pax_global_header00006660000000000000000000000064133474267270014531gustar00rootroot0000000000000052 comment=242bd8d896bc15ced4952a80aedbfa63e562e48d goxel-0.8.1/000077500000000000000000000000001334742672700126555ustar00rootroot00000000000000goxel-0.8.1/.gitattributes000066400000000000000000000000261334742672700155460ustar00rootroot00000000000000src/assets.inl binary goxel-0.8.1/.gitignore000066400000000000000000000001451334742672700146450ustar00rootroot00000000000000*.o *.swp *~ *.obj .sconsign.dblite /.sconf_temp /goxel /imgui.ini /config.log .DS_Store xcuserdata/ goxel-0.8.1/.travis.yml000066400000000000000000000022711334742672700147700ustar00rootroot00000000000000# Travis configuration for automatic build language: c++ matrix: include: # gcc disabled until I find a way to do something equivalent to # Wno-incompatible-pointer-types-discards-qualifiers with gcc 4.8 # - os: linux # sudo: required # dist: trusty # compiler: gcc - os: linux sudo: required dist: trusty compiler: clang - os: osx osx_image: xcode9.2 before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update; sudo apt-get install -y libgtk-3-dev mesa-common-dev libgl1-mesa-dev; wget https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip; fi install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unzip glfw-3.2.1.zip; cd glfw-3.2.1; cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON; make; sudo make install; cd ..; fi script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make release || travis_terminate 1; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd osx/goxel; xcodebuild build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO || travis_terminate 1; cd ../..; fi goxel-0.8.1/AUTHORS000066400000000000000000000007421334742672700137300ustar00rootroot00000000000000Goxel was created by: Guillaume Chereau Other contributors: Dustin Willis Webber Pablo Hugo Reda Othelarian (https://github.com/othelarian) Michał (https://github.com/YarlBoro) Goxel uses the font DejaVu (GPL-2+ licence): Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. DejaVu changes are in public domain. goxel-0.8.1/CONTRIBUTING.md000066400000000000000000000011701334742672700151050ustar00rootroot00000000000000# Contributing to Goxel ## CLA For the moment I ask every contributors to sign a CLA (contributor license agreement) document that gives me the right to relicense the code under any other license. To sign the CLA you can either get the pdf and send me the signed version by email, or contact me and I'll send you a link to a form that allows to sign it online. Link to the pdf: - For individuals: https://guillaumechereau.github.io/goxel/cla/goxel-cla-individual.pdf - For company: https://guillaumechereau.github.io/goxel/cla/goxel-cla-entity.pdf You can send the signed documents to guillaume@noctua-software.com. goxel-0.8.1/COPYING000066400000000000000000001045131334742672700137140ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, 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 them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state 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 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . goxel-0.8.1/INTERNALS.md000066400000000000000000000024451334742672700145430ustar00rootroot00000000000000 Small explanation of the internals of goxel code ================================================ The voxels data are stored as blocks of 16^3 voxels (`block_t`). The blocks implement a copy on write mechanism with references counting, so that it is very fast to copy blocks, the actual data (`block_data_t`) is copied only when we make change to a block. Several blocks together form a mesh (`mesh_t`), the meshes also use a copy on write mechanism to make copy basically free. An `image_t` contains several `layer_t`, which is basically a mesh plus a few attributes. The image also keeps snapshots of the layers at every changes for undo history (since we use copy on write on individual blocks, this does not require much memory). The basic function to operate on a mesh is `mesh_op`, we give it a `painter_t` pointer that defines the operation: shape, color, mode, etc. All the rendering functions are differed. The `render_xxx` calls just build a list of operations, that is executed when we call `render_render`. The assets are stored directly in the C code (`src/assets.inl`), a python script (`tools/create_assets`) takes care of generating this file. We can then use `assets_get` to retrieve them. The gui is using Ocornut imgui library, with a few custom widgets defined in `src/imgui_user.inl`. goxel-0.8.1/Makefile000066400000000000000000000032611334742672700143170ustar00rootroot00000000000000SHELL = bash .ONESHELL: all: scons -j 8 release: scons debug=0 profile: scons profile=1 run: ./goxel clean: scons -c # Make the doc using natualdocs. On debian, we only have an old version # of naturaldocs available, where it is not possible to exclude files by # pattern. I don't want to parse the C files (only the headers), so for # the moment I use a tmp file to copy the sources and remove the C files. # It's a bit ugly. .PHONY: doc doc: rm -rf /tmp/goxel_src cp -rf src /tmp/goxel_src find /tmp/goxel_src -name '*.c' | xargs rm mkdir -p doc ndconfig naturaldocs -i /tmp/goxel_src -o html doc -p ndconfig # Targets to install/uninstall goxel and its data files on unix system. PREFIX ?= /usr/local .PHONY: install install: install -Dm744 goxel $(DESTDIR)$(PREFIX)/bin/goxel for size in 16 24 32 48 64 128 256; do install -Dm644 data/icons/icon$${size}.png \ $$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/icons/hicolor/ \ $${size}x$${size}/apps/goxel.png) done install -Dm644 snap/gui/goxel.desktop \ $(DESTDIR)$(PREFIX)/share/applications/goxel.desktop install -Dm644 \ snap/gui/io.github.guillaumechereau.Goxel.appdata.xml \ $$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/metainfo/ \ io.github.guillaumechereau.Goxel.appdata.xml) .PHONY: uninstall uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/goxel for size in 16 24 32 48 64 128 256; do \ rm -f $$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/icons/hicolor/ \ $${size}x$${size}/apps/goxel.png) done rm -f $(DESTDIR)$(PREFIX)/share/applications/goxel.desktop rm -f $$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/metainfo/ \ io.github.guillaumechereau.Goxel.appdata.xml) goxel-0.8.1/README.md000066400000000000000000000044621334742672700141420ustar00rootroot00000000000000 Goxel ===== Version 0.8.0 By Guillaume Chereau [![Build Status]( https://travis-ci.org/guillaumechereau/goxel.svg?branch=master)]( https://travis-ci.org/guillaumechereau/goxel) [![Snap Status](https://build.snapcraft.io/badge/guillaumechereau/goxel.svg)](https://build.snapcraft.io/user/guillaumechereau/goxel) [![DebianBadge](https://badges.debian.net/badges/debian/unstable/goxel/version.svg)](https://packages.debian.org/unstable/goxel) Webpage: https://guillaumechereau.github.io/goxel Online Procedural Rendering: https://voxeltoy.com About ----- You can use goxel to create voxel graphics (3D images formed of cubes). It works on Linux, BSD, Windows and macOS. Download -------- The last release files can be downloaded from [there]( https://github.com/guillaumechereau/goxel/releases/latest). There is also in iOS version on [iTunes]( https://itunes.apple.com/us/app/goxel-3d-voxel-editor/id1259097826). ![goxel screenshot 0](https://guillaumechereau.github.io/goxel/images/screenshots/laser.png) ![goxel screenshot 1](https://guillaumechereau.github.io/goxel/images/screenshots/palettes.png) ![goxel screenshot 2](https://guillaumechereau.github.io/goxel/images/screenshots/selection.png) Licence ------- Goxel is released under the GPL3 licence. Features -------- - 24 bits RGB colors. - Unlimited scene size. - Unlimited undo buffer. - Layers. - Marching Cube rendering. - Procedural rendering. - Export to obj, pyl, png, magica voxel, qubicle. - Ray tracing. Usage ----- - Left click: apply selected tool operation. - Middle click: rotate the view. - right click: pan the view. - Left/Right arrow: rotate the view. - Mouse wheel: zoom in and out. Building -------- The building system uses scons. You can compile in debug with 'scons', and in release with 'scons debug=0'. On Windows, I only tried to build with msys2. The code is in C99, using some gnu extensions, so it does not compile with msvc. # Linux/BSD Install dependencies: scons pkg-config libglfw3-dev libgtk-3-dev Then to build: make release # Windows You need to install msys2 mingw, and the following packages: pacman -S mingw-w64-x86_64-gcc pacman -S mingw-w64-x86_64-glfw pacman -S mingw-w64-x86_64-libtre-git pacman -S scons pacman -S make Then to build: make release goxel-0.8.1/SConstruct000066400000000000000000000140361334742672700147130ustar00rootroot00000000000000# Goxel 3D voxels editor # # copyright (c) 2018 Guillaume Chereau # # Goxel 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. # # Goxel 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 # goxel. If not, see . import glob import os import sys target_os = str(Platform()) debug = int(ARGUMENTS.get('debug', 1)) profile = int(ARGUMENTS.get('profile', 0)) werror = int(ARGUMENTS.get("werror", 1)) clang = int(ARGUMENTS.get("clang", 0)) argp_standalone = int(ARGUMENTS.get("argp_standalone", 0)) cycles = int(ARGUMENTS.get('cycles', 1)) sound = False if os.environ.get('CC') == 'clang': clang = 1 if profile: debug = 0 env = Environment(ENV = os.environ) conf = env.Configure() if clang: env.Replace(CC='clang', CXX='clang++') # Asan & Ubsan (need to come first). # Cycles doesn't like libasan with clang, so we only use it on # C code with clang. if debug and target_os == 'posix': if not clang: env.Append(CCFLAGS=['-fsanitize=address', '-fsanitize=undefined'], LINKFLAGS=['-fsanitize=address', '-fsanitize=undefined'], LIBS=['asan', 'ubsan']) else: env.Append(CFLAGS=['-fsanitize=address', '-fsanitize=undefined'], LINKFLAGS=['-fsanitize=address', '-fsanitize=undefined']) # Global compilation flags. # CCFLAGS : C and C++ # CFLAGS : only C # CXXFLAGS : only C++ env.Append( CFLAGS=['-std=gnu99', '-Wall', '-Wno-unknow-pragma', '-Wno-unknown-warning-option'], CXXFLAGS=['-std=gnu++11', '-Wall', '-Wno-narrowing'] ) if werror: env.Append(CCFLAGS='-Werror') if debug: env.Append(CCFLAGS=['-O1']) if env['CC'] == 'gcc': env.Append(CCFLAGS='-Og') else: env.Append(CCFLAGS=['-O3', '-DNDEBUG']) if env['CC'] == 'gcc': env.Append(CFLAGS='-Ofast', CXXFLAGS='-Ofast') if profile or debug: env.Append(CCFLAGS='-g') env.Append(CPPPATH=['src']) sources = glob.glob('src/*.c') + glob.glob('src/*.cpp') + \ glob.glob('src/formats/*.c') + \ glob.glob('src/tools/*.c') # Check for libpng. if conf.CheckLibWithHeader('libpng', 'png.h', 'c'): env.Append(CCFLAGS='-DHAVE_LIBPNG=1') # Linux compilation support. if target_os == 'posix': env.Append(LIBS=['GL', 'm', 'z']) if not conf.CheckDeclaration('__GLIBC__', includes='#include '): env.Append(LIBS=['argp']) # Note: add '--static' to link with all the libs needed by glfw3. env.ParseConfig('pkg-config --libs glfw3') env.ParseConfig('pkg-config --cflags --libs gtk+-3.0') # Windows compilation support. if target_os == 'msys': env.Append(CCFLAGS='-DNO_ARGP') env.Append(CXXFLAGS=['-Wno-attributes', '-Wno-unused-variable', '-DFREE_WINDOWS']) env.Append(LIBS=['glfw3', 'opengl32', 'Imm32', 'gdi32', 'Comdlg32', 'z', 'tre', 'intl', 'iconv'], LINKFLAGS='--static') sources += glob.glob('ext_src/glew/glew.c') env.Append(CPPPATH=['ext_src/glew']) env.Append(CCFLAGS='-DGLEW_STATIC') # OSX Compilation support. if target_os == 'darwin': sources += glob.glob('src/*.m') env.Append(FRAMEWORKS=['OpenGL', 'Cocoa']) env.Append(LIBS=['m', 'z', 'argp', 'glfw3', 'objc']) # Add external libs. env.Append(CPPPATH=['ext_src/uthash']) env.Append(CPPPATH=['ext_src/stb']) env.Append(CPPPATH=['ext_src/noc']) sources += glob.glob('ext_src/inih/*.c') env.Append(CPPPATH=['ext_src/inih']) env.Append(CFLAGS='-DINI_HANDLER_LINENO=1') if sound: env.Append(LIBS='openal') env.Append(CCFLAGS='-DSOUND=1') if argp_standalone: env.Append(LIBS='argp') # Cycles rendering support. if cycles: sources += glob.glob('ext_src/cycles/src/util/*.cpp') sources = [x for x in sources if not x.endswith('util_view.cpp')] sources += glob.glob('ext_src/cycles/src/bvh/*.cpp') sources += glob.glob('ext_src/cycles/src/render/*.cpp') sources += glob.glob('ext_src/cycles/src/graph/*.cpp') sources = [x for x in sources if not x.endswith('node_xml.cpp')] sources += glob.glob('ext_src/cycles/src/device/device.cpp') sources += glob.glob('ext_src/cycles/src/device/device_cpu.cpp') sources += glob.glob('ext_src/cycles/src/device/device_memory.cpp') sources += glob.glob('ext_src/cycles/src/device/device_denoising.cpp') sources += glob.glob('ext_src/cycles/src/device/device_split_kernel.cpp') sources += glob.glob('ext_src/cycles/src/device/device_task.cpp') sources += glob.glob('ext_src/cycles/src/kernel/kernels/cpu/*.cpp') sources += glob.glob('ext_src/cycles/src/subd/*.cpp') env.Append(CPPPATH=['ext_src/cycles/src']) env.Append(CPPPATH=['ext_src/cycles/third_party/atomic']) env.Append(CPPFLAGS=[ '-DCYCLES_STD_UNORDERED_MAP', '-DCCL_NAMESPACE_BEGIN=namespace ccl {', '-DCCL_NAMESPACE_END=}', '-DWITH_CUDA_DYNLOAD', '-DWITHOUT_OPENIMAGEIO', '-DWITH_GLEW_MX', '-DWITH_CYCLES', ]) # Try to improve compilation speed on linux. if not clang: env.Append(CPPFLAGS='-fno-var-tracking-assignments') # Seems to fix a crash on windows and i386 targets! env.Append(CXXFLAGS='-msse2 -fno-tree-slp-vectorize') if target_os == 'msys': env.Append(CXXFLAGS='-O3') env.Append(CPPFLAGS=['-Wno-sign-compare', '-Wno-strict-aliasing', '-Wno-uninitialized']) if clang: env.Append(CPPFLAGS=['-Wno-overloaded-virtual']) # Append external environment flags env.Append( CFLAGS=os.environ.get("CFLAGS", "").split(), CXXFLAGS=os.environ.get("CXXFLAGS", "").split(), LINKFLAGS=os.environ.get("LDFLAGS", "").split() ) env.Program(target='goxel', source=sources) goxel-0.8.1/data/000077500000000000000000000000001334742672700135665ustar00rootroot00000000000000goxel-0.8.1/data/fonts/000077500000000000000000000000001334742672700147175ustar00rootroot00000000000000goxel-0.8.1/data/fonts/DejaVuSans-light.ttf000066400000000000000000001357501334742672700205610ustar00rootroot000000000000000FFTMo9<GDEF&(GPOSvyl$GSUBtMATHXOS/2Y,Vcmap rUcvt z} pfpgmq4vj\gasp glyf??@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\_]`^, %Id@QX Y!-,%Id@QX Y!-,  P y PXY%%# P y PXY%-,KPX EDY!-,%E`D-,KSX%%EDY!!-,ED-,%%I%%I` ch #:e:-@%2%%A:B2SAS//2ݖ}ٻ֊A}G}G͖2ƅ%]%]@@%d%d%A2dA  d   A(]%]@%..%A  %d%@~}}~}}|d{T{%zyxw v utsrqponl!kjBjSih}gBfedcba:`^ ][ZYX YX WW2VUTUBTSSRQJQP ONMNMLKJKJIJI IH GFEDC-CBAK@?>=>=<=<; <@; :987876765 65 43 21 21 0/ 0 / .- .- ,2+*%+d*)*%)('%(A'%&% &% $#"!! d d BBBdB-B}d       -d@--d++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++5fqu-J3T99NR7s`s3VV9s3D{o{RoHT3fs +b-{T#\q#H99`#fy```{w``b{{Rffw;{J/}oo5jo{-{T7fD)fsD,,,,^@tPz(`T~.  R ~ T  :  L& |Zn.z06.j \DVh*vZ  N ! DdU./<2<2/<2<23!%!!D $hUD5 5@ K TX8Y<2991/0 P ]%3#3#5qeB@KTKT[X8Y1<20@0 @ P ` p ]#!#o$++`@1      91/<<<<<<<2220@   ]!! !3!!!!#!#!5!!5!T%Dh$ig8R>hggh`TifaabbNm!(/@U" '&( /)/))/B" ) *!#*- ) " & 0K TX8YK TKT[KT[X@8Y<<<1/299990KSX99Y"#.'5.546753.'>54&dijfod]SS\dtzq{---@A$*.U# jXV`OnZXhq) #'3@6$%&%&'$'B .$ &($4'!%   ! + 1 4K TK T[K T[KT[KT[K T[X18Y9912<0KSXY""32654&'2#"&546"32654&%3#2#"&546WccWUccUVcbWWcd1Zܻۻa ۻۼ 0@      !         B  (('+'$ .  .'.'!!199999991/9990KSX99999999Y"2]@ " ) **&:4D ^YZ UZZY0g{ "-  ' (   2'') #**(/2; 49?2J LKFO2VZ Y UY\_2j i`2uy z 2229]]3267 >73#'#"5467.54632.#"[UԠ_I{;B h]hΆ02޸SUWDi;#QX?@Yr~YW׀c?}<$$/1oX3go7@ KTKT[X8Y10@ @P`p]#o+{ 7@  KTX 8YKTX @8Y29910#&547{>;o @ <99103#654<:=JN@,       <2<2991<22990 %#'-73%g:r:g:PrPbybcy #@   <<1/<<0!!#!5!-Ө-Ӫ--@ 1073#ӤR@d10!!d1/073#B-@B/9910KSXY"3#m #@  10"32'2#"  P3343ssyzZ @@B  KTX@8Y1/20KSXY"]7!5%3!!JeJsHHժJ@'B   KTKT[KT[X8Y91/20KSX9Y"@2UVVzzvtvust]]%!!567>54&#"5>32Ls3aM_xzXE[w:mIwBC12\ps(p@.    #)&  )KTKT[X 8Y99190@ daa d!]!"&'532654&+532654&#"5>32?^jTmǹSrsY %Đ%%12wps{$& Ѳ|d @   B    K TK T[X 8Y<291/<290KSXY"@* *HYiw+&+6NO O Vfuz ]] !33##!55^%3`d^@#    KTKT[X8YKTX@8Y190!!>32!"&'532654&#",X,$^hZkʭQTժ 10$& $X@$  "% " !%190@]]"32654&.#">32# !2 LL;kPL;y$&W]ybhc@B991/0KSXY"KTX@878Y@X9Hg]]!#!3V+ #/C@% '-'0 $*$ !0991990"32654&%.54$32#"$54632654&#"HŚV г "Əُattt$X@# %!"" %190@]]7532#"543 !"&2654&#"LK:lL>$& V\s[#@<21/073#3##^M@*B$#29190KSXY" 5Ѧ`@ #<210!!!!^O@+B$#<9190KSXY"55//m$e@+$     &%K TX8Y99991/9990y z z ]%3##546?>54&#"5>32ſ8ZZ93lOa^gHZX/'eVY5^1YnFC98ŸLVV/5<4q L@2  L4307$7CM34( (+(I+*(I,=M<9912990K TK T[KT[KT[KT[XMMM@878Y@ NN/N?N]32654&#"#"&5463253>54&'&$#"3267#"$'&5476$32|{zy!orqp ˘s'6@   0210].# !267# !2'ffjzSb_^^_HHghG.@   2 99991/0`]3 !%! )5BhPa/w.,~ .@   21/0 ]!!!!!!9>ժF# )@ 21/0 ]!!!!#ZpPժH7s9@ 43 1990%!5!# !2.# !26uu^opkSUmnHF_`%; ,@ 8  221/<20P ]3!3#!#"d+9.KTX@8Y1/0@ 0@P`]3#+f B@  9 KTX@8Y991990@ 0 @ P ` ]3+53265M?nj @(B  291/<290KSXY"]@ ((764GFCUgvw    (+*66650 A@E@@@ b`hgwp  ,]q]q3! !#3wH1j%@ :1/0@ 0P]3!!_ժ @4  B    >  91/<290KSXY"p]@V   && & 45 i|{y   #,'( 4<VY ej vy ]]! !###-}-+3 y@B6 991/<2990KSXY" ]@068HGif FIWXeiy ]]!3!#j+s #@  310"32' ! ':xyLHH[[bb:@   ? 291/0@ ?_]32654&#%!2+#8/ϒs R@*  B     39991990KSX9Y""32#'# ! '? !#y;:xLHHab[T@5  B    ?  299991/<9990KSX9Y"@]@Bz%%%&'&&& 66FFhuuw]]#.+#! 32654&#A{>ٿJx~hb؍O'~@<    B %( "-"(9999190KSX99Y")])/)O)].#"!"&'532654&/.54$32Hs_wzj{r{i76vce+ٶ0/EF~n|-&J@@@1/20K TX@878Y@  @ p ]!!#!ժ+)@@   8AKTX8Y1299990]332653! ˮ®u\*$h@'B91/290KSXY"P]@b*GGZ} *&&))% 833<<7HEEIIGYVfiizvvyyu)]]!3 3J+D {@I      B     91/<2290KSXY"]@  ($ >>4 0 LMB @ Yjkg ` {|      !   # $ %  <:5306 9 ? 0FFJ@E@BBB@@ D M @@XVY Pfgab```d d d wv{xwtyywpx   []]3 3 3# #D:9:9+=; f@  1 ]@ /<20KBPX@   @    Y3 3 # #su \Y+3{@(B@@ 91/290KSXY" ]@<5000F@@@QQQe &)78@ ghxp ]]3 3#f9\ @BB K TK T[X8Y991/0KSXY"@@ )&8HGH    / 59? GJO UYfio wx ]]!!!5!sP=g՚oX;@CK TX@8YKTKT[X8Y210!#3!Xo0@CKTKT[X@8Y<10!53#5oXޏ@ 91290 # #HHu-10!5{-{ %@'   #   E&22991/9990@n0000 0!0"?'@@@@ @!@"PPPP P!P"P'p' !"'''000 0!@@@ @!PPP P!``` `!ppp p! !]]"326=7#5#"&5463!54&#"5>32߬o?`TeZ3f{bsٴ)Lfa..'' 8@  G F221/0`]4&#"326>32#"&'#3姒:{{:/Rdaadq{?@  HE210@ ].#"3267#"!2NPƳPNM]-U5++++$$>:#qZ8@G E221/0`]3#5#"3232654&#":||ǧ^daDDaq{p@$   KE9190@)?p?????,// , ooooo ]q]!3267# 32.#" ͷjbck)^Z44*,8 Cė/Y@     LK TX @8YKTX 8Y<<991/22990@P]#"!!##535463cM/ѹPhc/яNqVZ{ (J@#  &#' & G E)221/990`***]4&#"326!"&'5326=#"3253aQQR9||9=,*[cb::bcd4@  N  F21/<90`]#4&#"#3>32d||Bu\edy+@F<21/0@  @ P ` p ]3#3#`Vy D@   O  F<2991990@ @P`p]3+532653#F1iL`a( @)B F 291/<90KSXY" ]@_ ')+Vfgsw    ('(++@ h` ]q]33 ##%kǹi#y"F1/0@ @P`p]3#{"Z@&   PPF#291/<<<290@0$P$p$$$$$$$ ]>32#4&#"#4&#"#3>32)Erurw?yz|v\`gb|d{6@  N  F21/<90`]#4&#"#3>32d||Bu\`edqu{ J@  QE10@#?{{   {  {]"32654&'2#"s98V{>@ GF2210@ `]%#3>32#"&4&#"326s:{{8 daaqVZ{ >@   GE2210@ `]32654&#"#"3253#/s:||:/daDDadJ{0@    F21/90P].#"#3>32JI,:.˾`fco{'@<  S  SB %( R"E(9999190KSX99Y"']@m   . , , , ; ; ; ; $( ( *//*(() )!$'      '/)?)_))))))]]q.#"#"&'532654&/.54632NZb?ĥZlfae@f?((TT@I!*##55YQKP%$78@  F<<2991/<2990]!!;#"&5#53w{KsբN`>X{;@    NF921/290o]332653#5#"&||Cua{fc=`@'BK TX@8YKTKT[X8Y91/290KSXY"@Hj{  &&)) 55::0FFIIFH@VVYYPffiigh`ut{{uz>]]3 3#=^^\`TV5` @IU U U U   B     K TKT[KT[KT[K T[X@8YK TK T[KT[X8Y91/<2290KSXY"@" 5 IIF @ [[U P nnf yy          %%#'!%""%' $ ! # 9669 0FHF@B@@@D D D @@VVVPQRRPS T U cdejejjjn a g ouuy}x}zzxy  { v } @/   y]]333# #V`jjj;y` C@F      B   K TKT[KT[KT[X@8YKTX8Y91/<290KSXY"@   & =1 UWX f vzvt        )&% * :9746 9 0 IFE J @ YVYYWVYVV Y P o x  /]] # # 3 dkr))`HJq=V`@C        B     K TKT[X @8YKTX 8Y9129990KSX2Y"@     # 5 I O N Z Z j        '$$  )( % $ $ ' ** 755008 6 6 8 990A@@@@@@@@B E G II@TQQUPPVUVW W U U YYPffh ii`{xx   e]]+5326?3 3N|lLT3!;^^hzHTNlX` @B K TK T[X8YKTX@8Y2991/0KSXY"@B&GI  + 690 @@E@@CWY_ ``f``b ]]!!!5!qjL}e`ۓ%$w@4 %   !  % $  C %K TX@8Y<<29999999199999990&]#"&=4&+5326=46;#"3>l==k>DV[noZVtsݓXX$@6%   #%#C %K TX8YKTX@8Y<2<9999999199999990&]326=467.=4&+532;#"+FUZooZUF?l>>l?VWstݔ/IC@&=>:A$104G$ 7aD=0^* D^ J21/02#"$'&5476$"3267>54&'..#"3267#"&54632mmllmmmmllmm^^``^^⃄^]]^\^BB@zBCFInmmmmnnmmmmng^^^傁^^__^]⃅]^^! "b+/10K TKT[X@878Y!!Vu=  @  Z[Z10"32654&'2#"&546PnnPPnoO@v+..ooPOmmOOp1.-rB .@     <2<21/<<0!!#!5!!!-Ө-}}!$   7 !$ !$!$!!$p @ 104767632#"'&'&pihѵhiihҵhiѶiiiiѶiiii>2   : `   (Z4;b ;; 0    " F m " : %: h: ; ;Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain DejaVu SansDejaVu SansBookBookDejaVu SansDejaVu SansDejaVu SansDejaVu SansVersion 2.35Version 2.35DejaVuSansDejaVuSansDejaVu fonts teamDejaVu fonts teamhttp://dejavu.sourceforge.nethttp://dejavu.sourceforge.netFonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.http://dejavu.sourceforge.net/wiki/index.php/Licensehttp://dejavu.sourceforge.net/wiki/index.php/LicenseDejaVu SansDejaVu SansBookBook~Zh  !"#$%&'()*+,-./0123456789:;<=>@ABDEFGHIJKLMNOPQRSTUVWXYZ[\]^`triagupuni25B4uni25B6triagdnuni25BEuni25C0H18533 g DFLTzarabarmnbraicanschercyrlgeorgrekhanihebrkanalao (latn4mathpnko |ogamrunrtfngthaiKUR SND URD MKD SRB 4ISM 4KSM 4LSM 4MOL 4NSM 4ROM 4SKS 4SSM 4 RQDccmp ccmp&ccmp. " 2n <~D"V&R~IJ#<BBDDFFHHIJKLTT&4&4&4&4&4&&&&& DFLTzarabarmnbraicanschercyrlgeorgrekhanihebrkanalao (latn4mathpnko |ogamrunrtfngthaiKUR SND URD MKD SRB 4ISM 4KSM 4LSM 4MOL 4NSM 4ROM 4SKS 4SSM 4kernkern""d!0!5PKr9KD &&K9a}au9aauaau/&DaDDkkDDDDkDD)ak}/DDa9}D}&&9}k}k}&D aDY}aaauNaaau}}k}ka aakkAk&k}}DHVaD)kkDN9a}au9aau/9a}au9aau/9a}au9aau/&kD&9a}au9aau/9a}a9aa/D?}DVD aDKr9KD &&Kk}k&/<&J  !J      !"#$%& #&(*,.1< EFKKNORRVY4$,=}} P< ```h`UvZZZZZZZZrZZ8<( $(,048<$Dd "8( u(( ( ( u(( ( ( u(( ( q( f(( ~( q( r(( (( (( ( ( r(( (( (( ( ((@((@((^(V^(V =>[\@^goxel-0.8.1/data/icons/000077500000000000000000000000001334742672700147015ustar00rootroot00000000000000goxel-0.8.1/data/icons/icon128.png000066400000000000000000000246041334742672700166000ustar00rootroot00000000000000PNG  IHDR>a)KIDATx}ydWyZz].d&,!o`C Nr/矜c$qv,ab0aI6, kUo˗?{U]3]3#\95]}~.0c1c1c1c1c1c1cp]4 9;u_dRѥK[^{¥Я[={0A\elV 櫧5۾l"p]g2|e& 8ws"; TItLƍvsY{TxIG>`Or BZm)O8lrGz Y{wSn1.]&'eC*\ bwbE.A-$j>r}o?(N| RAa8sqT}?tR%?Xg8npovq]%oa!~q}\xs>xoxp bU)OYU/?NHˎOn[nam jj 97@0F0ExA L82:_ɸ9fg~`F/S\Vx˧8-_~qv-l &KGX>08}$/"i "3.\\_O+dNZ[GԑOeAS :O /)Ν 10ZmB"V$v2l np< @D0*R0M;ސwNZIUJX=<{HKN~+; axW0? H+@j!#/@%mCFMp ;> 7%D"--AT[kIm7>KIqvKKF>mwq'Wob\l>&d <bh!^\`w<8n\i\ *d2 zJNI_a%V*\ {? ZoF%h!j,AF+@+ "Ȩ.܍ \p (DP-c$ɆSI %Áe+uJJ 7w]O9^uqgeUFX1H>$) )は" .u10VPIZ {I w/Q?|9xϫb?q&~1>MFa~+FCF $a F%Ct]2 J/W@* U !ƺĠks<^`m1o-j-C57kk* @MQ &[ #hT^Da kۂ%B>R( [H*ljR0Fތ![IsK8"l+D3Xjwэ,!$"/@`|KB^hVN5t4*ѪFNLӻoA~rpW"3$t…_E0 #n-]_DZ7[xȑa[ k)"r0c \xµ!D2@dg0Q[V~qX.'6Q^xarNpuiսu/AqnPQRmV/ k,NB0!켼Nױx TXy5,?fx>L܈b 8N}YQwgxAy$ 3^sۃxX%soey { s`O֡uFvgQ>0n*BvI9LN_5h#1'a>rroԅ̗鳟y7^P"PkD`#("?^PB~jsh,UF/hJmTAeYhaks0cH[ XYJWcjUd pjpV8q1",w 3$[0Gaf?r]Zejk]Sch7ϡQ=c0.ax,Ft#@ X(-\ƟF~rD9DdcRbGN"]E֠eI^H/& xs#w<'w#(ar tIgaӶ8Xqf-QuI[ܮW#?Y9 8Yкb c dLBj%q m+j\pCTVe\6ORahmP"D΁˽C8 v]㘹V‹O,L:祢4S C{}fe.2m?`j嘚6.uA H5f%Q pIm%M8Z5j}9q$!# 4&ɜ1/(aǕczͨ/ѯaa$6zVd"#Yb A0WPػ(čeDw1y@}ƶ?,T%.8%B)$LDH%ᚼu};pX0mȀDЖe8Nӳ7cnve 8w:B-E@2Q! 0d[|mögi2+DdXdA|YI ppa7󥝘u#0qٯt]^Faz?v&goXk2T! kK6ch-jisb1 @l;Ȩ 1heD\xPIhWdP`wLM.gĵ}X<8#-<A7 P܇+{ &mH#aTw!UF*C뤓DFg#P q4Sqe{,=l 1"YFS'\/%Cxs"0xy`1./ƁW {O}{OC&]Op͸֟Cˮ!.\֐qa}IXIw]h,YD}(|VW*C_x1 nʜwFCmAJk:mXx3Mۚ{o;z*gշ¾ٙqhJ5+=^wľIؘ8`Tҳ* }Z7(m;Kytj;gܻ&`~fKǿ%w;t ؑ$w=Fw0%CAv `\@X-6XooM8"(6Bw& &dhWd+Q /h4$YϞҎVijf@A& TA^1 D] m'@+ö͌ ϹiJ>4Jn^/=V4!n&6J!(N#(rPJ1VklщlԛVI*FZDedҴfg 8ۆm' GMsmκ^l@g4d c ZiDm G4WNr*iF0݀V ^nAa+BZ$ uS@3Fub_)ĢcLJNz4nEabvy@"ί@H"@ru %5ⶄ'NhGX_퇷 cmhm"CUlУWJԫЬJ{foDLlq9ra}eW܍U/@DRēU;Zth(QJxnp 1?aR$zXL_7νҕ߰5~GN%!ݹv1=D3Jݔ?]eFIҼŴӳџ':>tբs+#%p 1t!|0d;_1y;I;4<x<[Kp_xw:Ak]ȴv(H狑1¦^%W8T =_1i\I`a*פzJZX.SA lRNt~/ 2)Bf)`3z3qߡupW?}ם'd$F@bt:b L(/>zkPZ(td:dH*|+qƻeehJXI!\oLco2#\&'? 6<) X@1 kl~zJGXgU!Fq*ɯVy_ə ,V- [ X<-zbNSWpaG\8+,ܯ^#s7Wꅇ47#!C~۹ jգh6Ncb*ZLL]ݿ$k]3F8BV;~2 9D'VPYy_&W5F7'xHJA%J_`Nkɹw-.B\%\Hon! h C-ZǨRr*iKWPY;^ 7YjDu9,= )AݶV{Jd`t%4R`iR6; @N`$V*GP'BG /U&M,j壝!Fͳ h 奧1՘u TwP^*^t:f9t| N@x} Vݫ1Pq&LR6 Ŵی j @ۋX8wh7Vb+'FGakg?PY6}(l&$`B 6BZ70D cMW'3yINH"9eDhTarzj/"* l/A>Ҧ6fLMER 1p.9v}\^S &:׃RVFuKH!ŚP NX]lϪi658^vG`@Zu%:)x>#l2$ZET [բ{ 2n[q3b *I`w}u.qnv>U +ysai *_`VzE}l3WoO{L=FC:]ą |{2'7y 1bR#b[I%zkl6\zF 0aHI$[(j(;斍6 t ^7i8`.8Hf%W>ΊYfNBCyMI"ؚRo-f"Y1.T `CHݰqZ`pnH =7K0%S (ݮApKױVMsB.CI g[L`Q= :}t;:BV0Q+Z:h I>oDbY:J:<. M SOM>\X2$$" 8-Dq )7m I%1NhQ;7`U.{Xp#S@`ƀcn:\i绩tQ! Amw*Qm_0&! F,.3\gy%QuLO.ak/x=@G[7 nh`=޻ͬ}La hSGw7'(e'0|[ Kneׯt$@oj|1FHULy@qCXȐtʓut>Ҵp Y Ȍ~W0i._K0Sm{Y\udjWTgνh1/ILbt;֓Lu^"0љHz7l.YpVhaAC"MXFDB:W'r׳;1։fɞR$IlwI%}.` C/ n`d?s+MJ m7wXM˖2r 2 -+ܾ·1[tY0h3 "Cd1lΡtr8^PԖ:cBpO UZuC %dmyUb֝uM/Mֱ>CevƧ%8YNnd^"5Lo:π.zpSVm \aZ1^n{ݪEJBSb L↝yp|9™ZD0guݭCӚ:p ]YL:D0s8~Vg{a$D*lU"]ߖgG'S%@{*nWJ3\A1x}oxtĪz7 :I51S R-IdAU-WjdVY\Tb=t`t$|V\}>kPi^K`%|6fHZX+(-85@ˠ;a٢3' ZْZk}:6<:9 ZMz6suP\Qv WB2i!͈k:DޖmFJ$JT0+}S53uHe:D s7 CX4bk* ALtm1p q0c M+WK-Iޞ=3"T/5D&P-p5[) mҥfu, 8n`o[x%J[C t ݽAz­ F-$J#FpsDW'`ؽKccq "unZ{&&Fߵͯ+5sW pnS9-Sy(`&@!U=&uv9frsxDŽ0&rA."@ [L,6X׿?ѝ/'zWM)¹ɚD+N~ @T[ [%[m9f4`. s9AX  &:]:\0$h͍ZRJ?"[{ w8:7+}RC0շ.9-]d=ـ~wyij8Z-}?z$ۙGng]rz0qGw(n oB`0vg2Ɩ?=6UOZ&d=1)7KGnޖőpUsrt]7s]0TGC>Eqp`13[O& u8.#!P mN"HT[K ȊD؟Z uS,hߒ>|XM7j3]7/csl7:E:I߮;(w[73bc90S2#@' .XiɎK\Qr0Z+(%Ds98q B!Ŗ|Sh eBzc䃏(r Hxqg6Sjf*2F$O7ʖ p]}=RݾW5A@z^7g1-E tWN ]c(K\B?1t}4cH0FZ^>wnmRqm{pq?K4DQN2H?[\j:$&\BarϹ?#@P(8YԖqE^"Z)UHyKׅp8w/JI,; )nLֱBee{gYbMnY ?x3NdU>euo__|72}nc|cA>X+,/0F3DUN) 829l/bG/TWc?W[m;'}tw<`BT[*jttO=eE yǦۋ=~.w ΢Y \A.S:}:Kf Ig[Ƈ翆 \~dPq/QrO'GeI콿v{|?8J*h ql7\;119A.7# }$Hˋ 鮡QEO7{K=[l Josn+~O/p8t=Raɩ@FZJ$n5_l7+ g0QP(AQ8+KYn>aZk_v~/mdq áCtXD˽u݁UH Ibj6V_>ڙORavb _x^r(//Cq>٨V>_S]_tdL1?GΪtH8n7P?/2[v sBp[-,-RQ7ᇨ ,=qUqf}b:r{ $qYo|&,ǿm=N^UįVAO,k_.6^8xMMd\6&`YT+F;gydzt]-RCRʹS^_F/idϻ3PX޸8p̿ ,|e|mz1CA ᄍl4jÏrQ41./3c1c1c1c1c1c1c18&\IENDB`goxel-0.8.1/data/icons/icon16.png000066400000000000000000000012561334742672700165120ustar00rootroot00000000000000PNG  IHDRauIDATxkSaƟ|Ӝ1)mvAtt JqpSDDpPq pq$(TtQZRJmM/19\rs؂> }x9tU[Ì3݉䯀;U]09E2Sԫޑ!@[oeP{( _B?ל\_x<I$^ۮ UEm#DERJJA{Gύ/l3 B:?3$QD3Z~?W PSyEVe'1?i-O<IfO@Sp+_`K΢X] \n~iAJVZ2BφBNgSTR%1;e`Y;Q5wxu0F` I7 e~+'쪐KmMVJEBA@(bAoGpZVWC170ĝDA@y A!E~2ϮP}&OeVdJM}a2i X172<,nj7;jYsj|xrtLR)9'srԡ_ /m_IENDB`goxel-0.8.1/data/icons/icon24.png000066400000000000000000000022041334742672700165030ustar00rootroot00000000000000PNG  IHDRw=KIDATx[UUk}>\38VjcVdHԓC[Ey*!ނ(c/ݜ@RQ42s.zvΜ>`88=E~|E,J{if͆ti1<_LL$T.&0|O—\ǞpС/ڹ}71En}kB4 0m-E^BE㧎??@]b<:Nh(~ܫ#T)+'JĎ~G~g߾[m ' ccZ^{PQ5vžHA+ f)ff{8M0jTƁVoX#CKn*S'Q).l!U8{g|&n8-`4X* C $rM@Cvt~\+yq#׿1V*㰬"܅d-A}~$!`4aBČCl^+! D/"=JAT@)bׂKgI)-dsUD*cJ(5@KB@@R 6@d̡* _NoUep=X0  ,[cA+ °24L 2*Q"zhM94jx5݊ 5(3`,YaQT,T ?7NJgkm輻M/z-4kq!r((I?:U&ojW,+}؏I?(ʵ ~my%sIT&=ܶkRՅʕdh`#Qx r\֪:vU*VӘC IENDB`goxel-0.8.1/data/icons/icon256.png000066400000000000000000000607231334742672700166040ustar00rootroot00000000000000PNG  IHDR\rfaIDATxydW}&XsM,h ؍lWŲoݶnhgzO=c{zfi/2㥍X$*T[n2^ȌǪ̏z*#cyラo2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C @zaq?k-.JkF念*z W ]jӧA3!#}S]-u3S~䣿cM5οQMC%gCAVp #)˹V<׮|*t6<ǚ齿sڅ2ң'T>)xkTNA ?]j> ad0%|w7sGʕު%ГoUNIGngwjO]zϟ 7V_NM]'dZ& Of8z}B00ϡ_Ӡ^晿|:z]'h^A+ 5d0A͂S__ɴAF>F:џ73GlaR@0_^wj_;}/ZӏWbGt3w#զf0")BU /zOڧO~, 12^,!)n4cNP-A5^ Zx\[S<@0s'qnm<u62##1p)mKGr~@3!R/x9X{>(,fn"T o+hәfZR/ _ 柇ы/fZAF#B)w]E5#;hWΣ"N[`a8eX9h r.!@>ڇ" A5_Onς'?SOʰ=2'O>j,rKۨn-^vV~ (,C-hpЌ HBʽkT3`:efu2FZ V5tk_'XVpp`<ǜ/a&H)j]CЮTBĴ8P B#_-t :D؍p7 ,h#p|&4̴ $SNi/i~X3TzJBSU>S?=!"@`Xyon0 u0ylL+;x8g{]݀"M2y$LD+UU إ}]!ň%]M{b~Ŵt!K|N k&BFtw{)%$!84q T% *G_Й? (T_w2pmsqHq g?gX꦳L*/J0=D0 KhwGY# ~9Ǩe\pjf0s0LU xGd 对CkT_?yY\/T]vʶՌHUޝd}ןРS hR@xr@֔y5=^V0{hfnݻb'x~h<訒`] #JR2mBBjLGu.̋2 JЃ߮"*R:/0e`f uRr _n9G ."?A3@M-^ ط]GzݍɫRЈ$IpvRBL&xMUW᷒"iY80SݩR@2IXð+$*7돡)IRoj__6töiRu 9{PU{gHnoU} hV_D\(Kw0 LuLP{$z#% 9dd͜t̃"knW^W?1bkơ%SNiG&;WW6/~@U]ܨ#_ygxXeUXkϠtJw-xB? tO!zx j@7hM7Э2X]äy "lէta3CKX|,?w)S %BJvfG^o 4k"ڤT_ s`ː/Nz)$dԿCU)!%R&UKU[4Ԕ' Yؘ0- [.Ter)O!ۚ*pE*~i!RrPYy ~gska:TM4/ WGCqVV1}L%.1s=ɔV02x&*=2I۽ORʶMs¡%<蒐6XHTb_=-Asm{#y~ ;\}o1o'GsKK[~/Dj7iJ[ؠ@` {5Y"kUJ¡%g>#r7?T5" !y$(ͰU"ICSoovUT~K)VP5tZ+#(kmkoʋwbˑ//|z[^=n.,/(! va B ~E<ݑRBB6B5CKk7+"]Uas`~KW寠, s`(.`iK;µPu3 .%"ŀi#pkZ:S>)% _AP8->};}]F 4H !$ #vCFVN걷 wT yj[|| SƕY r@G )Amw85CMVaaRrCv;v2bTsToU99 tЮ^Azߊ[;ƿ\޻ V!*!Xh6q<J[a%Aix5IXT|= am`]W87o'rɏ?v] < lI/_TE I!8-x 9Hx!lIdꀤ/Eҿ,젺M֞ߩoXP!6iZ6joY{NFt3tH!Tf:|oo@G[鼢]]WY?uCMM- oma VtSV_It>.!7w^sex A;' `Xzޫ\*{~sتqx eX- fE}0D}XAЩ#p,\2|.n5B`Xn$:L..#hWiD-\h' \=@-ɥ <*BcR%^!3ۑ^a7Qm-Ѝ\@SU'']9"f~ ArB 9Xj_Rhl{~tVAۣI*,"pkphmZG赒ɸy!jJQ}Z9^q Qx&/4:wrysy򽰜9FZ4<^[MQcW o"i':WwÇCM7;[FQͰa8%Vq];s4Â3wK>vr@b(ոF#P ?MHAJ}G 4mb瘉 UЅS8܍ {Ñ h$M!n ? uU8*y!󮫖a>~ J9vi׻v':"-h.zhfoY;S?#Vp*T苜%I@ H _7(/ pv6}bJnSI[;XH;wk{?PӧȄRniƞwrMhEN[W8ͫOM~oxO8S(;HDA}QBcdZtvx1(հp8~/T1N1`![ ݞ4B)%8sW/Yo| yݴL _,T3 A7/8pJG0~מ3hTΪtWFT\[<+{@) $T粭0(o=nooa :UtF"GHGB"+8M0B?$T:|!C>|b$!xڂЭGE'`0hl_F}95vGv=],^D6iØqkJw8w #wp3 <TXlzo52$ӱaJ5_:*:Ԥ &aD &4RJ}8j?=*TG?+7<_Au;n`K 2 ])@P TTot<XCp";8Bn-Iqq:#9vDі[ ƙ׺z0 A &ӊ#Cp>yB0g{&yB,.݁#Q5T.͋. H *5ɖ Ph$v9 y_+@TN8HY"1L=LF fthIG@p 4 S 4xG|熠C!%8*XX7K_'Ѯ]LS]DjPS% 4DjC3ǁ٘Qb:eĉ0oW0ᖼ".$i "]Ɂ@{\p\HK6 49|#C6HB78y#?oy-6/?OAH- *% *\,i&D0fKKFiv_2շ߭to)Ꮬ}RHdoC #mOH!:&իz4"$ b"D/鰘;ga۟(*>*@_ ,|/|T|4d;b"R9!@4MU/j\S<M3'F5PBgh规L$LruϯCCONh ȬIA໑F`E/j5x!8c[v*)EѷiRfpѬ'P֥ZK)A)^2aB3C HƔЗgAr,. 3 @J `*TU_SݞU)oRV5WCgjAU0й&0{# t0- _`4."s戛Э2GC}[X9Y]x^smjLtIBA$\ x΢Q-5$ zˢ.; ju`aT8IJqTTzQf_*2B{]__$:rnev `0㽝>mG`)"p,G4[`~琴"tU݂ㆵ N2D P2a( h jOȱעPnW7u5a~yG~{aЎ ej-1HR&2s~* Ɨ0+"T~T5@}7$<CQ>vnx` Cr[F)%,XDi.)tG~M@ЮL'H%ѭHAXRp:#CR"B@ 0"t <3q;j:toJ"K=o GcG"0zANy:c? {C|)K}Ղ/M{MxnVzp `36iB<` 5afAc@52UȢFN Ga&!t/|o !B; nVtE' F*&rr)_v-2U\?Ǜg^1=>rcM#j8A5ns0L, i9[NȡT r8zۃ\:V^Wo'Tܑ{qP%һY}~0mP{tw`^+vIyeЯj~p[>⺜~ "lJ!jwRLVG#`76ՔnJ[9a`擨<>ʥ=D{t3wNţ`G'ЌhoU>^RvP!.J]<͕)xpv%Ah76)KaB娡wC/)vZZ8"N܏Xyظxn{]>)؅e[M=> $Ia~~vvCCKzQ@3 Ǭ8fL+Wn>a4 "ӁnX)"/I5^Tazn2^*߃s_ƅ'i\#w~7rKaUEr +)ONξt0eK! nEXBe)4k QeuF). !`,M6x# :!W *??0{nؾ B\P\'nx5)oET7B@$c.vT؁v~?=B$4"*05t+ѩ'j]0fu#_v!{թQȪKaA3,pG)"hAUET3a-E\N tMe ?(  oE]yx_1Wխ:Rw罂ξ㡭96g )!Wq1P[x-8:" RU ˦`!TOqDn}ϥL59gະr%X"B,d?)8:D]=1/y["@}y4k硦8 OV yp]&3BA]G.dR驓R%`` aT &DB!xE [}] B+Wa `!G{FMDx\զ;$e[39-A @V#һ% ,L%igY,y,0I ۓLSu)="OPKp+fla)8{-0}XN(Dƫ#D `~G :)!}"z)TsNgG>I/Âu ,L|ʚ|#?}'0/.Ec`!Xڛ*`5קԿxC~0_H[bQ?BIUuЃJI   zG;YGun=*+kBk3AϬ{JKUastZ+Xމ`RA1<pOD~v튲y/raׯ|g! a`!|G'h!*uQӕH׾+m'2 ^g_g,Dv"SbR`4z H!갍j h3A8}zUR!^} }aNrLDD $B)$ imE,sƋBp YD ӄQB[ACh#>~&&@"cڍzl?@7&G =H@VȂ[n\+sp2`i"\&} L#}$/|ĦA;ѿ Ic $[ $U B`CungUJ#2 Э c]|rڞ ;YnB\nwq&'ws\m&C*1~ɇi6G:FT2+9WWӎ߮_ z"{.Z |w3bҦ@Ꮖ 4 Sj7II-^KN_mrg 3C=䜉 tګ(nl]L#rʋwoK4gK6{&&wnNgu=M4]ӿž !lyh sQ'ox\=s54h7Rؚ\z5h7/m"?W L"vCb'gr@$ V![EywFاUBS3,oo Kl3g~13 q)զ)DV":'=Y h^\XS׶Go/ ![˹V%k`>#)Սt;  q ]z≙$ȳ&ic@`j&nN0kNq޿L0Gv2${[g_B "߱(tK4üMr?wsnxя[~_< lʇ3Cg]c82vMRG9=N=H(aAz$>tw- p~w СiwK &$R5)yHcv~To߇tӂU<嵥Ļ3vwӯ8@lA +_Gaha " t`O}o~sp)!nM3r--#ě?TN,@MӉSD//mbZ@=RsT}=9>]d)๛ظU$ʡB jx* @WiB> 8z~,7L$FFhfٯa} `Ϟ=CX4Ku$#CtW/ވWL& *6ןFs(-J# -N @lj TJMtĦAo0_/-Jޛ}ʭa<{f[|rӇjLlIUp ڋh7/R+W<AVC0)0B AAJ˯ļy/t}bwkEz,jςmĂ ^UQ<{1tL{8d ̧ByƳS \_pڧw˜J' 'DmcD  PhIn,J~' 57SȽZ%}L&LcDpg|$JP^ =፴;  :~緔0`bn?RJP)![%&Bn07jVuF}|Btr幃H,-]8QXBVLR:Fy_Bq1ɱG=T$Ԕ029¸_o"&M7uӾ_rqa׀3sN9YWUfpkQ*ߪ<ڣ`Zel|[n;WJ߭bm>{12=Rʮ%^'ibP2٣>o$Q' I4M7!u3^F0DӠSG!7]<5h'KE~"&Vwa(oҐB07͵jRGI){U]~Սg1t'hlʪRBUO"js)JS @_~AzC8 @3@c@pzA7<Za62fZ+[h2`SWϢ<hD0B7u-ImcʗQ6‘+I>@ zX93'n^+HI׏|bXtCU9=Z"Rfœ m:Av'{U_2ڍKѸaP4Hä*X%*Byn,{5]"v`=l>/e*O| R@3,Pӂ@pلHwc_EPcmL@QgP%R ߿+_۩lL~D}IE54gQ^^BF赵K_THOm$[;%ɀR("`4 A %8]0M ~@vll3Egݧ}42kؑz̀Sclg_ODFDU6(ݎ>混N Jֶ-Q BMD"Q`0PUARx%ݝ\TO3f-7Ic+DtSO)j Q({ v:lMt Ma" *#RJ0)%y<́491cBӵAb"8ٿB+G^<6מӃ-i'msmw$wM>g8 ` ,aat 0 ,E ?@Hx\y$gK 5N``aWϠVyKȱWX FywgN]%! >_tXrsm~NmMF)%$S4Р4݄4|!Ĥc?A1D~Vթ&7L3G`^ `ֲcCL߻s%̠Bp#U6OzC8 R!Du.)8x Nۙ RP?<ܖ#nvPvW9|կ4$ns t:}w2ӿ-lШBtA OHY-!!8? }-( @Aоb2n4a)8Bn:P &;ك)8 |_En0@K).~#JBzRt@ݹ~cF?;=RpA:DCvaԧX4ƤL@rL]F*`q`E 3tj]0HDU{FS 450ߍrFmRJ"#!) N.Lmq#`4 >(z}DJc6ePd}ίiQv^+5'&,fݾ}ײMGKA٠LcMbp|{àdHȢ:y+I4=*!M'sTn9} >"aN}%Aځ(xwЌh'42#tP$j\@~mRvd@wIAJ1 EvLruڵ-jD̞@n䖖P!&(˜80%TSe"J#`a|. 1@x΀ڞȪ,5S}٬Qx`Gb:oy%G˴" e+o?J^z*p̘~om%6F?0pYW&el7a"ѧ{=G{ n)p_$syb?@Rj?2z;_GL&0D4c)Dr¯)8sfQ i#!N!lr:?O!y#)_/ R0 0/6qáP-gX YJ j(]l@=ockXGS>繮D%DǠ~Ÿ>נ{BB?wBrryaf43A@MQC B!$~IgQJ^, VDP'?9%Ѩl>-8T$Q? DE2/XQy3 ؁Lcv %dtHA@(!>ɓ/a$;逬wNq pO*ŷ7s :gjtPB,h;mki(sGE1F|Fcf  ̻'A vx"@(MDF?Gw/SdͤXRrU +-9|dP!QJx}j3K<*.bG"~ *p, ݱ]Z2% #\pJ(B\DUM <G4_SVEIŵէh%帎wr8^pa MDl:1P- e 5S"gۖώv'?]:u䳤@Ӣ:!X-@ dh~" ܱ j"0`6\]0m5pÜC;L;LL-vGn7֋l5nE{rIv `!Tt+ʁ&@=?"lC㖗K)"[qf5@`1oXo8f&!@F$2aGߠ$/bAS>ΖO>~3 %͟܆^lM(Rw jj~a&9 UN"+246fթ(Se yW>W<4-|] TZ`~wU_\ 8--Lbh "t ?VafM3>V)n]t[Kh9S;B@4 fcLFF8oIC][:(J@AI }Z_ˉJ(2enG੆1 xg`^낒كښ9kD9S=Grxݭ%ܲh]>Qա%xtzHcBر>!2 JK0rm}{2A2S\ؘY8}4,geG' 8yK t@,m;yϲ0dgO;-rPFA"c@ Oe;G8 K&=`f}$6"QJ\00X}}RhqCP=8!=GBsI|\0bھӲz҈e@2tkk"U<=@ !$pBlZV80vA0ga1oJ(l*ҁF;,$4svxo ]$m6oRRM_5D>i4 ōHumKMr# FFÉ =R{tt;awI9ݿa FZـsLa9 ?H.N6E4@%`i{Ѣ!V[ !"ؒ@( IdFNu3۶q =N}'}hk駉 B?#em3($Ä?:gK~L@Zi8 cG5/2\t8+vĠKw4,P%M.$Ht==tmyi @6|نbتatH9&BPÄkC:{K[?1p__ڬBP|r:*njhAǼa9 }>DH`$7u)Y4˝9GhK(rFLo<7G!|01СRf)x'd07!֧=b =W?)?+1MKۏfFpӜKun8]G(Gs: ˶ @×` n^ߩkpޔaCjM#"Н%ؐk_4FڨOqQL"?zBW/^|Vծa(ْBAq碉ntp; DbqCلe- /ZsBN2sK-KJwI&&xLrǹdJhD@vc H.4-XvhTiTD XiqxLBƅG45AYoU}7Y8^ 0HTX<F<'iǾ7VԴ?;5"G753@ UwN@ar~Jkk xԩSYX'77ӅRr#a\PҦ:xKA%n(w"&9 ӄm; h$Dp-C!PՔIY<-!"f 3`엾tlo?Sډ7$܏v=I4pZ=7$ᷪ;F ;BW}PL ?xJP*ϽqrS^ew@ )\Õ`T2P DVDZBTT(hktBj3z#i\\( @"?'?Un" !/Gg?Tcae8^u¡HEq˜[' CsA5'1"`^A10k\x衇^vm'|N>ƞ9*BU7]dļ9D s<Pݰ !\&CkX0*~ &!j pBgIyo>ZnO3s TDammYL2;Ί$8ucޔ+~X*cujy 7=\z®&"9:n*iBd%` A   R!8G!8&)?~2̛vC{XyJuMR"4vӜKw^G/>>udЇw#w͕~:W(ʶm}\`7CH ↋ ! N Nth]O@P0 e;0-  * s]TVa$ ?ս$bXpHtZŸW2yͺUI=YN9I&R  s?k42 Gry'r͆iQz/ f+*(h7pDhASOR$]wP`c})\0ɐ{>*'ˆm=9Ci(ŒRpɼ~ #mCGo;Jw8>B1!9TXh7j0u މ$ cv`&P6*kmOtS.V6> \5meȰsj#ڰZUΔU}˘A2 裹0R,~6_,vrviœ$@9MT77 f*m&EF.t-lnsiOG0z;/@/{BΰZGuݴx!h X ~Gk?\y}tih*KJY=Pi-*`Lr)ELy=;Bff_[ Ǩ}@she. 5!Qo?ݍ;/ ?zת c;痲z] xno=/jVi!~:suWfw8Grw3ׂk|Q䋥-ߟq44Zfeʀi1֦b|m;NL?(z٨V݌&d|׫Uk7C:woLݺ+W~8 >w,obyƒ4MSQ xno֪FjcBreMS @QQFC}$BxL׍a\`a([ӵz|};փ>>/r0Ds1ll͋RZ[7f[7K凝|m`_6/4k_?$ٱz9kvα4MB4L@J67jRs;zu_j0-o/?S(_cٻkK6Ag?}bZ򦷽X8|B˶5-hS)%j ڭ|K)vF~sxC3CL=RybCdð# YVzm}wu}_P*DT\!i٤17 DNQno 2':uJ/+)H._Xu}$NnlTfu_}sS'O7|SbN!hfp!P؀iCJvڨ>67Lg3zFJss?[*r w]׭תV6N9K|S.WhTzK._(%.FZjV~̙3nnG/|gҫ-6T[9<Ӫ6]3;OCxb~BᣅR,]8GeuFn "#GϿT{T4 @pӪת߸ܨgNmJwXBb|/4҅s^Z˄6!jKˋҏE%K VkVxUY>F3/'ŋO߳? !#CSN9.?[*}sM\_GYYW+>~P>jthqޯTy<FF_+-<7RUe \p\e}vOm8} # G~湅//?j4j%T BF>ayEקqdȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2v;l_IENDB`goxel-0.8.1/data/icons/icon32.png000066400000000000000000000032601334742672700165050ustar00rootroot00000000000000PNG  IHDR szzwIDATxMl\W7_c;qj'!!BբڢTbXDvQ@dQP`b@B(HHT"- RBTB붉73xƞ7ͼqXӦ'R սϹ8nwSAJ57w=%Vؤ\Mܑ#xع1.xZu:'0)Ȁe04ǴO6F yJ0#~Z qTRz1rb.7pC8yCVlvT G~pf2m(Y@np]=)T"4U2Y궟y#T]ՙWk' B%!n ֤PYEq0. 8`دqpV FO9 Y-`U$1.Aҋ,FܩȀ44)q+- t%5C%mxzu P+])܃Odp|wj6/m{ҏ.Ch-ΟX~*n A=[ռص~8^?@kTޛD;R ۫  h(}ĽX֯G`B1) Os `ii1;~ą %`\@>v&DP;'^[06Ep.aAm!/! א +;0Hi{@c+@%w hAHd-tE,!*h7QOto ^' 2 s>|:Ю-¨Y :2*Z}Cw=rԿvI N.z YrcPI[. Ktu^!kdž/[a0mQQ< ˽~p.[G_Eyu!s>dg2p~Kw#&m=Y>V]qő [C*Yi Kex@}`,BAF'cY@uC,L.]n2] bw .0KE-$#(]YX@Ƭq@p0cpHzt|ZkaT QJV` S,mm\>a= uQd5|?6Y@:bX-k#, KajA܀v֭{3T/bwaεùQ_rR(\Jp ,|I kҤ5PIήnεjj = |LI9 8Xwzw9 "9(i"&Q՛[z6qog{>ѬU~2w򷦧}Cͨ>?[<̌'8W_iq|<IENDB`goxel-0.8.1/data/icons/icon48.png000066400000000000000000000056741334742672700165270ustar00rootroot00000000000000PNG  IHDR00W IDATx{ld]?{Ϭ}z7:aXڴKB Ѥ?(-ȕDD %H@V2Q $ TPRB%JBVM6 ws~q]>!OrCnkQjH0Ȃo٧[dO=ܨ᧔K/sk]k#jϙ趽 ~K`eߥyN~퇿)f峞UY?%0=4T5X'sCW Y֎mvW ;7=?|ԏs%q9"z.2rm^PFiW *(AD-l4h|kg]W.O~;-G ~EigUqtТzS'To"ن_Q޲Kb*n&#l_E%&Y "Vn}r_.)gAkp.f Z{R?o1j&hgȓy'4o~u#[=-I(e@=j96_x!ae;ZyZ,Kwi,&I۩#_n}:oAvLMP_&"Q}dIF2ҩ:Ҹ2ae yWI KwOt6^FR̿>@(IZi,)Jxjϓŝ4y#Oz4"t ~F+{诬o^89zmqs6z(!M:\}ѱ[ٺCT"l>,8Ԋ~pyFtiCopF;7٧iv|{С0( ,Ro3/ 9-g3:c,mdi(U}v(JkLўLPBK_ xh{ O "7h5c;پ.FY^ADUpy8ki~$/_x%.chXP(֍_#UÒ#R+<*v;Of(e8g%==-4ϩ*1^1.RIWY0AK .OJ$ΊwITL&vb%ɇAÊE*znx+QОK[ wnDqeid&iSx}{=)' Qk!6wWꨜrrָqoc>[a #@35d2S%*_a[gg1>+6m~;VqΉ7,nXBme,qmZqK-'V"άeFFT5)<:! J_./ORTS t.z/fyXȫ́+{hf&ܦuRƉƬ̟&DV5Fj5S (/Γ%i+|1eFt}Aei}4zr tUW}2{w*Me9}^{ZDCJf^^\d^}gg6{}*gu!<x/Xn:sdl}I'?ѱ_|4l\??l5F033%a#׻KMמOO=[Յ3?33s !7 \rYIENDB`goxel-0.8.1/data/icons/icon64.png000066400000000000000000000104551334742672700165160ustar00rootroot00000000000000PNG  IHDR@@iqIDATxkWy23ދk'qB Iq(m(h?$JT *cUQ4mJJ!T`BԸiC`'^_2;;w۹;;{qvױAf=;{3ys9˸˸˸8qǿ:Fhu~ݚX7k<!{is~\t9wI}Zuz;!{냏һePjs6u&?+:JO.·G+I%{TΚԚG&;sr{C;g-0o#ZOu9]Z(uC B|!BU#Ա2VFgP~<55XǏk?$ZGR=k4i/Eu*{ +(? jY댞;OōGSO\ujpRAZCϒt6:PKPށTPaReX1yzey<:{+y=N]_mn?7xz৽rT*\;9K3$yL'CujPA@P"1cBJ@F :H:&OY2bngճ&~ݜWC| 䓻O{ABNb"NI5<2Z52Vg*BHۓƭwn퉻V8jT!ۄ>sgrddq'8зxk2YTX ++sZ1:9 88G7ae ?$+4Hek_xY7%# sB*C) S?Mܜ&O:d8T0@Xynkk f\ڸbd,.@up/^=0*%7dZd R/UBea]U;AcfO}V㥞s8~#G4ig~F&P8@g\qhH |e-`@u8 BTe}w T'5贃3yBCˑ *S:`n4\R{my=C9y謋>ؕigē̟/YhbQBe'R?K4Fm:(%%3T(O>:ӌ<1yjgνobdMO0}^.IgstaM`F o`-(bMfY&nMm3aYd\pH%^kM΁1-t;{ako5wǾɧHy.01VF'ވY19h5Q]Cgq/.pgIڱ}kb.oeW~P`:btNy*/ Vexj3L$3'3#"MN}F8c4"ug4O{ ͌<38U:B,"F #RTaϙ@O9&l0#,rrΑ LM~s>3t̜~3WtZgHy38t /&jO^.8A S+eu4x>E@ǖs;Ϲ'Y=GU= yW3Sݹޚ]_@֖!QACt^fΡ.&Kr}ֹ@h,|j8gs,ԞWYaY!_s(t)8IyA@R\Pi#APVg9"6ϖ^m􈰅9Ak\^i[&={D4Ηl_n+NyÓ g4is9Vp}i i[!u!dQnKI R"='ĉ%O_;K*.WyJ.uL 5,9;u6m=K̵L?}MHT>Rga* zZAD)o9v1ϰFѣX+ a(4hfDݱhF!/%s=3cu35wr/]mxb gݪG{J^ oz5Mp>r,w1x Sbu3 @^e™͖-nڌOSkyUN8YY\q˧F#LV~3v1yu1i|[hY3=?R20\V  ]ͩŜz7a1T\_/ d2'-x',sxJJ W)*Oٓ ˤY?yΚ5<齷] ?܊LΉ箮|~JK9d=fr!! :Эyv8a:80, Z3d(,qKoӿ=fR+ 8vũ56wӦ髺&w~~Qߣ^"@yA;ռ435ȰYdgHg-աJe0Dy>QfiMgsDQg>jhql=r0q+^uv>$%ie&K:-%n>X6;Ka< C學 ),%M1fǎaA8MO9ΘZw?U;}Gntɀѷ54w*!Isi;4q6E+X WT?J7^zdY,%F'$_To/U?2?;Ci|];Ç7udϰ[\=7u?'藥<(ڻ:80~S*G!z}>j7ھ3*GJι63u&Do>_-.}W^r9[Sg&DG{KG ʽR_͜ /G]0\\OIWΞkoQP~EcJ=.iXPT2>##cW\`قڡm۶ѫW/RSS>ܹsYft`Z33 :/.- lq@Em %@|~ˮ\ g8pܾu􊗕Rl^F++)ZLX|>x%>ݡSk}Roi :\Ǟ[; j% {m-0x3w:0 8{- 3\, ^EaЂ[k`KN礩Y;b[uN~uAl pUt7k;?bS:Ș;s̄Cvv6gnSNAhʕ,[oБGsNwc( ^e( Fy  f]vVv߅ޒrJ'0uʱғmiU ނro{% J):u|͠eJsNf+(.B")19LSf{N1[y/q%]^6pƶ davVŰ, F{pXwyt5GQ˦%ߴ^k=$~9眓8|pkrrVXXm۶ˏZz_u] pǸfddP)zn]y2עRO6iV{b[7ʽŎG7 MW-+Vr-ՕBו_\W7 0oP73f+,{c]d%~7["Wś{8:w?ߔן{`OYvM$Wϡf{h-Olļk豖Z.Zǣk.9L5鲔5r XO= vkcTn-f)S4>s-/K_)}^'ӓ6`>YoW 6ogS f^0~ {57TSJKJ 05aִD- m( xr#V W-qѣ'ןVzsLo@?V-x7$r-qo^k$Z`̑CiXb2 x|f~}فE-]?B7pyZrZRfgǺ"p9Sٿޭ[78`.27>|W++w]?Ji! 1RT>rFeCc .~_/7?9z3Xg^|_5+包>#g&p,r?<\)mh;P^_Ü?F`íǃ0D'Ơ2th`'p3)w tLOJZaE:XO?IR؜]1?pQnRm gZVՙDo*k}^-|_v,f1DKPfCΤ nk5eo]W:t^e{ 7O.UM0TU`2P{lBau0kxc |?ϋuedق Nt[GfddϜ9sP-cʣfAFfU它&Z.+1'Y߾5 s}EbМ1+~[luADv1Q,I&%_ڵkXb+VDfIKIVRV:'%3SVNOYe%WoaO|hiY -S-}ۘN75-QSv6.=ll5!qq?F2jK]GG\U= }??{b4 pf`wذaY`Si]nuP~nCKڰUM[wZof"? +w9h㟢 4e>K`Bdz.)?1:ѹ1c&^|GiǫEb܃_fZ,a͚5ٳ'oGqm4ϩ@y PJו2^C)GWʫ4Ҕn(t}_`53¨X0H~@؂FRJڏz쵬aO{06D|?YI)?Sy0]y?D6%(=AE ٗ_~yoFΝ+:?Ksnz`׮]_{ܳK+ٻs9<e3>_\p^jc&~=-pW7;l Po~eq;"N$?#$55 }يRxǃݻw_зo_V\8<UԽNn3PythVv%.ȥ{(p]j\jCC;P(`MvPcт7M6rss阍-k)iO:!wyžtlk _?5OhV9Xhm(o/&8A+9Y_].Uw\~k/ k;rn鉇ҷ.8} tmc'WWxnM{H$loOwMkf{5n66/Y7*I/Ϧkhn65h(f D'%j]1 Rf?Ȳ'h(FDm`ta 5P!b c/0 x'So meǛ嚦ݸf@y=z % [􇥍)x[ggw+ Ө+MK1K:zcώ{f_"|EL$l3 ufe38#.=y Md[{-> 4lۖsh{؟S;۷gȐ!Avx}~ʷ=l$<7s{J =nT:N<䐔DӻtdgJl-{RTX?,Yz_߱͜Kϝzu(Kk;?O^vGtZRӊ{:6!%fSZnݻ[bHoz?UY+!*vjisO۫}_^r0&X'^*doPJW(m5V⸱GiV7)Ot_hEf$ؿ?Q~-`vv6oެ^Ds.'|KRm26 ʓbp$CK+sE Z۫a/=Or&;0+<|r?9ƞԎ;XhQ0;5^uSKW]6|T e}E.7O{- ]P^1կcfTl݅7O{QJ| CADK zkjh۶-~ {r- UڱnPV)ebiݢ]Y:;Y9de/߱z.gX&>jGkkoGi{Z9 -؂oLyg4 NSq ;+^뤭FB5>o8餓$GΝ;y<ϙ4Q Wk7*m04szu-jՊK^]HƖ^6۹o϶씎ZA'Fβ K΋=w/8;u܄%.W];?((!idZfK\uKb]*&5(!š+dݹwޕGFaa!+WtY5ퟖlӊ 4,oimdVRlcz:_9@&dRfIL2Q'a322HOO˯g)_H+mذt`Sqy2V |fu#$6biGXFkk-k?Q[vfff&Ȁڹs'Wv~Vmms6h&C+ V`Pl`XС|27f`_ I:vH0 u~2|.$''rI<]ۿCzuRp#U7sf%{OU)E+V{wJa) XJ-Z"11>UdSFmLd0 ڵkOR ]#V}U\ۿ7*4OPF۶mf{vTNԢE KII 6m>-je󭯺ꪙ?h⌎$-ޣFN> v+~Ǫe8u(W4CMoاo=5ғis'`x]ӴnQ9:))iÆ c|5kxcOKKۥZp8źovA?]Sj_"?5o ʗ3^Qp` amۖ^;wa,W_}Υ%Kt{5~l˜N]IΚX,ѤܹrN"5KKi6 e6WEh:f&U/;٪)]2,ғ; #fw&P@׬;f$[7jzl۶={Ҿ}{O^^FMtꪫ>޷o@SYV2mnvW$^Hy%f+IZ=[0<>q^Wc+D}gWqXwz{~Ek=W0V8ef̘[t:M3 σ~~s[/tO&>םk_6%!`?|*rh cK_*HJ|k,Z1OA~{N()6|eSS vnFUjp\l޼0`M4 v9KyGۻs렿@{K*"*=]33|Fwc"u=l.=w%E;94~JUw{\·9CS˓/_9M:[fM5knp8!3iQGIwwn&طV>3{2uB =TBlo>0gﮓyM{j9fعm+,]^vmEsj`ÒA_׻Tdk92wpg(;8Ȕ$6ћk^]^5mJQQG}tE};늆tv'~k}5i :3+ɢ u{S4ϋILua!hvVI${Zj0B!D{!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!Bh.MH`|!#JN@[ Z@@6ĢuS2̺j pWyA_5ls T Vym!0cjb]!`X"zװ`ZDO$B6FC;ӽtV'Y-V՞h(rODߣ;mVKB6+nBG`]xeK^cI_pK#zu^ſ t o6fEܱ*XuNNLK5ajjRjġ};IjՖ {تkRPRg_^N[GIyI^1P]&п9U6U[T "|ړ?D+Y5{&{tb97#%"h644g{QPZ`Yl[=.xZ&>iZLu}Qi|_: @A_ꙻ2]s=7ѫY$xZ&{5-9n2eDڵMت#''YCǃ2o}nKw Jm}E}֮_(>̠C= @Ic֔Ĕo9uĩYiK&=3itlى-:&O<1kΚr.O qud煷w mOIOHվG׾k|(NL1*ZF;x#i)iȅ_aOQ}fnGi:oWܾ2WXW Gߺoޚ =44;'stDSz`լt\,!DeӒ~p܅=ߎ F]_ߛ]V^6 t:b]шEvgϜ<9Au<$BT_5-%3F#Ku9SRg鱮}1zVrvۆXA4rL$h=);/UOJbmf7W#=GtIILy16JQ?wQI)m)-" _4U6,Hg#z}{=Ż^%&$rG:+IcӜnqo1,a`44-ʜNanz~,N^x-W\D0nSc;v$xfIZr]=9+5)5*ߜ!`eҠSZ~qR W`X4,ZOP^"JJz,׽;/fg]+E"c7m³~͗+w sjN9qh -1t*ƟCn00 ªY@Mаp(|v{p8ʝ:x(YVQDnBĞb9wÓmV[T1?JyC _9B a` 34fB2qОCScRjۢY3c9X5GwcWFoE͕գ{wm%&_)=N-p9c4`!:6B|)))ο\8̤:Ĉŋ}J~W*Ikfj^Ӎ}",e Z b]kZ$Sc_vaر>/36%%_z>cr8YIIOxY:clV+ 'Dާ7onTtmHmJôujkNla>&5s};vd8e}MIIKϤO?7ӦMzxg&&g蘜G5ʭVRZŷǑ/IOML2+H%&Z, ,'D™MII}I'$#q5?ɑGzj;o'cǎ=ڵ8zчg>31>KǔO>覛z8:u$ @a7BChd]Bċpé~˗ ?WmNWmy1hRSL:}V\͋<ǑGu/b]2+py=a1 4j_84{/K0dQ!t|L|xionI௔QX ؏{ěx-W\kh ̓܋OV`HB<^XZh =f_)^ tl=M+5 ?[ 5^|TW?㱇dQ[ukױr*<Ȃ?yP˒%Ky'7bݒ=CN1 'R/D71=L>t:_4ii ؟~NJ D K.3ÆZV<,] W$zjDNd8bQ.kl1)_)΃;XGF> )))s^|9{+T:r-76d ~QTkO>DN>İ0U0cXcw0_K&бSwl܋ut;& d,Q J)]8@F> )7z{ff&6n{]{Yr̥p#c1%ˢp:ˉ'СCޛͧkEq#$ 9cT=^;לudhcTw!zuǻoW{ӀE8g3N.I}+\iN ,U9Jw}r~Y+`RnǝH?;Q{Ӏy.OI̬oW\ͪJ3o7zsy\3[5GgR׽9z7ZhWВ'.sݹrIt߷c?-?$%)w;/u;c]kZl'Wv|ɧ;swD,9 N}+WԁU5lŢ 9@hF?4jI"Xpk۵"޾祘S$ *xϱ!F2 PD3hbÊle4*24̠73I6^Ps| `? ޫՉ9.ڲwŜ+@Ū F?ݗa| 1{[+K| `p& ]˹j'5%q4!u;B?ɘkɟ9XT #AM,_C>+z5D$A2 q%1u#ԋi@*O#|6`(921o#]Y6KIAf`U'?h}`8O E,Tű/NՠaS%=11Ɉb2} /X +97s$"ܪK21/N̕n$u bGJ*UJ*ORM"~$Tx8%2 @Dƣ+Z ,zx~aޅ/0 ŁڭIs̀}E=qO\O);1`^D-GǾ"U* cռJwڬtH;[; Pc `Nsw*T?0/@/Bu|6UU]`/'җa.Z #$Tf8m"\l̕ކ9Z`M ,Jq5 +"f{oQ}K@caN x p0t<ĜI\, jQMՉؕ#H7 ¼U78FՊ4+3}@jxuk\[3s4@o;/D4}W7|*9ݴ-_y#~C! ڒc_zƲ EPTs1z'`6qՅ,SV~M-ހ9T\"l$(L]!49mk K(OǼZ::GKb+XUb~I={ J;Erh_a0`] ĜXWs)'q1g% sJĀzzcNK b$|Ӂo0E&hX-pxb9v9.)wyI< ",ͥb> ??9eg1放R,7rx@} se]ZΕĶ p2ű$ s/TU[6&!L`p,0%cN}9$?sA4$+fPdK*/D\TGCu; /RuVJeUm9BT} AūiZ{eh_juWwUso?aUJSM>TJu8wj_R8 P3-5VT!? WMtɘWε? k!Jv f?w0N@a6.mlZu-C0~(sJP,ç'Oh- TD4FFVU͡% +Z!BBn5x,}ܴ8|e`<4̻<[w1@hIQUl?XZYIt w`6*N\Fה` O PǁLh*_¾U]¾PyPL ZO֕TdJGK5%Ө= s@M%eEӚ _4tp(䲅ԴGM|(AU[V5 fD~7SbA?^+\,zPP4?OjwaWhi:$$-Ez;Dc:=Ȓu="̻< 5C Ozz ۨ95 MO+׺O!@]u![uP6q`Ze5uY֥jz,->)4$^'Ӵ*M\*PcN$(HI;| , afomGbjEfEu-tl]YxiU^_/x"'^SI$7]U~/ 稯jSq0Uph`\mVqZ*4"YڒIpYP"߃⍘K{/pĻwBv R禮[ זL]uI@S `. ~'nWwF+ 9"reS:򄷩-woi`TJWY 3eUlpKԊjΑ,1\)*TJǸ+U٘sgb.usU4b{ ;:Q,%/j[eڒq"ښ{o8;EQx=օ* rR 1wE\Rj@»(T/l뿝o1Oɣ_X!T| N"XP! o9MXO<̛U?\KaހLBl+S%@4_ݽa-ї9s-֮0k \77=܇y+ƷΊOUw!/Dcx灏rH4Lsst̅w.^ukᪿ(D/҂ 39r=fP+75 04i`}0c[ ?(R׿$??3/ZڝJӟK`:p5SaN[Ig͡n_N!_fa.ui0 1/];+ezbI zc5jVj_N2l94x7cN888v8=0WsneIr걶$ uR8I?+ !B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!1R*;M jAK?MC!q( ]$B4;hmk !'& 8I_h a+B!%B!"s¶M58870N`>8E1*Bf"^Pwp0 _6=|VcB!*]ぽDX8#c dVy]&}YgCj:D\B!H}^ ^:ֳ|uA|`P[q0 h`6挆NVS?RpK`v v/`#fG8'B $7&R'mMLm%-_/@[`%P(?RDu$ ?օ`|!B շ`(@d`N[!`;x`wB\C-fª6 XNRc"l 3O[#1G}GˠB4INڭ\)~À4c8_٢܇31?3!Pʹ }JX{6-w1h~$B!D'X l'sk٦:$`LXB)(6o 0W !h2 VK.}m?Pw\~ 9"n8\3A0RpKW{׫?mcIT byBS%ܰBf+\&C q)[`؀djz34vÁ\ɀ$7&RȷjU[q̺vzW]Wb]!/\ @]Q}SW lLW_S0[B+ȯ^8 [=]Q:O8:B!ji Nv7bhMEdn   `I_\3Yx#Y7 .L >~8%ǺB![}Ѕz5|1B8ӷ͔WH&F7BdaG_S0P:ntP_"Т?󠾖źB![}\{?9UOA>.#MfM,XRc"] ʴR20_/@ 3zZi7m%7&R0;p栾x?c P¹ \*BԨ!1R b31g*zQe X/'Կ1ƽXS%GL`,3خ/Bԥ+> h3p'ꀧa޵r0[[/*o!V` Ǡ 0o|Y / obqpp;+\9&w4a{IT&'Կ1Gv@}K7y!'_8I_p 0["B!B 戕B!QMB !kՐ@!h& ȋpYBf-JFJI/oLR`D@!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!/-R*pP{r=|C!-%f-fOFlί~XB8fR 㳺 ;Uх41|u]r(&&'H ik\Yl$MY;, ǺPBJ~RSN}W݅;(ٽtbOrD}Zz|XK(%z.~ԄqYAm_XTƤ O`\JRpp /3qAbQس;pb FLOVV9Jʝe'_Ÿ|Bʒx{<2ֻzt`jΤNc| ;XBmh֋tʩϾj/xwϠsK /^7OyPeDEVf*ݺ r )I:3=_i'2Fb9b\޺u Ҷؕi'-goT]%?Wac,q- &B4B Ͼ5]ΡȞlKѹUEٿcV$&X1 ())Nߝ;h͆>nŻrUUr*^jg_J鵇+sNjꕯE?&@phX.B.4_6K/=|8_ԳQVV@fV mߞݧb;ƴ ,@6f7VN HHHxzȐ!u\Xhb/^} o|q$Re`|fjҬg>~f_G$"%VE =jgM9'mO?kT;I';n'++֭[SO0j*`t]=0H+=~ΤԴT=lz)fz|wyK:yVQ3;eǞ(d<%CYϴjEޕoOP4)Q)Q>`QNdzĔGxm[׮y7xoz~W9pnWف}VMŠN\ffSOl#bغug[87Ya7oOw9pbɓ_u5I@J#8sX~7Vm^cݎ!} c֝5?|D|wQa9NeEռ>ufR\t݋{^ a?7"~{+8 ,MP;}u I&f։#&(MP 0@{MS3|(PFn_QpF8f]eV-[i )%'vn HBB_N<>oX`c꥗m[rMu]T)oiLjfڦm~쁔G RX#rc?Oxm۷sWs%SHJLO#xy7yŗ?-*wxn 6{]gfn:|}/t}9U;m݋/$j/k ~|J0˯,oY~|$RקP5m׊AGiׯҠĞsذa @9 X  \eZϷZxS hV'E CY̮񿷘'}^g{wkP10_: oۮ^z:eMdgW?a X3rIѺuRR5<7۷n3N7F`.R߅U 3=,7#b@ ; .cf'p&f@qm;˷Ϯh7f}:VfQUtjN r/ig0AS06++O>8[x輔=?)-ۓovyy&Ekg0ϞK$7 J{(ep` : m?! rb9S]RҴr?G'yys=wӵK22yp4&|=09~oR._>ӏ|AO"%%}o_N?о}{ta܃ ߏ>9}=zvwoڸyfk]˜1Yr%+WVhbWAN[++wg])l4 ѣxW}fTc* 4ҐhlffUW6Ty]rV}˗-c%%]rԊrj.z 3?"5w-2ٵmKٺwnټ.`6t+p 323:r [6Wnv:ٽ{w}⼃QJѢe ZlR܃5:ԩ}2%C _~2Fޙo曥qSu[$FLfdD1)))i}ᠰg]P|t7#N</!ͯ~.\Ȳe8)+sw's<{T`CkoLSa9hxh9k-Z` 6;ǣqu{OQaQBۚnh5. \\nR1ֽd7} sÌEa0OX$%e?4{wT, ;O?|}O>CIQ!yK~_47 |Nc7Dݻ'G^k@~~ҥsiݺ /bкMS)x<1w;)_4-]L򈑇%;\>o 7mS]>}I:D ꯒ}6lओN~`ԩAݬV}-)<nQΟ& v^rX&c333^fUzXxLRu"|=tї1aoGrR2^ʜ R2Q>c}qr %T:%׻ǟs >y*GS)9 ٿ-:})sz{oj*^_~awӵKg iצ5eE[7oNX,?3[2FM+ڮ$3fmZ|F:@N۷H$Χzrrp,X@=/g|_0~YkFz&fl}VN5yrh xwj, Þ|bwm9s,F&}1o͹^WLfff^fUj˖-+b{pw#r/K-%Fݩ7oO9AJ rQ, mبu;rw{ҽ鸋v~h:a8)Um*C^W<$aY,,Z &m[t.YMf60Wvlw;zd˹諓Rm ABB"=zWP6uO\k3R9v0CC:tliې'K"T)SN"=+6@RjMmZlo+/ 6lOd޼yo*<}ŵ}N;m[oU3 a&60Е?xih$#'gff^,g%PO^1|պ6/<|w(_0U{e$ v`N@x޻K7 #`ygv}}8gMWjc̘Q]9,"A{rCVK)tdO"ўx(4:w@NXpvj %9-AC)ZjYvZN8X&ݎݢճ=0|0:յeɚ-݈`lVV׫VnИ=ٽwJ)JJJXh)[n:junŐ^-GqN3`a rz(ϑw:-OSޛ]:wC,i!ߟfKe,V}1a{gTRJQ^V"{uNOgo[jYuLm޼yJ~-x )(3§YQ_bMbqx1o"!0>ߘ(ݞ]HFhZ0g[tȄ9o;+mNq?הּ͚rÏf}C=#M,y'?+]ko*g~>Y{X6jwh? ֽ#TZ֑TM)4CIj-]b]en@E=[vX0QJzkv)B1gP ϢVGaޝcoB2$`2_ֿb9+n}{q+m׳HyGIKK61|ܣGl6c۷b@FS;us1ɣnjw^aD}pAFJ\ o0h\E߂{t~?b]el}cdpײew}F섇۵ʚ"4Ⱥͻ40W@E$Ts.u4y1, 6*yٽ;Æ[׮?/+/ [6oaРA޶mF;xmxٔúi(%E+ >#+b .]NKKZY5W r[ksU1j߬P f~&tRs꺾ر;,?l۳w/+>kt؁tzQw~^^a*ai@tm]m"?' [7c#F^TqS^1c{-ߟ8 f<'44K:t=Cl)>?VV 7$WII K-aݳ!Jwڧ;WR`,+- {v)*/po{hlߵ5v֑+zܺoߞ ֯9hV9U+W+>0owkVҵmv0R|}?|C72|EkVJu K#zO`U_P&A7WY%~&?Y_VVvѽjkSFKOKjJK$v0cNA퓽o/{Ԛ=P @^@D;I6z̨~+L4TMf7~ˢT|t%uzMJRВ0U{ڷo12ƿ[?}RZBN\!\ M:.x0O0$%%e5-Z,wxo{'=-f:1|YĤӃ,v'!v1ˤ旅~׿̀ARv쨩7(.%AB{wM`?7|33f̘";s^{ݔjl]ĔLzs.@Yniz(ݻ(u].[ʞݻ_{}GYx F-0{Ou=M_"-: 9o~ʥJڷoQGվZr!?ٲ-[Y}&fRSSO[[g?w :dD7Es}E_7i>*//?O.][n7[B\__Z "J:fEX6vZjQXXwb@Q bUZi3?^ݸ>Xf-z-9'HJkE߱f n~jC7Z9;`a|/lcv#˒EK8x0W=S9j_K4n Kλe=\{i!mmߘh](%%-[,U:us~EpCN8>ga6cƌ/oem0r٧]'/O4uS,;Sv`SI΃"_}=˘<۫a }9GCfԚΒ%(,(VLBuM `ep}9α@NE(&]u gG1QҔCsH~ :F -}B؏w⦋k{-aku>]9ﯿο8匓{$,MVR`GZjOgu僯z_1mK./9|߹spX) 8f/[AaA!ypl""C4/i}}OV.F]rj.D9]ۀz[x#N5sav:bFc/ʖ٦,^xUs-\Hx4{(u9NR6m92ڵi q9]M?-Y?eGٓ&`dY?o0TT$nsN0_{~9#bݠ{zXh1>\o4Rn``NsOf83cQp&Nqô~󱅈'ٳ'yϞ [`G,IXE#ub!^~ *G58f\))- z>C.mV[>n'ܮCe_=aZ3.OI[reˠI)!퓳7ܝ[B^!D\G.}x6B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!BAuZ޷F fAJ!l.@5>Þ0ϓ'جX^`bztĢ՜݂eY8 !h$ s߼猄1C:˭3wv8Rjnl5a+BBblڦ=қnU{uT'x`soaŲE,Bf$Z @"08jmgX(a8 oc3R~x f`PONx`[j%{uz.d L.X,gwA̰x^\.Gڶm eeeVZW6،ԄjA5׶+سu] .yDjޮzVVV>fhk>}ڵ ޺x2oDiI iS:־}o~֮=_~պSǁ7GAIt*׶+_Vp!W8ZV뽆adq:IڀX,OGt;?CGHU,lX%?e\xڵk5c͚5՚ شۼGof>%kaoת,!!WjOÇWsֳghݺ5=+V[GA,6bj*}m<~ ߗ.r۶mw3֯_o4mRZ`g_>h&(殓@!Dh‘LX,.,wكN:qÍ7Ƕl.YRR,3[5{,Yŷ<51PB7 ʏd;w?.g>|8Ç'## &[t钡i(62Þ[j/Akيi@p+ !p݄ +hٲ%&55a#v o^WUcǦ?놩,[ݎRm۶u6Nx xFpM|R}so;= f[M`Ȟ1B!BWug}\s ]vc~)8r5doN}gQ|hF^8deQ7n#_Q֐vf?F-C BZ'] 3qD.z͠AH@}1#N>y_7s?z}Fb֌v|k{O5])*'%aMk~ϊ+8c)*2 xsۀ U/hZ2d:d1T"ny ٿGiB$u_gٳ'zqCM蕃PtMxFZXWWx[, B=, 3z5B $.eee  "$ TZZgewlO%gzuؕ}F뎌:2s i}پwLy)2:,#EK#E n!`-yY P!DCq].sWQrr2O=ˁRT&@2x{7))կz馛9#0՜)4!r/>^׻+[nr_F0?wq90_95e;z$\p~(((s5~GYFEf!\?~} rv7CU{ Pl߸o;A}cT{ 0~D_S{PFCf!PT~ܼy:n~{4: ӼLZwO'ҵ02[AK{ 6-˾~^߿iӦ3sGXaX:4 +2+@!FCo 75뛔I&qhǏG4.B>,>3>>Y hѢC?Ŕ)oqF^x%fΜi撀0pxCSBGra0^7o}]6m'b=餓9/X ꍄn7֭c5}ڵV4 0;:B!! >]=gƌN}wZj<Ҿ}{-## à|6nܤo۶ꚦioaGq>-?mTeB!j fnFaYaiVnhzލ`RG]`X/|`*s{9X\ɅBS$@^']+O)&AVܝ/63yQ/BF/Z @˕K2 B!Bf7"r? !&-/_!DxH·N4 !sråӭs:B$ql[.(wy$ !/wky9y)ZǨk;>p{ ̯waBjDuF\!!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B!B4E`VIENDB`goxel-0.8.1/data/other/000077500000000000000000000000001334742672700147075ustar00rootroot00000000000000goxel-0.8.1/data/other/povray_template.pov000066400000000000000000000013531334742672700206520ustar00rootroot00000000000000// Generated from goxel {{version}} // https://github.com/guillaumechereau/goxel {{#camera}} camera { perspective right x*{{width}}/{{height}} direction <0, 0, -1> angle {{angle}} transform { matrix {{modelview}} inverse } } {{/camera}} #declare Voxel = box {<-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>} #macro Vox(Pos, Color) object { Voxel translate Pos translate <0.5, 0.5, 0.5> texture { pigment {color rgb Color / 255} } } #end {{#light}} global_settings { ambient_light rgb<1, 1, 1> * {{ambient}} } light_source { <0, 0, 1024> color rgb <2, 2, 2> parallel point_at {{point_at}} } {{/light}} union { {{#voxels}} Vox({{pos}}, {{color}}) {{/voxels}} } goxel-0.8.1/data/palettes/000077500000000000000000000000001334742672700154075ustar00rootroot00000000000000goxel-0.8.1/data/palettes/Blues.gpl000066400000000000000000000121231334742672700171640ustar00rootroot00000000000000GIMP Palette Name: Blues # # For them rainy days ... by Daniel Egnor # 0 0 0 #000000 128 128 128 #808080 255 255 255 #FFFFFF 0 0 4 #000004 0 0 12 #00000C 0 0 16 #000010 0 0 24 #000018 0 0 32 #000020 0 0 36 #000024 0 0 44 #00002C 0 0 48 #000030 0 0 56 #000038 0 0 64 #000040 0 0 68 #000044 0 0 76 #00004C 0 0 80 #000050 0 0 88 #000058 0 0 96 #000060 0 0 100 #000064 0 0 108 #00006C 0 0 116 #000074 0 0 120 #000078 0 0 128 #000080 0 0 132 #000084 0 0 140 #00008C 0 0 148 #000094 0 0 152 #000098 0 0 160 #0000A0 0 0 164 #0000A4 0 0 172 #0000AC 0 0 180 #0000B4 0 0 184 #0000B8 0 0 192 #0000C0 0 0 200 #0000C8 0 4 200 #0004C8 0 12 200 #000CC8 0 16 204 #0010CC 0 24 204 #0018CC 0 28 208 #001CD0 0 36 208 #0024D0 0 40 208 #0028D0 0 48 212 #0030D4 0 56 212 #0038D4 0 60 216 #003CD8 0 68 216 #0044D8 0 72 216 #0048D8 0 80 220 #0050DC 0 84 220 #0054DC 0 92 224 #005CE0 0 100 224 #0064E0 0 104 224 #0068E0 0 112 228 #0070E4 0 116 228 #0074E4 0 124 232 #007CE8 0 128 232 #0080E8 0 136 232 #0088E8 0 140 236 #008CEC 0 148 236 #0094EC 0 156 240 #009CF0 0 160 240 #00A0F0 0 168 240 #00A8F0 0 172 244 #00ACF4 0 180 244 #00B4F4 0 184 248 #00B8F8 0 192 248 #00C0F8 0 200 252 #00C8FC 4 200 252 #04C8FC 12 200 252 #0CC8FC 20 204 252 #14CCFC 28 204 252 #1CCCFC 36 208 252 #24D0FC 44 208 252 #2CD0FC 52 208 252 #34D0FC 60 212 252 #3CD4FC 68 212 252 #44D4FC 76 216 252 #4CD8FC 84 216 252 #54D8FC 92 216 252 #5CD8FC 100 220 252 #64DCFC 108 220 252 #6CDCFC 116 224 252 #74E0FC 124 224 252 #7CE0FC 132 224 252 #84E0FC 140 228 252 #8CE4FC 148 228 252 #94E4FC 156 232 252 #9CE8FC 164 232 252 #A4E8FC 172 232 252 #ACE8FC 180 236 252 #B4ECFC 188 236 252 #BCECFC 196 240 252 #C4F0FC 204 240 252 #CCF0FC 212 240 252 #D4F0FC 220 244 252 #DCF4FC 228 244 252 #E4F4FC 236 248 252 #ECF8FC 244 248 252 #F4F8FC 252 252 252 #FCFCFC 248 252 252 #F8FCFC 244 252 252 #F4FCFC 240 252 252 #F0FCFC 232 252 252 #E8FCFC 228 252 252 #E4FCFC 224 252 252 #E0FCFC 216 252 252 #D8FCFC 212 252 252 #D4FCFC 208 252 252 #D0FCFC 200 252 252 #C8FCFC 196 252 252 #C4FCFC 192 252 252 #C0FCFC 184 252 252 #B8FCFC 180 252 252 #B4FCFC 176 252 252 #B0FCFC 168 252 252 #A8FCFC 164 252 252 #A4FCFC 160 252 252 #A0FCFC 156 252 252 #9CFCFC 148 252 252 #94FCFC 144 252 252 #90FCFC 140 252 252 #8CFCFC 132 252 252 #84FCFC 128 252 252 #80FCFC 124 252 252 #7CFCFC 116 252 252 #74FCFC 112 252 252 #70FCFC 108 252 252 #6CFCFC 100 252 252 #64FCFC 96 252 252 #60FCFC 92 252 252 #5CFCFC 84 252 252 #54FCFC 80 252 252 #50FCFC 76 252 252 #4CFCFC 72 252 252 #48FCFC 64 252 252 #40FCFC 60 252 252 #3CFCFC 56 252 252 #38FCFC 48 252 252 #30FCFC 44 252 252 #2CFCFC 40 252 252 #28FCFC 32 252 252 #20FCFC 28 252 252 #1CFCFC 24 252 252 #18FCFC 16 252 252 #10FCFC 12 252 252 #0CFCFC 8 252 252 #08FCFC 0 252 252 #00FCFC 0 248 252 #00F8FC 0 244 252 #00F4FC 0 240 252 #00F0FC 0 232 252 #00E8FC 0 228 252 #00E4FC 0 224 252 #00E0FC 0 216 252 #00D8FC 0 212 252 #00D4FC 0 208 252 #00D0FC 0 200 252 #00C8FC 0 196 252 #00C4FC 0 192 252 #00C0FC 0 184 252 #00B8FC 0 180 252 #00B4FC 0 176 252 #00B0FC 0 168 252 #00A8FC 0 164 252 #00A4FC 0 160 252 #00A0FC 0 156 252 #009CFC 0 148 252 #0094FC 0 144 252 #0090FC 0 140 252 #008CFC 0 132 252 #0084FC 0 128 252 #0080FC 0 124 252 #007CFC 0 116 252 #0074FC 0 112 252 #0070FC 0 108 252 #006CFC 0 100 252 #0064FC 0 96 252 #0060FC 0 92 252 #005CFC 0 84 252 #0054FC 0 80 252 #0050FC 0 76 252 #004CFC 0 72 252 #0048FC 0 64 252 #0040FC 0 60 252 #003CFC 0 56 252 #0038FC 0 48 252 #0030FC 0 44 252 #002CFC 0 40 252 #0028FC 0 32 252 #0020FC 0 28 252 #001CFC 0 24 252 #0018FC 0 16 252 #0010FC 0 12 252 #000CFC 0 8 252 #0008FC 0 0 252 #0000FC 0 0 248 #0000F8 0 0 244 #0000F4 0 0 240 #0000F0 0 0 236 #0000EC 0 0 232 #0000E8 0 0 228 #0000E4 0 0 224 #0000E0 0 0 220 #0000DC 0 0 216 #0000D8 0 0 212 #0000D4 0 0 208 #0000D0 0 0 204 #0000CC 0 0 200 #0000C8 0 0 196 #0000C4 0 0 192 #0000C0 0 0 188 #0000BC 0 0 184 #0000B8 0 0 180 #0000B4 0 0 176 #0000B0 0 0 172 #0000AC 0 0 168 #0000A8 0 0 164 #0000A4 0 0 160 #0000A0 0 0 156 #00009C 0 0 152 #000098 0 0 148 #000094 0 0 144 #000090 0 0 140 #00008C 0 0 136 #000088 0 0 132 #000084 0 0 128 #000080 0 0 124 #00007C 0 0 120 #000078 0 0 116 #000074 0 0 112 #000070 0 0 108 #00006C 0 0 104 #000068 0 0 100 #000064 0 0 96 #000060 0 0 92 #00005C 0 0 88 #000058 0 0 84 #000054 0 0 80 #000050 0 0 76 #00004C 0 0 72 #000048 0 0 68 #000044 0 0 64 #000040 0 0 60 #00003C 0 0 56 #000038 0 0 52 #000034 0 0 48 #000030 0 0 44 #00002C 0 0 40 #000028 0 0 36 #000024 0 0 32 #000020 0 0 28 #00001C 0 0 24 #000018 0 0 20 #000014 0 0 16 #000010 0 0 12 #00000C 0 0 8 #000008 0 0 0 #000000 goxel-0.8.1/data/palettes/Caramel.gpl000066400000000000000000000060471334742672700174660ustar00rootroot00000000000000GIMP Palette Name: Caramel # 48 48 48 grey19 164 136 192 172 140 192 180 144 192 188 148 192 196 152 192 204 152 192 212 156 192 220 160 192 228 164 192 236 168 192 228 160 188 216 148 184 204 136 180 192 124 176 180 112 168 168 104 164 156 92 160 144 80 156 132 68 152 120 56 144 140 84 140 160 116 132 180 144 128 200 176 120 224 208 112 212 200 120 196 188 132 184 176 144 168 168 156 156 156 164 140 144 176 128 136 188 112 124 200 96 112 212 108 112 192 124 116 172 136 116 148 152 120 128 168 120 108 180 124 84 196 124 64 212 128 40 212 128 44 212 132 48 212 136 52 212 140 56 216 144 60 216 148 64 216 148 68 216 152 72 220 156 76 220 160 80 220 164 84 220 168 88 224 168 92 224 172 96 224 176 100 224 180 104 228 184 108 228 188 112 228 188 116 228 192 120 232 196 124 232 200 128 232 204 132 232 208 136 236 212 140 232 208 140 224 204 140 216 196 140 208 192 136 200 188 136 192 180 136 188 176 132 180 172 132 172 164 132 164 160 128 156 156 128 148 148 128 144 144 124 136 136 124 128 132 124 120 128 120 112 120 120 104 116 120 100 112 116 92 104 116 84 100 116 76 96 112 68 88 112 60 84 112 52 76 108 56 80 108 60 88 108 64 96 108 72 100 108 76 108 108 80 116 108 88 120 108 92 128 108 96 136 108 104 144 104 108 148 104 112 156 104 116 164 104 124 168 104 128 176 104 132 184 104 140 188 104 144 196 104 148 204 104 156 212 100 156 208 100 156 204 100 156 200 96 156 196 96 156 192 92 156 188 92 156 184 88 156 180 88 156 176 84 156 172 84 156 168 80 156 164 80 156 160 76 156 156 76 156 152 72 156 148 72 156 144 68 156 140 68 156 136 64 156 132 64 156 124 60 160 124 72 164 128 84 168 132 96 176 136 112 180 136 124 184 140 136 188 144 148 196 148 164 196 148 164 196 148 160 196 144 156 196 144 152 192 140 148 192 140 144 192 140 140 192 136 136 192 136 132 188 132 128 188 132 124 188 132 120 188 128 116 184 128 112 184 124 108 184 124 104 184 124 104 184 120 100 180 120 96 180 116 92 180 116 88 180 116 84 176 112 80 176 112 76 176 108 72 176 108 68 176 108 64 172 104 60 172 104 56 172 100 52 172 100 48 168 96 44 160 96 44 152 96 48 140 100 52 132 100 56 120 100 60 112 104 60 100 104 64 92 104 68 80 108 72 72 108 76 60 108 80 52 112 80 40 112 84 32 112 88 20 116 92 12 116 96 0 120 100 0 120 100 0 116 100 0 112 104 0 112 104 0 108 104 0 104 108 0 104 108 0 100 112 0 96 112 0 96 112 0 92 116 4 88 116 4 84 120 4 84 120 4 80 120 4 76 124 4 76 124 4 72 128 4 68 128 4 68 128 4 64 132 4 60 132 8 56 136 28 60 136 48 68 140 72 76 144 92 80 148 116 88 152 136 96 156 160 100 160 180 108 164 204 116 168 204 116 168 204 120 168 200 124 168 200 128 168 200 128 168 196 132 168 196 136 168 192 140 168 192 140 168 192 144 168 188 148 168 188 152 168 184 156 168 184 156 168 184 160 168 180 164 168 180 168 168 180 168 168 176 172 168 176 176 168 172 180 168 172 184 168 172 184 168 168 188 168 168 192 168 164 196 168 164 196 168 164 200 168 160 204 168 160 208 168 156 212 164 148 212 168 136 216 176 goxel-0.8.1/data/palettes/Gold.gpl000066400000000000000000000040361334742672700170030ustar00rootroot00000000000000GIMP Palette Name: Gold # 0 0 0 #000000 128 128 128 #808080 255 255 255 #FFFFFF 252 252 128 #FCFC80 252 248 124 #FCF87C 252 244 120 #FCF478 248 244 120 #F8F478 248 240 116 #F8F074 248 240 112 #F8F070 248 236 112 #F8EC70 244 236 108 #F4EC6C 244 232 108 #F4E86C 244 232 104 #F4E868 244 228 104 #F4E468 240 228 100 #F0E464 240 224 96 #F0E060 240 220 92 #F0DC5C 236 220 92 #ECDC5C 236 216 88 #ECD858 236 216 84 #ECD854 236 212 84 #ECD454 236 212 80 #ECD450 232 208 80 #E8D050 232 208 76 #E8D04C 232 204 76 #E8CC4C 232 204 72 #E8CC48 228 200 68 #E4C844 228 196 64 #E4C440 224 192 60 #E0C03C 224 192 56 #E0C038 224 188 56 #E0BC38 224 188 52 #E0BC34 220 184 52 #DCB834 220 184 48 #DCB830 220 180 48 #DCB430 220 180 44 #DCB42C 220 176 40 #DCB028 216 176 40 #D8B028 216 172 36 #D8AC24 216 168 32 #D8A820 212 168 28 #D4A81C 212 164 28 #D4A41C 212 164 24 #D4A418 212 160 24 #D4A018 208 160 20 #D0A014 208 156 20 #D09C14 208 156 16 #D09C10 208 152 12 #D0980C 204 152 12 #CC980C 204 148 8 #CC9408 204 144 4 #CC9004 200 140 0 #C88C00 196 136 0 #C48800 192 132 0 #C08400 188 128 0 #BC8000 184 124 0 #B87C00 180 120 0 #B47800 176 116 0 #B07400 172 112 0 #AC7000 168 108 0 #A86C00 164 104 0 #A46800 160 100 0 #A06400 156 96 0 #9C6000 152 92 0 #985C00 148 88 0 #945800 144 84 0 #905400 140 80 0 #8C5000 136 76 0 #884C00 132 72 0 #844800 128 68 0 #804400 124 64 0 #7C4000 120 60 0 #783C00 116 56 0 #743800 112 52 0 #703400 108 48 0 #6C3000 104 44 0 #682C00 100 40 0 #642800 96 36 0 #602400 92 32 0 #5C2000 88 28 0 #581C00 84 24 0 #541800 80 20 0 #501400 76 16 0 #4C1000 72 12 0 #480C00 68 8 0 #440800 64 4 0 #400400 60 0 0 #3C0000 56 0 0 #380000 52 0 0 #340000 48 0 0 #300000 44 0 0 #2C0000 40 0 0 #280000 36 0 0 #240000 32 0 0 #200000 28 0 0 #1C0000 24 0 0 #180000 20 0 0 #140000 16 0 0 #100000 12 0 0 #0C0000 8 0 0 #080000 4 0 0 #040000 0 0 0 #000000 goxel-0.8.1/data/palettes/Gray.gpl000066400000000000000000000146701334742672700170250ustar00rootroot00000000000000GIMP Palette Name: Gray Columns: 3 # 0 0 0 00 hex (0) 1 1 1 01 hex (1) 2 2 2 02 hex (2) 3 3 3 03 hex (3) 4 4 4 04 hex (4) 5 5 5 05 hex (5) 6 6 6 06 hex (6) 7 7 7 07 hex (7) 8 8 8 08 hex (8) 9 9 9 09 hex (9) 10 10 10 0A hex (10) 11 11 11 0B hex (11) 12 12 12 0C hex (12) 13 13 13 0D hex (13) 14 14 14 0E hex (14) 15 15 15 0F hex (15) 16 16 16 10 hex (16) 17 17 17 11 hex (17) 18 18 18 12 hex (18) 19 19 19 13 hex (19) 20 20 20 14 hex (20) 21 21 21 15 hex (21) 22 22 22 16 hex (22) 23 23 23 17 hex (23) 24 24 24 18 hex (24) 25 25 25 19 hex (25) 26 26 26 1A hex (26) 27 27 27 1B hex (27) 28 28 28 1C hex (28) 29 29 29 1D hex (29) 30 30 30 1E hex (30) 31 31 31 1F hex (31) 32 32 32 20 hex (32) 33 33 33 21 hex (33) 34 34 34 22 hex (34) 35 35 35 23 hex (35) 36 36 36 24 hex (36) 37 37 37 25 hex (37) 38 38 38 26 hex (38) 39 39 39 27 hex (39) 40 40 40 28 hex (40) 41 41 41 29 hex (41) 42 42 42 2A hex (42) 43 43 43 2B hex (43) 44 44 44 2C hex (44) 45 45 45 2D hex (45) 46 46 46 2E hex (46) 47 47 47 2F hex (47) 48 48 48 30 hex (48) 49 49 49 31 hex (49) 50 50 50 32 hex (50) 51 51 51 33 hex (51) 52 52 52 34 hex (52) 53 53 53 35 hex (53) 54 54 54 36 hex (54) 55 55 55 37 hex (55) 56 56 56 38 hex (56) 57 57 57 39 hex (57) 58 58 58 3A hex (58) 59 59 59 3B hex (59) 60 60 60 3C hex (60) 61 61 61 3D hex (61) 62 62 62 3E hex (62) 63 63 63 3F hex (63) 64 64 64 40 hex (64) 65 65 65 41 hex (65) 66 66 66 42 hex (66) 67 67 67 43 hex (67) 68 68 68 44 hex (68) 69 69 69 45 hex (69) 70 70 70 46 hex (70) 71 71 71 47 hex (71) 72 72 72 48 hex (72) 73 73 73 49 hex (73) 74 74 74 4A hex (74) 75 75 75 4B hex (75) 76 76 76 4C hex (76) 77 77 77 4D hex (77) 78 78 78 4E hex (78) 79 79 79 4F hex (79) 80 80 80 50 hex (80) 81 81 81 51 hex (81) 82 82 82 52 hex (82) 83 83 83 53 hex (83) 84 84 84 54 hex (84) 85 85 85 55 hex (85) 86 86 86 56 hex (86) 87 87 87 57 hex (87) 88 88 88 58 hex (88) 89 89 89 59 hex (89) 90 90 90 5A hex (90) 91 91 91 5B hex (91) 92 92 92 5C hex (92) 93 93 93 5D hex (93) 94 94 94 5E hex (94) 95 95 95 5F hex (95) 96 96 96 60 hex (96) 97 97 97 61 hex (97) 98 98 98 62 hex (98) 99 99 99 63 hex (99) 100 100 100 64 hex (100) 101 101 101 65 hex (101) 102 102 102 66 hex (102) 103 103 103 67 hex (103) 104 104 104 68 hex (104) 105 105 105 69 hex (105) 106 106 106 6A hex (106) 107 107 107 6B hex (107) 108 108 108 6C hex (108) 109 109 109 6D hex (109) 110 110 110 6E hex (110) 111 111 111 6F hex (111) 112 112 112 70 hex (112) 113 113 113 71 hex (113) 114 114 114 72 hex (114) 115 115 115 73 hex (115) 116 116 116 74 hex (116) 117 117 117 75 hex (117) 118 118 118 76 hex (118) 119 119 119 77 hex (119) 120 120 120 78 hex (120) 121 121 121 79 hex (121) 122 122 122 7A hex (122) 123 123 123 7B hex (123) 124 124 124 7C hex (124) 125 125 125 7D hex (125) 126 126 126 7E hex (126) 127 127 127 7F hex (127) 128 128 128 80 hex (128) 129 129 129 81 hex (129) 130 130 130 82 hex (130) 131 131 131 83 hex (131) 132 132 132 84 hex (132) 133 133 133 85 hex (133) 134 134 134 86 hex (134) 135 135 135 87 hex (135) 136 136 136 88 hex (136) 137 137 137 89 hex (137) 138 138 138 8A hex (138) 139 139 139 8B hex (139) 140 140 140 8C hex (140) 141 141 141 8D hex (141) 142 142 142 8E hex (142) 143 143 143 8F hex (143) 144 144 144 90 hex (144) 145 145 145 91 hex (145) 146 146 146 92 hex (146) 147 147 147 93 hex (147) 148 148 148 94 hex (148) 149 149 149 95 hex (149) 150 150 150 96 hex (150) 151 151 151 97 hex (151) 152 152 152 98 hex (152) 153 153 153 99 hex (153) 154 154 154 9A hex (154) 155 155 155 9B hex (155) 156 156 156 9C hex (156) 157 157 157 9D hex (157) 158 158 158 9E hex (158) 159 159 159 9F hex (159) 160 160 160 A0 hex (160) 161 161 161 A1 hex (161) 162 162 162 A2 hex (162) 163 163 163 A3 hex (163) 164 164 164 A4 hex (164) 165 165 165 A5 hex (165) 166 166 166 A6 hex (166) 167 167 167 A7 hex (167) 168 168 168 A8 hex (168) 169 169 169 A9 hex (169) 170 170 170 AA hex (170) 171 171 171 AB hex (171) 172 172 172 AC hex (172) 173 173 173 AD hex (173) 174 174 174 AE hex (174) 175 175 175 AF hex (175) 176 176 176 B0 hex (176) 177 177 177 B1 hex (177) 178 178 178 B2 hex (178) 179 179 179 B3 hex (179) 180 180 180 B4 hex (180) 181 181 181 B5 hex (181) 182 182 182 B6 hex (182) 183 183 183 B7 hex (183) 184 184 184 B8 hex (184) 185 185 185 B9 hex (185) 186 186 186 BA hex (186) 187 187 187 BB hex (187) 188 188 188 BC hex (188) 189 189 189 BD hex (189) 190 190 190 BE hex (190) 191 191 191 BF hex (191) 192 192 192 C0 hex (192) 193 193 193 C1 hex (193) 194 194 194 C2 hex (194) 195 195 195 C3 hex (195) 196 196 196 C4 hex (196) 197 197 197 C5 hex (197) 198 198 198 C6 hex (198) 199 199 199 C7 hex (199) 200 200 200 C8 hex (200) 201 201 201 C9 hex (201) 202 202 202 CA hex (202) 203 203 203 CB hex (203) 204 204 204 CC hex (204) 205 205 205 CD hex (205) 206 206 206 CE hex (206) 207 207 207 CF hex (207) 208 208 208 D0 hex (208) 209 209 209 D1 hex (209) 210 210 210 D2 hex (210) 211 211 211 D3 hex (211) 212 212 212 D4 hex (212) 213 213 213 D5 hex (213) 214 214 214 D6 hex (214) 215 215 215 D7 hex (215) 216 216 216 D8 hex (216) 217 217 217 D9 hex (217) 218 218 218 DA hex (218) 219 219 219 DB hex (219) 220 220 220 DC hex (220) 221 221 221 DD hex (221) 222 222 222 DE hex (222) 223 223 223 DF hex (223) 224 224 224 E0 hex (224) 225 225 225 E1 hex (225) 226 226 226 E2 hex (226) 227 227 227 E3 hex (227) 228 228 228 E4 hex (228) 229 229 229 E5 hex (229) 230 230 230 E6 hex (230) 231 231 231 E7 hex (231) 232 232 232 E8 hex (232) 233 233 233 E9 hex (233) 234 234 234 EA hex (234) 235 235 235 EB hex (235) 236 236 236 EC hex (236) 237 237 237 ED hex (237) 238 238 238 EE hex (238) 239 239 239 EF hex (239) 240 240 240 F0 hex (240) 241 241 241 F1 hex (241) 242 242 242 F2 hex (242) 243 243 243 F3 hex (243) 244 244 244 F4 hex (244) 245 245 245 F5 hex (245) 246 246 246 F6 hex (246) 247 247 247 F7 hex (247) 248 248 248 F8 hex (248) 249 249 249 F9 hex (249) 250 250 250 FA hex (250) 251 251 251 FB hex (251) 252 252 252 FC hex (252) 253 253 253 FD hex (253) 254 254 254 FE hex (254) 255 255 255 FF hex (255) goxel-0.8.1/data/palettes/Grays.gpl000066400000000000000000000011121334742672700171730ustar00rootroot00000000000000GIMP Palette Name: Grays # 0 0 0 gray0 7 7 7 gray3 15 15 15 gray6 23 23 23 gray9 31 31 31 gray12 39 39 39 gray15 47 47 47 gray18 55 55 55 gray21 63 63 63 gray25 71 71 71 gray28 79 79 79 gray31 87 87 87 gray34 95 95 95 gray37 103 103 103 gray40 111 111 111 gray43 119 119 119 gray46 127 127 127 gray50 135 135 135 gray53 143 143 143 gray56 151 151 151 gray59 159 159 159 gray62 167 167 167 gray65 175 175 175 gray68 183 183 183 gray71 191 191 191 gray75 199 199 199 gray78 207 207 207 gray81 215 215 215 gray84 223 223 223 gray87 231 231 231 gray90 239 239 239 gray93 247 247 247 gray96 goxel-0.8.1/data/palettes/Greens.gpl000066400000000000000000000120501334742672700173340ustar00rootroot00000000000000GIMP Palette Name: Greens # 0 0 0 #000000 128 128 128 #808080 255 255 255 #FFFFFF 0 4 0 #000400 0 12 0 #000C00 0 16 0 #001000 0 24 0 #001800 0 32 0 #002000 0 36 0 #002400 0 44 0 #002C00 0 48 0 #003000 0 56 0 #003800 0 64 0 #004000 0 68 0 #004400 0 76 0 #004C00 0 80 0 #005000 0 88 0 #005800 0 96 0 #006000 0 100 0 #006400 0 108 0 #006C00 0 116 0 #007400 0 120 0 #007800 0 128 0 #008000 0 132 0 #008400 0 140 0 #008C00 0 148 0 #009400 0 152 0 #009800 0 160 0 #00A000 0 164 0 #00A400 0 172 0 #00AC00 0 180 0 #00B400 0 184 0 #00B800 0 192 0 #00C000 0 200 0 #00C800 4 200 0 #04C800 12 200 0 #0CC800 16 204 0 #10CC00 24 204 0 #18CC00 28 208 0 #1CD000 36 208 0 #24D000 40 208 0 #28D000 48 212 0 #30D400 56 212 0 #38D400 60 216 0 #3CD800 68 216 0 #44D800 72 216 0 #48D800 80 220 0 #50DC00 84 220 0 #54DC00 92 224 0 #5CE000 100 224 0 #64E000 104 224 0 #68E000 112 228 0 #70E400 116 228 0 #74E400 124 232 0 #7CE800 128 232 0 #80E800 136 232 0 #88E800 140 236 0 #8CEC00 148 236 0 #94EC00 156 240 0 #9CF000 160 240 0 #A0F000 168 240 0 #A8F000 172 244 0 #ACF400 180 244 0 #B4F400 184 248 0 #B8F800 192 248 0 #C0F800 200 252 0 #C8FC00 200 252 4 #C8FC04 200 252 12 #C8FC0C 204 252 20 #CCFC14 204 252 28 #CCFC1C 208 252 36 #D0FC24 208 252 44 #D0FC2C 208 252 52 #D0FC34 212 252 60 #D4FC3C 212 252 68 #D4FC44 216 252 76 #D8FC4C 216 252 84 #D8FC54 216 252 92 #D8FC5C 220 252 100 #DCFC64 220 252 108 #DCFC6C 224 252 116 #E0FC74 224 252 124 #E0FC7C 224 252 132 #E0FC84 228 252 140 #E4FC8C 228 252 148 #E4FC94 232 252 156 #E8FC9C 232 252 164 #E8FCA4 232 252 172 #E8FCAC 236 252 180 #ECFCB4 236 252 188 #ECFCBC 240 252 196 #F0FCC4 240 252 204 #F0FCCC 240 252 212 #F0FCD4 244 252 220 #F4FCDC 244 252 228 #F4FCE4 248 252 236 #F8FCEC 248 252 244 #F8FCF4 252 252 252 #FCFCFC 252 252 248 #FCFCF8 252 252 244 #FCFCF4 252 252 240 #FCFCF0 252 252 232 #FCFCE8 252 252 228 #FCFCE4 252 252 224 #FCFCE0 252 252 216 #FCFCD8 252 252 212 #FCFCD4 252 252 208 #FCFCD0 252 252 200 #FCFCC8 252 252 196 #FCFCC4 252 252 192 #FCFCC0 252 252 184 #FCFCB8 252 252 180 #FCFCB4 252 252 176 #FCFCB0 252 252 168 #FCFCA8 252 252 164 #FCFCA4 252 252 160 #FCFCA0 252 252 156 #FCFC9C 252 252 148 #FCFC94 252 252 144 #FCFC90 252 252 140 #FCFC8C 252 252 132 #FCFC84 252 252 128 #FCFC80 252 252 124 #FCFC7C 252 252 116 #FCFC74 252 252 112 #FCFC70 252 252 108 #FCFC6C 252 252 100 #FCFC64 252 252 96 #FCFC60 252 252 92 #FCFC5C 252 252 84 #FCFC54 252 252 80 #FCFC50 252 252 76 #FCFC4C 252 252 72 #FCFC48 252 252 64 #FCFC40 252 252 60 #FCFC3C 252 252 56 #FCFC38 252 252 48 #FCFC30 252 252 44 #FCFC2C 252 252 40 #FCFC28 252 252 32 #FCFC20 252 252 28 #FCFC1C 252 252 24 #FCFC18 252 252 16 #FCFC10 252 252 12 #FCFC0C 252 252 8 #FCFC08 252 252 0 #FCFC00 248 252 0 #F8FC00 244 252 0 #F4FC00 240 252 0 #F0FC00 232 252 0 #E8FC00 228 252 0 #E4FC00 224 252 0 #E0FC00 216 252 0 #D8FC00 212 252 0 #D4FC00 208 252 0 #D0FC00 200 252 0 #C8FC00 196 252 0 #C4FC00 192 252 0 #C0FC00 184 252 0 #B8FC00 180 252 0 #B4FC00 176 252 0 #B0FC00 168 252 0 #A8FC00 164 252 0 #A4FC00 160 252 0 #A0FC00 156 252 0 #9CFC00 148 252 0 #94FC00 144 252 0 #90FC00 140 252 0 #8CFC00 132 252 0 #84FC00 128 252 0 #80FC00 124 252 0 #7CFC00 116 252 0 #74FC00 112 252 0 #70FC00 108 252 0 #6CFC00 100 252 0 #64FC00 96 252 0 #60FC00 92 252 0 #5CFC00 84 252 0 #54FC00 80 252 0 #50FC00 76 252 0 #4CFC00 72 252 0 #48FC00 64 252 0 #40FC00 60 252 0 #3CFC00 56 252 0 #38FC00 48 252 0 #30FC00 44 252 0 #2CFC00 40 252 0 #28FC00 32 252 0 #20FC00 28 252 0 #1CFC00 24 252 0 #18FC00 16 252 0 #10FC00 12 252 0 #0CFC00 8 252 0 #08FC00 0 252 0 #00FC00 0 248 0 #00F800 0 244 0 #00F400 0 240 0 #00F000 0 236 0 #00EC00 0 232 0 #00E800 0 228 0 #00E400 0 224 0 #00E000 0 220 0 #00DC00 0 216 0 #00D800 0 212 0 #00D400 0 208 0 #00D000 0 204 0 #00CC00 0 200 0 #00C800 0 196 0 #00C400 0 192 0 #00C000 0 188 0 #00BC00 0 184 0 #00B800 0 180 0 #00B400 0 176 0 #00B000 0 172 0 #00AC00 0 168 0 #00A800 0 164 0 #00A400 0 160 0 #00A000 0 156 0 #009C00 0 152 0 #009800 0 148 0 #009400 0 144 0 #009000 0 140 0 #008C00 0 136 0 #008800 0 132 0 #008400 0 128 0 #008000 0 124 0 #007C00 0 120 0 #007800 0 116 0 #007400 0 112 0 #007000 0 108 0 #006C00 0 104 0 #006800 0 100 0 #006400 0 96 0 #006000 0 92 0 #005C00 0 88 0 #005800 0 84 0 #005400 0 80 0 #005000 0 76 0 #004C00 0 72 0 #004800 0 68 0 #004400 0 64 0 #004000 0 60 0 #003C00 0 56 0 #003800 0 52 0 #003400 0 48 0 #003000 0 44 0 #002C00 0 40 0 #002800 0 36 0 #002400 0 32 0 #002000 0 28 0 #001C00 0 24 0 #001800 0 20 0 #001400 0 16 0 #001000 0 12 0 #000C00 0 8 0 #000800 0 0 0 #000000 goxel-0.8.1/data/palettes/Hilite.gpl000066400000000000000000000065601334742672700173400ustar00rootroot00000000000000GIMP Palette Name: Hilite # 0 0 0 #000000 128 128 128 #808080 255 255 255 #FFFFFF 164 144 180 #A490B4 160 144 180 #A090B4 160 144 176 #A090B0 160 140 172 #A08CAC 160 140 168 #A08CA8 160 140 164 #A08CA4 160 136 164 #A088A4 156 136 160 #9C88A0 156 136 156 #9C889C 156 132 152 #9C8498 156 132 148 #9C8494 156 132 144 #9C8490 152 128 144 #988090 152 128 140 #98808C 152 128 136 #988088 152 128 132 #988084 152 124 132 #987C84 152 124 128 #987C80 152 124 124 #987C7C 148 124 124 #947C7C 148 124 120 #947C78 148 120 120 #947878 148 120 116 #947874 148 120 112 #947870 148 116 108 #94746C 144 116 108 #90746C 144 116 104 #907468 144 116 100 #907464 144 112 100 #907064 144 112 96 #907060 144 112 92 #90705C 144 112 88 #907058 140 108 88 #8C6C58 140 108 84 #8C6C54 140 108 80 #8C6C50 140 104 76 #8C684C 140 104 72 #8C6848 136 104 68 #886844 136 100 68 #886444 136 100 64 #886440 136 100 60 #88643C 136 96 56 #886038 136 96 52 #886034 132 96 48 #846030 132 92 44 #845C2C 132 92 40 #845C28 132 92 36 #845C24 132 88 36 #845824 132 88 32 #845820 128 88 32 #805820 128 88 28 #80581C 128 88 24 #805818 128 84 24 #805418 128 84 20 #805414 128 84 16 #805410 124 80 12 #7C500C 124 84 16 #7C5410 128 84 16 #805410 128 88 20 #805814 128 92 24 #805C18 132 92 24 #845C18 132 92 28 #845C1C 132 96 28 #84601C 136 96 32 #886020 136 100 32 #886420 136 104 36 #886824 140 104 36 #8C6824 140 108 40 #8C6C28 144 108 44 #906C2C 144 112 44 #90702C 144 112 48 #907030 144 116 48 #907430 148 116 52 #947434 148 120 52 #947834 148 120 56 #947838 152 120 56 #987838 152 124 56 #987C38 152 124 60 #987C3C 152 128 60 #98803C 156 128 64 #9C8040 156 132 64 #9C8440 156 132 68 #9C8444 160 136 68 #A08844 160 136 72 #A08848 160 140 76 #A08C4C 164 140 76 #A48C4C 164 144 76 #A4904C 164 144 80 #A49050 164 148 80 #A49450 168 148 84 #A89454 168 152 88 #A89858 172 152 88 #AC9858 172 156 92 #AC9C5C 172 160 96 #ACA060 176 160 96 #B0A060 176 164 100 #B0A464 180 164 100 #B4A464 180 168 104 #B4A868 180 172 108 #B4AC6C 184 172 108 #B8AC6C 184 176 112 #B8B070 188 176 116 #BCB074 188 180 116 #BCB474 188 180 120 #BCB478 188 184 120 #BCB878 192 184 120 #C0B878 192 188 124 #C0BC7C 196 192 128 #C4C080 196 192 132 #C4C084 196 196 132 #C4C484 200 196 136 #C8C488 200 200 136 #C8C888 200 200 140 #C8C88C 200 204 140 #C8CC8C 204 204 144 #CCCC90 204 208 144 #CCD090 208 208 148 #D0D094 208 212 148 #D0D494 208 212 152 #D0D498 208 216 152 #D0D898 212 216 156 #D4D89C 212 220 156 #D4DC9C 212 220 160 #D4DCA0 216 220 160 #D8DCA0 216 224 164 #D8E0A4 216 228 164 #D8E4A4 220 228 168 #DCE4A8 220 232 168 #DCE8A8 220 232 172 #DCE8AC 224 232 172 #E0E8AC 224 236 176 #E0ECB0 224 240 180 #E0F0B4 228 240 180 #E4F0B4 228 244 184 #E4F4B8 232 248 188 #E8F8BC 228 244 188 #E4F4BC 224 244 188 #E0F4BC 224 240 188 #E0F0BC 220 240 188 #DCF0BC 220 236 188 #DCECBC 216 236 188 #D8ECBC 216 232 188 #D8E8BC 212 232 188 #D4E8BC 212 232 184 #D4E8B8 212 228 184 #D4E4B8 208 228 184 #D0E4B8 204 224 184 #CCE0B8 204 220 184 #CCDCB8 200 220 184 #C8DCB8 196 216 184 #C4D8B8 192 212 184 #C0D4B8 192 212 180 #C0D4B4 188 212 180 #BCD4B4 188 208 180 #BCD0B4 184 208 180 #B8D0B4 184 204 180 #B8CCB4 180 204 180 #B4CCB4 180 200 180 #B4C8B4 176 200 180 #B0C8B4 176 196 180 #B0C4B4 172 196 180 #ACC4B4 172 192 180 #ACC0B4 168 192 176 #A8C0B0 168 188 176 #A8BCB0 164 188 176 #A4BCB0 160 184 176 #A0B8B0 156 180 176 #9CB4B0 goxel-0.8.1/data/palettes/Khaki.gpl000066400000000000000000000061271334742672700171500ustar00rootroot00000000000000GIMP Palette Name: Khaki # 0 0 0 #000000 128 128 128 #808080 255 255 255 #FFFFFF 144 132 108 #90846C 144 132 112 #908470 144 132 116 #908474 144 136 116 #908874 144 136 120 #908878 144 140 120 #908C78 144 140 124 #908C7C 144 140 128 #908C80 144 144 128 #909080 144 144 132 #909084 144 144 136 #909088 144 148 136 #909488 144 148 140 #90948C 144 152 140 #90988C 144 152 144 #909890 144 152 148 #909894 144 156 148 #909C94 144 156 152 #909C98 144 160 152 #90A098 144 160 156 #90A09C 144 160 160 #90A0A0 144 164 160 #90A4A0 144 164 164 #90A4A4 144 164 168 #90A4A8 144 168 168 #90A8A8 144 168 172 #90A8AC 144 172 172 #90ACAC 144 172 176 #90ACB0 144 172 180 #90ACB4 144 176 180 #90B0B4 144 176 184 #90B0B8 144 180 184 #90B4B8 144 180 188 #90B4BC 144 180 192 #90B4C0 144 184 192 #90B8C0 144 184 196 #90B8C4 148 188 192 #94BCC0 152 188 192 #98BCC0 152 188 188 #98BCBC 156 188 188 #9CBCBC 160 188 184 #A0BCB8 164 188 184 #A4BCB8 164 188 180 #A4BCB4 164 192 180 #A4C0B4 168 192 180 #A8C0B4 172 192 176 #ACC0B0 176 192 176 #B0C0B0 176 192 172 #B0C0AC 180 192 172 #B4C0AC 180 192 168 #B4C0A8 184 192 168 #B8C0A8 184 196 168 #B8C4A8 188 196 164 #BCC4A4 192 196 164 #C0C4A4 192 196 160 #C0C4A0 196 196 160 #C4C4A0 200 196 156 #C8C49C 200 200 156 #C8C89C 204 200 156 #CCC89C 204 200 152 #CCC898 208 200 152 #D0C898 208 200 148 #D0C894 212 200 148 #D4C894 216 200 148 #D8C894 216 200 144 #D8C890 220 200 144 #DCC890 220 204 144 #DCCC90 220 204 140 #DCCC8C 224 204 140 #E0CC8C 228 204 136 #E4CC88 232 204 136 #E8CC88 232 204 132 #E8CC84 236 204 132 #ECCC84 232 200 128 #E8C880 228 200 128 #E4C880 228 196 128 #E4C480 228 196 124 #E4C47C 224 196 124 #E0C47C 220 192 124 #DCC07C 220 192 120 #DCC078 216 192 120 #D8C078 216 188 120 #D8BC78 212 188 120 #D4BC78 212 188 116 #D4BC74 208 188 116 #D0BC74 208 184 116 #D0B874 204 184 116 #CCB874 204 184 112 #CCB870 204 180 112 #CCB470 200 180 112 #C8B470 196 180 108 #C4B46C 196 176 108 #C4B06C 192 176 108 #C0B06C 188 172 104 #BCAC68 184 172 104 #B8AC68 184 168 104 #B8A868 180 168 100 #B4A864 176 168 100 #B0A864 176 164 100 #B0A464 176 164 96 #B0A460 172 164 96 #ACA460 172 160 96 #ACA060 168 160 96 #A8A060 168 160 92 #A8A05C 164 160 92 #A4A05C 164 156 92 #A49C5C 160 156 92 #A09C5C 160 156 88 #A09C58 156 152 88 #9C9858 152 152 88 #989858 152 152 84 #989854 152 148 84 #989454 148 148 84 #949454 144 144 80 #909050 140 144 80 #8C9050 140 140 80 #8C8C50 140 140 76 #8C8C4C 136 140 76 #888C4C 132 136 76 #84884C 132 136 72 #848848 128 136 72 #808848 128 132 72 #808448 124 132 72 #7C8448 124 132 68 #7C8444 120 132 68 #788444 120 128 68 #788044 116 128 68 #748044 116 128 64 #748040 116 124 64 #747C40 112 124 64 #707C40 108 124 60 #6C7C3C 108 120 60 #6C783C 104 120 60 #68783C 100 116 56 #647438 96 116 56 #607438 96 112 56 #607038 92 112 52 #5C7034 88 112 52 #587034 88 108 52 #586C34 88 108 48 #586C30 84 108 48 #546C30 84 104 48 #546830 80 104 48 #506830 80 104 44 #50682C 76 104 44 #4C682C 76 100 44 #4C642C 72 100 44 #48642C 72 100 40 #486428 68 96 40 #446028 64 96 40 #406028 64 96 36 #406024 64 92 36 #405C24 60 92 36 #3C5C24 goxel-0.8.1/data/palettes/MagicaVoxel.gpl000066400000000000000000000120411334742672700203100ustar00rootroot00000000000000GIMP Palette Name: MagicaVoxel # 255 255 255 #FFFFFF 255 255 204 #FFFFCC 255 255 153 #FFFF99 255 255 102 #FFFF66 255 255 51 #FFFF33 255 255 0 #FFFF00 255 204 255 #FFCCFF 255 204 204 #FFCCCC 255 204 153 #FFCC99 255 204 102 #FFCC66 255 204 51 #FFCC33 255 204 0 #FFCC00 255 153 255 #FF99FF 255 153 204 #FF99CC 255 153 153 #FF9999 255 153 102 #FF9966 255 153 51 #FF9933 255 153 0 #FF9900 255 102 255 #FF66FF 255 102 204 #FF66CC 255 102 153 #FF6699 255 102 102 #FF6666 255 102 51 #FF6633 255 102 0 #FF6600 255 51 255 #FF33FF 255 51 204 #FF33CC 255 51 153 #FF3399 255 51 102 #FF3366 255 51 51 #FF3333 255 51 0 #FF3300 255 0 255 #FF00FF 255 0 204 #FF00CC 255 0 153 #FF0099 255 0 102 #FF0066 255 0 51 #FF0033 255 0 0 #FF0000 204 255 255 #CCFFFF 204 255 204 #CCFFCC 204 255 153 #CCFF99 204 255 102 #CCFF66 204 255 51 #CCFF33 204 255 0 #CCFF00 204 204 255 #CCCCFF 204 204 204 #CCCCCC 204 204 153 #CCCC99 204 204 102 #CCCC66 204 204 51 #CCCC33 204 204 0 #CCCC00 204 153 255 #CC99FF 204 153 204 #CC99CC 204 153 153 #CC9999 204 153 102 #CC9966 204 153 51 #CC9933 204 153 0 #CC9900 204 102 255 #CC66FF 204 102 204 #CC66CC 204 102 153 #CC6699 204 102 102 #CC6666 204 102 51 #CC6633 204 102 0 #CC6600 204 51 255 #CC33FF 204 51 204 #CC33CC 204 51 153 #CC3399 204 51 102 #CC3366 204 51 51 #CC3333 204 51 0 #CC3300 204 0 255 #CC00FF 204 0 204 #CC00CC 204 0 153 #CC0099 204 0 102 #CC0066 204 0 51 #CC0033 204 0 0 #CC0000 153 255 255 #99FFFF 153 255 204 #99FFCC 153 255 153 #99FF99 153 255 102 #99FF66 153 255 51 #99FF33 153 255 0 #99FF00 153 204 255 #99CCFF 153 204 204 #99CCCC 153 204 153 #99CC99 153 204 102 #99CC66 153 204 51 #99CC33 153 204 0 #99CC00 153 153 255 #9999FF 153 153 204 #9999CC 153 153 153 #999999 153 153 102 #999966 153 153 51 #999933 153 153 0 #999900 153 102 255 #9966FF 153 102 204 #9966CC 153 102 153 #996699 153 102 102 #996666 153 102 51 #996633 153 102 0 #996600 153 51 255 #9933FF 153 51 204 #9933CC 153 51 153 #993399 153 51 102 #993366 153 51 51 #993333 153 51 0 #993300 153 0 255 #9900FF 153 0 204 #9900CC 153 0 153 #990099 153 0 102 #990066 153 0 51 #990033 153 0 0 #990000 102 255 255 #66FFFF 102 255 204 #66FFCC 102 255 153 #66FF99 102 255 102 #66FF66 102 255 51 #66FF33 102 255 0 #66FF00 102 204 255 #66CCFF 102 204 204 #66CCCC 102 204 153 #66CC99 102 204 102 #66CC66 102 204 51 #66CC33 102 204 0 #66CC00 102 153 255 #6699FF 102 153 204 #6699CC 102 153 153 #669999 102 153 102 #669966 102 153 51 #669933 102 153 0 #669900 102 102 255 #6666FF 102 102 204 #6666CC 102 102 153 #666699 102 102 102 #666666 102 102 51 #666633 102 102 0 #666600 102 51 255 #6633FF 102 51 204 #6633CC 102 51 153 #663399 102 51 102 #663366 102 51 51 #663333 102 51 0 #663300 102 0 255 #6600FF 102 0 204 #6600CC 102 0 153 #660099 102 0 102 #660066 102 0 51 #660033 102 0 0 #660000 51 255 255 #33FFFF 51 255 204 #33FFCC 51 255 153 #33FF99 51 255 102 #33FF66 51 255 51 #33FF33 51 255 0 #33FF00 51 204 255 #33CCFF 51 204 204 #33CCCC 51 204 153 #33CC99 51 204 102 #33CC66 51 204 51 #33CC33 51 204 0 #33CC00 51 153 255 #3399FF 51 153 204 #3399CC 51 153 153 #339999 51 153 102 #339966 51 153 51 #339933 51 153 0 #339900 51 102 255 #3366FF 51 102 204 #3366CC 51 102 153 #336699 51 102 102 #336666 51 102 51 #336633 51 102 0 #336600 51 51 255 #3333FF 51 51 204 #3333CC 51 51 153 #333399 51 51 102 #333366 51 51 51 #333333 51 51 0 #333300 51 0 255 #3300FF 51 0 204 #3300CC 51 0 153 #330099 51 0 102 #330066 51 0 51 #330033 51 0 0 #330000 0 255 255 #00FFFF 0 255 204 #00FFCC 0 255 153 #00FF99 0 255 102 #00FF66 0 255 51 #00FF33 0 255 0 #00FF00 0 204 255 #00CCFF 0 204 204 #00CCCC 0 204 153 #00CC99 0 204 102 #00CC66 0 204 51 #00CC33 0 204 0 #00CC00 0 153 255 #0099FF 0 153 204 #0099CC 0 153 153 #009999 0 153 102 #009966 0 153 51 #009933 0 153 0 #009900 0 102 255 #0066FF 0 102 204 #0066CC 0 102 153 #006699 0 102 102 #006666 0 102 51 #006633 0 102 0 #006600 0 51 255 #0033FF 0 51 204 #0033CC 0 51 153 #003399 0 51 102 #003366 0 51 51 #003333 0 51 0 #003300 0 0 255 #0000FF 0 0 204 #0000CC 0 0 153 #000099 0 0 102 #000066 0 0 51 #000033 238 0 0 #EE0000 221 0 0 #DD0000 187 0 0 #BB0000 170 0 0 #AA0000 136 0 0 #880000 119 0 0 #770000 85 0 0 #550000 68 0 0 #440000 34 0 0 #220000 17 0 0 #110000 0 238 0 #00EE00 0 221 0 #00DD00 0 187 0 #00BB00 0 170 0 #00AA00 0 136 0 #008800 0 119 0 #007700 0 85 0 #005500 0 68 0 #004400 0 34 0 #002200 0 17 0 #001100 0 0 238 #0000EE 0 0 221 #0000DD 0 0 187 #0000BB 0 0 170 #0000AA 0 0 136 #000088 0 0 119 #000077 0 0 85 #000055 0 0 68 #000044 0 0 34 #000022 0 0 17 #000011 238 238 238 #EEEEEE 221 221 221 #DDDDDD 187 187 187 #BBBBBB 170 170 170 #AAAAAA 136 136 136 #888888 119 119 119 #777777 85 85 85 #555555 68 68 68 #444444 34 34 34 #222222 17 17 17 #111111 0 0 0 #000000 goxel-0.8.1/data/palettes/Pastels.gpl000066400000000000000000000006621334742672700175320ustar00rootroot00000000000000GIMP Palette Name: Pastels # Pastels -- GIMP Palette file 226 145 145 Untitled 153 221 146 Untitled 147 216 185 Untitled 148 196 211 Untitled 148 154 206 Untitled 179 148 204 Untitled 204 150 177 Untitled 204 164 153 Untitled 223 229 146 Untitled 255 165 96 Untitled 107 255 99 Untitled 101 255 204 Untitled 101 196 255 Untitled 101 107 255 Untitled 173 101 255 Untitled 255 101 244 Untitled 255 101 132 Untitled 255 101 101 Untitled goxel-0.8.1/data/palettes/Plasma.gpl000066400000000000000000000060461334742672700173360ustar00rootroot00000000000000GIMP Palette Name: Plasma # 240 240 0 240 224 0 240 208 0 240 192 0 240 176 0 240 160 0 240 144 0 240 128 0 240 112 0 240 96 0 240 80 0 240 64 0 240 48 0 240 32 0 240 16 0 240 0 0 224 224 16 224 212 16 224 200 16 224 184 16 224 172 12 224 156 12 224 144 12 224 128 12 224 116 8 224 100 8 224 88 8 224 72 8 224 60 4 224 44 4 224 32 4 224 16 0 208 208 32 208 200 32 208 188 28 208 176 28 208 164 24 208 152 24 208 140 20 208 128 20 208 116 16 208 104 16 208 92 12 208 80 12 208 68 8 208 56 8 208 44 4 208 32 0 192 192 48 192 184 48 192 176 44 192 164 40 192 156 36 192 144 32 192 136 32 192 128 28 192 116 24 192 108 20 192 96 16 192 88 16 192 80 12 192 68 8 192 60 4 192 48 0 176 176 64 176 172 60 176 164 56 176 156 52 176 148 48 176 140 44 176 132 40 176 124 36 176 120 32 176 112 28 176 104 24 176 96 20 176 88 16 176 80 12 176 72 8 176 64 0 160 160 80 160 156 76 160 152 72 160 144 64 160 140 60 160 136 56 160 128 48 160 124 44 160 120 40 160 112 32 160 108 28 160 104 24 160 96 16 160 92 12 160 88 8 160 80 0 144 144 96 144 144 92 144 140 84 144 136 80 144 132 72 144 128 64 144 128 60 144 124 52 144 120 48 144 116 40 144 112 32 144 112 28 144 108 20 144 104 16 144 100 8 144 96 0 128 128 112 128 128 108 128 128 100 128 128 92 128 124 84 128 124 76 128 124 68 128 124 60 128 120 56 128 120 48 128 120 40 128 120 32 128 116 24 128 116 16 128 116 8 128 112 0 112 112 128 112 112 120 112 112 112 grey44 112 112 104 112 116 96 112 116 88 112 116 80 112 116 72 112 120 60 112 120 52 112 120 44 112 120 36 112 124 28 112 124 20 112 124 12 112 128 0 96 96 144 96 96 136 96 100 128 96 104 116 96 108 108 96 112 96 96 112 88 96 116 80 96 120 68 96 124 60 96 128 48 96 128 40 96 132 32 96 136 20 96 140 12 96 144 0 80 80 160 80 84 152 80 88 140 80 96 128 80 100 120 80 104 108 80 112 96 80 116 88 80 120 76 80 128 64 80 132 56 80 136 44 80 144 32 80 148 24 80 152 12 80 160 0 64 64 176 64 68 168 64 76 156 64 84 144 64 92 132 64 100 120 64 108 108 64 116 96 64 120 84 64 128 72 64 136 60 64 144 48 64 152 36 64 160 24 64 168 12 64 176 0 48 48 192 48 56 180 48 64 168 48 76 156 48 84 144 48 96 128 48 104 116 48 112 104 48 124 92 48 132 80 48 144 64 48 152 52 48 160 40 48 172 28 48 180 16 48 192 0 32 32 208 32 40 196 32 52 184 32 64 168 32 76 156 32 88 140 32 100 128 32 112 112 32 124 100 32 136 84 32 148 72 32 160 56 32 172 44 32 184 28 32 196 16 32 208 0 16 16 224 16 28 212 16 40 196 16 56 180 16 68 168 16 84 152 16 96 136 16 112 120 16 124 108 16 140 92 16 152 76 16 168 60 16 180 48 16 196 32 16 208 16 16 224 0 0 0 240 0 16 224 0 32 208 0 48 192 0 64 176 0 80 160 0 96 144 0 112 128 0 128 112 0 144 96 0 160 80 0 176 64 0 192 48 0 208 32 0 224 16 0 240 0 goxel-0.8.1/data/palettes/Reds.gpl000066400000000000000000000067721334742672700170240ustar00rootroot00000000000000GIMP Palette Name: Reds # 0 0 0 #000000 128 128 128 #808080 255 255 255 #FFFFFF 76 0 0 #4C0000 72 0 0 #480000 68 0 0 #440000 64 0 0 #400000 60 0 0 #3C0000 56 0 0 #380000 52 0 0 #340000 48 0 0 #300000 44 0 0 #2C0000 40 0 0 #280000 36 0 0 #240000 32 0 0 #200000 28 0 0 #1C0000 24 0 0 #180000 20 0 0 #140000 16 0 0 #100000 12 0 0 #0C0000 8 0 0 #080000 4 0 0 #040000 0 0 0 #000000 4 0 0 #040000 4 4 4 #040404 8 4 4 #080404 12 8 8 #0C0808 16 8 8 #100808 16 12 12 #100C0C 20 12 12 #140C0C 24 16 16 #181010 28 16 16 #1C1010 28 20 20 #1C1414 32 20 20 #201414 36 24 24 #241818 40 24 24 #281818 40 28 28 #281C1C 44 28 28 #2C1C1C 48 32 32 #302020 52 32 32 #342020 52 36 36 #342424 56 36 36 #382424 60 40 40 #3C2828 64 40 40 #402828 64 44 44 #402C2C 68 44 44 #442C2C 72 48 48 #483030 76 48 48 #4C3030 76 52 52 #4C3434 80 52 52 #503434 84 56 56 #543838 88 56 56 #583838 88 60 60 #583C3C 92 60 60 #5C3C3C 92 64 64 #5C4040 96 64 64 #604040 100 64 64 #644040 100 68 68 #644444 104 68 68 #684444 104 72 72 #684848 108 72 72 #6C4848 112 72 72 #704848 112 76 76 #704C4C 116 76 76 #744C4C 116 80 80 #745050 120 80 80 #785050 124 84 84 #7C5454 128 84 84 #805454 128 88 88 #805858 132 88 88 #845858 252 252 252 #FCFCFC 252 248 248 #FCF8F8 252 244 244 #FCF4F4 252 240 240 #FCF0F0 252 236 236 #FCECEC 252 232 232 #FCE8E8 252 228 228 #FCE4E4 252 224 224 #FCE0E0 252 220 220 #FCDCDC 252 216 216 #FCD8D8 252 212 212 #FCD4D4 252 208 208 #FCD0D0 252 204 204 #FCCCCC 252 200 200 #FCC8C8 252 196 196 #FCC4C4 252 192 192 #FCC0C0 252 188 188 #FCBCBC 252 184 184 #FCB8B8 252 180 180 #FCB4B4 252 176 176 #FCB0B0 252 172 172 #FCACAC 252 168 168 #FCA8A8 252 164 164 #FCA4A4 252 160 160 #FCA0A0 252 156 156 #FC9C9C 252 152 152 #FC9898 252 148 148 #FC9494 252 144 144 #FC9090 252 140 140 #FC8C8C 252 136 136 #FC8888 252 132 132 #FC8484 252 128 128 #FC8080 252 124 124 #FC7C7C 252 120 120 #FC7878 252 116 116 #FC7474 252 112 112 #FC7070 252 108 108 #FC6C6C 252 104 104 #FC6868 252 100 100 #FC6464 252 96 96 #FC6060 252 92 92 #FC5C5C 252 88 88 #FC5858 252 84 84 #FC5454 252 80 80 #FC5050 252 76 76 #FC4C4C 252 72 72 #FC4848 252 68 68 #FC4444 252 64 64 #FC4040 252 60 60 #FC3C3C 252 56 56 #FC3838 252 52 52 #FC3434 252 48 48 #FC3030 252 44 44 #FC2C2C 252 40 40 #FC2828 252 36 36 #FC2424 252 32 32 #FC2020 252 28 28 #FC1C1C 252 24 24 #FC1818 252 20 20 #FC1414 252 16 16 #FC1010 252 12 12 #FC0C0C 252 8 8 #FC0808 252 4 4 #FC0404 252 0 0 #FC0000 248 0 0 #F80000 244 0 0 #F40000 240 0 0 #F00000 236 0 0 #EC0000 232 0 0 #E80000 228 0 0 #E40000 224 0 0 #E00000 220 0 0 #DC0000 216 0 0 #D80000 212 0 0 #D40000 208 0 0 #D00000 204 0 0 #CC0000 200 0 0 #C80000 196 0 0 #C40000 192 0 0 #C00000 188 0 0 #BC0000 184 0 0 #B80000 180 0 0 #B40000 176 0 0 #B00000 172 0 0 #AC0000 168 0 0 #A80000 164 0 0 #A40000 160 0 0 #A00000 156 0 0 #9C0000 152 0 0 #980000 148 0 0 #940000 144 0 0 #900000 140 0 0 #8C0000 136 0 0 #880000 132 0 0 #840000 128 0 0 #800000 124 0 0 #7C0000 120 0 0 #780000 116 0 0 #740000 112 0 0 #700000 108 0 0 #6C0000 104 0 0 #680000 100 0 0 #640000 96 0 0 #600000 92 0 0 #5C0000 88 0 0 #580000 84 0 0 #540000 80 0 0 #500000 goxel-0.8.1/data/palettes/Royal.gpl000066400000000000000000000105771334742672700172130ustar00rootroot00000000000000GIMP Palette Name: Royal # 0 0 0 #000000 128 128 128 #808080 255 255 255 #FFFFFF 60 0 80 #3C0050 60 0 84 #3C0054 64 0 84 #400054 64 0 88 #400058 68 0 88 #440058 68 0 92 #44005C 72 0 96 #480060 72 0 100 #480064 76 0 100 #4C0064 76 0 104 #4C0068 80 0 104 #500068 80 0 108 #50006C 84 0 112 #540070 84 0 116 #540074 88 0 116 #580074 88 0 120 #580078 92 0 120 #5C0078 92 0 124 #5C007C 96 0 128 #600080 96 0 132 #600084 100 0 132 #640084 100 0 136 #640088 104 0 136 #680088 104 0 140 #68008C 108 0 144 #6C0090 108 0 148 #6C0094 112 0 148 #700094 112 0 152 #700098 116 0 152 #740098 116 0 156 #74009C 120 0 160 #7800A0 124 4 160 #7C04A0 124 8 164 #7C08A4 128 12 164 #800CA4 128 16 164 #8010A4 132 20 168 #8414A8 132 24 168 #8418A8 136 28 168 #881CA8 136 32 172 #8820AC 140 36 172 #8C24AC 140 40 172 #8C28AC 144 44 176 #902CB0 144 48 176 #9030B0 148 52 180 #9434B4 148 56 180 #9438B4 152 60 180 #983CB4 152 64 184 #9840B8 156 68 184 #9C44B8 156 72 184 #9C48B8 160 76 188 #A04CBC 160 80 188 #A050BC 164 84 188 #A454BC 164 88 192 #A458C0 168 92 192 #A85CC0 168 96 192 #A860C0 172 100 196 #AC64C4 172 104 196 #AC68C4 176 108 200 #B06CC8 176 112 200 #B070C8 180 116 200 #B474C8 180 120 204 #B478CC 184 124 204 #B87CCC 188 128 204 #BC80CC 188 132 208 #BC84D0 192 136 208 #C088D0 192 140 208 #C08CD0 196 144 212 #C490D4 196 148 212 #C494D4 200 152 216 #C898D8 200 156 216 #C89CD8 204 160 216 #CCA0D8 204 164 220 #CCA4DC 208 168 220 #D0A8DC 208 172 220 #D0ACDC 212 176 224 #D4B0E0 212 180 224 #D4B4E0 216 184 224 #D8B8E0 216 188 228 #D8BCE4 220 192 228 #DCC0E4 220 196 228 #DCC4E4 224 200 232 #E0C8E8 224 204 232 #E0CCE8 228 208 236 #E4D0EC 228 212 236 #E4D4EC 232 216 236 #E8D8EC 232 220 240 #E8DCF0 236 224 240 #ECE0F0 236 228 240 #ECE4F0 240 232 244 #F0E8F4 240 236 244 #F0ECF4 244 240 244 #F4F0F4 244 244 248 #F4F4F8 248 248 248 #F8F8F8 252 252 252 #FCFCFC 252 252 248 #FCFCF8 252 252 244 #FCFCF4 252 252 240 #FCFCF0 252 252 236 #FCFCEC 252 252 232 #FCFCE8 252 252 228 #FCFCE4 252 252 224 #FCFCE0 252 252 220 #FCFCDC 252 252 216 #FCFCD8 252 252 212 #FCFCD4 252 252 208 #FCFCD0 252 252 204 #FCFCCC 252 252 200 #FCFCC8 252 252 196 #FCFCC4 252 252 192 #FCFCC0 252 252 188 #FCFCBC 252 252 184 #FCFCB8 252 252 180 #FCFCB4 252 252 176 #FCFCB0 252 252 172 #FCFCAC 252 252 168 #FCFCA8 252 252 164 #FCFCA4 252 252 160 #FCFCA0 252 252 156 #FCFC9C 252 252 152 #FCFC98 252 252 148 #FCFC94 252 252 144 #FCFC90 252 252 140 #FCFC8C 252 252 136 #FCFC88 252 252 132 #FCFC84 252 252 128 #FCFC80 252 252 124 #FCFC7C 252 252 120 #FCFC78 252 252 116 #FCFC74 252 252 112 #FCFC70 252 252 108 #FCFC6C 252 252 104 #FCFC68 252 252 100 #FCFC64 252 252 96 #FCFC60 252 252 92 #FCFC5C 252 252 88 #FCFC58 252 252 84 #FCFC54 252 252 80 #FCFC50 252 252 76 #FCFC4C 252 252 72 #FCFC48 252 252 68 #FCFC44 252 252 64 #FCFC40 252 252 60 #FCFC3C 252 252 56 #FCFC38 252 252 52 #FCFC34 252 252 48 #FCFC30 252 252 44 #FCFC2C 252 252 40 #FCFC28 252 252 36 #FCFC24 252 252 32 #FCFC20 252 252 28 #FCFC1C 252 252 24 #FCFC18 252 252 20 #FCFC14 252 252 16 #FCFC10 252 252 12 #FCFC0C 252 252 8 #FCFC08 252 252 4 #FCFC04 252 252 0 #FCFC00 252 248 0 #FCF800 248 244 0 #F8F400 244 240 0 #F4F000 240 236 4 #F0EC04 240 232 4 #F0E804 236 228 4 #ECE404 232 224 8 #E8E008 228 220 8 #E4DC08 228 216 8 #E4D808 224 212 12 #E0D40C 220 208 12 #DCD00C 216 204 12 #D8CC0C 212 200 16 #D4C810 212 196 16 #D4C410 208 192 16 #D0C010 204 188 20 #CCBC14 200 184 20 #C8B814 200 180 20 #C8B414 196 176 24 #C4B018 192 172 24 #C0AC18 188 168 24 #BCA818 184 164 28 #B8A41C 184 160 28 #B8A01C 180 156 28 #B49C1C 176 152 32 #B09820 172 148 32 #AC9420 172 144 32 #AC9020 168 140 36 #A88C24 164 136 36 #A48824 160 132 36 #A08424 160 128 36 #A08024 156 124 40 #9C7C28 152 120 40 #987828 148 116 40 #947428 144 112 44 #90702C 144 108 44 #906C2C 140 104 44 #8C682C 136 100 48 #886430 132 96 48 #846030 132 92 48 #845C30 128 88 52 #805834 124 84 52 #7C5434 120 80 52 #785034 116 76 56 #744C38 116 72 56 #744838 112 68 56 #704438 108 64 60 #6C403C 104 60 60 #683C3C 104 56 60 #68383C 100 52 64 #643440 96 48 64 #603040 92 44 64 #5C2C40 88 40 68 #582844 88 36 68 #582444 84 32 68 #542044 80 28 72 #501C48 76 24 72 #4C1848 76 20 72 #4C1448 72 16 76 #48104C 68 12 76 #440C4C 64 8 76 #40084C 60 0 80 #3C0050 goxel-0.8.1/data/palettes/Tango-Palette.gpl000066400000000000000000000013041334742672700205550ustar00rootroot00000000000000GIMP Palette Name: Tango icons Columns: 3 # 252 233 79 Butter 1 237 212 0 Butter 2 196 160 0 Butter 3 138 226 52 Chameleon 1 115 210 22 Chameleon 2 78 154 6 Chameleon 3 252 175 62 Orange 1 245 121 0 Orange 2 206 92 0 Orange 3 114 159 207 Sky Blue 1 52 101 164 Sky Blue 2 32 74 135 Sky Blue 3 173 127 168 Plum 1 117 80 123 Plum 2 92 53 102 Plum 3 233 185 110 Chocolate 1 193 125 17 Chocolate 2 143 89 2 Chocolate 3 239 41 41 Scarlet Red 1 204 0 0 Scarlet Red 2 164 0 0 Scarlet Red 3 255 255 255 Snowy White 238 238 236 Aluminium 1 211 215 207 Aluminium 2 186 189 182 Aluminium 3 136 138 133 Aluminium 4 85 87 83 Aluminium 5 46 52 54 Aluminium 6 0 0 0 Jet Black goxel-0.8.1/data/palettes/Ubuntu.gpl000066400000000000000000000021171334742672700173760ustar00rootroot00000000000000GIMP Palette Name: Ubuntu Columns: 0 # 238 199 62 Orange Hilight 240 165 19 Orange 251 139 0 Orange Base 244 72 0 Orange Shadow 255 255 153 Accent Yellow Highlight 255 255 0 Yellow 253 202 1 Accent Yellow Base 152 102 1 Accent Yellow Shadow 244 72 0 Accent Orange 253 51 1 Accent Red 212 0 0 Accent Red Base 152 1 1 Accent Deep Red 253 217 155 Human Highlight 217 187 122 Human 129 102 71 Human Base 86 82 72 Environmental Shadow 170 204 238 Environmental Blue Highlight 102 153 204 Environmental Blue Medium 51 102 153 Environmental Blue Base 0 51 102 Environmental Blue Shadow 179 222 253 Accent Blue Shadow 1 151 253 Accent Blue 1 105 201 Accent Blue Base 1 51 151 Accent Blue Shadow 204 255 153 Accent Green Highlight 152 252 102 Accent Green 51 153 0 Accent Green Base 1 90 1 Accent Green Shadow 0 43 61 Ubuntu Toner 255 155 255 Accent Magenta Highlight 255 0 255 Accent Magenta 102 0 204 Accent Dark Violet 238 238 238 Grey 1 204 204 207 Grey 2 170 170 170 Grey 3 136 136 136 Grey 4 102 102 102 Grey 5 51 51 51 Grey 6 0 0 0 Black goxel-0.8.1/data/palettes/db16.gpl000066400000000000000000000005751334742672700166560ustar00rootroot00000000000000GIMP Palette Name: DB16 Columns: 8 # 20 12 28 Dark1 68 36 52 Dark2 48 52 109 Dark3 78 74 78 Dark4 133 76 48 Dark5 52 101 36 Dark6 208 70 72 Dark7 117 113 97 Dark8 89 125 206 Light1 210 125 44 Light2 133 149 161 Light3 109 170 44 Light4 210 170 153 Light5 109 194 202 Light6 218 212 94 Light7 222 238 214 Light8 goxel-0.8.1/data/palettes/db32.gpl000066400000000000000000000012221334742672700166420ustar00rootroot00000000000000GIMP Palette Name: DB32 Columns: 8 # 0 0 0 Black 34 32 52 Valhalla 69 40 60 Loulou 102 57 49 Oiled cedar 143 86 59 Rope 223 113 38 Tahiti gold 217 160 102 Twine 238 195 154 Pancho 251 242 54 Golden fizz 153 229 80 Atlantis 106 190 48 Christi 55 148 110 Elf green 75 105 47 Dell 82 75 36 Verdigris 50 60 57 Opal 63 63 116 Deep koamaru 48 96 130 Venice blue 91 110 225 Royal blue 99 155 255 Cornflower 95 205 228 Viking 203 219 252 Light steel blue 255 255 255 White 155 173 183 Heather 132 126 135 Topaz 105 106 106 Dim gray 89 86 82 Smokey ash 118 66 138 Clairvoyant 172 50 50 Brown 217 87 99 Mandy 215 123 186 Plum 143 151 74 Rain forest 138 111 48 Stinger goxel-0.8.1/data/palettes/echo-palette.gpl000066400000000000000000000012501334742672700204630ustar00rootroot00000000000000GIMP Palette Name: Echo Icon Theme Palette Columns: 3 # 25 174 255 Blue1 0 132 200 Blue2 0 92 148 Blue3 255 65 65 Red1 220 0 0 Red2 181 0 0 Red3 255 255 62 Orange1 255 153 0 Orange2 255 102 0 Orange3 255 192 34 Brown1 184 129 0 Brown2 128 77 0 Brown3 204 255 66 Green1 154 222 0 Green2 0 145 0 Green3 241 202 255 Purple1 215 108 255 Purple2 186 0 255 Purple3 189 205 212 Metalic1 158 171 176 Metalic2 54 78 89 Metalic3 14 35 46 Metalic4 255 255 255 Grey1 204 204 204 Grey2 153 153 153 Grey3 102 102 102 Grey4 45 45 45 Grey5 goxel-0.8.1/data/palettes/inkscape.gpl000066400000000000000000000220161334742672700177110ustar00rootroot00000000000000GIMP Palette Name: Inkscape default Columns: 3 # generated by PaletteGen.py 0 0 0 Black 26 26 26 90% Gray 51 51 51 80% Gray 77 77 77 70% Gray 102 102 102 60% Gray 128 128 128 50% Gray 153 153 153 40% Gray 179 179 179 30% Gray 204 204 204 20% Gray 230 230 230 10% Gray 236 236 236 7.5% Gray 242 242 242 5% Gray 249 249 249 2.5% Gray 255 255 255 White 128 0 0 Maroon (#800000) 255 0 0 Red (#FF0000) 128 128 0 Olive (#808000) 255 255 0 Yellow (#FFFF00) 0 128 0 Green (#008000) 0 255 0 Lime (#00FF00) 0 128 128 Teal (#008080) 0 255 255 Aqua (#00FFFF) 0 0 128 Navy (#000080) 0 0 255 Blue (#0000FF) 128 0 128 Purple (#800080) 255 0 255 Fuchsia (#FF00FF) 43 0 0 #2B0000 85 0 0 #550000 128 0 0 #800000 170 0 0 #AA0000 212 0 0 #D40000 255 0 0 #FF0000 255 42 42 #FF2A2A 255 85 85 #FF5555 255 128 128 #FF8080 255 170 170 #FFAAAA 255 213 213 #FFD5D5 40 11 11 #280B0B 80 22 22 #501616 120 33 33 #782121 160 44 44 #A02C2C 200 55 55 #C83737 211 95 95 #D35F5F 222 135 135 #DE8787 233 175 175 #E9AFAF 244 215 215 #F4D7D7 36 28 28 #241C1C 72 55 55 #483737 108 83 83 #6C5353 145 111 111 #916F6F 172 147 147 #AC9393 200 183 183 #C8B7B7 227 219 219 #E3DBDB 43 17 0 #2B1100 85 34 0 #552200 128 51 0 #803300 170 68 0 #AA4400 212 85 0 #D45500 255 102 0 #FF6600 255 127 42 #FF7F2A 255 153 85 #FF9955 255 179 128 #FFB380 255 204 170 #FFCCAA 255 230 213 #FFE6D5 40 23 11 #28170B 80 45 22 #502D16 120 68 33 #784421 160 90 44 #A05A2C 200 113 55 #C87137 211 141 95 #D38D5F 222 170 135 #DEAA87 233 198 175 #E9C6AF 244 227 215 #F4E3D7 36 31 28 #241F1C 72 62 55 #483E37 108 93 83 #6C5D53 145 124 111 #917C6F 172 157 147 #AC9D93 200 190 183 #C8BEB7 227 222 219 #E3DEDB 43 34 0 #2B2200 85 68 0 #554400 128 102 0 #806600 170 136 0 #AA8800 212 170 0 #D4AA00 255 204 0 #FFCC00 255 212 42 #FFD42A 255 221 85 #FFDD55 255 230 128 #FFE680 255 238 170 #FFEEAA 255 246 213 #FFF6D5 40 34 11 #28220B 80 68 22 #504416 120 103 33 #786721 160 137 44 #A0892C 200 171 55 #C8AB37 211 188 95 #D3BC5F 222 205 135 #DECD87 233 221 175 #E9DDAF 244 238 215 #F4EED7 36 34 28 #24221C 72 69 55 #484537 108 103 83 #6C6753 145 138 111 #918A6F 172 167 147 #ACA793 200 196 183 #C8C4B7 227 226 219 #E3E2DB 34 43 0 #222B00 68 85 0 #445500 102 128 0 #668000 136 170 0 #88AA00 170 212 0 #AAD400 204 255 0 #CCFF00 212 255 42 #D4FF2A 221 255 85 #DDFF55 229 255 128 #E5FF80 238 255 170 #EEFFAA 246 255 213 #F6FFD5 34 40 11 #22280B 68 80 22 #445016 103 120 33 #677821 137 160 44 #89A02C 171 200 55 #ABC837 188 211 95 #BCD35F 205 222 135 #CDDE87 221 233 175 #DDE9AF 238 244 215 #EEF4D7 34 36 28 #22241C 69 72 55 #454837 103 108 83 #676C53 138 145 111 #8A916F 167 172 147 #A7AC93 196 200 183 #C4C8B7 226 227 219 #E2E3DB 17 43 0 #112B00 34 85 0 #225500 51 128 0 #338000 68 170 0 #44AA00 85 212 0 #55D400 102 255 0 #66FF00 127 255 42 #7FFF2A 153 255 85 #99FF55 179 255 128 #B3FF80 204 255 170 #CCFFAA 229 255 213 #E5FFD5 23 40 11 #17280B 45 80 22 #2D5016 68 120 33 #447821 90 160 44 #5AA02C 113 200 55 #71C837 141 211 95 #8DD35F 170 222 135 #AADE87 198 233 175 #C6E9AF 227 244 215 #E3F4D7 31 36 28 #1F241C 62 72 55 #3E4837 93 108 83 #5D6C53 124 145 111 #7C916F 157 172 147 #9DAC93 190 200 183 #BEC8B7 222 227 219 #DEE3DB 0 43 0 #002B00 0 85 0 #005500 0 128 0 #008000 0 170 0 #00AA00 0 212 0 #00D400 0 255 0 #00FF00 42 255 42 #2AFF2A 85 255 85 #55FF55 128 255 128 #80FF80 170 255 170 #AAFFAA 213 255 213 #D5FFD5 11 40 11 #0B280B 22 80 22 #165016 33 120 33 #217821 44 160 44 #2CA02C 55 200 55 #37C837 95 211 95 #5FD35F 135 222 135 #87DE87 175 233 175 #AFE9AF 215 244 215 #D7F4D7 28 36 28 #1C241C 55 72 55 #374837 83 108 83 #536C53 111 145 111 #6F916F 147 172 147 #93AC93 183 200 183 #B7C8B7 219 227 219 #DBE3DB 0 43 17 #002B11 0 85 34 #005522 0 128 51 #008033 0 170 68 #00AA44 0 212 85 #00D455 0 255 102 #00FF66 42 255 128 #2AFF80 85 255 153 #55FF99 128 255 179 #80FFB3 170 255 204 #AAFFCC 213 255 230 #D5FFE6 11 40 23 #0B2817 22 80 45 #16502D 33 120 68 #217844 44 160 90 #2CA05A 55 200 113 #37C871 95 211 141 #5FD38D 135 222 170 #87DEAA 175 233 198 #AFE9C6 215 244 227 #D7F4E3 28 36 31 #1C241F 55 72 62 #37483E 83 108 93 #536C5D 111 145 124 #6F917C 147 172 157 #93AC9D 183 200 190 #B7C8BE 219 227 222 #DBE3DE 0 43 34 #002B22 0 85 68 #005544 0 128 102 #008066 0 170 136 #00AA88 0 212 170 #00D4AA 0 255 204 #00FFCC 42 255 213 #2AFFD5 85 255 221 #55FFDD 128 255 230 #80FFE6 170 255 238 #AAFFEE 213 255 246 #D5FFF6 11 40 34 #0B2822 22 80 68 #165044 33 120 103 #217867 44 160 137 #2CA089 55 200 171 #37C8AB 95 211 188 #5FD3BC 135 222 205 #87DECD 175 233 221 #AFE9DD 215 244 238 #D7F4EE 28 36 34 #1C2422 55 72 69 #374845 83 108 103 #536C67 111 145 138 #6F918A 147 172 167 #93ACA7 183 200 196 #B7C8C4 219 227 226 #DBE3E2 0 34 43 #00222B 0 68 85 #004455 0 102 128 #006680 0 136 170 #0088AA 0 170 212 #00AAD4 0 204 255 #00CCFF 42 212 255 #2AD4FF 85 221 255 #55DDFF 128 229 255 #80E5FF 170 238 255 #AAEEFF 213 246 255 #D5F6FF 11 34 40 #0B2228 22 68 80 #164450 33 103 120 #216778 44 137 160 #2C89A0 55 171 200 #37ABC8 95 188 211 #5FBCD3 135 205 222 #87CDDE 175 221 233 #AFDDE9 215 238 244 #D7EEF4 28 34 36 #1C2224 55 69 72 #374548 83 103 108 #53676C 111 138 145 #6F8A91 147 167 172 #93A7AC 183 196 200 #B7C4C8 219 226 227 #DBE2E3 0 17 43 #00112B 0 34 85 #002255 0 51 128 #003380 0 68 170 #0044AA 0 85 212 #0055D4 0 102 255 #0066FF 42 127 255 #2A7FFF 85 153 255 #5599FF 128 179 255 #80B3FF 170 204 255 #AACCFF 213 229 255 #D5E5FF 11 23 40 #0B1728 22 45 80 #162D50 33 68 120 #214478 44 90 160 #2C5AA0 55 113 200 #3771C8 95 141 211 #5F8DD3 135 170 222 #87AADE 175 198 233 #AFC6E9 215 227 244 #D7E3F4 28 31 36 #1C1F24 55 62 72 #373E48 83 93 108 #535D6C 111 124 145 #6F7C91 147 157 172 #939DAC 183 190 200 #B7BEC8 219 222 227 #DBDEE3 0 0 43 #00002B 0 0 85 #000055 0 0 128 #000080 0 0 170 #0000AA 0 0 212 #0000D4 0 0 255 #0000FF 42 42 255 #2A2AFF 85 85 255 #5555FF 128 128 255 #8080FF 170 170 255 #AAAAFF 213 213 255 #D5D5FF 11 11 40 #0B0B28 22 22 80 #161650 33 33 120 #212178 44 44 160 #2C2CA0 55 55 200 #3737C8 95 95 211 #5F5FD3 135 135 222 #8787DE 175 175 233 #AFAFE9 215 215 244 #D7D7F4 28 28 36 #1C1C24 55 55 72 #373748 83 83 108 #53536C 111 111 145 #6F6F91 147 147 172 #9393AC 183 183 200 #B7B7C8 219 219 227 #DBDBE3 17 0 43 #11002B 34 0 85 #220055 51 0 128 #330080 68 0 170 #4400AA 85 0 212 #5500D4 102 0 255 #6600FF 127 42 255 #7F2AFF 153 85 255 #9955FF 179 128 255 #B380FF 204 170 255 #CCAAFF 229 213 255 #E5D5FF 23 11 40 #170B28 45 22 80 #2D1650 68 33 120 #442178 90 44 160 #5A2CA0 113 55 200 #7137C8 141 95 211 #8D5FD3 170 135 222 #AA87DE 198 175 233 #C6AFE9 227 215 244 #E3D7F4 31 28 36 #1F1C24 62 55 72 #3E3748 93 83 108 #5D536C 124 111 145 #7C6F91 157 147 172 #9D93AC 190 183 200 #BEB7C8 222 219 227 #DEDBE3 34 0 43 #22002B 68 0 85 #440055 102 0 128 #660080 136 0 170 #8800AA 170 0 212 #AA00D4 204 0 255 #CC00FF 212 42 255 #D42AFF 221 85 255 #DD55FF 229 128 255 #E580FF 238 170 255 #EEAAFF 246 213 255 #F6D5FF 34 11 40 #220B28 68 22 80 #441650 103 33 120 #672178 137 44 160 #892CA0 171 55 200 #AB37C8 188 95 211 #BC5FD3 205 135 222 #CD87DE 221 175 233 #DDAFE9 238 215 244 #EED7F4 34 28 36 #221C24 69 55 72 #453748 103 83 108 #67536C 138 111 145 #8A6F91 167 147 172 #A793AC 196 183 200 #C4B7C8 226 219 227 #E2DBE3 43 0 34 #2B0022 85 0 68 #550044 128 0 102 #800066 170 0 136 #AA0088 212 0 170 #D400AA 255 0 204 #FF00CC 255 42 212 #FF2AD4 255 85 221 #FF55DD 255 128 229 #FF80E5 255 170 238 #FFAAEE 255 213 246 #FFD5F6 40 11 34 #280B22 80 22 68 #501644 120 33 103 #782167 160 44 137 #A02C89 200 55 171 #C837AB 211 95 188 #D35FBC 222 135 205 #DE87CD 233 175 221 #E9AFDD 244 215 238 #F4D7EE 36 28 34 #241C22 72 55 69 #483745 108 83 103 #6C5367 145 111 138 #916F8A 172 147 167 #AC93A7 200 183 196 #C8B7C4 227 219 226 #E3DBE2 43 0 17 #2B0011 85 0 34 #550022 128 0 51 #800033 170 0 68 #AA0044 212 0 85 #D40055 255 0 102 #FF0066 255 42 127 #FF2A7F 255 85 153 #FF5599 255 128 178 #FF80B2 255 170 204 #FFAACC 255 213 229 #FFD5E5 40 11 23 #280B17 80 22 45 #50162D 120 33 68 #782144 160 44 90 #A02C5A 200 55 113 #C83771 211 95 141 #D35F8D 222 135 170 #DE87AA 233 175 198 #E9AFC6 244 215 227 #F4D7E3 36 28 31 #241C1F 72 55 62 #48373E 108 83 93 #6C535D 145 111 124 #916F7C 172 147 157 #AC939D 200 183 190 #C8B7BE 227 219 222 #E3DBDE goxel-0.8.1/data/palettes/webhex.gpl000066400000000000000000000100441334742672700173740ustar00rootroot00000000000000GIMP Palette Name: WebHex # 255 255 255 FFFFFF 255 255 204 FFFFCC 255 255 153 FFFF99 255 255 102 FFFF66 255 255 51 FFFF33 255 255 0 FFFF00 255 204 255 FFCCFF 255 204 204 FFCCCC 255 204 153 FFCC99 255 204 102 FFCC66 255 204 51 FFCC33 255 204 0 FFCC00 255 153 255 FF99FF 255 153 204 FF99CC 255 153 153 FF9999 255 153 102 FF9966 255 153 51 FF9933 255 153 0 FF9900 255 102 255 FF66FF 255 102 204 FF66CC 255 102 153 FF6699 255 102 102 FF6666 255 102 51 FF6633 255 102 0 FF6600 255 51 255 FF33FF 255 51 204 FF33CC 255 51 153 FF3399 255 51 102 FF3366 255 51 51 FF3333 255 51 0 FF3300 255 0 255 FF00FF 255 0 204 FF00CC 255 0 153 FF0099 255 0 102 FF0066 255 0 51 FF0033 255 0 0 FF0000 204 255 255 CCFFFF 204 255 204 CCFFCC 204 255 153 CCFF99 204 255 102 CCFF66 204 255 51 CCFF33 204 255 0 CCFF00 204 204 255 CCCCFF 204 204 204 CCCCCC 204 204 153 CCCC99 204 204 102 CCCC66 204 204 51 CCCC33 204 204 0 CCCC00 204 153 255 CC99FF 204 153 204 CC99CC 204 153 153 CC9999 204 153 102 CC9966 204 153 51 CC9933 204 153 0 CC9900 204 102 255 CC66FF 204 102 204 CC66CC 204 102 153 CC6699 204 102 102 CC6666 204 102 51 CC6633 204 102 0 CC6600 204 51 255 CC33FF 204 51 204 CC33CC 204 51 153 CC3399 204 51 102 CC3366 204 51 51 CC3333 204 51 0 CC3300 204 0 255 CC00FF 204 0 204 CC00CC 204 0 153 CC0099 204 0 102 CC0066 204 0 51 CC0033 204 0 0 CC0000 153 255 255 99FFFF 153 255 204 99FFCC 153 255 153 99FF99 153 255 102 99FF66 153 255 51 99FF33 153 255 0 99FF00 153 204 255 99CCFF 153 204 204 99CCCC 153 204 153 99CC99 153 204 102 99CC66 153 204 51 99CC33 153 204 0 99CC00 153 153 255 9999FF 153 153 204 9999CC 153 153 153 999999 153 153 102 999966 153 153 51 999933 153 153 0 999900 153 102 255 9966FF 153 102 204 9966CC 153 102 153 996699 153 102 102 996666 153 102 51 996633 153 102 0 996600 153 51 255 9933FF 153 51 204 9933CC 153 51 153 993399 153 51 102 993366 153 51 51 993333 153 51 0 993300 153 0 255 9900FF 153 0 204 9900CC 153 0 153 990099 153 0 102 990066 153 0 51 990033 153 0 0 990000 102 255 255 66FFFF 102 255 204 66FFCC 102 255 153 66FF99 102 255 102 66FF66 102 255 51 66FF33 102 255 0 66FF00 102 204 255 66CCFF 102 204 204 66CCCC 102 204 153 66CC99 102 204 102 66CC66 102 204 51 66CC33 102 204 0 66CC00 102 153 255 6699FF 102 153 204 6699CC 102 153 153 669999 102 153 102 669966 102 153 51 669933 102 153 0 669900 102 102 255 6666FF 102 102 204 6666CC 102 102 153 666699 102 102 102 666666 102 102 51 666633 102 102 0 666600 102 51 255 6633FF 102 51 204 6633CC 102 51 153 663399 102 51 102 663366 102 51 51 663333 102 51 0 663300 102 0 255 6600FF 102 0 204 6600CC 102 0 153 660099 102 0 102 660066 102 0 51 660033 102 0 0 660000 51 255 255 33FFFF 51 255 204 33FFCC 51 255 153 33FF99 51 255 102 33FF66 51 255 51 33FF33 51 255 0 33FF00 51 204 255 33CCFF 51 204 204 33CCCC 51 204 153 33CC99 51 204 102 33CC66 51 204 51 33CC33 51 204 0 33CC00 51 153 255 3399FF 51 153 204 3399CC 51 153 153 339999 51 153 102 339966 51 153 51 339933 51 153 0 339900 51 102 255 3366FF 51 102 204 3366CC 51 102 153 336699 51 102 102 336666 51 102 51 336633 51 102 0 336600 51 51 255 3333FF 51 51 204 3333CC 51 51 153 333399 51 51 102 333366 51 51 51 333333 51 51 0 333300 51 0 255 3300FF 51 0 204 3300CC 51 0 153 330099 51 0 102 330066 51 0 51 330033 51 0 0 330000 0 255 255 00FFFF 0 255 204 00FFCC 0 255 153 00FF99 0 255 102 00FF66 0 255 51 00FF33 0 255 0 00FF00 0 204 255 00CCFF 0 204 204 00CCCC 0 204 153 00CC99 0 204 102 00CC66 0 204 51 00CC33 0 204 0 00CC00 0 153 255 0099FF 0 153 204 0099CC 0 153 153 009999 0 153 102 009966 0 153 51 009933 0 153 0 009900 0 102 255 0066FF 0 102 204 0066CC 0 102 153 006699 0 102 102 006666 0 102 51 006633 0 102 0 006600 0 51 255 0033FF 0 51 204 0033CC 0 51 153 003399 0 51 102 003366 0 51 51 003333 0 51 0 003300 0 0 255 0000FF 0 0 204 0000CC 0 0 153 000099 0 0 102 000066 0 0 51 000033 0 0 0 000000 goxel-0.8.1/data/progs/000077500000000000000000000000001334742672700147205ustar00rootroot00000000000000goxel-0.8.1/data/progs/cherry.goxcf000066400000000000000000000007241334742672700172470ustar00rootroot00000000000000shape main { [seed 7] tree(0, 40, 10)[s 10 light -0.9] } shape tree($n, $e, $f) rule { cylinder[] if ($n < $e) { tree($n + 1)[rz 0+-10 z 0.5 s 0.95 z 0.5 rx 4] } if (($n >= $e) || ($n > $f && 0+-1 > 0.5)) { flower[] } } rule 0.1 { tree[rz 180] } rule 0.08 { tree[] tree($n + 1)[rz 0+-180 rx -45] } shape flower { [light 0.5 sat 0.7 sn 1 s 6 z -0.5 x -1 hue -10] sphere[x 0+-0.5 0+-0.5 light 0+-0.2] }goxel-0.8.1/data/progs/city.goxcf000066400000000000000000000022561334742672700167250ustar00rootroot00000000000000shape main { [seed 4] city[] } shape ground { [s 128 128 1 light -0.6 sat 0.2 hue 50] cube[] loop 16 [] { cube[x 0+-0.4 0+-0.4 s 0.2+-0.1 0.2+-0.1 3+-1 light -0.3+-0.2] } } shape city { ground[] loop 128 [wait 1] { building[x 0+-58 0+-58 s 2+-0.5 sat 0.2+-0.1 hue 0+-180] } } shape building // Tall building rule 1 { [s 3] $n = int(10+-5) loop $n [z 1 wait 1] { $s = 2+-0.2 floor[s $s $s 1 z 0.5] } [z $n - 0.5] loop 1+-2 [] { antenna[] } } // Low building rule 1 { [s 8+-4 8+-4 4+-2 z 0.5] cube[light -0.3] windows(8)[] loop 2+-1 [] {antenna[]} } // Tree rule 10 { [z 0.5 sn 1 z 0.5] [sat 1 0.5 light 1 0.2 hue 1 20] cube[z 0.5 sz 5] loop 2 [] { sphere[z 4 s 4+-1 x 0+-0.1 0+-0.1 hue 100+-40] } } shape windows($n) { loop $n [rz 90] { cube[x 0.5 0+-0.4 sn s 1/3 x -0.5 light 1 1 light 0+-0.2] } } shape floor { cube[light -0.5+-0.1] windows(8)[] } shape antenna { [z 0.5 x 0+-0.4 0+-0.4 sn 1 sz 2+-1 z 0.5 light -0.5] cube[] }goxel-0.8.1/data/progs/intro.goxcf000066400000000000000000000047671334742672700171210ustar00rootroot00000000000000// The 'main' shape is always the entry point of the program. shape main { // Initial random seed of 2. // Remove this line to use different seed each time. [seed 2] // Improves marching cube rendering. [antialiased 1] // Render a single white voxel. cube [] // Put an other cube next to it. // 'x' applies a translation of 1 along x. // Those transformation are only applied // to this cube. cube [x 1] // Now render a bigger grey sphere. // light -0.5 move the light value to half // the current value of 1 and the target sphere [s 10 x 1 light -0.5] // We can also render cylinders: cylinder [s 10 x -1 light -0.9] // This time we use a user defined shape. // And we increase the saturation to give it a color. my_shape [z 20 light -0.5 sat 0.5] } // A user defined shape shape my_shape { // s 8 8 1 scales with different values // for each axis. // rx A applies a rotation along z of // 45 deg. // Note that the color is red, because we set the // Saturation when we called my_shape. cube [s 8 8 1 z 1 rz 45] // Loop 16 time, each time increasing the x // translation and the hue. loop 16 [x 2 hue 10] { cube [] } // The loop transformations only affect // the loop block, after it we return to // the previous context. sphere [s 6 z 1] // Let's try a recursive shape: tree [x -10 s 4] // And an other one with a bit or randomness: tree2 [x 10 s 4 rz 180 hue 180] // A shape with several rules: my_other_shape [y 10 rz 90 hue -60 s 3] } // Tree render a cylinder and then call itself. // Since we scale down the shape at each iteration // at some point it becomes too small, and is // then automatically stopped. shape tree { cylinder [] tree [z 1 s 0.99 ry -6] } shape tree2 { cylinder [] // 'A +- B' means that we use a random value in the range // A - B, A + B. this make the second spiral a bit // messy. tree2 [z 1 s 0.99 ry -6+-6] } // Here 'my_other_shape' defines several rules. The rule // used is picked randomly using the weight. shape my_other_shape // Most of the time, just keep growing in z. rule 15 { cube [] my_other_shape [z 1] } // Sometime split into two rule 1 { my_other_shape [rx 45 s 0.9] my_other_shape [rx -45 s 0.9] } // Some other times render a shpere and stop rule 0.5 { // 'hue 1 70' means that we immediately set the hue // to 70 (yellow). sphere [s 3 hue 1 70] } goxel-0.8.1/data/progs/planet.goxcf000066400000000000000000000010121334742672700172250ustar00rootroot00000000000000// Simple planet shape main { [s 50] sphere [sat 0.5 light -0.75 hue 200] loop 3 [] { continent[rz 0+-180 ry 0+-180 hue 1 40+-10 sat 1 0.5 light -0.5+-0.1] } loop 16 [wait 1] { cloud [rz 0+-180 ry 0+-180 hue 200 light -0.1 sat 0.5] } } shape continent { loop 30 [rz 10 rx 0+-80 wait 1] { sphere[x 0.3 s 0.4+-0.05] } } shape cloud { loop 5 [rz 2 rx 0+-180 wait 1] { sphere[x 0.5 s 0.04 +- 0.01] } } goxel-0.8.1/data/progs/test.goxcf000066400000000000000000000005021334742672700167240ustar00rootroot00000000000000// Simple Test shape branch rule { cylinder [sz 0.7] branch [rz 0 z 0.25 s 0.9 rx 30 z 0.25 light -0.1 hue 10 sat 0.1] } rule 0.2 { branch [rz 180] } rule 0.2 { branch [rz 90] } rule 0.1 { branch [rx -90 s 0.8 z 1] branch [] } shape main { [light 1 antialiased 1] branch [s 32] } goxel-0.8.1/data/progs/test2.goxcf000066400000000000000000000006421334742672700170130ustar00rootroot00000000000000shape main { [antialiased 1] [light 0.5 sat 0.5 s 100] loop 5 [s -0.95 light 0.1 sat 0.01 hue 5] { sphere [light -0.6 hue 30] } loop 30 [wait 1] { sphere [sub rz 0+-180 ry 0+-180 z 0.5 s 0.3] } loop 2 [rz 90] { loop 120 [ry 10 wait 1] { sphere [hue 30+-30 light -0.5+-0.4 z 0.5 s 0.05+-0.01 z 4+-0.5] } } } goxel-0.8.1/data/progs/test3.goxcf000066400000000000000000000004551334742672700170160ustar00rootroot00000000000000shape main { [antialiased 1] loop 8 [rz 45] { test [s 20 x 2] } } shape test { [sat 0.4 light -0.2 hue 240] sphere[] cube [z 0.5 sub] tige (15) [s 0.5 light -0.5] } shape tige ($n) { cylinder[] if $n { tige($n - 1)[z 0.5 ry $n z 0.5 sat -0.1] } } goxel-0.8.1/data/progs/tree-big.goxcf000066400000000000000000000010341334742672700174440ustar00rootroot00000000000000 shape leaf { cube[] leaf[x 0.5 s 0.9 0.9 0.8 ry 25 x 0.4] } shape top { loop 8 [rz 360 / 8] { [life 8 sy 2 z 0+-5] leaf[s 5 light -0.4 sat 0.5 hue 60+-20 ry -45] } } shape part($n) { loop $i = $n [z 1 rz 30+-10 rx 0+-10 wait 1] { cylinder[s 4 x 0.1 light 0+-0.1] if ($i == int($n - 2)) { top[] } } } shape main { [antialiased 1 hue 40 light -0.5 sat 0.5] $n = 40+-10 loop 3 [rz 120+-45] { [y 0.5] part($n)[light -0.3+-0.05] } } goxel-0.8.1/data/progs/tree-small.goxcf000066400000000000000000000005631334742672700200210ustar00rootroot00000000000000shape branch2 { cube[] branch2 [z 0.5 s 0.8 rx 20+-4 z 0.5] } shape branch { [rx 90] branch2[s 2] } shape tree($s) { loop $s [z 1] { cube[s 1 light -0.8+-0.1 sat 0.5] } [z $s] [sat 1 light -0.5 hue 50+-30] loop 6 [rz 360 / 6 rz 0+-10] { branch[light 0+-0.3] } } shape main { [antialiased 0] tree(8+-2)[] } goxel-0.8.1/data/shaders/000077500000000000000000000000001334742672700152175ustar00rootroot00000000000000goxel-0.8.1/data/shaders/background.glsl000066400000000000000000000010711334742672700202200ustar00rootroot00000000000000varying lowp vec4 v_color; #ifdef VERTEX_SHADER /************************************************************************/ attribute highp vec3 a_pos; attribute lowp vec4 a_color; void main() { gl_Position = vec4(a_pos, 1.0); v_color = a_color; } /************************************************************************/ #endif #ifdef FRAGMENT_SHADER /************************************************************************/ void main() { gl_FragColor = v_color; } /************************************************************************/ #endif goxel-0.8.1/data/shaders/mesh.glsl000066400000000000000000000102011334742672700170300ustar00rootroot00000000000000/* * I followed those name conventions. All the vectors are expressed in eye * coordinates. * * reflection light source * * r s * ^ ^ * \ n / * eye \ ^ / * v <.... \ | / * -----__\|/ * ----+---- * * */ uniform highp mat4 u_model; uniform highp mat4 u_view; uniform highp mat4 u_proj; uniform highp mat4 u_shadow_mvp; uniform lowp float u_pos_scale; // Light parameters uniform lowp vec3 u_l_dir; uniform lowp float u_l_int; // Material parameters uniform lowp float u_m_amb; // Ambient light coef. uniform lowp float u_m_dif; // Diffuse light coef. uniform lowp float u_m_spe; // Specular light coef. uniform lowp float u_m_shi; // Specular light shininess. uniform lowp float u_m_smo; // Smoothness. uniform mediump sampler2D u_bshadow_tex; uniform mediump sampler2D u_bump_tex; uniform mediump float u_bshadow; uniform mediump sampler2D u_shadow_tex; uniform mediump float u_shadow_k; varying highp vec3 v_pos; varying lowp vec4 v_color; varying mediump vec2 v_bshadow_uv; varying mediump vec2 v_uv; varying mediump vec2 v_bump_uv; varying mediump vec3 v_normal; varying mediump vec4 v_shadow_coord; #ifdef VERTEX_SHADER /************************************************************************/ attribute highp vec3 a_pos; attribute mediump vec3 a_normal; attribute lowp vec4 a_color; attribute mediump vec2 a_bshadow_uv; attribute mediump vec2 a_bump_uv; // bump tex base coordinates [0,255] attribute mediump vec2 a_uv; // uv coordinates [0,1] void main() { v_normal = a_normal; v_color = a_color; v_bshadow_uv = (a_bshadow_uv + 0.5) / (16.0 * VOXEL_TEXTURE_SIZE); v_pos = a_pos * u_pos_scale; v_uv = a_uv; v_bump_uv = a_bump_uv; gl_Position = u_proj * u_view * u_model * vec4(v_pos, 1.0); v_shadow_coord = (u_shadow_mvp * u_model * vec4(v_pos, 1.0)); } /************************************************************************/ #endif #ifdef FRAGMENT_SHADER /************************************************************************/ mediump vec2 uv, bump_uv; mediump vec3 n, s, r, v, bump; mediump float s_dot_n; lowp float l_amb, l_dif, l_spe; lowp float bshadow; lowp float visibility; lowp vec2 PS[4]; // Poisson offsets used for the shadow map. int i; void main() { // clamp uv so to prevent overflow with multismapling. uv = clamp(v_uv, 0.0, 1.0); s = u_l_dir; n = normalize((u_view * u_model * vec4(v_normal, 0.0)).xyz); bump_uv = (v_bump_uv + 0.5 + uv * 15.0) / 256.0; bump = texture2D(u_bump_tex, bump_uv).xyz - 0.5; bump = normalize((u_view * u_model * vec4(bump, 0.0)).xyz); n = mix(bump, n, u_m_smo); s_dot_n = dot(s, n); l_dif = u_m_dif * max(0.0, s_dot_n); l_amb = u_m_amb; // Specular light. v = normalize(-(u_view * u_model * vec4(v_pos, 1.0)).xyz); r = reflect(-s, n); l_spe = u_m_spe * pow(max(dot(r, v), 0.0), u_m_shi); l_spe = s_dot_n > 0.0 ? l_spe : 0.0; bshadow = texture2D(u_bshadow_tex, v_bshadow_uv).r; bshadow = sqrt(bshadow); bshadow = mix(1.0, bshadow, u_bshadow); gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); gl_FragColor.rgb += (l_dif + l_amb) * u_l_int * v_color.rgb; gl_FragColor.rgb += l_spe * u_l_int * vec3(1.0); gl_FragColor.rgb *= bshadow; // Shadow map. #ifdef SHADOW visibility = 1.0; mediump vec4 shadow_coord = v_shadow_coord / v_shadow_coord.w; lowp float bias = 0.005 * tan(acos(clamp(s_dot_n, 0.0, 1.0))); bias = clamp(bias, 0.0, 0.015); shadow_coord.z -= bias; PS[0] = vec2(-0.94201624, -0.39906216) / 1024.0; PS[1] = vec2(+0.94558609, -0.76890725) / 1024.0; PS[2] = vec2(-0.09418410, -0.92938870) / 1024.0; PS[3] = vec2(+0.34495938, +0.29387760) / 1024.0; for (i = 0; i < 4; i++) if (texture2D(u_shadow_tex, v_shadow_coord.xy + PS[i]).z < shadow_coord.z) visibility -= 0.2; if (s_dot_n <= 0.0) visibility = 0.5; gl_FragColor.rgb *= mix(1.0, visibility, u_shadow_k); #endif } /************************************************************************/ #endif goxel-0.8.1/data/shaders/model3d.glsl000066400000000000000000000053151334742672700174350ustar00rootroot00000000000000#if defined(GL_ES) && defined(FRAGMENT_SHADER) #extension GL_OES_standard_derivatives : enable #endif uniform highp mat4 u_model; uniform highp mat4 u_view; uniform highp mat4 u_proj; uniform highp mat4 u_clip; uniform lowp vec4 u_color; uniform mediump vec2 u_uv_scale; uniform lowp float u_grid_alpha; uniform mediump vec3 u_l_dir; uniform mediump float u_l_diff; uniform mediump float u_l_emit; uniform mediump sampler2D u_tex; uniform mediump float u_strip; uniform mediump float u_time; varying mediump vec3 v_normal; varying highp vec3 v_pos; varying lowp vec4 v_color; varying mediump vec2 v_uv; varying mediump vec4 v_clip_pos; #ifdef VERTEX_SHADER /************************************************************************/ attribute highp vec3 a_pos; attribute lowp vec4 a_color; attribute mediump vec3 a_normal; attribute mediump vec2 a_uv; void main() { lowp vec4 col = u_color * a_color; highp vec3 pos = (u_view * u_model * vec4(a_pos, 1.0)).xyz; if (u_clip[3][3] > 0.0) v_clip_pos = u_clip * u_model * vec4(a_pos, 1.0); gl_Position = u_proj * vec4(pos, 1.0); mediump float diff = max(0.0, dot(u_l_dir, a_normal)); col.rgb *= (u_l_emit + u_l_diff * diff); v_color = col; v_uv = a_uv * u_uv_scale; v_pos = (u_model * vec4(a_pos, 1.0)).xyz; v_normal = a_normal; } /************************************************************************/ #endif #ifdef FRAGMENT_SHADER /************************************************************************/ void main() { gl_FragColor = v_color * texture2D(u_tex, v_uv); if (u_strip > 0.0) { mediump float p = gl_FragCoord.x + gl_FragCoord.y + u_time * 4.0; if (mod(p, 8.0) < 4.0) gl_FragColor.rgb *= 0.5; } if (u_clip[3][3] > 0.0) { if ( v_clip_pos[0] < -v_clip_pos[3] || v_clip_pos[1] < -v_clip_pos[3] || v_clip_pos[2] < -v_clip_pos[3] || v_clip_pos[0] > +v_clip_pos[3] || v_clip_pos[1] > +v_clip_pos[3] || v_clip_pos[2] > +v_clip_pos[3]) discard; } // Grid effect. #if !defined(GL_ES) || defined(GL_OES_standard_derivatives) if (u_grid_alpha > 0.0) { mediump vec2 c; if (abs((u_model * vec4(v_normal, 0.0)).x) > 0.5) c = v_pos.yz; if (abs((u_model * vec4(v_normal, 0.0)).y) > 0.5) c = v_pos.zx; if (abs((u_model * vec4(v_normal, 0.0)).z) > 0.5) c = v_pos.xy; mediump vec2 grid = abs(fract(c - 0.5) - 0.5) / fwidth(c); mediump float line = min(grid.x, grid.y); gl_FragColor.rgb *= mix(1.0 - u_grid_alpha, 1.0, min(line, 1.0)); } #endif } /************************************************************************/ #endif goxel-0.8.1/data/shaders/pos_data.glsl000066400000000000000000000014251334742672700176760ustar00rootroot00000000000000varying lowp vec2 v_pos_data; uniform highp mat4 u_model; uniform highp mat4 u_view; uniform highp mat4 u_proj; uniform lowp vec2 u_block_id; #ifdef VERTEX_SHADER /************************************************************************/ attribute highp vec3 a_pos; attribute lowp vec2 a_pos_data; void main() { highp vec3 pos = a_pos; gl_Position = u_proj * u_view * u_model * vec4(pos, 1.0); v_pos_data = a_pos_data; } /************************************************************************/ #endif #ifdef FRAGMENT_SHADER /************************************************************************/ void main() { gl_FragColor.rg = u_block_id; gl_FragColor.ba = v_pos_data; } /************************************************************************/ #endif goxel-0.8.1/data/shaders/shadow_map.glsl000066400000000000000000000011761334742672700202310ustar00rootroot00000000000000#ifdef VERTEX_SHADER /************************************************************************/ attribute highp vec3 a_pos; uniform highp mat4 u_model; uniform highp mat4 u_view; uniform highp mat4 u_proj; uniform mediump float u_pos_scale; void main() { gl_Position = u_proj * u_view * u_model * vec4(a_pos * u_pos_scale, 1.0); } /************************************************************************/ #endif #ifdef FRAGMENT_SHADER /************************************************************************/ void main() {} /************************************************************************/ #endif goxel-0.8.1/data/sounds/000077500000000000000000000000001334742672700151015ustar00rootroot00000000000000goxel-0.8.1/data/sounds/click.wav000066400000000000000000000010141334742672700167010ustar00rootroot00000000000000RIFFWAVEfmt Ddata@7UNS.'' h|fWOfjBI_ȜNVr*N@R+%ES\+4+S(zK黳uis_leaf())? ~idx: idx; } /* BVH */ BVH::BVH(const BVHParams& params_, const vector& objects_) : params(params_), objects(objects_) { } BVH *BVH::create(const BVHParams& params, const vector& objects) { switch(params.bvh_layout) { case BVH_LAYOUT_BVH2: return new BVH2(params, objects); case BVH_LAYOUT_BVH4: return new BVH4(params, objects); case BVH_LAYOUT_NONE: case BVH_LAYOUT_ALL: break; } LOG(DFATAL) << "Requested unsupported BVH layout."; return NULL; } /* Building */ void BVH::build(Progress& progress) { progress.set_substatus("Building BVH"); /* build nodes */ BVHBuild bvh_build(objects, pack.prim_type, pack.prim_index, pack.prim_object, pack.prim_time, params, progress); BVHNode *root = bvh_build.run(); if(progress.get_cancel()) { if(root) root->deleteSubtree(); return; } /* pack triangles */ progress.set_substatus("Packing BVH triangles and strands"); pack_primitives(); if(progress.get_cancel()) { root->deleteSubtree(); return; } /* pack nodes */ progress.set_substatus("Packing BVH nodes"); pack_nodes(root); /* free build nodes */ root->deleteSubtree(); } /* Refitting */ void BVH::refit(Progress& progress) { progress.set_substatus("Packing BVH primitives"); pack_primitives(); if(progress.get_cancel()) return; progress.set_substatus("Refitting BVH nodes"); refit_nodes(); } void BVH::refit_primitives(int start, int end, BoundBox& bbox, uint& visibility) { /* Refit range of primitives. */ for(int prim = start; prim < end; prim++) { int pidx = pack.prim_index[prim]; int tob = pack.prim_object[prim]; Object *ob = objects[tob]; if(pidx == -1) { /* Object instance. */ bbox.grow(ob->bounds); } else { /* Primitives. */ const Mesh *mesh = ob->mesh; if(pack.prim_type[prim] & PRIMITIVE_ALL_CURVE) { /* Curves. */ int str_offset = (params.top_level)? mesh->curve_offset: 0; Mesh::Curve curve = mesh->get_curve(pidx - str_offset); int k = PRIMITIVE_UNPACK_SEGMENT(pack.prim_type[prim]); curve.bounds_grow(k, &mesh->curve_keys[0], &mesh->curve_radius[0], bbox); visibility |= PATH_RAY_CURVE; /* Motion curves. */ if(mesh->use_motion_blur) { Attribute *attr = mesh->curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); if(attr) { size_t mesh_size = mesh->curve_keys.size(); size_t steps = mesh->motion_steps - 1; float3 *key_steps = attr->data_float3(); for(size_t i = 0; i < steps; i++) curve.bounds_grow(k, key_steps + i*mesh_size, &mesh->curve_radius[0], bbox); } } } else { /* Triangles. */ int tri_offset = (params.top_level)? mesh->tri_offset: 0; Mesh::Triangle triangle = mesh->get_triangle(pidx - tri_offset); const float3 *vpos = &mesh->verts[0]; triangle.bounds_grow(vpos, bbox); /* Motion triangles. */ if(mesh->use_motion_blur) { Attribute *attr = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); if(attr) { size_t mesh_size = mesh->verts.size(); size_t steps = mesh->motion_steps - 1; float3 *vert_steps = attr->data_float3(); for(size_t i = 0; i < steps; i++) triangle.bounds_grow(vert_steps + i*mesh_size, bbox); } } } } visibility |= ob->visibility_for_tracing(); } } /* Triangles */ void BVH::pack_triangle(int idx, float4 tri_verts[3]) { int tob = pack.prim_object[idx]; assert(tob >= 0 && tob < objects.size()); const Mesh *mesh = objects[tob]->mesh; int tidx = pack.prim_index[idx]; Mesh::Triangle t = mesh->get_triangle(tidx); const float3 *vpos = &mesh->verts[0]; float3 v0 = vpos[t.v[0]]; float3 v1 = vpos[t.v[1]]; float3 v2 = vpos[t.v[2]]; tri_verts[0] = float3_to_float4(v0); tri_verts[1] = float3_to_float4(v1); tri_verts[2] = float3_to_float4(v2); } void BVH::pack_primitives() { const size_t tidx_size = pack.prim_index.size(); size_t num_prim_triangles = 0; /* Count number of triangles primitives in BVH. */ for(unsigned int i = 0; i < tidx_size; i++) { if((pack.prim_index[i] != -1)) { if((pack.prim_type[i] & PRIMITIVE_ALL_TRIANGLE) != 0) { ++num_prim_triangles; } } } /* Reserve size for arrays. */ pack.prim_tri_index.clear(); pack.prim_tri_index.resize(tidx_size); pack.prim_tri_verts.clear(); pack.prim_tri_verts.resize(num_prim_triangles * 3); pack.prim_visibility.clear(); pack.prim_visibility.resize(tidx_size); /* Fill in all the arrays. */ size_t prim_triangle_index = 0; for(unsigned int i = 0; i < tidx_size; i++) { if(pack.prim_index[i] != -1) { int tob = pack.prim_object[i]; Object *ob = objects[tob]; if((pack.prim_type[i] & PRIMITIVE_ALL_TRIANGLE) != 0) { pack_triangle(i, (float4*)&pack.prim_tri_verts[3 * prim_triangle_index]); pack.prim_tri_index[i] = 3 * prim_triangle_index; ++prim_triangle_index; } else { pack.prim_tri_index[i] = -1; } pack.prim_visibility[i] = ob->visibility_for_tracing(); if(pack.prim_type[i] & PRIMITIVE_ALL_CURVE) { pack.prim_visibility[i] |= PATH_RAY_CURVE; } } else { pack.prim_tri_index[i] = -1; pack.prim_visibility[i] = 0; } } } /* Pack Instances */ void BVH::pack_instances(size_t nodes_size, size_t leaf_nodes_size) { /* The BVH's for instances are built separately, but for traversal all * BVH's are stored in global arrays. This function merges them into the * top level BVH, adjusting indexes and offsets where appropriate. */ /* TODO(sergey): This code needs adjustment for wider BVH than 4. */ const bool use_qbvh = (params.bvh_layout == BVH_LAYOUT_BVH4); /* Adjust primitive index to point to the triangle in the global array, for * meshes with transform applied and already in the top level BVH. */ for(size_t i = 0; i < pack.prim_index.size(); i++) if(pack.prim_index[i] != -1) { if(pack.prim_type[i] & PRIMITIVE_ALL_CURVE) pack.prim_index[i] += objects[pack.prim_object[i]]->mesh->curve_offset; else pack.prim_index[i] += objects[pack.prim_object[i]]->mesh->tri_offset; } /* track offsets of instanced BVH data in global array */ size_t prim_offset = pack.prim_index.size(); size_t nodes_offset = nodes_size; size_t nodes_leaf_offset = leaf_nodes_size; /* clear array that gives the node indexes for instanced objects */ pack.object_node.clear(); /* reserve */ size_t prim_index_size = pack.prim_index.size(); size_t prim_tri_verts_size = pack.prim_tri_verts.size(); size_t pack_prim_index_offset = prim_index_size; size_t pack_prim_tri_verts_offset = prim_tri_verts_size; size_t pack_nodes_offset = nodes_size; size_t pack_leaf_nodes_offset = leaf_nodes_size; size_t object_offset = 0; map mesh_map; foreach(Object *ob, objects) { Mesh *mesh = ob->mesh; BVH *bvh = mesh->bvh; if(mesh->need_build_bvh()) { if(mesh_map.find(mesh) == mesh_map.end()) { prim_index_size += bvh->pack.prim_index.size(); prim_tri_verts_size += bvh->pack.prim_tri_verts.size(); nodes_size += bvh->pack.nodes.size(); leaf_nodes_size += bvh->pack.leaf_nodes.size(); mesh_map[mesh] = 1; } } } mesh_map.clear(); pack.prim_index.resize(prim_index_size); pack.prim_type.resize(prim_index_size); pack.prim_object.resize(prim_index_size); pack.prim_visibility.resize(prim_index_size); pack.prim_tri_verts.resize(prim_tri_verts_size); pack.prim_tri_index.resize(prim_index_size); pack.nodes.resize(nodes_size); pack.leaf_nodes.resize(leaf_nodes_size); pack.object_node.resize(objects.size()); if(params.num_motion_curve_steps > 0 || params.num_motion_triangle_steps > 0) { pack.prim_time.resize(prim_index_size); } int *pack_prim_index = (pack.prim_index.size())? &pack.prim_index[0]: NULL; int *pack_prim_type = (pack.prim_type.size())? &pack.prim_type[0]: NULL; int *pack_prim_object = (pack.prim_object.size())? &pack.prim_object[0]: NULL; uint *pack_prim_visibility = (pack.prim_visibility.size())? &pack.prim_visibility[0]: NULL; float4 *pack_prim_tri_verts = (pack.prim_tri_verts.size())? &pack.prim_tri_verts[0]: NULL; uint *pack_prim_tri_index = (pack.prim_tri_index.size())? &pack.prim_tri_index[0]: NULL; int4 *pack_nodes = (pack.nodes.size())? &pack.nodes[0]: NULL; int4 *pack_leaf_nodes = (pack.leaf_nodes.size())? &pack.leaf_nodes[0]: NULL; float2 *pack_prim_time = (pack.prim_time.size())? &pack.prim_time[0]: NULL; /* merge */ foreach(Object *ob, objects) { Mesh *mesh = ob->mesh; /* We assume that if mesh doesn't need own BVH it was already included * into a top-level BVH and no packing here is needed. */ if(!mesh->need_build_bvh()) { pack.object_node[object_offset++] = 0; continue; } /* if mesh already added once, don't add it again, but used set * node offset for this object */ map::iterator it = mesh_map.find(mesh); if(mesh_map.find(mesh) != mesh_map.end()) { int noffset = it->second; pack.object_node[object_offset++] = noffset; continue; } BVH *bvh = mesh->bvh; int noffset = nodes_offset; int noffset_leaf = nodes_leaf_offset; int mesh_tri_offset = mesh->tri_offset; int mesh_curve_offset = mesh->curve_offset; /* fill in node indexes for instances */ if(bvh->pack.root_index == -1) pack.object_node[object_offset++] = -noffset_leaf-1; else pack.object_node[object_offset++] = noffset; mesh_map[mesh] = pack.object_node[object_offset-1]; /* merge primitive, object and triangle indexes */ if(bvh->pack.prim_index.size()) { size_t bvh_prim_index_size = bvh->pack.prim_index.size(); int *bvh_prim_index = &bvh->pack.prim_index[0]; int *bvh_prim_type = &bvh->pack.prim_type[0]; uint *bvh_prim_visibility = &bvh->pack.prim_visibility[0]; uint *bvh_prim_tri_index = &bvh->pack.prim_tri_index[0]; float2 *bvh_prim_time = bvh->pack.prim_time.size()? &bvh->pack.prim_time[0]: NULL; for(size_t i = 0; i < bvh_prim_index_size; i++) { if(bvh->pack.prim_type[i] & PRIMITIVE_ALL_CURVE) { pack_prim_index[pack_prim_index_offset] = bvh_prim_index[i] + mesh_curve_offset; pack_prim_tri_index[pack_prim_index_offset] = -1; } else { pack_prim_index[pack_prim_index_offset] = bvh_prim_index[i] + mesh_tri_offset; pack_prim_tri_index[pack_prim_index_offset] = bvh_prim_tri_index[i] + pack_prim_tri_verts_offset; } pack_prim_type[pack_prim_index_offset] = bvh_prim_type[i]; pack_prim_visibility[pack_prim_index_offset] = bvh_prim_visibility[i]; pack_prim_object[pack_prim_index_offset] = 0; // unused for instances if(bvh_prim_time != NULL) { pack_prim_time[pack_prim_index_offset] = bvh_prim_time[i]; } pack_prim_index_offset++; } } /* Merge triangle vertices data. */ if(bvh->pack.prim_tri_verts.size()) { const size_t prim_tri_size = bvh->pack.prim_tri_verts.size(); memcpy(pack_prim_tri_verts + pack_prim_tri_verts_offset, &bvh->pack.prim_tri_verts[0], prim_tri_size*sizeof(float4)); pack_prim_tri_verts_offset += prim_tri_size; } /* merge nodes */ if(bvh->pack.leaf_nodes.size()) { int4 *leaf_nodes_offset = &bvh->pack.leaf_nodes[0]; size_t leaf_nodes_offset_size = bvh->pack.leaf_nodes.size(); for(size_t i = 0, j = 0; i < leaf_nodes_offset_size; i += BVH_NODE_LEAF_SIZE, j++) { int4 data = leaf_nodes_offset[i]; data.x += prim_offset; data.y += prim_offset; pack_leaf_nodes[pack_leaf_nodes_offset] = data; for(int j = 1; j < BVH_NODE_LEAF_SIZE; ++j) { pack_leaf_nodes[pack_leaf_nodes_offset + j] = leaf_nodes_offset[i + j]; } pack_leaf_nodes_offset += BVH_NODE_LEAF_SIZE; } } if(bvh->pack.nodes.size()) { int4 *bvh_nodes = &bvh->pack.nodes[0]; size_t bvh_nodes_size = bvh->pack.nodes.size(); for(size_t i = 0, j = 0; i < bvh_nodes_size; j++) { size_t nsize, nsize_bbox; if(bvh_nodes[i].x & PATH_RAY_NODE_UNALIGNED) { nsize = use_qbvh ? BVH_UNALIGNED_QNODE_SIZE : BVH_UNALIGNED_NODE_SIZE; nsize_bbox = (use_qbvh)? 13: 0; } else { nsize = (use_qbvh)? BVH_QNODE_SIZE: BVH_NODE_SIZE; nsize_bbox = (use_qbvh)? 7: 0; } memcpy(pack_nodes + pack_nodes_offset, bvh_nodes + i, nsize_bbox*sizeof(int4)); /* Modify offsets into arrays */ int4 data = bvh_nodes[i + nsize_bbox]; data.z += (data.z < 0)? -noffset_leaf: noffset; data.w += (data.w < 0)? -noffset_leaf: noffset; if(use_qbvh) { data.x += (data.x < 0)? -noffset_leaf: noffset; data.y += (data.y < 0)? -noffset_leaf: noffset; } pack_nodes[pack_nodes_offset + nsize_bbox] = data; /* Usually this copies nothing, but we better * be prepared for possible node size extension. */ memcpy(&pack_nodes[pack_nodes_offset + nsize_bbox+1], &bvh_nodes[i + nsize_bbox+1], sizeof(int4) * (nsize - (nsize_bbox+1))); pack_nodes_offset += nsize; i += nsize; } } nodes_offset += bvh->pack.nodes.size(); nodes_leaf_offset += bvh->pack.leaf_nodes.size(); prim_offset += bvh->pack.prim_index.size(); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh.h000066400000000000000000000060451334742672700201110ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_H__ #define __BVH_H__ #include "bvh/bvh_params.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class BVHNode; struct BVHStackEntry; class BVHParams; class BoundBox; class LeafNode; class Object; class Progress; #define BVH_ALIGN 4096 #define TRI_NODE_SIZE 3 /* Packed BVH * * BVH stored as it will be used for traversal on the rendering device. */ struct PackedBVH { /* BVH nodes storage, one node is 4x int4, and contains two bounding boxes, * and child, triangle or object indexes depending on the node type */ array nodes; /* BVH leaf nodes storage. */ array leaf_nodes; /* object index to BVH node index mapping for instances */ array object_node; /* Mapping from primitive index to index in triangle array. */ array prim_tri_index; /* Continuous storage of triangle vertices. */ array prim_tri_verts; /* primitive type - triangle or strand */ array prim_type; /* visibility visibilitys for primitives */ array prim_visibility; /* mapping from BVH primitive index to true primitive index, as primitives * may be duplicated due to spatial splits. -1 for instances. */ array prim_index; /* mapping from BVH primitive index, to the object id of that primitive. */ array prim_object; /* Time range of BVH primitive. */ array prim_time; /* index of the root node. */ int root_index; PackedBVH() { root_index = 0; } }; /* BVH */ class BVH { public: PackedBVH pack; BVHParams params; vector objects; static BVH *create(const BVHParams& params, const vector& objects); virtual ~BVH() {} void build(Progress& progress); void refit(Progress& progress); protected: BVH(const BVHParams& params, const vector& objects); /* Refit range of primitives. */ void refit_primitives(int start, int end, BoundBox& bbox, uint& visibility); /* triangles and strands */ void pack_primitives(); void pack_triangle(int idx, float4 storage[3]); /* merge instance BVH's */ void pack_instances(size_t nodes_size, size_t leaf_nodes_size); /* for subclasses to implement */ virtual void pack_nodes(const BVHNode *root) = 0; virtual void refit_nodes() = 0; }; /* Pack Utility */ struct BVHStackEntry { const BVHNode *node; int idx; BVHStackEntry(const BVHNode *n = 0, int i = 0); int encodeIdx() const; }; CCL_NAMESPACE_END #endif /* __BVH_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh2.cpp000066400000000000000000000226471334742672700205340ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh2.h" #include "render/mesh.h" #include "render/object.h" #include "bvh/bvh_node.h" #include "bvh/bvh_unaligned.h" CCL_NAMESPACE_BEGIN static bool node_bvh_is_unaligned(const BVHNode *node) { const BVHNode *node0 = node->get_child(0), *node1 = node->get_child(1); return node0->is_unaligned || node1->is_unaligned; } BVH2::BVH2(const BVHParams& params_, const vector& objects_) : BVH(params_, objects_) { } void BVH2::pack_leaf(const BVHStackEntry& e, const LeafNode *leaf) { assert(e.idx + BVH_NODE_LEAF_SIZE <= pack.leaf_nodes.size()); float4 data[BVH_NODE_LEAF_SIZE]; memset(data, 0, sizeof(data)); if(leaf->num_triangles() == 1 && pack.prim_index[leaf->lo] == -1) { /* object */ data[0].x = __int_as_float(~(leaf->lo)); data[0].y = __int_as_float(0); } else { /* triangle */ data[0].x = __int_as_float(leaf->lo); data[0].y = __int_as_float(leaf->hi); } data[0].z = __uint_as_float(leaf->visibility); if(leaf->num_triangles() != 0) { data[0].w = __uint_as_float(pack.prim_type[leaf->lo]); } memcpy(&pack.leaf_nodes[e.idx], data, sizeof(float4)*BVH_NODE_LEAF_SIZE); } void BVH2::pack_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1) { if(e0.node->is_unaligned || e1.node->is_unaligned) { pack_unaligned_inner(e, e0, e1); } else { pack_aligned_inner(e, e0, e1); } } void BVH2::pack_aligned_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1) { pack_aligned_node(e.idx, e0.node->bounds, e1.node->bounds, e0.encodeIdx(), e1.encodeIdx(), e0.node->visibility, e1.node->visibility); } void BVH2::pack_aligned_node(int idx, const BoundBox& b0, const BoundBox& b1, int c0, int c1, uint visibility0, uint visibility1) { assert(idx + BVH_NODE_SIZE <= pack.nodes.size()); assert(c0 < 0 || c0 < pack.nodes.size()); assert(c1 < 0 || c1 < pack.nodes.size()); int4 data[BVH_NODE_SIZE] = { make_int4(visibility0 & ~PATH_RAY_NODE_UNALIGNED, visibility1 & ~PATH_RAY_NODE_UNALIGNED, c0, c1), make_int4(__float_as_int(b0.min.x), __float_as_int(b1.min.x), __float_as_int(b0.max.x), __float_as_int(b1.max.x)), make_int4(__float_as_int(b0.min.y), __float_as_int(b1.min.y), __float_as_int(b0.max.y), __float_as_int(b1.max.y)), make_int4(__float_as_int(b0.min.z), __float_as_int(b1.min.z), __float_as_int(b0.max.z), __float_as_int(b1.max.z)), }; memcpy(&pack.nodes[idx], data, sizeof(int4)*BVH_NODE_SIZE); } void BVH2::pack_unaligned_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1) { pack_unaligned_node(e.idx, e0.node->get_aligned_space(), e1.node->get_aligned_space(), e0.node->bounds, e1.node->bounds, e0.encodeIdx(), e1.encodeIdx(), e0.node->visibility, e1.node->visibility); } void BVH2::pack_unaligned_node(int idx, const Transform& aligned_space0, const Transform& aligned_space1, const BoundBox& bounds0, const BoundBox& bounds1, int c0, int c1, uint visibility0, uint visibility1) { assert(idx + BVH_UNALIGNED_NODE_SIZE <= pack.nodes.size()); assert(c0 < 0 || c0 < pack.nodes.size()); assert(c1 < 0 || c1 < pack.nodes.size()); float4 data[BVH_UNALIGNED_NODE_SIZE]; Transform space0 = BVHUnaligned::compute_node_transform(bounds0, aligned_space0); Transform space1 = BVHUnaligned::compute_node_transform(bounds1, aligned_space1); data[0] = make_float4(__int_as_float(visibility0 | PATH_RAY_NODE_UNALIGNED), __int_as_float(visibility1 | PATH_RAY_NODE_UNALIGNED), __int_as_float(c0), __int_as_float(c1)); data[1] = space0.x; data[2] = space0.y; data[3] = space0.z; data[4] = space1.x; data[5] = space1.y; data[6] = space1.z; memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_UNALIGNED_NODE_SIZE); } void BVH2::pack_nodes(const BVHNode *root) { const size_t num_nodes = root->getSubtreeSize(BVH_STAT_NODE_COUNT); const size_t num_leaf_nodes = root->getSubtreeSize(BVH_STAT_LEAF_COUNT); assert(num_leaf_nodes <= num_nodes); const size_t num_inner_nodes = num_nodes - num_leaf_nodes; size_t node_size; if(params.use_unaligned_nodes) { const size_t num_unaligned_nodes = root->getSubtreeSize(BVH_STAT_UNALIGNED_INNER_COUNT); node_size = (num_unaligned_nodes * BVH_UNALIGNED_NODE_SIZE) + (num_inner_nodes - num_unaligned_nodes) * BVH_NODE_SIZE; } else { node_size = num_inner_nodes * BVH_NODE_SIZE; } /* Resize arrays */ pack.nodes.clear(); pack.leaf_nodes.clear(); /* For top level BVH, first merge existing BVH's so we know the offsets. */ if(params.top_level) { pack_instances(node_size, num_leaf_nodes*BVH_NODE_LEAF_SIZE); } else { pack.nodes.resize(node_size); pack.leaf_nodes.resize(num_leaf_nodes*BVH_NODE_LEAF_SIZE); } int nextNodeIdx = 0, nextLeafNodeIdx = 0; vector stack; stack.reserve(BVHParams::MAX_DEPTH*2); if(root->is_leaf()) { stack.push_back(BVHStackEntry(root, nextLeafNodeIdx++)); } else { stack.push_back(BVHStackEntry(root, nextNodeIdx)); nextNodeIdx += node_bvh_is_unaligned(root) ? BVH_UNALIGNED_NODE_SIZE : BVH_NODE_SIZE; } while(stack.size()) { BVHStackEntry e = stack.back(); stack.pop_back(); if(e.node->is_leaf()) { /* leaf node */ const LeafNode *leaf = reinterpret_cast(e.node); pack_leaf(e, leaf); } else { /* innner node */ int idx[2]; for(int i = 0; i < 2; ++i) { if(e.node->get_child(i)->is_leaf()) { idx[i] = nextLeafNodeIdx++; } else { idx[i] = nextNodeIdx; nextNodeIdx += node_bvh_is_unaligned(e.node->get_child(i)) ? BVH_UNALIGNED_NODE_SIZE : BVH_NODE_SIZE; } } stack.push_back(BVHStackEntry(e.node->get_child(0), idx[0])); stack.push_back(BVHStackEntry(e.node->get_child(1), idx[1])); pack_inner(e, stack[stack.size()-2], stack[stack.size()-1]); } } assert(node_size == nextNodeIdx); /* root index to start traversal at, to handle case of single leaf node */ pack.root_index = (root->is_leaf())? -1: 0; } void BVH2::refit_nodes() { assert(!params.top_level); BoundBox bbox = BoundBox::empty; uint visibility = 0; refit_node(0, (pack.root_index == -1)? true: false, bbox, visibility); } void BVH2::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility) { if(leaf) { /* refit leaf node */ assert(idx + BVH_NODE_LEAF_SIZE <= pack.leaf_nodes.size()); const int4 *data = &pack.leaf_nodes[idx]; const int c0 = data[0].x; const int c1 = data[0].y; BVH::refit_primitives(c0, c1, bbox, visibility); /* TODO(sergey): De-duplicate with pack_leaf(). */ float4 leaf_data[BVH_NODE_LEAF_SIZE]; leaf_data[0].x = __int_as_float(c0); leaf_data[0].y = __int_as_float(c1); leaf_data[0].z = __uint_as_float(visibility); leaf_data[0].w = __uint_as_float(data[0].w); memcpy(&pack.leaf_nodes[idx], leaf_data, sizeof(float4)*BVH_NODE_LEAF_SIZE); } else { assert(idx + BVH_NODE_SIZE <= pack.nodes.size()); const int4 *data = &pack.nodes[idx]; const bool is_unaligned = (data[0].x & PATH_RAY_NODE_UNALIGNED) != 0; const int c0 = data[0].z; const int c1 = data[0].w; /* refit inner node, set bbox from children */ BoundBox bbox0 = BoundBox::empty, bbox1 = BoundBox::empty; uint visibility0 = 0, visibility1 = 0; refit_node((c0 < 0)? -c0-1: c0, (c0 < 0), bbox0, visibility0); refit_node((c1 < 0)? -c1-1: c1, (c1 < 0), bbox1, visibility1); if(is_unaligned) { Transform aligned_space = transform_identity(); pack_unaligned_node(idx, aligned_space, aligned_space, bbox0, bbox1, c0, c1, visibility0, visibility1); } else { pack_aligned_node(idx, bbox0, bbox1, c0, c1, visibility0, visibility1); } bbox.grow(bbox0); bbox.grow(bbox1); visibility = visibility0|visibility1; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh2.h000066400000000000000000000050021334742672700201630ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH2_H__ #define __BVH2_H__ #include "bvh/bvh.h" #include "bvh/bvh_params.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class BVHNode; struct BVHStackEntry; class BVHParams; class BoundBox; class LeafNode; class Object; class Progress; #define BVH_NODE_SIZE 4 #define BVH_NODE_LEAF_SIZE 1 #define BVH_UNALIGNED_NODE_SIZE 7 /* BVH2 * * Typical BVH with each node having two children. */ class BVH2 : public BVH { protected: /* constructor */ friend class BVH; BVH2(const BVHParams& params, const vector& objects); /* pack */ void pack_nodes(const BVHNode *root); void pack_leaf(const BVHStackEntry& e, const LeafNode *leaf); void pack_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1); void pack_aligned_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1); void pack_aligned_node(int idx, const BoundBox& b0, const BoundBox& b1, int c0, int c1, uint visibility0, uint visibility1); void pack_unaligned_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1); void pack_unaligned_node(int idx, const Transform& aligned_space0, const Transform& aligned_space1, const BoundBox& b0, const BoundBox& b1, int c0, int c1, uint visibility0, uint visibility1); /* refit */ void refit_nodes(); void refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility); }; CCL_NAMESPACE_END #endif /* __BVH2_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh4.cpp000066400000000000000000000302441334742672700205260ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh4.h" #include "render/mesh.h" #include "render/object.h" #include "bvh/bvh_node.h" #include "bvh/bvh_unaligned.h" CCL_NAMESPACE_BEGIN /* Can we avoid this somehow or make more generic? * * Perhaps we can merge nodes in actual tree and make our * life easier all over the place. */ static bool node_qbvh_is_unaligned(const BVHNode *node) { const BVHNode *node0 = node->get_child(0), *node1 = node->get_child(1); bool has_unaligned = false; if(node0->is_leaf()) { has_unaligned |= node0->is_unaligned; } else { has_unaligned |= node0->get_child(0)->is_unaligned; has_unaligned |= node0->get_child(1)->is_unaligned; } if(node1->is_leaf()) { has_unaligned |= node1->is_unaligned; } else { has_unaligned |= node1->get_child(0)->is_unaligned; has_unaligned |= node1->get_child(1)->is_unaligned; } return has_unaligned; } BVH4::BVH4(const BVHParams& params_, const vector& objects_) : BVH(params_, objects_) { params.bvh_layout = BVH_LAYOUT_BVH4; } void BVH4::pack_leaf(const BVHStackEntry& e, const LeafNode *leaf) { float4 data[BVH_QNODE_LEAF_SIZE]; memset(data, 0, sizeof(data)); if(leaf->num_triangles() == 1 && pack.prim_index[leaf->lo] == -1) { /* object */ data[0].x = __int_as_float(~(leaf->lo)); data[0].y = __int_as_float(0); } else { /* triangle */ data[0].x = __int_as_float(leaf->lo); data[0].y = __int_as_float(leaf->hi); } data[0].z = __uint_as_float(leaf->visibility); if(leaf->num_triangles() != 0) { data[0].w = __uint_as_float(pack.prim_type[leaf->lo]); } memcpy(&pack.leaf_nodes[e.idx], data, sizeof(float4)*BVH_QNODE_LEAF_SIZE); } void BVH4::pack_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num) { bool has_unaligned = false; /* Check whether we have to create unaligned node or all nodes are aligned * and we can cut some corner here. */ if(params.use_unaligned_nodes) { for(int i = 0; i < num; i++) { if(en[i].node->is_unaligned) { has_unaligned = true; break; } } } if(has_unaligned) { /* There's no unaligned children, pack into AABB node. */ pack_unaligned_inner(e, en, num); } else { /* Create unaligned node with orientation transform for each of the * children. */ pack_aligned_inner(e, en, num); } } void BVH4::pack_aligned_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num) { BoundBox bounds[4]; int child[4]; for(int i = 0; i < num; ++i) { bounds[i] = en[i].node->bounds; child[i] = en[i].encodeIdx(); } pack_aligned_node(e.idx, bounds, child, e.node->visibility, e.node->time_from, e.node->time_to, num); } void BVH4::pack_aligned_node(int idx, const BoundBox *bounds, const int *child, const uint visibility, const float time_from, const float time_to, const int num) { float4 data[BVH_QNODE_SIZE]; memset(data, 0, sizeof(data)); data[0].x = __uint_as_float(visibility & ~PATH_RAY_NODE_UNALIGNED); data[0].y = time_from; data[0].z = time_to; for(int i = 0; i < num; i++) { float3 bb_min = bounds[i].min; float3 bb_max = bounds[i].max; data[1][i] = bb_min.x; data[2][i] = bb_max.x; data[3][i] = bb_min.y; data[4][i] = bb_max.y; data[5][i] = bb_min.z; data[6][i] = bb_max.z; data[7][i] = __int_as_float(child[i]); } for(int i = num; i < 4; i++) { /* We store BB which would never be recorded as intersection * so kernel might safely assume there are always 4 child nodes. */ data[1][i] = FLT_MAX; data[2][i] = -FLT_MAX; data[3][i] = FLT_MAX; data[4][i] = -FLT_MAX; data[5][i] = FLT_MAX; data[6][i] = -FLT_MAX; data[7][i] = __int_as_float(0); } memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_QNODE_SIZE); } void BVH4::pack_unaligned_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num) { Transform aligned_space[4]; BoundBox bounds[4]; int child[4]; for(int i = 0; i < num; ++i) { aligned_space[i] = en[i].node->get_aligned_space(); bounds[i] = en[i].node->bounds; child[i] = en[i].encodeIdx(); } pack_unaligned_node(e.idx, aligned_space, bounds, child, e.node->visibility, e.node->time_from, e.node->time_to, num); } void BVH4::pack_unaligned_node(int idx, const Transform *aligned_space, const BoundBox *bounds, const int *child, const uint visibility, const float time_from, const float time_to, const int num) { float4 data[BVH_UNALIGNED_QNODE_SIZE]; memset(data, 0, sizeof(data)); data[0].x = __uint_as_float(visibility | PATH_RAY_NODE_UNALIGNED); data[0].y = time_from; data[0].z = time_to; for(int i = 0; i < num; i++) { Transform space = BVHUnaligned::compute_node_transform( bounds[i], aligned_space[i]); data[1][i] = space.x.x; data[2][i] = space.x.y; data[3][i] = space.x.z; data[4][i] = space.y.x; data[5][i] = space.y.y; data[6][i] = space.y.z; data[7][i] = space.z.x; data[8][i] = space.z.y; data[9][i] = space.z.z; data[10][i] = space.x.w; data[11][i] = space.y.w; data[12][i] = space.z.w; data[13][i] = __int_as_float(child[i]); } for(int i = num; i < 4; i++) { /* We store BB which would never be recorded as intersection * so kernel might safely assume there are always 4 child nodes. */ data[1][i] = NAN; data[2][i] = NAN; data[3][i] = NAN; data[4][i] = NAN; data[5][i] = NAN; data[6][i] = NAN; data[7][i] = NAN; data[8][i] = NAN; data[9][i] = NAN; data[10][i] = NAN; data[11][i] = NAN; data[12][i] = NAN; data[13][i] = __int_as_float(0); } memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_UNALIGNED_QNODE_SIZE); } /* Quad SIMD Nodes */ void BVH4::pack_nodes(const BVHNode *root) { /* Calculate size of the arrays required. */ const size_t num_nodes = root->getSubtreeSize(BVH_STAT_QNODE_COUNT); const size_t num_leaf_nodes = root->getSubtreeSize(BVH_STAT_LEAF_COUNT); assert(num_leaf_nodes <= num_nodes); const size_t num_inner_nodes = num_nodes - num_leaf_nodes; size_t node_size; if(params.use_unaligned_nodes) { const size_t num_unaligned_nodes = root->getSubtreeSize(BVH_STAT_UNALIGNED_INNER_QNODE_COUNT); node_size = (num_unaligned_nodes * BVH_UNALIGNED_QNODE_SIZE) + (num_inner_nodes - num_unaligned_nodes) * BVH_QNODE_SIZE; } else { node_size = num_inner_nodes * BVH_QNODE_SIZE; } /* Resize arrays. */ pack.nodes.clear(); pack.leaf_nodes.clear(); /* For top level BVH, first merge existing BVH's so we know the offsets. */ if(params.top_level) { pack_instances(node_size, num_leaf_nodes*BVH_QNODE_LEAF_SIZE); } else { pack.nodes.resize(node_size); pack.leaf_nodes.resize(num_leaf_nodes*BVH_QNODE_LEAF_SIZE); } int nextNodeIdx = 0, nextLeafNodeIdx = 0; vector stack; stack.reserve(BVHParams::MAX_DEPTH*2); if(root->is_leaf()) { stack.push_back(BVHStackEntry(root, nextLeafNodeIdx++)); } else { stack.push_back(BVHStackEntry(root, nextNodeIdx)); nextNodeIdx += node_qbvh_is_unaligned(root) ? BVH_UNALIGNED_QNODE_SIZE : BVH_QNODE_SIZE; } while(stack.size()) { BVHStackEntry e = stack.back(); stack.pop_back(); if(e.node->is_leaf()) { /* leaf node */ const LeafNode *leaf = reinterpret_cast(e.node); pack_leaf(e, leaf); } else { /* Inner node. */ const BVHNode *node = e.node; const BVHNode *node0 = node->get_child(0); const BVHNode *node1 = node->get_child(1); /* Collect nodes. */ const BVHNode *nodes[4]; int numnodes = 0; if(node0->is_leaf()) { nodes[numnodes++] = node0; } else { nodes[numnodes++] = node0->get_child(0); nodes[numnodes++] = node0->get_child(1); } if(node1->is_leaf()) { nodes[numnodes++] = node1; } else { nodes[numnodes++] = node1->get_child(0); nodes[numnodes++] = node1->get_child(1); } /* Push entries on the stack. */ for(int i = 0; i < numnodes; ++i) { int idx; if(nodes[i]->is_leaf()) { idx = nextLeafNodeIdx++; } else { idx = nextNodeIdx; nextNodeIdx += node_qbvh_is_unaligned(nodes[i]) ? BVH_UNALIGNED_QNODE_SIZE : BVH_QNODE_SIZE; } stack.push_back(BVHStackEntry(nodes[i], idx)); } /* Set node. */ pack_inner(e, &stack[stack.size()-numnodes], numnodes); } } assert(node_size == nextNodeIdx); /* Root index to start traversal at, to handle case of single leaf node. */ pack.root_index = (root->is_leaf())? -1: 0; } void BVH4::refit_nodes() { assert(!params.top_level); BoundBox bbox = BoundBox::empty; uint visibility = 0; refit_node(0, (pack.root_index == -1)? true: false, bbox, visibility); } void BVH4::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility) { if(leaf) { /* Refit leaf node. */ int4 *data = &pack.leaf_nodes[idx]; int4 c = data[0]; BVH::refit_primitives(c.x, c.y, bbox, visibility); /* TODO(sergey): This is actually a copy of pack_leaf(), * but this chunk of code only knows actual data and has * no idea about BVHNode. * * Would be nice to de-duplicate code, but trying to make * making code more general ends up in much nastier code * in my opinion so far. * * Same applies to the inner nodes case below. */ float4 leaf_data[BVH_QNODE_LEAF_SIZE]; leaf_data[0].x = __int_as_float(c.x); leaf_data[0].y = __int_as_float(c.y); leaf_data[0].z = __uint_as_float(visibility); leaf_data[0].w = __uint_as_float(c.w); memcpy(&pack.leaf_nodes[idx], leaf_data, sizeof(float4)*BVH_QNODE_LEAF_SIZE); } else { int4 *data = &pack.nodes[idx]; bool is_unaligned = (data[0].x & PATH_RAY_NODE_UNALIGNED) != 0; int4 c; if(is_unaligned) { c = data[13]; } else { c = data[7]; } /* Refit inner node, set bbox from children. */ BoundBox child_bbox[4] = {BoundBox::empty, BoundBox::empty, BoundBox::empty, BoundBox::empty}; uint child_visibility[4] = {0}; int num_nodes = 0; for(int i = 0; i < 4; ++i) { if(c[i] != 0) { refit_node((c[i] < 0)? -c[i]-1: c[i], (c[i] < 0), child_bbox[i], child_visibility[i]); ++num_nodes; bbox.grow(child_bbox[i]); visibility |= child_visibility[i]; } } if(is_unaligned) { Transform aligned_space[4] = {transform_identity(), transform_identity(), transform_identity(), transform_identity()}; pack_unaligned_node(idx, aligned_space, child_bbox, &c[0], visibility, 0.0f, 1.0f, 4); } else { pack_aligned_node(idx, child_bbox, &c[0], visibility, 0.0f, 1.0f, 4); } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh4.h000066400000000000000000000050521334742672700201720ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH4_H__ #define __BVH4_H__ #include "bvh/bvh.h" #include "bvh/bvh_params.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class BVHNode; struct BVHStackEntry; class BVHParams; class BoundBox; class LeafNode; class Object; class Progress; #define BVH_QNODE_SIZE 8 #define BVH_QNODE_LEAF_SIZE 1 #define BVH_UNALIGNED_QNODE_SIZE 14 /* BVH4 * * Quad BVH, with each node having four children, to use with SIMD instructions. */ class BVH4 : public BVH { protected: /* constructor */ friend class BVH; BVH4(const BVHParams& params, const vector& objects); /* pack */ void pack_nodes(const BVHNode *root); void pack_leaf(const BVHStackEntry& e, const LeafNode *leaf); void pack_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num); void pack_aligned_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num); void pack_aligned_node(int idx, const BoundBox *bounds, const int *child, const uint visibility, const float time_from, const float time_to, const int num); void pack_unaligned_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num); void pack_unaligned_node(int idx, const Transform *aligned_space, const BoundBox *bounds, const int *child, const uint visibility, const float time_from, const float time_to, const int num); /* refit */ void refit_nodes(); void refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility); }; CCL_NAMESPACE_END #endif /* __BVH4_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh_binning.cpp000066400000000000000000000200771334742672700221510ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2011 Intel Corporation * Modifications Copyright 2012, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //#define __KERNEL_SSE__ #include "bvh/bvh_binning.h" #include #include "util/util_algorithm.h" #include "util/util_boundbox.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* SSE replacements */ __forceinline void prefetch_L1 (const void* /*ptr*/) { } __forceinline void prefetch_L2 (const void* /*ptr*/) { } __forceinline void prefetch_L3 (const void* /*ptr*/) { } __forceinline void prefetch_NTA(const void* /*ptr*/) { } template __forceinline float extract(const int4& b) { return b[src]; } template __forceinline const float4 insert(const float4& a, const float b) { float4 r = a; r[dst] = b; return r; } __forceinline int get_best_dimension(const float4& bestSAH) { // return (int)__bsf(movemask(reduce_min(bestSAH) == bestSAH)); float minSAH = min(bestSAH.x, min(bestSAH.y, bestSAH.z)); if(bestSAH.x == minSAH) return 0; else if(bestSAH.y == minSAH) return 1; else return 2; } /* BVH Object Binning */ BVHObjectBinning::BVHObjectBinning(const BVHRange& job, BVHReference *prims, const BVHUnaligned *unaligned_heuristic, const Transform *aligned_space) : BVHRange(job), splitSAH(FLT_MAX), dim(0), pos(0), unaligned_heuristic_(unaligned_heuristic), aligned_space_(aligned_space) { if(aligned_space_ == NULL) { bounds_ = bounds(); cent_bounds_ = cent_bounds(); } else { /* TODO(sergey): With some additional storage we can avoid * need in re-calculating this. */ bounds_ = unaligned_heuristic->compute_aligned_boundbox( *this, prims, *aligned_space, ¢_bounds_); } /* compute number of bins to use and precompute scaling factor for binning */ num_bins = min(size_t(MAX_BINS), size_t(4.0f + 0.05f*size())); scale = rcp(cent_bounds_.size()) * make_float3((float)num_bins); /* initialize binning counter and bounds */ BoundBox bin_bounds[MAX_BINS][4]; /* bounds for every bin in every dimension */ int4 bin_count[MAX_BINS]; /* number of primitives mapped to bin */ for(size_t i = 0; i < num_bins; i++) { bin_count[i] = make_int4(0); bin_bounds[i][0] = bin_bounds[i][1] = bin_bounds[i][2] = BoundBox::empty; } /* map geometry to bins, unrolled once */ { ssize_t i; for(i = 0; i < ssize_t(size()) - 1; i += 2) { prefetch_L2(&prims[start() + i + 8]); /* map even and odd primitive to bin */ const BVHReference& prim0 = prims[start() + i + 0]; const BVHReference& prim1 = prims[start() + i + 1]; BoundBox bounds0 = get_prim_bounds(prim0); BoundBox bounds1 = get_prim_bounds(prim1); int4 bin0 = get_bin(bounds0); int4 bin1 = get_bin(bounds1); /* increase bounds for bins for even primitive */ int b00 = (int)extract<0>(bin0); bin_count[b00][0]++; bin_bounds[b00][0].grow(bounds0); int b01 = (int)extract<1>(bin0); bin_count[b01][1]++; bin_bounds[b01][1].grow(bounds0); int b02 = (int)extract<2>(bin0); bin_count[b02][2]++; bin_bounds[b02][2].grow(bounds0); /* increase bounds of bins for odd primitive */ int b10 = (int)extract<0>(bin1); bin_count[b10][0]++; bin_bounds[b10][0].grow(bounds1); int b11 = (int)extract<1>(bin1); bin_count[b11][1]++; bin_bounds[b11][1].grow(bounds1); int b12 = (int)extract<2>(bin1); bin_count[b12][2]++; bin_bounds[b12][2].grow(bounds1); } /* for uneven number of primitives */ if(i < ssize_t(size())) { /* map primitive to bin */ const BVHReference& prim0 = prims[start() + i]; BoundBox bounds0 = get_prim_bounds(prim0); int4 bin0 = get_bin(bounds0); /* increase bounds of bins */ int b00 = (int)extract<0>(bin0); bin_count[b00][0]++; bin_bounds[b00][0].grow(bounds0); int b01 = (int)extract<1>(bin0); bin_count[b01][1]++; bin_bounds[b01][1].grow(bounds0); int b02 = (int)extract<2>(bin0); bin_count[b02][2]++; bin_bounds[b02][2].grow(bounds0); } } /* sweep from right to left and compute parallel prefix of merged bounds */ float4 r_area[MAX_BINS]; /* area of bounds of primitives on the right */ float4 r_count[MAX_BINS]; /* number of primitives on the right */ int4 count = make_int4(0); BoundBox bx = BoundBox::empty; BoundBox by = BoundBox::empty; BoundBox bz = BoundBox::empty; for(size_t i = num_bins - 1; i > 0; i--) { count = count + bin_count[i]; r_count[i] = blocks(count); bx = merge(bx,bin_bounds[i][0]); r_area[i][0] = bx.half_area(); by = merge(by,bin_bounds[i][1]); r_area[i][1] = by.half_area(); bz = merge(bz,bin_bounds[i][2]); r_area[i][2] = bz.half_area(); r_area[i][3] = r_area[i][2]; } /* sweep from left to right and compute SAH */ int4 ii = make_int4(1); float4 bestSAH = make_float4(FLT_MAX); int4 bestSplit = make_int4(-1); count = make_int4(0); bx = BoundBox::empty; by = BoundBox::empty; bz = BoundBox::empty; for(size_t i = 1; i < num_bins; i++, ii += make_int4(1)) { count = count + bin_count[i-1]; bx = merge(bx,bin_bounds[i-1][0]); float Ax = bx.half_area(); by = merge(by,bin_bounds[i-1][1]); float Ay = by.half_area(); bz = merge(bz,bin_bounds[i-1][2]); float Az = bz.half_area(); float4 lCount = blocks(count); float4 lArea = make_float4(Ax,Ay,Az,Az); float4 sah = lArea*lCount + r_area[i]*r_count[i]; bestSplit = select(sah < bestSAH,ii,bestSplit); bestSAH = min(sah,bestSAH); } int4 mask = float3_to_float4(cent_bounds_.size()) <= make_float4(0.0f); bestSAH = insert<3>(select(mask, make_float4(FLT_MAX), bestSAH), FLT_MAX); /* find best dimension */ dim = get_best_dimension(bestSAH); splitSAH = bestSAH[dim]; pos = bestSplit[dim]; leafSAH = bounds_.half_area() * blocks(size()); } void BVHObjectBinning::split(BVHReference* prims, BVHObjectBinning& left_o, BVHObjectBinning& right_o) const { size_t N = size(); BoundBox lgeom_bounds = BoundBox::empty; BoundBox rgeom_bounds = BoundBox::empty; BoundBox lcent_bounds = BoundBox::empty; BoundBox rcent_bounds = BoundBox::empty; ssize_t l = 0, r = N-1; while(l <= r) { prefetch_L2(&prims[start() + l + 8]); prefetch_L2(&prims[start() + r - 8]); BVHReference prim = prims[start() + l]; BoundBox unaligned_bounds = get_prim_bounds(prim); float3 unaligned_center = unaligned_bounds.center2(); float3 center = prim.bounds().center2(); if(get_bin(unaligned_center)[dim] < pos) { lgeom_bounds.grow(prim.bounds()); lcent_bounds.grow(center); l++; } else { rgeom_bounds.grow(prim.bounds()); rcent_bounds.grow(center); swap(prims[start()+l],prims[start()+r]); r--; } } /* finish */ if(l != 0 && N-1-r != 0) { right_o = BVHObjectBinning(BVHRange(rgeom_bounds, rcent_bounds, start() + l, N-1-r), prims); left_o = BVHObjectBinning(BVHRange(lgeom_bounds, lcent_bounds, start(), l), prims); return; } /* object medium split if we did not make progress, can happen when all * primitives have same centroid */ lgeom_bounds = BoundBox::empty; rgeom_bounds = BoundBox::empty; lcent_bounds = BoundBox::empty; rcent_bounds = BoundBox::empty; for(size_t i = 0; i < N/2; i++) { lgeom_bounds.grow(prims[start()+i].bounds()); lcent_bounds.grow(prims[start()+i].bounds().center2()); } for(size_t i = N/2; i < N; i++) { rgeom_bounds.grow(prims[start()+i].bounds()); rcent_bounds.grow(prims[start()+i].bounds().center2()); } right_o = BVHObjectBinning(BVHRange(rgeom_bounds, rcent_bounds, start() + N/2, N/2 + N%2), prims); left_o = BVHObjectBinning(BVHRange(lgeom_bounds, lcent_bounds, start(), N/2), prims); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh_binning.h000066400000000000000000000066551334742672700216240ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2011 Intel Corporation * Modifications Copyright 2012, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_BINNING_H__ #define __BVH_BINNING_H__ #include "bvh/bvh_params.h" #include "bvh/bvh_unaligned.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class BVHBuild; /* Single threaded object binner. Finds the split with the best SAH heuristic * by testing for each dimension multiple partitionings for regular spaced * partition locations. A partitioning for a partition location is computed, * by putting primitives whose centroid is on the left and right of the split * location to different sets. The SAH is evaluated by computing the number of * blocks occupied by the primitives in the partitions. */ class BVHObjectBinning : public BVHRange { public: __forceinline BVHObjectBinning() : leafSAH(FLT_MAX) {} BVHObjectBinning(const BVHRange& job, BVHReference *prims, const BVHUnaligned *unaligned_heuristic = NULL, const Transform *aligned_space = NULL); void split(BVHReference *prims, BVHObjectBinning& left_o, BVHObjectBinning& right_o) const; __forceinline const BoundBox& unaligned_bounds() { return bounds_; } float splitSAH; /* SAH cost of the best split */ float leafSAH; /* SAH cost of creating a leaf */ protected: int dim; /* best split dimension */ int pos; /* best split position */ size_t num_bins; /* actual number of bins to use */ float3 scale; /* scaling factor to compute bin */ /* Effective bounds and centroid bounds. */ BoundBox bounds_; BoundBox cent_bounds_; const BVHUnaligned *unaligned_heuristic_; const Transform *aligned_space_; enum { MAX_BINS = 32 }; enum { LOG_BLOCK_SIZE = 2 }; /* computes the bin numbers for each dimension for a box. */ __forceinline int4 get_bin(const BoundBox& box) const { int4 a = make_int4((box.center2() - cent_bounds_.min)*scale - make_float3(0.5f)); int4 mn = make_int4(0); int4 mx = make_int4((int)num_bins-1); return clamp(a, mn, mx); } /* computes the bin numbers for each dimension for a point. */ __forceinline int4 get_bin(const float3& c) const { return make_int4((c - cent_bounds_.min)*scale - make_float3(0.5f)); } /* compute the number of blocks occupied for each dimension. */ __forceinline float4 blocks(const int4& a) const { return make_float4((a + make_int4((1 << LOG_BLOCK_SIZE)-1)) >> LOG_BLOCK_SIZE); } /* compute the number of blocks occupied in one dimension. */ __forceinline int blocks(size_t a) const { return (int)((a+((1LL << LOG_BLOCK_SIZE)-1)) >> LOG_BLOCK_SIZE); } __forceinline BoundBox get_prim_bounds(const BVHReference& prim) const { if(aligned_space_ == NULL) { return prim.bounds(); } else { return unaligned_heuristic_->compute_aligned_prim_boundbox( prim, *aligned_space_); } } }; CCL_NAMESPACE_END #endif /* __BVH_BINNING_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh_build.cpp000066400000000000000000001177061334742672700216320ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh_build.h" #include "bvh/bvh_binning.h" #include "bvh/bvh_node.h" #include "bvh/bvh_params.h" #include "bvh_split.h" #include "render/mesh.h" #include "render/object.h" #include "render/scene.h" #include "render/curves.h" #include "util/util_algorithm.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_progress.h" #include "util/util_stack_allocator.h" #include "util/util_simd.h" #include "util/util_time.h" #include "util/util_queue.h" CCL_NAMESPACE_BEGIN /* BVH Build Task */ class BVHBuildTask : public Task { public: BVHBuildTask(BVHBuild *build, InnerNode *node, int child, const BVHObjectBinning& range, int level) : range_(range) { run = function_bind(&BVHBuild::thread_build_node, build, node, child, &range_, level); } private: BVHObjectBinning range_; }; class BVHSpatialSplitBuildTask : public Task { public: BVHSpatialSplitBuildTask(BVHBuild *build, InnerNode *node, int child, const BVHRange& range, const vector& references, int level) : range_(range), references_(references.begin() + range.start(), references.begin() + range.end()) { range_.set_start(0); run = function_bind(&BVHBuild::thread_build_spatial_split_node, build, node, child, &range_, &references_, level, _1); } private: BVHRange range_; vector references_; }; /* Constructor / Destructor */ BVHBuild::BVHBuild(const vector& objects_, array& prim_type_, array& prim_index_, array& prim_object_, array& prim_time_, const BVHParams& params_, Progress& progress_) : objects(objects_), prim_type(prim_type_), prim_index(prim_index_), prim_object(prim_object_), prim_time(prim_time_), params(params_), progress(progress_), progress_start_time(0.0), unaligned_heuristic(objects_) { spatial_min_overlap = 0.0f; } BVHBuild::~BVHBuild() { } /* Adding References */ void BVHBuild::add_reference_triangles(BoundBox& root, BoundBox& center, Mesh *mesh, int i) { const Attribute *attr_mP = NULL; if(mesh->has_motion_blur()) { attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); } const size_t num_triangles = mesh->num_triangles(); for(uint j = 0; j < num_triangles; j++) { Mesh::Triangle t = mesh->get_triangle(j); const float3 *verts = &mesh->verts[0]; if(attr_mP == NULL) { BoundBox bounds = BoundBox::empty; t.bounds_grow(verts, bounds); if(bounds.valid() && t.valid(verts)) { references.push_back(BVHReference(bounds, j, i, PRIMITIVE_TRIANGLE)); root.grow(bounds); center.grow(bounds.center2()); } } else if(params.num_motion_triangle_steps == 0 || params.use_spatial_split) { /* Motion triangles, simple case: single node for the whole * primitive. Lowest memory footprint and faster BVH build but * least optimal ray-tracing. */ /* TODO(sergey): Support motion steps for spatially split BVH. */ const size_t num_verts = mesh->verts.size(); const size_t num_steps = mesh->motion_steps; const float3 *vert_steps = attr_mP->data_float3(); BoundBox bounds = BoundBox::empty; t.bounds_grow(verts, bounds); for(size_t step = 0; step < num_steps - 1; step++) { t.bounds_grow(vert_steps + step*num_verts, bounds); } if(bounds.valid()) { references.push_back( BVHReference(bounds, j, i, PRIMITIVE_MOTION_TRIANGLE)); root.grow(bounds); center.grow(bounds.center2()); } } else { /* Motion triangles, trace optimized case: we split triangle * primitives into separate nodes for each of the time steps. * This way we minimize overlap of neighbor curve primitives. */ const int num_bvh_steps = params.num_motion_curve_steps * 2 + 1; const float num_bvh_steps_inv_1 = 1.0f / (num_bvh_steps - 1); const size_t num_verts = mesh->verts.size(); const size_t num_steps = mesh->motion_steps; const float3 *vert_steps = attr_mP->data_float3(); /* Calculate bounding box of the previous time step. * Will be reused later to avoid duplicated work on * calculating BVH time step boundbox. */ float3 prev_verts[3]; t.motion_verts(verts, vert_steps, num_verts, num_steps, 0.0f, prev_verts); BoundBox prev_bounds = BoundBox::empty; prev_bounds.grow(prev_verts[0]); prev_bounds.grow(prev_verts[1]); prev_bounds.grow(prev_verts[2]); /* Create all primitive time steps, */ for(int bvh_step = 1; bvh_step < num_bvh_steps; ++bvh_step) { const float curr_time = (float)(bvh_step) * num_bvh_steps_inv_1; float3 curr_verts[3]; t.motion_verts(verts, vert_steps, num_verts, num_steps, curr_time, curr_verts); BoundBox curr_bounds = BoundBox::empty; curr_bounds.grow(curr_verts[0]); curr_bounds.grow(curr_verts[1]); curr_bounds.grow(curr_verts[2]); BoundBox bounds = prev_bounds; bounds.grow(curr_bounds); if(bounds.valid()) { const float prev_time = (float)(bvh_step - 1) * num_bvh_steps_inv_1; references.push_back( BVHReference(bounds, j, i, PRIMITIVE_MOTION_TRIANGLE, prev_time, curr_time)); root.grow(bounds); center.grow(bounds.center2()); } /* Current time boundbox becomes previous one for the * next time step. */ prev_bounds = curr_bounds; } } } } void BVHBuild::add_reference_curves(BoundBox& root, BoundBox& center, Mesh *mesh, int i) { const Attribute *curve_attr_mP = NULL; if(mesh->has_motion_blur()) { curve_attr_mP = mesh->curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); } const size_t num_curves = mesh->num_curves(); for(uint j = 0; j < num_curves; j++) { const Mesh::Curve curve = mesh->get_curve(j); const float *curve_radius = &mesh->curve_radius[0]; for(int k = 0; k < curve.num_keys - 1; k++) { if(curve_attr_mP == NULL) { /* Really simple logic for static hair. */ BoundBox bounds = BoundBox::empty; curve.bounds_grow(k, &mesh->curve_keys[0], curve_radius, bounds); if(bounds.valid()) { int packed_type = PRIMITIVE_PACK_SEGMENT(PRIMITIVE_CURVE, k); references.push_back(BVHReference(bounds, j, i, packed_type)); root.grow(bounds); center.grow(bounds.center2()); } } else if(params.num_motion_curve_steps == 0 || params.use_spatial_split) { /* Simple case of motion curves: single node for the while * shutter time. Lowest memory usage but less optimal * rendering. */ /* TODO(sergey): Support motion steps for spatially split BVH. */ BoundBox bounds = BoundBox::empty; curve.bounds_grow(k, &mesh->curve_keys[0], curve_radius, bounds); const size_t num_keys = mesh->curve_keys.size(); const size_t num_steps = mesh->motion_steps; const float3 *key_steps = curve_attr_mP->data_float3(); for(size_t step = 0; step < num_steps - 1; step++) { curve.bounds_grow(k, key_steps + step*num_keys, curve_radius, bounds); } if(bounds.valid()) { int packed_type = PRIMITIVE_PACK_SEGMENT(PRIMITIVE_MOTION_CURVE, k); references.push_back(BVHReference(bounds, j, i, packed_type)); root.grow(bounds); center.grow(bounds.center2()); } } else { /* Motion curves, trace optimized case: we split curve keys * primitives into separate nodes for each of the time steps. * This way we minimize overlap of neighbor curve primitives. */ const int num_bvh_steps = params.num_motion_curve_steps * 2 + 1; const float num_bvh_steps_inv_1 = 1.0f / (num_bvh_steps - 1); const size_t num_steps = mesh->motion_steps; const float3 *curve_keys = &mesh->curve_keys[0]; const float3 *key_steps = curve_attr_mP->data_float3(); const size_t num_keys = mesh->curve_keys.size(); /* Calculate bounding box of the previous time step. * Will be reused later to avoid duplicated work on * calculating BVH time step boundbox. */ float4 prev_keys[4]; curve.cardinal_motion_keys(curve_keys, curve_radius, key_steps, num_keys, num_steps, 0.0f, k - 1, k, k + 1, k + 2, prev_keys); BoundBox prev_bounds = BoundBox::empty; curve.bounds_grow(prev_keys, prev_bounds); /* Create all primitive time steps, */ for(int bvh_step = 1; bvh_step < num_bvh_steps; ++bvh_step) { const float curr_time = (float)(bvh_step) * num_bvh_steps_inv_1; float4 curr_keys[4]; curve.cardinal_motion_keys(curve_keys, curve_radius, key_steps, num_keys, num_steps, curr_time, k - 1, k, k + 1, k + 2, curr_keys); BoundBox curr_bounds = BoundBox::empty; curve.bounds_grow(curr_keys, curr_bounds); BoundBox bounds = prev_bounds; bounds.grow(curr_bounds); if(bounds.valid()) { const float prev_time = (float)(bvh_step - 1) * num_bvh_steps_inv_1; int packed_type = PRIMITIVE_PACK_SEGMENT(PRIMITIVE_MOTION_CURVE, k); references.push_back(BVHReference(bounds, j, i, packed_type, prev_time, curr_time)); root.grow(bounds); center.grow(bounds.center2()); } /* Current time boundbox becomes previous one for the * next time step. */ prev_bounds = curr_bounds; } } } } } void BVHBuild::add_reference_mesh(BoundBox& root, BoundBox& center, Mesh *mesh, int i) { if(params.primitive_mask & PRIMITIVE_ALL_TRIANGLE) { add_reference_triangles(root, center, mesh, i); } if(params.primitive_mask & PRIMITIVE_ALL_CURVE) { add_reference_curves(root, center, mesh, i); } } void BVHBuild::add_reference_object(BoundBox& root, BoundBox& center, Object *ob, int i) { references.push_back(BVHReference(ob->bounds, -1, i, 0)); root.grow(ob->bounds); center.grow(ob->bounds.center2()); } static size_t count_curve_segments(Mesh *mesh) { size_t num = 0, num_curves = mesh->num_curves(); for(size_t i = 0; i < num_curves; i++) num += mesh->get_curve(i).num_keys - 1; return num; } void BVHBuild::add_references(BVHRange& root) { /* reserve space for references */ size_t num_alloc_references = 0; foreach(Object *ob, objects) { if(params.top_level) { if(!ob->is_traceable()) { continue; } if(!ob->mesh->is_instanced()) { if(params.primitive_mask & PRIMITIVE_ALL_TRIANGLE) { num_alloc_references += ob->mesh->num_triangles(); } if(params.primitive_mask & PRIMITIVE_ALL_CURVE) { num_alloc_references += count_curve_segments(ob->mesh); } } else num_alloc_references++; } else { if(params.primitive_mask & PRIMITIVE_ALL_TRIANGLE) { num_alloc_references += ob->mesh->num_triangles(); } if(params.primitive_mask & PRIMITIVE_ALL_CURVE) { num_alloc_references += count_curve_segments(ob->mesh); } } } references.reserve(num_alloc_references); /* add references from objects */ BoundBox bounds = BoundBox::empty, center = BoundBox::empty; int i = 0; foreach(Object *ob, objects) { if(params.top_level) { if(!ob->is_traceable()) { ++i; continue; } if(!ob->mesh->is_instanced()) add_reference_mesh(bounds, center, ob->mesh, i); else add_reference_object(bounds, center, ob, i); } else add_reference_mesh(bounds, center, ob->mesh, i); i++; if(progress.get_cancel()) return; } /* happens mostly on empty meshes */ if(!bounds.valid()) bounds.grow(make_float3(0.0f, 0.0f, 0.0f)); root = BVHRange(bounds, center, 0, references.size()); } /* Build */ BVHNode* BVHBuild::run() { BVHRange root; /* add references */ add_references(root); if(progress.get_cancel()) return NULL; /* init spatial splits */ if(params.top_level) { /* NOTE: Technically it is supported by the builder but it's not really * optimized for speed yet and not really clear yet if it has measurable * improvement on render time. Needs some extra investigation before * enabling spatial split for top level BVH. */ params.use_spatial_split = false; } spatial_min_overlap = root.bounds().safe_area() * params.spatial_split_alpha; if(params.use_spatial_split) { /* NOTE: The API here tries to be as much ready for multi-threaded build * as possible, but at the same time it tries not to introduce any * changes in behavior for until all refactoring needed for threading is * finished. * * So we currently allocate single storage for now, which is only used by * the only thread working on the spatial BVH build. */ spatial_storage.resize(TaskScheduler::num_threads() + 1); size_t num_bins = max(root.size(), (int)BVHParams::NUM_SPATIAL_BINS) - 1; foreach(BVHSpatialStorage &storage, spatial_storage) { storage.right_bounds.clear(); } spatial_storage[0].right_bounds.resize(num_bins); } spatial_free_index = 0; need_prim_time = params.num_motion_curve_steps > 0 || params.num_motion_triangle_steps > 0; /* init progress updates */ double build_start_time; build_start_time = progress_start_time = time_dt(); progress_count = 0; progress_total = references.size(); progress_original_total = progress_total; prim_type.resize(references.size()); prim_index.resize(references.size()); prim_object.resize(references.size()); if(need_prim_time) { prim_time.resize(references.size()); } else { prim_time.resize(0); } /* build recursively */ BVHNode *rootnode; if(params.use_spatial_split) { /* Perform multithreaded spatial split build. */ rootnode = build_node(root, &references, 0, 0); task_pool.wait_work(); } else { /* Perform multithreaded binning build. */ BVHObjectBinning rootbin(root, (references.size())? &references[0]: NULL); rootnode = build_node(rootbin, 0); task_pool.wait_work(); } /* delete if we canceled */ if(rootnode) { if(progress.get_cancel()) { rootnode->deleteSubtree(); rootnode = NULL; VLOG(1) << "BVH build cancelled."; } else { /*rotate(rootnode, 4, 5);*/ rootnode->update_visibility(); rootnode->update_time(); } if(rootnode != NULL) { VLOG(1) << "BVH build statistics:\n" << " Build time: " << time_dt() - build_start_time << "\n" << " Total number of nodes: " << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_NODE_COUNT)) << "\n" << " Number of inner nodes: " << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_INNER_COUNT)) << "\n" << " Number of leaf nodes: " << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_LEAF_COUNT)) << "\n" << " Number of unaligned nodes: " << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_UNALIGNED_COUNT)) << "\n" << " Allocation slop factor: " << ((prim_type.capacity() != 0) ? (float)prim_type.size() / prim_type.capacity() : 1.0f) << "\n" << " Maximum depth: " << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_DEPTH)) << "\n"; } } return rootnode; } void BVHBuild::progress_update() { if(time_dt() - progress_start_time < 0.25) return; double progress_start = (double)progress_count/(double)progress_total; double duplicates = (double)(progress_total - progress_original_total)/(double)progress_total; string msg = string_printf("Building BVH %.0f%%, duplicates %.0f%%", progress_start * 100.0, duplicates * 100.0); progress.set_substatus(msg); progress_start_time = time_dt(); } void BVHBuild::thread_build_node(InnerNode *inner, int child, BVHObjectBinning *range, int level) { if(progress.get_cancel()) return; /* build nodes */ BVHNode *node = build_node(*range, level); /* set child in inner node */ inner->children[child] = node; /* update progress */ if(range->size() < THREAD_TASK_SIZE) { /*rotate(node, INT_MAX, 5);*/ thread_scoped_lock lock(build_mutex); progress_count += range->size(); progress_update(); } } void BVHBuild::thread_build_spatial_split_node(InnerNode *inner, int child, BVHRange *range, vector *references, int level, int thread_id) { if(progress.get_cancel()) { return; } /* build nodes */ BVHNode *node = build_node(*range, references, level, thread_id); /* set child in inner node */ inner->children[child] = node; } bool BVHBuild::range_within_max_leaf_size(const BVHRange& range, const vector& references) const { size_t size = range.size(); size_t max_leaf_size = max(params.max_triangle_leaf_size, params.max_curve_leaf_size); if(size > max_leaf_size) return false; size_t num_triangles = 0; size_t num_motion_triangles = 0; size_t num_curves = 0; size_t num_motion_curves = 0; for(int i = 0; i < size; i++) { const BVHReference& ref = references[range.start() + i]; if(ref.prim_type() & PRIMITIVE_CURVE) num_curves++; if(ref.prim_type() & PRIMITIVE_MOTION_CURVE) num_motion_curves++; else if(ref.prim_type() & PRIMITIVE_TRIANGLE) num_triangles++; else if(ref.prim_type() & PRIMITIVE_MOTION_TRIANGLE) num_motion_triangles++; } return (num_triangles <= params.max_triangle_leaf_size) && (num_motion_triangles <= params.max_motion_triangle_leaf_size) && (num_curves <= params.max_curve_leaf_size) && (num_motion_curves <= params.max_motion_curve_leaf_size); } /* multithreaded binning builder */ BVHNode* BVHBuild::build_node(const BVHObjectBinning& range, int level) { size_t size = range.size(); float leafSAH = params.sah_primitive_cost * range.leafSAH; float splitSAH = params.sah_node_cost * range.bounds().half_area() + params.sah_primitive_cost * range.splitSAH; /* Have at least one inner node on top level, for performance and correct * visibility tests, since object instances do not check visibility flag. */ if(!(range.size() > 0 && params.top_level && level == 0)) { /* Make leaf node when threshold reached or SAH tells us. */ if((params.small_enough_for_leaf(size, level)) || (range_within_max_leaf_size(range, references) && leafSAH < splitSAH)) { return create_leaf_node(range, references); } } BVHObjectBinning unaligned_range; float unalignedSplitSAH = FLT_MAX; float unalignedLeafSAH = FLT_MAX; Transform aligned_space; bool do_unalinged_split = false; if(params.use_unaligned_nodes && splitSAH > params.unaligned_split_threshold*leafSAH) { aligned_space = unaligned_heuristic.compute_aligned_space( range, &references[0]); unaligned_range = BVHObjectBinning(range, &references[0], &unaligned_heuristic, &aligned_space); unalignedSplitSAH = params.sah_node_cost * unaligned_range.unaligned_bounds().half_area() + params.sah_primitive_cost * unaligned_range.splitSAH; unalignedLeafSAH = params.sah_primitive_cost * unaligned_range.leafSAH; if(!(range.size() > 0 && params.top_level && level == 0)) { if(unalignedLeafSAH < unalignedSplitSAH && unalignedSplitSAH < splitSAH && range_within_max_leaf_size(range, references)) { return create_leaf_node(range, references); } } /* Check whether unaligned split is better than the regular one. */ if(unalignedSplitSAH < splitSAH) { do_unalinged_split = true; } } /* Perform split. */ BVHObjectBinning left, right; if(do_unalinged_split) { unaligned_range.split(&references[0], left, right); } else { range.split(&references[0], left, right); } BoundBox bounds; if(do_unalinged_split) { bounds = unaligned_heuristic.compute_aligned_boundbox( range, &references[0], aligned_space); } else { bounds = range.bounds(); } /* Create inner node. */ InnerNode *inner; if(range.size() < THREAD_TASK_SIZE) { /* local build */ BVHNode *leftnode = build_node(left, level + 1); BVHNode *rightnode = build_node(right, level + 1); inner = new InnerNode(bounds, leftnode, rightnode); } else { /* Threaded build */ inner = new InnerNode(bounds); task_pool.push(new BVHBuildTask(this, inner, 0, left, level + 1), true); task_pool.push(new BVHBuildTask(this, inner, 1, right, level + 1), true); } if(do_unalinged_split) { inner->set_aligned_space(aligned_space); } return inner; } /* multithreaded spatial split builder */ BVHNode* BVHBuild::build_node(const BVHRange& range, vector *references, int level, int thread_id) { /* Update progress. * * TODO(sergey): Currently it matches old behavior, but we can move it to the * task thread (which will mimic non=split builder) and save some CPU ticks * on checking cancel status. */ progress_update(); if(progress.get_cancel()) { return NULL; } /* Small enough or too deep => create leaf. */ if(!(range.size() > 0 && params.top_level && level == 0)) { if(params.small_enough_for_leaf(range.size(), level)) { progress_count += range.size(); return create_leaf_node(range, *references); } } /* Perform splitting test. */ BVHSpatialStorage *storage = &spatial_storage[thread_id]; BVHMixedSplit split(this, storage, range, references, level); if(!(range.size() > 0 && params.top_level && level == 0)) { if(split.no_split) { progress_count += range.size(); return create_leaf_node(range, *references); } } float leafSAH = params.sah_primitive_cost * split.leafSAH; float splitSAH = params.sah_node_cost * range.bounds().half_area() + params.sah_primitive_cost * split.nodeSAH; BVHMixedSplit unaligned_split; float unalignedSplitSAH = FLT_MAX; /* float unalignedLeafSAH = FLT_MAX; */ Transform aligned_space; bool do_unalinged_split = false; if(params.use_unaligned_nodes && splitSAH > params.unaligned_split_threshold*leafSAH) { aligned_space = unaligned_heuristic.compute_aligned_space(range, &references->at(0)); unaligned_split = BVHMixedSplit(this, storage, range, references, level, &unaligned_heuristic, &aligned_space); /* unalignedLeafSAH = params.sah_primitive_cost * split.leafSAH; */ unalignedSplitSAH = params.sah_node_cost * unaligned_split.bounds.half_area() + params.sah_primitive_cost * unaligned_split.nodeSAH; /* TOOD(sergey): Check we can create leaf already. */ /* Check whether unaligned split is better than the regulat one. */ if(unalignedSplitSAH < splitSAH) { do_unalinged_split = true; } } /* Do split. */ BVHRange left, right; if(do_unalinged_split) { unaligned_split.split(this, left, right, range); } else { split.split(this, left, right, range); } progress_total += left.size() + right.size() - range.size(); BoundBox bounds; if(do_unalinged_split) { bounds = unaligned_heuristic.compute_aligned_boundbox( range, &references->at(0), aligned_space); } else { bounds = range.bounds(); } /* Create inner node. */ InnerNode *inner; if(range.size() < THREAD_TASK_SIZE) { /* Local build. */ /* Build left node. */ vector copy(references->begin() + right.start(), references->begin() + right.end()); right.set_start(0); BVHNode *leftnode = build_node(left, references, level + 1, thread_id); /* Build right node. */ BVHNode *rightnode = build_node(right, ©, level + 1, thread_id); inner = new InnerNode(bounds, leftnode, rightnode); } else { /* Threaded build. */ inner = new InnerNode(bounds); task_pool.push(new BVHSpatialSplitBuildTask(this, inner, 0, left, *references, level + 1), true); task_pool.push(new BVHSpatialSplitBuildTask(this, inner, 1, right, *references, level + 1), true); } if(do_unalinged_split) { inner->set_aligned_space(aligned_space); } return inner; } /* Create Nodes */ BVHNode *BVHBuild::create_object_leaf_nodes(const BVHReference *ref, int start, int num) { if(num == 0) { BoundBox bounds = BoundBox::empty; return new LeafNode(bounds, 0, 0, 0); } else if(num == 1) { assert(start < prim_type.size()); prim_type[start] = ref->prim_type(); prim_index[start] = ref->prim_index(); prim_object[start] = ref->prim_object(); if(need_prim_time) { prim_time[start] = make_float2(ref->time_from(), ref->time_to()); } const uint visibility = objects[ref->prim_object()]->visibility_for_tracing(); BVHNode *leaf_node = new LeafNode(ref->bounds(), visibility, start, start+1); leaf_node->time_from = ref->time_from(); leaf_node->time_to = ref->time_to(); return leaf_node; } else { int mid = num/2; BVHNode *leaf0 = create_object_leaf_nodes(ref, start, mid); BVHNode *leaf1 = create_object_leaf_nodes(ref+mid, start+mid, num-mid); BoundBox bounds = BoundBox::empty; bounds.grow(leaf0->bounds); bounds.grow(leaf1->bounds); BVHNode *inner_node = new InnerNode(bounds, leaf0, leaf1); inner_node->time_from = min(leaf0->time_from, leaf1->time_from); inner_node->time_to = max(leaf0->time_to, leaf1->time_to); return inner_node; } } BVHNode* BVHBuild::create_leaf_node(const BVHRange& range, const vector& references) { /* This is a bit overallocating here (considering leaf size into account), * but chunk-based re-allocation in vector makes it difficult to use small * size of stack storage here. Some tweaks are possible tho. * * NOTES: * - If the size is too big, we'll have inefficient stack usage, * and lots of cache misses. * - If the size is too small, then we can run out of memory * allowed to be used by vector. * In practice it wouldn't mean crash, just allocator will fallback * to heap which is slower. * - Optimistic re-allocation in STL could jump us out of stack usage * because re-allocation happens in chunks and size of those chunks we * can not control. */ typedef StackAllocator<256, int> LeafStackAllocator; typedef StackAllocator<256, float2> LeafTimeStackAllocator; typedef StackAllocator<256, BVHReference> LeafReferenceStackAllocator; vector p_type[PRIMITIVE_NUM_TOTAL]; vector p_index[PRIMITIVE_NUM_TOTAL]; vector p_object[PRIMITIVE_NUM_TOTAL]; vector p_time[PRIMITIVE_NUM_TOTAL]; vector p_ref[PRIMITIVE_NUM_TOTAL]; /* TODO(sergey): In theory we should be able to store references. */ vector object_references; uint visibility[PRIMITIVE_NUM_TOTAL] = {0}; /* NOTE: Keep initializtion in sync with actual number of primitives. */ BoundBox bounds[PRIMITIVE_NUM_TOTAL] = {BoundBox::empty, BoundBox::empty, BoundBox::empty, BoundBox::empty}; int ob_num = 0; int num_new_prims = 0; /* Fill in per-type type/index array. */ for(int i = 0; i < range.size(); i++) { const BVHReference& ref = references[range.start() + i]; if(ref.prim_index() != -1) { int type_index = bitscan(ref.prim_type() & PRIMITIVE_ALL); p_ref[type_index].push_back(ref); p_type[type_index].push_back(ref.prim_type()); p_index[type_index].push_back(ref.prim_index()); p_object[type_index].push_back(ref.prim_object()); p_time[type_index].push_back(make_float2(ref.time_from(), ref.time_to())); bounds[type_index].grow(ref.bounds()); visibility[type_index] |= objects[ref.prim_object()]->visibility_for_tracing(); if(ref.prim_type() & PRIMITIVE_ALL_CURVE) { visibility[type_index] |= PATH_RAY_CURVE; } ++num_new_prims; } else { object_references.push_back(ref); ++ob_num; } } /* Create leaf nodes for every existing primitive. * * Here we write primitive types, indices and objects to a temporary array. * This way we keep all the heavy memory allocation code outside of the * thread lock in the case of spatial split building. * * TODO(sergey): With some pointer trickery we can write directly to the * destination buffers for the non-spatial split BVH. */ BVHNode *leaves[PRIMITIVE_NUM_TOTAL + 1] = {NULL}; int num_leaves = 0; size_t start_index = 0; vector local_prim_type, local_prim_index, local_prim_object; vector local_prim_time; local_prim_type.resize(num_new_prims); local_prim_index.resize(num_new_prims); local_prim_object.resize(num_new_prims); if(need_prim_time) { local_prim_time.resize(num_new_prims); } for(int i = 0; i < PRIMITIVE_NUM_TOTAL; ++i) { int num = (int)p_type[i].size(); if(num != 0) { assert(p_type[i].size() == p_index[i].size()); assert(p_type[i].size() == p_object[i].size()); Transform aligned_space; bool alignment_found = false; for(int j = 0; j < num; ++j) { const int index = start_index + j; local_prim_type[index] = p_type[i][j]; local_prim_index[index] = p_index[i][j]; local_prim_object[index] = p_object[i][j]; if(need_prim_time) { local_prim_time[index] = p_time[i][j]; } if(params.use_unaligned_nodes && !alignment_found) { alignment_found = unaligned_heuristic.compute_aligned_space(p_ref[i][j], &aligned_space); } } LeafNode *leaf_node = new LeafNode(bounds[i], visibility[i], start_index, start_index + num); if(true) { float time_from = 1.0f, time_to = 0.0f; for(int j = 0; j < num; ++j) { const BVHReference &ref = p_ref[i][j]; time_from = min(time_from, ref.time_from()); time_to = max(time_to, ref.time_to()); } leaf_node->time_from = time_from; leaf_node->time_to = time_to; } if(alignment_found) { /* Need to recalculate leaf bounds with new alignment. */ leaf_node->bounds = BoundBox::empty; for(int j = 0; j < num; ++j) { const BVHReference &ref = p_ref[i][j]; BoundBox ref_bounds = unaligned_heuristic.compute_aligned_prim_boundbox( ref, aligned_space); leaf_node->bounds.grow(ref_bounds); } /* Set alignment space. */ leaf_node->set_aligned_space(aligned_space); } leaves[num_leaves++] = leaf_node; start_index += num; } } /* Get size of new data to be copied to the packed arrays. */ const int num_new_leaf_data = start_index; const size_t new_leaf_data_size = sizeof(int) * num_new_leaf_data; /* Copy actual data to the packed array. */ if(params.use_spatial_split) { spatial_spin_lock.lock(); /* We use first free index in the packed arrays and mode pointer to the * end of the current range. * * This doesn't give deterministic packed arrays, but it shouldn't really * matter because order of children in BVH is deterministic. */ start_index = spatial_free_index; spatial_free_index += range.size(); /* Extend an array when needed. */ const size_t range_end = start_index + range.size(); if(prim_type.size() < range_end) { /* Avoid extra re-allocations by pre-allocating bigger array in an * advance. */ if(range_end >= prim_type.capacity()) { float progress = (float)progress_count/(float)progress_total; float factor = (1.0f - progress); const size_t reserve = (size_t)(range_end + (float)range_end*factor); prim_type.reserve(reserve); prim_index.reserve(reserve); prim_object.reserve(reserve); if(need_prim_time) { prim_time.reserve(reserve); } } prim_type.resize(range_end); prim_index.resize(range_end); prim_object.resize(range_end); if(need_prim_time) { prim_time.resize(range_end); } } /* Perform actual data copy. */ if(new_leaf_data_size > 0) { memcpy(&prim_type[start_index], &local_prim_type[0], new_leaf_data_size); memcpy(&prim_index[start_index], &local_prim_index[0], new_leaf_data_size); memcpy(&prim_object[start_index], &local_prim_object[0], new_leaf_data_size); if(need_prim_time) { memcpy(&prim_time[start_index], &local_prim_time[0], sizeof(float2)*num_new_leaf_data); } } spatial_spin_lock.unlock(); } else { /* For the regular BVH builder we simply copy new data starting at the * range start. This is totally thread-safe, all threads are living * inside of their own range. */ start_index = range.start(); if(new_leaf_data_size > 0) { memcpy(&prim_type[start_index], &local_prim_type[0], new_leaf_data_size); memcpy(&prim_index[start_index], &local_prim_index[0], new_leaf_data_size); memcpy(&prim_object[start_index], &local_prim_object[0], new_leaf_data_size); if(need_prim_time) { memcpy(&prim_time[start_index], &local_prim_time[0], sizeof(float2)*num_new_leaf_data); } } } /* So far leaves were created with the zero-based index in an arrays, * here we modify the indices to correspond to actual packed array start * index. */ for(int i = 0; i < num_leaves; ++i) { LeafNode *leaf = (LeafNode *)leaves[i]; leaf->lo += start_index; leaf->hi += start_index; } /* Create leaf node for object. */ if(num_leaves == 0 || ob_num) { /* Only create object leaf nodes if there are objects or no other * nodes created. */ const BVHReference *ref = (ob_num)? &object_references[0]: NULL; leaves[num_leaves] = create_object_leaf_nodes(ref, start_index + num_new_leaf_data, ob_num); ++num_leaves; } /* TODO(sergey): Need to take care of alignment when number of leaves * is more than 1. */ if(num_leaves == 1) { /* Simplest case: single leaf, just return it. * In all the rest cases we'll be creating intermediate inner node with * an appropriate bounding box. */ return leaves[0]; } else if(num_leaves == 2) { return new InnerNode(range.bounds(), leaves[0], leaves[1]); } else if(num_leaves == 3) { BoundBox inner_bounds = merge(leaves[1]->bounds, leaves[2]->bounds); BVHNode *inner = new InnerNode(inner_bounds, leaves[1], leaves[2]); return new InnerNode(range.bounds(), leaves[0], inner); } else { /* Should be doing more branches if more primitive types added. */ assert(num_leaves <= 5); BoundBox inner_bounds_a = merge(leaves[0]->bounds, leaves[1]->bounds); BoundBox inner_bounds_b = merge(leaves[2]->bounds, leaves[3]->bounds); BVHNode *inner_a = new InnerNode(inner_bounds_a, leaves[0], leaves[1]); BVHNode *inner_b = new InnerNode(inner_bounds_b, leaves[2], leaves[3]); BoundBox inner_bounds_c = merge(inner_a->bounds, inner_b->bounds); BVHNode *inner_c = new InnerNode(inner_bounds_c, inner_a, inner_b); if(num_leaves == 5) { return new InnerNode(range.bounds(), inner_c, leaves[4]); } return inner_c; } #undef MAX_ITEMS_PER_LEAF } /* Tree Rotations */ void BVHBuild::rotate(BVHNode *node, int max_depth, int iterations) { /* in tested scenes, this resulted in slightly slower raytracing, so disabled * it for now. could be implementation bug, or depend on the scene */ if(node) for(int i = 0; i < iterations; i++) rotate(node, max_depth); } void BVHBuild::rotate(BVHNode *node, int max_depth) { /* nothing to rotate if we reached a leaf node. */ if(node->is_leaf() || max_depth < 0) return; InnerNode *parent = (InnerNode*)node; /* rotate all children first */ for(size_t c = 0; c < 2; c++) rotate(parent->children[c], max_depth-1); /* compute current area of all children */ BoundBox bounds0 = parent->children[0]->bounds; BoundBox bounds1 = parent->children[1]->bounds; float area0 = bounds0.half_area(); float area1 = bounds1.half_area(); float4 child_area = make_float4(area0, area1, 0.0f, 0.0f); /* find best rotation. we pick a target child of a first child, and swap * this with an other child. we perform the best such swap. */ float best_cost = FLT_MAX; int best_child = -1, best_target = -1, best_other = -1; for(size_t c = 0; c < 2; c++) { /* ignore leaf nodes as we cannot descent into */ if(parent->children[c]->is_leaf()) continue; InnerNode *child = (InnerNode*)parent->children[c]; BoundBox& other = (c == 0)? bounds1: bounds0; /* transpose child bounds */ BoundBox target0 = child->children[0]->bounds; BoundBox target1 = child->children[1]->bounds; /* compute cost for both possible swaps */ float cost0 = merge(other, target1).half_area() - child_area[c]; float cost1 = merge(target0, other).half_area() - child_area[c]; if(min(cost0,cost1) < best_cost) { best_child = (int)c; best_other = (int)(1-c); if(cost0 < cost1) { best_cost = cost0; best_target = 0; } else { best_cost = cost0; best_target = 1; } } } /* if we did not find a swap that improves the SAH then do nothing */ if(best_cost >= 0) return; assert(best_child == 0 || best_child == 1); assert(best_target != -1); /* perform the best found tree rotation */ InnerNode *child = (InnerNode*)parent->children[best_child]; swap(parent->children[best_other], child->children[best_target]); child->bounds = merge(child->children[0]->bounds, child->children[1]->bounds); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh_build.h000066400000000000000000000100571334742672700212660ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_BUILD_H__ #define __BVH_BUILD_H__ #include #include "bvh/bvh_params.h" #include "bvh/bvh_unaligned.h" #include "util/util_task.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Boundbox; class BVHBuildTask; class BVHNode; class BVHSpatialSplitBuildTask; class BVHParams; class InnerNode; class Mesh; class Object; class Progress; /* BVH Builder */ class BVHBuild { public: /* Constructor/Destructor */ BVHBuild(const vector& objects, array& prim_type, array& prim_index, array& prim_object, array& prim_time, const BVHParams& params, Progress& progress); ~BVHBuild(); BVHNode *run(); protected: friend class BVHMixedSplit; friend class BVHObjectSplit; friend class BVHSpatialSplit; friend class BVHBuildTask; friend class BVHSpatialSplitBuildTask; friend class BVHObjectBinning; /* Adding references. */ void add_reference_triangles(BoundBox& root, BoundBox& center, Mesh *mesh, int i); void add_reference_curves(BoundBox& root, BoundBox& center, Mesh *mesh, int i); void add_reference_mesh(BoundBox& root, BoundBox& center, Mesh *mesh, int i); void add_reference_object(BoundBox& root, BoundBox& center, Object *ob, int i); void add_references(BVHRange& root); /* Building. */ BVHNode *build_node(const BVHRange& range, vector *references, int level, int thread_id); BVHNode *build_node(const BVHObjectBinning& range, int level); BVHNode *create_leaf_node(const BVHRange& range, const vector& references); BVHNode *create_object_leaf_nodes(const BVHReference *ref, int start, int num); bool range_within_max_leaf_size(const BVHRange& range, const vector& references) const; /* Threads. */ enum { THREAD_TASK_SIZE = 4096 }; void thread_build_node(InnerNode *node, int child, BVHObjectBinning *range, int level); void thread_build_spatial_split_node(InnerNode *node, int child, BVHRange *range, vector *references, int level, int thread_id); thread_mutex build_mutex; /* Progress. */ void progress_update(); /* Tree rotations. */ void rotate(BVHNode *node, int max_depth); void rotate(BVHNode *node, int max_depth, int iterations); /* Objects and primitive references. */ vector objects; vector references; int num_original_references; /* Output primitive indexes and objects. */ array& prim_type; array& prim_index; array& prim_object; array& prim_time; bool need_prim_time; /* Build parameters. */ BVHParams params; /* Progress reporting. */ Progress& progress; double progress_start_time; size_t progress_count; size_t progress_total; size_t progress_original_total; /* Spatial splitting. */ float spatial_min_overlap; vector spatial_storage; size_t spatial_free_index; thread_spin_lock spatial_spin_lock; /* Threads. */ TaskPool task_pool; /* Unaligned building. */ BVHUnaligned unaligned_heuristic; }; CCL_NAMESPACE_END #endif /* __BVH_BUILD_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh_node.cpp000066400000000000000000000123031334742672700214430ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh_node.h" #include "bvh/bvh.h" #include "bvh/bvh_build.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN /* BVH Node */ int BVHNode::getSubtreeSize(BVH_STAT stat) const { int cnt = 0; switch(stat) { case BVH_STAT_NODE_COUNT: cnt = 1; break; case BVH_STAT_LEAF_COUNT: cnt = is_leaf() ? 1 : 0; break; case BVH_STAT_INNER_COUNT: cnt = is_leaf() ? 0 : 1; break; case BVH_STAT_TRIANGLE_COUNT: cnt = is_leaf() ? reinterpret_cast(this)->num_triangles() : 0; break; case BVH_STAT_CHILDNODE_COUNT: cnt = num_children(); break; case BVH_STAT_QNODE_COUNT: cnt = 1; for(int i = 0; i < num_children(); i++) { BVHNode *node = get_child(i); if(node->is_leaf()) { cnt += 1; } else { for(int j = 0; j < node->num_children(); j++) { cnt += node->get_child(j)->getSubtreeSize(stat); } } } return cnt; case BVH_STAT_ALIGNED_COUNT: if(!is_unaligned) { cnt = 1; } break; case BVH_STAT_UNALIGNED_COUNT: if(is_unaligned) { cnt = 1; } break; case BVH_STAT_ALIGNED_INNER_COUNT: if(!is_leaf()) { bool has_unaligned = false; for(int j = 0; j < num_children(); j++) { has_unaligned |= get_child(j)->is_unaligned; } cnt += has_unaligned? 0: 1; } break; case BVH_STAT_UNALIGNED_INNER_COUNT: if(!is_leaf()) { bool has_unaligned = false; for(int j = 0; j < num_children(); j++) { has_unaligned |= get_child(j)->is_unaligned; } cnt += has_unaligned? 1: 0; } break; case BVH_STAT_ALIGNED_INNER_QNODE_COUNT: { bool has_unaligned = false; for(int i = 0; i < num_children(); i++) { BVHNode *node = get_child(i); if(node->is_leaf()) { has_unaligned |= node->is_unaligned; } else { for(int j = 0; j < node->num_children(); j++) { cnt += node->get_child(j)->getSubtreeSize(stat); has_unaligned |= node->get_child(j)->is_unaligned; } } } cnt += has_unaligned? 0: 1; } return cnt; case BVH_STAT_UNALIGNED_INNER_QNODE_COUNT: { bool has_unaligned = false; for(int i = 0; i < num_children(); i++) { BVHNode *node = get_child(i); if(node->is_leaf()) { has_unaligned |= node->is_unaligned; } else { for(int j = 0; j < node->num_children(); j++) { cnt += node->get_child(j)->getSubtreeSize(stat); has_unaligned |= node->get_child(j)->is_unaligned; } } } cnt += has_unaligned? 1: 0; } return cnt; case BVH_STAT_ALIGNED_LEAF_COUNT: cnt = (is_leaf() && !is_unaligned) ? 1 : 0; break; case BVH_STAT_UNALIGNED_LEAF_COUNT: cnt = (is_leaf() && is_unaligned) ? 1 : 0; break; case BVH_STAT_DEPTH: if(is_leaf()) { cnt = 1; } else { for(int i = 0; i < num_children(); i++) { cnt = max(cnt, get_child(i)->getSubtreeSize(stat)); } cnt += 1; } return cnt; default: assert(0); /* unknown mode */ } if(!is_leaf()) for(int i = 0; i < num_children(); i++) cnt += get_child(i)->getSubtreeSize(stat); return cnt; } void BVHNode::deleteSubtree() { for(int i = 0; i < num_children(); i++) if(get_child(i)) get_child(i)->deleteSubtree(); delete this; } float BVHNode::computeSubtreeSAHCost(const BVHParams& p, float probability) const { float SAH = probability * p.cost(num_children(), num_triangles()); for(int i = 0; i < num_children(); i++) { BVHNode *child = get_child(i); SAH += child->computeSubtreeSAHCost(p, probability * child->bounds.safe_area()/bounds.safe_area()); } return SAH; } uint BVHNode::update_visibility() { if(!is_leaf() && visibility == 0) { InnerNode *inner = (InnerNode*)this; BVHNode *child0 = inner->children[0]; BVHNode *child1 = inner->children[1]; visibility = child0->update_visibility()|child1->update_visibility(); } return visibility; } void BVHNode::update_time() { if(!is_leaf()) { InnerNode *inner = (InnerNode*)this; BVHNode *child0 = inner->children[0]; BVHNode *child1 = inner->children[1]; child0->update_time(); child1->update_time(); time_from = min(child0->time_from, child1->time_from); time_to = max(child0->time_to, child1->time_to); } } /* Inner Node */ void InnerNode::print(int depth) const { for(int i = 0; i < depth; i++) printf(" "); printf("inner node %p\n", (void*)this); if(children[0]) children[0]->print(depth+1); if(children[1]) children[1]->print(depth+1); } void LeafNode::print(int depth) const { for(int i = 0; i < depth; i++) printf(" "); printf("leaf node %d to %d\n", lo, hi); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh_node.h000066400000000000000000000073311334742672700211150ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_NODE_H__ #define __BVH_NODE_H__ #include "util/util_boundbox.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN enum BVH_STAT { BVH_STAT_NODE_COUNT, BVH_STAT_INNER_COUNT, BVH_STAT_LEAF_COUNT, BVH_STAT_TRIANGLE_COUNT, BVH_STAT_CHILDNODE_COUNT, BVH_STAT_QNODE_COUNT, BVH_STAT_ALIGNED_COUNT, BVH_STAT_UNALIGNED_COUNT, BVH_STAT_ALIGNED_INNER_COUNT, BVH_STAT_UNALIGNED_INNER_COUNT, BVH_STAT_ALIGNED_INNER_QNODE_COUNT, BVH_STAT_UNALIGNED_INNER_QNODE_COUNT, BVH_STAT_ALIGNED_LEAF_COUNT, BVH_STAT_UNALIGNED_LEAF_COUNT, BVH_STAT_DEPTH, }; class BVHParams; class BVHNode { public: BVHNode() : is_unaligned(false), aligned_space(NULL), time_from(0.0f), time_to(1.0f) { } virtual ~BVHNode() { delete aligned_space; } virtual bool is_leaf() const = 0; virtual int num_children() const = 0; virtual BVHNode *get_child(int i) const = 0; virtual int num_triangles() const { return 0; } virtual void print(int depth = 0) const = 0; inline void set_aligned_space(const Transform& aligned_space) { is_unaligned = true; if(this->aligned_space == NULL) { this->aligned_space = new Transform(aligned_space); } else { *this->aligned_space = aligned_space; } } inline Transform get_aligned_space() const { if(aligned_space == NULL) { return transform_identity(); } return *aligned_space; } // Subtree functions int getSubtreeSize(BVH_STAT stat=BVH_STAT_NODE_COUNT) const; float computeSubtreeSAHCost(const BVHParams& p, float probability = 1.0f) const; void deleteSubtree(); uint update_visibility(); void update_time(); // Properties. BoundBox bounds; uint visibility; bool is_unaligned; /* TODO(sergey): Can be stored as 3x3 matrix, but better to have some * utilities and type defines in util_transform first. */ Transform *aligned_space; float time_from, time_to; }; class InnerNode : public BVHNode { public: InnerNode(const BoundBox& bounds, BVHNode* child0, BVHNode* child1) { this->bounds = bounds; children[0] = child0; children[1] = child1; if(child0 && child1) visibility = child0->visibility|child1->visibility; else visibility = 0; /* happens on build cancel */ } explicit InnerNode(const BoundBox& bounds) { this->bounds = bounds; visibility = 0; children[0] = NULL; children[1] = NULL; } bool is_leaf() const { return false; } int num_children() const { return 2; } BVHNode *get_child(int i) const{ assert(i>=0 && i<2); return children[i]; } void print(int depth) const; BVHNode *children[2]; }; class LeafNode : public BVHNode { public: LeafNode(const BoundBox& bounds, uint visibility, int lo, int hi) : lo(lo), hi(hi) { this->bounds = bounds; this->visibility = visibility; } LeafNode(const LeafNode& s) : BVHNode() { *this = s; } bool is_leaf() const { return true; } int num_children() const { return 0; } BVHNode *get_child(int) const { return NULL; } int num_triangles() const { return hi - lo; } void print(int depth) const; int lo; int hi; }; CCL_NAMESPACE_END #endif /* __BVH_NODE_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh_params.h000066400000000000000000000160441334742672700214540ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_PARAMS_H__ #define __BVH_PARAMS_H__ #include "util/util_boundbox.h" #include "kernel/kernel_types.h" CCL_NAMESPACE_BEGIN /* Layout of BVH tree. * * For example, how wide BVH tree is, in terms of number of children * per node. */ typedef KernelBVHLayout BVHLayout; /* Names bitflag type to denote which BVH layouts are supported by * particular area. * * Bitflags are the BVH_LAYOUT_* values. */ typedef int BVHLayoutMask; /* Get human readable name of BVH layout. */ const char *bvh_layout_name(BVHLayout layout); /* BVH Parameters */ class BVHParams { public: /* spatial split area threshold */ bool use_spatial_split; float spatial_split_alpha; /* Unaligned nodes creation threshold */ float unaligned_split_threshold; /* SAH costs */ float sah_node_cost; float sah_primitive_cost; /* number of primitives in leaf */ int min_leaf_size; int max_triangle_leaf_size; int max_motion_triangle_leaf_size; int max_curve_leaf_size; int max_motion_curve_leaf_size; /* object or mesh level bvh */ bool top_level; /* BVH layout to be built. */ BVHLayout bvh_layout; /* Mask of primitives to be included into the BVH. */ int primitive_mask; /* Use unaligned bounding boxes. * Only used for curves BVH. */ bool use_unaligned_nodes; /* Split time range to this number of steps and create leaf node for each * of this time steps. * * Speeds up rendering of motion curve primitives in the cost of higher * memory usage. */ int num_motion_curve_steps; /* Same as above, but for triangle primitives. */ int num_motion_triangle_steps; /* fixed parameters */ enum { MAX_DEPTH = 64, MAX_SPATIAL_DEPTH = 48, NUM_SPATIAL_BINS = 32 }; BVHParams() { use_spatial_split = true; spatial_split_alpha = 1e-5f; unaligned_split_threshold = 0.7f; /* todo: see if splitting up primitive cost to be separate for triangles * and curves can help. so far in tests it doesn't help, but why? */ sah_node_cost = 1.0f; sah_primitive_cost = 1.0f; min_leaf_size = 1; max_triangle_leaf_size = 8; max_motion_triangle_leaf_size = 8; max_curve_leaf_size = 1; max_motion_curve_leaf_size = 4; top_level = false; bvh_layout = BVH_LAYOUT_BVH2; use_unaligned_nodes = false; primitive_mask = PRIMITIVE_ALL; num_motion_curve_steps = 0; num_motion_triangle_steps = 0; } /* SAH costs */ __forceinline float cost(int num_nodes, int num_primitives) const { return node_cost(num_nodes) + primitive_cost(num_primitives); } __forceinline float primitive_cost(int n) const { return n*sah_primitive_cost; } __forceinline float node_cost(int n) const { return n*sah_node_cost; } __forceinline bool small_enough_for_leaf(int size, int level) { return (size <= min_leaf_size || level >= MAX_DEPTH); } /* Gets best matching BVH. * * If the requested layout is supported by the device, it will be used. * Otherwise, widest supported layout below that will be used. */ static BVHLayout best_bvh_layout(BVHLayout requested_layout, BVHLayoutMask supported_layouts); }; /* BVH Reference * * Reference to a primitive. Primitive index and object are sneakily packed * into BoundBox to reduce memory usage and align nicely */ class BVHReference { public: __forceinline BVHReference() {} __forceinline BVHReference(const BoundBox& bounds_, int prim_index_, int prim_object_, int prim_type, float time_from = 0.0f, float time_to = 1.0f) : rbounds(bounds_), time_from_(time_from), time_to_(time_to) { rbounds.min.w = __int_as_float(prim_index_); rbounds.max.w = __int_as_float(prim_object_); type = prim_type; } __forceinline const BoundBox& bounds() const { return rbounds; } __forceinline int prim_index() const { return __float_as_int(rbounds.min.w); } __forceinline int prim_object() const { return __float_as_int(rbounds.max.w); } __forceinline int prim_type() const { return type; } __forceinline float time_from() const { return time_from_; } __forceinline float time_to() const { return time_to_; } BVHReference& operator=(const BVHReference &arg) { if(&arg != this) { memcpy(this, &arg, sizeof(BVHReference)); } return *this; } protected: BoundBox rbounds; uint type; float time_from_, time_to_; }; /* BVH Range * * Build range used during construction, to indicate the bounds and place in * the reference array of a subset of primitives Again uses trickery to pack * integers into BoundBox for alignment purposes. */ class BVHRange { public: __forceinline BVHRange() { rbounds.min.w = __int_as_float(0); rbounds.max.w = __int_as_float(0); } __forceinline BVHRange(const BoundBox& bounds_, int start_, int size_) : rbounds(bounds_) { rbounds.min.w = __int_as_float(start_); rbounds.max.w = __int_as_float(size_); } __forceinline BVHRange(const BoundBox& bounds_, const BoundBox& cbounds_, int start_, int size_) : rbounds(bounds_), cbounds(cbounds_) { rbounds.min.w = __int_as_float(start_); rbounds.max.w = __int_as_float(size_); } __forceinline void set_start(int start_) { rbounds.min.w = __int_as_float(start_); } __forceinline const BoundBox& bounds() const { return rbounds; } __forceinline const BoundBox& cent_bounds() const { return cbounds; } __forceinline int start() const { return __float_as_int(rbounds.min.w); } __forceinline int size() const { return __float_as_int(rbounds.max.w); } __forceinline int end() const { return start() + size(); } protected: BoundBox rbounds; BoundBox cbounds; }; /* BVH Spatial Bin */ struct BVHSpatialBin { BoundBox bounds; int enter; int exit; __forceinline BVHSpatialBin() { } }; /* BVH Spatial Storage * * The idea of this storage is have thread-specific storage for the spatial * splitters. We can pre-allocate this storage in advance and avoid heavy memory * operations during split process. */ struct BVHSpatialStorage { /* Accumulated bounds when sweeping from right to left. */ vector right_bounds; /* Bins used for histogram when selecting best split plane. */ BVHSpatialBin bins[3][BVHParams::NUM_SPATIAL_BINS]; /* Temporary storage for the new references. Used by spatial split to store * new references in before they're getting inserted into actual array, */ vector new_references; }; CCL_NAMESPACE_END #endif /* __BVH_PARAMS_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh_sort.cpp000066400000000000000000000140601334742672700215070ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh_sort.h" #include "bvh/bvh_build.h" #include "util/util_algorithm.h" #include "util/util_task.h" CCL_NAMESPACE_BEGIN static const int BVH_SORT_THRESHOLD = 4096; struct BVHReferenceCompare { public: int dim; const BVHUnaligned *unaligned_heuristic; const Transform *aligned_space; BVHReferenceCompare(int dim, const BVHUnaligned *unaligned_heuristic, const Transform *aligned_space) : dim(dim), unaligned_heuristic(unaligned_heuristic), aligned_space(aligned_space) { } __forceinline BoundBox get_prim_bounds(const BVHReference& prim) const { return (aligned_space != NULL) ? unaligned_heuristic->compute_aligned_prim_boundbox( prim, *aligned_space) : prim.bounds(); } /* Compare two references. * * Returns value is similar to return value of strcmp(). */ __forceinline int compare(const BVHReference& ra, const BVHReference& rb) const { BoundBox ra_bounds = get_prim_bounds(ra), rb_bounds = get_prim_bounds(rb); float ca = ra_bounds.min[dim] + ra_bounds.max[dim]; float cb = rb_bounds.min[dim] + rb_bounds.max[dim]; if(ca < cb) return -1; else if(ca > cb) return 1; else if(ra.prim_object() < rb.prim_object()) return -1; else if(ra.prim_object() > rb.prim_object()) return 1; else if(ra.prim_index() < rb.prim_index()) return -1; else if(ra.prim_index() > rb.prim_index()) return 1; else if(ra.prim_type() < rb.prim_type()) return -1; else if(ra.prim_type() > rb.prim_type()) return 1; return 0; } bool operator()(const BVHReference& ra, const BVHReference& rb) { return (compare(ra, rb) < 0); } }; static void bvh_reference_sort_threaded(TaskPool *task_pool, BVHReference *data, const int job_start, const int job_end, const BVHReferenceCompare& compare); class BVHSortTask : public Task { public: BVHSortTask(TaskPool *task_pool, BVHReference *data, const int job_start, const int job_end, const BVHReferenceCompare& compare) { run = function_bind(bvh_reference_sort_threaded, task_pool, data, job_start, job_end, compare); } }; /* Multi-threaded reference sort. */ static void bvh_reference_sort_threaded(TaskPool *task_pool, BVHReference *data, const int job_start, const int job_end, const BVHReferenceCompare& compare) { int start = job_start, end = job_end; bool have_work = (start < end); while(have_work) { const int count = job_end - job_start; if(count < BVH_SORT_THRESHOLD) { /* Number of reference low enough, faster to finish the job * in one thread rather than to spawn more threads. */ sort(data+job_start, data+job_end+1, compare); break; } /* Single QSort step. * Use median-of-three method for the pivot point. */ int left = start, right = end; int center = (left + right) >> 1; if(compare.compare(data[left], data[center]) > 0) { swap(data[left], data[center]); } if(compare.compare(data[left], data[right]) > 0) { swap(data[left], data[right]); } if(compare.compare(data[center], data[right]) > 0) { swap(data[center], data[right]); } swap(data[center], data[right - 1]); BVHReference median = data[right - 1]; do { while(compare.compare(data[left], median) < 0) { ++left; } while(compare.compare(data[right], median) > 0) { --right; } if(left <= right) { swap(data[left], data[right]); ++left; --right; } } while(left <= right); /* We only create one new task here to reduce downside effects of * latency in TaskScheduler. * So generally current thread keeps working on the left part of the * array, and we create new task for the right side. * However, if there's nothing to be done in the left side of the array * we don't create any tasks and make it so current thread works on the * right side. */ have_work = false; if(left < end) { if(start < right) { task_pool->push(new BVHSortTask(task_pool, data, left, end, compare), true); } else { start = left; have_work = true; } } if(start < right) { end = right; have_work = true; } } } void bvh_reference_sort(int start, int end, BVHReference *data, int dim, const BVHUnaligned *unaligned_heuristic, const Transform *aligned_space) { const int count = end - start; BVHReferenceCompare compare(dim, unaligned_heuristic, aligned_space); if(count < BVH_SORT_THRESHOLD) { /* It is important to not use any mutex if array is small enough, * otherwise we end up in situation when we're going to sleep far * too often. */ sort(data+start, data+end, compare); } else { TaskPool task_pool; bvh_reference_sort_threaded(&task_pool, data, start, end - 1, compare); task_pool.wait_work(); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh_sort.h000066400000000000000000000021771334742672700211620ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_SORT_H__ #define __BVH_SORT_H__ #include CCL_NAMESPACE_BEGIN class BVHReference; class BVHUnaligned; struct Transform; void bvh_reference_sort(int start, int end, BVHReference *data, int dim, const BVHUnaligned *unaligned_heuristic = NULL, const Transform *aligned_space = NULL); CCL_NAMESPACE_END #endif /* __BVH_SORT_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh_split.cpp000066400000000000000000000443151334742672700216610ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh_split.h" #include "bvh/bvh_build.h" #include "bvh/bvh_sort.h" #include "render/mesh.h" #include "render/object.h" #include "util/util_algorithm.h" CCL_NAMESPACE_BEGIN /* Object Split */ BVHObjectSplit::BVHObjectSplit(BVHBuild *builder, BVHSpatialStorage *storage, const BVHRange& range, vector *references, float nodeSAH, const BVHUnaligned *unaligned_heuristic, const Transform *aligned_space) : sah(FLT_MAX), dim(0), num_left(0), left_bounds(BoundBox::empty), right_bounds(BoundBox::empty), storage_(storage), references_(references), unaligned_heuristic_(unaligned_heuristic), aligned_space_(aligned_space) { const BVHReference *ref_ptr = &references_->at(range.start()); float min_sah = FLT_MAX; storage_->right_bounds.resize(range.size()); for(int dim = 0; dim < 3; dim++) { /* Sort references. */ bvh_reference_sort(range.start(), range.end(), &references_->at(0), dim, unaligned_heuristic_, aligned_space_); /* sweep right to left and determine bounds. */ BoundBox right_bounds = BoundBox::empty; for(int i = range.size() - 1; i > 0; i--) { BoundBox prim_bounds = get_prim_bounds(ref_ptr[i]); right_bounds.grow(prim_bounds); storage_->right_bounds[i - 1] = right_bounds; } /* sweep left to right and select lowest SAH. */ BoundBox left_bounds = BoundBox::empty; for(int i = 1; i < range.size(); i++) { BoundBox prim_bounds = get_prim_bounds(ref_ptr[i - 1]); left_bounds.grow(prim_bounds); right_bounds = storage_->right_bounds[i - 1]; float sah = nodeSAH + left_bounds.safe_area() * builder->params.primitive_cost(i) + right_bounds.safe_area() * builder->params.primitive_cost(range.size() - i); if(sah < min_sah) { min_sah = sah; this->sah = sah; this->dim = dim; this->num_left = i; this->left_bounds = left_bounds; this->right_bounds = right_bounds; } } } } void BVHObjectSplit::split(BVHRange& left, BVHRange& right, const BVHRange& range) { assert(references_->size() > 0); /* sort references according to split */ bvh_reference_sort(range.start(), range.end(), &references_->at(0), this->dim, unaligned_heuristic_, aligned_space_); BoundBox effective_left_bounds, effective_right_bounds; const int num_right = range.size() - this->num_left; if(aligned_space_ == NULL) { effective_left_bounds = left_bounds; effective_right_bounds = right_bounds; } else { effective_left_bounds = BoundBox::empty; effective_right_bounds = BoundBox::empty; for(int i = 0; i < this->num_left; ++i) { BoundBox prim_boundbox = references_->at(range.start() + i).bounds(); effective_left_bounds.grow(prim_boundbox); } for(int i = 0; i < num_right; ++i) { BoundBox prim_boundbox = references_->at(range.start() + this->num_left + i).bounds(); effective_right_bounds.grow(prim_boundbox); } } /* split node ranges */ left = BVHRange(effective_left_bounds, range.start(), this->num_left); right = BVHRange(effective_right_bounds, left.end(), num_right); } /* Spatial Split */ BVHSpatialSplit::BVHSpatialSplit(const BVHBuild& builder, BVHSpatialStorage *storage, const BVHRange& range, vector *references, float nodeSAH, const BVHUnaligned *unaligned_heuristic, const Transform *aligned_space) : sah(FLT_MAX), dim(0), pos(0.0f), storage_(storage), references_(references), unaligned_heuristic_(unaligned_heuristic), aligned_space_(aligned_space) { /* initialize bins. */ BoundBox range_bounds; if(aligned_space == NULL) { range_bounds = range.bounds(); } else { range_bounds = unaligned_heuristic->compute_aligned_boundbox( range, &references->at(0), *aligned_space); } float3 origin = range_bounds.min; float3 binSize = (range_bounds.max - origin) * (1.0f / (float)BVHParams::NUM_SPATIAL_BINS); float3 invBinSize = 1.0f / binSize; for(int dim = 0; dim < 3; dim++) { for(int i = 0; i < BVHParams::NUM_SPATIAL_BINS; i++) { BVHSpatialBin& bin = storage_->bins[dim][i]; bin.bounds = BoundBox::empty; bin.enter = 0; bin.exit = 0; } } /* chop references into bins. */ for(unsigned int refIdx = range.start(); refIdx < range.end(); refIdx++) { const BVHReference& ref = references_->at(refIdx); BoundBox prim_bounds = get_prim_bounds(ref); float3 firstBinf = (prim_bounds.min - origin) * invBinSize; float3 lastBinf = (prim_bounds.max - origin) * invBinSize; int3 firstBin = make_int3((int)firstBinf.x, (int)firstBinf.y, (int)firstBinf.z); int3 lastBin = make_int3((int)lastBinf.x, (int)lastBinf.y, (int)lastBinf.z); firstBin = clamp(firstBin, 0, BVHParams::NUM_SPATIAL_BINS - 1); lastBin = clamp(lastBin, firstBin, BVHParams::NUM_SPATIAL_BINS - 1); for(int dim = 0; dim < 3; dim++) { BVHReference currRef(get_prim_bounds(ref), ref.prim_index(), ref.prim_object(), ref.prim_type()); for(int i = firstBin[dim]; i < lastBin[dim]; i++) { BVHReference leftRef, rightRef; split_reference(builder, leftRef, rightRef, currRef, dim, origin[dim] + binSize[dim] * (float)(i + 1)); storage_->bins[dim][i].bounds.grow(leftRef.bounds()); currRef = rightRef; } storage_->bins[dim][lastBin[dim]].bounds.grow(currRef.bounds()); storage_->bins[dim][firstBin[dim]].enter++; storage_->bins[dim][lastBin[dim]].exit++; } } /* select best split plane. */ storage_->right_bounds.resize(BVHParams::NUM_SPATIAL_BINS); for(int dim = 0; dim < 3; dim++) { /* sweep right to left and determine bounds. */ BoundBox right_bounds = BoundBox::empty; for(int i = BVHParams::NUM_SPATIAL_BINS - 1; i > 0; i--) { right_bounds.grow(storage_->bins[dim][i].bounds); storage_->right_bounds[i - 1] = right_bounds; } /* sweep left to right and select lowest SAH. */ BoundBox left_bounds = BoundBox::empty; int leftNum = 0; int rightNum = range.size(); for(int i = 1; i < BVHParams::NUM_SPATIAL_BINS; i++) { left_bounds.grow(storage_->bins[dim][i - 1].bounds); leftNum += storage_->bins[dim][i - 1].enter; rightNum -= storage_->bins[dim][i - 1].exit; float sah = nodeSAH + left_bounds.safe_area() * builder.params.primitive_cost(leftNum) + storage_->right_bounds[i - 1].safe_area() * builder.params.primitive_cost(rightNum); if(sah < this->sah) { this->sah = sah; this->dim = dim; this->pos = origin[dim] + binSize[dim] * (float)i; } } } } void BVHSpatialSplit::split(BVHBuild *builder, BVHRange& left, BVHRange& right, const BVHRange& range) { /* Categorize references and compute bounds. * * Left-hand side: [left_start, left_end[ * Uncategorized/split: [left_end, right_start[ * Right-hand side: [right_start, refs.size()[ */ vector& refs = *references_; int left_start = range.start(); int left_end = left_start; int right_start = range.end(); int right_end = range.end(); BoundBox left_bounds = BoundBox::empty; BoundBox right_bounds = BoundBox::empty; for(int i = left_end; i < right_start; i++) { BoundBox prim_bounds = get_prim_bounds(refs[i]); if(prim_bounds.max[this->dim] <= this->pos) { /* entirely on the left-hand side */ left_bounds.grow(prim_bounds); swap(refs[i], refs[left_end++]); } else if(prim_bounds.min[this->dim] >= this->pos) { /* entirely on the right-hand side */ right_bounds.grow(prim_bounds); swap(refs[i--], refs[--right_start]); } } /* Duplicate or unsplit references intersecting both sides. * * Duplication happens into a temporary pre-allocated vector in order to * reduce number of memmove() calls happening in vector.insert(). */ vector& new_refs = storage_->new_references; new_refs.clear(); new_refs.reserve(right_start - left_end); while(left_end < right_start) { /* split reference. */ BVHReference curr_ref(get_prim_bounds(refs[left_end]), refs[left_end].prim_index(), refs[left_end].prim_object(), refs[left_end].prim_type()); BVHReference lref, rref; split_reference(*builder, lref, rref, curr_ref, this->dim, this->pos); /* compute SAH for duplicate/unsplit candidates. */ BoundBox lub = left_bounds; // Unsplit to left: new left-hand bounds. BoundBox rub = right_bounds; // Unsplit to right: new right-hand bounds. BoundBox ldb = left_bounds; // Duplicate: new left-hand bounds. BoundBox rdb = right_bounds; // Duplicate: new right-hand bounds. lub.grow(curr_ref.bounds()); rub.grow(curr_ref.bounds()); ldb.grow(lref.bounds()); rdb.grow(rref.bounds()); float lac = builder->params.primitive_cost(left_end - left_start); float rac = builder->params.primitive_cost(right_end - right_start); float lbc = builder->params.primitive_cost(left_end - left_start + 1); float rbc = builder->params.primitive_cost(right_end - right_start + 1); float unsplitLeftSAH = lub.safe_area() * lbc + right_bounds.safe_area() * rac; float unsplitRightSAH = left_bounds.safe_area() * lac + rub.safe_area() * rbc; float duplicateSAH = ldb.safe_area() * lbc + rdb.safe_area() * rbc; float minSAH = min(min(unsplitLeftSAH, unsplitRightSAH), duplicateSAH); if(minSAH == unsplitLeftSAH) { /* unsplit to left */ left_bounds = lub; left_end++; } else if(minSAH == unsplitRightSAH) { /* unsplit to right */ right_bounds = rub; swap(refs[left_end], refs[--right_start]); } else { /* duplicate */ left_bounds = ldb; right_bounds = rdb; refs[left_end++] = lref; new_refs.push_back(rref); right_end++; } } /* Insert duplicated references into actual array in one go. */ if(new_refs.size() != 0) { refs.insert(refs.begin() + (right_end - new_refs.size()), new_refs.begin(), new_refs.end()); } if(aligned_space_ != NULL) { left_bounds = right_bounds = BoundBox::empty; for(int i = left_start; i < left_end - left_start; ++i) { BoundBox prim_boundbox = references_->at(i).bounds(); left_bounds.grow(prim_boundbox); } for(int i = right_start; i < right_end - right_start; ++i) { BoundBox prim_boundbox = references_->at(i).bounds(); right_bounds.grow(prim_boundbox); } } left = BVHRange(left_bounds, left_start, left_end - left_start); right = BVHRange(right_bounds, right_start, right_end - right_start); } void BVHSpatialSplit::split_triangle_primitive(const Mesh *mesh, const Transform *tfm, int prim_index, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds) { Mesh::Triangle t = mesh->get_triangle(prim_index); const float3 *verts = &mesh->verts[0]; float3 v1 = tfm ? transform_point(tfm, verts[t.v[2]]) : verts[t.v[2]]; v1 = get_unaligned_point(v1); for(int i = 0; i < 3; i++) { float3 v0 = v1; int vindex = t.v[i]; v1 = tfm ? transform_point(tfm, verts[vindex]) : verts[vindex]; v1 = get_unaligned_point(v1); float v0p = v0[dim]; float v1p = v1[dim]; /* insert vertex to the boxes it belongs to. */ if(v0p <= pos) left_bounds.grow(v0); if(v0p >= pos) right_bounds.grow(v0); /* edge intersects the plane => insert intersection to both boxes. */ if((v0p < pos && v1p > pos) || (v0p > pos && v1p < pos)) { float3 t = lerp(v0, v1, clamp((pos - v0p) / (v1p - v0p), 0.0f, 1.0f)); left_bounds.grow(t); right_bounds.grow(t); } } } void BVHSpatialSplit::split_curve_primitive(const Mesh *mesh, const Transform *tfm, int prim_index, int segment_index, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds) { /* curve split: NOTE - Currently ignores curve width and needs to be fixed.*/ Mesh::Curve curve = mesh->get_curve(prim_index); const int k0 = curve.first_key + segment_index; const int k1 = k0 + 1; float3 v0 = mesh->curve_keys[k0]; float3 v1 = mesh->curve_keys[k1]; if(tfm != NULL) { v0 = transform_point(tfm, v0); v1 = transform_point(tfm, v1); } v0 = get_unaligned_point(v0); v1 = get_unaligned_point(v1); float v0p = v0[dim]; float v1p = v1[dim]; /* insert vertex to the boxes it belongs to. */ if(v0p <= pos) left_bounds.grow(v0); if(v0p >= pos) right_bounds.grow(v0); if(v1p <= pos) left_bounds.grow(v1); if(v1p >= pos) right_bounds.grow(v1); /* edge intersects the plane => insert intersection to both boxes. */ if((v0p < pos && v1p > pos) || (v0p > pos && v1p < pos)) { float3 t = lerp(v0, v1, clamp((pos - v0p) / (v1p - v0p), 0.0f, 1.0f)); left_bounds.grow(t); right_bounds.grow(t); } } void BVHSpatialSplit::split_triangle_reference(const BVHReference& ref, const Mesh *mesh, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds) { split_triangle_primitive(mesh, NULL, ref.prim_index(), dim, pos, left_bounds, right_bounds); } void BVHSpatialSplit::split_curve_reference(const BVHReference& ref, const Mesh *mesh, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds) { split_curve_primitive(mesh, NULL, ref.prim_index(), PRIMITIVE_UNPACK_SEGMENT(ref.prim_type()), dim, pos, left_bounds, right_bounds); } void BVHSpatialSplit::split_object_reference(const Object *object, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds) { Mesh *mesh = object->mesh; for(int tri_idx = 0; tri_idx < mesh->num_triangles(); ++tri_idx) { split_triangle_primitive(mesh, &object->tfm, tri_idx, dim, pos, left_bounds, right_bounds); } for(int curve_idx = 0; curve_idx < mesh->num_curves(); ++curve_idx) { Mesh::Curve curve = mesh->get_curve(curve_idx); for(int segment_idx = 0; segment_idx < curve.num_keys - 1; ++segment_idx) { split_curve_primitive(mesh, &object->tfm, curve_idx, segment_idx, dim, pos, left_bounds, right_bounds); } } } void BVHSpatialSplit::split_reference(const BVHBuild& builder, BVHReference& left, BVHReference& right, const BVHReference& ref, int dim, float pos) { /* initialize boundboxes */ BoundBox left_bounds = BoundBox::empty; BoundBox right_bounds = BoundBox::empty; /* loop over vertices/edges. */ const Object *ob = builder.objects[ref.prim_object()]; const Mesh *mesh = ob->mesh; if(ref.prim_type() & PRIMITIVE_ALL_TRIANGLE) { split_triangle_reference(ref, mesh, dim, pos, left_bounds, right_bounds); } else if(ref.prim_type() & PRIMITIVE_ALL_CURVE) { split_curve_reference(ref, mesh, dim, pos, left_bounds, right_bounds); } else { split_object_reference(ob, dim, pos, left_bounds, right_bounds); } /* intersect with original bounds. */ left_bounds.max[dim] = pos; right_bounds.min[dim] = pos; left_bounds.intersect(ref.bounds()); right_bounds.intersect(ref.bounds()); /* set references */ left = BVHReference(left_bounds, ref.prim_index(), ref.prim_object(), ref.prim_type()); right = BVHReference(right_bounds, ref.prim_index(), ref.prim_object(), ref.prim_type()); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh_split.h000066400000000000000000000171371334742672700213300ustar00rootroot00000000000000/* * Adapted from code copyright 2009-2010 NVIDIA Corporation * Modifications Copyright 2011, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_SPLIT_H__ #define __BVH_SPLIT_H__ #include "bvh/bvh_build.h" #include "bvh/bvh_params.h" CCL_NAMESPACE_BEGIN class BVHBuild; struct Transform; /* Object Split */ class BVHObjectSplit { public: float sah; int dim; int num_left; BoundBox left_bounds; BoundBox right_bounds; BVHObjectSplit() {} BVHObjectSplit(BVHBuild *builder, BVHSpatialStorage *storage, const BVHRange& range, vector *references, float nodeSAH, const BVHUnaligned *unaligned_heuristic = NULL, const Transform *aligned_space = NULL); void split(BVHRange& left, BVHRange& right, const BVHRange& range); protected: BVHSpatialStorage *storage_; vector *references_; const BVHUnaligned *unaligned_heuristic_; const Transform *aligned_space_; __forceinline BoundBox get_prim_bounds(const BVHReference& prim) const { if(aligned_space_ == NULL) { return prim.bounds(); } else { return unaligned_heuristic_->compute_aligned_prim_boundbox( prim, *aligned_space_); } } }; /* Spatial Split */ class BVHSpatialSplit { public: float sah; int dim; float pos; BVHSpatialSplit() : sah(FLT_MAX), dim(0), pos(0.0f), storage_(NULL), references_(NULL) {} BVHSpatialSplit(const BVHBuild& builder, BVHSpatialStorage *storage, const BVHRange& range, vector *references, float nodeSAH, const BVHUnaligned *unaligned_heuristic = NULL, const Transform *aligned_space = NULL); void split(BVHBuild *builder, BVHRange& left, BVHRange& right, const BVHRange& range); void split_reference(const BVHBuild& builder, BVHReference& left, BVHReference& right, const BVHReference& ref, int dim, float pos); protected: BVHSpatialStorage *storage_; vector *references_; const BVHUnaligned *unaligned_heuristic_; const Transform *aligned_space_; /* Lower-level functions which calculates boundaries of left and right nodes * needed for spatial split. * * Operates directly with primitive specified by it's index, reused by higher * level splitting functions. */ void split_triangle_primitive(const Mesh *mesh, const Transform *tfm, int prim_index, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds); void split_curve_primitive(const Mesh *mesh, const Transform *tfm, int prim_index, int segment_index, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds); /* Lower-level functions which calculates boundaries of left and right nodes * needed for spatial split. * * Operates with BVHReference, internally uses lower level API functions. */ void split_triangle_reference(const BVHReference& ref, const Mesh *mesh, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds); void split_curve_reference(const BVHReference& ref, const Mesh *mesh, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds); void split_object_reference(const Object *object, int dim, float pos, BoundBox& left_bounds, BoundBox& right_bounds); __forceinline BoundBox get_prim_bounds(const BVHReference& prim) const { if(aligned_space_ == NULL) { return prim.bounds(); } else { return unaligned_heuristic_->compute_aligned_prim_boundbox( prim, *aligned_space_); } } __forceinline float3 get_unaligned_point(const float3& point) const { if(aligned_space_ == NULL) { return point; } else { return transform_point(aligned_space_, point); } } }; /* Mixed Object-Spatial Split */ class BVHMixedSplit { public: BVHObjectSplit object; BVHSpatialSplit spatial; float leafSAH; float nodeSAH; float minSAH; bool no_split; BoundBox bounds; BVHMixedSplit() {} __forceinline BVHMixedSplit(BVHBuild *builder, BVHSpatialStorage *storage, const BVHRange& range, vector *references, int level, const BVHUnaligned *unaligned_heuristic = NULL, const Transform *aligned_space = NULL) { if(aligned_space == NULL) { bounds = range.bounds(); } else { bounds = unaligned_heuristic->compute_aligned_boundbox( range, &references->at(0), *aligned_space); } /* find split candidates. */ float area = bounds.safe_area(); leafSAH = area * builder->params.primitive_cost(range.size()); nodeSAH = area * builder->params.node_cost(2); object = BVHObjectSplit(builder, storage, range, references, nodeSAH, unaligned_heuristic, aligned_space); if(builder->params.use_spatial_split && level < BVHParams::MAX_SPATIAL_DEPTH) { BoundBox overlap = object.left_bounds; overlap.intersect(object.right_bounds); if(overlap.safe_area() >= builder->spatial_min_overlap) { spatial = BVHSpatialSplit(*builder, storage, range, references, nodeSAH, unaligned_heuristic, aligned_space); } } /* leaf SAH is the lowest => create leaf. */ minSAH = min(min(leafSAH, object.sah), spatial.sah); no_split = (minSAH == leafSAH && builder->range_within_max_leaf_size(range, *references)); } __forceinline void split(BVHBuild *builder, BVHRange& left, BVHRange& right, const BVHRange& range) { if(builder->params.use_spatial_split && minSAH == spatial.sah) spatial.split(builder, left, right, range); if(!left.size() || !right.size()) object.split(left, right, range); } }; CCL_NAMESPACE_END #endif /* __BVH_SPLIT_H__ */ goxel-0.8.1/ext_src/cycles/src/bvh/bvh_unaligned.cpp000066400000000000000000000121251334742672700224660ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh_unaligned.h" #include "render/mesh.h" #include "render/object.h" #include "bvh/bvh_binning.h" #include "bvh_params.h" #include "util/util_boundbox.h" #include "util/util_transform.h" CCL_NAMESPACE_BEGIN BVHUnaligned::BVHUnaligned(const vector& objects) : objects_(objects) { } Transform BVHUnaligned::compute_aligned_space( const BVHObjectBinning& range, const BVHReference *references) const { for(int i = range.start(); i < range.end(); ++i) { const BVHReference& ref = references[i]; Transform aligned_space; /* Use first primitive which defines correct direction to define * the orientation space. */ if(compute_aligned_space(ref, &aligned_space)) { return aligned_space; } } return transform_identity(); } Transform BVHUnaligned::compute_aligned_space( const BVHRange& range, const BVHReference *references) const { for(int i = range.start(); i < range.end(); ++i) { const BVHReference& ref = references[i]; Transform aligned_space; /* Use first primitive which defines correct direction to define * the orientation space. */ if(compute_aligned_space(ref, &aligned_space)) { return aligned_space; } } return transform_identity(); } bool BVHUnaligned::compute_aligned_space(const BVHReference& ref, Transform *aligned_space) const { const Object *object = objects_[ref.prim_object()]; const int packed_type = ref.prim_type(); const int type = (packed_type & PRIMITIVE_ALL); if(type & PRIMITIVE_CURVE) { const int curve_index = ref.prim_index(); const int segment = PRIMITIVE_UNPACK_SEGMENT(packed_type); const Mesh *mesh = object->mesh; const Mesh::Curve& curve = mesh->get_curve(curve_index); const int key = curve.first_key + segment; const float3 v1 = mesh->curve_keys[key], v2 = mesh->curve_keys[key + 1]; float length; const float3 axis = normalize_len(v2 - v1, &length); if(length > 1e-6f) { *aligned_space = make_transform_frame(axis); return true; } } *aligned_space = transform_identity(); return false; } BoundBox BVHUnaligned::compute_aligned_prim_boundbox( const BVHReference& prim, const Transform& aligned_space) const { BoundBox bounds = BoundBox::empty; const Object *object = objects_[prim.prim_object()]; const int packed_type = prim.prim_type(); const int type = (packed_type & PRIMITIVE_ALL); if(type & PRIMITIVE_CURVE) { const int curve_index = prim.prim_index(); const int segment = PRIMITIVE_UNPACK_SEGMENT(packed_type); const Mesh *mesh = object->mesh; const Mesh::Curve& curve = mesh->get_curve(curve_index); curve.bounds_grow(segment, &mesh->curve_keys[0], &mesh->curve_radius[0], aligned_space, bounds); } else { bounds = prim.bounds().transformed(&aligned_space); } return bounds; } BoundBox BVHUnaligned::compute_aligned_boundbox( const BVHObjectBinning& range, const BVHReference *references, const Transform& aligned_space, BoundBox *cent_bounds) const { BoundBox bounds = BoundBox::empty; if(cent_bounds != NULL) { *cent_bounds = BoundBox::empty; } for(int i = range.start(); i < range.end(); ++i) { const BVHReference& ref = references[i]; BoundBox ref_bounds = compute_aligned_prim_boundbox(ref, aligned_space); bounds.grow(ref_bounds); if(cent_bounds != NULL) { cent_bounds->grow(ref_bounds.center2()); } } return bounds; } BoundBox BVHUnaligned::compute_aligned_boundbox( const BVHRange& range, const BVHReference *references, const Transform& aligned_space, BoundBox *cent_bounds) const { BoundBox bounds = BoundBox::empty; if(cent_bounds != NULL) { *cent_bounds = BoundBox::empty; } for(int i = range.start(); i < range.end(); ++i) { const BVHReference& ref = references[i]; BoundBox ref_bounds = compute_aligned_prim_boundbox(ref, aligned_space); bounds.grow(ref_bounds); if(cent_bounds != NULL) { cent_bounds->grow(ref_bounds.center2()); } } return bounds; } Transform BVHUnaligned::compute_node_transform( const BoundBox& bounds, const Transform& aligned_space) { Transform space = aligned_space; space.x.w -= bounds.min.x; space.y.w -= bounds.min.y; space.z.w -= bounds.min.z; float3 dim = bounds.max - bounds.min; return transform_scale(1.0f / max(1e-18f, dim.x), 1.0f / max(1e-18f, dim.y), 1.0f / max(1e-18f, dim.z)) * space; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/bvh/bvh_unaligned.h000066400000000000000000000047521334742672700221420ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_UNALIGNED_H__ #define __BVH_UNALIGNED_H__ #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class BoundBox; class BVHObjectBinning; class BVHRange; class BVHReference; struct Transform; class Object; /* Helper class to perform calculations needed for unaligned nodes. */ class BVHUnaligned { public: BVHUnaligned(const vector& objects); /* Calculate alignment for the oriented node for a given range. */ Transform compute_aligned_space( const BVHObjectBinning& range, const BVHReference *references) const; Transform compute_aligned_space( const BVHRange& range, const BVHReference *references) const; /* Calculate alignment for the oriented node for a given reference. * * Return true when space was calculated successfully. */ bool compute_aligned_space(const BVHReference& ref, Transform *aligned_space) const; /* Calculate primitive's bounding box in given space. */ BoundBox compute_aligned_prim_boundbox( const BVHReference& prim, const Transform& aligned_space) const; /* Calculate bounding box in given space. */ BoundBox compute_aligned_boundbox( const BVHObjectBinning& range, const BVHReference *references, const Transform& aligned_space, BoundBox *cent_bounds = NULL) const; BoundBox compute_aligned_boundbox( const BVHRange& range, const BVHReference *references, const Transform& aligned_space, BoundBox *cent_bounds = NULL) const; /* Calculate affine transform for node packing. * Bounds will be in the range of 0..1. */ static Transform compute_node_transform(const BoundBox& bounds, const Transform& aligned_space); protected: /* List of objects BVH is being created for. */ const vector& objects_; }; CCL_NAMESPACE_END #endif /* __BVH_UNALIGNED_H__ */ goxel-0.8.1/ext_src/cycles/src/device/000077500000000000000000000000001334742672700176345ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/device/CMakeLists.txt000066400000000000000000000025251334742672700224000ustar00rootroot00000000000000 set(INC .. ../../glew-mx ) set(INC_SYS ${GLEW_INCLUDE_DIR} ../../../extern/clew/include ) if(WITH_CUDA_DYNLOAD) list(APPEND INC ../../../extern/cuew/include ) add_definitions(-DWITH_CUDA_DYNLOAD) else() list(APPEND INC_SYS ${CUDA_TOOLKIT_INCLUDE} ) add_definitions(-DCYCLES_CUDA_NVCC_EXECUTABLE="${CUDA_NVCC_EXECUTABLE}") endif() set(SRC device.cpp device_cpu.cpp device_cuda.cpp device_denoising.cpp device_memory.cpp device_multi.cpp device_opencl.cpp device_split_kernel.cpp device_task.cpp ) set(SRC_OPENCL opencl/opencl.h opencl/memory_manager.h opencl/opencl_base.cpp opencl/opencl_mega.cpp opencl/opencl_split.cpp opencl/opencl_util.cpp opencl/memory_manager.cpp ) if(WITH_CYCLES_NETWORK) list(APPEND SRC device_network.cpp ) endif() set(SRC_HEADERS device.h device_denoising.h device_memory.h device_intern.h device_network.h device_split_kernel.h device_task.h ) add_definitions(${GL_DEFINITIONS}) if(WITH_CYCLES_NETWORK) add_definitions(-DWITH_NETWORK) endif() if(WITH_CYCLES_DEVICE_OPENCL) add_definitions(-DWITH_OPENCL) endif() if(WITH_CYCLES_DEVICE_CUDA) add_definitions(-DWITH_CUDA) endif() if(WITH_CYCLES_DEVICE_MULTI) add_definitions(-DWITH_MULTI) endif() include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) cycles_add_library(cycles_device ${SRC} ${SRC_OPENCL} ${SRC_HEADERS}) goxel-0.8.1/ext_src/cycles/src/device/device.cpp000066400000000000000000000247461334742672700216140ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include "device/device.h" #include "device/device_intern.h" #include "util/util_foreach.h" #include "util/util_half.h" #include "util/util_logging.h" #include "util/util_math.h" #include "util/util_opengl.h" #include "util/util_time.h" #include "util/util_system.h" #include "util/util_types.h" #include "util/util_vector.h" #include "util/util_string.h" CCL_NAMESPACE_BEGIN bool Device::need_types_update = true; bool Device::need_devices_update = true; thread_mutex Device::device_mutex; vector Device::types; vector Device::devices; /* Device Requested Features */ std::ostream& operator <<(std::ostream &os, const DeviceRequestedFeatures& requested_features) { os << "Experimental features: " << (requested_features.experimental ? "On" : "Off") << std::endl; os << "Max nodes group: " << requested_features.max_nodes_group << std::endl; /* TODO(sergey): Decode bitflag into list of names. */ os << "Nodes features: " << requested_features.nodes_features << std::endl; os << "Use Hair: " << string_from_bool(requested_features.use_hair) << std::endl; os << "Use Object Motion: " << string_from_bool(requested_features.use_object_motion) << std::endl; os << "Use Camera Motion: " << string_from_bool(requested_features.use_camera_motion) << std::endl; os << "Use Baking: " << string_from_bool(requested_features.use_baking) << std::endl; os << "Use Subsurface: " << string_from_bool(requested_features.use_subsurface) << std::endl; os << "Use Volume: " << string_from_bool(requested_features.use_volume) << std::endl; os << "Use Branched Integrator: " << string_from_bool(requested_features.use_integrator_branched) << std::endl; os << "Use Patch Evaluation: " << string_from_bool(requested_features.use_patch_evaluation) << std::endl; os << "Use Transparent Shadows: " << string_from_bool(requested_features.use_transparent) << std::endl; os << "Use Principled BSDF: " << string_from_bool(requested_features.use_principled) << std::endl; os << "Use Denoising: " << string_from_bool(requested_features.use_denoising) << std::endl; return os; } /* Device */ Device::~Device() { if(!background && vertex_buffer != 0) { glDeleteBuffers(1, &vertex_buffer); } } void Device::draw_pixels(device_memory& rgba, int y, int w, int h, int dx, int dy, int width, int height, bool transparent, const DeviceDrawParams &draw_params) { assert(rgba.type == MEM_PIXELS); mem_copy_from(rgba, y, w, h, rgba.memory_elements_size(1)); if(transparent) { glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); } glColor3f(1.0f, 1.0f, 1.0f); if(rgba.data_type == TYPE_HALF) { /* for multi devices, this assumes the inefficient method that we allocate * all pixels on the device even though we only render to a subset */ GLhalf *host_pointer = (GLhalf*)rgba.host_pointer; float vbuffer[16], *basep; float *vp = NULL; host_pointer += 4*y*w; /* draw half float texture, GLSL shader for display transform assumed to be bound */ GLuint texid; glGenTextures(1, &texid); glBindTexture(GL_TEXTURE_2D, texid); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, w, h, 0, GL_RGBA, GL_HALF_FLOAT, host_pointer); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glEnable(GL_TEXTURE_2D); if(draw_params.bind_display_space_shader_cb) { draw_params.bind_display_space_shader_cb(); } if(GLEW_VERSION_1_5) { if(!vertex_buffer) glGenBuffers(1, &vertex_buffer); glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); /* invalidate old contents - avoids stalling if buffer is still waiting in queue to be rendered */ glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(float), NULL, GL_STREAM_DRAW); vp = (float *)glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); basep = NULL; } else { basep = vbuffer; vp = vbuffer; } if(vp) { /* texture coordinate - vertex pair */ vp[0] = 0.0f; vp[1] = 0.0f; vp[2] = dx; vp[3] = dy; vp[4] = 1.0f; vp[5] = 0.0f; vp[6] = (float)width + dx; vp[7] = dy; vp[8] = 1.0f; vp[9] = 1.0f; vp[10] = (float)width + dx; vp[11] = (float)height + dy; vp[12] = 0.0f; vp[13] = 1.0f; vp[14] = dx; vp[15] = (float)height + dy; if(vertex_buffer) glUnmapBuffer(GL_ARRAY_BUFFER); } glTexCoordPointer(2, GL_FLOAT, 4 * sizeof(float), basep); glVertexPointer(2, GL_FLOAT, 4 * sizeof(float), ((char *)basep) + 2 * sizeof(float)); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); if(vertex_buffer) { glBindBuffer(GL_ARRAY_BUFFER, 0); } if(draw_params.unbind_display_space_shader_cb) { draw_params.unbind_display_space_shader_cb(); } glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D); glDeleteTextures(1, &texid); } else { /* fallback for old graphics cards that don't support GLSL, half float, * and non-power-of-two textures */ glPixelZoom((float)width/(float)w, (float)height/(float)h); glRasterPos2f(dx, dy); uint8_t *pixels = (uint8_t*)rgba.host_pointer; pixels += 4*y*w; glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels); glRasterPos2f(0.0f, 0.0f); glPixelZoom(1.0f, 1.0f); } if(transparent) glDisable(GL_BLEND); } Device *Device::create(DeviceInfo& info, Stats &stats, bool background) { Device *device; switch(info.type) { case DEVICE_CPU: device = device_cpu_create(info, stats, background); break; #ifdef WITH_CUDA case DEVICE_CUDA: if(device_cuda_init()) device = device_cuda_create(info, stats, background); else device = NULL; break; #endif #ifdef WITH_MULTI case DEVICE_MULTI: device = device_multi_create(info, stats, background); break; #endif #ifdef WITH_NETWORK case DEVICE_NETWORK: device = device_network_create(info, stats, "127.0.0.1"); break; #endif #ifdef WITH_OPENCL case DEVICE_OPENCL: if(device_opencl_init()) device = device_opencl_create(info, stats, background); else device = NULL; break; #endif default: return NULL; } return device; } DeviceType Device::type_from_string(const char *name) { if(strcmp(name, "CPU") == 0) return DEVICE_CPU; else if(strcmp(name, "CUDA") == 0) return DEVICE_CUDA; else if(strcmp(name, "OPENCL") == 0) return DEVICE_OPENCL; else if(strcmp(name, "NETWORK") == 0) return DEVICE_NETWORK; else if(strcmp(name, "MULTI") == 0) return DEVICE_MULTI; return DEVICE_NONE; } string Device::string_from_type(DeviceType type) { if(type == DEVICE_CPU) return "CPU"; else if(type == DEVICE_CUDA) return "CUDA"; else if(type == DEVICE_OPENCL) return "OPENCL"; else if(type == DEVICE_NETWORK) return "NETWORK"; else if(type == DEVICE_MULTI) return "MULTI"; return ""; } vector& Device::available_types() { thread_scoped_lock lock(device_mutex); if(need_types_update) { types.clear(); types.push_back(DEVICE_CPU); #ifdef WITH_CUDA if(device_cuda_init()) { types.push_back(DEVICE_CUDA); } #endif #ifdef WITH_OPENCL if(device_opencl_init()) { types.push_back(DEVICE_OPENCL); } #endif #ifdef WITH_NETWORK types.push_back(DEVICE_NETWORK); #endif need_types_update = false; } return types; } vector& Device::available_devices() { thread_scoped_lock lock(device_mutex); if(need_devices_update) { devices.clear(); #ifdef WITH_OPENCL if(device_opencl_init()) { device_opencl_info(devices); } #endif #ifdef WITH_CUDA if(device_cuda_init()) { device_cuda_info(devices); } #endif device_cpu_info(devices); #ifdef WITH_NETWORK device_network_info(devices); #endif need_devices_update = false; } return devices; } string Device::device_capabilities() { string capabilities = "CPU device capabilities: "; capabilities += device_cpu_capabilities() + "\n"; #ifdef WITH_OPENCL if(device_opencl_init()) { capabilities += "\nOpenCL device capabilities:\n"; capabilities += device_opencl_capabilities(); } #endif #ifdef WITH_CUDA if(device_cuda_init()) { capabilities += "\nCUDA device capabilities:\n"; capabilities += device_cuda_capabilities(); } #endif return capabilities; } DeviceInfo Device::get_multi_device(const vector& subdevices, int threads, bool background) { assert(subdevices.size() > 1); DeviceInfo info; info.type = DEVICE_MULTI; info.id = "MULTI"; info.description = "Multi Device"; info.num = 0; info.has_half_images = true; info.has_volume_decoupled = true; info.bvh_layout_mask = BVH_LAYOUT_ALL; info.has_osl = true; foreach(const DeviceInfo &device, subdevices) { /* Ensure CPU device does not slow down GPU. */ if(device.type == DEVICE_CPU && subdevices.size() > 1) { if(background) { int orig_cpu_threads = (threads)? threads: system_cpu_thread_count(); int cpu_threads = max(orig_cpu_threads - (subdevices.size() - 1), 0); VLOG(1) << "CPU render threads reduced from " << orig_cpu_threads << " to " << cpu_threads << ", to dedicate to GPU."; if(cpu_threads >= 1) { DeviceInfo cpu_device = device; cpu_device.cpu_threads = cpu_threads; info.multi_devices.push_back(cpu_device); } else { continue; } } else { VLOG(1) << "CPU render threads disabled for interactive render."; continue; } } else { info.multi_devices.push_back(device); } /* Accumulate device info. */ info.has_half_images &= device.has_half_images; info.has_volume_decoupled &= device.has_volume_decoupled; info.bvh_layout_mask = device.bvh_layout_mask & info.bvh_layout_mask; info.has_osl &= device.has_osl; } return info; } void Device::tag_update() { need_types_update = true; need_devices_update = true; } void Device::free_memory() { need_types_update = true; need_devices_update = true; types.free_memory(); devices.free_memory(); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device.h000066400000000000000000000245371334742672700212570ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEVICE_H__ #define __DEVICE_H__ #include #include "bvh/bvh_params.h" #include "device/device_memory.h" #include "device/device_task.h" #include "util/util_list.h" #include "util/util_stats.h" #include "util/util_string.h" #include "util/util_thread.h" #include "util/util_texture.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Progress; class RenderTile; /* Device Types */ enum DeviceType { DEVICE_NONE, DEVICE_CPU, DEVICE_OPENCL, DEVICE_CUDA, DEVICE_NETWORK, DEVICE_MULTI }; class DeviceInfo { public: DeviceType type; string description; string id; /* used for user preferences, should stay fixed with changing hardware config */ int num; bool display_device; /* GPU is used as a display device. */ bool advanced_shading; /* Supports full shading system. */ bool has_half_images; /* Support half-float textures. */ bool has_volume_decoupled; /* Decoupled volume shading. */ BVHLayoutMask bvh_layout_mask; /* Bitmask of supported BVH layouts. */ bool has_osl; /* Support Open Shading Language. */ bool use_split_kernel; /* Use split or mega kernel. */ int cpu_threads; vector multi_devices; DeviceInfo() { type = DEVICE_CPU; id = "CPU"; num = 0; cpu_threads = 0; display_device = false; advanced_shading = true; has_half_images = false; has_volume_decoupled = false; bvh_layout_mask = BVH_LAYOUT_NONE; has_osl = false; use_split_kernel = false; } bool operator==(const DeviceInfo &info) { /* Multiple Devices with the same ID would be very bad. */ assert(id != info.id || (type == info.type && num == info.num && description == info.description)); return id == info.id; } }; class DeviceRequestedFeatures { public: /* Use experimental feature set. */ bool experimental; /* Selective nodes compilation. */ /* Identifier of a node group up to which all the nodes needs to be * compiled in. Nodes from higher group indices will be ignores. */ int max_nodes_group; /* Features bitfield indicating which features from the requested group * will be compiled in. Nodes which corresponds to features which are not * in this bitfield will be ignored even if they're in the requested group. */ int nodes_features; /* BVH/sampling kernel features. */ bool use_hair; bool use_object_motion; bool use_camera_motion; /* Denotes whether baking functionality is needed. */ bool use_baking; /* Use subsurface scattering materials. */ bool use_subsurface; /* Use volume materials. */ bool use_volume; /* Use branched integrator. */ bool use_integrator_branched; /* Use OpenSubdiv patch evaluation */ bool use_patch_evaluation; /* Use Transparent shadows */ bool use_transparent; /* Use various shadow tricks, such as shadow catcher. */ bool use_shadow_tricks; /* Per-uber shader usage flags. */ bool use_principled; /* Denoising features. */ bool use_denoising; /* Use raytracing in shaders. */ bool use_shader_raytrace; DeviceRequestedFeatures() { /* TODO(sergey): Find more meaningful defaults. */ experimental = false; max_nodes_group = 0; nodes_features = 0; use_hair = false; use_object_motion = false; use_camera_motion = false; use_baking = false; use_subsurface = false; use_volume = false; use_integrator_branched = false; use_patch_evaluation = false; use_transparent = false; use_shadow_tricks = false; use_principled = false; use_denoising = false; use_shader_raytrace = false; } bool modified(const DeviceRequestedFeatures& requested_features) { return !(experimental == requested_features.experimental && max_nodes_group == requested_features.max_nodes_group && nodes_features == requested_features.nodes_features && use_hair == requested_features.use_hair && use_object_motion == requested_features.use_object_motion && use_camera_motion == requested_features.use_camera_motion && use_baking == requested_features.use_baking && use_subsurface == requested_features.use_subsurface && use_volume == requested_features.use_volume && use_integrator_branched == requested_features.use_integrator_branched && use_patch_evaluation == requested_features.use_patch_evaluation && use_transparent == requested_features.use_transparent && use_shadow_tricks == requested_features.use_shadow_tricks && use_principled == requested_features.use_principled && use_denoising == requested_features.use_denoising && use_shader_raytrace == requested_features.use_shader_raytrace); } /* Convert the requested features structure to a build options, * which could then be passed to compilers. */ string get_build_options(void) const { string build_options = ""; if(experimental) { build_options += "-D__KERNEL_EXPERIMENTAL__ "; } build_options += "-D__NODES_MAX_GROUP__=" + string_printf("%d", max_nodes_group); build_options += " -D__NODES_FEATURES__=" + string_printf("%d", nodes_features); if(!use_hair) { build_options += " -D__NO_HAIR__"; } if(!use_object_motion) { build_options += " -D__NO_OBJECT_MOTION__"; } if(!use_camera_motion) { build_options += " -D__NO_CAMERA_MOTION__"; } if(!use_baking) { build_options += " -D__NO_BAKING__"; } if(!use_volume) { build_options += " -D__NO_VOLUME__"; } if(!use_subsurface) { build_options += " -D__NO_SUBSURFACE__"; } if(!use_integrator_branched) { build_options += " -D__NO_BRANCHED_PATH__"; } if(!use_patch_evaluation) { build_options += " -D__NO_PATCH_EVAL__"; } if(!use_transparent && !use_volume) { build_options += " -D__NO_TRANSPARENT__"; } if(!use_shadow_tricks) { build_options += " -D__NO_SHADOW_TRICKS__"; } if(!use_principled) { build_options += " -D__NO_PRINCIPLED__"; } if(!use_denoising) { build_options += " -D__NO_DENOISING__"; } if(!use_shader_raytrace) { build_options += " -D__NO_SHADER_RAYTRACE__"; } return build_options; } }; std::ostream& operator <<(std::ostream &os, const DeviceRequestedFeatures& requested_features); /* Device */ struct DeviceDrawParams { function bind_display_space_shader_cb; function unbind_display_space_shader_cb; }; class Device { friend class device_sub_ptr; protected: Device(DeviceInfo& info_, Stats &stats_, bool background) : background(background), vertex_buffer(0), info(info_), stats(stats_) {} bool background; string error_msg; /* used for real time display */ unsigned int vertex_buffer; virtual device_ptr mem_alloc_sub_ptr(device_memory& /*mem*/, int /*offset*/, int /*size*/) { /* Only required for devices that implement denoising. */ assert(false); return (device_ptr) 0; } virtual void mem_free_sub_ptr(device_ptr /*ptr*/) {}; public: virtual ~Device(); /* info */ DeviceInfo info; virtual const string& error_message() { return error_msg; } bool have_error() { return !error_message().empty(); } virtual void set_error(const string& error) { if(!have_error()) { error_msg = error; } fprintf(stderr, "%s\n", error.c_str()); fflush(stderr); } virtual bool show_samples() const { return false; } /* statistics */ Stats &stats; /* memory alignment */ virtual int mem_sub_ptr_alignment() { return MIN_ALIGNMENT_CPU_DATA_TYPES; } /* constant memory */ virtual void const_copy_to(const char *name, void *host, size_t size) = 0; /* open shading language, only for CPU device */ virtual void *osl_memory() { return NULL; } /* load/compile kernels, must be called before adding tasks */ virtual bool load_kernels( const DeviceRequestedFeatures& /*requested_features*/) { return true; } /* tasks */ virtual int get_split_task_count(DeviceTask& task) = 0; virtual void task_add(DeviceTask& task) = 0; virtual void task_wait() = 0; virtual void task_cancel() = 0; /* opengl drawing */ virtual void draw_pixels(device_memory& mem, int y, int w, int h, int dx, int dy, int width, int height, bool transparent, const DeviceDrawParams &draw_params); #ifdef WITH_NETWORK /* networking */ void server_run(); #endif /* multi device */ virtual void map_tile(Device * /*sub_device*/, RenderTile& /*tile*/) {} virtual int device_number(Device * /*sub_device*/) { return 0; } virtual void map_neighbor_tiles(Device * /*sub_device*/, RenderTile * /*tiles*/) {} virtual void unmap_neighbor_tiles(Device * /*sub_device*/, RenderTile * /*tiles*/) {} /* static */ static Device *create(DeviceInfo& info, Stats &stats, bool background = true); static DeviceType type_from_string(const char *name); static string string_from_type(DeviceType type); static vector& available_types(); static vector& available_devices(); static string device_capabilities(); static DeviceInfo get_multi_device(const vector& subdevices, int threads, bool background); /* Tag devices lists for update. */ static void tag_update(); static void free_memory(); protected: /* Memory allocation, only accessed through device_memory. */ friend class MultiDevice; friend class DeviceServer; friend class device_memory; virtual void mem_alloc(device_memory& mem) = 0; virtual void mem_copy_to(device_memory& mem) = 0; virtual void mem_copy_from(device_memory& mem, int y, int w, int h, int elem) = 0; virtual void mem_zero(device_memory& mem) = 0; virtual void mem_free(device_memory& mem) = 0; private: /* Indicted whether device types and devices lists were initialized. */ static bool need_types_update, need_devices_update; static thread_mutex device_mutex; static vector types; static vector devices; }; CCL_NAMESPACE_END #endif /* __DEVICE_H__ */ goxel-0.8.1/ext_src/cycles/src/device/device_cpu.cpp000066400000000000000000001060441334742672700224530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include /* So ImathMath is included before our kernel_cpu_compat. */ #ifdef WITH_OSL /* So no context pollution happens from indirectly included windows.h */ # include "util/util_windows.h" # include #endif #include "device/device.h" #include "device/device_denoising.h" #include "device/device_intern.h" #include "device/device_split_kernel.h" #include "kernel/kernel.h" #include "kernel/kernel_compat_cpu.h" #include "kernel/kernel_types.h" #include "kernel/split/kernel_split_data.h" #include "kernel/kernel_globals.h" #include "kernel/filter/filter.h" #include "kernel/osl/osl_shader.h" #include "kernel/osl/osl_globals.h" #include "render/buffers.h" #include "util/util_debug.h" #include "util/util_foreach.h" #include "util/util_function.h" #include "util/util_logging.h" #include "util/util_map.h" #include "util/util_opengl.h" #include "util/util_optimization.h" #include "util/util_progress.h" #include "util/util_system.h" #include "util/util_thread.h" CCL_NAMESPACE_BEGIN class CPUDevice; /* Has to be outside of the class to be shared across template instantiations. */ static const char *logged_architecture = ""; template class KernelFunctions { public: KernelFunctions() { kernel = (F)NULL; } KernelFunctions(F kernel_default, F kernel_sse2, F kernel_sse3, F kernel_sse41, F kernel_avx, F kernel_avx2) { const char *architecture_name = "default"; kernel = kernel_default; /* Silence potential warnings about unused variables * when compiling without some architectures. */ (void)kernel_sse2; (void)kernel_sse3; (void)kernel_sse41; (void)kernel_avx; (void)kernel_avx2; #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 if(DebugFlags().cpu.has_avx2() && system_cpu_support_avx2()) { architecture_name = "AVX2"; kernel = kernel_avx2; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX if(DebugFlags().cpu.has_avx() && system_cpu_support_avx()) { architecture_name = "AVX"; kernel = kernel_avx; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 if(DebugFlags().cpu.has_sse41() && system_cpu_support_sse41()) { architecture_name = "SSE4.1"; kernel = kernel_sse41; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 if(DebugFlags().cpu.has_sse3() && system_cpu_support_sse3()) { architecture_name = "SSE3"; kernel = kernel_sse3; } else #endif #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 if(DebugFlags().cpu.has_sse2() && system_cpu_support_sse2()) { architecture_name = "SSE2"; kernel = kernel_sse2; } #endif if(strcmp(architecture_name, logged_architecture) != 0) { VLOG(1) << "Will be using " << architecture_name << " kernels."; logged_architecture = architecture_name; } } inline F operator()() const { assert(kernel); return kernel; } protected: F kernel; }; class CPUSplitKernel : public DeviceSplitKernel { CPUDevice *device; public: explicit CPUSplitKernel(CPUDevice *device); virtual bool enqueue_split_kernel_data_init(const KernelDimensions& dim, RenderTile& rtile, int num_global_elements, device_memory& kernel_globals, device_memory& kernel_data_, device_memory& split_data, device_memory& ray_state, device_memory& queue_index, device_memory& use_queues_flag, device_memory& work_pool_wgs); virtual SplitKernelFunction* get_split_kernel_function(const string& kernel_name, const DeviceRequestedFeatures&); virtual int2 split_kernel_local_size(); virtual int2 split_kernel_global_size(device_memory& kg, device_memory& data, DeviceTask *task); virtual uint64_t state_buffer_size(device_memory& kg, device_memory& data, size_t num_threads); }; class CPUDevice : public Device { public: TaskPool task_pool; KernelGlobals kernel_globals; device_vector texture_info; bool need_texture_info; #ifdef WITH_OSL OSLGlobals osl_globals; #endif bool use_split_kernel; DeviceRequestedFeatures requested_features; KernelFunctions path_trace_kernel; KernelFunctions convert_to_half_float_kernel; KernelFunctions convert_to_byte_kernel; KernelFunctions shader_kernel; KernelFunctions filter_divide_shadow_kernel; KernelFunctions filter_get_feature_kernel; KernelFunctions filter_detect_outliers_kernel; KernelFunctions filter_combine_halves_kernel; KernelFunctions filter_nlm_calc_difference_kernel; KernelFunctions filter_nlm_blur_kernel; KernelFunctions filter_nlm_calc_weight_kernel; KernelFunctions filter_nlm_update_output_kernel; KernelFunctions filter_nlm_normalize_kernel; KernelFunctions filter_construct_transform_kernel; KernelFunctions filter_nlm_construct_gramian_kernel; KernelFunctions filter_finalize_kernel; KernelFunctions data_init_kernel; unordered_map > split_kernels; #define KERNEL_FUNCTIONS(name) \ KERNEL_NAME_EVAL(cpu, name), \ KERNEL_NAME_EVAL(cpu_sse2, name), \ KERNEL_NAME_EVAL(cpu_sse3, name), \ KERNEL_NAME_EVAL(cpu_sse41, name), \ KERNEL_NAME_EVAL(cpu_avx, name), \ KERNEL_NAME_EVAL(cpu_avx2, name) CPUDevice(DeviceInfo& info_, Stats &stats_, bool background_) : Device(info_, stats_, background_), texture_info(this, "__texture_info", MEM_TEXTURE), #define REGISTER_KERNEL(name) name ## _kernel(KERNEL_FUNCTIONS(name)) REGISTER_KERNEL(path_trace), REGISTER_KERNEL(convert_to_half_float), REGISTER_KERNEL(convert_to_byte), REGISTER_KERNEL(shader), REGISTER_KERNEL(filter_divide_shadow), REGISTER_KERNEL(filter_get_feature), REGISTER_KERNEL(filter_detect_outliers), REGISTER_KERNEL(filter_combine_halves), REGISTER_KERNEL(filter_nlm_calc_difference), REGISTER_KERNEL(filter_nlm_blur), REGISTER_KERNEL(filter_nlm_calc_weight), REGISTER_KERNEL(filter_nlm_update_output), REGISTER_KERNEL(filter_nlm_normalize), REGISTER_KERNEL(filter_construct_transform), REGISTER_KERNEL(filter_nlm_construct_gramian), REGISTER_KERNEL(filter_finalize), REGISTER_KERNEL(data_init) #undef REGISTER_KERNEL { if(info.cpu_threads == 0) { info.cpu_threads = TaskScheduler::num_threads(); } #ifdef WITH_OSL kernel_globals.osl = &osl_globals; #endif use_split_kernel = DebugFlags().cpu.split_kernel; if(use_split_kernel) { VLOG(1) << "Will be using split kernel."; } need_texture_info = false; #define REGISTER_SPLIT_KERNEL(name) split_kernels[#name] = KernelFunctions(KERNEL_FUNCTIONS(name)) REGISTER_SPLIT_KERNEL(path_init); REGISTER_SPLIT_KERNEL(scene_intersect); REGISTER_SPLIT_KERNEL(lamp_emission); REGISTER_SPLIT_KERNEL(do_volume); REGISTER_SPLIT_KERNEL(queue_enqueue); REGISTER_SPLIT_KERNEL(indirect_background); REGISTER_SPLIT_KERNEL(shader_setup); REGISTER_SPLIT_KERNEL(shader_sort); REGISTER_SPLIT_KERNEL(shader_eval); REGISTER_SPLIT_KERNEL(holdout_emission_blurring_pathtermination_ao); REGISTER_SPLIT_KERNEL(subsurface_scatter); REGISTER_SPLIT_KERNEL(direct_lighting); REGISTER_SPLIT_KERNEL(shadow_blocked_ao); REGISTER_SPLIT_KERNEL(shadow_blocked_dl); REGISTER_SPLIT_KERNEL(enqueue_inactive); REGISTER_SPLIT_KERNEL(next_iteration_setup); REGISTER_SPLIT_KERNEL(indirect_subsurface); REGISTER_SPLIT_KERNEL(buffer_update); #undef REGISTER_SPLIT_KERNEL #undef KERNEL_FUNCTIONS } ~CPUDevice() { task_pool.stop(); texture_info.free(); } virtual bool show_samples() const { return (info.cpu_threads == 1); } void load_texture_info() { if(need_texture_info) { texture_info.copy_to_device(); need_texture_info = false; } } void mem_alloc(device_memory& mem) { if(mem.type == MEM_TEXTURE) { assert(!"mem_alloc not supported for textures."); } else { if(mem.name) { VLOG(1) << "Buffer allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; } if(mem.type == MEM_DEVICE_ONLY) { assert(!mem.host_pointer); size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES; void *data = util_aligned_malloc(mem.memory_size(), alignment); mem.device_pointer = (device_ptr)data; } else { mem.device_pointer = (device_ptr)mem.host_pointer; } mem.device_size = mem.memory_size(); stats.mem_alloc(mem.device_size); } } void mem_copy_to(device_memory& mem) { if(mem.type == MEM_TEXTURE) { tex_free(mem); tex_alloc(mem); } else if(mem.type == MEM_PIXELS) { assert(!"mem_copy_to not supported for pixels."); } else { if(!mem.device_pointer) { mem_alloc(mem); } /* copy is no-op */ } } void mem_copy_from(device_memory& /*mem*/, int /*y*/, int /*w*/, int /*h*/, int /*elem*/) { /* no-op */ } void mem_zero(device_memory& mem) { if(!mem.device_pointer) { mem_alloc(mem); } if(mem.device_pointer) { memset((void*)mem.device_pointer, 0, mem.memory_size()); } } void mem_free(device_memory& mem) { if(mem.type == MEM_TEXTURE) { tex_free(mem); } else if(mem.device_pointer) { if(mem.type == MEM_DEVICE_ONLY) { util_aligned_free((void*)mem.device_pointer); } mem.device_pointer = 0; stats.mem_free(mem.device_size); mem.device_size = 0; } } virtual device_ptr mem_alloc_sub_ptr(device_memory& mem, int offset, int /*size*/) { return (device_ptr) (((char*) mem.device_pointer) + mem.memory_elements_size(offset)); } void const_copy_to(const char *name, void *host, size_t size) { kernel_const_copy(&kernel_globals, name, host, size); } void tex_alloc(device_memory& mem) { VLOG(1) << "Texture allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; if(mem.interpolation == INTERPOLATION_NONE) { /* Data texture. */ kernel_tex_copy(&kernel_globals, mem.name, mem.host_pointer, mem.data_size); } else { /* Image Texture. */ int flat_slot = 0; if(string_startswith(mem.name, "__tex_image")) { int pos = string(mem.name).rfind("_"); flat_slot = atoi(mem.name + pos + 1); } else { assert(0); } if(flat_slot >= texture_info.size()) { /* Allocate some slots in advance, to reduce amount * of re-allocations. */ texture_info.resize(flat_slot + 128); } TextureInfo& info = texture_info[flat_slot]; info.data = (uint64_t)mem.host_pointer; info.cl_buffer = 0; info.interpolation = mem.interpolation; info.extension = mem.extension; info.width = mem.data_width; info.height = mem.data_height; info.depth = mem.data_depth; need_texture_info = true; } mem.device_pointer = (device_ptr)mem.host_pointer; mem.device_size = mem.memory_size(); stats.mem_alloc(mem.device_size); } void tex_free(device_memory& mem) { if(mem.device_pointer) { mem.device_pointer = 0; stats.mem_free(mem.device_size); mem.device_size = 0; need_texture_info = true; } } void *osl_memory() { #ifdef WITH_OSL return &osl_globals; #else return NULL; #endif } void thread_run(DeviceTask *task) { if(task->type == DeviceTask::RENDER) { thread_render(*task); } else if(task->type == DeviceTask::FILM_CONVERT) thread_film_convert(*task); else if(task->type == DeviceTask::SHADER) thread_shader(*task); } class CPUDeviceTask : public DeviceTask { public: CPUDeviceTask(CPUDevice *device, DeviceTask& task) : DeviceTask(task) { run = function_bind(&CPUDevice::thread_run, device, this); } }; bool denoising_set_tiles(device_ptr *buffers, DenoisingTask *task) { TilesInfo *tiles = (TilesInfo*) task->tiles_mem.host_pointer; for(int i = 0; i < 9; i++) { tiles->buffers[i] = buffers[i]; } task->tiles_mem.copy_to_device(); return true; } bool denoising_non_local_means(device_ptr image_ptr, device_ptr guide_ptr, device_ptr variance_ptr, device_ptr out_ptr, DenoisingTask *task) { int4 rect = task->rect; int r = task->nlm_state.r; int f = task->nlm_state.f; float a = task->nlm_state.a; float k_2 = task->nlm_state.k_2; int w = align_up(rect.z-rect.x, 4); int h = rect.w-rect.y; float *blurDifference = (float*) task->nlm_state.temporary_1_ptr; float *difference = (float*) task->nlm_state.temporary_2_ptr; float *weightAccum = (float*) task->nlm_state.temporary_3_ptr; memset(weightAccum, 0, sizeof(float)*w*h); memset((float*) out_ptr, 0, sizeof(float)*w*h); for(int i = 0; i < (2*r+1)*(2*r+1); i++) { int dy = i / (2*r+1) - r; int dx = i % (2*r+1) - r; int local_rect[4] = {max(0, -dx), max(0, -dy), rect.z-rect.x - max(0, dx), rect.w-rect.y - max(0, dy)}; filter_nlm_calc_difference_kernel()(dx, dy, (float*) guide_ptr, (float*) variance_ptr, difference, local_rect, w, 0, a, k_2); filter_nlm_blur_kernel() (difference, blurDifference, local_rect, w, f); filter_nlm_calc_weight_kernel()(blurDifference, difference, local_rect, w, f); filter_nlm_blur_kernel() (difference, blurDifference, local_rect, w, f); filter_nlm_update_output_kernel()(dx, dy, blurDifference, (float*) image_ptr, (float*) out_ptr, weightAccum, local_rect, w, f); } int local_rect[4] = {0, 0, rect.z-rect.x, rect.w-rect.y}; filter_nlm_normalize_kernel()((float*) out_ptr, weightAccum, local_rect, w); return true; } bool denoising_construct_transform(DenoisingTask *task) { for(int y = 0; y < task->filter_area.w; y++) { for(int x = 0; x < task->filter_area.z; x++) { filter_construct_transform_kernel()((float*) task->buffer.mem.device_pointer, x + task->filter_area.x, y + task->filter_area.y, y*task->filter_area.z + x, (float*) task->storage.transform.device_pointer, (int*) task->storage.rank.device_pointer, &task->rect.x, task->buffer.pass_stride, task->radius, task->pca_threshold); } } return true; } bool denoising_reconstruct(device_ptr color_ptr, device_ptr color_variance_ptr, device_ptr output_ptr, DenoisingTask *task) { mem_zero(task->storage.XtWX); mem_zero(task->storage.XtWY); float *difference = (float*) task->reconstruction_state.temporary_1_ptr; float *blurDifference = (float*) task->reconstruction_state.temporary_2_ptr; int r = task->radius; for(int i = 0; i < (2*r+1)*(2*r+1); i++) { int dy = i / (2*r+1) - r; int dx = i % (2*r+1) - r; int local_rect[4] = {max(0, -dx), max(0, -dy), task->reconstruction_state.source_w - max(0, dx), task->reconstruction_state.source_h - max(0, dy)}; filter_nlm_calc_difference_kernel()(dx, dy, (float*) color_ptr, (float*) color_variance_ptr, difference, local_rect, task->buffer.stride, task->buffer.pass_stride, 1.0f, task->nlm_k_2); filter_nlm_blur_kernel()(difference, blurDifference, local_rect, task->buffer.stride, 4); filter_nlm_calc_weight_kernel()(blurDifference, difference, local_rect, task->buffer.stride, 4); filter_nlm_blur_kernel()(difference, blurDifference, local_rect, task->buffer.stride, 4); filter_nlm_construct_gramian_kernel()(dx, dy, blurDifference, (float*) task->buffer.mem.device_pointer, (float*) task->storage.transform.device_pointer, (int*) task->storage.rank.device_pointer, (float*) task->storage.XtWX.device_pointer, (float3*) task->storage.XtWY.device_pointer, local_rect, &task->reconstruction_state.filter_window.x, task->buffer.stride, 4, task->buffer.pass_stride); } for(int y = 0; y < task->filter_area.w; y++) { for(int x = 0; x < task->filter_area.z; x++) { filter_finalize_kernel()(x, y, y*task->filter_area.z + x, (float*) output_ptr, (int*) task->storage.rank.device_pointer, (float*) task->storage.XtWX.device_pointer, (float3*) task->storage.XtWY.device_pointer, &task->reconstruction_state.buffer_params.x, task->render_buffer.samples); } } return true; } bool denoising_combine_halves(device_ptr a_ptr, device_ptr b_ptr, device_ptr mean_ptr, device_ptr variance_ptr, int r, int4 rect, DenoisingTask * /*task*/) { for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x; x < rect.z; x++) { filter_combine_halves_kernel()(x, y, (float*) mean_ptr, (float*) variance_ptr, (float*) a_ptr, (float*) b_ptr, &rect.x, r); } } return true; } bool denoising_divide_shadow(device_ptr a_ptr, device_ptr b_ptr, device_ptr sample_variance_ptr, device_ptr sv_variance_ptr, device_ptr buffer_variance_ptr, DenoisingTask *task) { for(int y = task->rect.y; y < task->rect.w; y++) { for(int x = task->rect.x; x < task->rect.z; x++) { filter_divide_shadow_kernel()(task->render_buffer.samples, task->tiles, x, y, (float*) a_ptr, (float*) b_ptr, (float*) sample_variance_ptr, (float*) sv_variance_ptr, (float*) buffer_variance_ptr, &task->rect.x, task->render_buffer.pass_stride, task->render_buffer.denoising_data_offset); } } return true; } bool denoising_get_feature(int mean_offset, int variance_offset, device_ptr mean_ptr, device_ptr variance_ptr, DenoisingTask *task) { for(int y = task->rect.y; y < task->rect.w; y++) { for(int x = task->rect.x; x < task->rect.z; x++) { filter_get_feature_kernel()(task->render_buffer.samples, task->tiles, mean_offset, variance_offset, x, y, (float*) mean_ptr, (float*) variance_ptr, &task->rect.x, task->render_buffer.pass_stride, task->render_buffer.denoising_data_offset); } } return true; } bool denoising_detect_outliers(device_ptr image_ptr, device_ptr variance_ptr, device_ptr depth_ptr, device_ptr output_ptr, DenoisingTask *task) { for(int y = task->rect.y; y < task->rect.w; y++) { for(int x = task->rect.x; x < task->rect.z; x++) { filter_detect_outliers_kernel()(x, y, (float*) image_ptr, (float*) variance_ptr, (float*) depth_ptr, (float*) output_ptr, &task->rect.x, task->buffer.pass_stride); } } return true; } void path_trace(DeviceTask &task, RenderTile &tile, KernelGlobals *kg) { scoped_timer timer(&tile.buffers->render_time); float *render_buffer = (float*)tile.buffer; int start_sample = tile.start_sample; int end_sample = tile.start_sample + tile.num_samples; for(int sample = start_sample; sample < end_sample; sample++) { if(task.get_cancel() || task_pool.canceled()) { if(task.need_finish_queue == false) break; } for(int y = tile.y; y < tile.y + tile.h; y++) { for(int x = tile.x; x < tile.x + tile.w; x++) { path_trace_kernel()(kg, render_buffer, sample, x, y, tile.offset, tile.stride); } } tile.sample = sample + 1; task.update_progress(&tile, tile.w*tile.h); } } void denoise(DeviceTask &task, DenoisingTask& denoising, RenderTile &tile) { tile.sample = tile.start_sample + tile.num_samples; denoising.functions.construct_transform = function_bind(&CPUDevice::denoising_construct_transform, this, &denoising); denoising.functions.reconstruct = function_bind(&CPUDevice::denoising_reconstruct, this, _1, _2, _3, &denoising); denoising.functions.divide_shadow = function_bind(&CPUDevice::denoising_divide_shadow, this, _1, _2, _3, _4, _5, &denoising); denoising.functions.non_local_means = function_bind(&CPUDevice::denoising_non_local_means, this, _1, _2, _3, _4, &denoising); denoising.functions.combine_halves = function_bind(&CPUDevice::denoising_combine_halves, this, _1, _2, _3, _4, _5, _6, &denoising); denoising.functions.get_feature = function_bind(&CPUDevice::denoising_get_feature, this, _1, _2, _3, _4, &denoising); denoising.functions.detect_outliers = function_bind(&CPUDevice::denoising_detect_outliers, this, _1, _2, _3, _4, &denoising); denoising.functions.set_tiles = function_bind(&CPUDevice::denoising_set_tiles, this, _1, &denoising); denoising.filter_area = make_int4(tile.x, tile.y, tile.w, tile.h); denoising.render_buffer.samples = tile.sample; RenderTile rtiles[9]; rtiles[4] = tile; task.map_neighbor_tiles(rtiles, this); denoising.tiles_from_rendertiles(rtiles); denoising.init_from_devicetask(task); denoising.run_denoising(); task.unmap_neighbor_tiles(rtiles, this); task.update_progress(&tile, tile.w*tile.h); } void thread_render(DeviceTask& task) { if(task_pool.canceled()) { if(task.need_finish_queue == false) return; } /* allocate buffer for kernel globals */ device_only_memory kgbuffer(this, "kernel_globals"); kgbuffer.alloc_to_device(1); KernelGlobals *kg = new ((void*) kgbuffer.device_pointer) KernelGlobals(thread_kernel_globals_init()); CPUSplitKernel *split_kernel = NULL; if(use_split_kernel) { split_kernel = new CPUSplitKernel(this); if(!split_kernel->load_kernels(requested_features)) { thread_kernel_globals_free((KernelGlobals*)kgbuffer.device_pointer); kgbuffer.free(); delete split_kernel; return; } } RenderTile tile; DenoisingTask denoising(this); while(task.acquire_tile(this, tile)) { if(tile.task == RenderTile::PATH_TRACE) { if(use_split_kernel) { device_only_memory void_buffer(this, "void_buffer"); split_kernel->path_trace(&task, tile, kgbuffer, void_buffer); } else { path_trace(task, tile, kg); } } else if(tile.task == RenderTile::DENOISE) { denoise(task, denoising, tile); } task.release_tile(tile); if(task_pool.canceled()) { if(task.need_finish_queue == false) break; } } thread_kernel_globals_free((KernelGlobals*)kgbuffer.device_pointer); kg->~KernelGlobals(); kgbuffer.free(); delete split_kernel; } void thread_film_convert(DeviceTask& task) { float sample_scale = 1.0f/(task.sample + 1); if(task.rgba_half) { for(int y = task.y; y < task.y + task.h; y++) for(int x = task.x; x < task.x + task.w; x++) convert_to_half_float_kernel()(&kernel_globals, (uchar4*)task.rgba_half, (float*)task.buffer, sample_scale, x, y, task.offset, task.stride); } else { for(int y = task.y; y < task.y + task.h; y++) for(int x = task.x; x < task.x + task.w; x++) convert_to_byte_kernel()(&kernel_globals, (uchar4*)task.rgba_byte, (float*)task.buffer, sample_scale, x, y, task.offset, task.stride); } } void thread_shader(DeviceTask& task) { KernelGlobals kg = kernel_globals; #ifdef WITH_OSL OSLShader::thread_init(&kg, &kernel_globals, &osl_globals); #endif for(int sample = 0; sample < task.num_samples; sample++) { for(int x = task.shader_x; x < task.shader_x + task.shader_w; x++) shader_kernel()(&kg, (uint4*)task.shader_input, (float4*)task.shader_output, task.shader_eval_type, task.shader_filter, x, task.offset, sample); if(task.get_cancel() || task_pool.canceled()) break; task.update_progress(NULL); } #ifdef WITH_OSL OSLShader::thread_free(&kg); #endif } int get_split_task_count(DeviceTask& task) { if(task.type == DeviceTask::SHADER) return task.get_subtask_count(info.cpu_threads, 256); else return task.get_subtask_count(info.cpu_threads); } void task_add(DeviceTask& task) { /* Load texture info. */ load_texture_info(); /* split task into smaller ones */ list tasks; if(task.type == DeviceTask::SHADER) task.split(tasks, info.cpu_threads, 256); else task.split(tasks, info.cpu_threads); foreach(DeviceTask& task, tasks) task_pool.push(new CPUDeviceTask(this, task)); } void task_wait() { task_pool.wait_work(); } void task_cancel() { task_pool.cancel(); } protected: inline KernelGlobals thread_kernel_globals_init() { KernelGlobals kg = kernel_globals; kg.transparent_shadow_intersections = NULL; const int decoupled_count = sizeof(kg.decoupled_volume_steps) / sizeof(*kg.decoupled_volume_steps); for(int i = 0; i < decoupled_count; ++i) { kg.decoupled_volume_steps[i] = NULL; } kg.decoupled_volume_steps_index = 0; #ifdef WITH_OSL OSLShader::thread_init(&kg, &kernel_globals, &osl_globals); #endif return kg; } inline void thread_kernel_globals_free(KernelGlobals *kg) { if(kg == NULL) { return; } if(kg->transparent_shadow_intersections != NULL) { free(kg->transparent_shadow_intersections); } const int decoupled_count = sizeof(kg->decoupled_volume_steps) / sizeof(*kg->decoupled_volume_steps); for(int i = 0; i < decoupled_count; ++i) { if(kg->decoupled_volume_steps[i] != NULL) { free(kg->decoupled_volume_steps[i]); } } #ifdef WITH_OSL OSLShader::thread_free(kg); #endif } virtual bool load_kernels(const DeviceRequestedFeatures& requested_features_) { requested_features = requested_features_; return true; } }; /* split kernel */ class CPUSplitKernelFunction : public SplitKernelFunction { public: CPUDevice* device; void (*func)(KernelGlobals *kg, KernelData *data); CPUSplitKernelFunction(CPUDevice* device) : device(device), func(NULL) {} ~CPUSplitKernelFunction() {} virtual bool enqueue(const KernelDimensions& dim, device_memory& kernel_globals, device_memory& data) { if(!func) { return false; } KernelGlobals *kg = (KernelGlobals*)kernel_globals.device_pointer; kg->global_size = make_int2(dim.global_size[0], dim.global_size[1]); for(int y = 0; y < dim.global_size[1]; y++) { for(int x = 0; x < dim.global_size[0]; x++) { kg->global_id = make_int2(x, y); func(kg, (KernelData*)data.device_pointer); } } return true; } }; CPUSplitKernel::CPUSplitKernel(CPUDevice *device) : DeviceSplitKernel(device), device(device) { } bool CPUSplitKernel::enqueue_split_kernel_data_init(const KernelDimensions& dim, RenderTile& rtile, int num_global_elements, device_memory& kernel_globals, device_memory& data, device_memory& split_data, device_memory& ray_state, device_memory& queue_index, device_memory& use_queues_flags, device_memory& work_pool_wgs) { KernelGlobals *kg = (KernelGlobals*)kernel_globals.device_pointer; kg->global_size = make_int2(dim.global_size[0], dim.global_size[1]); for(int y = 0; y < dim.global_size[1]; y++) { for(int x = 0; x < dim.global_size[0]; x++) { kg->global_id = make_int2(x, y); device->data_init_kernel()((KernelGlobals*)kernel_globals.device_pointer, (KernelData*)data.device_pointer, (void*)split_data.device_pointer, num_global_elements, (char*)ray_state.device_pointer, rtile.start_sample, rtile.start_sample + rtile.num_samples, rtile.x, rtile.y, rtile.w, rtile.h, rtile.offset, rtile.stride, (int*)queue_index.device_pointer, dim.global_size[0] * dim.global_size[1], (char*)use_queues_flags.device_pointer, (uint*)work_pool_wgs.device_pointer, rtile.num_samples, (float*)rtile.buffer); } } return true; } SplitKernelFunction* CPUSplitKernel::get_split_kernel_function(const string& kernel_name, const DeviceRequestedFeatures&) { CPUSplitKernelFunction *kernel = new CPUSplitKernelFunction(device); kernel->func = device->split_kernels[kernel_name](); if(!kernel->func) { delete kernel; return NULL; } return kernel; } int2 CPUSplitKernel::split_kernel_local_size() { return make_int2(1, 1); } int2 CPUSplitKernel::split_kernel_global_size(device_memory& /*kg*/, device_memory& /*data*/, DeviceTask * /*task*/) { return make_int2(1, 1); } uint64_t CPUSplitKernel::state_buffer_size(device_memory& kernel_globals, device_memory& /*data*/, size_t num_threads) { KernelGlobals *kg = (KernelGlobals*)kernel_globals.device_pointer; return split_data_buffer_size(kg, num_threads); } Device *device_cpu_create(DeviceInfo& info, Stats &stats, bool background) { return new CPUDevice(info, stats, background); } void device_cpu_info(vector& devices) { DeviceInfo info; info.type = DEVICE_CPU; info.description = system_cpu_brand_string(); info.id = "CPU"; info.num = 0; info.advanced_shading = true; info.bvh_layout_mask = BVH_LAYOUT_BVH2; if (system_cpu_support_sse2()) { info.bvh_layout_mask |= BVH_LAYOUT_BVH4; } info.has_volume_decoupled = true; info.has_osl = true; info.has_half_images = true; devices.insert(devices.begin(), info); } string device_cpu_capabilities(void) { string capabilities = ""; capabilities += system_cpu_support_sse2() ? "SSE2 " : ""; capabilities += system_cpu_support_sse3() ? "SSE3 " : ""; capabilities += system_cpu_support_sse41() ? "SSE41 " : ""; capabilities += system_cpu_support_avx() ? "AVX " : ""; capabilities += system_cpu_support_avx2() ? "AVX2" : ""; if(capabilities[capabilities.size() - 1] == ' ') capabilities.resize(capabilities.size() - 1); return capabilities; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device_cuda.cpp000066400000000000000000002366261334742672700226120ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include "device/device.h" #include "device/device_denoising.h" #include "device/device_intern.h" #include "device/device_split_kernel.h" #include "render/buffers.h" #include "kernel/filter/filter_defines.h" #ifdef WITH_CUDA_DYNLOAD # include "cuew.h" #else # include "util/util_opengl.h" # include # include #endif #include "util/util_debug.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_map.h" #include "util/util_md5.h" #include "util/util_opengl.h" #include "util/util_path.h" #include "util/util_string.h" #include "util/util_system.h" #include "util/util_types.h" #include "util/util_time.h" #include "kernel/split/kernel_split_data_types.h" CCL_NAMESPACE_BEGIN #ifndef WITH_CUDA_DYNLOAD /* Transparently implement some functions, so majority of the file does not need * to worry about difference between dynamically loaded and linked CUDA at all. */ namespace { const char *cuewErrorString(CUresult result) { /* We can only give error code here without major code duplication, that * should be enough since dynamic loading is only being disabled by folks * who knows what they're doing anyway. * * NOTE: Avoid call from several threads. */ static string error; error = string_printf("%d", result); return error.c_str(); } const char *cuewCompilerPath(void) { return CYCLES_CUDA_NVCC_EXECUTABLE; } int cuewCompilerVersion(void) { return (CUDA_VERSION / 100) + (CUDA_VERSION % 100 / 10); } } /* namespace */ #endif /* WITH_CUDA_DYNLOAD */ class CUDADevice; class CUDASplitKernel : public DeviceSplitKernel { CUDADevice *device; public: explicit CUDASplitKernel(CUDADevice *device); virtual uint64_t state_buffer_size(device_memory& kg, device_memory& data, size_t num_threads); virtual bool enqueue_split_kernel_data_init(const KernelDimensions& dim, RenderTile& rtile, int num_global_elements, device_memory& kernel_globals, device_memory& kernel_data_, device_memory& split_data, device_memory& ray_state, device_memory& queue_index, device_memory& use_queues_flag, device_memory& work_pool_wgs); virtual SplitKernelFunction* get_split_kernel_function(const string& kernel_name, const DeviceRequestedFeatures&); virtual int2 split_kernel_local_size(); virtual int2 split_kernel_global_size(device_memory& kg, device_memory& data, DeviceTask *task); }; /* Utility to push/pop CUDA context. */ class CUDAContextScope { public: CUDAContextScope(CUDADevice *device); ~CUDAContextScope(); private: CUDADevice *device; }; class CUDADevice : public Device { public: DedicatedTaskPool task_pool; CUdevice cuDevice; CUcontext cuContext; CUmodule cuModule, cuFilterModule; size_t device_texture_headroom; size_t device_working_headroom; bool move_texture_to_host; size_t map_host_used; size_t map_host_limit; int can_map_host; int cuDevId; int cuDevArchitecture; bool first_error; CUDASplitKernel *split_kernel; struct CUDAMem { CUDAMem() : texobject(0), array(0), map_host_pointer(0), free_map_host(false) {} CUtexObject texobject; CUarray array; void *map_host_pointer; bool free_map_host; }; typedef map CUDAMemMap; CUDAMemMap cuda_mem_map; struct PixelMem { GLuint cuPBO; CUgraphicsResource cuPBOresource; GLuint cuTexId; int w, h; }; map pixel_mem_map; /* Bindless Textures */ device_vector texture_info; bool need_texture_info; CUdeviceptr cuda_device_ptr(device_ptr mem) { return (CUdeviceptr)mem; } static bool have_precompiled_kernels() { string cubins_path = path_get("lib"); return path_exists(cubins_path); } virtual bool show_samples() const { /* The CUDADevice only processes one tile at a time, so showing samples is fine. */ return true; } /*#ifdef NDEBUG #define cuda_abort() #else #define cuda_abort() abort() #endif*/ void cuda_error_documentation() { if(first_error) { fprintf(stderr, "\nRefer to the Cycles GPU rendering documentation for possible solutions:\n"); fprintf(stderr, "https://docs.blender.org/manual/en/dev/render/cycles/gpu_rendering.html\n\n"); first_error = false; } } #define cuda_assert(stmt) \ { \ CUresult result = stmt; \ \ if(result != CUDA_SUCCESS) { \ string message = string_printf("CUDA error: %s in %s, line %d", cuewErrorString(result), #stmt, __LINE__); \ if(error_msg == "") \ error_msg = message; \ fprintf(stderr, "%s\n", message.c_str()); \ /*cuda_abort();*/ \ cuda_error_documentation(); \ } \ } (void)0 bool cuda_error_(CUresult result, const string& stmt) { if(result == CUDA_SUCCESS) return false; string message = string_printf("CUDA error at %s: %s", stmt.c_str(), cuewErrorString(result)); if(error_msg == "") error_msg = message; fprintf(stderr, "%s\n", message.c_str()); cuda_error_documentation(); return true; } #define cuda_error(stmt) cuda_error_(stmt, #stmt) void cuda_error_message(const string& message) { if(error_msg == "") error_msg = message; fprintf(stderr, "%s\n", message.c_str()); cuda_error_documentation(); } CUDADevice(DeviceInfo& info, Stats &stats, bool background_) : Device(info, stats, background_), texture_info(this, "__texture_info", MEM_TEXTURE) { first_error = true; background = background_; cuDevId = info.num; cuDevice = 0; cuContext = 0; cuModule = 0; cuFilterModule = 0; split_kernel = NULL; need_texture_info = false; device_texture_headroom = 0; device_working_headroom = 0; move_texture_to_host = false; map_host_limit = 0; map_host_used = 0; can_map_host = 0; /* Intialize CUDA. */ if(cuda_error(cuInit(0))) return; /* Setup device and context. */ if(cuda_error(cuDeviceGet(&cuDevice, cuDevId))) return; /* CU_CTX_MAP_HOST for mapping host memory when out of device memory. * CU_CTX_LMEM_RESIZE_TO_MAX for reserving local memory ahead of render, * so we can predict which memory to map to host. */ cuda_assert(cuDeviceGetAttribute(&can_map_host, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, cuDevice)); unsigned int ctx_flags = CU_CTX_LMEM_RESIZE_TO_MAX; if(can_map_host) { ctx_flags |= CU_CTX_MAP_HOST; init_host_memory(); } /* Create context. */ CUresult result; if(background) { result = cuCtxCreate(&cuContext, ctx_flags, cuDevice); } else { result = cuGLCtxCreate(&cuContext, ctx_flags, cuDevice); if(result != CUDA_SUCCESS) { result = cuCtxCreate(&cuContext, ctx_flags, cuDevice); background = true; } } if(cuda_error_(result, "cuCtxCreate")) return; int major, minor; cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevId); cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevId); cuDevArchitecture = major*100 + minor*10; /* Pop context set by cuCtxCreate. */ cuCtxPopCurrent(NULL); } ~CUDADevice() { task_pool.stop(); delete split_kernel; texture_info.free(); cuda_assert(cuCtxDestroy(cuContext)); } bool support_device(const DeviceRequestedFeatures& /*requested_features*/) { int major, minor; cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevId); cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevId); /* We only support sm_30 and above */ if(major < 3) { cuda_error_message(string_printf("CUDA device supported only with compute capability 3.0 or up, found %d.%d.", major, minor)); return false; } return true; } bool use_adaptive_compilation() { return DebugFlags().cuda.adaptive_compile; } bool use_split_kernel() { return DebugFlags().cuda.split_kernel; } /* Common NVCC flags which stays the same regardless of shading model, * kernel sources md5 and only depends on compiler or compilation settings. */ string compile_kernel_get_common_cflags( const DeviceRequestedFeatures& requested_features, bool filter=false, bool split=false) { const int machine = system_cpu_bits(); const string source_path = path_get("source"); const string include_path = source_path; string cflags = string_printf("-m%d " "--ptxas-options=\"-v\" " "--use_fast_math " "-DNVCC " "-I\"%s\"", machine, include_path.c_str()); if(!filter && use_adaptive_compilation()) { cflags += " " + requested_features.get_build_options(); } const char *extra_cflags = getenv("CYCLES_CUDA_EXTRA_CFLAGS"); if(extra_cflags) { cflags += string(" ") + string(extra_cflags); } #ifdef WITH_CYCLES_DEBUG cflags += " -D__KERNEL_DEBUG__"; #endif if(split) { cflags += " -D__SPLIT__"; } return cflags; } bool compile_check_compiler() { const char *nvcc = cuewCompilerPath(); if(nvcc == NULL) { cuda_error_message("CUDA nvcc compiler not found. " "Install CUDA toolkit in default location."); return false; } const int cuda_version = cuewCompilerVersion(); VLOG(1) << "Found nvcc " << nvcc << ", CUDA version " << cuda_version << "."; const int major = cuda_version / 10, minor = cuda_version & 10; if(cuda_version == 0) { cuda_error_message("CUDA nvcc compiler version could not be parsed."); return false; } if(cuda_version < 80) { printf("Unsupported CUDA version %d.%d detected, " "you need CUDA 8.0 or newer.\n", major, minor); return false; } else if(cuda_version != 80) { printf("CUDA version %d.%d detected, build may succeed but only " "CUDA 8.0 is officially supported.\n", major, minor); } return true; } string compile_kernel(const DeviceRequestedFeatures& requested_features, bool filter=false, bool split=false) { const char *name, *source; if(filter) { name = "filter"; source = "filter.cu"; } else if(split) { name = "kernel_split"; source = "kernel_split.cu"; } else { name = "kernel"; source = "kernel.cu"; } /* Compute cubin name. */ int major, minor; cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevId); cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevId); /* Attempt to use kernel provided with Blender. */ if(!use_adaptive_compilation()) { const string cubin = path_get(string_printf("lib/%s_sm_%d%d.cubin", name, major, minor)); VLOG(1) << "Testing for pre-compiled kernel " << cubin << "."; if(path_exists(cubin)) { VLOG(1) << "Using precompiled kernel."; return cubin; } } const string common_cflags = compile_kernel_get_common_cflags(requested_features, filter, split); /* Try to use locally compiled kernel. */ const string source_path = path_get("source"); const string kernel_md5 = path_files_md5_hash(source_path); /* We include cflags into md5 so changing cuda toolkit or changing other * compiler command line arguments makes sure cubin gets re-built. */ const string cubin_md5 = util_md5_string(kernel_md5 + common_cflags); const string cubin_file = string_printf("cycles_%s_sm%d%d_%s.cubin", name, major, minor, cubin_md5.c_str()); const string cubin = path_cache_get(path_join("kernels", cubin_file)); VLOG(1) << "Testing for locally compiled kernel " << cubin << "."; if(path_exists(cubin)) { VLOG(1) << "Using locally compiled kernel."; return cubin; } #ifdef _WIN32 if(have_precompiled_kernels()) { if(major < 3) { cuda_error_message(string_printf( "CUDA device requires compute capability 3.0 or up, " "found %d.%d. Your GPU is not supported.", major, minor)); } else { cuda_error_message(string_printf( "CUDA binary kernel for this graphics card compute " "capability (%d.%d) not found.", major, minor)); } return ""; } #endif /* Compile. */ if(!compile_check_compiler()) { return ""; } const char *nvcc = cuewCompilerPath(); const string kernel = path_join( path_join(source_path, "kernel"), path_join("kernels", path_join("cuda", source))); double starttime = time_dt(); printf("Compiling CUDA kernel ...\n"); path_create_directories(cubin); string command = string_printf("\"%s\" " "-arch=sm_%d%d " "--cubin \"%s\" " "-o \"%s\" " "%s ", nvcc, major, minor, kernel.c_str(), cubin.c_str(), common_cflags.c_str()); printf("%s\n", command.c_str()); if(system(command.c_str()) == -1) { cuda_error_message("Failed to execute compilation command, " "see console for details."); return ""; } /* Verify if compilation succeeded */ if(!path_exists(cubin)) { cuda_error_message("CUDA kernel compilation failed, " "see console for details."); return ""; } printf("Kernel compilation finished in %.2lfs.\n", time_dt() - starttime); return cubin; } bool load_kernels(const DeviceRequestedFeatures& requested_features) { /* TODO(sergey): Support kernels re-load for CUDA devices. * * Currently re-loading kernel will invalidate memory pointers, * causing problems in cuCtxSynchronize. */ if(cuFilterModule && cuModule) { VLOG(1) << "Skipping kernel reload, not currently supported."; return true; } /* check if cuda init succeeded */ if(cuContext == 0) return false; /* check if GPU is supported */ if(!support_device(requested_features)) return false; /* get kernel */ string cubin = compile_kernel(requested_features, false, use_split_kernel()); if(cubin == "") return false; string filter_cubin = compile_kernel(requested_features, true, false); if(filter_cubin == "") return false; /* open module */ CUDAContextScope scope(this); string cubin_data; CUresult result; if(path_read_text(cubin, cubin_data)) result = cuModuleLoadData(&cuModule, cubin_data.c_str()); else result = CUDA_ERROR_FILE_NOT_FOUND; if(cuda_error_(result, "cuModuleLoad")) cuda_error_message(string_printf("Failed loading CUDA kernel %s.", cubin.c_str())); if(path_read_text(filter_cubin, cubin_data)) result = cuModuleLoadData(&cuFilterModule, cubin_data.c_str()); else result = CUDA_ERROR_FILE_NOT_FOUND; if(cuda_error_(result, "cuModuleLoad")) cuda_error_message(string_printf("Failed loading CUDA kernel %s.", filter_cubin.c_str())); if(result == CUDA_SUCCESS) { reserve_local_memory(requested_features); } return (result == CUDA_SUCCESS); } void reserve_local_memory(const DeviceRequestedFeatures& requested_features) { if(use_split_kernel()) { /* Split kernel mostly uses global memory and adaptive compilation, * difficult to predict how much is needed currently. */ return; } /* Together with CU_CTX_LMEM_RESIZE_TO_MAX, this reserves local memory * needed for kernel launches, so that we can reliably figure out when * to allocate scene data in mapped host memory. */ CUDAContextScope scope(this); size_t total = 0, free_before = 0, free_after = 0; cuMemGetInfo(&free_before, &total); /* Get kernel function. */ CUfunction cuPathTrace; if(requested_features.use_integrator_branched) { cuda_assert(cuModuleGetFunction(&cuPathTrace, cuModule, "kernel_cuda_branched_path_trace")); } else { cuda_assert(cuModuleGetFunction(&cuPathTrace, cuModule, "kernel_cuda_path_trace")); } cuda_assert(cuFuncSetCacheConfig(cuPathTrace, CU_FUNC_CACHE_PREFER_L1)); int min_blocks, num_threads_per_block; cuda_assert(cuOccupancyMaxPotentialBlockSize(&min_blocks, &num_threads_per_block, cuPathTrace, NULL, 0, 0)); /* Launch kernel, using just 1 block appears sufficient to reserve * memory for all multiprocessors. It would be good to do this in * parallel for the multi GPU case still to make it faster. */ CUdeviceptr d_work_tiles = 0; uint total_work_size = 0; void *args[] = {&d_work_tiles, &total_work_size}; cuda_assert(cuLaunchKernel(cuPathTrace, 1, 1, 1, num_threads_per_block, 1, 1, 0, 0, args, 0)); cuda_assert(cuCtxSynchronize()); cuMemGetInfo(&free_after, &total); VLOG(1) << "Local memory reserved " << string_human_readable_number(free_before - free_after) << " bytes. (" << string_human_readable_size(free_before - free_after) << ")"; #if 0 /* For testing mapped host memory, fill up device memory. */ const size_t keep_mb = 1024; while(free_after > keep_mb * 1024 * 1024LL) { CUdeviceptr tmp; cuda_assert(cuMemAlloc(&tmp, 10 * 1024 * 1024LL)); cuMemGetInfo(&free_after, &total); } #endif } void init_host_memory() { /* Limit amount of host mapped memory, because allocating too much can * cause system instability. Leave at least half or 4 GB of system * memory free, whichever is smaller. */ size_t default_limit = 4 * 1024 * 1024 * 1024LL; size_t system_ram = system_physical_ram(); if(system_ram > 0) { if(system_ram / 2 > default_limit) { map_host_limit = system_ram - default_limit; } else { map_host_limit = system_ram / 2; } } else { VLOG(1) << "Mapped host memory disabled, failed to get system RAM"; map_host_limit = 0; } /* Amount of device memory to keep is free after texture memory * and working memory allocations respectively. We set the working * memory limit headroom lower so that some space is left after all * texture memory allocations. */ device_working_headroom = 32 * 1024 * 1024LL; // 32MB device_texture_headroom = 128 * 1024 * 1024LL; // 128MB VLOG(1) << "Mapped host memory limit set to " << string_human_readable_number(map_host_limit) << " bytes. (" << string_human_readable_size(map_host_limit) << ")"; } void load_texture_info() { if(need_texture_info) { texture_info.copy_to_device(); need_texture_info = false; } } void move_textures_to_host(size_t size, bool for_texture) { /* Signal to reallocate textures in host memory only. */ move_texture_to_host = true; while(size > 0) { /* Find suitable memory allocation to move. */ device_memory *max_mem = NULL; size_t max_size = 0; bool max_is_image = false; foreach(CUDAMemMap::value_type& pair, cuda_mem_map) { device_memory& mem = *pair.first; CUDAMem *cmem = &pair.second; bool is_texture = (mem.type == MEM_TEXTURE) && (&mem != &texture_info); bool is_image = is_texture && (mem.data_height > 1); /* Can't move this type of memory. */ if(!is_texture || cmem->array) { continue; } /* Already in host memory. */ if(cmem->map_host_pointer) { continue; } /* For other textures, only move image textures. */ if(for_texture && !is_image) { continue; } /* Try to move largest allocation, prefer moving images. */ if(is_image > max_is_image || (is_image == max_is_image && mem.device_size > max_size)) { max_is_image = is_image; max_size = mem.device_size; max_mem = &mem; } } /* Move to host memory. This part is mutex protected since * multiple CUDA devices could be moving the memory. The * first one will do it, and the rest will adopt the pointer. */ if(max_mem) { VLOG(1) << "Move memory from device to host: " << max_mem->name; static thread_mutex move_mutex; thread_scoped_lock lock(move_mutex); /* Preserve the original device pointer, in case of multi device * we can't change it because the pointer mapping would break. */ device_ptr prev_pointer = max_mem->device_pointer; size_t prev_size = max_mem->device_size; tex_free(*max_mem); tex_alloc(*max_mem); size = (max_size >= size)? 0: size - max_size; max_mem->device_pointer = prev_pointer; max_mem->device_size = prev_size; } else { break; } } /* Update texture info array with new pointers. */ load_texture_info(); move_texture_to_host = false; } CUDAMem *generic_alloc(device_memory& mem, size_t pitch_padding = 0) { CUDAContextScope scope(this); CUdeviceptr device_pointer = 0; size_t size = mem.memory_size() + pitch_padding; CUresult mem_alloc_result = CUDA_ERROR_OUT_OF_MEMORY; const char *status = ""; /* First try allocating in device memory, respecting headroom. We make * an exception for texture info. It is small and frequently accessed, * so treat it as working memory. * * If there is not enough room for working memory, we will try to move * textures to host memory, assuming the performance impact would have * been worse for working memory. */ bool is_texture = (mem.type == MEM_TEXTURE) && (&mem != &texture_info); bool is_image = is_texture && (mem.data_height > 1); size_t headroom = (is_texture)? device_texture_headroom: device_working_headroom; size_t total = 0, free = 0; cuMemGetInfo(&free, &total); /* Move textures to host memory if needed. */ if(!move_texture_to_host && !is_image && (size + headroom) >= free) { move_textures_to_host(size + headroom - free, is_texture); cuMemGetInfo(&free, &total); } /* Allocate in device memory. */ if(!move_texture_to_host && (size + headroom) < free) { mem_alloc_result = cuMemAlloc(&device_pointer, size); if(mem_alloc_result == CUDA_SUCCESS) { status = " in device memory"; } } /* Fall back to mapped host memory if needed and possible. */ void *map_host_pointer = 0; bool free_map_host = false; if(mem_alloc_result != CUDA_SUCCESS && can_map_host && map_host_used + size < map_host_limit) { if(mem.shared_pointer) { /* Another device already allocated host memory. */ mem_alloc_result = CUDA_SUCCESS; map_host_pointer = mem.shared_pointer; } else { /* Allocate host memory ourselves. */ mem_alloc_result = cuMemHostAlloc(&map_host_pointer, size, CU_MEMHOSTALLOC_DEVICEMAP | CU_MEMHOSTALLOC_WRITECOMBINED); mem.shared_pointer = map_host_pointer; free_map_host = true; } if(mem_alloc_result == CUDA_SUCCESS) { cuda_assert(cuMemHostGetDevicePointer_v2(&device_pointer, mem.shared_pointer, 0)); map_host_used += size; status = " in host memory"; /* Replace host pointer with our host allocation. Only works if * CUDA memory layout is the same and has no pitch padding. Also * does not work if we move textures to host during a render, * since other devices might be using the memory. */ if(!move_texture_to_host && pitch_padding == 0 && mem.host_pointer && mem.host_pointer != mem.shared_pointer) { memcpy(mem.shared_pointer, mem.host_pointer, size); mem.host_free(); mem.host_pointer = mem.shared_pointer; } } else { status = " failed, out of host memory"; } } else if(mem_alloc_result != CUDA_SUCCESS) { status = " failed, out of device and host memory"; } if(mem_alloc_result != CUDA_SUCCESS) { cuda_assert(mem_alloc_result); } if(mem.name) { VLOG(1) << "Buffer allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")" << status; } mem.device_pointer = (device_ptr)device_pointer; mem.device_size = size; stats.mem_alloc(size); if(!mem.device_pointer) { return NULL; } /* Insert into map of allocations. */ CUDAMem *cmem = &cuda_mem_map[&mem]; cmem->map_host_pointer = map_host_pointer; cmem->free_map_host = free_map_host; return cmem; } void generic_copy_to(device_memory& mem) { if(mem.host_pointer && mem.device_pointer) { CUDAContextScope scope(this); if(mem.host_pointer != mem.shared_pointer) { cuda_assert(cuMemcpyHtoD(cuda_device_ptr(mem.device_pointer), mem.host_pointer, mem.memory_size())); } } } void generic_free(device_memory& mem) { if(mem.device_pointer) { CUDAContextScope scope(this); const CUDAMem& cmem = cuda_mem_map[&mem]; if(cmem.map_host_pointer) { /* Free host memory. */ if(cmem.free_map_host) { cuMemFreeHost(cmem.map_host_pointer); if(mem.host_pointer == mem.shared_pointer) { mem.host_pointer = 0; } mem.shared_pointer = 0; } map_host_used -= mem.device_size; } else { /* Free device memory. */ cuMemFree(mem.device_pointer); } stats.mem_free(mem.device_size); mem.device_pointer = 0; mem.device_size = 0; cuda_mem_map.erase(cuda_mem_map.find(&mem)); } } void mem_alloc(device_memory& mem) { if(mem.type == MEM_PIXELS && !background) { pixels_alloc(mem); } else if(mem.type == MEM_TEXTURE) { assert(!"mem_alloc not supported for textures."); } else { generic_alloc(mem); } } void mem_copy_to(device_memory& mem) { if(mem.type == MEM_PIXELS) { assert(!"mem_copy_to not supported for pixels."); } else if(mem.type == MEM_TEXTURE) { tex_free(mem); tex_alloc(mem); } else { if(!mem.device_pointer) { generic_alloc(mem); } generic_copy_to(mem); } } void mem_copy_from(device_memory& mem, int y, int w, int h, int elem) { if(mem.type == MEM_PIXELS && !background) { pixels_copy_from(mem, y, w, h); } else if(mem.type == MEM_TEXTURE) { assert(!"mem_copy_from not supported for textures."); } else { CUDAContextScope scope(this); size_t offset = elem*y*w; size_t size = elem*w*h; if(mem.host_pointer && mem.device_pointer) { cuda_assert(cuMemcpyDtoH((uchar*)mem.host_pointer + offset, (CUdeviceptr)(mem.device_pointer + offset), size)); } else if(mem.host_pointer) { memset((char*)mem.host_pointer + offset, 0, size); } } } void mem_zero(device_memory& mem) { if(!mem.device_pointer) { mem_alloc(mem); } if(mem.host_pointer) { memset(mem.host_pointer, 0, mem.memory_size()); } if(mem.device_pointer && (!mem.host_pointer || mem.host_pointer != mem.shared_pointer)) { CUDAContextScope scope(this); cuda_assert(cuMemsetD8(cuda_device_ptr(mem.device_pointer), 0, mem.memory_size())); } } void mem_free(device_memory& mem) { if(mem.type == MEM_PIXELS && !background) { pixels_free(mem); } else if(mem.type == MEM_TEXTURE) { tex_free(mem); } else { generic_free(mem); } } virtual device_ptr mem_alloc_sub_ptr(device_memory& mem, int offset, int /*size*/) { return (device_ptr) (((char*) mem.device_pointer) + mem.memory_elements_size(offset)); } void const_copy_to(const char *name, void *host, size_t size) { CUDAContextScope scope(this); CUdeviceptr mem; size_t bytes; cuda_assert(cuModuleGetGlobal(&mem, &bytes, cuModule, name)); //assert(bytes == size); cuda_assert(cuMemcpyHtoD(mem, host, size)); } void tex_alloc(device_memory& mem) { CUDAContextScope scope(this); /* General variables for both architectures */ string bind_name = mem.name; size_t dsize = datatype_size(mem.data_type); size_t size = mem.memory_size(); CUaddress_mode address_mode = CU_TR_ADDRESS_MODE_WRAP; switch(mem.extension) { case EXTENSION_REPEAT: address_mode = CU_TR_ADDRESS_MODE_WRAP; break; case EXTENSION_EXTEND: address_mode = CU_TR_ADDRESS_MODE_CLAMP; break; case EXTENSION_CLIP: address_mode = CU_TR_ADDRESS_MODE_BORDER; break; default: assert(0); break; } CUfilter_mode filter_mode; if(mem.interpolation == INTERPOLATION_CLOSEST) { filter_mode = CU_TR_FILTER_MODE_POINT; } else { filter_mode = CU_TR_FILTER_MODE_LINEAR; } /* Data Storage */ if(mem.interpolation == INTERPOLATION_NONE) { generic_alloc(mem); generic_copy_to(mem); CUdeviceptr cumem; size_t cubytes; cuda_assert(cuModuleGetGlobal(&cumem, &cubytes, cuModule, bind_name.c_str())); if(cubytes == 8) { /* 64 bit device pointer */ uint64_t ptr = mem.device_pointer; cuda_assert(cuMemcpyHtoD(cumem, (void*)&ptr, cubytes)); } else { /* 32 bit device pointer */ uint32_t ptr = (uint32_t)mem.device_pointer; cuda_assert(cuMemcpyHtoD(cumem, (void*)&ptr, cubytes)); } return; } /* Image Texture Storage */ CUarray_format_enum format; switch(mem.data_type) { case TYPE_UCHAR: format = CU_AD_FORMAT_UNSIGNED_INT8; break; case TYPE_UINT: format = CU_AD_FORMAT_UNSIGNED_INT32; break; case TYPE_INT: format = CU_AD_FORMAT_SIGNED_INT32; break; case TYPE_FLOAT: format = CU_AD_FORMAT_FLOAT; break; case TYPE_HALF: format = CU_AD_FORMAT_HALF; break; default: assert(0); return; } CUDAMem *cmem = NULL; CUarray array_3d = NULL; size_t src_pitch = mem.data_width * dsize * mem.data_elements; size_t dst_pitch = src_pitch; if(mem.data_depth > 1) { /* 3D texture using array, there is no API for linear memory. */ CUDA_ARRAY3D_DESCRIPTOR desc; desc.Width = mem.data_width; desc.Height = mem.data_height; desc.Depth = mem.data_depth; desc.Format = format; desc.NumChannels = mem.data_elements; desc.Flags = 0; VLOG(1) << "Array 3D allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; cuda_assert(cuArray3DCreate(&array_3d, &desc)); if(!array_3d) { return; } CUDA_MEMCPY3D param; memset(¶m, 0, sizeof(param)); param.dstMemoryType = CU_MEMORYTYPE_ARRAY; param.dstArray = array_3d; param.srcMemoryType = CU_MEMORYTYPE_HOST; param.srcHost = mem.host_pointer; param.srcPitch = src_pitch; param.WidthInBytes = param.srcPitch; param.Height = mem.data_height; param.Depth = mem.data_depth; cuda_assert(cuMemcpy3D(¶m)); mem.device_pointer = (device_ptr)array_3d; mem.device_size = size; stats.mem_alloc(size); cmem = &cuda_mem_map[&mem]; cmem->texobject = 0; cmem->array = array_3d; } else if(mem.data_height > 0) { /* 2D texture, using pitch aligned linear memory. */ int alignment = 0; cuda_assert(cuDeviceGetAttribute(&alignment, CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, cuDevice)); dst_pitch = align_up(src_pitch, alignment); size_t dst_size = dst_pitch * mem.data_height; cmem = generic_alloc(mem, dst_size - mem.memory_size()); if(!cmem) { return; } CUDA_MEMCPY2D param; memset(¶m, 0, sizeof(param)); param.dstMemoryType = CU_MEMORYTYPE_DEVICE; param.dstDevice = mem.device_pointer; param.dstPitch = dst_pitch; param.srcMemoryType = CU_MEMORYTYPE_HOST; param.srcHost = mem.host_pointer; param.srcPitch = src_pitch; param.WidthInBytes = param.srcPitch; param.Height = mem.data_height; cuda_assert(cuMemcpy2DUnaligned(¶m)); } else { /* 1D texture, using linear memory. */ cmem = generic_alloc(mem); if(!cmem) { return; } cuda_assert(cuMemcpyHtoD(mem.device_pointer, mem.host_pointer, size)); } /* Kepler+, bindless textures. */ int flat_slot = 0; if(string_startswith(mem.name, "__tex_image")) { int pos = string(mem.name).rfind("_"); flat_slot = atoi(mem.name + pos + 1); } else { assert(0); } CUDA_RESOURCE_DESC resDesc; memset(&resDesc, 0, sizeof(resDesc)); if(array_3d) { resDesc.resType = CU_RESOURCE_TYPE_ARRAY; resDesc.res.array.hArray = array_3d; resDesc.flags = 0; } else if(mem.data_height > 0) { resDesc.resType = CU_RESOURCE_TYPE_PITCH2D; resDesc.res.pitch2D.devPtr = mem.device_pointer; resDesc.res.pitch2D.format = format; resDesc.res.pitch2D.numChannels = mem.data_elements; resDesc.res.pitch2D.height = mem.data_height; resDesc.res.pitch2D.width = mem.data_width; resDesc.res.pitch2D.pitchInBytes = dst_pitch; } else { resDesc.resType = CU_RESOURCE_TYPE_LINEAR; resDesc.res.linear.devPtr = mem.device_pointer; resDesc.res.linear.format = format; resDesc.res.linear.numChannels = mem.data_elements; resDesc.res.linear.sizeInBytes = mem.device_size; } CUDA_TEXTURE_DESC texDesc; memset(&texDesc, 0, sizeof(texDesc)); texDesc.addressMode[0] = address_mode; texDesc.addressMode[1] = address_mode; texDesc.addressMode[2] = address_mode; texDesc.filterMode = filter_mode; texDesc.flags = CU_TRSF_NORMALIZED_COORDINATES; cuda_assert(cuTexObjectCreate(&cmem->texobject, &resDesc, &texDesc, NULL)); /* Resize once */ if(flat_slot >= texture_info.size()) { /* Allocate some slots in advance, to reduce amount * of re-allocations. */ texture_info.resize(flat_slot + 128); } /* Set Mapping and tag that we need to (re-)upload to device */ TextureInfo& info = texture_info[flat_slot]; info.data = (uint64_t)cmem->texobject; info.cl_buffer = 0; info.interpolation = mem.interpolation; info.extension = mem.extension; info.width = mem.data_width; info.height = mem.data_height; info.depth = mem.data_depth; need_texture_info = true; } void tex_free(device_memory& mem) { if(mem.device_pointer) { CUDAContextScope scope(this); const CUDAMem& cmem = cuda_mem_map[&mem]; if(cmem.texobject) { /* Free bindless texture. */ cuTexObjectDestroy(cmem.texobject); } if(cmem.array) { /* Free array. */ cuArrayDestroy(cmem.array); stats.mem_free(mem.device_size); mem.device_pointer = 0; mem.device_size = 0; cuda_mem_map.erase(cuda_mem_map.find(&mem)); } else { generic_free(mem); } } } bool denoising_set_tiles(device_ptr *buffers, DenoisingTask *task) { TilesInfo *tiles = (TilesInfo*) task->tiles_mem.host_pointer; for(int i = 0; i < 9; i++) { tiles->buffers[i] = buffers[i]; } task->tiles_mem.copy_to_device(); return !have_error(); } #define CUDA_GET_BLOCKSIZE(func, w, h) \ int threads_per_block; \ cuda_assert(cuFuncGetAttribute(&threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, func)); \ int threads = (int)sqrt((float)threads_per_block); \ int xblocks = ((w) + threads - 1)/threads; \ int yblocks = ((h) + threads - 1)/threads; #define CUDA_LAUNCH_KERNEL(func, args) \ cuda_assert(cuLaunchKernel(func, \ xblocks, yblocks, 1, \ threads, threads, 1, \ 0, 0, args, 0)); /* Similar as above, but for 1-dimensional blocks. */ #define CUDA_GET_BLOCKSIZE_1D(func, w, h) \ int threads_per_block; \ cuda_assert(cuFuncGetAttribute(&threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, func)); \ int xblocks = ((w) + threads_per_block - 1)/threads_per_block; \ int yblocks = h; #define CUDA_LAUNCH_KERNEL_1D(func, args) \ cuda_assert(cuLaunchKernel(func, \ xblocks, yblocks, 1, \ threads_per_block, 1, 1, \ 0, 0, args, 0)); bool denoising_non_local_means(device_ptr image_ptr, device_ptr guide_ptr, device_ptr variance_ptr, device_ptr out_ptr, DenoisingTask *task) { if(have_error()) return false; CUDAContextScope scope(this); int stride = task->buffer.stride; int w = task->buffer.width; int h = task->buffer.h; int r = task->nlm_state.r; int f = task->nlm_state.f; float a = task->nlm_state.a; float k_2 = task->nlm_state.k_2; int shift_stride = stride*h; int num_shifts = (2*r+1)*(2*r+1); int mem_size = sizeof(float)*shift_stride*num_shifts; int channel_offset = 0; device_only_memory temporary_mem(this, "Denoising temporary_mem"); temporary_mem.alloc_to_device(2*mem_size); if(have_error()) return false; CUdeviceptr difference = cuda_device_ptr(temporary_mem.device_pointer); CUdeviceptr blurDifference = difference + mem_size; CUdeviceptr weightAccum = task->nlm_state.temporary_3_ptr; cuda_assert(cuMemsetD8(weightAccum, 0, sizeof(float)*shift_stride)); cuda_assert(cuMemsetD8(out_ptr, 0, sizeof(float)*shift_stride)); { CUfunction cuNLMCalcDifference, cuNLMBlur, cuNLMCalcWeight, cuNLMUpdateOutput; cuda_assert(cuModuleGetFunction(&cuNLMCalcDifference, cuFilterModule, "kernel_cuda_filter_nlm_calc_difference")); cuda_assert(cuModuleGetFunction(&cuNLMBlur, cuFilterModule, "kernel_cuda_filter_nlm_blur")); cuda_assert(cuModuleGetFunction(&cuNLMCalcWeight, cuFilterModule, "kernel_cuda_filter_nlm_calc_weight")); cuda_assert(cuModuleGetFunction(&cuNLMUpdateOutput, cuFilterModule, "kernel_cuda_filter_nlm_update_output")); cuda_assert(cuFuncSetCacheConfig(cuNLMCalcDifference, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuFuncSetCacheConfig(cuNLMBlur, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuFuncSetCacheConfig(cuNLMCalcWeight, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuFuncSetCacheConfig(cuNLMUpdateOutput, CU_FUNC_CACHE_PREFER_L1)); CUDA_GET_BLOCKSIZE_1D(cuNLMCalcDifference, w*h, num_shifts); void *calc_difference_args[] = {&guide_ptr, &variance_ptr, &difference, &w, &h, &stride, &shift_stride, &r, &channel_offset, &a, &k_2}; void *blur_args[] = {&difference, &blurDifference, &w, &h, &stride, &shift_stride, &r, &f}; void *calc_weight_args[] = {&blurDifference, &difference, &w, &h, &stride, &shift_stride, &r, &f}; void *update_output_args[] = {&blurDifference, &image_ptr, &out_ptr, &weightAccum, &w, &h, &stride, &shift_stride, &r, &f}; CUDA_LAUNCH_KERNEL_1D(cuNLMCalcDifference, calc_difference_args); CUDA_LAUNCH_KERNEL_1D(cuNLMBlur, blur_args); CUDA_LAUNCH_KERNEL_1D(cuNLMCalcWeight, calc_weight_args); CUDA_LAUNCH_KERNEL_1D(cuNLMBlur, blur_args); CUDA_LAUNCH_KERNEL_1D(cuNLMUpdateOutput, update_output_args); } temporary_mem.free(); { CUfunction cuNLMNormalize; cuda_assert(cuModuleGetFunction(&cuNLMNormalize, cuFilterModule, "kernel_cuda_filter_nlm_normalize")); cuda_assert(cuFuncSetCacheConfig(cuNLMNormalize, CU_FUNC_CACHE_PREFER_L1)); void *normalize_args[] = {&out_ptr, &weightAccum, &w, &h, &stride}; CUDA_GET_BLOCKSIZE(cuNLMNormalize, w, h); CUDA_LAUNCH_KERNEL(cuNLMNormalize, normalize_args); cuda_assert(cuCtxSynchronize()); } return !have_error(); } bool denoising_construct_transform(DenoisingTask *task) { if(have_error()) return false; CUDAContextScope scope(this); CUfunction cuFilterConstructTransform; cuda_assert(cuModuleGetFunction(&cuFilterConstructTransform, cuFilterModule, "kernel_cuda_filter_construct_transform")); cuda_assert(cuFuncSetCacheConfig(cuFilterConstructTransform, CU_FUNC_CACHE_PREFER_SHARED)); CUDA_GET_BLOCKSIZE(cuFilterConstructTransform, task->storage.w, task->storage.h); void *args[] = {&task->buffer.mem.device_pointer, &task->storage.transform.device_pointer, &task->storage.rank.device_pointer, &task->filter_area, &task->rect, &task->radius, &task->pca_threshold, &task->buffer.pass_stride}; CUDA_LAUNCH_KERNEL(cuFilterConstructTransform, args); cuda_assert(cuCtxSynchronize()); return !have_error(); } bool denoising_reconstruct(device_ptr color_ptr, device_ptr color_variance_ptr, device_ptr output_ptr, DenoisingTask *task) { if(have_error()) return false; CUDAContextScope scope(this); mem_zero(task->storage.XtWX); mem_zero(task->storage.XtWY); int r = task->radius; int f = 4; float a = 1.0f; float k_2 = task->nlm_k_2; int w = task->reconstruction_state.source_w; int h = task->reconstruction_state.source_h; int stride = task->buffer.stride; int shift_stride = stride*h; int num_shifts = (2*r+1)*(2*r+1); int mem_size = sizeof(float)*shift_stride*num_shifts; device_only_memory temporary_mem(this, "Denoising temporary_mem"); temporary_mem.alloc_to_device(2*mem_size); if(have_error()) return false; CUdeviceptr difference = cuda_device_ptr(temporary_mem.device_pointer); CUdeviceptr blurDifference = difference + mem_size; { CUfunction cuNLMCalcDifference, cuNLMBlur, cuNLMCalcWeight, cuNLMConstructGramian; cuda_assert(cuModuleGetFunction(&cuNLMCalcDifference, cuFilterModule, "kernel_cuda_filter_nlm_calc_difference")); cuda_assert(cuModuleGetFunction(&cuNLMBlur, cuFilterModule, "kernel_cuda_filter_nlm_blur")); cuda_assert(cuModuleGetFunction(&cuNLMCalcWeight, cuFilterModule, "kernel_cuda_filter_nlm_calc_weight")); cuda_assert(cuModuleGetFunction(&cuNLMConstructGramian, cuFilterModule, "kernel_cuda_filter_nlm_construct_gramian")); cuda_assert(cuFuncSetCacheConfig(cuNLMCalcDifference, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuFuncSetCacheConfig(cuNLMBlur, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuFuncSetCacheConfig(cuNLMCalcWeight, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuFuncSetCacheConfig(cuNLMConstructGramian, CU_FUNC_CACHE_PREFER_SHARED)); CUDA_GET_BLOCKSIZE_1D(cuNLMCalcDifference, task->reconstruction_state.source_w * task->reconstruction_state.source_h, num_shifts); void *calc_difference_args[] = {&color_ptr, &color_variance_ptr, &difference, &w, &h, &stride, &shift_stride, &r, &task->buffer.pass_stride, &a, &k_2}; void *blur_args[] = {&difference, &blurDifference, &w, &h, &stride, &shift_stride, &r, &f}; void *calc_weight_args[] = {&blurDifference, &difference, &w, &h, &stride, &shift_stride, &r, &f}; void *construct_gramian_args[] = {&blurDifference, &task->buffer.mem.device_pointer, &task->storage.transform.device_pointer, &task->storage.rank.device_pointer, &task->storage.XtWX.device_pointer, &task->storage.XtWY.device_pointer, &task->reconstruction_state.filter_window, &w, &h, &stride, &shift_stride, &r, &f, &task->buffer.pass_stride}; CUDA_LAUNCH_KERNEL_1D(cuNLMCalcDifference, calc_difference_args); CUDA_LAUNCH_KERNEL_1D(cuNLMBlur, blur_args); CUDA_LAUNCH_KERNEL_1D(cuNLMCalcWeight, calc_weight_args); CUDA_LAUNCH_KERNEL_1D(cuNLMBlur, blur_args); CUDA_LAUNCH_KERNEL_1D(cuNLMConstructGramian, construct_gramian_args); } temporary_mem.free(); { CUfunction cuFinalize; cuda_assert(cuModuleGetFunction(&cuFinalize, cuFilterModule, "kernel_cuda_filter_finalize")); cuda_assert(cuFuncSetCacheConfig(cuFinalize, CU_FUNC_CACHE_PREFER_L1)); void *finalize_args[] = {&output_ptr, &task->storage.rank.device_pointer, &task->storage.XtWX.device_pointer, &task->storage.XtWY.device_pointer, &task->filter_area, &task->reconstruction_state.buffer_params.x, &task->render_buffer.samples}; CUDA_GET_BLOCKSIZE(cuFinalize, task->reconstruction_state.source_w, task->reconstruction_state.source_h); CUDA_LAUNCH_KERNEL(cuFinalize, finalize_args); } cuda_assert(cuCtxSynchronize()); return !have_error(); } bool denoising_combine_halves(device_ptr a_ptr, device_ptr b_ptr, device_ptr mean_ptr, device_ptr variance_ptr, int r, int4 rect, DenoisingTask *task) { if(have_error()) return false; CUDAContextScope scope(this); CUfunction cuFilterCombineHalves; cuda_assert(cuModuleGetFunction(&cuFilterCombineHalves, cuFilterModule, "kernel_cuda_filter_combine_halves")); cuda_assert(cuFuncSetCacheConfig(cuFilterCombineHalves, CU_FUNC_CACHE_PREFER_L1)); CUDA_GET_BLOCKSIZE(cuFilterCombineHalves, task->rect.z-task->rect.x, task->rect.w-task->rect.y); void *args[] = {&mean_ptr, &variance_ptr, &a_ptr, &b_ptr, &rect, &r}; CUDA_LAUNCH_KERNEL(cuFilterCombineHalves, args); cuda_assert(cuCtxSynchronize()); return !have_error(); } bool denoising_divide_shadow(device_ptr a_ptr, device_ptr b_ptr, device_ptr sample_variance_ptr, device_ptr sv_variance_ptr, device_ptr buffer_variance_ptr, DenoisingTask *task) { if(have_error()) return false; CUDAContextScope scope(this); CUfunction cuFilterDivideShadow; cuda_assert(cuModuleGetFunction(&cuFilterDivideShadow, cuFilterModule, "kernel_cuda_filter_divide_shadow")); cuda_assert(cuFuncSetCacheConfig(cuFilterDivideShadow, CU_FUNC_CACHE_PREFER_L1)); CUDA_GET_BLOCKSIZE(cuFilterDivideShadow, task->rect.z-task->rect.x, task->rect.w-task->rect.y); void *args[] = {&task->render_buffer.samples, &task->tiles_mem.device_pointer, &a_ptr, &b_ptr, &sample_variance_ptr, &sv_variance_ptr, &buffer_variance_ptr, &task->rect, &task->render_buffer.pass_stride, &task->render_buffer.denoising_data_offset}; CUDA_LAUNCH_KERNEL(cuFilterDivideShadow, args); cuda_assert(cuCtxSynchronize()); return !have_error(); } bool denoising_get_feature(int mean_offset, int variance_offset, device_ptr mean_ptr, device_ptr variance_ptr, DenoisingTask *task) { if(have_error()) return false; CUDAContextScope scope(this); CUfunction cuFilterGetFeature; cuda_assert(cuModuleGetFunction(&cuFilterGetFeature, cuFilterModule, "kernel_cuda_filter_get_feature")); cuda_assert(cuFuncSetCacheConfig(cuFilterGetFeature, CU_FUNC_CACHE_PREFER_L1)); CUDA_GET_BLOCKSIZE(cuFilterGetFeature, task->rect.z-task->rect.x, task->rect.w-task->rect.y); void *args[] = {&task->render_buffer.samples, &task->tiles_mem.device_pointer, &mean_offset, &variance_offset, &mean_ptr, &variance_ptr, &task->rect, &task->render_buffer.pass_stride, &task->render_buffer.denoising_data_offset}; CUDA_LAUNCH_KERNEL(cuFilterGetFeature, args); cuda_assert(cuCtxSynchronize()); return !have_error(); } bool denoising_detect_outliers(device_ptr image_ptr, device_ptr variance_ptr, device_ptr depth_ptr, device_ptr output_ptr, DenoisingTask *task) { if(have_error()) return false; CUDAContextScope scope(this); CUfunction cuFilterDetectOutliers; cuda_assert(cuModuleGetFunction(&cuFilterDetectOutliers, cuFilterModule, "kernel_cuda_filter_detect_outliers")); cuda_assert(cuFuncSetCacheConfig(cuFilterDetectOutliers, CU_FUNC_CACHE_PREFER_L1)); CUDA_GET_BLOCKSIZE(cuFilterDetectOutliers, task->rect.z-task->rect.x, task->rect.w-task->rect.y); void *args[] = {&image_ptr, &variance_ptr, &depth_ptr, &output_ptr, &task->rect, &task->buffer.pass_stride}; CUDA_LAUNCH_KERNEL(cuFilterDetectOutliers, args); cuda_assert(cuCtxSynchronize()); return !have_error(); } void denoise(RenderTile &rtile, DenoisingTask& denoising, const DeviceTask &task) { denoising.functions.construct_transform = function_bind(&CUDADevice::denoising_construct_transform, this, &denoising); denoising.functions.reconstruct = function_bind(&CUDADevice::denoising_reconstruct, this, _1, _2, _3, &denoising); denoising.functions.divide_shadow = function_bind(&CUDADevice::denoising_divide_shadow, this, _1, _2, _3, _4, _5, &denoising); denoising.functions.non_local_means = function_bind(&CUDADevice::denoising_non_local_means, this, _1, _2, _3, _4, &denoising); denoising.functions.combine_halves = function_bind(&CUDADevice::denoising_combine_halves, this, _1, _2, _3, _4, _5, _6, &denoising); denoising.functions.get_feature = function_bind(&CUDADevice::denoising_get_feature, this, _1, _2, _3, _4, &denoising); denoising.functions.detect_outliers = function_bind(&CUDADevice::denoising_detect_outliers, this, _1, _2, _3, _4, &denoising); denoising.functions.set_tiles = function_bind(&CUDADevice::denoising_set_tiles, this, _1, &denoising); denoising.filter_area = make_int4(rtile.x, rtile.y, rtile.w, rtile.h); denoising.render_buffer.samples = rtile.sample; RenderTile rtiles[9]; rtiles[4] = rtile; task.map_neighbor_tiles(rtiles, this); denoising.tiles_from_rendertiles(rtiles); denoising.init_from_devicetask(task); denoising.run_denoising(); task.unmap_neighbor_tiles(rtiles, this); } void path_trace(DeviceTask& task, RenderTile& rtile, device_vector& work_tiles) { scoped_timer timer(&rtile.buffers->render_time); if(have_error()) return; CUDAContextScope scope(this); CUfunction cuPathTrace; /* Get kernel function. */ if(task.integrator_branched) { cuda_assert(cuModuleGetFunction(&cuPathTrace, cuModule, "kernel_cuda_branched_path_trace")); } else { cuda_assert(cuModuleGetFunction(&cuPathTrace, cuModule, "kernel_cuda_path_trace")); } if(have_error()) { return; } cuda_assert(cuFuncSetCacheConfig(cuPathTrace, CU_FUNC_CACHE_PREFER_L1)); /* Allocate work tile. */ work_tiles.alloc(1); WorkTile *wtile = work_tiles.data(); wtile->x = rtile.x; wtile->y = rtile.y; wtile->w = rtile.w; wtile->h = rtile.h; wtile->offset = rtile.offset; wtile->stride = rtile.stride; wtile->buffer = (float*)cuda_device_ptr(rtile.buffer); /* Prepare work size. More step samples render faster, but for now we * remain conservative for GPUs connected to a display to avoid driver * timeouts and display freezing. */ int min_blocks, num_threads_per_block; cuda_assert(cuOccupancyMaxPotentialBlockSize(&min_blocks, &num_threads_per_block, cuPathTrace, NULL, 0, 0)); if(!info.display_device) { min_blocks *= 8; } uint step_samples = divide_up(min_blocks * num_threads_per_block, wtile->w * wtile->h);; /* Render all samples. */ int start_sample = rtile.start_sample; int end_sample = rtile.start_sample + rtile.num_samples; for(int sample = start_sample; sample < end_sample; sample += step_samples) { /* Setup and copy work tile to device. */ wtile->start_sample = sample; wtile->num_samples = min(step_samples, end_sample - sample);; work_tiles.copy_to_device(); CUdeviceptr d_work_tiles = cuda_device_ptr(work_tiles.device_pointer); uint total_work_size = wtile->w * wtile->h * wtile->num_samples; uint num_blocks = divide_up(total_work_size, num_threads_per_block); /* Launch kernel. */ void *args[] = {&d_work_tiles, &total_work_size}; cuda_assert(cuLaunchKernel(cuPathTrace, num_blocks, 1, 1, num_threads_per_block, 1, 1, 0, 0, args, 0)); cuda_assert(cuCtxSynchronize()); /* Update progress. */ rtile.sample = sample + wtile->num_samples; task.update_progress(&rtile, rtile.w*rtile.h*wtile->num_samples); if(task.get_cancel()) { if(task.need_finish_queue == false) break; } } } void film_convert(DeviceTask& task, device_ptr buffer, device_ptr rgba_byte, device_ptr rgba_half) { if(have_error()) return; CUDAContextScope scope(this); CUfunction cuFilmConvert; CUdeviceptr d_rgba = map_pixels((rgba_byte)? rgba_byte: rgba_half); CUdeviceptr d_buffer = cuda_device_ptr(buffer); /* get kernel function */ if(rgba_half) { cuda_assert(cuModuleGetFunction(&cuFilmConvert, cuModule, "kernel_cuda_convert_to_half_float")); } else { cuda_assert(cuModuleGetFunction(&cuFilmConvert, cuModule, "kernel_cuda_convert_to_byte")); } float sample_scale = 1.0f/(task.sample + 1); /* pass in parameters */ void *args[] = {&d_rgba, &d_buffer, &sample_scale, &task.x, &task.y, &task.w, &task.h, &task.offset, &task.stride}; /* launch kernel */ int threads_per_block; cuda_assert(cuFuncGetAttribute(&threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, cuFilmConvert)); int xthreads = (int)sqrt(threads_per_block); int ythreads = (int)sqrt(threads_per_block); int xblocks = (task.w + xthreads - 1)/xthreads; int yblocks = (task.h + ythreads - 1)/ythreads; cuda_assert(cuFuncSetCacheConfig(cuFilmConvert, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuLaunchKernel(cuFilmConvert, xblocks , yblocks, 1, /* blocks */ xthreads, ythreads, 1, /* threads */ 0, 0, args, 0)); unmap_pixels((rgba_byte)? rgba_byte: rgba_half); cuda_assert(cuCtxSynchronize()); } void shader(DeviceTask& task) { if(have_error()) return; CUDAContextScope scope(this); CUfunction cuShader; CUdeviceptr d_input = cuda_device_ptr(task.shader_input); CUdeviceptr d_output = cuda_device_ptr(task.shader_output); /* get kernel function */ if(task.shader_eval_type >= SHADER_EVAL_BAKE) { cuda_assert(cuModuleGetFunction(&cuShader, cuModule, "kernel_cuda_bake")); } else if(task.shader_eval_type == SHADER_EVAL_DISPLACE) { cuda_assert(cuModuleGetFunction(&cuShader, cuModule, "kernel_cuda_displace")); } else { cuda_assert(cuModuleGetFunction(&cuShader, cuModule, "kernel_cuda_background")); } /* do tasks in smaller chunks, so we can cancel it */ const int shader_chunk_size = 65536; const int start = task.shader_x; const int end = task.shader_x + task.shader_w; int offset = task.offset; bool canceled = false; for(int sample = 0; sample < task.num_samples && !canceled; sample++) { for(int shader_x = start; shader_x < end; shader_x += shader_chunk_size) { int shader_w = min(shader_chunk_size, end - shader_x); /* pass in parameters */ void *args[8]; int arg = 0; args[arg++] = &d_input; args[arg++] = &d_output; args[arg++] = &task.shader_eval_type; if(task.shader_eval_type >= SHADER_EVAL_BAKE) { args[arg++] = &task.shader_filter; } args[arg++] = &shader_x; args[arg++] = &shader_w; args[arg++] = &offset; args[arg++] = &sample; /* launch kernel */ int threads_per_block; cuda_assert(cuFuncGetAttribute(&threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, cuShader)); int xblocks = (shader_w + threads_per_block - 1)/threads_per_block; cuda_assert(cuFuncSetCacheConfig(cuShader, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuLaunchKernel(cuShader, xblocks , 1, 1, /* blocks */ threads_per_block, 1, 1, /* threads */ 0, 0, args, 0)); cuda_assert(cuCtxSynchronize()); if(task.get_cancel()) { canceled = true; break; } } task.update_progress(NULL); } } CUdeviceptr map_pixels(device_ptr mem) { if(!background) { PixelMem pmem = pixel_mem_map[mem]; CUdeviceptr buffer; size_t bytes; cuda_assert(cuGraphicsMapResources(1, &pmem.cuPBOresource, 0)); cuda_assert(cuGraphicsResourceGetMappedPointer(&buffer, &bytes, pmem.cuPBOresource)); return buffer; } return cuda_device_ptr(mem); } void unmap_pixels(device_ptr mem) { if(!background) { PixelMem pmem = pixel_mem_map[mem]; cuda_assert(cuGraphicsUnmapResources(1, &pmem.cuPBOresource, 0)); } } void pixels_alloc(device_memory& mem) { PixelMem pmem; pmem.w = mem.data_width; pmem.h = mem.data_height; CUDAContextScope scope(this); glGenBuffers(1, &pmem.cuPBO); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pmem.cuPBO); if(mem.data_type == TYPE_HALF) glBufferData(GL_PIXEL_UNPACK_BUFFER, pmem.w*pmem.h*sizeof(GLhalf)*4, NULL, GL_DYNAMIC_DRAW); else glBufferData(GL_PIXEL_UNPACK_BUFFER, pmem.w*pmem.h*sizeof(uint8_t)*4, NULL, GL_DYNAMIC_DRAW); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); glGenTextures(1, &pmem.cuTexId); glBindTexture(GL_TEXTURE_2D, pmem.cuTexId); if(mem.data_type == TYPE_HALF) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, pmem.w, pmem.h, 0, GL_RGBA, GL_HALF_FLOAT, NULL); else glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, pmem.w, pmem.h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glBindTexture(GL_TEXTURE_2D, 0); CUresult result = cuGraphicsGLRegisterBuffer(&pmem.cuPBOresource, pmem.cuPBO, CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE); if(result == CUDA_SUCCESS) { mem.device_pointer = pmem.cuTexId; pixel_mem_map[mem.device_pointer] = pmem; mem.device_size = mem.memory_size(); stats.mem_alloc(mem.device_size); return; } else { /* failed to register buffer, fallback to no interop */ glDeleteBuffers(1, &pmem.cuPBO); glDeleteTextures(1, &pmem.cuTexId); background = true; } } void pixels_copy_from(device_memory& mem, int y, int w, int h) { PixelMem pmem = pixel_mem_map[mem.device_pointer]; CUDAContextScope scope(this); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pmem.cuPBO); uchar *pixels = (uchar*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_ONLY); size_t offset = sizeof(uchar)*4*y*w; memcpy((uchar*)mem.host_pointer + offset, pixels + offset, sizeof(uchar)*4*w*h); glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); } void pixels_free(device_memory& mem) { if(mem.device_pointer) { PixelMem pmem = pixel_mem_map[mem.device_pointer]; CUDAContextScope scope(this); cuda_assert(cuGraphicsUnregisterResource(pmem.cuPBOresource)); glDeleteBuffers(1, &pmem.cuPBO); glDeleteTextures(1, &pmem.cuTexId); pixel_mem_map.erase(pixel_mem_map.find(mem.device_pointer)); mem.device_pointer = 0; stats.mem_free(mem.device_size); mem.device_size = 0; } } void draw_pixels(device_memory& mem, int y, int w, int h, int dx, int dy, int width, int height, bool transparent, const DeviceDrawParams &draw_params) { assert(mem.type == MEM_PIXELS); if(!background) { PixelMem pmem = pixel_mem_map[mem.device_pointer]; float *vpointer; CUDAContextScope scope(this); /* for multi devices, this assumes the inefficient method that we allocate * all pixels on the device even though we only render to a subset */ size_t offset = 4*y*w; if(mem.data_type == TYPE_HALF) offset *= sizeof(GLhalf); else offset *= sizeof(uint8_t); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pmem.cuPBO); glBindTexture(GL_TEXTURE_2D, pmem.cuTexId); if(mem.data_type == TYPE_HALF) glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_HALF_FLOAT, (void*)offset); else glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, (void*)offset); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); glEnable(GL_TEXTURE_2D); if(transparent) { glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); } glColor3f(1.0f, 1.0f, 1.0f); if(draw_params.bind_display_space_shader_cb) { draw_params.bind_display_space_shader_cb(); } if(!vertex_buffer) glGenBuffers(1, &vertex_buffer); glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); /* invalidate old contents - avoids stalling if buffer is still waiting in queue to be rendered */ glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(float), NULL, GL_STREAM_DRAW); vpointer = (float *)glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); if(vpointer) { /* texture coordinate - vertex pair */ vpointer[0] = 0.0f; vpointer[1] = 0.0f; vpointer[2] = dx; vpointer[3] = dy; vpointer[4] = (float)w/(float)pmem.w; vpointer[5] = 0.0f; vpointer[6] = (float)width + dx; vpointer[7] = dy; vpointer[8] = (float)w/(float)pmem.w; vpointer[9] = (float)h/(float)pmem.h; vpointer[10] = (float)width + dx; vpointer[11] = (float)height + dy; vpointer[12] = 0.0f; vpointer[13] = (float)h/(float)pmem.h; vpointer[14] = dx; vpointer[15] = (float)height + dy; glUnmapBuffer(GL_ARRAY_BUFFER); } glTexCoordPointer(2, GL_FLOAT, 4 * sizeof(float), 0); glVertexPointer(2, GL_FLOAT, 4 * sizeof(float), (char *)NULL + 2 * sizeof(float)); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); glBindBuffer(GL_ARRAY_BUFFER, 0); if(draw_params.unbind_display_space_shader_cb) { draw_params.unbind_display_space_shader_cb(); } if(transparent) glDisable(GL_BLEND); glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D); return; } Device::draw_pixels(mem, y, w, h, dx, dy, width, height, transparent, draw_params); } void thread_run(DeviceTask *task) { CUDAContextScope scope(this); if(task->type == DeviceTask::RENDER) { DeviceRequestedFeatures requested_features; if(use_split_kernel()) { if(split_kernel == NULL) { split_kernel = new CUDASplitKernel(this); split_kernel->load_kernels(requested_features); } } device_vector work_tiles(this, "work_tiles", MEM_READ_ONLY); /* keep rendering tiles until done */ RenderTile tile; DenoisingTask denoising(this); while(task->acquire_tile(this, tile)) { if(tile.task == RenderTile::PATH_TRACE) { if(use_split_kernel()) { device_only_memory void_buffer(this, "void_buffer"); split_kernel->path_trace(task, tile, void_buffer, void_buffer); } else { path_trace(*task, tile, work_tiles); } } else if(tile.task == RenderTile::DENOISE) { tile.sample = tile.start_sample + tile.num_samples; denoise(tile, denoising, *task); task->update_progress(&tile, tile.w*tile.h); } task->release_tile(tile); if(task->get_cancel()) { if(task->need_finish_queue == false) break; } } work_tiles.free(); } else if(task->type == DeviceTask::SHADER) { shader(*task); cuda_assert(cuCtxSynchronize()); } } class CUDADeviceTask : public DeviceTask { public: CUDADeviceTask(CUDADevice *device, DeviceTask& task) : DeviceTask(task) { run = function_bind(&CUDADevice::thread_run, device, this); } }; int get_split_task_count(DeviceTask& /*task*/) { return 1; } void task_add(DeviceTask& task) { CUDAContextScope scope(this); /* Load texture info. */ load_texture_info(); /* Synchronize all memory copies before executing task. */ cuda_assert(cuCtxSynchronize()); if(task.type == DeviceTask::FILM_CONVERT) { /* must be done in main thread due to opengl access */ film_convert(task, task.buffer, task.rgba_byte, task.rgba_half); } else { task_pool.push(new CUDADeviceTask(this, task)); } } void task_wait() { task_pool.wait(); } void task_cancel() { task_pool.cancel(); } friend class CUDASplitKernelFunction; friend class CUDASplitKernel; friend class CUDAContextScope; }; /* redefine the cuda_assert macro so it can be used outside of the CUDADevice class * now that the definition of that class is complete */ #undef cuda_assert #define cuda_assert(stmt) \ { \ CUresult result = stmt; \ \ if(result != CUDA_SUCCESS) { \ string message = string_printf("CUDA error: %s in %s", cuewErrorString(result), #stmt); \ if(device->error_msg == "") \ device->error_msg = message; \ fprintf(stderr, "%s\n", message.c_str()); \ /*cuda_abort();*/ \ device->cuda_error_documentation(); \ } \ } (void)0 /* CUDA context scope. */ CUDAContextScope::CUDAContextScope(CUDADevice *device) : device(device) { cuda_assert(cuCtxPushCurrent(device->cuContext)); } CUDAContextScope::~CUDAContextScope() { cuda_assert(cuCtxPopCurrent(NULL)); } /* split kernel */ class CUDASplitKernelFunction : public SplitKernelFunction{ CUDADevice* device; CUfunction func; public: CUDASplitKernelFunction(CUDADevice *device, CUfunction func) : device(device), func(func) {} /* enqueue the kernel, returns false if there is an error */ bool enqueue(const KernelDimensions &dim, device_memory &/*kg*/, device_memory &/*data*/) { return enqueue(dim, NULL); } /* enqueue the kernel, returns false if there is an error */ bool enqueue(const KernelDimensions &dim, void *args[]) { if(device->have_error()) return false; CUDAContextScope scope(device); /* we ignore dim.local_size for now, as this is faster */ int threads_per_block; cuda_assert(cuFuncGetAttribute(&threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, func)); int xblocks = (dim.global_size[0]*dim.global_size[1] + threads_per_block - 1)/threads_per_block; cuda_assert(cuFuncSetCacheConfig(func, CU_FUNC_CACHE_PREFER_L1)); cuda_assert(cuLaunchKernel(func, xblocks, 1, 1, /* blocks */ threads_per_block, 1, 1, /* threads */ 0, 0, args, 0)); return !device->have_error(); } }; CUDASplitKernel::CUDASplitKernel(CUDADevice *device) : DeviceSplitKernel(device), device(device) { } uint64_t CUDASplitKernel::state_buffer_size(device_memory& /*kg*/, device_memory& /*data*/, size_t num_threads) { CUDAContextScope scope(device); device_vector size_buffer(device, "size_buffer", MEM_READ_WRITE); size_buffer.alloc(1); size_buffer.zero_to_device(); uint threads = num_threads; CUdeviceptr d_size = device->cuda_device_ptr(size_buffer.device_pointer); struct args_t { uint* num_threads; CUdeviceptr* size; }; args_t args = { &threads, &d_size }; CUfunction state_buffer_size; cuda_assert(cuModuleGetFunction(&state_buffer_size, device->cuModule, "kernel_cuda_state_buffer_size")); cuda_assert(cuLaunchKernel(state_buffer_size, 1, 1, 1, 1, 1, 1, 0, 0, (void**)&args, 0)); size_buffer.copy_from_device(0, 1, 1); size_t size = size_buffer[0]; size_buffer.free(); return size; } bool CUDASplitKernel::enqueue_split_kernel_data_init(const KernelDimensions& dim, RenderTile& rtile, int num_global_elements, device_memory& /*kernel_globals*/, device_memory& /*kernel_data*/, device_memory& split_data, device_memory& ray_state, device_memory& queue_index, device_memory& use_queues_flag, device_memory& work_pool_wgs) { CUDAContextScope scope(device); CUdeviceptr d_split_data = device->cuda_device_ptr(split_data.device_pointer); CUdeviceptr d_ray_state = device->cuda_device_ptr(ray_state.device_pointer); CUdeviceptr d_queue_index = device->cuda_device_ptr(queue_index.device_pointer); CUdeviceptr d_use_queues_flag = device->cuda_device_ptr(use_queues_flag.device_pointer); CUdeviceptr d_work_pool_wgs = device->cuda_device_ptr(work_pool_wgs.device_pointer); CUdeviceptr d_buffer = device->cuda_device_ptr(rtile.buffer); int end_sample = rtile.start_sample + rtile.num_samples; int queue_size = dim.global_size[0] * dim.global_size[1]; struct args_t { CUdeviceptr* split_data_buffer; int* num_elements; CUdeviceptr* ray_state; int* start_sample; int* end_sample; int* sx; int* sy; int* sw; int* sh; int* offset; int* stride; CUdeviceptr* queue_index; int* queuesize; CUdeviceptr* use_queues_flag; CUdeviceptr* work_pool_wgs; int* num_samples; CUdeviceptr* buffer; }; args_t args = { &d_split_data, &num_global_elements, &d_ray_state, &rtile.start_sample, &end_sample, &rtile.x, &rtile.y, &rtile.w, &rtile.h, &rtile.offset, &rtile.stride, &d_queue_index, &queue_size, &d_use_queues_flag, &d_work_pool_wgs, &rtile.num_samples, &d_buffer }; CUfunction data_init; cuda_assert(cuModuleGetFunction(&data_init, device->cuModule, "kernel_cuda_path_trace_data_init")); if(device->have_error()) { return false; } CUDASplitKernelFunction(device, data_init).enqueue(dim, (void**)&args); return !device->have_error(); } SplitKernelFunction* CUDASplitKernel::get_split_kernel_function(const string& kernel_name, const DeviceRequestedFeatures&) { CUDAContextScope scope(device); CUfunction func; cuda_assert(cuModuleGetFunction(&func, device->cuModule, (string("kernel_cuda_") + kernel_name).data())); if(device->have_error()) { device->cuda_error_message(string_printf("kernel \"kernel_cuda_%s\" not found in module", kernel_name.data())); return NULL; } return new CUDASplitKernelFunction(device, func); } int2 CUDASplitKernel::split_kernel_local_size() { return make_int2(32, 1); } int2 CUDASplitKernel::split_kernel_global_size(device_memory& kg, device_memory& data, DeviceTask * /*task*/) { CUDAContextScope scope(device); size_t free; size_t total; cuda_assert(cuMemGetInfo(&free, &total)); VLOG(1) << "Maximum device allocation size: " << string_human_readable_number(free) << " bytes. (" << string_human_readable_size(free) << ")."; size_t num_elements = max_elements_for_max_buffer_size(kg, data, free / 2); size_t side = round_down((int)sqrt(num_elements), 32); int2 global_size = make_int2(side, round_down(num_elements / side, 16)); VLOG(1) << "Global size: " << global_size << "."; return global_size; } bool device_cuda_init(void) { #ifdef WITH_CUDA_DYNLOAD static bool initialized = false; static bool result = false; if(initialized) return result; initialized = true; int cuew_result = cuewInit(CUEW_INIT_CUDA); if(cuew_result == CUEW_SUCCESS) { VLOG(1) << "CUEW initialization succeeded"; if(CUDADevice::have_precompiled_kernels()) { VLOG(1) << "Found precompiled kernels"; result = true; } #ifndef _WIN32 else if(cuewCompilerPath() != NULL) { VLOG(1) << "Found CUDA compiler " << cuewCompilerPath(); result = true; } else { VLOG(1) << "Neither precompiled kernels nor CUDA compiler wad found," << " unable to use CUDA"; } #endif } else { VLOG(1) << "CUEW initialization failed: " << ((cuew_result == CUEW_ERROR_ATEXIT_FAILED) ? "Error setting up atexit() handler" : "Error opening the library"); } return result; #else /* WITH_CUDA_DYNLOAD */ return true; #endif /* WITH_CUDA_DYNLOAD */ } Device *device_cuda_create(DeviceInfo& info, Stats &stats, bool background) { return new CUDADevice(info, stats, background); } static CUresult device_cuda_safe_init() { #ifdef _WIN32 __try { return cuInit(0); } __except(EXCEPTION_EXECUTE_HANDLER) { /* Ignore crashes inside the CUDA driver and hope we can * survive even with corrupted CUDA installs. */ fprintf(stderr, "Cycles CUDA: driver crashed, continuing without CUDA.\n"); } return CUDA_ERROR_NO_DEVICE; #else return cuInit(0); #endif } void device_cuda_info(vector& devices) { CUresult result = device_cuda_safe_init(); if(result != CUDA_SUCCESS) { if(result != CUDA_ERROR_NO_DEVICE) fprintf(stderr, "CUDA cuInit: %s\n", cuewErrorString(result)); return; } int count = 0; result = cuDeviceGetCount(&count); if(result != CUDA_SUCCESS) { fprintf(stderr, "CUDA cuDeviceGetCount: %s\n", cuewErrorString(result)); return; } vector display_devices; for(int num = 0; num < count; num++) { char name[256]; result = cuDeviceGetName(name, 256, num); if(result != CUDA_SUCCESS) { fprintf(stderr, "CUDA cuDeviceGetName: %s\n", cuewErrorString(result)); continue; } int major; cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, num); if(major < 3) { VLOG(1) << "Ignoring device \"" << name << "\", this graphics card is no longer supported."; continue; } DeviceInfo info; info.type = DEVICE_CUDA; info.description = string(name); info.num = num; info.advanced_shading = (major >= 3); info.has_half_images = (major >= 3); info.has_volume_decoupled = false; info.bvh_layout_mask = BVH_LAYOUT_BVH2; int pci_location[3] = {0, 0, 0}; cuDeviceGetAttribute(&pci_location[0], CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, num); cuDeviceGetAttribute(&pci_location[1], CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, num); cuDeviceGetAttribute(&pci_location[2], CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, num); info.id = string_printf("CUDA_%s_%04x:%02x:%02x", name, (unsigned int)pci_location[0], (unsigned int)pci_location[1], (unsigned int)pci_location[2]); /* If device has a kernel timeout and no compute preemption, we assume * it is connected to a display and will freeze the display while doing * computations. */ int timeout_attr = 0, preempt_attr = 0; cuDeviceGetAttribute(&timeout_attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num); cuDeviceGetAttribute(&preempt_attr, CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, num); if(timeout_attr && !preempt_attr) { VLOG(1) << "Device is recognized as display."; info.description += " (Display)"; info.display_device = true; display_devices.push_back(info); } else { devices.push_back(info); } VLOG(1) << "Added device \"" << name << "\" with id \"" << info.id << "\"."; } if(!display_devices.empty()) devices.insert(devices.end(), display_devices.begin(), display_devices.end()); } string device_cuda_capabilities(void) { CUresult result = device_cuda_safe_init(); if(result != CUDA_SUCCESS) { if(result != CUDA_ERROR_NO_DEVICE) { return string("Error initializing CUDA: ") + cuewErrorString(result); } return "No CUDA device found\n"; } int count; result = cuDeviceGetCount(&count); if(result != CUDA_SUCCESS) { return string("Error getting devices: ") + cuewErrorString(result); } string capabilities = ""; for(int num = 0; num < count; num++) { char name[256]; if(cuDeviceGetName(name, 256, num) != CUDA_SUCCESS) { continue; } capabilities += string("\t") + name + "\n"; int value; #define GET_ATTR(attr) \ { \ if(cuDeviceGetAttribute(&value, \ CU_DEVICE_ATTRIBUTE_##attr, \ num) == CUDA_SUCCESS) \ { \ capabilities += string_printf("\t\tCU_DEVICE_ATTRIBUTE_" #attr "\t\t\t%d\n", \ value); \ } \ } (void)0 /* TODO(sergey): Strip all attributes which are not useful for us * or does not depend on the driver. */ GET_ATTR(MAX_THREADS_PER_BLOCK); GET_ATTR(MAX_BLOCK_DIM_X); GET_ATTR(MAX_BLOCK_DIM_Y); GET_ATTR(MAX_BLOCK_DIM_Z); GET_ATTR(MAX_GRID_DIM_X); GET_ATTR(MAX_GRID_DIM_Y); GET_ATTR(MAX_GRID_DIM_Z); GET_ATTR(MAX_SHARED_MEMORY_PER_BLOCK); GET_ATTR(SHARED_MEMORY_PER_BLOCK); GET_ATTR(TOTAL_CONSTANT_MEMORY); GET_ATTR(WARP_SIZE); GET_ATTR(MAX_PITCH); GET_ATTR(MAX_REGISTERS_PER_BLOCK); GET_ATTR(REGISTERS_PER_BLOCK); GET_ATTR(CLOCK_RATE); GET_ATTR(TEXTURE_ALIGNMENT); GET_ATTR(GPU_OVERLAP); GET_ATTR(MULTIPROCESSOR_COUNT); GET_ATTR(KERNEL_EXEC_TIMEOUT); GET_ATTR(INTEGRATED); GET_ATTR(CAN_MAP_HOST_MEMORY); GET_ATTR(COMPUTE_MODE); GET_ATTR(MAXIMUM_TEXTURE1D_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_HEIGHT); GET_ATTR(MAXIMUM_TEXTURE3D_WIDTH); GET_ATTR(MAXIMUM_TEXTURE3D_HEIGHT); GET_ATTR(MAXIMUM_TEXTURE3D_DEPTH); GET_ATTR(MAXIMUM_TEXTURE2D_LAYERED_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_LAYERED_HEIGHT); GET_ATTR(MAXIMUM_TEXTURE2D_LAYERED_LAYERS); GET_ATTR(MAXIMUM_TEXTURE2D_ARRAY_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_ARRAY_HEIGHT); GET_ATTR(MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES); GET_ATTR(SURFACE_ALIGNMENT); GET_ATTR(CONCURRENT_KERNELS); GET_ATTR(ECC_ENABLED); GET_ATTR(TCC_DRIVER); GET_ATTR(MEMORY_CLOCK_RATE); GET_ATTR(GLOBAL_MEMORY_BUS_WIDTH); GET_ATTR(L2_CACHE_SIZE); GET_ATTR(MAX_THREADS_PER_MULTIPROCESSOR); GET_ATTR(ASYNC_ENGINE_COUNT); GET_ATTR(UNIFIED_ADDRESSING); GET_ATTR(MAXIMUM_TEXTURE1D_LAYERED_WIDTH); GET_ATTR(MAXIMUM_TEXTURE1D_LAYERED_LAYERS); GET_ATTR(CAN_TEX2D_GATHER); GET_ATTR(MAXIMUM_TEXTURE2D_GATHER_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_GATHER_HEIGHT); GET_ATTR(MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE); GET_ATTR(MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE); GET_ATTR(MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE); GET_ATTR(TEXTURE_PITCH_ALIGNMENT); GET_ATTR(MAXIMUM_TEXTURECUBEMAP_WIDTH); GET_ATTR(MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH); GET_ATTR(MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS); GET_ATTR(MAXIMUM_SURFACE1D_WIDTH); GET_ATTR(MAXIMUM_SURFACE2D_WIDTH); GET_ATTR(MAXIMUM_SURFACE2D_HEIGHT); GET_ATTR(MAXIMUM_SURFACE3D_WIDTH); GET_ATTR(MAXIMUM_SURFACE3D_HEIGHT); GET_ATTR(MAXIMUM_SURFACE3D_DEPTH); GET_ATTR(MAXIMUM_SURFACE1D_LAYERED_WIDTH); GET_ATTR(MAXIMUM_SURFACE1D_LAYERED_LAYERS); GET_ATTR(MAXIMUM_SURFACE2D_LAYERED_WIDTH); GET_ATTR(MAXIMUM_SURFACE2D_LAYERED_HEIGHT); GET_ATTR(MAXIMUM_SURFACE2D_LAYERED_LAYERS); GET_ATTR(MAXIMUM_SURFACECUBEMAP_WIDTH); GET_ATTR(MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH); GET_ATTR(MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS); GET_ATTR(MAXIMUM_TEXTURE1D_LINEAR_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_LINEAR_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_LINEAR_HEIGHT); GET_ATTR(MAXIMUM_TEXTURE2D_LINEAR_PITCH); GET_ATTR(MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH); GET_ATTR(MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT); GET_ATTR(COMPUTE_CAPABILITY_MAJOR); GET_ATTR(COMPUTE_CAPABILITY_MINOR); GET_ATTR(MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH); GET_ATTR(STREAM_PRIORITIES_SUPPORTED); GET_ATTR(GLOBAL_L1_CACHE_SUPPORTED); GET_ATTR(LOCAL_L1_CACHE_SUPPORTED); GET_ATTR(MAX_SHARED_MEMORY_PER_MULTIPROCESSOR); GET_ATTR(MAX_REGISTERS_PER_MULTIPROCESSOR); GET_ATTR(MANAGED_MEMORY); GET_ATTR(MULTI_GPU_BOARD); GET_ATTR(MULTI_GPU_BOARD_GROUP_ID); #undef GET_ATTR capabilities += "\n"; } return capabilities; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device_denoising.cpp000066400000000000000000000233171334742672700236440ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device_denoising.h" #include "kernel/filter/filter_defines.h" CCL_NAMESPACE_BEGIN DenoisingTask::DenoisingTask(Device *device) : tiles_mem(device, "denoising tiles_mem", MEM_READ_WRITE), storage(device), buffer(device), device(device) { } DenoisingTask::~DenoisingTask() { storage.XtWX.free(); storage.XtWY.free(); storage.transform.free(); storage.rank.free(); storage.temporary_1.free(); storage.temporary_2.free(); storage.temporary_color.free(); buffer.mem.free(); tiles_mem.free(); } void DenoisingTask::init_from_devicetask(const DeviceTask &task) { radius = task.denoising_radius; nlm_k_2 = powf(2.0f, lerp(-5.0f, 3.0f, task.denoising_strength)); if(task.denoising_relative_pca) { pca_threshold = -powf(10.0f, lerp(-8.0f, 0.0f, task.denoising_feature_strength)); } else { pca_threshold = powf(10.0f, lerp(-5.0f, 3.0f, task.denoising_feature_strength)); } render_buffer.pass_stride = task.pass_stride; render_buffer.denoising_data_offset = task.pass_denoising_data; render_buffer.denoising_clean_offset = task.pass_denoising_clean; /* Expand filter_area by radius pixels and clamp the result to the extent of the neighboring tiles */ rect = rect_from_shape(filter_area.x, filter_area.y, filter_area.z, filter_area.w); rect = rect_expand(rect, radius); rect = rect_clip(rect, make_int4(tiles->x[0], tiles->y[0], tiles->x[3], tiles->y[3])); } void DenoisingTask::tiles_from_rendertiles(RenderTile *rtiles) { tiles = (TilesInfo*) tiles_mem.alloc(sizeof(TilesInfo)/sizeof(int)); device_ptr buffers[9]; for(int i = 0; i < 9; i++) { buffers[i] = rtiles[i].buffer; tiles->offsets[i] = rtiles[i].offset; tiles->strides[i] = rtiles[i].stride; } tiles->x[0] = rtiles[3].x; tiles->x[1] = rtiles[4].x; tiles->x[2] = rtiles[5].x; tiles->x[3] = rtiles[5].x + rtiles[5].w; tiles->y[0] = rtiles[1].y; tiles->y[1] = rtiles[4].y; tiles->y[2] = rtiles[7].y; tiles->y[3] = rtiles[7].y + rtiles[7].h; render_buffer.offset = rtiles[4].offset; render_buffer.stride = rtiles[4].stride; render_buffer.ptr = rtiles[4].buffer; functions.set_tiles(buffers); } bool DenoisingTask::run_denoising() { /* Allocate denoising buffer. */ buffer.passes = 14; buffer.width = rect.z - rect.x; buffer.stride = align_up(buffer.width, 4); buffer.h = rect.w - rect.y; buffer.pass_stride = align_up(buffer.stride * buffer.h, divide_up(device->mem_sub_ptr_alignment(), sizeof(float))); buffer.mem.alloc_to_device(buffer.pass_stride * buffer.passes, false); device_ptr null_ptr = (device_ptr) 0; /* Prefilter shadow feature. */ { device_sub_ptr unfiltered_a (buffer.mem, 0, buffer.pass_stride); device_sub_ptr unfiltered_b (buffer.mem, 1*buffer.pass_stride, buffer.pass_stride); device_sub_ptr sample_var (buffer.mem, 2*buffer.pass_stride, buffer.pass_stride); device_sub_ptr sample_var_var (buffer.mem, 3*buffer.pass_stride, buffer.pass_stride); device_sub_ptr buffer_var (buffer.mem, 5*buffer.pass_stride, buffer.pass_stride); device_sub_ptr filtered_var (buffer.mem, 6*buffer.pass_stride, buffer.pass_stride); device_sub_ptr nlm_temporary_1(buffer.mem, 7*buffer.pass_stride, buffer.pass_stride); device_sub_ptr nlm_temporary_2(buffer.mem, 8*buffer.pass_stride, buffer.pass_stride); device_sub_ptr nlm_temporary_3(buffer.mem, 9*buffer.pass_stride, buffer.pass_stride); nlm_state.temporary_1_ptr = *nlm_temporary_1; nlm_state.temporary_2_ptr = *nlm_temporary_2; nlm_state.temporary_3_ptr = *nlm_temporary_3; /* Get the A/B unfiltered passes, the combined sample variance, the estimated variance of the sample variance and the buffer variance. */ functions.divide_shadow(*unfiltered_a, *unfiltered_b, *sample_var, *sample_var_var, *buffer_var); /* Smooth the (generally pretty noisy) buffer variance using the spatial information from the sample variance. */ nlm_state.set_parameters(6, 3, 4.0f, 1.0f); functions.non_local_means(*buffer_var, *sample_var, *sample_var_var, *filtered_var); /* Reuse memory, the previous data isn't needed anymore. */ device_ptr filtered_a = *buffer_var, filtered_b = *sample_var; /* Use the smoothed variance to filter the two shadow half images using each other for weight calculation. */ nlm_state.set_parameters(5, 3, 1.0f, 0.25f); functions.non_local_means(*unfiltered_a, *unfiltered_b, *filtered_var, filtered_a); functions.non_local_means(*unfiltered_b, *unfiltered_a, *filtered_var, filtered_b); device_ptr residual_var = *sample_var_var; /* Estimate the residual variance between the two filtered halves. */ functions.combine_halves(filtered_a, filtered_b, null_ptr, residual_var, 2, rect); device_ptr final_a = *unfiltered_a, final_b = *unfiltered_b; /* Use the residual variance for a second filter pass. */ nlm_state.set_parameters(4, 2, 1.0f, 0.5f); functions.non_local_means(filtered_a, filtered_b, residual_var, final_a); functions.non_local_means(filtered_b, filtered_a, residual_var, final_b); /* Combine the two double-filtered halves to a final shadow feature. */ device_sub_ptr shadow_pass(buffer.mem, 4*buffer.pass_stride, buffer.pass_stride); functions.combine_halves(final_a, final_b, *shadow_pass, null_ptr, 0, rect); } /* Prefilter general features. */ { device_sub_ptr unfiltered (buffer.mem, 8*buffer.pass_stride, buffer.pass_stride); device_sub_ptr variance (buffer.mem, 9*buffer.pass_stride, buffer.pass_stride); device_sub_ptr nlm_temporary_1(buffer.mem, 10*buffer.pass_stride, buffer.pass_stride); device_sub_ptr nlm_temporary_2(buffer.mem, 11*buffer.pass_stride, buffer.pass_stride); device_sub_ptr nlm_temporary_3(buffer.mem, 12*buffer.pass_stride, buffer.pass_stride); nlm_state.temporary_1_ptr = *nlm_temporary_1; nlm_state.temporary_2_ptr = *nlm_temporary_2; nlm_state.temporary_3_ptr = *nlm_temporary_3; int mean_from[] = { 0, 1, 2, 12, 6, 7, 8 }; int variance_from[] = { 3, 4, 5, 13, 9, 10, 11}; int pass_to[] = { 1, 2, 3, 0, 5, 6, 7}; for(int pass = 0; pass < 7; pass++) { device_sub_ptr feature_pass(buffer.mem, pass_to[pass]*buffer.pass_stride, buffer.pass_stride); /* Get the unfiltered pass and its variance from the RenderBuffers. */ functions.get_feature(mean_from[pass], variance_from[pass], *unfiltered, *variance); /* Smooth the pass and store the result in the denoising buffers. */ nlm_state.set_parameters(2, 2, 1.0f, 0.25f); functions.non_local_means(*unfiltered, *unfiltered, *variance, *feature_pass); } } /* Copy color passes. */ { int mean_from[] = {20, 21, 22}; int variance_from[] = {23, 24, 25}; int mean_to[] = { 8, 9, 10}; int variance_to[] = {11, 12, 13}; int num_color_passes = 3; storage.temporary_color.alloc_to_device(3*buffer.pass_stride, false); for(int pass = 0; pass < num_color_passes; pass++) { device_sub_ptr color_pass(storage.temporary_color, pass*buffer.pass_stride, buffer.pass_stride); device_sub_ptr color_var_pass(buffer.mem, variance_to[pass]*buffer.pass_stride, buffer.pass_stride); functions.get_feature(mean_from[pass], variance_from[pass], *color_pass, *color_var_pass); } { device_sub_ptr depth_pass (buffer.mem, 0, buffer.pass_stride); device_sub_ptr color_var_pass(buffer.mem, variance_to[0]*buffer.pass_stride, 3*buffer.pass_stride); device_sub_ptr output_pass (buffer.mem, mean_to[0]*buffer.pass_stride, 3*buffer.pass_stride); functions.detect_outliers(storage.temporary_color.device_pointer, *color_var_pass, *depth_pass, *output_pass); } } storage.w = filter_area.z; storage.h = filter_area.w; storage.transform.alloc_to_device(storage.w*storage.h*TRANSFORM_SIZE, false); storage.rank.alloc_to_device(storage.w*storage.h, false); functions.construct_transform(); device_only_memory temporary_1(device, "Denoising NLM temporary 1"); device_only_memory temporary_2(device, "Denoising NLM temporary 2"); temporary_1.alloc_to_device(buffer.pass_stride, false); temporary_2.alloc_to_device(buffer.pass_stride, false); reconstruction_state.temporary_1_ptr = temporary_1.device_pointer; reconstruction_state.temporary_2_ptr = temporary_2.device_pointer; storage.XtWX.alloc_to_device(storage.w*storage.h*XTWX_SIZE, false); storage.XtWY.alloc_to_device(storage.w*storage.h*XTWY_SIZE, false); reconstruction_state.filter_window = rect_from_shape(filter_area.x-rect.x, filter_area.y-rect.y, storage.w, storage.h); int tile_coordinate_offset = filter_area.y*render_buffer.stride + filter_area.x; reconstruction_state.buffer_params = make_int4(render_buffer.offset + tile_coordinate_offset, render_buffer.stride, render_buffer.pass_stride, render_buffer.denoising_clean_offset); reconstruction_state.source_w = rect.z-rect.x; reconstruction_state.source_h = rect.w-rect.y; { device_sub_ptr color_ptr (buffer.mem, 8*buffer.pass_stride, 3*buffer.pass_stride); device_sub_ptr color_var_ptr(buffer.mem, 11*buffer.pass_stride, 3*buffer.pass_stride); functions.reconstruct(*color_ptr, *color_var_ptr, render_buffer.ptr); } return true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device_denoising.h000066400000000000000000000115171334742672700233100ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEVICE_DENOISING_H__ #define __DEVICE_DENOISING_H__ #include "device/device.h" #include "render/buffers.h" #include "kernel/filter/filter_defines.h" CCL_NAMESPACE_BEGIN class DenoisingTask { public: /* Parameters of the denoising algorithm. */ int radius; float nlm_k_2; float pca_threshold; /* Pointer and parameters of the RenderBuffers. */ struct RenderBuffers { int denoising_data_offset; int denoising_clean_offset; int pass_stride; int offset; int stride; device_ptr ptr; int samples; } render_buffer; TilesInfo *tiles; device_vector tiles_mem; void tiles_from_rendertiles(RenderTile *rtiles); int4 rect; int4 filter_area; struct DeviceFunctions { function non_local_means; function reconstruct; function construct_transform; function combine_halves; function divide_shadow; function get_feature; function detect_outliers; function set_tiles; } functions; /* Stores state of the current Reconstruction operation, * which is accessed by the device in order to perform the operation. */ struct ReconstructionState { device_ptr temporary_1_ptr; /* There two images are used as temporary storage. */ device_ptr temporary_2_ptr; int4 filter_window; int4 buffer_params; int source_w; int source_h; } reconstruction_state; /* Stores state of the current NLM operation, * which is accessed by the device in order to perform the operation. */ struct NLMState { device_ptr temporary_1_ptr; /* There three images are used as temporary storage. */ device_ptr temporary_2_ptr; device_ptr temporary_3_ptr; int r; /* Search radius of the filter. */ int f; /* Patch size of the filter. */ float a; /* Variance compensation factor in the MSE estimation. */ float k_2; /* Squared value of the k parameter of the filter. */ void set_parameters(int r_, int f_, float a_, float k_2_) { r = r_; f = f_; a = a_, k_2 = k_2_; } } nlm_state; struct Storage { device_only_memory transform; device_only_memory rank; device_only_memory XtWX; device_only_memory XtWY; device_only_memory temporary_1; device_only_memory temporary_2; device_only_memory temporary_color; int w; int h; Storage(Device *device) : transform(device, "denoising transform"), rank(device, "denoising rank"), XtWX(device, "denoising XtWX"), XtWY(device, "denoising XtWY"), temporary_1(device, "denoising NLM temporary 1"), temporary_2(device, "denoising NLM temporary 2"), temporary_color(device, "denoising temporary color") {} } storage; DenoisingTask(Device *device); ~DenoisingTask(); void init_from_devicetask(const DeviceTask &task); bool run_denoising(); struct DenoiseBuffers { int pass_stride; int passes; int stride; int h; int width; device_only_memory mem; DenoiseBuffers(Device *device) : mem(device, "denoising pixel buffer") {} } buffer; protected: Device *device; }; CCL_NAMESPACE_END #endif /* __DEVICE_DENOISING_H__ */ goxel-0.8.1/ext_src/cycles/src/device/device_intern.h000066400000000000000000000030011334742672700226150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEVICE_INTERN_H__ #define __DEVICE_INTERN_H__ CCL_NAMESPACE_BEGIN class Device; Device *device_cpu_create(DeviceInfo& info, Stats &stats, bool background); bool device_opencl_init(void); Device *device_opencl_create(DeviceInfo& info, Stats &stats, bool background); bool device_cuda_init(void); Device *device_cuda_create(DeviceInfo& info, Stats &stats, bool background); Device *device_network_create(DeviceInfo& info, Stats &stats, const char *address); Device *device_multi_create(DeviceInfo& info, Stats &stats, bool background); void device_cpu_info(vector& devices); void device_opencl_info(vector& devices); void device_cuda_info(vector& devices); void device_network_info(vector& devices); string device_cpu_capabilities(void); string device_opencl_capabilities(void); string device_cuda_capabilities(void); CCL_NAMESPACE_END #endif /* __DEVICE_INTERN_H__ */ goxel-0.8.1/ext_src/cycles/src/device/device_memory.cpp000066400000000000000000000046021334742672700231710ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "device/device_memory.h" CCL_NAMESPACE_BEGIN /* Device Memory */ device_memory::device_memory(Device *device, const char *name, MemoryType type) : data_type(device_type_traits::data_type), data_elements(device_type_traits::num_elements), data_size(0), device_size(0), data_width(0), data_height(0), data_depth(0), type(type), name(name), interpolation(INTERPOLATION_NONE), extension(EXTENSION_REPEAT), device(device), device_pointer(0), host_pointer(0), shared_pointer(0) { } device_memory::~device_memory() { } void *device_memory::host_alloc(size_t size) { if(!size) { return 0; } void *ptr = util_aligned_malloc(size, MIN_ALIGNMENT_CPU_DATA_TYPES); if(ptr) { util_guarded_mem_alloc(size); } else { throw std::bad_alloc(); } return ptr; } void device_memory::host_free() { if(host_pointer) { util_guarded_mem_free(memory_size()); util_aligned_free((void*)host_pointer); host_pointer = 0; } } void device_memory::device_alloc() { assert(!device_pointer && type != MEM_TEXTURE); device->mem_alloc(*this); } void device_memory::device_free() { if(device_pointer) { device->mem_free(*this); } } void device_memory::device_copy_to() { if(host_pointer) { device->mem_copy_to(*this); } } void device_memory::device_copy_from(int y, int w, int h, int elem) { assert(type != MEM_TEXTURE && type != MEM_READ_ONLY); device->mem_copy_from(*this, y, w, h, elem); } void device_memory::device_zero() { if(data_size) { device->mem_zero(*this); } } /* Device Sub Ptr */ device_sub_ptr::device_sub_ptr(device_memory& mem, int offset, int size) : device(mem.device) { ptr = device->mem_alloc_sub_ptr(mem, offset, size); } device_sub_ptr::~device_sub_ptr() { device->mem_free_sub_ptr(ptr); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device_memory.h000066400000000000000000000253611334742672700226430ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEVICE_MEMORY_H__ #define __DEVICE_MEMORY_H__ /* Device Memory * * Data types for allocating, copying and freeing device memory. */ #include "util/util_half.h" #include "util/util_texture.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Device; enum MemoryType { MEM_READ_ONLY, MEM_READ_WRITE, MEM_DEVICE_ONLY, MEM_TEXTURE, MEM_PIXELS }; /* Supported Data Types */ enum DataType { TYPE_UNKNOWN, TYPE_UCHAR, TYPE_UINT, TYPE_INT, TYPE_FLOAT, TYPE_HALF, TYPE_UINT64, }; static inline size_t datatype_size(DataType datatype) { switch(datatype) { case TYPE_UNKNOWN: return 1; case TYPE_UCHAR: return sizeof(uchar); case TYPE_FLOAT: return sizeof(float); case TYPE_UINT: return sizeof(uint); case TYPE_INT: return sizeof(int); case TYPE_HALF: return sizeof(half); case TYPE_UINT64: return sizeof(uint64_t); default: return 0; } } /* Traits for data types */ template struct device_type_traits { static const DataType data_type = TYPE_UNKNOWN; static const int num_elements = sizeof(T); }; template<> struct device_type_traits { static const DataType data_type = TYPE_UCHAR; static const int num_elements = 1; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UCHAR; static const int num_elements = 2; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UCHAR; static const int num_elements = 3; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UCHAR; static const int num_elements = 4; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UINT; static const int num_elements = 1; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UINT; static const int num_elements = 2; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UINT; static const int num_elements = 3; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UINT; static const int num_elements = 4; }; template<> struct device_type_traits { static const DataType data_type = TYPE_INT; static const int num_elements = 1; }; template<> struct device_type_traits { static const DataType data_type = TYPE_INT; static const int num_elements = 2; }; template<> struct device_type_traits { static const DataType data_type = TYPE_INT; static const int num_elements = 3; }; template<> struct device_type_traits { static const DataType data_type = TYPE_INT; static const int num_elements = 4; }; template<> struct device_type_traits { static const DataType data_type = TYPE_FLOAT; static const int num_elements = 1; }; template<> struct device_type_traits { static const DataType data_type = TYPE_FLOAT; static const int num_elements = 2; }; template<> struct device_type_traits { static const DataType data_type = TYPE_FLOAT; static const int num_elements = 4; }; template<> struct device_type_traits { static const DataType data_type = TYPE_FLOAT; static const int num_elements = 4; }; template<> struct device_type_traits { static const DataType data_type = TYPE_HALF; static const int num_elements = 1; }; template<> struct device_type_traits { static const DataType data_type = TYPE_HALF; static const int num_elements = 4; }; template<> struct device_type_traits { static const DataType data_type = TYPE_UINT64; static const int num_elements = 1; }; /* Device Memory * * Base class for all device memory. This should not be allocated directly, * instead the appropriate subclass can be used. */ class device_memory { public: size_t memory_size() { return data_size*data_elements*datatype_size(data_type); } size_t memory_elements_size(int elements) { return elements*data_elements*datatype_size(data_type); } /* Data information. */ DataType data_type; int data_elements; size_t data_size; size_t device_size; size_t data_width; size_t data_height; size_t data_depth; MemoryType type; const char *name; InterpolationType interpolation; ExtensionType extension; /* Pointers. */ Device *device; device_ptr device_pointer; void *host_pointer; void *shared_pointer; virtual ~device_memory(); protected: friend class CUDADevice; /* Only create through subclasses. */ device_memory(Device *device, const char *name, MemoryType type); /* No copying allowed. */ device_memory(const device_memory&); device_memory& operator = (const device_memory&); /* Host allocation on the device. All host_pointer memory should be * allocated with these functions, for devices that support using * the same pointer for host and device. */ void *host_alloc(size_t size); void host_free(); /* Device memory allocation and copying. */ void device_alloc(); void device_free(); void device_copy_to(); void device_copy_from(int y, int w, int h, int elem); void device_zero(); }; /* Device Only Memory * * Working memory only needed by the device, with no corresponding allocation * on the host. Only used internally in the device implementations. */ template class device_only_memory : public device_memory { public: device_only_memory(Device *device, const char *name) : device_memory(device, name, MEM_DEVICE_ONLY) { data_type = device_type_traits::data_type; data_elements = max(device_type_traits::num_elements, 1); } virtual ~device_only_memory() { free(); } void alloc_to_device(size_t num, bool shrink_to_fit = true) { size_t new_size = num; bool reallocate; if(shrink_to_fit) { reallocate = (data_size != new_size); } else { reallocate = (data_size < new_size); } if(reallocate) { device_free(); data_size = new_size; device_alloc(); } } void free() { device_free(); data_size = 0; } void zero_to_device() { device_zero(); } }; /* Device Vector * * Data vector to exchange data between host and device. Memory will be * allocated on the host first with alloc() and resize, and then filled * in and copied to the device with copy_to_device(). Or alternatively * allocated and set to zero on the device with zero_to_device(). * * When using memory type MEM_TEXTURE, a pointer to this memory will be * automatically attached to kernel globals, using the provided name * matching an entry in kernel_textures.h. */ template class device_vector : public device_memory { public: device_vector(Device *device, const char *name, MemoryType type) : device_memory(device, name, type) { data_type = device_type_traits::data_type; data_elements = device_type_traits::num_elements; assert(data_elements > 0); } virtual ~device_vector() { free(); } /* Host memory allocation. */ T *alloc(size_t width, size_t height = 0, size_t depth = 0) { size_t new_size = size(width, height, depth); if(new_size != data_size) { device_free(); host_free(); host_pointer = host_alloc(sizeof(T)*new_size); assert(device_pointer == 0); } data_size = new_size; data_width = width; data_height = height; data_depth = depth; return data(); } /* Host memory resize. Only use this if the original data needs to be * preserved, it is faster to call alloc() if it can be discarded. */ T *resize(size_t width, size_t height = 0, size_t depth = 0) { size_t new_size = size(width, height, depth); if(new_size != data_size) { void *new_ptr = host_alloc(sizeof(T)*new_size); if(new_size && data_size) { size_t min_size = ((new_size < data_size)? new_size: data_size); memcpy((T*)new_ptr, (T*)host_pointer, sizeof(T)*min_size); } device_free(); host_free(); host_pointer = new_ptr; assert(device_pointer == 0); } data_size = new_size; data_width = width; data_height = height; data_depth = depth; return data(); } /* Take over data from an existing array. */ void steal_data(array& from) { device_free(); host_free(); data_size = from.size(); data_width = 0; data_height = 0; data_depth = 0; host_pointer = from.steal_pointer(); assert(device_pointer == 0); } /* Free device and host memory. */ void free() { device_free(); host_free(); data_size = 0; data_width = 0; data_height = 0; data_depth = 0; host_pointer = 0; assert(device_pointer == 0); } size_t size() { return data_size; } T* data() { return (T*)host_pointer; } T& operator[](size_t i) { assert(i < data_size); return data()[i]; } void copy_to_device() { device_copy_to(); } void copy_from_device(int y, int w, int h) { device_copy_from(y, w, h, sizeof(T)); } void zero_to_device() { device_zero(); } protected: size_t size(size_t width, size_t height, size_t depth) { return width * ((height == 0)? 1: height) * ((depth == 0)? 1: depth); } }; /* Pixel Memory * * Device memory to efficiently draw as pixels to the screen in interactive * rendering. Only copying pixels from the device is supported, not copying to. */ template class device_pixels : public device_vector { public: device_pixels(Device *device, const char *name) : device_vector(device, name, MEM_PIXELS) { } void alloc_to_device(size_t width, size_t height, size_t depth = 0) { device_vector::alloc(width, height, depth); if(!device_memory::device_pointer) { device_memory::device_alloc(); } } T *copy_from_device(int y, int w, int h) { device_memory::device_copy_from(y, w, h, sizeof(T)); return device_vector::data(); } }; /* Device Sub Memory * * Pointer into existing memory. It is not allocated separately, but created * from an already allocated base memory. It is freed automatically when it * goes out of scope, which should happen before base memory is freed. * * Note: some devices require offset and size of the sub_ptr to be properly * aligned to device->mem_address_alingment(). */ class device_sub_ptr { public: device_sub_ptr(device_memory& mem, int offset, int size); ~device_sub_ptr(); device_ptr operator*() const { return ptr; } protected: /* No copying. */ device_sub_ptr& operator = (const device_sub_ptr&); Device *device; device_ptr ptr; }; CCL_NAMESPACE_END #endif /* __DEVICE_MEMORY_H__ */ goxel-0.8.1/ext_src/cycles/src/device/device_multi.cpp000066400000000000000000000231741334742672700230200ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include "device/device.h" #include "device/device_intern.h" #include "device/device_network.h" #include "render/buffers.h" #include "util/util_foreach.h" #include "util/util_list.h" #include "util/util_logging.h" #include "util/util_map.h" #include "util/util_time.h" CCL_NAMESPACE_BEGIN class MultiDevice : public Device { public: struct SubDevice { explicit SubDevice(Device *device_) : device(device_) {} Device *device; map ptr_map; }; list devices; device_ptr unique_key; MultiDevice(DeviceInfo& info, Stats &stats, bool background_) : Device(info, stats, background_), unique_key(1) { foreach(DeviceInfo& subinfo, info.multi_devices) { Device *device = Device::create(subinfo, sub_stats_, background); /* Always add CPU devices at the back since GPU devices can change * host memory pointers, which CPU uses as device pointer. */ if(subinfo.type == DEVICE_CPU) { devices.push_back(SubDevice(device)); } else { devices.push_front(SubDevice(device)); } } #ifdef WITH_NETWORK /* try to add network devices */ ServerDiscovery discovery(true); time_sleep(1.0); vector servers = discovery.get_server_list(); foreach(string& server, servers) { Device *device = device_network_create(info, stats, server.c_str()); if(device) devices.push_back(SubDevice(device)); } #endif } ~MultiDevice() { foreach(SubDevice& sub, devices) delete sub.device; } const string& error_message() { foreach(SubDevice& sub, devices) { if(sub.device->error_message() != "") { if(error_msg == "") error_msg = sub.device->error_message(); break; } } return error_msg; } virtual bool show_samples() const { if(devices.size() > 1) { return false; } return devices.front().device->show_samples(); } bool load_kernels(const DeviceRequestedFeatures& requested_features) { foreach(SubDevice& sub, devices) if(!sub.device->load_kernels(requested_features)) return false; return true; } void mem_alloc(device_memory& mem) { device_ptr key = unique_key++; foreach(SubDevice& sub, devices) { mem.device = sub.device; mem.device_pointer = 0; mem.device_size = 0; sub.device->mem_alloc(mem); sub.ptr_map[key] = mem.device_pointer; } mem.device = this; mem.device_pointer = key; stats.mem_alloc(mem.device_size); } void mem_copy_to(device_memory& mem) { device_ptr existing_key = mem.device_pointer; device_ptr key = (existing_key)? existing_key: unique_key++; size_t existing_size = mem.device_size; foreach(SubDevice& sub, devices) { mem.device = sub.device; mem.device_pointer = (existing_key)? sub.ptr_map[existing_key]: 0; mem.device_size = existing_size; sub.device->mem_copy_to(mem); sub.ptr_map[key] = mem.device_pointer; } mem.device = this; mem.device_pointer = key; stats.mem_alloc(mem.device_size - existing_size); } void mem_copy_from(device_memory& mem, int y, int w, int h, int elem) { device_ptr key = mem.device_pointer; int i = 0, sub_h = h/devices.size(); foreach(SubDevice& sub, devices) { int sy = y + i*sub_h; int sh = (i == (int)devices.size() - 1)? h - sub_h*i: sub_h; mem.device = sub.device; mem.device_pointer = sub.ptr_map[key]; sub.device->mem_copy_from(mem, sy, w, sh, elem); i++; } mem.device = this; mem.device_pointer = key; } void mem_zero(device_memory& mem) { device_ptr existing_key = mem.device_pointer; device_ptr key = (existing_key)? existing_key: unique_key++; size_t existing_size = mem.device_size; foreach(SubDevice& sub, devices) { mem.device = sub.device; mem.device_pointer = (existing_key)? sub.ptr_map[existing_key]: 0; mem.device_size = existing_size; sub.device->mem_zero(mem); sub.ptr_map[key] = mem.device_pointer; } mem.device = this; mem.device_pointer = key; stats.mem_alloc(mem.device_size - existing_size); } void mem_free(device_memory& mem) { device_ptr key = mem.device_pointer; size_t existing_size = mem.device_size; foreach(SubDevice& sub, devices) { mem.device = sub.device; mem.device_pointer = sub.ptr_map[key]; mem.device_size = existing_size; sub.device->mem_free(mem); sub.ptr_map.erase(sub.ptr_map.find(key)); } mem.device = this; mem.device_pointer = 0; mem.device_size = 0; stats.mem_free(existing_size); } void const_copy_to(const char *name, void *host, size_t size) { foreach(SubDevice& sub, devices) sub.device->const_copy_to(name, host, size); } void draw_pixels(device_memory& rgba, int y, int w, int h, int dx, int dy, int width, int height, bool transparent, const DeviceDrawParams &draw_params) { device_ptr key = rgba.device_pointer; int i = 0, sub_h = h/devices.size(); int sub_height = height/devices.size(); foreach(SubDevice& sub, devices) { int sy = y + i*sub_h; int sh = (i == (int)devices.size() - 1)? h - sub_h*i: sub_h; int sheight = (i == (int)devices.size() - 1)? height - sub_height*i: sub_height; int sdy = dy + i*sub_height; /* adjust math for w/width */ rgba.device_pointer = sub.ptr_map[key]; sub.device->draw_pixels(rgba, sy, w, sh, dx, sdy, width, sheight, transparent, draw_params); i++; } rgba.device_pointer = key; } void map_tile(Device *sub_device, RenderTile& tile) { foreach(SubDevice& sub, devices) { if(sub.device == sub_device) { if(tile.buffer) tile.buffer = sub.ptr_map[tile.buffer]; } } } int device_number(Device *sub_device) { int i = 0; foreach(SubDevice& sub, devices) { if(sub.device == sub_device) return i; i++; } return -1; } void map_neighbor_tiles(Device *sub_device, RenderTile *tiles) { for(int i = 0; i < 9; i++) { if(!tiles[i].buffers) { continue; } /* If the tile was rendered on another device, copy its memory to * to the current device now, for the duration of the denoising task. * Note that this temporarily modifies the RenderBuffers and calls * the device, so this function is not thread safe. */ device_vector &mem = tiles[i].buffers->buffer; if(mem.device != sub_device) { /* Only copy from device to host once. This is faster, but * also required for the case where a CPU thread is denoising * a tile rendered on the GPU. In that case we have to avoid * overwriting the buffer being denoised by the CPU thread. */ if(!tiles[i].buffers->map_neighbor_copied) { tiles[i].buffers->map_neighbor_copied = true; mem.copy_from_device(0, mem.data_size, 1); } Device *original_device = mem.device; device_ptr original_ptr = mem.device_pointer; size_t original_size = mem.device_size; mem.device = sub_device; mem.device_pointer = 0; mem.device_size = 0; mem.copy_to_device(); tiles[i].buffer = mem.device_pointer; mem.device = original_device; mem.device_pointer = original_ptr; mem.device_size = original_size; } } } void unmap_neighbor_tiles(Device * sub_device, RenderTile * tiles) { for(int i = 0; i < 9; i++) { if(!tiles[i].buffers) { continue; } device_vector &mem = tiles[i].buffers->buffer; if(mem.device != sub_device) { Device *original_device = mem.device; device_ptr original_ptr = mem.device_pointer; size_t original_size = mem.device_size; mem.device = sub_device; mem.device_pointer = tiles[i].buffer; /* Copy denoised tile to the host. */ if(i == 4) { mem.copy_from_device(0, mem.data_size, 1); } sub_device->mem_free(mem); mem.device = original_device; mem.device_pointer = original_ptr; mem.device_size = original_size; /* Copy denoised tile to the original device. */ if(i == 4) { mem.copy_to_device(); } } } } int get_split_task_count(DeviceTask& task) { int total_tasks = 0; list tasks; task.split(tasks, devices.size()); foreach(SubDevice& sub, devices) { if(!tasks.empty()) { DeviceTask subtask = tasks.front(); tasks.pop_front(); total_tasks += sub.device->get_split_task_count(subtask); } } return total_tasks; } void task_add(DeviceTask& task) { list tasks; task.split(tasks, devices.size()); foreach(SubDevice& sub, devices) { if(!tasks.empty()) { DeviceTask subtask = tasks.front(); tasks.pop_front(); if(task.buffer) subtask.buffer = sub.ptr_map[task.buffer]; if(task.rgba_byte) subtask.rgba_byte = sub.ptr_map[task.rgba_byte]; if(task.rgba_half) subtask.rgba_half = sub.ptr_map[task.rgba_half]; if(task.shader_input) subtask.shader_input = sub.ptr_map[task.shader_input]; if(task.shader_output) subtask.shader_output = sub.ptr_map[task.shader_output]; sub.device->task_add(subtask); } } } void task_wait() { foreach(SubDevice& sub, devices) sub.device->task_wait(); } void task_cancel() { foreach(SubDevice& sub, devices) sub.device->task_cancel(); } protected: Stats sub_stats_; }; Device *device_multi_create(DeviceInfo& info, Stats &stats, bool background) { return new MultiDevice(info, stats, background); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device_network.cpp000066400000000000000000000453701334742672700233610ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "device/device_intern.h" #include "device/device_network.h" #include "util/util_foreach.h" #include "util/util_logging.h" #if defined(WITH_NETWORK) CCL_NAMESPACE_BEGIN typedef map PtrMap; typedef vector DataVector; typedef map DataMap; /* tile list */ typedef vector TileList; /* search a list of tiles and find the one that matches the passed render tile */ static TileList::iterator tile_list_find(TileList& tile_list, RenderTile& tile) { for(TileList::iterator it = tile_list.begin(); it != tile_list.end(); ++it) if(tile.x == it->x && tile.y == it->y && tile.start_sample == it->start_sample) return it; return tile_list.end(); } class NetworkDevice : public Device { public: boost::asio::io_service io_service; tcp::socket socket; device_ptr mem_counter; DeviceTask the_task; /* todo: handle multiple tasks */ thread_mutex rpc_lock; virtual bool show_samples() const { return false; } NetworkDevice(DeviceInfo& info, Stats &stats, const char *address) : Device(info, stats, true), socket(io_service) { error_func = NetworkError(); stringstream portstr; portstr << SERVER_PORT; tcp::resolver resolver(io_service); tcp::resolver::query query(address, portstr.str()); tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); tcp::resolver::iterator end; boost::system::error_code error = boost::asio::error::host_not_found; while(error && endpoint_iterator != end) { socket.close(); socket.connect(*endpoint_iterator++, error); } if(error) error_func.network_error(error.message()); mem_counter = 0; } ~NetworkDevice() { RPCSend snd(socket, &error_func, "stop"); snd.write(); } void mem_alloc(device_memory& mem) { if(mem.name) { VLOG(1) << "Buffer allocate: " << mem.name << ", " << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; } thread_scoped_lock lock(rpc_lock); mem.device_pointer = ++mem_counter; RPCSend snd(socket, &error_func, "mem_alloc"); snd.add(mem); snd.write(); } void mem_copy_to(device_memory& mem) { thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "mem_copy_to"); snd.add(mem); snd.write(); snd.write_buffer(mem.host_pointer, mem.memory_size()); } void mem_copy_from(device_memory& mem, int y, int w, int h, int elem) { thread_scoped_lock lock(rpc_lock); size_t data_size = mem.memory_size(); RPCSend snd(socket, &error_func, "mem_copy_from"); snd.add(mem); snd.add(y); snd.add(w); snd.add(h); snd.add(elem); snd.write(); RPCReceive rcv(socket, &error_func); rcv.read_buffer(mem.host_pointer, data_size); } void mem_zero(device_memory& mem) { thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "mem_zero"); snd.add(mem); snd.write(); } void mem_free(device_memory& mem) { if(mem.device_pointer) { thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "mem_free"); snd.add(mem); snd.write(); mem.device_pointer = 0; } } void const_copy_to(const char *name, void *host, size_t size) { thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "const_copy_to"); string name_string(name); snd.add(name_string); snd.add(size); snd.write(); snd.write_buffer(host, size); } bool load_kernels(const DeviceRequestedFeatures& requested_features) { if(error_func.have_error()) return false; thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "load_kernels"); snd.add(requested_features.experimental); snd.add(requested_features.max_closure); snd.add(requested_features.max_nodes_group); snd.add(requested_features.nodes_features); snd.write(); bool result; RPCReceive rcv(socket, &error_func); rcv.read(result); return result; } void task_add(DeviceTask& task) { thread_scoped_lock lock(rpc_lock); the_task = task; RPCSend snd(socket, &error_func, "task_add"); snd.add(task); snd.write(); } void task_wait() { thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "task_wait"); snd.write(); lock.unlock(); TileList the_tiles; /* todo: run this threaded for connecting to multiple clients */ for(;;) { if(error_func.have_error()) break; RenderTile tile; lock.lock(); RPCReceive rcv(socket, &error_func); if(rcv.name == "acquire_tile") { lock.unlock(); /* todo: watch out for recursive calls! */ if(the_task.acquire_tile(this, tile)) { /* write return as bool */ the_tiles.push_back(tile); lock.lock(); RPCSend snd(socket, &error_func, "acquire_tile"); snd.add(tile); snd.write(); lock.unlock(); } else { lock.lock(); RPCSend snd(socket, &error_func, "acquire_tile_none"); snd.write(); lock.unlock(); } } else if(rcv.name == "release_tile") { rcv.read(tile); lock.unlock(); TileList::iterator it = tile_list_find(the_tiles, tile); if(it != the_tiles.end()) { tile.buffers = it->buffers; the_tiles.erase(it); } assert(tile.buffers != NULL); the_task.release_tile(tile); lock.lock(); RPCSend snd(socket, &error_func, "release_tile"); snd.write(); lock.unlock(); } else if(rcv.name == "task_wait_done") { lock.unlock(); break; } else lock.unlock(); } } void task_cancel() { thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "task_cancel"); snd.write(); } int get_split_task_count(DeviceTask&) { return 1; } private: NetworkError error_func; }; Device *device_network_create(DeviceInfo& info, Stats &stats, const char *address) { return new NetworkDevice(info, stats, address); } void device_network_info(vector& devices) { DeviceInfo info; info.type = DEVICE_NETWORK; info.description = "Network Device"; info.id = "NETWORK"; info.num = 0; /* todo: get this info from device */ info.advanced_shading = true; info.has_volume_decoupled = false; info.bvh_layout_mask = BVH_LAYOUT_BVH2; info.has_osl = false; devices.push_back(info); } class DeviceServer { public: thread_mutex rpc_lock; void network_error(const string &message) { error_func.network_error(message); } bool have_error() { return error_func.have_error(); } DeviceServer(Device *device_, tcp::socket& socket_) : device(device_), socket(socket_), stop(false), blocked_waiting(false) { error_func = NetworkError(); } void listen() { /* receive remote function calls */ for(;;) { listen_step(); if(stop) break; } } protected: void listen_step() { thread_scoped_lock lock(rpc_lock); RPCReceive rcv(socket, &error_func); if(rcv.name == "stop") stop = true; else process(rcv, lock); } /* create a memory buffer for a device buffer and insert it into mem_data */ DataVector &data_vector_insert(device_ptr client_pointer, size_t data_size) { /* create a new DataVector and insert it into mem_data */ pair data_ins = mem_data.insert( DataMap::value_type(client_pointer, DataVector())); /* make sure it was a unique insertion */ assert(data_ins.second); /* get a reference to the inserted vector */ DataVector &data_v = data_ins.first->second; /* size the vector */ data_v.resize(data_size); return data_v; } DataVector &data_vector_find(device_ptr client_pointer) { DataMap::iterator i = mem_data.find(client_pointer); assert(i != mem_data.end()); return i->second; } /* setup mapping and reverse mapping of client_pointer<->real_pointer */ void pointer_mapping_insert(device_ptr client_pointer, device_ptr real_pointer) { pair mapins; /* insert mapping from client pointer to our real device pointer */ mapins = ptr_map.insert(PtrMap::value_type(client_pointer, real_pointer)); assert(mapins.second); /* insert reverse mapping from real our device pointer to client pointer */ mapins = ptr_imap.insert(PtrMap::value_type(real_pointer, client_pointer)); assert(mapins.second); } device_ptr device_ptr_from_client_pointer(device_ptr client_pointer) { PtrMap::iterator i = ptr_map.find(client_pointer); assert(i != ptr_map.end()); return i->second; } device_ptr device_ptr_from_client_pointer_erase(device_ptr client_pointer) { PtrMap::iterator i = ptr_map.find(client_pointer); assert(i != ptr_map.end()); device_ptr result = i->second; /* erase the mapping */ ptr_map.erase(i); /* erase the reverse mapping */ PtrMap::iterator irev = ptr_imap.find(result); assert(irev != ptr_imap.end()); ptr_imap.erase(irev); /* erase the data vector */ DataMap::iterator idata = mem_data.find(client_pointer); assert(idata != mem_data.end()); mem_data.erase(idata); return result; } /* note that the lock must be already acquired upon entry. * This is necessary because the caller often peeks at * the header and delegates control to here when it doesn't * specifically handle the current RPC. * The lock must be unlocked before returning */ void process(RPCReceive& rcv, thread_scoped_lock &lock) { if(rcv.name == "mem_alloc") { string name; network_device_memory mem(device); rcv.read(mem, name); lock.unlock(); /* Allocate host side data buffer. */ size_t data_size = mem.memory_size(); device_ptr client_pointer = mem.device_pointer; DataVector &data_v = data_vector_insert(client_pointer, data_size); mem.host_pointer = (data_size)? (void*)&(data_v[0]): 0; /* Perform the allocation on the actual device. */ device->mem_alloc(mem); /* Store a mapping to/from client_pointer and real device pointer. */ pointer_mapping_insert(client_pointer, mem.device_pointer); } else if(rcv.name == "mem_copy_to") { string name; network_device_memory mem(device); rcv.read(mem, name); lock.unlock(); size_t data_size = mem.memory_size(); device_ptr client_pointer = mem.device_pointer; if(client_pointer) { /* Lookup existing host side data buffer. */ DataVector &data_v = data_vector_find(client_pointer); mem.host_pointer = (void*)&data_v[0]; /* Translate the client pointer to a real device pointer. */ mem.device_pointer = device_ptr_from_client_pointer(client_pointer); } else { /* Allocate host side data buffer. */ DataVector &data_v = data_vector_insert(client_pointer, data_size); mem.host_pointer = (data_size)? (void*)&(data_v[0]): 0; } /* Copy data from network into memory buffer. */ rcv.read_buffer((uint8_t*)mem.host_pointer, data_size); /* Copy the data from the memory buffer to the device buffer. */ device->mem_copy_to(mem); if(!client_pointer) { /* Store a mapping to/from client_pointer and real device pointer. */ pointer_mapping_insert(client_pointer, mem.device_pointer); } } else if(rcv.name == "mem_copy_from") { string name; network_device_memory mem(device); int y, w, h, elem; rcv.read(mem, name); rcv.read(y); rcv.read(w); rcv.read(h); rcv.read(elem); device_ptr client_pointer = mem.device_pointer; mem.device_pointer = device_ptr_from_client_pointer(client_pointer); DataVector &data_v = data_vector_find(client_pointer); mem.host_pointer = (device_ptr)&(data_v[0]); device->mem_copy_from(mem, y, w, h, elem); size_t data_size = mem.memory_size(); RPCSend snd(socket, &error_func, "mem_copy_from"); snd.write(); snd.write_buffer((uint8_t*)mem.host_pointer, data_size); lock.unlock(); } else if(rcv.name == "mem_zero") { string name; network_device_memory mem(device); rcv.read(mem, name); lock.unlock(); size_t data_size = mem.memory_size(); device_ptr client_pointer = mem.device_pointer; if(client_pointer) { /* Lookup existing host side data buffer. */ DataVector &data_v = data_vector_find(client_pointer); mem.host_pointer = (void*)&data_v[0]; /* Translate the client pointer to a real device pointer. */ mem.device_pointer = device_ptr_from_client_pointer(client_pointer); } else { /* Allocate host side data buffer. */ DataVector &data_v = data_vector_insert(client_pointer, data_size); mem.host_pointer = (void*)? (device_ptr)&(data_v[0]): 0; } /* Zero memory. */ device->mem_zero(mem); if(!client_pointer) { /* Store a mapping to/from client_pointer and real device pointer. */ pointer_mapping_insert(client_pointer, mem.device_pointer); } } else if(rcv.name == "mem_free") { string name; network_device_memory mem(device); rcv.read(mem, name); lock.unlock(); device_ptr client_pointer = mem.device_pointer; mem.device_pointer = device_ptr_from_client_pointer_erase(client_pointer); device->mem_free(mem); } else if(rcv.name == "const_copy_to") { string name_string; size_t size; rcv.read(name_string); rcv.read(size); vector host_vector(size); rcv.read_buffer(&host_vector[0], size); lock.unlock(); device->const_copy_to(name_string.c_str(), &host_vector[0], size); } else if(rcv.name == "load_kernels") { DeviceRequestedFeatures requested_features; rcv.read(requested_features.experimental); rcv.read(requested_features.max_closure); rcv.read(requested_features.max_nodes_group); rcv.read(requested_features.nodes_features); bool result; result = device->load_kernels(requested_features); RPCSend snd(socket, &error_func, "load_kernels"); snd.add(result); snd.write(); lock.unlock(); } else if(rcv.name == "task_add") { DeviceTask task; rcv.read(task); lock.unlock(); if(task.buffer) task.buffer = device_ptr_from_client_pointer(task.buffer); if(task.rgba_half) task.rgba_half = device_ptr_from_client_pointer(task.rgba_half); if(task.rgba_byte) task.rgba_byte = device_ptr_from_client_pointer(task.rgba_byte); if(task.shader_input) task.shader_input = device_ptr_from_client_pointer(task.shader_input); if(task.shader_output) task.shader_output = device_ptr_from_client_pointer(task.shader_output); task.acquire_tile = function_bind(&DeviceServer::task_acquire_tile, this, _1, _2); task.release_tile = function_bind(&DeviceServer::task_release_tile, this, _1); task.update_progress_sample = function_bind(&DeviceServer::task_update_progress_sample, this); task.update_tile_sample = function_bind(&DeviceServer::task_update_tile_sample, this, _1); task.get_cancel = function_bind(&DeviceServer::task_get_cancel, this); device->task_add(task); } else if(rcv.name == "task_wait") { lock.unlock(); blocked_waiting = true; device->task_wait(); blocked_waiting = false; lock.lock(); RPCSend snd(socket, &error_func, "task_wait_done"); snd.write(); lock.unlock(); } else if(rcv.name == "task_cancel") { lock.unlock(); device->task_cancel(); } else if(rcv.name == "acquire_tile") { AcquireEntry entry; entry.name = rcv.name; rcv.read(entry.tile); acquire_queue.push_back(entry); lock.unlock(); } else if(rcv.name == "acquire_tile_none") { AcquireEntry entry; entry.name = rcv.name; acquire_queue.push_back(entry); lock.unlock(); } else if(rcv.name == "release_tile") { AcquireEntry entry; entry.name = rcv.name; acquire_queue.push_back(entry); lock.unlock(); } else { cout << "Error: unexpected RPC receive call \"" + rcv.name + "\"\n"; lock.unlock(); } } bool task_acquire_tile(Device *, RenderTile& tile) { thread_scoped_lock acquire_lock(acquire_mutex); bool result = false; RPCSend snd(socket, &error_func, "acquire_tile"); snd.write(); do { if(blocked_waiting) listen_step(); /* todo: avoid busy wait loop */ thread_scoped_lock lock(rpc_lock); if(!acquire_queue.empty()) { AcquireEntry entry = acquire_queue.front(); acquire_queue.pop_front(); if(entry.name == "acquire_tile") { tile = entry.tile; if(tile.buffer) tile.buffer = ptr_map[tile.buffer]; result = true; break; } else if(entry.name == "acquire_tile_none") { break; } else { cout << "Error: unexpected acquire RPC receive call \"" + entry.name + "\"\n"; } } } while(acquire_queue.empty() && !stop && !have_error()); return result; } void task_update_progress_sample() { ; /* skip */ } void task_update_tile_sample(RenderTile&) { ; /* skip */ } void task_release_tile(RenderTile& tile) { thread_scoped_lock acquire_lock(acquire_mutex); if(tile.buffer) tile.buffer = ptr_imap[tile.buffer]; { thread_scoped_lock lock(rpc_lock); RPCSend snd(socket, &error_func, "release_tile"); snd.add(tile); snd.write(); lock.unlock(); } do { if(blocked_waiting) listen_step(); /* todo: avoid busy wait loop */ thread_scoped_lock lock(rpc_lock); if(!acquire_queue.empty()) { AcquireEntry entry = acquire_queue.front(); acquire_queue.pop_front(); if(entry.name == "release_tile") { lock.unlock(); break; } else { cout << "Error: unexpected release RPC receive call \"" + entry.name + "\"\n"; } } } while(acquire_queue.empty() && !stop); } bool task_get_cancel() { return false; } /* properties */ Device *device; tcp::socket& socket; /* mapping of remote to local pointer */ PtrMap ptr_map; PtrMap ptr_imap; DataMap mem_data; struct AcquireEntry { string name; RenderTile tile; }; thread_mutex acquire_mutex; list acquire_queue; bool stop; bool blocked_waiting; private: NetworkError error_func; /* todo: free memory and device (osl) on network error */ }; void Device::server_run() { try { /* starts thread that responds to discovery requests */ ServerDiscovery discovery; for(;;) { /* accept connection */ boost::asio::io_service io_service; tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), SERVER_PORT)); tcp::socket socket(io_service); acceptor.accept(socket); string remote_address = socket.remote_endpoint().address().to_string(); printf("Connected to remote client at: %s\n", remote_address.c_str()); DeviceServer server(this, socket); server.listen(); printf("Disconnected.\n"); } } catch(exception& e) { fprintf(stderr, "Network server exception: %s\n", e.what()); } } CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/device/device_network.h000066400000000000000000000267521334742672700230310ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEVICE_NETWORK_H__ #define __DEVICE_NETWORK_H__ #ifdef WITH_NETWORK #include #include #include #include #include #include #include #include #include #include #include #include #include "render/buffers.h" #include "util/util_foreach.h" #include "util/util_list.h" #include "util/util_map.h" #include "util/util_param.h" #include "util/util_string.h" CCL_NAMESPACE_BEGIN using std::cout; using std::cerr; using std::hex; using std::setw; using std::exception; using boost::asio::ip::tcp; static const int SERVER_PORT = 5120; static const int DISCOVER_PORT = 5121; static const string DISCOVER_REQUEST_MSG = "REQUEST_RENDER_SERVER_IP"; static const string DISCOVER_REPLY_MSG = "REPLY_RENDER_SERVER_IP"; #if 0 typedef boost::archive::text_oarchive o_archive; typedef boost::archive::text_iarchive i_archive; #else typedef boost::archive::binary_oarchive o_archive; typedef boost::archive::binary_iarchive i_archive; #endif /* Serialization of device memory */ class network_device_memory : public device_memory { public: network_device_memory(Device *device) : device_memory(device, "", MEM_READ_ONLY) { } ~network_device_memory() { device_pointer = 0; }; vector local_data; }; /* Common netowrk error function / object for both DeviceNetwork and DeviceServer*/ class NetworkError { public: NetworkError() { error = ""; error_count = 0; } ~NetworkError() {} void network_error(const string& message) { error = message; error_count += 1; } bool have_error() { return true ? error_count > 0 : false; } private: string error; int error_count; }; /* Remote procedure call Send */ class RPCSend { public: RPCSend(tcp::socket& socket_, NetworkError* e, const string& name_ = "") : name(name_), socket(socket_), archive(archive_stream), sent(false) { archive & name_; error_func = e; fprintf(stderr, "rpc send %s\n", name.c_str()); } ~RPCSend() { } void add(const device_memory& mem) { archive & mem.data_type & mem.data_elements & mem.data_size; archive & mem.data_width & mem.data_height & mem.data_depth & mem.device_pointer; archive & mem.type & string(mem.name); archive & mem.interpolation & mem.extension; archive & mem.device_pointer; } template void add(const T& data) { archive & data; } void add(const DeviceTask& task) { int type = (int)task.type; archive & type & task.x & task.y & task.w & task.h; archive & task.rgba_byte & task.rgba_half & task.buffer & task.sample & task.num_samples; archive & task.offset & task.stride; archive & task.shader_input & task.shader_output & task.shader_eval_type; archive & task.shader_x & task.shader_w; archive & task.need_finish_queue; } void add(const RenderTile& tile) { archive & tile.x & tile.y & tile.w & tile.h; archive & tile.start_sample & tile.num_samples & tile.sample; archive & tile.resolution & tile.offset & tile.stride; archive & tile.buffer; } void write() { boost::system::error_code error; /* get string from stream */ string archive_str = archive_stream.str(); /* first send fixed size header with size of following data */ ostringstream header_stream; header_stream << setw(8) << hex << archive_str.size(); string header_str = header_stream.str(); boost::asio::write(socket, boost::asio::buffer(header_str), boost::asio::transfer_all(), error); if(error.value()) error_func->network_error(error.message()); /* then send actual data */ boost::asio::write(socket, boost::asio::buffer(archive_str), boost::asio::transfer_all(), error); if(error.value()) error_func->network_error(error.message()); sent = true; } void write_buffer(void *buffer, size_t size) { boost::system::error_code error; boost::asio::write(socket, boost::asio::buffer(buffer, size), boost::asio::transfer_all(), error); if(error.value()) error_func->network_error(error.message()); } protected: string name; tcp::socket& socket; ostringstream archive_stream; o_archive archive; bool sent; NetworkError *error_func; }; /* Remote procedure call Receive */ class RPCReceive { public: RPCReceive(tcp::socket& socket_, NetworkError* e ) : socket(socket_), archive_stream(NULL), archive(NULL) { error_func = e; /* read head with fixed size */ vector header(8); boost::system::error_code error; size_t len = boost::asio::read(socket, boost::asio::buffer(header), error); if(error.value()) { error_func->network_error(error.message()); } /* verify if we got something */ if(len == header.size()) { /* decode header */ string header_str(&header[0], header.size()); istringstream header_stream(header_str); size_t data_size; if((header_stream >> hex >> data_size)) { vector data(data_size); size_t len = boost::asio::read(socket, boost::asio::buffer(data), error); if(error.value()) error_func->network_error(error.message()); if(len == data_size) { archive_str = (data.size())? string(&data[0], data.size()): string(""); archive_stream = new istringstream(archive_str); archive = new i_archive(*archive_stream); *archive & name; fprintf(stderr, "rpc receive %s\n", name.c_str()); } else { error_func->network_error("Network receive error: data size doesn't match header"); } } else { error_func->network_error("Network receive error: can't decode data size from header"); } } else { error_func->network_error("Network receive error: invalid header size"); } } ~RPCReceive() { delete archive; delete archive_stream; } void read(network_device_memory& mem, string& name) { *archive & mem.data_type & mem.data_elements & mem.data_size; *archive & mem.data_width & mem.data_height & mem.data_depth & mem.device_pointer; *archive & mem.type & name; *archive & mem.interpolation & mem.extension; *archive & mem.device_pointer; mem.name = name.c_str(); mem.host_pointer = 0; /* Can't transfer OpenGL texture over network. */ if(mem.type == MEM_PIXELS) { mem.type = MEM_READ_WRITE; } } template void read(T& data) { *archive & data; } void read_buffer(void *buffer, size_t size) { boost::system::error_code error; size_t len = boost::asio::read(socket, boost::asio::buffer(buffer, size), error); if(error.value()) { error_func->network_error(error.message()); } if(len != size) cout << "Network receive error: buffer size doesn't match expected size\n"; } void read(DeviceTask& task) { int type; *archive & type & task.x & task.y & task.w & task.h; *archive & task.rgba_byte & task.rgba_half & task.buffer & task.sample & task.num_samples; *archive & task.offset & task.stride; *archive & task.shader_input & task.shader_output & task.shader_eval_type; *archive & task.shader_x & task.shader_w; *archive & task.need_finish_queue; task.type = (DeviceTask::Type)type; } void read(RenderTile& tile) { *archive & tile.x & tile.y & tile.w & tile.h; *archive & tile.start_sample & tile.num_samples & tile.sample; *archive & tile.resolution & tile.offset & tile.stride; *archive & tile.buffer; tile.buffers = NULL; } string name; protected: tcp::socket& socket; string archive_str; istringstream *archive_stream; i_archive *archive; NetworkError *error_func; }; /* Server auto discovery */ class ServerDiscovery { public: explicit ServerDiscovery(bool discover = false) : listen_socket(io_service), collect_servers(false) { /* setup listen socket */ listen_endpoint.address(boost::asio::ip::address_v4::any()); listen_endpoint.port(DISCOVER_PORT); listen_socket.open(listen_endpoint.protocol()); boost::asio::socket_base::reuse_address option(true); listen_socket.set_option(option); listen_socket.bind(listen_endpoint); /* setup receive callback */ async_receive(); /* start server discovery */ if(discover) { collect_servers = true; servers.clear(); broadcast_message(DISCOVER_REQUEST_MSG); } /* start thread */ work = new boost::asio::io_service::work(io_service); thread = new boost::thread(boost::bind(&boost::asio::io_service::run, &io_service)); } ~ServerDiscovery() { io_service.stop(); thread->join(); delete thread; delete work; } vector get_server_list() { vector result; mutex.lock(); result = vector(servers.begin(), servers.end()); mutex.unlock(); return result; } private: void handle_receive_from(const boost::system::error_code& error, size_t size) { if(error) { cout << "Server discovery receive error: " << error.message() << "\n"; return; } if(size > 0) { string msg = string(receive_buffer, size); /* handle incoming message */ if(collect_servers) { if(msg == DISCOVER_REPLY_MSG) { string address = receive_endpoint.address().to_string(); mutex.lock(); /* add address if it's not already in the list */ bool found = std::find(servers.begin(), servers.end(), address) != servers.end(); if(!found) servers.push_back(address); mutex.unlock(); } } else { /* reply to request */ if(msg == DISCOVER_REQUEST_MSG) broadcast_message(DISCOVER_REPLY_MSG); } } async_receive(); } void async_receive() { listen_socket.async_receive_from( boost::asio::buffer(receive_buffer), receive_endpoint, boost::bind(&ServerDiscovery::handle_receive_from, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } void broadcast_message(const string& msg) { /* setup broadcast socket */ boost::asio::ip::udp::socket socket(io_service); socket.open(boost::asio::ip::udp::v4()); boost::asio::socket_base::broadcast option(true); socket.set_option(option); boost::asio::ip::udp::endpoint broadcast_endpoint( boost::asio::ip::address::from_string("255.255.255.255"), DISCOVER_PORT); /* broadcast message */ socket.send_to(boost::asio::buffer(msg), broadcast_endpoint); } /* network service and socket */ boost::asio::io_service io_service; boost::asio::ip::udp::endpoint listen_endpoint; boost::asio::ip::udp::socket listen_socket; /* threading */ boost::thread *thread; boost::asio::io_service::work *work; boost::mutex mutex; /* buffer and endpoint for receiving messages */ char receive_buffer[256]; boost::asio::ip::udp::endpoint receive_endpoint; // os, version, devices, status, host name, group name, ip as far as fields go struct ServerInfo { string cycles_version; string os; int device_count; string status; string host_name; string group_name; string host_addr; }; /* collection of server addresses in list */ bool collect_servers; vector servers; }; CCL_NAMESPACE_END #endif #endif /* __DEVICE_NETWORK_H__ */ goxel-0.8.1/ext_src/cycles/src/device/device_opencl.cpp000066400000000000000000000176611334742672700231520ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef WITH_OPENCL #include "device/opencl/opencl.h" #include "device/device_intern.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_set.h" CCL_NAMESPACE_BEGIN Device *device_opencl_create(DeviceInfo& info, Stats &stats, bool background) { vector usable_devices; OpenCLInfo::get_usable_devices(&usable_devices); assert(info.num < usable_devices.size()); const OpenCLPlatformDevice& platform_device = usable_devices[info.num]; const string& platform_name = platform_device.platform_name; const cl_device_type device_type = platform_device.device_type; if(OpenCLInfo::kernel_use_split(platform_name, device_type)) { VLOG(1) << "Using split kernel."; return opencl_create_split_device(info, stats, background); } else { VLOG(1) << "Using mega kernel."; return opencl_create_mega_device(info, stats, background); } } bool device_opencl_init(void) { static bool initialized = false; static bool result = false; if(initialized) return result; initialized = true; if(OpenCLInfo::device_type() != 0) { int clew_result = clewInit(); if(clew_result == CLEW_SUCCESS) { VLOG(1) << "CLEW initialization succeeded."; result = true; } else { VLOG(1) << "CLEW initialization failed: " << ((clew_result == CLEW_ERROR_ATEXIT_FAILED) ? "Error setting up atexit() handler" : "Error opening the library"); } } else { VLOG(1) << "Skip initializing CLEW, platform is force disabled."; result = false; } return result; } static cl_int device_opencl_get_num_platforms_safe(cl_uint *num_platforms) { #ifdef _WIN32 __try { return clGetPlatformIDs(0, NULL, num_platforms); } __except(EXCEPTION_EXECUTE_HANDLER) { /* Ignore crashes inside the OpenCL driver and hope we can * survive even with corrupted OpenCL installs. */ fprintf(stderr, "Cycles OpenCL: driver crashed, continuing without OpenCL.\n"); } *num_platforms = 0; return CL_DEVICE_NOT_FOUND; #else return clGetPlatformIDs(0, NULL, num_platforms); #endif } void device_opencl_info(vector& devices) { cl_uint num_platforms = 0; device_opencl_get_num_platforms_safe(&num_platforms); if(num_platforms == 0) { return; } vector usable_devices; OpenCLInfo::get_usable_devices(&usable_devices); /* Devices are numbered consecutively across platforms. */ int num_devices = 0; set unique_ids; foreach(OpenCLPlatformDevice& platform_device, usable_devices) { /* Compute unique ID for persistent user preferences. */ const string& platform_name = platform_device.platform_name; const cl_device_type device_type = platform_device.device_type; const string& device_name = platform_device.device_name; string hardware_id = platform_device.hardware_id; if(hardware_id == "") { hardware_id = string_printf("ID_%d", num_devices); } string id = string("OPENCL_") + platform_name + "_" + device_name + "_" + hardware_id; /* Hardware ID might not be unique, add device number in that case. */ if(unique_ids.find(id) != unique_ids.end()) { id += string_printf("_ID_%d", num_devices); } unique_ids.insert(id); /* Create DeviceInfo. */ DeviceInfo info; info.type = DEVICE_OPENCL; info.description = string_remove_trademark(string(device_name)); info.num = num_devices; /* We don't know if it's used for display, but assume it is. */ info.display_device = true; info.advanced_shading = OpenCLInfo::kernel_use_advanced_shading(platform_name); info.use_split_kernel = OpenCLInfo::kernel_use_split(platform_name, device_type); info.has_volume_decoupled = false; info.bvh_layout_mask = BVH_LAYOUT_BVH2; info.id = id; devices.push_back(info); num_devices++; } } string device_opencl_capabilities(void) { if(OpenCLInfo::device_type() == 0) { return "All OpenCL devices are forced to be OFF"; } string result = ""; string error_msg = ""; /* Only used by opencl_assert(), but in the future * it could also be nicely reported to the console. */ cl_uint num_platforms = 0; opencl_assert(device_opencl_get_num_platforms_safe(&num_platforms)); if(num_platforms == 0) { return "No OpenCL platforms found\n"; } result += string_printf("Number of platforms: %u\n", num_platforms); vector platform_ids; platform_ids.resize(num_platforms); opencl_assert(clGetPlatformIDs(num_platforms, &platform_ids[0], NULL)); #define APPEND_STRING_INFO(func, id, name, what) \ do { \ char data[1024] = "\0"; \ opencl_assert(func(id, what, sizeof(data), &data, NULL)); \ result += string_printf("%s: %s\n", name, data); \ } while(false) #define APPEND_STRING_EXTENSION_INFO(func, id, name, what) \ do { \ char data[1024] = "\0"; \ size_t length = 0; \ if(func(id, what, sizeof(data), &data, &length) == CL_SUCCESS) { \ if(length != 0 && data[0] != '\0') { \ result += string_printf("%s: %s\n", name, data); \ } \ } \ } while(false) #define APPEND_PLATFORM_STRING_INFO(id, name, what) \ APPEND_STRING_INFO(clGetPlatformInfo, id, "\tPlatform " name, what) #define APPEND_DEVICE_STRING_INFO(id, name, what) \ APPEND_STRING_INFO(clGetDeviceInfo, id, "\t\t\tDevice " name, what) #define APPEND_DEVICE_STRING_EXTENSION_INFO(id, name, what) \ APPEND_STRING_EXTENSION_INFO(clGetDeviceInfo, id, "\t\t\tDevice " name, what) vector device_ids; for(cl_uint platform = 0; platform < num_platforms; ++platform) { cl_platform_id platform_id = platform_ids[platform]; result += string_printf("Platform #%u\n", platform); APPEND_PLATFORM_STRING_INFO(platform_id, "Name", CL_PLATFORM_NAME); APPEND_PLATFORM_STRING_INFO(platform_id, "Vendor", CL_PLATFORM_VENDOR); APPEND_PLATFORM_STRING_INFO(platform_id, "Version", CL_PLATFORM_VERSION); APPEND_PLATFORM_STRING_INFO(platform_id, "Profile", CL_PLATFORM_PROFILE); APPEND_PLATFORM_STRING_INFO(platform_id, "Extensions", CL_PLATFORM_EXTENSIONS); cl_uint num_devices = 0; opencl_assert(clGetDeviceIDs(platform_ids[platform], CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices)); result += string_printf("\tNumber of devices: %u\n", num_devices); device_ids.resize(num_devices); opencl_assert(clGetDeviceIDs(platform_ids[platform], CL_DEVICE_TYPE_ALL, num_devices, &device_ids[0], NULL)); for(cl_uint device = 0; device < num_devices; ++device) { cl_device_id device_id = device_ids[device]; result += string_printf("\t\tDevice: #%u\n", device); APPEND_DEVICE_STRING_INFO(device_id, "Name", CL_DEVICE_NAME); APPEND_DEVICE_STRING_EXTENSION_INFO(device_id, "Board Name", CL_DEVICE_BOARD_NAME_AMD); APPEND_DEVICE_STRING_INFO(device_id, "Vendor", CL_DEVICE_VENDOR); APPEND_DEVICE_STRING_INFO(device_id, "OpenCL C Version", CL_DEVICE_OPENCL_C_VERSION); APPEND_DEVICE_STRING_INFO(device_id, "Profile", CL_DEVICE_PROFILE); APPEND_DEVICE_STRING_INFO(device_id, "Version", CL_DEVICE_VERSION); APPEND_DEVICE_STRING_INFO(device_id, "Extensions", CL_DEVICE_EXTENSIONS); } } #undef APPEND_STRING_INFO #undef APPEND_PLATFORM_STRING_INFO #undef APPEND_DEVICE_STRING_INFO return result; } CCL_NAMESPACE_END #endif /* WITH_OPENCL */ goxel-0.8.1/ext_src/cycles/src/device/device_split_kernel.cpp000066400000000000000000000245371334742672700243650ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device_split_kernel.h" #include "kernel/kernel_types.h" #include "kernel/split/kernel_split_data_types.h" #include "util/util_logging.h" #include "util/util_time.h" CCL_NAMESPACE_BEGIN static const double alpha = 0.1; /* alpha for rolling average */ DeviceSplitKernel::DeviceSplitKernel(Device *device) : device(device), split_data(device, "split_data"), ray_state(device, "ray_state", MEM_READ_WRITE), queue_index(device, "queue_index"), use_queues_flag(device, "use_queues_flag"), work_pool_wgs(device, "work_pool_wgs") { first_tile = true; avg_time_per_sample = 0.0; kernel_path_init = NULL; kernel_scene_intersect = NULL; kernel_lamp_emission = NULL; kernel_do_volume = NULL; kernel_queue_enqueue = NULL; kernel_indirect_background = NULL; kernel_shader_setup = NULL; kernel_shader_sort = NULL; kernel_shader_eval = NULL; kernel_holdout_emission_blurring_pathtermination_ao = NULL; kernel_subsurface_scatter = NULL; kernel_direct_lighting = NULL; kernel_shadow_blocked_ao = NULL; kernel_shadow_blocked_dl = NULL; kernel_enqueue_inactive = NULL; kernel_next_iteration_setup = NULL; kernel_indirect_subsurface = NULL; kernel_buffer_update = NULL; } DeviceSplitKernel::~DeviceSplitKernel() { split_data.free(); ray_state.free(); use_queues_flag.free(); queue_index.free(); work_pool_wgs.free(); delete kernel_path_init; delete kernel_scene_intersect; delete kernel_lamp_emission; delete kernel_do_volume; delete kernel_queue_enqueue; delete kernel_indirect_background; delete kernel_shader_setup; delete kernel_shader_sort; delete kernel_shader_eval; delete kernel_holdout_emission_blurring_pathtermination_ao; delete kernel_subsurface_scatter; delete kernel_direct_lighting; delete kernel_shadow_blocked_ao; delete kernel_shadow_blocked_dl; delete kernel_enqueue_inactive; delete kernel_next_iteration_setup; delete kernel_indirect_subsurface; delete kernel_buffer_update; } bool DeviceSplitKernel::load_kernels(const DeviceRequestedFeatures& requested_features) { #define LOAD_KERNEL(name) \ kernel_##name = get_split_kernel_function(#name, requested_features); \ if(!kernel_##name) { \ device->set_error(string("Split kernel error: failed to load kernel_") + #name); \ return false; \ } LOAD_KERNEL(path_init); LOAD_KERNEL(scene_intersect); LOAD_KERNEL(lamp_emission); LOAD_KERNEL(do_volume); LOAD_KERNEL(queue_enqueue); LOAD_KERNEL(indirect_background); LOAD_KERNEL(shader_setup); LOAD_KERNEL(shader_sort); LOAD_KERNEL(shader_eval); LOAD_KERNEL(holdout_emission_blurring_pathtermination_ao); LOAD_KERNEL(subsurface_scatter); LOAD_KERNEL(direct_lighting); LOAD_KERNEL(shadow_blocked_ao); LOAD_KERNEL(shadow_blocked_dl); LOAD_KERNEL(enqueue_inactive); LOAD_KERNEL(next_iteration_setup); LOAD_KERNEL(indirect_subsurface); LOAD_KERNEL(buffer_update); #undef LOAD_KERNEL return true; } size_t DeviceSplitKernel::max_elements_for_max_buffer_size(device_memory& kg, device_memory& data, uint64_t max_buffer_size) { uint64_t size_per_element = state_buffer_size(kg, data, 1024) / 1024; VLOG(1) << "Split state element size: " << string_human_readable_number(size_per_element) << " bytes. (" << string_human_readable_size(size_per_element) << ")."; return max_buffer_size / size_per_element; } bool DeviceSplitKernel::path_trace(DeviceTask *task, RenderTile& tile, device_memory& kgbuffer, device_memory& kernel_data) { if(device->have_error()) { return false; } /* Get local size */ size_t local_size[2]; { int2 lsize = split_kernel_local_size(); local_size[0] = lsize[0]; local_size[1] = lsize[1]; } /* Number of elements in the global state buffer */ int num_global_elements = global_size[0] * global_size[1]; /* Allocate all required global memory once. */ if(first_tile) { first_tile = false; /* Set gloabl size */ { int2 gsize = split_kernel_global_size(kgbuffer, kernel_data, task); /* Make sure that set work size is a multiple of local * work size dimensions. */ global_size[0] = round_up(gsize[0], local_size[0]); global_size[1] = round_up(gsize[1], local_size[1]); } num_global_elements = global_size[0] * global_size[1]; assert(num_global_elements % WORK_POOL_SIZE == 0); /* Calculate max groups */ /* Denotes the maximum work groups possible w.r.t. current requested tile size. */ unsigned int work_pool_size = (device->info.type == DEVICE_CPU) ? WORK_POOL_SIZE_CPU : WORK_POOL_SIZE_GPU; unsigned int max_work_groups = num_global_elements / work_pool_size + 1; /* Allocate work_pool_wgs memory. */ work_pool_wgs.alloc_to_device(max_work_groups); queue_index.alloc_to_device(NUM_QUEUES); use_queues_flag.alloc_to_device(1); split_data.alloc_to_device(state_buffer_size(kgbuffer, kernel_data, num_global_elements)); ray_state.alloc(num_global_elements); } #define ENQUEUE_SPLIT_KERNEL(name, global_size, local_size) \ if(device->have_error()) { \ return false; \ } \ if(!kernel_##name->enqueue(KernelDimensions(global_size, local_size), kgbuffer, kernel_data)) { \ return false; \ } tile.sample = tile.start_sample; /* for exponential increase between tile updates */ int time_multiplier = 1; while(tile.sample < tile.start_sample + tile.num_samples) { /* to keep track of how long it takes to run a number of samples */ double start_time = time_dt(); /* initial guess to start rolling average */ const int initial_num_samples = 1; /* approx number of samples per second */ int samples_per_second = (avg_time_per_sample > 0.0) ? int(double(time_multiplier) / avg_time_per_sample) + 1 : initial_num_samples; RenderTile subtile = tile; subtile.start_sample = tile.sample; subtile.num_samples = min(samples_per_second, tile.start_sample + tile.num_samples - tile.sample); if(device->have_error()) { return false; } /* reset state memory here as global size for data_init * kernel might not be large enough to do in kernel */ work_pool_wgs.zero_to_device(); split_data.zero_to_device(); ray_state.zero_to_device(); if(!enqueue_split_kernel_data_init(KernelDimensions(global_size, local_size), subtile, num_global_elements, kgbuffer, kernel_data, split_data, ray_state, queue_index, use_queues_flag, work_pool_wgs)) { return false; } ENQUEUE_SPLIT_KERNEL(path_init, global_size, local_size); bool activeRaysAvailable = true; double cancel_time = DBL_MAX; while(activeRaysAvailable) { /* Do path-iteration in host [Enqueue Path-iteration kernels. */ for(int PathIter = 0; PathIter < 16; PathIter++) { ENQUEUE_SPLIT_KERNEL(scene_intersect, global_size, local_size); ENQUEUE_SPLIT_KERNEL(lamp_emission, global_size, local_size); ENQUEUE_SPLIT_KERNEL(do_volume, global_size, local_size); ENQUEUE_SPLIT_KERNEL(queue_enqueue, global_size, local_size); ENQUEUE_SPLIT_KERNEL(indirect_background, global_size, local_size); ENQUEUE_SPLIT_KERNEL(shader_setup, global_size, local_size); ENQUEUE_SPLIT_KERNEL(shader_sort, global_size, local_size); ENQUEUE_SPLIT_KERNEL(shader_eval, global_size, local_size); ENQUEUE_SPLIT_KERNEL(holdout_emission_blurring_pathtermination_ao, global_size, local_size); ENQUEUE_SPLIT_KERNEL(subsurface_scatter, global_size, local_size); ENQUEUE_SPLIT_KERNEL(queue_enqueue, global_size, local_size); ENQUEUE_SPLIT_KERNEL(direct_lighting, global_size, local_size); ENQUEUE_SPLIT_KERNEL(shadow_blocked_ao, global_size, local_size); ENQUEUE_SPLIT_KERNEL(shadow_blocked_dl, global_size, local_size); ENQUEUE_SPLIT_KERNEL(enqueue_inactive, global_size, local_size); ENQUEUE_SPLIT_KERNEL(next_iteration_setup, global_size, local_size); ENQUEUE_SPLIT_KERNEL(indirect_subsurface, global_size, local_size); ENQUEUE_SPLIT_KERNEL(queue_enqueue, global_size, local_size); ENQUEUE_SPLIT_KERNEL(buffer_update, global_size, local_size); if(task->get_cancel() && cancel_time == DBL_MAX) { /* Wait up to twice as many seconds for current samples to finish * to avoid artifacts in render result from ending too soon. */ cancel_time = time_dt() + 2.0 * time_multiplier; } if(time_dt() > cancel_time) { return true; } } /* Decide if we should exit path-iteration in host. */ ray_state.copy_from_device(0, global_size[0] * global_size[1], 1); activeRaysAvailable = false; for(int rayStateIter = 0; rayStateIter < global_size[0] * global_size[1]; ++rayStateIter) { if(!IS_STATE(ray_state.data(), rayStateIter, RAY_INACTIVE)) { if(IS_STATE(ray_state.data(), rayStateIter, RAY_INVALID)) { /* Something went wrong, abort to avoid looping endlessly. */ device->set_error("Split kernel error: invalid ray state"); return false; } /* Not all rays are RAY_INACTIVE. */ activeRaysAvailable = true; break; } } if(time_dt() > cancel_time) { return true; } } double time_per_sample = ((time_dt()-start_time) / subtile.num_samples); if(avg_time_per_sample == 0.0) { /* start rolling average */ avg_time_per_sample = time_per_sample; } else { avg_time_per_sample = alpha*time_per_sample + (1.0-alpha)*avg_time_per_sample; } #undef ENQUEUE_SPLIT_KERNEL tile.sample += subtile.num_samples; task->update_progress(&tile, tile.w*tile.h*subtile.num_samples); time_multiplier = min(time_multiplier << 1, 10); if(task->get_cancel()) { return true; } } return true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device_split_kernel.h000066400000000000000000000115771334742672700240320ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEVICE_SPLIT_KERNEL_H__ #define __DEVICE_SPLIT_KERNEL_H__ #include "device/device.h" #include "render/buffers.h" CCL_NAMESPACE_BEGIN /* When allocate global memory in chunks. We may not be able to * allocate exactly "CL_DEVICE_MAX_MEM_ALLOC_SIZE" bytes in chunks; * Since some bytes may be needed for aligning chunks of memory; * This is the amount of memory that we dedicate for that purpose. */ #define DATA_ALLOCATION_MEM_FACTOR 5000000 //5MB /* Types used for split kernel */ class KernelDimensions { public: size_t global_size[2]; size_t local_size[2]; KernelDimensions(size_t global_size_[2], size_t local_size_[2]) { memcpy(global_size, global_size_, sizeof(global_size)); memcpy(local_size, local_size_, sizeof(local_size)); } }; class SplitKernelFunction { public: virtual ~SplitKernelFunction() {} /* enqueue the kernel, returns false if there is an error */ virtual bool enqueue(const KernelDimensions& dim, device_memory& kg, device_memory& data) = 0; }; class DeviceSplitKernel { private: Device *device; SplitKernelFunction *kernel_path_init; SplitKernelFunction *kernel_scene_intersect; SplitKernelFunction *kernel_lamp_emission; SplitKernelFunction *kernel_do_volume; SplitKernelFunction *kernel_queue_enqueue; SplitKernelFunction *kernel_indirect_background; SplitKernelFunction *kernel_shader_setup; SplitKernelFunction *kernel_shader_sort; SplitKernelFunction *kernel_shader_eval; SplitKernelFunction *kernel_holdout_emission_blurring_pathtermination_ao; SplitKernelFunction *kernel_subsurface_scatter; SplitKernelFunction *kernel_direct_lighting; SplitKernelFunction *kernel_shadow_blocked_ao; SplitKernelFunction *kernel_shadow_blocked_dl; SplitKernelFunction *kernel_enqueue_inactive; SplitKernelFunction *kernel_next_iteration_setup; SplitKernelFunction *kernel_indirect_subsurface; SplitKernelFunction *kernel_buffer_update; /* Global memory variables [porting]; These memory is used for * co-operation between different kernels; Data written by one * kernel will be available to another kernel via this global * memory. */ device_only_memory split_data; device_vector ray_state; device_only_memory queue_index; /* Array of size num_queues that tracks the size of each queue. */ /* Flag to make sceneintersect and lampemission kernel use queues. */ device_only_memory use_queues_flag; /* Approximate time it takes to complete one sample */ double avg_time_per_sample; /* Work pool with respect to each work group. */ device_only_memory work_pool_wgs; /* Marked True in constructor and marked false at the end of path_trace(). */ bool first_tile; /* Cached global size */ size_t global_size[2]; public: explicit DeviceSplitKernel(Device* device); virtual ~DeviceSplitKernel(); bool load_kernels(const DeviceRequestedFeatures& requested_features); bool path_trace(DeviceTask *task, RenderTile& rtile, device_memory& kgbuffer, device_memory& kernel_data); virtual uint64_t state_buffer_size(device_memory& kg, device_memory& data, size_t num_threads) = 0; size_t max_elements_for_max_buffer_size(device_memory& kg, device_memory& data, uint64_t max_buffer_size); virtual bool enqueue_split_kernel_data_init(const KernelDimensions& dim, RenderTile& rtile, int num_global_elements, device_memory& kernel_globals, device_memory& kernel_data_, device_memory& split_data, device_memory& ray_state, device_memory& queue_index, device_memory& use_queues_flag, device_memory& work_pool_wgs) = 0; virtual SplitKernelFunction* get_split_kernel_function(const string& kernel_name, const DeviceRequestedFeatures&) = 0; virtual int2 split_kernel_local_size() = 0; virtual int2 split_kernel_global_size(device_memory& kg, device_memory& data, DeviceTask *task) = 0; }; CCL_NAMESPACE_END #endif /* __DEVICE_SPLIT_KERNEL_H__ */ goxel-0.8.1/ext_src/cycles/src/device/device_task.cpp000066400000000000000000000052461334742672700226300ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include "device/device_task.h" #include "render/buffers.h" #include "util/util_algorithm.h" #include "util/util_time.h" CCL_NAMESPACE_BEGIN /* Device Task */ DeviceTask::DeviceTask(Type type_) : type(type_), x(0), y(0), w(0), h(0), rgba_byte(0), rgba_half(0), buffer(0), sample(0), num_samples(1), shader_input(0), shader_output(0), shader_eval_type(0), shader_filter(0), shader_x(0), shader_w(0) { last_update_time = time_dt(); } int DeviceTask::get_subtask_count(int num, int max_size) { if(max_size != 0) { int max_size_num; if(type == SHADER) { max_size_num = (shader_w + max_size - 1)/max_size; } else { max_size = max(1, max_size/w); max_size_num = (h + max_size - 1)/max_size; } num = max(max_size_num, num); } if(type == SHADER) { num = min(shader_w, num); } else if(type == RENDER) { } else { num = min(h, num); } return num; } void DeviceTask::split(list& tasks, int num, int max_size) { num = get_subtask_count(num, max_size); if(type == SHADER) { for(int i = 0; i < num; i++) { int tx = shader_x + (shader_w/num)*i; int tw = (i == num-1)? shader_w - i*(shader_w/num): shader_w/num; DeviceTask task = *this; task.shader_x = tx; task.shader_w = tw; tasks.push_back(task); } } else if(type == RENDER) { for(int i = 0; i < num; i++) tasks.push_back(*this); } else { for(int i = 0; i < num; i++) { int ty = y + (h/num)*i; int th = (i == num-1)? h - i*(h/num): h/num; DeviceTask task = *this; task.y = ty; task.h = th; tasks.push_back(task); } } } void DeviceTask::update_progress(RenderTile *rtile, int pixel_samples) { if((type != RENDER) && (type != SHADER)) return; if(update_progress_sample) { if(pixel_samples == -1) { pixel_samples = shader_w; } update_progress_sample(pixel_samples, rtile? rtile->sample : 0); } if(update_tile_sample) { double current_time = time_dt(); if(current_time - last_update_time >= 1.0) { update_tile_sample(*rtile); last_update_time = current_time; } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/device/device_task.h000066400000000000000000000042431334742672700222710ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __DEVICE_TASK_H__ #define __DEVICE_TASK_H__ #include "device/device_memory.h" #include "util/util_function.h" #include "util/util_list.h" #include "util/util_task.h" CCL_NAMESPACE_BEGIN /* Device Task */ class Device; class RenderBuffers; class RenderTile; class Tile; class DeviceTask : public Task { public: typedef enum { RENDER, FILM_CONVERT, SHADER } Type; Type type; int x, y, w, h; device_ptr rgba_byte; device_ptr rgba_half; device_ptr buffer; int sample; int num_samples; int offset, stride; device_ptr shader_input; device_ptr shader_output; int shader_eval_type; int shader_filter; int shader_x, shader_w; int passes_size; explicit DeviceTask(Type type = RENDER); int get_subtask_count(int num, int max_size = 0); void split(list& tasks, int num, int max_size = 0); void update_progress(RenderTile *rtile, int pixel_samples = -1); function acquire_tile; function update_progress_sample; function update_tile_sample; function release_tile; function get_cancel; function map_neighbor_tiles; function unmap_neighbor_tiles; int denoising_radius; float denoising_strength; float denoising_feature_strength; bool denoising_relative_pca; int pass_stride; int pass_denoising_data; int pass_denoising_clean; bool need_finish_queue; bool integrator_branched; int2 requested_tile_size; protected: double last_update_time; }; CCL_NAMESPACE_END #endif /* __DEVICE_TASK_H__ */ goxel-0.8.1/ext_src/cycles/src/graph/000077500000000000000000000000001334742672700174765ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/graph/node.cpp000066400000000000000000000376311334742672700211410ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "graph/node.h" #include "graph/node_type.h" #include "util/util_foreach.h" #include "util/util_md5.h" #include "util/util_param.h" #include "util/util_transform.h" CCL_NAMESPACE_BEGIN /* Node Type */ Node::Node(const NodeType *type_, ustring name_) : name(name_), type(type_) { assert(type); /* assign non-empty name, convenient for debugging */ if(name.empty()) { name = type->name; } /* initialize default values */ foreach(const SocketType& socket, type->inputs) { set_default_value(socket); } } Node::~Node() { } template static T& get_socket_value(const Node *node, const SocketType& socket) { return (T&)*(((char*)node) + socket.struct_offset); } #ifndef NDEBUG static bool is_socket_float3(const SocketType& socket) { return socket.type == SocketType::COLOR || socket.type == SocketType::POINT || socket.type == SocketType::VECTOR || socket.type == SocketType::NORMAL; } static bool is_socket_array_float3(const SocketType& socket) { return socket.type == SocketType::COLOR_ARRAY || socket.type == SocketType::POINT_ARRAY || socket.type == SocketType::VECTOR_ARRAY || socket.type == SocketType::NORMAL_ARRAY; } #endif /* set values */ void Node::set(const SocketType& input, bool value) { assert(input.type == SocketType::BOOLEAN); get_socket_value(this, input) = value; } void Node::set(const SocketType& input, int value) { assert((input.type == SocketType::INT || input.type == SocketType::ENUM)); get_socket_value(this, input) = value; } void Node::set(const SocketType& input, uint value) { assert(input.type == SocketType::UINT); get_socket_value(this, input) = value; } void Node::set(const SocketType& input, float value) { assert(input.type == SocketType::FLOAT); get_socket_value(this, input) = value; } void Node::set(const SocketType& input, float2 value) { assert(input.type == SocketType::FLOAT); get_socket_value(this, input) = value; } void Node::set(const SocketType& input, float3 value) { assert(is_socket_float3(input)); get_socket_value(this, input) = value; } void Node::set(const SocketType& input, const char *value) { set(input, ustring(value)); } void Node::set(const SocketType& input, ustring value) { if(input.type == SocketType::STRING) { get_socket_value(this, input) = value; } else if(input.type == SocketType::ENUM) { const NodeEnum& enm = *input.enum_values; if(enm.exists(value)) { get_socket_value(this, input) = enm[value]; } else { assert(0); } } else { assert(0); } } void Node::set(const SocketType& input, const Transform& value) { assert(input.type == SocketType::TRANSFORM); get_socket_value(this, input) = value; } void Node::set(const SocketType& input, Node *value) { assert(input.type == SocketType::TRANSFORM); get_socket_value(this, input) = value; } /* set array values */ void Node::set(const SocketType& input, array& value) { assert(input.type == SocketType::BOOLEAN_ARRAY); get_socket_value >(this, input).steal_data(value); } void Node::set(const SocketType& input, array& value) { assert(input.type == SocketType::INT_ARRAY); get_socket_value >(this, input).steal_data(value); } void Node::set(const SocketType& input, array& value) { assert(input.type == SocketType::FLOAT_ARRAY); get_socket_value >(this, input).steal_data(value); } void Node::set(const SocketType& input, array& value) { assert(input.type == SocketType::FLOAT_ARRAY); get_socket_value >(this, input).steal_data(value); } void Node::set(const SocketType& input, array& value) { assert(is_socket_array_float3(input)); get_socket_value >(this, input).steal_data(value); } void Node::set(const SocketType& input, array& value) { assert(input.type == SocketType::STRING_ARRAY); get_socket_value >(this, input).steal_data(value); } void Node::set(const SocketType& input, array& value) { assert(input.type == SocketType::TRANSFORM_ARRAY); get_socket_value >(this, input).steal_data(value); } void Node::set(const SocketType& input, array& value) { assert(input.type == SocketType::TRANSFORM_ARRAY); get_socket_value >(this, input).steal_data(value); } /* get values */ bool Node::get_bool(const SocketType& input) const { assert(input.type == SocketType::BOOLEAN); return get_socket_value(this, input); } int Node::get_int(const SocketType& input) const { assert(input.type == SocketType::INT || input.type == SocketType::ENUM); return get_socket_value(this, input); } uint Node::get_uint(const SocketType& input) const { assert(input.type == SocketType::UINT); return get_socket_value(this, input); } float Node::get_float(const SocketType& input) const { assert(input.type == SocketType::FLOAT); return get_socket_value(this, input); } float2 Node::get_float2(const SocketType& input) const { assert(input.type == SocketType::FLOAT); return get_socket_value(this, input); } float3 Node::get_float3(const SocketType& input) const { assert(is_socket_float3(input)); return get_socket_value(this, input); } ustring Node::get_string(const SocketType& input) const { if(input.type == SocketType::STRING) { return get_socket_value(this, input); } else if(input.type == SocketType::ENUM) { const NodeEnum& enm = *input.enum_values; int intvalue = get_socket_value(this, input); return (enm.exists(intvalue)) ? enm[intvalue] : ustring(); } else { assert(0); return ustring(); } } Transform Node::get_transform(const SocketType& input) const { assert(input.type == SocketType::TRANSFORM); return get_socket_value(this, input); } Node *Node::get_node(const SocketType& input) const { assert(input.type == SocketType::NODE); return get_socket_value(this, input); } /* get array values */ const array& Node::get_bool_array(const SocketType& input) const { assert(input.type == SocketType::BOOLEAN_ARRAY); return get_socket_value >(this, input); } const array& Node::get_int_array(const SocketType& input) const { assert(input.type == SocketType::INT_ARRAY); return get_socket_value >(this, input); } const array& Node::get_float_array(const SocketType& input) const { assert(input.type == SocketType::FLOAT_ARRAY); return get_socket_value >(this, input); } const array& Node::get_float2_array(const SocketType& input) const { assert(input.type == SocketType::FLOAT_ARRAY); return get_socket_value >(this, input); } const array& Node::get_float3_array(const SocketType& input) const { assert(is_socket_array_float3(input)); return get_socket_value >(this, input); } const array& Node::get_string_array(const SocketType& input) const { assert(input.type == SocketType::STRING_ARRAY); return get_socket_value >(this, input); } const array& Node::get_transform_array(const SocketType& input) const { assert(input.type == SocketType::TRANSFORM_ARRAY); return get_socket_value >(this, input); } const array& Node::get_node_array(const SocketType& input) const { assert(input.type == SocketType::NODE_ARRAY); return get_socket_value >(this, input); } /* generic value operations */ bool Node::has_default_value(const SocketType& input) const { const void *src = input.default_value; void *dst = &get_socket_value(this, input); return memcmp(dst, src, input.size()) == 0; } void Node::set_default_value(const SocketType& socket) { const void *src = socket.default_value; void *dst = ((char*)this) + socket.struct_offset; if (src) memcpy(dst, src, socket.size()); } template static void copy_array(const Node *node, const SocketType& socket, const Node *other, const SocketType& other_socket) { const array* src = (const array*)(((char*)other) + other_socket.struct_offset); array* dst = (array*)(((char*)node) + socket.struct_offset); *dst = *src; } void Node::copy_value(const SocketType& socket, const Node& other, const SocketType& other_socket) { assert(socket.type == other_socket.type); if(socket.is_array()) { switch(socket.type) { case SocketType::BOOLEAN_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::FLOAT_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::INT_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::COLOR_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::VECTOR_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::POINT_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::NORMAL_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::POINT2_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::STRING_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::TRANSFORM_ARRAY: copy_array(this, socket, &other, other_socket); break; case SocketType::NODE_ARRAY: copy_array(this, socket, &other, other_socket); break; default: assert(0); break; } } else { const void *src = ((char*)&other) + other_socket.struct_offset; void *dst = ((char*)this) + socket.struct_offset; memcpy(dst, src, socket.size()); } } template static bool is_array_equal(const Node *node, const Node *other, const SocketType& socket) { const array* a = (const array*)(((char*)node) + socket.struct_offset); const array* b = (const array*)(((char*)other) + socket.struct_offset); return *a == *b; } template static bool is_value_equal(const Node *node, const Node *other, const SocketType& socket) { const T *a = (const T*)(((char*)node) + socket.struct_offset); const T *b = (const T*)(((char*)other) + socket.struct_offset); return *a == *b; } bool Node::equals_value(const Node& other, const SocketType& socket) const { switch(socket.type) { case SocketType::BOOLEAN: return is_value_equal(this, &other, socket); case SocketType::FLOAT: return is_value_equal(this, &other, socket); case SocketType::INT: return is_value_equal(this, &other, socket); case SocketType::UINT: return is_value_equal(this, &other, socket); case SocketType::COLOR: return is_value_equal(this, &other, socket); case SocketType::VECTOR: return is_value_equal(this, &other, socket); case SocketType::POINT: return is_value_equal(this, &other, socket); case SocketType::NORMAL: return is_value_equal(this, &other, socket); case SocketType::POINT2: return is_value_equal(this, &other, socket); case SocketType::CLOSURE: return true; case SocketType::STRING: return is_value_equal(this, &other, socket); case SocketType::ENUM: return is_value_equal(this, &other, socket); case SocketType::TRANSFORM: return is_value_equal(this, &other, socket); case SocketType::NODE: return is_value_equal(this, &other, socket); case SocketType::BOOLEAN_ARRAY: return is_array_equal(this, &other, socket); case SocketType::FLOAT_ARRAY: return is_array_equal(this, &other, socket); case SocketType::INT_ARRAY: return is_array_equal(this, &other, socket); case SocketType::COLOR_ARRAY: return is_array_equal(this, &other, socket); case SocketType::VECTOR_ARRAY: return is_array_equal(this, &other, socket); case SocketType::POINT_ARRAY: return is_array_equal(this, &other, socket); case SocketType::NORMAL_ARRAY: return is_array_equal(this, &other, socket); case SocketType::POINT2_ARRAY: return is_array_equal(this, &other, socket); case SocketType::STRING_ARRAY: return is_array_equal(this, &other, socket); case SocketType::TRANSFORM_ARRAY: return is_array_equal(this, &other, socket); case SocketType::NODE_ARRAY: return is_array_equal(this, &other, socket); case SocketType::UNDEFINED: return true; } return true; } /* equals */ bool Node::equals(const Node& other) const { assert(type == other.type); foreach(const SocketType& socket, type->inputs) { if(!equals_value(other, socket)) return false; } return true; } /* Hash */ template static void value_hash(const Node *node, const SocketType& socket, MD5Hash& md5) { md5.append(((uint8_t*)node) + socket.struct_offset, socket.size()); } static void float3_hash(const Node *node, const SocketType& socket, MD5Hash& md5) { /* Don't compare 4th element used for padding. */ md5.append(((uint8_t*)node) + socket.struct_offset, sizeof(float) * 3); } template static void array_hash(const Node *node, const SocketType& socket, MD5Hash& md5) { const array& a = *(const array*)(((char*)node) + socket.struct_offset); for (size_t i = 0; i < a.size(); i++) { md5.append((uint8_t*)&a[i], sizeof(T)); } } static void float3_array_hash(const Node *node, const SocketType& socket, MD5Hash& md5) { /* Don't compare 4th element used for padding. */ const array& a = *(const array*)(((char*)node) + socket.struct_offset); for (size_t i = 0; i < a.size(); i++) { md5.append((uint8_t*)&a[i], sizeof(float) * 3); } } void Node::hash(MD5Hash& md5) { md5.append(type->name.string()); foreach(const SocketType& socket, type->inputs) { md5.append(socket.name.string()); switch(socket.type) { case SocketType::BOOLEAN: value_hash(this, socket, md5); break; case SocketType::FLOAT: value_hash(this, socket, md5); break; case SocketType::INT: value_hash(this, socket, md5); break; case SocketType::UINT: value_hash(this, socket, md5); break; case SocketType::COLOR: float3_hash(this, socket, md5); break; case SocketType::VECTOR: float3_hash(this, socket, md5); break; case SocketType::POINT: float3_hash(this, socket, md5); break; case SocketType::NORMAL: float3_hash(this, socket, md5); break; case SocketType::POINT2: value_hash(this, socket, md5); break; case SocketType::CLOSURE: break; case SocketType::STRING: value_hash(this, socket, md5); break; case SocketType::ENUM: value_hash(this, socket, md5); break; case SocketType::TRANSFORM: value_hash(this, socket, md5); break; case SocketType::NODE: value_hash(this, socket, md5); break; case SocketType::BOOLEAN_ARRAY: array_hash(this, socket, md5); break; case SocketType::FLOAT_ARRAY: array_hash(this, socket, md5); break; case SocketType::INT_ARRAY: array_hash(this, socket, md5); break; case SocketType::COLOR_ARRAY: float3_array_hash(this, socket, md5); break; case SocketType::VECTOR_ARRAY: float3_array_hash(this, socket, md5); break; case SocketType::POINT_ARRAY: float3_array_hash(this, socket, md5); break; case SocketType::NORMAL_ARRAY: float3_array_hash(this, socket, md5); break; case SocketType::POINT2_ARRAY: array_hash(this, socket, md5); break; case SocketType::STRING_ARRAY: array_hash(this, socket, md5); break; case SocketType::TRANSFORM_ARRAY: array_hash(this, socket, md5); break; case SocketType::NODE_ARRAY: array_hash(this, socket, md5); break; case SocketType::UNDEFINED: break; } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/graph/node.h000066400000000000000000000070561334742672700206040ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "graph/node_type.h" #include "util/util_map.h" #include "util/util_param.h" #include "util/util_ustring.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class MD5Hash; struct Node; struct NodeType; struct Transform; /* Node */ struct Node { explicit Node(const NodeType *type, ustring name = ustring()); virtual ~Node(); /* set values */ void set(const SocketType& input, bool value); void set(const SocketType& input, int value); void set(const SocketType& input, uint value); void set(const SocketType& input, float value); void set(const SocketType& input, float2 value); void set(const SocketType& input, float3 value); void set(const SocketType& input, const char *value); void set(const SocketType& input, ustring value); void set(const SocketType& input, const Transform& value); void set(const SocketType& input, Node *value); /* set array values. the memory from the input array will taken over * by the node and the input array will be empty after return */ void set(const SocketType& input, array& value); void set(const SocketType& input, array& value); void set(const SocketType& input, array& value); void set(const SocketType& input, array& value); void set(const SocketType& input, array& value); void set(const SocketType& input, array& value); void set(const SocketType& input, array& value); void set(const SocketType& input, array& value); /* get values */ bool get_bool(const SocketType& input) const; int get_int(const SocketType& input) const; uint get_uint(const SocketType& input) const; float get_float(const SocketType& input) const; float2 get_float2(const SocketType& input) const; float3 get_float3(const SocketType& input) const; ustring get_string(const SocketType& input) const; Transform get_transform(const SocketType& input) const; Node *get_node(const SocketType& input) const; /* get array values */ const array& get_bool_array(const SocketType& input) const; const array& get_int_array(const SocketType& input) const; const array& get_float_array(const SocketType& input) const; const array& get_float2_array(const SocketType& input) const; const array& get_float3_array(const SocketType& input) const; const array& get_string_array(const SocketType& input) const; const array& get_transform_array(const SocketType& input) const; const array& get_node_array(const SocketType& input) const; /* generic values operations */ bool has_default_value(const SocketType& input) const; void set_default_value(const SocketType& input); bool equals_value(const Node& other, const SocketType& input) const; void copy_value(const SocketType& input, const Node& other, const SocketType& other_input); /* equals */ bool equals(const Node& other) const; /* compute hash of node and its socket values */ void hash(MD5Hash& md5); ustring name; const NodeType *type; }; CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/graph/node_enum.h000066400000000000000000000025631334742672700216260ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "util/util_map.h" #include "util/util_param.h" #include "util/util_ustring.h" CCL_NAMESPACE_BEGIN /* Enum * * Utility class for enum values. */ struct NodeEnum { bool empty() const { return left.empty(); } void insert(const char *x, int y) { left[ustring(x)] = y; right[y] = ustring(x); } bool exists(ustring x) const { return left.find(x) != left.end(); } bool exists(int y) const { return right.find(y) != right.end(); } int operator[](const char *x) const { return left.find(ustring(x))->second; } int operator[](ustring x) const { return left.find(x)->second; } ustring operator[](int y) const { return right.find(y)->second; } private: unordered_map left; unordered_map right; }; CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/graph/node_type.cpp000066400000000000000000000121261334742672700221720ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "graph/node_type.h" #include "util/util_foreach.h" #include "util/util_transform.h" CCL_NAMESPACE_BEGIN /* Node Socket Type */ size_t SocketType::size() const { return size(type); } bool SocketType::is_array() const { return (type >= BOOLEAN_ARRAY); } size_t SocketType::size(Type type) { switch(type) { case UNDEFINED: return 0; case BOOLEAN: return sizeof(bool); case FLOAT: return sizeof(float); case INT: return sizeof(int); case UINT: return sizeof(uint); case COLOR: return sizeof(float3); case VECTOR: return sizeof(float3); case POINT: return sizeof(float3); case NORMAL: return sizeof(float3); case POINT2: return sizeof(float2); case CLOSURE: return 0; case STRING: return sizeof(ustring); case ENUM: return sizeof(int); case TRANSFORM: return sizeof(Transform); case NODE: return sizeof(void*); case BOOLEAN_ARRAY: return sizeof(array); case FLOAT_ARRAY: return sizeof(array); case INT_ARRAY: return sizeof(array); case COLOR_ARRAY: return sizeof(array); case VECTOR_ARRAY: return sizeof(array); case POINT_ARRAY: return sizeof(array); case NORMAL_ARRAY: return sizeof(array); case POINT2_ARRAY: return sizeof(array); case STRING_ARRAY: return sizeof(array); case TRANSFORM_ARRAY: return sizeof(array); case NODE_ARRAY: return sizeof(array); } assert(0); return 0; } size_t SocketType::max_size() { return sizeof(Transform); } void *SocketType::zero_default_value() { static Transform zero_transform = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}; return &zero_transform; } ustring SocketType::type_name(Type type) { static ustring names[] = { ustring("undefined"), ustring("boolean"), ustring("float"), ustring("int"), ustring("uint"), ustring("color"), ustring("vector"), ustring("point"), ustring("normal"), ustring("point2"), ustring("closure"), ustring("string"), ustring("enum"), ustring("transform"), ustring("node"), ustring("array_boolean"), ustring("array_float"), ustring("array_int"), ustring("array_color"), ustring("array_vector"), ustring("array_point"), ustring("array_normal"), ustring("array_point2"), ustring("array_string"), ustring("array_transform"), ustring("array_node")}; return names[(int)type]; } bool SocketType::is_float3(Type type) { return (type == COLOR || type == VECTOR || type == POINT || type == NORMAL); } /* Node Type */ NodeType::NodeType(Type type_) : type(type_) { } NodeType::~NodeType() { } void NodeType::register_input(ustring name, ustring ui_name, SocketType::Type type, int struct_offset, const void *default_value, const NodeEnum *enum_values, const NodeType **node_type, int flags, int extra_flags) { SocketType socket; socket.name = name; socket.ui_name = ui_name; socket.type = type; socket.struct_offset = struct_offset; socket.default_value = default_value; socket.enum_values = enum_values; socket.node_type = node_type; socket.flags = flags | extra_flags; inputs.push_back(socket); } void NodeType::register_output(ustring name, ustring ui_name, SocketType::Type type) { SocketType socket; socket.name = name; socket.ui_name = ui_name; socket.type = type; socket.struct_offset = 0; socket.default_value = NULL; socket.enum_values = NULL; socket.node_type = NULL; socket.flags = SocketType::LINKABLE; outputs.push_back(socket); } const SocketType *NodeType::find_input(ustring name) const { foreach(const SocketType& socket, inputs) { if(socket.name == name) { return &socket; } } return NULL; } const SocketType *NodeType::find_output(ustring name) const { foreach(const SocketType& socket, outputs) { if(socket.name == name) { return &socket; } } return NULL; } /* Node Type Registry */ unordered_map& NodeType::types() { static unordered_map _types; return _types; } NodeType *NodeType::add(const char *name_, CreateFunc create_, Type type_) { ustring name(name_); if(types().find(name) != types().end()) { fprintf(stderr, "Node type %s registered twice!\n", name_); assert(0); return NULL; } types()[name] = NodeType(type_); NodeType *type = &types()[name]; type->name = name; type->create = create_; return type; } const NodeType *NodeType::find(ustring name) { unordered_map::iterator it = types().find(name); return (it == types().end()) ? NULL : &it->second; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/graph/node_type.h000066400000000000000000000257561334742672700216540ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "graph/node_enum.h" #include "util/util_map.h" #include "util/util_param.h" #include "util/util_ustring.h" #include "util/util_string.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN struct Node; struct NodeType; /* Socket Type */ struct SocketType { enum Type { UNDEFINED, BOOLEAN, FLOAT, INT, UINT, COLOR, VECTOR, POINT, NORMAL, POINT2, CLOSURE, STRING, ENUM, TRANSFORM, NODE, BOOLEAN_ARRAY, FLOAT_ARRAY, INT_ARRAY, COLOR_ARRAY, VECTOR_ARRAY, POINT_ARRAY, NORMAL_ARRAY, POINT2_ARRAY, STRING_ARRAY, TRANSFORM_ARRAY, NODE_ARRAY, }; enum Flags { LINKABLE = (1 << 0), ANIMATABLE = (1 << 1), SVM_INTERNAL = (1 << 2), OSL_INTERNAL = (1 << 3), INTERNAL = (1 << 2) | (1 << 3), LINK_TEXTURE_GENERATED = (1 << 4), LINK_TEXTURE_UV = (1 << 5), LINK_INCOMING = (1 << 6), LINK_NORMAL = (1 << 7), LINK_POSITION = (1 << 8), LINK_TANGENT = (1 << 9), DEFAULT_LINK_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) }; ustring name; Type type; int struct_offset; const void *default_value; const NodeEnum *enum_values; const NodeType **node_type; int flags; ustring ui_name; size_t size() const; bool is_array() const; static size_t size(Type type); static size_t max_size(); static ustring type_name(Type type); static void *zero_default_value(); static bool is_float3(Type type); }; /* Node Type */ struct NodeType { enum Type { NONE, SHADER }; explicit NodeType(Type type = NONE); ~NodeType(); void register_input(ustring name, ustring ui_name, SocketType::Type type, int struct_offset, const void *default_value, const NodeEnum *enum_values = NULL, const NodeType **node_type = NULL, int flags = 0, int extra_flags = 0); void register_output(ustring name, ustring ui_name, SocketType::Type type); const SocketType *find_input(ustring name) const; const SocketType *find_output(ustring name) const; typedef Node *(*CreateFunc)(const NodeType *type); ustring name; Type type; vector > inputs; vector > outputs; CreateFunc create; static NodeType *add(const char *name, CreateFunc create, Type type = NONE); static const NodeType *find(ustring name); static unordered_map& types(); }; /* Node Definition Macros */ #define NODE_DECLARE \ template \ static const NodeType *register_type(); \ static Node *create(const NodeType *type); \ static const NodeType *node_type; #define NODE_DEFINE(structname) \ const NodeType *structname::node_type = structname::register_type(); \ Node *structname::create(const NodeType*) { return new structname(); } \ template \ const NodeType *structname::register_type() /* Sock Definition Macros */ #define SOCKET_OFFSETOF(T, name) (((char *)&(((T *)1)->name)) - (char *)1) #define SOCKET_SIZEOF(T, name) (sizeof(((T *)1)->name)) #define SOCKET_DEFINE(name, ui_name, default_value, datatype, TYPE, flags, ...) \ { \ static datatype defval = default_value; \ CHECK_TYPE(((T *)1)->name, datatype); \ type->register_input(ustring(#name), ustring(ui_name), TYPE, SOCKET_OFFSETOF(T, name), &defval, NULL, NULL, flags, ##__VA_ARGS__); \ } #define SOCKET_BOOLEAN(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, bool, SocketType::BOOLEAN, 0, ##__VA_ARGS__) #define SOCKET_INT(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, int, SocketType::INT, 0, ##__VA_ARGS__) #define SOCKET_UINT(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, uint, SocketType::UINT, 0, ##__VA_ARGS__) #define SOCKET_FLOAT(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float, SocketType::FLOAT, 0, ##__VA_ARGS__) #define SOCKET_COLOR(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::COLOR, 0, ##__VA_ARGS__) #define SOCKET_VECTOR(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::VECTOR, 0, ##__VA_ARGS__) #define SOCKET_POINT(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::POINT, 0, ##__VA_ARGS__) #define SOCKET_NORMAL(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::NORMAL, 0, ##__VA_ARGS__) #define SOCKET_POINT2(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float2, SocketType::POINT2, 0, ##__VA_ARGS__) #define SOCKET_STRING(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, ustring, SocketType::STRING, 0, ##__VA_ARGS__) #define SOCKET_TRANSFORM(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, Transform, SocketType::TRANSFORM, 0, ##__VA_ARGS__) #define SOCKET_ENUM(name, ui_name, values, default_value, ...) \ { \ static int defval = default_value; \ assert(SOCKET_SIZEOF(T, name) == sizeof(int)); \ type->register_input(ustring(#name), ustring(ui_name), SocketType::ENUM, SOCKET_OFFSETOF(T, name), &defval, &values, NULL, ##__VA_ARGS__); \ } #define SOCKET_NODE(name, ui_name, node_type, ...) \ { \ static Node *defval = NULL; \ assert(SOCKET_SIZEOF(T, name) == sizeof(Node*)); \ type->register_input(ustring(#name), ustring(ui_name), SocketType::NODE, SOCKET_OFFSETOF(T, name), &defval, NULL, node_type, ##__VA_ARGS__); \ } #define SOCKET_BOOLEAN_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::BOOLEAN_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_INT_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::INT_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_FLOAT_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::FLOAT_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_COLOR_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::COLOR_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_VECTOR_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::VECTOR_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_POINT_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::POINT_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_NORMAL_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::NORMAL_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_POINT2_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::POINT2_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_STRING_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::STRING_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_TRANSFORM_ARRAY(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, array, SocketType::TRANSFORM_ARRAY, 0, ##__VA_ARGS__) #define SOCKET_NODE_ARRAY(name, ui_name, node_type, ...) \ { \ static Node *defval = NULL; \ assert(SOCKET_SIZEOF(T, name) == sizeof(Node*)); \ type->register_input(ustring(#name), ustring(ui_name), SocketType::NODE_ARRAY, SOCKET_OFFSETOF(T, name), &defval, NULL, node_type, ##__VA_ARGS__); \ } #define SOCKET_IN_BOOLEAN(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, bool, SocketType::BOOLEAN, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_INT(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, int, SocketType::INT, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_FLOAT(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float, SocketType::FLOAT, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_COLOR(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::COLOR, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_VECTOR(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::VECTOR, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_POINT(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::POINT, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_NORMAL(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, float3, SocketType::NORMAL, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_STRING(name, ui_name, default_value, ...) \ SOCKET_DEFINE(name, ui_name, default_value, ustring, SocketType::STRING, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_IN_CLOSURE(name, ui_name, ...) \ type->register_input(ustring(#name), ustring(ui_name), SocketType::CLOSURE, 0, NULL, NULL, NULL, SocketType::LINKABLE, ##__VA_ARGS__) #define SOCKET_OUT_BOOLEAN(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::BOOLEAN); } #define SOCKET_OUT_INT(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::INT); } #define SOCKET_OUT_FLOAT(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::FLOAT); } #define SOCKET_OUT_COLOR(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::COLOR); } #define SOCKET_OUT_VECTOR(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::VECTOR); } #define SOCKET_OUT_POINT(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::POINT); } #define SOCKET_OUT_NORMAL(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::NORMAL); } #define SOCKET_OUT_CLOSURE(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::CLOSURE); } #define SOCKET_OUT_STRING(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::STRING); } #define SOCKET_OUT_ENUM(name, ui_name) \ { type->register_output(ustring(#name), ustring(ui_name), SocketType::ENUM); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/graph/node_xml.cpp000066400000000000000000000253741334742672700220220ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "graph/node_xml.h" #include "util/util_foreach.h" #include "util/util_string.h" #include "util/util_transform.h" CCL_NAMESPACE_BEGIN static bool xml_read_boolean(const char *value) { return string_iequals(value, "true") || (atoi(value) != 0); } static const char *xml_write_boolean(bool value) { return (value) ? "true" : "false"; } template static void xml_read_float_array(T& value, xml_attribute attr) { vector tokens; string_split(tokens, attr.value()); if(tokens.size() % VECTOR_SIZE != 0) { return; } value.resize(tokens.size() / VECTOR_SIZE); for(size_t i = 0; i < value.size(); i++) { float *value_float = (float*)&value[i]; for(size_t j = 0; j < VECTOR_SIZE; j++) value_float[j] = (float)atof(tokens[i * VECTOR_SIZE + j].c_str()); } } void xml_read_node(XMLReader& reader, Node *node, xml_node xml_node) { xml_attribute name_attr = xml_node.attribute("name"); if(name_attr) { node->name = ustring(name_attr.value()); } foreach(const SocketType& socket, node->type->inputs) { if(socket.type == SocketType::CLOSURE || socket.type == SocketType::UNDEFINED) { continue; } if(socket.flags & SocketType::INTERNAL) { continue; } xml_attribute attr = xml_node.attribute(socket.name.c_str()); if(!attr) { continue; } switch(socket.type) { case SocketType::BOOLEAN: { node->set(socket, xml_read_boolean(attr.value())); break; } case SocketType::BOOLEAN_ARRAY: { vector tokens; string_split(tokens, attr.value()); array value; value.resize(tokens.size()); for(size_t i = 0; i < value.size(); i++) value[i] = xml_read_boolean(tokens[i].c_str()); node->set(socket, value); break; } case SocketType::FLOAT: { node->set(socket, (float)atof(attr.value())); break; } case SocketType::FLOAT_ARRAY: { array value; xml_read_float_array<1>(value, attr); node->set(socket, value); break; } case SocketType::INT: { node->set(socket, (int)atoi(attr.value())); break; } case SocketType::UINT: { node->set(socket, (uint)atoi(attr.value())); break; } case SocketType::INT_ARRAY: { vector tokens; string_split(tokens, attr.value()); array value; value.resize(tokens.size()); for(size_t i = 0; i < value.size(); i++) { value[i] = (int)atoi(attr.value()); } node->set(socket, value); break; } case SocketType::COLOR: case SocketType::VECTOR: case SocketType::POINT: case SocketType::NORMAL: { array value; xml_read_float_array<3>(value, attr); if(value.size() == 1) { node->set(socket, value[0]); } break; } case SocketType::COLOR_ARRAY: case SocketType::VECTOR_ARRAY: case SocketType::POINT_ARRAY: case SocketType::NORMAL_ARRAY: { array value; xml_read_float_array<3>(value, attr); node->set(socket, value); break; } case SocketType::POINT2: { array value; xml_read_float_array<2>(value, attr); if(value.size() == 1) { node->set(socket, value[0]); } break; } case SocketType::POINT2_ARRAY: { array value; xml_read_float_array<2>(value, attr); node->set(socket, value); break; } case SocketType::STRING: { node->set(socket, attr.value()); break; } case SocketType::ENUM: { ustring value(attr.value()); if(socket.enum_values->exists(value)) { node->set(socket, value); } else { fprintf(stderr, "Unknown value \"%s\" for attribute \"%s\".\n", value.c_str(), socket.name.c_str()); } break; } case SocketType::STRING_ARRAY: { vector tokens; string_split(tokens, attr.value()); array value; value.resize(tokens.size()); for(size_t i = 0; i < value.size(); i++) { value[i] = ustring(tokens[i]); } node->set(socket, value); break; } case SocketType::TRANSFORM: { array value; xml_read_float_array<16>(value, attr); if(value.size() == 1) { node->set(socket, value[0]); } break; } case SocketType::TRANSFORM_ARRAY: { array value; xml_read_float_array<16>(value, attr); node->set(socket, value); break; } case SocketType::NODE: { ustring value(attr.value()); map::iterator it = reader.node_map.find(value); if(it != reader.node_map.end()) { Node *value_node = it->second; if(value_node->type == *(socket.node_type)) node->set(socket, it->second); } break; } case SocketType::NODE_ARRAY: { vector tokens; string_split(tokens, attr.value()); array value; value.resize(tokens.size()); for(size_t i = 0; i < value.size(); i++) { map::iterator it = reader.node_map.find(ustring(tokens[i])); if(it != reader.node_map.end()) { Node *value_node = it->second; value[i] = (value_node->type == *(socket.node_type)) ? value_node : NULL; } else { value[i] = NULL; } } node->set(socket, value); break; } case SocketType::CLOSURE: case SocketType::UNDEFINED: break; } } if(node->name) reader.node_map[node->name] = node; } xml_node xml_write_node(Node *node, xml_node xml_root) { xml_node xml_node = xml_root.append_child(node->type->name.c_str()); xml_node.append_attribute("name") = node->name.c_str(); foreach(const SocketType& socket, node->type->inputs) { if(socket.type == SocketType::CLOSURE || socket.type == SocketType::UNDEFINED) { continue; } if(socket.flags & SocketType::INTERNAL) { continue; } if(node->has_default_value(socket)) { continue; } xml_attribute attr = xml_node.append_attribute(socket.name.c_str()); switch(socket.type) { case SocketType::BOOLEAN: { attr = xml_write_boolean(node->get_bool(socket)); break; } case SocketType::BOOLEAN_ARRAY: { std::stringstream ss; const array& value = node->get_bool_array(socket); for(size_t i = 0; i < value.size(); i++) { ss << xml_write_boolean(value[i]); if(i != value.size() - 1) ss << " "; } attr = ss.str().c_str(); break; } case SocketType::FLOAT: { attr = (double)node->get_float(socket); break; } case SocketType::FLOAT_ARRAY: { std::stringstream ss; const array& value = node->get_float_array(socket); for(size_t i = 0; i < value.size(); i++) { ss << value[i]; if(i != value.size() - 1) { ss << " "; } } attr = ss.str().c_str(); break; } case SocketType::INT: { attr = node->get_int(socket); break; } case SocketType::UINT: { attr = node->get_uint(socket); break; } case SocketType::INT_ARRAY: { std::stringstream ss; const array& value = node->get_int_array(socket); for(size_t i = 0; i < value.size(); i++) { ss << value[i]; if(i != value.size() - 1) { ss << " "; } } attr = ss.str().c_str(); break; } case SocketType::COLOR: case SocketType::VECTOR: case SocketType::POINT: case SocketType::NORMAL: { float3 value = node->get_float3(socket); attr = string_printf("%g %g %g", (double)value.x, (double)value.y, (double)value.z).c_str(); break; } case SocketType::COLOR_ARRAY: case SocketType::VECTOR_ARRAY: case SocketType::POINT_ARRAY: case SocketType::NORMAL_ARRAY: { std::stringstream ss; const array& value = node->get_float3_array(socket); for(size_t i = 0; i < value.size(); i++) { ss << string_printf("%g %g %g", (double)value[i].x, (double)value[i].y, (double)value[i].z); if(i != value.size() - 1) { ss << " "; } } attr = ss.str().c_str(); break; } case SocketType::POINT2: { float2 value = node->get_float2(socket); attr = string_printf("%g %g", (double)value.x, (double)value.y).c_str(); break; } case SocketType::POINT2_ARRAY: { std::stringstream ss; const array& value = node->get_float2_array(socket); for(size_t i = 0; i < value.size(); i++) { ss << string_printf("%g %g", (double)value[i].x, (double)value[i].y); if(i != value.size() - 1) { ss << " "; } } attr = ss.str().c_str(); break; } case SocketType::STRING: case SocketType::ENUM: { attr = node->get_string(socket).c_str(); break; } case SocketType::STRING_ARRAY: { std::stringstream ss; const array& value = node->get_string_array(socket); for(size_t i = 0; i < value.size(); i++) { ss << value[i]; if(i != value.size() - 1) { ss << " "; } } attr = ss.str().c_str(); break; } case SocketType::TRANSFORM: { Transform tfm = node->get_transform(socket); std::stringstream ss; for(int i = 0; i < 4; i++) { ss << string_printf("%g %g %g %g", (double)tfm[i][0], (double)tfm[i][1], (double)tfm[i][2], (double)tfm[i][3]); if(i != 3) { ss << " "; } } attr = ss.str().c_str(); break; } case SocketType::TRANSFORM_ARRAY: { std::stringstream ss; const array& value = node->get_transform_array(socket); for(size_t j = 0; j < value.size(); j++) { const Transform& tfm = value[j]; for(int i = 0; i < 4; i++) { ss << string_printf("%g %g %g %g", (double)tfm[i][0], (double)tfm[i][1], (double)tfm[i][2], (double)tfm[i][3]); if(j != value.size() - 1 || i != 3) { ss << " "; } } } attr = ss.str().c_str(); break; } case SocketType::NODE: { Node *value = node->get_node(socket); if(value) { attr = value->name.c_str(); } break; } case SocketType::NODE_ARRAY: { std::stringstream ss; const array& value = node->get_node_array(socket); for(size_t i = 0; i < value.size(); i++) { if(value[i]) { ss << value[i]->name.c_str(); } if(i != value.size() - 1) { ss << " "; } } attr = ss.str().c_str(); break; } case SocketType::CLOSURE: case SocketType::UNDEFINED: break; } } return xml_node; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/graph/node_xml.h000066400000000000000000000016651334742672700214640ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "graph/node.h" #include "util/util_map.h" #include "util/util_string.h" #include "util/util_xml.h" CCL_NAMESPACE_BEGIN struct XMLReader { map node_map; }; void xml_read_node(XMLReader& reader, Node *node, xml_node xml_node); xml_node xml_write_node(Node *node, xml_node xml_root); CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/000077500000000000000000000000001334742672700176555ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/CMakeLists.txt000066400000000000000000000363131334742672700224230ustar00rootroot00000000000000remove_extra_strict_flags() set(INC .. ) set(INC_SYS ) set(SRC_CPU_KERNELS kernels/cpu/kernel.cpp kernels/cpu/kernel_sse2.cpp kernels/cpu/kernel_sse3.cpp kernels/cpu/kernel_sse41.cpp kernels/cpu/kernel_avx.cpp kernels/cpu/kernel_avx2.cpp kernels/cpu/kernel_split.cpp kernels/cpu/kernel_split_sse2.cpp kernels/cpu/kernel_split_sse3.cpp kernels/cpu/kernel_split_sse41.cpp kernels/cpu/kernel_split_avx.cpp kernels/cpu/kernel_split_avx2.cpp kernels/cpu/filter.cpp kernels/cpu/filter_sse2.cpp kernels/cpu/filter_sse3.cpp kernels/cpu/filter_sse41.cpp kernels/cpu/filter_avx.cpp kernels/cpu/filter_avx2.cpp ) set(SRC_CUDA_KERNELS kernels/cuda/kernel.cu kernels/cuda/kernel_split.cu kernels/cuda/filter.cu ) set(SRC_OPENCL_KERNELS kernels/opencl/kernel.cl kernels/opencl/kernel_state_buffer_size.cl kernels/opencl/kernel_split.cl kernels/opencl/kernel_data_init.cl kernels/opencl/kernel_path_init.cl kernels/opencl/kernel_queue_enqueue.cl kernels/opencl/kernel_scene_intersect.cl kernels/opencl/kernel_lamp_emission.cl kernels/opencl/kernel_do_volume.cl kernels/opencl/kernel_indirect_background.cl kernels/opencl/kernel_shader_setup.cl kernels/opencl/kernel_shader_sort.cl kernels/opencl/kernel_shader_eval.cl kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl kernels/opencl/kernel_subsurface_scatter.cl kernels/opencl/kernel_direct_lighting.cl kernels/opencl/kernel_shadow_blocked_ao.cl kernels/opencl/kernel_shadow_blocked_dl.cl kernels/opencl/kernel_enqueue_inactive.cl kernels/opencl/kernel_next_iteration_setup.cl kernels/opencl/kernel_indirect_subsurface.cl kernels/opencl/kernel_buffer_update.cl kernels/opencl/filter.cl ) set(SRC_BVH_HEADERS bvh/bvh.h bvh/bvh_nodes.h bvh/bvh_shadow_all.h bvh/bvh_local.h bvh/bvh_traversal.h bvh/bvh_types.h bvh/bvh_volume.h bvh/bvh_volume_all.h bvh/qbvh_nodes.h bvh/qbvh_shadow_all.h bvh/qbvh_local.h bvh/qbvh_traversal.h bvh/qbvh_volume.h bvh/qbvh_volume_all.h ) set(SRC_HEADERS kernel_accumulate.h kernel_bake.h kernel_camera.h kernel_compat_cpu.h kernel_compat_cuda.h kernel_compat_opencl.h kernel_differential.h kernel_emission.h kernel_film.h kernel_globals.h kernel_jitter.h kernel_light.h kernel_math.h kernel_montecarlo.h kernel_passes.h kernel_path.h kernel_path_branched.h kernel_path_common.h kernel_path_state.h kernel_path_surface.h kernel_path_subsurface.h kernel_path_volume.h kernel_projection.h kernel_queues.h kernel_random.h kernel_shader.h kernel_shadow.h kernel_subsurface.h kernel_textures.h kernel_types.h kernel_volume.h kernel_work_stealing.h ) set(SRC_KERNELS_CPU_HEADERS kernel.h kernels/cpu/kernel_cpu.h kernels/cpu/kernel_cpu_impl.h kernels/cpu/kernel_cpu_image.h kernels/cpu/filter_cpu.h kernels/cpu/filter_cpu_impl.h ) set(SRC_KERNELS_CUDA_HEADERS kernels/cuda/kernel_config.h kernels/cuda/kernel_cuda_image.h ) set(SRC_KERNELS_OPENCL_HEADERS kernels/opencl/kernel_split_function.h kernels/opencl/kernel_opencl_image.h ) set(SRC_CLOSURE_HEADERS closure/alloc.h closure/bsdf.h closure/bsdf_ashikhmin_velvet.h closure/bsdf_diffuse.h closure/bsdf_diffuse_ramp.h closure/bsdf_microfacet.h closure/bsdf_microfacet_multi.h closure/bsdf_microfacet_multi_impl.h closure/bsdf_oren_nayar.h closure/bsdf_phong_ramp.h closure/bsdf_reflection.h closure/bsdf_refraction.h closure/bsdf_toon.h closure/bsdf_transparent.h closure/bsdf_util.h closure/bsdf_ashikhmin_shirley.h closure/bsdf_hair.h closure/bssrdf.h closure/emissive.h closure/volume.h closure/bsdf_principled_diffuse.h closure/bsdf_principled_sheen.h ) set(SRC_SVM_HEADERS svm/svm.h svm/svm_attribute.h svm/svm_bevel.h svm/svm_blackbody.h svm/svm_bump.h svm/svm_camera.h svm/svm_closure.h svm/svm_convert.h svm/svm_checker.h svm/svm_color_util.h svm/svm_brick.h svm/svm_displace.h svm/svm_fresnel.h svm/svm_wireframe.h svm/svm_wavelength.h svm/svm_gamma.h svm/svm_brightness.h svm/svm_geometry.h svm/svm_gradient.h svm/svm_hsv.h svm/svm_image.h svm/svm_invert.h svm/svm_light_path.h svm/svm_magic.h svm/svm_mapping.h svm/svm_math.h svm/svm_math_util.h svm/svm_mix.h svm/svm_musgrave.h svm/svm_noise.h svm/svm_noisetex.h svm/svm_normal.h svm/svm_ramp.h svm/svm_ramp_util.h svm/svm_sepcomb_hsv.h svm/svm_sepcomb_vector.h svm/svm_sky.h svm/svm_tex_coord.h svm/svm_texture.h svm/svm_types.h svm/svm_value.h svm/svm_vector_transform.h svm/svm_voronoi.h svm/svm_voxel.h svm/svm_wave.h ) set(SRC_GEOM_HEADERS geom/geom.h geom/geom_attribute.h geom/geom_curve.h geom/geom_curve_intersect.h geom/geom_motion_curve.h geom/geom_motion_triangle.h geom/geom_motion_triangle_intersect.h geom/geom_motion_triangle_shader.h geom/geom_object.h geom/geom_patch.h geom/geom_primitive.h geom/geom_subd_triangle.h geom/geom_triangle.h geom/geom_triangle_intersect.h geom/geom_volume.h ) set(SRC_FILTER_HEADERS filter/filter.h filter/filter_defines.h filter/filter_features.h filter/filter_features_sse.h filter/filter_kernel.h filter/filter_nlm_cpu.h filter/filter_nlm_gpu.h filter/filter_prefilter.h filter/filter_reconstruction.h filter/filter_transform.h filter/filter_transform_gpu.h filter/filter_transform_sse.h ) set(SRC_UTIL_HEADERS ../util/util_atomic.h ../util/util_color.h ../util/util_defines.h ../util/util_half.h ../util/util_hash.h ../util/util_math.h ../util/util_math_fast.h ../util/util_math_intersect.h ../util/util_math_float2.h ../util/util_math_float3.h ../util/util_math_float4.h ../util/util_math_int2.h ../util/util_math_int3.h ../util/util_math_int4.h ../util/util_math_matrix.h ../util/util_rect.h ../util/util_static_assert.h ../util/util_transform.h ../util/util_texture.h ../util/util_types.h ../util/util_types_float2.h ../util/util_types_float2_impl.h ../util/util_types_float3.h ../util/util_types_float3_impl.h ../util/util_types_float4.h ../util/util_types_float4_impl.h ../util/util_types_int2.h ../util/util_types_int2_impl.h ../util/util_types_int3.h ../util/util_types_int3_impl.h ../util/util_types_int4.h ../util/util_types_int4_impl.h ../util/util_types_uchar2.h ../util/util_types_uchar2_impl.h ../util/util_types_uchar3.h ../util/util_types_uchar3_impl.h ../util/util_types_uchar4.h ../util/util_types_uchar4_impl.h ../util/util_types_uint2.h ../util/util_types_uint2_impl.h ../util/util_types_uint3.h ../util/util_types_uint3_impl.h ../util/util_types_uint4.h ../util/util_types_uint4_impl.h ../util/util_types_vector3.h ../util/util_types_vector3_impl.h ) set(SRC_SPLIT_HEADERS split/kernel_branched.h split/kernel_buffer_update.h split/kernel_data_init.h split/kernel_direct_lighting.h split/kernel_do_volume.h split/kernel_enqueue_inactive.h split/kernel_holdout_emission_blurring_pathtermination_ao.h split/kernel_indirect_background.h split/kernel_indirect_subsurface.h split/kernel_lamp_emission.h split/kernel_next_iteration_setup.h split/kernel_path_init.h split/kernel_queue_enqueue.h split/kernel_scene_intersect.h split/kernel_shader_setup.h split/kernel_shader_sort.h split/kernel_shader_eval.h split/kernel_shadow_blocked_ao.h split/kernel_shadow_blocked_dl.h split/kernel_split_common.h split/kernel_split_data.h split/kernel_split_data_types.h split/kernel_subsurface_scatter.h ) # CUDA module if(WITH_CYCLES_CUDA_BINARIES) # 64 bit only set(CUDA_BITS 64) # CUDA version execute_process(COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${NVCC_OUT}") string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${NVCC_OUT}") set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}") # warn for other versions if(CUDA_VERSION MATCHES "80" OR CUDA_VERSION MATCHES "90") else() message(WARNING "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, " "build may succeed but only CUDA 8.0 is officially supported") endif() # build for each arch set(cuda_sources kernels/cuda/kernel.cu kernels/cuda/kernel_split.cu ${SRC_HEADERS} ${SRC_KERNELS_CUDA_HEADERS} ${SRC_BVH_HEADERS} ${SRC_SVM_HEADERS} ${SRC_GEOM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS} ) set(cuda_filter_sources kernels/cuda/filter.cu ${SRC_HEADERS} ${SRC_KERNELS_CUDA_HEADERS} ${SRC_FILTER_HEADERS} ${SRC_UTIL_HEADERS} ) set(cuda_cubins) macro(CYCLES_CUDA_KERNEL_ADD arch name flags sources experimental) set(cuda_cubin ${name}_${arch}.cubin) set(cuda_kernel_src "/kernels/cuda/${name}.cu") set(cuda_flags -D CCL_NAMESPACE_BEGIN= -D CCL_NAMESPACE_END= -D NVCC -m ${CUDA_BITS} -I ${CMAKE_CURRENT_SOURCE_DIR}/.. -I ${CMAKE_CURRENT_SOURCE_DIR}/kernels/cuda --use_fast_math -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin}) if(${experimental}) set(cuda_flags ${cuda_flags} -D __KERNEL_EXPERIMENTAL__) set(name ${name}_experimental) endif() if(WITH_CYCLES_DEBUG) set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__) endif() if(WITH_CYCLES_CUBIN_COMPILER) string(SUBSTRING ${arch} 3 -1 CUDA_ARCH) # Needed to find libnvrtc-builtins.so. Can't do it from inside # cycles_cubin_cc since the env variable is read before main() if(APPLE) set(CUBIN_CC_ENV ${CMAKE_COMMAND} -E env DYLD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib") elseif(UNIX) set(CUBIN_CC_ENV ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib64") endif() add_custom_command( OUTPUT ${cuda_cubin} COMMAND ${CUBIN_CC_ENV} "$" -target ${CUDA_ARCH} -i ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src} ${cuda_flags} -v -cuda-toolkit-dir "${CUDA_TOOLKIT_ROOT_DIR}" DEPENDS ${sources} cycles_cubin_cc) else() add_custom_command( OUTPUT ${cuda_cubin} COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} ${CUDA_NVCC_FLAGS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src} --ptxas-options="-v" ${cuda_flags} DEPENDS ${sources}) endif() delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib) list(APPEND cuda_cubins ${cuda_cubin}) unset(cuda_debug_flags) endmacro() foreach(arch ${CYCLES_CUDA_BINARIES_ARCH}) if(${arch} MATCHES "sm_2.") message(STATUS "CUDA binaries for ${arch} are no longer supported, skipped.") else() # Compile regular kernel CYCLES_CUDA_KERNEL_ADD(${arch} filter "" "${cuda_filter_sources}" FALSE) CYCLES_CUDA_KERNEL_ADD(${arch} kernel "" "${cuda_sources}" FALSE) endif() if(WITH_CYCLES_CUDA_SPLIT_KERNEL_BINARIES) # Compile split kernel CYCLES_CUDA_KERNEL_ADD(${arch} kernel_split "-D __SPLIT__" ${cuda_sources} FALSE) endif() endforeach() add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins}) cycles_set_solution_folder(cycles_kernel_cuda) endif() # OSL module if(WITH_CYCLES_OSL) add_subdirectory(osl) add_subdirectory(shaders) endif() # CPU module include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) set_source_files_properties(kernels/cpu/kernel.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_split.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/filter.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}") if(CXX_HAS_SSE) set_source_files_properties(kernels/cpu/kernel_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_split_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_split_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_split_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/filter_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/filter_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/filter_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}") endif() if(CXX_HAS_AVX) set_source_files_properties(kernels/cpu/kernel_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_split_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/filter_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}") endif() if(CXX_HAS_AVX2) set_source_files_properties(kernels/cpu/kernel_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_split_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/filter_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") endif() cycles_add_library(cycles_kernel ${SRC_CPU_KERNELS} ${SRC_CUDA_KERNELS} ${SRC_OPENCL_KERNELS} ${SRC_HEADERS} ${SRC_KERNELS_CPU_HEADERS} ${SRC_KERNELS_CUDA_HEADERS} ${SRC_KERNELS_OPENCL_HEADERS} ${SRC_BVH_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_FILTER_HEADERS} ${SRC_SVM_HEADERS} ${SRC_GEOM_HEADERS} ${SRC_SPLIT_HEADERS} ) if(WITH_CYCLES_CUDA) add_dependencies(cycles_kernel cycles_kernel_cuda) endif() # OpenCL kernel #set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl) #add_custom_command( # OUTPUT ${KERNEL_PREPROCESSED} # COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -o ${KERNEL_PREPROCESSED} # DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS}) #add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED}) #delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_OPENCL_KERNELS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CUDA_KERNELS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_OPENCL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_CUDA_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_BVH_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/bvh) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CLOSURE_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/closure) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_FILTER_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/filter) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/svm) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_GEOM_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/geom) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/util) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SPLIT_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/split) goxel-0.8.1/ext_src/cycles/src/kernel/bvh/000077500000000000000000000000001334742672700204345ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh.h000066400000000000000000000335051334742672700213720ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* BVH * * Bounding volume hierarchy for ray tracing. We compile different variations * of the same BVH traversal function for faster rendering when some types of * primitives are not needed, using #includes to work around the lack of * C++ templates in OpenCL. * * Originally based on "Understanding the Efficiency of Ray Traversal on GPUs", * the code has been extended and modified to support more primitives and work * with CPU/CUDA/OpenCL. */ CCL_NAMESPACE_BEGIN #include "kernel/bvh/bvh_types.h" /* Common QBVH functions. */ #ifdef __QBVH__ # include "kernel/bvh/qbvh_nodes.h" #endif /* Regular BVH traversal */ #include "kernel/bvh/bvh_nodes.h" #define BVH_FUNCTION_NAME bvh_intersect #define BVH_FUNCTION_FEATURES 0 #include "kernel/bvh/bvh_traversal.h" #if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING # include "kernel/bvh/bvh_traversal.h" #endif #if defined(__HAIR__) # define BVH_FUNCTION_NAME bvh_intersect_hair # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH # include "kernel/bvh/bvh_traversal.h" #endif #if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION # include "kernel/bvh/bvh_traversal.h" #endif #if defined(__HAIR__) && defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_hair_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH|BVH_MOTION # include "kernel/bvh/bvh_traversal.h" #endif /* Subsurface scattering BVH traversal */ #if defined(__BVH_LOCAL__) # define BVH_FUNCTION_NAME bvh_intersect_local # define BVH_FUNCTION_FEATURES BVH_HAIR # include "kernel/bvh/bvh_local.h" # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_local_motion # define BVH_FUNCTION_FEATURES BVH_MOTION|BVH_HAIR # include "kernel/bvh/bvh_local.h" # endif #endif /* __BVH_LOCAL__ */ /* Volume BVH traversal */ #if defined(__VOLUME__) # define BVH_FUNCTION_NAME bvh_intersect_volume # define BVH_FUNCTION_FEATURES BVH_HAIR # include "kernel/bvh/bvh_volume.h" # if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_volume_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR # include "kernel/bvh/bvh_volume.h" # endif # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_volume_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR # include "kernel/bvh/bvh_volume.h" # endif #endif /* __VOLUME__ */ /* Record all intersections - Shadow BVH traversal */ #if defined(__SHADOW_RECORD_ALL__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all # define BVH_FUNCTION_FEATURES 0 # include "kernel/bvh/bvh_shadow_all.h" # if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING # include "kernel/bvh/bvh_shadow_all.h" # endif # if defined(__HAIR__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR # include "kernel/bvh/bvh_shadow_all.h" # endif # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION # include "kernel/bvh/bvh_shadow_all.h" # endif # if defined(__HAIR__) && defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_MOTION # include "kernel/bvh/bvh_shadow_all.h" # endif #endif /* __SHADOW_RECORD_ALL__ */ /* Record all intersections - Volume BVH traversal */ #if defined(__VOLUME_RECORD_ALL__) # define BVH_FUNCTION_NAME bvh_intersect_volume_all # define BVH_FUNCTION_FEATURES BVH_HAIR # include "kernel/bvh/bvh_volume_all.h" # if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_volume_all_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR # include "kernel/bvh/bvh_volume_all.h" # endif # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_volume_all_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR # include "kernel/bvh/bvh_volume_all.h" # endif #endif /* __VOLUME_RECORD_ALL__ */ #undef BVH_FEATURE #undef BVH_NAME_JOIN #undef BVH_NAME_EVAL #undef BVH_FUNCTION_FULL_NAME /* Note: ray is passed by value to work around a possible CUDA compiler bug. */ ccl_device_intersect bool scene_intersect(KernelGlobals *kg, const Ray ray, const uint visibility, Intersection *isect, uint *lcg_state, float difl, float extmax) { #ifdef __OBJECT_MOTION__ if(kernel_data.bvh.have_motion) { # ifdef __HAIR__ if(kernel_data.bvh.have_curves) return bvh_intersect_hair_motion(kg, &ray, isect, visibility, lcg_state, difl, extmax); # endif /* __HAIR__ */ return bvh_intersect_motion(kg, &ray, isect, visibility); } #endif /* __OBJECT_MOTION__ */ #ifdef __HAIR__ if(kernel_data.bvh.have_curves) return bvh_intersect_hair(kg, &ray, isect, visibility, lcg_state, difl, extmax); #endif /* __HAIR__ */ #ifdef __KERNEL_CPU__ # ifdef __INSTANCING__ if(kernel_data.bvh.have_instancing) return bvh_intersect_instancing(kg, &ray, isect, visibility); # endif /* __INSTANCING__ */ return bvh_intersect(kg, &ray, isect, visibility); #else /* __KERNEL_CPU__ */ # ifdef __INSTANCING__ return bvh_intersect_instancing(kg, &ray, isect, visibility); # else return bvh_intersect(kg, &ray, isect, visibility); # endif /* __INSTANCING__ */ #endif /* __KERNEL_CPU__ */ } #ifdef __BVH_LOCAL__ /* Note: ray is passed by value to work around a possible CUDA compiler bug. */ ccl_device_intersect void scene_intersect_local(KernelGlobals *kg, const Ray ray, LocalIntersection *local_isect, int local_object, uint *lcg_state, int max_hits) { #ifdef __OBJECT_MOTION__ if(kernel_data.bvh.have_motion) { return bvh_intersect_local_motion(kg, &ray, local_isect, local_object, lcg_state, max_hits); } #endif /* __OBJECT_MOTION__ */ return bvh_intersect_local(kg, &ray, local_isect, local_object, lcg_state, max_hits); } #endif #ifdef __SHADOW_RECORD_ALL__ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals *kg, const Ray *ray, Intersection *isect, uint visibility, uint max_hits, uint *num_hits) { # ifdef __OBJECT_MOTION__ if(kernel_data.bvh.have_motion) { # ifdef __HAIR__ if(kernel_data.bvh.have_curves) { return bvh_intersect_shadow_all_hair_motion(kg, ray, isect, visibility, max_hits, num_hits); } # endif /* __HAIR__ */ return bvh_intersect_shadow_all_motion(kg, ray, isect, visibility, max_hits, num_hits); } # endif /* __OBJECT_MOTION__ */ # ifdef __HAIR__ if(kernel_data.bvh.have_curves) { return bvh_intersect_shadow_all_hair(kg, ray, isect, visibility, max_hits, num_hits); } # endif /* __HAIR__ */ # ifdef __INSTANCING__ if(kernel_data.bvh.have_instancing) { return bvh_intersect_shadow_all_instancing(kg, ray, isect, visibility, max_hits, num_hits); } # endif /* __INSTANCING__ */ return bvh_intersect_shadow_all(kg, ray, isect, visibility, max_hits, num_hits); } #endif /* __SHADOW_RECORD_ALL__ */ #ifdef __VOLUME__ ccl_device_intersect bool scene_intersect_volume(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint visibility) { # ifdef __OBJECT_MOTION__ if(kernel_data.bvh.have_motion) { return bvh_intersect_volume_motion(kg, ray, isect, visibility); } # endif /* __OBJECT_MOTION__ */ # ifdef __KERNEL_CPU__ # ifdef __INSTANCING__ if(kernel_data.bvh.have_instancing) return bvh_intersect_volume_instancing(kg, ray, isect, visibility); # endif /* __INSTANCING__ */ return bvh_intersect_volume(kg, ray, isect, visibility); # else /* __KERNEL_CPU__ */ # ifdef __INSTANCING__ return bvh_intersect_volume_instancing(kg, ray, isect, visibility); # else return bvh_intersect_volume(kg, ray, isect, visibility); # endif /* __INSTANCING__ */ # endif /* __KERNEL_CPU__ */ } #endif /* __VOLUME__ */ #ifdef __VOLUME_RECORD_ALL__ ccl_device_intersect uint scene_intersect_volume_all(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint max_hits, const uint visibility) { # ifdef __OBJECT_MOTION__ if(kernel_data.bvh.have_motion) { return bvh_intersect_volume_all_motion(kg, ray, isect, max_hits, visibility); } # endif /* __OBJECT_MOTION__ */ # ifdef __INSTANCING__ if(kernel_data.bvh.have_instancing) return bvh_intersect_volume_all_instancing(kg, ray, isect, max_hits, visibility); # endif /* __INSTANCING__ */ return bvh_intersect_volume_all(kg, ray, isect, max_hits, visibility); } #endif /* __VOLUME_RECORD_ALL__ */ /* Ray offset to avoid self intersection. * * This function should be used to compute a modified ray start position for * rays leaving from a surface. */ ccl_device_inline float3 ray_offset(float3 P, float3 Ng) { #ifdef __INTERSECTION_REFINE__ const float epsilon_f = 1e-5f; /* ideally this should match epsilon_f, but instancing and motion blur * precision makes it problematic */ const float epsilon_test = 1.0f; const int epsilon_i = 32; float3 res; /* x component */ if(fabsf(P.x) < epsilon_test) { res.x = P.x + Ng.x*epsilon_f; } else { uint ix = __float_as_uint(P.x); ix += ((ix ^ __float_as_uint(Ng.x)) >> 31)? -epsilon_i: epsilon_i; res.x = __uint_as_float(ix); } /* y component */ if(fabsf(P.y) < epsilon_test) { res.y = P.y + Ng.y*epsilon_f; } else { uint iy = __float_as_uint(P.y); iy += ((iy ^ __float_as_uint(Ng.y)) >> 31)? -epsilon_i: epsilon_i; res.y = __uint_as_float(iy); } /* z component */ if(fabsf(P.z) < epsilon_test) { res.z = P.z + Ng.z*epsilon_f; } else { uint iz = __float_as_uint(P.z); iz += ((iz ^ __float_as_uint(Ng.z)) >> 31)? -epsilon_i: epsilon_i; res.z = __uint_as_float(iz); } return res; #else const float epsilon_f = 1e-4f; return P + epsilon_f*Ng; #endif } #if defined(__VOLUME_RECORD_ALL__) || (defined(__SHADOW_RECORD_ALL__) && defined(__KERNEL_CPU__)) /* ToDo: Move to another file? */ ccl_device int intersections_compare(const void *a, const void *b) { const Intersection *isect_a = (const Intersection*)a; const Intersection *isect_b = (const Intersection*)b; if(isect_a->t < isect_b->t) return -1; else if(isect_a->t > isect_b->t) return 1; else return 0; } #endif #if defined(__SHADOW_RECORD_ALL__) ccl_device_inline void sort_intersections(Intersection *hits, uint num_hits) { #ifdef __KERNEL_GPU__ /* Use bubble sort which has more friendly memory pattern on GPU. */ bool swapped; do { swapped = false; for(int j = 0; j < num_hits - 1; ++j) { if(hits[j].t > hits[j + 1].t) { struct Intersection tmp = hits[j]; hits[j] = hits[j + 1]; hits[j + 1] = tmp; swapped = true; } } --num_hits; } while(swapped); #else qsort(hits, num_hits, sizeof(Intersection), intersections_compare); #endif } #endif /* __SHADOW_RECORD_ALL__ | __VOLUME_RECORD_ALL__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh_local.h000066400000000000000000000210621334742672700225370ustar00rootroot00000000000000/* * Adapted from code Copyright 2009-2010 NVIDIA Corporation, * and code copyright 2009-2012 Intel Corporation * * Modifications Copyright 2011-2013, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef __QBVH__ # include "kernel/bvh/qbvh_local.h" #endif #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT bvh_node_intersect #else # define NODE_INTERSECT bvh_aligned_node_intersect #endif /* This is a template BVH traversal function for finding local intersections * around the shading point, for subsurface scattering and bevel. We disable * various features for performance, and for instanced objects avoid traversing * other parts of the scene. * * BVH_MOTION: motion blur rendering * */ #ifndef __KERNEL_GPU__ ccl_device #else ccl_device_inline #endif void BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, const Ray *ray, LocalIntersection *local_isect, int local_object, uint *lcg_state, int max_hits) { /* todo: * - test if pushing distance on the stack helps (for non shadow rays) * - separate version for shadow rays * - likely and unlikely for if() statements * - test restrict attribute for pointers */ /* traversal stack in CUDA thread-local memory */ int traversal_stack[BVH_STACK_SIZE]; traversal_stack[0] = ENTRYPOINT_SENTINEL; /* traversal variables in registers */ int stack_ptr = 0; int node_addr = kernel_tex_fetch(__object_node, local_object); /* ray parameters in registers */ float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; float isect_t = ray->t; local_isect->num_hits = 0; const int object_flag = kernel_tex_fetch(__object_flag, local_object); if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; isect_t = bvh_instance_motion_push(kg, local_object, ray, &P, &dir, &idir, isect_t, &ob_itfm); #else isect_t = bvh_instance_push(kg, local_object, ray, &P, &dir, &idir, isect_t); #endif object = local_object; } #if defined(__KERNEL_SSE2__) const shuffle_swap_t shuf_identity = shuffle_swap_identity(); const shuffle_swap_t shuf_swap = shuffle_swap_swap(); const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); ssef Psplat[3], idirsplat[3]; # if BVH_FEATURE(BVH_HAIR) ssef tnear(0.0f), tfar(isect_t); # endif shuffle_swap_t shufflexyz[3]; Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); ssef tsplat(0.0f, 0.0f, -isect_t, -isect_t); gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif /* traversal loop */ do { do { /* traverse internal nodes */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { int node_addr_child1, traverse_mask; float dist[2]; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); #if !defined(__KERNEL_SSE2__) traverse_mask = NODE_INTERSECT(kg, P, # if BVH_FEATURE(BVH_HAIR) dir, # endif idir, isect_t, node_addr, PATH_RAY_ALL_VISIBILITY, dist); #else // __KERNEL_SSE2__ traverse_mask = NODE_INTERSECT(kg, P, dir, # if BVH_FEATURE(BVH_HAIR) tnear, tfar, # endif tsplat, Psplat, idirsplat, shufflexyz, node_addr, PATH_RAY_ALL_VISIBILITY, dist); #endif // __KERNEL_SSE2__ node_addr = __float_as_int(cnodes.z); node_addr_child1 = __float_as_int(cnodes.w); if(traverse_mask == 3) { /* Both children were intersected, push the farther one. */ bool is_closest_child1 = (dist[1] < dist[0]); if(is_closest_child1) { int tmp = node_addr; node_addr = node_addr_child1; node_addr_child1 = tmp; } ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = node_addr_child1; } else { /* One child was intersected. */ if(traverse_mask == 2) { node_addr = node_addr_child1; } else if(traverse_mask == 0) { /* Neither child was intersected. */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; } } } /* if node is leaf, fetch triangle list */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); int prim_addr = __float_as_int(leaf.x); const int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); /* pop */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; /* primitive intersection */ switch(type & PRIMITIVE_ALL) { case PRIMITIVE_TRIANGLE: { /* intersect ray against primitive */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); triangle_intersect_local(kg, local_isect, P, dir, object, local_object, prim_addr, isect_t, lcg_state, max_hits); } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { /* intersect ray against primitive */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); motion_triangle_intersect_local(kg, local_isect, P, dir, ray->time, object, local_object, prim_addr, isect_t, lcg_state, max_hits); } break; } #endif default: { break; } } } } while(node_addr != ENTRYPOINT_SENTINEL); } while(node_addr != ENTRYPOINT_SENTINEL); } ccl_device_inline void BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, LocalIntersection *local_isect, int local_object, uint *lcg_state, int max_hits) { switch(kernel_data.bvh.bvh_layout) { #ifdef __QBVH__ case BVH_LAYOUT_BVH4: return BVH_FUNCTION_FULL_NAME(QBVH)(kg, ray, local_isect, local_object, lcg_state, max_hits); #endif case BVH_LAYOUT_BVH2: return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, local_isect, local_object, lcg_state, max_hits); } kernel_assert(!"Should not happen"); } #undef BVH_FUNCTION_NAME #undef BVH_FUNCTION_FEATURES #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh_nodes.h000066400000000000000000000644631334742672700225710ustar00rootroot00000000000000/* * Copyright 2011-2016, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // TODO(sergey): Look into avoid use of full Transform and use 3x3 matrix and // 3-vector which might be faster. ccl_device_forceinline Transform bvh_unaligned_node_fetch_space(KernelGlobals *kg, int node_addr, int child) { Transform space; const int child_addr = node_addr + child * 3; space.x = kernel_tex_fetch(__bvh_nodes, child_addr+1); space.y = kernel_tex_fetch(__bvh_nodes, child_addr+2); space.z = kernel_tex_fetch(__bvh_nodes, child_addr+3); space.w = make_float4(0.0f, 0.0f, 0.0f, 1.0f); return space; } #if !defined(__KERNEL_SSE2__) ccl_device_forceinline int bvh_aligned_node_intersect(KernelGlobals *kg, const float3 P, const float3 idir, const float t, const int node_addr, const uint visibility, float dist[2]) { /* fetch node data */ float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); float4 node0 = kernel_tex_fetch(__bvh_nodes, node_addr+1); float4 node1 = kernel_tex_fetch(__bvh_nodes, node_addr+2); float4 node2 = kernel_tex_fetch(__bvh_nodes, node_addr+3); /* intersect ray against child nodes */ float c0lox = (node0.x - P.x) * idir.x; float c0hix = (node0.z - P.x) * idir.x; float c0loy = (node1.x - P.y) * idir.y; float c0hiy = (node1.z - P.y) * idir.y; float c0loz = (node2.x - P.z) * idir.z; float c0hiz = (node2.z - P.z) * idir.z; float c0min = max4(0.0f, min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz)); float c0max = min4(t, max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz)); float c1lox = (node0.y - P.x) * idir.x; float c1hix = (node0.w - P.x) * idir.x; float c1loy = (node1.y - P.y) * idir.y; float c1hiy = (node1.w - P.y) * idir.y; float c1loz = (node2.y - P.z) * idir.z; float c1hiz = (node2.w - P.z) * idir.z; float c1min = max4(0.0f, min(c1lox, c1hix), min(c1loy, c1hiy), min(c1loz, c1hiz)); float c1max = min4(t, max(c1lox, c1hix), max(c1loy, c1hiy), max(c1loz, c1hiz)); dist[0] = c0min; dist[1] = c1min; #ifdef __VISIBILITY_FLAG__ /* this visibility test gives a 5% performance hit, how to solve? */ return (((c0max >= c0min) && (__float_as_uint(cnodes.x) & visibility))? 1: 0) | (((c1max >= c1min) && (__float_as_uint(cnodes.y) & visibility))? 2: 0); #else return ((c0max >= c0min)? 1: 0) | ((c1max >= c1min)? 2: 0); #endif } ccl_device_forceinline int bvh_aligned_node_intersect_robust(KernelGlobals *kg, const float3 P, const float3 idir, const float t, const float difl, const float extmax, const int node_addr, const uint visibility, float dist[2]) { /* fetch node data */ float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); float4 node0 = kernel_tex_fetch(__bvh_nodes, node_addr+1); float4 node1 = kernel_tex_fetch(__bvh_nodes, node_addr+2); float4 node2 = kernel_tex_fetch(__bvh_nodes, node_addr+3); /* intersect ray against child nodes */ float c0lox = (node0.x - P.x) * idir.x; float c0hix = (node0.z - P.x) * idir.x; float c0loy = (node1.x - P.y) * idir.y; float c0hiy = (node1.z - P.y) * idir.y; float c0loz = (node2.x - P.z) * idir.z; float c0hiz = (node2.z - P.z) * idir.z; float c0min = max4(0.0f, min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz)); float c0max = min4(t, max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz)); float c1lox = (node0.y - P.x) * idir.x; float c1hix = (node0.w - P.x) * idir.x; float c1loy = (node1.y - P.y) * idir.y; float c1hiy = (node1.w - P.y) * idir.y; float c1loz = (node2.y - P.z) * idir.z; float c1hiz = (node2.w - P.z) * idir.z; float c1min = max4(0.0f, min(c1lox, c1hix), min(c1loy, c1hiy), min(c1loz, c1hiz)); float c1max = min4(t, max(c1lox, c1hix), max(c1loy, c1hiy), max(c1loz, c1hiz)); if(difl != 0.0f) { float hdiff = 1.0f + difl; float ldiff = 1.0f - difl; if(__float_as_int(cnodes.z) & PATH_RAY_CURVE) { c0min = max(ldiff * c0min, c0min - extmax); c0max = min(hdiff * c0max, c0max + extmax); } if(__float_as_int(cnodes.w) & PATH_RAY_CURVE) { c1min = max(ldiff * c1min, c1min - extmax); c1max = min(hdiff * c1max, c1max + extmax); } } dist[0] = c0min; dist[1] = c1min; #ifdef __VISIBILITY_FLAG__ /* this visibility test gives a 5% performance hit, how to solve? */ return (((c0max >= c0min) && (__float_as_uint(cnodes.x) & visibility))? 1: 0) | (((c1max >= c1min) && (__float_as_uint(cnodes.y) & visibility))? 2: 0); #else return ((c0max >= c0min)? 1: 0) | ((c1max >= c1min)? 2: 0); #endif } ccl_device_forceinline bool bvh_unaligned_node_intersect_child( KernelGlobals *kg, const float3 P, const float3 dir, const float t, int node_addr, int child, float dist[2]) { Transform space = bvh_unaligned_node_fetch_space(kg, node_addr, child); float3 aligned_dir = transform_direction(&space, dir); float3 aligned_P = transform_point(&space, P); float3 nrdir = -bvh_inverse_direction(aligned_dir); float3 lower_xyz = aligned_P * nrdir; float3 upper_xyz = lower_xyz - nrdir; const float near_x = min(lower_xyz.x, upper_xyz.x); const float near_y = min(lower_xyz.y, upper_xyz.y); const float near_z = min(lower_xyz.z, upper_xyz.z); const float far_x = max(lower_xyz.x, upper_xyz.x); const float far_y = max(lower_xyz.y, upper_xyz.y); const float far_z = max(lower_xyz.z, upper_xyz.z); const float tnear = max4(0.0f, near_x, near_y, near_z); const float tfar = min4(t, far_x, far_y, far_z); *dist = tnear; return tnear <= tfar; } ccl_device_forceinline bool bvh_unaligned_node_intersect_child_robust( KernelGlobals *kg, const float3 P, const float3 dir, const float t, const float difl, int node_addr, int child, float dist[2]) { Transform space = bvh_unaligned_node_fetch_space(kg, node_addr, child); float3 aligned_dir = transform_direction(&space, dir); float3 aligned_P = transform_point(&space, P); float3 nrdir = -bvh_inverse_direction(aligned_dir); float3 tLowerXYZ = aligned_P * nrdir; float3 tUpperXYZ = tLowerXYZ - nrdir; const float near_x = min(tLowerXYZ.x, tUpperXYZ.x); const float near_y = min(tLowerXYZ.y, tUpperXYZ.y); const float near_z = min(tLowerXYZ.z, tUpperXYZ.z); const float far_x = max(tLowerXYZ.x, tUpperXYZ.x); const float far_y = max(tLowerXYZ.y, tUpperXYZ.y); const float far_z = max(tLowerXYZ.z, tUpperXYZ.z); const float tnear = max4(0.0f, near_x, near_y, near_z); const float tfar = min4(t, far_x, far_y, far_z); *dist = tnear; if(difl != 0.0f) { /* TODO(sergey): Same as for QBVH, needs a proper use. */ const float round_down = 1.0f - difl; const float round_up = 1.0f + difl; return round_down*tnear <= round_up*tfar; } else { return tnear <= tfar; } } ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, const float3 P, const float3 dir, const float3 idir, const float t, const int node_addr, const uint visibility, float dist[2]) { int mask = 0; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); if(bvh_unaligned_node_intersect_child(kg, P, dir, t, node_addr, 0, &dist[0])) { #ifdef __VISIBILITY_FLAG__ if((__float_as_uint(cnodes.x) & visibility)) #endif { mask |= 1; } } if(bvh_unaligned_node_intersect_child(kg, P, dir, t, node_addr, 1, &dist[1])) { #ifdef __VISIBILITY_FLAG__ if((__float_as_uint(cnodes.y) & visibility)) #endif { mask |= 2; } } return mask; } ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg, const float3 P, const float3 dir, const float3 idir, const float t, const float difl, const float extmax, const int node_addr, const uint visibility, float dist[2]) { int mask = 0; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); if(bvh_unaligned_node_intersect_child_robust(kg, P, dir, t, difl, node_addr, 0, &dist[0])) { #ifdef __VISIBILITY_FLAG__ if((__float_as_uint(cnodes.x) & visibility)) #endif { mask |= 1; } } if(bvh_unaligned_node_intersect_child_robust(kg, P, dir, t, difl, node_addr, 1, &dist[1])) { #ifdef __VISIBILITY_FLAG__ if((__float_as_uint(cnodes.y) & visibility)) #endif { mask |= 2; } } return mask; } ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, const float3 P, const float3 dir, const float3 idir, const float t, const int node_addr, const uint visibility, float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { return bvh_unaligned_node_intersect(kg, P, dir, idir, t, node_addr, visibility, dist); } else { return bvh_aligned_node_intersect(kg, P, idir, t, node_addr, visibility, dist); } } ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg, const float3 P, const float3 dir, const float3 idir, const float t, const float difl, const float extmax, const int node_addr, const uint visibility, float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { return bvh_unaligned_node_intersect_robust(kg, P, dir, idir, t, difl, extmax, node_addr, visibility, dist); } else { return bvh_aligned_node_intersect_robust(kg, P, idir, t, difl, extmax, node_addr, visibility, dist); } } #else /* !defined(__KERNEL_SSE2__) */ int ccl_device_forceinline bvh_aligned_node_intersect( KernelGlobals *kg, const float3& P, const float3& dir, const ssef& tsplat, const ssef Psplat[3], const ssef idirsplat[3], const shuffle_swap_t shufflexyz[3], const int node_addr, const uint visibility, float dist[2]) { /* Intersect two child bounding boxes, SSE3 version adapted from Embree */ const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); /* fetch node data */ const ssef *bvh_nodes = (ssef*)kg->__bvh_nodes.data + node_addr; /* intersect ray against child nodes */ const ssef tminmaxx = (shuffle_swap(bvh_nodes[1], shufflexyz[0]) - Psplat[0]) * idirsplat[0]; const ssef tminmaxy = (shuffle_swap(bvh_nodes[2], shufflexyz[1]) - Psplat[1]) * idirsplat[1]; const ssef tminmaxz = (shuffle_swap(bvh_nodes[3], shufflexyz[2]) - Psplat[2]) * idirsplat[2]; /* calculate { c0min, c1min, -c0max, -c1max} */ ssef minmax = max(max(tminmaxx, tminmaxy), max(tminmaxz, tsplat)); const ssef tminmax = minmax ^ pn; const sseb lrhit = tminmax <= shuffle<2, 3, 0, 1>(tminmax); dist[0] = tminmax[0]; dist[1] = tminmax[1]; int mask = movemask(lrhit); # ifdef __VISIBILITY_FLAG__ /* this visibility test gives a 5% performance hit, how to solve? */ float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility))? 1: 0) | (((mask & 2) && (__float_as_uint(cnodes.y) & visibility))? 2: 0); return cmask; # else return mask & 3; # endif } ccl_device_forceinline int bvh_aligned_node_intersect_robust( KernelGlobals *kg, const float3& P, const float3& dir, const ssef& tsplat, const ssef Psplat[3], const ssef idirsplat[3], const shuffle_swap_t shufflexyz[3], const float difl, const float extmax, const int nodeAddr, const uint visibility, float dist[2]) { /* Intersect two child bounding boxes, SSE3 version adapted from Embree */ const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); /* fetch node data */ const ssef *bvh_nodes = (ssef*)kg->__bvh_nodes.data + nodeAddr; /* intersect ray against child nodes */ const ssef tminmaxx = (shuffle_swap(bvh_nodes[1], shufflexyz[0]) - Psplat[0]) * idirsplat[0]; const ssef tminmaxy = (shuffle_swap(bvh_nodes[2], shufflexyz[1]) - Psplat[1]) * idirsplat[1]; const ssef tminmaxz = (shuffle_swap(bvh_nodes[3], shufflexyz[2]) - Psplat[2]) * idirsplat[2]; /* calculate { c0min, c1min, -c0max, -c1max} */ ssef minmax = max(max(tminmaxx, tminmaxy), max(tminmaxz, tsplat)); const ssef tminmax = minmax ^ pn; if(difl != 0.0f) { float4 cnodes = kernel_tex_fetch(__bvh_nodes, nodeAddr+0); float4 *tminmaxview = (float4*)&tminmax; float& c0min = tminmaxview->x, &c1min = tminmaxview->y; float& c0max = tminmaxview->z, &c1max = tminmaxview->w; float hdiff = 1.0f + difl; float ldiff = 1.0f - difl; if(__float_as_int(cnodes.x) & PATH_RAY_CURVE) { c0min = max(ldiff * c0min, c0min - extmax); c0max = min(hdiff * c0max, c0max + extmax); } if(__float_as_int(cnodes.y) & PATH_RAY_CURVE) { c1min = max(ldiff * c1min, c1min - extmax); c1max = min(hdiff * c1max, c1max + extmax); } } const sseb lrhit = tminmax <= shuffle<2, 3, 0, 1>(tminmax); dist[0] = tminmax[0]; dist[1] = tminmax[1]; int mask = movemask(lrhit); # ifdef __VISIBILITY_FLAG__ /* this visibility test gives a 5% performance hit, how to solve? */ float4 cnodes = kernel_tex_fetch(__bvh_nodes, nodeAddr+0); int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility))? 1: 0) | (((mask & 2) && (__float_as_uint(cnodes.y) & visibility))? 2: 0); return cmask; # else return mask & 3; # endif } ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, const float3 P, const float3 dir, const ssef& isect_near, const ssef& isect_far, const int node_addr, const uint visibility, float dist[2]) { Transform space0 = bvh_unaligned_node_fetch_space(kg, node_addr, 0); Transform space1 = bvh_unaligned_node_fetch_space(kg, node_addr, 1); float3 aligned_dir0 = transform_direction(&space0, dir), aligned_dir1 = transform_direction(&space1, dir); float3 aligned_P0 = transform_point(&space0, P), aligned_P1 = transform_point(&space1, P); float3 nrdir0 = -bvh_inverse_direction(aligned_dir0), nrdir1 = -bvh_inverse_direction(aligned_dir1); ssef lower_x = ssef(aligned_P0.x * nrdir0.x, aligned_P1.x * nrdir1.x, 0.0f, 0.0f), lower_y = ssef(aligned_P0.y * nrdir0.y, aligned_P1.y * nrdir1.y, 0.0f, 0.0f), lower_z = ssef(aligned_P0.z * nrdir0.z, aligned_P1.z * nrdir1.z, 0.0f, 0.0f); ssef upper_x = lower_x - ssef(nrdir0.x, nrdir1.x, 0.0f, 0.0f), upper_y = lower_y - ssef(nrdir0.y, nrdir1.y, 0.0f, 0.0f), upper_z = lower_z - ssef(nrdir0.z, nrdir1.z, 0.0f, 0.0f); ssef tnear_x = min(lower_x, upper_x); ssef tnear_y = min(lower_y, upper_y); ssef tnear_z = min(lower_z, upper_z); ssef tfar_x = max(lower_x, upper_x); ssef tfar_y = max(lower_y, upper_y); ssef tfar_z = max(lower_z, upper_z); const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); sseb vmask = tnear <= tfar; dist[0] = tnear.f[0]; dist[1] = tnear.f[1]; int mask = (int)movemask(vmask); # ifdef __VISIBILITY_FLAG__ /* this visibility test gives a 5% performance hit, how to solve? */ float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility))? 1: 0) | (((mask & 2) && (__float_as_uint(cnodes.y) & visibility))? 2: 0); return cmask; # else return mask & 3; # endif } ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg, const float3 P, const float3 dir, const ssef& isect_near, const ssef& isect_far, const float difl, const int node_addr, const uint visibility, float dist[2]) { Transform space0 = bvh_unaligned_node_fetch_space(kg, node_addr, 0); Transform space1 = bvh_unaligned_node_fetch_space(kg, node_addr, 1); float3 aligned_dir0 = transform_direction(&space0, dir), aligned_dir1 = transform_direction(&space1, dir); float3 aligned_P0 = transform_point(&space0, P), aligned_P1 = transform_point(&space1, P); float3 nrdir0 = -bvh_inverse_direction(aligned_dir0), nrdir1 = -bvh_inverse_direction(aligned_dir1); ssef lower_x = ssef(aligned_P0.x * nrdir0.x, aligned_P1.x * nrdir1.x, 0.0f, 0.0f), lower_y = ssef(aligned_P0.y * nrdir0.y, aligned_P1.y * nrdir1.y, 0.0f, 0.0f), lower_z = ssef(aligned_P0.z * nrdir0.z, aligned_P1.z * nrdir1.z, 0.0f, 0.0f); ssef upper_x = lower_x - ssef(nrdir0.x, nrdir1.x, 0.0f, 0.0f), upper_y = lower_y - ssef(nrdir0.y, nrdir1.y, 0.0f, 0.0f), upper_z = lower_z - ssef(nrdir0.z, nrdir1.z, 0.0f, 0.0f); ssef tnear_x = min(lower_x, upper_x); ssef tnear_y = min(lower_y, upper_y); ssef tnear_z = min(lower_z, upper_z); ssef tfar_x = max(lower_x, upper_x); ssef tfar_y = max(lower_y, upper_y); ssef tfar_z = max(lower_z, upper_z); const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); sseb vmask; if(difl != 0.0f) { const float round_down = 1.0f - difl; const float round_up = 1.0f + difl; vmask = round_down*tnear <= round_up*tfar; } else { vmask = tnear <= tfar; } dist[0] = tnear.f[0]; dist[1] = tnear.f[1]; int mask = (int)movemask(vmask); # ifdef __VISIBILITY_FLAG__ /* this visibility test gives a 5% performance hit, how to solve? */ float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility))? 1: 0) | (((mask & 2) && (__float_as_uint(cnodes.y) & visibility))? 2: 0); return cmask; # else return mask & 3; # endif } ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, const float3& P, const float3& dir, const ssef& isect_near, const ssef& isect_far, const ssef& tsplat, const ssef Psplat[3], const ssef idirsplat[3], const shuffle_swap_t shufflexyz[3], const int node_addr, const uint visibility, float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { return bvh_unaligned_node_intersect(kg, P, dir, isect_near, isect_far, node_addr, visibility, dist); } else { return bvh_aligned_node_intersect(kg, P, dir, tsplat, Psplat, idirsplat, shufflexyz, node_addr, visibility, dist); } } ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg, const float3& P, const float3& dir, const ssef& isect_near, const ssef& isect_far, const ssef& tsplat, const ssef Psplat[3], const ssef idirsplat[3], const shuffle_swap_t shufflexyz[3], const float difl, const float extmax, const int node_addr, const uint visibility, float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { return bvh_unaligned_node_intersect_robust(kg, P, dir, isect_near, isect_far, difl, node_addr, visibility, dist); } else { return bvh_aligned_node_intersect_robust(kg, P, dir, tsplat, Psplat, idirsplat, shufflexyz, difl, extmax, node_addr, visibility, dist); } } #endif /* !defined(__KERNEL_SSE2__) */ goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh_shadow_all.h000066400000000000000000000307651334742672700235740ustar00rootroot00000000000000/* * Adapted from code Copyright 2009-2010 NVIDIA Corporation, * and code copyright 2009-2012 Intel Corporation * * Modifications Copyright 2011-2013, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef __QBVH__ # include "kernel/bvh/qbvh_shadow_all.h" #endif #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT bvh_node_intersect #else # define NODE_INTERSECT bvh_aligned_node_intersect #endif /* This is a template BVH traversal function, where various features can be * enabled/disabled. This way we can compile optimized versions for each case * without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_HAIR: hair curve rendering * BVH_MOTION: motion blur rendering * */ #ifndef __KERNEL_GPU__ ccl_device #else ccl_device_inline #endif bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect_array, const uint visibility, const uint max_hits, uint *num_hits) { /* todo: * - likely and unlikely for if() statements * - test restrict attribute for pointers */ /* traversal stack in CUDA thread-local memory */ int traversal_stack[BVH_STACK_SIZE]; traversal_stack[0] = ENTRYPOINT_SENTINEL; /* traversal variables in registers */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; /* ray parameters in registers */ const float tmax = ray->t; float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; float isect_t = tmax; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif #if BVH_FEATURE(BVH_INSTANCING) int num_hits_in_instance = 0; #endif *num_hits = 0; isect_array->t = tmax; #if defined(__KERNEL_SSE2__) const shuffle_swap_t shuf_identity = shuffle_swap_identity(); const shuffle_swap_t shuf_swap = shuffle_swap_swap(); const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); ssef Psplat[3], idirsplat[3]; # if BVH_FEATURE(BVH_HAIR) ssef tnear(0.0f), tfar(isect_t); # endif shuffle_swap_t shufflexyz[3]; Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); ssef tsplat(0.0f, 0.0f, -isect_t, -isect_t); gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif /* __KERNEL_SSE2__ */ /* traversal loop */ do { do { /* traverse internal nodes */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { int node_addr_child1, traverse_mask; float dist[2]; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); #if !defined(__KERNEL_SSE2__) traverse_mask = NODE_INTERSECT(kg, P, # if BVH_FEATURE(BVH_HAIR) dir, # endif idir, isect_t, node_addr, visibility, dist); #else // __KERNEL_SSE2__ traverse_mask = NODE_INTERSECT(kg, P, dir, # if BVH_FEATURE(BVH_HAIR) tnear, tfar, # endif tsplat, Psplat, idirsplat, shufflexyz, node_addr, visibility, dist); #endif // __KERNEL_SSE2__ node_addr = __float_as_int(cnodes.z); node_addr_child1 = __float_as_int(cnodes.w); if(traverse_mask == 3) { /* Both children were intersected, push the farther one. */ bool is_closest_child1 = (dist[1] < dist[0]); if(is_closest_child1) { int tmp = node_addr; node_addr = node_addr_child1; node_addr_child1 = tmp; } ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = node_addr_child1; } else { /* One child was intersected. */ if(traverse_mask == 2) { node_addr = node_addr_child1; } else if(traverse_mask == 0) { /* Neither child was intersected. */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; } } } /* if node is leaf, fetch triangle list */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif const int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); const uint p_type = type & PRIMITIVE_ALL; /* pop */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; /* primitive intersection */ while(prim_addr < prim_addr2) { kernel_assert((kernel_tex_fetch(__prim_type, prim_addr) & PRIMITIVE_ALL) == p_type); bool hit; /* todo: specialized intersect functions which don't fill in * isect unless needed and check SD_HAS_TRANSPARENT_SHADOW? * might give a few % performance improvement */ switch(p_type) { case PRIMITIVE_TRIANGLE: { hit = triangle_intersect(kg, isect_array, P, dir, visibility, object, prim_addr); break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { hit = motion_triangle_intersect(kg, isect_array, P, dir, ray->time, visibility, object, prim_addr); break; } #endif #if BVH_FEATURE(BVH_HAIR) case PRIMITIVE_CURVE: case PRIMITIVE_MOTION_CURVE: { const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr); if(kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) { hit = cardinal_curve_intersect(kg, isect_array, P, dir, visibility, object, prim_addr, ray->time, curve_type, NULL, 0, 0); } else { hit = curve_intersect(kg, isect_array, P, dir, visibility, object, prim_addr, ray->time, curve_type, NULL, 0, 0); } break; } #endif default: { hit = false; break; } } /* shadow ray early termination */ if(hit) { /* detect if this surface has a shader with transparent shadows */ /* todo: optimize so primitive visibility flag indicates if * the primitive has a transparent shadow shader? */ int prim = kernel_tex_fetch(__prim_index, isect_array->prim); int shader = 0; #ifdef __HAIR__ if(kernel_tex_fetch(__prim_type, isect_array->prim) & PRIMITIVE_ALL_TRIANGLE) #endif { shader = kernel_tex_fetch(__tri_shader, prim); } #ifdef __HAIR__ else { float4 str = kernel_tex_fetch(__curves, prim); shader = __float_as_int(str.z); } #endif int flag = kernel_tex_fetch(__shader_flag, (shader & SHADER_MASK)*SHADER_SIZE); /* if no transparent shadows, all light is blocked */ if(!(flag & SD_HAS_TRANSPARENT_SHADOW)) { return true; } /* if maximum number of hits reached, block all light */ else if(*num_hits == max_hits) { return true; } /* move on to next entry in intersections array */ isect_array++; (*num_hits)++; #if BVH_FEATURE(BVH_INSTANCING) num_hits_in_instance++; #endif isect_array->t = isect_t; } prim_addr++; } } #if BVH_FEATURE(BVH_INSTANCING) else { /* instance push */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); # if BVH_FEATURE(BVH_MOTION) isect_t = bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, isect_t, &ob_itfm); # else isect_t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect_t); # endif num_hits_in_instance = 0; isect_array->t = isect_t; # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect_t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL; node_addr = kernel_tex_fetch(__object_node, object); } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* Instance pop. */ if(num_hits_in_instance) { float t_fac; # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac, &ob_itfm); # else bvh_instance_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac); # endif /* scale isect->t to adjust for instancing */ for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } } else { # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX, &ob_itfm); # else bvh_instance_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX); # endif } isect_t = tmax; isect_array->t = isect_t; # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect_t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr]; --stack_ptr; } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); return false; } ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersection *isect_array, const uint visibility, const uint max_hits, uint *num_hits) { switch(kernel_data.bvh.bvh_layout) { #ifdef __QBVH__ case BVH_LAYOUT_BVH4: return BVH_FUNCTION_FULL_NAME(QBVH)(kg, ray, isect_array, visibility, max_hits, num_hits); #endif case BVH_LAYOUT_BVH2: return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect_array, visibility, max_hits, num_hits); } kernel_assert(!"Should not happen"); return false; } #undef BVH_FUNCTION_NAME #undef BVH_FUNCTION_FEATURES #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh_traversal.h000066400000000000000000000350111334742672700234470ustar00rootroot00000000000000/* * Adapted from code Copyright 2009-2010 NVIDIA Corporation, * and code copyright 2009-2012 Intel Corporation * * Modifications Copyright 2011-2013, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef __QBVH__ # include "kernel/bvh/qbvh_traversal.h" #endif #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT bvh_node_intersect # define NODE_INTERSECT_ROBUST bvh_node_intersect_robust #else # define NODE_INTERSECT bvh_aligned_node_intersect # define NODE_INTERSECT_ROBUST bvh_aligned_node_intersect_robust #endif /* This is a template BVH traversal function, where various features can be * enabled/disabled. This way we can compile optimized versions for each case * without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_HAIR: hair curve rendering * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width * BVH_MOTION: motion blur rendering * */ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint visibility #if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) , uint *lcg_state, float difl, float extmax #endif ) { /* todo: * - test if pushing distance on the stack helps (for non shadow rays) * - separate version for shadow rays * - likely and unlikely for if() statements * - test restrict attribute for pointers */ /* traversal stack in CUDA thread-local memory */ int traversal_stack[BVH_STACK_SIZE]; traversal_stack[0] = ENTRYPOINT_SENTINEL; /* traversal variables in registers */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; /* ray parameters in registers */ float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif isect->t = ray->t; isect->u = 0.0f; isect->v = 0.0f; isect->prim = PRIM_NONE; isect->object = OBJECT_NONE; BVH_DEBUG_INIT(); #if defined(__KERNEL_SSE2__) const shuffle_swap_t shuf_identity = shuffle_swap_identity(); const shuffle_swap_t shuf_swap = shuffle_swap_swap(); const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); ssef Psplat[3], idirsplat[3]; # if BVH_FEATURE(BVH_HAIR) ssef tnear(0.0f), tfar(isect->t); # endif shuffle_swap_t shufflexyz[3]; Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); ssef tsplat(0.0f, 0.0f, -isect->t, -isect->t); gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif /* traversal loop */ do { do { /* traverse internal nodes */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { int node_addr_child1, traverse_mask; float dist[2]; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); #if !defined(__KERNEL_SSE2__) # if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) if(difl != 0.0f) { traverse_mask = NODE_INTERSECT_ROBUST(kg, P, # if BVH_FEATURE(BVH_HAIR) dir, # endif idir, isect->t, difl, extmax, node_addr, visibility, dist); } else # endif { traverse_mask = NODE_INTERSECT(kg, P, # if BVH_FEATURE(BVH_HAIR) dir, # endif idir, isect->t, node_addr, visibility, dist); } #else // __KERNEL_SSE2__ # if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) if(difl != 0.0f) { traverse_mask = NODE_INTERSECT_ROBUST(kg, P, dir, # if BVH_FEATURE(BVH_HAIR) tnear, tfar, # endif tsplat, Psplat, idirsplat, shufflexyz, difl, extmax, node_addr, visibility, dist); } else # endif { traverse_mask = NODE_INTERSECT(kg, P, dir, # if BVH_FEATURE(BVH_HAIR) tnear, tfar, # endif tsplat, Psplat, idirsplat, shufflexyz, node_addr, visibility, dist); } #endif // __KERNEL_SSE2__ node_addr = __float_as_int(cnodes.z); node_addr_child1 = __float_as_int(cnodes.w); if(traverse_mask == 3) { /* Both children were intersected, push the farther one. */ bool is_closest_child1 = (dist[1] < dist[0]); if(is_closest_child1) { int tmp = node_addr; node_addr = node_addr_child1; node_addr_child1 = tmp; } ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = node_addr_child1; } else { /* One child was intersected. */ if(traverse_mask == 2) { node_addr = node_addr_child1; } else if(traverse_mask == 0) { /* Neither child was intersected. */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; } } BVH_DEBUG_NEXT_NODE(); } /* if node is leaf, fetch triangle list */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif const int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); /* pop */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; /* primitive intersection */ switch(type & PRIMITIVE_ALL) { case PRIMITIVE_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr)) { /* shadow ray early termination */ #if defined(__KERNEL_SSE2__) if(visibility & PATH_RAY_SHADOW_OPAQUE) return true; tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif #else if(visibility & PATH_RAY_SHADOW_OPAQUE) return true; #endif } } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, prim_addr)) { /* shadow ray early termination */ # if defined(__KERNEL_SSE2__) if(visibility & PATH_RAY_SHADOW_OPAQUE) return true; tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif # else if(visibility & PATH_RAY_SHADOW_OPAQUE) return true; # endif } } break; } #endif /* BVH_FEATURE(BVH_MOTION) */ #if BVH_FEATURE(BVH_HAIR) case PRIMITIVE_CURVE: case PRIMITIVE_MOTION_CURVE: { for(; prim_addr < prim_addr2; prim_addr++) { BVH_DEBUG_NEXT_INTERSECTION(); const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr); kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL)); bool hit; if(kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) { hit = cardinal_curve_intersect(kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type, lcg_state, difl, extmax); } else { hit = curve_intersect(kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type, lcg_state, difl, extmax); } if(hit) { /* shadow ray early termination */ # if defined(__KERNEL_SSE2__) if(visibility & PATH_RAY_SHADOW_OPAQUE) return true; tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif # else if(visibility & PATH_RAY_SHADOW_OPAQUE) return true; # endif } } break; } #endif /* BVH_FEATURE(BVH_HAIR) */ } } #if BVH_FEATURE(BVH_INSTANCING) else { /* instance push */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); # if BVH_FEATURE(BVH_MOTION) isect->t = bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, isect->t, &ob_itfm); # else isect->t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect->t); # endif # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL; node_addr = kernel_tex_fetch(__object_node, object); BVH_DEBUG_NEXT_INSTANCE(); } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* instance pop */ # if BVH_FEATURE(BVH_MOTION) isect->t = bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, isect->t, &ob_itfm); # else isect->t = bvh_instance_pop(kg, object, ray, &P, &dir, &idir, isect->t); # endif # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr]; --stack_ptr; } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); return (isect->prim != PRIM_NONE); } ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint visibility #if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) , uint *lcg_state, float difl, float extmax #endif ) { switch(kernel_data.bvh.bvh_layout) { #ifdef __QBVH__ case BVH_LAYOUT_BVH4: return BVH_FUNCTION_FULL_NAME(QBVH)(kg, ray, isect, visibility # if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) , lcg_state, difl, extmax # endif ); #endif /* __QBVH__ */ case BVH_LAYOUT_BVH2: return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect, visibility #if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) , lcg_state, difl, extmax #endif ); } kernel_assert(!"Should not happen"); return false; } #undef BVH_FUNCTION_NAME #undef BVH_FUNCTION_FEATURES #undef NODE_INTERSECT #undef NODE_INTERSECT_ROBUST goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh_types.h000066400000000000000000000042301334742672700226070ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BVH_TYPES__ #define __BVH_TYPES__ CCL_NAMESPACE_BEGIN /* Don't inline intersect functions on GPU, this is faster */ #ifdef __KERNEL_GPU__ # define ccl_device_intersect ccl_device_forceinline #else # define ccl_device_intersect ccl_device_inline #endif /* bottom-most stack entry, indicating the end of traversal */ #define ENTRYPOINT_SENTINEL 0x76543210 /* 64 object BVH + 64 mesh BVH + 64 object node splitting */ #define BVH_STACK_SIZE 192 #define BVH_QSTACK_SIZE 384 /* BVH intersection function variations */ #define BVH_INSTANCING 1 #define BVH_MOTION 2 #define BVH_HAIR 4 #define BVH_HAIR_MINIMUM_WIDTH 8 #define BVH_NAME_JOIN(x,y) x ## _ ## y #define BVH_NAME_EVAL(x,y) BVH_NAME_JOIN(x,y) #define BVH_FUNCTION_FULL_NAME(prefix) BVH_NAME_EVAL(prefix, BVH_FUNCTION_NAME) #define BVH_FEATURE(f) (((BVH_FUNCTION_FEATURES) & (f)) != 0) /* Debugging heleprs */ #ifdef __KERNEL_DEBUG__ # define BVH_DEBUG_INIT() \ do { \ isect->num_traversed_nodes = 0; \ isect->num_traversed_instances = 0; \ isect->num_intersections = 0; \ } while(0) # define BVH_DEBUG_NEXT_NODE() \ do { \ ++isect->num_traversed_nodes; \ } while(0) # define BVH_DEBUG_NEXT_INTERSECTION() \ do { \ ++isect->num_intersections; \ } while(0) # define BVH_DEBUG_NEXT_INSTANCE() \ do { \ ++isect->num_traversed_instances; \ } while(0) #else /* __KERNEL_DEBUG__ */ # define BVH_DEBUG_INIT() # define BVH_DEBUG_NEXT_NODE() # define BVH_DEBUG_NEXT_INTERSECTION() # define BVH_DEBUG_NEXT_INSTANCE() #endif /* __KERNEL_DEBUG__ */ CCL_NAMESPACE_END #endif /* __BVH_TYPES__ */ goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh_volume.h000066400000000000000000000235261334742672700227630ustar00rootroot00000000000000/* * Adapted from code Copyright 2009-2010 NVIDIA Corporation, * and code copyright 2009-2012 Intel Corporation * * Modifications Copyright 2011-2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef __QBVH__ # include "kernel/bvh/qbvh_volume.h" #endif #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT bvh_node_intersect #else # define NODE_INTERSECT bvh_aligned_node_intersect #endif /* This is a template BVH traversal function for volumes, where * various features can be enabled/disabled. This way we can compile optimized * versions for each case without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_MOTION: motion blur rendering * */ #ifndef __KERNEL_GPU__ ccl_device #else ccl_device_inline #endif bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint visibility) { /* todo: * - test if pushing distance on the stack helps (for non shadow rays) * - separate version for shadow rays * - likely and unlikely for if() statements * - test restrict attribute for pointers */ /* traversal stack in CUDA thread-local memory */ int traversal_stack[BVH_STACK_SIZE]; traversal_stack[0] = ENTRYPOINT_SENTINEL; /* traversal variables in registers */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; /* ray parameters in registers */ float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif isect->t = ray->t; isect->u = 0.0f; isect->v = 0.0f; isect->prim = PRIM_NONE; isect->object = OBJECT_NONE; #if defined(__KERNEL_SSE2__) const shuffle_swap_t shuf_identity = shuffle_swap_identity(); const shuffle_swap_t shuf_swap = shuffle_swap_swap(); const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); ssef Psplat[3], idirsplat[3]; # if BVH_FEATURE(BVH_HAIR) ssef tnear(0.0f), tfar(isect->t); # endif shuffle_swap_t shufflexyz[3]; Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); ssef tsplat(0.0f, 0.0f, -isect->t, -isect->t); gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif /* traversal loop */ do { do { /* traverse internal nodes */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { int node_addr_child1, traverse_mask; float dist[2]; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); #if !defined(__KERNEL_SSE2__) traverse_mask = NODE_INTERSECT(kg, P, # if BVH_FEATURE(BVH_HAIR) dir, # endif idir, isect->t, node_addr, visibility, dist); #else // __KERNEL_SSE2__ traverse_mask = NODE_INTERSECT(kg, P, dir, # if BVH_FEATURE(BVH_HAIR) tnear, tfar, # endif tsplat, Psplat, idirsplat, shufflexyz, node_addr, visibility, dist); #endif // __KERNEL_SSE2__ node_addr = __float_as_int(cnodes.z); node_addr_child1 = __float_as_int(cnodes.w); if(traverse_mask == 3) { /* Both children were intersected, push the farther one. */ bool is_closest_child1 = (dist[1] < dist[0]); if(is_closest_child1) { int tmp = node_addr; node_addr = node_addr_child1; node_addr_child1 = tmp; } ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = node_addr_child1; } else { /* One child was intersected. */ if(traverse_mask == 2) { node_addr = node_addr_child1; } else if(traverse_mask == 0) { /* Neither child was intersected. */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; } } } /* if node is leaf, fetch triangle list */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif const int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); /* pop */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; /* primitive intersection */ switch(type & PRIMITIVE_ALL) { case PRIMITIVE_TRIANGLE: { /* intersect ray against primitive */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* only primitives from volume object */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr); } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { /* intersect ray against primitive */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* only primitives from volume object */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, prim_addr); } break; } #endif default: { break; } } } #if BVH_FEATURE(BVH_INSTANCING) else { /* instance push */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_HAS_VOLUME) { # if BVH_FEATURE(BVH_MOTION) isect->t = bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, isect->t, &ob_itfm); # else isect->t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect->t); # endif # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL; node_addr = kernel_tex_fetch(__object_node, object); } else { /* pop */ object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr]; --stack_ptr; } } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* instance pop */ # if BVH_FEATURE(BVH_MOTION) isect->t = bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, isect->t, &ob_itfm); # else isect->t = bvh_instance_pop(kg, object, ray, &P, &dir, &idir, isect->t); # endif # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr]; --stack_ptr; } #endif /* FEATURE(BVH_MOTION) */ } while(node_addr != ENTRYPOINT_SENTINEL); return (isect->prim != PRIM_NONE); } ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint visibility) { switch(kernel_data.bvh.bvh_layout) { #ifdef __QBVH__ case BVH_LAYOUT_BVH4: return BVH_FUNCTION_FULL_NAME(QBVH)(kg, ray, isect, visibility); #endif case BVH_LAYOUT_BVH2: return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect, visibility); } kernel_assert(!"Should not happen"); return false; } #undef BVH_FUNCTION_NAME #undef BVH_FUNCTION_FEATURES #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/bvh/bvh_volume_all.h000066400000000000000000000304341334742672700236070ustar00rootroot00000000000000/* * Adapted from code Copyright 2009-2010 NVIDIA Corporation, * and code copyright 2009-2012 Intel Corporation * * Modifications Copyright 2011-2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef __QBVH__ # include "kernel/bvh/qbvh_volume_all.h" #endif #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT bvh_node_intersect #else # define NODE_INTERSECT bvh_aligned_node_intersect #endif /* This is a template BVH traversal function for volumes, where * various features can be enabled/disabled. This way we can compile optimized * versions for each case without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_MOTION: motion blur rendering * */ #ifndef __KERNEL_GPU__ ccl_device #else ccl_device_inline #endif uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect_array, const uint max_hits, const uint visibility) { /* todo: * - test if pushing distance on the stack helps (for non shadow rays) * - separate version for shadow rays * - likely and unlikely for if() statements * - test restrict attribute for pointers */ /* traversal stack in CUDA thread-local memory */ int traversal_stack[BVH_STACK_SIZE]; traversal_stack[0] = ENTRYPOINT_SENTINEL; /* traversal variables in registers */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; /* ray parameters in registers */ const float tmax = ray->t; float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; float isect_t = tmax; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif #if BVH_FEATURE(BVH_INSTANCING) int num_hits_in_instance = 0; #endif uint num_hits = 0; isect_array->t = tmax; #if defined(__KERNEL_SSE2__) const shuffle_swap_t shuf_identity = shuffle_swap_identity(); const shuffle_swap_t shuf_swap = shuffle_swap_swap(); const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); ssef Psplat[3], idirsplat[3]; # if BVH_FEATURE(BVH_HAIR) ssef tnear(0.0f), tfar(isect_t); # endif shuffle_swap_t shufflexyz[3]; Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); ssef tsplat(0.0f, 0.0f, -isect_t, -isect_t); gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif /* __KERNEL_SSE2__ */ /* traversal loop */ do { do { /* traverse internal nodes */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { int node_addr_child1, traverse_mask; float dist[2]; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); #if !defined(__KERNEL_SSE2__) traverse_mask = NODE_INTERSECT(kg, P, # if BVH_FEATURE(BVH_HAIR) dir, # endif idir, isect_t, node_addr, visibility, dist); #else // __KERNEL_SSE2__ traverse_mask = NODE_INTERSECT(kg, P, dir, # if BVH_FEATURE(BVH_HAIR) tnear, tfar, # endif tsplat, Psplat, idirsplat, shufflexyz, node_addr, visibility, dist); #endif // __KERNEL_SSE2__ node_addr = __float_as_int(cnodes.z); node_addr_child1 = __float_as_int(cnodes.w); if(traverse_mask == 3) { /* Both children were intersected, push the farther one. */ bool is_closest_child1 = (dist[1] < dist[0]); if(is_closest_child1) { int tmp = node_addr; node_addr = node_addr_child1; node_addr_child1 = tmp; } ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = node_addr_child1; } else { /* One child was intersected. */ if(traverse_mask == 2) { node_addr = node_addr_child1; } else if(traverse_mask == 0) { /* Neither child was intersected. */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; } } } /* if node is leaf, fetch triangle list */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif const int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); bool hit; /* pop */ node_addr = traversal_stack[stack_ptr]; --stack_ptr; /* primitive intersection */ switch(type & PRIMITIVE_ALL) { case PRIMITIVE_TRIANGLE: { /* intersect ray against primitive */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* only primitives from volume object */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } hit = triangle_intersect(kg, isect_array, P, dir, visibility, object, prim_addr); if(hit) { /* Move on to next entry in intersections array. */ isect_array++; num_hits++; #if BVH_FEATURE(BVH_INSTANCING) num_hits_in_instance++; #endif isect_array->t = isect_t; if(num_hits == max_hits) { #if BVH_FEATURE(BVH_INSTANCING) # if BVH_FEATURE(BVH_MOTION) float t_fac = 1.0f / len(transform_direction(&ob_itfm, dir)); # else Transform itfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); float t_fac = 1.0f / len(transform_direction(&itfm, dir)); # endif for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } #endif /* BVH_FEATURE(BVH_INSTANCING) */ return num_hits; } } } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { /* intersect ray against primitive */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* only primitives from volume object */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } hit = motion_triangle_intersect(kg, isect_array, P, dir, ray->time, visibility, object, prim_addr); if(hit) { /* Move on to next entry in intersections array. */ isect_array++; num_hits++; # if BVH_FEATURE(BVH_INSTANCING) num_hits_in_instance++; # endif isect_array->t = isect_t; if(num_hits == max_hits) { # if BVH_FEATURE(BVH_INSTANCING) # if BVH_FEATURE(BVH_MOTION) float t_fac = 1.0f / len(transform_direction(&ob_itfm, dir)); # else Transform itfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); float t_fac = 1.0f / len(transform_direction(&itfm, dir)); # endif for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } # endif /* BVH_FEATURE(BVH_INSTANCING) */ return num_hits; } } } break; } #endif /* BVH_MOTION */ default: { break; } } } #if BVH_FEATURE(BVH_INSTANCING) else { /* instance push */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_HAS_VOLUME) { # if BVH_FEATURE(BVH_MOTION) isect_t = bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, isect_t, &ob_itfm); # else isect_t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect_t); # endif num_hits_in_instance = 0; isect_array->t = isect_t; # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect_t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif ++stack_ptr; kernel_assert(stack_ptr < BVH_STACK_SIZE); traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL; node_addr = kernel_tex_fetch(__object_node, object); } else { /* pop */ object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr]; --stack_ptr; } } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* Instance pop. */ if(num_hits_in_instance) { float t_fac; # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac, &ob_itfm); # else bvh_instance_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac); # endif /* Scale isect->t to adjust for instancing. */ for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } } else { # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX, &ob_itfm); # else bvh_instance_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX); # endif } isect_t = tmax; isect_array->t = isect_t; # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); Psplat[2] = ssef(P.z); tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect_t); # endif gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr]; --stack_ptr; } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); return num_hits; } ccl_device_inline uint BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersection *isect_array, const uint max_hits, const uint visibility) { switch(kernel_data.bvh.bvh_layout) { #ifdef __QBVH__ case BVH_LAYOUT_BVH4: return BVH_FUNCTION_FULL_NAME(QBVH)(kg, ray, isect_array, max_hits, visibility); #endif case BVH_LAYOUT_BVH2: return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect_array, max_hits, visibility); } kernel_assert(!"Should not happen"); return 0; } #undef BVH_FUNCTION_NAME #undef BVH_FUNCTION_FEATURES #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/bvh/qbvh_local.h000066400000000000000000000225571334742672700227320ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This is a template BVH traversal function for finding local intersections * around the shading point, for subsurface scattering and bevel. We disable * various features for performance, and for instanced objects avoid traversing * other parts of the scene. * * BVH_MOTION: motion blur rendering * */ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT qbvh_node_intersect #else # define NODE_INTERSECT qbvh_aligned_node_intersect #endif ccl_device void BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, const Ray *ray, LocalIntersection *local_isect, int local_object, uint *lcg_state, int max_hits) { /* TODO(sergey): * - Test if pushing distance on the stack helps (for non shadow rays). * - Separate version for shadow rays. * - Likely and unlikely for if() statements. * - SSE for hair. * - Test restrict attribute for pointers. */ /* Traversal stack in CUDA thread-local memory. */ QBVHStackItem traversal_stack[BVH_QSTACK_SIZE]; traversal_stack[0].addr = ENTRYPOINT_SENTINEL; /* Traversal variables in registers. */ int stack_ptr = 0; int node_addr = kernel_tex_fetch(__object_node, local_object); /* Ray parameters in registers. */ float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; float isect_t = ray->t; local_isect->num_hits = 0; const int object_flag = kernel_tex_fetch(__object_flag, local_object); if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; isect_t = bvh_instance_motion_push(kg, local_object, ray, &P, &dir, &idir, isect_t, &ob_itfm); #else isect_t = bvh_instance_push(kg, local_object, ray, &P, &dir, &idir, isect_t); #endif object = local_object; } #ifndef __KERNEL_SSE41__ if(!isfinite(P.x)) { return; } #endif ssef tnear(0.0f), tfar(isect_t); #if BVH_FEATURE(BVH_HAIR) sse3f dir4(ssef(dir.x), ssef(dir.y), ssef(dir.z)); #endif sse3f idir4(ssef(idir.x), ssef(idir.y), ssef(idir.z)); #ifdef __KERNEL_AVX2__ float3 P_idir = P*idir; sse3f P_idir4(P_idir.x, P_idir.y, P_idir.z); #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) sse3f org4(ssef(P.x), ssef(P.y), ssef(P.z)); #endif /* Offsets to select the side that becomes the lower or upper bound. */ int near_x, near_y, near_z; int far_x, far_y, far_z; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); /* Traversal loop. */ do { do { /* Traverse internal nodes. */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { ssef dist; int child_mask = NODE_INTERSECT(kg, tnear, tfar, #ifdef __KERNEL_AVX2__ P_idir4, #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4, #endif #if BVH_FEATURE(BVH_HAIR) dir4, #endif idir4, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, &dist); if(child_mask != 0) { float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); float4 cnodes; #if BVH_FEATURE(BVH_HAIR) if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+13); } else #endif { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+7); } /* One child is hit, continue with that child. */ int r = __bscf(child_mask); if(child_mask == 0) { node_addr = __float_as_int(cnodes[r]); continue; } /* Two children are hit, push far child, and continue with * closer child. */ int c0 = __float_as_int(cnodes[r]); float d0 = ((float*)&dist)[r]; r = __bscf(child_mask); int c1 = __float_as_int(cnodes[r]); float d1 = ((float*)&dist)[r]; if(child_mask == 0) { if(d1 < d0) { node_addr = c1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; continue; } else { node_addr = c0; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; continue; } } /* Here starts the slow path for 3 or 4 hit children. We push * all nodes onto the stack to sort them there. */ ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; /* Three children are hit, push all onto stack and sort 3 * stack items, continue with closest child. */ r = __bscf(child_mask); int c2 = __float_as_int(cnodes[r]); float d2 = ((float*)&dist)[r]; if(child_mask == 0) { ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2]); node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } /* Four children are hit, push all onto stack and sort 4 * stack items, continue with closest child. */ r = __bscf(child_mask); int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c3; traversal_stack[stack_ptr].dist = d3; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2], &traversal_stack[stack_ptr - 3]); } node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } /* If node is leaf, fetch triangle list. */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); int prim_addr = __float_as_int(leaf.x); int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; /* Primitive intersection. */ switch(type & PRIMITIVE_ALL) { case PRIMITIVE_TRIANGLE: { /* Intersect ray against primitive, */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); triangle_intersect_local(kg, local_isect, P, dir, object, local_object, prim_addr, isect_t, lcg_state, max_hits); } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { /* Intersect ray against primitive. */ for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); motion_triangle_intersect_local(kg, local_isect, P, dir, ray->time, object, local_object, prim_addr, isect_t, lcg_state, max_hits); } break; } #endif default: break; } } } while(node_addr != ENTRYPOINT_SENTINEL); } while(node_addr != ENTRYPOINT_SENTINEL); } #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/bvh/qbvh_nodes.h000066400000000000000000000436101334742672700227410ustar00rootroot00000000000000/* * Copyright 2011-2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Aligned nodes intersection SSE code is adopted from Embree, */ struct QBVHStackItem { int addr; float dist; }; ccl_device_inline void qbvh_near_far_idx_calc(const float3& idir, int *ccl_restrict near_x, int *ccl_restrict near_y, int *ccl_restrict near_z, int *ccl_restrict far_x, int *ccl_restrict far_y, int *ccl_restrict far_z) { #ifdef __KERNEL_SSE__ *near_x = 0; *far_x = 1; *near_y = 2; *far_y = 3; *near_z = 4; *far_z = 5; const size_t mask = movemask(ssef(idir.m128)); const int mask_x = mask & 1; const int mask_y = (mask & 2) >> 1; const int mask_z = (mask & 4) >> 2; *near_x += mask_x; *far_x -= mask_x; *near_y += mask_y; *far_y -= mask_y; *near_z += mask_z; *far_z -= mask_z; #else if(idir.x >= 0.0f) { *near_x = 0; *far_x = 1; } else { *near_x = 1; *far_x = 0; } if(idir.y >= 0.0f) { *near_y = 2; *far_y = 3; } else { *near_y = 3; *far_y = 2; } if(idir.z >= 0.0f) { *near_z = 4; *far_z = 5; } else { *near_z = 5; *far_z = 4; } #endif } /* TOOD(sergey): Investigate if using intrinsics helps for both * stack item swap and float comparison. */ ccl_device_inline void qbvh_item_swap(QBVHStackItem *ccl_restrict a, QBVHStackItem *ccl_restrict b) { QBVHStackItem tmp = *a; *a = *b; *b = tmp; } ccl_device_inline void qbvh_stack_sort(QBVHStackItem *ccl_restrict s1, QBVHStackItem *ccl_restrict s2, QBVHStackItem *ccl_restrict s3) { if(s2->dist < s1->dist) { qbvh_item_swap(s2, s1); } if(s3->dist < s2->dist) { qbvh_item_swap(s3, s2); } if(s2->dist < s1->dist) { qbvh_item_swap(s2, s1); } } ccl_device_inline void qbvh_stack_sort(QBVHStackItem *ccl_restrict s1, QBVHStackItem *ccl_restrict s2, QBVHStackItem *ccl_restrict s3, QBVHStackItem *ccl_restrict s4) { if(s2->dist < s1->dist) { qbvh_item_swap(s2, s1); } if(s4->dist < s3->dist) { qbvh_item_swap(s4, s3); } if(s3->dist < s1->dist) { qbvh_item_swap(s3, s1); } if(s4->dist < s2->dist) { qbvh_item_swap(s4, s2); } if(s3->dist < s2->dist) { qbvh_item_swap(s3, s2); } } /* Axis-aligned nodes intersection */ ccl_device_inline int qbvh_aligned_node_intersect(KernelGlobals *ccl_restrict kg, const ssef& isect_near, const ssef& isect_far, #ifdef __KERNEL_AVX2__ const sse3f& org_idir, #else const sse3f& org, #endif const sse3f& idir, const int near_x, const int near_y, const int near_z, const int far_x, const int far_y, const int far_z, const int node_addr, ssef *ccl_restrict dist) { const int offset = node_addr + 1; #ifdef __KERNEL_AVX2__ const ssef tnear_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+near_x), idir.x, org_idir.x); const ssef tnear_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+near_y), idir.y, org_idir.y); const ssef tnear_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+near_z), idir.z, org_idir.z); const ssef tfar_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+far_x), idir.x, org_idir.x); const ssef tfar_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+far_y), idir.y, org_idir.y); const ssef tfar_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+far_z), idir.z, org_idir.z); #else const ssef tnear_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset+near_x) - org.x) * idir.x; const ssef tnear_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset+near_y) - org.y) * idir.y; const ssef tnear_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset+near_z) - org.z) * idir.z; const ssef tfar_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset+far_x) - org.x) * idir.x; const ssef tfar_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset+far_y) - org.y) * idir.y; const ssef tfar_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset+far_z) - org.z) * idir.z; #endif #ifdef __KERNEL_SSE41__ const ssef tnear = maxi(maxi(tnear_x, tnear_y), maxi(tnear_z, isect_near)); const ssef tfar = mini(mini(tfar_x, tfar_y), mini(tfar_z, isect_far)); const sseb vmask = cast(tnear) > cast(tfar); int mask = (int)movemask(vmask)^0xf; #else const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); const sseb vmask = tnear <= tfar; int mask = (int)movemask(vmask); #endif *dist = tnear; return mask; } ccl_device_inline int qbvh_aligned_node_intersect_robust( KernelGlobals *ccl_restrict kg, const ssef& isect_near, const ssef& isect_far, #ifdef __KERNEL_AVX2__ const sse3f& P_idir, #else const sse3f& P, #endif const sse3f& idir, const int near_x, const int near_y, const int near_z, const int far_x, const int far_y, const int far_z, const int node_addr, const float difl, ssef *ccl_restrict dist) { const int offset = node_addr + 1; #ifdef __KERNEL_AVX2__ const ssef tnear_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+near_x), idir.x, P_idir.x); const ssef tnear_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+near_y), idir.y, P_idir.y); const ssef tnear_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+near_z), idir.z, P_idir.z); const ssef tfar_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+far_x), idir.x, P_idir.x); const ssef tfar_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+far_y), idir.y, P_idir.y); const ssef tfar_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset+far_z), idir.z, P_idir.z); #else const ssef tnear_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset+near_x) - P.x) * idir.x; const ssef tnear_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset+near_y) - P.y) * idir.y; const ssef tnear_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset+near_z) - P.z) * idir.z; const ssef tfar_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset+far_x) - P.x) * idir.x; const ssef tfar_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset+far_y) - P.y) * idir.y; const ssef tfar_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset+far_z) - P.z) * idir.z; #endif const float round_down = 1.0f - difl; const float round_up = 1.0f + difl; const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); const sseb vmask = round_down*tnear <= round_up*tfar; *dist = tnear; return (int)movemask(vmask); } /* Unaligned nodes intersection */ ccl_device_inline int qbvh_unaligned_node_intersect( KernelGlobals *ccl_restrict kg, const ssef& isect_near, const ssef& isect_far, #ifdef __KERNEL_AVX2__ const sse3f& org_idir, #endif const sse3f& org, const sse3f& dir, const sse3f& idir, const int near_x, const int near_y, const int near_z, const int far_x, const int far_y, const int far_z, const int node_addr, ssef *ccl_restrict dist) { const int offset = node_addr; const ssef tfm_x_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+1); const ssef tfm_x_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+2); const ssef tfm_x_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+3); const ssef tfm_y_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+4); const ssef tfm_y_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+5); const ssef tfm_y_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+6); const ssef tfm_z_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+7); const ssef tfm_z_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+8); const ssef tfm_z_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+9); const ssef tfm_t_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+10); const ssef tfm_t_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+11); const ssef tfm_t_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+12); const ssef aligned_dir_x = dir.x*tfm_x_x + dir.y*tfm_x_y + dir.z*tfm_x_z, aligned_dir_y = dir.x*tfm_y_x + dir.y*tfm_y_y + dir.z*tfm_y_z, aligned_dir_z = dir.x*tfm_z_x + dir.y*tfm_z_y + dir.z*tfm_z_z; const ssef aligned_P_x = org.x*tfm_x_x + org.y*tfm_x_y + org.z*tfm_x_z + tfm_t_x, aligned_P_y = org.x*tfm_y_x + org.y*tfm_y_y + org.z*tfm_y_z + tfm_t_y, aligned_P_z = org.x*tfm_z_x + org.y*tfm_z_y + org.z*tfm_z_z + tfm_t_z; const ssef neg_one(-1.0f, -1.0f, -1.0f, -1.0f); const ssef nrdir_x = neg_one / aligned_dir_x, nrdir_y = neg_one / aligned_dir_y, nrdir_z = neg_one / aligned_dir_z; const ssef tlower_x = aligned_P_x * nrdir_x, tlower_y = aligned_P_y * nrdir_y, tlower_z = aligned_P_z * nrdir_z; const ssef tupper_x = tlower_x - nrdir_x, tupper_y = tlower_y - nrdir_y, tupper_z = tlower_z - nrdir_z; #ifdef __KERNEL_SSE41__ const ssef tnear_x = mini(tlower_x, tupper_x); const ssef tnear_y = mini(tlower_y, tupper_y); const ssef tnear_z = mini(tlower_z, tupper_z); const ssef tfar_x = maxi(tlower_x, tupper_x); const ssef tfar_y = maxi(tlower_y, tupper_y); const ssef tfar_z = maxi(tlower_z, tupper_z); const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); const sseb vmask = tnear <= tfar; *dist = tnear; return movemask(vmask); #else const ssef tnear_x = min(tlower_x, tupper_x); const ssef tnear_y = min(tlower_y, tupper_y); const ssef tnear_z = min(tlower_z, tupper_z); const ssef tfar_x = max(tlower_x, tupper_x); const ssef tfar_y = max(tlower_y, tupper_y); const ssef tfar_z = max(tlower_z, tupper_z); const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); const sseb vmask = tnear <= tfar; *dist = tnear; return movemask(vmask); #endif } ccl_device_inline int qbvh_unaligned_node_intersect_robust( KernelGlobals *ccl_restrict kg, const ssef& isect_near, const ssef& isect_far, #ifdef __KERNEL_AVX2__ const sse3f& P_idir, #endif const sse3f& P, const sse3f& dir, const sse3f& idir, const int near_x, const int near_y, const int near_z, const int far_x, const int far_y, const int far_z, const int node_addr, const float difl, ssef *ccl_restrict dist) { const int offset = node_addr; const ssef tfm_x_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+1); const ssef tfm_x_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+2); const ssef tfm_x_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+3); const ssef tfm_y_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+4); const ssef tfm_y_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+5); const ssef tfm_y_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+6); const ssef tfm_z_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+7); const ssef tfm_z_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+8); const ssef tfm_z_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+9); const ssef tfm_t_x = kernel_tex_fetch_ssef(__bvh_nodes, offset+10); const ssef tfm_t_y = kernel_tex_fetch_ssef(__bvh_nodes, offset+11); const ssef tfm_t_z = kernel_tex_fetch_ssef(__bvh_nodes, offset+12); const ssef aligned_dir_x = dir.x*tfm_x_x + dir.y*tfm_x_y + dir.z*tfm_x_z, aligned_dir_y = dir.x*tfm_y_x + dir.y*tfm_y_y + dir.z*tfm_y_z, aligned_dir_z = dir.x*tfm_z_x + dir.y*tfm_z_y + dir.z*tfm_z_z; const ssef aligned_P_x = P.x*tfm_x_x + P.y*tfm_x_y + P.z*tfm_x_z + tfm_t_x, aligned_P_y = P.x*tfm_y_x + P.y*tfm_y_y + P.z*tfm_y_z + tfm_t_y, aligned_P_z = P.x*tfm_z_x + P.y*tfm_z_y + P.z*tfm_z_z + tfm_t_z; const ssef neg_one(-1.0f, -1.0f, -1.0f, -1.0f); const ssef nrdir_x = neg_one / aligned_dir_x, nrdir_y = neg_one / aligned_dir_y, nrdir_z = neg_one / aligned_dir_z; const ssef tlower_x = aligned_P_x * nrdir_x, tlower_y = aligned_P_y * nrdir_y, tlower_z = aligned_P_z * nrdir_z; const ssef tupper_x = tlower_x - nrdir_x, tupper_y = tlower_y - nrdir_y, tupper_z = tlower_z - nrdir_z; const float round_down = 1.0f - difl; const float round_up = 1.0f + difl; #ifdef __KERNEL_SSE41__ const ssef tnear_x = mini(tlower_x, tupper_x); const ssef tnear_y = mini(tlower_y, tupper_y); const ssef tnear_z = mini(tlower_z, tupper_z); const ssef tfar_x = maxi(tlower_x, tupper_x); const ssef tfar_y = maxi(tlower_y, tupper_y); const ssef tfar_z = maxi(tlower_z, tupper_z); #else const ssef tnear_x = min(tlower_x, tupper_x); const ssef tnear_y = min(tlower_y, tupper_y); const ssef tnear_z = min(tlower_z, tupper_z); const ssef tfar_x = max(tlower_x, tupper_x); const ssef tfar_y = max(tlower_y, tupper_y); const ssef tfar_z = max(tlower_z, tupper_z); #endif const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); const sseb vmask = round_down*tnear <= round_up*tfar; *dist = tnear; return movemask(vmask); } /* Intersectors wrappers. * * They'll check node type and call appropriate intersection code. */ ccl_device_inline int qbvh_node_intersect( KernelGlobals *ccl_restrict kg, const ssef& isect_near, const ssef& isect_far, #ifdef __KERNEL_AVX2__ const sse3f& org_idir, #endif const sse3f& org, const sse3f& dir, const sse3f& idir, const int near_x, const int near_y, const int near_z, const int far_x, const int far_y, const int far_z, const int node_addr, ssef *ccl_restrict dist) { const int offset = node_addr; const float4 node = kernel_tex_fetch(__bvh_nodes, offset); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { return qbvh_unaligned_node_intersect(kg, isect_near, isect_far, #ifdef __KERNEL_AVX2__ org_idir, #endif org, dir, idir, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, dist); } else { return qbvh_aligned_node_intersect(kg, isect_near, isect_far, #ifdef __KERNEL_AVX2__ org_idir, #else org, #endif idir, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, dist); } } ccl_device_inline int qbvh_node_intersect_robust( KernelGlobals *ccl_restrict kg, const ssef& isect_near, const ssef& isect_far, #ifdef __KERNEL_AVX2__ const sse3f& P_idir, #endif const sse3f& P, const sse3f& dir, const sse3f& idir, const int near_x, const int near_y, const int near_z, const int far_x, const int far_y, const int far_z, const int node_addr, const float difl, ssef *ccl_restrict dist) { const int offset = node_addr; const float4 node = kernel_tex_fetch(__bvh_nodes, offset); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { return qbvh_unaligned_node_intersect_robust(kg, isect_near, isect_far, #ifdef __KERNEL_AVX2__ P_idir, #endif P, dir, idir, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, difl, dist); } else { return qbvh_aligned_node_intersect_robust(kg, isect_near, isect_far, #ifdef __KERNEL_AVX2__ P_idir, #else P, #endif idir, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, difl, dist); } } goxel-0.8.1/ext_src/cycles/src/kernel/bvh/qbvh_shadow_all.h000066400000000000000000000344641334742672700237550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This is a template BVH traversal function, where various features can be * enabled/disabled. This way we can compile optimized versions for each case * without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_HAIR: hair curve rendering * BVH_MOTION: motion blur rendering * */ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT qbvh_node_intersect #else # define NODE_INTERSECT qbvh_aligned_node_intersect #endif ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect_array, const uint visibility, const uint max_hits, uint *num_hits) { /* TODO(sergey): * - Test if pushing distance on the stack helps. * - Likely and unlikely for if() statements. * - Test restrict attribute for pointers. */ /* Traversal stack in CUDA thread-local memory. */ QBVHStackItem traversal_stack[BVH_QSTACK_SIZE]; traversal_stack[0].addr = ENTRYPOINT_SENTINEL; /* Traversal variables in registers. */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; /* Ray parameters in registers. */ const float tmax = ray->t; float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; float isect_t = tmax; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif *num_hits = 0; isect_array->t = tmax; #ifndef __KERNEL_SSE41__ if(!isfinite(P.x)) { return false; } #endif #if BVH_FEATURE(BVH_INSTANCING) int num_hits_in_instance = 0; #endif ssef tnear(0.0f), tfar(isect_t); #if BVH_FEATURE(BVH_HAIR) sse3f dir4(ssef(dir.x), ssef(dir.y), ssef(dir.z)); #endif sse3f idir4(ssef(idir.x), ssef(idir.y), ssef(idir.z)); #ifdef __KERNEL_AVX2__ float3 P_idir = P*idir; sse3f P_idir4(P_idir.x, P_idir.y, P_idir.z); #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) sse3f org4(ssef(P.x), ssef(P.y), ssef(P.z)); #endif /* Offsets to select the side that becomes the lower or upper bound. */ int near_x, near_y, near_z; int far_x, far_y, far_z; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); /* Traversal loop. */ do { do { /* Traverse internal nodes. */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); (void)inodes; if(false #ifdef __VISIBILITY_FLAG__ || ((__float_as_uint(inodes.x) & visibility) == 0) #endif #if BVH_FEATURE(BVH_MOTION) || UNLIKELY(ray->time < inodes.y) || UNLIKELY(ray->time > inodes.z) #endif ) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } ssef dist; int child_mask = NODE_INTERSECT(kg, tnear, tfar, #ifdef __KERNEL_AVX2__ P_idir4, #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4, #endif #if BVH_FEATURE(BVH_HAIR) dir4, #endif idir4, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, &dist); if(child_mask != 0) { float4 cnodes; #if BVH_FEATURE(BVH_HAIR) if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+13); } else #endif { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+7); } /* One child is hit, continue with that child. */ int r = __bscf(child_mask); if(child_mask == 0) { node_addr = __float_as_int(cnodes[r]); continue; } /* Two children are hit, push far child, and continue with * closer child. */ int c0 = __float_as_int(cnodes[r]); float d0 = ((float*)&dist)[r]; r = __bscf(child_mask); int c1 = __float_as_int(cnodes[r]); float d1 = ((float*)&dist)[r]; if(child_mask == 0) { if(d1 < d0) { node_addr = c1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; continue; } else { node_addr = c0; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; continue; } } /* Here starts the slow path for 3 or 4 hit children. We push * all nodes onto the stack to sort them there. */ ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; /* Three children are hit, push all onto stack and sort 3 * stack items, continue with closest child. */ r = __bscf(child_mask); int c2 = __float_as_int(cnodes[r]); float d2 = ((float*)&dist)[r]; if(child_mask == 0) { ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2]); node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } /* Four children are hit, push all onto stack and sort 4 * stack items, continue with closest child. */ r = __bscf(child_mask); int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c3; traversal_stack[stack_ptr].dist = d3; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2], &traversal_stack[stack_ptr - 3]); } node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } /* If node is leaf, fetch triangle list. */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); #ifdef __VISIBILITY_FLAG__ if((__float_as_uint(leaf.z) & visibility) == 0) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } #endif int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); const uint p_type = type & PRIMITIVE_ALL; /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; /* Primitive intersection. */ while(prim_addr < prim_addr2) { kernel_assert((kernel_tex_fetch(__prim_type, prim_addr) & PRIMITIVE_ALL) == p_type); bool hit; /* todo: specialized intersect functions which don't fill in * isect unless needed and check SD_HAS_TRANSPARENT_SHADOW? * might give a few % performance improvement */ switch(p_type) { case PRIMITIVE_TRIANGLE: { hit = triangle_intersect(kg, isect_array, P, dir, visibility, object, prim_addr); break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { hit = motion_triangle_intersect(kg, isect_array, P, dir, ray->time, visibility, object, prim_addr); break; } #endif #if BVH_FEATURE(BVH_HAIR) case PRIMITIVE_CURVE: case PRIMITIVE_MOTION_CURVE: { const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr); if(kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) { hit = cardinal_curve_intersect(kg, isect_array, P, dir, visibility, object, prim_addr, ray->time, curve_type, NULL, 0, 0); } else { hit = curve_intersect(kg, isect_array, P, dir, visibility, object, prim_addr, ray->time, curve_type, NULL, 0, 0); } break; } #endif default: { hit = false; break; } } /* Shadow ray early termination. */ if(hit) { /* detect if this surface has a shader with transparent shadows */ /* todo: optimize so primitive visibility flag indicates if * the primitive has a transparent shadow shader? */ int prim = kernel_tex_fetch(__prim_index, isect_array->prim); int shader = 0; #ifdef __HAIR__ if(kernel_tex_fetch(__prim_type, isect_array->prim) & PRIMITIVE_ALL_TRIANGLE) #endif { shader = kernel_tex_fetch(__tri_shader, prim); } #ifdef __HAIR__ else { float4 str = kernel_tex_fetch(__curves, prim); shader = __float_as_int(str.z); } #endif int flag = kernel_tex_fetch(__shader_flag, (shader & SHADER_MASK)*SHADER_SIZE); /* if no transparent shadows, all light is blocked */ if(!(flag & SD_HAS_TRANSPARENT_SHADOW)) { return true; } /* if maximum number of hits reached, block all light */ else if(*num_hits == max_hits) { return true; } /* move on to next entry in intersections array */ isect_array++; (*num_hits)++; #if BVH_FEATURE(BVH_INSTANCING) num_hits_in_instance++; #endif isect_array->t = isect_t; } prim_addr++; } } #if BVH_FEATURE(BVH_INSTANCING) else { /* Instance push. */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); # if BVH_FEATURE(BVH_MOTION) isect_t = bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, isect_t, &ob_itfm); # else isect_t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect_t); # endif num_hits_in_instance = 0; isect_array->t = isect_t; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect_t); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = ENTRYPOINT_SENTINEL; node_addr = kernel_tex_fetch(__object_node, object); } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* Instance pop. */ if(num_hits_in_instance) { float t_fac; # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac, &ob_itfm); # else bvh_instance_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac); # endif /* Scale isect->t to adjust for instancing. */ for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } } else { # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX, &ob_itfm); # else bvh_instance_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX); # endif } isect_t = tmax; isect_array->t = isect_t; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect_t); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); return false; } #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/bvh/qbvh_traversal.h000066400000000000000000000370461334742672700236420ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This is a template BVH traversal function, where various features can be * enabled/disabled. This way we can compile optimized versions for each case * without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_HAIR: hair curve rendering * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width * BVH_MOTION: motion blur rendering * */ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT qbvh_node_intersect # define NODE_INTERSECT_ROBUST qbvh_node_intersect_robust #else # define NODE_INTERSECT qbvh_aligned_node_intersect # define NODE_INTERSECT_ROBUST qbvh_aligned_node_intersect_robust #endif ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint visibility #if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) ,uint *lcg_state, float difl, float extmax #endif ) { /* TODO(sergey): * - Test if pushing distance on the stack helps (for non shadow rays). * - Separate version for shadow rays. * - Likely and unlikely for if() statements. * - Test restrict attribute for pointers. */ /* Traversal stack in CUDA thread-local memory. */ QBVHStackItem traversal_stack[BVH_QSTACK_SIZE]; traversal_stack[0].addr = ENTRYPOINT_SENTINEL; traversal_stack[0].dist = -FLT_MAX; /* Traversal variables in registers. */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; float node_dist = -FLT_MAX; /* Ray parameters in registers. */ float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif #ifndef __KERNEL_SSE41__ if(!isfinite(P.x)) { return false; } #endif isect->t = ray->t; isect->u = 0.0f; isect->v = 0.0f; isect->prim = PRIM_NONE; isect->object = OBJECT_NONE; BVH_DEBUG_INIT(); ssef tnear(0.0f), tfar(ray->t); #if BVH_FEATURE(BVH_HAIR) sse3f dir4(ssef(dir.x), ssef(dir.y), ssef(dir.z)); #endif sse3f idir4(ssef(idir.x), ssef(idir.y), ssef(idir.z)); #ifdef __KERNEL_AVX2__ float3 P_idir = P*idir; sse3f P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) sse3f org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); #endif /* Offsets to select the side that becomes the lower or upper bound. */ int near_x, near_y, near_z; int far_x, far_y, far_z; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); /* Traversal loop. */ do { do { /* Traverse internal nodes. */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); (void)inodes; if(UNLIKELY(node_dist > isect->t) #if BVH_FEATURE(BVH_MOTION) || UNLIKELY(ray->time < inodes.y) || UNLIKELY(ray->time > inodes.z) #endif #ifdef __VISIBILITY_FLAG__ || (__float_as_uint(inodes.x) & visibility) == 0 #endif ) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; node_dist = traversal_stack[stack_ptr].dist; --stack_ptr; continue; } int child_mask; ssef dist; BVH_DEBUG_NEXT_NODE(); #if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) if(difl != 0.0f) { /* NOTE: We extend all the child BB instead of fetching * and checking visibility flags for each of the, * * Need to test if doing opposite would be any faster. */ child_mask = NODE_INTERSECT_ROBUST(kg, tnear, tfar, # ifdef __KERNEL_AVX2__ P_idir4, # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4, # endif # if BVH_FEATURE(BVH_HAIR) dir4, # endif idir4, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, difl, &dist); } else #endif /* BVH_HAIR_MINIMUM_WIDTH */ { child_mask = NODE_INTERSECT(kg, tnear, tfar, #ifdef __KERNEL_AVX2__ P_idir4, #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4, #endif #if BVH_FEATURE(BVH_HAIR) dir4, #endif idir4, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, &dist); } if(child_mask != 0) { float4 cnodes; /* TODO(sergey): Investigate whether moving cnodes upwards * gives a speedup (will be different cache pattern but will * avoid extra check here), */ #if BVH_FEATURE(BVH_HAIR) if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+13); } else #endif { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+7); } /* One child is hit, continue with that child. */ int r = __bscf(child_mask); float d0 = ((float*)&dist)[r]; if(child_mask == 0) { node_addr = __float_as_int(cnodes[r]); node_dist = d0; continue; } /* Two children are hit, push far child, and continue with * closer child. */ int c0 = __float_as_int(cnodes[r]); r = __bscf(child_mask); int c1 = __float_as_int(cnodes[r]); float d1 = ((float*)&dist)[r]; if(child_mask == 0) { if(d1 < d0) { node_addr = c1; node_dist = d1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; continue; } else { node_addr = c0; node_dist = d0; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; continue; } } /* Here starts the slow path for 3 or 4 hit children. We push * all nodes onto the stack to sort them there. */ ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; /* Three children are hit, push all onto stack and sort 3 * stack items, continue with closest child. */ r = __bscf(child_mask); int c2 = __float_as_int(cnodes[r]); float d2 = ((float*)&dist)[r]; if(child_mask == 0) { ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2]); node_addr = traversal_stack[stack_ptr].addr; node_dist = traversal_stack[stack_ptr].dist; --stack_ptr; continue; } /* Four children are hit, push all onto stack and sort 4 * stack items, continue with closest child. */ r = __bscf(child_mask); int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c3; traversal_stack[stack_ptr].dist = d3; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2], &traversal_stack[stack_ptr - 3]); } node_addr = traversal_stack[stack_ptr].addr; node_dist = traversal_stack[stack_ptr].dist; --stack_ptr; } /* If node is leaf, fetch triangle list. */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); #ifdef __VISIBILITY_FLAG__ if(UNLIKELY((node_dist > isect->t) || ((__float_as_uint(leaf.z) & visibility) == 0))) #else if(UNLIKELY((node_dist > isect->t))) #endif { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; node_dist = traversal_stack[stack_ptr].dist; --stack_ptr; continue; } int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; node_dist = traversal_stack[stack_ptr].dist; --stack_ptr; /* Primitive intersection. */ switch(type & PRIMITIVE_ALL) { case PRIMITIVE_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr)) { tfar = ssef(isect->t); /* Shadow ray early termination. */ if(visibility & PATH_RAY_SHADOW_OPAQUE) { return true; } } } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, prim_addr)) { tfar = ssef(isect->t); /* Shadow ray early termination. */ if(visibility & PATH_RAY_SHADOW_OPAQUE) { return true; } } } break; } #endif /* BVH_FEATURE(BVH_MOTION) */ #if BVH_FEATURE(BVH_HAIR) case PRIMITIVE_CURVE: case PRIMITIVE_MOTION_CURVE: { for(; prim_addr < prim_addr2; prim_addr++) { BVH_DEBUG_NEXT_INTERSECTION(); const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr); kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL)); bool hit; if(kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) { hit = cardinal_curve_intersect(kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type, lcg_state, difl, extmax); } else { hit = curve_intersect(kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type, lcg_state, difl, extmax); } if(hit) { tfar = ssef(isect->t); /* Shadow ray early termination. */ if(visibility & PATH_RAY_SHADOW_OPAQUE) { return true; } } } break; } #endif /* BVH_FEATURE(BVH_HAIR) */ } } #if BVH_FEATURE(BVH_INSTANCING) else { /* Instance push. */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); # if BVH_FEATURE(BVH_MOTION) qbvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect->t, &node_dist, &ob_itfm); # else qbvh_instance_push(kg, object, ray, &P, &dir, &idir, &isect->t, &node_dist); # endif qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect->t); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = ENTRYPOINT_SENTINEL; traversal_stack[stack_ptr].dist = -FLT_MAX; node_addr = kernel_tex_fetch(__object_node, object); BVH_DEBUG_NEXT_INSTANCE(); } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* Instance pop. */ # if BVH_FEATURE(BVH_MOTION) isect->t = bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, isect->t, &ob_itfm); # else isect->t = bvh_instance_pop(kg, object, ray, &P, &dir, &idir, isect->t); # endif qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect->t); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; node_dist = traversal_stack[stack_ptr].dist; --stack_ptr; } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); return (isect->prim != PRIM_NONE); } #undef NODE_INTERSECT #undef NODE_INTERSECT_ROBUST goxel-0.8.1/ext_src/cycles/src/kernel/bvh/qbvh_volume.h000066400000000000000000000264471334742672700231510ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This is a template BVH traversal function for volumes, where * various features can be enabled/disabled. This way we can compile optimized * versions for each case without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_MOTION: motion blur rendering * */ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT qbvh_node_intersect #else # define NODE_INTERSECT qbvh_aligned_node_intersect #endif ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect, const uint visibility) { /* TODO(sergey): * - Test if pushing distance on the stack helps. * - Likely and unlikely for if() statements. * - Test restrict attribute for pointers. */ /* Traversal stack in CUDA thread-local memory. */ QBVHStackItem traversal_stack[BVH_QSTACK_SIZE]; traversal_stack[0].addr = ENTRYPOINT_SENTINEL; /* Traversal variables in registers. */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; /* Ray parameters in registers. */ float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif #ifndef __KERNEL_SSE41__ if(!isfinite(P.x)) { return false; } #endif isect->t = ray->t; isect->u = 0.0f; isect->v = 0.0f; isect->prim = PRIM_NONE; isect->object = OBJECT_NONE; ssef tnear(0.0f), tfar(ray->t); #if BVH_FEATURE(BVH_HAIR) sse3f dir4(ssef(dir.x), ssef(dir.y), ssef(dir.z)); #endif sse3f idir4(ssef(idir.x), ssef(idir.y), ssef(idir.z)); #ifdef __KERNEL_AVX2__ float3 P_idir = P*idir; sse3f P_idir4(P_idir.x, P_idir.y, P_idir.z); #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) sse3f org4(ssef(P.x), ssef(P.y), ssef(P.z)); #endif /* Offsets to select the side that becomes the lower or upper bound. */ int near_x, near_y, near_z; int far_x, far_y, far_z; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); /* Traversal loop. */ do { do { /* Traverse internal nodes. */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); #ifdef __VISIBILITY_FLAG__ if((__float_as_uint(inodes.x) & visibility) == 0) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } #endif ssef dist; int child_mask = NODE_INTERSECT(kg, tnear, tfar, #ifdef __KERNEL_AVX2__ P_idir4, #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4, #endif #if BVH_FEATURE(BVH_HAIR) dir4, #endif idir4, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, &dist); if(child_mask != 0) { float4 cnodes; #if BVH_FEATURE(BVH_HAIR) if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+13); } else #endif { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+7); } /* One child is hit, continue with that child. */ int r = __bscf(child_mask); if(child_mask == 0) { node_addr = __float_as_int(cnodes[r]); continue; } /* Two children are hit, push far child, and continue with * closer child. */ int c0 = __float_as_int(cnodes[r]); float d0 = ((float*)&dist)[r]; r = __bscf(child_mask); int c1 = __float_as_int(cnodes[r]); float d1 = ((float*)&dist)[r]; if(child_mask == 0) { if(d1 < d0) { node_addr = c1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; continue; } else { node_addr = c0; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; continue; } } /* Here starts the slow path for 3 or 4 hit children. We push * all nodes onto the stack to sort them there. */ ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; /* Three children are hit, push all onto stack and sort 3 * stack items, continue with closest child. */ r = __bscf(child_mask); int c2 = __float_as_int(cnodes[r]); float d2 = ((float*)&dist)[r]; if(child_mask == 0) { ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2]); node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } /* Four children are hit, push all onto stack and sort 4 * stack items, continue with closest child. */ r = __bscf(child_mask); int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c3; traversal_stack[stack_ptr].dist = d3; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2], &traversal_stack[stack_ptr - 3]); } node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } /* If node is leaf, fetch triangle list. */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); if((__float_as_uint(leaf.z) & visibility) == 0) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); const uint p_type = type & PRIMITIVE_ALL; /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; /* Primitive intersection. */ switch(p_type) { case PRIMITIVE_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* Only primitives from volume object. */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } /* Intersect ray against primitive. */ triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr); } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* Only primitives from volume object. */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } /* Intersect ray against primitive. */ motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, prim_addr); } break; } #endif } } #if BVH_FEATURE(BVH_INSTANCING) else { /* Instance push. */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_HAS_VOLUME) { # if BVH_FEATURE(BVH_MOTION) isect->t = bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, isect->t, &ob_itfm); # else isect->t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect->t); # endif qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect->t); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = ENTRYPOINT_SENTINEL; node_addr = kernel_tex_fetch(__object_node, object); } else { /* Pop. */ object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* Instance pop. */ # if BVH_FEATURE(BVH_MOTION) isect->t = bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, isect->t, &ob_itfm); # else isect->t = bvh_instance_pop(kg, object, ray, &P, &dir, &idir, isect->t); # endif qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect->t); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); return (isect->prim != PRIM_NONE); } #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/bvh/qbvh_volume_all.h000066400000000000000000000327211334742672700237710ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This is a template BVH traversal function for volumes, where * various features can be enabled/disabled. This way we can compile optimized * versions for each case without new features slowing things down. * * BVH_INSTANCING: object instancing * BVH_MOTION: motion blur rendering * */ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT qbvh_node_intersect #else # define NODE_INTERSECT qbvh_aligned_node_intersect #endif ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect_array, const uint max_hits, const uint visibility) { /* TODO(sergey): * - Test if pushing distance on the stack helps. * - Likely and unlikely for if() statements. * - Test restrict attribute for pointers. */ /* Traversal stack in CUDA thread-local memory. */ QBVHStackItem traversal_stack[BVH_QSTACK_SIZE]; traversal_stack[0].addr = ENTRYPOINT_SENTINEL; /* Traversal variables in registers. */ int stack_ptr = 0; int node_addr = kernel_data.bvh.root; /* Ray parameters in registers. */ const float tmax = ray->t; float3 P = ray->P; float3 dir = bvh_clamp_direction(ray->D); float3 idir = bvh_inverse_direction(dir); int object = OBJECT_NONE; float isect_t = tmax; #if BVH_FEATURE(BVH_MOTION) Transform ob_itfm; #endif uint num_hits = 0; isect_array->t = tmax; #ifndef __KERNEL_SSE41__ if(!isfinite(P.x)) { return 0; } #endif #if BVH_FEATURE(BVH_INSTANCING) int num_hits_in_instance = 0; #endif ssef tnear(0.0f), tfar(isect_t); #if BVH_FEATURE(BVH_HAIR) sse3f dir4(ssef(dir.x), ssef(dir.y), ssef(dir.z)); #endif sse3f idir4(ssef(idir.x), ssef(idir.y), ssef(idir.z)); #ifdef __KERNEL_AVX2__ float3 P_idir = P*idir; sse3f P_idir4(P_idir.x, P_idir.y, P_idir.z); #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) sse3f org4(ssef(P.x), ssef(P.y), ssef(P.z)); #endif /* Offsets to select the side that becomes the lower or upper bound. */ int near_x, near_y, near_z; int far_x, far_y, far_z; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); /* Traversal loop. */ do { do { /* Traverse internal nodes. */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); #ifdef __VISIBILITY_FLAG__ if((__float_as_uint(inodes.x) & visibility) == 0) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } #endif ssef dist; int child_mask = NODE_INTERSECT(kg, tnear, tfar, #ifdef __KERNEL_AVX2__ P_idir4, #endif #if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4, #endif #if BVH_FEATURE(BVH_HAIR) dir4, #endif idir4, near_x, near_y, near_z, far_x, far_y, far_z, node_addr, &dist); if(child_mask != 0) { float4 cnodes; #if BVH_FEATURE(BVH_HAIR) if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+13); } else #endif { cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+7); } /* One child is hit, continue with that child. */ int r = __bscf(child_mask); if(child_mask == 0) { node_addr = __float_as_int(cnodes[r]); continue; } /* Two children are hit, push far child, and continue with * closer child. */ int c0 = __float_as_int(cnodes[r]); float d0 = ((float*)&dist)[r]; r = __bscf(child_mask); int c1 = __float_as_int(cnodes[r]); float d1 = ((float*)&dist)[r]; if(child_mask == 0) { if(d1 < d0) { node_addr = c1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; continue; } else { node_addr = c0; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; continue; } } /* Here starts the slow path for 3 or 4 hit children. We push * all nodes onto the stack to sort them there. */ ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c1; traversal_stack[stack_ptr].dist = d1; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c0; traversal_stack[stack_ptr].dist = d0; /* Three children are hit, push all onto stack and sort 3 * stack items, continue with closest child. */ r = __bscf(child_mask); int c2 = __float_as_int(cnodes[r]); float d2 = ((float*)&dist)[r]; if(child_mask == 0) { ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2]); node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } /* Four children are hit, push all onto stack and sort 4 * stack items, continue with closest child. */ r = __bscf(child_mask); int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c3; traversal_stack[stack_ptr].dist = d3; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = c2; traversal_stack[stack_ptr].dist = d2; qbvh_stack_sort(&traversal_stack[stack_ptr], &traversal_stack[stack_ptr - 1], &traversal_stack[stack_ptr - 2], &traversal_stack[stack_ptr - 3]); } node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } /* If node is leaf, fetch triangle list. */ if(node_addr < 0) { float4 leaf = kernel_tex_fetch(__bvh_leaf_nodes, (-node_addr-1)); if((__float_as_uint(leaf.z) & visibility) == 0) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; continue; } int prim_addr = __float_as_int(leaf.x); #if BVH_FEATURE(BVH_INSTANCING) if(prim_addr >= 0) { #endif int prim_addr2 = __float_as_int(leaf.y); const uint type = __float_as_int(leaf.w); const uint p_type = type & PRIMITIVE_ALL; bool hit; /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; /* Primitive intersection. */ switch(p_type) { case PRIMITIVE_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* Only primitives from volume object. */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } /* Intersect ray against primitive. */ hit = triangle_intersect(kg, isect_array, P, dir, visibility, object, prim_addr); if(hit) { /* Move on to next entry in intersections array. */ isect_array++; num_hits++; #if BVH_FEATURE(BVH_INSTANCING) num_hits_in_instance++; #endif isect_array->t = isect_t; if(num_hits == max_hits) { #if BVH_FEATURE(BVH_INSTANCING) # if BVH_FEATURE(BVH_MOTION) float t_fac = 1.0f / len(transform_direction(&ob_itfm, dir)); # else Transform itfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); float t_fac = 1.0f / len(transform_direction(&itfm, dir)); # endif for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } #endif /* BVH_FEATURE(BVH_INSTANCING) */ return num_hits; } } } break; } #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); /* Only primitives from volume object. */ uint tri_object = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, prim_addr): object; int object_flag = kernel_tex_fetch(__object_flag, tri_object); if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) { continue; } /* Intersect ray against primitive. */ hit = motion_triangle_intersect(kg, isect_array, P, dir, ray->time, visibility, object, prim_addr); if(hit) { /* Move on to next entry in intersections array. */ isect_array++; num_hits++; # if BVH_FEATURE(BVH_INSTANCING) num_hits_in_instance++; # endif isect_array->t = isect_t; if(num_hits == max_hits) { # if BVH_FEATURE(BVH_INSTANCING) # if BVH_FEATURE(BVH_MOTION) float t_fac = 1.0f / len(transform_direction(&ob_itfm, dir)); # else Transform itfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); float t_fac = 1.0f / len(transform_direction(&itfm, dir)); # endif for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } # endif /* BVH_FEATURE(BVH_INSTANCING) */ return num_hits; } } } break; } #endif } } #if BVH_FEATURE(BVH_INSTANCING) else { /* Instance push. */ object = kernel_tex_fetch(__prim_object, -prim_addr-1); int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_HAS_VOLUME) { # if BVH_FEATURE(BVH_MOTION) isect_t = bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, isect_t, &ob_itfm); # else isect_t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect_t); # endif qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect_t); idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif num_hits_in_instance = 0; isect_array->t = isect_t; ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = ENTRYPOINT_SENTINEL; node_addr = kernel_tex_fetch(__object_node, object); } else { /* Pop. */ object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } } } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); #if BVH_FEATURE(BVH_INSTANCING) if(stack_ptr >= 0) { kernel_assert(object != OBJECT_NONE); /* Instance pop. */ if(num_hits_in_instance) { float t_fac; # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac, &ob_itfm); # else bvh_instance_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac); # endif /* Scale isect->t to adjust for instancing. */ for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; } } else { # if BVH_FEATURE(BVH_MOTION) bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX, &ob_itfm); # else bvh_instance_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX); # endif } isect_t = tmax; isect_array->t = isect_t; qbvh_near_far_idx_calc(idir, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); tfar = ssef(isect_t); # if BVH_FEATURE(BVH_HAIR) dir4 = sse3f(ssef(dir.x), ssef(dir.y), ssef(dir.z)); # endif idir4 = sse3f(ssef(idir.x), ssef(idir.y), ssef(idir.z)); # ifdef __KERNEL_AVX2__ P_idir = P*idir; P_idir4 = sse3f(P_idir.x, P_idir.y, P_idir.z); # endif # if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; } #endif /* FEATURE(BVH_INSTANCING) */ } while(node_addr != ENTRYPOINT_SENTINEL); return num_hits; } #undef NODE_INTERSECT goxel-0.8.1/ext_src/cycles/src/kernel/closure/000077500000000000000000000000001334742672700213315ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/closure/alloc.h000066400000000000000000000047201334742672700225770ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device ShaderClosure *closure_alloc(ShaderData *sd, int size, ClosureType type, float3 weight) { kernel_assert(size <= sizeof(ShaderClosure)); if(sd->num_closure_left == 0) return NULL; ShaderClosure *sc = &sd->closure[sd->num_closure]; sc->type = type; sc->weight = weight; sd->num_closure++; sd->num_closure_left--; return sc; } ccl_device ccl_addr_space void *closure_alloc_extra(ShaderData *sd, int size) { /* Allocate extra space for closure that need more parameters. We allocate * in chunks of sizeof(ShaderClosure) starting from the end of the closure * array. * * This lets us keep the same fast array iteration over closures, as we * found linked list iteration and iteration with skipping to be slower. */ int num_extra = ((size + sizeof(ShaderClosure) - 1) / sizeof(ShaderClosure)); if(num_extra > sd->num_closure_left) { /* Remove previous closure if it was allocated. */ sd->num_closure--; sd->num_closure_left++; return NULL; } sd->num_closure_left -= num_extra; return (ccl_addr_space void*)(sd->closure + sd->num_closure + sd->num_closure_left); } ccl_device_inline ShaderClosure *bsdf_alloc(ShaderData *sd, int size, float3 weight) { ShaderClosure *sc = closure_alloc(sd, size, CLOSURE_NONE_ID, weight); if(sc == NULL) return NULL; float sample_weight = fabsf(average(weight)); sc->sample_weight = sample_weight; return (sample_weight >= CLOSURE_WEIGHT_CUTOFF) ? sc : NULL; } #ifdef __OSL__ ccl_device_inline ShaderClosure *bsdf_alloc_osl(ShaderData *sd, int size, float3 weight, void *data) { ShaderClosure *sc = closure_alloc(sd, size, CLOSURE_NONE_ID, weight); if(!sc) return NULL; memcpy(sc, data, size); float sample_weight = fabsf(average(weight)); sc->weight = weight; sc->sample_weight = sample_weight; return (sample_weight >= CLOSURE_WEIGHT_CUTOFF) ? sc : NULL; } #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf.h000066400000000000000000000423731334742672700224310ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "kernel/closure/bsdf_ashikhmin_velvet.h" #include "kernel/closure/bsdf_diffuse.h" #include "kernel/closure/bsdf_oren_nayar.h" #include "kernel/closure/bsdf_phong_ramp.h" #include "kernel/closure/bsdf_diffuse_ramp.h" #include "kernel/closure/bsdf_microfacet.h" #include "kernel/closure/bsdf_microfacet_multi.h" #include "kernel/closure/bsdf_reflection.h" #include "kernel/closure/bsdf_refraction.h" #include "kernel/closure/bsdf_transparent.h" #include "kernel/closure/bsdf_ashikhmin_shirley.h" #include "kernel/closure/bsdf_toon.h" #include "kernel/closure/bsdf_hair.h" #include "kernel/closure/bsdf_principled_diffuse.h" #include "kernel/closure/bsdf_principled_sheen.h" #include "kernel/closure/bssrdf.h" #include "kernel/closure/volume.h" CCL_NAMESPACE_BEGIN /* Returns the square of the roughness of the closure if it has roughness, * 0 for singular closures and 1 otherwise. */ ccl_device_inline float bsdf_get_roughness_squared(const ShaderClosure *sc) { if(CLOSURE_IS_BSDF_SINGULAR(sc->type)) { return 0.0f; } if(CLOSURE_IS_BSDF_MICROFACET(sc->type)) { MicrofacetBsdf *bsdf = (MicrofacetBsdf*) sc; return bsdf->alpha_x*bsdf->alpha_y; } return 1.0f; } ccl_device_forceinline int bsdf_sample(KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, float randu, float randv, float3 *eval, float3 *omega_in, differential3 *domega_in, float *pdf) { int label; switch(sc->type) { case CLOSURE_BSDF_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_ID: label = bsdf_diffuse_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; #ifdef __SVM__ case CLOSURE_BSDF_OREN_NAYAR_ID: label = bsdf_oren_nayar_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; #ifdef __OSL__ case CLOSURE_BSDF_PHONG_RAMP_ID: label = bsdf_phong_ramp_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_DIFFUSE_RAMP_ID: label = bsdf_diffuse_ramp_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; #endif case CLOSURE_BSDF_TRANSLUCENT_ID: label = bsdf_translucent_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_REFLECTION_ID: label = bsdf_reflection_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_REFRACTION_ID: label = bsdf_refraction_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_TRANSPARENT_ID: label = bsdf_transparent_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_MICROFACET_GGX_ID: case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID: label = bsdf_microfacet_ggx_sample(kg, sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID: label = bsdf_microfacet_multi_ggx_sample(kg, sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf, &sd->lcg_state); break; case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID: label = bsdf_microfacet_multi_ggx_glass_sample(kg, sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf, &sd->lcg_state); break; case CLOSURE_BSDF_MICROFACET_BECKMANN_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID: label = bsdf_microfacet_beckmann_sample(kg, sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID: label = bsdf_ashikhmin_shirley_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: label = bsdf_ashikhmin_velvet_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_DIFFUSE_TOON_ID: label = bsdf_diffuse_toon_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_GLOSSY_TOON_ID: label = bsdf_glossy_toon_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_HAIR_REFLECTION_ID: label = bsdf_hair_reflection_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: label = bsdf_hair_transmission_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; #ifdef __PRINCIPLED__ case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID: label = bsdf_principled_diffuse_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID: label = bsdf_principled_sheen_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; #endif /* __PRINCIPLED__ */ #endif #ifdef __VOLUME__ case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID: label = volume_henyey_greenstein_sample(sc, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; #endif default: label = LABEL_NONE; break; } /* Test if BSDF sample should be treated as transparent for background. */ if(label & LABEL_TRANSMIT) { float threshold_squared = kernel_data.background.transparent_roughness_squared_threshold; if(threshold_squared >= 0.0f) { if(bsdf_get_roughness_squared(sc) <= threshold_squared) { label |= LABEL_TRANSMIT_TRANSPARENT; } } } return label; } #ifndef __KERNEL_CUDA__ ccl_device #else ccl_device_forceinline #endif float3 bsdf_eval(KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, const float3 omega_in, float *pdf) { float3 eval; if(dot(sd->Ng, omega_in) >= 0.0f) { switch(sc->type) { case CLOSURE_BSDF_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_ID: eval = bsdf_diffuse_eval_reflect(sc, sd->I, omega_in, pdf); break; #ifdef __SVM__ case CLOSURE_BSDF_OREN_NAYAR_ID: eval = bsdf_oren_nayar_eval_reflect(sc, sd->I, omega_in, pdf); break; #ifdef __OSL__ case CLOSURE_BSDF_PHONG_RAMP_ID: eval = bsdf_phong_ramp_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_DIFFUSE_RAMP_ID: eval = bsdf_diffuse_ramp_eval_reflect(sc, sd->I, omega_in, pdf); break; #endif case CLOSURE_BSDF_TRANSLUCENT_ID: eval = bsdf_translucent_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_REFLECTION_ID: eval = bsdf_reflection_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_REFRACTION_ID: eval = bsdf_refraction_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_TRANSPARENT_ID: eval = bsdf_transparent_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_MICROFACET_GGX_ID: case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID: eval = bsdf_microfacet_ggx_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID: eval = bsdf_microfacet_multi_ggx_eval_reflect(sc, sd->I, omega_in, pdf, &sd->lcg_state); break; case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID: eval = bsdf_microfacet_multi_ggx_glass_eval_reflect(sc, sd->I, omega_in, pdf, &sd->lcg_state); break; case CLOSURE_BSDF_MICROFACET_BECKMANN_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID: eval = bsdf_microfacet_beckmann_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID: eval = bsdf_ashikhmin_shirley_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: eval = bsdf_ashikhmin_velvet_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_DIFFUSE_TOON_ID: eval = bsdf_diffuse_toon_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_GLOSSY_TOON_ID: eval = bsdf_glossy_toon_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_HAIR_REFLECTION_ID: eval = bsdf_hair_reflection_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: eval = bsdf_hair_transmission_eval_reflect(sc, sd->I, omega_in, pdf); break; #ifdef __PRINCIPLED__ case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID: eval = bsdf_principled_diffuse_eval_reflect(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID: eval = bsdf_principled_sheen_eval_reflect(sc, sd->I, omega_in, pdf); break; #endif /* __PRINCIPLED__ */ #endif #ifdef __VOLUME__ case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID: eval = volume_henyey_greenstein_eval_phase(sc, sd->I, omega_in, pdf); break; #endif default: eval = make_float3(0.0f, 0.0f, 0.0f); break; } } else { switch(sc->type) { case CLOSURE_BSDF_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_ID: eval = bsdf_diffuse_eval_transmit(sc, sd->I, omega_in, pdf); break; #ifdef __SVM__ case CLOSURE_BSDF_OREN_NAYAR_ID: eval = bsdf_oren_nayar_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_TRANSLUCENT_ID: eval = bsdf_translucent_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_REFLECTION_ID: eval = bsdf_reflection_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_REFRACTION_ID: eval = bsdf_refraction_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_TRANSPARENT_ID: eval = bsdf_transparent_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_MICROFACET_GGX_ID: case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID: eval = bsdf_microfacet_ggx_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID: eval = bsdf_microfacet_multi_ggx_eval_transmit(sc, sd->I, omega_in, pdf, &sd->lcg_state); break; case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID: eval = bsdf_microfacet_multi_ggx_glass_eval_transmit(sc, sd->I, omega_in, pdf, &sd->lcg_state); break; case CLOSURE_BSDF_MICROFACET_BECKMANN_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID: eval = bsdf_microfacet_beckmann_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID: eval = bsdf_ashikhmin_shirley_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: eval = bsdf_ashikhmin_velvet_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_DIFFUSE_TOON_ID: eval = bsdf_diffuse_toon_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_GLOSSY_TOON_ID: eval = bsdf_glossy_toon_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_HAIR_REFLECTION_ID: eval = bsdf_hair_reflection_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: eval = bsdf_hair_transmission_eval_transmit(sc, sd->I, omega_in, pdf); break; #ifdef __PRINCIPLED__ case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID: eval = bsdf_principled_diffuse_eval_transmit(sc, sd->I, omega_in, pdf); break; case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID: eval = bsdf_principled_sheen_eval_transmit(sc, sd->I, omega_in, pdf); break; #endif /* __PRINCIPLED__ */ #endif #ifdef __VOLUME__ case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID: eval = volume_henyey_greenstein_eval_phase(sc, sd->I, omega_in, pdf); break; #endif default: eval = make_float3(0.0f, 0.0f, 0.0f); break; } } return eval; } ccl_device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness) { /* ToDo: do we want to blur volume closures? */ #ifdef __SVM__ switch(sc->type) { case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID: bsdf_microfacet_multi_ggx_blur(sc, roughness); break; case CLOSURE_BSDF_MICROFACET_GGX_ID: case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID: bsdf_microfacet_ggx_blur(sc, roughness); break; case CLOSURE_BSDF_MICROFACET_BECKMANN_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID: bsdf_microfacet_beckmann_blur(sc, roughness); break; case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID: bsdf_ashikhmin_shirley_blur(sc, roughness); break; default: break; } #endif } ccl_device bool bsdf_merge(ShaderClosure *a, ShaderClosure *b) { #ifdef __SVM__ switch(a->type) { case CLOSURE_BSDF_TRANSPARENT_ID: return true; case CLOSURE_BSDF_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_ID: case CLOSURE_BSDF_TRANSLUCENT_ID: return bsdf_diffuse_merge(a, b); case CLOSURE_BSDF_OREN_NAYAR_ID: return bsdf_oren_nayar_merge(a, b); case CLOSURE_BSDF_REFLECTION_ID: case CLOSURE_BSDF_REFRACTION_ID: case CLOSURE_BSDF_MICROFACET_GGX_ID: case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID: return bsdf_microfacet_merge(a, b); case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: return bsdf_ashikhmin_velvet_merge(a, b); case CLOSURE_BSDF_DIFFUSE_TOON_ID: case CLOSURE_BSDF_GLOSSY_TOON_ID: return bsdf_toon_merge(a, b); case CLOSURE_BSDF_HAIR_REFLECTION_ID: case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: return bsdf_hair_merge(a, b); #ifdef __PRINCIPLED__ case CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID: case CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID: return bsdf_principled_diffuse_merge(a, b); #endif #ifdef __VOLUME__ case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID: return volume_henyey_greenstein_merge(a, b); #endif default: return false; } #else return false; #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_ashikhmin_shirley.h000066400000000000000000000164401334742672700262170ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BSDF_ASHIKHMIN_SHIRLEY_H__ #define __BSDF_ASHIKHMIN_SHIRLEY_H__ /* ASHIKHMIN SHIRLEY BSDF Implementation of Michael Ashikhmin and Peter Shirley: "An Anisotropic Phong BRDF Model" (2000) The Fresnel factor is missing to get a separable bsdf (intensity*color), as is the case with all other microfacet-based BSDF implementations in Cycles. Other than that, the implementation directly follows the paper. */ CCL_NAMESPACE_BEGIN ccl_device int bsdf_ashikhmin_shirley_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f); bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_ashikhmin_shirley_aniso_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f); bsdf->alpha_y = clamp(bsdf->alpha_y, 1e-4f, 1.0f); bsdf->type = CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device void bsdf_ashikhmin_shirley_blur(ShaderClosure *sc, float roughness) { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)sc; bsdf->alpha_x = fmaxf(roughness, bsdf->alpha_x); bsdf->alpha_y = fmaxf(roughness, bsdf->alpha_y); } ccl_device_inline float bsdf_ashikhmin_shirley_roughness_to_exponent(float roughness) { return 2.0f / (roughness*roughness) - 2.0f; } ccl_device_forceinline float3 bsdf_ashikhmin_shirley_eval_reflect( const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float3 N = bsdf->N; float NdotI = dot(N, I); /* in Cycles/OSL convention I is omega_out */ float NdotO = dot(N, omega_in); /* and consequently we use for O omaga_in ;) */ float out = 0.0f; if(fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f) return make_float3(0.0f, 0.0f, 0.0f); if(NdotI > 0.0f && NdotO > 0.0f) { NdotI = fmaxf(NdotI, 1e-6f); NdotO = fmaxf(NdotO, 1e-6f); float3 H = normalize(omega_in + I); float HdotI = fmaxf(fabsf(dot(H, I)), 1e-6f); float HdotN = fmaxf(dot(H, N), 1e-6f); float pump = 1.0f / fmaxf(1e-6f, (HdotI*fmaxf(NdotO, NdotI))); /* pump from original paper (first derivative disc., but cancels the HdotI in the pdf nicely) */ /*float pump = 1.0f / fmaxf(1e-4f, ((NdotO + NdotI) * (NdotO*NdotI))); */ /* pump from d-brdf paper */ float n_x = bsdf_ashikhmin_shirley_roughness_to_exponent(bsdf->alpha_x); float n_y = bsdf_ashikhmin_shirley_roughness_to_exponent(bsdf->alpha_y); if(n_x == n_y) { /* isotropic */ float e = n_x; float lobe = powf(HdotN, e); float norm = (n_x + 1.0f) / (8.0f * M_PI_F); out = NdotO * norm * lobe * pump; *pdf = norm * lobe / HdotI; /* this is p_h / 4(H.I) (conversion from 'wh measure' to 'wi measure', eq. 8 in paper) */ } else { /* anisotropic */ float3 X, Y; make_orthonormals_tangent(N, bsdf->T, &X, &Y); float HdotX = dot(H, X); float HdotY = dot(H, Y); float lobe; if(HdotN < 1.0f) { float e = (n_x * HdotX*HdotX + n_y * HdotY*HdotY) / (1.0f - HdotN*HdotN); lobe = powf(HdotN, e); } else { lobe = 1.0f; } float norm = sqrtf((n_x + 1.0f)*(n_y + 1.0f)) / (8.0f * M_PI_F); out = NdotO * norm * lobe * pump; *pdf = norm * lobe / HdotI; } } return make_float3(out, out, out); } ccl_device float3 bsdf_ashikhmin_shirley_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device_inline void bsdf_ashikhmin_shirley_sample_first_quadrant(float n_x, float n_y, float randu, float randv, float *phi, float *cos_theta) { *phi = atanf(sqrtf((n_x + 1.0f) / (n_y + 1.0f)) * tanf(M_PI_2_F * randu)); float cos_phi = cosf(*phi); float sin_phi = sinf(*phi); *cos_theta = powf(randv, 1.0f / (n_x * cos_phi*cos_phi + n_y * sin_phi*sin_phi + 1.0f)); } ccl_device int bsdf_ashikhmin_shirley_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float3 N = bsdf->N; int label = LABEL_REFLECT | LABEL_GLOSSY; float NdotI = dot(N, I); if(NdotI > 0.0f) { float n_x = bsdf_ashikhmin_shirley_roughness_to_exponent(bsdf->alpha_x); float n_y = bsdf_ashikhmin_shirley_roughness_to_exponent(bsdf->alpha_y); /* get x,y basis on the surface for anisotropy */ float3 X, Y; if(n_x == n_y) make_orthonormals(N, &X, &Y); else make_orthonormals_tangent(N, bsdf->T, &X, &Y); /* sample spherical coords for h in tangent space */ float phi; float cos_theta; if(n_x == n_y) { /* isotropic sampling */ phi = M_2PI_F * randu; cos_theta = powf(randv, 1.0f / (n_x + 1.0f)); } else { /* anisotropic sampling */ if(randu < 0.25f) { /* first quadrant */ float remapped_randu = 4.0f * randu; bsdf_ashikhmin_shirley_sample_first_quadrant(n_x, n_y, remapped_randu, randv, &phi, &cos_theta); } else if(randu < 0.5f) { /* second quadrant */ float remapped_randu = 4.0f * (.5f - randu); bsdf_ashikhmin_shirley_sample_first_quadrant(n_x, n_y, remapped_randu, randv, &phi, &cos_theta); phi = M_PI_F - phi; } else if(randu < 0.75f) { /* third quadrant */ float remapped_randu = 4.0f * (randu - 0.5f); bsdf_ashikhmin_shirley_sample_first_quadrant(n_x, n_y, remapped_randu, randv, &phi, &cos_theta); phi = M_PI_F + phi; } else { /* fourth quadrant */ float remapped_randu = 4.0f * (1.0f - randu); bsdf_ashikhmin_shirley_sample_first_quadrant(n_x, n_y, remapped_randu, randv, &phi, &cos_theta); phi = 2.0f * M_PI_F - phi; } } /* get half vector in tangent space */ float sin_theta = sqrtf(fmaxf(0.0f, 1.0f - cos_theta*cos_theta)); float cos_phi = cosf(phi); float sin_phi = sinf(phi); /* no sqrt(1-cos^2) here b/c it causes artifacts */ float3 h = make_float3( sin_theta * cos_phi, sin_theta * sin_phi, cos_theta ); /* half vector to world space */ float3 H = h.x*X + h.y*Y + h.z*N; float HdotI = dot(H, I); if(HdotI < 0.0f) H = -H; /* reflect I on H to get omega_in */ *omega_in = -I + (2.0f * HdotI) * H; if(fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f) { /* Some high number for MIS. */ *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); label = LABEL_REFLECT | LABEL_SINGULAR; } else { /* leave the rest to eval_reflect */ *eval = bsdf_ashikhmin_shirley_eval_reflect(sc, I, *omega_in, pdf); } #ifdef __RAY_DIFFERENTIALS__ /* just do the reflection thing for now */ *domega_in_dx = (2.0f * dot(N, dIdx)) * N - dIdx; *domega_in_dy = (2.0f * dot(N, dIdy)) * N - dIdy; #endif } return label; } CCL_NAMESPACE_END #endif /* __BSDF_ASHIKHMIN_SHIRLEY_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_ashikhmin_velvet.h000066400000000000000000000124631334742672700260460ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_ASHIKHMIN_VELVET_H__ #define __BSDF_ASHIKHMIN_VELVET_H__ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct VelvetBsdf { SHADER_CLOSURE_BASE; float sigma; float invsigma2; } VelvetBsdf; ccl_device int bsdf_ashikhmin_velvet_setup(VelvetBsdf *bsdf) { float sigma = fmaxf(bsdf->sigma, 0.01f); bsdf->invsigma2 = 1.0f/(sigma * sigma); bsdf->type = CLOSURE_BSDF_ASHIKHMIN_VELVET_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device bool bsdf_ashikhmin_velvet_merge(const ShaderClosure *a, const ShaderClosure *b) { const VelvetBsdf *bsdf_a = (const VelvetBsdf*)a; const VelvetBsdf *bsdf_b = (const VelvetBsdf*)b; return (isequal_float3(bsdf_a->N, bsdf_b->N)) && (bsdf_a->sigma == bsdf_b->sigma); } ccl_device float3 bsdf_ashikhmin_velvet_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const VelvetBsdf *bsdf = (const VelvetBsdf*)sc; float m_invsigma2 = bsdf->invsigma2; float3 N = bsdf->N; float cosNO = dot(N, I); float cosNI = dot(N, omega_in); if(cosNO > 0 && cosNI > 0) { float3 H = normalize(omega_in + I); float cosNH = dot(N, H); float cosHO = fabsf(dot(I, H)); if(!(fabsf(cosNH) < 1.0f-1e-5f && cosHO > 1e-5f)) return make_float3(0.0f, 0.0f, 0.0f); float cosNHdivHO = cosNH / cosHO; cosNHdivHO = fmaxf(cosNHdivHO, 1e-5f); float fac1 = 2 * fabsf(cosNHdivHO * cosNO); float fac2 = 2 * fabsf(cosNHdivHO * cosNI); float sinNH2 = 1 - cosNH * cosNH; float sinNH4 = sinNH2 * sinNH2; float cotangent2 = (cosNH * cosNH) / sinNH2; float D = expf(-cotangent2 * m_invsigma2) * m_invsigma2 * M_1_PI_F / sinNH4; float G = min(1.0f, min(fac1, fac2)); // TODO: derive G from D analytically float out = 0.25f * (D * G) / cosNO; *pdf = 0.5f * M_1_PI_F; return make_float3(out, out, out); } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_ashikhmin_velvet_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_ashikhmin_velvet_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const VelvetBsdf *bsdf = (const VelvetBsdf*)sc; float m_invsigma2 = bsdf->invsigma2; float3 N = bsdf->N; // we are viewing the surface from above - send a ray out with uniform // distribution over the hemisphere sample_uniform_hemisphere(N, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0) { float3 H = normalize(*omega_in + I); float cosNI = dot(N, *omega_in); float cosNO = dot(N, I); float cosNH = dot(N, H); float cosHO = fabsf(dot(I, H)); if(fabsf(cosNO) > 1e-5f && fabsf(cosNH) < 1.0f-1e-5f && cosHO > 1e-5f) { float cosNHdivHO = cosNH / cosHO; cosNHdivHO = fmaxf(cosNHdivHO, 1e-5f); float fac1 = 2 * fabsf(cosNHdivHO * cosNO); float fac2 = 2 * fabsf(cosNHdivHO * cosNI); float sinNH2 = 1 - cosNH * cosNH; float sinNH4 = sinNH2 * sinNH2; float cotangent2 = (cosNH * cosNH) / sinNH2; float D = expf(-cotangent2 * m_invsigma2) * m_invsigma2 * M_1_PI_F / sinNH4; float G = min(1.0f, min(fac1, fac2)); // TODO: derive G from D analytically float power = 0.25f * (D * G) / cosNO; *eval = make_float3(power, power, power); #ifdef __RAY_DIFFERENTIALS__ // TODO: find a better approximation for the retroreflective bounce *domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx; *domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy; #endif } else *pdf = 0.0f; } else *pdf = 0.0f; return LABEL_REFLECT|LABEL_DIFFUSE; } CCL_NAMESPACE_END #endif /* __BSDF_ASHIKHMIN_VELVET_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_diffuse.h000066400000000000000000000115721334742672700241330ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_DIFFUSE_H__ #define __BSDF_DIFFUSE_H__ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct DiffuseBsdf { SHADER_CLOSURE_BASE; } DiffuseBsdf; /* DIFFUSE */ ccl_device int bsdf_diffuse_setup(DiffuseBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_DIFFUSE_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device bool bsdf_diffuse_merge(const ShaderClosure *a, const ShaderClosure *b) { const DiffuseBsdf *bsdf_a = (const DiffuseBsdf*)a; const DiffuseBsdf *bsdf_b = (const DiffuseBsdf*)b; return (isequal_float3(bsdf_a->N, bsdf_b->N)); } ccl_device float3 bsdf_diffuse_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const DiffuseBsdf *bsdf = (const DiffuseBsdf*)sc; float3 N = bsdf->N; float cos_pi = fmaxf(dot(N, omega_in), 0.0f) * M_1_PI_F; *pdf = cos_pi; return make_float3(cos_pi, cos_pi, cos_pi); } ccl_device float3 bsdf_diffuse_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_diffuse_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const DiffuseBsdf *bsdf = (const DiffuseBsdf*)sc; float3 N = bsdf->N; // distribution over the hemisphere sample_cos_hemisphere(N, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0.0f) { *eval = make_float3(*pdf, *pdf, *pdf); #ifdef __RAY_DIFFERENTIALS__ // TODO: find a better approximation for the diffuse bounce *domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx; *domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy; #endif } else *pdf = 0.0f; return LABEL_REFLECT|LABEL_DIFFUSE; } /* TRANSLUCENT */ ccl_device int bsdf_translucent_setup(DiffuseBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_TRANSLUCENT_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device float3 bsdf_translucent_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_translucent_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const DiffuseBsdf *bsdf = (const DiffuseBsdf*)sc; float3 N = bsdf->N; float cos_pi = fmaxf(-dot(N, omega_in), 0.0f) * M_1_PI_F; *pdf = cos_pi; return make_float3 (cos_pi, cos_pi, cos_pi); } ccl_device int bsdf_translucent_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const DiffuseBsdf *bsdf = (const DiffuseBsdf*)sc; float3 N = bsdf->N; // we are viewing the surface from the right side - send a ray out with cosine // distribution over the hemisphere sample_cos_hemisphere (-N, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) < 0) { *eval = make_float3(*pdf, *pdf, *pdf); #ifdef __RAY_DIFFERENTIALS__ // TODO: find a better approximation for the diffuse bounce *domega_in_dx = -((2 * dot(N, dIdx)) * N - dIdx); *domega_in_dy = -((2 * dot(N, dIdy)) * N - dIdy); #endif } else { *pdf = 0; } return LABEL_TRANSMIT|LABEL_DIFFUSE; } CCL_NAMESPACE_END #endif /* __BSDF_DIFFUSE_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_diffuse_ramp.h000066400000000000000000000074121334742672700251500ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2012, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_DIFFUSE_RAMP_H__ #define __BSDF_DIFFUSE_RAMP_H__ CCL_NAMESPACE_BEGIN #ifdef __OSL__ typedef ccl_addr_space struct DiffuseRampBsdf { SHADER_CLOSURE_BASE; float3 *colors; } DiffuseRampBsdf; ccl_device float3 bsdf_diffuse_ramp_get_color(const float3 colors[8], float pos) { int MAXCOLORS = 8; float npos = pos * (float)(MAXCOLORS - 1); int ipos = float_to_int(npos); if(ipos < 0) return colors[0]; if(ipos >= (MAXCOLORS - 1)) return colors[MAXCOLORS - 1]; float offset = npos - (float)ipos; return colors[ipos] * (1.0f - offset) + colors[ipos+1] * offset; } ccl_device int bsdf_diffuse_ramp_setup(DiffuseRampBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_DIFFUSE_RAMP_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device void bsdf_diffuse_ramp_blur(ShaderClosure *sc, float roughness) { } ccl_device float3 bsdf_diffuse_ramp_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const DiffuseRampBsdf *bsdf = (const DiffuseRampBsdf*)sc; float3 N = bsdf->N; float cos_pi = fmaxf(dot(N, omega_in), 0.0f); *pdf = cos_pi * M_1_PI_F; return bsdf_diffuse_ramp_get_color(bsdf->colors, cos_pi) * M_1_PI_F; } ccl_device float3 bsdf_diffuse_ramp_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_diffuse_ramp_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const DiffuseRampBsdf *bsdf = (const DiffuseRampBsdf*)sc; float3 N = bsdf->N; // distribution over the hemisphere sample_cos_hemisphere(N, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0.0f) { *eval = bsdf_diffuse_ramp_get_color(bsdf->colors, *pdf * M_PI_F) * M_1_PI_F; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(N, dIdx)) * N - dIdx; *domega_in_dy = (2 * dot(N, dIdy)) * N - dIdy; #endif } else *pdf = 0.0f; return LABEL_REFLECT|LABEL_DIFFUSE; } #endif /* __OSL__ */ CCL_NAMESPACE_END #endif /* __BSDF_DIFFUSE_RAMP_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_hair.h000066400000000000000000000232241334742672700234260ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_HAIR_H__ #define __BSDF_HAIR_H__ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct HairBsdf { SHADER_CLOSURE_BASE; float3 T; float roughness1; float roughness2; float offset; } HairBsdf; ccl_device int bsdf_hair_reflection_setup(HairBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_HAIR_REFLECTION_ID; bsdf->roughness1 = clamp(bsdf->roughness1, 0.001f, 1.0f); bsdf->roughness2 = clamp(bsdf->roughness2, 0.001f, 1.0f); return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_hair_transmission_setup(HairBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_HAIR_TRANSMISSION_ID; bsdf->roughness1 = clamp(bsdf->roughness1, 0.001f, 1.0f); bsdf->roughness2 = clamp(bsdf->roughness2, 0.001f, 1.0f); return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device bool bsdf_hair_merge(const ShaderClosure *a, const ShaderClosure *b) { const HairBsdf *bsdf_a = (const HairBsdf*)a; const HairBsdf *bsdf_b = (const HairBsdf*)b; return (isequal_float3(bsdf_a->T, bsdf_b->T)) && (bsdf_a->roughness1 == bsdf_b->roughness1) && (bsdf_a->roughness2 == bsdf_b->roughness2) && (bsdf_a->offset == bsdf_b->offset); } ccl_device float3 bsdf_hair_reflection_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const HairBsdf *bsdf = (const HairBsdf*)sc; float offset = bsdf->offset; float3 Tg = bsdf->T; float roughness1 = bsdf->roughness1; float roughness2 = bsdf->roughness2; float Iz = dot(Tg, I); float3 locy = normalize(I - Tg * Iz); float theta_r = M_PI_2_F - fast_acosf(Iz); float omega_in_z = dot(Tg, omega_in); float3 omega_in_y = normalize(omega_in - Tg * omega_in_z); float theta_i = M_PI_2_F - fast_acosf(omega_in_z); float cosphi_i = dot(omega_in_y, locy); if(M_PI_2_F - fabsf(theta_i) < 0.001f || cosphi_i < 0.0f) { *pdf = 0.0f; return make_float3(*pdf, *pdf, *pdf); } float roughness1_inv = 1.0f / roughness1; float roughness2_inv = 1.0f / roughness2; float phi_i = fast_acosf(cosphi_i) * roughness2_inv; phi_i = fabsf(phi_i) < M_PI_F ? phi_i : M_PI_F; float costheta_i = fast_cosf(theta_i); float a_R = fast_atan2f(((M_PI_2_F + theta_r) * 0.5f - offset) * roughness1_inv, 1.0f); float b_R = fast_atan2f(((-M_PI_2_F + theta_r) * 0.5f - offset) * roughness1_inv, 1.0f); float theta_h = (theta_i + theta_r) * 0.5f; float t = theta_h - offset; float phi_pdf = fast_cosf(phi_i * 0.5f) * 0.25f * roughness2_inv; float theta_pdf = roughness1 / (2 * (t*t + roughness1*roughness1) * (a_R - b_R)* costheta_i); *pdf = phi_pdf * theta_pdf; return make_float3(*pdf, *pdf, *pdf); } ccl_device float3 bsdf_hair_transmission_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_hair_reflection_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_hair_transmission_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const HairBsdf *bsdf = (const HairBsdf*)sc; float offset = bsdf->offset; float3 Tg = bsdf->T; float roughness1 = bsdf->roughness1; float roughness2 = bsdf->roughness2; float Iz = dot(Tg, I); float3 locy = normalize(I - Tg * Iz); float theta_r = M_PI_2_F - fast_acosf(Iz); float omega_in_z = dot(Tg, omega_in); float3 omega_in_y = normalize(omega_in - Tg * omega_in_z); float theta_i = M_PI_2_F - fast_acosf(omega_in_z); float phi_i = fast_acosf(dot(omega_in_y, locy)); if(M_PI_2_F - fabsf(theta_i) < 0.001f) { *pdf = 0.0f; return make_float3(*pdf, *pdf, *pdf); } float costheta_i = fast_cosf(theta_i); float roughness1_inv = 1.0f / roughness1; float a_TT = fast_atan2f(((M_PI_2_F + theta_r)/2 - offset) * roughness1_inv, 1.0f); float b_TT = fast_atan2f(((-M_PI_2_F + theta_r)/2 - offset) * roughness1_inv, 1.0f); float c_TT = 2 * fast_atan2f(M_PI_2_F / roughness2, 1.0f); float theta_h = (theta_i + theta_r) / 2; float t = theta_h - offset; float phi = fabsf(phi_i); float p = M_PI_F - phi; float theta_pdf = roughness1 / (2 * (t*t + roughness1 * roughness1) * (a_TT - b_TT)*costheta_i); float phi_pdf = roughness2 / (c_TT * (p * p + roughness2 * roughness2)); *pdf = phi_pdf * theta_pdf; return make_float3(*pdf, *pdf, *pdf); } ccl_device int bsdf_hair_reflection_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const HairBsdf *bsdf = (const HairBsdf*)sc; float offset = bsdf->offset; float3 Tg = bsdf->T; float roughness1 = bsdf->roughness1; float roughness2 = bsdf->roughness2; float Iz = dot(Tg, I); float3 locy = normalize(I - Tg * Iz); float3 locx = cross(locy, Tg); float theta_r = M_PI_2_F - fast_acosf(Iz); float roughness1_inv = 1.0f / roughness1; float a_R = fast_atan2f(((M_PI_2_F + theta_r) * 0.5f - offset) * roughness1_inv, 1.0f); float b_R = fast_atan2f(((-M_PI_2_F + theta_r) * 0.5f - offset) * roughness1_inv, 1.0f); float t = roughness1 * tanf(randu * (a_R - b_R) + b_R); float theta_h = t + offset; float theta_i = 2 * theta_h - theta_r; float costheta_i, sintheta_i; fast_sincosf(theta_i, &sintheta_i, &costheta_i); float phi = 2 * safe_asinf(1 - 2 * randv) * roughness2; float phi_pdf = fast_cosf(phi * 0.5f) * 0.25f / roughness2; float theta_pdf = roughness1 / (2 * (t*t + roughness1*roughness1) * (a_R - b_R)*costheta_i); float sinphi, cosphi; fast_sincosf(phi, &sinphi, &cosphi); *omega_in =(cosphi * costheta_i) * locy - (sinphi * costheta_i) * locx + ( sintheta_i) * Tg; //differentials - TODO: find a better approximation for the reflective bounce #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = 2 * dot(locy, dIdx) * locy - dIdx; *domega_in_dy = 2 * dot(locy, dIdy) * locy - dIdy; #endif *pdf = fabsf(phi_pdf * theta_pdf); if(M_PI_2_F - fabsf(theta_i) < 0.001f) *pdf = 0.0f; *eval = make_float3(*pdf, *pdf, *pdf); return LABEL_REFLECT|LABEL_GLOSSY; } ccl_device int bsdf_hair_transmission_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const HairBsdf *bsdf = (const HairBsdf*)sc; float offset = bsdf->offset; float3 Tg = bsdf->T; float roughness1 = bsdf->roughness1; float roughness2 = bsdf->roughness2; float Iz = dot(Tg, I); float3 locy = normalize(I - Tg * Iz); float3 locx = cross(locy, Tg); float theta_r = M_PI_2_F - fast_acosf(Iz); float roughness1_inv = 1.0f / roughness1; float a_TT = fast_atan2f(((M_PI_2_F + theta_r)/2 - offset) * roughness1_inv, 1.0f); float b_TT = fast_atan2f(((-M_PI_2_F + theta_r)/2 - offset) * roughness1_inv, 1.0f); float c_TT = 2 * fast_atan2f(M_PI_2_F / roughness2, 1.0f); float t = roughness1 * tanf(randu * (a_TT - b_TT) + b_TT); float theta_h = t + offset; float theta_i = 2 * theta_h - theta_r; float costheta_i, sintheta_i; fast_sincosf(theta_i, &sintheta_i, &costheta_i); float p = roughness2 * tanf(c_TT * (randv - 0.5f)); float phi = p + M_PI_F; float theta_pdf = roughness1 / (2 * (t*t + roughness1*roughness1) * (a_TT - b_TT) * costheta_i); float phi_pdf = roughness2 / (c_TT * (p * p + roughness2 * roughness2)); float sinphi, cosphi; fast_sincosf(phi, &sinphi, &cosphi); *omega_in =(cosphi * costheta_i) * locy - (sinphi * costheta_i) * locx + ( sintheta_i) * Tg; //differentials - TODO: find a better approximation for the transmission bounce #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = 2 * dot(locy, dIdx) * locy - dIdx; *domega_in_dy = 2 * dot(locy, dIdy) * locy - dIdy; #endif *pdf = fabsf(phi_pdf * theta_pdf); if(M_PI_2_F - fabsf(theta_i) < 0.001f) { *pdf = 0.0f; } *eval = make_float3(*pdf, *pdf, *pdf); /* TODO(sergey): Should always be negative, but seems some precision issue * is involved here. */ kernel_assert(dot(locy, *omega_in) < 1e-4f); return LABEL_TRANSMIT|LABEL_GLOSSY; } CCL_NAMESPACE_END #endif /* __BSDF_HAIR_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_microfacet.h000066400000000000000000001047751334742672700246320ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_MICROFACET_H__ #define __BSDF_MICROFACET_H__ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct MicrofacetExtra { float3 color, cspec0; float clearcoat; } MicrofacetExtra; typedef ccl_addr_space struct MicrofacetBsdf { SHADER_CLOSURE_BASE; float alpha_x, alpha_y, ior; MicrofacetExtra *extra; float3 T; } MicrofacetBsdf; /* Beckmann and GGX microfacet importance sampling. */ ccl_device_inline void microfacet_beckmann_sample_slopes( KernelGlobals *kg, const float cos_theta_i, const float sin_theta_i, float randu, float randv, float *slope_x, float *slope_y, float *G1i) { /* special case (normal incidence) */ if(cos_theta_i >= 0.99999f) { const float r = sqrtf(-logf(randu)); const float phi = M_2PI_F * randv; *slope_x = r * cosf(phi); *slope_y = r * sinf(phi); *G1i = 1.0f; return; } /* precomputations */ const float tan_theta_i = sin_theta_i/cos_theta_i; const float inv_a = tan_theta_i; const float cot_theta_i = 1.0f/tan_theta_i; const float erf_a = fast_erff(cot_theta_i); const float exp_a2 = expf(-cot_theta_i*cot_theta_i); const float SQRT_PI_INV = 0.56418958354f; const float Lambda = 0.5f*(erf_a - 1.0f) + (0.5f*SQRT_PI_INV)*(exp_a2*inv_a); const float G1 = 1.0f/(1.0f + Lambda); /* masking */ *G1i = G1; #if defined(__KERNEL_GPU__) /* Based on paper from Wenzel Jakob * An Improved Visible Normal Sampling Routine for the Beckmann Distribution * * http://www.mitsuba-renderer.org/~wenzel/files/visnormal.pdf * * Reformulation from OpenShadingLanguage which avoids using inverse * trigonometric functions. */ /* Sample slope X. * * Compute a coarse approximation using the approximation: * exp(-ierf(x)^2) ~= 1 - x * x * solve y = 1 + b + K * (1 - b * b) */ float K = tan_theta_i * SQRT_PI_INV; float y_approx = randu * (1.0f + erf_a + K * (1 - erf_a * erf_a)); float y_exact = randu * (1.0f + erf_a + K * exp_a2); float b = K > 0 ? (0.5f - sqrtf(K * (K - y_approx + 1.0f) + 0.25f)) / K : y_approx - 1.0f; /* Perform newton step to refine toward the true root. */ float inv_erf = fast_ierff(b); float value = 1.0f + b + K * expf(-inv_erf * inv_erf) - y_exact; /* Check if we are close enough already, * this also avoids NaNs as we get close to the root. */ if(fabsf(value) > 1e-6f) { b -= value / (1.0f - inv_erf * tan_theta_i); /* newton step 1. */ inv_erf = fast_ierff(b); value = 1.0f + b + K * expf(-inv_erf * inv_erf) - y_exact; b -= value / (1.0f - inv_erf * tan_theta_i); /* newton step 2. */ /* Compute the slope from the refined value. */ *slope_x = fast_ierff(b); } else { /* We are close enough already. */ *slope_x = inv_erf; } *slope_y = fast_ierff(2.0f*randv - 1.0f); #else /* Use precomputed table on CPU, it gives better perfomance. */ int beckmann_table_offset = kernel_data.tables.beckmann_offset; *slope_x = lookup_table_read_2D(kg, randu, cos_theta_i, beckmann_table_offset, BECKMANN_TABLE_SIZE, BECKMANN_TABLE_SIZE); *slope_y = fast_ierff(2.0f*randv - 1.0f); #endif } /* GGX microfacet importance sampling from: * * Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals. * E. Heitz and E. d'Eon, EGSR 2014 */ ccl_device_inline void microfacet_ggx_sample_slopes( const float cos_theta_i, const float sin_theta_i, float randu, float randv, float *slope_x, float *slope_y, float *G1i) { /* special case (normal incidence) */ if(cos_theta_i >= 0.99999f) { const float r = sqrtf(randu/(1.0f - randu)); const float phi = M_2PI_F * randv; *slope_x = r * cosf(phi); *slope_y = r * sinf(phi); *G1i = 1.0f; return; } /* precomputations */ const float tan_theta_i = sin_theta_i/cos_theta_i; const float G1_inv = 0.5f * (1.0f + safe_sqrtf(1.0f + tan_theta_i*tan_theta_i)); *G1i = 1.0f/G1_inv; /* sample slope_x */ const float A = 2.0f*randu*G1_inv - 1.0f; const float AA = A*A; const float tmp = 1.0f/(AA - 1.0f); const float B = tan_theta_i; const float BB = B*B; const float D = safe_sqrtf(BB*(tmp*tmp) - (AA - BB)*tmp); const float slope_x_1 = B*tmp - D; const float slope_x_2 = B*tmp + D; *slope_x = (A < 0.0f || slope_x_2*tan_theta_i > 1.0f)? slope_x_1: slope_x_2; /* sample slope_y */ float S; if(randv > 0.5f) { S = 1.0f; randv = 2.0f*(randv - 0.5f); } else { S = -1.0f; randv = 2.0f*(0.5f - randv); } const float z = (randv*(randv*(randv*0.27385f - 0.73369f) + 0.46341f)) / (randv*(randv*(randv*0.093073f + 0.309420f) - 1.000000f) + 0.597999f); *slope_y = S * z * safe_sqrtf(1.0f + (*slope_x)*(*slope_x)); } ccl_device_forceinline float3 microfacet_sample_stretched( KernelGlobals *kg, const float3 omega_i, const float alpha_x, const float alpha_y, const float randu, const float randv, bool beckmann, float *G1i) { /* 1. stretch omega_i */ float3 omega_i_ = make_float3(alpha_x * omega_i.x, alpha_y * omega_i.y, omega_i.z); omega_i_ = normalize(omega_i_); /* get polar coordinates of omega_i_ */ float costheta_ = 1.0f; float sintheta_ = 0.0f; float cosphi_ = 1.0f; float sinphi_ = 0.0f; if(omega_i_.z < 0.99999f) { costheta_ = omega_i_.z; sintheta_ = safe_sqrtf(1.0f - costheta_*costheta_); float invlen = 1.0f/sintheta_; cosphi_ = omega_i_.x * invlen; sinphi_ = omega_i_.y * invlen; } /* 2. sample P22_{omega_i}(x_slope, y_slope, 1, 1) */ float slope_x, slope_y; if(beckmann) { microfacet_beckmann_sample_slopes(kg, costheta_, sintheta_, randu, randv, &slope_x, &slope_y, G1i); } else { microfacet_ggx_sample_slopes(costheta_, sintheta_, randu, randv, &slope_x, &slope_y, G1i); } /* 3. rotate */ float tmp = cosphi_*slope_x - sinphi_*slope_y; slope_y = sinphi_*slope_x + cosphi_*slope_y; slope_x = tmp; /* 4. unstretch */ slope_x = alpha_x * slope_x; slope_y = alpha_y * slope_y; /* 5. compute normal */ return normalize(make_float3(-slope_x, -slope_y, 1.0f)); } /* Calculate the reflection color * * If fresnel is used, the color is an interpolation of the F0 color and white * with respect to the fresnel * * Else it is simply white */ ccl_device_forceinline float3 reflection_color(const MicrofacetBsdf *bsdf, float3 L, float3 H) { float3 F = make_float3(1.0f, 1.0f, 1.0f); bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID || bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID || bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID); if(use_fresnel) { float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior); F = interpolate_fresnel_color(L, H, bsdf->ior, F0, bsdf->extra->cspec0); } return F; } ccl_device_forceinline float D_GTR1(float NdotH, float alpha) { if(alpha >= 1.0f) return M_1_PI_F; float alpha2 = alpha*alpha; float t = 1.0f + (alpha2 - 1.0f) * NdotH*NdotH; return (alpha2 - 1.0f) / (M_PI_F * logf(alpha2) * t); } /* GGX microfacet with Smith shadow-masking from: * * Microfacet Models for Refraction through Rough Surfaces * B. Walter, S. R. Marschner, H. Li, K. E. Torrance, EGSR 2007 * * Anisotropic from: * * Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs * E. Heitz, Research Report 2014 * * Anisotropy is only supported for reflection currently, but adding it for * transmission is just a matter of copying code from reflection if needed. */ ccl_device int bsdf_microfacet_ggx_setup(MicrofacetBsdf *bsdf) { bsdf->extra = NULL; bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_microfacet_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) { bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x); bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y); bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z); float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior); float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0)); bsdf->sample_weight *= F; bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_microfacet_ggx_clearcoat_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) { bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x); bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y); bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z); float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior); float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0)); bsdf->sample_weight *= 0.25f * bsdf->extra->clearcoat * F; bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device bool bsdf_microfacet_merge(const ShaderClosure *a, const ShaderClosure *b) { const MicrofacetBsdf *bsdf_a = (const MicrofacetBsdf*)a; const MicrofacetBsdf *bsdf_b = (const MicrofacetBsdf*)b; return (isequal_float3(bsdf_a->N, bsdf_b->N)) && (bsdf_a->alpha_x == bsdf_b->alpha_x) && (bsdf_a->alpha_y == bsdf_b->alpha_y) && (isequal_float3(bsdf_a->T, bsdf_b->T)) && (bsdf_a->ior == bsdf_b->ior) && ((bsdf_a->extra == NULL && bsdf_b->extra == NULL) || ((bsdf_a->extra && bsdf_b->extra) && (isequal_float3(bsdf_a->extra->color, bsdf_b->extra->color)) && (isequal_float3(bsdf_a->extra->cspec0, bsdf_b->extra->cspec0)) && (bsdf_a->extra->clearcoat == bsdf_b->extra->clearcoat))); } ccl_device int bsdf_microfacet_ggx_aniso_setup(MicrofacetBsdf *bsdf) { bsdf->extra = NULL; bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = saturate(bsdf->alpha_y); bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_microfacet_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) { bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x); bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y); bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z); float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior); float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0)); bsdf->sample_weight *= F; bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = saturate(bsdf->alpha_y); bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_microfacet_ggx_refraction_setup(MicrofacetBsdf *bsdf) { bsdf->extra = NULL; bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device void bsdf_microfacet_ggx_blur(ShaderClosure *sc, float roughness) { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)sc; bsdf->alpha_x = fmaxf(roughness, bsdf->alpha_x); bsdf->alpha_y = fmaxf(roughness, bsdf->alpha_y); } ccl_device float3 bsdf_microfacet_ggx_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float alpha_x = bsdf->alpha_x; float alpha_y = bsdf->alpha_y; bool m_refractive = bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID; float3 N = bsdf->N; if(m_refractive || alpha_x*alpha_y <= 1e-7f) return make_float3(0.0f, 0.0f, 0.0f); float cosNO = dot(N, I); float cosNI = dot(N, omega_in); if(cosNI > 0 && cosNO > 0) { /* get half vector */ float3 m = normalize(omega_in + I); float alpha2 = alpha_x * alpha_y; float D, G1o, G1i; if(alpha_x == alpha_y) { /* isotropic * eq. 20: (F*G*D)/(4*in*on) * eq. 33: first we calculate D(m) */ float cosThetaM = dot(N, m); float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; float tanThetaM2 = (1 - cosThetaM2) / cosThetaM2; if(bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID) { /* use GTR1 for clearcoat */ D = D_GTR1(cosThetaM, bsdf->alpha_x); /* the alpha value for clearcoat is a fixed 0.25 => alpha2 = 0.25 * 0.25 */ alpha2 = 0.0625f; } else { /* use GTR2 otherwise */ D = alpha2 / (M_PI_F * cosThetaM4 * (alpha2 + tanThetaM2) * (alpha2 + tanThetaM2)); } /* eq. 34: now calculate G1(i,m) and G1(o,m) */ G1o = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNO * cosNO) / (cosNO * cosNO))); G1i = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNI * cosNI) / (cosNI * cosNI))); } else { /* anisotropic */ float3 X, Y, Z = N; make_orthonormals_tangent(Z, bsdf->T, &X, &Y); /* distribution */ float3 local_m = make_float3(dot(X, m), dot(Y, m), dot(Z, m)); float slope_x = -local_m.x/(local_m.z*alpha_x); float slope_y = -local_m.y/(local_m.z*alpha_y); float slope_len = 1 + slope_x*slope_x + slope_y*slope_y; float cosThetaM = local_m.z; float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; D = 1 / ((slope_len * slope_len) * M_PI_F * alpha2 * cosThetaM4); /* G1(i,m) and G1(o,m) */ float tanThetaO2 = (1 - cosNO * cosNO) / (cosNO * cosNO); float cosPhiO = dot(I, X); float sinPhiO = dot(I, Y); float alphaO2 = (cosPhiO*cosPhiO)*(alpha_x*alpha_x) + (sinPhiO*sinPhiO)*(alpha_y*alpha_y); alphaO2 /= cosPhiO*cosPhiO + sinPhiO*sinPhiO; G1o = 2 / (1 + safe_sqrtf(1 + alphaO2 * tanThetaO2)); float tanThetaI2 = (1 - cosNI * cosNI) / (cosNI * cosNI); float cosPhiI = dot(omega_in, X); float sinPhiI = dot(omega_in, Y); float alphaI2 = (cosPhiI*cosPhiI)*(alpha_x*alpha_x) + (sinPhiI*sinPhiI)*(alpha_y*alpha_y); alphaI2 /= cosPhiI*cosPhiI + sinPhiI*sinPhiI; G1i = 2 / (1 + safe_sqrtf(1 + alphaI2 * tanThetaI2)); } float G = G1o * G1i; /* eq. 20 */ float common = D * 0.25f / cosNO; float3 F = reflection_color(bsdf, omega_in, m); if(bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID) { F *= 0.25f * bsdf->extra->clearcoat; } float3 out = F * G * common; /* eq. 2 in distribution of visible normals sampling * pm = Dw = G1o * dot(m, I) * D / dot(N, I); */ /* eq. 38 - but see also: * eq. 17 in http://www.graphics.cornell.edu/~bjw/wardnotes.pdf * pdf = pm * 0.25 / dot(m, I); */ *pdf = G1o * common; return out; } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_microfacet_ggx_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float alpha_x = bsdf->alpha_x; float alpha_y = bsdf->alpha_y; float m_eta = bsdf->ior; bool m_refractive = bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID; float3 N = bsdf->N; if(!m_refractive || alpha_x*alpha_y <= 1e-7f) return make_float3(0.0f, 0.0f, 0.0f); float cosNO = dot(N, I); float cosNI = dot(N, omega_in); if(cosNO <= 0 || cosNI >= 0) return make_float3(0.0f, 0.0f, 0.0f); /* vectors on same side -- not possible */ /* compute half-vector of the refraction (eq. 16) */ float3 ht = -(m_eta * omega_in + I); float3 Ht = normalize(ht); float cosHO = dot(Ht, I); float cosHI = dot(Ht, omega_in); float D, G1o, G1i; /* eq. 33: first we calculate D(m) with m=Ht: */ float alpha2 = alpha_x * alpha_y; float cosThetaM = dot(N, Ht); float cosThetaM2 = cosThetaM * cosThetaM; float tanThetaM2 = (1 - cosThetaM2) / cosThetaM2; float cosThetaM4 = cosThetaM2 * cosThetaM2; D = alpha2 / (M_PI_F * cosThetaM4 * (alpha2 + tanThetaM2) * (alpha2 + tanThetaM2)); /* eq. 34: now calculate G1(i,m) and G1(o,m) */ G1o = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNO * cosNO) / (cosNO * cosNO))); G1i = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNI * cosNI) / (cosNI * cosNI))); float G = G1o * G1i; /* probability */ float Ht2 = dot(ht, ht); /* eq. 2 in distribution of visible normals sampling * pm = Dw = G1o * dot(m, I) * D / dot(N, I); */ /* out = fabsf(cosHI * cosHO) * (m_eta * m_eta) * G * D / (cosNO * Ht2) * pdf = pm * (m_eta * m_eta) * fabsf(cosHI) / Ht2 */ float common = D * (m_eta * m_eta) / (cosNO * Ht2); float out = G * fabsf(cosHI * cosHO) * common; *pdf = G1o * fabsf(cosHO * cosHI) * common; return make_float3(out, out, out); } ccl_device int bsdf_microfacet_ggx_sample(KernelGlobals *kg, const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float alpha_x = bsdf->alpha_x; float alpha_y = bsdf->alpha_y; bool m_refractive = bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID; float3 N = bsdf->N; int label; float cosNO = dot(N, I); if(cosNO > 0) { float3 X, Y, Z = N; if(alpha_x == alpha_y) make_orthonormals(Z, &X, &Y); else make_orthonormals_tangent(Z, bsdf->T, &X, &Y); /* importance sampling with distribution of visible normals. vectors are * transformed to local space before and after */ float3 local_I = make_float3(dot(X, I), dot(Y, I), cosNO); float3 local_m; float G1o; local_m = microfacet_sample_stretched(kg, local_I, alpha_x, alpha_y, randu, randv, false, &G1o); float3 m = X*local_m.x + Y*local_m.y + Z*local_m.z; float cosThetaM = local_m.z; /* reflection or refraction? */ if(!m_refractive) { float cosMO = dot(m, I); label = LABEL_REFLECT | LABEL_GLOSSY; if(cosMO > 0) { /* eq. 39 - compute actual reflected direction */ *omega_in = 2 * cosMO * m - I; if(dot(Ng, *omega_in) > 0) { if(alpha_x*alpha_y <= 1e-7f) { /* some high number for MIS */ *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID || bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID || bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID); /* if fresnel is used, calculate the color with reflection_color(...) */ if(use_fresnel) { *eval *= reflection_color(bsdf, *omega_in, m); } label = LABEL_REFLECT | LABEL_SINGULAR; } else { /* microfacet normal is visible to this ray */ /* eq. 33 */ float alpha2 = alpha_x * alpha_y; float D, G1i; if(alpha_x == alpha_y) { /* isotropic */ float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; float tanThetaM2 = 1/(cosThetaM2) - 1; /* eval BRDF*cosNI */ float cosNI = dot(N, *omega_in); if(bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID) { /* use GTR1 for clearcoat */ D = D_GTR1(cosThetaM, bsdf->alpha_x); /* the alpha value for clearcoat is a fixed 0.25 => alpha2 = 0.25 * 0.25 */ alpha2 = 0.0625f; /* recalculate G1o */ G1o = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNO * cosNO) / (cosNO * cosNO))); } else { /* use GTR2 otherwise */ D = alpha2 / (M_PI_F * cosThetaM4 * (alpha2 + tanThetaM2) * (alpha2 + tanThetaM2)); } /* eq. 34: now calculate G1(i,m) */ G1i = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNI * cosNI) / (cosNI * cosNI))); } else { /* anisotropic distribution */ float3 local_m = make_float3(dot(X, m), dot(Y, m), dot(Z, m)); float slope_x = -local_m.x/(local_m.z*alpha_x); float slope_y = -local_m.y/(local_m.z*alpha_y); float slope_len = 1 + slope_x*slope_x + slope_y*slope_y; float cosThetaM = local_m.z; float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; D = 1 / ((slope_len * slope_len) * M_PI_F * alpha2 * cosThetaM4); /* calculate G1(i,m) */ float cosNI = dot(N, *omega_in); float tanThetaI2 = (1 - cosNI * cosNI) / (cosNI * cosNI); float cosPhiI = dot(*omega_in, X); float sinPhiI = dot(*omega_in, Y); float alphaI2 = (cosPhiI*cosPhiI)*(alpha_x*alpha_x) + (sinPhiI*sinPhiI)*(alpha_y*alpha_y); alphaI2 /= cosPhiI*cosPhiI + sinPhiI*sinPhiI; G1i = 2 / (1 + safe_sqrtf(1 + alphaI2 * tanThetaI2)); } /* see eval function for derivation */ float common = (G1o * D) * 0.25f / cosNO; *pdf = common; float3 F = reflection_color(bsdf, *omega_in, m); *eval = G1i * common * F; } if(bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID) { *eval *= 0.25f * bsdf->extra->clearcoat; } #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(m, dIdx)) * m - dIdx; *domega_in_dy = (2 * dot(m, dIdy)) * m - dIdy; #endif } } } else { label = LABEL_TRANSMIT | LABEL_GLOSSY; /* CAUTION: the i and o variables are inverted relative to the paper * eq. 39 - compute actual refractive direction */ float3 R, T; #ifdef __RAY_DIFFERENTIALS__ float3 dRdx, dRdy, dTdx, dTdy; #endif float m_eta = bsdf->ior, fresnel; bool inside; fresnel = fresnel_dielectric(m_eta, m, I, &R, &T, #ifdef __RAY_DIFFERENTIALS__ dIdx, dIdy, &dRdx, &dRdy, &dTdx, &dTdy, #endif &inside); if(!inside && fresnel != 1.0f) { *omega_in = T; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = dTdx; *domega_in_dy = dTdy; #endif if(alpha_x*alpha_y <= 1e-7f || fabsf(m_eta - 1.0f) < 1e-4f) { /* some high number for MIS */ *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); label = LABEL_TRANSMIT | LABEL_SINGULAR; } else { /* eq. 33 */ float alpha2 = alpha_x * alpha_y; float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; float tanThetaM2 = 1/(cosThetaM2) - 1; float D = alpha2 / (M_PI_F * cosThetaM4 * (alpha2 + tanThetaM2) * (alpha2 + tanThetaM2)); /* eval BRDF*cosNI */ float cosNI = dot(N, *omega_in); /* eq. 34: now calculate G1(i,m) */ float G1i = 2 / (1 + safe_sqrtf(1 + alpha2 * (1 - cosNI * cosNI) / (cosNI * cosNI))); /* eq. 21 */ float cosHI = dot(m, *omega_in); float cosHO = dot(m, I); float Ht2 = m_eta * cosHI + cosHO; Ht2 *= Ht2; /* see eval function for derivation */ float common = (G1o * D) * (m_eta * m_eta) / (cosNO * Ht2); float out = G1i * fabsf(cosHI * cosHO) * common; *pdf = cosHO * fabsf(cosHI) * common; *eval = make_float3(out, out, out); } } } } else { label = (m_refractive) ? LABEL_TRANSMIT|LABEL_GLOSSY : LABEL_REFLECT|LABEL_GLOSSY; } return label; } /* Beckmann microfacet with Smith shadow-masking from: * * Microfacet Models for Refraction through Rough Surfaces * B. Walter, S. R. Marschner, H. Li, K. E. Torrance, EGSR 2007 */ ccl_device int bsdf_microfacet_beckmann_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_BECKMANN_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_microfacet_beckmann_aniso_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = saturate(bsdf->alpha_y); bsdf->type = CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device int bsdf_microfacet_beckmann_refraction_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_x = saturate(bsdf->alpha_x); bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device void bsdf_microfacet_beckmann_blur(ShaderClosure *sc, float roughness) { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)sc; bsdf->alpha_x = fmaxf(roughness, bsdf->alpha_x); bsdf->alpha_y = fmaxf(roughness, bsdf->alpha_y); } ccl_device_inline float bsdf_beckmann_G1(float alpha, float cos_n) { cos_n *= cos_n; float invA = alpha * safe_sqrtf((1.0f - cos_n) / cos_n); if(invA < 0.625f) { return 1.0f; } float a = 1.0f / invA; return ((2.181f*a + 3.535f)*a) / ((2.577f*a + 2.276f)*a + 1.0f); } ccl_device_inline float bsdf_beckmann_aniso_G1(float alpha_x, float alpha_y, float cos_n, float cos_phi, float sin_phi) { cos_n *= cos_n; sin_phi *= sin_phi; cos_phi *= cos_phi; alpha_x *= alpha_x; alpha_y *= alpha_y; float alphaO2 = (cos_phi*alpha_x + sin_phi*alpha_y) / (cos_phi + sin_phi); float invA = safe_sqrtf(alphaO2 * (1 - cos_n) / cos_n); if(invA < 0.625f) { return 1.0f; } float a = 1.0f / invA; return ((2.181f*a + 3.535f)*a) / ((2.577f*a + 2.276f)*a + 1.0f); } ccl_device float3 bsdf_microfacet_beckmann_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float alpha_x = bsdf->alpha_x; float alpha_y = bsdf->alpha_y; bool m_refractive = bsdf->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID; float3 N = bsdf->N; if(m_refractive || alpha_x*alpha_y <= 1e-7f) return make_float3(0.0f, 0.0f, 0.0f); float cosNO = dot(N, I); float cosNI = dot(N, omega_in); if(cosNO > 0 && cosNI > 0) { /* get half vector */ float3 m = normalize(omega_in + I); float alpha2 = alpha_x * alpha_y; float D, G1o, G1i; if(alpha_x == alpha_y) { /* isotropic * eq. 20: (F*G*D)/(4*in*on) * eq. 25: first we calculate D(m) */ float cosThetaM = dot(N, m); float cosThetaM2 = cosThetaM * cosThetaM; float tanThetaM2 = (1 - cosThetaM2) / cosThetaM2; float cosThetaM4 = cosThetaM2 * cosThetaM2; D = expf(-tanThetaM2 / alpha2) / (M_PI_F * alpha2 * cosThetaM4); /* eq. 26, 27: now calculate G1(i,m) and G1(o,m) */ G1o = bsdf_beckmann_G1(alpha_x, cosNO); G1i = bsdf_beckmann_G1(alpha_x, cosNI); } else { /* anisotropic */ float3 X, Y, Z = N; make_orthonormals_tangent(Z, bsdf->T, &X, &Y); /* distribution */ float3 local_m = make_float3(dot(X, m), dot(Y, m), dot(Z, m)); float slope_x = -local_m.x/(local_m.z*alpha_x); float slope_y = -local_m.y/(local_m.z*alpha_y); float cosThetaM = local_m.z; float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; D = expf(-slope_x*slope_x - slope_y*slope_y) / (M_PI_F * alpha2 * cosThetaM4); /* G1(i,m) and G1(o,m) */ G1o = bsdf_beckmann_aniso_G1(alpha_x, alpha_y, cosNO, dot(I, X), dot(I, Y)); G1i = bsdf_beckmann_aniso_G1(alpha_x, alpha_y, cosNI, dot(omega_in, X), dot(omega_in, Y)); } float G = G1o * G1i; /* eq. 20 */ float common = D * 0.25f / cosNO; float out = G * common; /* eq. 2 in distribution of visible normals sampling * pm = Dw = G1o * dot(m, I) * D / dot(N, I); */ /* eq. 38 - but see also: * eq. 17 in http://www.graphics.cornell.edu/~bjw/wardnotes.pdf * pdf = pm * 0.25 / dot(m, I); */ *pdf = G1o * common; return make_float3(out, out, out); } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_microfacet_beckmann_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float alpha_x = bsdf->alpha_x; float alpha_y = bsdf->alpha_y; float m_eta = bsdf->ior; bool m_refractive = bsdf->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID; float3 N = bsdf->N; if(!m_refractive || alpha_x*alpha_y <= 1e-7f) return make_float3(0.0f, 0.0f, 0.0f); float cosNO = dot(N, I); float cosNI = dot(N, omega_in); if(cosNO <= 0 || cosNI >= 0) return make_float3(0.0f, 0.0f, 0.0f); /* compute half-vector of the refraction (eq. 16) */ float3 ht = -(m_eta * omega_in + I); float3 Ht = normalize(ht); float cosHO = dot(Ht, I); float cosHI = dot(Ht, omega_in); /* eq. 25: first we calculate D(m) with m=Ht: */ float alpha2 = alpha_x * alpha_y; float cosThetaM = min(dot(N, Ht), 1.0f); float cosThetaM2 = cosThetaM * cosThetaM; float tanThetaM2 = (1 - cosThetaM2) / cosThetaM2; float cosThetaM4 = cosThetaM2 * cosThetaM2; float D = expf(-tanThetaM2 / alpha2) / (M_PI_F * alpha2 * cosThetaM4); /* eq. 26, 27: now calculate G1(i,m) and G1(o,m) */ float G1o = bsdf_beckmann_G1(alpha_x, cosNO); float G1i = bsdf_beckmann_G1(alpha_x, cosNI); float G = G1o * G1i; /* probability */ float Ht2 = dot(ht, ht); /* eq. 2 in distribution of visible normals sampling * pm = Dw = G1o * dot(m, I) * D / dot(N, I); */ /* out = fabsf(cosHI * cosHO) * (m_eta * m_eta) * G * D / (cosNO * Ht2) * pdf = pm * (m_eta * m_eta) * fabsf(cosHI) / Ht2 */ float common = D * (m_eta * m_eta) / (cosNO * Ht2); float out = G * fabsf(cosHI * cosHO) * common; *pdf = G1o * fabsf(cosHO * cosHI) * common; return make_float3(out, out, out); } ccl_device int bsdf_microfacet_beckmann_sample(KernelGlobals *kg, const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float alpha_x = bsdf->alpha_x; float alpha_y = bsdf->alpha_y; bool m_refractive = bsdf->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID; float3 N = bsdf->N; int label; float cosNO = dot(N, I); if(cosNO > 0) { float3 X, Y, Z = N; if(alpha_x == alpha_y) make_orthonormals(Z, &X, &Y); else make_orthonormals_tangent(Z, bsdf->T, &X, &Y); /* importance sampling with distribution of visible normals. vectors are * transformed to local space before and after */ float3 local_I = make_float3(dot(X, I), dot(Y, I), cosNO); float3 local_m; float G1o; local_m = microfacet_sample_stretched(kg, local_I, alpha_x, alpha_x, randu, randv, true, &G1o); float3 m = X*local_m.x + Y*local_m.y + Z*local_m.z; float cosThetaM = local_m.z; /* reflection or refraction? */ if(!m_refractive) { label = LABEL_REFLECT | LABEL_GLOSSY; float cosMO = dot(m, I); if(cosMO > 0) { /* eq. 39 - compute actual reflected direction */ *omega_in = 2 * cosMO * m - I; if(dot(Ng, *omega_in) > 0) { if(alpha_x*alpha_y <= 1e-7f) { /* some high number for MIS */ *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); label = LABEL_REFLECT | LABEL_SINGULAR; } else { /* microfacet normal is visible to this ray * eq. 25 */ float alpha2 = alpha_x * alpha_y; float D, G1i; if(alpha_x == alpha_y) { /* istropic distribution */ float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; float tanThetaM2 = 1/(cosThetaM2) - 1; D = expf(-tanThetaM2 / alpha2) / (M_PI_F * alpha2 * cosThetaM4); /* eval BRDF*cosNI */ float cosNI = dot(N, *omega_in); /* eq. 26, 27: now calculate G1(i,m) */ G1i = bsdf_beckmann_G1(alpha_x, cosNI); } else { /* anisotropic distribution */ float3 local_m = make_float3(dot(X, m), dot(Y, m), dot(Z, m)); float slope_x = -local_m.x/(local_m.z*alpha_x); float slope_y = -local_m.y/(local_m.z*alpha_y); float cosThetaM = local_m.z; float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; D = expf(-slope_x*slope_x - slope_y*slope_y) / (M_PI_F * alpha2 * cosThetaM4); /* G1(i,m) */ G1i = bsdf_beckmann_aniso_G1(alpha_x, alpha_y, dot(*omega_in, N), dot(*omega_in, X), dot(*omega_in, Y)); } float G = G1o * G1i; /* see eval function for derivation */ float common = D * 0.25f / cosNO; float out = G * common; *pdf = G1o * common; *eval = make_float3(out, out, out); } #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(m, dIdx)) * m - dIdx; *domega_in_dy = (2 * dot(m, dIdy)) * m - dIdy; #endif } } } else { label = LABEL_TRANSMIT | LABEL_GLOSSY; /* CAUTION: the i and o variables are inverted relative to the paper * eq. 39 - compute actual refractive direction */ float3 R, T; #ifdef __RAY_DIFFERENTIALS__ float3 dRdx, dRdy, dTdx, dTdy; #endif float m_eta = bsdf->ior, fresnel; bool inside; fresnel = fresnel_dielectric(m_eta, m, I, &R, &T, #ifdef __RAY_DIFFERENTIALS__ dIdx, dIdy, &dRdx, &dRdy, &dTdx, &dTdy, #endif &inside); if(!inside && fresnel != 1.0f) { *omega_in = T; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = dTdx; *domega_in_dy = dTdy; #endif if(alpha_x*alpha_y <= 1e-7f || fabsf(m_eta - 1.0f) < 1e-4f) { /* some high number for MIS */ *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); label = LABEL_TRANSMIT | LABEL_SINGULAR; } else { /* eq. 33 */ float alpha2 = alpha_x * alpha_y; float cosThetaM2 = cosThetaM * cosThetaM; float cosThetaM4 = cosThetaM2 * cosThetaM2; float tanThetaM2 = 1/(cosThetaM2) - 1; float D = expf(-tanThetaM2 / alpha2) / (M_PI_F * alpha2 * cosThetaM4); /* eval BRDF*cosNI */ float cosNI = dot(N, *omega_in); /* eq. 26, 27: now calculate G1(i,m) */ float G1i = bsdf_beckmann_G1(alpha_x, cosNI); float G = G1o * G1i; /* eq. 21 */ float cosHI = dot(m, *omega_in); float cosHO = dot(m, I); float Ht2 = m_eta * cosHI + cosHO; Ht2 *= Ht2; /* see eval function for derivation */ float common = D * (m_eta * m_eta) / (cosNO * Ht2); float out = G * fabsf(cosHI * cosHO) * common; *pdf = G1o * cosHO * fabsf(cosHI) * common; *eval = make_float3(out, out, out); } } } } else { label = (m_refractive) ? LABEL_TRANSMIT|LABEL_GLOSSY : LABEL_REFLECT|LABEL_GLOSSY; } return label; } CCL_NAMESPACE_END #endif /* __BSDF_MICROFACET_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_microfacet_multi.h000066400000000000000000000520511334742672700260310ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Most of the code is based on the supplemental implementations from https://eheitzresearch.wordpress.com/240-2/. */ /* === GGX Microfacet distribution functions === */ /* Isotropic GGX microfacet distribution */ ccl_device_forceinline float D_ggx(float3 wm, float alpha) { wm.z *= wm.z; alpha *= alpha; float tmp = (1.0f - wm.z) + alpha * wm.z; return alpha / max(M_PI_F * tmp*tmp, 1e-7f); } /* Anisotropic GGX microfacet distribution */ ccl_device_forceinline float D_ggx_aniso(const float3 wm, const float2 alpha) { float slope_x = -wm.x/alpha.x; float slope_y = -wm.y/alpha.y; float tmp = wm.z*wm.z + slope_x*slope_x + slope_y*slope_y; return 1.0f / max(M_PI_F * tmp*tmp * alpha.x*alpha.y, 1e-7f); } /* Sample slope distribution (based on page 14 of the supplemental implementation). */ ccl_device_forceinline float2 mf_sampleP22_11(const float cosI, const float randx, const float randy) { if(cosI > 0.9999f || fabsf(cosI) < 1e-6f) { const float r = sqrtf(randx / max(1.0f - randx, 1e-7f)); const float phi = M_2PI_F * randy; return make_float2(r*cosf(phi), r*sinf(phi)); } const float sinI = safe_sqrtf(1.0f - cosI*cosI); const float tanI = sinI/cosI; const float projA = 0.5f * (cosI + 1.0f); if(projA < 0.0001f) return make_float2(0.0f, 0.0f); const float A = 2.0f*randx*projA / cosI - 1.0f; float tmp = A*A-1.0f; if(fabsf(tmp) < 1e-7f) return make_float2(0.0f, 0.0f); tmp = 1.0f / tmp; const float D = safe_sqrtf(tanI*tanI*tmp*tmp - (A*A-tanI*tanI)*tmp); const float slopeX2 = tanI*tmp + D; const float slopeX = (A < 0.0f || slopeX2 > 1.0f/tanI)? (tanI*tmp - D) : slopeX2; float U2; if(randy >= 0.5f) U2 = 2.0f*(randy - 0.5f); else U2 = 2.0f*(0.5f - randy); const float z = (U2*(U2*(U2*0.27385f-0.73369f)+0.46341f)) / (U2*(U2*(U2*0.093073f+0.309420f)-1.0f)+0.597999f); const float slopeY = z * sqrtf(1.0f + slopeX*slopeX); if(randy >= 0.5f) return make_float2(slopeX, slopeY); else return make_float2(slopeX, -slopeY); } /* Visible normal sampling for the GGX distribution (based on page 7 of the supplemental implementation). */ ccl_device_forceinline float3 mf_sample_vndf(const float3 wi, const float2 alpha, const float randx, const float randy) { const float3 wi_11 = normalize(make_float3(alpha.x*wi.x, alpha.y*wi.y, wi.z)); const float2 slope_11 = mf_sampleP22_11(wi_11.z, randx, randy); const float3 cossin_phi = safe_normalize(make_float3(wi_11.x, wi_11.y, 0.0f)); const float slope_x = alpha.x*(cossin_phi.x * slope_11.x - cossin_phi.y * slope_11.y); const float slope_y = alpha.y*(cossin_phi.y * slope_11.x + cossin_phi.x * slope_11.y); kernel_assert(isfinite(slope_x)); return normalize(make_float3(-slope_x, -slope_y, 1.0f)); } /* === Phase functions: Glossy and Glass === */ /* Phase function for reflective materials. */ ccl_device_forceinline float3 mf_sample_phase_glossy(const float3 wi, float3 *weight, const float3 wm) { return -wi + 2.0f * wm * dot(wi, wm); } ccl_device_forceinline float3 mf_eval_phase_glossy(const float3 w, const float lambda, const float3 wo, const float2 alpha) { if(w.z > 0.9999f) return make_float3(0.0f, 0.0f, 0.0f); const float3 wh = normalize(wo - w); if(wh.z < 0.0f) return make_float3(0.0f, 0.0f, 0.0f); float pArea = (w.z < -0.9999f)? 1.0f: lambda*w.z; const float dotW_WH = dot(-w, wh); if(dotW_WH < 0.0f) return make_float3(0.0f, 0.0f, 0.0f); float phase = max(0.0f, dotW_WH) * 0.25f / max(pArea * dotW_WH, 1e-7f); if(alpha.x == alpha.y) phase *= D_ggx(wh, alpha.x); else phase *= D_ggx_aniso(wh, alpha); return make_float3(phase, phase, phase); } /* Phase function for dielectric transmissive materials, including both reflection and refraction according to the dielectric fresnel term. */ ccl_device_forceinline float3 mf_sample_phase_glass(const float3 wi, const float eta, const float3 wm, const float randV, bool *outside) { float cosI = dot(wi, wm); float f = fresnel_dielectric_cos(cosI, eta); if(randV < f) { *outside = true; return -wi + 2.0f * wm * cosI; } *outside = false; float inv_eta = 1.0f/eta; float cosT = -safe_sqrtf(1.0f - (1.0f - cosI*cosI) * inv_eta*inv_eta); return normalize(wm*(cosI*inv_eta + cosT) - wi*inv_eta); } ccl_device_forceinline float3 mf_eval_phase_glass(const float3 w, const float lambda, const float3 wo, const bool wo_outside, const float2 alpha, const float eta) { if(w.z > 0.9999f) return make_float3(0.0f, 0.0f, 0.0f); float pArea = (w.z < -0.9999f)? 1.0f: lambda*w.z; float v; if(wo_outside) { const float3 wh = normalize(wo - w); if(wh.z < 0.0f) return make_float3(0.0f, 0.0f, 0.0f); const float dotW_WH = dot(-w, wh); v = fresnel_dielectric_cos(dotW_WH, eta) * max(0.0f, dotW_WH) * D_ggx(wh, alpha.x) * 0.25f / (pArea * dotW_WH); } else { float3 wh = normalize(wo*eta - w); if(wh.z < 0.0f) wh = -wh; const float dotW_WH = dot(-w, wh), dotWO_WH = dot(wo, wh); if(dotW_WH < 0.0f) return make_float3(0.0f, 0.0f, 0.0f); float temp = dotW_WH + eta*dotWO_WH; v = (1.0f - fresnel_dielectric_cos(dotW_WH, eta)) * max(0.0f, dotW_WH) * max(0.0f, -dotWO_WH) * D_ggx(wh, alpha.x) / (pArea * temp * temp); } return make_float3(v, v, v); } /* === Utility functions for the random walks === */ /* Smith Lambda function for GGX (based on page 12 of the supplemental implementation). */ ccl_device_forceinline float mf_lambda(const float3 w, const float2 alpha) { if(w.z > 0.9999f) return 0.0f; else if(w.z < -0.9999f) return -0.9999f; const float inv_wz2 = 1.0f / max(w.z*w.z, 1e-7f); const float2 wa = make_float2(w.x, w.y)*alpha; float v = sqrtf(1.0f + dot(wa, wa) * inv_wz2); if(w.z <= 0.0f) v = -v; return 0.5f*(v - 1.0f); } /* Height distribution CDF (based on page 4 of the supplemental implementation). */ ccl_device_forceinline float mf_invC1(const float h) { return 2.0f * saturate(h) - 1.0f; } ccl_device_forceinline float mf_C1(const float h) { return saturate(0.5f * (h + 1.0f)); } /* Masking function (based on page 16 of the supplemental implementation). */ ccl_device_forceinline float mf_G1(const float3 w, const float C1, const float lambda) { if(w.z > 0.9999f) return 1.0f; if(w.z < 1e-5f) return 0.0f; return powf(C1, lambda); } /* Sampling from the visible height distribution (based on page 17 of the supplemental implementation). */ ccl_device_forceinline bool mf_sample_height(const float3 w, float *h, float *C1, float *G1, float *lambda, const float U) { if(w.z > 0.9999f) return false; if(w.z < -0.9999f) { *C1 *= U; *h = mf_invC1(*C1); *G1 = mf_G1(w, *C1, *lambda); } else if(fabsf(w.z) >= 0.0001f) { if(U > 1.0f - *G1) return false; if(*lambda >= 0.0f) { *C1 = 1.0f; } else { *C1 *= powf(1.0f-U, -1.0f / *lambda); } *h = mf_invC1(*C1); *G1 = mf_G1(w, *C1, *lambda); } return true; } /* === PDF approximations for the different phase functions. === * As explained in bsdf_microfacet_multi_impl.h, using approximations with MIS still produces an unbiased result. */ /* Approximation for the albedo of the single-scattering GGX distribution, * the missing energy is then approximated as a diffuse reflection for the PDF. */ ccl_device_forceinline float mf_ggx_albedo(float r) { float albedo = 0.806495f*expf(-1.98712f*r*r) + 0.199531f; albedo -= ((((((1.76741f*r - 8.43891f)*r + 15.784f)*r - 14.398f)*r + 6.45221f)*r - 1.19722f)*r + 0.027803f)*r + 0.00568739f; return saturate(albedo); } ccl_device_inline float mf_ggx_transmission_albedo(float a, float ior) { if(ior < 1.0f) { ior = 1.0f/ior; } a = saturate(a); ior = clamp(ior, 1.0f, 3.0f); float I_1 = 0.0476898f*expf(-0.978352f*(ior-0.65657f)*(ior-0.65657f)) - 0.033756f*ior + 0.993261f; float R_1 = (((0.116991f*a - 0.270369f)*a + 0.0501366f)*a - 0.00411511f)*a + 1.00008f; float I_2 = (((-2.08704f*ior + 26.3298f)*ior - 127.906f)*ior + 292.958f)*ior - 287.946f + 199.803f/(ior*ior) - 101.668f/(ior*ior*ior); float R_2 = ((((5.3725f*a -24.9307f)*a + 22.7437f)*a - 3.40751f)*a + 0.0986325f)*a + 0.00493504f; return saturate(1.0f + I_2*R_2*0.0019127f - (1.0f - I_1)*(1.0f - R_1)*9.3205f); } ccl_device_forceinline float mf_ggx_pdf(const float3 wi, const float3 wo, const float alpha) { float D = D_ggx(normalize(wi+wo), alpha); float lambda = mf_lambda(wi, make_float2(alpha, alpha)); float singlescatter = 0.25f * D / max((1.0f + lambda) * wi.z, 1e-7f); float multiscatter = wo.z * M_1_PI_F; float albedo = mf_ggx_albedo(alpha); return albedo*singlescatter + (1.0f - albedo)*multiscatter; } ccl_device_forceinline float mf_ggx_aniso_pdf(const float3 wi, const float3 wo, const float2 alpha) { float D = D_ggx_aniso(normalize(wi+wo), alpha); float lambda = mf_lambda(wi, alpha); float singlescatter = 0.25f * D / max((1.0f + lambda) * wi.z, 1e-7f); float multiscatter = wo.z * M_1_PI_F; float albedo = mf_ggx_albedo(sqrtf(alpha.x*alpha.y)); return albedo*singlescatter + (1.0f - albedo)*multiscatter; } ccl_device_forceinline float mf_glass_pdf(const float3 wi, const float3 wo, const float alpha, const float eta) { bool reflective = (wi.z*wo.z > 0.0f); float wh_len; float3 wh = normalize_len(wi + (reflective? wo : (wo*eta)), &wh_len); if(wh.z < 0.0f) wh = -wh; float3 r_wi = (wi.z < 0.0f)? -wi: wi; float lambda = mf_lambda(r_wi, make_float2(alpha, alpha)); float D = D_ggx(wh, alpha); float fresnel = fresnel_dielectric_cos(dot(r_wi, wh), eta); float multiscatter = fabsf(wo.z * M_1_PI_F); if(reflective) { float singlescatter = 0.25f * D / max((1.0f + lambda) * r_wi.z, 1e-7f); float albedo = mf_ggx_albedo(alpha); return fresnel * (albedo*singlescatter + (1.0f - albedo)*multiscatter); } else { float singlescatter = fabsf(dot(r_wi, wh)*dot(wo, wh) * D * eta*eta / max((1.0f + lambda) * r_wi.z * wh_len*wh_len, 1e-7f)); float albedo = mf_ggx_transmission_albedo(alpha, eta); return (1.0f - fresnel) * (albedo*singlescatter + (1.0f - albedo)*multiscatter); } } /* === Actual random walk implementations, one version of mf_eval and mf_sample per phase function. === */ #define MF_NAME_JOIN(x,y) x ## _ ## y #define MF_NAME_EVAL(x,y) MF_NAME_JOIN(x,y) #define MF_FUNCTION_FULL_NAME(prefix) MF_NAME_EVAL(prefix, MF_PHASE_FUNCTION) #define MF_PHASE_FUNCTION glass #define MF_MULTI_GLASS #include "kernel/closure/bsdf_microfacet_multi_impl.h" #define MF_PHASE_FUNCTION glossy #define MF_MULTI_GLOSSY #include "kernel/closure/bsdf_microfacet_multi_impl.h" ccl_device void bsdf_microfacet_multi_ggx_blur(ShaderClosure *sc, float roughness) { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)sc; bsdf->alpha_x = fmaxf(roughness, bsdf->alpha_x); bsdf->alpha_y = fmaxf(roughness, bsdf->alpha_y); } /* === Closure implementations === */ /* Multiscattering GGX Glossy closure */ ccl_device int bsdf_microfacet_multi_ggx_common_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f); bsdf->alpha_y = clamp(bsdf->alpha_y, 1e-4f, 1.0f); bsdf->extra->color.x = saturate(bsdf->extra->color.x); bsdf->extra->color.y = saturate(bsdf->extra->color.y); bsdf->extra->color.z = saturate(bsdf->extra->color.z); bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x); bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y); bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z); return SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSDF_NEEDS_LCG; } ccl_device int bsdf_microfacet_multi_ggx_aniso_setup(MicrofacetBsdf *bsdf) { if(is_zero(bsdf->T)) bsdf->T = make_float3(1.0f, 0.0f, 0.0f); bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID; return bsdf_microfacet_multi_ggx_common_setup(bsdf); } ccl_device int bsdf_microfacet_multi_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) { if(is_zero(bsdf->T)) bsdf->T = make_float3(1.0f, 0.0f, 0.0f); bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID; float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior); float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0)); bsdf->sample_weight *= F; return bsdf_microfacet_multi_ggx_common_setup(bsdf); } ccl_device int bsdf_microfacet_multi_ggx_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID; return bsdf_microfacet_multi_ggx_common_setup(bsdf); } ccl_device int bsdf_microfacet_multi_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) { bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID; float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior); float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0)); bsdf->sample_weight *= F; return bsdf_microfacet_multi_ggx_common_setup(bsdf); } ccl_device int bsdf_microfacet_multi_ggx_refraction_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_y = bsdf->alpha_x; bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID; return bsdf_microfacet_multi_ggx_common_setup(bsdf); } ccl_device float3 bsdf_microfacet_multi_ggx_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf, ccl_addr_space uint *lcg_state) { *pdf = 0.0f; return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_microfacet_multi_ggx_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf, ccl_addr_space uint *lcg_state) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; if(bsdf->alpha_x*bsdf->alpha_y < 1e-7f) { return make_float3(0.0f, 0.0f, 0.0f); } bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID); bool is_aniso = (bsdf->alpha_x != bsdf->alpha_y); float3 X, Y, Z; Z = bsdf->N; if(is_aniso) make_orthonormals_tangent(Z, bsdf->T, &X, &Y); else make_orthonormals(Z, &X, &Y); float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z)); float3 localO = make_float3(dot(omega_in, X), dot(omega_in, Y), dot(omega_in, Z)); if(is_aniso) *pdf = mf_ggx_aniso_pdf(localI, localO, make_float2(bsdf->alpha_x, bsdf->alpha_y)); else *pdf = mf_ggx_pdf(localI, localO, bsdf->alpha_x); return mf_eval_glossy(localI, localO, true, bsdf->extra->color, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, use_fresnel, bsdf->extra->cspec0); } ccl_device int bsdf_microfacet_multi_ggx_sample(KernelGlobals *kg, const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf, ccl_addr_space uint *lcg_state) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float3 X, Y, Z; Z = bsdf->N; if(bsdf->alpha_x*bsdf->alpha_y < 1e-7f) { *omega_in = 2*dot(Z, I)*Z - I; *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(Z, dIdx)) * Z - dIdx; *domega_in_dy = (2 * dot(Z, dIdy)) * Z - dIdy; #endif return LABEL_REFLECT|LABEL_SINGULAR; } bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID); bool is_aniso = (bsdf->alpha_x != bsdf->alpha_y); if(is_aniso) make_orthonormals_tangent(Z, bsdf->T, &X, &Y); else make_orthonormals(Z, &X, &Y); float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z)); float3 localO; *eval = mf_sample_glossy(localI, &localO, bsdf->extra->color, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, use_fresnel, bsdf->extra->cspec0); if(is_aniso) *pdf = mf_ggx_aniso_pdf(localI, localO, make_float2(bsdf->alpha_x, bsdf->alpha_y)); else *pdf = mf_ggx_pdf(localI, localO, bsdf->alpha_x); *eval *= *pdf; *omega_in = X*localO.x + Y*localO.y + Z*localO.z; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(Z, dIdx)) * Z - dIdx; *domega_in_dy = (2 * dot(Z, dIdy)) * Z - dIdy; #endif return LABEL_REFLECT|LABEL_GLOSSY; } /* Multiscattering GGX Glass closure */ ccl_device int bsdf_microfacet_multi_ggx_glass_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f); bsdf->alpha_y = bsdf->alpha_x; bsdf->ior = max(0.0f, bsdf->ior); bsdf->extra->color.x = saturate(bsdf->extra->color.x); bsdf->extra->color.y = saturate(bsdf->extra->color.y); bsdf->extra->color.z = saturate(bsdf->extra->color.z); bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID; return SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSDF_NEEDS_LCG; } ccl_device int bsdf_microfacet_multi_ggx_glass_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) { bsdf->alpha_x = clamp(bsdf->alpha_x, 1e-4f, 1.0f); bsdf->alpha_y = bsdf->alpha_x; bsdf->ior = max(0.0f, bsdf->ior); bsdf->extra->color.x = saturate(bsdf->extra->color.x); bsdf->extra->color.y = saturate(bsdf->extra->color.y); bsdf->extra->color.z = saturate(bsdf->extra->color.z); bsdf->extra->cspec0.x = saturate(bsdf->extra->cspec0.x); bsdf->extra->cspec0.y = saturate(bsdf->extra->cspec0.y); bsdf->extra->cspec0.z = saturate(bsdf->extra->cspec0.z); bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID; float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior); float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0)); bsdf->sample_weight *= F; return SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSDF_NEEDS_LCG; } ccl_device float3 bsdf_microfacet_multi_ggx_glass_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf, ccl_addr_space uint *lcg_state) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; if(bsdf->alpha_x*bsdf->alpha_y < 1e-7f) { return make_float3(0.0f, 0.0f, 0.0f); } float3 X, Y, Z; Z = bsdf->N; make_orthonormals(Z, &X, &Y); float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z)); float3 localO = make_float3(dot(omega_in, X), dot(omega_in, Y), dot(omega_in, Z)); *pdf = mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior); return mf_eval_glass(localI, localO, false, bsdf->extra->color, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, false, bsdf->extra->color); } ccl_device float3 bsdf_microfacet_multi_ggx_glass_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf, ccl_addr_space uint *lcg_state) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; if(bsdf->alpha_x*bsdf->alpha_y < 1e-7f) { return make_float3(0.0f, 0.0f, 0.0f); } bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID); float3 X, Y, Z; Z = bsdf->N; make_orthonormals(Z, &X, &Y); float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z)); float3 localO = make_float3(dot(omega_in, X), dot(omega_in, Y), dot(omega_in, Z)); *pdf = mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior); return mf_eval_glass(localI, localO, true, bsdf->extra->color, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, use_fresnel, bsdf->extra->cspec0); } ccl_device int bsdf_microfacet_multi_ggx_glass_sample(KernelGlobals *kg, const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf, ccl_addr_space uint *lcg_state) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float3 X, Y, Z; Z = bsdf->N; if(bsdf->alpha_x*bsdf->alpha_y < 1e-7f) { float3 R, T; #ifdef __RAY_DIFFERENTIALS__ float3 dRdx, dRdy, dTdx, dTdy; #endif bool inside; float fresnel = fresnel_dielectric(bsdf->ior, Z, I, &R, &T, #ifdef __RAY_DIFFERENTIALS__ dIdx, dIdy, &dRdx, &dRdy, &dTdx, &dTdy, #endif &inside); *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); if(randu < fresnel) { *omega_in = R; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = dRdx; *domega_in_dy = dRdy; #endif return LABEL_REFLECT|LABEL_SINGULAR; } else { *omega_in = T; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = dTdx; *domega_in_dy = dTdy; #endif return LABEL_TRANSMIT|LABEL_SINGULAR; } } bool use_fresnel = (bsdf->type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID); make_orthonormals(Z, &X, &Y); float3 localI = make_float3(dot(I, X), dot(I, Y), dot(I, Z)); float3 localO; *eval = mf_sample_glass(localI, &localO, bsdf->extra->color, bsdf->alpha_x, bsdf->alpha_y, lcg_state, bsdf->ior, use_fresnel, bsdf->extra->cspec0); *pdf = mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior); *eval *= *pdf; *omega_in = X*localO.x + Y*localO.y + Z*localO.z; if(localO.z*localI.z > 0.0f) { #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(Z, dIdx)) * Z - dIdx; *domega_in_dy = (2 * dot(Z, dIdy)) * Z - dIdy; #endif return LABEL_REFLECT|LABEL_GLOSSY; } else { #ifdef __RAY_DIFFERENTIALS__ float cosI = dot(Z, I); float dnp = max(sqrtf(1.0f - (bsdf->ior * bsdf->ior * (1.0f - cosI*cosI))), 1e-7f); *domega_in_dx = -(bsdf->ior * dIdx) + ((bsdf->ior - bsdf->ior * bsdf->ior * cosI / dnp) * dot(dIdx, Z)) * Z; *domega_in_dy = -(bsdf->ior * dIdy) + ((bsdf->ior - bsdf->ior * bsdf->ior * cosI / dnp) * dot(dIdy, Z)) * Z; #endif return LABEL_TRANSMIT|LABEL_GLOSSY; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_microfacet_multi_impl.h000066400000000000000000000204151334742672700270510ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Evaluate the BSDF from wi to wo. * Evaluation is split into the analytical single-scattering BSDF and the multi-scattering BSDF, * which is evaluated stochastically through a random walk. At each bounce (except for the first one), * the amount of reflection from here towards wo is evaluated before bouncing again. * * Because of the random walk, the evaluation is not deterministic, but its expected value is equal to * the correct BSDF, which is enough for Monte-Carlo rendering. The PDF also can't be determined * analytically, so the single-scattering PDF plus a diffuse term to account for the multi-scattered * energy is used. In combination with MIS, that is enough to produce an unbiased result, although * the balance heuristic isn't necessarily optimal anymore. */ ccl_device_forceinline float3 MF_FUNCTION_FULL_NAME(mf_eval)( float3 wi, float3 wo, const bool wo_outside, const float3 color, const float alpha_x, const float alpha_y, ccl_addr_space uint *lcg_state, const float eta, bool use_fresnel, const float3 cspec0) { /* Evaluating for a shallower incoming direction produces less noise, and the properties of the BSDF guarantee reciprocity. */ bool swapped = false; #ifdef MF_MULTI_GLASS if(wi.z*wo.z < 0.0f) { /* Glass transmission is a special case and requires the directions to change hemisphere. */ if(-wo.z < wi.z) { swapped = true; float3 tmp = -wo; wo = -wi; wi = tmp; } } else #endif if(wo.z < wi.z) { swapped = true; float3 tmp = wo; wo = wi; wi = tmp; } if(wi.z < 1e-5f || (wo.z < 1e-5f && wo_outside) || (wo.z > -1e-5f && !wo_outside)) return make_float3(0.0f, 0.0f, 0.0f); const float2 alpha = make_float2(alpha_x, alpha_y); float lambda_r = mf_lambda(-wi, alpha); float shadowing_lambda = mf_lambda(wo_outside? wo: -wo, alpha); /* Analytically compute single scattering for lower noise. */ float3 eval; float3 throughput = make_float3(1.0f, 1.0f, 1.0f); const float3 wh = normalize(wi+wo); #ifdef MF_MULTI_GLASS eval = mf_eval_phase_glass(-wi, lambda_r, wo, wo_outside, alpha, eta); if(wo_outside) eval *= -lambda_r / (shadowing_lambda - lambda_r); else eval *= -lambda_r * beta(-lambda_r, shadowing_lambda+1.0f); #else /* MF_MULTI_GLOSSY */ const float G2 = 1.0f / (1.0f - (lambda_r + 1.0f) + shadowing_lambda); float val = G2 * 0.25f / wi.z; if(alpha.x == alpha.y) val *= D_ggx(wh, alpha.x); else val *= D_ggx_aniso(wh, alpha); eval = make_float3(val, val, val); #endif float F0 = fresnel_dielectric_cos(1.0f, eta); if(use_fresnel) { throughput = interpolate_fresnel_color(wi, wh, eta, F0, cspec0); eval *= throughput; } float3 wr = -wi; float hr = 1.0f; float C1_r = 1.0f; float G1_r = 0.0f; bool outside = true; for(int order = 0; order < 10; order++) { /* Sample microfacet height. */ float height_rand = lcg_step_float_addrspace(lcg_state); if(!mf_sample_height(wr, &hr, &C1_r, &G1_r, &lambda_r, height_rand)) break; /* Sample microfacet normal. */ float vndf_rand_y = lcg_step_float_addrspace(lcg_state); float vndf_rand_x = lcg_step_float_addrspace(lcg_state); float3 wm = mf_sample_vndf(-wr, alpha, vndf_rand_x, vndf_rand_y); #ifdef MF_MULTI_GLASS if(order == 0 && use_fresnel) { /* Evaluate amount of scattering towards wo on this microfacet. */ float3 phase; if(outside) phase = mf_eval_phase_glass(wr, lambda_r, wo, wo_outside, alpha, eta); else phase = mf_eval_phase_glass(wr, lambda_r, -wo, !wo_outside, alpha, 1.0f / eta); eval = throughput * phase * mf_G1(wo_outside ? wo : -wo, mf_C1((outside == wo_outside) ? hr : -hr), shadowing_lambda); } #endif if(order > 0) { /* Evaluate amount of scattering towards wo on this microfacet. */ float3 phase; #ifdef MF_MULTI_GLASS if(outside) phase = mf_eval_phase_glass(wr, lambda_r, wo, wo_outside, alpha, eta); else phase = mf_eval_phase_glass(wr, lambda_r, -wo, !wo_outside, alpha, 1.0f/eta); #else /* MF_MULTI_GLOSSY */ phase = mf_eval_phase_glossy(wr, lambda_r, wo, alpha) * throughput; #endif eval += throughput * phase * mf_G1(wo_outside? wo: -wo, mf_C1((outside == wo_outside)? hr: -hr), shadowing_lambda); } if(order+1 < 10) { /* Bounce from the microfacet. */ #ifdef MF_MULTI_GLASS bool next_outside; float3 wi_prev = -wr; float phase_rand = lcg_step_float_addrspace(lcg_state); wr = mf_sample_phase_glass(-wr, outside? eta: 1.0f/eta, wm, phase_rand, &next_outside); if(!next_outside) { outside = !outside; wr = -wr; hr = -hr; } if(use_fresnel && !next_outside) { throughput *= color; } else if(use_fresnel && order > 0) { throughput *= interpolate_fresnel_color(wi_prev, wm, eta, F0, cspec0); } #else /* MF_MULTI_GLOSSY */ if(use_fresnel && order > 0) { throughput *= interpolate_fresnel_color(-wr, wm, eta, F0, cspec0); } wr = mf_sample_phase_glossy(-wr, &throughput, wm); #endif lambda_r = mf_lambda(wr, alpha); if(!use_fresnel) throughput *= color; C1_r = mf_C1(hr); G1_r = mf_G1(wr, C1_r, lambda_r); } } if(swapped) eval *= fabsf(wi.z / wo.z); return eval; } /* Perform a random walk on the microsurface starting from wi, returning the direction in which the walk * escaped the surface in wo. The function returns the throughput between wi and wo. * Without reflection losses due to coloring or fresnel absorption in conductors, the sampling is optimal. */ ccl_device_forceinline float3 MF_FUNCTION_FULL_NAME(mf_sample)( float3 wi, float3 *wo, const float3 color, const float alpha_x, const float alpha_y, ccl_addr_space uint *lcg_state, const float eta, bool use_fresnel, const float3 cspec0) { const float2 alpha = make_float2(alpha_x, alpha_y); float3 throughput = make_float3(1.0f, 1.0f, 1.0f); float3 wr = -wi; float lambda_r = mf_lambda(wr, alpha); float hr = 1.0f; float C1_r = 1.0f; float G1_r = 0.0f; bool outside = true; float F0 = fresnel_dielectric_cos(1.0f, eta); if(use_fresnel) { throughput = interpolate_fresnel_color(wi, normalize(wi + wr), eta, F0, cspec0); } int order; for(order = 0; order < 10; order++) { /* Sample microfacet height. */ float height_rand = lcg_step_float_addrspace(lcg_state); if(!mf_sample_height(wr, &hr, &C1_r, &G1_r, &lambda_r, height_rand)) { /* The random walk has left the surface. */ *wo = outside? wr: -wr; return throughput; } /* Sample microfacet normal. */ float vndf_rand_y = lcg_step_float_addrspace(lcg_state); float vndf_rand_x = lcg_step_float_addrspace(lcg_state); float3 wm = mf_sample_vndf(-wr, alpha, vndf_rand_x, vndf_rand_y); /* First-bounce color is already accounted for in mix weight. */ if(!use_fresnel && order > 0) throughput *= color; /* Bounce from the microfacet. */ #ifdef MF_MULTI_GLASS bool next_outside; float3 wi_prev = -wr; float phase_rand = lcg_step_float_addrspace(lcg_state); wr = mf_sample_phase_glass(-wr, outside? eta: 1.0f/eta, wm, phase_rand, &next_outside); if(!next_outside) { hr = -hr; wr = -wr; outside = !outside; } if(use_fresnel) { if(!next_outside) { throughput *= color; } else { float3 t_color = interpolate_fresnel_color(wi_prev, wm, eta, F0, cspec0); if(order == 0) throughput = t_color; else throughput *= t_color; } } #else /* MF_MULTI_GLOSSY */ if(use_fresnel) { float3 t_color = interpolate_fresnel_color(-wr, wm, eta, F0, cspec0); if(order == 0) throughput = t_color; else throughput *= t_color; } wr = mf_sample_phase_glossy(-wr, &throughput, wm); #endif /* Update random walk parameters. */ lambda_r = mf_lambda(wr, alpha); G1_r = mf_G1(wr, C1_r, lambda_r); } *wo = make_float3(0.0f, 0.0f, 1.0f); return make_float3(0.0f, 0.0f, 0.0f); } #undef MF_MULTI_GLASS #undef MF_MULTI_GLOSSY #undef MF_PHASE_FUNCTION goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_oren_nayar.h000066400000000000000000000062021334742672700246350ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BSDF_OREN_NAYAR_H__ #define __BSDF_OREN_NAYAR_H__ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct OrenNayarBsdf { SHADER_CLOSURE_BASE; float roughness; float a; float b; } OrenNayarBsdf; ccl_device float3 bsdf_oren_nayar_get_intensity(const ShaderClosure *sc, float3 n, float3 v, float3 l) { const OrenNayarBsdf *bsdf = (const OrenNayarBsdf*)sc; float nl = max(dot(n, l), 0.0f); float nv = max(dot(n, v), 0.0f); float t = dot(l, v) - nl * nv; if(t > 0.0f) t /= max(nl, nv) + FLT_MIN; float is = nl * (bsdf->a + bsdf->b * t); return make_float3(is, is, is); } ccl_device int bsdf_oren_nayar_setup(OrenNayarBsdf *bsdf) { float sigma = bsdf->roughness; bsdf->type = CLOSURE_BSDF_OREN_NAYAR_ID; sigma = saturate(sigma); float div = 1.0f / (M_PI_F + ((3.0f * M_PI_F - 4.0f) / 6.0f) * sigma); bsdf->a = 1.0f * div; bsdf->b = sigma * div; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device bool bsdf_oren_nayar_merge(const ShaderClosure *a, const ShaderClosure *b) { const OrenNayarBsdf *bsdf_a = (const OrenNayarBsdf*)a; const OrenNayarBsdf *bsdf_b = (const OrenNayarBsdf*)b; return (isequal_float3(bsdf_a->N, bsdf_b->N)) && (bsdf_a->roughness == bsdf_b->roughness); } ccl_device float3 bsdf_oren_nayar_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const OrenNayarBsdf *bsdf = (const OrenNayarBsdf*)sc; if(dot(bsdf->N, omega_in) > 0.0f) { *pdf = 0.5f * M_1_PI_F; return bsdf_oren_nayar_get_intensity(sc, bsdf->N, I, omega_in); } else { *pdf = 0.0f; return make_float3(0.0f, 0.0f, 0.0f); } } ccl_device float3 bsdf_oren_nayar_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_oren_nayar_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const OrenNayarBsdf *bsdf = (const OrenNayarBsdf*)sc; sample_uniform_hemisphere(bsdf->N, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0.0f) { *eval = bsdf_oren_nayar_get_intensity(sc, bsdf->N, I, *omega_in); #ifdef __RAY_DIFFERENTIALS__ // TODO: find a better approximation for the bounce *domega_in_dx = (2.0f * dot(bsdf->N, dIdx)) * bsdf->N - dIdx; *domega_in_dy = (2.0f * dot(bsdf->N, dIdy)) * bsdf->N - dIdy; #endif } else { *pdf = 0.0f; *eval = make_float3(0.0f, 0.0f, 0.0f); } return LABEL_REFLECT|LABEL_DIFFUSE; } CCL_NAMESPACE_END #endif /* __BSDF_OREN_NAYAR_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_phong_ramp.h000066400000000000000000000115011334742672700246300ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2012, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_PHONG_RAMP_H__ #define __BSDF_PHONG_RAMP_H__ CCL_NAMESPACE_BEGIN #ifdef __OSL__ typedef ccl_addr_space struct PhongRampBsdf { SHADER_CLOSURE_BASE; float exponent; float3 *colors; } PhongRampBsdf; ccl_device float3 bsdf_phong_ramp_get_color(const float3 colors[8], float pos) { int MAXCOLORS = 8; float npos = pos * (float)(MAXCOLORS - 1); int ipos = float_to_int(npos); if(ipos < 0) return colors[0]; if(ipos >= (MAXCOLORS - 1)) return colors[MAXCOLORS - 1]; float offset = npos - (float)ipos; return colors[ipos] * (1.0f - offset) + colors[ipos+1] * offset; } ccl_device int bsdf_phong_ramp_setup(PhongRampBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_PHONG_RAMP_ID; bsdf->exponent = max(bsdf->exponent, 0.0f); return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device float3 bsdf_phong_ramp_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const PhongRampBsdf *bsdf = (const PhongRampBsdf*)sc; float m_exponent = bsdf->exponent; float cosNI = dot(bsdf->N, omega_in); float cosNO = dot(bsdf->N, I); if(cosNI > 0 && cosNO > 0) { // reflect the view vector float3 R = (2 * cosNO) * bsdf->N - I; float cosRI = dot(R, omega_in); if(cosRI > 0) { float cosp = powf(cosRI, m_exponent); float common = 0.5f * M_1_PI_F * cosp; float out = cosNI * (m_exponent + 2) * common; *pdf = (m_exponent + 1) * common; return bsdf_phong_ramp_get_color(bsdf->colors, cosp) * out; } } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_phong_ramp_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_phong_ramp_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const PhongRampBsdf *bsdf = (const PhongRampBsdf*)sc; float cosNO = dot(bsdf->N, I); float m_exponent = bsdf->exponent; if(cosNO > 0) { // reflect the view vector float3 R = (2 * cosNO) * bsdf->N - I; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(bsdf->N, dIdx)) * bsdf->N - dIdx; *domega_in_dy = (2 * dot(bsdf->N, dIdy)) * bsdf->N - dIdy; #endif float3 T, B; make_orthonormals (R, &T, &B); float phi = M_2PI_F * randu; float cosTheta = powf(randv, 1 / (m_exponent + 1)); float sinTheta2 = 1 - cosTheta * cosTheta; float sinTheta = sinTheta2 > 0 ? sqrtf(sinTheta2) : 0; *omega_in = (cosf(phi) * sinTheta) * T + (sinf(phi) * sinTheta) * B + ( cosTheta) * R; if(dot(Ng, *omega_in) > 0.0f) { // common terms for pdf and eval float cosNI = dot(bsdf->N, *omega_in); // make sure the direction we chose is still in the right hemisphere if(cosNI > 0) { float cosp = powf(cosTheta, m_exponent); float common = 0.5f * M_1_PI_F * cosp; *pdf = (m_exponent + 1) * common; float out = cosNI * (m_exponent + 2) * common; *eval = bsdf_phong_ramp_get_color(bsdf->colors, cosp) * out; } } } return LABEL_REFLECT|LABEL_GLOSSY; } #endif /* __OSL__ */ CCL_NAMESPACE_END #endif /* __BSDF_PHONG_RAMP_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_principled_diffuse.h000066400000000000000000000071231334742672700263410ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BSDF_PRINCIPLED_DIFFUSE_H__ #define __BSDF_PRINCIPLED_DIFFUSE_H__ /* DISNEY PRINCIPLED DIFFUSE BRDF * * Shading model by Brent Burley (Disney): "Physically Based Shading at Disney" (2012) */ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct PrincipledDiffuseBsdf { SHADER_CLOSURE_BASE; float roughness; } PrincipledDiffuseBsdf; ccl_device float3 calculate_principled_diffuse_brdf(const PrincipledDiffuseBsdf *bsdf, float3 N, float3 V, float3 L, float3 H, float *pdf) { float NdotL = max(dot(N, L), 0.0f); float NdotV = max(dot(N, V), 0.0f); if(NdotL < 0 || NdotV < 0) { *pdf = 0.0f; return make_float3(0.0f, 0.0f, 0.0f); } float LdotH = dot(L, H); float FL = schlick_fresnel(NdotL), FV = schlick_fresnel(NdotV); const float Fd90 = 0.5f + 2.0f * LdotH*LdotH * bsdf->roughness; float Fd = (1.0f * (1.0f - FL) + Fd90 * FL) * (1.0f * (1.0f - FV) + Fd90 * FV); float value = M_1_PI_F * NdotL * Fd; return make_float3(value, value, value); } ccl_device int bsdf_principled_diffuse_setup(PrincipledDiffuseBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device bool bsdf_principled_diffuse_merge(const ShaderClosure *a, const ShaderClosure *b) { const PrincipledDiffuseBsdf *bsdf_a = (const PrincipledDiffuseBsdf*)a; const PrincipledDiffuseBsdf *bsdf_b = (const PrincipledDiffuseBsdf*)b; return (isequal_float3(bsdf_a->N, bsdf_b->N) && bsdf_a->roughness == bsdf_b->roughness); } ccl_device float3 bsdf_principled_diffuse_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const PrincipledDiffuseBsdf *bsdf = (const PrincipledDiffuseBsdf *)sc; float3 N = bsdf->N; float3 V = I; // outgoing float3 L = omega_in; // incoming float3 H = normalize(L + V); if(dot(N, omega_in) > 0.0f) { *pdf = fmaxf(dot(N, omega_in), 0.0f) * M_1_PI_F; return calculate_principled_diffuse_brdf(bsdf, N, V, L, H, pdf); } else { *pdf = 0.0f; return make_float3(0.0f, 0.0f, 0.0f); } } ccl_device float3 bsdf_principled_diffuse_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_principled_diffuse_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const PrincipledDiffuseBsdf *bsdf = (const PrincipledDiffuseBsdf *)sc; float3 N = bsdf->N; sample_cos_hemisphere(N, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0) { float3 H = normalize(I + *omega_in); *eval = calculate_principled_diffuse_brdf(bsdf, N, I, *omega_in, H, pdf); #ifdef __RAY_DIFFERENTIALS__ // TODO: find a better approximation for the diffuse bounce *domega_in_dx = -((2 * dot(N, dIdx)) * N - dIdx); *domega_in_dy = -((2 * dot(N, dIdy)) * N - dIdy); #endif } else { *pdf = 0.0f; } return LABEL_REFLECT|LABEL_DIFFUSE; } CCL_NAMESPACE_END #endif /* __BSDF_PRINCIPLED_DIFFUSE_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_principled_sheen.h000066400000000000000000000057511334742672700260230ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BSDF_PRINCIPLED_SHEEN_H__ #define __BSDF_PRINCIPLED_SHEEN_H__ /* DISNEY PRINCIPLED SHEEN BRDF * * Shading model by Brent Burley (Disney): "Physically Based Shading at Disney" (2012) */ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct PrincipledSheenBsdf { SHADER_CLOSURE_BASE; } PrincipledSheenBsdf; ccl_device float3 calculate_principled_sheen_brdf(const PrincipledSheenBsdf *bsdf, float3 N, float3 V, float3 L, float3 H, float *pdf) { float NdotL = dot(N, L); float NdotV = dot(N, V); if(NdotL < 0 || NdotV < 0) { *pdf = 0.0f; return make_float3(0.0f, 0.0f, 0.0f); } float LdotH = dot(L, H); float value = schlick_fresnel(LdotH) * NdotL; return make_float3(value, value, value); } ccl_device int bsdf_principled_sheen_setup(PrincipledSheenBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_PRINCIPLED_SHEEN_ID; return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device float3 bsdf_principled_sheen_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const PrincipledSheenBsdf *bsdf = (const PrincipledSheenBsdf *)sc; float3 N = bsdf->N; float3 V = I; // outgoing float3 L = omega_in; // incoming float3 H = normalize(L + V); if(dot(N, omega_in) > 0.0f) { *pdf = fmaxf(dot(N, omega_in), 0.0f) * M_1_PI_F; return calculate_principled_sheen_brdf(bsdf, N, V, L, H, pdf); } else { *pdf = 0.0f; return make_float3(0.0f, 0.0f, 0.0f); } } ccl_device float3 bsdf_principled_sheen_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_principled_sheen_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const PrincipledSheenBsdf *bsdf = (const PrincipledSheenBsdf *)sc; float3 N = bsdf->N; sample_cos_hemisphere(N, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0) { float3 H = normalize(I + *omega_in); *eval = calculate_principled_sheen_brdf(bsdf, N, I, *omega_in, H, pdf); #ifdef __RAY_DIFFERENTIALS__ // TODO: find a better approximation for the diffuse bounce *domega_in_dx = -((2 * dot(N, dIdx)) * N - dIdx); *domega_in_dy = -((2 * dot(N, dIdy)) * N - dIdy); #endif } else { *pdf = 0.0f; } return LABEL_REFLECT|LABEL_DIFFUSE; } CCL_NAMESPACE_END #endif /* __BSDF_PRINCIPLED_SHEEN_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_reflection.h000066400000000000000000000057531334742672700246440ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_REFLECTION_H__ #define __BSDF_REFLECTION_H__ CCL_NAMESPACE_BEGIN /* REFLECTION */ ccl_device int bsdf_reflection_setup(MicrofacetBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_REFLECTION_ID; return SD_BSDF; } ccl_device float3 bsdf_reflection_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_reflection_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_reflection_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float3 N = bsdf->N; // only one direction is possible float cosNO = dot(N, I); if(cosNO > 0) { *omega_in = (2 * cosNO) * N - I; if(dot(Ng, *omega_in) > 0) { #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = 2 * dot(N, dIdx) * N - dIdx; *domega_in_dy = 2 * dot(N, dIdy) * N - dIdy; #endif /* Some high number for MIS. */ *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); } } return LABEL_REFLECT|LABEL_SINGULAR; } CCL_NAMESPACE_END #endif /* __BSDF_REFLECTION_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_refraction.h000066400000000000000000000061601334742672700246370ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_REFRACTION_H__ #define __BSDF_REFRACTION_H__ CCL_NAMESPACE_BEGIN /* REFRACTION */ ccl_device int bsdf_refraction_setup(MicrofacetBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_REFRACTION_ID; return SD_BSDF; } ccl_device float3 bsdf_refraction_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_refraction_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_refraction_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const MicrofacetBsdf *bsdf = (const MicrofacetBsdf*)sc; float m_eta = bsdf->ior; float3 N = bsdf->N; float3 R, T; #ifdef __RAY_DIFFERENTIALS__ float3 dRdx, dRdy, dTdx, dTdy; #endif bool inside; float fresnel; fresnel = fresnel_dielectric(m_eta, N, I, &R, &T, #ifdef __RAY_DIFFERENTIALS__ dIdx, dIdy, &dRdx, &dRdy, &dTdx, &dTdy, #endif &inside); if(!inside && fresnel != 1.0f) { /* Some high number for MIS. */ *pdf = 1e6f; *eval = make_float3(1e6f, 1e6f, 1e6f); *omega_in = T; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = dTdx; *domega_in_dy = dTdy; #endif } return LABEL_TRANSMIT|LABEL_SINGULAR; } CCL_NAMESPACE_END #endif /* __BSDF_REFRACTION_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_toon.h000066400000000000000000000154651334742672700234720ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_TOON_H__ #define __BSDF_TOON_H__ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct ToonBsdf { SHADER_CLOSURE_BASE; float size; float smooth; } ToonBsdf; /* DIFFUSE TOON */ ccl_device int bsdf_diffuse_toon_setup(ToonBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_DIFFUSE_TOON_ID; bsdf->size = saturate(bsdf->size); bsdf->smooth = saturate(bsdf->smooth); return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device bool bsdf_toon_merge(const ShaderClosure *a, const ShaderClosure *b) { const ToonBsdf *bsdf_a = (const ToonBsdf*)a; const ToonBsdf *bsdf_b = (const ToonBsdf*)b; return (isequal_float3(bsdf_a->N, bsdf_b->N)) && (bsdf_a->size == bsdf_b->size) && (bsdf_a->smooth == bsdf_b->smooth); } ccl_device float3 bsdf_toon_get_intensity(float max_angle, float smooth, float angle) { float is; if(angle < max_angle) is = 1.0f; else if(angle < (max_angle + smooth) && smooth != 0.0f) is = (1.0f - (angle - max_angle)/smooth); else is = 0.0f; return make_float3(is, is, is); } ccl_device float bsdf_toon_get_sample_angle(float max_angle, float smooth) { return fminf(max_angle + smooth, M_PI_2_F); } ccl_device float3 bsdf_diffuse_toon_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const ToonBsdf *bsdf = (const ToonBsdf*)sc; float max_angle = bsdf->size*M_PI_2_F; float smooth = bsdf->smooth*M_PI_2_F; float angle = safe_acosf(fmaxf(dot(bsdf->N, omega_in), 0.0f)); float3 eval = bsdf_toon_get_intensity(max_angle, smooth, angle); if(eval.x > 0.0f) { float sample_angle = bsdf_toon_get_sample_angle(max_angle, smooth); *pdf = 0.5f * M_1_PI_F / (1.0f - cosf(sample_angle)); return *pdf * eval; } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_diffuse_toon_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_diffuse_toon_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const ToonBsdf *bsdf = (const ToonBsdf*)sc; float max_angle = bsdf->size*M_PI_2_F; float smooth = bsdf->smooth*M_PI_2_F; float sample_angle = bsdf_toon_get_sample_angle(max_angle, smooth); float angle = sample_angle*randu; if(sample_angle > 0.0f) { sample_uniform_cone(bsdf->N, sample_angle, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0.0f) { *eval = *pdf * bsdf_toon_get_intensity(max_angle, smooth, angle); #ifdef __RAY_DIFFERENTIALS__ // TODO: find a better approximation for the bounce *domega_in_dx = (2.0f * dot(bsdf->N, dIdx)) * bsdf->N - dIdx; *domega_in_dy = (2.0f * dot(bsdf->N, dIdy)) * bsdf->N - dIdy; #endif } else *pdf = 0.0f; } return LABEL_REFLECT | LABEL_DIFFUSE; } /* GLOSSY TOON */ ccl_device int bsdf_glossy_toon_setup(ToonBsdf *bsdf) { bsdf->type = CLOSURE_BSDF_GLOSSY_TOON_ID; bsdf->size = saturate(bsdf->size); bsdf->smooth = saturate(bsdf->smooth); return SD_BSDF|SD_BSDF_HAS_EVAL; } ccl_device float3 bsdf_glossy_toon_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { const ToonBsdf *bsdf = (const ToonBsdf*)sc; float max_angle = bsdf->size*M_PI_2_F; float smooth = bsdf->smooth*M_PI_2_F; float cosNI = dot(bsdf->N, omega_in); float cosNO = dot(bsdf->N, I); if(cosNI > 0 && cosNO > 0) { /* reflect the view vector */ float3 R = (2 * cosNO) * bsdf->N - I; float cosRI = dot(R, omega_in); float angle = safe_acosf(fmaxf(cosRI, 0.0f)); float3 eval = bsdf_toon_get_intensity(max_angle, smooth, angle); float sample_angle = bsdf_toon_get_sample_angle(max_angle, smooth); *pdf = 0.5f * M_1_PI_F / (1.0f - cosf(sample_angle)); return *pdf * eval; } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_glossy_toon_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_glossy_toon_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const ToonBsdf *bsdf = (const ToonBsdf*)sc; float max_angle = bsdf->size*M_PI_2_F; float smooth = bsdf->smooth*M_PI_2_F; float cosNO = dot(bsdf->N, I); if(cosNO > 0) { /* reflect the view vector */ float3 R = (2 * cosNO) * bsdf->N - I; float sample_angle = bsdf_toon_get_sample_angle(max_angle, smooth); float angle = sample_angle*randu; sample_uniform_cone(R, sample_angle, randu, randv, omega_in, pdf); if(dot(Ng, *omega_in) > 0.0f) { float cosNI = dot(bsdf->N, *omega_in); /* make sure the direction we chose is still in the right hemisphere */ if(cosNI > 0) { *eval = *pdf * bsdf_toon_get_intensity(max_angle, smooth, angle); #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = (2 * dot(bsdf->N, dIdx)) * bsdf->N - dIdx; *domega_in_dy = (2 * dot(bsdf->N, dIdy)) * bsdf->N - dIdy; #endif } else *pdf = 0.0f; } else *pdf = 0.0f; } return LABEL_GLOSSY | LABEL_REFLECT; } CCL_NAMESPACE_END #endif /* __BSDF_TOON_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_transparent.h000066400000000000000000000067351334742672700250540ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_TRANSPARENT_H__ #define __BSDF_TRANSPARENT_H__ CCL_NAMESPACE_BEGIN ccl_device void bsdf_transparent_setup(ShaderData *sd, const float3 weight, int path_flag) { if(sd->flag & SD_TRANSPARENT) { sd->closure_transparent_extinction += weight; for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(sc->type == CLOSURE_BSDF_TRANSPARENT_ID) { sc->weight += weight; sc->sample_weight += fabsf(average(weight)); break; } } } else { sd->flag |= SD_BSDF|SD_TRANSPARENT; sd->closure_transparent_extinction = weight; if(path_flag & PATH_RAY_TERMINATE) { /* In this case the number of closures is set to zero to disable * all others, but we still want to get transparency so increase * the number just for this. */ sd->num_closure_left = 1; } ShaderClosure *bsdf = bsdf_alloc(sd, sizeof(ShaderClosure), weight); if(bsdf) { bsdf->N = sd->N; bsdf->type = CLOSURE_BSDF_TRANSPARENT_ID; } } } ccl_device float3 bsdf_transparent_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device float3 bsdf_transparent_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { return make_float3(0.0f, 0.0f, 0.0f); } ccl_device int bsdf_transparent_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { // only one direction is possible *omega_in = -I; #ifdef __RAY_DIFFERENTIALS__ *domega_in_dx = -dIdx; *domega_in_dy = -dIdy; #endif *pdf = 1; *eval = make_float3(1, 1, 1); return LABEL_TRANSMIT|LABEL_TRANSPARENT; } CCL_NAMESPACE_END #endif /* __BSDF_TRANSPARENT_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bsdf_util.h000066400000000000000000000124241334742672700234600ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __BSDF_UTIL_H__ #define __BSDF_UTIL_H__ CCL_NAMESPACE_BEGIN ccl_device float fresnel_dielectric( float eta, const float3 N, const float3 I, float3 *R, float3 *T, #ifdef __RAY_DIFFERENTIALS__ const float3 dIdx, const float3 dIdy, float3 *dRdx, float3 *dRdy, float3 *dTdx, float3 *dTdy, #endif bool *is_inside) { float cos = dot(N, I), neta; float3 Nn; // check which side of the surface we are on if(cos > 0) { // we are on the outside of the surface, going in neta = 1 / eta; Nn = N; *is_inside = false; } else { // we are inside the surface cos = -cos; neta = eta; Nn = -N; *is_inside = true; } // compute reflection *R = (2 * cos)* Nn - I; #ifdef __RAY_DIFFERENTIALS__ *dRdx = (2 * dot(Nn, dIdx)) * Nn - dIdx; *dRdy = (2 * dot(Nn, dIdy)) * Nn - dIdy; #endif float arg = 1 -(neta * neta *(1 -(cos * cos))); if(arg < 0) { *T = make_float3(0.0f, 0.0f, 0.0f); #ifdef __RAY_DIFFERENTIALS__ *dTdx = make_float3(0.0f, 0.0f, 0.0f); *dTdy = make_float3(0.0f, 0.0f, 0.0f); #endif return 1; // total internal reflection } else { float dnp = max(sqrtf(arg), 1e-7f); float nK = (neta * cos)- dnp; *T = -(neta * I)+(nK * Nn); #ifdef __RAY_DIFFERENTIALS__ *dTdx = -(neta * dIdx) + ((neta - neta * neta * cos / dnp) * dot(dIdx, Nn)) * Nn; *dTdy = -(neta * dIdy) + ((neta - neta * neta * cos / dnp) * dot(dIdy, Nn)) * Nn; #endif // compute Fresnel terms float cosTheta1 = cos; // N.R float cosTheta2 = -dot(Nn, *T); float pPara = (cosTheta1 - eta * cosTheta2)/(cosTheta1 + eta * cosTheta2); float pPerp = (eta * cosTheta1 - cosTheta2)/(eta * cosTheta1 + cosTheta2); return 0.5f * (pPara * pPara + pPerp * pPerp); } } ccl_device float fresnel_dielectric_cos(float cosi, float eta) { // compute fresnel reflectance without explicitly computing // the refracted direction float c = fabsf(cosi); float g = eta * eta - 1 + c * c; if(g > 0) { g = sqrtf(g); float A = (g - c)/(g + c); float B = (c *(g + c)- 1)/(c *(g - c)+ 1); return 0.5f * A * A *(1 + B * B); } return 1.0f; // TIR(no refracted component) } ccl_device float3 fresnel_conductor(float cosi, const float3 eta, const float3 k) { float3 cosi2 = make_float3(cosi*cosi, cosi*cosi, cosi*cosi); float3 one = make_float3(1.0f, 1.0f, 1.0f); float3 tmp_f = eta * eta + k * k; float3 tmp = tmp_f * cosi2; float3 Rparl2 = (tmp - (2.0f * eta * cosi) + one) / (tmp + (2.0f * eta * cosi) + one); float3 Rperp2 = (tmp_f - (2.0f * eta * cosi) + cosi2) / (tmp_f + (2.0f * eta * cosi) + cosi2); return(Rparl2 + Rperp2) * 0.5f; } ccl_device float schlick_fresnel(float u) { float m = clamp(1.0f - u, 0.0f, 1.0f); float m2 = m * m; return m2 * m2 * m; // pow(m, 5) } ccl_device float smooth_step(float edge0, float edge1, float x) { float result; if(x < edge0) result = 0.0f; else if(x >= edge1) result = 1.0f; else { float t = (x - edge0)/(edge1 - edge0); result = (3.0f-2.0f*t)*(t*t); } return result; } /* Calculate the fresnel color which is a blend between white and the F0 color (cspec0) */ ccl_device_forceinline float3 interpolate_fresnel_color(float3 L, float3 H, float ior, float F0, float3 cspec0) { /* Calculate the fresnel interpolation factor * The value from fresnel_dielectric_cos(...) has to be normalized because * the cspec0 keeps the F0 color */ float F0_norm = 1.0f / (1.0f - F0); float FH = (fresnel_dielectric_cos(dot(L, H), ior) - F0) * F0_norm; /* Blend between white and a specular color with respect to the fresnel */ return cspec0 * (1.0f - FH) + make_float3(1.0f, 1.0f, 1.0f) * FH; } CCL_NAMESPACE_END #endif /* __BSDF_UTIL_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/bssrdf.h000066400000000000000000000325671334742672700230020ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_BSSRDF_H__ #define __KERNEL_BSSRDF_H__ CCL_NAMESPACE_BEGIN typedef ccl_addr_space struct Bssrdf { SHADER_CLOSURE_BASE; float3 radius; float3 albedo; float sharpness; float texture_blur; float roughness; float channels; } Bssrdf; /* Planar Truncated Gaussian * * Note how this is different from the typical gaussian, this one integrates * to 1 over the plane (where you get an extra 2*pi*x factor). We are lucky * that integrating x*exp(-x) gives a nice closed form solution. */ /* paper suggests 1/12.46 which is much too small, suspect it's *12.46 */ #define GAUSS_TRUNCATE 12.46f ccl_device float bssrdf_gaussian_eval(const float radius, float r) { /* integrate (2*pi*r * exp(-r*r/(2*v)))/(2*pi*v)) from 0 to Rm * = 1 - exp(-Rm*Rm/(2*v)) */ const float v = radius*radius*(0.25f*0.25f); const float Rm = sqrtf(v*GAUSS_TRUNCATE); if(r >= Rm) return 0.0f; return expf(-r*r/(2.0f*v))/(2.0f*M_PI_F*v); } ccl_device float bssrdf_gaussian_pdf(const float radius, float r) { /* 1.0 - expf(-Rm*Rm/(2*v)) simplified */ const float area_truncated = 1.0f - expf(-0.5f*GAUSS_TRUNCATE); return bssrdf_gaussian_eval(radius, r) * (1.0f/(area_truncated)); } ccl_device void bssrdf_gaussian_sample(const float radius, float xi, float *r, float *h) { /* xi = integrate (2*pi*r * exp(-r*r/(2*v)))/(2*pi*v)) = -exp(-r^2/(2*v)) * r = sqrt(-2*v*logf(xi)) */ const float v = radius*radius*(0.25f*0.25f); const float Rm = sqrtf(v*GAUSS_TRUNCATE); /* 1.0 - expf(-Rm*Rm/(2*v)) simplified */ const float area_truncated = 1.0f - expf(-0.5f*GAUSS_TRUNCATE); /* r(xi) */ const float r_squared = -2.0f*v*logf(1.0f - xi*area_truncated); *r = sqrtf(r_squared); /* h^2 + r^2 = Rm^2 */ *h = safe_sqrtf(Rm*Rm - r_squared); } /* Planar Cubic BSSRDF falloff * * This is basically (Rm - x)^3, with some factors to normalize it. For sampling * we integrate 2*pi*x * (Rm - x)^3, which gives us a quintic equation that as * far as I can tell has no closed form solution. So we get an iterative solution * instead with newton-raphson. */ ccl_device float bssrdf_cubic_eval(const float radius, const float sharpness, float r) { if(sharpness == 0.0f) { const float Rm = radius; if(r >= Rm) return 0.0f; /* integrate (2*pi*r * 10*(R - r)^3)/(pi * R^5) from 0 to R = 1 */ const float Rm5 = (Rm*Rm) * (Rm*Rm) * Rm; const float f = Rm - r; const float num = f*f*f; return (10.0f * num) / (Rm5 * M_PI_F); } else { float Rm = radius*(1.0f + sharpness); if(r >= Rm) return 0.0f; /* custom variation with extra sharpness, to match the previous code */ const float y = 1.0f/(1.0f + sharpness); float Rmy, ry, ryinv; if(sharpness == 1.0f) { Rmy = sqrtf(Rm); ry = sqrtf(r); ryinv = (ry > 0.0f)? 1.0f/ry: 0.0f; } else { Rmy = powf(Rm, y); ry = powf(r, y); ryinv = (r > 0.0f)? powf(r, y - 1.0f): 0.0f; } const float Rmy5 = (Rmy*Rmy) * (Rmy*Rmy) * Rmy; const float f = Rmy - ry; const float num = f*(f*f)*(y*ryinv); return (10.0f * num) / (Rmy5 * M_PI_F); } } ccl_device float bssrdf_cubic_pdf(const float radius, const float sharpness, float r) { return bssrdf_cubic_eval(radius, sharpness, r); } /* solve 10x^2 - 20x^3 + 15x^4 - 4x^5 - xi == 0 */ ccl_device_forceinline float bssrdf_cubic_quintic_root_find(float xi) { /* newton-raphson iteration, usually succeeds in 2-4 iterations, except * outside 0.02 ... 0.98 where it can go up to 10, so overall performance * should not be too bad */ const float tolerance = 1e-6f; const int max_iteration_count = 10; float x = 0.25f; int i; for(i = 0; i < max_iteration_count; i++) { float x2 = x*x; float x3 = x2*x; float nx = (1.0f - x); float f = 10.0f*x2 - 20.0f*x3 + 15.0f*x2*x2 - 4.0f*x2*x3 - xi; float f_ = 20.0f*(x*nx)*(nx*nx); if(fabsf(f) < tolerance || f_ == 0.0f) break; x = saturate(x - f/f_); } return x; } ccl_device void bssrdf_cubic_sample(const float radius, const float sharpness, float xi, float *r, float *h) { float Rm = radius; float r_ = bssrdf_cubic_quintic_root_find(xi); if(sharpness != 0.0f) { r_ = powf(r_, 1.0f + sharpness); Rm *= (1.0f + sharpness); } r_ *= Rm; *r = r_; /* h^2 + r^2 = Rm^2 */ *h = safe_sqrtf(Rm*Rm - r_*r_); } /* Approximate Reflectance Profiles * http://graphics.pixar.com/library/ApproxBSSRDF/paper.pdf */ /* This is a bit arbitrary, just need big enough radius so it matches * the mean free length, but still not too big so sampling is still * effective. Might need some further tweaks. */ #define BURLEY_TRUNCATE 16.0f #define BURLEY_TRUNCATE_CDF 0.9963790093708328f // cdf(BURLEY_TRUNCATE) ccl_device_inline float bssrdf_burley_fitting(float A) { /* Diffuse surface transmission, equation (6). */ return 1.9f - A + 3.5f * (A - 0.8f) * (A - 0.8f); } /* Scale mean free path length so it gives similar looking result * to Cubic and Gaussian models. */ ccl_device_inline float3 bssrdf_burley_compatible_mfp(float3 r) { return 0.25f * M_1_PI_F * r; } ccl_device void bssrdf_burley_setup(Bssrdf *bssrdf) { /* Mean free path length. */ const float3 l = bssrdf_burley_compatible_mfp(bssrdf->radius); /* Surface albedo. */ const float3 A = bssrdf->albedo; const float3 s = make_float3(bssrdf_burley_fitting(A.x), bssrdf_burley_fitting(A.y), bssrdf_burley_fitting(A.z)); bssrdf->radius = l / s; } ccl_device float bssrdf_burley_eval(const float d, float r) { const float Rm = BURLEY_TRUNCATE * d; if(r >= Rm) return 0.0f; /* Burley refletance profile, equation (3). * * NOTES: * - Surface albedo is already included into sc->weight, no need to * multiply by this term here. * - This is normalized diffuse model, so the equation is mutliplied * by 2*pi, which also matches cdf(). */ float exp_r_3_d = expf(-r / (3.0f * d)); float exp_r_d = exp_r_3_d * exp_r_3_d * exp_r_3_d; return (exp_r_d + exp_r_3_d) / (4.0f*d); } ccl_device float bssrdf_burley_pdf(const float d, float r) { return bssrdf_burley_eval(d, r) * (1.0f/BURLEY_TRUNCATE_CDF); } /* Find the radius for desired CDF value. * Returns scaled radius, meaning the result is to be scaled up by d. * Since there's no closed form solution we do Newton-Raphson method to find it. */ ccl_device_forceinline float bssrdf_burley_root_find(float xi) { const float tolerance = 1e-6f; const int max_iteration_count = 10; /* Do initial guess based on manual curve fitting, this allows us to reduce * number of iterations to maximum 4 across the [0..1] range. We keep maximum * number of iteration higher just to be sure we didn't miss root in some * corner case. */ float r; if(xi <= 0.9f) { r = expf(xi * xi * 2.4f) - 1.0f; } else { /* TODO(sergey): Some nicer curve fit is possible here. */ r = 15.0f; } /* Solve against scaled radius. */ for(int i = 0; i < max_iteration_count; i++) { float exp_r_3 = expf(-r / 3.0f); float exp_r = exp_r_3 * exp_r_3 * exp_r_3; float f = 1.0f - 0.25f * exp_r - 0.75f * exp_r_3 - xi; float f_ = 0.25f * exp_r + 0.25f * exp_r_3; if(fabsf(f) < tolerance || f_ == 0.0f) { break; } r = r - f/f_; if(r < 0.0f) { r = 0.0f; } } return r; } ccl_device void bssrdf_burley_sample(const float d, float xi, float *r, float *h) { const float Rm = BURLEY_TRUNCATE * d; const float r_ = bssrdf_burley_root_find(xi * BURLEY_TRUNCATE_CDF) * d; *r = r_; /* h^2 + r^2 = Rm^2 */ *h = safe_sqrtf(Rm*Rm - r_*r_); } /* None BSSRDF falloff * * Samples distributed over disk with no falloff, for reference. */ ccl_device float bssrdf_none_eval(const float radius, float r) { const float Rm = radius; return (r < Rm)? 1.0f: 0.0f; } ccl_device float bssrdf_none_pdf(const float radius, float r) { /* integrate (2*pi*r)/(pi*Rm*Rm) from 0 to Rm = 1 */ const float Rm = radius; const float area = (M_PI_F*Rm*Rm); return bssrdf_none_eval(radius, r) / area; } ccl_device void bssrdf_none_sample(const float radius, float xi, float *r, float *h) { /* xi = integrate (2*pi*r)/(pi*Rm*Rm) = r^2/Rm^2 * r = sqrt(xi)*Rm */ const float Rm = radius; const float r_ = sqrtf(xi)*Rm; *r = r_; /* h^2 + r^2 = Rm^2 */ *h = safe_sqrtf(Rm*Rm - r_*r_); } /* Generic */ ccl_device_inline Bssrdf *bssrdf_alloc(ShaderData *sd, float3 weight) { Bssrdf *bssrdf = (Bssrdf*)closure_alloc(sd, sizeof(Bssrdf), CLOSURE_NONE_ID, weight); if(bssrdf == NULL) { return NULL; } float sample_weight = fabsf(average(weight)); bssrdf->sample_weight = sample_weight; return (sample_weight >= CLOSURE_WEIGHT_CUTOFF) ? bssrdf : NULL; } ccl_device int bssrdf_setup(ShaderData *sd, Bssrdf *bssrdf, ClosureType type) { int flag = 0; int bssrdf_channels = 3; float3 diffuse_weight = make_float3(0.0f, 0.0f, 0.0f); /* Verify if the radii are large enough to sample without precision issues. */ if(bssrdf->radius.x < BSSRDF_MIN_RADIUS) { diffuse_weight.x = bssrdf->weight.x; bssrdf->weight.x = 0.0f; bssrdf->radius.x = 0.0f; bssrdf_channels--; } if(bssrdf->radius.y < BSSRDF_MIN_RADIUS) { diffuse_weight.y = bssrdf->weight.y; bssrdf->weight.y = 0.0f; bssrdf->radius.y = 0.0f; bssrdf_channels--; } if(bssrdf->radius.z < BSSRDF_MIN_RADIUS) { diffuse_weight.z = bssrdf->weight.z; bssrdf->weight.z = 0.0f; bssrdf->radius.z = 0.0f; bssrdf_channels--; } if(bssrdf_channels < 3) { /* Add diffuse BSDF if any radius too small. */ #ifdef __PRINCIPLED__ if(type == CLOSURE_BSSRDF_PRINCIPLED_ID || type == CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID) { float roughness = bssrdf->roughness; float3 N = bssrdf->N; PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf*)bsdf_alloc(sd, sizeof(PrincipledDiffuseBsdf), diffuse_weight); if(bsdf) { bsdf->type = CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID; bsdf->N = N; bsdf->roughness = roughness; flag |= bsdf_principled_diffuse_setup(bsdf); } } else #endif /* __PRINCIPLED__ */ { DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd, sizeof(DiffuseBsdf), diffuse_weight); if(bsdf) { bsdf->type = CLOSURE_BSDF_BSSRDF_ID; bsdf->N = bssrdf->N; flag |= bsdf_diffuse_setup(bsdf); } } } /* Setup BSSRDF if radius is large enough. */ if(bssrdf_channels > 0) { bssrdf->type = type; bssrdf->channels = bssrdf_channels; bssrdf->sample_weight = fabsf(average(bssrdf->weight)) * bssrdf->channels; bssrdf->texture_blur = saturate(bssrdf->texture_blur); bssrdf->sharpness = saturate(bssrdf->sharpness); if(type == CLOSURE_BSSRDF_BURLEY_ID || type == CLOSURE_BSSRDF_PRINCIPLED_ID || type == CLOSURE_BSSRDF_RANDOM_WALK_ID || type == CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID) { bssrdf_burley_setup(bssrdf); } flag |= SD_BSSRDF; } else { bssrdf->type = type; bssrdf->sample_weight = 0.0f; } return flag; } ccl_device void bssrdf_sample(const ShaderClosure *sc, float xi, float *r, float *h) { const Bssrdf *bssrdf = (const Bssrdf*)sc; float radius; /* Sample color channel and reuse random number. Only a subset of channels * may be used if their radius was too small to handle as BSSRDF. */ xi *= bssrdf->channels; if(xi < 1.0f) { radius = (bssrdf->radius.x > 0.0f)? bssrdf->radius.x: (bssrdf->radius.y > 0.0f)? bssrdf->radius.y: bssrdf->radius.z; } else if(xi < 2.0f) { xi -= 1.0f; radius = (bssrdf->radius.x > 0.0f)? bssrdf->radius.y: bssrdf->radius.z; } else { xi -= 2.0f; radius = bssrdf->radius.z; } /* Sample BSSRDF. */ if(bssrdf->type == CLOSURE_BSSRDF_CUBIC_ID) { bssrdf_cubic_sample(radius, bssrdf->sharpness, xi, r, h); } else if(bssrdf->type == CLOSURE_BSSRDF_GAUSSIAN_ID){ bssrdf_gaussian_sample(radius, xi, r, h); } else { /*if(bssrdf->type == CLOSURE_BSSRDF_BURLEY_ID || bssrdf->type == CLOSURE_BSSRDF_PRINCIPLED_ID)*/ bssrdf_burley_sample(radius, xi, r, h); } } ccl_device float bssrdf_channel_pdf(const Bssrdf *bssrdf, float radius, float r) { if(radius == 0.0f) { return 0.0f; } else if(bssrdf->type == CLOSURE_BSSRDF_CUBIC_ID) { return bssrdf_cubic_pdf(radius, bssrdf->sharpness, r); } else if(bssrdf->type == CLOSURE_BSSRDF_GAUSSIAN_ID) { return bssrdf_gaussian_pdf(radius, r); } else { /*if(bssrdf->type == CLOSURE_BSSRDF_BURLEY_ID || bssrdf->type == CLOSURE_BSSRDF_PRINCIPLED_ID)*/ return bssrdf_burley_pdf(radius, r); } } ccl_device_forceinline float3 bssrdf_eval(const ShaderClosure *sc, float r) { const Bssrdf *bssrdf = (const Bssrdf*)sc; return make_float3( bssrdf_channel_pdf(bssrdf, bssrdf->radius.x, r), bssrdf_channel_pdf(bssrdf, bssrdf->radius.y, r), bssrdf_channel_pdf(bssrdf, bssrdf->radius.z, r)); } ccl_device_forceinline float bssrdf_pdf(const ShaderClosure *sc, float r) { const Bssrdf *bssrdf = (const Bssrdf*)sc; float3 pdf = bssrdf_eval(sc, r); return (pdf.x + pdf.y + pdf.z) / bssrdf->channels; } CCL_NAMESPACE_END #endif /* __KERNEL_BSSRDF_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/closure/emissive.h000066400000000000000000000055141334742672700233330ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ CCL_NAMESPACE_BEGIN /* BACKGROUND CLOSURE */ ccl_device void background_setup(ShaderData *sd, const float3 weight) { if(sd->flag & SD_EMISSION) { sd->closure_emission_background += weight; } else { sd->flag |= SD_EMISSION; sd->closure_emission_background = weight; } } /* EMISSION CLOSURE */ ccl_device void emission_setup(ShaderData *sd, const float3 weight) { if(sd->flag & SD_EMISSION) { sd->closure_emission_background += weight; } else { sd->flag |= SD_EMISSION; sd->closure_emission_background = weight; } } /* return the probability distribution function in the direction I, * given the parameters and the light's surface normal. This MUST match * the PDF computed by sample(). */ ccl_device float emissive_pdf(const float3 Ng, const float3 I) { float cosNO = fabsf(dot(Ng, I)); return (cosNO > 0.0f)? 1.0f: 0.0f; } ccl_device void emissive_sample(const float3 Ng, float randu, float randv, float3 *omega_out, float *pdf) { /* todo: not implemented and used yet */ } ccl_device float3 emissive_simple_eval(const float3 Ng, const float3 I) { float res = emissive_pdf(Ng, I); return make_float3(res, res, res); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/closure/volume.h000066400000000000000000000114161334742672700230140ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __VOLUME_H__ #define __VOLUME_H__ CCL_NAMESPACE_BEGIN /* VOLUME EXTINCTION */ ccl_device void volume_extinction_setup(ShaderData *sd, float3 weight) { if(sd->flag & SD_EXTINCTION) { sd->closure_transparent_extinction += weight; } else { sd->flag |= SD_EXTINCTION; sd->closure_transparent_extinction = weight; } } /* HENYEY-GREENSTEIN CLOSURE */ typedef ccl_addr_space struct HenyeyGreensteinVolume { SHADER_CLOSURE_BASE; float g; } HenyeyGreensteinVolume; /* Given cosine between rays, return probability density that a photon bounces * to that direction. The g parameter controls how different it is from the * uniform sphere. g=0 uniform diffuse-like, g=1 close to sharp single ray. */ ccl_device float single_peaked_henyey_greenstein(float cos_theta, float g) { return ((1.0f - g * g) / safe_powf(1.0f + g * g - 2.0f * g * cos_theta, 1.5f)) * (M_1_PI_F * 0.25f); }; ccl_device int volume_henyey_greenstein_setup(HenyeyGreensteinVolume *volume) { volume->type = CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID; /* clamp anisotropy to avoid delta function */ volume->g = signf(volume->g) * min(fabsf(volume->g), 1.0f - 1e-3f); return SD_SCATTER; } ccl_device bool volume_henyey_greenstein_merge(const ShaderClosure *a, const ShaderClosure *b) { const HenyeyGreensteinVolume *volume_a = (const HenyeyGreensteinVolume*)a; const HenyeyGreensteinVolume *volume_b = (const HenyeyGreensteinVolume*)b; return (volume_a->g == volume_b->g); } ccl_device float3 volume_henyey_greenstein_eval_phase(const ShaderClosure *sc, const float3 I, float3 omega_in, float *pdf) { const HenyeyGreensteinVolume *volume = (const HenyeyGreensteinVolume*)sc; float g = volume->g; /* note that I points towards the viewer */ if(fabsf(g) < 1e-3f) { *pdf = M_1_PI_F * 0.25f; } else { float cos_theta = dot(-I, omega_in); *pdf = single_peaked_henyey_greenstein(cos_theta, g); } return make_float3(*pdf, *pdf, *pdf); } ccl_device float3 henyey_greenstrein_sample(float3 D, float g, float randu, float randv, float *pdf) { /* match pdf for small g */ float cos_theta; bool isotropic = fabsf(g) < 1e-3f; if(isotropic) { cos_theta = (1.0f - 2.0f * randu); if(pdf) { *pdf = M_1_PI_F * 0.25f; } } else { float k = (1.0f - g * g) / (1.0f - g + 2.0f * g * randu); cos_theta = (1.0f + g * g - k * k) / (2.0f * g); if(pdf) { *pdf = single_peaked_henyey_greenstein(cos_theta, g); } } float sin_theta = safe_sqrtf(1.0f - cos_theta * cos_theta); float phi = M_2PI_F * randv; float3 dir = make_float3(sin_theta * cosf(phi), sin_theta * sinf(phi), cos_theta); float3 T, B; make_orthonormals(D, &T, &B); dir = dir.x * T + dir.y * B + dir.z * D; return dir; } ccl_device int volume_henyey_greenstein_sample(const ShaderClosure *sc, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { const HenyeyGreensteinVolume *volume = (const HenyeyGreensteinVolume*)sc; float g = volume->g; /* note that I points towards the viewer and so is used negated */ *omega_in = henyey_greenstrein_sample(-I, g, randu, randv, pdf); *eval = make_float3(*pdf, *pdf, *pdf); /* perfect importance sampling */ #ifdef __RAY_DIFFERENTIALS__ /* todo: implement ray differential estimation */ *domega_in_dx = make_float3(0.0f, 0.0f, 0.0f); *domega_in_dy = make_float3(0.0f, 0.0f, 0.0f); #endif return LABEL_VOLUME_SCATTER; } /* VOLUME CLOSURE */ ccl_device float3 volume_phase_eval(const ShaderData *sd, const ShaderClosure *sc, float3 omega_in, float *pdf) { kernel_assert(sc->type == CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID); return volume_henyey_greenstein_eval_phase(sc, sd->I, omega_in, pdf); } ccl_device int volume_phase_sample(const ShaderData *sd, const ShaderClosure *sc, float randu, float randv, float3 *eval, float3 *omega_in, differential3 *domega_in, float *pdf) { int label; switch(sc->type) { case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID: label = volume_henyey_greenstein_sample(sc, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; default: *eval = make_float3(0.0f, 0.0f, 0.0f); label = LABEL_NONE; break; } return label; } CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/kernel/filter/000077500000000000000000000000001334742672700211425ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter.h000066400000000000000000000026661334742672700226120ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __FILTER_H__ #define __FILTER_H__ /* CPU Filter Kernel Interface */ #include "util/util_types.h" #include "kernel/filter/filter_defines.h" CCL_NAMESPACE_BEGIN #define KERNEL_NAME_JOIN(x, y, z) x ## _ ## y ## _ ## z #define KERNEL_NAME_EVAL(arch, name) KERNEL_NAME_JOIN(kernel, arch, name) #define KERNEL_FUNCTION_FULL_NAME(name) KERNEL_NAME_EVAL(KERNEL_ARCH, name) #define KERNEL_ARCH cpu #include "kernel/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_sse2 #include "kernel/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_sse3 #include "kernel/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_sse41 #include "kernel/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_avx #include "kernel/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_avx2 #include "kernel/kernels/cpu/filter_cpu.h" CCL_NAMESPACE_END #endif /* __FILTER_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_defines.h000066400000000000000000000021661334742672700243020ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __FILTER_DEFINES_H__ #define __FILTER_DEFINES_H__ #define DENOISE_FEATURES 10 #define TRANSFORM_SIZE (DENOISE_FEATURES*DENOISE_FEATURES) #define XTWX_SIZE (((DENOISE_FEATURES+1)*(DENOISE_FEATURES+2))/2) #define XTWY_SIZE (DENOISE_FEATURES+1) typedef struct TilesInfo { int offsets[9]; int strides[9]; int x[4]; int y[4]; /* TODO(lukas): CUDA doesn't have uint64_t... */ #ifdef __KERNEL_OPENCL__ ccl_global float *buffers[9]; #else long long int buffers[9]; #endif } TilesInfo; #endif /* __FILTER_DEFINES_H__*/ goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_features.h000066400000000000000000000140101334742672700244720ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #define ccl_get_feature(buffer, pass) (buffer)[(pass)*pass_stride] /* Loop over the pixels in the range [low.x, high.x) x [low.y, high.y). * pixel_buffer always points to the current pixel in the first pass. */ #define FOR_PIXEL_WINDOW pixel_buffer = buffer + (low.y - rect.y)*buffer_w + (low.x - rect.x); \ for(pixel.y = low.y; pixel.y < high.y; pixel.y++) { \ for(pixel.x = low.x; pixel.x < high.x; pixel.x++, pixel_buffer++) { #define END_FOR_PIXEL_WINDOW } \ pixel_buffer += buffer_w - (high.x - low.x); \ } ccl_device_inline void filter_get_features(int2 pixel, const ccl_global float *ccl_restrict buffer, float *features, const float *ccl_restrict mean, int pass_stride) { features[0] = pixel.x; features[1] = pixel.y; features[2] = fabsf(ccl_get_feature(buffer, 0)); features[3] = ccl_get_feature(buffer, 1); features[4] = ccl_get_feature(buffer, 2); features[5] = ccl_get_feature(buffer, 3); features[6] = ccl_get_feature(buffer, 4); features[7] = ccl_get_feature(buffer, 5); features[8] = ccl_get_feature(buffer, 6); features[9] = ccl_get_feature(buffer, 7); if(mean) { for(int i = 0; i < DENOISE_FEATURES; i++) features[i] -= mean[i]; } } ccl_device_inline void filter_get_feature_scales(int2 pixel, const ccl_global float *ccl_restrict buffer, float *scales, const float *ccl_restrict mean, int pass_stride) { scales[0] = fabsf(pixel.x - mean[0]); scales[1] = fabsf(pixel.y - mean[1]); scales[2] = fabsf(fabsf(ccl_get_feature(buffer, 0)) - mean[2]); scales[3] = len_squared(make_float3(ccl_get_feature(buffer, 1) - mean[3], ccl_get_feature(buffer, 2) - mean[4], ccl_get_feature(buffer, 3) - mean[5])); scales[4] = fabsf(ccl_get_feature(buffer, 4) - mean[6]); scales[5] = len_squared(make_float3(ccl_get_feature(buffer, 5) - mean[7], ccl_get_feature(buffer, 6) - mean[8], ccl_get_feature(buffer, 7) - mean[9])); } ccl_device_inline void filter_calculate_scale(float *scale) { scale[0] = 1.0f/max(scale[0], 0.01f); scale[1] = 1.0f/max(scale[1], 0.01f); scale[2] = 1.0f/max(scale[2], 0.01f); scale[6] = 1.0f/max(scale[4], 0.01f); scale[7] = scale[8] = scale[9] = 1.0f/max(sqrtf(scale[5]), 0.01f); scale[3] = scale[4] = scale[5] = 1.0f/max(sqrtf(scale[3]), 0.01f); } ccl_device_inline float3 filter_get_color(const ccl_global float *ccl_restrict buffer, int pass_stride) { return make_float3(ccl_get_feature(buffer, 8), ccl_get_feature(buffer, 9), ccl_get_feature(buffer, 10)); } ccl_device_inline void design_row_add(float *design_row, int rank, const ccl_global float *ccl_restrict transform, int stride, int row, float feature) { for(int i = 0; i < rank; i++) { design_row[1+i] += transform[(row*DENOISE_FEATURES + i)*stride]*feature; } } /* Fill the design row. */ ccl_device_inline void filter_get_design_row_transform(int2 p_pixel, const ccl_global float *ccl_restrict p_buffer, int2 q_pixel, const ccl_global float *ccl_restrict q_buffer, int pass_stride, int rank, float *design_row, const ccl_global float *ccl_restrict transform, int stride) { design_row[0] = 1.0f; math_vector_zero(design_row+1, rank); design_row_add(design_row, rank, transform, stride, 0, q_pixel.x - p_pixel.x); design_row_add(design_row, rank, transform, stride, 1, q_pixel.y - p_pixel.y); design_row_add(design_row, rank, transform, stride, 2, fabsf(ccl_get_feature(q_buffer, 0)) - fabsf(ccl_get_feature(p_buffer, 0))); design_row_add(design_row, rank, transform, stride, 3, ccl_get_feature(q_buffer, 1) - ccl_get_feature(p_buffer, 1)); design_row_add(design_row, rank, transform, stride, 4, ccl_get_feature(q_buffer, 2) - ccl_get_feature(p_buffer, 2)); design_row_add(design_row, rank, transform, stride, 5, ccl_get_feature(q_buffer, 3) - ccl_get_feature(p_buffer, 3)); design_row_add(design_row, rank, transform, stride, 6, ccl_get_feature(q_buffer, 4) - ccl_get_feature(p_buffer, 4)); design_row_add(design_row, rank, transform, stride, 7, ccl_get_feature(q_buffer, 5) - ccl_get_feature(p_buffer, 5)); design_row_add(design_row, rank, transform, stride, 8, ccl_get_feature(q_buffer, 6) - ccl_get_feature(p_buffer, 6)); design_row_add(design_row, rank, transform, stride, 9, ccl_get_feature(q_buffer, 7) - ccl_get_feature(p_buffer, 7)); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_features_sse.h000066400000000000000000000102741334742672700253540ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #define ccl_get_feature_sse(pass) load_float4(buffer + (pass)*pass_stride) /* Loop over the pixels in the range [low.x, high.x) x [low.y, high.y), 4 at a time. * pixel_buffer always points to the first of the 4 current pixel in the first pass. * x4 and y4 contain the coordinates of the four pixels, active_pixels contains a mask that's set for all pixels within the window. */ #define FOR_PIXEL_WINDOW_SSE pixel_buffer = buffer + (low.y - rect.y)*buffer_w + (low.x - rect.x); \ for(pixel.y = low.y; pixel.y < high.y; pixel.y++) { \ float4 y4 = make_float4(pixel.y); \ for(pixel.x = low.x; pixel.x < high.x; pixel.x += 4, pixel_buffer += 4) { \ float4 x4 = make_float4(pixel.x) + make_float4(0.0f, 1.0f, 2.0f, 3.0f); \ int4 active_pixels = x4 < make_float4(high.x); #define END_FOR_PIXEL_WINDOW_SSE } \ pixel_buffer += buffer_w - (pixel.x - low.x); \ } ccl_device_inline void filter_get_features_sse(float4 x, float4 y, int4 active_pixels, const float *ccl_restrict buffer, float4 *features, const float4 *ccl_restrict mean, int pass_stride) { features[0] = x; features[1] = y; features[2] = fabs(ccl_get_feature_sse(0)); features[3] = ccl_get_feature_sse(1); features[4] = ccl_get_feature_sse(2); features[5] = ccl_get_feature_sse(3); features[6] = ccl_get_feature_sse(4); features[7] = ccl_get_feature_sse(5); features[8] = ccl_get_feature_sse(6); features[9] = ccl_get_feature_sse(7); if(mean) { for(int i = 0; i < DENOISE_FEATURES; i++) features[i] = features[i] - mean[i]; } for(int i = 0; i < DENOISE_FEATURES; i++) features[i] = mask(active_pixels, features[i]); } ccl_device_inline void filter_get_feature_scales_sse(float4 x, float4 y, int4 active_pixels, const float *ccl_restrict buffer, float4 *scales, const float4 *ccl_restrict mean, int pass_stride) { scales[0] = fabs(x - mean[0]); scales[1] = fabs(y - mean[1]); scales[2] = fabs(fabs(ccl_get_feature_sse(0)) - mean[2]); scales[3] = sqr(ccl_get_feature_sse(1) - mean[3]) + sqr(ccl_get_feature_sse(2) - mean[4]) + sqr(ccl_get_feature_sse(3) - mean[5]); scales[4] = fabs(ccl_get_feature_sse(4) - mean[6]); scales[5] = sqr(ccl_get_feature_sse(5) - mean[7]) + sqr(ccl_get_feature_sse(6) - mean[8]) + sqr(ccl_get_feature_sse(7) - mean[9]); for(int i = 0; i < 6; i++) scales[i] = mask(active_pixels, scales[i]); } ccl_device_inline void filter_calculate_scale_sse(float4 *scale) { scale[0] = rcp(max(reduce_max(scale[0]), make_float4(0.01f))); scale[1] = rcp(max(reduce_max(scale[1]), make_float4(0.01f))); scale[2] = rcp(max(reduce_max(scale[2]), make_float4(0.01f))); scale[6] = rcp(max(reduce_max(scale[4]), make_float4(0.01f))); scale[7] = scale[8] = scale[9] = rcp(max(reduce_max(sqrt(scale[5])), make_float4(0.01f))); scale[3] = scale[4] = scale[5] = rcp(max(reduce_max(sqrt(scale[3])), make_float4(0.01f))); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_kernel.h000066400000000000000000000025741334742672700241500ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_color.h" #include "util/util_math.h" #include "util/util_math_fast.h" #include "util/util_texture.h" #include "util/util_atomic.h" #include "util/util_math_matrix.h" #include "kernel/filter/filter_defines.h" #include "kernel/filter/filter_features.h" #ifdef __KERNEL_SSE3__ # include "kernel/filter/filter_features_sse.h" #endif #include "kernel/filter/filter_prefilter.h" #ifdef __KERNEL_GPU__ # include "kernel/filter/filter_transform_gpu.h" #else # ifdef __KERNEL_SSE3__ # include "kernel/filter/filter_transform_sse.h" # else # include "kernel/filter/filter_transform.h" # endif #endif #include "kernel/filter/filter_reconstruction.h" #ifdef __KERNEL_CPU__ # include "kernel/filter/filter_nlm_cpu.h" #else # include "kernel/filter/filter_nlm_gpu.h" #endif goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_nlm_cpu.h000066400000000000000000000163701334742672700243240ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device_inline void kernel_filter_nlm_calc_difference(int dx, int dy, const float *ccl_restrict weight_image, const float *ccl_restrict variance_image, float *difference_image, int4 rect, int stride, int channel_offset, float a, float k_2) { for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x; x < rect.z; x++) { float diff = 0.0f; int numChannels = channel_offset? 3 : 1; for(int c = 0; c < numChannels; c++) { float cdiff = weight_image[c*channel_offset + y*stride + x] - weight_image[c*channel_offset + (y+dy)*stride + (x+dx)]; float pvar = variance_image[c*channel_offset + y*stride + x]; float qvar = variance_image[c*channel_offset + (y+dy)*stride + (x+dx)]; diff += (cdiff*cdiff - a*(pvar + min(pvar, qvar))) / (1e-8f + k_2*(pvar+qvar)); } if(numChannels > 1) { diff *= 1.0f/numChannels; } difference_image[y*stride + x] = diff; } } } ccl_device_inline void kernel_filter_nlm_blur(const float *ccl_restrict difference_image, float *out_image, int4 rect, int stride, int f) { int aligned_lowx = rect.x / 4; int aligned_highx = (rect.z + 3) / 4; for(int y = rect.y; y < rect.w; y++) { const int low = max(rect.y, y-f); const int high = min(rect.w, y+f+1); for(int x = rect.x; x < rect.z; x++) { out_image[y*stride + x] = 0.0f; } for(int y1 = low; y1 < high; y1++) { float4* out_image4 = (float4*)(out_image + y*stride); float4* difference_image4 = (float4*)(difference_image + y1*stride); for(int x = aligned_lowx; x < aligned_highx; x++) { out_image4[x] += difference_image4[x]; } } for(int x = rect.x; x < rect.z; x++) { out_image[y*stride + x] *= 1.0f/(high - low); } } } ccl_device_inline void kernel_filter_nlm_calc_weight(const float *ccl_restrict difference_image, float *out_image, int4 rect, int stride, int f) { for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x; x < rect.z; x++) { out_image[y*stride + x] = 0.0f; } } for(int dx = -f; dx <= f; dx++) { int pos_dx = max(0, dx); int neg_dx = min(0, dx); for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x-neg_dx; x < rect.z-pos_dx; x++) { out_image[y*stride + x] += difference_image[y*stride + x+dx]; } } } for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x; x < rect.z; x++) { const int low = max(rect.x, x-f); const int high = min(rect.z, x+f+1); out_image[y*stride + x] = fast_expf(-max(out_image[y*stride + x] * (1.0f/(high - low)), 0.0f)); } } } ccl_device_inline void kernel_filter_nlm_update_output(int dx, int dy, const float *ccl_restrict difference_image, const float *ccl_restrict image, float *out_image, float *accum_image, int4 rect, int stride, int f) { for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x; x < rect.z; x++) { const int low = max(rect.x, x-f); const int high = min(rect.z, x+f+1); float sum = 0.0f; for(int x1 = low; x1 < high; x1++) { sum += difference_image[y*stride + x1]; } float weight = sum * (1.0f/(high - low)); accum_image[y*stride + x] += weight; out_image[y*stride + x] += weight*image[(y+dy)*stride + (x+dx)]; } } } ccl_device_inline void kernel_filter_nlm_construct_gramian(int dx, int dy, const float *ccl_restrict difference_image, const float *ccl_restrict buffer, float *transform, int *rank, float *XtWX, float3 *XtWY, int4 rect, int4 filter_window, int stride, int f, int pass_stride) { int4 clip_area = rect_clip(rect, filter_window); /* fy and fy are in filter-window-relative coordinates, while x and y are in feature-window-relative coordinates. */ for(int y = clip_area.y; y < clip_area.w; y++) { for(int x = clip_area.x; x < clip_area.z; x++) { const int low = max(rect.x, x-f); const int high = min(rect.z, x+f+1); float sum = 0.0f; for(int x1 = low; x1 < high; x1++) { sum += difference_image[y*stride + x1]; } float weight = sum * (1.0f/(high - low)); int storage_ofs = coord_to_local_index(filter_window, x, y); float *l_transform = transform + storage_ofs*TRANSFORM_SIZE; float *l_XtWX = XtWX + storage_ofs*XTWX_SIZE; float3 *l_XtWY = XtWY + storage_ofs*XTWY_SIZE; int *l_rank = rank + storage_ofs; kernel_filter_construct_gramian(x, y, 1, dx, dy, stride, pass_stride, buffer, l_transform, l_rank, weight, l_XtWX, l_XtWY, 0); } } } ccl_device_inline void kernel_filter_nlm_normalize(float *out_image, const float *ccl_restrict accum_image, int4 rect, int w) { for(int y = rect.y; y < rect.w; y++) { for(int x = rect.x; x < rect.z; x++) { out_image[y*w+x] /= accum_image[y*w+x]; } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_nlm_gpu.h000066400000000000000000000200661334742672700243250ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Determines pixel coordinates and offset for the current thread. * Returns whether the thread should do any work. * * All coordinates are relative to the denoising buffer! * * Window is the rect that should be processed. * co is filled with (x, y, dx, dy). */ ccl_device_inline bool get_nlm_coords_window(int w, int h, int r, int stride, int4 *rect, int4 *co, int *ofs, int4 window) { /* Determine the pixel offset that this thread should apply. */ int s = 2*r+1; int si = ccl_global_id(1); int sx = si % s; int sy = si / s; if(sy >= s) { return false; } co->z = sx-r; co->w = sy-r; /* Pixels still need to lie inside the denoising buffer after applying the offset, * so determine the area for which this is the case. */ *rect = make_int4(max(0, -co->z), max(0, -co->w), w - max(0, co->z), h - max(0, co->w)); /* Find the intersection of the area that we want to process (window) and the area * that can be processed (rect) to get the final area for this offset. */ int4 clip_area = rect_clip(window, *rect); /* If the radius is larger than one of the sides of the window, * there will be shifts for which there is no usable pixel at all. */ if(!rect_is_valid(clip_area)) { return false; } /* Map the linear thread index to pixels inside the clip area. */ int x, y; if(!local_index_to_coord(clip_area, ccl_global_id(0), &x, &y)) { return false; } co->x = x; co->y = y; *ofs = (sy*s + sx) * stride; return true; } ccl_device_inline bool get_nlm_coords(int w, int h, int r, int stride, int4 *rect, int4 *co, int *ofs) { return get_nlm_coords_window(w, h, r, stride, rect, co, ofs, make_int4(0, 0, w, h)); } ccl_device_inline void kernel_filter_nlm_calc_difference(int x, int y, int dx, int dy, const ccl_global float *ccl_restrict weight_image, const ccl_global float *ccl_restrict variance_image, ccl_global float *difference_image, int4 rect, int stride, int channel_offset, float a, float k_2) { float diff = 0.0f; int numChannels = channel_offset? 3 : 1; for(int c = 0; c < numChannels; c++) { float cdiff = weight_image[c*channel_offset + y*stride + x] - weight_image[c*channel_offset + (y+dy)*stride + (x+dx)]; float pvar = variance_image[c*channel_offset + y*stride + x]; float qvar = variance_image[c*channel_offset + (y+dy)*stride + (x+dx)]; diff += (cdiff*cdiff - a*(pvar + min(pvar, qvar))) / (1e-8f + k_2*(pvar+qvar)); } if(numChannels > 1) { diff *= 1.0f/numChannels; } difference_image[y*stride + x] = diff; } ccl_device_inline void kernel_filter_nlm_blur(int x, int y, const ccl_global float *ccl_restrict difference_image, ccl_global float *out_image, int4 rect, int stride, int f) { float sum = 0.0f; const int low = max(rect.y, y-f); const int high = min(rect.w, y+f+1); for(int y1 = low; y1 < high; y1++) { sum += difference_image[y1*stride + x]; } sum *= 1.0f/(high-low); out_image[y*stride + x] = sum; } ccl_device_inline void kernel_filter_nlm_calc_weight(int x, int y, const ccl_global float *ccl_restrict difference_image, ccl_global float *out_image, int4 rect, int stride, int f) { float sum = 0.0f; const int low = max(rect.x, x-f); const int high = min(rect.z, x+f+1); for(int x1 = low; x1 < high; x1++) { sum += difference_image[y*stride + x1]; } sum *= 1.0f/(high-low); out_image[y*stride + x] = fast_expf(-max(sum, 0.0f)); } ccl_device_inline void kernel_filter_nlm_update_output(int x, int y, int dx, int dy, const ccl_global float *ccl_restrict difference_image, const ccl_global float *ccl_restrict image, ccl_global float *out_image, ccl_global float *accum_image, int4 rect, int stride, int f) { float sum = 0.0f; const int low = max(rect.x, x-f); const int high = min(rect.z, x+f+1); for(int x1 = low; x1 < high; x1++) { sum += difference_image[y*stride + x1]; } sum *= 1.0f/(high-low); if(out_image) { atomic_add_and_fetch_float(accum_image + y*stride + x, sum); atomic_add_and_fetch_float(out_image + y*stride + x, sum*image[(y+dy)*stride + (x+dx)]); } else { accum_image[y*stride + x] = sum; } } ccl_device_inline void kernel_filter_nlm_construct_gramian(int x, int y, int dx, int dy, const ccl_global float *ccl_restrict difference_image, const ccl_global float *ccl_restrict buffer, const ccl_global float *ccl_restrict transform, ccl_global int *rank, ccl_global float *XtWX, ccl_global float3 *XtWY, int4 rect, int4 filter_window, int stride, int f, int pass_stride, int localIdx) { const int low = max(rect.x, x-f); const int high = min(rect.z, x+f+1); float sum = 0.0f; for(int x1 = low; x1 < high; x1++) { sum += difference_image[y*stride + x1]; } float weight = sum * (1.0f/(high - low)); /* Reconstruction data is only stored for pixels inside the filter window, * so compute the pixels's index in there. */ int storage_ofs = coord_to_local_index(filter_window, x, y); transform += storage_ofs; rank += storage_ofs; XtWX += storage_ofs; XtWY += storage_ofs; kernel_filter_construct_gramian(x, y, rect_size(filter_window), dx, dy, stride, pass_stride, buffer, transform, rank, weight, XtWX, XtWY, localIdx); } ccl_device_inline void kernel_filter_nlm_normalize(int x, int y, ccl_global float *out_image, const ccl_global float *ccl_restrict accum_image, int stride) { out_image[y*stride + x] /= accum_image[y*stride + x]; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_prefilter.h000066400000000000000000000217511334742672700246620ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* First step of the shadow prefiltering, performs the shadow division and stores all data * in a nice and easy rectangular array that can be passed to the NLM filter. * * Calculates: * unfiltered: Contains the two half images of the shadow feature pass * sampleVariance: The sample-based variance calculated in the kernel. Note: This calculation is biased in general, and especially here since the variance of the ratio can only be approximated. * sampleVarianceV: Variance of the sample variance estimation, quite noisy (since it's essentially the buffer variance of the two variance halves) * bufferVariance: The buffer-based variance of the shadow feature. Unbiased, but quite noisy. */ ccl_device void kernel_filter_divide_shadow(int sample, ccl_global TilesInfo *tiles, int x, int y, ccl_global float *unfilteredA, ccl_global float *unfilteredB, ccl_global float *sampleVariance, ccl_global float *sampleVarianceV, ccl_global float *bufferVariance, int4 rect, int buffer_pass_stride, int buffer_denoising_offset) { int xtile = (x < tiles->x[1])? 0: ((x < tiles->x[2])? 1: 2); int ytile = (y < tiles->y[1])? 0: ((y < tiles->y[2])? 1: 2); int tile = ytile*3+xtile; int offset = tiles->offsets[tile]; int stride = tiles->strides[tile]; const ccl_global float *ccl_restrict center_buffer = (ccl_global float*) tiles->buffers[tile]; center_buffer += (y*stride + x + offset)*buffer_pass_stride; center_buffer += buffer_denoising_offset + 14; int buffer_w = align_up(rect.z - rect.x, 4); int idx = (y-rect.y)*buffer_w + (x - rect.x); unfilteredA[idx] = center_buffer[1] / max(center_buffer[0], 1e-7f); unfilteredB[idx] = center_buffer[4] / max(center_buffer[3], 1e-7f); float varA = center_buffer[2]; float varB = center_buffer[5]; int odd_sample = (sample+1)/2; int even_sample = sample/2; /* Approximate variance as E[x^2] - 1/N * (E[x])^2, since online variance * update does not work efficiently with atomics in the kernel. */ varA = max(0.0f, varA - unfilteredA[idx]*unfilteredA[idx]*odd_sample); varB = max(0.0f, varB - unfilteredB[idx]*unfilteredB[idx]*even_sample); varA /= max(odd_sample - 1, 1); varB /= max(even_sample - 1, 1); sampleVariance[idx] = 0.5f*(varA + varB) / sample; sampleVarianceV[idx] = 0.5f * (varA - varB) * (varA - varB) / (sample*sample); bufferVariance[idx] = 0.5f * (unfilteredA[idx] - unfilteredB[idx]) * (unfilteredA[idx] - unfilteredB[idx]); } /* Load a regular feature from the render buffers into the denoise buffer. * Parameters: * - sample: The sample amount in the buffer, used to normalize the buffer. * - m_offset, v_offset: Render Buffer Pass offsets of mean and variance of the feature. * - x, y: Current pixel * - mean, variance: Target denoise buffers. * - rect: The prefilter area (lower pixels inclusive, upper pixels exclusive). */ ccl_device void kernel_filter_get_feature(int sample, ccl_global TilesInfo *tiles, int m_offset, int v_offset, int x, int y, ccl_global float *mean, ccl_global float *variance, int4 rect, int buffer_pass_stride, int buffer_denoising_offset) { int xtile = (x < tiles->x[1])? 0: ((x < tiles->x[2])? 1: 2); int ytile = (y < tiles->y[1])? 0: ((y < tiles->y[2])? 1: 2); int tile = ytile*3+xtile; ccl_global float *center_buffer = ((ccl_global float*) tiles->buffers[tile]) + (tiles->offsets[tile] + y*tiles->strides[tile] + x)*buffer_pass_stride + buffer_denoising_offset; int buffer_w = align_up(rect.z - rect.x, 4); int idx = (y-rect.y)*buffer_w + (x - rect.x); mean[idx] = center_buffer[m_offset] / sample; if(sample > 1) { /* Approximate variance as E[x^2] - 1/N * (E[x])^2, since online variance * update does not work efficiently with atomics in the kernel. */ variance[idx] = max(0.0f, (center_buffer[v_offset] - mean[idx]*mean[idx]*sample) / (sample * (sample-1))); } else { /* Can't compute variance with single sample, just set it very high. */ variance[idx] = 1e10f; } } ccl_device void kernel_filter_detect_outliers(int x, int y, ccl_global float *image, ccl_global float *variance, ccl_global float *depth, ccl_global float *out, int4 rect, int pass_stride) { int buffer_w = align_up(rect.z - rect.x, 4); int n = 0; float values[25]; for(int y1 = max(y-2, rect.y); y1 < min(y+3, rect.w); y1++) { for(int x1 = max(x-2, rect.x); x1 < min(x+3, rect.z); x1++) { int idx = (y1-rect.y)*buffer_w + (x1-rect.x); float3 color = make_float3(image[idx], image[idx+pass_stride], image[idx+2*pass_stride]); color = max(color, make_float3(0.0f, 0.0f, 0.0f)); float L = average(color); /* Find the position of L. */ int i; for(i = 0; i < n; i++) { if(values[i] > L) break; } /* Make space for L by shifting all following values to the right. */ for(int j = n; j > i; j--) { values[j] = values[j-1]; } /* Insert L. */ values[i] = L; n++; } } int idx = (y-rect.y)*buffer_w + (x-rect.x); float3 color = make_float3(image[idx], image[idx+pass_stride], image[idx+2*pass_stride]); color = max(color, make_float3(0.0f, 0.0f, 0.0f)); float L = average(color); float ref = 2.0f*values[(int)(n*0.75f)]; if(L > ref) { /* The pixel appears to be an outlier. * However, it may just be a legitimate highlight. Therefore, it is checked how likely it is that the pixel * should actually be at the reference value: * If the reference is within the 3-sigma interval, the pixel is assumed to be a statistical outlier. * Otherwise, it is very unlikely that the pixel should be darker, which indicates a legitimate highlight. */ float stddev = sqrtf(average(make_float3(variance[idx], variance[idx+pass_stride], variance[idx+2*pass_stride]))); if(L - 3*stddev < ref) { /* The pixel is an outlier, so negate the depth value to mark it as one. * Also, scale its brightness down to the outlier threshold to avoid trouble with the NLM weights. */ depth[idx] = -depth[idx]; float fac = ref/L; color *= fac; variance[idx ] *= fac*fac; variance[idx + pass_stride] *= fac*fac; variance[idx+2*pass_stride] *= fac*fac; } } out[idx ] = color.x; out[idx + pass_stride] = color.y; out[idx+2*pass_stride] = color.z; } /* Combine A/B buffers. * Calculates the combined mean and the buffer variance. */ ccl_device void kernel_filter_combine_halves(int x, int y, ccl_global float *mean, ccl_global float *variance, ccl_global float *a, ccl_global float *b, int4 rect, int r) { int buffer_w = align_up(rect.z - rect.x, 4); int idx = (y-rect.y)*buffer_w + (x - rect.x); if(mean) mean[idx] = 0.5f * (a[idx]+b[idx]); if(variance) { if(r == 0) variance[idx] = 0.25f * (a[idx]-b[idx])*(a[idx]-b[idx]); else { variance[idx] = 0.0f; float values[25]; int numValues = 0; for(int py = max(y-r, rect.y); py < min(y+r+1, rect.w); py++) { for(int px = max(x-r, rect.x); px < min(x+r+1, rect.z); px++) { int pidx = (py-rect.y)*buffer_w + (px-rect.x); values[numValues++] = 0.25f * (a[pidx]-b[pidx])*(a[pidx]-b[pidx]); } } /* Insertion-sort the variances (fast enough for 25 elements). */ for(int i = 1; i < numValues; i++) { float v = values[i]; int j; for(j = i-1; j >= 0 && values[j] > v; j--) values[j+1] = values[j]; values[j+1] = v; } variance[idx] = values[(7*numValues)/8]; } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_reconstruction.h000066400000000000000000000105231334742672700257420ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device_inline void kernel_filter_construct_gramian(int x, int y, int storage_stride, int dx, int dy, int buffer_stride, int pass_stride, const ccl_global float *ccl_restrict buffer, const ccl_global float *ccl_restrict transform, ccl_global int *rank, float weight, ccl_global float *XtWX, ccl_global float3 *XtWY, int localIdx) { if(weight < 1e-3f) { return; } int p_offset = y * buffer_stride + x; int q_offset = (y+dy) * buffer_stride + (x+dx); #ifdef __KERNEL_GPU__ const int stride = storage_stride; #else const int stride = 1; (void) storage_stride; #endif #ifdef __KERNEL_CUDA__ ccl_local float shared_design_row[(DENOISE_FEATURES+1)*CCL_MAX_LOCAL_SIZE]; ccl_local_param float *design_row = shared_design_row + localIdx*(DENOISE_FEATURES+1); #else float design_row[DENOISE_FEATURES+1]; #endif float3 q_color = filter_get_color(buffer + q_offset, pass_stride); /* If the pixel was flagged as an outlier during prefiltering, skip it. */ if(ccl_get_feature(buffer + q_offset, 0) < 0.0f) { return; } filter_get_design_row_transform(make_int2(x, y), buffer + p_offset, make_int2(x+dx, y+dy), buffer + q_offset, pass_stride, *rank, design_row, transform, stride); math_trimatrix_add_gramian_strided(XtWX, (*rank)+1, design_row, weight, stride); math_vec3_add_strided(XtWY, (*rank)+1, design_row, weight * q_color, stride); } ccl_device_inline void kernel_filter_finalize(int x, int y, ccl_global float *buffer, ccl_global int *rank, int storage_stride, ccl_global float *XtWX, ccl_global float3 *XtWY, int4 buffer_params, int sample) { #ifdef __KERNEL_GPU__ const int stride = storage_stride; #else const int stride = 1; (void) storage_stride; #endif if(XtWX[0] < 1e-3f) { /* There is not enough information to determine a denoised result. * As a fallback, keep the original value of the pixel. */ return; } /* The weighted average of pixel colors (essentially, the NLM-filtered image). * In case the solution of the linear model fails due to numerical issues, * fall back to this value. */ float3 mean_color = XtWY[0]/XtWX[0]; math_trimatrix_vec3_solve(XtWX, XtWY, (*rank)+1, stride); float3 final_color = XtWY[0]; if(!isfinite3_safe(final_color)) { final_color = mean_color; } /* Clamp pixel value to positive values. */ final_color = max(final_color, make_float3(0.0f, 0.0f, 0.0f)); ccl_global float *combined_buffer = buffer + (y*buffer_params.y + x + buffer_params.x)*buffer_params.z; final_color *= sample; if(buffer_params.w) { final_color.x += combined_buffer[buffer_params.w+0]; final_color.y += combined_buffer[buffer_params.w+1]; final_color.z += combined_buffer[buffer_params.w+2]; } combined_buffer[0] = final_color.x; combined_buffer[1] = final_color.y; combined_buffer[2] = final_color.z; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_transform.h000066400000000000000000000100561334742672700246750ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void kernel_filter_construct_transform(const float *ccl_restrict buffer, int x, int y, int4 rect, int pass_stride, float *transform, int *rank, int radius, float pca_threshold) { int buffer_w = align_up(rect.z - rect.x, 4); float features[DENOISE_FEATURES]; /* Temporary storage, used in different steps of the algorithm. */ float tempmatrix[DENOISE_FEATURES*DENOISE_FEATURES]; float tempvector[2*DENOISE_FEATURES]; const float *ccl_restrict pixel_buffer; int2 pixel; /* === Calculate denoising window. === */ int2 low = make_int2(max(rect.x, x - radius), max(rect.y, y - radius)); int2 high = make_int2(min(rect.z, x + radius + 1), min(rect.w, y + radius + 1)); int num_pixels = (high.y - low.y) * (high.x - low.x); /* === Shift feature passes to have mean 0. === */ float feature_means[DENOISE_FEATURES]; math_vector_zero(feature_means, DENOISE_FEATURES); FOR_PIXEL_WINDOW { filter_get_features(pixel, pixel_buffer, features, NULL, pass_stride); math_vector_add(feature_means, features, DENOISE_FEATURES); } END_FOR_PIXEL_WINDOW math_vector_scale(feature_means, 1.0f / num_pixels, DENOISE_FEATURES); /* === Scale the shifted feature passes to a range of [-1; 1], will be baked into the transform later. === */ float *feature_scale = tempvector; math_vector_zero(feature_scale, DENOISE_FEATURES); FOR_PIXEL_WINDOW { filter_get_feature_scales(pixel, pixel_buffer, features, feature_means, pass_stride); math_vector_max(feature_scale, features, DENOISE_FEATURES); } END_FOR_PIXEL_WINDOW filter_calculate_scale(feature_scale); /* === Generate the feature transformation. === * This transformation maps the DENOISE_FEATURES-dimentional feature space to a reduced feature (r-feature) space * which generally has fewer dimensions. This mainly helps to prevent overfitting. */ float* feature_matrix = tempmatrix; math_matrix_zero(feature_matrix, DENOISE_FEATURES); FOR_PIXEL_WINDOW { filter_get_features(pixel, pixel_buffer, features, feature_means, pass_stride); math_vector_mul(features, feature_scale, DENOISE_FEATURES); math_matrix_add_gramian(feature_matrix, DENOISE_FEATURES, features, 1.0f); } END_FOR_PIXEL_WINDOW math_matrix_jacobi_eigendecomposition(feature_matrix, transform, DENOISE_FEATURES, 1); *rank = 0; /* Prevent overfitting when a small window is used. */ int max_rank = min(DENOISE_FEATURES, num_pixels/3); if(pca_threshold < 0.0f) { float threshold_energy = 0.0f; for(int i = 0; i < DENOISE_FEATURES; i++) { threshold_energy += feature_matrix[i*DENOISE_FEATURES+i]; } threshold_energy *= 1.0f - (-pca_threshold); float reduced_energy = 0.0f; for(int i = 0; i < max_rank; i++, (*rank)++) { if(i >= 2 && reduced_energy >= threshold_energy) break; float s = feature_matrix[i*DENOISE_FEATURES+i]; reduced_energy += s; } } else { for(int i = 0; i < max_rank; i++, (*rank)++) { float s = feature_matrix[i*DENOISE_FEATURES+i]; if(i >= 2 && sqrtf(s) < pca_threshold) break; } } /* Bake the feature scaling into the transformation matrix. */ for(int i = 0; i < (*rank); i++) { math_vector_mul(transform + i*DENOISE_FEATURES, feature_scale, DENOISE_FEATURES); } math_matrix_transpose(transform, DENOISE_FEATURES, 1); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_transform_gpu.h000066400000000000000000000105431334742672700255510ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void kernel_filter_construct_transform(const ccl_global float *ccl_restrict buffer, int x, int y, int4 rect, int pass_stride, ccl_global float *transform, ccl_global int *rank, int radius, float pca_threshold, int transform_stride, int localIdx) { int buffer_w = align_up(rect.z - rect.x, 4); #ifdef __KERNEL_CUDA__ ccl_local float shared_features[DENOISE_FEATURES*CCL_MAX_LOCAL_SIZE]; ccl_local_param float *features = shared_features + localIdx*DENOISE_FEATURES; #else float features[DENOISE_FEATURES]; #endif /* === Calculate denoising window. === */ int2 low = make_int2(max(rect.x, x - radius), max(rect.y, y - radius)); int2 high = make_int2(min(rect.z, x + radius + 1), min(rect.w, y + radius + 1)); int num_pixels = (high.y - low.y) * (high.x - low.x); const ccl_global float *ccl_restrict pixel_buffer; int2 pixel; /* === Shift feature passes to have mean 0. === */ float feature_means[DENOISE_FEATURES]; math_vector_zero(feature_means, DENOISE_FEATURES); FOR_PIXEL_WINDOW { filter_get_features(pixel, pixel_buffer, features, NULL, pass_stride); math_vector_add(feature_means, features, DENOISE_FEATURES); } END_FOR_PIXEL_WINDOW math_vector_scale(feature_means, 1.0f / num_pixels, DENOISE_FEATURES); /* === Scale the shifted feature passes to a range of [-1; 1], will be baked into the transform later. === */ float feature_scale[DENOISE_FEATURES]; math_vector_zero(feature_scale, DENOISE_FEATURES); FOR_PIXEL_WINDOW { filter_get_feature_scales(pixel, pixel_buffer, features, feature_means, pass_stride); math_vector_max(feature_scale, features, DENOISE_FEATURES); } END_FOR_PIXEL_WINDOW filter_calculate_scale(feature_scale); /* === Generate the feature transformation. === * This transformation maps the DENOISE_FEATURES-dimentional feature space to a reduced feature (r-feature) space * which generally has fewer dimensions. This mainly helps to prevent overfitting. */ float feature_matrix[DENOISE_FEATURES*DENOISE_FEATURES]; math_matrix_zero(feature_matrix, DENOISE_FEATURES); FOR_PIXEL_WINDOW { filter_get_features(pixel, pixel_buffer, features, feature_means, pass_stride); math_vector_mul(features, feature_scale, DENOISE_FEATURES); math_matrix_add_gramian(feature_matrix, DENOISE_FEATURES, features, 1.0f); } END_FOR_PIXEL_WINDOW math_matrix_jacobi_eigendecomposition(feature_matrix, transform, DENOISE_FEATURES, transform_stride); *rank = 0; /* Prevent overfitting when a small window is used. */ int max_rank = min(DENOISE_FEATURES, num_pixels/3); if(pca_threshold < 0.0f) { float threshold_energy = 0.0f; for(int i = 0; i < DENOISE_FEATURES; i++) { threshold_energy += feature_matrix[i*DENOISE_FEATURES+i]; } threshold_energy *= 1.0f - (-pca_threshold); float reduced_energy = 0.0f; for(int i = 0; i < max_rank; i++, (*rank)++) { if(i >= 2 && reduced_energy >= threshold_energy) break; float s = feature_matrix[i*DENOISE_FEATURES+i]; reduced_energy += s; } } else { for(int i = 0; i < max_rank; i++, (*rank)++) { float s = feature_matrix[i*DENOISE_FEATURES+i]; if(i >= 2 && sqrtf(s) < pca_threshold) break; } } math_matrix_transpose(transform, DENOISE_FEATURES, transform_stride); /* Bake the feature scaling into the transformation matrix. */ for(int i = 0; i < DENOISE_FEATURES; i++) { for(int j = 0; j < (*rank); j++) { transform[(i*DENOISE_FEATURES + j)*transform_stride] *= feature_scale[i]; } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/filter/filter_transform_sse.h000066400000000000000000000075271334742672700255600ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void kernel_filter_construct_transform(const float *ccl_restrict buffer, int x, int y, int4 rect, int pass_stride, float *transform, int *rank, int radius, float pca_threshold) { int buffer_w = align_up(rect.z - rect.x, 4); float4 features[DENOISE_FEATURES]; const float *ccl_restrict pixel_buffer; int2 pixel; int2 low = make_int2(max(rect.x, x - radius), max(rect.y, y - radius)); int2 high = make_int2(min(rect.z, x + radius + 1), min(rect.w, y + radius + 1)); int num_pixels = (high.y - low.y) * (high.x - low.x); float4 feature_means[DENOISE_FEATURES]; math_vector_zero_sse(feature_means, DENOISE_FEATURES); FOR_PIXEL_WINDOW_SSE { filter_get_features_sse(x4, y4, active_pixels, pixel_buffer, features, NULL, pass_stride); math_vector_add_sse(feature_means, DENOISE_FEATURES, features); } END_FOR_PIXEL_WINDOW_SSE float4 pixel_scale = make_float4(1.0f / num_pixels); for(int i = 0; i < DENOISE_FEATURES; i++) { feature_means[i] = reduce_add(feature_means[i]) * pixel_scale; } float4 feature_scale[DENOISE_FEATURES]; math_vector_zero_sse(feature_scale, DENOISE_FEATURES); FOR_PIXEL_WINDOW_SSE { filter_get_feature_scales_sse(x4, y4, active_pixels, pixel_buffer, features, feature_means, pass_stride); math_vector_max_sse(feature_scale, features, DENOISE_FEATURES); } END_FOR_PIXEL_WINDOW_SSE filter_calculate_scale_sse(feature_scale); float4 feature_matrix_sse[DENOISE_FEATURES*DENOISE_FEATURES]; math_matrix_zero_sse(feature_matrix_sse, DENOISE_FEATURES); FOR_PIXEL_WINDOW_SSE { filter_get_features_sse(x4, y4, active_pixels, pixel_buffer, features, feature_means, pass_stride); math_vector_mul_sse(features, DENOISE_FEATURES, feature_scale); math_matrix_add_gramian_sse(feature_matrix_sse, DENOISE_FEATURES, features, make_float4(1.0f)); } END_FOR_PIXEL_WINDOW_SSE float feature_matrix[DENOISE_FEATURES*DENOISE_FEATURES]; math_matrix_hsum(feature_matrix, DENOISE_FEATURES, feature_matrix_sse); math_matrix_jacobi_eigendecomposition(feature_matrix, transform, DENOISE_FEATURES, 1); *rank = 0; /* Prevent overfitting when a small window is used. */ int max_rank = min(DENOISE_FEATURES, num_pixels/3); if(pca_threshold < 0.0f) { float threshold_energy = 0.0f; for(int i = 0; i < DENOISE_FEATURES; i++) { threshold_energy += feature_matrix[i*DENOISE_FEATURES+i]; } threshold_energy *= 1.0f - (-pca_threshold); float reduced_energy = 0.0f; for(int i = 0; i < max_rank; i++, (*rank)++) { if(i >= 2 && reduced_energy >= threshold_energy) break; float s = feature_matrix[i*DENOISE_FEATURES+i]; reduced_energy += s; } } else { for(int i = 0; i < max_rank; i++, (*rank)++) { float s = feature_matrix[i*DENOISE_FEATURES+i]; if(i >= 2 && sqrtf(s) < pca_threshold) break; } } math_matrix_transpose(transform, DENOISE_FEATURES, 1); /* Bake the feature scaling into the transformation matrix. */ for(int i = 0; i < DENOISE_FEATURES; i++) { math_vector_scale(transform + i*DENOISE_FEATURES, feature_scale[i][0], *rank); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/000077500000000000000000000000001334742672700206045ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom.h000066400000000000000000000023261334742672700217070ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "kernel/geom/geom_attribute.h" #include "kernel/geom/geom_object.h" #ifdef __PATCH_EVAL__ # include "kernel/geom/geom_patch.h" #endif #include "kernel/geom/geom_triangle.h" #include "kernel/geom/geom_subd_triangle.h" #include "kernel/geom/geom_triangle_intersect.h" #include "kernel/geom/geom_motion_triangle.h" #include "kernel/geom/geom_motion_triangle_intersect.h" #include "kernel/geom/geom_motion_triangle_shader.h" #include "kernel/geom/geom_motion_curve.h" #include "kernel/geom/geom_curve.h" #include "kernel/geom/geom_curve_intersect.h" #include "kernel/geom/geom_volume.h" #include "kernel/geom/geom_primitive.h" goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_attribute.h000066400000000000000000000064631334742672700240000ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Attributes * * We support an arbitrary number of attributes on various mesh elements. * On vertices, triangles, curve keys, curves, meshes and volume grids. * Most of the code for attribute reading is in the primitive files. * * Lookup of attributes is different between OSL and SVM, as OSL is ustring * based while for SVM we use integer ids. */ ccl_device_inline uint subd_triangle_patch(KernelGlobals *kg, const ShaderData *sd); ccl_device_inline uint attribute_primitive_type(KernelGlobals *kg, const ShaderData *sd) { #ifdef __HAIR__ if(sd->type & PRIMITIVE_ALL_CURVE) { return ATTR_PRIM_CURVE; } else #endif if(subd_triangle_patch(kg, sd) != ~0) { return ATTR_PRIM_SUBD; } else { return ATTR_PRIM_TRIANGLE; } } ccl_device_inline AttributeDescriptor attribute_not_found() { const AttributeDescriptor desc = {ATTR_ELEMENT_NONE, (NodeAttributeType)0, 0, ATTR_STD_NOT_FOUND}; return desc; } /* Find attribute based on ID */ ccl_device_inline uint object_attribute_map_offset(KernelGlobals *kg, int object) { int offset = object*OBJECT_SIZE + 15; float4 f = kernel_tex_fetch(__objects, offset); return __float_as_uint(f.y); } ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals *kg, const ShaderData *sd, uint id) { if(sd->object == OBJECT_NONE) { return attribute_not_found(); } /* for SVM, find attribute by unique id */ uint attr_offset = object_attribute_map_offset(kg, sd->object); attr_offset += attribute_primitive_type(kg, sd); uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset); while(attr_map.x != id) { if(UNLIKELY(attr_map.x == ATTR_STD_NONE)) { return attribute_not_found(); } attr_offset += ATTR_PRIM_TYPES; attr_map = kernel_tex_fetch(__attributes_map, attr_offset); } AttributeDescriptor desc; desc.element = (AttributeElement)attr_map.y; if(sd->prim == PRIM_NONE && desc.element != ATTR_ELEMENT_MESH && desc.element != ATTR_ELEMENT_VOXEL && desc.element != ATTR_ELEMENT_OBJECT) { return attribute_not_found(); } /* return result */ desc.offset = (attr_map.y == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : (int)attr_map.z; desc.type = (NodeAttributeType)(attr_map.w & 0xff); desc.flags = (AttributeFlag)(attr_map.w >> 8); return desc; } /* Transform matrix attribute on meshes */ ccl_device Transform primitive_attribute_matrix(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc) { Transform tfm; tfm.x = kernel_tex_fetch(__attributes_float3, desc.offset + 0); tfm.y = kernel_tex_fetch(__attributes_float3, desc.offset + 1); tfm.z = kernel_tex_fetch(__attributes_float3, desc.offset + 2); tfm.w = kernel_tex_fetch(__attributes_float3, desc.offset + 3); return tfm; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_curve.h000066400000000000000000000137071334742672700231200ustar00rootroot00000000000000/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Curve Primitive * * Curve primitive for rendering hair and fur. These can be render as flat * ribbons or curves with actual thickness. The curve can also be rendered as * line segments rather than curves for better performance. */ #ifdef __HAIR__ /* Reading attributes on various curve elements */ ccl_device float curve_attribute_float(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float *dx, float *dy) { if(desc.element == ATTR_ELEMENT_CURVE) { #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; #endif return kernel_tex_fetch(__attributes_float, desc.offset + sd->prim); } else if(desc.element == ATTR_ELEMENT_CURVE_KEY || desc.element == ATTR_ELEMENT_CURVE_KEY_MOTION) { float4 curvedata = kernel_tex_fetch(__curves, sd->prim); int k0 = __float_as_int(curvedata.x) + PRIMITIVE_UNPACK_SEGMENT(sd->type); int k1 = k0 + 1; float f0 = kernel_tex_fetch(__attributes_float, desc.offset + k0); float f1 = kernel_tex_fetch(__attributes_float, desc.offset + k1); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*(f1 - f0); if(dy) *dy = 0.0f; #endif return (1.0f - sd->u)*f0 + sd->u*f1; } else { #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; #endif return 0.0f; } } ccl_device float3 curve_attribute_float3(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float3 *dx, float3 *dy) { if(desc.element == ATTR_ELEMENT_CURVE) { /* idea: we can't derive any useful differentials here, but for tiled * mipmap image caching it would be useful to avoid reading the highest * detail level always. maybe a derivative based on the hair density * could be computed somehow? */ #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); #endif return float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + sd->prim)); } else if(desc.element == ATTR_ELEMENT_CURVE_KEY || desc.element == ATTR_ELEMENT_CURVE_KEY_MOTION) { float4 curvedata = kernel_tex_fetch(__curves, sd->prim); int k0 = __float_as_int(curvedata.x) + PRIMITIVE_UNPACK_SEGMENT(sd->type); int k1 = k0 + 1; float3 f0 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + k0)); float3 f1 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + k1)); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*(f1 - f0); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); #endif return (1.0f - sd->u)*f0 + sd->u*f1; } else { #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); #endif return make_float3(0.0f, 0.0f, 0.0f); } } /* Curve thickness */ ccl_device float curve_thickness(KernelGlobals *kg, ShaderData *sd) { float r = 0.0f; if(sd->type & PRIMITIVE_ALL_CURVE) { float4 curvedata = kernel_tex_fetch(__curves, sd->prim); int k0 = __float_as_int(curvedata.x) + PRIMITIVE_UNPACK_SEGMENT(sd->type); int k1 = k0 + 1; float4 P_curve[2]; if(sd->type & PRIMITIVE_CURVE) { P_curve[0]= kernel_tex_fetch(__curve_keys, k0); P_curve[1]= kernel_tex_fetch(__curve_keys, k1); } else { motion_curve_keys(kg, sd->object, sd->prim, sd->time, k0, k1, P_curve); } r = (P_curve[1].w - P_curve[0].w) * sd->u + P_curve[0].w; } return r*2.0f; } /* Curve location for motion pass, linear interpolation between keys and * ignoring radius because we do the same for the motion keys */ ccl_device float3 curve_motion_center_location(KernelGlobals *kg, ShaderData *sd) { float4 curvedata = kernel_tex_fetch(__curves, sd->prim); int k0 = __float_as_int(curvedata.x) + PRIMITIVE_UNPACK_SEGMENT(sd->type); int k1 = k0 + 1; float4 P_curve[2]; P_curve[0]= kernel_tex_fetch(__curve_keys, k0); P_curve[1]= kernel_tex_fetch(__curve_keys, k1); return float4_to_float3(P_curve[1]) * sd->u + float4_to_float3(P_curve[0]) * (1.0f - sd->u); } /* Curve tangent normal */ ccl_device float3 curve_tangent_normal(KernelGlobals *kg, ShaderData *sd) { float3 tgN = make_float3(0.0f,0.0f,0.0f); if(sd->type & PRIMITIVE_ALL_CURVE) { tgN = -(-sd->I - sd->dPdu * (dot(sd->dPdu,-sd->I) / len_squared(sd->dPdu))); tgN = normalize(tgN); /* need to find suitable scaled gd for corrected normal */ #if 0 tgN = normalize(tgN - gd * sd->dPdu); #endif } return tgN; } /* Curve bounds utility function */ ccl_device_inline void curvebounds(float *lower, float *upper, float *extremta, float *extrema, float *extremtb, float *extremb, float p0, float p1, float p2, float p3) { float halfdiscroot = (p2 * p2 - 3 * p3 * p1); float ta = -1.0f; float tb = -1.0f; *extremta = -1.0f; *extremtb = -1.0f; *upper = p0; *lower = (p0 + p1) + (p2 + p3); *extrema = *upper; *extremb = *lower; if(*lower >= *upper) { *upper = *lower; *lower = p0; } if(halfdiscroot >= 0) { float inv3p3 = (1.0f/3.0f)/p3; halfdiscroot = sqrtf(halfdiscroot); ta = (-p2 - halfdiscroot) * inv3p3; tb = (-p2 + halfdiscroot) * inv3p3; } float t2; float t3; if(ta > 0.0f && ta < 1.0f) { t2 = ta * ta; t3 = t2 * ta; *extremta = ta; *extrema = p3 * t3 + p2 * t2 + p1 * ta + p0; *upper = fmaxf(*extrema, *upper); *lower = fminf(*extrema, *lower); } if(tb > 0.0f && tb < 1.0f) { t2 = tb * tb; t3 = t2 * tb; *extremtb = tb; *extremb = p3 * t3 + p2 * t2 + p1 * tb + p0; *upper = fmaxf(*extremb, *upper); *lower = fminf(*extremb, *lower); } } #endif /* __HAIR__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_curve_intersect.h000066400000000000000000000667711334742672700252110ustar00rootroot00000000000000/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Curve primitive intersection functions. */ #ifdef __HAIR__ #ifdef __KERNEL_SSE2__ ccl_device_inline ssef transform_point_T3(const ssef t[3], const ssef &a) { return madd(shuffle<0>(a), t[0], madd(shuffle<1>(a), t[1], shuffle<2>(a) * t[2])); } #endif /* On CPU pass P and dir by reference to aligned vector. */ ccl_device_forceinline bool cardinal_curve_intersect( KernelGlobals *kg, Intersection *isect, const float3 ccl_ref P, const float3 ccl_ref dir, uint visibility, int object, int curveAddr, float time, int type, uint *lcg_state, float difl, float extmax) { const bool is_curve_primitive = (type & PRIMITIVE_CURVE); if(!is_curve_primitive && kernel_data.bvh.use_bvh_steps) { const float2 prim_time = kernel_tex_fetch(__prim_time, curveAddr); if(time < prim_time.x || time > prim_time.y) { return false; } } int segment = PRIMITIVE_UNPACK_SEGMENT(type); float epsilon = 0.0f; float r_st, r_en; int depth = kernel_data.curve.subdivisions; int flags = kernel_data.curve.curveflags; int prim = kernel_tex_fetch(__prim_index, curveAddr); #ifdef __KERNEL_SSE2__ ssef vdir = load4f(dir); ssef vcurve_coef[4]; const float3 *curve_coef = (float3 *)vcurve_coef; { ssef dtmp = vdir * vdir; ssef d_ss = mm_sqrt(dtmp + shuffle<2>(dtmp)); ssef rd_ss = load1f_first(1.0f) / d_ss; ssei v00vec = load4i((ssei *)&kg->__curves.data[prim]); int2 &v00 = (int2 &)v00vec; int k0 = v00.x + segment; int k1 = k0 + 1; int ka = max(k0 - 1, v00.x); int kb = min(k1 + 1, v00.x + v00.y - 1); #if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) && (!defined(_MSC_VER) || _MSC_VER > 1800) avxf P_curve_0_1, P_curve_2_3; if(is_curve_primitive) { P_curve_0_1 = _mm256_loadu2_m128(&kg->__curve_keys.data[k0].x, &kg->__curve_keys.data[ka].x); P_curve_2_3 = _mm256_loadu2_m128(&kg->__curve_keys.data[kb].x, &kg->__curve_keys.data[k1].x); } else { int fobject = (object == OBJECT_NONE) ? kernel_tex_fetch(__prim_object, curveAddr) : object; motion_cardinal_curve_keys_avx(kg, fobject, prim, time, ka, k0, k1, kb, &P_curve_0_1,&P_curve_2_3); } #else /* __KERNEL_AVX2__ */ ssef P_curve[4]; if(is_curve_primitive) { P_curve[0] = load4f(&kg->__curve_keys.data[ka].x); P_curve[1] = load4f(&kg->__curve_keys.data[k0].x); P_curve[2] = load4f(&kg->__curve_keys.data[k1].x); P_curve[3] = load4f(&kg->__curve_keys.data[kb].x); } else { int fobject = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, curveAddr): object; motion_cardinal_curve_keys(kg, fobject, prim, time, ka, k0, k1, kb, (float4*)&P_curve); } #endif /* __KERNEL_AVX2__ */ ssef rd_sgn = set_sign_bit<0, 1, 1, 1>(shuffle<0>(rd_ss)); ssef mul_zxxy = shuffle<2, 0, 0, 1>(vdir) * rd_sgn; ssef mul_yz = shuffle<1, 2, 1, 2>(vdir) * mul_zxxy; ssef mul_shuf = shuffle<0, 1, 2, 3>(mul_zxxy, mul_yz); ssef vdir0 = vdir & cast(ssei(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0)); ssef htfm0 = shuffle<0, 2, 0, 3>(mul_shuf, vdir0); ssef htfm1 = shuffle<1, 0, 1, 3>(load1f_first(extract<0>(d_ss)), vdir0); ssef htfm2 = shuffle<1, 3, 2, 3>(mul_shuf, vdir0); #if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) && (!defined(_MSC_VER) || _MSC_VER > 1800) const avxf vPP = _mm256_broadcast_ps(&P.m128); const avxf htfm00 = avxf(htfm0.m128, htfm0.m128); const avxf htfm11 = avxf(htfm1.m128, htfm1.m128); const avxf htfm22 = avxf(htfm2.m128, htfm2.m128); const avxf p01 = madd(shuffle<0>(P_curve_0_1 - vPP), htfm00, madd(shuffle<1>(P_curve_0_1 - vPP), htfm11, shuffle<2>(P_curve_0_1 - vPP) * htfm22)); const avxf p23 = madd(shuffle<0>(P_curve_2_3 - vPP), htfm00, madd(shuffle<1>(P_curve_2_3 - vPP), htfm11, shuffle<2>(P_curve_2_3 - vPP)*htfm22)); const ssef p0 = _mm256_castps256_ps128(p01); const ssef p1 = _mm256_extractf128_ps(p01, 1); const ssef p2 = _mm256_castps256_ps128(p23); const ssef p3 = _mm256_extractf128_ps(p23, 1); const ssef P_curve_1 = _mm256_extractf128_ps(P_curve_0_1, 1); r_st = ((float4 &)P_curve_1).w; const ssef P_curve_2 = _mm256_castps256_ps128(P_curve_2_3); r_en = ((float4 &)P_curve_2).w; #else /* __KERNEL_AVX2__ */ ssef htfm[] = { htfm0, htfm1, htfm2 }; ssef vP = load4f(P); ssef p0 = transform_point_T3(htfm, P_curve[0] - vP); ssef p1 = transform_point_T3(htfm, P_curve[1] - vP); ssef p2 = transform_point_T3(htfm, P_curve[2] - vP); ssef p3 = transform_point_T3(htfm, P_curve[3] - vP); r_st = ((float4 &)P_curve[1]).w; r_en = ((float4 &)P_curve[2]).w; #endif /* __KERNEL_AVX2__ */ float fc = 0.71f; ssef vfc = ssef(fc); ssef vfcxp3 = vfc * p3; vcurve_coef[0] = p1; vcurve_coef[1] = vfc * (p2 - p0); vcurve_coef[2] = madd(ssef(fc * 2.0f), p0, madd(ssef(fc - 3.0f), p1, msub(ssef(3.0f - 2.0f * fc), p2, vfcxp3))); vcurve_coef[3] = msub(ssef(fc - 2.0f), p2 - p1, msub(vfc, p0, vfcxp3)); } #else float3 curve_coef[4]; /* curve Intersection check */ /* obtain curve parameters */ { /* ray transform created - this should be created at beginning of intersection loop */ Transform htfm; float d = sqrtf(dir.x * dir.x + dir.z * dir.z); htfm = make_transform( dir.z / d, 0, -dir.x /d, 0, -dir.x * dir.y /d, d, -dir.y * dir.z /d, 0, dir.x, dir.y, dir.z, 0, 0, 0, 0, 1); float4 v00 = kernel_tex_fetch(__curves, prim); int k0 = __float_as_int(v00.x) + segment; int k1 = k0 + 1; int ka = max(k0 - 1,__float_as_int(v00.x)); int kb = min(k1 + 1,__float_as_int(v00.x) + __float_as_int(v00.y) - 1); float4 P_curve[4]; if(is_curve_primitive) { P_curve[0] = kernel_tex_fetch(__curve_keys, ka); P_curve[1] = kernel_tex_fetch(__curve_keys, k0); P_curve[2] = kernel_tex_fetch(__curve_keys, k1); P_curve[3] = kernel_tex_fetch(__curve_keys, kb); } else { int fobject = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, curveAddr): object; motion_cardinal_curve_keys(kg, fobject, prim, time, ka, k0, k1, kb, P_curve); } float3 p0 = transform_point(&htfm, float4_to_float3(P_curve[0]) - P); float3 p1 = transform_point(&htfm, float4_to_float3(P_curve[1]) - P); float3 p2 = transform_point(&htfm, float4_to_float3(P_curve[2]) - P); float3 p3 = transform_point(&htfm, float4_to_float3(P_curve[3]) - P); float fc = 0.71f; curve_coef[0] = p1; curve_coef[1] = -fc*p0 + fc*p2; curve_coef[2] = 2.0f * fc * p0 + (fc - 3.0f) * p1 + (3.0f - 2.0f * fc) * p2 - fc * p3; curve_coef[3] = -fc * p0 + (2.0f - fc) * p1 + (fc - 2.0f) * p2 + fc * p3; r_st = P_curve[1].w; r_en = P_curve[2].w; } #endif float r_curr = max(r_st, r_en); if((flags & CURVE_KN_RIBBONS) || !(flags & CURVE_KN_BACKFACING)) epsilon = 2 * r_curr; /* find bounds - this is slow for cubic curves */ float upper, lower; float zextrem[4]; curvebounds(&lower, &upper, &zextrem[0], &zextrem[1], &zextrem[2], &zextrem[3], curve_coef[0].z, curve_coef[1].z, curve_coef[2].z, curve_coef[3].z); if(lower - r_curr > isect->t || upper + r_curr < epsilon) return false; /* minimum width extension */ float mw_extension = min(difl * fabsf(upper), extmax); float r_ext = mw_extension + r_curr; float xextrem[4]; curvebounds(&lower, &upper, &xextrem[0], &xextrem[1], &xextrem[2], &xextrem[3], curve_coef[0].x, curve_coef[1].x, curve_coef[2].x, curve_coef[3].x); if(lower > r_ext || upper < -r_ext) return false; float yextrem[4]; curvebounds(&lower, &upper, &yextrem[0], &yextrem[1], &yextrem[2], &yextrem[3], curve_coef[0].y, curve_coef[1].y, curve_coef[2].y, curve_coef[3].y); if(lower > r_ext || upper < -r_ext) return false; /* setup recurrent loop */ int level = 1 << depth; int tree = 0; float resol = 1.0f / (float)level; bool hit = false; /* begin loop */ while(!(tree >> (depth))) { const float i_st = tree * resol; const float i_en = i_st + (level * resol); #ifdef __KERNEL_SSE2__ ssef vi_st = ssef(i_st), vi_en = ssef(i_en); ssef vp_st = madd(madd(madd(vcurve_coef[3], vi_st, vcurve_coef[2]), vi_st, vcurve_coef[1]), vi_st, vcurve_coef[0]); ssef vp_en = madd(madd(madd(vcurve_coef[3], vi_en, vcurve_coef[2]), vi_en, vcurve_coef[1]), vi_en, vcurve_coef[0]); ssef vbmin = min(vp_st, vp_en); ssef vbmax = max(vp_st, vp_en); float3 &bmin = (float3 &)vbmin, &bmax = (float3 &)vbmax; float &bminx = bmin.x, &bminy = bmin.y, &bminz = bmin.z; float &bmaxx = bmax.x, &bmaxy = bmax.y, &bmaxz = bmax.z; float3 &p_st = (float3 &)vp_st, &p_en = (float3 &)vp_en; #else float3 p_st = ((curve_coef[3] * i_st + curve_coef[2]) * i_st + curve_coef[1]) * i_st + curve_coef[0]; float3 p_en = ((curve_coef[3] * i_en + curve_coef[2]) * i_en + curve_coef[1]) * i_en + curve_coef[0]; float bminx = min(p_st.x, p_en.x); float bmaxx = max(p_st.x, p_en.x); float bminy = min(p_st.y, p_en.y); float bmaxy = max(p_st.y, p_en.y); float bminz = min(p_st.z, p_en.z); float bmaxz = max(p_st.z, p_en.z); #endif if(xextrem[0] >= i_st && xextrem[0] <= i_en) { bminx = min(bminx,xextrem[1]); bmaxx = max(bmaxx,xextrem[1]); } if(xextrem[2] >= i_st && xextrem[2] <= i_en) { bminx = min(bminx,xextrem[3]); bmaxx = max(bmaxx,xextrem[3]); } if(yextrem[0] >= i_st && yextrem[0] <= i_en) { bminy = min(bminy,yextrem[1]); bmaxy = max(bmaxy,yextrem[1]); } if(yextrem[2] >= i_st && yextrem[2] <= i_en) { bminy = min(bminy,yextrem[3]); bmaxy = max(bmaxy,yextrem[3]); } if(zextrem[0] >= i_st && zextrem[0] <= i_en) { bminz = min(bminz,zextrem[1]); bmaxz = max(bmaxz,zextrem[1]); } if(zextrem[2] >= i_st && zextrem[2] <= i_en) { bminz = min(bminz,zextrem[3]); bmaxz = max(bmaxz,zextrem[3]); } float r1 = r_st + (r_en - r_st) * i_st; float r2 = r_st + (r_en - r_st) * i_en; r_curr = max(r1, r2); mw_extension = min(difl * fabsf(bmaxz), extmax); float r_ext = mw_extension + r_curr; float coverage = 1.0f; if(bminz - r_curr > isect->t || bmaxz + r_curr < epsilon || bminx > r_ext|| bmaxx < -r_ext|| bminy > r_ext|| bmaxy < -r_ext) { /* the bounding box does not overlap the square centered at O */ tree += level; level = tree & -tree; } else if(level == 1) { /* the maximum recursion depth is reached. * check if dP0.(Q-P0)>=0 and dPn.(Pn-Q)>=0. * dP* is reversed if necessary.*/ float t = isect->t; float u = 0.0f; float gd = 0.0f; if(flags & CURVE_KN_RIBBONS) { float3 tg = (p_en - p_st); #ifdef __KERNEL_SSE__ const float3 tg_sq = tg * tg; float w = tg_sq.x + tg_sq.y; #else float w = tg.x * tg.x + tg.y * tg.y; #endif if(w == 0) { tree++; level = tree & -tree; continue; } #ifdef __KERNEL_SSE__ const float3 p_sttg = p_st * tg; w = -(p_sttg.x + p_sttg.y) / w; #else w = -(p_st.x * tg.x + p_st.y * tg.y) / w; #endif w = saturate(w); /* compute u on the curve segment */ u = i_st * (1 - w) + i_en * w; r_curr = r_st + (r_en - r_st) * u; /* compare x-y distances */ float3 p_curr = ((curve_coef[3] * u + curve_coef[2]) * u + curve_coef[1]) * u + curve_coef[0]; float3 dp_st = (3 * curve_coef[3] * i_st + 2 * curve_coef[2]) * i_st + curve_coef[1]; if(dot(tg, dp_st)< 0) dp_st *= -1; if(dot(dp_st, -p_st) + p_curr.z * dp_st.z < 0) { tree++; level = tree & -tree; continue; } float3 dp_en = (3 * curve_coef[3] * i_en + 2 * curve_coef[2]) * i_en + curve_coef[1]; if(dot(tg, dp_en) < 0) dp_en *= -1; if(dot(dp_en, p_en) - p_curr.z * dp_en.z < 0) { tree++; level = tree & -tree; continue; } /* compute coverage */ float r_ext = r_curr; coverage = 1.0f; if(difl != 0.0f) { mw_extension = min(difl * fabsf(bmaxz), extmax); r_ext = mw_extension + r_curr; #ifdef __KERNEL_SSE__ const float3 p_curr_sq = p_curr * p_curr; const float3 dxxx(_mm_sqrt_ss(_mm_hadd_ps(p_curr_sq.m128, p_curr_sq.m128))); float d = dxxx.x; #else float d = sqrtf(p_curr.x * p_curr.x + p_curr.y * p_curr.y); #endif float d0 = d - r_curr; float d1 = d + r_curr; float inv_mw_extension = 1.0f/mw_extension; if(d0 >= 0) coverage = (min(d1 * inv_mw_extension, 1.0f) - min(d0 * inv_mw_extension, 1.0f)) * 0.5f; else // inside coverage = (min(d1 * inv_mw_extension, 1.0f) + min(-d0 * inv_mw_extension, 1.0f)) * 0.5f; } if(p_curr.x * p_curr.x + p_curr.y * p_curr.y >= r_ext * r_ext || p_curr.z <= epsilon || isect->t < p_curr.z) { tree++; level = tree & -tree; continue; } t = p_curr.z; /* stochastic fade from minimum width */ if(difl != 0.0f && lcg_state) { if(coverage != 1.0f && (lcg_step_float(lcg_state) > coverage)) return hit; } } else { float l = len(p_en - p_st); /* minimum width extension */ float or1 = r1; float or2 = r2; if(difl != 0.0f) { mw_extension = min(len(p_st - P) * difl, extmax); or1 = r1 < mw_extension ? mw_extension : r1; mw_extension = min(len(p_en - P) * difl, extmax); or2 = r2 < mw_extension ? mw_extension : r2; } /* --- */ float invl = 1.0f/l; float3 tg = (p_en - p_st) * invl; gd = (or2 - or1) * invl; float difz = -dot(p_st,tg); float cyla = 1.0f - (tg.z * tg.z * (1 + gd*gd)); float invcyla = 1.0f/cyla; float halfb = (-p_st.z - tg.z*(difz + gd*(difz*gd + or1))); float tcentre = -halfb*invcyla; float zcentre = difz + (tg.z * tcentre); float3 tdif = - p_st; tdif.z += tcentre; float tdifz = dot(tdif,tg); float tb = 2*(tdif.z - tg.z*(tdifz + gd*(tdifz*gd + or1))); float tc = dot(tdif,tdif) - tdifz * tdifz * (1 + gd*gd) - or1*or1 - 2*or1*tdifz*gd; float td = tb*tb - 4*cyla*tc; if(td < 0.0f) { tree++; level = tree & -tree; continue; } float rootd = sqrtf(td); float correction = (-tb - rootd) * 0.5f * invcyla; t = tcentre + correction; float3 dp_st = (3 * curve_coef[3] * i_st + 2 * curve_coef[2]) * i_st + curve_coef[1]; if(dot(tg, dp_st)< 0) dp_st *= -1; float3 dp_en = (3 * curve_coef[3] * i_en + 2 * curve_coef[2]) * i_en + curve_coef[1]; if(dot(tg, dp_en) < 0) dp_en *= -1; if(flags & CURVE_KN_BACKFACING && (dot(dp_st, -p_st) + t * dp_st.z < 0 || dot(dp_en, p_en) - t * dp_en.z < 0 || isect->t < t || t <= 0.0f)) { correction = (-tb + rootd) * 0.5f * invcyla; t = tcentre + correction; } if(dot(dp_st, -p_st) + t * dp_st.z < 0 || dot(dp_en, p_en) - t * dp_en.z < 0 || isect->t < t || t <= 0.0f) { tree++; level = tree & -tree; continue; } float w = (zcentre + (tg.z * correction)) * invl; w = saturate(w); /* compute u on the curve segment */ u = i_st * (1 - w) + i_en * w; /* stochastic fade from minimum width */ if(difl != 0.0f && lcg_state) { r_curr = r1 + (r2 - r1) * w; r_ext = or1 + (or2 - or1) * w; coverage = r_curr/r_ext; if(coverage != 1.0f && (lcg_step_float(lcg_state) > coverage)) return hit; } } /* we found a new intersection */ #ifdef __VISIBILITY_FLAG__ /* visibility flag test. we do it here under the assumption * that most triangles are culled by node flags */ if(kernel_tex_fetch(__prim_visibility, curveAddr) & visibility) #endif { /* record intersection */ isect->t = t; isect->u = u; isect->v = gd; isect->prim = curveAddr; isect->object = object; isect->type = type; hit = true; } tree++; level = tree & -tree; } else { /* split the curve into two curves and process */ level = level >> 1; } } return hit; } ccl_device_forceinline bool curve_intersect(KernelGlobals *kg, Intersection *isect, float3 P, float3 direction, uint visibility, int object, int curveAddr, float time, int type, uint *lcg_state, float difl, float extmax) { /* define few macros to minimize code duplication for SSE */ #ifndef __KERNEL_SSE2__ # define len3_squared(x) len_squared(x) # define len3(x) len(x) # define dot3(x, y) dot(x, y) #endif const bool is_curve_primitive = (type & PRIMITIVE_CURVE); if(!is_curve_primitive && kernel_data.bvh.use_bvh_steps) { const float2 prim_time = kernel_tex_fetch(__prim_time, curveAddr); if(time < prim_time.x || time > prim_time.y) { return false; } } int segment = PRIMITIVE_UNPACK_SEGMENT(type); /* curve Intersection check */ int flags = kernel_data.curve.curveflags; int prim = kernel_tex_fetch(__prim_index, curveAddr); float4 v00 = kernel_tex_fetch(__curves, prim); int cnum = __float_as_int(v00.x); int k0 = cnum + segment; int k1 = k0 + 1; #ifndef __KERNEL_SSE2__ float4 P_curve[2]; if(is_curve_primitive) { P_curve[0] = kernel_tex_fetch(__curve_keys, k0); P_curve[1] = kernel_tex_fetch(__curve_keys, k1); } else { int fobject = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, curveAddr): object; motion_curve_keys(kg, fobject, prim, time, k0, k1, P_curve); } float or1 = P_curve[0].w; float or2 = P_curve[1].w; float3 p1 = float4_to_float3(P_curve[0]); float3 p2 = float4_to_float3(P_curve[1]); /* minimum width extension */ float r1 = or1; float r2 = or2; float3 dif = P - p1; float3 dif_second = P - p2; if(difl != 0.0f) { float pixelsize = min(len3(dif) * difl, extmax); r1 = or1 < pixelsize ? pixelsize : or1; pixelsize = min(len3(dif_second) * difl, extmax); r2 = or2 < pixelsize ? pixelsize : or2; } /* --- */ float3 p21_diff = p2 - p1; float3 sphere_dif1 = (dif + dif_second) * 0.5f; float3 dir = direction; float sphere_b_tmp = dot3(dir, sphere_dif1); float3 sphere_dif2 = sphere_dif1 - sphere_b_tmp * dir; #else ssef P_curve[2]; if(is_curve_primitive) { P_curve[0] = load4f(&kg->__curve_keys.data[k0].x); P_curve[1] = load4f(&kg->__curve_keys.data[k1].x); } else { int fobject = (object == OBJECT_NONE)? kernel_tex_fetch(__prim_object, curveAddr): object; motion_curve_keys(kg, fobject, prim, time, k0, k1, (float4*)&P_curve); } const ssef or12 = shuffle<3, 3, 3, 3>(P_curve[0], P_curve[1]); ssef r12 = or12; const ssef vP = load4f(P); const ssef dif = vP - P_curve[0]; const ssef dif_second = vP - P_curve[1]; if(difl != 0.0f) { const ssef len1_sq = len3_squared_splat(dif); const ssef len2_sq = len3_squared_splat(dif_second); const ssef len12 = mm_sqrt(shuffle<0, 0, 0, 0>(len1_sq, len2_sq)); const ssef pixelsize12 = min(len12 * difl, ssef(extmax)); r12 = max(or12, pixelsize12); } float or1 = extract<0>(or12), or2 = extract<0>(shuffle<2>(or12)); float r1 = extract<0>(r12), r2 = extract<0>(shuffle<2>(r12)); const ssef p21_diff = P_curve[1] - P_curve[0]; const ssef sphere_dif1 = (dif + dif_second) * 0.5f; const ssef dir = load4f(direction); const ssef sphere_b_tmp = dot3_splat(dir, sphere_dif1); const ssef sphere_dif2 = nmadd(sphere_b_tmp, dir, sphere_dif1); #endif float mr = max(r1, r2); float l = len3(p21_diff); float invl = 1.0f / l; float sp_r = mr + 0.5f * l; float sphere_b = dot3(dir, sphere_dif2); float sdisc = sphere_b * sphere_b - len3_squared(sphere_dif2) + sp_r * sp_r; if(sdisc < 0.0f) return false; /* obtain parameters and test midpoint distance for suitable modes */ #ifndef __KERNEL_SSE2__ float3 tg = p21_diff * invl; #else const ssef tg = p21_diff * invl; #endif float gd = (r2 - r1) * invl; float dirz = dot3(dir, tg); float difz = dot3(dif, tg); float a = 1.0f - (dirz*dirz*(1 + gd*gd)); float halfb = dot3(dir, dif) - dirz*(difz + gd*(difz*gd + r1)); float tcentre = -halfb/a; float zcentre = difz + (dirz * tcentre); if((tcentre > isect->t) && !(flags & CURVE_KN_ACCURATE)) return false; if((zcentre < 0 || zcentre > l) && !(flags & CURVE_KN_ACCURATE) && !(flags & CURVE_KN_INTERSECTCORRECTION)) return false; /* test minimum separation */ #ifndef __KERNEL_SSE2__ float3 cprod = cross(tg, dir); float cprod2sq = len3_squared(cross(tg, dif)); #else const ssef cprod = cross(tg, dir); float cprod2sq = len3_squared(cross_zxy(tg, dif)); #endif float cprodsq = len3_squared(cprod); float distscaled = dot3(cprod, dif); if(cprodsq == 0) distscaled = cprod2sq; else distscaled = (distscaled*distscaled)/cprodsq; if(distscaled > mr*mr) return false; /* calculate true intersection */ #ifndef __KERNEL_SSE2__ float3 tdif = dif + tcentre * dir; #else const ssef tdif = madd(ssef(tcentre), dir, dif); #endif float tdifz = dot3(tdif, tg); float tdifma = tdifz*gd + r1; float tb = 2*(dot3(dir, tdif) - dirz*(tdifz + gd*tdifma)); float tc = dot3(tdif, tdif) - tdifz*tdifz - tdifma*tdifma; float td = tb*tb - 4*a*tc; if(td < 0.0f) return false; float rootd = 0.0f; float correction = 0.0f; if(flags & CURVE_KN_ACCURATE) { rootd = sqrtf(td); correction = ((-tb - rootd)/(2*a)); } float t = tcentre + correction; if(t < isect->t) { if(flags & CURVE_KN_INTERSECTCORRECTION) { rootd = sqrtf(td); correction = ((-tb - rootd)/(2*a)); t = tcentre + correction; } float z = zcentre + (dirz * correction); // bool backface = false; if(flags & CURVE_KN_BACKFACING && (t < 0.0f || z < 0 || z > l)) { // backface = true; correction = ((-tb + rootd)/(2*a)); t = tcentre + correction; z = zcentre + (dirz * correction); } /* stochastic fade from minimum width */ float adjradius = or1 + z * (or2 - or1) * invl; adjradius = adjradius / (r1 + z * gd); if(lcg_state && adjradius != 1.0f) { if(lcg_step_float(lcg_state) > adjradius) return false; } /* --- */ if(t > 0.0f && t < isect->t && z >= 0 && z <= l) { if(flags & CURVE_KN_ENCLOSEFILTER) { float enc_ratio = 1.01f; if((difz > -r1 * enc_ratio) && (dot3(dif_second, tg) < r2 * enc_ratio)) { float a2 = 1.0f - (dirz*dirz*(1 + gd*gd*enc_ratio*enc_ratio)); float c2 = dot3(dif, dif) - difz * difz * (1 + gd*gd*enc_ratio*enc_ratio) - r1*r1*enc_ratio*enc_ratio - 2*r1*difz*gd*enc_ratio; if(a2*c2 < 0.0f) return false; } } #ifdef __VISIBILITY_FLAG__ /* visibility flag test. we do it here under the assumption * that most triangles are culled by node flags */ if(kernel_tex_fetch(__prim_visibility, curveAddr) & visibility) #endif { /* record intersection */ isect->t = t; isect->u = z*invl; isect->v = gd; isect->prim = curveAddr; isect->object = object; isect->type = type; return true; } } } return false; #ifndef __KERNEL_SSE2__ # undef len3_squared # undef len3 # undef dot3 #endif } ccl_device_inline float3 curvetangent(float t, float3 p0, float3 p1, float3 p2, float3 p3) { float fc = 0.71f; float data[4]; float t2 = t * t; data[0] = -3.0f * fc * t2 + 4.0f * fc * t - fc; data[1] = 3.0f * (2.0f - fc) * t2 + 2.0f * (fc - 3.0f) * t; data[2] = 3.0f * (fc - 2.0f) * t2 + 2.0f * (3.0f - 2.0f * fc) * t + fc; data[3] = 3.0f * fc * t2 - 2.0f * fc * t; return data[0] * p0 + data[1] * p1 + data[2] * p2 + data[3] * p3; } ccl_device_inline float3 curvepoint(float t, float3 p0, float3 p1, float3 p2, float3 p3) { float data[4]; float fc = 0.71f; float t2 = t * t; float t3 = t2 * t; data[0] = -fc * t3 + 2.0f * fc * t2 - fc * t; data[1] = (2.0f - fc) * t3 + (fc - 3.0f) * t2 + 1.0f; data[2] = (fc - 2.0f) * t3 + (3.0f - 2.0f * fc) * t2 + fc * t; data[3] = fc * t3 - fc * t2; return data[0] * p0 + data[1] * p1 + data[2] * p2 + data[3] * p3; } ccl_device_inline float3 curve_refine(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray) { int flag = kernel_data.curve.curveflags; float t = isect->t; float3 P = ray->P; float3 D = ray->D; if(isect->object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_itfm; #else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_INVERSE_TRANSFORM); #endif P = transform_point(&tfm, P); D = transform_direction(&tfm, D*t); D = normalize_len(D, &t); } int prim = kernel_tex_fetch(__prim_index, isect->prim); float4 v00 = kernel_tex_fetch(__curves, prim); int k0 = __float_as_int(v00.x) + PRIMITIVE_UNPACK_SEGMENT(sd->type); int k1 = k0 + 1; float3 tg; if(flag & CURVE_KN_INTERPOLATE) { int ka = max(k0 - 1,__float_as_int(v00.x)); int kb = min(k1 + 1,__float_as_int(v00.x) + __float_as_int(v00.y) - 1); float4 P_curve[4]; if(sd->type & PRIMITIVE_CURVE) { P_curve[0] = kernel_tex_fetch(__curve_keys, ka); P_curve[1] = kernel_tex_fetch(__curve_keys, k0); P_curve[2] = kernel_tex_fetch(__curve_keys, k1); P_curve[3] = kernel_tex_fetch(__curve_keys, kb); } else { motion_cardinal_curve_keys(kg, sd->object, sd->prim, sd->time, ka, k0, k1, kb, P_curve); } float3 p[4]; p[0] = float4_to_float3(P_curve[0]); p[1] = float4_to_float3(P_curve[1]); p[2] = float4_to_float3(P_curve[2]); p[3] = float4_to_float3(P_curve[3]); P = P + D*t; #ifdef __UV__ sd->u = isect->u; sd->v = 0.0f; #endif tg = normalize(curvetangent(isect->u, p[0], p[1], p[2], p[3])); if(kernel_data.curve.curveflags & CURVE_KN_RIBBONS) { sd->Ng = normalize(-(D - tg * (dot(tg, D)))); } else { /* direction from inside to surface of curve */ float3 p_curr = curvepoint(isect->u, p[0], p[1], p[2], p[3]); sd->Ng = normalize(P - p_curr); /* adjustment for changing radius */ float gd = isect->v; if(gd != 0.0f) { sd->Ng = sd->Ng - gd * tg; sd->Ng = normalize(sd->Ng); } } /* todo: sometimes the normal is still so that this is detected as * backfacing even if cull backfaces is enabled */ sd->N = sd->Ng; } else { float4 P_curve[2]; if(sd->type & PRIMITIVE_CURVE) { P_curve[0]= kernel_tex_fetch(__curve_keys, k0); P_curve[1]= kernel_tex_fetch(__curve_keys, k1); } else { motion_curve_keys(kg, sd->object, sd->prim, sd->time, k0, k1, P_curve); } float l = 1.0f; tg = normalize_len(float4_to_float3(P_curve[1] - P_curve[0]), &l); P = P + D*t; float3 dif = P - float4_to_float3(P_curve[0]); #ifdef __UV__ sd->u = dot(dif,tg)/l; sd->v = 0.0f; #endif if(flag & CURVE_KN_TRUETANGENTGNORMAL) { sd->Ng = -(D - tg * dot(tg, D)); sd->Ng = normalize(sd->Ng); } else { float gd = isect->v; /* direction from inside to surface of curve */ sd->Ng = (dif - tg * sd->u * l) / (P_curve[0].w + sd->u * l * gd); /* adjustment for changing radius */ if(gd != 0.0f) { sd->Ng = sd->Ng - gd * tg; sd->Ng = normalize(sd->Ng); } } sd->N = sd->Ng; } #ifdef __DPDU__ /* dPdu/dPdv */ sd->dPdu = tg; sd->dPdv = cross(tg, sd->Ng); #endif if(isect->object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_tfm; #else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_TRANSFORM); #endif P = transform_point(&tfm, P); } return P; } #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_motion_curve.h000066400000000000000000000176501334742672700245060ustar00rootroot00000000000000/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Motion Curve Primitive * * These are stored as regular curves, plus extra positions and radii at times * other than the frame center. Computing the curve keys at a given ray time is * a matter of interpolation of the two steps between which the ray time lies. * * The extra curve keys are stored as ATTR_STD_MOTION_VERTEX_POSITION. */ #ifdef __HAIR__ ccl_device_inline int find_attribute_curve_motion(KernelGlobals *kg, int object, uint id, AttributeElement *elem) { /* todo: find a better (faster) solution for this, maybe store offset per object. * * NOTE: currently it's not a bottleneck because in test scenes the loop below runs * zero iterations and rendering is really slow with motion curves. For until other * areas are speed up it's probably not so crucial to optimize this out. */ uint attr_offset = object_attribute_map_offset(kg, object) + ATTR_PRIM_CURVE; uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset); while(attr_map.x != id) { attr_offset += ATTR_PRIM_TYPES; attr_map = kernel_tex_fetch(__attributes_map, attr_offset); } *elem = (AttributeElement)attr_map.y; /* return result */ return (attr_map.y == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : (int)attr_map.z; } ccl_device_inline void motion_curve_keys_for_step(KernelGlobals *kg, int offset, int numkeys, int numsteps, int step, int k0, int k1, float4 keys[2]) { if(step == numsteps) { /* center step: regular key location */ keys[0] = kernel_tex_fetch(__curve_keys, k0); keys[1] = kernel_tex_fetch(__curve_keys, k1); } else { /* center step is not stored in this array */ if(step > numsteps) step--; offset += step*numkeys; keys[0] = kernel_tex_fetch(__attributes_float3, offset + k0); keys[1] = kernel_tex_fetch(__attributes_float3, offset + k1); } } /* return 2 curve key locations */ ccl_device_inline void motion_curve_keys(KernelGlobals *kg, int object, int prim, float time, int k0, int k1, float4 keys[2]) { /* get motion info */ int numsteps, numkeys; object_motion_info(kg, object, &numsteps, NULL, &numkeys); /* figure out which steps we need to fetch and their interpolation factor */ int maxstep = numsteps*2; int step = min((int)(time*maxstep), maxstep-1); float t = time*maxstep - step; /* find attribute */ AttributeElement elem; int offset = find_attribute_curve_motion(kg, object, ATTR_STD_MOTION_VERTEX_POSITION, &elem); kernel_assert(offset != ATTR_STD_NOT_FOUND); /* fetch key coordinates */ float4 next_keys[2]; motion_curve_keys_for_step(kg, offset, numkeys, numsteps, step, k0, k1, keys); motion_curve_keys_for_step(kg, offset, numkeys, numsteps, step+1, k0, k1, next_keys); /* interpolate between steps */ keys[0] = (1.0f - t)*keys[0] + t*next_keys[0]; keys[1] = (1.0f - t)*keys[1] + t*next_keys[1]; } ccl_device_inline void motion_cardinal_curve_keys_for_step(KernelGlobals *kg, int offset, int numkeys, int numsteps, int step, int k0, int k1, int k2, int k3, float4 keys[4]) { if(step == numsteps) { /* center step: regular key location */ keys[0] = kernel_tex_fetch(__curve_keys, k0); keys[1] = kernel_tex_fetch(__curve_keys, k1); keys[2] = kernel_tex_fetch(__curve_keys, k2); keys[3] = kernel_tex_fetch(__curve_keys, k3); } else { /* center step is not stored in this array */ if(step > numsteps) step--; offset += step*numkeys; keys[0] = kernel_tex_fetch(__attributes_float3, offset + k0); keys[1] = kernel_tex_fetch(__attributes_float3, offset + k1); keys[2] = kernel_tex_fetch(__attributes_float3, offset + k2); keys[3] = kernel_tex_fetch(__attributes_float3, offset + k3); } } /* return 2 curve key locations */ ccl_device_inline void motion_cardinal_curve_keys(KernelGlobals *kg, int object, int prim, float time, int k0, int k1, int k2, int k3, float4 keys[4]) { /* get motion info */ int numsteps, numkeys; object_motion_info(kg, object, &numsteps, NULL, &numkeys); /* figure out which steps we need to fetch and their interpolation factor */ int maxstep = numsteps*2; int step = min((int)(time*maxstep), maxstep-1); float t = time*maxstep - step; /* find attribute */ AttributeElement elem; int offset = find_attribute_curve_motion(kg, object, ATTR_STD_MOTION_VERTEX_POSITION, &elem); kernel_assert(offset != ATTR_STD_NOT_FOUND); /* fetch key coordinates */ float4 next_keys[4]; motion_cardinal_curve_keys_for_step(kg, offset, numkeys, numsteps, step, k0, k1, k2, k3, keys); motion_cardinal_curve_keys_for_step(kg, offset, numkeys, numsteps, step+1, k0, k1, k2, k3, next_keys); /* interpolate between steps */ keys[0] = (1.0f - t)*keys[0] + t*next_keys[0]; keys[1] = (1.0f - t)*keys[1] + t*next_keys[1]; keys[2] = (1.0f - t)*keys[2] + t*next_keys[2]; keys[3] = (1.0f - t)*keys[3] + t*next_keys[3]; } #if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) /* Similar to above, but returns keys as pair of two AVX registers with each * holding two float4. */ ccl_device_inline void motion_cardinal_curve_keys_avx(KernelGlobals *kg, int object, int prim, float time, int k0, int k1, int k2, int k3, avxf *out_keys_0_1, avxf *out_keys_2_3) { /* Get motion info. */ int numsteps, numkeys; object_motion_info(kg, object, &numsteps, NULL, &numkeys); /* Figure out which steps we need to fetch and their interpolation factor. */ int maxstep = numsteps * 2; int step = min((int)(time*maxstep), maxstep - 1); float t = time*maxstep - step; /* Find attribute. */ AttributeElement elem; int offset = find_attribute_curve_motion(kg, object, ATTR_STD_MOTION_VERTEX_POSITION, &elem); kernel_assert(offset != ATTR_STD_NOT_FOUND); /* Fetch key coordinates. */ float4 next_keys[4]; float4 keys[4]; motion_cardinal_curve_keys_for_step(kg, offset, numkeys, numsteps, step, k0, k1, k2, k3, keys); motion_cardinal_curve_keys_for_step(kg, offset, numkeys, numsteps, step + 1, k0, k1, k2, k3, next_keys); const avxf keys_0_1 = avxf(keys[0].m128, keys[1].m128); const avxf keys_2_3 = avxf(keys[2].m128, keys[3].m128); const avxf next_keys_0_1 = avxf(next_keys[0].m128, next_keys[1].m128); const avxf next_keys_2_3 = avxf(next_keys[2].m128, next_keys[3].m128); /* Interpolate between steps. */ *out_keys_0_1 = (1.0f - t) * keys_0_1 + t*next_keys_0_1; *out_keys_2_3 = (1.0f - t) * keys_2_3 + t*next_keys_2_3; } #endif #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_motion_triangle.h000066400000000000000000000134211334742672700251570ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Motion Triangle Primitive * * These are stored as regular triangles, plus extra positions and normals at * times other than the frame center. Computing the triangle vertex positions * or normals at a given ray time is a matter of interpolation of the two steps * between which the ray time lies. * * The extra positions and normals are stored as ATTR_STD_MOTION_VERTEX_POSITION * and ATTR_STD_MOTION_VERTEX_NORMAL mesh attributes. */ CCL_NAMESPACE_BEGIN /* Time interpolation of vertex positions and normals */ ccl_device_inline int find_attribute_motion(KernelGlobals *kg, int object, uint id, AttributeElement *elem) { /* todo: find a better (faster) solution for this, maybe store offset per object */ uint attr_offset = object_attribute_map_offset(kg, object); uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset); while(attr_map.x != id) { attr_offset += ATTR_PRIM_TYPES; attr_map = kernel_tex_fetch(__attributes_map, attr_offset); } *elem = (AttributeElement)attr_map.y; /* return result */ return (attr_map.y == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : (int)attr_map.z; } ccl_device_inline void motion_triangle_verts_for_step(KernelGlobals *kg, uint4 tri_vindex, int offset, int numverts, int numsteps, int step, float3 verts[3]) { if(step == numsteps) { /* center step: regular vertex location */ verts[0] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+0)); verts[1] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+1)); verts[2] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+2)); } else { /* center step not store in this array */ if(step > numsteps) step--; offset += step*numverts; verts[0] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.x)); verts[1] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.y)); verts[2] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.z)); } } ccl_device_inline void motion_triangle_normals_for_step(KernelGlobals *kg, uint4 tri_vindex, int offset, int numverts, int numsteps, int step, float3 normals[3]) { if(step == numsteps) { /* center step: regular vertex location */ normals[0] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.x)); normals[1] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.y)); normals[2] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.z)); } else { /* center step is not stored in this array */ if(step > numsteps) step--; offset += step*numverts; normals[0] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.x)); normals[1] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.y)); normals[2] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.z)); } } ccl_device_inline void motion_triangle_vertices(KernelGlobals *kg, int object, int prim, float time, float3 verts[3]) { /* get motion info */ int numsteps, numverts; object_motion_info(kg, object, &numsteps, &numverts, NULL); /* figure out which steps we need to fetch and their interpolation factor */ int maxstep = numsteps*2; int step = min((int)(time*maxstep), maxstep-1); float t = time*maxstep - step; /* find attribute */ AttributeElement elem; int offset = find_attribute_motion(kg, object, ATTR_STD_MOTION_VERTEX_POSITION, &elem); kernel_assert(offset != ATTR_STD_NOT_FOUND); /* fetch vertex coordinates */ float3 next_verts[3]; uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim); motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step, verts); motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step+1, next_verts); /* interpolate between steps */ verts[0] = (1.0f - t)*verts[0] + t*next_verts[0]; verts[1] = (1.0f - t)*verts[1] + t*next_verts[1]; verts[2] = (1.0f - t)*verts[2] + t*next_verts[2]; } ccl_device_inline float3 motion_triangle_smooth_normal(KernelGlobals *kg, float3 Ng, int object, int prim, float u, float v, float time) { /* get motion info */ int numsteps, numverts; object_motion_info(kg, object, &numsteps, &numverts, NULL); /* figure out which steps we need to fetch and their interpolation factor */ int maxstep = numsteps*2; int step = min((int)(time*maxstep), maxstep-1); float t = time*maxstep - step; /* find attribute */ AttributeElement elem; int offset = find_attribute_motion(kg, object, ATTR_STD_MOTION_VERTEX_NORMAL, &elem); kernel_assert(offset != ATTR_STD_NOT_FOUND); /* fetch normals */ float3 normals[3], next_normals[3]; uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim); motion_triangle_normals_for_step(kg, tri_vindex, offset, numverts, numsteps, step, normals); motion_triangle_normals_for_step(kg, tri_vindex, offset, numverts, numsteps, step+1, next_normals); /* interpolate between steps */ normals[0] = (1.0f - t)*normals[0] + t*next_normals[0]; normals[1] = (1.0f - t)*normals[1] + t*next_normals[1]; normals[2] = (1.0f - t)*normals[2] + t*next_normals[2]; /* interpolate between vertices */ float w = 1.0f - u - v; float3 N = safe_normalize(u*normals[0] + v*normals[1] + w*normals[2]); return is_zero(N)? Ng: N; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_motion_triangle_intersect.h000066400000000000000000000210201334742672700272310ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Motion Triangle Primitive * * These are stored as regular triangles, plus extra positions and normals at * times other than the frame center. Computing the triangle vertex positions * or normals at a given ray time is a matter of interpolation of the two steps * between which the ray time lies. * * The extra positions and normals are stored as ATTR_STD_MOTION_VERTEX_POSITION * and ATTR_STD_MOTION_VERTEX_NORMAL mesh attributes. */ CCL_NAMESPACE_BEGIN /* Refine triangle intersection to more precise hit point. For rays that travel * far the precision is often not so good, this reintersects the primitive from * a closer distance. */ ccl_device_inline float3 motion_triangle_refine(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray, float3 verts[3]) { float3 P = ray->P; float3 D = ray->D; float t = isect->t; #ifdef __INTERSECTION_REFINE__ if(isect->object != OBJECT_NONE) { if(UNLIKELY(t == 0.0f)) { return P; } # ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_itfm; # else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_INVERSE_TRANSFORM); # endif P = transform_point(&tfm, P); D = transform_direction(&tfm, D*t); D = normalize_len(D, &t); } P = P + D*t; /* Compute refined intersection distance. */ const float3 e1 = verts[0] - verts[2]; const float3 e2 = verts[1] - verts[2]; const float3 s1 = cross(D, e2); const float invdivisor = 1.0f/dot(s1, e1); const float3 d = P - verts[2]; const float3 s2 = cross(d, e1); float rt = dot(e2, s2)*invdivisor; /* Compute refined position. */ P = P + D*rt; if(isect->object != OBJECT_NONE) { # ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_tfm; # else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_TRANSFORM); # endif P = transform_point(&tfm, P); } return P; #else return P + D*t; #endif } /* Same as above, except that isect->t is assumed to be in object space * for instancing. */ #ifdef __BVH_LOCAL__ # if defined(__KERNEL_CUDA__) && (defined(i386) || defined(_M_IX86)) ccl_device_noinline # else ccl_device_inline # endif float3 motion_triangle_refine_local(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray, float3 verts[3]) { float3 P = ray->P; float3 D = ray->D; float t = isect->t; # ifdef __INTERSECTION_REFINE__ if(isect->object != OBJECT_NONE) { # ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_itfm; # else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_INVERSE_TRANSFORM); # endif P = transform_point(&tfm, P); D = transform_direction(&tfm, D); D = normalize(D); } P = P + D*t; /* compute refined intersection distance */ const float3 e1 = verts[0] - verts[2]; const float3 e2 = verts[1] - verts[2]; const float3 s1 = cross(D, e2); const float invdivisor = 1.0f/dot(s1, e1); const float3 d = P - verts[2]; const float3 s2 = cross(d, e1); float rt = dot(e2, s2)*invdivisor; P = P + D*rt; if(isect->object != OBJECT_NONE) { # ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_tfm; # else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_TRANSFORM); # endif P = transform_point(&tfm, P); } return P; # else /* __INTERSECTION_REFINE__ */ return P + D*t; # endif /* __INTERSECTION_REFINE__ */ } #endif /* __BVH_LOCAL__ */ /* Ray intersection. We simply compute the vertex positions at the given ray * time and do a ray intersection with the resulting triangle. */ ccl_device_inline bool motion_triangle_intersect( KernelGlobals *kg, Intersection *isect, float3 P, float3 dir, float time, uint visibility, int object, int prim_addr) { /* Primitive index for vertex location lookup. */ int prim = kernel_tex_fetch(__prim_index, prim_addr); int fobject = (object == OBJECT_NONE) ? kernel_tex_fetch(__prim_object, prim_addr) : object; /* Get vertex locations for intersection. */ float3 verts[3]; motion_triangle_vertices(kg, fobject, prim, time, verts); /* Ray-triangle intersection, unoptimized. */ float t, u, v; if(ray_triangle_intersect(P, dir, isect->t, #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) (ssef*)verts, #else verts[0], verts[1], verts[2], #endif &u, &v, &t)) { #ifdef __VISIBILITY_FLAG__ /* Visibility flag test. we do it here under the assumption * that most triangles are culled by node flags. */ if(kernel_tex_fetch(__prim_visibility, prim_addr) & visibility) #endif { isect->t = t; isect->u = u; isect->v = v; isect->prim = prim_addr; isect->object = object; isect->type = PRIMITIVE_MOTION_TRIANGLE; return true; } } return false; } /* Special ray intersection routines for local intersections. In that case we * only want to intersect with primitives in the same object, and if case of * multiple hits we pick a single random primitive as the intersection point. */ #ifdef __BVH_LOCAL__ ccl_device_inline void motion_triangle_intersect_local( KernelGlobals *kg, LocalIntersection *local_isect, float3 P, float3 dir, float time, int object, int local_object, int prim_addr, float tmax, uint *lcg_state, int max_hits) { /* Only intersect with matching object, for instanced objects we * already know we are only intersecting the right object. */ if(object == OBJECT_NONE) { if(kernel_tex_fetch(__prim_object, prim_addr) != local_object) { return; } } /* Primitive index for vertex location lookup. */ int prim = kernel_tex_fetch(__prim_index, prim_addr); /* Get vertex locations for intersection. */ float3 verts[3]; motion_triangle_vertices(kg, local_object, prim, time, verts); /* Ray-triangle intersection, unoptimized. */ float t, u, v; if(!ray_triangle_intersect(P, dir, tmax, #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) (ssef*)verts, #else verts[0], verts[1], verts[2], #endif &u, &v, &t)) { return; } int hit; if(lcg_state) { /* Record up to max_hits intersections. */ for(int i = min(max_hits, local_isect->num_hits) - 1; i >= 0; --i) { if(local_isect->hits[i].t == t) { return; } } local_isect->num_hits++; if(local_isect->num_hits <= max_hits) { hit = local_isect->num_hits - 1; } else { /* Reservoir sampling: if we are at the maximum number of * hits, randomly replace element or skip it. */ hit = lcg_step_uint(lcg_state) % local_isect->num_hits; if(hit >= max_hits) return; } } else { /* Record closest intersection only. */ if(local_isect->num_hits && t > local_isect->hits[0].t) { return; } hit = 0; local_isect->num_hits = 1; } /* Record intersection. */ Intersection *isect = &local_isect->hits[hit]; isect->t = t; isect->u = u; isect->v = v; isect->prim = prim_addr; isect->object = object; isect->type = PRIMITIVE_MOTION_TRIANGLE; /* Record geometric normal. */ local_isect->Ng[hit] = normalize(cross(verts[1] - verts[0], verts[2] - verts[0])); } #endif /* __BVH_LOCAL__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_motion_triangle_shader.h000066400000000000000000000112141334742672700265030ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Motion Triangle Primitive * * These are stored as regular triangles, plus extra positions and normals at * times other than the frame center. Computing the triangle vertex positions * or normals at a given ray time is a matter of interpolation of the two steps * between which the ray time lies. * * The extra positions and normals are stored as ATTR_STD_MOTION_VERTEX_POSITION * and ATTR_STD_MOTION_VERTEX_NORMAL mesh attributes. */ CCL_NAMESPACE_BEGIN /* Setup of motion triangle specific parts of ShaderData, moved into this one * function to more easily share computation of interpolated positions and * normals */ /* return 3 triangle vertex normals */ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray, bool is_local) { /* Get shader. */ sd->shader = kernel_tex_fetch(__tri_shader, sd->prim); /* Get motion info. */ /* TODO(sergey): This logic is really similar to motion_triangle_vertices(), * can we de-duplicate something here? */ int numsteps, numverts; object_motion_info(kg, sd->object, &numsteps, &numverts, NULL); /* Figure out which steps we need to fetch and their interpolation factor. */ int maxstep = numsteps*2; int step = min((int)(sd->time*maxstep), maxstep-1); float t = sd->time*maxstep - step; /* Find attribute. */ AttributeElement elem; int offset = find_attribute_motion(kg, sd->object, ATTR_STD_MOTION_VERTEX_POSITION, &elem); kernel_assert(offset != ATTR_STD_NOT_FOUND); /* Fetch vertex coordinates. */ float3 verts[3], next_verts[3]; uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim); motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step, verts); motion_triangle_verts_for_step(kg, tri_vindex, offset, numverts, numsteps, step+1, next_verts); /* Interpolate between steps. */ verts[0] = (1.0f - t)*verts[0] + t*next_verts[0]; verts[1] = (1.0f - t)*verts[1] + t*next_verts[1]; verts[2] = (1.0f - t)*verts[2] + t*next_verts[2]; /* Compute refined position. */ #ifdef __BVH_LOCAL__ if(is_local) { sd->P = motion_triangle_refine_local(kg, sd, isect, ray, verts); } else #endif /* __BVH_LOCAL__*/ { sd->P = motion_triangle_refine(kg, sd, isect, ray, verts); } /* Compute face normal. */ float3 Ng; if(sd->object_flag & SD_OBJECT_NEGATIVE_SCALE_APPLIED) { Ng = normalize(cross(verts[2] - verts[0], verts[1] - verts[0])); } else { Ng = normalize(cross(verts[1] - verts[0], verts[2] - verts[0])); } sd->Ng = Ng; sd->N = Ng; /* Compute derivatives of P w.r.t. uv. */ #ifdef __DPDU__ sd->dPdu = (verts[0] - verts[2]); sd->dPdv = (verts[1] - verts[2]); #endif /* Compute smooth normal. */ if(sd->shader & SHADER_SMOOTH_NORMAL) { /* Find attribute. */ AttributeElement elem; int offset = find_attribute_motion(kg, sd->object, ATTR_STD_MOTION_VERTEX_NORMAL, &elem); kernel_assert(offset != ATTR_STD_NOT_FOUND); /* Fetch vertex coordinates. */ float3 normals[3], next_normals[3]; motion_triangle_normals_for_step(kg, tri_vindex, offset, numverts, numsteps, step, normals); motion_triangle_normals_for_step(kg, tri_vindex, offset, numverts, numsteps, step+1, next_normals); /* Interpolate between steps. */ normals[0] = (1.0f - t)*normals[0] + t*next_normals[0]; normals[1] = (1.0f - t)*normals[1] + t*next_normals[1]; normals[2] = (1.0f - t)*normals[2] + t*next_normals[2]; /* Interpolate between vertices. */ float u = sd->u; float v = sd->v; float w = 1.0f - u - v; sd->N = (u*normals[0] + v*normals[1] + w*normals[2]); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_object.h000066400000000000000000000513761334742672700232460ustar00rootroot00000000000000/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Object Primitive * * All mesh and curve primitives are part of an object. The same mesh and curves * may be instanced multiple times by different objects. * * If the mesh is not instanced multiple times, the object will not be explicitly * stored as a primitive in the BVH, rather the bare triangles are curved are * directly primitives in the BVH with world space locations applied, and the object * ID is looked up afterwards. */ CCL_NAMESPACE_BEGIN /* Object attributes, for now a fixed size and contents */ enum ObjectTransform { OBJECT_TRANSFORM = 0, OBJECT_INVERSE_TRANSFORM = 4, OBJECT_TRANSFORM_MOTION_PRE = 0, OBJECT_TRANSFORM_MOTION_MID = 4, OBJECT_TRANSFORM_MOTION_POST = 8, OBJECT_PROPERTIES = 12, OBJECT_DUPLI = 13 }; enum ObjectVectorTransform { OBJECT_VECTOR_MOTION_PRE = 0, OBJECT_VECTOR_MOTION_POST = 3 }; /* Object to world space transformation */ ccl_device_inline Transform object_fetch_transform(KernelGlobals *kg, int object, enum ObjectTransform type) { int offset = object*OBJECT_SIZE + (int)type; Transform tfm; tfm.x = kernel_tex_fetch(__objects, offset + 0); tfm.y = kernel_tex_fetch(__objects, offset + 1); tfm.z = kernel_tex_fetch(__objects, offset + 2); tfm.w = make_float4(0.0f, 0.0f, 0.0f, 1.0f); return tfm; } /* Lamp to world space transformation */ ccl_device_inline Transform lamp_fetch_transform(KernelGlobals *kg, int lamp, bool inverse) { int offset = lamp*LIGHT_SIZE + (inverse? 8 : 5); Transform tfm; tfm.x = kernel_tex_fetch(__light_data, offset + 0); tfm.y = kernel_tex_fetch(__light_data, offset + 1); tfm.z = kernel_tex_fetch(__light_data, offset + 2); tfm.w = make_float4(0.0f, 0.0f, 0.0f, 1.0f); return tfm; } /* Object to world space transformation for motion vectors */ ccl_device_inline Transform object_fetch_vector_transform(KernelGlobals *kg, int object, enum ObjectVectorTransform type) { int offset = object*OBJECT_VECTOR_SIZE + (int)type; Transform tfm; tfm.x = kernel_tex_fetch(__objects_vector, offset + 0); tfm.y = kernel_tex_fetch(__objects_vector, offset + 1); tfm.z = kernel_tex_fetch(__objects_vector, offset + 2); tfm.w = make_float4(0.0f, 0.0f, 0.0f, 1.0f); return tfm; } /* Motion blurred object transformations */ #ifdef __OBJECT_MOTION__ ccl_device_inline Transform object_fetch_transform_motion(KernelGlobals *kg, int object, float time) { MotionTransform motion; int offset = object*OBJECT_SIZE + (int)OBJECT_TRANSFORM_MOTION_PRE; motion.pre.x = kernel_tex_fetch(__objects, offset + 0); motion.pre.y = kernel_tex_fetch(__objects, offset + 1); motion.pre.z = kernel_tex_fetch(__objects, offset + 2); motion.pre.w = kernel_tex_fetch(__objects, offset + 3); motion.mid.x = kernel_tex_fetch(__objects, offset + 4); motion.mid.y = kernel_tex_fetch(__objects, offset + 5); motion.mid.z = kernel_tex_fetch(__objects, offset + 6); motion.mid.w = kernel_tex_fetch(__objects, offset + 7); motion.post.x = kernel_tex_fetch(__objects, offset + 8); motion.post.y = kernel_tex_fetch(__objects, offset + 9); motion.post.z = kernel_tex_fetch(__objects, offset + 10); motion.post.w = kernel_tex_fetch(__objects, offset + 11); Transform tfm; transform_motion_interpolate(&tfm, &motion, time); return tfm; } ccl_device_inline Transform object_fetch_transform_motion_test(KernelGlobals *kg, int object, float time, Transform *itfm) { int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_MOTION) { /* if we do motion blur */ Transform tfm = object_fetch_transform_motion(kg, object, time); if(itfm) *itfm = transform_quick_inverse(tfm); return tfm; } else { Transform tfm = object_fetch_transform(kg, object, OBJECT_TRANSFORM); if(itfm) *itfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); return tfm; } } #endif /* Transform position from object to world space */ ccl_device_inline void object_position_transform(KernelGlobals *kg, const ShaderData *sd, float3 *P) { #ifdef __OBJECT_MOTION__ *P = transform_point_auto(&sd->ob_tfm, *P); #else Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_TRANSFORM); *P = transform_point(&tfm, *P); #endif } /* Transform position from world to object space */ ccl_device_inline void object_inverse_position_transform(KernelGlobals *kg, const ShaderData *sd, float3 *P) { #ifdef __OBJECT_MOTION__ *P = transform_point_auto(&sd->ob_itfm, *P); #else Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_INVERSE_TRANSFORM); *P = transform_point(&tfm, *P); #endif } /* Transform normal from world to object space */ ccl_device_inline void object_inverse_normal_transform(KernelGlobals *kg, const ShaderData *sd, float3 *N) { #ifdef __OBJECT_MOTION__ if((sd->object != OBJECT_NONE) || (sd->type == PRIMITIVE_LAMP)) { *N = normalize(transform_direction_transposed_auto(&sd->ob_tfm, *N)); } #else if(sd->object != OBJECT_NONE) { Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_TRANSFORM); *N = normalize(transform_direction_transposed(&tfm, *N)); } else if(sd->type == PRIMITIVE_LAMP) { Transform tfm = lamp_fetch_transform(kg, sd->lamp, false); *N = normalize(transform_direction_transposed(&tfm, *N)); } #endif } /* Transform normal from object to world space */ ccl_device_inline void object_normal_transform(KernelGlobals *kg, const ShaderData *sd, float3 *N) { #ifdef __OBJECT_MOTION__ *N = normalize(transform_direction_transposed_auto(&sd->ob_itfm, *N)); #else Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_INVERSE_TRANSFORM); *N = normalize(transform_direction_transposed(&tfm, *N)); #endif } /* Transform direction vector from object to world space */ ccl_device_inline void object_dir_transform(KernelGlobals *kg, const ShaderData *sd, float3 *D) { #ifdef __OBJECT_MOTION__ *D = transform_direction_auto(&sd->ob_tfm, *D); #else Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_TRANSFORM); *D = transform_direction(&tfm, *D); #endif } /* Transform direction vector from world to object space */ ccl_device_inline void object_inverse_dir_transform(KernelGlobals *kg, const ShaderData *sd, float3 *D) { #ifdef __OBJECT_MOTION__ *D = transform_direction_auto(&sd->ob_itfm, *D); #else Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_INVERSE_TRANSFORM); *D = transform_direction(&tfm, *D); #endif } /* Object center position */ ccl_device_inline float3 object_location(KernelGlobals *kg, const ShaderData *sd) { if(sd->object == OBJECT_NONE) return make_float3(0.0f, 0.0f, 0.0f); #ifdef __OBJECT_MOTION__ return make_float3(sd->ob_tfm.x.w, sd->ob_tfm.y.w, sd->ob_tfm.z.w); #else Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_TRANSFORM); return make_float3(tfm.x.w, tfm.y.w, tfm.z.w); #endif } /* Total surface area of object */ ccl_device_inline float object_surface_area(KernelGlobals *kg, int object) { int offset = object*OBJECT_SIZE + OBJECT_PROPERTIES; float4 f = kernel_tex_fetch(__objects, offset); return f.x; } /* Pass ID number of object */ ccl_device_inline float object_pass_id(KernelGlobals *kg, int object) { if(object == OBJECT_NONE) return 0.0f; int offset = object*OBJECT_SIZE + OBJECT_PROPERTIES; float4 f = kernel_tex_fetch(__objects, offset); return f.y; } /* Per lamp random number for shader variation */ ccl_device_inline float lamp_random_number(KernelGlobals *kg, int lamp) { if(lamp == LAMP_NONE) return 0.0f; float4 f = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 4); return f.y; } /* Per object random number for shader variation */ ccl_device_inline float object_random_number(KernelGlobals *kg, int object) { if(object == OBJECT_NONE) return 0.0f; int offset = object*OBJECT_SIZE + OBJECT_PROPERTIES; float4 f = kernel_tex_fetch(__objects, offset); return f.z; } /* Particle ID from which this object was generated */ ccl_device_inline int object_particle_id(KernelGlobals *kg, int object) { if(object == OBJECT_NONE) return 0; int offset = object*OBJECT_SIZE + OBJECT_PROPERTIES; float4 f = kernel_tex_fetch(__objects, offset); return __float_as_uint(f.w); } /* Generated texture coordinate on surface from where object was instanced */ ccl_device_inline float3 object_dupli_generated(KernelGlobals *kg, int object) { if(object == OBJECT_NONE) return make_float3(0.0f, 0.0f, 0.0f); int offset = object*OBJECT_SIZE + OBJECT_DUPLI; float4 f = kernel_tex_fetch(__objects, offset); return make_float3(f.x, f.y, f.z); } /* UV texture coordinate on surface from where object was instanced */ ccl_device_inline float3 object_dupli_uv(KernelGlobals *kg, int object) { if(object == OBJECT_NONE) return make_float3(0.0f, 0.0f, 0.0f); int offset = object*OBJECT_SIZE + OBJECT_DUPLI; float4 f = kernel_tex_fetch(__objects, offset + 1); return make_float3(f.x, f.y, 0.0f); } /* Information about mesh for motion blurred triangles and curves */ ccl_device_inline void object_motion_info(KernelGlobals *kg, int object, int *numsteps, int *numverts, int *numkeys) { int offset = object*OBJECT_SIZE + OBJECT_DUPLI; if(numkeys) { float4 f = kernel_tex_fetch(__objects, offset); *numkeys = __float_as_int(f.w); } float4 f = kernel_tex_fetch(__objects, offset + 1); if(numsteps) *numsteps = __float_as_int(f.z); if(numverts) *numverts = __float_as_int(f.w); } /* Offset to an objects patch map */ ccl_device_inline uint object_patch_map_offset(KernelGlobals *kg, int object) { if(object == OBJECT_NONE) return 0; int offset = object*OBJECT_SIZE + 15; float4 f = kernel_tex_fetch(__objects, offset); return __float_as_uint(f.x); } /* Pass ID for shader */ ccl_device int shader_pass_id(KernelGlobals *kg, const ShaderData *sd) { return kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*SHADER_SIZE + 1); } /* Particle data from which object was instanced */ ccl_device_inline uint particle_index(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f = kernel_tex_fetch(__particles, offset + 0); return __float_as_uint(f.x); } ccl_device float particle_age(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f = kernel_tex_fetch(__particles, offset + 0); return f.y; } ccl_device float particle_lifetime(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f = kernel_tex_fetch(__particles, offset + 0); return f.z; } ccl_device float particle_size(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f = kernel_tex_fetch(__particles, offset + 0); return f.w; } ccl_device float4 particle_rotation(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f = kernel_tex_fetch(__particles, offset + 1); return f; } ccl_device float3 particle_location(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f = kernel_tex_fetch(__particles, offset + 2); return make_float3(f.x, f.y, f.z); } ccl_device float3 particle_velocity(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f2 = kernel_tex_fetch(__particles, offset + 2); float4 f3 = kernel_tex_fetch(__particles, offset + 3); return make_float3(f2.w, f3.x, f3.y); } ccl_device float3 particle_angular_velocity(KernelGlobals *kg, int particle) { int offset = particle*PARTICLE_SIZE; float4 f3 = kernel_tex_fetch(__particles, offset + 3); float4 f4 = kernel_tex_fetch(__particles, offset + 4); return make_float3(f3.z, f3.w, f4.x); } /* Object intersection in BVH */ ccl_device_inline float3 bvh_clamp_direction(float3 dir) { /* clamp absolute values by exp2f(-80.0f) to avoid division by zero when calculating inverse direction */ #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) const ssef oopes(8.271806E-25f,8.271806E-25f,8.271806E-25f,0.0f); const ssef mask = _mm_cmpgt_ps(fabs(dir), oopes); const ssef signdir = signmsk(dir.m128) | oopes; # ifndef __KERNEL_AVX__ ssef res = mask & ssef(dir); res = _mm_or_ps(res,_mm_andnot_ps(mask, signdir)); # else ssef res = _mm_blendv_ps(signdir, dir, mask); # endif return float3(res); #else /* __KERNEL_SSE__ && __KERNEL_SSE2__ */ const float ooeps = 8.271806E-25f; return make_float3((fabsf(dir.x) > ooeps)? dir.x: copysignf(ooeps, dir.x), (fabsf(dir.y) > ooeps)? dir.y: copysignf(ooeps, dir.y), (fabsf(dir.z) > ooeps)? dir.z: copysignf(ooeps, dir.z)); #endif /* __KERNEL_SSE__ && __KERNEL_SSE2__ */ } ccl_device_inline float3 bvh_inverse_direction(float3 dir) { return rcp(dir); } /* Transform ray into object space to enter static object in BVH */ ccl_device_inline float bvh_instance_push(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float t) { Transform tfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); *P = transform_point(&tfm, ray->P); float len; *dir = bvh_clamp_direction(normalize_len(transform_direction(&tfm, ray->D), &len)); *idir = bvh_inverse_direction(*dir); if(t != FLT_MAX) { t *= len; } return t; } #ifdef __QBVH__ /* Same as above, but optimized for QBVH scene intersection, * which needs to modify two max distances. * * TODO(sergey): Investigate if passing NULL instead of t1 gets optimized * so we can avoid having this duplication. */ ccl_device_inline void qbvh_instance_push(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float *t, float *t1) { Transform tfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); *P = transform_point(&tfm, ray->P); float len; *dir = bvh_clamp_direction(normalize_len(transform_direction(&tfm, ray->D), &len)); *idir = bvh_inverse_direction(*dir); if(*t != FLT_MAX) *t *= len; if(*t1 != -FLT_MAX) *t1 *= len; } #endif /* Transorm ray to exit static object in BVH */ ccl_device_inline float bvh_instance_pop(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float t) { if(t != FLT_MAX) { Transform tfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); t /= len(transform_direction(&tfm, ray->D)); } *P = ray->P; *dir = bvh_clamp_direction(ray->D); *idir = bvh_inverse_direction(*dir); return t; } /* Same as above, but returns scale factor to apply to multiple intersection distances */ ccl_device_inline void bvh_instance_pop_factor(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float *t_fac) { Transform tfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); *t_fac = 1.0f / len(transform_direction(&tfm, ray->D)); *P = ray->P; *dir = bvh_clamp_direction(ray->D); *idir = bvh_inverse_direction(*dir); } #ifdef __OBJECT_MOTION__ /* Transform ray into object space to enter motion blurred object in BVH */ ccl_device_inline float bvh_instance_motion_push(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float t, Transform *itfm) { object_fetch_transform_motion_test(kg, object, ray->time, itfm); *P = transform_point(itfm, ray->P); float len; *dir = bvh_clamp_direction(normalize_len(transform_direction(itfm, ray->D), &len)); *idir = bvh_inverse_direction(*dir); if(t != FLT_MAX) { t *= len; } return t; } #ifdef __QBVH__ /* Same as above, but optimized for QBVH scene intersection, * which needs to modify two max distances. * * TODO(sergey): Investigate if passing NULL instead of t1 gets optimized * so we can avoid having this duplication. */ ccl_device_inline void qbvh_instance_motion_push(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float *t, float *t1, Transform *itfm) { object_fetch_transform_motion_test(kg, object, ray->time, itfm); *P = transform_point(itfm, ray->P); float len; *dir = bvh_clamp_direction(normalize_len(transform_direction(itfm, ray->D), &len)); *idir = bvh_inverse_direction(*dir); if(*t != FLT_MAX) *t *= len; if(*t1 != -FLT_MAX) *t1 *= len; } #endif /* Transorm ray to exit motion blurred object in BVH */ ccl_device_inline float bvh_instance_motion_pop(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float t, Transform *itfm) { if(t != FLT_MAX) { t /= len(transform_direction(itfm, ray->D)); } *P = ray->P; *dir = bvh_clamp_direction(ray->D); *idir = bvh_inverse_direction(*dir); return t; } /* Same as above, but returns scale factor to apply to multiple intersection distances */ ccl_device_inline void bvh_instance_motion_pop_factor(KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float *t_fac, Transform *itfm) { *t_fac = 1.0f / len(transform_direction(itfm, ray->D)); *P = ray->P; *dir = bvh_clamp_direction(ray->D); *idir = bvh_inverse_direction(*dir); } #endif /* TODO(sergey): This is only for until we've got OpenCL 2.0 * on all devices we consider supported. It'll be replaced with * generic address space. */ #ifdef __KERNEL_OPENCL__ ccl_device_inline void object_position_transform_addrspace(KernelGlobals *kg, const ShaderData *sd, ccl_addr_space float3 *P) { float3 private_P = *P; object_position_transform(kg, sd, &private_P); *P = private_P; } ccl_device_inline void object_dir_transform_addrspace(KernelGlobals *kg, const ShaderData *sd, ccl_addr_space float3 *D) { float3 private_D = *D; object_dir_transform(kg, sd, &private_D); *D = private_D; } ccl_device_inline void object_normal_transform_addrspace(KernelGlobals *kg, const ShaderData *sd, ccl_addr_space float3 *N) { float3 private_N = *N; object_normal_transform(kg, sd, &private_N); *N = private_N; } #endif #ifndef __KERNEL_OPENCL__ # define object_position_transform_auto object_position_transform # define object_dir_transform_auto object_dir_transform # define object_normal_transform_auto object_normal_transform #else # define object_position_transform_auto object_position_transform_addrspace # define object_dir_transform_auto object_dir_transform_addrspace # define object_normal_transform_auto object_normal_transform_addrspace #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_patch.h000066400000000000000000000227341334742672700230730ustar00rootroot00000000000000/* * Based on code from OpenSubdiv released under this license: * * Copyright 2013 Pixar * * Licensed under the Apache License, Version 2.0 (the "Apache License") * with the following modification; you may not use this file except in * compliance with the Apache License and the following modification to it: * Section 6. Trademarks. is deleted and replaced with: * * 6. Trademarks. This License does not grant permission to use the trade * names, trademarks, service marks, or product names of the Licensor * and its affiliates, except as required to comply with Section 4(c) of * the License and to reproduce the content of the NOTICE file. * * You may obtain a copy of the Apache License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the Apache License with the above modification is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the Apache License for the specific * language governing permissions and limitations under the Apache License. * */ CCL_NAMESPACE_BEGIN typedef struct PatchHandle { int array_index, patch_index, vert_index; } PatchHandle; ccl_device_inline int patch_map_resolve_quadrant(float median, float *u, float *v) { int quadrant = -1; if(*u < median) { if(*v < median) { quadrant = 0; } else { quadrant = 1; *v -= median; } } else { if(*v < median) { quadrant = 3; } else { quadrant = 2; *v -= median; } *u -= median; } return quadrant; } /* retrieve PatchHandle from patch coords */ ccl_device_inline PatchHandle patch_map_find_patch(KernelGlobals *kg, int object, int patch, float u, float v) { PatchHandle handle; kernel_assert((u >= 0.0f) && (u <= 1.0f) && (v >= 0.0f) && (v <= 1.0f)); int node = (object_patch_map_offset(kg, object) + patch)/2; float median = 0.5f; for(int depth = 0; depth < 0xff; depth++) { float delta = median * 0.5f; int quadrant = patch_map_resolve_quadrant(median, &u, &v); kernel_assert(quadrant >= 0); uint child = kernel_tex_fetch(__patches, node + quadrant); /* is the quadrant a hole? */ if(!(child & PATCH_MAP_NODE_IS_SET)) { handle.array_index = -1; return handle; } uint index = child & PATCH_MAP_NODE_INDEX_MASK; if(child & PATCH_MAP_NODE_IS_LEAF) { handle.array_index = kernel_tex_fetch(__patches, index + 0); handle.patch_index = kernel_tex_fetch(__patches, index + 1); handle.vert_index = kernel_tex_fetch(__patches, index + 2); return handle; } else { node = index; } median = delta; } /* no leaf found */ kernel_assert(0); handle.array_index = -1; return handle; } ccl_device_inline void patch_eval_bspline_weights(float t, float *point, float *deriv) { /* The four uniform cubic B-Spline basis functions evaluated at t */ float inv_6 = 1.0f / 6.0f; float t2 = t * t; float t3 = t * t2; point[0] = inv_6 * (1.0f - 3.0f*(t - t2) - t3); point[1] = inv_6 * (4.0f - 6.0f*t2 + 3.0f*t3); point[2] = inv_6 * (1.0f + 3.0f*(t + t2 - t3)); point[3] = inv_6 * t3; /* Derivatives of the above four basis functions at t */ deriv[0] = -0.5f*t2 + t - 0.5f; deriv[1] = 1.5f*t2 - 2.0f*t; deriv[2] = -1.5f*t2 + t + 0.5f; deriv[3] = 0.5f*t2; } ccl_device_inline void patch_eval_adjust_boundary_weights(uint bits, float *s, float *t) { int boundary = ((bits >> 8) & 0xf); if(boundary & 1) { t[2] -= t[0]; t[1] += 2*t[0]; t[0] = 0; } if(boundary & 2) { s[1] -= s[3]; s[2] += 2*s[3]; s[3] = 0; } if(boundary & 4) { t[1] -= t[3]; t[2] += 2*t[3]; t[3] = 0; } if(boundary & 8) { s[2] -= s[0]; s[1] += 2*s[0]; s[0] = 0; } } ccl_device_inline int patch_eval_depth(uint patch_bits) { return (patch_bits & 0xf); } ccl_device_inline float patch_eval_param_fraction(uint patch_bits) { bool non_quad_root = (patch_bits >> 4) & 0x1; int depth = patch_eval_depth(patch_bits); if(non_quad_root) { return 1.0f / (float)(1 << (depth-1)); } else { return 1.0f / (float)(1 << depth); } } ccl_device_inline void patch_eval_normalize_coords(uint patch_bits, float *u, float *v) { float frac = patch_eval_param_fraction(patch_bits); int iu = (patch_bits >> 22) & 0x3ff; int iv = (patch_bits >> 12) & 0x3ff; /* top left corner */ float pu = (float)iu*frac; float pv = (float)iv*frac; /* normalize uv coordinates */ *u = (*u - pu) / frac; *v = (*v - pv) / frac; } /* retrieve patch control indices */ ccl_device_inline int patch_eval_indices(KernelGlobals *kg, const PatchHandle *handle, int channel, int indices[PATCH_MAX_CONTROL_VERTS]) { int index_base = kernel_tex_fetch(__patches, handle->array_index + 2) + handle->vert_index; /* XXX: regular patches only */ for(int i = 0; i < 16; i++) { indices[i] = kernel_tex_fetch(__patches, index_base + i); } return 16; } /* evaluate patch basis functions */ ccl_device_inline void patch_eval_basis(KernelGlobals *kg, const PatchHandle *handle, float u, float v, float weights[PATCH_MAX_CONTROL_VERTS], float weights_du[PATCH_MAX_CONTROL_VERTS], float weights_dv[PATCH_MAX_CONTROL_VERTS]) { uint patch_bits = kernel_tex_fetch(__patches, handle->patch_index + 1); /* read patch param */ float d_scale = 1 << patch_eval_depth(patch_bits); bool non_quad_root = (patch_bits >> 4) & 0x1; if(non_quad_root) { d_scale *= 0.5f; } patch_eval_normalize_coords(patch_bits, &u, &v); /* XXX: regular patches only for now. */ float s[4], t[4], ds[4], dt[4]; patch_eval_bspline_weights(u, s, ds); patch_eval_bspline_weights(v, t, dt); patch_eval_adjust_boundary_weights(patch_bits, s, t); patch_eval_adjust_boundary_weights(patch_bits, ds, dt); for(int k = 0; k < 4; k++) { for(int l = 0; l < 4; l++) { weights[4*k+l] = s[l] * t[k]; weights_du[4*k+l] = ds[l] * t[k] * d_scale; weights_dv[4*k+l] = s[l] * dt[k] * d_scale; } } } /* generic function for evaluating indices and weights from patch coords */ ccl_device_inline int patch_eval_control_verts(KernelGlobals *kg, int object, int patch, float u, float v, int channel, int indices[PATCH_MAX_CONTROL_VERTS], float weights[PATCH_MAX_CONTROL_VERTS], float weights_du[PATCH_MAX_CONTROL_VERTS], float weights_dv[PATCH_MAX_CONTROL_VERTS]) { PatchHandle handle = patch_map_find_patch(kg, object, patch, u, v); kernel_assert(handle.array_index >= 0); int num_control = patch_eval_indices(kg, &handle, channel, indices); patch_eval_basis(kg, &handle, u, v, weights, weights_du, weights_dv); return num_control; } /* functions for evaluating attributes on patches */ ccl_device float patch_eval_float(KernelGlobals *kg, const ShaderData *sd, int offset, int patch, float u, float v, int channel, float *du, float* dv) { int indices[PATCH_MAX_CONTROL_VERTS]; float weights[PATCH_MAX_CONTROL_VERTS]; float weights_du[PATCH_MAX_CONTROL_VERTS]; float weights_dv[PATCH_MAX_CONTROL_VERTS]; int num_control = patch_eval_control_verts(kg, sd->object, patch, u, v, channel, indices, weights, weights_du, weights_dv); float val = 0.0f; if(du) *du = 0.0f; if(dv) *dv = 0.0f; for(int i = 0; i < num_control; i++) { float v = kernel_tex_fetch(__attributes_float, offset + indices[i]); val += v * weights[i]; if(du) *du += v * weights_du[i]; if(dv) *dv += v * weights_dv[i]; } return val; } ccl_device float3 patch_eval_float3(KernelGlobals *kg, const ShaderData *sd, int offset, int patch, float u, float v, int channel, float3 *du, float3 *dv) { int indices[PATCH_MAX_CONTROL_VERTS]; float weights[PATCH_MAX_CONTROL_VERTS]; float weights_du[PATCH_MAX_CONTROL_VERTS]; float weights_dv[PATCH_MAX_CONTROL_VERTS]; int num_control = patch_eval_control_verts(kg, sd->object, patch, u, v, channel, indices, weights, weights_du, weights_dv); float3 val = make_float3(0.0f, 0.0f, 0.0f); if(du) *du = make_float3(0.0f, 0.0f, 0.0f); if(dv) *dv = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < num_control; i++) { float3 v = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + indices[i])); val += v * weights[i]; if(du) *du += v * weights_du[i]; if(dv) *dv += v * weights_dv[i]; } return val; } ccl_device float3 patch_eval_uchar4(KernelGlobals *kg, const ShaderData *sd, int offset, int patch, float u, float v, int channel, float3 *du, float3 *dv) { int indices[PATCH_MAX_CONTROL_VERTS]; float weights[PATCH_MAX_CONTROL_VERTS]; float weights_du[PATCH_MAX_CONTROL_VERTS]; float weights_dv[PATCH_MAX_CONTROL_VERTS]; int num_control = patch_eval_control_verts(kg, sd->object, patch, u, v, channel, indices, weights, weights_du, weights_dv); float3 val = make_float3(0.0f, 0.0f, 0.0f); if(du) *du = make_float3(0.0f, 0.0f, 0.0f); if(dv) *dv = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < num_control; i++) { float3 v = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, offset + indices[i])); val += v * weights[i]; if(du) *du += v * weights_du[i]; if(dv) *dv += v * weights_dv[i]; } return val; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_primitive.h000066400000000000000000000170411334742672700237770ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Primitive Utilities * * Generic functions to look up mesh, curve and volume primitive attributes for * shading and render passes. */ CCL_NAMESPACE_BEGIN /* Generic primitive attribute reading functions */ ccl_device_inline float primitive_attribute_float(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float *dx, float *dy) { if(sd->type & PRIMITIVE_ALL_TRIANGLE) { if(subd_triangle_patch(kg, sd) == ~0) return triangle_attribute_float(kg, sd, desc, dx, dy); else return subd_triangle_attribute_float(kg, sd, desc, dx, dy); } #ifdef __HAIR__ else if(sd->type & PRIMITIVE_ALL_CURVE) { return curve_attribute_float(kg, sd, desc, dx, dy); } #endif #ifdef __VOLUME__ else if(sd->object != OBJECT_NONE && desc.element == ATTR_ELEMENT_VOXEL) { return volume_attribute_float(kg, sd, desc, dx, dy); } #endif else { if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; return 0.0f; } } ccl_device_inline float3 primitive_attribute_float3(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float3 *dx, float3 *dy) { if(sd->type & PRIMITIVE_ALL_TRIANGLE) { if(subd_triangle_patch(kg, sd) == ~0) return triangle_attribute_float3(kg, sd, desc, dx, dy); else return subd_triangle_attribute_float3(kg, sd, desc, dx, dy); } #ifdef __HAIR__ else if(sd->type & PRIMITIVE_ALL_CURVE) { return curve_attribute_float3(kg, sd, desc, dx, dy); } #endif #ifdef __VOLUME__ else if(sd->object != OBJECT_NONE && desc.element == ATTR_ELEMENT_VOXEL) { return volume_attribute_float3(kg, sd, desc, dx, dy); } #endif else { if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); return make_float3(0.0f, 0.0f, 0.0f); } } /* Default UV coordinate */ ccl_device_inline float3 primitive_uv(KernelGlobals *kg, ShaderData *sd) { const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_UV); if(desc.offset == ATTR_STD_NOT_FOUND) return make_float3(0.0f, 0.0f, 0.0f); float3 uv = primitive_attribute_float3(kg, sd, desc, NULL, NULL); uv.z = 1.0f; return uv; } /* Ptex coordinates */ ccl_device bool primitive_ptex(KernelGlobals *kg, ShaderData *sd, float2 *uv, int *face_id) { /* storing ptex data as attributes is not memory efficient but simple for tests */ const AttributeDescriptor desc_face_id = find_attribute(kg, sd, ATTR_STD_PTEX_FACE_ID); const AttributeDescriptor desc_uv = find_attribute(kg, sd, ATTR_STD_PTEX_UV); if(desc_face_id.offset == ATTR_STD_NOT_FOUND || desc_uv.offset == ATTR_STD_NOT_FOUND) return false; float3 uv3 = primitive_attribute_float3(kg, sd, desc_uv, NULL, NULL); float face_id_f = primitive_attribute_float(kg, sd, desc_face_id, NULL, NULL); *uv = make_float2(uv3.x, uv3.y); *face_id = (int)face_id_f; return true; } /* Surface tangent */ ccl_device float3 primitive_tangent(KernelGlobals *kg, ShaderData *sd) { #ifdef __HAIR__ if(sd->type & PRIMITIVE_ALL_CURVE) # ifdef __DPDU__ return normalize(sd->dPdu); # else return make_float3(0.0f, 0.0f, 0.0f); # endif #endif /* try to create spherical tangent from generated coordinates */ const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_GENERATED); if(desc.offset != ATTR_STD_NOT_FOUND) { float3 data = primitive_attribute_float3(kg, sd, desc, NULL, NULL); data = make_float3(-(data.y - 0.5f), (data.x - 0.5f), 0.0f); object_normal_transform(kg, sd, &data); return cross(sd->N, normalize(cross(data, sd->N))); } else { /* otherwise use surface derivatives */ #ifdef __DPDU__ return normalize(sd->dPdu); #else return make_float3(0.0f, 0.0f, 0.0f); #endif } } /* Motion vector for motion pass */ ccl_device_inline float4 primitive_motion_vector(KernelGlobals *kg, ShaderData *sd) { /* center position */ float3 center; #ifdef __HAIR__ bool is_curve_primitive = sd->type & PRIMITIVE_ALL_CURVE; if(is_curve_primitive) { center = curve_motion_center_location(kg, sd); if(!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { object_position_transform(kg, sd, ¢er); } } else #endif center = sd->P; float3 motion_pre = center, motion_post = center; /* deformation motion */ AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_MOTION_VERTEX_POSITION); if(desc.offset != ATTR_STD_NOT_FOUND) { /* get motion info */ int numverts, numkeys; object_motion_info(kg, sd->object, NULL, &numverts, &numkeys); /* lookup attributes */ motion_pre = primitive_attribute_float3(kg, sd, desc, NULL, NULL); desc.offset += (sd->type & PRIMITIVE_ALL_TRIANGLE)? numverts: numkeys; motion_post = primitive_attribute_float3(kg, sd, desc, NULL, NULL); #ifdef __HAIR__ if(is_curve_primitive && (sd->object_flag & SD_OBJECT_HAS_VERTEX_MOTION) == 0) { object_position_transform(kg, sd, &motion_pre); object_position_transform(kg, sd, &motion_post); } #endif } /* object motion. note that depending on the mesh having motion vectors, this * transformation was set match the world/object space of motion_pre/post */ Transform tfm; tfm = object_fetch_vector_transform(kg, sd->object, OBJECT_VECTOR_MOTION_PRE); motion_pre = transform_point(&tfm, motion_pre); tfm = object_fetch_vector_transform(kg, sd->object, OBJECT_VECTOR_MOTION_POST); motion_post = transform_point(&tfm, motion_post); float3 motion_center; /* camera motion, for perspective/orthographic motion.pre/post will be a * world-to-raster matrix, for panorama it's world-to-camera */ if(kernel_data.cam.type != CAMERA_PANORAMA) { tfm = kernel_data.cam.worldtoraster; motion_center = transform_perspective(&tfm, center); tfm = kernel_data.cam.motion.pre; motion_pre = transform_perspective(&tfm, motion_pre); tfm = kernel_data.cam.motion.post; motion_post = transform_perspective(&tfm, motion_post); } else { tfm = kernel_data.cam.worldtocamera; motion_center = normalize(transform_point(&tfm, center)); motion_center = float2_to_float3(direction_to_panorama(&kernel_data.cam, motion_center)); motion_center.x *= kernel_data.cam.width; motion_center.y *= kernel_data.cam.height; tfm = kernel_data.cam.motion.pre; motion_pre = normalize(transform_point(&tfm, motion_pre)); motion_pre = float2_to_float3(direction_to_panorama(&kernel_data.cam, motion_pre)); motion_pre.x *= kernel_data.cam.width; motion_pre.y *= kernel_data.cam.height; tfm = kernel_data.cam.motion.post; motion_post = normalize(transform_point(&tfm, motion_post)); motion_post = float2_to_float3(direction_to_panorama(&kernel_data.cam, motion_post)); motion_post.x *= kernel_data.cam.width; motion_post.y *= kernel_data.cam.height; } motion_pre = motion_pre - motion_center; motion_post = motion_center - motion_post; return make_float4(motion_pre.x, motion_pre.y, motion_post.x, motion_post.y); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_subd_triangle.h000066400000000000000000000247301334742672700246140ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Functions for retrieving attributes on triangles produced from subdivision meshes */ CCL_NAMESPACE_BEGIN /* Patch index for triangle, -1 if not subdivision triangle */ ccl_device_inline uint subd_triangle_patch(KernelGlobals *kg, const ShaderData *sd) { return (sd->prim != PRIM_NONE) ? kernel_tex_fetch(__tri_patch, sd->prim) : ~0; } /* UV coords of triangle within patch */ ccl_device_inline void subd_triangle_patch_uv(KernelGlobals *kg, const ShaderData *sd, float2 uv[3]) { uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim); uv[0] = kernel_tex_fetch(__tri_patch_uv, tri_vindex.x); uv[1] = kernel_tex_fetch(__tri_patch_uv, tri_vindex.y); uv[2] = kernel_tex_fetch(__tri_patch_uv, tri_vindex.z); } /* Vertex indices of patch */ ccl_device_inline uint4 subd_triangle_patch_indices(KernelGlobals *kg, int patch) { uint4 indices; indices.x = kernel_tex_fetch(__patches, patch+0); indices.y = kernel_tex_fetch(__patches, patch+1); indices.z = kernel_tex_fetch(__patches, patch+2); indices.w = kernel_tex_fetch(__patches, patch+3); return indices; } /* Originating face for patch */ ccl_device_inline uint subd_triangle_patch_face(KernelGlobals *kg, int patch) { return kernel_tex_fetch(__patches, patch+4); } /* Number of corners on originating face */ ccl_device_inline uint subd_triangle_patch_num_corners(KernelGlobals *kg, int patch) { return kernel_tex_fetch(__patches, patch+5) & 0xffff; } /* Indices of the four corners that are used by the patch */ ccl_device_inline void subd_triangle_patch_corners(KernelGlobals *kg, int patch, int corners[4]) { uint4 data; data.x = kernel_tex_fetch(__patches, patch+4); data.y = kernel_tex_fetch(__patches, patch+5); data.z = kernel_tex_fetch(__patches, patch+6); data.w = kernel_tex_fetch(__patches, patch+7); int num_corners = data.y & 0xffff; if(num_corners == 4) { /* quad */ corners[0] = data.z; corners[1] = data.z+1; corners[2] = data.z+2; corners[3] = data.z+3; } else { /* ngon */ int c = data.y >> 16; corners[0] = data.z + c; corners[1] = data.z + mod(c+1, num_corners); corners[2] = data.w; corners[3] = data.z + mod(c-1, num_corners); } } /* Reading attributes on various subdivision triangle elements */ ccl_device_noinline float subd_triangle_attribute_float(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float *dx, float *dy) { int patch = subd_triangle_patch(kg, sd); #ifdef __PATCH_EVAL__ if(desc.flags & ATTR_SUBDIVIDED) { float2 uv[3]; subd_triangle_patch_uv(kg, sd, uv); float2 dpdu = uv[0] - uv[2]; float2 dpdv = uv[1] - uv[2]; /* p is [s, t] */ float2 p = dpdu * sd->u + dpdv * sd->v + uv[2]; float a, dads, dadt; a = patch_eval_float(kg, sd, desc.offset, patch, p.x, p.y, 0, &dads, &dadt); #ifdef __RAY_DIFFERENTIALS__ if(dx || dy) { float dsdu = dpdu.x; float dtdu = dpdu.y; float dsdv = dpdv.x; float dtdv = dpdv.y; if(dx) { float dudx = sd->du.dx; float dvdx = sd->dv.dx; float dsdx = dsdu*dudx + dsdv*dvdx; float dtdx = dtdu*dudx + dtdv*dvdx; *dx = dads*dsdx + dadt*dtdx; } if(dy) { float dudy = sd->du.dy; float dvdy = sd->dv.dy; float dsdy = dsdu*dudy + dsdv*dvdy; float dtdy = dtdu*dudy + dtdv*dvdy; *dy = dads*dsdy + dadt*dtdy; } } #endif return a; } else #endif /* __PATCH_EVAL__ */ if(desc.element == ATTR_ELEMENT_FACE) { if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; return kernel_tex_fetch(__attributes_float, desc.offset + subd_triangle_patch_face(kg, patch)); } else if(desc.element == ATTR_ELEMENT_VERTEX || desc.element == ATTR_ELEMENT_VERTEX_MOTION) { float2 uv[3]; subd_triangle_patch_uv(kg, sd, uv); uint4 v = subd_triangle_patch_indices(kg, patch); float f0 = kernel_tex_fetch(__attributes_float, desc.offset + v.x); float f1 = kernel_tex_fetch(__attributes_float, desc.offset + v.y); float f2 = kernel_tex_fetch(__attributes_float, desc.offset + v.z); float f3 = kernel_tex_fetch(__attributes_float, desc.offset + v.w); if(subd_triangle_patch_num_corners(kg, patch) != 4) { f1 = (f1+f0)*0.5f; f3 = (f3+f0)*0.5f; } float a = mix(mix(f0, f1, uv[0].x), mix(f3, f2, uv[0].x), uv[0].y); float b = mix(mix(f0, f1, uv[1].x), mix(f3, f2, uv[1].x), uv[1].y); float c = mix(mix(f0, f1, uv[2].x), mix(f3, f2, uv[2].x), uv[2].y); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*a + sd->dv.dx*b - (sd->du.dx + sd->dv.dx)*c; if(dy) *dy = sd->du.dy*a + sd->dv.dy*b - (sd->du.dy + sd->dv.dy)*c; #endif return sd->u*a + sd->v*b + (1.0f - sd->u - sd->v)*c; } else if(desc.element == ATTR_ELEMENT_CORNER) { float2 uv[3]; subd_triangle_patch_uv(kg, sd, uv); int corners[4]; subd_triangle_patch_corners(kg, patch, corners); float f0 = kernel_tex_fetch(__attributes_float, corners[0] + desc.offset); float f1 = kernel_tex_fetch(__attributes_float, corners[1] + desc.offset); float f2 = kernel_tex_fetch(__attributes_float, corners[2] + desc.offset); float f3 = kernel_tex_fetch(__attributes_float, corners[3] + desc.offset); if(subd_triangle_patch_num_corners(kg, patch) != 4) { f1 = (f1+f0)*0.5f; f3 = (f3+f0)*0.5f; } float a = mix(mix(f0, f1, uv[0].x), mix(f3, f2, uv[0].x), uv[0].y); float b = mix(mix(f0, f1, uv[1].x), mix(f3, f2, uv[1].x), uv[1].y); float c = mix(mix(f0, f1, uv[2].x), mix(f3, f2, uv[2].x), uv[2].y); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*a + sd->dv.dx*b - (sd->du.dx + sd->dv.dx)*c; if(dy) *dy = sd->du.dy*a + sd->dv.dy*b - (sd->du.dy + sd->dv.dy)*c; #endif return sd->u*a + sd->v*b + (1.0f - sd->u - sd->v)*c; } else { if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; return 0.0f; } } ccl_device_noinline float3 subd_triangle_attribute_float3(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float3 *dx, float3 *dy) { int patch = subd_triangle_patch(kg, sd); #ifdef __PATCH_EVAL__ if(desc.flags & ATTR_SUBDIVIDED) { float2 uv[3]; subd_triangle_patch_uv(kg, sd, uv); float2 dpdu = uv[0] - uv[2]; float2 dpdv = uv[1] - uv[2]; /* p is [s, t] */ float2 p = dpdu * sd->u + dpdv * sd->v + uv[2]; float3 a, dads, dadt; if(desc.element == ATTR_ELEMENT_CORNER_BYTE) { a = patch_eval_uchar4(kg, sd, desc.offset, patch, p.x, p.y, 0, &dads, &dadt); } else { a = patch_eval_float3(kg, sd, desc.offset, patch, p.x, p.y, 0, &dads, &dadt); } #ifdef __RAY_DIFFERENTIALS__ if(dx || dy) { float dsdu = dpdu.x; float dtdu = dpdu.y; float dsdv = dpdv.x; float dtdv = dpdv.y; if(dx) { float dudx = sd->du.dx; float dvdx = sd->dv.dx; float dsdx = dsdu*dudx + dsdv*dvdx; float dtdx = dtdu*dudx + dtdv*dvdx; *dx = dads*dsdx + dadt*dtdx; } if(dy) { float dudy = sd->du.dy; float dvdy = sd->dv.dy; float dsdy = dsdu*dudy + dsdv*dvdy; float dtdy = dtdu*dudy + dtdv*dvdy; *dy = dads*dsdy + dadt*dtdy; } } #endif return a; } else #endif /* __PATCH_EVAL__ */ if(desc.element == ATTR_ELEMENT_FACE) { if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); return float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + subd_triangle_patch_face(kg, patch))); } else if(desc.element == ATTR_ELEMENT_VERTEX || desc.element == ATTR_ELEMENT_VERTEX_MOTION) { float2 uv[3]; subd_triangle_patch_uv(kg, sd, uv); uint4 v = subd_triangle_patch_indices(kg, patch); float3 f0 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + v.x)); float3 f1 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + v.y)); float3 f2 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + v.z)); float3 f3 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + v.w)); if(subd_triangle_patch_num_corners(kg, patch) != 4) { f1 = (f1+f0)*0.5f; f3 = (f3+f0)*0.5f; } float3 a = mix(mix(f0, f1, uv[0].x), mix(f3, f2, uv[0].x), uv[0].y); float3 b = mix(mix(f0, f1, uv[1].x), mix(f3, f2, uv[1].x), uv[1].y); float3 c = mix(mix(f0, f1, uv[2].x), mix(f3, f2, uv[2].x), uv[2].y); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*a + sd->dv.dx*b - (sd->du.dx + sd->dv.dx)*c; if(dy) *dy = sd->du.dy*a + sd->dv.dy*b - (sd->du.dy + sd->dv.dy)*c; #endif return sd->u*a + sd->v*b + (1.0f - sd->u - sd->v)*c; } else if(desc.element == ATTR_ELEMENT_CORNER || desc.element == ATTR_ELEMENT_CORNER_BYTE) { float2 uv[3]; subd_triangle_patch_uv(kg, sd, uv); int corners[4]; subd_triangle_patch_corners(kg, patch, corners); float3 f0, f1, f2, f3; if(desc.element == ATTR_ELEMENT_CORNER) { f0 = float4_to_float3(kernel_tex_fetch(__attributes_float3, corners[0] + desc.offset)); f1 = float4_to_float3(kernel_tex_fetch(__attributes_float3, corners[1] + desc.offset)); f2 = float4_to_float3(kernel_tex_fetch(__attributes_float3, corners[2] + desc.offset)); f3 = float4_to_float3(kernel_tex_fetch(__attributes_float3, corners[3] + desc.offset)); } else { f0 = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, corners[0] + desc.offset)); f1 = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, corners[1] + desc.offset)); f2 = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, corners[2] + desc.offset)); f3 = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, corners[3] + desc.offset)); } if(subd_triangle_patch_num_corners(kg, patch) != 4) { f1 = (f1+f0)*0.5f; f3 = (f3+f0)*0.5f; } float3 a = mix(mix(f0, f1, uv[0].x), mix(f3, f2, uv[0].x), uv[0].y); float3 b = mix(mix(f0, f1, uv[1].x), mix(f3, f2, uv[1].x), uv[1].y); float3 c = mix(mix(f0, f1, uv[2].x), mix(f3, f2, uv[2].x), uv[2].y); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*a + sd->dv.dx*b - (sd->du.dx + sd->dv.dx)*c; if(dy) *dy = sd->du.dy*a + sd->dv.dy*b - (sd->du.dy + sd->dv.dy)*c; #endif return sd->u*a + sd->v*b + (1.0f - sd->u - sd->v)*c; } else { if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); return make_float3(0.0f, 0.0f, 0.0f); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_triangle.h000066400000000000000000000171421334742672700235760ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Triangle Primitive * * Basic triangle with 3 vertices is used to represent mesh surfaces. For BVH * ray intersection we use a precomputed triangle storage to accelerate * intersection at the cost of more memory usage */ CCL_NAMESPACE_BEGIN /* normal on triangle */ ccl_device_inline float3 triangle_normal(KernelGlobals *kg, ShaderData *sd) { /* load triangle vertices */ const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim); const float3 v0 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+0)); const float3 v1 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+1)); const float3 v2 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+2)); /* return normal */ if(sd->object_flag & SD_OBJECT_NEGATIVE_SCALE_APPLIED) { return normalize(cross(v2 - v0, v1 - v0)); } else { return normalize(cross(v1 - v0, v2 - v0)); } } /* point and normal on triangle */ ccl_device_inline void triangle_point_normal(KernelGlobals *kg, int object, int prim, float u, float v, float3 *P, float3 *Ng, int *shader) { /* load triangle vertices */ const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim); float3 v0 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+0)); float3 v1 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+1)); float3 v2 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+2)); /* compute point */ float t = 1.0f - u - v; *P = (u*v0 + v*v1 + t*v2); /* get object flags */ int object_flag = kernel_tex_fetch(__object_flag, object); /* compute normal */ if(object_flag & SD_OBJECT_NEGATIVE_SCALE_APPLIED) { *Ng = normalize(cross(v2 - v0, v1 - v0)); } else { *Ng = normalize(cross(v1 - v0, v2 - v0)); } /* shader`*/ *shader = kernel_tex_fetch(__tri_shader, prim); } /* Triangle vertex locations */ ccl_device_inline void triangle_vertices(KernelGlobals *kg, int prim, float3 P[3]) { const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim); P[0] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+0)); P[1] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+1)); P[2] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+2)); } /* Interpolate smooth vertex normal from vertices */ ccl_device_inline float3 triangle_smooth_normal(KernelGlobals *kg, float3 Ng, int prim, float u, float v) { /* load triangle vertices */ const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim); float3 n0 = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.x)); float3 n1 = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.y)); float3 n2 = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.z)); float3 N = safe_normalize((1.0f - u - v)*n2 + u*n0 + v*n1); return is_zero(N)? Ng: N; } /* Ray differentials on triangle */ ccl_device_inline void triangle_dPdudv(KernelGlobals *kg, int prim, ccl_addr_space float3 *dPdu, ccl_addr_space float3 *dPdv) { /* fetch triangle vertex coordinates */ const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim); const float3 p0 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+0)); const float3 p1 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+1)); const float3 p2 = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w+2)); /* compute derivatives of P w.r.t. uv */ *dPdu = (p0 - p2); *dPdv = (p1 - p2); } /* Reading attributes on various triangle elements */ ccl_device float triangle_attribute_float(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float *dx, float *dy) { if(desc.element == ATTR_ELEMENT_FACE) { if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; return kernel_tex_fetch(__attributes_float, desc.offset + sd->prim); } else if(desc.element == ATTR_ELEMENT_VERTEX || desc.element == ATTR_ELEMENT_VERTEX_MOTION) { uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim); float f0 = kernel_tex_fetch(__attributes_float, desc.offset + tri_vindex.x); float f1 = kernel_tex_fetch(__attributes_float, desc.offset + tri_vindex.y); float f2 = kernel_tex_fetch(__attributes_float, desc.offset + tri_vindex.z); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*f0 + sd->dv.dx*f1 - (sd->du.dx + sd->dv.dx)*f2; if(dy) *dy = sd->du.dy*f0 + sd->dv.dy*f1 - (sd->du.dy + sd->dv.dy)*f2; #endif return sd->u*f0 + sd->v*f1 + (1.0f - sd->u - sd->v)*f2; } else if(desc.element == ATTR_ELEMENT_CORNER) { int tri = desc.offset + sd->prim*3; float f0 = kernel_tex_fetch(__attributes_float, tri + 0); float f1 = kernel_tex_fetch(__attributes_float, tri + 1); float f2 = kernel_tex_fetch(__attributes_float, tri + 2); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*f0 + sd->dv.dx*f1 - (sd->du.dx + sd->dv.dx)*f2; if(dy) *dy = sd->du.dy*f0 + sd->dv.dy*f1 - (sd->du.dy + sd->dv.dy)*f2; #endif return sd->u*f0 + sd->v*f1 + (1.0f - sd->u - sd->v)*f2; } else { if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; return 0.0f; } } ccl_device float3 triangle_attribute_float3(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float3 *dx, float3 *dy) { if(desc.element == ATTR_ELEMENT_FACE) { if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); return float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + sd->prim)); } else if(desc.element == ATTR_ELEMENT_VERTEX || desc.element == ATTR_ELEMENT_VERTEX_MOTION) { uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim); float3 f0 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.x)); float3 f1 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.y)); float3 f2 = float4_to_float3(kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.z)); #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*f0 + sd->dv.dx*f1 - (sd->du.dx + sd->dv.dx)*f2; if(dy) *dy = sd->du.dy*f0 + sd->dv.dy*f1 - (sd->du.dy + sd->dv.dy)*f2; #endif return sd->u*f0 + sd->v*f1 + (1.0f - sd->u - sd->v)*f2; } else if(desc.element == ATTR_ELEMENT_CORNER || desc.element == ATTR_ELEMENT_CORNER_BYTE) { int tri = desc.offset + sd->prim*3; float3 f0, f1, f2; if(desc.element == ATTR_ELEMENT_CORNER) { f0 = float4_to_float3(kernel_tex_fetch(__attributes_float3, tri + 0)); f1 = float4_to_float3(kernel_tex_fetch(__attributes_float3, tri + 1)); f2 = float4_to_float3(kernel_tex_fetch(__attributes_float3, tri + 2)); } else { f0 = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, tri + 0)); f1 = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, tri + 1)); f2 = color_byte_to_float(kernel_tex_fetch(__attributes_uchar4, tri + 2)); } #ifdef __RAY_DIFFERENTIALS__ if(dx) *dx = sd->du.dx*f0 + sd->dv.dx*f1 - (sd->du.dx + sd->dv.dx)*f2; if(dy) *dy = sd->du.dy*f0 + sd->dv.dy*f1 - (sd->du.dy + sd->dv.dy)*f2; #endif return sd->u*f0 + sd->v*f1 + (1.0f - sd->u - sd->v)*f2; } else { if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); return make_float3(0.0f, 0.0f, 0.0f); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_triangle_intersect.h000066400000000000000000000233561334742672700256620ustar00rootroot00000000000000/* * Copyright 2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Triangle/Ray intersections. * * For BVH ray intersection we use a precomputed triangle storage to accelerate * intersection at the cost of more memory usage. */ CCL_NAMESPACE_BEGIN ccl_device_inline bool triangle_intersect(KernelGlobals *kg, Intersection *isect, float3 P, float3 dir, uint visibility, int object, int prim_addr) { const uint tri_vindex = kernel_tex_fetch(__prim_tri_index, prim_addr); #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const ssef *ssef_verts = (ssef*)&kg->__prim_tri_verts.data[tri_vindex]; #else const float4 tri_a = kernel_tex_fetch(__prim_tri_verts, tri_vindex+0), tri_b = kernel_tex_fetch(__prim_tri_verts, tri_vindex+1), tri_c = kernel_tex_fetch(__prim_tri_verts, tri_vindex+2); #endif float t, u, v; if(ray_triangle_intersect(P, dir, isect->t, #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) ssef_verts, #else float4_to_float3(tri_a), float4_to_float3(tri_b), float4_to_float3(tri_c), #endif &u, &v, &t)) { #ifdef __VISIBILITY_FLAG__ /* Visibility flag test. we do it here under the assumption * that most triangles are culled by node flags. */ if(kernel_tex_fetch(__prim_visibility, prim_addr) & visibility) #endif { isect->prim = prim_addr; isect->object = object; isect->type = PRIMITIVE_TRIANGLE; isect->u = u; isect->v = v; isect->t = t; return true; } } return false; } /* Special ray intersection routines for local intersection. In that case we * only want to intersect with primitives in the same object, and if case of * multiple hits we pick a single random primitive as the intersection point. */ #ifdef __BVH_LOCAL__ ccl_device_inline void triangle_intersect_local( KernelGlobals *kg, LocalIntersection *local_isect, float3 P, float3 dir, int object, int local_object, int prim_addr, float tmax, uint *lcg_state, int max_hits) { /* Only intersect with matching object, for instanced objects we * already know we are only intersecting the right object. */ if(object == OBJECT_NONE) { if(kernel_tex_fetch(__prim_object, prim_addr) != local_object) { return; } } const uint tri_vindex = kernel_tex_fetch(__prim_tri_index, prim_addr); #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const ssef *ssef_verts = (ssef*)&kg->__prim_tri_verts.data[tri_vindex]; #else const float3 tri_a = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+0)), tri_b = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+1)), tri_c = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+2)); #endif float t, u, v; if(!ray_triangle_intersect(P, dir, tmax, #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) ssef_verts, #else tri_a, tri_b, tri_c, #endif &u, &v, &t)) { return; } int hit; if(lcg_state) { /* Record up to max_hits intersections. */ for(int i = min(max_hits, local_isect->num_hits) - 1; i >= 0; --i) { if(local_isect->hits[i].t == t) { return; } } local_isect->num_hits++; if(local_isect->num_hits <= max_hits) { hit = local_isect->num_hits - 1; } else { /* reservoir sampling: if we are at the maximum number of * hits, randomly replace element or skip it */ hit = lcg_step_uint(lcg_state) % local_isect->num_hits; if(hit >= max_hits) return; } } else { /* Record closest intersection only. */ if(local_isect->num_hits && t > local_isect->hits[0].t) { return; } hit = 0; local_isect->num_hits = 1; } /* Record intersection. */ Intersection *isect = &local_isect->hits[hit]; isect->prim = prim_addr; isect->object = object; isect->type = PRIMITIVE_TRIANGLE; isect->u = u; isect->v = v; isect->t = t; /* Record geometric normal. */ #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const float3 tri_a = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+0)), tri_b = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+1)), tri_c = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+2)); #endif local_isect->Ng[hit] = normalize(cross(tri_b - tri_a, tri_c - tri_a)); } #endif /* __BVH_LOCAL__ */ /* Refine triangle intersection to more precise hit point. For rays that travel * far the precision is often not so good, this reintersects the primitive from * a closer distance. */ /* Reintersections uses the paper: * * Tomas Moeller * Fast, minimum storage ray/triangle intersection * http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf */ ccl_device_inline float3 triangle_refine(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray) { float3 P = ray->P; float3 D = ray->D; float t = isect->t; #ifdef __INTERSECTION_REFINE__ if(isect->object != OBJECT_NONE) { if(UNLIKELY(t == 0.0f)) { return P; } # ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_itfm; # else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_INVERSE_TRANSFORM); # endif P = transform_point(&tfm, P); D = transform_direction(&tfm, D*t); D = normalize_len(D, &t); } P = P + D*t; const uint tri_vindex = kernel_tex_fetch(__prim_tri_index, isect->prim); const float4 tri_a = kernel_tex_fetch(__prim_tri_verts, tri_vindex+0), tri_b = kernel_tex_fetch(__prim_tri_verts, tri_vindex+1), tri_c = kernel_tex_fetch(__prim_tri_verts, tri_vindex+2); float3 edge1 = make_float3(tri_a.x - tri_c.x, tri_a.y - tri_c.y, tri_a.z - tri_c.z); float3 edge2 = make_float3(tri_b.x - tri_c.x, tri_b.y - tri_c.y, tri_b.z - tri_c.z); float3 tvec = make_float3(P.x - tri_c.x, P.y - tri_c.y, P.z - tri_c.z); float3 qvec = cross(tvec, edge1); float3 pvec = cross(D, edge2); float det = dot(edge1, pvec); if(det != 0.0f) { /* If determinant is zero it means ray lies in the plane of * the triangle. It is possible in theory due to watertight * nature of triangle intersection. For such cases we simply * don't refine intersection hoping it'll go all fine. */ float rt = dot(edge2, qvec) / det; P = P + D*rt; } if(isect->object != OBJECT_NONE) { # ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_tfm; # else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_TRANSFORM); # endif P = transform_point(&tfm, P); } return P; #else return P + D*t; #endif } /* Same as above, except that isect->t is assumed to be in object space for * instancing. */ ccl_device_inline float3 triangle_refine_local(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray) { float3 P = ray->P; float3 D = ray->D; float t = isect->t; if(isect->object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_itfm; #else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_INVERSE_TRANSFORM); #endif P = transform_point(&tfm, P); D = transform_direction(&tfm, D); D = normalize(D); } P = P + D*t; #ifdef __INTERSECTION_REFINE__ const uint tri_vindex = kernel_tex_fetch(__prim_tri_index, isect->prim); const float4 tri_a = kernel_tex_fetch(__prim_tri_verts, tri_vindex+0), tri_b = kernel_tex_fetch(__prim_tri_verts, tri_vindex+1), tri_c = kernel_tex_fetch(__prim_tri_verts, tri_vindex+2); float3 edge1 = make_float3(tri_a.x - tri_c.x, tri_a.y - tri_c.y, tri_a.z - tri_c.z); float3 edge2 = make_float3(tri_b.x - tri_c.x, tri_b.y - tri_c.y, tri_b.z - tri_c.z); float3 tvec = make_float3(P.x - tri_c.x, P.y - tri_c.y, P.z - tri_c.z); float3 qvec = cross(tvec, edge1); float3 pvec = cross(D, edge2); float det = dot(edge1, pvec); if(det != 0.0f) { /* If determinant is zero it means ray lies in the plane of * the triangle. It is possible in theory due to watertight * nature of triangle intersection. For such cases we simply * don't refine intersection hoping it'll go all fine. */ float rt = dot(edge2, qvec) / det; P = P + D*rt; } #endif /* __INTERSECTION_REFINE__ */ if(isect->object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_tfm; #else Transform tfm = object_fetch_transform(kg, isect->object, OBJECT_TRANSFORM); #endif P = transform_point(&tfm, P); } return P; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/geom/geom_volume.h000066400000000000000000000054651334742672700233050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Volume Primitive * * Volumes are just regions inside meshes with the mesh surface as boundaries. * There isn't as much data to access as for surfaces, there is only a position * to do lookups in 3D voxel or procedural textures. * * 3D voxel textures can be assigned as attributes per mesh, which means the * same shader can be used for volume objects with different densities, etc. */ CCL_NAMESPACE_BEGIN #ifdef __VOLUME__ /* Return position normalized to 0..1 in mesh bounds */ ccl_device_inline float3 volume_normalized_position(KernelGlobals *kg, const ShaderData *sd, float3 P) { /* todo: optimize this so it's just a single matrix multiplication when * possible (not motion blur), or perhaps even just translation + scale */ const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_GENERATED_TRANSFORM); object_inverse_position_transform(kg, sd, &P); if(desc.offset != ATTR_STD_NOT_FOUND) { Transform tfm = primitive_attribute_matrix(kg, sd, desc); P = transform_point(&tfm, P); } return P; } ccl_device float volume_attribute_float(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float *dx, float *dy) { float3 P = volume_normalized_position(kg, sd, sd->P); InterpolationType interp = (sd->flag & SD_VOLUME_CUBIC)? INTERPOLATION_CUBIC: INTERPOLATION_NONE; float4 r = kernel_tex_image_interp_3d(kg, desc.offset, P.x, P.y, P.z, interp); if(dx) *dx = 0.0f; if(dy) *dy = 0.0f; return average(float4_to_float3(r)); } ccl_device float3 volume_attribute_float3(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float3 *dx, float3 *dy) { float3 P = volume_normalized_position(kg, sd, sd->P); InterpolationType interp = (sd->flag & SD_VOLUME_CUBIC)? INTERPOLATION_CUBIC: INTERPOLATION_NONE; float4 r = kernel_tex_image_interp_3d(kg, desc.offset, P.x, P.y, P.z, interp); if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f); if(r.w != 0.0f && r.w != 1.0f) { /* For RGBA colors, unpremultiply after interpolation. */ return float4_to_float3(r) / r.w; } else { return float4_to_float3(r); } } #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel.h000066400000000000000000000035441334742672700213140ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_H__ #define __KERNEL_H__ /* CPU Kernel Interface */ #include "util/util_types.h" #include "kernel/kernel_types.h" CCL_NAMESPACE_BEGIN #define KERNEL_NAME_JOIN(x, y, z) x ## _ ## y ## _ ## z #define KERNEL_NAME_EVAL(arch, name) KERNEL_NAME_JOIN(kernel, arch, name) #define KERNEL_FUNCTION_FULL_NAME(name) KERNEL_NAME_EVAL(KERNEL_ARCH, name) struct KernelGlobals; struct KernelData; KernelGlobals *kernel_globals_create(); void kernel_globals_free(KernelGlobals *kg); void *kernel_osl_memory(KernelGlobals *kg); bool kernel_osl_use(KernelGlobals *kg); void kernel_const_copy(KernelGlobals *kg, const char *name, void *host, size_t size); void kernel_tex_copy(KernelGlobals *kg, const char *name, void *mem, size_t size); #define KERNEL_ARCH cpu #include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_sse2 #include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_sse3 #include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_sse41 #include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_avx #include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_avx2 #include "kernel/kernels/cpu/kernel_cpu.h" CCL_NAMESPACE_END #endif /* __KERNEL_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_accumulate.h000066400000000000000000000536371334742672700235270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* BSDF Eval * * BSDF evaluation result, split per BSDF type. This is used to accumulate * render passes separately. */ ccl_device float3 shader_bsdf_transparency(KernelGlobals *kg, const ShaderData *sd); ccl_device_inline void bsdf_eval_init(BsdfEval *eval, ClosureType type, float3 value, int use_light_pass) { #ifdef __PASSES__ eval->use_light_pass = use_light_pass; if(eval->use_light_pass) { eval->diffuse = make_float3(0.0f, 0.0f, 0.0f); eval->glossy = make_float3(0.0f, 0.0f, 0.0f); eval->transmission = make_float3(0.0f, 0.0f, 0.0f); eval->transparent = make_float3(0.0f, 0.0f, 0.0f); eval->subsurface = make_float3(0.0f, 0.0f, 0.0f); eval->scatter = make_float3(0.0f, 0.0f, 0.0f); if(type == CLOSURE_BSDF_TRANSPARENT_ID) eval->transparent = value; else if(CLOSURE_IS_BSDF_DIFFUSE(type)) eval->diffuse = value; else if(CLOSURE_IS_BSDF_GLOSSY(type)) eval->glossy = value; else if(CLOSURE_IS_BSDF_TRANSMISSION(type)) eval->transmission = value; else if(CLOSURE_IS_BSDF_BSSRDF(type)) eval->subsurface = value; else if(CLOSURE_IS_PHASE(type)) eval->scatter = value; } else #endif { eval->diffuse = value; } #ifdef __SHADOW_TRICKS__ eval->sum_no_mis = make_float3(0.0f, 0.0f, 0.0f); #endif } ccl_device_inline void bsdf_eval_accum(BsdfEval *eval, ClosureType type, float3 value, float mis_weight) { #ifdef __SHADOW_TRICKS__ eval->sum_no_mis += value; #endif value *= mis_weight; #ifdef __PASSES__ if(eval->use_light_pass) { if(CLOSURE_IS_BSDF_DIFFUSE(type)) eval->diffuse += value; else if(CLOSURE_IS_BSDF_GLOSSY(type)) eval->glossy += value; else if(CLOSURE_IS_BSDF_TRANSMISSION(type)) eval->transmission += value; else if(CLOSURE_IS_BSDF_BSSRDF(type)) eval->subsurface += value; else if(CLOSURE_IS_PHASE(type)) eval->scatter += value; /* skipping transparent, this function is used by for eval(), will be zero then */ } else #endif { eval->diffuse += value; } } ccl_device_inline bool bsdf_eval_is_zero(BsdfEval *eval) { #ifdef __PASSES__ if(eval->use_light_pass) { return is_zero(eval->diffuse) && is_zero(eval->glossy) && is_zero(eval->transmission) && is_zero(eval->transparent) && is_zero(eval->subsurface) && is_zero(eval->scatter); } else #endif { return is_zero(eval->diffuse); } } ccl_device_inline void bsdf_eval_mis(BsdfEval *eval, float value) { #ifdef __PASSES__ if(eval->use_light_pass) { eval->diffuse *= value; eval->glossy *= value; eval->transmission *= value; eval->subsurface *= value; eval->scatter *= value; /* skipping transparent, this function is used by for eval(), will be zero then */ } else #endif { eval->diffuse *= value; } } ccl_device_inline void bsdf_eval_mul(BsdfEval *eval, float value) { #ifdef __SHADOW_TRICKS__ eval->sum_no_mis *= value; #endif bsdf_eval_mis(eval, value); } ccl_device_inline void bsdf_eval_mul3(BsdfEval *eval, float3 value) { #ifdef __SHADOW_TRICKS__ eval->sum_no_mis *= value; #endif #ifdef __PASSES__ if(eval->use_light_pass) { eval->diffuse *= value; eval->glossy *= value; eval->transmission *= value; eval->subsurface *= value; eval->scatter *= value; /* skipping transparent, this function is used by for eval(), will be zero then */ } else eval->diffuse *= value; #else eval->diffuse *= value; #endif } ccl_device_inline float3 bsdf_eval_sum(const BsdfEval *eval) { #ifdef __PASSES__ if(eval->use_light_pass) { return eval->diffuse + eval->glossy + eval->transmission + eval->subsurface + eval->scatter; } else #endif return eval->diffuse; } /* Path Radiance * * We accumulate different render passes separately. After summing at the end * to get the combined result, it should be identical. We definite directly * visible as the first non-transparent hit, while indirectly visible are the * bounces after that. */ ccl_device_inline void path_radiance_init(PathRadiance *L, int use_light_pass) { /* clear all */ #ifdef __PASSES__ L->use_light_pass = use_light_pass; if(use_light_pass) { L->indirect = make_float3(0.0f, 0.0f, 0.0f); L->direct_emission = make_float3(0.0f, 0.0f, 0.0f); L->color_diffuse = make_float3(0.0f, 0.0f, 0.0f); L->color_glossy = make_float3(0.0f, 0.0f, 0.0f); L->color_transmission = make_float3(0.0f, 0.0f, 0.0f); L->color_subsurface = make_float3(0.0f, 0.0f, 0.0f); L->direct_diffuse = make_float3(0.0f, 0.0f, 0.0f); L->direct_glossy = make_float3(0.0f, 0.0f, 0.0f); L->direct_transmission = make_float3(0.0f, 0.0f, 0.0f); L->direct_subsurface = make_float3(0.0f, 0.0f, 0.0f); L->direct_scatter = make_float3(0.0f, 0.0f, 0.0f); L->indirect_diffuse = make_float3(0.0f, 0.0f, 0.0f); L->indirect_glossy = make_float3(0.0f, 0.0f, 0.0f); L->indirect_transmission = make_float3(0.0f, 0.0f, 0.0f); L->indirect_subsurface = make_float3(0.0f, 0.0f, 0.0f); L->indirect_scatter = make_float3(0.0f, 0.0f, 0.0f); L->transparent = 0.0f; L->emission = make_float3(0.0f, 0.0f, 0.0f); L->background = make_float3(0.0f, 0.0f, 0.0f); L->ao = make_float3(0.0f, 0.0f, 0.0f); L->shadow = make_float4(0.0f, 0.0f, 0.0f, 0.0f); L->mist = 0.0f; L->state.diffuse = make_float3(0.0f, 0.0f, 0.0f); L->state.glossy = make_float3(0.0f, 0.0f, 0.0f); L->state.transmission = make_float3(0.0f, 0.0f, 0.0f); L->state.subsurface = make_float3(0.0f, 0.0f, 0.0f); L->state.scatter = make_float3(0.0f, 0.0f, 0.0f); L->state.direct = make_float3(0.0f, 0.0f, 0.0f); } else #endif { L->transparent = 0.0f; L->emission = make_float3(0.0f, 0.0f, 0.0f); } #ifdef __SHADOW_TRICKS__ L->path_total = make_float3(0.0f, 0.0f, 0.0f); L->path_total_shaded = make_float3(0.0f, 0.0f, 0.0f); L->shadow_background_color = make_float3(0.0f, 0.0f, 0.0f); L->shadow_throughput = 0.0f; L->shadow_transparency = 1.0f; L->has_shadow_catcher = 0; #endif #ifdef __DENOISING_FEATURES__ L->denoising_normal = make_float3(0.0f, 0.0f, 0.0f); L->denoising_albedo = make_float3(0.0f, 0.0f, 0.0f); L->denoising_depth = 0.0f; #endif #ifdef __KERNEL_DEBUG__ L->debug_data.num_bvh_traversed_nodes = 0; L->debug_data.num_bvh_traversed_instances = 0; L->debug_data.num_bvh_intersections = 0; L->debug_data.num_ray_bounces = 0; #endif } ccl_device_inline void path_radiance_bsdf_bounce( KernelGlobals *kg, PathRadianceState *L_state, ccl_addr_space float3 *throughput, BsdfEval *bsdf_eval, float bsdf_pdf, int bounce, int bsdf_label) { float inverse_pdf = 1.0f/bsdf_pdf; #ifdef __PASSES__ if(kernel_data.film.use_light_pass) { if(bounce == 0 && !(bsdf_label & LABEL_TRANSPARENT)) { /* first on directly visible surface */ float3 value = *throughput*inverse_pdf; L_state->diffuse = bsdf_eval->diffuse*value; L_state->glossy = bsdf_eval->glossy*value; L_state->transmission = bsdf_eval->transmission*value; L_state->subsurface = bsdf_eval->subsurface*value; L_state->scatter = bsdf_eval->scatter*value; *throughput = L_state->diffuse + L_state->glossy + L_state->transmission + L_state->subsurface + L_state->scatter; L_state->direct = *throughput; } else { /* transparent bounce before first hit, or indirectly visible through BSDF */ float3 sum = (bsdf_eval_sum(bsdf_eval) + bsdf_eval->transparent) * inverse_pdf; *throughput *= sum; } } else #endif { *throughput *= bsdf_eval->diffuse*inverse_pdf; } } ccl_device_inline void path_radiance_accum_emission(PathRadiance *L, ccl_addr_space PathState *state, float3 throughput, float3 value) { #ifdef __SHADOW_TRICKS__ if(state->flag & PATH_RAY_SHADOW_CATCHER) { return; } #endif #ifdef __PASSES__ if(L->use_light_pass) { if(state->bounce == 0) L->emission += throughput*value; else if(state->bounce == 1) L->direct_emission += throughput*value; else L->indirect += throughput*value; } else #endif { L->emission += throughput*value; } } ccl_device_inline void path_radiance_accum_ao(PathRadiance *L, ccl_addr_space PathState *state, float3 throughput, float3 alpha, float3 bsdf, float3 ao) { #ifdef __SHADOW_TRICKS__ if(state->flag & PATH_RAY_STORE_SHADOW_INFO) { float3 light = throughput * bsdf; L->path_total += light; L->path_total_shaded += ao * light; if(state->flag & PATH_RAY_SHADOW_CATCHER) { return; } } #endif #ifdef __PASSES__ if(L->use_light_pass) { if(state->bounce == 0) { /* directly visible lighting */ L->direct_diffuse += throughput*bsdf*ao; L->ao += alpha*throughput*ao; } else { /* indirectly visible lighting after BSDF bounce */ L->indirect += throughput*bsdf*ao; } } else #endif { L->emission += throughput*bsdf*ao; } } ccl_device_inline void path_radiance_accum_total_ao( PathRadiance *L, ccl_addr_space PathState *state, float3 throughput, float3 bsdf) { #ifdef __SHADOW_TRICKS__ if(state->flag & PATH_RAY_STORE_SHADOW_INFO) { L->path_total += throughput * bsdf; } #else (void) L; (void) state; (void) throughput; (void) bsdf; #endif } ccl_device_inline void path_radiance_accum_light(PathRadiance *L, ccl_addr_space PathState *state, float3 throughput, BsdfEval *bsdf_eval, float3 shadow, float shadow_fac, bool is_lamp) { #ifdef __SHADOW_TRICKS__ if(state->flag & PATH_RAY_STORE_SHADOW_INFO) { float3 light = throughput * bsdf_eval->sum_no_mis; L->path_total += light; L->path_total_shaded += shadow * light; if(state->flag & PATH_RAY_SHADOW_CATCHER) { return; } } #endif #ifdef __PASSES__ if(L->use_light_pass) { if(state->bounce == 0) { /* directly visible lighting */ L->direct_diffuse += throughput*bsdf_eval->diffuse*shadow; L->direct_glossy += throughput*bsdf_eval->glossy*shadow; L->direct_transmission += throughput*bsdf_eval->transmission*shadow; L->direct_subsurface += throughput*bsdf_eval->subsurface*shadow; L->direct_scatter += throughput*bsdf_eval->scatter*shadow; if(is_lamp) { L->shadow.x += shadow.x*shadow_fac; L->shadow.y += shadow.y*shadow_fac; L->shadow.z += shadow.z*shadow_fac; } } else { /* indirectly visible lighting after BSDF bounce */ L->indirect += throughput*bsdf_eval_sum(bsdf_eval)*shadow; } } else #endif { L->emission += throughput*bsdf_eval->diffuse*shadow; } } ccl_device_inline void path_radiance_accum_total_light( PathRadiance *L, ccl_addr_space PathState *state, float3 throughput, const BsdfEval *bsdf_eval) { #ifdef __SHADOW_TRICKS__ if(state->flag & PATH_RAY_STORE_SHADOW_INFO) { L->path_total += throughput * bsdf_eval->sum_no_mis; } #else (void) L; (void) state; (void) throughput; (void) bsdf_eval; #endif } ccl_device_inline void path_radiance_accum_background( PathRadiance *L, ccl_addr_space PathState *state, float3 throughput, float3 value) { #ifdef __SHADOW_TRICKS__ if(state->flag & PATH_RAY_STORE_SHADOW_INFO) { L->path_total += throughput * value; L->path_total_shaded += throughput * value * L->shadow_transparency; if(state->flag & PATH_RAY_SHADOW_CATCHER) { return; } } #endif #ifdef __PASSES__ if(L->use_light_pass) { if(state->flag & PATH_RAY_TRANSPARENT_BACKGROUND) L->background += throughput*value; else if(state->bounce == 1) L->direct_emission += throughput*value; else L->indirect += throughput*value; } else #endif { L->emission += throughput*value; } #ifdef __DENOISING_FEATURES__ L->denoising_albedo += state->denoising_feature_weight * value; #endif /* __DENOISING_FEATURES__ */ } ccl_device_inline void path_radiance_accum_transparent( PathRadiance *L, ccl_addr_space PathState *state, float3 throughput) { L->transparent += average(throughput); } #ifdef __SHADOW_TRICKS__ ccl_device_inline void path_radiance_accum_shadowcatcher( PathRadiance *L, float3 throughput, float3 background) { L->shadow_throughput += average(throughput); L->shadow_background_color += throughput * background; L->has_shadow_catcher = 1; } #endif ccl_device_inline void path_radiance_sum_indirect(PathRadiance *L) { #ifdef __PASSES__ /* this division is a bit ugly, but means we only have to keep track of * only a single throughput further along the path, here we recover just * the indirect path that is not influenced by any particular BSDF type */ if(L->use_light_pass) { L->direct_emission = safe_divide_color(L->direct_emission, L->state.direct); L->direct_diffuse += L->state.diffuse*L->direct_emission; L->direct_glossy += L->state.glossy*L->direct_emission; L->direct_transmission += L->state.transmission*L->direct_emission; L->direct_subsurface += L->state.subsurface*L->direct_emission; L->direct_scatter += L->state.scatter*L->direct_emission; L->indirect = safe_divide_color(L->indirect, L->state.direct); L->indirect_diffuse += L->state.diffuse*L->indirect; L->indirect_glossy += L->state.glossy*L->indirect; L->indirect_transmission += L->state.transmission*L->indirect; L->indirect_subsurface += L->state.subsurface*L->indirect; L->indirect_scatter += L->state.scatter*L->indirect; } #endif } ccl_device_inline void path_radiance_reset_indirect(PathRadiance *L) { #ifdef __PASSES__ if(L->use_light_pass) { L->state.diffuse = make_float3(0.0f, 0.0f, 0.0f); L->state.glossy = make_float3(0.0f, 0.0f, 0.0f); L->state.transmission = make_float3(0.0f, 0.0f, 0.0f); L->state.subsurface = make_float3(0.0f, 0.0f, 0.0f); L->state.scatter = make_float3(0.0f, 0.0f, 0.0f); L->direct_emission = make_float3(0.0f, 0.0f, 0.0f); L->indirect = make_float3(0.0f, 0.0f, 0.0f); } #endif } ccl_device_inline void path_radiance_copy_indirect(PathRadiance *L, const PathRadiance *L_src) { #ifdef __PASSES__ if(L->use_light_pass) { L->state = L_src->state; L->direct_emission = L_src->direct_emission; L->indirect = L_src->indirect; } #endif } #ifdef __SHADOW_TRICKS__ ccl_device_inline void path_radiance_sum_shadowcatcher(KernelGlobals *kg, PathRadiance *L, float3 *L_sum, float *alpha) { /* Calculate current shadow of the path. */ float path_total = average(L->path_total); float shadow; if(UNLIKELY(!isfinite_safe(path_total))) { kernel_assert(!"Non-finite total radiance along the path"); shadow = 0.0f; } else if(path_total == 0.0f) { shadow = L->shadow_transparency; } else { float path_total_shaded = average(L->path_total_shaded); shadow = path_total_shaded / path_total; } /* Calculate final light sum and transparency for shadow catcher object. */ if(kernel_data.background.transparent) { *alpha -= L->shadow_throughput * shadow; } else { L->shadow_background_color *= shadow; *L_sum += L->shadow_background_color; } } #endif ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadiance *L, float *alpha) { float3 L_sum; /* Light Passes are used */ #ifdef __PASSES__ float3 L_direct, L_indirect; float clamp_direct = kernel_data.integrator.sample_clamp_direct; float clamp_indirect = kernel_data.integrator.sample_clamp_indirect; if(L->use_light_pass) { path_radiance_sum_indirect(L); L_direct = L->direct_diffuse + L->direct_glossy + L->direct_transmission + L->direct_subsurface + L->direct_scatter + L->emission; L_indirect = L->indirect_diffuse + L->indirect_glossy + L->indirect_transmission + L->indirect_subsurface + L->indirect_scatter; if(!kernel_data.background.transparent) L_direct += L->background; L_sum = L_direct + L_indirect; float sum = fabsf((L_sum).x) + fabsf((L_sum).y) + fabsf((L_sum).z); /* Reject invalid value */ if(!isfinite_safe(sum)) { kernel_assert(!"Non-finite sum in path_radiance_clamp_and_sum!"); L_sum = make_float3(0.0f, 0.0f, 0.0f); L->direct_diffuse = make_float3(0.0f, 0.0f, 0.0f); L->direct_glossy = make_float3(0.0f, 0.0f, 0.0f); L->direct_transmission = make_float3(0.0f, 0.0f, 0.0f); L->direct_subsurface = make_float3(0.0f, 0.0f, 0.0f); L->direct_scatter = make_float3(0.0f, 0.0f, 0.0f); L->indirect_diffuse = make_float3(0.0f, 0.0f, 0.0f); L->indirect_glossy = make_float3(0.0f, 0.0f, 0.0f); L->indirect_transmission = make_float3(0.0f, 0.0f, 0.0f); L->indirect_subsurface = make_float3(0.0f, 0.0f, 0.0f); L->indirect_scatter = make_float3(0.0f, 0.0f, 0.0f); L->emission = make_float3(0.0f, 0.0f, 0.0f); } /* Clamp direct and indirect samples */ #ifdef __CLAMP_SAMPLE__ else if(sum > clamp_direct || sum > clamp_indirect) { float scale; /* Direct */ float sum_direct = fabsf(L_direct.x) + fabsf(L_direct.y) + fabsf(L_direct.z); if(sum_direct > clamp_direct) { scale = clamp_direct/sum_direct; L_direct *= scale; L->direct_diffuse *= scale; L->direct_glossy *= scale; L->direct_transmission *= scale; L->direct_subsurface *= scale; L->direct_scatter *= scale; L->emission *= scale; L->background *= scale; } /* Indirect */ float sum_indirect = fabsf(L_indirect.x) + fabsf(L_indirect.y) + fabsf(L_indirect.z); if(sum_indirect > clamp_indirect) { scale = clamp_indirect/sum_indirect; L_indirect *= scale; L->indirect_diffuse *= scale; L->indirect_glossy *= scale; L->indirect_transmission *= scale; L->indirect_subsurface *= scale; L->indirect_scatter *= scale; } /* Sum again, after clamping */ L_sum = L_direct + L_indirect; } #endif } /* No Light Passes */ else #endif { L_sum = L->emission; /* Reject invalid value */ float sum = fabsf((L_sum).x) + fabsf((L_sum).y) + fabsf((L_sum).z); if(!isfinite_safe(sum)) { kernel_assert(!"Non-finite final sum in path_radiance_clamp_and_sum!"); L_sum = make_float3(0.0f, 0.0f, 0.0f); } } /* Compute alpha. */ *alpha = 1.0f - L->transparent; /* Add shadow catcher contributions. */ #ifdef __SHADOW_TRICKS__ if(L->has_shadow_catcher) { path_radiance_sum_shadowcatcher(kg, L, &L_sum, alpha); } #endif /* __SHADOW_TRICKS__ */ return L_sum; } ccl_device_inline void path_radiance_split_denoising(KernelGlobals *kg, PathRadiance *L, float3 *noisy, float3 *clean) { #ifdef __PASSES__ kernel_assert(L->use_light_pass); *clean = L->emission + L->background; *noisy = L->direct_scatter + L->indirect_scatter; # define ADD_COMPONENT(flag, component) \ if(kernel_data.film.denoising_flags & flag) \ *clean += component; \ else \ *noisy += component; ADD_COMPONENT(DENOISING_CLEAN_DIFFUSE_DIR, L->direct_diffuse); ADD_COMPONENT(DENOISING_CLEAN_DIFFUSE_IND, L->indirect_diffuse); ADD_COMPONENT(DENOISING_CLEAN_GLOSSY_DIR, L->direct_glossy); ADD_COMPONENT(DENOISING_CLEAN_GLOSSY_IND, L->indirect_glossy); ADD_COMPONENT(DENOISING_CLEAN_TRANSMISSION_DIR, L->direct_transmission); ADD_COMPONENT(DENOISING_CLEAN_TRANSMISSION_IND, L->indirect_transmission); ADD_COMPONENT(DENOISING_CLEAN_SUBSURFACE_DIR, L->direct_subsurface); ADD_COMPONENT(DENOISING_CLEAN_SUBSURFACE_IND, L->indirect_subsurface); # undef ADD_COMPONENT #else *noisy = L->emission; *clean = make_float3(0.0f, 0.0f, 0.0f); #endif #ifdef __SHADOW_TRICKS__ if(L->has_shadow_catcher) { *noisy += L->shadow_background_color; } #endif *noisy = ensure_finite3(*noisy); *clean = ensure_finite3(*clean); } ccl_device_inline void path_radiance_accum_sample(PathRadiance *L, PathRadiance *L_sample) { #ifdef __SPLIT_KERNEL__ # define safe_float3_add(f, v) \ do { \ ccl_global float *p = (ccl_global float*)(&(f)); \ atomic_add_and_fetch_float(p+0, (v).x); \ atomic_add_and_fetch_float(p+1, (v).y); \ atomic_add_and_fetch_float(p+2, (v).z); \ } while(0) # define safe_float_add(f, v) \ atomic_add_and_fetch_float(&(f), (v)) #else # define safe_float3_add(f, v) (f) += (v) # define safe_float_add(f, v) (f) += (v) #endif /* __SPLIT_KERNEL__ */ #ifdef __PASSES__ safe_float3_add(L->direct_diffuse, L_sample->direct_diffuse); safe_float3_add(L->direct_glossy, L_sample->direct_glossy); safe_float3_add(L->direct_transmission, L_sample->direct_transmission); safe_float3_add(L->direct_subsurface, L_sample->direct_subsurface); safe_float3_add(L->direct_scatter, L_sample->direct_scatter); safe_float3_add(L->indirect_diffuse, L_sample->indirect_diffuse); safe_float3_add(L->indirect_glossy, L_sample->indirect_glossy); safe_float3_add(L->indirect_transmission, L_sample->indirect_transmission); safe_float3_add(L->indirect_subsurface, L_sample->indirect_subsurface); safe_float3_add(L->indirect_scatter, L_sample->indirect_scatter); safe_float3_add(L->background, L_sample->background); safe_float3_add(L->ao, L_sample->ao); safe_float3_add(L->shadow, L_sample->shadow); safe_float_add(L->mist, L_sample->mist); #endif /* __PASSES__ */ safe_float3_add(L->emission, L_sample->emission); #undef safe_float_add #undef safe_float3_add } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_bake.h000066400000000000000000000412331334742672700222730ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #ifdef __BAKING__ ccl_device_inline void compute_light_pass(KernelGlobals *kg, ShaderData *sd, PathRadiance *L, uint rng_hash, int pass_filter, int sample) { /* initialize master radiance accumulator */ kernel_assert(kernel_data.film.use_light_pass); path_radiance_init(L, kernel_data.film.use_light_pass); PathRadiance L_sample; PathState state; Ray ray; float3 throughput = make_float3(1.0f, 1.0f, 1.0f); /* emission and indirect shader data memory used by various functions */ ShaderData emission_sd, indirect_sd; ray.P = sd->P + sd->Ng; ray.D = -sd->Ng; ray.t = FLT_MAX; #ifdef __CAMERA_MOTION__ ray.time = 0.5f; #endif /* init radiance */ path_radiance_init(&L_sample, kernel_data.film.use_light_pass); /* init path state */ path_state_init(kg, &emission_sd, &state, rng_hash, sample, NULL); /* evaluate surface shader */ shader_eval_surface(kg, sd, &state, state.flag); /* TODO, disable more closures we don't need besides transparent */ shader_bsdf_disable_transparency(kg, sd); #ifdef __BRANCHED_PATH__ if(!kernel_data.integrator.branched) { /* regular path tracer */ #endif /* sample ambient occlusion */ if(pass_filter & BAKE_FILTER_AO) { kernel_path_ao(kg, sd, &emission_sd, &L_sample, &state, throughput, shader_bsdf_alpha(kg, sd)); } /* sample emission */ if((pass_filter & BAKE_FILTER_EMISSION) && (sd->flag & SD_EMISSION)) { float3 emission = indirect_primitive_emission(kg, sd, 0.0f, state.flag, state.ray_pdf); path_radiance_accum_emission(&L_sample, &state, throughput, emission); } bool is_sss_sample = false; #ifdef __SUBSURFACE__ /* sample subsurface scattering */ if((pass_filter & BAKE_FILTER_SUBSURFACE) && (sd->flag & SD_BSSRDF)) { /* when mixing BSSRDF and BSDF closures we should skip BSDF lighting if scattering was successful */ SubsurfaceIndirectRays ss_indirect; kernel_path_subsurface_init_indirect(&ss_indirect); if(kernel_path_subsurface_scatter(kg, sd, &emission_sd, &L_sample, &state, &ray, &throughput, &ss_indirect)) { while(ss_indirect.num_rays) { kernel_path_subsurface_setup_indirect(kg, &ss_indirect, &state, &ray, &L_sample, &throughput); kernel_path_indirect(kg, &indirect_sd, &emission_sd, &ray, throughput, &state, &L_sample); } is_sss_sample = true; } } #endif /* sample light and BSDF */ if(!is_sss_sample && (pass_filter & (BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT))) { kernel_path_surface_connect_light(kg, sd, &emission_sd, throughput, &state, &L_sample); if(kernel_path_surface_bounce(kg, sd, &throughput, &state, &L_sample.state, &ray)) { #ifdef __LAMP_MIS__ state.ray_t = 0.0f; #endif /* compute indirect light */ kernel_path_indirect(kg, &indirect_sd, &emission_sd, &ray, throughput, &state, &L_sample); /* sum and reset indirect light pass variables for the next samples */ path_radiance_sum_indirect(&L_sample); path_radiance_reset_indirect(&L_sample); } } #ifdef __BRANCHED_PATH__ } else { /* branched path tracer */ /* sample ambient occlusion */ if(pass_filter & BAKE_FILTER_AO) { kernel_branched_path_ao(kg, sd, &emission_sd, &L_sample, &state, throughput); } /* sample emission */ if((pass_filter & BAKE_FILTER_EMISSION) && (sd->flag & SD_EMISSION)) { float3 emission = indirect_primitive_emission(kg, sd, 0.0f, state.flag, state.ray_pdf); path_radiance_accum_emission(&L_sample, &state, throughput, emission); } #ifdef __SUBSURFACE__ /* sample subsurface scattering */ if((pass_filter & BAKE_FILTER_SUBSURFACE) && (sd->flag & SD_BSSRDF)) { /* when mixing BSSRDF and BSDF closures we should skip BSDF lighting if scattering was successful */ kernel_branched_path_subsurface_scatter(kg, sd, &indirect_sd, &emission_sd, &L_sample, &state, &ray, throughput); } #endif /* sample light and BSDF */ if(pass_filter & (BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT)) { #if defined(__EMISSION__) /* direct light */ if(kernel_data.integrator.use_direct_light) { int all = kernel_data.integrator.sample_all_lights_direct; kernel_branched_path_surface_connect_light(kg, sd, &emission_sd, &state, throughput, 1.0f, &L_sample, all); } #endif /* indirect light */ kernel_branched_path_surface_indirect_light(kg, sd, &indirect_sd, &emission_sd, throughput, 1.0f, &state, &L_sample); } } #endif /* accumulate into master L */ path_radiance_accum_sample(L, &L_sample); } /* this helps with AA but it's not the real solution as it does not AA the geometry * but it's better than nothing, thus committed */ ccl_device_inline float bake_clamp_mirror_repeat(float u, float max) { /* use mirror repeat (like opengl texture) so that if the barycentric * coordinate goes past the end of the triangle it is not always clamped * to the same value, gives ugly patterns */ u /= max; float fu = floorf(u); u = u - fu; return ((((int)fu) & 1)? 1.0f - u: u) * max; } ccl_device_inline float3 kernel_bake_shader_bsdf(KernelGlobals *kg, ShaderData *sd, const ShaderEvalType type) { switch(type) { case SHADER_EVAL_DIFFUSE: return shader_bsdf_diffuse(kg, sd); case SHADER_EVAL_GLOSSY: return shader_bsdf_glossy(kg, sd); case SHADER_EVAL_TRANSMISSION: return shader_bsdf_transmission(kg, sd); #ifdef __SUBSURFACE__ case SHADER_EVAL_SUBSURFACE: return shader_bsdf_subsurface(kg, sd); #endif default: kernel_assert(!"Unknown bake type passed to BSDF evaluate"); return make_float3(0.0f, 0.0f, 0.0f); } } ccl_device float3 kernel_bake_evaluate_direct_indirect(KernelGlobals *kg, ShaderData *sd, PathState *state, float3 direct, float3 indirect, const ShaderEvalType type, const int pass_filter) { float3 color; const bool is_color = (pass_filter & BAKE_FILTER_COLOR) != 0; const bool is_direct = (pass_filter & BAKE_FILTER_DIRECT) != 0; const bool is_indirect = (pass_filter & BAKE_FILTER_INDIRECT) != 0; float3 out = make_float3(0.0f, 0.0f, 0.0f); if(is_color) { if(is_direct || is_indirect) { /* Leave direct and diffuse channel colored. */ color = make_float3(1.0f, 1.0f, 1.0f); } else { /* surface color of the pass only */ shader_eval_surface(kg, sd, state, 0); return kernel_bake_shader_bsdf(kg, sd, type); } } else { shader_eval_surface(kg, sd, state, 0); color = kernel_bake_shader_bsdf(kg, sd, type); } if(is_direct) { out += safe_divide_even_color(direct, color); } if(is_indirect) { out += safe_divide_even_color(indirect, color); } return out; } ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input, ccl_global float4 *output, ShaderEvalType type, int pass_filter, int i, int offset, int sample) { ShaderData sd; PathState state = {0}; uint4 in = input[i * 2]; uint4 diff = input[i * 2 + 1]; float3 out = make_float3(0.0f, 0.0f, 0.0f); int object = in.x; int prim = in.y; if(prim == -1) return; float u = __uint_as_float(in.z); float v = __uint_as_float(in.w); float dudx = __uint_as_float(diff.x); float dudy = __uint_as_float(diff.y); float dvdx = __uint_as_float(diff.z); float dvdy = __uint_as_float(diff.w); int num_samples = kernel_data.integrator.aa_samples; /* random number generator */ uint rng_hash = cmj_hash(offset + i, kernel_data.integrator.seed); float filter_x, filter_y; if(sample == 0) { filter_x = filter_y = 0.5f; } else { path_rng_2D(kg, rng_hash, sample, num_samples, PRNG_FILTER_U, &filter_x, &filter_y); } /* subpixel u/v offset */ if(sample > 0) { u = bake_clamp_mirror_repeat(u + dudx*(filter_x - 0.5f) + dudy*(filter_y - 0.5f), 1.0f); v = bake_clamp_mirror_repeat(v + dvdx*(filter_x - 0.5f) + dvdy*(filter_y - 0.5f), 1.0f - u); } /* triangle */ int shader; float3 P, Ng; triangle_point_normal(kg, object, prim, u, v, &P, &Ng, &shader); /* light passes */ PathRadiance L; shader_setup_from_sample(kg, &sd, P, Ng, Ng, shader, object, prim, u, v, 1.0f, 0.5f, !(kernel_tex_fetch(__object_flag, object) & SD_OBJECT_TRANSFORM_APPLIED), LAMP_NONE); sd.I = sd.N; /* update differentials */ sd.dP.dx = sd.dPdu * dudx + sd.dPdv * dvdx; sd.dP.dy = sd.dPdu * dudy + sd.dPdv * dvdy; sd.du.dx = dudx; sd.du.dy = dudy; sd.dv.dx = dvdx; sd.dv.dy = dvdy; /* set RNG state for shaders that use sampling */ state.rng_hash = rng_hash; state.rng_offset = 0; state.sample = sample; state.num_samples = num_samples; state.min_ray_pdf = FLT_MAX; /* light passes if we need more than color */ if(pass_filter & ~BAKE_FILTER_COLOR) compute_light_pass(kg, &sd, &L, rng_hash, pass_filter, sample); switch(type) { /* data passes */ case SHADER_EVAL_NORMAL: { float3 N = sd.N; if((sd.flag & SD_HAS_BUMP)) { shader_eval_surface(kg, &sd, &state, 0); N = shader_bsdf_average_normal(kg, &sd); } /* encoding: normal = (2 * color) - 1 */ out = N * 0.5f + make_float3(0.5f, 0.5f, 0.5f); break; } case SHADER_EVAL_UV: { out = primitive_uv(kg, &sd); break; } case SHADER_EVAL_EMISSION: { shader_eval_surface(kg, &sd, &state, PATH_RAY_EMISSION); out = shader_emissive_eval(kg, &sd); break; } #ifdef __PASSES__ /* light passes */ case SHADER_EVAL_AO: { out = L.ao; break; } case SHADER_EVAL_COMBINED: { if((pass_filter & BAKE_FILTER_COMBINED) == BAKE_FILTER_COMBINED) { float alpha; out = path_radiance_clamp_and_sum(kg, &L, &alpha); break; } if((pass_filter & BAKE_FILTER_DIFFUSE_DIRECT) == BAKE_FILTER_DIFFUSE_DIRECT) out += L.direct_diffuse; if((pass_filter & BAKE_FILTER_DIFFUSE_INDIRECT) == BAKE_FILTER_DIFFUSE_INDIRECT) out += L.indirect_diffuse; if((pass_filter & BAKE_FILTER_GLOSSY_DIRECT) == BAKE_FILTER_GLOSSY_DIRECT) out += L.direct_glossy; if((pass_filter & BAKE_FILTER_GLOSSY_INDIRECT) == BAKE_FILTER_GLOSSY_INDIRECT) out += L.indirect_glossy; if((pass_filter & BAKE_FILTER_TRANSMISSION_DIRECT) == BAKE_FILTER_TRANSMISSION_DIRECT) out += L.direct_transmission; if((pass_filter & BAKE_FILTER_TRANSMISSION_INDIRECT) == BAKE_FILTER_TRANSMISSION_INDIRECT) out += L.indirect_transmission; if((pass_filter & BAKE_FILTER_SUBSURFACE_DIRECT) == BAKE_FILTER_SUBSURFACE_DIRECT) out += L.direct_subsurface; if((pass_filter & BAKE_FILTER_SUBSURFACE_INDIRECT) == BAKE_FILTER_SUBSURFACE_INDIRECT) out += L.indirect_subsurface; if((pass_filter & BAKE_FILTER_EMISSION) != 0) out += L.emission; break; } case SHADER_EVAL_SHADOW: { out = make_float3(L.shadow.x, L.shadow.y, L.shadow.z); break; } case SHADER_EVAL_DIFFUSE: { out = kernel_bake_evaluate_direct_indirect(kg, &sd, &state, L.direct_diffuse, L.indirect_diffuse, type, pass_filter); break; } case SHADER_EVAL_GLOSSY: { out = kernel_bake_evaluate_direct_indirect(kg, &sd, &state, L.direct_glossy, L.indirect_glossy, type, pass_filter); break; } case SHADER_EVAL_TRANSMISSION: { out = kernel_bake_evaluate_direct_indirect(kg, &sd, &state, L.direct_transmission, L.indirect_transmission, type, pass_filter); break; } case SHADER_EVAL_SUBSURFACE: { #ifdef __SUBSURFACE__ out = kernel_bake_evaluate_direct_indirect(kg, &sd, &state, L.direct_subsurface, L.indirect_subsurface, type, pass_filter); #endif break; } #endif /* extra */ case SHADER_EVAL_ENVIRONMENT: { /* setup ray */ Ray ray; ray.P = make_float3(0.0f, 0.0f, 0.0f); ray.D = normalize(P); ray.t = 0.0f; #ifdef __CAMERA_MOTION__ ray.time = 0.5f; #endif #ifdef __RAY_DIFFERENTIALS__ ray.dD = differential3_zero(); ray.dP = differential3_zero(); #endif /* setup shader data */ shader_setup_from_background(kg, &sd, &ray); /* evaluate */ int flag = 0; /* we can't know which type of BSDF this is for */ out = shader_eval_background(kg, &sd, &state, flag); break; } default: { /* no real shader, returning the position of the verts for debugging */ out = normalize(P); break; } } /* write output */ const float output_fac = 1.0f/num_samples; const float4 scaled_result = make_float4(out.x, out.y, out.z, 1.0f) * output_fac; output[i] = (sample == 0)? scaled_result: output[i] + scaled_result; } #endif /* __BAKING__ */ ccl_device void kernel_displace_evaluate(KernelGlobals *kg, ccl_global uint4 *input, ccl_global float4 *output, int i) { ShaderData sd; PathState state = {0}; uint4 in = input[i]; /* setup shader data */ int object = in.x; int prim = in.y; float u = __uint_as_float(in.z); float v = __uint_as_float(in.w); shader_setup_from_displace(kg, &sd, object, prim, u, v); /* evaluate */ float3 P = sd.P; shader_eval_displacement(kg, &sd, &state); float3 D = sd.P - P; object_inverse_dir_transform(kg, &sd, &D); /* write output */ output[i] += make_float4(D.x, D.y, D.z, 0.0f); } ccl_device void kernel_background_evaluate(KernelGlobals *kg, ccl_global uint4 *input, ccl_global float4 *output, int i) { ShaderData sd; PathState state = {0}; uint4 in = input[i]; /* setup ray */ Ray ray; float u = __uint_as_float(in.x); float v = __uint_as_float(in.y); ray.P = make_float3(0.0f, 0.0f, 0.0f); ray.D = equirectangular_to_direction(u, v); ray.t = 0.0f; #ifdef __CAMERA_MOTION__ ray.time = 0.5f; #endif #ifdef __RAY_DIFFERENTIALS__ ray.dD = differential3_zero(); ray.dP = differential3_zero(); #endif /* setup shader data */ shader_setup_from_background(kg, &sd, &ray); /* evaluate */ int flag = 0; /* we can't know which type of BSDF this is for */ float3 color = shader_eval_background(kg, &sd, &state, flag); /* write output */ output[i] += make_float4(color.x, color.y, color.z, 0.0f); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_camera.h000066400000000000000000000361341334742672700226250ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Perspective Camera */ ccl_device float2 camera_sample_aperture(ccl_constant KernelCamera *cam, float u, float v) { float blades = cam->blades; float2 bokeh; if(blades == 0.0f) { /* sample disk */ bokeh = concentric_sample_disk(u, v); } else { /* sample polygon */ float rotation = cam->bladesrotation; bokeh = regular_polygon_sample(blades, rotation, u, v); } /* anamorphic lens bokeh */ bokeh.x *= cam->inv_aperture_ratio; return bokeh; } ccl_device void camera_sample_perspective(KernelGlobals *kg, float raster_x, float raster_y, float lens_u, float lens_v, ccl_addr_space Ray *ray) { /* create ray form raster position */ Transform rastertocamera = kernel_data.cam.rastertocamera; float3 raster = make_float3(raster_x, raster_y, 0.0f); float3 Pcamera = transform_perspective(&rastertocamera, raster); #ifdef __CAMERA_MOTION__ if(kernel_data.cam.have_perspective_motion) { /* TODO(sergey): Currently we interpolate projected coordinate which * gives nice looking result and which is simple, but is in fact a bit * different comparing to constructing projective matrix from an * interpolated field of view. */ if(ray->time < 0.5f) { Transform rastertocamera_pre = kernel_data.cam.perspective_motion.pre; float3 Pcamera_pre = transform_perspective(&rastertocamera_pre, raster); Pcamera = interp(Pcamera_pre, Pcamera, ray->time * 2.0f); } else { Transform rastertocamera_post = kernel_data.cam.perspective_motion.post; float3 Pcamera_post = transform_perspective(&rastertocamera_post, raster); Pcamera = interp(Pcamera, Pcamera_post, (ray->time - 0.5f) * 2.0f); } } #endif float3 P = make_float3(0.0f, 0.0f, 0.0f); float3 D = Pcamera; /* modify ray for depth of field */ float aperturesize = kernel_data.cam.aperturesize; if(aperturesize > 0.0f) { /* sample point on aperture */ float2 lensuv = camera_sample_aperture(&kernel_data.cam, lens_u, lens_v)*aperturesize; /* compute point on plane of focus */ float ft = kernel_data.cam.focaldistance/D.z; float3 Pfocus = D*ft; /* update ray for effect of lens */ P = make_float3(lensuv.x, lensuv.y, 0.0f); D = normalize(Pfocus - P); } /* transform ray from camera to world */ Transform cameratoworld = kernel_data.cam.cameratoworld; #ifdef __CAMERA_MOTION__ if(kernel_data.cam.have_motion) { # ifdef __KERNEL_OPENCL__ const MotionTransform tfm = kernel_data.cam.motion; transform_motion_interpolate(&cameratoworld, &tfm, ray->time); # else transform_motion_interpolate(&cameratoworld, &kernel_data.cam.motion, ray->time); # endif } #endif P = transform_point(&cameratoworld, P); D = normalize(transform_direction(&cameratoworld, D)); bool use_stereo = kernel_data.cam.interocular_offset != 0.0f; if(!use_stereo) { /* No stereo */ ray->P = P; ray->D = D; #ifdef __RAY_DIFFERENTIALS__ float3 Dcenter = transform_direction(&cameratoworld, Pcamera); ray->dP = differential3_zero(); ray->dD.dx = normalize(Dcenter + float4_to_float3(kernel_data.cam.dx)) - normalize(Dcenter); ray->dD.dy = normalize(Dcenter + float4_to_float3(kernel_data.cam.dy)) - normalize(Dcenter); #endif } else { /* Spherical stereo */ spherical_stereo_transform(&kernel_data.cam, &P, &D); ray->P = P; ray->D = D; #ifdef __RAY_DIFFERENTIALS__ /* Ray differentials, computed from scratch using the raster coordinates * because we don't want to be affected by depth of field. We compute * ray origin and direction for the center and two neighbouring pixels * and simply take their differences. */ float3 Pnostereo = transform_point(&cameratoworld, make_float3(0.0f, 0.0f, 0.0f)); float3 Pcenter = Pnostereo; float3 Dcenter = Pcamera; Dcenter = normalize(transform_direction(&cameratoworld, Dcenter)); spherical_stereo_transform(&kernel_data.cam, &Pcenter, &Dcenter); float3 Px = Pnostereo; float3 Dx = transform_perspective(&rastertocamera, make_float3(raster_x + 1.0f, raster_y, 0.0f)); Dx = normalize(transform_direction(&cameratoworld, Dx)); spherical_stereo_transform(&kernel_data.cam, &Px, &Dx); ray->dP.dx = Px - Pcenter; ray->dD.dx = Dx - Dcenter; float3 Py = Pnostereo; float3 Dy = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y + 1.0f, 0.0f)); Dy = normalize(transform_direction(&cameratoworld, Dy)); spherical_stereo_transform(&kernel_data.cam, &Py, &Dy); ray->dP.dy = Py - Pcenter; ray->dD.dy = Dy - Dcenter; #endif } #ifdef __CAMERA_CLIPPING__ /* clipping */ float z_inv = 1.0f / normalize(Pcamera).z; float nearclip = kernel_data.cam.nearclip * z_inv; ray->P += nearclip * ray->D; ray->dP.dx += nearclip * ray->dD.dx; ray->dP.dy += nearclip * ray->dD.dy; ray->t = kernel_data.cam.cliplength * z_inv; #else ray->t = FLT_MAX; #endif } /* Orthographic Camera */ ccl_device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, float raster_y, float lens_u, float lens_v, ccl_addr_space Ray *ray) { /* create ray form raster position */ Transform rastertocamera = kernel_data.cam.rastertocamera; float3 Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); float3 P; float3 D = make_float3(0.0f, 0.0f, 1.0f); /* modify ray for depth of field */ float aperturesize = kernel_data.cam.aperturesize; if(aperturesize > 0.0f) { /* sample point on aperture */ float2 lensuv = camera_sample_aperture(&kernel_data.cam, lens_u, lens_v)*aperturesize; /* compute point on plane of focus */ float3 Pfocus = D * kernel_data.cam.focaldistance; /* update ray for effect of lens */ float3 lensuvw = make_float3(lensuv.x, lensuv.y, 0.0f); P = Pcamera + lensuvw; D = normalize(Pfocus - lensuvw); } else { P = Pcamera; } /* transform ray from camera to world */ Transform cameratoworld = kernel_data.cam.cameratoworld; #ifdef __CAMERA_MOTION__ if(kernel_data.cam.have_motion) { # ifdef __KERNEL_OPENCL__ const MotionTransform tfm = kernel_data.cam.motion; transform_motion_interpolate(&cameratoworld, &tfm, ray->time); # else transform_motion_interpolate(&cameratoworld, &kernel_data.cam.motion, ray->time); # endif } #endif ray->P = transform_point(&cameratoworld, P); ray->D = normalize(transform_direction(&cameratoworld, D)); #ifdef __RAY_DIFFERENTIALS__ /* ray differential */ ray->dP.dx = float4_to_float3(kernel_data.cam.dx); ray->dP.dy = float4_to_float3(kernel_data.cam.dy); ray->dD = differential3_zero(); #endif #ifdef __CAMERA_CLIPPING__ /* clipping */ ray->t = kernel_data.cam.cliplength; #else ray->t = FLT_MAX; #endif } /* Panorama Camera */ ccl_device_inline void camera_sample_panorama(ccl_constant KernelCamera *cam, float raster_x, float raster_y, float lens_u, float lens_v, ccl_addr_space Ray *ray) { Transform rastertocamera = cam->rastertocamera; float3 Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); /* create ray form raster position */ float3 P = make_float3(0.0f, 0.0f, 0.0f); float3 D = panorama_to_direction(cam, Pcamera.x, Pcamera.y); /* indicates ray should not receive any light, outside of the lens */ if(is_zero(D)) { ray->t = 0.0f; return; } /* modify ray for depth of field */ float aperturesize = cam->aperturesize; if(aperturesize > 0.0f) { /* sample point on aperture */ float2 lensuv = camera_sample_aperture(cam, lens_u, lens_v)*aperturesize; /* compute point on plane of focus */ float3 Dfocus = normalize(D); float3 Pfocus = Dfocus * cam->focaldistance; /* calculate orthonormal coordinates perpendicular to Dfocus */ float3 U, V; U = normalize(make_float3(1.0f, 0.0f, 0.0f) - Dfocus.x * Dfocus); V = normalize(cross(Dfocus, U)); /* update ray for effect of lens */ P = U * lensuv.x + V * lensuv.y; D = normalize(Pfocus - P); } /* transform ray from camera to world */ Transform cameratoworld = cam->cameratoworld; #ifdef __CAMERA_MOTION__ if(cam->have_motion) { # ifdef __KERNEL_OPENCL__ const MotionTransform tfm = cam->motion; transform_motion_interpolate(&cameratoworld, &tfm, ray->time); # else transform_motion_interpolate(&cameratoworld, &cam->motion, ray->time); # endif } #endif P = transform_point(&cameratoworld, P); D = normalize(transform_direction(&cameratoworld, D)); /* Stereo transform */ bool use_stereo = cam->interocular_offset != 0.0f; if(use_stereo) { spherical_stereo_transform(cam, &P, &D); } ray->P = P; ray->D = D; #ifdef __RAY_DIFFERENTIALS__ /* Ray differentials, computed from scratch using the raster coordinates * because we don't want to be affected by depth of field. We compute * ray origin and direction for the center and two neighbouring pixels * and simply take their differences. */ float3 Pcenter = Pcamera; float3 Dcenter = panorama_to_direction(cam, Pcenter.x, Pcenter.y); Pcenter = transform_point(&cameratoworld, Pcenter); Dcenter = normalize(transform_direction(&cameratoworld, Dcenter)); if(use_stereo) { spherical_stereo_transform(cam, &Pcenter, &Dcenter); } float3 Px = transform_perspective(&rastertocamera, make_float3(raster_x + 1.0f, raster_y, 0.0f)); float3 Dx = panorama_to_direction(cam, Px.x, Px.y); Px = transform_point(&cameratoworld, Px); Dx = normalize(transform_direction(&cameratoworld, Dx)); if(use_stereo) { spherical_stereo_transform(cam, &Px, &Dx); } ray->dP.dx = Px - Pcenter; ray->dD.dx = Dx - Dcenter; float3 Py = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y + 1.0f, 0.0f)); float3 Dy = panorama_to_direction(cam, Py.x, Py.y); Py = transform_point(&cameratoworld, Py); Dy = normalize(transform_direction(&cameratoworld, Dy)); if(use_stereo) { spherical_stereo_transform(cam, &Py, &Dy); } ray->dP.dy = Py - Pcenter; ray->dD.dy = Dy - Dcenter; #endif #ifdef __CAMERA_CLIPPING__ /* clipping */ float nearclip = cam->nearclip; ray->P += nearclip * ray->D; ray->dP.dx += nearclip * ray->dD.dx; ray->dP.dy += nearclip * ray->dD.dy; ray->t = cam->cliplength; #else ray->t = FLT_MAX; #endif } /* Common */ ccl_device_inline void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, float filter_v, float lens_u, float lens_v, float time, ccl_addr_space Ray *ray) { /* pixel filter */ int filter_table_offset = kernel_data.film.filter_table_offset; float raster_x = x + lookup_table_read(kg, filter_u, filter_table_offset, FILTER_TABLE_SIZE); float raster_y = y + lookup_table_read(kg, filter_v, filter_table_offset, FILTER_TABLE_SIZE); #ifdef __CAMERA_MOTION__ /* motion blur */ if(kernel_data.cam.shuttertime == -1.0f) { ray->time = 0.5f; } else { /* TODO(sergey): Such lookup is unneeded when there's rolling shutter * effect in use but rolling shutter duration is set to 0.0. */ const int shutter_table_offset = kernel_data.cam.shutter_table_offset; ray->time = lookup_table_read(kg, time, shutter_table_offset, SHUTTER_TABLE_SIZE); /* TODO(sergey): Currently single rolling shutter effect type only * where scanlines are acquired from top to bottom and whole scanline * is acquired at once (no delay in acquisition happens between pixels * of single scanline). * * Might want to support more models in the future. */ if(kernel_data.cam.rolling_shutter_type) { /* Time corresponding to a fully rolling shutter only effect: * top of the frame is time 0.0, bottom of the frame is time 1.0. */ const float time = 1.0f - (float)y / kernel_data.cam.height; const float duration = kernel_data.cam.rolling_shutter_duration; if(duration != 0.0f) { /* This isn't fully physical correct, but lets us to have simple * controls in the interface. The idea here is basically sort of * linear interpolation between how much rolling shutter effect * exist on the frame and how much of it is a motion blur effect. */ ray->time = (ray->time - 0.5f) * duration; ray->time += (time - 0.5f) * (1.0f - duration) + 0.5f; } else { ray->time = time; } } } #endif /* sample */ if(kernel_data.cam.type == CAMERA_PERSPECTIVE) camera_sample_perspective(kg, raster_x, raster_y, lens_u, lens_v, ray); else if(kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) camera_sample_orthographic(kg, raster_x, raster_y, lens_u, lens_v, ray); else camera_sample_panorama(&kernel_data.cam, raster_x, raster_y, lens_u, lens_v, ray); } /* Utilities */ ccl_device_inline float3 camera_position(KernelGlobals *kg) { Transform cameratoworld = kernel_data.cam.cameratoworld; return make_float3(cameratoworld.x.w, cameratoworld.y.w, cameratoworld.z.w); } ccl_device_inline float camera_distance(KernelGlobals *kg, float3 P) { Transform cameratoworld = kernel_data.cam.cameratoworld; float3 camP = make_float3(cameratoworld.x.w, cameratoworld.y.w, cameratoworld.z.w); if(kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) { float3 camD = make_float3(cameratoworld.x.z, cameratoworld.y.z, cameratoworld.z.z); return fabsf(dot((P - camP), camD)); } else return len(P - camP); } ccl_device_inline float3 camera_direction_from_point(KernelGlobals *kg, float3 P) { Transform cameratoworld = kernel_data.cam.cameratoworld; if(kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) { float3 camD = make_float3(cameratoworld.x.z, cameratoworld.y.z, cameratoworld.z.z); return -camD; } else { float3 camP = make_float3(cameratoworld.x.w, cameratoworld.y.w, cameratoworld.z.w); return normalize(camP - P); } } ccl_device_inline float3 camera_world_to_ndc(KernelGlobals *kg, ShaderData *sd, float3 P) { if(kernel_data.cam.type != CAMERA_PANORAMA) { /* perspective / ortho */ if(sd->object == PRIM_NONE && kernel_data.cam.type == CAMERA_PERSPECTIVE) P += camera_position(kg); Transform tfm = kernel_data.cam.worldtondc; return transform_perspective(&tfm, P); } else { /* panorama */ Transform tfm = kernel_data.cam.worldtocamera; if(sd->object != OBJECT_NONE) P = normalize(transform_point(&tfm, P)); else P = normalize(transform_direction(&tfm, P)); float2 uv = direction_to_panorama(&kernel_data.cam, P); return make_float3(uv.x, uv.y, 0.0f); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_compat_cpu.h000066400000000000000000000103471334742672700235250ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_COMPAT_CPU_H__ #define __KERNEL_COMPAT_CPU_H__ #define __KERNEL_CPU__ /* Release kernel has too much false-positive maybe-uninitialized warnings, * which makes it possible to miss actual warnings. */ #if (defined(__GNUC__) && !defined(__clang__)) && defined(NDEBUG) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" # pragma GCC diagnostic ignored "-Wuninitialized" #endif /* Selective nodes compilation. */ #ifndef __NODES_MAX_GROUP__ # define __NODES_MAX_GROUP__ NODE_GROUP_LEVEL_MAX #endif #ifndef __NODES_FEATURES__ # define __NODES_FEATURES__ NODE_FEATURE_ALL #endif #include "util/util_math.h" #include "util/util_simd.h" #include "util/util_half.h" #include "util/util_types.h" #include "util/util_texture.h" #define ccl_addr_space #define ccl_local_id(d) 0 #define ccl_global_id(d) (kg->global_id[d]) #define ccl_local_size(d) 1 #define ccl_global_size(d) (kg->global_size[d]) #define ccl_group_id(d) ccl_global_id(d) #define ccl_num_groups(d) ccl_global_size(d) /* On x86_64, versions of glibc < 2.16 have an issue where expf is * much slower than the double version. This was fixed in glibc 2.16. */ #if !defined(__KERNEL_GPU__) && defined(__x86_64__) && defined(__x86_64__) && \ defined(__GNU_LIBRARY__) && defined(__GLIBC__ ) && defined(__GLIBC_MINOR__) && \ (__GLIBC__ <= 2 && __GLIBC_MINOR__ < 16) # define expf(x) ((float)exp((double)(x))) #endif CCL_NAMESPACE_BEGIN /* Assertions inside the kernel only work for the CPU device, so we wrap it in * a macro which is empty for other devices */ #define kernel_assert(cond) assert(cond) /* Texture types to be compatible with CUDA textures. These are really just * simple arrays and after inlining fetch hopefully revert to being a simple * pointer lookup. */ template struct texture { ccl_always_inline const T& fetch(int index) { kernel_assert(index >= 0 && index < width); return data[index]; } #ifdef __KERNEL_AVX__ /* Reads 256 bytes but indexes in blocks of 128 bytes to maintain * compatibility with existing indicies and data structures. */ ccl_always_inline avxf fetch_avxf(const int index) { kernel_assert(index >= 0 && (index+1) < width); ssef *ssef_data = (ssef*)data; ssef *ssef_node_data = &ssef_data[index]; return _mm256_loadu_ps((float *)ssef_node_data); } #endif #ifdef __KERNEL_SSE2__ ccl_always_inline ssef fetch_ssef(int index) { kernel_assert(index >= 0 && index < width); return ((ssef*)data)[index]; } ccl_always_inline ssei fetch_ssei(int index) { kernel_assert(index >= 0 && index < width); return ((ssei*)data)[index]; } #endif T *data; int width; }; /* Macros to handle different memory storage on different devices */ #define kernel_tex_fetch(tex, index) (kg->tex.fetch(index)) #define kernel_tex_fetch_avxf(tex, index) (kg->tex.fetch_avxf(index)) #define kernel_tex_fetch_ssef(tex, index) (kg->tex.fetch_ssef(index)) #define kernel_tex_fetch_ssei(tex, index) (kg->tex.fetch_ssei(index)) #define kernel_tex_lookup(tex, t, offset, size) (kg->tex.lookup(t, offset, size)) #define kernel_data (kg->__data) #ifdef __KERNEL_SSE2__ typedef vector3 sse3b; typedef vector3 sse3f; typedef vector3 sse3i; ccl_device_inline void print_sse3b(const char *label, sse3b& a) { print_sseb(label, a.x); print_sseb(label, a.y); print_sseb(label, a.z); } ccl_device_inline void print_sse3f(const char *label, sse3f& a) { print_ssef(label, a.x); print_ssef(label, a.y); print_ssef(label, a.z); } ccl_device_inline void print_sse3i(const char *label, sse3i& a) { print_ssei(label, a.x); print_ssei(label, a.y); print_ssei(label, a.z); } #endif CCL_NAMESPACE_END #endif /* __KERNEL_COMPAT_CPU_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_compat_cuda.h000066400000000000000000000073571334742672700236610ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_COMPAT_CUDA_H__ #define __KERNEL_COMPAT_CUDA_H__ #define __KERNEL_GPU__ #define __KERNEL_CUDA__ #define CCL_NAMESPACE_BEGIN #define CCL_NAMESPACE_END /* Selective nodes compilation. */ #ifndef __NODES_MAX_GROUP__ # define __NODES_MAX_GROUP__ NODE_GROUP_LEVEL_MAX #endif #ifndef __NODES_FEATURES__ # define __NODES_FEATURES__ NODE_FEATURE_ALL #endif /* Manual definitions so we can compile without CUDA toolkit. */ typedef unsigned int uint32_t; typedef unsigned long long uint64_t; typedef unsigned short half; typedef unsigned long long CUtexObject; #define FLT_MIN 1.175494350822287507969e-38f #define FLT_MAX 340282346638528859811704183484516925440.0f __device__ half __float2half(const float f) { half val; asm("{ cvt.rn.f16.f32 %0, %1;}\n" : "=h"(val) : "f"(f)); return val; } /* Qualifier wrappers for different names on different devices */ #define ccl_device __device__ __inline__ #if __CUDA_ARCH__ < 500 # define ccl_device_inline __device__ __forceinline__ # define ccl_device_forceinline __device__ __forceinline__ #else # define ccl_device_inline __device__ __inline__ # define ccl_device_forceinline __device__ __forceinline__ #endif #define ccl_device_noinline __device__ __noinline__ #define ccl_global #define ccl_static_constant __constant__ #define ccl_constant const #define ccl_local __shared__ #define ccl_local_param #define ccl_private #define ccl_may_alias #define ccl_addr_space #define ccl_restrict __restrict__ /* TODO(sergey): In theory we might use references with CUDA, however * performance impact yet to be investigated. */ #define ccl_ref #define ccl_align(n) __align__(n) #define ATTR_FALLTHROUGH #define CCL_MAX_LOCAL_SIZE (CUDA_THREADS_BLOCK_WIDTH*CUDA_THREADS_BLOCK_WIDTH) /* No assert supported for CUDA */ #define kernel_assert(cond) /* Types */ #include "util/util_half.h" #include "util/util_types.h" /* Work item functions */ ccl_device_inline uint ccl_local_id(uint d) { switch(d) { case 0: return threadIdx.x; case 1: return threadIdx.y; case 2: return threadIdx.z; default: return 0; } } #define ccl_global_id(d) (ccl_group_id(d) * ccl_local_size(d) + ccl_local_id(d)) ccl_device_inline uint ccl_local_size(uint d) { switch(d) { case 0: return blockDim.x; case 1: return blockDim.y; case 2: return blockDim.z; default: return 0; } } #define ccl_global_size(d) (ccl_num_groups(d) * ccl_local_size(d)) ccl_device_inline uint ccl_group_id(uint d) { switch(d) { case 0: return blockIdx.x; case 1: return blockIdx.y; case 2: return blockIdx.z; default: return 0; } } ccl_device_inline uint ccl_num_groups(uint d) { switch(d) { case 0: return gridDim.x; case 1: return gridDim.y; case 2: return gridDim.z; default: return 0; } } /* Textures */ /* Use arrays for regular data. */ #define kernel_tex_fetch(t, index) t[(index)] #define kernel_data __data /* Use fast math functions */ #define cosf(x) __cosf(((float)(x))) #define sinf(x) __sinf(((float)(x))) #define powf(x, y) __powf(((float)(x)), ((float)(y))) #define tanf(x) __tanf(((float)(x))) #define logf(x) __logf(((float)(x))) #define expf(x) __expf(((float)(x))) #endif /* __KERNEL_COMPAT_CUDA_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_compat_opencl.h000066400000000000000000000105761334742672700242220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_COMPAT_OPENCL_H__ #define __KERNEL_COMPAT_OPENCL_H__ #define __KERNEL_GPU__ #define __KERNEL_OPENCL__ /* no namespaces in opencl */ #define CCL_NAMESPACE_BEGIN #define CCL_NAMESPACE_END #ifdef __CL_NOINLINE__ # define ccl_noinline __attribute__((noinline)) #else # define ccl_noinline #endif /* in opencl all functions are device functions, so leave this empty */ #define ccl_device #define ccl_device_inline ccl_device #define ccl_device_forceinline ccl_device #define ccl_device_noinline ccl_device ccl_noinline #define ccl_may_alias #define ccl_static_constant static __constant #define ccl_constant __constant #define ccl_global __global #define ccl_local __local #define ccl_local_param __local #define ccl_private __private #define ccl_restrict restrict #define ccl_ref #define ccl_align(n) __attribute__((aligned(n))) #ifdef __SPLIT_KERNEL__ # define ccl_addr_space __global #else # define ccl_addr_space #endif #define ATTR_FALLTHROUGH #define ccl_local_id(d) get_local_id(d) #define ccl_global_id(d) get_global_id(d) #define ccl_local_size(d) get_local_size(d) #define ccl_global_size(d) get_global_size(d) #define ccl_group_id(d) get_group_id(d) #define ccl_num_groups(d) get_num_groups(d) /* Selective nodes compilation. */ #ifndef __NODES_MAX_GROUP__ # define __NODES_MAX_GROUP__ NODE_GROUP_LEVEL_MAX #endif #ifndef __NODES_FEATURES__ # define __NODES_FEATURES__ NODE_FEATURE_ALL #endif /* no assert in opencl */ #define kernel_assert(cond) /* make_type definitions with opencl style element initializers */ #ifdef make_float2 # undef make_float2 #endif #ifdef make_float3 # undef make_float3 #endif #ifdef make_float4 # undef make_float4 #endif #ifdef make_int2 # undef make_int2 #endif #ifdef make_int3 # undef make_int3 #endif #ifdef make_int4 # undef make_int4 #endif #ifdef make_uchar4 # undef make_uchar4 #endif #define make_float2(x, y) ((float2)(x, y)) #define make_float3(x, y, z) ((float3)(x, y, z)) #define make_float4(x, y, z, w) ((float4)(x, y, z, w)) #define make_int2(x, y) ((int2)(x, y)) #define make_int3(x, y, z) ((int3)(x, y, z)) #define make_int4(x, y, z, w) ((int4)(x, y, z, w)) #define make_uchar4(x, y, z, w) ((uchar4)(x, y, z, w)) /* math functions */ #define __uint_as_float(x) as_float(x) #define __float_as_uint(x) as_uint(x) #define __int_as_float(x) as_float(x) #define __float_as_int(x) as_int(x) #define powf(x, y) pow(((float)(x)), ((float)(y))) #define fabsf(x) fabs(((float)(x))) #define copysignf(x, y) copysign(((float)(x)), ((float)(y))) #define asinf(x) asin(((float)(x))) #define acosf(x) acos(((float)(x))) #define atanf(x) atan(((float)(x))) #define floorf(x) floor(((float)(x))) #define ceilf(x) ceil(((float)(x))) #define hypotf(x, y) hypot(((float)(x)), ((float)(y))) #define atan2f(x, y) atan2(((float)(x)), ((float)(y))) #define fmaxf(x, y) fmax(((float)(x)), ((float)(y))) #define fminf(x, y) fmin(((float)(x)), ((float)(y))) #define fmodf(x, y) fmod((float)(x), (float)(y)) #ifndef __CL_USE_NATIVE__ # define sinf(x) native_sin(((float)(x))) # define cosf(x) native_cos(((float)(x))) # define tanf(x) native_tan(((float)(x))) # define expf(x) native_exp(((float)(x))) # define sqrtf(x) native_sqrt(((float)(x))) # define logf(x) native_log(((float)(x))) # define rcp(x) native_recip(x) #else # define sinf(x) sin(((float)(x))) # define cosf(x) cos(((float)(x))) # define tanf(x) tan(((float)(x))) # define expf(x) exp(((float)(x))) # define sqrtf(x) sqrt(((float)(x))) # define logf(x) log(((float)(x))) # define rcp(x) recip(x)) #endif /* data lookup defines */ #define kernel_data (*kg->data) #define kernel_tex_fetch(tex, index) ((const ccl_global tex##_t*)(kg->buffers[kg->tex.cl_buffer] + kg->tex.data))[(index)] /* define NULL */ #define NULL 0 #include "util/util_half.h" #include "util/util_types.h" #endif /* __KERNEL_COMPAT_OPENCL_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_differential.h000066400000000000000000000055731334742672700240340ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* See "Tracing Ray Differentials", Homan Igehy, 1999. */ ccl_device void differential_transfer(ccl_addr_space differential3 *dP_, const differential3 dP, float3 D, const differential3 dD, float3 Ng, float t) { /* ray differential transfer through homogeneous medium, to * compute dPdx/dy at a shading point from the incoming ray */ float3 tmp = D/dot(D, Ng); float3 tmpx = dP.dx + t*dD.dx; float3 tmpy = dP.dy + t*dD.dy; dP_->dx = tmpx - dot(tmpx, Ng)*tmp; dP_->dy = tmpy - dot(tmpy, Ng)*tmp; } ccl_device void differential_incoming(ccl_addr_space differential3 *dI, const differential3 dD) { /* compute dIdx/dy at a shading point, we just need to negate the * differential of the ray direction */ dI->dx = -dD.dx; dI->dy = -dD.dy; } ccl_device void differential_dudv(ccl_addr_space differential *du, ccl_addr_space differential *dv, float3 dPdu, float3 dPdv, differential3 dP, float3 Ng) { /* now we have dPdx/dy from the ray differential transfer, and dPdu/dv * from the primitive, we can compute dudx/dy and dvdx/dy. these are * mainly used for differentials of arbitrary mesh attributes. */ /* find most stable axis to project to 2D */ float xn = fabsf(Ng.x); float yn = fabsf(Ng.y); float zn = fabsf(Ng.z); if(zn < xn || zn < yn) { if(yn < xn || yn < zn) { dPdu.x = dPdu.y; dPdv.x = dPdv.y; dP.dx.x = dP.dx.y; dP.dy.x = dP.dy.y; } dPdu.y = dPdu.z; dPdv.y = dPdv.z; dP.dx.y = dP.dx.z; dP.dy.y = dP.dy.z; } /* using Cramer's rule, we solve for dudx and dvdx in a 2x2 linear system, * and the same for dudy and dvdy. the denominator is the same for both * solutions, so we compute it only once. * * dP.dx = dPdu * dudx + dPdv * dvdx; * dP.dy = dPdu * dudy + dPdv * dvdy; */ float det = (dPdu.x*dPdv.y - dPdv.x*dPdu.y); if(det != 0.0f) det = 1.0f/det; du->dx = (dP.dx.x*dPdv.y - dP.dx.y*dPdv.x)*det; dv->dx = (dP.dx.y*dPdu.x - dP.dx.x*dPdu.y)*det; du->dy = (dP.dy.x*dPdv.y - dP.dy.y*dPdv.x)*det; dv->dy = (dP.dy.y*dPdu.x - dP.dy.x*dPdu.y)*det; } ccl_device differential differential_zero() { differential d; d.dx = 0.0f; d.dy = 0.0f; return d; } ccl_device differential3 differential3_zero() { differential3 d; d.dx = make_float3(0.0f, 0.0f, 0.0f); d.dy = make_float3(0.0f, 0.0f, 0.0f); return d; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_emission.h000066400000000000000000000251531334742672700232220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Direction Emission */ ccl_device_noinline float3 direct_emissive_eval(KernelGlobals *kg, ShaderData *emission_sd, LightSample *ls, ccl_addr_space PathState *state, float3 I, differential3 dI, float t, float time) { /* setup shading at emitter */ float3 eval; int shader_flag = kernel_tex_fetch(__shader_flag, (ls->shader & SHADER_MASK)*SHADER_SIZE); #ifdef __BACKGROUND_MIS__ if(ls->type == LIGHT_BACKGROUND) { Ray ray; ray.D = ls->D; ray.P = ls->P; ray.t = 1.0f; ray.time = time; ray.dP = differential3_zero(); ray.dD = dI; shader_setup_from_background(kg, emission_sd, &ray); path_state_modify_bounce(state, true); eval = shader_eval_background(kg, emission_sd, state, 0); path_state_modify_bounce(state, false); } else #endif if(shader_flag & SD_HAS_CONSTANT_EMISSION) { eval.x = __int_as_float(kernel_tex_fetch(__shader_flag, (ls->shader & SHADER_MASK)*SHADER_SIZE + 2)); eval.y = __int_as_float(kernel_tex_fetch(__shader_flag, (ls->shader & SHADER_MASK)*SHADER_SIZE + 3)); eval.z = __int_as_float(kernel_tex_fetch(__shader_flag, (ls->shader & SHADER_MASK)*SHADER_SIZE + 4)); if((ls->prim != PRIM_NONE) && dot(ls->Ng, I) < 0.0f) { ls->Ng = -ls->Ng; } } else { shader_setup_from_sample(kg, emission_sd, ls->P, ls->Ng, I, ls->shader, ls->object, ls->prim, ls->u, ls->v, t, time, false, ls->lamp); ls->Ng = emission_sd->Ng; /* No proper path flag, we're evaluating this for all closures. that's * weak but we'd have to do multiple evaluations otherwise. */ path_state_modify_bounce(state, true); shader_eval_surface(kg, emission_sd, state, PATH_RAY_EMISSION); path_state_modify_bounce(state, false); /* Evaluate emissive closure. */ eval = shader_emissive_eval(kg, emission_sd); } eval *= ls->eval_fac; return eval; } ccl_device_noinline bool direct_emission(KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, LightSample *ls, ccl_addr_space PathState *state, Ray *ray, BsdfEval *eval, bool *is_lamp, float rand_terminate) { if(ls->pdf == 0.0f) return false; /* todo: implement */ differential3 dD = differential3_zero(); /* evaluate closure */ float3 light_eval = direct_emissive_eval(kg, emission_sd, ls, state, -ls->D, dD, ls->t, sd->time); if(is_zero(light_eval)) return false; /* evaluate BSDF at shading point */ #ifdef __VOLUME__ if(sd->prim != PRIM_NONE) shader_bsdf_eval(kg, sd, ls->D, eval, ls->pdf, ls->shader & SHADER_USE_MIS); else { float bsdf_pdf; shader_volume_phase_eval(kg, sd, ls->D, eval, &bsdf_pdf); if(ls->shader & SHADER_USE_MIS) { /* Multiple importance sampling. */ float mis_weight = power_heuristic(ls->pdf, bsdf_pdf); light_eval *= mis_weight; } } #else shader_bsdf_eval(kg, sd, ls->D, eval, ls->pdf, ls->shader & SHADER_USE_MIS); #endif bsdf_eval_mul3(eval, light_eval/ls->pdf); #ifdef __PASSES__ /* use visibility flag to skip lights */ if(ls->shader & SHADER_EXCLUDE_ANY) { if(ls->shader & SHADER_EXCLUDE_DIFFUSE) { eval->diffuse = make_float3(0.0f, 0.0f, 0.0f); eval->subsurface = make_float3(0.0f, 0.0f, 0.0f); } if(ls->shader & SHADER_EXCLUDE_GLOSSY) eval->glossy = make_float3(0.0f, 0.0f, 0.0f); if(ls->shader & SHADER_EXCLUDE_TRANSMIT) eval->transmission = make_float3(0.0f, 0.0f, 0.0f); if(ls->shader & SHADER_EXCLUDE_SCATTER) eval->scatter = make_float3(0.0f, 0.0f, 0.0f); } #endif if(bsdf_eval_is_zero(eval)) return false; if(kernel_data.integrator.light_inv_rr_threshold > 0.0f #ifdef __SHADOW_TRICKS__ && (state->flag & PATH_RAY_SHADOW_CATCHER) == 0 #endif ) { float probability = max3(fabs(bsdf_eval_sum(eval))) * kernel_data.integrator.light_inv_rr_threshold; if(probability < 1.0f) { if(rand_terminate >= probability) { return false; } bsdf_eval_mul(eval, 1.0f / probability); } } if(ls->shader & SHADER_CAST_SHADOW) { /* setup ray */ bool transmit = (dot(sd->Ng, ls->D) < 0.0f); ray->P = ray_offset(sd->P, (transmit)? -sd->Ng: sd->Ng); if(ls->t == FLT_MAX) { /* distant light */ ray->D = ls->D; ray->t = ls->t; } else { /* other lights, avoid self-intersection */ ray->D = ray_offset(ls->P, ls->Ng) - ray->P; ray->D = normalize_len(ray->D, &ray->t); } ray->dP = sd->dP; ray->dD = differential3_zero(); } else { /* signal to not cast shadow ray */ ray->t = 0.0f; } /* return if it's a lamp for shadow pass */ *is_lamp = (ls->prim == PRIM_NONE && ls->type != LIGHT_BACKGROUND); return true; } /* Indirect Primitive Emission */ ccl_device_noinline float3 indirect_primitive_emission(KernelGlobals *kg, ShaderData *sd, float t, int path_flag, float bsdf_pdf) { /* evaluate emissive closure */ float3 L = shader_emissive_eval(kg, sd); #ifdef __HAIR__ if(!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS) && (sd->type & PRIMITIVE_ALL_TRIANGLE)) #else if(!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS)) #endif { /* multiple importance sampling, get triangle light pdf, * and compute weight with respect to BSDF pdf */ float pdf = triangle_light_pdf(kg, sd, t); float mis_weight = power_heuristic(bsdf_pdf, pdf); return L*mis_weight; } return L; } /* Indirect Lamp Emission */ ccl_device_noinline bool indirect_lamp_emission(KernelGlobals *kg, ShaderData *emission_sd, ccl_addr_space PathState *state, Ray *ray, float3 *emission) { bool hit_lamp = false; *emission = make_float3(0.0f, 0.0f, 0.0f); for(int lamp = 0; lamp < kernel_data.integrator.num_all_lights; lamp++) { LightSample ls; if(!lamp_light_eval(kg, lamp, ray->P, ray->D, ray->t, &ls)) continue; #ifdef __PASSES__ /* use visibility flag to skip lights */ if(ls.shader & SHADER_EXCLUDE_ANY) { if(((ls.shader & SHADER_EXCLUDE_DIFFUSE) && (state->flag & PATH_RAY_DIFFUSE)) || ((ls.shader & SHADER_EXCLUDE_GLOSSY) && ((state->flag & (PATH_RAY_GLOSSY|PATH_RAY_REFLECT)) == (PATH_RAY_GLOSSY|PATH_RAY_REFLECT))) || ((ls.shader & SHADER_EXCLUDE_TRANSMIT) && (state->flag & PATH_RAY_TRANSMIT)) || ((ls.shader & SHADER_EXCLUDE_SCATTER) && (state->flag & PATH_RAY_VOLUME_SCATTER))) continue; } #endif float3 L = direct_emissive_eval(kg, emission_sd, &ls, state, -ray->D, ray->dD, ls.t, ray->time); #ifdef __VOLUME__ if(state->volume_stack[0].shader != SHADER_NONE) { /* shadow attenuation */ Ray volume_ray = *ray; volume_ray.t = ls.t; float3 volume_tp = make_float3(1.0f, 1.0f, 1.0f); kernel_volume_shadow(kg, emission_sd, state, &volume_ray, &volume_tp); L *= volume_tp; } #endif if(!(state->flag & PATH_RAY_MIS_SKIP)) { /* multiple importance sampling, get regular light pdf, * and compute weight with respect to BSDF pdf */ float mis_weight = power_heuristic(state->ray_pdf, ls.pdf); L *= mis_weight; } *emission += L; hit_lamp = true; } return hit_lamp; } /* Indirect Background */ ccl_device_noinline float3 indirect_background(KernelGlobals *kg, ShaderData *emission_sd, ccl_addr_space PathState *state, ccl_addr_space Ray *ray) { #ifdef __BACKGROUND__ int shader = kernel_data.background.surface_shader; /* use visibility flag to skip lights */ if(shader & SHADER_EXCLUDE_ANY) { if(((shader & SHADER_EXCLUDE_DIFFUSE) && (state->flag & PATH_RAY_DIFFUSE)) || ((shader & SHADER_EXCLUDE_GLOSSY) && ((state->flag & (PATH_RAY_GLOSSY|PATH_RAY_REFLECT)) == (PATH_RAY_GLOSSY|PATH_RAY_REFLECT))) || ((shader & SHADER_EXCLUDE_TRANSMIT) && (state->flag & PATH_RAY_TRANSMIT)) || ((shader & SHADER_EXCLUDE_CAMERA) && (state->flag & PATH_RAY_CAMERA)) || ((shader & SHADER_EXCLUDE_SCATTER) && (state->flag & PATH_RAY_VOLUME_SCATTER))) return make_float3(0.0f, 0.0f, 0.0f); } /* evaluate background closure */ # ifdef __SPLIT_KERNEL__ Ray priv_ray = *ray; shader_setup_from_background(kg, emission_sd, &priv_ray); # else shader_setup_from_background(kg, emission_sd, ray); # endif path_state_modify_bounce(state, true); float3 L = shader_eval_background(kg, emission_sd, state, state->flag); path_state_modify_bounce(state, false); #ifdef __BACKGROUND_MIS__ /* check if background light exists or if we should skip pdf */ int res = kernel_data.integrator.pdf_background_res; if(!(state->flag & PATH_RAY_MIS_SKIP) && res) { /* multiple importance sampling, get background light pdf for ray * direction, and compute weight with respect to BSDF pdf */ float pdf = background_light_pdf(kg, ray->P, ray->D); float mis_weight = power_heuristic(state->ray_pdf, pdf); return L*mis_weight; } #endif return L; #else return make_float3(0.8f, 0.8f, 0.8f); #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_film.h000066400000000000000000000050121334742672700223130ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device float4 film_map(KernelGlobals *kg, float4 irradiance, float scale) { float exposure = kernel_data.film.exposure; float4 result = irradiance*scale; /* conversion to srgb */ result.x = color_scene_linear_to_srgb(result.x*exposure); result.y = color_scene_linear_to_srgb(result.y*exposure); result.z = color_scene_linear_to_srgb(result.z*exposure); /* clamp since alpha might be > 1.0 due to russian roulette */ result.w = saturate(result.w); return result; } ccl_device uchar4 film_float_to_byte(float4 color) { uchar4 result; /* simple float to byte conversion */ result.x = (uchar)(saturate(color.x)*255.0f); result.y = (uchar)(saturate(color.y)*255.0f); result.z = (uchar)(saturate(color.z)*255.0f); result.w = (uchar)(saturate(color.w)*255.0f); return result; } ccl_device void kernel_film_convert_to_byte(KernelGlobals *kg, ccl_global uchar4 *rgba, ccl_global float *buffer, float sample_scale, int x, int y, int offset, int stride) { /* buffer offset */ int index = offset + x + y*stride; rgba += index; buffer += index*kernel_data.film.pass_stride; /* map colors */ float4 irradiance = *((ccl_global float4*)buffer); float4 float_result = film_map(kg, irradiance, sample_scale); uchar4 byte_result = film_float_to_byte(float_result); *rgba = byte_result; } ccl_device void kernel_film_convert_to_half_float(KernelGlobals *kg, ccl_global uchar4 *rgba, ccl_global float *buffer, float sample_scale, int x, int y, int offset, int stride) { /* buffer offset */ int index = offset + x + y*stride; ccl_global float4 *in = (ccl_global float4*)(buffer + index*kernel_data.film.pass_stride); ccl_global half *out = (ccl_global half*)rgba + index*4; float exposure = kernel_data.film.exposure; float4 rgba_in = *in; if(exposure != 1.0f) { rgba_in.x *= exposure; rgba_in.y *= exposure; rgba_in.z *= exposure; } float4_store_half(out, rgba_in, sample_scale); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_globals.h000066400000000000000000000124351334742672700230160ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Constant Globals */ #ifndef __KERNEL_GLOBALS_H__ #define __KERNEL_GLOBALS_H__ #ifdef __KERNEL_CPU__ # include "util/util_vector.h" #endif #ifdef __KERNEL_OPENCL__ # include "util/util_atomic.h" #endif CCL_NAMESPACE_BEGIN /* On the CPU, we pass along the struct KernelGlobals to nearly everywhere in * the kernel, to access constant data. These are all stored as "textures", but * these are really just standard arrays. We can't use actually globals because * multiple renders may be running inside the same process. */ #ifdef __KERNEL_CPU__ # ifdef __OSL__ struct OSLGlobals; struct OSLThreadData; struct OSLShadingSystem; # endif struct Intersection; struct VolumeStep; typedef struct KernelGlobals { # define KERNEL_TEX(type, name) texture name; # include "kernel/kernel_textures.h" KernelData __data; # ifdef __OSL__ /* On the CPU, we also have the OSL globals here. Most data structures are shared * with SVM, the difference is in the shaders and object/mesh attributes. */ OSLGlobals *osl; OSLShadingSystem *osl_ss; OSLThreadData *osl_tdata; # endif /* **** Run-time data **** */ /* Heap-allocated storage for transparent shadows intersections. */ Intersection *transparent_shadow_intersections; /* Storage for decoupled volume steps. */ VolumeStep *decoupled_volume_steps[2]; int decoupled_volume_steps_index; /* split kernel */ SplitData split_data; SplitParams split_param_data; int2 global_size; int2 global_id; } KernelGlobals; #endif /* __KERNEL_CPU__ */ /* For CUDA, constant memory textures must be globals, so we can't put them * into a struct. As a result we don't actually use this struct and use actual * globals and simply pass along a NULL pointer everywhere, which we hope gets * optimized out. */ #ifdef __KERNEL_CUDA__ __constant__ KernelData __data; typedef struct KernelGlobals { /* NOTE: Keep the size in sync with SHADOW_STACK_MAX_HITS. */ Intersection hits_stack[64]; } KernelGlobals; # define KERNEL_TEX(type, name) const __constant__ __device__ type *name; # include "kernel/kernel_textures.h" #endif /* __KERNEL_CUDA__ */ /* OpenCL */ #ifdef __KERNEL_OPENCL__ # define KERNEL_TEX(type, name) \ typedef type name##_t; # include "kernel/kernel_textures.h" typedef ccl_addr_space struct KernelGlobals { ccl_constant KernelData *data; ccl_global char *buffers[8]; # define KERNEL_TEX(type, name) \ TextureInfo name; # include "kernel/kernel_textures.h" # ifdef __SPLIT_KERNEL__ SplitData split_data; SplitParams split_param_data; # endif } KernelGlobals; #define KERNEL_BUFFER_PARAMS \ ccl_global char *buffer0, \ ccl_global char *buffer1, \ ccl_global char *buffer2, \ ccl_global char *buffer3, \ ccl_global char *buffer4, \ ccl_global char *buffer5, \ ccl_global char *buffer6, \ ccl_global char *buffer7 #define KERNEL_BUFFER_ARGS buffer0, buffer1, buffer2, buffer3, buffer4, buffer5, buffer6, buffer7 ccl_device_inline void kernel_set_buffer_pointers(KernelGlobals *kg, KERNEL_BUFFER_PARAMS) { #ifdef __SPLIT_KERNEL__ if(ccl_local_id(0) + ccl_local_id(1) == 0) #endif { kg->buffers[0] = buffer0; kg->buffers[1] = buffer1; kg->buffers[2] = buffer2; kg->buffers[3] = buffer3; kg->buffers[4] = buffer4; kg->buffers[5] = buffer5; kg->buffers[6] = buffer6; kg->buffers[7] = buffer7; } # ifdef __SPLIT_KERNEL__ ccl_barrier(CCL_LOCAL_MEM_FENCE); # endif } ccl_device_inline void kernel_set_buffer_info(KernelGlobals *kg) { # ifdef __SPLIT_KERNEL__ if(ccl_local_id(0) + ccl_local_id(1) == 0) # endif { ccl_global TextureInfo *info = (ccl_global TextureInfo*)kg->buffers[0]; # define KERNEL_TEX(type, name) \ kg->name = *(info++); # include "kernel/kernel_textures.h" } # ifdef __SPLIT_KERNEL__ ccl_barrier(CCL_LOCAL_MEM_FENCE); # endif } #endif /* __KERNEL_OPENCL__ */ /* Interpolated lookup table access */ ccl_device float lookup_table_read(KernelGlobals *kg, float x, int offset, int size) { x = saturate(x)*(size-1); int index = min(float_to_int(x), size-1); int nindex = min(index+1, size-1); float t = x - index; float data0 = kernel_tex_fetch(__lookup_table, index + offset); if(t == 0.0f) return data0; float data1 = kernel_tex_fetch(__lookup_table, nindex + offset); return (1.0f - t)*data0 + t*data1; } ccl_device float lookup_table_read_2D(KernelGlobals *kg, float x, float y, int offset, int xsize, int ysize) { y = saturate(y)*(ysize-1); int index = min(float_to_int(y), ysize-1); int nindex = min(index+1, ysize-1); float t = y - index; float data0 = lookup_table_read(kg, x, offset + xsize*index, xsize); if(t == 0.0f) return data0; float data1 = lookup_table_read(kg, x, offset + xsize*nindex, xsize); return (1.0f - t)*data0 + t*data1; } CCL_NAMESPACE_END #endif /* __KERNEL_GLOBALS_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_jitter.h000066400000000000000000000111371334742672700226720ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* TODO(sergey): Consider moving portable ctz/clz stuff to util. */ CCL_NAMESPACE_BEGIN /* "Correlated Multi-Jittered Sampling" * Andrew Kensler, Pixar Technical Memo 13-01, 2013 */ /* todo: find good value, suggested 64 gives pattern on cornell box ceiling */ #define CMJ_RANDOM_OFFSET_LIMIT 4096 ccl_device_inline bool cmj_is_pow2(int i) { return (i > 1) && ((i & (i - 1)) == 0); } ccl_device_inline int cmj_fast_mod_pow2(int a, int b) { return (a & (b - 1)); } /* b must be > 1 */ ccl_device_inline int cmj_fast_div_pow2(int a, int b) { kernel_assert(b > 1); #if defined(__KERNEL_SSE2__) # ifdef _MSC_VER unsigned long ctz; _BitScanForward(&ctz, b); return a >> ctz; # else return a >> __builtin_ctz(b); # endif #elif defined(__KERNEL_CUDA__) return a >> (__ffs(b) - 1); #else return a/b; #endif } ccl_device_inline uint cmj_w_mask(uint w) { kernel_assert(w > 1); #if defined(__KERNEL_SSE2__) # ifdef _MSC_VER unsigned long leading_zero; _BitScanReverse(&leading_zero, w); return ((1 << (1 + leading_zero)) - 1); # else return ((1 << (32 - __builtin_clz(w))) - 1); # endif #elif defined(__KERNEL_CUDA__) return ((1 << (32 - __clz(w))) - 1); #else w |= w >> 1; w |= w >> 2; w |= w >> 4; w |= w >> 8; w |= w >> 16; return w; #endif } ccl_device_inline uint cmj_permute(uint i, uint l, uint p) { uint w = l - 1; if((l & w) == 0) { /* l is a power of two (fast) */ i ^= p; i *= 0xe170893d; i ^= p >> 16; i ^= (i & w) >> 4; i ^= p >> 8; i *= 0x0929eb3f; i ^= p >> 23; i ^= (i & w) >> 1; i *= 1 | p >> 27; i *= 0x6935fa69; i ^= (i & w) >> 11; i *= 0x74dcb303; i ^= (i & w) >> 2; i *= 0x9e501cc3; i ^= (i & w) >> 2; i *= 0xc860a3df; i &= w; i ^= i >> 5; return (i + p) & w; } else { /* l is not a power of two (slow) */ w = cmj_w_mask(w); do { i ^= p; i *= 0xe170893d; i ^= p >> 16; i ^= (i & w) >> 4; i ^= p >> 8; i *= 0x0929eb3f; i ^= p >> 23; i ^= (i & w) >> 1; i *= 1 | p >> 27; i *= 0x6935fa69; i ^= (i & w) >> 11; i *= 0x74dcb303; i ^= (i & w) >> 2; i *= 0x9e501cc3; i ^= (i & w) >> 2; i *= 0xc860a3df; i &= w; i ^= i >> 5; } while(i >= l); return (i + p) % l; } } ccl_device_inline uint cmj_hash(uint i, uint p) { i ^= p; i ^= i >> 17; i ^= i >> 10; i *= 0xb36534e5; i ^= i >> 12; i ^= i >> 21; i *= 0x93fc4795; i ^= 0xdf6e307f; i ^= i >> 17; i *= 1 | p >> 18; return i; } ccl_device_inline uint cmj_hash_simple(uint i, uint p) { i = (i ^ 61) ^ p; i += i << 3; i ^= i >> 4; i *= 0x27d4eb2d; return i; } ccl_device_inline float cmj_randfloat(uint i, uint p) { return cmj_hash(i, p) * (1.0f / 4294967808.0f); } #ifdef __CMJ__ ccl_device float cmj_sample_1D(int s, int N, int p) { kernel_assert(s < N); uint x = cmj_permute(s, N, p * 0x68bc21eb); float jx = cmj_randfloat(s, p * 0x967a889b); float invN = 1.0f/N; return (x + jx)*invN; } /* TODO(sergey): Do some extra tests and consider moving to util_math.h. */ ccl_device_inline int cmj_isqrt(int value) { #if defined(__KERNEL_CUDA__) return float_to_int(__fsqrt_ru(value)); #elif defined(__KERNEL_GPU__) return float_to_int(sqrtf(value)); #else /* This is a work around for fast-math on CPU which might replace sqrtf() * with am approximated version. */ return float_to_int(sqrtf(value) + 1e-6f); #endif } ccl_device void cmj_sample_2D(int s, int N, int p, float *fx, float *fy) { kernel_assert(s < N); int m = cmj_isqrt(N); int n = (N - 1)/m + 1; float invN = 1.0f/N; float invm = 1.0f/m; float invn = 1.0f/n; s = cmj_permute(s, N, p * 0x51633e2d); int sdivm, smodm; if(cmj_is_pow2(m)) { sdivm = cmj_fast_div_pow2(s, m); smodm = cmj_fast_mod_pow2(s, m); } else { /* Doing s*inmv gives precision issues here. */ sdivm = s / m; smodm = s - sdivm*m; } uint sx = cmj_permute(smodm, m, p * 0x68bc21eb); uint sy = cmj_permute(sdivm, n, p * 0x02e5be93); float jx = cmj_randfloat(s, p * 0x967a889b); float jy = cmj_randfloat(s, p * 0x368cc8b7); *fx = (sx + (sy + jx)*invn)*invm; *fy = (s + jy)*invN; } #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_light.h000066400000000000000000001027351334742672700225050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Light Sample result */ typedef struct LightSample { float3 P; /* position on light, or direction for distant light */ float3 Ng; /* normal on light */ float3 D; /* direction from shading point to light */ float t; /* distance to light (FLT_MAX for distant light) */ float u, v; /* parametric coordinate on primitive */ float pdf; /* light sampling probability density function */ float eval_fac; /* intensity multiplier */ int object; /* object id for triangle/curve lights */ int prim; /* primitive id for triangle/curve lights */ int shader; /* shader id */ int lamp; /* lamp id */ LightType type; /* type of light */ } LightSample; /* Area light sampling */ /* Uses the following paper: * * Carlos Urena et al. * An Area-Preserving Parametrization for Spherical Rectangles. * * https://www.solidangle.com/research/egsr2013_spherical_rectangle.pdf * * Note: light_p is modified when sample_coord is true. */ ccl_device_inline float area_light_sample(float3 P, float3 *light_p, float3 axisu, float3 axisv, float randu, float randv, bool sample_coord) { /* In our name system we're using P for the center, * which is o in the paper. */ float3 corner = *light_p - axisu * 0.5f - axisv * 0.5f; float axisu_len, axisv_len; /* Compute local reference system R. */ float3 x = normalize_len(axisu, &axisu_len); float3 y = normalize_len(axisv, &axisv_len); float3 z = cross(x, y); /* Compute rectangle coords in local reference system. */ float3 dir = corner - P; float z0 = dot(dir, z); /* Flip 'z' to make it point against Q. */ if(z0 > 0.0f) { z *= -1.0f; z0 *= -1.0f; } float x0 = dot(dir, x); float y0 = dot(dir, y); float x1 = x0 + axisu_len; float y1 = y0 + axisv_len; /* Create vectors to four vertices. */ float3 v00 = make_float3(x0, y0, z0); float3 v01 = make_float3(x0, y1, z0); float3 v10 = make_float3(x1, y0, z0); float3 v11 = make_float3(x1, y1, z0); /* Compute normals to edges. */ float3 n0 = normalize(cross(v00, v10)); float3 n1 = normalize(cross(v10, v11)); float3 n2 = normalize(cross(v11, v01)); float3 n3 = normalize(cross(v01, v00)); /* Compute internal angles (gamma_i). */ float g0 = safe_acosf(-dot(n0, n1)); float g1 = safe_acosf(-dot(n1, n2)); float g2 = safe_acosf(-dot(n2, n3)); float g3 = safe_acosf(-dot(n3, n0)); /* Compute predefined constants. */ float b0 = n0.z; float b1 = n2.z; float b0sq = b0 * b0; float k = M_2PI_F - g2 - g3; /* Compute solid angle from internal angles. */ float S = g0 + g1 - k; if(sample_coord) { /* Compute cu. */ float au = randu * S + k; float fu = (cosf(au) * b0 - b1) / sinf(au); float cu = 1.0f / sqrtf(fu * fu + b0sq) * (fu > 0.0f ? 1.0f : -1.0f); cu = clamp(cu, -1.0f, 1.0f); /* Compute xu. */ float xu = -(cu * z0) / max(sqrtf(1.0f - cu * cu), 1e-7f); xu = clamp(xu, x0, x1); /* Compute yv. */ float z0sq = z0 * z0; float y0sq = y0 * y0; float y1sq = y1 * y1; float d = sqrtf(xu * xu + z0sq); float h0 = y0 / sqrtf(d * d + y0sq); float h1 = y1 / sqrtf(d * d + y1sq); float hv = h0 + randv * (h1 - h0), hv2 = hv * hv; float yv = (hv2 < 1.0f - 1e-6f) ? (hv * d) / sqrtf(1.0f - hv2) : y1; /* Transform (xu, yv, z0) to world coords. */ *light_p = P + xu * x + yv * y + z0 * z; } /* return pdf */ if(S != 0.0f) return 1.0f / S; else return 0.0f; } /* Background Light */ #ifdef __BACKGROUND_MIS__ /* TODO(sergey): In theory it should be all fine to use noinline for all * devices, but we're so close to the release so better not screw things * up for CPU at least. */ #ifdef __KERNEL_GPU__ ccl_device_noinline #else ccl_device #endif float3 background_map_sample(KernelGlobals *kg, float randu, float randv, float *pdf) { /* for the following, the CDF values are actually a pair of floats, with the * function value as X and the actual CDF as Y. The last entry's function * value is the CDF total. */ int res = kernel_data.integrator.pdf_background_res; int cdf_count = res + 1; /* this is basically std::lower_bound as used by pbrt */ int first = 0; int count = res; while(count > 0) { int step = count >> 1; int middle = first + step; if(kernel_tex_fetch(__light_background_marginal_cdf, middle).y < randv) { first = middle + 1; count -= step + 1; } else count = step; } int index_v = max(0, first - 1); kernel_assert(index_v >= 0 && index_v < res); float2 cdf_v = kernel_tex_fetch(__light_background_marginal_cdf, index_v); float2 cdf_next_v = kernel_tex_fetch(__light_background_marginal_cdf, index_v + 1); float2 cdf_last_v = kernel_tex_fetch(__light_background_marginal_cdf, res); /* importance-sampled V direction */ float dv = (randv - cdf_v.y) / (cdf_next_v.y - cdf_v.y); float v = (index_v + dv) / res; /* this is basically std::lower_bound as used by pbrt */ first = 0; count = res; while(count > 0) { int step = count >> 1; int middle = first + step; if(kernel_tex_fetch(__light_background_conditional_cdf, index_v * cdf_count + middle).y < randu) { first = middle + 1; count -= step + 1; } else count = step; } int index_u = max(0, first - 1); kernel_assert(index_u >= 0 && index_u < res); float2 cdf_u = kernel_tex_fetch(__light_background_conditional_cdf, index_v * cdf_count + index_u); float2 cdf_next_u = kernel_tex_fetch(__light_background_conditional_cdf, index_v * cdf_count + index_u + 1); float2 cdf_last_u = kernel_tex_fetch(__light_background_conditional_cdf, index_v * cdf_count + res); /* importance-sampled U direction */ float du = (randu - cdf_u.y) / (cdf_next_u.y - cdf_u.y); float u = (index_u + du) / res; /* compute pdf */ float denom = cdf_last_u.x * cdf_last_v.x; float sin_theta = sinf(M_PI_F * v); if(sin_theta == 0.0f || denom == 0.0f) *pdf = 0.0f; else *pdf = (cdf_u.x * cdf_v.x)/(M_2PI_F * M_PI_F * sin_theta * denom); /* compute direction */ return equirectangular_to_direction(u, v); } /* TODO(sergey): Same as above, after the release we should consider using * 'noinline' for all devices. */ #ifdef __KERNEL_GPU__ ccl_device_noinline #else ccl_device #endif float background_map_pdf(KernelGlobals *kg, float3 direction) { float2 uv = direction_to_equirectangular(direction); int res = kernel_data.integrator.pdf_background_res; float sin_theta = sinf(uv.y * M_PI_F); if(sin_theta == 0.0f) return 0.0f; int index_u = clamp(float_to_int(uv.x * res), 0, res - 1); int index_v = clamp(float_to_int(uv.y * res), 0, res - 1); /* pdfs in V direction */ float2 cdf_last_u = kernel_tex_fetch(__light_background_conditional_cdf, index_v * (res + 1) + res); float2 cdf_last_v = kernel_tex_fetch(__light_background_marginal_cdf, res); float denom = cdf_last_u.x * cdf_last_v.x; if(denom == 0.0f) return 0.0f; /* pdfs in U direction */ float2 cdf_u = kernel_tex_fetch(__light_background_conditional_cdf, index_v * (res + 1) + index_u); float2 cdf_v = kernel_tex_fetch(__light_background_marginal_cdf, index_v); return (cdf_u.x * cdf_v.x)/(M_2PI_F * M_PI_F * sin_theta * denom); } ccl_device_inline bool background_portal_data_fetch_and_check_side(KernelGlobals *kg, float3 P, int index, float3 *lightpos, float3 *dir) { float4 data0 = kernel_tex_fetch(__light_data, (index + kernel_data.integrator.portal_offset)*LIGHT_SIZE + 0); float4 data3 = kernel_tex_fetch(__light_data, (index + kernel_data.integrator.portal_offset)*LIGHT_SIZE + 3); *lightpos = make_float3(data0.y, data0.z, data0.w); *dir = make_float3(data3.y, data3.z, data3.w); /* Check whether portal is on the right side. */ if(dot(*dir, P - *lightpos) > 1e-4f) return true; return false; } ccl_device_inline float background_portal_pdf(KernelGlobals *kg, float3 P, float3 direction, int ignore_portal, bool *is_possible) { float portal_pdf = 0.0f; int num_possible = 0; for(int p = 0; p < kernel_data.integrator.num_portals; p++) { if(p == ignore_portal) continue; float3 lightpos, dir; if(!background_portal_data_fetch_and_check_side(kg, P, p, &lightpos, &dir)) continue; /* There's a portal that could be sampled from this position. */ if(is_possible) { *is_possible = true; } num_possible++; float4 data1 = kernel_tex_fetch(__light_data, (p + kernel_data.integrator.portal_offset)*LIGHT_SIZE + 1); float4 data2 = kernel_tex_fetch(__light_data, (p + kernel_data.integrator.portal_offset)*LIGHT_SIZE + 2); float3 axisu = make_float3(data1.y, data1.z, data1.w); float3 axisv = make_float3(data2.y, data2.z, data2.w); if(!ray_quad_intersect(P, direction, 1e-4f, FLT_MAX, lightpos, axisu, axisv, dir, NULL, NULL, NULL, NULL)) continue; portal_pdf += area_light_sample(P, &lightpos, axisu, axisv, 0.0f, 0.0f, false); } if(ignore_portal >= 0) { /* We have skipped a portal that could be sampled as well. */ num_possible++; } return (num_possible > 0)? portal_pdf / num_possible: 0.0f; } ccl_device int background_num_possible_portals(KernelGlobals *kg, float3 P) { int num_possible_portals = 0; for(int p = 0; p < kernel_data.integrator.num_portals; p++) { float3 lightpos, dir; if(background_portal_data_fetch_and_check_side(kg, P, p, &lightpos, &dir)) num_possible_portals++; } return num_possible_portals; } ccl_device float3 background_portal_sample(KernelGlobals *kg, float3 P, float randu, float randv, int num_possible, int *sampled_portal, float *pdf) { /* Pick a portal, then re-normalize randv. */ randv *= num_possible; int portal = (int)randv; randv -= portal; /* TODO(sergey): Some smarter way of finding portal to sample * is welcome. */ for(int p = 0; p < kernel_data.integrator.num_portals; p++) { /* Search for the sampled portal. */ float3 lightpos, dir; if(!background_portal_data_fetch_and_check_side(kg, P, p, &lightpos, &dir)) continue; if(portal == 0) { /* p is the portal to be sampled. */ float4 data1 = kernel_tex_fetch(__light_data, (p + kernel_data.integrator.portal_offset)*LIGHT_SIZE + 1); float4 data2 = kernel_tex_fetch(__light_data, (p + kernel_data.integrator.portal_offset)*LIGHT_SIZE + 2); float3 axisu = make_float3(data1.y, data1.z, data1.w); float3 axisv = make_float3(data2.y, data2.z, data2.w); *pdf = area_light_sample(P, &lightpos, axisu, axisv, randu, randv, true); *pdf /= num_possible; *sampled_portal = p; return normalize(lightpos - P); } portal--; } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device_inline float3 background_light_sample(KernelGlobals *kg, float3 P, float randu, float randv, float *pdf) { /* Probability of sampling portals instead of the map. */ float portal_sampling_pdf = kernel_data.integrator.portal_pdf; /* Check if there are portals in the scene which we can sample. */ if(portal_sampling_pdf > 0.0f) { int num_portals = background_num_possible_portals(kg, P); if(num_portals > 0) { if(portal_sampling_pdf == 1.0f || randu < portal_sampling_pdf) { if(portal_sampling_pdf < 1.0f) { randu /= portal_sampling_pdf; } int portal; float3 D = background_portal_sample(kg, P, randu, randv, num_portals, &portal, pdf); if(num_portals > 1) { /* Ignore the chosen portal, its pdf is already included. */ *pdf += background_portal_pdf(kg, P, D, portal, NULL); } /* We could also have sampled the map, so combine with MIS. */ if(portal_sampling_pdf < 1.0f) { float cdf_pdf = background_map_pdf(kg, D); *pdf = (portal_sampling_pdf * (*pdf) + (1.0f - portal_sampling_pdf) * cdf_pdf); } return D; } else { /* Sample map, but with nonzero portal_sampling_pdf for MIS. */ randu = (randu - portal_sampling_pdf) / (1.0f - portal_sampling_pdf); } } else { /* We can't sample a portal. * Check if we can sample the map instead. */ if(portal_sampling_pdf == 1.0f) { /* Use uniform as a fallback if we can't sample the map. */ *pdf = 1.0f / M_4PI_F; return sample_uniform_sphere(randu, randv); } else { portal_sampling_pdf = 0.0f; } } } float3 D = background_map_sample(kg, randu, randv, pdf); /* Use MIS if portals could be sampled as well. */ if(portal_sampling_pdf > 0.0f) { float portal_pdf = background_portal_pdf(kg, P, D, -1, NULL); *pdf = (portal_sampling_pdf * portal_pdf + (1.0f - portal_sampling_pdf) * (*pdf)); } return D; } ccl_device float background_light_pdf(KernelGlobals *kg, float3 P, float3 direction) { /* Probability of sampling portals instead of the map. */ float portal_sampling_pdf = kernel_data.integrator.portal_pdf; float portal_pdf = 0.0f, map_pdf = 0.0f; if(portal_sampling_pdf > 0.0f) { /* Evaluate PDF of sampling this direction by portal sampling. */ bool is_possible = false; portal_pdf = background_portal_pdf(kg, P, direction, -1, &is_possible) * portal_sampling_pdf; if(!is_possible) { /* Portal sampling is not possible here because all portals point to the wrong side. * If map sampling is possible, it would be used instead, otherwise fallback sampling is used. */ if(portal_sampling_pdf == 1.0f) { return kernel_data.integrator.pdf_lights / M_4PI_F; } else { /* Force map sampling. */ portal_sampling_pdf = 0.0f; } } } if(portal_sampling_pdf < 1.0f) { /* Evaluate PDF of sampling this direction by map sampling. */ map_pdf = background_map_pdf(kg, direction) * (1.0f - portal_sampling_pdf); } return (portal_pdf + map_pdf) * kernel_data.integrator.pdf_lights; } #endif /* Regular Light */ ccl_device float3 disk_light_sample(float3 v, float randu, float randv) { float3 ru, rv; make_orthonormals(v, &ru, &rv); to_unit_disk(&randu, &randv); return ru*randu + rv*randv; } ccl_device float3 distant_light_sample(float3 D, float radius, float randu, float randv) { return normalize(D + disk_light_sample(D, randu, randv)*radius); } ccl_device float3 sphere_light_sample(float3 P, float3 center, float radius, float randu, float randv) { return disk_light_sample(normalize(P - center), randu, randv)*radius; } ccl_device float spot_light_attenuation(float4 data1, float4 data2, LightSample *ls) { float3 dir = make_float3(data2.y, data2.z, data2.w); float3 I = ls->Ng; float spot_angle = data1.w; float spot_smooth = data2.x; float attenuation = dot(dir, I); if(attenuation <= spot_angle) { attenuation = 0.0f; } else { float t = attenuation - spot_angle; if(t < spot_smooth && spot_smooth != 0.0f) attenuation *= smoothstepf(t/spot_smooth); } return attenuation; } ccl_device float lamp_light_pdf(KernelGlobals *kg, const float3 Ng, const float3 I, float t) { float cos_pi = dot(Ng, I); if(cos_pi <= 0.0f) return 0.0f; return t*t/cos_pi; } ccl_device_inline bool lamp_light_sample(KernelGlobals *kg, int lamp, float randu, float randv, float3 P, LightSample *ls) { float4 data0 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 0); float4 data1 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 1); LightType type = (LightType)__float_as_int(data0.x); ls->type = type; ls->shader = __float_as_int(data1.x); ls->object = PRIM_NONE; ls->prim = PRIM_NONE; ls->lamp = lamp; ls->u = randu; ls->v = randv; if(type == LIGHT_DISTANT) { /* distant light */ float3 lightD = make_float3(data0.y, data0.z, data0.w); float3 D = lightD; float radius = data1.y; float invarea = data1.w; if(radius > 0.0f) D = distant_light_sample(D, radius, randu, randv); ls->P = D; ls->Ng = D; ls->D = -D; ls->t = FLT_MAX; float costheta = dot(lightD, D); ls->pdf = invarea/(costheta*costheta*costheta); ls->eval_fac = ls->pdf; } #ifdef __BACKGROUND_MIS__ else if(type == LIGHT_BACKGROUND) { /* infinite area light (e.g. light dome or env light) */ float3 D = -background_light_sample(kg, P, randu, randv, &ls->pdf); ls->P = D; ls->Ng = D; ls->D = -D; ls->t = FLT_MAX; ls->eval_fac = 1.0f; } #endif else { ls->P = make_float3(data0.y, data0.z, data0.w); if(type == LIGHT_POINT || type == LIGHT_SPOT) { float radius = data1.y; if(radius > 0.0f) /* sphere light */ ls->P += sphere_light_sample(P, ls->P, radius, randu, randv); ls->D = normalize_len(ls->P - P, &ls->t); ls->Ng = -ls->D; float invarea = data1.z; ls->eval_fac = (0.25f*M_1_PI_F)*invarea; ls->pdf = invarea; if(type == LIGHT_SPOT) { /* spot light attenuation */ float4 data2 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 2); ls->eval_fac *= spot_light_attenuation(data1, data2, ls); if(ls->eval_fac == 0.0f) { return false; } } float2 uv = map_to_sphere(ls->Ng); ls->u = uv.x; ls->v = uv.y; ls->pdf *= lamp_light_pdf(kg, ls->Ng, -ls->D, ls->t); } else { /* area light */ float4 data2 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 2); float4 data3 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 3); float3 axisu = make_float3(data1.y, data1.z, data1.w); float3 axisv = make_float3(data2.y, data2.z, data2.w); float3 D = make_float3(data3.y, data3.z, data3.w); if(dot(ls->P - P, D) > 0.0f) { return false; } float3 inplane = ls->P; ls->pdf = area_light_sample(P, &ls->P, axisu, axisv, randu, randv, true); inplane = ls->P - inplane; ls->u = dot(inplane, axisu) * (1.0f / dot(axisu, axisu)) + 0.5f; ls->v = dot(inplane, axisv) * (1.0f / dot(axisv, axisv)) + 0.5f; ls->Ng = D; ls->D = normalize_len(ls->P - P, &ls->t); float invarea = data2.x; ls->eval_fac = 0.25f*invarea; } } ls->pdf *= kernel_data.integrator.pdf_lights; return (ls->pdf > 0.0f); } ccl_device bool lamp_light_eval(KernelGlobals *kg, int lamp, float3 P, float3 D, float t, LightSample *ls) { float4 data0 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 0); float4 data1 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 1); LightType type = (LightType)__float_as_int(data0.x); ls->type = type; ls->shader = __float_as_int(data1.x); ls->object = PRIM_NONE; ls->prim = PRIM_NONE; ls->lamp = lamp; /* todo: missing texture coordinates */ ls->u = 0.0f; ls->v = 0.0f; if(!(ls->shader & SHADER_USE_MIS)) return false; if(type == LIGHT_DISTANT) { /* distant light */ float radius = data1.y; if(radius == 0.0f) return false; if(t != FLT_MAX) return false; /* a distant light is infinitely far away, but equivalent to a disk * shaped light exactly 1 unit away from the current shading point. * * radius t^2/cos(theta) * <----------> t = sqrt(1^2 + tan(theta)^2) * tan(th) area = radius*radius*pi * <-----> * \ | (1 + tan(theta)^2)/cos(theta) * \ | (1 + tan(acos(cos(theta)))^2)/cos(theta) * t \th| 1 simplifies to * \-| 1/(cos(theta)^3) * \| magic! * P */ float3 lightD = make_float3(data0.y, data0.z, data0.w); float costheta = dot(-lightD, D); float cosangle = data1.z; if(costheta < cosangle) return false; ls->P = -D; ls->Ng = -D; ls->D = D; ls->t = FLT_MAX; /* compute pdf */ float invarea = data1.w; ls->pdf = invarea/(costheta*costheta*costheta); ls->eval_fac = ls->pdf; } else if(type == LIGHT_POINT || type == LIGHT_SPOT) { float3 lightP = make_float3(data0.y, data0.z, data0.w); float radius = data1.y; /* sphere light */ if(radius == 0.0f) return false; if(!ray_aligned_disk_intersect(P, D, t, lightP, radius, &ls->P, &ls->t)) { return false; } ls->Ng = -D; ls->D = D; float invarea = data1.z; ls->eval_fac = (0.25f*M_1_PI_F)*invarea; ls->pdf = invarea; if(type == LIGHT_SPOT) { /* spot light attenuation */ float4 data2 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 2); ls->eval_fac *= spot_light_attenuation(data1, data2, ls); if(ls->eval_fac == 0.0f) return false; } float2 uv = map_to_sphere(ls->Ng); ls->u = uv.x; ls->v = uv.y; /* compute pdf */ if(ls->t != FLT_MAX) ls->pdf *= lamp_light_pdf(kg, ls->Ng, -ls->D, ls->t); } else if(type == LIGHT_AREA) { /* area light */ float4 data2 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 2); float4 data3 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 3); float invarea = data2.x; if(invarea == 0.0f) return false; float3 axisu = make_float3(data1.y, data1.z, data1.w); float3 axisv = make_float3(data2.y, data2.z, data2.w); float3 Ng = make_float3(data3.y, data3.z, data3.w); /* one sided */ if(dot(D, Ng) >= 0.0f) return false; float3 light_P = make_float3(data0.y, data0.z, data0.w); if(!ray_quad_intersect(P, D, 0.0f, t, light_P, axisu, axisv, Ng, &ls->P, &ls->t, &ls->u, &ls->v)) { return false; } ls->D = D; ls->Ng = Ng; ls->pdf = area_light_sample(P, &light_P, axisu, axisv, 0, 0, false); ls->eval_fac = 0.25f*invarea; } else { return false; } ls->pdf *= kernel_data.integrator.pdf_lights; return true; } /* Triangle Light */ /* returns true if the triangle is has motion blur or an instancing transform applied */ ccl_device_inline bool triangle_world_space_vertices(KernelGlobals *kg, int object, int prim, float time, float3 V[3]) { bool has_motion = false; const int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_HAS_VERTEX_MOTION && time >= 0.0f) { motion_triangle_vertices(kg, object, prim, time, V); has_motion = true; } else { triangle_vertices(kg, prim, V); } #ifdef __INSTANCING__ if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { # ifdef __OBJECT_MOTION__ Transform tfm = object_fetch_transform_motion_test(kg, object, time, NULL); # else Transform tfm = object_fetch_transform(kg, object, OBJECT_TRANSFORM); # endif V[0] = transform_point(&tfm, V[0]); V[1] = transform_point(&tfm, V[1]); V[2] = transform_point(&tfm, V[2]); has_motion = true; } #endif return has_motion; } ccl_device_inline float triangle_light_pdf_area(KernelGlobals *kg, const float3 Ng, const float3 I, float t) { float pdf = kernel_data.integrator.pdf_triangles; float cos_pi = fabsf(dot(Ng, I)); if(cos_pi == 0.0f) return 0.0f; return t*t*pdf/cos_pi; } ccl_device_forceinline float triangle_light_pdf(KernelGlobals *kg, ShaderData *sd, float t) { /* A naive heuristic to decide between costly solid angle sampling * and simple area sampling, comparing the distance to the triangle plane * to the length of the edges of the triangle. */ float3 V[3]; bool has_motion = triangle_world_space_vertices(kg, sd->object, sd->prim, sd->time, V); const float3 e0 = V[1] - V[0]; const float3 e1 = V[2] - V[0]; const float3 e2 = V[2] - V[1]; const float longest_edge_squared = max(len_squared(e0), max(len_squared(e1), len_squared(e2))); const float3 N = cross(e0, e1); const float distance_to_plane = fabsf(dot(N, sd->I * t))/dot(N, N); if(longest_edge_squared > distance_to_plane*distance_to_plane) { /* sd contains the point on the light source * calculate Px, the point that we're shading */ const float3 Px = sd->P + sd->I * t; const float3 v0_p = V[0] - Px; const float3 v1_p = V[1] - Px; const float3 v2_p = V[2] - Px; const float3 u01 = safe_normalize(cross(v0_p, v1_p)); const float3 u02 = safe_normalize(cross(v0_p, v2_p)); const float3 u12 = safe_normalize(cross(v1_p, v2_p)); const float alpha = fast_acosf(dot(u02, u01)); const float beta = fast_acosf(-dot(u01, u12)); const float gamma = fast_acosf(dot(u02, u12)); const float solid_angle = alpha + beta + gamma - M_PI_F; /* pdf_triangles is calculated over triangle area, but we're not sampling over its area */ if(UNLIKELY(solid_angle == 0.0f)) { return 0.0f; } else { float area = 1.0f; if(has_motion) { /* get the center frame vertices, this is what the PDF was calculated from */ triangle_world_space_vertices(kg, sd->object, sd->prim, -1.0f, V); area = triangle_area(V[0], V[1], V[2]); } else { area = 0.5f * len(N); } const float pdf = area * kernel_data.integrator.pdf_triangles; return pdf / solid_angle; } } else { float pdf = triangle_light_pdf_area(kg, sd->Ng, sd->I, t); if(has_motion) { const float area = 0.5f * len(N); if(UNLIKELY(area == 0.0f)) { return 0.0f; } /* scale the PDF. * area = the area the sample was taken from * area_pre = the are from which pdf_triangles was calculated from */ triangle_world_space_vertices(kg, sd->object, sd->prim, -1.0f, V); const float area_pre = triangle_area(V[0], V[1], V[2]); pdf = pdf * area_pre / area; } return pdf; } } ccl_device_forceinline void triangle_light_sample(KernelGlobals *kg, int prim, int object, float randu, float randv, float time, LightSample *ls, const float3 P) { /* A naive heuristic to decide between costly solid angle sampling * and simple area sampling, comparing the distance to the triangle plane * to the length of the edges of the triangle. */ float3 V[3]; bool has_motion = triangle_world_space_vertices(kg, object, prim, time, V); const float3 e0 = V[1] - V[0]; const float3 e1 = V[2] - V[0]; const float3 e2 = V[2] - V[1]; const float longest_edge_squared = max(len_squared(e0), max(len_squared(e1), len_squared(e2))); const float3 N0 = cross(e0, e1); float Nl = 0.0f; ls->Ng = safe_normalize_len(N0, &Nl); float area = 0.5f * Nl; /* flip normal if necessary */ const int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_NEGATIVE_SCALE_APPLIED) { ls->Ng = -ls->Ng; } ls->eval_fac = 1.0f; ls->shader = kernel_tex_fetch(__tri_shader, prim); ls->object = object; ls->prim = prim; ls->lamp = LAMP_NONE; ls->shader |= SHADER_USE_MIS; ls->type = LIGHT_TRIANGLE; float distance_to_plane = fabsf(dot(N0, V[0] - P)/dot(N0, N0)); if(longest_edge_squared > distance_to_plane*distance_to_plane) { /* see James Arvo, "Stratified Sampling of Spherical Triangles" * http://www.graphics.cornell.edu/pubs/1995/Arv95c.pdf */ /* project the triangle to the unit sphere * and calculate its edges and angles */ const float3 v0_p = V[0] - P; const float3 v1_p = V[1] - P; const float3 v2_p = V[2] - P; const float3 u01 = safe_normalize(cross(v0_p, v1_p)); const float3 u02 = safe_normalize(cross(v0_p, v2_p)); const float3 u12 = safe_normalize(cross(v1_p, v2_p)); const float3 A = safe_normalize(v0_p); const float3 B = safe_normalize(v1_p); const float3 C = safe_normalize(v2_p); const float cos_alpha = dot(u02, u01); const float cos_beta = -dot(u01, u12); const float cos_gamma = dot(u02, u12); /* calculate dihedral angles */ const float alpha = fast_acosf(cos_alpha); const float beta = fast_acosf(cos_beta); const float gamma = fast_acosf(cos_gamma); /* the area of the unit spherical triangle = solid angle */ const float solid_angle = alpha + beta + gamma - M_PI_F; /* precompute a few things * these could be re-used to take several samples * as they are independent of randu/randv */ const float cos_c = dot(A, B); const float sin_alpha = fast_sinf(alpha); const float product = sin_alpha * cos_c; /* Select a random sub-area of the spherical triangle * and calculate the third vertex C_ of that new triangle */ const float phi = randu * solid_angle - alpha; float s, t; fast_sincosf(phi, &s, &t); const float u = t - cos_alpha; const float v = s + product; const float3 U = safe_normalize(C - dot(C, A) * A); float q = 1.0f; const float det = ((v * s + u * t) * sin_alpha); if(det != 0.0f) { q = ((v * t - u * s) * cos_alpha - v) / det; } const float temp = max(1.0f - q*q, 0.0f); const float3 C_ = safe_normalize(q * A + sqrtf(temp) * U); /* Finally, select a random point along the edge of the new triangle * That point on the spherical triangle is the sampled ray direction */ const float z = 1.0f - randv * (1.0f - dot(C_, B)); ls->D = z * B + safe_sqrtf(1.0f - z*z) * safe_normalize(C_ - dot(C_, B) * B); /* calculate intersection with the planar triangle */ if(!ray_triangle_intersect(P, ls->D, FLT_MAX, #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) (ssef*)V, #else V[0], V[1], V[2], #endif &ls->u, &ls->v, &ls->t)) { ls->pdf = 0.0f; return; } ls->P = P + ls->D * ls->t; /* pdf_triangles is calculated over triangle area, but we're sampling over solid angle */ if(UNLIKELY(solid_angle == 0.0f)) { ls->pdf = 0.0f; return; } else { if(has_motion) { /* get the center frame vertices, this is what the PDF was calculated from */ triangle_world_space_vertices(kg, object, prim, -1.0f, V); area = triangle_area(V[0], V[1], V[2]); } const float pdf = area * kernel_data.integrator.pdf_triangles; ls->pdf = pdf / solid_angle; } } else { /* compute random point in triangle */ randu = sqrtf(randu); const float u = 1.0f - randu; const float v = randv*randu; const float t = 1.0f - u - v; ls->P = u * V[0] + v * V[1] + t * V[2]; /* compute incoming direction, distance and pdf */ ls->D = normalize_len(ls->P - P, &ls->t); ls->pdf = triangle_light_pdf_area(kg, ls->Ng, -ls->D, ls->t); if(has_motion && area != 0.0f) { /* scale the PDF. * area = the area the sample was taken from * area_pre = the are from which pdf_triangles was calculated from */ triangle_world_space_vertices(kg, object, prim, -1.0f, V); const float area_pre = triangle_area(V[0], V[1], V[2]); ls->pdf = ls->pdf * area_pre / area; } ls->u = u; ls->v = v; } } /* Light Distribution */ ccl_device int light_distribution_sample(KernelGlobals *kg, float *randu) { /* This is basically std::upper_bound as used by pbrt, to find a point light or * triangle to emit from, proportional to area. a good improvement would be to * also sample proportional to power, though it's not so well defined with * arbitrary shaders. */ int first = 0; int len = kernel_data.integrator.num_distribution + 1; float r = *randu; while(len > 0) { int half_len = len >> 1; int middle = first + half_len; if(r < kernel_tex_fetch(__light_distribution, middle).x) { len = half_len; } else { first = middle + 1; len = len - half_len - 1; } } /* Clamping should not be needed but float rounding errors seem to * make this fail on rare occasions. */ int index = clamp(first-1, 0, kernel_data.integrator.num_distribution-1); /* Rescale to reuse random number. this helps the 2D samples within * each area light be stratified as well. */ float distr_min = kernel_tex_fetch(__light_distribution, index).x; float distr_max = kernel_tex_fetch(__light_distribution, index+1).x; *randu = (r - distr_min)/(distr_max - distr_min); return index; } /* Generic Light */ ccl_device bool light_select_reached_max_bounces(KernelGlobals *kg, int index, int bounce) { float4 data4 = kernel_tex_fetch(__light_data, index*LIGHT_SIZE + 4); return (bounce > __float_as_int(data4.x)); } ccl_device_noinline bool light_sample(KernelGlobals *kg, float randu, float randv, float time, float3 P, int bounce, LightSample *ls) { /* sample index */ int index = light_distribution_sample(kg, &randu); /* fetch light data */ float4 l = kernel_tex_fetch(__light_distribution, index); int prim = __float_as_int(l.y); if(prim >= 0) { int object = __float_as_int(l.w); int shader_flag = __float_as_int(l.z); triangle_light_sample(kg, prim, object, randu, randv, time, ls, P); ls->shader |= shader_flag; return (ls->pdf > 0.0f); } else { int lamp = -prim-1; if(UNLIKELY(light_select_reached_max_bounces(kg, lamp, bounce))) { return false; } return lamp_light_sample(kg, lamp, randu, randv, P, ls); } } ccl_device int light_select_num_samples(KernelGlobals *kg, int index) { float4 data3 = kernel_tex_fetch(__light_data, index*LIGHT_SIZE + 3); return __float_as_int(data3.x); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_math.h000066400000000000000000000015611334742672700223220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_MATH_H__ #define __KERNEL_MATH_H__ #include "util/util_color.h" #include "util/util_math.h" #include "util/util_math_fast.h" #include "util/util_math_intersect.h" #include "util/util_texture.h" #include "util/util_transform.h" #endif /* __KERNEL_MATH_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_montecarlo.h000066400000000000000000000131431334742672700235330ustar00rootroot00000000000000/* * Parts adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __KERNEL_MONTECARLO_CL__ #define __KERNEL_MONTECARLO_CL__ CCL_NAMESPACE_BEGIN /* distribute uniform xy on [0,1] over unit disk [-1,1] */ ccl_device void to_unit_disk(float *x, float *y) { float phi = M_2PI_F * (*x); float r = sqrtf(*y); *x = r * cosf(phi); *y = r * sinf(phi); } /* return an orthogonal tangent and bitangent given a normal and tangent that * may not be exactly orthogonal */ ccl_device void make_orthonormals_tangent(const float3 N, const float3 T, float3 *a, float3 *b) { *b = normalize(cross(N, T)); *a = cross(*b, N); } /* sample direction with cosine weighted distributed in hemisphere */ ccl_device_inline void sample_cos_hemisphere(const float3 N, float randu, float randv, float3 *omega_in, float *pdf) { to_unit_disk(&randu, &randv); float costheta = sqrtf(max(1.0f - randu * randu - randv * randv, 0.0f)); float3 T, B; make_orthonormals(N, &T, &B); *omega_in = randu * T + randv * B + costheta * N; *pdf = costheta *M_1_PI_F; } /* sample direction uniformly distributed in hemisphere */ ccl_device_inline void sample_uniform_hemisphere(const float3 N, float randu, float randv, float3 *omega_in, float *pdf) { float z = randu; float r = sqrtf(max(0.0f, 1.0f - z*z)); float phi = M_2PI_F * randv; float x = r * cosf(phi); float y = r * sinf(phi); float3 T, B; make_orthonormals (N, &T, &B); *omega_in = x * T + y * B + z * N; *pdf = 0.5f * M_1_PI_F; } /* sample direction uniformly distributed in cone */ ccl_device_inline void sample_uniform_cone(const float3 N, float angle, float randu, float randv, float3 *omega_in, float *pdf) { float z = cosf(angle*randu); float r = sqrtf(max(0.0f, 1.0f - z*z)); float phi = M_2PI_F * randv; float x = r * cosf(phi); float y = r * sinf(phi); float3 T, B; make_orthonormals (N, &T, &B); *omega_in = x * T + y * B + z * N; *pdf = 0.5f * M_1_PI_F / (1.0f - cosf(angle)); } /* sample uniform point on the surface of a sphere */ ccl_device float3 sample_uniform_sphere(float u1, float u2) { float z = 1.0f - 2.0f*u1; float r = sqrtf(fmaxf(0.0f, 1.0f - z*z)); float phi = M_2PI_F*u2; float x = r*cosf(phi); float y = r*sinf(phi); return make_float3(x, y, z); } ccl_device float balance_heuristic(float a, float b) { return (a)/(a + b); } ccl_device float balance_heuristic_3(float a, float b, float c) { return (a)/(a + b + c); } ccl_device float power_heuristic(float a, float b) { return (a*a)/(a*a + b*b); } ccl_device float power_heuristic_3(float a, float b, float c) { return (a*a)/(a*a + b*b + c*c); } ccl_device float max_heuristic(float a, float b) { return (a > b)? 1.0f: 0.0f; } /* distribute uniform xy on [0,1] over unit disk [-1,1], with concentric mapping * to better preserve stratification for some RNG sequences */ ccl_device float2 concentric_sample_disk(float u1, float u2) { float phi, r; float a = 2.0f*u1 - 1.0f; float b = 2.0f*u2 - 1.0f; if(a == 0.0f && b == 0.0f) { return make_float2(0.0f, 0.0f); } else if(a*a > b*b) { r = a; phi = M_PI_4_F * (b/a); } else { r = b; phi = M_PI_2_F - M_PI_4_F * (a/b); } return make_float2(r*cosf(phi), r*sinf(phi)); } /* sample point in unit polygon with given number of corners and rotation */ ccl_device float2 regular_polygon_sample(float corners, float rotation, float u, float v) { /* sample corner number and reuse u */ float corner = floorf(u*corners); u = u*corners - corner; /* uniform sampled triangle weights */ u = sqrtf(u); v = v*u; u = 1.0f - u; /* point in triangle */ float angle = M_PI_F/corners; float2 p = make_float2((u + v)*cosf(angle), (u - v)*sinf(angle)); /* rotate */ rotation += corner*2.0f*angle; float cr = cosf(rotation); float sr = sinf(rotation); return make_float2(cr*p.x - sr*p.y, sr*p.x + cr*p.y); } CCL_NAMESPACE_END #endif /* __KERNEL_MONTECARLO_CL__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_passes.h000066400000000000000000000337131334742672700226730ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #if defined(__SPLIT_KERNEL__) || defined(__KERNEL_CUDA__) #define __ATOMIC_PASS_WRITE__ #endif ccl_device_inline void kernel_write_pass_float(ccl_global float *buffer, float value) { ccl_global float *buf = buffer; #ifdef __ATOMIC_PASS_WRITE__ atomic_add_and_fetch_float(buf, value); #else *buf += value; #endif } ccl_device_inline void kernel_write_pass_float3(ccl_global float *buffer, float3 value) { #ifdef __ATOMIC_PASS_WRITE__ ccl_global float *buf_x = buffer + 0; ccl_global float *buf_y = buffer + 1; ccl_global float *buf_z = buffer + 2; atomic_add_and_fetch_float(buf_x, value.x); atomic_add_and_fetch_float(buf_y, value.y); atomic_add_and_fetch_float(buf_z, value.z); #else ccl_global float3 *buf = (ccl_global float3*)buffer; *buf += value; #endif } ccl_device_inline void kernel_write_pass_float4(ccl_global float *buffer, float4 value) { #ifdef __ATOMIC_PASS_WRITE__ ccl_global float *buf_x = buffer + 0; ccl_global float *buf_y = buffer + 1; ccl_global float *buf_z = buffer + 2; ccl_global float *buf_w = buffer + 3; atomic_add_and_fetch_float(buf_x, value.x); atomic_add_and_fetch_float(buf_y, value.y); atomic_add_and_fetch_float(buf_z, value.z); atomic_add_and_fetch_float(buf_w, value.w); #else ccl_global float4 *buf = (ccl_global float4*)buffer; *buf += value; #endif } #ifdef __DENOISING_FEATURES__ ccl_device_inline void kernel_write_pass_float_variance(ccl_global float *buffer, float value) { kernel_write_pass_float(buffer, value); /* The online one-pass variance update that's used for the megakernel can't easily be implemented * with atomics, so for the split kernel the E[x^2] - 1/N * (E[x])^2 fallback is used. */ kernel_write_pass_float(buffer+1, value*value); } # ifdef __ATOMIC_PASS_WRITE__ # define kernel_write_pass_float3_unaligned kernel_write_pass_float3 # else ccl_device_inline void kernel_write_pass_float3_unaligned(ccl_global float *buffer, float3 value) { buffer[0] += value.x; buffer[1] += value.y; buffer[2] += value.z; } # endif ccl_device_inline void kernel_write_pass_float3_variance(ccl_global float *buffer, float3 value) { kernel_write_pass_float3_unaligned(buffer, value); kernel_write_pass_float3_unaligned(buffer+3, value*value); } ccl_device_inline void kernel_write_denoising_shadow(KernelGlobals *kg, ccl_global float *buffer, int sample, float path_total, float path_total_shaded) { if(kernel_data.film.pass_denoising_data == 0) return; buffer += (sample & 1)? DENOISING_PASS_SHADOW_B : DENOISING_PASS_SHADOW_A; path_total = ensure_finite(path_total); path_total_shaded = ensure_finite(path_total_shaded); kernel_write_pass_float(buffer, path_total); kernel_write_pass_float(buffer+1, path_total_shaded); float value = path_total_shaded / max(path_total, 1e-7f); kernel_write_pass_float(buffer+2, value*value); } #endif /* __DENOISING_FEATURES__ */ ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, PathRadiance *L) { #ifdef __DENOISING_FEATURES__ if(state->denoising_feature_weight == 0.0f) { return; } L->denoising_depth += ensure_finite(state->denoising_feature_weight * sd->ray_length); /* Skip implicitly transparent surfaces. */ if(sd->flag & SD_HAS_ONLY_VOLUME) { return; } float3 normal = make_float3(0.0f, 0.0f, 0.0f); float3 albedo = make_float3(0.0f, 0.0f, 0.0f); float sum_weight = 0.0f, sum_nonspecular_weight = 0.0f; for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(!CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) continue; /* All closures contribute to the normal feature, but only diffuse-like ones to the albedo. */ normal += sc->N * sc->sample_weight; sum_weight += sc->sample_weight; if(bsdf_get_roughness_squared(sc) > sqr(0.075f)) { albedo += sc->weight; sum_nonspecular_weight += sc->sample_weight; } } /* Wait for next bounce if 75% or more sample weight belongs to specular-like closures. */ if((sum_weight == 0.0f) || (sum_nonspecular_weight*4.0f > sum_weight)) { if(sum_weight != 0.0f) { normal /= sum_weight; } L->denoising_normal += ensure_finite3(state->denoising_feature_weight * normal); L->denoising_albedo += ensure_finite3(state->denoising_feature_weight * albedo); state->denoising_feature_weight = 0.0f; } #else (void) kg; (void) sd; (void) state; (void) L; #endif /* __DENOISING_FEATURES__ */ } #ifdef __KERNEL_DEBUG__ ccl_device_inline void kernel_write_debug_passes(KernelGlobals *kg, ccl_global float *buffer, PathRadiance *L) { int flag = kernel_data.film.pass_flag; if(flag & PASSMASK(BVH_TRAVERSED_NODES)) { kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversed_nodes, L->debug_data.num_bvh_traversed_nodes); } if(flag & PASSMASK(BVH_TRAVERSED_INSTANCES)) { kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversed_instances, L->debug_data.num_bvh_traversed_instances); } if(flag & PASSMASK(BVH_INTERSECTIONS)) { kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_intersections, L->debug_data.num_bvh_intersections); } if(flag & PASSMASK(RAY_BOUNCES)) { kernel_write_pass_float(buffer + kernel_data.film.pass_ray_bounces, L->debug_data.num_ray_bounces); } } #endif /* __KERNEL_DEBUG__ */ ccl_device_inline void kernel_write_data_passes(KernelGlobals *kg, ccl_global float *buffer, PathRadiance *L, ShaderData *sd, ccl_addr_space PathState *state, float3 throughput) { #ifdef __PASSES__ int path_flag = state->flag; if(!(path_flag & PATH_RAY_CAMERA)) return; int flag = kernel_data.film.pass_flag; int light_flag = kernel_data.film.light_pass_flag; if(!((flag | light_flag) & PASS_ANY)) return; if(!(path_flag & PATH_RAY_SINGLE_PASS_DONE)) { if(!(sd->flag & SD_TRANSPARENT) || kernel_data.film.pass_alpha_threshold == 0.0f || average(shader_bsdf_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold) { if(state->sample == 0) { if(flag & PASSMASK(DEPTH)) { float depth = camera_distance(kg, sd->P); kernel_write_pass_float(buffer + kernel_data.film.pass_depth, depth); } if(flag & PASSMASK(OBJECT_ID)) { float id = object_pass_id(kg, sd->object); kernel_write_pass_float(buffer + kernel_data.film.pass_object_id, id); } if(flag & PASSMASK(MATERIAL_ID)) { float id = shader_pass_id(kg, sd); kernel_write_pass_float(buffer + kernel_data.film.pass_material_id, id); } } if(flag & PASSMASK(NORMAL)) { float3 normal = shader_bsdf_average_normal(kg, sd); kernel_write_pass_float3(buffer + kernel_data.film.pass_normal, normal); } if(flag & PASSMASK(UV)) { float3 uv = primitive_uv(kg, sd); kernel_write_pass_float3(buffer + kernel_data.film.pass_uv, uv); } if(flag & PASSMASK(MOTION)) { float4 speed = primitive_motion_vector(kg, sd); kernel_write_pass_float4(buffer + kernel_data.film.pass_motion, speed); kernel_write_pass_float(buffer + kernel_data.film.pass_motion_weight, 1.0f); } state->flag |= PATH_RAY_SINGLE_PASS_DONE; } } if(light_flag & PASSMASK_COMPONENT(DIFFUSE)) L->color_diffuse += shader_bsdf_diffuse(kg, sd)*throughput; if(light_flag & PASSMASK_COMPONENT(GLOSSY)) L->color_glossy += shader_bsdf_glossy(kg, sd)*throughput; if(light_flag & PASSMASK_COMPONENT(TRANSMISSION)) L->color_transmission += shader_bsdf_transmission(kg, sd)*throughput; if(light_flag & PASSMASK_COMPONENT(SUBSURFACE)) L->color_subsurface += shader_bsdf_subsurface(kg, sd)*throughput; if(light_flag & PASSMASK(MIST)) { /* bring depth into 0..1 range */ float mist_start = kernel_data.film.mist_start; float mist_inv_depth = kernel_data.film.mist_inv_depth; float depth = camera_distance(kg, sd->P); float mist = saturate((depth - mist_start)*mist_inv_depth); /* falloff */ float mist_falloff = kernel_data.film.mist_falloff; if(mist_falloff == 1.0f) ; else if(mist_falloff == 2.0f) mist = mist*mist; else if(mist_falloff == 0.5f) mist = sqrtf(mist); else mist = powf(mist, mist_falloff); /* modulate by transparency */ float3 alpha = shader_bsdf_alpha(kg, sd); L->mist += (1.0f - mist)*average(throughput*alpha); } #endif } ccl_device_inline void kernel_write_light_passes(KernelGlobals *kg, ccl_global float *buffer, PathRadiance *L) { #ifdef __PASSES__ int light_flag = kernel_data.film.light_pass_flag; if(!kernel_data.film.use_light_pass) return; if(light_flag & PASSMASK(DIFFUSE_INDIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_diffuse_indirect, L->indirect_diffuse); if(light_flag & PASSMASK(GLOSSY_INDIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_indirect, L->indirect_glossy); if(light_flag & PASSMASK(TRANSMISSION_INDIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_indirect, L->indirect_transmission); if(light_flag & PASSMASK(SUBSURFACE_INDIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_indirect, L->indirect_subsurface); if(light_flag & PASSMASK(VOLUME_INDIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_volume_indirect, L->indirect_scatter); if(light_flag & PASSMASK(DIFFUSE_DIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_diffuse_direct, L->direct_diffuse); if(light_flag & PASSMASK(GLOSSY_DIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_direct, L->direct_glossy); if(light_flag & PASSMASK(TRANSMISSION_DIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_direct, L->direct_transmission); if(light_flag & PASSMASK(SUBSURFACE_DIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_direct, L->direct_subsurface); if(light_flag & PASSMASK(VOLUME_DIRECT)) kernel_write_pass_float3(buffer + kernel_data.film.pass_volume_direct, L->direct_scatter); if(light_flag & PASSMASK(EMISSION)) kernel_write_pass_float3(buffer + kernel_data.film.pass_emission, L->emission); if(light_flag & PASSMASK(BACKGROUND)) kernel_write_pass_float3(buffer + kernel_data.film.pass_background, L->background); if(light_flag & PASSMASK(AO)) kernel_write_pass_float3(buffer + kernel_data.film.pass_ao, L->ao); if(light_flag & PASSMASK(DIFFUSE_COLOR)) kernel_write_pass_float3(buffer + kernel_data.film.pass_diffuse_color, L->color_diffuse); if(light_flag & PASSMASK(GLOSSY_COLOR)) kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_color, L->color_glossy); if(light_flag & PASSMASK(TRANSMISSION_COLOR)) kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_color, L->color_transmission); if(light_flag & PASSMASK(SUBSURFACE_COLOR)) kernel_write_pass_float3(buffer + kernel_data.film.pass_subsurface_color, L->color_subsurface); if(light_flag & PASSMASK(SHADOW)) { float4 shadow = L->shadow; shadow.w = kernel_data.film.pass_shadow_scale; kernel_write_pass_float4(buffer + kernel_data.film.pass_shadow, shadow); } if(light_flag & PASSMASK(MIST)) kernel_write_pass_float(buffer + kernel_data.film.pass_mist, 1.0f - L->mist); #endif } ccl_device_inline void kernel_write_result(KernelGlobals *kg, ccl_global float *buffer, int sample, PathRadiance *L) { float alpha; float3 L_sum = path_radiance_clamp_and_sum(kg, L, &alpha); kernel_write_pass_float4(buffer, make_float4(L_sum.x, L_sum.y, L_sum.z, alpha)); kernel_write_light_passes(kg, buffer, L); #ifdef __DENOISING_FEATURES__ if(kernel_data.film.pass_denoising_data) { # ifdef __SHADOW_TRICKS__ kernel_write_denoising_shadow(kg, buffer + kernel_data.film.pass_denoising_data, sample, average(L->path_total), average(L->path_total_shaded)); # else kernel_write_denoising_shadow(kg, buffer + kernel_data.film.pass_denoising_data, sample, 0.0f, 0.0f); # endif if(kernel_data.film.pass_denoising_clean) { float3 noisy, clean; path_radiance_split_denoising(kg, L, &noisy, &clean); kernel_write_pass_float3_variance( buffer + kernel_data.film.pass_denoising_data + DENOISING_PASS_COLOR, noisy); kernel_write_pass_float3_unaligned( buffer + kernel_data.film.pass_denoising_clean, clean); } else { kernel_write_pass_float3_variance(buffer + kernel_data.film.pass_denoising_data + DENOISING_PASS_COLOR, ensure_finite3(L_sum)); } kernel_write_pass_float3_variance( buffer + kernel_data.film.pass_denoising_data + DENOISING_PASS_NORMAL, L->denoising_normal); kernel_write_pass_float3_variance( buffer + kernel_data.film.pass_denoising_data + DENOISING_PASS_ALBEDO, L->denoising_albedo); kernel_write_pass_float_variance( buffer + kernel_data.film.pass_denoising_data + DENOISING_PASS_DEPTH, L->denoising_depth); } #endif /* __DENOISING_FEATURES__ */ #ifdef __KERNEL_DEBUG__ kernel_write_debug_passes(kg, buffer, L); #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_path.h000066400000000000000000000537571334742672700223430ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef __OSL__ # include "kernel/osl/osl_shader.h" #endif #include "kernel/kernel_random.h" #include "kernel/kernel_projection.h" #include "kernel/kernel_montecarlo.h" #include "kernel/kernel_differential.h" #include "kernel/kernel_camera.h" #include "kernel/geom/geom.h" #include "kernel/bvh/bvh.h" #include "kernel/kernel_accumulate.h" #include "kernel/kernel_shader.h" #include "kernel/kernel_light.h" #include "kernel/kernel_passes.h" #if defined(__VOLUME__) || defined(__SUBSURFACE__) # include "kernel/kernel_volume.h" #endif #ifdef __SUBSURFACE__ # include "kernel/kernel_subsurface.h" #endif #include "kernel/kernel_path_state.h" #include "kernel/kernel_shadow.h" #include "kernel/kernel_emission.h" #include "kernel/kernel_path_common.h" #include "kernel/kernel_path_surface.h" #include "kernel/kernel_path_volume.h" #include "kernel/kernel_path_subsurface.h" CCL_NAMESPACE_BEGIN ccl_device_forceinline bool kernel_path_scene_intersect( KernelGlobals *kg, ccl_addr_space PathState *state, Ray *ray, Intersection *isect, PathRadiance *L) { uint visibility = path_state_ray_visibility(kg, state); if(path_state_ao_bounce(kg, state)) { visibility = PATH_RAY_SHADOW; ray->t = kernel_data.background.ao_distance; } #ifdef __HAIR__ float difl = 0.0f, extmax = 0.0f; uint lcg_state = 0; if(kernel_data.bvh.have_curves) { if((kernel_data.cam.resolution == 1) && (state->flag & PATH_RAY_CAMERA)) { float3 pixdiff = ray->dD.dx + ray->dD.dy; /*pixdiff = pixdiff - dot(pixdiff, ray.D)*ray.D;*/ difl = kernel_data.curve.minimum_width * len(pixdiff) * 0.5f; } extmax = kernel_data.curve.maximum_width; lcg_state = lcg_state_init_addrspace(state, 0x51633e2d); } bool hit = scene_intersect(kg, *ray, visibility, isect, &lcg_state, difl, extmax); #else bool hit = scene_intersect(kg, *ray, visibility, isect, NULL, 0.0f, 0.0f); #endif /* __HAIR__ */ #ifdef __KERNEL_DEBUG__ if(state->flag & PATH_RAY_CAMERA) { L->debug_data.num_bvh_traversed_nodes += isect->num_traversed_nodes; L->debug_data.num_bvh_traversed_instances += isect->num_traversed_instances; L->debug_data.num_bvh_intersections += isect->num_intersections; } L->debug_data.num_ray_bounces++; #endif /* __KERNEL_DEBUG__ */ return hit; } ccl_device_forceinline void kernel_path_lamp_emission( KernelGlobals *kg, ccl_addr_space PathState *state, Ray *ray, float3 throughput, ccl_addr_space Intersection *isect, ShaderData *emission_sd, PathRadiance *L) { #ifdef __LAMP_MIS__ if(kernel_data.integrator.use_lamp_mis && !(state->flag & PATH_RAY_CAMERA)) { /* ray starting from previous non-transparent bounce */ Ray light_ray; light_ray.P = ray->P - state->ray_t*ray->D; state->ray_t += isect->t; light_ray.D = ray->D; light_ray.t = state->ray_t; light_ray.time = ray->time; light_ray.dD = ray->dD; light_ray.dP = ray->dP; /* intersect with lamp */ float3 emission; if(indirect_lamp_emission(kg, emission_sd, state, &light_ray, &emission)) path_radiance_accum_emission(L, state, throughput, emission); } #endif /* __LAMP_MIS__ */ } ccl_device_forceinline void kernel_path_background( KernelGlobals *kg, ccl_addr_space PathState *state, ccl_addr_space Ray *ray, float3 throughput, ShaderData *sd, PathRadiance *L) { /* eval background shader if nothing hit */ if(kernel_data.background.transparent && (state->flag & PATH_RAY_TRANSPARENT_BACKGROUND)) { L->transparent += average(throughput); #ifdef __PASSES__ if(!(kernel_data.film.light_pass_flag & PASSMASK(BACKGROUND))) #endif /* __PASSES__ */ return; } /* When using the ao bounces approximation, adjust background * shader intensity with ao factor. */ if(path_state_ao_bounce(kg, state)) { throughput *= kernel_data.background.ao_bounces_factor; } #ifdef __BACKGROUND__ /* sample background shader */ float3 L_background = indirect_background(kg, sd, state, ray); path_radiance_accum_background(L, state, throughput, L_background); #endif /* __BACKGROUND__ */ } #ifndef __SPLIT_KERNEL__ #ifdef __VOLUME__ ccl_device_forceinline VolumeIntegrateResult kernel_path_volume( KernelGlobals *kg, ShaderData *sd, PathState *state, Ray *ray, float3 *throughput, ccl_addr_space Intersection *isect, bool hit, ShaderData *emission_sd, PathRadiance *L) { /* Sanitize volume stack. */ if(!hit) { kernel_volume_clean_stack(kg, state->volume_stack); } if(state->volume_stack[0].shader == SHADER_NONE) { return VOLUME_PATH_ATTENUATED; } /* volume attenuation, emission, scatter */ Ray volume_ray = *ray; volume_ray.t = (hit)? isect->t: FLT_MAX; bool heterogeneous = volume_stack_is_heterogeneous(kg, state->volume_stack); # ifdef __VOLUME_DECOUPLED__ int sampling_method = volume_stack_sampling_method(kg, state->volume_stack); bool direct = (state->flag & PATH_RAY_CAMERA) != 0; bool decoupled = kernel_volume_use_decoupled(kg, heterogeneous, direct, sampling_method); if(decoupled) { /* cache steps along volume for repeated sampling */ VolumeSegment volume_segment; shader_setup_from_volume(kg, sd, &volume_ray); kernel_volume_decoupled_record(kg, state, &volume_ray, sd, &volume_segment, heterogeneous); volume_segment.sampling_method = sampling_method; /* emission */ if(volume_segment.closure_flag & SD_EMISSION) path_radiance_accum_emission(L, state, *throughput, volume_segment.accum_emission); /* scattering */ VolumeIntegrateResult result = VOLUME_PATH_ATTENUATED; if(volume_segment.closure_flag & SD_SCATTER) { int all = kernel_data.integrator.sample_all_lights_indirect; /* direct light sampling */ kernel_branched_path_volume_connect_light(kg, sd, emission_sd, *throughput, state, L, all, &volume_ray, &volume_segment); /* indirect sample. if we use distance sampling and take just * one sample for direct and indirect light, we could share * this computation, but makes code a bit complex */ float rphase = path_state_rng_1D(kg, state, PRNG_PHASE_CHANNEL); float rscatter = path_state_rng_1D(kg, state, PRNG_SCATTER_DISTANCE); result = kernel_volume_decoupled_scatter(kg, state, &volume_ray, sd, throughput, rphase, rscatter, &volume_segment, NULL, true); } /* free cached steps */ kernel_volume_decoupled_free(kg, &volume_segment); if(result == VOLUME_PATH_SCATTERED) { if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray)) return VOLUME_PATH_SCATTERED; else return VOLUME_PATH_MISSED; } else { *throughput *= volume_segment.accum_transmittance; } } else # endif /* __VOLUME_DECOUPLED__ */ { /* integrate along volume segment with distance sampling */ VolumeIntegrateResult result = kernel_volume_integrate( kg, state, sd, &volume_ray, L, throughput, heterogeneous); # ifdef __VOLUME_SCATTER__ if(result == VOLUME_PATH_SCATTERED) { /* direct lighting */ kernel_path_volume_connect_light(kg, sd, emission_sd, *throughput, state, L); /* indirect light bounce */ if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray)) return VOLUME_PATH_SCATTERED; else return VOLUME_PATH_MISSED; } # endif /* __VOLUME_SCATTER__ */ } return VOLUME_PATH_ATTENUATED; } #endif /* __VOLUME__ */ #endif /* __SPLIT_KERNEL__ */ ccl_device_forceinline bool kernel_path_shader_apply( KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, ccl_addr_space Ray *ray, float3 throughput, ShaderData *emission_sd, PathRadiance *L, ccl_global float *buffer) { #ifdef __SHADOW_TRICKS__ if((sd->object_flag & SD_OBJECT_SHADOW_CATCHER)) { if(state->flag & PATH_RAY_TRANSPARENT_BACKGROUND) { state->flag |= (PATH_RAY_SHADOW_CATCHER | PATH_RAY_STORE_SHADOW_INFO); float3 bg = make_float3(0.0f, 0.0f, 0.0f); if(!kernel_data.background.transparent) { bg = indirect_background(kg, emission_sd, state, ray); } path_radiance_accum_shadowcatcher(L, throughput, bg); } } else if(state->flag & PATH_RAY_SHADOW_CATCHER) { /* Only update transparency after shadow catcher bounce. */ L->shadow_transparency *= average(shader_bsdf_transparency(kg, sd)); } #endif /* __SHADOW_TRICKS__ */ /* holdout */ #ifdef __HOLDOUT__ if(((sd->flag & SD_HOLDOUT) || (sd->object_flag & SD_OBJECT_HOLDOUT_MASK)) && (state->flag & PATH_RAY_TRANSPARENT_BACKGROUND)) { if(kernel_data.background.transparent) { float3 holdout_weight; if(sd->object_flag & SD_OBJECT_HOLDOUT_MASK) { holdout_weight = make_float3(1.0f, 1.0f, 1.0f); } else { holdout_weight = shader_holdout_eval(kg, sd); } /* any throughput is ok, should all be identical here */ L->transparent += average(holdout_weight*throughput); } if(sd->object_flag & SD_OBJECT_HOLDOUT_MASK) { return false; } } #endif /* __HOLDOUT__ */ /* holdout mask objects do not write data passes */ kernel_write_data_passes(kg, buffer, L, sd, state, throughput); /* blurring of bsdf after bounces, for rays that have a small likelihood * of following this particular path (diffuse, rough glossy) */ if(kernel_data.integrator.filter_glossy != FLT_MAX) { float blur_pdf = kernel_data.integrator.filter_glossy*state->min_ray_pdf; if(blur_pdf < 1.0f) { float blur_roughness = sqrtf(1.0f - blur_pdf)*0.5f; shader_bsdf_blur(kg, sd, blur_roughness); } } #ifdef __EMISSION__ /* emission */ if(sd->flag & SD_EMISSION) { float3 emission = indirect_primitive_emission(kg, sd, sd->ray_length, state->flag, state->ray_pdf); path_radiance_accum_emission(L, state, throughput, emission); } #endif /* __EMISSION__ */ return true; } ccl_device_noinline void kernel_path_ao(KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, PathRadiance *L, ccl_addr_space PathState *state, float3 throughput, float3 ao_alpha) { /* todo: solve correlation */ float bsdf_u, bsdf_v; path_state_rng_2D(kg, state, PRNG_BSDF_U, &bsdf_u, &bsdf_v); float ao_factor = kernel_data.background.ao_factor; float3 ao_N; float3 ao_bsdf = shader_bsdf_ao(kg, sd, ao_factor, &ao_N); float3 ao_D; float ao_pdf; sample_cos_hemisphere(ao_N, bsdf_u, bsdf_v, &ao_D, &ao_pdf); if(dot(sd->Ng, ao_D) > 0.0f && ao_pdf != 0.0f) { Ray light_ray; float3 ao_shadow; light_ray.P = ray_offset(sd->P, sd->Ng); light_ray.D = ao_D; light_ray.t = kernel_data.background.ao_distance; light_ray.time = sd->time; light_ray.dP = sd->dP; light_ray.dD = differential3_zero(); if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &ao_shadow)) { path_radiance_accum_ao(L, state, throughput, ao_alpha, ao_bsdf, ao_shadow); } else { path_radiance_accum_total_ao(L, state, throughput, ao_bsdf); } } } #ifndef __SPLIT_KERNEL__ #if defined(__BRANCHED_PATH__) || defined(__BAKING__) ccl_device void kernel_path_indirect(KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, Ray *ray, float3 throughput, PathState *state, PathRadiance *L) { #ifdef __SUBSURFACE__ SubsurfaceIndirectRays ss_indirect; kernel_path_subsurface_init_indirect(&ss_indirect); for(;;) { #endif /* __SUBSURFACE__ */ /* path iteration */ for(;;) { /* Find intersection with objects in scene. */ Intersection isect; bool hit = kernel_path_scene_intersect(kg, state, ray, &isect, L); /* Find intersection with lamps and compute emission for MIS. */ kernel_path_lamp_emission(kg, state, ray, throughput, &isect, sd, L); #ifdef __VOLUME__ /* Volume integration. */ VolumeIntegrateResult result = kernel_path_volume(kg, sd, state, ray, &throughput, &isect, hit, emission_sd, L); if(result == VOLUME_PATH_SCATTERED) { continue; } else if(result == VOLUME_PATH_MISSED) { break; } #endif /* __VOLUME__*/ /* Shade background. */ if(!hit) { kernel_path_background(kg, state, ray, throughput, sd, L); break; } else if(path_state_ao_bounce(kg, state)) { break; } /* Setup shader data. */ shader_setup_from_ray(kg, sd, &isect, ray); /* Skip most work for volume bounding surface. */ #ifdef __VOLUME__ if(!(sd->flag & SD_HAS_ONLY_VOLUME)) { #endif /* Evaluate shader. */ shader_eval_surface(kg, sd, state, state->flag); shader_prepare_closures(sd, state); /* Apply shadow catcher, holdout, emission. */ if(!kernel_path_shader_apply(kg, sd, state, ray, throughput, emission_sd, L, NULL)) { break; } /* path termination. this is a strange place to put the termination, it's * mainly due to the mixed in MIS that we use. gives too many unneeded * shader evaluations, only need emission if we are going to terminate */ float probability = path_state_continuation_probability(kg, state, throughput); if(probability == 0.0f) { break; } else if(probability != 1.0f) { float terminate = path_state_rng_1D(kg, state, PRNG_TERMINATE); if(terminate >= probability) break; throughput /= probability; } kernel_update_denoising_features(kg, sd, state, L); #ifdef __AO__ /* ambient occlusion */ if(kernel_data.integrator.use_ambient_occlusion || (sd->flag & SD_AO)) { kernel_path_ao(kg, sd, emission_sd, L, state, throughput, make_float3(0.0f, 0.0f, 0.0f)); } #endif /* __AO__ */ #ifdef __SUBSURFACE__ /* bssrdf scatter to a different location on the same object, replacing * the closures with a diffuse BSDF */ if(sd->flag & SD_BSSRDF) { if(kernel_path_subsurface_scatter(kg, sd, emission_sd, L, state, ray, &throughput, &ss_indirect)) { break; } } #endif /* __SUBSURFACE__ */ #if defined(__EMISSION__) if(kernel_data.integrator.use_direct_light) { int all = (kernel_data.integrator.sample_all_lights_indirect) || (state->flag & PATH_RAY_SHADOW_CATCHER); kernel_branched_path_surface_connect_light(kg, sd, emission_sd, state, throughput, 1.0f, L, all); } #endif /* defined(__EMISSION__) */ #ifdef __VOLUME__ } #endif if(!kernel_path_surface_bounce(kg, sd, &throughput, state, &L->state, ray)) break; } #ifdef __SUBSURFACE__ /* Trace indirect subsurface rays by restarting the loop. this uses less * stack memory than invoking kernel_path_indirect. */ if(ss_indirect.num_rays) { kernel_path_subsurface_setup_indirect(kg, &ss_indirect, state, ray, L, &throughput); } else { break; } } #endif /* __SUBSURFACE__ */ } #endif /* defined(__BRANCHED_PATH__) || defined(__BAKING__) */ ccl_device_forceinline void kernel_path_integrate( KernelGlobals *kg, PathState *state, float3 throughput, Ray *ray, PathRadiance *L, ccl_global float *buffer, ShaderData *emission_sd) { /* Shader data memory used for both volumes and surfaces, saves stack space. */ ShaderData sd; #ifdef __SUBSURFACE__ SubsurfaceIndirectRays ss_indirect; kernel_path_subsurface_init_indirect(&ss_indirect); for(;;) { #endif /* __SUBSURFACE__ */ /* path iteration */ for(;;) { /* Find intersection with objects in scene. */ Intersection isect; bool hit = kernel_path_scene_intersect(kg, state, ray, &isect, L); /* Find intersection with lamps and compute emission for MIS. */ kernel_path_lamp_emission(kg, state, ray, throughput, &isect, &sd, L); #ifdef __VOLUME__ /* Volume integration. */ VolumeIntegrateResult result = kernel_path_volume(kg, &sd, state, ray, &throughput, &isect, hit, emission_sd, L); if(result == VOLUME_PATH_SCATTERED) { continue; } else if(result == VOLUME_PATH_MISSED) { break; } #endif /* __VOLUME__*/ /* Shade background. */ if(!hit) { kernel_path_background(kg, state, ray, throughput, &sd, L); break; } else if(path_state_ao_bounce(kg, state)) { break; } /* Setup shader data. */ shader_setup_from_ray(kg, &sd, &isect, ray); /* Skip most work for volume bounding surface. */ #ifdef __VOLUME__ if(!(sd.flag & SD_HAS_ONLY_VOLUME)) { #endif /* Evaluate shader. */ shader_eval_surface(kg, &sd, state, state->flag); shader_prepare_closures(&sd, state); /* Apply shadow catcher, holdout, emission. */ if(!kernel_path_shader_apply(kg, &sd, state, ray, throughput, emission_sd, L, buffer)) { break; } /* path termination. this is a strange place to put the termination, it's * mainly due to the mixed in MIS that we use. gives too many unneeded * shader evaluations, only need emission if we are going to terminate */ float probability = path_state_continuation_probability(kg, state, throughput); if(probability == 0.0f) { break; } else if(probability != 1.0f) { float terminate = path_state_rng_1D(kg, state, PRNG_TERMINATE); if(terminate >= probability) break; throughput /= probability; } kernel_update_denoising_features(kg, &sd, state, L); #ifdef __AO__ /* ambient occlusion */ if(kernel_data.integrator.use_ambient_occlusion || (sd.flag & SD_AO)) { kernel_path_ao(kg, &sd, emission_sd, L, state, throughput, shader_bsdf_alpha(kg, &sd)); } #endif /* __AO__ */ #ifdef __SUBSURFACE__ /* bssrdf scatter to a different location on the same object, replacing * the closures with a diffuse BSDF */ if(sd.flag & SD_BSSRDF) { if(kernel_path_subsurface_scatter(kg, &sd, emission_sd, L, state, ray, &throughput, &ss_indirect)) { break; } } #endif /* __SUBSURFACE__ */ /* direct lighting */ kernel_path_surface_connect_light(kg, &sd, emission_sd, throughput, state, L); #ifdef __VOLUME__ } #endif /* compute direct lighting and next bounce */ if(!kernel_path_surface_bounce(kg, &sd, &throughput, state, &L->state, ray)) break; } #ifdef __SUBSURFACE__ /* Trace indirect subsurface rays by restarting the loop. this uses less * stack memory than invoking kernel_path_indirect. */ if(ss_indirect.num_rays) { kernel_path_subsurface_setup_indirect(kg, &ss_indirect, state, ray, L, &throughput); } else { break; } } #endif /* __SUBSURFACE__ */ } ccl_device void kernel_path_trace(KernelGlobals *kg, ccl_global float *buffer, int sample, int x, int y, int offset, int stride) { /* buffer offset */ int index = offset + x + y*stride; int pass_stride = kernel_data.film.pass_stride; buffer += index*pass_stride; /* Initialize random numbers and sample ray. */ uint rng_hash; Ray ray; kernel_path_trace_setup(kg, sample, x, y, &rng_hash, &ray); if(ray.t == 0.0f) { return; } /* Initialize state. */ float3 throughput = make_float3(1.0f, 1.0f, 1.0f); PathRadiance L; path_radiance_init(&L, kernel_data.film.use_light_pass); ShaderDataTinyStorage emission_sd_storage; ShaderData *emission_sd = AS_SHADER_DATA(&emission_sd_storage); PathState state; path_state_init(kg, emission_sd, &state, rng_hash, sample, &ray); /* Integrate. */ kernel_path_integrate(kg, &state, throughput, &ray, &L, buffer, emission_sd); kernel_write_result(kg, buffer, sample, &L); } #endif /* __SPLIT_KERNEL__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_path_branched.h000066400000000000000000000463751334742672700241670ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #ifdef __BRANCHED_PATH__ ccl_device_inline void kernel_branched_path_ao(KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, PathRadiance *L, ccl_addr_space PathState *state, float3 throughput) { int num_samples = kernel_data.integrator.ao_samples; float num_samples_inv = 1.0f/num_samples; float ao_factor = kernel_data.background.ao_factor; float3 ao_N; float3 ao_bsdf = shader_bsdf_ao(kg, sd, ao_factor, &ao_N); float3 ao_alpha = shader_bsdf_alpha(kg, sd); for(int j = 0; j < num_samples; j++) { float bsdf_u, bsdf_v; path_branched_rng_2D(kg, state->rng_hash, state, j, num_samples, PRNG_BSDF_U, &bsdf_u, &bsdf_v); float3 ao_D; float ao_pdf; sample_cos_hemisphere(ao_N, bsdf_u, bsdf_v, &ao_D, &ao_pdf); if(dot(sd->Ng, ao_D) > 0.0f && ao_pdf != 0.0f) { Ray light_ray; float3 ao_shadow; light_ray.P = ray_offset(sd->P, sd->Ng); light_ray.D = ao_D; light_ray.t = kernel_data.background.ao_distance; light_ray.time = sd->time; light_ray.dP = sd->dP; light_ray.dD = differential3_zero(); if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &ao_shadow)) { path_radiance_accum_ao(L, state, throughput*num_samples_inv, ao_alpha, ao_bsdf, ao_shadow); } else { path_radiance_accum_total_ao(L, state, throughput*num_samples_inv, ao_bsdf); } } } } #ifndef __SPLIT_KERNEL__ #ifdef __VOLUME__ ccl_device_forceinline void kernel_branched_path_volume( KernelGlobals *kg, ShaderData *sd, PathState *state, Ray *ray, float3 *throughput, ccl_addr_space Intersection *isect, bool hit, ShaderData *indirect_sd, ShaderData *emission_sd, PathRadiance *L) { /* Sanitize volume stack. */ if(!hit) { kernel_volume_clean_stack(kg, state->volume_stack); } if(state->volume_stack[0].shader == SHADER_NONE) { return; } /* volume attenuation, emission, scatter */ Ray volume_ray = *ray; volume_ray.t = (hit)? isect->t: FLT_MAX; bool heterogeneous = volume_stack_is_heterogeneous(kg, state->volume_stack); # ifdef __VOLUME_DECOUPLED__ /* decoupled ray marching only supported on CPU */ if(kernel_data.integrator.volume_decoupled) { /* cache steps along volume for repeated sampling */ VolumeSegment volume_segment; shader_setup_from_volume(kg, sd, &volume_ray); kernel_volume_decoupled_record(kg, state, &volume_ray, sd, &volume_segment, heterogeneous); /* direct light sampling */ if(volume_segment.closure_flag & SD_SCATTER) { volume_segment.sampling_method = volume_stack_sampling_method(kg, state->volume_stack); int all = kernel_data.integrator.sample_all_lights_direct; kernel_branched_path_volume_connect_light(kg, sd, emission_sd, *throughput, state, L, all, &volume_ray, &volume_segment); /* indirect light sampling */ int num_samples = kernel_data.integrator.volume_samples; float num_samples_inv = 1.0f/num_samples; for(int j = 0; j < num_samples; j++) { PathState ps = *state; Ray pray = *ray; float3 tp = *throughput; /* branch RNG state */ path_state_branch(&ps, j, num_samples); /* scatter sample. if we use distance sampling and take just one * sample for direct and indirect light, we could share this * computation, but makes code a bit complex */ float rphase = path_state_rng_1D(kg, &ps, PRNG_PHASE_CHANNEL); float rscatter = path_state_rng_1D(kg, &ps, PRNG_SCATTER_DISTANCE); VolumeIntegrateResult result = kernel_volume_decoupled_scatter(kg, &ps, &pray, sd, &tp, rphase, rscatter, &volume_segment, NULL, false); if(result == VOLUME_PATH_SCATTERED && kernel_path_volume_bounce(kg, sd, &tp, &ps, &L->state, &pray)) { kernel_path_indirect(kg, indirect_sd, emission_sd, &pray, tp*num_samples_inv, &ps, L); /* for render passes, sum and reset indirect light pass variables * for the next samples */ path_radiance_sum_indirect(L); path_radiance_reset_indirect(L); } } } /* emission and transmittance */ if(volume_segment.closure_flag & SD_EMISSION) path_radiance_accum_emission(L, state, *throughput, volume_segment.accum_emission); *throughput *= volume_segment.accum_transmittance; /* free cached steps */ kernel_volume_decoupled_free(kg, &volume_segment); } else # endif /* __VOLUME_DECOUPLED__ */ { /* GPU: no decoupled ray marching, scatter probalistically */ int num_samples = kernel_data.integrator.volume_samples; float num_samples_inv = 1.0f/num_samples; /* todo: we should cache the shader evaluations from stepping * through the volume, for now we redo them multiple times */ for(int j = 0; j < num_samples; j++) { PathState ps = *state; Ray pray = *ray; float3 tp = (*throughput) * num_samples_inv; /* branch RNG state */ path_state_branch(&ps, j, num_samples); VolumeIntegrateResult result = kernel_volume_integrate( kg, &ps, sd, &volume_ray, L, &tp, heterogeneous); # ifdef __VOLUME_SCATTER__ if(result == VOLUME_PATH_SCATTERED) { /* todo: support equiangular, MIS and all light sampling. * alternatively get decoupled ray marching working on the GPU */ kernel_path_volume_connect_light(kg, sd, emission_sd, tp, state, L); if(kernel_path_volume_bounce(kg, sd, &tp, &ps, &L->state, &pray)) { kernel_path_indirect(kg, indirect_sd, emission_sd, &pray, tp, &ps, L); /* for render passes, sum and reset indirect light pass variables * for the next samples */ path_radiance_sum_indirect(L); path_radiance_reset_indirect(L); } } # endif /* __VOLUME_SCATTER__ */ } /* todo: avoid this calculation using decoupled ray marching */ kernel_volume_shadow(kg, emission_sd, state, &volume_ray, throughput); } } #endif /* __VOLUME__ */ /* bounce off surface and integrate indirect light */ ccl_device_noinline void kernel_branched_path_surface_indirect_light(KernelGlobals *kg, ShaderData *sd, ShaderData *indirect_sd, ShaderData *emission_sd, float3 throughput, float num_samples_adjust, PathState *state, PathRadiance *L) { float sum_sample_weight = 0.0f; #ifdef __DENOISING_FEATURES__ if(state->denoising_feature_weight > 0.0f) { for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; /* transparency is not handled here, but in outer loop */ if(!CLOSURE_IS_BSDF(sc->type) || CLOSURE_IS_BSDF_TRANSPARENT(sc->type)) { continue; } sum_sample_weight += sc->sample_weight; } } else { sum_sample_weight = 1.0f; } #endif /* __DENOISING_FEATURES__ */ for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; /* transparency is not handled here, but in outer loop */ if(!CLOSURE_IS_BSDF(sc->type) || CLOSURE_IS_BSDF_TRANSPARENT(sc->type)) { continue; } int num_samples; if(CLOSURE_IS_BSDF_DIFFUSE(sc->type)) num_samples = kernel_data.integrator.diffuse_samples; else if(CLOSURE_IS_BSDF_BSSRDF(sc->type)) num_samples = 1; else if(CLOSURE_IS_BSDF_GLOSSY(sc->type)) num_samples = kernel_data.integrator.glossy_samples; else num_samples = kernel_data.integrator.transmission_samples; num_samples = ceil_to_int(num_samples_adjust*num_samples); float num_samples_inv = num_samples_adjust/num_samples; for(int j = 0; j < num_samples; j++) { PathState ps = *state; float3 tp = throughput; Ray bsdf_ray; #ifdef __SHADOW_TRICKS__ float shadow_transparency = L->shadow_transparency; #endif ps.rng_hash = cmj_hash(state->rng_hash, i); if(!kernel_branched_path_surface_bounce(kg, sd, sc, j, num_samples, &tp, &ps, &L->state, &bsdf_ray, sum_sample_weight)) { continue; } ps.rng_hash = state->rng_hash; kernel_path_indirect(kg, indirect_sd, emission_sd, &bsdf_ray, tp*num_samples_inv, &ps, L); /* for render passes, sum and reset indirect light pass variables * for the next samples */ path_radiance_sum_indirect(L); path_radiance_reset_indirect(L); #ifdef __SHADOW_TRICKS__ L->shadow_transparency = shadow_transparency; #endif } } } #ifdef __SUBSURFACE__ ccl_device void kernel_branched_path_subsurface_scatter(KernelGlobals *kg, ShaderData *sd, ShaderData *indirect_sd, ShaderData *emission_sd, PathRadiance *L, PathState *state, Ray *ray, float3 throughput) { for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(!CLOSURE_IS_BSSRDF(sc->type)) continue; /* set up random number generator */ uint lcg_state = lcg_state_init(state, 0x68bc21eb); int num_samples = kernel_data.integrator.subsurface_samples * 3; float num_samples_inv = 1.0f/num_samples; uint bssrdf_rng_hash = cmj_hash(state->rng_hash, i); /* do subsurface scatter step with copy of shader data, this will * replace the BSSRDF with a diffuse BSDF closure */ for(int j = 0; j < num_samples; j++) { PathState hit_state = *state; path_state_branch(&hit_state, j, num_samples); hit_state.rng_hash = bssrdf_rng_hash; LocalIntersection ss_isect; float bssrdf_u, bssrdf_v; path_state_rng_2D(kg, &hit_state, PRNG_BSDF_U, &bssrdf_u, &bssrdf_v); int num_hits = subsurface_scatter_multi_intersect(kg, &ss_isect, sd, &hit_state, sc, &lcg_state, bssrdf_u, bssrdf_v, true); hit_state.rng_offset += PRNG_BOUNCE_NUM; #ifdef __VOLUME__ Ray volume_ray = *ray; bool need_update_volume_stack = kernel_data.integrator.use_volumes && sd->object_flag & SD_OBJECT_INTERSECTS_VOLUME; #endif /* __VOLUME__ */ /* compute lighting with the BSDF closure */ for(int hit = 0; hit < num_hits; hit++) { ShaderData bssrdf_sd = *sd; subsurface_scatter_multi_setup(kg, &ss_isect, hit, &bssrdf_sd, &hit_state, sc); #ifdef __VOLUME__ if(need_update_volume_stack) { /* Setup ray from previous surface point to the new one. */ float3 P = ray_offset(bssrdf_sd.P, -bssrdf_sd.Ng); volume_ray.D = normalize_len(P - volume_ray.P, &volume_ray.t); for(int k = 0; k < VOLUME_STACK_SIZE; k++) { hit_state.volume_stack[k] = state->volume_stack[k]; } kernel_volume_stack_update_for_subsurface( kg, emission_sd, &volume_ray, hit_state.volume_stack); } #endif /* __VOLUME__ */ #ifdef __EMISSION__ /* direct light */ if(kernel_data.integrator.use_direct_light) { int all = (kernel_data.integrator.sample_all_lights_direct) || (hit_state.flag & PATH_RAY_SHADOW_CATCHER); kernel_branched_path_surface_connect_light( kg, &bssrdf_sd, emission_sd, &hit_state, throughput, num_samples_inv, L, all); } #endif /* __EMISSION__ */ /* indirect light */ kernel_branched_path_surface_indirect_light( kg, &bssrdf_sd, indirect_sd, emission_sd, throughput, num_samples_inv, &hit_state, L); } } } } #endif /* __SUBSURFACE__ */ ccl_device void kernel_branched_path_integrate(KernelGlobals *kg, uint rng_hash, int sample, Ray ray, ccl_global float *buffer, PathRadiance *L) { /* initialize */ float3 throughput = make_float3(1.0f, 1.0f, 1.0f); path_radiance_init(L, kernel_data.film.use_light_pass); /* shader data memory used for both volumes and surfaces, saves stack space */ ShaderData sd; /* shader data used by emission, shadows, volume stacks, indirect path */ ShaderDataTinyStorage emission_sd_storage; ShaderData *emission_sd = AS_SHADER_DATA(&emission_sd_storage); ShaderData indirect_sd; PathState state; path_state_init(kg, emission_sd, &state, rng_hash, sample, &ray); /* Main Loop * Here we only handle transparency intersections from the camera ray. * Indirect bounces are handled in kernel_branched_path_surface_indirect_light(). */ for(;;) { /* Find intersection with objects in scene. */ Intersection isect; bool hit = kernel_path_scene_intersect(kg, &state, &ray, &isect, L); #ifdef __VOLUME__ /* Volume integration. */ kernel_branched_path_volume(kg, &sd, &state, &ray, &throughput, &isect, hit, &indirect_sd, emission_sd, L); #endif /* __VOLUME__ */ /* Shade background. */ if(!hit) { kernel_path_background(kg, &state, &ray, throughput, &sd, L); break; } /* Setup and evaluate shader. */ shader_setup_from_ray(kg, &sd, &isect, &ray); /* Skip most work for volume bounding surface. */ #ifdef __VOLUME__ if(!(sd.flag & SD_HAS_ONLY_VOLUME)) { #endif shader_eval_surface(kg, &sd, &state, state.flag); shader_merge_closures(&sd); /* Apply shadow catcher, holdout, emission. */ if(!kernel_path_shader_apply(kg, &sd, &state, &ray, throughput, emission_sd, L, buffer)) { break; } /* transparency termination */ if(state.flag & PATH_RAY_TRANSPARENT) { /* path termination. this is a strange place to put the termination, it's * mainly due to the mixed in MIS that we use. gives too many unneeded * shader evaluations, only need emission if we are going to terminate */ float probability = path_state_continuation_probability(kg, &state, throughput); if(probability == 0.0f) { break; } else if(probability != 1.0f) { float terminate = path_state_rng_1D(kg, &state, PRNG_TERMINATE); if(terminate >= probability) break; throughput /= probability; } } kernel_update_denoising_features(kg, &sd, &state, L); #ifdef __AO__ /* ambient occlusion */ if(kernel_data.integrator.use_ambient_occlusion || (sd.flag & SD_AO)) { kernel_branched_path_ao(kg, &sd, emission_sd, L, &state, throughput); } #endif /* __AO__ */ #ifdef __SUBSURFACE__ /* bssrdf scatter to a different location on the same object */ if(sd.flag & SD_BSSRDF) { kernel_branched_path_subsurface_scatter(kg, &sd, &indirect_sd, emission_sd, L, &state, &ray, throughput); } #endif /* __SUBSURFACE__ */ PathState hit_state = state; #ifdef __EMISSION__ /* direct light */ if(kernel_data.integrator.use_direct_light) { int all = (kernel_data.integrator.sample_all_lights_direct) || (state.flag & PATH_RAY_SHADOW_CATCHER); kernel_branched_path_surface_connect_light(kg, &sd, emission_sd, &hit_state, throughput, 1.0f, L, all); } #endif /* __EMISSION__ */ /* indirect light */ kernel_branched_path_surface_indirect_light(kg, &sd, &indirect_sd, emission_sd, throughput, 1.0f, &hit_state, L); /* continue in case of transparency */ throughput *= shader_bsdf_transparency(kg, &sd); if(is_zero(throughput)) break; /* Update Path State */ path_state_next(kg, &state, LABEL_TRANSPARENT); #ifdef __VOLUME__ } else { /* For volume bounding meshes we pass through without counting transparent * bounces, only sanity check in case self intersection gets us stuck. */ state.volume_bounds_bounce++; if (state.volume_bounds_bounce > VOLUME_BOUNDS_MAX) { break; } } #endif ray.P = ray_offset(sd.P, -sd.Ng); ray.t -= sd.ray_length; /* clipping works through transparent */ #ifdef __RAY_DIFFERENTIALS__ ray.dP = sd.dP; ray.dD.dx = -sd.dI.dx; ray.dD.dy = -sd.dI.dy; #endif /* __RAY_DIFFERENTIALS__ */ #ifdef __VOLUME__ /* enter/exit volume */ kernel_volume_stack_enter_exit(kg, &sd, state.volume_stack); #endif /* __VOLUME__ */ } } ccl_device void kernel_branched_path_trace(KernelGlobals *kg, ccl_global float *buffer, int sample, int x, int y, int offset, int stride) { /* buffer offset */ int index = offset + x + y*stride; int pass_stride = kernel_data.film.pass_stride; buffer += index*pass_stride; /* initialize random numbers and ray */ uint rng_hash; Ray ray; kernel_path_trace_setup(kg, sample, x, y, &rng_hash, &ray); /* integrate */ PathRadiance L; if(ray.t != 0.0f) { kernel_branched_path_integrate(kg, rng_hash, sample, ray, buffer, &L); kernel_write_result(kg, buffer, sample, &L); } } #endif /* __SPLIT_KERNEL__ */ #endif /* __BRANCHED_PATH__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_path_common.h000066400000000000000000000030721334742672700236740ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_hash.h" CCL_NAMESPACE_BEGIN ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg, int sample, int x, int y, uint *rng_hash, ccl_addr_space Ray *ray) { float filter_u; float filter_v; int num_samples = kernel_data.integrator.aa_samples; path_rng_init(kg, sample, num_samples, rng_hash, x, y, &filter_u, &filter_v); /* sample camera ray */ float lens_u = 0.0f, lens_v = 0.0f; if(kernel_data.cam.aperturesize > 0.0f) path_rng_2D(kg, *rng_hash, sample, num_samples, PRNG_LENS_U, &lens_u, &lens_v); float time = 0.0f; #ifdef __CAMERA_MOTION__ if(kernel_data.cam.shuttertime != -1.0f) time = path_rng_1D(kg, *rng_hash, sample, num_samples, PRNG_TIME); #endif camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, time, ray); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_path_state.h000066400000000000000000000171331334742672700235270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device_inline void path_state_init(KernelGlobals *kg, ShaderData *stack_sd, ccl_addr_space PathState *state, uint rng_hash, int sample, ccl_addr_space Ray *ray) { state->flag = PATH_RAY_CAMERA|PATH_RAY_MIS_SKIP|PATH_RAY_TRANSPARENT_BACKGROUND; state->rng_hash = rng_hash; state->rng_offset = PRNG_BASE_NUM; state->sample = sample; state->num_samples = kernel_data.integrator.aa_samples; state->branch_factor = 1.0f; state->bounce = 0; state->diffuse_bounce = 0; state->glossy_bounce = 0; state->transmission_bounce = 0; state->transparent_bounce = 0; #ifdef __DENOISING_FEATURES__ if(kernel_data.film.pass_denoising_data) { state->flag |= PATH_RAY_STORE_SHADOW_INFO; state->denoising_feature_weight = 1.0f; } else { state->denoising_feature_weight = 0.0f; } #endif /* __DENOISING_FEATURES__ */ state->min_ray_pdf = FLT_MAX; state->ray_pdf = 0.0f; #ifdef __LAMP_MIS__ state->ray_t = 0.0f; #endif #ifdef __VOLUME__ state->volume_bounce = 0; state->volume_bounds_bounce = 0; if(kernel_data.integrator.use_volumes) { /* Initialize volume stack with volume we are inside of. */ kernel_volume_stack_init(kg, stack_sd, state, ray, state->volume_stack); /* Seed RNG for cases where we can't use stratified samples .*/ state->rng_congruential = lcg_init(rng_hash + sample*0x51633e2d); } else { state->volume_stack[0].shader = SHADER_NONE; } #endif } ccl_device_inline void path_state_next(KernelGlobals *kg, ccl_addr_space PathState *state, int label) { /* ray through transparent keeps same flags from previous ray and is * not counted as a regular bounce, transparent has separate max */ if(label & LABEL_TRANSPARENT) { state->flag |= PATH_RAY_TRANSPARENT; state->transparent_bounce++; if(state->transparent_bounce >= kernel_data.integrator.transparent_max_bounce) { state->flag |= PATH_RAY_TERMINATE_IMMEDIATE; } if(!kernel_data.integrator.transparent_shadows) state->flag |= PATH_RAY_MIS_SKIP; /* random number generator next bounce */ state->rng_offset += PRNG_BOUNCE_NUM; return; } state->bounce++; if(state->bounce >= kernel_data.integrator.max_bounce) { state->flag |= PATH_RAY_TERMINATE_AFTER_TRANSPARENT; } state->flag &= ~(PATH_RAY_ALL_VISIBILITY|PATH_RAY_MIS_SKIP); #ifdef __VOLUME__ if(label & LABEL_VOLUME_SCATTER) { /* volume scatter */ state->flag |= PATH_RAY_VOLUME_SCATTER; state->flag &= ~PATH_RAY_TRANSPARENT_BACKGROUND; state->volume_bounce++; if(state->volume_bounce >= kernel_data.integrator.max_volume_bounce) { state->flag |= PATH_RAY_TERMINATE_AFTER_TRANSPARENT; } } else #endif { /* surface reflection/transmission */ if(label & LABEL_REFLECT) { state->flag |= PATH_RAY_REFLECT; state->flag &= ~PATH_RAY_TRANSPARENT_BACKGROUND; if(label & LABEL_DIFFUSE) { state->diffuse_bounce++; if(state->diffuse_bounce >= kernel_data.integrator.max_diffuse_bounce) { state->flag |= PATH_RAY_TERMINATE_AFTER_TRANSPARENT; } } else { state->glossy_bounce++; if(state->glossy_bounce >= kernel_data.integrator.max_glossy_bounce) { state->flag |= PATH_RAY_TERMINATE_AFTER_TRANSPARENT; } } } else { kernel_assert(label & LABEL_TRANSMIT); state->flag |= PATH_RAY_TRANSMIT; if(!(label & LABEL_TRANSMIT_TRANSPARENT)) { state->flag &= ~PATH_RAY_TRANSPARENT_BACKGROUND; } state->transmission_bounce++; if(state->transmission_bounce >= kernel_data.integrator.max_transmission_bounce) { state->flag |= PATH_RAY_TERMINATE_AFTER_TRANSPARENT; } } /* diffuse/glossy/singular */ if(label & LABEL_DIFFUSE) { state->flag |= PATH_RAY_DIFFUSE|PATH_RAY_DIFFUSE_ANCESTOR; } else if(label & LABEL_GLOSSY) { state->flag |= PATH_RAY_GLOSSY; } else { kernel_assert(label & LABEL_SINGULAR); state->flag |= PATH_RAY_GLOSSY|PATH_RAY_SINGULAR|PATH_RAY_MIS_SKIP; } } /* random number generator next bounce */ state->rng_offset += PRNG_BOUNCE_NUM; #ifdef __DENOISING_FEATURES__ if((state->denoising_feature_weight == 0.0f) && !(state->flag & PATH_RAY_SHADOW_CATCHER)) { state->flag &= ~PATH_RAY_STORE_SHADOW_INFO; } #endif } ccl_device_inline uint path_state_ray_visibility(KernelGlobals *kg, ccl_addr_space PathState *state) { uint flag = state->flag & PATH_RAY_ALL_VISIBILITY; /* for visibility, diffuse/glossy are for reflection only */ if(flag & PATH_RAY_TRANSMIT) flag &= ~(PATH_RAY_DIFFUSE|PATH_RAY_GLOSSY); /* todo: this is not supported as its own ray visibility yet */ if(state->flag & PATH_RAY_VOLUME_SCATTER) flag |= PATH_RAY_DIFFUSE; return flag; } ccl_device_inline float path_state_continuation_probability(KernelGlobals *kg, ccl_addr_space PathState *state, const float3 throughput) { if(state->flag & PATH_RAY_TERMINATE_IMMEDIATE) { /* Ray is to be terminated immediately. */ return 0.0f; } else if(state->flag & PATH_RAY_TRANSPARENT) { /* Do at least one bounce without RR. */ if(state->transparent_bounce <= 1) { return 1.0f; } #ifdef __SHADOW_TRICKS__ /* Exception for shadow catcher not working correctly with RR. */ else if((state->flag & PATH_RAY_SHADOW_CATCHER) && (state->transparent_bounce <= 8)) { return 1.0f; } #endif } else { /* Do at least one bounce without RR. */ if(state->bounce <= 1) { return 1.0f; } #ifdef __SHADOW_TRICKS__ /* Exception for shadow catcher not working correctly with RR. */ else if((state->flag & PATH_RAY_SHADOW_CATCHER) && (state->bounce <= 3)) { return 1.0f; } #endif } /* Probabilistic termination: use sqrt() to roughly match typical view * transform and do path termination a bit later on average. */ return min(sqrtf(max3(fabs(throughput)) * state->branch_factor), 1.0f); } /* TODO(DingTo): Find more meaningful name for this */ ccl_device_inline void path_state_modify_bounce(ccl_addr_space PathState *state, bool increase) { /* Modify bounce temporarily for shader eval */ if(increase) state->bounce += 1; else state->bounce -= 1; } ccl_device_inline bool path_state_ao_bounce(KernelGlobals *kg, ccl_addr_space PathState *state) { if(state->bounce <= kernel_data.integrator.ao_bounces) { return false; } int bounce = state->bounce - state->transmission_bounce - (state->glossy_bounce > 0); return (bounce > kernel_data.integrator.ao_bounces); } ccl_device_inline void path_state_branch(ccl_addr_space PathState *state, int branch, int num_branches) { if(num_branches > 1) { /* Path is splitting into a branch, adjust so that each branch * still gets a unique sample from the same sequence. */ state->sample = state->sample*num_branches + branch; state->num_samples = state->num_samples*num_branches; state->branch_factor *= num_branches; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_path_subsurface.h000066400000000000000000000116721334742672700245530ustar00rootroot00000000000000/* * Copyright 2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #ifdef __SUBSURFACE__ # ifndef __KERNEL_CUDA__ ccl_device # else ccl_device_inline # endif bool kernel_path_subsurface_scatter( KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, PathRadiance *L, ccl_addr_space PathState *state, ccl_addr_space Ray *ray, ccl_addr_space float3 *throughput, ccl_addr_space SubsurfaceIndirectRays *ss_indirect) { float bssrdf_u, bssrdf_v; path_state_rng_2D(kg, state, PRNG_BSDF_U, &bssrdf_u, &bssrdf_v); const ShaderClosure *sc = shader_bssrdf_pick(sd, throughput, &bssrdf_u); /* do bssrdf scatter step if we picked a bssrdf closure */ if(sc) { /* We should never have two consecutive BSSRDF bounces, * the second one should be converted to a diffuse BSDF to * avoid this. */ kernel_assert(!(state->flag & PATH_RAY_DIFFUSE_ANCESTOR)); uint lcg_state = lcg_state_init_addrspace(state, 0x68bc21eb); LocalIntersection ss_isect; int num_hits = subsurface_scatter_multi_intersect(kg, &ss_isect, sd, state, sc, &lcg_state, bssrdf_u, bssrdf_v, false); # ifdef __VOLUME__ bool need_update_volume_stack = kernel_data.integrator.use_volumes && sd->object_flag & SD_OBJECT_INTERSECTS_VOLUME; # endif /* __VOLUME__ */ /* compute lighting with the BSDF closure */ for(int hit = 0; hit < num_hits; hit++) { /* NOTE: We reuse the existing ShaderData, we assume the path * integration loop stops when this function returns true. */ subsurface_scatter_multi_setup(kg, &ss_isect, hit, sd, state, sc); kernel_path_surface_connect_light(kg, sd, emission_sd, *throughput, state, L); ccl_addr_space PathState *hit_state = &ss_indirect->state[ss_indirect->num_rays]; ccl_addr_space Ray *hit_ray = &ss_indirect->rays[ss_indirect->num_rays]; ccl_addr_space float3 *hit_tp = &ss_indirect->throughputs[ss_indirect->num_rays]; PathRadianceState *hit_L_state = &ss_indirect->L_state[ss_indirect->num_rays]; *hit_state = *state; *hit_ray = *ray; *hit_tp = *throughput; *hit_L_state = L->state; hit_state->rng_offset += PRNG_BOUNCE_NUM; if(kernel_path_surface_bounce(kg, sd, hit_tp, hit_state, hit_L_state, hit_ray)) { # ifdef __LAMP_MIS__ hit_state->ray_t = 0.0f; # endif /* __LAMP_MIS__ */ # ifdef __VOLUME__ if(need_update_volume_stack) { Ray volume_ray = *ray; /* Setup ray from previous surface point to the new one. */ volume_ray.D = normalize_len(hit_ray->P - volume_ray.P, &volume_ray.t); kernel_volume_stack_update_for_subsurface( kg, emission_sd, &volume_ray, hit_state->volume_stack); } # endif /* __VOLUME__ */ ss_indirect->num_rays++; } } return true; } return false; } ccl_device_inline void kernel_path_subsurface_init_indirect( ccl_addr_space SubsurfaceIndirectRays *ss_indirect) { ss_indirect->num_rays = 0; } ccl_device void kernel_path_subsurface_setup_indirect( KernelGlobals *kg, ccl_addr_space SubsurfaceIndirectRays *ss_indirect, ccl_addr_space PathState *state, ccl_addr_space Ray *ray, PathRadiance *L, ccl_addr_space float3 *throughput) { /* Setup state, ray and throughput for indirect SSS rays. */ ss_indirect->num_rays--; path_radiance_sum_indirect(L); path_radiance_reset_indirect(L); *state = ss_indirect->state[ss_indirect->num_rays]; *ray = ss_indirect->rays[ss_indirect->num_rays]; L->state = ss_indirect->L_state[ss_indirect->num_rays]; *throughput = ss_indirect->throughputs[ss_indirect->num_rays]; state->rng_offset += ss_indirect->num_rays * PRNG_BOUNCE_NUM; } #endif /* __SUBSURFACE__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_path_surface.h000066400000000000000000000264461334742672700240460ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #if defined(__BRANCHED_PATH__) || defined(__SUBSURFACE__) || defined(__SHADOW_TRICKS__) || defined(__BAKING__) /* branched path tracing: connect path directly to position on one or more lights and add it to L */ ccl_device_noinline void kernel_branched_path_surface_connect_light( KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, ccl_addr_space PathState *state, float3 throughput, float num_samples_adjust, PathRadiance *L, int sample_all_lights) { #ifdef __EMISSION__ /* sample illumination from lights to find path contribution */ if(!(sd->flag & SD_BSDF_HAS_EVAL)) return; Ray light_ray; BsdfEval L_light; bool is_lamp; # ifdef __OBJECT_MOTION__ light_ray.time = sd->time; # endif if(sample_all_lights) { /* lamp sampling */ for(int i = 0; i < kernel_data.integrator.num_all_lights; i++) { if(UNLIKELY(light_select_reached_max_bounces(kg, i, state->bounce))) continue; int num_samples = ceil_to_int(num_samples_adjust*light_select_num_samples(kg, i)); float num_samples_inv = num_samples_adjust/(num_samples*kernel_data.integrator.num_all_lights); uint lamp_rng_hash = cmj_hash(state->rng_hash, i); for(int j = 0; j < num_samples; j++) { float light_u, light_v; path_branched_rng_2D(kg, lamp_rng_hash, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v); float terminate = path_branched_rng_light_termination(kg, lamp_rng_hash, state, j, num_samples); LightSample ls; if(lamp_light_sample(kg, i, light_u, light_v, sd->P, &ls)) { /* The sampling probability returned by lamp_light_sample assumes that all lights were sampled. * However, this code only samples lamps, so if the scene also had mesh lights, the real probability is twice as high. */ if(kernel_data.integrator.pdf_triangles != 0.0f) ls.pdf *= 2.0f; if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, throughput*num_samples_inv, &L_light, shadow, num_samples_inv, is_lamp); } else { path_radiance_accum_total_light(L, state, throughput*num_samples_inv, &L_light); } } } } } /* mesh light sampling */ if(kernel_data.integrator.pdf_triangles != 0.0f) { int num_samples = ceil_to_int(num_samples_adjust*kernel_data.integrator.mesh_light_samples); float num_samples_inv = num_samples_adjust/num_samples; for(int j = 0; j < num_samples; j++) { float light_u, light_v; path_branched_rng_2D(kg, state->rng_hash, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v); float terminate = path_branched_rng_light_termination(kg, state->rng_hash, state, j, num_samples); /* only sample triangle lights */ if(kernel_data.integrator.num_all_lights) light_u = 0.5f*light_u; LightSample ls; if(light_sample(kg, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { /* Same as above, probability needs to be corrected since the sampling was forced to select a mesh light. */ if(kernel_data.integrator.num_all_lights) ls.pdf *= 2.0f; if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, throughput*num_samples_inv, &L_light, shadow, num_samples_inv, is_lamp); } else { path_radiance_accum_total_light(L, state, throughput*num_samples_inv, &L_light); } } } } } } else { /* sample one light at random */ float light_u, light_v; path_state_rng_2D(kg, state, PRNG_LIGHT_U, &light_u, &light_v); float terminate = path_state_rng_light_termination(kg, state); LightSample ls; if(light_sample(kg, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { /* sample random light */ if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, throughput*num_samples_adjust, &L_light, shadow, num_samples_adjust, is_lamp); } else { path_radiance_accum_total_light(L, state, throughput*num_samples_adjust, &L_light); } } } } #endif } /* branched path tracing: bounce off or through surface to with new direction stored in ray */ ccl_device bool kernel_branched_path_surface_bounce( KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, int sample, int num_samples, ccl_addr_space float3 *throughput, ccl_addr_space PathState *state, PathRadianceState *L_state, ccl_addr_space Ray *ray, float sum_sample_weight) { /* sample BSDF */ float bsdf_pdf; BsdfEval bsdf_eval; float3 bsdf_omega_in; differential3 bsdf_domega_in; float bsdf_u, bsdf_v; path_branched_rng_2D(kg, state->rng_hash, state, sample, num_samples, PRNG_BSDF_U, &bsdf_u, &bsdf_v); int label; label = shader_bsdf_sample_closure(kg, sd, sc, bsdf_u, bsdf_v, &bsdf_eval, &bsdf_omega_in, &bsdf_domega_in, &bsdf_pdf); if(bsdf_pdf == 0.0f || bsdf_eval_is_zero(&bsdf_eval)) return false; /* modify throughput */ path_radiance_bsdf_bounce(kg, L_state, throughput, &bsdf_eval, bsdf_pdf, state->bounce, label); #ifdef __DENOISING_FEATURES__ state->denoising_feature_weight *= sc->sample_weight / (sum_sample_weight * num_samples); #endif /* modify path state */ path_state_next(kg, state, label); /* setup ray */ ray->P = ray_offset(sd->P, (label & LABEL_TRANSMIT)? -sd->Ng: sd->Ng); ray->D = normalize(bsdf_omega_in); ray->t = FLT_MAX; #ifdef __RAY_DIFFERENTIALS__ ray->dP = sd->dP; ray->dD = bsdf_domega_in; #endif #ifdef __OBJECT_MOTION__ ray->time = sd->time; #endif #ifdef __VOLUME__ /* enter/exit volume */ if(label & LABEL_TRANSMIT) kernel_volume_stack_enter_exit(kg, sd, state->volume_stack); #endif /* branch RNG state */ path_state_branch(state, sample, num_samples); /* set MIS state */ state->min_ray_pdf = fminf(bsdf_pdf, FLT_MAX); state->ray_pdf = bsdf_pdf; #ifdef __LAMP_MIS__ state->ray_t = 0.0f; #endif return true; } #endif /* path tracing: connect path directly to position on a light and add it to L */ ccl_device_inline void kernel_path_surface_connect_light(KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, float3 throughput, ccl_addr_space PathState *state, PathRadiance *L) { #ifdef __EMISSION__ if(!(kernel_data.integrator.use_direct_light && (sd->flag & SD_BSDF_HAS_EVAL))) return; #ifdef __SHADOW_TRICKS__ if(state->flag & PATH_RAY_SHADOW_CATCHER) { kernel_branched_path_surface_connect_light(kg, sd, emission_sd, state, throughput, 1.0f, L, 1); return; } #endif /* sample illumination from lights to find path contribution */ float light_u, light_v; path_state_rng_2D(kg, state, PRNG_LIGHT_U, &light_u, &light_v); Ray light_ray; BsdfEval L_light; bool is_lamp; #ifdef __OBJECT_MOTION__ light_ray.time = sd->time; #endif LightSample ls; if(light_sample(kg, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { float terminate = path_state_rng_light_termination(kg, state); if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, throughput, &L_light, shadow, 1.0f, is_lamp); } else { path_radiance_accum_total_light(L, state, throughput, &L_light); } } } #endif } /* path tracing: bounce off or through surface to with new direction stored in ray */ ccl_device bool kernel_path_surface_bounce(KernelGlobals *kg, ShaderData *sd, ccl_addr_space float3 *throughput, ccl_addr_space PathState *state, PathRadianceState *L_state, ccl_addr_space Ray *ray) { /* no BSDF? we can stop here */ if(sd->flag & SD_BSDF) { /* sample BSDF */ float bsdf_pdf; BsdfEval bsdf_eval; float3 bsdf_omega_in; differential3 bsdf_domega_in; float bsdf_u, bsdf_v; path_state_rng_2D(kg, state, PRNG_BSDF_U, &bsdf_u, &bsdf_v); int label; label = shader_bsdf_sample(kg, sd, bsdf_u, bsdf_v, &bsdf_eval, &bsdf_omega_in, &bsdf_domega_in, &bsdf_pdf); if(bsdf_pdf == 0.0f || bsdf_eval_is_zero(&bsdf_eval)) return false; /* modify throughput */ path_radiance_bsdf_bounce(kg, L_state, throughput, &bsdf_eval, bsdf_pdf, state->bounce, label); /* set labels */ if(!(label & LABEL_TRANSPARENT)) { state->ray_pdf = bsdf_pdf; #ifdef __LAMP_MIS__ state->ray_t = 0.0f; #endif state->min_ray_pdf = fminf(bsdf_pdf, state->min_ray_pdf); } /* update path state */ path_state_next(kg, state, label); /* setup ray */ ray->P = ray_offset(sd->P, (label & LABEL_TRANSMIT)? -sd->Ng: sd->Ng); ray->D = normalize(bsdf_omega_in); if(state->bounce == 0) ray->t -= sd->ray_length; /* clipping works through transparent */ else ray->t = FLT_MAX; #ifdef __RAY_DIFFERENTIALS__ ray->dP = sd->dP; ray->dD = bsdf_domega_in; #endif #ifdef __VOLUME__ /* enter/exit volume */ if(label & LABEL_TRANSMIT) kernel_volume_stack_enter_exit(kg, sd, state->volume_stack); #endif return true; } #ifdef __VOLUME__ else if(sd->flag & SD_HAS_ONLY_VOLUME) { /* For volume bounding meshes we pass through without counting transparent * bounces, only sanity check in case self intersection gets us stuck. */ state->volume_bounds_bounce++; if (state->volume_bounds_bounce > VOLUME_BOUNDS_MAX) { return false; } if(state->bounce == 0) ray->t -= sd->ray_length; /* clipping works through transparent */ else ray->t = FLT_MAX; /* setup ray position, direction stays unchanged */ ray->P = ray_offset(sd->P, -sd->Ng); #ifdef __RAY_DIFFERENTIALS__ ray->dP = sd->dP; #endif /* enter/exit volume */ kernel_volume_stack_enter_exit(kg, sd, state->volume_stack); return true; } #endif else { /* no bsdf or volume? */ return false; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_path_volume.h000066400000000000000000000217361334742672700237220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #ifdef __VOLUME_SCATTER__ ccl_device_inline void kernel_path_volume_connect_light( KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, float3 throughput, ccl_addr_space PathState *state, PathRadiance *L) { #ifdef __EMISSION__ if(!kernel_data.integrator.use_direct_light) return; /* sample illumination from lights to find path contribution */ float light_u, light_v; path_state_rng_2D(kg, state, PRNG_LIGHT_U, &light_u, &light_v); Ray light_ray; BsdfEval L_light; LightSample ls; bool is_lamp; /* connect to light from given point where shader has been evaluated */ light_ray.time = sd->time; if(light_sample(kg, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { float terminate = path_state_rng_light_termination(kg, state); if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, throughput, &L_light, shadow, 1.0f, is_lamp); } } } #endif /* __EMISSION__ */ } #ifdef __KERNEL_GPU__ ccl_device_noinline #else ccl_device #endif bool kernel_path_volume_bounce( KernelGlobals *kg, ShaderData *sd, ccl_addr_space float3 *throughput, ccl_addr_space PathState *state, PathRadianceState *L_state, ccl_addr_space Ray *ray) { /* sample phase function */ float phase_pdf; BsdfEval phase_eval; float3 phase_omega_in; differential3 phase_domega_in; float phase_u, phase_v; path_state_rng_2D(kg, state, PRNG_BSDF_U, &phase_u, &phase_v); int label; label = shader_volume_phase_sample(kg, sd, phase_u, phase_v, &phase_eval, &phase_omega_in, &phase_domega_in, &phase_pdf); if(phase_pdf == 0.0f || bsdf_eval_is_zero(&phase_eval)) return false; /* modify throughput */ path_radiance_bsdf_bounce(kg, L_state, throughput, &phase_eval, phase_pdf, state->bounce, label); /* set labels */ state->ray_pdf = phase_pdf; #ifdef __LAMP_MIS__ state->ray_t = 0.0f; #endif state->min_ray_pdf = fminf(phase_pdf, state->min_ray_pdf); /* update path state */ path_state_next(kg, state, label); /* Russian roulette termination of volume ray scattering. */ float probability = path_state_continuation_probability(kg, state, *throughput); if(probability == 0.0f) { return false; } else if(probability != 1.0f) { /* Use dimension from the previous bounce, has not been used yet. */ float terminate = path_state_rng_1D(kg, state, PRNG_TERMINATE - PRNG_BOUNCE_NUM); if(terminate >= probability) { return false; } *throughput /= probability; } /* setup ray */ ray->P = sd->P; ray->D = phase_omega_in; ray->t = FLT_MAX; #ifdef __RAY_DIFFERENTIALS__ ray->dP = sd->dP; ray->dD = phase_domega_in; #endif return true; } #ifndef __SPLIT_KERNEL__ ccl_device void kernel_branched_path_volume_connect_light( KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, float3 throughput, ccl_addr_space PathState *state, PathRadiance *L, bool sample_all_lights, Ray *ray, const VolumeSegment *segment) { #ifdef __EMISSION__ if(!kernel_data.integrator.use_direct_light) return; Ray light_ray; BsdfEval L_light; bool is_lamp; light_ray.time = sd->time; if(sample_all_lights) { /* lamp sampling */ for(int i = 0; i < kernel_data.integrator.num_all_lights; i++) { if(UNLIKELY(light_select_reached_max_bounces(kg, i, state->bounce))) continue; int num_samples = light_select_num_samples(kg, i); float num_samples_inv = 1.0f/(num_samples*kernel_data.integrator.num_all_lights); uint lamp_rng_hash = cmj_hash(state->rng_hash, i); for(int j = 0; j < num_samples; j++) { /* sample random position on given light */ float light_u, light_v; path_branched_rng_2D(kg, lamp_rng_hash, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v); LightSample ls; lamp_light_sample(kg, i, light_u, light_v, ray->P, &ls); float3 tp = throughput; /* sample position on volume segment */ float rphase = path_branched_rng_1D(kg, state->rng_hash, state, j, num_samples, PRNG_PHASE_CHANNEL); float rscatter = path_branched_rng_1D(kg, state->rng_hash, state, j, num_samples, PRNG_SCATTER_DISTANCE); VolumeIntegrateResult result = kernel_volume_decoupled_scatter(kg, state, ray, sd, &tp, rphase, rscatter, segment, (ls.t != FLT_MAX)? &ls.P: NULL, false); /* todo: split up light_sample so we don't have to call it again with new position */ if(result == VOLUME_PATH_SCATTERED && lamp_light_sample(kg, i, light_u, light_v, sd->P, &ls)) { if(kernel_data.integrator.pdf_triangles != 0.0f) ls.pdf *= 2.0f; float terminate = path_branched_rng_light_termination(kg, state->rng_hash, state, j, num_samples); if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, tp*num_samples_inv, &L_light, shadow, num_samples_inv, is_lamp); } } } } } /* mesh light sampling */ if(kernel_data.integrator.pdf_triangles != 0.0f) { int num_samples = kernel_data.integrator.mesh_light_samples; float num_samples_inv = 1.0f/num_samples; for(int j = 0; j < num_samples; j++) { /* sample random position on random triangle */ float light_u, light_v; path_branched_rng_2D(kg, state->rng_hash, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v); /* only sample triangle lights */ if(kernel_data.integrator.num_all_lights) light_u = 0.5f*light_u; LightSample ls; light_sample(kg, light_u, light_v, sd->time, ray->P, state->bounce, &ls); float3 tp = throughput; /* sample position on volume segment */ float rphase = path_branched_rng_1D(kg, state->rng_hash, state, j, num_samples, PRNG_PHASE_CHANNEL); float rscatter = path_branched_rng_1D(kg, state->rng_hash, state, j, num_samples, PRNG_SCATTER_DISTANCE); VolumeIntegrateResult result = kernel_volume_decoupled_scatter(kg, state, ray, sd, &tp, rphase, rscatter, segment, (ls.t != FLT_MAX)? &ls.P: NULL, false); /* todo: split up light_sample so we don't have to call it again with new position */ if(result == VOLUME_PATH_SCATTERED && light_sample(kg, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { if(kernel_data.integrator.num_all_lights) ls.pdf *= 2.0f; float terminate = path_branched_rng_light_termination(kg, state->rng_hash, state, j, num_samples); if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, tp*num_samples_inv, &L_light, shadow, num_samples_inv, is_lamp); } } } } } } else { /* sample random position on random light */ float light_u, light_v; path_state_rng_2D(kg, state, PRNG_LIGHT_U, &light_u, &light_v); LightSample ls; light_sample(kg, light_u, light_v, sd->time, ray->P, state->bounce, &ls); float3 tp = throughput; /* sample position on volume segment */ float rphase = path_state_rng_1D(kg, state, PRNG_PHASE_CHANNEL); float rscatter = path_state_rng_1D(kg, state, PRNG_SCATTER_DISTANCE); VolumeIntegrateResult result = kernel_volume_decoupled_scatter(kg, state, ray, sd, &tp, rphase, rscatter, segment, (ls.t != FLT_MAX)? &ls.P: NULL, false); /* todo: split up light_sample so we don't have to call it again with new position */ if(result == VOLUME_PATH_SCATTERED && light_sample(kg, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { /* sample random light */ float terminate = path_state_rng_light_termination(kg, state); if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &light_ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, tp, &L_light, shadow, 1.0f, is_lamp); } } } } #endif /* __EMISSION__ */ } #endif /* __SPLIT_KERNEL__ */ #endif /* __VOLUME_SCATTER__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_projection.h000066400000000000000000000200011334742672700235330ustar00rootroot00000000000000/* * Parts adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __KERNEL_PROJECTION_CL__ #define __KERNEL_PROJECTION_CL__ CCL_NAMESPACE_BEGIN /* Spherical coordinates <-> Cartesian direction */ ccl_device float2 direction_to_spherical(float3 dir) { float theta = safe_acosf(dir.z); float phi = atan2f(dir.x, dir.y); return make_float2(theta, phi); } ccl_device float3 spherical_to_direction(float theta, float phi) { float sin_theta = sinf(theta); return make_float3(sin_theta*cosf(phi), sin_theta*sinf(phi), cosf(theta)); } /* Equirectangular coordinates <-> Cartesian direction */ ccl_device float2 direction_to_equirectangular_range(float3 dir, float4 range) { if(is_zero(dir)) return make_float2(0.0f, 0.0f); float u = (atan2f(dir.y, dir.x) - range.y) / range.x; float v = (acosf(dir.z / len(dir)) - range.w) / range.z; return make_float2(u, v); } ccl_device float3 equirectangular_range_to_direction(float u, float v, float4 range) { float phi = range.x*u + range.y; float theta = range.z*v + range.w; float sin_theta = sinf(theta); return make_float3(sin_theta*cosf(phi), sin_theta*sinf(phi), cosf(theta)); } ccl_device float2 direction_to_equirectangular(float3 dir) { return direction_to_equirectangular_range(dir, make_float4(-M_2PI_F, M_PI_F, -M_PI_F, M_PI_F)); } ccl_device float3 equirectangular_to_direction(float u, float v) { return equirectangular_range_to_direction(u, v, make_float4(-M_2PI_F, M_PI_F, -M_PI_F, M_PI_F)); } /* Fisheye <-> Cartesian direction */ ccl_device float2 direction_to_fisheye(float3 dir, float fov) { float r = atan2f(sqrtf(dir.y*dir.y + dir.z*dir.z), dir.x) / fov; float phi = atan2f(dir.z, dir.y); float u = r * cosf(phi) + 0.5f; float v = r * sinf(phi) + 0.5f; return make_float2(u, v); } ccl_device float3 fisheye_to_direction(float u, float v, float fov) { u = (u - 0.5f) * 2.0f; v = (v - 0.5f) * 2.0f; float r = sqrtf(u*u + v*v); if(r > 1.0f) return make_float3(0.0f, 0.0f, 0.0f); float phi = safe_acosf((r != 0.0f)? u/r: 0.0f); float theta = r * fov * 0.5f; if(v < 0.0f) phi = -phi; return make_float3( cosf(theta), -cosf(phi)*sinf(theta), sinf(phi)*sinf(theta) ); } ccl_device float2 direction_to_fisheye_equisolid(float3 dir, float lens, float width, float height) { float theta = safe_acosf(dir.x); float r = 2.0f * lens * sinf(theta * 0.5f); float phi = atan2f(dir.z, dir.y); float u = r * cosf(phi) / width + 0.5f; float v = r * sinf(phi) / height + 0.5f; return make_float2(u, v); } ccl_device_inline float3 fisheye_equisolid_to_direction(float u, float v, float lens, float fov, float width, float height) { u = (u - 0.5f) * width; v = (v - 0.5f) * height; float rmax = 2.0f * lens * sinf(fov * 0.25f); float r = sqrtf(u*u + v*v); if(r > rmax) return make_float3(0.0f, 0.0f, 0.0f); float phi = safe_acosf((r != 0.0f)? u/r: 0.0f); float theta = 2.0f * asinf(r/(2.0f * lens)); if(v < 0.0f) phi = -phi; return make_float3( cosf(theta), -cosf(phi)*sinf(theta), sinf(phi)*sinf(theta) ); } /* Mirror Ball <-> Cartesion direction */ ccl_device float3 mirrorball_to_direction(float u, float v) { /* point on sphere */ float3 dir; dir.x = 2.0f*u - 1.0f; dir.z = 2.0f*v - 1.0f; if(dir.x*dir.x + dir.z*dir.z > 1.0f) return make_float3(0.0f, 0.0f, 0.0f); dir.y = -sqrtf(max(1.0f - dir.x*dir.x - dir.z*dir.z, 0.0f)); /* reflection */ float3 I = make_float3(0.0f, -1.0f, 0.0f); return 2.0f*dot(dir, I)*dir - I; } ccl_device float2 direction_to_mirrorball(float3 dir) { /* inverse of mirrorball_to_direction */ dir.y -= 1.0f; float div = 2.0f*sqrtf(max(-0.5f*dir.y, 0.0f)); if(div > 0.0f) dir /= div; float u = 0.5f*(dir.x + 1.0f); float v = 0.5f*(dir.z + 1.0f); return make_float2(u, v); } ccl_device_inline float3 panorama_to_direction(ccl_constant KernelCamera *cam, float u, float v) { switch(cam->panorama_type) { case PANORAMA_EQUIRECTANGULAR: return equirectangular_range_to_direction(u, v, cam->equirectangular_range); case PANORAMA_MIRRORBALL: return mirrorball_to_direction(u, v); case PANORAMA_FISHEYE_EQUIDISTANT: return fisheye_to_direction(u, v, cam->fisheye_fov); case PANORAMA_FISHEYE_EQUISOLID: default: return fisheye_equisolid_to_direction(u, v, cam->fisheye_lens, cam->fisheye_fov, cam->sensorwidth, cam->sensorheight); } } ccl_device_inline float2 direction_to_panorama(ccl_constant KernelCamera *cam, float3 dir) { switch(cam->panorama_type) { case PANORAMA_EQUIRECTANGULAR: return direction_to_equirectangular_range(dir, cam->equirectangular_range); case PANORAMA_MIRRORBALL: return direction_to_mirrorball(dir); case PANORAMA_FISHEYE_EQUIDISTANT: return direction_to_fisheye(dir, cam->fisheye_fov); case PANORAMA_FISHEYE_EQUISOLID: default: return direction_to_fisheye_equisolid(dir, cam->fisheye_lens, cam->sensorwidth, cam->sensorheight); } } ccl_device_inline void spherical_stereo_transform(ccl_constant KernelCamera *cam, float3 *P, float3 *D) { float interocular_offset = cam->interocular_offset; /* Interocular offset of zero means either non stereo, or stereo without * spherical stereo. */ kernel_assert(interocular_offset != 0.0f); if(cam->pole_merge_angle_to > 0.0f) { const float pole_merge_angle_from = cam->pole_merge_angle_from, pole_merge_angle_to = cam->pole_merge_angle_to; float altitude = fabsf(safe_asinf((*D).z)); if(altitude > pole_merge_angle_to) { interocular_offset = 0.0f; } else if(altitude > pole_merge_angle_from) { float fac = (altitude - pole_merge_angle_from) / (pole_merge_angle_to - pole_merge_angle_from); float fade = cosf(fac * M_PI_2_F); interocular_offset *= fade; } } float3 up = make_float3(0.0f, 0.0f, 1.0f); float3 side = normalize(cross(*D, up)); float3 stereo_offset = side * interocular_offset; *P += stereo_offset; /* Convergence distance is FLT_MAX in the case of parallel convergence mode, * no need to modify direction in this case either. */ const float convergence_distance = cam->convergence_distance; if(convergence_distance != FLT_MAX) { float3 screen_offset = convergence_distance * (*D); *D = normalize(screen_offset - stereo_offset); } } CCL_NAMESPACE_END #endif /* __KERNEL_PROJECTION_CL__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_queues.h000066400000000000000000000123641334742672700227030ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_QUEUE_H__ #define __KERNEL_QUEUE_H__ CCL_NAMESPACE_BEGIN /* * Queue utility functions for split kernel */ #ifdef __KERNEL_OPENCL__ #pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable #pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics : enable #endif /* * Enqueue ray index into the queue */ ccl_device void enqueue_ray_index( int ray_index, /* Ray index to be enqueued. */ int queue_number, /* Queue in which the ray index should be enqueued. */ ccl_global int *queues, /* Buffer of all queues. */ int queue_size, /* Size of each queue. */ ccl_global int *queue_index) /* Array of size num_queues; Used for atomic increment. */ { /* This thread's queue index. */ int my_queue_index = atomic_fetch_and_inc_uint32((ccl_global uint*)&queue_index[queue_number]) + (queue_number * queue_size); queues[my_queue_index] = ray_index; } /* * Get the ray index for this thread * Returns a positive ray_index for threads that have to do some work; * Returns 'QUEUE_EMPTY_SLOT' for threads that don't have any work * i.e All ray's in the queue has been successfully allocated and there * is no more ray to allocate to other threads. */ ccl_device int get_ray_index( KernelGlobals *kg, int thread_index, /* Global thread index. */ int queue_number, /* Queue to operate on. */ ccl_global int *queues, /* Buffer of all queues. */ int queuesize, /* Size of a queue. */ int empty_queue) /* Empty the queue slot as soon as we fetch the ray index. */ { int ray_index = queues[queue_number * queuesize + thread_index]; if(empty_queue && ray_index != QUEUE_EMPTY_SLOT) { queues[queue_number * queuesize + thread_index] = QUEUE_EMPTY_SLOT; } return ray_index; } /* The following functions are to realize Local memory variant of enqueue ray index function. */ /* All threads should call this function. */ ccl_device void enqueue_ray_index_local( int ray_index, /* Ray index to enqueue. */ int queue_number, /* Queue in which to enqueue ray index. */ char enqueue_flag, /* True for threads whose ray index has to be enqueued. */ int queuesize, /* queue size. */ ccl_local_param unsigned int *local_queue_atomics, /* To to local queue atomics. */ ccl_global int *Queue_data, /* Queues. */ ccl_global int *Queue_index) /* To do global queue atomics. */ { int lidx = ccl_local_id(1) * ccl_local_size(0) + ccl_local_id(0); /* Get local queue id .*/ unsigned int lqidx; if(enqueue_flag) { lqidx = atomic_fetch_and_inc_uint32(local_queue_atomics); } ccl_barrier(CCL_LOCAL_MEM_FENCE); /* Get global queue offset. */ if(lidx == 0) { *local_queue_atomics = atomic_fetch_and_add_uint32((ccl_global uint*)&Queue_index[queue_number], *local_queue_atomics); } ccl_barrier(CCL_LOCAL_MEM_FENCE); /* Get global queue index and enqueue ray. */ if(enqueue_flag) { unsigned int my_gqidx = queue_number * queuesize + (*local_queue_atomics) + lqidx; Queue_data[my_gqidx] = ray_index; } } ccl_device unsigned int get_local_queue_index( int queue_number, /* Queue in which to enqueue the ray; -1 if no queue */ ccl_local_param unsigned int *local_queue_atomics) { int my_lqidx = atomic_fetch_and_inc_uint32(&local_queue_atomics[queue_number]); return my_lqidx; } ccl_device unsigned int get_global_per_queue_offset( int queue_number, ccl_local_param unsigned int *local_queue_atomics, ccl_global int* global_queue_atomics) { unsigned int queue_offset = atomic_fetch_and_add_uint32((ccl_global uint*)&global_queue_atomics[queue_number], local_queue_atomics[queue_number]); return queue_offset; } ccl_device unsigned int get_global_queue_index( int queue_number, int queuesize, unsigned int lqidx, ccl_local_param unsigned int * global_per_queue_offset) { int my_gqidx = queuesize * queue_number + lqidx + global_per_queue_offset[queue_number]; return my_gqidx; } ccl_device int dequeue_ray_index( int queue_number, ccl_global int *queues, int queue_size, ccl_global int *queue_index) { int index = atomic_fetch_and_dec_uint32((ccl_global uint*)&queue_index[queue_number])-1; if(index < 0) { return QUEUE_EMPTY_SLOT; } return queues[index + queue_number * queue_size]; } CCL_NAMESPACE_END #endif // __KERNEL_QUEUE_H__ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_random.h000066400000000000000000000174731334742672700226620ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "kernel/kernel_jitter.h" #include "util/util_hash.h" CCL_NAMESPACE_BEGIN /* Pseudo random numbers, uncomment this for debugging correlations. Only run * this single threaded on a CPU for repeatable results. */ //#define __DEBUG_CORRELATION__ /* High Dimensional Sobol. * * Multidimensional sobol with generator matrices. Dimension 0 and 1 are equal * to classic Van der Corput and Sobol sequences. */ #ifdef __SOBOL__ /* Skip initial numbers that for some dimensions have clear patterns that * don't cover the entire sample space. Ideally we would have a better * progressive pattern that doesn't suffer from this problem, because even * with this offset some dimensions are quite poor. */ #define SOBOL_SKIP 64 ccl_device uint sobol_dimension(KernelGlobals *kg, int index, int dimension) { uint result = 0; uint i = index + SOBOL_SKIP; for(uint j = 0; i; i >>= 1, j++) { if(i & 1) { result ^= kernel_tex_fetch(__sobol_directions, 32*dimension + j); } } return result; } #endif /* __SOBOL__ */ ccl_device_forceinline float path_rng_1D(KernelGlobals *kg, uint rng_hash, int sample, int num_samples, int dimension) { #ifdef __DEBUG_CORRELATION__ return (float)drand48(); #endif #ifdef __CMJ__ # ifdef __SOBOL__ if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) # endif { /* Correlated multi-jitter. */ int p = rng_hash + dimension; return cmj_sample_1D(sample, num_samples, p); } #endif #ifdef __SOBOL__ /* Sobol sequence value using direction vectors. */ uint result = sobol_dimension(kg, sample, dimension); float r = (float)result * (1.0f/(float)0xFFFFFFFF); /* Cranly-Patterson rotation using rng seed */ float shift; /* Hash rng with dimension to solve correlation issues. * See T38710, T50116. */ uint tmp_rng = cmj_hash_simple(dimension, rng_hash); shift = tmp_rng * (1.0f/(float)0xFFFFFFFF); return r + shift - floorf(r + shift); #endif } ccl_device_forceinline void path_rng_2D(KernelGlobals *kg, uint rng_hash, int sample, int num_samples, int dimension, float *fx, float *fy) { #ifdef __DEBUG_CORRELATION__ *fx = (float)drand48(); *fy = (float)drand48(); return; #endif #ifdef __CMJ__ # ifdef __SOBOL__ if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) # endif { /* Correlated multi-jitter. */ int p = rng_hash + dimension; cmj_sample_2D(sample, num_samples, p, fx, fy); return; } #endif #ifdef __SOBOL__ /* Sobol. */ *fx = path_rng_1D(kg, rng_hash, sample, num_samples, dimension); *fy = path_rng_1D(kg, rng_hash, sample, num_samples, dimension + 1); #endif } ccl_device_inline void path_rng_init(KernelGlobals *kg, int sample, int num_samples, uint *rng_hash, int x, int y, float *fx, float *fy) { /* load state */ *rng_hash = hash_int_2d(x, y); *rng_hash ^= kernel_data.integrator.seed; #ifdef __DEBUG_CORRELATION__ srand48(*rng_hash + sample); #endif if(sample == 0) { *fx = 0.5f; *fy = 0.5f; } else { path_rng_2D(kg, *rng_hash, sample, num_samples, PRNG_FILTER_U, fx, fy); } } /* Linear Congruential Generator */ ccl_device uint lcg_step_uint(uint *rng) { /* implicit mod 2^32 */ *rng = (1103515245*(*rng) + 12345); return *rng; } ccl_device float lcg_step_float(uint *rng) { /* implicit mod 2^32 */ *rng = (1103515245*(*rng) + 12345); return (float)*rng * (1.0f/(float)0xFFFFFFFF); } ccl_device uint lcg_init(uint seed) { uint rng = seed; lcg_step_uint(&rng); return rng; } /* Path Tracing Utility Functions * * For each random number in each step of the path we must have a unique * dimension to avoid using the same sequence twice. * * For branches in the path we must be careful not to reuse the same number * in a sequence and offset accordingly. */ ccl_device_inline float path_state_rng_1D(KernelGlobals *kg, const ccl_addr_space PathState *state, int dimension) { return path_rng_1D(kg, state->rng_hash, state->sample, state->num_samples, state->rng_offset + dimension); } ccl_device_inline void path_state_rng_2D(KernelGlobals *kg, const ccl_addr_space PathState *state, int dimension, float *fx, float *fy) { path_rng_2D(kg, state->rng_hash, state->sample, state->num_samples, state->rng_offset + dimension, fx, fy); } ccl_device_inline float path_branched_rng_1D( KernelGlobals *kg, uint rng_hash, const ccl_addr_space PathState *state, int branch, int num_branches, int dimension) { return path_rng_1D(kg, rng_hash, state->sample * num_branches + branch, state->num_samples * num_branches, state->rng_offset + dimension); } ccl_device_inline void path_branched_rng_2D( KernelGlobals *kg, uint rng_hash, const ccl_addr_space PathState *state, int branch, int num_branches, int dimension, float *fx, float *fy) { path_rng_2D(kg, rng_hash, state->sample * num_branches + branch, state->num_samples * num_branches, state->rng_offset + dimension, fx, fy); } /* Utitility functions to get light termination value, * since it might not be needed in many cases. */ ccl_device_inline float path_state_rng_light_termination( KernelGlobals *kg, const ccl_addr_space PathState *state) { if(kernel_data.integrator.light_inv_rr_threshold > 0.0f) { return path_state_rng_1D(kg, state, PRNG_LIGHT_TERMINATE); } return 0.0f; } ccl_device_inline float path_branched_rng_light_termination( KernelGlobals *kg, uint rng_hash, const ccl_addr_space PathState *state, int branch, int num_branches) { if(kernel_data.integrator.light_inv_rr_threshold > 0.0f) { return path_branched_rng_1D(kg, rng_hash, state, branch, num_branches, PRNG_LIGHT_TERMINATE); } return 0.0f; } ccl_device_inline uint lcg_state_init(PathState *state, uint scramble) { return lcg_init(state->rng_hash + state->rng_offset + state->sample*scramble); } ccl_device_inline uint lcg_state_init_addrspace(ccl_addr_space PathState *state, uint scramble) { return lcg_init(state->rng_hash + state->rng_offset + state->sample*scramble); } ccl_device float lcg_step_float_addrspace(ccl_addr_space uint *rng) { /* Implicit mod 2^32 */ *rng = (1103515245*(*rng) + 12345); return (float)*rng * (1.0f/(float)0xFFFFFFFF); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_shader.h000066400000000000000000001005211334742672700226330ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * ShaderData, used in four steps: * * Setup from incoming ray, sampled position and background. * Execute for surface, volume or displacement. * Evaluate one or more closures. * Release. * */ #include "kernel/closure/alloc.h" #include "kernel/closure/bsdf_util.h" #include "kernel/closure/bsdf.h" #include "kernel/closure/emissive.h" #include "kernel/svm/svm.h" CCL_NAMESPACE_BEGIN /* ShaderData setup from incoming ray */ #ifdef __OBJECT_MOTION__ ccl_device void shader_setup_object_transforms(KernelGlobals *kg, ShaderData *sd, float time) { if(sd->object_flag & SD_OBJECT_MOTION) { sd->ob_tfm = object_fetch_transform_motion(kg, sd->object, time); sd->ob_itfm = transform_quick_inverse(sd->ob_tfm); } else { sd->ob_tfm = object_fetch_transform(kg, sd->object, OBJECT_TRANSFORM); sd->ob_itfm = object_fetch_transform(kg, sd->object, OBJECT_INVERSE_TRANSFORM); } } #endif ccl_device_noinline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray) { #ifdef __INSTANCING__ sd->object = (isect->object == PRIM_NONE)? kernel_tex_fetch(__prim_object, isect->prim): isect->object; #endif sd->lamp = LAMP_NONE; sd->type = isect->type; sd->flag = 0; sd->object_flag = kernel_tex_fetch(__object_flag, sd->object); /* matrices and time */ #ifdef __OBJECT_MOTION__ shader_setup_object_transforms(kg, sd, ray->time); #endif sd->time = ray->time; sd->prim = kernel_tex_fetch(__prim_index, isect->prim); sd->ray_length = isect->t; #ifdef __UV__ sd->u = isect->u; sd->v = isect->v; #endif #ifdef __HAIR__ if(sd->type & PRIMITIVE_ALL_CURVE) { /* curve */ float4 curvedata = kernel_tex_fetch(__curves, sd->prim); sd->shader = __float_as_int(curvedata.z); sd->P = curve_refine(kg, sd, isect, ray); } else #endif if(sd->type & PRIMITIVE_TRIANGLE) { /* static triangle */ float3 Ng = triangle_normal(kg, sd); sd->shader = kernel_tex_fetch(__tri_shader, sd->prim); /* vectors */ sd->P = triangle_refine(kg, sd, isect, ray); sd->Ng = Ng; sd->N = Ng; /* smooth normal */ if(sd->shader & SHADER_SMOOTH_NORMAL) sd->N = triangle_smooth_normal(kg, Ng, sd->prim, sd->u, sd->v); #ifdef __DPDU__ /* dPdu/dPdv */ triangle_dPdudv(kg, sd->prim, &sd->dPdu, &sd->dPdv); #endif } else { /* motion triangle */ motion_triangle_shader_setup(kg, sd, isect, ray, false); } sd->I = -ray->D; sd->flag |= kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*SHADER_SIZE); #ifdef __INSTANCING__ if(isect->object != OBJECT_NONE) { /* instance transform */ object_normal_transform_auto(kg, sd, &sd->N); object_normal_transform_auto(kg, sd, &sd->Ng); # ifdef __DPDU__ object_dir_transform_auto(kg, sd, &sd->dPdu); object_dir_transform_auto(kg, sd, &sd->dPdv); # endif } #endif /* backfacing test */ bool backfacing = (dot(sd->Ng, sd->I) < 0.0f); if(backfacing) { sd->flag |= SD_BACKFACING; sd->Ng = -sd->Ng; sd->N = -sd->N; #ifdef __DPDU__ sd->dPdu = -sd->dPdu; sd->dPdv = -sd->dPdv; #endif } #ifdef __RAY_DIFFERENTIALS__ /* differentials */ differential_transfer(&sd->dP, ray->dP, ray->D, ray->dD, sd->Ng, isect->t); differential_incoming(&sd->dI, ray->dD); differential_dudv(&sd->du, &sd->dv, sd->dPdu, sd->dPdv, sd->dP, sd->Ng); #endif } /* ShaderData setup from BSSRDF scatter */ #ifdef __SUBSURFACE__ # ifndef __KERNEL_CUDA__ ccl_device # else ccl_device_inline # endif void shader_setup_from_subsurface( KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray) { const bool backfacing = sd->flag & SD_BACKFACING; /* object, matrices, time, ray_length stay the same */ sd->flag = 0; sd->object_flag = kernel_tex_fetch(__object_flag, sd->object); sd->prim = kernel_tex_fetch(__prim_index, isect->prim); sd->type = isect->type; # ifdef __UV__ sd->u = isect->u; sd->v = isect->v; # endif /* fetch triangle data */ if(sd->type == PRIMITIVE_TRIANGLE) { float3 Ng = triangle_normal(kg, sd); sd->shader = kernel_tex_fetch(__tri_shader, sd->prim); /* static triangle */ sd->P = triangle_refine_local(kg, sd, isect, ray); sd->Ng = Ng; sd->N = Ng; if(sd->shader & SHADER_SMOOTH_NORMAL) sd->N = triangle_smooth_normal(kg, Ng, sd->prim, sd->u, sd->v); # ifdef __DPDU__ /* dPdu/dPdv */ triangle_dPdudv(kg, sd->prim, &sd->dPdu, &sd->dPdv); # endif } else { /* motion triangle */ motion_triangle_shader_setup(kg, sd, isect, ray, true); } sd->flag |= kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*SHADER_SIZE); # ifdef __INSTANCING__ if(isect->object != OBJECT_NONE) { /* instance transform */ object_normal_transform_auto(kg, sd, &sd->N); object_normal_transform_auto(kg, sd, &sd->Ng); # ifdef __DPDU__ object_dir_transform_auto(kg, sd, &sd->dPdu); object_dir_transform_auto(kg, sd, &sd->dPdv); # endif } # endif /* backfacing test */ if(backfacing) { sd->flag |= SD_BACKFACING; sd->Ng = -sd->Ng; sd->N = -sd->N; # ifdef __DPDU__ sd->dPdu = -sd->dPdu; sd->dPdv = -sd->dPdv; # endif } /* should not get used in principle as the shading will only use a diffuse * BSDF, but the shader might still access it */ sd->I = sd->N; # ifdef __RAY_DIFFERENTIALS__ /* differentials */ differential_dudv(&sd->du, &sd->dv, sd->dPdu, sd->dPdv, sd->dP, sd->Ng); /* don't modify dP and dI */ # endif } #endif /* ShaderData setup from position sampled on mesh */ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd, const float3 P, const float3 Ng, const float3 I, int shader, int object, int prim, float u, float v, float t, float time, bool object_space, int lamp) { /* vectors */ sd->P = P; sd->N = Ng; sd->Ng = Ng; sd->I = I; sd->shader = shader; if(prim != PRIM_NONE) sd->type = PRIMITIVE_TRIANGLE; else if(lamp != LAMP_NONE) sd->type = PRIMITIVE_LAMP; else sd->type = PRIMITIVE_NONE; /* primitive */ #ifdef __INSTANCING__ sd->object = object; #endif sd->lamp = LAMP_NONE; /* currently no access to bvh prim index for strand sd->prim*/ sd->prim = prim; #ifdef __UV__ sd->u = u; sd->v = v; #endif sd->time = time; sd->ray_length = t; sd->flag = kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*SHADER_SIZE); sd->object_flag = 0; if(sd->object != OBJECT_NONE) { sd->object_flag |= kernel_tex_fetch(__object_flag, sd->object); #ifdef __OBJECT_MOTION__ shader_setup_object_transforms(kg, sd, time); } else if(lamp != LAMP_NONE) { sd->ob_tfm = lamp_fetch_transform(kg, lamp, false); sd->ob_itfm = lamp_fetch_transform(kg, lamp, true); sd->lamp = lamp; #endif } /* transform into world space */ if(object_space) { object_position_transform_auto(kg, sd, &sd->P); object_normal_transform_auto(kg, sd, &sd->Ng); sd->N = sd->Ng; object_dir_transform_auto(kg, sd, &sd->I); } if(sd->type & PRIMITIVE_TRIANGLE) { /* smooth normal */ if(sd->shader & SHADER_SMOOTH_NORMAL) { sd->N = triangle_smooth_normal(kg, Ng, sd->prim, sd->u, sd->v); #ifdef __INSTANCING__ if(!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { object_normal_transform_auto(kg, sd, &sd->N); } #endif } /* dPdu/dPdv */ #ifdef __DPDU__ triangle_dPdudv(kg, sd->prim, &sd->dPdu, &sd->dPdv); # ifdef __INSTANCING__ if(!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { object_dir_transform_auto(kg, sd, &sd->dPdu); object_dir_transform_auto(kg, sd, &sd->dPdv); } # endif #endif } else { #ifdef __DPDU__ sd->dPdu = make_float3(0.0f, 0.0f, 0.0f); sd->dPdv = make_float3(0.0f, 0.0f, 0.0f); #endif } /* backfacing test */ if(sd->prim != PRIM_NONE) { bool backfacing = (dot(sd->Ng, sd->I) < 0.0f); if(backfacing) { sd->flag |= SD_BACKFACING; sd->Ng = -sd->Ng; sd->N = -sd->N; #ifdef __DPDU__ sd->dPdu = -sd->dPdu; sd->dPdv = -sd->dPdv; #endif } } #ifdef __RAY_DIFFERENTIALS__ /* no ray differentials here yet */ sd->dP = differential3_zero(); sd->dI = differential3_zero(); sd->du = differential_zero(); sd->dv = differential_zero(); #endif } /* ShaderData setup for displacement */ ccl_device void shader_setup_from_displace(KernelGlobals *kg, ShaderData *sd, int object, int prim, float u, float v) { float3 P, Ng, I = make_float3(0.0f, 0.0f, 0.0f); int shader; triangle_point_normal(kg, object, prim, u, v, &P, &Ng, &shader); /* force smooth shading for displacement */ shader |= SHADER_SMOOTH_NORMAL; shader_setup_from_sample(kg, sd, P, Ng, I, shader, object, prim, u, v, 0.0f, 0.5f, !(kernel_tex_fetch(__object_flag, object) & SD_OBJECT_TRANSFORM_APPLIED), LAMP_NONE); } /* ShaderData setup from ray into background */ ccl_device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderData *sd, const Ray *ray) { /* vectors */ sd->P = ray->D; sd->N = -ray->D; sd->Ng = -ray->D; sd->I = -ray->D; sd->shader = kernel_data.background.surface_shader; sd->flag = kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*SHADER_SIZE); sd->object_flag = 0; sd->time = ray->time; sd->ray_length = 0.0f; #ifdef __INSTANCING__ sd->object = PRIM_NONE; #endif sd->lamp = LAMP_NONE; sd->prim = PRIM_NONE; #ifdef __UV__ sd->u = 0.0f; sd->v = 0.0f; #endif #ifdef __DPDU__ /* dPdu/dPdv */ sd->dPdu = make_float3(0.0f, 0.0f, 0.0f); sd->dPdv = make_float3(0.0f, 0.0f, 0.0f); #endif #ifdef __RAY_DIFFERENTIALS__ /* differentials */ sd->dP = ray->dD; differential_incoming(&sd->dI, sd->dP); sd->du = differential_zero(); sd->dv = differential_zero(); #endif } /* ShaderData setup from point inside volume */ #ifdef __VOLUME__ ccl_device_inline void shader_setup_from_volume(KernelGlobals *kg, ShaderData *sd, const Ray *ray) { /* vectors */ sd->P = ray->P; sd->N = -ray->D; sd->Ng = -ray->D; sd->I = -ray->D; sd->shader = SHADER_NONE; sd->flag = 0; sd->object_flag = 0; sd->time = ray->time; sd->ray_length = 0.0f; /* todo: can we set this to some useful value? */ # ifdef __INSTANCING__ sd->object = PRIM_NONE; /* todo: fill this for texture coordinates */ # endif sd->lamp = LAMP_NONE; sd->prim = PRIM_NONE; sd->type = PRIMITIVE_NONE; # ifdef __UV__ sd->u = 0.0f; sd->v = 0.0f; # endif # ifdef __DPDU__ /* dPdu/dPdv */ sd->dPdu = make_float3(0.0f, 0.0f, 0.0f); sd->dPdv = make_float3(0.0f, 0.0f, 0.0f); # endif # ifdef __RAY_DIFFERENTIALS__ /* differentials */ sd->dP = ray->dD; differential_incoming(&sd->dI, sd->dP); sd->du = differential_zero(); sd->dv = differential_zero(); # endif /* for NDC coordinates */ sd->ray_P = ray->P; sd->ray_dP = ray->dP; } #endif /* __VOLUME__ */ /* Merging */ #if defined(__BRANCHED_PATH__) || defined(__VOLUME__) ccl_device_inline void shader_merge_closures(ShaderData *sd) { /* merge identical closures, better when we sample a single closure at a time */ for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sci = &sd->closure[i]; for(int j = i + 1; j < sd->num_closure; j++) { ShaderClosure *scj = &sd->closure[j]; if(sci->type != scj->type) continue; if(!bsdf_merge(sci, scj)) continue; sci->weight += scj->weight; sci->sample_weight += scj->sample_weight; int size = sd->num_closure - (j+1); if(size > 0) { for(int k = 0; k < size; k++) { scj[k] = scj[k+1]; } } sd->num_closure--; kernel_assert(sd->num_closure >= 0); j--; } } } #endif /* __BRANCHED_PATH__ || __VOLUME__ */ /* Defensive sampling. */ ccl_device_inline void shader_prepare_closures(ShaderData *sd, ccl_addr_space PathState *state) { /* We can likely also do defensive sampling at deeper bounces, particularly * for cases like a perfect mirror but possibly also others. This will need * a good heuristic. */ if(state->bounce + state->transparent_bounce == 0 && sd->num_closure > 1) { float sum = 0.0f; for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) { sum += sc->sample_weight; } } for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) { sc->sample_weight = max(sc->sample_weight, 0.125f * sum); } } } } /* BSDF */ ccl_device_inline void _shader_bsdf_multi_eval(KernelGlobals *kg, ShaderData *sd, const float3 omega_in, float *pdf, const ShaderClosure *skip_sc, BsdfEval *result_eval, float sum_pdf, float sum_sample_weight) { /* this is the veach one-sample model with balance heuristic, some pdf * factors drop out when using balance heuristic weighting */ for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(sc != skip_sc && CLOSURE_IS_BSDF(sc->type)) { float bsdf_pdf = 0.0f; float3 eval = bsdf_eval(kg, sd, sc, omega_in, &bsdf_pdf); if(bsdf_pdf != 0.0f) { bsdf_eval_accum(result_eval, sc->type, eval*sc->weight, 1.0f); sum_pdf += bsdf_pdf*sc->sample_weight; } sum_sample_weight += sc->sample_weight; } } *pdf = (sum_sample_weight > 0.0f)? sum_pdf/sum_sample_weight: 0.0f; } #ifdef __BRANCHED_PATH__ ccl_device_inline void _shader_bsdf_multi_eval_branched(KernelGlobals *kg, ShaderData *sd, const float3 omega_in, BsdfEval *result_eval, float light_pdf, bool use_mis) { for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF(sc->type)) { float bsdf_pdf = 0.0f; float3 eval = bsdf_eval(kg, sd, sc, omega_in, &bsdf_pdf); if(bsdf_pdf != 0.0f) { float mis_weight = use_mis? power_heuristic(light_pdf, bsdf_pdf): 1.0f; bsdf_eval_accum(result_eval, sc->type, eval * sc->weight, mis_weight); } } } } #endif /* __BRANCHED_PATH__ */ #ifndef __KERNEL_CUDA__ ccl_device #else ccl_device_inline #endif void shader_bsdf_eval(KernelGlobals *kg, ShaderData *sd, const float3 omega_in, BsdfEval *eval, float light_pdf, bool use_mis) { bsdf_eval_init(eval, NBUILTIN_CLOSURES, make_float3(0.0f, 0.0f, 0.0f), kernel_data.film.use_light_pass); #ifdef __BRANCHED_PATH__ if(kernel_data.integrator.branched) _shader_bsdf_multi_eval_branched(kg, sd, omega_in, eval, light_pdf, use_mis); else #endif { float pdf; _shader_bsdf_multi_eval(kg, sd, omega_in, &pdf, NULL, eval, 0.0f, 0.0f); if(use_mis) { float weight = power_heuristic(light_pdf, pdf); bsdf_eval_mis(eval, weight); } } } ccl_device_inline const ShaderClosure *shader_bsdf_pick(ShaderData *sd, float *randu) { /* Note the sampling here must match shader_bssrdf_pick, * since we reuse the same random number. */ int sampled = 0; if(sd->num_closure > 1) { /* Pick a BSDF or based on sample weights. */ float sum = 0.0f; for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) { sum += sc->sample_weight; } } float r = (*randu)*sum; float partial_sum = 0.0f; for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) { float next_sum = partial_sum + sc->sample_weight; if(r < next_sum) { sampled = i; /* Rescale to reuse for direction sample, to better * preserve stratifaction. */ *randu = (r - partial_sum) / sc->sample_weight; break; } partial_sum = next_sum; } } } const ShaderClosure *sc = &sd->closure[sampled]; return CLOSURE_IS_BSDF(sc->type)? sc: NULL; } ccl_device_inline const ShaderClosure *shader_bssrdf_pick(ShaderData *sd, ccl_addr_space float3 *throughput, float *randu) { /* Note the sampling here must match shader_bsdf_pick, * since we reuse the same random number. */ int sampled = 0; if(sd->num_closure > 1) { /* Pick a BSDF or BSSRDF or based on sample weights. */ float sum_bsdf = 0.0f; float sum_bssrdf = 0.0f; for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF(sc->type)) { sum_bsdf += sc->sample_weight; } else if(CLOSURE_IS_BSSRDF(sc->type)) { sum_bssrdf += sc->sample_weight; } } float r = (*randu)*(sum_bsdf + sum_bssrdf); float partial_sum = 0.0f; for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) { float next_sum = partial_sum + sc->sample_weight; if(r < next_sum) { if(CLOSURE_IS_BSDF(sc->type)) { *throughput *= (sum_bsdf + sum_bssrdf) / sum_bsdf; return NULL; } else { *throughput *= (sum_bsdf + sum_bssrdf) / sum_bssrdf; sampled = i; /* Rescale to reuse for direction sample, to better * preserve stratifaction. */ *randu = (r - partial_sum) / sc->sample_weight; break; } } partial_sum = next_sum; } } } const ShaderClosure *sc = &sd->closure[sampled]; return CLOSURE_IS_BSSRDF(sc->type)? sc: NULL; } ccl_device_inline int shader_bsdf_sample(KernelGlobals *kg, ShaderData *sd, float randu, float randv, BsdfEval *bsdf_eval, float3 *omega_in, differential3 *domega_in, float *pdf) { const ShaderClosure *sc = shader_bsdf_pick(sd, &randu); if(sc == NULL) { *pdf = 0.0f; return LABEL_NONE; } /* BSSRDF should already have been handled elsewhere. */ kernel_assert(CLOSURE_IS_BSDF(sc->type)); int label; float3 eval; *pdf = 0.0f; label = bsdf_sample(kg, sd, sc, randu, randv, &eval, omega_in, domega_in, pdf); if(*pdf != 0.0f) { bsdf_eval_init(bsdf_eval, sc->type, eval*sc->weight, kernel_data.film.use_light_pass); if(sd->num_closure > 1) { float sweight = sc->sample_weight; _shader_bsdf_multi_eval(kg, sd, *omega_in, pdf, sc, bsdf_eval, *pdf*sweight, sweight); } } return label; } ccl_device int shader_bsdf_sample_closure(KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, float randu, float randv, BsdfEval *bsdf_eval, float3 *omega_in, differential3 *domega_in, float *pdf) { int label; float3 eval; *pdf = 0.0f; label = bsdf_sample(kg, sd, sc, randu, randv, &eval, omega_in, domega_in, pdf); if(*pdf != 0.0f) bsdf_eval_init(bsdf_eval, sc->type, eval*sc->weight, kernel_data.film.use_light_pass); return label; } ccl_device void shader_bsdf_blur(KernelGlobals *kg, ShaderData *sd, float roughness) { for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF(sc->type)) bsdf_blur(kg, sc, roughness); } } ccl_device float3 shader_bsdf_transparency(KernelGlobals *kg, const ShaderData *sd) { if(sd->flag & SD_HAS_ONLY_VOLUME) { return make_float3(1.0f, 1.0f, 1.0f); } else if(sd->flag & SD_TRANSPARENT) { return sd->closure_transparent_extinction; } else { return make_float3(0.0f, 0.0f, 0.0f); } } ccl_device void shader_bsdf_disable_transparency(KernelGlobals *kg, ShaderData *sd) { if(sd->flag & SD_TRANSPARENT) { for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(sc->type == CLOSURE_BSDF_TRANSPARENT_ID) { sc->sample_weight = 0.0f; sc->weight = make_float3(0.0f, 0.0f, 0.0f); } } sd->flag &= ~SD_TRANSPARENT; } } ccl_device float3 shader_bsdf_alpha(KernelGlobals *kg, ShaderData *sd) { float3 alpha = make_float3(1.0f, 1.0f, 1.0f) - shader_bsdf_transparency(kg, sd); alpha = max(alpha, make_float3(0.0f, 0.0f, 0.0f)); alpha = min(alpha, make_float3(1.0f, 1.0f, 1.0f)); return alpha; } ccl_device float3 shader_bsdf_diffuse(KernelGlobals *kg, ShaderData *sd) { float3 eval = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_DIFFUSE(sc->type)) eval += sc->weight; } return eval; } ccl_device float3 shader_bsdf_glossy(KernelGlobals *kg, ShaderData *sd) { float3 eval = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_GLOSSY(sc->type)) eval += sc->weight; } return eval; } ccl_device float3 shader_bsdf_transmission(KernelGlobals *kg, ShaderData *sd) { float3 eval = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_TRANSMISSION(sc->type)) eval += sc->weight; } return eval; } ccl_device float3 shader_bsdf_subsurface(KernelGlobals *kg, ShaderData *sd) { float3 eval = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSSRDF(sc->type) || CLOSURE_IS_BSDF_BSSRDF(sc->type)) eval += sc->weight; } return eval; } ccl_device float3 shader_bsdf_average_normal(KernelGlobals *kg, ShaderData *sd) { float3 N = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) N += sc->N*average(sc->weight); } return (is_zero(N))? sd->N : normalize(N); } ccl_device float3 shader_bsdf_ao(KernelGlobals *kg, ShaderData *sd, float ao_factor, float3 *N_) { float3 eval = make_float3(0.0f, 0.0f, 0.0f); float3 N = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSDF_DIFFUSE(sc->type)) { const DiffuseBsdf *bsdf = (const DiffuseBsdf*)sc; eval += sc->weight*ao_factor; N += bsdf->N*average(sc->weight); } else if(CLOSURE_IS_AMBIENT_OCCLUSION(sc->type)) { eval += sc->weight; N += sd->N*average(sc->weight); } } *N_ = (is_zero(N))? sd->N : normalize(N); return eval; } #ifdef __SUBSURFACE__ ccl_device float3 shader_bssrdf_sum(ShaderData *sd, float3 *N_, float *texture_blur_) { float3 eval = make_float3(0.0f, 0.0f, 0.0f); float3 N = make_float3(0.0f, 0.0f, 0.0f); float texture_blur = 0.0f, weight_sum = 0.0f; for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_BSSRDF(sc->type)) { const Bssrdf *bssrdf = (const Bssrdf*)sc; float avg_weight = fabsf(average(sc->weight)); N += bssrdf->N*avg_weight; eval += sc->weight; texture_blur += bssrdf->texture_blur*avg_weight; weight_sum += avg_weight; } } if(N_) *N_ = (is_zero(N))? sd->N: normalize(N); if(texture_blur_) *texture_blur_ = safe_divide(texture_blur, weight_sum); return eval; } #endif /* __SUBSURFACE__ */ /* Emission */ ccl_device float3 shader_emissive_eval(KernelGlobals *kg, ShaderData *sd) { if(sd->flag & SD_EMISSION) { return emissive_simple_eval(sd->Ng, sd->I) * sd->closure_emission_background; } else { return make_float3(0.0f, 0.0f, 0.0f); } } /* Holdout */ ccl_device float3 shader_holdout_eval(KernelGlobals *kg, ShaderData *sd) { float3 weight = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_HOLDOUT(sc->type)) weight += sc->weight; } return weight; } /* Surface Evaluation */ ccl_device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, int path_flag) { /* If path is being terminated, we are tracing a shadow ray or evaluating * emission, then we don't need to store closures. The emission and shadow * shader data also do not have a closure array to save GPU memory. */ int max_closures; if(path_flag & (PATH_RAY_TERMINATE|PATH_RAY_SHADOW|PATH_RAY_EMISSION)) { max_closures = 0; } else { max_closures = kernel_data.integrator.max_closures; } sd->num_closure = 0; sd->num_closure_left = max_closures; #ifdef __OSL__ if(kg->osl) OSLShader::eval_surface(kg, sd, state, path_flag); else #endif { #ifdef __SVM__ svm_eval_nodes(kg, sd, state, SHADER_TYPE_SURFACE, path_flag); #else DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd, sizeof(DiffuseBsdf), make_float3(0.8f, 0.8f, 0.8f)); bsdf->N = sd->N; sd->flag |= bsdf_diffuse_setup(bsdf); #endif } if(sd->flag & SD_BSDF_NEEDS_LCG) { sd->lcg_state = lcg_state_init_addrspace(state, 0xb4bc3953); } } /* Background Evaluation */ ccl_device float3 shader_eval_background(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, int path_flag) { sd->num_closure = 0; sd->num_closure_left = 0; #ifdef __SVM__ # ifdef __OSL__ if(kg->osl) { OSLShader::eval_background(kg, sd, state, path_flag); } else # endif /* __OSL__ */ { svm_eval_nodes(kg, sd, state, SHADER_TYPE_SURFACE, path_flag); } if(sd->flag & SD_EMISSION) { return sd->closure_emission_background; } else { return make_float3(0.0f, 0.0f, 0.0f); } #else /* __SVM__ */ return make_float3(0.8f, 0.8f, 0.8f); #endif /* __SVM__ */ } /* Volume */ #ifdef __VOLUME__ ccl_device_inline void _shader_volume_phase_multi_eval(const ShaderData *sd, const float3 omega_in, float *pdf, int skip_phase, BsdfEval *result_eval, float sum_pdf, float sum_sample_weight) { for(int i = 0; i < sd->num_closure; i++) { if(i == skip_phase) continue; const ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_PHASE(sc->type)) { float phase_pdf = 0.0f; float3 eval = volume_phase_eval(sd, sc, omega_in, &phase_pdf); if(phase_pdf != 0.0f) { bsdf_eval_accum(result_eval, sc->type, eval, 1.0f); sum_pdf += phase_pdf*sc->sample_weight; } sum_sample_weight += sc->sample_weight; } } *pdf = (sum_sample_weight > 0.0f)? sum_pdf/sum_sample_weight: 0.0f; } ccl_device void shader_volume_phase_eval(KernelGlobals *kg, const ShaderData *sd, const float3 omega_in, BsdfEval *eval, float *pdf) { bsdf_eval_init(eval, NBUILTIN_CLOSURES, make_float3(0.0f, 0.0f, 0.0f), kernel_data.film.use_light_pass); _shader_volume_phase_multi_eval(sd, omega_in, pdf, -1, eval, 0.0f, 0.0f); } ccl_device int shader_volume_phase_sample(KernelGlobals *kg, const ShaderData *sd, float randu, float randv, BsdfEval *phase_eval, float3 *omega_in, differential3 *domega_in, float *pdf) { int sampled = 0; if(sd->num_closure > 1) { /* pick a phase closure based on sample weights */ float sum = 0.0f; for(sampled = 0; sampled < sd->num_closure; sampled++) { const ShaderClosure *sc = &sd->closure[sampled]; if(CLOSURE_IS_PHASE(sc->type)) sum += sc->sample_weight; } float r = randu*sum; float partial_sum = 0.0f; for(sampled = 0; sampled < sd->num_closure; sampled++) { const ShaderClosure *sc = &sd->closure[sampled]; if(CLOSURE_IS_PHASE(sc->type)) { float next_sum = partial_sum + sc->sample_weight; if(r <= next_sum) { /* Rescale to reuse for BSDF direction sample. */ randu = (r - partial_sum) / sc->sample_weight; break; } partial_sum = next_sum; } } if(sampled == sd->num_closure) { *pdf = 0.0f; return LABEL_NONE; } } /* todo: this isn't quite correct, we don't weight anisotropy properly * depending on color channels, even if this is perhaps not a common case */ const ShaderClosure *sc = &sd->closure[sampled]; int label; float3 eval; *pdf = 0.0f; label = volume_phase_sample(sd, sc, randu, randv, &eval, omega_in, domega_in, pdf); if(*pdf != 0.0f) { bsdf_eval_init(phase_eval, sc->type, eval, kernel_data.film.use_light_pass); } return label; } ccl_device int shader_phase_sample_closure(KernelGlobals *kg, const ShaderData *sd, const ShaderClosure *sc, float randu, float randv, BsdfEval *phase_eval, float3 *omega_in, differential3 *domega_in, float *pdf) { int label; float3 eval; *pdf = 0.0f; label = volume_phase_sample(sd, sc, randu, randv, &eval, omega_in, domega_in, pdf); if(*pdf != 0.0f) bsdf_eval_init(phase_eval, sc->type, eval, kernel_data.film.use_light_pass); return label; } /* Volume Evaluation */ ccl_device_inline void shader_eval_volume(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, ccl_addr_space VolumeStack *stack, int path_flag) { /* If path is being terminated, we are tracing a shadow ray or evaluating * emission, then we don't need to store closures. The emission and shadow * shader data also do not have a closure array to save GPU memory. */ int max_closures; if(path_flag & (PATH_RAY_TERMINATE|PATH_RAY_SHADOW|PATH_RAY_EMISSION)) { max_closures = 0; } else { max_closures = kernel_data.integrator.max_closures; } /* reset closures once at the start, we will be accumulating the closures * for all volumes in the stack into a single array of closures */ sd->num_closure = 0; sd->num_closure_left = max_closures; sd->flag = 0; sd->object_flag = 0; for(int i = 0; stack[i].shader != SHADER_NONE; i++) { /* setup shaderdata from stack. it's mostly setup already in * shader_setup_from_volume, this switching should be quick */ sd->object = stack[i].object; sd->lamp = LAMP_NONE; sd->shader = stack[i].shader; sd->flag &= ~SD_SHADER_FLAGS; sd->flag |= kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*SHADER_SIZE); sd->object_flag &= ~SD_OBJECT_FLAGS; if(sd->object != OBJECT_NONE) { sd->object_flag |= kernel_tex_fetch(__object_flag, sd->object); #ifdef __OBJECT_MOTION__ /* todo: this is inefficient for motion blur, we should be * caching matrices instead of recomputing them each step */ shader_setup_object_transforms(kg, sd, sd->time); #endif } /* evaluate shader */ #ifdef __SVM__ # ifdef __OSL__ if(kg->osl) { OSLShader::eval_volume(kg, sd, state, path_flag); } else # endif { svm_eval_nodes(kg, sd, state, SHADER_TYPE_VOLUME, path_flag); } #endif /* merge closures to avoid exceeding number of closures limit */ if(i > 0) shader_merge_closures(sd); } } #endif /* __VOLUME__ */ /* Displacement Evaluation */ ccl_device void shader_eval_displacement(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state) { sd->num_closure = 0; sd->num_closure_left = 0; /* this will modify sd->P */ #ifdef __SVM__ # ifdef __OSL__ if(kg->osl) OSLShader::eval_displacement(kg, sd, state); else # endif { svm_eval_nodes(kg, sd, state, SHADER_TYPE_DISPLACEMENT, 0); } #endif } /* Transparent Shadows */ #ifdef __TRANSPARENT_SHADOWS__ ccl_device bool shader_transparent_shadow(KernelGlobals *kg, Intersection *isect) { int prim = kernel_tex_fetch(__prim_index, isect->prim); int shader = 0; #ifdef __HAIR__ if(kernel_tex_fetch(__prim_type, isect->prim) & PRIMITIVE_ALL_TRIANGLE) { #endif shader = kernel_tex_fetch(__tri_shader, prim); #ifdef __HAIR__ } else { float4 str = kernel_tex_fetch(__curves, prim); shader = __float_as_int(str.z); } #endif int flag = kernel_tex_fetch(__shader_flag, (shader & SHADER_MASK)*SHADER_SIZE); return (flag & SD_HAS_TRANSPARENT_SHADOW) != 0; } #endif /* __TRANSPARENT_SHADOWS__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_shadow.h000066400000000000000000000476021334742672700226640ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #ifdef __VOLUME__ typedef struct VolumeState { # ifdef __SPLIT_KERNEL__ # else PathState ps; # endif } VolumeState; /* Get PathState ready for use for volume stack evaluation. */ # ifdef __SPLIT_KERNEL__ ccl_addr_space # endif ccl_device_inline PathState *shadow_blocked_volume_path_state( KernelGlobals *kg, VolumeState *volume_state, ccl_addr_space PathState *state, ShaderData *sd, Ray *ray) { # ifdef __SPLIT_KERNEL__ ccl_addr_space PathState *ps = &kernel_split_state.state_shadow[ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0)]; # else PathState *ps = &volume_state->ps; # endif *ps = *state; /* We are checking for shadow on the "other" side of the surface, so need * to discard volume we are currently at. */ if(dot(sd->Ng, ray->D) < 0.0f) { kernel_volume_stack_enter_exit(kg, sd, ps->volume_stack); } return ps; } #endif /* __VOLUME__ */ /* Attenuate throughput accordingly to the given intersection event. * Returns true if the throughput is zero and traversal can be aborted. */ ccl_device_forceinline bool shadow_handle_transparent_isect( KernelGlobals *kg, ShaderData *shadow_sd, ccl_addr_space PathState *state, # ifdef __VOLUME__ ccl_addr_space struct PathState *volume_state, # endif Intersection *isect, Ray *ray, float3 *throughput) { #ifdef __VOLUME__ /* Attenuation between last surface and next surface. */ if(volume_state->volume_stack[0].shader != SHADER_NONE) { Ray segment_ray = *ray; segment_ray.t = isect->t; kernel_volume_shadow(kg, shadow_sd, volume_state, &segment_ray, throughput); } #endif /* Setup shader data at surface. */ shader_setup_from_ray(kg, shadow_sd, isect, ray); /* Attenuation from transparent surface. */ if(!(shadow_sd->flag & SD_HAS_ONLY_VOLUME)) { path_state_modify_bounce(state, true); shader_eval_surface(kg, shadow_sd, state, PATH_RAY_SHADOW); path_state_modify_bounce(state, false); *throughput *= shader_bsdf_transparency(kg, shadow_sd); } /* Stop if all light is blocked. */ if(is_zero(*throughput)) { return true; } #ifdef __VOLUME__ /* Exit/enter volume. */ kernel_volume_stack_enter_exit(kg, shadow_sd, volume_state->volume_stack); #endif return false; } /* Special version which only handles opaque shadows. */ ccl_device bool shadow_blocked_opaque(KernelGlobals *kg, ShaderData *shadow_sd, ccl_addr_space PathState *state, const uint visibility, Ray *ray, Intersection *isect, float3 *shadow) { const bool blocked = scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, isect, NULL, 0.0f, 0.0f); #ifdef __VOLUME__ if(!blocked && state->volume_stack[0].shader != SHADER_NONE) { /* Apply attenuation from current volume shader. */ kernel_volume_shadow(kg, shadow_sd, state, ray, shadow); } #endif return blocked; } #ifdef __TRANSPARENT_SHADOWS__ # ifdef __SHADOW_RECORD_ALL__ /* Shadow function to compute how much light is blocked, * * We trace a single ray. If it hits any opaque surface, or more than a given * number of transparent surfaces is hit, then we consider the geometry to be * entirely blocked. If not, all transparent surfaces will be recorded and we * will shade them one by one to determine how much light is blocked. This all * happens in one scene intersection function. * * Recording all hits works well in some cases but may be slower in others. If * we have many semi-transparent hairs, one intersection may be faster because * you'd be reinteresecting the same hairs a lot with each step otherwise. If * however there is mostly binary transparency then we may be recording many * unnecessary intersections when one of the first surfaces blocks all light. * * From tests in real scenes it seems the performance loss is either minimal, * or there is a performance increase anyway due to avoiding the need to send * two rays with transparent shadows. * * On CPU it'll handle all transparent bounces (by allocating storage for * intersections when they don't fit into the stack storage). * * On GPU it'll only handle SHADOW_STACK_MAX_HITS-1 intersections, so this * is something to be kept an eye on. */ # define SHADOW_STACK_MAX_HITS 64 /* Actual logic with traversal loop implementation which is free from device * specific tweaks. * * Note that hits array should be as big as max_hits+1. */ ccl_device bool shadow_blocked_transparent_all_loop(KernelGlobals *kg, ShaderData *sd, ShaderData *shadow_sd, ccl_addr_space PathState *state, const uint visibility, Ray *ray, Intersection *hits, uint max_hits, float3 *shadow) { /* Intersect to find an opaque surface, or record all transparent * surface hits. */ uint num_hits; const bool blocked = scene_intersect_shadow_all(kg, ray, hits, visibility, max_hits, &num_hits); # ifdef __VOLUME__ VolumeState volume_state; # endif /* If no opaque surface found but we did find transparent hits, * shade them. */ if(!blocked && num_hits > 0) { float3 throughput = make_float3(1.0f, 1.0f, 1.0f); float3 Pend = ray->P + ray->D*ray->t; float last_t = 0.0f; int bounce = state->transparent_bounce; Intersection *isect = hits; # ifdef __VOLUME__ # ifdef __SPLIT_KERNEL__ ccl_addr_space # endif PathState *ps = shadow_blocked_volume_path_state(kg, &volume_state, state, sd, ray); # endif sort_intersections(hits, num_hits); for(int hit = 0; hit < num_hits; hit++, isect++) { /* Adjust intersection distance for moving ray forward. */ float new_t = isect->t; isect->t -= last_t; /* Skip hit if we did not move forward, step by step raytracing * would have skipped it as well then. */ if(last_t == new_t) { continue; } last_t = new_t; /* Attenuate the throughput. */ if(shadow_handle_transparent_isect(kg, shadow_sd, state, #ifdef __VOLUME__ ps, #endif isect, ray, &throughput)) { return true; } /* Move ray forward. */ ray->P = shadow_sd->P; if(ray->t != FLT_MAX) { ray->D = normalize_len(Pend - ray->P, &ray->t); } bounce++; } # ifdef __VOLUME__ /* Attenuation for last line segment towards light. */ if(ps->volume_stack[0].shader != SHADER_NONE) { kernel_volume_shadow(kg, shadow_sd, ps, ray, &throughput); } # endif *shadow = throughput; return is_zero(throughput); } # ifdef __VOLUME__ if(!blocked && state->volume_stack[0].shader != SHADER_NONE) { /* Apply attenuation from current volume shader. */ # ifdef __SPLIT_KERNEL__ ccl_addr_space # endif PathState *ps = shadow_blocked_volume_path_state(kg, &volume_state, state, sd, ray); kernel_volume_shadow(kg, shadow_sd, ps, ray, shadow); } # endif return blocked; } /* Here we do all device specific trickery before invoking actual traversal * loop to help readability of the actual logic. */ ccl_device bool shadow_blocked_transparent_all(KernelGlobals *kg, ShaderData *sd, ShaderData *shadow_sd, ccl_addr_space PathState *state, const uint visibility, Ray *ray, uint max_hits, float3 *shadow) { # ifdef __SPLIT_KERNEL__ Intersection hits_[SHADOW_STACK_MAX_HITS]; Intersection *hits = &hits_[0]; # elif defined(__KERNEL_CUDA__) Intersection *hits = kg->hits_stack; # else Intersection hits_stack[SHADOW_STACK_MAX_HITS]; Intersection *hits = hits_stack; # endif # ifndef __KERNEL_GPU__ /* Prefer to use stack but use dynamic allocation if too deep max hits * we need max_hits + 1 storage space due to the logic in * scene_intersect_shadow_all which will first store and then check if * the limit is exceeded. * * Ignore this on GPU because of slow/unavailable malloc(). */ if(max_hits + 1 > SHADOW_STACK_MAX_HITS) { if(kg->transparent_shadow_intersections == NULL) { const int transparent_max_bounce = kernel_data.integrator.transparent_max_bounce; kg->transparent_shadow_intersections = (Intersection*)malloc(sizeof(Intersection)*(transparent_max_bounce + 1)); } hits = kg->transparent_shadow_intersections; } # endif /* __KERNEL_GPU__ */ /* Invoke actual traversal. */ return shadow_blocked_transparent_all_loop(kg, sd, shadow_sd, state, visibility, ray, hits, max_hits, shadow); } # endif /* __SHADOW_RECORD_ALL__ */ # if defined(__KERNEL_GPU__) || !defined(__SHADOW_RECORD_ALL__) /* Shadow function to compute how much light is blocked, * * Here we raytrace from one transparent surface to the next step by step. * To minimize overhead in cases where we don't need transparent shadows, we * first trace a regular shadow ray. We check if the hit primitive was * potentially transparent, and only in that case start marching. this gives * one extra ray cast for the cases were we do want transparency. */ /* This function is only implementing device-independent traversal logic * which requires some precalculation done. */ ccl_device bool shadow_blocked_transparent_stepped_loop( KernelGlobals *kg, ShaderData *sd, ShaderData *shadow_sd, ccl_addr_space PathState *state, const uint visibility, Ray *ray, Intersection *isect, const bool blocked, const bool is_transparent_isect, float3 *shadow) { # ifdef __VOLUME__ VolumeState volume_state; # endif if(blocked && is_transparent_isect) { float3 throughput = make_float3(1.0f, 1.0f, 1.0f); float3 Pend = ray->P + ray->D*ray->t; int bounce = state->transparent_bounce; # ifdef __VOLUME__ # ifdef __SPLIT_KERNEL__ ccl_addr_space # endif PathState *ps = shadow_blocked_volume_path_state(kg, &volume_state, state, sd, ray); # endif for(;;) { if(bounce >= kernel_data.integrator.transparent_max_bounce) { return true; } if(!scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_TRANSPARENT, isect, NULL, 0.0f, 0.0f)) { break; } if(!shader_transparent_shadow(kg, isect)) { return true; } /* Attenuate the throughput. */ if(shadow_handle_transparent_isect(kg, shadow_sd, state, #ifdef __VOLUME__ ps, #endif isect, ray, &throughput)) { return true; } /* Move ray forward. */ ray->P = ray_offset(shadow_sd->P, -shadow_sd->Ng); if(ray->t != FLT_MAX) { ray->D = normalize_len(Pend - ray->P, &ray->t); } bounce++; } # ifdef __VOLUME__ /* Attenuation for last line segment towards light. */ if(ps->volume_stack[0].shader != SHADER_NONE) { kernel_volume_shadow(kg, shadow_sd, ps, ray, &throughput); } # endif *shadow *= throughput; return is_zero(throughput); } # ifdef __VOLUME__ if(!blocked && state->volume_stack[0].shader != SHADER_NONE) { /* Apply attenuation from current volume shader. */ # ifdef __SPLIT_KERNEL__ ccl_addr_space # endif PathState *ps = shadow_blocked_volume_path_state(kg, &volume_state, state, sd, ray); kernel_volume_shadow(kg, shadow_sd, ps, ray, shadow); } # endif return blocked; } ccl_device bool shadow_blocked_transparent_stepped( KernelGlobals *kg, ShaderData *sd, ShaderData *shadow_sd, ccl_addr_space PathState *state, const uint visibility, Ray *ray, Intersection *isect, float3 *shadow) { bool blocked = scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, isect, NULL, 0.0f, 0.0f); bool is_transparent_isect = blocked ? shader_transparent_shadow(kg, isect) : false; return shadow_blocked_transparent_stepped_loop(kg, sd, shadow_sd, state, visibility, ray, isect, blocked, is_transparent_isect, shadow); } # endif /* __KERNEL_GPU__ || !__SHADOW_RECORD_ALL__ */ #endif /* __TRANSPARENT_SHADOWS__ */ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, ShaderData *sd, ShaderData *shadow_sd, ccl_addr_space PathState *state, Ray *ray_input, float3 *shadow) { Ray *ray = ray_input; Intersection isect; /* Some common early checks. */ *shadow = make_float3(1.0f, 1.0f, 1.0f); if(ray->t == 0.0f) { return false; } #ifdef __SHADOW_TRICKS__ const uint visibility = (state->flag & PATH_RAY_SHADOW_CATCHER) ? PATH_RAY_SHADOW_NON_CATCHER : PATH_RAY_SHADOW; #else const uint visibility = PATH_RAY_SHADOW; #endif /* Do actual shadow shading. */ /* First of all, we check if integrator requires transparent shadows. * if not, we use simplest and fastest ever way to calculate occlusion. */ #ifdef __TRANSPARENT_SHADOWS__ if(!kernel_data.integrator.transparent_shadows) #endif { return shadow_blocked_opaque(kg, shadow_sd, state, visibility, ray, &isect, shadow); } #ifdef __TRANSPARENT_SHADOWS__ # ifdef __SHADOW_RECORD_ALL__ /* For the transparent shadows we try to use record-all logic on the * devices which supports this. */ const int transparent_max_bounce = kernel_data.integrator.transparent_max_bounce; /* Check transparent bounces here, for volume scatter which can do * lighting before surface path termination is checked. */ if(state->transparent_bounce >= transparent_max_bounce) { return true; } const uint max_hits = transparent_max_bounce - state->transparent_bounce - 1; # ifdef __KERNEL_GPU__ /* On GPU we do trickey with tracing opaque ray first, this avoids speed * regressions in some files. * * TODO(sergey): Check why using record-all behavior causes slowdown in such * cases. Could that be caused by a higher spill pressure? */ const bool blocked = scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, &isect, NULL, 0.0f, 0.0f); const bool is_transparent_isect = blocked ? shader_transparent_shadow(kg, &isect) : false; if(!blocked || !is_transparent_isect || max_hits + 1 >= SHADOW_STACK_MAX_HITS) { return shadow_blocked_transparent_stepped_loop(kg, sd, shadow_sd, state, visibility, ray, &isect, blocked, is_transparent_isect, shadow); } # endif /* __KERNEL_GPU__ */ return shadow_blocked_transparent_all(kg, sd, shadow_sd, state, visibility, ray, max_hits, shadow); # else /* __SHADOW_RECORD_ALL__ */ /* Fallback to a slowest version which works on all devices. */ return shadow_blocked_transparent_stepped(kg, sd, shadow_sd, state, visibility, ray, &isect, shadow); # endif /* __SHADOW_RECORD_ALL__ */ #endif /* __TRANSPARENT_SHADOWS__ */ } #undef SHADOW_STACK_MAX_HITS CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_subsurface.h000066400000000000000000000376631334742672700235470ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* BSSRDF using disk based importance sampling. * * BSSRDF Importance Sampling, SIGGRAPH 2013 * http://library.imageworks.com/pdfs/imageworks-library-BSSRDF-sampling.pdf */ ccl_device_inline float3 subsurface_scatter_eval(ShaderData *sd, const ShaderClosure *sc, float disk_r, float r, bool all) { /* this is the veach one-sample model with balance heuristic, some pdf * factors drop out when using balance heuristic weighting */ float3 eval_sum = make_float3(0.0f, 0.0f, 0.0f); float pdf_sum = 0.0f; float sample_weight_inv = 0.0f; if(!all) { float sample_weight_sum = 0.0f; for(int i = 0; i < sd->num_closure; i++) { sc = &sd->closure[i]; if(CLOSURE_IS_DISK_BSSRDF(sc->type)) { sample_weight_sum += sc->sample_weight; } } sample_weight_inv = 1.0f/sample_weight_sum; } for(int i = 0; i < sd->num_closure; i++) { sc = &sd->closure[i]; if(CLOSURE_IS_DISK_BSSRDF(sc->type)) { /* in case of branched path integrate we sample all bssrdf's once, * for path trace we pick one, so adjust pdf for that */ float sample_weight = (all)? 1.0f: sc->sample_weight * sample_weight_inv; /* compute pdf */ float3 eval = bssrdf_eval(sc, r); float pdf = bssrdf_pdf(sc, disk_r); eval_sum += sc->weight * eval; pdf_sum += sample_weight * pdf; } } return (pdf_sum > 0.0f)? eval_sum / pdf_sum : make_float3(0.0f, 0.0f, 0.0f); } /* replace closures with a single diffuse bsdf closure after scatter step */ ccl_device void subsurface_scatter_setup_diffuse_bsdf(KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, float3 weight, float3 N) { sd->flag &= ~SD_CLOSURE_FLAGS; sd->num_closure = 0; sd->num_closure_left = kernel_data.integrator.max_closures; Bssrdf *bssrdf = (Bssrdf *)sc; #ifdef __PRINCIPLED__ if(bssrdf->type == CLOSURE_BSSRDF_PRINCIPLED_ID || bssrdf->type == CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID) { PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf*)bsdf_alloc(sd, sizeof(PrincipledDiffuseBsdf), weight); if(bsdf) { bsdf->N = N; bsdf->roughness = bssrdf->roughness; sd->flag |= bsdf_principled_diffuse_setup(bsdf); /* replace CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID with this special ID so render passes * can recognize it as not being a regular Disney principled diffuse closure */ bsdf->type = CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID; } } else if(CLOSURE_IS_BSDF_BSSRDF(bssrdf->type) || CLOSURE_IS_BSSRDF(bssrdf->type)) #endif /* __PRINCIPLED__ */ { DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd, sizeof(DiffuseBsdf), weight); if(bsdf) { bsdf->N = N; sd->flag |= bsdf_diffuse_setup(bsdf); /* replace CLOSURE_BSDF_DIFFUSE_ID with this special ID so render passes * can recognize it as not being a regular diffuse closure */ bsdf->type = CLOSURE_BSDF_BSSRDF_ID; } } } /* optionally do blurring of color and/or bump mapping, at the cost of a shader evaluation */ ccl_device float3 subsurface_color_pow(float3 color, float exponent) { color = max(color, make_float3(0.0f, 0.0f, 0.0f)); if(exponent == 1.0f) { /* nothing to do */ } else if(exponent == 0.5f) { color.x = sqrtf(color.x); color.y = sqrtf(color.y); color.z = sqrtf(color.z); } else { color.x = powf(color.x, exponent); color.y = powf(color.y, exponent); color.z = powf(color.z, exponent); } return color; } ccl_device void subsurface_color_bump_blur(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, float3 *eval, float3 *N) { /* average color and texture blur at outgoing point */ float texture_blur; float3 out_color = shader_bssrdf_sum(sd, NULL, &texture_blur); /* do we have bump mapping? */ bool bump = (sd->flag & SD_HAS_BSSRDF_BUMP) != 0; if(bump || texture_blur > 0.0f) { /* average color and normal at incoming point */ shader_eval_surface(kg, sd, state, state->flag); float3 in_color = shader_bssrdf_sum(sd, (bump)? N: NULL, NULL); /* we simply divide out the average color and multiply with the average * of the other one. we could try to do this per closure but it's quite * tricky to match closures between shader evaluations, their number and * order may change, this is simpler */ if(texture_blur > 0.0f) { out_color = subsurface_color_pow(out_color, texture_blur); in_color = subsurface_color_pow(in_color, texture_blur); *eval *= safe_divide_color(in_color, out_color); } } } /* Subsurface scattering step, from a point on the surface to other * nearby points on the same object. */ ccl_device_inline int subsurface_scatter_disk( KernelGlobals *kg, LocalIntersection *ss_isect, ShaderData *sd, const ShaderClosure *sc, uint *lcg_state, float disk_u, float disk_v, bool all) { /* pick random axis in local frame and point on disk */ float3 disk_N, disk_T, disk_B; float pick_pdf_N, pick_pdf_T, pick_pdf_B; disk_N = sd->Ng; make_orthonormals(disk_N, &disk_T, &disk_B); if(disk_v < 0.5f) { pick_pdf_N = 0.5f; pick_pdf_T = 0.25f; pick_pdf_B = 0.25f; disk_v *= 2.0f; } else if(disk_v < 0.75f) { float3 tmp = disk_N; disk_N = disk_T; disk_T = tmp; pick_pdf_N = 0.25f; pick_pdf_T = 0.5f; pick_pdf_B = 0.25f; disk_v = (disk_v - 0.5f)*4.0f; } else { float3 tmp = disk_N; disk_N = disk_B; disk_B = tmp; pick_pdf_N = 0.25f; pick_pdf_T = 0.25f; pick_pdf_B = 0.5f; disk_v = (disk_v - 0.75f)*4.0f; } /* sample point on disk */ float phi = M_2PI_F * disk_v; float disk_height, disk_r; bssrdf_sample(sc, disk_u, &disk_r, &disk_height); float3 disk_P = (disk_r*cosf(phi)) * disk_T + (disk_r*sinf(phi)) * disk_B; /* create ray */ #ifdef __SPLIT_KERNEL__ Ray ray_object = ss_isect->ray; Ray *ray = &ray_object; #else Ray *ray = &ss_isect->ray; #endif ray->P = sd->P + disk_N*disk_height + disk_P; ray->D = -disk_N; ray->t = 2.0f*disk_height; ray->dP = sd->dP; ray->dD = differential3_zero(); ray->time = sd->time; /* intersect with the same object. if multiple intersections are found it * will use at most BSSRDF_MAX_HITS hits, a random subset of all hits */ scene_intersect_local(kg, *ray, ss_isect, sd->object, lcg_state, BSSRDF_MAX_HITS); int num_eval_hits = min(ss_isect->num_hits, BSSRDF_MAX_HITS); for(int hit = 0; hit < num_eval_hits; hit++) { /* Quickly retrieve P and Ng without setting up ShaderData. */ float3 hit_P; if(sd->type & PRIMITIVE_TRIANGLE) { hit_P = triangle_refine_local(kg, sd, &ss_isect->hits[hit], ray); } #ifdef __OBJECT_MOTION__ else if(sd->type & PRIMITIVE_MOTION_TRIANGLE) { float3 verts[3]; motion_triangle_vertices( kg, sd->object, kernel_tex_fetch(__prim_index, ss_isect->hits[hit].prim), sd->time, verts); hit_P = motion_triangle_refine_local(kg, sd, &ss_isect->hits[hit], ray, verts); } #endif /* __OBJECT_MOTION__ */ else { ss_isect->weight[hit] = make_float3(0.0f, 0.0f, 0.0f); continue; } float3 hit_Ng = ss_isect->Ng[hit]; if(ss_isect->hits[hit].object != OBJECT_NONE) { object_normal_transform(kg, sd, &hit_Ng); } /* Probability densities for local frame axes. */ float pdf_N = pick_pdf_N * fabsf(dot(disk_N, hit_Ng)); float pdf_T = pick_pdf_T * fabsf(dot(disk_T, hit_Ng)); float pdf_B = pick_pdf_B * fabsf(dot(disk_B, hit_Ng)); /* Multiple importance sample between 3 axes, power heuristic * found to be slightly better than balance heuristic. pdf_N * in the MIS weight and denominator cancelled out. */ float w = pdf_N / (sqr(pdf_N) + sqr(pdf_T) + sqr(pdf_B)); if(ss_isect->num_hits > BSSRDF_MAX_HITS) { w *= ss_isect->num_hits/(float)BSSRDF_MAX_HITS; } /* Real distance to sampled point. */ float r = len(hit_P - sd->P); /* Evaluate profiles. */ float3 eval = subsurface_scatter_eval(sd, sc, disk_r, r, all) * w; ss_isect->weight[hit] = eval; } #ifdef __SPLIT_KERNEL__ ss_isect->ray = *ray; #endif return num_eval_hits; } ccl_device_noinline void subsurface_scatter_multi_setup( KernelGlobals *kg, LocalIntersection* ss_isect, int hit, ShaderData *sd, ccl_addr_space PathState *state, const ShaderClosure *sc) { #ifdef __SPLIT_KERNEL__ Ray ray_object = ss_isect->ray; Ray *ray = &ray_object; #else Ray *ray = &ss_isect->ray; #endif /* Workaround for AMD GPU OpenCL compiler. Most probably cache bypass issue. */ #if defined(__SPLIT_KERNEL__) && defined(__KERNEL_OPENCL_AMD__) && defined(__KERNEL_GPU__) kernel_split_params.dummy_sd_flag = sd->flag; #endif /* Setup new shading point. */ shader_setup_from_subsurface(kg, sd, &ss_isect->hits[hit], ray); /* Optionally blur colors and bump mapping. */ float3 weight = ss_isect->weight[hit]; float3 N = sd->N; subsurface_color_bump_blur(kg, sd, state, &weight, &N); /* Setup diffuse BSDF. */ subsurface_scatter_setup_diffuse_bsdf(kg, sd, sc, weight, N); } /* Random walk subsurface scattering. * * "Practical and Controllable Subsurface Scattering for Production Path * Tracing". Matt Jen-Yuan Chiang, Peter Kutz, Brent Burley. SIGGRAPH 2016. */ ccl_device void subsurface_random_walk_remap( const float A, const float d, float *sigma_t, float *sigma_s) { /* Compute attenuation and scattering coefficients from albedo. */ const float a = 1.0f - expf(A * (-5.09406f + A * (2.61188f - A * 4.31805f))); const float s = 1.9f - A + 3.5f * sqr(A - 0.8f); *sigma_t = 1.0f / fmaxf(d * s, 1e-16f); *sigma_s = *sigma_t * a; } ccl_device void subsurface_random_walk_coefficients( const ShaderClosure *sc, float3 *sigma_t, float3 *sigma_s, float3 *weight) { const Bssrdf *bssrdf = (const Bssrdf*)sc; const float3 A = bssrdf->albedo; const float3 d = bssrdf->radius; float sigma_t_x, sigma_t_y, sigma_t_z; float sigma_s_x, sigma_s_y, sigma_s_z; subsurface_random_walk_remap(A.x, d.x, &sigma_t_x, &sigma_s_x); subsurface_random_walk_remap(A.y, d.y, &sigma_t_y, &sigma_s_y); subsurface_random_walk_remap(A.z, d.z, &sigma_t_z, &sigma_s_z); *sigma_t = make_float3(sigma_t_x, sigma_t_y, sigma_t_z); *sigma_s = make_float3(sigma_s_x, sigma_s_y, sigma_s_z); /* Closure mixing and Fresnel weights separate from albedo. */ *weight = safe_divide_color(bssrdf->weight, A); } ccl_device_noinline bool subsurface_random_walk( KernelGlobals *kg, LocalIntersection *ss_isect, ShaderData *sd, ccl_addr_space PathState *state, const ShaderClosure *sc, const float bssrdf_u, const float bssrdf_v) { /* Sample diffuse surface scatter into the object. */ float3 D; float pdf; sample_cos_hemisphere(-sd->N, bssrdf_u, bssrdf_v, &D, &pdf); if(dot(-sd->Ng, D) <= 0.0f) { return 0; } /* Convert subsurface to volume coefficients. */ float3 sigma_t, sigma_s; float3 throughput = make_float3(1.0f, 1.0f, 1.0f); subsurface_random_walk_coefficients(sc, &sigma_t, &sigma_s, &throughput); /* Setup ray. */ #ifdef __SPLIT_KERNEL__ Ray ray_object = ss_isect->ray; Ray *ray = &ray_object; #else Ray *ray = &ss_isect->ray; #endif ray->P = ray_offset(sd->P, -sd->Ng); ray->D = D; ray->t = FLT_MAX; ray->time = sd->time; /* Modify state for RNGs, decorrelated from other paths. */ uint prev_rng_offset = state->rng_offset; uint prev_rng_hash = state->rng_hash; state->rng_hash = cmj_hash(state->rng_hash + state->rng_offset, 0xdeadbeef); /* Random walk until we hit the surface again. */ bool hit = false; for(int bounce = 0; bounce < BSSRDF_MAX_BOUNCES; bounce++) { /* Advance random number offset. */ state->rng_offset += PRNG_BOUNCE_NUM; if(bounce > 0) { /* Sample scattering direction. */ const float anisotropy = 0.0f; float scatter_u, scatter_v; path_state_rng_2D(kg, state, PRNG_BSDF_U, &scatter_u, &scatter_v); ray->D = henyey_greenstrein_sample(ray->D, anisotropy, scatter_u, scatter_v, NULL); } /* Sample color channel, use MIS with balance heuristic. */ float rphase = path_state_rng_1D(kg, state, PRNG_PHASE_CHANNEL); float3 albedo = safe_divide_color(sigma_s, sigma_t); float3 channel_pdf; int channel = kernel_volume_sample_channel(albedo, throughput, rphase, &channel_pdf); /* Distance sampling. */ float rdist = path_state_rng_1D(kg, state, PRNG_SCATTER_DISTANCE); float sample_sigma_t = kernel_volume_channel_get(sigma_t, channel); float t = -logf(1.0f - rdist)/sample_sigma_t; ray->t = t; scene_intersect_local(kg, *ray, ss_isect, sd->object, NULL, 1); hit = (ss_isect->num_hits > 0); if(hit) { /* Compute world space distance to surface hit. */ float3 D = ray->D; object_inverse_dir_transform(kg, sd, &D); D = normalize(D) * ss_isect->hits[0].t; object_dir_transform(kg, sd, &D); t = len(D); } /* Advance to new scatter location. */ ray->P += t * ray->D; /* Update throughput. */ float3 transmittance = volume_color_transmittance(sigma_t, t); float pdf = dot(channel_pdf, (hit)? transmittance: sigma_t * transmittance); throughput *= ((hit)? transmittance: sigma_s * transmittance) / pdf; if(hit) { /* If we hit the surface, we are done. */ break; } /* Russian roulette. */ float terminate = path_state_rng_1D(kg, state, PRNG_TERMINATE); float probability = min(max3(fabs(throughput)), 1.0f); if(terminate >= probability) { break; } throughput /= probability; } kernel_assert(isfinite_safe(throughput.x) && isfinite_safe(throughput.y) && isfinite_safe(throughput.z)); state->rng_offset = prev_rng_offset; state->rng_hash = prev_rng_hash; /* Return number of hits in ss_isect. */ if(!hit) { return 0; } /* TODO: gain back performance lost from merging with disk BSSRDF. We * only need to return on hit so this indirect ray push/pop overhead * is not actually needed, but it does keep the code simpler. */ ss_isect->weight[0] = throughput; #ifdef __SPLIT_KERNEL__ ss_isect->ray = *ray; #endif return 1; } ccl_device_inline int subsurface_scatter_multi_intersect( KernelGlobals *kg, LocalIntersection *ss_isect, ShaderData *sd, ccl_addr_space PathState *state, const ShaderClosure *sc, uint *lcg_state, float bssrdf_u, float bssrdf_v, bool all) { if(CLOSURE_IS_DISK_BSSRDF(sc->type)) { return subsurface_scatter_disk(kg, ss_isect, sd, sc, lcg_state, bssrdf_u, bssrdf_v, all); } else { return subsurface_random_walk(kg, ss_isect, sd, state, sc, bssrdf_u, bssrdf_v); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_textures.h000066400000000000000000000040651334742672700232560ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef KERNEL_TEX # define KERNEL_TEX(type, name) #endif /* bvh */ KERNEL_TEX(float4, __bvh_nodes) KERNEL_TEX(float4, __bvh_leaf_nodes) KERNEL_TEX(float4, __prim_tri_verts) KERNEL_TEX(uint, __prim_tri_index) KERNEL_TEX(uint, __prim_type) KERNEL_TEX(uint, __prim_visibility) KERNEL_TEX(uint, __prim_index) KERNEL_TEX(uint, __prim_object) KERNEL_TEX(uint, __object_node) KERNEL_TEX(float2, __prim_time) /* objects */ KERNEL_TEX(float4, __objects) KERNEL_TEX(float4, __objects_vector) /* triangles */ KERNEL_TEX(uint, __tri_shader) KERNEL_TEX(float4, __tri_vnormal) KERNEL_TEX(uint4, __tri_vindex) KERNEL_TEX(uint, __tri_patch) KERNEL_TEX(float2, __tri_patch_uv) /* curves */ KERNEL_TEX(float4, __curves) KERNEL_TEX(float4, __curve_keys) /* patches */ KERNEL_TEX(uint, __patches) /* attributes */ KERNEL_TEX(uint4, __attributes_map) KERNEL_TEX(float, __attributes_float) KERNEL_TEX(float4, __attributes_float3) KERNEL_TEX(uchar4, __attributes_uchar4) /* lights */ KERNEL_TEX(float4, __light_distribution) KERNEL_TEX(float4, __light_data) KERNEL_TEX(float2, __light_background_marginal_cdf) KERNEL_TEX(float2, __light_background_conditional_cdf) /* particles */ KERNEL_TEX(float4, __particles) /* shaders */ KERNEL_TEX(uint4, __svm_nodes) KERNEL_TEX(uint, __shader_flag) KERNEL_TEX(uint, __object_flag) /* lookup tables */ KERNEL_TEX(float, __lookup_table) /* sobol */ KERNEL_TEX(uint, __sobol_directions) /* image textures */ KERNEL_TEX(TextureInfo, __texture_info) #undef KERNEL_TEX goxel-0.8.1/ext_src/cycles/src/kernel/kernel_types.h000066400000000000000000001175661334742672700225520ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_TYPES_H__ #define __KERNEL_TYPES_H__ #include "kernel/kernel_math.h" #include "kernel/svm/svm_types.h" #include "util/util_static_assert.h" #ifndef __KERNEL_GPU__ # define __KERNEL_CPU__ #endif /* TODO(sergey): This is only to make it possible to include this header * from outside of the kernel. but this could be done somewhat cleaner? */ #ifndef ccl_addr_space # define ccl_addr_space #endif CCL_NAMESPACE_BEGIN /* Constants */ #define OBJECT_SIZE 16 #define OBJECT_VECTOR_SIZE 6 #define LIGHT_SIZE 11 #define FILTER_TABLE_SIZE 1024 #define RAMP_TABLE_SIZE 256 #define SHUTTER_TABLE_SIZE 256 #define PARTICLE_SIZE 5 #define SHADER_SIZE 5 #define BSSRDF_MIN_RADIUS 1e-8f #define BSSRDF_MAX_HITS 4 #define BSSRDF_MAX_BOUNCES 256 #define LOCAL_MAX_HITS 4 #define VOLUME_BOUNDS_MAX 1024 #define BECKMANN_TABLE_SIZE 256 #define SHADER_NONE (~0) #define OBJECT_NONE (~0) #define PRIM_NONE (~0) #define LAMP_NONE (~0) #define VOLUME_STACK_SIZE 16 /* Split kernel constants */ #define WORK_POOL_SIZE_GPU 64 #define WORK_POOL_SIZE_CPU 1 #ifdef __KERNEL_GPU__ # define WORK_POOL_SIZE WORK_POOL_SIZE_GPU #else # define WORK_POOL_SIZE WORK_POOL_SIZE_CPU #endif #define SHADER_SORT_BLOCK_SIZE 2048 #ifdef __KERNEL_OPENCL__ # define SHADER_SORT_LOCAL_SIZE 64 #elif defined(__KERNEL_CUDA__) # define SHADER_SORT_LOCAL_SIZE 32 #else # define SHADER_SORT_LOCAL_SIZE 1 #endif /* Device capabilities */ #ifdef __KERNEL_CPU__ # ifdef __KERNEL_SSE2__ # define __QBVH__ # endif # define __KERNEL_SHADING__ # define __KERNEL_ADV_SHADING__ # define __BRANCHED_PATH__ # ifdef WITH_OSL # define __OSL__ # endif # define __PRINCIPLED__ # define __SUBSURFACE__ # define __CMJ__ # define __VOLUME__ # define __VOLUME_SCATTER__ # define __SHADOW_RECORD_ALL__ # define __VOLUME_DECOUPLED__ # define __VOLUME_RECORD_ALL__ #endif /* __KERNEL_CPU__ */ #ifdef __KERNEL_CUDA__ # define __KERNEL_SHADING__ # define __KERNEL_ADV_SHADING__ # define __VOLUME__ # define __VOLUME_SCATTER__ # define __SUBSURFACE__ # define __PRINCIPLED__ # define __SHADOW_RECORD_ALL__ # define __CMJ__ # ifndef __SPLIT_KERNEL__ # define __BRANCHED_PATH__ # endif #endif /* __KERNEL_CUDA__ */ #ifdef __KERNEL_OPENCL__ /* keep __KERNEL_ADV_SHADING__ in sync with opencl_kernel_use_advanced_shading! */ # ifdef __KERNEL_OPENCL_NVIDIA__ # define __KERNEL_SHADING__ # define __KERNEL_ADV_SHADING__ # define __SUBSURFACE__ # define __PRINCIPLED__ # define __VOLUME__ # define __VOLUME_SCATTER__ # define __SHADOW_RECORD_ALL__ # define __CMJ__ # define __BRANCHED_PATH__ # endif /* __KERNEL_OPENCL_NVIDIA__ */ # ifdef __KERNEL_OPENCL_APPLE__ # define __KERNEL_SHADING__ # define __KERNEL_ADV_SHADING__ # define __PRINCIPLED__ # define __CMJ__ /* TODO(sergey): Currently experimental section is ignored here, * this is because megakernel in device_opencl does not support * custom cflags depending on the scene features. */ # endif /* __KERNEL_OPENCL_APPLE__ */ # ifdef __KERNEL_OPENCL_AMD__ # define __CL_USE_NATIVE__ # define __KERNEL_SHADING__ # define __KERNEL_ADV_SHADING__ # define __SUBSURFACE__ # define __PRINCIPLED__ # define __VOLUME__ # define __VOLUME_SCATTER__ # define __SHADOW_RECORD_ALL__ # define __CMJ__ # define __BRANCHED_PATH__ # endif /* __KERNEL_OPENCL_AMD__ */ # ifdef __KERNEL_OPENCL_INTEL_CPU__ # define __CL_USE_NATIVE__ # define __KERNEL_SHADING__ # define __KERNEL_ADV_SHADING__ # define __PRINCIPLED__ # define __CMJ__ # endif /* __KERNEL_OPENCL_INTEL_CPU__ */ #endif /* __KERNEL_OPENCL__ */ /* Kernel features */ #define __SOBOL__ #define __INSTANCING__ #define __DPDU__ #define __UV__ #define __BACKGROUND__ #define __CAUSTICS_TRICKS__ #define __VISIBILITY_FLAG__ #define __RAY_DIFFERENTIALS__ #define __CAMERA_CLIPPING__ #define __INTERSECTION_REFINE__ #define __CLAMP_SAMPLE__ #define __PATCH_EVAL__ #define __SHADOW_TRICKS__ #define __DENOISING_FEATURES__ #define __SHADER_RAYTRACE__ #ifdef __KERNEL_SHADING__ # define __SVM__ # define __EMISSION__ # define __TEXTURES__ # define __EXTRA_NODES__ # define __HOLDOUT__ #endif #ifdef __KERNEL_ADV_SHADING__ # define __MULTI_CLOSURE__ # define __TRANSPARENT_SHADOWS__ # define __PASSES__ # define __BACKGROUND_MIS__ # define __LAMP_MIS__ # define __AO__ # define __CAMERA_MOTION__ # define __OBJECT_MOTION__ # define __HAIR__ # define __BAKING__ #endif /* Scene-based selective features compilation. */ #ifdef __NO_CAMERA_MOTION__ # undef __CAMERA_MOTION__ #endif #ifdef __NO_OBJECT_MOTION__ # undef __OBJECT_MOTION__ #endif #ifdef __NO_HAIR__ # undef __HAIR__ #endif #ifdef __NO_VOLUME__ # undef __VOLUME__ # undef __VOLUME_SCATTER__ #endif #ifdef __NO_SUBSURFACE__ # undef __SUBSURFACE__ #endif #ifdef __NO_BAKING__ # undef __BAKING__ #endif #ifdef __NO_BRANCHED_PATH__ # undef __BRANCHED_PATH__ #endif #ifdef __NO_PATCH_EVAL__ # undef __PATCH_EVAL__ #endif #ifdef __NO_TRANSPARENT__ # undef __TRANSPARENT_SHADOWS__ #endif #ifdef __NO_SHADOW_TRICKS__ # undef __SHADOW_TRICKS__ #endif #ifdef __NO_PRINCIPLED__ # undef __PRINCIPLED__ #endif #ifdef __NO_DENOISING__ # undef __DENOISING_FEATURES__ #endif #ifdef __NO_SHADER_RAYTRACE__ # undef __SHADER_RAYTRACE__ #endif /* Features that enable others */ #ifdef WITH_CYCLES_DEBUG # define __KERNEL_DEBUG__ #endif #if defined(__SUBSURFACE__) || defined(__SHADER_RAYTRACE__) # define __BVH_LOCAL__ #endif /* Shader Evaluation */ typedef enum ShaderEvalType { SHADER_EVAL_DISPLACE, SHADER_EVAL_BACKGROUND, /* bake types */ SHADER_EVAL_BAKE, /* no real shade, it's used in the code to * differentiate the type of shader eval from the above */ /* data passes */ SHADER_EVAL_NORMAL, SHADER_EVAL_UV, SHADER_EVAL_DIFFUSE_COLOR, SHADER_EVAL_GLOSSY_COLOR, SHADER_EVAL_TRANSMISSION_COLOR, SHADER_EVAL_SUBSURFACE_COLOR, SHADER_EVAL_EMISSION, /* light passes */ SHADER_EVAL_AO, SHADER_EVAL_COMBINED, SHADER_EVAL_SHADOW, SHADER_EVAL_DIFFUSE, SHADER_EVAL_GLOSSY, SHADER_EVAL_TRANSMISSION, SHADER_EVAL_SUBSURFACE, /* extra */ SHADER_EVAL_ENVIRONMENT, } ShaderEvalType; /* Path Tracing * note we need to keep the u/v pairs at even values */ enum PathTraceDimension { PRNG_FILTER_U = 0, PRNG_FILTER_V = 1, PRNG_LENS_U = 2, PRNG_LENS_V = 3, PRNG_TIME = 4, PRNG_UNUSED_0 = 5, PRNG_UNUSED_1 = 6, /* for some reason (6, 7) is a bad sobol pattern */ PRNG_UNUSED_2 = 7, /* with a low number of samples (< 64) */ PRNG_BASE_NUM = 10, PRNG_BSDF_U = 0, PRNG_BSDF_V = 1, PRNG_LIGHT_U = 2, PRNG_LIGHT_V = 3, PRNG_LIGHT_TERMINATE = 4, PRNG_TERMINATE = 5, PRNG_PHASE_CHANNEL = 6, PRNG_SCATTER_DISTANCE = 7, PRNG_BOUNCE_NUM = 8, PRNG_BEVEL_U = 6, /* reuse volume dimension, correlation won't harm */ PRNG_BEVEL_V = 7, }; enum SamplingPattern { SAMPLING_PATTERN_SOBOL = 0, SAMPLING_PATTERN_CMJ = 1, SAMPLING_NUM_PATTERNS, }; /* these flags values correspond to raytypes in osl.cpp, so keep them in sync! */ enum PathRayFlag { PATH_RAY_CAMERA = (1 << 0), PATH_RAY_REFLECT = (1 << 1), PATH_RAY_TRANSMIT = (1 << 2), PATH_RAY_DIFFUSE = (1 << 3), PATH_RAY_GLOSSY = (1 << 4), PATH_RAY_SINGULAR = (1 << 5), PATH_RAY_TRANSPARENT = (1 << 6), PATH_RAY_SHADOW_OPAQUE_NON_CATCHER = (1 << 7), PATH_RAY_SHADOW_OPAQUE_CATCHER = (1 << 8), PATH_RAY_SHADOW_OPAQUE = (PATH_RAY_SHADOW_OPAQUE_NON_CATCHER|PATH_RAY_SHADOW_OPAQUE_CATCHER), PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER = (1 << 9), PATH_RAY_SHADOW_TRANSPARENT_CATCHER = (1 << 10), PATH_RAY_SHADOW_TRANSPARENT = (PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER|PATH_RAY_SHADOW_TRANSPARENT_CATCHER), PATH_RAY_SHADOW_NON_CATCHER = (PATH_RAY_SHADOW_OPAQUE_NON_CATCHER|PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER), PATH_RAY_SHADOW = (PATH_RAY_SHADOW_OPAQUE|PATH_RAY_SHADOW_TRANSPARENT), PATH_RAY_CURVE = (1 << 11), /* visibility flag to define curve segments */ PATH_RAY_VOLUME_SCATTER = (1 << 12), /* volume scattering */ /* Special flag to tag unaligned BVH nodes. */ PATH_RAY_NODE_UNALIGNED = (1 << 13), PATH_RAY_ALL_VISIBILITY = ((1 << 14)-1), /* Don't apply multiple importance sampling weights to emission from * lamp or surface hits, because they were not direct light sampled. */ PATH_RAY_MIS_SKIP = (1 << 14), /* Diffuse bounce earlier in the path, skip SSS to improve performance * and avoid branching twice with disk sampling SSS. */ PATH_RAY_DIFFUSE_ANCESTOR = (1 << 15), /* Single pass has been written. */ PATH_RAY_SINGLE_PASS_DONE = (1 << 16), /* Ray is behind a shadow catcher .*/ PATH_RAY_SHADOW_CATCHER = (1 << 17), /* Store shadow data for shadow catcher or denoising. */ PATH_RAY_STORE_SHADOW_INFO = (1 << 18), /* Zero background alpha, for camera or transparent glass rays. */ PATH_RAY_TRANSPARENT_BACKGROUND = (1 << 19), /* Terminate ray immediately at next bounce. */ PATH_RAY_TERMINATE_IMMEDIATE = (1 << 20), /* Ray is to be terminated, but continue with transparent bounces and * emission as long as we encounter them. This is required to make the * MIS between direct and indirect light rays match, as shadow rays go * through transparent surfaces to reach emisison too. */ PATH_RAY_TERMINATE_AFTER_TRANSPARENT = (1 << 21), /* Ray is to be terminated. */ PATH_RAY_TERMINATE = (PATH_RAY_TERMINATE_IMMEDIATE|PATH_RAY_TERMINATE_AFTER_TRANSPARENT), /* Path and shader is being evaluated for direct lighting emission. */ PATH_RAY_EMISSION = (1 << 22) }; /* Closure Label */ typedef enum ClosureLabel { LABEL_NONE = 0, LABEL_TRANSMIT = 1, LABEL_REFLECT = 2, LABEL_DIFFUSE = 4, LABEL_GLOSSY = 8, LABEL_SINGULAR = 16, LABEL_TRANSPARENT = 32, LABEL_VOLUME_SCATTER = 64, LABEL_TRANSMIT_TRANSPARENT = 128, } ClosureLabel; /* Render Passes */ #define PASS_NAME_JOIN(a, b) a ## _ ## b #define PASSMASK(pass) (1 << ((PASS_NAME_JOIN(PASS, pass)) % 32)) #define PASSMASK_COMPONENT(comp) (PASSMASK(PASS_NAME_JOIN(comp, DIRECT)) | \ PASSMASK(PASS_NAME_JOIN(comp, INDIRECT)) | \ PASSMASK(PASS_NAME_JOIN(comp, COLOR))) typedef enum PassType { PASS_NONE = 0, /* Main passes */ PASS_COMBINED = 1, PASS_DEPTH, PASS_NORMAL, PASS_UV, PASS_OBJECT_ID, PASS_MATERIAL_ID, PASS_MOTION, PASS_MOTION_WEIGHT, #ifdef __KERNEL_DEBUG__ PASS_BVH_TRAVERSED_NODES, PASS_BVH_TRAVERSED_INSTANCES, PASS_BVH_INTERSECTIONS, PASS_RAY_BOUNCES, #endif PASS_RENDER_TIME, PASS_CATEGORY_MAIN_END = 31, PASS_MIST = 32, PASS_EMISSION, PASS_BACKGROUND, PASS_AO, PASS_SHADOW, PASS_LIGHT, /* no real pass, used to force use_light_pass */ PASS_DIFFUSE_DIRECT, PASS_DIFFUSE_INDIRECT, PASS_DIFFUSE_COLOR, PASS_GLOSSY_DIRECT, PASS_GLOSSY_INDIRECT, PASS_GLOSSY_COLOR, PASS_TRANSMISSION_DIRECT, PASS_TRANSMISSION_INDIRECT, PASS_TRANSMISSION_COLOR, PASS_SUBSURFACE_DIRECT, PASS_SUBSURFACE_INDIRECT, PASS_SUBSURFACE_COLOR, PASS_VOLUME_DIRECT, PASS_VOLUME_INDIRECT, /* No Scatter color since it's tricky to define what it would even mean. */ PASS_CATEGORY_LIGHT_END = 63, } PassType; #define PASS_ANY (~0) typedef enum DenoisingPassOffsets { DENOISING_PASS_NORMAL = 0, DENOISING_PASS_NORMAL_VAR = 3, DENOISING_PASS_ALBEDO = 6, DENOISING_PASS_ALBEDO_VAR = 9, DENOISING_PASS_DEPTH = 12, DENOISING_PASS_DEPTH_VAR = 13, DENOISING_PASS_SHADOW_A = 14, DENOISING_PASS_SHADOW_B = 17, DENOISING_PASS_COLOR = 20, DENOISING_PASS_COLOR_VAR = 23, DENOISING_PASS_SIZE_BASE = 26, DENOISING_PASS_SIZE_CLEAN = 3, } DenoisingPassOffsets; typedef enum eBakePassFilter { BAKE_FILTER_NONE = 0, BAKE_FILTER_DIRECT = (1 << 0), BAKE_FILTER_INDIRECT = (1 << 1), BAKE_FILTER_COLOR = (1 << 2), BAKE_FILTER_DIFFUSE = (1 << 3), BAKE_FILTER_GLOSSY = (1 << 4), BAKE_FILTER_TRANSMISSION = (1 << 5), BAKE_FILTER_SUBSURFACE = (1 << 6), BAKE_FILTER_EMISSION = (1 << 7), BAKE_FILTER_AO = (1 << 8), } eBakePassFilter; typedef enum BakePassFilterCombos { BAKE_FILTER_COMBINED = ( BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT | BAKE_FILTER_DIFFUSE | BAKE_FILTER_GLOSSY | BAKE_FILTER_TRANSMISSION | BAKE_FILTER_SUBSURFACE | BAKE_FILTER_EMISSION | BAKE_FILTER_AO), BAKE_FILTER_DIFFUSE_DIRECT = (BAKE_FILTER_DIRECT | BAKE_FILTER_DIFFUSE), BAKE_FILTER_GLOSSY_DIRECT = (BAKE_FILTER_DIRECT | BAKE_FILTER_GLOSSY), BAKE_FILTER_TRANSMISSION_DIRECT = (BAKE_FILTER_DIRECT | BAKE_FILTER_TRANSMISSION), BAKE_FILTER_SUBSURFACE_DIRECT = (BAKE_FILTER_DIRECT | BAKE_FILTER_SUBSURFACE), BAKE_FILTER_DIFFUSE_INDIRECT = (BAKE_FILTER_INDIRECT | BAKE_FILTER_DIFFUSE), BAKE_FILTER_GLOSSY_INDIRECT = (BAKE_FILTER_INDIRECT | BAKE_FILTER_GLOSSY), BAKE_FILTER_TRANSMISSION_INDIRECT = (BAKE_FILTER_INDIRECT | BAKE_FILTER_TRANSMISSION), BAKE_FILTER_SUBSURFACE_INDIRECT = (BAKE_FILTER_INDIRECT | BAKE_FILTER_SUBSURFACE), } BakePassFilterCombos; typedef enum DenoiseFlag { DENOISING_CLEAN_DIFFUSE_DIR = (1 << 0), DENOISING_CLEAN_DIFFUSE_IND = (1 << 1), DENOISING_CLEAN_GLOSSY_DIR = (1 << 2), DENOISING_CLEAN_GLOSSY_IND = (1 << 3), DENOISING_CLEAN_TRANSMISSION_DIR = (1 << 4), DENOISING_CLEAN_TRANSMISSION_IND = (1 << 5), DENOISING_CLEAN_SUBSURFACE_DIR = (1 << 6), DENOISING_CLEAN_SUBSURFACE_IND = (1 << 7), DENOISING_CLEAN_ALL_PASSES = (1 << 8)-1, } DenoiseFlag; #ifdef __KERNEL_DEBUG__ /* NOTE: This is a runtime-only struct, alignment is not * really important here. */ typedef struct DebugData { int num_bvh_traversed_nodes; int num_bvh_traversed_instances; int num_bvh_intersections; int num_ray_bounces; } DebugData; #endif typedef ccl_addr_space struct PathRadianceState { #ifdef __PASSES__ float3 diffuse; float3 glossy; float3 transmission; float3 subsurface; float3 scatter; float3 direct; #endif } PathRadianceState; typedef ccl_addr_space struct PathRadiance { #ifdef __PASSES__ int use_light_pass; #endif float transparent; float3 emission; #ifdef __PASSES__ float3 background; float3 ao; float3 indirect; float3 direct_emission; float3 color_diffuse; float3 color_glossy; float3 color_transmission; float3 color_subsurface; float3 direct_diffuse; float3 direct_glossy; float3 direct_transmission; float3 direct_subsurface; float3 direct_scatter; float3 indirect_diffuse; float3 indirect_glossy; float3 indirect_transmission; float3 indirect_subsurface; float3 indirect_scatter; float4 shadow; float mist; #endif struct PathRadianceState state; #ifdef __SHADOW_TRICKS__ /* Total light reachable across the path, ignoring shadow blocked queries. */ float3 path_total; /* Total light reachable across the path with shadow blocked queries * applied here. * * Dividing this figure by path_total will give estimate of shadow pass. */ float3 path_total_shaded; /* Color of the background on which shadow is alpha-overed. */ float3 shadow_background_color; /* Path radiance sum and throughput at the moment when ray hits shadow * catcher object. */ float shadow_throughput; /* Accumulated transparency along the path after shadow catcher bounce. */ float shadow_transparency; /* Indicate if any shadow catcher data is set. */ int has_shadow_catcher; #endif #ifdef __DENOISING_FEATURES__ float3 denoising_normal; float3 denoising_albedo; float denoising_depth; #endif /* __DENOISING_FEATURES__ */ #ifdef __KERNEL_DEBUG__ DebugData debug_data; #endif /* __KERNEL_DEBUG__ */ } PathRadiance; typedef struct BsdfEval { #ifdef __PASSES__ int use_light_pass; #endif float3 diffuse; #ifdef __PASSES__ float3 glossy; float3 transmission; float3 transparent; float3 subsurface; float3 scatter; #endif #ifdef __SHADOW_TRICKS__ float3 sum_no_mis; #endif } BsdfEval; /* Shader Flag */ typedef enum ShaderFlag { SHADER_SMOOTH_NORMAL = (1 << 31), SHADER_CAST_SHADOW = (1 << 30), SHADER_AREA_LIGHT = (1 << 29), SHADER_USE_MIS = (1 << 28), SHADER_EXCLUDE_DIFFUSE = (1 << 27), SHADER_EXCLUDE_GLOSSY = (1 << 26), SHADER_EXCLUDE_TRANSMIT = (1 << 25), SHADER_EXCLUDE_CAMERA = (1 << 24), SHADER_EXCLUDE_SCATTER = (1 << 23), SHADER_EXCLUDE_ANY = (SHADER_EXCLUDE_DIFFUSE|SHADER_EXCLUDE_GLOSSY|SHADER_EXCLUDE_TRANSMIT|SHADER_EXCLUDE_CAMERA|SHADER_EXCLUDE_SCATTER), SHADER_MASK = ~(SHADER_SMOOTH_NORMAL|SHADER_CAST_SHADOW|SHADER_AREA_LIGHT|SHADER_USE_MIS|SHADER_EXCLUDE_ANY) } ShaderFlag; /* Light Type */ typedef enum LightType { LIGHT_POINT, LIGHT_DISTANT, LIGHT_BACKGROUND, LIGHT_AREA, LIGHT_SPOT, LIGHT_TRIANGLE } LightType; /* Camera Type */ enum CameraType { CAMERA_PERSPECTIVE, CAMERA_ORTHOGRAPHIC, CAMERA_PANORAMA }; /* Panorama Type */ enum PanoramaType { PANORAMA_EQUIRECTANGULAR = 0, PANORAMA_FISHEYE_EQUIDISTANT = 1, PANORAMA_FISHEYE_EQUISOLID = 2, PANORAMA_MIRRORBALL = 3, PANORAMA_NUM_TYPES, }; /* Differential */ typedef struct differential3 { float3 dx; float3 dy; } differential3; typedef struct differential { float dx; float dy; } differential; /* Ray */ typedef struct Ray { /* TODO(sergey): This is only needed because current AMD * compiler has hard time building the kernel with this * reshuffle. And at the same time reshuffle will cause * less optimal CPU code in certain places. * * We'll get rid of this nasty exception once AMD compiler * is fixed. */ #ifndef __KERNEL_OPENCL_AMD__ float3 P; /* origin */ float3 D; /* direction */ float t; /* length of the ray */ float time; /* time (for motion blur) */ #else float t; /* length of the ray */ float time; /* time (for motion blur) */ float3 P; /* origin */ float3 D; /* direction */ #endif #ifdef __RAY_DIFFERENTIALS__ differential3 dP; differential3 dD; #endif } Ray; /* Intersection */ typedef struct Intersection { float t, u, v; int prim; int object; int type; #ifdef __KERNEL_DEBUG__ int num_traversed_nodes; int num_traversed_instances; int num_intersections; #endif } Intersection; /* Primitives */ typedef enum PrimitiveType { PRIMITIVE_NONE = 0, PRIMITIVE_TRIANGLE = (1 << 0), PRIMITIVE_MOTION_TRIANGLE = (1 << 1), PRIMITIVE_CURVE = (1 << 2), PRIMITIVE_MOTION_CURVE = (1 << 3), /* Lamp primitive is not included below on purpose, * since it is no real traceable primitive. */ PRIMITIVE_LAMP = (1 << 4), PRIMITIVE_ALL_TRIANGLE = (PRIMITIVE_TRIANGLE|PRIMITIVE_MOTION_TRIANGLE), PRIMITIVE_ALL_CURVE = (PRIMITIVE_CURVE|PRIMITIVE_MOTION_CURVE), PRIMITIVE_ALL_MOTION = (PRIMITIVE_MOTION_TRIANGLE|PRIMITIVE_MOTION_CURVE), PRIMITIVE_ALL = (PRIMITIVE_ALL_TRIANGLE|PRIMITIVE_ALL_CURVE), /* Total number of different traceable primitives. * NOTE: This is an actual value, not a bitflag. */ PRIMITIVE_NUM_TOTAL = 4, } PrimitiveType; #define PRIMITIVE_PACK_SEGMENT(type, segment) ((segment << PRIMITIVE_NUM_TOTAL) | (type)) #define PRIMITIVE_UNPACK_SEGMENT(type) (type >> PRIMITIVE_NUM_TOTAL) /* Attributes */ typedef enum AttributePrimitive { ATTR_PRIM_TRIANGLE = 0, ATTR_PRIM_CURVE, ATTR_PRIM_SUBD, ATTR_PRIM_TYPES } AttributePrimitive; typedef enum AttributeElement { ATTR_ELEMENT_NONE, ATTR_ELEMENT_OBJECT, ATTR_ELEMENT_MESH, ATTR_ELEMENT_FACE, ATTR_ELEMENT_VERTEX, ATTR_ELEMENT_VERTEX_MOTION, ATTR_ELEMENT_CORNER, ATTR_ELEMENT_CORNER_BYTE, ATTR_ELEMENT_CURVE, ATTR_ELEMENT_CURVE_KEY, ATTR_ELEMENT_CURVE_KEY_MOTION, ATTR_ELEMENT_VOXEL } AttributeElement; typedef enum AttributeStandard { ATTR_STD_NONE = 0, ATTR_STD_VERTEX_NORMAL, ATTR_STD_FACE_NORMAL, ATTR_STD_UV, ATTR_STD_UV_TANGENT, ATTR_STD_UV_TANGENT_SIGN, ATTR_STD_GENERATED, ATTR_STD_GENERATED_TRANSFORM, ATTR_STD_POSITION_UNDEFORMED, ATTR_STD_POSITION_UNDISPLACED, ATTR_STD_MOTION_VERTEX_POSITION, ATTR_STD_MOTION_VERTEX_NORMAL, ATTR_STD_PARTICLE, ATTR_STD_CURVE_INTERCEPT, ATTR_STD_CURVE_RANDOM, ATTR_STD_PTEX_FACE_ID, ATTR_STD_PTEX_UV, ATTR_STD_VOLUME_DENSITY, ATTR_STD_VOLUME_COLOR, ATTR_STD_VOLUME_FLAME, ATTR_STD_VOLUME_HEAT, ATTR_STD_VOLUME_TEMPERATURE, ATTR_STD_VOLUME_VELOCITY, ATTR_STD_POINTINESS, ATTR_STD_NUM, ATTR_STD_NOT_FOUND = ~0 } AttributeStandard; typedef enum AttributeFlag { ATTR_FINAL_SIZE = (1 << 0), ATTR_SUBDIVIDED = (1 << 1), } AttributeFlag; typedef struct AttributeDescriptor { AttributeElement element; NodeAttributeType type; uint flags; /* see enum AttributeFlag */ int offset; } AttributeDescriptor; /* Closure data */ #ifdef __MULTI_CLOSURE__ # ifdef __SPLIT_KERNEL__ # define MAX_CLOSURE 1 # else # ifndef __MAX_CLOSURE__ # define MAX_CLOSURE 64 # else # define MAX_CLOSURE __MAX_CLOSURE__ # endif # endif #else # define MAX_CLOSURE 1 #endif /* This struct is the base class for all closures. The common members are * duplicated in all derived classes since we don't have C++ in the kernel * yet, and because it lets us lay out the members to minimize padding. The * weight member is located at the beginning of the struct for this reason. * * ShaderClosure has a fixed size, and any extra space must be allocated * with closure_alloc_extra(). * * We pad the struct to 80 bytes and ensure it is aligned to 16 bytes, which * we assume to be the maximum required alignment for any struct. */ #define SHADER_CLOSURE_BASE \ float3 weight; \ ClosureType type; \ float sample_weight; \ float3 N typedef ccl_addr_space struct ccl_align(16) ShaderClosure { SHADER_CLOSURE_BASE; float data[10]; /* pad to 80 bytes */ } ShaderClosure; /* Shader Data * * Main shader state at a point on the surface or in a volume. All coordinates * are in world space. */ enum ShaderDataFlag { /* Runtime flags. */ /* Set when ray hits backside of surface. */ SD_BACKFACING = (1 << 0), /* Shader has non-zero emission. */ SD_EMISSION = (1 << 1), /* Shader has BSDF closure. */ SD_BSDF = (1 << 2), /* Shader has non-singular BSDF closure. */ SD_BSDF_HAS_EVAL = (1 << 3), /* Shader has BSSRDF closure. */ SD_BSSRDF = (1 << 4), /* Shader has holdout closure. */ SD_HOLDOUT = (1 << 5), /* Shader has non-zero volume extinction. */ SD_EXTINCTION = (1 << 6), /* Shader has have volume phase (scatter) closure. */ SD_SCATTER = (1 << 7), /* Shader has AO closure. */ SD_AO = (1 << 8), /* Shader has transparent closure. */ SD_TRANSPARENT = (1 << 9), /* BSDF requires LCG for evaluation. */ SD_BSDF_NEEDS_LCG = (1 << 10), SD_CLOSURE_FLAGS = (SD_EMISSION | SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSSRDF | SD_HOLDOUT | SD_EXTINCTION | SD_SCATTER | SD_AO | SD_BSDF_NEEDS_LCG), /* Shader flags. */ /* direct light sample */ SD_USE_MIS = (1 << 16), /* Has transparent shadow. */ SD_HAS_TRANSPARENT_SHADOW = (1 << 17), /* Has volume shader. */ SD_HAS_VOLUME = (1 << 18), /* Has only volume shader, no surface. */ SD_HAS_ONLY_VOLUME = (1 << 19), /* Has heterogeneous volume. */ SD_HETEROGENEOUS_VOLUME = (1 << 20), /* BSSRDF normal uses bump. */ SD_HAS_BSSRDF_BUMP = (1 << 21), /* Use equiangular volume sampling */ SD_VOLUME_EQUIANGULAR = (1 << 22), /* Use multiple importance volume sampling. */ SD_VOLUME_MIS = (1 << 23), /* Use cubic interpolation for voxels. */ SD_VOLUME_CUBIC = (1 << 24), /* Has data connected to the displacement input or uses bump map. */ SD_HAS_BUMP = (1 << 25), /* Has true displacement. */ SD_HAS_DISPLACEMENT = (1 << 26), /* Has constant emission (value stored in __shader_flag) */ SD_HAS_CONSTANT_EMISSION = (1 << 27), /* Needs to access attributes */ SD_NEED_ATTRIBUTES = (1 << 28), SD_SHADER_FLAGS = (SD_USE_MIS | SD_HAS_TRANSPARENT_SHADOW | SD_HAS_VOLUME | SD_HAS_ONLY_VOLUME | SD_HETEROGENEOUS_VOLUME | SD_HAS_BSSRDF_BUMP | SD_VOLUME_EQUIANGULAR | SD_VOLUME_MIS | SD_VOLUME_CUBIC | SD_HAS_BUMP | SD_HAS_DISPLACEMENT | SD_HAS_CONSTANT_EMISSION | SD_NEED_ATTRIBUTES) }; /* Object flags. */ enum ShaderDataObjectFlag { /* Holdout for camera rays. */ SD_OBJECT_HOLDOUT_MASK = (1 << 0), /* Has object motion blur. */ SD_OBJECT_MOTION = (1 << 1), /* Vertices have transform applied. */ SD_OBJECT_TRANSFORM_APPLIED = (1 << 2), /* Vertices have negative scale applied. */ SD_OBJECT_NEGATIVE_SCALE_APPLIED = (1 << 3), /* Object has a volume shader. */ SD_OBJECT_HAS_VOLUME = (1 << 4), /* Object intersects AABB of an object with volume shader. */ SD_OBJECT_INTERSECTS_VOLUME = (1 << 5), /* Has position for motion vertices. */ SD_OBJECT_HAS_VERTEX_MOTION = (1 << 6), /* object is used to catch shadows */ SD_OBJECT_SHADOW_CATCHER = (1 << 7), /* object has volume attributes */ SD_OBJECT_HAS_VOLUME_ATTRIBUTES = (1 << 8), SD_OBJECT_FLAGS = (SD_OBJECT_HOLDOUT_MASK | SD_OBJECT_MOTION | SD_OBJECT_TRANSFORM_APPLIED | SD_OBJECT_NEGATIVE_SCALE_APPLIED | SD_OBJECT_HAS_VOLUME | SD_OBJECT_INTERSECTS_VOLUME | SD_OBJECT_SHADOW_CATCHER | SD_OBJECT_HAS_VOLUME_ATTRIBUTES) }; typedef ccl_addr_space struct ShaderData { /* position */ float3 P; /* smooth normal for shading */ float3 N; /* true geometric normal */ float3 Ng; /* view/incoming direction */ float3 I; /* shader id */ int shader; /* booleans describing shader, see ShaderDataFlag */ int flag; /* booleans describing object of the shader, see ShaderDataObjectFlag */ int object_flag; /* primitive id if there is one, ~0 otherwise */ int prim; /* combined type and curve segment for hair */ int type; /* parametric coordinates * - barycentric weights for triangles */ float u; float v; /* object id if there is one, ~0 otherwise */ int object; /* lamp id if there is one, ~0 otherwise */ int lamp; /* motion blur sample time */ float time; /* length of the ray being shaded */ float ray_length; #ifdef __RAY_DIFFERENTIALS__ /* differential of P. these are orthogonal to Ng, not N */ differential3 dP; /* differential of I */ differential3 dI; /* differential of u, v */ differential du; differential dv; #endif #ifdef __DPDU__ /* differential of P w.r.t. parametric coordinates. note that dPdu is * not readily suitable as a tangent for shading on triangles. */ float3 dPdu; float3 dPdv; #endif #ifdef __OBJECT_MOTION__ /* object <-> world space transformations, cached to avoid * re-interpolating them constantly for shading */ Transform ob_tfm; Transform ob_itfm; #endif /* ray start position, only set for backgrounds */ float3 ray_P; differential3 ray_dP; #ifdef __OSL__ struct KernelGlobals *osl_globals; struct PathState *osl_path_state; #endif /* LCG state for closures that require additional random numbers. */ uint lcg_state; /* Closure data, we store a fixed array of closures */ int num_closure; int num_closure_left; float randb_closure; float3 svm_closure_weight; /* Closure weights summed directly, so we can evaluate * emission and shadow transparency with MAX_CLOSURE 0. */ float3 closure_emission_background; float3 closure_transparent_extinction; /* At the end so we can adjust size in ShaderDataTinyStorage. */ struct ShaderClosure closure[MAX_CLOSURE]; } ShaderData; typedef ccl_addr_space struct ShaderDataTinyStorage { char pad[sizeof(ShaderData) - sizeof(ShaderClosure) * MAX_CLOSURE]; } ShaderDataTinyStorage; #define AS_SHADER_DATA(shader_data_tiny_storage) ((ShaderData*)shader_data_tiny_storage) /* Path State */ #ifdef __VOLUME__ typedef struct VolumeStack { int object; int shader; } VolumeStack; #endif typedef struct PathState { /* see enum PathRayFlag */ int flag; /* random number generator state */ uint rng_hash; /* per pixel hash */ int rng_offset; /* dimension offset */ int sample; /* path sample number */ int num_samples; /* total number of times this path will be sampled */ float branch_factor; /* number of branches in indirect paths */ /* bounce counting */ int bounce; int diffuse_bounce; int glossy_bounce; int transmission_bounce; int transparent_bounce; #ifdef __DENOISING_FEATURES__ float denoising_feature_weight; #endif /* __DENOISING_FEATURES__ */ /* multiple importance sampling */ float min_ray_pdf; /* smallest bounce pdf over entire path up to now */ float ray_pdf; /* last bounce pdf */ #ifdef __LAMP_MIS__ float ray_t; /* accumulated distance through transparent surfaces */ #endif /* volume rendering */ #ifdef __VOLUME__ int volume_bounce; int volume_bounds_bounce; uint rng_congruential; VolumeStack volume_stack[VOLUME_STACK_SIZE]; #endif } PathState; /* Struct to gather multiple nearby intersections. */ typedef struct LocalIntersection { Ray ray; float3 weight[LOCAL_MAX_HITS]; int num_hits; struct Intersection hits[LOCAL_MAX_HITS]; float3 Ng[LOCAL_MAX_HITS]; } LocalIntersection; /* Subsurface */ /* Struct to gather SSS indirect rays and delay tracing them. */ typedef struct SubsurfaceIndirectRays { PathState state[BSSRDF_MAX_HITS]; int num_rays; struct Ray rays[BSSRDF_MAX_HITS]; float3 throughputs[BSSRDF_MAX_HITS]; struct PathRadianceState L_state[BSSRDF_MAX_HITS]; } SubsurfaceIndirectRays; static_assert(BSSRDF_MAX_HITS <= LOCAL_MAX_HITS, "BSSRDF hits too high."); /* Constant Kernel Data * * These structs are passed from CPU to various devices, and the struct layout * must match exactly. Structs are padded to ensure 16 byte alignment, and we * do not use float3 because its size may not be the same on all devices. */ typedef struct KernelCamera { /* type */ int type; /* panorama */ int panorama_type; float fisheye_fov; float fisheye_lens; float4 equirectangular_range; /* stereo */ float interocular_offset; float convergence_distance; float pole_merge_angle_from; float pole_merge_angle_to; /* matrices */ Transform cameratoworld; Transform rastertocamera; /* differentials */ float4 dx; float4 dy; /* depth of field */ float aperturesize; float blades; float bladesrotation; float focaldistance; /* motion blur */ float shuttertime; int have_motion, have_perspective_motion; /* clipping */ float nearclip; float cliplength; /* sensor size */ float sensorwidth; float sensorheight; /* render size */ float width, height; int resolution; /* anamorphic lens bokeh */ float inv_aperture_ratio; int is_inside_volume; /* more matrices */ Transform screentoworld; Transform rastertoworld; /* work around cuda sm 2.0 crash, this seems to * cross some limit in combination with motion * Transform ndctoworld; */ Transform worldtoscreen; Transform worldtoraster; Transform worldtondc; Transform worldtocamera; MotionTransform motion; /* Denotes changes in the projective matrix, namely in rastertocamera. * Used for camera zoom motion blur, */ PerspectiveMotionTransform perspective_motion; int shutter_table_offset; /* Rolling shutter */ int rolling_shutter_type; float rolling_shutter_duration; int pad; } KernelCamera; static_assert_align(KernelCamera, 16); typedef struct KernelFilm { float exposure; int pass_flag; int light_pass_flag; int pass_stride; int use_light_pass; int pass_combined; int pass_depth; int pass_normal; int pass_motion; int pass_motion_weight; int pass_uv; int pass_object_id; int pass_material_id; int pass_diffuse_color; int pass_glossy_color; int pass_transmission_color; int pass_subsurface_color; int pass_diffuse_indirect; int pass_glossy_indirect; int pass_transmission_indirect; int pass_subsurface_indirect; int pass_volume_indirect; int pass_diffuse_direct; int pass_glossy_direct; int pass_transmission_direct; int pass_subsurface_direct; int pass_volume_direct; int pass_emission; int pass_background; int pass_ao; float pass_alpha_threshold; int pass_shadow; float pass_shadow_scale; int filter_table_offset; int pass_mist; float mist_start; float mist_inv_depth; float mist_falloff; int pass_denoising_data; int pass_denoising_clean; int denoising_flags; int pad1, pad2, pad3; #ifdef __KERNEL_DEBUG__ int pass_bvh_traversed_nodes; int pass_bvh_traversed_instances; int pass_bvh_intersections; int pass_ray_bounces; #endif } KernelFilm; static_assert_align(KernelFilm, 16); typedef struct KernelBackground { /* only shader index */ int surface_shader; int volume_shader; int transparent; float transparent_roughness_squared_threshold; /* ambient occlusion */ float ao_factor; float ao_distance; float ao_bounces_factor; float ao_pad; } KernelBackground; static_assert_align(KernelBackground, 16); typedef struct KernelIntegrator { /* emission */ int use_direct_light; int use_ambient_occlusion; int num_distribution; int num_all_lights; float pdf_triangles; float pdf_lights; int pdf_background_res; float light_inv_rr_threshold; /* light portals */ float portal_pdf; int num_portals; int portal_offset; /* bounces */ int max_bounce; int max_diffuse_bounce; int max_glossy_bounce; int max_transmission_bounce; int max_volume_bounce; int ao_bounces; /* transparent */ int transparent_max_bounce; int transparent_shadows; /* caustics */ int caustics_reflective; int caustics_refractive; float filter_glossy; /* seed */ int seed; /* clamp */ float sample_clamp_direct; float sample_clamp_indirect; /* branched path */ int branched; int volume_decoupled; int diffuse_samples; int glossy_samples; int transmission_samples; int ao_samples; int mesh_light_samples; int subsurface_samples; int sample_all_lights_direct; int sample_all_lights_indirect; /* mis */ int use_lamp_mis; /* sampler */ int sampling_pattern; int aa_samples; /* volume render */ int use_volumes; int volume_max_steps; float volume_step_size; int volume_samples; int start_sample; int max_closures; } KernelIntegrator; static_assert_align(KernelIntegrator, 16); typedef enum KernelBVHLayout { BVH_LAYOUT_NONE = 0, BVH_LAYOUT_BVH2 = (1 << 0), BVH_LAYOUT_BVH4 = (1 << 1), BVH_LAYOUT_DEFAULT = BVH_LAYOUT_BVH4, BVH_LAYOUT_ALL = (unsigned int)(-1), } KernelBVHLayout; typedef struct KernelBVH { /* root node */ int root; int have_motion; int have_curves; int have_instancing; int bvh_layout; int use_bvh_steps; int pad1, pad2; } KernelBVH; static_assert_align(KernelBVH, 16); typedef enum CurveFlag { /* runtime flags */ CURVE_KN_BACKFACING = 1, /* backside of cylinder? */ CURVE_KN_ENCLOSEFILTER = 2, /* don't consider strands surrounding start point? */ CURVE_KN_INTERPOLATE = 4, /* render as a curve? */ CURVE_KN_ACCURATE = 8, /* use accurate intersections test? */ CURVE_KN_INTERSECTCORRECTION = 16, /* correct for width after determing closest midpoint? */ CURVE_KN_TRUETANGENTGNORMAL = 32, /* use tangent normal for geometry? */ CURVE_KN_RIBBONS = 64, /* use flat curve ribbons */ } CurveFlag; typedef struct KernelCurves { int curveflags; int subdivisions; float minimum_width; float maximum_width; } KernelCurves; static_assert_align(KernelCurves, 16); typedef struct KernelTables { int beckmann_offset; int pad1, pad2, pad3; } KernelTables; static_assert_align(KernelTables, 16); typedef struct KernelData { KernelCamera cam; KernelFilm film; KernelBackground background; KernelIntegrator integrator; KernelBVH bvh; KernelCurves curve; KernelTables tables; } KernelData; static_assert_align(KernelData, 16); /* Declarations required for split kernel */ /* Macro for queues */ /* Value marking queue's empty slot */ #define QUEUE_EMPTY_SLOT -1 /* * Queue 1 - Active rays * Queue 2 - Background queue * Queue 3 - Shadow ray cast kernel - AO * Queeu 4 - Shadow ray cast kernel - direct lighting */ /* Queue names */ enum QueueNumber { /* All active rays and regenerated rays are enqueued here. */ QUEUE_ACTIVE_AND_REGENERATED_RAYS = 0, /* All * 1. Background-hit rays, * 2. Rays that has exited path-iteration but needs to update output buffer * 3. Rays to be regenerated * are enqueued here. */ QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, /* All rays for which a shadow ray should be cast to determine radiance * contribution for AO are enqueued here. */ QUEUE_SHADOW_RAY_CAST_AO_RAYS, /* All rays for which a shadow ray should be cast to determine radiance * contributing for direct lighting are enqueued here. */ QUEUE_SHADOW_RAY_CAST_DL_RAYS, /* Rays sorted according to shader->id */ QUEUE_SHADER_SORTED_RAYS, #ifdef __BRANCHED_PATH__ /* All rays moving to next iteration of the indirect loop for light */ QUEUE_LIGHT_INDIRECT_ITER, /* Queue of all inactive rays. These are candidates for sharing work of indirect loops */ QUEUE_INACTIVE_RAYS, # ifdef __VOLUME__ /* All rays moving to next iteration of the indirect loop for volumes */ QUEUE_VOLUME_INDIRECT_ITER, # endif # ifdef __SUBSURFACE__ /* All rays moving to next iteration of the indirect loop for subsurface */ QUEUE_SUBSURFACE_INDIRECT_ITER, # endif #endif /* __BRANCHED_PATH__ */ NUM_QUEUES }; /* We use RAY_STATE_MASK to get ray_state */ #define RAY_STATE_MASK 0x0F #define RAY_FLAG_MASK 0xF0 enum RayState { RAY_INVALID = 0, /* Denotes ray is actively involved in path-iteration. */ RAY_ACTIVE, /* Denotes ray has completed processing all samples and is inactive. */ RAY_INACTIVE, /* Denotes ray has exited path-iteration and needs to update output buffer. */ RAY_UPDATE_BUFFER, /* Denotes ray needs to skip most surface shader work. */ RAY_HAS_ONLY_VOLUME, /* Donotes ray has hit background */ RAY_HIT_BACKGROUND, /* Denotes ray has to be regenerated */ RAY_TO_REGENERATE, /* Denotes ray has been regenerated */ RAY_REGENERATED, /* Denotes ray is moving to next iteration of the branched indirect loop */ RAY_LIGHT_INDIRECT_NEXT_ITER, RAY_VOLUME_INDIRECT_NEXT_ITER, RAY_SUBSURFACE_INDIRECT_NEXT_ITER, /* Ray flags */ /* Flags to denote that the ray is currently evaluating the branched indirect loop */ RAY_BRANCHED_LIGHT_INDIRECT = (1 << 4), RAY_BRANCHED_VOLUME_INDIRECT = (1 << 5), RAY_BRANCHED_SUBSURFACE_INDIRECT = (1 << 6), RAY_BRANCHED_INDIRECT = (RAY_BRANCHED_LIGHT_INDIRECT | RAY_BRANCHED_VOLUME_INDIRECT | RAY_BRANCHED_SUBSURFACE_INDIRECT), /* Ray is evaluating an iteration of an indirect loop for another thread */ RAY_BRANCHED_INDIRECT_SHARED = (1 << 7), }; #define ASSIGN_RAY_STATE(ray_state, ray_index, state) (ray_state[ray_index] = ((ray_state[ray_index] & RAY_FLAG_MASK) | state)) #define IS_STATE(ray_state, ray_index, state) ((ray_index) != QUEUE_EMPTY_SLOT && ((ray_state)[(ray_index)] & RAY_STATE_MASK) == (state)) #define ADD_RAY_FLAG(ray_state, ray_index, flag) (ray_state[ray_index] = (ray_state[ray_index] | flag)) #define REMOVE_RAY_FLAG(ray_state, ray_index, flag) (ray_state[ray_index] = (ray_state[ray_index] & (~flag))) #define IS_FLAG(ray_state, ray_index, flag) (ray_state[ray_index] & flag) /* Patches */ #define PATCH_MAX_CONTROL_VERTS 16 /* Patch map node flags */ #define PATCH_MAP_NODE_IS_SET (1 << 30) #define PATCH_MAP_NODE_IS_LEAF (1u << 31) #define PATCH_MAP_NODE_INDEX_MASK (~(PATCH_MAP_NODE_IS_SET | PATCH_MAP_NODE_IS_LEAF)) /* Work Tiles */ typedef struct WorkTile { uint x, y, w, h; uint start_sample; uint num_samples; uint offset; uint stride; ccl_global float *buffer; } WorkTile; CCL_NAMESPACE_END #endif /* __KERNEL_TYPES_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernel_volume.h000066400000000000000000001251541334742672700227050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Events for probalistic scattering */ typedef enum VolumeIntegrateResult { VOLUME_PATH_SCATTERED = 0, VOLUME_PATH_ATTENUATED = 1, VOLUME_PATH_MISSED = 2 } VolumeIntegrateResult; /* Volume shader properties * * extinction coefficient = absorption coefficient + scattering coefficient * sigma_t = sigma_a + sigma_s */ typedef struct VolumeShaderCoefficients { float3 sigma_t; float3 sigma_s; float3 emission; } VolumeShaderCoefficients; #ifdef __VOLUME__ /* evaluate shader to get extinction coefficient at P */ ccl_device_inline bool volume_shader_extinction_sample(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, float3 P, float3 *extinction) { sd->P = P; shader_eval_volume(kg, sd, state, state->volume_stack, PATH_RAY_SHADOW); if(sd->flag & SD_EXTINCTION) { *extinction = sd->closure_transparent_extinction; return true; } else { return false; } } /* evaluate shader to get absorption, scattering and emission at P */ ccl_device_inline bool volume_shader_sample(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, float3 P, VolumeShaderCoefficients *coeff) { sd->P = P; shader_eval_volume(kg, sd, state, state->volume_stack, state->flag); if(!(sd->flag & (SD_EXTINCTION|SD_SCATTER|SD_EMISSION))) return false; coeff->sigma_s = make_float3(0.0f, 0.0f, 0.0f); coeff->sigma_t = (sd->flag & SD_EXTINCTION)? sd->closure_transparent_extinction: make_float3(0.0f, 0.0f, 0.0f); coeff->emission = (sd->flag & SD_EMISSION)? sd->closure_emission_background: make_float3(0.0f, 0.0f, 0.0f); if(sd->flag & SD_SCATTER) { for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(CLOSURE_IS_VOLUME(sc->type)) coeff->sigma_s += sc->weight; } } return true; } #endif /* __VOLUME__ */ ccl_device float3 volume_color_transmittance(float3 sigma, float t) { return make_float3(expf(-sigma.x * t), expf(-sigma.y * t), expf(-sigma.z * t)); } ccl_device float kernel_volume_channel_get(float3 value, int channel) { return (channel == 0)? value.x: ((channel == 1)? value.y: value.z); } #ifdef __VOLUME__ ccl_device bool volume_stack_is_heterogeneous(KernelGlobals *kg, ccl_addr_space VolumeStack *stack) { for(int i = 0; stack[i].shader != SHADER_NONE; i++) { int shader_flag = kernel_tex_fetch(__shader_flag, (stack[i].shader & SHADER_MASK)*SHADER_SIZE); if(shader_flag & SD_HETEROGENEOUS_VOLUME) { return true; } else if(shader_flag & SD_NEED_ATTRIBUTES) { /* We want to render world or objects without any volume grids * as homogenous, but can only verify this at runtime since other * heterogenous volume objects may be using the same shader. */ int object = stack[i].object; if(object != OBJECT_NONE) { int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_OBJECT_HAS_VOLUME_ATTRIBUTES) { return true; } } } } return false; } ccl_device int volume_stack_sampling_method(KernelGlobals *kg, VolumeStack *stack) { if(kernel_data.integrator.num_all_lights == 0) return 0; int method = -1; for(int i = 0; stack[i].shader != SHADER_NONE; i++) { int shader_flag = kernel_tex_fetch(__shader_flag, (stack[i].shader & SHADER_MASK)*SHADER_SIZE); if(shader_flag & SD_VOLUME_MIS) { return SD_VOLUME_MIS; } else if(shader_flag & SD_VOLUME_EQUIANGULAR) { if(method == 0) return SD_VOLUME_MIS; method = SD_VOLUME_EQUIANGULAR; } else { if(method == SD_VOLUME_EQUIANGULAR) return SD_VOLUME_MIS; method = 0; } } return method; } /* Volume Shadows * * These functions are used to attenuate shadow rays to lights. Both absorption * and scattering will block light, represented by the extinction coefficient. */ /* homogeneous volume: assume shader evaluation at the starts gives * the extinction coefficient for the entire line segment */ ccl_device void kernel_volume_shadow_homogeneous(KernelGlobals *kg, ccl_addr_space PathState *state, Ray *ray, ShaderData *sd, float3 *throughput) { float3 sigma_t; if(volume_shader_extinction_sample(kg, sd, state, ray->P, &sigma_t)) *throughput *= volume_color_transmittance(sigma_t, ray->t); } /* heterogeneous volume: integrate stepping through the volume until we * reach the end, get absorbed entirely, or run out of iterations */ ccl_device void kernel_volume_shadow_heterogeneous(KernelGlobals *kg, ccl_addr_space PathState *state, Ray *ray, ShaderData *sd, float3 *throughput) { float3 tp = *throughput; const float tp_eps = 1e-6f; /* todo: this is likely not the right value */ /* prepare for stepping */ int max_steps = kernel_data.integrator.volume_max_steps; float step = kernel_data.integrator.volume_step_size; float random_jitter_offset = lcg_step_float_addrspace(&state->rng_congruential) * step; /* compute extinction at the start */ float t = 0.0f; float3 sum = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < max_steps; i++) { /* advance to new position */ float new_t = min(ray->t, (i+1) * step); float dt = new_t - t; /* use random position inside this segment to sample shader */ if(new_t == ray->t) random_jitter_offset = lcg_step_float_addrspace(&state->rng_congruential) * dt; float3 new_P = ray->P + ray->D * (t + random_jitter_offset); float3 sigma_t; /* compute attenuation over segment */ if(volume_shader_extinction_sample(kg, sd, state, new_P, &sigma_t)) { /* Compute expf() only for every Nth step, to save some calculations * because exp(a)*exp(b) = exp(a+b), also do a quick tp_eps check then. */ sum += (-sigma_t * (new_t - t)); if((i & 0x07) == 0) { /* ToDo: Other interval? */ tp = *throughput * make_float3(expf(sum.x), expf(sum.y), expf(sum.z)); /* stop if nearly all light is blocked */ if(tp.x < tp_eps && tp.y < tp_eps && tp.z < tp_eps) break; } } /* stop if at the end of the volume */ t = new_t; if(t == ray->t) { /* Update throughput in case we haven't done it above */ tp = *throughput * make_float3(expf(sum.x), expf(sum.y), expf(sum.z)); break; } } *throughput = tp; } /* get the volume attenuation over line segment defined by ray, with the * assumption that there are no surfaces blocking light between the endpoints */ ccl_device_noinline void kernel_volume_shadow(KernelGlobals *kg, ShaderData *shadow_sd, ccl_addr_space PathState *state, Ray *ray, float3 *throughput) { shader_setup_from_volume(kg, shadow_sd, ray); if(volume_stack_is_heterogeneous(kg, state->volume_stack)) kernel_volume_shadow_heterogeneous(kg, state, ray, shadow_sd, throughput); else kernel_volume_shadow_homogeneous(kg, state, ray, shadow_sd, throughput); } #endif /* __VOLUME__ */ /* Equi-angular sampling as in: * "Importance Sampling Techniques for Path Tracing in Participating Media" */ ccl_device float kernel_volume_equiangular_sample(Ray *ray, float3 light_P, float xi, float *pdf) { float t = ray->t; float delta = dot((light_P - ray->P) , ray->D); float D = safe_sqrtf(len_squared(light_P - ray->P) - delta * delta); if(UNLIKELY(D == 0.0f)) { *pdf = 0.0f; return 0.0f; } float theta_a = -atan2f(delta, D); float theta_b = atan2f(t - delta, D); float t_ = D * tanf((xi * theta_b) + (1 - xi) * theta_a); if(UNLIKELY(theta_b == theta_a)) { *pdf = 0.0f; return 0.0f; } *pdf = D / ((theta_b - theta_a) * (D * D + t_ * t_)); return min(t, delta + t_); /* min is only for float precision errors */ } ccl_device float kernel_volume_equiangular_pdf(Ray *ray, float3 light_P, float sample_t) { float delta = dot((light_P - ray->P) , ray->D); float D = safe_sqrtf(len_squared(light_P - ray->P) - delta * delta); if(UNLIKELY(D == 0.0f)) { return 0.0f; } float t = ray->t; float t_ = sample_t - delta; float theta_a = -atan2f(delta, D); float theta_b = atan2f(t - delta, D); if(UNLIKELY(theta_b == theta_a)) { return 0.0f; } float pdf = D / ((theta_b - theta_a) * (D * D + t_ * t_)); return pdf; } /* Distance sampling */ ccl_device float kernel_volume_distance_sample(float max_t, float3 sigma_t, int channel, float xi, float3 *transmittance, float3 *pdf) { /* xi is [0, 1[ so log(0) should never happen, division by zero is * avoided because sample_sigma_t > 0 when SD_SCATTER is set */ float sample_sigma_t = kernel_volume_channel_get(sigma_t, channel); float3 full_transmittance = volume_color_transmittance(sigma_t, max_t); float sample_transmittance = kernel_volume_channel_get(full_transmittance, channel); float sample_t = min(max_t, -logf(1.0f - xi*(1.0f - sample_transmittance))/sample_sigma_t); *transmittance = volume_color_transmittance(sigma_t, sample_t); *pdf = safe_divide_color(sigma_t * *transmittance, make_float3(1.0f, 1.0f, 1.0f) - full_transmittance); /* todo: optimization: when taken together with hit/miss decision, * the full_transmittance cancels out drops out and xi does not * need to be remapped */ return sample_t; } ccl_device float3 kernel_volume_distance_pdf(float max_t, float3 sigma_t, float sample_t) { float3 full_transmittance = volume_color_transmittance(sigma_t, max_t); float3 transmittance = volume_color_transmittance(sigma_t, sample_t); return safe_divide_color(sigma_t * transmittance, make_float3(1.0f, 1.0f, 1.0f) - full_transmittance); } /* Emission */ ccl_device float3 kernel_volume_emission_integrate(VolumeShaderCoefficients *coeff, int closure_flag, float3 transmittance, float t) { /* integral E * exp(-sigma_t * t) from 0 to t = E * (1 - exp(-sigma_t * t))/sigma_t * this goes to E * t as sigma_t goes to zero * * todo: we should use an epsilon to avoid precision issues near zero sigma_t */ float3 emission = coeff->emission; if(closure_flag & SD_EXTINCTION) { float3 sigma_t = coeff->sigma_t; emission.x *= (sigma_t.x > 0.0f)? (1.0f - transmittance.x)/sigma_t.x: t; emission.y *= (sigma_t.y > 0.0f)? (1.0f - transmittance.y)/sigma_t.y: t; emission.z *= (sigma_t.z > 0.0f)? (1.0f - transmittance.z)/sigma_t.z: t; } else emission *= t; return emission; } /* Volume Path */ ccl_device int kernel_volume_sample_channel(float3 albedo, float3 throughput, float rand, float3 *pdf) { /* Sample color channel proportional to throughput and single scattering * albedo, to significantly reduce noise with many bounce, following: * * "Practical and Controllable Subsurface Scattering for Production Path * Tracing". Matt Jen-Yuan Chiang, Peter Kutz, Brent Burley. SIGGRAPH 2016. */ float3 weights = fabs(throughput * albedo); float sum_weights = weights.x + weights.y + weights.z; if(sum_weights > 0.0f) { *pdf = weights/sum_weights; } else { *pdf = make_float3(1.0f/3.0f, 1.0f/3.0f, 1.0f/3.0f); } if(rand < pdf->x) { return 0; } else if(rand < pdf->x + pdf->y) { return 1; } else { return 2; } } #ifdef __VOLUME__ /* homogeneous volume: assume shader evaluation at the start gives * the volume shading coefficient for the entire line segment */ ccl_device VolumeIntegrateResult kernel_volume_integrate_homogeneous( KernelGlobals *kg, ccl_addr_space PathState *state, Ray *ray, ShaderData *sd, PathRadiance *L, ccl_addr_space float3 *throughput, bool probalistic_scatter) { VolumeShaderCoefficients coeff; if(!volume_shader_sample(kg, sd, state, ray->P, &coeff)) return VOLUME_PATH_MISSED; int closure_flag = sd->flag; float t = ray->t; float3 new_tp; #ifdef __VOLUME_SCATTER__ /* randomly scatter, and if we do t is shortened */ if(closure_flag & SD_SCATTER) { /* Sample channel, use MIS with balance heuristic. */ float rphase = path_state_rng_1D(kg, state, PRNG_PHASE_CHANNEL); float3 albedo = safe_divide_color(coeff.sigma_s, coeff.sigma_t); float3 channel_pdf; int channel = kernel_volume_sample_channel(albedo, *throughput, rphase, &channel_pdf); /* decide if we will hit or miss */ bool scatter = true; float xi = path_state_rng_1D(kg, state, PRNG_SCATTER_DISTANCE); if(probalistic_scatter) { float sample_sigma_t = kernel_volume_channel_get(coeff.sigma_t, channel); float sample_transmittance = expf(-sample_sigma_t * t); if(1.0f - xi >= sample_transmittance) { scatter = true; /* rescale random number so we can reuse it */ xi = 1.0f - (1.0f - xi - sample_transmittance)/(1.0f - sample_transmittance); } else scatter = false; } if(scatter) { /* scattering */ float3 pdf; float3 transmittance; float sample_t; /* distance sampling */ sample_t = kernel_volume_distance_sample(ray->t, coeff.sigma_t, channel, xi, &transmittance, &pdf); /* modify pdf for hit/miss decision */ if(probalistic_scatter) pdf *= make_float3(1.0f, 1.0f, 1.0f) - volume_color_transmittance(coeff.sigma_t, t); new_tp = *throughput * coeff.sigma_s * transmittance / dot(channel_pdf, pdf); t = sample_t; } else { /* no scattering */ float3 transmittance = volume_color_transmittance(coeff.sigma_t, t); float pdf = dot(channel_pdf, transmittance); new_tp = *throughput * transmittance / pdf; } } else #endif if(closure_flag & SD_EXTINCTION) { /* absorption only, no sampling needed */ float3 transmittance = volume_color_transmittance(coeff.sigma_t, t); new_tp = *throughput * transmittance; } /* integrate emission attenuated by extinction */ if(L && (closure_flag & SD_EMISSION)) { float3 transmittance = volume_color_transmittance(coeff.sigma_t, ray->t); float3 emission = kernel_volume_emission_integrate(&coeff, closure_flag, transmittance, ray->t); path_radiance_accum_emission(L, state, *throughput, emission); } /* modify throughput */ if(closure_flag & SD_EXTINCTION) { *throughput = new_tp; /* prepare to scatter to new direction */ if(t < ray->t) { /* adjust throughput and move to new location */ sd->P = ray->P + t*ray->D; return VOLUME_PATH_SCATTERED; } } return VOLUME_PATH_ATTENUATED; } /* heterogeneous volume distance sampling: integrate stepping through the * volume until we reach the end, get absorbed entirely, or run out of * iterations. this does probabilistically scatter or get transmitted through * for path tracing where we don't want to branch. */ ccl_device VolumeIntegrateResult kernel_volume_integrate_heterogeneous_distance( KernelGlobals *kg, ccl_addr_space PathState *state, Ray *ray, ShaderData *sd, PathRadiance *L, ccl_addr_space float3 *throughput) { float3 tp = *throughput; const float tp_eps = 1e-6f; /* todo: this is likely not the right value */ /* prepare for stepping */ int max_steps = kernel_data.integrator.volume_max_steps; float step_size = kernel_data.integrator.volume_step_size; float random_jitter_offset = lcg_step_float_addrspace(&state->rng_congruential) * step_size; /* compute coefficients at the start */ float t = 0.0f; float3 accum_transmittance = make_float3(1.0f, 1.0f, 1.0f); /* pick random color channel, we use the Veach one-sample * model with balance heuristic for the channels */ float xi = path_state_rng_1D(kg, state, PRNG_SCATTER_DISTANCE); float rphase = path_state_rng_1D(kg, state, PRNG_PHASE_CHANNEL); bool has_scatter = false; for(int i = 0; i < max_steps; i++) { /* advance to new position */ float new_t = min(ray->t, (i+1) * step_size); float dt = new_t - t; /* use random position inside this segment to sample shader */ if(new_t == ray->t) random_jitter_offset = lcg_step_float_addrspace(&state->rng_congruential) * dt; float3 new_P = ray->P + ray->D * (t + random_jitter_offset); VolumeShaderCoefficients coeff; /* compute segment */ if(volume_shader_sample(kg, sd, state, new_P, &coeff)) { int closure_flag = sd->flag; float3 new_tp; float3 transmittance; bool scatter = false; /* distance sampling */ #ifdef __VOLUME_SCATTER__ if((closure_flag & SD_SCATTER) || (has_scatter && (closure_flag & SD_EXTINCTION))) { has_scatter = true; /* Sample channel, use MIS with balance heuristic. */ float3 albedo = safe_divide_color(coeff.sigma_s, coeff.sigma_t); float3 channel_pdf; int channel = kernel_volume_sample_channel(albedo, tp, rphase, &channel_pdf); /* compute transmittance over full step */ transmittance = volume_color_transmittance(coeff.sigma_t, dt); /* decide if we will scatter or continue */ float sample_transmittance = kernel_volume_channel_get(transmittance, channel); if(1.0f - xi >= sample_transmittance) { /* compute sampling distance */ float sample_sigma_t = kernel_volume_channel_get(coeff.sigma_t, channel); float new_dt = -logf(1.0f - xi)/sample_sigma_t; new_t = t + new_dt; /* transmittance and pdf */ float3 new_transmittance = volume_color_transmittance(coeff.sigma_t, new_dt); float3 pdf = coeff.sigma_t * new_transmittance; /* throughput */ new_tp = tp * coeff.sigma_s * new_transmittance / dot(channel_pdf, pdf); scatter = true; } else { /* throughput */ float pdf = dot(channel_pdf, transmittance); new_tp = tp * transmittance / pdf; /* remap xi so we can reuse it and keep thing stratified */ xi = 1.0f - (1.0f - xi)/sample_transmittance; } } else #endif if(closure_flag & SD_EXTINCTION) { /* absorption only, no sampling needed */ transmittance = volume_color_transmittance(coeff.sigma_t, dt); new_tp = tp * transmittance; } /* integrate emission attenuated by absorption */ if(L && (closure_flag & SD_EMISSION)) { float3 emission = kernel_volume_emission_integrate(&coeff, closure_flag, transmittance, dt); path_radiance_accum_emission(L, state, tp, emission); } /* modify throughput */ if(closure_flag & SD_EXTINCTION) { tp = new_tp; /* stop if nearly all light blocked */ if(tp.x < tp_eps && tp.y < tp_eps && tp.z < tp_eps) { tp = make_float3(0.0f, 0.0f, 0.0f); break; } } /* prepare to scatter to new direction */ if(scatter) { /* adjust throughput and move to new location */ sd->P = ray->P + new_t*ray->D; *throughput = tp; return VOLUME_PATH_SCATTERED; } else { /* accumulate transmittance */ accum_transmittance *= transmittance; } } /* stop if at the end of the volume */ t = new_t; if(t == ray->t) break; } *throughput = tp; return VOLUME_PATH_ATTENUATED; } /* get the volume attenuation and emission over line segment defined by * ray, with the assumption that there are no surfaces blocking light * between the endpoints. distance sampling is used to decide if we will * scatter or not. */ ccl_device_noinline VolumeIntegrateResult kernel_volume_integrate( KernelGlobals *kg, ccl_addr_space PathState *state, ShaderData *sd, Ray *ray, PathRadiance *L, ccl_addr_space float3 *throughput, bool heterogeneous) { shader_setup_from_volume(kg, sd, ray); if(heterogeneous) return kernel_volume_integrate_heterogeneous_distance(kg, state, ray, sd, L, throughput); else return kernel_volume_integrate_homogeneous(kg, state, ray, sd, L, throughput, true); } #ifndef __SPLIT_KERNEL__ /* Decoupled Volume Sampling * * VolumeSegment is list of coefficients and transmittance stored at all steps * through a volume. This can then later be used for decoupled sampling as in: * "Importance Sampling Techniques for Path Tracing in Participating Media" * * On the GPU this is only supported (but currently not enabled) * for homogeneous volumes (1 step), due to * no support for malloc/free and too much stack usage with a fix size array. */ typedef struct VolumeStep { float3 sigma_s; /* scatter coefficient */ float3 sigma_t; /* extinction coefficient */ float3 accum_transmittance; /* accumulated transmittance including this step */ float3 cdf_distance; /* cumulative density function for distance sampling */ float t; /* distance at end of this step */ float shade_t; /* jittered distance where shading was done in step */ int closure_flag; /* shader evaluation closure flags */ } VolumeStep; typedef struct VolumeSegment { VolumeStep stack_step; /* stack storage for homogeneous step, to avoid malloc */ VolumeStep *steps; /* recorded steps */ int numsteps; /* number of steps */ int closure_flag; /* accumulated closure flags from all steps */ float3 accum_emission; /* accumulated emission at end of segment */ float3 accum_transmittance; /* accumulated transmittance at end of segment */ float3 accum_albedo; /* accumulated average albedo over segment */ int sampling_method; /* volume sampling method */ } VolumeSegment; /* record volume steps to the end of the volume. * * it would be nice if we could only record up to the point that we need to scatter, * but the entire segment is needed to do always scattering, rather than probabilistically * hitting or missing the volume. if we don't know the transmittance at the end of the * volume we can't generate stratified distance samples up to that transmittance */ #ifdef __VOLUME_DECOUPLED__ ccl_device void kernel_volume_decoupled_record(KernelGlobals *kg, PathState *state, Ray *ray, ShaderData *sd, VolumeSegment *segment, bool heterogeneous) { const float tp_eps = 1e-6f; /* todo: this is likely not the right value */ /* prepare for volume stepping */ int max_steps; float step_size, random_jitter_offset; if(heterogeneous) { const int global_max_steps = kernel_data.integrator.volume_max_steps; step_size = kernel_data.integrator.volume_step_size; /* compute exact steps in advance for malloc */ if(ray->t > global_max_steps*step_size) { max_steps = global_max_steps; step_size = ray->t / (float)max_steps; } else { max_steps = max((int)ceilf(ray->t/step_size), 1); } #ifdef __KERNEL_CPU__ /* NOTE: For the branched path tracing it's possible to have direct * and indirect light integration both having volume segments allocated. * We detect this using index in the pre-allocated memory. Currently we * only support two segments allocated at a time, if more needed some * modifications to the KernelGlobals will be needed. * * This gives us restrictions that decoupled record should only happen * in the stack manner, meaning if there's subsequent call of decoupled * record it'll need to free memory before it's caller frees memory. */ const int index = kg->decoupled_volume_steps_index; assert(index < sizeof(kg->decoupled_volume_steps) / sizeof(*kg->decoupled_volume_steps)); if(kg->decoupled_volume_steps[index] == NULL) { kg->decoupled_volume_steps[index] = (VolumeStep*)malloc(sizeof(VolumeStep)*global_max_steps); } segment->steps = kg->decoupled_volume_steps[index]; ++kg->decoupled_volume_steps_index; #else segment->steps = (VolumeStep*)malloc(sizeof(VolumeStep)*max_steps); #endif random_jitter_offset = lcg_step_float(&state->rng_congruential) * step_size; } else { max_steps = 1; step_size = ray->t; random_jitter_offset = 0.0f; segment->steps = &segment->stack_step; } /* init accumulation variables */ float3 accum_emission = make_float3(0.0f, 0.0f, 0.0f); float3 accum_transmittance = make_float3(1.0f, 1.0f, 1.0f); float3 accum_albedo = make_float3(0.0f, 0.0f, 0.0f); float3 cdf_distance = make_float3(0.0f, 0.0f, 0.0f); float t = 0.0f; segment->numsteps = 0; segment->closure_flag = 0; bool is_last_step_empty = false; VolumeStep *step = segment->steps; for(int i = 0; i < max_steps; i++, step++) { /* advance to new position */ float new_t = min(ray->t, (i+1) * step_size); float dt = new_t - t; /* use random position inside this segment to sample shader */ if(heterogeneous && new_t == ray->t) random_jitter_offset = lcg_step_float(&state->rng_congruential) * dt; float3 new_P = ray->P + ray->D * (t + random_jitter_offset); VolumeShaderCoefficients coeff; /* compute segment */ if(volume_shader_sample(kg, sd, state, new_P, &coeff)) { int closure_flag = sd->flag; float3 sigma_t = coeff.sigma_t; /* compute average albedo for channel sampling */ if(closure_flag & SD_SCATTER) { accum_albedo += dt * safe_divide_color(coeff.sigma_s, sigma_t); } /* compute accumulated transmittance */ float3 transmittance = volume_color_transmittance(sigma_t, dt); /* compute emission attenuated by absorption */ if(closure_flag & SD_EMISSION) { float3 emission = kernel_volume_emission_integrate(&coeff, closure_flag, transmittance, dt); accum_emission += accum_transmittance * emission; } accum_transmittance *= transmittance; /* compute pdf for distance sampling */ float3 pdf_distance = dt * accum_transmittance * coeff.sigma_s; cdf_distance = cdf_distance + pdf_distance; /* write step data */ step->sigma_t = sigma_t; step->sigma_s = coeff.sigma_s; step->closure_flag = closure_flag; segment->closure_flag |= closure_flag; is_last_step_empty = false; segment->numsteps++; } else { if(is_last_step_empty) { /* consecutive empty step, merge */ step--; } else { /* store empty step */ step->sigma_t = make_float3(0.0f, 0.0f, 0.0f); step->sigma_s = make_float3(0.0f, 0.0f, 0.0f); step->closure_flag = 0; segment->numsteps++; is_last_step_empty = true; } } step->accum_transmittance = accum_transmittance; step->cdf_distance = cdf_distance; step->t = new_t; step->shade_t = t + random_jitter_offset; /* stop if at the end of the volume */ t = new_t; if(t == ray->t) break; /* stop if nearly all light blocked */ if(accum_transmittance.x < tp_eps && accum_transmittance.y < tp_eps && accum_transmittance.z < tp_eps) break; } /* store total emission and transmittance */ segment->accum_emission = accum_emission; segment->accum_transmittance = accum_transmittance; segment->accum_albedo = accum_albedo; /* normalize cumulative density function for distance sampling */ VolumeStep *last_step = segment->steps + segment->numsteps - 1; if(!is_zero(last_step->cdf_distance)) { VolumeStep *step = &segment->steps[0]; int numsteps = segment->numsteps; float3 inv_cdf_distance_sum = safe_invert_color(last_step->cdf_distance); for(int i = 0; i < numsteps; i++, step++) step->cdf_distance *= inv_cdf_distance_sum; } } ccl_device void kernel_volume_decoupled_free(KernelGlobals *kg, VolumeSegment *segment) { if(segment->steps != &segment->stack_step) { #ifdef __KERNEL_CPU__ /* NOTE: We only allow free last allocated segment. * No random order of alloc/free is supported. */ assert(kg->decoupled_volume_steps_index > 0); assert(segment->steps == kg->decoupled_volume_steps[kg->decoupled_volume_steps_index - 1]); --kg->decoupled_volume_steps_index; #else free(segment->steps); #endif } } #endif /* __VOLUME_DECOUPLED__ */ /* scattering for homogeneous and heterogeneous volumes, using decoupled ray * marching. * * function is expected to return VOLUME_PATH_SCATTERED when probalistic_scatter is false */ ccl_device VolumeIntegrateResult kernel_volume_decoupled_scatter( KernelGlobals *kg, PathState *state, Ray *ray, ShaderData *sd, float3 *throughput, float rphase, float rscatter, const VolumeSegment *segment, const float3 *light_P, bool probalistic_scatter) { kernel_assert(segment->closure_flag & SD_SCATTER); /* Sample color channel, use MIS with balance heuristic. */ float3 channel_pdf; int channel = kernel_volume_sample_channel(segment->accum_albedo, *throughput, rphase, &channel_pdf); float xi = rscatter; /* probabilistic scattering decision based on transmittance */ if(probalistic_scatter) { float sample_transmittance = kernel_volume_channel_get(segment->accum_transmittance, channel); if(1.0f - xi >= sample_transmittance) { /* rescale random number so we can reuse it */ xi = 1.0f - (1.0f - xi - sample_transmittance)/(1.0f - sample_transmittance); } else { *throughput /= sample_transmittance; return VOLUME_PATH_MISSED; } } VolumeStep *step; float3 transmittance; float pdf, sample_t; float mis_weight = 1.0f; bool distance_sample = true; bool use_mis = false; if(segment->sampling_method && light_P) { if(segment->sampling_method == SD_VOLUME_MIS) { /* multiple importance sample: randomly pick between * equiangular and distance sampling strategy */ if(xi < 0.5f) { xi *= 2.0f; } else { xi = (xi - 0.5f)*2.0f; distance_sample = false; } use_mis = true; } else { /* only equiangular sampling */ distance_sample = false; } } /* distance sampling */ if(distance_sample) { /* find step in cdf */ step = segment->steps; float prev_t = 0.0f; float3 step_pdf_distance = make_float3(1.0f, 1.0f, 1.0f); if(segment->numsteps > 1) { float prev_cdf = 0.0f; float step_cdf = 1.0f; float3 prev_cdf_distance = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; ; i++, step++) { /* todo: optimize using binary search */ step_cdf = kernel_volume_channel_get(step->cdf_distance, channel); if(xi < step_cdf || i == segment->numsteps-1) break; prev_cdf = step_cdf; prev_t = step->t; prev_cdf_distance = step->cdf_distance; } /* remap xi so we can reuse it */ xi = (xi - prev_cdf)/(step_cdf - prev_cdf); /* pdf for picking step */ step_pdf_distance = step->cdf_distance - prev_cdf_distance; } /* determine range in which we will sample */ float step_t = step->t - prev_t; /* sample distance and compute transmittance */ float3 distance_pdf; sample_t = prev_t + kernel_volume_distance_sample(step_t, step->sigma_t, channel, xi, &transmittance, &distance_pdf); /* modify pdf for hit/miss decision */ if(probalistic_scatter) distance_pdf *= make_float3(1.0f, 1.0f, 1.0f) - segment->accum_transmittance; pdf = dot(channel_pdf, distance_pdf * step_pdf_distance); /* multiple importance sampling */ if(use_mis) { float equi_pdf = kernel_volume_equiangular_pdf(ray, *light_P, sample_t); mis_weight = 2.0f*power_heuristic(pdf, equi_pdf); } } /* equi-angular sampling */ else { /* sample distance */ sample_t = kernel_volume_equiangular_sample(ray, *light_P, xi, &pdf); /* find step in which sampled distance is located */ step = segment->steps; float prev_t = 0.0f; float3 step_pdf_distance = make_float3(1.0f, 1.0f, 1.0f); if(segment->numsteps > 1) { float3 prev_cdf_distance = make_float3(0.0f, 0.0f, 0.0f); int numsteps = segment->numsteps; int high = numsteps - 1; int low = 0; int mid; while(low < high) { mid = (low + high) >> 1; if(sample_t < step[mid].t) high = mid; else if(sample_t >= step[mid + 1].t) low = mid + 1; else { /* found our interval in step[mid] .. step[mid+1] */ prev_t = step[mid].t; prev_cdf_distance = step[mid].cdf_distance; step += mid+1; break; } } if(low >= numsteps - 1) { prev_t = step[numsteps - 1].t; prev_cdf_distance = step[numsteps-1].cdf_distance; step += numsteps - 1; } /* pdf for picking step with distance sampling */ step_pdf_distance = step->cdf_distance - prev_cdf_distance; } /* determine range in which we will sample */ float step_t = step->t - prev_t; float step_sample_t = sample_t - prev_t; /* compute transmittance */ transmittance = volume_color_transmittance(step->sigma_t, step_sample_t); /* multiple importance sampling */ if(use_mis) { float3 distance_pdf3 = kernel_volume_distance_pdf(step_t, step->sigma_t, step_sample_t); float distance_pdf = dot(channel_pdf, distance_pdf3 * step_pdf_distance); mis_weight = 2.0f*power_heuristic(pdf, distance_pdf); } } if(sample_t < 0.0f || pdf == 0.0f) { return VOLUME_PATH_MISSED; } /* compute transmittance up to this step */ if(step != segment->steps) transmittance *= (step-1)->accum_transmittance; /* modify throughput */ *throughput *= step->sigma_s * transmittance * (mis_weight / pdf); /* evaluate shader to create closures at shading point */ if(segment->numsteps > 1) { sd->P = ray->P + step->shade_t*ray->D; VolumeShaderCoefficients coeff; volume_shader_sample(kg, sd, state, sd->P, &coeff); } /* move to new position */ sd->P = ray->P + sample_t*ray->D; return VOLUME_PATH_SCATTERED; } #endif /* __SPLIT_KERNEL */ /* decide if we need to use decoupled or not */ ccl_device bool kernel_volume_use_decoupled(KernelGlobals *kg, bool heterogeneous, bool direct, int sampling_method) { /* decoupled ray marching for heterogeneous volumes not supported on the GPU, * which also means equiangular and multiple importance sampling is not * support for that case */ if(!kernel_data.integrator.volume_decoupled) return false; #ifdef __KERNEL_GPU__ if(heterogeneous) return false; #endif /* equiangular and multiple importance sampling only implemented for decoupled */ if(sampling_method != 0) return true; /* for all light sampling use decoupled, reusing shader evaluations is * typically faster in that case */ if(direct) return kernel_data.integrator.sample_all_lights_direct; else return kernel_data.integrator.sample_all_lights_indirect; } /* Volume Stack * * This is an array of object/shared ID's that the current segment of the path * is inside of. */ ccl_device void kernel_volume_stack_init(KernelGlobals *kg, ShaderData *stack_sd, ccl_addr_space const PathState *state, ccl_addr_space const Ray *ray, ccl_addr_space VolumeStack *stack) { /* NULL ray happens in the baker, does it need proper initialization of * camera in volume? */ if(!kernel_data.cam.is_inside_volume || ray == NULL) { /* Camera is guaranteed to be in the air, only take background volume * into account in this case. */ if(kernel_data.background.volume_shader != SHADER_NONE) { stack[0].shader = kernel_data.background.volume_shader; stack[0].object = PRIM_NONE; stack[1].shader = SHADER_NONE; } else { stack[0].shader = SHADER_NONE; } return; } kernel_assert(state->flag & PATH_RAY_CAMERA); Ray volume_ray = *ray; volume_ray.t = FLT_MAX; const uint visibility = (state->flag & PATH_RAY_ALL_VISIBILITY); int stack_index = 0, enclosed_index = 0; #ifdef __VOLUME_RECORD_ALL__ Intersection hits[2*VOLUME_STACK_SIZE + 1]; uint num_hits = scene_intersect_volume_all(kg, &volume_ray, hits, 2*VOLUME_STACK_SIZE, visibility); if(num_hits > 0) { int enclosed_volumes[VOLUME_STACK_SIZE]; Intersection *isect = hits; qsort(hits, num_hits, sizeof(Intersection), intersections_compare); for(uint hit = 0; hit < num_hits; ++hit, ++isect) { shader_setup_from_ray(kg, stack_sd, isect, &volume_ray); if(stack_sd->flag & SD_BACKFACING) { bool need_add = true; for(int i = 0; i < enclosed_index && need_add; ++i) { /* If ray exited the volume and never entered to that volume * it means that camera is inside such a volume. */ if(enclosed_volumes[i] == stack_sd->object) { need_add = false; } } for(int i = 0; i < stack_index && need_add; ++i) { /* Don't add intersections twice. */ if(stack[i].object == stack_sd->object) { need_add = false; break; } } if(need_add) { stack[stack_index].object = stack_sd->object; stack[stack_index].shader = stack_sd->shader; ++stack_index; } } else { /* If ray from camera enters the volume, this volume shouldn't * be added to the stack on exit. */ enclosed_volumes[enclosed_index++] = stack_sd->object; } } } #else int enclosed_volumes[VOLUME_STACK_SIZE]; int step = 0; while(stack_index < VOLUME_STACK_SIZE - 1 && enclosed_index < VOLUME_STACK_SIZE - 1 && step < 2 * VOLUME_STACK_SIZE) { Intersection isect; if(!scene_intersect_volume(kg, &volume_ray, &isect, visibility)) { break; } shader_setup_from_ray(kg, stack_sd, &isect, &volume_ray); if(stack_sd->flag & SD_BACKFACING) { /* If ray exited the volume and never entered to that volume * it means that camera is inside such a volume. */ bool need_add = true; for(int i = 0; i < enclosed_index && need_add; ++i) { /* If ray exited the volume and never entered to that volume * it means that camera is inside such a volume. */ if(enclosed_volumes[i] == stack_sd->object) { need_add = false; } } for(int i = 0; i < stack_index && need_add; ++i) { /* Don't add intersections twice. */ if(stack[i].object == stack_sd->object) { need_add = false; break; } } if(need_add) { stack[stack_index].object = stack_sd->object; stack[stack_index].shader = stack_sd->shader; ++stack_index; } } else { /* If ray from camera enters the volume, this volume shouldn't * be added to the stack on exit. */ enclosed_volumes[enclosed_index++] = stack_sd->object; } /* Move ray forward. */ volume_ray.P = ray_offset(stack_sd->P, -stack_sd->Ng); ++step; } #endif /* stack_index of 0 means quick checks outside of the kernel gave false * positive, nothing to worry about, just we've wasted quite a few of * ticks just to come into conclusion that camera is in the air. * * In this case we're doing the same above -- check whether background has * volume. */ if(stack_index == 0 && kernel_data.background.volume_shader == SHADER_NONE) { stack[0].shader = kernel_data.background.volume_shader; stack[0].object = PRIM_NONE; stack[1].shader = SHADER_NONE; } else { stack[stack_index].shader = SHADER_NONE; } } ccl_device void kernel_volume_stack_enter_exit(KernelGlobals *kg, ShaderData *sd, ccl_addr_space VolumeStack *stack) { /* todo: we should have some way for objects to indicate if they want the * world shader to work inside them. excluding it by default is problematic * because non-volume objects can't be assumed to be closed manifolds */ if(!(sd->flag & SD_HAS_VOLUME)) return; if(sd->flag & SD_BACKFACING) { /* exit volume object: remove from stack */ for(int i = 0; stack[i].shader != SHADER_NONE; i++) { if(stack[i].object == sd->object) { /* shift back next stack entries */ do { stack[i] = stack[i+1]; i++; } while(stack[i].shader != SHADER_NONE); return; } } } else { /* enter volume object: add to stack */ int i; for(i = 0; stack[i].shader != SHADER_NONE; i++) { /* already in the stack? then we have nothing to do */ if(stack[i].object == sd->object) return; } /* if we exceed the stack limit, ignore */ if(i >= VOLUME_STACK_SIZE-1) return; /* add to the end of the stack */ stack[i].shader = sd->shader; stack[i].object = sd->object; stack[i+1].shader = SHADER_NONE; } } #ifdef __SUBSURFACE__ ccl_device void kernel_volume_stack_update_for_subsurface(KernelGlobals *kg, ShaderData *stack_sd, Ray *ray, ccl_addr_space VolumeStack *stack) { kernel_assert(kernel_data.integrator.use_volumes); Ray volume_ray = *ray; # ifdef __VOLUME_RECORD_ALL__ Intersection hits[2*VOLUME_STACK_SIZE + 1]; uint num_hits = scene_intersect_volume_all(kg, &volume_ray, hits, 2*VOLUME_STACK_SIZE, PATH_RAY_ALL_VISIBILITY); if(num_hits > 0) { Intersection *isect = hits; qsort(hits, num_hits, sizeof(Intersection), intersections_compare); for(uint hit = 0; hit < num_hits; ++hit, ++isect) { shader_setup_from_ray(kg, stack_sd, isect, &volume_ray); kernel_volume_stack_enter_exit(kg, stack_sd, stack); } } # else Intersection isect; int step = 0; float3 Pend = ray->P + ray->D*ray->t; while(step < 2 * VOLUME_STACK_SIZE && scene_intersect_volume(kg, &volume_ray, &isect, PATH_RAY_ALL_VISIBILITY)) { shader_setup_from_ray(kg, stack_sd, &isect, &volume_ray); kernel_volume_stack_enter_exit(kg, stack_sd, stack); /* Move ray forward. */ volume_ray.P = ray_offset(stack_sd->P, -stack_sd->Ng); if(volume_ray.t != FLT_MAX) { volume_ray.D = normalize_len(Pend - volume_ray.P, &volume_ray.t); } ++step; } # endif } #endif /* Clean stack after the last bounce. * * It is expected that all volumes are closed manifolds, so at the time when ray * hits nothing (for example, it is a last bounce which goes to environment) the * only expected volume in the stack is the world's one. All the rest volume * entries should have been exited already. * * This isn't always true because of ray intersection precision issues, which * could lead us to an infinite non-world volume in the stack, causing render * artifacts. * * Use this function after the last bounce to get rid of all volumes apart from * the world's one after the last bounce to avoid render artifacts. */ ccl_device_inline void kernel_volume_clean_stack(KernelGlobals *kg, ccl_addr_space VolumeStack *volume_stack) { if(kernel_data.background.volume_shader != SHADER_NONE) { /* Keep the world's volume in stack. */ volume_stack[1].shader = SHADER_NONE; } else { volume_stack[0].shader = SHADER_NONE; } } #endif /* __VOLUME__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernel_work_stealing.h000066400000000000000000000053751334742672700242500ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_WORK_STEALING_H__ #define __KERNEL_WORK_STEALING_H__ CCL_NAMESPACE_BEGIN /* * Utility functions for work stealing */ #ifdef __KERNEL_OPENCL__ # pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable #endif #ifdef __SPLIT_KERNEL__ /* Returns true if there is work */ ccl_device bool get_next_work(KernelGlobals *kg, ccl_global uint *work_pools, uint total_work_size, uint ray_index, ccl_private uint *global_work_index) { /* With a small amount of work there may be more threads than work due to * rounding up of global size, stop such threads immediately. */ if(ray_index >= total_work_size) { return false; } /* Increase atomic work index counter in pool. */ uint pool = ray_index / WORK_POOL_SIZE; uint work_index = atomic_fetch_and_inc_uint32(&work_pools[pool]); /* Map per-pool work index to a global work index. */ uint global_size = ccl_global_size(0) * ccl_global_size(1); kernel_assert(global_size % WORK_POOL_SIZE == 0); kernel_assert(ray_index < global_size); *global_work_index = (work_index / WORK_POOL_SIZE) * global_size + (pool * WORK_POOL_SIZE) + (work_index % WORK_POOL_SIZE); /* Test if all work for this pool is done. */ return (*global_work_index < total_work_size); } #endif /* Map global work index to tile, pixel X/Y and sample. */ ccl_device_inline void get_work_pixel(ccl_global const WorkTile *tile, uint global_work_index, ccl_private uint *x, ccl_private uint *y, ccl_private uint *sample) { uint tile_pixels = tile->w * tile->h; uint sample_offset = global_work_index / tile_pixels; uint pixel_offset = global_work_index - sample_offset * tile_pixels; uint y_offset = pixel_offset / tile->w; uint x_offset = pixel_offset - y_offset * tile->w; *x = tile->x + x_offset; *y = tile->y + y_offset; *sample = tile->start_sample + sample_offset; } CCL_NAMESPACE_END #endif /* __KERNEL_WORK_STEALING_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/kernels/000077500000000000000000000000001334742672700213205ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/000077500000000000000000000000001334742672700221075ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter.cpp000066400000000000000000000030641334742672700241030ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* CPU kernel entry points */ /* On x86-64, we can assume SSE2, so avoid the extra kernel and compile this * one with SSE2 intrinsics. */ #if defined(__x86_64__) || defined(_M_X64) # define __KERNEL_SSE2__ #endif /* When building kernel for native machine detect kernel features from the flags * set by compiler. */ #ifdef WITH_KERNEL_NATIVE # ifdef __SSE2__ # ifndef __KERNEL_SSE2__ # define __KERNEL_SSE2__ # endif # endif # ifdef __SSE3__ # define __KERNEL_SSE3__ # endif # ifdef __SSSE3__ # define __KERNEL_SSSE3__ # endif # ifdef __SSE4_1__ # define __KERNEL_SSE41__ # endif # ifdef __AVX__ # define __KERNEL_SSE__ # define __KERNEL_AVX__ # endif # ifdef __AVX2__ # define __KERNEL_SSE__ # define __KERNEL_AVX2__ # endif #endif /* quiet unused define warnings */ #if defined(__KERNEL_SSE2__) /* do nothing */ #endif #include "kernel/filter/filter.h" #define KERNEL_ARCH cpu #include "kernel/kernels/cpu/filter_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter_avx.cpp000066400000000000000000000025231334742672700247600ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with AVX * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE__ # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # define __KERNEL_AVX__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */ #include "kernel/filter/filter.h" #define KERNEL_ARCH cpu_avx #include "kernel/kernels/cpu/filter_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter_avx2.cpp000066400000000000000000000025631334742672700250460ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with AVX2 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE__ # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # define __KERNEL_AVX__ # define __KERNEL_AVX2__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */ #include "kernel/filter/filter.h" #define KERNEL_ARCH cpu_avx2 #include "kernel/kernels/cpu/filter_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter_cpu.h000066400000000000000000000172351334742672700244240ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Templated common declaration part of all CPU kernels. */ void KERNEL_FUNCTION_FULL_NAME(filter_divide_shadow)(int sample, TilesInfo *tiles, int x, int y, float *unfilteredA, float *unfilteredB, float *sampleV, float *sampleVV, float *bufferV, int* prefilter_rect, int buffer_pass_stride, int buffer_denoising_offset); void KERNEL_FUNCTION_FULL_NAME(filter_get_feature)(int sample, TilesInfo *tiles, int m_offset, int v_offset, int x, int y, float *mean, float *variance, int* prefilter_rect, int buffer_pass_stride, int buffer_denoising_offset); void KERNEL_FUNCTION_FULL_NAME(filter_detect_outliers)(int x, int y, ccl_global float *image, ccl_global float *variance, ccl_global float *depth, ccl_global float *output, int *rect, int pass_stride); void KERNEL_FUNCTION_FULL_NAME(filter_combine_halves)(int x, int y, float *mean, float *variance, float *a, float *b, int* prefilter_rect, int r); void KERNEL_FUNCTION_FULL_NAME(filter_construct_transform)(float* buffer, int x, int y, int storage_ofs, float *transform, int *rank, int* rect, int pass_stride, int radius, float pca_threshold); void KERNEL_FUNCTION_FULL_NAME(filter_nlm_calc_difference)(int dx, int dy, float *weight_image, float *variance, float *difference_image, int* rect, int stride, int channel_offset, float a, float k_2); void KERNEL_FUNCTION_FULL_NAME(filter_nlm_blur)(float *difference_image, float *out_image, int* rect, int stride, int f); void KERNEL_FUNCTION_FULL_NAME(filter_nlm_calc_weight)(float *difference_image, float *out_image, int* rect, int stride, int f); void KERNEL_FUNCTION_FULL_NAME(filter_nlm_update_output)(int dx, int dy, float *difference_image, float *image, float *out_image, float *accum_image, int* rect, int stride, int f); void KERNEL_FUNCTION_FULL_NAME(filter_nlm_construct_gramian)(int dx, int dy, float *difference_image, float *buffer, float *transform, int *rank, float *XtWX, float3 *XtWY, int *rect, int *filter_window, int stride, int f, int pass_stride); void KERNEL_FUNCTION_FULL_NAME(filter_nlm_normalize)(float *out_image, float *accum_image, int* rect, int stride); void KERNEL_FUNCTION_FULL_NAME(filter_finalize)(int x, int y, int storage_ofs, float *buffer, int *rank, float *XtWX, float3 *XtWY, int *buffer_params, int sample); #undef KERNEL_ARCH goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter_cpu_impl.h000066400000000000000000000264761334742672700254540ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Templated common implementation part of all CPU kernels. * * The idea is that particular .cpp files sets needed optimization flags and * simply includes this file without worry of copying actual implementation over. */ #include "kernel/kernel_compat_cpu.h" #include "kernel/filter/filter_kernel.h" #ifdef KERNEL_STUB # define STUB_ASSERT(arch, name) assert(!(#name " kernel stub for architecture " #arch " was called!")) #endif CCL_NAMESPACE_BEGIN /* Denoise filter */ void KERNEL_FUNCTION_FULL_NAME(filter_divide_shadow)(int sample, TilesInfo *tiles, int x, int y, float *unfilteredA, float *unfilteredB, float *sampleVariance, float *sampleVarianceV, float *bufferVariance, int* prefilter_rect, int buffer_pass_stride, int buffer_denoising_offset) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_divide_shadow); #else kernel_filter_divide_shadow(sample, tiles, x, y, unfilteredA, unfilteredB, sampleVariance, sampleVarianceV, bufferVariance, load_int4(prefilter_rect), buffer_pass_stride, buffer_denoising_offset); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_get_feature)(int sample, TilesInfo *tiles, int m_offset, int v_offset, int x, int y, float *mean, float *variance, int* prefilter_rect, int buffer_pass_stride, int buffer_denoising_offset) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_get_feature); #else kernel_filter_get_feature(sample, tiles, m_offset, v_offset, x, y, mean, variance, load_int4(prefilter_rect), buffer_pass_stride, buffer_denoising_offset); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_detect_outliers)(int x, int y, ccl_global float *image, ccl_global float *variance, ccl_global float *depth, ccl_global float *output, int *rect, int pass_stride) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_detect_outliers); #else kernel_filter_detect_outliers(x, y, image, variance, depth, output, load_int4(rect), pass_stride); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_combine_halves)(int x, int y, float *mean, float *variance, float *a, float *b, int* prefilter_rect, int r) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_combine_halves); #else kernel_filter_combine_halves(x, y, mean, variance, a, b, load_int4(prefilter_rect), r); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_construct_transform)(float* buffer, int x, int y, int storage_ofs, float *transform, int *rank, int* prefilter_rect, int pass_stride, int radius, float pca_threshold) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_construct_transform); #else rank += storage_ofs; transform += storage_ofs*TRANSFORM_SIZE; kernel_filter_construct_transform(buffer, x, y, load_int4(prefilter_rect), pass_stride, transform, rank, radius, pca_threshold); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_nlm_calc_difference)(int dx, int dy, float *weight_image, float *variance, float *difference_image, int *rect, int stride, int channel_offset, float a, float k_2) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_nlm_calc_difference); #else kernel_filter_nlm_calc_difference(dx, dy, weight_image, variance, difference_image, load_int4(rect), stride, channel_offset, a, k_2); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_nlm_blur)(float *difference_image, float *out_image, int *rect, int stride, int f) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_nlm_blur); #else kernel_filter_nlm_blur(difference_image, out_image, load_int4(rect), stride, f); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_nlm_calc_weight)(float *difference_image, float *out_image, int *rect, int stride, int f) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_nlm_calc_weight); #else kernel_filter_nlm_calc_weight(difference_image, out_image, load_int4(rect), stride, f); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_nlm_update_output)(int dx, int dy, float *difference_image, float *image, float *out_image, float *accum_image, int *rect, int stride, int f) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_nlm_update_output); #else kernel_filter_nlm_update_output(dx, dy, difference_image, image, out_image, accum_image, load_int4(rect), stride, f); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_nlm_construct_gramian)(int dx, int dy, float *difference_image, float *buffer, float *transform, int *rank, float *XtWX, float3 *XtWY, int *rect, int *filter_window, int stride, int f, int pass_stride) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_nlm_construct_gramian); #else kernel_filter_nlm_construct_gramian(dx, dy, difference_image, buffer, transform, rank, XtWX, XtWY, load_int4(rect), load_int4(filter_window), stride, f, pass_stride); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_nlm_normalize)(float *out_image, float *accum_image, int *rect, int stride) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_nlm_normalize); #else kernel_filter_nlm_normalize(out_image, accum_image, load_int4(rect), stride); #endif } void KERNEL_FUNCTION_FULL_NAME(filter_finalize)(int x, int y, int storage_ofs, float *buffer, int *rank, float *XtWX, float3 *XtWY, int *buffer_params, int sample) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, filter_finalize); #else XtWX += storage_ofs*XTWX_SIZE; XtWY += storage_ofs*XTWY_SIZE; rank += storage_ofs; kernel_filter_finalize(x, y, buffer, rank, 1, XtWX, XtWY, load_int4(buffer_params), sample); #endif } #undef KERNEL_STUB #undef STUB_ASSERT #undef KERNEL_ARCH CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter_sse2.cpp000066400000000000000000000023131334742672700250330ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE2 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ #include "kernel/filter/filter.h" #define KERNEL_ARCH cpu_sse2 #include "kernel/kernels/cpu/filter_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter_sse3.cpp000066400000000000000000000024121334742672700250340ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE3/SSSE3 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 */ #include "kernel/filter/filter.h" #define KERNEL_ARCH cpu_sse3 #include "kernel/kernels/cpu/filter_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/filter_sse41.cpp000066400000000000000000000025051334742672700251210ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE3/SSSE3 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE__ # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */ #include "kernel/filter/filter.h" #define KERNEL_ARCH cpu_sse41 #include "kernel/kernels/cpu/filter_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel.cpp000066400000000000000000000042021334742672700240710ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* CPU kernel entry points */ /* On x86-64, we can assume SSE2, so avoid the extra kernel and compile this * one with SSE2 intrinsics. */ #if defined(__x86_64__) || defined(_M_X64) # define __KERNEL_SSE2__ #endif /* When building kernel for native machine detect kernel features from the flags * set by compiler. */ #ifdef WITH_KERNEL_NATIVE # ifdef __SSE2__ # ifndef __KERNEL_SSE2__ # define __KERNEL_SSE2__ # endif # endif # ifdef __SSE3__ # define __KERNEL_SSE3__ # endif # ifdef __SSSE3__ # define __KERNEL_SSSE3__ # endif # ifdef __SSE4_1__ # define __KERNEL_SSE41__ # endif # ifdef __AVX__ # define __KERNEL_SSE__ # define __KERNEL_AVX__ # endif # ifdef __AVX2__ # define __KERNEL_SSE__ # define __KERNEL_AVX2__ # endif #endif /* quiet unused define warnings */ #if defined(__KERNEL_SSE2__) /* do nothing */ #endif #include "kernel/kernel.h" #define KERNEL_ARCH cpu #include "kernel/kernels/cpu/kernel_cpu_impl.h" CCL_NAMESPACE_BEGIN /* Memory Copy */ void kernel_const_copy(KernelGlobals *kg, const char *name, void *host, size_t size) { if(strcmp(name, "__data") == 0) memcpy(&kg->__data, host, size); else assert(0); } void kernel_tex_copy(KernelGlobals *kg, const char *name, void *mem, size_t size) { if(0) { } #define KERNEL_TEX(type, tname) \ else if(strcmp(name, #tname) == 0) { \ kg->tname.data = (type*)mem; \ kg->tname.width = size; \ } #include "kernel/kernel_textures.h" else { assert(0); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_avx.cpp000066400000000000000000000025141334742672700247530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with AVX * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE__ # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # define __KERNEL_AVX__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_avx2.cpp000066400000000000000000000025541334742672700250410ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with AVX2 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE__ # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # define __KERNEL_AVX__ # define __KERNEL_AVX2__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx2 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_cpu.h000066400000000000000000000074571334742672700244240ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Templated common declaration part of all CPU kernels. */ void KERNEL_FUNCTION_FULL_NAME(path_trace)(KernelGlobals *kg, float *buffer, int sample, int x, int y, int offset, int stride); void KERNEL_FUNCTION_FULL_NAME(convert_to_byte)(KernelGlobals *kg, uchar4 *rgba, float *buffer, float sample_scale, int x, int y, int offset, int stride); void KERNEL_FUNCTION_FULL_NAME(convert_to_half_float)(KernelGlobals *kg, uchar4 *rgba, float *buffer, float sample_scale, int x, int y, int offset, int stride); void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample); /* Split kernels */ void KERNEL_FUNCTION_FULL_NAME(data_init)( KernelGlobals *kg, ccl_constant KernelData *data, ccl_global void *split_data_buffer, int num_elements, ccl_global char *ray_state, int start_sample, int end_sample, int sx, int sy, int sw, int sh, int offset, int stride, ccl_global int *Queue_index, int queuesize, ccl_global char *use_queues_flag, ccl_global unsigned int *work_pool_wgs, unsigned int num_samples, ccl_global float *buffer); #define DECLARE_SPLIT_KERNEL_FUNCTION(name) \ void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData *data); DECLARE_SPLIT_KERNEL_FUNCTION(path_init) DECLARE_SPLIT_KERNEL_FUNCTION(scene_intersect) DECLARE_SPLIT_KERNEL_FUNCTION(lamp_emission) DECLARE_SPLIT_KERNEL_FUNCTION(do_volume) DECLARE_SPLIT_KERNEL_FUNCTION(queue_enqueue) DECLARE_SPLIT_KERNEL_FUNCTION(indirect_background) DECLARE_SPLIT_KERNEL_FUNCTION(shader_setup) DECLARE_SPLIT_KERNEL_FUNCTION(shader_sort) DECLARE_SPLIT_KERNEL_FUNCTION(shader_eval) DECLARE_SPLIT_KERNEL_FUNCTION(holdout_emission_blurring_pathtermination_ao) DECLARE_SPLIT_KERNEL_FUNCTION(subsurface_scatter) DECLARE_SPLIT_KERNEL_FUNCTION(direct_lighting) DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked_ao) DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked_dl) DECLARE_SPLIT_KERNEL_FUNCTION(enqueue_inactive) DECLARE_SPLIT_KERNEL_FUNCTION(next_iteration_setup) DECLARE_SPLIT_KERNEL_FUNCTION(indirect_subsurface) DECLARE_SPLIT_KERNEL_FUNCTION(buffer_update) #undef KERNEL_ARCH goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_cpu_image.h000066400000000000000000000356741334742672700255700ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_CPU_IMAGE_H__ #define __KERNEL_CPU_IMAGE_H__ CCL_NAMESPACE_BEGIN template struct TextureInterpolator { #define SET_CUBIC_SPLINE_WEIGHTS(u, t) \ { \ u[0] = (((-1.0f/6.0f)* t + 0.5f) * t - 0.5f) * t + (1.0f/6.0f); \ u[1] = (( 0.5f * t - 1.0f) * t ) * t + (2.0f/3.0f); \ u[2] = (( -0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f/6.0f); \ u[3] = (1.0f / 6.0f) * t * t * t; \ } (void)0 static ccl_always_inline float4 read(float4 r) { return r; } static ccl_always_inline float4 read(uchar4 r) { float f = 1.0f/255.0f; return make_float4(r.x*f, r.y*f, r.z*f, r.w*f); } static ccl_always_inline float4 read(uchar r) { float f = r*(1.0f/255.0f); return make_float4(f, f, f, 1.0f); } static ccl_always_inline float4 read(float r) { /* TODO(dingto): Optimize this, so interpolation * happens on float instead of float4 */ return make_float4(r, r, r, 1.0f); } static ccl_always_inline float4 read(half4 r) { return half4_to_float4(r); } static ccl_always_inline float4 read(half r) { float f = half_to_float(r); return make_float4(f, f, f, 1.0f); } static ccl_always_inline float4 read(const T *data, int x, int y, int width, int height) { if(x < 0 || y < 0 || x >= width || y >= height) { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } return read(data[y * width + x]); } static ccl_always_inline int wrap_periodic(int x, int width) { x %= width; if(x < 0) x += width; return x; } static ccl_always_inline int wrap_clamp(int x, int width) { return clamp(x, 0, width-1); } static ccl_always_inline float frac(float x, int *ix) { int i = float_to_int(x) - ((x < 0.0f)? 1: 0); *ix = i; return x - (float)i; } /* ******** 2D interpolation ******** */ static ccl_always_inline float4 interp_closest(const TextureInfo& info, float x, float y) { const T *data = (const T*)info.data; const int width = info.width; const int height = info.height; int ix, iy; frac(x*(float)width, &ix); frac(y*(float)height, &iy); switch(info.extension) { case EXTENSION_REPEAT: ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); break; case EXTENSION_CLIP: if(x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } ATTR_FALLTHROUGH; case EXTENSION_EXTEND: ix = wrap_clamp(ix, width); iy = wrap_clamp(iy, height); break; default: kernel_assert(0); return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } return read(data[ix + iy*width]); } static ccl_always_inline float4 interp_linear(const TextureInfo& info, float x, float y) { const T *data = (const T*)info.data; const int width = info.width; const int height = info.height; int ix, iy, nix, niy; const float tx = frac(x*(float)width - 0.5f, &ix); const float ty = frac(y*(float)height - 0.5f, &iy); switch(info.extension) { case EXTENSION_REPEAT: ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); nix = wrap_periodic(ix+1, width); niy = wrap_periodic(iy+1, height); break; case EXTENSION_CLIP: nix = ix + 1; niy = iy + 1; break; case EXTENSION_EXTEND: nix = wrap_clamp(ix+1, width); niy = wrap_clamp(iy+1, height); ix = wrap_clamp(ix, width); iy = wrap_clamp(iy, height); break; default: kernel_assert(0); return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } return (1.0f - ty) * (1.0f - tx) * read(data, ix, iy, width, height) + (1.0f - ty) * tx * read(data, nix, iy, width, height) + ty * (1.0f - tx) * read(data, ix, niy, width, height) + ty * tx * read(data, nix, niy, width, height); } static ccl_always_inline float4 interp_cubic(const TextureInfo& info, float x, float y) { const T *data = (const T*)info.data; const int width = info.width; const int height = info.height; int ix, iy, nix, niy; const float tx = frac(x*(float)width - 0.5f, &ix); const float ty = frac(y*(float)height - 0.5f, &iy); int pix, piy, nnix, nniy; switch(info.extension) { case EXTENSION_REPEAT: ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); pix = wrap_periodic(ix-1, width); piy = wrap_periodic(iy-1, height); nix = wrap_periodic(ix+1, width); niy = wrap_periodic(iy+1, height); nnix = wrap_periodic(ix+2, width); nniy = wrap_periodic(iy+2, height); break; case EXTENSION_CLIP: pix = ix - 1; piy = iy - 1; nix = ix + 1; niy = iy + 1; nnix = ix + 2; nniy = iy + 2; break; case EXTENSION_EXTEND: pix = wrap_clamp(ix-1, width); piy = wrap_clamp(iy-1, height); nix = wrap_clamp(ix+1, width); niy = wrap_clamp(iy+1, height); nnix = wrap_clamp(ix+2, width); nniy = wrap_clamp(iy+2, height); ix = wrap_clamp(ix, width); iy = wrap_clamp(iy, height); break; default: kernel_assert(0); return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } const int xc[4] = {pix, ix, nix, nnix}; const int yc[4] = {piy, iy, niy, nniy}; float u[4], v[4]; /* Some helper macro to keep code reasonable size, * let compiler to inline all the matrix multiplications. */ #define DATA(x, y) (read(data, xc[x], yc[y], width, height)) #define TERM(col) \ (v[col] * (u[0] * DATA(0, col) + \ u[1] * DATA(1, col) + \ u[2] * DATA(2, col) + \ u[3] * DATA(3, col))) SET_CUBIC_SPLINE_WEIGHTS(u, tx); SET_CUBIC_SPLINE_WEIGHTS(v, ty); /* Actual interpolation. */ return TERM(0) + TERM(1) + TERM(2) + TERM(3); #undef TERM #undef DATA } static ccl_always_inline float4 interp(const TextureInfo& info, float x, float y) { if(UNLIKELY(!info.data)) { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } switch(info.interpolation) { case INTERPOLATION_CLOSEST: return interp_closest(info, x, y); case INTERPOLATION_LINEAR: return interp_linear(info, x, y); default: return interp_cubic(info, x, y); } } /* ******** 3D interpolation ******** */ static ccl_always_inline float4 interp_3d_closest(const TextureInfo& info, float x, float y, float z) { int width = info.width; int height = info.height; int depth = info.depth; int ix, iy, iz; frac(x*(float)width, &ix); frac(y*(float)height, &iy); frac(z*(float)depth, &iz); switch(info.extension) { case EXTENSION_REPEAT: ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); iz = wrap_periodic(iz, depth); break; case EXTENSION_CLIP: if(x < 0.0f || y < 0.0f || z < 0.0f || x > 1.0f || y > 1.0f || z > 1.0f) { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } ATTR_FALLTHROUGH; case EXTENSION_EXTEND: ix = wrap_clamp(ix, width); iy = wrap_clamp(iy, height); iz = wrap_clamp(iz, depth); break; default: kernel_assert(0); return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } const T *data = (const T*)info.data; return read(data[ix + iy*width + iz*width*height]); } static ccl_always_inline float4 interp_3d_linear(const TextureInfo& info, float x, float y, float z) { int width = info.width; int height = info.height; int depth = info.depth; int ix, iy, iz; int nix, niy, niz; float tx = frac(x*(float)width - 0.5f, &ix); float ty = frac(y*(float)height - 0.5f, &iy); float tz = frac(z*(float)depth - 0.5f, &iz); switch(info.extension) { case EXTENSION_REPEAT: ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); iz = wrap_periodic(iz, depth); nix = wrap_periodic(ix+1, width); niy = wrap_periodic(iy+1, height); niz = wrap_periodic(iz+1, depth); break; case EXTENSION_CLIP: if(x < 0.0f || y < 0.0f || z < 0.0f || x > 1.0f || y > 1.0f || z > 1.0f) { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } ATTR_FALLTHROUGH; case EXTENSION_EXTEND: nix = wrap_clamp(ix+1, width); niy = wrap_clamp(iy+1, height); niz = wrap_clamp(iz+1, depth); ix = wrap_clamp(ix, width); iy = wrap_clamp(iy, height); iz = wrap_clamp(iz, depth); break; default: kernel_assert(0); return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } const T *data = (const T*)info.data; float4 r; r = (1.0f - tz)*(1.0f - ty)*(1.0f - tx)*read(data[ix + iy*width + iz*width*height]); r += (1.0f - tz)*(1.0f - ty)*tx*read(data[nix + iy*width + iz*width*height]); r += (1.0f - tz)*ty*(1.0f - tx)*read(data[ix + niy*width + iz*width*height]); r += (1.0f - tz)*ty*tx*read(data[nix + niy*width + iz*width*height]); r += tz*(1.0f - ty)*(1.0f - tx)*read(data[ix + iy*width + niz*width*height]); r += tz*(1.0f - ty)*tx*read(data[nix + iy*width + niz*width*height]); r += tz*ty*(1.0f - tx)*read(data[ix + niy*width + niz*width*height]); r += tz*ty*tx*read(data[nix + niy*width + niz*width*height]); return r; } /* TODO(sergey): For some unspeakable reason both GCC-6 and Clang-3.9 are * causing stack overflow issue in this function unless it is inlined. * * Only happens for AVX2 kernel and global __KERNEL_SSE__ vectorization * enabled. */ #ifdef __GNUC__ static ccl_always_inline #else static ccl_never_inline #endif float4 interp_3d_tricubic(const TextureInfo& info, float x, float y, float z) { int width = info.width; int height = info.height; int depth = info.depth; int ix, iy, iz; int nix, niy, niz; /* Tricubic b-spline interpolation. */ const float tx = frac(x*(float)width - 0.5f, &ix); const float ty = frac(y*(float)height - 0.5f, &iy); const float tz = frac(z*(float)depth - 0.5f, &iz); int pix, piy, piz, nnix, nniy, nniz; switch(info.extension) { case EXTENSION_REPEAT: ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); iz = wrap_periodic(iz, depth); pix = wrap_periodic(ix-1, width); piy = wrap_periodic(iy-1, height); piz = wrap_periodic(iz-1, depth); nix = wrap_periodic(ix+1, width); niy = wrap_periodic(iy+1, height); niz = wrap_periodic(iz+1, depth); nnix = wrap_periodic(ix+2, width); nniy = wrap_periodic(iy+2, height); nniz = wrap_periodic(iz+2, depth); break; case EXTENSION_CLIP: if(x < 0.0f || y < 0.0f || z < 0.0f || x > 1.0f || y > 1.0f || z > 1.0f) { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } ATTR_FALLTHROUGH; case EXTENSION_EXTEND: pix = wrap_clamp(ix-1, width); piy = wrap_clamp(iy-1, height); piz = wrap_clamp(iz-1, depth); nix = wrap_clamp(ix+1, width); niy = wrap_clamp(iy+1, height); niz = wrap_clamp(iz+1, depth); nnix = wrap_clamp(ix+2, width); nniy = wrap_clamp(iy+2, height); nniz = wrap_clamp(iz+2, depth); ix = wrap_clamp(ix, width); iy = wrap_clamp(iy, height); iz = wrap_clamp(iz, depth); break; default: kernel_assert(0); return make_float4(0.0f, 0.0f, 0.0f, 0.0f); } const int xc[4] = {pix, ix, nix, nnix}; const int yc[4] = {width * piy, width * iy, width * niy, width * nniy}; const int zc[4] = {width * height * piz, width * height * iz, width * height * niz, width * height * nniz}; float u[4], v[4], w[4]; /* Some helper macro to keep code reasonable size, * let compiler to inline all the matrix multiplications. */ #define DATA(x, y, z) (read(data[xc[x] + yc[y] + zc[z]])) #define COL_TERM(col, row) \ (v[col] * (u[0] * DATA(0, col, row) + \ u[1] * DATA(1, col, row) + \ u[2] * DATA(2, col, row) + \ u[3] * DATA(3, col, row))) #define ROW_TERM(row) \ (w[row] * (COL_TERM(0, row) + \ COL_TERM(1, row) + \ COL_TERM(2, row) + \ COL_TERM(3, row))) SET_CUBIC_SPLINE_WEIGHTS(u, tx); SET_CUBIC_SPLINE_WEIGHTS(v, ty); SET_CUBIC_SPLINE_WEIGHTS(w, tz); /* Actual interpolation. */ const T *data = (const T*)info.data; return ROW_TERM(0) + ROW_TERM(1) + ROW_TERM(2) + ROW_TERM(3); #undef COL_TERM #undef ROW_TERM #undef DATA } static ccl_always_inline float4 interp_3d(const TextureInfo& info, float x, float y, float z, InterpolationType interp) { if(UNLIKELY(!info.data)) return make_float4(0.0f, 0.0f, 0.0f, 0.0f); switch((interp == INTERPOLATION_NONE)? info.interpolation: interp) { case INTERPOLATION_CLOSEST: return interp_3d_closest(info, x, y, z); case INTERPOLATION_LINEAR: return interp_3d_linear(info, x, y, z); default: return interp_3d_tricubic(info, x, y, z); } } #undef SET_CUBIC_SPLINE_WEIGHTS }; ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y) { const TextureInfo& info = kernel_tex_fetch(__texture_info, id); switch(kernel_tex_type(id)) { case IMAGE_DATA_TYPE_HALF: return TextureInterpolator::interp(info, x, y); case IMAGE_DATA_TYPE_BYTE: return TextureInterpolator::interp(info, x, y); case IMAGE_DATA_TYPE_FLOAT: return TextureInterpolator::interp(info, x, y); case IMAGE_DATA_TYPE_HALF4: return TextureInterpolator::interp(info, x, y); case IMAGE_DATA_TYPE_BYTE4: return TextureInterpolator::interp(info, x, y); case IMAGE_DATA_TYPE_FLOAT4: default: return TextureInterpolator::interp(info, x, y); } } ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float x, float y, float z, InterpolationType interp) { const TextureInfo& info = kernel_tex_fetch(__texture_info, id); switch(kernel_tex_type(id)) { case IMAGE_DATA_TYPE_HALF: return TextureInterpolator::interp_3d(info, x, y, z, interp); case IMAGE_DATA_TYPE_BYTE: return TextureInterpolator::interp_3d(info, x, y, z, interp); case IMAGE_DATA_TYPE_FLOAT: return TextureInterpolator::interp_3d(info, x, y, z, interp); case IMAGE_DATA_TYPE_HALF4: return TextureInterpolator::interp_3d(info, x, y, z, interp); case IMAGE_DATA_TYPE_BYTE4: return TextureInterpolator::interp_3d(info, x, y, z, interp); case IMAGE_DATA_TYPE_FLOAT4: default: return TextureInterpolator::interp_3d(info, x, y, z, interp); } } CCL_NAMESPACE_END #endif // __KERNEL_CPU_IMAGE_H__ goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_cpu_impl.h000066400000000000000000000177401334742672700254410ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Templated common implementation part of all CPU kernels. * * The idea is that particular .cpp files sets needed optimization flags and * simply includes this file without worry of copying actual implementation over. */ #include "kernel/kernel_compat_cpu.h" #ifndef KERNEL_STUB # ifndef __SPLIT_KERNEL__ # include "kernel/kernel_math.h" # include "kernel/kernel_types.h" # include "kernel/split/kernel_split_data.h" # include "kernel/kernel_globals.h" # include "kernel/kernels/cpu/kernel_cpu_image.h" # include "kernel/kernel_film.h" # include "kernel/kernel_path.h" # include "kernel/kernel_path_branched.h" # include "kernel/kernel_bake.h" # else # include "kernel/split/kernel_split_common.h" # include "kernel/split/kernel_data_init.h" # include "kernel/split/kernel_path_init.h" # include "kernel/split/kernel_scene_intersect.h" # include "kernel/split/kernel_lamp_emission.h" # include "kernel/split/kernel_do_volume.h" # include "kernel/split/kernel_queue_enqueue.h" # include "kernel/split/kernel_indirect_background.h" # include "kernel/split/kernel_shader_setup.h" # include "kernel/split/kernel_shader_sort.h" # include "kernel/split/kernel_shader_eval.h" # include "kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h" # include "kernel/split/kernel_subsurface_scatter.h" # include "kernel/split/kernel_direct_lighting.h" # include "kernel/split/kernel_shadow_blocked_ao.h" # include "kernel/split/kernel_shadow_blocked_dl.h" # include "kernel/split/kernel_enqueue_inactive.h" # include "kernel/split/kernel_next_iteration_setup.h" # include "kernel/split/kernel_indirect_subsurface.h" # include "kernel/split/kernel_buffer_update.h" # endif /* __SPLIT_KERNEL__ */ #else # define STUB_ASSERT(arch, name) assert(!(#name " kernel stub for architecture " #arch " was called!")) # ifdef __SPLIT_KERNEL__ # include "kernel/split/kernel_data_init.h" # endif /* __SPLIT_KERNEL__ */ #endif /* KERNEL_STUB */ CCL_NAMESPACE_BEGIN #ifndef __SPLIT_KERNEL__ /* Path Tracing */ void KERNEL_FUNCTION_FULL_NAME(path_trace)(KernelGlobals *kg, float *buffer, int sample, int x, int y, int offset, int stride) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, path_trace); #else # ifdef __BRANCHED_PATH__ if(kernel_data.integrator.branched) { kernel_branched_path_trace(kg, buffer, sample, x, y, offset, stride); } else # endif { kernel_path_trace(kg, buffer, sample, x, y, offset, stride); } #endif /* KERNEL_STUB */ } /* Film */ void KERNEL_FUNCTION_FULL_NAME(convert_to_byte)(KernelGlobals *kg, uchar4 *rgba, float *buffer, float sample_scale, int x, int y, int offset, int stride) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, convert_to_byte); #else kernel_film_convert_to_byte(kg, rgba, buffer, sample_scale, x, y, offset, stride); #endif /* KERNEL_STUB */ } void KERNEL_FUNCTION_FULL_NAME(convert_to_half_float)(KernelGlobals *kg, uchar4 *rgba, float *buffer, float sample_scale, int x, int y, int offset, int stride) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, convert_to_half_float); #else kernel_film_convert_to_half_float(kg, rgba, buffer, sample_scale, x, y, offset, stride); #endif /* KERNEL_STUB */ } /* Shader Evaluate */ void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, shader); #else if(type >= SHADER_EVAL_BAKE) { # ifdef __BAKING__ kernel_bake_evaluate(kg, input, output, (ShaderEvalType)type, filter, i, offset, sample); # endif } else if(type == SHADER_EVAL_DISPLACE) { kernel_displace_evaluate(kg, input, output, i); } else { kernel_background_evaluate(kg, input, output, i); } #endif /* KERNEL_STUB */ } #else /* __SPLIT_KERNEL__ */ /* Split Kernel Path Tracing */ #ifdef KERNEL_STUB # define DEFINE_SPLIT_KERNEL_FUNCTION(name) \ void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData* /*data*/) \ { \ STUB_ASSERT(KERNEL_ARCH, name); \ } # define DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(name, type) \ void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData* /*data*/) \ { \ STUB_ASSERT(KERNEL_ARCH, name); \ } #else # define DEFINE_SPLIT_KERNEL_FUNCTION(name) \ void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData* /*data*/) \ { \ kernel_##name(kg); \ } # define DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(name, type) \ void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals *kg, KernelData* /*data*/) \ { \ ccl_local type locals; \ kernel_##name(kg, &locals); \ } #endif /* KERNEL_STUB */ DEFINE_SPLIT_KERNEL_FUNCTION(path_init) DEFINE_SPLIT_KERNEL_FUNCTION(scene_intersect) DEFINE_SPLIT_KERNEL_FUNCTION(lamp_emission) DEFINE_SPLIT_KERNEL_FUNCTION(do_volume) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(queue_enqueue, QueueEnqueueLocals) DEFINE_SPLIT_KERNEL_FUNCTION(indirect_background) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(shader_setup, uint) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(shader_sort, ShaderSortLocals) DEFINE_SPLIT_KERNEL_FUNCTION(shader_eval) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(holdout_emission_blurring_pathtermination_ao, BackgroundAOLocals) DEFINE_SPLIT_KERNEL_FUNCTION(subsurface_scatter) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(direct_lighting, uint) DEFINE_SPLIT_KERNEL_FUNCTION(shadow_blocked_ao) DEFINE_SPLIT_KERNEL_FUNCTION(shadow_blocked_dl) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(enqueue_inactive, uint) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(next_iteration_setup, uint) DEFINE_SPLIT_KERNEL_FUNCTION(indirect_subsurface) DEFINE_SPLIT_KERNEL_FUNCTION_LOCALS(buffer_update, uint) #endif /* __SPLIT_KERNEL__ */ #undef KERNEL_STUB #undef STUB_ASSERT #undef KERNEL_ARCH CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_split.cpp000066400000000000000000000030551334742672700253110ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* CPU kernel entry points */ /* On x86-64, we can assume SSE2, so avoid the extra kernel and compile this * one with SSE2 intrinsics. */ #if defined(__x86_64__) || defined(_M_X64) # define __KERNEL_SSE2__ #endif #define __SPLIT_KERNEL__ /* When building kernel for native machine detect kernel features from the flags * set by compiler. */ #ifdef WITH_KERNEL_NATIVE # ifdef __SSE2__ # ifndef __KERNEL_SSE2__ # define __KERNEL_SSE2__ # endif # endif # ifdef __SSE3__ # define __KERNEL_SSE3__ # endif # ifdef __SSSE3__ # define __KERNEL_SSSE3__ # endif # ifdef __SSE4_1__ # define __KERNEL_SSE41__ # endif # ifdef __AVX__ # define __KERNEL_AVX__ # endif # ifdef __AVX2__ # define __KERNEL_SSE__ # define __KERNEL_AVX2__ # endif #endif /* quiet unused define warnings */ #if defined(__KERNEL_SSE2__) /* do nothing */ #endif #include "kernel/kernel.h" #define KERNEL_ARCH cpu #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_split_avx.cpp000066400000000000000000000025461334742672700261730ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with AVX * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #define __SPLIT_KERNEL__ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE__ # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # define __KERNEL_AVX__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_split_avx2.cpp000066400000000000000000000026061334742672700262520ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with AVX2 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #define __SPLIT_KERNEL__ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE__ # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # define __KERNEL_AVX__ # define __KERNEL_AVX2__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx2 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_split_sse2.cpp000066400000000000000000000023361334742672700262460ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE2 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #define __SPLIT_KERNEL__ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse2 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_split_sse3.cpp000066400000000000000000000024351334742672700262470ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE3/SSSE3 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #define __SPLIT_KERNEL__ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse3 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_split_sse41.cpp000066400000000000000000000024751334742672700263350ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE3/SSSE3 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #define __SPLIT_KERNEL__ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse41 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_sse2.cpp000066400000000000000000000023041334742672700250260ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE2 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse2 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_sse3.cpp000066400000000000000000000024031334742672700250270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE3/SSSE3 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse3 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/kernels/cpu/kernel_sse41.cpp000066400000000000000000000024431334742672700251150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Optimized CPU kernel entry points. This file is compiled with SSE3/SSSE3 * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ #include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # define KERNEL_STUB #else /* SSE optimization disabled for now on 32 bit, see bug #36316 */ # if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86))) # define __KERNEL_SSE2__ # define __KERNEL_SSE3__ # define __KERNEL_SSSE3__ # define __KERNEL_SSE41__ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */ #include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse41 #include "kernel/kernels/cpu/kernel_cpu_impl.h" goxel-0.8.1/ext_src/cycles/src/kernel/osl/000077500000000000000000000000001334742672700204525ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/osl/CMakeLists.txt000066400000000000000000000007141334742672700232140ustar00rootroot00000000000000 set(INC ../.. ) set(INC_SYS ) set(SRC background.cpp bsdf_diffuse_ramp.cpp bsdf_phong_ramp.cpp emissive.cpp osl_bssrdf.cpp osl_closures.cpp osl_services.cpp osl_shader.cpp ) set(HEADER_SRC osl_closures.h osl_globals.h osl_services.h osl_shader.h ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}") include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) cycles_add_library(cycles_kernel_osl ${SRC} ${HEADER_SRC}) goxel-0.8.1/ext_src/cycles/src/kernel/osl/background.cpp000066400000000000000000000076361334742672700233110ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ #include #include #include "kernel/osl/osl_closures.h" #include "kernel/kernel_compat_cpu.h" #include "kernel/closure/alloc.h" #include "kernel/closure/emissive.h" CCL_NAMESPACE_BEGIN using namespace OSL; /// Generic background closure /// /// We only have a background closure for the shaders /// to return a color in background shaders. No methods, /// only the weight is taking into account /// class GenericBackgroundClosure : public CClosurePrimitive { public: void setup(ShaderData *sd, int /* path_flag */, float3 weight) { background_setup(sd, weight); } }; /// Holdout closure /// /// This will be used by the shader to mark the /// amount of holdout for the current shading /// point. No parameters, only the weight will be /// used /// class HoldoutClosure : CClosurePrimitive { public: void setup(ShaderData *sd, int /* path_flag */, float3 weight) { closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_HOLDOUT_ID, weight); sd->flag |= SD_HOLDOUT; } }; /// ambient occlusion closure /// /// We only have a ambient occlusion closure for the shaders /// to return a color in ambient occlusion shaders. No methods, /// only the weight is taking into account /// class AmbientOcclusionClosure : public CClosurePrimitive { public: void setup(ShaderData *sd, int /* path_flag */, float3 weight) { closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_AMBIENT_OCCLUSION_ID, weight); sd->flag |= SD_AO; } }; ClosureParam *closure_background_params() { static ClosureParam params[] = { CLOSURE_STRING_KEYPARAM(GenericBackgroundClosure, label, "label"), CLOSURE_FINISH_PARAM(GenericBackgroundClosure) }; return params; } CCLOSURE_PREPARE(closure_background_prepare, GenericBackgroundClosure) ClosureParam *closure_holdout_params() { static ClosureParam params[] = { CLOSURE_FINISH_PARAM(HoldoutClosure) }; return params; } CCLOSURE_PREPARE(closure_holdout_prepare, HoldoutClosure) ClosureParam *closure_ambient_occlusion_params() { static ClosureParam params[] = { CLOSURE_STRING_KEYPARAM(AmbientOcclusionClosure, label, "label"), CLOSURE_FINISH_PARAM(AmbientOcclusionClosure) }; return params; } CCLOSURE_PREPARE(closure_ambient_occlusion_prepare, AmbientOcclusionClosure) CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/bsdf_diffuse_ramp.cpp000066400000000000000000000056621334742672700246310ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ #include #include #include "kernel/kernel_compat_cpu.h" #include "kernel/osl/osl_closures.h" #include "kernel/kernel_types.h" #include "kernel/kernel_montecarlo.h" #include "kernel/closure/alloc.h" #include "kernel/closure/bsdf_diffuse_ramp.h" CCL_NAMESPACE_BEGIN using namespace OSL; class DiffuseRampClosure : public CBSDFClosure { public: DiffuseRampBsdf params; Color3 colors[8]; void setup(ShaderData *sd, int /* path_flag */, float3 weight) { DiffuseRampBsdf *bsdf = (DiffuseRampBsdf*)bsdf_alloc_osl(sd, sizeof(DiffuseRampBsdf), weight, ¶ms); if(bsdf) { bsdf->colors = (float3*)closure_alloc_extra(sd, sizeof(float3)*8); if(bsdf->colors) { for(int i = 0; i < 8; i++) bsdf->colors[i] = TO_FLOAT3(colors[i]); sd->flag |= bsdf_diffuse_ramp_setup(bsdf); } } } }; ClosureParam *closure_bsdf_diffuse_ramp_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(DiffuseRampClosure, params.N), CLOSURE_COLOR_ARRAY_PARAM(DiffuseRampClosure, colors, 8), CLOSURE_STRING_KEYPARAM(DiffuseRampClosure, label, "label"), CLOSURE_FINISH_PARAM(DiffuseRampClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_diffuse_ramp_prepare, DiffuseRampClosure) CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/bsdf_phong_ramp.cpp000066400000000000000000000056521334742672700243160ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ #include #include #include "kernel/kernel_compat_cpu.h" #include "kernel/osl/osl_closures.h" #include "kernel/kernel_types.h" #include "kernel/closure/alloc.h" #include "kernel/closure/bsdf_phong_ramp.h" CCL_NAMESPACE_BEGIN using namespace OSL; class PhongRampClosure : public CBSDFClosure { public: PhongRampBsdf params; Color3 colors[8]; void setup(ShaderData *sd, int /* path_flag */, float3 weight) { PhongRampBsdf *bsdf = (PhongRampBsdf*)bsdf_alloc_osl(sd, sizeof(PhongRampBsdf), weight, ¶ms); if(bsdf) { bsdf->colors = (float3*)closure_alloc_extra(sd, sizeof(float3)*8); if(bsdf->colors) { for(int i = 0; i < 8; i++) bsdf->colors[i] = TO_FLOAT3(colors[i]); sd->flag |= bsdf_phong_ramp_setup(bsdf); } } } }; ClosureParam *closure_bsdf_phong_ramp_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(PhongRampClosure, params.N), CLOSURE_FLOAT_PARAM(PhongRampClosure, params.exponent), CLOSURE_COLOR_ARRAY_PARAM(PhongRampClosure, colors, 8), CLOSURE_STRING_KEYPARAM(PhongRampClosure, label, "label"), CLOSURE_FINISH_PARAM(PhongRampClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_phong_ramp_prepare, PhongRampClosure) CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/emissive.cpp000066400000000000000000000053031334742672700230030ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ #include #include #include "kernel/osl/osl_closures.h" #include "kernel/kernel_compat_cpu.h" #include "kernel/kernel_types.h" #include "kernel/closure/alloc.h" #include "kernel/closure/emissive.h" CCL_NAMESPACE_BEGIN using namespace OSL; /// Variable cone emissive closure /// /// This primitive emits in a cone having a configurable /// penumbra area where the light decays to 0 reaching the /// outer_angle limit. It can also behave as a lambertian emitter /// if the provided angles are PI/2, which is the default /// class GenericEmissiveClosure : public CClosurePrimitive { public: void setup(ShaderData *sd, int /* path_flag */, float3 weight) { emission_setup(sd, weight); } }; ClosureParam *closure_emission_params() { static ClosureParam params[] = { CLOSURE_STRING_KEYPARAM(GenericEmissiveClosure, label, "label"), CLOSURE_FINISH_PARAM(GenericEmissiveClosure) }; return params; } CCLOSURE_PREPARE(closure_emission_prepare, GenericEmissiveClosure) CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_bssrdf.cpp000066400000000000000000000112211334742672700233130ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ #include #include "kernel/kernel_compat_cpu.h" #include "kernel/osl/osl_closures.h" #include "kernel/kernel_types.h" #include "kernel/kernel_montecarlo.h" #include "kernel/closure/alloc.h" #include "kernel/closure/bsdf_util.h" #include "kernel/closure/bsdf_diffuse.h" #include "kernel/closure/bsdf_principled_diffuse.h" #include "kernel/closure/bssrdf.h" CCL_NAMESPACE_BEGIN using namespace OSL; static ustring u_cubic("cubic"); static ustring u_gaussian("gaussian"); static ustring u_burley("burley"); static ustring u_principled("principled"); static ustring u_random_walk("random_walk"); static ustring u_principled_random_walk("principled_random_walk"); class CBSSRDFClosure : public CClosurePrimitive { public: Bssrdf params; ustring method; CBSSRDFClosure() { params.texture_blur = 0.0f; params.sharpness = 0.0f; params.roughness = 0.0f; } void setup(ShaderData *sd, int path_flag, float3 weight) { if (method == u_cubic) { alloc(sd, path_flag, weight, CLOSURE_BSSRDF_CUBIC_ID); } else if (method == u_gaussian) { alloc(sd, path_flag, weight, CLOSURE_BSSRDF_GAUSSIAN_ID); } else if (method == u_burley) { alloc(sd, path_flag, weight, CLOSURE_BSSRDF_BURLEY_ID); } else if (method == u_principled) { alloc(sd, path_flag, weight, CLOSURE_BSSRDF_PRINCIPLED_ID); } else if (method == u_random_walk) { alloc(sd, path_flag, weight, CLOSURE_BSSRDF_RANDOM_WALK_ID); } else if (method == u_principled_random_walk) { alloc(sd, path_flag, weight, CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID); } } void alloc(ShaderData *sd, int path_flag, float3 weight, ClosureType type) { Bssrdf *bssrdf = bssrdf_alloc(sd, weight); if(bssrdf) { /* disable in case of diffuse ancestor, can't see it well then and * adds considerably noise due to probabilities of continuing path * getting lower and lower */ if(path_flag & PATH_RAY_DIFFUSE_ANCESTOR) { params.radius = make_float3(0.0f, 0.0f, 0.0f); } /* create one closure per color channel */ bssrdf->radius = params.radius; bssrdf->albedo = params.albedo; bssrdf->texture_blur = params.texture_blur; bssrdf->sharpness = params.sharpness; bssrdf->N = params.N; bssrdf->roughness = params.roughness; sd->flag |= bssrdf_setup(sd, bssrdf, (ClosureType)type); } } }; ClosureParam *closure_bssrdf_params() { static ClosureParam params[] = { CLOSURE_STRING_PARAM(CBSSRDFClosure, method), CLOSURE_FLOAT3_PARAM(CBSSRDFClosure, params.N), CLOSURE_FLOAT3_PARAM(CBSSRDFClosure, params.radius), CLOSURE_FLOAT3_PARAM(CBSSRDFClosure, params.albedo), CLOSURE_FLOAT_KEYPARAM(CBSSRDFClosure, params.texture_blur, "texture_blur"), CLOSURE_FLOAT_KEYPARAM(CBSSRDFClosure, params.sharpness, "sharpness"), CLOSURE_FLOAT_KEYPARAM(CBSSRDFClosure, params.roughness, "roughness"), CLOSURE_STRING_KEYPARAM(CBSSRDFClosure, label, "label"), CLOSURE_FINISH_PARAM(CBSSRDFClosure) }; return params; } CCLOSURE_PREPARE(closure_bssrdf_prepare, CBSSRDFClosure) CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_closures.cpp000066400000000000000000000710351334742672700237000ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ #include #include #include "kernel/osl/osl_closures.h" #include "kernel/osl/osl_shader.h" #include "util/util_math.h" #include "util/util_param.h" #include "kernel/kernel_types.h" #include "kernel/kernel_compat_cpu.h" #include "kernel/split/kernel_split_data_types.h" #include "kernel/kernel_globals.h" #include "kernel/kernel_montecarlo.h" #include "kernel/kernel_random.h" #include "kernel/closure/alloc.h" #include "kernel/closure/bsdf_util.h" #include "kernel/closure/bsdf_ashikhmin_velvet.h" #include "kernel/closure/bsdf_diffuse.h" #include "kernel/closure/bsdf_microfacet.h" #include "kernel/closure/bsdf_microfacet_multi.h" #include "kernel/closure/bsdf_oren_nayar.h" #include "kernel/closure/bsdf_reflection.h" #include "kernel/closure/bsdf_refraction.h" #include "kernel/closure/bsdf_transparent.h" #include "kernel/closure/bsdf_ashikhmin_shirley.h" #include "kernel/closure/bsdf_toon.h" #include "kernel/closure/bsdf_hair.h" #include "kernel/closure/bsdf_principled_diffuse.h" #include "kernel/closure/bsdf_principled_sheen.h" #include "kernel/closure/volume.h" CCL_NAMESPACE_BEGIN using namespace OSL; /* BSDF class definitions */ BSDF_CLOSURE_CLASS_BEGIN(Diffuse, diffuse, DiffuseBsdf, LABEL_DIFFUSE) CLOSURE_FLOAT3_PARAM(DiffuseClosure, params.N), BSDF_CLOSURE_CLASS_END(Diffuse, diffuse) BSDF_CLOSURE_CLASS_BEGIN(Translucent, translucent, DiffuseBsdf, LABEL_DIFFUSE) CLOSURE_FLOAT3_PARAM(TranslucentClosure, params.N), BSDF_CLOSURE_CLASS_END(Translucent, translucent) BSDF_CLOSURE_CLASS_BEGIN(OrenNayar, oren_nayar, OrenNayarBsdf, LABEL_DIFFUSE) CLOSURE_FLOAT3_PARAM(OrenNayarClosure, params.N), CLOSURE_FLOAT_PARAM(OrenNayarClosure, params.roughness), BSDF_CLOSURE_CLASS_END(OrenNayar, oren_nayar) BSDF_CLOSURE_CLASS_BEGIN(Reflection, reflection, MicrofacetBsdf, LABEL_SINGULAR) CLOSURE_FLOAT3_PARAM(ReflectionClosure, params.N), BSDF_CLOSURE_CLASS_END(Reflection, reflection) BSDF_CLOSURE_CLASS_BEGIN(Refraction, refraction, MicrofacetBsdf, LABEL_SINGULAR) CLOSURE_FLOAT3_PARAM(RefractionClosure, params.N), CLOSURE_FLOAT_PARAM(RefractionClosure, params.ior), BSDF_CLOSURE_CLASS_END(Refraction, refraction) BSDF_CLOSURE_CLASS_BEGIN(AshikhminVelvet, ashikhmin_velvet, VelvetBsdf, LABEL_DIFFUSE) CLOSURE_FLOAT3_PARAM(AshikhminVelvetClosure, params.N), CLOSURE_FLOAT_PARAM(AshikhminVelvetClosure, params.sigma), BSDF_CLOSURE_CLASS_END(AshikhminVelvet, ashikhmin_velvet) BSDF_CLOSURE_CLASS_BEGIN(AshikhminShirley, ashikhmin_shirley_aniso, MicrofacetBsdf, LABEL_GLOSSY|LABEL_REFLECT) CLOSURE_FLOAT3_PARAM(AshikhminShirleyClosure, params.N), CLOSURE_FLOAT3_PARAM(AshikhminShirleyClosure, params.T), CLOSURE_FLOAT_PARAM(AshikhminShirleyClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(AshikhminShirleyClosure, params.alpha_y), BSDF_CLOSURE_CLASS_END(AshikhminShirley, ashikhmin_shirley_aniso) BSDF_CLOSURE_CLASS_BEGIN(DiffuseToon, diffuse_toon, ToonBsdf, LABEL_DIFFUSE) CLOSURE_FLOAT3_PARAM(DiffuseToonClosure, params.N), CLOSURE_FLOAT_PARAM(DiffuseToonClosure, params.size), CLOSURE_FLOAT_PARAM(DiffuseToonClosure, params.smooth), BSDF_CLOSURE_CLASS_END(DiffuseToon, diffuse_toon) BSDF_CLOSURE_CLASS_BEGIN(GlossyToon, glossy_toon, ToonBsdf, LABEL_GLOSSY) CLOSURE_FLOAT3_PARAM(GlossyToonClosure, params.N), CLOSURE_FLOAT_PARAM(GlossyToonClosure, params.size), CLOSURE_FLOAT_PARAM(GlossyToonClosure, params.smooth), BSDF_CLOSURE_CLASS_END(GlossyToon, glossy_toon) BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGX, microfacet_ggx, MicrofacetBsdf, LABEL_GLOSSY|LABEL_REFLECT) CLOSURE_FLOAT3_PARAM(MicrofacetGGXClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure, params.alpha_x), BSDF_CLOSURE_CLASS_END(MicrofacetGGX, microfacet_ggx) BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGXAniso, microfacet_ggx_aniso, MicrofacetBsdf, LABEL_GLOSSY|LABEL_REFLECT) CLOSURE_FLOAT3_PARAM(MicrofacetGGXAnisoClosure, params.N), CLOSURE_FLOAT3_PARAM(MicrofacetGGXAnisoClosure, params.T), CLOSURE_FLOAT_PARAM(MicrofacetGGXAnisoClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetGGXAnisoClosure, params.alpha_y), BSDF_CLOSURE_CLASS_END(MicrofacetGGXAniso, microfacet_ggx_aniso) BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmann, microfacet_beckmann, MicrofacetBsdf, LABEL_GLOSSY|LABEL_REFLECT) CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure, params.alpha_x), BSDF_CLOSURE_CLASS_END(MicrofacetBeckmann, microfacet_beckmann) BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmannAniso, microfacet_beckmann_aniso, MicrofacetBsdf, LABEL_GLOSSY|LABEL_REFLECT) CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannAnisoClosure, params.N), CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannAnisoClosure, params.T), CLOSURE_FLOAT_PARAM(MicrofacetBeckmannAnisoClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetBeckmannAnisoClosure, params.alpha_y), BSDF_CLOSURE_CLASS_END(MicrofacetBeckmannAniso, microfacet_beckmann_aniso) BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGXRefraction, microfacet_ggx_refraction, MicrofacetBsdf, LABEL_GLOSSY|LABEL_TRANSMIT) CLOSURE_FLOAT3_PARAM(MicrofacetGGXRefractionClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetGGXRefractionClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetGGXRefractionClosure, params.ior), BSDF_CLOSURE_CLASS_END(MicrofacetGGXRefraction, microfacet_ggx_refraction) BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmannRefraction, microfacet_beckmann_refraction, MicrofacetBsdf, LABEL_GLOSSY|LABEL_TRANSMIT) CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannRefractionClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetBeckmannRefractionClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetBeckmannRefractionClosure, params.ior), BSDF_CLOSURE_CLASS_END(MicrofacetBeckmannRefraction, microfacet_beckmann_refraction) BSDF_CLOSURE_CLASS_BEGIN(HairReflection, hair_reflection, HairBsdf, LABEL_GLOSSY) CLOSURE_FLOAT3_PARAM(HairReflectionClosure, params.N), CLOSURE_FLOAT_PARAM(HairReflectionClosure, params.roughness1), CLOSURE_FLOAT_PARAM(HairReflectionClosure, params.roughness2), CLOSURE_FLOAT3_PARAM(HairReflectionClosure, params.T), CLOSURE_FLOAT_PARAM(HairReflectionClosure, params.offset), BSDF_CLOSURE_CLASS_END(HairReflection, hair_reflection) BSDF_CLOSURE_CLASS_BEGIN(HairTransmission, hair_transmission, HairBsdf, LABEL_GLOSSY) CLOSURE_FLOAT3_PARAM(HairTransmissionClosure, params.N), CLOSURE_FLOAT_PARAM(HairTransmissionClosure, params.roughness1), CLOSURE_FLOAT_PARAM(HairTransmissionClosure, params.roughness2), CLOSURE_FLOAT3_PARAM(HairReflectionClosure, params.T), CLOSURE_FLOAT_PARAM(HairReflectionClosure, params.offset), BSDF_CLOSURE_CLASS_END(HairTransmission, hair_transmission) BSDF_CLOSURE_CLASS_BEGIN(PrincipledDiffuse, principled_diffuse, PrincipledDiffuseBsdf, LABEL_DIFFUSE) CLOSURE_FLOAT3_PARAM(PrincipledDiffuseClosure, params.N), CLOSURE_FLOAT_PARAM(PrincipledDiffuseClosure, params.roughness), BSDF_CLOSURE_CLASS_END(PrincipledDiffuse, principled_diffuse) BSDF_CLOSURE_CLASS_BEGIN(PrincipledSheen, principled_sheen, PrincipledSheenBsdf, LABEL_DIFFUSE) CLOSURE_FLOAT3_PARAM(PrincipledSheenClosure, params.N), BSDF_CLOSURE_CLASS_END(PrincipledSheen, principled_sheen) /* DISNEY PRINCIPLED CLEARCOAT */ class PrincipledClearcoatClosure : public CBSDFClosure { public: MicrofacetBsdf params; float clearcoat, clearcoat_roughness; MicrofacetBsdf *alloc(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc_osl(sd, sizeof(MicrofacetBsdf), weight, ¶ms); if(!bsdf) { return NULL; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { return NULL; } bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra = extra; bsdf->ior = 1.5f; bsdf->alpha_x = clearcoat_roughness; bsdf->alpha_y = clearcoat_roughness; bsdf->extra->color = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra->cspec0 = make_float3(0.04f, 0.04f, 0.04f); bsdf->extra->clearcoat = clearcoat; return bsdf; } void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } sd->flag |= bsdf_microfacet_ggx_clearcoat_setup(bsdf, sd); } }; ClosureParam *closure_bsdf_principled_clearcoat_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(PrincipledClearcoatClosure, params.N), CLOSURE_FLOAT_PARAM(PrincipledClearcoatClosure, clearcoat), CLOSURE_FLOAT_PARAM(PrincipledClearcoatClosure, clearcoat_roughness), CLOSURE_STRING_KEYPARAM(PrincipledClearcoatClosure, label, "label"), CLOSURE_FINISH_PARAM(PrincipledClearcoatClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_principled_clearcoat_prepare, PrincipledClearcoatClosure) /* Registration */ static void register_closure(OSL::ShadingSystem *ss, const char *name, int id, OSL::ClosureParam *params, OSL::PrepareClosureFunc prepare) { /* optimization: it's possible to not use a prepare function at all and * only initialize the actual class when accessing the closure component * data, but then we need to map the id to the class somehow */ #if OSL_LIBRARY_VERSION_CODE >= 10900 ss->register_closure(name, id, params, prepare, NULL); #else ss->register_closure(name, id, params, prepare, NULL, 16); #endif } void OSLShader::register_closures(OSLShadingSystem *ss_) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)ss_; int id = 0; register_closure(ss, "diffuse", id++, bsdf_diffuse_params(), bsdf_diffuse_prepare); register_closure(ss, "oren_nayar", id++, bsdf_oren_nayar_params(), bsdf_oren_nayar_prepare); register_closure(ss, "translucent", id++, bsdf_translucent_params(), bsdf_translucent_prepare); register_closure(ss, "reflection", id++, bsdf_reflection_params(), bsdf_reflection_prepare); register_closure(ss, "refraction", id++, bsdf_refraction_params(), bsdf_refraction_prepare); register_closure(ss, "transparent", id++, closure_bsdf_transparent_params(), closure_bsdf_transparent_prepare); register_closure(ss, "microfacet_ggx", id++, bsdf_microfacet_ggx_params(), bsdf_microfacet_ggx_prepare); register_closure(ss, "microfacet_ggx_aniso", id++, bsdf_microfacet_ggx_aniso_params(), bsdf_microfacet_ggx_aniso_prepare); register_closure(ss, "microfacet_ggx_refraction", id++, bsdf_microfacet_ggx_refraction_params(), bsdf_microfacet_ggx_refraction_prepare); register_closure(ss, "microfacet_multi_ggx", id++, closure_bsdf_microfacet_multi_ggx_params(), closure_bsdf_microfacet_multi_ggx_prepare); register_closure(ss, "microfacet_multi_ggx_glass", id++, closure_bsdf_microfacet_multi_ggx_glass_params(), closure_bsdf_microfacet_multi_ggx_glass_prepare); register_closure(ss, "microfacet_multi_ggx_aniso", id++, closure_bsdf_microfacet_multi_ggx_aniso_params(), closure_bsdf_microfacet_multi_ggx_aniso_prepare); register_closure(ss, "microfacet_ggx_fresnel", id++, closure_bsdf_microfacet_ggx_fresnel_params(), closure_bsdf_microfacet_ggx_fresnel_prepare); register_closure(ss, "microfacet_ggx_aniso_fresnel", id++, closure_bsdf_microfacet_ggx_aniso_fresnel_params(), closure_bsdf_microfacet_ggx_aniso_fresnel_prepare); register_closure(ss, "microfacet_multi_ggx_fresnel", id++, closure_bsdf_microfacet_multi_ggx_fresnel_params(), closure_bsdf_microfacet_multi_ggx_fresnel_prepare); register_closure(ss, "microfacet_multi_ggx_glass_fresnel", id++, closure_bsdf_microfacet_multi_ggx_glass_fresnel_params(), closure_bsdf_microfacet_multi_ggx_glass_fresnel_prepare); register_closure(ss, "microfacet_multi_ggx_aniso_fresnel", id++, closure_bsdf_microfacet_multi_ggx_aniso_fresnel_params(), closure_bsdf_microfacet_multi_ggx_aniso_fresnel_prepare); register_closure(ss, "microfacet_beckmann", id++, bsdf_microfacet_beckmann_params(), bsdf_microfacet_beckmann_prepare); register_closure(ss, "microfacet_beckmann_aniso", id++, bsdf_microfacet_beckmann_aniso_params(), bsdf_microfacet_beckmann_aniso_prepare); register_closure(ss, "microfacet_beckmann_refraction", id++, bsdf_microfacet_beckmann_refraction_params(), bsdf_microfacet_beckmann_refraction_prepare); register_closure(ss, "ashikhmin_shirley", id++, bsdf_ashikhmin_shirley_aniso_params(), bsdf_ashikhmin_shirley_aniso_prepare); register_closure(ss, "ashikhmin_velvet", id++, bsdf_ashikhmin_velvet_params(), bsdf_ashikhmin_velvet_prepare); register_closure(ss, "diffuse_toon", id++, bsdf_diffuse_toon_params(), bsdf_diffuse_toon_prepare); register_closure(ss, "glossy_toon", id++, bsdf_glossy_toon_params(), bsdf_glossy_toon_prepare); register_closure(ss, "principled_diffuse", id++, bsdf_principled_diffuse_params(), bsdf_principled_diffuse_prepare); register_closure(ss, "principled_sheen", id++, bsdf_principled_sheen_params(), bsdf_principled_sheen_prepare); register_closure(ss, "principled_clearcoat", id++, closure_bsdf_principled_clearcoat_params(), closure_bsdf_principled_clearcoat_prepare); register_closure(ss, "emission", id++, closure_emission_params(), closure_emission_prepare); register_closure(ss, "background", id++, closure_background_params(), closure_background_prepare); register_closure(ss, "holdout", id++, closure_holdout_params(), closure_holdout_prepare); register_closure(ss, "ambient_occlusion", id++, closure_ambient_occlusion_params(), closure_ambient_occlusion_prepare); register_closure(ss, "diffuse_ramp", id++, closure_bsdf_diffuse_ramp_params(), closure_bsdf_diffuse_ramp_prepare); register_closure(ss, "phong_ramp", id++, closure_bsdf_phong_ramp_params(), closure_bsdf_phong_ramp_prepare); register_closure(ss, "bssrdf", id++, closure_bssrdf_params(), closure_bssrdf_prepare); register_closure(ss, "hair_reflection", id++, bsdf_hair_reflection_params(), bsdf_hair_reflection_prepare); register_closure(ss, "hair_transmission", id++, bsdf_hair_transmission_params(), bsdf_hair_transmission_prepare); register_closure(ss, "henyey_greenstein", id++, closure_henyey_greenstein_params(), closure_henyey_greenstein_prepare); register_closure(ss, "absorption", id++, closure_absorption_params(), closure_absorption_prepare); } /* BSDF Closure */ bool CBSDFClosure::skip(const ShaderData *sd, int path_flag, int scattering) { /* caustic options */ if((scattering & LABEL_GLOSSY) && (path_flag & PATH_RAY_DIFFUSE)) { KernelGlobals *kg = sd->osl_globals; if((!kernel_data.integrator.caustics_reflective && (scattering & LABEL_REFLECT)) || (!kernel_data.integrator.caustics_refractive && (scattering & LABEL_TRANSMIT))) { return true; } } return false; } /* GGX closures with Fresnel */ class MicrofacetFresnelClosure : public CBSDFClosure { public: MicrofacetBsdf params; float3 color; float3 cspec0; MicrofacetBsdf *alloc(ShaderData *sd, int path_flag, float3 weight) { /* Technically, the MultiGGX Glass closure may also transmit. However, * since this is set statically and only used for caustic flags, this * is probably as good as it gets. */ if(skip(sd, path_flag, LABEL_GLOSSY | LABEL_REFLECT)) { return NULL; } MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc_osl(sd, sizeof(MicrofacetBsdf), weight, ¶ms); if(!bsdf) { return NULL; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { return NULL; } bsdf->extra = extra; bsdf->extra->color = color; bsdf->extra->cspec0 = cspec0; bsdf->extra->clearcoat = 0.0f; return bsdf; } }; class MicrofacetGGXFresnelClosure : public MicrofacetFresnelClosure { public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_y = bsdf->alpha_x; sd->flag |= bsdf_microfacet_ggx_fresnel_setup(bsdf, sd); } }; ClosureParam *closure_bsdf_microfacet_ggx_fresnel_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetGGXFresnelClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetGGXFresnelClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetGGXFresnelClosure, params.ior), CLOSURE_FLOAT3_PARAM(MicrofacetGGXFresnelClosure, color), CLOSURE_FLOAT3_PARAM(MicrofacetGGXFresnelClosure, cspec0), CLOSURE_STRING_KEYPARAM(MicrofacetGGXFresnelClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetGGXFresnelClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_ggx_fresnel_prepare, MicrofacetGGXFresnelClosure); class MicrofacetGGXAnisoFresnelClosure : public MicrofacetFresnelClosure { public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } sd->flag |= bsdf_microfacet_ggx_aniso_fresnel_setup(bsdf, sd); } }; ClosureParam *closure_bsdf_microfacet_ggx_aniso_fresnel_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetGGXFresnelClosure, params.N), CLOSURE_FLOAT3_PARAM(MicrofacetGGXFresnelClosure, params.T), CLOSURE_FLOAT_PARAM(MicrofacetGGXFresnelClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetGGXFresnelClosure, params.alpha_y), CLOSURE_FLOAT_PARAM(MicrofacetGGXFresnelClosure, params.ior), CLOSURE_FLOAT3_PARAM(MicrofacetGGXFresnelClosure, color), CLOSURE_FLOAT3_PARAM(MicrofacetGGXFresnelClosure, cspec0), CLOSURE_STRING_KEYPARAM(MicrofacetGGXFresnelClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetGGXFresnelClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_ggx_aniso_fresnel_prepare, MicrofacetGGXAnisoFresnelClosure); /* Multiscattering GGX closures */ class MicrofacetMultiClosure : public CBSDFClosure { public: MicrofacetBsdf params; float3 color; MicrofacetBsdf *alloc(ShaderData *sd, int path_flag, float3 weight) { /* Technically, the MultiGGX closure may also transmit. However, * since this is set statically and only used for caustic flags, this * is probably as good as it gets. */ if(skip(sd, path_flag, LABEL_GLOSSY|LABEL_REFLECT)) { return NULL; } MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc_osl(sd, sizeof(MicrofacetBsdf), weight, ¶ms); if(!bsdf) { return NULL; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { return NULL; } bsdf->extra = extra; bsdf->extra->color = color; bsdf->extra->cspec0 = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra->clearcoat = 0.0f; return bsdf; } }; class MicrofacetMultiGGXClosure : public MicrofacetMultiClosure { public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } bsdf->ior = 0.0f; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_y = bsdf->alpha_x; sd->flag |= bsdf_microfacet_multi_ggx_setup(bsdf); } }; ClosureParam *closure_bsdf_microfacet_multi_ggx_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXClosure, params.alpha_x), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXClosure, color), CLOSURE_STRING_KEYPARAM(MicrofacetMultiGGXClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetMultiGGXClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_multi_ggx_prepare, MicrofacetMultiGGXClosure); class MicrofacetMultiGGXAnisoClosure : public MicrofacetMultiClosure { public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } bsdf->ior = 0.0f; sd->flag |= bsdf_microfacet_multi_ggx_aniso_setup(bsdf); } }; ClosureParam *closure_bsdf_microfacet_multi_ggx_aniso_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXClosure, params.N), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXClosure, params.T), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXClosure, params.alpha_y), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXClosure, color), CLOSURE_STRING_KEYPARAM(MicrofacetMultiGGXClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetMultiGGXClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_multi_ggx_aniso_prepare, MicrofacetMultiGGXAnisoClosure); class MicrofacetMultiGGXGlassClosure : public MicrofacetMultiClosure { public: MicrofacetMultiGGXGlassClosure() : MicrofacetMultiClosure() {} void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_y = bsdf->alpha_x; sd->flag |= bsdf_microfacet_multi_ggx_glass_setup(bsdf); } }; ClosureParam *closure_bsdf_microfacet_multi_ggx_glass_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXClosure, params.ior), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXClosure, color), CLOSURE_STRING_KEYPARAM(MicrofacetMultiGGXClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetMultiGGXClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_multi_ggx_glass_prepare, MicrofacetMultiGGXGlassClosure); /* Multiscattering GGX closures with Fresnel */ class MicrofacetMultiFresnelClosure : public CBSDFClosure { public: MicrofacetBsdf params; float3 color; float3 cspec0; MicrofacetBsdf *alloc(ShaderData *sd, int path_flag, float3 weight) { /* Technically, the MultiGGX closure may also transmit. However, * since this is set statically and only used for caustic flags, this * is probably as good as it gets. */ if(skip(sd, path_flag, LABEL_GLOSSY | LABEL_REFLECT)) { return NULL; } MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc_osl(sd, sizeof(MicrofacetBsdf), weight, ¶ms); if(!bsdf) { return NULL; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { return NULL; } bsdf->extra = extra; bsdf->extra->color = color; bsdf->extra->cspec0 = cspec0; bsdf->extra->clearcoat = 0.0f; return bsdf; } }; class MicrofacetMultiGGXFresnelClosure : public MicrofacetMultiFresnelClosure { public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_y = bsdf->alpha_x; sd->flag |= bsdf_microfacet_multi_ggx_fresnel_setup(bsdf, sd); } }; ClosureParam *closure_bsdf_microfacet_multi_ggx_fresnel_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXFresnelClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXFresnelClosure, params.ior), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, color), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, cspec0), CLOSURE_STRING_KEYPARAM(MicrofacetMultiGGXFresnelClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetMultiGGXFresnelClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_multi_ggx_fresnel_prepare, MicrofacetMultiGGXFresnelClosure); class MicrofacetMultiGGXAnisoFresnelClosure : public MicrofacetMultiFresnelClosure { public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } sd->flag |= bsdf_microfacet_multi_ggx_aniso_fresnel_setup(bsdf, sd); } }; ClosureParam *closure_bsdf_microfacet_multi_ggx_aniso_fresnel_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, params.N), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, params.T), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXFresnelClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXFresnelClosure, params.alpha_y), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXFresnelClosure, params.ior), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, color), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, cspec0), CLOSURE_STRING_KEYPARAM(MicrofacetMultiGGXFresnelClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetMultiGGXFresnelClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_multi_ggx_aniso_fresnel_prepare, MicrofacetMultiGGXAnisoFresnelClosure); class MicrofacetMultiGGXGlassFresnelClosure : public MicrofacetMultiFresnelClosure { public: MicrofacetMultiGGXGlassFresnelClosure() : MicrofacetMultiFresnelClosure() {} void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); if(!bsdf) { return; } bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_y = bsdf->alpha_x; sd->flag |= bsdf_microfacet_multi_ggx_glass_fresnel_setup(bsdf, sd); } }; ClosureParam *closure_bsdf_microfacet_multi_ggx_glass_fresnel_params() { static ClosureParam params[] = { CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, params.N), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXFresnelClosure, params.alpha_x), CLOSURE_FLOAT_PARAM(MicrofacetMultiGGXFresnelClosure, params.ior), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, color), CLOSURE_FLOAT3_PARAM(MicrofacetMultiGGXFresnelClosure, cspec0), CLOSURE_STRING_KEYPARAM(MicrofacetMultiGGXFresnelClosure, label, "label"), CLOSURE_FINISH_PARAM(MicrofacetMultiGGXFresnelClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_microfacet_multi_ggx_glass_fresnel_prepare, MicrofacetMultiGGXGlassFresnelClosure); /* Transparent */ class TransparentClosure : public CBSDFClosure { public: ShaderClosure params; float3 unused; void setup(ShaderData *sd, int path_flag, float3 weight) { bsdf_transparent_setup(sd, weight, path_flag); } }; ClosureParam *closure_bsdf_transparent_params() { static ClosureParam params[] = { CLOSURE_STRING_KEYPARAM(TransparentClosure, label, "label"), CLOSURE_FINISH_PARAM(TransparentClosure) }; return params; } CCLOSURE_PREPARE(closure_bsdf_transparent_prepare, TransparentClosure) /* Volume */ class VolumeAbsorptionClosure : public CBSDFClosure { public: void setup(ShaderData *sd, int path_flag, float3 weight) { volume_extinction_setup(sd, weight); } }; ClosureParam *closure_absorption_params() { static ClosureParam params[] = { CLOSURE_STRING_KEYPARAM(VolumeAbsorptionClosure, label, "label"), CLOSURE_FINISH_PARAM(VolumeAbsorptionClosure) }; return params; } CCLOSURE_PREPARE(closure_absorption_prepare, VolumeAbsorptionClosure) class VolumeHenyeyGreensteinClosure : public CBSDFClosure { public: HenyeyGreensteinVolume params; void setup(ShaderData *sd, int path_flag, float3 weight) { volume_extinction_setup(sd, weight); HenyeyGreensteinVolume *volume = (HenyeyGreensteinVolume*)bsdf_alloc_osl(sd, sizeof(HenyeyGreensteinVolume), weight, ¶ms); if(!volume) { return; } sd->flag |= volume_henyey_greenstein_setup(volume); } }; ClosureParam *closure_henyey_greenstein_params() { static ClosureParam params[] = { CLOSURE_FLOAT_PARAM(VolumeHenyeyGreensteinClosure, params.g), CLOSURE_STRING_KEYPARAM(VolumeHenyeyGreensteinClosure, label, "label"), CLOSURE_FINISH_PARAM(VolumeHenyeyGreensteinClosure) }; return params; } CCLOSURE_PREPARE(closure_henyey_greenstein_prepare, VolumeHenyeyGreensteinClosure) CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_closures.h000066400000000000000000000145561334742672700233520ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 __OSL_CLOSURES_H__ #define __OSL_CLOSURES_H__ #include "util/util_types.h" #include "kernel/kernel_types.h" #include #include #include CCL_NAMESPACE_BEGIN OSL::ClosureParam *closure_emission_params(); OSL::ClosureParam *closure_background_params(); OSL::ClosureParam *closure_holdout_params(); OSL::ClosureParam *closure_ambient_occlusion_params(); OSL::ClosureParam *closure_bsdf_diffuse_ramp_params(); OSL::ClosureParam *closure_bsdf_phong_ramp_params(); OSL::ClosureParam *closure_bsdf_transparent_params(); OSL::ClosureParam *closure_bssrdf_params(); OSL::ClosureParam *closure_absorption_params(); OSL::ClosureParam *closure_henyey_greenstein_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_glass_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_aniso_params(); OSL::ClosureParam *closure_bsdf_microfacet_ggx_fresnel_params(); OSL::ClosureParam *closure_bsdf_microfacet_ggx_aniso_fresnel_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_fresnel_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_glass_fresnel_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_aniso_fresnel_params(); OSL::ClosureParam *closure_bsdf_principled_clearcoat_params(); void closure_emission_prepare(OSL::RendererServices *, int id, void *data); void closure_background_prepare(OSL::RendererServices *, int id, void *data); void closure_holdout_prepare(OSL::RendererServices *, int id, void *data); void closure_ambient_occlusion_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_diffuse_ramp_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_phong_ramp_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_transparent_prepare(OSL::RendererServices *, int id, void *data); void closure_bssrdf_prepare(OSL::RendererServices *, int id, void *data); void closure_absorption_prepare(OSL::RendererServices *, int id, void *data); void closure_henyey_greenstein_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_glass_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_aniso_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_ggx_fresnel_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_ggx_aniso_fresnel_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_fresnel_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_glass_fresnel_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_aniso_fresnel_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_principled_clearcoat_prepare(OSL::RendererServices *, int id, void *data); #define CCLOSURE_PREPARE(name, classname) \ void name(RendererServices *, int id, void *data) \ { \ memset(data, 0, sizeof(classname)); \ new (data) classname(); \ } #define CCLOSURE_PREPARE_STATIC(name, classname) static CCLOSURE_PREPARE(name, classname) #define CLOSURE_FLOAT3_PARAM(st, fld) \ { TypeDesc::TypeVector, (int)reckless_offsetof(st, fld), NULL, sizeof(OSL::Vec3) } #define TO_VEC3(v) OSL::Vec3(v.x, v.y, v.z) #define TO_COLOR3(v) OSL::Color3(v.x, v.y, v.z) #define TO_FLOAT3(v) make_float3(v[0], v[1], v[2]) /* Closure */ class CClosurePrimitive { public: virtual void setup(ShaderData *sd, int path_flag, float3 weight) = 0; OSL::ustring label; }; /* BSDF */ class CBSDFClosure : public CClosurePrimitive { public: bool skip(const ShaderData *sd, int path_flag, int scattering); }; #define BSDF_CLOSURE_CLASS_BEGIN(Upper, lower, structname, TYPE) \ \ class Upper##Closure : public CBSDFClosure { \ public: \ structname params; \ float3 unused; \ \ void setup(ShaderData *sd, int path_flag, float3 weight) \ { \ if(!skip(sd, path_flag, TYPE)) { \ structname *bsdf = (structname*)bsdf_alloc_osl(sd, sizeof(structname), weight, ¶ms); \ sd->flag |= (bsdf) ? bsdf_##lower##_setup(bsdf) : 0; \ } \ } \ }; \ \ static ClosureParam *bsdf_##lower##_params() \ { \ static ClosureParam params[] = { /* parameters */ #define BSDF_CLOSURE_CLASS_END(Upper, lower) \ CLOSURE_STRING_KEYPARAM(Upper##Closure, label, "label"), \ CLOSURE_FINISH_PARAM(Upper##Closure) \ }; \ return params; \ } \ \ CCLOSURE_PREPARE_STATIC(bsdf_##lower##_prepare, Upper##Closure) CCL_NAMESPACE_END #endif /* __OSL_CLOSURES_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_globals.h000066400000000000000000000041361334742672700231270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __OSL_GLOBALS_H__ #define __OSL_GLOBALS_H__ #ifdef WITH_OSL #include #include "util/util_map.h" #include "util/util_param.h" #include "util/util_thread.h" #include "util/util_vector.h" #ifndef WIN32 using std::isfinite; #endif CCL_NAMESPACE_BEGIN class OSLRenderServices; struct OSLGlobals { OSLGlobals() { ss = NULL; ts = NULL; services = NULL; use = false; } bool use; /* shading system */ OSL::ShadingSystem *ss; OSL::TextureSystem *ts; OSLRenderServices *services; /* shader states */ vector surface_state; vector volume_state; vector displacement_state; vector bump_state; OSL::ShaderGroupRef background_state; /* attributes */ struct Attribute { TypeDesc type; AttributeDescriptor desc; ParamValue value; }; typedef unordered_map AttributeMap; typedef unordered_map ObjectNameMap; vector attribute_map; ObjectNameMap object_name_map; vector object_names; }; /* trace() call result */ struct OSLTraceData { Ray ray; Intersection isect; ShaderData sd; bool setup; bool init; }; /* thread key for thread specific data lookup */ struct OSLThreadData { OSL::ShaderGlobals globals; OSL::PerThreadInfo *osl_thread_info; OSLTraceData tracedata; OSL::ShadingContext *context; OIIO::TextureSystem::Perthread *oiio_thread_info; }; CCL_NAMESPACE_END #endif #endif /* __OSL_GLOBALS_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_services.cpp000066400000000000000000001117701334742672700236650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* TODO(sergey): There is a bit of headers dependency hell going on * here, so for now we just put here. In the future it might be better * to have dedicated file for such tweaks. */ #if (defined(__GNUC__) && !defined(__clang__)) && defined(NDEBUG) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" # pragma GCC diagnostic ignored "-Wuninitialized" #endif #include #include "render/mesh.h" #include "render/object.h" #include "render/scene.h" #include "kernel/osl/osl_closures.h" #include "kernel/osl/osl_globals.h" #include "kernel/osl/osl_services.h" #include "kernel/osl/osl_shader.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_string.h" #include "kernel/kernel_compat_cpu.h" #include "kernel/split/kernel_split_data_types.h" #include "kernel/kernel_globals.h" #include "kernel/kernel_random.h" #include "kernel/kernel_projection.h" #include "kernel/kernel_differential.h" #include "kernel/kernel_montecarlo.h" #include "kernel/kernel_camera.h" #include "kernel/kernels/cpu/kernel_cpu_image.h" #include "kernel/geom/geom.h" #include "kernel/bvh/bvh.h" #include "kernel/kernel_projection.h" #include "kernel/kernel_accumulate.h" #include "kernel/kernel_shader.h" #ifdef WITH_PTEX # include #endif CCL_NAMESPACE_BEGIN /* RenderServices implementation */ #define COPY_MATRIX44(m1, m2) { \ CHECK_TYPE(m1, OSL::Matrix44*); \ CHECK_TYPE(m2, Transform*); \ memcpy(m1, m2, sizeof(*m2)); \ } (void)0 /* static ustrings */ ustring OSLRenderServices::u_distance("distance"); ustring OSLRenderServices::u_index("index"); ustring OSLRenderServices::u_world("world"); ustring OSLRenderServices::u_camera("camera"); ustring OSLRenderServices::u_screen("screen"); ustring OSLRenderServices::u_raster("raster"); ustring OSLRenderServices::u_ndc("NDC"); ustring OSLRenderServices::u_object_location("object:location"); ustring OSLRenderServices::u_object_index("object:index"); ustring OSLRenderServices::u_geom_dupli_generated("geom:dupli_generated"); ustring OSLRenderServices::u_geom_dupli_uv("geom:dupli_uv"); ustring OSLRenderServices::u_material_index("material:index"); ustring OSLRenderServices::u_object_random("object:random"); ustring OSLRenderServices::u_particle_index("particle:index"); ustring OSLRenderServices::u_particle_random("particle:random"); ustring OSLRenderServices::u_particle_age("particle:age"); ustring OSLRenderServices::u_particle_lifetime("particle:lifetime"); ustring OSLRenderServices::u_particle_location("particle:location"); ustring OSLRenderServices::u_particle_rotation("particle:rotation"); ustring OSLRenderServices::u_particle_size("particle:size"); ustring OSLRenderServices::u_particle_velocity("particle:velocity"); ustring OSLRenderServices::u_particle_angular_velocity("particle:angular_velocity"); ustring OSLRenderServices::u_geom_numpolyvertices("geom:numpolyvertices"); ustring OSLRenderServices::u_geom_trianglevertices("geom:trianglevertices"); ustring OSLRenderServices::u_geom_polyvertices("geom:polyvertices"); ustring OSLRenderServices::u_geom_name("geom:name"); ustring OSLRenderServices::u_geom_undisplaced("geom:undisplaced"); ustring OSLRenderServices::u_is_smooth("geom:is_smooth"); ustring OSLRenderServices::u_is_curve("geom:is_curve"); ustring OSLRenderServices::u_curve_thickness("geom:curve_thickness"); ustring OSLRenderServices::u_curve_tangent_normal("geom:curve_tangent_normal"); ustring OSLRenderServices::u_curve_random("geom:curve_random"); ustring OSLRenderServices::u_path_ray_length("path:ray_length"); ustring OSLRenderServices::u_path_ray_depth("path:ray_depth"); ustring OSLRenderServices::u_path_diffuse_depth("path:diffuse_depth"); ustring OSLRenderServices::u_path_glossy_depth("path:glossy_depth"); ustring OSLRenderServices::u_path_transparent_depth("path:transparent_depth"); ustring OSLRenderServices::u_path_transmission_depth("path:transmission_depth"); ustring OSLRenderServices::u_trace("trace"); ustring OSLRenderServices::u_hit("hit"); ustring OSLRenderServices::u_hitdist("hitdist"); ustring OSLRenderServices::u_N("N"); ustring OSLRenderServices::u_Ng("Ng"); ustring OSLRenderServices::u_P("P"); ustring OSLRenderServices::u_I("I"); ustring OSLRenderServices::u_u("u"); ustring OSLRenderServices::u_v("v"); ustring OSLRenderServices::u_empty; ustring OSLRenderServices::u_at_bevel("@bevel"); OSLRenderServices::OSLRenderServices() { kernel_globals = NULL; osl_ts = NULL; #ifdef WITH_PTEX size_t maxmem = 16384 * 1024; ptex_cache = PtexCache::create(0, maxmem); #endif } OSLRenderServices::~OSLRenderServices() { if(osl_ts) { VLOG(2) << "OSL texture system stats:\n" << osl_ts->getstats(); } #ifdef WITH_PTEX ptex_cache->release(); #endif } void OSLRenderServices::thread_init(KernelGlobals *kernel_globals_, OSL::TextureSystem *osl_ts_) { kernel_globals = kernel_globals_; osl_ts = osl_ts_; } bool OSLRenderServices::get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) { /* this is only used for shader and object space, we don't really have * a concept of shader space, so we just use object space for both. */ if(xform) { const ShaderData *sd = (const ShaderData *)xform; KernelGlobals *kg = sd->osl_globals; int object = sd->object; if(object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm; if(time == sd->time) tfm = sd->ob_tfm; else tfm = object_fetch_transform_motion_test(kg, object, time, NULL); #else Transform tfm = object_fetch_transform(kg, object, OBJECT_TRANSFORM); #endif tfm = transform_transpose(tfm); COPY_MATRIX44(&result, &tfm); return true; } else if(sd->type == PRIMITIVE_LAMP) { Transform tfm = transform_transpose(sd->ob_tfm); COPY_MATRIX44(&result, &tfm); return true; } } return false; } bool OSLRenderServices::get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) { /* this is only used for shader and object space, we don't really have * a concept of shader space, so we just use object space for both. */ if(xform) { const ShaderData *sd = (const ShaderData *)xform; KernelGlobals *kg = sd->osl_globals; int object = sd->object; if(object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform itfm; if(time == sd->time) itfm = sd->ob_itfm; else object_fetch_transform_motion_test(kg, object, time, &itfm); #else Transform itfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); #endif itfm = transform_transpose(itfm); COPY_MATRIX44(&result, &itfm); return true; } else if(sd->type == PRIMITIVE_LAMP) { Transform tfm = transform_transpose(sd->ob_itfm); COPY_MATRIX44(&result, &tfm); return true; } } return false; } bool OSLRenderServices::get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from, float time) { KernelGlobals *kg = kernel_globals; if(from == u_ndc) { Transform tfm = transform_transpose(transform_quick_inverse(kernel_data.cam.worldtondc)); COPY_MATRIX44(&result, &tfm); return true; } else if(from == u_raster) { Transform tfm = transform_transpose(kernel_data.cam.rastertoworld); COPY_MATRIX44(&result, &tfm); return true; } else if(from == u_screen) { Transform tfm = transform_transpose(kernel_data.cam.screentoworld); COPY_MATRIX44(&result, &tfm); return true; } else if(from == u_camera) { Transform tfm = transform_transpose(kernel_data.cam.cameratoworld); COPY_MATRIX44(&result, &tfm); return true; } else if(from == u_world) { result.makeIdentity(); return true; } return false; } bool OSLRenderServices::get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring to, float time) { KernelGlobals *kg = kernel_globals; if(to == u_ndc) { Transform tfm = transform_transpose(kernel_data.cam.worldtondc); COPY_MATRIX44(&result, &tfm); return true; } else if(to == u_raster) { Transform tfm = transform_transpose(kernel_data.cam.worldtoraster); COPY_MATRIX44(&result, &tfm); return true; } else if(to == u_screen) { Transform tfm = transform_transpose(kernel_data.cam.worldtoscreen); COPY_MATRIX44(&result, &tfm); return true; } else if(to == u_camera) { Transform tfm = transform_transpose(kernel_data.cam.worldtocamera); COPY_MATRIX44(&result, &tfm); return true; } else if(to == u_world) { result.makeIdentity(); return true; } return false; } bool OSLRenderServices::get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform) { /* this is only used for shader and object space, we don't really have * a concept of shader space, so we just use object space for both. */ if(xform) { const ShaderData *sd = (const ShaderData *)xform; int object = sd->object; if(object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_tfm; #else KernelGlobals *kg = sd->osl_globals; Transform tfm = object_fetch_transform(kg, object, OBJECT_TRANSFORM); #endif tfm = transform_transpose(tfm); COPY_MATRIX44(&result, &tfm); return true; } else if(sd->type == PRIMITIVE_LAMP) { Transform tfm = transform_transpose(sd->ob_tfm); COPY_MATRIX44(&result, &tfm); return true; } } return false; } bool OSLRenderServices::get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform) { /* this is only used for shader and object space, we don't really have * a concept of shader space, so we just use object space for both. */ if(xform) { const ShaderData *sd = (const ShaderData *)xform; int object = sd->object; if(object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm = sd->ob_itfm; #else KernelGlobals *kg = sd->osl_globals; Transform tfm = object_fetch_transform(kg, object, OBJECT_INVERSE_TRANSFORM); #endif tfm = transform_transpose(tfm); COPY_MATRIX44(&result, &tfm); return true; } else if(sd->type == PRIMITIVE_LAMP) { Transform tfm = transform_transpose(sd->ob_itfm); COPY_MATRIX44(&result, &tfm); return true; } } return false; } bool OSLRenderServices::get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from) { KernelGlobals *kg = kernel_globals; if(from == u_ndc) { Transform tfm = transform_transpose(transform_quick_inverse(kernel_data.cam.worldtondc)); COPY_MATRIX44(&result, &tfm); return true; } else if(from == u_raster) { Transform tfm = transform_transpose(kernel_data.cam.rastertoworld); COPY_MATRIX44(&result, &tfm); return true; } else if(from == u_screen) { Transform tfm = transform_transpose(kernel_data.cam.screentoworld); COPY_MATRIX44(&result, &tfm); return true; } else if(from == u_camera) { Transform tfm = transform_transpose(kernel_data.cam.cameratoworld); COPY_MATRIX44(&result, &tfm); return true; } return false; } bool OSLRenderServices::get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring to) { KernelGlobals *kg = kernel_globals; if(to == u_ndc) { Transform tfm = transform_transpose(kernel_data.cam.worldtondc); COPY_MATRIX44(&result, &tfm); return true; } else if(to == u_raster) { Transform tfm = transform_transpose(kernel_data.cam.worldtoraster); COPY_MATRIX44(&result, &tfm); return true; } else if(to == u_screen) { Transform tfm = transform_transpose(kernel_data.cam.worldtoscreen); COPY_MATRIX44(&result, &tfm); return true; } else if(to == u_camera) { Transform tfm = transform_transpose(kernel_data.cam.worldtocamera); COPY_MATRIX44(&result, &tfm); return true; } return false; } bool OSLRenderServices::get_array_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, int index, void *val) { return false; } static bool set_attribute_float3(float3 f[3], TypeDesc type, bool derivatives, void *val) { if(type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) { float *fval = (float *)val; fval[0] = f[0].x; fval[1] = f[0].y; fval[2] = f[0].z; if(derivatives) { fval[3] = f[1].x; fval[4] = f[1].y; fval[5] = f[1].z; fval[6] = f[2].x; fval[7] = f[2].y; fval[8] = f[2].z; } return true; } else if(type == TypeDesc::TypeFloat) { float *fval = (float *)val; fval[0] = average(f[0]); if(derivatives) { fval[1] = average(f[1]); fval[2] = average(f[2]); } return true; } return false; } static bool set_attribute_float3(float3 f, TypeDesc type, bool derivatives, void *val) { float3 fv[3]; fv[0] = f; fv[1] = make_float3(0.0f, 0.0f, 0.0f); fv[2] = make_float3(0.0f, 0.0f, 0.0f); return set_attribute_float3(fv, type, derivatives, val); } static bool set_attribute_float(float f[3], TypeDesc type, bool derivatives, void *val) { if(type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) { float *fval = (float *)val; fval[0] = f[0]; fval[1] = f[1]; fval[2] = f[2]; if(derivatives) { fval[3] = f[1]; fval[4] = f[1]; fval[5] = f[1]; fval[6] = f[2]; fval[7] = f[2]; fval[8] = f[2]; } return true; } else if(type == TypeDesc::TypeFloat) { float *fval = (float *)val; fval[0] = f[0]; if(derivatives) { fval[1] = f[1]; fval[2] = f[2]; } return true; } return false; } static bool set_attribute_float(float f, TypeDesc type, bool derivatives, void *val) { float fv[3]; fv[0] = f; fv[1] = 0.0f; fv[2] = 0.0f; return set_attribute_float(fv, type, derivatives, val); } static bool set_attribute_int(int i, TypeDesc type, bool derivatives, void *val) { if(type.basetype == TypeDesc::INT && type.aggregate == TypeDesc::SCALAR && type.arraylen == 0) { int *ival = (int *)val; ival[0] = i; if(derivatives) { ival[1] = 0; ival[2] = 0; } return true; } return false; } static bool set_attribute_string(ustring str, TypeDesc type, bool derivatives, void *val) { if(type.basetype == TypeDesc::STRING && type.aggregate == TypeDesc::SCALAR && type.arraylen == 0) { ustring *sval = (ustring *)val; sval[0] = str; if(derivatives) { sval[1] = OSLRenderServices::u_empty; sval[2] = OSLRenderServices::u_empty; } return true; } return false; } static bool set_attribute_float3_3(float3 P[3], TypeDesc type, bool derivatives, void *val) { if(type.vecsemantics == TypeDesc::POINT && type.arraylen >= 3) { float *fval = (float *)val; fval[0] = P[0].x; fval[1] = P[0].y; fval[2] = P[0].z; fval[3] = P[1].x; fval[4] = P[1].y; fval[5] = P[1].z; fval[6] = P[2].x; fval[7] = P[2].y; fval[8] = P[2].z; if(type.arraylen > 3) memset(fval + 3*3, 0, sizeof(float)*3*(type.arraylen - 3)); if(derivatives) memset(fval + type.arraylen*3, 0, sizeof(float)*2*3*type.arraylen); return true; } return false; } static bool set_attribute_matrix(const Transform& tfm, TypeDesc type, void *val) { if(type == TypeDesc::TypeMatrix) { Transform transpose = transform_transpose(tfm); memcpy(val, &transpose, sizeof(Transform)); return true; } return false; } static bool get_mesh_element_attribute(KernelGlobals *kg, const ShaderData *sd, const OSLGlobals::Attribute& attr, const TypeDesc& type, bool derivatives, void *val) { if(attr.type == TypeDesc::TypePoint || attr.type == TypeDesc::TypeVector || attr.type == TypeDesc::TypeNormal || attr.type == TypeDesc::TypeColor) { float3 fval[3]; fval[0] = primitive_attribute_float3(kg, sd, attr.desc, (derivatives) ? &fval[1] : NULL, (derivatives) ? &fval[2] : NULL); return set_attribute_float3(fval, type, derivatives, val); } else if(attr.type == TypeDesc::TypeFloat) { float fval[3]; fval[0] = primitive_attribute_float(kg, sd, attr.desc, (derivatives) ? &fval[1] : NULL, (derivatives) ? &fval[2] : NULL); return set_attribute_float(fval, type, derivatives, val); } else { return false; } } static bool get_mesh_attribute(KernelGlobals *kg, const ShaderData *sd, const OSLGlobals::Attribute& attr, const TypeDesc& type, bool derivatives, void *val) { if(attr.type == TypeDesc::TypeMatrix) { Transform tfm = primitive_attribute_matrix(kg, sd, attr.desc); return set_attribute_matrix(tfm, type, val); } else { return false; } } static void get_object_attribute(const OSLGlobals::Attribute& attr, bool derivatives, void *val) { size_t datasize = attr.value.datasize(); memcpy(val, attr.value.data(), datasize); if(derivatives) memset((char *)val + datasize, 0, datasize * 2); } bool OSLRenderServices::get_object_standard_attribute(KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val) { /* todo: turn this into hash table? */ /* Object Attributes */ if(name == u_object_location) { float3 f = object_location(kg, sd); return set_attribute_float3(f, type, derivatives, val); } else if(name == u_object_index) { float f = object_pass_id(kg, sd->object); return set_attribute_float(f, type, derivatives, val); } else if(name == u_geom_dupli_generated) { float3 f = object_dupli_generated(kg, sd->object); return set_attribute_float3(f, type, derivatives, val); } else if(name == u_geom_dupli_uv) { float3 f = object_dupli_uv(kg, sd->object); return set_attribute_float3(f, type, derivatives, val); } else if(name == u_material_index) { float f = shader_pass_id(kg, sd); return set_attribute_float(f, type, derivatives, val); } else if(name == u_object_random) { float f = object_random_number(kg, sd->object); return set_attribute_float(f, type, derivatives, val); } /* Particle Attributes */ else if(name == u_particle_index) { int particle_id = object_particle_id(kg, sd->object); float f = particle_index(kg, particle_id); return set_attribute_float(f, type, derivatives, val); } else if(name == u_particle_random) { int particle_id = object_particle_id(kg, sd->object); float f = hash_int_01(particle_index(kg, particle_id)); return set_attribute_float(f, type, derivatives, val); } else if(name == u_particle_age) { int particle_id = object_particle_id(kg, sd->object); float f = particle_age(kg, particle_id); return set_attribute_float(f, type, derivatives, val); } else if(name == u_particle_lifetime) { int particle_id = object_particle_id(kg, sd->object); float f = particle_lifetime(kg, particle_id); return set_attribute_float(f, type, derivatives, val); } else if(name == u_particle_location) { int particle_id = object_particle_id(kg, sd->object); float3 f = particle_location(kg, particle_id); return set_attribute_float3(f, type, derivatives, val); } #if 0 /* unsupported */ else if(name == u_particle_rotation) { int particle_id = object_particle_id(kg, sd->object); float4 f = particle_rotation(kg, particle_id); return set_attribute_float4(f, type, derivatives, val); } #endif else if(name == u_particle_size) { int particle_id = object_particle_id(kg, sd->object); float f = particle_size(kg, particle_id); return set_attribute_float(f, type, derivatives, val); } else if(name == u_particle_velocity) { int particle_id = object_particle_id(kg, sd->object); float3 f = particle_velocity(kg, particle_id); return set_attribute_float3(f, type, derivatives, val); } else if(name == u_particle_angular_velocity) { int particle_id = object_particle_id(kg, sd->object); float3 f = particle_angular_velocity(kg, particle_id); return set_attribute_float3(f, type, derivatives, val); } /* Geometry Attributes */ else if(name == u_geom_numpolyvertices) { return set_attribute_int(3, type, derivatives, val); } else if((name == u_geom_trianglevertices || name == u_geom_polyvertices) && sd->type & PRIMITIVE_ALL_TRIANGLE) { float3 P[3]; if(sd->type & PRIMITIVE_TRIANGLE) triangle_vertices(kg, sd->prim, P); else motion_triangle_vertices(kg, sd->object, sd->prim, sd->time, P); if(!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { object_position_transform(kg, sd, &P[0]); object_position_transform(kg, sd, &P[1]); object_position_transform(kg, sd, &P[2]); } return set_attribute_float3_3(P, type, derivatives, val); } else if(name == u_geom_name) { ustring object_name = kg->osl->object_names[sd->object]; return set_attribute_string(object_name, type, derivatives, val); } else if(name == u_is_smooth) { float f = ((sd->shader & SHADER_SMOOTH_NORMAL) != 0); return set_attribute_float(f, type, derivatives, val); } /* Hair Attributes */ else if(name == u_is_curve) { float f = (sd->type & PRIMITIVE_ALL_CURVE) != 0; return set_attribute_float(f, type, derivatives, val); } else if(name == u_curve_thickness) { float f = curve_thickness(kg, sd); return set_attribute_float(f, type, derivatives, val); } else if(name == u_curve_tangent_normal) { float3 f = curve_tangent_normal(kg, sd); return set_attribute_float3(f, type, derivatives, val); } else return false; } bool OSLRenderServices::get_background_attribute(KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val) { if(name == u_path_ray_length) { /* Ray Length */ float f = sd->ray_length; return set_attribute_float(f, type, derivatives, val); } else if(name == u_path_ray_depth) { /* Ray Depth */ PathState *state = sd->osl_path_state; int f = state->bounce; return set_attribute_int(f, type, derivatives, val); } else if(name == u_path_diffuse_depth) { /* Diffuse Ray Depth */ PathState *state = sd->osl_path_state; int f = state->diffuse_bounce; return set_attribute_int(f, type, derivatives, val); } else if(name == u_path_glossy_depth) { /* Glossy Ray Depth */ PathState *state = sd->osl_path_state; int f = state->glossy_bounce; return set_attribute_int(f, type, derivatives, val); } else if(name == u_path_transmission_depth) { /* Transmission Ray Depth */ PathState *state = sd->osl_path_state; int f = state->transmission_bounce; return set_attribute_int(f, type, derivatives, val); } else if(name == u_path_transparent_depth) { /* Transparent Ray Depth */ PathState *state = sd->osl_path_state; int f = state->transparent_bounce; return set_attribute_int(f, type, derivatives, val); } else if(name == u_path_transmission_depth) { /* Transmission Ray Depth */ PathState *state = sd->osl_path_state; int f = state->transmission_bounce; return set_attribute_int(f, type, derivatives, val); } else if(name == u_ndc) { /* NDC coordinates with special exception for otho */ OSLThreadData *tdata = kg->osl_tdata; OSL::ShaderGlobals *globals = &tdata->globals; float3 ndc[3]; if((globals->raytype & PATH_RAY_CAMERA) && sd->object == OBJECT_NONE && kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) { ndc[0] = camera_world_to_ndc(kg, sd, sd->ray_P); if(derivatives) { ndc[1] = camera_world_to_ndc(kg, sd, sd->ray_P + sd->ray_dP.dx) - ndc[0]; ndc[2] = camera_world_to_ndc(kg, sd, sd->ray_P + sd->ray_dP.dy) - ndc[0]; } } else { ndc[0] = camera_world_to_ndc(kg, sd, sd->P); if(derivatives) { ndc[1] = camera_world_to_ndc(kg, sd, sd->P + sd->dP.dx) - ndc[0]; ndc[2] = camera_world_to_ndc(kg, sd, sd->P + sd->dP.dy) - ndc[0]; } } return set_attribute_float3(ndc, type, derivatives, val); } else return false; } bool OSLRenderServices::get_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object_name, TypeDesc type, ustring name, void *val) { if(sg == NULL || sg->renderstate == NULL) return false; ShaderData *sd = (ShaderData *)(sg->renderstate); return get_attribute(sd, derivatives, object_name, type, name, val); } bool OSLRenderServices::get_attribute(ShaderData *sd, bool derivatives, ustring object_name, TypeDesc type, ustring name, void *val) { KernelGlobals *kg = sd->osl_globals; int prim_type = 0; int object; /* lookup of attribute on another object */ if(object_name != u_empty) { OSLGlobals::ObjectNameMap::iterator it = kg->osl->object_name_map.find(object_name); if(it == kg->osl->object_name_map.end()) return false; object = it->second; } else { object = sd->object; prim_type = attribute_primitive_type(kg, sd); if(object == OBJECT_NONE) return get_background_attribute(kg, sd, name, type, derivatives, val); } /* find attribute on object */ object = object*ATTR_PRIM_TYPES + prim_type; OSLGlobals::AttributeMap& attribute_map = kg->osl->attribute_map[object]; OSLGlobals::AttributeMap::iterator it = attribute_map.find(name); if(it != attribute_map.end()) { const OSLGlobals::Attribute& attr = it->second; if(attr.desc.element != ATTR_ELEMENT_OBJECT) { /* triangle and vertex attributes */ if(get_mesh_element_attribute(kg, sd, attr, type, derivatives, val)) return true; else return get_mesh_attribute(kg, sd, attr, type, derivatives, val); } else { /* object attribute */ get_object_attribute(attr, derivatives, val); return true; } } else { /* not found in attribute, check standard object info */ bool is_std_object_attribute = get_object_standard_attribute(kg, sd, name, type, derivatives, val); if(is_std_object_attribute) return true; return get_background_attribute(kg, sd, name, type, derivatives, val); } return false; } bool OSLRenderServices::get_userdata(bool derivatives, ustring name, TypeDesc type, OSL::ShaderGlobals *sg, void *val) { return false; /* disabled by lockgeom */ } bool OSLRenderServices::has_userdata(ustring name, TypeDesc type, OSL::ShaderGlobals *sg) { return false; /* never called by OSL */ } bool OSLRenderServices::texture(ustring filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, float s, float t, float dsdx, float dtdx, float dsdy, float dtdy, int nchannels, float *result, float *dresultds, float *dresultdt) { OSL::TextureSystem *ts = osl_ts; ShaderData *sd = (ShaderData *)(sg->renderstate); KernelGlobals *kg = sd->osl_globals; if(texture_thread_info == NULL) { OSLThreadData *tdata = kg->osl_tdata; texture_thread_info = tdata->oiio_thread_info; } #ifdef WITH_PTEX /* todo: this is just a quick hack, only works with particular files and options */ if(string_endswith(filename.string(), ".ptx")) { float2 uv; int faceid; if(!primitive_ptex(kg, sd, &uv, &faceid)) return false; float u = uv.x; float v = uv.y; float dudx = 0.0f; float dvdx = 0.0f; float dudy = 0.0f; float dvdy = 0.0f; Ptex::String error; PtexPtr r(ptex_cache->get(filename.c_str(), error)); if(!r) { //std::cerr << error.c_str() << std::endl; return false; } bool mipmaplerp = false; float sharpness = 1.0f; PtexFilter::Options opts(PtexFilter::f_bicubic, mipmaplerp, sharpness); PtexPtr f(PtexFilter::getFilter(r, opts)); f->eval(result, options.firstchannel, nchannels, faceid, u, v, dudx, dvdx, dudy, dvdy); for(int c = r->numChannels(); c < nchannels; c++) result[c] = result[0]; return true; } #endif bool status = false; if(filename.length() && filename[0] == '@') { if(filename == u_at_bevel) { /* Bevel shader hack. */ if(nchannels >= 3) { PathState *state = sd->osl_path_state; int num_samples = (int)s; float radius = t; float3 N = svm_bevel(kg, sd, state, radius, num_samples); result[0] = N.x; result[1] = N.y; result[2] = N.z; status = true; } } else { /* Packed texture. */ int slot = atoi(filename.c_str() + 1); float4 rgba = kernel_tex_image_interp(kg, slot, s, 1.0f - t); result[0] = rgba[0]; if(nchannels > 1) result[1] = rgba[1]; if(nchannels > 2) result[2] = rgba[2]; if(nchannels > 3) result[3] = rgba[3]; status = true; } } else { if(texture_handle != NULL) { status = ts->texture(texture_handle, texture_thread_info, options, s, t, dsdx, dtdx, dsdy, dtdy, nchannels, result, dresultds, dresultdt); } else { status = ts->texture(filename, options, s, t, dsdx, dtdx, dsdy, dtdy, nchannels, result, dresultds, dresultdt); } } if(!status) { if(nchannels == 3 || nchannels == 4) { result[0] = 1.0f; result[1] = 0.0f; result[2] = 1.0f; if(nchannels == 4) result[3] = 1.0f; } /* This might be slow, but prevents error messages leak and * other nasty stuff happening. */ string err = ts->geterror(); (void)err; } return status; } bool OSLRenderServices::texture3d(ustring filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &dPdz, int nchannels, float *result, float *dresultds, float *dresultdt, float *dresultdr) { OSL::TextureSystem *ts = osl_ts; ShaderData *sd = (ShaderData *)(sg->renderstate); KernelGlobals *kg = sd->osl_globals; if(texture_thread_info == NULL) { OSLThreadData *tdata = kg->osl_tdata; texture_thread_info = tdata->oiio_thread_info; } bool status; if(filename.length() && filename[0] == '@') { int slot = atoi(filename.c_str() + 1); float4 rgba = kernel_tex_image_interp_3d(kg, slot, P.x, P.y, P.z, INTERPOLATION_NONE); result[0] = rgba[0]; if(nchannels > 1) result[1] = rgba[1]; if(nchannels > 2) result[2] = rgba[2]; if(nchannels > 3) result[3] = rgba[3]; status = true; } else { if(texture_handle != NULL) { status = ts->texture3d(texture_handle, texture_thread_info, options, P, dPdx, dPdy, dPdz, nchannels, result, dresultds, dresultdt, dresultdr); } else { status = ts->texture3d(filename, options, P, dPdx, dPdy, dPdz, nchannels, result, dresultds, dresultdt, dresultdr); } } if(!status) { if(nchannels == 3 || nchannels == 4) { result[0] = 1.0f; result[1] = 0.0f; result[2] = 1.0f; if(nchannels == 4) result[3] = 1.0f; } /* This might be slow, but prevents error messages leak and * other nasty stuff happening. */ string err = ts->geterror(); (void)err; } return status; } bool OSLRenderServices::environment(ustring filename, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, int nchannels, float *result) { OSL::TextureSystem *ts = osl_ts; ShaderData *sd = (ShaderData *)(sg->renderstate); KernelGlobals *kg = sd->osl_globals; OSLThreadData *tdata = kg->osl_tdata; OIIO::TextureSystem::Perthread *thread_info = tdata->oiio_thread_info; OIIO::TextureSystem::TextureHandle *th = ts->get_texture_handle(filename, thread_info); bool status = ts->environment(th, thread_info, options, R, dRdx, dRdy, nchannels, result); if(!status) { if(nchannels == 3 || nchannels == 4) { result[0] = 1.0f; result[1] = 0.0f; result[2] = 1.0f; if(nchannels == 4) result[3] = 1.0f; } } return status; } bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg, ustring filename, int subimage, ustring dataname, TypeDesc datatype, void *data) { OSL::TextureSystem *ts = osl_ts; return ts->get_texture_info(filename, subimage, dataname, datatype, data); } int OSLRenderServices::pointcloud_search(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 ¢er, float radius, int max_points, bool sort, size_t *out_indices, float *out_distances, int derivs_offset) { return 0; } int OSLRenderServices::pointcloud_get(OSL::ShaderGlobals *sg, ustring filename, size_t *indices, int count, ustring attr_name, TypeDesc attr_type, void *out_data) { return 0; } bool OSLRenderServices::pointcloud_write(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &pos, int nattribs, const ustring *names, const TypeDesc *types, const void **data) { return false; } bool OSLRenderServices::trace(TraceOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy) { /* todo: options.shader support, maybe options.traceset */ ShaderData *sd = (ShaderData *)(sg->renderstate); /* setup ray */ Ray ray; ray.P = TO_FLOAT3(P); ray.D = TO_FLOAT3(R); ray.t = (options.maxdist == 1.0e30f)? FLT_MAX: options.maxdist - options.mindist; ray.time = sd->time; if(options.mindist == 0.0f) { /* avoid self-intersections */ if(ray.P == sd->P) { bool transmit = (dot(sd->Ng, ray.D) < 0.0f); ray.P = ray_offset(sd->P, (transmit)? -sd->Ng: sd->Ng); } } else { /* offset for minimum distance */ ray.P += options.mindist*ray.D; } /* ray differentials */ ray.dP.dx = TO_FLOAT3(dPdx); ray.dP.dy = TO_FLOAT3(dPdy); ray.dD.dx = TO_FLOAT3(dRdx); ray.dD.dy = TO_FLOAT3(dRdy); /* allocate trace data */ OSLTraceData *tracedata = (OSLTraceData*)sg->tracedata; tracedata->ray = ray; tracedata->setup = false; tracedata->init = true; tracedata->sd.osl_globals = sd->osl_globals; /* Raytrace, leaving out shadow opaque to avoid early exit. */ uint visibility = PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE; return scene_intersect(sd->osl_globals, ray, visibility, &tracedata->isect, NULL, 0.0f, 0.0f); } bool OSLRenderServices::getmessage(OSL::ShaderGlobals *sg, ustring source, ustring name, TypeDesc type, void *val, bool derivatives) { OSLTraceData *tracedata = (OSLTraceData*)sg->tracedata; if(source == u_trace && tracedata->init) { if(name == u_hit) { return set_attribute_int((tracedata->isect.prim != PRIM_NONE), type, derivatives, val); } else if(tracedata->isect.prim != PRIM_NONE) { if(name == u_hitdist) { float f[3] = {tracedata->isect.t, 0.0f, 0.0f}; return set_attribute_float(f, type, derivatives, val); } else { ShaderData *sd = &tracedata->sd; KernelGlobals *kg = sd->osl_globals; if(!tracedata->setup) { /* lazy shader data setup */ shader_setup_from_ray(kg, sd, &tracedata->isect, &tracedata->ray); tracedata->setup = true; } if(name == u_N) { return set_attribute_float3(sd->N, type, derivatives, val); } else if(name == u_Ng) { return set_attribute_float3(sd->Ng, type, derivatives, val); } else if(name == u_P) { float3 f[3] = {sd->P, sd->dP.dx, sd->dP.dy}; return set_attribute_float3(f, type, derivatives, val); } else if(name == u_I) { float3 f[3] = {sd->I, sd->dI.dx, sd->dI.dy}; return set_attribute_float3(f, type, derivatives, val); } else if(name == u_u) { float f[3] = {sd->u, sd->du.dx, sd->du.dy}; return set_attribute_float(f, type, derivatives, val); } else if(name == u_v) { float f[3] = {sd->v, sd->dv.dx, sd->dv.dy}; return set_attribute_float(f, type, derivatives, val); } return get_attribute(sd, derivatives, u_empty, type, name, val); } } } return false; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_services.h000066400000000000000000000160671334742672700233350ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __OSL_SERVICES_H__ #define __OSL_SERVICES_H__ /* OSL Render Services * * Implementation of OSL render services, to retriever matrices, attributes, * textures and point clouds. In principle this should only be accessing * kernel data, but currently we also reach back into the Scene to retrieve * attributes. */ #include #include #ifdef WITH_PTEX class PtexCache; #endif CCL_NAMESPACE_BEGIN class Object; class Scene; class Shader; struct ShaderData; struct float3; struct KernelGlobals; class OSLRenderServices : public OSL::RendererServices { public: OSLRenderServices(); ~OSLRenderServices(); void thread_init(KernelGlobals *kernel_globals, OSL::TextureSystem *ts); bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time); bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time); bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from, float time); bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring to, float time); bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform); bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform); bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from); bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from); bool get_array_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, int index, void *val); bool get_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, void *val); bool get_attribute(ShaderData *sd, bool derivatives, ustring object_name, TypeDesc type, ustring name, void *val); bool get_userdata(bool derivatives, ustring name, TypeDesc type, OSL::ShaderGlobals *sg, void *val); bool has_userdata(ustring name, TypeDesc type, OSL::ShaderGlobals *sg); int pointcloud_search(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 ¢er, float radius, int max_points, bool sort, size_t *out_indices, float *out_distances, int derivs_offset); int pointcloud_get(OSL::ShaderGlobals *sg, ustring filename, size_t *indices, int count, ustring attr_name, TypeDesc attr_type, void *out_data); bool pointcloud_write(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &pos, int nattribs, const ustring *names, const TypeDesc *types, const void **data); bool trace(TraceOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy); bool getmessage(OSL::ShaderGlobals *sg, ustring source, ustring name, TypeDesc type, void *val, bool derivatives); bool texture(ustring filename, TextureSystem::TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, float s, float t, float dsdx, float dtdx, float dsdy, float dtdy, int nchannels, float *result, float *dresultds, float *dresultdt); bool texture3d(ustring filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &dPdz, int nchannels, float *result, float *dresultds, float *dresultdt, float *dresultdr); bool environment(ustring filename, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, int nchannels, float *result); bool get_texture_info(OSL::ShaderGlobals *sg, ustring filename, int subimage, ustring dataname, TypeDesc datatype, void *data); static bool get_background_attribute(KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val); static bool get_object_standard_attribute(KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val); static ustring u_distance; static ustring u_index; static ustring u_world; static ustring u_camera; static ustring u_screen; static ustring u_raster; static ustring u_ndc; static ustring u_object_location; static ustring u_object_index; static ustring u_geom_dupli_generated; static ustring u_geom_dupli_uv; static ustring u_material_index; static ustring u_object_random; static ustring u_particle_index; static ustring u_particle_random; static ustring u_particle_age; static ustring u_particle_lifetime; static ustring u_particle_location; static ustring u_particle_rotation; static ustring u_particle_size; static ustring u_particle_velocity; static ustring u_particle_angular_velocity; static ustring u_geom_numpolyvertices; static ustring u_geom_trianglevertices; static ustring u_geom_polyvertices; static ustring u_geom_name; static ustring u_geom_undisplaced; static ustring u_is_smooth; static ustring u_is_curve; static ustring u_curve_thickness; static ustring u_curve_tangent_normal; static ustring u_curve_random; static ustring u_path_ray_length; static ustring u_path_ray_depth; static ustring u_path_diffuse_depth; static ustring u_path_glossy_depth; static ustring u_path_transparent_depth; static ustring u_path_transmission_depth; static ustring u_trace; static ustring u_hit; static ustring u_hitdist; static ustring u_N; static ustring u_Ng; static ustring u_P; static ustring u_I; static ustring u_u; static ustring u_v; static ustring u_empty; static ustring u_at_bevel; private: KernelGlobals *kernel_globals; OSL::TextureSystem *osl_ts; #ifdef WITH_PTEX PtexCache *ptex_cache; #endif }; CCL_NAMESPACE_END #endif /* __OSL_SERVICES_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_shader.cpp000066400000000000000000000274051334742672700233110ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "kernel/kernel_compat_cpu.h" #include "kernel/kernel_montecarlo.h" #include "kernel/kernel_types.h" #include "kernel/split/kernel_split_data_types.h" #include "kernel/kernel_globals.h" #include "kernel/geom/geom_object.h" #include "kernel/osl/osl_closures.h" #include "kernel/osl/osl_globals.h" #include "kernel/osl/osl_services.h" #include "kernel/osl/osl_shader.h" #include "util/util_foreach.h" #include "render/attribute.h" CCL_NAMESPACE_BEGIN /* Threads */ void OSLShader::thread_init(KernelGlobals *kg, KernelGlobals *kernel_globals, OSLGlobals *osl_globals) { /* no osl used? */ if(!osl_globals->use) { kg->osl = NULL; return; } /* per thread kernel data init*/ kg->osl = osl_globals; kg->osl->services->thread_init(kernel_globals, osl_globals->ts); OSL::ShadingSystem *ss = kg->osl->ss; OSLThreadData *tdata = new OSLThreadData(); memset(&tdata->globals, 0, sizeof(OSL::ShaderGlobals)); tdata->globals.tracedata = &tdata->tracedata; tdata->globals.flipHandedness = false; tdata->osl_thread_info = ss->create_thread_info(); tdata->context = ss->get_context(tdata->osl_thread_info); tdata->oiio_thread_info = osl_globals->ts->get_perthread_info(); kg->osl_ss = (OSLShadingSystem*)ss; kg->osl_tdata = tdata; } void OSLShader::thread_free(KernelGlobals *kg) { if(!kg->osl) return; OSL::ShadingSystem *ss = (OSL::ShadingSystem*)kg->osl_ss; OSLThreadData *tdata = kg->osl_tdata; ss->release_context(tdata->context); ss->destroy_thread_info(tdata->osl_thread_info); delete tdata; kg->osl = NULL; kg->osl_ss = NULL; kg->osl_tdata = NULL; } /* Globals */ static void shaderdata_to_shaderglobals(KernelGlobals *kg, ShaderData *sd, PathState *state, int path_flag, OSLThreadData *tdata) { OSL::ShaderGlobals *globals = &tdata->globals; /* copy from shader data to shader globals */ globals->P = TO_VEC3(sd->P); globals->dPdx = TO_VEC3(sd->dP.dx); globals->dPdy = TO_VEC3(sd->dP.dy); globals->I = TO_VEC3(sd->I); globals->dIdx = TO_VEC3(sd->dI.dx); globals->dIdy = TO_VEC3(sd->dI.dy); globals->N = TO_VEC3(sd->N); globals->Ng = TO_VEC3(sd->Ng); globals->u = sd->u; globals->dudx = sd->du.dx; globals->dudy = sd->du.dy; globals->v = sd->v; globals->dvdx = sd->dv.dx; globals->dvdy = sd->dv.dy; globals->dPdu = TO_VEC3(sd->dPdu); globals->dPdv = TO_VEC3(sd->dPdv); globals->surfacearea = (sd->object == OBJECT_NONE) ? 1.0f : object_surface_area(kg, sd->object); globals->time = sd->time; /* booleans */ globals->raytype = path_flag; globals->backfacing = (sd->flag & SD_BACKFACING); /* shader data to be used in services callbacks */ globals->renderstate = sd; /* hacky, we leave it to services to fetch actual object matrix */ globals->shader2common = sd; globals->object2common = sd; /* must be set to NULL before execute */ globals->Ci = NULL; /* clear trace data */ tdata->tracedata.init = false; /* used by renderservices */ sd->osl_globals = kg; sd->osl_path_state = state; } /* Surface */ static void flatten_surface_closure_tree(ShaderData *sd, int path_flag, const OSL::ClosureColor *closure, float3 weight = make_float3(1.0f, 1.0f, 1.0f)) { /* OSL gives us a closure tree, we flatten it into arrays per * closure type, for evaluation, sampling, etc later on. */ switch(closure->id) { case OSL::ClosureColor::MUL: { OSL::ClosureMul *mul = (OSL::ClosureMul *)closure; flatten_surface_closure_tree(sd, path_flag, mul->closure, TO_FLOAT3(mul->weight) * weight); break; } case OSL::ClosureColor::ADD: { OSL::ClosureAdd *add = (OSL::ClosureAdd *)closure; flatten_surface_closure_tree(sd, path_flag, add->closureA, weight); flatten_surface_closure_tree(sd, path_flag, add->closureB, weight); break; } default: { OSL::ClosureComponent *comp = (OSL::ClosureComponent *)closure; CClosurePrimitive *prim = (CClosurePrimitive *)comp->data(); if(prim) { #ifdef OSL_SUPPORTS_WEIGHTED_CLOSURE_COMPONENTS weight = weight*TO_FLOAT3(comp->w); #endif prim->setup(sd, path_flag, weight); } break; } } } void OSLShader::eval_surface(KernelGlobals *kg, ShaderData *sd, PathState *state, int path_flag) { /* setup shader globals from shader data */ OSLThreadData *tdata = kg->osl_tdata; shaderdata_to_shaderglobals(kg, sd, state, path_flag, tdata); /* execute shader for this point */ OSL::ShadingSystem *ss = (OSL::ShadingSystem*)kg->osl_ss; OSL::ShaderGlobals *globals = &tdata->globals; OSL::ShadingContext *octx = tdata->context; int shader = sd->shader & SHADER_MASK; /* automatic bump shader */ if(kg->osl->bump_state[shader]) { /* save state */ float3 P = sd->P; float3 dPdx = sd->dP.dx; float3 dPdy = sd->dP.dy; /* set state as if undisplaced */ if(sd->flag & SD_HAS_DISPLACEMENT) { float data[9]; bool found = kg->osl->services->get_attribute(sd, true, OSLRenderServices::u_empty, TypeDesc::TypeVector, OSLRenderServices::u_geom_undisplaced, data); (void)found; assert(found); memcpy(&sd->P, data, sizeof(float)*3); memcpy(&sd->dP.dx, data+3, sizeof(float)*3); memcpy(&sd->dP.dy, data+6, sizeof(float)*3); object_position_transform(kg, sd, &sd->P); object_dir_transform(kg, sd, &sd->dP.dx); object_dir_transform(kg, sd, &sd->dP.dy); globals->P = TO_VEC3(sd->P); globals->dPdx = TO_VEC3(sd->dP.dx); globals->dPdy = TO_VEC3(sd->dP.dy); } /* execute bump shader */ ss->execute(octx, *(kg->osl->bump_state[shader]), *globals); /* reset state */ sd->P = P; sd->dP.dx = dPdx; sd->dP.dy = dPdy; globals->P = TO_VEC3(P); globals->dPdx = TO_VEC3(dPdx); globals->dPdy = TO_VEC3(dPdy); } /* surface shader */ if(kg->osl->surface_state[shader]) { ss->execute(octx, *(kg->osl->surface_state[shader]), *globals); } /* flatten closure tree */ if(globals->Ci) flatten_surface_closure_tree(sd, path_flag, globals->Ci); } /* Background */ static void flatten_background_closure_tree(ShaderData *sd, const OSL::ClosureColor *closure, float3 weight = make_float3(1.0f, 1.0f, 1.0f)) { /* OSL gives us a closure tree, if we are shading for background there * is only one supported closure type at the moment, which has no evaluation * functions, so we just sum the weights */ switch(closure->id) { case OSL::ClosureColor::MUL: { OSL::ClosureMul *mul = (OSL::ClosureMul *)closure; flatten_background_closure_tree(sd, mul->closure, weight * TO_FLOAT3(mul->weight)); break; } case OSL::ClosureColor::ADD: { OSL::ClosureAdd *add = (OSL::ClosureAdd *)closure; flatten_background_closure_tree(sd, add->closureA, weight); flatten_background_closure_tree(sd, add->closureB, weight); break; } default: { OSL::ClosureComponent *comp = (OSL::ClosureComponent *)closure; CClosurePrimitive *prim = (CClosurePrimitive *)comp->data(); if(prim) { #ifdef OSL_SUPPORTS_WEIGHTED_CLOSURE_COMPONENTS weight = weight*TO_FLOAT3(comp->w); #endif prim->setup(sd, 0, weight); } break; } } } void OSLShader::eval_background(KernelGlobals *kg, ShaderData *sd, PathState *state, int path_flag) { /* setup shader globals from shader data */ OSLThreadData *tdata = kg->osl_tdata; shaderdata_to_shaderglobals(kg, sd, state, path_flag, tdata); /* execute shader for this point */ OSL::ShadingSystem *ss = (OSL::ShadingSystem*)kg->osl_ss; OSL::ShaderGlobals *globals = &tdata->globals; OSL::ShadingContext *octx = tdata->context; if(kg->osl->background_state) { ss->execute(octx, *(kg->osl->background_state), *globals); } /* return background color immediately */ if(globals->Ci) flatten_background_closure_tree(sd, globals->Ci); } /* Volume */ static void flatten_volume_closure_tree(ShaderData *sd, const OSL::ClosureColor *closure, float3 weight = make_float3(1.0f, 1.0f, 1.0f)) { /* OSL gives us a closure tree, we flatten it into arrays per * closure type, for evaluation, sampling, etc later on. */ switch(closure->id) { case OSL::ClosureColor::MUL: { OSL::ClosureMul *mul = (OSL::ClosureMul *)closure; flatten_volume_closure_tree(sd, mul->closure, TO_FLOAT3(mul->weight) * weight); break; } case OSL::ClosureColor::ADD: { OSL::ClosureAdd *add = (OSL::ClosureAdd *)closure; flatten_volume_closure_tree(sd, add->closureA, weight); flatten_volume_closure_tree(sd, add->closureB, weight); break; } default: { OSL::ClosureComponent *comp = (OSL::ClosureComponent *)closure; CClosurePrimitive *prim = (CClosurePrimitive *)comp->data(); if(prim) { #ifdef OSL_SUPPORTS_WEIGHTED_CLOSURE_COMPONENTS weight = weight*TO_FLOAT3(comp->w); #endif prim->setup(sd, 0, weight); } } } } void OSLShader::eval_volume(KernelGlobals *kg, ShaderData *sd, PathState *state, int path_flag) { /* setup shader globals from shader data */ OSLThreadData *tdata = kg->osl_tdata; shaderdata_to_shaderglobals(kg, sd, state, path_flag, tdata); /* execute shader */ OSL::ShadingSystem *ss = (OSL::ShadingSystem*)kg->osl_ss; OSL::ShaderGlobals *globals = &tdata->globals; OSL::ShadingContext *octx = tdata->context; int shader = sd->shader & SHADER_MASK; if(kg->osl->volume_state[shader]) { ss->execute(octx, *(kg->osl->volume_state[shader]), *globals); } /* flatten closure tree */ if(globals->Ci) flatten_volume_closure_tree(sd, globals->Ci); } /* Displacement */ void OSLShader::eval_displacement(KernelGlobals *kg, ShaderData *sd, PathState *state) { /* setup shader globals from shader data */ OSLThreadData *tdata = kg->osl_tdata; shaderdata_to_shaderglobals(kg, sd, state, 0, tdata); /* execute shader */ OSL::ShadingSystem *ss = (OSL::ShadingSystem*)kg->osl_ss; OSL::ShaderGlobals *globals = &tdata->globals; OSL::ShadingContext *octx = tdata->context; int shader = sd->shader & SHADER_MASK; if(kg->osl->displacement_state[shader]) { ss->execute(octx, *(kg->osl->displacement_state[shader]), *globals); } /* get back position */ sd->P = TO_FLOAT3(globals->P); } /* Attributes */ int OSLShader::find_attribute(KernelGlobals *kg, const ShaderData *sd, uint id, AttributeDescriptor *desc) { /* for OSL, a hash map is used to lookup the attribute by name. */ int object = sd->object*ATTR_PRIM_TYPES; #ifdef __HAIR__ if(sd->type & PRIMITIVE_ALL_CURVE) object += ATTR_PRIM_CURVE; #endif OSLGlobals::AttributeMap &attr_map = kg->osl->attribute_map[object]; ustring stdname(std::string("geom:") + std::string(Attribute::standard_name((AttributeStandard)id))); OSLGlobals::AttributeMap::const_iterator it = attr_map.find(stdname); if(it != attr_map.end()) { const OSLGlobals::Attribute &osl_attr = it->second; *desc = osl_attr.desc; if(sd->prim == PRIM_NONE && (AttributeElement)osl_attr.desc.element != ATTR_ELEMENT_MESH) { desc->offset = ATTR_STD_NOT_FOUND; return ATTR_STD_NOT_FOUND; } /* return result */ if(osl_attr.desc.element == ATTR_ELEMENT_NONE) { desc->offset = ATTR_STD_NOT_FOUND; } return desc->offset; } else { desc->offset = ATTR_STD_NOT_FOUND; return (int)ATTR_STD_NOT_FOUND; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/osl/osl_shader.h000066400000000000000000000041031334742672700227440ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __OSL_SHADER_H__ #define __OSL_SHADER_H__ #ifdef WITH_OSL /* OSL Shader Engine * * Holds all variables to execute and use OSL shaders from the kernel. These * are initialized externally by OSLShaderManager before rendering starts. * * Before/after a thread starts rendering, thread_init/thread_free must be * called, which will store any per thread OSL state in thread local storage. * This means no thread state must be passed along in the kernel itself. */ #include "kernel/kernel_types.h" CCL_NAMESPACE_BEGIN class Scene; struct ShaderClosure; struct ShaderData; struct differential3; struct KernelGlobals; struct OSLGlobals; struct OSLShadingSystem; class OSLShader { public: /* init */ static void register_closures(OSLShadingSystem *ss); /* per thread data */ static void thread_init(KernelGlobals *kg, KernelGlobals *kernel_globals, OSLGlobals *osl_globals); static void thread_free(KernelGlobals *kg); /* eval */ static void eval_surface(KernelGlobals *kg, ShaderData *sd, PathState *state, int path_flag); static void eval_background(KernelGlobals *kg, ShaderData *sd, PathState *state, int path_flag); static void eval_volume(KernelGlobals *kg, ShaderData *sd, PathState *state, int path_flag); static void eval_displacement(KernelGlobals *kg, ShaderData *sd, PathState *state); /* attributes */ static int find_attribute(KernelGlobals *kg, const ShaderData *sd, uint id, AttributeDescriptor *desc); }; CCL_NAMESPACE_END #endif #endif /* __OSL_SHADER_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/shaders/000077500000000000000000000000001334742672700213065ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/shaders/CMakeLists.txt000066400000000000000000000060171334742672700240520ustar00rootroot00000000000000 # OSL node shaders set(SRC_OSL node_add_closure.osl node_ambient_occlusion.osl node_anisotropic_bsdf.osl node_attribute.osl node_background.osl node_bevel.osl node_brick_texture.osl node_brightness.osl node_bump.osl node_camera.osl node_checker_texture.osl node_combine_rgb.osl node_combine_hsv.osl node_combine_xyz.osl node_convert_from_color.osl node_convert_from_float.osl node_convert_from_int.osl node_convert_from_normal.osl node_convert_from_point.osl node_convert_from_vector.osl node_diffuse_bsdf.osl node_displacement.osl node_vector_displacement.osl node_emission.osl node_environment_texture.osl node_fresnel.osl node_gamma.osl node_geometry.osl node_glass_bsdf.osl node_glossy_bsdf.osl node_gradient_texture.osl node_hair_info.osl node_scatter_volume.osl node_absorption_volume.osl node_principled_volume.osl node_holdout.osl node_hsv.osl node_image_texture.osl node_invert.osl node_layer_weight.osl node_light_falloff.osl node_light_path.osl node_magic_texture.osl node_mapping.osl node_math.osl node_mix.osl node_mix_closure.osl node_musgrave_texture.osl node_noise_texture.osl node_normal.osl node_normal_map.osl node_object_info.osl node_output_displacement.osl node_output_surface.osl node_output_volume.osl node_particle_info.osl node_refraction_bsdf.osl node_rgb_curves.osl node_rgb_ramp.osl node_separate_rgb.osl node_separate_hsv.osl node_separate_xyz.osl node_set_normal.osl node_sky_texture.osl node_subsurface_scattering.osl node_tangent.osl node_texture_coordinate.osl node_toon_bsdf.osl node_translucent_bsdf.osl node_transparent_bsdf.osl node_value.osl node_vector_curves.osl node_vector_math.osl node_vector_transform.osl node_velvet_bsdf.osl node_voronoi_texture.osl node_voxel_texture.osl node_wavelength.osl node_blackbody.osl node_wave_texture.osl node_wireframe.osl node_hair_bsdf.osl node_uv_map.osl node_principled_bsdf.osl node_rgb_to_bw.osl ) set(SRC_OSL_HEADERS node_color.h node_fresnel.h node_ramp_util.h node_texture.h stdosl.h oslutil.h ) set(SRC_OSO ) # TODO, add a module to compile OSL foreach(_file ${SRC_OSL}) set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file}) set_source_files_properties(${_file} PROPERTIES HEADER_FILE_ONLY TRUE) string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE}) string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE}) add_custom_command( OUTPUT ${_OSO_FILE} COMMAND ${OSL_COMPILER} -q -O2 -I"${CMAKE_CURRENT_SOURCE_DIR}" -o ${_OSO_FILE} ${_OSL_FILE} DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS} ${OSL_COMPILER}) list(APPEND SRC_OSO ${_OSO_FILE} ) unset(_OSL_FILE) unset(_OSO_FILE) endforeach() add_custom_target(cycles_osl_shaders ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS} ${OSL_COMPILER} SOURCES ${SRC_OSL}) cycles_set_solution_folder(cycles_osl_shaders) # CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader) delayed_install("${CMAKE_CURRENT_SOURCE_DIR}" "${SRC_OSL_HEADERS}" ${CYCLES_INSTALL_PATH}/shader) goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_absorption_volume.osl000066400000000000000000000015011334742672700265760ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_absorption_volume( color Color = color(0.8, 0.8, 0.8), float Density = 1.0, output closure color Volume = 0) { Volume = ((color(1.0, 1.0, 1.0) - Color) * max(Density, 0.0)) * absorption(); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_add_closure.osl000066400000000000000000000014141334742672700253160ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_add_closure( closure color Closure1 = 0, closure color Closure2 = 0, output closure color Closure = 0) { Closure = Closure1 + Closure2; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_ambient_occlusion.osl000066400000000000000000000014001334742672700265220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_ambient_occlusion( normal NormalIn = N, color Color = 0.8, output closure color AO = 0) { AO = Color * ambient_occlusion(); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_anisotropic_bsdf.osl000066400000000000000000000034371334742672700263710ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_anisotropic_bsdf( color Color = 0.0, string distribution = "GGX", float Roughness = 0.0, float Anisotropy = 0.0, float Rotation = 0.0, normal Normal = N, normal Tangent = normalize(dPdu), output closure color BSDF = 0) { /* rotate tangent around normal */ vector T = Tangent; if (Rotation != 0.0) T = rotate(T, Rotation * M_2PI, point(0.0, 0.0, 0.0), Normal); /* compute roughness */ float RoughnessU, RoughnessV; float aniso = clamp(Anisotropy, -0.99, 0.99); if (aniso < 0.0) { RoughnessU = Roughness / (1.0 + aniso); RoughnessV = Roughness * (1.0 + aniso); } else { RoughnessU = Roughness * (1.0 - aniso); RoughnessV = Roughness / (1.0 - aniso); } if (distribution == "sharp") BSDF = Color * reflection(Normal); else if (distribution == "beckmann") BSDF = Color * microfacet_beckmann_aniso(Normal, T, RoughnessU, RoughnessV); else if (distribution == "GGX") BSDF = Color * microfacet_ggx_aniso(Normal, T, RoughnessU, RoughnessV); else if (distribution == "Multiscatter GGX") BSDF = Color * microfacet_multi_ggx_aniso(Normal, T, RoughnessU, RoughnessV, Color); else BSDF = Color * ashikhmin_shirley(Normal, T, RoughnessU, RoughnessV); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_attribute.osl000066400000000000000000000020631334742672700250360ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_attribute( string bump_offset = "center", string name = "", output point Vector = point(0.0, 0.0, 0.0), output color Color = 0.0, output float Fac = 0.0) { getattribute(name, Color); Vector = point(Color); getattribute(name, Fac); if (bump_offset == "dx") { Color += Dx(Color); Vector += Dx(Vector); Fac += Dx(Fac); } else if (bump_offset == "dy") { Color += Dy(Color); Vector += Dy(Vector); Fac += Dy(Fac); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_background.osl000066400000000000000000000014161334742672700251530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_background( color Color = 0.8, float Strength = 1.0, output closure color Background = 0) { Background = Color * Strength * background(); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_bevel.osl000066400000000000000000000016601334742672700241320ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_bevel( int samples = 4, float Radius = 0.05, normal NormalIn = N, output normal NormalOut = N) { /* Abuse texture call with special @bevel token. */ vector bevel_N = (normal)(color)texture("@bevel", samples, Radius); /* Preserve input normal. */ NormalOut = normalize(NormalIn + (bevel_N - N)); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_blackbody.osl000066400000000000000000000015121334742672700247630ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_blackbody( float Temperature = 1200.0, output color Color = 0.0) { color rgb = blackbody(Temperature); /* Scale by luminance */ float l = luminance(rgb); if (l != 0.0) rgb /= l; Color = rgb; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_brick_texture.osl000066400000000000000000000054371334742672700257150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Brick */ float brick_noise(int n) /* fast integer noise */ { int nn; n = (n + 1013) & 2147483647; n = (n >> 13) ^ n; nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 2147483647; return 0.5 * ((float)nn / 1073741824.0); } float brick(point p, float mortar_size, float mortar_smooth, float bias, float BrickWidth, float row_height, float offset_amount, int offset_frequency, float squash_amount, int squash_frequency, float tint) { int bricknum, rownum; float offset = 0.0; float brick_width = BrickWidth; float x, y; rownum = (int)floor(p[1] / row_height); if (offset_frequency && squash_frequency) { brick_width *= (rownum % squash_frequency) ? 1.0 : squash_amount; /* squash */ offset = (rownum % offset_frequency) ? 0.0 : (brick_width * offset_amount); /* offset */ } bricknum = (int)floor((p[0] + offset) / brick_width); x = (p[0] + offset) - brick_width * bricknum; y = p[1] - row_height * rownum; tint = clamp((brick_noise((rownum << 16) + (bricknum & 65535)) + bias), 0.0, 1.0); float min_dist = min(min(x, y), min(brick_width - x, row_height - y)); if(min_dist >= mortar_size) { return 0.0; } else if(mortar_smooth == 0.0) { return 1.0; } else { min_dist = 1.0 - min_dist/mortar_size; return smoothstep(0.0, mortar_smooth, min_dist); } } shader node_brick_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), float offset = 0.5, int offset_frequency = 2, float squash = 1.0, int squash_frequency = 1, point Vector = P, color Color1 = 0.2, color Color2 = 0.8, color Mortar = 0.0, float Scale = 5.0, float MortarSize = 0.02, float MortarSmooth = 0.0, float Bias = 0.0, float BrickWidth = 0.5, float RowHeight = 0.25, output float Fac = 0.0, output color Color = 0.2) { point p = Vector; if (use_mapping) p = transform(mapping, p); float tint = 0.0; color Col = Color1; Fac = brick(p * Scale, MortarSize, MortarSmooth, Bias, BrickWidth, RowHeight, offset, offset_frequency, squash, squash_frequency, tint); if (Fac != 1.0) { float facm = 1.0 - tint; Col = facm * Color1 + tint * Color2; } Color = mix(Col, Mortar, Fac); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_brightness.osl000066400000000000000000000016651334742672700252120ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_brightness( color ColorIn = 0.8, float Bright = 0.0, float Contrast = 0.0, output color ColorOut = 0.8) { float a = 1.0 + Contrast; float b = Bright - Contrast * 0.5; ColorOut[0] = max(a * ColorIn[0] + b, 0.0); ColorOut[1] = max(a * ColorIn[1] + b, 0.0); ColorOut[2] = max(a * ColorIn[2] + b, 0.0); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_bump.osl000066400000000000000000000034521334742672700240010ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" /* "Bump Mapping Unparameterized Surfaces on the GPU" * Morten S. Mikkelsen, 2010 */ surface node_bump( int invert = 0, int use_object_space = 0, normal NormalIn = N, float Strength = 0.1, float Distance = 1.0, float SampleCenter = 0.0, float SampleX = 0.0, float SampleY = 0.0, output normal NormalOut = N) { point Ptmp = P; normal Normal = NormalIn; if (use_object_space) { Ptmp = transform("object", Ptmp); Normal = normalize(transform("object", Normal)); } /* get surface tangents from normal */ vector dPdx = Dx(Ptmp); vector dPdy = Dy(Ptmp); vector Rx = cross(dPdy, Normal); vector Ry = cross(Normal, dPdx); /* compute surface gradient and determinant */ float det = dot(dPdx, Rx); vector surfgrad = (SampleX - SampleCenter) * Rx + (SampleY - SampleCenter) * Ry; float absdet = fabs(det); float strength = max(Strength, 0.0); float dist = Distance; if (invert) dist *= -1.0; /* compute and output perturbed normal */ NormalOut = normalize(absdet * Normal - dist * sign(det) * surfgrad); NormalOut = normalize(strength * NormalOut + (1.0 - strength) * Normal); if (use_object_space) { NormalOut = normalize(transform("object", "world", NormalOut)); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_camera.osl000066400000000000000000000016441334742672700242670ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_camera( output vector ViewVector = vector(0.0, 0.0, 0.0), output float ViewZDepth = 0.0, output float ViewDistance = 0.0) { ViewVector = (vector)transform("world", "camera", P); ViewZDepth = fabs(ViewVector[2]); ViewDistance = length(ViewVector); ViewVector = normalize(ViewVector); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_checker_texture.osl000066400000000000000000000026151334742672700262220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Checker */ float checker(point p) { p[0] = (p[0] + 0.000001) * 0.999999; p[1] = (p[1] + 0.000001) * 0.999999; p[2] = (p[2] + 0.000001) * 0.999999; int xi = (int)fabs(floor(p[0])); int yi = (int)fabs(floor(p[1])); int zi = (int)fabs(floor(p[2])); if ((xi % 2 == yi % 2) == (zi % 2)) { return 1.0; } else { return 0.0; } } shader node_checker_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), float Scale = 5.0, point Vector = P, color Color1 = 0.8, color Color2 = 0.2, output float Fac = 0.0, output color Color = 0.0) { point p = Vector; if (use_mapping) p = transform(mapping, p); Fac = checker(p * Scale); if (Fac == 1.0) { Color = Color1; } else { Color = Color2; } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_color.h000066400000000000000000000057031334742672700236070ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ float color_srgb_to_scene_linear(float c) { if (c < 0.04045) return (c < 0.0) ? 0.0 : c * (1.0 / 12.92); else return pow((c + 0.055) * (1.0 / 1.055), 2.4); } float color_scene_linear_to_srgb(float c) { if (c < 0.0031308) return (c < 0.0) ? 0.0 : c * 12.92; else return 1.055 * pow(c, 1.0 / 2.4) - 0.055; } color color_srgb_to_scene_linear(color c) { return color( color_srgb_to_scene_linear(c[0]), color_srgb_to_scene_linear(c[1]), color_srgb_to_scene_linear(c[2])); } color color_scene_linear_to_srgb(color c) { return color( color_scene_linear_to_srgb(c[0]), color_scene_linear_to_srgb(c[1]), color_scene_linear_to_srgb(c[2])); } color color_unpremultiply(color c, float alpha) { if (alpha != 1.0 && alpha != 0.0) return c / alpha; return c; } /* Color Operations */ color xyY_to_xyz(float x, float y, float Y) { float X, Z; if (y != 0.0) X = (x / y) * Y; else X = 0.0; if (y != 0.0 && Y != 0.0) Z = ((1.0 - x - y) / y) * Y; else Z = 0.0; return color(X, Y, Z); } color xyz_to_rgb(float x, float y, float z) { return color( 3.240479 * x + -1.537150 * y + -0.498535 * z, -0.969256 * x + 1.875991 * y + 0.041556 * z, 0.055648 * x + -0.204043 * y + 1.057311 * z); } color rgb_to_hsv(color rgb) { float cmax, cmin, h, s, v, cdelta; color c; cmax = max(rgb[0], max(rgb[1], rgb[2])); cmin = min(rgb[0], min(rgb[1], rgb[2])); cdelta = cmax - cmin; v = cmax; if (cmax != 0.0) { s = cdelta / cmax; } else { s = 0.0; h = 0.0; } if (s == 0.0) { h = 0.0; } else { c = (color(cmax, cmax, cmax) - rgb) / cdelta; if (rgb[0] == cmax) h = c[2] - c[1]; else if (rgb[1] == cmax) h = 2.0 + c[0] - c[2]; else h = 4.0 + c[1] - c[0]; h /= 6.0; if (h < 0.0) h += 1.0; } return color(h, s, v); } color hsv_to_rgb(color hsv) { float i, f, p, q, t, h, s, v; color rgb; h = hsv[0]; s = hsv[1]; v = hsv[2]; if (s == 0.0) { rgb = color(v, v, v); } else { if (h == 1.0) h = 0.0; h *= 6.0; i = floor(h); f = h - i; rgb = color(f, f, f); p = v * (1.0 - s); q = v * (1.0 - (s * f)); t = v * (1.0 - (s * (1.0 - f))); if (i == 0.0) rgb = color(v, t, p); else if (i == 1.0) rgb = color(q, v, p); else if (i == 2.0) rgb = color(p, v, t); else if (i == 3.0) rgb = color(p, q, v); else if (i == 4.0) rgb = color(t, p, v); else rgb = color(v, p, q); } return rgb; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_combine_hsv.osl000066400000000000000000000013731334742672700253320ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_combine_hsv( float H = 0.0, float S = 0.0, float V = 0.0, output color Color = 0.8) { Color = color("hsv", H, S, V); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_combine_rgb.osl000066400000000000000000000013631334742672700253030ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_combine_rgb( float R = 0.0, float G = 0.0, float B = 0.0, output color Image = 0.8) { Image = color(R, G, B); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_combine_xyz.osl000066400000000000000000000013671334742672700253670ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_combine_xyz( float X = 0.0, float Y = 0.0, float Z = 0.0, output vector Vector = 0.8) { Vector = vector(X, Y, Z); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_convert_from_color.osl000066400000000000000000000024751334742672700267430ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_convert_from_color( color value_color = 0.0, output string value_string = "", output float value_float = 0.0, output int value_int = 0, output vector value_vector = vector(0.0, 0.0, 0.0), output point value_point = point(0.0, 0.0, 0.0), output normal value_normal = normal(0.0, 0.0, 0.0)) { value_float = value_color[0] * 0.2126 + value_color[1] * 0.7152 + value_color[2] * 0.0722; value_int = (int)(value_color[0] * 0.2126 + value_color[1] * 0.7152 + value_color[2] * 0.0722); value_vector = vector(value_color[0], value_color[1], value_color[2]); value_point = point(value_color[0], value_color[1], value_color[2]); value_normal = normal(value_color[0], value_color[1], value_color[2]); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_convert_from_float.osl000066400000000000000000000023011334742672700267160ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_convert_from_float( float value_float = 0.0, output string value_string = "", output int value_int = 0, output color value_color = 0.0, output vector value_vector = vector(0.0, 0.0, 0.0), output point value_point = point(0.0, 0.0, 0.0), output normal value_normal = normal(0.0, 0.0, 0.0)) { value_int = (int)value_float; value_color = color(value_float, value_float, value_float); value_vector = vector(value_float, value_float, value_float); value_point = point(value_float, value_float, value_float); value_normal = normal(value_float, value_float, value_float); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_convert_from_int.osl000066400000000000000000000021271334742672700264110ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_convert_from_int( int value_int = 0, output string value_string = "", output float value_float = 0.0, output color value_color = 0.0, output vector value_vector = vector(0.0, 0.0, 0.0), output point value_point = point(0.0, 0.0, 0.0), output normal value_normal = normal(0.0, 0.0, 0.0)) { float f = (float)value_int; value_float = f; value_color = color(f, f, f); value_vector = vector(f, f, f); value_point = point(f, f, f); value_normal = normal(f, f, f); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_convert_from_normal.osl000066400000000000000000000024651334742672700271140ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_convert_from_normal( normal value_normal = normal(0.0, 0.0, 0.0), output string value_string = "", output float value_float = 0.0, output int value_int = 0, output vector value_vector = vector(0.0, 0.0, 0.0), output color value_color = 0.0, output point value_point = point(0.0, 0.0, 0.0)) { value_float = (value_normal[0] + value_normal[1] + value_normal[2]) * (1.0 / 3.0); value_int = (int)((value_normal[0] + value_normal[1] + value_normal[2]) * (1.0 / 3.0)); value_vector = vector(value_normal[0], value_normal[1], value_normal[2]); value_color = color(value_normal[0], value_normal[1], value_normal[2]); value_point = point(value_normal[0], value_normal[1], value_normal[2]); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_convert_from_point.osl000066400000000000000000000024521334742672700267510ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_convert_from_point( point value_point = point(0.0, 0.0, 0.0), output string value_string = "", output float value_float = 0.0, output int value_int = 0, output vector value_vector = vector(0.0, 0.0, 0.0), output color value_color = 0.0, output normal value_normal = normal(0.0, 0.0, 0.0)) { value_float = (value_point[0] + value_point[1] + value_point[2]) * (1.0 / 3.0); value_int = (int)((value_normal[0] + value_normal[1] + value_normal[2]) * (1.0 / 3.0)); value_vector = vector(value_point[0], value_point[1], value_point[2]); value_color = color(value_point[0], value_point[1], value_point[2]); value_normal = normal(value_point[0], value_point[1], value_point[2]); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_convert_from_string.osl000066400000000000000000000016741334742672700271330ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_convert_from_string( string value_string = "", output color value_color = color(0.0, 0.0, 0.0), output float value_float = 0.0, output int value_int = 0, output vector value_vector = vector(0.0, 0.0, 0.0), output point value_point = point(0.0, 0.0, 0.0), output normal value_normal = normal(0.0, 0.0, 0.0)) { } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_convert_from_vector.osl000066400000000000000000000025061334742672700271220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_convert_from_vector( vector value_vector = vector(0.0, 0.0, 0.0), output string value_string = "", output float value_float = 0.0, output int value_int = 0, output color value_color = color(0.0, 0.0, 0.0), output point value_point = point(0.0, 0.0, 0.0), output normal value_normal = normal(0.0, 0.0, 0.0)) { value_float = (value_vector[0] + value_vector[1] + value_vector[2]) * (1.0 / 3.0); value_int = (int)((value_normal[0] + value_normal[1] + value_normal[2]) * (1.0 / 3.0)); value_color = color(value_vector[0], value_vector[1], value_vector[2]); value_point = point(value_vector[0], value_vector[1], value_vector[2]); value_normal = normal(value_vector[0], value_vector[1], value_vector[2]); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_diffuse_bsdf.osl000066400000000000000000000015371334742672700254630ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_diffuse_bsdf( color Color = 0.8, float Roughness = 0.0, normal Normal = N, output closure color BSDF = 0) { if (Roughness == 0.0) BSDF = Color * diffuse(Normal); else BSDF = Color * oren_nayar(Normal, Roughness); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_displacement.osl000066400000000000000000000020751334742672700255060ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_displacement( string space = "object", float Height = 0.0, float Midlevel = 0.5, float Scale = 1.0, normal Normal = N, output vector Displacement = vector(0.0, 0.0, 0.0)) { Displacement = Normal; if(space == "object") { Displacement = transform("object", Displacement); } Displacement = normalize(Displacement) * (Height - Midlevel) * Scale; if(space == "object") { Displacement = transform("object", "world", Displacement); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_emission.osl000066400000000000000000000014101334742672700246540ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_emission( color Color = 0.8, float Strength = 1.0, output closure color Emission = 0) { Emission = (Strength * Color) * emission(); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_environment_texture.osl000066400000000000000000000041131334742672700271550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_color.h" vector environment_texture_direction_to_equirectangular(vector dir) { float u = -atan2(dir[1], dir[0]) / (M_2PI) + 0.5; float v = atan2(dir[2], hypot(dir[0], dir[1])) / M_PI + 0.5; return vector(u, v, 0.0); } vector environment_texture_direction_to_mirrorball(vector dir) { dir[1] -= 1.0; float div = 2.0 * sqrt(max(-0.5 * dir[1], 0.0)); if (div > 0.0) dir /= div; float u = 0.5 * (dir[0] + 1.0); float v = 0.5 * (dir[2] + 1.0); return vector(u, v, 0.0); } shader node_environment_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), vector Vector = P, string filename = "", string projection = "equirectangular", string interpolation = "linear", string color_space = "sRGB", int is_float = 1, int use_alpha = 1, output color Color = 0.0, output float Alpha = 1.0) { vector p = Vector; if (use_mapping) p = transform(mapping, p); p = normalize(p); if (projection == "equirectangular") p = environment_texture_direction_to_equirectangular(p); else p = environment_texture_direction_to_mirrorball(p); /* todo: use environment for better texture filtering of equirectangular */ Color = (color)texture(filename, p[0], 1.0 - p[1], "wrap", "periodic", "interp", interpolation, "alpha", Alpha); if (use_alpha) { Color = color_unpremultiply(Color, Alpha); if (!is_float) Color = min(Color, 1.0); } if (color_space == "sRGB") Color = color_srgb_to_scene_linear(Color); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_fresnel.h000066400000000000000000000027141334742672700241260ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ float fresnel_dielectric_cos(float cosi, float eta) { /* compute fresnel reflectance without explicitly computing * the refracted direction */ float c = fabs(cosi); float g = eta * eta - 1 + c * c; float result; if (g > 0) { g = sqrt(g); float A = (g - c) / (g + c); float B = (c * (g + c) - 1) / (c * (g - c) + 1); result = 0.5 * A * A * (1 + B * B); } else result = 1.0; /* TIR (no refracted component) */ return result; } color fresnel_conductor(float cosi, color eta, color k) { color cosi2 = color(cosi * cosi); color one = color(1, 1, 1); color tmp_f = eta * eta + k * k; color tmp = tmp_f * cosi2; color Rparl2 = (tmp - (2.0 * eta * cosi) + one) / (tmp + (2.0 * eta * cosi) + one); color Rperp2 = (tmp_f - (2.0 * eta * cosi) + cosi2) / (tmp_f + (2.0 * eta * cosi) + cosi2); return (Rparl2 + Rperp2) * 0.5; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_fresnel.osl000066400000000000000000000015611334742672700244730ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_fresnel.h" shader node_fresnel( float IOR = 1.45, normal Normal = N, output float Fac = 0.0) { float f = max(IOR, 1e-5); float eta = backfacing() ? 1.0 / f : f; float cosi = dot(I, Normal); Fac = fresnel_dielectric_cos(cosi, eta); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_gamma.osl000066400000000000000000000013611334742672700241150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_gamma( color ColorIn = 0.8, float Gamma = 1.0, output color ColorOut = 0.0) { ColorOut = pow(ColorIn, Gamma); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_geometry.osl000066400000000000000000000037161334742672700246740ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_geometry( normal NormalIn = N, string bump_offset = "center", output point Position = point(0.0, 0.0, 0.0), output normal Normal = normal(0.0, 0.0, 0.0), output normal Tangent = normal(0.0, 0.0, 0.0), output normal TrueNormal = normal(0.0, 0.0, 0.0), output vector Incoming = vector(0.0, 0.0, 0.0), output point Parametric = point(0.0, 0.0, 0.0), output float Backfacing = 0.0, output float Pointiness = 0.0) { Position = P; Normal = NormalIn; TrueNormal = Ng; Incoming = I; Parametric = point(u, v, 0.0); Backfacing = backfacing(); if (bump_offset == "dx") { Position += Dx(Position); Parametric += Dx(Parametric); } else if (bump_offset == "dy") { Position += Dy(Position); Parametric += Dy(Parametric); } /* first try to get tangent attribute */ point generated; /* try to create spherical tangent from generated coordinates */ if (getattribute("geom:generated", generated)) { normal data = normal(-(generated[1] - 0.5), (generated[0] - 0.5), 0.0); vector T = transform("object", "world", data); Tangent = cross(Normal, normalize(cross(T, Normal))); } else { /* otherwise use surface derivatives */ Tangent = normalize(dPdu); } getattribute("geom:pointiness", Pointiness); if (bump_offset == "dx") { Pointiness += Dx(Pointiness); } else if (bump_offset == "dy") { Pointiness += Dy(Pointiness); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_glass_bsdf.osl000066400000000000000000000030451334742672700251430ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_fresnel.h" shader node_glass_bsdf( color Color = 0.8, string distribution = "sharp", float Roughness = 0.2, float IOR = 1.45, normal Normal = N, output closure color BSDF = 0) { float f = max(IOR, 1e-5); float eta = backfacing() ? 1.0 / f : f; float cosi = dot(I, Normal); float Fr = fresnel_dielectric_cos(cosi, eta); if (distribution == "sharp") BSDF = Color * (Fr * reflection(Normal) + (1.0 - Fr) * refraction(Normal, eta)); else if (distribution == "beckmann") BSDF = Color * (Fr * microfacet_beckmann(Normal, Roughness) + (1.0 - Fr) * microfacet_beckmann_refraction(Normal, Roughness, eta)); else if (distribution == "Multiscatter GGX") BSDF = Color * microfacet_multi_ggx_glass(Normal, Roughness, eta, Color); else if (distribution == "GGX") BSDF = Color * (Fr * microfacet_ggx(Normal, Roughness) + (1.0 - Fr) * microfacet_ggx_refraction(Normal, Roughness, eta)); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_glossy_bsdf.osl000066400000000000000000000023471334742672700253560ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_fresnel.h" shader node_glossy_bsdf( color Color = 0.8, string distribution = "GGX", float Roughness = 0.2, normal Normal = N, output closure color BSDF = 0) { if (distribution == "sharp") BSDF = Color * reflection(Normal); else if (distribution == "beckmann") BSDF = Color * microfacet_beckmann(Normal, Roughness); else if (distribution == "GGX") BSDF = Color * microfacet_ggx(Normal, Roughness); else if (distribution == "Multiscatter GGX") BSDF = Color * microfacet_multi_ggx(Normal, Roughness, Color); else BSDF = Color * ashikhmin_shirley(Normal, vector(0, 0, 0), Roughness, Roughness); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_gradient_texture.osl000066400000000000000000000032441334742672700264120ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Gradient */ float gradient(point p, string type) { float x, y, z; x = p[0]; y = p[1]; z = p[2]; float result = 0.0; if (type == "linear") { result = x; } else if (type == "quadratic") { float r = max(x, 0.0); result = r * r; } else if (type == "easing") { float r = min(max(x, 0.0), 1.0); float t = r * r; result = (3.0 * t - 2.0 * t * r); } else if (type == "diagonal") { result = (x + y) * 0.5; } else if (type == "radial") { result = atan2(y, x) / M_2PI + 0.5; } else { float r = max(1.0 - sqrt(x * x + y * y + z * z), 0.0); if (type == "quadratic_sphere") result = r * r; else if (type == "spherical") result = r; } return result; } shader node_gradient_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), string type = "linear", point Vector = P, output float Fac = 0.0, output color Color = 0.0) { point p = Vector; if (use_mapping) p = transform(mapping, p); Fac = gradient(p, type); Color = color(Fac, Fac, Fac); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_hair_bsdf.osl000066400000000000000000000031161334742672700247540ustar00rootroot00000000000000/* * Copyright 2011, Blender Foundation. * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "stdosl.h" shader node_hair_bsdf( color Color = 0.8, string component = "reflection", float Offset = 0.0, float RoughnessU = 0.1, float RoughnessV = 1.0, normal Tangent = normal(0, 0, 0), output closure color BSDF = 0) { float roughnessh = clamp(RoughnessU, 0.001, 1.0); float roughnessv = clamp(RoughnessV, 0.001, 1.0); float offset = -Offset; normal T; float IsCurve = 0; getattribute("geom:is_curve", IsCurve); if (isconnected(Tangent)) { T = Tangent; } else if(!IsCurve) { T = normalize(dPdv); offset = 0.0; } else { T = normalize(dPdu); } if (backfacing() && IsCurve) { BSDF = transparent(); } else { if (component == "reflection") BSDF = Color * hair_reflection(Ng, roughnessh, roughnessv, T, offset); else BSDF = Color * hair_transmission(Ng, roughnessh, roughnessv, T, offset); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_hair_info.osl000066400000000000000000000020321334742672700247650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_hair_info( output float IsStrand = 0.0, output float Intercept = 0.0, output float Thickness = 0.0, output normal TangentNormal = N, output float Random = 0) { getattribute("geom:is_curve", IsStrand); getattribute("geom:curve_intercept", Intercept); getattribute("geom:curve_thickness", Thickness); getattribute("geom:curve_tangent_normal", TangentNormal); getattribute("geom:curve_random", Random); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_holdout.osl000066400000000000000000000012671334742672700245160ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_holdout( output closure color Holdout = holdout()) { } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_hsv.osl000066400000000000000000000023161334742672700236340ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_color.h" shader node_hsv( float Hue = 0.5, float Saturation = 1.0, float Value = 1.0, float Fac = 0.5, color ColorIn = 0.0, output color ColorOut = 0.0) { color Color = rgb_to_hsv(ColorIn); // remember: fmod doesn't work for negative numbers Color[0] += Hue + 0.5; Color[0] = fmod(Color[0], 1.0); Color[1] *= Saturation; Color[2] *= Value; Color = hsv_to_rgb(Color); // Clamp color to prevent negative values cauzed by oversaturation. Color[0] = max(Color[0], 0.0); Color[1] = max(Color[1], 0.0); Color[2] = max(Color[2], 0.0); ColorOut = mix(ColorIn, Color, Fac); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_image_texture.osl000066400000000000000000000173661334742672700257110ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_color.h" point texco_remap_square(point co) { return (co - point(0.5, 0.5, 0.5)) * 2.0; } point map_to_tube(vector dir) { float u, v; v = (dir[2] + 1.0) * 0.5; float len = sqrt(dir[0] * dir[0] + dir[1] * dir[1]); if (len > 0.0) { u = (1.0 - (atan2(dir[0] / len, dir[1] / len) / M_PI)) * 0.5; } else { v = u = 0.0; /* To avoid un-initialized variables. */ } return point(u, v, 0.0); } point map_to_sphere(vector dir) { float len = length(dir); float v, u; if (len > 0.0) { if (dir[0] == 0.0 && dir[1] == 0.0) { u = 0.0; /* Othwise domain error. */ } else { u = (1.0 - atan2(dir[0], dir[1]) / M_PI) / 2.0; } v = 1.0 - acos(dir[2] / len) / M_PI; } else { v = u = 0.0; /* To avoid un-initialized variables. */ } return point(u, v, 0.0); } color image_texture_lookup(string filename, string color_space, float u, float v, output float Alpha, int use_alpha, int is_float, string interpolation, string extension) { color rgb = (color)texture(filename, u, 1.0 - v, "wrap", extension, "interp", interpolation, "alpha", Alpha); if (use_alpha) { rgb = color_unpremultiply(rgb, Alpha); if (!is_float) rgb = min(rgb, 1.0); } if (color_space == "sRGB") { rgb = color_srgb_to_scene_linear(rgb); } return rgb; } shader node_image_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), point Vector = P, string filename = "", string color_space = "sRGB", string projection = "flat", string interpolation = "smartcubic", string extension = "periodic", float projection_blend = 0.0, int is_float = 1, int use_alpha = 1, output color Color = 0.0, output float Alpha = 1.0) { point p = Vector; if (use_mapping) p = transform(mapping, p); if (projection == "flat") { Color = image_texture_lookup(filename, color_space, p[0], p[1], Alpha, use_alpha, is_float, interpolation, extension); } else if (projection == "box") { /* object space normal */ vector Nob = transform("world", "object", N); /* project from direction vector to barycentric coordinates in triangles */ Nob = vector(fabs(Nob[0]), fabs(Nob[1]), fabs(Nob[2])); Nob /= (Nob[0] + Nob[1] + Nob[2]); /* basic idea is to think of this as a triangle, each corner representing * one of the 3 faces of the cube. in the corners we have single textures, * in between we blend between two textures, and in the middle we a blend * between three textures. * * the Nxyz values are the barycentric coordinates in an equilateral * triangle, which in case of blending, in the middle has a smaller * equilateral triangle where 3 textures blend. this divides things into * 7 zones, with an if () test for each zone */ vector weight = vector(0.0, 0.0, 0.0); float blend = projection_blend; float limit = 0.5 * (1.0 + blend); /* first test for corners with single texture */ if (Nob[0] > limit * (Nob[0] + Nob[1]) && Nob[0] > limit * (Nob[0] + Nob[2])) { weight[0] = 1.0; } else if (Nob[1] > limit * (Nob[0] + Nob[1]) && Nob[1] > limit * (Nob[1] + Nob[2])) { weight[1] = 1.0; } else if (Nob[2] > limit * (Nob[0] + Nob[2]) && Nob[2] > limit * (Nob[1] + Nob[2])) { weight[2] = 1.0; } else if (blend > 0.0) { /* in case of blending, test for mixes between two textures */ if (Nob[2] < (1.0 - limit) * (Nob[1] + Nob[0])) { weight[0] = Nob[0] / (Nob[0] + Nob[1]); weight[0] = clamp((weight[0] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0); weight[1] = 1.0 - weight[0]; } else if (Nob[0] < (1.0 - limit) * (Nob[1] + Nob[2])) { weight[1] = Nob[1] / (Nob[1] + Nob[2]); weight[1] = clamp((weight[1] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0); weight[2] = 1.0 - weight[1]; } else if (Nob[1] < (1.0 - limit) * (Nob[0] + Nob[2])) { weight[0] = Nob[0] / (Nob[0] + Nob[2]); weight[0] = clamp((weight[0] - 0.5 * (1.0 - blend)) / blend, 0.0, 1.0); weight[2] = 1.0 - weight[0]; } else { /* last case, we have a mix between three */ weight[0] = ((2.0 - limit) * Nob[0] + (limit - 1.0)) / (2.0 * limit - 1.0); weight[1] = ((2.0 - limit) * Nob[1] + (limit - 1.0)) / (2.0 * limit - 1.0); weight[2] = ((2.0 - limit) * Nob[2] + (limit - 1.0)) / (2.0 * limit - 1.0); } } else { /* Desperate mode, no valid choice anyway, fallback to one side.*/ weight[0] = 1.0; } Color = color(0.0, 0.0, 0.0); Alpha = 0.0; float tmp_alpha; if (weight[0] > 0.0) { Color += weight[0] * image_texture_lookup(filename, color_space, p[1], p[2], tmp_alpha, use_alpha, is_float, interpolation, extension); Alpha += weight[0] * tmp_alpha; } if (weight[1] > 0.0) { Color += weight[1] * image_texture_lookup(filename, color_space, p[0], p[2], tmp_alpha, use_alpha, is_float, interpolation, extension); Alpha += weight[1] * tmp_alpha; } if (weight[2] > 0.0) { Color += weight[2] * image_texture_lookup(filename, color_space, p[1], p[0], tmp_alpha, use_alpha, is_float, interpolation, extension); Alpha += weight[2] * tmp_alpha; } } else if (projection == "sphere") { point projected = map_to_sphere(texco_remap_square(p)); Color = image_texture_lookup(filename, color_space, projected[0], projected[1], Alpha, use_alpha, is_float, interpolation, extension); } else if (projection == "tube") { point projected = map_to_tube(texco_remap_square(p)); Color = image_texture_lookup(filename, color_space, projected[0], projected[1], Alpha, use_alpha, is_float, interpolation, extension); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_invert.osl000066400000000000000000000014411334742672700243410ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_invert( float Fac = 1.0, color ColorIn = 0.8, output color ColorOut = 0.8) { color ColorInv = color(1.0) - ColorIn; ColorOut = mix(ColorIn, ColorInv, Fac); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_layer_weight.osl000066400000000000000000000022471334742672700255220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_fresnel.h" shader node_layer_weight( float Blend = 0.5, normal Normal = N, output float Fresnel = 0.0, output float Facing = 0.0) { float blend = Blend; float cosi = dot(I, Normal); /* Fresnel */ float eta = max(1.0 - Blend, 1e-5); eta = backfacing() ? eta : 1.0 / eta; Fresnel = fresnel_dielectric_cos(cosi, eta); /* Facing */ Facing = fabs(cosi); if (blend != 0.5) { blend = clamp(blend, 0.0, 1.0 - 1e-5); blend = (blend < 0.5) ? 2.0 * blend : 0.5 / (1.0 - blend); Facing = pow(Facing, blend); } Facing = 1.0 - Facing; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_light_falloff.osl000066400000000000000000000022111334742672700256260ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_light_falloff( float Strength = 0.0, float Smooth = 0.0, output float Quadratic = 0.0, output float Linear = 0.0, output float Constant = 0.0) { float ray_length = 0.0; float strength = Strength; getattribute("path:ray_length", ray_length); if (Smooth > 0.0) { float squared = ray_length * ray_length; strength *= squared / (Smooth + squared); } /* Quadratic */ Quadratic = strength; /* Linear */ Linear = (strength * ray_length); /* Constant */ Constant = (strength * ray_length * ray_length); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_light_path.osl000066400000000000000000000040331334742672700251550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_light_path( output float IsCameraRay = 0.0, output float IsShadowRay = 0.0, output float IsDiffuseRay = 0.0, output float IsGlossyRay = 0.0, output float IsSingularRay = 0.0, output float IsReflectionRay = 0.0, output float IsTransmissionRay = 0.0, output float IsVolumeScatterRay = 0.0, output float RayLength = 0.0, output float RayDepth = 0.0, output float DiffuseDepth = 0.0, output float GlossyDepth = 0.0, output float TransparentDepth = 0.0, output float TransmissionDepth = 0.0) { IsCameraRay = raytype("camera"); IsShadowRay = raytype("shadow"); IsDiffuseRay = raytype("diffuse"); IsGlossyRay = raytype("glossy"); IsSingularRay = raytype("singular"); IsReflectionRay = raytype("reflection"); IsTransmissionRay = raytype("refraction"); IsVolumeScatterRay = raytype("volume_scatter"); getattribute("path:ray_length", RayLength); int ray_depth; getattribute("path:ray_depth", ray_depth); RayDepth = (float)ray_depth; int diffuse_depth; getattribute("path:diffuse_depth", diffuse_depth); DiffuseDepth = (float)diffuse_depth; int glossy_depth; getattribute("path:glossy_depth", glossy_depth); GlossyDepth = (float)glossy_depth; int transparent_depth; getattribute("path:transparent_depth", transparent_depth); TransparentDepth = (float)transparent_depth; int transmission_depth; getattribute("path:transmission_depth", transmission_depth); TransmissionDepth = (float)transmission_depth; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_magic_texture.osl000066400000000000000000000042161334742672700256750ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Magic */ color magic(point p, int n, float distortion) { float dist = distortion; float x = sin(( p[0] + p[1] + p[2]) * 5.0); float y = cos((-p[0] + p[1] - p[2]) * 5.0); float z = -cos((-p[0] - p[1] + p[2]) * 5.0); if (n > 0) { x *= dist; y *= dist; z *= dist; y = -cos(x - y + z); y *= dist; if (n > 1) { x = cos(x - y - z); x *= dist; if (n > 2) { z = sin(-x - y - z); z *= dist; if (n > 3) { x = -cos(-x + y - z); x *= dist; if (n > 4) { y = -sin(-x + y + z); y *= dist; if (n > 5) { y = -cos(-x + y + z); y *= dist; if (n > 6) { x = cos(x + y + z); x *= dist; if (n > 7) { z = sin(x + y - z); z *= dist; if (n > 8) { x = -cos(-x - y + z); x *= dist; if (n > 9) { y = -sin(x - y + z); y *= dist; } } } } } } } } } } if (dist != 0.0) { dist *= 2.0; x /= dist; y /= dist; z /= dist; } return color(0.5 - x, 0.5 - y, 0.5 - z); } shader node_magic_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), int depth = 2, float Distortion = 5.0, float Scale = 5.0, point Vector = P, output float Fac = 0.0, output color Color = 0.0) { point p = Vector; if (use_mapping) p = transform(mapping, p); Color = magic(p * Scale, depth, Distortion); Fac = (Color[0] + Color[1] + Color[2]) * (1.0 / 3.0); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_mapping.osl000066400000000000000000000020171334742672700244650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_mapping( matrix Matrix = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), point mapping_min = point(0.0, 0.0, 0.0), point mapping_max = point(0.0, 0.0, 0.0), int use_minmax = 0, point VectorIn = point(0.0, 0.0, 0.0), output point VectorOut = point(0.0, 0.0, 0.0)) { point p = transform(Matrix, VectorIn); if (use_minmax) p = min(max(mapping_min, p), mapping_max); VectorOut = p; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_math.osl000066400000000000000000000044431334742672700237700ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" float safe_divide(float a, float b) { float result; if (b == 0.0) result = 0.0; else result = a / b; return result; } float safe_modulo(float a, float b) { float result; if (b == 0.0) result = 0.0; else result = fmod(a, b); return result; } float safe_log(float a, float b) { if (a < 0.0 || b < 0.0) return 0.0; return log(a) / log(b); } shader node_math( string type = "add", int use_clamp = 0, float Value1 = 0.0, float Value2 = 0.0, output float Value = 0.0) { /* OSL asin, acos, pow check for values that could give rise to nan */ if (type == "add") Value = Value1 + Value2; else if (type == "subtract") Value = Value1 - Value2; else if (type == "multiply") Value = Value1 * Value2; else if (type == "divide") Value = safe_divide(Value1, Value2); else if (type == "sine") Value = sin(Value1); else if (type == "cosine") Value = cos(Value1); else if (type == "tangent") Value = tan(Value1); else if (type == "arcsine") Value = asin(Value1); else if (type == "arccosine") Value = acos(Value1); else if (type == "arctangent") Value = atan(Value1); else if (type == "power") Value = pow(Value1, Value2); else if (type == "logarithm") Value = safe_log(Value1, Value2); else if (type == "minimum") Value = min(Value1, Value2); else if (type == "maximum") Value = max(Value1, Value2); else if (type == "round") Value = floor(Value1 + 0.5); else if (type == "less_than") Value = Value1 < Value2; else if (type == "greater_than") Value = Value1 > Value2; else if (type == "modulo") Value = safe_modulo(Value1, Value2); else if (type == "absolute") Value = fabs(Value1); if (use_clamp) Value = clamp(Value, 0.0, 1.0); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_mix.osl000066400000000000000000000160121334742672700236270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_color.h" color node_mix_blend(float t, color col1, color col2) { return mix(col1, col2, t); } color node_mix_add(float t, color col1, color col2) { return mix(col1, col1 + col2, t); } color node_mix_mul(float t, color col1, color col2) { return mix(col1, col1 * col2, t); } color node_mix_screen(float t, color col1, color col2) { float tm = 1.0 - t; return color(1.0) - (color(tm) + t * (color(1.0) - col2)) * (color(1.0) - col1); } color node_mix_overlay(float t, color col1, color col2) { float tm = 1.0 - t; color outcol = col1; if (outcol[0] < 0.5) outcol[0] *= tm + 2.0 * t * col2[0]; else outcol[0] = 1.0 - (tm + 2.0 * t * (1.0 - col2[0])) * (1.0 - outcol[0]); if (outcol[1] < 0.5) outcol[1] *= tm + 2.0 * t * col2[1]; else outcol[1] = 1.0 - (tm + 2.0 * t * (1.0 - col2[1])) * (1.0 - outcol[1]); if (outcol[2] < 0.5) outcol[2] *= tm + 2.0 * t * col2[2]; else outcol[2] = 1.0 - (tm + 2.0 * t * (1.0 - col2[2])) * (1.0 - outcol[2]); return outcol; } color node_mix_sub(float t, color col1, color col2) { return mix(col1, col1 - col2, t); } color node_mix_div(float t, color col1, color col2) { float tm = 1.0 - t; color outcol = col1; if (col2[0] != 0.0) outcol[0] = tm * outcol[0] + t * outcol[0] / col2[0]; if (col2[1] != 0.0) outcol[1] = tm * outcol[1] + t * outcol[1] / col2[1]; if (col2[2] != 0.0) outcol[2] = tm * outcol[2] + t * outcol[2] / col2[2]; return outcol; } color node_mix_diff(float t, color col1, color col2) { return mix(col1, abs(col1 - col2), t); } color node_mix_dark(float t, color col1, color col2) { return min(col1, col2) * t + col1 * (1.0 - t); } color node_mix_light(float t, color col1, color col2) { return max(col1, col2 * t); } color node_mix_dodge(float t, color col1, color col2) { color outcol = col1; if (outcol[0] != 0.0) { float tmp = 1.0 - t * col2[0]; if (tmp <= 0.0) outcol[0] = 1.0; else if ((tmp = outcol[0] / tmp) > 1.0) outcol[0] = 1.0; else outcol[0] = tmp; } if (outcol[1] != 0.0) { float tmp = 1.0 - t * col2[1]; if (tmp <= 0.0) outcol[1] = 1.0; else if ((tmp = outcol[1] / tmp) > 1.0) outcol[1] = 1.0; else outcol[1] = tmp; } if (outcol[2] != 0.0) { float tmp = 1.0 - t * col2[2]; if (tmp <= 0.0) outcol[2] = 1.0; else if ((tmp = outcol[2] / tmp) > 1.0) outcol[2] = 1.0; else outcol[2] = tmp; } return outcol; } color node_mix_burn(float t, color col1, color col2) { float tmp, tm = 1.0 - t; color outcol = col1; tmp = tm + t * col2[0]; if (tmp <= 0.0) outcol[0] = 0.0; else if ((tmp = (1.0 - (1.0 - outcol[0]) / tmp)) < 0.0) outcol[0] = 0.0; else if (tmp > 1.0) outcol[0] = 1.0; else outcol[0] = tmp; tmp = tm + t * col2[1]; if (tmp <= 0.0) outcol[1] = 0.0; else if ((tmp = (1.0 - (1.0 - outcol[1]) / tmp)) < 0.0) outcol[1] = 0.0; else if (tmp > 1.0) outcol[1] = 1.0; else outcol[1] = tmp; tmp = tm + t * col2[2]; if (tmp <= 0.0) outcol[2] = 0.0; else if ((tmp = (1.0 - (1.0 - outcol[2]) / tmp)) < 0.0) outcol[2] = 0.0; else if (tmp > 1.0) outcol[2] = 1.0; else outcol[2] = tmp; return outcol; } color node_mix_hue(float t, color col1, color col2) { color outcol = col1; color hsv2 = rgb_to_hsv(col2); if (hsv2[1] != 0.0) { color hsv = rgb_to_hsv(outcol); hsv[0] = hsv2[0]; color tmp = hsv_to_rgb(hsv); outcol = mix(outcol, tmp, t); } return outcol; } color node_mix_sat(float t, color col1, color col2) { float tm = 1.0 - t; color outcol = col1; color hsv = rgb_to_hsv(outcol); if (hsv[1] != 0.0) { color hsv2 = rgb_to_hsv(col2); hsv[1] = tm * hsv[1] + t * hsv2[1]; outcol = hsv_to_rgb(hsv); } return outcol; } color node_mix_val(float t, color col1, color col2) { float tm = 1.0 - t; color hsv = rgb_to_hsv(col1); color hsv2 = rgb_to_hsv(col2); hsv[2] = tm * hsv[2] + t * hsv2[2]; return hsv_to_rgb(hsv); } color node_mix_color(float t, color col1, color col2) { color outcol = col1; color hsv2 = rgb_to_hsv(col2); if (hsv2[1] != 0.0) { color hsv = rgb_to_hsv(outcol); hsv[0] = hsv2[0]; hsv[1] = hsv2[1]; color tmp = hsv_to_rgb(hsv); outcol = mix(outcol, tmp, t); } return outcol; } color node_mix_soft(float t, color col1, color col2) { float tm = 1.0 - t; color one = color(1.0); color scr = one - (one - col2) * (one - col1); return tm * col1 + t * ((one - col1) * col2 * col1 + col1 * scr); } color node_mix_linear(float t, color col1, color col2) { color outcol = col1; if (col2[0] > 0.5) outcol[0] = col1[0] + t * (2.0 * (col2[0] - 0.5)); else outcol[0] = col1[0] + t * (2.0 * (col2[0]) - 1.0); if (col2[1] > 0.5) outcol[1] = col1[1] + t * (2.0 * (col2[1] - 0.5)); else outcol[1] = col1[1] + t * (2.0 * (col2[1]) - 1.0); if (col2[2] > 0.5) outcol[2] = col1[2] + t * (2.0 * (col2[2] - 0.5)); else outcol[2] = col1[2] + t * (2.0 * (col2[2]) - 1.0); return outcol; } color node_mix_clamp(color col) { color outcol = col; outcol[0] = clamp(col[0], 0.0, 1.0); outcol[1] = clamp(col[1], 0.0, 1.0); outcol[2] = clamp(col[2], 0.0, 1.0); return outcol; } shader node_mix( string type = "mix", int use_clamp = 0, float Fac = 0.5, color Color1 = 0.0, color Color2 = 0.0, output color Color = 0.0) { float t = clamp(Fac, 0.0, 1.0); if (type == "mix") Color = node_mix_blend(t, Color1, Color2); if (type == "add") Color = node_mix_add(t, Color1, Color2); if (type == "multiply") Color = node_mix_mul(t, Color1, Color2); if (type == "screen") Color = node_mix_screen(t, Color1, Color2); if (type == "overlay") Color = node_mix_overlay(t, Color1, Color2); if (type == "subtract") Color = node_mix_sub(t, Color1, Color2); if (type == "divide") Color = node_mix_div(t, Color1, Color2); if (type == "difference") Color = node_mix_diff(t, Color1, Color2); if (type == "darken") Color = node_mix_dark(t, Color1, Color2); if (type == "lighten") Color = node_mix_light(t, Color1, Color2); if (type == "dodge") Color = node_mix_dodge(t, Color1, Color2); if (type == "burn") Color = node_mix_burn(t, Color1, Color2); if (type == "hue") Color = node_mix_hue(t, Color1, Color2); if (type == "saturation") Color = node_mix_sat(t, Color1, Color2); if (type == "value") Color = node_mix_val (t, Color1, Color2); if (type == "color") Color = node_mix_color(t, Color1, Color2); if (type == "soft_light") Color = node_mix_soft(t, Color1, Color2); if (type == "linear_light") Color = node_mix_linear(t, Color1, Color2); if (use_clamp) Color = node_mix_clamp(Color); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_mix_closure.osl000066400000000000000000000015171334742672700253670ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_mix_closure( float Fac = 0.5, closure color Closure1 = 0, closure color Closure2 = 0, output closure color Closure = 0) { float t = clamp(Fac, 0.0, 1.0); Closure = (1.0 - t) * Closure1 + t * Closure2; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_musgrave_texture.osl000066400000000000000000000133371334742672700264520ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Musgrave fBm * * H: fractal increment parameter * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * * from "Texturing and Modelling: A procedural approach" */ float noise_musgrave_fBm(point p, float H, float lacunarity, float octaves) { float rmd; float value = 0.0; float pwr = 1.0; float pwHL = pow(lacunarity, -H); int i; for (i = 0; i < (int)octaves; i++) { value += safe_noise(p, "signed") * pwr; pwr *= pwHL; p *= lacunarity; } rmd = octaves - floor(octaves); if (rmd != 0.0) value += rmd * safe_noise(p, "signed") * pwr; return value; } /* Musgrave Multifractal * * H: highest fractal dimension * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm */ float noise_musgrave_multi_fractal(point p, float H, float lacunarity, float octaves) { float rmd; float value = 1.0; float pwr = 1.0; float pwHL = pow(lacunarity, -H); int i; for (i = 0; i < (int)octaves; i++) { value *= (pwr * safe_noise(p, "signed") + 1.0); pwr *= pwHL; p *= lacunarity; } rmd = octaves - floor(octaves); if (rmd != 0.0) value *= (rmd * pwr * safe_noise(p, "signed") + 1.0); /* correct? */ return value; } /* Musgrave Heterogeneous Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * offset: raises the terrain from `sea level' */ float noise_musgrave_hetero_terrain(point p, float H, float lacunarity, float octaves, float offset) { float value, increment, rmd; float pwHL = pow(lacunarity, -H); float pwr = pwHL; int i; /* first unscaled octave of function; later octaves are scaled */ value = offset + safe_noise(p, "signed"); p *= lacunarity; for (i = 1; i < (int)octaves; i++) { increment = (safe_noise(p, "signed") + offset) * pwr * value; value += increment; pwr *= pwHL; p *= lacunarity; } rmd = octaves - floor(octaves); if (rmd != 0.0) { increment = (safe_noise(p, "signed") + offset) * pwr * value; value += rmd * increment; } return value; } /* Hybrid Additive/Multiplicative Multifractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * offset: raises the terrain from `sea level' */ float noise_musgrave_hybrid_multi_fractal(point p, float H, float lacunarity, float octaves, float offset, float gain) { float result, signal, weight, rmd; float pwHL = pow(lacunarity, -H); float pwr = pwHL; int i; result = safe_noise(p, "signed") + offset; weight = gain * result; p *= lacunarity; for (i = 1; (weight > 0.001) && (i < (int)octaves); i++) { if (weight > 1.0) weight = 1.0; signal = (safe_noise(p, "signed") + offset) * pwr; pwr *= pwHL; result += weight * signal; weight *= gain * signal; p *= lacunarity; } rmd = octaves - floor(octaves); if (rmd != 0.0) result += rmd * ((safe_noise(p, "signed") + offset) * pwr); return result; } /* Ridged Multifractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * offset: raises the terrain from `sea level' */ float noise_musgrave_ridged_multi_fractal(point p, float H, float lacunarity, float octaves, float offset, float gain) { float result, signal, weight; float pwHL = pow(lacunarity, -H); float pwr = pwHL; int i; signal = offset - fabs(safe_noise(p, "signed")); signal *= signal; result = signal; weight = 1.0; for (i = 1; i < (int)octaves; i++) { p *= lacunarity; weight = clamp(signal * gain, 0.0, 1.0); signal = offset - fabs(safe_noise(p, "signed")); signal *= signal; signal *= weight; result += signal * pwr; pwr *= pwHL; } return result; } /* Shader */ shader node_musgrave_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), string type = "fBM", float Dimension = 2.0, float Lacunarity = 1.0, float Detail = 2.0, float Offset = 0.0, float Gain = 1.0, float Scale = 5.0, point Vector = P, output float Fac = 0.0, output color Color = 0.0) { float dimension = max(Dimension, 1e-5); float octaves = clamp(Detail, 0.0, 16.0); float lacunarity = max(Lacunarity, 1e-5); float intensity = 1.0; point p = Vector; if (use_mapping) p = transform(mapping, p); p = p * Scale; if (type == "multifractal") Fac = intensity * noise_musgrave_multi_fractal(p, dimension, lacunarity, octaves); else if (type == "fBM") Fac = intensity * noise_musgrave_fBm(p, dimension, lacunarity, octaves); else if (type == "hybrid_multifractal") Fac = intensity * noise_musgrave_hybrid_multi_fractal(p, dimension, lacunarity, octaves, Offset, Gain); else if (type == "ridged_multifractal") Fac = intensity * noise_musgrave_ridged_multi_fractal(p, dimension, lacunarity, octaves, Offset, Gain); else if (type == "hetero_terrain") Fac = intensity * noise_musgrave_hetero_terrain(p, dimension, lacunarity, octaves, Offset); Color = color(Fac, Fac, Fac); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_noise_texture.osl000066400000000000000000000030471334742672700257330ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Noise */ float noise(point p, float distortion, float detail, float fac, color Color) { point r; int hard = 0; if (distortion != 0.0) { r[0] = safe_noise(p + point(13.5), "unsigned") * distortion; r[1] = safe_noise(p, "unsigned") * distortion; r[2] = safe_noise(p - point(13.5), "unsigned") * distortion; p += r; } fac = noise_turbulence(p, detail, hard); Color = color(fac, noise_turbulence(point(p[1], p[0], p[2]), detail, hard), noise_turbulence(point(p[1], p[2], p[0]), detail, hard)); return fac; } shader node_noise_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), float Distortion = 0.0, float Scale = 5.0, float Detail = 2.0, point Vector = P, output float Fac = 0.0, output color Color = 0.0) { point p = Vector; if (use_mapping) p = transform(mapping, p); Fac = noise(p * Scale, Distortion, Detail, Fac, Color); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_normal.osl000066400000000000000000000015711334742672700243260ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_normal( normal direction = normal(0.0, 0.0, 0.0), normal NormalIn = normal(0.0, 0.0, 0.0), output normal NormalOut = normal(0.0, 0.0, 0.0), output float Dot = 1.0) { NormalOut = normalize(direction); Dot = dot(NormalOut, normalize(NormalIn)); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_normal_map.osl000066400000000000000000000050431334742672700251610ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_normal_map( normal NormalIn = N, float Strength = 1.0, color Color = color(0.5, 0.5, 1.0), string space = "tangent", string attr_name = "geom:tangent", string attr_sign_name = "geom:tangent_sign", output normal Normal = NormalIn) { color mcolor = 2.0 * color(Color[0] - 0.5, Color[1] - 0.5, Color[2] - 0.5); int is_backfacing = backfacing(); if (space == "tangent") { vector tangent; vector ninterp; float tangent_sign; float is_smooth; getattribute("geom:is_smooth", is_smooth); if (!is_smooth) { ninterp = normalize(transform("world", "object", Ng)); /* the normal is already inverted, which is too soon for the math here */ if (is_backfacing) { ninterp = -ninterp; } } // get _unnormalized_ interpolated normal and tangent if (getattribute(attr_name, tangent) && getattribute(attr_sign_name, tangent_sign) && (!is_smooth || getattribute("geom:N", ninterp))) { // apply normal map vector B = tangent_sign * cross(ninterp, tangent); Normal = normalize(mcolor[0] * tangent + mcolor[1] * B + mcolor[2] * ninterp); // transform to world space Normal = normalize(transform("object", "world", Normal)); } else { Normal = normal(0, 0, 0); } } else if (space == "object") { Normal = normalize(transform("object", "world", vector(mcolor))); } else if (space == "world") { Normal = normalize(vector(mcolor)); } else if (space == "blender_object") { /* strange blender convention */ mcolor[1] = -mcolor[1]; mcolor[2] = -mcolor[2]; Normal = normalize(transform("object", "world", vector(mcolor))); } else if (space == "blender_world") { /* strange blender convention */ mcolor[1] = -mcolor[1]; mcolor[2] = -mcolor[2]; Normal = normalize(vector(mcolor)); } /* invert normal for backfacing polygons */ if (is_backfacing) { Normal = -Normal; } if (Strength != 1.0) Normal = normalize(NormalIn + (Normal - NormalIn) * max(Strength, 0.0)); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_object_info.osl000066400000000000000000000017161334742672700253200ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_object_info( output point Location = point(0.0, 0.0, 0.0), output float ObjectIndex = 0.0, output float MaterialIndex = 0.0, output float Random = 0.0) { getattribute("object:location", Location); getattribute("object:index", ObjectIndex); getattribute("material:index", MaterialIndex); getattribute("object:random", Random); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_output_displacement.osl000066400000000000000000000013131334742672700271200ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" displacement node_output_displacement(vector Displacement = 0.0) { P += Displacement; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_output_surface.osl000066400000000000000000000012741334742672700261060ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" surface node_output_surface(closure color Surface = 0) { Ci = Surface; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_output_volume.osl000066400000000000000000000012701334742672700257610ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" volume node_output_volume(closure color Volume = 0) { Ci = Volume; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_particle_info.osl000066400000000000000000000024521334742672700256530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_particle_info( output float Index = 0.0, output float Random = 0.0, output float Age = 0.0, output float Lifetime = 0.0, output point Location = point(0.0, 0.0, 0.0), output float Size = 0.0, output vector Velocity = point(0.0, 0.0, 0.0), output vector AngularVelocity = point(0.0, 0.0, 0.0)) { getattribute("particle:index", Index); getattribute("particle:random", Random); getattribute("particle:age", Age); getattribute("particle:lifetime", Lifetime); getattribute("particle:location", Location); getattribute("particle:size", Size); getattribute("particle:velocity", Velocity); getattribute("particle:angular_velocity", AngularVelocity); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_principled_bsdf.osl000066400000000000000000000110131334742672700261550ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_fresnel.h" shader node_principled_bsdf( string distribution = "Multiscatter GGX", string subsurface_method = "burley", color BaseColor = color(0.8, 0.8, 0.8), float Subsurface = 0.0, vector SubsurfaceRadius = vector(1.0, 1.0, 1.0), color SubsurfaceColor = color(0.7, 0.1, 0.1), float Metallic = 0.0, float Specular = 0.5, float SpecularTint = 0.0, float Roughness = 0.5, float Anisotropic = 0.0, float AnisotropicRotation = 0.0, float Sheen = 0.0, float SheenTint = 0.5, float Clearcoat = 0.0, float ClearcoatRoughness = 0.03, float IOR = 1.45, float Transmission = 0.0, float TransmissionRoughness = 0.0, normal Normal = N, normal ClearcoatNormal = N, normal Tangent = normalize(dPdu), output closure color BSDF = 0) { float f = max(IOR, 1e-5); float diffuse_weight = (1.0 - clamp(Metallic, 0.0, 1.0)) * (1.0 - clamp(Transmission, 0.0, 1.0)); float final_transmission = clamp(Transmission, 0.0, 1.0) * (1.0 - clamp(Metallic, 0.0, 1.0)); float specular_weight = (1.0 - final_transmission); vector T = Tangent; float m_cdlum = luminance(BaseColor); color m_ctint = m_cdlum > 0.0 ? BaseColor / m_cdlum : color(0.0, 0.0, 0.0); // normalize lum. to isolate hue+sat /* rotate tangent */ if (AnisotropicRotation != 0.0) T = rotate(T, AnisotropicRotation * M_2PI, point(0.0, 0.0, 0.0), Normal); if (diffuse_weight > 1e-5) { if (Subsurface > 1e-5) { color mixed_ss_base_color = SubsurfaceColor * Subsurface + BaseColor * (1.0 - Subsurface); if (subsurface_method == "burley") { BSDF = mixed_ss_base_color * bssrdf("principled", Normal, Subsurface * SubsurfaceRadius, SubsurfaceColor, "roughness", Roughness); } else { BSDF = mixed_ss_base_color * bssrdf("principled_random_walk", Normal, Subsurface * SubsurfaceRadius, mixed_ss_base_color, "roughness", Roughness); } } else { BSDF = BaseColor * principled_diffuse(Normal, Roughness); } if (Sheen > 1e-5) { color sheen_color = color(1.0, 1.0, 1.0) * (1.0 - SheenTint) + m_ctint * SheenTint; BSDF = BSDF + sheen_color * Sheen * principled_sheen(Normal); } BSDF = BSDF * diffuse_weight; } if (specular_weight > 1e-5) { float aspect = sqrt(1.0 - Anisotropic * 0.9); float r2 = Roughness * Roughness; float alpha_x = r2 / aspect; float alpha_y = r2 * aspect; color tmp_col = color(1.0, 1.0, 1.0) * (1.0 - SpecularTint) + m_ctint * SpecularTint; color Cspec0 = (Specular * 0.08 * tmp_col) * (1.0 - Metallic) + BaseColor * Metallic; if (distribution == "GGX" || Roughness <= 0.075) { BSDF = BSDF + specular_weight * microfacet_ggx_aniso_fresnel(Normal, T, alpha_x, alpha_y, (2.0 / (1.0 - sqrt(0.08 * Specular))) - 1.0, BaseColor, Cspec0); } else { BSDF = BSDF + specular_weight * microfacet_multi_ggx_aniso_fresnel(Normal, T, alpha_x, alpha_y, (2.0 / (1.0 - sqrt(0.08 * Specular))) - 1.0, BaseColor, Cspec0); } } if (final_transmission > 1e-5) { color Cspec0 = BaseColor * SpecularTint + color(1.0, 1.0, 1.0) * (1.0 - SpecularTint); float eta = backfacing() ? 1.0 / f : f; if (distribution == "GGX" || Roughness <= 5e-2) { float cosNO = dot(Normal, I); float Fr = fresnel_dielectric_cos(cosNO, eta); float refl_roughness = Roughness; if (Roughness <= 1e-2) refl_roughness = 0.0; float transmission_roughness = refl_roughness; if (distribution == "GGX") transmission_roughness = 1.0 - (1.0 - refl_roughness) * (1.0 - TransmissionRoughness); BSDF = BSDF + final_transmission * (Fr * microfacet_ggx_fresnel(Normal, refl_roughness * refl_roughness, eta, BaseColor, Cspec0) + (1.0 - Fr) * BaseColor * microfacet_ggx_refraction(Normal, transmission_roughness * transmission_roughness, eta)); } else { BSDF = BSDF + final_transmission * microfacet_multi_ggx_glass_fresnel(Normal, Roughness * Roughness, eta, BaseColor, Cspec0); } } if (Clearcoat > 1e-5) { BSDF = BSDF + principled_clearcoat(ClearcoatNormal, Clearcoat, ClearcoatRoughness * ClearcoatRoughness); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_principled_volume.osl000066400000000000000000000053261334742672700265600ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_principled_volume( color Color = color(0.5, 0.5, 0.5), float Density = 1.0, float Anisotropy = 0.0, color AbsorptionColor = color(0.0, 0.0, 0.0), float EmissionStrength = 0.0, color EmissionColor = color(1.0, 1.0, 1.0), float BlackbodyIntensity = 0.0, color BlackbodyTint = color(1.0, 1.0, 1.0), float Temperature = 1500.0, string DensityAttribute = "geom:density", string ColorAttribute = "geom:color", string TemperatureAttribute = "geom:temperature", output closure color Volume = 0) { /* Compute density. */ float primitive_density = 1.0; float density = max(Density, 0.0); if(density > 1e-5) { if(getattribute(DensityAttribute, primitive_density)) { density = max(density * primitive_density, 0.0); } } if(density > 1e-5) { /* Compute scattering color. */ color scatter_color = Color; color primitive_color; if(getattribute(ColorAttribute, primitive_color)) { scatter_color *= primitive_color; } /* Add scattering and absorption closures. */ color scatter_coeff = scatter_color; color absorption_color = sqrt(max(AbsorptionColor, 0.0)); color absorption_coeff = max(1.0 - scatter_color, 0.0) * max(1.0 - absorption_color, 0.0); Volume = scatter_coeff * density * henyey_greenstein(Anisotropy) + absorption_coeff * density * absorption(); } /* Compute emission. */ float emission_strength = max(EmissionStrength, 0.0); float blackbody_intensity = BlackbodyIntensity; if(emission_strength > 1e-5) { Volume += emission_strength * EmissionColor * emission(); } if(blackbody_intensity > 1e-3) { float T = Temperature; /* Add temperature from attribute if available. */ float temperature; if(getattribute(TemperatureAttribute, temperature)) { T *= max(temperature, 0.0); } T = max(T, 0.0); /* Stefan-Boltzman law. */ float T4 = (T * T) * (T * T); float sigma = 5.670373e-8 * 1e-6 / M_PI; float intensity = sigma * mix(1.0, T4, blackbody_intensity); if(intensity > 1e-5) { color bb = blackbody(T); float l = luminance(bb); if(l != 0.0) { bb *= BlackbodyTint * intensity / l; Volume += bb * emission(); } } } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_ramp_util.h000066400000000000000000000041151334742672700244610ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* NOTE: svm_ramp.h, svm_ramp_util.h and node_ramp_util.h must stay consistent */ color rgb_ramp_lookup(color ramp[], float at, int interpolate, int extrapolate) { float f = at; int table_size = arraylength(ramp); if ((f < 0.0 || f > 1.0) && extrapolate) { color t0, dy; if (f < 0.0) { t0 = ramp[0]; dy = t0 - ramp[1]; f = -f; } else { t0 = ramp[table_size - 1]; dy = t0 - ramp[table_size - 2]; f = f - 1.0; } return t0 + dy * f * (table_size - 1); } f = clamp(at, 0.0, 1.0) * (table_size - 1); /* clamp int as well in case of NaN */ int i = (int)f; if (i < 0) i = 0; if (i >= table_size) i = table_size - 1; float t = f - (float)i; color result = ramp[i]; if (interpolate && t > 0.0) result = (1.0 - t) * result + t * ramp[i + 1]; return result; } float rgb_ramp_lookup(float ramp[], float at, int interpolate, int extrapolate) { float f = at; int table_size = arraylength(ramp); if ((f < 0.0 || f > 1.0) && extrapolate) { float t0, dy; if (f < 0.0) { t0 = ramp[0]; dy = t0 - ramp[1]; f = -f; } else { t0 = ramp[table_size - 1]; dy = t0 - ramp[table_size - 2]; f = f - 1.0; } return t0 + dy * f * (table_size - 1); } f = clamp(at, 0.0, 1.0) * (table_size - 1); /* clamp int as well in case of NaN */ int i = (int)f; if (i < 0) i = 0; if (i >= table_size) i = table_size - 1; float t = f - (float)i; float result = ramp[i]; if (interpolate && t > 0.0) result = (1.0 - t) * result + t * ramp[i + 1]; return result; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_refraction_bsdf.osl000066400000000000000000000022071334742672700261650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_refraction_bsdf( color Color = 0.8, string distribution = "sharp", float Roughness = 0.2, float IOR = 1.45, normal Normal = N, output closure color BSDF = 0) { float f = max(IOR, 1e-5); float eta = backfacing() ? 1.0 / f : f; if (distribution == "sharp") BSDF = Color * refraction(Normal, eta); else if (distribution == "beckmann") BSDF = Color * microfacet_beckmann_refraction(Normal, Roughness, eta); else if (distribution == "GGX") BSDF = Color * microfacet_ggx_refraction(Normal, Roughness, eta); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_rgb_curves.osl000066400000000000000000000021521334742672700251730ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_ramp_util.h" shader node_rgb_curves( color ramp[] = {0.0}, float min_x = 0.0, float max_x = 1.0, color ColorIn = 0.0, float Fac = 0.0, output color ColorOut = 0.0) { color c = (ColorIn - color(min_x, min_x, min_x)) / (max_x - min_x); color r = rgb_ramp_lookup(ramp, c[0], 1, 1); color g = rgb_ramp_lookup(ramp, c[1], 1, 1); color b = rgb_ramp_lookup(ramp, c[2], 1, 1); ColorOut[0] = r[0]; ColorOut[1] = g[1]; ColorOut[2] = b[2]; ColorOut = mix(ColorIn, ColorOut, Fac); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_rgb_ramp.osl000066400000000000000000000016671334742672700246350ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_ramp_util.h" shader node_rgb_ramp( color ramp_color[] = {0.0}, float ramp_alpha[] = {0.0}, int interpolate = 1, float Fac = 0.0, output color Color = 0.0, output float Alpha = 1.0) { Color = rgb_ramp_lookup(ramp_color, Fac, interpolate, 0); Alpha = rgb_ramp_lookup(ramp_alpha, Fac, interpolate, 0); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_rgb_to_bw.osl000066400000000000000000000013741334742672700250030ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_rgb_to_bw( color Color = 0.0, output float Val = 0.0) { Val = Color[0] * 0.2126 + Color[1] * 0.7152 + Color[2] * 0.0722; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_scatter_volume.osl000066400000000000000000000015171334742672700260720ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_scatter_volume( color Color = color(0.8, 0.8, 0.8), float Density = 1.0, float Anisotropy = 0.0, output closure color Volume = 0) { Volume = (Color * max(Density, 0.0)) * henyey_greenstein(Anisotropy); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_separate_hsv.osl000066400000000000000000000015111334742672700255140ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_color.h" shader node_separate_hsv( color Color = 0.8, output float H = 0.0, output float S = 0.0, output float V = 0.0) { color col = rgb_to_hsv(Color); H = col[0]; S = col[1]; V = col[2]; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_separate_rgb.osl000066400000000000000000000014251334742672700254720ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_separate_rgb( color Image = 0.8, output float R = 0.0, output float G = 0.0, output float B = 0.0) { R = Image[0]; G = Image[1]; B = Image[2]; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_separate_xyz.osl000066400000000000000000000014321334742672700255500ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_separate_xyz( vector Vector = 0.8, output float X = 0.0, output float Y = 0.0, output float Z = 0.0) { X = Vector[0]; Y = Vector[1]; Z = Vector[2]; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_set_normal.osl000066400000000000000000000013461334742672700252010ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" surface node_set_normal( normal Direction = N, output normal Normal = N) { N = Direction; Normal = Direction; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_sky_texture.osl000066400000000000000000000102771334742672700254270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_color.h" float sky_angle_between(float thetav, float phiv, float theta, float phi) { float cospsi = sin(thetav) * sin(theta) * cos(phi - phiv) + cos(thetav) * cos(theta); if (cospsi > 1.0) return 0.0; if (cospsi < -1.0) return M_PI; return acos(cospsi); } vector sky_spherical_coordinates(vector dir) { return vector(acos(dir[2]), atan2(dir[0], dir[1]), 0); } /* Preetham */ float sky_perez_function(float lam[9], float theta, float gamma) { float ctheta = cos(theta); float cgamma = cos(gamma); return (1.0 + lam[0] * exp(lam[1] / ctheta)) * (1.0 + lam[2] * exp(lam[3] * gamma) + lam[4] * cgamma * cgamma); } color sky_radiance_old(normal dir, float sunphi, float suntheta, color radiance, float config_x[9], float config_y[9], float config_z[9]) { /* convert vector to spherical coordinates */ vector spherical = sky_spherical_coordinates(dir); float theta = spherical[0]; float phi = spherical[1]; /* angle between sun direction and dir */ float gamma = sky_angle_between(theta, phi, suntheta, sunphi); /* clamp theta to horizon */ theta = min(theta, M_PI_2 - 0.001); /* compute xyY color space values */ float x = radiance[1] * sky_perez_function(config_y, theta, gamma); float y = radiance[2] * sky_perez_function(config_z, theta, gamma); float Y = radiance[0] * sky_perez_function(config_x, theta, gamma); /* convert to RGB */ color xyz = xyY_to_xyz(x, y, Y); return xyz_to_rgb(xyz[0], xyz[1], xyz[2]); } /* Hosek / Wilkie */ float sky_radiance_internal(float config[9], float theta, float gamma) { float ctheta = cos(theta); float cgamma = cos(gamma); float expM = exp(config[4] * gamma); float rayM = cgamma * cgamma; float mieM = (1.0 + rayM) / pow((1.0 + config[8] * config[8] - 2.0 * config[8] * cgamma), 1.5); float zenith = sqrt(ctheta); return (1.0 + config[0] * exp(config[1] / (ctheta + 0.01))) * (config[2] + config[3] * expM + config[5] * rayM + config[6] * mieM + config[7] * zenith); } color sky_radiance_new(normal dir, float sunphi, float suntheta, color radiance, float config_x[9], float config_y[9], float config_z[9]) { /* convert vector to spherical coordinates */ vector spherical = sky_spherical_coordinates(dir); float theta = spherical[0]; float phi = spherical[1]; /* angle between sun direction and dir */ float gamma = sky_angle_between(theta, phi, suntheta, sunphi); /* clamp theta to horizon */ theta = min(theta, M_PI_2 - 0.001); /* compute xyz color space values */ float x = sky_radiance_internal(config_x, theta, gamma) * radiance[0]; float y = sky_radiance_internal(config_y, theta, gamma) * radiance[1]; float z = sky_radiance_internal(config_z, theta, gamma) * radiance[2]; /* convert to RGB and adjust strength */ return xyz_to_rgb(x, y, z) * (M_2PI / 683); } shader node_sky_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), vector Vector = P, string type = "hosek_wilkie", float theta = 0.0, float phi = 0.0, color radiance = color(0.0, 0.0, 0.0), float config_x[9] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, float config_y[9] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, float config_z[9] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, output color Color = color(0.0, 0.0, 0.0)) { vector p = Vector; if (use_mapping) p = transform(mapping, p); if (type == "hosek_wilkie") Color = sky_radiance_new(p, phi, theta, radiance, config_x, config_y, config_z); else Color = sky_radiance_old(p, phi, theta, radiance, config_x, config_y, config_z); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_subsurface_scattering.osl000066400000000000000000000025551334742672700274260ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_subsurface_scattering( color Color = 0.8, float Scale = 1.0, vector Radius = vector(0.1, 0.1, 0.1), float TextureBlur = 0.0, float Sharpness = 0.0, string falloff = "cubic", normal Normal = N, output closure color BSSRDF = 0) { if (falloff == "gaussian") BSSRDF = Color * bssrdf("gaussian", Normal, Scale * Radius, Color, "texture_blur", TextureBlur); else if (falloff == "cubic") BSSRDF = Color * bssrdf("cubic", Normal, Scale * Radius, Color, "texture_blur", TextureBlur, "sharpness", Sharpness); else if (falloff == "burley") BSSRDF = Color * bssrdf("burley", Normal, Scale * Radius, Color, "texture_blur", TextureBlur); else BSSRDF = Color * bssrdf("random_walk", Normal, Scale * Radius, Color, "texture_blur", TextureBlur); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_tangent.osl000066400000000000000000000025211334742672700244720ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_tangent( normal NormalIn = N, string attr_name = "geom:tangent", string direction_type = "radial", string axis = "z", output normal Tangent = normalize(dPdu)) { vector T; if (direction_type == "uv_map") { getattribute(attr_name, T); } else if (direction_type == "radial") { point generated; if (!getattribute("geom:generated", generated)) generated = P; if (axis == "x") T = vector(0.0, -(generated[2] - 0.5), (generated[1] - 0.5)); else if (axis == "y") T = vector(-(generated[2] - 0.5), 0.0, (generated[0] - 0.5)); else T = vector(-(generated[1] - 0.5), (generated[0] - 0.5), 0.0); } T = transform("object", "world", T); Tangent = cross(NormalIn, normalize(cross(T, NormalIn))); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_texture.h000066400000000000000000000061641334742672700241730ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Voronoi / Worley like */ color cellnoise_color(point p) { float r = cellnoise(p); float g = cellnoise(point(p[1], p[0], p[2])); float b = cellnoise(point(p[1], p[2], p[0])); return color(r, g, b); } void voronoi(point p, float e, float da[4], point pa[4]) { /* returns distances in da and point coords in pa */ int xx, yy, zz, xi, yi, zi; xi = (int)floor(p[0]); yi = (int)floor(p[1]); zi = (int)floor(p[2]); da[0] = 1e10; da[1] = 1e10; da[2] = 1e10; da[3] = 1e10; for (xx = xi - 1; xx <= xi + 1; xx++) { for (yy = yi - 1; yy <= yi + 1; yy++) { for (zz = zi - 1; zz <= zi + 1; zz++) { point ip = point(xx, yy, zz); point vp = (point)cellnoise_color(ip); point pd = p - (vp + ip); float d = dot(pd, pd); vp += point(xx, yy, zz); if (d < da[0]) { da[3] = da[2]; da[2] = da[1]; da[1] = da[0]; da[0] = d; pa[3] = pa[2]; pa[2] = pa[1]; pa[1] = pa[0]; pa[0] = vp; } else if (d < da[1]) { da[3] = da[2]; da[2] = da[1]; da[1] = d; pa[3] = pa[2]; pa[2] = pa[1]; pa[1] = vp; } else if (d < da[2]) { da[3] = da[2]; da[2] = d; pa[3] = pa[2]; pa[2] = vp; } else if (d < da[3]) { da[3] = d; pa[3] = vp; } } } } } /* Noise Bases */ float safe_noise(point p, string type) { float f = 0.0; /* Perlin noise in range -1..1 */ if (type == "signed") f = noise("perlin", p); /* Perlin noise in range 0..1 */ else f = noise(p); /* can happen for big coordinates, things even out to 0.5 then anyway */ if (!isfinite(f)) return 0.5; return f; } /* Turbulence */ float noise_turbulence(point p, float details, int hard) { float fscale = 1.0; float amp = 1.0; float sum = 0.0; int i, n; float octaves = clamp(details, 0.0, 16.0); n = (int)octaves; for (i = 0; i <= n; i++) { float t = safe_noise(fscale * p, "unsigned"); if (hard) t = fabs(2.0 * t - 1.0); sum += t * amp; amp *= 0.5; fscale *= 2.0; } float rmd = octaves - floor(octaves); if (rmd != 0.0) { float t = safe_noise(fscale * p, "unsigned"); if (hard) t = fabs(2.0 * t - 1.0); float sum2 = sum + t * amp; sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1)); sum2 *= ((float)(1 << (n + 1)) / (float)((1 << (n + 2)) - 1)); return (1.0 - rmd) * sum + rmd * sum2; } else { sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1)); return sum; } } /* Utility */ float nonzero(float f, float eps) { float r; if (abs(f) < eps) r = sign(f) * eps; else r = f; return r; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_texture_coordinate.osl000066400000000000000000000047561334742672700267550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_texture_coordinate( normal NormalIn = N, int is_background = 0, int is_volume = 0, int from_dupli = 0, int use_transform = 0, string bump_offset = "center", matrix object_itfm = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), output point Generated = point(0.0, 0.0, 0.0), output point UV = point(0.0, 0.0, 0.0), output point Object = point(0.0, 0.0, 0.0), output point Camera = point(0.0, 0.0, 0.0), output point Window = point(0.0, 0.0, 0.0), output normal Normal = normal(0.0, 0.0, 0.0), output point Reflection = point(0.0, 0.0, 0.0)) { if (is_background) { Generated = P; UV = point(0.0, 0.0, 0.0); Object = P; point Pcam = transform("camera", "world", point(0, 0, 0)); Camera = transform("camera", P + Pcam); getattribute("NDC", Window); Normal = NormalIn; Reflection = I; } else { if (from_dupli) { getattribute("geom:dupli_generated", Generated); getattribute("geom:dupli_uv", UV); } else if (is_volume) { Generated = transform("object", P); matrix tfm; if (getattribute("geom:generated_transform", tfm)) Generated = transform(tfm, Generated); getattribute("geom:uv", UV); } else { getattribute("geom:generated", Generated); getattribute("geom:uv", UV); } if (use_transform) { Object = transform(object_itfm, P); } else { Object = transform("object", P); } Camera = transform("camera", P); Window = transform("NDC", P); Normal = transform("world", "object", NormalIn); Reflection = -reflect(I, NormalIn); } if (bump_offset == "dx") { if (!from_dupli) { Generated += Dx(Generated); UV += Dx(UV); } Object += Dx(Object); Camera += Dx(Camera); Window += Dx(Window); } else if (bump_offset == "dy") { if (!from_dupli) { Generated += Dy(Generated); UV += Dy(UV); } Object += Dy(Object); Camera += Dy(Camera); Window += Dy(Window); } Window[2] = 0.0; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_toon_bsdf.osl000066400000000000000000000017031334742672700250100ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_toon_bsdf( color Color = 0.8, string component = "diffuse", float Size = 0.5, float Smooth = 0.0, normal Normal = N, output closure color BSDF = 0) { if (component == "diffuse") BSDF = Color * diffuse_toon(Normal, Size, Smooth); else if (component == "glossy") BSDF = Color * glossy_toon(Normal, Size, Smooth); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_translucent_bsdf.osl000066400000000000000000000014011334742672700263660ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_translucent_bsdf( color Color = 0.8, normal Normal = N, output closure color BSDF = 0) { BSDF = Color * translucent(Normal); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_transparent_bsdf.osl000066400000000000000000000013731334742672700263750ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_transparent_bsdf( color Color = 0.8, normal Normal = N, output closure color BSDF = 0) { BSDF = Color * transparent(); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_uv_map.osl000066400000000000000000000020731334742672700243230ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_uv_map( int from_dupli = 0, string attribute = "", string bump_offset = "center", output point UV = point(0.0, 0.0, 0.0)) { if (from_dupli) { getattribute("geom:dupli_uv", UV); } else { if (attribute == "") getattribute("geom:uv", UV); else getattribute(attribute, UV); } if (bump_offset == "dx") { if (!from_dupli) { UV += Dx(UV); } } else if (bump_offset == "dy") { if (!from_dupli) { UV += Dy(UV); } } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_value.osl000066400000000000000000000016241334742672700241510ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_value( float value_value = 0.0, vector vector_value = vector(0.0, 0.0, 0.0), color color_value = 0.0, output float Value = 0.0, output vector Vector = vector(0.0, 0.0, 0.0), output color Color = 0.0) { Value = value_value; Vector = vector_value; Color = color_value; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_vector_curves.osl000066400000000000000000000022361334742672700257260ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_ramp_util.h" shader node_vector_curves( color ramp[] = {0.0}, float min_x = 0.0, float max_x = 1.0, vector VectorIn = vector(0.0, 0.0, 0.0), float Fac = 0.0, output vector VectorOut = vector(0.0, 0.0, 0.0)) { vector c = (VectorIn - vector(min_x, min_x, min_x)) / (max_x - min_x); color r = rgb_ramp_lookup(ramp, c[0], 1, 1); color g = rgb_ramp_lookup(ramp, c[0], 1, 1); color b = rgb_ramp_lookup(ramp, c[0], 1, 1); VectorOut[0] = r[0]; VectorOut[1] = g[1]; VectorOut[2] = b[2]; VectorOut = mix(VectorIn, VectorOut, Fac); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_vector_displacement.osl000066400000000000000000000031701334742672700270650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_vector_displacement( color Vector = color(0.0, 0.0, 0.0), float Midlevel = 0.0, float Scale = 1.0, string space = "tangent", string attr_name = "geom:tangent", string attr_sign_name = "geom:tangent_sign", output vector Displacement = vector(0.0, 0.0, 0.0)) { vector offset = (Vector - vector(Midlevel)) * Scale; if(space == "tangent") { /* Tangent space. */ vector N_object = normalize(transform("world", "object", N)); vector T_object; if(getattribute(attr_name, T_object)) { T_object = normalize(T_object); } else { T_object = normalize(dPdu); } vector B_object = normalize(cross(N_object, T_object)); float tangent_sign; if(getattribute(attr_sign_name, tangent_sign)) { B_object *= tangent_sign; } Displacement = T_object*offset[0] + N_object*offset[1] + B_object*offset[2]; } else { /* Object or world space. */ Displacement = offset; } if(space != "world") { /* Tangent or object space. */ Displacement = transform("object", "world", Displacement); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_vector_math.osl000066400000000000000000000027221334742672700253500ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_vector_math( string type = "add", vector Vector1 = vector(0.0, 0.0, 0.0), vector Vector2 = vector(0.0, 0.0, 0.0), output float Value = 0.0, output vector Vector = vector(0.0, 0.0, 0.0)) { if (type == "add") { Vector = Vector1 + Vector2; Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2])) / 3.0; } else if (type == "subtract") { Vector = Vector1 - Vector2; Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2])) / 3.0; } else if (type == "average") { Value = length(Vector1 + Vector2); Vector = normalize(Vector1 + Vector2); } else if (type == "dot_product") { Value = dot(Vector1, Vector2); } else if (type == "cross_product") { vector c = cross(Vector1, Vector2); Value = length(c); Vector = normalize(c); } else if (type == "normalize") { Value = length(Vector1); Vector = normalize(Vector1); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_vector_transform.osl000066400000000000000000000021551334742672700264320ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_vector_transform( string type = "vector", string convert_from = "world", string convert_to = "object", vector VectorIn = vector(0.0, 0.0, 0.0), output vector VectorOut = vector(0.0, 0.0, 0.0)) { if (type == "vector" || type == "normal") { VectorOut = transform(convert_from, convert_to, VectorIn); if (type == "normal") VectorOut = normalize(VectorOut); } else if (type == "point") { point Point = (point)VectorIn; VectorOut = transform(convert_from, convert_to, Point); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_velvet_bsdf.osl000066400000000000000000000015361334742672700253420ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_fresnel.h" shader node_velvet_bsdf( color Color = 0.8, float Sigma = 0.0, normal Normal = N, output closure color BSDF = 0) { float sigma = clamp(Sigma, 0.0, 1.0); BSDF = Color * ashikhmin_velvet(Normal, sigma); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_voronoi_texture.osl000066400000000000000000000024521334742672700263100ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Voronoi */ shader node_voronoi_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), string coloring = "intensity", float Scale = 5.0, point Vector = P, output float Fac = 0.0, output color Color = 0.0) { point p = Vector; if (use_mapping) p = transform(mapping, p); /* compute distance and point coordinate of 4 nearest neighbours */ float da[4]; point pa[4]; voronoi(p * Scale, 1.0, da, pa); /* Colored output */ if (coloring == "intensity") { Fac = fabs(da[0]); Color = color(Fac); } else { Color = cellnoise_color(pa[0]); Fac = (Color[0] + Color[1] + Color[2]) * (1.0 / 3.0); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_voxel_texture.osl000066400000000000000000000025001334742672700257440ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_voxel_texture( string filename = "", string interpolation = "linear", int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), point Vector = P, output float Density = 0, output color Color = 0) { point p = Vector; if (use_mapping) { p = transform(mapping, p); } else { p = transform("object", Vector); matrix tfm; if (getattribute("geom:generated_transform", tfm)) p = transform(tfm, p); } if (p[0] < 0.0 || p[1] < 0.0 || p[2] < 0.0 || p[0] > 1.0 || p[1] > 1.0 || p[2] > 1.0) { Density = 0; Color = color(0, 0, 0); } else { Color = (color)texture3d(filename, p, "wrap", "periodic", "interp", interpolation, "alpha", Density); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_wave_texture.osl000066400000000000000000000031521334742672700255550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "node_texture.h" /* Wave */ float wave(point p, string type, string profile, float detail, float distortion, float dscale) { float n = 0.0; if (type == "bands") { n = (p[0] + p[1] + p[2]) * 10.0; } else if (type == "rings") { n = length(p) * 20.0; } if (distortion != 0.0) { n = n + (distortion * noise_turbulence(p * dscale, detail, 0)); } if (profile == "sine") { return 0.5 + 0.5 * sin(n); } else { /* Saw profile */ n /= M_2PI; n -= (int) n; return (n < 0.0) ? n + 1.0 : n; } } shader node_wave_texture( int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), string type = "bands", string profile = "sine", float Scale = 5.0, float Distortion = 0.0, float Detail = 2.0, float DetailScale = 1.0, point Vector = P, output float Fac = 0.0, output color Color = 0.0) { point p = Vector; if (use_mapping) p = transform(mapping, p); Fac = wave(p * Scale, type, profile, Detail, Distortion, DetailScale); Color = Fac; } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_wavelength.osl000066400000000000000000000013531334742672700252000ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" shader node_wavelength( float Wavelength = 500.0, output color Color = 0.0) { Color = wavelength_color(Wavelength); } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/node_wireframe.osl000066400000000000000000000024451334742672700250200ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdosl.h" #include "oslutil.h" shader node_wireframe( string bump_offset = "center", int use_pixel_size = 0, float Size = 0.01, output float Fac = 0.0) { Fac = wireframe("triangles", Size, use_pixel_size); /* TODO(sergey): Since we can't use autodiff here we do algebraic * calculation of derivatives by definition. We could probably * optimize this a bit by doing some extra calculation in wireframe(). */ if (bump_offset == "dx") { point dx = Dx(P); P -= dx; Fac += (Fac - wireframe("triangles", Size, use_pixel_size)) / length(dx); } else if (bump_offset == "dy") { point dy = Dy(P); P -= dy; Fac += (Fac - wireframe("triangles", Size, use_pixel_size)) / length(dy); } } goxel-0.8.1/ext_src/cycles/src/kernel/shaders/oslutil.h000066400000000000000000000073541334742672700231630ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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 CCL_OSLUTIL_H #define CCL_OSLUTIL_H // Return wireframe opacity factor [0, 1] given a geometry type in // ("triangles", "polygons" or "patches"), and a line_width in raster // or world space depending on the last (raster) boolean argument. // float wireframe(string edge_type, float line_width, int raster) { // ray differentials are so big in diffuse context that this function would always return "wire" if (raytype("path:diffuse")) return 0.0; int np = 0; point p[64]; float pixelWidth = 1; if (edge_type == "triangles") { np = 3; if (!getattribute("geom:trianglevertices", p)) return 0.0; } else if (edge_type == "polygons" || edge_type == "patches") { getattribute("geom:numpolyvertices", np); if (np < 3 || !getattribute("geom:polyvertices", p)) return 0.0; } if (raster) { // Project the derivatives of P to the viewing plane defined // by I so we have a measure of how big is a pixel at this point float pixelWidthX = length(Dx(P) - dot(Dx(P), I) * I); float pixelWidthY = length(Dy(P) - dot(Dy(P), I) * I); // Take the average of both axis' length pixelWidth = (pixelWidthX + pixelWidthY) / 2; } // Use half the width as the neighbor face will render the // other half. And take the square for fast comparison pixelWidth *= 0.5 * line_width; pixelWidth *= pixelWidth; for (int i = 0; i < np; i++) { int i2 = i ? i - 1 : np - 1; vector dir = P - p[i]; vector edge = p[i] - p[i2]; vector crs = cross(edge, dir); // At this point dot(crs, crs) / dot(edge, edge) is // the square of area / length(edge) == square of the // distance to the edge. if (dot(crs, crs) < (dot(edge, edge) * pixelWidth)) return 1; } return 0; } float wireframe(string edge_type, float line_width) { return wireframe(edge_type, line_width, 1); } float wireframe(string edge_type) { return wireframe(edge_type, 1.0, 1); } float wireframe() { return wireframe("polygons", 1.0, 1); } #endif /* CCL_OSLUTIL_H */ goxel-0.8.1/ext_src/cycles/src/kernel/shaders/stdosl.h000066400000000000000000000547771334742672700230130ustar00rootroot00000000000000///////////////////////////////////////////////////////////////////////////// // Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. 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 Sony Pictures Imageworks 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 CCL_STDOSL_H #define CCL_STDOSL_H #ifndef M_PI #define M_PI 3.1415926535897932 /* pi */ #define M_PI_2 1.5707963267948966 /* pi/2 */ #define M_PI_4 0.7853981633974483 /* pi/4 */ #define M_2_PI 0.6366197723675813 /* 2/pi */ #define M_2PI 6.2831853071795865 /* 2*pi */ #define M_4PI 12.566370614359173 /* 4*pi */ #define M_2_SQRTPI 1.1283791670955126 /* 2/sqrt(pi) */ #define M_E 2.7182818284590452 /* e (Euler's number) */ #define M_LN2 0.6931471805599453 /* ln(2) */ #define M_LN10 2.3025850929940457 /* ln(10) */ #define M_LOG2E 1.4426950408889634 /* log_2(e) */ #define M_LOG10E 0.4342944819032518 /* log_10(e) */ #define M_SQRT2 1.4142135623730950 /* sqrt(2) */ #define M_SQRT1_2 0.7071067811865475 /* 1/sqrt(2) */ #endif // Declaration of built-in functions and closures #define BUILTIN [[ int builtin = 1 ]] #define BUILTIN_DERIV [[ int builtin = 1, int deriv = 1 ]] #define PERCOMP1(name) \ normal name (normal x) BUILTIN; \ vector name (vector x) BUILTIN; \ point name (point x) BUILTIN; \ color name (color x) BUILTIN; \ float name (float x) BUILTIN; #define PERCOMP2(name) \ normal name (normal x, normal y) BUILTIN; \ vector name (vector x, vector y) BUILTIN; \ point name (point x, point y) BUILTIN; \ color name (color x, color y) BUILTIN; \ float name (float x, float y) BUILTIN; #define PERCOMP2F(name) \ normal name (normal x, float y) BUILTIN; \ vector name (vector x, float y) BUILTIN; \ point name (point x, float y) BUILTIN; \ color name (color x, float y) BUILTIN; \ float name (float x, float y) BUILTIN; // Basic math normal degrees (normal x) { return x*(180.0/M_PI); } vector degrees (vector x) { return x*(180.0/M_PI); } point degrees (point x) { return x*(180.0/M_PI); } color degrees (color x) { return x*(180.0/M_PI); } float degrees (float x) { return x*(180.0/M_PI); } normal radians (normal x) { return x*(M_PI/180.0); } vector radians (vector x) { return x*(M_PI/180.0); } point radians (point x) { return x*(M_PI/180.0); } color radians (color x) { return x*(M_PI/180.0); } float radians (float x) { return x*(M_PI/180.0); } PERCOMP1 (cos) PERCOMP1 (sin) PERCOMP1 (tan) PERCOMP1 (acos) PERCOMP1 (asin) PERCOMP1 (atan) PERCOMP2 (atan2) PERCOMP1 (cosh) PERCOMP1 (sinh) PERCOMP1 (tanh) PERCOMP2F (pow) PERCOMP1 (exp) PERCOMP1 (exp2) PERCOMP1 (expm1) PERCOMP1 (log) point log (point a, float b) { return log(a)/log(b); } vector log (vector a, float b) { return log(a)/log(b); } color log (color a, float b) { return log(a)/log(b); } float log (float a, float b) { return log(a)/log(b); } PERCOMP1 (log2) PERCOMP1 (log10) PERCOMP1 (logb) PERCOMP1 (sqrt) PERCOMP1 (inversesqrt) float hypot (float a, float b) { return sqrt (a*a + b*b); } float hypot (float a, float b, float c) { return sqrt (a*a + b*b + c*c); } PERCOMP1 (abs) int abs (int x) BUILTIN; PERCOMP1 (fabs) int fabs (int x) BUILTIN; PERCOMP1 (sign) PERCOMP1 (floor) PERCOMP1 (ceil) PERCOMP1 (round) PERCOMP1 (trunc) PERCOMP2 (fmod) PERCOMP2F (fmod) int mod (int a, int b) { return a - b*(int)floor(a/b); } point mod (point a, point b) { return a - b*floor(a/b); } vector mod (vector a, vector b) { return a - b*floor(a/b); } normal mod (normal a, normal b) { return a - b*floor(a/b); } color mod (color a, color b) { return a - b*floor(a/b); } point mod (point a, float b) { return a - b*floor(a/b); } vector mod (vector a, float b) { return a - b*floor(a/b); } normal mod (normal a, float b) { return a - b*floor(a/b); } color mod (color a, float b) { return a - b*floor(a/b); } float mod (float a, float b) { return a - b*floor(a/b); } PERCOMP2 (min) int min (int a, int b) BUILTIN; PERCOMP2 (max) int max (int a, int b) BUILTIN; normal clamp (normal x, normal minval, normal maxval) { return max(min(x,maxval),minval); } vector clamp (vector x, vector minval, vector maxval) { return max(min(x,maxval),minval); } point clamp (point x, point minval, point maxval) { return max(min(x,maxval),minval); } color clamp (color x, color minval, color maxval) { return max(min(x,maxval),minval); } float clamp (float x, float minval, float maxval) { return max(min(x,maxval),minval); } int clamp (int x, int minval, int maxval) { return max(min(x,maxval),minval); } #if 0 normal mix (normal x, normal y, normal a) { return x*(1-a) + y*a; } normal mix (normal x, normal y, float a) { return x*(1-a) + y*a; } vector mix (vector x, vector y, vector a) { return x*(1-a) + y*a; } vector mix (vector x, vector y, float a) { return x*(1-a) + y*a; } point mix (point x, point y, point a) { return x*(1-a) + y*a; } point mix (point x, point y, float a) { return x*(1-a) + y*a; } color mix (color x, color y, color a) { return x*(1-a) + y*a; } color mix (color x, color y, float a) { return x*(1-a) + y*a; } float mix (float x, float y, float a) { return x*(1-a) + y*a; } #else normal mix (normal x, normal y, normal a) BUILTIN; normal mix (normal x, normal y, float a) BUILTIN; vector mix (vector x, vector y, vector a) BUILTIN; vector mix (vector x, vector y, float a) BUILTIN; point mix (point x, point y, point a) BUILTIN; point mix (point x, point y, float a) BUILTIN; color mix (color x, color y, color a) BUILTIN; color mix (color x, color y, float a) BUILTIN; float mix (float x, float y, float a) BUILTIN; #endif int isnan (float x) BUILTIN; int isinf (float x) BUILTIN; int isfinite (float x) BUILTIN; float erf (float x) BUILTIN; float erfc (float x) BUILTIN; // Vector functions vector cross (vector a, vector b) BUILTIN; float dot (vector a, vector b) BUILTIN; float length (vector v) BUILTIN; float distance (point a, point b) BUILTIN; float distance (point a, point b, point q) { vector d = b - a; float dd = dot(d, d); if(dd == 0.0) return distance(q, a); float t = dot(q - a, d)/dd; return distance(q, a + clamp(t, 0.0, 1.0)*d); } normal normalize (normal v) BUILTIN; vector normalize (vector v) BUILTIN; vector faceforward (vector N, vector I, vector Nref) BUILTIN; vector faceforward (vector N, vector I) BUILTIN; vector reflect (vector I, vector N) { return I - 2*dot(N,I)*N; } vector refract (vector I, vector N, float eta) { float IdotN = dot (I, N); float k = 1 - eta*eta * (1 - IdotN*IdotN); return (k < 0) ? vector(0,0,0) : (eta*I - N * (eta*IdotN + sqrt(k))); } void fresnel (vector I, normal N, float eta, output float Kr, output float Kt, output vector R, output vector T) { float sqr(float x) { return x*x; } float c = dot(I, N); if (c < 0) c = -c; R = reflect(I, N); float g = 1.0 / sqr(eta) - 1.0 + c * c; if (g >= 0.0) { g = sqrt (g); float beta = g - c; float F = (c * (g+c) - 1.0) / (c * beta + 1.0); F = 0.5 * (1.0 + sqr(F)); F *= sqr (beta / (g+c)); Kr = F; Kt = (1.0 - Kr) * eta*eta; // OPT: the following recomputes some of the above values, but it // gives us the same result as if the shader-writer called refract() T = refract(I, N, eta); } else { // total internal reflection Kr = 1.0; Kt = 0.0; T = vector (0,0,0); } } void fresnel (vector I, normal N, float eta, output float Kr, output float Kt) { vector R, T; fresnel(I, N, eta, Kr, Kt, R, T); } normal transform (matrix Mto, normal p) BUILTIN; vector transform (matrix Mto, vector p) BUILTIN; point transform (matrix Mto, point p) BUILTIN; normal transform (string from, string to, normal p) BUILTIN; vector transform (string from, string to, vector p) BUILTIN; point transform (string from, string to, point p) BUILTIN; normal transform (string to, normal p) { return transform("common",to,p); } vector transform (string to, vector p) { return transform("common",to,p); } point transform (string to, point p) { return transform("common",to,p); } float transformu (string tounits, float x) BUILTIN; float transformu (string fromunits, string tounits, float x) BUILTIN; point rotate (point p, float angle, point a, point b) { vector axis = normalize (b - a); float cosang, sinang; /* Older OSX has major issues with sincos() function, * it's likely a big in OSL or LLVM. For until we've * updated to new versions of this libraries we'll * use a workaround to prevent possible crashes on all * the platforms. * * Shouldn't be that bad because it's mainly used for * anisotropic shader where angle is usually constant. */ #if 0 sincos (angle, sinang, cosang); #else sinang = sin (angle); cosang = cos (angle); #endif float cosang1 = 1.0 - cosang; float x = axis[0], y = axis[1], z = axis[2]; matrix M = matrix (x * x + (1.0 - x * x) * cosang, x * y * cosang1 + z * sinang, x * z * cosang1 - y * sinang, 0.0, x * y * cosang1 - z * sinang, y * y + (1.0 - y * y) * cosang, y * z * cosang1 + x * sinang, 0.0, x * z * cosang1 + y * sinang, y * z * cosang1 - x * sinang, z * z + (1.0 - z * z) * cosang, 0.0, 0.0, 0.0, 0.0, 1.0); return transform (M, p-a) + a; } // Color functions float luminance (color c) BUILTIN; color blackbody (float temperatureK) BUILTIN; color wavelength_color (float wavelength_nm) BUILTIN; color transformc (string to, color x) { color rgb_to_hsv (color rgb) { // See Foley & van Dam float r = rgb[0], g = rgb[1], b = rgb[2]; float mincomp = min (r, min (g, b)); float maxcomp = max (r, max (g, b)); float delta = maxcomp - mincomp; // chroma float h, s, v; v = maxcomp; if (maxcomp > 0) s = delta / maxcomp; else s = 0; if (s <= 0) h = 0; else { if (r >= maxcomp) h = (g-b) / delta; else if (g >= maxcomp) h = 2 + (b-r) / delta; else h = 4 + (r-g) / delta; h /= 6; if (h < 0) h += 1; } return color (h, s, v); } color rgb_to_hsl (color rgb) { // See Foley & van Dam // First convert rgb to hsv, then to hsl float minval = min (rgb[0], min (rgb[1], rgb[2])); color hsv = rgb_to_hsv (rgb); float maxval = hsv[2]; // v == maxval float h = hsv[0], s, l = (minval+maxval) / 2; if (minval == maxval) s = 0; // special 'achromatic' case, hue is 0 else if (l <= 0.5) s = (maxval - minval) / (maxval + minval); else s = (maxval - minval) / (2 - maxval - minval); return color (h, s, l); } color r; if (to == "rgb" || to == "RGB") r = x; else if (to == "hsv") r = rgb_to_hsv (x); else if (to == "hsl") r = rgb_to_hsl (x); else if (to == "YIQ") r = color (dot (vector(0.299, 0.587, 0.114), (vector)x), dot (vector(0.596, -0.275, -0.321), (vector)x), dot (vector(0.212, -0.523, 0.311), (vector)x)); else if (to == "XYZ") r = color (dot (vector(0.412453, 0.357580, 0.180423), (vector)x), dot (vector(0.212671, 0.715160, 0.072169), (vector)x), dot (vector(0.019334, 0.119193, 0.950227), (vector)x)); else { error ("Unknown color space \"%s\"", to); r = x; } return r; } color transformc (string from, string to, color x) { color hsv_to_rgb (color c) { // Reference: Foley & van Dam float h = c[0], s = c[1], v = c[2]; color r; if (s < 0.0001) { r = v; } else { h = 6 * (h - floor(h)); // expand to [0..6) int hi = (int)h; float f = h - hi; float p = v * (1-s); float q = v * (1-s*f); float t = v * (1-s*(1-f)); if (hi == 0) r = color (v, t, p); else if (hi == 1) r = color (q, v, p); else if (hi == 2) r = color (p, v, t); else if (hi == 3) r = color (p, q, v); else if (hi == 4) r = color (t, p, v); else r = color (v, p, q); } return r; } color hsl_to_rgb (color c) { float h = c[0], s = c[1], l = c[2]; // Easiest to convert hsl -> hsv, then hsv -> RGB (per Foley & van Dam) float v = (l <= 0.5) ? (l * (1 + s)) : (l * (1 - s) + s); color r; if (v <= 0) { r = 0; } else { float min = 2 * l - v; s = (v - min) / v; r = hsv_to_rgb (color (h, s, v)); } return r; } color r; if (from == "rgb" || from == "RGB") r = x; else if (from == "hsv") r = hsv_to_rgb (x); else if (from == "hsl") r = hsl_to_rgb (x); else if (from == "YIQ") r = color (dot (vector(1, 0.9557, 0.6199), (vector)x), dot (vector(1, -0.2716, -0.6469), (vector)x), dot (vector(1, -1.1082, 1.7051), (vector)x)); else if (from == "XYZ") r = color (dot (vector( 3.240479, -1.537150, -0.498535), (vector)x), dot (vector(-0.969256, 1.875991, 0.041556), (vector)x), dot (vector( 0.055648, -0.204043, 1.057311), (vector)x)); else { error ("Unknown color space \"%s\"", to); r = x; } return transformc (to, r); } // Matrix functions float determinant (matrix m) BUILTIN; matrix transpose (matrix m) BUILTIN; // Pattern generation color step (color edge, color x) BUILTIN; point step (point edge, point x) BUILTIN; vector step (vector edge, vector x) BUILTIN; normal step (normal edge, normal x) BUILTIN; float step (float edge, float x) BUILTIN; float smoothstep (float edge0, float edge1, float x) BUILTIN; float linearstep (float edge0, float edge1, float x) { float result; if (edge0 != edge1) { float xclamped = clamp (x, edge0, edge1); result = (xclamped - edge0) / (edge1 - edge0); } else { // special case: edges coincide result = step (edge0, x); } return result; } float smooth_linearstep (float edge0, float edge1, float x_, float eps_) { float result; if (edge0 != edge1) { float rampup (float x, float r) { return 0.5/r * x*x; } float width_inv = 1.0 / (edge1 - edge0); float eps = eps_ * width_inv; float x = (x_ - edge0) * width_inv; if (x <= -eps) result = 0; else if (x >= eps && x <= 1.0-eps) result = x; else if (x >= 1.0+eps) result = 1; else if (x < eps) result = rampup (x+eps, 2.0*eps); else /* if (x < 1.0+eps) */ result = 1.0 - rampup (1.0+eps - x, 2.0*eps); } else { result = step (edge0, x_); } return result; } float aastep (float edge, float s, float dedge, float ds) { // Box filtered AA step float width = fabs(dedge) + fabs(ds); float halfwidth = 0.5*width; float e1 = edge-halfwidth; return (s <= e1) ? 0.0 : ((s >= (edge+halfwidth)) ? 1.0 : (s-e1)/width); } float aastep (float edge, float s, float ds) { return aastep (edge, s, filterwidth(edge), ds); } float aastep (float edge, float s) { return aastep (edge, s, filterwidth(edge), filterwidth(s)); } // Derivatives and area operators // Displacement functions // String functions int strlen (string s) BUILTIN; int hash (string s) BUILTIN; int getchar (string s, int index) BUILTIN; int startswith (string s, string prefix) BUILTIN; int endswith (string s, string suffix) BUILTIN; string substr (string s, int start, int len) BUILTIN; string substr (string s, int start) { return substr (s, start, strlen(s)); } float stof (string str) BUILTIN; int stoi (string str) BUILTIN; // Define concat in terms of shorter concat string concat (string a, string b, string c) { return concat(concat(a,b), c); } string concat (string a, string b, string c, string d) { return concat(concat(a,b,c), d); } string concat (string a, string b, string c, string d, string e) { return concat(concat(a,b,c,d), e); } string concat (string a, string b, string c, string d, string e, string f) { return concat(concat(a,b,c,d,e), f); } // Texture // Closures closure color diffuse(normal N) BUILTIN; closure color oren_nayar(normal N, float sigma) BUILTIN; closure color diffuse_ramp(normal N, color colors[8]) BUILTIN; closure color phong_ramp(normal N, float exponent, color colors[8]) BUILTIN; closure color diffuse_toon(normal N, float size, float smooth) BUILTIN; closure color glossy_toon(normal N, float size, float smooth) BUILTIN; closure color translucent(normal N) BUILTIN; closure color reflection(normal N) BUILTIN; closure color refraction(normal N, float eta) BUILTIN; closure color transparent() BUILTIN; closure color microfacet_ggx(normal N, float ag) BUILTIN; closure color microfacet_ggx_aniso(normal N, vector T, float ax, float ay) BUILTIN; closure color microfacet_ggx_refraction(normal N, float ag, float eta) BUILTIN; closure color microfacet_multi_ggx(normal N, float ag, color C) BUILTIN; closure color microfacet_multi_ggx_aniso(normal N, vector T, float ax, float ay, color C) BUILTIN; closure color microfacet_multi_ggx_glass(normal N, float ag, float eta, color C) BUILTIN; closure color microfacet_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN; closure color microfacet_ggx_aniso_fresnel(normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN; closure color microfacet_multi_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN; closure color microfacet_multi_ggx_aniso_fresnel(normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN; closure color microfacet_multi_ggx_glass_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN; closure color microfacet_beckmann(normal N, float ab) BUILTIN; closure color microfacet_beckmann_aniso(normal N, vector T, float ax, float ay) BUILTIN; closure color microfacet_beckmann_refraction(normal N, float ab, float eta) BUILTIN; closure color ashikhmin_shirley(normal N, vector T,float ax, float ay) BUILTIN; closure color ashikhmin_velvet(normal N, float sigma) BUILTIN; closure color emission() BUILTIN; closure color background() BUILTIN; closure color holdout() BUILTIN; closure color ambient_occlusion() BUILTIN; closure color principled_diffuse(normal N, float roughness) BUILTIN; closure color principled_sheen(normal N) BUILTIN; closure color principled_clearcoat(normal N, float clearcoat, float clearcoat_roughness) BUILTIN; // BSSRDF closure color bssrdf(string method, normal N, vector radius, color albedo) BUILTIN; // Hair closure color hair_reflection(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN; closure color hair_transmission(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN; // Volume closure color henyey_greenstein(float g) BUILTIN; closure color absorption() BUILTIN; // OSL 1.5 Microfacet functions closure color microfacet(string distribution, normal N, vector U, float xalpha, float yalpha, float eta, int refract) { /* GGX */ if (distribution == "ggx" || distribution == "default") { if (!refract) { if (xalpha == yalpha) { /* Isotropic */ return microfacet_ggx(N, xalpha); } else { /* Anisotropic */ return microfacet_ggx_aniso(N, U, xalpha, yalpha); } } else { return microfacet_ggx_refraction(N, xalpha, eta); } } /* Beckmann */ else { if (!refract) { if (xalpha == yalpha) { /* Isotropic */ return microfacet_beckmann(N, xalpha); } else { /* Anisotropic */ return microfacet_beckmann_aniso(N, U, xalpha, yalpha); } } else { return microfacet_beckmann_refraction(N, xalpha, eta); } } } closure color microfacet (string distribution, normal N, float alpha, float eta, int refract) { return microfacet(distribution, N, vector(0), alpha, alpha, eta, refract); } // Renderer state int backfacing () BUILTIN; int raytype (string typename) BUILTIN; // the individual 'isFOOray' functions are deprecated int iscameraray () { return raytype("camera"); } int isdiffuseray () { return raytype("diffuse"); } int isglossyray () { return raytype("glossy"); } int isshadowray () { return raytype("shadow"); } int getmatrix (string fromspace, string tospace, output matrix M) BUILTIN; int getmatrix (string fromspace, output matrix M) { return getmatrix (fromspace, "common", M); } // Miscellaneous #undef BUILTIN #undef BUILTIN_DERIV #undef PERCOMP1 #undef PERCOMP2 #undef PERCOMP2F #endif /* CCL_STDOSL_H */ goxel-0.8.1/ext_src/cycles/src/kernel/split/000077500000000000000000000000001334742672700210105ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_branched.h000066400000000000000000000174611334742672700243000ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #ifdef __BRANCHED_PATH__ /* sets up the various state needed to do an indirect loop */ ccl_device_inline void kernel_split_branched_path_indirect_loop_init(KernelGlobals *kg, int ray_index) { SplitBranchedState *branched_state = &kernel_split_state.branched_state[ray_index]; /* save a copy of the state to restore later */ #define BRANCHED_STORE(name) \ branched_state->name = kernel_split_state.name[ray_index]; BRANCHED_STORE(path_state); BRANCHED_STORE(throughput); BRANCHED_STORE(ray); BRANCHED_STORE(isect); BRANCHED_STORE(ray_state); *kernel_split_sd(branched_state_sd, ray_index) = *kernel_split_sd(sd, ray_index); for(int i = 0; i < kernel_split_sd(branched_state_sd, ray_index)->num_closure; i++) { kernel_split_sd(branched_state_sd, ray_index)->closure[i] = kernel_split_sd(sd, ray_index)->closure[i]; } #undef BRANCHED_STORE /* set loop counters to intial position */ branched_state->next_closure = 0; branched_state->next_sample = 0; } /* ends an indirect loop and restores the previous state */ ccl_device_inline void kernel_split_branched_path_indirect_loop_end(KernelGlobals *kg, int ray_index) { SplitBranchedState *branched_state = &kernel_split_state.branched_state[ray_index]; /* restore state */ #define BRANCHED_RESTORE(name) \ kernel_split_state.name[ray_index] = branched_state->name; BRANCHED_RESTORE(path_state); BRANCHED_RESTORE(throughput); BRANCHED_RESTORE(ray); BRANCHED_RESTORE(isect); BRANCHED_RESTORE(ray_state); *kernel_split_sd(sd, ray_index) = *kernel_split_sd(branched_state_sd, ray_index); for(int i = 0; i < kernel_split_sd(branched_state_sd, ray_index)->num_closure; i++) { kernel_split_sd(sd, ray_index)->closure[i] = kernel_split_sd(branched_state_sd, ray_index)->closure[i]; } #undef BRANCHED_RESTORE /* leave indirect loop */ REMOVE_RAY_FLAG(kernel_split_state.ray_state, ray_index, RAY_BRANCHED_INDIRECT); } ccl_device_inline bool kernel_split_branched_indirect_start_shared(KernelGlobals *kg, int ray_index) { ccl_global char *ray_state = kernel_split_state.ray_state; int inactive_ray = dequeue_ray_index(QUEUE_INACTIVE_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, kernel_split_params.queue_index); if(!IS_STATE(ray_state, inactive_ray, RAY_INACTIVE)) { return false; } #define SPLIT_DATA_ENTRY(type, name, num) \ if(num) { \ kernel_split_state.name[inactive_ray] = kernel_split_state.name[ray_index]; \ } SPLIT_DATA_ENTRIES_BRANCHED_SHARED #undef SPLIT_DATA_ENTRY *kernel_split_sd(sd, inactive_ray) = *kernel_split_sd(sd, ray_index); for(int i = 0; i < kernel_split_sd(sd, ray_index)->num_closure; i++) { kernel_split_sd(sd, inactive_ray)->closure[i] = kernel_split_sd(sd, ray_index)->closure[i]; } kernel_split_state.branched_state[inactive_ray].shared_sample_count = 0; kernel_split_state.branched_state[inactive_ray].original_ray = ray_index; kernel_split_state.branched_state[inactive_ray].waiting_on_shared_samples = false; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; PathRadiance *inactive_L = &kernel_split_state.path_radiance[inactive_ray]; path_radiance_init(inactive_L, kernel_data.film.use_light_pass); path_radiance_copy_indirect(inactive_L, L); ray_state[inactive_ray] = RAY_REGENERATED; ADD_RAY_FLAG(ray_state, inactive_ray, RAY_BRANCHED_INDIRECT_SHARED); ADD_RAY_FLAG(ray_state, inactive_ray, IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)); atomic_fetch_and_inc_uint32((ccl_global uint*)&kernel_split_state.branched_state[ray_index].shared_sample_count); return true; } /* bounce off surface and integrate indirect light */ ccl_device_noinline bool kernel_split_branched_path_surface_indirect_light_iter(KernelGlobals *kg, int ray_index, float num_samples_adjust, ShaderData *saved_sd, bool reset_path_state, bool wait_for_shared) { SplitBranchedState *branched_state = &kernel_split_state.branched_state[ray_index]; ShaderData *sd = saved_sd; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; float3 throughput = branched_state->throughput; ccl_global PathState *ps = &kernel_split_state.path_state[ray_index]; float sum_sample_weight = 0.0f; #ifdef __DENOISING_FEATURES__ if(ps->denoising_feature_weight > 0.0f) { for(int i = 0; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; /* transparency is not handled here, but in outer loop */ if(!CLOSURE_IS_BSDF(sc->type) || CLOSURE_IS_BSDF_TRANSPARENT(sc->type)) { continue; } sum_sample_weight += sc->sample_weight; } } else { sum_sample_weight = 1.0f; } #endif /* __DENOISING_FEATURES__ */ for(int i = branched_state->next_closure; i < sd->num_closure; i++) { const ShaderClosure *sc = &sd->closure[i]; if(!CLOSURE_IS_BSDF(sc->type)) continue; /* transparency is not handled here, but in outer loop */ if(sc->type == CLOSURE_BSDF_TRANSPARENT_ID) continue; int num_samples; if(CLOSURE_IS_BSDF_DIFFUSE(sc->type)) num_samples = kernel_data.integrator.diffuse_samples; else if(CLOSURE_IS_BSDF_BSSRDF(sc->type)) num_samples = 1; else if(CLOSURE_IS_BSDF_GLOSSY(sc->type)) num_samples = kernel_data.integrator.glossy_samples; else num_samples = kernel_data.integrator.transmission_samples; num_samples = ceil_to_int(num_samples_adjust*num_samples); float num_samples_inv = num_samples_adjust/num_samples; for(int j = branched_state->next_sample; j < num_samples; j++) { if(reset_path_state) { *ps = branched_state->path_state; } ps->rng_hash = cmj_hash(branched_state->path_state.rng_hash, i); ccl_global float3 *tp = &kernel_split_state.throughput[ray_index]; *tp = throughput; ccl_global Ray *bsdf_ray = &kernel_split_state.ray[ray_index]; if(!kernel_branched_path_surface_bounce(kg, sd, sc, j, num_samples, tp, ps, &L->state, bsdf_ray, sum_sample_weight)) { continue; } ps->rng_hash = branched_state->path_state.rng_hash; /* update state for next iteration */ branched_state->next_closure = i; branched_state->next_sample = j+1; /* start the indirect path */ *tp *= num_samples_inv; if(kernel_split_branched_indirect_start_shared(kg, ray_index)) { continue; } return true; } branched_state->next_sample = 0; } branched_state->next_closure = sd->num_closure; if(wait_for_shared) { branched_state->waiting_on_shared_samples = (branched_state->shared_sample_count > 0); if(branched_state->waiting_on_shared_samples) { return true; } } return false; } #endif /* __BRANCHED_PATH__ */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_buffer_update.h000066400000000000000000000135671334742672700253500ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel takes care of rays that hit the background (sceneintersect * kernel), and for the rays of state RAY_UPDATE_BUFFER it updates the ray's * accumulated radiance in the output buffer. This kernel also takes care of * rays that have been determined to-be-regenerated. * * We will empty QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue in this kernel. * * Typically all rays that are in state RAY_HIT_BACKGROUND, RAY_UPDATE_BUFFER * will be eventually set to RAY_TO_REGENERATE state in this kernel. * Finally all rays of ray_state RAY_TO_REGENERATE will be regenerated and put * in queue QUEUE_ACTIVE_AND_REGENERATED_RAYS. * * State of queues when this kernel is called: * At entry, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE rays. * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with * RAY_UPDATE_BUFFER, RAY_HIT_BACKGROUND, RAY_TO_REGENERATE rays. * At exit, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and * RAY_REGENERATED rays. * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be empty. */ ccl_device void kernel_buffer_update(KernelGlobals *kg, ccl_local_param unsigned int *local_queue_atomics) { if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(ray_index == 0) { /* We will empty this queue in this kernel. */ kernel_split_params.queue_index[QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS] = 0; } char enqueue_flag = 0; ray_index = get_ray_index(kg, ray_index, QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); #ifdef __COMPUTE_DEVICE_GPU__ /* If we are executing on a GPU device, we exit all threads that are not * required. * * If we are executing on a CPU device, then we need to keep all threads * active since we have barrier() calls later in the kernel. CPU devices, * expect all threads to execute barrier statement. */ if(ray_index == QUEUE_EMPTY_SLOT) { return; } #endif #ifndef __COMPUTE_DEVICE_GPU__ if(ray_index != QUEUE_EMPTY_SLOT) { #endif ccl_global char *ray_state = kernel_split_state.ray_state; ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; if(IS_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER)) { uint sample = state->sample; uint buffer_offset = kernel_split_state.buffer_offset[ray_index]; ccl_global float *buffer = kernel_split_params.tile.buffer + buffer_offset; /* accumulate result in output buffer */ kernel_write_result(kg, buffer, sample, L); ASSIGN_RAY_STATE(ray_state, ray_index, RAY_TO_REGENERATE); } if(IS_STATE(ray_state, ray_index, RAY_TO_REGENERATE)) { /* We have completed current work; So get next work */ ccl_global uint *work_pools = kernel_split_params.work_pools; uint total_work_size = kernel_split_params.total_work_size; uint work_index; if(!get_next_work(kg, work_pools, total_work_size, ray_index, &work_index)) { /* If work is invalid, this means no more work is available and the thread may exit */ ASSIGN_RAY_STATE(ray_state, ray_index, RAY_INACTIVE); } if(IS_STATE(ray_state, ray_index, RAY_TO_REGENERATE)) { ccl_global WorkTile *tile = &kernel_split_params.tile; uint x, y, sample; get_work_pixel(tile, work_index, &x, &y, &sample); /* Store buffer offset for writing to passes. */ uint buffer_offset = (tile->offset + x + y*tile->stride) * kernel_data.film.pass_stride; kernel_split_state.buffer_offset[ray_index] = buffer_offset; /* Initialize random numbers and ray. */ uint rng_hash; kernel_path_trace_setup(kg, sample, x, y, &rng_hash, ray); if(ray->t != 0.0f) { /* Initialize throughput, path radiance, Ray, PathState; * These rays proceed with path-iteration. */ *throughput = make_float3(1.0f, 1.0f, 1.0f); path_radiance_init(L, kernel_data.film.use_light_pass); path_state_init(kg, AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]), state, rng_hash, sample, ray); #ifdef __SUBSURFACE__ kernel_path_subsurface_init_indirect(&kernel_split_state.ss_rays[ray_index]); #endif ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); enqueue_flag = 1; } else { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_TO_REGENERATE); } } } #ifndef __COMPUTE_DEVICE_GPU__ } #endif /* Enqueue RAY_REGENERATED rays into QUEUE_ACTIVE_AND_REGENERATED_RAYS; * These rays will be made active during next SceneIntersectkernel. */ enqueue_ray_index_local(ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, enqueue_flag, kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_data_init.h000066400000000000000000000063561334742672700244670ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel Initializes structures needed in path-iteration kernels. * * Note on Queues: * All slots in queues are initialized to queue empty slot; * The number of elements in the queues is initialized to 0; */ #ifndef __KERNEL_CPU__ ccl_device void kernel_data_init( #else void KERNEL_FUNCTION_FULL_NAME(data_init)( #endif KernelGlobals *kg, ccl_constant KernelData *data, ccl_global void *split_data_buffer, int num_elements, ccl_global char *ray_state, #ifdef __KERNEL_OPENCL__ KERNEL_BUFFER_PARAMS, #endif int start_sample, int end_sample, int sx, int sy, int sw, int sh, int offset, int stride, ccl_global int *Queue_index, /* Tracks the number of elements in queues */ int queuesize, /* size (capacity) of the queue */ ccl_global char *use_queues_flag, /* flag to decide if scene-intersect kernel should use queues to fetch ray index */ ccl_global unsigned int *work_pools, /* Work pool for each work group */ unsigned int num_samples, ccl_global float *buffer) { #ifdef KERNEL_STUB STUB_ASSERT(KERNEL_ARCH, data_init); #else #ifdef __KERNEL_OPENCL__ kg->data = data; #endif kernel_split_params.tile.x = sx; kernel_split_params.tile.y = sy; kernel_split_params.tile.w = sw; kernel_split_params.tile.h = sh; kernel_split_params.tile.start_sample = start_sample; kernel_split_params.tile.num_samples = num_samples; kernel_split_params.tile.offset = offset; kernel_split_params.tile.stride = stride; kernel_split_params.tile.buffer = buffer; kernel_split_params.total_work_size = sw * sh * num_samples; kernel_split_params.work_pools = work_pools; kernel_split_params.queue_index = Queue_index; kernel_split_params.queue_size = queuesize; kernel_split_params.use_queues_flag = use_queues_flag; split_data_init(kg, &kernel_split_state, num_elements, split_data_buffer, ray_state); #ifdef __KERNEL_OPENCL__ kernel_set_buffer_pointers(kg, KERNEL_BUFFER_ARGS); kernel_set_buffer_info(kg); #endif int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); /* Initialize queue data and queue index. */ if(thread_index < queuesize) { for(int i = 0; i < NUM_QUEUES; i++) { kernel_split_state.queue_data[i * queuesize + thread_index] = QUEUE_EMPTY_SLOT; } } if(thread_index == 0) { for(int i = 0; i < NUM_QUEUES; i++) { Queue_index[i] = 0; } /* The scene-intersect kernel should not use the queues very first time. * since the queue would be empty. */ *use_queues_flag = 0; } #endif /* KERENL_STUB */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_direct_lighting.h000066400000000000000000000130151334742672700256600ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel takes care of direct lighting logic. * However, the "shadow ray cast" part of direct lighting is handled * in the next kernel. * * This kernels determines the rays for which a shadow_blocked() function * associated with direct lighting should be executed. Those rays for which * a shadow_blocked() function for direct-lighting must be executed, are * marked with flag RAY_SHADOW_RAY_CAST_DL and enqueued into the queue * QUEUE_SHADOW_RAY_CAST_DL_RAYS * * Note on Queues: * This kernel only reads from the QUEUE_ACTIVE_AND_REGENERATED_RAYS queue * and processes only the rays of state RAY_ACTIVE; If a ray needs to execute * the corresponding shadow_blocked part, after direct lighting, the ray is * marked with RAY_SHADOW_RAY_CAST_DL flag. * * State of queues when this kernel is called: * - State of queues QUEUE_ACTIVE_AND_REGENERATED_RAYS and * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be same before and after this * kernel call. * - QUEUE_SHADOW_RAY_CAST_DL_RAYS queue will be filled with rays for which a * shadow_blocked function must be executed, after this kernel call * Before this kernel call the QUEUE_SHADOW_RAY_CAST_DL_RAYS will be empty. */ ccl_device void kernel_direct_lighting(KernelGlobals *kg, ccl_local_param unsigned int *local_queue_atomics) { if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); char enqueue_flag = 0; int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 0); if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) { ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); /* direct lighting */ #ifdef __EMISSION__ bool flag = (kernel_data.integrator.use_direct_light && (sd->flag & SD_BSDF_HAS_EVAL)); # ifdef __BRANCHED_PATH__ if(flag && kernel_data.integrator.branched) { flag = false; enqueue_flag = 1; } # endif /* __BRANCHED_PATH__ */ # ifdef __SHADOW_TRICKS__ if(flag && state->flag & PATH_RAY_SHADOW_CATCHER) { flag = false; enqueue_flag = 1; } # endif /* __SHADOW_TRICKS__ */ if(flag) { /* Sample illumination from lights to find path contribution. */ float light_u, light_v; path_state_rng_2D(kg, state, PRNG_LIGHT_U, &light_u, &light_v); float terminate = path_state_rng_light_termination(kg, state); LightSample ls; if(light_sample(kg, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { Ray light_ray; light_ray.time = sd->time; BsdfEval L_light; bool is_lamp; if(direct_emission(kg, sd, AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]), &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { /* Write intermediate data to global memory to access from * the next kernel. */ kernel_split_state.light_ray[ray_index] = light_ray; kernel_split_state.bsdf_eval[ray_index] = L_light; kernel_split_state.is_lamp[ray_index] = is_lamp; /* Mark ray state for next shadow kernel. */ enqueue_flag = 1; } } } #endif /* __EMISSION__ */ } #ifdef __EMISSION__ /* Enqueue RAY_SHADOW_RAY_CAST_DL rays. */ enqueue_ray_index_local(ray_index, QUEUE_SHADOW_RAY_CAST_DL_RAYS, enqueue_flag, kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); #endif #ifdef __BRANCHED_PATH__ /* Enqueue RAY_LIGHT_INDIRECT_NEXT_ITER rays * this is the last kernel before next_iteration_setup that uses local atomics so we do this here */ ccl_barrier(CCL_LOCAL_MEM_FENCE); if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); enqueue_ray_index_local(ray_index, QUEUE_LIGHT_INDIRECT_ITER, IS_STATE(kernel_split_state.ray_state, ray_index, RAY_LIGHT_INDIRECT_NEXT_ITER), kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); #endif /* __BRANCHED_PATH__ */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_do_volume.h000066400000000000000000000173241334742672700245210ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #if defined(__BRANCHED_PATH__) && defined(__VOLUME__) ccl_device_inline void kernel_split_branched_path_volume_indirect_light_init(KernelGlobals *kg, int ray_index) { kernel_split_branched_path_indirect_loop_init(kg, ray_index); ADD_RAY_FLAG(kernel_split_state.ray_state, ray_index, RAY_BRANCHED_VOLUME_INDIRECT); } ccl_device_noinline bool kernel_split_branched_path_volume_indirect_light_iter(KernelGlobals *kg, int ray_index) { SplitBranchedState *branched_state = &kernel_split_state.branched_state[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); /* GPU: no decoupled ray marching, scatter probalistically */ int num_samples = kernel_data.integrator.volume_samples; float num_samples_inv = 1.0f/num_samples; Ray volume_ray = branched_state->ray; volume_ray.t = (!IS_STATE(&branched_state->ray_state, 0, RAY_HIT_BACKGROUND)) ? branched_state->isect.t : FLT_MAX; bool heterogeneous = volume_stack_is_heterogeneous(kg, branched_state->path_state.volume_stack); for(int j = branched_state->next_sample; j < num_samples; j++) { ccl_global PathState *ps = &kernel_split_state.path_state[ray_index]; *ps = branched_state->path_state; ccl_global Ray *pray = &kernel_split_state.ray[ray_index]; *pray = branched_state->ray; ccl_global float3 *tp = &kernel_split_state.throughput[ray_index]; *tp = branched_state->throughput * num_samples_inv; /* branch RNG state */ path_state_branch(ps, j, num_samples); /* integrate along volume segment with distance sampling */ VolumeIntegrateResult result = kernel_volume_integrate( kg, ps, sd, &volume_ray, L, tp, heterogeneous); # ifdef __VOLUME_SCATTER__ if(result == VOLUME_PATH_SCATTERED) { /* direct lighting */ kernel_path_volume_connect_light(kg, sd, emission_sd, *tp, &branched_state->path_state, L); /* indirect light bounce */ if(!kernel_path_volume_bounce(kg, sd, tp, ps, &L->state, pray)) { continue; } /* start the indirect path */ branched_state->next_closure = 0; branched_state->next_sample = j+1; /* Attempting to share too many samples is slow for volumes as it causes us to * loop here more and have many calls to kernel_volume_integrate which evaluates * shaders. The many expensive shader evaluations cause the work load to become * unbalanced and many threads to become idle in this kernel. Limiting the * number of shared samples here helps quite a lot. */ if(branched_state->shared_sample_count < 2) { if(kernel_split_branched_indirect_start_shared(kg, ray_index)) { continue; } } return true; } # endif } branched_state->next_sample = num_samples; branched_state->waiting_on_shared_samples = (branched_state->shared_sample_count > 0); if(branched_state->waiting_on_shared_samples) { return true; } kernel_split_branched_path_indirect_loop_end(kg, ray_index); /* todo: avoid this calculation using decoupled ray marching */ float3 throughput = kernel_split_state.throughput[ray_index]; kernel_volume_shadow(kg, emission_sd, &kernel_split_state.path_state[ray_index], &volume_ray, &throughput); kernel_split_state.throughput[ray_index] = throughput; return false; } #endif /* __BRANCHED_PATH__ && __VOLUME__ */ ccl_device void kernel_do_volume(KernelGlobals *kg) { #ifdef __VOLUME__ /* We will empty this queue in this kernel. */ if(ccl_global_id(0) == 0 && ccl_global_id(1) == 0) { kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS] = 0; # ifdef __BRANCHED_PATH__ kernel_split_params.queue_index[QUEUE_VOLUME_INDIRECT_ITER] = 0; # endif /* __BRANCHED_PATH__ */ } int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(*kernel_split_params.use_queues_flag) { ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); } ccl_global char *ray_state = kernel_split_state.ray_state; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; if(IS_STATE(ray_state, ray_index, RAY_ACTIVE) || IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND)) { ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; ccl_global Intersection *isect = &kernel_split_state.isect[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); bool hit = ! IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND); /* Sanitize volume stack. */ if(!hit) { kernel_volume_clean_stack(kg, state->volume_stack); } /* volume attenuation, emission, scatter */ if(state->volume_stack[0].shader != SHADER_NONE) { Ray volume_ray = *ray; volume_ray.t = (hit)? isect->t: FLT_MAX; # ifdef __BRANCHED_PATH__ if(!kernel_data.integrator.branched || IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)) { # endif /* __BRANCHED_PATH__ */ bool heterogeneous = volume_stack_is_heterogeneous(kg, state->volume_stack); { /* integrate along volume segment with distance sampling */ VolumeIntegrateResult result = kernel_volume_integrate( kg, state, sd, &volume_ray, L, throughput, heterogeneous); # ifdef __VOLUME_SCATTER__ if(result == VOLUME_PATH_SCATTERED) { /* direct lighting */ kernel_path_volume_connect_light(kg, sd, emission_sd, *throughput, state, L); /* indirect light bounce */ if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } else { kernel_split_path_end(kg, ray_index); } } # endif /* __VOLUME_SCATTER__ */ } # ifdef __BRANCHED_PATH__ } else { kernel_split_branched_path_volume_indirect_light_init(kg, ray_index); if(kernel_split_branched_path_volume_indirect_light_iter(kg, ray_index)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } } # endif /* __BRANCHED_PATH__ */ } } # ifdef __BRANCHED_PATH__ /* iter loop */ ray_index = get_ray_index(kg, ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0), QUEUE_VOLUME_INDIRECT_ITER, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); if(IS_STATE(ray_state, ray_index, RAY_VOLUME_INDIRECT_NEXT_ITER)) { /* for render passes, sum and reset indirect light pass variables * for the next samples */ path_radiance_sum_indirect(&kernel_split_state.path_radiance[ray_index]); path_radiance_reset_indirect(&kernel_split_state.path_radiance[ray_index]); if(kernel_split_branched_path_volume_indirect_light_iter(kg, ray_index)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } } # endif /* __BRANCHED_PATH__ */ #endif /* __VOLUME__ */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_enqueue_inactive.h000066400000000000000000000030461334742672700260550ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void kernel_enqueue_inactive(KernelGlobals *kg, ccl_local_param unsigned int *local_queue_atomics) { #ifdef __BRANCHED_PATH__ /* Enqeueue RAY_INACTIVE rays into QUEUE_INACTIVE_RAYS queue. */ if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); char enqueue_flag = 0; if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_INACTIVE)) { enqueue_flag = 1; } enqueue_ray_index_local(ray_index, QUEUE_INACTIVE_RAYS, enqueue_flag, kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); #endif /* __BRANCHED_PATH__ */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h000066400000000000000000000140371334742672700337630ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel takes care of the logic to process "material of type holdout", * indirect primitive emission, bsdf blurring, probabilistic path termination * and AO. * * This kernels determines the rays for which a shadow_blocked() function * associated with AO should be executed. Those rays for which a * shadow_blocked() function for AO must be executed are marked with flag * RAY_SHADOW_RAY_CAST_ao and enqueued into the queue * QUEUE_SHADOW_RAY_CAST_AO_RAYS * * Ray state of rays that are terminated in this kernel are changed to RAY_UPDATE_BUFFER * * Note on Queues: * This kernel fetches rays from the queue QUEUE_ACTIVE_AND_REGENERATED_RAYS * and processes only the rays of state RAY_ACTIVE. * There are different points in this kernel where a ray may terminate and * reach RAY_UPDATE_BUFFER state. These rays are enqueued into * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. These rays will still be present * in QUEUE_ACTIVE_AND_REGENERATED_RAYS queue, but since their ray-state has * been changed to RAY_UPDATE_BUFFER, there is no problem. * * State of queues when this kernel is called: * At entry, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and * RAY_REGENERATED rays * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with * RAY_TO_REGENERATE rays. * - QUEUE_SHADOW_RAY_CAST_AO_RAYS will be empty. * At exit, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE, * RAY_REGENERATED and RAY_UPDATE_BUFFER rays. * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with * RAY_TO_REGENERATE and RAY_UPDATE_BUFFER rays. * - QUEUE_SHADOW_RAY_CAST_AO_RAYS will be filled with rays marked with * flag RAY_SHADOW_RAY_CAST_AO */ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao( KernelGlobals *kg, ccl_local_param BackgroundAOLocals *locals) { if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { locals->queue_atomics_bg = 0; locals->queue_atomics_ao = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); #ifdef __AO__ char enqueue_flag = 0; #endif int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 0); #ifdef __COMPUTE_DEVICE_GPU__ /* If we are executing on a GPU device, we exit all threads that are not * required. * * If we are executing on a CPU device, then we need to keep all threads * active since we have barrier() calls later in the kernel. CPU devices, * expect all threads to execute barrier statement. */ if(ray_index == QUEUE_EMPTY_SLOT) { return; } #endif /* __COMPUTE_DEVICE_GPU__ */ #ifndef __COMPUTE_DEVICE_GPU__ if(ray_index != QUEUE_EMPTY_SLOT) { #endif ccl_global PathState *state = 0x0; float3 throughput; ccl_global char *ray_state = kernel_split_state.ray_state; ShaderData *sd = kernel_split_sd(sd, ray_index); if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { uint buffer_offset = kernel_split_state.buffer_offset[ray_index]; ccl_global float *buffer = kernel_split_params.tile.buffer + buffer_offset; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; throughput = kernel_split_state.throughput[ray_index]; state = &kernel_split_state.path_state[ray_index]; if(!kernel_path_shader_apply(kg, sd, state, ray, throughput, emission_sd, L, buffer)) { kernel_split_path_end(kg, ray_index); } } if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { /* Path termination. this is a strange place to put the termination, it's * mainly due to the mixed in MIS that we use. gives too many unneeded * shader evaluations, only need emission if we are going to terminate. */ float probability = path_state_continuation_probability(kg, state, throughput); if(probability == 0.0f) { kernel_split_path_end(kg, ray_index); } else if(probability < 1.0f) { float terminate = path_state_rng_1D(kg, state, PRNG_TERMINATE); if(terminate >= probability) { kernel_split_path_end(kg, ray_index); } else { kernel_split_state.throughput[ray_index] = throughput/probability; } } if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; kernel_update_denoising_features(kg, sd, state, L); } } #ifdef __AO__ if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { /* ambient occlusion */ if(kernel_data.integrator.use_ambient_occlusion || (sd->flag & SD_AO)) { enqueue_flag = 1; } } #endif /* __AO__ */ #ifndef __COMPUTE_DEVICE_GPU__ } #endif #ifdef __AO__ /* Enqueue to-shadow-ray-cast rays. */ enqueue_ray_index_local(ray_index, QUEUE_SHADOW_RAY_CAST_AO_RAYS, enqueue_flag, kernel_split_params.queue_size, &locals->queue_atomics_ao, kernel_split_state.queue_data, kernel_split_params.queue_index); #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_indirect_background.h000066400000000000000000000042771334742672700265330ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void kernel_indirect_background(KernelGlobals *kg) { ccl_global char *ray_state = kernel_split_state.ray_state; int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); int ray_index; if(kernel_data.integrator.ao_bounces != INT_MAX) { ray_index = get_ray_index(kg, thread_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 0); if(ray_index != QUEUE_EMPTY_SLOT) { if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; if(path_state_ao_bounce(kg, state)) { kernel_split_path_end(kg, ray_index); } } } } ray_index = get_ray_index(kg, thread_index, QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 0); if(ray_index == QUEUE_EMPTY_SLOT) { return; } if(IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND)) { ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; float3 throughput = kernel_split_state.throughput[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); kernel_path_background(kg, state, ray, throughput, sd, L); kernel_split_path_end(kg, ray_index); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_indirect_subsurface.h000066400000000000000000000046451334742672700265550ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void kernel_indirect_subsurface(KernelGlobals *kg) { int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(thread_index == 0) { /* We will empty both queues in this kernel. */ kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS] = 0; kernel_split_params.queue_index[QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS] = 0; } int ray_index; get_ray_index(kg, thread_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); ray_index = get_ray_index(kg, thread_index, QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); #ifdef __SUBSURFACE__ if(ray_index == QUEUE_EMPTY_SLOT) { return; } ccl_global char *ray_state = kernel_split_state.ray_state; ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; if(IS_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER)) { ccl_addr_space SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index]; /* Trace indirect subsurface rays by restarting the loop. this uses less * stack memory than invoking kernel_path_indirect. */ if(ss_indirect->num_rays) { kernel_path_subsurface_setup_indirect(kg, ss_indirect, state, ray, L, throughput); ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } } #endif /* __SUBSURFACE__ */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_lamp_emission.h000066400000000000000000000044651334742672700253710ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel operates on QUEUE_ACTIVE_AND_REGENERATED_RAYS. * It processes rays of state RAY_ACTIVE and RAY_HIT_BACKGROUND. * We will empty QUEUE_ACTIVE_AND_REGENERATED_RAYS queue in this kernel. */ ccl_device void kernel_lamp_emission(KernelGlobals *kg) { #ifndef __VOLUME__ /* We will empty this queue in this kernel. */ if(ccl_global_id(0) == 0 && ccl_global_id(1) == 0) { kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS] = 0; } #endif /* Fetch use_queues_flag. */ char local_use_queues_flag = *kernel_split_params.use_queues_flag; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(local_use_queues_flag) { ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, #ifndef __VOLUME__ 1 #else 0 #endif ); if(ray_index == QUEUE_EMPTY_SLOT) { return; } } if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE) || IS_STATE(kernel_split_state.ray_state, ray_index, RAY_HIT_BACKGROUND)) { PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; float3 throughput = kernel_split_state.throughput[ray_index]; Ray ray = kernel_split_state.ray[ray_index]; ccl_global Intersection *isect = &kernel_split_state.isect[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); kernel_path_lamp_emission(kg, state, &ray, throughput, isect, sd, L); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_next_iteration_setup.h000066400000000000000000000236671334742672700270130ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /*This kernel takes care of setting up ray for the next iteration of * path-iteration and accumulating radiance corresponding to AO and * direct-lighting * * Ray state of rays that are terminated in this kernel are changed * to RAY_UPDATE_BUFFER. * * Note on queues: * This kernel fetches rays from the queue QUEUE_ACTIVE_AND_REGENERATED_RAYS * and processes only the rays of state RAY_ACTIVE. * There are different points in this kernel where a ray may terminate and * reach RAY_UPDATE_BUFF state. These rays are enqueued into * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. These rays will still be present * in QUEUE_ACTIVE_AND_REGENERATED_RAYS queue, but since their ray-state has * been changed to RAY_UPDATE_BUFF, there is no problem. * * State of queues when this kernel is called: * At entry, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE, * RAY_REGENERATED, RAY_UPDATE_BUFFER rays. * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with * RAY_TO_REGENERATE and RAY_UPDATE_BUFFER rays. * At exit, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE, * RAY_REGENERATED and more RAY_UPDATE_BUFFER rays. * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with * RAY_TO_REGENERATE and more RAY_UPDATE_BUFFER rays. */ #ifdef __BRANCHED_PATH__ ccl_device_inline void kernel_split_branched_indirect_light_init(KernelGlobals *kg, int ray_index) { kernel_split_branched_path_indirect_loop_init(kg, ray_index); ADD_RAY_FLAG(kernel_split_state.ray_state, ray_index, RAY_BRANCHED_LIGHT_INDIRECT); } ccl_device void kernel_split_branched_transparent_bounce(KernelGlobals *kg, int ray_index) { ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; # ifdef __VOLUME__ if(!(sd->flag & SD_HAS_ONLY_VOLUME)) { # endif /* continue in case of transparency */ *throughput *= shader_bsdf_transparency(kg, sd); if(is_zero(*throughput)) { kernel_split_path_end(kg, ray_index); return; } /* Update Path State */ path_state_next(kg, state, LABEL_TRANSPARENT); # ifdef __VOLUME__ } else { /* For volume bounding meshes we pass through without counting transparent * bounces, only sanity check in case self intersection gets us stuck. */ state->volume_bounds_bounce++; if (state->volume_bounds_bounce > VOLUME_BOUNDS_MAX) { kernel_split_path_end(kg, ray_index); return; } } # endif ray->P = ray_offset(sd->P, -sd->Ng); ray->t -= sd->ray_length; /* clipping works through transparent */ # ifdef __RAY_DIFFERENTIALS__ ray->dP = sd->dP; ray->dD.dx = -sd->dI.dx; ray->dD.dy = -sd->dI.dy; # endif /* __RAY_DIFFERENTIALS__ */ # ifdef __VOLUME__ /* enter/exit volume */ kernel_volume_stack_enter_exit(kg, sd, state->volume_stack); # endif /* __VOLUME__ */ } #endif /* __BRANCHED_PATH__ */ ccl_device void kernel_next_iteration_setup(KernelGlobals *kg, ccl_local_param unsigned int *local_queue_atomics) { if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); if(ccl_global_id(0) == 0 && ccl_global_id(1) == 0) { /* If we are here, then it means that scene-intersect kernel * has already been executed atleast once. From the next time, * scene-intersect kernel may operate on queues to fetch ray index */ *kernel_split_params.use_queues_flag = 1; /* Mark queue indices of QUEUE_SHADOW_RAY_CAST_AO_RAYS and * QUEUE_SHADOW_RAY_CAST_DL_RAYS queues that were made empty during the * previous kernel. */ kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_AO_RAYS] = 0; kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_DL_RAYS] = 0; } int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 0); ccl_global char *ray_state = kernel_split_state.ray_state; # ifdef __VOLUME__ /* Reactivate only volume rays here, most surface work was skipped. */ if(IS_STATE(ray_state, ray_index, RAY_HAS_ONLY_VOLUME)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_ACTIVE); } # endif bool active = IS_STATE(ray_state, ray_index, RAY_ACTIVE); if(active) { ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; #ifdef __BRANCHED_PATH__ if(!kernel_data.integrator.branched || IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)) { #endif /* Compute direct lighting and next bounce. */ if(!kernel_path_surface_bounce(kg, sd, throughput, state, &L->state, ray)) { kernel_split_path_end(kg, ray_index); } #ifdef __BRANCHED_PATH__ } else if(sd->flag & SD_HAS_ONLY_VOLUME) { kernel_split_branched_transparent_bounce(kg, ray_index); } else { kernel_split_branched_indirect_light_init(kg, ray_index); if(kernel_split_branched_path_surface_indirect_light_iter(kg, ray_index, 1.0f, kernel_split_sd(branched_state_sd, ray_index), true, true)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } else { kernel_split_branched_path_indirect_loop_end(kg, ray_index); kernel_split_branched_transparent_bounce(kg, ray_index); } } #endif /* __BRANCHED_PATH__ */ } /* Enqueue RAY_UPDATE_BUFFER rays. */ enqueue_ray_index_local(ray_index, QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, IS_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER) && active, kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); #ifdef __BRANCHED_PATH__ /* iter loop */ if(ccl_global_id(0) == 0 && ccl_global_id(1) == 0) { kernel_split_params.queue_index[QUEUE_LIGHT_INDIRECT_ITER] = 0; } ray_index = get_ray_index(kg, ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0), QUEUE_LIGHT_INDIRECT_ITER, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); if(IS_STATE(ray_state, ray_index, RAY_LIGHT_INDIRECT_NEXT_ITER)) { /* for render passes, sum and reset indirect light pass variables * for the next samples */ PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; path_radiance_sum_indirect(L); path_radiance_reset_indirect(L); if(kernel_split_branched_path_surface_indirect_light_iter(kg, ray_index, 1.0f, kernel_split_sd(branched_state_sd, ray_index), true, true)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } else { kernel_split_branched_path_indirect_loop_end(kg, ray_index); kernel_split_branched_transparent_bounce(kg, ray_index); } } # ifdef __VOLUME__ /* Enqueue RAY_VOLUME_INDIRECT_NEXT_ITER rays */ ccl_barrier(CCL_LOCAL_MEM_FENCE); if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); enqueue_ray_index_local(ray_index, QUEUE_VOLUME_INDIRECT_ITER, IS_STATE(kernel_split_state.ray_state, ray_index, RAY_VOLUME_INDIRECT_NEXT_ITER), kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); # endif /* __VOLUME__ */ # ifdef __SUBSURFACE__ /* Enqueue RAY_SUBSURFACE_INDIRECT_NEXT_ITER rays */ ccl_barrier(CCL_LOCAL_MEM_FENCE); if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); enqueue_ray_index_local(ray_index, QUEUE_SUBSURFACE_INDIRECT_ITER, IS_STATE(kernel_split_state.ray_state, ray_index, RAY_SUBSURFACE_INDIRECT_NEXT_ITER), kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); # endif /* __SUBSURFACE__ */ #endif /* __BRANCHED_PATH__ */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_path_init.h000066400000000000000000000055001334742672700245000ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel initializes structures needed in path-iteration kernels. * This is the first kernel in ray-tracing logic. * * Ray state of rays outside the tile-boundary will be marked RAY_INACTIVE */ ccl_device void kernel_path_init(KernelGlobals *kg) { int ray_index = ccl_global_id(0) + ccl_global_id(1) * ccl_global_size(0); /* This is the first assignment to ray_state; * So we dont use ASSIGN_RAY_STATE macro. */ kernel_split_state.ray_state[ray_index] = RAY_ACTIVE; /* Get work. */ ccl_global uint *work_pools = kernel_split_params.work_pools; uint total_work_size = kernel_split_params.total_work_size; uint work_index; if(!get_next_work(kg, work_pools, total_work_size, ray_index, &work_index)) { /* No more work, mark ray as inactive */ kernel_split_state.ray_state[ray_index] = RAY_INACTIVE; return; } ccl_global WorkTile *tile = &kernel_split_params.tile; uint x, y, sample; get_work_pixel(tile, work_index, &x, &y, &sample); /* Store buffer offset for writing to passes. */ uint buffer_offset = (tile->offset + x + y*tile->stride) * kernel_data.film.pass_stride; kernel_split_state.buffer_offset[ray_index] = buffer_offset; /* Initialize random numbers and ray. */ uint rng_hash; kernel_path_trace_setup(kg, sample, x, y, &rng_hash, &kernel_split_state.ray[ray_index]); if(kernel_split_state.ray[ray_index].t != 0.0f) { /* Initialize throughput, path radiance, Ray, PathState; * These rays proceed with path-iteration. */ kernel_split_state.throughput[ray_index] = make_float3(1.0f, 1.0f, 1.0f); path_radiance_init(&kernel_split_state.path_radiance[ray_index], kernel_data.film.use_light_pass); path_state_init(kg, AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]), &kernel_split_state.path_state[ray_index], rng_hash, sample, &kernel_split_state.ray[ray_index]); #ifdef __SUBSURFACE__ kernel_path_subsurface_init_indirect(&kernel_split_state.ss_rays[ray_index]); #endif } else { ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_queue_enqueue.h000066400000000000000000000071101334742672700253730ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel enqueues rays of different ray state into their * appropriate queues: * * 1. Rays that have been determined to hit the background from the * "kernel_scene_intersect" kernel are enqueued in * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS; * 2. Rays that have been determined to be actively participating in pat * -iteration will be enqueued into QUEUE_ACTIVE_AND_REGENERATED_RAYS. * * State of queue during other times this kernel is called: * At entry, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be empty. * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will contain RAY_TO_REGENERATE * and RAY_UPDATE_BUFFER rays. * At exit, * - QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE rays. * - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with * RAY_TO_REGENERATE, RAY_UPDATE_BUFFER, RAY_HIT_BACKGROUND rays. */ ccl_device void kernel_queue_enqueue(KernelGlobals *kg, ccl_local_param QueueEnqueueLocals *locals) { /* We have only 2 cases (Hit/Not-Hit) */ int lidx = ccl_local_id(1) * ccl_local_size(0) + ccl_local_id(0); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(lidx == 0) { locals->queue_atomics[0] = 0; locals->queue_atomics[1] = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); int queue_number = -1; if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_HIT_BACKGROUND) || IS_STATE(kernel_split_state.ray_state, ray_index, RAY_UPDATE_BUFFER) || IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) { queue_number = QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS; } else if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE) || IS_STATE(kernel_split_state.ray_state, ray_index, RAY_HAS_ONLY_VOLUME) || IS_STATE(kernel_split_state.ray_state, ray_index, RAY_REGENERATED)) { queue_number = QUEUE_ACTIVE_AND_REGENERATED_RAYS; } unsigned int my_lqidx; if(queue_number != -1) { my_lqidx = get_local_queue_index(queue_number, locals->queue_atomics); } ccl_barrier(CCL_LOCAL_MEM_FENCE); if(lidx == 0) { locals->queue_atomics[QUEUE_ACTIVE_AND_REGENERATED_RAYS] = get_global_per_queue_offset(QUEUE_ACTIVE_AND_REGENERATED_RAYS, locals->queue_atomics, kernel_split_params.queue_index); locals->queue_atomics[QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS] = get_global_per_queue_offset(QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, locals->queue_atomics, kernel_split_params.queue_index); } ccl_barrier(CCL_LOCAL_MEM_FENCE); unsigned int my_gqidx; if(queue_number != -1) { my_gqidx = get_global_queue_index(queue_number, kernel_split_params.queue_size, my_lqidx, locals->queue_atomics); kernel_split_state.queue_data[my_gqidx] = ray_index; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_scene_intersect.h000066400000000000000000000050661334742672700257050ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel takes care of scene_intersect function. * * This kernel changes the ray_state of RAY_REGENERATED rays to RAY_ACTIVE. * This kernel processes rays of ray state RAY_ACTIVE * This kernel determines the rays that have hit the background and changes * their ray state to RAY_HIT_BACKGROUND. */ ccl_device void kernel_scene_intersect(KernelGlobals *kg) { /* Fetch use_queues_flag */ char local_use_queues_flag = *kernel_split_params.use_queues_flag; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(local_use_queues_flag) { ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 0); if(ray_index == QUEUE_EMPTY_SLOT) { return; } } /* All regenerated rays become active here */ if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_REGENERATED)) { #ifdef __BRANCHED_PATH__ if(kernel_split_state.branched_state[ray_index].waiting_on_shared_samples) { kernel_split_path_end(kg, ray_index); } else #endif /* __BRANCHED_PATH__ */ { ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE); } } if(!IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) { return; } ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; Ray ray = kernel_split_state.ray[ray_index]; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; Intersection isect; bool hit = kernel_path_scene_intersect(kg, state, &ray, &isect, L); kernel_split_state.isect[ray_index] = isect; if(!hit) { /* Change the state of rays that hit the background; * These rays undergo special processing in the * background_bufferUpdate kernel. */ ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_HIT_BACKGROUND); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_shader_eval.h000066400000000000000000000040041334742672700247740ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel evaluates ShaderData structure from the values computed * by the previous kernels. */ ccl_device void kernel_shader_eval(KernelGlobals *kg) { int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); /* Sorting on cuda split is not implemented */ #ifdef __KERNEL_CUDA__ int queue_index = kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS]; #else int queue_index = kernel_split_params.queue_index[QUEUE_SHADER_SORTED_RAYS]; #endif if(ray_index >= queue_index) { return; } ray_index = get_ray_index(kg, ray_index, #ifdef __KERNEL_CUDA__ QUEUE_ACTIVE_AND_REGENERATED_RAYS, #else QUEUE_SHADER_SORTED_RAYS, #endif kernel_split_state.queue_data, kernel_split_params.queue_size, 0); if(ray_index == QUEUE_EMPTY_SLOT) { return; } ccl_global char *ray_state = kernel_split_state.ray_state; if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; shader_eval_surface(kg, kernel_split_sd(sd, ray_index), state, state->flag); #ifdef __BRANCHED_PATH__ if(kernel_data.integrator.branched) { shader_merge_closures(kernel_split_sd(sd, ray_index)); } else #endif { shader_prepare_closures(kernel_split_sd(sd, ray_index), state); } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_shader_setup.h000066400000000000000000000052711334742672700252140ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* This kernel sets up the ShaderData structure from the values computed * by the previous kernels. * * It also identifies the rays of state RAY_TO_REGENERATE and enqueues them * in QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */ ccl_device void kernel_shader_setup(KernelGlobals *kg, ccl_local_param unsigned int *local_queue_atomics) { /* Enqeueue RAY_TO_REGENERATE rays into QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */ if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { *local_queue_atomics = 0; } ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); int queue_index = kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS]; if(ray_index >= queue_index) { return; } ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 0); if(ray_index == QUEUE_EMPTY_SLOT) { return; } char enqueue_flag = (IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) ? 1 : 0; enqueue_ray_index_local(ray_index, QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, enqueue_flag, kernel_split_params.queue_size, local_queue_atomics, kernel_split_state.queue_data, kernel_split_params.queue_index); /* Continue on with shader evaluation. */ if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) { Intersection isect = kernel_split_state.isect[ray_index]; Ray ray = kernel_split_state.ray[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); shader_setup_from_ray(kg, sd, &isect, &ray); #ifdef __VOLUME__ if(sd->flag & SD_HAS_ONLY_VOLUME) { ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_HAS_ONLY_VOLUME); } #endif } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_shader_sort.h000066400000000000000000000064021334742672700250400ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void kernel_shader_sort(KernelGlobals *kg, ccl_local_param ShaderSortLocals *locals) { #ifndef __KERNEL_CUDA__ int tid = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); uint qsize = kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS]; if(tid == 0) { kernel_split_params.queue_index[QUEUE_SHADER_SORTED_RAYS] = qsize; } uint offset = (tid/SHADER_SORT_LOCAL_SIZE)*SHADER_SORT_BLOCK_SIZE; if(offset >= qsize) { return; } int lid = ccl_local_id(1) * ccl_local_size(0) + ccl_local_id(0); uint input = QUEUE_ACTIVE_AND_REGENERATED_RAYS * (kernel_split_params.queue_size); uint output = QUEUE_SHADER_SORTED_RAYS * (kernel_split_params.queue_size); ccl_local uint *local_value = &locals->local_value[0]; ccl_local ushort *local_index = &locals->local_index[0]; /* copy to local memory */ for(uint i = 0; i < SHADER_SORT_BLOCK_SIZE; i += SHADER_SORT_LOCAL_SIZE) { uint idx = offset + i + lid; uint add = input + idx; uint value = (~0); if(idx < qsize) { int ray_index = kernel_split_state.queue_data[add]; bool valid = (ray_index != QUEUE_EMPTY_SLOT) && IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE); if(valid) { value = kernel_split_sd(sd, ray_index)->shader & SHADER_MASK; } } local_value[i + lid] = value; local_index[i + lid] = i + lid; } ccl_barrier(CCL_LOCAL_MEM_FENCE); /* skip sorting for cpu split kernel */ # ifdef __KERNEL_OPENCL__ /* bitonic sort */ for(uint length = 1; length < SHADER_SORT_BLOCK_SIZE; length <<= 1) { for(uint inc = length; inc > 0; inc >>= 1) { for(uint ii = 0; ii < SHADER_SORT_BLOCK_SIZE; ii += SHADER_SORT_LOCAL_SIZE) { uint i = lid + ii; bool direction = ((i & (length << 1)) != 0); uint j = i ^ inc; ushort ioff = local_index[i]; ushort joff = local_index[j]; uint iKey = local_value[ioff]; uint jKey = local_value[joff]; bool smaller = (jKey < iKey) || (jKey == iKey && j < i); bool swap = smaller ^ (j < i) ^ direction; ccl_barrier(CCL_LOCAL_MEM_FENCE); local_index[i] = (swap) ? joff : ioff; local_index[j] = (swap) ? ioff : joff; ccl_barrier(CCL_LOCAL_MEM_FENCE); } } } # endif /* __KERNEL_OPENCL__ */ /* copy to destination */ for(uint i = 0; i < SHADER_SORT_BLOCK_SIZE; i += SHADER_SORT_LOCAL_SIZE) { uint idx = offset + i + lid; uint lidx = local_index[i + lid]; uint outi = output + idx; uint ini = input + offset + lidx; uint value = local_value[lidx]; if(idx < qsize) { kernel_split_state.queue_data[outi] = (value == (~0)) ? QUEUE_EMPTY_SLOT : kernel_split_state.queue_data[ini]; } } #endif /* __KERNEL_CUDA__ */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_shadow_blocked_ao.h000066400000000000000000000036251334742672700261560ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Shadow ray cast for AO. */ ccl_device void kernel_shadow_blocked_ao(KernelGlobals *kg) { unsigned int ao_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_AO_RAYS]; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = QUEUE_EMPTY_SLOT; int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(thread_index < ao_queue_length) { ray_index = get_ray_index(kg, thread_index, QUEUE_SHADOW_RAY_CAST_AO_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); } if(ray_index == QUEUE_EMPTY_SLOT) { return; } ShaderData *sd = kernel_split_sd(sd, ray_index); ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; float3 throughput = kernel_split_state.throughput[ray_index]; #ifdef __BRANCHED_PATH__ if(!kernel_data.integrator.branched || IS_FLAG(kernel_split_state.ray_state, ray_index, RAY_BRANCHED_INDIRECT)) { #endif kernel_path_ao(kg, sd, emission_sd, L, state, throughput, shader_bsdf_alpha(kg, sd)); #ifdef __BRANCHED_PATH__ } else { kernel_branched_path_ao(kg, sd, emission_sd, L, state, throughput); } #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_shadow_blocked_dl.h000066400000000000000000000066501334742672700261570ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Shadow ray cast for direct visible light. */ ccl_device void kernel_shadow_blocked_dl(KernelGlobals *kg) { unsigned int dl_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_DL_RAYS]; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = QUEUE_EMPTY_SLOT; int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(thread_index < dl_queue_length) { ray_index = get_ray_index(kg, thread_index, QUEUE_SHADOW_RAY_CAST_DL_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); } #ifdef __BRANCHED_PATH__ /* TODO(mai): move this somewhere else? */ if(thread_index == 0) { /* Clear QUEUE_INACTIVE_RAYS before next kernel. */ kernel_split_params.queue_index[QUEUE_INACTIVE_RAYS] = 0; } #endif /* __BRANCHED_PATH__ */ if(ray_index == QUEUE_EMPTY_SLOT) return; ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; Ray ray = kernel_split_state.light_ray[ray_index]; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); float3 throughput = kernel_split_state.throughput[ray_index]; BsdfEval L_light = kernel_split_state.bsdf_eval[ray_index]; ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); bool is_lamp = kernel_split_state.is_lamp[ray_index]; # if defined(__BRANCHED_PATH__) || defined(__SHADOW_TRICKS__) bool use_branched = false; int all = 0; if(state->flag & PATH_RAY_SHADOW_CATCHER) { use_branched = true; all = 1; } # if defined(__BRANCHED_PATH__) else if(kernel_data.integrator.branched) { use_branched = true; if(IS_FLAG(kernel_split_state.ray_state, ray_index, RAY_BRANCHED_INDIRECT)) { all = (kernel_data.integrator.sample_all_lights_indirect); } else { all = (kernel_data.integrator.sample_all_lights_direct); } } # endif /* __BRANCHED_PATH__ */ if(use_branched) { kernel_branched_path_surface_connect_light(kg, sd, emission_sd, state, throughput, 1.0f, L, all); } else # endif /* defined(__BRANCHED_PATH__) || defined(__SHADOW_TRICKS__)*/ { /* trace shadow ray */ float3 shadow; if(!shadow_blocked(kg, sd, emission_sd, state, &ray, &shadow)) { /* accumulate */ path_radiance_accum_light(L, state, throughput, &L_light, shadow, 1.0f, is_lamp); } else { path_radiance_accum_total_light(L, state, throughput, &L_light); } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_split_common.h000066400000000000000000000056471334742672700252400ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_SPLIT_H__ #define __KERNEL_SPLIT_H__ #include "kernel/kernel_math.h" #include "kernel/kernel_types.h" #include "kernel/split/kernel_split_data.h" #include "kernel/kernel_globals.h" #ifdef __OSL__ # include "kernel/osl/osl_shader.h" #endif #ifdef __KERNEL_OPENCL__ # include "kernel/kernels/opencl/kernel_opencl_image.h" #endif #ifdef __KERNEL_CUDA__ # include "kernel/kernels/cuda/kernel_cuda_image.h" #endif #ifdef __KERNEL_CPU__ # include "kernel/kernels/cpu/kernel_cpu_image.h" #endif #include "util/util_atomic.h" #include "kernel/kernel_path.h" #ifdef __BRANCHED_PATH__ # include "kernel/kernel_path_branched.h" #endif #include "kernel/kernel_queues.h" #include "kernel/kernel_work_stealing.h" #ifdef __BRANCHED_PATH__ # include "kernel/split/kernel_branched.h" #endif CCL_NAMESPACE_BEGIN ccl_device_inline void kernel_split_path_end(KernelGlobals *kg, int ray_index) { ccl_global char *ray_state = kernel_split_state.ray_state; #ifdef __BRANCHED_PATH__ ccl_addr_space SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index]; if(ss_indirect->num_rays) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); } else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) { int orig_ray = kernel_split_state.branched_state[ray_index].original_ray; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; PathRadiance *orig_ray_L = &kernel_split_state.path_radiance[orig_ray]; path_radiance_sum_indirect(L); path_radiance_accum_sample(orig_ray_L, L); atomic_fetch_and_dec_uint32((ccl_global uint*)&kernel_split_state.branched_state[orig_ray].shared_sample_count); ASSIGN_RAY_STATE(ray_state, ray_index, RAY_INACTIVE); } else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_LIGHT_INDIRECT)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_LIGHT_INDIRECT_NEXT_ITER); } else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_VOLUME_INDIRECT)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_VOLUME_INDIRECT_NEXT_ITER); } else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_SUBSURFACE_INDIRECT)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_SUBSURFACE_INDIRECT_NEXT_ITER); } else { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); } #else ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); #endif } CCL_NAMESPACE_END #endif /* __KERNEL_SPLIT_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_split_data.h000066400000000000000000000045271334742672700246550ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_SPLIT_DATA_H__ #define __KERNEL_SPLIT_DATA_H__ #include "kernel/split/kernel_split_data_types.h" #include "kernel/kernel_globals.h" CCL_NAMESPACE_BEGIN ccl_device_inline uint64_t split_data_buffer_size(KernelGlobals *kg, size_t num_elements) { (void)kg; /* Unused on CPU. */ uint64_t size = 0; #define SPLIT_DATA_ENTRY(type, name, num) + align_up(num_elements * num * sizeof(type), 16) size = size SPLIT_DATA_ENTRIES; #undef SPLIT_DATA_ENTRY uint64_t closure_size = sizeof(ShaderClosure) * (kernel_data.integrator.max_closures-1); #ifdef __BRANCHED_PATH__ size += align_up(num_elements * (sizeof(ShaderData) + closure_size), 16); #endif size += align_up(num_elements * (sizeof(ShaderData) + closure_size), 16); return size; } ccl_device_inline void split_data_init(KernelGlobals *kg, ccl_global SplitData *split_data, size_t num_elements, ccl_global void *data, ccl_global char *ray_state) { (void)kg; /* Unused on CPU. */ ccl_global char *p = (ccl_global char*)data; #define SPLIT_DATA_ENTRY(type, name, num) \ split_data->name = (type*)p; p += align_up(num_elements * num * sizeof(type), 16); SPLIT_DATA_ENTRIES; #undef SPLIT_DATA_ENTRY uint64_t closure_size = sizeof(ShaderClosure) * (kernel_data.integrator.max_closures-1); #ifdef __BRANCHED_PATH__ split_data->_branched_state_sd = (ShaderData*)p; p += align_up(num_elements * (sizeof(ShaderData) + closure_size), 16); #endif split_data->_sd = (ShaderData*)p; p += align_up(num_elements * (sizeof(ShaderData) + closure_size), 16); split_data->ray_state = ray_state; } CCL_NAMESPACE_END #endif /* __KERNEL_SPLIT_DATA_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_split_data_types.h000066400000000000000000000131531334742672700260740ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __KERNEL_SPLIT_DATA_TYPES_H__ #define __KERNEL_SPLIT_DATA_TYPES_H__ CCL_NAMESPACE_BEGIN /* parameters used by the split kernels, we use a single struct to avoid passing these to each kernel */ typedef struct SplitParams { WorkTile tile; uint total_work_size; ccl_global unsigned int *work_pools; ccl_global int *queue_index; int queue_size; ccl_global char *use_queues_flag; /* Place for storing sd->flag. AMD GPU OpenCL compiler workaround */ int dummy_sd_flag; } SplitParams; /* Global memory variables [porting]; These memory is used for * co-operation between different kernels; Data written by one * kernel will be available to another kernel via this global * memory. */ /* SPLIT_DATA_ENTRY(type, name, num) */ #ifdef __BRANCHED_PATH__ typedef ccl_global struct SplitBranchedState { /* various state that must be kept and restored after an indirect loop */ PathState path_state; float3 throughput; Ray ray; Intersection isect; char ray_state; /* indirect loop state */ int next_closure; int next_sample; #ifdef __SUBSURFACE__ int ss_next_closure; int ss_next_sample; int next_hit; int num_hits; uint lcg_state; LocalIntersection ss_isect; #endif /*__SUBSURFACE__ */ int shared_sample_count; /* number of branched samples shared with other threads */ int original_ray; /* index of original ray when sharing branched samples */ bool waiting_on_shared_samples; } SplitBranchedState; #define SPLIT_DATA_BRANCHED_ENTRIES \ SPLIT_DATA_ENTRY( SplitBranchedState, branched_state, 1) \ SPLIT_DATA_ENTRY(ShaderData, _branched_state_sd, 0) #else #define SPLIT_DATA_BRANCHED_ENTRIES #endif /* __BRANCHED_PATH__ */ #ifdef __SUBSURFACE__ # define SPLIT_DATA_SUBSURFACE_ENTRIES \ SPLIT_DATA_ENTRY(ccl_global SubsurfaceIndirectRays, ss_rays, 1) #else # define SPLIT_DATA_SUBSURFACE_ENTRIES #endif /* __SUBSURFACE__ */ #ifdef __VOLUME__ # define SPLIT_DATA_VOLUME_ENTRIES \ SPLIT_DATA_ENTRY(ccl_global PathState, state_shadow, 1) #else # define SPLIT_DATA_VOLUME_ENTRIES #endif /* __VOLUME__ */ #define SPLIT_DATA_ENTRIES \ SPLIT_DATA_ENTRY(ccl_global float3, throughput, 1) \ SPLIT_DATA_ENTRY(PathRadiance, path_radiance, 1) \ SPLIT_DATA_ENTRY(ccl_global Ray, ray, 1) \ SPLIT_DATA_ENTRY(ccl_global PathState, path_state, 1) \ SPLIT_DATA_ENTRY(ccl_global Intersection, isect, 1) \ SPLIT_DATA_ENTRY(ccl_global BsdfEval, bsdf_eval, 1) \ SPLIT_DATA_ENTRY(ccl_global int, is_lamp, 1) \ SPLIT_DATA_ENTRY(ccl_global Ray, light_ray, 1) \ SPLIT_DATA_ENTRY(ccl_global int, queue_data, (NUM_QUEUES*2)) /* TODO(mai): this is too large? */ \ SPLIT_DATA_ENTRY(ccl_global uint, buffer_offset, 1) \ SPLIT_DATA_ENTRY(ShaderDataTinyStorage, sd_DL_shadow, 1) \ SPLIT_DATA_SUBSURFACE_ENTRIES \ SPLIT_DATA_VOLUME_ENTRIES \ SPLIT_DATA_BRANCHED_ENTRIES \ SPLIT_DATA_ENTRY(ShaderData, _sd, 0) /* entries to be copied to inactive rays when sharing branched samples (TODO: which are actually needed?) */ #define SPLIT_DATA_ENTRIES_BRANCHED_SHARED \ SPLIT_DATA_ENTRY(ccl_global float3, throughput, 1) \ SPLIT_DATA_ENTRY(PathRadiance, path_radiance, 1) \ SPLIT_DATA_ENTRY(ccl_global Ray, ray, 1) \ SPLIT_DATA_ENTRY(ccl_global PathState, path_state, 1) \ SPLIT_DATA_ENTRY(ccl_global Intersection, isect, 1) \ SPLIT_DATA_ENTRY(ccl_global BsdfEval, bsdf_eval, 1) \ SPLIT_DATA_ENTRY(ccl_global int, is_lamp, 1) \ SPLIT_DATA_ENTRY(ccl_global Ray, light_ray, 1) \ SPLIT_DATA_ENTRY(ShaderDataTinyStorage, sd_DL_shadow, 1) \ SPLIT_DATA_SUBSURFACE_ENTRIES \ SPLIT_DATA_VOLUME_ENTRIES \ SPLIT_DATA_BRANCHED_ENTRIES \ SPLIT_DATA_ENTRY(ShaderData, _sd, 0) /* struct that holds pointers to data in the shared state buffer */ typedef struct SplitData { #define SPLIT_DATA_ENTRY(type, name, num) type *name; SPLIT_DATA_ENTRIES #undef SPLIT_DATA_ENTRY /* this is actually in a separate buffer from the rest of the split state data (so it can be read back from * the host easily) but is still used the same as the other data so we have it here in this struct as well */ ccl_global char *ray_state; } SplitData; #ifndef __KERNEL_CUDA__ # define kernel_split_state (kg->split_data) # define kernel_split_params (kg->split_param_data) #else __device__ SplitData __split_data; # define kernel_split_state (__split_data) __device__ SplitParams __split_param_data; # define kernel_split_params (__split_param_data) #endif /* __KERNEL_CUDA__ */ #define kernel_split_sd(sd, ray_index) ((ShaderData*) \ ( \ ((ccl_global char*)kernel_split_state._##sd) + \ (sizeof(ShaderData) + sizeof(ShaderClosure)*(kernel_data.integrator.max_closures-1)) * (ray_index) \ )) /* Local storage for queue_enqueue kernel. */ typedef struct QueueEnqueueLocals { uint queue_atomics[2]; } QueueEnqueueLocals; /* Local storage for holdout_emission_blurring_pathtermination_ao kernel. */ typedef struct BackgroundAOLocals { uint queue_atomics_bg; uint queue_atomics_ao; } BackgroundAOLocals; typedef struct ShaderSortLocals { uint local_value[SHADER_SORT_BLOCK_SIZE]; ushort local_index[SHADER_SORT_BLOCK_SIZE]; } ShaderSortLocals; CCL_NAMESPACE_END #endif /* __KERNEL_SPLIT_DATA_TYPES_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/split/kernel_subsurface_scatter.h000066400000000000000000000254731334742672700264230ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN #if defined(__BRANCHED_PATH__) && defined(__SUBSURFACE__) ccl_device_inline void kernel_split_branched_path_subsurface_indirect_light_init(KernelGlobals *kg, int ray_index) { kernel_split_branched_path_indirect_loop_init(kg, ray_index); SplitBranchedState *branched_state = &kernel_split_state.branched_state[ray_index]; branched_state->ss_next_closure = 0; branched_state->ss_next_sample = 0; branched_state->num_hits = 0; branched_state->next_hit = 0; ADD_RAY_FLAG(kernel_split_state.ray_state, ray_index, RAY_BRANCHED_SUBSURFACE_INDIRECT); } ccl_device_noinline bool kernel_split_branched_path_subsurface_indirect_light_iter(KernelGlobals *kg, int ray_index) { SplitBranchedState *branched_state = &kernel_split_state.branched_state[ray_index]; ShaderData *sd = kernel_split_sd(branched_state_sd, ray_index); PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); for(int i = branched_state->ss_next_closure; i < sd->num_closure; i++) { ShaderClosure *sc = &sd->closure[i]; if(!CLOSURE_IS_BSSRDF(sc->type)) continue; /* set up random number generator */ if(branched_state->ss_next_sample == 0 && branched_state->next_hit == 0 && branched_state->next_closure == 0 && branched_state->next_sample == 0) { branched_state->lcg_state = lcg_state_init_addrspace(&branched_state->path_state, 0x68bc21eb); } int num_samples = kernel_data.integrator.subsurface_samples * 3; float num_samples_inv = 1.0f/num_samples; uint bssrdf_rng_hash = cmj_hash(branched_state->path_state.rng_hash, i); /* do subsurface scatter step with copy of shader data, this will * replace the BSSRDF with a diffuse BSDF closure */ for(int j = branched_state->ss_next_sample; j < num_samples; j++) { ccl_global PathState *hit_state = &kernel_split_state.path_state[ray_index]; *hit_state = branched_state->path_state; hit_state->rng_hash = bssrdf_rng_hash; path_state_branch(hit_state, j, num_samples); ccl_global LocalIntersection *ss_isect = &branched_state->ss_isect; float bssrdf_u, bssrdf_v; path_branched_rng_2D(kg, bssrdf_rng_hash, hit_state, j, num_samples, PRNG_BSDF_U, &bssrdf_u, &bssrdf_v); /* intersection is expensive so avoid doing multiple times for the same input */ if(branched_state->next_hit == 0 && branched_state->next_closure == 0 && branched_state->next_sample == 0) { uint lcg_state = branched_state->lcg_state; LocalIntersection ss_isect_private; branched_state->num_hits = subsurface_scatter_multi_intersect(kg, &ss_isect_private, sd, hit_state, sc, &lcg_state, bssrdf_u, bssrdf_v, true); branched_state->lcg_state = lcg_state; *ss_isect = ss_isect_private; } hit_state->rng_offset += PRNG_BOUNCE_NUM; #ifdef __VOLUME__ Ray volume_ray = branched_state->ray; bool need_update_volume_stack = kernel_data.integrator.use_volumes && sd->object_flag & SD_OBJECT_INTERSECTS_VOLUME; #endif /* __VOLUME__ */ /* compute lighting with the BSDF closure */ for(int hit = branched_state->next_hit; hit < branched_state->num_hits; hit++) { ShaderData *bssrdf_sd = kernel_split_sd(sd, ray_index); *bssrdf_sd = *sd; /* note: copy happens each iteration of inner loop, this is * important as the indirect path will write into bssrdf_sd */ LocalIntersection ss_isect_private = *ss_isect; subsurface_scatter_multi_setup(kg, &ss_isect_private, hit, bssrdf_sd, hit_state, sc); *ss_isect = ss_isect_private; #ifdef __VOLUME__ if(need_update_volume_stack) { /* Setup ray from previous surface point to the new one. */ float3 P = ray_offset(bssrdf_sd->P, -bssrdf_sd->Ng); volume_ray.D = normalize_len(P - volume_ray.P, &volume_ray.t); for(int k = 0; k < VOLUME_STACK_SIZE; k++) { hit_state->volume_stack[k] = branched_state->path_state.volume_stack[k]; } kernel_volume_stack_update_for_subsurface(kg, emission_sd, &volume_ray, hit_state->volume_stack); } #endif /* __VOLUME__ */ #ifdef __EMISSION__ if(branched_state->next_closure == 0 && branched_state->next_sample == 0) { /* direct light */ if(kernel_data.integrator.use_direct_light) { int all = (kernel_data.integrator.sample_all_lights_direct) || (hit_state->flag & PATH_RAY_SHADOW_CATCHER); kernel_branched_path_surface_connect_light(kg, bssrdf_sd, emission_sd, hit_state, branched_state->throughput, num_samples_inv, L, all); } } #endif /* __EMISSION__ */ /* indirect light */ if(kernel_split_branched_path_surface_indirect_light_iter(kg, ray_index, num_samples_inv, bssrdf_sd, false, false)) { branched_state->ss_next_closure = i; branched_state->ss_next_sample = j; branched_state->next_hit = hit; return true; } branched_state->next_closure = 0; } branched_state->next_hit = 0; } branched_state->ss_next_sample = 0; } branched_state->ss_next_closure = sd->num_closure; branched_state->waiting_on_shared_samples = (branched_state->shared_sample_count > 0); if(branched_state->waiting_on_shared_samples) { return true; } kernel_split_branched_path_indirect_loop_end(kg, ray_index); return false; } #endif /* __BRANCHED_PATH__ && __SUBSURFACE__ */ ccl_device void kernel_subsurface_scatter(KernelGlobals *kg) { int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); if(thread_index == 0) { /* We will empty both queues in this kernel. */ kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS] = 0; kernel_split_params.queue_index[QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS] = 0; } int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); ray_index = get_ray_index(kg, ray_index, QUEUE_ACTIVE_AND_REGENERATED_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); get_ray_index(kg, thread_index, QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); #ifdef __SUBSURFACE__ ccl_global char *ray_state = kernel_split_state.ray_state; if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index]; ccl_global SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index]; ShaderData *sd = kernel_split_sd(sd, ray_index); ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); if(sd->flag & SD_BSSRDF) { #ifdef __BRANCHED_PATH__ if(!kernel_data.integrator.branched || IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)) { #endif if(kernel_path_subsurface_scatter(kg, sd, emission_sd, L, state, ray, throughput, ss_indirect)) { kernel_split_path_end(kg, ray_index); } #ifdef __BRANCHED_PATH__ } else { kernel_split_branched_path_subsurface_indirect_light_init(kg, ray_index); if(kernel_split_branched_path_subsurface_indirect_light_iter(kg, ray_index)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } } #endif } } # ifdef __BRANCHED_PATH__ if(ccl_global_id(0) == 0 && ccl_global_id(1) == 0) { kernel_split_params.queue_index[QUEUE_SUBSURFACE_INDIRECT_ITER] = 0; } /* iter loop */ ray_index = get_ray_index(kg, ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0), QUEUE_SUBSURFACE_INDIRECT_ITER, kernel_split_state.queue_data, kernel_split_params.queue_size, 1); if(IS_STATE(ray_state, ray_index, RAY_SUBSURFACE_INDIRECT_NEXT_ITER)) { /* for render passes, sum and reset indirect light pass variables * for the next samples */ path_radiance_sum_indirect(&kernel_split_state.path_radiance[ray_index]); path_radiance_reset_indirect(&kernel_split_state.path_radiance[ray_index]); if(kernel_split_branched_path_subsurface_indirect_light_iter(kg, ray_index)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_REGENERATED); } } # endif /* __BRANCHED_PATH__ */ #endif /* __SUBSURFACE__ */ } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/000077500000000000000000000000001334742672700204625ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm.h000066400000000000000000000352641334742672700214520ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SVM_H__ #define __SVM_H__ /* Shader Virtual Machine * * A shader is a list of nodes to be executed. These are simply read one after * the other and executed, using an node counter. Each node and it's associated * data is encoded as one or more uint4's in a 1D texture. If the data is larger * than an uint4, the node can increase the node counter to compensate for this. * Floats are encoded as int and then converted to float again. * * Nodes write their output into a stack. All stack data in the stack is * floats, since it's all factors, colors and vectors. The stack will be stored * in local memory on the GPU, as it would take too many register and indexes in * ways not known at compile time. This seems the only solution even though it * may be slow, with two positive factors. If the same shader is being executed, * memory access will be coalesced and cached. * * The result of shader execution will be a single closure. This means the * closure type, associated label, data and weight. Sampling from multiple * closures is supported through the mix closure node, the logic for that is * mostly taken care of in the SVM compiler. */ #include "kernel/svm/svm_types.h" CCL_NAMESPACE_BEGIN /* Stack */ ccl_device_inline float3 stack_load_float3(float *stack, uint a) { kernel_assert(a+2 < SVM_STACK_SIZE); return make_float3(stack[a+0], stack[a+1], stack[a+2]); } ccl_device_inline void stack_store_float3(float *stack, uint a, float3 f) { kernel_assert(a+2 < SVM_STACK_SIZE); stack[a+0] = f.x; stack[a+1] = f.y; stack[a+2] = f.z; } ccl_device_inline float stack_load_float(float *stack, uint a) { kernel_assert(a < SVM_STACK_SIZE); return stack[a]; } ccl_device_inline float stack_load_float_default(float *stack, uint a, uint value) { return (a == (uint)SVM_STACK_INVALID)? __uint_as_float(value): stack_load_float(stack, a); } ccl_device_inline void stack_store_float(float *stack, uint a, float f) { kernel_assert(a < SVM_STACK_SIZE); stack[a] = f; } ccl_device_inline int stack_load_int(float *stack, uint a) { kernel_assert(a < SVM_STACK_SIZE); return __float_as_int(stack[a]); } ccl_device_inline int stack_load_int_default(float *stack, uint a, uint value) { return (a == (uint)SVM_STACK_INVALID)? (int)value: stack_load_int(stack, a); } ccl_device_inline void stack_store_int(float *stack, uint a, int i) { kernel_assert(a < SVM_STACK_SIZE); stack[a] = __int_as_float(i); } ccl_device_inline bool stack_valid(uint a) { return a != (uint)SVM_STACK_INVALID; } /* Reading Nodes */ ccl_device_inline uint4 read_node(KernelGlobals *kg, int *offset) { uint4 node = kernel_tex_fetch(__svm_nodes, *offset); (*offset)++; return node; } ccl_device_inline float4 read_node_float(KernelGlobals *kg, int *offset) { uint4 node = kernel_tex_fetch(__svm_nodes, *offset); float4 f = make_float4(__uint_as_float(node.x), __uint_as_float(node.y), __uint_as_float(node.z), __uint_as_float(node.w)); (*offset)++; return f; } ccl_device_inline float4 fetch_node_float(KernelGlobals *kg, int offset) { uint4 node = kernel_tex_fetch(__svm_nodes, offset); return make_float4(__uint_as_float(node.x), __uint_as_float(node.y), __uint_as_float(node.z), __uint_as_float(node.w)); } ccl_device_inline void decode_node_uchar4(uint i, uint *x, uint *y, uint *z, uint *w) { if(x) *x = (i & 0xFF); if(y) *y = ((i >> 8) & 0xFF); if(z) *z = ((i >> 16) & 0xFF); if(w) *w = ((i >> 24) & 0xFF); } CCL_NAMESPACE_END /* Nodes */ #include "kernel/svm/svm_noise.h" #include "svm_texture.h" #include "kernel/svm/svm_color_util.h" #include "kernel/svm/svm_math_util.h" #include "kernel/svm/svm_attribute.h" #include "kernel/svm/svm_gradient.h" #include "kernel/svm/svm_blackbody.h" #include "kernel/svm/svm_closure.h" #include "kernel/svm/svm_noisetex.h" #include "kernel/svm/svm_convert.h" #include "kernel/svm/svm_displace.h" #include "kernel/svm/svm_fresnel.h" #include "kernel/svm/svm_wireframe.h" #include "kernel/svm/svm_wavelength.h" #include "kernel/svm/svm_camera.h" #include "kernel/svm/svm_geometry.h" #include "kernel/svm/svm_hsv.h" #include "kernel/svm/svm_image.h" #include "kernel/svm/svm_gamma.h" #include "kernel/svm/svm_brightness.h" #include "kernel/svm/svm_invert.h" #include "kernel/svm/svm_light_path.h" #include "kernel/svm/svm_magic.h" #include "kernel/svm/svm_mapping.h" #include "kernel/svm/svm_normal.h" #include "kernel/svm/svm_wave.h" #include "kernel/svm/svm_math.h" #include "kernel/svm/svm_mix.h" #include "kernel/svm/svm_ramp.h" #include "kernel/svm/svm_sepcomb_hsv.h" #include "kernel/svm/svm_sepcomb_vector.h" #include "kernel/svm/svm_musgrave.h" #include "kernel/svm/svm_sky.h" #include "kernel/svm/svm_tex_coord.h" #include "kernel/svm/svm_value.h" #include "kernel/svm/svm_voronoi.h" #include "kernel/svm/svm_checker.h" #include "kernel/svm/svm_brick.h" #include "kernel/svm/svm_vector_transform.h" #include "kernel/svm/svm_voxel.h" #include "kernel/svm/svm_bump.h" #ifdef __SHADER_RAYTRACE__ # include "kernel/svm/svm_bevel.h" #endif CCL_NAMESPACE_BEGIN #define NODES_GROUP(group) ((group) <= __NODES_MAX_GROUP__) #define NODES_FEATURE(feature) ((__NODES_FEATURES__ & (feature)) != 0) /* Main Interpreter Loop */ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, ShaderType type, int path_flag) { float stack[SVM_STACK_SIZE]; int offset = sd->shader & SHADER_MASK; while(1) { uint4 node = read_node(kg, &offset); switch(node.x) { #if NODES_GROUP(NODE_GROUP_LEVEL_0) case NODE_SHADER_JUMP: { if(type == SHADER_TYPE_SURFACE) offset = node.y; else if(type == SHADER_TYPE_VOLUME) offset = node.z; else if(type == SHADER_TYPE_DISPLACEMENT) offset = node.w; else return; break; } case NODE_CLOSURE_BSDF: svm_node_closure_bsdf(kg, sd, stack, node, type, path_flag, &offset); break; case NODE_CLOSURE_EMISSION: svm_node_closure_emission(sd, stack, node); break; case NODE_CLOSURE_BACKGROUND: svm_node_closure_background(sd, stack, node); break; case NODE_CLOSURE_SET_WEIGHT: svm_node_closure_set_weight(sd, node.y, node.z, node.w); break; case NODE_CLOSURE_WEIGHT: svm_node_closure_weight(sd, stack, node.y); break; case NODE_EMISSION_WEIGHT: svm_node_emission_weight(kg, sd, stack, node); break; case NODE_MIX_CLOSURE: svm_node_mix_closure(sd, stack, node); break; case NODE_JUMP_IF_ZERO: if(stack_load_float(stack, node.z) == 0.0f) offset += node.y; break; case NODE_JUMP_IF_ONE: if(stack_load_float(stack, node.z) == 1.0f) offset += node.y; break; case NODE_GEOMETRY: svm_node_geometry(kg, sd, stack, node.y, node.z); break; case NODE_CONVERT: svm_node_convert(sd, stack, node.y, node.z, node.w); break; case NODE_TEX_COORD: svm_node_tex_coord(kg, sd, path_flag, stack, node, &offset); break; case NODE_VALUE_F: svm_node_value_f(kg, sd, stack, node.y, node.z); break; case NODE_VALUE_V: svm_node_value_v(kg, sd, stack, node.y, &offset); break; case NODE_ATTR: svm_node_attr(kg, sd, stack, node); break; # if NODES_FEATURE(NODE_FEATURE_BUMP) case NODE_GEOMETRY_BUMP_DX: svm_node_geometry_bump_dx(kg, sd, stack, node.y, node.z); break; case NODE_GEOMETRY_BUMP_DY: svm_node_geometry_bump_dy(kg, sd, stack, node.y, node.z); break; case NODE_SET_DISPLACEMENT: svm_node_set_displacement(kg, sd, stack, node.y); break; case NODE_DISPLACEMENT: svm_node_displacement(kg, sd, stack, node); break; case NODE_VECTOR_DISPLACEMENT: svm_node_vector_displacement(kg, sd, stack, node, &offset); break; # endif /* NODES_FEATURE(NODE_FEATURE_BUMP) */ # ifdef __TEXTURES__ case NODE_TEX_IMAGE: svm_node_tex_image(kg, sd, stack, node); break; case NODE_TEX_IMAGE_BOX: svm_node_tex_image_box(kg, sd, stack, node); break; case NODE_TEX_NOISE: svm_node_tex_noise(kg, sd, stack, node, &offset); break; # endif /* __TEXTURES__ */ # ifdef __EXTRA_NODES__ # if NODES_FEATURE(NODE_FEATURE_BUMP) case NODE_SET_BUMP: svm_node_set_bump(kg, sd, stack, node); break; case NODE_ATTR_BUMP_DX: svm_node_attr_bump_dx(kg, sd, stack, node); break; case NODE_ATTR_BUMP_DY: svm_node_attr_bump_dy(kg, sd, stack, node); break; case NODE_TEX_COORD_BUMP_DX: svm_node_tex_coord_bump_dx(kg, sd, path_flag, stack, node, &offset); break; case NODE_TEX_COORD_BUMP_DY: svm_node_tex_coord_bump_dy(kg, sd, path_flag, stack, node, &offset); break; case NODE_CLOSURE_SET_NORMAL: svm_node_set_normal(kg, sd, stack, node.y, node.z); break; # if NODES_FEATURE(NODE_FEATURE_BUMP_STATE) case NODE_ENTER_BUMP_EVAL: svm_node_enter_bump_eval(kg, sd, stack, node.y); break; case NODE_LEAVE_BUMP_EVAL: svm_node_leave_bump_eval(kg, sd, stack, node.y); break; # endif /* NODES_FEATURE(NODE_FEATURE_BUMP_STATE) */ # endif /* NODES_FEATURE(NODE_FEATURE_BUMP) */ case NODE_HSV: svm_node_hsv(kg, sd, stack, node, &offset); break; # endif /* __EXTRA_NODES__ */ #endif /* NODES_GROUP(NODE_GROUP_LEVEL_0) */ #if NODES_GROUP(NODE_GROUP_LEVEL_1) case NODE_CLOSURE_HOLDOUT: svm_node_closure_holdout(sd, stack, node); break; case NODE_CLOSURE_AMBIENT_OCCLUSION: svm_node_closure_ambient_occlusion(sd, stack, node); break; case NODE_FRESNEL: svm_node_fresnel(sd, stack, node.y, node.z, node.w); break; case NODE_LAYER_WEIGHT: svm_node_layer_weight(sd, stack, node); break; # if NODES_FEATURE(NODE_FEATURE_VOLUME) case NODE_CLOSURE_VOLUME: svm_node_closure_volume(kg, sd, stack, node, type); break; case NODE_PRINCIPLED_VOLUME: svm_node_principled_volume(kg, sd, stack, node, type, path_flag, &offset); break; # endif /* NODES_FEATURE(NODE_FEATURE_VOLUME) */ # ifdef __EXTRA_NODES__ case NODE_MATH: svm_node_math(kg, sd, stack, node.y, node.z, node.w, &offset); break; case NODE_VECTOR_MATH: svm_node_vector_math(kg, sd, stack, node.y, node.z, node.w, &offset); break; case NODE_RGB_RAMP: svm_node_rgb_ramp(kg, sd, stack, node, &offset); break; case NODE_GAMMA: svm_node_gamma(sd, stack, node.y, node.z, node.w); break; case NODE_BRIGHTCONTRAST: svm_node_brightness(sd, stack, node.y, node.z, node.w); break; case NODE_LIGHT_PATH: svm_node_light_path(sd, state, stack, node.y, node.z, path_flag); break; case NODE_OBJECT_INFO: svm_node_object_info(kg, sd, stack, node.y, node.z); break; case NODE_PARTICLE_INFO: svm_node_particle_info(kg, sd, stack, node.y, node.z); break; # ifdef __HAIR__ # if NODES_FEATURE(NODE_FEATURE_HAIR) case NODE_HAIR_INFO: svm_node_hair_info(kg, sd, stack, node.y, node.z); break; # endif /* NODES_FEATURE(NODE_FEATURE_HAIR) */ # endif /* __HAIR__ */ # endif /* __EXTRA_NODES__ */ #endif /* NODES_GROUP(NODE_GROUP_LEVEL_1) */ #if NODES_GROUP(NODE_GROUP_LEVEL_2) case NODE_MAPPING: svm_node_mapping(kg, sd, stack, node.y, node.z, &offset); break; case NODE_MIN_MAX: svm_node_min_max(kg, sd, stack, node.y, node.z, &offset); break; case NODE_CAMERA: svm_node_camera(kg, sd, stack, node.y, node.z, node.w); break; # ifdef __TEXTURES__ case NODE_TEX_ENVIRONMENT: svm_node_tex_environment(kg, sd, stack, node); break; case NODE_TEX_SKY: svm_node_tex_sky(kg, sd, stack, node, &offset); break; case NODE_TEX_GRADIENT: svm_node_tex_gradient(sd, stack, node); break; case NODE_TEX_VORONOI: svm_node_tex_voronoi(kg, sd, stack, node, &offset); break; case NODE_TEX_MUSGRAVE: svm_node_tex_musgrave(kg, sd, stack, node, &offset); break; case NODE_TEX_WAVE: svm_node_tex_wave(kg, sd, stack, node, &offset); break; case NODE_TEX_MAGIC: svm_node_tex_magic(kg, sd, stack, node, &offset); break; case NODE_TEX_CHECKER: svm_node_tex_checker(kg, sd, stack, node); break; case NODE_TEX_BRICK: svm_node_tex_brick(kg, sd, stack, node, &offset); break; # endif /* __TEXTURES__ */ # ifdef __EXTRA_NODES__ case NODE_NORMAL: svm_node_normal(kg, sd, stack, node.y, node.z, node.w, &offset); break; case NODE_LIGHT_FALLOFF: svm_node_light_falloff(sd, stack, node); break; # endif /* __EXTRA_NODES__ */ #endif /* NODES_GROUP(NODE_GROUP_LEVEL_2) */ #if NODES_GROUP(NODE_GROUP_LEVEL_3) case NODE_RGB_CURVES: case NODE_VECTOR_CURVES: svm_node_curves(kg, sd, stack, node, &offset); break; case NODE_TANGENT: svm_node_tangent(kg, sd, stack, node); break; case NODE_NORMAL_MAP: svm_node_normal_map(kg, sd, stack, node); break; # ifdef __EXTRA_NODES__ case NODE_INVERT: svm_node_invert(sd, stack, node.y, node.z, node.w); break; case NODE_MIX: svm_node_mix(kg, sd, stack, node.y, node.z, node.w, &offset); break; case NODE_SEPARATE_VECTOR: svm_node_separate_vector(sd, stack, node.y, node.z, node.w); break; case NODE_COMBINE_VECTOR: svm_node_combine_vector(sd, stack, node.y, node.z, node.w); break; case NODE_SEPARATE_HSV: svm_node_separate_hsv(kg, sd, stack, node.y, node.z, node.w, &offset); break; case NODE_COMBINE_HSV: svm_node_combine_hsv(kg, sd, stack, node.y, node.z, node.w, &offset); break; case NODE_VECTOR_TRANSFORM: svm_node_vector_transform(kg, sd, stack, node); break; case NODE_WIREFRAME: svm_node_wireframe(kg, sd, stack, node); break; case NODE_WAVELENGTH: svm_node_wavelength(sd, stack, node.y, node.z); break; case NODE_BLACKBODY: svm_node_blackbody(kg, sd, stack, node.y, node.z); break; # endif /* __EXTRA_NODES__ */ # if NODES_FEATURE(NODE_FEATURE_VOLUME) case NODE_TEX_VOXEL: svm_node_tex_voxel(kg, sd, stack, node, &offset); break; # endif /* NODES_FEATURE(NODE_FEATURE_VOLUME) */ # ifdef __SHADER_RAYTRACE__ case NODE_BEVEL: svm_node_bevel(kg, sd, state, stack, node); break; # endif /* __SHADER_RAYTRACE__ */ #endif /* NODES_GROUP(NODE_GROUP_LEVEL_3) */ case NODE_END: return; default: kernel_assert(!"Unknown node type was passed to the SVM machine"); return; } } } #undef NODES_GROUP #undef NODES_FEATURE CCL_NAMESPACE_END #endif /* __SVM_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_attribute.h000066400000000000000000000102341334742672700235230ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Attribute Node */ ccl_device AttributeDescriptor svm_node_attr_init(KernelGlobals *kg, ShaderData *sd, uint4 node, NodeAttributeType *type, uint *out_offset) { *out_offset = node.z; *type = (NodeAttributeType)node.w; AttributeDescriptor desc; if(sd->object != OBJECT_NONE) { desc = find_attribute(kg, sd, node.y); if(desc.offset == ATTR_STD_NOT_FOUND) { desc = attribute_not_found(); desc.offset = 0; desc.type = (NodeAttributeType)node.w; } } else { /* background */ desc = attribute_not_found(); desc.offset = 0; desc.type = (NodeAttributeType)node.w; } return desc; } ccl_device void svm_node_attr(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { NodeAttributeType type; uint out_offset; AttributeDescriptor desc = svm_node_attr_init(kg, sd, node, &type, &out_offset); /* fetch and store attribute */ if(type == NODE_ATTR_FLOAT) { if(desc.type == NODE_ATTR_FLOAT) { float f = primitive_attribute_float(kg, sd, desc, NULL, NULL); stack_store_float(stack, out_offset, f); } else { float3 f = primitive_attribute_float3(kg, sd, desc, NULL, NULL); stack_store_float(stack, out_offset, average(f)); } } else { if(desc.type == NODE_ATTR_FLOAT3) { float3 f = primitive_attribute_float3(kg, sd, desc, NULL, NULL); stack_store_float3(stack, out_offset, f); } else { float f = primitive_attribute_float(kg, sd, desc, NULL, NULL); stack_store_float3(stack, out_offset, make_float3(f, f, f)); } } } #ifndef __KERNEL_CUDA__ ccl_device #else ccl_device_noinline #endif void svm_node_attr_bump_dx(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { NodeAttributeType type; uint out_offset; AttributeDescriptor desc = svm_node_attr_init(kg, sd, node, &type, &out_offset); /* fetch and store attribute */ if(type == NODE_ATTR_FLOAT) { if(desc.type == NODE_ATTR_FLOAT) { float dx; float f = primitive_attribute_float(kg, sd, desc, &dx, NULL); stack_store_float(stack, out_offset, f+dx); } else { float3 dx; float3 f = primitive_attribute_float3(kg, sd, desc, &dx, NULL); stack_store_float(stack, out_offset, average(f+dx)); } } else { if(desc.type == NODE_ATTR_FLOAT3) { float3 dx; float3 f = primitive_attribute_float3(kg, sd, desc, &dx, NULL); stack_store_float3(stack, out_offset, f+dx); } else { float dx; float f = primitive_attribute_float(kg, sd, desc, &dx, NULL); stack_store_float3(stack, out_offset, make_float3(f+dx, f+dx, f+dx)); } } } #ifndef __KERNEL_CUDA__ ccl_device #else ccl_device_noinline #endif void svm_node_attr_bump_dy(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { NodeAttributeType type; uint out_offset; AttributeDescriptor desc = svm_node_attr_init(kg, sd, node, &type, &out_offset); /* fetch and store attribute */ if(type == NODE_ATTR_FLOAT) { if(desc.type == NODE_ATTR_FLOAT) { float dy; float f = primitive_attribute_float(kg, sd, desc, NULL, &dy); stack_store_float(stack, out_offset, f+dy); } else { float3 dy; float3 f = primitive_attribute_float3(kg, sd, desc, NULL, &dy); stack_store_float(stack, out_offset, average(f+dy)); } } else { if(desc.type == NODE_ATTR_FLOAT3) { float3 dy; float3 f = primitive_attribute_float3(kg, sd, desc, NULL, &dy); stack_store_float3(stack, out_offset, f+dy); } else { float dy; float f = primitive_attribute_float(kg, sd, desc, NULL, &dy); stack_store_float3(stack, out_offset, make_float3(f+dy, f+dy, f+dy)); } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_bevel.h000066400000000000000000000147671334742672700226340ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Bevel shader averaging normals from nearby surfaces. * * Sampling strategy from: BSSRDF Importance Sampling, SIGGRAPH 2013 * http://library.imageworks.com/pdfs/imageworks-library-BSSRDF-sampling.pdf */ ccl_device_noinline float3 svm_bevel( KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, float radius, int num_samples) { /* Early out if no sampling needed. */ if(radius <= 0.0f || num_samples < 1 || sd->object == OBJECT_NONE) { return sd->N; } /* Don't bevel for blurry indirect rays. */ if(state->min_ray_pdf < 8.0f) { return sd->N; } /* Setup for multi intersection. */ LocalIntersection isect; uint lcg_state = lcg_state_init_addrspace(state, 0x64c6a40e); /* Sample normals from surrounding points on surface. */ float3 sum_N = make_float3(0.0f, 0.0f, 0.0f); for(int sample = 0; sample < num_samples; sample++) { float disk_u, disk_v; path_branched_rng_2D(kg, state->rng_hash, state, sample, num_samples, PRNG_BEVEL_U, &disk_u, &disk_v); /* Pick random axis in local frame and point on disk. */ float3 disk_N, disk_T, disk_B; float pick_pdf_N, pick_pdf_T, pick_pdf_B; disk_N = sd->Ng; make_orthonormals(disk_N, &disk_T, &disk_B); float axisu = disk_u; if(axisu < 0.5f) { pick_pdf_N = 0.5f; pick_pdf_T = 0.25f; pick_pdf_B = 0.25f; disk_u *= 2.0f; } else if(axisu < 0.75f) { float3 tmp = disk_N; disk_N = disk_T; disk_T = tmp; pick_pdf_N = 0.25f; pick_pdf_T = 0.5f; pick_pdf_B = 0.25f; disk_u = (disk_u - 0.5f)*4.0f; } else { float3 tmp = disk_N; disk_N = disk_B; disk_B = tmp; pick_pdf_N = 0.25f; pick_pdf_T = 0.25f; pick_pdf_B = 0.5f; disk_u = (disk_u - 0.75f)*4.0f; } /* Sample point on disk. */ float phi = M_2PI_F * disk_u; float disk_r = disk_v; float disk_height; /* Perhaps find something better than Cubic BSSRDF, but happens to work well. */ bssrdf_cubic_sample(radius, 0.0f, disk_r, &disk_r, &disk_height); float3 disk_P = (disk_r*cosf(phi)) * disk_T + (disk_r*sinf(phi)) * disk_B; /* Create ray. */ Ray *ray = &isect.ray; ray->P = sd->P + disk_N*disk_height + disk_P; ray->D = -disk_N; ray->t = 2.0f*disk_height; ray->dP = sd->dP; ray->dD = differential3_zero(); ray->time = sd->time; /* Intersect with the same object. if multiple intersections are found it * will use at most LOCAL_MAX_HITS hits, a random subset of all hits. */ scene_intersect_local(kg, *ray, &isect, sd->object, &lcg_state, LOCAL_MAX_HITS); int num_eval_hits = min(isect.num_hits, LOCAL_MAX_HITS); for(int hit = 0; hit < num_eval_hits; hit++) { /* Quickly retrieve P and Ng without setting up ShaderData. */ float3 hit_P; if(sd->type & PRIMITIVE_TRIANGLE) { hit_P = triangle_refine_local(kg, sd, &isect.hits[hit], ray); } #ifdef __OBJECT_MOTION__ else if(sd->type & PRIMITIVE_MOTION_TRIANGLE) { float3 verts[3]; motion_triangle_vertices( kg, sd->object, kernel_tex_fetch(__prim_index, isect.hits[hit].prim), sd->time, verts); hit_P = motion_triangle_refine_local(kg, sd, &isect.hits[hit], ray, verts); } #endif /* __OBJECT_MOTION__ */ float3 hit_Ng = isect.Ng[hit]; /* Compute smooth normal. */ float3 N = hit_Ng; int prim = kernel_tex_fetch(__prim_index, isect.hits[hit].prim); int shader = kernel_tex_fetch(__tri_shader, prim); if (shader & SHADER_SMOOTH_NORMAL) { float u = isect.hits[hit].u; float v = isect.hits[hit].v; if (sd->type & PRIMITIVE_TRIANGLE) { N = triangle_smooth_normal(kg, N, prim, u, v); } #ifdef __OBJECT_MOTION__ else if(sd->type & PRIMITIVE_MOTION_TRIANGLE) { N = motion_triangle_smooth_normal(kg, N, sd->object, prim, u, v, sd->time); } #endif /* __OBJECT_MOTION__ */ } /* Transform normals to world space. */ if(isect.hits[hit].object != OBJECT_NONE) { object_normal_transform(kg, sd, &N); object_normal_transform(kg, sd, &hit_Ng); } /* Probability densities for local frame axes. */ float pdf_N = pick_pdf_N * fabsf(dot(disk_N, hit_Ng)); float pdf_T = pick_pdf_T * fabsf(dot(disk_T, hit_Ng)); float pdf_B = pick_pdf_B * fabsf(dot(disk_B, hit_Ng)); /* Multiple importance sample between 3 axes, power heuristic * found to be slightly better than balance heuristic. pdf_N * in the MIS weight and denominator cancelled out. */ float w = pdf_N / (sqr(pdf_N) + sqr(pdf_T) + sqr(pdf_B)); if(isect.num_hits > LOCAL_MAX_HITS) { w *= isect.num_hits/(float)LOCAL_MAX_HITS; } /* Real distance to sampled point. */ float r = len(hit_P - sd->P); /* Compute weight. */ float pdf = bssrdf_cubic_pdf(radius, 0.0f, r); float disk_pdf = bssrdf_cubic_pdf(radius, 0.0f, disk_r); w *= pdf / disk_pdf; /* Sum normal and weight. */ sum_N += w * N; } } /* Normalize. */ float3 N = safe_normalize(sum_N); return is_zero(N) ? sd->N : (sd->flag & SD_BACKFACING) ? -N : N; } ccl_device void svm_node_bevel( KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, float *stack, uint4 node) { uint num_samples, radius_offset, normal_offset, out_offset; decode_node_uchar4(node.y, &num_samples, &radius_offset, &normal_offset, &out_offset); float radius = stack_load_float(stack, radius_offset); float3 bevel_N = svm_bevel(kg, sd, state, radius, num_samples); if(stack_valid(normal_offset)) { /* Preserve input normal. */ float3 ref_N = stack_load_float3(stack, normal_offset); bevel_N = normalize(ref_N + (bevel_N - sd->N));; } stack_store_float3(stack, out_offset, bevel_N); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_blackbody.h000066400000000000000000000040631334742672700234550ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2013, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ CCL_NAMESPACE_BEGIN /* Blackbody Node */ ccl_device void svm_node_blackbody(KernelGlobals *kg, ShaderData *sd, float *stack, uint temperature_offset, uint col_offset) { /* Input */ float temperature = stack_load_float(stack, temperature_offset); float3 color_rgb = svm_math_blackbody_color(temperature); stack_store_float3(stack, col_offset, color_rgb); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_brick.h000066400000000000000000000101631334742672700226130ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Brick */ ccl_device_noinline float brick_noise(uint n) /* fast integer noise */ { uint nn; n = (n + 1013) & 0x7fffffff; n = (n >> 13) ^ n; nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff; return 0.5f * ((float)nn / 1073741824.0f); } ccl_device_noinline float2 svm_brick(float3 p, float mortar_size, float mortar_smooth, float bias, float brick_width, float row_height, float offset_amount, int offset_frequency, float squash_amount, int squash_frequency) { int bricknum, rownum; float offset = 0.0f; float x, y; rownum = floor_to_int(p.y / row_height); if(offset_frequency && squash_frequency) { brick_width *= (rownum % squash_frequency) ? 1.0f : squash_amount; /* squash */ offset = (rownum % offset_frequency) ? 0.0f : (brick_width*offset_amount); /* offset */ } bricknum = floor_to_int((p.x+offset) / brick_width); x = (p.x+offset) - brick_width*bricknum; y = p.y - row_height*rownum; float tint = saturate((brick_noise((rownum << 16) + (bricknum & 0xFFFF)) + bias)); float min_dist = min(min(x, y), min(brick_width - x, row_height - y)); float mortar; if(min_dist >= mortar_size) { mortar = 0.0f; } else if(mortar_smooth == 0.0f) { mortar = 1.0f; } else { min_dist = 1.0f - min_dist/mortar_size; mortar = (min_dist < mortar_smooth)? smoothstepf(min_dist / mortar_smooth) : 1.0f; } return make_float2(tint, mortar); } ccl_device void svm_node_tex_brick(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint4 node2 = read_node(kg, offset); uint4 node3 = read_node(kg, offset); uint4 node4 = read_node(kg, offset); /* Input and Output Sockets */ uint co_offset, color1_offset, color2_offset, mortar_offset, scale_offset; uint mortar_size_offset, bias_offset, brick_width_offset, row_height_offset; uint color_offset, fac_offset, mortar_smooth_offset; /* RNA properties */ uint offset_frequency, squash_frequency; decode_node_uchar4(node.y, &co_offset, &color1_offset, &color2_offset, &mortar_offset); decode_node_uchar4(node.z, &scale_offset, &mortar_size_offset, &bias_offset, &brick_width_offset); decode_node_uchar4(node.w, &row_height_offset, &color_offset, &fac_offset, &mortar_smooth_offset); decode_node_uchar4(node2.x, &offset_frequency, &squash_frequency, NULL, NULL); float3 co = stack_load_float3(stack, co_offset); float3 color1 = stack_load_float3(stack, color1_offset); float3 color2 = stack_load_float3(stack, color2_offset); float3 mortar = stack_load_float3(stack, mortar_offset); float scale = stack_load_float_default(stack, scale_offset, node2.y); float mortar_size = stack_load_float_default(stack, mortar_size_offset, node2.z); float mortar_smooth = stack_load_float_default(stack, mortar_smooth_offset, node4.x); float bias = stack_load_float_default(stack, bias_offset, node2.w); float brick_width = stack_load_float_default(stack, brick_width_offset, node3.x); float row_height = stack_load_float_default(stack, row_height_offset, node3.y); float offset_amount = __int_as_float(node3.z); float squash_amount = __int_as_float(node3.w); float2 f2 = svm_brick(co*scale, mortar_size, mortar_smooth, bias, brick_width, row_height, offset_amount, offset_frequency, squash_amount, squash_frequency); float tint = f2.x; float f = f2.y; if(f != 1.0f) { float facm = 1.0f - tint; color1 = facm * color1 + tint * color2; } if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, color1*(1.0f-f) + mortar*f); if(stack_valid(fac_offset)) stack_store_float(stack, fac_offset, f); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_brightness.h000066400000000000000000000022351334742672700236720ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void svm_node_brightness(ShaderData *sd, float *stack, uint in_color, uint out_color, uint node) { uint bright_offset, contrast_offset; float3 color = stack_load_float3(stack, in_color); decode_node_uchar4(node, &bright_offset, &contrast_offset, NULL, NULL); float brightness = stack_load_float(stack, bright_offset); float contrast = stack_load_float(stack, contrast_offset); color = svm_brightness_contrast(color, brightness, contrast); if(stack_valid(out_color)) stack_store_float3(stack, out_color, color); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_bump.h000066400000000000000000000031461334742672700224670ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Bump Eval Nodes */ ccl_device void svm_node_enter_bump_eval(KernelGlobals *kg, ShaderData *sd, float *stack, uint offset) { /* save state */ stack_store_float3(stack, offset+0, sd->P); stack_store_float3(stack, offset+3, sd->dP.dx); stack_store_float3(stack, offset+6, sd->dP.dy); /* set state as if undisplaced */ const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_POSITION_UNDISPLACED); if(desc.offset != ATTR_STD_NOT_FOUND) { float3 P, dPdx, dPdy; P = primitive_attribute_float3(kg, sd, desc, &dPdx, &dPdy); object_position_transform(kg, sd, &P); object_dir_transform(kg, sd, &dPdx); object_dir_transform(kg, sd, &dPdy); sd->P = P; sd->dP.dx = dPdx; sd->dP.dy = dPdy; } } ccl_device void svm_node_leave_bump_eval(KernelGlobals *kg, ShaderData *sd, float *stack, uint offset) { /* restore state */ sd->P = stack_load_float3(stack, offset+0); sd->dP.dx = stack_load_float3(stack, offset+3); sd->dP.dy = stack_load_float3(stack, offset+6); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_camera.h000066400000000000000000000023011334742672700227440ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void svm_node_camera(KernelGlobals *kg, ShaderData *sd, float *stack, uint out_vector, uint out_zdepth, uint out_distance) { float distance; float zdepth; float3 vector; Transform tfm = kernel_data.cam.worldtocamera; vector = transform_point(&tfm, sd->P); zdepth = vector.z; distance = len(vector); if(stack_valid(out_vector)) stack_store_float3(stack, out_vector, normalize(vector)); if(stack_valid(out_zdepth)) stack_store_float(stack, out_zdepth, zdepth); if(stack_valid(out_distance)) stack_store_float(stack, out_distance, distance); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_checker.h000066400000000000000000000035001334742672700231220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Checker */ ccl_device_noinline float svm_checker(float3 p) { /* avoid precision issues on unit coordinates */ p.x = (p.x + 0.000001f)*0.999999f; p.y = (p.y + 0.000001f)*0.999999f; p.z = (p.z + 0.000001f)*0.999999f; int xi = abs(float_to_int(floorf(p.x))); int yi = abs(float_to_int(floorf(p.y))); int zi = abs(float_to_int(floorf(p.z))); return ((xi % 2 == yi % 2) == (zi % 2))? 1.0f: 0.0f; } ccl_device void svm_node_tex_checker(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint co_offset, color1_offset, color2_offset, scale_offset; uint color_offset, fac_offset; decode_node_uchar4(node.y, &co_offset, &color1_offset, &color2_offset, &scale_offset); decode_node_uchar4(node.z, &color_offset, &fac_offset, NULL, NULL); float3 co = stack_load_float3(stack, co_offset); float3 color1 = stack_load_float3(stack, color1_offset); float3 color2 = stack_load_float3(stack, color2_offset); float scale = stack_load_float_default(stack, scale_offset, node.w); float f = svm_checker(co*scale); if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, (f == 1.0f)? color1: color2); if(stack_valid(fac_offset)) stack_store_float(stack, fac_offset, f); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_closure.h000066400000000000000000001054361334742672700232050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Closure Nodes */ ccl_device void svm_node_glass_setup(ShaderData *sd, MicrofacetBsdf *bsdf, int type, float eta, float roughness, bool refract) { if(type == CLOSURE_BSDF_SHARP_GLASS_ID) { if(refract) { bsdf->alpha_y = 0.0f; bsdf->alpha_x = 0.0f; bsdf->ior = eta; sd->flag |= bsdf_refraction_setup(bsdf); } else { bsdf->alpha_y = 0.0f; bsdf->alpha_x = 0.0f; bsdf->ior = 0.0f; sd->flag |= bsdf_reflection_setup(bsdf); } } else if(type == CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID) { bsdf->alpha_x = roughness; bsdf->alpha_y = roughness; bsdf->ior = eta; if(refract) sd->flag |= bsdf_microfacet_beckmann_refraction_setup(bsdf); else sd->flag |= bsdf_microfacet_beckmann_setup(bsdf); } else { bsdf->alpha_x = roughness; bsdf->alpha_y = roughness; bsdf->ior = eta; if(refract) sd->flag |= bsdf_microfacet_ggx_refraction_setup(bsdf); else sd->flag |= bsdf_microfacet_ggx_setup(bsdf); } } ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, ShaderType shader_type, int path_flag, int *offset) { uint type, param1_offset, param2_offset; uint mix_weight_offset; decode_node_uchar4(node.y, &type, ¶m1_offset, ¶m2_offset, &mix_weight_offset); float mix_weight = (stack_valid(mix_weight_offset)? stack_load_float(stack, mix_weight_offset): 1.0f); /* note we read this extra node before weight check, so offset is added */ uint4 data_node = read_node(kg, offset); /* Only compute BSDF for surfaces, transparent variable is shared with volume extinction. */ if(mix_weight == 0.0f || shader_type != SHADER_TYPE_SURFACE) { if(type == CLOSURE_BSDF_PRINCIPLED_ID) { /* Read all principled BSDF extra data to get the right offset. */ read_node(kg, offset); read_node(kg, offset); read_node(kg, offset); read_node(kg, offset); } return; } float3 N = stack_valid(data_node.x)? stack_load_float3(stack, data_node.x): sd->N; float param1 = (stack_valid(param1_offset))? stack_load_float(stack, param1_offset): __uint_as_float(node.z); float param2 = (stack_valid(param2_offset))? stack_load_float(stack, param2_offset): __uint_as_float(node.w); switch(type) { #ifdef __PRINCIPLED__ case CLOSURE_BSDF_PRINCIPLED_ID: { uint specular_offset, roughness_offset, specular_tint_offset, anisotropic_offset, sheen_offset, sheen_tint_offset, clearcoat_offset, clearcoat_roughness_offset, eta_offset, transmission_offset, anisotropic_rotation_offset, transmission_roughness_offset; uint4 data_node2 = read_node(kg, offset); float3 T = stack_load_float3(stack, data_node.y); decode_node_uchar4(data_node.z, &specular_offset, &roughness_offset, &specular_tint_offset, &anisotropic_offset); decode_node_uchar4(data_node.w, &sheen_offset, &sheen_tint_offset, &clearcoat_offset, &clearcoat_roughness_offset); decode_node_uchar4(data_node2.x, &eta_offset, &transmission_offset, &anisotropic_rotation_offset, &transmission_roughness_offset); // get Disney principled parameters float metallic = param1; float subsurface = param2; float specular = stack_load_float(stack, specular_offset); float roughness = stack_load_float(stack, roughness_offset); float specular_tint = stack_load_float(stack, specular_tint_offset); float anisotropic = stack_load_float(stack, anisotropic_offset); float sheen = stack_load_float(stack, sheen_offset); float sheen_tint = stack_load_float(stack, sheen_tint_offset); float clearcoat = stack_load_float(stack, clearcoat_offset); float clearcoat_roughness = stack_load_float(stack, clearcoat_roughness_offset); float transmission = stack_load_float(stack, transmission_offset); float anisotropic_rotation = stack_load_float(stack, anisotropic_rotation_offset); float transmission_roughness = stack_load_float(stack, transmission_roughness_offset); float eta = fmaxf(stack_load_float(stack, eta_offset), 1e-5f); ClosureType distribution = (ClosureType) data_node2.y; ClosureType subsurface_method = (ClosureType) data_node2.z; /* rotate tangent */ if(anisotropic_rotation != 0.0f) T = rotate_around_axis(T, N, anisotropic_rotation * M_2PI_F); /* calculate ior */ float ior = (sd->flag & SD_BACKFACING) ? 1.0f / eta : eta; // calculate fresnel for refraction float cosNO = dot(N, sd->I); float fresnel = fresnel_dielectric_cos(cosNO, ior); // calculate weights of the diffuse and specular part float diffuse_weight = (1.0f - saturate(metallic)) * (1.0f - saturate(transmission)); float final_transmission = saturate(transmission) * (1.0f - saturate(metallic)); float specular_weight = (1.0f - final_transmission); // get the base color uint4 data_base_color = read_node(kg, offset); float3 base_color = stack_valid(data_base_color.x) ? stack_load_float3(stack, data_base_color.x) : make_float3(__uint_as_float(data_base_color.y), __uint_as_float(data_base_color.z), __uint_as_float(data_base_color.w)); // get the additional clearcoat normal and subsurface scattering radius uint4 data_cn_ssr = read_node(kg, offset); float3 clearcoat_normal = stack_valid(data_cn_ssr.x) ? stack_load_float3(stack, data_cn_ssr.x) : sd->N; float3 subsurface_radius = stack_valid(data_cn_ssr.y) ? stack_load_float3(stack, data_cn_ssr.y) : make_float3(1.0f, 1.0f, 1.0f); // get the subsurface color uint4 data_subsurface_color = read_node(kg, offset); float3 subsurface_color = stack_valid(data_subsurface_color.x) ? stack_load_float3(stack, data_subsurface_color.x) : make_float3(__uint_as_float(data_subsurface_color.y), __uint_as_float(data_subsurface_color.z), __uint_as_float(data_subsurface_color.w)); float3 weight = sd->svm_closure_weight * mix_weight; #ifdef __SUBSURFACE__ float3 mixed_ss_base_color = subsurface_color * subsurface + base_color * (1.0f - subsurface); float3 subsurf_weight = weight * mixed_ss_base_color * diffuse_weight; /* disable in case of diffuse ancestor, can't see it well then and * adds considerably noise due to probabilities of continuing path * getting lower and lower */ if(path_flag & PATH_RAY_DIFFUSE_ANCESTOR) { subsurface = 0.0f; /* need to set the base color in this case such that the * rays get the correctly mixed color after transmitting * the object */ base_color = mixed_ss_base_color; } /* diffuse */ if(fabsf(average(mixed_ss_base_color)) > CLOSURE_WEIGHT_CUTOFF) { if(subsurface <= CLOSURE_WEIGHT_CUTOFF && diffuse_weight > CLOSURE_WEIGHT_CUTOFF) { float3 diff_weight = weight * base_color * diffuse_weight; PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf*)bsdf_alloc(sd, sizeof(PrincipledDiffuseBsdf), diff_weight); if(bsdf) { bsdf->N = N; bsdf->roughness = roughness; /* setup bsdf */ sd->flag |= bsdf_principled_diffuse_setup(bsdf); } } else if(subsurface > CLOSURE_WEIGHT_CUTOFF) { Bssrdf *bssrdf = bssrdf_alloc(sd, subsurf_weight); if(bssrdf) { bssrdf->radius = subsurface_radius * subsurface; bssrdf->albedo = (subsurface_method == CLOSURE_BSSRDF_PRINCIPLED_ID)? subsurface_color: mixed_ss_base_color; bssrdf->texture_blur = 0.0f; bssrdf->sharpness = 0.0f; bssrdf->N = N; bssrdf->roughness = roughness; /* setup bsdf */ sd->flag |= bssrdf_setup(sd, bssrdf, subsurface_method); } } } #else /* diffuse */ if(diffuse_weight > CLOSURE_WEIGHT_CUTOFF) { float3 diff_weight = weight * base_color * diffuse_weight; PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf*)bsdf_alloc(sd, sizeof(PrincipledDiffuseBsdf), diff_weight); if(bsdf) { bsdf->N = N; bsdf->roughness = roughness; /* setup bsdf */ sd->flag |= bsdf_principled_diffuse_setup(bsdf); } } #endif /* sheen */ if(diffuse_weight > CLOSURE_WEIGHT_CUTOFF && sheen > CLOSURE_WEIGHT_CUTOFF) { float m_cdlum = linear_rgb_to_gray(base_color); float3 m_ctint = m_cdlum > 0.0f ? base_color / m_cdlum : make_float3(1.0f, 1.0f, 1.0f); // normalize lum. to isolate hue+sat /* color of the sheen component */ float3 sheen_color = make_float3(1.0f, 1.0f, 1.0f) * (1.0f - sheen_tint) + m_ctint * sheen_tint; float3 sheen_weight = weight * sheen * sheen_color * diffuse_weight; PrincipledSheenBsdf *bsdf = (PrincipledSheenBsdf*)bsdf_alloc(sd, sizeof(PrincipledSheenBsdf), sheen_weight); if(bsdf) { bsdf->N = N; /* setup bsdf */ sd->flag |= bsdf_principled_sheen_setup(bsdf); } } /* specular reflection */ #ifdef __CAUSTICS_TRICKS__ if(kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0) { #endif if(specular_weight > CLOSURE_WEIGHT_CUTOFF && (specular > CLOSURE_WEIGHT_CUTOFF || metallic > CLOSURE_WEIGHT_CUTOFF)) { float3 spec_weight = weight * specular_weight; MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), spec_weight); if(!bsdf){ break; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { break; } bsdf->N = N; bsdf->ior = (2.0f / (1.0f - safe_sqrtf(0.08f * specular))) - 1.0f; bsdf->T = T; bsdf->extra = extra; float aspect = safe_sqrtf(1.0f - anisotropic * 0.9f); float r2 = roughness * roughness; bsdf->alpha_x = r2 / aspect; bsdf->alpha_y = r2 * aspect; float m_cdlum = 0.3f * base_color.x + 0.6f * base_color.y + 0.1f * base_color.z; // luminance approx. float3 m_ctint = m_cdlum > 0.0f ? base_color / m_cdlum : make_float3(0.0f, 0.0f, 0.0f); // normalize lum. to isolate hue+sat float3 tmp_col = make_float3(1.0f, 1.0f, 1.0f) * (1.0f - specular_tint) + m_ctint * specular_tint; bsdf->extra->cspec0 = (specular * 0.08f * tmp_col) * (1.0f - metallic) + base_color * metallic; bsdf->extra->color = base_color; bsdf->extra->clearcoat = 0.0f; /* setup bsdf */ if(distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID || roughness <= 0.075f) /* use single-scatter GGX */ sd->flag |= bsdf_microfacet_ggx_aniso_fresnel_setup(bsdf, sd); else /* use multi-scatter GGX */ sd->flag |= bsdf_microfacet_multi_ggx_aniso_fresnel_setup(bsdf, sd); } #ifdef __CAUSTICS_TRICKS__ } #endif /* BSDF */ #ifdef __CAUSTICS_TRICKS__ if(kernel_data.integrator.caustics_reflective || kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0) { #endif if(final_transmission > CLOSURE_WEIGHT_CUTOFF) { float3 glass_weight = weight * final_transmission; float3 cspec0 = base_color * specular_tint + make_float3(1.0f, 1.0f, 1.0f) * (1.0f - specular_tint); if(roughness <= 5e-2f || distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID) { /* use single-scatter GGX */ float refl_roughness = roughness; /* reflection */ #ifdef __CAUSTICS_TRICKS__ if(kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0) #endif { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), glass_weight*fresnel); if(!bsdf) { break; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { break; } bsdf->N = N; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra = extra; bsdf->alpha_x = refl_roughness * refl_roughness; bsdf->alpha_y = refl_roughness * refl_roughness; bsdf->ior = ior; bsdf->extra->color = base_color; bsdf->extra->cspec0 = cspec0; bsdf->extra->clearcoat = 0.0f; /* setup bsdf */ sd->flag |= bsdf_microfacet_ggx_fresnel_setup(bsdf, sd); } /* refraction */ #ifdef __CAUSTICS_TRICKS__ if(kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0) #endif { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), base_color*glass_weight*(1.0f - fresnel)); if(!bsdf) { break; } bsdf->N = N; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra = NULL; if(distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID) transmission_roughness = 1.0f - (1.0f - refl_roughness) * (1.0f - transmission_roughness); else transmission_roughness = refl_roughness; bsdf->alpha_x = transmission_roughness * transmission_roughness; bsdf->alpha_y = transmission_roughness * transmission_roughness; bsdf->ior = ior; /* setup bsdf */ sd->flag |= bsdf_microfacet_ggx_refraction_setup(bsdf); } } else { /* use multi-scatter GGX */ MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), glass_weight); if(!bsdf) { break; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { break; } bsdf->N = N; bsdf->extra = extra; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_x = roughness * roughness; bsdf->alpha_y = roughness * roughness; bsdf->ior = ior; bsdf->extra->color = base_color; bsdf->extra->cspec0 = cspec0; bsdf->extra->clearcoat = 0.0f; /* setup bsdf */ sd->flag |= bsdf_microfacet_multi_ggx_glass_fresnel_setup(bsdf, sd); } } #ifdef __CAUSTICS_TRICKS__ } #endif /* clearcoat */ #ifdef __CAUSTICS_TRICKS__ if(kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0) { #endif if(clearcoat > CLOSURE_WEIGHT_CUTOFF) { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight); if(!bsdf) { break; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { break; } bsdf->N = clearcoat_normal; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->ior = 1.5f; bsdf->extra = extra; bsdf->alpha_x = clearcoat_roughness * clearcoat_roughness; bsdf->alpha_y = clearcoat_roughness * clearcoat_roughness; bsdf->extra->color = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra->cspec0 = make_float3(0.04f, 0.04f, 0.04f); bsdf->extra->clearcoat = clearcoat; /* setup bsdf */ sd->flag |= bsdf_microfacet_ggx_clearcoat_setup(bsdf, sd); } #ifdef __CAUSTICS_TRICKS__ } #endif break; } #endif /* __PRINCIPLED__ */ case CLOSURE_BSDF_DIFFUSE_ID: { float3 weight = sd->svm_closure_weight * mix_weight; OrenNayarBsdf *bsdf = (OrenNayarBsdf*)bsdf_alloc(sd, sizeof(OrenNayarBsdf), weight); if(bsdf) { bsdf->N = N; float roughness = param1; if(roughness == 0.0f) { sd->flag |= bsdf_diffuse_setup((DiffuseBsdf*)bsdf); } else { bsdf->roughness = roughness; sd->flag |= bsdf_oren_nayar_setup(bsdf); } } break; } case CLOSURE_BSDF_TRANSLUCENT_ID: { float3 weight = sd->svm_closure_weight * mix_weight; DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd, sizeof(DiffuseBsdf), weight); if(bsdf) { bsdf->N = N; sd->flag |= bsdf_translucent_setup(bsdf); } break; } case CLOSURE_BSDF_TRANSPARENT_ID: { float3 weight = sd->svm_closure_weight * mix_weight; bsdf_transparent_setup(sd, weight, path_flag); break; } case CLOSURE_BSDF_REFLECTION_ID: case CLOSURE_BSDF_MICROFACET_GGX_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID: { #ifdef __CAUSTICS_TRICKS__ if(!kernel_data.integrator.caustics_reflective && (path_flag & PATH_RAY_DIFFUSE)) break; #endif float3 weight = sd->svm_closure_weight * mix_weight; MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight); if(!bsdf) { break; } bsdf->N = N; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_x = param1; bsdf->alpha_y = param1; bsdf->ior = 0.0f; bsdf->extra = NULL; /* setup bsdf */ if(type == CLOSURE_BSDF_REFLECTION_ID) sd->flag |= bsdf_reflection_setup(bsdf); else if(type == CLOSURE_BSDF_MICROFACET_BECKMANN_ID) sd->flag |= bsdf_microfacet_beckmann_setup(bsdf); else if(type == CLOSURE_BSDF_MICROFACET_GGX_ID) sd->flag |= bsdf_microfacet_ggx_setup(bsdf); else if(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID) { kernel_assert(stack_valid(data_node.z)); bsdf->extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(bsdf->extra) { bsdf->extra->color = stack_load_float3(stack, data_node.z); bsdf->extra->cspec0 = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra->clearcoat = 0.0f; sd->flag |= bsdf_microfacet_multi_ggx_setup(bsdf); } } else { sd->flag |= bsdf_ashikhmin_shirley_setup(bsdf); } break; } case CLOSURE_BSDF_REFRACTION_ID: case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID: { #ifdef __CAUSTICS_TRICKS__ if(!kernel_data.integrator.caustics_refractive && (path_flag & PATH_RAY_DIFFUSE)) break; #endif float3 weight = sd->svm_closure_weight * mix_weight; MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight); if(bsdf) { bsdf->N = N; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra = NULL; float eta = fmaxf(param2, 1e-5f); eta = (sd->flag & SD_BACKFACING)? 1.0f/eta: eta; /* setup bsdf */ if(type == CLOSURE_BSDF_REFRACTION_ID) { bsdf->alpha_x = 0.0f; bsdf->alpha_y = 0.0f; bsdf->ior = eta; sd->flag |= bsdf_refraction_setup(bsdf); } else { bsdf->alpha_x = param1; bsdf->alpha_y = param1; bsdf->ior = eta; if(type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID) sd->flag |= bsdf_microfacet_beckmann_refraction_setup(bsdf); else sd->flag |= bsdf_microfacet_ggx_refraction_setup(bsdf); } } break; } case CLOSURE_BSDF_SHARP_GLASS_ID: case CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID: case CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID: { #ifdef __CAUSTICS_TRICKS__ if(!kernel_data.integrator.caustics_reflective && !kernel_data.integrator.caustics_refractive && (path_flag & PATH_RAY_DIFFUSE)) { break; } #endif float3 weight = sd->svm_closure_weight * mix_weight; /* index of refraction */ float eta = fmaxf(param2, 1e-5f); eta = (sd->flag & SD_BACKFACING)? 1.0f/eta: eta; /* fresnel */ float cosNO = dot(N, sd->I); float fresnel = fresnel_dielectric_cos(cosNO, eta); float roughness = param1; /* reflection */ #ifdef __CAUSTICS_TRICKS__ if(kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0) #endif { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight*fresnel); if(bsdf) { bsdf->N = N; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra = NULL; svm_node_glass_setup(sd, bsdf, type, eta, roughness, false); } } /* refraction */ #ifdef __CAUSTICS_TRICKS__ if(kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0) #endif { MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight*(1.0f - fresnel)); if(bsdf) { bsdf->N = N; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra = NULL; svm_node_glass_setup(sd, bsdf, type, eta, roughness, true); } } break; } case CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID: { #ifdef __CAUSTICS_TRICKS__ if(!kernel_data.integrator.caustics_reflective && !kernel_data.integrator.caustics_refractive && (path_flag & PATH_RAY_DIFFUSE)) break; #endif float3 weight = sd->svm_closure_weight * mix_weight; MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight); if(!bsdf) { break; } MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(!extra) { break; } bsdf->N = N; bsdf->extra = extra; bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->alpha_x = param1; bsdf->alpha_y = param1; float eta = fmaxf(param2, 1e-5f); bsdf->ior = (sd->flag & SD_BACKFACING)? 1.0f/eta: eta; kernel_assert(stack_valid(data_node.z)); bsdf->extra->color = stack_load_float3(stack, data_node.z); bsdf->extra->cspec0 = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra->clearcoat = 0.0f; /* setup bsdf */ sd->flag |= bsdf_microfacet_multi_ggx_glass_setup(bsdf); break; } case CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID: case CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID: case CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID: case CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID: { #ifdef __CAUSTICS_TRICKS__ if(!kernel_data.integrator.caustics_reflective && (path_flag & PATH_RAY_DIFFUSE)) break; #endif float3 weight = sd->svm_closure_weight * mix_weight; MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), weight); if(bsdf) { bsdf->N = N; bsdf->extra = NULL; bsdf->T = stack_load_float3(stack, data_node.y); /* rotate tangent */ float rotation = stack_load_float(stack, data_node.z); if(rotation != 0.0f) bsdf->T = rotate_around_axis(bsdf->T, bsdf->N, rotation * M_2PI_F); /* compute roughness */ float roughness = param1; float anisotropy = clamp(param2, -0.99f, 0.99f); if(anisotropy < 0.0f) { bsdf->alpha_x = roughness/(1.0f + anisotropy); bsdf->alpha_y = roughness*(1.0f + anisotropy); } else { bsdf->alpha_x = roughness*(1.0f - anisotropy); bsdf->alpha_y = roughness/(1.0f - anisotropy); } bsdf->ior = 0.0f; if(type == CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID) { sd->flag |= bsdf_microfacet_beckmann_aniso_setup(bsdf); } else if(type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID) { sd->flag |= bsdf_microfacet_ggx_aniso_setup(bsdf); } else if(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID) { kernel_assert(stack_valid(data_node.w)); bsdf->extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra)); if(bsdf->extra) { bsdf->extra->color = stack_load_float3(stack, data_node.w); bsdf->extra->cspec0 = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra->clearcoat = 0.0f; sd->flag |= bsdf_microfacet_multi_ggx_aniso_setup(bsdf); } } else sd->flag |= bsdf_ashikhmin_shirley_aniso_setup(bsdf); } break; } case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: { float3 weight = sd->svm_closure_weight * mix_weight; VelvetBsdf *bsdf = (VelvetBsdf*)bsdf_alloc(sd, sizeof(VelvetBsdf), weight); if(bsdf) { bsdf->N = N; bsdf->sigma = saturate(param1); sd->flag |= bsdf_ashikhmin_velvet_setup(bsdf); } break; } case CLOSURE_BSDF_GLOSSY_TOON_ID: #ifdef __CAUSTICS_TRICKS__ if(!kernel_data.integrator.caustics_reflective && (path_flag & PATH_RAY_DIFFUSE)) break; ATTR_FALLTHROUGH; #endif case CLOSURE_BSDF_DIFFUSE_TOON_ID: { float3 weight = sd->svm_closure_weight * mix_weight; ToonBsdf *bsdf = (ToonBsdf*)bsdf_alloc(sd, sizeof(ToonBsdf), weight); if(bsdf) { bsdf->N = N; bsdf->size = param1; bsdf->smooth = param2; if(type == CLOSURE_BSDF_DIFFUSE_TOON_ID) sd->flag |= bsdf_diffuse_toon_setup(bsdf); else sd->flag |= bsdf_glossy_toon_setup(bsdf); } break; } #ifdef __HAIR__ case CLOSURE_BSDF_HAIR_REFLECTION_ID: case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: { float3 weight = sd->svm_closure_weight * mix_weight; if(sd->flag & SD_BACKFACING && sd->type & PRIMITIVE_ALL_CURVE) { /* todo: giving a fixed weight here will cause issues when * mixing multiple BSDFS. energy will not be conserved and * the throughput can blow up after multiple bounces. we * better figure out a way to skip backfaces from rays * spawned by transmission from the front */ bsdf_transparent_setup(sd, make_float3(1.0f, 1.0f, 1.0f), path_flag); } else { HairBsdf *bsdf = (HairBsdf*)bsdf_alloc(sd, sizeof(HairBsdf), weight); if(bsdf) { bsdf->N = N; bsdf->roughness1 = param1; bsdf->roughness2 = param2; bsdf->offset = -stack_load_float(stack, data_node.z); if(stack_valid(data_node.y)) { bsdf->T = normalize(stack_load_float3(stack, data_node.y)); } else if(!(sd->type & PRIMITIVE_ALL_CURVE)) { bsdf->T = normalize(sd->dPdv); bsdf->offset = 0.0f; } else bsdf->T = normalize(sd->dPdu); if(type == CLOSURE_BSDF_HAIR_REFLECTION_ID) { sd->flag |= bsdf_hair_reflection_setup(bsdf); } else { sd->flag |= bsdf_hair_transmission_setup(bsdf); } } } break; } #endif #ifdef __SUBSURFACE__ case CLOSURE_BSSRDF_CUBIC_ID: case CLOSURE_BSSRDF_GAUSSIAN_ID: case CLOSURE_BSSRDF_BURLEY_ID: case CLOSURE_BSSRDF_RANDOM_WALK_ID: { float3 weight = sd->svm_closure_weight * mix_weight; Bssrdf *bssrdf = bssrdf_alloc(sd, weight); if(bssrdf) { /* disable in case of diffuse ancestor, can't see it well then and * adds considerably noise due to probabilities of continuing path * getting lower and lower */ if(path_flag & PATH_RAY_DIFFUSE_ANCESTOR) param1 = 0.0f; bssrdf->radius = stack_load_float3(stack, data_node.z)*param1; bssrdf->albedo = sd->svm_closure_weight; bssrdf->texture_blur = param2; bssrdf->sharpness = stack_load_float(stack, data_node.w); bssrdf->N = N; bssrdf->roughness = 0.0f; sd->flag |= bssrdf_setup(sd, bssrdf, (ClosureType)type); } break; } #endif default: break; } } ccl_device void svm_node_closure_volume(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, ShaderType shader_type) { #ifdef __VOLUME__ /* Only sum extinction for volumes, variable is shared with surface transparency. */ if(shader_type != SHADER_TYPE_VOLUME) { return; } uint type, density_offset, anisotropy_offset; uint mix_weight_offset; decode_node_uchar4(node.y, &type, &density_offset, &anisotropy_offset, &mix_weight_offset); float mix_weight = (stack_valid(mix_weight_offset)? stack_load_float(stack, mix_weight_offset): 1.0f); if(mix_weight == 0.0f) { return; } float density = (stack_valid(density_offset))? stack_load_float(stack, density_offset): __uint_as_float(node.z); density = mix_weight * fmaxf(density, 0.0f); /* Compute scattering coefficient. */ float3 weight = sd->svm_closure_weight; if(type == CLOSURE_VOLUME_ABSORPTION_ID) { weight = make_float3(1.0f, 1.0f, 1.0f) - weight; } weight *= density; /* Add closure for volume scattering. */ if(type == CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID) { HenyeyGreensteinVolume *volume = (HenyeyGreensteinVolume*)bsdf_alloc(sd, sizeof(HenyeyGreensteinVolume), weight); if(volume) { float anisotropy = (stack_valid(anisotropy_offset))? stack_load_float(stack, anisotropy_offset): __uint_as_float(node.w); volume->g = anisotropy; /* g */ sd->flag |= volume_henyey_greenstein_setup(volume); } } /* Sum total extinction weight. */ volume_extinction_setup(sd, weight); #endif } ccl_device void svm_node_principled_volume(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, ShaderType shader_type, int path_flag, int *offset) { #ifdef __VOLUME__ uint4 value_node = read_node(kg, offset); uint4 attr_node = read_node(kg, offset); /* Only sum extinction for volumes, variable is shared with surface transparency. */ if(shader_type != SHADER_TYPE_VOLUME) { return; } uint density_offset, anisotropy_offset, absorption_color_offset, mix_weight_offset; decode_node_uchar4(node.y, &density_offset, &anisotropy_offset, &absorption_color_offset, &mix_weight_offset); float mix_weight = (stack_valid(mix_weight_offset)? stack_load_float(stack, mix_weight_offset): 1.0f); if(mix_weight == 0.0f) { return; } /* Compute density. */ float primitive_density = 1.0f; float density = (stack_valid(density_offset))? stack_load_float(stack, density_offset): __uint_as_float(value_node.x); density = mix_weight * fmaxf(density, 0.0f); if(density > CLOSURE_WEIGHT_CUTOFF) { /* Density and color attribute lookup if available. */ const AttributeDescriptor attr_density = find_attribute(kg, sd, attr_node.x); if(attr_density.offset != ATTR_STD_NOT_FOUND) { primitive_density = primitive_attribute_float(kg, sd, attr_density, NULL, NULL); density = fmaxf(density * primitive_density, 0.0f); } } if(density > CLOSURE_WEIGHT_CUTOFF) { /* Compute scattering color. */ float3 color = sd->svm_closure_weight; const AttributeDescriptor attr_color = find_attribute(kg, sd, attr_node.y); if(attr_color.offset != ATTR_STD_NOT_FOUND) { color *= primitive_attribute_float3(kg, sd, attr_color, NULL, NULL); } /* Add closure for volume scattering. */ HenyeyGreensteinVolume *volume = (HenyeyGreensteinVolume*)bsdf_alloc(sd, sizeof(HenyeyGreensteinVolume), color * density); if(volume) { float anisotropy = (stack_valid(anisotropy_offset))? stack_load_float(stack, anisotropy_offset): __uint_as_float(value_node.y); volume->g = anisotropy; sd->flag |= volume_henyey_greenstein_setup(volume); } /* Add extinction weight. */ float3 zero = make_float3(0.0f, 0.0f, 0.0f); float3 one = make_float3(1.0f, 1.0f, 1.0f); float3 absorption_color = max(sqrt(stack_load_float3(stack, absorption_color_offset)), zero); float3 absorption = max(one - color, zero) * max(one - absorption_color, zero); volume_extinction_setup(sd, (color + absorption) * density); } /* Compute emission. */ if(path_flag & PATH_RAY_SHADOW) { /* Don't need emission for shadows. */ return; } uint emission_offset, emission_color_offset, blackbody_offset, temperature_offset; decode_node_uchar4(node.z, &emission_offset, &emission_color_offset, &blackbody_offset, &temperature_offset); float emission = (stack_valid(emission_offset))? stack_load_float(stack, emission_offset): __uint_as_float(value_node.z); float blackbody = (stack_valid(blackbody_offset))? stack_load_float(stack, blackbody_offset): __uint_as_float(value_node.w); if(emission > CLOSURE_WEIGHT_CUTOFF) { float3 emission_color = stack_load_float3(stack, emission_color_offset); emission_setup(sd, emission * emission_color); } if(blackbody > CLOSURE_WEIGHT_CUTOFF) { float T = stack_load_float(stack, temperature_offset); /* Add flame temperature from attribute if available. */ const AttributeDescriptor attr_temperature = find_attribute(kg, sd, attr_node.z); if(attr_temperature.offset != ATTR_STD_NOT_FOUND) { float temperature = primitive_attribute_float(kg, sd, attr_temperature, NULL, NULL); T *= fmaxf(temperature, 0.0f); } T = fmaxf(T, 0.0f); /* Stefan-Boltzmann law. */ float T4 = sqr(sqr(T)); float sigma = 5.670373e-8f * 1e-6f / M_PI_F; float intensity = sigma * mix(1.0f, T4, blackbody); if(intensity > CLOSURE_WEIGHT_CUTOFF) { float3 blackbody_tint = stack_load_float3(stack, node.w); float3 bb = blackbody_tint * intensity * svm_math_blackbody_color(T); emission_setup(sd, bb); } } #endif } ccl_device void svm_node_closure_emission(ShaderData *sd, float *stack, uint4 node) { uint mix_weight_offset = node.y; float3 weight = sd->svm_closure_weight; if(stack_valid(mix_weight_offset)) { float mix_weight = stack_load_float(stack, mix_weight_offset); if(mix_weight == 0.0f) return; weight *= mix_weight; } emission_setup(sd, weight); } ccl_device void svm_node_closure_background(ShaderData *sd, float *stack, uint4 node) { uint mix_weight_offset = node.y; float3 weight = sd->svm_closure_weight; if(stack_valid(mix_weight_offset)) { float mix_weight = stack_load_float(stack, mix_weight_offset); if(mix_weight == 0.0f) return; weight *= mix_weight; } background_setup(sd, weight); } ccl_device void svm_node_closure_holdout(ShaderData *sd, float *stack, uint4 node) { uint mix_weight_offset = node.y; if(stack_valid(mix_weight_offset)) { float mix_weight = stack_load_float(stack, mix_weight_offset); if(mix_weight == 0.0f) return; closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_HOLDOUT_ID, sd->svm_closure_weight * mix_weight); } else closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_HOLDOUT_ID, sd->svm_closure_weight); sd->flag |= SD_HOLDOUT; } ccl_device void svm_node_closure_ambient_occlusion(ShaderData *sd, float *stack, uint4 node) { uint mix_weight_offset = node.y; if(stack_valid(mix_weight_offset)) { float mix_weight = stack_load_float(stack, mix_weight_offset); if(mix_weight == 0.0f) return; closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_AMBIENT_OCCLUSION_ID, sd->svm_closure_weight * mix_weight); } else closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_AMBIENT_OCCLUSION_ID, sd->svm_closure_weight); sd->flag |= SD_AO; } /* Closure Nodes */ ccl_device_inline void svm_node_closure_store_weight(ShaderData *sd, float3 weight) { sd->svm_closure_weight = weight; } ccl_device void svm_node_closure_set_weight(ShaderData *sd, uint r, uint g, uint b) { float3 weight = make_float3(__uint_as_float(r), __uint_as_float(g), __uint_as_float(b)); svm_node_closure_store_weight(sd, weight); } ccl_device void svm_node_closure_weight(ShaderData *sd, float *stack, uint weight_offset) { float3 weight = stack_load_float3(stack, weight_offset); svm_node_closure_store_weight(sd, weight); } ccl_device void svm_node_emission_weight(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint color_offset = node.y; uint strength_offset = node.z; float strength = stack_load_float(stack, strength_offset); float3 weight = stack_load_float3(stack, color_offset)*strength; svm_node_closure_store_weight(sd, weight); } ccl_device void svm_node_mix_closure(ShaderData *sd, float *stack, uint4 node) { /* fetch weight from blend input, previous mix closures, * and write to stack to be used by closure nodes later */ uint weight_offset, in_weight_offset, weight1_offset, weight2_offset; decode_node_uchar4(node.y, &weight_offset, &in_weight_offset, &weight1_offset, &weight2_offset); float weight = stack_load_float(stack, weight_offset); weight = saturate(weight); float in_weight = (stack_valid(in_weight_offset))? stack_load_float(stack, in_weight_offset): 1.0f; if(stack_valid(weight1_offset)) stack_store_float(stack, weight1_offset, in_weight*(1.0f - weight)); if(stack_valid(weight2_offset)) stack_store_float(stack, weight2_offset, in_weight*weight); } /* (Bump) normal */ ccl_device void svm_node_set_normal(KernelGlobals *kg, ShaderData *sd, float *stack, uint in_direction, uint out_normal) { float3 normal = stack_load_float3(stack, in_direction); sd->N = normal; stack_store_float3(stack, out_normal, normal); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_color_util.h000066400000000000000000000156021334742672700236770ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device float3 svm_mix_blend(float t, float3 col1, float3 col2) { return interp(col1, col2, t); } ccl_device float3 svm_mix_add(float t, float3 col1, float3 col2) { return interp(col1, col1 + col2, t); } ccl_device float3 svm_mix_mul(float t, float3 col1, float3 col2) { return interp(col1, col1 * col2, t); } ccl_device float3 svm_mix_screen(float t, float3 col1, float3 col2) { float tm = 1.0f - t; float3 one = make_float3(1.0f, 1.0f, 1.0f); float3 tm3 = make_float3(tm, tm, tm); return one - (tm3 + t*(one - col2))*(one - col1); } ccl_device float3 svm_mix_overlay(float t, float3 col1, float3 col2) { float tm = 1.0f - t; float3 outcol = col1; if(outcol.x < 0.5f) outcol.x *= tm + 2.0f*t*col2.x; else outcol.x = 1.0f - (tm + 2.0f*t*(1.0f - col2.x))*(1.0f - outcol.x); if(outcol.y < 0.5f) outcol.y *= tm + 2.0f*t*col2.y; else outcol.y = 1.0f - (tm + 2.0f*t*(1.0f - col2.y))*(1.0f - outcol.y); if(outcol.z < 0.5f) outcol.z *= tm + 2.0f*t*col2.z; else outcol.z = 1.0f - (tm + 2.0f*t*(1.0f - col2.z))*(1.0f - outcol.z); return outcol; } ccl_device float3 svm_mix_sub(float t, float3 col1, float3 col2) { return interp(col1, col1 - col2, t); } ccl_device float3 svm_mix_div(float t, float3 col1, float3 col2) { float tm = 1.0f - t; float3 outcol = col1; if(col2.x != 0.0f) outcol.x = tm*outcol.x + t*outcol.x/col2.x; if(col2.y != 0.0f) outcol.y = tm*outcol.y + t*outcol.y/col2.y; if(col2.z != 0.0f) outcol.z = tm*outcol.z + t*outcol.z/col2.z; return outcol; } ccl_device float3 svm_mix_diff(float t, float3 col1, float3 col2) { return interp(col1, fabs(col1 - col2), t); } ccl_device float3 svm_mix_dark(float t, float3 col1, float3 col2) { return min(col1, col2)*t + col1*(1.0f - t); } ccl_device float3 svm_mix_light(float t, float3 col1, float3 col2) { return max(col1, col2*t); } ccl_device float3 svm_mix_dodge(float t, float3 col1, float3 col2) { float3 outcol = col1; if(outcol.x != 0.0f) { float tmp = 1.0f - t*col2.x; if(tmp <= 0.0f) outcol.x = 1.0f; else if((tmp = outcol.x/tmp) > 1.0f) outcol.x = 1.0f; else outcol.x = tmp; } if(outcol.y != 0.0f) { float tmp = 1.0f - t*col2.y; if(tmp <= 0.0f) outcol.y = 1.0f; else if((tmp = outcol.y/tmp) > 1.0f) outcol.y = 1.0f; else outcol.y = tmp; } if(outcol.z != 0.0f) { float tmp = 1.0f - t*col2.z; if(tmp <= 0.0f) outcol.z = 1.0f; else if((tmp = outcol.z/tmp) > 1.0f) outcol.z = 1.0f; else outcol.z = tmp; } return outcol; } ccl_device float3 svm_mix_burn(float t, float3 col1, float3 col2) { float tmp, tm = 1.0f - t; float3 outcol = col1; tmp = tm + t*col2.x; if(tmp <= 0.0f) outcol.x = 0.0f; else if((tmp = (1.0f - (1.0f - outcol.x)/tmp)) < 0.0f) outcol.x = 0.0f; else if(tmp > 1.0f) outcol.x = 1.0f; else outcol.x = tmp; tmp = tm + t*col2.y; if(tmp <= 0.0f) outcol.y = 0.0f; else if((tmp = (1.0f - (1.0f - outcol.y)/tmp)) < 0.0f) outcol.y = 0.0f; else if(tmp > 1.0f) outcol.y = 1.0f; else outcol.y = tmp; tmp = tm + t*col2.z; if(tmp <= 0.0f) outcol.z = 0.0f; else if((tmp = (1.0f - (1.0f - outcol.z)/tmp)) < 0.0f) outcol.z = 0.0f; else if(tmp > 1.0f) outcol.z = 1.0f; else outcol.z = tmp; return outcol; } ccl_device float3 svm_mix_hue(float t, float3 col1, float3 col2) { float3 outcol = col1; float3 hsv2 = rgb_to_hsv(col2); if(hsv2.y != 0.0f) { float3 hsv = rgb_to_hsv(outcol); hsv.x = hsv2.x; float3 tmp = hsv_to_rgb(hsv); outcol = interp(outcol, tmp, t); } return outcol; } ccl_device float3 svm_mix_sat(float t, float3 col1, float3 col2) { float tm = 1.0f - t; float3 outcol = col1; float3 hsv = rgb_to_hsv(outcol); if(hsv.y != 0.0f) { float3 hsv2 = rgb_to_hsv(col2); hsv.y = tm*hsv.y + t*hsv2.y; outcol = hsv_to_rgb(hsv); } return outcol; } ccl_device float3 svm_mix_val(float t, float3 col1, float3 col2) { float tm = 1.0f - t; float3 hsv = rgb_to_hsv(col1); float3 hsv2 = rgb_to_hsv(col2); hsv.z = tm*hsv.z + t*hsv2.z; return hsv_to_rgb(hsv); } ccl_device float3 svm_mix_color(float t, float3 col1, float3 col2) { float3 outcol = col1; float3 hsv2 = rgb_to_hsv(col2); if(hsv2.y != 0.0f) { float3 hsv = rgb_to_hsv(outcol); hsv.x = hsv2.x; hsv.y = hsv2.y; float3 tmp = hsv_to_rgb(hsv); outcol = interp(outcol, tmp, t); } return outcol; } ccl_device float3 svm_mix_soft(float t, float3 col1, float3 col2) { float tm = 1.0f - t; float3 one = make_float3(1.0f, 1.0f, 1.0f); float3 scr = one - (one - col2)*(one - col1); return tm*col1 + t*((one - col1)*col2*col1 + col1*scr); } ccl_device float3 svm_mix_linear(float t, float3 col1, float3 col2) { return col1 + t*(2.0f*col2 + make_float3(-1.0f, -1.0f, -1.0f)); } ccl_device float3 svm_mix_clamp(float3 col) { float3 outcol = col; outcol.x = saturate(col.x); outcol.y = saturate(col.y); outcol.z = saturate(col.z); return outcol; } ccl_device_noinline float3 svm_mix(NodeMix type, float fac, float3 c1, float3 c2) { float t = saturate(fac); switch(type) { case NODE_MIX_BLEND: return svm_mix_blend(t, c1, c2); case NODE_MIX_ADD: return svm_mix_add(t, c1, c2); case NODE_MIX_MUL: return svm_mix_mul(t, c1, c2); case NODE_MIX_SCREEN: return svm_mix_screen(t, c1, c2); case NODE_MIX_OVERLAY: return svm_mix_overlay(t, c1, c2); case NODE_MIX_SUB: return svm_mix_sub(t, c1, c2); case NODE_MIX_DIV: return svm_mix_div(t, c1, c2); case NODE_MIX_DIFF: return svm_mix_diff(t, c1, c2); case NODE_MIX_DARK: return svm_mix_dark(t, c1, c2); case NODE_MIX_LIGHT: return svm_mix_light(t, c1, c2); case NODE_MIX_DODGE: return svm_mix_dodge(t, c1, c2); case NODE_MIX_BURN: return svm_mix_burn(t, c1, c2); case NODE_MIX_HUE: return svm_mix_hue(t, c1, c2); case NODE_MIX_SAT: return svm_mix_sat(t, c1, c2); case NODE_MIX_VAL: return svm_mix_val (t, c1, c2); case NODE_MIX_COLOR: return svm_mix_color(t, c1, c2); case NODE_MIX_SOFT: return svm_mix_soft(t, c1, c2); case NODE_MIX_LINEAR: return svm_mix_linear(t, c1, c2); case NODE_MIX_CLAMP: return svm_mix_clamp(c1); } return make_float3(0.0f, 0.0f, 0.0f); } ccl_device_inline float3 svm_brightness_contrast(float3 color, float brightness, float contrast) { float a = 1.0f + contrast; float b = brightness - contrast*0.5f; color.x = max(a*color.x + b, 0.0f); color.y = max(a*color.y + b, 0.0f); color.z = max(a*color.z + b, 0.0f); return color; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_convert.h000066400000000000000000000036241334742672700232050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Conversion Nodes */ ccl_device void svm_node_convert(ShaderData *sd, float *stack, uint type, uint from, uint to) { switch(type) { case NODE_CONVERT_FI: { float f = stack_load_float(stack, from); stack_store_int(stack, to, float_to_int(f)); break; } case NODE_CONVERT_FV: { float f = stack_load_float(stack, from); stack_store_float3(stack, to, make_float3(f, f, f)); break; } case NODE_CONVERT_CF: { float3 f = stack_load_float3(stack, from); float g = linear_rgb_to_gray(f); stack_store_float(stack, to, g); break; } case NODE_CONVERT_CI: { float3 f = stack_load_float3(stack, from); int i = (int)linear_rgb_to_gray(f); stack_store_int(stack, to, i); break; } case NODE_CONVERT_VF: { float3 f = stack_load_float3(stack, from); float g = average(f); stack_store_float(stack, to, g); break; } case NODE_CONVERT_VI: { float3 f = stack_load_float3(stack, from); int i = (int)average(f); stack_store_int(stack, to, i); break; } case NODE_CONVERT_IF: { float f = (float)stack_load_int(stack, from); stack_store_float(stack, to, f); break; } case NODE_CONVERT_IV: { float f = (float)stack_load_int(stack, from); stack_store_float3(stack, to, make_float3(f, f, f)); break; } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_displace.h000066400000000000000000000116351334742672700233120ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Bump Node */ ccl_device void svm_node_set_bump(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { #ifdef __RAY_DIFFERENTIALS__ /* get normal input */ uint normal_offset, scale_offset, invert, use_object_space; decode_node_uchar4(node.y, &normal_offset, &scale_offset, &invert, &use_object_space); float3 normal_in = stack_valid(normal_offset)? stack_load_float3(stack, normal_offset): sd->N; float3 dPdx = sd->dP.dx; float3 dPdy = sd->dP.dy; if(use_object_space) { object_inverse_normal_transform(kg, sd, &normal_in); object_inverse_dir_transform(kg, sd, &dPdx); object_inverse_dir_transform(kg, sd, &dPdy); } /* get surface tangents from normal */ float3 Rx = cross(dPdy, normal_in); float3 Ry = cross(normal_in, dPdx); /* get bump values */ uint c_offset, x_offset, y_offset, strength_offset; decode_node_uchar4(node.z, &c_offset, &x_offset, &y_offset, &strength_offset); float h_c = stack_load_float(stack, c_offset); float h_x = stack_load_float(stack, x_offset); float h_y = stack_load_float(stack, y_offset); /* compute surface gradient and determinant */ float det = dot(dPdx, Rx); float3 surfgrad = (h_x - h_c)*Rx + (h_y - h_c)*Ry; float absdet = fabsf(det); float strength = stack_load_float(stack, strength_offset); float scale = stack_load_float(stack, scale_offset); if(invert) scale *= -1.0f; strength = max(strength, 0.0f); /* compute and output perturbed normal */ float3 normal_out = safe_normalize(absdet*normal_in - scale*signf(det)*surfgrad); if(is_zero(normal_out)) { normal_out = normal_in; } else { normal_out = normalize(strength*normal_out + (1.0f - strength)*normal_in); } if(use_object_space) { object_normal_transform(kg, sd, &normal_out); } stack_store_float3(stack, node.w, normal_out); #endif } /* Displacement Node */ ccl_device void svm_node_set_displacement(KernelGlobals *kg, ShaderData *sd, float *stack, uint fac_offset) { float3 dP = stack_load_float3(stack, fac_offset); sd->P += dP; } ccl_device void svm_node_displacement(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint height_offset, midlevel_offset, scale_offset, normal_offset; decode_node_uchar4(node.y, &height_offset, &midlevel_offset, &scale_offset, &normal_offset); float height = stack_load_float(stack, height_offset); float midlevel = stack_load_float(stack, midlevel_offset); float scale = stack_load_float(stack, scale_offset); float3 normal = stack_valid(normal_offset)? stack_load_float3(stack, normal_offset): sd->N; uint space = node.w; float3 dP = normal; if(space == NODE_NORMAL_MAP_OBJECT) { /* Object space. */ object_inverse_normal_transform(kg, sd, &dP); dP *= (height - midlevel) * scale; object_dir_transform(kg, sd, &dP); } else { /* World space. */ dP *= (height - midlevel) * scale; } stack_store_float3(stack, node.z, dP); } ccl_device void svm_node_vector_displacement(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint4 data_node = read_node(kg, offset); uint space = data_node.x; uint vector_offset, midlevel_offset,scale_offset, displacement_offset; decode_node_uchar4(node.y, &vector_offset, &midlevel_offset, &scale_offset, &displacement_offset); float3 vector = stack_load_float3(stack, vector_offset); float midlevel = stack_load_float(stack, midlevel_offset); float scale = stack_load_float(stack, scale_offset); float3 dP = (vector - make_float3(midlevel, midlevel, midlevel)) * scale; if(space == NODE_NORMAL_MAP_TANGENT) { /* Tangent space. */ float3 normal = sd->N; object_inverse_normal_transform(kg, sd, &normal); const AttributeDescriptor attr = find_attribute(kg, sd, node.z); float3 tangent; if(attr.offset != ATTR_STD_NOT_FOUND) { tangent = primitive_attribute_float3(kg, sd, attr, NULL, NULL); } else { tangent = normalize(sd->dPdu); } float3 bitangent = normalize(cross(normal, tangent));; const AttributeDescriptor attr_sign = find_attribute(kg, sd, node.w); if(attr_sign.offset != ATTR_STD_NOT_FOUND) { float sign = primitive_attribute_float(kg, sd, attr_sign, NULL, NULL); bitangent *= sign; } dP = tangent*dP.x + normal*dP.y + bitangent*dP.z; } if(space != NODE_NORMAL_MAP_WORLD) { /* Tangent or object space. */ object_dir_transform(kg, sd, &dP); } stack_store_float3(stack, displacement_offset, dP); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_fresnel.h000066400000000000000000000042561334742672700231650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Fresnel Node */ ccl_device void svm_node_fresnel(ShaderData *sd, float *stack, uint ior_offset, uint ior_value, uint node) { uint normal_offset, out_offset; decode_node_uchar4(node, &normal_offset, &out_offset, NULL, NULL); float eta = (stack_valid(ior_offset))? stack_load_float(stack, ior_offset): __uint_as_float(ior_value); float3 normal_in = stack_valid(normal_offset)? stack_load_float3(stack, normal_offset): sd->N; eta = fmaxf(eta, 1e-5f); eta = (sd->flag & SD_BACKFACING)? 1.0f/eta: eta; float f = fresnel_dielectric_cos(dot(sd->I, normal_in), eta); stack_store_float(stack, out_offset, f); } /* Layer Weight Node */ ccl_device void svm_node_layer_weight(ShaderData *sd, float *stack, uint4 node) { uint blend_offset = node.y; uint blend_value = node.z; uint type, normal_offset, out_offset; decode_node_uchar4(node.w, &type, &normal_offset, &out_offset, NULL); float blend = (stack_valid(blend_offset))? stack_load_float(stack, blend_offset): __uint_as_float(blend_value); float3 normal_in = (stack_valid(normal_offset))? stack_load_float3(stack, normal_offset): sd->N; float f; if(type == NODE_LAYER_WEIGHT_FRESNEL) { float eta = fmaxf(1.0f - blend, 1e-5f); eta = (sd->flag & SD_BACKFACING)? eta: 1.0f/eta; f = fresnel_dielectric_cos(dot(sd->I, normal_in), eta); } else { f = fabsf(dot(sd->I, normal_in)); if(blend != 0.5f) { blend = clamp(blend, 0.0f, 1.0f-1e-5f); blend = (blend < 0.5f)? 2.0f*blend: 0.5f/(1.0f - blend); f = powf(f, blend); } f = 1.0f - f; } stack_store_float(stack, out_offset, f); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_gamma.h000066400000000000000000000017231334742672700226050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void svm_node_gamma(ShaderData *sd, float *stack, uint in_gamma, uint in_color, uint out_color) { float3 color = stack_load_float3(stack, in_color); float gamma = stack_load_float(stack, in_gamma); color = svm_math_gamma_color(color, gamma); if(stack_valid(out_color)) stack_store_float3(stack, out_color, color); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_geometry.h000066400000000000000000000141201334742672700233510ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Geometry Node */ ccl_device_inline void svm_node_geometry(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset) { float3 data; switch(type) { case NODE_GEOM_P: data = sd->P; break; case NODE_GEOM_N: data = sd->N; break; #ifdef __DPDU__ case NODE_GEOM_T: data = primitive_tangent(kg, sd); break; #endif case NODE_GEOM_I: data = sd->I; break; case NODE_GEOM_Ng: data = sd->Ng; break; #ifdef __UV__ case NODE_GEOM_uv: data = make_float3(sd->u, sd->v, 0.0f); break; #endif default: data = make_float3(0.0f, 0.0f, 0.0f); } stack_store_float3(stack, out_offset, data); } ccl_device void svm_node_geometry_bump_dx(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset) { #ifdef __RAY_DIFFERENTIALS__ float3 data; switch(type) { case NODE_GEOM_P: data = sd->P + sd->dP.dx; break; case NODE_GEOM_uv: data = make_float3(sd->u + sd->du.dx, sd->v + sd->dv.dx, 0.0f); break; default: svm_node_geometry(kg, sd, stack, type, out_offset); return; } stack_store_float3(stack, out_offset, data); #else svm_node_geometry(kg, sd, stack, type, out_offset); #endif } ccl_device void svm_node_geometry_bump_dy(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset) { #ifdef __RAY_DIFFERENTIALS__ float3 data; switch(type) { case NODE_GEOM_P: data = sd->P + sd->dP.dy; break; case NODE_GEOM_uv: data = make_float3(sd->u + sd->du.dy, sd->v + sd->dv.dy, 0.0f); break; default: svm_node_geometry(kg, sd, stack, type, out_offset); return; } stack_store_float3(stack, out_offset, data); #else svm_node_geometry(kg, sd, stack, type, out_offset); #endif } /* Object Info */ ccl_device void svm_node_object_info(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset) { float data; switch(type) { case NODE_INFO_OB_LOCATION: { stack_store_float3(stack, out_offset, object_location(kg, sd)); return; } case NODE_INFO_OB_INDEX: data = object_pass_id(kg, sd->object); break; case NODE_INFO_MAT_INDEX: data = shader_pass_id(kg, sd); break; case NODE_INFO_OB_RANDOM: { if(sd->lamp != LAMP_NONE) { data = lamp_random_number(kg, sd->lamp); } else { data = object_random_number(kg, sd->object); } break; } default: data = 0.0f; break; } stack_store_float(stack, out_offset, data); } /* Particle Info */ ccl_device void svm_node_particle_info(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset) { switch(type) { case NODE_INFO_PAR_INDEX: { int particle_id = object_particle_id(kg, sd->object); stack_store_float(stack, out_offset, particle_index(kg, particle_id)); break; } case NODE_INFO_PAR_RANDOM: { int particle_id = object_particle_id(kg, sd->object); float random = hash_int_01(particle_index(kg, particle_id)); stack_store_float(stack, out_offset, random); break; } case NODE_INFO_PAR_AGE: { int particle_id = object_particle_id(kg, sd->object); stack_store_float(stack, out_offset, particle_age(kg, particle_id)); break; } case NODE_INFO_PAR_LIFETIME: { int particle_id = object_particle_id(kg, sd->object); stack_store_float(stack, out_offset, particle_lifetime(kg, particle_id)); break; } case NODE_INFO_PAR_LOCATION: { int particle_id = object_particle_id(kg, sd->object); stack_store_float3(stack, out_offset, particle_location(kg, particle_id)); break; } #if 0 /* XXX float4 currently not supported in SVM stack */ case NODE_INFO_PAR_ROTATION: { int particle_id = object_particle_id(kg, sd->object); stack_store_float4(stack, out_offset, particle_rotation(kg, particle_id)); break; } #endif case NODE_INFO_PAR_SIZE: { int particle_id = object_particle_id(kg, sd->object); stack_store_float(stack, out_offset, particle_size(kg, particle_id)); break; } case NODE_INFO_PAR_VELOCITY: { int particle_id = object_particle_id(kg, sd->object); stack_store_float3(stack, out_offset, particle_velocity(kg, particle_id)); break; } case NODE_INFO_PAR_ANGULAR_VELOCITY: { int particle_id = object_particle_id(kg, sd->object); stack_store_float3(stack, out_offset, particle_angular_velocity(kg, particle_id)); break; } } } #ifdef __HAIR__ /* Hair Info */ ccl_device void svm_node_hair_info(KernelGlobals *kg, ShaderData *sd, float *stack, uint type, uint out_offset) { float data; float3 data3; switch(type) { case NODE_INFO_CURVE_IS_STRAND: { data = (sd->type & PRIMITIVE_ALL_CURVE) != 0; stack_store_float(stack, out_offset, data); break; } case NODE_INFO_CURVE_INTERCEPT: break; /* handled as attribute */ case NODE_INFO_CURVE_RANDOM: break; /* handled as attribute */ case NODE_INFO_CURVE_THICKNESS: { data = curve_thickness(kg, sd); stack_store_float(stack, out_offset, data); break; } /*case NODE_INFO_CURVE_FADE: { data = sd->curve_transparency; stack_store_float(stack, out_offset, data); break; }*/ case NODE_INFO_CURVE_TANGENT_NORMAL: { data3 = curve_tangent_normal(kg, sd); stack_store_float3(stack, out_offset, data3); break; } } } #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_gradient.h000066400000000000000000000040101334742672700233100ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Gradient */ ccl_device float svm_gradient(float3 p, NodeGradientType type) { float x, y, z; x = p.x; y = p.y; z = p.z; if(type == NODE_BLEND_LINEAR) { return x; } else if(type == NODE_BLEND_QUADRATIC) { float r = fmaxf(x, 0.0f); return r*r; } else if(type == NODE_BLEND_EASING) { float r = fminf(fmaxf(x, 0.0f), 1.0f); float t = r*r; return (3.0f*t - 2.0f*t*r); } else if(type == NODE_BLEND_DIAGONAL) { return (x + y) * 0.5f; } else if(type == NODE_BLEND_RADIAL) { return atan2f(y, x) / M_2PI_F + 0.5f; } else { /* Bias a little bit for the case where p is a unit length vector, * to get exactly zero instead of a small random value depending * on float precision. */ float r = fmaxf(0.999999f - sqrtf(x*x + y*y + z*z), 0.0f); if(type == NODE_BLEND_QUADRATIC_SPHERE) return r*r; else if(type == NODE_BLEND_SPHERICAL) return r; } return 0.0f; } ccl_device void svm_node_tex_gradient(ShaderData *sd, float *stack, uint4 node) { uint type, co_offset, color_offset, fac_offset; decode_node_uchar4(node.y, &type, &co_offset, &fac_offset, &color_offset); float3 co = stack_load_float3(stack, co_offset); float f = svm_gradient(co, (NodeGradientType)type); f = saturate(f); if(stack_valid(fac_offset)) stack_store_float(stack, fac_offset, f); if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, make_float3(f, f, f)); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_hsv.h000066400000000000000000000037031334742672700223230ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SVM_HSV_H__ #define __SVM_HSV_H__ CCL_NAMESPACE_BEGIN ccl_device void svm_node_hsv(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint in_color_offset, fac_offset, out_color_offset; uint hue_offset, sat_offset, val_offset; decode_node_uchar4(node.y, &in_color_offset, &fac_offset, &out_color_offset, NULL); decode_node_uchar4(node.z, &hue_offset, &sat_offset, &val_offset, NULL); float fac = stack_load_float(stack, fac_offset); float3 in_color = stack_load_float3(stack, in_color_offset); float3 color = in_color; float hue = stack_load_float(stack, hue_offset); float sat = stack_load_float(stack, sat_offset); float val = stack_load_float(stack, val_offset); color = rgb_to_hsv(color); /* remember: fmod doesn't work for negative numbers here */ color.x += hue + 0.5f; color.x = fmodf(color.x, 1.0f); color.y *= sat; color.z *= val; color = hsv_to_rgb(color); color.x = fac*color.x + (1.0f - fac)*in_color.x; color.y = fac*color.y + (1.0f - fac)*in_color.y; color.z = fac*color.z + (1.0f - fac)*in_color.z; /* Clamp color to prevent negative values caused by oversaturation. */ color.x = max(color.x, 0.0f); color.y = max(color.y, 0.0f); color.z = max(color.z, 0.0f); if(stack_valid(out_color_offset)) stack_store_float3(stack, out_color_offset, color); } CCL_NAMESPACE_END #endif /* __SVM_HSV_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_image.h000066400000000000000000000143741334742672700226130ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, uint srgb, uint use_alpha) { float4 r = kernel_tex_image_interp(kg, id, x, y); const float alpha = r.w; if(use_alpha && alpha != 1.0f && alpha != 0.0f) { r /= alpha; const int texture_type = kernel_tex_type(id); if(texture_type == IMAGE_DATA_TYPE_BYTE4 || texture_type == IMAGE_DATA_TYPE_BYTE) { r = min(r, make_float4(1.0f, 1.0f, 1.0f, 1.0f)); } r.w = alpha; } if(srgb) { r = color_srgb_to_scene_linear_v4(r); } return r; } /* Remap coordnate from 0..1 box to -1..-1 */ ccl_device_inline float3 texco_remap_square(float3 co) { return (co - make_float3(0.5f, 0.5f, 0.5f)) * 2.0f; } ccl_device void svm_node_tex_image(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint id = node.y; uint co_offset, out_offset, alpha_offset, srgb; decode_node_uchar4(node.z, &co_offset, &out_offset, &alpha_offset, &srgb); float3 co = stack_load_float3(stack, co_offset); float2 tex_co; uint use_alpha = stack_valid(alpha_offset); if(node.w == NODE_IMAGE_PROJ_SPHERE) { co = texco_remap_square(co); tex_co = map_to_sphere(co); } else if(node.w == NODE_IMAGE_PROJ_TUBE) { co = texco_remap_square(co); tex_co = map_to_tube(co); } else { tex_co = make_float2(co.x, co.y); } float4 f = svm_image_texture(kg, id, tex_co.x, tex_co.y, srgb, use_alpha); if(stack_valid(out_offset)) stack_store_float3(stack, out_offset, make_float3(f.x, f.y, f.z)); if(stack_valid(alpha_offset)) stack_store_float(stack, alpha_offset, f.w); } ccl_device void svm_node_tex_image_box(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { /* get object space normal */ float3 N = sd->N; N = sd->N; object_inverse_normal_transform(kg, sd, &N); /* project from direction vector to barycentric coordinates in triangles */ float3 signed_N = N; N.x = fabsf(N.x); N.y = fabsf(N.y); N.z = fabsf(N.z); N /= (N.x + N.y + N.z); /* basic idea is to think of this as a triangle, each corner representing * one of the 3 faces of the cube. in the corners we have single textures, * in between we blend between two textures, and in the middle we a blend * between three textures. * * the Nxyz values are the barycentric coordinates in an equilateral * triangle, which in case of blending, in the middle has a smaller * equilateral triangle where 3 textures blend. this divides things into * 7 zones, with an if() test for each zone */ float3 weight = make_float3(0.0f, 0.0f, 0.0f); float blend = __int_as_float(node.w); float limit = 0.5f*(1.0f + blend); /* first test for corners with single texture */ if(N.x > limit*(N.x + N.y) && N.x > limit*(N.x + N.z)) { weight.x = 1.0f; } else if(N.y > limit*(N.x + N.y) && N.y > limit*(N.y + N.z)) { weight.y = 1.0f; } else if(N.z > limit*(N.x + N.z) && N.z > limit*(N.y + N.z)) { weight.z = 1.0f; } else if(blend > 0.0f) { /* in case of blending, test for mixes between two textures */ if(N.z < (1.0f - limit)*(N.y + N.x)) { weight.x = N.x/(N.x + N.y); weight.x = saturate((weight.x - 0.5f*(1.0f - blend))/blend); weight.y = 1.0f - weight.x; } else if(N.x < (1.0f - limit)*(N.y + N.z)) { weight.y = N.y/(N.y + N.z); weight.y = saturate((weight.y - 0.5f*(1.0f - blend))/blend); weight.z = 1.0f - weight.y; } else if(N.y < (1.0f - limit)*(N.x + N.z)) { weight.x = N.x/(N.x + N.z); weight.x = saturate((weight.x - 0.5f*(1.0f - blend))/blend); weight.z = 1.0f - weight.x; } else { /* last case, we have a mix between three */ weight.x = ((2.0f - limit)*N.x + (limit - 1.0f))/(2.0f*limit - 1.0f); weight.y = ((2.0f - limit)*N.y + (limit - 1.0f))/(2.0f*limit - 1.0f); weight.z = ((2.0f - limit)*N.z + (limit - 1.0f))/(2.0f*limit - 1.0f); } } else { /* Desperate mode, no valid choice anyway, fallback to one side.*/ weight.x = 1.0f; } /* now fetch textures */ uint co_offset, out_offset, alpha_offset, srgb; decode_node_uchar4(node.z, &co_offset, &out_offset, &alpha_offset, &srgb); float3 co = stack_load_float3(stack, co_offset); uint id = node.y; float4 f = make_float4(0.0f, 0.0f, 0.0f, 0.0f); uint use_alpha = stack_valid(alpha_offset); /* Map so that no textures are flipped, rotation is somewhat arbitrary. */ if(weight.x > 0.0f) { float2 uv = make_float2((signed_N.x < 0.0f)? 1.0f - co.y: co.y, co.z); f += weight.x*svm_image_texture(kg, id, uv.x, uv.y, srgb, use_alpha); } if(weight.y > 0.0f) { float2 uv = make_float2((signed_N.y > 0.0f)? 1.0f - co.x: co.x, co.z); f += weight.y*svm_image_texture(kg, id, uv.x, uv.y, srgb, use_alpha); } if(weight.z > 0.0f) { float2 uv = make_float2((signed_N.z > 0.0f)? 1.0f - co.y: co.y, co.x); f += weight.z*svm_image_texture(kg, id, uv.x, uv.y, srgb, use_alpha); } if(stack_valid(out_offset)) stack_store_float3(stack, out_offset, make_float3(f.x, f.y, f.z)); if(stack_valid(alpha_offset)) stack_store_float(stack, alpha_offset, f.w); } ccl_device void svm_node_tex_environment(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint id = node.y; uint co_offset, out_offset, alpha_offset, srgb; uint projection = node.w; decode_node_uchar4(node.z, &co_offset, &out_offset, &alpha_offset, &srgb); float3 co = stack_load_float3(stack, co_offset); float2 uv; co = safe_normalize(co); if(projection == 0) uv = direction_to_equirectangular(co); else uv = direction_to_mirrorball(co); uint use_alpha = stack_valid(alpha_offset); float4 f = svm_image_texture(kg, id, uv.x, uv.y, srgb, use_alpha); if(stack_valid(out_offset)) stack_store_float3(stack, out_offset, make_float3(f.x, f.y, f.z)); if(stack_valid(alpha_offset)) stack_store_float(stack, alpha_offset, f.w); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_invert.h000066400000000000000000000022021334742672700230230ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor) { return factor*(1.0f - color) + (1.0f - factor) * color; } ccl_device void svm_node_invert(ShaderData *sd, float *stack, uint in_fac, uint in_color, uint out_color) { float factor = stack_load_float(stack, in_fac); float3 color = stack_load_float3(stack, in_color); color.x = invert(color.x, factor); color.y = invert(color.y, factor); color.z = invert(color.z, factor); if(stack_valid(out_color)) stack_store_float3(stack, out_color, color); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_light_path.h000066400000000000000000000056261334742672700236540ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Light Path Node */ ccl_device void svm_node_light_path(ShaderData *sd, ccl_addr_space PathState *state, float *stack, uint type, uint out_offset, int path_flag) { float info = 0.0f; switch(type) { case NODE_LP_camera: info = (path_flag & PATH_RAY_CAMERA)? 1.0f: 0.0f; break; case NODE_LP_shadow: info = (path_flag & PATH_RAY_SHADOW)? 1.0f: 0.0f; break; case NODE_LP_diffuse: info = (path_flag & PATH_RAY_DIFFUSE)? 1.0f: 0.0f; break; case NODE_LP_glossy: info = (path_flag & PATH_RAY_GLOSSY)? 1.0f: 0.0f; break; case NODE_LP_singular: info = (path_flag & PATH_RAY_SINGULAR)? 1.0f: 0.0f; break; case NODE_LP_reflection: info = (path_flag & PATH_RAY_REFLECT)? 1.0f: 0.0f; break; case NODE_LP_transmission: info = (path_flag & PATH_RAY_TRANSMIT)? 1.0f: 0.0f; break; case NODE_LP_volume_scatter: info = (path_flag & PATH_RAY_VOLUME_SCATTER)? 1.0f: 0.0f; break; case NODE_LP_backfacing: info = (sd->flag & SD_BACKFACING)? 1.0f: 0.0f; break; case NODE_LP_ray_length: info = sd->ray_length; break; case NODE_LP_ray_depth: info = (float)state->bounce; break; case NODE_LP_ray_diffuse: info = (float)state->diffuse_bounce; break; case NODE_LP_ray_glossy: info = (float)state->glossy_bounce; break; case NODE_LP_ray_transparent: info = (float)state->transparent_bounce; break; case NODE_LP_ray_transmission: info = (float)state->transmission_bounce; break; } stack_store_float(stack, out_offset, info); } /* Light Falloff Node */ ccl_device void svm_node_light_falloff(ShaderData *sd, float *stack, uint4 node) { uint strength_offset, out_offset, smooth_offset; decode_node_uchar4(node.z, &strength_offset, &smooth_offset, &out_offset, NULL); float strength = stack_load_float(stack, strength_offset); uint type = node.y; switch(type) { case NODE_LIGHT_FALLOFF_QUADRATIC: break; case NODE_LIGHT_FALLOFF_LINEAR: strength *= sd->ray_length; break; case NODE_LIGHT_FALLOFF_CONSTANT: strength *= sd->ray_length*sd->ray_length; break; } float smooth = stack_load_float(stack, smooth_offset); if(smooth > 0.0f) { float squared = sd->ray_length*sd->ray_length; /* Distant lamps set the ray length to FLT_MAX, which causes squared to overflow. */ if(isfinite(squared)) { strength *= squared/(smooth + squared); } } stack_store_float(stack, out_offset, strength); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_magic.h000066400000000000000000000051211334742672700225770ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Magic */ ccl_device_noinline float3 svm_magic(float3 p, int n, float distortion) { float x = sinf((p.x + p.y + p.z)*5.0f); float y = cosf((-p.x + p.y - p.z)*5.0f); float z = -cosf((-p.x - p.y + p.z)*5.0f); if(n > 0) { x *= distortion; y *= distortion; z *= distortion; y = -cosf(x-y+z); y *= distortion; if(n > 1) { x = cosf(x-y-z); x *= distortion; if(n > 2) { z = sinf(-x-y-z); z *= distortion; if(n > 3) { x = -cosf(-x+y-z); x *= distortion; if(n > 4) { y = -sinf(-x+y+z); y *= distortion; if(n > 5) { y = -cosf(-x+y+z); y *= distortion; if(n > 6) { x = cosf(x+y+z); x *= distortion; if(n > 7) { z = sinf(x+y-z); z *= distortion; if(n > 8) { x = -cosf(-x-y+z); x *= distortion; if(n > 9) { y = -sinf(x-y+z); y *= distortion; } } } } } } } } } } if(distortion != 0.0f) { distortion *= 2.0f; x /= distortion; y /= distortion; z /= distortion; } return make_float3(0.5f - x, 0.5f - y, 0.5f - z); } ccl_device void svm_node_tex_magic(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint depth; uint scale_offset, distortion_offset, co_offset, fac_offset, color_offset; decode_node_uchar4(node.y, &depth, &color_offset, &fac_offset, NULL); decode_node_uchar4(node.z, &co_offset, &scale_offset, &distortion_offset, NULL); uint4 node2 = read_node(kg, offset); float3 co = stack_load_float3(stack, co_offset); float scale = stack_load_float_default(stack, scale_offset, node2.x); float distortion = stack_load_float_default(stack, distortion_offset, node2.y); float3 color = svm_magic(co*scale, depth, distortion); if(stack_valid(fac_offset)) stack_store_float(stack, fac_offset, average(color)); if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, color); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_mapping.h000066400000000000000000000027111334742672700231540ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Mapping Node */ ccl_device void svm_node_mapping(KernelGlobals *kg, ShaderData *sd, float *stack, uint vec_offset, uint out_offset, int *offset) { float3 v = stack_load_float3(stack, vec_offset); Transform tfm; tfm.x = read_node_float(kg, offset); tfm.y = read_node_float(kg, offset); tfm.z = read_node_float(kg, offset); tfm.w = read_node_float(kg, offset); float3 r = transform_point(&tfm, v); stack_store_float3(stack, out_offset, r); } ccl_device void svm_node_min_max(KernelGlobals *kg, ShaderData *sd, float *stack, uint vec_offset, uint out_offset, int *offset) { float3 v = stack_load_float3(stack, vec_offset); float3 mn = float4_to_float3(read_node_float(kg, offset)); float3 mx = float4_to_float3(read_node_float(kg, offset)); float3 r = min(max(mn, v), mx); stack_store_float3(stack, out_offset, r); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_math.h000066400000000000000000000030371334742672700224540ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Nodes */ ccl_device void svm_node_math(KernelGlobals *kg, ShaderData *sd, float *stack, uint itype, uint f1_offset, uint f2_offset, int *offset) { NodeMath type = (NodeMath)itype; float f1 = stack_load_float(stack, f1_offset); float f2 = stack_load_float(stack, f2_offset); float f = svm_math(type, f1, f2); uint4 node1 = read_node(kg, offset); stack_store_float(stack, node1.y, f); } ccl_device void svm_node_vector_math(KernelGlobals *kg, ShaderData *sd, float *stack, uint itype, uint v1_offset, uint v2_offset, int *offset) { NodeVectorMath type = (NodeVectorMath)itype; float3 v1 = stack_load_float3(stack, v1_offset); float3 v2 = stack_load_float3(stack, v2_offset); float f; float3 v; svm_vector_math(&f, &v, type, v1, v2); uint4 node1 = read_node(kg, offset); if(stack_valid(node1.y)) stack_store_float(stack, node1.y, f); if(stack_valid(node1.z)) stack_store_float3(stack, node1.z, v); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_math_util.h000066400000000000000000000125351334742672700235140ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device float average_fac(float3 v) { return (fabsf(v.x) + fabsf(v.y) + fabsf(v.z))/3.0f; } ccl_device void svm_vector_math(float *Fac, float3 *Vector, NodeVectorMath type, float3 Vector1, float3 Vector2) { if(type == NODE_VECTOR_MATH_ADD) { *Vector = Vector1 + Vector2; *Fac = average_fac(*Vector); } else if(type == NODE_VECTOR_MATH_SUBTRACT) { *Vector = Vector1 - Vector2; *Fac = average_fac(*Vector); } else if(type == NODE_VECTOR_MATH_AVERAGE) { *Vector = safe_normalize_len(Vector1 + Vector2, Fac); } else if(type == NODE_VECTOR_MATH_DOT_PRODUCT) { *Fac = dot(Vector1, Vector2); *Vector = make_float3(0.0f, 0.0f, 0.0f); } else if(type == NODE_VECTOR_MATH_CROSS_PRODUCT) { *Vector = safe_normalize_len(cross(Vector1, Vector2), Fac); } else if(type == NODE_VECTOR_MATH_NORMALIZE) { *Vector = safe_normalize_len(Vector1, Fac); } else { *Fac = 0.0f; *Vector = make_float3(0.0f, 0.0f, 0.0f); } } ccl_device float svm_math(NodeMath type, float Fac1, float Fac2) { float Fac; if(type == NODE_MATH_ADD) Fac = Fac1 + Fac2; else if(type == NODE_MATH_SUBTRACT) Fac = Fac1 - Fac2; else if(type == NODE_MATH_MULTIPLY) Fac = Fac1*Fac2; else if(type == NODE_MATH_DIVIDE) Fac = safe_divide(Fac1, Fac2); else if(type == NODE_MATH_SINE) Fac = sinf(Fac1); else if(type == NODE_MATH_COSINE) Fac = cosf(Fac1); else if(type == NODE_MATH_TANGENT) Fac = tanf(Fac1); else if(type == NODE_MATH_ARCSINE) Fac = safe_asinf(Fac1); else if(type == NODE_MATH_ARCCOSINE) Fac = safe_acosf(Fac1); else if(type == NODE_MATH_ARCTANGENT) Fac = atanf(Fac1); else if(type == NODE_MATH_POWER) Fac = safe_powf(Fac1, Fac2); else if(type == NODE_MATH_LOGARITHM) Fac = safe_logf(Fac1, Fac2); else if(type == NODE_MATH_MINIMUM) Fac = fminf(Fac1, Fac2); else if(type == NODE_MATH_MAXIMUM) Fac = fmaxf(Fac1, Fac2); else if(type == NODE_MATH_ROUND) Fac = floorf(Fac1 + 0.5f); else if(type == NODE_MATH_LESS_THAN) Fac = Fac1 < Fac2; else if(type == NODE_MATH_GREATER_THAN) Fac = Fac1 > Fac2; else if(type == NODE_MATH_MODULO) Fac = safe_modulo(Fac1, Fac2); else if(type == NODE_MATH_ABSOLUTE) Fac = fabsf(Fac1); else if(type == NODE_MATH_CLAMP) Fac = saturate(Fac1); else Fac = 0.0f; return Fac; } /* Calculate color in range 800..12000 using an approximation * a/x+bx+c for R and G and ((at + b)t + c)t + d) for B * Max absolute error for RGB is (0.00095, 0.00077, 0.00057), * which is enough to get the same 8 bit/channel color. */ ccl_static_constant float blackbody_table_r[6][3] = { { 2.52432244e+03f, -1.06185848e-03f, 3.11067539e+00f }, { 3.37763626e+03f, -4.34581697e-04f, 1.64843306e+00f }, { 4.10671449e+03f, -8.61949938e-05f, 6.41423749e-01f }, { 4.66849800e+03f, 2.85655028e-05f, 1.29075375e-01f }, { 4.60124770e+03f, 2.89727618e-05f, 1.48001316e-01f }, { 3.78765709e+03f, 9.36026367e-06f, 3.98995841e-01f }, }; ccl_static_constant float blackbody_table_g[6][3] = { { -7.50343014e+02f, 3.15679613e-04f, 4.73464526e-01f }, { -1.00402363e+03f, 1.29189794e-04f, 9.08181524e-01f }, { -1.22075471e+03f, 2.56245413e-05f, 1.20753416e+00f }, { -1.42546105e+03f, -4.01730887e-05f, 1.44002695e+00f }, { -1.18134453e+03f, -2.18913373e-05f, 1.30656109e+00f }, { -5.00279505e+02f, -4.59745390e-06f, 1.09090465e+00f }, }; ccl_static_constant float blackbody_table_b[6][4] = { { 0.0f, 0.0f, 0.0f, 0.0f }, /* zeros should be optimized by compiler */ { 0.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 0.0f }, { -2.02524603e-11f, 1.79435860e-07f, -2.60561875e-04f, -1.41761141e-02f }, { -2.22463426e-13f, -1.55078698e-08f, 3.81675160e-04f, -7.30646033e-01f }, { 6.72595954e-13f, -2.73059993e-08f, 4.24068546e-04f, -7.52204323e-01f }, }; ccl_device float3 svm_math_blackbody_color(float t) { if(t >= 12000.0f) { return make_float3(0.826270103f, 0.994478524f, 1.56626022f); } else if(t < 965.0f) { /* For 800 <= t < 965 color does not change in OSL implementation, so keep color the same */ return make_float3(4.70366907f, 0.0f, 0.0f); } int i = (t >= 6365.0f)? 5: (t >= 3315.0f)? 4: (t >= 1902.0f)? 3: (t >= 1449.0f)? 2: (t >= 1167.0f)? 1: 0; ccl_constant float *r = blackbody_table_r[i]; ccl_constant float *g = blackbody_table_g[i]; ccl_constant float *b = blackbody_table_b[i]; const float t_inv = 1.0f / t; return make_float3(r[0] * t_inv + r[1] * t + r[2], g[0] * t_inv + g[1] * t + g[2], ((b[0] * t + b[1]) * t + b[2]) * t + b[3]); } ccl_device_inline float3 svm_math_gamma_color(float3 color, float gamma) { if(gamma == 0.0f) return make_float3(1.0f, 1.0f, 1.0f); if(color.x > 0.0f) color.x = powf(color.x, gamma); if(color.y > 0.0f) color.y = powf(color.y, gamma); if(color.z > 0.0f) color.z = powf(color.z, gamma); return color; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_mix.h000066400000000000000000000021341334742672700223150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Node */ ccl_device void svm_node_mix(KernelGlobals *kg, ShaderData *sd, float *stack, uint fac_offset, uint c1_offset, uint c2_offset, int *offset) { /* read extra data */ uint4 node1 = read_node(kg, offset); float fac = stack_load_float(stack, fac_offset); float3 c1 = stack_load_float3(stack, c1_offset); float3 c2 = stack_load_float3(stack, c2_offset); float3 result = svm_mix((NodeMix)node1.y, fac, c1, c2); stack_store_float3(stack, node1.z, result); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_musgrave.h000066400000000000000000000153031334742672700233530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Musgrave fBm * * H: fractal increment parameter * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * * from "Texturing and Modelling: A procedural approach" */ ccl_device_noinline float noise_musgrave_fBm(float3 p, float H, float lacunarity, float octaves) { float rmd; float value = 0.0f; float pwr = 1.0f; float pwHL = powf(lacunarity, -H); int i; for(i = 0; i < float_to_int(octaves); i++) { value += snoise(p) * pwr; pwr *= pwHL; p *= lacunarity; } rmd = octaves - floorf(octaves); if(rmd != 0.0f) value += rmd * snoise(p) * pwr; return value; } /* Musgrave Multifractal * * H: highest fractal dimension * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm */ ccl_device_noinline float noise_musgrave_multi_fractal(float3 p, float H, float lacunarity, float octaves) { float rmd; float value = 1.0f; float pwr = 1.0f; float pwHL = powf(lacunarity, -H); int i; for(i = 0; i < float_to_int(octaves); i++) { value *= (pwr * snoise(p) + 1.0f); pwr *= pwHL; p *= lacunarity; } rmd = octaves - floorf(octaves); if(rmd != 0.0f) value *= (rmd * pwr * snoise(p) + 1.0f); /* correct? */ return value; } /* Musgrave Heterogeneous Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * offset: raises the terrain from `sea level' */ ccl_device_noinline float noise_musgrave_hetero_terrain(float3 p, float H, float lacunarity, float octaves, float offset) { float value, increment, rmd; float pwHL = powf(lacunarity, -H); float pwr = pwHL; int i; /* first unscaled octave of function; later octaves are scaled */ value = offset + snoise(p); p *= lacunarity; for(i = 1; i < float_to_int(octaves); i++) { increment = (snoise(p) + offset) * pwr * value; value += increment; pwr *= pwHL; p *= lacunarity; } rmd = octaves - floorf(octaves); if(rmd != 0.0f) { increment = (snoise(p) + offset) * pwr * value; value += rmd * increment; } return value; } /* Hybrid Additive/Multiplicative Multifractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * offset: raises the terrain from `sea level' */ ccl_device_noinline float noise_musgrave_hybrid_multi_fractal(float3 p, float H, float lacunarity, float octaves, float offset, float gain) { float result, signal, weight, rmd; float pwHL = powf(lacunarity, -H); float pwr = pwHL; int i; result = snoise(p) + offset; weight = gain * result; p *= lacunarity; for(i = 1; (weight > 0.001f) && (i < float_to_int(octaves)); i++) { if(weight > 1.0f) weight = 1.0f; signal = (snoise(p) + offset) * pwr; pwr *= pwHL; result += weight * signal; weight *= gain * signal; p *= lacunarity; } rmd = octaves - floorf(octaves); if(rmd != 0.0f) result += rmd * ((snoise(p) + offset) * pwr); return result; } /* Ridged Multifractal Terrain * * H: fractal dimension of the roughest area * lacunarity: gap between successive frequencies * octaves: number of frequencies in the fBm * offset: raises the terrain from `sea level' */ ccl_device_noinline float noise_musgrave_ridged_multi_fractal(float3 p, float H, float lacunarity, float octaves, float offset, float gain) { float result, signal, weight; float pwHL = powf(lacunarity, -H); float pwr = pwHL; int i; signal = offset - fabsf(snoise(p)); signal *= signal; result = signal; weight = 1.0f; for(i = 1; i < float_to_int(octaves); i++) { p *= lacunarity; weight = saturate(signal * gain); signal = offset - fabsf(snoise(p)); signal *= signal; signal *= weight; result += signal * pwr; pwr *= pwHL; } return result; } /* Shader */ ccl_device float svm_musgrave(NodeMusgraveType type, float dimension, float lacunarity, float octaves, float offset, float intensity, float gain, float3 p) { if(type == NODE_MUSGRAVE_MULTIFRACTAL) return intensity*noise_musgrave_multi_fractal(p, dimension, lacunarity, octaves); else if(type == NODE_MUSGRAVE_FBM) return intensity*noise_musgrave_fBm(p, dimension, lacunarity, octaves); else if(type == NODE_MUSGRAVE_HYBRID_MULTIFRACTAL) return intensity*noise_musgrave_hybrid_multi_fractal(p, dimension, lacunarity, octaves, offset, gain); else if(type == NODE_MUSGRAVE_RIDGED_MULTIFRACTAL) return intensity*noise_musgrave_ridged_multi_fractal(p, dimension, lacunarity, octaves, offset, gain); else if(type == NODE_MUSGRAVE_HETERO_TERRAIN) return intensity*noise_musgrave_hetero_terrain(p, dimension, lacunarity, octaves, offset); return 0.0f; } ccl_device void svm_node_tex_musgrave(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint4 node2 = read_node(kg, offset); uint4 node3 = read_node(kg, offset); uint type, co_offset, color_offset, fac_offset; uint dimension_offset, lacunarity_offset, detail_offset, offset_offset; uint gain_offset, scale_offset; decode_node_uchar4(node.y, &type, &co_offset, &color_offset, &fac_offset); decode_node_uchar4(node.z, &dimension_offset, &lacunarity_offset, &detail_offset, &offset_offset); decode_node_uchar4(node.w, &gain_offset, &scale_offset, NULL, NULL); float3 co = stack_load_float3(stack, co_offset); float dimension = stack_load_float_default(stack, dimension_offset, node2.x); float lacunarity = stack_load_float_default(stack, lacunarity_offset, node2.y); float detail = stack_load_float_default(stack, detail_offset, node2.z); float foffset = stack_load_float_default(stack, offset_offset, node2.w); float gain = stack_load_float_default(stack, gain_offset, node3.x); float scale = stack_load_float_default(stack, scale_offset, node3.y); dimension = fmaxf(dimension, 1e-5f); detail = clamp(detail, 0.0f, 16.0f); lacunarity = fmaxf(lacunarity, 1e-5f); float f = svm_musgrave((NodeMusgraveType)type, dimension, lacunarity, detail, foffset, 1.0f, gain, co*scale); if(stack_valid(fac_offset)) stack_store_float(stack, fac_offset, f); if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, make_float3(f, f, f)); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_noise.h000066400000000000000000000233171334742672700226430ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2011, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ CCL_NAMESPACE_BEGIN #ifndef __KERNEL_SSE2__ ccl_device int quick_floor(float x) { return float_to_int(x) - ((x < 0) ? 1 : 0); } #else ccl_device_inline ssei quick_floor_sse(const ssef& x) { ssei b = truncatei(x); ssei isneg = cast((x < ssef(0.0f)).m128); return b + isneg; // unsaturated add 0xffffffff is the same as subtract -1 } #endif #ifndef __KERNEL_SSE2__ ccl_device float bits_to_01(uint bits) { return bits * (1.0f/(float)0xFFFFFFFF); } #else ccl_device_inline ssef bits_to_01_sse(const ssei& bits) { return uint32_to_float(bits) * ssef(1.0f/(float)0xFFFFFFFF); } #endif ccl_device uint hash(uint kx, uint ky, uint kz) { // define some handy macros #define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) #define final(a,b,c) \ { \ c ^= b; c -= rot(b,14); \ a ^= c; a -= rot(c,11); \ b ^= a; b -= rot(a,25); \ c ^= b; c -= rot(b,16); \ a ^= c; a -= rot(c,4); \ b ^= a; b -= rot(a,14); \ c ^= b; c -= rot(b,24); \ } // now hash the data! uint a, b, c, len = 3; a = b = c = 0xdeadbeef + (len << 2) + 13; c += kz; b += ky; a += kx; final(a, b, c); return c; // macros not needed anymore #undef rot #undef final } #ifdef __KERNEL_SSE2__ ccl_device_inline ssei hash_sse(const ssei& kx, const ssei& ky, const ssei& kz) { # define rot(x,k) (((x)<<(k)) | (srl(x, 32-(k)))) # define xor_rot(a, b, c) do {a = a^b; a = a - rot(b, c);} while(0) uint len = 3; ssei magic = ssei(0xdeadbeef + (len << 2) + 13); ssei a = magic + kx; ssei b = magic + ky; ssei c = magic + kz; xor_rot(c, b, 14); xor_rot(a, c, 11); xor_rot(b, a, 25); xor_rot(c, b, 16); xor_rot(a, c, 4); xor_rot(b, a, 14); xor_rot(c, b, 24); return c; # undef rot # undef xor_rot } #endif #if 0 // unused ccl_device int imod(int a, int b) { a %= b; return a < 0 ? a + b : a; } ccl_device uint phash(int kx, int ky, int kz, int3 p) { return hash(imod(kx, p.x), imod(ky, p.y), imod(kz, p.z)); } #endif #ifndef __KERNEL_SSE2__ ccl_device float floorfrac(float x, int* i) { *i = quick_floor(x); return x - *i; } #else ccl_device_inline ssef floorfrac_sse(const ssef& x, ssei *i) { *i = quick_floor_sse(x); return x - ssef(*i); } #endif #ifndef __KERNEL_SSE2__ ccl_device float fade(float t) { return t * t * t * (t * (t * 6.0f - 15.0f) + 10.0f); } #else ccl_device_inline ssef fade_sse(const ssef *t) { ssef a = madd(*t, ssef(6.0f), ssef(-15.0f)); ssef b = madd(*t, a, ssef(10.0f)); return ((*t) * (*t)) * ((*t) * b); } #endif #ifndef __KERNEL_SSE2__ ccl_device float nerp(float t, float a, float b) { return (1.0f - t) * a + t * b; } #else ccl_device_inline ssef nerp_sse(const ssef& t, const ssef& a, const ssef& b) { ssef x1 = (ssef(1.0f) - t) * a; return madd(t, b, x1); } #endif #ifndef __KERNEL_SSE2__ ccl_device float grad(int hash, float x, float y, float z) { // use vectors pointing to the edges of the cube int h = hash & 15; float u = h<8 ? x : y; float vt = ((h == 12) | (h == 14)) ? x : z; float v = h < 4 ? y : vt; return ((h&1) ? -u : u) + ((h&2) ? -v : v); } #else ccl_device_inline ssef grad_sse(const ssei& hash, const ssef& x, const ssef& y, const ssef& z) { ssei c1 = ssei(1); ssei c2 = ssei(2); ssei h = hash & ssei(15); // h = hash & 15 sseb case_ux = h < ssei(8); // 0xffffffff if h < 8 else 0 ssef u = select(case_ux, x, y); // u = h<8 ? x : y sseb case_vy = h < ssei(4); // 0xffffffff if h < 4 else 0 sseb case_h12 = h == ssei(12); // 0xffffffff if h == 12 else 0 sseb case_h14 = h == ssei(14); // 0xffffffff if h == 14 else 0 sseb case_vx = case_h12 | case_h14; // 0xffffffff if h == 12 or h == 14 else 0 ssef v = select(case_vy, y, select(case_vx, x, z)); // v = h<4 ? y : h == 12 || h == 14 ? x : z ssei case_uneg = (h & c1) << 31; // 1<<31 if h&1 else 0 ssef case_uneg_mask = cast(case_uneg); // -0.0 if h&1 else +0.0 ssef ru = u ^ case_uneg_mask; // -u if h&1 else u (copy float sign) ssei case_vneg = (h & c2) << 30; // 2<<30 if h&2 else 0 ssef case_vneg_mask = cast(case_vneg); // -0.0 if h&2 else +0.0 ssef rv = v ^ case_vneg_mask; // -v if h&2 else v (copy float sign) ssef r = ru + rv; // ((h&1) ? -u : u) + ((h&2) ? -v : v) return r; } #endif #ifndef __KERNEL_SSE2__ ccl_device float scale3(float result) { return 0.9820f * result; } #else ccl_device_inline ssef scale3_sse(const ssef& result) { return ssef(0.9820f) * result; } #endif #ifndef __KERNEL_SSE2__ ccl_device_noinline float perlin(float x, float y, float z) { int X; float fx = floorfrac(x, &X); int Y; float fy = floorfrac(y, &Y); int Z; float fz = floorfrac(z, &Z); float u = fade(fx); float v = fade(fy); float w = fade(fz); float result; result = nerp (w, nerp (v, nerp (u, grad (hash (X , Y , Z ), fx , fy , fz ), grad (hash (X+1, Y , Z ), fx-1.0f, fy , fz )), nerp (u, grad (hash (X , Y+1, Z ), fx , fy-1.0f, fz ), grad (hash (X+1, Y+1, Z ), fx-1.0f, fy-1.0f, fz ))), nerp (v, nerp (u, grad (hash (X , Y , Z+1), fx , fy , fz-1.0f ), grad (hash (X+1, Y , Z+1), fx-1.0f, fy , fz-1.0f )), nerp (u, grad (hash (X , Y+1, Z+1), fx , fy-1.0f, fz-1.0f ), grad (hash (X+1, Y+1, Z+1), fx-1.0f, fy-1.0f, fz-1.0f )))); float r = scale3(result); /* can happen for big coordinates, things even out to 0.0 then anyway */ return (isfinite(r))? r: 0.0f; } #else ccl_device_noinline float perlin(float x, float y, float z) { ssef xyz = ssef(x, y, z, 0.0f); ssei XYZ; ssef fxyz = floorfrac_sse(xyz, &XYZ); ssef uvw = fade_sse(&fxyz); ssef u = shuffle<0>(uvw), v = shuffle<1>(uvw), w = shuffle<2>(uvw); ssei XYZ_ofc = XYZ + ssei(1); ssei vdy = shuffle<1, 1, 1, 1>(XYZ, XYZ_ofc); // +0, +0, +1, +1 ssei vdz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZ, XYZ_ofc)); // +0, +1, +0, +1 ssei h1 = hash_sse(shuffle<0>(XYZ), vdy, vdz); // hash directions 000, 001, 010, 011 ssei h2 = hash_sse(shuffle<0>(XYZ_ofc), vdy, vdz); // hash directions 100, 101, 110, 111 ssef fxyz_ofc = fxyz - ssef(1.0f); ssef vfy = shuffle<1, 1, 1, 1>(fxyz, fxyz_ofc); ssef vfz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyz, fxyz_ofc)); ssef g1 = grad_sse(h1, shuffle<0>(fxyz), vfy, vfz); ssef g2 = grad_sse(h2, shuffle<0>(fxyz_ofc), vfy, vfz); ssef n1 = nerp_sse(u, g1, g2); ssef n1_half = shuffle<2, 3, 2, 3>(n1); // extract 2 floats to a separate vector ssef n2 = nerp_sse(v, n1, n1_half); // process nerp([a, b, _, _], [c, d, _, _]) -> [a', b', _, _] ssef n2_second = shuffle<1>(n2); // extract b to a separate vector ssef result = nerp_sse(w, n2, n2_second); // process nerp([a', _, _, _], [b', _, _, _]) -> [a'', _, _, _] ssef r = scale3_sse(result); ssef infmask = cast(ssei(0x7f800000)); ssef rinfmask = ((r & infmask) == infmask).m128; // 0xffffffff if r is inf/-inf/nan else 0 ssef rfinite = andnot(rinfmask, r); // 0 if r is inf/-inf/nan else r return extract<0>(rfinite); } #endif /* perlin noise in range 0..1 */ ccl_device float noise(float3 p) { float r = perlin(p.x, p.y, p.z); return 0.5f*r + 0.5f; } /* perlin noise in range -1..1 */ ccl_device float snoise(float3 p) { return perlin(p.x, p.y, p.z); } /* cell noise */ #ifndef __KERNEL_SSE2__ ccl_device_noinline float cellnoise(float3 p) { uint ix = quick_floor(p.x); uint iy = quick_floor(p.y); uint iz = quick_floor(p.z); return bits_to_01(hash(ix, iy, iz)); } ccl_device float3 cellnoise_color(float3 p) { float r = cellnoise(p); float g = cellnoise(make_float3(p.y, p.x, p.z)); float b = cellnoise(make_float3(p.y, p.z, p.x)); return make_float3(r, g, b); } #else ccl_device ssef cellnoise_color(const ssef& p) { ssei ip = quick_floor_sse(p); ssei ip_yxz = shuffle<1, 0, 2, 3>(ip); ssei ip_xyy = shuffle<0, 1, 1, 3>(ip); ssei ip_zzx = shuffle<2, 2, 0, 3>(ip); return bits_to_01_sse(hash_sse(ip_xyy, ip_yxz, ip_zzx)); } #endif CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_noisetex.h000066400000000000000000000036231334742672700233620ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Noise */ ccl_device void svm_node_tex_noise(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint co_offset, scale_offset, detail_offset, distortion_offset, fac_offset, color_offset; decode_node_uchar4(node.y, &co_offset, &scale_offset, &detail_offset, &distortion_offset); decode_node_uchar4(node.z, &color_offset, &fac_offset, NULL, NULL); uint4 node2 = read_node(kg, offset); float scale = stack_load_float_default(stack, scale_offset, node2.x); float detail = stack_load_float_default(stack, detail_offset, node2.y); float distortion = stack_load_float_default(stack, distortion_offset, node2.z); float3 p = stack_load_float3(stack, co_offset) * scale; int hard = 0; if(distortion != 0.0f) { float3 r, offset = make_float3(13.5f, 13.5f, 13.5f); r.x = noise(p + offset) * distortion; r.y = noise(p) * distortion; r.z = noise(p - offset) * distortion; p += r; } float f = noise_turbulence(p, detail, hard); if(stack_valid(fac_offset)) { stack_store_float(stack, fac_offset, f); } if(stack_valid(color_offset)) { float3 color = make_float3(f, noise_turbulence(make_float3(p.y, p.x, p.z), detail, hard), noise_turbulence(make_float3(p.y, p.z, p.x), detail, hard)); stack_store_float3(stack, color_offset, color); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_normal.h000066400000000000000000000024451334742672700230150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void svm_node_normal(KernelGlobals *kg, ShaderData *sd, float *stack, uint in_normal_offset, uint out_normal_offset, uint out_dot_offset, int *offset) { /* read extra data */ uint4 node1 = read_node(kg, offset); float3 normal = stack_load_float3(stack, in_normal_offset); float3 direction; direction.x = __int_as_float(node1.x); direction.y = __int_as_float(node1.y); direction.z = __int_as_float(node1.z); direction = normalize(direction); if(stack_valid(out_normal_offset)) stack_store_float3(stack, out_normal_offset, direction); if(stack_valid(out_dot_offset)) stack_store_float(stack, out_dot_offset, dot(direction, normalize(normal))); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_ramp.h000066400000000000000000000066401334742672700224650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SVM_RAMP_H__ #define __SVM_RAMP_H__ CCL_NAMESPACE_BEGIN /* NOTE: svm_ramp.h, svm_ramp_util.h and node_ramp_util.h must stay consistent */ ccl_device_inline float4 rgb_ramp_lookup(KernelGlobals *kg, int offset, float f, bool interpolate, bool extrapolate, int table_size) { if((f < 0.0f || f > 1.0f) && extrapolate) { float4 t0, dy; if(f < 0.0f) { t0 = fetch_node_float(kg, offset); dy = t0 - fetch_node_float(kg, offset + 1); f = -f; } else { t0 = fetch_node_float(kg, offset + table_size - 1); dy = t0 - fetch_node_float(kg, offset + table_size - 2); f = f - 1.0f; } return t0 + dy * f * (table_size-1); } f = saturate(f)*(table_size-1); /* clamp int as well in case of NaN */ int i = clamp(float_to_int(f), 0, table_size-1); float t = f - (float)i; float4 a = fetch_node_float(kg, offset+i); if(interpolate && t > 0.0f) a = (1.0f - t)*a + t*fetch_node_float(kg, offset+i+1); return a; } ccl_device void svm_node_rgb_ramp(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint fac_offset, color_offset, alpha_offset; uint interpolate = node.z; decode_node_uchar4(node.y, &fac_offset, &color_offset, &alpha_offset, NULL); uint table_size = read_node(kg, offset).x; float fac = stack_load_float(stack, fac_offset); float4 color = rgb_ramp_lookup(kg, *offset, fac, interpolate, false, table_size); if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, float4_to_float3(color)); if(stack_valid(alpha_offset)) stack_store_float(stack, alpha_offset, color.w); *offset += table_size; } ccl_device void svm_node_curves(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint fac_offset, color_offset, out_offset; decode_node_uchar4(node.y, &fac_offset, &color_offset, &out_offset, NULL); uint table_size = read_node(kg, offset).x; float fac = stack_load_float(stack, fac_offset); float3 color = stack_load_float3(stack, color_offset); const float min_x = __int_as_float(node.z), max_x = __int_as_float(node.w); const float range_x = max_x - min_x; const float3 relpos = (color - make_float3(min_x, min_x, min_x)) / range_x; float r = rgb_ramp_lookup(kg, *offset, relpos.x, true, true, table_size).x; float g = rgb_ramp_lookup(kg, *offset, relpos.y, true, true, table_size).y; float b = rgb_ramp_lookup(kg, *offset, relpos.z, true, true, table_size).z; color = (1.0f - fac)*color + fac*make_float3(r, g, b); stack_store_float3(stack, out_offset, color); *offset += table_size; } CCL_NAMESPACE_END #endif /* __SVM_RAMP_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_ramp_util.h000066400000000000000000000046771334742672700235320ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SVM_RAMP_UTIL_H__ #define __SVM_RAMP_UTIL_H__ CCL_NAMESPACE_BEGIN /* NOTE: svm_ramp.h, svm_ramp_util.h and node_ramp_util.h must stay consistent */ ccl_device_inline float3 rgb_ramp_lookup(const float3 *ramp, float f, bool interpolate, bool extrapolate, int table_size) { if((f < 0.0f || f > 1.0f) && extrapolate) { float3 t0, dy; if(f < 0.0f) { t0 = ramp[0]; dy = t0 - ramp[1], f = -f; } else { t0 = ramp[table_size - 1]; dy = t0 - ramp[table_size - 2]; f = f - 1.0f; } return t0 + dy * f * (table_size - 1); } f = clamp(f, 0.0f, 1.0f) * (table_size - 1); /* clamp int as well in case of NaN */ int i = clamp(float_to_int(f), 0, table_size-1); float t = f - (float)i; float3 result = ramp[i]; if(interpolate && t > 0.0f) { result = (1.0f - t) * result + t * ramp[i + 1]; } return result; } ccl_device float float_ramp_lookup(const float *ramp, float f, bool interpolate, bool extrapolate, int table_size) { if((f < 0.0f || f > 1.0f) && extrapolate) { float t0, dy; if(f < 0.0f) { t0 = ramp[0]; dy = t0 - ramp[1], f = -f; } else { t0 = ramp[table_size - 1]; dy = t0 - ramp[table_size - 2]; f = f - 1.0f; } return t0 + dy * f * (table_size - 1); } f = clamp(f, 0.0f, 1.0f) * (table_size - 1); /* clamp int as well in case of NaN */ int i = clamp(float_to_int(f), 0, table_size-1); float t = f - (float)i; float result = ramp[i]; if(interpolate && t > 0.0f) { result = (1.0f - t) * result + t * ramp[i + 1]; } return result; } CCL_NAMESPACE_END #endif /* __SVM_RAMP_UTIL_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_sepcomb_hsv.h000066400000000000000000000033431334742672700240330ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN ccl_device void svm_node_combine_hsv(KernelGlobals *kg, ShaderData *sd, float *stack, uint hue_in, uint saturation_in, uint value_in, int *offset) { uint4 node1 = read_node(kg, offset); uint color_out = node1.y; float hue = stack_load_float(stack, hue_in); float saturation = stack_load_float(stack, saturation_in); float value = stack_load_float(stack, value_in); /* Combine, and convert back to RGB */ float3 color = hsv_to_rgb(make_float3(hue, saturation, value)); if(stack_valid(color_out)) stack_store_float3(stack, color_out, color); } ccl_device void svm_node_separate_hsv(KernelGlobals *kg, ShaderData *sd, float *stack, uint color_in, uint hue_out, uint saturation_out, int *offset) { uint4 node1 = read_node(kg, offset); uint value_out = node1.y; float3 color = stack_load_float3(stack, color_in); /* Convert to HSV */ color = rgb_to_hsv(color); if(stack_valid(hue_out)) stack_store_float(stack, hue_out, color.x); if(stack_valid(saturation_out)) stack_store_float(stack, saturation_out, color.y); if(stack_valid(value_out)) stack_store_float(stack, value_out, color.z); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_sepcomb_vector.h000066400000000000000000000026131334742672700245340ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Vector combine / separate, used for the RGB and XYZ nodes */ ccl_device void svm_node_combine_vector(ShaderData *sd, float *stack, uint in_offset, uint vector_index, uint out_offset) { float vector = stack_load_float(stack, in_offset); if(stack_valid(out_offset)) stack_store_float(stack, out_offset+vector_index, vector); } ccl_device void svm_node_separate_vector(ShaderData *sd, float *stack, uint ivector_offset, uint vector_index, uint out_offset) { float3 vector = stack_load_float3(stack, ivector_offset); if(stack_valid(out_offset)) { if(vector_index == 0) stack_store_float(stack, out_offset, vector.x); else if(vector_index == 1) stack_store_float(stack, out_offset, vector.y); else stack_store_float(stack, out_offset, vector.z); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_sky.h000066400000000000000000000131621334742672700223310ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Sky texture */ ccl_device float sky_angle_between(float thetav, float phiv, float theta, float phi) { float cospsi = sinf(thetav)*sinf(theta)*cosf(phi - phiv) + cosf(thetav)*cosf(theta); return safe_acosf(cospsi); } /* * "A Practical Analytic Model for Daylight" * A. J. Preetham, Peter Shirley, Brian Smits */ ccl_device float sky_perez_function(float *lam, float theta, float gamma) { float ctheta = cosf(theta); float cgamma = cosf(gamma); return (1.0f + lam[0]*expf(lam[1]/ctheta)) * (1.0f + lam[2]*expf(lam[3]*gamma) + lam[4]*cgamma*cgamma); } ccl_device float3 sky_radiance_old(KernelGlobals *kg, float3 dir, float sunphi, float suntheta, float radiance_x, float radiance_y, float radiance_z, float *config_x, float *config_y, float *config_z) { /* convert vector to spherical coordinates */ float2 spherical = direction_to_spherical(dir); float theta = spherical.x; float phi = spherical.y; /* angle between sun direction and dir */ float gamma = sky_angle_between(theta, phi, suntheta, sunphi); /* clamp theta to horizon */ theta = min(theta, M_PI_2_F - 0.001f); /* compute xyY color space values */ float x = radiance_y * sky_perez_function(config_y, theta, gamma); float y = radiance_z * sky_perez_function(config_z, theta, gamma); float Y = radiance_x * sky_perez_function(config_x, theta, gamma); /* convert to RGB */ float3 xyz = xyY_to_xyz(x, y, Y); return xyz_to_rgb(xyz.x, xyz.y, xyz.z); } /* * "An Analytic Model for Full Spectral Sky-Dome Radiance" * Lukas Hosek, Alexander Wilkie */ ccl_device float sky_radiance_internal(float *configuration, float theta, float gamma) { float ctheta = cosf(theta); float cgamma = cosf(gamma); float expM = expf(configuration[4] * gamma); float rayM = cgamma * cgamma; float mieM = (1.0f + rayM) / powf((1.0f + configuration[8]*configuration[8] - 2.0f*configuration[8]*cgamma), 1.5f); float zenith = sqrtf(ctheta); return (1.0f + configuration[0] * expf(configuration[1] / (ctheta + 0.01f))) * (configuration[2] + configuration[3] * expM + configuration[5] * rayM + configuration[6] * mieM + configuration[7] * zenith); } ccl_device float3 sky_radiance_new(KernelGlobals *kg, float3 dir, float sunphi, float suntheta, float radiance_x, float radiance_y, float radiance_z, float *config_x, float *config_y, float *config_z) { /* convert vector to spherical coordinates */ float2 spherical = direction_to_spherical(dir); float theta = spherical.x; float phi = spherical.y; /* angle between sun direction and dir */ float gamma = sky_angle_between(theta, phi, suntheta, sunphi); /* clamp theta to horizon */ theta = min(theta, M_PI_2_F - 0.001f); /* compute xyz color space values */ float x = sky_radiance_internal(config_x, theta, gamma) * radiance_x; float y = sky_radiance_internal(config_y, theta, gamma) * radiance_y; float z = sky_radiance_internal(config_z, theta, gamma) * radiance_z; /* convert to RGB and adjust strength */ return xyz_to_rgb(x, y, z) * (M_2PI_F/683); } ccl_device void svm_node_tex_sky(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { /* Define variables */ float sunphi, suntheta, radiance_x, radiance_y, radiance_z; float config_x[9], config_y[9], config_z[9]; /* Load data */ uint dir_offset = node.y; uint out_offset = node.z; int sky_model = node.w; float4 data = read_node_float(kg, offset); sunphi = data.x; suntheta = data.y; radiance_x = data.z; radiance_y = data.w; data = read_node_float(kg, offset); radiance_z = data.x; config_x[0] = data.y; config_x[1] = data.z; config_x[2] = data.w; data = read_node_float(kg, offset); config_x[3] = data.x; config_x[4] = data.y; config_x[5] = data.z; config_x[6] = data.w; data = read_node_float(kg, offset); config_x[7] = data.x; config_x[8] = data.y; config_y[0] = data.z; config_y[1] = data.w; data = read_node_float(kg, offset); config_y[2] = data.x; config_y[3] = data.y; config_y[4] = data.z; config_y[5] = data.w; data = read_node_float(kg, offset); config_y[6] = data.x; config_y[7] = data.y; config_y[8] = data.z; config_z[0] = data.w; data = read_node_float(kg, offset); config_z[1] = data.x; config_z[2] = data.y; config_z[3] = data.z; config_z[4] = data.w; data = read_node_float(kg, offset); config_z[5] = data.x; config_z[6] = data.y; config_z[7] = data.z; config_z[8] = data.w; float3 dir = stack_load_float3(stack, dir_offset); float3 f; /* Compute Sky */ if(sky_model == 0) { f = sky_radiance_old(kg, dir, sunphi, suntheta, radiance_x, radiance_y, radiance_z, config_x, config_y, config_z); } else { f = sky_radiance_new(kg, dir, sunphi, suntheta, radiance_x, radiance_y, radiance_z, config_x, config_y, config_z); } stack_store_float3(stack, out_offset, f); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_tex_coord.h000066400000000000000000000254031334742672700235120ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Texture Coordinate Node */ ccl_device void svm_node_tex_coord(KernelGlobals *kg, ShaderData *sd, int path_flag, float *stack, uint4 node, int *offset) { float3 data; uint type = node.y; uint out_offset = node.z; switch(type) { case NODE_TEXCO_OBJECT: { data = sd->P; if(node.w == 0) { if(sd->object != OBJECT_NONE) { object_inverse_position_transform(kg, sd, &data); } } else { Transform tfm; tfm.x = read_node_float(kg, offset); tfm.y = read_node_float(kg, offset); tfm.z = read_node_float(kg, offset); tfm.w = read_node_float(kg, offset); data = transform_point(&tfm, data); } break; } case NODE_TEXCO_NORMAL: { data = sd->N; object_inverse_normal_transform(kg, sd, &data); break; } case NODE_TEXCO_CAMERA: { Transform tfm = kernel_data.cam.worldtocamera; if(sd->object != OBJECT_NONE) data = transform_point(&tfm, sd->P); else data = transform_point(&tfm, sd->P + camera_position(kg)); break; } case NODE_TEXCO_WINDOW: { if((path_flag & PATH_RAY_CAMERA) && sd->object == OBJECT_NONE && kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) data = camera_world_to_ndc(kg, sd, sd->ray_P); else data = camera_world_to_ndc(kg, sd, sd->P); data.z = 0.0f; break; } case NODE_TEXCO_REFLECTION: { if(sd->object != OBJECT_NONE) data = 2.0f*dot(sd->N, sd->I)*sd->N - sd->I; else data = sd->I; break; } case NODE_TEXCO_DUPLI_GENERATED: { data = object_dupli_generated(kg, sd->object); break; } case NODE_TEXCO_DUPLI_UV: { data = object_dupli_uv(kg, sd->object); break; } case NODE_TEXCO_VOLUME_GENERATED: { data = sd->P; #ifdef __VOLUME__ if(sd->object != OBJECT_NONE) data = volume_normalized_position(kg, sd, data); #endif break; } } stack_store_float3(stack, out_offset, data); } ccl_device void svm_node_tex_coord_bump_dx(KernelGlobals *kg, ShaderData *sd, int path_flag, float *stack, uint4 node, int *offset) { #ifdef __RAY_DIFFERENTIALS__ float3 data; uint type = node.y; uint out_offset = node.z; switch(type) { case NODE_TEXCO_OBJECT: { data = sd->P + sd->dP.dx; if(node.w == 0) { if(sd->object != OBJECT_NONE) { object_inverse_position_transform(kg, sd, &data); } } else { Transform tfm; tfm.x = read_node_float(kg, offset); tfm.y = read_node_float(kg, offset); tfm.z = read_node_float(kg, offset); tfm.w = read_node_float(kg, offset); data = transform_point(&tfm, data); } break; } case NODE_TEXCO_NORMAL: { data = sd->N; object_inverse_normal_transform(kg, sd, &data); break; } case NODE_TEXCO_CAMERA: { Transform tfm = kernel_data.cam.worldtocamera; if(sd->object != OBJECT_NONE) data = transform_point(&tfm, sd->P + sd->dP.dx); else data = transform_point(&tfm, sd->P + sd->dP.dx + camera_position(kg)); break; } case NODE_TEXCO_WINDOW: { if((path_flag & PATH_RAY_CAMERA) && sd->object == OBJECT_NONE && kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) data = camera_world_to_ndc(kg, sd, sd->ray_P + sd->ray_dP.dx); else data = camera_world_to_ndc(kg, sd, sd->P + sd->dP.dx); data.z = 0.0f; break; } case NODE_TEXCO_REFLECTION: { if(sd->object != OBJECT_NONE) data = 2.0f*dot(sd->N, sd->I)*sd->N - sd->I; else data = sd->I; break; } case NODE_TEXCO_DUPLI_GENERATED: { data = object_dupli_generated(kg, sd->object); break; } case NODE_TEXCO_DUPLI_UV: { data = object_dupli_uv(kg, sd->object); break; } case NODE_TEXCO_VOLUME_GENERATED: { data = sd->P + sd->dP.dx; #ifdef __VOLUME__ if(sd->object != OBJECT_NONE) data = volume_normalized_position(kg, sd, data); #endif break; } } stack_store_float3(stack, out_offset, data); #else svm_node_tex_coord(kg, sd, path_flag, stack, node, offset); #endif } ccl_device void svm_node_tex_coord_bump_dy(KernelGlobals *kg, ShaderData *sd, int path_flag, float *stack, uint4 node, int *offset) { #ifdef __RAY_DIFFERENTIALS__ float3 data; uint type = node.y; uint out_offset = node.z; switch(type) { case NODE_TEXCO_OBJECT: { data = sd->P + sd->dP.dy; if(node.w == 0) { if(sd->object != OBJECT_NONE) { object_inverse_position_transform(kg, sd, &data); } } else { Transform tfm; tfm.x = read_node_float(kg, offset); tfm.y = read_node_float(kg, offset); tfm.z = read_node_float(kg, offset); tfm.w = read_node_float(kg, offset); data = transform_point(&tfm, data); } break; } case NODE_TEXCO_NORMAL: { data = sd->N; object_inverse_normal_transform(kg, sd, &data); break; } case NODE_TEXCO_CAMERA: { Transform tfm = kernel_data.cam.worldtocamera; if(sd->object != OBJECT_NONE) data = transform_point(&tfm, sd->P + sd->dP.dy); else data = transform_point(&tfm, sd->P + sd->dP.dy + camera_position(kg)); break; } case NODE_TEXCO_WINDOW: { if((path_flag & PATH_RAY_CAMERA) && sd->object == OBJECT_NONE && kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) data = camera_world_to_ndc(kg, sd, sd->ray_P + sd->ray_dP.dy); else data = camera_world_to_ndc(kg, sd, sd->P + sd->dP.dy); data.z = 0.0f; break; } case NODE_TEXCO_REFLECTION: { if(sd->object != OBJECT_NONE) data = 2.0f*dot(sd->N, sd->I)*sd->N - sd->I; else data = sd->I; break; } case NODE_TEXCO_DUPLI_GENERATED: { data = object_dupli_generated(kg, sd->object); break; } case NODE_TEXCO_DUPLI_UV: { data = object_dupli_uv(kg, sd->object); break; } case NODE_TEXCO_VOLUME_GENERATED: { data = sd->P + sd->dP.dy; #ifdef __VOLUME__ if(sd->object != OBJECT_NONE) data = volume_normalized_position(kg, sd, data); #endif break; } } stack_store_float3(stack, out_offset, data); #else svm_node_tex_coord(kg, sd, path_flag, stack, node, offset); #endif } ccl_device void svm_node_normal_map(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint color_offset, strength_offset, normal_offset, space; decode_node_uchar4(node.y, &color_offset, &strength_offset, &normal_offset, &space); float3 color = stack_load_float3(stack, color_offset); color = 2.0f*make_float3(color.x - 0.5f, color.y - 0.5f, color.z - 0.5f); bool is_backfacing = (sd->flag & SD_BACKFACING) != 0; float3 N; if(space == NODE_NORMAL_MAP_TANGENT) { /* tangent space */ if(sd->object == OBJECT_NONE) { stack_store_float3(stack, normal_offset, make_float3(0.0f, 0.0f, 0.0f)); return; } /* first try to get tangent attribute */ const AttributeDescriptor attr = find_attribute(kg, sd, node.z); const AttributeDescriptor attr_sign = find_attribute(kg, sd, node.w); const AttributeDescriptor attr_normal = find_attribute(kg, sd, ATTR_STD_VERTEX_NORMAL); if(attr.offset == ATTR_STD_NOT_FOUND || attr_sign.offset == ATTR_STD_NOT_FOUND || attr_normal.offset == ATTR_STD_NOT_FOUND) { stack_store_float3(stack, normal_offset, make_float3(0.0f, 0.0f, 0.0f)); return; } /* get _unnormalized_ interpolated normal and tangent */ float3 tangent = primitive_attribute_float3(kg, sd, attr, NULL, NULL); float sign = primitive_attribute_float(kg, sd, attr_sign, NULL, NULL); float3 normal; if(sd->shader & SHADER_SMOOTH_NORMAL) { normal = primitive_attribute_float3(kg, sd, attr_normal, NULL, NULL); } else { normal = sd->Ng; /* the normal is already inverted, which is too soon for the math here */ if(is_backfacing) { normal = -normal; } object_inverse_normal_transform(kg, sd, &normal); } /* apply normal map */ float3 B = sign * cross(normal, tangent); N = safe_normalize(color.x * tangent + color.y * B + color.z * normal); /* transform to world space */ object_normal_transform(kg, sd, &N); } else { /* strange blender convention */ if(space == NODE_NORMAL_MAP_BLENDER_OBJECT || space == NODE_NORMAL_MAP_BLENDER_WORLD) { color.y = -color.y; color.z = -color.z; } /* object, world space */ N = color; if(space == NODE_NORMAL_MAP_OBJECT || space == NODE_NORMAL_MAP_BLENDER_OBJECT) object_normal_transform(kg, sd, &N); else N = safe_normalize(N); } /* invert normal for backfacing polygons */ if(is_backfacing) { N = -N; } float strength = stack_load_float(stack, strength_offset); if(strength != 1.0f) { strength = max(strength, 0.0f); N = safe_normalize(sd->N + (N - sd->N)*strength); } if(is_zero(N)) { N = sd->N; } stack_store_float3(stack, normal_offset, N); } ccl_device void svm_node_tangent(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint tangent_offset, direction_type, axis; decode_node_uchar4(node.y, &tangent_offset, &direction_type, &axis, NULL); float3 tangent; if(direction_type == NODE_TANGENT_UVMAP) { /* UV map */ const AttributeDescriptor desc = find_attribute(kg, sd, node.z); if(desc.offset == ATTR_STD_NOT_FOUND) tangent = make_float3(0.0f, 0.0f, 0.0f); else tangent = primitive_attribute_float3(kg, sd, desc, NULL, NULL); } else { /* radial */ const AttributeDescriptor desc = find_attribute(kg, sd, node.z); float3 generated; if(desc.offset == ATTR_STD_NOT_FOUND) generated = sd->P; else generated = primitive_attribute_float3(kg, sd, desc, NULL, NULL); if(axis == NODE_TANGENT_AXIS_X) tangent = make_float3(0.0f, -(generated.z - 0.5f), (generated.y - 0.5f)); else if(axis == NODE_TANGENT_AXIS_Y) tangent = make_float3(-(generated.z - 0.5f), 0.0f, (generated.x - 0.5f)); else tangent = make_float3(-(generated.y - 0.5f), (generated.x - 0.5f), 0.0f); } object_normal_transform(kg, sd, &tangent); tangent = cross(sd->N, normalize(cross(tangent, sd->N))); stack_store_float3(stack, tangent_offset, tangent); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_texture.h000066400000000000000000000026271334742672700232270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Turbulence */ ccl_device_noinline float noise_turbulence(float3 p, float octaves, int hard) { float fscale = 1.0f; float amp = 1.0f; float sum = 0.0f; int i, n; octaves = clamp(octaves, 0.0f, 16.0f); n = float_to_int(octaves); for(i = 0; i <= n; i++) { float t = noise(fscale*p); if(hard) t = fabsf(2.0f*t - 1.0f); sum += t*amp; amp *= 0.5f; fscale *= 2.0f; } float rmd = octaves - floorf(octaves); if(rmd != 0.0f) { float t = noise(fscale*p); if(hard) t = fabsf(2.0f*t - 1.0f); float sum2 = sum + t*amp; sum *= ((float)(1 << n)/(float)((1 << (n+1)) - 1)); sum2 *= ((float)(1 << (n+1))/(float)((1 << (n+2)) - 1)); return (1.0f - rmd)*sum + rmd*sum2; } else { sum *= ((float)(1 << n)/(float)((1 << (n+1)) - 1)); return sum; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_types.h000066400000000000000000000323311334742672700226660ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SVM_TYPES_H__ #define __SVM_TYPES_H__ CCL_NAMESPACE_BEGIN /* Stack */ /* SVM stack has a fixed size */ #define SVM_STACK_SIZE 255 /* SVM stack offsets with this value indicate that it's not on the stack */ #define SVM_STACK_INVALID 255 #define SVM_BUMP_EVAL_STATE_SIZE 9 /* Nodes */ /* Known frequencies of used nodes, used for selective nodes compilation * in the kernel. Currently only affects split OpenCL kernel. * * Keep as defines so it's easy to check which nodes are to be compiled * from preprocessor. * * Lower the number of group more often the node is used. */ #define NODE_GROUP_LEVEL_0 0 #define NODE_GROUP_LEVEL_1 1 #define NODE_GROUP_LEVEL_2 2 #define NODE_GROUP_LEVEL_3 3 #define NODE_GROUP_LEVEL_MAX NODE_GROUP_LEVEL_3 #define NODE_FEATURE_VOLUME (1 << 0) #define NODE_FEATURE_HAIR (1 << 1) #define NODE_FEATURE_BUMP (1 << 2) #define NODE_FEATURE_BUMP_STATE (1 << 3) /* TODO(sergey): Consider using something like ((uint)(-1)). * Need to check carefully operand types around usage of this * define first. */ #define NODE_FEATURE_ALL (NODE_FEATURE_VOLUME|NODE_FEATURE_HAIR|NODE_FEATURE_BUMP|NODE_FEATURE_BUMP_STATE) typedef enum ShaderNodeType { NODE_END = 0, NODE_CLOSURE_BSDF, NODE_CLOSURE_EMISSION, NODE_CLOSURE_BACKGROUND, NODE_CLOSURE_SET_WEIGHT, NODE_CLOSURE_WEIGHT, NODE_MIX_CLOSURE, NODE_JUMP_IF_ZERO, NODE_JUMP_IF_ONE, NODE_TEX_IMAGE, NODE_TEX_IMAGE_BOX, NODE_TEX_SKY, NODE_GEOMETRY, NODE_GEOMETRY_DUPLI, NODE_LIGHT_PATH, NODE_VALUE_F, NODE_VALUE_V, NODE_MIX, NODE_ATTR, NODE_CONVERT, NODE_FRESNEL, NODE_WIREFRAME, NODE_WAVELENGTH, NODE_BLACKBODY, NODE_EMISSION_WEIGHT, NODE_TEX_GRADIENT, NODE_TEX_VORONOI, NODE_TEX_MUSGRAVE, NODE_TEX_WAVE, NODE_TEX_MAGIC, NODE_TEX_NOISE, NODE_SHADER_JUMP, NODE_SET_DISPLACEMENT, NODE_GEOMETRY_BUMP_DX, NODE_GEOMETRY_BUMP_DY, NODE_SET_BUMP, NODE_MATH, NODE_VECTOR_MATH, NODE_VECTOR_TRANSFORM, NODE_MAPPING, NODE_TEX_COORD, NODE_TEX_COORD_BUMP_DX, NODE_TEX_COORD_BUMP_DY, NODE_ATTR_BUMP_DX, NODE_ATTR_BUMP_DY, NODE_TEX_ENVIRONMENT, NODE_CLOSURE_HOLDOUT, NODE_LAYER_WEIGHT, NODE_CLOSURE_VOLUME, NODE_SEPARATE_VECTOR, NODE_COMBINE_VECTOR, NODE_SEPARATE_HSV, NODE_COMBINE_HSV, NODE_HSV, NODE_CAMERA, NODE_INVERT, NODE_NORMAL, NODE_GAMMA, NODE_TEX_CHECKER, NODE_BRIGHTCONTRAST, NODE_RGB_RAMP, NODE_RGB_CURVES, NODE_VECTOR_CURVES, NODE_MIN_MAX, NODE_LIGHT_FALLOFF, NODE_OBJECT_INFO, NODE_PARTICLE_INFO, NODE_TEX_BRICK, NODE_CLOSURE_SET_NORMAL, NODE_CLOSURE_AMBIENT_OCCLUSION, NODE_TANGENT, NODE_NORMAL_MAP, NODE_HAIR_INFO, NODE_UVMAP, NODE_TEX_VOXEL, NODE_ENTER_BUMP_EVAL, NODE_LEAVE_BUMP_EVAL, NODE_BEVEL, NODE_DISPLACEMENT, NODE_VECTOR_DISPLACEMENT, NODE_PRINCIPLED_VOLUME, } ShaderNodeType; typedef enum NodeAttributeType { NODE_ATTR_FLOAT = 0, NODE_ATTR_FLOAT3, NODE_ATTR_MATRIX } NodeAttributeType; typedef enum NodeGeometry { NODE_GEOM_P = 0, NODE_GEOM_N, NODE_GEOM_T, NODE_GEOM_I, NODE_GEOM_Ng, NODE_GEOM_uv } NodeGeometry; typedef enum NodeObjectInfo { NODE_INFO_OB_LOCATION, NODE_INFO_OB_INDEX, NODE_INFO_MAT_INDEX, NODE_INFO_OB_RANDOM } NodeObjectInfo; typedef enum NodeParticleInfo { NODE_INFO_PAR_INDEX, NODE_INFO_PAR_RANDOM, NODE_INFO_PAR_AGE, NODE_INFO_PAR_LIFETIME, NODE_INFO_PAR_LOCATION, NODE_INFO_PAR_ROTATION, NODE_INFO_PAR_SIZE, NODE_INFO_PAR_VELOCITY, NODE_INFO_PAR_ANGULAR_VELOCITY } NodeParticleInfo; typedef enum NodeHairInfo { NODE_INFO_CURVE_IS_STRAND, NODE_INFO_CURVE_INTERCEPT, NODE_INFO_CURVE_THICKNESS, /*fade for minimum hair width transpency*/ /*NODE_INFO_CURVE_FADE,*/ NODE_INFO_CURVE_TANGENT_NORMAL, NODE_INFO_CURVE_RANDOM, } NodeHairInfo; typedef enum NodeLightPath { NODE_LP_camera = 0, NODE_LP_shadow, NODE_LP_diffuse, NODE_LP_glossy, NODE_LP_singular, NODE_LP_reflection, NODE_LP_transmission, NODE_LP_volume_scatter, NODE_LP_backfacing, NODE_LP_ray_length, NODE_LP_ray_depth, NODE_LP_ray_diffuse, NODE_LP_ray_glossy, NODE_LP_ray_transparent, NODE_LP_ray_transmission, } NodeLightPath; typedef enum NodeLightFalloff { NODE_LIGHT_FALLOFF_QUADRATIC, NODE_LIGHT_FALLOFF_LINEAR, NODE_LIGHT_FALLOFF_CONSTANT } NodeLightFalloff; typedef enum NodeTexCoord { NODE_TEXCO_NORMAL, NODE_TEXCO_OBJECT, NODE_TEXCO_CAMERA, NODE_TEXCO_WINDOW, NODE_TEXCO_REFLECTION, NODE_TEXCO_DUPLI_GENERATED, NODE_TEXCO_DUPLI_UV, NODE_TEXCO_VOLUME_GENERATED } NodeTexCoord; typedef enum NodeMix { NODE_MIX_BLEND = 0, NODE_MIX_ADD, NODE_MIX_MUL, NODE_MIX_SUB, NODE_MIX_SCREEN, NODE_MIX_DIV, NODE_MIX_DIFF, NODE_MIX_DARK, NODE_MIX_LIGHT, NODE_MIX_OVERLAY, NODE_MIX_DODGE, NODE_MIX_BURN, NODE_MIX_HUE, NODE_MIX_SAT, NODE_MIX_VAL, NODE_MIX_COLOR, NODE_MIX_SOFT, NODE_MIX_LINEAR, NODE_MIX_CLAMP /* used for the clamp UI option */ } NodeMix; typedef enum NodeMath { NODE_MATH_ADD, NODE_MATH_SUBTRACT, NODE_MATH_MULTIPLY, NODE_MATH_DIVIDE, NODE_MATH_SINE, NODE_MATH_COSINE, NODE_MATH_TANGENT, NODE_MATH_ARCSINE, NODE_MATH_ARCCOSINE, NODE_MATH_ARCTANGENT, NODE_MATH_POWER, NODE_MATH_LOGARITHM, NODE_MATH_MINIMUM, NODE_MATH_MAXIMUM, NODE_MATH_ROUND, NODE_MATH_LESS_THAN, NODE_MATH_GREATER_THAN, NODE_MATH_MODULO, NODE_MATH_ABSOLUTE, NODE_MATH_CLAMP /* used for the clamp UI option */ } NodeMath; typedef enum NodeVectorMath { NODE_VECTOR_MATH_ADD, NODE_VECTOR_MATH_SUBTRACT, NODE_VECTOR_MATH_AVERAGE, NODE_VECTOR_MATH_DOT_PRODUCT, NODE_VECTOR_MATH_CROSS_PRODUCT, NODE_VECTOR_MATH_NORMALIZE } NodeVectorMath; typedef enum NodeVectorTransformType { NODE_VECTOR_TRANSFORM_TYPE_VECTOR, NODE_VECTOR_TRANSFORM_TYPE_POINT, NODE_VECTOR_TRANSFORM_TYPE_NORMAL } NodeVectorTransformType; typedef enum NodeVectorTransformConvertSpace { NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD, NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT, NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA } NodeVectorTransformConvertSpace; typedef enum NodeConvert { NODE_CONVERT_FV, NODE_CONVERT_FI, NODE_CONVERT_CF, NODE_CONVERT_CI, NODE_CONVERT_VF, NODE_CONVERT_VI, NODE_CONVERT_IF, NODE_CONVERT_IV } NodeConvert; typedef enum NodeMusgraveType { NODE_MUSGRAVE_MULTIFRACTAL, NODE_MUSGRAVE_FBM, NODE_MUSGRAVE_HYBRID_MULTIFRACTAL, NODE_MUSGRAVE_RIDGED_MULTIFRACTAL, NODE_MUSGRAVE_HETERO_TERRAIN } NodeMusgraveType; typedef enum NodeWaveType { NODE_WAVE_BANDS, NODE_WAVE_RINGS } NodeWaveType; typedef enum NodeWaveProfiles { NODE_WAVE_PROFILE_SIN, NODE_WAVE_PROFILE_SAW, } NodeWaveProfile; typedef enum NodeSkyType { NODE_SKY_OLD, NODE_SKY_NEW } NodeSkyType; typedef enum NodeGradientType { NODE_BLEND_LINEAR, NODE_BLEND_QUADRATIC, NODE_BLEND_EASING, NODE_BLEND_DIAGONAL, NODE_BLEND_RADIAL, NODE_BLEND_QUADRATIC_SPHERE, NODE_BLEND_SPHERICAL } NodeGradientType; typedef enum NodeVoronoiColoring { NODE_VORONOI_INTENSITY, NODE_VORONOI_CELLS } NodeVoronoiColoring; typedef enum NodeBlendWeightType { NODE_LAYER_WEIGHT_FRESNEL, NODE_LAYER_WEIGHT_FACING } NodeBlendWeightType; typedef enum NodeTangentDirectionType { NODE_TANGENT_RADIAL, NODE_TANGENT_UVMAP } NodeTangentDirectionType; typedef enum NodeTangentAxis { NODE_TANGENT_AXIS_X, NODE_TANGENT_AXIS_Y, NODE_TANGENT_AXIS_Z } NodeTangentAxis; typedef enum NodeNormalMapSpace { NODE_NORMAL_MAP_TANGENT, NODE_NORMAL_MAP_OBJECT, NODE_NORMAL_MAP_WORLD, NODE_NORMAL_MAP_BLENDER_OBJECT, NODE_NORMAL_MAP_BLENDER_WORLD, } NodeNormalMapSpace; typedef enum NodeImageColorSpace { NODE_COLOR_SPACE_NONE = 0, NODE_COLOR_SPACE_COLOR = 1, } NodeImageColorSpace; typedef enum NodeImageProjection { NODE_IMAGE_PROJ_FLAT = 0, NODE_IMAGE_PROJ_BOX = 1, NODE_IMAGE_PROJ_SPHERE = 2, NODE_IMAGE_PROJ_TUBE = 3, } NodeImageProjection; typedef enum NodeEnvironmentProjection { NODE_ENVIRONMENT_EQUIRECTANGULAR = 0, NODE_ENVIRONMENT_MIRROR_BALL = 1, } NodeEnvironmentProjection; typedef enum NodeBumpOffset { NODE_BUMP_OFFSET_CENTER, NODE_BUMP_OFFSET_DX, NODE_BUMP_OFFSET_DY, } NodeBumpOffset; typedef enum NodeTexVoxelSpace { NODE_TEX_VOXEL_SPACE_OBJECT = 0, NODE_TEX_VOXEL_SPACE_WORLD = 1, } NodeTexVoxelSpace; typedef enum ShaderType { SHADER_TYPE_SURFACE, SHADER_TYPE_VOLUME, SHADER_TYPE_DISPLACEMENT, SHADER_TYPE_BUMP, } ShaderType; /* Closure */ typedef enum ClosureType { /* Special type, flags generic node as a non-BSDF. */ CLOSURE_NONE_ID, CLOSURE_BSDF_ID, /* Diffuse */ CLOSURE_BSDF_DIFFUSE_ID, CLOSURE_BSDF_OREN_NAYAR_ID, CLOSURE_BSDF_DIFFUSE_RAMP_ID, CLOSURE_BSDF_PRINCIPLED_DIFFUSE_ID, CLOSURE_BSDF_PRINCIPLED_SHEEN_ID, CLOSURE_BSDF_DIFFUSE_TOON_ID, /* Glossy */ CLOSURE_BSDF_REFLECTION_ID, CLOSURE_BSDF_MICROFACET_GGX_ID, CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID, CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID, CLOSURE_BSDF_MICROFACET_BECKMANN_ID, CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID, CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID, CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID, CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID, CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID, CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID, CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_FRESNEL_ID, CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID, CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID, CLOSURE_BSDF_ASHIKHMIN_VELVET_ID, CLOSURE_BSDF_PHONG_RAMP_ID, CLOSURE_BSDF_GLOSSY_TOON_ID, CLOSURE_BSDF_HAIR_REFLECTION_ID, /* Transmission */ CLOSURE_BSDF_TRANSLUCENT_ID, CLOSURE_BSDF_REFRACTION_ID, CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID, CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID, CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID, CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID, CLOSURE_BSDF_SHARP_GLASS_ID, CLOSURE_BSDF_HAIR_TRANSMISSION_ID, /* Special cases */ CLOSURE_BSDF_BSSRDF_ID, CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID, CLOSURE_BSDF_TRANSPARENT_ID, /* BSSRDF */ CLOSURE_BSSRDF_CUBIC_ID, CLOSURE_BSSRDF_GAUSSIAN_ID, CLOSURE_BSSRDF_PRINCIPLED_ID, CLOSURE_BSSRDF_BURLEY_ID, CLOSURE_BSSRDF_RANDOM_WALK_ID, CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID, /* Other */ CLOSURE_HOLDOUT_ID, CLOSURE_AMBIENT_OCCLUSION_ID, /* Volume */ CLOSURE_VOLUME_ID, CLOSURE_VOLUME_ABSORPTION_ID, CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID, CLOSURE_BSDF_PRINCIPLED_ID, NBUILTIN_CLOSURES } ClosureType; /* watch this, being lazy with memory usage */ #define CLOSURE_IS_BSDF(type) (type <= CLOSURE_BSDF_TRANSPARENT_ID) #define CLOSURE_IS_BSDF_DIFFUSE(type) (type >= CLOSURE_BSDF_DIFFUSE_ID && type <= CLOSURE_BSDF_DIFFUSE_TOON_ID) #define CLOSURE_IS_BSDF_GLOSSY(type) (type >= CLOSURE_BSDF_REFLECTION_ID && type <= CLOSURE_BSDF_HAIR_REFLECTION_ID) #define CLOSURE_IS_BSDF_TRANSMISSION(type) (type >= CLOSURE_BSDF_TRANSLUCENT_ID && type <= CLOSURE_BSDF_HAIR_TRANSMISSION_ID) #define CLOSURE_IS_BSDF_BSSRDF(type) (type == CLOSURE_BSDF_BSSRDF_ID || type == CLOSURE_BSDF_BSSRDF_PRINCIPLED_ID) #define CLOSURE_IS_BSDF_SINGULAR(type) (type == CLOSURE_BSDF_REFLECTION_ID || \ type == CLOSURE_BSDF_REFRACTION_ID || \ type == CLOSURE_BSDF_TRANSPARENT_ID) #define CLOSURE_IS_BSDF_TRANSPARENT(type) (type == CLOSURE_BSDF_TRANSPARENT_ID) #define CLOSURE_IS_BSDF_MULTISCATTER(type) (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID ||\ type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID || \ type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) #define CLOSURE_IS_BSDF_MICROFACET(type) ((type >= CLOSURE_BSDF_MICROFACET_GGX_ID && type <= CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID) ||\ (type >= CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID && type <= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) ||\ (type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID)) #define CLOSURE_IS_BSDF_OR_BSSRDF(type) (type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID) #define CLOSURE_IS_BSSRDF(type) (type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID) #define CLOSURE_IS_DISK_BSSRDF(type) (type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_BURLEY_ID) #define CLOSURE_IS_VOLUME(type) (type >= CLOSURE_VOLUME_ID && type <= CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID) #define CLOSURE_IS_VOLUME_SCATTER(type) (type == CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID) #define CLOSURE_IS_VOLUME_ABSORPTION(type) (type == CLOSURE_VOLUME_ABSORPTION_ID) #define CLOSURE_IS_HOLDOUT(type) (type == CLOSURE_HOLDOUT_ID) #define CLOSURE_IS_AMBIENT_OCCLUSION(type) (type == CLOSURE_AMBIENT_OCCLUSION_ID) #define CLOSURE_IS_PHASE(type) (type == CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID) #define CLOSURE_IS_GLASS(type) (type >= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID && type <= CLOSURE_BSDF_SHARP_GLASS_ID) #define CLOSURE_IS_PRINCIPLED(type) (type == CLOSURE_BSDF_PRINCIPLED_ID) #define CLOSURE_WEIGHT_CUTOFF 1e-5f CCL_NAMESPACE_END #endif /* __SVM_TYPES_H__ */ goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_value.h000066400000000000000000000022211334742672700226310ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Value Nodes */ ccl_device void svm_node_value_f(KernelGlobals *kg, ShaderData *sd, float *stack, uint ivalue, uint out_offset) { stack_store_float(stack, out_offset, __uint_as_float(ivalue)); } ccl_device void svm_node_value_v(KernelGlobals *kg, ShaderData *sd, float *stack, uint out_offset, int *offset) { /* read extra data */ uint4 node1 = read_node(kg, offset); float3 p = make_float3(__uint_as_float(node1.y), __uint_as_float(node1.z), __uint_as_float(node1.w)); stack_store_float3(stack, out_offset, p); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_vector_transform.h000066400000000000000000000061301334742672700251150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Vector Transform */ ccl_device void svm_node_vector_transform(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint itype, ifrom, ito; uint vector_in, vector_out; decode_node_uchar4(node.y, &itype, &ifrom, &ito, NULL); decode_node_uchar4(node.z, &vector_in, &vector_out, NULL, NULL); float3 in = stack_load_float3(stack, vector_in); NodeVectorTransformType type = (NodeVectorTransformType)itype; NodeVectorTransformConvertSpace from = (NodeVectorTransformConvertSpace)ifrom; NodeVectorTransformConvertSpace to = (NodeVectorTransformConvertSpace)ito; Transform tfm; bool is_object = (sd->object != OBJECT_NONE); bool is_direction = (type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR || type == NODE_VECTOR_TRANSFORM_TYPE_NORMAL); /* From world */ if(from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD) { if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) { tfm = kernel_data.cam.worldtocamera; if(is_direction) in = transform_direction(&tfm, in); else in = transform_point(&tfm, in); } else if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT && is_object) { if(is_direction) object_inverse_dir_transform(kg, sd, &in); else object_inverse_position_transform(kg, sd, &in); } } /* From camera */ else if(from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) { if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD || to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) { tfm = kernel_data.cam.cameratoworld; if(is_direction) in = transform_direction(&tfm, in); else in = transform_point(&tfm, in); } if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT && is_object) { if(is_direction) object_inverse_dir_transform(kg, sd, &in); else object_inverse_position_transform(kg, sd, &in); } } /* From object */ else if(from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) { if((to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD || to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) && is_object) { if(is_direction) object_dir_transform(kg, sd, &in); else object_position_transform(kg, sd, &in); } if(to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) { tfm = kernel_data.cam.worldtocamera; if(is_direction) in = transform_direction(&tfm, in); else in = transform_point(&tfm, in); } } /* Normalize Normal */ if(type == NODE_VECTOR_TRANSFORM_TYPE_NORMAL) in = normalize(in); /* Output */ if(stack_valid(vector_out)) { stack_store_float3(stack, vector_out, in); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_voronoi.h000066400000000000000000000071131334742672700232150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Voronoi */ ccl_device float voronoi_F1_distance(float3 p) { /* returns squared distance in da */ float da = 1e10f; #ifndef __KERNEL_SSE2__ int ix = floor_to_int(p.x), iy = floor_to_int(p.y), iz = floor_to_int(p.z); for(int xx = -1; xx <= 1; xx++) { for(int yy = -1; yy <= 1; yy++) { for(int zz = -1; zz <= 1; zz++) { float3 ip = make_float3(ix + xx, iy + yy, iz + zz); float3 vp = ip + cellnoise_color(ip); float d = len_squared(p - vp); da = min(d, da); } } } #else ssef vec_p = load4f(p); ssei xyzi = quick_floor_sse(vec_p); for(int xx = -1; xx <= 1; xx++) { for(int yy = -1; yy <= 1; yy++) { for(int zz = -1; zz <= 1; zz++) { ssef ip = ssef(xyzi + ssei(xx, yy, zz, 0)); ssef vp = ip + cellnoise_color(ip); float d = len_squared<1, 1, 1, 0>(vec_p - vp); da = min(d, da); } } } #endif return da; } ccl_device float3 voronoi_F1_color(float3 p) { /* returns color of the nearest point */ float da = 1e10f; #ifndef __KERNEL_SSE2__ float3 pa; int ix = floor_to_int(p.x), iy = floor_to_int(p.y), iz = floor_to_int(p.z); for(int xx = -1; xx <= 1; xx++) { for(int yy = -1; yy <= 1; yy++) { for(int zz = -1; zz <= 1; zz++) { float3 ip = make_float3(ix + xx, iy + yy, iz + zz); float3 vp = ip + cellnoise_color(ip); float d = len_squared(p - vp); if(d < da) { da = d; pa = vp; } } } } return cellnoise_color(pa); #else ssef pa, vec_p = load4f(p); ssei xyzi = quick_floor_sse(vec_p); for(int xx = -1; xx <= 1; xx++) { for(int yy = -1; yy <= 1; yy++) { for(int zz = -1; zz <= 1; zz++) { ssef ip = ssef(xyzi + ssei(xx, yy, zz, 0)); ssef vp = ip + cellnoise_color(ip); float d = len_squared<1, 1, 1, 0>(vec_p - vp); if(d < da) { da = d; pa = vp; } } } } ssef color = cellnoise_color(pa); return (float3 &)color; #endif } ccl_device_noinline float4 svm_voronoi(NodeVoronoiColoring coloring, float3 p) { if(coloring == NODE_VORONOI_INTENSITY) { /* compute squared distance to the nearest neighbour */ float fac = voronoi_F1_distance(p); return make_float4(fac, fac, fac, fac); } else { /* compute color of the nearest neighbour */ float3 color = voronoi_F1_color(p); return make_float4(color.x, color.y, color.z, average(color)); } } ccl_device void svm_node_tex_voronoi(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint coloring = node.y; uint scale_offset, co_offset, fac_offset, color_offset; decode_node_uchar4(node.z, &scale_offset, &co_offset, &fac_offset, &color_offset); float3 co = stack_load_float3(stack, co_offset); float scale = stack_load_float_default(stack, scale_offset, node.w); float4 result = svm_voronoi((NodeVoronoiColoring)coloring, co*scale); float3 color = make_float3(result.x, result.y, result.z); float f = result.w; if(stack_valid(fac_offset)) stack_store_float(stack, fac_offset, f); if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, color); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_voxel.h000066400000000000000000000036201334742672700226560ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* TODO(sergey): Think of making it more generic volume-type attribute * sampler. */ ccl_device void svm_node_tex_voxel(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint co_offset, density_out_offset, color_out_offset, space; decode_node_uchar4(node.z, &co_offset, &density_out_offset, &color_out_offset, &space); #ifdef __VOLUME__ int id = node.y; float3 co = stack_load_float3(stack, co_offset); if(space == NODE_TEX_VOXEL_SPACE_OBJECT) { co = volume_normalized_position(kg, sd, co); } else { kernel_assert(space == NODE_TEX_VOXEL_SPACE_WORLD); Transform tfm; tfm.x = read_node_float(kg, offset); tfm.y = read_node_float(kg, offset); tfm.z = read_node_float(kg, offset); tfm.w = read_node_float(kg, offset); co = transform_point(&tfm, co); } float4 r = kernel_tex_image_interp_3d(kg, id, co.x, co.y, co.z, INTERPOLATION_NONE); #else float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f); #endif if(stack_valid(density_out_offset)) stack_store_float(stack, density_out_offset, r.w); if(stack_valid(color_out_offset)) stack_store_float3(stack, color_out_offset, make_float3(r.x, r.y, r.z)); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_wave.h000066400000000000000000000043061334742672700224650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CCL_NAMESPACE_BEGIN /* Wave */ ccl_device_noinline float svm_wave(NodeWaveType type, NodeWaveProfile profile, float3 p, float detail, float distortion, float dscale) { float n; if(type == NODE_WAVE_BANDS) n = (p.x + p.y + p.z) * 10.0f; else /* NODE_WAVE_RINGS */ n = len(p) * 20.0f; if(distortion != 0.0f) n += distortion * noise_turbulence(p*dscale, detail, 0); if(profile == NODE_WAVE_PROFILE_SIN) { return 0.5f + 0.5f * sinf(n); } else { /* NODE_WAVE_PROFILE_SAW */ n /= M_2PI_F; n -= (int) n; return (n < 0.0f)? n + 1.0f: n; } } ccl_device void svm_node_tex_wave(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) { uint4 node2 = read_node(kg, offset); uint type; uint co_offset, scale_offset, detail_offset, dscale_offset, distortion_offset, color_offset, fac_offset; decode_node_uchar4(node.y, &type, &color_offset, &fac_offset, &dscale_offset); decode_node_uchar4(node.z, &co_offset, &scale_offset, &detail_offset, &distortion_offset); float3 co = stack_load_float3(stack, co_offset); float scale = stack_load_float_default(stack, scale_offset, node2.x); float detail = stack_load_float_default(stack, detail_offset, node2.y); float distortion = stack_load_float_default(stack, distortion_offset, node2.z); float dscale = stack_load_float_default(stack, dscale_offset, node2.w); float f = svm_wave((NodeWaveType)type, (NodeWaveProfile)node.w, co*scale, detail, distortion, dscale); if(stack_valid(fac_offset)) stack_store_float(stack, fac_offset, f); if(stack_valid(color_offset)) stack_store_float3(stack, color_offset, make_float3(f, f, f)); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_wavelength.h000066400000000000000000000120151334742672700236630ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2013, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ CCL_NAMESPACE_BEGIN /* Wavelength to RGB */ // CIE colour matching functions xBar, yBar, and zBar for // wavelengths from 380 through 780 nanometers, every 5 // nanometers. For a wavelength lambda in this range: // cie_colour_match[(lambda - 380) / 5][0] = xBar // cie_colour_match[(lambda - 380) / 5][1] = yBar // cie_colour_match[(lambda - 380) / 5][2] = zBar ccl_static_constant float cie_colour_match[81][3] = { {0.0014f,0.0000f,0.0065f}, {0.0022f,0.0001f,0.0105f}, {0.0042f,0.0001f,0.0201f}, {0.0076f,0.0002f,0.0362f}, {0.0143f,0.0004f,0.0679f}, {0.0232f,0.0006f,0.1102f}, {0.0435f,0.0012f,0.2074f}, {0.0776f,0.0022f,0.3713f}, {0.1344f,0.0040f,0.6456f}, {0.2148f,0.0073f,1.0391f}, {0.2839f,0.0116f,1.3856f}, {0.3285f,0.0168f,1.6230f}, {0.3483f,0.0230f,1.7471f}, {0.3481f,0.0298f,1.7826f}, {0.3362f,0.0380f,1.7721f}, {0.3187f,0.0480f,1.7441f}, {0.2908f,0.0600f,1.6692f}, {0.2511f,0.0739f,1.5281f}, {0.1954f,0.0910f,1.2876f}, {0.1421f,0.1126f,1.0419f}, {0.0956f,0.1390f,0.8130f}, {0.0580f,0.1693f,0.6162f}, {0.0320f,0.2080f,0.4652f}, {0.0147f,0.2586f,0.3533f}, {0.0049f,0.3230f,0.2720f}, {0.0024f,0.4073f,0.2123f}, {0.0093f,0.5030f,0.1582f}, {0.0291f,0.6082f,0.1117f}, {0.0633f,0.7100f,0.0782f}, {0.1096f,0.7932f,0.0573f}, {0.1655f,0.8620f,0.0422f}, {0.2257f,0.9149f,0.0298f}, {0.2904f,0.9540f,0.0203f}, {0.3597f,0.9803f,0.0134f}, {0.4334f,0.9950f,0.0087f}, {0.5121f,1.0000f,0.0057f}, {0.5945f,0.9950f,0.0039f}, {0.6784f,0.9786f,0.0027f}, {0.7621f,0.9520f,0.0021f}, {0.8425f,0.9154f,0.0018f}, {0.9163f,0.8700f,0.0017f}, {0.9786f,0.8163f,0.0014f}, {1.0263f,0.7570f,0.0011f}, {1.0567f,0.6949f,0.0010f}, {1.0622f,0.6310f,0.0008f}, {1.0456f,0.5668f,0.0006f}, {1.0026f,0.5030f,0.0003f}, {0.9384f,0.4412f,0.0002f}, {0.8544f,0.3810f,0.0002f}, {0.7514f,0.3210f,0.0001f}, {0.6424f,0.2650f,0.0000f}, {0.5419f,0.2170f,0.0000f}, {0.4479f,0.1750f,0.0000f}, {0.3608f,0.1382f,0.0000f}, {0.2835f,0.1070f,0.0000f}, {0.2187f,0.0816f,0.0000f}, {0.1649f,0.0610f,0.0000f}, {0.1212f,0.0446f,0.0000f}, {0.0874f,0.0320f,0.0000f}, {0.0636f,0.0232f,0.0000f}, {0.0468f,0.0170f,0.0000f}, {0.0329f,0.0119f,0.0000f}, {0.0227f,0.0082f,0.0000f}, {0.0158f,0.0057f,0.0000f}, {0.0114f,0.0041f,0.0000f}, {0.0081f,0.0029f,0.0000f}, {0.0058f,0.0021f,0.0000f}, {0.0041f,0.0015f,0.0000f}, {0.0029f,0.0010f,0.0000f}, {0.0020f,0.0007f,0.0000f}, {0.0014f,0.0005f,0.0000f}, {0.0010f,0.0004f,0.0000f}, {0.0007f,0.0002f,0.0000f}, {0.0005f,0.0002f,0.0000f}, {0.0003f,0.0001f,0.0000f}, {0.0002f,0.0001f,0.0000f}, {0.0002f,0.0001f,0.0000f}, {0.0001f,0.0000f,0.0000f}, {0.0001f,0.0000f,0.0000f}, {0.0001f,0.0000f,0.0000f}, {0.0000f,0.0000f,0.0000f} }; ccl_device void svm_node_wavelength(ShaderData *sd, float *stack, uint wavelength, uint color_out) { float lambda_nm = stack_load_float(stack, wavelength); float ii = (lambda_nm-380.0f) * (1.0f/5.0f); // scaled 0..80 int i = float_to_int(ii); float3 color; if(i < 0 || i >= 80) { color = make_float3(0.0f, 0.0f, 0.0f); } else { ii -= i; ccl_constant float *c = cie_colour_match[i]; color = interp(make_float3(c[0], c[1], c[2]), make_float3(c[3], c[4], c[5]), ii); } color = xyz_to_rgb(color.x, color.y, color.z); color *= 1.0f/2.52f; // Empirical scale from lg to make all comps <= 1 /* Clamp to zero if values are smaller */ color = max(color, make_float3(0.0f, 0.0f, 0.0f)); stack_store_float3(stack, color_out, color); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/kernel/svm/svm_wireframe.h000066400000000000000000000114471334742672700235100ustar00rootroot00000000000000/* * Adapted from Open Shading Language with this license: * * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. * All Rights Reserved. * * Modifications Copyright 2013, Blender Foundation. * * 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 Sony Pictures Imageworks 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. */ CCL_NAMESPACE_BEGIN /* Wireframe Node */ ccl_device_inline float wireframe(KernelGlobals *kg, ShaderData *sd, float size, int pixel_size, float3 *P) { #ifdef __HAIR__ if(sd->prim != PRIM_NONE && sd->type & PRIMITIVE_ALL_TRIANGLE) #else if(sd->prim != PRIM_NONE) #endif { float3 Co[3]; float pixelwidth = 1.0f; /* Triangles */ int np = 3; if(sd->type & PRIMITIVE_TRIANGLE) triangle_vertices(kg, sd->prim, Co); else motion_triangle_vertices(kg, sd->object, sd->prim, sd->time, Co); if(!(sd->object_flag & SD_OBJECT_TRANSFORM_APPLIED)) { object_position_transform(kg, sd, &Co[0]); object_position_transform(kg, sd, &Co[1]); object_position_transform(kg, sd, &Co[2]); } if(pixel_size) { // Project the derivatives of P to the viewing plane defined // by I so we have a measure of how big is a pixel at this point float pixelwidth_x = len(sd->dP.dx - dot(sd->dP.dx, sd->I) * sd->I); float pixelwidth_y = len(sd->dP.dy - dot(sd->dP.dy, sd->I) * sd->I); // Take the average of both axis' length pixelwidth = (pixelwidth_x + pixelwidth_y) * 0.5f; } // Use half the width as the neighbor face will render the // other half. And take the square for fast comparison pixelwidth *= 0.5f * size; pixelwidth *= pixelwidth; for(int i = 0; i < np; i++) { int i2 = i ? i - 1 : np - 1; float3 dir = *P - Co[i]; float3 edge = Co[i] - Co[i2]; float3 crs = cross(edge, dir); // At this point dot(crs, crs) / dot(edge, edge) is // the square of area / length(edge) == square of the // distance to the edge. if(dot(crs, crs) < (dot(edge, edge) * pixelwidth)) return 1.0f; } } return 0.0f; } ccl_device void svm_node_wireframe(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint in_size = node.y; uint out_fac = node.z; uint use_pixel_size, bump_offset; decode_node_uchar4(node.w, &use_pixel_size, &bump_offset, NULL, NULL); /* Input Data */ float size = stack_load_float(stack, in_size); int pixel_size = (int)use_pixel_size; /* Calculate wireframe */ #ifdef __SPLIT_KERNEL__ /* TODO(sergey): This is because sd is actually a global space, * which makes it difficult to re-use same wireframe() function. * * With OpenCL 2.0 it's possible to avoid this change, but for until * then we'll be living with such an exception. */ float3 P = sd->P; float f = wireframe(kg, sd, size, pixel_size, &P); #else float f = wireframe(kg, sd, size, pixel_size, &sd->P); #endif /* TODO(sergey): Think of faster way to calculate derivatives. */ if(bump_offset == NODE_BUMP_OFFSET_DX) { float3 Px = sd->P - sd->dP.dx; f += (f - wireframe(kg, sd, size, pixel_size, &Px)) / len(sd->dP.dx); } else if(bump_offset == NODE_BUMP_OFFSET_DY) { float3 Py = sd->P - sd->dP.dy; f += (f - wireframe(kg, sd, size, pixel_size, &Py)) / len(sd->dP.dy); } if(stack_valid(out_fac)) stack_store_float(stack, out_fac, f); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/000077500000000000000000000000001334742672700176545ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/render/attribute.cpp000066400000000000000000000360301334742672700223650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/image.h" #include "render/mesh.h" #include "render/attribute.h" #include "util/util_foreach.h" #include "util/util_transform.h" CCL_NAMESPACE_BEGIN /* Attribute */ Attribute::~Attribute() { /* for voxel data, we need to remove the image from the image manager */ if(element == ATTR_ELEMENT_VOXEL) { VoxelAttribute *voxel_data = data_voxel(); if(voxel_data && voxel_data->slot != -1) { voxel_data->manager->remove_image(voxel_data->slot); } } } void Attribute::set(ustring name_, TypeDesc type_, AttributeElement element_) { name = name_; type = type_; element = element_; std = ATTR_STD_NONE; flags = 0; /* string and matrix not supported! */ assert(type == TypeDesc::TypeFloat || type == TypeDesc::TypeColor || type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || type == TypeDesc::TypeNormal || type == TypeDesc::TypeMatrix); } void Attribute::resize(Mesh *mesh, AttributePrimitive prim, bool reserve_only) { if(reserve_only) { buffer.reserve(buffer_size(mesh, prim)); } else { buffer.resize(buffer_size(mesh, prim), 0); } } void Attribute::resize(size_t num_elements) { buffer.resize(num_elements * data_sizeof(), 0); } void Attribute::add(const float& f) { char *data = (char*)&f; size_t size = sizeof(f); for(size_t i = 0; i < size; i++) buffer.push_back(data[i]); } void Attribute::add(const uchar4& f) { char *data = (char*)&f; size_t size = sizeof(f); for(size_t i = 0; i < size; i++) buffer.push_back(data[i]); } void Attribute::add(const float3& f) { char *data = (char*)&f; size_t size = sizeof(f); for(size_t i = 0; i < size; i++) buffer.push_back(data[i]); } void Attribute::add(const Transform& f) { char *data = (char*)&f; size_t size = sizeof(f); for(size_t i = 0; i < size; i++) buffer.push_back(data[i]); } void Attribute::add(const VoxelAttribute& f) { char *data = (char*)&f; size_t size = sizeof(f); for(size_t i = 0; i < size; i++) buffer.push_back(data[i]); } void Attribute::add(const char *data) { size_t size = data_sizeof(); for(size_t i = 0; i < size; i++) buffer.push_back(data[i]); } size_t Attribute::data_sizeof() const { if(element == ATTR_ELEMENT_VOXEL) return sizeof(VoxelAttribute); else if(element == ATTR_ELEMENT_CORNER_BYTE) return sizeof(uchar4); else if(type == TypeDesc::TypeFloat) return sizeof(float); else if(type == TypeDesc::TypeMatrix) return sizeof(Transform); else return sizeof(float3); } size_t Attribute::element_size(Mesh *mesh, AttributePrimitive prim) const { if(flags & ATTR_FINAL_SIZE) { return buffer.size() / data_sizeof(); } size_t size; switch(element) { case ATTR_ELEMENT_OBJECT: case ATTR_ELEMENT_MESH: case ATTR_ELEMENT_VOXEL: size = 1; break; case ATTR_ELEMENT_VERTEX: size = mesh->verts.size() + mesh->num_ngons; if(prim == ATTR_PRIM_SUBD) { size -= mesh->num_subd_verts; } break; case ATTR_ELEMENT_VERTEX_MOTION: size = (mesh->verts.size() + mesh->num_ngons) * (mesh->motion_steps - 1); if(prim == ATTR_PRIM_SUBD) { size -= mesh->num_subd_verts * (mesh->motion_steps - 1); } break; case ATTR_ELEMENT_FACE: if(prim == ATTR_PRIM_TRIANGLE) { size = mesh->num_triangles(); } else { size = mesh->subd_faces.size() + mesh->num_ngons; } break; case ATTR_ELEMENT_CORNER: case ATTR_ELEMENT_CORNER_BYTE: if(prim == ATTR_PRIM_TRIANGLE) { size = mesh->num_triangles()*3; } else { size = mesh->subd_face_corners.size() + mesh->num_ngons; } break; case ATTR_ELEMENT_CURVE: size = mesh->num_curves(); break; case ATTR_ELEMENT_CURVE_KEY: size = mesh->curve_keys.size(); break; case ATTR_ELEMENT_CURVE_KEY_MOTION: size = mesh->curve_keys.size() * (mesh->motion_steps - 1); break; default: size = 0; break; } return size; } size_t Attribute::buffer_size(Mesh *mesh, AttributePrimitive prim) const { return element_size(mesh, prim)*data_sizeof(); } bool Attribute::same_storage(TypeDesc a, TypeDesc b) { if(a == b) return true; if(a == TypeDesc::TypeColor || a == TypeDesc::TypePoint || a == TypeDesc::TypeVector || a == TypeDesc::TypeNormal) { if(b == TypeDesc::TypeColor || b == TypeDesc::TypePoint || b == TypeDesc::TypeVector || b == TypeDesc::TypeNormal) { return true; } } return false; } void Attribute::zero_data(void* dst) { memset(dst, 0, data_sizeof()); } void Attribute::add_with_weight(void* dst, void* src, float weight) { if(element == ATTR_ELEMENT_CORNER_BYTE) { for(int i = 0; i < 4; i++) { ((uchar*)dst)[i] += uchar(((uchar*)src)[i] * weight); } } else if(same_storage(type, TypeDesc::TypeFloat)) { *((float*)dst) += *((float*)src) * weight; } else if(same_storage(type, TypeDesc::TypeVector)) { *((float4*)dst) += *((float4*)src) * weight; } else { assert(!"not implemented for this type"); } } const char *Attribute::standard_name(AttributeStandard std) { switch(std) { case ATTR_STD_VERTEX_NORMAL: return "N"; case ATTR_STD_FACE_NORMAL: return "Ng"; case ATTR_STD_UV: return "uv"; case ATTR_STD_GENERATED: return "generated"; case ATTR_STD_GENERATED_TRANSFORM: return "generated_transform"; case ATTR_STD_UV_TANGENT: return "tangent"; case ATTR_STD_UV_TANGENT_SIGN: return "tangent_sign"; case ATTR_STD_POSITION_UNDEFORMED: return "undeformed"; case ATTR_STD_POSITION_UNDISPLACED: return "undisplaced"; case ATTR_STD_MOTION_VERTEX_POSITION: return "motion_P"; case ATTR_STD_MOTION_VERTEX_NORMAL: return "motion_N"; case ATTR_STD_PARTICLE: return "particle"; case ATTR_STD_CURVE_INTERCEPT: return "curve_intercept"; case ATTR_STD_CURVE_RANDOM: return "curve_random"; case ATTR_STD_PTEX_FACE_ID: return "ptex_face_id"; case ATTR_STD_PTEX_UV: return "ptex_uv"; case ATTR_STD_VOLUME_DENSITY: return "density"; case ATTR_STD_VOLUME_COLOR: return "color"; case ATTR_STD_VOLUME_FLAME: return "flame"; case ATTR_STD_VOLUME_HEAT: return "heat"; case ATTR_STD_VOLUME_TEMPERATURE: return "temperature"; case ATTR_STD_VOLUME_VELOCITY: return "velocity"; case ATTR_STD_POINTINESS: return "pointiness"; case ATTR_STD_NOT_FOUND: case ATTR_STD_NONE: case ATTR_STD_NUM: return ""; } return ""; } AttributeStandard Attribute::name_standard(const char *name) { if(name) { for(int std = ATTR_STD_NONE; std < ATTR_STD_NUM; std++) { if(strcmp(name, Attribute::standard_name((AttributeStandard)std)) == 0) { return (AttributeStandard)std; } } } return ATTR_STD_NONE; } /* Attribute Set */ AttributeSet::AttributeSet() { triangle_mesh = NULL; curve_mesh = NULL; subd_mesh = NULL; } AttributeSet::~AttributeSet() { } Attribute *AttributeSet::add(ustring name, TypeDesc type, AttributeElement element) { Attribute *attr = find(name); if(attr) { /* return if same already exists */ if(attr->type == type && attr->element == element) return attr; /* overwrite attribute with same name but different type/element */ remove(name); } #if __cplusplus >= 201103L attributes.emplace_back(); attr = &attributes.back(); attr->set(name, type, element); #else { Attribute attr_temp; attr_temp.set(name, type, element); attributes.push_back(attr_temp); attr = &attributes.back(); } #endif /* this is weak .. */ if(triangle_mesh) attr->resize(triangle_mesh, ATTR_PRIM_TRIANGLE, false); if(curve_mesh) attr->resize(curve_mesh, ATTR_PRIM_CURVE, false); if(subd_mesh) attr->resize(subd_mesh, ATTR_PRIM_SUBD, false); return attr; } Attribute *AttributeSet::find(ustring name) const { foreach(const Attribute& attr, attributes) if(attr.name == name) return (Attribute*)&attr; return NULL; } void AttributeSet::remove(ustring name) { Attribute *attr = find(name); if(attr) { list::iterator it; for(it = attributes.begin(); it != attributes.end(); it++) { if(&*it == attr) { attributes.erase(it); return; } } } } Attribute *AttributeSet::add(AttributeStandard std, ustring name) { Attribute *attr = NULL; if(name == ustring()) name = Attribute::standard_name(std); if(triangle_mesh || subd_mesh) { switch(std) { case ATTR_STD_VERTEX_NORMAL: attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_FACE_NORMAL: attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_FACE); break; case ATTR_STD_UV: attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CORNER); break; case ATTR_STD_UV_TANGENT: attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CORNER); break; case ATTR_STD_UV_TANGENT_SIGN: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CORNER); break; case ATTR_STD_GENERATED: case ATTR_STD_POSITION_UNDEFORMED: case ATTR_STD_POSITION_UNDISPLACED: attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_MOTION_VERTEX_POSITION: attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX_MOTION); break; case ATTR_STD_MOTION_VERTEX_NORMAL: attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_VERTEX_MOTION); break; case ATTR_STD_PTEX_FACE_ID: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE); break; case ATTR_STD_PTEX_UV: attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_VERTEX); break; case ATTR_STD_GENERATED_TRANSFORM: attr = add(name, TypeDesc::TypeMatrix, ATTR_ELEMENT_MESH); break; case ATTR_STD_VOLUME_DENSITY: case ATTR_STD_VOLUME_FLAME: case ATTR_STD_VOLUME_HEAT: case ATTR_STD_VOLUME_TEMPERATURE: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); break; case ATTR_STD_VOLUME_COLOR: attr = add(name, TypeDesc::TypeColor, ATTR_ELEMENT_VOXEL); break; case ATTR_STD_VOLUME_VELOCITY: attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_VOXEL); break; case ATTR_STD_POINTINESS: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX); break; default: assert(0); break; } } else if(curve_mesh) { switch(std) { case ATTR_STD_UV: case ATTR_STD_GENERATED: attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); break; case ATTR_STD_MOTION_VERTEX_POSITION: attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_KEY_MOTION); break; case ATTR_STD_CURVE_INTERCEPT: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY); break; case ATTR_STD_CURVE_RANDOM: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE); break; case ATTR_STD_GENERATED_TRANSFORM: attr = add(name, TypeDesc::TypeMatrix, ATTR_ELEMENT_MESH); break; case ATTR_STD_POINTINESS: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX); break; default: assert(0); break; } } attr->std = std; return attr; } Attribute *AttributeSet::find(AttributeStandard std) const { foreach(const Attribute& attr, attributes) if(attr.std == std) return (Attribute*)&attr; return NULL; } void AttributeSet::remove(AttributeStandard std) { Attribute *attr = find(std); if(attr) { list::iterator it; for(it = attributes.begin(); it != attributes.end(); it++) { if(&*it == attr) { attributes.erase(it); return; } } } } Attribute *AttributeSet::find(AttributeRequest& req) { if(req.std == ATTR_STD_NONE) return find(req.name); else return find(req.std); } void AttributeSet::remove(Attribute *attribute) { if(attribute->std == ATTR_STD_NONE) { remove(attribute->name); } else { remove(attribute->std); } } void AttributeSet::resize(bool reserve_only) { foreach(Attribute& attr, attributes) { if(triangle_mesh) attr.resize(triangle_mesh, ATTR_PRIM_TRIANGLE, reserve_only); if(curve_mesh) attr.resize(curve_mesh, ATTR_PRIM_CURVE, reserve_only); if(subd_mesh) attr.resize(subd_mesh, ATTR_PRIM_SUBD, reserve_only); } } void AttributeSet::clear() { attributes.clear(); } /* AttributeRequest */ AttributeRequest::AttributeRequest(ustring name_) { name = name_; std = ATTR_STD_NONE; triangle_type = TypeDesc::TypeFloat; triangle_desc.element = ATTR_ELEMENT_NONE; triangle_desc.offset = 0; triangle_desc.type = NODE_ATTR_FLOAT; curve_type = TypeDesc::TypeFloat; curve_desc.element = ATTR_ELEMENT_NONE; curve_desc.offset = 0; curve_desc.type = NODE_ATTR_FLOAT; subd_type = TypeDesc::TypeFloat; subd_desc.element = ATTR_ELEMENT_NONE; subd_desc.offset = 0; subd_desc.type = NODE_ATTR_FLOAT; } AttributeRequest::AttributeRequest(AttributeStandard std_) { name = ustring(); std = std_; triangle_type = TypeDesc::TypeFloat; triangle_desc.element = ATTR_ELEMENT_NONE; triangle_desc.offset = 0; triangle_desc.type = NODE_ATTR_FLOAT; curve_type = TypeDesc::TypeFloat; curve_desc.element = ATTR_ELEMENT_NONE; curve_desc.offset = 0; curve_desc.type = NODE_ATTR_FLOAT; subd_type = TypeDesc::TypeFloat; subd_desc.element = ATTR_ELEMENT_NONE; subd_desc.offset = 0; subd_desc.type = NODE_ATTR_FLOAT; } /* AttributeRequestSet */ AttributeRequestSet::AttributeRequestSet() { } AttributeRequestSet::~AttributeRequestSet() { } bool AttributeRequestSet::modified(const AttributeRequestSet& other) { if(requests.size() != other.requests.size()) return true; for(size_t i = 0; i < requests.size(); i++) { bool found = false; for(size_t j = 0; j < requests.size() && !found; j++) if(requests[i].name == other.requests[j].name && requests[i].std == other.requests[j].std) { found = true; } if(!found) { return true; } } return false; } void AttributeRequestSet::add(ustring name) { foreach(AttributeRequest& req, requests) { if(req.name == name) { return; } } requests.push_back(AttributeRequest(name)); } void AttributeRequestSet::add(AttributeStandard std) { foreach(AttributeRequest& req, requests) if(req.std == std) return; requests.push_back(AttributeRequest(std)); } void AttributeRequestSet::add(AttributeRequestSet& reqs) { foreach(AttributeRequest& req, reqs.requests) { if(req.std == ATTR_STD_NONE) add(req.name); else add(req.std); } } void AttributeRequestSet::add_standard(ustring name) { if(!name) { return; } AttributeStandard std = Attribute::name_standard(name.c_str()); if(std) { add(std); } else { add(name); } } bool AttributeRequestSet::find(ustring name) { foreach(AttributeRequest& req, requests) if(req.name == name) return true; return false; } bool AttributeRequestSet::find(AttributeStandard std) { foreach(AttributeRequest& req, requests) if(req.std == std) return true; return false; } size_t AttributeRequestSet::size() { return requests.size(); } void AttributeRequestSet::clear() { requests.clear(); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/attribute.h000066400000000000000000000112201334742672700220240ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __ATTRIBUTE_H__ #define __ATTRIBUTE_H__ #include "kernel/kernel_types.h" #include "util/util_list.h" #include "util/util_param.h" #include "util/util_types.h" #include "util/util_ustring.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Attribute; class AttributeRequest; class AttributeRequestSet; class AttributeSet; class ImageManager; class Mesh; struct Transform; /* Attributes for voxels are images */ struct VoxelAttribute { ImageManager *manager; int slot; }; /* Attribute * * Arbitrary data layers on meshes. * Supported types: Float, Color, Vector, Normal, Point */ class Attribute { public: ustring name; AttributeStandard std; TypeDesc type; vector buffer; AttributeElement element; uint flags; /* enum AttributeFlag */ Attribute() {} ~Attribute(); void set(ustring name, TypeDesc type, AttributeElement element); void resize(Mesh *mesh, AttributePrimitive prim, bool reserve_only); void resize(size_t num_elements); size_t data_sizeof() const; size_t element_size(Mesh *mesh, AttributePrimitive prim) const; size_t buffer_size(Mesh *mesh, AttributePrimitive prim) const; char *data() { return (buffer.size())? &buffer[0]: NULL; }; float3 *data_float3() { return (float3*)data(); } float4 *data_float4() { return (float4*)data(); } float *data_float() { return (float*)data(); } uchar4 *data_uchar4() { return (uchar4*)data(); } Transform *data_transform() { return (Transform*)data(); } VoxelAttribute *data_voxel() { return ( VoxelAttribute*)data(); } const char *data() const { return (buffer.size())? &buffer[0]: NULL; } const float3 *data_float3() const { return (const float3*)data(); } const float4 *data_float4() const { return (const float4*)data(); } const float *data_float() const { return (const float*)data(); } const Transform *data_transform() const { return (const Transform*)data(); } const VoxelAttribute *data_voxel() const { return (const VoxelAttribute*)data(); } void zero_data(void* dst); void add_with_weight(void* dst, void* src, float weight); void add(const float& f); void add(const float3& f); void add(const uchar4& f); void add(const Transform& f); void add(const VoxelAttribute& f); void add(const char *data); static bool same_storage(TypeDesc a, TypeDesc b); static const char *standard_name(AttributeStandard std); static AttributeStandard name_standard(const char *name); }; /* Attribute Set * * Set of attributes on a mesh. */ class AttributeSet { public: Mesh *triangle_mesh; Mesh *curve_mesh; Mesh *subd_mesh; list attributes; AttributeSet(); ~AttributeSet(); Attribute *add(ustring name, TypeDesc type, AttributeElement element); Attribute *find(ustring name) const; void remove(ustring name); Attribute *add(AttributeStandard std, ustring name = ustring()); Attribute *find(AttributeStandard std) const; void remove(AttributeStandard std); Attribute *find(AttributeRequest& req); void remove(Attribute *attribute); void resize(bool reserve_only = false); void clear(); }; /* AttributeRequest * * Request from a shader to use a certain attribute, so we can figure out * which ones we need to export from the host app end store for the kernel. * The attribute is found either by name or by standard attribute type. */ class AttributeRequest { public: ustring name; AttributeStandard std; /* temporary variables used by MeshManager */ TypeDesc triangle_type, curve_type, subd_type; AttributeDescriptor triangle_desc, curve_desc, subd_desc; explicit AttributeRequest(ustring name_); explicit AttributeRequest(AttributeStandard std); }; /* AttributeRequestSet * * Set of attributes requested by a shader. */ class AttributeRequestSet { public: vector requests; AttributeRequestSet(); ~AttributeRequestSet(); void add(ustring name); void add(AttributeStandard std); void add(AttributeRequestSet& reqs); void add_standard(ustring name); bool find(ustring name); bool find(AttributeStandard std); size_t size(); void clear(); bool modified(const AttributeRequestSet& other); }; CCL_NAMESPACE_END #endif /* __ATTRIBUTE_H__ */ goxel-0.8.1/ext_src/cycles/src/render/background.cpp000066400000000000000000000074141334742672700225050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/background.h" #include "device/device.h" #include "render/integrator.h" #include "render/graph.h" #include "render/nodes.h" #include "render/scene.h" #include "render/shader.h" #include "util/util_foreach.h" #include "util/util_math.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN NODE_DEFINE(Background) { NodeType* type = NodeType::add("background", create); SOCKET_FLOAT(ao_factor, "AO Factor", 0.0f); SOCKET_FLOAT(ao_distance, "AO Distance", FLT_MAX); SOCKET_BOOLEAN(use_shader, "Use Shader", true); SOCKET_BOOLEAN(use_ao, "Use AO", false); SOCKET_UINT(visibility, "Visibility", PATH_RAY_ALL_VISIBILITY); SOCKET_BOOLEAN(transparent, "Transparent", false); SOCKET_BOOLEAN(transparent_glass, "Transparent Glass", false); SOCKET_FLOAT(transparent_roughness_threshold, "Transparent Roughness Threshold", 0.0f); SOCKET_NODE(shader, "Shader", &Shader::node_type); return type; } Background::Background() : Node(node_type) { need_update = true; } Background::~Background() { } void Background::device_update(Device *device, DeviceScene *dscene, Scene *scene) { if(!need_update) return; device_free(device, dscene); Shader *bg_shader = shader; if(use_shader) { if(!bg_shader) bg_shader = scene->default_background; } else bg_shader = scene->default_empty; /* set shader index and transparent option */ KernelBackground *kbackground = &dscene->data.background; kbackground->ao_factor = (use_ao)? ao_factor: 0.0f; kbackground->ao_bounces_factor = ao_factor; kbackground->ao_distance = ao_distance; kbackground->transparent = transparent; kbackground->surface_shader = scene->shader_manager->get_shader_id(bg_shader); if(transparent && transparent_glass) { /* Square twice, once for principled BSDF convention, and once for * faster comparison in kernel with anisotropic roughness. */ kbackground->transparent_roughness_squared_threshold = sqr(sqr(transparent_roughness_threshold)); } else { kbackground->transparent_roughness_squared_threshold = -1.0f; } if(bg_shader->has_volume) kbackground->volume_shader = kbackground->surface_shader; else kbackground->volume_shader = SHADER_NONE; /* No background node, make world shader invisible to all rays, to skip evaluation in kernel. */ if(bg_shader->graph->nodes.size() <= 1) { kbackground->surface_shader |= SHADER_EXCLUDE_ANY; } /* Background present, check visibilities */ else { if(!(visibility & PATH_RAY_DIFFUSE)) kbackground->surface_shader |= SHADER_EXCLUDE_DIFFUSE; if(!(visibility & PATH_RAY_GLOSSY)) kbackground->surface_shader |= SHADER_EXCLUDE_GLOSSY; if(!(visibility & PATH_RAY_TRANSMIT)) kbackground->surface_shader |= SHADER_EXCLUDE_TRANSMIT; if(!(visibility & PATH_RAY_VOLUME_SCATTER)) kbackground->surface_shader |= SHADER_EXCLUDE_SCATTER; if(!(visibility & PATH_RAY_CAMERA)) kbackground->surface_shader |= SHADER_EXCLUDE_CAMERA; } need_update = false; } void Background::device_free(Device * /*device*/, DeviceScene * /*dscene*/) { } bool Background::modified(const Background& background) { return !Node::equals(background); } void Background::tag_update(Scene *scene) { scene->integrator->tag_update(scene); need_update = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/background.h000066400000000000000000000025121334742672700221440ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BACKGROUND_H__ #define __BACKGROUND_H__ #include "graph/node.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Scene; class Shader; class Background : public Node { public: NODE_DECLARE float ao_factor; float ao_distance; bool use_shader; bool use_ao; uint visibility; Shader *shader; bool transparent; bool transparent_glass; float transparent_roughness_threshold; bool need_update; Background(); ~Background(); void device_update(Device *device, DeviceScene *dscene, Scene *scene); void device_free(Device *device, DeviceScene *dscene); bool modified(const Background& background); void tag_update(Scene *scene); }; CCL_NAMESPACE_END #endif /* __BACKGROUND_H__ */ goxel-0.8.1/ext_src/cycles/src/render/bake.cpp000066400000000000000000000162201334742672700212630ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/bake.h" #include "render/mesh.h" #include "render/object.h" #include "render/shader.h" #include "render/integrator.h" #include "util/util_foreach.h" CCL_NAMESPACE_BEGIN BakeData::BakeData(const int object, const size_t tri_offset, const size_t num_pixels): m_object(object), m_tri_offset(tri_offset), m_num_pixels(num_pixels) { m_primitive.resize(num_pixels); m_u.resize(num_pixels); m_v.resize(num_pixels); m_dudx.resize(num_pixels); m_dudy.resize(num_pixels); m_dvdx.resize(num_pixels); m_dvdy.resize(num_pixels); } BakeData::~BakeData() { m_primitive.clear(); m_u.clear(); m_v.clear(); m_dudx.clear(); m_dudy.clear(); m_dvdx.clear(); m_dvdy.clear(); } void BakeData::set(int i, int prim, float uv[2], float dudx, float dudy, float dvdx, float dvdy) { m_primitive[i] = (prim == -1 ? -1 : m_tri_offset + prim); m_u[i] = uv[0]; m_v[i] = uv[1]; m_dudx[i] = dudx; m_dudy[i] = dudy; m_dvdx[i] = dvdx; m_dvdy[i] = dvdy; } void BakeData::set_null(int i) { m_primitive[i] = -1; } int BakeData::object() { return m_object; } size_t BakeData::size() { return m_num_pixels; } bool BakeData::is_valid(int i) { return m_primitive[i] != -1; } uint4 BakeData::data(int i) { return make_uint4( m_object, m_primitive[i], __float_as_int(m_u[i]), __float_as_int(m_v[i]) ); } uint4 BakeData::differentials(int i) { return make_uint4( __float_as_int(m_dudx[i]), __float_as_int(m_dudy[i]), __float_as_int(m_dvdx[i]), __float_as_int(m_dvdy[i]) ); } BakeManager::BakeManager() { m_bake_data = NULL; m_is_baking = false; need_update = true; m_shader_limit = 512 * 512; } BakeManager::~BakeManager() { if(m_bake_data) delete m_bake_data; } bool BakeManager::get_baking() { return m_is_baking; } void BakeManager::set_baking(const bool value) { m_is_baking = value; } BakeData *BakeManager::init(const int object, const size_t tri_offset, const size_t num_pixels) { m_bake_data = new BakeData(object, tri_offset, num_pixels); return m_bake_data; } void BakeManager::set_shader_limit(const size_t x, const size_t y) { m_shader_limit = x * y; m_shader_limit = (size_t)pow(2, ceil(log(m_shader_limit)/log(2))); } bool BakeManager::bake(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress, ShaderEvalType shader_type, const int pass_filter, BakeData *bake_data, float result[]) { size_t num_pixels = bake_data->size(); int num_samples = aa_samples(scene, bake_data, shader_type); /* calculate the total pixel samples for the progress bar */ total_pixel_samples = 0; for(size_t shader_offset = 0; shader_offset < num_pixels; shader_offset += m_shader_limit) { size_t shader_size = (size_t)fminf(num_pixels - shader_offset, m_shader_limit); total_pixel_samples += shader_size * num_samples; } progress.reset_sample(); progress.set_total_pixel_samples(total_pixel_samples); /* needs to be up to date for baking specific AA samples */ dscene->data.integrator.aa_samples = num_samples; device->const_copy_to("__data", &dscene->data, sizeof(dscene->data)); for(size_t shader_offset = 0; shader_offset < num_pixels; shader_offset += m_shader_limit) { size_t shader_size = (size_t)fminf(num_pixels - shader_offset, m_shader_limit); /* setup input for device task */ device_vector d_input(device, "bake_input", MEM_READ_ONLY); uint4 *d_input_data = d_input.alloc(shader_size * 2); size_t d_input_size = 0; for(size_t i = shader_offset; i < (shader_offset + shader_size); i++) { d_input_data[d_input_size++] = bake_data->data(i); d_input_data[d_input_size++] = bake_data->differentials(i); } if(d_input_size == 0) { m_is_baking = false; return false; } /* run device task */ device_vector d_output(device, "bake_output", MEM_READ_WRITE); d_output.alloc(shader_size); d_output.zero_to_device(); d_input.copy_to_device(); DeviceTask task(DeviceTask::SHADER); task.shader_input = d_input.device_pointer; task.shader_output = d_output.device_pointer; task.shader_eval_type = shader_type; task.shader_filter = pass_filter; task.shader_x = 0; task.offset = shader_offset; task.shader_w = d_output.size(); task.num_samples = num_samples; task.get_cancel = function_bind(&Progress::get_cancel, &progress); task.update_progress_sample = function_bind(&Progress::add_samples_update, &progress, _1, _2); device->task_add(task); device->task_wait(); if(progress.get_cancel()) { d_input.free(); d_output.free(); m_is_baking = false; return false; } d_output.copy_from_device(0, 1, d_output.size()); d_input.free(); /* read result */ int k = 0; float4 *offset = d_output.data(); size_t depth = 4; for(size_t i=shader_offset; i < (shader_offset + shader_size); i++) { size_t index = i * depth; float4 out = offset[k++]; if(bake_data->is_valid(i)) { for(size_t j=0; j < 4; j++) { result[index + j] = out[j]; } } } d_output.free(); } m_is_baking = false; return true; } void BakeManager::device_update(Device * /*device*/, DeviceScene * /*dscene*/, Scene * /*scene*/, Progress& progress) { if(!need_update) return; if(progress.get_cancel()) return; need_update = false; } void BakeManager::device_free(Device * /*device*/, DeviceScene * /*dscene*/) { } int BakeManager::aa_samples(Scene *scene, BakeData *bake_data, ShaderEvalType type) { if(type == SHADER_EVAL_UV) { return 1; } else if(type == SHADER_EVAL_NORMAL) { /* Only antialias normal if mesh has bump mapping. */ Object *object = scene->objects[bake_data->object()]; if(object->mesh) { foreach(Shader *shader, object->mesh->used_shaders) { if(shader->has_bump) { return scene->integrator->aa_samples; } } } return 1; } else { return scene->integrator->aa_samples; } } /* Keep it synced with kernel_bake.h logic */ int BakeManager::shader_type_to_pass_filter(ShaderEvalType type, const int pass_filter) { const int component_flags = pass_filter & (BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT | BAKE_FILTER_COLOR); switch(type) { case SHADER_EVAL_AO: return BAKE_FILTER_AO; case SHADER_EVAL_SHADOW: return BAKE_FILTER_DIRECT; case SHADER_EVAL_DIFFUSE: return BAKE_FILTER_DIFFUSE | component_flags; case SHADER_EVAL_GLOSSY: return BAKE_FILTER_GLOSSY | component_flags; case SHADER_EVAL_TRANSMISSION: return BAKE_FILTER_TRANSMISSION | component_flags; case SHADER_EVAL_SUBSURFACE: return BAKE_FILTER_SUBSURFACE | component_flags; case SHADER_EVAL_COMBINED: return pass_filter; default: return 0; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/bake.h000066400000000000000000000043251334742672700207330ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BAKE_H__ #define __BAKE_H__ #include "device/device.h" #include "render/scene.h" #include "util/util_progress.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class BakeData { public: BakeData(const int object, const size_t tri_offset, const size_t num_pixels); ~BakeData(); void set(int i, int prim, float uv[2], float dudx, float dudy, float dvdx, float dvdy); void set_null(int i); int object(); size_t size(); uint4 data(int i); uint4 differentials(int i); bool is_valid(int i); private: int m_object; size_t m_tri_offset; size_t m_num_pixels; vectorm_primitive; vectorm_u; vectorm_v; vectorm_dudx; vectorm_dudy; vectorm_dvdx; vectorm_dvdy; }; class BakeManager { public: BakeManager(); ~BakeManager(); bool get_baking(); void set_baking(const bool value); BakeData *init(const int object, const size_t tri_offset, const size_t num_pixels); void set_shader_limit(const size_t x, const size_t y); bool bake(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress, ShaderEvalType shader_type, const int pass_filter, BakeData *bake_data, float result[]); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free(Device *device, DeviceScene *dscene); static int shader_type_to_pass_filter(ShaderEvalType type, const int pass_filter); static int aa_samples(Scene *scene, BakeData *bake_data, ShaderEvalType type); bool need_update; size_t total_pixel_samples; private: BakeData *m_bake_data; bool m_is_baking; size_t m_shader_limit; }; CCL_NAMESPACE_END #endif /* __BAKE_H__ */ goxel-0.8.1/ext_src/cycles/src/render/buffers.cpp000066400000000000000000000264471334742672700220310ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "render/buffers.h" #include "device/device.h" #include "util/util_foreach.h" #include "util/util_hash.h" #include "util/util_image.h" #include "util/util_math.h" #include "util/util_opengl.h" #include "util/util_time.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* Buffer Params */ BufferParams::BufferParams() { width = 0; height = 0; full_x = 0; full_y = 0; full_width = 0; full_height = 0; denoising_data_pass = false; denoising_clean_pass = false; Pass::add(PASS_COMBINED, passes); } void BufferParams::get_offset_stride(int& offset, int& stride) { offset = -(full_x + full_y*width); stride = width; } bool BufferParams::modified(const BufferParams& params) { return !(full_x == params.full_x && full_y == params.full_y && width == params.width && height == params.height && full_width == params.full_width && full_height == params.full_height && Pass::equals(passes, params.passes)); } int BufferParams::get_passes_size() { int size = 0; for(size_t i = 0; i < passes.size(); i++) size += passes[i].components; if(denoising_data_pass) { size += DENOISING_PASS_SIZE_BASE; if(denoising_clean_pass) size += DENOISING_PASS_SIZE_CLEAN; } return align_up(size, 4); } int BufferParams::get_denoising_offset() { int offset = 0; for(size_t i = 0; i < passes.size(); i++) offset += passes[i].components; return offset; } /* Render Buffer Task */ RenderTile::RenderTile() { x = 0; y = 0; w = 0; h = 0; sample = 0; start_sample = 0; num_samples = 0; resolution = 0; offset = 0; stride = 0; buffer = 0; buffers = NULL; } /* Render Buffers */ RenderBuffers::RenderBuffers(Device *device) : buffer(device, "RenderBuffers", MEM_READ_WRITE), map_neighbor_copied(false), render_time(0.0f) { } RenderBuffers::~RenderBuffers() { buffer.free(); } void RenderBuffers::reset(BufferParams& params_) { params = params_; /* re-allocate buffer */ buffer.alloc(params.width*params.height*params.get_passes_size()); buffer.zero_to_device(); } void RenderBuffers::zero() { buffer.zero_to_device(); } bool RenderBuffers::copy_from_device() { if(!buffer.device_pointer) return false; buffer.copy_from_device(0, params.width * params.get_passes_size(), params.height); return true; } bool RenderBuffers::get_denoising_pass_rect(int offset, float exposure, int sample, int components, float *pixels) { if(buffer.data() == NULL) { return false; } float invsample = 1.0f/sample; float scale = invsample; bool variance = (offset == DENOISING_PASS_NORMAL_VAR) || (offset == DENOISING_PASS_ALBEDO_VAR) || (offset == DENOISING_PASS_DEPTH_VAR) || (offset == DENOISING_PASS_COLOR_VAR); if(offset == DENOISING_PASS_COLOR) { scale *= exposure; } else if(offset == DENOISING_PASS_COLOR_VAR) { scale *= exposure*exposure; } offset += params.get_denoising_offset(); int pass_stride = params.get_passes_size(); int size = params.width*params.height; if(variance) { /* Approximate variance as E[x^2] - 1/N * (E[x])^2, since online variance * update does not work efficiently with atomics in the kernel. */ int mean_offset = offset - components; float *mean = buffer.data() + mean_offset; float *var = buffer.data() + offset; assert(mean_offset >= 0); if(components == 1) { for(int i = 0; i < size; i++, mean += pass_stride, var += pass_stride, pixels++) { pixels[0] = max(0.0f, var[0] - mean[0]*mean[0]*invsample)*scale; } } else if(components == 3) { for(int i = 0; i < size; i++, mean += pass_stride, var += pass_stride, pixels += 3) { pixels[0] = max(0.0f, var[0] - mean[0]*mean[0]*invsample)*scale; pixels[1] = max(0.0f, var[1] - mean[1]*mean[1]*invsample)*scale; pixels[2] = max(0.0f, var[2] - mean[2]*mean[2]*invsample)*scale; } } else { return false; } } else { float *in = buffer.data() + offset; if(components == 1) { for(int i = 0; i < size; i++, in += pass_stride, pixels++) { pixels[0] = in[0]*scale; } } else if(components == 3) { for(int i = 0; i < size; i++, in += pass_stride, pixels += 3) { pixels[0] = in[0]*scale; pixels[1] = in[1]*scale; pixels[2] = in[2]*scale; } } else { return false; } } return true; } bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int components, float *pixels) { if(buffer.data() == NULL) { return false; } int pass_offset = 0; for(size_t j = 0; j < params.passes.size(); j++) { Pass& pass = params.passes[j]; if(pass.type != type) { pass_offset += pass.components; continue; } float *in = buffer.data() + pass_offset; int pass_stride = params.get_passes_size(); float scale = (pass.filter)? 1.0f/(float)sample: 1.0f; float scale_exposure = (pass.exposure)? scale*exposure: scale; int size = params.width*params.height; if(components == 1 && type == PASS_RENDER_TIME) { /* Render time is not stored by kernel, but measured per tile. */ float val = (float) (1000.0 * render_time/(params.width * params.height * sample)); for(int i = 0; i < size; i++, pixels++) { pixels[0] = val; } } else if(components == 1) { assert(pass.components == components); /* Scalar */ if(type == PASS_DEPTH) { for(int i = 0; i < size; i++, in += pass_stride, pixels++) { float f = *in; pixels[0] = (f == 0.0f)? 1e10f: f*scale_exposure; } } else if(type == PASS_MIST) { for(int i = 0; i < size; i++, in += pass_stride, pixels++) { float f = *in; pixels[0] = saturate(f*scale_exposure); } } #ifdef WITH_CYCLES_DEBUG else if(type == PASS_BVH_TRAVERSED_NODES || type == PASS_BVH_TRAVERSED_INSTANCES || type == PASS_BVH_INTERSECTIONS || type == PASS_RAY_BOUNCES) { for(int i = 0; i < size; i++, in += pass_stride, pixels++) { float f = *in; pixels[0] = f*scale; } } #endif else { for(int i = 0; i < size; i++, in += pass_stride, pixels++) { float f = *in; pixels[0] = f*scale_exposure; } } } else if(components == 3) { assert(pass.components == 4); /* RGBA */ if(type == PASS_SHADOW) { for(int i = 0; i < size; i++, in += pass_stride, pixels += 3) { float4 f = make_float4(in[0], in[1], in[2], in[3]); float invw = (f.w > 0.0f)? 1.0f/f.w: 1.0f; pixels[0] = f.x*invw; pixels[1] = f.y*invw; pixels[2] = f.z*invw; } } else if(pass.divide_type != PASS_NONE) { /* RGB lighting passes that need to divide out color */ pass_offset = 0; for(size_t k = 0; k < params.passes.size(); k++) { Pass& color_pass = params.passes[k]; if(color_pass.type == pass.divide_type) break; pass_offset += color_pass.components; } float *in_divide = buffer.data() + pass_offset; for(int i = 0; i < size; i++, in += pass_stride, in_divide += pass_stride, pixels += 3) { float3 f = make_float3(in[0], in[1], in[2]); float3 f_divide = make_float3(in_divide[0], in_divide[1], in_divide[2]); f = safe_divide_even_color(f*exposure, f_divide); pixels[0] = f.x; pixels[1] = f.y; pixels[2] = f.z; } } else { /* RGB/vector */ for(int i = 0; i < size; i++, in += pass_stride, pixels += 3) { float3 f = make_float3(in[0], in[1], in[2]); pixels[0] = f.x*scale_exposure; pixels[1] = f.y*scale_exposure; pixels[2] = f.z*scale_exposure; } } } else if(components == 4) { assert(pass.components == components); /* RGBA */ if(type == PASS_SHADOW) { for(int i = 0; i < size; i++, in += pass_stride, pixels += 4) { float4 f = make_float4(in[0], in[1], in[2], in[3]); float invw = (f.w > 0.0f)? 1.0f/f.w: 1.0f; pixels[0] = f.x*invw; pixels[1] = f.y*invw; pixels[2] = f.z*invw; pixels[3] = 1.0f; } } else if(type == PASS_MOTION) { /* need to normalize by number of samples accumulated for motion */ pass_offset = 0; for(size_t k = 0; k < params.passes.size(); k++) { Pass& color_pass = params.passes[k]; if(color_pass.type == PASS_MOTION_WEIGHT) break; pass_offset += color_pass.components; } float *in_weight = buffer.data() + pass_offset; for(int i = 0; i < size; i++, in += pass_stride, in_weight += pass_stride, pixels += 4) { float4 f = make_float4(in[0], in[1], in[2], in[3]); float w = in_weight[0]; float invw = (w > 0.0f)? 1.0f/w: 0.0f; pixels[0] = f.x*invw; pixels[1] = f.y*invw; pixels[2] = f.z*invw; pixels[3] = f.w*invw; } } else { for(int i = 0; i < size; i++, in += pass_stride, pixels += 4) { float4 f = make_float4(in[0], in[1], in[2], in[3]); pixels[0] = f.x*scale_exposure; pixels[1] = f.y*scale_exposure; pixels[2] = f.z*scale_exposure; /* clamp since alpha might be > 1.0 due to russian roulette */ pixels[3] = saturate(f.w*scale); } } } return true; } return false; } /* Display Buffer */ DisplayBuffer::DisplayBuffer(Device *device, bool linear) : draw_width(0), draw_height(0), transparent(true), /* todo: determine from background */ half_float(linear), rgba_byte(device, "display buffer byte"), rgba_half(device, "display buffer half") { } DisplayBuffer::~DisplayBuffer() { rgba_byte.free(); rgba_half.free(); } void DisplayBuffer::reset(BufferParams& params_) { draw_width = 0; draw_height = 0; params = params_; /* allocate display pixels */ if(half_float) { rgba_half.alloc_to_device(params.width, params.height); } else { rgba_byte.alloc_to_device(params.width, params.height); } } void DisplayBuffer::draw_set(int width, int height) { assert(width <= params.width && height <= params.height); draw_width = width; draw_height = height; } void DisplayBuffer::draw(Device *device, const DeviceDrawParams& draw_params) { if(draw_width != 0 && draw_height != 0) { device_memory& rgba = (half_float)? (device_memory&)rgba_half: (device_memory&)rgba_byte; device->draw_pixels(rgba, 0, draw_width, draw_height, params.full_x, params.full_y, params.width, params.height, transparent, draw_params); } } bool DisplayBuffer::draw_ready() { return (draw_width != 0 && draw_height != 0); } void DisplayBuffer::write(const string& filename) { int w = draw_width; int h = draw_height; if(w == 0 || h == 0) return; if(half_float) return; /* read buffer from device */ uchar4 *pixels = rgba_byte.copy_from_device(0, w, h); /* write image */ ImageOutput *out = ImageOutput::create(filename); ImageSpec spec(w, h, 4, IMG::TypeDesc::UINT8); out->open(filename, spec); /* conversion for different top/bottom convention */ out->write_image(IMG::TypeDesc::UINT8, (uchar*)(pixels + (h-1)*w), AutoStride, -w*sizeof(uchar4), AutoStride); out->close(); delete out; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/buffers.h000066400000000000000000000066371334742672700214750ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BUFFERS_H__ #define __BUFFERS_H__ #include "device/device_memory.h" #include "render/film.h" #include "kernel/kernel_types.h" #include "util/util_half.h" #include "util/util_string.h" #include "util/util_thread.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class Device; struct DeviceDrawParams; struct float4; /* Buffer Parameters * Size of render buffer and how it fits in the full image (border render). */ class BufferParams { public: /* width/height of the physical buffer */ int width; int height; /* offset into and width/height of the full buffer */ int full_x; int full_y; int full_width; int full_height; /* passes */ array passes; bool denoising_data_pass; /* If only some light path types should be denoised, an additional pass is needed. */ bool denoising_clean_pass; /* functions */ BufferParams(); void get_offset_stride(int& offset, int& stride); bool modified(const BufferParams& params); void add_pass(PassType type); int get_passes_size(); int get_denoising_offset(); }; /* Render Buffers */ class RenderBuffers { public: /* buffer parameters */ BufferParams params; /* float buffer */ device_vector buffer; bool map_neighbor_copied; double render_time; explicit RenderBuffers(Device *device); ~RenderBuffers(); void reset(BufferParams& params); void zero(); bool copy_from_device(); bool get_pass_rect(PassType type, float exposure, int sample, int components, float *pixels); bool get_denoising_pass_rect(int offset, float exposure, int sample, int components, float *pixels); }; /* Display Buffer * * The buffer used for drawing during render, filled by converting the render * buffers to byte of half float storage */ class DisplayBuffer { public: /* buffer parameters */ BufferParams params; /* dimensions for how much of the buffer is actually ready for display. * with progressive render we can be using only a subset of the buffer. * if these are zero, it means nothing can be drawn yet */ int draw_width, draw_height; /* draw alpha channel? */ bool transparent; /* use half float? */ bool half_float; /* byte buffer for converted result */ device_pixels rgba_byte; device_pixels rgba_half; DisplayBuffer(Device *device, bool linear = false); ~DisplayBuffer(); void reset(BufferParams& params); void write(const string& filename); void draw_set(int width, int height); void draw(Device *device, const DeviceDrawParams& draw_params); bool draw_ready(); }; /* Render Tile * Rendering task on a buffer */ class RenderTile { public: typedef enum { PATH_TRACE, DENOISE } Task; Task task; int x, y, w, h; int start_sample; int num_samples; int sample; int resolution; int offset; int stride; int tile_index; device_ptr buffer; RenderBuffers *buffers; RenderTile(); }; CCL_NAMESPACE_END #endif /* __BUFFERS_H__ */ goxel-0.8.1/ext_src/cycles/src/render/camera.cpp000066400000000000000000000560131334742672700216150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/camera.h" #include "render/mesh.h" #include "render/object.h" #include "render/scene.h" #include "render/tables.h" #include "device/device.h" #include "util/util_foreach.h" #include "util/util_function.h" #include "util/util_math_cdf.h" #include "util/util_vector.h" /* needed for calculating differentials */ #include "kernel/kernel_compat_cpu.h" #include "kernel/split/kernel_split_data.h" #include "kernel/kernel_globals.h" #include "kernel/kernel_projection.h" #include "kernel/kernel_differential.h" #include "kernel/kernel_montecarlo.h" #include "kernel/kernel_camera.h" CCL_NAMESPACE_BEGIN static float shutter_curve_eval(float x, array& shutter_curve) { if(shutter_curve.size() == 0) { return 1.0f; } x *= shutter_curve.size(); int index = (int)x; float frac = x - index; if(index < shutter_curve.size() - 1) { return lerp(shutter_curve[index], shutter_curve[index + 1], frac); } else { return shutter_curve[shutter_curve.size() - 1]; } } NODE_DEFINE(Camera) { NodeType* type = NodeType::add("camera", create); SOCKET_FLOAT(shuttertime, "Shutter Time", 1.0f); static NodeEnum motion_position_enum; motion_position_enum.insert("start", MOTION_POSITION_START); motion_position_enum.insert("center", MOTION_POSITION_CENTER); motion_position_enum.insert("end", MOTION_POSITION_END); SOCKET_ENUM(motion_position, "Motion Position", motion_position_enum, MOTION_POSITION_CENTER); static NodeEnum rolling_shutter_type_enum; rolling_shutter_type_enum.insert("none", ROLLING_SHUTTER_NONE); rolling_shutter_type_enum.insert("top", ROLLING_SHUTTER_TOP); SOCKET_ENUM(rolling_shutter_type, "Rolling Shutter Type", rolling_shutter_type_enum, ROLLING_SHUTTER_NONE); SOCKET_FLOAT(rolling_shutter_duration, "Rolling Shutter Duration", 0.1f); SOCKET_FLOAT_ARRAY(shutter_curve, "Shutter Curve", array()); SOCKET_FLOAT(aperturesize, "Aperture Size", 0.0f); SOCKET_FLOAT(focaldistance, "Focal Distance", 10.0f); SOCKET_UINT(blades, "Blades", 0); SOCKET_FLOAT(bladesrotation, "Blades Rotation", 0.0f); SOCKET_TRANSFORM(matrix, "Matrix", transform_identity()); SOCKET_FLOAT(aperture_ratio, "Aperture Ratio", 1.0f); static NodeEnum type_enum; type_enum.insert("perspective", CAMERA_PERSPECTIVE); type_enum.insert("orthograph", CAMERA_ORTHOGRAPHIC); type_enum.insert("panorama", CAMERA_PANORAMA); SOCKET_ENUM(type, "Type", type_enum, CAMERA_PERSPECTIVE); static NodeEnum panorama_type_enum; panorama_type_enum.insert("equirectangular", PANORAMA_EQUIRECTANGULAR); panorama_type_enum.insert("mirrorball", PANORAMA_MIRRORBALL); panorama_type_enum.insert("fisheye_equidistant", PANORAMA_FISHEYE_EQUIDISTANT); panorama_type_enum.insert("fisheye_equisolid", PANORAMA_FISHEYE_EQUISOLID); SOCKET_ENUM(panorama_type, "Panorama Type", panorama_type_enum, PANORAMA_EQUIRECTANGULAR); SOCKET_FLOAT(fisheye_fov, "Fisheye FOV", M_PI_F); SOCKET_FLOAT(fisheye_lens, "Fisheye Lens", 10.5f); SOCKET_FLOAT(latitude_min, "Latitude Min", -M_PI_2_F); SOCKET_FLOAT(latitude_max, "Latitude Max", M_PI_2_F); SOCKET_FLOAT(longitude_min, "Longitude Min", -M_PI_F); SOCKET_FLOAT(longitude_max, "Longitude Max", M_PI_F); SOCKET_FLOAT(fov, "FOV", M_PI_4_F); SOCKET_FLOAT(fov_pre, "FOV Pre", M_PI_4_F); SOCKET_FLOAT(fov_post, "FOV Post", M_PI_4_F); static NodeEnum stereo_eye_enum; stereo_eye_enum.insert("none", STEREO_NONE); stereo_eye_enum.insert("left", STEREO_LEFT); stereo_eye_enum.insert("right", STEREO_RIGHT); SOCKET_ENUM(stereo_eye, "Stereo Eye", stereo_eye_enum, STEREO_NONE); SOCKET_FLOAT(interocular_distance, "Interocular Distance", 0.065f); SOCKET_FLOAT(convergence_distance, "Convergence Distance", 30.0f * 0.065f); SOCKET_BOOLEAN(use_pole_merge, "Use Pole Merge", false); SOCKET_FLOAT(pole_merge_angle_from, "Pole Merge Angle From", 60.0f * M_PI_F / 180.0f); SOCKET_FLOAT(pole_merge_angle_to, "Pole Merge Angle To", 75.0f * M_PI_F / 180.0f); SOCKET_FLOAT(sensorwidth, "Sensor Width", 0.036f); SOCKET_FLOAT(sensorheight, "Sensor Height", 0.024f); SOCKET_FLOAT(nearclip, "Near Clip", 1e-5f); SOCKET_FLOAT(farclip, "Far Clip", 1e5f); SOCKET_FLOAT(viewplane.left, "Viewplane Left", 0); SOCKET_FLOAT(viewplane.right, "Viewplane Right", 0); SOCKET_FLOAT(viewplane.bottom, "Viewplane Bottom", 0); SOCKET_FLOAT(viewplane.top, "Viewplane Top", 0); SOCKET_FLOAT(border.left, "Border Left", 0); SOCKET_FLOAT(border.right, "Border Right", 0); SOCKET_FLOAT(border.bottom, "Border Bottom", 0); SOCKET_FLOAT(border.top, "Border Top", 0); SOCKET_FLOAT(offscreen_dicing_scale, "Offscreen Dicing Scale", 1.0f); return type; } Camera::Camera() : Node(node_type) { shutter_table_offset = TABLE_OFFSET_INVALID; width = 1024; height = 512; resolution = 1; motion.pre = transform_identity(); motion.post = transform_identity(); use_motion = false; use_perspective_motion = false; shutter_curve.resize(RAMP_TABLE_SIZE); for(int i = 0; i < shutter_curve.size(); ++i) { shutter_curve[i] = 1.0f; } compute_auto_viewplane(); screentoworld = transform_identity(); rastertoworld = transform_identity(); ndctoworld = transform_identity(); rastertocamera = transform_identity(); cameratoworld = transform_identity(); worldtoraster = transform_identity(); dx = make_float3(0.0f, 0.0f, 0.0f); dy = make_float3(0.0f, 0.0f, 0.0f); need_update = true; need_device_update = true; need_flags_update = true; previous_need_motion = -1; memset(&kernel_camera, 0, sizeof(kernel_camera)); } Camera::~Camera() { } void Camera::compute_auto_viewplane() { if(type == CAMERA_PANORAMA) { viewplane.left = 0.0f; viewplane.right = 1.0f; viewplane.bottom = 0.0f; viewplane.top = 1.0f; } else { float aspect = (float)width/(float)height; if(width >= height) { viewplane.left = -aspect; viewplane.right = aspect; viewplane.bottom = -1.0f; viewplane.top = 1.0f; } else { viewplane.left = -1.0f; viewplane.right = 1.0f; viewplane.bottom = -1.0f/aspect; viewplane.top = 1.0f/aspect; } } } void Camera::update(Scene *scene) { Scene::MotionType need_motion = scene->need_motion(); if(previous_need_motion != need_motion) { /* scene's motion model could have been changed since previous device * camera update this could happen for example in case when one render * layer has got motion pass and another not */ need_device_update = true; } if(!need_update) return; /* Full viewport to camera border in the viewport. */ Transform fulltoborder = transform_from_viewplane(viewport_camera_border); Transform bordertofull = transform_inverse(fulltoborder); /* ndc to raster */ Transform ndctoraster = transform_scale(width, height, 1.0f) * bordertofull; Transform full_ndctoraster = transform_scale(full_width, full_height, 1.0f) * bordertofull; /* raster to screen */ Transform screentondc = fulltoborder * transform_from_viewplane(viewplane); Transform screentoraster = ndctoraster * screentondc; Transform rastertoscreen = transform_inverse(screentoraster); Transform full_screentoraster = full_ndctoraster * screentondc; Transform full_rastertoscreen = transform_inverse(full_screentoraster); /* screen to camera */ Transform cameratoscreen; if(type == CAMERA_PERSPECTIVE) cameratoscreen = transform_perspective(fov, nearclip, farclip); else if(type == CAMERA_ORTHOGRAPHIC) cameratoscreen = transform_orthographic(nearclip, farclip); else cameratoscreen = transform_identity(); Transform screentocamera = transform_inverse(cameratoscreen); rastertocamera = screentocamera * rastertoscreen; Transform full_rastertocamera = screentocamera * full_rastertoscreen; cameratoraster = screentoraster * cameratoscreen; cameratoworld = matrix; screentoworld = cameratoworld * screentocamera; rastertoworld = cameratoworld * rastertocamera; ndctoworld = rastertoworld * ndctoraster; /* note we recompose matrices instead of taking inverses of the above, this * is needed to avoid inverting near degenerate matrices that happen due to * precision issues with large scenes */ worldtocamera = transform_inverse(matrix); worldtoscreen = cameratoscreen * worldtocamera; worldtondc = screentondc * worldtoscreen; worldtoraster = ndctoraster * worldtondc; /* differentials */ if(type == CAMERA_ORTHOGRAPHIC) { dx = transform_direction(&rastertocamera, make_float3(1, 0, 0)); dy = transform_direction(&rastertocamera, make_float3(0, 1, 0)); full_dx = transform_direction(&full_rastertocamera, make_float3(1, 0, 0)); full_dy = transform_direction(&full_rastertocamera, make_float3(0, 1, 0)); } else if(type == CAMERA_PERSPECTIVE) { dx = transform_perspective(&rastertocamera, make_float3(1, 0, 0)) - transform_perspective(&rastertocamera, make_float3(0, 0, 0)); dy = transform_perspective(&rastertocamera, make_float3(0, 1, 0)) - transform_perspective(&rastertocamera, make_float3(0, 0, 0)); full_dx = transform_perspective(&full_rastertocamera, make_float3(1, 0, 0)) - transform_perspective(&full_rastertocamera, make_float3(0, 0, 0)); full_dy = transform_perspective(&full_rastertocamera, make_float3(0, 1, 0)) - transform_perspective(&full_rastertocamera, make_float3(0, 0, 0)); } else { dx = make_float3(0.0f, 0.0f, 0.0f); dy = make_float3(0.0f, 0.0f, 0.0f); } dx = transform_direction(&cameratoworld, dx); dy = transform_direction(&cameratoworld, dy); full_dx = transform_direction(&cameratoworld, full_dx); full_dy = transform_direction(&cameratoworld, full_dy); if(type == CAMERA_PERSPECTIVE) { float3 v = transform_perspective(&full_rastertocamera, make_float3(full_width, full_height, 1.0f)); frustum_right_normal = normalize(make_float3(v.z, 0.0f, -v.x)); frustum_top_normal = normalize(make_float3(0.0f, v.z, -v.y)); } /* TODO(sergey): Support other types of camera. */ if(type == CAMERA_PERSPECTIVE) { /* TODO(sergey): Move to an utility function and de-duplicate with * calculation above. */ Transform screentocamera_pre = transform_inverse(transform_perspective(fov_pre, nearclip, farclip)); Transform screentocamera_post = transform_inverse(transform_perspective(fov_post, nearclip, farclip)); perspective_motion.pre = screentocamera_pre * rastertoscreen; perspective_motion.post = screentocamera_post * rastertoscreen; } /* Compute kernel camera data. */ KernelCamera *kcam = &kernel_camera; /* store matrices */ kcam->screentoworld = screentoworld; kcam->rastertoworld = rastertoworld; kcam->rastertocamera = rastertocamera; kcam->cameratoworld = cameratoworld; kcam->worldtocamera = worldtocamera; kcam->worldtoscreen = worldtoscreen; kcam->worldtoraster = worldtoraster; kcam->worldtondc = worldtondc; /* camera motion */ kcam->have_motion = 0; kcam->have_perspective_motion = 0; if(need_motion == Scene::MOTION_PASS) { /* TODO(sergey): Support perspective (zoom, fov) motion. */ if(type == CAMERA_PANORAMA) { if(use_motion) { kcam->motion.pre = transform_inverse(motion.pre); kcam->motion.post = transform_inverse(motion.post); } else { kcam->motion.pre = kcam->worldtocamera; kcam->motion.post = kcam->worldtocamera; } } else { if(use_motion) { kcam->motion.pre = cameratoraster * transform_inverse(motion.pre); kcam->motion.post = cameratoraster * transform_inverse(motion.post); } else { kcam->motion.pre = worldtoraster; kcam->motion.post = worldtoraster; } } } else if(need_motion == Scene::MOTION_BLUR) { if(use_motion) { transform_motion_decompose(&kcam->motion, &motion, &matrix); kcam->have_motion = 1; } if(use_perspective_motion) { kcam->perspective_motion = perspective_motion; kcam->have_perspective_motion = 1; } } /* depth of field */ kcam->aperturesize = aperturesize; kcam->focaldistance = focaldistance; kcam->blades = (blades < 3)? 0.0f: blades; kcam->bladesrotation = bladesrotation; /* motion blur */ kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: -1.0f; /* type */ kcam->type = type; /* anamorphic lens bokeh */ kcam->inv_aperture_ratio = 1.0f / aperture_ratio; /* panorama */ kcam->panorama_type = panorama_type; kcam->fisheye_fov = fisheye_fov; kcam->fisheye_lens = fisheye_lens; kcam->equirectangular_range = make_float4(longitude_min - longitude_max, -longitude_min, latitude_min - latitude_max, -latitude_min + M_PI_2_F); switch(stereo_eye) { case STEREO_LEFT: kcam->interocular_offset = -interocular_distance * 0.5f; break; case STEREO_RIGHT: kcam->interocular_offset = interocular_distance * 0.5f; break; case STEREO_NONE: default: kcam->interocular_offset = 0.0f; break; } kcam->convergence_distance = convergence_distance; if(use_pole_merge) { kcam->pole_merge_angle_from = pole_merge_angle_from; kcam->pole_merge_angle_to = pole_merge_angle_to; } else { kcam->pole_merge_angle_from = -1.0f; kcam->pole_merge_angle_to = -1.0f; } /* sensor size */ kcam->sensorwidth = sensorwidth; kcam->sensorheight = sensorheight; /* render size */ kcam->width = width; kcam->height = height; kcam->resolution = resolution; /* store differentials */ kcam->dx = float3_to_float4(dx); kcam->dy = float3_to_float4(dy); /* clipping */ kcam->nearclip = nearclip; kcam->cliplength = (farclip == FLT_MAX)? FLT_MAX: farclip - nearclip; /* Camera in volume. */ kcam->is_inside_volume = 0; /* Rolling shutter effect */ kcam->rolling_shutter_type = rolling_shutter_type; kcam->rolling_shutter_duration = rolling_shutter_duration; /* Set further update flags */ need_update = false; need_device_update = true; need_flags_update = true; previous_need_motion = need_motion; } void Camera::device_update(Device * /* device */, DeviceScene *dscene, Scene *scene) { update(scene); if(!need_device_update) return; scene->lookup_tables->remove_table(&shutter_table_offset); if(kernel_camera.shuttertime != -1.0f) { vector shutter_table; util_cdf_inverted(SHUTTER_TABLE_SIZE, 0.0f, 1.0f, function_bind(shutter_curve_eval, _1, shutter_curve), false, shutter_table); shutter_table_offset = scene->lookup_tables->add_table(dscene, shutter_table); kernel_camera.shutter_table_offset = (int)shutter_table_offset; } dscene->data.cam = kernel_camera; } void Camera::device_update_volume(Device * /*device*/, DeviceScene *dscene, Scene *scene) { if(!need_device_update && !need_flags_update) { return; } KernelCamera *kcam = &dscene->data.cam; BoundBox viewplane_boundbox = viewplane_bounds_get(); for(size_t i = 0; i < scene->objects.size(); ++i) { Object *object = scene->objects[i]; if(object->mesh->has_volume && viewplane_boundbox.intersects(object->bounds)) { /* TODO(sergey): Consider adding more grained check. */ kcam->is_inside_volume = 1; break; } } need_device_update = false; need_flags_update = false; } void Camera::device_free(Device * /*device*/, DeviceScene * /*dscene*/, Scene *scene) { scene->lookup_tables->remove_table(&shutter_table_offset); } bool Camera::modified(const Camera& cam) { return !Node::equals(cam); } bool Camera::motion_modified(const Camera& cam) { return !((motion == cam.motion) && (use_motion == cam.use_motion) && (use_perspective_motion == cam.use_perspective_motion)); } void Camera::tag_update() { need_update = true; } float3 Camera::transform_raster_to_world(float raster_x, float raster_y) { float3 D, P; if(type == CAMERA_PERSPECTIVE) { D = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); float3 Pclip = normalize(D); P = make_float3(0.0f, 0.0f, 0.0f); /* TODO(sergey): Aperture support? */ P = transform_point(&cameratoworld, P); D = normalize(transform_direction(&cameratoworld, D)); /* TODO(sergey): Clipping is conditional in kernel, and hence it could * be mistakes in here, currently leading to wrong camera-in-volume * detection. */ P += nearclip * D / Pclip.z; } else if(type == CAMERA_ORTHOGRAPHIC) { D = make_float3(0.0f, 0.0f, 1.0f); /* TODO(sergey): Aperture support? */ P = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f)); P = transform_point(&cameratoworld, P); D = normalize(transform_direction(&cameratoworld, D)); } else { assert(!"unsupported camera type"); } return P; } BoundBox Camera::viewplane_bounds_get() { /* TODO(sergey): This is all rather stupid, but is there a way to perform * checks we need in a more clear and smart fasion? */ BoundBox bounds = BoundBox::empty; if(type == CAMERA_PANORAMA) { if(use_spherical_stereo == false) { bounds.grow(make_float3(cameratoworld.x.w, cameratoworld.y.w, cameratoworld.z.w)); } else { float half_eye_distance = interocular_distance * 0.5f; bounds.grow(make_float3(cameratoworld.x.w + half_eye_distance, cameratoworld.y.w, cameratoworld.z.w)); bounds.grow(make_float3(cameratoworld.z.w, cameratoworld.y.w + half_eye_distance, cameratoworld.z.w)); bounds.grow(make_float3(cameratoworld.x.w - half_eye_distance, cameratoworld.y.w, cameratoworld.z.w)); bounds.grow(make_float3(cameratoworld.x.w, cameratoworld.y.w - half_eye_distance, cameratoworld.z.w)); } } else { bounds.grow(transform_raster_to_world(0.0f, 0.0f)); bounds.grow(transform_raster_to_world(0.0f, (float)height)); bounds.grow(transform_raster_to_world((float)width, (float)height)); bounds.grow(transform_raster_to_world((float)width, 0.0f)); if(type == CAMERA_PERSPECTIVE) { /* Center point has the most distance in local Z axis, * use it to construct bounding box/ */ bounds.grow(transform_raster_to_world(0.5f*width, 0.5f*height)); } } return bounds; } float Camera::world_to_raster_size(float3 P) { float res = 1.0f; if(type == CAMERA_ORTHOGRAPHIC) { res = min(len(full_dx), len(full_dy)); if(offscreen_dicing_scale > 1.0f) { float3 p = transform_perspective(&worldtocamera, P); float3 v = transform_perspective(&rastertocamera, make_float3(width, height, 0.0f)); /* Create point clamped to frustum */ float3 c; c.x = max(-v.x, min(v.x, p.x)); c.y = max(-v.y, min(v.y, p.y)); c.z = max(0.0f, p.z); float f_dist = len(p - c) / sqrtf((v.x*v.x+v.y*v.y)*0.5f); if(f_dist > 0.0f) { res += res * f_dist * (offscreen_dicing_scale - 1.0f); } } } else if(type == CAMERA_PERSPECTIVE) { /* Calculate as if point is directly ahead of the camera. */ float3 raster = make_float3(0.5f*width, 0.5f*height, 0.0f); float3 Pcamera = transform_perspective(&rastertocamera, raster); /* dDdx */ float3 Ddiff = transform_direction(&cameratoworld, Pcamera); float3 dx = len_squared(full_dx) < len_squared(full_dy) ? full_dx : full_dy; float3 dDdx = normalize(Ddiff + dx) - normalize(Ddiff); /* dPdx */ float dist = len(transform_point(&worldtocamera, P)); float3 D = normalize(Ddiff); res = len(dist*dDdx - dot(dist*dDdx, D)*D); /* Decent approx distance to frustum (doesn't handle corners correctly, but not that big of a deal) */ float f_dist = 0.0f; if(offscreen_dicing_scale > 1.0f) { float3 p = transform_point(&worldtocamera, P); /* Distance from the four planes */ float r = dot(p, frustum_right_normal); float t = dot(p, frustum_top_normal); p = make_float3(-p.x, -p.y, p.z); float l = dot(p, frustum_right_normal); float b = dot(p, frustum_top_normal); p = make_float3(-p.x, -p.y, p.z); if(r <= 0.0f && l <= 0.0f && t <= 0.0f && b <= 0.0f) { /* Point is inside frustum */ f_dist = 0.0f; } else if(r > 0.0f && l > 0.0f && t > 0.0f && b > 0.0f) { /* Point is behind frustum */ f_dist = len(p); } else { /* Point may be behind or off to the side, need to check */ float3 along_right = make_float3(-frustum_right_normal.z, 0.0f, frustum_right_normal.x); float3 along_left = make_float3(frustum_right_normal.z, 0.0f, frustum_right_normal.x); float3 along_top = make_float3(0.0f, -frustum_top_normal.z, frustum_top_normal.y); float3 along_bottom = make_float3(0.0f, frustum_top_normal.z, frustum_top_normal.y); float dist[] = {r, l, t, b}; float3 along[] = {along_right, along_left, along_top, along_bottom}; bool test_o = false; float *d = dist; float3 *a = along; for(int i = 0; i < 4; i++, d++, a++) { /* Test if we should check this side at all */ if(*d > 0.0f) { if(dot(p, *a) >= 0.0f) { /* We are in front of the back edge of this side of the frustum */ f_dist = max(f_dist, *d); } else { /* Possibly far enough behind the frustum to use distance to origin instead of edge */ test_o = true; } } } if(test_o) { f_dist = (f_dist > 0) ? min(f_dist, len(p)) : len(p); } } if(f_dist > 0.0f) { res += len(dDdx - dot(dDdx, D)*D) * f_dist * (offscreen_dicing_scale - 1.0f); } } } else if(type == CAMERA_PANORAMA) { float3 D = transform_point(&worldtocamera, P); float dist = len(D); Ray ray; /* Distortion can become so great that the results become meaningless, there * may be a better way to do this, but calculating differentials from the * point directly ahead seems to produce good enough results. */ #if 0 float2 dir = direction_to_panorama(&kernel_camera, normalize(D)); float3 raster = transform_perspective(&cameratoraster, make_float3(dir.x, dir.y, 0.0f)); ray.t = 1.0f; camera_sample_panorama(&kernel_camera, raster.x, raster.y, 0.0f, 0.0f, &ray); if(ray.t == 0.0f) { /* No differentials, just use from directly ahead. */ camera_sample_panorama(&kernel_camera, 0.5f*width, 0.5f*height, 0.0f, 0.0f, &ray); } #else camera_sample_panorama(&kernel_camera, 0.5f*width, 0.5f*height, 0.0f, 0.0f, &ray); #endif differential_transfer(&ray.dP, ray.dP, ray.D, ray.dD, ray.D, dist); return max(len(ray.dP.dx) * (float(width)/float(full_width)), len(ray.dP.dy) * (float(height)/float(full_height))); } return res; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/camera.h000066400000000000000000000112151334742672700212550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __CAMERA_H__ #define __CAMERA_H__ #include "kernel/kernel_types.h" #include "graph/node.h" #include "util/util_boundbox.h" #include "util/util_transform.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Scene; /* Camera * * The camera parameters are quite standard, tested to be both compatible with * Renderman, and Blender after remapping. */ class Camera : public Node { public: NODE_DECLARE /* Specifies an offset for the shutter's time interval. */ enum MotionPosition { /* Shutter opens at the current frame. */ MOTION_POSITION_START = 0, /* Shutter is fully open at the current frame. */ MOTION_POSITION_CENTER = 1, /* Shutter closes at the current frame. */ MOTION_POSITION_END = 2, MOTION_NUM_POSITIONS, }; /* Specifies rolling shutter effect. */ enum RollingShutterType { /* No rolling shutter effect. */ ROLLING_SHUTTER_NONE = 0, /* Sensor is being scanned vertically from top to bottom. */ ROLLING_SHUTTER_TOP = 1, ROLLING_SHUTTER_NUM_TYPES, }; /* Stereo Type */ enum StereoEye { STEREO_NONE, STEREO_LEFT, STEREO_RIGHT, }; /* motion blur */ float shuttertime; MotionPosition motion_position; array shutter_curve; size_t shutter_table_offset; /* ** Rolling shutter effect. ** */ /* Defines rolling shutter effect type. */ RollingShutterType rolling_shutter_type; /* Specifies exposure time of scanlines when using * rolling shutter effect. */ float rolling_shutter_duration; /* depth of field */ float focaldistance; float aperturesize; uint blades; float bladesrotation; /* type */ CameraType type; float fov; /* panorama */ PanoramaType panorama_type; float fisheye_fov; float fisheye_lens; float latitude_min; float latitude_max; float longitude_min; float longitude_max; /* panorama stereo */ StereoEye stereo_eye; bool use_spherical_stereo; float interocular_distance; float convergence_distance; bool use_pole_merge; float pole_merge_angle_from; float pole_merge_angle_to; /* anamorphic lens bokeh */ float aperture_ratio; /* sensor */ float sensorwidth; float sensorheight; /* clipping */ float nearclip; float farclip; /* screen */ int width, height; int resolution; BoundBox2D viewplane; /* width and height change during preview, so we need these for calculating dice rates. */ int full_width, full_height; /* controls how fast the dicing rate falls off for geometry out side of view */ float offscreen_dicing_scale; /* border */ BoundBox2D border; BoundBox2D viewport_camera_border; /* transformation */ Transform matrix; /* motion */ MotionTransform motion; bool use_motion, use_perspective_motion; float fov_pre, fov_post; PerspectiveMotionTransform perspective_motion; /* computed camera parameters */ Transform screentoworld; Transform rastertoworld; Transform ndctoworld; Transform cameratoworld; Transform worldtoraster; Transform worldtoscreen; Transform worldtondc; Transform worldtocamera; Transform rastertocamera; Transform cameratoraster; float3 dx; float3 dy; float3 full_dx; float3 full_dy; float3 frustum_right_normal; float3 frustum_top_normal; /* update */ bool need_update; bool need_device_update; bool need_flags_update; int previous_need_motion; /* Kernel camera data, copied here for dicing. */ KernelCamera kernel_camera; /* functions */ Camera(); ~Camera(); void compute_auto_viewplane(); void update(Scene *scene); void device_update(Device *device, DeviceScene *dscene, Scene *scene); void device_update_volume(Device *device, DeviceScene *dscene, Scene *scene); void device_free(Device *device, DeviceScene *dscene, Scene *scene); bool modified(const Camera& cam); bool motion_modified(const Camera& cam); void tag_update(); /* Public utility functions. */ BoundBox viewplane_bounds_get(); /* Calculates the width of a pixel at point in world space. */ float world_to_raster_size(float3 P); private: /* Private utility functions. */ float3 transform_raster_to_world(float raster_x, float raster_y); }; CCL_NAMESPACE_END #endif /* __CAMERA_H__ */ goxel-0.8.1/ext_src/cycles/src/render/constant_fold.cpp000066400000000000000000000225711334742672700232240ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/constant_fold.h" #include "render/graph.h" #include "util/util_foreach.h" #include "util/util_logging.h" CCL_NAMESPACE_BEGIN ConstantFolder::ConstantFolder(ShaderGraph *graph, ShaderNode *node, ShaderOutput *output) : graph(graph), node(node), output(output) { } bool ConstantFolder::all_inputs_constant() const { foreach(ShaderInput *input, node->inputs) { if(input->link) { return false; } } return true; } void ConstantFolder::make_constant(float value) const { VLOG(1) << "Folding " << node->name << "::" << output->name() << " to constant (" << value << ")."; foreach(ShaderInput *sock, output->links) { sock->set(value); } graph->disconnect(output); } void ConstantFolder::make_constant(float3 value) const { VLOG(1) << "Folding " << node->name << "::" << output->name() << " to constant " << value << "."; foreach(ShaderInput *sock, output->links) { sock->set(value); } graph->disconnect(output); } void ConstantFolder::make_constant_clamp(float value, bool clamp) const { make_constant(clamp ? saturate(value) : value); } void ConstantFolder::make_constant_clamp(float3 value, bool clamp) const { if(clamp) { value.x = saturate(value.x); value.y = saturate(value.y); value.z = saturate(value.z); } make_constant(value); } void ConstantFolder::make_zero() const { if(output->type() == SocketType::FLOAT) { make_constant(0.0f); } else if(SocketType::is_float3(output->type())) { make_constant(make_float3(0.0f, 0.0f, 0.0f)); } else { assert(0); } } void ConstantFolder::make_one() const { if(output->type() == SocketType::FLOAT) { make_constant(1.0f); } else if(SocketType::is_float3(output->type())) { make_constant(make_float3(1.0f, 1.0f, 1.0f)); } else { assert(0); } } void ConstantFolder::bypass(ShaderOutput *new_output) const { assert(new_output); VLOG(1) << "Folding " << node->name << "::" << output->name() << " to socket " << new_output->parent->name << "::" << new_output->name() << "."; /* Remove all outgoing links from socket and connect them to new_output instead. * The graph->relink method affects node inputs, so it's not safe to use in constant * folding if the node has multiple outputs and will thus be folded multiple times. */ vector outputs = output->links; graph->disconnect(output); foreach(ShaderInput *sock, outputs) { graph->connect(new_output, sock); } } void ConstantFolder::discard() const { assert(output->type() == SocketType::CLOSURE); VLOG(1) << "Discarding closure " << node->name << "."; graph->disconnect(output); } void ConstantFolder::bypass_or_discard(ShaderInput *input) const { assert(input->type() == SocketType::CLOSURE); if(input->link) { bypass(input->link); } else { discard(); } } bool ConstantFolder::try_bypass_or_make_constant(ShaderInput *input, bool clamp) const { if(input->type() != output->type()) { return false; } else if(!input->link) { if(input->type() == SocketType::FLOAT) { make_constant_clamp(node->get_float(input->socket_type), clamp); return true; } else if(SocketType::is_float3(input->type())) { make_constant_clamp(node->get_float3(input->socket_type), clamp); return true; } } else if(!clamp) { bypass(input->link); return true; } else { /* disconnect other inputs if we can't fully bypass due to clamp */ foreach(ShaderInput *other, node->inputs) { if(other != input && other->link) { graph->disconnect(other); } } } return false; } bool ConstantFolder::is_zero(ShaderInput *input) const { if(!input->link) { if(input->type() == SocketType::FLOAT) { return node->get_float(input->socket_type) == 0.0f; } else if(SocketType::is_float3(input->type())) { return node->get_float3(input->socket_type) == make_float3(0.0f, 0.0f, 0.0f); } } return false; } bool ConstantFolder::is_one(ShaderInput *input) const { if(!input->link) { if(input->type() == SocketType::FLOAT) { return node->get_float(input->socket_type) == 1.0f; } else if(SocketType::is_float3(input->type())) { return node->get_float3(input->socket_type) == make_float3(1.0f, 1.0f, 1.0f); } } return false; } /* Specific nodes */ void ConstantFolder::fold_mix(NodeMix type, bool clamp) const { ShaderInput *fac_in = node->input("Fac"); ShaderInput *color1_in = node->input("Color1"); ShaderInput *color2_in = node->input("Color2"); float fac = saturate(node->get_float(fac_in->socket_type)); bool fac_is_zero = !fac_in->link && fac == 0.0f; bool fac_is_one = !fac_in->link && fac == 1.0f; /* remove no-op node when factor is 0.0 */ if(fac_is_zero) { /* note that some of the modes will clamp out of bounds values even without use_clamp */ if(!(type == NODE_MIX_LIGHT || type == NODE_MIX_DODGE || type == NODE_MIX_BURN)) { if(try_bypass_or_make_constant(color1_in, clamp)) { return; } } } switch(type) { case NODE_MIX_BLEND: /* remove useless mix colors nodes */ if(color1_in->link && color2_in->link) { if(color1_in->link == color2_in->link) { try_bypass_or_make_constant(color1_in, clamp); break; } } else if(!color1_in->link && !color2_in->link) { float3 color1 = node->get_float3(color1_in->socket_type); float3 color2 = node->get_float3(color2_in->socket_type); if(color1 == color2) { try_bypass_or_make_constant(color1_in, clamp); break; } } /* remove no-op mix color node when factor is 1.0 */ if(fac_is_one) { try_bypass_or_make_constant(color2_in, clamp); break; } break; case NODE_MIX_ADD: /* 0 + X (fac 1) == X */ if(is_zero(color1_in) && fac_is_one) { try_bypass_or_make_constant(color2_in, clamp); } /* X + 0 (fac ?) == X */ else if(is_zero(color2_in)) { try_bypass_or_make_constant(color1_in, clamp); } break; case NODE_MIX_SUB: /* X - 0 (fac ?) == X */ if(is_zero(color2_in)) { try_bypass_or_make_constant(color1_in, clamp); } /* X - X (fac 1) == 0 */ else if(color1_in->link && color1_in->link == color2_in->link && fac_is_one) { make_zero(); } break; case NODE_MIX_MUL: /* X * 1 (fac ?) == X, 1 * X (fac 1) == X */ if(is_one(color1_in) && fac_is_one) { try_bypass_or_make_constant(color2_in, clamp); } else if(is_one(color2_in)) { try_bypass_or_make_constant(color1_in, clamp); } /* 0 * ? (fac ?) == 0, ? * 0 (fac 1) == 0 */ else if(is_zero(color1_in)) { make_zero(); } else if(is_zero(color2_in) && fac_is_one) { make_zero(); } break; case NODE_MIX_DIV: /* X / 1 (fac ?) == X */ if(is_one(color2_in)) { try_bypass_or_make_constant(color1_in, clamp); } /* 0 / ? (fac ?) == 0 */ else if(is_zero(color1_in)) { make_zero(); } break; default: break; } } void ConstantFolder::fold_math(NodeMath type, bool clamp) const { ShaderInput *value1_in = node->input("Value1"); ShaderInput *value2_in = node->input("Value2"); switch(type) { case NODE_MATH_ADD: /* X + 0 == 0 + X == X */ if(is_zero(value1_in)) { try_bypass_or_make_constant(value2_in, clamp); } else if(is_zero(value2_in)) { try_bypass_or_make_constant(value1_in, clamp); } break; case NODE_MATH_SUBTRACT: /* X - 0 == X */ if(is_zero(value2_in)) { try_bypass_or_make_constant(value1_in, clamp); } break; case NODE_MATH_MULTIPLY: /* X * 1 == 1 * X == X */ if(is_one(value1_in)) { try_bypass_or_make_constant(value2_in, clamp); } else if(is_one(value2_in)) { try_bypass_or_make_constant(value1_in, clamp); } /* X * 0 == 0 * X == 0 */ else if(is_zero(value1_in) || is_zero(value2_in)) { make_zero(); } break; case NODE_MATH_DIVIDE: /* X / 1 == X */ if(is_one(value2_in)) { try_bypass_or_make_constant(value1_in, clamp); } /* 0 / X == 0 */ else if(is_zero(value1_in)) { make_zero(); } break; case NODE_MATH_POWER: /* 1 ^ X == X ^ 0 == 1 */ if(is_one(value1_in) || is_zero(value2_in)) { make_one(); } /* X ^ 1 == X */ else if(is_one(value2_in)) { try_bypass_or_make_constant(value1_in, clamp); } default: break; } } void ConstantFolder::fold_vector_math(NodeVectorMath type) const { ShaderInput *vector1_in = node->input("Vector1"); ShaderInput *vector2_in = node->input("Vector2"); switch(type) { case NODE_VECTOR_MATH_ADD: /* X + 0 == 0 + X == X */ if(is_zero(vector1_in)) { try_bypass_or_make_constant(vector2_in); } else if(is_zero(vector2_in)) { try_bypass_or_make_constant(vector1_in); } break; case NODE_VECTOR_MATH_SUBTRACT: /* X - 0 == X */ if(is_zero(vector2_in)) { try_bypass_or_make_constant(vector1_in); } break; case NODE_VECTOR_MATH_DOT_PRODUCT: case NODE_VECTOR_MATH_CROSS_PRODUCT: /* X * 0 == 0 * X == 0 */ if(is_zero(vector1_in) || is_zero(vector2_in)) { make_zero(); } break; default: break; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/constant_fold.h000066400000000000000000000041071334742672700226640ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __CONSTANT_FOLD_H__ #define __CONSTANT_FOLD_H__ #include "util/util_types.h" #include "kernel/svm/svm_types.h" CCL_NAMESPACE_BEGIN class ShaderGraph; class ShaderInput; class ShaderNode; class ShaderOutput; class ConstantFolder { public: ShaderGraph *const graph; ShaderNode *const node; ShaderOutput *const output; ConstantFolder(ShaderGraph *graph, ShaderNode *node, ShaderOutput *output); bool all_inputs_constant() const; /* Constant folding helpers */ void make_constant(float value) const; void make_constant(float3 value) const; void make_constant_clamp(float value, bool clamp) const; void make_constant_clamp(float3 value, bool clamp) const; void make_zero() const; void make_one() const; /* Bypass node, relinking to another output socket. */ void bypass(ShaderOutput *output) const; /* For closure nodes, discard node entirely or bypass to one of its inputs. */ void discard() const; void bypass_or_discard(ShaderInput *input) const; /* Bypass or make constant, unless we can't due to clamp being true. */ bool try_bypass_or_make_constant(ShaderInput *input, bool clamp = false) const; /* Test if shader inputs of the current nodes have fixed values. */ bool is_zero(ShaderInput *input) const; bool is_one(ShaderInput *input) const; /* Specific nodes. */ void fold_mix(NodeMix type, bool clamp) const; void fold_math(NodeMath type, bool clamp) const; void fold_vector_math(NodeVectorMath type) const; }; CCL_NAMESPACE_END #endif /* __CONSTANT_FOLD_H__ */ goxel-0.8.1/ext_src/cycles/src/render/curves.cpp000066400000000000000000000124221334742672700216700ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/curves.h" #include "render/mesh.h" #include "render/object.h" #include "render/scene.h" #include "util/util_foreach.h" #include "util/util_map.h" #include "util/util_progress.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN /* Curve functions */ void curvebounds(float *lower, float *upper, float3 *p, int dim) { float *p0 = &p[0].x; float *p1 = &p[1].x; float *p2 = &p[2].x; float *p3 = &p[3].x; float fc = 0.71f; float curve_coef[4]; curve_coef[0] = p1[dim]; curve_coef[1] = -fc*p0[dim] + fc*p2[dim]; curve_coef[2] = 2.0f * fc * p0[dim] + (fc - 3.0f) * p1[dim] + (3.0f - 2.0f * fc) * p2[dim] - fc * p3[dim]; curve_coef[3] = -fc * p0[dim] + (2.0f - fc) * p1[dim] + (fc - 2.0f) * p2[dim] + fc * p3[dim]; float discroot = curve_coef[2] * curve_coef[2] - 3 * curve_coef[3] * curve_coef[1]; float ta = -1.0f; float tb = -1.0f; if(discroot >= 0) { discroot = sqrtf(discroot); ta = (-curve_coef[2] - discroot) / (3 * curve_coef[3]); tb = (-curve_coef[2] + discroot) / (3 * curve_coef[3]); ta = (ta > 1.0f || ta < 0.0f) ? -1.0f : ta; tb = (tb > 1.0f || tb < 0.0f) ? -1.0f : tb; } *upper = max(p1[dim],p2[dim]); *lower = min(p1[dim],p2[dim]); float exa = p1[dim]; float exb = p2[dim]; if(ta >= 0.0f) { float t2 = ta * ta; float t3 = t2 * ta; exa = curve_coef[3] * t3 + curve_coef[2] * t2 + curve_coef[1] * ta + curve_coef[0]; } if(tb >= 0.0f) { float t2 = tb * tb; float t3 = t2 * tb; exb = curve_coef[3] * t3 + curve_coef[2] * t2 + curve_coef[1] * tb + curve_coef[0]; } *upper = max(*upper, max(exa,exb)); *lower = min(*lower, min(exa,exb)); } /* Hair System Manager */ CurveSystemManager::CurveSystemManager() { primitive = CURVE_LINE_SEGMENTS; curve_shape = CURVE_THICK; line_method = CURVE_CORRECTED; triangle_method = CURVE_CAMERA_TRIANGLES; resolution = 3; subdivisions = 3; minimum_width = 0.0f; maximum_width = 0.0f; use_curves = true; use_encasing = true; use_backfacing = false; use_tangent_normal_geometry = false; need_update = true; need_mesh_update = false; } CurveSystemManager::~CurveSystemManager() { } void CurveSystemManager::device_update(Device *device, DeviceScene *dscene, Scene * /*scene*/, Progress& progress) { if(!need_update) return; device_free(device, dscene); progress.set_status("Updating Hair settings", "Copying Hair settings to device"); KernelCurves *kcurve = &dscene->data.curve; kcurve->curveflags = 0; if(use_curves) { if(primitive == CURVE_SEGMENTS || primitive == CURVE_RIBBONS) kcurve->curveflags |= CURVE_KN_INTERPOLATE; if(primitive == CURVE_RIBBONS) kcurve->curveflags |= CURVE_KN_RIBBONS; if(line_method == CURVE_ACCURATE) kcurve->curveflags |= CURVE_KN_ACCURATE; else if(line_method == CURVE_CORRECTED) kcurve->curveflags |= CURVE_KN_INTERSECTCORRECTION; if(use_tangent_normal_geometry) kcurve->curveflags |= CURVE_KN_TRUETANGENTGNORMAL; if(use_backfacing) kcurve->curveflags |= CURVE_KN_BACKFACING; if(use_encasing) kcurve->curveflags |= CURVE_KN_ENCLOSEFILTER; kcurve->minimum_width = minimum_width; kcurve->maximum_width = maximum_width; kcurve->subdivisions = subdivisions; } if(progress.get_cancel()) return; need_update = false; } void CurveSystemManager::device_free(Device * /*device*/, DeviceScene * /*dscene*/) { } bool CurveSystemManager::modified(const CurveSystemManager& CurveSystemManager) { return !(curve_shape == CurveSystemManager.curve_shape && line_method == CurveSystemManager.line_method && primitive == CurveSystemManager.primitive && use_encasing == CurveSystemManager.use_encasing && use_tangent_normal_geometry == CurveSystemManager.use_tangent_normal_geometry && minimum_width == CurveSystemManager.minimum_width && maximum_width == CurveSystemManager.maximum_width && use_backfacing == CurveSystemManager.use_backfacing && triangle_method == CurveSystemManager.triangle_method && resolution == CurveSystemManager.resolution && use_curves == CurveSystemManager.use_curves && subdivisions == CurveSystemManager.subdivisions); } bool CurveSystemManager::modified_mesh(const CurveSystemManager& CurveSystemManager) { return !(primitive == CurveSystemManager.primitive && curve_shape == CurveSystemManager.curve_shape && triangle_method == CurveSystemManager.triangle_method && resolution == CurveSystemManager.resolution && use_curves == CurveSystemManager.use_curves); } void CurveSystemManager::tag_update(Scene * /*scene*/) { need_update = true; } void CurveSystemManager::tag_update_mesh() { need_mesh_update = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/curves.h000066400000000000000000000051721334742672700213410ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __CURVES_H__ #define __CURVES_H__ #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Progress; class Scene; void curvebounds(float *lower, float *upper, float3 *p, int dim); typedef enum CurvePrimitiveType { CURVE_TRIANGLES = 0, CURVE_LINE_SEGMENTS = 1, CURVE_SEGMENTS = 2, CURVE_RIBBONS = 3, CURVE_NUM_PRIMITIVE_TYPES, } CurvePrimitiveType; typedef enum CurveShapeType { CURVE_RIBBON = 0, CURVE_THICK = 1, CURVE_NUM_SHAPE_TYPES, } CurveShapeType; typedef enum CurveTriangleMethod { CURVE_CAMERA_TRIANGLES, CURVE_TESSELATED_TRIANGLES } CurveTriangleMethod; typedef enum CurveLineMethod { CURVE_ACCURATE, CURVE_CORRECTED, CURVE_UNCORRECTED } CurveLineMethod; class ParticleCurveData { public: ParticleCurveData(); ~ParticleCurveData(); array psys_firstcurve; array psys_curvenum; array psys_shader; array psys_rootradius; array psys_tipradius; array psys_shape; array psys_closetip; array curve_firstkey; array curve_keynum; array curve_length; array curve_uv; array curve_vcol; array curvekey_co; array curvekey_time; }; /* HairSystem Manager */ class CurveSystemManager { public: CurvePrimitiveType primitive; CurveShapeType curve_shape; CurveLineMethod line_method; CurveTriangleMethod triangle_method; int resolution; int subdivisions; float minimum_width; float maximum_width; bool use_curves; bool use_encasing; bool use_backfacing; bool use_tangent_normal_geometry; bool need_update; bool need_mesh_update; CurveSystemManager(); ~CurveSystemManager(); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free(Device *device, DeviceScene *dscene); bool modified(const CurveSystemManager& CurveSystemManager); bool modified_mesh(const CurveSystemManager& CurveSystemManager); void tag_update(Scene *scene); void tag_update_mesh(); }; CCL_NAMESPACE_END #endif /* __CURVES_H__ */ goxel-0.8.1/ext_src/cycles/src/render/film.cpp000066400000000000000000000310751334742672700213150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/camera.h" #include "device/device.h" #include "render/film.h" #include "render/integrator.h" #include "render/mesh.h" #include "render/scene.h" #include "render/tables.h" #include "util/util_algorithm.h" #include "util/util_foreach.h" #include "util/util_math.h" #include "util/util_math_cdf.h" CCL_NAMESPACE_BEGIN /* Pass */ static bool compare_pass_order(const Pass& a, const Pass& b) { if(a.components == b.components) return (a.type < b.type); return (a.components > b.components); } void Pass::add(PassType type, array& passes) { for(size_t i = 0; i < passes.size(); i++) if(passes[i].type == type) return; Pass pass; pass.type = type; pass.filter = true; pass.exposure = false; pass.divide_type = PASS_NONE; switch(type) { case PASS_NONE: pass.components = 0; break; case PASS_COMBINED: pass.components = 4; pass.exposure = true; break; case PASS_DEPTH: pass.components = 1; pass.filter = false; break; case PASS_MIST: pass.components = 1; break; case PASS_NORMAL: pass.components = 4; break; case PASS_UV: pass.components = 4; break; case PASS_MOTION: pass.components = 4; pass.divide_type = PASS_MOTION_WEIGHT; break; case PASS_MOTION_WEIGHT: pass.components = 1; break; case PASS_OBJECT_ID: case PASS_MATERIAL_ID: pass.components = 1; pass.filter = false; break; case PASS_EMISSION: case PASS_BACKGROUND: pass.components = 4; pass.exposure = true; break; case PASS_AO: pass.components = 4; break; case PASS_SHADOW: pass.components = 4; pass.exposure = false; break; case PASS_LIGHT: /* This isn't a real pass, used by baking to see whether * light data is needed or not. * * Set components to 0 so pass sort below happens in a * determined way. */ pass.components = 0; break; #ifdef WITH_CYCLES_DEBUG case PASS_BVH_TRAVERSED_NODES: case PASS_BVH_TRAVERSED_INSTANCES: case PASS_BVH_INTERSECTIONS: case PASS_RAY_BOUNCES: pass.components = 1; pass.exposure = false; break; #endif case PASS_RENDER_TIME: /* This pass is handled entirely on the host side. */ pass.components = 0; break; case PASS_DIFFUSE_COLOR: case PASS_GLOSSY_COLOR: case PASS_TRANSMISSION_COLOR: case PASS_SUBSURFACE_COLOR: pass.components = 4; break; case PASS_DIFFUSE_DIRECT: case PASS_DIFFUSE_INDIRECT: pass.components = 4; pass.exposure = true; pass.divide_type = PASS_DIFFUSE_COLOR; break; case PASS_GLOSSY_DIRECT: case PASS_GLOSSY_INDIRECT: pass.components = 4; pass.exposure = true; pass.divide_type = PASS_GLOSSY_COLOR; break; case PASS_TRANSMISSION_DIRECT: case PASS_TRANSMISSION_INDIRECT: pass.components = 4; pass.exposure = true; pass.divide_type = PASS_TRANSMISSION_COLOR; break; case PASS_SUBSURFACE_DIRECT: case PASS_SUBSURFACE_INDIRECT: pass.components = 4; pass.exposure = true; pass.divide_type = PASS_SUBSURFACE_COLOR; break; case PASS_VOLUME_DIRECT: case PASS_VOLUME_INDIRECT: pass.components = 4; pass.exposure = true; break; default: assert(false); break; } passes.push_back_slow(pass); /* order from by components, to ensure alignment so passes with size 4 * come first and then passes with size 1 */ sort(&passes[0], &passes[0] + passes.size(), compare_pass_order); if(pass.divide_type != PASS_NONE) Pass::add(pass.divide_type, passes); } bool Pass::equals(const array& A, const array& B) { if(A.size() != B.size()) return false; for(int i = 0; i < A.size(); i++) if(A[i].type != B[i].type) return false; return true; } bool Pass::contains(const array& passes, PassType type) { for(size_t i = 0; i < passes.size(); i++) if(passes[i].type == type) return true; return false; } /* Pixel Filter */ static float filter_func_box(float /*v*/, float /*width*/) { return 1.0f; } static float filter_func_gaussian(float v, float width) { v *= 6.0f/width; return expf(-2.0f*v*v); } static float filter_func_blackman_harris(float v, float width) { v = M_2PI_F * (v / width + 0.5f); return 0.35875f - 0.48829f*cosf(v) + 0.14128f*cosf(2.0f*v) - 0.01168f*cosf(3.0f*v); } static vector filter_table(FilterType type, float width) { vector filter_table(FILTER_TABLE_SIZE); float (*filter_func)(float, float) = NULL; switch(type) { case FILTER_BOX: filter_func = filter_func_box; break; case FILTER_GAUSSIAN: filter_func = filter_func_gaussian; width *= 3.0f; break; case FILTER_BLACKMAN_HARRIS: filter_func = filter_func_blackman_harris; width *= 2.0f; break; default: assert(0); } /* Create importance sampling table. */ /* TODO(sergey): With the even filter table size resolution we can not * really make it nice symmetric importance map without sampling full range * (meaning, we would need to sample full filter range and not use the * make_symmetric argument). * * Current code matches exactly initial filter table code, but we should * consider either making FILTER_TABLE_SIZE odd value or sample full filter. */ util_cdf_inverted(FILTER_TABLE_SIZE, 0.0f, width * 0.5f, function_bind(filter_func, _1, width), true, filter_table); return filter_table; } /* Film */ NODE_DEFINE(Film) { NodeType* type = NodeType::add("film", create); SOCKET_FLOAT(exposure, "Exposure", 0.8f); SOCKET_FLOAT(pass_alpha_threshold, "Pass Alpha Threshold", 0.5f); static NodeEnum filter_enum; filter_enum.insert("box", FILTER_BOX); filter_enum.insert("gaussian", FILTER_GAUSSIAN); filter_enum.insert("blackman_harris", FILTER_BLACKMAN_HARRIS); SOCKET_ENUM(filter_type, "Filter Type", filter_enum, FILTER_BOX); SOCKET_FLOAT(filter_width, "Filter Width", 1.0f); SOCKET_FLOAT(mist_start, "Mist Start", 0.0f); SOCKET_FLOAT(mist_depth, "Mist Depth", 100.0f); SOCKET_FLOAT(mist_falloff, "Mist Falloff", 1.0f); SOCKET_BOOLEAN(use_sample_clamp, "Use Sample Clamp", false); SOCKET_BOOLEAN(denoising_data_pass, "Generate Denoising Data Pass", false); SOCKET_BOOLEAN(denoising_clean_pass, "Generate Denoising Clean Pass", false); SOCKET_INT(denoising_flags, "Denoising Flags", 0); return type; } Film::Film() : Node(node_type) { Pass::add(PASS_COMBINED, passes); use_light_visibility = false; filter_table_offset = TABLE_OFFSET_INVALID; need_update = true; } Film::~Film() { } void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene) { if(!need_update) return; device_free(device, dscene, scene); KernelFilm *kfilm = &dscene->data.film; /* update __data */ kfilm->exposure = exposure; kfilm->pass_flag = 0; kfilm->light_pass_flag = 0; kfilm->pass_stride = 0; kfilm->use_light_pass = use_light_visibility || use_sample_clamp; for(size_t i = 0; i < passes.size(); i++) { Pass& pass = passes[i]; if(pass.type == PASS_NONE) continue; int pass_flag = (1 << (pass.type % 32)); if(pass.type <= PASS_CATEGORY_MAIN_END) { kfilm->pass_flag |= pass_flag; } else { assert(pass.type <= PASS_CATEGORY_LIGHT_END); kfilm->use_light_pass = 1; kfilm->light_pass_flag |= pass_flag; } switch(pass.type) { case PASS_COMBINED: kfilm->pass_combined = kfilm->pass_stride; break; case PASS_DEPTH: kfilm->pass_depth = kfilm->pass_stride; break; case PASS_NORMAL: kfilm->pass_normal = kfilm->pass_stride; break; case PASS_UV: kfilm->pass_uv = kfilm->pass_stride; break; case PASS_MOTION: kfilm->pass_motion = kfilm->pass_stride; break; case PASS_MOTION_WEIGHT: kfilm->pass_motion_weight = kfilm->pass_stride; break; case PASS_OBJECT_ID: kfilm->pass_object_id = kfilm->pass_stride; break; case PASS_MATERIAL_ID: kfilm->pass_material_id = kfilm->pass_stride; break; case PASS_MIST: kfilm->pass_mist = kfilm->pass_stride; break; case PASS_EMISSION: kfilm->pass_emission = kfilm->pass_stride; break; case PASS_BACKGROUND: kfilm->pass_background = kfilm->pass_stride; break; case PASS_AO: kfilm->pass_ao = kfilm->pass_stride; break; case PASS_SHADOW: kfilm->pass_shadow = kfilm->pass_stride; break; case PASS_LIGHT: break; case PASS_DIFFUSE_COLOR: kfilm->pass_diffuse_color = kfilm->pass_stride; break; case PASS_GLOSSY_COLOR: kfilm->pass_glossy_color = kfilm->pass_stride; break; case PASS_TRANSMISSION_COLOR: kfilm->pass_transmission_color = kfilm->pass_stride; break; case PASS_SUBSURFACE_COLOR: kfilm->pass_subsurface_color = kfilm->pass_stride; break; case PASS_DIFFUSE_INDIRECT: kfilm->pass_diffuse_indirect = kfilm->pass_stride; break; case PASS_GLOSSY_INDIRECT: kfilm->pass_glossy_indirect = kfilm->pass_stride; break; case PASS_TRANSMISSION_INDIRECT: kfilm->pass_transmission_indirect = kfilm->pass_stride; break; case PASS_SUBSURFACE_INDIRECT: kfilm->pass_subsurface_indirect = kfilm->pass_stride; break; case PASS_VOLUME_INDIRECT: kfilm->pass_volume_indirect = kfilm->pass_stride; break; case PASS_DIFFUSE_DIRECT: kfilm->pass_diffuse_direct = kfilm->pass_stride; break; case PASS_GLOSSY_DIRECT: kfilm->pass_glossy_direct = kfilm->pass_stride; break; case PASS_TRANSMISSION_DIRECT: kfilm->pass_transmission_direct = kfilm->pass_stride; break; case PASS_SUBSURFACE_DIRECT: kfilm->pass_subsurface_direct = kfilm->pass_stride; break; case PASS_VOLUME_DIRECT: kfilm->pass_volume_direct = kfilm->pass_stride; break; #ifdef WITH_CYCLES_DEBUG case PASS_BVH_TRAVERSED_NODES: kfilm->pass_bvh_traversed_nodes = kfilm->pass_stride; break; case PASS_BVH_TRAVERSED_INSTANCES: kfilm->pass_bvh_traversed_instances = kfilm->pass_stride; break; case PASS_BVH_INTERSECTIONS: kfilm->pass_bvh_intersections = kfilm->pass_stride; break; case PASS_RAY_BOUNCES: kfilm->pass_ray_bounces = kfilm->pass_stride; break; #endif case PASS_RENDER_TIME: break; default: assert(false); break; } kfilm->pass_stride += pass.components; } kfilm->pass_denoising_data = 0; kfilm->pass_denoising_clean = 0; kfilm->denoising_flags = 0; if(denoising_data_pass) { kfilm->pass_denoising_data = kfilm->pass_stride; kfilm->pass_stride += DENOISING_PASS_SIZE_BASE; kfilm->denoising_flags = denoising_flags; if(denoising_clean_pass) { kfilm->pass_denoising_clean = kfilm->pass_stride; kfilm->pass_stride += DENOISING_PASS_SIZE_CLEAN; kfilm->use_light_pass = 1; } } kfilm->pass_stride = align_up(kfilm->pass_stride, 4); kfilm->pass_alpha_threshold = pass_alpha_threshold; /* update filter table */ vector table = filter_table(filter_type, filter_width); scene->lookup_tables->remove_table(&filter_table_offset); filter_table_offset = scene->lookup_tables->add_table(dscene, table); kfilm->filter_table_offset = (int)filter_table_offset; /* mist pass parameters */ kfilm->mist_start = mist_start; kfilm->mist_inv_depth = (mist_depth > 0.0f)? 1.0f/mist_depth: 0.0f; kfilm->mist_falloff = mist_falloff; pass_stride = kfilm->pass_stride; denoising_data_offset = kfilm->pass_denoising_data; denoising_clean_offset = kfilm->pass_denoising_clean; need_update = false; } void Film::device_free(Device * /*device*/, DeviceScene * /*dscene*/, Scene *scene) { scene->lookup_tables->remove_table(&filter_table_offset); } bool Film::modified(const Film& film) { return !Node::equals(film) || !Pass::equals(passes, film.passes); } void Film::tag_passes_update(Scene *scene, const array& passes_) { if(Pass::contains(passes, PASS_UV) != Pass::contains(passes_, PASS_UV)) { scene->mesh_manager->tag_update(scene); foreach(Shader *shader, scene->shaders) shader->need_update_mesh = true; } else if(Pass::contains(passes, PASS_MOTION) != Pass::contains(passes_, PASS_MOTION)) scene->mesh_manager->tag_update(scene); passes = passes_; } void Film::tag_update(Scene * /*scene*/) { need_update = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/film.h000066400000000000000000000040171334742672700207560ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __FILM_H__ #define __FILM_H__ #include "util/util_string.h" #include "util/util_vector.h" #include "kernel/kernel_types.h" #include "graph/node.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Scene; typedef enum FilterType { FILTER_BOX, FILTER_GAUSSIAN, FILTER_BLACKMAN_HARRIS, FILTER_NUM_TYPES, } FilterType; class Pass { public: PassType type; int components; bool filter; bool exposure; PassType divide_type; static void add(PassType type, array& passes); static bool equals(const array& A, const array& B); static bool contains(const array& passes, PassType); }; class Film : public Node { public: NODE_DECLARE float exposure; array passes; bool denoising_data_pass; bool denoising_clean_pass; int denoising_flags; float pass_alpha_threshold; int pass_stride; int denoising_data_offset; int denoising_clean_offset; FilterType filter_type; float filter_width; size_t filter_table_offset; float mist_start; float mist_depth; float mist_falloff; bool use_light_visibility; bool use_sample_clamp; bool need_update; Film(); ~Film(); void device_update(Device *device, DeviceScene *dscene, Scene *scene); void device_free(Device *device, DeviceScene *dscene, Scene *scene); bool modified(const Film& film); void tag_passes_update(Scene *scene, const array& passes_); void tag_update(Scene *scene); }; CCL_NAMESPACE_END #endif /* __FILM_H__ */ goxel-0.8.1/ext_src/cycles/src/render/graph.cpp000066400000000000000000000746201334742672700214720ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/attribute.h" #include "render/graph.h" #include "render/nodes.h" #include "render/scene.h" #include "render/shader.h" #include "render/constant_fold.h" #include "util/util_algorithm.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_md5.h" #include "util/util_queue.h" CCL_NAMESPACE_BEGIN namespace { bool check_node_inputs_has_links(const ShaderNode *node) { foreach(const ShaderInput *in, node->inputs) { if(in->link) { return true; } } return false; } bool check_node_inputs_traversed(const ShaderNode *node, const ShaderNodeSet& done) { foreach(const ShaderInput *in, node->inputs) { if(in->link) { if(done.find(in->link->parent) == done.end()) { return false; } } } return true; } } /* namespace */ /* Node */ ShaderNode::ShaderNode(const NodeType *type) : Node(type) { name = type->name; id = -1; bump = SHADER_BUMP_NONE; special_type = SHADER_SPECIAL_TYPE_NONE; create_inputs_outputs(type); } ShaderNode::~ShaderNode() { foreach(ShaderInput *socket, inputs) delete socket; foreach(ShaderOutput *socket, outputs) delete socket; } void ShaderNode::create_inputs_outputs(const NodeType *type) { foreach(const SocketType& socket, type->inputs) { if(socket.flags & SocketType::LINKABLE) { inputs.push_back(new ShaderInput(socket, this)); } } foreach(const SocketType& socket, type->outputs) { outputs.push_back(new ShaderOutput(socket, this)); } } ShaderInput *ShaderNode::input(const char *name) { foreach(ShaderInput *socket, inputs) { if(socket->name() == name) return socket; } return NULL; } ShaderOutput *ShaderNode::output(const char *name) { foreach(ShaderOutput *socket, outputs) if(socket->name() == name) return socket; return NULL; } ShaderInput *ShaderNode::input(ustring name) { foreach(ShaderInput *socket, inputs) { if(socket->name() == name) return socket; } return NULL; } ShaderOutput *ShaderNode::output(ustring name) { foreach(ShaderOutput *socket, outputs) if(socket->name() == name) return socket; return NULL; } void ShaderNode::attributes(Shader *shader, AttributeRequestSet *attributes) { foreach(ShaderInput *input, inputs) { if(!input->link) { if(input->flags() & SocketType::LINK_TEXTURE_GENERATED) { if(shader->has_surface) attributes->add(ATTR_STD_GENERATED); if(shader->has_volume) attributes->add(ATTR_STD_GENERATED_TRANSFORM); } else if(input->flags() & SocketType::LINK_TEXTURE_UV) { if(shader->has_surface) attributes->add(ATTR_STD_UV); } } } } bool ShaderNode::equals(const ShaderNode& other) { if(type != other.type || bump != other.bump) { return false; } assert(inputs.size() == other.inputs.size()); /* Compare unlinkable sockets */ foreach(const SocketType& socket, type->inputs) { if(!(socket.flags & SocketType::LINKABLE)) { if(!Node::equals_value(other, socket)) { return false; } } } /* Compare linkable input sockets */ for(int i = 0; i < inputs.size(); ++i) { ShaderInput *input_a = inputs[i], *input_b = other.inputs[i]; if(input_a->link == NULL && input_b->link == NULL) { /* Unconnected inputs are expected to have the same value. */ if(!Node::equals_value(other, input_a->socket_type)) { return false; } } else if(input_a->link != NULL && input_b->link != NULL) { /* Expect links are to come from the same exact socket. */ if(input_a->link != input_b->link) { return false; } } else { /* One socket has a link and another has not, inputs can't be * considered equal. */ return false; } } return true; } /* Graph */ ShaderGraph::ShaderGraph() { finalized = false; simplified = false; num_node_ids = 0; add(new OutputNode()); } ShaderGraph::~ShaderGraph() { clear_nodes(); } ShaderNode *ShaderGraph::add(ShaderNode *node) { assert(!finalized); simplified = false; node->id = num_node_ids++; nodes.push_back(node); return node; } OutputNode *ShaderGraph::output() { return (OutputNode*)nodes.front(); } void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to) { assert(!finalized); assert(from && to); if(to->link) { fprintf(stderr, "Cycles shader graph connect: input already connected.\n"); return; } if(from->type() != to->type()) { /* for closures we can't do automatic conversion */ if(from->type() == SocketType::CLOSURE || to->type() == SocketType::CLOSURE) { fprintf(stderr, "Cycles shader graph connect: can only connect closure to closure " "(%s.%s to %s.%s).\n", from->parent->name.c_str(), from->name().c_str(), to->parent->name.c_str(), to->name().c_str()); return; } /* add automatic conversion node in case of type mismatch */ ShaderNode *convert = add(new ConvertNode(from->type(), to->type(), true)); connect(from, convert->inputs[0]); connect(convert->outputs[0], to); } else { /* types match, just connect */ to->link = from; from->links.push_back(to); } } void ShaderGraph::disconnect(ShaderOutput *from) { assert(!finalized); simplified = false; foreach(ShaderInput *sock, from->links) { sock->link = NULL; } from->links.clear(); } void ShaderGraph::disconnect(ShaderInput *to) { assert(!finalized); assert(to->link); simplified = false; ShaderOutput *from = to->link; to->link = NULL; from->links.erase(remove(from->links.begin(), from->links.end(), to), from->links.end()); } void ShaderGraph::relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to) { simplified = false; /* Copy because disconnect modifies this list */ vector outputs = from->links; /* Bypass node by moving all links from "from" to "to" */ foreach(ShaderInput *sock, node->inputs) { if(sock->link) disconnect(sock); } foreach(ShaderInput *sock, outputs) { disconnect(sock); if(to) connect(to, sock); } } void ShaderGraph::simplify(Scene *scene) { if(!simplified) { default_inputs(scene->shader_manager->use_osl()); clean(scene); refine_bump_nodes(); simplified = true; } } void ShaderGraph::finalize(Scene *scene, bool do_bump, bool do_simplify, bool bump_in_object_space) { /* before compiling, the shader graph may undergo a number of modifications. * currently we set default geometry shader inputs, and create automatic bump * from displacement. a graph can be finalized only once, and should not be * modified afterwards. */ if(!finalized) { simplify(scene); if(do_bump) bump_from_displacement(bump_in_object_space); ShaderInput *surface_in = output()->input("Surface"); ShaderInput *volume_in = output()->input("Volume"); /* todo: make this work when surface and volume closures are tangled up */ if(surface_in->link) transform_multi_closure(surface_in->link->parent, NULL, false); if(volume_in->link) transform_multi_closure(volume_in->link->parent, NULL, true); finalized = true; } else if(do_simplify) { simplify_settings(scene); } } void ShaderGraph::find_dependencies(ShaderNodeSet& dependencies, ShaderInput *input) { /* find all nodes that this input depends on directly and indirectly */ ShaderNode *node = (input->link)? input->link->parent: NULL; if(node != NULL && dependencies.find(node) == dependencies.end()) { foreach(ShaderInput *in, node->inputs) find_dependencies(dependencies, in); dependencies.insert(node); } } void ShaderGraph::clear_nodes() { foreach(ShaderNode *node, nodes) { delete node; } nodes.clear(); } void ShaderGraph::copy_nodes(ShaderNodeSet& nodes, ShaderNodeMap& nnodemap) { /* copy a set of nodes, and the links between them. the assumption is * made that all nodes that inputs are linked to are in the set too. */ /* copy nodes */ foreach(ShaderNode *node, nodes) { ShaderNode *nnode = node->clone(); nnodemap[node] = nnode; /* create new inputs and outputs to recreate links and ensure * that we still point to valid SocketType if the NodeType * changed in cloning, as it does for OSL nodes */ nnode->inputs.clear(); nnode->outputs.clear(); nnode->create_inputs_outputs(nnode->type); } /* recreate links */ foreach(ShaderNode *node, nodes) { foreach(ShaderInput *input, node->inputs) { if(input->link) { /* find new input and output */ ShaderNode *nfrom = nnodemap[input->link->parent]; ShaderNode *nto = nnodemap[input->parent]; ShaderOutput *noutput = nfrom->output(input->link->name()); ShaderInput *ninput = nto->input(input->name()); /* connect */ connect(noutput, ninput); } } } } /* Graph simplification */ /* ******************** */ /* Remove proxy nodes. * * These only exists temporarily when exporting groups, and we must remove them * early so that node->attributes() and default links do not see them. */ void ShaderGraph::remove_proxy_nodes() { vector removed(num_node_ids, false); bool any_node_removed = false; foreach(ShaderNode *node, nodes) { if(node->special_type == SHADER_SPECIAL_TYPE_PROXY) { ConvertNode *proxy = static_cast(node); ShaderInput *input = proxy->inputs[0]; ShaderOutput *output = proxy->outputs[0]; /* bypass the proxy node */ if(input->link) { relink(proxy, output, input->link); } else { /* Copy because disconnect modifies this list */ vector links(output->links); foreach(ShaderInput *to, links) { /* remove any autoconvert nodes too if they lead to * sockets with an automatically set default value */ ShaderNode *tonode = to->parent; if(tonode->special_type == SHADER_SPECIAL_TYPE_AUTOCONVERT) { bool all_links_removed = true; vector links = tonode->outputs[0]->links; foreach(ShaderInput *autoin, links) { if(autoin->flags() & SocketType::DEFAULT_LINK_MASK) disconnect(autoin); else all_links_removed = false; } if(all_links_removed) removed[tonode->id] = true; } disconnect(to); /* transfer the default input value to the target socket */ tonode->copy_value(to->socket_type, *proxy, input->socket_type); } } removed[proxy->id] = true; any_node_removed = true; } } /* remove nodes */ if(any_node_removed) { list newnodes; foreach(ShaderNode *node, nodes) { if(!removed[node->id]) newnodes.push_back(node); else delete node; } nodes = newnodes; } } /* Constant folding. * * Try to constant fold some nodes, and pipe result directly to * the input socket of connected nodes. */ void ShaderGraph::constant_fold() { ShaderNodeSet done, scheduled; queue traverse_queue; bool has_displacement = (output()->input("Displacement")->link != NULL); /* Schedule nodes which doesn't have any dependencies. */ foreach(ShaderNode *node, nodes) { if(!check_node_inputs_has_links(node)) { traverse_queue.push(node); scheduled.insert(node); } } while(!traverse_queue.empty()) { ShaderNode *node = traverse_queue.front(); traverse_queue.pop(); done.insert(node); foreach(ShaderOutput *output, node->outputs) { if(output->links.size() == 0) { continue; } /* Schedule node which was depending on the value, * when possible. Do it before disconnect. */ foreach(ShaderInput *input, output->links) { if(scheduled.find(input->parent) != scheduled.end()) { /* Node might not be optimized yet but scheduled already * by other dependencies. No need to re-schedule it. */ continue; } /* Schedule node if its inputs are fully done. */ if(check_node_inputs_traversed(input->parent, done)) { traverse_queue.push(input->parent); scheduled.insert(input->parent); } } /* Optimize current node. */ ConstantFolder folder(this, node, output); node->constant_fold(folder); } } /* Folding might have removed all nodes connected to the displacement output * even tho there is displacement to be applied, so add in a value node if * that happens to ensure there is still a valid graph for displacement. */ if(has_displacement && !output()->input("Displacement")->link) { ColorNode *value = (ColorNode*)add(new ColorNode()); value->value = output()->displacement; connect(value->output("Color"), output()->input("Displacement")); } } /* Simplification. */ void ShaderGraph::simplify_settings(Scene *scene) { foreach(ShaderNode *node, nodes) { node->simplify_settings(scene); } } /* Deduplicate nodes with same settings. */ void ShaderGraph::deduplicate_nodes() { /* NOTES: * - Deduplication happens for nodes which has same exact settings and same * exact input links configuration (either connected to same output or has * the same exact default value). * - Deduplication happens in the bottom-top manner, so we know for fact that * all traversed nodes are either can not be deduplicated at all or were * already deduplicated. */ ShaderNodeSet scheduled, done; map candidates; queue traverse_queue; int num_deduplicated = 0; /* Schedule nodes which doesn't have any dependencies. */ foreach(ShaderNode *node, nodes) { if(!check_node_inputs_has_links(node)) { traverse_queue.push(node); scheduled.insert(node); } } while(!traverse_queue.empty()) { ShaderNode *node = traverse_queue.front(); traverse_queue.pop(); done.insert(node); /* Schedule the nodes which were depending on the current node. */ bool has_output_links = false; foreach(ShaderOutput *output, node->outputs) { foreach(ShaderInput *input, output->links) { has_output_links = true; if(scheduled.find(input->parent) != scheduled.end()) { /* Node might not be optimized yet but scheduled already * by other dependencies. No need to re-schedule it. */ continue; } /* Schedule node if its inputs are fully done. */ if(check_node_inputs_traversed(input->parent, done)) { traverse_queue.push(input->parent); scheduled.insert(input->parent); } } } /* Only need to care about nodes that are actually used */ if(!has_output_links) { continue; } /* Try to merge this node with another one. */ ShaderNode *merge_with = NULL; foreach(ShaderNode *other_node, candidates[node->type->name]) { if(node != other_node && node->equals(*other_node)) { merge_with = other_node; break; } } /* If found an equivalent, merge; otherwise keep node for later merges */ if(merge_with != NULL) { for(int i = 0; i < node->outputs.size(); ++i) { relink(node, node->outputs[i], merge_with->outputs[i]); } num_deduplicated++; } else { candidates[node->type->name].insert(node); } } if(num_deduplicated > 0) { VLOG(1) << "Deduplicated " << num_deduplicated << " nodes."; } } /* Check whether volume output has meaningful nodes, otherwise * disconnect the output. */ void ShaderGraph::verify_volume_output() { /* Check whether we can optimize the whole volume graph out. */ ShaderInput *volume_in = output()->input("Volume"); if(volume_in->link == NULL) { return; } bool has_valid_volume = false; ShaderNodeSet scheduled; queue traverse_queue; /* Schedule volume output. */ traverse_queue.push(volume_in->link->parent); scheduled.insert(volume_in->link->parent); /* Traverse down the tree. */ while(!traverse_queue.empty()) { ShaderNode *node = traverse_queue.front(); traverse_queue.pop(); /* Node is fully valid for volume, can't optimize anything out. */ if(node->has_volume_support()) { has_valid_volume = true; break; } foreach(ShaderInput *input, node->inputs) { if(input->link == NULL) { continue; } if(scheduled.find(input->link->parent) != scheduled.end()) { continue; } traverse_queue.push(input->link->parent); scheduled.insert(input->link->parent); } } if(!has_valid_volume) { VLOG(1) << "Disconnect meaningless volume output."; disconnect(volume_in->link); } } void ShaderGraph::break_cycles(ShaderNode *node, vector& visited, vector& on_stack) { visited[node->id] = true; on_stack[node->id] = true; foreach(ShaderInput *input, node->inputs) { if(input->link) { ShaderNode *depnode = input->link->parent; if(on_stack[depnode->id]) { /* break cycle */ disconnect(input); fprintf(stderr, "Cycles shader graph: detected cycle in graph, connection removed.\n"); } else if(!visited[depnode->id]) { /* visit dependencies */ break_cycles(depnode, visited, on_stack); } } } on_stack[node->id] = false; } void ShaderGraph::compute_displacement_hash() { /* Compute hash of all nodes linked to displacement, to detect if we need * to recompute displacement when shader nodes change. */ ShaderInput *displacement_in = output()->input("Displacement"); if(!displacement_in->link) { displacement_hash = ""; return; } ShaderNodeSet nodes_displace; find_dependencies(nodes_displace, displacement_in); MD5Hash md5; foreach(ShaderNode *node, nodes_displace) { node->hash(md5); foreach(ShaderInput *input, node->inputs) { int link_id = (input->link) ? input->link->parent->id : 0; md5.append((uint8_t*)&link_id, sizeof(link_id)); } } displacement_hash = md5.get_hex(); } void ShaderGraph::clean(Scene *scene) { /* Graph simplification */ /* NOTE: Remove proxy nodes was already done. */ constant_fold(); simplify_settings(scene); deduplicate_nodes(); verify_volume_output(); /* we do two things here: find cycles and break them, and remove unused * nodes that don't feed into the output. how cycles are broken is * undefined, they are invalid input, the important thing is to not crash */ vector visited(num_node_ids, false); vector on_stack(num_node_ids, false); /* break cycles */ break_cycles(output(), visited, on_stack); /* disconnect unused nodes */ foreach(ShaderNode *node, nodes) { if(!visited[node->id]) { foreach(ShaderInput *to, node->inputs) { ShaderOutput *from = to->link; if(from) { to->link = NULL; from->links.erase(remove(from->links.begin(), from->links.end(), to), from->links.end()); } } } } /* remove unused nodes */ list newnodes; foreach(ShaderNode *node, nodes) { if(visited[node->id]) newnodes.push_back(node); else delete node; } nodes = newnodes; } void ShaderGraph::default_inputs(bool do_osl) { /* nodes can specify default texture coordinates, for now we give * everything the position by default, except for the sky texture */ ShaderNode *geom = NULL; ShaderNode *texco = NULL; foreach(ShaderNode *node, nodes) { foreach(ShaderInput *input, node->inputs) { if(!input->link && (!(input->flags() & SocketType::OSL_INTERNAL) || do_osl)) { if(input->flags() & SocketType::LINK_TEXTURE_GENERATED) { if(!texco) texco = new TextureCoordinateNode(); connect(texco->output("Generated"), input); } else if(input->flags() & SocketType::LINK_TEXTURE_UV) { if(!texco) texco = new TextureCoordinateNode(); connect(texco->output("UV"), input); } else if(input->flags() & SocketType::LINK_INCOMING) { if(!geom) geom = new GeometryNode(); connect(geom->output("Incoming"), input); } else if(input->flags() & SocketType::LINK_NORMAL) { if(!geom) geom = new GeometryNode(); connect(geom->output("Normal"), input); } else if(input->flags() & SocketType::LINK_POSITION) { if(!geom) geom = new GeometryNode(); connect(geom->output("Position"), input); } else if(input->flags() & SocketType::LINK_TANGENT) { if(!geom) geom = new GeometryNode(); connect(geom->output("Tangent"), input); } } } } if(geom) add(geom); if(texco) add(texco); } void ShaderGraph::refine_bump_nodes() { /* we transverse the node graph looking for bump nodes, when we find them, * like in bump_from_displacement(), we copy the sub-graph defined from "bump" * input to the inputs "center","dx" and "dy" What is in "bump" input is moved * to "center" input. */ foreach(ShaderNode *node, nodes) { if(node->special_type == SHADER_SPECIAL_TYPE_BUMP && node->input("Height")->link) { ShaderInput *bump_input = node->input("Height"); ShaderNodeSet nodes_bump; /* make 2 extra copies of the subgraph defined in Bump input */ ShaderNodeMap nodes_dx; ShaderNodeMap nodes_dy; /* find dependencies for the given input */ find_dependencies(nodes_bump, bump_input); copy_nodes(nodes_bump, nodes_dx); copy_nodes(nodes_bump, nodes_dy); /* mark nodes to indicate they are use for bump computation, so that any texture coordinates are shifted by dx/dy when sampling */ foreach(ShaderNode *node, nodes_bump) node->bump = SHADER_BUMP_CENTER; foreach(NodePair& pair, nodes_dx) pair.second->bump = SHADER_BUMP_DX; foreach(NodePair& pair, nodes_dy) pair.second->bump = SHADER_BUMP_DY; ShaderOutput *out = bump_input->link; ShaderOutput *out_dx = nodes_dx[out->parent]->output(out->name()); ShaderOutput *out_dy = nodes_dy[out->parent]->output(out->name()); connect(out_dx, node->input("SampleX")); connect(out_dy, node->input("SampleY")); /* add generated nodes */ foreach(NodePair& pair, nodes_dx) add(pair.second); foreach(NodePair& pair, nodes_dy) add(pair.second); /* connect what is connected is bump to samplecenter input*/ connect(out , node->input("SampleCenter")); /* bump input is just for connectivity purpose for the graph input, * we re-connected this input to samplecenter, so lets disconnect it * from bump input */ disconnect(bump_input); } } } void ShaderGraph::bump_from_displacement(bool use_object_space) { /* generate bump mapping automatically from displacement. bump mapping is * done using a 3-tap filter, computing the displacement at the center, * and two other positions shifted by ray differentials. * * since the input to displacement is a node graph, we need to ensure that * all texture coordinates use are shift by the ray differentials. for this * reason we make 3 copies of the node subgraph defining the displacement, * with each different geometry and texture coordinate nodes that generate * different shifted coordinates. * * these 3 displacement values are then fed into the bump node, which will * output the perturbed normal. */ ShaderInput *displacement_in = output()->input("Displacement"); if(!displacement_in->link) return; /* find dependencies for the given input */ ShaderNodeSet nodes_displace; find_dependencies(nodes_displace, displacement_in); /* copy nodes for 3 bump samples */ ShaderNodeMap nodes_center; ShaderNodeMap nodes_dx; ShaderNodeMap nodes_dy; copy_nodes(nodes_displace, nodes_center); copy_nodes(nodes_displace, nodes_dx); copy_nodes(nodes_displace, nodes_dy); /* mark nodes to indicate they are use for bump computation, so * that any texture coordinates are shifted by dx/dy when sampling */ foreach(NodePair& pair, nodes_center) pair.second->bump = SHADER_BUMP_CENTER; foreach(NodePair& pair, nodes_dx) pair.second->bump = SHADER_BUMP_DX; foreach(NodePair& pair, nodes_dy) pair.second->bump = SHADER_BUMP_DY; /* add set normal node and connect the bump normal ouput to the set normal * output, so it can finally set the shader normal, note we are only doing * this for bump from displacement, this will be the only bump allowed to * overwrite the shader normal */ ShaderNode *set_normal = add(new SetNormalNode()); /* add bump node and connect copied graphs to it */ BumpNode *bump = (BumpNode*)add(new BumpNode()); bump->use_object_space = use_object_space; bump->distance = 1.0f; ShaderOutput *out = displacement_in->link; ShaderOutput *out_center = nodes_center[out->parent]->output(out->name()); ShaderOutput *out_dx = nodes_dx[out->parent]->output(out->name()); ShaderOutput *out_dy = nodes_dy[out->parent]->output(out->name()); /* convert displacement vector to height */ VectorMathNode *dot_center = (VectorMathNode*)add(new VectorMathNode()); VectorMathNode *dot_dx = (VectorMathNode*)add(new VectorMathNode()); VectorMathNode *dot_dy = (VectorMathNode*)add(new VectorMathNode()); dot_center->type = NODE_VECTOR_MATH_DOT_PRODUCT; dot_dx->type = NODE_VECTOR_MATH_DOT_PRODUCT; dot_dy->type = NODE_VECTOR_MATH_DOT_PRODUCT; GeometryNode *geom = (GeometryNode*)add(new GeometryNode()); connect(geom->output("Normal"), dot_center->input("Vector2")); connect(geom->output("Normal"), dot_dx->input("Vector2")); connect(geom->output("Normal"), dot_dy->input("Vector2")); connect(out_center, dot_center->input("Vector1")); connect(out_dx, dot_dx->input("Vector1")); connect(out_dy, dot_dy->input("Vector1")); connect(dot_center->output("Value"), bump->input("SampleCenter")); connect(dot_dx->output("Value"), bump->input("SampleX")); connect(dot_dy->output("Value"), bump->input("SampleY")); /* connect the bump out to the set normal in: */ connect(bump->output("Normal"), set_normal->input("Direction")); /* connect to output node */ connect(set_normal->output("Normal"), output()->input("Normal")); /* finally, add the copied nodes to the graph. we can't do this earlier * because we would create dependency cycles in the above loop */ foreach(NodePair& pair, nodes_center) add(pair.second); foreach(NodePair& pair, nodes_dx) add(pair.second); foreach(NodePair& pair, nodes_dy) add(pair.second); } void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight_out, bool volume) { /* for SVM in multi closure mode, this transforms the shader mix/add part of * the graph into nodes that feed weights into closure nodes. this is too * avoid building a closure tree and then flattening it, and instead write it * directly to an array */ if(node->special_type == SHADER_SPECIAL_TYPE_COMBINE_CLOSURE) { ShaderInput *fin = node->input("Fac"); ShaderInput *cl1in = node->input("Closure1"); ShaderInput *cl2in = node->input("Closure2"); ShaderOutput *weight1_out, *weight2_out; if(fin) { /* mix closure: add node to mix closure weights */ MixClosureWeightNode *mix_node = new MixClosureWeightNode(); add(mix_node); ShaderInput *fac_in = mix_node->input("Fac"); ShaderInput *weight_in = mix_node->input("Weight"); if(fin->link) connect(fin->link, fac_in); else mix_node->fac = node->get_float(fin->socket_type); if(weight_out) connect(weight_out, weight_in); weight1_out = mix_node->output("Weight1"); weight2_out = mix_node->output("Weight2"); } else { /* add closure: just pass on any weights */ weight1_out = weight_out; weight2_out = weight_out; } if(cl1in->link) transform_multi_closure(cl1in->link->parent, weight1_out, volume); if(cl2in->link) transform_multi_closure(cl2in->link->parent, weight2_out, volume); } else { ShaderInput *weight_in = node->input((volume)? "VolumeMixWeight": "SurfaceMixWeight"); /* not a closure node? */ if(!weight_in) return; /* already has a weight connected to it? add weights */ float weight_value = node->get_float(weight_in->socket_type); if(weight_in->link || weight_value != 0.0f) { MathNode *math_node = new MathNode(); add(math_node); if(weight_in->link) connect(weight_in->link, math_node->input("Value1")); else math_node->value1 = weight_value; if(weight_out) connect(weight_out, math_node->input("Value2")); else math_node->value2 = 1.0f; weight_out = math_node->output("Value"); if(weight_in->link) disconnect(weight_in); } /* connected to closure mix weight */ if(weight_out) connect(weight_out, weight_in); else node->set(weight_in->socket_type, weight_value + 1.0f); } } int ShaderGraph::get_num_closures() { int num_closures = 0; foreach(ShaderNode *node, nodes) { ClosureType closure_type = node->get_closure_type(); if(closure_type == CLOSURE_NONE_ID) { continue; } else if(CLOSURE_IS_BSSRDF(closure_type)) { num_closures += 3; } else if(CLOSURE_IS_GLASS(closure_type)) { num_closures += 2; } else if(CLOSURE_IS_BSDF_MULTISCATTER(closure_type)) { num_closures += 2; } else if(CLOSURE_IS_PRINCIPLED(closure_type)) { num_closures += 8; } else if(CLOSURE_IS_VOLUME(closure_type)) { num_closures += VOLUME_STACK_SIZE; } else { ++num_closures; } } return num_closures; } void ShaderGraph::dump_graph(const char *filename) { FILE *fd = fopen(filename, "w"); if(fd == NULL) { printf("Error opening file for dumping the graph: %s\n", filename); return; } fprintf(fd, "digraph shader_graph {\n"); fprintf(fd, "ranksep=1.5\n"); fprintf(fd, "rankdir=LR\n"); fprintf(fd, "splines=false\n"); foreach(ShaderNode *node, nodes) { fprintf(fd, "// NODE: %p\n", node); fprintf(fd, "\"%p\" [shape=record,label=\"{", node); if(node->inputs.size()) { fprintf(fd, "{"); foreach(ShaderInput *socket, node->inputs) { if(socket != node->inputs[0]) { fprintf(fd, "|"); } fprintf(fd, "%s", socket, socket->name().c_str()); } fprintf(fd, "}|"); } fprintf(fd, "%s", node->name.c_str()); if(node->bump == SHADER_BUMP_CENTER) { fprintf(fd, " (bump:center)"); } else if(node->bump == SHADER_BUMP_DX) { fprintf(fd, " (bump:dx)"); } else if(node->bump == SHADER_BUMP_DY) { fprintf(fd, " (bump:dy)"); } if(node->outputs.size()) { fprintf(fd, "|{"); foreach(ShaderOutput *socket, node->outputs) { if(socket != node->outputs[0]) { fprintf(fd, "|"); } fprintf(fd, "%s", socket, socket->name().c_str()); } fprintf(fd, "}"); } fprintf(fd, "}\"]"); } foreach(ShaderNode *node, nodes) { foreach(ShaderOutput *output, node->outputs) { foreach(ShaderInput *input, output->links) { fprintf(fd, "// CONNECTION: OUT_%p->IN_%p (%s:%s)\n", output, input, output->name().c_str(), input->name().c_str()); fprintf(fd, "\"%p\":\"OUT_%p\":e -> \"%p\":\"IN_%p\":w [label=\"\"]\n", output->parent, output, input->parent, input); } } } fprintf(fd, "}\n"); fclose(fd); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/graph.h000066400000000000000000000210451334742672700211300ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __GRAPH_H__ #define __GRAPH_H__ #include "graph/node.h" #include "graph/node_type.h" #include "kernel/kernel_types.h" #include "util/util_list.h" #include "util/util_map.h" #include "util/util_param.h" #include "util/util_set.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class AttributeRequestSet; class Scene; class Shader; class ShaderInput; class ShaderOutput; class ShaderNode; class ShaderGraph; class SVMCompiler; class OSLCompiler; class OutputNode; class ConstantFolder; class MD5Hash; /* Bump * * For bump mapping, a node may be evaluated multiple times, using different * samples to reconstruct the normal, this indicates the sample position */ enum ShaderBump { SHADER_BUMP_NONE, SHADER_BUMP_CENTER, SHADER_BUMP_DX, SHADER_BUMP_DY }; /* Identifiers for some special node types. * * The graph needs to identify these in the clean function. * Cannot use dynamic_cast, as this is disabled for OSL. */ enum ShaderNodeSpecialType { SHADER_SPECIAL_TYPE_NONE, SHADER_SPECIAL_TYPE_PROXY, SHADER_SPECIAL_TYPE_AUTOCONVERT, SHADER_SPECIAL_TYPE_GEOMETRY, SHADER_SPECIAL_TYPE_SCRIPT, SHADER_SPECIAL_TYPE_IMAGE_SLOT, SHADER_SPECIAL_TYPE_CLOSURE, SHADER_SPECIAL_TYPE_COMBINE_CLOSURE, SHADER_SPECIAL_TYPE_OUTPUT, SHADER_SPECIAL_TYPE_BUMP, }; /* Input * * Input socket for a shader node. May be linked to an output or not. If not * linked, it will either get a fixed default value, or e.g. a texture * coordinate. */ class ShaderInput { public: ShaderInput(const SocketType& socket_type_, ShaderNode* parent_) : socket_type(socket_type_), parent(parent_), link(NULL), stack_offset(SVM_STACK_INVALID) {} ustring name() { return socket_type.ui_name; } int flags() { return socket_type.flags; } SocketType::Type type() { return socket_type.type; } void set(float f) { ((Node*)parent)->set(socket_type, f); } void set(float3 f) { ((Node*)parent)->set(socket_type, f); } const SocketType& socket_type; ShaderNode *parent; ShaderOutput *link; int stack_offset; /* for SVM compiler */ }; /* Output * * Output socket for a shader node. */ class ShaderOutput { public: ShaderOutput(const SocketType& socket_type_, ShaderNode* parent_) : socket_type(socket_type_), parent(parent_), stack_offset(SVM_STACK_INVALID) {} ustring name() { return socket_type.ui_name; } SocketType::Type type() { return socket_type.type; } const SocketType& socket_type; ShaderNode *parent; vector links; int stack_offset; /* for SVM compiler */ }; /* Node * * Shader node in graph, with input and output sockets. This is the virtual * base class for all node types. */ class ShaderNode : public Node { public: explicit ShaderNode(const NodeType *type); virtual ~ShaderNode(); void create_inputs_outputs(const NodeType *type); ShaderInput *input(const char *name); ShaderOutput *output(const char *name); ShaderInput *input(ustring name); ShaderOutput *output(ustring name); virtual ShaderNode *clone() const = 0; virtual void attributes(Shader *shader, AttributeRequestSet *attributes); virtual void compile(SVMCompiler& compiler) = 0; virtual void compile(OSLCompiler& compiler) = 0; /* ** Node optimization ** */ /* Check whether the node can be replaced with single constant. */ virtual void constant_fold(const ConstantFolder& /*folder*/) {} /* Simplify settings used by artists to the ones which are simpler to * evaluate in the kernel but keep the final result unchanged. */ virtual void simplify_settings(Scene * /*scene*/) {}; virtual bool has_surface_emission() { return false; } virtual bool has_surface_transparent() { return false; } virtual bool has_surface_bssrdf() { return false; } virtual bool has_bump() { return false; } virtual bool has_bssrdf_bump() { return false; } virtual bool has_spatial_varying() { return false; } virtual bool has_object_dependency() { return false; } virtual bool has_attribute_dependency() { return false; } virtual bool has_integrator_dependency() { return false; } virtual bool has_volume_support() { return false; } virtual bool has_raytrace() { return false; } vector inputs; vector outputs; int id; /* index in graph node array */ ShaderBump bump; /* for bump mapping utility */ ShaderNodeSpecialType special_type; /* special node type */ /* ** Selective nodes compilation ** */ /* TODO(sergey): More explicitly mention in the function names * that those functions are for selective compilation only? */ /* Nodes are split into several groups, group of level 0 contains * nodes which are most commonly used, further levels are extension * of previous one and includes less commonly used nodes. */ virtual int get_group() { return NODE_GROUP_LEVEL_0; } /* Node feature are used to disable huge nodes inside the group, * so it's possible to disable huge nodes inside of the required * nodes group. */ virtual int get_feature() { return bump == SHADER_BUMP_NONE ? 0 : NODE_FEATURE_BUMP; } /* Get closure ID to which the node compiles into. */ virtual ClosureType get_closure_type() { return CLOSURE_NONE_ID; } /* Check whether settings of the node equals to another one. * * This is mainly used to check whether two nodes can be merged * together. Meaning, runtime stuff like node id and unbound slots * will be ignored for comparison. * * NOTE: If some node can't be de-duplicated for whatever reason it * is to be handled in the subclass. */ virtual bool equals(const ShaderNode& other); }; /* Node definition utility macros */ #define SHADER_NODE_CLASS(type) \ NODE_DECLARE \ type(); \ virtual ShaderNode *clone() const { return new type(*this); } \ virtual void compile(SVMCompiler& compiler); \ virtual void compile(OSLCompiler& compiler); \ #define SHADER_NODE_NO_CLONE_CLASS(type) \ NODE_DECLARE \ type(); \ virtual void compile(SVMCompiler& compiler); \ virtual void compile(OSLCompiler& compiler); \ #define SHADER_NODE_BASE_CLASS(type) \ virtual ShaderNode *clone() const { return new type(*this); } \ virtual void compile(SVMCompiler& compiler); \ virtual void compile(OSLCompiler& compiler); \ class ShaderNodeIDComparator { public: bool operator()(const ShaderNode *n1, const ShaderNode *n2) const { return n1->id < n2->id; } }; typedef set ShaderNodeSet; typedef map ShaderNodeMap; /* Graph * * Shader graph of nodes. Also does graph manipulations for default inputs, * bump mapping from displacement, and possibly other things in the future. */ class ShaderGraph { public: list nodes; size_t num_node_ids; bool finalized; bool simplified; string displacement_hash; ShaderGraph(); ~ShaderGraph(); ShaderNode *add(ShaderNode *node); OutputNode *output(); void connect(ShaderOutput *from, ShaderInput *to); void disconnect(ShaderOutput *from); void disconnect(ShaderInput *to); void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to); void remove_proxy_nodes(); void compute_displacement_hash(); void simplify(Scene *scene); void finalize(Scene *scene, bool do_bump = false, bool do_simplify = false, bool bump_in_object_space = false); int get_num_closures(); void dump_graph(const char *filename); protected: typedef pair NodePair; void find_dependencies(ShaderNodeSet& dependencies, ShaderInput *input); void clear_nodes(); void copy_nodes(ShaderNodeSet& nodes, ShaderNodeMap& nnodemap); void break_cycles(ShaderNode *node, vector& visited, vector& on_stack); void bump_from_displacement(bool use_object_space); void refine_bump_nodes(); void default_inputs(bool do_osl); void transform_multi_closure(ShaderNode *node, ShaderOutput *weight_out, bool volume); /* Graph simplification routines. */ void clean(Scene *scene); void constant_fold(); void simplify_settings(Scene *scene); void deduplicate_nodes(); void verify_volume_output(); }; CCL_NAMESPACE_END #endif /* __GRAPH_H__ */ goxel-0.8.1/ext_src/cycles/src/render/image.cpp000066400000000000000000000662771334742672700214640ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/image.h" #include "render/scene.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_path.h" #include "util/util_progress.h" #include "util/util_texture.h" #ifdef WITH_OSL #include #endif CCL_NAMESPACE_BEGIN /* Some helpers to silence warning in templated function. */ static bool isfinite(uchar /*value*/) { return false; } static bool isfinite(half /*value*/) { return false; } ImageManager::ImageManager(const DeviceInfo& info) { need_update = true; osl_texture_system = NULL; animation_frame = 0; /* Set image limits */ max_num_images = TEX_NUM_MAX; has_half_images = info.has_half_images; for(size_t type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { tex_num_images[type] = 0; } } ImageManager::~ImageManager() { for(size_t type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { for(size_t slot = 0; slot < images[type].size(); slot++) assert(!images[type][slot]); } } void ImageManager::set_osl_texture_system(void *texture_system) { osl_texture_system = texture_system; } bool ImageManager::set_animation_frame_update(int frame) { if(frame != animation_frame) { animation_frame = frame; for(size_t type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { for(size_t slot = 0; slot < images[type].size(); slot++) { if(images[type][slot] && images[type][slot]->animated) return true; } } } return false; } bool ImageManager::get_image_metadata(const string& filename, void *builtin_data, ImageMetaData& metadata) { memset(&metadata, 0, sizeof(metadata)); if(builtin_data) { if(builtin_image_info_cb) { builtin_image_info_cb(filename, builtin_data, metadata); } else { return false; } if(metadata.is_float) { metadata.is_linear = true; metadata.type = (metadata.channels > 1) ? IMAGE_DATA_TYPE_FLOAT4 : IMAGE_DATA_TYPE_FLOAT; } else { metadata.type = (metadata.channels > 1) ? IMAGE_DATA_TYPE_BYTE4 : IMAGE_DATA_TYPE_BYTE; } return true; } /* Perform preliminary checks, with meaningful logging. */ if(!path_exists(filename)) { VLOG(1) << "File '" << filename << "' does not exist."; return false; } if(path_is_directory(filename)) { VLOG(1) << "File '" << filename << "' is a directory, can't use as image."; return false; } ImageInput *in = ImageInput::create(filename); if(!in) { return false; } ImageSpec spec; if(!in->open(filename, spec)) { delete in; return false; } metadata.width = spec.width; metadata.height = spec.height; metadata.depth = spec.depth; /* check the main format, and channel formats; * if any take up more than one byte, we'll need a float texture slot */ if(spec.format.basesize() > 1) { metadata.is_float = true; metadata.is_linear = true; } for(size_t channel = 0; channel < spec.channelformats.size(); channel++) { if(spec.channelformats[channel].basesize() > 1) { metadata.is_float = true; metadata.is_linear = true; } } /* check if it's half float */ if(spec.format == IMG::TypeDesc::HALF) metadata.is_half = true; /* basic color space detection, not great but better than nothing * before we do OpenColorIO integration */ if(metadata.is_float) { string colorspace = spec.get_string_attribute("oiio:ColorSpace"); metadata.is_linear = !(colorspace == "sRGB" || colorspace == "GammaCorrected" || (colorspace == "" && (strcmp(in->format_name(), "png") == 0 || strcmp(in->format_name(), "tiff") == 0 || strcmp(in->format_name(), "dpx") == 0 || strcmp(in->format_name(), "jpeg2000") == 0))); } else { metadata.is_linear = false; } /* set type and channels */ metadata.channels = spec.nchannels; if(metadata.is_half) { metadata.type = (metadata.channels > 1) ? IMAGE_DATA_TYPE_HALF4 : IMAGE_DATA_TYPE_HALF; } else if(metadata.is_float) { metadata.type = (metadata.channels > 1) ? IMAGE_DATA_TYPE_FLOAT4 : IMAGE_DATA_TYPE_FLOAT; } else { metadata.type = (metadata.channels > 1) ? IMAGE_DATA_TYPE_BYTE4 : IMAGE_DATA_TYPE_BYTE; } in->close(); delete in; return true; } int ImageManager::max_flattened_slot(ImageDataType type) { if(tex_num_images[type] == 0) { /* No textures for the type, no slots needs allocation. */ return 0; } return type_index_to_flattened_slot(tex_num_images[type], type); } /* The lower three bits of a device texture slot number indicate its type. * These functions convert the slot ids from ImageManager "images" ones * to device ones and vice verse. */ int ImageManager::type_index_to_flattened_slot(int slot, ImageDataType type) { return (slot << IMAGE_DATA_TYPE_SHIFT) | (type); } int ImageManager::flattened_slot_to_type_index(int flat_slot, ImageDataType *type) { *type = (ImageDataType)(flat_slot & IMAGE_DATA_TYPE_MASK); return flat_slot >> IMAGE_DATA_TYPE_SHIFT; } string ImageManager::name_from_type(int type) { if(type == IMAGE_DATA_TYPE_FLOAT4) return "float4"; else if(type == IMAGE_DATA_TYPE_FLOAT) return "float"; else if(type == IMAGE_DATA_TYPE_BYTE) return "byte"; else if(type == IMAGE_DATA_TYPE_HALF4) return "half4"; else if(type == IMAGE_DATA_TYPE_HALF) return "half"; else return "byte4"; } static bool image_equals(ImageManager::Image *image, const string& filename, void *builtin_data, InterpolationType interpolation, ExtensionType extension, bool use_alpha) { return image->filename == filename && image->builtin_data == builtin_data && image->interpolation == interpolation && image->extension == extension && image->use_alpha == use_alpha; } int ImageManager::add_image(const string& filename, void *builtin_data, bool animated, float frame, InterpolationType interpolation, ExtensionType extension, bool use_alpha, ImageMetaData& metadata) { Image *img; size_t slot; get_image_metadata(filename, builtin_data, metadata); ImageDataType type = metadata.type; thread_scoped_lock device_lock(device_mutex); /* No half textures on OpenCL, use full float instead. */ if(!has_half_images) { if(type == IMAGE_DATA_TYPE_HALF4) { type = IMAGE_DATA_TYPE_FLOAT4; } else if(type == IMAGE_DATA_TYPE_HALF) { type = IMAGE_DATA_TYPE_FLOAT; } } /* Fnd existing image. */ for(slot = 0; slot < images[type].size(); slot++) { img = images[type][slot]; if(img && image_equals(img, filename, builtin_data, interpolation, extension, use_alpha)) { if(img->frame != frame) { img->frame = frame; img->need_load = true; } if(img->use_alpha != use_alpha) { img->use_alpha = use_alpha; img->need_load = true; } img->users++; return type_index_to_flattened_slot(slot, type); } } /* Find free slot. */ for(slot = 0; slot < images[type].size(); slot++) { if(!images[type][slot]) break; } /* Count if we're over the limit. * Very unlikely, since max_num_images is insanely big. But better safe than sorry. */ int tex_count = 0; for(int type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { tex_count += tex_num_images[type]; } if(tex_count > max_num_images) { printf("ImageManager::add_image: Reached image limit (%d), skipping '%s'\n", max_num_images, filename.c_str()); return -1; } if(slot == images[type].size()) { images[type].resize(images[type].size() + 1); } /* Add new image. */ img = new Image(); img->filename = filename; img->builtin_data = builtin_data; img->builtin_free_cache = metadata.builtin_free_cache; img->need_load = true; img->animated = animated; img->frame = frame; img->interpolation = interpolation; img->extension = extension; img->users = 1; img->use_alpha = use_alpha; img->mem = NULL; images[type][slot] = img; ++tex_num_images[type]; need_update = true; return type_index_to_flattened_slot(slot, type); } void ImageManager::remove_image(int flat_slot) { ImageDataType type; int slot = flattened_slot_to_type_index(flat_slot, &type); Image *image = images[type][slot]; assert(image && image->users >= 1); /* decrement user count */ image->users--; /* don't remove immediately, rather do it all together later on. one of * the reasons for this is that on shader changes we add and remove nodes * that use them, but we do not want to reload the image all the time. */ if(image->users == 0) need_update = true; } void ImageManager::remove_image(const string& filename, void *builtin_data, InterpolationType interpolation, ExtensionType extension, bool use_alpha) { size_t slot; for(int type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { for(slot = 0; slot < images[type].size(); slot++) { if(images[type][slot] && image_equals(images[type][slot], filename, builtin_data, interpolation, extension, use_alpha)) { remove_image(type_index_to_flattened_slot(slot, (ImageDataType)type)); return; } } } } /* TODO(sergey): Deduplicate with the iteration above, but make it pretty, * without bunch of arguments passing around making code readability even * more cluttered. */ void ImageManager::tag_reload_image(const string& filename, void *builtin_data, InterpolationType interpolation, ExtensionType extension, bool use_alpha) { for(size_t type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { for(size_t slot = 0; slot < images[type].size(); slot++) { if(images[type][slot] && image_equals(images[type][slot], filename, builtin_data, interpolation, extension, use_alpha)) { images[type][slot]->need_load = true; break; } } } } bool ImageManager::file_load_image_generic(Image *img, ImageInput **in, int &width, int &height, int &depth, int &components) { if(img->filename == "") return false; if(!img->builtin_data) { /* NOTE: Error logging is done in meta data acquisition. */ if(!path_exists(img->filename) || path_is_directory(img->filename)) { return false; } /* load image from file through OIIO */ *in = ImageInput::create(img->filename); if(!*in) return false; ImageSpec spec = ImageSpec(); ImageSpec config = ImageSpec(); if(img->use_alpha == false) config.attribute("oiio:UnassociatedAlpha", 1); if(!(*in)->open(img->filename, spec, config)) { delete *in; *in = NULL; return false; } width = spec.width; height = spec.height; depth = spec.depth; components = spec.nchannels; } else { /* load image using builtin images callbacks */ if(!builtin_image_info_cb || !builtin_image_pixels_cb) return false; ImageMetaData metadata; builtin_image_info_cb(img->filename, img->builtin_data, metadata); width = metadata.width; height = metadata.height; depth = metadata.depth; components = metadata.channels; } /* we only handle certain number of components */ if(!(components >= 1 && components <= 4)) { if(*in) { (*in)->close(); delete *in; *in = NULL; } return false; } return true; } template bool ImageManager::file_load_image(Image *img, ImageDataType type, int texture_limit, device_vector& tex_img) { const StorageType alpha_one = (FileFormat == IMG::TypeDesc::UINT8)? 255 : 1; ImageInput *in = NULL; int width, height, depth, components; if(!file_load_image_generic(img, &in, width, height, depth, components)) { return false; } /* Read RGBA pixels. */ vector pixels_storage; StorageType *pixels; const size_t max_size = max(max(width, height), depth); if(max_size == 0) { /* Don't bother with invalid images. */ return false; } if(texture_limit > 0 && max_size > texture_limit) { pixels_storage.resize(((size_t)width)*height*depth*4); pixels = &pixels_storage[0]; } else { thread_scoped_lock device_lock(device_mutex); pixels = (StorageType*)tex_img.alloc(width, height, depth); } if(pixels == NULL) { /* Could be that we've run out of memory. */ return false; } bool cmyk = false; const size_t num_pixels = ((size_t)width) * height * depth; if(in) { StorageType *readpixels = pixels; vector tmppixels; if(components > 4) { tmppixels.resize(((size_t)width)*height*components); readpixels = &tmppixels[0]; } if(depth <= 1) { size_t scanlinesize = ((size_t)width)*components*sizeof(StorageType); in->read_image(FileFormat, (uchar*)readpixels + (height-1)*scanlinesize, AutoStride, -scanlinesize, AutoStride); } else { in->read_image(FileFormat, (uchar*)readpixels); } if(components > 4) { size_t dimensions = ((size_t)width)*height; for(size_t i = dimensions-1, pixel = 0; pixel < dimensions; pixel++, i--) { pixels[i*4+3] = tmppixels[i*components+3]; pixels[i*4+2] = tmppixels[i*components+2]; pixels[i*4+1] = tmppixels[i*components+1]; pixels[i*4+0] = tmppixels[i*components+0]; } tmppixels.clear(); } cmyk = in->format_name() && strcmp(in->format_name(), "jpeg") == 0 && components == 4; in->close(); delete in; } else { if(FileFormat == IMG::TypeDesc::FLOAT) { builtin_image_float_pixels_cb(img->filename, img->builtin_data, (float*)&pixels[0], num_pixels * components, img->builtin_free_cache); } else if(FileFormat == IMG::TypeDesc::UINT8) { builtin_image_pixels_cb(img->filename, img->builtin_data, (uchar*)&pixels[0], num_pixels * components, img->builtin_free_cache); } else { /* TODO(dingto): Support half for ImBuf. */ } } /* Check if we actually have a float4 slot, in case components == 1, * but device doesn't support single channel textures. */ bool is_rgba = (type == IMAGE_DATA_TYPE_FLOAT4 || type == IMAGE_DATA_TYPE_HALF4 || type == IMAGE_DATA_TYPE_BYTE4); if(is_rgba) { if(cmyk) { /* CMYK */ for(size_t i = num_pixels-1, pixel = 0; pixel < num_pixels; pixel++, i--) { pixels[i*4+2] = (pixels[i*4+2]*pixels[i*4+3])/255; pixels[i*4+1] = (pixels[i*4+1]*pixels[i*4+3])/255; pixels[i*4+0] = (pixels[i*4+0]*pixels[i*4+3])/255; pixels[i*4+3] = alpha_one; } } else if(components == 2) { /* grayscale + alpha */ for(size_t i = num_pixels-1, pixel = 0; pixel < num_pixels; pixel++, i--) { pixels[i*4+3] = pixels[i*2+1]; pixels[i*4+2] = pixels[i*2+0]; pixels[i*4+1] = pixels[i*2+0]; pixels[i*4+0] = pixels[i*2+0]; } } else if(components == 3) { /* RGB */ for(size_t i = num_pixels-1, pixel = 0; pixel < num_pixels; pixel++, i--) { pixels[i*4+3] = alpha_one; pixels[i*4+2] = pixels[i*3+2]; pixels[i*4+1] = pixels[i*3+1]; pixels[i*4+0] = pixels[i*3+0]; } } else if(components == 1) { /* grayscale */ for(size_t i = num_pixels-1, pixel = 0; pixel < num_pixels; pixel++, i--) { pixels[i*4+3] = alpha_one; pixels[i*4+2] = pixels[i]; pixels[i*4+1] = pixels[i]; pixels[i*4+0] = pixels[i]; } } if(img->use_alpha == false) { for(size_t i = num_pixels-1, pixel = 0; pixel < num_pixels; pixel++, i--) { pixels[i*4+3] = alpha_one; } } } /* Make sure we don't have buggy values. */ if(FileFormat == IMG::TypeDesc::FLOAT) { /* For RGBA buffers we put all channels to 0 if either of them is not * finite. This way we avoid possible artifacts caused by fully changed * hue. */ if(is_rgba) { for(size_t i = 0; i < num_pixels; i += 4) { StorageType *pixel = &pixels[i*4]; if(!isfinite(pixel[0]) || !isfinite(pixel[1]) || !isfinite(pixel[2]) || !isfinite(pixel[3])) { pixel[0] = 0; pixel[1] = 0; pixel[2] = 0; pixel[3] = 0; } } } else { for(size_t i = 0; i < num_pixels; ++i) { StorageType *pixel = &pixels[i]; if(!isfinite(pixel[0])) { pixel[0] = 0; } } } } /* Scale image down if needed. */ if(pixels_storage.size() > 0) { float scale_factor = 1.0f; while(max_size * scale_factor > texture_limit) { scale_factor *= 0.5f; } VLOG(1) << "Scaling image " << img->filename << " by a factor of " << scale_factor << "."; vector scaled_pixels; size_t scaled_width, scaled_height, scaled_depth; util_image_resize_pixels(pixels_storage, width, height, depth, is_rgba ? 4 : 1, scale_factor, &scaled_pixels, &scaled_width, &scaled_height, &scaled_depth); StorageType *texture_pixels; { thread_scoped_lock device_lock(device_mutex); texture_pixels = (StorageType*)tex_img.alloc(scaled_width, scaled_height, scaled_depth); } memcpy(texture_pixels, &scaled_pixels[0], scaled_pixels.size() * sizeof(StorageType)); } return true; } void ImageManager::device_load_image(Device *device, Scene *scene, ImageDataType type, int slot, Progress *progress) { if(progress->get_cancel()) return; Image *img = images[type][slot]; if(osl_texture_system && !img->builtin_data) return; string filename = path_filename(images[type][slot]->filename); progress->set_status("Updating Images", "Loading " + filename); const int texture_limit = scene->params.texture_limit; /* Slot assignment */ int flat_slot = type_index_to_flattened_slot(slot, type); img->mem_name = string_printf("__tex_image_%s_%03d", name_from_type(type).c_str(), flat_slot); /* Free previous texture in slot. */ if(img->mem) { thread_scoped_lock device_lock(device_mutex); delete img->mem; img->mem = NULL; } /* Create new texture. */ if(type == IMAGE_DATA_TYPE_FLOAT4) { device_vector *tex_img = new device_vector(device, img->mem_name.c_str(), MEM_TEXTURE); if(!file_load_image(img, type, texture_limit, *tex_img)) { /* on failure to load, we set a 1x1 pixels pink image */ thread_scoped_lock device_lock(device_mutex); float *pixels = (float*)tex_img->alloc(1, 1); pixels[0] = TEX_IMAGE_MISSING_R; pixels[1] = TEX_IMAGE_MISSING_G; pixels[2] = TEX_IMAGE_MISSING_B; pixels[3] = TEX_IMAGE_MISSING_A; } img->mem = tex_img; img->mem->interpolation = img->interpolation; img->mem->extension = img->extension; thread_scoped_lock device_lock(device_mutex); tex_img->copy_to_device(); } else if(type == IMAGE_DATA_TYPE_FLOAT) { device_vector *tex_img = new device_vector(device, img->mem_name.c_str(), MEM_TEXTURE); if(!file_load_image(img, type, texture_limit, *tex_img)) { /* on failure to load, we set a 1x1 pixels pink image */ thread_scoped_lock device_lock(device_mutex); float *pixels = (float*)tex_img->alloc(1, 1); pixels[0] = TEX_IMAGE_MISSING_R; } img->mem = tex_img; img->mem->interpolation = img->interpolation; img->mem->extension = img->extension; thread_scoped_lock device_lock(device_mutex); tex_img->copy_to_device(); } else if(type == IMAGE_DATA_TYPE_BYTE4) { device_vector *tex_img = new device_vector(device, img->mem_name.c_str(), MEM_TEXTURE); if(!file_load_image(img, type, texture_limit, *tex_img)) { /* on failure to load, we set a 1x1 pixels pink image */ thread_scoped_lock device_lock(device_mutex); uchar *pixels = (uchar*)tex_img->alloc(1, 1); pixels[0] = (TEX_IMAGE_MISSING_R * 255); pixels[1] = (TEX_IMAGE_MISSING_G * 255); pixels[2] = (TEX_IMAGE_MISSING_B * 255); pixels[3] = (TEX_IMAGE_MISSING_A * 255); } img->mem = tex_img; img->mem->interpolation = img->interpolation; img->mem->extension = img->extension; thread_scoped_lock device_lock(device_mutex); tex_img->copy_to_device(); } else if(type == IMAGE_DATA_TYPE_BYTE) { device_vector *tex_img = new device_vector(device, img->mem_name.c_str(), MEM_TEXTURE); if(!file_load_image(img, type, texture_limit, *tex_img)) { /* on failure to load, we set a 1x1 pixels pink image */ thread_scoped_lock device_lock(device_mutex); uchar *pixels = (uchar*)tex_img->alloc(1, 1); pixels[0] = (TEX_IMAGE_MISSING_R * 255); } img->mem = tex_img; img->mem->interpolation = img->interpolation; img->mem->extension = img->extension; thread_scoped_lock device_lock(device_mutex); tex_img->copy_to_device(); } else if(type == IMAGE_DATA_TYPE_HALF4) { device_vector *tex_img = new device_vector(device, img->mem_name.c_str(), MEM_TEXTURE); if(!file_load_image(img, type, texture_limit, *tex_img)) { /* on failure to load, we set a 1x1 pixels pink image */ thread_scoped_lock device_lock(device_mutex); half *pixels = (half*)tex_img->alloc(1, 1); pixels[0] = TEX_IMAGE_MISSING_R; pixels[1] = TEX_IMAGE_MISSING_G; pixels[2] = TEX_IMAGE_MISSING_B; pixels[3] = TEX_IMAGE_MISSING_A; } img->mem = tex_img; img->mem->interpolation = img->interpolation; img->mem->extension = img->extension; thread_scoped_lock device_lock(device_mutex); tex_img->copy_to_device(); } else if(type == IMAGE_DATA_TYPE_HALF) { device_vector *tex_img = new device_vector(device, img->mem_name.c_str(), MEM_TEXTURE); if(!file_load_image(img, type, texture_limit, *tex_img)) { /* on failure to load, we set a 1x1 pixels pink image */ thread_scoped_lock device_lock(device_mutex); half *pixels = (half*)tex_img->alloc(1, 1); pixels[0] = TEX_IMAGE_MISSING_R; } img->mem = tex_img; img->mem->interpolation = img->interpolation; img->mem->extension = img->extension; thread_scoped_lock device_lock(device_mutex); tex_img->copy_to_device(); } img->need_load = false; } void ImageManager::device_free_image(Device *, ImageDataType type, int slot) { Image *img = images[type][slot]; if(img) { if(osl_texture_system && !img->builtin_data) { #ifdef WITH_OSL ustring filename(images[type][slot]->filename); ((OSL::TextureSystem*)osl_texture_system)->invalidate(filename); #endif } if(img->mem) { thread_scoped_lock device_lock(device_mutex); delete img->mem; } delete img; images[type][slot] = NULL; --tex_num_images[type]; } } void ImageManager::device_update(Device *device, Scene *scene, Progress& progress) { if(!need_update) { return; } TaskPool pool; for(int type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { for(size_t slot = 0; slot < images[type].size(); slot++) { if(!images[type][slot]) continue; if(images[type][slot]->users == 0) { device_free_image(device, (ImageDataType)type, slot); } else if(images[type][slot]->need_load) { if(!osl_texture_system || images[type][slot]->builtin_data) pool.push(function_bind(&ImageManager::device_load_image, this, device, scene, (ImageDataType)type, slot, &progress)); } } } pool.wait_work(); need_update = false; } void ImageManager::device_update_slot(Device *device, Scene *scene, int flat_slot, Progress *progress) { ImageDataType type; int slot = flattened_slot_to_type_index(flat_slot, &type); Image *image = images[type][slot]; assert(image != NULL); if(image->users == 0) { device_free_image(device, type, slot); } else if(image->need_load) { if(!osl_texture_system || image->builtin_data) device_load_image(device, scene, type, slot, progress); } } void ImageManager::device_free_builtin(Device *device) { for(int type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { for(size_t slot = 0; slot < images[type].size(); slot++) { if(images[type][slot] && images[type][slot]->builtin_data) device_free_image(device, (ImageDataType)type, slot); } } } void ImageManager::device_free(Device *device) { for(int type = 0; type < IMAGE_DATA_NUM_TYPES; type++) { for(size_t slot = 0; slot < images[type].size(); slot++) { device_free_image(device, (ImageDataType)type, slot); } images[type].clear(); } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/image.h000066400000000000000000000115571334742672700211200ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __IMAGE_H__ #define __IMAGE_H__ #include "device/device.h" #include "device/device_memory.h" #include "util/util_image.h" #include "util/util_string.h" #include "util/util_thread.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Device; class Progress; class Scene; class ImageMetaData { public: /* Must be set by image file or builtin callback. */ bool is_float, is_half; int channels; size_t width, height, depth; bool builtin_free_cache; /* Automatically set. */ ImageDataType type; bool is_linear; }; class ImageManager { public: explicit ImageManager(const DeviceInfo& info); ~ImageManager(); int add_image(const string& filename, void *builtin_data, bool animated, float frame, InterpolationType interpolation, ExtensionType extension, bool use_alpha, ImageMetaData& metadata); void remove_image(int flat_slot); void remove_image(const string& filename, void *builtin_data, InterpolationType interpolation, ExtensionType extension, bool use_alpha); void tag_reload_image(const string& filename, void *builtin_data, InterpolationType interpolation, ExtensionType extension, bool use_alpha); bool get_image_metadata(const string& filename, void *builtin_data, ImageMetaData& metadata); void device_update(Device *device, Scene *scene, Progress& progress); void device_update_slot(Device *device, Scene *scene, int flat_slot, Progress *progress); void device_free(Device *device); void device_free_builtin(Device *device); void set_osl_texture_system(void *texture_system); bool set_animation_frame_update(int frame); bool need_update; /* NOTE: Here pixels_size is a size of storage, which equals to * width * height * depth. * Use this to avoid some nasty memory corruptions. */ function builtin_image_info_cb; function builtin_image_pixels_cb; function builtin_image_float_pixels_cb; struct Image { string filename; void *builtin_data; bool builtin_free_cache; bool use_alpha; bool need_load; bool animated; float frame; InterpolationType interpolation; ExtensionType extension; string mem_name; device_memory *mem; int users; }; private: int tex_num_images[IMAGE_DATA_NUM_TYPES]; int max_num_images; bool has_half_images; thread_mutex device_mutex; int animation_frame; vector images[IMAGE_DATA_NUM_TYPES]; void *osl_texture_system; bool file_load_image_generic(Image *img, ImageInput **in, int &width, int &height, int &depth, int &components); template bool file_load_image(Image *img, ImageDataType type, int texture_limit, device_vector& tex_img); int max_flattened_slot(ImageDataType type); int type_index_to_flattened_slot(int slot, ImageDataType type); int flattened_slot_to_type_index(int flat_slot, ImageDataType *type); string name_from_type(int type); void device_load_image(Device *device, Scene *scene, ImageDataType type, int slot, Progress *progess); void device_free_image(Device *device, ImageDataType type, int slot); }; CCL_NAMESPACE_END #endif /* __IMAGE_H__ */ goxel-0.8.1/ext_src/cycles/src/render/integrator.cpp000066400000000000000000000171161334742672700225440ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/background.h" #include "render/integrator.h" #include "render/film.h" #include "render/light.h" #include "render/scene.h" #include "render/shader.h" #include "render/sobol.h" #include "util/util_foreach.h" #include "util/util_hash.h" CCL_NAMESPACE_BEGIN NODE_DEFINE(Integrator) { NodeType *type = NodeType::add("integrator", create); SOCKET_INT(max_bounce, "Max Bounce", 7); SOCKET_INT(max_diffuse_bounce, "Max Diffuse Bounce", 7); SOCKET_INT(max_glossy_bounce, "Max Glossy Bounce", 7); SOCKET_INT(max_transmission_bounce, "Max Transmission Bounce", 7); SOCKET_INT(max_volume_bounce, "Max Volume Bounce", 7); SOCKET_INT(transparent_max_bounce, "Transparent Max Bounce", 7); SOCKET_INT(ao_bounces, "AO Bounces", 0); SOCKET_INT(volume_max_steps, "Volume Max Steps", 1024); SOCKET_FLOAT(volume_step_size, "Volume Step Size", 0.1f); SOCKET_BOOLEAN(caustics_reflective, "Reflective Caustics", true); SOCKET_BOOLEAN(caustics_refractive, "Refractive Caustics", true); SOCKET_FLOAT(filter_glossy, "Filter Glossy", 0.0f); SOCKET_INT(seed, "Seed", 0); SOCKET_FLOAT(sample_clamp_direct, "Sample Clamp Direct", 0.0f); SOCKET_FLOAT(sample_clamp_indirect, "Sample Clamp Indirect", 0.0f); SOCKET_BOOLEAN(motion_blur, "Motion Blur", false); SOCKET_INT(aa_samples, "AA Samples", 0); SOCKET_INT(diffuse_samples, "Diffuse Samples", 1); SOCKET_INT(glossy_samples, "Glossy Samples", 1); SOCKET_INT(transmission_samples, "Transmission Samples", 1); SOCKET_INT(ao_samples, "AO Samples", 1); SOCKET_INT(mesh_light_samples, "Mesh Light Samples", 1); SOCKET_INT(subsurface_samples, "Subsurface Samples", 1); SOCKET_INT(volume_samples, "Volume Samples", 1); SOCKET_INT(start_sample, "Start Sample", 0); SOCKET_BOOLEAN(sample_all_lights_direct, "Sample All Lights Direct", true); SOCKET_BOOLEAN(sample_all_lights_indirect, "Sample All Lights Indirect", true); SOCKET_FLOAT(light_sampling_threshold, "Light Sampling Threshold", 0.05f); static NodeEnum method_enum; method_enum.insert("path", PATH); method_enum.insert("branched_path", BRANCHED_PATH); SOCKET_ENUM(method, "Method", method_enum, PATH); static NodeEnum sampling_pattern_enum; sampling_pattern_enum.insert("sobol", SAMPLING_PATTERN_SOBOL); sampling_pattern_enum.insert("cmj", SAMPLING_PATTERN_CMJ); SOCKET_ENUM(sampling_pattern, "Sampling Pattern", sampling_pattern_enum, SAMPLING_PATTERN_SOBOL); return type; } Integrator::Integrator() : Node(node_type) { need_update = true; } Integrator::~Integrator() { } void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene) { if(!need_update) return; device_free(device, dscene); KernelIntegrator *kintegrator = &dscene->data.integrator; /* integrator parameters */ kintegrator->max_bounce = max_bounce + 1; kintegrator->max_diffuse_bounce = max_diffuse_bounce + 1; kintegrator->max_glossy_bounce = max_glossy_bounce + 1; kintegrator->max_transmission_bounce = max_transmission_bounce + 1; kintegrator->max_volume_bounce = max_volume_bounce + 1; kintegrator->transparent_max_bounce = transparent_max_bounce + 1; if(ao_bounces == 0) { kintegrator->ao_bounces = INT_MAX; } else { kintegrator->ao_bounces = ao_bounces - 1; } /* Transparent Shadows * We only need to enable transparent shadows, if we actually have * transparent shaders in the scene. Otherwise we can disable it * to improve performance a bit. */ kintegrator->transparent_shadows = false; foreach(Shader *shader, scene->shaders) { /* keep this in sync with SD_HAS_TRANSPARENT_SHADOW in shader.cpp */ if((shader->has_surface_transparent && shader->use_transparent_shadow) || shader->has_volume) { kintegrator->transparent_shadows = true; break; } } kintegrator->volume_max_steps = volume_max_steps; kintegrator->volume_step_size = volume_step_size; kintegrator->caustics_reflective = caustics_reflective; kintegrator->caustics_refractive = caustics_refractive; kintegrator->filter_glossy = (filter_glossy == 0.0f)? FLT_MAX: 1.0f/filter_glossy; kintegrator->seed = hash_int(seed); kintegrator->use_ambient_occlusion = ((Pass::contains(scene->film->passes, PASS_AO)) || dscene->data.background.ao_factor != 0.0f); kintegrator->sample_clamp_direct = (sample_clamp_direct == 0.0f)? FLT_MAX: sample_clamp_direct*3.0f; kintegrator->sample_clamp_indirect = (sample_clamp_indirect == 0.0f)? FLT_MAX: sample_clamp_indirect*3.0f; kintegrator->branched = (method == BRANCHED_PATH); kintegrator->volume_decoupled = device->info.has_volume_decoupled; kintegrator->diffuse_samples = diffuse_samples; kintegrator->glossy_samples = glossy_samples; kintegrator->transmission_samples = transmission_samples; kintegrator->ao_samples = ao_samples; kintegrator->mesh_light_samples = mesh_light_samples; kintegrator->subsurface_samples = subsurface_samples; kintegrator->volume_samples = volume_samples; kintegrator->start_sample = start_sample; if(method == BRANCHED_PATH) { kintegrator->sample_all_lights_direct = sample_all_lights_direct; kintegrator->sample_all_lights_indirect = sample_all_lights_indirect; } else { kintegrator->sample_all_lights_direct = false; kintegrator->sample_all_lights_indirect = false; } kintegrator->sampling_pattern = sampling_pattern; kintegrator->aa_samples = aa_samples; if(light_sampling_threshold > 0.0f) { kintegrator->light_inv_rr_threshold = 1.0f / light_sampling_threshold; } else { kintegrator->light_inv_rr_threshold = 0.0f; } /* sobol directions table */ int max_samples = 1; if(method == BRANCHED_PATH) { foreach(Light *light, scene->lights) max_samples = max(max_samples, light->samples); max_samples = max(max_samples, max(diffuse_samples, max(glossy_samples, transmission_samples))); max_samples = max(max_samples, max(ao_samples, max(mesh_light_samples, subsurface_samples))); max_samples = max(max_samples, volume_samples); } uint total_bounces = max_bounce + transparent_max_bounce + 3 + max(BSSRDF_MAX_HITS, BSSRDF_MAX_BOUNCES); max_samples *= total_bounces; int dimensions = PRNG_BASE_NUM + max_samples*PRNG_BOUNCE_NUM; dimensions = min(dimensions, SOBOL_MAX_DIMENSIONS); uint *directions = dscene->sobol_directions.alloc(SOBOL_BITS*dimensions); sobol_generate_direction_vectors((uint(*)[SOBOL_BITS])directions, dimensions); dscene->sobol_directions.copy_to_device(); /* Clamping. */ bool use_sample_clamp = (sample_clamp_direct != 0.0f || sample_clamp_indirect != 0.0f); if(use_sample_clamp != scene->film->use_sample_clamp) { scene->film->use_sample_clamp = use_sample_clamp; scene->film->tag_update(scene); } need_update = false; } void Integrator::device_free(Device *, DeviceScene *dscene) { dscene->sobol_directions.free(); } bool Integrator::modified(const Integrator& integrator) { return !Node::equals(integrator); } void Integrator::tag_update(Scene *scene) { foreach(Shader *shader, scene->shaders) { if(shader->has_integrator_dependency) { scene->shader_manager->need_update = true; break; } } need_update = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/integrator.h000066400000000000000000000036431334742672700222110ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __INTEGRATOR_H__ #define __INTEGRATOR_H__ #include "kernel/kernel_types.h" #include "graph/node.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Scene; class Integrator : public Node { public: NODE_DECLARE int max_bounce; int max_diffuse_bounce; int max_glossy_bounce; int max_transmission_bounce; int max_volume_bounce; int transparent_max_bounce; int ao_bounces; int volume_max_steps; float volume_step_size; bool caustics_reflective; bool caustics_refractive; float filter_glossy; int seed; float sample_clamp_direct; float sample_clamp_indirect; bool motion_blur; int aa_samples; int diffuse_samples; int glossy_samples; int transmission_samples; int ao_samples; int mesh_light_samples; int subsurface_samples; int volume_samples; int start_sample; bool sample_all_lights_direct; bool sample_all_lights_indirect; float light_sampling_threshold; enum Method { BRANCHED_PATH = 0, PATH = 1, NUM_METHODS, }; Method method; SamplingPattern sampling_pattern; bool need_update; Integrator(); ~Integrator(); void device_update(Device *device, DeviceScene *dscene, Scene *scene); void device_free(Device *device, DeviceScene *dscene); bool modified(const Integrator& integrator); void tag_update(Scene *scene); }; CCL_NAMESPACE_END #endif /* __INTEGRATOR_H__ */ goxel-0.8.1/ext_src/cycles/src/render/light.cpp000066400000000000000000000621161334742672700214750ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/background.h" #include "device/device.h" #include "render/integrator.h" #include "render/film.h" #include "render/light.h" #include "render/mesh.h" #include "render/object.h" #include "render/scene.h" #include "render/shader.h" #include "util/util_foreach.h" #include "util/util_progress.h" #include "util/util_logging.h" CCL_NAMESPACE_BEGIN static void shade_background_pixels(Device *device, DeviceScene *dscene, int res, vector& pixels, Progress& progress) { /* create input */ int width = res; int height = res; device_vector d_input(device, "background_input", MEM_READ_ONLY); device_vector d_output(device, "background_output", MEM_READ_WRITE); uint4 *d_input_data = d_input.alloc(width*height); for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { float u = (x + 0.5f)/width; float v = (y + 0.5f)/height; uint4 in = make_uint4(__float_as_int(u), __float_as_int(v), 0, 0); d_input_data[x + y*width] = in; } } /* compute on device */ d_output.alloc(width*height); d_output.zero_to_device(); d_input.copy_to_device(); device->const_copy_to("__data", &dscene->data, sizeof(dscene->data)); DeviceTask main_task(DeviceTask::SHADER); main_task.shader_input = d_input.device_pointer; main_task.shader_output = d_output.device_pointer; main_task.shader_eval_type = SHADER_EVAL_BACKGROUND; main_task.shader_x = 0; main_task.shader_w = width*height; main_task.num_samples = 1; main_task.get_cancel = function_bind(&Progress::get_cancel, &progress); /* disabled splitting for now, there's an issue with multi-GPU mem_copy_from */ list split_tasks; main_task.split(split_tasks, 1, 128*128); foreach(DeviceTask& task, split_tasks) { device->task_add(task); device->task_wait(); d_output.copy_from_device(task.shader_x, 1, task.shader_w); } d_input.free(); float4 *d_output_data = d_output.data(); pixels.resize(width*height); for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { pixels[y*width + x].x = d_output_data[y*width + x].x; pixels[y*width + x].y = d_output_data[y*width + x].y; pixels[y*width + x].z = d_output_data[y*width + x].z; } } d_output.free(); } /* Light */ NODE_DEFINE(Light) { NodeType* type = NodeType::add("light", create); static NodeEnum type_enum; type_enum.insert("point", LIGHT_POINT); type_enum.insert("distant", LIGHT_DISTANT); type_enum.insert("background", LIGHT_BACKGROUND); type_enum.insert("area", LIGHT_AREA); type_enum.insert("spot", LIGHT_SPOT); SOCKET_ENUM(type, "Type", type_enum, LIGHT_POINT); SOCKET_POINT(co, "Co", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_VECTOR(dir, "Dir", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_FLOAT(size, "Size", 0.0f); SOCKET_VECTOR(axisu, "Axis U", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_FLOAT(sizeu, "Size U", 1.0f); SOCKET_VECTOR(axisv, "Axis V", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_FLOAT(sizev, "Size V", 1.0f); SOCKET_INT(map_resolution, "Map Resolution", 512); SOCKET_FLOAT(spot_angle, "Spot Angle", M_PI_4_F); SOCKET_FLOAT(spot_smooth, "Spot Smooth", 0.0f); SOCKET_TRANSFORM(tfm, "Transform", transform_identity()); SOCKET_BOOLEAN(cast_shadow, "Cast Shadow", true); SOCKET_BOOLEAN(use_mis, "Use Mis", false); SOCKET_BOOLEAN(use_diffuse, "Use Diffuse", true); SOCKET_BOOLEAN(use_glossy, "Use Glossy", true); SOCKET_BOOLEAN(use_transmission, "Use Transmission", true); SOCKET_BOOLEAN(use_scatter, "Use Scatter", true); SOCKET_INT(samples, "Samples", 1); SOCKET_INT(max_bounces, "Max Bounces", 1024); SOCKET_UINT(random_id, "Random ID", 0); SOCKET_BOOLEAN(is_portal, "Is Portal", false); SOCKET_BOOLEAN(is_enabled, "Is Enabled", true); SOCKET_NODE(shader, "Shader", &Shader::node_type); return type; } Light::Light() : Node(node_type) { } void Light::tag_update(Scene *scene) { scene->light_manager->need_update = true; } bool Light::has_contribution(Scene *scene) { if(is_portal) { return false; } if(type == LIGHT_BACKGROUND) { return true; } return (shader) ? shader->has_surface_emission : scene->default_light->has_surface_emission; } /* Light Manager */ LightManager::LightManager() { need_update = true; use_light_visibility = false; } LightManager::~LightManager() { } bool LightManager::has_background_light(Scene *scene) { foreach(Light *light, scene->lights) { if(light->type == LIGHT_BACKGROUND) { return true; } } return false; } void LightManager::disable_ineffective_light(Device *device, Scene *scene) { /* Make all lights enabled by default, and perform some preliminary checks * needed for finer-tuning of settings (for example, check whether we've * got portals or not). */ bool has_portal = false, has_background = false; foreach(Light *light, scene->lights) { light->is_enabled = light->has_contribution(scene); has_portal |= light->is_portal; has_background |= light->type == LIGHT_BACKGROUND; } if(has_background) { /* Ignore background light if: * - If unsupported on a device * - If we don't need it (no HDRs etc.) */ Shader *shader = (scene->background->shader) ? scene->background->shader : scene->default_background; bool disable_mis = !(has_portal || shader->has_surface_spatial_varying) || !(device->info.advanced_shading); if(disable_mis) { VLOG(1) << "Background MIS has been disabled.\n"; foreach(Light *light, scene->lights) { if(light->type == LIGHT_BACKGROUND) { light->is_enabled = false; } } } } } bool LightManager::object_usable_as_light(Object *object) { Mesh *mesh = object->mesh; /* Skip objects with NaNs */ if(!object->bounds.valid()) { return false; } /* Skip if we are not visible for BSDFs. */ if(!(object->visibility & (PATH_RAY_DIFFUSE|PATH_RAY_GLOSSY|PATH_RAY_TRANSMIT))) { return false; } /* Skip if we have no emission shaders. */ /* TODO(sergey): Ideally we want to avoid such duplicated loop, since it'll * iterate all mesh shaders twice (when counting and when calculating * triangle area. */ foreach(const Shader *shader, mesh->used_shaders) { if(shader->use_mis && shader->has_surface_emission) { return true; } } return false; } void LightManager::device_update_distribution(Device *, DeviceScene *dscene, Scene *scene, Progress& progress) { progress.set_status("Updating Lights", "Computing distribution"); /* count */ size_t num_lights = 0; size_t num_portals = 0; size_t num_background_lights = 0; size_t num_triangles = 0; bool background_mis = false; foreach(Light *light, scene->lights) { if(light->is_enabled) { num_lights++; } if(light->is_portal) { num_portals++; } } foreach(Object *object, scene->objects) { if(progress.get_cancel()) return; if(!object_usable_as_light(object)) { continue; } /* Count triangles. */ Mesh *mesh = object->mesh; size_t mesh_num_triangles = mesh->num_triangles(); for(size_t i = 0; i < mesh_num_triangles; i++) { int shader_index = mesh->shader[i]; Shader *shader = (shader_index < mesh->used_shaders.size()) ? mesh->used_shaders[shader_index] : scene->default_surface; if(shader->use_mis && shader->has_surface_emission) { num_triangles++; } } } size_t num_distribution = num_triangles + num_lights; VLOG(1) << "Total " << num_distribution << " of light distribution primitives."; /* emission area */ float4 *distribution = dscene->light_distribution.alloc(num_distribution + 1); float totarea = 0.0f; /* triangles */ size_t offset = 0; int j = 0; foreach(Object *object, scene->objects) { if(progress.get_cancel()) return; if(!object_usable_as_light(object)) { j++; continue; } /* Sum area. */ Mesh *mesh = object->mesh; bool transform_applied = mesh->transform_applied; Transform tfm = object->tfm; int object_id = j; int shader_flag = 0; if(!(object->visibility & PATH_RAY_DIFFUSE)) { shader_flag |= SHADER_EXCLUDE_DIFFUSE; use_light_visibility = true; } if(!(object->visibility & PATH_RAY_GLOSSY)) { shader_flag |= SHADER_EXCLUDE_GLOSSY; use_light_visibility = true; } if(!(object->visibility & PATH_RAY_TRANSMIT)) { shader_flag |= SHADER_EXCLUDE_TRANSMIT; use_light_visibility = true; } if(!(object->visibility & PATH_RAY_VOLUME_SCATTER)) { shader_flag |= SHADER_EXCLUDE_SCATTER; use_light_visibility = true; } size_t mesh_num_triangles = mesh->num_triangles(); for(size_t i = 0; i < mesh_num_triangles; i++) { int shader_index = mesh->shader[i]; Shader *shader = (shader_index < mesh->used_shaders.size()) ? mesh->used_shaders[shader_index] : scene->default_surface; if(shader->use_mis && shader->has_surface_emission) { distribution[offset].x = totarea; distribution[offset].y = __int_as_float(i + mesh->tri_offset); distribution[offset].z = __int_as_float(shader_flag); distribution[offset].w = __int_as_float(object_id); offset++; Mesh::Triangle t = mesh->get_triangle(i); if(!t.valid(&mesh->verts[0])) { continue; } float3 p1 = mesh->verts[t.v[0]]; float3 p2 = mesh->verts[t.v[1]]; float3 p3 = mesh->verts[t.v[2]]; if(!transform_applied) { p1 = transform_point(&tfm, p1); p2 = transform_point(&tfm, p2); p3 = transform_point(&tfm, p3); } totarea += triangle_area(p1, p2, p3); } } j++; } float trianglearea = totarea; /* point lights */ float lightarea = (totarea > 0.0f) ? totarea / num_lights : 1.0f; bool use_lamp_mis = false; int light_index = 0; foreach(Light *light, scene->lights) { if(!light->is_enabled) continue; distribution[offset].x = totarea; distribution[offset].y = __int_as_float(~light_index); distribution[offset].z = 1.0f; distribution[offset].w = light->size; totarea += lightarea; if(light->size > 0.0f && light->use_mis) use_lamp_mis = true; if(light->type == LIGHT_BACKGROUND) { num_background_lights++; background_mis = light->use_mis; } light_index++; offset++; } /* normalize cumulative distribution functions */ distribution[num_distribution].x = totarea; distribution[num_distribution].y = 0.0f; distribution[num_distribution].z = 0.0f; distribution[num_distribution].w = 0.0f; if(totarea > 0.0f) { for(size_t i = 0; i < num_distribution; i++) distribution[i].x /= totarea; distribution[num_distribution].x = 1.0f; } if(progress.get_cancel()) return; /* update device */ KernelIntegrator *kintegrator = &dscene->data.integrator; KernelFilm *kfilm = &dscene->data.film; kintegrator->use_direct_light = (totarea > 0.0f); if(kintegrator->use_direct_light) { /* number of emissives */ kintegrator->num_distribution = num_distribution; /* precompute pdfs */ kintegrator->pdf_triangles = 0.0f; kintegrator->pdf_lights = 0.0f; /* sample one, with 0.5 probability of light or triangle */ kintegrator->num_all_lights = num_lights; if(trianglearea > 0.0f) { kintegrator->pdf_triangles = 1.0f/trianglearea; if(num_lights) kintegrator->pdf_triangles *= 0.5f; } if(num_lights) { kintegrator->pdf_lights = 1.0f/num_lights; if(trianglearea > 0.0f) kintegrator->pdf_lights *= 0.5f; } kintegrator->use_lamp_mis = use_lamp_mis; /* bit of an ugly hack to compensate for emitting triangles influencing * amount of samples we get for this pass */ kfilm->pass_shadow_scale = 1.0f; if(kintegrator->pdf_triangles != 0.0f) kfilm->pass_shadow_scale *= 0.5f; if(num_background_lights < num_lights) kfilm->pass_shadow_scale *= (float)(num_lights - num_background_lights)/(float)num_lights; /* CDF */ dscene->light_distribution.copy_to_device(); /* Portals */ if(num_portals > 0) { kintegrator->portal_offset = light_index; kintegrator->num_portals = num_portals; kintegrator->portal_pdf = background_mis? 0.5f: 1.0f; } else { kintegrator->num_portals = 0; kintegrator->portal_offset = 0; kintegrator->portal_pdf = 0.0f; } } else { dscene->light_distribution.free(); kintegrator->num_distribution = 0; kintegrator->num_all_lights = 0; kintegrator->pdf_triangles = 0.0f; kintegrator->pdf_lights = 0.0f; kintegrator->use_lamp_mis = false; kintegrator->num_portals = 0; kintegrator->portal_offset = 0; kintegrator->portal_pdf = 0.0f; kfilm->pass_shadow_scale = 1.0f; } } static void background_cdf(int start, int end, int res, int cdf_count, const vector *pixels, float2 *cond_cdf) { /* Conditional CDFs (rows, U direction). */ for(int i = start; i < end; i++) { float sin_theta = sinf(M_PI_F * (i + 0.5f) / res); float3 env_color = (*pixels)[i * res]; float ave_luminance = average(env_color); cond_cdf[i * cdf_count].x = ave_luminance * sin_theta; cond_cdf[i * cdf_count].y = 0.0f; for(int j = 1; j < res; j++) { env_color = (*pixels)[i * res + j]; ave_luminance = average(env_color); cond_cdf[i * cdf_count + j].x = ave_luminance * sin_theta; cond_cdf[i * cdf_count + j].y = cond_cdf[i * cdf_count + j - 1].y + cond_cdf[i * cdf_count + j - 1].x / res; } float cdf_total = cond_cdf[i * cdf_count + res - 1].y + cond_cdf[i * cdf_count + res - 1].x / res; float cdf_total_inv = 1.0f / cdf_total; /* stuff the total into the brightness value for the last entry, because * we are going to normalize the CDFs to 0.0 to 1.0 afterwards */ cond_cdf[i * cdf_count + res].x = cdf_total; if(cdf_total > 0.0f) for(int j = 1; j < res; j++) cond_cdf[i * cdf_count + j].y *= cdf_total_inv; cond_cdf[i * cdf_count + res].y = 1.0f; } } void LightManager::device_update_background(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { KernelIntegrator *kintegrator = &dscene->data.integrator; Light *background_light = NULL; /* find background light */ foreach(Light *light, scene->lights) { if(light->type == LIGHT_BACKGROUND) { background_light = light; break; } } /* no background light found, signal renderer to skip sampling */ if(!background_light || !background_light->is_enabled) { kintegrator->pdf_background_res = 0; return; } progress.set_status("Updating Lights", "Importance map"); assert(kintegrator->use_direct_light); /* get the resolution from the light's size (we stuff it in there) */ int res = background_light->map_resolution; kintegrator->pdf_background_res = res; assert(res > 0); vector pixels; shade_background_pixels(device, dscene, res, pixels, progress); if(progress.get_cancel()) return; /* build row distributions and column distribution for the infinite area environment light */ int cdf_count = res + 1; float2 *marg_cdf = dscene->light_background_marginal_cdf.alloc(cdf_count); float2 *cond_cdf = dscene->light_background_conditional_cdf.alloc(cdf_count * cdf_count); double time_start = time_dt(); if(res < 512) { /* Small enough resolution, faster to do single-threaded. */ background_cdf(0, res, res, cdf_count, &pixels, cond_cdf); } else { /* Threaded evaluation for large resolution. */ const int num_blocks = TaskScheduler::num_threads(); const int chunk_size = res / num_blocks; int start_row = 0; TaskPool pool; for(int i = 0; i < num_blocks; ++i) { const int current_chunk_size = (i != num_blocks - 1) ? chunk_size : (res - i * chunk_size); pool.push(function_bind(&background_cdf, start_row, start_row + current_chunk_size, res, cdf_count, &pixels, cond_cdf)); start_row += current_chunk_size; } pool.wait_work(); } /* marginal CDFs (column, V direction, sum of rows) */ marg_cdf[0].x = cond_cdf[res].x; marg_cdf[0].y = 0.0f; for(int i = 1; i < res; i++) { marg_cdf[i].x = cond_cdf[i * cdf_count + res].x; marg_cdf[i].y = marg_cdf[i - 1].y + marg_cdf[i - 1].x / res; } float cdf_total = marg_cdf[res - 1].y + marg_cdf[res - 1].x / res; marg_cdf[res].x = cdf_total; if(cdf_total > 0.0f) for(int i = 1; i < res; i++) marg_cdf[i].y /= cdf_total; marg_cdf[res].y = 1.0f; VLOG(2) << "Background MIS build time " << time_dt() - time_start << "\n"; /* update device */ dscene->light_background_marginal_cdf.copy_to_device(); dscene->light_background_conditional_cdf.copy_to_device(); } void LightManager::device_update_points(Device *, DeviceScene *dscene, Scene *scene) { int num_scene_lights = scene->lights.size(); int num_lights = 0; foreach(Light *light, scene->lights) { if(light->is_enabled || light->is_portal) { num_lights++; } } float4 *light_data = dscene->light_data.alloc(num_lights*LIGHT_SIZE); if(num_lights == 0) { VLOG(1) << "No effective light, ignoring points update."; return; } int light_index = 0; foreach(Light *light, scene->lights) { if(!light->is_enabled) { continue; } float3 co = light->co; Shader *shader = (light->shader) ? light->shader : scene->default_light; int shader_id = scene->shader_manager->get_shader_id(shader); float samples = __int_as_float(light->samples); float max_bounces = __int_as_float(light->max_bounces); float random = (float)light->random_id * (1.0f/(float)0xFFFFFFFF); if(!light->cast_shadow) shader_id &= ~SHADER_CAST_SHADOW; if(!light->use_diffuse) { shader_id |= SHADER_EXCLUDE_DIFFUSE; use_light_visibility = true; } if(!light->use_glossy) { shader_id |= SHADER_EXCLUDE_GLOSSY; use_light_visibility = true; } if(!light->use_transmission) { shader_id |= SHADER_EXCLUDE_TRANSMIT; use_light_visibility = true; } if(!light->use_scatter) { shader_id |= SHADER_EXCLUDE_SCATTER; use_light_visibility = true; } if(light->type == LIGHT_POINT) { shader_id &= ~SHADER_AREA_LIGHT; float radius = light->size; float invarea = (radius > 0.0f)? 1.0f/(M_PI_F*radius*radius): 1.0f; if(light->use_mis && radius > 0.0f) shader_id |= SHADER_USE_MIS; light_data[light_index*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z); light_data[light_index*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), radius, invarea, 0.0f); light_data[light_index*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); light_data[light_index*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f); } else if(light->type == LIGHT_DISTANT) { shader_id &= ~SHADER_AREA_LIGHT; float radius = light->size; float angle = atanf(radius); float cosangle = cosf(angle); float area = M_PI_F*radius*radius; float invarea = (area > 0.0f)? 1.0f/area: 1.0f; float3 dir = light->dir; dir = safe_normalize(dir); if(light->use_mis && area > 0.0f) shader_id |= SHADER_USE_MIS; light_data[light_index*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), dir.x, dir.y, dir.z); light_data[light_index*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), radius, cosangle, invarea); light_data[light_index*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); light_data[light_index*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f); } else if(light->type == LIGHT_BACKGROUND) { uint visibility = scene->background->visibility; shader_id &= ~SHADER_AREA_LIGHT; shader_id |= SHADER_USE_MIS; if(!(visibility & PATH_RAY_DIFFUSE)) { shader_id |= SHADER_EXCLUDE_DIFFUSE; use_light_visibility = true; } if(!(visibility & PATH_RAY_GLOSSY)) { shader_id |= SHADER_EXCLUDE_GLOSSY; use_light_visibility = true; } if(!(visibility & PATH_RAY_TRANSMIT)) { shader_id |= SHADER_EXCLUDE_TRANSMIT; use_light_visibility = true; } if(!(visibility & PATH_RAY_VOLUME_SCATTER)) { shader_id |= SHADER_EXCLUDE_SCATTER; use_light_visibility = true; } light_data[light_index*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), 0.0f, 0.0f, 0.0f); light_data[light_index*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), 0.0f, 0.0f, 0.0f); light_data[light_index*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); light_data[light_index*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f); } else if(light->type == LIGHT_AREA) { float3 axisu = light->axisu*(light->sizeu*light->size); float3 axisv = light->axisv*(light->sizev*light->size); float area = len(axisu)*len(axisv); float invarea = (area > 0.0f)? 1.0f/area: 1.0f; float3 dir = light->dir; dir = safe_normalize(dir); if(light->use_mis && area > 0.0f) shader_id |= SHADER_USE_MIS; light_data[light_index*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z); light_data[light_index*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), axisu.x, axisu.y, axisu.z); light_data[light_index*LIGHT_SIZE + 2] = make_float4(invarea, axisv.x, axisv.y, axisv.z); light_data[light_index*LIGHT_SIZE + 3] = make_float4(samples, dir.x, dir.y, dir.z); } else if(light->type == LIGHT_SPOT) { shader_id &= ~SHADER_AREA_LIGHT; float radius = light->size; float invarea = (radius > 0.0f)? 1.0f/(M_PI_F*radius*radius): 1.0f; float spot_angle = cosf(light->spot_angle*0.5f); float spot_smooth = (1.0f - spot_angle)*light->spot_smooth; float3 dir = light->dir; dir = safe_normalize(dir); if(light->use_mis && radius > 0.0f) shader_id |= SHADER_USE_MIS; light_data[light_index*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z); light_data[light_index*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), radius, invarea, spot_angle); light_data[light_index*LIGHT_SIZE + 2] = make_float4(spot_smooth, dir.x, dir.y, dir.z); light_data[light_index*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f); } light_data[light_index*LIGHT_SIZE + 4] = make_float4(max_bounces, random, 0.0f, 0.0f); Transform tfm = light->tfm; Transform itfm = transform_inverse(tfm); memcpy(&light_data[light_index*LIGHT_SIZE + 5], &tfm, sizeof(float4)*3); memcpy(&light_data[light_index*LIGHT_SIZE + 8], &itfm, sizeof(float4)*3); light_index++; } /* TODO(sergey): Consider moving portals update to their own function * keeping this one more manageable. */ foreach(Light *light, scene->lights) { if(!light->is_portal) continue; assert(light->type == LIGHT_AREA); float3 co = light->co; float3 axisu = light->axisu*(light->sizeu*light->size); float3 axisv = light->axisv*(light->sizev*light->size); float area = len(axisu)*len(axisv); float invarea = (area > 0.0f) ? 1.0f / area : 1.0f; float3 dir = light->dir; dir = safe_normalize(dir); light_data[light_index*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), co.x, co.y, co.z); light_data[light_index*LIGHT_SIZE + 1] = make_float4(area, axisu.x, axisu.y, axisu.z); light_data[light_index*LIGHT_SIZE + 2] = make_float4(invarea, axisv.x, axisv.y, axisv.z); light_data[light_index*LIGHT_SIZE + 3] = make_float4(-1, dir.x, dir.y, dir.z); light_data[light_index*LIGHT_SIZE + 4] = make_float4(-1, 0.0f, 0.0f, 0.0f); Transform tfm = light->tfm; Transform itfm = transform_inverse(tfm); memcpy(&light_data[light_index*LIGHT_SIZE + 5], &tfm, sizeof(float4)*3); memcpy(&light_data[light_index*LIGHT_SIZE + 8], &itfm, sizeof(float4)*3); light_index++; } VLOG(1) << "Number of lights sent to the device: " << light_index; VLOG(1) << "Number of lights without contribution: " << num_scene_lights - light_index; dscene->light_data.copy_to_device(); } void LightManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { if(!need_update) return; VLOG(1) << "Total " << scene->lights.size() << " lights."; device_free(device, dscene); use_light_visibility = false; disable_ineffective_light(device, scene); device_update_points(device, dscene, scene); if(progress.get_cancel()) return; device_update_distribution(device, dscene, scene, progress); if(progress.get_cancel()) return; device_update_background(device, dscene, scene, progress); if(progress.get_cancel()) return; if(use_light_visibility != scene->film->use_light_visibility) { scene->film->use_light_visibility = use_light_visibility; scene->film->tag_update(scene); } need_update = false; } void LightManager::device_free(Device *, DeviceScene *dscene) { dscene->light_distribution.free(); dscene->light_data.free(); dscene->light_background_marginal_cdf.free(); dscene->light_background_conditional_cdf.free(); } void LightManager::tag_update(Scene * /*scene*/) { need_update = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/light.h000066400000000000000000000055111334742672700211360ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __LIGHT_H__ #define __LIGHT_H__ #include "kernel/kernel_types.h" #include "graph/node.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Object; class Progress; class Scene; class Shader; class Light : public Node { public: NODE_DECLARE; Light(); LightType type; float3 co; float3 dir; float size; float3 axisu; float sizeu; float3 axisv; float sizev; Transform tfm; int map_resolution; float spot_angle; float spot_smooth; bool cast_shadow; bool use_mis; bool use_diffuse; bool use_glossy; bool use_transmission; bool use_scatter; bool is_portal; bool is_enabled; Shader *shader; int samples; int max_bounces; uint random_id; void tag_update(Scene *scene); /* Check whether the light has contribution the the scene. */ bool has_contribution(Scene *scene); }; class LightManager { public: bool use_light_visibility; bool need_update; LightManager(); ~LightManager(); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free(Device *device, DeviceScene *dscene); void tag_update(Scene *scene); /* Check whether there is a background light. */ bool has_background_light(Scene *scene); protected: /* Optimization: disable light which is either unsupported or * which doesn't contribute to the scene or which is only used for MIS * and scene doesn't need MIS. */ void disable_ineffective_light(Device *device, Scene *scene); void device_update_points(Device *device, DeviceScene *dscene, Scene *scene); void device_update_distribution(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_update_background(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); /* Check whether light manager can use the object as a light-emissive. */ bool object_usable_as_light(Object *object); }; CCL_NAMESPACE_END #endif /* __LIGHT_H__ */ goxel-0.8.1/ext_src/cycles/src/render/mesh.cpp000066400000000000000000001766641334742672700213400ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bvh/bvh.h" #include "bvh/bvh_build.h" #include "render/camera.h" #include "render/curves.h" #include "device/device.h" #include "render/graph.h" #include "render/shader.h" #include "render/light.h" #include "render/mesh.h" #include "render/nodes.h" #include "render/object.h" #include "render/scene.h" #include "kernel/osl/osl_globals.h" #include "subd/subd_split.h" #include "subd/subd_patch_table.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_progress.h" #include "util/util_set.h" CCL_NAMESPACE_BEGIN /* Triangle */ void Mesh::Triangle::bounds_grow(const float3 *verts, BoundBox& bounds) const { bounds.grow(verts[v[0]]); bounds.grow(verts[v[1]]); bounds.grow(verts[v[2]]); } void Mesh::Triangle::motion_verts(const float3 *verts, const float3 *vert_steps, size_t num_verts, size_t num_steps, float time, float3 r_verts[3]) const { /* Figure out which steps we need to fetch and their interpolation factor. */ const size_t max_step = num_steps - 1; const size_t step = min((int)(time * max_step), max_step - 1); const float t = time*max_step - step; /* Fetch vertex coordinates. */ float3 curr_verts[3]; float3 next_verts[3]; verts_for_step(verts, vert_steps, num_verts, num_steps, step, curr_verts); verts_for_step(verts, vert_steps, num_verts, num_steps, step + 1, next_verts); /* Interpolate between steps. */ r_verts[0] = (1.0f - t)*curr_verts[0] + t*next_verts[0]; r_verts[1] = (1.0f - t)*curr_verts[1] + t*next_verts[1]; r_verts[2] = (1.0f - t)*curr_verts[2] + t*next_verts[2]; } void Mesh::Triangle::verts_for_step(const float3 *verts, const float3 *vert_steps, size_t num_verts, size_t num_steps, size_t step, float3 r_verts[3]) const { const size_t center_step = ((num_steps - 1) / 2); if(step == center_step) { /* Center step: regular vertex location. */ r_verts[0] = verts[v[0]]; r_verts[1] = verts[v[1]]; r_verts[2] = verts[v[2]]; } else { /* Center step not stored in the attribute array array. */ if(step > center_step) { step--; } size_t offset = step * num_verts; r_verts[0] = vert_steps[offset + v[0]]; r_verts[1] = vert_steps[offset + v[1]]; r_verts[2] = vert_steps[offset + v[2]]; } } float3 Mesh::Triangle::compute_normal(const float3 *verts) const { const float3& v0 = verts[v[0]]; const float3& v1 = verts[v[1]]; const float3& v2 = verts[v[2]]; const float3 norm = cross(v1 - v0, v2 - v0); const float normlen = len(norm); if(normlen == 0.0f) { return make_float3(1.0f, 0.0f, 0.0f); } return norm / normlen; } bool Mesh::Triangle::valid(const float3 *verts) const { return isfinite3_safe(verts[v[0]]) && isfinite3_safe(verts[v[1]]) && isfinite3_safe(verts[v[2]]); } /* Curve */ void Mesh::Curve::bounds_grow(const int k, const float3 *curve_keys, const float *curve_radius, BoundBox& bounds) const { float3 P[4]; P[0] = curve_keys[max(first_key + k - 1,first_key)]; P[1] = curve_keys[first_key + k]; P[2] = curve_keys[first_key + k + 1]; P[3] = curve_keys[min(first_key + k + 2, first_key + num_keys - 1)]; float3 lower; float3 upper; curvebounds(&lower.x, &upper.x, P, 0); curvebounds(&lower.y, &upper.y, P, 1); curvebounds(&lower.z, &upper.z, P, 2); float mr = max(curve_radius[first_key + k], curve_radius[first_key + k + 1]); bounds.grow(lower, mr); bounds.grow(upper, mr); } void Mesh::Curve::bounds_grow(const int k, const float3 *curve_keys, const float *curve_radius, const Transform& aligned_space, BoundBox& bounds) const { float3 P[4]; P[0] = curve_keys[max(first_key + k - 1,first_key)]; P[1] = curve_keys[first_key + k]; P[2] = curve_keys[first_key + k + 1]; P[3] = curve_keys[min(first_key + k + 2, first_key + num_keys - 1)]; P[0] = transform_point(&aligned_space, P[0]); P[1] = transform_point(&aligned_space, P[1]); P[2] = transform_point(&aligned_space, P[2]); P[3] = transform_point(&aligned_space, P[3]); float3 lower; float3 upper; curvebounds(&lower.x, &upper.x, P, 0); curvebounds(&lower.y, &upper.y, P, 1); curvebounds(&lower.z, &upper.z, P, 2); float mr = max(curve_radius[first_key + k], curve_radius[first_key + k + 1]); bounds.grow(lower, mr); bounds.grow(upper, mr); } void Mesh::Curve::bounds_grow(float4 keys[4], BoundBox& bounds) const { float3 P[4] = { float4_to_float3(keys[0]), float4_to_float3(keys[1]), float4_to_float3(keys[2]), float4_to_float3(keys[3]), }; float3 lower; float3 upper; curvebounds(&lower.x, &upper.x, P, 0); curvebounds(&lower.y, &upper.y, P, 1); curvebounds(&lower.z, &upper.z, P, 2); float mr = max(keys[1].w, keys[2].w); bounds.grow(lower, mr); bounds.grow(upper, mr); } void Mesh::Curve::motion_keys(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, float time, size_t k0, size_t k1, float4 r_keys[2]) const { /* Figure out which steps we need to fetch and their interpolation factor. */ const size_t max_step = num_steps - 1; const size_t step = min((int)(time * max_step), max_step - 1); const float t = time*max_step - step; /* Fetch vertex coordinates. */ float4 curr_keys[2]; float4 next_keys[2]; keys_for_step(curve_keys, curve_radius, key_steps, num_curve_keys, num_steps, step, k0, k1, curr_keys); keys_for_step(curve_keys, curve_radius, key_steps, num_curve_keys, num_steps, step + 1, k0, k1, next_keys); /* Interpolate between steps. */ r_keys[0] = (1.0f - t)*curr_keys[0] + t*next_keys[0]; r_keys[1] = (1.0f - t)*curr_keys[1] + t*next_keys[1]; } void Mesh::Curve::cardinal_motion_keys(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, float time, size_t k0, size_t k1, size_t k2, size_t k3, float4 r_keys[4]) const { /* Figure out which steps we need to fetch and their interpolation factor. */ const size_t max_step = num_steps - 1; const size_t step = min((int)(time * max_step), max_step - 1); const float t = time*max_step - step; /* Fetch vertex coordinates. */ float4 curr_keys[4]; float4 next_keys[4]; cardinal_keys_for_step(curve_keys, curve_radius, key_steps, num_curve_keys, num_steps, step, k0, k1, k2, k3, curr_keys); cardinal_keys_for_step(curve_keys, curve_radius, key_steps, num_curve_keys, num_steps, step + 1, k0, k1, k2, k3, next_keys); /* Interpolate between steps. */ r_keys[0] = (1.0f - t)*curr_keys[0] + t*next_keys[0]; r_keys[1] = (1.0f - t)*curr_keys[1] + t*next_keys[1]; r_keys[2] = (1.0f - t)*curr_keys[2] + t*next_keys[2]; r_keys[3] = (1.0f - t)*curr_keys[3] + t*next_keys[3]; } void Mesh::Curve::keys_for_step(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, size_t step, size_t k0, size_t k1, float4 r_keys[2]) const { k0 = max(k0, 0); k1 = min(k1, num_keys - 1); const size_t center_step = ((num_steps - 1) / 2); if(step == center_step) { /* Center step: regular key location. */ /* TODO(sergey): Consider adding make_float4(float3, float) * function. */ r_keys[0] = make_float4(curve_keys[first_key + k0].x, curve_keys[first_key + k0].y, curve_keys[first_key + k0].z, curve_radius[first_key + k0]); r_keys[1] = make_float4(curve_keys[first_key + k1].x, curve_keys[first_key + k1].y, curve_keys[first_key + k1].z, curve_radius[first_key + k1]); } else { /* Center step is not stored in this array. */ if(step > center_step) { step--; } const size_t offset = first_key + step * num_curve_keys; r_keys[0] = make_float4(key_steps[offset + k0].x, key_steps[offset + k0].y, key_steps[offset + k0].z, curve_radius[first_key + k0]); r_keys[1] = make_float4(key_steps[offset + k1].x, key_steps[offset + k1].y, key_steps[offset + k1].z, curve_radius[first_key + k1]); } } void Mesh::Curve::cardinal_keys_for_step(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, size_t step, size_t k0, size_t k1, size_t k2, size_t k3, float4 r_keys[4]) const { k0 = max(k0, 0); k3 = min(k3, num_keys - 1); const size_t center_step = ((num_steps - 1) / 2); if(step == center_step) { /* Center step: regular key location. */ r_keys[0] = make_float4(curve_keys[first_key + k0].x, curve_keys[first_key + k0].y, curve_keys[first_key + k0].z, curve_radius[first_key + k0]); r_keys[1] = make_float4(curve_keys[first_key + k1].x, curve_keys[first_key + k1].y, curve_keys[first_key + k1].z, curve_radius[first_key + k1]); r_keys[2] = make_float4(curve_keys[first_key + k2].x, curve_keys[first_key + k2].y, curve_keys[first_key + k2].z, curve_radius[first_key + k2]); r_keys[3] = make_float4(curve_keys[first_key + k3].x, curve_keys[first_key + k3].y, curve_keys[first_key + k3].z, curve_radius[first_key + k3]); } else { /* Center step is not stored in this array. */ if(step > center_step) { step--; } const size_t offset = first_key + step * num_curve_keys; r_keys[0] = make_float4(key_steps[offset + k0].x, key_steps[offset + k0].y, key_steps[offset + k0].z, curve_radius[first_key + k0]); r_keys[1] = make_float4(key_steps[offset + k1].x, key_steps[offset + k1].y, key_steps[offset + k1].z, curve_radius[first_key + k1]); r_keys[2] = make_float4(key_steps[offset + k2].x, key_steps[offset + k2].y, key_steps[offset + k2].z, curve_radius[first_key + k2]); r_keys[3] = make_float4(key_steps[offset + k3].x, key_steps[offset + k3].y, key_steps[offset + k3].z, curve_radius[first_key + k3]); } } /* SubdFace */ float3 Mesh::SubdFace::normal(const Mesh *mesh) const { float3 v0 = mesh->verts[mesh->subd_face_corners[start_corner+0]]; float3 v1 = mesh->verts[mesh->subd_face_corners[start_corner+1]]; float3 v2 = mesh->verts[mesh->subd_face_corners[start_corner+2]]; return safe_normalize(cross(v1 - v0, v2 - v0)); } /* Mesh */ NODE_DEFINE(Mesh) { NodeType* type = NodeType::add("mesh", create); SOCKET_UINT(motion_steps, "Motion Steps", 3); SOCKET_BOOLEAN(use_motion_blur, "Use Motion Blur", false); SOCKET_INT_ARRAY(triangles, "Triangles", array()); SOCKET_POINT_ARRAY(verts, "Vertices", array()); SOCKET_INT_ARRAY(shader, "Shader", array()); SOCKET_BOOLEAN_ARRAY(smooth, "Smooth", array()); SOCKET_POINT_ARRAY(curve_keys, "Curve Keys", array()); SOCKET_FLOAT_ARRAY(curve_radius, "Curve Radius", array()); SOCKET_INT_ARRAY(curve_first_key, "Curve First Key", array()); SOCKET_INT_ARRAY(curve_shader, "Curve Shader", array()); return type; } Mesh::Mesh() : Node(node_type) { need_update = true; need_update_rebuild = false; transform_applied = false; transform_negative_scaled = false; transform_normal = transform_identity(); bounds = BoundBox::empty; bvh = NULL; tri_offset = 0; vert_offset = 0; curve_offset = 0; curvekey_offset = 0; patch_offset = 0; face_offset = 0; corner_offset = 0; attr_map_offset = 0; num_subd_verts = 0; attributes.triangle_mesh = this; curve_attributes.curve_mesh = this; subd_attributes.subd_mesh = this; geometry_flags = GEOMETRY_NONE; has_volume = false; has_surface_bssrdf = false; num_ngons = 0; subdivision_type = SUBDIVISION_NONE; subd_params = NULL; patch_table = NULL; } Mesh::~Mesh() { delete bvh; delete patch_table; delete subd_params; } void Mesh::resize_mesh(int numverts, int numtris) { verts.resize(numverts); triangles.resize(numtris * 3); shader.resize(numtris); smooth.resize(numtris); if(subd_faces.size()) { triangle_patch.resize(numtris); vert_patch_uv.resize(numverts); } attributes.resize(); } void Mesh::reserve_mesh(int numverts, int numtris) { /* reserve space to add verts and triangles later */ verts.reserve(numverts); triangles.reserve(numtris * 3); shader.reserve(numtris); smooth.reserve(numtris); if(subd_faces.size()) { triangle_patch.reserve(numtris); vert_patch_uv.reserve(numverts); } attributes.resize(true); } void Mesh::resize_curves(int numcurves, int numkeys) { curve_keys.resize(numkeys); curve_radius.resize(numkeys); curve_first_key.resize(numcurves); curve_shader.resize(numcurves); curve_attributes.resize(); } void Mesh::reserve_curves(int numcurves, int numkeys) { curve_keys.reserve(numkeys); curve_radius.reserve(numkeys); curve_first_key.reserve(numcurves); curve_shader.reserve(numcurves); curve_attributes.resize(true); } void Mesh::resize_subd_faces(int numfaces, int num_ngons_, int numcorners) { subd_faces.resize(numfaces); subd_face_corners.resize(numcorners); num_ngons = num_ngons_; subd_attributes.resize(); } void Mesh::reserve_subd_faces(int numfaces, int num_ngons_, int numcorners) { subd_faces.reserve(numfaces); subd_face_corners.reserve(numcorners); num_ngons = num_ngons_; subd_attributes.resize(true); } void Mesh::clear() { /* clear all verts and triangles */ verts.clear(); triangles.clear(); shader.clear(); smooth.clear(); triangle_patch.clear(); vert_patch_uv.clear(); curve_keys.clear(); curve_radius.clear(); curve_first_key.clear(); curve_shader.clear(); subd_faces.clear(); subd_face_corners.clear(); num_subd_verts = 0; subd_creases.clear(); attributes.clear(); curve_attributes.clear(); subd_attributes.clear(); used_shaders.clear(); transform_applied = false; transform_negative_scaled = false; transform_normal = transform_identity(); geometry_flags = GEOMETRY_NONE; delete patch_table; patch_table = NULL; } int Mesh::split_vertex(int vertex) { /* copy vertex location and vertex attributes */ add_vertex_slow(verts[vertex]); foreach(Attribute& attr, attributes.attributes) { if(attr.element == ATTR_ELEMENT_VERTEX) { array tmp(attr.data_sizeof()); memcpy(tmp.data(), attr.data() + tmp.size()*vertex, tmp.size()); attr.add(tmp.data()); } } foreach(Attribute& attr, subd_attributes.attributes) { if(attr.element == ATTR_ELEMENT_VERTEX) { array tmp(attr.data_sizeof()); memcpy(tmp.data(), attr.data() + tmp.size()*vertex, tmp.size()); attr.add(tmp.data()); } } return verts.size() - 1; } void Mesh::add_vertex(float3 P) { verts.push_back_reserved(P); if(subd_faces.size()) { vert_patch_uv.push_back_reserved(make_float2(0.0f, 0.0f)); } } void Mesh::add_vertex_slow(float3 P) { verts.push_back_slow(P); if(subd_faces.size()) { vert_patch_uv.push_back_slow(make_float2(0.0f, 0.0f)); } } void Mesh::add_triangle(int v0, int v1, int v2, int shader_, bool smooth_) { triangles.push_back_reserved(v0); triangles.push_back_reserved(v1); triangles.push_back_reserved(v2); shader.push_back_reserved(shader_); smooth.push_back_reserved(smooth_); if(subd_faces.size()) { triangle_patch.push_back_reserved(-1); } } void Mesh::add_curve_key(float3 co, float radius) { curve_keys.push_back_reserved(co); curve_radius.push_back_reserved(radius); } void Mesh::add_curve(int first_key, int shader) { curve_first_key.push_back_reserved(first_key); curve_shader.push_back_reserved(shader); } void Mesh::add_subd_face(int* corners, int num_corners, int shader_, bool smooth_) { int start_corner = subd_face_corners.size(); for(int i = 0; i < num_corners; i++) { subd_face_corners.push_back_reserved(corners[i]); } int ptex_offset = 0; if(subd_faces.size()) { SubdFace& s = subd_faces[subd_faces.size()-1]; ptex_offset = s.ptex_offset + s.num_ptex_faces(); } SubdFace face = {start_corner, num_corners, shader_, smooth_, ptex_offset}; subd_faces.push_back_reserved(face); } void Mesh::compute_bounds() { BoundBox bnds = BoundBox::empty; size_t verts_size = verts.size(); size_t curve_keys_size = curve_keys.size(); if(verts_size + curve_keys_size > 0) { for(size_t i = 0; i < verts_size; i++) bnds.grow(verts[i]); for(size_t i = 0; i < curve_keys_size; i++) bnds.grow(curve_keys[i], curve_radius[i]); Attribute *attr = attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); if(use_motion_blur && attr) { size_t steps_size = verts.size() * (motion_steps - 1); float3 *vert_steps = attr->data_float3(); for(size_t i = 0; i < steps_size; i++) bnds.grow(vert_steps[i]); } Attribute *curve_attr = curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); if(use_motion_blur && curve_attr) { size_t steps_size = curve_keys.size() * (motion_steps - 1); float3 *key_steps = curve_attr->data_float3(); for(size_t i = 0; i < steps_size; i++) bnds.grow(key_steps[i]); } if(!bnds.valid()) { bnds = BoundBox::empty; /* skip nan or inf coordinates */ for(size_t i = 0; i < verts_size; i++) bnds.grow_safe(verts[i]); for(size_t i = 0; i < curve_keys_size; i++) bnds.grow_safe(curve_keys[i], curve_radius[i]); if(use_motion_blur && attr) { size_t steps_size = verts.size() * (motion_steps - 1); float3 *vert_steps = attr->data_float3(); for(size_t i = 0; i < steps_size; i++) bnds.grow_safe(vert_steps[i]); } if(use_motion_blur && curve_attr) { size_t steps_size = curve_keys.size() * (motion_steps - 1); float3 *key_steps = curve_attr->data_float3(); for(size_t i = 0; i < steps_size; i++) bnds.grow_safe(key_steps[i]); } } } if(!bnds.valid()) { /* empty mesh */ bnds.grow(make_float3(0.0f, 0.0f, 0.0f)); } bounds = bnds; } void Mesh::add_face_normals() { /* don't compute if already there */ if(attributes.find(ATTR_STD_FACE_NORMAL)) return; /* get attributes */ Attribute *attr_fN = attributes.add(ATTR_STD_FACE_NORMAL); float3 *fN = attr_fN->data_float3(); /* compute face normals */ size_t triangles_size = num_triangles(); if(triangles_size) { float3 *verts_ptr = verts.data(); for(size_t i = 0; i < triangles_size; i++) { fN[i] = get_triangle(i).compute_normal(verts_ptr); } } /* expected to be in local space */ if(transform_applied) { Transform ntfm = transform_inverse(transform_normal); for(size_t i = 0; i < triangles_size; i++) fN[i] = normalize(transform_direction(&ntfm, fN[i])); } } void Mesh::add_vertex_normals() { bool flip = transform_negative_scaled; size_t verts_size = verts.size(); size_t triangles_size = num_triangles(); /* static vertex normals */ if(!attributes.find(ATTR_STD_VERTEX_NORMAL) && triangles_size) { /* get attributes */ Attribute *attr_fN = attributes.find(ATTR_STD_FACE_NORMAL); Attribute *attr_vN = attributes.add(ATTR_STD_VERTEX_NORMAL); float3 *fN = attr_fN->data_float3(); float3 *vN = attr_vN->data_float3(); /* compute vertex normals */ memset(vN, 0, verts.size()*sizeof(float3)); for(size_t i = 0; i < triangles_size; i++) { for(size_t j = 0; j < 3; j++) { vN[get_triangle(i).v[j]] += fN[i]; } } for(size_t i = 0; i < verts_size; i++) { vN[i] = normalize(vN[i]); if(flip) { vN[i] = -vN[i]; } } } /* motion vertex normals */ Attribute *attr_mP = attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); Attribute *attr_mN = attributes.find(ATTR_STD_MOTION_VERTEX_NORMAL); if(has_motion_blur() && attr_mP && !attr_mN && triangles_size) { /* create attribute */ attr_mN = attributes.add(ATTR_STD_MOTION_VERTEX_NORMAL); for(int step = 0; step < motion_steps - 1; step++) { float3 *mP = attr_mP->data_float3() + step*verts.size(); float3 *mN = attr_mN->data_float3() + step*verts.size(); /* compute */ memset(mN, 0, verts.size()*sizeof(float3)); for(size_t i = 0; i < triangles_size; i++) { for(size_t j = 0; j < 3; j++) { float3 fN = get_triangle(i).compute_normal(mP); mN[get_triangle(i).v[j]] += fN; } } for(size_t i = 0; i < verts_size; i++) { mN[i] = normalize(mN[i]); if(flip) { mN[i] = -mN[i]; } } } } /* subd vertex normals */ if(!subd_attributes.find(ATTR_STD_VERTEX_NORMAL) && subd_faces.size()) { /* get attributes */ Attribute *attr_vN = subd_attributes.add(ATTR_STD_VERTEX_NORMAL); float3 *vN = attr_vN->data_float3(); /* compute vertex normals */ memset(vN, 0, verts.size()*sizeof(float3)); for(size_t i = 0; i < subd_faces.size(); i++) { SubdFace& face = subd_faces[i]; float3 fN = face.normal(this); for(size_t j = 0; j < face.num_corners; j++) { size_t corner = subd_face_corners[face.start_corner+j]; vN[corner] += fN; } } for(size_t i = 0; i < verts_size; i++) { vN[i] = normalize(vN[i]); if(flip) { vN[i] = -vN[i]; } } } } void Mesh::add_undisplaced() { AttributeSet& attrs = (subdivision_type == SUBDIVISION_NONE) ? attributes : subd_attributes; /* don't compute if already there */ if(attrs.find(ATTR_STD_POSITION_UNDISPLACED)) { return; } /* get attribute */ Attribute *attr = attrs.add(ATTR_STD_POSITION_UNDISPLACED); attr->flags |= ATTR_SUBDIVIDED; float3 *data = attr->data_float3(); /* copy verts */ size_t size = attr->buffer_size(this, (subdivision_type == SUBDIVISION_NONE) ? ATTR_PRIM_TRIANGLE : ATTR_PRIM_SUBD); /* Center points for ngons aren't stored in Mesh::verts but are included in size since they will be * calculated later, we subtract them from size here so we don't have an overflow while copying. */ size -= num_ngons * attr->data_sizeof(); if(size) { memcpy(data, verts.data(), size); } } void Mesh::pack_normals(Scene *scene, uint *tri_shader, float4 *vnormal) { Attribute *attr_vN = attributes.find(ATTR_STD_VERTEX_NORMAL); if(attr_vN == NULL) { /* Happens on objects with just hair. */ return; } float3 *vN = attr_vN->data_float3(); uint shader_id = 0; uint last_shader = -1; bool last_smooth = false; size_t triangles_size = num_triangles(); int *shader_ptr = shader.data(); bool do_transform = transform_applied; Transform ntfm = transform_normal; /* save shader */ for(size_t i = 0; i < triangles_size; i++) { if(shader_ptr[i] != last_shader || last_smooth != smooth[i]) { last_shader = shader_ptr[i]; last_smooth = smooth[i]; Shader *shader = (last_shader < used_shaders.size()) ? used_shaders[last_shader] : scene->default_surface; shader_id = scene->shader_manager->get_shader_id(shader, last_smooth); } tri_shader[i] = shader_id; } size_t verts_size = verts.size(); for(size_t i = 0; i < verts_size; i++) { float3 vNi = vN[i]; if(do_transform) vNi = safe_normalize(transform_direction(&ntfm, vNi)); vnormal[i] = make_float4(vNi.x, vNi.y, vNi.z, 0.0f); } } void Mesh::pack_verts(const vector& tri_prim_index, uint4 *tri_vindex, uint *tri_patch, float2 *tri_patch_uv, size_t vert_offset, size_t tri_offset) { size_t verts_size = verts.size(); if(verts_size && subd_faces.size()) { float2 *vert_patch_uv_ptr = vert_patch_uv.data(); for(size_t i = 0; i < verts_size; i++) { tri_patch_uv[i] = vert_patch_uv_ptr[i]; } } size_t triangles_size = num_triangles(); for(size_t i = 0; i < triangles_size; i++) { Triangle t = get_triangle(i); tri_vindex[i] = make_uint4(t.v[0] + vert_offset, t.v[1] + vert_offset, t.v[2] + vert_offset, tri_prim_index[i + tri_offset]); tri_patch[i] = (!subd_faces.size()) ? -1 : (triangle_patch[i]*8 + patch_offset); } } void Mesh::pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset) { size_t curve_keys_size = curve_keys.size(); /* pack curve keys */ if(curve_keys_size) { float3 *keys_ptr = curve_keys.data(); float *radius_ptr = curve_radius.data(); for(size_t i = 0; i < curve_keys_size; i++) curve_key_co[i] = make_float4(keys_ptr[i].x, keys_ptr[i].y, keys_ptr[i].z, radius_ptr[i]); } /* pack curve segments */ size_t curve_num = num_curves(); for(size_t i = 0; i < curve_num; i++) { Curve curve = get_curve(i); int shader_id = curve_shader[i]; Shader *shader = (shader_id < used_shaders.size()) ? used_shaders[shader_id] : scene->default_surface; shader_id = scene->shader_manager->get_shader_id(shader, false); curve_data[i] = make_float4( __int_as_float(curve.first_key + curvekey_offset), __int_as_float(curve.num_keys), __int_as_float(shader_id), 0.0f); } } void Mesh::pack_patches(uint *patch_data, uint vert_offset, uint face_offset, uint corner_offset) { size_t num_faces = subd_faces.size(); int ngons = 0; for(size_t f = 0; f < num_faces; f++) { SubdFace face = subd_faces[f]; if(face.is_quad()) { int c[4]; memcpy(c, &subd_face_corners[face.start_corner], sizeof(int)*4); *(patch_data++) = c[0] + vert_offset; *(patch_data++) = c[1] + vert_offset; *(patch_data++) = c[2] + vert_offset; *(patch_data++) = c[3] + vert_offset; *(patch_data++) = f+face_offset; *(patch_data++) = face.num_corners; *(patch_data++) = face.start_corner + corner_offset; *(patch_data++) = 0; } else { for(int i = 0; i < face.num_corners; i++) { int c[4]; c[0] = subd_face_corners[face.start_corner + mod(i + 0, face.num_corners)]; c[1] = subd_face_corners[face.start_corner + mod(i + 1, face.num_corners)]; c[2] = verts.size() - num_subd_verts + ngons; c[3] = subd_face_corners[face.start_corner + mod(i - 1, face.num_corners)]; *(patch_data++) = c[0] + vert_offset; *(patch_data++) = c[1] + vert_offset; *(patch_data++) = c[2] + vert_offset; *(patch_data++) = c[3] + vert_offset; *(patch_data++) = f+face_offset; *(patch_data++) = face.num_corners | (i << 16); *(patch_data++) = face.start_corner + corner_offset; *(patch_data++) = subd_face_corners.size() + ngons + corner_offset; } ngons++; } } } void Mesh::compute_bvh(Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, int n, int total) { if(progress->get_cancel()) return; compute_bounds(); if(need_build_bvh()) { string msg = "Updating Mesh BVH "; if(name == "") msg += string_printf("%u/%u", (uint)(n+1), (uint)total); else msg += string_printf("%s %u/%u", name.c_str(), (uint)(n+1), (uint)total); Object object; object.mesh = this; vector objects; objects.push_back(&object); if(bvh && !need_update_rebuild) { progress->set_status(msg, "Refitting BVH"); bvh->objects = objects; bvh->refit(*progress); } else { progress->set_status(msg, "Building BVH"); BVHParams bparams; bparams.use_spatial_split = params->use_bvh_spatial_split; bparams.bvh_layout = BVHParams::best_bvh_layout( params->bvh_layout, device->info.bvh_layout_mask); bparams.use_unaligned_nodes = dscene->data.bvh.have_curves && params->use_bvh_unaligned_nodes; bparams.num_motion_triangle_steps = params->num_bvh_time_steps; bparams.num_motion_curve_steps = params->num_bvh_time_steps; delete bvh; bvh = BVH::create(bparams, objects); MEM_GUARDED_CALL(progress, bvh->build, *progress); } } need_update = false; need_update_rebuild = false; } void Mesh::tag_update(Scene *scene, bool rebuild) { need_update = true; if(rebuild) { need_update_rebuild = true; scene->light_manager->need_update = true; } else { foreach(Shader *shader, used_shaders) if(shader->has_surface_emission) scene->light_manager->need_update = true; } scene->mesh_manager->need_update = true; scene->object_manager->need_update = true; } bool Mesh::has_motion_blur() const { return (use_motion_blur && (attributes.find(ATTR_STD_MOTION_VERTEX_POSITION) || curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION))); } bool Mesh::has_true_displacement() const { foreach(Shader *shader, used_shaders) { if(shader->has_displacement && shader->displacement_method != DISPLACE_BUMP) { return true; } } return false; } bool Mesh::need_build_bvh() const { return !transform_applied || has_surface_bssrdf; } bool Mesh::is_instanced() const { /* Currently we treat subsurface objects as instanced. * * While it might be not very optimal for ray traversal, it avoids having * duplicated BVH in the memory, saving quite some space. */ return !transform_applied || has_surface_bssrdf; } /* Mesh Manager */ MeshManager::MeshManager() { need_update = true; need_flags_update = true; } MeshManager::~MeshManager() { } void MeshManager::update_osl_attributes(Device *device, Scene *scene, vector& mesh_attributes) { #ifdef WITH_OSL /* for OSL, a hash map is used to lookup the attribute by name. */ OSLGlobals *og = (OSLGlobals*)device->osl_memory(); og->object_name_map.clear(); og->attribute_map.clear(); og->object_names.clear(); og->attribute_map.resize(scene->objects.size()*ATTR_PRIM_TYPES); for(size_t i = 0; i < scene->objects.size(); i++) { /* set object name to object index map */ Object *object = scene->objects[i]; og->object_name_map[object->name] = i; og->object_names.push_back(object->name); /* set object attributes */ foreach(ParamValue& attr, object->attributes) { OSLGlobals::Attribute osl_attr; osl_attr.type = attr.type(); osl_attr.desc.element = ATTR_ELEMENT_OBJECT; osl_attr.value = attr; osl_attr.desc.offset = 0; osl_attr.desc.flags = 0; og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_TRIANGLE][attr.name()] = osl_attr; og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_CURVE][attr.name()] = osl_attr; og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_SUBD][attr.name()] = osl_attr; } /* find mesh attributes */ size_t j; for(j = 0; j < scene->meshes.size(); j++) if(scene->meshes[j] == object->mesh) break; AttributeRequestSet& attributes = mesh_attributes[j]; /* set object attributes */ foreach(AttributeRequest& req, attributes.requests) { OSLGlobals::Attribute osl_attr; if(req.triangle_desc.element != ATTR_ELEMENT_NONE) { osl_attr.desc = req.triangle_desc; if(req.triangle_type == TypeDesc::TypeFloat) osl_attr.type = TypeDesc::TypeFloat; else if(req.triangle_type == TypeDesc::TypeMatrix) osl_attr.type = TypeDesc::TypeMatrix; else osl_attr.type = TypeDesc::TypeColor; if(req.std != ATTR_STD_NONE) { /* if standard attribute, add lookup by geom: name convention */ ustring stdname(string("geom:") + string(Attribute::standard_name(req.std))); og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_TRIANGLE][stdname] = osl_attr; } else if(req.name != ustring()) { /* add lookup by mesh attribute name */ og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_TRIANGLE][req.name] = osl_attr; } } if(req.curve_desc.element != ATTR_ELEMENT_NONE) { osl_attr.desc = req.curve_desc; if(req.curve_type == TypeDesc::TypeFloat) osl_attr.type = TypeDesc::TypeFloat; else if(req.curve_type == TypeDesc::TypeMatrix) osl_attr.type = TypeDesc::TypeMatrix; else osl_attr.type = TypeDesc::TypeColor; if(req.std != ATTR_STD_NONE) { /* if standard attribute, add lookup by geom: name convention */ ustring stdname(string("geom:") + string(Attribute::standard_name(req.std))); og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_CURVE][stdname] = osl_attr; } else if(req.name != ustring()) { /* add lookup by mesh attribute name */ og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_CURVE][req.name] = osl_attr; } } if(req.subd_desc.element != ATTR_ELEMENT_NONE) { osl_attr.desc = req.subd_desc; if(req.subd_type == TypeDesc::TypeFloat) osl_attr.type = TypeDesc::TypeFloat; else if(req.subd_type == TypeDesc::TypeMatrix) osl_attr.type = TypeDesc::TypeMatrix; else osl_attr.type = TypeDesc::TypeColor; if(req.std != ATTR_STD_NONE) { /* if standard attribute, add lookup by geom: name convention */ ustring stdname(string("geom:") + string(Attribute::standard_name(req.std))); og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_SUBD][stdname] = osl_attr; } else if(req.name != ustring()) { /* add lookup by mesh attribute name */ og->attribute_map[i*ATTR_PRIM_TYPES + ATTR_PRIM_SUBD][req.name] = osl_attr; } } } } #else (void)device; (void)scene; (void)mesh_attributes; #endif } void MeshManager::update_svm_attributes(Device *, DeviceScene *dscene, Scene *scene, vector& mesh_attributes) { /* for SVM, the attributes_map table is used to lookup the offset of an * attribute, based on a unique shader attribute id. */ /* compute array stride */ int attr_map_size = 0; for(size_t i = 0; i < scene->meshes.size(); i++) { Mesh *mesh = scene->meshes[i]; mesh->attr_map_offset = attr_map_size; attr_map_size += (mesh_attributes[i].size() + 1)*ATTR_PRIM_TYPES; } if(attr_map_size == 0) return; /* create attribute map */ uint4 *attr_map = dscene->attributes_map.alloc(attr_map_size*scene->meshes.size()); memset(attr_map, 0, dscene->attributes_map.size()*sizeof(uint)); for(size_t i = 0; i < scene->meshes.size(); i++) { Mesh *mesh = scene->meshes[i]; AttributeRequestSet& attributes = mesh_attributes[i]; /* set object attributes */ int index = mesh->attr_map_offset; foreach(AttributeRequest& req, attributes.requests) { uint id; if(req.std == ATTR_STD_NONE) id = scene->shader_manager->get_attribute_id(req.name); else id = scene->shader_manager->get_attribute_id(req.std); if(mesh->num_triangles()) { attr_map[index].x = id; attr_map[index].y = req.triangle_desc.element; attr_map[index].z = as_uint(req.triangle_desc.offset); if(req.triangle_type == TypeDesc::TypeFloat) attr_map[index].w = NODE_ATTR_FLOAT; else if(req.triangle_type == TypeDesc::TypeMatrix) attr_map[index].w = NODE_ATTR_MATRIX; else attr_map[index].w = NODE_ATTR_FLOAT3; attr_map[index].w |= req.triangle_desc.flags << 8; } index++; if(mesh->num_curves()) { attr_map[index].x = id; attr_map[index].y = req.curve_desc.element; attr_map[index].z = as_uint(req.curve_desc.offset); if(req.curve_type == TypeDesc::TypeFloat) attr_map[index].w = NODE_ATTR_FLOAT; else if(req.curve_type == TypeDesc::TypeMatrix) attr_map[index].w = NODE_ATTR_MATRIX; else attr_map[index].w = NODE_ATTR_FLOAT3; attr_map[index].w |= req.curve_desc.flags << 8; } index++; if(mesh->subd_faces.size()) { attr_map[index].x = id; attr_map[index].y = req.subd_desc.element; attr_map[index].z = as_uint(req.subd_desc.offset); if(req.subd_type == TypeDesc::TypeFloat) attr_map[index].w = NODE_ATTR_FLOAT; else if(req.subd_type == TypeDesc::TypeMatrix) attr_map[index].w = NODE_ATTR_MATRIX; else attr_map[index].w = NODE_ATTR_FLOAT3; attr_map[index].w |= req.subd_desc.flags << 8; } index++; } /* terminator */ for(int j = 0; j < ATTR_PRIM_TYPES; j++) { attr_map[index].x = ATTR_STD_NONE; attr_map[index].y = 0; attr_map[index].z = 0; attr_map[index].w = 0; index++; } } /* copy to device */ dscene->attributes_map.copy_to_device(); } static void update_attribute_element_size(Mesh *mesh, Attribute *mattr, AttributePrimitive prim, size_t *attr_float_size, size_t *attr_float3_size, size_t *attr_uchar4_size) { if(mattr) { size_t size = mattr->element_size(mesh, prim); if(mattr->element == ATTR_ELEMENT_VOXEL) { /* pass */ } else if(mattr->element == ATTR_ELEMENT_CORNER_BYTE) { *attr_uchar4_size += size; } else if(mattr->type == TypeDesc::TypeFloat) { *attr_float_size += size; } else if(mattr->type == TypeDesc::TypeMatrix) { *attr_float3_size += size * 4; } else { *attr_float3_size += size; } } } static void update_attribute_element_offset(Mesh *mesh, device_vector& attr_float, size_t& attr_float_offset, device_vector& attr_float3, size_t& attr_float3_offset, device_vector& attr_uchar4, size_t& attr_uchar4_offset, Attribute *mattr, AttributePrimitive prim, TypeDesc& type, AttributeDescriptor& desc) { if(mattr) { /* store element and type */ desc.element = mattr->element; desc.flags = mattr->flags; type = mattr->type; /* store attribute data in arrays */ size_t size = mattr->element_size(mesh, prim); AttributeElement& element = desc.element; int& offset = desc.offset; if(mattr->element == ATTR_ELEMENT_VOXEL) { /* store slot in offset value */ VoxelAttribute *voxel_data = mattr->data_voxel(); offset = voxel_data->slot; } else if(mattr->element == ATTR_ELEMENT_CORNER_BYTE) { uchar4 *data = mattr->data_uchar4(); offset = attr_uchar4_offset; assert(attr_uchar4.size() >= offset + size); for(size_t k = 0; k < size; k++) { attr_uchar4[offset+k] = data[k]; } attr_uchar4_offset += size; } else if(mattr->type == TypeDesc::TypeFloat) { float *data = mattr->data_float(); offset = attr_float_offset; assert(attr_float.size() >= offset + size); for(size_t k = 0; k < size; k++) { attr_float[offset+k] = data[k]; } attr_float_offset += size; } else if(mattr->type == TypeDesc::TypeMatrix) { Transform *tfm = mattr->data_transform(); offset = attr_float3_offset; assert(attr_float3.size() >= offset + size * 4); for(size_t k = 0; k < size*4; k++) { attr_float3[offset+k] = (&tfm->x)[k]; } attr_float3_offset += size * 4; } else { float4 *data = mattr->data_float4(); offset = attr_float3_offset; assert(attr_float3.size() >= offset + size); for(size_t k = 0; k < size; k++) { attr_float3[offset+k] = data[k]; } attr_float3_offset += size; } /* mesh vertex/curve index is global, not per object, so we sneak * a correction for that in here */ if(mesh->subdivision_type == Mesh::SUBDIVISION_CATMULL_CLARK && desc.flags & ATTR_SUBDIVIDED) { /* indices for subdivided attributes are retrieved * from patch table so no need for correction here*/ } else if(element == ATTR_ELEMENT_VERTEX) offset -= mesh->vert_offset; else if(element == ATTR_ELEMENT_VERTEX_MOTION) offset -= mesh->vert_offset; else if(element == ATTR_ELEMENT_FACE) { if(prim == ATTR_PRIM_TRIANGLE) offset -= mesh->tri_offset; else offset -= mesh->face_offset; } else if(element == ATTR_ELEMENT_CORNER || element == ATTR_ELEMENT_CORNER_BYTE) { if(prim == ATTR_PRIM_TRIANGLE) offset -= 3*mesh->tri_offset; else offset -= mesh->corner_offset; } else if(element == ATTR_ELEMENT_CURVE) offset -= mesh->curve_offset; else if(element == ATTR_ELEMENT_CURVE_KEY) offset -= mesh->curvekey_offset; else if(element == ATTR_ELEMENT_CURVE_KEY_MOTION) offset -= mesh->curvekey_offset; } else { /* attribute not found */ desc.element = ATTR_ELEMENT_NONE; desc.offset = 0; } } void MeshManager::device_update_attributes(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { progress.set_status("Updating Mesh", "Computing attributes"); /* gather per mesh requested attributes. as meshes may have multiple * shaders assigned, this merges the requested attributes that have * been set per shader by the shader manager */ vector mesh_attributes(scene->meshes.size()); for(size_t i = 0; i < scene->meshes.size(); i++) { Mesh *mesh = scene->meshes[i]; scene->need_global_attributes(mesh_attributes[i]); foreach(Shader *shader, mesh->used_shaders) { mesh_attributes[i].add(shader->attributes); } } /* mesh attribute are stored in a single array per data type. here we fill * those arrays, and set the offset and element type to create attribute * maps next */ /* Pre-allocate attributes to avoid arrays re-allocation which would * take 2x of overall attribute memory usage. */ size_t attr_float_size = 0; size_t attr_float3_size = 0; size_t attr_uchar4_size = 0; for(size_t i = 0; i < scene->meshes.size(); i++) { Mesh *mesh = scene->meshes[i]; AttributeRequestSet& attributes = mesh_attributes[i]; foreach(AttributeRequest& req, attributes.requests) { Attribute *triangle_mattr = mesh->attributes.find(req); Attribute *curve_mattr = mesh->curve_attributes.find(req); Attribute *subd_mattr = mesh->subd_attributes.find(req); update_attribute_element_size(mesh, triangle_mattr, ATTR_PRIM_TRIANGLE, &attr_float_size, &attr_float3_size, &attr_uchar4_size); update_attribute_element_size(mesh, curve_mattr, ATTR_PRIM_CURVE, &attr_float_size, &attr_float3_size, &attr_uchar4_size); update_attribute_element_size(mesh, subd_mattr, ATTR_PRIM_SUBD, &attr_float_size, &attr_float3_size, &attr_uchar4_size); } } dscene->attributes_float.alloc(attr_float_size); dscene->attributes_float3.alloc(attr_float3_size); dscene->attributes_uchar4.alloc(attr_uchar4_size); size_t attr_float_offset = 0; size_t attr_float3_offset = 0; size_t attr_uchar4_offset = 0; /* Fill in attributes. */ for(size_t i = 0; i < scene->meshes.size(); i++) { Mesh *mesh = scene->meshes[i]; AttributeRequestSet& attributes = mesh_attributes[i]; /* todo: we now store std and name attributes from requests even if * they actually refer to the same mesh attributes, optimize */ foreach(AttributeRequest& req, attributes.requests) { Attribute *triangle_mattr = mesh->attributes.find(req); Attribute *curve_mattr = mesh->curve_attributes.find(req); Attribute *subd_mattr = mesh->subd_attributes.find(req); update_attribute_element_offset(mesh, dscene->attributes_float, attr_float_offset, dscene->attributes_float3, attr_float3_offset, dscene->attributes_uchar4, attr_uchar4_offset, triangle_mattr, ATTR_PRIM_TRIANGLE, req.triangle_type, req.triangle_desc); update_attribute_element_offset(mesh, dscene->attributes_float, attr_float_offset, dscene->attributes_float3, attr_float3_offset, dscene->attributes_uchar4, attr_uchar4_offset, curve_mattr, ATTR_PRIM_CURVE, req.curve_type, req.curve_desc); update_attribute_element_offset(mesh, dscene->attributes_float, attr_float_offset, dscene->attributes_float3, attr_float3_offset, dscene->attributes_uchar4, attr_uchar4_offset, subd_mattr, ATTR_PRIM_SUBD, req.subd_type, req.subd_desc); if(progress.get_cancel()) return; } } /* create attribute lookup maps */ if(scene->shader_manager->use_osl()) update_osl_attributes(device, scene, mesh_attributes); update_svm_attributes(device, dscene, scene, mesh_attributes); if(progress.get_cancel()) return; /* copy to device */ progress.set_status("Updating Mesh", "Copying Attributes to device"); if(dscene->attributes_float.size()) { dscene->attributes_float.copy_to_device(); } if(dscene->attributes_float3.size()) { dscene->attributes_float3.copy_to_device(); } if(dscene->attributes_uchar4.size()) { dscene->attributes_uchar4.copy_to_device(); } if(progress.get_cancel()) return; /* After mesh attributes and patch tables have been copied to device memory, * we need to update offsets in the objects. */ scene->object_manager->device_update_mesh_offsets(device, dscene, scene); } void MeshManager::mesh_calc_offset(Scene *scene) { size_t vert_size = 0; size_t tri_size = 0; size_t curve_key_size = 0; size_t curve_size = 0; size_t patch_size = 0; size_t face_size = 0; size_t corner_size = 0; foreach(Mesh *mesh, scene->meshes) { mesh->vert_offset = vert_size; mesh->tri_offset = tri_size; mesh->curvekey_offset = curve_key_size; mesh->curve_offset = curve_size; mesh->patch_offset = patch_size; mesh->face_offset = face_size; mesh->corner_offset = corner_size; vert_size += mesh->verts.size(); tri_size += mesh->num_triangles(); curve_key_size += mesh->curve_keys.size(); curve_size += mesh->num_curves(); if(mesh->subd_faces.size()) { Mesh::SubdFace& last = mesh->subd_faces[mesh->subd_faces.size()-1]; patch_size += (last.ptex_offset + last.num_ptex_faces()) * 8; /* patch tables are stored in same array so include them in patch_size */ if(mesh->patch_table) { mesh->patch_table_offset = patch_size; patch_size += mesh->patch_table->total_size(); } } face_size += mesh->subd_faces.size(); corner_size += mesh->subd_face_corners.size(); } } void MeshManager::device_update_mesh(Device *, DeviceScene *dscene, Scene *scene, bool for_displacement, Progress& progress) { /* Count. */ size_t vert_size = 0; size_t tri_size = 0; size_t curve_key_size = 0; size_t curve_size = 0; size_t patch_size = 0; foreach(Mesh *mesh, scene->meshes) { vert_size += mesh->verts.size(); tri_size += mesh->num_triangles(); curve_key_size += mesh->curve_keys.size(); curve_size += mesh->num_curves(); if(mesh->subd_faces.size()) { Mesh::SubdFace& last = mesh->subd_faces[mesh->subd_faces.size()-1]; patch_size += (last.ptex_offset + last.num_ptex_faces()) * 8; /* patch tables are stored in same array so include them in patch_size */ if(mesh->patch_table) { mesh->patch_table_offset = patch_size; patch_size += mesh->patch_table->total_size(); } } } /* Create mapping from triangle to primitive triangle array. */ vector tri_prim_index(tri_size); if(for_displacement) { /* For displacement kernels we do some trickery to make them believe * we've got all required data ready. However, that data is different * from final render kernels since we don't have BVH yet, so can't * really use same semantic of arrays. */ foreach(Mesh *mesh, scene->meshes) { for(size_t i = 0; i < mesh->num_triangles(); ++i) { tri_prim_index[i + mesh->tri_offset] = 3 * (i + mesh->tri_offset); } } } else { for(size_t i = 0; i < dscene->prim_index.size(); ++i) { if((dscene->prim_type[i] & PRIMITIVE_ALL_TRIANGLE) != 0) { tri_prim_index[dscene->prim_index[i]] = dscene->prim_tri_index[i]; } } } /* Fill in all the arrays. */ if(tri_size != 0) { /* normals */ progress.set_status("Updating Mesh", "Computing normals"); uint *tri_shader = dscene->tri_shader.alloc(tri_size); float4 *vnormal = dscene->tri_vnormal.alloc(vert_size); uint4 *tri_vindex = dscene->tri_vindex.alloc(tri_size); uint *tri_patch = dscene->tri_patch.alloc(tri_size); float2 *tri_patch_uv = dscene->tri_patch_uv.alloc(vert_size); foreach(Mesh *mesh, scene->meshes) { mesh->pack_normals(scene, &tri_shader[mesh->tri_offset], &vnormal[mesh->vert_offset]); mesh->pack_verts(tri_prim_index, &tri_vindex[mesh->tri_offset], &tri_patch[mesh->tri_offset], &tri_patch_uv[mesh->vert_offset], mesh->vert_offset, mesh->tri_offset); if(progress.get_cancel()) return; } /* vertex coordinates */ progress.set_status("Updating Mesh", "Copying Mesh to device"); dscene->tri_shader.copy_to_device(); dscene->tri_vnormal.copy_to_device(); dscene->tri_vindex.copy_to_device(); dscene->tri_patch.copy_to_device(); dscene->tri_patch_uv.copy_to_device(); } if(curve_size != 0) { progress.set_status("Updating Mesh", "Copying Strands to device"); float4 *curve_keys = dscene->curve_keys.alloc(curve_key_size); float4 *curves = dscene->curves.alloc(curve_size); foreach(Mesh *mesh, scene->meshes) { mesh->pack_curves(scene, &curve_keys[mesh->curvekey_offset], &curves[mesh->curve_offset], mesh->curvekey_offset); if(progress.get_cancel()) return; } dscene->curve_keys.copy_to_device(); dscene->curves.copy_to_device(); } if(patch_size != 0) { progress.set_status("Updating Mesh", "Copying Patches to device"); uint *patch_data = dscene->patches.alloc(patch_size); foreach(Mesh *mesh, scene->meshes) { mesh->pack_patches(&patch_data[mesh->patch_offset], mesh->vert_offset, mesh->face_offset, mesh->corner_offset); if(mesh->patch_table) { mesh->patch_table->copy_adjusting_offsets(&patch_data[mesh->patch_table_offset], mesh->patch_table_offset); } if(progress.get_cancel()) return; } dscene->patches.copy_to_device(); } if(for_displacement) { float4 *prim_tri_verts = dscene->prim_tri_verts.alloc(tri_size * 3); foreach(Mesh *mesh, scene->meshes) { for(size_t i = 0; i < mesh->num_triangles(); ++i) { Mesh::Triangle t = mesh->get_triangle(i); size_t offset = 3 * (i + mesh->tri_offset); prim_tri_verts[offset + 0] = float3_to_float4(mesh->verts[t.v[0]]); prim_tri_verts[offset + 1] = float3_to_float4(mesh->verts[t.v[1]]); prim_tri_verts[offset + 2] = float3_to_float4(mesh->verts[t.v[2]]); } } dscene->prim_tri_verts.copy_to_device(); } } void MeshManager::device_update_bvh(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { /* bvh build */ progress.set_status("Updating Scene BVH", "Building"); BVHParams bparams; bparams.top_level = true; bparams.bvh_layout = BVHParams::best_bvh_layout( scene->params.bvh_layout, device->info.bvh_layout_mask); bparams.use_spatial_split = scene->params.use_bvh_spatial_split; bparams.use_unaligned_nodes = dscene->data.bvh.have_curves && scene->params.use_bvh_unaligned_nodes; bparams.num_motion_triangle_steps = scene->params.num_bvh_time_steps; bparams.num_motion_curve_steps = scene->params.num_bvh_time_steps; VLOG(1) << "Using " << bvh_layout_name(bparams.bvh_layout) << " layout."; BVH *bvh = BVH::create(bparams, scene->objects); bvh->build(progress); if(progress.get_cancel()) { delete bvh; return; } /* copy to device */ progress.set_status("Updating Scene BVH", "Copying BVH to device"); PackedBVH& pack = bvh->pack; if(pack.nodes.size()) { dscene->bvh_nodes.steal_data(pack.nodes); dscene->bvh_nodes.copy_to_device(); } if(pack.leaf_nodes.size()) { dscene->bvh_leaf_nodes.steal_data(pack.leaf_nodes); dscene->bvh_leaf_nodes.copy_to_device(); } if(pack.object_node.size()) { dscene->object_node.steal_data(pack.object_node); dscene->object_node.copy_to_device(); } if(pack.prim_tri_index.size()) { dscene->prim_tri_index.steal_data(pack.prim_tri_index); dscene->prim_tri_index.copy_to_device(); } if(pack.prim_tri_verts.size()) { dscene->prim_tri_verts.steal_data(pack.prim_tri_verts); dscene->prim_tri_verts.copy_to_device(); } if(pack.prim_type.size()) { dscene->prim_type.steal_data(pack.prim_type); dscene->prim_type.copy_to_device(); } if(pack.prim_visibility.size()) { dscene->prim_visibility.steal_data(pack.prim_visibility); dscene->prim_visibility.copy_to_device(); } if(pack.prim_index.size()) { dscene->prim_index.steal_data(pack.prim_index); dscene->prim_index.copy_to_device(); } if(pack.prim_object.size()) { dscene->prim_object.steal_data(pack.prim_object); dscene->prim_object.copy_to_device(); } if(pack.prim_time.size()) { dscene->prim_time.steal_data(pack.prim_time); dscene->prim_time.copy_to_device(); } dscene->data.bvh.root = pack.root_index; dscene->data.bvh.bvh_layout = bparams.bvh_layout; dscene->data.bvh.use_bvh_steps = (scene->params.num_bvh_time_steps != 0); delete bvh; } void MeshManager::device_update_flags(Device * /*device*/, DeviceScene * /*dscene*/, Scene * scene, Progress& /*progress*/) { if(!need_update && !need_flags_update) { return; } /* update flags */ foreach(Mesh *mesh, scene->meshes) { mesh->has_volume = false; foreach(const Shader *shader, mesh->used_shaders) { if(shader->has_volume) { mesh->has_volume = true; } if(shader->has_surface_bssrdf) { mesh->has_surface_bssrdf = true; } } } need_flags_update = false; } void MeshManager::device_update_displacement_images(Device *device, Scene *scene, Progress& progress) { progress.set_status("Updating Displacement Images"); TaskPool pool; ImageManager *image_manager = scene->image_manager; set bump_images; foreach(Mesh *mesh, scene->meshes) { if(mesh->need_update) { foreach(Shader *shader, mesh->used_shaders) { if(!shader->has_displacement || shader->displacement_method == DISPLACE_BUMP) { continue; } foreach(ShaderNode* node, shader->graph->nodes) { if(node->special_type != SHADER_SPECIAL_TYPE_IMAGE_SLOT) { continue; } ImageSlotTextureNode *image_node = static_cast(node); int slot = image_node->slot; if(slot != -1) { bump_images.insert(slot); } } } } } foreach(int slot, bump_images) { pool.push(function_bind(&ImageManager::device_update_slot, image_manager, device, scene, slot, &progress)); } pool.wait_work(); } void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { if(!need_update) return; VLOG(1) << "Total " << scene->meshes.size() << " meshes."; /* Update normals. */ foreach(Mesh *mesh, scene->meshes) { foreach(Shader *shader, mesh->used_shaders) { if(shader->need_update_mesh) mesh->need_update = true; } if(mesh->need_update) { mesh->add_face_normals(); mesh->add_vertex_normals(); if(mesh->need_attribute(scene, ATTR_STD_POSITION_UNDISPLACED)) { mesh->add_undisplaced(); } if(progress.get_cancel()) return; } } /* Tessellate meshes that are using subdivision */ size_t total_tess_needed = 0; foreach(Mesh *mesh, scene->meshes) { if(mesh->need_update && mesh->subdivision_type != Mesh::SUBDIVISION_NONE && mesh->num_subd_verts == 0 && mesh->subd_params) { total_tess_needed++; } } size_t i = 0; foreach(Mesh *mesh, scene->meshes) { if(mesh->need_update && mesh->subdivision_type != Mesh::SUBDIVISION_NONE && mesh->num_subd_verts == 0 && mesh->subd_params) { string msg = "Tessellating "; if(mesh->name == "") msg += string_printf("%u/%u", (uint)(i+1), (uint)total_tess_needed); else msg += string_printf("%s %u/%u", mesh->name.c_str(), (uint)(i+1), (uint)total_tess_needed); progress.set_status("Updating Mesh", msg); DiagSplit dsplit(*mesh->subd_params); mesh->tessellate(&dsplit); i++; if(progress.get_cancel()) return; } } /* Update images needed for true displacement. */ bool true_displacement_used = false; bool old_need_object_flags_update = false; foreach(Mesh *mesh, scene->meshes) { if(mesh->need_update && mesh->has_true_displacement()) { true_displacement_used = true; break; } } if(true_displacement_used) { VLOG(1) << "Updating images used for true displacement."; device_update_displacement_images(device, scene, progress); old_need_object_flags_update = scene->object_manager->need_flags_update; scene->object_manager->device_update_flags(device, dscene, scene, progress, false); } /* Device update. */ device_free(device, dscene); mesh_calc_offset(scene); if(true_displacement_used) { device_update_mesh(device, dscene, scene, true, progress); } if(progress.get_cancel()) return; device_update_attributes(device, dscene, scene, progress); if(progress.get_cancel()) return; /* Update displacement. */ bool displacement_done = false; foreach(Mesh *mesh, scene->meshes) { if(mesh->need_update && displace(device, dscene, scene, mesh, progress)) { displacement_done = true; } } /* TODO: properly handle cancel halfway displacement */ if(progress.get_cancel()) return; /* Device re-update after displacement. */ if(displacement_done) { device_free(device, dscene); device_update_attributes(device, dscene, scene, progress); if(progress.get_cancel()) return; } /* Update bvh. */ size_t num_bvh = 0; foreach(Mesh *mesh, scene->meshes) { if(mesh->need_update && mesh->need_build_bvh()) { num_bvh++; } } TaskPool pool; i = 0; foreach(Mesh *mesh, scene->meshes) { if(mesh->need_update) { pool.push(function_bind(&Mesh::compute_bvh, mesh, device, dscene, &scene->params, &progress, i, num_bvh)); if(mesh->need_build_bvh()) { i++; } } } TaskPool::Summary summary; pool.wait_work(&summary); VLOG(2) << "Objects BVH build pool statistics:\n" << summary.full_report(); foreach(Shader *shader, scene->shaders) { shader->need_update_mesh = false; } Scene::MotionType need_motion = scene->need_motion(); bool motion_blur = need_motion == Scene::MOTION_BLUR; /* Update objects. */ vector volume_objects; foreach(Object *object, scene->objects) { object->compute_bounds(motion_blur); } if(progress.get_cancel()) return; device_update_bvh(device, dscene, scene, progress); if(progress.get_cancel()) return; device_update_mesh(device, dscene, scene, false, progress); if(progress.get_cancel()) return; need_update = false; if(true_displacement_used) { /* Re-tag flags for update, so they're re-evaluated * for meshes with correct bounding boxes. * * This wouldn't cause wrong results, just true * displacement might be less optimal ot calculate. */ scene->object_manager->need_flags_update = old_need_object_flags_update; } } void MeshManager::device_free(Device *device, DeviceScene *dscene) { dscene->bvh_nodes.free(); dscene->bvh_leaf_nodes.free(); dscene->object_node.free(); dscene->prim_tri_verts.free(); dscene->prim_tri_index.free(); dscene->prim_type.free(); dscene->prim_visibility.free(); dscene->prim_index.free(); dscene->prim_object.free(); dscene->prim_time.free(); dscene->tri_shader.free(); dscene->tri_vnormal.free(); dscene->tri_vindex.free(); dscene->tri_patch.free(); dscene->tri_patch_uv.free(); dscene->curves.free(); dscene->curve_keys.free(); dscene->patches.free(); dscene->attributes_map.free(); dscene->attributes_float.free(); dscene->attributes_float3.free(); dscene->attributes_uchar4.free(); #ifdef WITH_OSL OSLGlobals *og = (OSLGlobals*)device->osl_memory(); if(og) { og->object_name_map.clear(); og->attribute_map.clear(); og->object_names.clear(); } #else (void)device; #endif } void MeshManager::tag_update(Scene *scene) { need_update = true; scene->object_manager->need_update = true; } bool Mesh::need_attribute(Scene *scene, AttributeStandard std) { if(std == ATTR_STD_NONE) return false; if(scene->need_global_attribute(std)) return true; foreach(Shader *shader, used_shaders) if(shader->attributes.find(std)) return true; return false; } bool Mesh::need_attribute(Scene * /*scene*/, ustring name) { if(name == ustring()) return false; foreach(Shader *shader, used_shaders) if(shader->attributes.find(name)) return true; return false; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/mesh.h000066400000000000000000000250601334742672700207640ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __MESH_H__ #define __MESH_H__ #include "graph/node.h" #include "render/attribute.h" #include "render/shader.h" #include "util/util_boundbox.h" #include "util/util_list.h" #include "util/util_map.h" #include "util/util_param.h" #include "util/util_transform.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Attribute; class BVH; class Device; class DeviceScene; class Mesh; class Progress; class Scene; class SceneParams; class AttributeRequest; struct SubdParams; class DiagSplit; struct PackedPatchTable; /* Mesh */ class Mesh : public Node { public: NODE_DECLARE /* Mesh Triangle */ struct Triangle { int v[3]; void bounds_grow(const float3 *verts, BoundBox& bounds) const; void motion_verts(const float3 *verts, const float3 *vert_steps, size_t num_verts, size_t num_steps, float time, float3 r_verts[3]) const; void verts_for_step(const float3 *verts, const float3 *vert_steps, size_t num_verts, size_t num_steps, size_t step, float3 r_verts[3]) const; float3 compute_normal(const float3 *verts) const; bool valid(const float3 *verts) const; }; Triangle get_triangle(size_t i) const { Triangle tri = {{triangles[i*3 + 0], triangles[i*3 + 1], triangles[i*3 + 2]}}; return tri; } size_t num_triangles() const { return triangles.size() / 3; } /* Mesh Curve */ struct Curve { int first_key; int num_keys; int num_segments() { return num_keys - 1; } void bounds_grow(const int k, const float3 *curve_keys, const float *curve_radius, BoundBox& bounds) const; void bounds_grow(float4 keys[4], BoundBox& bounds) const; void bounds_grow(const int k, const float3 *curve_keys, const float *curve_radius, const Transform& aligned_space, BoundBox& bounds) const; void motion_keys(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, float time, size_t k0, size_t k1, float4 r_keys[2]) const; void cardinal_motion_keys(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, float time, size_t k0, size_t k1, size_t k2, size_t k3, float4 r_keys[4]) const; void keys_for_step(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, size_t step, size_t k0, size_t k1, float4 r_keys[2]) const; void cardinal_keys_for_step(const float3 *curve_keys, const float *curve_radius, const float3 *key_steps, size_t num_curve_keys, size_t num_steps, size_t step, size_t k0, size_t k1, size_t k2, size_t k3, float4 r_keys[4]) const; }; Curve get_curve(size_t i) const { int first = curve_first_key[i]; int next_first = (i+1 < curve_first_key.size()) ? curve_first_key[i+1] : curve_keys.size(); Curve curve = {first, next_first - first}; return curve; } size_t num_curves() const { return curve_first_key.size(); } /* Mesh SubdFace */ struct SubdFace { int start_corner; int num_corners; int shader; bool smooth; int ptex_offset; bool is_quad() { return num_corners == 4; } float3 normal(const Mesh *mesh) const; int num_ptex_faces() const { return num_corners == 4 ? 1 : num_corners; } }; struct SubdEdgeCrease { int v[2]; float crease; }; enum SubdivisionType { SUBDIVISION_NONE, SUBDIVISION_LINEAR, SUBDIVISION_CATMULL_CLARK, }; SubdivisionType subdivision_type; /* Mesh Data */ enum GeometryFlags { GEOMETRY_NONE = 0, GEOMETRY_TRIANGLES = (1 << 0), GEOMETRY_CURVES = (1 << 1), }; int geometry_flags; /* used to distinguish meshes with no verts and meshed for which geometry is not created */ array triangles; array verts; array shader; array smooth; /* used for storing patch info for subd triangles, only allocated if there are patches */ array triangle_patch; /* must be < 0 for non subd triangles */ array vert_patch_uv; bool has_volume; /* Set in the device_update_flags(). */ bool has_surface_bssrdf; /* Set in the device_update_flags(). */ array curve_keys; array curve_radius; array curve_first_key; array curve_shader; array subd_faces; array subd_face_corners; int num_ngons; array subd_creases; SubdParams *subd_params; vector used_shaders; AttributeSet attributes; AttributeSet curve_attributes; AttributeSet subd_attributes; BoundBox bounds; bool transform_applied; bool transform_negative_scaled; Transform transform_normal; PackedPatchTable *patch_table; uint motion_steps; bool use_motion_blur; /* Update Flags */ bool need_update; bool need_update_rebuild; /* BVH */ BVH *bvh; size_t tri_offset; size_t vert_offset; size_t curve_offset; size_t curvekey_offset; size_t patch_offset; size_t patch_table_offset; size_t face_offset; size_t corner_offset; size_t attr_map_offset; size_t num_subd_verts; /* Functions */ Mesh(); ~Mesh(); void resize_mesh(int numverts, int numfaces); void reserve_mesh(int numverts, int numfaces); void resize_curves(int numcurves, int numkeys); void reserve_curves(int numcurves, int numkeys); void resize_subd_faces(int numfaces, int num_ngons, int numcorners); void reserve_subd_faces(int numfaces, int num_ngons, int numcorners); void clear(); void add_vertex(float3 P); void add_vertex_slow(float3 P); void add_triangle(int v0, int v1, int v2, int shader, bool smooth); void add_curve_key(float3 loc, float radius); void add_curve(int first_key, int shader); void add_subd_face(int* corners, int num_corners, int shader_, bool smooth_); int split_vertex(int vertex); void compute_bounds(); void add_face_normals(); void add_vertex_normals(); void add_undisplaced(); void pack_normals(Scene *scene, uint *shader, float4 *vnormal); void pack_verts(const vector& tri_prim_index, uint4 *tri_vindex, uint *tri_patch, float2 *tri_patch_uv, size_t vert_offset, size_t tri_offset); void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset); void pack_patches(uint *patch_data, uint vert_offset, uint face_offset, uint corner_offset); void compute_bvh(Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, int n, int total); bool need_attribute(Scene *scene, AttributeStandard std); bool need_attribute(Scene *scene, ustring name); void tag_update(Scene *scene, bool rebuild); bool has_motion_blur() const; bool has_true_displacement() const; /* Check whether the mesh should have own BVH built separately. Briefly, * own BVH is needed for mesh, if: * * - It is instanced multiple times, so each instance object should share the * same BVH tree. * - Special ray intersection is needed, for example to limit subsurface rays * to only the mesh itself. */ bool need_build_bvh() const; /* Check if the mesh should be treated as instanced. */ bool is_instanced() const; void tessellate(DiagSplit *split); }; /* Mesh Manager */ class MeshManager { public: bool need_update; bool need_flags_update; MeshManager(); ~MeshManager(); bool displace(Device *device, DeviceScene *dscene, Scene *scene, Mesh *mesh, Progress& progress); /* attributes */ void update_osl_attributes(Device *device, Scene *scene, vector& mesh_attributes); void update_svm_attributes(Device *device, DeviceScene *dscene, Scene *scene, vector& mesh_attributes); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_update_flags(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free(Device *device, DeviceScene *dscene); void tag_update(Scene *scene); protected: /* Calculate verts/triangles/curves offsets in global arrays. */ void mesh_calc_offset(Scene *scene); void device_update_object(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_update_mesh(Device *device, DeviceScene *dscene, Scene *scene, bool for_displacement, Progress& progress); void device_update_attributes(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_update_bvh(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_update_displacement_images(Device *device, Scene *scene, Progress& progress); }; CCL_NAMESPACE_END #endif /* __MESH_H__ */ goxel-0.8.1/ext_src/cycles/src/render/mesh_displace.cpp000066400000000000000000000205221334742672700231610ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/mesh.h" #include "render/object.h" #include "render/scene.h" #include "render/shader.h" #include "util/util_foreach.h" #include "util/util_progress.h" CCL_NAMESPACE_BEGIN static float3 compute_face_normal(const Mesh::Triangle& t, float3 *verts) { float3 v0 = verts[t.v[0]]; float3 v1 = verts[t.v[1]]; float3 v2 = verts[t.v[2]]; float3 norm = cross(v1 - v0, v2 - v0); float normlen = len(norm); if(normlen == 0.0f) return make_float3(1.0f, 0.0f, 0.0f); return norm / normlen; } bool MeshManager::displace(Device *device, DeviceScene *dscene, Scene *scene, Mesh *mesh, Progress& progress) { /* verify if we have a displacement shader */ if(!mesh->has_true_displacement()) { return false; } string msg = string_printf("Computing Displacement %s", mesh->name.c_str()); progress.set_status("Updating Mesh", msg); /* find object index. todo: is arbitrary */ size_t object_index = OBJECT_NONE; for(size_t i = 0; i < scene->objects.size(); i++) { if(scene->objects[i]->mesh == mesh) { object_index = i; break; } } /* setup input for device task */ const size_t num_verts = mesh->verts.size(); vector done(num_verts, false); device_vector d_input(device, "displace_input", MEM_READ_ONLY); uint4 *d_input_data = d_input.alloc(num_verts); size_t d_input_size = 0; size_t num_triangles = mesh->num_triangles(); for(size_t i = 0; i < num_triangles; i++) { Mesh::Triangle t = mesh->get_triangle(i); int shader_index = mesh->shader[i]; Shader *shader = (shader_index < mesh->used_shaders.size()) ? mesh->used_shaders[shader_index] : scene->default_surface; if(!shader->has_displacement || shader->displacement_method == DISPLACE_BUMP) { continue; } for(int j = 0; j < 3; j++) { if(done[t.v[j]]) continue; done[t.v[j]] = true; /* set up object, primitive and barycentric coordinates */ int object = object_index; int prim = mesh->tri_offset + i; float u, v; switch(j) { case 0: u = 1.0f; v = 0.0f; break; case 1: u = 0.0f; v = 1.0f; break; default: u = 0.0f; v = 0.0f; break; } /* back */ uint4 in = make_uint4(object, prim, __float_as_int(u), __float_as_int(v)); d_input_data[d_input_size++] = in; } } if(d_input_size == 0) return false; /* run device task */ device_vector d_output(device, "displace_output", MEM_READ_WRITE); d_output.alloc(d_input_size); d_output.zero_to_device(); d_input.copy_to_device(); /* needs to be up to data for attribute access */ device->const_copy_to("__data", &dscene->data, sizeof(dscene->data)); DeviceTask task(DeviceTask::SHADER); task.shader_input = d_input.device_pointer; task.shader_output = d_output.device_pointer; task.shader_eval_type = SHADER_EVAL_DISPLACE; task.shader_x = 0; task.shader_w = d_output.size(); task.num_samples = 1; task.get_cancel = function_bind(&Progress::get_cancel, &progress); device->task_add(task); device->task_wait(); if(progress.get_cancel()) { d_input.free(); d_output.free(); return false; } d_output.copy_from_device(0, 1, d_output.size()); d_input.free(); /* read result */ done.clear(); done.resize(num_verts, false); int k = 0; float4 *offset = d_output.data(); Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); for(size_t i = 0; i < num_triangles; i++) { Mesh::Triangle t = mesh->get_triangle(i); int shader_index = mesh->shader[i]; Shader *shader = (shader_index < mesh->used_shaders.size()) ? mesh->used_shaders[shader_index] : scene->default_surface; if(!shader->has_displacement || shader->displacement_method == DISPLACE_BUMP) { continue; } for(int j = 0; j < 3; j++) { if(!done[t.v[j]]) { done[t.v[j]] = true; float3 off = float4_to_float3(offset[k++]); /* Avoid illegal vertex coordinates. */ off = ensure_finite3(off); mesh->verts[t.v[j]] += off; if(attr_mP != NULL) { for(int step = 0; step < mesh->motion_steps - 1; step++) { float3 *mP = attr_mP->data_float3() + step*num_verts; mP[t.v[j]] += off; } } } } } d_output.free(); /* for displacement method both, we only need to recompute the face * normals, as bump mapping in the shader will already alter the * vertex normal, so we start from the non-displaced vertex normals * to avoid applying the perturbation twice. */ mesh->attributes.remove(ATTR_STD_FACE_NORMAL); mesh->add_face_normals(); bool need_recompute_vertex_normals = false; foreach(Shader *shader, mesh->used_shaders) { if(shader->has_displacement && shader->displacement_method == DISPLACE_TRUE) { need_recompute_vertex_normals = true; break; } } if(need_recompute_vertex_normals) { bool flip = mesh->transform_negative_scaled; vector tri_has_true_disp(num_triangles, false); for(size_t i = 0; i < num_triangles; i++) { int shader_index = mesh->shader[i]; Shader *shader = (shader_index < mesh->used_shaders.size()) ? mesh->used_shaders[shader_index] : scene->default_surface; tri_has_true_disp[i] = shader->has_displacement && shader->displacement_method == DISPLACE_TRUE; } /* static vertex normals */ /* get attributes */ Attribute *attr_fN = mesh->attributes.find(ATTR_STD_FACE_NORMAL); Attribute *attr_vN = mesh->attributes.find(ATTR_STD_VERTEX_NORMAL); float3 *fN = attr_fN->data_float3(); float3 *vN = attr_vN->data_float3(); /* compute vertex normals */ /* zero vertex normals on triangles with true displacement */ for(size_t i = 0; i < num_triangles; i++) { if(tri_has_true_disp[i]) { for(size_t j = 0; j < 3; j++) { vN[mesh->get_triangle(i).v[j]] = make_float3(0.0f, 0.0f, 0.0f); } } } /* add face normals to vertex normals */ for(size_t i = 0; i < num_triangles; i++) { if(tri_has_true_disp[i]) { for(size_t j = 0; j < 3; j++) { vN[mesh->get_triangle(i).v[j]] += fN[i]; } } } /* normalize vertex normals */ done.clear(); done.resize(num_verts, false); for(size_t i = 0; i < num_triangles; i++) { if(tri_has_true_disp[i]) { for(size_t j = 0; j < 3; j++) { int vert = mesh->get_triangle(i).v[j]; if(done[vert]) { continue; } vN[vert] = normalize(vN[vert]); if(flip) vN[vert] = -vN[vert]; done[vert] = true; } } } /* motion vertex normals */ Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); Attribute *attr_mN = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_NORMAL); if(mesh->has_motion_blur() && attr_mP && attr_mN) { for(int step = 0; step < mesh->motion_steps - 1; step++) { float3 *mP = attr_mP->data_float3() + step*mesh->verts.size(); float3 *mN = attr_mN->data_float3() + step*mesh->verts.size(); /* compute */ /* zero vertex normals on triangles with true displacement */ for(size_t i = 0; i < num_triangles; i++) { if(tri_has_true_disp[i]) { for(size_t j = 0; j < 3; j++) { mN[mesh->get_triangle(i).v[j]] = make_float3(0.0f, 0.0f, 0.0f); } } } /* add face normals to vertex normals */ for(size_t i = 0; i < num_triangles; i++) { if(tri_has_true_disp[i]) { for(size_t j = 0; j < 3; j++) { float3 fN = compute_face_normal(mesh->get_triangle(i), mP); mN[mesh->get_triangle(i).v[j]] += fN; } } } /* normalize vertex normals */ done.clear(); done.resize(num_verts, false); for(size_t i = 0; i < num_triangles; i++) { if(tri_has_true_disp[i]) { for(size_t j = 0; j < 3; j++) { int vert = mesh->get_triangle(i).v[j]; if(done[vert]) { continue; } mN[vert] = normalize(mN[vert]); if(flip) mN[vert] = -mN[vert]; done[vert] = true; } } } } } } return true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/mesh_subdivision.cpp000066400000000000000000000411211334742672700237310ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/mesh.h" #include "render/attribute.h" #include "render/camera.h" #include "subd/subd_split.h" #include "subd/subd_patch.h" #include "subd/subd_patch_table.h" #include "util/util_foreach.h" #include "util/util_algorithm.h" CCL_NAMESPACE_BEGIN #ifdef WITH_OPENSUBDIV CCL_NAMESPACE_END #include #include #include #include /* specializations of TopologyRefinerFactory for ccl::Mesh */ namespace OpenSubdiv { namespace OPENSUBDIV_VERSION { namespace Far { template<> bool TopologyRefinerFactory::resizeComponentTopology(TopologyRefiner& refiner, ccl::Mesh const& mesh) { setNumBaseVertices(refiner, mesh.verts.size()); setNumBaseFaces(refiner, mesh.subd_faces.size()); const ccl::Mesh::SubdFace* face = mesh.subd_faces.data(); for(int i = 0; i < mesh.subd_faces.size(); i++, face++) { setNumBaseFaceVertices(refiner, i, face->num_corners); } return true; } template<> bool TopologyRefinerFactory::assignComponentTopology(TopologyRefiner& refiner, ccl::Mesh const& mesh) { const ccl::Mesh::SubdFace* face = mesh.subd_faces.data(); for(int i = 0; i < mesh.subd_faces.size(); i++, face++) { IndexArray face_verts = getBaseFaceVertices(refiner, i); int* corner = &mesh.subd_face_corners[face->start_corner]; for(int j = 0; j < face->num_corners; j++, corner++) { face_verts[j] = *corner; } } return true; } template<> bool TopologyRefinerFactory::assignComponentTags(TopologyRefiner& refiner, ccl::Mesh const& mesh) { const ccl::Mesh::SubdEdgeCrease* crease = mesh.subd_creases.data(); for(int i = 0; i < mesh.subd_creases.size(); i++, crease++) { Index edge = findBaseEdge(refiner, crease->v[0], crease->v[1]); if(edge != INDEX_INVALID) { setBaseEdgeSharpness(refiner, edge, crease->crease * 10.0f); } } for(int i = 0; i < mesh.verts.size(); i++) { ConstIndexArray vert_edges = getBaseVertexEdges(refiner, i); if(vert_edges.size() == 2) { float sharpness = refiner.getLevel(0).getEdgeSharpness(vert_edges[0]); sharpness = ccl::min(sharpness, refiner.getLevel(0).getEdgeSharpness(vert_edges[1])); setBaseVertexSharpness(refiner, i, sharpness); } } return true; } template<> bool TopologyRefinerFactory::assignFaceVaryingTopology(TopologyRefiner& /*refiner*/, ccl::Mesh const& /*mesh*/) { return true; } template<> void TopologyRefinerFactory::reportInvalidTopology(TopologyError /*err_code*/, char const * /*msg*/, ccl::Mesh const& /*mesh*/) { } } /* namespace Far */ } /* namespace OPENSUBDIV_VERSION */ } /* namespace OpenSubdiv */ CCL_NAMESPACE_BEGIN using namespace OpenSubdiv; /* struct that implements OpenSubdiv's vertex interface */ template struct OsdValue { T value; OsdValue() {} void Clear(void* = 0) { memset(&value, 0, sizeof(T)); } void AddWithWeight(OsdValue const& src, float weight) { value += src.value * weight; } }; template<> void OsdValue::AddWithWeight(OsdValue const& src, float weight) { for(int i = 0; i < 4; i++) { value[i] += (uchar)(src.value[i] * weight); } } /* class for holding OpenSubdiv data used during tessellation */ class OsdData { Mesh* mesh; vector > verts; Far::TopologyRefiner* refiner; Far::PatchTable* patch_table; Far::PatchMap* patch_map; public: OsdData() : mesh(NULL), refiner(NULL), patch_table(NULL), patch_map(NULL) {} ~OsdData() { delete refiner; delete patch_table; delete patch_map; } void build_from_mesh(Mesh* mesh_) { mesh = mesh_; /* type and options */ Sdc::SchemeType type = Sdc::SCHEME_CATMARK; Sdc::Options options; options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY); /* create refiner */ refiner = Far::TopologyRefinerFactory::Create(*mesh, Far::TopologyRefinerFactory::Options(type, options)); /* adaptive refinement */ int max_isolation = calculate_max_isolation(); refiner->RefineAdaptive(Far::TopologyRefiner::AdaptiveOptions(max_isolation)); /* create patch table */ Far::PatchTableFactory::Options patch_options; patch_options.endCapType = Far::PatchTableFactory::Options::ENDCAP_GREGORY_BASIS; patch_table = Far::PatchTableFactory::Create(*refiner, patch_options); /* interpolate verts */ int num_refiner_verts = refiner->GetNumVerticesTotal(); int num_local_points = patch_table->GetNumLocalPoints(); verts.resize(num_refiner_verts + num_local_points); for(int i = 0; i < mesh->verts.size(); i++) { verts[i].value = mesh->verts[i]; } OsdValue* src = verts.data(); for(int i = 0; i < refiner->GetMaxLevel(); i++) { OsdValue* dest = src + refiner->GetLevel(i).GetNumVertices(); Far::PrimvarRefiner(*refiner).Interpolate(i+1, src, dest); src = dest; } patch_table->ComputeLocalPointValues(&verts[0], &verts[num_refiner_verts]); /* create patch map */ patch_map = new Far::PatchMap(*patch_table); } void subdivide_attribute(Attribute& attr) { Far::PrimvarRefiner primvar_refiner(*refiner); if(attr.element == ATTR_ELEMENT_VERTEX) { int num_refiner_verts = refiner->GetNumVerticesTotal(); int num_local_points = patch_table->GetNumLocalPoints(); attr.resize(num_refiner_verts + num_local_points); attr.flags |= ATTR_FINAL_SIZE; char* src = attr.buffer.data(); for(int i = 0; i < refiner->GetMaxLevel(); i++) { char* dest = src + refiner->GetLevel(i).GetNumVertices() * attr.data_sizeof(); if(attr.same_storage(attr.type, TypeDesc::TypeFloat)) { primvar_refiner.Interpolate(i+1, (OsdValue*)src, (OsdValue*&)dest); } else { primvar_refiner.Interpolate(i+1, (OsdValue*)src, (OsdValue*&)dest); } src = dest; } if(attr.same_storage(attr.type, TypeDesc::TypeFloat)) { patch_table->ComputeLocalPointValues((OsdValue*)&attr.buffer[0], (OsdValue*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]); } else { patch_table->ComputeLocalPointValues((OsdValue*)&attr.buffer[0], (OsdValue*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]); } } else if(attr.element == ATTR_ELEMENT_CORNER || attr.element == ATTR_ELEMENT_CORNER_BYTE) { // TODO(mai): fvar interpolation } } int calculate_max_isolation() { /* loop over all edges to find longest in screen space */ const Far::TopologyLevel& level = refiner->GetLevel(0); Transform objecttoworld = mesh->subd_params->objecttoworld; Camera* cam = mesh->subd_params->camera; float longest_edge = 0.0f; for(size_t i = 0; i < level.GetNumEdges(); i++) { Far::ConstIndexArray verts = level.GetEdgeVertices(i); float3 a = mesh->verts[verts[0]]; float3 b = mesh->verts[verts[1]]; float edge_len; if(cam) { a = transform_point(&objecttoworld, a); b = transform_point(&objecttoworld, b); edge_len = len(a - b) / cam->world_to_raster_size((a + b) * 0.5f); } else { edge_len = len(a - b); } longest_edge = max(longest_edge, edge_len); } /* calculate isolation level */ int isolation = (int)(log2f(max(longest_edge / mesh->subd_params->dicing_rate, 1.0f)) + 1.0f); return min(isolation, 10); } friend struct OsdPatch; friend class Mesh; }; /* ccl::Patch implementation that uses OpenSubdiv for eval */ struct OsdPatch : Patch { OsdData* osd_data; OsdPatch(OsdData* data) : osd_data(data) {} void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v) { const Far::PatchTable::PatchHandle* handle = osd_data->patch_map->FindPatch(patch_index, u, v); assert(handle); float p_weights[20], du_weights[20], dv_weights[20]; osd_data->patch_table->EvaluateBasis(*handle, u, v, p_weights, du_weights, dv_weights); Far::ConstIndexArray cv = osd_data->patch_table->GetPatchVertices(*handle); float3 du, dv; if(P) *P = make_float3(0.0f, 0.0f, 0.0f); du = make_float3(0.0f, 0.0f, 0.0f); dv = make_float3(0.0f, 0.0f, 0.0f); for(int i = 0; i < cv.size(); i++) { float3 p = osd_data->verts[cv[i]].value; if(P) *P += p * p_weights[i]; du += p * du_weights[i]; dv += p * dv_weights[i]; } if(dPdu) *dPdu = du; if(dPdv) *dPdv = dv; if(N) { *N = cross(du, dv); float t = len(*N); *N = (t != 0.0f) ? *N/t : make_float3(0.0f, 0.0f, 1.0f); } } BoundBox bound() { return BoundBox::empty; } }; #endif void Mesh::tessellate(DiagSplit *split) { #ifdef WITH_OPENSUBDIV OsdData osd_data; bool need_packed_patch_table = false; if(subdivision_type == SUBDIVISION_CATMULL_CLARK) { if(subd_faces.size()) { osd_data.build_from_mesh(this); } } else #endif { /* force linear subdivision if OpenSubdiv is unavailable to avoid * falling into catmull-clark code paths by accident */ subdivision_type = SUBDIVISION_LINEAR; /* force disable attribute subdivision for same reason as above */ foreach(Attribute& attr, subd_attributes.attributes) { attr.flags &= ~ATTR_SUBDIVIDED; } } int num_faces = subd_faces.size(); Attribute *attr_vN = subd_attributes.find(ATTR_STD_VERTEX_NORMAL); float3* vN = attr_vN->data_float3(); for(int f = 0; f < num_faces; f++) { SubdFace& face = subd_faces[f]; if(face.is_quad()) { /* quad */ QuadDice::SubPatch subpatch; LinearQuadPatch quad_patch; #ifdef WITH_OPENSUBDIV OsdPatch osd_patch(&osd_data); if(subdivision_type == SUBDIVISION_CATMULL_CLARK) { osd_patch.patch_index = face.ptex_offset; subpatch.patch = &osd_patch; } else #endif { float3 *hull = quad_patch.hull; float3 *normals = quad_patch.normals; quad_patch.patch_index = face.ptex_offset; for(int i = 0; i < 4; i++) { hull[i] = verts[subd_face_corners[face.start_corner+i]]; } if(face.smooth) { for(int i = 0; i < 4; i++) { normals[i] = vN[subd_face_corners[face.start_corner+i]]; } } else { float3 N = face.normal(this); for(int i = 0; i < 4; i++) { normals[i] = N; } } swap(hull[2], hull[3]); swap(normals[2], normals[3]); subpatch.patch = &quad_patch; } subpatch.patch->shader = face.shader; /* Quad faces need to be split at least once to line up with split ngons, we do this * here in this manner because if we do it later edge factors may end up slightly off. */ subpatch.P00 = make_float2(0.0f, 0.0f); subpatch.P10 = make_float2(0.5f, 0.0f); subpatch.P01 = make_float2(0.0f, 0.5f); subpatch.P11 = make_float2(0.5f, 0.5f); split->split_quad(subpatch.patch, &subpatch); subpatch.P00 = make_float2(0.5f, 0.0f); subpatch.P10 = make_float2(1.0f, 0.0f); subpatch.P01 = make_float2(0.5f, 0.5f); subpatch.P11 = make_float2(1.0f, 0.5f); split->split_quad(subpatch.patch, &subpatch); subpatch.P00 = make_float2(0.0f, 0.5f); subpatch.P10 = make_float2(0.5f, 0.5f); subpatch.P01 = make_float2(0.0f, 1.0f); subpatch.P11 = make_float2(0.5f, 1.0f); split->split_quad(subpatch.patch, &subpatch); subpatch.P00 = make_float2(0.5f, 0.5f); subpatch.P10 = make_float2(1.0f, 0.5f); subpatch.P01 = make_float2(0.5f, 1.0f); subpatch.P11 = make_float2(1.0f, 1.0f); split->split_quad(subpatch.patch, &subpatch); } else { /* ngon */ #ifdef WITH_OPENSUBDIV if(subdivision_type == SUBDIVISION_CATMULL_CLARK) { OsdPatch patch(&osd_data); patch.shader = face.shader; for(int corner = 0; corner < face.num_corners; corner++) { patch.patch_index = face.ptex_offset + corner; split->split_quad(&patch); } } else #endif { float3 center_vert = make_float3(0.0f, 0.0f, 0.0f); float3 center_normal = make_float3(0.0f, 0.0f, 0.0f); float inv_num_corners = 1.0f/float(face.num_corners); for(int corner = 0; corner < face.num_corners; corner++) { center_vert += verts[subd_face_corners[face.start_corner + corner]] * inv_num_corners; center_normal += vN[subd_face_corners[face.start_corner + corner]] * inv_num_corners; } for(int corner = 0; corner < face.num_corners; corner++) { LinearQuadPatch patch; float3 *hull = patch.hull; float3 *normals = patch.normals; patch.patch_index = face.ptex_offset + corner; patch.shader = face.shader; hull[0] = verts[subd_face_corners[face.start_corner + mod(corner + 0, face.num_corners)]]; hull[1] = verts[subd_face_corners[face.start_corner + mod(corner + 1, face.num_corners)]]; hull[2] = verts[subd_face_corners[face.start_corner + mod(corner - 1, face.num_corners)]]; hull[3] = center_vert; hull[1] = (hull[1] + hull[0]) * 0.5; hull[2] = (hull[2] + hull[0]) * 0.5; if(face.smooth) { normals[0] = vN[subd_face_corners[face.start_corner + mod(corner + 0, face.num_corners)]]; normals[1] = vN[subd_face_corners[face.start_corner + mod(corner + 1, face.num_corners)]]; normals[2] = vN[subd_face_corners[face.start_corner + mod(corner - 1, face.num_corners)]]; normals[3] = center_normal; normals[1] = (normals[1] + normals[0]) * 0.5; normals[2] = (normals[2] + normals[0]) * 0.5; } else { float3 N = face.normal(this); for(int i = 0; i < 4; i++) { normals[i] = N; } } split->split_quad(&patch); } } } } /* interpolate center points for attributes */ foreach(Attribute& attr, subd_attributes.attributes) { #ifdef WITH_OPENSUBDIV if(subdivision_type == SUBDIVISION_CATMULL_CLARK && attr.flags & ATTR_SUBDIVIDED) { if(attr.element == ATTR_ELEMENT_CORNER || attr.element == ATTR_ELEMENT_CORNER_BYTE) { /* keep subdivision for corner attributes disabled for now */ attr.flags &= ~ATTR_SUBDIVIDED; } else if(subd_faces.size()) { osd_data.subdivide_attribute(attr); need_packed_patch_table = true; continue; } } #endif char* data = attr.data(); size_t stride = attr.data_sizeof(); int ngons = 0; switch(attr.element) { case ATTR_ELEMENT_VERTEX: { for(int f = 0; f < num_faces; f++) { SubdFace& face = subd_faces[f]; if(!face.is_quad()) { char* center = data + (verts.size() - num_subd_verts + ngons) * stride; attr.zero_data(center); float inv_num_corners = 1.0f / float(face.num_corners); for(int corner = 0; corner < face.num_corners; corner++) { attr.add_with_weight(center, data + subd_face_corners[face.start_corner + corner] * stride, inv_num_corners); } ngons++; } } } break; case ATTR_ELEMENT_VERTEX_MOTION: { // TODO(mai): implement } break; case ATTR_ELEMENT_CORNER: { for(int f = 0; f < num_faces; f++) { SubdFace& face = subd_faces[f]; if(!face.is_quad()) { char* center = data + (subd_face_corners.size() + ngons) * stride; attr.zero_data(center); float inv_num_corners = 1.0f / float(face.num_corners); for(int corner = 0; corner < face.num_corners; corner++) { attr.add_with_weight(center, data + (face.start_corner + corner) * stride, inv_num_corners); } ngons++; } } } break; case ATTR_ELEMENT_CORNER_BYTE: { for(int f = 0; f < num_faces; f++) { SubdFace& face = subd_faces[f]; if(!face.is_quad()) { uchar* center = (uchar*)data + (subd_face_corners.size() + ngons) * stride; float inv_num_corners = 1.0f / float(face.num_corners); float4 val = make_float4(0.0f, 0.0f, 0.0f, 0.0f); for(int corner = 0; corner < face.num_corners; corner++) { for(int i = 0; i < 4; i++) { val[i] += float(*(data + (face.start_corner + corner) * stride + i)) * inv_num_corners; } } for(int i = 0; i < 4; i++) { center[i] = uchar(min(max(val[i], 0.0f), 255.0f)); } ngons++; } } } break; default: break; } } #ifdef WITH_OPENSUBDIV /* pack patch tables */ if(need_packed_patch_table) { delete patch_table; patch_table = new PackedPatchTable; patch_table->pack(osd_data.patch_table); } #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/nodes.cpp000066400000000000000000005101761334742672700215020ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/image.h" #include "render/integrator.h" #include "render/nodes.h" #include "render/scene.h" #include "render/svm.h" #include "kernel/svm/svm_color_util.h" #include "kernel/svm/svm_ramp_util.h" #include "kernel/svm/svm_math_util.h" #include "render/osl.h" #include "render/constant_fold.h" #include "util/util_sky_model.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_transform.h" CCL_NAMESPACE_BEGIN /* Texture Mapping */ #define TEXTURE_MAPPING_DEFINE(TextureNode) \ SOCKET_POINT(tex_mapping.translation, "Translation", make_float3(0.0f, 0.0f, 0.0f)); \ SOCKET_VECTOR(tex_mapping.rotation, "Rotation", make_float3(0.0f, 0.0f, 0.0f)); \ SOCKET_VECTOR(tex_mapping.scale, "Scale", make_float3(1.0f, 1.0f, 1.0f)); \ \ SOCKET_VECTOR(tex_mapping.min, "Min", make_float3(-FLT_MAX, -FLT_MAX, -FLT_MAX)); \ SOCKET_VECTOR(tex_mapping.max, "Max", make_float3(FLT_MAX, FLT_MAX, FLT_MAX)); \ SOCKET_BOOLEAN(tex_mapping.use_minmax, "Use Min Max", false); \ \ static NodeEnum mapping_axis_enum; \ mapping_axis_enum.insert("none", TextureMapping::NONE); \ mapping_axis_enum.insert("x", TextureMapping::X); \ mapping_axis_enum.insert("y", TextureMapping::Y); \ mapping_axis_enum.insert("z", TextureMapping::Z); \ SOCKET_ENUM(tex_mapping.x_mapping, "x_mapping", mapping_axis_enum, TextureMapping::X); \ SOCKET_ENUM(tex_mapping.y_mapping, "y_mapping", mapping_axis_enum, TextureMapping::Y); \ SOCKET_ENUM(tex_mapping.z_mapping, "z_mapping", mapping_axis_enum, TextureMapping::Z); \ \ static NodeEnum mapping_type_enum; \ mapping_type_enum.insert("point", TextureMapping::POINT); \ mapping_type_enum.insert("texture", TextureMapping::TEXTURE); \ mapping_type_enum.insert("vector", TextureMapping::VECTOR); \ mapping_type_enum.insert("normal", TextureMapping::NORMAL); \ SOCKET_ENUM(tex_mapping.type, "Type", mapping_type_enum, TextureMapping::TEXTURE); \ \ static NodeEnum mapping_projection_enum; \ mapping_projection_enum.insert("flat", TextureMapping::FLAT); \ mapping_projection_enum.insert("cube", TextureMapping::CUBE); \ mapping_projection_enum.insert("tube", TextureMapping::TUBE); \ mapping_projection_enum.insert("sphere", TextureMapping::SPHERE); \ SOCKET_ENUM(tex_mapping.projection, "Projection", mapping_projection_enum, TextureMapping::FLAT); TextureMapping::TextureMapping() { } Transform TextureMapping::compute_transform() { Transform mmat = transform_scale(make_float3(0.0f, 0.0f, 0.0f)); if(x_mapping != NONE) mmat[0][x_mapping-1] = 1.0f; if(y_mapping != NONE) mmat[1][y_mapping-1] = 1.0f; if(z_mapping != NONE) mmat[2][z_mapping-1] = 1.0f; float3 scale_clamped = scale; if(type == TEXTURE || type == NORMAL) { /* keep matrix invertible */ if(fabsf(scale.x) < 1e-5f) scale_clamped.x = signf(scale.x)*1e-5f; if(fabsf(scale.y) < 1e-5f) scale_clamped.y = signf(scale.y)*1e-5f; if(fabsf(scale.z) < 1e-5f) scale_clamped.z = signf(scale.z)*1e-5f; } Transform smat = transform_scale(scale_clamped); Transform rmat = transform_euler(rotation); Transform tmat = transform_translate(translation); Transform mat; switch(type) { case TEXTURE: /* inverse transform on texture coordinate gives * forward transform on texture */ mat = tmat*rmat*smat; mat = transform_inverse(mat); break; case POINT: /* full transform */ mat = tmat*rmat*smat; break; case VECTOR: /* no translation for vectors */ mat = rmat*smat; break; case NORMAL: /* no translation for normals, and inverse transpose */ mat = rmat*smat; mat = transform_inverse(mat); mat = transform_transpose(mat); break; } /* projection last */ mat = mat*mmat; return mat; } bool TextureMapping::skip() { if(translation != make_float3(0.0f, 0.0f, 0.0f)) return false; if(rotation != make_float3(0.0f, 0.0f, 0.0f)) return false; if(scale != make_float3(1.0f, 1.0f, 1.0f)) return false; if(x_mapping != X || y_mapping != Y || z_mapping != Z) return false; if(use_minmax) return false; return true; } void TextureMapping::compile(SVMCompiler& compiler, int offset_in, int offset_out) { compiler.add_node(NODE_MAPPING, offset_in, offset_out); Transform tfm = compute_transform(); compiler.add_node(tfm.x); compiler.add_node(tfm.y); compiler.add_node(tfm.z); compiler.add_node(tfm.w); if(use_minmax) { compiler.add_node(NODE_MIN_MAX, offset_out, offset_out); compiler.add_node(float3_to_float4(min)); compiler.add_node(float3_to_float4(max)); } if(type == NORMAL) { compiler.add_node(NODE_VECTOR_MATH, NODE_VECTOR_MATH_NORMALIZE, offset_out, offset_out); compiler.add_node(NODE_VECTOR_MATH, SVM_STACK_INVALID, offset_out); } } /* Convenience function for texture nodes, allocating stack space to output * a modified vector and returning its offset */ int TextureMapping::compile_begin(SVMCompiler& compiler, ShaderInput *vector_in) { if(!skip()) { int offset_in = compiler.stack_assign(vector_in); int offset_out = compiler.stack_find_offset(SocketType::VECTOR); compile(compiler, offset_in, offset_out); return offset_out; } return compiler.stack_assign(vector_in); } void TextureMapping::compile_end(SVMCompiler& compiler, ShaderInput *vector_in, int vector_offset) { if(!skip()) { compiler.stack_clear_offset(vector_in->type(), vector_offset); } } void TextureMapping::compile(OSLCompiler &compiler) { if(!skip()) { Transform tfm = transform_transpose(compute_transform()); compiler.parameter("mapping", tfm); compiler.parameter("use_mapping", 1); } } /* Image Texture */ NODE_DEFINE(ImageTextureNode) { NodeType* type = NodeType::add("image_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(ImageTextureNode); SOCKET_STRING(filename, "Filename", ustring()); static NodeEnum color_space_enum; color_space_enum.insert("none", NODE_COLOR_SPACE_NONE); color_space_enum.insert("color", NODE_COLOR_SPACE_COLOR); SOCKET_ENUM(color_space, "Color Space", color_space_enum, NODE_COLOR_SPACE_COLOR); SOCKET_BOOLEAN(use_alpha, "Use Alpha", true); static NodeEnum interpolation_enum; interpolation_enum.insert("closest", INTERPOLATION_CLOSEST); interpolation_enum.insert("linear", INTERPOLATION_LINEAR); interpolation_enum.insert("cubic", INTERPOLATION_CUBIC); interpolation_enum.insert("smart", INTERPOLATION_SMART); SOCKET_ENUM(interpolation, "Interpolation", interpolation_enum, INTERPOLATION_LINEAR); static NodeEnum extension_enum; extension_enum.insert("periodic", EXTENSION_REPEAT); extension_enum.insert("clamp", EXTENSION_EXTEND); extension_enum.insert("black", EXTENSION_CLIP); SOCKET_ENUM(extension, "Extension", extension_enum, EXTENSION_REPEAT); static NodeEnum projection_enum; projection_enum.insert("flat", NODE_IMAGE_PROJ_FLAT); projection_enum.insert("box", NODE_IMAGE_PROJ_BOX); projection_enum.insert("sphere", NODE_IMAGE_PROJ_SPHERE); projection_enum.insert("tube", NODE_IMAGE_PROJ_TUBE); SOCKET_ENUM(projection, "Projection", projection_enum, NODE_IMAGE_PROJ_FLAT); SOCKET_FLOAT(projection_blend, "Projection Blend", 0.0f); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_UV); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(alpha, "Alpha"); return type; } ImageTextureNode::ImageTextureNode() : ImageSlotTextureNode(node_type) { image_manager = NULL; slot = -1; is_float = -1; is_linear = false; builtin_data = NULL; animated = false; } ImageTextureNode::~ImageTextureNode() { if(image_manager) { image_manager->remove_image(filename.string(), builtin_data, interpolation, extension, use_alpha); } } ShaderNode *ImageTextureNode::clone() const { ImageTextureNode *node = new ImageTextureNode(*this); node->image_manager = NULL; node->slot = -1; node->is_float = -1; node->is_linear = false; return node; } void ImageTextureNode::attributes(Shader *shader, AttributeRequestSet *attributes) { #ifdef WITH_PTEX /* todo: avoid loading other texture coordinates when using ptex, * and hide texture coordinate socket in the UI */ if(shader->has_surface && string_endswith(filename, ".ptx")) { /* ptex */ attributes->add(ATTR_STD_PTEX_FACE_ID); attributes->add(ATTR_STD_PTEX_UV); } #endif ShaderNode::attributes(shader, attributes); } void ImageTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *color_out = output("Color"); ShaderOutput *alpha_out = output("Alpha"); image_manager = compiler.image_manager; if(is_float == -1) { ImageMetaData metadata; slot = image_manager->add_image(filename.string(), builtin_data, animated, 0, interpolation, extension, use_alpha, metadata); is_float = metadata.is_float; is_linear = metadata.is_linear; } if(slot != -1) { int srgb = (is_linear || color_space != NODE_COLOR_SPACE_COLOR)? 0: 1; int vector_offset = tex_mapping.compile_begin(compiler, vector_in); if(projection != NODE_IMAGE_PROJ_BOX) { compiler.add_node(NODE_TEX_IMAGE, slot, compiler.encode_uchar4( vector_offset, compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(alpha_out), srgb), projection); } else { compiler.add_node(NODE_TEX_IMAGE_BOX, slot, compiler.encode_uchar4( vector_offset, compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(alpha_out), srgb), __float_as_int(projection_blend)); } tex_mapping.compile_end(compiler, vector_in, vector_offset); } else { /* image not found */ if(!color_out->links.empty()) { compiler.add_node(NODE_VALUE_V, compiler.stack_assign(color_out)); compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R, TEX_IMAGE_MISSING_G, TEX_IMAGE_MISSING_B)); } if(!alpha_out->links.empty()) compiler.add_node(NODE_VALUE_F, __float_as_int(TEX_IMAGE_MISSING_A), compiler.stack_assign(alpha_out)); } } void ImageTextureNode::compile(OSLCompiler& compiler) { ShaderOutput *alpha_out = output("Alpha"); tex_mapping.compile(compiler); image_manager = compiler.image_manager; if(is_float == -1) { ImageMetaData metadata; if(builtin_data == NULL) { image_manager->get_image_metadata(filename.string(), NULL, metadata); } else { slot = image_manager->add_image(filename.string(), builtin_data, animated, 0, interpolation, extension, use_alpha, metadata); } is_float = metadata.is_float; is_linear = metadata.is_linear; } if(slot == -1) { compiler.parameter(this, "filename"); } else { /* TODO(sergey): It's not so simple to pass custom attribute * to the texture() function in order to make builtin images * support more clear. So we use special file name which is * "@" and check whether file name matches this * mask in the OSLRenderServices::texture(). */ compiler.parameter("filename", string_printf("@%d", slot).c_str()); } if(is_linear || color_space != NODE_COLOR_SPACE_COLOR) compiler.parameter("color_space", "linear"); else compiler.parameter("color_space", "sRGB"); compiler.parameter(this, "projection"); compiler.parameter(this, "projection_blend"); compiler.parameter("is_float", is_float); compiler.parameter("use_alpha", !alpha_out->links.empty()); compiler.parameter(this, "interpolation"); compiler.parameter(this, "extension"); compiler.add(this, "node_image_texture"); } /* Environment Texture */ NODE_DEFINE(EnvironmentTextureNode) { NodeType* type = NodeType::add("environment_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(EnvironmentTextureNode); SOCKET_STRING(filename, "Filename", ustring()); static NodeEnum color_space_enum; color_space_enum.insert("none", NODE_COLOR_SPACE_NONE); color_space_enum.insert("color", NODE_COLOR_SPACE_COLOR); SOCKET_ENUM(color_space, "Color Space", color_space_enum, NODE_COLOR_SPACE_COLOR); SOCKET_BOOLEAN(use_alpha, "Use Alpha", true); static NodeEnum interpolation_enum; interpolation_enum.insert("closest", INTERPOLATION_CLOSEST); interpolation_enum.insert("linear", INTERPOLATION_LINEAR); interpolation_enum.insert("cubic", INTERPOLATION_CUBIC); interpolation_enum.insert("smart", INTERPOLATION_SMART); SOCKET_ENUM(interpolation, "Interpolation", interpolation_enum, INTERPOLATION_LINEAR); static NodeEnum projection_enum; projection_enum.insert("equirectangular", NODE_ENVIRONMENT_EQUIRECTANGULAR); projection_enum.insert("mirror_ball", NODE_ENVIRONMENT_MIRROR_BALL); SOCKET_ENUM(projection, "Projection", projection_enum, NODE_ENVIRONMENT_EQUIRECTANGULAR); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_POSITION); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(alpha, "Alpha"); return type; } EnvironmentTextureNode::EnvironmentTextureNode() : ImageSlotTextureNode(node_type) { image_manager = NULL; slot = -1; is_float = -1; is_linear = false; builtin_data = NULL; animated = false; } EnvironmentTextureNode::~EnvironmentTextureNode() { if(image_manager) { image_manager->remove_image(filename.string(), builtin_data, interpolation, EXTENSION_REPEAT, use_alpha); } } ShaderNode *EnvironmentTextureNode::clone() const { EnvironmentTextureNode *node = new EnvironmentTextureNode(*this); node->image_manager = NULL; node->slot = -1; node->is_float = -1; node->is_linear = false; return node; } void EnvironmentTextureNode::attributes(Shader *shader, AttributeRequestSet *attributes) { #ifdef WITH_PTEX if(shader->has_surface && string_endswith(filename, ".ptx")) { /* ptex */ attributes->add(ATTR_STD_PTEX_FACE_ID); attributes->add(ATTR_STD_PTEX_UV); } #endif ShaderNode::attributes(shader, attributes); } void EnvironmentTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *color_out = output("Color"); ShaderOutput *alpha_out = output("Alpha"); image_manager = compiler.image_manager; if(slot == -1) { ImageMetaData metadata; slot = image_manager->add_image(filename.string(), builtin_data, animated, 0, interpolation, EXTENSION_REPEAT, use_alpha, metadata); is_float = metadata.is_float; is_linear = metadata.is_linear; } if(slot != -1) { int srgb = (is_linear || color_space != NODE_COLOR_SPACE_COLOR)? 0: 1; int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_ENVIRONMENT, slot, compiler.encode_uchar4( vector_offset, compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(alpha_out), srgb), projection); tex_mapping.compile_end(compiler, vector_in, vector_offset); } else { /* image not found */ if(!color_out->links.empty()) { compiler.add_node(NODE_VALUE_V, compiler.stack_assign(color_out)); compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R, TEX_IMAGE_MISSING_G, TEX_IMAGE_MISSING_B)); } if(!alpha_out->links.empty()) compiler.add_node(NODE_VALUE_F, __float_as_int(TEX_IMAGE_MISSING_A), compiler.stack_assign(alpha_out)); } } void EnvironmentTextureNode::compile(OSLCompiler& compiler) { ShaderOutput *alpha_out = output("Alpha"); tex_mapping.compile(compiler); /* See comments in ImageTextureNode::compile about support * of builtin images. */ image_manager = compiler.image_manager; if(is_float == -1) { ImageMetaData metadata; if(builtin_data == NULL) { image_manager->get_image_metadata(filename.string(), NULL, metadata); } else { slot = image_manager->add_image(filename.string(), builtin_data, animated, 0, interpolation, EXTENSION_REPEAT, use_alpha, metadata); } is_float = metadata.is_float; is_linear = metadata.is_linear; } if(slot == -1) { compiler.parameter(this, "filename"); } else { compiler.parameter("filename", string_printf("@%d", slot).c_str()); } compiler.parameter(this, "projection"); if(is_linear || color_space != NODE_COLOR_SPACE_COLOR) compiler.parameter("color_space", "linear"); else compiler.parameter("color_space", "sRGB"); compiler.parameter(this, "interpolation"); compiler.parameter("is_float", is_float); compiler.parameter("use_alpha", !alpha_out->links.empty()); compiler.add(this, "node_environment_texture"); } /* Sky Texture */ static float2 sky_spherical_coordinates(float3 dir) { return make_float2(acosf(dir.z), atan2f(dir.x, dir.y)); } typedef struct SunSky { /* sun direction in spherical and cartesian */ float theta, phi; /* Parameter */ float radiance_x, radiance_y, radiance_z; float config_x[9], config_y[9], config_z[9]; } SunSky; /* Preetham model */ static float sky_perez_function(float lam[6], float theta, float gamma) { return (1.0f + lam[0]*expf(lam[1]/cosf(theta))) * (1.0f + lam[2]*expf(lam[3]*gamma) + lam[4]*cosf(gamma)*cosf(gamma)); } static void sky_texture_precompute_old(SunSky *sunsky, float3 dir, float turbidity) { /* * We re-use the SunSky struct of the new model, to avoid extra variables * zenith_Y/x/y is now radiance_x/y/z * perez_Y/x/y is now config_x/y/z */ float2 spherical = sky_spherical_coordinates(dir); float theta = spherical.x; float phi = spherical.y; sunsky->theta = theta; sunsky->phi = phi; float theta2 = theta*theta; float theta3 = theta2*theta; float T = turbidity; float T2 = T * T; float chi = (4.0f / 9.0f - T / 120.0f) * (M_PI_F - 2.0f * theta); sunsky->radiance_x = (4.0453f * T - 4.9710f) * tanf(chi) - 0.2155f * T + 2.4192f; sunsky->radiance_x *= 0.06f; sunsky->radiance_y = (0.00166f * theta3 - 0.00375f * theta2 + 0.00209f * theta) * T2 + (-0.02903f * theta3 + 0.06377f * theta2 - 0.03202f * theta + 0.00394f) * T + (0.11693f * theta3 - 0.21196f * theta2 + 0.06052f * theta + 0.25886f); sunsky->radiance_z = (0.00275f * theta3 - 0.00610f * theta2 + 0.00317f * theta) * T2 + (-0.04214f * theta3 + 0.08970f * theta2 - 0.04153f * theta + 0.00516f) * T + (0.15346f * theta3 - 0.26756f * theta2 + 0.06670f * theta + 0.26688f); sunsky->config_x[0] = (0.1787f * T - 1.4630f); sunsky->config_x[1] = (-0.3554f * T + 0.4275f); sunsky->config_x[2] = (-0.0227f * T + 5.3251f); sunsky->config_x[3] = (0.1206f * T - 2.5771f); sunsky->config_x[4] = (-0.0670f * T + 0.3703f); sunsky->config_y[0] = (-0.0193f * T - 0.2592f); sunsky->config_y[1] = (-0.0665f * T + 0.0008f); sunsky->config_y[2] = (-0.0004f * T + 0.2125f); sunsky->config_y[3] = (-0.0641f * T - 0.8989f); sunsky->config_y[4] = (-0.0033f * T + 0.0452f); sunsky->config_z[0] = (-0.0167f * T - 0.2608f); sunsky->config_z[1] = (-0.0950f * T + 0.0092f); sunsky->config_z[2] = (-0.0079f * T + 0.2102f); sunsky->config_z[3] = (-0.0441f * T - 1.6537f); sunsky->config_z[4] = (-0.0109f * T + 0.0529f); /* unused for old sky model */ for(int i = 5; i < 9; i++) { sunsky->config_x[i] = 0.0f; sunsky->config_y[i] = 0.0f; sunsky->config_z[i] = 0.0f; } sunsky->radiance_x /= sky_perez_function(sunsky->config_x, 0, theta); sunsky->radiance_y /= sky_perez_function(sunsky->config_y, 0, theta); sunsky->radiance_z /= sky_perez_function(sunsky->config_z, 0, theta); } /* Hosek / Wilkie */ static void sky_texture_precompute_new(SunSky *sunsky, float3 dir, float turbidity, float ground_albedo) { /* Calculate Sun Direction and save coordinates */ float2 spherical = sky_spherical_coordinates(dir); float theta = spherical.x; float phi = spherical.y; /* Clamp Turbidity */ turbidity = clamp(turbidity, 0.0f, 10.0f); /* Clamp to Horizon */ theta = clamp(theta, 0.0f, M_PI_2_F); sunsky->theta = theta; sunsky->phi = phi; float solarElevation = M_PI_2_F - theta; /* Initialize Sky Model */ ArHosekSkyModelState *sky_state; sky_state = arhosek_xyz_skymodelstate_alloc_init((double)turbidity, (double)ground_albedo, (double)solarElevation); /* Copy values from sky_state to SunSky */ for(int i = 0; i < 9; ++i) { sunsky->config_x[i] = (float)sky_state->configs[0][i]; sunsky->config_y[i] = (float)sky_state->configs[1][i]; sunsky->config_z[i] = (float)sky_state->configs[2][i]; } sunsky->radiance_x = (float)sky_state->radiances[0]; sunsky->radiance_y = (float)sky_state->radiances[1]; sunsky->radiance_z = (float)sky_state->radiances[2]; /* Free sky_state */ arhosekskymodelstate_free(sky_state); } NODE_DEFINE(SkyTextureNode) { NodeType* type = NodeType::add("sky_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(SkyTextureNode); static NodeEnum type_enum; type_enum.insert("preetham", NODE_SKY_OLD); type_enum.insert("hosek_wilkie", NODE_SKY_NEW); SOCKET_ENUM(type, "Type", type_enum, NODE_SKY_NEW); SOCKET_VECTOR(sun_direction, "Sun Direction", make_float3(0.0f, 0.0f, 1.0f)); SOCKET_FLOAT(turbidity, "Turbidity", 2.2f); SOCKET_FLOAT(ground_albedo, "Ground Albedo", 0.3f); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_OUT_COLOR(color, "Color"); return type; } SkyTextureNode::SkyTextureNode() : TextureNode(node_type) { } void SkyTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *color_out = output("Color"); SunSky sunsky; if(type == NODE_SKY_OLD) sky_texture_precompute_old(&sunsky, sun_direction, turbidity); else if(type == NODE_SKY_NEW) sky_texture_precompute_new(&sunsky, sun_direction, turbidity, ground_albedo); else assert(false); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.stack_assign(color_out); compiler.add_node(NODE_TEX_SKY, vector_offset, compiler.stack_assign(color_out), type); compiler.add_node(__float_as_uint(sunsky.phi), __float_as_uint(sunsky.theta), __float_as_uint(sunsky.radiance_x), __float_as_uint(sunsky.radiance_y)); compiler.add_node(__float_as_uint(sunsky.radiance_z), __float_as_uint(sunsky.config_x[0]), __float_as_uint(sunsky.config_x[1]), __float_as_uint(sunsky.config_x[2])); compiler.add_node(__float_as_uint(sunsky.config_x[3]), __float_as_uint(sunsky.config_x[4]), __float_as_uint(sunsky.config_x[5]), __float_as_uint(sunsky.config_x[6])); compiler.add_node(__float_as_uint(sunsky.config_x[7]), __float_as_uint(sunsky.config_x[8]), __float_as_uint(sunsky.config_y[0]), __float_as_uint(sunsky.config_y[1])); compiler.add_node(__float_as_uint(sunsky.config_y[2]), __float_as_uint(sunsky.config_y[3]), __float_as_uint(sunsky.config_y[4]), __float_as_uint(sunsky.config_y[5])); compiler.add_node(__float_as_uint(sunsky.config_y[6]), __float_as_uint(sunsky.config_y[7]), __float_as_uint(sunsky.config_y[8]), __float_as_uint(sunsky.config_z[0])); compiler.add_node(__float_as_uint(sunsky.config_z[1]), __float_as_uint(sunsky.config_z[2]), __float_as_uint(sunsky.config_z[3]), __float_as_uint(sunsky.config_z[4])); compiler.add_node(__float_as_uint(sunsky.config_z[5]), __float_as_uint(sunsky.config_z[6]), __float_as_uint(sunsky.config_z[7]), __float_as_uint(sunsky.config_z[8])); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void SkyTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); SunSky sunsky; if(type == NODE_SKY_OLD) sky_texture_precompute_old(&sunsky, sun_direction, turbidity); else if(type == NODE_SKY_NEW) sky_texture_precompute_new(&sunsky, sun_direction, turbidity, ground_albedo); else assert(false); compiler.parameter(this, "type"); compiler.parameter("theta", sunsky.theta); compiler.parameter("phi", sunsky.phi); compiler.parameter_color("radiance", make_float3(sunsky.radiance_x, sunsky.radiance_y, sunsky.radiance_z)); compiler.parameter_array("config_x", sunsky.config_x, 9); compiler.parameter_array("config_y", sunsky.config_y, 9); compiler.parameter_array("config_z", sunsky.config_z, 9); compiler.add(this, "node_sky_texture"); } /* Gradient Texture */ NODE_DEFINE(GradientTextureNode) { NodeType* type = NodeType::add("gradient_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(GradientTextureNode); static NodeEnum type_enum; type_enum.insert("linear", NODE_BLEND_LINEAR); type_enum.insert("quadratic", NODE_BLEND_QUADRATIC); type_enum.insert("easing", NODE_BLEND_EASING); type_enum.insert("diagonal", NODE_BLEND_DIAGONAL); type_enum.insert("radial", NODE_BLEND_RADIAL); type_enum.insert("quadratic_sphere", NODE_BLEND_QUADRATIC_SPHERE); type_enum.insert("spherical", NODE_BLEND_SPHERICAL); SOCKET_ENUM(type, "Type", type_enum, NODE_BLEND_LINEAR); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } GradientTextureNode::GradientTextureNode() : TextureNode(node_type) { } void GradientTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_GRADIENT, compiler.encode_uchar4( type, vector_offset, compiler.stack_assign_if_linked(fac_out), compiler.stack_assign_if_linked(color_out))); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void GradientTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.parameter(this, "type"); compiler.add(this, "node_gradient_texture"); } /* Noise Texture */ NODE_DEFINE(NoiseTextureNode) { NodeType* type = NodeType::add("noise_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(NoiseTextureNode); SOCKET_IN_FLOAT(scale, "Scale", 1.0f); SOCKET_IN_FLOAT(detail, "Detail", 2.0f); SOCKET_IN_FLOAT(distortion, "Distortion", 0.0f); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } NoiseTextureNode::NoiseTextureNode() : TextureNode(node_type) { } void NoiseTextureNode::compile(SVMCompiler& compiler) { ShaderInput *distortion_in = input("Distortion"); ShaderInput *detail_in = input("Detail"); ShaderInput *scale_in = input("Scale"); ShaderInput *vector_in = input("Vector"); ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_NOISE, compiler.encode_uchar4( vector_offset, compiler.stack_assign_if_linked(scale_in), compiler.stack_assign_if_linked(detail_in), compiler.stack_assign_if_linked(distortion_in)), compiler.encode_uchar4( compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(fac_out))); compiler.add_node( __float_as_int(scale), __float_as_int(detail), __float_as_int(distortion)); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void NoiseTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.add(this, "node_noise_texture"); } /* Voronoi Texture */ NODE_DEFINE(VoronoiTextureNode) { NodeType* type = NodeType::add("voronoi_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(VoronoiTextureNode); static NodeEnum coloring_enum; coloring_enum.insert("intensity", NODE_VORONOI_INTENSITY); coloring_enum.insert("cells", NODE_VORONOI_CELLS); SOCKET_ENUM(coloring, "Coloring", coloring_enum, NODE_VORONOI_INTENSITY); SOCKET_IN_FLOAT(scale, "Scale", 1.0f); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } VoronoiTextureNode::VoronoiTextureNode() : TextureNode(node_type) { } void VoronoiTextureNode::compile(SVMCompiler& compiler) { ShaderInput *scale_in = input("Scale"); ShaderInput *vector_in = input("Vector"); ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_VORONOI, coloring, compiler.encode_uchar4( compiler.stack_assign_if_linked(scale_in), vector_offset, compiler.stack_assign(fac_out), compiler.stack_assign(color_out)), __float_as_int(scale)); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void VoronoiTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.parameter(this, "coloring"); compiler.add(this, "node_voronoi_texture"); } /* Musgrave Texture */ NODE_DEFINE(MusgraveTextureNode) { NodeType* type = NodeType::add("musgrave_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(MusgraveTextureNode); static NodeEnum type_enum; type_enum.insert("multifractal", NODE_MUSGRAVE_MULTIFRACTAL); type_enum.insert("fBM", NODE_MUSGRAVE_FBM); type_enum.insert("hybrid_multifractal", NODE_MUSGRAVE_HYBRID_MULTIFRACTAL); type_enum.insert("ridged_multifractal", NODE_MUSGRAVE_RIDGED_MULTIFRACTAL); type_enum.insert("hetero_terrain", NODE_MUSGRAVE_HETERO_TERRAIN); SOCKET_ENUM(type, "Type", type_enum, NODE_MUSGRAVE_FBM); SOCKET_IN_FLOAT(scale, "Scale", 1.0f); SOCKET_IN_FLOAT(detail, "Detail", 2.0f); SOCKET_IN_FLOAT(dimension, "Dimension", 2.0f); SOCKET_IN_FLOAT(lacunarity, "Lacunarity", 1.0f); SOCKET_IN_FLOAT(offset, "Offset", 0.0f); SOCKET_IN_FLOAT(gain, "Gain", 1.0f); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } MusgraveTextureNode::MusgraveTextureNode() : TextureNode(node_type) { } void MusgraveTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderInput *scale_in = input("Scale"); ShaderInput *dimension_in = input("Dimension"); ShaderInput *lacunarity_in = input("Lacunarity"); ShaderInput *detail_in = input("Detail"); ShaderInput *offset_in = input("Offset"); ShaderInput *gain_in = input("Gain"); ShaderOutput *fac_out = output("Fac"); ShaderOutput *color_out = output("Color"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_MUSGRAVE, compiler.encode_uchar4( type, vector_offset, compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(fac_out)), compiler.encode_uchar4( compiler.stack_assign_if_linked(dimension_in), compiler.stack_assign_if_linked(lacunarity_in), compiler.stack_assign_if_linked(detail_in), compiler.stack_assign_if_linked(offset_in)), compiler.encode_uchar4( compiler.stack_assign_if_linked(gain_in), compiler.stack_assign_if_linked(scale_in))); compiler.add_node(__float_as_int(dimension), __float_as_int(lacunarity), __float_as_int(detail), __float_as_int(offset)); compiler.add_node(__float_as_int(gain), __float_as_int(scale)); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void MusgraveTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.parameter(this, "type"); compiler.add(this, "node_musgrave_texture"); } /* Wave Texture */ NODE_DEFINE(WaveTextureNode) { NodeType* type = NodeType::add("wave_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(WaveTextureNode); static NodeEnum type_enum; type_enum.insert("bands", NODE_WAVE_BANDS); type_enum.insert("rings", NODE_WAVE_RINGS); SOCKET_ENUM(type, "Type", type_enum, NODE_WAVE_BANDS); static NodeEnum profile_enum; profile_enum.insert("sine", NODE_WAVE_PROFILE_SIN); profile_enum.insert("saw", NODE_WAVE_PROFILE_SAW); SOCKET_ENUM(profile, "Profile", profile_enum, NODE_WAVE_PROFILE_SIN); SOCKET_IN_FLOAT(scale, "Scale", 1.0f); SOCKET_IN_FLOAT(distortion, "Distortion", 0.0f); SOCKET_IN_FLOAT(detail, "Detail", 2.0f); SOCKET_IN_FLOAT(detail_scale, "Detail Scale", 0.0f); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } WaveTextureNode::WaveTextureNode() : TextureNode(node_type) { } void WaveTextureNode::compile(SVMCompiler& compiler) { ShaderInput *scale_in = input("Scale"); ShaderInput *distortion_in = input("Distortion"); ShaderInput *dscale_in = input("Detail Scale"); ShaderInput *detail_in = input("Detail"); ShaderInput *vector_in = input("Vector"); ShaderOutput *fac_out = output("Fac"); ShaderOutput *color_out = output("Color"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_WAVE, compiler.encode_uchar4( type, compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(fac_out), compiler.stack_assign_if_linked(dscale_in)), compiler.encode_uchar4( vector_offset, compiler.stack_assign_if_linked(scale_in), compiler.stack_assign_if_linked(detail_in), compiler.stack_assign_if_linked(distortion_in)), profile); compiler.add_node( __float_as_int(scale), __float_as_int(detail), __float_as_int(distortion), __float_as_int(detail_scale)); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void WaveTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.parameter(this, "type"); compiler.parameter(this, "profile"); compiler.add(this, "node_wave_texture"); } /* Magic Texture */ NODE_DEFINE(MagicTextureNode) { NodeType* type = NodeType::add("magic_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(MagicTextureNode); SOCKET_INT(depth, "Depth", 2); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_IN_FLOAT(scale, "Scale", 5.0f); SOCKET_IN_FLOAT(distortion, "Distortion", 1.0f); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } MagicTextureNode::MagicTextureNode() : TextureNode(node_type) { } void MagicTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderInput *scale_in = input("Scale"); ShaderInput *distortion_in = input("Distortion"); ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_MAGIC, compiler.encode_uchar4( depth, compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(fac_out)), compiler.encode_uchar4( vector_offset, compiler.stack_assign_if_linked(scale_in), compiler.stack_assign_if_linked(distortion_in))); compiler.add_node( __float_as_int(scale), __float_as_int(distortion)); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void MagicTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.parameter(this, "depth"); compiler.add(this, "node_magic_texture"); } /* Checker Texture */ NODE_DEFINE(CheckerTextureNode) { NodeType* type = NodeType::add("checker_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(CheckerTextureNode); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_IN_COLOR(color1, "Color1", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_COLOR(color2, "Color2", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_FLOAT(scale, "Scale", 1.0f); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } CheckerTextureNode::CheckerTextureNode() : TextureNode(node_type) { } void CheckerTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderInput *color1_in = input("Color1"); ShaderInput *color2_in = input("Color2"); ShaderInput *scale_in = input("Scale"); ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_CHECKER, compiler.encode_uchar4( vector_offset, compiler.stack_assign(color1_in), compiler.stack_assign(color2_in), compiler.stack_assign_if_linked(scale_in)), compiler.encode_uchar4( compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(fac_out)), __float_as_int(scale)); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void CheckerTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.add(this, "node_checker_texture"); } /* Brick Texture */ NODE_DEFINE(BrickTextureNode) { NodeType* type = NodeType::add("brick_texture", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(BrickTextureNode); SOCKET_FLOAT(offset, "Offset", 0.5f); SOCKET_INT(offset_frequency, "Offset Frequency", 2); SOCKET_FLOAT(squash, "Squash", 1.0f); SOCKET_INT(squash_frequency, "Squash Frequency", 2); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TEXTURE_GENERATED); SOCKET_IN_COLOR(color1, "Color1", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_COLOR(color2, "Color2", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_COLOR(mortar, "Mortar", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_FLOAT(scale, "Scale", 5.0f); SOCKET_IN_FLOAT(mortar_size, "Mortar Size", 0.02f); SOCKET_IN_FLOAT(mortar_smooth, "Mortar Smooth", 0.0f); SOCKET_IN_FLOAT(bias, "Bias", 0.0f); SOCKET_IN_FLOAT(brick_width, "Brick Width", 0.5f); SOCKET_IN_FLOAT(row_height, "Row Height", 0.25f); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } BrickTextureNode::BrickTextureNode() : TextureNode(node_type) { } void BrickTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderInput *color1_in = input("Color1"); ShaderInput *color2_in = input("Color2"); ShaderInput *mortar_in = input("Mortar"); ShaderInput *scale_in = input("Scale"); ShaderInput *mortar_size_in = input("Mortar Size"); ShaderInput *mortar_smooth_in = input("Mortar Smooth"); ShaderInput *bias_in = input("Bias"); ShaderInput *brick_width_in = input("Brick Width"); ShaderInput *row_height_in = input("Row Height"); ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); int vector_offset = tex_mapping.compile_begin(compiler, vector_in); compiler.add_node(NODE_TEX_BRICK, compiler.encode_uchar4( vector_offset, compiler.stack_assign(color1_in), compiler.stack_assign(color2_in), compiler.stack_assign(mortar_in)), compiler.encode_uchar4( compiler.stack_assign_if_linked(scale_in), compiler.stack_assign_if_linked(mortar_size_in), compiler.stack_assign_if_linked(bias_in), compiler.stack_assign_if_linked(brick_width_in)), compiler.encode_uchar4( compiler.stack_assign_if_linked(row_height_in), compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(fac_out), compiler.stack_assign_if_linked(mortar_smooth_in))); compiler.add_node(compiler.encode_uchar4(offset_frequency, squash_frequency), __float_as_int(scale), __float_as_int(mortar_size), __float_as_int(bias)); compiler.add_node(__float_as_int(brick_width), __float_as_int(row_height), __float_as_int(offset), __float_as_int(squash)); compiler.add_node(__float_as_int(mortar_smooth), SVM_STACK_INVALID, SVM_STACK_INVALID, SVM_STACK_INVALID); tex_mapping.compile_end(compiler, vector_in, vector_offset); } void BrickTextureNode::compile(OSLCompiler& compiler) { tex_mapping.compile(compiler); compiler.parameter(this, "offset"); compiler.parameter(this, "offset_frequency"); compiler.parameter(this, "squash"); compiler.parameter(this, "squash_frequency"); compiler.add(this, "node_brick_texture"); } /* Point Density Texture */ NODE_DEFINE(PointDensityTextureNode) { NodeType* type = NodeType::add("point_density_texture", create, NodeType::SHADER); SOCKET_STRING(filename, "Filename", ustring()); static NodeEnum space_enum; space_enum.insert("object", NODE_TEX_VOXEL_SPACE_OBJECT); space_enum.insert("world", NODE_TEX_VOXEL_SPACE_WORLD); SOCKET_ENUM(space, "Space", space_enum, NODE_TEX_VOXEL_SPACE_OBJECT); static NodeEnum interpolation_enum; interpolation_enum.insert("closest", INTERPOLATION_CLOSEST); interpolation_enum.insert("linear", INTERPOLATION_LINEAR); interpolation_enum.insert("cubic", INTERPOLATION_CUBIC); interpolation_enum.insert("smart", INTERPOLATION_SMART); SOCKET_ENUM(interpolation, "Interpolation", interpolation_enum, INTERPOLATION_LINEAR); SOCKET_TRANSFORM(tfm, "Transform", transform_identity()); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_POSITION); SOCKET_OUT_FLOAT(density, "Density"); SOCKET_OUT_COLOR(color, "Color"); return type; } PointDensityTextureNode::PointDensityTextureNode() : ShaderNode(node_type) { image_manager = NULL; slot = -1; builtin_data = NULL; } PointDensityTextureNode::~PointDensityTextureNode() { if(image_manager) { image_manager->remove_image(filename.string(), builtin_data, interpolation, EXTENSION_CLIP, true); } } ShaderNode *PointDensityTextureNode::clone() const { PointDensityTextureNode *node = new PointDensityTextureNode(*this); node->image_manager = NULL; node->slot = -1; return node; } void PointDensityTextureNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_volume) attributes->add(ATTR_STD_GENERATED_TRANSFORM); ShaderNode::attributes(shader, attributes); } void PointDensityTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *density_out = output("Density"); ShaderOutput *color_out = output("Color"); const bool use_density = !density_out->links.empty(); const bool use_color = !color_out->links.empty(); image_manager = compiler.image_manager; if(use_density || use_color) { if(slot == -1) { ImageMetaData metadata; slot = image_manager->add_image(filename.string(), builtin_data, false, 0, interpolation, EXTENSION_CLIP, true, metadata); } if(slot != -1) { compiler.stack_assign(vector_in); compiler.add_node(NODE_TEX_VOXEL, slot, compiler.encode_uchar4(compiler.stack_assign(vector_in), compiler.stack_assign_if_linked(density_out), compiler.stack_assign_if_linked(color_out), space)); if(space == NODE_TEX_VOXEL_SPACE_WORLD) { compiler.add_node(tfm.x); compiler.add_node(tfm.y); compiler.add_node(tfm.z); compiler.add_node(tfm.w); } } else { if(use_density) { compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), compiler.stack_assign(density_out)); } if(use_color) { compiler.add_node(NODE_VALUE_V, compiler.stack_assign(color_out)); compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R, TEX_IMAGE_MISSING_G, TEX_IMAGE_MISSING_B)); } } } } void PointDensityTextureNode::compile(OSLCompiler& compiler) { ShaderOutput *density_out = output("Density"); ShaderOutput *color_out = output("Color"); const bool use_density = !density_out->links.empty(); const bool use_color = !color_out->links.empty(); image_manager = compiler.image_manager; if(use_density || use_color) { if(slot == -1) { ImageMetaData metadata; slot = image_manager->add_image(filename.string(), builtin_data, false, 0, interpolation, EXTENSION_CLIP, true, metadata); } if(slot != -1) { compiler.parameter("filename", string_printf("@%d", slot).c_str()); } if(space == NODE_TEX_VOXEL_SPACE_WORLD) { compiler.parameter("mapping", transform_transpose(tfm)); compiler.parameter("use_mapping", 1); } compiler.parameter(this, "interpolation"); compiler.add(this, "node_voxel_texture"); } } /* Normal */ NODE_DEFINE(NormalNode) { NodeType* type = NodeType::add("normal", create, NodeType::SHADER); SOCKET_VECTOR(direction, "direction", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_NORMAL(normal, "Normal"); SOCKET_OUT_FLOAT(dot, "Dot"); return type; } NormalNode::NormalNode() : ShaderNode(node_type) { } void NormalNode::compile(SVMCompiler& compiler) { ShaderInput *normal_in = input("Normal"); ShaderOutput *normal_out = output("Normal"); ShaderOutput *dot_out = output("Dot"); compiler.add_node(NODE_NORMAL, compiler.stack_assign(normal_in), compiler.stack_assign(normal_out), compiler.stack_assign(dot_out)); compiler.add_node( __float_as_int(direction.x), __float_as_int(direction.y), __float_as_int(direction.z)); } void NormalNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "direction"); compiler.add(this, "node_normal"); } /* Mapping */ NODE_DEFINE(MappingNode) { NodeType* type = NodeType::add("mapping", create, NodeType::SHADER); TEXTURE_MAPPING_DEFINE(MappingNode); SOCKET_IN_POINT(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_POINT(vector, "Vector"); return type; } MappingNode::MappingNode() : ShaderNode(node_type) { } void MappingNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *vector_out = output("Vector"); tex_mapping.compile(compiler, compiler.stack_assign(vector_in), compiler.stack_assign(vector_out)); } void MappingNode::compile(OSLCompiler& compiler) { Transform tfm = transform_transpose(tex_mapping.compute_transform()); compiler.parameter("Matrix", tfm); compiler.parameter_point("mapping_min", tex_mapping.min); compiler.parameter_point("mapping_max", tex_mapping.max); compiler.parameter("use_minmax", tex_mapping.use_minmax); compiler.add(this, "node_mapping"); } /* RGBToBW */ NODE_DEFINE(RGBToBWNode) { NodeType* type = NodeType::add("rgb_to_bw", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_FLOAT(val, "Val"); return type; } RGBToBWNode::RGBToBWNode() : ShaderNode(node_type) { } void RGBToBWNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant(linear_rgb_to_gray(color)); } } void RGBToBWNode::compile(SVMCompiler& compiler) { compiler.add_node(NODE_CONVERT, NODE_CONVERT_CF, compiler.stack_assign(inputs[0]), compiler.stack_assign(outputs[0])); } void RGBToBWNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_rgb_to_bw"); } /* Convert */ const NodeType* ConvertNode::node_types[ConvertNode::MAX_TYPE][ConvertNode::MAX_TYPE]; bool ConvertNode::initialized = ConvertNode::register_types(); Node* ConvertNode::create(const NodeType *type) { return new ConvertNode(type->inputs[0].type, type->outputs[0].type); } bool ConvertNode::register_types() { const int num_types = 8; SocketType::Type types[num_types] = {SocketType::FLOAT, SocketType::INT, SocketType::COLOR, SocketType::VECTOR, SocketType::POINT, SocketType::NORMAL, SocketType::STRING, SocketType::CLOSURE}; for(size_t i = 0; i < num_types; i++) { SocketType::Type from = types[i]; ustring from_name(SocketType::type_name(from)); ustring from_value_name("value_" + from_name.string()); for(size_t j = 0; j < num_types; j++) { SocketType::Type to = types[j]; ustring to_name(SocketType::type_name(to)); ustring to_value_name("value_" + to_name.string()); string node_name = "convert_" + from_name.string() + "_to_" + to_name.string(); NodeType* type = NodeType::add(node_name.c_str(), create, NodeType::SHADER); type->register_input(from_value_name, from_value_name, from, SOCKET_OFFSETOF(ConvertNode, value_float), SocketType::zero_default_value(), NULL, NULL, SocketType::LINKABLE); type->register_output(to_value_name, to_value_name, to); assert(from < MAX_TYPE); assert(to < MAX_TYPE); node_types[from][to] = type; } } return true; } ConvertNode::ConvertNode(SocketType::Type from_, SocketType::Type to_, bool autoconvert) : ShaderNode(node_types[from_][to_]) { from = from_; to = to_; if(from == to) special_type = SHADER_SPECIAL_TYPE_PROXY; else if(autoconvert) special_type = SHADER_SPECIAL_TYPE_AUTOCONVERT; } void ConvertNode::constant_fold(const ConstantFolder& folder) { /* proxy nodes should have been removed at this point */ assert(special_type != SHADER_SPECIAL_TYPE_PROXY); /* TODO(DingTo): conversion from/to int is not supported yet, don't fold in that case */ if(folder.all_inputs_constant()) { if(from == SocketType::FLOAT) { if(SocketType::is_float3(to)) { folder.make_constant(make_float3(value_float, value_float, value_float)); } } else if(SocketType::is_float3(from)) { if(to == SocketType::FLOAT) { if(from == SocketType::COLOR) { /* color to float */ folder.make_constant(linear_rgb_to_gray(value_color)); } else { /* vector/point/normal to float */ folder.make_constant(average(value_vector)); } } else if(SocketType::is_float3(to)) { folder.make_constant(value_color); } } } else { ShaderInput *in = inputs[0]; ShaderNode *prev = in->link->parent; /* no-op conversion of A to B to A */ if(prev->type == node_types[to][from]) { ShaderInput *prev_in = prev->inputs[0]; if(SocketType::is_float3(from) && (to == SocketType::FLOAT || SocketType::is_float3(to)) && prev_in->link) { folder.bypass(prev_in->link); } } } } void ConvertNode::compile(SVMCompiler& compiler) { /* proxy nodes should have been removed at this point */ assert(special_type != SHADER_SPECIAL_TYPE_PROXY); ShaderInput *in = inputs[0]; ShaderOutput *out = outputs[0]; if(from == SocketType::FLOAT) { if(to == SocketType::INT) /* float to int */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_FI, compiler.stack_assign(in), compiler.stack_assign(out)); else /* float to float3 */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_FV, compiler.stack_assign(in), compiler.stack_assign(out)); } else if(from == SocketType::INT) { if(to == SocketType::FLOAT) /* int to float */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_IF, compiler.stack_assign(in), compiler.stack_assign(out)); else /* int to vector/point/normal */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_IV, compiler.stack_assign(in), compiler.stack_assign(out)); } else if(to == SocketType::FLOAT) { if(from == SocketType::COLOR) /* color to float */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_CF, compiler.stack_assign(in), compiler.stack_assign(out)); else /* vector/point/normal to float */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_VF, compiler.stack_assign(in), compiler.stack_assign(out)); } else if(to == SocketType::INT) { if(from == SocketType::COLOR) /* color to int */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_CI, compiler.stack_assign(in), compiler.stack_assign(out)); else /* vector/point/normal to int */ compiler.add_node(NODE_CONVERT, NODE_CONVERT_VI, compiler.stack_assign(in), compiler.stack_assign(out)); } else { /* float3 to float3 */ if(in->link) { /* no op in SVM */ compiler.stack_link(in, out); } else { /* set 0,0,0 value */ compiler.add_node(NODE_VALUE_V, compiler.stack_assign(out)); compiler.add_node(NODE_VALUE_V, value_color); } } } void ConvertNode::compile(OSLCompiler& compiler) { /* proxy nodes should have been removed at this point */ assert(special_type != SHADER_SPECIAL_TYPE_PROXY); if(from == SocketType::FLOAT) compiler.add(this, "node_convert_from_float"); else if(from == SocketType::INT) compiler.add(this, "node_convert_from_int"); else if(from == SocketType::COLOR) compiler.add(this, "node_convert_from_color"); else if(from == SocketType::VECTOR) compiler.add(this, "node_convert_from_vector"); else if(from == SocketType::POINT) compiler.add(this, "node_convert_from_point"); else if(from == SocketType::NORMAL) compiler.add(this, "node_convert_from_normal"); else assert(0); } /* Base type for all closure-type nodes */ BsdfBaseNode::BsdfBaseNode(const NodeType *node_type) : ShaderNode(node_type) { special_type = SHADER_SPECIAL_TYPE_CLOSURE; } bool BsdfBaseNode::has_bump() { /* detect if anything is plugged into the normal input besides the default */ ShaderInput *normal_in = input("Normal"); return (normal_in && normal_in->link && normal_in->link->parent->special_type != SHADER_SPECIAL_TYPE_GEOMETRY); } /* BSDF Closure */ BsdfNode::BsdfNode(const NodeType *node_type) : BsdfBaseNode(node_type) { } void BsdfNode::compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2, ShaderInput *param3, ShaderInput *param4) { ShaderInput *color_in = input("Color"); ShaderInput *normal_in = input("Normal"); ShaderInput *tangent_in = input("Tangent"); if(color_in->link) compiler.add_node(NODE_CLOSURE_WEIGHT, compiler.stack_assign(color_in)); else compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color); int normal_offset = (normal_in) ? compiler.stack_assign_if_linked(normal_in) : SVM_STACK_INVALID; int tangent_offset = (tangent_in) ? compiler.stack_assign_if_linked(tangent_in) : SVM_STACK_INVALID; int param3_offset = (param3) ? compiler.stack_assign(param3) : SVM_STACK_INVALID; int param4_offset = (param4) ? compiler.stack_assign(param4) : SVM_STACK_INVALID; compiler.add_node(NODE_CLOSURE_BSDF, compiler.encode_uchar4(closure, (param1)? compiler.stack_assign(param1): SVM_STACK_INVALID, (param2)? compiler.stack_assign(param2): SVM_STACK_INVALID, compiler.closure_mix_weight_offset()), __float_as_int((param1)? get_float(param1->socket_type): 0.0f), __float_as_int((param2)? get_float(param2->socket_type): 0.0f)); compiler.add_node(normal_offset, tangent_offset, param3_offset, param4_offset); } void BsdfNode::compile(SVMCompiler& compiler) { compile(compiler, NULL, NULL); } void BsdfNode::compile(OSLCompiler& /*compiler*/) { assert(0); } /* Anisotropic BSDF Closure */ NODE_DEFINE(AnisotropicBsdfNode) { NodeType* type = NodeType::add("anisotropic_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); static NodeEnum distribution_enum; distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID); distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID); distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID); distribution_enum.insert("ashikhmin_shirley", CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID); SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID); SOCKET_IN_VECTOR(tangent, "Tangent", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TANGENT); SOCKET_IN_FLOAT(roughness, "Roughness", 0.2f); SOCKET_IN_FLOAT(anisotropy, "Anisotropy", 0.5f); SOCKET_IN_FLOAT(rotation, "Rotation", 0.0f); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } AnisotropicBsdfNode::AnisotropicBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID; } void AnisotropicBsdfNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { ShaderInput *tangent_in = input("Tangent"); if(!tangent_in->link) attributes->add(ATTR_STD_GENERATED); } ShaderNode::attributes(shader, attributes); } void AnisotropicBsdfNode::compile(SVMCompiler& compiler) { closure = distribution; if(closure == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID) BsdfNode::compile(compiler, input("Roughness"), input("Anisotropy"), input("Rotation"), input("Color")); else BsdfNode::compile(compiler, input("Roughness"), input("Anisotropy"), input("Rotation")); } void AnisotropicBsdfNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "distribution"); compiler.add(this, "node_anisotropic_bsdf"); } /* Glossy BSDF Closure */ NODE_DEFINE(GlossyBsdfNode) { NodeType* type = NodeType::add("glossy_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); static NodeEnum distribution_enum; distribution_enum.insert("sharp", CLOSURE_BSDF_REFLECTION_ID); distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_ID); distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_ID); distribution_enum.insert("ashikhmin_shirley", CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID); distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID); SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_ID); SOCKET_IN_FLOAT(roughness, "Roughness", 0.2f); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } GlossyBsdfNode::GlossyBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_MICROFACET_GGX_ID; distribution_orig = NBUILTIN_CLOSURES; } void GlossyBsdfNode::simplify_settings(Scene *scene) { if(distribution_orig == NBUILTIN_CLOSURES) { roughness_orig = roughness; distribution_orig = distribution; } else { /* By default we use original values, so we don't worry about restoring * defaults later one and can only do override when needed. */ roughness = roughness_orig; distribution = distribution_orig; } Integrator *integrator = scene->integrator; ShaderInput *roughness_input = input("Roughness"); if(integrator->filter_glossy == 0.0f) { /* Fallback to Sharp closure for Roughness close to 0. * Note: Keep the epsilon in sync with kernel! */ if(!roughness_input->link && roughness <= 1e-4f) { VLOG(1) << "Using sharp glossy BSDF."; distribution = CLOSURE_BSDF_REFLECTION_ID; } } else { /* If filter glossy is used we replace Sharp glossy with GGX so we can * benefit from closure blur to remove unwanted noise. */ if(roughness_input->link == NULL && distribution == CLOSURE_BSDF_REFLECTION_ID) { VLOG(1) << "Using GGX glossy with filter glossy."; distribution = CLOSURE_BSDF_MICROFACET_GGX_ID; roughness = 0.0f; } } closure = distribution; } bool GlossyBsdfNode::has_integrator_dependency() { ShaderInput *roughness_input = input("Roughness"); return !roughness_input->link && (distribution == CLOSURE_BSDF_REFLECTION_ID || roughness <= 1e-4f); } void GlossyBsdfNode::compile(SVMCompiler& compiler) { closure = distribution; if(closure == CLOSURE_BSDF_REFLECTION_ID) BsdfNode::compile(compiler, NULL, NULL); else if(closure == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID) BsdfNode::compile(compiler, input("Roughness"), NULL, input("Color")); else BsdfNode::compile(compiler, input("Roughness"), NULL); } void GlossyBsdfNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "distribution"); compiler.add(this, "node_glossy_bsdf"); } /* Glass BSDF Closure */ NODE_DEFINE(GlassBsdfNode) { NodeType* type = NodeType::add("glass_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); static NodeEnum distribution_enum; distribution_enum.insert("sharp", CLOSURE_BSDF_SHARP_GLASS_ID); distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID); distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID); distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID); SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID); SOCKET_IN_FLOAT(roughness, "Roughness", 0.0f); SOCKET_IN_FLOAT(IOR, "IOR", 0.3f); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } GlassBsdfNode::GlassBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_SHARP_GLASS_ID; distribution_orig = NBUILTIN_CLOSURES; } void GlassBsdfNode::simplify_settings(Scene *scene) { if(distribution_orig == NBUILTIN_CLOSURES) { roughness_orig = roughness; distribution_orig = distribution; } else { /* By default we use original values, so we don't worry about restoring * defaults later one and can only do override when needed. */ roughness = roughness_orig; distribution = distribution_orig; } Integrator *integrator = scene->integrator; ShaderInput *roughness_input = input("Roughness"); if(integrator->filter_glossy == 0.0f) { /* Fallback to Sharp closure for Roughness close to 0. * Note: Keep the epsilon in sync with kernel! */ if(!roughness_input->link && roughness <= 1e-4f) { VLOG(1) << "Using sharp glass BSDF."; distribution = CLOSURE_BSDF_SHARP_GLASS_ID; } } else { /* If filter glossy is used we replace Sharp glossy with GGX so we can * benefit from closure blur to remove unwanted noise. */ if(roughness_input->link == NULL && distribution == CLOSURE_BSDF_SHARP_GLASS_ID) { VLOG(1) << "Using GGX glass with filter glossy."; distribution = CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID; roughness = 0.0f; } } closure = distribution; } bool GlassBsdfNode::has_integrator_dependency() { ShaderInput *roughness_input = input("Roughness"); return !roughness_input->link && (distribution == CLOSURE_BSDF_SHARP_GLASS_ID || roughness <= 1e-4f); } void GlassBsdfNode::compile(SVMCompiler& compiler) { closure = distribution; if(closure == CLOSURE_BSDF_SHARP_GLASS_ID) BsdfNode::compile(compiler, NULL, input("IOR")); else if(closure == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) BsdfNode::compile(compiler, input("Roughness"), input("IOR"), input("Color")); else BsdfNode::compile(compiler, input("Roughness"), input("IOR")); } void GlassBsdfNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "distribution"); compiler.add(this, "node_glass_bsdf"); } /* Refraction BSDF Closure */ NODE_DEFINE(RefractionBsdfNode) { NodeType* type = NodeType::add("refraction_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); static NodeEnum distribution_enum; distribution_enum.insert("sharp", CLOSURE_BSDF_REFRACTION_ID); distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID); distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID); SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID); SOCKET_IN_FLOAT(roughness, "Roughness", 0.0f); SOCKET_IN_FLOAT(IOR, "IOR", 0.3f); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } RefractionBsdfNode::RefractionBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_REFRACTION_ID; distribution_orig = NBUILTIN_CLOSURES; } void RefractionBsdfNode::simplify_settings(Scene *scene) { if(distribution_orig == NBUILTIN_CLOSURES) { roughness_orig = roughness; distribution_orig = distribution; } else { /* By default we use original values, so we don't worry about restoring * defaults later one and can only do override when needed. */ roughness = roughness_orig; distribution = distribution_orig; } Integrator *integrator = scene->integrator; ShaderInput *roughness_input = input("Roughness"); if(integrator->filter_glossy == 0.0f) { /* Fallback to Sharp closure for Roughness close to 0. * Note: Keep the epsilon in sync with kernel! */ if(!roughness_input->link && roughness <= 1e-4f) { VLOG(1) << "Using sharp refraction BSDF."; distribution = CLOSURE_BSDF_REFRACTION_ID; } } else { /* If filter glossy is used we replace Sharp glossy with GGX so we can * benefit from closure blur to remove unwanted noise. */ if(roughness_input->link == NULL && distribution == CLOSURE_BSDF_REFRACTION_ID) { VLOG(1) << "Using GGX refraction with filter glossy."; distribution = CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID; roughness = 0.0f; } } closure = distribution; } bool RefractionBsdfNode::has_integrator_dependency() { ShaderInput *roughness_input = input("Roughness"); return !roughness_input->link && (distribution == CLOSURE_BSDF_REFRACTION_ID || roughness <= 1e-4f); } void RefractionBsdfNode::compile(SVMCompiler& compiler) { closure = distribution; if(closure == CLOSURE_BSDF_REFRACTION_ID) BsdfNode::compile(compiler, NULL, input("IOR")); else BsdfNode::compile(compiler, input("Roughness"), input("IOR")); } void RefractionBsdfNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "distribution"); compiler.add(this, "node_refraction_bsdf"); } /* Toon BSDF Closure */ NODE_DEFINE(ToonBsdfNode) { NodeType* type = NodeType::add("toon_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); static NodeEnum component_enum; component_enum.insert("diffuse", CLOSURE_BSDF_DIFFUSE_TOON_ID); component_enum.insert("glossy", CLOSURE_BSDF_GLOSSY_TOON_ID); SOCKET_ENUM(component, "Component", component_enum, CLOSURE_BSDF_DIFFUSE_TOON_ID); SOCKET_IN_FLOAT(size, "Size", 0.5f); SOCKET_IN_FLOAT(smooth, "Smooth", 0.0f); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } ToonBsdfNode::ToonBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_DIFFUSE_TOON_ID; } void ToonBsdfNode::compile(SVMCompiler& compiler) { closure = component; BsdfNode::compile(compiler, input("Size"), input("Smooth")); } void ToonBsdfNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "component"); compiler.add(this, "node_toon_bsdf"); } /* Velvet BSDF Closure */ NODE_DEFINE(VelvetBsdfNode) { NodeType* type = NodeType::add("velvet_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_IN_FLOAT(sigma, "Sigma", 1.0f); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } VelvetBsdfNode::VelvetBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_ASHIKHMIN_VELVET_ID; } void VelvetBsdfNode::compile(SVMCompiler& compiler) { BsdfNode::compile(compiler, input("Sigma"), NULL); } void VelvetBsdfNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_velvet_bsdf"); } /* Diffuse BSDF Closure */ NODE_DEFINE(DiffuseBsdfNode) { NodeType* type = NodeType::add("diffuse_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_IN_FLOAT(roughness, "Roughness", 0.0f); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } DiffuseBsdfNode::DiffuseBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_DIFFUSE_ID; } void DiffuseBsdfNode::compile(SVMCompiler& compiler) { BsdfNode::compile(compiler, input("Roughness"), NULL); } void DiffuseBsdfNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_diffuse_bsdf"); } /* Disney principled BSDF Closure */ NODE_DEFINE(PrincipledBsdfNode) { NodeType* type = NodeType::add("principled_bsdf", create, NodeType::SHADER); static NodeEnum distribution_enum; distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID); distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID); SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID); static NodeEnum subsurface_method_enum; subsurface_method_enum.insert("burley", CLOSURE_BSSRDF_PRINCIPLED_ID); subsurface_method_enum.insert("random_walk", CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID); SOCKET_ENUM(subsurface_method, "Subsurface Method", subsurface_method_enum, CLOSURE_BSSRDF_PRINCIPLED_ID); SOCKET_IN_COLOR(base_color, "Base Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_COLOR(subsurface_color, "Subsurface Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_FLOAT(metallic, "Metallic", 0.0f); SOCKET_IN_FLOAT(subsurface, "Subsurface", 0.0f); SOCKET_IN_VECTOR(subsurface_radius, "Subsurface Radius", make_float3(0.1f, 0.1f, 0.1f)); SOCKET_IN_FLOAT(specular, "Specular", 0.0f); SOCKET_IN_FLOAT(roughness, "Roughness", 0.5f); SOCKET_IN_FLOAT(specular_tint, "Specular Tint", 0.0f); SOCKET_IN_FLOAT(anisotropic, "Anisotropic", 0.0f); SOCKET_IN_FLOAT(sheen, "Sheen", 0.0f); SOCKET_IN_FLOAT(sheen_tint, "Sheen Tint", 0.0f); SOCKET_IN_FLOAT(clearcoat, "Clearcoat", 0.0f); SOCKET_IN_FLOAT(clearcoat_roughness, "Clearcoat Roughness", 0.03f); SOCKET_IN_FLOAT(ior, "IOR", 0.0f); SOCKET_IN_FLOAT(transmission, "Transmission", 0.0f); SOCKET_IN_FLOAT(transmission_roughness, "Transmission Roughness", 0.0f); SOCKET_IN_FLOAT(anisotropic_rotation, "Anisotropic Rotation", 0.0f); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_NORMAL(clearcoat_normal, "Clearcoat Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_NORMAL(tangent, "Tangent", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TANGENT); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } PrincipledBsdfNode::PrincipledBsdfNode() : BsdfBaseNode(node_type) { closure = CLOSURE_BSDF_PRINCIPLED_ID; distribution = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID; distribution_orig = NBUILTIN_CLOSURES; } bool PrincipledBsdfNode::has_surface_bssrdf() { ShaderInput *subsurface_in = input("Subsurface"); return (subsurface_in->link != NULL || subsurface > CLOSURE_WEIGHT_CUTOFF); } void PrincipledBsdfNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { ShaderInput *tangent_in = input("Tangent"); if(!tangent_in->link) attributes->add(ATTR_STD_GENERATED); } ShaderNode::attributes(shader, attributes); } void PrincipledBsdfNode::compile(SVMCompiler& compiler, ShaderInput *p_metallic, ShaderInput *p_subsurface, ShaderInput *p_subsurface_radius, ShaderInput *p_specular, ShaderInput *p_roughness, ShaderInput *p_specular_tint, ShaderInput *p_anisotropic, ShaderInput *p_sheen, ShaderInput *p_sheen_tint, ShaderInput *p_clearcoat, ShaderInput *p_clearcoat_roughness, ShaderInput *p_ior, ShaderInput *p_transmission, ShaderInput *p_anisotropic_rotation, ShaderInput *p_transmission_roughness) { ShaderInput *base_color_in = input("Base Color"); ShaderInput *subsurface_color_in = input("Subsurface Color"); ShaderInput *normal_in = input("Normal"); ShaderInput *clearcoat_normal_in = input("Clearcoat Normal"); ShaderInput *tangent_in = input("Tangent"); float3 weight = make_float3(1.0f, 1.0f, 1.0f); compiler.add_node(NODE_CLOSURE_SET_WEIGHT, weight); int normal_offset = compiler.stack_assign_if_linked(normal_in); int clearcoat_normal_offset = compiler.stack_assign_if_linked(clearcoat_normal_in); int tangent_offset = compiler.stack_assign_if_linked(tangent_in); int specular_offset = compiler.stack_assign(p_specular); int roughness_offset = compiler.stack_assign(p_roughness); int specular_tint_offset = compiler.stack_assign(p_specular_tint); int anisotropic_offset = compiler.stack_assign(p_anisotropic); int sheen_offset = compiler.stack_assign(p_sheen); int sheen_tint_offset = compiler.stack_assign(p_sheen_tint); int clearcoat_offset = compiler.stack_assign(p_clearcoat); int clearcoat_roughness_offset = compiler.stack_assign(p_clearcoat_roughness); int ior_offset = compiler.stack_assign(p_ior); int transmission_offset = compiler.stack_assign(p_transmission); int transmission_roughness_offset = compiler.stack_assign(p_transmission_roughness); int anisotropic_rotation_offset = compiler.stack_assign(p_anisotropic_rotation); int subsurface_radius_offset = compiler.stack_assign(p_subsurface_radius); compiler.add_node(NODE_CLOSURE_BSDF, compiler.encode_uchar4(closure, compiler.stack_assign(p_metallic), compiler.stack_assign(p_subsurface), compiler.closure_mix_weight_offset()), __float_as_int((p_metallic) ? get_float(p_metallic->socket_type) : 0.0f), __float_as_int((p_subsurface) ? get_float(p_subsurface->socket_type) : 0.0f)); compiler.add_node(normal_offset, tangent_offset, compiler.encode_uchar4(specular_offset, roughness_offset, specular_tint_offset, anisotropic_offset), compiler.encode_uchar4(sheen_offset, sheen_tint_offset, clearcoat_offset, clearcoat_roughness_offset)); compiler.add_node(compiler.encode_uchar4(ior_offset, transmission_offset, anisotropic_rotation_offset, transmission_roughness_offset), distribution, subsurface_method, SVM_STACK_INVALID); float3 bc_default = get_float3(base_color_in->socket_type); compiler.add_node(((base_color_in->link) ? compiler.stack_assign(base_color_in) : SVM_STACK_INVALID), __float_as_int(bc_default.x), __float_as_int(bc_default.y), __float_as_int(bc_default.z)); compiler.add_node(clearcoat_normal_offset, subsurface_radius_offset, SVM_STACK_INVALID, SVM_STACK_INVALID); float3 ss_default = get_float3(subsurface_color_in->socket_type); compiler.add_node(((subsurface_color_in->link) ? compiler.stack_assign(subsurface_color_in) : SVM_STACK_INVALID), __float_as_int(ss_default.x), __float_as_int(ss_default.y), __float_as_int(ss_default.z)); } bool PrincipledBsdfNode::has_integrator_dependency() { ShaderInput *roughness_input = input("Roughness"); return !roughness_input->link && roughness <= 1e-4f; } void PrincipledBsdfNode::compile(SVMCompiler& compiler) { compile(compiler, input("Metallic"), input("Subsurface"), input("Subsurface Radius"), input("Specular"), input("Roughness"), input("Specular Tint"), input("Anisotropic"), input("Sheen"), input("Sheen Tint"), input("Clearcoat"), input("Clearcoat Roughness"), input("IOR"), input("Transmission"), input("Anisotropic Rotation"), input("Transmission Roughness")); } void PrincipledBsdfNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "distribution"); compiler.parameter(this, "subsurface_method"); compiler.add(this, "node_principled_bsdf"); } bool PrincipledBsdfNode::has_bssrdf_bump() { return has_surface_bssrdf() && has_bump(); } /* Translucent BSDF Closure */ NODE_DEFINE(TranslucentBsdfNode) { NodeType* type = NodeType::add("translucent_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } TranslucentBsdfNode::TranslucentBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_TRANSLUCENT_ID; } void TranslucentBsdfNode::compile(SVMCompiler& compiler) { BsdfNode::compile(compiler, NULL, NULL); } void TranslucentBsdfNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_translucent_bsdf"); } /* Transparent BSDF Closure */ NODE_DEFINE(TransparentBsdfNode) { NodeType* type = NodeType::add("transparent_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } TransparentBsdfNode::TransparentBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_TRANSPARENT_ID; } void TransparentBsdfNode::compile(SVMCompiler& compiler) { BsdfNode::compile(compiler, NULL, NULL); } void TransparentBsdfNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_transparent_bsdf"); } /* Subsurface Scattering Closure */ NODE_DEFINE(SubsurfaceScatteringNode) { NodeType* type = NodeType::add("subsurface_scattering", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); static NodeEnum falloff_enum; falloff_enum.insert("cubic", CLOSURE_BSSRDF_CUBIC_ID); falloff_enum.insert("gaussian", CLOSURE_BSSRDF_GAUSSIAN_ID); falloff_enum.insert("burley", CLOSURE_BSSRDF_BURLEY_ID); falloff_enum.insert("random_walk", CLOSURE_BSSRDF_RANDOM_WALK_ID); SOCKET_ENUM(falloff, "Falloff", falloff_enum, CLOSURE_BSSRDF_BURLEY_ID); SOCKET_IN_FLOAT(scale, "Scale", 0.01f); SOCKET_IN_VECTOR(radius, "Radius", make_float3(0.1f, 0.1f, 0.1f)); SOCKET_IN_FLOAT(sharpness, "Sharpness", 0.0f); SOCKET_IN_FLOAT(texture_blur, "Texture Blur", 1.0f); SOCKET_OUT_CLOSURE(BSSRDF, "BSSRDF"); return type; } SubsurfaceScatteringNode::SubsurfaceScatteringNode() : BsdfNode(node_type) { closure = falloff; } void SubsurfaceScatteringNode::compile(SVMCompiler& compiler) { closure = falloff; BsdfNode::compile(compiler, input("Scale"), input("Texture Blur"), input("Radius"), input("Sharpness")); } void SubsurfaceScatteringNode::compile(OSLCompiler& compiler) { closure = falloff; compiler.parameter(this, "falloff"); compiler.add(this, "node_subsurface_scattering"); } bool SubsurfaceScatteringNode::has_bssrdf_bump() { /* detect if anything is plugged into the normal input besides the default */ ShaderInput *normal_in = input("Normal"); return (normal_in->link && normal_in->link->parent->special_type != SHADER_SPECIAL_TYPE_GEOMETRY); } /* Emissive Closure */ NODE_DEFINE(EmissionNode) { NodeType* type = NodeType::add("emission", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_FLOAT(strength, "Strength", 10.0f); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(emission, "Emission"); return type; } EmissionNode::EmissionNode() : ShaderNode(node_type) { } void EmissionNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); ShaderInput *strength_in = input("Strength"); if(color_in->link || strength_in->link) { compiler.add_node(NODE_EMISSION_WEIGHT, compiler.stack_assign(color_in), compiler.stack_assign(strength_in)); } else compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color * strength); compiler.add_node(NODE_CLOSURE_EMISSION, compiler.closure_mix_weight_offset()); } void EmissionNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_emission"); } void EmissionNode::constant_fold(const ConstantFolder& folder) { ShaderInput *color_in = input("Color"); ShaderInput *strength_in = input("Strength"); if((!color_in->link && color == make_float3(0.0f, 0.0f, 0.0f)) || (!strength_in->link && strength == 0.0f)) { folder.discard(); } } /* Background Closure */ NODE_DEFINE(BackgroundNode) { NodeType* type = NodeType::add("background_shader", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_FLOAT(strength, "Strength", 1.0f); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(background, "Background"); return type; } BackgroundNode::BackgroundNode() : ShaderNode(node_type) { } void BackgroundNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); ShaderInput *strength_in = input("Strength"); if(color_in->link || strength_in->link) { compiler.add_node(NODE_EMISSION_WEIGHT, compiler.stack_assign(color_in), compiler.stack_assign(strength_in)); } else compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color*strength); compiler.add_node(NODE_CLOSURE_BACKGROUND, compiler.closure_mix_weight_offset()); } void BackgroundNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_background"); } void BackgroundNode::constant_fold(const ConstantFolder& folder) { ShaderInput *color_in = input("Color"); ShaderInput *strength_in = input("Strength"); if((!color_in->link && color == make_float3(0.0f, 0.0f, 0.0f)) || (!strength_in->link && strength == 0.0f)) { folder.discard(); } } /* Holdout Closure */ NODE_DEFINE(HoldoutNode) { NodeType* type = NodeType::add("holdout", create, NodeType::SHADER); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_IN_FLOAT(volume_mix_weight, "VolumeMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(holdout, "Holdout"); return type; } HoldoutNode::HoldoutNode() : ShaderNode(node_type) { } void HoldoutNode::compile(SVMCompiler& compiler) { float3 value = make_float3(1.0f, 1.0f, 1.0f); compiler.add_node(NODE_CLOSURE_SET_WEIGHT, value); compiler.add_node(NODE_CLOSURE_HOLDOUT, compiler.closure_mix_weight_offset()); } void HoldoutNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_holdout"); } /* Ambient Occlusion */ NODE_DEFINE(AmbientOcclusionNode) { NodeType* type = NodeType::add("ambient_occlusion", create, NodeType::SHADER); SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(AO, "AO"); return type; } AmbientOcclusionNode::AmbientOcclusionNode() : ShaderNode(node_type) { } void AmbientOcclusionNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); if(color_in->link) compiler.add_node(NODE_CLOSURE_WEIGHT, compiler.stack_assign(color_in)); else compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color); compiler.add_node(NODE_CLOSURE_AMBIENT_OCCLUSION, compiler.closure_mix_weight_offset()); } void AmbientOcclusionNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_ambient_occlusion"); } /* Volume Closure */ VolumeNode::VolumeNode(const NodeType *node_type) : ShaderNode(node_type) { closure = CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID; } void VolumeNode::compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2) { ShaderInput *color_in = input("Color"); if(color_in->link) compiler.add_node(NODE_CLOSURE_WEIGHT, compiler.stack_assign(color_in)); else compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color); compiler.add_node(NODE_CLOSURE_VOLUME, compiler.encode_uchar4(closure, (param1)? compiler.stack_assign(param1): SVM_STACK_INVALID, (param2)? compiler.stack_assign(param2): SVM_STACK_INVALID, compiler.closure_mix_weight_offset()), __float_as_int((param1)? get_float(param1->socket_type): 0.0f), __float_as_int((param2)? get_float(param2->socket_type): 0.0f)); } void VolumeNode::compile(SVMCompiler& compiler) { compile(compiler, NULL, NULL); } void VolumeNode::compile(OSLCompiler& /*compiler*/) { assert(0); } /* Absorption Volume Closure */ NODE_DEFINE(AbsorptionVolumeNode) { NodeType* type = NodeType::add("absorption_volume", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_FLOAT(density, "Density", 1.0f); SOCKET_IN_FLOAT(volume_mix_weight, "VolumeMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(volume, "Volume"); return type; } AbsorptionVolumeNode::AbsorptionVolumeNode() : VolumeNode(node_type) { closure = CLOSURE_VOLUME_ABSORPTION_ID; } void AbsorptionVolumeNode::compile(SVMCompiler& compiler) { VolumeNode::compile(compiler, input("Density"), NULL); } void AbsorptionVolumeNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_absorption_volume"); } /* Scatter Volume Closure */ NODE_DEFINE(ScatterVolumeNode) { NodeType* type = NodeType::add("scatter_volume", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_FLOAT(density, "Density", 1.0f); SOCKET_IN_FLOAT(anisotropy, "Anisotropy", 0.0f); SOCKET_IN_FLOAT(volume_mix_weight, "VolumeMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(volume, "Volume"); return type; } ScatterVolumeNode::ScatterVolumeNode() : VolumeNode(node_type) { closure = CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID; } void ScatterVolumeNode::compile(SVMCompiler& compiler) { VolumeNode::compile(compiler, input("Density"), input("Anisotropy")); } void ScatterVolumeNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_scatter_volume"); } /* Principled Volume Closure */ NODE_DEFINE(PrincipledVolumeNode) { NodeType* type = NodeType::add("principled_volume", create, NodeType::SHADER); SOCKET_IN_STRING(density_attribute, "Density Attribute", ustring()); SOCKET_IN_STRING(color_attribute, "Color Attribute", ustring()); SOCKET_IN_STRING(temperature_attribute, "Temperature Attribute", ustring()); SOCKET_IN_COLOR(color, "Color", make_float3(0.5f, 0.5f, 0.5f)); SOCKET_IN_FLOAT(density, "Density", 1.0f); SOCKET_IN_FLOAT(anisotropy, "Anisotropy", 0.0f); SOCKET_IN_COLOR(absorption_color, "Absorption Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_FLOAT(emission_strength, "Emission Strength", 0.0f); SOCKET_IN_COLOR(emission_color, "Emission Color", make_float3(1.0f, 1.0f, 1.0f)); SOCKET_IN_FLOAT(blackbody_intensity, "Blackbody Intensity", 0.0f); SOCKET_IN_COLOR(blackbody_tint, "Blackbody Tint", make_float3(1.0f, 1.0f, 1.0f)); SOCKET_IN_FLOAT(temperature, "Temperature", 1500.0f); SOCKET_IN_FLOAT(volume_mix_weight, "VolumeMixWeight", 0.0f, SocketType::SVM_INTERNAL); SOCKET_OUT_CLOSURE(volume, "Volume"); return type; } PrincipledVolumeNode::PrincipledVolumeNode() : VolumeNode(node_type) { closure = CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID; } void PrincipledVolumeNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_volume) { ShaderInput *density_in = input("Density"); ShaderInput *blackbody_in = input("Blackbody Intensity"); if(density_in->link || density > 0.0f) { attributes->add_standard(density_attribute); attributes->add_standard(color_attribute); } if(blackbody_in->link || blackbody_intensity > 0.0f) { attributes->add_standard(temperature_attribute); } attributes->add(ATTR_STD_GENERATED_TRANSFORM); } ShaderNode::attributes(shader, attributes); } void PrincipledVolumeNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); ShaderInput *density_in = input("Density"); ShaderInput *anisotropy_in = input("Anisotropy"); ShaderInput *absorption_color_in = input("Absorption Color"); ShaderInput *emission_in = input("Emission Strength"); ShaderInput *emission_color_in = input("Emission Color"); ShaderInput *blackbody_in = input("Blackbody Intensity"); ShaderInput *blackbody_tint_in = input("Blackbody Tint"); ShaderInput *temperature_in = input("Temperature"); if(color_in->link) compiler.add_node(NODE_CLOSURE_WEIGHT, compiler.stack_assign(color_in)); else compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color); compiler.add_node(NODE_PRINCIPLED_VOLUME, compiler.encode_uchar4( compiler.stack_assign_if_linked(density_in), compiler.stack_assign_if_linked(anisotropy_in), compiler.stack_assign(absorption_color_in), compiler.closure_mix_weight_offset()), compiler.encode_uchar4( compiler.stack_assign_if_linked(emission_in), compiler.stack_assign(emission_color_in), compiler.stack_assign_if_linked(blackbody_in), compiler.stack_assign(temperature_in)), compiler.stack_assign(blackbody_tint_in)); int attr_density = compiler.attribute_standard(density_attribute); int attr_color = compiler.attribute_standard(color_attribute); int attr_temperature = compiler.attribute_standard(temperature_attribute); compiler.add_node( __float_as_int(density), __float_as_int(anisotropy), __float_as_int(emission_strength), __float_as_int(blackbody_intensity)); compiler.add_node( attr_density, attr_color, attr_temperature); } void PrincipledVolumeNode::compile(OSLCompiler& compiler) { if(Attribute::name_standard(density_attribute.c_str())) { density_attribute = ustring("geom:" + density_attribute.string()); } if(Attribute::name_standard(color_attribute.c_str())) { color_attribute = ustring("geom:" + color_attribute.string()); } if(Attribute::name_standard(temperature_attribute.c_str())) { temperature_attribute = ustring("geom:" + temperature_attribute.string()); } compiler.add(this, "node_principled_volume"); } /* Hair BSDF Closure */ NODE_DEFINE(HairBsdfNode) { NodeType* type = NodeType::add("hair_bsdf", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL); static NodeEnum component_enum; component_enum.insert("reflection", CLOSURE_BSDF_HAIR_REFLECTION_ID); component_enum.insert("transmission", CLOSURE_BSDF_HAIR_TRANSMISSION_ID); SOCKET_ENUM(component, "Component", component_enum, CLOSURE_BSDF_HAIR_REFLECTION_ID); SOCKET_IN_FLOAT(offset, "Offset", 0.0f); SOCKET_IN_FLOAT(roughness_u, "RoughnessU", 0.2f); SOCKET_IN_FLOAT(roughness_v, "RoughnessV", 0.2f); SOCKET_IN_VECTOR(tangent, "Tangent", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_CLOSURE(BSDF, "BSDF"); return type; } HairBsdfNode::HairBsdfNode() : BsdfNode(node_type) { closure = CLOSURE_BSDF_HAIR_REFLECTION_ID; } void HairBsdfNode::compile(SVMCompiler& compiler) { closure = component; BsdfNode::compile(compiler, input("RoughnessU"), input("RoughnessV"), input("Offset")); } void HairBsdfNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "component"); compiler.add(this, "node_hair_bsdf"); } /* Geometry */ NODE_DEFINE(GeometryNode) { NodeType* type = NodeType::add("geometry", create, NodeType::SHADER); SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL); SOCKET_OUT_POINT(position, "Position"); SOCKET_OUT_NORMAL(normal, "Normal"); SOCKET_OUT_NORMAL(tangent, "Tangent"); SOCKET_OUT_NORMAL(true_normal, "True Normal"); SOCKET_OUT_VECTOR(incoming, "Incoming"); SOCKET_OUT_POINT(parametric, "Parametric"); SOCKET_OUT_FLOAT(backfacing, "Backfacing"); SOCKET_OUT_FLOAT(pointiness, "Pointiness"); return type; } GeometryNode::GeometryNode() : ShaderNode(node_type) { special_type = SHADER_SPECIAL_TYPE_GEOMETRY; } void GeometryNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { if(!output("Tangent")->links.empty()) { attributes->add(ATTR_STD_GENERATED); } if(!output("Pointiness")->links.empty()) { attributes->add(ATTR_STD_POINTINESS); } } ShaderNode::attributes(shader, attributes); } void GeometryNode::compile(SVMCompiler& compiler) { ShaderOutput *out; ShaderNodeType geom_node = NODE_GEOMETRY; ShaderNodeType attr_node = NODE_ATTR; if(bump == SHADER_BUMP_DX) { geom_node = NODE_GEOMETRY_BUMP_DX; attr_node = NODE_ATTR_BUMP_DX; } else if(bump == SHADER_BUMP_DY) { geom_node = NODE_GEOMETRY_BUMP_DY; attr_node = NODE_ATTR_BUMP_DY; } out = output("Position"); if(!out->links.empty()) { compiler.add_node(geom_node, NODE_GEOM_P, compiler.stack_assign(out)); } out = output("Normal"); if(!out->links.empty()) { compiler.add_node(geom_node, NODE_GEOM_N, compiler.stack_assign(out)); } out = output("Tangent"); if(!out->links.empty()) { compiler.add_node(geom_node, NODE_GEOM_T, compiler.stack_assign(out)); } out = output("True Normal"); if(!out->links.empty()) { compiler.add_node(geom_node, NODE_GEOM_Ng, compiler.stack_assign(out)); } out = output("Incoming"); if(!out->links.empty()) { compiler.add_node(geom_node, NODE_GEOM_I, compiler.stack_assign(out)); } out = output("Parametric"); if(!out->links.empty()) { compiler.add_node(geom_node, NODE_GEOM_uv, compiler.stack_assign(out)); } out = output("Backfacing"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_backfacing, compiler.stack_assign(out)); } out = output("Pointiness"); if(!out->links.empty()) { if(compiler.output_type() != SHADER_TYPE_VOLUME) { compiler.add_node(attr_node, ATTR_STD_POINTINESS, compiler.stack_assign(out), NODE_ATTR_FLOAT); } else { compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), compiler.stack_assign(out)); } } } void GeometryNode::compile(OSLCompiler& compiler) { if(bump == SHADER_BUMP_DX) compiler.parameter("bump_offset", "dx"); else if(bump == SHADER_BUMP_DY) compiler.parameter("bump_offset", "dy"); else compiler.parameter("bump_offset", "center"); compiler.add(this, "node_geometry"); } /* TextureCoordinate */ NODE_DEFINE(TextureCoordinateNode) { NodeType* type = NodeType::add("texture_coordinate", create, NodeType::SHADER); SOCKET_BOOLEAN(from_dupli, "From Dupli", false); SOCKET_BOOLEAN(use_transform, "Use Transform", false); SOCKET_TRANSFORM(ob_tfm, "Object Transform", transform_identity()); SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL); SOCKET_OUT_POINT(generated, "Generated"); SOCKET_OUT_NORMAL(normal, "Normal"); SOCKET_OUT_POINT(UV, "UV"); SOCKET_OUT_POINT(object, "Object"); SOCKET_OUT_POINT(camera, "Camera"); SOCKET_OUT_POINT(window, "Window"); SOCKET_OUT_NORMAL(reflection, "Reflection"); return type; } TextureCoordinateNode::TextureCoordinateNode() : ShaderNode(node_type) { } void TextureCoordinateNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { if(!from_dupli) { if(!output("Generated")->links.empty()) attributes->add(ATTR_STD_GENERATED); if(!output("UV")->links.empty()) attributes->add(ATTR_STD_UV); } } if(shader->has_volume) { if(!from_dupli) { if(!output("Generated")->links.empty()) { attributes->add(ATTR_STD_GENERATED_TRANSFORM); } } } ShaderNode::attributes(shader, attributes); } void TextureCoordinateNode::compile(SVMCompiler& compiler) { ShaderOutput *out; ShaderNodeType texco_node = NODE_TEX_COORD; ShaderNodeType attr_node = NODE_ATTR; ShaderNodeType geom_node = NODE_GEOMETRY; if(bump == SHADER_BUMP_DX) { texco_node = NODE_TEX_COORD_BUMP_DX; attr_node = NODE_ATTR_BUMP_DX; geom_node = NODE_GEOMETRY_BUMP_DX; } else if(bump == SHADER_BUMP_DY) { texco_node = NODE_TEX_COORD_BUMP_DY; attr_node = NODE_ATTR_BUMP_DY; geom_node = NODE_GEOMETRY_BUMP_DY; } out = output("Generated"); if(!out->links.empty()) { if(compiler.background) { compiler.add_node(geom_node, NODE_GEOM_P, compiler.stack_assign(out)); } else { if(from_dupli) { compiler.add_node(texco_node, NODE_TEXCO_DUPLI_GENERATED, compiler.stack_assign(out)); } else if(compiler.output_type() == SHADER_TYPE_VOLUME) { compiler.add_node(texco_node, NODE_TEXCO_VOLUME_GENERATED, compiler.stack_assign(out)); } else { int attr = compiler.attribute(ATTR_STD_GENERATED); compiler.add_node(attr_node, attr, compiler.stack_assign(out), NODE_ATTR_FLOAT3); } } } out = output("Normal"); if(!out->links.empty()) { compiler.add_node(texco_node, NODE_TEXCO_NORMAL, compiler.stack_assign(out)); } out = output("UV"); if(!out->links.empty()) { if(from_dupli) { compiler.add_node(texco_node, NODE_TEXCO_DUPLI_UV, compiler.stack_assign(out)); } else { int attr = compiler.attribute(ATTR_STD_UV); compiler.add_node(attr_node, attr, compiler.stack_assign(out), NODE_ATTR_FLOAT3); } } out = output("Object"); if(!out->links.empty()) { compiler.add_node(texco_node, NODE_TEXCO_OBJECT, compiler.stack_assign(out), use_transform); if(use_transform) { Transform ob_itfm = transform_inverse(ob_tfm); compiler.add_node(ob_itfm.x); compiler.add_node(ob_itfm.y); compiler.add_node(ob_itfm.z); compiler.add_node(ob_itfm.w); } } out = output("Camera"); if(!out->links.empty()) { compiler.add_node(texco_node, NODE_TEXCO_CAMERA, compiler.stack_assign(out)); } out = output("Window"); if(!out->links.empty()) { compiler.add_node(texco_node, NODE_TEXCO_WINDOW, compiler.stack_assign(out)); } out = output("Reflection"); if(!out->links.empty()) { if(compiler.background) { compiler.add_node(geom_node, NODE_GEOM_I, compiler.stack_assign(out)); } else { compiler.add_node(texco_node, NODE_TEXCO_REFLECTION, compiler.stack_assign(out)); } } } void TextureCoordinateNode::compile(OSLCompiler& compiler) { if(bump == SHADER_BUMP_DX) compiler.parameter("bump_offset", "dx"); else if(bump == SHADER_BUMP_DY) compiler.parameter("bump_offset", "dy"); else compiler.parameter("bump_offset", "center"); if(compiler.background) compiler.parameter("is_background", true); if(compiler.output_type() == SHADER_TYPE_VOLUME) compiler.parameter("is_volume", true); compiler.parameter(this, "use_transform"); Transform ob_itfm = transform_transpose(transform_inverse(ob_tfm)); compiler.parameter("object_itfm", ob_itfm); compiler.parameter(this, "from_dupli"); compiler.add(this, "node_texture_coordinate"); } /* UV Map */ NODE_DEFINE(UVMapNode) { NodeType* type = NodeType::add("uvmap", create, NodeType::SHADER); SOCKET_STRING(attribute, "attribute", ustring()); SOCKET_IN_BOOLEAN(from_dupli, "from dupli", false); SOCKET_OUT_POINT(UV, "UV"); return type; } UVMapNode::UVMapNode() : ShaderNode(node_type) { } void UVMapNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { if(!from_dupli) { if(!output("UV")->links.empty()) { if(attribute != "") attributes->add(attribute); else attributes->add(ATTR_STD_UV); } } } ShaderNode::attributes(shader, attributes); } void UVMapNode::compile(SVMCompiler& compiler) { ShaderOutput *out = output("UV"); ShaderNodeType texco_node = NODE_TEX_COORD; ShaderNodeType attr_node = NODE_ATTR; int attr; if(bump == SHADER_BUMP_DX) { texco_node = NODE_TEX_COORD_BUMP_DX; attr_node = NODE_ATTR_BUMP_DX; } else if(bump == SHADER_BUMP_DY) { texco_node = NODE_TEX_COORD_BUMP_DY; attr_node = NODE_ATTR_BUMP_DY; } if(!out->links.empty()) { if(from_dupli) { compiler.add_node(texco_node, NODE_TEXCO_DUPLI_UV, compiler.stack_assign(out)); } else { if(attribute != "") attr = compiler.attribute(attribute); else attr = compiler.attribute(ATTR_STD_UV); compiler.add_node(attr_node, attr, compiler.stack_assign(out), NODE_ATTR_FLOAT3); } } } void UVMapNode::compile(OSLCompiler& compiler) { if(bump == SHADER_BUMP_DX) compiler.parameter("bump_offset", "dx"); else if(bump == SHADER_BUMP_DY) compiler.parameter("bump_offset", "dy"); else compiler.parameter("bump_offset", "center"); compiler.parameter(this, "from_dupli"); compiler.parameter(this, "attribute"); compiler.add(this, "node_uv_map"); } /* Light Path */ NODE_DEFINE(LightPathNode) { NodeType* type = NodeType::add("light_path", create, NodeType::SHADER); SOCKET_OUT_FLOAT(is_camera_ray, "Is Camera Ray"); SOCKET_OUT_FLOAT(is_shadow_ray, "Is Shadow Ray"); SOCKET_OUT_FLOAT(is_diffuse_ray, "Is Diffuse Ray"); SOCKET_OUT_FLOAT(is_glossy_ray, "Is Glossy Ray"); SOCKET_OUT_FLOAT(is_singular_ray, "Is Singular Ray"); SOCKET_OUT_FLOAT(is_reflection_ray, "Is Reflection Ray"); SOCKET_OUT_FLOAT(is_transmission_ray, "Is Transmission Ray"); SOCKET_OUT_FLOAT(is_volume_scatter_ray, "Is Volume Scatter Ray"); SOCKET_OUT_FLOAT(ray_length, "Ray Length"); SOCKET_OUT_FLOAT(ray_depth, "Ray Depth"); SOCKET_OUT_FLOAT(diffuse_depth, "Diffuse Depth"); SOCKET_OUT_FLOAT(glossy_depth, "Glossy Depth"); SOCKET_OUT_FLOAT(transparent_depth, "Transparent Depth"); SOCKET_OUT_FLOAT(transmission_depth, "Transmission Depth"); return type; } LightPathNode::LightPathNode() : ShaderNode(node_type) { } void LightPathNode::compile(SVMCompiler& compiler) { ShaderOutput *out; out = output("Is Camera Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_camera, compiler.stack_assign(out)); } out = output("Is Shadow Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_shadow, compiler.stack_assign(out)); } out = output("Is Diffuse Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_diffuse, compiler.stack_assign(out)); } out = output("Is Glossy Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_glossy, compiler.stack_assign(out)); } out = output("Is Singular Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_singular, compiler.stack_assign(out)); } out = output("Is Reflection Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_reflection, compiler.stack_assign(out)); } out = output("Is Transmission Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_transmission, compiler.stack_assign(out)); } out = output("Is Volume Scatter Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_volume_scatter, compiler.stack_assign(out)); } out = output("Ray Length"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_length, compiler.stack_assign(out)); } out = output("Ray Depth"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_depth, compiler.stack_assign(out)); } out = output("Diffuse Depth"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_diffuse, compiler.stack_assign(out)); } out = output("Glossy Depth"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_glossy, compiler.stack_assign(out)); } out = output("Transparent Depth"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_transparent, compiler.stack_assign(out)); } out = output("Transmission Depth"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_transmission, compiler.stack_assign(out)); } } void LightPathNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_light_path"); } /* Light Falloff */ NODE_DEFINE(LightFalloffNode) { NodeType* type = NodeType::add("light_fallof", create, NodeType::SHADER); SOCKET_IN_FLOAT(strength, "Strength", 100.0f); SOCKET_IN_FLOAT(smooth, "Smooth", 0.0f); SOCKET_OUT_FLOAT(quadratic, "Quadratic"); SOCKET_OUT_FLOAT(linear, "Linear"); SOCKET_OUT_FLOAT(constant, "Constant"); return type; } LightFalloffNode::LightFalloffNode() : ShaderNode(node_type) { } void LightFalloffNode::compile(SVMCompiler& compiler) { ShaderInput *strength_in = input("Strength"); ShaderInput *smooth_in = input("Smooth"); ShaderOutput *out = output("Quadratic"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_FALLOFF, NODE_LIGHT_FALLOFF_QUADRATIC, compiler.encode_uchar4( compiler.stack_assign(strength_in), compiler.stack_assign(smooth_in), compiler.stack_assign(out))); } out = output("Linear"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_FALLOFF, NODE_LIGHT_FALLOFF_LINEAR, compiler.encode_uchar4( compiler.stack_assign(strength_in), compiler.stack_assign(smooth_in), compiler.stack_assign(out))); } out = output("Constant"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_FALLOFF, NODE_LIGHT_FALLOFF_CONSTANT, compiler.encode_uchar4( compiler.stack_assign(strength_in), compiler.stack_assign(smooth_in), compiler.stack_assign(out))); } } void LightFalloffNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_light_falloff"); } /* Object Info */ NODE_DEFINE(ObjectInfoNode) { NodeType* type = NodeType::add("object_info", create, NodeType::SHADER); SOCKET_OUT_VECTOR(location, "Location"); SOCKET_OUT_FLOAT(object_index, "Object Index"); SOCKET_OUT_FLOAT(material_index, "Material Index"); SOCKET_OUT_FLOAT(random, "Random"); return type; } ObjectInfoNode::ObjectInfoNode() : ShaderNode(node_type) { } void ObjectInfoNode::compile(SVMCompiler& compiler) { ShaderOutput *out = output("Location"); if(!out->links.empty()) { compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_OB_LOCATION, compiler.stack_assign(out)); } out = output("Object Index"); if(!out->links.empty()) { compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_OB_INDEX, compiler.stack_assign(out)); } out = output("Material Index"); if(!out->links.empty()) { compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_MAT_INDEX, compiler.stack_assign(out)); } out = output("Random"); if(!out->links.empty()) { compiler.add_node(NODE_OBJECT_INFO, NODE_INFO_OB_RANDOM, compiler.stack_assign(out)); } } void ObjectInfoNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_object_info"); } /* Particle Info */ NODE_DEFINE(ParticleInfoNode) { NodeType* type = NodeType::add("particle_info", create, NodeType::SHADER); SOCKET_OUT_FLOAT(index, "Index"); SOCKET_OUT_FLOAT(random, "Random"); SOCKET_OUT_FLOAT(age, "Age"); SOCKET_OUT_FLOAT(lifetime, "Lifetime"); SOCKET_OUT_POINT(location, "Location"); #if 0 /* not yet supported */ SOCKET_OUT_QUATERNION(rotation, "Rotation"); #endif SOCKET_OUT_FLOAT(size, "Size"); SOCKET_OUT_VECTOR(velocity, "Velocity"); SOCKET_OUT_VECTOR(angular_velocity, "Angular Velocity"); return type; } ParticleInfoNode::ParticleInfoNode() : ShaderNode(node_type) { } void ParticleInfoNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(!output("Index")->links.empty()) attributes->add(ATTR_STD_PARTICLE); if(!output("Random")->links.empty()) attributes->add(ATTR_STD_PARTICLE); if(!output("Age")->links.empty()) attributes->add(ATTR_STD_PARTICLE); if(!output("Lifetime")->links.empty()) attributes->add(ATTR_STD_PARTICLE); if(!output("Location")->links.empty()) attributes->add(ATTR_STD_PARTICLE); #if 0 /* not yet supported */ if(!output("Rotation")->links.empty()) attributes->add(ATTR_STD_PARTICLE); #endif if(!output("Size")->links.empty()) attributes->add(ATTR_STD_PARTICLE); if(!output("Velocity")->links.empty()) attributes->add(ATTR_STD_PARTICLE); if(!output("Angular Velocity")->links.empty()) attributes->add(ATTR_STD_PARTICLE); ShaderNode::attributes(shader, attributes); } void ParticleInfoNode::compile(SVMCompiler& compiler) { ShaderOutput *out; out = output("Index"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_INDEX, compiler.stack_assign(out)); } out = output("Random"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_RANDOM, compiler.stack_assign(out)); } out = output("Age"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_AGE, compiler.stack_assign(out)); } out = output("Lifetime"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_LIFETIME, compiler.stack_assign(out)); } out = output("Location"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_LOCATION, compiler.stack_assign(out)); } /* quaternion data is not yet supported by Cycles */ #if 0 out = output("Rotation"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_ROTATION, compiler.stack_assign(out)); } #endif out = output("Size"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_SIZE, compiler.stack_assign(out)); } out = output("Velocity"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_VELOCITY, compiler.stack_assign(out)); } out = output("Angular Velocity"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_ANGULAR_VELOCITY, compiler.stack_assign(out)); } } void ParticleInfoNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_particle_info"); } /* Hair Info */ NODE_DEFINE(HairInfoNode) { NodeType* type = NodeType::add("hair_info", create, NodeType::SHADER); SOCKET_OUT_FLOAT(is_strand, "Is Strand"); SOCKET_OUT_FLOAT(intercept, "Intercept"); SOCKET_OUT_FLOAT(thickness, "Thickness"); SOCKET_OUT_NORMAL(tangent_normal, "Tangent Normal"); #if 0 /*output for minimum hair width transparency - deactivated */ SOCKET_OUT_FLOAT(fade, "Fade"); #endif SOCKET_OUT_FLOAT(index, "Random"); return type; } HairInfoNode::HairInfoNode() : ShaderNode(node_type) { } void HairInfoNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { ShaderOutput *intercept_out = output("Intercept"); if(!intercept_out->links.empty()) attributes->add(ATTR_STD_CURVE_INTERCEPT); if(!output("Random")->links.empty()) attributes->add(ATTR_STD_CURVE_RANDOM); } ShaderNode::attributes(shader, attributes); } void HairInfoNode::compile(SVMCompiler& compiler) { ShaderOutput *out; out = output("Is Strand"); if(!out->links.empty()) { compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_IS_STRAND, compiler.stack_assign(out)); } out = output("Intercept"); if(!out->links.empty()) { int attr = compiler.attribute(ATTR_STD_CURVE_INTERCEPT); compiler.add_node(NODE_ATTR, attr, compiler.stack_assign(out), NODE_ATTR_FLOAT); } out = output("Thickness"); if(!out->links.empty()) { compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_THICKNESS, compiler.stack_assign(out)); } out = output("Tangent Normal"); if(!out->links.empty()) { compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_TANGENT_NORMAL, compiler.stack_assign(out)); } /*out = output("Fade"); if(!out->links.empty()) { compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_FADE, compiler.stack_assign(out)); }*/ out = output("Random"); if(!out->links.empty()) { int attr = compiler.attribute(ATTR_STD_CURVE_RANDOM); compiler.add_node(NODE_ATTR, attr, compiler.stack_assign(out), NODE_ATTR_FLOAT); } } void HairInfoNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_hair_info"); } /* Value */ NODE_DEFINE(ValueNode) { NodeType* type = NodeType::add("value", create, NodeType::SHADER); SOCKET_FLOAT(value, "Value", 0.0f); SOCKET_OUT_FLOAT(value, "Value"); return type; } ValueNode::ValueNode() : ShaderNode(node_type) { } void ValueNode::constant_fold(const ConstantFolder& folder) { folder.make_constant(value); } void ValueNode::compile(SVMCompiler& compiler) { ShaderOutput *val_out = output("Value"); compiler.add_node(NODE_VALUE_F, __float_as_int(value), compiler.stack_assign(val_out)); } void ValueNode::compile(OSLCompiler& compiler) { compiler.parameter("value_value", value); compiler.add(this, "node_value"); } /* Color */ NODE_DEFINE(ColorNode) { NodeType* type = NodeType::add("color", create, NodeType::SHADER); SOCKET_COLOR(value, "Value", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_COLOR(color, "Color"); return type; } ColorNode::ColorNode() : ShaderNode(node_type) { } void ColorNode::constant_fold(const ConstantFolder& folder) { folder.make_constant(value); } void ColorNode::compile(SVMCompiler& compiler) { ShaderOutput *color_out = output("Color"); if(!color_out->links.empty()) { compiler.add_node(NODE_VALUE_V, compiler.stack_assign(color_out)); compiler.add_node(NODE_VALUE_V, value); } } void ColorNode::compile(OSLCompiler& compiler) { compiler.parameter_color("color_value", value); compiler.add(this, "node_value"); } /* Add Closure */ NODE_DEFINE(AddClosureNode) { NodeType* type = NodeType::add("add_closure", create, NodeType::SHADER); SOCKET_IN_CLOSURE(closure1, "Closure1"); SOCKET_IN_CLOSURE(closure2, "Closure2"); SOCKET_OUT_CLOSURE(closure, "Closure"); return type; } AddClosureNode::AddClosureNode() : ShaderNode(node_type) { special_type = SHADER_SPECIAL_TYPE_COMBINE_CLOSURE; } void AddClosureNode::compile(SVMCompiler& /*compiler*/) { /* handled in the SVM compiler */ } void AddClosureNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_add_closure"); } void AddClosureNode::constant_fold(const ConstantFolder& folder) { ShaderInput *closure1_in = input("Closure1"); ShaderInput *closure2_in = input("Closure2"); /* remove useless add closures nodes */ if(!closure1_in->link) { folder.bypass_or_discard(closure2_in); } else if(!closure2_in->link) { folder.bypass_or_discard(closure1_in); } } /* Mix Closure */ NODE_DEFINE(MixClosureNode) { NodeType* type = NodeType::add("mix_closure", create, NodeType::SHADER); SOCKET_IN_FLOAT(fac, "Fac", 0.5f); SOCKET_IN_CLOSURE(closure1, "Closure1"); SOCKET_IN_CLOSURE(closure2, "Closure2"); SOCKET_OUT_CLOSURE(closure, "Closure"); return type; } MixClosureNode::MixClosureNode() : ShaderNode(node_type) { special_type = SHADER_SPECIAL_TYPE_COMBINE_CLOSURE; } void MixClosureNode::compile(SVMCompiler& /*compiler*/) { /* handled in the SVM compiler */ } void MixClosureNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_mix_closure"); } void MixClosureNode::constant_fold(const ConstantFolder& folder) { ShaderInput *fac_in = input("Fac"); ShaderInput *closure1_in = input("Closure1"); ShaderInput *closure2_in = input("Closure2"); /* remove useless mix closures nodes */ if(closure1_in->link == closure2_in->link) { folder.bypass_or_discard(closure1_in); } /* remove unused mix closure input when factor is 0.0 or 1.0 * check for closure links and make sure factor link is disconnected */ else if(!fac_in->link) { /* factor 0.0 */ if(fac <= 0.0f) { folder.bypass_or_discard(closure1_in); } /* factor 1.0 */ else if(fac >= 1.0f) { folder.bypass_or_discard(closure2_in); } } } /* Mix Closure */ NODE_DEFINE(MixClosureWeightNode) { NodeType* type = NodeType::add("mix_closure_weight", create, NodeType::SHADER); SOCKET_IN_FLOAT(weight, "Weight", 1.0f); SOCKET_IN_FLOAT(fac, "Fac", 1.0f); SOCKET_OUT_FLOAT(weight1, "Weight1"); SOCKET_OUT_FLOAT(weight2, "Weight2"); return type; } MixClosureWeightNode::MixClosureWeightNode() : ShaderNode(node_type) { } void MixClosureWeightNode::compile(SVMCompiler& compiler) { ShaderInput *weight_in = input("Weight"); ShaderInput *fac_in = input("Fac"); ShaderOutput *weight1_out = output("Weight1"); ShaderOutput *weight2_out = output("Weight2"); compiler.add_node(NODE_MIX_CLOSURE, compiler.encode_uchar4( compiler.stack_assign(fac_in), compiler.stack_assign(weight_in), compiler.stack_assign(weight1_out), compiler.stack_assign(weight2_out))); } void MixClosureWeightNode::compile(OSLCompiler& /*compiler*/) { assert(0); } /* Invert */ NODE_DEFINE(InvertNode) { NodeType* type = NodeType::add("invert", create, NodeType::SHADER); SOCKET_IN_FLOAT(fac, "Fac", 1.0f); SOCKET_IN_COLOR(color, "Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_COLOR(color, "Color"); return type; } InvertNode::InvertNode() : ShaderNode(node_type) { } void InvertNode::constant_fold(const ConstantFolder& folder) { ShaderInput *fac_in = input("Fac"); ShaderInput *color_in = input("Color"); if(!fac_in->link) { /* evaluate fully constant node */ if(!color_in->link) { folder.make_constant(interp(color, make_float3(1.0f, 1.0f, 1.0f) - color, fac)); } /* remove no-op node */ else if(fac == 0.0f) { folder.bypass(color_in->link); } } } void InvertNode::compile(SVMCompiler& compiler) { ShaderInput *fac_in = input("Fac"); ShaderInput *color_in = input("Color"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_INVERT, compiler.stack_assign(fac_in), compiler.stack_assign(color_in), compiler.stack_assign(color_out)); } void InvertNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_invert"); } /* Mix */ NODE_DEFINE(MixNode) { NodeType* type = NodeType::add("mix", create, NodeType::SHADER); static NodeEnum type_enum; type_enum.insert("mix", NODE_MIX_BLEND); type_enum.insert("add", NODE_MIX_ADD); type_enum.insert("multiply", NODE_MIX_MUL); type_enum.insert("screen", NODE_MIX_SCREEN); type_enum.insert("overlay", NODE_MIX_OVERLAY); type_enum.insert("subtract", NODE_MIX_SUB); type_enum.insert("divide", NODE_MIX_DIV); type_enum.insert("difference", NODE_MIX_DIFF); type_enum.insert("darken", NODE_MIX_DARK); type_enum.insert("lighten", NODE_MIX_LIGHT); type_enum.insert("dodge", NODE_MIX_DODGE); type_enum.insert("burn", NODE_MIX_BURN); type_enum.insert("hue", NODE_MIX_HUE); type_enum.insert("saturation", NODE_MIX_SAT); type_enum.insert("value", NODE_MIX_VAL); type_enum.insert("color", NODE_MIX_COLOR); type_enum.insert("soft_light", NODE_MIX_SOFT); type_enum.insert("linear_light", NODE_MIX_LINEAR); SOCKET_ENUM(type, "Type", type_enum, NODE_MIX_BLEND); SOCKET_BOOLEAN(use_clamp, "Use Clamp", false); SOCKET_IN_FLOAT(fac, "Fac", 0.5f); SOCKET_IN_COLOR(color1, "Color1", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_COLOR(color2, "Color2", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_COLOR(color, "Color"); return type; } MixNode::MixNode() : ShaderNode(node_type) { } void MixNode::compile(SVMCompiler& compiler) { ShaderInput *fac_in = input("Fac"); ShaderInput *color1_in = input("Color1"); ShaderInput *color2_in = input("Color2"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_MIX, compiler.stack_assign(fac_in), compiler.stack_assign(color1_in), compiler.stack_assign(color2_in)); compiler.add_node(NODE_MIX, type, compiler.stack_assign(color_out)); if(use_clamp) { compiler.add_node(NODE_MIX, 0, compiler.stack_assign(color_out)); compiler.add_node(NODE_MIX, NODE_MIX_CLAMP, compiler.stack_assign(color_out)); } } void MixNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "type"); compiler.parameter(this, "use_clamp"); compiler.add(this, "node_mix"); } void MixNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant_clamp(svm_mix(type, fac, color1, color2), use_clamp); } else { folder.fold_mix(type, use_clamp); } } /* Combine RGB */ NODE_DEFINE(CombineRGBNode) { NodeType* type = NodeType::add("combine_rgb", create, NodeType::SHADER); SOCKET_IN_FLOAT(r, "R", 0.0f); SOCKET_IN_FLOAT(g, "G", 0.0f); SOCKET_IN_FLOAT(b, "B", 0.0f); SOCKET_OUT_COLOR(image, "Image"); return type; } CombineRGBNode::CombineRGBNode() : ShaderNode(node_type) { } void CombineRGBNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant(make_float3(r, g, b)); } } void CombineRGBNode::compile(SVMCompiler& compiler) { ShaderInput *red_in = input("R"); ShaderInput *green_in = input("G"); ShaderInput *blue_in = input("B"); ShaderOutput *color_out = output("Image"); compiler.add_node(NODE_COMBINE_VECTOR, compiler.stack_assign(red_in), 0, compiler.stack_assign(color_out)); compiler.add_node(NODE_COMBINE_VECTOR, compiler.stack_assign(green_in), 1, compiler.stack_assign(color_out)); compiler.add_node(NODE_COMBINE_VECTOR, compiler.stack_assign(blue_in), 2, compiler.stack_assign(color_out)); } void CombineRGBNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_combine_rgb"); } /* Combine XYZ */ NODE_DEFINE(CombineXYZNode) { NodeType* type = NodeType::add("combine_xyz", create, NodeType::SHADER); SOCKET_IN_FLOAT(x, "X", 0.0f); SOCKET_IN_FLOAT(y, "Y", 0.0f); SOCKET_IN_FLOAT(z, "Z", 0.0f); SOCKET_OUT_VECTOR(vector, "Vector"); return type; } CombineXYZNode::CombineXYZNode() : ShaderNode(node_type) { } void CombineXYZNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant(make_float3(x, y, z)); } } void CombineXYZNode::compile(SVMCompiler& compiler) { ShaderInput *x_in = input("X"); ShaderInput *y_in = input("Y"); ShaderInput *z_in = input("Z"); ShaderOutput *vector_out = output("Vector"); compiler.add_node(NODE_COMBINE_VECTOR, compiler.stack_assign(x_in), 0, compiler.stack_assign(vector_out)); compiler.add_node(NODE_COMBINE_VECTOR, compiler.stack_assign(y_in), 1, compiler.stack_assign(vector_out)); compiler.add_node(NODE_COMBINE_VECTOR, compiler.stack_assign(z_in), 2, compiler.stack_assign(vector_out)); } void CombineXYZNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_combine_xyz"); } /* Combine HSV */ NODE_DEFINE(CombineHSVNode) { NodeType* type = NodeType::add("combine_hsv", create, NodeType::SHADER); SOCKET_IN_FLOAT(h, "H", 0.0f); SOCKET_IN_FLOAT(s, "S", 0.0f); SOCKET_IN_FLOAT(v, "V", 0.0f); SOCKET_OUT_COLOR(color, "Color"); return type; } CombineHSVNode::CombineHSVNode() : ShaderNode(node_type) { } void CombineHSVNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant(hsv_to_rgb(make_float3(h, s, v))); } } void CombineHSVNode::compile(SVMCompiler& compiler) { ShaderInput *hue_in = input("H"); ShaderInput *saturation_in = input("S"); ShaderInput *value_in = input("V"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_COMBINE_HSV, compiler.stack_assign(hue_in), compiler.stack_assign(saturation_in), compiler.stack_assign(value_in)); compiler.add_node(NODE_COMBINE_HSV, compiler.stack_assign(color_out)); } void CombineHSVNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_combine_hsv"); } /* Gamma */ NODE_DEFINE(GammaNode) { NodeType* type = NodeType::add("gamma", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_FLOAT(gamma, "Gamma", 1.0f); SOCKET_OUT_COLOR(color, "Color"); return type; } GammaNode::GammaNode() : ShaderNode(node_type) { } void GammaNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant(svm_math_gamma_color(color, gamma)); } else { ShaderInput *color_in = input("Color"); ShaderInput *gamma_in = input("Gamma"); /* 1 ^ X == X ^ 0 == 1 */ if(folder.is_one(color_in) || folder.is_zero(gamma_in)) { folder.make_one(); } /* X ^ 1 == X */ else if(folder.is_one(gamma_in)) { folder.try_bypass_or_make_constant(color_in, false); } } } void GammaNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); ShaderInput *gamma_in = input("Gamma"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_GAMMA, compiler.stack_assign(gamma_in), compiler.stack_assign(color_in), compiler.stack_assign(color_out)); } void GammaNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_gamma"); } /* Bright Contrast */ NODE_DEFINE(BrightContrastNode) { NodeType* type = NodeType::add("brightness_contrast", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_FLOAT(bright, "Bright", 0.0f); SOCKET_IN_FLOAT(contrast, "Contrast", 0.0f); SOCKET_OUT_COLOR(color, "Color"); return type; } BrightContrastNode::BrightContrastNode() : ShaderNode(node_type) { } void BrightContrastNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant(svm_brightness_contrast(color, bright, contrast)); } } void BrightContrastNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); ShaderInput *bright_in = input("Bright"); ShaderInput *contrast_in = input("Contrast"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_BRIGHTCONTRAST, compiler.stack_assign(color_in), compiler.stack_assign(color_out), compiler.encode_uchar4( compiler.stack_assign(bright_in), compiler.stack_assign(contrast_in))); } void BrightContrastNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_brightness"); } /* Separate RGB */ NODE_DEFINE(SeparateRGBNode) { NodeType* type = NodeType::add("separate_rgb", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Image", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_FLOAT(r, "R"); SOCKET_OUT_FLOAT(g, "G"); SOCKET_OUT_FLOAT(b, "B"); return type; } SeparateRGBNode::SeparateRGBNode() : ShaderNode(node_type) { } void SeparateRGBNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { for(int channel = 0; channel < 3; channel++) { if(outputs[channel] == folder.output) { folder.make_constant(color[channel]); return; } } } } void SeparateRGBNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Image"); ShaderOutput *red_out = output("R"); ShaderOutput *green_out = output("G"); ShaderOutput *blue_out = output("B"); compiler.add_node(NODE_SEPARATE_VECTOR, compiler.stack_assign(color_in), 0, compiler.stack_assign(red_out)); compiler.add_node(NODE_SEPARATE_VECTOR, compiler.stack_assign(color_in), 1, compiler.stack_assign(green_out)); compiler.add_node(NODE_SEPARATE_VECTOR, compiler.stack_assign(color_in), 2, compiler.stack_assign(blue_out)); } void SeparateRGBNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_separate_rgb"); } /* Separate XYZ */ NODE_DEFINE(SeparateXYZNode) { NodeType* type = NodeType::add("separate_xyz", create, NodeType::SHADER); SOCKET_IN_COLOR(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_FLOAT(x, "X"); SOCKET_OUT_FLOAT(y, "Y"); SOCKET_OUT_FLOAT(z, "Z"); return type; } SeparateXYZNode::SeparateXYZNode() : ShaderNode(node_type) { } void SeparateXYZNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { for(int channel = 0; channel < 3; channel++) { if(outputs[channel] == folder.output) { folder.make_constant(vector[channel]); return; } } } } void SeparateXYZNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *x_out = output("X"); ShaderOutput *y_out = output("Y"); ShaderOutput *z_out = output("Z"); compiler.add_node(NODE_SEPARATE_VECTOR, compiler.stack_assign(vector_in), 0, compiler.stack_assign(x_out)); compiler.add_node(NODE_SEPARATE_VECTOR, compiler.stack_assign(vector_in), 1, compiler.stack_assign(y_out)); compiler.add_node(NODE_SEPARATE_VECTOR, compiler.stack_assign(vector_in), 2, compiler.stack_assign(z_out)); } void SeparateXYZNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_separate_xyz"); } /* Separate HSV */ NODE_DEFINE(SeparateHSVNode) { NodeType* type = NodeType::add("separate_hsv", create, NodeType::SHADER); SOCKET_IN_COLOR(color, "Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_FLOAT(h, "H"); SOCKET_OUT_FLOAT(s, "S"); SOCKET_OUT_FLOAT(v, "V"); return type; } SeparateHSVNode::SeparateHSVNode() : ShaderNode(node_type) { } void SeparateHSVNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { float3 hsv = rgb_to_hsv(color); for(int channel = 0; channel < 3; channel++) { if(outputs[channel] == folder.output) { folder.make_constant(hsv[channel]); return; } } } } void SeparateHSVNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); ShaderOutput *hue_out = output("H"); ShaderOutput *saturation_out = output("S"); ShaderOutput *value_out = output("V"); compiler.add_node(NODE_SEPARATE_HSV, compiler.stack_assign(color_in), compiler.stack_assign(hue_out), compiler.stack_assign(saturation_out)); compiler.add_node(NODE_SEPARATE_HSV, compiler.stack_assign(value_out)); } void SeparateHSVNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_separate_hsv"); } /* Hue Saturation Value */ NODE_DEFINE(HSVNode) { NodeType* type = NodeType::add("hsv", create, NodeType::SHADER); SOCKET_IN_FLOAT(hue, "Hue", 0.5f); SOCKET_IN_FLOAT(saturation, "Saturation", 1.0f); SOCKET_IN_FLOAT(value, "Value", 1.0f); SOCKET_IN_FLOAT(fac, "Fac", 1.0f); SOCKET_IN_COLOR(color, "Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_COLOR(color, "Color"); return type; } HSVNode::HSVNode() : ShaderNode(node_type) { } void HSVNode::compile(SVMCompiler& compiler) { ShaderInput *hue_in = input("Hue"); ShaderInput *saturation_in = input("Saturation"); ShaderInput *value_in = input("Value"); ShaderInput *fac_in = input("Fac"); ShaderInput *color_in = input("Color"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_HSV, compiler.encode_uchar4( compiler.stack_assign(color_in), compiler.stack_assign(fac_in), compiler.stack_assign(color_out)), compiler.encode_uchar4( compiler.stack_assign(hue_in), compiler.stack_assign(saturation_in), compiler.stack_assign(value_in))); } void HSVNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_hsv"); } /* Attribute */ NODE_DEFINE(AttributeNode) { NodeType* type = NodeType::add("attribute", create, NodeType::SHADER); SOCKET_STRING(attribute, "Attribute", ustring()); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_VECTOR(vector, "Vector"); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } AttributeNode::AttributeNode() : ShaderNode(node_type) { } void AttributeNode::attributes(Shader *shader, AttributeRequestSet *attributes) { ShaderOutput *color_out = output("Color"); ShaderOutput *vector_out = output("Vector"); ShaderOutput *fac_out = output("Fac"); if(!color_out->links.empty() || !vector_out->links.empty() || !fac_out->links.empty()) { attributes->add_standard(attribute); } if(shader->has_volume) { attributes->add(ATTR_STD_GENERATED_TRANSFORM); } ShaderNode::attributes(shader, attributes); } void AttributeNode::compile(SVMCompiler& compiler) { ShaderOutput *color_out = output("Color"); ShaderOutput *vector_out = output("Vector"); ShaderOutput *fac_out = output("Fac"); ShaderNodeType attr_node = NODE_ATTR; int attr = compiler.attribute_standard(attribute);; if(bump == SHADER_BUMP_DX) attr_node = NODE_ATTR_BUMP_DX; else if(bump == SHADER_BUMP_DY) attr_node = NODE_ATTR_BUMP_DY; if(!color_out->links.empty() || !vector_out->links.empty()) { if(!color_out->links.empty()) { compiler.add_node(attr_node, attr, compiler.stack_assign(color_out), NODE_ATTR_FLOAT3); } if(!vector_out->links.empty()) { compiler.add_node(attr_node, attr, compiler.stack_assign(vector_out), NODE_ATTR_FLOAT3); } } if(!fac_out->links.empty()) { compiler.add_node(attr_node, attr, compiler.stack_assign(fac_out), NODE_ATTR_FLOAT); } } void AttributeNode::compile(OSLCompiler& compiler) { if(bump == SHADER_BUMP_DX) compiler.parameter("bump_offset", "dx"); else if(bump == SHADER_BUMP_DY) compiler.parameter("bump_offset", "dy"); else compiler.parameter("bump_offset", "center"); if(Attribute::name_standard(attribute.c_str()) != ATTR_STD_NONE) compiler.parameter("name", (string("geom:") + attribute.c_str()).c_str()); else compiler.parameter("name", attribute.c_str()); compiler.add(this, "node_attribute"); } /* Camera */ NODE_DEFINE(CameraNode) { NodeType* type = NodeType::add("camera_info", create, NodeType::SHADER); SOCKET_OUT_VECTOR(view_vector, "View Vector"); SOCKET_OUT_FLOAT(view_z_depth, "View Z Depth"); SOCKET_OUT_FLOAT(view_distance, "View Distance"); return type; } CameraNode::CameraNode() : ShaderNode(node_type) { } void CameraNode::compile(SVMCompiler& compiler) { ShaderOutput *vector_out = output("View Vector"); ShaderOutput *z_depth_out = output("View Z Depth"); ShaderOutput *distance_out = output("View Distance"); compiler.add_node(NODE_CAMERA, compiler.stack_assign(vector_out), compiler.stack_assign(z_depth_out), compiler.stack_assign(distance_out)); } void CameraNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_camera"); } /* Fresnel */ NODE_DEFINE(FresnelNode) { NodeType* type = NodeType::add("fresnel", create, NodeType::SHADER); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL); SOCKET_IN_FLOAT(IOR, "IOR", 1.45f); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } FresnelNode::FresnelNode() : ShaderNode(node_type) { } void FresnelNode::compile(SVMCompiler& compiler) { ShaderInput *normal_in = input("Normal"); ShaderInput *IOR_in = input("IOR"); ShaderOutput *fac_out = output("Fac"); compiler.add_node(NODE_FRESNEL, compiler.stack_assign(IOR_in), __float_as_int(IOR), compiler.encode_uchar4( compiler.stack_assign_if_linked(normal_in), compiler.stack_assign(fac_out))); } void FresnelNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_fresnel"); } /* Layer Weight */ NODE_DEFINE(LayerWeightNode) { NodeType* type = NodeType::add("layer_weight", create, NodeType::SHADER); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL); SOCKET_IN_FLOAT(blend, "Blend", 0.5f); SOCKET_OUT_FLOAT(fresnel, "Fresnel"); SOCKET_OUT_FLOAT(facing, "Facing"); return type; } LayerWeightNode::LayerWeightNode() : ShaderNode(node_type) { } void LayerWeightNode::compile(SVMCompiler& compiler) { ShaderInput *normal_in = input("Normal"); ShaderInput *blend_in = input("Blend"); ShaderOutput *fresnel_out = output("Fresnel"); ShaderOutput *facing_out = output("Facing"); if(!fresnel_out->links.empty()) { compiler.add_node(NODE_LAYER_WEIGHT, compiler.stack_assign_if_linked(blend_in), __float_as_int(blend), compiler.encode_uchar4(NODE_LAYER_WEIGHT_FRESNEL, compiler.stack_assign_if_linked(normal_in), compiler.stack_assign(fresnel_out))); } if(!facing_out->links.empty()) { compiler.add_node(NODE_LAYER_WEIGHT, compiler.stack_assign_if_linked(blend_in), __float_as_int(blend), compiler.encode_uchar4(NODE_LAYER_WEIGHT_FACING, compiler.stack_assign_if_linked(normal_in), compiler.stack_assign(facing_out))); } } void LayerWeightNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_layer_weight"); } /* Wireframe */ NODE_DEFINE(WireframeNode) { NodeType* type = NodeType::add("wireframe", create, NodeType::SHADER); SOCKET_BOOLEAN(use_pixel_size, "Use Pixel Size", false); SOCKET_IN_FLOAT(size, "Size", 0.01f); SOCKET_OUT_FLOAT(fac, "Fac"); return type; } WireframeNode::WireframeNode() : ShaderNode(node_type) { } void WireframeNode::compile(SVMCompiler& compiler) { ShaderInput *size_in = input("Size"); ShaderOutput *fac_out = output("Fac"); NodeBumpOffset bump_offset = NODE_BUMP_OFFSET_CENTER; if(bump == SHADER_BUMP_DX) { bump_offset = NODE_BUMP_OFFSET_DX; } else if(bump == SHADER_BUMP_DY) { bump_offset = NODE_BUMP_OFFSET_DY; } compiler.add_node(NODE_WIREFRAME, compiler.stack_assign(size_in), compiler.stack_assign(fac_out), compiler.encode_uchar4(use_pixel_size, bump_offset, 0, 0)); } void WireframeNode::compile(OSLCompiler& compiler) { if(bump == SHADER_BUMP_DX) { compiler.parameter("bump_offset", "dx"); } else if(bump == SHADER_BUMP_DY) { compiler.parameter("bump_offset", "dy"); } else { compiler.parameter("bump_offset", "center"); } compiler.parameter(this, "use_pixel_size"); compiler.add(this, "node_wireframe"); } /* Wavelength */ NODE_DEFINE(WavelengthNode) { NodeType* type = NodeType::add("wavelength", create, NodeType::SHADER); SOCKET_IN_FLOAT(wavelength, "Wavelength", 500.0f); SOCKET_OUT_COLOR(color, "Color"); return type; } WavelengthNode::WavelengthNode() : ShaderNode(node_type) { } void WavelengthNode::compile(SVMCompiler& compiler) { ShaderInput *wavelength_in = input("Wavelength"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_WAVELENGTH, compiler.stack_assign(wavelength_in), compiler.stack_assign(color_out)); } void WavelengthNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_wavelength"); } /* Blackbody */ NODE_DEFINE(BlackbodyNode) { NodeType* type = NodeType::add("blackbody", create, NodeType::SHADER); SOCKET_IN_FLOAT(temperature, "Temperature", 1200.0f); SOCKET_OUT_COLOR(color, "Color"); return type; } BlackbodyNode::BlackbodyNode() : ShaderNode(node_type) { } void BlackbodyNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant(svm_math_blackbody_color(temperature)); } } void BlackbodyNode::compile(SVMCompiler& compiler) { ShaderInput *temperature_in = input("Temperature"); ShaderOutput *color_out = output("Color"); compiler.add_node(NODE_BLACKBODY, compiler.stack_assign(temperature_in), compiler.stack_assign(color_out)); } void BlackbodyNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_blackbody"); } /* Output */ NODE_DEFINE(OutputNode) { NodeType* type = NodeType::add("output", create, NodeType::SHADER); SOCKET_IN_CLOSURE(surface, "Surface"); SOCKET_IN_CLOSURE(volume, "Volume"); SOCKET_IN_VECTOR(displacement, "Displacement", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f)); return type; } OutputNode::OutputNode() : ShaderNode(node_type) { special_type = SHADER_SPECIAL_TYPE_OUTPUT; } void OutputNode::compile(SVMCompiler& compiler) { if(compiler.output_type() == SHADER_TYPE_DISPLACEMENT) { ShaderInput *displacement_in = input("Displacement"); if(displacement_in->link) { compiler.add_node(NODE_SET_DISPLACEMENT, compiler.stack_assign(displacement_in)); } } } void OutputNode::compile(OSLCompiler& compiler) { if(compiler.output_type() == SHADER_TYPE_SURFACE) compiler.add(this, "node_output_surface"); else if(compiler.output_type() == SHADER_TYPE_VOLUME) compiler.add(this, "node_output_volume"); else if(compiler.output_type() == SHADER_TYPE_DISPLACEMENT) compiler.add(this, "node_output_displacement"); } /* Math */ NODE_DEFINE(MathNode) { NodeType* type = NodeType::add("math", create, NodeType::SHADER); static NodeEnum type_enum; type_enum.insert("add", NODE_MATH_ADD); type_enum.insert("subtract", NODE_MATH_SUBTRACT); type_enum.insert("multiply", NODE_MATH_MULTIPLY); type_enum.insert("divide", NODE_MATH_DIVIDE); type_enum.insert("sine", NODE_MATH_SINE); type_enum.insert("cosine", NODE_MATH_COSINE); type_enum.insert("tangent", NODE_MATH_TANGENT); type_enum.insert("arcsine", NODE_MATH_ARCSINE); type_enum.insert("arccosine", NODE_MATH_ARCCOSINE); type_enum.insert("arctangent", NODE_MATH_ARCTANGENT); type_enum.insert("power", NODE_MATH_POWER); type_enum.insert("logarithm", NODE_MATH_LOGARITHM); type_enum.insert("minimum", NODE_MATH_MINIMUM); type_enum.insert("maximum", NODE_MATH_MAXIMUM); type_enum.insert("round", NODE_MATH_ROUND); type_enum.insert("less_than", NODE_MATH_LESS_THAN); type_enum.insert("greater_than", NODE_MATH_GREATER_THAN); type_enum.insert("modulo", NODE_MATH_MODULO); type_enum.insert("absolute", NODE_MATH_ABSOLUTE); SOCKET_ENUM(type, "Type", type_enum, NODE_MATH_ADD); SOCKET_BOOLEAN(use_clamp, "Use Clamp", false); SOCKET_IN_FLOAT(value1, "Value1", 0.0f); SOCKET_IN_FLOAT(value2, "Value2", 0.0f); SOCKET_OUT_FLOAT(value, "Value"); return type; } MathNode::MathNode() : ShaderNode(node_type) { } void MathNode::constant_fold(const ConstantFolder& folder) { if(folder.all_inputs_constant()) { folder.make_constant_clamp(svm_math(type, value1, value2), use_clamp); } else { folder.fold_math(type, use_clamp); } } void MathNode::compile(SVMCompiler& compiler) { ShaderInput *value1_in = input("Value1"); ShaderInput *value2_in = input("Value2"); ShaderOutput *value_out = output("Value"); compiler.add_node(NODE_MATH, type, compiler.stack_assign(value1_in), compiler.stack_assign(value2_in)); compiler.add_node(NODE_MATH, compiler.stack_assign(value_out)); if(use_clamp) { compiler.add_node(NODE_MATH, NODE_MATH_CLAMP, compiler.stack_assign(value_out)); compiler.add_node(NODE_MATH, compiler.stack_assign(value_out)); } } void MathNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "type"); compiler.parameter(this, "use_clamp"); compiler.add(this, "node_math"); } /* VectorMath */ NODE_DEFINE(VectorMathNode) { NodeType* type = NodeType::add("vector_math", create, NodeType::SHADER); static NodeEnum type_enum; type_enum.insert("add", NODE_VECTOR_MATH_ADD); type_enum.insert("subtract", NODE_VECTOR_MATH_SUBTRACT); type_enum.insert("average", NODE_VECTOR_MATH_AVERAGE); type_enum.insert("dot_product", NODE_VECTOR_MATH_DOT_PRODUCT); type_enum.insert("cross_product", NODE_VECTOR_MATH_CROSS_PRODUCT); type_enum.insert("normalize", NODE_VECTOR_MATH_NORMALIZE); SOCKET_ENUM(type, "Type", type_enum, NODE_VECTOR_MATH_ADD); SOCKET_IN_VECTOR(vector1, "Vector1", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_VECTOR(vector2, "Vector2", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_FLOAT(value, "Value"); SOCKET_OUT_VECTOR(vector, "Vector"); return type; } VectorMathNode::VectorMathNode() : ShaderNode(node_type) { } void VectorMathNode::constant_fold(const ConstantFolder& folder) { float value; float3 vector; if(folder.all_inputs_constant()) { svm_vector_math(&value, &vector, type, vector1, vector2); if(folder.output == output("Value")) { folder.make_constant(value); } else if(folder.output == output("Vector")) { folder.make_constant(vector); } } else { folder.fold_vector_math(type); } } void VectorMathNode::compile(SVMCompiler& compiler) { ShaderInput *vector1_in = input("Vector1"); ShaderInput *vector2_in = input("Vector2"); ShaderOutput *value_out = output("Value"); ShaderOutput *vector_out = output("Vector"); compiler.add_node(NODE_VECTOR_MATH, type, compiler.stack_assign(vector1_in), compiler.stack_assign(vector2_in)); compiler.add_node(NODE_VECTOR_MATH, compiler.stack_assign(value_out), compiler.stack_assign(vector_out)); } void VectorMathNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "type"); compiler.add(this, "node_vector_math"); } /* VectorTransform */ NODE_DEFINE(VectorTransformNode) { NodeType* type = NodeType::add("vector_transform", create, NodeType::SHADER); static NodeEnum type_enum; type_enum.insert("vector", NODE_VECTOR_TRANSFORM_TYPE_VECTOR); type_enum.insert("point", NODE_VECTOR_TRANSFORM_TYPE_POINT); type_enum.insert("normal", NODE_VECTOR_TRANSFORM_TYPE_NORMAL); SOCKET_ENUM(type, "Type", type_enum, NODE_VECTOR_TRANSFORM_TYPE_VECTOR); static NodeEnum space_enum; space_enum.insert("world", NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD); space_enum.insert("object", NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT); space_enum.insert("camera", NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA); SOCKET_ENUM(convert_from, "Convert From", space_enum, NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD); SOCKET_ENUM(convert_to, "Convert To", space_enum, NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT); SOCKET_IN_VECTOR(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_VECTOR(vector, "Vector"); return type; } VectorTransformNode::VectorTransformNode() : ShaderNode(node_type) { } void VectorTransformNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderOutput *vector_out = output("Vector"); compiler.add_node(NODE_VECTOR_TRANSFORM, compiler.encode_uchar4(type, convert_from, convert_to), compiler.encode_uchar4(compiler.stack_assign(vector_in), compiler.stack_assign(vector_out))); } void VectorTransformNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "type"); compiler.parameter(this, "convert_from"); compiler.parameter(this, "convert_to"); compiler.add(this, "node_vector_transform"); } /* BumpNode */ NODE_DEFINE(BumpNode) { NodeType* type = NodeType::add("bump", create, NodeType::SHADER); SOCKET_BOOLEAN(invert, "Invert", false); SOCKET_BOOLEAN(use_object_space, "UseObjectSpace", false); /* this input is used by the user, but after graph transform it is no longer * used and moved to sampler center/x/y instead */ SOCKET_IN_FLOAT(height, "Height", 1.0f); SOCKET_IN_FLOAT(sample_center, "SampleCenter", 0.0f); SOCKET_IN_FLOAT(sample_x, "SampleX", 0.0f); SOCKET_IN_FLOAT(sample_y, "SampleY", 0.0f); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_IN_FLOAT(strength, "Strength", 1.0f); SOCKET_IN_FLOAT(distance, "Distance", 0.1f); SOCKET_OUT_NORMAL(normal, "Normal"); return type; } BumpNode::BumpNode() : ShaderNode(node_type) { special_type = SHADER_SPECIAL_TYPE_BUMP; } void BumpNode::compile(SVMCompiler& compiler) { ShaderInput *center_in = input("SampleCenter"); ShaderInput *dx_in = input("SampleX"); ShaderInput *dy_in = input("SampleY"); ShaderInput *normal_in = input("Normal"); ShaderInput *strength_in = input("Strength"); ShaderInput *distance_in = input("Distance"); ShaderOutput *normal_out = output("Normal"); /* pack all parameters in the node */ compiler.add_node(NODE_SET_BUMP, compiler.encode_uchar4( compiler.stack_assign_if_linked(normal_in), compiler.stack_assign(distance_in), invert, use_object_space), compiler.encode_uchar4( compiler.stack_assign(center_in), compiler.stack_assign(dx_in), compiler.stack_assign(dy_in), compiler.stack_assign(strength_in)), compiler.stack_assign(normal_out)); } void BumpNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "invert"); compiler.parameter(this, "use_object_space"); compiler.add(this, "node_bump"); } void BumpNode::constant_fold(const ConstantFolder& folder) { ShaderInput *height_in = input("Height"); ShaderInput *normal_in = input("Normal"); if(height_in->link == NULL) { if(normal_in->link == NULL) { GeometryNode *geom = new GeometryNode(); folder.graph->add(geom); folder.bypass(geom->output("Normal")); } else { folder.bypass(normal_in->link); } } /* TODO(sergey): Ignore bump with zero strength. */ } /* Curve node */ CurvesNode::CurvesNode(const NodeType *node_type) : ShaderNode(node_type) { } void CurvesNode::constant_fold(const ConstantFolder& folder, ShaderInput *value_in) { ShaderInput *fac_in = input("Fac"); /* evaluate fully constant node */ if(folder.all_inputs_constant()) { if(curves.size() == 0) { return; } float3 pos = (value - make_float3(min_x, min_x, min_x)) / (max_x - min_x); float3 result; result[0] = rgb_ramp_lookup(curves.data(), pos[0], true, true, curves.size()).x; result[1] = rgb_ramp_lookup(curves.data(), pos[1], true, true, curves.size()).y; result[2] = rgb_ramp_lookup(curves.data(), pos[2], true, true, curves.size()).z; folder.make_constant(interp(value, result, fac)); } /* remove no-op node */ else if(!fac_in->link && fac == 0.0f) { /* link is not null because otherwise all inputs are constant */ folder.bypass(value_in->link); } } void CurvesNode::compile(SVMCompiler& compiler, int type, ShaderInput *value_in, ShaderOutput *value_out) { if(curves.size() == 0) return; ShaderInput *fac_in = input("Fac"); compiler.add_node(type, compiler.encode_uchar4(compiler.stack_assign(fac_in), compiler.stack_assign(value_in), compiler.stack_assign(value_out)), __float_as_int(min_x), __float_as_int(max_x)); compiler.add_node(curves.size()); for(int i = 0; i < curves.size(); i++) compiler.add_node(float3_to_float4(curves[i])); } void CurvesNode::compile(OSLCompiler& compiler, const char* name) { if(curves.size() == 0) return; compiler.parameter_color_array("ramp", curves); compiler.parameter(this, "min_x"); compiler.parameter(this, "max_x"); compiler.add(this, name); } void CurvesNode::compile(SVMCompiler& /*compiler*/) { assert(0); } void CurvesNode::compile(OSLCompiler& /*compiler*/) { assert(0); } /* RGBCurvesNode */ NODE_DEFINE(RGBCurvesNode) { NodeType* type = NodeType::add("rgb_curves", create, NodeType::SHADER); SOCKET_COLOR_ARRAY(curves, "Curves", array()); SOCKET_FLOAT(min_x, "Min X", 0.0f); SOCKET_FLOAT(max_x, "Max X", 1.0f); SOCKET_IN_FLOAT(fac, "Fac", 0.0f); SOCKET_IN_COLOR(value, "Color", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_COLOR(value, "Color"); return type; } RGBCurvesNode::RGBCurvesNode() : CurvesNode(node_type) { } void RGBCurvesNode::constant_fold(const ConstantFolder& folder) { CurvesNode::constant_fold(folder, input("Color")); } void RGBCurvesNode::compile(SVMCompiler& compiler) { CurvesNode::compile(compiler, NODE_RGB_CURVES, input("Color"), output("Color")); } void RGBCurvesNode::compile(OSLCompiler& compiler) { CurvesNode::compile(compiler, "node_rgb_curves"); } /* VectorCurvesNode */ NODE_DEFINE(VectorCurvesNode) { NodeType* type = NodeType::add("vector_curves", create, NodeType::SHADER); SOCKET_VECTOR_ARRAY(curves, "Curves", array()); SOCKET_FLOAT(min_x, "Min X", 0.0f); SOCKET_FLOAT(max_x, "Max X", 1.0f); SOCKET_IN_FLOAT(fac, "Fac", 0.0f); SOCKET_IN_VECTOR(value, "Vector", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_VECTOR(value, "Vector"); return type; } VectorCurvesNode::VectorCurvesNode() : CurvesNode(node_type) { } void VectorCurvesNode::constant_fold(const ConstantFolder& folder) { CurvesNode::constant_fold(folder, input("Vector")); } void VectorCurvesNode::compile(SVMCompiler& compiler) { CurvesNode::compile(compiler, NODE_VECTOR_CURVES, input("Vector"), output("Vector")); } void VectorCurvesNode::compile(OSLCompiler& compiler) { CurvesNode::compile(compiler, "node_vector_curves"); } /* RGBRampNode */ NODE_DEFINE(RGBRampNode) { NodeType* type = NodeType::add("rgb_ramp", create, NodeType::SHADER); SOCKET_COLOR_ARRAY(ramp, "Ramp", array()); SOCKET_FLOAT_ARRAY(ramp_alpha, "Ramp Alpha", array()); SOCKET_BOOLEAN(interpolate, "Interpolate", true); SOCKET_IN_FLOAT(fac, "Fac", 0.0f); SOCKET_OUT_COLOR(color, "Color"); SOCKET_OUT_FLOAT(alpha, "Alpha"); return type; } RGBRampNode::RGBRampNode() : ShaderNode(node_type) { } void RGBRampNode::constant_fold(const ConstantFolder& folder) { if(ramp.size() == 0 || ramp.size() != ramp_alpha.size()) return; if(folder.all_inputs_constant()) { float f = clamp(fac, 0.0f, 1.0f) * (ramp.size() - 1); /* clamp int as well in case of NaN */ int i = clamp((int)f, 0, ramp.size()-1); float t = f - (float)i; bool use_lerp = interpolate && t > 0.0f; if(folder.output == output("Color")) { float3 color = rgb_ramp_lookup(ramp.data(), fac, use_lerp, false, ramp.size()); folder.make_constant(color); } else if(folder.output == output("Alpha")) { float alpha = float_ramp_lookup(ramp_alpha.data(), fac, use_lerp, false, ramp_alpha.size()); folder.make_constant(alpha); } } } void RGBRampNode::compile(SVMCompiler& compiler) { if(ramp.size() == 0 || ramp.size() != ramp_alpha.size()) return; ShaderInput *fac_in = input("Fac"); ShaderOutput *color_out = output("Color"); ShaderOutput *alpha_out = output("Alpha"); compiler.add_node(NODE_RGB_RAMP, compiler.encode_uchar4( compiler.stack_assign(fac_in), compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(alpha_out)), interpolate); compiler.add_node(ramp.size()); for(int i = 0; i < ramp.size(); i++) compiler.add_node(make_float4(ramp[i].x, ramp[i].y, ramp[i].z, ramp_alpha[i])); } void RGBRampNode::compile(OSLCompiler& compiler) { if(ramp.size() == 0 || ramp.size() != ramp_alpha.size()) return; compiler.parameter_color_array("ramp_color", ramp); compiler.parameter_array("ramp_alpha", ramp_alpha.data(), ramp_alpha.size()); compiler.parameter(this, "interpolate"); compiler.add(this, "node_rgb_ramp"); } /* Set Normal Node */ NODE_DEFINE(SetNormalNode) { NodeType* type = NodeType::add("set_normal", create, NodeType::SHADER); SOCKET_IN_VECTOR(direction, "Direction", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_OUT_NORMAL(normal, "Normal"); return type; } SetNormalNode::SetNormalNode() : ShaderNode(node_type) { } void SetNormalNode::compile(SVMCompiler& compiler) { ShaderInput *direction_in = input("Direction"); ShaderOutput *normal_out = output("Normal"); compiler.add_node(NODE_CLOSURE_SET_NORMAL, compiler.stack_assign(direction_in), compiler.stack_assign(normal_out)); } void SetNormalNode::compile(OSLCompiler& compiler) { compiler.add(this, "node_set_normal"); } /* OSLNode */ OSLNode::OSLNode() : ShaderNode(new NodeType(NodeType::SHADER)) { special_type = SHADER_SPECIAL_TYPE_SCRIPT; } OSLNode::~OSLNode() { delete type; } ShaderNode *OSLNode::clone() const { return OSLNode::create(this->inputs.size(), this); } OSLNode* OSLNode::create(size_t num_inputs, const OSLNode *from) { /* allocate space for the node itself and parameters, aligned to 16 bytes * assuming that's the most parameter types need */ size_t node_size = align_up(sizeof(OSLNode), 16); size_t inputs_size = align_up(SocketType::max_size(), 16) * num_inputs; char *node_memory = (char*) operator new(node_size + inputs_size); memset(node_memory, 0, node_size + inputs_size); if(!from) { return new(node_memory) OSLNode(); } else { /* copy input default values and node type for cloning */ memcpy(node_memory + node_size, (char*)from + node_size, inputs_size); OSLNode *node = new(node_memory) OSLNode(*from); node->type = new NodeType(*(from->type)); return node; } } char* OSLNode::input_default_value() { /* pointer to default value storage, which is the same as our actual value */ size_t num_inputs = type->inputs.size(); size_t inputs_size = align_up(SocketType::max_size(), 16) * num_inputs; return (char*)this + align_up(sizeof(OSLNode), 16) + inputs_size; } void OSLNode::add_input(ustring name, SocketType::Type socket_type) { char *memory = input_default_value(); size_t offset = memory - (char*)this; const_cast(type)->register_input(name, name, socket_type, offset, memory, NULL, NULL, SocketType::LINKABLE); } void OSLNode::add_output(ustring name, SocketType::Type socket_type) { const_cast(type)->register_output(name, name, socket_type); } void OSLNode::compile(SVMCompiler&) { /* doesn't work for SVM, obviously ... */ } void OSLNode::compile(OSLCompiler& compiler) { if(!filepath.empty()) compiler.add(this, filepath.c_str(), true); else compiler.add(this, bytecode_hash.c_str(), false); } /* Normal Map */ NODE_DEFINE(NormalMapNode) { NodeType* type = NodeType::add("normal_map", create, NodeType::SHADER); static NodeEnum space_enum; space_enum.insert("tangent", NODE_NORMAL_MAP_TANGENT); space_enum.insert("object", NODE_NORMAL_MAP_OBJECT); space_enum.insert("world", NODE_NORMAL_MAP_WORLD); space_enum.insert("blender_object", NODE_NORMAL_MAP_BLENDER_OBJECT); space_enum.insert("blender_world", NODE_NORMAL_MAP_BLENDER_WORLD); SOCKET_ENUM(space, "Space", space_enum, NODE_TANGENT_RADIAL); SOCKET_STRING(attribute, "Attribute", ustring()); SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL); SOCKET_IN_FLOAT(strength, "Strength", 1.0f); SOCKET_IN_COLOR(color, "Color", make_float3(0.5f, 0.5f, 1.0f)); SOCKET_OUT_NORMAL(normal, "Normal"); return type; } NormalMapNode::NormalMapNode() : ShaderNode(node_type) { } void NormalMapNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface && space == NODE_NORMAL_MAP_TANGENT) { if(attribute.empty()) { attributes->add(ATTR_STD_UV_TANGENT); attributes->add(ATTR_STD_UV_TANGENT_SIGN); } else { attributes->add(ustring((string(attribute.c_str()) + ".tangent").c_str())); attributes->add(ustring((string(attribute.c_str()) + ".tangent_sign").c_str())); } attributes->add(ATTR_STD_VERTEX_NORMAL); } ShaderNode::attributes(shader, attributes); } void NormalMapNode::compile(SVMCompiler& compiler) { ShaderInput *color_in = input("Color"); ShaderInput *strength_in = input("Strength"); ShaderOutput *normal_out = output("Normal"); int attr = 0, attr_sign = 0; if(space == NODE_NORMAL_MAP_TANGENT) { if(attribute.empty()) { attr = compiler.attribute(ATTR_STD_UV_TANGENT); attr_sign = compiler.attribute(ATTR_STD_UV_TANGENT_SIGN); } else { attr = compiler.attribute(ustring((string(attribute.c_str()) + ".tangent").c_str())); attr_sign = compiler.attribute(ustring((string(attribute.c_str()) + ".tangent_sign").c_str())); } } compiler.add_node(NODE_NORMAL_MAP, compiler.encode_uchar4( compiler.stack_assign(color_in), compiler.stack_assign(strength_in), compiler.stack_assign(normal_out), space), attr, attr_sign); } void NormalMapNode::compile(OSLCompiler& compiler) { if(space == NODE_NORMAL_MAP_TANGENT) { if(attribute.empty()) { compiler.parameter("attr_name", ustring("geom:tangent")); compiler.parameter("attr_sign_name", ustring("geom:tangent_sign")); } else { compiler.parameter("attr_name", ustring((string(attribute.c_str()) + ".tangent").c_str())); compiler.parameter("attr_sign_name", ustring((string(attribute.c_str()) + ".tangent_sign").c_str())); } } compiler.parameter(this, "space"); compiler.add(this, "node_normal_map"); } /* Tangent */ NODE_DEFINE(TangentNode) { NodeType* type = NodeType::add("tangent", create, NodeType::SHADER); static NodeEnum direction_type_enum; direction_type_enum.insert("radial", NODE_TANGENT_RADIAL); direction_type_enum.insert("uv_map", NODE_TANGENT_UVMAP); SOCKET_ENUM(direction_type, "Direction Type", direction_type_enum, NODE_TANGENT_RADIAL); static NodeEnum axis_enum; axis_enum.insert("x", NODE_TANGENT_AXIS_X); axis_enum.insert("y", NODE_TANGENT_AXIS_Y); axis_enum.insert("z", NODE_TANGENT_AXIS_Z); SOCKET_ENUM(axis, "Axis", axis_enum, NODE_TANGENT_AXIS_X); SOCKET_STRING(attribute, "Attribute", ustring()); SOCKET_IN_NORMAL(normal_osl, "NormalIn", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL | SocketType::OSL_INTERNAL); SOCKET_OUT_NORMAL(tangent, "Tangent"); return type; } TangentNode::TangentNode() : ShaderNode(node_type) { } void TangentNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { if(direction_type == NODE_TANGENT_UVMAP) { if(attribute.empty()) attributes->add(ATTR_STD_UV_TANGENT); else attributes->add(ustring((string(attribute.c_str()) + ".tangent").c_str())); } else attributes->add(ATTR_STD_GENERATED); } ShaderNode::attributes(shader, attributes); } void TangentNode::compile(SVMCompiler& compiler) { ShaderOutput *tangent_out = output("Tangent"); int attr; if(direction_type == NODE_TANGENT_UVMAP) { if(attribute.empty()) attr = compiler.attribute(ATTR_STD_UV_TANGENT); else attr = compiler.attribute(ustring((string(attribute.c_str()) + ".tangent").c_str())); } else attr = compiler.attribute(ATTR_STD_GENERATED); compiler.add_node(NODE_TANGENT, compiler.encode_uchar4( compiler.stack_assign(tangent_out), direction_type, axis), attr); } void TangentNode::compile(OSLCompiler& compiler) { if(direction_type == NODE_TANGENT_UVMAP) { if(attribute.empty()) compiler.parameter("attr_name", ustring("geom:tangent")); else compiler.parameter("attr_name", ustring((string(attribute.c_str()) + ".tangent").c_str())); } compiler.parameter(this, "direction_type"); compiler.parameter(this, "axis"); compiler.add(this, "node_tangent"); } /* Bevel */ NODE_DEFINE(BevelNode) { NodeType* type = NodeType::add("bevel", create, NodeType::SHADER); SOCKET_INT(samples, "Samples", 4); SOCKET_IN_FLOAT(radius, "Radius", 0.05f); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_OUT_NORMAL(bevel, "Normal"); return type; } BevelNode::BevelNode() : ShaderNode(node_type) { } void BevelNode::compile(SVMCompiler& compiler) { ShaderInput *radius_in = input("Radius"); ShaderInput *normal_in = input("Normal"); ShaderOutput *normal_out = output("Normal"); compiler.add_node(NODE_BEVEL, compiler.encode_uchar4(samples, compiler.stack_assign(radius_in), compiler.stack_assign_if_linked(normal_in), compiler.stack_assign(normal_out))); } void BevelNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "samples"); compiler.add(this, "node_bevel"); } /* Displacement */ NODE_DEFINE(DisplacementNode) { NodeType* type = NodeType::add("displacement", create, NodeType::SHADER); static NodeEnum space_enum; space_enum.insert("object", NODE_NORMAL_MAP_OBJECT); space_enum.insert("world", NODE_NORMAL_MAP_WORLD); SOCKET_ENUM(space, "Space", space_enum, NODE_NORMAL_MAP_TANGENT); SOCKET_IN_FLOAT(height, "Height", 0.0f); SOCKET_IN_FLOAT(midlevel, "Midlevel", 0.5f); SOCKET_IN_FLOAT(scale, "Scale", 1.0f); SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL); SOCKET_OUT_VECTOR(displacement, "Displacement"); return type; } DisplacementNode::DisplacementNode() : ShaderNode(node_type) { } void DisplacementNode::compile(SVMCompiler& compiler) { ShaderInput *height_in = input("Height"); ShaderInput *midlevel_in = input("Midlevel"); ShaderInput *scale_in = input("Scale"); ShaderInput *normal_in = input("Normal"); ShaderOutput *displacement_out = output("Displacement"); compiler.add_node(NODE_DISPLACEMENT, compiler.encode_uchar4(compiler.stack_assign(height_in), compiler.stack_assign(midlevel_in), compiler.stack_assign(scale_in), compiler.stack_assign_if_linked(normal_in)), compiler.stack_assign(displacement_out), space); } void DisplacementNode::compile(OSLCompiler& compiler) { compiler.parameter(this, "space"); compiler.add(this, "node_displacement"); } /* Vector Displacement */ NODE_DEFINE(VectorDisplacementNode) { NodeType* type = NodeType::add("vector_displacement", create, NodeType::SHADER); static NodeEnum space_enum; space_enum.insert("tangent", NODE_NORMAL_MAP_TANGENT); space_enum.insert("object", NODE_NORMAL_MAP_OBJECT); space_enum.insert("world", NODE_NORMAL_MAP_WORLD); SOCKET_ENUM(space, "Space", space_enum, NODE_NORMAL_MAP_TANGENT); SOCKET_STRING(attribute, "Attribute", ustring()); SOCKET_IN_COLOR(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_IN_FLOAT(midlevel, "Midlevel", 0.0f); SOCKET_IN_FLOAT(scale, "Scale", 1.0f); SOCKET_OUT_VECTOR(displacement, "Displacement"); return type; } VectorDisplacementNode::VectorDisplacementNode() : ShaderNode(node_type) { } void VectorDisplacementNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface && space == NODE_NORMAL_MAP_TANGENT) { if(attribute.empty()) { attributes->add(ATTR_STD_UV_TANGENT); attributes->add(ATTR_STD_UV_TANGENT_SIGN); } else { attributes->add(ustring((string(attribute.c_str()) + ".tangent").c_str())); attributes->add(ustring((string(attribute.c_str()) + ".tangent_sign").c_str())); } attributes->add(ATTR_STD_VERTEX_NORMAL); } ShaderNode::attributes(shader, attributes); } void VectorDisplacementNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); ShaderInput *midlevel_in = input("Midlevel"); ShaderInput *scale_in = input("Scale"); ShaderOutput *displacement_out = output("Displacement"); int attr = 0, attr_sign = 0; if(space == NODE_NORMAL_MAP_TANGENT) { if(attribute.empty()) { attr = compiler.attribute(ATTR_STD_UV_TANGENT); attr_sign = compiler.attribute(ATTR_STD_UV_TANGENT_SIGN); } else { attr = compiler.attribute(ustring((string(attribute.c_str()) + ".tangent").c_str())); attr_sign = compiler.attribute(ustring((string(attribute.c_str()) + ".tangent_sign").c_str())); } } compiler.add_node(NODE_VECTOR_DISPLACEMENT, compiler.encode_uchar4(compiler.stack_assign(vector_in), compiler.stack_assign(midlevel_in), compiler.stack_assign(scale_in), compiler.stack_assign(displacement_out)), attr, attr_sign); compiler.add_node(space); } void VectorDisplacementNode::compile(OSLCompiler& compiler) { if(space == NODE_NORMAL_MAP_TANGENT) { if(attribute.empty()) { compiler.parameter("attr_name", ustring("geom:tangent")); compiler.parameter("attr_sign_name", ustring("geom:tangent_sign")); } else { compiler.parameter("attr_name", ustring((string(attribute.c_str()) + ".tangent").c_str())); compiler.parameter("attr_sign_name", ustring((string(attribute.c_str()) + ".tangent_sign").c_str())); } } compiler.parameter(this, "space"); compiler.add(this, "node_vector_displacement"); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/nodes.h000066400000000000000000000634741334742672700211530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __NODES_H__ #define __NODES_H__ #include "render/graph.h" #include "graph/node.h" #include "util/util_string.h" CCL_NAMESPACE_BEGIN class ImageManager; class Scene; class Shader; /* Texture Mapping */ class TextureMapping { public: TextureMapping(); Transform compute_transform(); bool skip(); void compile(SVMCompiler& compiler, int offset_in, int offset_out); int compile(SVMCompiler& compiler, ShaderInput *vector_in); void compile(OSLCompiler &compiler); int compile_begin(SVMCompiler& compiler, ShaderInput *vector_in); void compile_end(SVMCompiler& compiler, ShaderInput *vector_in, int vector_offset); float3 translation; float3 rotation; float3 scale; float3 min, max; bool use_minmax; enum Type { POINT = 0, TEXTURE = 1, VECTOR = 2, NORMAL = 3 }; Type type; enum Mapping { NONE = 0, X = 1, Y = 2, Z = 3 }; Mapping x_mapping, y_mapping, z_mapping; enum Projection { FLAT, CUBE, TUBE, SPHERE }; Projection projection; }; /* Nodes */ class TextureNode : public ShaderNode { public: explicit TextureNode(const NodeType *node_type) : ShaderNode(node_type) {} TextureMapping tex_mapping; }; /* Any node which uses image manager's slot should be a subclass of this one. */ class ImageSlotTextureNode : public TextureNode { public: explicit ImageSlotTextureNode(const NodeType *node_type) : TextureNode(node_type) { special_type = SHADER_SPECIAL_TYPE_IMAGE_SLOT; } int slot; }; class ImageTextureNode : public ImageSlotTextureNode { public: SHADER_NODE_NO_CLONE_CLASS(ImageTextureNode) ~ImageTextureNode(); ShaderNode *clone() const; void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } ImageManager *image_manager; int is_float; bool is_linear; bool use_alpha; ustring filename; void *builtin_data; NodeImageColorSpace color_space; NodeImageProjection projection; InterpolationType interpolation; ExtensionType extension; float projection_blend; bool animated; float3 vector; virtual bool equals(const ShaderNode& other) { const ImageTextureNode& image_node = (const ImageTextureNode&)other; return ImageSlotTextureNode::equals(other) && builtin_data == image_node.builtin_data && animated == image_node.animated; } }; class EnvironmentTextureNode : public ImageSlotTextureNode { public: SHADER_NODE_NO_CLONE_CLASS(EnvironmentTextureNode) ~EnvironmentTextureNode(); ShaderNode *clone() const; void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_2; } ImageManager *image_manager; int is_float; bool is_linear; bool use_alpha; ustring filename; void *builtin_data; NodeImageColorSpace color_space; NodeEnvironmentProjection projection; InterpolationType interpolation; bool animated; float3 vector; virtual bool equals(const ShaderNode& other) { const EnvironmentTextureNode& env_node = (const EnvironmentTextureNode&)other; return ImageSlotTextureNode::equals(other) && builtin_data == env_node.builtin_data && animated == env_node.animated; } }; class SkyTextureNode : public TextureNode { public: SHADER_NODE_CLASS(SkyTextureNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } NodeSkyType type; float3 sun_direction; float turbidity; float ground_albedo; float3 vector; }; class OutputNode : public ShaderNode { public: SHADER_NODE_CLASS(OutputNode) void *surface; void *volume; float3 displacement; float3 normal; /* Don't allow output node de-duplication. */ virtual bool equals(const ShaderNode& /*other*/) { return false; } }; class GradientTextureNode : public TextureNode { public: SHADER_NODE_CLASS(GradientTextureNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } NodeGradientType type; float3 vector; }; class NoiseTextureNode : public TextureNode { public: SHADER_NODE_CLASS(NoiseTextureNode) float scale, detail, distortion; float3 vector; }; class VoronoiTextureNode : public TextureNode { public: SHADER_NODE_CLASS(VoronoiTextureNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } NodeVoronoiColoring coloring; float scale; float3 vector; }; class MusgraveTextureNode : public TextureNode { public: SHADER_NODE_CLASS(MusgraveTextureNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } NodeMusgraveType type; float scale, detail, dimension, lacunarity, offset, gain; float3 vector; }; class WaveTextureNode : public TextureNode { public: SHADER_NODE_CLASS(WaveTextureNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } NodeWaveType type; NodeWaveProfile profile; float scale, distortion, detail, detail_scale; float3 vector; }; class MagicTextureNode : public TextureNode { public: SHADER_NODE_CLASS(MagicTextureNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } int depth; float3 vector; float scale, distortion; }; class CheckerTextureNode : public TextureNode { public: SHADER_NODE_CLASS(CheckerTextureNode) float3 vector, color1, color2; float scale; virtual int get_group() { return NODE_GROUP_LEVEL_2; } }; class BrickTextureNode : public TextureNode { public: SHADER_NODE_CLASS(BrickTextureNode) float offset, squash; int offset_frequency, squash_frequency; float3 color1, color2, mortar; float scale, mortar_size, mortar_smooth, bias, brick_width, row_height; float3 vector; virtual int get_group() { return NODE_GROUP_LEVEL_2; } }; class PointDensityTextureNode : public ShaderNode { public: SHADER_NODE_NO_CLONE_CLASS(PointDensityTextureNode) virtual int get_group() { return NODE_GROUP_LEVEL_3; } ~PointDensityTextureNode(); ShaderNode *clone() const; void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } bool has_object_dependency() { return true; } ustring filename; NodeTexVoxelSpace space; InterpolationType interpolation; Transform tfm; float3 vector; ImageManager *image_manager; int slot; void *builtin_data; virtual bool equals(const ShaderNode& other) { const PointDensityTextureNode& point_dendity_node = (const PointDensityTextureNode&)other; return ShaderNode::equals(other) && builtin_data == point_dendity_node.builtin_data; } }; class MappingNode : public ShaderNode { public: SHADER_NODE_CLASS(MappingNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } float3 vector; TextureMapping tex_mapping; }; class RGBToBWNode : public ShaderNode { public: SHADER_NODE_CLASS(RGBToBWNode) void constant_fold(const ConstantFolder& folder); float3 color; }; class ConvertNode : public ShaderNode { public: ConvertNode(SocketType::Type from, SocketType::Type to, bool autoconvert = false); SHADER_NODE_BASE_CLASS(ConvertNode) void constant_fold(const ConstantFolder& folder); SocketType::Type from, to; union { float value_float; int value_int; float3 value_color; float3 value_vector; float3 value_point; float3 value_normal; }; ustring value_string; private: static const int MAX_TYPE = 12; static bool register_types(); static Node* create(const NodeType *type); static const NodeType *node_types[MAX_TYPE][MAX_TYPE]; static bool initialized; }; class BsdfBaseNode : public ShaderNode { public: BsdfBaseNode(const NodeType *node_type); bool has_spatial_varying() { return true; } virtual ClosureType get_closure_type() { return closure; } virtual bool has_bump(); virtual bool equals(const ShaderNode& /*other*/) { /* TODO(sergey): With some care BSDF nodes can be de-duplicated. */ return false; } ClosureType closure; }; class BsdfNode : public BsdfBaseNode { public: explicit BsdfNode(const NodeType *node_type); SHADER_NODE_BASE_CLASS(BsdfNode) void compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2, ShaderInput *param3 = NULL, ShaderInput *param4 = NULL); float3 color; float3 normal; float surface_mix_weight; }; class AnisotropicBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(AnisotropicBsdfNode) float3 tangent; float roughness, anisotropy, rotation; ClosureType distribution; ClosureType get_closure_type() { return distribution; } void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } }; class DiffuseBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(DiffuseBsdfNode) float roughness; }; /* Disney principled BRDF */ class PrincipledBsdfNode : public BsdfBaseNode { public: SHADER_NODE_CLASS(PrincipledBsdfNode) bool has_surface_bssrdf(); bool has_bssrdf_bump(); void compile(SVMCompiler& compiler, ShaderInput *metallic, ShaderInput *subsurface, ShaderInput *subsurface_radius, ShaderInput *specular, ShaderInput *roughness, ShaderInput *specular_tint, ShaderInput *anisotropic, ShaderInput *sheen, ShaderInput *sheen_tint, ShaderInput *clearcoat, ShaderInput *clearcoat_roughness, ShaderInput *ior, ShaderInput *transmission, ShaderInput *anisotropic_rotation, ShaderInput *transmission_roughness); float3 base_color; float3 subsurface_color, subsurface_radius; float metallic, subsurface, specular, roughness, specular_tint, anisotropic, sheen, sheen_tint, clearcoat, clearcoat_roughness, ior, transmission, anisotropic_rotation, transmission_roughness; float3 normal, clearcoat_normal, tangent; float surface_mix_weight; ClosureType distribution, distribution_orig; ClosureType subsurface_method; bool has_integrator_dependency(); void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } }; class TranslucentBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(TranslucentBsdfNode) }; class TransparentBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(TransparentBsdfNode) bool has_surface_transparent() { return true; } }; class VelvetBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(VelvetBsdfNode) float sigma; }; class GlossyBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(GlossyBsdfNode) void simplify_settings(Scene *scene); bool has_integrator_dependency(); ClosureType get_closure_type() { return distribution; } float roughness, roughness_orig; ClosureType distribution, distribution_orig; }; class GlassBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(GlassBsdfNode) void simplify_settings(Scene *scene); bool has_integrator_dependency(); ClosureType get_closure_type() { return distribution; } float roughness, roughness_orig, IOR; ClosureType distribution, distribution_orig; }; class RefractionBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(RefractionBsdfNode) void simplify_settings(Scene *scene); bool has_integrator_dependency(); ClosureType get_closure_type() { return distribution; } float roughness, roughness_orig, IOR; ClosureType distribution, distribution_orig; }; class ToonBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(ToonBsdfNode) float smooth, size; ClosureType component; }; class SubsurfaceScatteringNode : public BsdfNode { public: SHADER_NODE_CLASS(SubsurfaceScatteringNode) bool has_surface_bssrdf() { return true; } bool has_bssrdf_bump(); ClosureType get_closure_type() { return falloff; } float scale; float3 radius; float sharpness; float texture_blur; ClosureType falloff; }; class EmissionNode : public ShaderNode { public: SHADER_NODE_CLASS(EmissionNode) void constant_fold(const ConstantFolder& folder); bool has_surface_emission() { return true; } bool has_volume_support() { return true; } float3 color; float strength; float surface_mix_weight; }; class BackgroundNode : public ShaderNode { public: SHADER_NODE_CLASS(BackgroundNode) void constant_fold(const ConstantFolder& folder); float3 color; float strength; float surface_mix_weight; }; class HoldoutNode : public ShaderNode { public: SHADER_NODE_CLASS(HoldoutNode) virtual int get_group() { return NODE_GROUP_LEVEL_1; } virtual ClosureType get_closure_type() { return CLOSURE_HOLDOUT_ID; } float surface_mix_weight; float volume_mix_weight; }; class AmbientOcclusionNode : public ShaderNode { public: SHADER_NODE_CLASS(AmbientOcclusionNode) bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_1; } virtual ClosureType get_closure_type() { return CLOSURE_AMBIENT_OCCLUSION_ID; } float3 normal_osl; float3 color; float surface_mix_weight; }; class VolumeNode : public ShaderNode { public: VolumeNode(const NodeType *node_type); SHADER_NODE_BASE_CLASS(VolumeNode) void compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2); virtual int get_group() { return NODE_GROUP_LEVEL_1; } virtual int get_feature() { return ShaderNode::get_feature() | NODE_FEATURE_VOLUME; } virtual ClosureType get_closure_type() { return closure; } virtual bool has_volume_support() { return true; } float3 color; float density; float volume_mix_weight; ClosureType closure; virtual bool equals(const ShaderNode& /*other*/) { /* TODO(sergey): With some care Volume nodes can be de-duplicated. */ return false; } }; class AbsorptionVolumeNode : public VolumeNode { public: SHADER_NODE_CLASS(AbsorptionVolumeNode) }; class ScatterVolumeNode : public VolumeNode { public: SHADER_NODE_CLASS(ScatterVolumeNode) float anisotropy; }; class PrincipledVolumeNode : public VolumeNode { public: SHADER_NODE_CLASS(PrincipledVolumeNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } ustring density_attribute; ustring color_attribute; ustring temperature_attribute; float anisotropy; float3 absorption_color; float emission_strength; float3 emission_color; float blackbody_intensity; float3 blackbody_tint; float temperature; }; class HairBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(HairBsdfNode) ClosureType get_closure_type() { return component; } ClosureType component; float offset; float roughness_u; float roughness_v; float3 tangent; }; class GeometryNode : public ShaderNode { public: SHADER_NODE_CLASS(GeometryNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } float3 normal_osl; }; class TextureCoordinateNode : public ShaderNode { public: SHADER_NODE_CLASS(TextureCoordinateNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } bool has_object_dependency() { return use_transform; } float3 normal_osl; bool from_dupli; bool use_transform; Transform ob_tfm; }; class UVMapNode : public ShaderNode { public: SHADER_NODE_CLASS(UVMapNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_1; } ustring attribute; bool from_dupli; }; class LightPathNode : public ShaderNode { public: SHADER_NODE_CLASS(LightPathNode) virtual int get_group() { return NODE_GROUP_LEVEL_1; } }; class LightFalloffNode : public ShaderNode { public: SHADER_NODE_CLASS(LightFalloffNode) bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_2; } float strength; float smooth; }; class ObjectInfoNode : public ShaderNode { public: SHADER_NODE_CLASS(ObjectInfoNode) virtual int get_group() { return NODE_GROUP_LEVEL_1; } }; class ParticleInfoNode : public ShaderNode { public: SHADER_NODE_CLASS(ParticleInfoNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_1; } }; class HairInfoNode : public ShaderNode { public: SHADER_NODE_CLASS(HairInfoNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_1; } virtual int get_feature() { return ShaderNode::get_feature() | NODE_FEATURE_HAIR; } }; class ValueNode : public ShaderNode { public: SHADER_NODE_CLASS(ValueNode) void constant_fold(const ConstantFolder& folder); float value; }; class ColorNode : public ShaderNode { public: SHADER_NODE_CLASS(ColorNode) void constant_fold(const ConstantFolder& folder); float3 value; }; class AddClosureNode : public ShaderNode { public: SHADER_NODE_CLASS(AddClosureNode) void constant_fold(const ConstantFolder& folder); }; class MixClosureNode : public ShaderNode { public: SHADER_NODE_CLASS(MixClosureNode) void constant_fold(const ConstantFolder& folder); float fac; }; class MixClosureWeightNode : public ShaderNode { public: SHADER_NODE_CLASS(MixClosureWeightNode) float weight; float fac; }; class InvertNode : public ShaderNode { public: SHADER_NODE_CLASS(InvertNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float fac; float3 color; }; class MixNode : public ShaderNode { public: SHADER_NODE_CLASS(MixNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } NodeMix type; bool use_clamp; float3 color1; float3 color2; float fac; }; class CombineRGBNode : public ShaderNode { public: SHADER_NODE_CLASS(CombineRGBNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float r, g, b; }; class CombineHSVNode : public ShaderNode { public: SHADER_NODE_CLASS(CombineHSVNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float h, s, v; }; class CombineXYZNode : public ShaderNode { public: SHADER_NODE_CLASS(CombineXYZNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float x, y, z; }; class GammaNode : public ShaderNode { public: SHADER_NODE_CLASS(GammaNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_1; } float3 color; float gamma; }; class BrightContrastNode : public ShaderNode { public: SHADER_NODE_CLASS(BrightContrastNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_1; } float3 color; float bright; float contrast; }; class SeparateRGBNode : public ShaderNode { public: SHADER_NODE_CLASS(SeparateRGBNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float3 color; }; class SeparateHSVNode : public ShaderNode { public: SHADER_NODE_CLASS(SeparateHSVNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float3 color; }; class SeparateXYZNode : public ShaderNode { public: SHADER_NODE_CLASS(SeparateXYZNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float3 vector; }; class HSVNode : public ShaderNode { public: SHADER_NODE_CLASS(HSVNode) float hue; float saturation; float value; float fac; float3 color; }; class AttributeNode : public ShaderNode { public: SHADER_NODE_CLASS(AttributeNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } ustring attribute; }; class CameraNode : public ShaderNode { public: SHADER_NODE_CLASS(CameraNode) bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_2; } }; class FresnelNode : public ShaderNode { public: SHADER_NODE_CLASS(FresnelNode) bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_1; } float3 normal; float IOR; }; class LayerWeightNode : public ShaderNode { public: SHADER_NODE_CLASS(LayerWeightNode) bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_1; } float3 normal; float blend; }; class WireframeNode : public ShaderNode { public: SHADER_NODE_CLASS(WireframeNode) bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_3; } float size; bool use_pixel_size; }; class WavelengthNode : public ShaderNode { public: SHADER_NODE_CLASS(WavelengthNode) virtual int get_group() { return NODE_GROUP_LEVEL_3; } float wavelength; }; class BlackbodyNode : public ShaderNode { public: SHADER_NODE_CLASS(BlackbodyNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_3; } float temperature; }; class MathNode : public ShaderNode { public: SHADER_NODE_CLASS(MathNode) virtual int get_group() { return NODE_GROUP_LEVEL_1; } void constant_fold(const ConstantFolder& folder); float value1; float value2; NodeMath type; bool use_clamp; }; class NormalNode : public ShaderNode { public: SHADER_NODE_CLASS(NormalNode) virtual int get_group() { return NODE_GROUP_LEVEL_2; } float3 direction; float3 normal; }; class VectorMathNode : public ShaderNode { public: SHADER_NODE_CLASS(VectorMathNode) virtual int get_group() { return NODE_GROUP_LEVEL_1; } void constant_fold(const ConstantFolder& folder); float3 vector1; float3 vector2; NodeVectorMath type; }; class VectorTransformNode : public ShaderNode { public: SHADER_NODE_CLASS(VectorTransformNode) virtual int get_group() { return NODE_GROUP_LEVEL_3; } NodeVectorTransformType type; NodeVectorTransformConvertSpace convert_from; NodeVectorTransformConvertSpace convert_to; float3 vector; }; class BumpNode : public ShaderNode { public: SHADER_NODE_CLASS(BumpNode) void constant_fold(const ConstantFolder& folder); bool has_spatial_varying() { return true; } virtual int get_feature() { return NODE_FEATURE_BUMP; } bool invert; bool use_object_space; float height; float sample_center; float sample_x; float sample_y; float3 normal; float strength; float distance; }; class CurvesNode : public ShaderNode { public: explicit CurvesNode(const NodeType *node_type); SHADER_NODE_BASE_CLASS(CurvesNode) virtual int get_group() { return NODE_GROUP_LEVEL_3; } array curves; float min_x, max_x, fac; float3 value; protected: void constant_fold(const ConstantFolder& folder, ShaderInput *value_in); void compile(SVMCompiler& compiler, int type, ShaderInput *value_in, ShaderOutput *value_out); void compile(OSLCompiler& compiler, const char *name); }; class RGBCurvesNode : public CurvesNode { public: SHADER_NODE_CLASS(RGBCurvesNode) void constant_fold(const ConstantFolder& folder); }; class VectorCurvesNode : public CurvesNode { public: SHADER_NODE_CLASS(VectorCurvesNode) void constant_fold(const ConstantFolder& folder); }; class RGBRampNode : public ShaderNode { public: SHADER_NODE_CLASS(RGBRampNode) void constant_fold(const ConstantFolder& folder); virtual int get_group() { return NODE_GROUP_LEVEL_1; } array ramp; array ramp_alpha; float fac; bool interpolate; }; class SetNormalNode : public ShaderNode { public: SHADER_NODE_CLASS(SetNormalNode) float3 direction; }; class OSLNode : public ShaderNode { public: static OSLNode *create(size_t num_inputs, const OSLNode *from = NULL); ~OSLNode(); ShaderNode *clone() const; char* input_default_value(); void add_input(ustring name, SocketType::Type type); void add_output(ustring name, SocketType::Type type); SHADER_NODE_NO_CLONE_CLASS(OSLNode) /* ideally we could beter detect this, but we can't query this now */ bool has_spatial_varying() { return true; } bool has_volume_support() { return true; } virtual bool equals(const ShaderNode& /*other*/) { return false; } string filepath; string bytecode_hash; }; class NormalMapNode : public ShaderNode { public: SHADER_NODE_CLASS(NormalMapNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_3; } NodeNormalMapSpace space; ustring attribute; float strength; float3 color; float3 normal_osl; }; class TangentNode : public ShaderNode { public: SHADER_NODE_CLASS(TangentNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_3; } NodeTangentDirectionType direction_type; NodeTangentAxis axis; ustring attribute; float3 normal_osl; }; class BevelNode : public ShaderNode { public: SHADER_NODE_CLASS(BevelNode) bool has_spatial_varying() { return true; } virtual int get_group() { return NODE_GROUP_LEVEL_3; } virtual bool has_raytrace() { return true; } float radius; float3 normal; int samples; }; class DisplacementNode : public ShaderNode { public: SHADER_NODE_CLASS(DisplacementNode) virtual int get_feature() { return NODE_FEATURE_BUMP; } NodeNormalMapSpace space; float height; float midlevel; float scale; float3 normal; }; class VectorDisplacementNode : public ShaderNode { public: SHADER_NODE_CLASS(VectorDisplacementNode) void attributes(Shader *shader, AttributeRequestSet *attributes); bool has_attribute_dependency() { return true; } virtual int get_feature() { return NODE_FEATURE_BUMP; } NodeNormalMapSpace space; ustring attribute; float3 vector; float midlevel; float scale; }; CCL_NAMESPACE_END #endif /* __NODES_H__ */ goxel-0.8.1/ext_src/cycles/src/render/object.cpp000066400000000000000000000525741334742672700216430ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/camera.h" #include "device/device.h" #include "render/light.h" #include "render/mesh.h" #include "render/curves.h" #include "render/object.h" #include "render/particles.h" #include "render/scene.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_map.h" #include "util/util_progress.h" #include "util/util_vector.h" #include "subd/subd_patch_table.h" CCL_NAMESPACE_BEGIN /* Object */ NODE_DEFINE(Object) { NodeType* type = NodeType::add("object", create); SOCKET_NODE(mesh, "Mesh", &Mesh::node_type); SOCKET_TRANSFORM(tfm, "Transform", transform_identity()); SOCKET_UINT(visibility, "Visibility", ~0); SOCKET_UINT(random_id, "Random ID", 0); SOCKET_INT(pass_id, "Pass ID", 0); SOCKET_BOOLEAN(use_holdout, "Use Holdout", false); SOCKET_BOOLEAN(hide_on_missing_motion, "Hide on Missing Motion", false); SOCKET_POINT(dupli_generated, "Dupli Generated", make_float3(0.0f, 0.0f, 0.0f)); SOCKET_POINT2(dupli_uv, "Dupli UV", make_float2(0.0f, 0.0f)); SOCKET_BOOLEAN(is_shadow_catcher, "Shadow Catcher", false); return type; } Object::Object() : Node(node_type) { particle_system = NULL; particle_index = 0; bounds = BoundBox::empty; motion.pre = transform_empty(); motion.mid = transform_empty(); motion.post = transform_empty(); use_motion = false; } Object::~Object() { } void Object::compute_bounds(bool motion_blur) { BoundBox mbounds = mesh->bounds; if(motion_blur && use_motion) { MotionTransform mtfm = motion; if(hide_on_missing_motion) { /* Hide objects that have no valid previous or next transform, for * example particle that stop existing. TODO: add support for this * case in the kernel so we don't get render artifacts. */ if(mtfm.pre == transform_empty() || mtfm.post == transform_empty()) { bounds = BoundBox::empty; return; } } /* In case of missing motion information for previous/next frame, * assume there is no motion. */ if(mtfm.pre == transform_empty()) { mtfm.pre = tfm; } if(mtfm.post == transform_empty()) { mtfm.post = tfm; } MotionTransform decomp; transform_motion_decompose(&decomp, &mtfm, &tfm); bounds = BoundBox::empty; /* todo: this is really terrible. according to pbrt there is a better * way to find this iteratively, but did not find implementation yet * or try to implement myself */ for(float t = 0.0f; t < 1.0f; t += (1.0f/128.0f)) { Transform ttfm; transform_motion_interpolate(&ttfm, &decomp, t); bounds.grow(mbounds.transformed(&ttfm)); } } else { if(mesh->transform_applied) { bounds = mbounds; } else { bounds = mbounds.transformed(&tfm); } } } void Object::apply_transform(bool apply_to_motion) { if(!mesh || tfm == transform_identity()) return; /* triangles */ if(mesh->verts.size()) { /* store matrix to transform later. when accessing these as attributes we * do not want the transform to be applied for consistency between static * and dynamic BVH, so we do it on packing. */ mesh->transform_normal = transform_transpose(transform_inverse(tfm)); /* apply to mesh vertices */ for(size_t i = 0; i < mesh->verts.size(); i++) mesh->verts[i] = transform_point(&tfm, mesh->verts[i]); if(apply_to_motion) { Attribute *attr = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); if(attr) { size_t steps_size = mesh->verts.size() * (mesh->motion_steps - 1); float3 *vert_steps = attr->data_float3(); for(size_t i = 0; i < steps_size; i++) vert_steps[i] = transform_point(&tfm, vert_steps[i]); } Attribute *attr_N = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_NORMAL); if(attr_N) { Transform ntfm = mesh->transform_normal; size_t steps_size = mesh->verts.size() * (mesh->motion_steps - 1); float3 *normal_steps = attr_N->data_float3(); for(size_t i = 0; i < steps_size; i++) normal_steps[i] = normalize(transform_direction(&ntfm, normal_steps[i])); } } } /* curves */ if(mesh->curve_keys.size()) { /* compute uniform scale */ float3 c0 = transform_get_column(&tfm, 0); float3 c1 = transform_get_column(&tfm, 1); float3 c2 = transform_get_column(&tfm, 2); float scalar = powf(fabsf(dot(cross(c0, c1), c2)), 1.0f/3.0f); /* apply transform to curve keys */ for(size_t i = 0; i < mesh->curve_keys.size(); i++) { float3 co = transform_point(&tfm, mesh->curve_keys[i]); float radius = mesh->curve_radius[i] * scalar; /* scale for curve radius is only correct for uniform scale */ mesh->curve_keys[i] = co; mesh->curve_radius[i] = radius; } if(apply_to_motion) { Attribute *curve_attr = mesh->curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); if(curve_attr) { /* apply transform to motion curve keys */ size_t steps_size = mesh->curve_keys.size() * (mesh->motion_steps - 1); float4 *key_steps = curve_attr->data_float4(); for(size_t i = 0; i < steps_size; i++) { float3 co = transform_point(&tfm, float4_to_float3(key_steps[i])); float radius = key_steps[i].w * scalar; /* scale for curve radius is only correct for uniform scale */ key_steps[i] = float3_to_float4(co); key_steps[i].w = radius; } } } } /* we keep normals pointing in same direction on negative scale, notify * mesh about this in it (re)calculates normals */ if(transform_negative_scale(tfm)) mesh->transform_negative_scaled = true; if(bounds.valid()) { mesh->compute_bounds(); compute_bounds(false); } /* tfm is not reset to identity, all code that uses it needs to check the * transform_applied boolean */ } void Object::tag_update(Scene *scene) { if(mesh) { if(mesh->transform_applied) mesh->need_update = true; foreach(Shader *shader, mesh->used_shaders) { if(shader->use_mis && shader->has_surface_emission) scene->light_manager->need_update = true; } } scene->camera->need_flags_update = true; scene->curve_system_manager->need_update = true; scene->mesh_manager->need_update = true; scene->object_manager->need_update = true; } vector Object::motion_times() { /* compute times at which we sample motion for this object */ vector times; if(!mesh || mesh->motion_steps == 1) return times; int motion_steps = mesh->motion_steps; for(int step = 0; step < motion_steps; step++) { if(step != motion_steps / 2) { float time = 2.0f * step / (motion_steps - 1) - 1.0f; times.push_back(time); } } return times; } bool Object::is_traceable() { /* Mesh itself can be empty,can skip all such objects. */ if(!bounds.valid() || bounds.size() == make_float3(0.0f, 0.0f, 0.0f)) { return false; } /* TODO(sergey): Check for mesh vertices/curves. visibility flags. */ return true; } uint Object::visibility_for_tracing() const { uint trace_visibility = visibility; if(is_shadow_catcher) { trace_visibility &= ~PATH_RAY_SHADOW_NON_CATCHER; } else { trace_visibility &= ~PATH_RAY_SHADOW_CATCHER; } return trace_visibility; } /* Object Manager */ ObjectManager::ObjectManager() { need_update = true; need_flags_update = true; } ObjectManager::~ObjectManager() { } void ObjectManager::device_update_object_transform(UpdateObjectTransformState *state, Object *ob, int object_index) { float4 *objects = state->objects; float4 *objects_vector = state->objects_vector; Mesh *mesh = ob->mesh; uint flag = 0; /* Compute transformations. */ Transform tfm = ob->tfm; Transform itfm = transform_inverse(tfm); /* Compute surface area. for uniform scale we can do avoid the many * transform calls and share computation for instances. * * TODO(brecht): Correct for displacement, and move to a better place. */ float uniform_scale; float surface_area = 0.0f; float pass_id = ob->pass_id; float random_number = (float)ob->random_id * (1.0f/(float)0xFFFFFFFF); int particle_index = (ob->particle_system) ? ob->particle_index + state->particle_offset[ob->particle_system] : 0; if(transform_uniform_scale(tfm, uniform_scale)) { map::iterator it; /* NOTE: This isn't fully optimal and could in theory lead to multiple * threads calculating area of the same mesh in parallel. However, this * also prevents suspending all the threads when some mesh's area is * not yet known. */ state->surface_area_lock.lock(); it = state->surface_area_map.find(mesh); state->surface_area_lock.unlock(); if(it == state->surface_area_map.end()) { size_t num_triangles = mesh->num_triangles(); for(size_t j = 0; j < num_triangles; j++) { Mesh::Triangle t = mesh->get_triangle(j); float3 p1 = mesh->verts[t.v[0]]; float3 p2 = mesh->verts[t.v[1]]; float3 p3 = mesh->verts[t.v[2]]; surface_area += triangle_area(p1, p2, p3); } state->surface_area_lock.lock(); state->surface_area_map[mesh] = surface_area; state->surface_area_lock.unlock(); } else { surface_area = it->second; } surface_area *= uniform_scale; } else { size_t num_triangles = mesh->num_triangles(); for(size_t j = 0; j < num_triangles; j++) { Mesh::Triangle t = mesh->get_triangle(j); float3 p1 = transform_point(&tfm, mesh->verts[t.v[0]]); float3 p2 = transform_point(&tfm, mesh->verts[t.v[1]]); float3 p3 = transform_point(&tfm, mesh->verts[t.v[2]]); surface_area += triangle_area(p1, p2, p3); } } /* Pack in texture. */ int offset = object_index*OBJECT_SIZE; /* OBJECT_TRANSFORM */ memcpy(&objects[offset], &tfm, sizeof(float4)*3); /* OBJECT_INVERSE_TRANSFORM */ memcpy(&objects[offset+4], &itfm, sizeof(float4)*3); /* OBJECT_PROPERTIES */ objects[offset+12] = make_float4(surface_area, pass_id, random_number, __int_as_float(particle_index)); if(mesh->use_motion_blur) { state->have_motion = true; } if(mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION)) { flag |= SD_OBJECT_HAS_VERTEX_MOTION; } if(state->need_motion == Scene::MOTION_PASS) { /* Motion transformations, is world/object space depending if mesh * comes with deformed position in object space, or if we transform * the shading point in world space. */ MotionTransform mtfm = ob->motion; /* In case of missing motion information for previous/next frame, * assume there is no motion. */ if(!ob->use_motion || mtfm.pre == transform_empty()) { mtfm.pre = ob->tfm; } if(!ob->use_motion || mtfm.post == transform_empty()) { mtfm.post = ob->tfm; } if(!mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION)) { mtfm.pre = mtfm.pre * itfm; mtfm.post = mtfm.post * itfm; } memcpy(&objects_vector[object_index*OBJECT_VECTOR_SIZE+0], &mtfm.pre, sizeof(float4)*3); memcpy(&objects_vector[object_index*OBJECT_VECTOR_SIZE+3], &mtfm.post, sizeof(float4)*3); } else if(state->need_motion == Scene::MOTION_BLUR) { if(ob->use_motion) { /* decompose transformations for interpolation. */ MotionTransform decomp; transform_motion_decompose(&decomp, &ob->motion, &ob->tfm); memcpy(&objects[offset], &decomp, sizeof(float4)*12); flag |= SD_OBJECT_MOTION; state->have_motion = true; } } /* Dupli object coords and motion info. */ int totalsteps = mesh->motion_steps; int numsteps = (totalsteps - 1)/2; int numverts = mesh->verts.size(); int numkeys = mesh->curve_keys.size(); objects[offset+13] = make_float4(ob->dupli_generated[0], ob->dupli_generated[1], ob->dupli_generated[2], __int_as_float(numkeys)); objects[offset+14] = make_float4(ob->dupli_uv[0], ob->dupli_uv[1], __int_as_float(numsteps), __int_as_float(numverts)); objects[offset+15] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); /* Object flag. */ if(ob->use_holdout) { flag |= SD_OBJECT_HOLDOUT_MASK; } state->object_flag[object_index] = flag; /* Have curves. */ if(mesh->num_curves()) { state->have_curves = true; } } bool ObjectManager::device_update_object_transform_pop_work( UpdateObjectTransformState *state, int *start_index, int *num_objects) { /* Tweakable parameter, number of objects per chunk. * Too small value will cause some extra overhead due to spin lock, * too big value might not use all threads nicely. */ static const int OBJECTS_PER_TASK = 32; bool have_work = false; state->queue_lock.lock(); int num_scene_objects = state->scene->objects.size(); if(state->queue_start_object < num_scene_objects) { int count = min(OBJECTS_PER_TASK, num_scene_objects - state->queue_start_object); *start_index = state->queue_start_object; *num_objects = count; state->queue_start_object += count; have_work = true; } state->queue_lock.unlock(); return have_work; } void ObjectManager::device_update_object_transform_task( UpdateObjectTransformState *state) { int start_index, num_objects; while(device_update_object_transform_pop_work(state, &start_index, &num_objects)) { for(int i = 0; i < num_objects; ++i) { const int object_index = start_index + i; Object *ob = state->scene->objects[object_index]; device_update_object_transform(state, ob, object_index); } } } void ObjectManager::device_update_transforms(DeviceScene *dscene, Scene *scene, uint *object_flag, Progress& progress) { UpdateObjectTransformState state; state.need_motion = scene->need_motion(); state.have_motion = false; state.have_curves = false; state.scene = scene; state.queue_start_object = 0; state.object_flag = object_flag; state.objects = dscene->objects.alloc(OBJECT_SIZE*scene->objects.size()); if(state.need_motion == Scene::MOTION_PASS) { state.objects_vector = dscene->objects_vector.alloc(OBJECT_VECTOR_SIZE*scene->objects.size()); } else { state.objects_vector = NULL; } /* Particle system device offsets * 0 is dummy particle, index starts at 1. */ int numparticles = 1; foreach(ParticleSystem *psys, scene->particle_systems) { state.particle_offset[psys] = numparticles; numparticles += psys->particles.size(); } /* NOTE: If it's just a handful of objects we deal with them in a single * thread to avoid threading overhead. However, this threshold is might * need some tweaks to make mid-complex scenes optimal. */ if(scene->objects.size() < 64) { int object_index = 0; foreach(Object *ob, scene->objects) { device_update_object_transform(&state, ob, object_index); object_index++; if(progress.get_cancel()) { return; } } } else { const int num_threads = TaskScheduler::num_threads(); TaskPool pool; for(int i = 0; i < num_threads; ++i) { pool.push(function_bind( &ObjectManager::device_update_object_transform_task, this, &state)); } pool.wait_work(); if(progress.get_cancel()) { return; } } dscene->objects.copy_to_device(); if(state.need_motion == Scene::MOTION_PASS) { dscene->objects_vector.copy_to_device(); } dscene->data.bvh.have_motion = state.have_motion; dscene->data.bvh.have_curves = state.have_curves; dscene->data.bvh.have_instancing = true; } void ObjectManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { if(!need_update) return; VLOG(1) << "Total " << scene->objects.size() << " objects."; device_free(device, dscene); if(scene->objects.size() == 0) return; /* object info flag */ uint *object_flag = dscene->object_flag.alloc(scene->objects.size()); /* set object transform matrices, before applying static transforms */ progress.set_status("Updating Objects", "Copying Transformations to device"); device_update_transforms(dscene, scene, object_flag, progress); if(progress.get_cancel()) return; /* prepare for static BVH building */ /* todo: do before to support getting object level coords? */ if(scene->params.bvh_type == SceneParams::BVH_STATIC) { progress.set_status("Updating Objects", "Applying Static Transformations"); apply_static_transforms(dscene, scene, object_flag, progress); } } void ObjectManager::device_update_flags(Device *, DeviceScene *dscene, Scene *scene, Progress& /*progress*/, bool bounds_valid) { if(!need_update && !need_flags_update) return; need_update = false; need_flags_update = false; if(scene->objects.size() == 0) return; /* object info flag */ uint *object_flag = dscene->object_flag.data(); vector volume_objects; bool has_volume_objects = false; foreach(Object *object, scene->objects) { if(object->mesh->has_volume) { if(bounds_valid) { volume_objects.push_back(object); } has_volume_objects = true; } } int object_index = 0; foreach(Object *object, scene->objects) { if(object->mesh->has_volume) { object_flag[object_index] |= SD_OBJECT_HAS_VOLUME; object_flag[object_index] &= ~SD_OBJECT_HAS_VOLUME_ATTRIBUTES; foreach(Attribute& attr, object->mesh->attributes.attributes) { if(attr.element == ATTR_ELEMENT_VOXEL) { object_flag[object_index] |= SD_OBJECT_HAS_VOLUME_ATTRIBUTES; } } } else { object_flag[object_index] &= ~(SD_OBJECT_HAS_VOLUME|SD_OBJECT_HAS_VOLUME_ATTRIBUTES); } if(object->is_shadow_catcher) { object_flag[object_index] |= SD_OBJECT_SHADOW_CATCHER; } else { object_flag[object_index] &= ~SD_OBJECT_SHADOW_CATCHER; } if(bounds_valid) { foreach(Object *volume_object, volume_objects) { if(object == volume_object) { continue; } if(object->bounds.intersects(volume_object->bounds)) { object_flag[object_index] |= SD_OBJECT_INTERSECTS_VOLUME; break; } } } else if(has_volume_objects) { /* Not really valid, but can't make more reliable in the case * of bounds not being up to date. */ object_flag[object_index] |= SD_OBJECT_INTERSECTS_VOLUME; } ++object_index; } /* allocate object flag */ dscene->object_flag.copy_to_device(); } void ObjectManager::device_update_mesh_offsets(Device *, DeviceScene *dscene, Scene *scene) { if(dscene->objects.size() == 0) { return; } uint4* objects = (uint4*)dscene->objects.data(); bool update = false; int object_index = 0; foreach(Object *object, scene->objects) { Mesh* mesh = object->mesh; int offset = object_index*OBJECT_SIZE + 15; if(mesh->patch_table) { uint patch_map_offset = 2*(mesh->patch_table_offset + mesh->patch_table->total_size() - mesh->patch_table->num_nodes * PATCH_NODE_SIZE) - mesh->patch_offset; if(objects[offset].x != patch_map_offset) { objects[offset].x = patch_map_offset; update = true; } } if(objects[offset].y != mesh->attr_map_offset) { objects[offset].y = mesh->attr_map_offset; update = true; } object_index++; } if(update) { dscene->objects.copy_to_device(); } } void ObjectManager::device_free(Device *, DeviceScene *dscene) { dscene->objects.free(); dscene->objects_vector.free(); dscene->object_flag.free(); } void ObjectManager::apply_static_transforms(DeviceScene *dscene, Scene *scene, uint *object_flag, Progress& progress) { /* todo: normals and displacement should be done before applying transform! */ /* todo: create objects/meshes in right order! */ /* counter mesh users */ map mesh_users; Scene::MotionType need_motion = scene->need_motion(); bool motion_blur = need_motion == Scene::MOTION_BLUR; bool apply_to_motion = need_motion != Scene::MOTION_PASS; int i = 0; bool have_instancing = false; foreach(Object *object, scene->objects) { map::iterator it = mesh_users.find(object->mesh); if(it == mesh_users.end()) mesh_users[object->mesh] = 1; else it->second++; } if(progress.get_cancel()) return; /* apply transforms for objects with single user meshes */ foreach(Object *object, scene->objects) { /* Annoying feedback loop here: we can't use is_instanced() because * it'll use uninitialized transform_applied flag. * * Could be solved by moving reference counter to Mesh. */ if((mesh_users[object->mesh] == 1 && !object->mesh->has_surface_bssrdf) && !object->mesh->has_true_displacement() && object->mesh->subdivision_type == Mesh::SUBDIVISION_NONE) { if(!(motion_blur && object->use_motion)) { if(!object->mesh->transform_applied) { object->apply_transform(apply_to_motion); object->mesh->transform_applied = true; if(progress.get_cancel()) return; } object_flag[i] |= SD_OBJECT_TRANSFORM_APPLIED; if(object->mesh->transform_negative_scaled) object_flag[i] |= SD_OBJECT_NEGATIVE_SCALE_APPLIED; } else have_instancing = true; } else have_instancing = true; i++; } dscene->data.bvh.have_instancing = have_instancing; } void ObjectManager::tag_update(Scene *scene) { need_update = true; scene->curve_system_manager->need_update = true; scene->mesh_manager->need_update = true; scene->light_manager->need_update = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/object.h000066400000000000000000000104451334742672700212770ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __OBJECT_H__ #define __OBJECT_H__ #include "graph/node.h" #include "render/scene.h" #include "util/util_boundbox.h" #include "util/util_param.h" #include "util/util_transform.h" #include "util/util_thread.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Mesh; class ParticleSystem; class Progress; class Scene; struct Transform; /* Object */ class Object : public Node { public: NODE_DECLARE Mesh *mesh; Transform tfm; BoundBox bounds; uint random_id; int pass_id; vector attributes; uint visibility; MotionTransform motion; bool use_motion; bool hide_on_missing_motion; bool use_holdout; bool is_shadow_catcher; float3 dupli_generated; float2 dupli_uv; ParticleSystem *particle_system; int particle_index; Object(); ~Object(); void tag_update(Scene *scene); void compute_bounds(bool motion_blur); void apply_transform(bool apply_to_motion); vector motion_times(); /* Check whether object is traceable and it worth adding it to * kernel scene. */ bool is_traceable(); /* Combine object's visibility with all possible internal run-time * determined flags which denotes trace-time visibility. */ uint visibility_for_tracing() const; }; /* Object Manager */ class ObjectManager { public: bool need_update; bool need_flags_update; ObjectManager(); ~ObjectManager(); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_update_transforms(DeviceScene *dscene, Scene *scene, uint *object_flag, Progress& progress); void device_update_flags(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress, bool bounds_valid = true); void device_update_mesh_offsets(Device *device, DeviceScene *dscene, Scene *scene); void device_free(Device *device, DeviceScene *dscene); void tag_update(Scene *scene); void apply_static_transforms(DeviceScene *dscene, Scene *scene, uint *object_flag, Progress& progress); protected: /* Global state of object transform update. */ struct UpdateObjectTransformState { /* Global state used by device_update_object_transform(). * Common for both threaded and non-threaded update. */ /* Type of the motion required by the scene settings. */ Scene::MotionType need_motion; /* Mapping from particle system to a index in packed particle array. * Only used for read. */ map particle_offset; /* Mesh area. * Used to avoid calculation of mesh area multiple times. Used for both * read and write. Acquire surface_area_lock to keep it all thread safe. */ map surface_area_map; /* Packed object arrays. Those will be filled in. */ uint *object_flag; float4 *objects; float4 *objects_vector; /* Flags which will be synchronized to Integrator. */ bool have_motion; bool have_curves; /* ** Scheduling queue. ** */ Scene *scene; /* Some locks to keep everything thread-safe. */ thread_spin_lock queue_lock; thread_spin_lock surface_area_lock; /* First unused object index in the queue. */ int queue_start_object; }; void device_update_object_transform(UpdateObjectTransformState *state, Object *ob, const int object_index); void device_update_object_transform_task(UpdateObjectTransformState *state); bool device_update_object_transform_pop_work( UpdateObjectTransformState *state, int *start_index, int *num_objects); }; CCL_NAMESPACE_END #endif /* __OBJECT_H__ */ goxel-0.8.1/ext_src/cycles/src/render/osl.cpp000066400000000000000000001032661334742672700211650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/graph.h" #include "render/light.h" #include "render/osl.h" #include "render/scene.h" #include "render/shader.h" #include "render/nodes.h" #ifdef WITH_OSL #include "kernel/osl/osl_globals.h" #include "kernel/osl/osl_services.h" #include "kernel/osl/osl_shader.h" #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_md5.h" #include "util/util_path.h" #include "util/util_progress.h" #endif CCL_NAMESPACE_BEGIN #ifdef WITH_OSL /* Shared Texture and Shading System */ OSL::TextureSystem *OSLShaderManager::ts_shared = NULL; int OSLShaderManager::ts_shared_users = 0; thread_mutex OSLShaderManager::ts_shared_mutex; OSL::ShadingSystem *OSLShaderManager::ss_shared = NULL; OSLRenderServices *OSLShaderManager::services_shared = NULL; int OSLShaderManager::ss_shared_users = 0; thread_mutex OSLShaderManager::ss_shared_mutex; thread_mutex OSLShaderManager::ss_mutex; /* Shader Manager */ OSLShaderManager::OSLShaderManager() { texture_system_init(); shading_system_init(); } OSLShaderManager::~OSLShaderManager() { shading_system_free(); texture_system_free(); } void OSLShaderManager::reset(Scene * /*scene*/) { shading_system_free(); shading_system_init(); } void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { if(!need_update) return; VLOG(1) << "Total " << scene->shaders.size() << " shaders."; device_free(device, dscene, scene); /* determine which shaders are in use */ device_update_shaders_used(scene); /* create shaders */ OSLGlobals *og = (OSLGlobals*)device->osl_memory(); foreach(Shader *shader, scene->shaders) { assert(shader->graph); if(progress.get_cancel()) return; /* we can only compile one shader at the time as the OSL ShadingSytem * has a single state, but we put the lock here so different renders can * compile shaders alternating */ thread_scoped_lock lock(ss_mutex); OSLCompiler compiler((void*)this, (void*)ss, scene->image_manager); compiler.background = (shader == scene->default_background); compiler.compile(scene, og, shader); if(shader->use_mis && shader->has_surface_emission) scene->light_manager->need_update = true; } /* setup shader engine */ og->ss = ss; og->ts = ts; og->services = services; int background_id = scene->shader_manager->get_shader_id(scene->default_background); og->background_state = og->surface_state[background_id & SHADER_MASK]; og->use = true; foreach(Shader *shader, scene->shaders) shader->need_update = false; need_update = false; /* set texture system */ scene->image_manager->set_osl_texture_system((void*)ts); device_update_common(device, dscene, scene, progress); { /* Perform greedyjit optimization. * * This might waste time on optimizing gorups which are never actually * used, but this prevents OSL from allocating data on TLS at render * time. * * This is much better for us because this way we aren't required to * stop task scheduler threads to make sure all TLS is clean and don't * have issues with TLS data free accessing freed memory if task scheduler * is being freed after the Session is freed. */ thread_scoped_lock lock(ss_shared_mutex); ss->optimize_all_groups(); } } void OSLShaderManager::device_free(Device *device, DeviceScene *dscene, Scene *scene) { OSLGlobals *og = (OSLGlobals*)device->osl_memory(); device_free_common(device, dscene, scene); /* clear shader engine */ og->use = false; og->ss = NULL; og->ts = NULL; og->surface_state.clear(); og->volume_state.clear(); og->displacement_state.clear(); og->bump_state.clear(); og->background_state.reset(); } void OSLShaderManager::texture_system_init() { /* create texture system, shared between different renders to reduce memory usage */ thread_scoped_lock lock(ts_shared_mutex); if(ts_shared_users == 0) { ts_shared = TextureSystem::create(true); ts_shared->attribute("automip", 1); ts_shared->attribute("autotile", 64); ts_shared->attribute("gray_to_rgb", 1); /* effectively unlimited for now, until we support proper mipmap lookups */ ts_shared->attribute("max_memory_MB", 16384); } ts = ts_shared; ts_shared_users++; } void OSLShaderManager::texture_system_free() { /* shared texture system decrease users and destroy if no longer used */ thread_scoped_lock lock(ts_shared_mutex); ts_shared_users--; if(ts_shared_users == 0) { ts_shared->invalidate_all(true); OSL::TextureSystem::destroy(ts_shared); ts_shared = NULL; } ts = NULL; } void OSLShaderManager::shading_system_init() { /* create shading system, shared between different renders to reduce memory usage */ thread_scoped_lock lock(ss_shared_mutex); if(ss_shared_users == 0) { services_shared = new OSLRenderServices(); string shader_path = path_get("shader"); #ifdef _WIN32 /* Annoying thing, Cycles stores paths in UTF-8 codepage, so it can * operate with file paths with any character. This requires to use wide * char functions, but OSL uses old fashioned ANSI functions which means: * * - We have to convert our paths to ANSI before passing to OSL * - OSL can't be used when there's a multi-byte character in the path * to the shaders folder. */ shader_path = string_to_ansi(shader_path); #endif ss_shared = new OSL::ShadingSystem(services_shared, ts_shared, &errhandler); ss_shared->attribute("lockgeom", 1); ss_shared->attribute("commonspace", "world"); ss_shared->attribute("searchpath:shader", shader_path); ss_shared->attribute("greedyjit", 1); VLOG(1) << "Using shader search path: " << shader_path; /* our own ray types */ static const char *raytypes[] = { "camera", /* PATH_RAY_CAMERA */ "reflection", /* PATH_RAY_REFLECT */ "refraction", /* PATH_RAY_TRANSMIT */ "diffuse", /* PATH_RAY_DIFFUSE */ "glossy", /* PATH_RAY_GLOSSY */ "singular", /* PATH_RAY_SINGULAR */ "transparent", /* PATH_RAY_TRANSPARENT */ "shadow", /* PATH_RAY_SHADOW_OPAQUE_NON_CATCHER */ "shadow", /* PATH_RAY_SHADOW_OPAQUE_CATCHER */ "shadow", /* PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER */ "shadow", /* PATH_RAY_SHADOW_TRANSPARENT_CATCHER */ "__unused__", "volume_scatter", /* PATH_RAY_VOLUME_SCATTER */ "__unused__", "__unused__", "diffuse_ancestor", /* PATH_RAY_DIFFUSE_ANCESTOR */ "__unused__", "__unused__", "__unused__", "__unused__", "__unused__", "__unused__", "__unused__", }; const int nraytypes = sizeof(raytypes)/sizeof(raytypes[0]); ss_shared->attribute("raytypes", TypeDesc(TypeDesc::STRING, nraytypes), raytypes); OSLShader::register_closures((OSLShadingSystem*)ss_shared); loaded_shaders.clear(); } ss = ss_shared; services = services_shared; ss_shared_users++; } void OSLShaderManager::shading_system_free() { /* shared shading system decrease users and destroy if no longer used */ thread_scoped_lock lock(ss_shared_mutex); ss_shared_users--; if(ss_shared_users == 0) { delete ss_shared; ss_shared = NULL; delete services_shared; services_shared = NULL; } ss = NULL; services = NULL; } bool OSLShaderManager::osl_compile(const string& inputfile, const string& outputfile) { vector options; string stdosl_path; string shader_path = path_get("shader"); /* specify output file name */ options.push_back("-o"); options.push_back(outputfile); /* specify standard include path */ string include_path_arg = string("-I") + shader_path; options.push_back(include_path_arg); stdosl_path = path_get("shader/stdosl.h"); /* compile */ OSL::OSLCompiler *compiler = new OSL::OSLCompiler(&OSL::ErrorHandler::default_handler()); bool ok = compiler->compile(string_view(inputfile), options, string_view(stdosl_path)); delete compiler; return ok; } bool OSLShaderManager::osl_query(OSL::OSLQuery& query, const string& filepath) { string searchpath = path_user_get("shaders"); return query.open(filepath, searchpath); } static string shader_filepath_hash(const string& filepath, uint64_t modified_time) { /* compute a hash from filepath and modified time to detect changes */ MD5Hash md5; md5.append((const uint8_t*)filepath.c_str(), filepath.size()); md5.append((const uint8_t*)&modified_time, sizeof(modified_time)); return md5.get_hex(); } const char *OSLShaderManager::shader_test_loaded(const string& hash) { map::iterator it = loaded_shaders.find(hash); return (it == loaded_shaders.end())? NULL: it->first.c_str(); } OSLShaderInfo *OSLShaderManager::shader_loaded_info(const string& hash) { map::iterator it = loaded_shaders.find(hash); return (it == loaded_shaders.end())? NULL: &it->second; } const char *OSLShaderManager::shader_load_filepath(string filepath) { size_t len = filepath.size(); string extension = filepath.substr(len - 4); uint64_t modified_time = path_modified_time(filepath); if(extension == ".osl") { /* .OSL File */ string osopath = filepath.substr(0, len - 4) + ".oso"; uint64_t oso_modified_time = path_modified_time(osopath); /* test if we have loaded the corresponding .OSO already */ if(oso_modified_time != 0) { const char *hash = shader_test_loaded(shader_filepath_hash(osopath, oso_modified_time)); if(hash) return hash; } /* autocompile .OSL to .OSO if needed */ if(oso_modified_time == 0 || (oso_modified_time < modified_time)) { OSLShaderManager::osl_compile(filepath, osopath); modified_time = path_modified_time(osopath); } else modified_time = oso_modified_time; filepath = osopath; } else { if(extension == ".oso") { /* .OSO File, nothing to do */ } else if(path_dirname(filepath) == "") { /* .OSO File in search path */ filepath = path_join(path_user_get("shaders"), filepath + ".oso"); } else { /* unknown file */ return NULL; } /* test if we have loaded this .OSO already */ const char *hash = shader_test_loaded(shader_filepath_hash(filepath, modified_time)); if(hash) return hash; } /* read oso bytecode from file */ string bytecode_hash = shader_filepath_hash(filepath, modified_time); string bytecode; if(!path_read_text(filepath, bytecode)) { fprintf(stderr, "Cycles shader graph: failed to read file %s\n", filepath.c_str()); OSLShaderInfo info; loaded_shaders[bytecode_hash] = info; /* to avoid repeat tries */ return NULL; } return shader_load_bytecode(bytecode_hash, bytecode); } const char *OSLShaderManager::shader_load_bytecode(const string& hash, const string& bytecode) { ss->LoadMemoryCompiledShader(hash.c_str(), bytecode.c_str()); OSLShaderInfo info; if(!info.query.open_bytecode(bytecode)) { fprintf(stderr, "OSL query error: %s\n", info.query.geterror().c_str()); } /* this is a bit weak, but works */ info.has_surface_emission = (bytecode.find("\"emission\"") != string::npos); info.has_surface_transparent = (bytecode.find("\"transparent\"") != string::npos); info.has_surface_bssrdf = (bytecode.find("\"bssrdf\"") != string::npos); loaded_shaders[hash] = info; return loaded_shaders.find(hash)->first.c_str(); } OSLNode *OSLShaderManager::osl_node(const std::string& filepath, const std::string& bytecode_hash, const std::string& bytecode) { /* create query */ const char *hash; if(!filepath.empty()) { hash = shader_load_filepath(filepath); } else { hash = shader_test_loaded(bytecode_hash); if(!hash) hash = shader_load_bytecode(bytecode_hash, bytecode); } if(!hash) { return NULL; } OSLShaderInfo *info = shader_loaded_info(hash); /* count number of inputs */ size_t num_inputs = 0; for(int i = 0; i < info->query.nparams(); i++) { const OSL::OSLQuery::Parameter *param = info->query.getparam(i); /* skip unsupported types */ if(param->varlenarray || param->isstruct || param->type.arraylen > 1) continue; if(!param->isoutput) num_inputs++; } /* create node */ OSLNode *node = OSLNode::create(num_inputs); /* add new sockets from parameters */ set used_sockets; for(int i = 0; i < info->query.nparams(); i++) { const OSL::OSLQuery::Parameter *param = info->query.getparam(i); /* skip unsupported types */ if(param->varlenarray || param->isstruct || param->type.arraylen > 1) continue; SocketType::Type socket_type; if(param->isclosure) { socket_type = SocketType::CLOSURE; } else if(param->type.vecsemantics != TypeDesc::NOSEMANTICS) { if(param->type.vecsemantics == TypeDesc::COLOR) socket_type = SocketType::COLOR; else if(param->type.vecsemantics == TypeDesc::POINT) socket_type = SocketType::POINT; else if(param->type.vecsemantics == TypeDesc::VECTOR) socket_type = SocketType::VECTOR; else if(param->type.vecsemantics == TypeDesc::NORMAL) socket_type = SocketType::NORMAL; else continue; if(!param->isoutput && param->validdefault) { float3 *default_value = (float3*)node->input_default_value(); default_value->x = param->fdefault[0]; default_value->y = param->fdefault[1]; default_value->z = param->fdefault[2]; } } else if(param->type.aggregate == TypeDesc::SCALAR) { if(param->type.basetype == TypeDesc::INT) { socket_type = SocketType::INT; if(!param->isoutput && param->validdefault) { *(int*)node->input_default_value() = param->idefault[0]; } } else if(param->type.basetype == TypeDesc::FLOAT) { socket_type = SocketType::FLOAT; if(!param->isoutput && param->validdefault) { *(float*)node->input_default_value() = param->fdefault[0]; } } else if(param->type.basetype == TypeDesc::STRING) { socket_type = SocketType::STRING; if(!param->isoutput && param->validdefault) { *(ustring*)node->input_default_value() = param->sdefault[0]; } } else continue; } else continue; if(param->isoutput) { node->add_output(param->name, socket_type); } else { node->add_input(param->name, socket_type); } } /* set bytcode hash or filepath */ if(!bytecode_hash.empty()) { node->bytecode_hash = bytecode_hash; } else { node->filepath = filepath; } /* Generate inputs and outputs */ node->create_inputs_outputs(node->type); return node; } /* Graph Compiler */ OSLCompiler::OSLCompiler(void *manager_, void *shadingsys_, ImageManager *image_manager_) { manager = manager_; shadingsys = shadingsys_; image_manager = image_manager_; current_type = SHADER_TYPE_SURFACE; current_shader = NULL; background = false; } string OSLCompiler::id(ShaderNode *node) { /* assign layer unique name based on pointer address + bump mode */ stringstream stream; stream << "node_" << node->type->name << "_" << node; return stream.str(); } string OSLCompiler::compatible_name(ShaderNode *node, ShaderInput *input) { string sname(input->name().string()); size_t i; /* strip whitespace */ while((i = sname.find(" ")) != string::npos) sname.replace(i, 1, ""); /* if output exists with the same name, add "In" suffix */ foreach(ShaderOutput *output, node->outputs) { if(input->name() == output->name()) { sname += "In"; break; } } return sname; } string OSLCompiler::compatible_name(ShaderNode *node, ShaderOutput *output) { string sname(output->name().string()); size_t i; /* strip whitespace */ while((i = sname.find(" ")) != string::npos) sname.replace(i, 1, ""); /* if input exists with the same name, add "Out" suffix */ foreach(ShaderInput *input, node->inputs) { if(input->name() == output->name()) { sname += "Out"; break; } } return sname; } bool OSLCompiler::node_skip_input(ShaderNode *node, ShaderInput *input) { /* exception for output node, only one input is actually used * depending on the current shader type */ if(input->flags() & SocketType::SVM_INTERNAL) return true; if(node->special_type == SHADER_SPECIAL_TYPE_OUTPUT) { if(input->name() == "Surface" && current_type != SHADER_TYPE_SURFACE) return true; if(input->name() == "Volume" && current_type != SHADER_TYPE_VOLUME) return true; if(input->name() == "Displacement" && current_type != SHADER_TYPE_DISPLACEMENT) return true; if(input->name() == "Normal" && current_type != SHADER_TYPE_BUMP) return true; } else if(node->special_type == SHADER_SPECIAL_TYPE_BUMP) { if(input->name() == "Height") return true; } else if(current_type == SHADER_TYPE_DISPLACEMENT && input->link && input->link->parent->special_type == SHADER_SPECIAL_TYPE_BUMP) return true; return false; } void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; /* load filepath */ if(isfilepath) { name = ((OSLShaderManager*)manager)->shader_load_filepath(name); if(name == NULL) return; } /* pass in fixed parameter values */ foreach(ShaderInput *input, node->inputs) { if(!input->link) { /* checks to untangle graphs */ if(node_skip_input(node, input)) continue; /* already has default value assigned */ else if(input->flags() & SocketType::DEFAULT_LINK_MASK) continue; string param_name = compatible_name(node, input); const SocketType& socket = input->socket_type; switch(input->type()) { case SocketType::COLOR: parameter_color(param_name.c_str(), node->get_float3(socket)); break; case SocketType::POINT: parameter_point(param_name.c_str(), node->get_float3(socket)); break; case SocketType::VECTOR: parameter_vector(param_name.c_str(), node->get_float3(socket)); break; case SocketType::NORMAL: parameter_normal(param_name.c_str(), node->get_float3(socket)); break; case SocketType::FLOAT: parameter(param_name.c_str(), node->get_float(socket)); break; case SocketType::INT: parameter(param_name.c_str(), node->get_int(socket)); break; case SocketType::STRING: parameter(param_name.c_str(), node->get_string(socket)); break; case SocketType::CLOSURE: case SocketType::UNDEFINED: default: break; } } } /* create shader of the appropriate type. OSL only distinguishes between "surface" * and "displacement" atm */ if(current_type == SHADER_TYPE_SURFACE) ss->Shader("surface", name, id(node).c_str()); else if(current_type == SHADER_TYPE_VOLUME) ss->Shader("surface", name, id(node).c_str()); else if(current_type == SHADER_TYPE_DISPLACEMENT) ss->Shader("displacement", name, id(node).c_str()); else if(current_type == SHADER_TYPE_BUMP) ss->Shader("displacement", name, id(node).c_str()); else assert(0); /* link inputs to other nodes */ foreach(ShaderInput *input, node->inputs) { if(input->link) { if(node_skip_input(node, input)) continue; /* connect shaders */ string id_from = id(input->link->parent); string id_to = id(node); string param_from = compatible_name(input->link->parent, input->link); string param_to = compatible_name(node, input); ss->ConnectShaders(id_from.c_str(), param_from.c_str(), id_to.c_str(), param_to.c_str()); } } /* test if we shader contains specific closures */ OSLShaderInfo *info = ((OSLShaderManager*)manager)->shader_loaded_info(name); if(current_type == SHADER_TYPE_SURFACE) { if(info) { if(info->has_surface_emission) current_shader->has_surface_emission = true; if(info->has_surface_transparent) current_shader->has_surface_transparent = true; if(info->has_surface_bssrdf) { current_shader->has_surface_bssrdf = true; current_shader->has_bssrdf_bump = true; /* can't detect yet */ } current_shader->has_bump = true; /* can't detect yet */ } if(node->has_spatial_varying()) { current_shader->has_surface_spatial_varying = true; } } else if(current_type == SHADER_TYPE_VOLUME) { if(node->has_spatial_varying()) current_shader->has_volume_spatial_varying = true; } if(node->has_object_dependency()) { current_shader->has_object_dependency = true; } if(node->has_attribute_dependency()) { current_shader->has_attribute_dependency = true; } if(node->has_integrator_dependency()) { current_shader->has_integrator_dependency = true; } } static TypeDesc array_typedesc(TypeDesc typedesc, int arraylength) { return TypeDesc((TypeDesc::BASETYPE)typedesc.basetype, (TypeDesc::AGGREGATE)typedesc.aggregate, (TypeDesc::VECSEMANTICS)typedesc.vecsemantics, arraylength); } void OSLCompiler::parameter(ShaderNode* node, const char *name) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ustring uname = ustring(name); const SocketType& socket = *(node->type->find_input(uname)); switch(socket.type) { case SocketType::BOOLEAN: { int value = node->get_bool(socket); ss->Parameter(name, TypeDesc::TypeInt, &value); break; } case SocketType::FLOAT: { float value = node->get_float(socket); ss->Parameter(uname, TypeDesc::TypeFloat, &value); break; } case SocketType::INT: { int value = node->get_int(socket); ss->Parameter(uname, TypeDesc::TypeInt, &value); break; } case SocketType::COLOR: { float3 value = node->get_float3(socket); ss->Parameter(uname, TypeDesc::TypeColor, &value); break; } case SocketType::VECTOR: { float3 value = node->get_float3(socket); ss->Parameter(uname, TypeDesc::TypeVector, &value); break; } case SocketType::POINT: { float3 value = node->get_float3(socket); ss->Parameter(uname, TypeDesc::TypePoint, &value); break; } case SocketType::NORMAL: { float3 value = node->get_float3(socket); ss->Parameter(uname, TypeDesc::TypeNormal, &value); break; } case SocketType::POINT2: { float2 value = node->get_float2(socket); ss->Parameter(uname, TypeDesc(TypeDesc::FLOAT, TypeDesc::VEC2, TypeDesc::POINT), &value); break; } case SocketType::STRING: { ustring value = node->get_string(socket); ss->Parameter(uname, TypeDesc::TypeString, &value); break; } case SocketType::ENUM: { ustring value = node->get_string(socket); ss->Parameter(uname, TypeDesc::TypeString, &value); break; } case SocketType::TRANSFORM: { Transform value = node->get_transform(socket); ss->Parameter(uname, TypeDesc::TypeMatrix, &value); break; } case SocketType::BOOLEAN_ARRAY: { // OSL does not support booleans, so convert to int const array& value = node->get_bool_array(socket); array intvalue(value.size()); for(size_t i = 0; i < value.size(); i++) intvalue[i] = value[i]; ss->Parameter(uname, array_typedesc(TypeDesc::TypeInt, value.size()), intvalue.data()); break; } case SocketType::FLOAT_ARRAY: { const array& value = node->get_float_array(socket); ss->Parameter(uname, array_typedesc(TypeDesc::TypeFloat, value.size()), value.data()); break; } case SocketType::INT_ARRAY: { const array& value = node->get_int_array(socket); ss->Parameter(uname, array_typedesc(TypeDesc::TypeInt, value.size()), value.data()); break; } case SocketType::COLOR_ARRAY: case SocketType::VECTOR_ARRAY: case SocketType::POINT_ARRAY: case SocketType::NORMAL_ARRAY: { TypeDesc typedesc; switch(socket.type) { case SocketType::COLOR_ARRAY: typedesc = TypeDesc::TypeColor; break; case SocketType::VECTOR_ARRAY: typedesc = TypeDesc::TypeVector; break; case SocketType::POINT_ARRAY: typedesc = TypeDesc::TypePoint; break; case SocketType::NORMAL_ARRAY: typedesc = TypeDesc::TypeNormal; break; default: assert(0); break; } // convert to tightly packed array since float3 has padding const array& value = node->get_float3_array(socket); array fvalue(value.size() * 3); for(size_t i = 0, j = 0; i < value.size(); i++) { fvalue[j++] = value[i].x; fvalue[j++] = value[i].y; fvalue[j++] = value[i].z; } ss->Parameter(uname, array_typedesc(typedesc, value.size()), fvalue.data()); break; } case SocketType::POINT2_ARRAY: { const array& value = node->get_float2_array(socket); ss->Parameter(uname, array_typedesc(TypeDesc(TypeDesc::FLOAT, TypeDesc::VEC2, TypeDesc::POINT), value.size()), value.data()); break; } case SocketType::STRING_ARRAY: { const array& value = node->get_string_array(socket); ss->Parameter(uname, array_typedesc(TypeDesc::TypeString, value.size()), value.data()); break; } case SocketType::TRANSFORM_ARRAY: { const array& value = node->get_transform_array(socket); ss->Parameter(uname, array_typedesc(TypeDesc::TypeMatrix, value.size()), value.data()); break; } case SocketType::CLOSURE: case SocketType::NODE: case SocketType::NODE_ARRAY: case SocketType::UNDEFINED: case SocketType::UINT: { assert(0); break; } } } void OSLCompiler::parameter(const char *name, float f) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypeFloat, &f); } void OSLCompiler::parameter_color(const char *name, float3 f) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypeColor, &f); } void OSLCompiler::parameter_point(const char *name, float3 f) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypePoint, &f); } void OSLCompiler::parameter_normal(const char *name, float3 f) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypeNormal, &f); } void OSLCompiler::parameter_vector(const char *name, float3 f) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypeVector, &f); } void OSLCompiler::parameter(const char *name, int f) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypeInt, &f); } void OSLCompiler::parameter(const char *name, const char *s) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypeString, &s); } void OSLCompiler::parameter(const char *name, ustring s) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; const char *str = s.c_str(); ss->Parameter(name, TypeDesc::TypeString, &str); } void OSLCompiler::parameter(const char *name, const Transform& tfm) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; ss->Parameter(name, TypeDesc::TypeMatrix, (float*)&tfm); } void OSLCompiler::parameter_array(const char *name, const float f[], int arraylen) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; TypeDesc type = TypeDesc::TypeFloat; type.arraylen = arraylen; ss->Parameter(name, type, f); } void OSLCompiler::parameter_color_array(const char *name, const array& f) { /* NB: cycles float3 type is actually 4 floats! need to use an explicit array */ array table(f.size()); for(int i = 0; i < f.size(); ++i) { table[i][0] = f[i].x; table[i][1] = f[i].y; table[i][2] = f[i].z; } OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; TypeDesc type = TypeDesc::TypeColor; type.arraylen = table.size(); ss->Parameter(name, type, table.data()); } void OSLCompiler::parameter_attribute(const char *name, ustring s) { if(Attribute::name_standard(s.c_str())) parameter(name, (string("geom:") + s.c_str()).c_str()); else parameter(name, s.c_str()); } void OSLCompiler::find_dependencies(ShaderNodeSet& dependencies, ShaderInput *input) { ShaderNode *node = (input->link)? input->link->parent: NULL; if(node != NULL && dependencies.find(node) == dependencies.end()) { foreach(ShaderInput *in, node->inputs) if(!node_skip_input(node, in)) find_dependencies(dependencies, in); dependencies.insert(node); } } void OSLCompiler::generate_nodes(const ShaderNodeSet& nodes) { ShaderNodeSet done; bool nodes_done; do { nodes_done = true; foreach(ShaderNode *node, nodes) { if(done.find(node) == done.end()) { bool inputs_done = true; foreach(ShaderInput *input, node->inputs) if(!node_skip_input(node, input)) if(input->link && done.find(input->link->parent) == done.end()) inputs_done = false; if(inputs_done) { node->compile(*this); done.insert(node); if(current_type == SHADER_TYPE_SURFACE) { if(node->has_surface_emission()) current_shader->has_surface_emission = true; if(node->has_surface_transparent()) current_shader->has_surface_transparent = true; if(node->has_spatial_varying()) current_shader->has_surface_spatial_varying = true; if(node->has_surface_bssrdf()) { current_shader->has_surface_bssrdf = true; if(node->has_bssrdf_bump()) current_shader->has_bssrdf_bump = true; } if(node->has_bump()) { current_shader->has_bump = true; } } else if(current_type == SHADER_TYPE_VOLUME) { if(node->has_spatial_varying()) current_shader->has_volume_spatial_varying = true; } } else nodes_done = false; } } } while(!nodes_done); } OSL::ShaderGroupRef OSLCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType type) { OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys; current_type = type; OSL::ShaderGroupRef group = ss->ShaderGroupBegin(shader->name.c_str()); ShaderNode *output = graph->output(); ShaderNodeSet dependencies; if(type == SHADER_TYPE_SURFACE) { /* generate surface shader */ find_dependencies(dependencies, output->input("Surface")); generate_nodes(dependencies); output->compile(*this); } else if(type == SHADER_TYPE_BUMP) { /* generate bump shader */ find_dependencies(dependencies, output->input("Normal")); generate_nodes(dependencies); output->compile(*this); } else if(type == SHADER_TYPE_VOLUME) { /* generate volume shader */ find_dependencies(dependencies, output->input("Volume")); generate_nodes(dependencies); output->compile(*this); } else if(type == SHADER_TYPE_DISPLACEMENT) { /* generate displacement shader */ find_dependencies(dependencies, output->input("Displacement")); generate_nodes(dependencies); output->compile(*this); } else assert(0); ss->ShaderGroupEnd(); return group; } void OSLCompiler::compile(Scene *scene, OSLGlobals *og, Shader *shader) { if(shader->need_update) { ShaderGraph *graph = shader->graph; ShaderNode *output = (graph)? graph->output(): NULL; bool has_bump = (shader->displacement_method != DISPLACE_TRUE) && output->input("Surface")->link && output->input("Displacement")->link; /* finalize */ shader->graph->finalize(scene, has_bump, shader->has_integrator_dependency, shader->displacement_method == DISPLACE_BOTH); current_shader = shader; shader->has_surface = false; shader->has_surface_emission = false; shader->has_surface_transparent = false; shader->has_surface_bssrdf = false; shader->has_bump = has_bump; shader->has_bssrdf_bump = has_bump; shader->has_volume = false; shader->has_displacement = false; shader->has_surface_spatial_varying = false; shader->has_volume_spatial_varying = false; shader->has_object_dependency = false; shader->has_attribute_dependency = false; shader->has_integrator_dependency = false; /* generate surface shader */ if(shader->used && graph && output->input("Surface")->link) { shader->osl_surface_ref = compile_type(shader, shader->graph, SHADER_TYPE_SURFACE); if(has_bump) shader->osl_surface_bump_ref = compile_type(shader, shader->graph, SHADER_TYPE_BUMP); else shader->osl_surface_bump_ref = OSL::ShaderGroupRef(); shader->has_surface = true; } else { shader->osl_surface_ref = OSL::ShaderGroupRef(); shader->osl_surface_bump_ref = OSL::ShaderGroupRef(); } /* generate volume shader */ if(shader->used && graph && output->input("Volume")->link) { shader->osl_volume_ref = compile_type(shader, shader->graph, SHADER_TYPE_VOLUME); shader->has_volume = true; } else shader->osl_volume_ref = OSL::ShaderGroupRef(); /* generate displacement shader */ if(shader->used && graph && output->input("Displacement")->link) { shader->osl_displacement_ref = compile_type(shader, shader->graph, SHADER_TYPE_DISPLACEMENT); shader->has_displacement = true; } else shader->osl_displacement_ref = OSL::ShaderGroupRef(); } /* push state to array for lookup */ og->surface_state.push_back(shader->osl_surface_ref); og->volume_state.push_back(shader->osl_volume_ref); og->displacement_state.push_back(shader->osl_displacement_ref); og->bump_state.push_back(shader->osl_surface_bump_ref); } #else void OSLCompiler::add(ShaderNode * /*node*/, const char * /*name*/, bool /*isfilepath*/) { } void OSLCompiler::parameter(ShaderNode * /*node*/, const char * /*name*/) { } void OSLCompiler::parameter(const char * /*name*/, float /*f*/) { } void OSLCompiler::parameter_color(const char * /*name*/, float3 /*f*/) { } void OSLCompiler::parameter_vector(const char * /*name*/, float3 /*f*/) { } void OSLCompiler::parameter_point(const char * /*name*/, float3 /*f*/) { } void OSLCompiler::parameter_normal(const char * /*name*/, float3 /*f*/) { } void OSLCompiler::parameter(const char * /*name*/, int /*f*/) { } void OSLCompiler::parameter(const char * /*name*/, const char * /*s*/) { } void OSLCompiler::parameter(const char * /*name*/, ustring /*s*/) { } void OSLCompiler::parameter(const char * /*name*/, const Transform& /*tfm*/) { } void OSLCompiler::parameter_array(const char * /*name*/, const float /*f*/[], int /*arraylen*/) { } void OSLCompiler::parameter_color_array(const char * /*name*/, const array& /*f*/) { } #endif /* WITH_OSL */ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/osl.h000066400000000000000000000112441334742672700206240ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __OSL_H__ #define __OSL_H__ #include "util/util_set.h" #include "util/util_string.h" #include "util/util_thread.h" #include "render/graph.h" #include "render/nodes.h" #include "render/shader.h" #ifdef WITH_OSL #include #include #include #endif CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class ImageManager; class OSLRenderServices; struct OSLGlobals; class Scene; class ShaderGraph; class ShaderNode; class ShaderInput; class ShaderOutput; #ifdef WITH_OSL /* OSL Shader Info * to auto detect closures in the shader for MIS and transparent shadows */ struct OSLShaderInfo { OSLShaderInfo() : has_surface_emission(false), has_surface_transparent(false), has_surface_bssrdf(false) {} OSL::OSLQuery query; bool has_surface_emission; bool has_surface_transparent; bool has_surface_bssrdf; }; /* Shader Manage */ class OSLShaderManager : public ShaderManager { public: OSLShaderManager(); ~OSLShaderManager(); void reset(Scene *scene); bool use_osl() { return true; } void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free(Device *device, DeviceScene *dscene, Scene *scene); /* osl compile and query */ static bool osl_compile(const string& inputfile, const string& outputfile); static bool osl_query(OSL::OSLQuery& query, const string& filepath); /* shader file loading, all functions return pointer to hash string if found */ const char *shader_test_loaded(const string& hash); const char *shader_load_bytecode(const string& hash, const string& bytecode); const char *shader_load_filepath(string filepath); OSLShaderInfo *shader_loaded_info(const string& hash); /* create OSL node using OSLQuery */ OSLNode *osl_node(const std::string& filepath, const std::string& bytecode_hash = "", const std::string& bytecode = ""); protected: void texture_system_init(); void texture_system_free(); void shading_system_init(); void shading_system_free(); OSL::ShadingSystem *ss; OSL::TextureSystem *ts; OSLRenderServices *services; OSL::ErrorHandler errhandler; map loaded_shaders; static OSL::TextureSystem *ts_shared; static thread_mutex ts_shared_mutex; static int ts_shared_users; static OSL::ShadingSystem *ss_shared; static OSLRenderServices *services_shared; static thread_mutex ss_shared_mutex; static thread_mutex ss_mutex; static int ss_shared_users; }; #endif /* Graph Compiler */ class OSLCompiler { public: OSLCompiler(void *manager, void *shadingsys, ImageManager *image_manager); void compile(Scene *scene, OSLGlobals *og, Shader *shader); void add(ShaderNode *node, const char *name, bool isfilepath = false); void parameter(ShaderNode *node, const char *name); void parameter(const char *name, float f); void parameter_color(const char *name, float3 f); void parameter_vector(const char *name, float3 f); void parameter_normal(const char *name, float3 f); void parameter_point(const char *name, float3 f); void parameter(const char *name, int f); void parameter(const char *name, const char *s); void parameter(const char *name, ustring str); void parameter(const char *name, const Transform& tfm); void parameter_array(const char *name, const float f[], int arraylen); void parameter_color_array(const char *name, const array& f); void parameter_attribute(const char *name, ustring s); ShaderType output_type() { return current_type; } bool background; ImageManager *image_manager; private: #ifdef WITH_OSL string id(ShaderNode *node); OSL::ShaderGroupRef compile_type(Shader *shader, ShaderGraph *graph, ShaderType type); bool node_skip_input(ShaderNode *node, ShaderInput *input); string compatible_name(ShaderNode *node, ShaderInput *input); string compatible_name(ShaderNode *node, ShaderOutput *output); void find_dependencies(ShaderNodeSet& dependencies, ShaderInput *input); void generate_nodes(const ShaderNodeSet& nodes); #endif void *shadingsys; void *manager; ShaderType current_type; Shader *current_shader; }; CCL_NAMESPACE_END #endif /* __OSL_H__ */ goxel-0.8.1/ext_src/cycles/src/render/particles.cpp000066400000000000000000000067161334742672700223600ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/particles.h" #include "render/scene.h" #include "util/util_foreach.h" #include "util/util_hash.h" #include "util/util_logging.h" #include "util/util_map.h" #include "util/util_progress.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN /* Particle System */ ParticleSystem::ParticleSystem() { } ParticleSystem::~ParticleSystem() { } void ParticleSystem::tag_update(Scene *scene) { scene->particle_system_manager->need_update = true; } /* Particle System Manager */ ParticleSystemManager::ParticleSystemManager() { need_update = true; } ParticleSystemManager::~ParticleSystemManager() { } void ParticleSystemManager::device_update_particles(Device *, DeviceScene *dscene, Scene *scene, Progress& progress) { /* count particles. * adds one dummy particle at the beginning to avoid invalid lookups, * in case a shader uses particle info without actual particle data. */ int num_particles = 1; for(size_t j = 0; j < scene->particle_systems.size(); j++) num_particles += scene->particle_systems[j]->particles.size(); float4 *particles = dscene->particles.alloc(PARTICLE_SIZE*num_particles); /* dummy particle */ particles[0] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); particles[1] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); particles[2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); particles[3] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); particles[4] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); int i = 1; for(size_t j = 0; j < scene->particle_systems.size(); j++) { ParticleSystem *psys = scene->particle_systems[j]; for(size_t k = 0; k < psys->particles.size(); k++) { /* pack in texture */ Particle& pa = psys->particles[k]; int offset = i*PARTICLE_SIZE; particles[offset] = make_float4(__uint_as_float(pa.index), pa.age, pa.lifetime, pa.size); particles[offset+1] = pa.rotation; particles[offset+2] = make_float4(pa.location.x, pa.location.y, pa.location.z, pa.velocity.x); particles[offset+3] = make_float4(pa.velocity.y, pa.velocity.z, pa.angular_velocity.x, pa.angular_velocity.y); particles[offset+4] = make_float4(pa.angular_velocity.z, 0.0f, 0.0f, 0.0f); i++; if(progress.get_cancel()) return; } } dscene->particles.copy_to_device(); } void ParticleSystemManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { if(!need_update) return; VLOG(1) << "Total " << scene->particle_systems.size() << " particle systems."; device_free(device, dscene); progress.set_status("Updating Particle Systems", "Copying Particles to device"); device_update_particles(device, dscene, scene, progress); if(progress.get_cancel()) return; need_update = false; } void ParticleSystemManager::device_free(Device *, DeviceScene *dscene) { dscene->particles.free(); } void ParticleSystemManager::tag_update(Scene * /*scene*/) { need_update = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/particles.h000066400000000000000000000030661334742672700220200ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __PARTICLES_H__ #define __PARTICLES_H__ #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Progress; class Scene; /* Particle System */ struct Particle { int index; float age; float lifetime; float3 location; float4 rotation; float size; float3 velocity; float3 angular_velocity; }; class ParticleSystem { public: ParticleSystem(); ~ParticleSystem(); void tag_update(Scene *scene); array particles; }; /* ParticleSystem Manager */ class ParticleSystemManager { public: bool need_update; ParticleSystemManager(); ~ParticleSystemManager(); void device_update_particles(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free(Device *device, DeviceScene *dscene); void tag_update(Scene *scene); }; CCL_NAMESPACE_END #endif /* __PARTICLES_H__ */ goxel-0.8.1/ext_src/cycles/src/render/scene.cpp000066400000000000000000000265521334742672700214670ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "render/background.h" #include "render/bake.h" #include "render/camera.h" #include "render/curves.h" #include "device/device.h" #include "render/film.h" #include "render/integrator.h" #include "render/light.h" #include "render/mesh.h" #include "render/object.h" #include "render/osl.h" #include "render/particles.h" #include "render/scene.h" #include "render/shader.h" #include "render/svm.h" #include "render/tables.h" #include "util/util_foreach.h" #include "util/util_guarded_allocator.h" #include "util/util_logging.h" #include "util/util_progress.h" CCL_NAMESPACE_BEGIN DeviceScene::DeviceScene(Device *device) : bvh_nodes(device, "__bvh_nodes", MEM_TEXTURE), bvh_leaf_nodes(device, "__bvh_leaf_nodes", MEM_TEXTURE), object_node(device, "__object_node", MEM_TEXTURE), prim_tri_index(device, "__prim_tri_index", MEM_TEXTURE), prim_tri_verts(device, "__prim_tri_verts", MEM_TEXTURE), prim_type(device, "__prim_type", MEM_TEXTURE), prim_visibility(device, "__prim_visibility", MEM_TEXTURE), prim_index(device, "__prim_index", MEM_TEXTURE), prim_object(device, "__prim_object", MEM_TEXTURE), prim_time(device, "__prim_time", MEM_TEXTURE), tri_shader(device, "__tri_shader", MEM_TEXTURE), tri_vnormal(device, "__tri_vnormal", MEM_TEXTURE), tri_vindex(device, "__tri_vindex", MEM_TEXTURE), tri_patch(device, "__tri_patch", MEM_TEXTURE), tri_patch_uv(device, "__tri_patch_uv", MEM_TEXTURE), curves(device, "__curves", MEM_TEXTURE), curve_keys(device, "__curve_keys", MEM_TEXTURE), patches(device, "__patches", MEM_TEXTURE), objects(device, "__objects", MEM_TEXTURE), objects_vector(device, "__objects_vector", MEM_TEXTURE), attributes_map(device, "__attributes_map", MEM_TEXTURE), attributes_float(device, "__attributes_float", MEM_TEXTURE), attributes_float3(device, "__attributes_float3", MEM_TEXTURE), attributes_uchar4(device, "__attributes_uchar4", MEM_TEXTURE), light_distribution(device, "__light_distribution", MEM_TEXTURE), light_data(device, "__light_data", MEM_TEXTURE), light_background_marginal_cdf(device, "__light_background_marginal_cdf", MEM_TEXTURE), light_background_conditional_cdf(device, "__light_background_conditional_cdf", MEM_TEXTURE), particles(device, "__particles", MEM_TEXTURE), svm_nodes(device, "__svm_nodes", MEM_TEXTURE), shader_flag(device, "__shader_flag", MEM_TEXTURE), object_flag(device, "__object_flag", MEM_TEXTURE), lookup_table(device, "__lookup_table", MEM_TEXTURE), sobol_directions(device, "__sobol_directions", MEM_TEXTURE) { memset(&data, 0, sizeof(data)); } Scene::Scene(const SceneParams& params_, Device *device) : device(device), dscene(device), params(params_) { memset(&dscene.data, 0, sizeof(dscene.data)); camera = new Camera(); dicing_camera = new Camera(); lookup_tables = new LookupTables(); film = new Film(); background = new Background(); light_manager = new LightManager(); mesh_manager = new MeshManager(); object_manager = new ObjectManager(); integrator = new Integrator(); image_manager = new ImageManager(device->info); particle_system_manager = new ParticleSystemManager(); curve_system_manager = new CurveSystemManager(); bake_manager = new BakeManager(); /* OSL only works on the CPU */ if(device->info.has_osl) shader_manager = ShaderManager::create(this, params.shadingsystem); else shader_manager = ShaderManager::create(this, SHADINGSYSTEM_SVM); } Scene::~Scene() { free_memory(true); } void Scene::free_memory(bool final) { foreach(Shader *s, shaders) delete s; foreach(Mesh *m, meshes) delete m; foreach(Object *o, objects) delete o; foreach(Light *l, lights) delete l; foreach(ParticleSystem *p, particle_systems) delete p; shaders.clear(); meshes.clear(); objects.clear(); lights.clear(); particle_systems.clear(); if(device) { camera->device_free(device, &dscene, this); film->device_free(device, &dscene, this); background->device_free(device, &dscene); integrator->device_free(device, &dscene); object_manager->device_free(device, &dscene); mesh_manager->device_free(device, &dscene); shader_manager->device_free(device, &dscene, this); light_manager->device_free(device, &dscene); particle_system_manager->device_free(device, &dscene); curve_system_manager->device_free(device, &dscene); bake_manager->device_free(device, &dscene); if(!params.persistent_data || final) image_manager->device_free(device); else image_manager->device_free_builtin(device); lookup_tables->device_free(device, &dscene); } if(final) { delete lookup_tables; delete camera; delete dicing_camera; delete film; delete background; delete integrator; delete object_manager; delete mesh_manager; delete shader_manager; delete light_manager; delete particle_system_manager; delete curve_system_manager; delete image_manager; delete bake_manager; } } void Scene::device_update(Device *device_, Progress& progress) { if(!device) device = device_; bool print_stats = need_data_update(); /* The order of updates is important, because there's dependencies between * the different managers, using data computed by previous managers. * * - Image manager uploads images used by shaders. * - Camera may be used for adaptive subdivision. * - Displacement shader must have all shader data available. * - Light manager needs lookup tables and final mesh data to compute emission CDF. * - Film needs light manager to run for use_light_visibility * - Lookup tables are done a second time to handle film tables */ progress.set_status("Updating Shaders"); shader_manager->device_update(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Background"); background->device_update(device, &dscene, this); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Camera"); camera->device_update(device, &dscene, this); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Meshes Flags"); mesh_manager->device_update_flags(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Objects"); object_manager->device_update(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Particle Systems"); particle_system_manager->device_update(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Meshes"); mesh_manager->device_update(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Objects Flags"); object_manager->device_update_flags(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Images"); image_manager->device_update(device, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Camera Volume"); camera->device_update_volume(device, &dscene, this); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Hair Systems"); curve_system_manager->device_update(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Lookup Tables"); lookup_tables->device_update(device, &dscene); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Lights"); light_manager->device_update(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Integrator"); integrator->device_update(device, &dscene, this); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Film"); film->device_update(device, &dscene, this); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Lookup Tables"); lookup_tables->device_update(device, &dscene); if(progress.get_cancel() || device->have_error()) return; progress.set_status("Updating Baking"); bake_manager->device_update(device, &dscene, this, progress); if(progress.get_cancel() || device->have_error()) return; if(device->have_error() == false) { progress.set_status("Updating Device", "Writing constant memory"); device->const_copy_to("__data", &dscene.data, sizeof(dscene.data)); } if(print_stats) { size_t mem_used = util_guarded_get_mem_used(); size_t mem_peak = util_guarded_get_mem_peak(); VLOG(1) << "System memory statistics after full device sync:\n" << " Usage: " << string_human_readable_number(mem_used) << " (" << string_human_readable_size(mem_used) << ")\n" << " Peak: " << string_human_readable_number(mem_peak) << " (" << string_human_readable_size(mem_peak) << ")"; } } Scene::MotionType Scene::need_motion() { if(integrator->motion_blur) return MOTION_BLUR; else if(Pass::contains(film->passes, PASS_MOTION)) return MOTION_PASS; else return MOTION_NONE; } float Scene::motion_shutter_time() { if(need_motion() == Scene::MOTION_PASS) return 2.0f; else return camera->shuttertime; } bool Scene::need_global_attribute(AttributeStandard std) { if(std == ATTR_STD_UV) return Pass::contains(film->passes, PASS_UV); else if(std == ATTR_STD_MOTION_VERTEX_POSITION) return need_motion() != MOTION_NONE; else if(std == ATTR_STD_MOTION_VERTEX_NORMAL) return need_motion() == MOTION_BLUR; return false; } void Scene::need_global_attributes(AttributeRequestSet& attributes) { for(int std = ATTR_STD_NONE; std < ATTR_STD_NUM; std++) if(need_global_attribute((AttributeStandard)std)) attributes.add((AttributeStandard)std); } bool Scene::need_update() { return (need_reset() || film->need_update); } bool Scene::need_data_update() { return (background->need_update || image_manager->need_update || object_manager->need_update || mesh_manager->need_update || light_manager->need_update || lookup_tables->need_update || integrator->need_update || shader_manager->need_update || particle_system_manager->need_update || curve_system_manager->need_update || bake_manager->need_update || film->need_update); } bool Scene::need_reset() { return need_data_update() || camera->need_update; } void Scene::reset() { shader_manager->reset(this); shader_manager->add_default(this); /* ensure all objects are updated */ camera->tag_update(); dicing_camera->tag_update(); film->tag_update(this); background->tag_update(this); integrator->tag_update(this); object_manager->tag_update(this); mesh_manager->tag_update(this); light_manager->tag_update(this); particle_system_manager->tag_update(this); curve_system_manager->tag_update(this); } void Scene::device_free() { free_memory(false); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/scene.h000066400000000000000000000141651334742672700211310ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SCENE_H__ #define __SCENE_H__ #include "bvh/bvh_params.h" #include "render/image.h" #include "render/shader.h" #include "device/device_memory.h" #include "util/util_param.h" #include "util/util_string.h" #include "util/util_system.h" #include "util/util_texture.h" #include "util/util_thread.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class AttributeRequestSet; class Background; class Camera; class Device; class DeviceInfo; class Film; class Integrator; class Light; class LightManager; class LookupTables; class Mesh; class MeshManager; class Object; class ObjectManager; class ParticleSystemManager; class ParticleSystem; class CurveSystemManager; class Shader; class ShaderManager; class Progress; class BakeManager; class BakeData; /* Scene Device Data */ class DeviceScene { public: /* BVH */ device_vector bvh_nodes; device_vector bvh_leaf_nodes; device_vector object_node; device_vector prim_tri_index; device_vector prim_tri_verts; device_vector prim_type; device_vector prim_visibility; device_vector prim_index; device_vector prim_object; device_vector prim_time; /* mesh */ device_vector tri_shader; device_vector tri_vnormal; device_vector tri_vindex; device_vector tri_patch; device_vector tri_patch_uv; device_vector curves; device_vector curve_keys; device_vector patches; /* objects */ device_vector objects; device_vector objects_vector; /* attributes */ device_vector attributes_map; device_vector attributes_float; device_vector attributes_float3; device_vector attributes_uchar4; /* lights */ device_vector light_distribution; device_vector light_data; device_vector light_background_marginal_cdf; device_vector light_background_conditional_cdf; /* particles */ device_vector particles; /* shaders */ device_vector svm_nodes; device_vector shader_flag; device_vector object_flag; /* lookup tables */ device_vector lookup_table; /* integrator */ device_vector sobol_directions; KernelData data; DeviceScene(Device *device); }; /* Scene Parameters */ class SceneParams { public: /* Type of BVH, in terms whether it is supported dynamic updates of meshes * or whether modifying geometry requires full BVH rebuild. */ enum BVHType { /* BVH supports dynamic updates of geometry. * * Faster for updating BVH tree when doing modifications in viewport, * but slower for rendering. */ BVH_DYNAMIC = 0, /* BVH tree is calculated for specific scene, updates in geometry * requires full tree rebuild. * * Slower to update BVH tree when modifying objects in viewport, also * slower to build final BVH tree but gives best possible render speed. */ BVH_STATIC = 1, BVH_NUM_TYPES, }; ShadingSystem shadingsystem; /* Requested BVH layout. * * If it's not supported by the device, the widest one from supported ones * will be used, but BVH wider than this one will never be used. */ BVHLayout bvh_layout; BVHType bvh_type; bool use_bvh_spatial_split; bool use_bvh_unaligned_nodes; int num_bvh_time_steps; bool persistent_data; int texture_limit; SceneParams() { shadingsystem = SHADINGSYSTEM_SVM; bvh_layout = BVH_LAYOUT_BVH2; bvh_type = BVH_DYNAMIC; use_bvh_spatial_split = false; use_bvh_unaligned_nodes = true; num_bvh_time_steps = 0; persistent_data = false; texture_limit = 0; } bool modified(const SceneParams& params) { return !(shadingsystem == params.shadingsystem && bvh_layout == params.bvh_layout && bvh_type == params.bvh_type && use_bvh_spatial_split == params.use_bvh_spatial_split && use_bvh_unaligned_nodes == params.use_bvh_unaligned_nodes && num_bvh_time_steps == params.num_bvh_time_steps && persistent_data == params.persistent_data && texture_limit == params.texture_limit); } }; /* Scene */ class Scene { public: /* data */ Camera *camera; Camera *dicing_camera; LookupTables *lookup_tables; Film *film; Background *background; Integrator *integrator; /* data lists */ vector objects; vector meshes; vector shaders; vector lights; vector particle_systems; /* data managers */ ImageManager *image_manager; LightManager *light_manager; ShaderManager *shader_manager; MeshManager *mesh_manager; ObjectManager *object_manager; ParticleSystemManager *particle_system_manager; CurveSystemManager *curve_system_manager; BakeManager *bake_manager; /* default shaders */ Shader *default_surface; Shader *default_light; Shader *default_background; Shader *default_empty; /* device */ Device *device; DeviceScene dscene; /* parameters */ SceneParams params; /* mutex must be locked manually by callers */ thread_mutex mutex; Scene(const SceneParams& params, Device *device); ~Scene(); void device_update(Device *device, Progress& progress); bool need_global_attribute(AttributeStandard std); void need_global_attributes(AttributeRequestSet& attributes); enum MotionType { MOTION_NONE = 0, MOTION_PASS, MOTION_BLUR }; MotionType need_motion(); float motion_shutter_time(); bool need_update(); bool need_reset(); void reset(); void device_free(); protected: /* Check if some heavy data worth logging was updated. * Mainly used to suppress extra annoying logging. */ bool need_data_update(); void free_memory(bool final); }; CCL_NAMESPACE_END #endif /* __SCENE_H__ */ goxel-0.8.1/ext_src/cycles/src/render/session.cpp000066400000000000000000000670501334742672700220530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include "render/buffers.h" #include "render/camera.h" #include "device/device.h" #include "render/graph.h" #include "render/integrator.h" #include "render/mesh.h" #include "render/object.h" #include "render/scene.h" #include "render/session.h" #include "render/bake.h" #include "util/util_foreach.h" #include "util/util_function.h" #include "util/util_logging.h" #include "util/util_math.h" #include "util/util_opengl.h" #include "util/util_task.h" #include "util/util_time.h" CCL_NAMESPACE_BEGIN /* Note about preserve_tile_device option for tile manager: * progressive refine and viewport rendering does requires tiles to * always be allocated for the same device */ Session::Session(const SessionParams& params_) : params(params_), tile_manager(params.progressive, params.samples, params.tile_size, params.start_resolution, params.background == false || params.progressive_refine, params.background, params.tile_order, max(params.device.multi_devices.size(), 1), params.pixel_size), stats() { device_use_gl = ((params.device.type != DEVICE_CPU) && !params.background); TaskScheduler::init(params.threads); device = Device::create(params.device, stats, params.background); if(params.background && params.output_path.empty()) { buffers = NULL; display = NULL; } else { buffers = new RenderBuffers(device); display = new DisplayBuffer(device, params.display_buffer_linear); } session_thread = NULL; scene = NULL; reset_time = 0.0; last_update_time = 0.0; delayed_reset.do_reset = false; delayed_reset.samples = 0; display_outdated = false; gpu_draw_ready = false; gpu_need_tonemap = false; pause = false; kernels_loaded = false; /* TODO(sergey): Check if it's indeed optimal value for the split kernel. */ max_closure_global = 1; } Session::~Session() { if(session_thread) { /* wait for session thread to end */ progress.set_cancel("Exiting"); gpu_need_tonemap = false; gpu_need_tonemap_cond.notify_all(); { thread_scoped_lock pause_lock(pause_mutex); pause = false; } pause_cond.notify_all(); wait(); } if(!params.output_path.empty()) { /* tonemap and write out image if requested */ delete display; display = new DisplayBuffer(device, false); display->reset(buffers->params); tonemap(params.samples); progress.set_status("Writing Image", params.output_path); display->write(params.output_path); } /* clean up */ tile_manager.device_free(); delete buffers; delete display; delete scene; delete device; TaskScheduler::exit(); } void Session::start() { session_thread = new thread(function_bind(&Session::run, this)); } bool Session::ready_to_reset() { double dt = time_dt() - reset_time; if(!display_outdated) return (dt > params.reset_timeout); else return (dt > params.cancel_timeout); } /* GPU Session */ void Session::reset_gpu(BufferParams& buffer_params, int samples) { thread_scoped_lock pause_lock(pause_mutex); /* block for buffer access and reset immediately. we can't do this * in the thread, because we need to allocate an OpenGL buffer, and * that only works in the main thread */ thread_scoped_lock display_lock(display_mutex); thread_scoped_lock buffers_lock(buffers_mutex); display_outdated = true; reset_time = time_dt(); reset_(buffer_params, samples); gpu_need_tonemap = false; gpu_need_tonemap_cond.notify_all(); pause_cond.notify_all(); } bool Session::draw_gpu(BufferParams& buffer_params, DeviceDrawParams& draw_params) { /* block for buffer access */ thread_scoped_lock display_lock(display_mutex); /* first check we already rendered something */ if(gpu_draw_ready) { /* then verify the buffers have the expected size, so we don't * draw previous results in a resized window */ if(!buffer_params.modified(display->params)) { /* for CUDA we need to do tonemapping still, since we can * only access GL buffers from the main thread */ if(gpu_need_tonemap) { thread_scoped_lock buffers_lock(buffers_mutex); tonemap(tile_manager.state.sample); gpu_need_tonemap = false; gpu_need_tonemap_cond.notify_all(); } display->draw(device, draw_params); if(display_outdated && (time_dt() - reset_time) > params.text_timeout) return false; return true; } } return false; } void Session::run_gpu() { bool tiles_written = false; reset_time = time_dt(); last_update_time = time_dt(); progress.set_render_start_time(); while(!progress.get_cancel()) { /* advance to next tile */ bool no_tiles = !tile_manager.next(); if(params.background) { /* if no work left and in background mode, we can stop immediately */ if(no_tiles) { progress.set_status("Finished"); break; } } else { /* if in interactive mode, and we are either paused or done for now, * wait for pause condition notify to wake up again */ thread_scoped_lock pause_lock(pause_mutex); if(!pause && !tile_manager.done()) { /* reset could have happened after no_tiles was set, before this lock. * in this case we shall not wait for pause condition */ } else if(pause || no_tiles) { update_status_time(pause, no_tiles); while(1) { scoped_timer pause_timer; pause_cond.wait(pause_lock); if(pause) { progress.add_skip_time(pause_timer, params.background); } update_status_time(pause, no_tiles); progress.set_update(); if(!pause) break; } } if(progress.get_cancel()) break; } if(!no_tiles) { /* update scene */ scoped_timer update_timer; update_scene(); progress.add_skip_time(update_timer, params.background); if(!device->error_message().empty()) progress.set_error(device->error_message()); if(progress.get_cancel()) break; } if(!no_tiles) { /* buffers mutex is locked entirely while rendering each * sample, and released/reacquired on each iteration to allow * reset and draw in between */ thread_scoped_lock buffers_lock(buffers_mutex); /* update status and timing */ update_status_time(); /* render */ render(); device->task_wait(); if(!device->error_message().empty()) progress.set_cancel(device->error_message()); /* update status and timing */ update_status_time(); gpu_need_tonemap = true; gpu_draw_ready = true; progress.set_update(); /* wait for tonemap */ if(!params.background) { while(gpu_need_tonemap) { if(progress.get_cancel()) break; gpu_need_tonemap_cond.wait(buffers_lock); } } if(!device->error_message().empty()) progress.set_error(device->error_message()); tiles_written = update_progressive_refine(progress.get_cancel()); if(progress.get_cancel()) break; } } if(!tiles_written) update_progressive_refine(true); } /* CPU Session */ void Session::reset_cpu(BufferParams& buffer_params, int samples) { thread_scoped_lock reset_lock(delayed_reset.mutex); thread_scoped_lock pause_lock(pause_mutex); display_outdated = true; reset_time = time_dt(); delayed_reset.params = buffer_params; delayed_reset.samples = samples; delayed_reset.do_reset = true; device->task_cancel(); pause_cond.notify_all(); } bool Session::draw_cpu(BufferParams& buffer_params, DeviceDrawParams& draw_params) { thread_scoped_lock display_lock(display_mutex); /* first check we already rendered something */ if(display->draw_ready()) { /* then verify the buffers have the expected size, so we don't * draw previous results in a resized window */ if(!buffer_params.modified(display->params)) { display->draw(device, draw_params); if(display_outdated && (time_dt() - reset_time) > params.text_timeout) return false; return true; } } return false; } bool Session::acquire_tile(Device *tile_device, RenderTile& rtile) { if(progress.get_cancel()) { if(params.progressive_refine == false) { /* for progressive refine current sample should be finished for all tiles */ return false; } } thread_scoped_lock tile_lock(tile_mutex); /* get next tile from manager */ Tile *tile; int device_num = device->device_number(tile_device); if(!tile_manager.next_tile(tile, device_num)) return false; /* fill render tile */ rtile.x = tile_manager.state.buffer.full_x + tile->x; rtile.y = tile_manager.state.buffer.full_y + tile->y; rtile.w = tile->w; rtile.h = tile->h; rtile.start_sample = tile_manager.state.sample; rtile.num_samples = tile_manager.state.num_samples; rtile.resolution = tile_manager.state.resolution_divider; rtile.tile_index = tile->index; rtile.task = (tile->state == Tile::DENOISE)? RenderTile::DENOISE: RenderTile::PATH_TRACE; tile_lock.unlock(); /* in case of a permanent buffer, return it, otherwise we will allocate * a new temporary buffer */ if(buffers) { tile_manager.state.buffer.get_offset_stride(rtile.offset, rtile.stride); rtile.buffer = buffers->buffer.device_pointer; rtile.buffers = buffers; device->map_tile(tile_device, rtile); return true; } if(tile->buffers == NULL) { /* fill buffer parameters */ BufferParams buffer_params = tile_manager.params; buffer_params.full_x = rtile.x; buffer_params.full_y = rtile.y; buffer_params.width = rtile.w; buffer_params.height = rtile.h; /* allocate buffers */ tile->buffers = new RenderBuffers(tile_device); tile->buffers->reset(buffer_params); } tile->buffers->params.get_offset_stride(rtile.offset, rtile.stride); rtile.buffer = tile->buffers->buffer.device_pointer; rtile.buffers = tile->buffers; rtile.sample = tile_manager.state.sample; /* this will tag tile as IN PROGRESS in blender-side render pipeline, * which is needed to highlight currently rendering tile before first * sample was processed for it */ update_tile_sample(rtile); return true; } void Session::update_tile_sample(RenderTile& rtile) { thread_scoped_lock tile_lock(tile_mutex); if(update_render_tile_cb) { if(params.progressive_refine == false) { /* todo: optimize this by making it thread safe and removing lock */ update_render_tile_cb(rtile, true); } } update_status_time(); } void Session::release_tile(RenderTile& rtile) { thread_scoped_lock tile_lock(tile_mutex); progress.add_finished_tile(rtile.task == RenderTile::DENOISE); bool delete_tile; if(tile_manager.finish_tile(rtile.tile_index, delete_tile)) { if(write_render_tile_cb && params.progressive_refine == false) { write_render_tile_cb(rtile); } if(delete_tile) { delete rtile.buffers; tile_manager.state.tiles[rtile.tile_index].buffers = NULL; } } else { if(update_render_tile_cb && params.progressive_refine == false) { update_render_tile_cb(rtile, false); } } update_status_time(); } void Session::map_neighbor_tiles(RenderTile *tiles, Device *tile_device) { thread_scoped_lock tile_lock(tile_mutex); int center_idx = tiles[4].tile_index; assert(tile_manager.state.tiles[center_idx].state == Tile::DENOISE); BufferParams buffer_params = tile_manager.params; int4 image_region = make_int4(buffer_params.full_x, buffer_params.full_y, buffer_params.full_x + buffer_params.width, buffer_params.full_y + buffer_params.height); for(int dy = -1, i = 0; dy <= 1; dy++) { for(int dx = -1; dx <= 1; dx++, i++) { int px = tiles[4].x + dx*params.tile_size.x; int py = tiles[4].y + dy*params.tile_size.y; if(px >= image_region.x && py >= image_region.y && px < image_region.z && py < image_region.w) { int tile_index = center_idx + dy*tile_manager.state.tile_stride + dx; Tile *tile = &tile_manager.state.tiles[tile_index]; assert(tile->buffers); tiles[i].buffer = tile->buffers->buffer.device_pointer; tiles[i].x = tile_manager.state.buffer.full_x + tile->x; tiles[i].y = tile_manager.state.buffer.full_y + tile->y; tiles[i].w = tile->w; tiles[i].h = tile->h; tiles[i].buffers = tile->buffers; tile->buffers->params.get_offset_stride(tiles[i].offset, tiles[i].stride); } else { tiles[i].buffer = (device_ptr)NULL; tiles[i].buffers = NULL; tiles[i].x = clamp(px, image_region.x, image_region.z); tiles[i].y = clamp(py, image_region.y, image_region.w); tiles[i].w = tiles[i].h = 0; } } } assert(tiles[4].buffers); device->map_neighbor_tiles(tile_device, tiles); } void Session::unmap_neighbor_tiles(RenderTile *tiles, Device *tile_device) { thread_scoped_lock tile_lock(tile_mutex); device->unmap_neighbor_tiles(tile_device, tiles); } void Session::run_cpu() { bool tiles_written = false; last_update_time = time_dt(); { /* reset once to start */ thread_scoped_lock reset_lock(delayed_reset.mutex); thread_scoped_lock buffers_lock(buffers_mutex); thread_scoped_lock display_lock(display_mutex); reset_(delayed_reset.params, delayed_reset.samples); delayed_reset.do_reset = false; } while(!progress.get_cancel()) { /* advance to next tile */ bool no_tiles = !tile_manager.next(); bool need_tonemap = false; if(params.background) { /* if no work left and in background mode, we can stop immediately */ if(no_tiles) { progress.set_status("Finished"); break; } } else { /* if in interactive mode, and we are either paused or done for now, * wait for pause condition notify to wake up again */ thread_scoped_lock pause_lock(pause_mutex); if(!pause && delayed_reset.do_reset) { /* reset once to start */ thread_scoped_lock reset_lock(delayed_reset.mutex); thread_scoped_lock buffers_lock(buffers_mutex); thread_scoped_lock display_lock(display_mutex); reset_(delayed_reset.params, delayed_reset.samples); delayed_reset.do_reset = false; } else if(pause || no_tiles) { update_status_time(pause, no_tiles); while(1) { scoped_timer pause_timer; pause_cond.wait(pause_lock); if(pause) { progress.add_skip_time(pause_timer, params.background); } update_status_time(pause, no_tiles); progress.set_update(); if(!pause) break; } } if(progress.get_cancel()) break; } if(!no_tiles) { /* buffers mutex is locked entirely while rendering each * sample, and released/reacquired on each iteration to allow * reset and draw in between */ thread_scoped_lock buffers_lock(buffers_mutex); /* update scene */ scoped_timer update_timer; update_scene(); progress.add_skip_time(update_timer, params.background); if(!device->error_message().empty()) progress.set_error(device->error_message()); if(progress.get_cancel()) break; /* update status and timing */ update_status_time(); /* render */ render(); /* update status and timing */ update_status_time(); if(!params.background) need_tonemap = true; if(!device->error_message().empty()) progress.set_error(device->error_message()); } device->task_wait(); { thread_scoped_lock reset_lock(delayed_reset.mutex); thread_scoped_lock buffers_lock(buffers_mutex); thread_scoped_lock display_lock(display_mutex); if(delayed_reset.do_reset) { /* reset rendering if request from main thread */ delayed_reset.do_reset = false; reset_(delayed_reset.params, delayed_reset.samples); } else if(need_tonemap) { /* tonemap only if we do not reset, we don't we don't * want to show the result of an incomplete sample */ tonemap(tile_manager.state.sample); } if(!device->error_message().empty()) progress.set_error(device->error_message()); tiles_written = update_progressive_refine(progress.get_cancel()); } progress.set_update(); } if(!tiles_written) update_progressive_refine(true); } DeviceRequestedFeatures Session::get_requested_device_features() { /* TODO(sergey): Consider moving this to the Scene level. */ DeviceRequestedFeatures requested_features; requested_features.experimental = params.experimental; scene->shader_manager->get_requested_features( scene, &requested_features); if(!params.background) { /* Avoid too much re-compilations for viewport render. */ requested_features.max_nodes_group = NODE_GROUP_LEVEL_MAX; requested_features.nodes_features = NODE_FEATURE_ALL; } /* This features are not being tweaked as often as shaders, * so could be done selective magic for the viewport as well. */ requested_features.use_hair = false; requested_features.use_object_motion = false; requested_features.use_camera_motion = scene->camera->use_motion; foreach(Object *object, scene->objects) { Mesh *mesh = object->mesh; if(mesh->num_curves()) { requested_features.use_hair = true; } requested_features.use_object_motion |= object->use_motion | mesh->use_motion_blur; requested_features.use_camera_motion |= mesh->use_motion_blur; #ifdef WITH_OPENSUBDIV if(mesh->subdivision_type != Mesh::SUBDIVISION_NONE) { requested_features.use_patch_evaluation = true; } #endif if(object->is_shadow_catcher) { requested_features.use_shadow_tricks = true; } } BakeManager *bake_manager = scene->bake_manager; requested_features.use_baking = bake_manager->get_baking(); requested_features.use_integrator_branched = (scene->integrator->method == Integrator::BRANCHED_PATH); requested_features.use_denoising = params.use_denoising; return requested_features; } void Session::load_kernels(bool lock_scene) { thread_scoped_lock scene_lock; if(lock_scene) { scene_lock = thread_scoped_lock(scene->mutex); } DeviceRequestedFeatures requested_features = get_requested_device_features(); if(!kernels_loaded || loaded_kernel_features.modified(requested_features)) { progress.set_status("Loading render kernels (may take a few minutes the first time)"); scoped_timer timer; VLOG(2) << "Requested features:\n" << requested_features; if(!device->load_kernels(requested_features)) { string message = device->error_message(); if(message.empty()) message = "Failed loading render kernel, see console for errors"; progress.set_error(message); progress.set_status("Error", message); progress.set_update(); return; } progress.add_skip_time(timer, false); VLOG(1) << "Total time spent loading kernels: " << time_dt() - timer.get_start(); kernels_loaded = true; loaded_kernel_features = requested_features; } } void Session::run() { /* load kernels */ load_kernels(); /* session thread loop */ progress.set_status("Waiting for render to start"); /* run */ if(!progress.get_cancel()) { /* reset number of rendered samples */ progress.reset_sample(); if(device_use_gl) run_gpu(); else run_cpu(); } /* progress update */ if(progress.get_cancel()) progress.set_status("Cancel", progress.get_cancel_message()); else progress.set_update(); } bool Session::draw(BufferParams& buffer_params, DeviceDrawParams &draw_params) { if(device_use_gl) return draw_gpu(buffer_params, draw_params); else return draw_cpu(buffer_params, draw_params); } void Session::reset_(BufferParams& buffer_params, int samples) { if(buffers && buffer_params.modified(tile_manager.params)) { gpu_draw_ready = false; buffers->reset(buffer_params); if(display) { display->reset(buffer_params); } } tile_manager.reset(buffer_params, samples); progress.reset_sample(); bool show_progress = params.background || tile_manager.get_num_effective_samples() != INT_MAX; progress.set_total_pixel_samples(show_progress? tile_manager.state.total_pixel_samples : 0); if(!params.background) progress.set_start_time(); progress.set_render_start_time(); } void Session::reset(BufferParams& buffer_params, int samples) { if(device_use_gl) reset_gpu(buffer_params, samples); else reset_cpu(buffer_params, samples); } void Session::set_samples(int samples) { if(samples != params.samples) { params.samples = samples; tile_manager.set_samples(samples); { thread_scoped_lock pause_lock(pause_mutex); } pause_cond.notify_all(); } } void Session::set_pause(bool pause_) { bool notify = false; { thread_scoped_lock pause_lock(pause_mutex); if(pause != pause_) { pause = pause_; notify = true; } } if(notify) pause_cond.notify_all(); } void Session::wait() { session_thread->join(); delete session_thread; session_thread = NULL; } void Session::update_scene() { thread_scoped_lock scene_lock(scene->mutex); /* update camera if dimensions changed for progressive render. the camera * knows nothing about progressive or cropped rendering, it just gets the * image dimensions passed in */ Camera *cam = scene->camera; int width = tile_manager.state.buffer.full_width; int height = tile_manager.state.buffer.full_height; int resolution = tile_manager.state.resolution_divider; if(width != cam->width || height != cam->height) { cam->width = width; cam->height = height; cam->resolution = resolution; cam->tag_update(); } /* number of samples is needed by multi jittered * sampling pattern and by baking */ Integrator *integrator = scene->integrator; BakeManager *bake_manager = scene->bake_manager; if(integrator->sampling_pattern == SAMPLING_PATTERN_CMJ || bake_manager->get_baking()) { int aa_samples = tile_manager.num_samples; if(aa_samples != integrator->aa_samples) { integrator->aa_samples = aa_samples; integrator->tag_update(scene); } } /* update scene */ if(scene->need_update()) { load_kernels(false); /* Update max_closures. */ KernelIntegrator *kintegrator = &scene->dscene.data.integrator; if(params.background) { kintegrator->max_closures = get_max_closure_count(); } else { /* Currently viewport render is faster with higher max_closures, needs investigating. */ kintegrator->max_closures = 64; } progress.set_status("Updating Scene"); MEM_GUARDED_CALL(&progress, scene->device_update, device, progress); } } void Session::update_status_time(bool show_pause, bool show_done) { int progressive_sample = tile_manager.state.sample; int num_samples = tile_manager.get_num_effective_samples(); int tile = progress.get_rendered_tiles(); int num_tiles = tile_manager.state.num_tiles; /* update status */ string status, substatus; if(!params.progressive) { const bool is_cpu = params.device.type == DEVICE_CPU; const bool rendering_finished = (tile == num_tiles); const bool is_last_tile = (tile + 1) == num_tiles; substatus = string_printf("Rendered %d/%d Tiles", tile, num_tiles); if(!rendering_finished && (device->show_samples() || (is_cpu && is_last_tile))) { /* Some devices automatically support showing the sample number: * - CUDADevice * - OpenCLDevice when using the megakernel (the split kernel renders multiple * samples at the same time, so the current sample isn't really defined) * - CPUDevice when using one thread * For these devices, the current sample is always shown. * * The other option is when the last tile is currently being rendered by the CPU. */ substatus += string_printf(", Sample %d/%d", progress.get_current_sample(), num_samples); } if(params.use_denoising) { substatus += string_printf(", Denoised %d tiles", progress.get_denoised_tiles()); } } else if(tile_manager.num_samples == INT_MAX) substatus = string_printf("Path Tracing Sample %d", progressive_sample+1); else substatus = string_printf("Path Tracing Sample %d/%d", progressive_sample+1, num_samples); if(show_pause) { status = "Paused"; } else if(show_done) { status = "Done"; progress.set_end_time(); /* Save end time so that further calls to get_time are accurate. */ } else { status = substatus; substatus.clear(); } progress.set_status(status, substatus); } void Session::render() { /* Clear buffers. */ if(buffers && tile_manager.state.sample == tile_manager.range_start_sample) { buffers->zero(); } /* Add path trace task. */ DeviceTask task(DeviceTask::RENDER); task.acquire_tile = function_bind(&Session::acquire_tile, this, _1, _2); task.release_tile = function_bind(&Session::release_tile, this, _1); task.map_neighbor_tiles = function_bind(&Session::map_neighbor_tiles, this, _1, _2); task.unmap_neighbor_tiles = function_bind(&Session::unmap_neighbor_tiles, this, _1, _2); task.get_cancel = function_bind(&Progress::get_cancel, &this->progress); task.update_tile_sample = function_bind(&Session::update_tile_sample, this, _1); task.update_progress_sample = function_bind(&Progress::add_samples, &this->progress, _1, _2); task.need_finish_queue = params.progressive_refine; task.integrator_branched = scene->integrator->method == Integrator::BRANCHED_PATH; task.requested_tile_size = params.tile_size; task.passes_size = tile_manager.params.get_passes_size(); if(params.use_denoising) { task.denoising_radius = params.denoising_radius; task.denoising_strength = params.denoising_strength; task.denoising_feature_strength = params.denoising_feature_strength; task.denoising_relative_pca = params.denoising_relative_pca; assert(!scene->film->need_update); task.pass_stride = scene->film->pass_stride; task.pass_denoising_data = scene->film->denoising_data_offset; task.pass_denoising_clean = scene->film->denoising_clean_offset; } device->task_add(task); } void Session::tonemap(int sample) { /* add tonemap task */ DeviceTask task(DeviceTask::FILM_CONVERT); task.x = tile_manager.state.buffer.full_x; task.y = tile_manager.state.buffer.full_y; task.w = tile_manager.state.buffer.width; task.h = tile_manager.state.buffer.height; task.rgba_byte = display->rgba_byte.device_pointer; task.rgba_half = display->rgba_half.device_pointer; task.buffer = buffers->buffer.device_pointer; task.sample = sample; tile_manager.state.buffer.get_offset_stride(task.offset, task.stride); if(task.w > 0 && task.h > 0) { device->task_add(task); device->task_wait(); /* set display to new size */ display->draw_set(task.w, task.h); } display_outdated = false; } bool Session::update_progressive_refine(bool cancel) { int sample = tile_manager.state.sample + 1; bool write = sample == tile_manager.num_samples || cancel; double current_time = time_dt(); if(current_time - last_update_time < params.progressive_update_timeout) { /* if last sample was processed, we need to write buffers anyway */ if(!write && sample != 1) return false; } if(params.progressive_refine) { foreach(Tile& tile, tile_manager.state.tiles) { if(!tile.buffers) { continue; } RenderTile rtile; rtile.x = tile_manager.state.buffer.full_x + tile.x; rtile.y = tile_manager.state.buffer.full_y + tile.y; rtile.w = tile.w; rtile.h = tile.h; rtile.sample = sample; rtile.buffers = tile.buffers; if(write) { if(write_render_tile_cb) write_render_tile_cb(rtile); } else { if(update_render_tile_cb) update_render_tile_cb(rtile, true); } } } last_update_time = current_time; return write; } void Session::device_free() { scene->device_free(); tile_manager.device_free(); /* used from background render only, so no need to * re-create render/display buffers here */ } int Session::get_max_closure_count() { int max_closures = 0; for(int i = 0; i < scene->shaders.size(); i++) { int num_closures = scene->shaders[i]->graph->get_num_closures(); max_closures = max(max_closures, num_closures); } max_closure_global = max(max_closure_global, max_closures); return max_closure_global; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/session.h000066400000000000000000000134051334742672700215130ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SESSION_H__ #define __SESSION_H__ #include "render/buffers.h" #include "device/device.h" #include "render/shader.h" #include "render/tile.h" #include "util/util_progress.h" #include "util/util_stats.h" #include "util/util_thread.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class BufferParams; class Device; class DeviceScene; class DeviceRequestedFeatures; class DisplayBuffer; class Progress; class RenderBuffers; class Scene; /* Session Parameters */ class SessionParams { public: DeviceInfo device; bool background; bool progressive_refine; string output_path; bool progressive; bool experimental; int samples; int2 tile_size; TileOrder tile_order; int start_resolution; int pixel_size; int threads; bool display_buffer_linear; bool use_denoising; int denoising_radius; float denoising_strength; float denoising_feature_strength; bool denoising_relative_pca; double cancel_timeout; double reset_timeout; double text_timeout; double progressive_update_timeout; ShadingSystem shadingsystem; SessionParams() { background = false; progressive_refine = false; output_path = ""; progressive = false; experimental = false; samples = INT_MAX; tile_size = make_int2(64, 64); start_resolution = INT_MAX; pixel_size = 1; threads = 0; use_denoising = false; denoising_radius = 8; denoising_strength = 0.0f; denoising_feature_strength = 0.0f; denoising_relative_pca = false; display_buffer_linear = false; cancel_timeout = 0.1; reset_timeout = 0.1; text_timeout = 1.0; progressive_update_timeout = 1.0; shadingsystem = SHADINGSYSTEM_SVM; tile_order = TILE_CENTER; } bool modified(const SessionParams& params) { return !(device == params.device && background == params.background && progressive_refine == params.progressive_refine && output_path == params.output_path /* && samples == params.samples */ && progressive == params.progressive && experimental == params.experimental && tile_size == params.tile_size && start_resolution == params.start_resolution && pixel_size == params.pixel_size && threads == params.threads && display_buffer_linear == params.display_buffer_linear && cancel_timeout == params.cancel_timeout && reset_timeout == params.reset_timeout && text_timeout == params.text_timeout && progressive_update_timeout == params.progressive_update_timeout && tile_order == params.tile_order && shadingsystem == params.shadingsystem); } }; /* Session * * This is the class that contains the session thread, running the render * control loop and dispatching tasks. */ class Session { public: Device *device; Scene *scene; RenderBuffers *buffers; DisplayBuffer *display; Progress progress; SessionParams params; TileManager tile_manager; Stats stats; function write_render_tile_cb; function update_render_tile_cb; explicit Session(const SessionParams& params); ~Session(); void start(); bool draw(BufferParams& params, DeviceDrawParams& draw_params); void wait(); bool ready_to_reset(); void reset(BufferParams& params, int samples); void set_samples(int samples); void set_pause(bool pause); void update_scene(); void load_kernels(bool lock_scene=true); void device_free(); /* Returns the rendering progress or 0 if no progress can be determined * (for example, when rendering with unlimited samples). */ float get_progress(); // XXX: I make it all public so that I can access the display_mutex // from goxel. // protected: public: struct DelayedReset { thread_mutex mutex; bool do_reset; BufferParams params; int samples; } delayed_reset; void run(); void update_status_time(bool show_pause = false, bool show_done = false); void tonemap(int sample); void render(); void reset_(BufferParams& params, int samples); void run_cpu(); bool draw_cpu(BufferParams& params, DeviceDrawParams& draw_params); void reset_cpu(BufferParams& params, int samples); void run_gpu(); bool draw_gpu(BufferParams& params, DeviceDrawParams& draw_params); void reset_gpu(BufferParams& params, int samples); bool acquire_tile(Device *tile_device, RenderTile& tile); void update_tile_sample(RenderTile& tile); void release_tile(RenderTile& tile); void map_neighbor_tiles(RenderTile *tiles, Device *tile_device); void unmap_neighbor_tiles(RenderTile *tiles, Device *tile_device); bool device_use_gl; thread *session_thread; volatile bool display_outdated; volatile bool gpu_draw_ready; volatile bool gpu_need_tonemap; thread_condition_variable gpu_need_tonemap_cond; bool pause; thread_condition_variable pause_cond; thread_mutex pause_mutex; thread_mutex tile_mutex; thread_mutex buffers_mutex; thread_mutex display_mutex; bool kernels_loaded; DeviceRequestedFeatures loaded_kernel_features; double reset_time; /* progressive refine */ double last_update_time; bool update_progressive_refine(bool cancel); DeviceRequestedFeatures get_requested_device_features(); /* ** Split kernel routines ** */ /* Maximumnumber of closure during session lifetime. */ int max_closure_global; /* Get maximum number of closures to be used in kernel. */ int get_max_closure_count(); }; CCL_NAMESPACE_END #endif /* __SESSION_H__ */ goxel-0.8.1/ext_src/cycles/src/render/shader.cpp000066400000000000000000000456151334742672700216410ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/background.h" #include "render/camera.h" #include "device/device.h" #include "render/graph.h" #include "render/integrator.h" #include "render/light.h" #include "render/mesh.h" #include "render/nodes.h" #include "render/object.h" #include "render/osl.h" #include "render/scene.h" #include "render/shader.h" #include "render/svm.h" #include "render/tables.h" #include "util/util_foreach.h" CCL_NAMESPACE_BEGIN thread_mutex ShaderManager::lookup_table_mutex; vector ShaderManager::beckmann_table; bool ShaderManager::beckmann_table_ready = false; /* Beckmann sampling precomputed table, see bsdf_microfacet.h */ /* 2D slope distribution (alpha = 1.0) */ static float beckmann_table_P22(const float slope_x, const float slope_y) { return expf(-(slope_x*slope_x + slope_y*slope_y)); } /* maximal slope amplitude (range that contains 99.99% of the distribution) */ static float beckmann_table_slope_max() { return 6.0; } /* MSVC 2015 needs this ugly hack to prevent a codegen bug on x86 * see T50176 for details */ #if defined(_MSC_VER) && (_MSC_VER == 1900) # define MSVC_VOLATILE volatile #else # define MSVC_VOLATILE #endif /* Paper used: Importance Sampling Microfacet-Based BSDFs with the * Distribution of Visible Normals. Supplemental Material 2/2. * * http://hal.inria.fr/docs/01/00/66/20/ANNEX/supplemental2.pdf */ static void beckmann_table_rows(float *table, int row_from, int row_to) { /* allocate temporary data */ const int DATA_TMP_SIZE = 512; vector slope_x(DATA_TMP_SIZE); vector CDF_P22_omega_i(DATA_TMP_SIZE); /* loop over incident directions */ for(int index_theta = row_from; index_theta < row_to; index_theta++) { /* incident vector */ const float cos_theta = index_theta / (BECKMANN_TABLE_SIZE - 1.0f); const float sin_theta = safe_sqrtf(1.0f - cos_theta*cos_theta); /* for a given incident vector * integrate P22_{omega_i}(x_slope, 1, 1), Eq. (10) */ slope_x[0] = (double)-beckmann_table_slope_max(); CDF_P22_omega_i[0] = 0; for(MSVC_VOLATILE int index_slope_x = 1; index_slope_x < DATA_TMP_SIZE; ++index_slope_x) { /* slope_x */ slope_x[index_slope_x] = (double)(-beckmann_table_slope_max() + 2.0f * beckmann_table_slope_max() * index_slope_x/(DATA_TMP_SIZE - 1.0f)); /* dot product with incident vector */ float dot_product = fmaxf(0.0f, -(float)slope_x[index_slope_x]*sin_theta + cos_theta); /* marginalize P22_{omega_i}(x_slope, 1, 1), Eq. (10) */ float P22_omega_i = 0.0f; for(int j = 0; j < 100; ++j) { float slope_y = -beckmann_table_slope_max() + 2.0f * beckmann_table_slope_max() * j * (1.0f/99.0f); P22_omega_i += dot_product * beckmann_table_P22((float)slope_x[index_slope_x], slope_y); } /* CDF of P22_{omega_i}(x_slope, 1, 1), Eq. (10) */ CDF_P22_omega_i[index_slope_x] = CDF_P22_omega_i[index_slope_x - 1] + (double)P22_omega_i; } /* renormalize CDF_P22_omega_i */ for(int index_slope_x = 1; index_slope_x < DATA_TMP_SIZE; ++index_slope_x) CDF_P22_omega_i[index_slope_x] /= CDF_P22_omega_i[DATA_TMP_SIZE - 1]; /* loop over random number U1 */ int index_slope_x = 0; for(int index_U = 0; index_U < BECKMANN_TABLE_SIZE; ++index_U) { const double U = 0.0000001 + 0.9999998 * index_U / (double)(BECKMANN_TABLE_SIZE - 1); /* inverse CDF_P22_omega_i, solve Eq.(11) */ while(CDF_P22_omega_i[index_slope_x] <= U) ++index_slope_x; const double interp = (CDF_P22_omega_i[index_slope_x] - U) / (CDF_P22_omega_i[index_slope_x] - CDF_P22_omega_i[index_slope_x - 1]); /* store value */ table[index_U + index_theta*BECKMANN_TABLE_SIZE] = (float)( interp * slope_x[index_slope_x - 1] + (1.0 - interp) * slope_x[index_slope_x]); } } } #undef MSVC_VOLATILE static void beckmann_table_build(vector& table) { table.resize(BECKMANN_TABLE_SIZE*BECKMANN_TABLE_SIZE); /* multithreaded build */ TaskPool pool; for(int i = 0; i < BECKMANN_TABLE_SIZE; i+=8) pool.push(function_bind(&beckmann_table_rows, &table[0], i, i+8)); pool.wait_work(); } /* Shader */ NODE_DEFINE(Shader) { NodeType* type = NodeType::add("shader", create); SOCKET_BOOLEAN(use_mis, "Use MIS", true); SOCKET_BOOLEAN(use_transparent_shadow, "Use Transparent Shadow", true); SOCKET_BOOLEAN(heterogeneous_volume, "Heterogeneous Volume", true); static NodeEnum volume_sampling_method_enum; volume_sampling_method_enum.insert("distance", VOLUME_SAMPLING_DISTANCE); volume_sampling_method_enum.insert("equiangular", VOLUME_SAMPLING_EQUIANGULAR); volume_sampling_method_enum.insert("multiple_importance", VOLUME_SAMPLING_MULTIPLE_IMPORTANCE); SOCKET_ENUM(volume_sampling_method, "Volume Sampling Method", volume_sampling_method_enum, VOLUME_SAMPLING_DISTANCE); static NodeEnum volume_interpolation_method_enum; volume_interpolation_method_enum.insert("linear", VOLUME_INTERPOLATION_LINEAR); volume_interpolation_method_enum.insert("cubic", VOLUME_INTERPOLATION_CUBIC); SOCKET_ENUM(volume_interpolation_method, "Volume Interpolation Method", volume_interpolation_method_enum, VOLUME_INTERPOLATION_LINEAR); static NodeEnum displacement_method_enum; displacement_method_enum.insert("bump", DISPLACE_BUMP); displacement_method_enum.insert("true", DISPLACE_TRUE); displacement_method_enum.insert("both", DISPLACE_BOTH); SOCKET_ENUM(displacement_method, "Displacement Method", displacement_method_enum, DISPLACE_BUMP); return type; } Shader::Shader() : Node(node_type) { pass_id = 0; graph = NULL; has_surface = false; has_surface_transparent = false; has_surface_emission = false; has_surface_bssrdf = false; has_volume = false; has_displacement = false; has_bump = false; has_bssrdf_bump = false; has_surface_spatial_varying = false; has_volume_spatial_varying = false; has_object_dependency = false; has_attribute_dependency = false; has_integrator_dependency = false; has_volume_connected = false; displacement_method = DISPLACE_BUMP; id = -1; used = false; need_update = true; need_update_mesh = true; } Shader::~Shader() { delete graph; } bool Shader::is_constant_emission(float3 *emission) { ShaderInput *surf = graph->output()->input("Surface"); if(!surf->link || surf->link->parent->type != EmissionNode::node_type) { return false; } EmissionNode *node = (EmissionNode*) surf->link->parent; assert(node->input("Color")); assert(node->input("Strength")); if(node->input("Color")->link || node->input("Strength")->link) { return false; } *emission = node->color*node->strength; return true; } void Shader::set_graph(ShaderGraph *graph_) { /* do this here already so that we can detect if mesh or object attributes * are needed, since the node attribute callbacks check if their sockets * are connected but proxy nodes should not count */ if(graph_) { graph_->remove_proxy_nodes(); if(displacement_method != DISPLACE_BUMP) { graph_->compute_displacement_hash(); } } /* update geometry if displacement changed */ if(displacement_method != DISPLACE_BUMP) { const char *old_hash = (graph)? graph->displacement_hash.c_str() : ""; const char *new_hash = (graph_)? graph_->displacement_hash.c_str() : ""; if(strcmp(old_hash, new_hash) != 0) { need_update_mesh = true; } } /* assign graph */ delete graph; graph = graph_; /* Store info here before graph optimization to make sure that * nodes that get optimized away still count. */ has_volume_connected = (graph->output()->input("Volume")->link != NULL); } void Shader::tag_update(Scene *scene) { /* update tag */ need_update = true; scene->shader_manager->need_update = true; /* if the shader previously was emissive, update light distribution, * if the new shader is emissive, a light manager update tag will be * done in the shader manager device update. */ if(use_mis && has_surface_emission) scene->light_manager->need_update = true; /* Special handle of background MIS light for now: for some reason it * has use_mis set to false. We are quite close to release now, so * better to be safe. */ if(this == scene->default_background && scene->light_manager->has_background_light(scene)) { scene->light_manager->need_update = true; } /* quick detection of which kind of shaders we have to avoid loading * e.g. surface attributes when there is only a volume shader. this could * be more fine grained but it's better than nothing */ OutputNode *output = graph->output(); bool prev_has_volume = has_volume; has_surface = has_surface || output->input("Surface")->link; has_volume = has_volume || output->input("Volume")->link; has_displacement = has_displacement || output->input("Displacement")->link; /* get requested attributes. this could be optimized by pruning unused * nodes here already, but that's the job of the shader manager currently, * and may not be so great for interactive rendering where you temporarily * disconnect a node */ AttributeRequestSet prev_attributes = attributes; attributes.clear(); foreach(ShaderNode *node, graph->nodes) node->attributes(this, &attributes); if(has_displacement && displacement_method == DISPLACE_BOTH) { attributes.add(ATTR_STD_POSITION_UNDISPLACED); } /* compare if the attributes changed, mesh manager will check * need_update_mesh, update the relevant meshes and clear it. */ if(attributes.modified(prev_attributes)) { need_update_mesh = true; scene->mesh_manager->need_update = true; } if(has_volume != prev_has_volume) { scene->mesh_manager->need_flags_update = true; scene->object_manager->need_flags_update = true; } } void Shader::tag_used(Scene *scene) { /* if an unused shader suddenly gets used somewhere, it needs to be * recompiled because it was skipped for compilation before */ if(!used) { need_update = true; scene->shader_manager->need_update = true; } } /* Shader Manager */ ShaderManager::ShaderManager() { need_update = true; beckmann_table_offset = TABLE_OFFSET_INVALID; } ShaderManager::~ShaderManager() { } ShaderManager *ShaderManager::create(Scene *scene, int shadingsystem) { ShaderManager *manager; (void)shadingsystem; /* Ignored when built without OSL. */ #ifdef WITH_OSL if(shadingsystem == SHADINGSYSTEM_OSL) { manager = new OSLShaderManager(); } else #endif { manager = new SVMShaderManager(); } add_default(scene); return manager; } uint ShaderManager::get_attribute_id(ustring name) { thread_scoped_spin_lock lock(attribute_lock_); /* get a unique id for each name, for SVM attribute lookup */ AttributeIDMap::iterator it = unique_attribute_id.find(name); if(it != unique_attribute_id.end()) return it->second; uint id = (uint)ATTR_STD_NUM + unique_attribute_id.size(); unique_attribute_id[name] = id; return id; } uint ShaderManager::get_attribute_id(AttributeStandard std) { return (uint)std; } int ShaderManager::get_shader_id(Shader *shader, bool smooth) { /* get a shader id to pass to the kernel */ int id = shader->id; /* smooth flag */ if(smooth) id |= SHADER_SMOOTH_NORMAL; /* default flags */ id |= SHADER_CAST_SHADOW|SHADER_AREA_LIGHT; return id; } void ShaderManager::device_update_shaders_used(Scene *scene) { /* figure out which shaders are in use, so SVM/OSL can skip compiling them * for speed and avoid loading image textures into memory */ uint id = 0; foreach(Shader *shader, scene->shaders) { shader->used = false; shader->id = id++; } scene->default_surface->used = true; scene->default_light->used = true; scene->default_background->used = true; scene->default_empty->used = true; if(scene->background->shader) scene->background->shader->used = true; foreach(Mesh *mesh, scene->meshes) foreach(Shader *shader, mesh->used_shaders) shader->used = true; foreach(Light *light, scene->lights) if(light->shader) light->shader->used = true; } void ShaderManager::device_update_common(Device *device, DeviceScene *dscene, Scene *scene, Progress& /*progress*/) { dscene->shader_flag.free(); if(scene->shaders.size() == 0) return; uint shader_flag_size = scene->shaders.size()*SHADER_SIZE; uint *shader_flag = dscene->shader_flag.alloc(shader_flag_size); uint i = 0; bool has_volumes = false; bool has_transparent_shadow = false; foreach(Shader *shader, scene->shaders) { uint flag = 0; if(shader->use_mis) flag |= SD_USE_MIS; if(shader->has_surface_transparent && shader->use_transparent_shadow) flag |= SD_HAS_TRANSPARENT_SHADOW; if(shader->has_volume) { flag |= SD_HAS_VOLUME; has_volumes = true; /* todo: this could check more fine grained, to skip useless volumes * enclosed inside an opaque bsdf. */ flag |= SD_HAS_TRANSPARENT_SHADOW; } /* in this case we can assume transparent surface */ if(shader->has_volume_connected && !shader->has_surface) flag |= SD_HAS_ONLY_VOLUME; if(shader->heterogeneous_volume && shader->has_volume_spatial_varying) flag |= SD_HETEROGENEOUS_VOLUME; if(shader->has_attribute_dependency) flag |= SD_NEED_ATTRIBUTES; if(shader->has_bssrdf_bump) flag |= SD_HAS_BSSRDF_BUMP; if(device->info.has_volume_decoupled) { if(shader->volume_sampling_method == VOLUME_SAMPLING_EQUIANGULAR) flag |= SD_VOLUME_EQUIANGULAR; if(shader->volume_sampling_method == VOLUME_SAMPLING_MULTIPLE_IMPORTANCE) flag |= SD_VOLUME_MIS; } if(shader->volume_interpolation_method == VOLUME_INTERPOLATION_CUBIC) flag |= SD_VOLUME_CUBIC; if(shader->has_bump) flag |= SD_HAS_BUMP; if(shader->displacement_method != DISPLACE_BUMP) flag |= SD_HAS_DISPLACEMENT; /* constant emission check */ float3 constant_emission = make_float3(0.0f, 0.0f, 0.0f); if(shader->is_constant_emission(&constant_emission)) flag |= SD_HAS_CONSTANT_EMISSION; /* regular shader */ shader_flag[i++] = flag; shader_flag[i++] = shader->pass_id; shader_flag[i++] = __float_as_int(constant_emission.x); shader_flag[i++] = __float_as_int(constant_emission.y); shader_flag[i++] = __float_as_int(constant_emission.z); has_transparent_shadow |= (flag & SD_HAS_TRANSPARENT_SHADOW) != 0; } dscene->shader_flag.copy_to_device(); /* lookup tables */ KernelTables *ktables = &dscene->data.tables; /* beckmann lookup table */ if(beckmann_table_offset == TABLE_OFFSET_INVALID) { if(!beckmann_table_ready) { thread_scoped_lock lock(lookup_table_mutex); if(!beckmann_table_ready) { beckmann_table_build(beckmann_table); beckmann_table_ready = true; } } beckmann_table_offset = scene->lookup_tables->add_table(dscene, beckmann_table); } ktables->beckmann_offset = (int)beckmann_table_offset; /* integrator */ KernelIntegrator *kintegrator = &dscene->data.integrator; kintegrator->use_volumes = has_volumes; /* TODO(sergey): De-duplicate with flags set in integrator.cpp. */ kintegrator->transparent_shadows = has_transparent_shadow; } void ShaderManager::device_free_common(Device *, DeviceScene *dscene, Scene *scene) { scene->lookup_tables->remove_table(&beckmann_table_offset); dscene->shader_flag.free(); } void ShaderManager::add_default(Scene *scene) { /* default surface */ { ShaderGraph *graph = new ShaderGraph(); DiffuseBsdfNode *diffuse = new DiffuseBsdfNode(); diffuse->color = make_float3(0.8f, 0.8f, 0.8f); graph->add(diffuse); graph->connect(diffuse->output("BSDF"), graph->output()->input("Surface")); Shader *shader = new Shader(); shader->name = "default_surface"; shader->graph = graph; scene->shaders.push_back(shader); scene->default_surface = shader; } /* default light */ { ShaderGraph *graph = new ShaderGraph(); EmissionNode *emission = new EmissionNode(); emission->color = make_float3(0.8f, 0.8f, 0.8f); emission->strength = 0.0f; graph->add(emission); graph->connect(emission->output("Emission"), graph->output()->input("Surface")); Shader *shader = new Shader(); shader->name = "default_light"; shader->graph = graph; scene->shaders.push_back(shader); scene->default_light = shader; } /* default background */ { ShaderGraph *graph = new ShaderGraph(); Shader *shader = new Shader(); shader->name = "default_background"; shader->graph = graph; scene->shaders.push_back(shader); scene->default_background = shader; } /* default empty */ { ShaderGraph *graph = new ShaderGraph(); Shader *shader = new Shader(); shader->name = "default_empty"; shader->graph = graph; scene->shaders.push_back(shader); scene->default_empty = shader; } } void ShaderManager::get_requested_graph_features(ShaderGraph *graph, DeviceRequestedFeatures *requested_features) { foreach(ShaderNode *node, graph->nodes) { requested_features->max_nodes_group = max(requested_features->max_nodes_group, node->get_group()); requested_features->nodes_features |= node->get_feature(); if(node->special_type == SHADER_SPECIAL_TYPE_CLOSURE) { BsdfNode *bsdf_node = static_cast(node); if(CLOSURE_IS_VOLUME(bsdf_node->closure)) { requested_features->nodes_features |= NODE_FEATURE_VOLUME; } else if(CLOSURE_IS_PRINCIPLED(bsdf_node->closure)) { requested_features->use_principled = true; } } if(node->has_surface_bssrdf()) { requested_features->use_subsurface = true; } if(node->has_surface_transparent()) { requested_features->use_transparent = true; } if(node->has_raytrace()) { requested_features->use_shader_raytrace = true; } } } void ShaderManager::get_requested_features(Scene *scene, DeviceRequestedFeatures *requested_features) { requested_features->max_nodes_group = NODE_GROUP_LEVEL_0; requested_features->nodes_features = 0; for(int i = 0; i < scene->shaders.size(); i++) { Shader *shader = scene->shaders[i]; /* Gather requested features from all the nodes from the graph nodes. */ get_requested_graph_features(shader->graph, requested_features); ShaderNode *output_node = shader->graph->output(); if(output_node->input("Displacement")->link != NULL) { requested_features->nodes_features |= NODE_FEATURE_BUMP; if(shader->displacement_method == DISPLACE_BOTH) { requested_features->nodes_features |= NODE_FEATURE_BUMP_STATE; } } /* On top of volume nodes, also check if we need volume sampling because * e.g. an Emission node would slip through the NODE_FEATURE_VOLUME check */ if(shader->has_volume) requested_features->use_volume |= true; } } void ShaderManager::free_memory() { beckmann_table.free_memory(); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/shader.h000066400000000000000000000133341334742672700212770ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SHADER_H__ #define __SHADER_H__ #ifdef WITH_OSL /* So no context pollution happens from indirectly included windows.h */ # include "util/util_windows.h" # include #endif #include "render/attribute.h" #include "kernel/kernel_types.h" #include "graph/node.h" #include "util/util_map.h" #include "util/util_param.h" #include "util/util_string.h" #include "util/util_thread.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class DeviceRequestedFeatures; class Mesh; class Progress; class Scene; class ShaderGraph; struct float3; enum ShadingSystem { SHADINGSYSTEM_OSL, SHADINGSYSTEM_SVM }; /* Keep those in sync with the python-defined enum. */ enum VolumeSampling { VOLUME_SAMPLING_DISTANCE = 0, VOLUME_SAMPLING_EQUIANGULAR = 1, VOLUME_SAMPLING_MULTIPLE_IMPORTANCE = 2, VOLUME_NUM_SAMPLING, }; enum VolumeInterpolation { VOLUME_INTERPOLATION_LINEAR = 0, VOLUME_INTERPOLATION_CUBIC = 1, VOLUME_NUM_INTERPOLATION, }; enum DisplacementMethod { DISPLACE_BUMP = 0, DISPLACE_TRUE = 1, DISPLACE_BOTH = 2, DISPLACE_NUM_METHODS, }; /* Shader describing the appearance of a Mesh, Light or Background. * * While there is only a single shader graph, it has three outputs: surface, * volume and displacement, that the shader manager will compile and execute * separately. */ class Shader : public Node { public: NODE_DECLARE int pass_id; /* shader graph */ ShaderGraph *graph; /* sampling */ bool use_mis; bool use_transparent_shadow; bool heterogeneous_volume; VolumeSampling volume_sampling_method; int volume_interpolation_method; /* synchronization */ bool need_update; bool need_update_mesh; /* If the shader has only volume components, the surface is assumed to * be transparent. * However, graph optimization might remove the volume subgraph, but * since the user connected something to the volume output the surface * should still be transparent. * Therefore, has_volume_connected stores whether some volume subtree * was connected before optimization. */ bool has_volume_connected; /* information about shader after compiling */ bool has_surface; bool has_surface_emission; bool has_surface_transparent; bool has_volume; bool has_displacement; bool has_surface_bssrdf; bool has_bump; bool has_bssrdf_bump; bool has_surface_spatial_varying; bool has_volume_spatial_varying; bool has_object_dependency; bool has_attribute_dependency; bool has_integrator_dependency; /* displacement */ DisplacementMethod displacement_method; /* requested mesh attributes */ AttributeRequestSet attributes; /* determined before compiling */ uint id; bool used; #ifdef WITH_OSL /* osl shading state references */ OSL::ShaderGroupRef osl_surface_ref; OSL::ShaderGroupRef osl_surface_bump_ref; OSL::ShaderGroupRef osl_volume_ref; OSL::ShaderGroupRef osl_displacement_ref; #endif Shader(); ~Shader(); /* Checks whether the shader consists of just a emission node with fixed inputs that's connected directly to the output. * If yes, it sets the content of emission to the constant value (color * strength), which is then used for speeding up light evaluation. */ bool is_constant_emission(float3* emission); void set_graph(ShaderGraph *graph); void tag_update(Scene *scene); void tag_used(Scene *scene); }; /* Shader Manager virtual base class * * From this the SVM and OSL shader managers are derived, that do the actual * shader compiling and device updating. */ class ShaderManager { public: bool need_update; static ShaderManager *create(Scene *scene, int shadingsystem); virtual ~ShaderManager(); virtual void reset(Scene *scene) = 0; virtual bool use_osl() { return false; } /* device update */ virtual void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) = 0; virtual void device_free(Device *device, DeviceScene *dscene, Scene *scene) = 0; void device_update_shaders_used(Scene *scene); void device_update_common(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free_common(Device *device, DeviceScene *dscene, Scene *scene); /* get globally unique id for a type of attribute */ uint get_attribute_id(ustring name); uint get_attribute_id(AttributeStandard std); /* get shader id for mesh faces */ int get_shader_id(Shader *shader, bool smooth = false); /* add default shaders to scene, to use as default for things that don't * have any shader assigned explicitly */ static void add_default(Scene *scene); /* Selective nodes compilation. */ void get_requested_features(Scene *scene, DeviceRequestedFeatures *requested_features); static void free_memory(); protected: ShaderManager(); typedef unordered_map AttributeIDMap; AttributeIDMap unique_attribute_id; static thread_mutex lookup_table_mutex; static vector beckmann_table; static bool beckmann_table_ready; size_t beckmann_table_offset; void get_requested_graph_features(ShaderGraph *graph, DeviceRequestedFeatures *requested_features); thread_spin_lock attribute_lock_; }; CCL_NAMESPACE_END #endif /* __SHADER_H__ */ goxel-0.8.1/ext_src/cycles/src/render/sobol.cpp000066400000000000000000102064311334742672700215050ustar00rootroot00000000000000/* * Sobol sequence direction vectors. * * This file contains code to create direction vectors for generating sobol * sequences in high dimensions. It is adapted from code on this webpage: * * http://web.maths.unsw.edu.au/~fkuo/sobol/ * * From these papers: * * S. Joe and F. Y. Kuo, Remark on Algorithm 659: Implementing Sobol's quasirandom * sequence generator, ACM Trans. Math. Softw. 29, 49-57 (2003) * * S. Joe and F. Y. Kuo, Constructing Sobol sequences with better two-dimensional * projections, SIAM J. Sci. Comput. 30, 2635-2654 (2008) * */ /* Copyright (c) 2008, Frances Y. Kuo and Stephen Joe * 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 names of the copyright holders nor the names of the * University of New South Wales and the University of Waikato * and 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 ``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 HOLDERS 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. */ #include "util/util_types.h" #include "render/sobol.h" CCL_NAMESPACE_BEGIN #define SOBOL_MAX_NUMBER 32 typedef struct SobolDirectionNumbers { uint d, s, a; uint m[SOBOL_MAX_NUMBER]; } SobolDirectionNumbers; static SobolDirectionNumbers SOBOL_NUMBERS[SOBOL_MAX_DIMENSIONS-1] = { {2, 1, 0, {1}}, {3, 2, 1, {1, 3}}, {4, 3, 1, {1, 3, 1}}, {5, 3, 2, {1, 1, 1}}, {6, 4, 1, {1, 1, 3, 3}}, {7, 4, 4, {1, 3, 5, 13}}, {8, 5, 2, {1, 1, 5, 5, 17}}, {9, 5, 4, {1, 1, 5, 5, 5}}, {10, 5, 7, {1, 1, 7, 11, 19}}, {11, 5, 11, {1, 1, 5, 1, 1}}, {12, 5, 13, {1, 1, 1, 3, 11}}, {13, 5, 14, {1, 3, 5, 5, 31}}, {14, 6, 1, {1, 3, 3, 9, 7, 49}}, {15, 6, 13, {1, 1, 1, 15, 21, 21}}, {16, 6, 16, {1, 3, 1, 13, 27, 49}}, {17, 6, 19, {1, 1, 1, 15, 7, 5}}, {18, 6, 22, {1, 3, 1, 15, 13, 25}}, {19, 6, 25, {1, 1, 5, 5, 19, 61}}, {20, 7, 1, {1, 3, 7, 11, 23, 15, 103}}, {21, 7, 4, {1, 3, 7, 13, 13, 15, 69}}, {22, 7, 7, {1, 1, 3, 13, 7, 35, 63}}, {23, 7, 8, {1, 3, 5, 9, 1, 25, 53}}, {24, 7, 14, {1, 3, 1, 13, 9, 35, 107}}, {25, 7, 19, {1, 3, 1, 5, 27, 61, 31}}, {26, 7, 21, {1, 1, 5, 11, 19, 41, 61}}, {27, 7, 28, {1, 3, 5, 3, 3, 13, 69}}, {28, 7, 31, {1, 1, 7, 13, 1, 19, 1}}, {29, 7, 32, {1, 3, 7, 5, 13, 19, 59}}, {30, 7, 37, {1, 1, 3, 9, 25, 29, 41}}, {31, 7, 41, {1, 3, 5, 13, 23, 1, 55}}, {32, 7, 42, {1, 3, 7, 3, 13, 59, 17}}, {33, 7, 50, {1, 3, 1, 3, 5, 53, 69}}, {34, 7, 55, {1, 1, 5, 5, 23, 33, 13}}, {35, 7, 56, {1, 1, 7, 7, 1, 61, 123}}, {36, 7, 59, {1, 1, 7, 9, 13, 61, 49}}, {37, 7, 62, {1, 3, 3, 5, 3, 55, 33}}, {38, 8, 14, {1, 3, 1, 15, 31, 13, 49, 245}}, {39, 8, 21, {1, 3, 5, 15, 31, 59, 63, 97}}, {40, 8, 22, {1, 3, 1, 11, 11, 11, 77, 249}}, {41, 8, 38, {1, 3, 1, 11, 27, 43, 71, 9}}, {42, 8, 47, {1, 1, 7, 15, 21, 11, 81, 45}}, {43, 8, 49, {1, 3, 7, 3, 25, 31, 65, 79}}, {44, 8, 50, {1, 3, 1, 1, 19, 11, 3, 205}}, {45, 8, 52, {1, 1, 5, 9, 19, 21, 29, 157}}, {46, 8, 56, {1, 3, 7, 11, 1, 33, 89, 185}}, {47, 8, 67, {1, 3, 3, 3, 15, 9, 79, 71}}, {48, 8, 70, {1, 3, 7, 11, 15, 39, 119, 27}}, {49, 8, 84, {1, 1, 3, 1, 11, 31, 97, 225}}, {50, 8, 97, {1, 1, 1, 3, 23, 43, 57, 177}}, {51, 8, 103, {1, 3, 7, 7, 17, 17, 37, 71}}, {52, 8, 115, {1, 3, 1, 5, 27, 63, 123, 213}}, {53, 8, 122, {1, 1, 3, 5, 11, 43, 53, 133}}, {54, 9, 8, {1, 3, 5, 5, 29, 17, 47, 173, 479}}, {55, 9, 13, {1, 3, 3, 11, 3, 1, 109, 9, 69}}, {56, 9, 16, {1, 1, 1, 5, 17, 39, 23, 5, 343}}, {57, 9, 22, {1, 3, 1, 5, 25, 15, 31, 103, 499}}, {58, 9, 25, {1, 1, 1, 11, 11, 17, 63, 105, 183}}, {59, 9, 44, {1, 1, 5, 11, 9, 29, 97, 231, 363}}, {60, 9, 47, {1, 1, 5, 15, 19, 45, 41, 7, 383}}, {61, 9, 52, {1, 3, 7, 7, 31, 19, 83, 137, 221}}, {62, 9, 55, {1, 1, 1, 3, 23, 15, 111, 223, 83}}, {63, 9, 59, {1, 1, 5, 13, 31, 15, 55, 25, 161}}, {64, 9, 62, {1, 1, 3, 13, 25, 47, 39, 87, 257}}, {65, 9, 67, {1, 1, 1, 11, 21, 53, 125, 249, 293}}, {66, 9, 74, {1, 1, 7, 11, 11, 7, 57, 79, 323}}, {67, 9, 81, {1, 1, 5, 5, 17, 13, 81, 3, 131}}, {68, 9, 82, {1, 1, 7, 13, 23, 7, 65, 251, 475}}, {69, 9, 87, {1, 3, 5, 1, 9, 43, 3, 149, 11}}, {70, 9, 91, {1, 1, 3, 13, 31, 13, 13, 255, 487}}, {71, 9, 94, {1, 3, 3, 1, 5, 63, 89, 91, 127}}, {72, 9, 103, {1, 1, 3, 3, 1, 19, 123, 127, 237}}, {73, 9, 104, {1, 1, 5, 7, 23, 31, 37, 243, 289}}, {74, 9, 109, {1, 1, 5, 11, 17, 53, 117, 183, 491}}, {75, 9, 122, {1, 1, 1, 5, 1, 13, 13, 209, 345}}, {76, 9, 124, {1, 1, 3, 15, 1, 57, 115, 7, 33}}, {77, 9, 137, {1, 3, 1, 11, 7, 43, 81, 207, 175}}, {78, 9, 138, {1, 3, 1, 1, 15, 27, 63, 255, 49}}, {79, 9, 143, {1, 3, 5, 3, 27, 61, 105, 171, 305}}, {80, 9, 145, {1, 1, 5, 3, 1, 3, 57, 249, 149}}, {81, 9, 152, {1, 1, 3, 5, 5, 57, 15, 13, 159}}, {82, 9, 157, {1, 1, 1, 11, 7, 11, 105, 141, 225}}, {83, 9, 167, {1, 3, 3, 5, 27, 59, 121, 101, 271}}, {84, 9, 173, {1, 3, 5, 9, 11, 49, 51, 59, 115}}, {85, 9, 176, {1, 1, 7, 1, 23, 45, 125, 71, 419}}, {86, 9, 181, {1, 1, 3, 5, 23, 5, 105, 109, 75}}, {87, 9, 182, {1, 1, 7, 15, 7, 11, 67, 121, 453}}, {88, 9, 185, {1, 3, 7, 3, 9, 13, 31, 27, 449}}, {89, 9, 191, {1, 3, 1, 15, 19, 39, 39, 89, 15}}, {90, 9, 194, {1, 1, 1, 1, 1, 33, 73, 145, 379}}, {91, 9, 199, {1, 3, 1, 15, 15, 43, 29, 13, 483}}, {92, 9, 218, {1, 1, 7, 3, 19, 27, 85, 131, 431}}, {93, 9, 220, {1, 3, 3, 3, 5, 35, 23, 195, 349}}, {94, 9, 227, {1, 3, 3, 7, 9, 27, 39, 59, 297}}, {95, 9, 229, {1, 1, 3, 9, 11, 17, 13, 241, 157}}, {96, 9, 230, {1, 3, 7, 15, 25, 57, 33, 189, 213}}, {97, 9, 234, {1, 1, 7, 1, 9, 55, 73, 83, 217}}, {98, 9, 236, {1, 3, 3, 13, 19, 27, 23, 113, 249}}, {99, 9, 241, {1, 3, 5, 3, 23, 43, 3, 253, 479}}, {100, 9, 244, {1, 1, 5, 5, 11, 5, 45, 117, 217}}, {101, 9, 253, {1, 3, 3, 7, 29, 37, 33, 123, 147}}, {102, 10, 4, {1, 3, 1, 15, 5, 5, 37, 227, 223, 459}}, {103, 10, 13, {1, 1, 7, 5, 5, 39, 63, 255, 135, 487}}, {104, 10, 19, {1, 3, 1, 7, 9, 7, 87, 249, 217, 599}}, {105, 10, 22, {1, 1, 3, 13, 9, 47, 7, 225, 363, 247}}, {106, 10, 50, {1, 3, 7, 13, 19, 13, 9, 67, 9, 737}}, {107, 10, 55, {1, 3, 5, 5, 19, 59, 7, 41, 319, 677}}, {108, 10, 64, {1, 1, 5, 3, 31, 63, 15, 43, 207, 789}}, {109, 10, 69, {1, 1, 7, 9, 13, 39, 3, 47, 497, 169}}, {110, 10, 98, {1, 3, 1, 7, 21, 17, 97, 19, 415, 905}}, {111, 10, 107, {1, 3, 7, 1, 3, 31, 71, 111, 165, 127}}, {112, 10, 115, {1, 1, 5, 11, 1, 61, 83, 119, 203, 847}}, {113, 10, 121, {1, 3, 3, 13, 9, 61, 19, 97, 47, 35}}, {114, 10, 127, {1, 1, 7, 7, 15, 29, 63, 95, 417, 469}}, {115, 10, 134, {1, 3, 1, 9, 25, 9, 71, 57, 213, 385}}, {116, 10, 140, {1, 3, 5, 13, 31, 47, 101, 57, 39, 341}}, {117, 10, 145, {1, 1, 3, 3, 31, 57, 125, 173, 365, 551}}, {118, 10, 152, {1, 3, 7, 1, 13, 57, 67, 157, 451, 707}}, {119, 10, 158, {1, 1, 1, 7, 21, 13, 105, 89, 429, 965}}, {120, 10, 161, {1, 1, 5, 9, 17, 51, 45, 119, 157, 141}}, {121, 10, 171, {1, 3, 7, 7, 13, 45, 91, 9, 129, 741}}, {122, 10, 181, {1, 3, 7, 1, 23, 57, 67, 141, 151, 571}}, {123, 10, 194, {1, 1, 3, 11, 17, 47, 93, 107, 375, 157}}, {124, 10, 199, {1, 3, 3, 5, 11, 21, 43, 51, 169, 915}}, {125, 10, 203, {1, 1, 5, 3, 15, 55, 101, 67, 455, 625}}, {126, 10, 208, {1, 3, 5, 9, 1, 23, 29, 47, 345, 595}}, {127, 10, 227, {1, 3, 7, 7, 5, 49, 29, 155, 323, 589}}, {128, 10, 242, {1, 3, 3, 7, 5, 41, 127, 61, 261, 717}}, {129, 10, 251, {1, 3, 7, 7, 17, 23, 117, 67, 129, 1009}}, {130, 10, 253, {1, 1, 3, 13, 11, 39, 21, 207, 123, 305}}, {131, 10, 265, {1, 1, 3, 9, 29, 3, 95, 47, 231, 73}}, {132, 10, 266, {1, 3, 1, 9, 1, 29, 117, 21, 441, 259}}, {133, 10, 274, {1, 3, 1, 13, 21, 39, 125, 211, 439, 723}}, {134, 10, 283, {1, 1, 7, 3, 17, 63, 115, 89, 49, 773}}, {135, 10, 289, {1, 3, 7, 13, 11, 33, 101, 107, 63, 73}}, {136, 10, 295, {1, 1, 5, 5, 13, 57, 63, 135, 437, 177}}, {137, 10, 301, {1, 1, 3, 7, 27, 63, 93, 47, 417, 483}}, {138, 10, 316, {1, 1, 3, 1, 23, 29, 1, 191, 49, 23}}, {139, 10, 319, {1, 1, 3, 15, 25, 55, 9, 101, 219, 607}}, {140, 10, 324, {1, 3, 1, 7, 7, 19, 51, 251, 393, 307}}, {141, 10, 346, {1, 3, 3, 3, 25, 55, 17, 75, 337, 3}}, {142, 10, 352, {1, 1, 1, 13, 25, 17, 65, 45, 479, 413}}, {143, 10, 361, {1, 1, 7, 7, 27, 49, 99, 161, 213, 727}}, {144, 10, 367, {1, 3, 5, 1, 23, 5, 43, 41, 251, 857}}, {145, 10, 382, {1, 3, 3, 7, 11, 61, 39, 87, 383, 835}}, {146, 10, 395, {1, 1, 3, 15, 13, 7, 29, 7, 505, 923}}, {147, 10, 398, {1, 3, 7, 1, 5, 31, 47, 157, 445, 501}}, {148, 10, 400, {1, 1, 3, 7, 1, 43, 9, 147, 115, 605}}, {149, 10, 412, {1, 3, 3, 13, 5, 1, 119, 211, 455, 1001}}, {150, 10, 419, {1, 1, 3, 5, 13, 19, 3, 243, 75, 843}}, {151, 10, 422, {1, 3, 7, 7, 1, 19, 91, 249, 357, 589}}, {152, 10, 426, {1, 1, 1, 9, 1, 25, 109, 197, 279, 411}}, {153, 10, 428, {1, 3, 1, 15, 23, 57, 59, 135, 191, 75}}, {154, 10, 433, {1, 1, 5, 15, 29, 21, 39, 253, 383, 349}}, {155, 10, 446, {1, 3, 3, 5, 19, 45, 61, 151, 199, 981}}, {156, 10, 454, {1, 3, 5, 13, 9, 61, 107, 141, 141, 1}}, {157, 10, 457, {1, 3, 1, 11, 27, 25, 85, 105, 309, 979}}, {158, 10, 472, {1, 3, 3, 11, 19, 7, 115, 223, 349, 43}}, {159, 10, 493, {1, 1, 7, 9, 21, 39, 123, 21, 275, 927}}, {160, 10, 505, {1, 1, 7, 13, 15, 41, 47, 243, 303, 437}}, {161, 10, 508, {1, 1, 1, 7, 7, 3, 15, 99, 409, 719}}, {162, 11, 2, {1, 3, 3, 15, 27, 49, 113, 123, 113, 67, 469}}, {163, 11, 11, {1, 3, 7, 11, 3, 23, 87, 169, 119, 483, 199}}, {164, 11, 21, {1, 1, 5, 15, 7, 17, 109, 229, 179, 213, 741}}, {165, 11, 22, {1, 1, 5, 13, 11, 17, 25, 135, 403, 557, 1433}}, {166, 11, 35, {1, 3, 1, 1, 1, 61, 67, 215, 189, 945, 1243}}, {167, 11, 49, {1, 1, 7, 13, 17, 33, 9, 221, 429, 217, 1679}}, {168, 11, 50, {1, 1, 3, 11, 27, 3, 15, 93, 93, 865, 1049}}, {169, 11, 56, {1, 3, 7, 7, 25, 41, 121, 35, 373, 379, 1547}}, {170, 11, 61, {1, 3, 3, 9, 11, 35, 45, 205, 241, 9, 59}}, {171, 11, 70, {1, 3, 1, 7, 3, 51, 7, 177, 53, 975, 89}}, {172, 11, 74, {1, 1, 3, 5, 27, 1, 113, 231, 299, 759, 861}}, {173, 11, 79, {1, 3, 3, 15, 25, 29, 5, 255, 139, 891, 2031}}, {174, 11, 84, {1, 3, 1, 1, 13, 9, 109, 193, 419, 95, 17}}, {175, 11, 88, {1, 1, 7, 9, 3, 7, 29, 41, 135, 839, 867}}, {176, 11, 103, {1, 1, 7, 9, 25, 49, 123, 217, 113, 909, 215}}, {177, 11, 104, {1, 1, 7, 3, 23, 15, 43, 133, 217, 327, 901}}, {178, 11, 112, {1, 1, 3, 3, 13, 53, 63, 123, 477, 711, 1387}}, {179, 11, 115, {1, 1, 3, 15, 7, 29, 75, 119, 181, 957, 247}}, {180, 11, 117, {1, 1, 1, 11, 27, 25, 109, 151, 267, 99, 1461}}, {181, 11, 122, {1, 3, 7, 15, 5, 5, 53, 145, 11, 725, 1501}}, {182, 11, 134, {1, 3, 7, 1, 9, 43, 71, 229, 157, 607, 1835}}, {183, 11, 137, {1, 3, 3, 13, 25, 1, 5, 27, 471, 349, 127}}, {184, 11, 146, {1, 1, 1, 1, 23, 37, 9, 221, 269, 897, 1685}}, {185, 11, 148, {1, 1, 3, 3, 31, 29, 51, 19, 311, 553, 1969}}, {186, 11, 157, {1, 3, 7, 5, 5, 55, 17, 39, 475, 671, 1529}}, {187, 11, 158, {1, 1, 7, 1, 1, 35, 47, 27, 437, 395, 1635}}, {188, 11, 162, {1, 1, 7, 3, 13, 23, 43, 135, 327, 139, 389}}, {189, 11, 164, {1, 3, 7, 3, 9, 25, 91, 25, 429, 219, 513}}, {190, 11, 168, {1, 1, 3, 5, 13, 29, 119, 201, 277, 157, 2043}}, {191, 11, 173, {1, 3, 5, 3, 29, 57, 13, 17, 167, 739, 1031}}, {192, 11, 185, {1, 3, 3, 5, 29, 21, 95, 27, 255, 679, 1531}}, {193, 11, 186, {1, 3, 7, 15, 9, 5, 21, 71, 61, 961, 1201}}, {194, 11, 191, {1, 3, 5, 13, 15, 57, 33, 93, 459, 867, 223}}, {195, 11, 193, {1, 1, 1, 15, 17, 43, 127, 191, 67, 177, 1073}}, {196, 11, 199, {1, 1, 1, 15, 23, 7, 21, 199, 75, 293, 1611}}, {197, 11, 213, {1, 3, 7, 13, 15, 39, 21, 149, 65, 741, 319}}, {198, 11, 214, {1, 3, 7, 11, 23, 13, 101, 89, 277, 519, 711}}, {199, 11, 220, {1, 3, 7, 15, 19, 27, 85, 203, 441, 97, 1895}}, {200, 11, 227, {1, 3, 1, 3, 29, 25, 21, 155, 11, 191, 197}}, {201, 11, 236, {1, 1, 7, 5, 27, 11, 81, 101, 457, 675, 1687}}, {202, 11, 242, {1, 3, 1, 5, 25, 5, 65, 193, 41, 567, 781}}, {203, 11, 251, {1, 3, 1, 5, 11, 15, 113, 77, 411, 695, 1111}}, {204, 11, 256, {1, 1, 3, 9, 11, 53, 119, 171, 55, 297, 509}}, {205, 11, 259, {1, 1, 1, 1, 11, 39, 113, 139, 165, 347, 595}}, {206, 11, 265, {1, 3, 7, 11, 9, 17, 101, 13, 81, 325, 1733}}, {207, 11, 266, {1, 3, 1, 1, 21, 43, 115, 9, 113, 907, 645}}, {208, 11, 276, {1, 1, 7, 3, 9, 25, 117, 197, 159, 471, 475}}, {209, 11, 292, {1, 3, 1, 9, 11, 21, 57, 207, 485, 613, 1661}}, {210, 11, 304, {1, 1, 7, 7, 27, 55, 49, 223, 89, 85, 1523}}, {211, 11, 310, {1, 1, 5, 3, 19, 41, 45, 51, 447, 299, 1355}}, {212, 11, 316, {1, 3, 1, 13, 1, 33, 117, 143, 313, 187, 1073}}, {213, 11, 319, {1, 1, 7, 7, 5, 11, 65, 97, 377, 377, 1501}}, {214, 11, 322, {1, 3, 1, 1, 21, 35, 95, 65, 99, 23, 1239}}, {215, 11, 328, {1, 1, 5, 9, 3, 37, 95, 167, 115, 425, 867}}, {216, 11, 334, {1, 3, 3, 13, 1, 37, 27, 189, 81, 679, 773}}, {217, 11, 339, {1, 1, 3, 11, 1, 61, 99, 233, 429, 969, 49}}, {218, 11, 341, {1, 1, 1, 7, 25, 63, 99, 165, 245, 793, 1143}}, {219, 11, 345, {1, 1, 5, 11, 11, 43, 55, 65, 71, 283, 273}}, {220, 11, 346, {1, 1, 5, 5, 9, 3, 101, 251, 355, 379, 1611}}, {221, 11, 362, {1, 1, 1, 15, 21, 63, 85, 99, 49, 749, 1335}}, {222, 11, 367, {1, 1, 5, 13, 27, 9, 121, 43, 255, 715, 289}}, {223, 11, 372, {1, 3, 1, 5, 27, 19, 17, 223, 77, 571, 1415}}, {224, 11, 375, {1, 1, 5, 3, 13, 59, 125, 251, 195, 551, 1737}}, {225, 11, 376, {1, 3, 3, 15, 13, 27, 49, 105, 389, 971, 755}}, {226, 11, 381, {1, 3, 5, 15, 23, 43, 35, 107, 447, 763, 253}}, {227, 11, 385, {1, 3, 5, 11, 21, 3, 17, 39, 497, 407, 611}}, {228, 11, 388, {1, 1, 7, 13, 15, 31, 113, 17, 23, 507, 1995}}, {229, 11, 392, {1, 1, 7, 15, 3, 15, 31, 153, 423, 79, 503}}, {230, 11, 409, {1, 1, 7, 9, 19, 25, 23, 171, 505, 923, 1989}}, {231, 11, 415, {1, 1, 5, 9, 21, 27, 121, 223, 133, 87, 697}}, {232, 11, 416, {1, 1, 5, 5, 9, 19, 107, 99, 319, 765, 1461}}, {233, 11, 421, {1, 1, 3, 3, 19, 25, 3, 101, 171, 729, 187}}, {234, 11, 428, {1, 1, 3, 1, 13, 23, 85, 93, 291, 209, 37}}, {235, 11, 431, {1, 1, 1, 15, 25, 25, 77, 253, 333, 947, 1073}}, {236, 11, 434, {1, 1, 3, 9, 17, 29, 55, 47, 255, 305, 2037}}, {237, 11, 439, {1, 3, 3, 9, 29, 63, 9, 103, 489, 939, 1523}}, {238, 11, 446, {1, 3, 7, 15, 7, 31, 89, 175, 369, 339, 595}}, {239, 11, 451, {1, 3, 7, 13, 25, 5, 71, 207, 251, 367, 665}}, {240, 11, 453, {1, 3, 3, 3, 21, 25, 75, 35, 31, 321, 1603}}, {241, 11, 457, {1, 1, 1, 9, 11, 1, 65, 5, 11, 329, 535}}, {242, 11, 458, {1, 1, 5, 3, 19, 13, 17, 43, 379, 485, 383}}, {243, 11, 471, {1, 3, 5, 13, 13, 9, 85, 147, 489, 787, 1133}}, {244, 11, 475, {1, 3, 1, 1, 5, 51, 37, 129, 195, 297, 1783}}, {245, 11, 478, {1, 1, 3, 15, 19, 57, 59, 181, 455, 697, 2033}}, {246, 11, 484, {1, 3, 7, 1, 27, 9, 65, 145, 325, 189, 201}}, {247, 11, 493, {1, 3, 1, 15, 31, 23, 19, 5, 485, 581, 539}}, {248, 11, 494, {1, 1, 7, 13, 11, 15, 65, 83, 185, 847, 831}}, {249, 11, 499, {1, 3, 5, 7, 7, 55, 73, 15, 303, 511, 1905}}, {250, 11, 502, {1, 3, 5, 9, 7, 21, 45, 15, 397, 385, 597}}, {251, 11, 517, {1, 3, 7, 3, 23, 13, 73, 221, 511, 883, 1265}}, {252, 11, 518, {1, 1, 3, 11, 1, 51, 73, 185, 33, 975, 1441}}, {253, 11, 524, {1, 3, 3, 9, 19, 59, 21, 39, 339, 37, 143}}, {254, 11, 527, {1, 1, 7, 1, 31, 33, 19, 167, 117, 635, 639}}, {255, 11, 555, {1, 1, 1, 3, 5, 13, 59, 83, 355, 349, 1967}}, {256, 11, 560, {1, 1, 1, 5, 19, 3, 53, 133, 97, 863, 983}}, {257, 11, 565, {1, 3, 1, 13, 9, 41, 91, 105, 173, 97, 625}}, {258, 11, 569, {1, 1, 5, 3, 7, 49, 115, 133, 71, 231, 1063}}, {259, 11, 578, {1, 1, 7, 5, 17, 43, 47, 45, 497, 547, 757}}, {260, 11, 580, {1, 3, 5, 15, 21, 61, 123, 191, 249, 31, 631}}, {261, 11, 587, {1, 3, 7, 9, 17, 7, 11, 185, 127, 169, 1951}}, {262, 11, 589, {1, 1, 5, 13, 11, 11, 9, 49, 29, 125, 791}}, {263, 11, 590, {1, 1, 1, 15, 31, 41, 13, 167, 273, 429, 57}}, {264, 11, 601, {1, 3, 5, 3, 27, 7, 35, 209, 65, 265, 1393}}, {265, 11, 607, {1, 3, 1, 13, 31, 19, 53, 143, 135, 9, 1021}}, {266, 11, 611, {1, 1, 7, 13, 31, 5, 115, 153, 143, 957, 623}}, {267, 11, 614, {1, 1, 5, 11, 25, 19, 29, 31, 297, 943, 443}}, {268, 11, 617, {1, 3, 3, 5, 21, 11, 127, 81, 479, 25, 699}}, {269, 11, 618, {1, 1, 3, 11, 25, 31, 97, 19, 195, 781, 705}}, {270, 11, 625, {1, 1, 5, 5, 31, 11, 75, 207, 197, 885, 2037}}, {271, 11, 628, {1, 1, 1, 11, 9, 23, 29, 231, 307, 17, 1497}}, {272, 11, 635, {1, 1, 5, 11, 11, 43, 111, 233, 307, 523, 1259}}, {273, 11, 641, {1, 1, 7, 5, 1, 21, 107, 229, 343, 933, 217}}, {274, 11, 647, {1, 1, 1, 11, 3, 21, 125, 131, 405, 599, 1469}}, {275, 11, 654, {1, 3, 5, 5, 9, 39, 33, 81, 389, 151, 811}}, {276, 11, 659, {1, 1, 7, 7, 7, 1, 59, 223, 265, 529, 2021}}, {277, 11, 662, {1, 3, 1, 3, 9, 23, 85, 181, 47, 265, 49}}, {278, 11, 672, {1, 3, 5, 11, 19, 23, 9, 7, 157, 299, 1983}}, {279, 11, 675, {1, 3, 1, 5, 15, 5, 21, 105, 29, 339, 1041}}, {280, 11, 682, {1, 1, 1, 1, 5, 33, 65, 85, 111, 705, 479}}, {281, 11, 684, {1, 1, 1, 7, 9, 35, 77, 87, 151, 321, 101}}, {282, 11, 689, {1, 1, 5, 7, 17, 1, 51, 197, 175, 811, 1229}}, {283, 11, 695, {1, 3, 3, 15, 23, 37, 85, 185, 239, 543, 731}}, {284, 11, 696, {1, 3, 1, 7, 7, 55, 111, 109, 289, 439, 243}}, {285, 11, 713, {1, 1, 7, 11, 17, 53, 35, 217, 259, 853, 1667}}, {286, 11, 719, {1, 3, 1, 9, 1, 63, 87, 17, 73, 565, 1091}}, {287, 11, 724, {1, 1, 3, 3, 11, 41, 1, 57, 295, 263, 1029}}, {288, 11, 733, {1, 1, 5, 1, 27, 45, 109, 161, 411, 421, 1395}}, {289, 11, 734, {1, 3, 5, 11, 25, 35, 47, 191, 339, 417, 1727}}, {290, 11, 740, {1, 1, 5, 15, 21, 1, 93, 251, 351, 217, 1767}}, {291, 11, 747, {1, 3, 3, 11, 3, 7, 75, 155, 313, 211, 491}}, {292, 11, 749, {1, 3, 3, 5, 11, 9, 101, 161, 453, 913, 1067}}, {293, 11, 752, {1, 1, 3, 1, 15, 45, 127, 141, 163, 727, 1597}}, {294, 11, 755, {1, 3, 3, 7, 1, 33, 63, 73, 73, 341, 1691}}, {295, 11, 762, {1, 3, 5, 13, 15, 39, 53, 235, 77, 99, 949}}, {296, 11, 770, {1, 1, 5, 13, 31, 17, 97, 13, 215, 301, 1927}}, {297, 11, 782, {1, 1, 7, 1, 1, 37, 91, 93, 441, 251, 1131}}, {298, 11, 784, {1, 3, 7, 9, 25, 5, 105, 69, 81, 943, 1459}}, {299, 11, 787, {1, 3, 7, 11, 31, 43, 13, 209, 27, 1017, 501}}, {300, 11, 789, {1, 1, 7, 15, 1, 33, 31, 233, 161, 507, 387}}, {301, 11, 793, {1, 3, 3, 5, 5, 53, 33, 177, 503, 627, 1927}}, {302, 11, 796, {1, 1, 7, 11, 7, 61, 119, 31, 457, 229, 1875}}, {303, 11, 803, {1, 1, 5, 15, 19, 5, 53, 201, 157, 885, 1057}}, {304, 11, 805, {1, 3, 7, 9, 1, 35, 51, 113, 249, 425, 1009}}, {305, 11, 810, {1, 3, 5, 7, 21, 53, 37, 155, 119, 345, 631}}, {306, 11, 815, {1, 3, 5, 7, 15, 31, 109, 69, 503, 595, 1879}}, {307, 11, 824, {1, 3, 3, 1, 25, 35, 65, 131, 403, 705, 503}}, {308, 11, 829, {1, 3, 7, 7, 19, 33, 11, 153, 45, 633, 499}}, {309, 11, 830, {1, 3, 3, 5, 11, 3, 29, 93, 487, 33, 703}}, {310, 11, 832, {1, 1, 3, 15, 21, 53, 107, 179, 387, 927, 1757}}, {311, 11, 841, {1, 1, 3, 7, 21, 45, 51, 147, 175, 317, 361}}, {312, 11, 847, {1, 1, 1, 7, 7, 13, 15, 243, 269, 795, 1965}}, {313, 11, 849, {1, 1, 3, 5, 19, 33, 57, 115, 443, 537, 627}}, {314, 11, 861, {1, 3, 3, 9, 3, 39, 25, 61, 185, 717, 1049}}, {315, 11, 871, {1, 3, 7, 3, 7, 37, 107, 153, 7, 269, 1581}}, {316, 11, 878, {1, 1, 7, 3, 7, 41, 91, 41, 145, 489, 1245}}, {317, 11, 889, {1, 1, 5, 9, 7, 7, 105, 81, 403, 407, 283}}, {318, 11, 892, {1, 1, 7, 9, 27, 55, 29, 77, 193, 963, 949}}, {319, 11, 901, {1, 1, 5, 3, 25, 51, 107, 63, 403, 917, 815}}, {320, 11, 908, {1, 1, 7, 3, 7, 61, 19, 51, 457, 599, 535}}, {321, 11, 920, {1, 3, 7, 1, 23, 51, 105, 153, 239, 215, 1847}}, {322, 11, 923, {1, 1, 3, 5, 27, 23, 79, 49, 495, 45, 1935}}, {323, 11, 942, {1, 1, 1, 11, 11, 47, 55, 133, 495, 999, 1461}}, {324, 11, 949, {1, 1, 3, 15, 27, 51, 93, 17, 355, 763, 1675}}, {325, 11, 950, {1, 3, 1, 3, 1, 3, 79, 119, 499, 17, 995}}, {326, 11, 954, {1, 1, 1, 1, 15, 43, 45, 17, 167, 973, 799}}, {327, 11, 961, {1, 1, 1, 3, 27, 49, 89, 29, 483, 913, 2023}}, {328, 11, 968, {1, 1, 3, 3, 5, 11, 75, 7, 41, 851, 611}}, {329, 11, 971, {1, 3, 1, 3, 7, 57, 39, 123, 257, 283, 507}}, {330, 11, 973, {1, 3, 3, 11, 27, 23, 113, 229, 187, 299, 133}}, {331, 11, 979, {1, 1, 3, 13, 9, 63, 101, 77, 451, 169, 337}}, {332, 11, 982, {1, 3, 7, 3, 3, 59, 45, 195, 229, 415, 409}}, {333, 11, 986, {1, 3, 5, 3, 11, 19, 71, 93, 43, 857, 369}}, {334, 11, 998, {1, 3, 7, 9, 19, 33, 115, 19, 241, 703, 247}}, {335, 11, 1001, {1, 3, 5, 11, 5, 35, 21, 155, 463, 1005, 1073}}, {336, 11, 1010, {1, 3, 7, 3, 25, 15, 109, 83, 93, 69, 1189}}, {337, 11, 1012, {1, 3, 5, 7, 5, 21, 93, 133, 135, 167, 903}}, {338, 12, 41, {1, 1, 7, 7, 3, 59, 121, 161, 285, 815, 1769, 3705}}, {339, 12, 52, {1, 3, 1, 1, 3, 47, 103, 171, 381, 609, 185, 373}}, {340, 12, 61, {1, 3, 3, 15, 23, 33, 107, 131, 441, 445, 689, 2059}}, {341, 12, 62, {1, 3, 3, 11, 7, 53, 101, 167, 435, 803, 1255, 3781}}, {342, 12, 76, {1, 1, 5, 11, 15, 59, 41, 19, 135, 835, 1263, 505}}, {343, 12, 104, {1, 1, 7, 11, 21, 49, 23, 219, 127, 961, 1065, 385}}, {344, 12, 117, {1, 3, 5, 15, 7, 47, 117, 217, 45, 731, 1639, 733}}, {345, 12, 131, {1, 1, 7, 11, 27, 57, 91, 87, 81, 35, 1269, 1007}}, {346, 12, 143, {1, 1, 3, 11, 15, 37, 53, 219, 193, 937, 1899, 3733}}, {347, 12, 145, {1, 3, 5, 3, 13, 11, 27, 19, 199, 393, 965, 2195}}, {348, 12, 157, {1, 3, 1, 3, 5, 1, 37, 173, 413, 1023, 553, 409}}, {349, 12, 167, {1, 3, 1, 7, 15, 29, 123, 95, 255, 373, 1799, 3841}}, {350, 12, 171, {1, 3, 5, 13, 21, 57, 51, 17, 511, 195, 1157, 1831}}, {351, 12, 176, {1, 1, 1, 15, 29, 19, 7, 73, 295, 519, 587, 3523}}, {352, 12, 181, {1, 1, 5, 13, 13, 35, 115, 191, 123, 535, 717, 1661}}, {353, 12, 194, {1, 3, 3, 5, 23, 21, 47, 251, 379, 921, 1119, 297}}, {354, 12, 217, {1, 3, 3, 9, 29, 53, 121, 201, 135, 193, 523, 2943}}, {355, 12, 236, {1, 1, 1, 7, 29, 45, 125, 9, 99, 867, 425, 601}}, {356, 12, 239, {1, 3, 1, 9, 13, 15, 67, 181, 109, 293, 1305, 3079}}, {357, 12, 262, {1, 3, 3, 9, 5, 35, 15, 209, 305, 87, 767, 2795}}, {358, 12, 283, {1, 3, 3, 11, 27, 57, 113, 123, 179, 643, 149, 523}}, {359, 12, 286, {1, 1, 3, 15, 11, 17, 67, 223, 63, 657, 335, 3309}}, {360, 12, 307, {1, 1, 1, 9, 25, 29, 109, 159, 39, 513, 571, 1761}}, {361, 12, 313, {1, 1, 3, 1, 5, 63, 75, 19, 455, 601, 123, 691}}, {362, 12, 319, {1, 1, 1, 3, 21, 5, 45, 169, 377, 513, 1951, 2565}}, {363, 12, 348, {1, 1, 3, 11, 3, 33, 119, 69, 253, 907, 805, 1449}}, {364, 12, 352, {1, 1, 5, 13, 31, 15, 17, 7, 499, 61, 687, 1867}}, {365, 12, 357, {1, 3, 7, 11, 17, 33, 73, 77, 299, 243, 641, 2345}}, {366, 12, 391, {1, 1, 7, 11, 9, 35, 31, 235, 359, 647, 379, 1161}}, {367, 12, 398, {1, 3, 3, 15, 31, 25, 5, 67, 33, 45, 437, 4067}}, {368, 12, 400, {1, 1, 3, 11, 7, 17, 37, 87, 333, 253, 1517, 2921}}, {369, 12, 412, {1, 1, 7, 15, 7, 15, 107, 189, 153, 769, 1521, 3427}}, {370, 12, 415, {1, 3, 5, 13, 5, 61, 113, 37, 293, 393, 113, 43}}, {371, 12, 422, {1, 1, 1, 15, 29, 43, 107, 31, 167, 147, 301, 1021}}, {372, 12, 440, {1, 1, 1, 13, 3, 1, 35, 93, 195, 181, 2027, 1491}}, {373, 12, 460, {1, 3, 3, 3, 13, 33, 77, 199, 153, 221, 1699, 3671}}, {374, 12, 465, {1, 3, 5, 13, 7, 49, 123, 155, 495, 681, 819, 809}}, {375, 12, 468, {1, 3, 5, 15, 27, 61, 117, 189, 183, 887, 617, 4053}}, {376, 12, 515, {1, 1, 1, 7, 31, 59, 125, 235, 389, 369, 447, 1039}}, {377, 12, 536, {1, 3, 5, 1, 5, 39, 115, 89, 249, 377, 431, 3747}}, {378, 12, 539, {1, 1, 1, 5, 7, 47, 59, 157, 77, 445, 699, 3439}}, {379, 12, 551, {1, 1, 3, 5, 11, 21, 19, 75, 11, 599, 1575, 735}}, {380, 12, 558, {1, 3, 5, 3, 19, 13, 41, 69, 199, 143, 1761, 3215}}, {381, 12, 563, {1, 3, 5, 7, 19, 43, 25, 41, 41, 11, 1647, 2783}}, {382, 12, 570, {1, 3, 1, 9, 19, 45, 111, 97, 405, 399, 457, 3219}}, {383, 12, 595, {1, 1, 3, 1, 23, 15, 65, 121, 59, 985, 829, 2259}}, {384, 12, 598, {1, 1, 3, 7, 17, 13, 107, 229, 75, 551, 1299, 2363}}, {385, 12, 617, {1, 1, 5, 5, 21, 57, 23, 199, 509, 139, 2007, 3875}}, {386, 12, 647, {1, 3, 1, 11, 19, 53, 15, 229, 215, 741, 695, 823}}, {387, 12, 654, {1, 3, 7, 1, 29, 3, 17, 163, 417, 559, 549, 319}}, {388, 12, 678, {1, 3, 1, 13, 17, 9, 47, 133, 365, 7, 1937, 1071}}, {389, 12, 713, {1, 3, 5, 7, 19, 37, 55, 163, 301, 249, 689, 2327}}, {390, 12, 738, {1, 3, 5, 13, 11, 23, 61, 205, 257, 377, 615, 1457}}, {391, 12, 747, {1, 3, 5, 1, 23, 37, 13, 75, 331, 495, 579, 3367}}, {392, 12, 750, {1, 1, 1, 9, 1, 23, 49, 129, 475, 543, 883, 2531}}, {393, 12, 757, {1, 3, 1, 5, 23, 59, 51, 35, 343, 695, 219, 369}}, {394, 12, 772, {1, 3, 3, 1, 27, 17, 63, 97, 71, 507, 1929, 613}}, {395, 12, 803, {1, 1, 5, 1, 21, 31, 11, 109, 247, 409, 1817, 2173}}, {396, 12, 810, {1, 1, 3, 15, 23, 9, 7, 209, 301, 23, 147, 1691}}, {397, 12, 812, {1, 1, 7, 5, 5, 19, 37, 229, 249, 277, 1115, 2309}}, {398, 12, 850, {1, 1, 1, 5, 5, 63, 5, 249, 285, 431, 343, 2467}}, {399, 12, 862, {1, 1, 1, 11, 7, 45, 35, 75, 505, 537, 29, 2919}}, {400, 12, 906, {1, 3, 5, 15, 11, 39, 15, 63, 263, 9, 199, 445}}, {401, 12, 908, {1, 3, 3, 3, 27, 63, 53, 171, 227, 63, 1049, 827}}, {402, 12, 929, {1, 1, 3, 13, 7, 11, 115, 183, 179, 937, 1785, 381}}, {403, 12, 930, {1, 3, 1, 11, 13, 15, 107, 81, 53, 295, 1785, 3757}}, {404, 12, 954, {1, 3, 3, 13, 11, 5, 109, 243, 3, 505, 323, 1373}}, {405, 12, 964, {1, 3, 3, 11, 21, 51, 17, 177, 381, 937, 1263, 3889}}, {406, 12, 982, {1, 3, 5, 9, 27, 25, 85, 193, 143, 573, 1189, 2995}}, {407, 12, 985, {1, 3, 5, 11, 13, 9, 81, 21, 159, 953, 91, 1751}}, {408, 12, 991, {1, 1, 3, 3, 27, 61, 11, 253, 391, 333, 1105, 635}}, {409, 12, 992, {1, 3, 3, 15, 9, 57, 95, 81, 419, 735, 251, 1141}}, {410, 12, 1067, {1, 1, 5, 9, 31, 39, 59, 13, 319, 807, 1241, 2433}}, {411, 12, 1070, {1, 3, 3, 5, 27, 13, 107, 141, 423, 937, 2027, 3233}}, {412, 12, 1096, {1, 3, 3, 9, 9, 25, 125, 23, 443, 835, 1245, 847}}, {413, 12, 1099, {1, 1, 7, 15, 17, 17, 83, 107, 411, 285, 847, 1571}}, {414, 12, 1116, {1, 1, 3, 13, 29, 61, 37, 81, 349, 727, 1453, 1957}}, {415, 12, 1143, {1, 3, 7, 11, 31, 13, 59, 77, 273, 591, 1265, 1533}}, {416, 12, 1165, {1, 1, 7, 7, 13, 17, 25, 25, 187, 329, 347, 1473}}, {417, 12, 1178, {1, 3, 7, 7, 5, 51, 37, 99, 221, 153, 503, 2583}}, {418, 12, 1184, {1, 3, 1, 13, 19, 27, 11, 69, 181, 479, 1183, 3229}}, {419, 12, 1202, {1, 3, 3, 13, 23, 21, 103, 147, 323, 909, 947, 315}}, {420, 12, 1213, {1, 3, 1, 3, 23, 1, 31, 59, 93, 513, 45, 2271}}, {421, 12, 1221, {1, 3, 5, 1, 7, 43, 109, 59, 231, 41, 1515, 2385}}, {422, 12, 1240, {1, 3, 1, 5, 31, 57, 49, 223, 283, 1013, 11, 701}}, {423, 12, 1246, {1, 1, 5, 1, 19, 53, 55, 31, 31, 299, 495, 693}}, {424, 12, 1252, {1, 3, 3, 9, 5, 33, 77, 253, 427, 791, 731, 1019}}, {425, 12, 1255, {1, 3, 7, 11, 1, 9, 119, 203, 53, 877, 1707, 3499}}, {426, 12, 1267, {1, 1, 3, 7, 13, 39, 55, 159, 423, 113, 1653, 3455}}, {427, 12, 1293, {1, 1, 3, 5, 21, 47, 51, 59, 55, 411, 931, 251}}, {428, 12, 1301, {1, 3, 7, 3, 31, 25, 81, 115, 405, 239, 741, 455}}, {429, 12, 1305, {1, 1, 5, 1, 31, 3, 101, 83, 479, 491, 1779, 2225}}, {430, 12, 1332, {1, 3, 3, 3, 9, 37, 107, 161, 203, 503, 767, 3435}}, {431, 12, 1349, {1, 3, 7, 9, 1, 27, 61, 119, 233, 39, 1375, 4089}}, {432, 12, 1384, {1, 1, 5, 9, 1, 31, 45, 51, 369, 587, 383, 2813}}, {433, 12, 1392, {1, 3, 7, 5, 31, 7, 49, 119, 487, 591, 1627, 53}}, {434, 12, 1402, {1, 1, 7, 1, 9, 47, 1, 223, 369, 711, 1603, 1917}}, {435, 12, 1413, {1, 3, 5, 3, 21, 37, 111, 17, 483, 739, 1193, 2775}}, {436, 12, 1417, {1, 3, 3, 7, 17, 11, 51, 117, 455, 191, 1493, 3821}}, {437, 12, 1423, {1, 1, 5, 9, 23, 39, 99, 181, 343, 485, 99, 1931}}, {438, 12, 1451, {1, 3, 1, 7, 29, 49, 31, 71, 489, 527, 1763, 2909}}, {439, 12, 1480, {1, 1, 5, 11, 5, 5, 73, 189, 321, 57, 1191, 3685}}, {440, 12, 1491, {1, 1, 5, 15, 13, 45, 125, 207, 371, 415, 315, 983}}, {441, 12, 1503, {1, 3, 3, 5, 25, 59, 33, 31, 239, 919, 1859, 2709}}, {442, 12, 1504, {1, 3, 5, 13, 27, 61, 23, 115, 61, 413, 1275, 3559}}, {443, 12, 1513, {1, 3, 7, 15, 5, 59, 101, 81, 47, 967, 809, 3189}}, {444, 12, 1538, {1, 1, 5, 11, 31, 15, 39, 25, 173, 505, 809, 2677}}, {445, 12, 1544, {1, 1, 5, 9, 19, 13, 95, 89, 511, 127, 1395, 2935}}, {446, 12, 1547, {1, 1, 5, 5, 31, 45, 9, 57, 91, 303, 1295, 3215}}, {447, 12, 1555, {1, 3, 3, 3, 19, 15, 113, 187, 217, 489, 1285, 1803}}, {448, 12, 1574, {1, 1, 3, 1, 13, 29, 57, 139, 255, 197, 537, 2183}}, {449, 12, 1603, {1, 3, 1, 15, 11, 7, 53, 255, 467, 9, 757, 3167}}, {450, 12, 1615, {1, 3, 3, 15, 21, 13, 9, 189, 359, 323, 49, 333}}, {451, 12, 1618, {1, 3, 7, 11, 7, 37, 21, 119, 401, 157, 1659, 1069}}, {452, 12, 1629, {1, 1, 5, 7, 17, 33, 115, 229, 149, 151, 2027, 279}}, {453, 12, 1634, {1, 1, 5, 15, 5, 49, 77, 155, 383, 385, 1985, 945}}, {454, 12, 1636, {1, 3, 7, 3, 7, 55, 85, 41, 357, 527, 1715, 1619}}, {455, 12, 1639, {1, 1, 3, 1, 21, 45, 115, 21, 199, 967, 1581, 3807}}, {456, 12, 1657, {1, 1, 3, 7, 21, 39, 117, 191, 169, 73, 413, 3417}}, {457, 12, 1667, {1, 1, 1, 13, 1, 31, 57, 195, 231, 321, 367, 1027}}, {458, 12, 1681, {1, 3, 7, 3, 11, 29, 47, 161, 71, 419, 1721, 437}}, {459, 12, 1697, {1, 1, 7, 3, 11, 9, 43, 65, 157, 1, 1851, 823}}, {460, 12, 1704, {1, 1, 1, 5, 21, 15, 31, 101, 293, 299, 127, 1321}}, {461, 12, 1709, {1, 1, 7, 1, 27, 1, 11, 229, 241, 705, 43, 1475}}, {462, 12, 1722, {1, 3, 7, 1, 5, 15, 73, 183, 193, 55, 1345, 49}}, {463, 12, 1730, {1, 3, 3, 3, 19, 3, 55, 21, 169, 663, 1675, 137}}, {464, 12, 1732, {1, 1, 1, 13, 7, 21, 69, 67, 373, 965, 1273, 2279}}, {465, 12, 1802, {1, 1, 7, 7, 21, 23, 17, 43, 341, 845, 465, 3355}}, {466, 12, 1804, {1, 3, 5, 5, 25, 5, 81, 101, 233, 139, 359, 2057}}, {467, 12, 1815, {1, 1, 3, 11, 15, 39, 55, 3, 471, 765, 1143, 3941}}, {468, 12, 1826, {1, 1, 7, 15, 9, 57, 81, 79, 215, 433, 333, 3855}}, {469, 12, 1832, {1, 1, 5, 5, 19, 45, 83, 31, 209, 363, 701, 1303}}, {470, 12, 1843, {1, 3, 7, 5, 1, 13, 55, 163, 435, 807, 287, 2031}}, {471, 12, 1849, {1, 3, 3, 7, 3, 3, 17, 197, 39, 169, 489, 1769}}, {472, 12, 1863, {1, 1, 3, 5, 29, 43, 87, 161, 289, 339, 1233, 2353}}, {473, 12, 1905, {1, 3, 3, 9, 21, 9, 77, 1, 453, 167, 1643, 2227}}, {474, 12, 1928, {1, 1, 7, 1, 15, 7, 67, 33, 193, 241, 1031, 2339}}, {475, 12, 1933, {1, 3, 1, 11, 1, 63, 45, 65, 265, 661, 849, 1979}}, {476, 12, 1939, {1, 3, 1, 13, 19, 49, 3, 11, 159, 213, 659, 2839}}, {477, 12, 1976, {1, 3, 5, 11, 9, 29, 27, 227, 253, 449, 1403, 3427}}, {478, 12, 1996, {1, 1, 3, 1, 7, 3, 77, 143, 277, 779, 1499, 475}}, {479, 12, 2013, {1, 1, 1, 5, 11, 23, 87, 131, 393, 849, 193, 3189}}, {480, 12, 2014, {1, 3, 5, 11, 3, 3, 89, 9, 449, 243, 1501, 1739}}, {481, 12, 2020, {1, 3, 1, 9, 29, 29, 113, 15, 65, 611, 135, 3687}}, {482, 13, 13, {1, 1, 1, 9, 21, 19, 39, 151, 395, 501, 1339, 959, 2725}}, {483, 13, 19, {1, 3, 7, 1, 7, 35, 45, 33, 119, 225, 1631, 1695, 1459}}, {484, 13, 26, {1, 1, 1, 3, 25, 55, 37, 79, 167, 907, 1075, 271, 4059}}, {485, 13, 41, {1, 3, 5, 13, 5, 13, 53, 165, 437, 67, 1705, 3177, 8095}}, {486, 13, 50, {1, 3, 3, 13, 27, 57, 95, 55, 443, 245, 1945, 1725, 1929}}, {487, 13, 55, {1, 3, 1, 9, 5, 33, 109, 35, 99, 827, 341, 2401, 2411}}, {488, 13, 69, {1, 1, 5, 9, 7, 33, 43, 39, 87, 799, 635, 3481, 7159}}, {489, 13, 70, {1, 3, 1, 1, 31, 15, 45, 27, 337, 113, 987, 2065, 2529}}, {490, 13, 79, {1, 1, 5, 9, 5, 15, 105, 123, 479, 289, 1609, 2177, 4629}}, {491, 13, 82, {1, 3, 5, 11, 31, 47, 97, 87, 385, 195, 1041, 651, 3271}}, {492, 13, 87, {1, 1, 3, 7, 17, 3, 101, 55, 87, 629, 1687, 1387, 2745}}, {493, 13, 93, {1, 3, 5, 5, 7, 21, 9, 237, 313, 549, 1107, 117, 6183}}, {494, 13, 94, {1, 1, 3, 9, 9, 5, 55, 201, 487, 851, 1103, 2993, 4055}}, {495, 13, 97, {1, 1, 5, 9, 31, 19, 59, 7, 363, 381, 1167, 2057, 5715}}, {496, 13, 100, {1, 3, 3, 15, 23, 63, 19, 227, 387, 827, 487, 1049, 7471}}, {497, 13, 112, {1, 3, 1, 5, 23, 25, 61, 245, 363, 863, 963, 3583, 6475}}, {498, 13, 121, {1, 1, 5, 1, 5, 27, 81, 85, 275, 49, 235, 3291, 1195}}, {499, 13, 134, {1, 1, 5, 7, 23, 53, 85, 107, 511, 779, 1265, 1093, 7859}}, {500, 13, 138, {1, 3, 3, 1, 9, 21, 75, 219, 59, 485, 1739, 3845, 1109}}, {501, 13, 148, {1, 3, 5, 1, 13, 41, 19, 143, 293, 391, 2023, 1791, 4399}}, {502, 13, 151, {1, 3, 7, 15, 21, 13, 21, 195, 215, 413, 523, 2099, 2341}}, {503, 13, 157, {1, 1, 1, 3, 29, 51, 47, 57, 135, 575, 943, 1673, 541}}, {504, 13, 161, {1, 3, 5, 1, 9, 13, 113, 175, 447, 115, 657, 4077, 5973}}, {505, 13, 179, {1, 1, 1, 11, 17, 41, 37, 95, 297, 579, 911, 2207, 2387}}, {506, 13, 181, {1, 3, 5, 3, 23, 11, 23, 231, 93, 667, 711, 1563, 7961}}, {507, 13, 188, {1, 1, 7, 3, 17, 59, 13, 181, 141, 991, 1817, 457, 1711}}, {508, 13, 196, {1, 3, 3, 5, 31, 59, 81, 205, 245, 537, 1049, 997, 1815}}, {509, 13, 203, {1, 3, 7, 5, 17, 13, 9, 79, 17, 185, 5, 2211, 6263}}, {510, 13, 206, {1, 3, 7, 13, 7, 53, 61, 145, 13, 285, 1203, 947, 2933}}, {511, 13, 223, {1, 1, 7, 3, 31, 19, 69, 217, 47, 441, 1893, 673, 4451}}, {512, 13, 224, {1, 1, 1, 1, 25, 9, 23, 225, 385, 629, 603, 3747, 4241}}, {513, 13, 227, {1, 3, 1, 9, 5, 37, 31, 237, 431, 79, 1521, 459, 2523}}, {514, 13, 230, {1, 3, 7, 3, 9, 43, 105, 179, 5, 225, 799, 1777, 4893}}, {515, 13, 239, {1, 1, 3, 1, 29, 45, 29, 159, 267, 247, 455, 847, 3909}}, {516, 13, 241, {1, 1, 3, 7, 25, 21, 121, 57, 467, 275, 719, 1521, 7319}}, {517, 13, 248, {1, 3, 1, 3, 11, 35, 119, 123, 81, 979, 1187, 3623, 4293}}, {518, 13, 253, {1, 1, 1, 7, 15, 25, 121, 235, 25, 487, 873, 1787, 1977}}, {519, 13, 268, {1, 1, 1, 11, 3, 7, 17, 135, 345, 353, 383, 4011, 2573}}, {520, 13, 274, {1, 3, 7, 15, 27, 13, 97, 123, 65, 675, 951, 1285, 6559}}, {521, 13, 283, {1, 3, 7, 3, 7, 1, 71, 19, 325, 765, 337, 1197, 2697}}, {522, 13, 286, {1, 3, 5, 1, 31, 37, 11, 71, 169, 283, 83, 3801, 7083}}, {523, 13, 289, {1, 1, 3, 15, 17, 29, 83, 65, 275, 679, 1749, 4007, 7749}}, {524, 13, 301, {1, 1, 3, 1, 21, 11, 41, 95, 237, 361, 1819, 2783, 2383}}, {525, 13, 302, {1, 3, 7, 11, 29, 57, 111, 187, 465, 145, 605, 1987, 8109}}, {526, 13, 316, {1, 1, 3, 3, 19, 15, 55, 83, 357, 1001, 643, 1517, 6529}}, {527, 13, 319, {1, 3, 1, 5, 29, 35, 73, 23, 77, 619, 1523, 1725, 8145}}, {528, 13, 324, {1, 1, 5, 5, 19, 23, 7, 197, 449, 337, 717, 2921, 315}}, {529, 13, 331, {1, 3, 5, 9, 7, 63, 117, 97, 97, 813, 1925, 2817, 1579}}, {530, 13, 333, {1, 1, 1, 11, 31, 7, 25, 235, 231, 133, 1007, 1371, 1553}}, {531, 13, 345, {1, 1, 7, 5, 19, 7, 47, 171, 267, 243, 1331, 567, 6033}}, {532, 13, 351, {1, 1, 5, 1, 7, 49, 55, 89, 109, 735, 1455, 3193, 6239}}, {533, 13, 358, {1, 1, 1, 7, 1, 61, 9, 103, 3, 929, 1481, 2927, 2957}}, {534, 13, 375, {1, 1, 5, 13, 17, 21, 75, 49, 255, 1019, 1161, 2133, 1177}}, {535, 13, 379, {1, 3, 1, 3, 13, 15, 41, 247, 211, 409, 1163, 523, 2635}}, {536, 13, 381, {1, 3, 7, 7, 21, 59, 91, 149, 479, 391, 681, 2311, 6249}}, {537, 13, 386, {1, 1, 5, 11, 27, 53, 21, 211, 197, 815, 719, 1605, 255}}, {538, 13, 403, {1, 1, 3, 3, 9, 33, 59, 3, 323, 1, 101, 1135, 8105}}, {539, 13, 405, {1, 3, 3, 1, 29, 5, 17, 141, 51, 991, 841, 327, 3859}}, {540, 13, 419, {1, 3, 1, 5, 11, 19, 23, 89, 175, 173, 165, 2881, 1881}}, {541, 13, 426, {1, 1, 1, 15, 13, 51, 87, 39, 495, 611, 1341, 1531, 7029}}, {542, 13, 428, {1, 1, 3, 11, 13, 55, 75, 185, 57, 61, 1917, 2051, 5965}}, {543, 13, 439, {1, 1, 5, 5, 7, 53, 11, 217, 213, 933, 921, 3607, 5175}}, {544, 13, 440, {1, 3, 3, 5, 17, 53, 103, 251, 369, 781, 1319, 3717, 4439}}, {545, 13, 446, {1, 3, 5, 13, 1, 39, 25, 235, 321, 773, 251, 3111, 6397}}, {546, 13, 451, {1, 1, 7, 3, 31, 5, 25, 29, 325, 385, 1313, 127, 4705}}, {547, 13, 454, {1, 1, 5, 15, 15, 27, 15, 85, 239, 243, 1633, 3473, 2621}}, {548, 13, 458, {1, 3, 3, 3, 9, 19, 113, 13, 137, 165, 25, 2957, 7549}}, {549, 13, 465, {1, 3, 1, 3, 11, 21, 3, 97, 417, 183, 1205, 1437, 247}}, {550, 13, 468, {1, 1, 7, 3, 17, 21, 125, 55, 67, 387, 385, 2323, 887}}, {551, 13, 472, {1, 3, 5, 5, 29, 11, 103, 223, 233, 641, 133, 415, 1297}}, {552, 13, 475, {1, 3, 3, 11, 1, 9, 5, 189, 235, 1007, 1363, 3985, 889}}, {553, 13, 477, {1, 3, 7, 9, 23, 19, 19, 183, 269, 403, 1643, 3559, 5189}}, {554, 13, 496, {1, 3, 7, 3, 29, 45, 17, 69, 475, 149, 1291, 2689, 7625}}, {555, 13, 502, {1, 3, 7, 3, 27, 37, 41, 73, 253, 1001, 431, 1111, 7887}}, {556, 13, 508, {1, 1, 7, 5, 3, 7, 87, 143, 289, 495, 631, 3011, 6151}}, {557, 13, 517, {1, 1, 1, 13, 5, 45, 17, 167, 23, 975, 801, 1975, 6833}}, {558, 13, 521, {1, 3, 1, 11, 7, 21, 39, 23, 213, 429, 1301, 2059, 197}}, {559, 13, 527, {1, 3, 3, 15, 3, 57, 121, 133, 29, 711, 1961, 2497, 189}}, {560, 13, 530, {1, 1, 3, 5, 11, 55, 115, 137, 233, 673, 985, 2849, 5911}}, {561, 13, 532, {1, 1, 7, 15, 29, 45, 1, 241, 329, 323, 925, 2821, 3331}}, {562, 13, 542, {1, 1, 5, 7, 13, 31, 81, 105, 199, 145, 195, 1365, 5119}}, {563, 13, 552, {1, 3, 7, 11, 3, 55, 11, 31, 117, 343, 1265, 1837, 2451}}, {564, 13, 555, {1, 1, 3, 7, 29, 57, 61, 179, 429, 591, 177, 1945, 2159}}, {565, 13, 560, {1, 3, 5, 11, 23, 49, 101, 137, 339, 323, 1035, 1749, 7737}}, {566, 13, 566, {1, 3, 1, 13, 21, 35, 55, 79, 19, 269, 1055, 2651, 7083}}, {567, 13, 575, {1, 3, 3, 11, 9, 9, 95, 167, 437, 361, 1185, 4083, 603}}, {568, 13, 577, {1, 1, 1, 7, 31, 61, 77, 65, 489, 657, 691, 2423, 4147}}, {569, 13, 589, {1, 3, 5, 7, 21, 37, 87, 191, 311, 453, 2013, 829, 2619}}, {570, 13, 590, {1, 1, 5, 9, 17, 47, 35, 101, 5, 813, 1157, 1279, 7365}}, {571, 13, 602, {1, 1, 5, 3, 11, 35, 113, 199, 369, 721, 901, 1471, 7801}}, {572, 13, 607, {1, 3, 1, 5, 9, 61, 83, 157, 391, 739, 1957, 2123, 4341}}, {573, 13, 608, {1, 3, 5, 11, 19, 19, 111, 225, 383, 219, 997, 717, 7505}}, {574, 13, 611, {1, 3, 1, 11, 13, 63, 35, 127, 209, 831, 501, 3017, 3507}}, {575, 13, 613, {1, 3, 7, 9, 29, 7, 11, 163, 81, 563, 1445, 3215, 6377}}, {576, 13, 625, {1, 3, 7, 11, 25, 3, 39, 195, 491, 45, 839, 4021, 4899}}, {577, 13, 644, {1, 3, 7, 15, 13, 5, 67, 143, 117, 505, 1281, 3679, 5695}}, {578, 13, 651, {1, 3, 7, 9, 9, 19, 21, 221, 147, 763, 683, 2211, 589}}, {579, 13, 654, {1, 1, 3, 5, 21, 47, 53, 109, 299, 807, 1153, 1209, 7961}}, {580, 13, 656, {1, 3, 7, 11, 9, 31, 45, 43, 505, 647, 1127, 2681, 4917}}, {581, 13, 662, {1, 1, 5, 15, 31, 41, 63, 113, 399, 727, 673, 2587, 5259}}, {582, 13, 668, {1, 1, 1, 13, 17, 53, 35, 99, 57, 243, 1447, 1919, 2831}}, {583, 13, 681, {1, 3, 7, 11, 23, 51, 13, 9, 49, 449, 997, 3073, 4407}}, {584, 13, 682, {1, 3, 5, 7, 23, 33, 89, 41, 415, 53, 697, 1113, 1489}}, {585, 13, 689, {1, 1, 3, 7, 1, 13, 29, 13, 255, 749, 77, 3463, 1761}}, {586, 13, 696, {1, 3, 3, 7, 13, 15, 93, 191, 309, 869, 739, 1041, 3053}}, {587, 13, 699, {1, 3, 5, 13, 5, 19, 109, 211, 347, 839, 893, 2947, 7735}}, {588, 13, 707, {1, 3, 1, 13, 27, 3, 119, 157, 485, 99, 1703, 3895, 573}}, {589, 13, 709, {1, 3, 7, 11, 1, 23, 123, 105, 31, 359, 275, 1775, 3685}}, {590, 13, 714, {1, 3, 3, 5, 27, 11, 125, 3, 413, 199, 2043, 2895, 2945}}, {591, 13, 716, {1, 3, 3, 3, 15, 49, 121, 159, 233, 543, 193, 4007, 321}}, {592, 13, 719, {1, 1, 3, 5, 9, 47, 87, 1, 51, 1011, 1595, 2239, 6467}}, {593, 13, 727, {1, 3, 7, 9, 1, 33, 87, 137, 469, 749, 1413, 805, 6817}}, {594, 13, 734, {1, 3, 1, 13, 19, 45, 95, 227, 29, 677, 1275, 3395, 4451}}, {595, 13, 738, {1, 1, 7, 5, 7, 63, 33, 71, 443, 561, 1311, 3069, 6943}}, {596, 13, 743, {1, 1, 1, 13, 9, 37, 23, 69, 13, 415, 1479, 1197, 861}}, {597, 13, 747, {1, 3, 3, 13, 27, 21, 13, 233, 105, 777, 345, 2443, 1105}}, {598, 13, 757, {1, 1, 7, 11, 23, 13, 21, 147, 221, 549, 73, 2729, 6279}}, {599, 13, 769, {1, 1, 7, 7, 25, 27, 15, 45, 227, 39, 75, 1191, 3563}}, {600, 13, 770, {1, 1, 5, 7, 13, 49, 99, 167, 227, 13, 353, 1047, 8075}}, {601, 13, 776, {1, 1, 3, 13, 31, 9, 27, 7, 461, 737, 1559, 3243, 53}}, {602, 13, 790, {1, 3, 1, 1, 21, 41, 97, 165, 171, 821, 587, 2137, 2293}}, {603, 13, 799, {1, 3, 1, 11, 17, 41, 29, 187, 87, 599, 1467, 1395, 5931}}, {604, 13, 805, {1, 1, 1, 9, 9, 49, 89, 205, 409, 453, 61, 1923, 1257}}, {605, 13, 809, {1, 3, 7, 3, 9, 43, 89, 143, 431, 83, 1243, 1795, 3599}}, {606, 13, 812, {1, 3, 5, 13, 3, 25, 59, 219, 43, 223, 797, 2651, 6015}}, {607, 13, 820, {1, 1, 5, 15, 7, 55, 65, 207, 213, 311, 1287, 1269, 6467}}, {608, 13, 827, {1, 3, 7, 11, 21, 57, 31, 183, 351, 857, 911, 1683, 7155}}, {609, 13, 829, {1, 3, 5, 11, 27, 1, 21, 47, 387, 383, 1593, 115, 3805}}, {610, 13, 835, {1, 3, 1, 1, 13, 23, 87, 173, 181, 619, 1653, 3931, 6073}}, {611, 13, 841, {1, 1, 7, 5, 17, 43, 37, 61, 307, 621, 1785, 55, 115}}, {612, 13, 844, {1, 3, 7, 15, 25, 61, 123, 15, 237, 671, 1473, 467, 1907}}, {613, 13, 856, {1, 1, 7, 5, 29, 57, 75, 237, 85, 699, 159, 3577, 4771}}, {614, 13, 859, {1, 1, 1, 11, 25, 19, 51, 1, 147, 31, 895, 2617, 625}}, {615, 13, 862, {1, 3, 7, 5, 29, 15, 115, 175, 395, 391, 1141, 1827, 1181}}, {616, 13, 865, {1, 3, 5, 7, 17, 7, 11, 193, 89, 243, 561, 3787, 4551}}, {617, 13, 885, {1, 3, 1, 11, 7, 57, 7, 125, 403, 947, 1261, 409, 8083}}, {618, 13, 890, {1, 1, 5, 13, 21, 63, 115, 233, 231, 921, 1747, 3635, 2519}}, {619, 13, 905, {1, 1, 5, 11, 3, 27, 15, 91, 505, 591, 1451, 3881, 2997}}, {620, 13, 916, {1, 1, 3, 11, 21, 9, 109, 153, 317, 533, 593, 3967, 2797}}, {621, 13, 925, {1, 3, 3, 13, 9, 57, 121, 245, 219, 867, 967, 791, 7095}}, {622, 13, 935, {1, 1, 1, 9, 29, 21, 99, 35, 375, 959, 329, 4087, 7171}}, {623, 13, 939, {1, 1, 1, 9, 11, 17, 17, 97, 89, 135, 631, 3809, 3253}}, {624, 13, 942, {1, 1, 1, 15, 21, 51, 91, 249, 459, 801, 757, 2353, 2033}}, {625, 13, 949, {1, 3, 5, 9, 23, 29, 77, 53, 399, 767, 1817, 2171, 1629}}, {626, 13, 953, {1, 1, 3, 5, 29, 5, 43, 121, 17, 859, 1479, 3785, 6641}}, {627, 13, 956, {1, 1, 3, 7, 7, 61, 45, 109, 371, 833, 91, 153, 4553}}, {628, 13, 961, {1, 1, 3, 11, 7, 55, 81, 123, 389, 139, 1933, 891, 1789}}, {629, 13, 968, {1, 3, 7, 15, 25, 17, 93, 165, 503, 717, 1553, 1475, 1627}}, {630, 13, 976, {1, 1, 1, 13, 13, 63, 13, 225, 357, 571, 33, 4073, 3795}}, {631, 13, 988, {1, 1, 3, 11, 1, 31, 107, 145, 407, 961, 501, 2987, 103}}, {632, 13, 995, {1, 1, 7, 1, 23, 63, 49, 193, 173, 281, 25, 2465, 5927}}, {633, 13, 997, {1, 1, 7, 1, 1, 1, 85, 77, 273, 693, 349, 1239, 4503}}, {634, 13, 1007, {1, 1, 5, 11, 7, 61, 9, 121, 25, 357, 1443, 405, 7827}}, {635, 13, 1015, {1, 1, 7, 13, 11, 53, 11, 207, 145, 211, 1703, 1081, 2117}}, {636, 13, 1016, {1, 1, 3, 11, 27, 23, 19, 9, 297, 279, 1481, 2273, 6387}}, {637, 13, 1027, {1, 3, 3, 5, 15, 45, 3, 41, 305, 87, 1815, 3461, 5349}}, {638, 13, 1036, {1, 3, 3, 13, 9, 37, 79, 125, 259, 561, 1087, 4091, 793}}, {639, 13, 1039, {1, 3, 5, 7, 31, 55, 7, 145, 347, 929, 589, 2783, 5905}}, {640, 13, 1041, {1, 1, 7, 15, 3, 25, 1, 181, 13, 243, 653, 2235, 7445}}, {641, 13, 1048, {1, 3, 5, 5, 17, 53, 65, 7, 33, 583, 1363, 1313, 2319}}, {642, 13, 1053, {1, 3, 3, 7, 27, 47, 97, 201, 187, 321, 63, 1515, 7917}}, {643, 13, 1054, {1, 1, 3, 5, 23, 9, 3, 165, 61, 19, 1789, 3783, 3037}}, {644, 13, 1058, {1, 3, 1, 13, 15, 43, 125, 191, 67, 273, 1551, 2227, 5253}}, {645, 13, 1075, {1, 1, 1, 13, 25, 53, 107, 33, 299, 249, 1475, 2233, 907}}, {646, 13, 1082, {1, 3, 5, 1, 23, 37, 85, 17, 207, 643, 665, 2933, 5199}}, {647, 13, 1090, {1, 1, 7, 7, 25, 57, 59, 41, 15, 751, 751, 1749, 7053}}, {648, 13, 1109, {1, 3, 3, 1, 13, 25, 127, 93, 281, 613, 875, 2223, 6345}}, {649, 13, 1110, {1, 1, 5, 3, 29, 55, 79, 249, 43, 317, 533, 995, 1991}}, {650, 13, 1119, {1, 3, 3, 15, 17, 49, 79, 31, 193, 233, 1437, 2615, 819}}, {651, 13, 1126, {1, 1, 5, 15, 25, 3, 123, 145, 377, 9, 455, 1191, 3953}}, {652, 13, 1130, {1, 3, 5, 3, 15, 19, 41, 231, 81, 393, 3, 19, 2409}}, {653, 13, 1135, {1, 1, 3, 1, 27, 43, 113, 179, 7, 853, 947, 2731, 297}}, {654, 13, 1137, {1, 1, 1, 11, 29, 39, 53, 191, 443, 689, 529, 3329, 7431}}, {655, 13, 1140, {1, 3, 7, 5, 3, 29, 19, 67, 441, 113, 949, 2769, 4169}}, {656, 13, 1149, {1, 3, 5, 11, 11, 55, 85, 169, 215, 815, 803, 2345, 3967}}, {657, 13, 1156, {1, 1, 7, 9, 5, 45, 111, 5, 419, 375, 303, 1725, 4489}}, {658, 13, 1159, {1, 3, 5, 15, 29, 43, 79, 19, 23, 417, 381, 541, 4923}}, {659, 13, 1160, {1, 1, 3, 15, 3, 31, 117, 39, 117, 305, 1227, 1223, 143}}, {660, 13, 1165, {1, 1, 5, 9, 5, 47, 87, 239, 181, 353, 1561, 3313, 1921}}, {661, 13, 1173, {1, 3, 3, 1, 3, 15, 53, 221, 441, 987, 1997, 2529, 8059}}, {662, 13, 1178, {1, 1, 7, 11, 15, 57, 111, 139, 137, 883, 1881, 2823, 5661}}, {663, 13, 1183, {1, 3, 5, 5, 21, 11, 5, 13, 27, 973, 587, 1331, 1373}}, {664, 13, 1184, {1, 1, 7, 11, 29, 51, 93, 29, 217, 221, 55, 2477, 1979}}, {665, 13, 1189, {1, 3, 3, 13, 3, 11, 49, 75, 379, 371, 1441, 793, 7633}}, {666, 13, 1194, {1, 1, 1, 13, 19, 45, 89, 249, 91, 649, 1695, 915, 5619}}, {667, 13, 1211, {1, 3, 1, 7, 7, 29, 1, 77, 313, 895, 519, 771, 295}}, {668, 13, 1214, {1, 3, 1, 15, 5, 3, 1, 57, 331, 109, 485, 2853, 6831}}, {669, 13, 1216, {1, 1, 1, 15, 17, 3, 35, 99, 245, 971, 839, 2509, 2803}}, {670, 13, 1225, {1, 3, 3, 3, 9, 37, 57, 251, 325, 317, 529, 1313, 6379}}, {671, 13, 1231, {1, 1, 1, 15, 25, 59, 1, 119, 95, 15, 795, 2375, 6463}}, {672, 13, 1239, {1, 3, 1, 5, 1, 49, 117, 21, 47, 179, 863, 85, 1669}}, {673, 13, 1243, {1, 3, 7, 3, 9, 37, 19, 221, 455, 973, 571, 1427, 817}}, {674, 13, 1246, {1, 1, 1, 15, 17, 9, 67, 213, 127, 887, 1299, 2913, 7451}}, {675, 13, 1249, {1, 3, 1, 13, 27, 27, 41, 43, 171, 623, 691, 391, 4885}}, {676, 13, 1259, {1, 3, 1, 13, 17, 17, 123, 239, 143, 227, 1151, 519, 6543}}, {677, 13, 1273, {1, 3, 7, 5, 7, 63, 97, 39, 101, 555, 1057, 381, 7891}}, {678, 13, 1274, {1, 3, 5, 1, 3, 27, 85, 129, 161, 875, 1945, 3541, 695}}, {679, 13, 1281, {1, 3, 3, 5, 21, 59, 25, 183, 35, 25, 987, 1459, 181}}, {680, 13, 1287, {1, 3, 5, 13, 1, 15, 127, 237, 349, 337, 1491, 2383, 7811}}, {681, 13, 1294, {1, 3, 5, 5, 31, 5, 109, 51, 409, 733, 1395, 3207, 6049}}, {682, 13, 1296, {1, 1, 5, 7, 13, 35, 113, 25, 263, 389, 299, 2521, 1783}}, {683, 13, 1305, {1, 3, 7, 11, 15, 47, 97, 73, 55, 75, 113, 2695, 1023}}, {684, 13, 1306, {1, 3, 1, 1, 3, 13, 69, 211, 289, 483, 1335, 787, 677}}, {685, 13, 1318, {1, 1, 3, 3, 17, 7, 37, 77, 505, 137, 1113, 345, 2975}}, {686, 13, 1332, {1, 1, 1, 13, 3, 11, 95, 199, 453, 109, 479, 3725, 239}}, {687, 13, 1335, {1, 1, 7, 15, 19, 53, 3, 145, 359, 863, 347, 3833, 3043}}, {688, 13, 1336, {1, 1, 7, 15, 25, 63, 127, 129, 125, 195, 155, 2211, 8153}}, {689, 13, 1341, {1, 1, 7, 13, 9, 49, 121, 115, 73, 119, 1851, 727, 47}}, {690, 13, 1342, {1, 3, 3, 13, 13, 11, 71, 7, 45, 591, 133, 2407, 5563}}, {691, 13, 1362, {1, 1, 1, 13, 23, 29, 87, 89, 501, 71, 1759, 1119, 687}}, {692, 13, 1364, {1, 1, 7, 7, 13, 7, 13, 183, 53, 951, 1877, 3991, 6771}}, {693, 13, 1368, {1, 3, 7, 11, 7, 1, 27, 47, 61, 21, 919, 961, 1091}}, {694, 13, 1378, {1, 3, 5, 5, 1, 27, 1, 5, 63, 157, 1297, 1049, 5893}}, {695, 13, 1387, {1, 3, 7, 9, 19, 33, 17, 133, 425, 797, 1721, 153, 119}}, {696, 13, 1389, {1, 3, 3, 7, 13, 37, 1, 215, 509, 1003, 61, 2353, 7511}}, {697, 13, 1397, {1, 1, 7, 1, 29, 19, 31, 79, 199, 555, 1209, 1603, 6089}}, {698, 13, 1401, {1, 3, 1, 1, 5, 31, 111, 127, 333, 429, 1863, 3925, 5411}}, {699, 13, 1408, {1, 1, 7, 5, 5, 5, 123, 191, 47, 993, 269, 4051, 2111}}, {700, 13, 1418, {1, 1, 5, 15, 1, 9, 87, 5, 47, 463, 865, 1813, 7357}}, {701, 13, 1425, {1, 3, 1, 3, 23, 63, 123, 83, 511, 777, 63, 1285, 4537}}, {702, 13, 1426, {1, 3, 3, 7, 27, 25, 31, 65, 441, 529, 1815, 1893, 323}}, {703, 13, 1431, {1, 3, 7, 5, 11, 19, 7, 5, 397, 811, 755, 2883, 4217}}, {704, 13, 1435, {1, 3, 1, 13, 9, 21, 13, 7, 271, 539, 1769, 3243, 5325}}, {705, 13, 1441, {1, 1, 7, 1, 31, 13, 47, 131, 181, 457, 1559, 2663, 6653}}, {706, 13, 1444, {1, 3, 3, 7, 29, 55, 25, 203, 419, 91, 437, 1159, 5691}}, {707, 13, 1462, {1, 1, 3, 13, 29, 19, 71, 217, 337, 329, 501, 939, 2205}}, {708, 13, 1471, {1, 1, 3, 1, 1, 27, 17, 201, 97, 285, 1269, 4043, 2207}}, {709, 13, 1474, {1, 1, 1, 1, 3, 41, 13, 199, 141, 129, 1515, 3129, 5969}}, {710, 13, 1483, {1, 3, 3, 9, 3, 17, 119, 41, 271, 933, 877, 701, 2197}}, {711, 13, 1485, {1, 1, 1, 7, 15, 47, 3, 195, 115, 821, 725, 843, 6071}}, {712, 13, 1494, {1, 3, 5, 15, 17, 33, 85, 65, 297, 571, 1123, 2743, 5727}}, {713, 13, 1497, {1, 1, 5, 11, 27, 15, 37, 235, 415, 293, 1439, 2739, 4171}}, {714, 13, 1516, {1, 3, 7, 7, 1, 55, 71, 35, 307, 11, 401, 1881, 933}}, {715, 13, 1522, {1, 3, 1, 11, 21, 37, 3, 177, 119, 339, 559, 3991, 3437}}, {716, 13, 1534, {1, 3, 3, 9, 17, 17, 97, 119, 301, 169, 157, 3267, 2261}}, {717, 13, 1543, {1, 3, 3, 9, 29, 3, 111, 101, 355, 869, 375, 2609, 7377}}, {718, 13, 1552, {1, 3, 5, 9, 7, 21, 123, 99, 343, 693, 1927, 1605, 4923}}, {719, 13, 1557, {1, 1, 3, 5, 13, 31, 99, 17, 75, 385, 1539, 1553, 7077}}, {720, 13, 1558, {1, 3, 3, 5, 31, 35, 107, 11, 407, 1019, 1317, 3593, 7203}}, {721, 13, 1567, {1, 3, 3, 13, 17, 33, 99, 245, 401, 957, 157, 1949, 1571}}, {722, 13, 1568, {1, 3, 1, 11, 27, 15, 11, 109, 429, 307, 1911, 2701, 861}}, {723, 13, 1574, {1, 1, 5, 13, 13, 35, 55, 255, 311, 957, 1803, 2673, 5195}}, {724, 13, 1592, {1, 1, 1, 11, 19, 3, 89, 37, 211, 783, 1355, 3567, 7135}}, {725, 13, 1605, {1, 1, 5, 5, 21, 49, 79, 17, 509, 331, 183, 3831, 855}}, {726, 13, 1606, {1, 3, 7, 5, 29, 19, 85, 109, 105, 523, 845, 3385, 7477}}, {727, 13, 1610, {1, 1, 1, 7, 25, 17, 125, 131, 53, 757, 253, 2989, 2939}}, {728, 13, 1617, {1, 3, 3, 9, 19, 23, 105, 39, 351, 677, 211, 401, 8103}}, {729, 13, 1623, {1, 3, 5, 1, 5, 11, 17, 3, 405, 469, 1569, 2865, 3133}}, {730, 13, 1630, {1, 1, 3, 13, 15, 5, 117, 179, 139, 145, 477, 1137, 2537}}, {731, 13, 1634, {1, 1, 7, 9, 5, 21, 9, 93, 211, 963, 1207, 3343, 4911}}, {732, 13, 1640, {1, 1, 1, 9, 13, 43, 17, 53, 81, 793, 1571, 2523, 3683}}, {733, 13, 1643, {1, 3, 3, 13, 25, 21, 5, 59, 489, 987, 1941, 171, 6009}}, {734, 13, 1648, {1, 3, 3, 7, 1, 39, 89, 171, 403, 467, 1767, 3423, 2791}}, {735, 13, 1651, {1, 1, 3, 9, 19, 49, 91, 125, 163, 1013, 89, 2849, 6785}}, {736, 13, 1653, {1, 1, 5, 9, 9, 11, 15, 241, 43, 297, 1719, 1541, 1821}}, {737, 13, 1670, {1, 3, 7, 15, 29, 23, 103, 239, 191, 33, 1043, 3649, 6579}}, {738, 13, 1676, {1, 3, 3, 9, 21, 51, 123, 55, 223, 645, 1463, 4021, 5891}}, {739, 13, 1684, {1, 1, 5, 7, 3, 41, 27, 235, 391, 303, 2021, 3187, 7607}}, {740, 13, 1687, {1, 1, 1, 9, 5, 49, 49, 29, 377, 251, 1887, 1017, 1301}}, {741, 13, 1691, {1, 1, 3, 3, 13, 41, 27, 47, 223, 23, 517, 3227, 6731}}, {742, 13, 1693, {1, 1, 7, 1, 31, 25, 47, 9, 511, 623, 2047, 1263, 1511}}, {743, 13, 1698, {1, 1, 3, 15, 15, 23, 53, 1, 261, 595, 85, 241, 7047}}, {744, 13, 1709, {1, 3, 3, 11, 17, 5, 81, 73, 149, 781, 2035, 3163, 4247}}, {745, 13, 1715, {1, 3, 7, 7, 29, 59, 49, 79, 397, 901, 1105, 2191, 6277}}, {746, 13, 1722, {1, 3, 3, 11, 13, 27, 25, 173, 107, 73, 1265, 585, 5251}}, {747, 13, 1732, {1, 1, 7, 15, 29, 23, 73, 229, 235, 887, 1469, 4073, 2591}}, {748, 13, 1735, {1, 1, 3, 9, 17, 15, 83, 173, 207, 879, 1701, 1509, 11}}, {749, 13, 1747, {1, 1, 3, 5, 5, 37, 65, 161, 39, 421, 1153, 2007, 5355}}, {750, 13, 1749, {1, 1, 7, 11, 23, 37, 5, 11, 9, 499, 17, 157, 5747}}, {751, 13, 1754, {1, 3, 7, 13, 25, 9, 49, 7, 39, 945, 1349, 1759, 1441}}, {752, 13, 1777, {1, 1, 5, 3, 21, 15, 113, 81, 265, 837, 333, 3625, 6133}}, {753, 13, 1784, {1, 3, 1, 11, 13, 27, 73, 109, 297, 327, 299, 3253, 6957}}, {754, 13, 1790, {1, 1, 3, 13, 19, 39, 123, 73, 65, 5, 1061, 2187, 5055}}, {755, 13, 1795, {1, 1, 3, 1, 11, 31, 21, 115, 453, 857, 711, 495, 549}}, {756, 13, 1801, {1, 3, 7, 7, 15, 29, 79, 103, 47, 713, 1735, 3121, 6321}}, {757, 13, 1802, {1, 1, 5, 5, 29, 9, 97, 33, 471, 705, 329, 1501, 1349}}, {758, 13, 1812, {1, 3, 3, 1, 21, 9, 111, 209, 71, 47, 491, 2143, 1797}}, {759, 13, 1828, {1, 3, 3, 3, 11, 39, 21, 135, 445, 259, 607, 3811, 5449}}, {760, 13, 1831, {1, 1, 7, 9, 11, 25, 113, 251, 395, 317, 317, 91, 1979}}, {761, 13, 1837, {1, 3, 1, 9, 3, 21, 103, 133, 389, 943, 1235, 1749, 7063}}, {762, 13, 1838, {1, 1, 3, 7, 1, 11, 5, 15, 497, 477, 479, 3079, 6969}}, {763, 13, 1840, {1, 1, 3, 3, 15, 39, 105, 131, 475, 465, 181, 865, 3813}}, {764, 13, 1845, {1, 1, 7, 9, 19, 63, 123, 131, 415, 525, 457, 2471, 3135}}, {765, 13, 1863, {1, 3, 7, 15, 25, 35, 123, 45, 341, 805, 485, 4049, 7065}}, {766, 13, 1864, {1, 1, 1, 5, 29, 9, 47, 227, 51, 867, 1873, 1593, 2271}}, {767, 13, 1867, {1, 1, 7, 15, 31, 9, 71, 117, 285, 711, 837, 1435, 6275}}, {768, 13, 1870, {1, 3, 1, 1, 5, 19, 79, 25, 301, 415, 1871, 645, 3251}}, {769, 13, 1877, {1, 3, 1, 3, 17, 51, 99, 185, 447, 43, 523, 219, 429}}, {770, 13, 1881, {1, 3, 1, 13, 29, 13, 51, 93, 7, 995, 757, 3017, 6865}}, {771, 13, 1884, {1, 1, 3, 15, 7, 25, 75, 17, 155, 981, 1231, 1229, 1995}}, {772, 13, 1903, {1, 3, 5, 3, 27, 45, 71, 73, 225, 763, 377, 1139, 2863}}, {773, 13, 1917, {1, 1, 3, 1, 1, 39, 69, 113, 29, 371, 1051, 793, 3749}}, {774, 13, 1918, {1, 1, 3, 13, 23, 61, 27, 183, 307, 431, 1345, 2757, 4031}}, {775, 13, 1922, {1, 3, 7, 5, 5, 59, 117, 197, 303, 721, 877, 723, 1601}}, {776, 13, 1924, {1, 3, 5, 1, 27, 33, 99, 237, 485, 711, 665, 3077, 5105}}, {777, 13, 1928, {1, 1, 3, 1, 13, 9, 103, 201, 23, 951, 2029, 165, 2093}}, {778, 13, 1931, {1, 3, 5, 13, 5, 29, 55, 85, 221, 677, 611, 3613, 4567}}, {779, 13, 1951, {1, 1, 1, 1, 7, 61, 9, 233, 261, 561, 953, 4023, 2443}}, {780, 13, 1952, {1, 3, 3, 13, 1, 17, 103, 71, 223, 213, 833, 1747, 6999}}, {781, 13, 1957, {1, 3, 5, 15, 25, 53, 57, 187, 25, 695, 1207, 4089, 2877}}, {782, 13, 1958, {1, 1, 7, 1, 7, 31, 87, 129, 493, 519, 1555, 1155, 4637}}, {783, 13, 1964, {1, 1, 1, 15, 21, 17, 23, 29, 19, 255, 927, 1791, 3093}}, {784, 13, 1967, {1, 1, 3, 9, 17, 33, 95, 129, 175, 461, 287, 2633, 2325}}, {785, 13, 1970, {1, 3, 5, 7, 23, 19, 63, 209, 249, 583, 1373, 2039, 2225}}, {786, 13, 1972, {1, 3, 3, 5, 5, 19, 79, 241, 459, 355, 1455, 3313, 3639}}, {787, 13, 1994, {1, 1, 7, 9, 21, 41, 97, 119, 129, 769, 1541, 3495, 7741}}, {788, 13, 2002, {1, 1, 7, 11, 9, 29, 35, 255, 141, 937, 1763, 41, 1393}}, {789, 13, 2007, {1, 3, 7, 1, 13, 51, 61, 157, 177, 847, 1829, 3539, 285}}, {790, 13, 2008, {1, 1, 1, 15, 21, 13, 9, 55, 397, 19, 1495, 1255, 7235}}, {791, 13, 2023, {1, 1, 7, 7, 25, 37, 53, 237, 319, 197, 269, 1205, 1485}}, {792, 13, 2030, {1, 1, 5, 15, 23, 17, 35, 247, 323, 807, 233, 3681, 4407}}, {793, 13, 2035, {1, 1, 3, 7, 9, 59, 85, 105, 493, 763, 1639, 391, 1451}}, {794, 13, 2038, {1, 3, 3, 9, 15, 33, 5, 253, 129, 625, 1527, 2793, 6057}}, {795, 13, 2042, {1, 3, 1, 1, 7, 47, 21, 161, 235, 83, 397, 3563, 5953}}, {796, 13, 2047, {1, 3, 7, 11, 3, 41, 25, 117, 375, 779, 1297, 3715, 8117}}, {797, 13, 2051, {1, 1, 3, 7, 31, 19, 103, 173, 475, 189, 2035, 2921, 1107}}, {798, 13, 2058, {1, 1, 7, 3, 25, 7, 93, 255, 307, 113, 1893, 2233, 6919}}, {799, 13, 2060, {1, 3, 5, 15, 9, 57, 79, 143, 165, 5, 1389, 193, 693}}, {800, 13, 2071, {1, 3, 5, 1, 29, 45, 91, 49, 189, 461, 439, 1283, 7835}}, {801, 13, 2084, {1, 1, 3, 13, 11, 61, 41, 231, 373, 695, 395, 915, 5393}}, {802, 13, 2087, {1, 3, 7, 11, 5, 51, 67, 53, 483, 95, 1943, 247, 5653}}, {803, 13, 2099, {1, 3, 7, 5, 5, 57, 45, 235, 137, 793, 1069, 1661, 1557}}, {804, 13, 2108, {1, 3, 5, 3, 25, 55, 103, 177, 81, 861, 1151, 143, 7655}}, {805, 13, 2111, {1, 1, 3, 1, 21, 41, 67, 131, 253, 431, 1269, 3181, 3429}}, {806, 13, 2120, {1, 3, 1, 1, 21, 7, 77, 221, 257, 663, 71, 2949, 2481}}, {807, 13, 2128, {1, 3, 5, 3, 3, 23, 45, 107, 299, 739, 1013, 3, 3165}}, {808, 13, 2138, {1, 1, 5, 1, 3, 37, 109, 37, 243, 983, 1221, 1691, 3869}}, {809, 13, 2143, {1, 1, 5, 5, 31, 7, 5, 193, 397, 867, 1495, 3435, 7441}}, {810, 13, 2144, {1, 1, 1, 1, 17, 59, 97, 233, 389, 597, 1013, 1631, 483}}, {811, 13, 2153, {1, 1, 1, 11, 7, 41, 107, 53, 111, 125, 1513, 1921, 7647}}, {812, 13, 2156, {1, 3, 3, 3, 31, 29, 117, 3, 365, 971, 1139, 2123, 5913}}, {813, 13, 2162, {1, 1, 1, 13, 23, 3, 1, 167, 475, 639, 1811, 3841, 3081}}, {814, 13, 2167, {1, 1, 5, 3, 5, 47, 65, 123, 275, 783, 95, 119, 7591}}, {815, 13, 2178, {1, 3, 1, 15, 13, 33, 93, 237, 467, 431, 705, 4013, 4035}}, {816, 13, 2183, {1, 3, 5, 1, 19, 7, 101, 231, 155, 737, 1381, 3343, 2051}}, {817, 13, 2202, {1, 1, 5, 9, 15, 49, 45, 163, 433, 765, 2031, 201, 2589}}, {818, 13, 2211, {1, 3, 7, 9, 19, 41, 31, 89, 93, 623, 105, 745, 4409}}, {819, 13, 2214, {1, 1, 5, 1, 11, 45, 127, 85, 389, 439, 829, 477, 7965}}, {820, 13, 2223, {1, 3, 3, 15, 13, 41, 1, 207, 435, 585, 311, 1725, 2737}}, {821, 13, 2225, {1, 3, 3, 3, 13, 49, 21, 31, 197, 799, 1411, 2959, 7133}}, {822, 13, 2232, {1, 3, 1, 3, 7, 43, 9, 141, 133, 579, 1059, 93, 957}}, {823, 13, 2237, {1, 3, 7, 1, 15, 51, 23, 213, 381, 851, 699, 2261, 3419}}, {824, 13, 2257, {1, 3, 5, 9, 25, 35, 67, 141, 35, 409, 1423, 365, 1645}}, {825, 13, 2260, {1, 3, 3, 11, 15, 33, 27, 181, 93, 87, 1761, 3511, 1353}}, {826, 13, 2267, {1, 3, 5, 3, 25, 63, 111, 137, 321, 819, 705, 1547, 7271}}, {827, 13, 2274, {1, 3, 1, 1, 5, 57, 99, 59, 411, 757, 1371, 3953, 3695}}, {828, 13, 2276, {1, 3, 5, 11, 11, 21, 25, 147, 239, 455, 709, 953, 7175}}, {829, 13, 2285, {1, 3, 3, 15, 5, 53, 91, 205, 341, 63, 723, 1565, 7135}}, {830, 13, 2288, {1, 1, 7, 15, 11, 21, 99, 79, 63, 593, 2007, 3629, 5271}}, {831, 13, 2293, {1, 3, 3, 1, 9, 21, 45, 175, 453, 435, 1855, 2649, 6959}}, {832, 13, 2294, {1, 1, 3, 15, 15, 33, 121, 121, 251, 431, 1127, 3305, 4199}}, {833, 13, 2297, {1, 1, 1, 9, 31, 15, 71, 29, 345, 391, 1159, 2809, 345}}, {834, 13, 2303, {1, 3, 7, 1, 23, 29, 95, 151, 327, 727, 647, 1623, 2971}}, {835, 13, 2308, {1, 1, 7, 7, 9, 29, 79, 91, 127, 909, 1293, 1315, 5315}}, {836, 13, 2311, {1, 1, 5, 11, 13, 37, 89, 73, 149, 477, 1909, 3343, 525}}, {837, 13, 2318, {1, 3, 5, 7, 5, 59, 55, 255, 223, 459, 2027, 237, 4205}}, {838, 13, 2323, {1, 1, 1, 7, 27, 11, 95, 65, 325, 835, 907, 3801, 3787}}, {839, 13, 2332, {1, 1, 1, 11, 27, 33, 99, 175, 51, 913, 331, 1851, 4133}}, {840, 13, 2341, {1, 3, 5, 5, 13, 37, 31, 99, 273, 409, 1827, 3845, 5491}}, {841, 13, 2345, {1, 1, 3, 7, 23, 19, 107, 85, 283, 523, 509, 451, 421}}, {842, 13, 2348, {1, 3, 5, 7, 13, 9, 51, 81, 87, 619, 61, 2803, 5271}}, {843, 13, 2354, {1, 1, 1, 15, 9, 45, 35, 219, 401, 271, 953, 649, 6847}}, {844, 13, 2368, {1, 1, 7, 11, 9, 45, 17, 219, 169, 837, 1483, 1605, 2901}}, {845, 13, 2377, {1, 1, 7, 7, 21, 43, 37, 33, 291, 359, 71, 2899, 7037}}, {846, 13, 2380, {1, 3, 3, 13, 31, 53, 37, 15, 149, 949, 551, 3445, 5455}}, {847, 13, 2383, {1, 3, 1, 5, 19, 45, 81, 223, 193, 439, 2047, 3879, 789}}, {848, 13, 2388, {1, 1, 7, 3, 11, 63, 35, 61, 255, 563, 459, 2991, 3359}}, {849, 13, 2395, {1, 1, 5, 9, 13, 49, 47, 185, 239, 221, 1533, 3635, 2045}}, {850, 13, 2397, {1, 3, 7, 3, 25, 37, 127, 223, 51, 357, 483, 3837, 6873}}, {851, 13, 2401, {1, 1, 7, 9, 31, 37, 113, 31, 387, 833, 1243, 1543, 5535}}, {852, 13, 2411, {1, 3, 1, 9, 23, 59, 119, 221, 73, 185, 2007, 2885, 2563}}, {853, 13, 2413, {1, 1, 1, 13, 7, 33, 53, 179, 67, 185, 1541, 1807, 4659}}, {854, 13, 2419, {1, 3, 1, 11, 31, 37, 23, 215, 269, 357, 207, 645, 4219}}, {855, 13, 2435, {1, 3, 3, 13, 19, 27, 107, 55, 91, 71, 1695, 1815, 89}}, {856, 13, 2442, {1, 1, 3, 15, 3, 19, 35, 247, 49, 529, 1523, 3317, 6151}}, {857, 13, 2455, {1, 1, 7, 7, 23, 25, 107, 139, 483, 503, 1277, 243, 7879}}, {858, 13, 2472, {1, 3, 3, 13, 3, 15, 11, 197, 135, 839, 985, 275, 5527}}, {859, 13, 2478, {1, 3, 5, 3, 25, 47, 95, 21, 113, 307, 1001, 3065, 295}}, {860, 13, 2490, {1, 1, 3, 9, 19, 19, 99, 213, 363, 449, 735, 2851, 2521}}, {861, 13, 2507, {1, 1, 3, 9, 5, 49, 63, 61, 157, 857, 497, 2801, 6987}}, {862, 13, 2509, {1, 1, 1, 9, 1, 41, 109, 119, 499, 939, 867, 3675, 8023}}, {863, 13, 2517, {1, 3, 1, 1, 13, 33, 109, 123, 289, 3, 1271, 2773, 4265}}, {864, 13, 2524, {1, 3, 1, 11, 9, 57, 83, 221, 95, 43, 1189, 457, 7133}}, {865, 13, 2528, {1, 1, 7, 3, 11, 49, 33, 219, 229, 289, 685, 3359, 4495}}, {866, 13, 2531, {1, 3, 1, 3, 19, 43, 67, 193, 41, 771, 407, 81, 3891}}, {867, 13, 2538, {1, 1, 7, 11, 5, 29, 51, 175, 297, 539, 1, 2245, 6439}}, {868, 13, 2545, {1, 3, 7, 15, 21, 33, 117, 183, 511, 489, 1283, 3281, 5979}}, {869, 13, 2546, {1, 3, 7, 5, 9, 3, 125, 147, 359, 549, 369, 3049, 2405}}, {870, 13, 2555, {1, 3, 5, 7, 19, 5, 65, 97, 483, 377, 1523, 1457, 2995}}, {871, 13, 2557, {1, 1, 5, 1, 11, 21, 41, 113, 277, 131, 1475, 1043, 2367}}, {872, 13, 2564, {1, 3, 3, 1, 15, 17, 101, 69, 443, 865, 817, 1421, 5231}}, {873, 13, 2573, {1, 1, 3, 3, 3, 55, 95, 99, 75, 195, 1929, 3931, 5855}}, {874, 13, 2579, {1, 3, 1, 3, 19, 23, 93, 213, 241, 551, 1307, 585, 7729}}, {875, 13, 2592, {1, 3, 1, 11, 23, 15, 53, 249, 467, 519, 95, 741, 409}}, {876, 13, 2598, {1, 1, 1, 15, 29, 37, 43, 203, 233, 877, 77, 1933, 2729}}, {877, 13, 2607, {1, 3, 7, 11, 27, 39, 43, 161, 255, 15, 1463, 833, 495}}, {878, 13, 2612, {1, 1, 7, 11, 3, 53, 81, 67, 375, 823, 1903, 3061, 395}}, {879, 13, 2619, {1, 1, 1, 1, 15, 37, 93, 233, 247, 501, 1321, 3275, 5409}}, {880, 13, 2621, {1, 3, 3, 7, 7, 11, 5, 105, 139, 983, 1239, 531, 3881}}, {881, 13, 2627, {1, 1, 5, 3, 19, 49, 107, 227, 361, 101, 355, 2649, 7383}}, {882, 13, 2633, {1, 1, 7, 5, 25, 41, 101, 121, 209, 293, 1937, 2259, 5557}}, {883, 13, 2636, {1, 1, 3, 7, 7, 1, 9, 13, 463, 1019, 995, 3159, 107}}, {884, 13, 2642, {1, 3, 5, 11, 5, 35, 127, 97, 261, 789, 807, 807, 6257}}, {885, 13, 2654, {1, 1, 7, 5, 11, 13, 45, 91, 417, 101, 1973, 3645, 2107}}, {886, 13, 2660, {1, 1, 3, 7, 5, 63, 57, 49, 203, 157, 115, 1393, 8117}}, {887, 13, 2669, {1, 3, 5, 5, 3, 43, 15, 155, 127, 489, 1165, 3701, 4867}}, {888, 13, 2675, {1, 1, 7, 7, 29, 29, 69, 215, 415, 367, 371, 1901, 6075}}, {889, 13, 2684, {1, 1, 1, 3, 11, 33, 89, 149, 433, 705, 1437, 1597, 505}}, {890, 13, 2694, {1, 3, 5, 1, 13, 37, 19, 119, 5, 581, 2037, 1633, 2099}}, {891, 13, 2703, {1, 3, 7, 13, 5, 49, 103, 245, 215, 515, 133, 2007, 1933}}, {892, 13, 2706, {1, 3, 1, 9, 1, 3, 25, 197, 253, 387, 1683, 2267, 221}}, {893, 13, 2712, {1, 3, 5, 15, 21, 9, 73, 201, 405, 999, 437, 3877, 6045}}, {894, 13, 2715, {1, 1, 3, 1, 31, 55, 25, 83, 421, 395, 1807, 2129, 7797}}, {895, 13, 2722, {1, 1, 3, 1, 23, 21, 121, 183, 125, 347, 143, 3685, 4317}}, {896, 13, 2727, {1, 3, 3, 3, 17, 45, 17, 223, 267, 795, 1815, 1309, 155}}, {897, 13, 2734, {1, 1, 1, 15, 17, 59, 5, 133, 15, 715, 1503, 153, 2887}}, {898, 13, 2742, {1, 1, 1, 1, 27, 13, 119, 77, 243, 995, 1851, 3719, 4695}}, {899, 13, 2745, {1, 3, 1, 5, 31, 49, 43, 165, 49, 609, 1265, 1141, 505}}, {900, 13, 2751, {1, 1, 7, 13, 11, 63, 21, 253, 229, 585, 1543, 3719, 4141}}, {901, 13, 2766, {1, 3, 7, 11, 23, 27, 17, 131, 295, 895, 1493, 1411, 3247}}, {902, 13, 2768, {1, 1, 5, 9, 29, 7, 97, 15, 113, 445, 859, 1483, 1121}}, {903, 13, 2780, {1, 3, 1, 9, 13, 49, 99, 107, 323, 201, 681, 3071, 5281}}, {904, 13, 2790, {1, 1, 1, 15, 9, 19, 61, 161, 7, 87, 587, 2199, 2811}}, {905, 13, 2794, {1, 3, 3, 15, 15, 19, 95, 45, 299, 829, 981, 3479, 487}}, {906, 13, 2796, {1, 1, 1, 9, 3, 37, 7, 19, 227, 13, 397, 513, 1257}}, {907, 13, 2801, {1, 1, 5, 15, 15, 13, 17, 111, 135, 929, 1145, 811, 1801}}, {908, 13, 2804, {1, 3, 1, 3, 27, 57, 31, 19, 279, 103, 693, 631, 3409}}, {909, 13, 2807, {1, 1, 1, 1, 15, 13, 67, 83, 23, 799, 1735, 2063, 3363}}, {910, 13, 2816, {1, 3, 3, 7, 3, 1, 61, 31, 41, 533, 2025, 4067, 6963}}, {911, 13, 2821, {1, 1, 5, 7, 17, 27, 81, 79, 107, 205, 29, 97, 4883}}, {912, 13, 2831, {1, 1, 1, 5, 19, 49, 91, 201, 283, 949, 651, 3819, 5073}}, {913, 13, 2834, {1, 1, 7, 9, 11, 13, 73, 197, 37, 219, 1931, 3369, 6017}}, {914, 13, 2839, {1, 1, 7, 15, 11, 7, 75, 205, 7, 819, 399, 661, 6487}}, {915, 13, 2845, {1, 3, 3, 3, 27, 37, 95, 41, 307, 165, 1077, 3485, 563}}, {916, 13, 2852, {1, 3, 5, 3, 21, 49, 57, 179, 109, 627, 1789, 431, 2941}}, {917, 13, 2856, {1, 1, 7, 5, 11, 19, 43, 137, 149, 679, 1543, 245, 1381}}, {918, 13, 2861, {1, 3, 5, 5, 15, 3, 69, 81, 135, 159, 1363, 3401, 6355}}, {919, 13, 2873, {1, 3, 5, 1, 9, 61, 49, 53, 319, 25, 1647, 1297, 615}}, {920, 13, 2874, {1, 3, 5, 11, 31, 43, 9, 101, 71, 919, 335, 3147, 5823}}, {921, 13, 2888, {1, 3, 1, 1, 15, 5, 29, 109, 511, 945, 867, 3677, 6915}}, {922, 13, 2893, {1, 3, 3, 15, 17, 49, 91, 111, 215, 29, 1879, 97, 2505}}, {923, 13, 2894, {1, 3, 1, 13, 19, 61, 11, 111, 163, 777, 533, 1113, 5339}}, {924, 13, 2902, {1, 1, 7, 9, 17, 55, 117, 91, 455, 289, 557, 913, 4455}}, {925, 13, 2917, {1, 3, 1, 7, 25, 19, 123, 37, 1, 277, 717, 2965, 4469}}, {926, 13, 2921, {1, 3, 7, 3, 19, 23, 87, 235, 209, 457, 2041, 2893, 1805}}, {927, 13, 2922, {1, 3, 3, 5, 5, 43, 23, 61, 351, 791, 59, 2009, 2909}}, {928, 13, 2929, {1, 1, 3, 7, 5, 1, 27, 231, 385, 257, 1261, 2701, 1807}}, {929, 13, 2935, {1, 3, 1, 1, 27, 19, 87, 253, 131, 685, 1743, 3983, 2651}}, {930, 13, 2946, {1, 3, 7, 11, 21, 17, 11, 81, 191, 641, 1821, 3005, 7251}}, {931, 13, 2951, {1, 3, 3, 5, 15, 31, 41, 213, 55, 931, 1953, 49, 6037}}, {932, 13, 2957, {1, 1, 7, 15, 7, 27, 65, 223, 113, 79, 1875, 911, 5445}}, {933, 13, 2960, {1, 3, 7, 7, 23, 55, 51, 167, 495, 25, 1585, 3447, 799}}, {934, 13, 2966, {1, 1, 3, 7, 27, 15, 95, 193, 337, 415, 975, 3085, 967}}, {935, 13, 2972, {1, 1, 7, 15, 19, 7, 93, 41, 433, 551, 401, 3169, 3971}}, {936, 13, 2976, {1, 1, 7, 11, 13, 15, 53, 69, 433, 59, 1117, 3359, 6231}}, {937, 13, 2979, {1, 1, 7, 3, 23, 5, 115, 201, 225, 109, 1903, 3897, 6265}}, {938, 13, 2985, {1, 1, 1, 11, 17, 1, 39, 143, 361, 659, 1105, 23, 4923}}, {939, 13, 3000, {1, 1, 1, 9, 27, 57, 85, 227, 261, 119, 1881, 3965, 6999}}, {940, 13, 3003, {1, 3, 7, 7, 15, 7, 107, 17, 315, 49, 1591, 905, 7789}}, {941, 13, 3013, {1, 3, 1, 7, 29, 3, 47, 237, 157, 769, 839, 3199, 3195}}, {942, 13, 3018, {1, 1, 3, 15, 25, 39, 63, 15, 111, 857, 881, 1505, 7671}}, {943, 13, 3020, {1, 1, 7, 1, 3, 35, 41, 215, 99, 895, 1025, 1483, 4707}}, {944, 13, 3025, {1, 3, 5, 1, 1, 31, 25, 247, 113, 841, 397, 1825, 6969}}, {945, 13, 3042, {1, 1, 3, 5, 19, 41, 49, 243, 225, 973, 241, 175, 1041}}, {946, 13, 3047, {1, 1, 1, 7, 15, 15, 105, 141, 83, 75, 1675, 3523, 5219}}, {947, 13, 3048, {1, 1, 7, 5, 13, 27, 47, 199, 445, 841, 959, 1157, 2209}}, {948, 13, 3051, {1, 3, 5, 15, 23, 31, 31, 81, 85, 33, 785, 2639, 7799}}, {949, 13, 3054, {1, 1, 5, 13, 21, 3, 47, 99, 235, 943, 1731, 2467, 7891}}, {950, 13, 3056, {1, 1, 1, 3, 17, 53, 85, 219, 73, 131, 1339, 875, 1191}}, {951, 13, 3065, {1, 1, 5, 7, 17, 63, 113, 7, 185, 557, 749, 3563, 4973}}, {952, 13, 3073, {1, 3, 3, 15, 15, 21, 43, 111, 155, 689, 345, 423, 3597}}, {953, 13, 3074, {1, 1, 5, 1, 15, 29, 93, 5, 361, 713, 695, 3937, 425}}, {954, 13, 3083, {1, 3, 7, 7, 13, 41, 115, 175, 315, 937, 123, 2841, 4457}}, {955, 13, 3086, {1, 1, 3, 11, 25, 5, 103, 53, 423, 811, 657, 399, 7257}}, {956, 13, 3091, {1, 1, 1, 1, 1, 13, 101, 211, 383, 325, 97, 1703, 4429}}, {957, 13, 3097, {1, 3, 7, 9, 31, 45, 83, 157, 509, 701, 841, 1105, 3643}}, {958, 13, 3109, {1, 1, 1, 7, 1, 9, 69, 17, 129, 281, 1161, 2945, 7693}}, {959, 13, 3116, {1, 3, 7, 1, 11, 29, 51, 143, 77, 433, 1723, 2317, 5641}}, {960, 13, 3124, {1, 1, 1, 1, 21, 43, 13, 67, 177, 505, 1629, 1267, 4885}}, {961, 13, 3128, {1, 1, 3, 11, 27, 63, 111, 47, 233, 781, 453, 1679, 3209}}, {962, 13, 3153, {1, 1, 3, 13, 29, 27, 119, 141, 493, 971, 461, 1159, 633}}, {963, 13, 3160, {1, 1, 3, 15, 23, 5, 79, 215, 163, 149, 1805, 2399, 61}}, {964, 13, 3165, {1, 3, 5, 13, 19, 5, 1, 39, 409, 561, 709, 829, 1357}}, {965, 13, 3172, {1, 3, 3, 13, 19, 43, 9, 177, 449, 447, 73, 2107, 5669}}, {966, 13, 3175, {1, 3, 5, 1, 23, 13, 63, 109, 203, 593, 829, 4017, 6881}}, {967, 13, 3184, {1, 1, 5, 7, 3, 9, 53, 175, 391, 169, 1283, 3793, 4451}}, {968, 13, 3193, {1, 1, 5, 7, 29, 43, 9, 5, 209, 77, 927, 2941, 8145}}, {969, 13, 3196, {1, 3, 5, 15, 17, 49, 5, 143, 131, 771, 1685, 925, 2175}}, {970, 13, 3200, {1, 1, 3, 11, 27, 27, 27, 159, 161, 1015, 1587, 4049, 1983}}, {971, 13, 3203, {1, 3, 1, 3, 23, 57, 119, 67, 481, 577, 389, 3319, 5325}}, {972, 13, 3205, {1, 3, 5, 1, 19, 39, 87, 61, 329, 657, 1773, 31, 1707}}, {973, 13, 3209, {1, 1, 3, 1, 5, 25, 15, 241, 131, 815, 1751, 3029, 8039}}, {974, 13, 3224, {1, 3, 3, 13, 27, 13, 77, 87, 437, 57, 621, 1031, 7891}}, {975, 13, 3239, {1, 3, 1, 13, 23, 51, 117, 37, 331, 745, 605, 3179, 4713}}, {976, 13, 3251, {1, 1, 5, 5, 19, 17, 99, 167, 87, 721, 737, 789, 2165}}, {977, 13, 3254, {1, 3, 5, 13, 1, 51, 119, 211, 165, 299, 1327, 3053, 3343}}, {978, 13, 3265, {1, 1, 5, 15, 29, 45, 17, 129, 67, 345, 1553, 2705, 7369}}, {979, 13, 3266, {1, 1, 1, 9, 23, 7, 13, 209, 7, 407, 317, 3077, 7287}}, {980, 13, 3275, {1, 1, 1, 5, 9, 59, 89, 3, 487, 451, 505, 2499, 7563}}, {981, 13, 3280, {1, 3, 1, 7, 21, 1, 21, 203, 101, 417, 1389, 2751, 1397}}, {982, 13, 3283, {1, 3, 7, 13, 7, 31, 3, 247, 349, 485, 1259, 549, 6321}}, {983, 13, 3286, {1, 1, 7, 7, 27, 33, 107, 197, 293, 729, 1753, 2571, 103}}, {984, 13, 3301, {1, 3, 5, 9, 25, 35, 5, 253, 137, 213, 2041, 3387, 1809}}, {985, 13, 3302, {1, 1, 7, 13, 15, 35, 67, 83, 295, 175, 839, 2831, 839}}, {986, 13, 3305, {1, 3, 3, 11, 3, 17, 55, 141, 247, 991, 117, 3799, 1221}}, {987, 13, 3319, {1, 1, 5, 1, 11, 37, 87, 233, 457, 653, 899, 2933, 3105}}, {988, 13, 3323, {1, 1, 3, 15, 3, 31, 67, 167, 437, 9, 651, 1109, 1139}}, {989, 13, 3326, {1, 1, 3, 1, 7, 63, 67, 17, 11, 883, 1855, 1941, 4751}}, {990, 13, 3331, {1, 3, 7, 9, 19, 33, 113, 117, 495, 39, 1795, 2561, 5519}}, {991, 13, 3348, {1, 1, 7, 5, 1, 3, 103, 37, 201, 223, 1101, 877, 6483}}, {992, 13, 3351, {1, 1, 5, 9, 29, 49, 51, 33, 439, 917, 861, 1321, 2135}}, {993, 13, 3358, {1, 1, 3, 3, 1, 5, 17, 93, 217, 619, 613, 1357, 6095}}, {994, 13, 3368, {1, 3, 1, 11, 3, 21, 5, 41, 15, 175, 843, 2937, 6849}}, {995, 13, 3374, {1, 3, 3, 7, 9, 57, 55, 127, 79, 287, 445, 2205, 7989}}, {996, 13, 3376, {1, 1, 7, 13, 23, 17, 93, 129, 157, 135, 1747, 1813, 4183}}, {997, 13, 3379, {1, 1, 1, 5, 31, 59, 99, 33, 425, 329, 887, 367, 1761}}, {998, 13, 3385, {1, 1, 7, 9, 17, 53, 77, 139, 435, 387, 49, 3649, 1773}}, {999, 13, 3386, {1, 3, 3, 15, 21, 57, 45, 161, 331, 719, 273, 3479, 4173}}, {1000, 13, 3396, {1, 1, 3, 9, 3, 3, 105, 201, 373, 877, 919, 1263, 6649}}, {1001, 13, 3420, {1, 3, 1, 15, 13, 43, 13, 99, 73, 163, 353, 3569, 5601}}, {1002, 13, 3423, {1, 3, 7, 3, 5, 9, 69, 177, 449, 47, 781, 1125, 4245}}, {1003, 13, 3430, {1, 1, 1, 5, 3, 45, 1, 123, 409, 903, 205, 2057, 7637}}, {1004, 13, 3433, {1, 3, 5, 9, 19, 47, 87, 135, 481, 799, 101, 3409, 2241}}, {1005, 13, 3434, {1, 3, 1, 13, 3, 25, 15, 27, 181, 967, 669, 2577, 7249}}, {1006, 13, 3439, {1, 1, 7, 3, 31, 5, 103, 53, 1, 911, 1209, 3697, 6685}}, {1007, 13, 3442, {1, 1, 3, 1, 5, 5, 49, 135, 281, 747, 761, 2973, 7963}}, {1008, 13, 3444, {1, 3, 3, 5, 19, 61, 125, 199, 299, 515, 1365, 369, 7027}}, {1009, 13, 3453, {1, 3, 1, 7, 5, 41, 63, 229, 283, 571, 147, 447, 657}}, {1010, 13, 3464, {1, 3, 1, 11, 5, 15, 55, 7, 259, 61, 27, 1429, 5631}}, {1011, 13, 3477, {1, 1, 5, 1, 3, 53, 51, 253, 155, 553, 1293, 3735, 6567}}, {1012, 13, 3478, {1, 3, 5, 9, 5, 41, 21, 159, 101, 785, 1981, 3799, 7693}}, {1013, 13, 3482, {1, 3, 7, 7, 9, 3, 95, 105, 129, 213, 1215, 1027, 5699}}, {1014, 13, 3487, {1, 1, 3, 3, 29, 13, 9, 253, 449, 321, 341, 2879, 171}}, {1015, 13, 3497, {1, 3, 7, 11, 21, 11, 75, 35, 43, 965, 675, 2217, 7175}}, {1016, 13, 3500, {1, 1, 5, 15, 31, 5, 29, 137, 311, 751, 47, 1367, 5921}}, {1017, 13, 3505, {1, 1, 3, 15, 17, 1, 45, 69, 55, 649, 835, 569, 7615}}, {1018, 13, 3506, {1, 3, 1, 13, 31, 7, 23, 15, 391, 145, 1845, 1825, 1403}}, {1019, 13, 3511, {1, 1, 3, 15, 5, 9, 79, 77, 105, 399, 1933, 2503, 4781}}, {1020, 13, 3512, {1, 3, 1, 3, 17, 47, 19, 13, 107, 475, 759, 2933, 3761}}, {1021, 13, 3515, {1, 1, 7, 11, 3, 7, 121, 209, 397, 877, 293, 847, 7039}}, {1022, 13, 3525, {1, 1, 1, 15, 29, 45, 5, 109, 335, 461, 143, 931, 4045}}, {1023, 13, 3532, {1, 3, 1, 7, 11, 57, 73, 89, 201, 173, 803, 3953, 5205}}, {1024, 13, 3538, {1, 1, 5, 11, 11, 33, 37, 29, 263, 1019, 657, 1453, 7807}}, {1025, 13, 3540, {1, 3, 3, 13, 31, 25, 37, 47, 261, 607, 1703, 2603, 417}}, {1026, 13, 3547, {1, 1, 1, 1, 31, 61, 45, 115, 275, 239, 1989, 1897, 4329}}, {1027, 13, 3549, {1, 3, 5, 3, 31, 3, 11, 173, 335, 579, 1193, 2219, 7875}}, {1028, 13, 3560, {1, 1, 7, 9, 29, 45, 13, 67, 399, 177, 1293, 3865, 2225}}, {1029, 13, 3571, {1, 1, 7, 11, 11, 51, 121, 227, 469, 905, 929, 2635, 4165}}, {1030, 13, 3577, {1, 3, 7, 9, 13, 39, 55, 167, 23, 147, 1603, 2083, 4645}}, {1031, 13, 3583, {1, 1, 3, 15, 27, 53, 11, 155, 157, 629, 259, 3009, 4605}}, {1032, 13, 3590, {1, 3, 1, 7, 15, 47, 51, 1, 259, 603, 887, 2833, 6581}}, {1033, 13, 3593, {1, 3, 5, 3, 1, 47, 91, 43, 361, 571, 29, 1453, 4269}}, {1034, 13, 3594, {1, 1, 3, 9, 11, 51, 55, 23, 415, 277, 1423, 3475, 1527}}, {1035, 13, 3599, {1, 1, 3, 11, 29, 49, 101, 75, 299, 709, 805, 4037, 4389}}, {1036, 13, 3601, {1, 1, 7, 3, 23, 1, 37, 51, 379, 771, 1301, 3717, 6673}}, {1037, 13, 3602, {1, 1, 5, 3, 23, 11, 125, 177, 375, 665, 951, 1577, 2603}}, {1038, 13, 3613, {1, 1, 1, 1, 1, 5, 71, 255, 21, 459, 467, 2083, 5415}}, {1039, 13, 3623, {1, 1, 5, 13, 23, 29, 109, 157, 363, 971, 549, 647, 1177}}, {1040, 13, 3630, {1, 1, 3, 9, 7, 15, 101, 3, 365, 213, 745, 1155, 6099}}, {1041, 13, 3638, {1, 3, 5, 15, 15, 19, 47, 179, 303, 521, 1279, 219, 2415}}, {1042, 13, 3649, {1, 3, 3, 13, 27, 11, 83, 165, 369, 989, 261, 3933, 4809}}, {1043, 13, 3655, {1, 1, 3, 11, 31, 59, 1, 185, 53, 703, 1471, 2935, 1107}}, {1044, 13, 3662, {1, 3, 3, 7, 25, 3, 81, 27, 93, 521, 433, 2859, 5861}}, {1045, 13, 3667, {1, 3, 3, 11, 29, 15, 49, 167, 315, 927, 543, 3473, 4307}}, {1046, 13, 3669, {1, 3, 1, 3, 29, 33, 53, 15, 183, 691, 703, 1311, 3393}}, {1047, 13, 3676, {1, 3, 5, 13, 23, 49, 3, 11, 1, 357, 1407, 415, 7211}}, {1048, 13, 3683, {1, 3, 7, 15, 1, 25, 91, 113, 323, 371, 189, 925, 1181}}, {1049, 13, 3700, {1, 3, 3, 3, 17, 59, 119, 199, 115, 223, 877, 2193, 193}}, {1050, 13, 3709, {1, 1, 1, 5, 5, 35, 31, 59, 437, 411, 37, 2405, 3797}}, {1051, 13, 3710, {1, 3, 1, 13, 9, 37, 1, 241, 59, 157, 1785, 1223, 563}}, {1052, 13, 3713, {1, 3, 5, 13, 3, 21, 25, 95, 15, 745, 85, 701, 5361}}, {1053, 13, 3723, {1, 3, 7, 1, 31, 33, 111, 195, 35, 913, 2013, 2951, 6611}}, {1054, 13, 3725, {1, 3, 5, 1, 19, 3, 75, 119, 111, 409, 951, 1457, 4957}}, {1055, 13, 3728, {1, 3, 1, 15, 19, 59, 3, 155, 237, 657, 1967, 3323, 6235}}, {1056, 13, 3734, {1, 1, 5, 1, 3, 19, 45, 105, 377, 881, 167, 2255, 4483}}, {1057, 13, 3737, {1, 1, 7, 7, 13, 13, 99, 89, 201, 279, 161, 2483, 6001}}, {1058, 13, 3738, {1, 1, 7, 3, 13, 17, 97, 129, 137, 377, 1519, 183, 3725}}, {1059, 13, 3744, {1, 1, 7, 9, 9, 5, 45, 135, 115, 181, 1685, 3505, 4387}}, {1060, 13, 3750, {1, 1, 1, 1, 19, 35, 69, 113, 305, 419, 949, 2969, 247}}, {1061, 13, 3762, {1, 1, 5, 13, 23, 61, 13, 139, 501, 811, 67, 1501, 6493}}, {1062, 13, 3764, {1, 1, 3, 13, 15, 41, 27, 217, 293, 13, 145, 2631, 6991}}, {1063, 13, 3774, {1, 3, 3, 13, 15, 37, 71, 123, 285, 49, 627, 1283, 5993}}, {1064, 13, 3776, {1, 3, 3, 11, 9, 25, 11, 1, 203, 353, 1347, 1999, 2799}}, {1065, 13, 3786, {1, 3, 5, 1, 7, 49, 101, 231, 499, 63, 1977, 2207, 7829}}, {1066, 13, 3800, {1, 1, 7, 1, 17, 15, 115, 139, 381, 943, 623, 4037, 2971}}, {1067, 13, 3803, {1, 1, 3, 5, 13, 55, 23, 87, 139, 795, 1669, 1375, 1185}}, {1068, 13, 3809, {1, 3, 3, 5, 5, 45, 97, 253, 241, 333, 645, 555, 7867}}, {1069, 13, 3816, {1, 3, 5, 1, 1, 1, 89, 27, 407, 509, 1433, 609, 2355}}, {1070, 13, 3821, {1, 3, 7, 1, 27, 29, 5, 157, 495, 811, 1293, 1143, 827}}, {1071, 13, 3827, {1, 1, 3, 3, 25, 49, 127, 111, 191, 3, 845, 1383, 2521}}, {1072, 13, 3829, {1, 1, 5, 7, 5, 51, 101, 155, 237, 461, 831, 3091, 3851}}, {1073, 13, 3836, {1, 3, 7, 1, 29, 35, 105, 91, 285, 705, 131, 395, 6011}}, {1074, 13, 3842, {1, 3, 5, 3, 13, 21, 83, 173, 221, 827, 1775, 1931, 6727}}, {1075, 13, 3844, {1, 1, 3, 5, 3, 25, 95, 115, 205, 569, 1447, 933, 6425}}, {1076, 13, 3847, {1, 1, 7, 9, 31, 3, 17, 175, 145, 447, 1321, 1069, 6527}}, {1077, 13, 3853, {1, 1, 3, 3, 23, 1, 79, 51, 421, 419, 873, 3939, 1801}}, {1078, 13, 3861, {1, 1, 5, 1, 3, 39, 15, 85, 169, 669, 919, 397, 5579}}, {1079, 13, 3871, {1, 3, 5, 1, 21, 61, 87, 217, 251, 619, 1091, 4009, 229}}, {1080, 13, 3872, {1, 1, 1, 11, 23, 55, 85, 121, 363, 867, 315, 447, 3373}}, {1081, 13, 3881, {1, 3, 3, 13, 29, 19, 89, 85, 137, 469, 1873, 2765, 3975}}, {1082, 13, 3890, {1, 3, 7, 13, 19, 63, 61, 77, 67, 361, 11, 1787, 4703}}, {1083, 13, 3892, {1, 1, 3, 11, 7, 15, 127, 105, 179, 857, 1671, 3647, 3389}}, {1084, 13, 3909, {1, 1, 1, 7, 19, 21, 99, 161, 499, 519, 1287, 2973, 479}}, {1085, 13, 3921, {1, 1, 3, 13, 29, 51, 95, 251, 55, 519, 1955, 2881, 5951}}, {1086, 13, 3934, {1, 1, 3, 11, 23, 63, 121, 237, 175, 311, 701, 1539, 2383}}, {1087, 13, 3938, {1, 1, 7, 5, 5, 45, 73, 97, 5, 153, 715, 2037, 3353}}, {1088, 13, 3947, {1, 1, 1, 3, 13, 7, 67, 173, 425, 843, 1497, 2729, 5193}}, {1089, 13, 3950, {1, 1, 7, 1, 23, 3, 119, 11, 77, 141, 1905, 2269, 4269}}, {1090, 13, 3952, {1, 1, 7, 15, 1, 23, 79, 251, 439, 603, 405, 2449, 6383}}, {1091, 13, 3964, {1, 3, 7, 11, 29, 27, 47, 255, 47, 661, 1967, 1007, 3689}}, {1092, 13, 3974, {1, 3, 7, 5, 19, 39, 35, 115, 417, 373, 291, 329, 603}}, {1093, 13, 3980, {1, 3, 1, 9, 11, 33, 27, 193, 207, 423, 1311, 1369, 7307}}, {1094, 13, 3983, {1, 1, 3, 11, 9, 29, 83, 17, 497, 493, 329, 3141, 5935}}, {1095, 13, 3986, {1, 3, 1, 5, 31, 51, 29, 171, 51, 493, 1621, 3501, 4091}}, {1096, 13, 3995, {1, 1, 5, 9, 21, 43, 105, 207, 245, 363, 1191, 699, 1139}}, {1097, 13, 3998, {1, 1, 3, 11, 19, 5, 81, 119, 247, 169, 1337, 45, 6565}}, {1098, 13, 4001, {1, 3, 1, 11, 3, 51, 3, 101, 159, 11, 253, 299, 5043}}, {1099, 13, 4002, {1, 3, 1, 5, 11, 53, 85, 39, 57, 645, 2007, 1039, 3627}}, {1100, 13, 4004, {1, 3, 5, 3, 17, 61, 97, 165, 415, 357, 283, 601, 5505}}, {1101, 13, 4008, {1, 3, 7, 3, 9, 51, 49, 85, 3, 227, 137, 309, 243}}, {1102, 13, 4011, {1, 1, 5, 3, 11, 59, 11, 131, 409, 703, 455, 123, 6727}}, {1103, 13, 4016, {1, 3, 7, 9, 25, 49, 21, 171, 287, 379, 667, 313, 713}}, {1104, 13, 4033, {1, 1, 3, 9, 7, 35, 47, 3, 367, 581, 1627, 1665, 3905}}, {1105, 13, 4036, {1, 3, 1, 1, 29, 57, 35, 55, 255, 653, 823, 2197, 6179}}, {1106, 13, 4040, {1, 3, 7, 15, 17, 15, 117, 83, 359, 163, 115, 2999, 5373}}, {1107, 13, 4053, {1, 1, 5, 3, 21, 61, 35, 97, 71, 687, 207, 2917, 1049}}, {1108, 13, 4058, {1, 1, 1, 15, 13, 15, 125, 81, 263, 661, 417, 3243, 1669}}, {1109, 13, 4081, {1, 1, 7, 3, 3, 19, 111, 193, 443, 339, 659, 1211, 1557}}, {1110, 13, 4091, {1, 3, 1, 3, 27, 3, 3, 173, 391, 213, 803, 3281, 3207}}, {1111, 13, 4094, {1, 1, 5, 15, 19, 1, 7, 211, 157, 603, 403, 1387, 1583}}, {1112, 14, 21, {1, 3, 5, 13, 17, 53, 125, 13, 339, 723, 521, 413, 5801, 10451}}, {1113, 14, 28, {1, 1, 3, 13, 29, 9, 99, 77, 141, 609, 1533, 983, 2039, 51}}, {1114, 14, 41, {1, 1, 3, 11, 21, 55, 5, 51, 423, 309, 525, 3715, 3025, 15055}}, {1115, 14, 47, {1, 1, 3, 7, 9, 21, 77, 171, 239, 341, 1653, 1093, 2273, 10723}}, {1116, 14, 61, {1, 1, 1, 15, 31, 15, 23, 35, 317, 869, 1917, 1415, 4313, 3687}}, {1117, 14, 84, {1, 1, 1, 5, 21, 25, 99, 167, 439, 453, 473, 431, 6665, 4989}}, {1118, 14, 87, {1, 1, 7, 9, 31, 47, 81, 83, 345, 43, 1363, 1885, 3155, 3185}}, {1119, 14, 93, {1, 3, 7, 1, 31, 17, 61, 185, 341, 129, 547, 717, 2071, 9991}}, {1120, 14, 94, {1, 3, 1, 13, 23, 61, 77, 217, 455, 77, 1263, 1601, 3501, 14953}}, {1121, 14, 103, {1, 1, 7, 7, 19, 19, 1, 229, 431, 943, 1069, 1949, 1289, 15729}}, {1122, 14, 117, {1, 1, 3, 5, 1, 35, 97, 251, 487, 459, 1265, 1739, 165, 10365}}, {1123, 14, 121, {1, 3, 5, 3, 11, 25, 79, 175, 383, 545, 187, 197, 4329, 3363}}, {1124, 14, 134, {1, 1, 3, 3, 29, 9, 63, 55, 175, 277, 431, 2549, 2629, 6409}}, {1125, 14, 137, {1, 1, 3, 15, 17, 21, 79, 139, 99, 135, 1763, 1805, 3471, 5439}}, {1126, 14, 157, {1, 1, 3, 9, 9, 15, 35, 119, 289, 835, 769, 3843, 4119, 4421}}, {1127, 14, 161, {1, 1, 1, 5, 19, 19, 67, 199, 307, 815, 1367, 1231, 3927, 6593}}, {1128, 14, 205, {1, 1, 3, 1, 29, 51, 121, 209, 431, 47, 1115, 907, 2535, 9755}}, {1129, 14, 206, {1, 1, 3, 5, 17, 1, 5, 119, 121, 223, 1719, 1291, 3947, 15891}}, {1130, 14, 211, {1, 3, 1, 15, 29, 25, 3, 131, 373, 307, 645, 3513, 1289, 1987}}, {1131, 14, 214, {1, 3, 3, 11, 29, 45, 105, 179, 331, 465, 891, 1315, 403, 3057}}, {1132, 14, 218, {1, 1, 5, 13, 17, 59, 77, 127, 485, 855, 1147, 3093, 891, 9869}}, {1133, 14, 234, {1, 1, 1, 7, 23, 27, 31, 203, 285, 463, 827, 685, 1349, 15051}}, {1134, 14, 236, {1, 1, 1, 5, 29, 5, 107, 195, 31, 425, 19, 2865, 3869, 11153}}, {1135, 14, 248, {1, 1, 7, 5, 7, 47, 1, 73, 307, 347, 393, 2205, 7709, 15121}}, {1136, 14, 262, {1, 1, 1, 13, 15, 61, 25, 131, 113, 369, 1995, 2527, 4475, 1745}}, {1137, 14, 299, {1, 1, 1, 1, 31, 63, 21, 253, 307, 281, 859, 3319, 6721, 2891}}, {1138, 14, 304, {1, 1, 3, 11, 1, 17, 5, 183, 301, 979, 651, 1685, 6343, 10067}}, {1139, 14, 319, {1, 1, 5, 15, 23, 45, 99, 145, 263, 507, 1381, 3425, 2215, 1815}}, {1140, 14, 322, {1, 3, 1, 5, 11, 63, 85, 203, 411, 881, 1369, 1237, 4657, 6541}}, {1141, 14, 334, {1, 3, 3, 13, 17, 53, 121, 201, 269, 983, 215, 3187, 7121, 6111}}, {1142, 14, 355, {1, 3, 5, 15, 15, 5, 13, 143, 3, 313, 1677, 1093, 3295, 3387}}, {1143, 14, 357, {1, 1, 3, 13, 3, 23, 73, 17, 257, 965, 239, 1271, 2803, 7327}}, {1144, 14, 358, {1, 3, 5, 13, 9, 57, 115, 37, 41, 467, 135, 1403, 3811, 4741}}, {1145, 14, 369, {1, 3, 7, 15, 9, 33, 39, 203, 351, 367, 1355, 1403, 3685, 4757}}, {1146, 14, 372, {1, 3, 5, 11, 31, 3, 113, 123, 203, 421, 1821, 3151, 2375, 4419}}, {1147, 14, 375, {1, 1, 1, 7, 21, 63, 99, 23, 133, 79, 991, 1755, 4989, 4709}}, {1148, 14, 388, {1, 3, 5, 1, 25, 63, 113, 239, 49, 443, 173, 1261, 3201, 10599}}, {1149, 14, 400, {1, 3, 3, 13, 3, 25, 101, 169, 23, 585, 327, 1327, 111, 10059}}, {1150, 14, 415, {1, 3, 3, 5, 19, 1, 33, 89, 437, 213, 1933, 1741, 2603, 5625}}, {1151, 14, 446, {1, 3, 1, 3, 15, 15, 25, 139, 73, 335, 237, 2461, 3101, 14951}}, {1152, 14, 451, {1, 3, 5, 1, 31, 15, 31, 187, 177, 659, 1339, 3767, 4975, 7123}}, {1153, 14, 458, {1, 3, 1, 3, 25, 19, 47, 89, 107, 107, 649, 683, 3123, 11085}}, {1154, 14, 471, {1, 3, 7, 9, 15, 21, 101, 25, 11, 625, 1555, 675, 3893, 5805}}, {1155, 14, 484, {1, 1, 1, 5, 7, 49, 123, 21, 439, 369, 207, 535, 4619, 14665}}, {1156, 14, 501, {1, 1, 5, 7, 1, 25, 103, 185, 99, 239, 1093, 1561, 6177, 4039}}, {1157, 14, 502, {1, 3, 7, 5, 29, 21, 43, 103, 343, 973, 1561, 2975, 7467, 7947}}, {1158, 14, 517, {1, 1, 7, 9, 19, 3, 13, 23, 461, 813, 1191, 985, 559, 3317}}, {1159, 14, 545, {1, 3, 5, 5, 27, 31, 79, 15, 365, 901, 1949, 117, 3619, 13311}}, {1160, 14, 569, {1, 3, 5, 7, 5, 33, 67, 199, 425, 189, 1691, 3099, 815, 1677}}, {1161, 14, 617, {1, 1, 7, 11, 13, 29, 73, 137, 265, 601, 445, 3893, 2511, 8047}}, {1162, 14, 618, {1, 1, 3, 1, 13, 5, 57, 101, 357, 391, 335, 601, 1359, 1065}}, {1163, 14, 623, {1, 1, 1, 1, 25, 57, 27, 115, 31, 873, 611, 2125, 447, 13585}}, {1164, 14, 625, {1, 3, 3, 13, 27, 17, 73, 11, 359, 33, 1153, 271, 4537, 15141}}, {1165, 14, 637, {1, 3, 7, 3, 11, 63, 103, 61, 59, 629, 1629, 3279, 3919, 3177}}, {1166, 14, 661, {1, 1, 5, 15, 3, 63, 85, 193, 381, 165, 175, 3247, 2501, 4209}}, {1167, 14, 668, {1, 1, 5, 15, 1, 33, 59, 219, 487, 193, 1557, 703, 2907, 7953}}, {1168, 14, 684, {1, 1, 7, 3, 9, 3, 105, 95, 389, 991, 21, 3841, 6983, 285}}, {1169, 14, 695, {1, 1, 1, 1, 1, 31, 25, 137, 117, 67, 1283, 1963, 6591, 15541}}, {1170, 14, 716, {1, 3, 5, 11, 7, 15, 127, 89, 453, 777, 1827, 2311, 7661, 11833}}, {1171, 14, 719, {1, 1, 7, 13, 19, 29, 79, 165, 223, 453, 2039, 3961, 6467, 5481}}, {1172, 14, 722, {1, 3, 3, 7, 17, 41, 43, 157, 323, 3, 1001, 2109, 4513, 12127}}, {1173, 14, 731, {1, 1, 5, 9, 31, 57, 3, 217, 113, 271, 1663, 1367, 6949, 8165}}, {1174, 14, 738, {1, 1, 7, 15, 27, 35, 81, 235, 61, 205, 525, 311, 6357, 2527}}, {1175, 14, 747, {1, 3, 1, 9, 19, 29, 71, 207, 321, 1011, 1615, 1333, 3459, 6681}}, {1176, 14, 755, {1, 3, 7, 7, 3, 57, 41, 19, 25, 397, 565, 1837, 7625, 11813}}, {1177, 14, 761, {1, 3, 3, 1, 27, 47, 31, 79, 441, 961, 1255, 423, 2405, 913}}, {1178, 14, 767, {1, 3, 3, 13, 3, 29, 69, 227, 85, 201, 395, 3199, 3869, 13099}}, {1179, 14, 775, {1, 3, 3, 7, 29, 61, 99, 7, 27, 227, 945, 873, 475, 4363}}, {1180, 14, 782, {1, 3, 5, 13, 19, 21, 57, 149, 217, 443, 565, 453, 5487, 10981}}, {1181, 14, 787, {1, 3, 3, 1, 9, 27, 47, 191, 35, 395, 1429, 4079, 6871, 8013}}, {1182, 14, 794, {1, 3, 5, 15, 5, 43, 9, 79, 279, 563, 1125, 985, 8117, 4099}}, {1183, 14, 803, {1, 3, 5, 1, 13, 41, 21, 117, 287, 667, 701, 1483, 8167, 13283}}, {1184, 14, 812, {1, 3, 1, 3, 15, 15, 59, 5, 383, 509, 1657, 3977, 7697, 10941}}, {1185, 14, 817, {1, 3, 1, 1, 17, 29, 19, 23, 377, 45, 981, 1631, 3557, 6749}}, {1186, 14, 824, {1, 3, 3, 9, 9, 51, 9, 193, 345, 361, 1679, 3333, 713, 5387}}, {1187, 14, 829, {1, 3, 5, 5, 17, 45, 97, 17, 385, 349, 105, 2245, 7295, 14393}}, {1188, 14, 850, {1, 3, 7, 3, 19, 51, 35, 99, 79, 301, 1563, 399, 5879, 14675}}, {1189, 14, 866, {1, 1, 7, 15, 13, 53, 55, 203, 417, 161, 2033, 1845, 6763, 3585}}, {1190, 14, 871, {1, 1, 3, 3, 7, 23, 11, 43, 241, 309, 1453, 3147, 2619, 3163}}, {1191, 14, 877, {1, 1, 1, 11, 17, 1, 17, 137, 443, 465, 993, 3217, 7879, 14607}}, {1192, 14, 920, {1, 1, 7, 13, 29, 49, 71, 217, 291, 793, 135, 21, 2503, 11091}}, {1193, 14, 935, {1, 3, 1, 11, 31, 51, 121, 227, 377, 157, 1457, 1317, 5625, 6217}}, {1194, 14, 959, {1, 1, 3, 7, 23, 61, 47, 93, 79, 617, 1805, 2403, 5513, 16335}}, {1195, 14, 979, {1, 3, 5, 11, 23, 25, 41, 11, 495, 587, 1223, 3107, 1469, 15223}}, {1196, 14, 992, {1, 3, 7, 7, 9, 1, 1, 49, 23, 723, 1761, 3717, 7375, 10875}}, {1197, 14, 1010, {1, 3, 3, 11, 25, 37, 57, 63, 309, 603, 183, 285, 1663, 5627}}, {1198, 14, 1012, {1, 3, 7, 11, 19, 25, 25, 201, 391, 257, 529, 1645, 1, 15111}}, {1199, 14, 1015, {1, 3, 3, 9, 11, 43, 91, 65, 5, 959, 301, 1015, 6343, 3453}}, {1200, 14, 1033, {1, 3, 3, 11, 17, 17, 103, 37, 77, 973, 575, 439, 49, 3639}}, {1201, 14, 1036, {1, 1, 5, 7, 1, 15, 107, 237, 231, 967, 923, 1101, 6715, 1713}}, {1202, 14, 1053, {1, 3, 1, 15, 9, 33, 29, 211, 245, 601, 1783, 887, 1209, 11785}}, {1203, 14, 1057, {1, 3, 3, 7, 21, 43, 27, 89, 27, 141, 865, 367, 1379, 4063}}, {1204, 14, 1069, {1, 3, 7, 7, 15, 17, 15, 15, 131, 649, 1955, 3289, 3983, 10689}}, {1205, 14, 1072, {1, 3, 1, 5, 17, 7, 125, 69, 359, 981, 1345, 933, 5281, 7113}}, {1206, 14, 1075, {1, 1, 5, 9, 17, 7, 41, 207, 497, 1015, 493, 891, 3563, 3541}}, {1207, 14, 1087, {1, 3, 5, 11, 27, 3, 47, 31, 303, 1007, 2047, 2203, 6257, 8369}}, {1208, 14, 1089, {1, 1, 1, 15, 25, 15, 89, 51, 217, 357, 1133, 1917, 213, 3365}}, {1209, 14, 1137, {1, 1, 5, 13, 29, 23, 123, 207, 429, 805, 819, 2357, 6313, 11019}}, {1210, 14, 1166, {1, 1, 3, 7, 19, 15, 41, 73, 279, 11, 1089, 3107, 7737, 15953}}, {1211, 14, 1174, {1, 3, 5, 7, 7, 15, 41, 73, 493, 457, 1731, 1139, 2513, 12373}}, {1212, 14, 1180, {1, 3, 5, 9, 17, 5, 55, 155, 173, 1005, 529, 3175, 7667, 4747}}, {1213, 14, 1204, {1, 1, 7, 7, 5, 21, 105, 31, 205, 847, 1033, 3167, 2347, 8499}}, {1214, 14, 1211, {1, 3, 5, 3, 11, 17, 59, 189, 179, 1007, 33, 3287, 4813, 8177}}, {1215, 14, 1219, {1, 3, 3, 13, 27, 47, 47, 171, 413, 875, 1081, 1259, 7139, 8645}}, {1216, 14, 1236, {1, 3, 5, 7, 25, 21, 51, 29, 361, 293, 51, 1119, 1453, 5283}}, {1217, 14, 1255, {1, 3, 7, 7, 29, 55, 103, 199, 511, 341, 1957, 3987, 2855, 1279}}, {1218, 14, 1264, {1, 1, 1, 9, 23, 51, 61, 63, 391, 37, 55, 3771, 6517, 15913}}, {1219, 14, 1306, {1, 1, 1, 9, 3, 19, 13, 147, 453, 855, 1321, 189, 5043, 11215}}, {1220, 14, 1330, {1, 3, 3, 13, 23, 3, 87, 155, 401, 981, 607, 3413, 995, 6473}}, {1221, 14, 1341, {1, 3, 1, 9, 29, 47, 95, 123, 421, 353, 1867, 2609, 2569, 14083}}, {1222, 14, 1344, {1, 1, 5, 13, 25, 39, 29, 111, 125, 545, 1493, 2371, 6361, 6307}}, {1223, 14, 1347, {1, 3, 3, 11, 13, 31, 87, 75, 27, 393, 921, 3655, 3343, 16349}}, {1224, 14, 1349, {1, 1, 5, 9, 19, 19, 7, 129, 223, 715, 433, 1627, 4463, 2951}}, {1225, 14, 1361, {1, 1, 7, 1, 31, 13, 49, 33, 89, 43, 1529, 725, 3809, 3427}}, {1226, 14, 1380, {1, 1, 7, 3, 1, 27, 45, 9, 309, 875, 659, 2661, 553, 7069}}, {1227, 14, 1390, {1, 1, 7, 15, 13, 37, 61, 19, 125, 683, 1227, 2255, 1455, 9339}}, {1228, 14, 1404, {1, 3, 5, 7, 19, 7, 71, 21, 465, 645, 1885, 873, 7405, 1913}}, {1229, 14, 1435, {1, 3, 1, 11, 11, 35, 79, 61, 79, 57, 1603, 3719, 6323, 16371}}, {1230, 14, 1444, {1, 1, 7, 1, 29, 57, 85, 21, 205, 37, 2045, 683, 4901, 8223}}, {1231, 14, 1453, {1, 1, 5, 13, 31, 31, 65, 131, 259, 535, 967, 3943, 2605, 2089}}, {1232, 14, 1461, {1, 1, 7, 9, 27, 61, 39, 243, 207, 41, 1909, 3279, 1331, 4635}}, {1233, 14, 1462, {1, 3, 3, 5, 11, 63, 105, 19, 169, 95, 773, 3175, 1869, 1797}}, {1234, 14, 1465, {1, 3, 3, 15, 13, 33, 107, 197, 153, 795, 1477, 105, 4965, 991}}, {1235, 14, 1468, {1, 3, 7, 11, 11, 37, 23, 149, 197, 3, 1035, 3857, 553, 1059}}, {1236, 14, 1474, {1, 3, 1, 3, 17, 29, 89, 189, 193, 59, 1477, 3517, 2565, 7739}}, {1237, 14, 1483, {1, 1, 1, 9, 23, 3, 25, 163, 469, 305, 1791, 3393, 6141, 8119}}, {1238, 14, 1488, {1, 3, 5, 7, 7, 41, 19, 101, 179, 487, 1071, 2761, 8043, 5103}}, {1239, 14, 1493, {1, 1, 7, 9, 1, 21, 101, 103, 349, 85, 1841, 1033, 4473, 3563}}, {1240, 14, 1500, {1, 1, 3, 13, 23, 61, 39, 27, 479, 13, 45, 1371, 7897, 10637}}, {1241, 14, 1509, {1, 1, 5, 9, 17, 61, 71, 55, 355, 99, 1695, 3053, 839, 959}}, {1242, 14, 1510, {1, 1, 3, 1, 7, 27, 87, 221, 327, 241, 461, 3177, 5933, 8299}}, {1243, 14, 1514, {1, 3, 7, 9, 5, 41, 111, 245, 447, 263, 1363, 1767, 6331, 3355}}, {1244, 14, 1519, {1, 3, 3, 13, 15, 11, 15, 169, 429, 149, 1965, 2477, 7733, 2499}}, {1245, 14, 1528, {1, 1, 5, 15, 15, 47, 25, 33, 469, 701, 773, 2747, 1533, 14633}}, {1246, 14, 1533, {1, 3, 1, 5, 19, 57, 37, 75, 423, 11, 685, 2487, 1779, 8797}}, {1247, 14, 1540, {1, 3, 1, 5, 19, 41, 67, 99, 333, 991, 953, 3221, 939, 4197}}, {1248, 14, 1550, {1, 3, 1, 15, 11, 39, 25, 1, 159, 679, 465, 1611, 5799, 2537}}, {1249, 14, 1567, {1, 1, 5, 11, 5, 37, 37, 7, 101, 703, 235, 23, 2209, 12799}}, {1250, 14, 1571, {1, 1, 7, 3, 11, 23, 71, 215, 45, 269, 1539, 3625, 5773, 6889}}, {1251, 14, 1573, {1, 3, 5, 15, 27, 33, 105, 109, 205, 653, 821, 435, 1087, 2495}}, {1252, 14, 1578, {1, 1, 3, 5, 11, 39, 53, 213, 41, 385, 1425, 25, 5553, 12523}}, {1253, 14, 1598, {1, 3, 5, 15, 29, 49, 13, 253, 505, 407, 985, 2569, 6727, 4761}}, {1254, 14, 1606, {1, 1, 1, 3, 29, 17, 69, 47, 25, 819, 1145, 2479, 1183, 3343}}, {1255, 14, 1618, {1, 3, 1, 15, 25, 61, 43, 55, 279, 579, 361, 355, 6101, 3143}}, {1256, 14, 1630, {1, 3, 5, 11, 3, 59, 125, 101, 451, 495, 1711, 3443, 3625, 15579}}, {1257, 14, 1634, {1, 3, 1, 11, 25, 61, 49, 219, 23, 795, 481, 3609, 3691, 15419}}, {1258, 14, 1640, {1, 3, 7, 5, 9, 59, 49, 233, 345, 143, 181, 3587, 3041, 1219}}, {1259, 14, 1643, {1, 3, 7, 13, 9, 31, 39, 137, 261, 919, 1367, 3145, 4659, 5875}}, {1260, 14, 1654, {1, 1, 3, 3, 27, 43, 95, 65, 301, 915, 31, 451, 7743, 7277}}, {1261, 14, 1679, {1, 3, 1, 5, 23, 37, 53, 31, 203, 453, 71, 1585, 6011, 16369}}, {1262, 14, 1688, {1, 1, 5, 1, 15, 47, 91, 227, 297, 45, 1415, 3647, 7811, 14015}}, {1263, 14, 1698, {1, 1, 1, 1, 29, 27, 93, 121, 169, 69, 1361, 2907, 1867, 7017}}, {1264, 14, 1703, {1, 3, 1, 7, 23, 53, 77, 41, 25, 873, 1333, 3889, 3239, 1771}}, {1265, 14, 1704, {1, 1, 1, 7, 31, 27, 87, 81, 167, 343, 1981, 2499, 7749, 15747}}, {1266, 14, 1722, {1, 3, 5, 13, 1, 17, 97, 37, 81, 645, 1167, 3547, 7769, 10731}}, {1267, 14, 1735, {1, 1, 7, 5, 9, 17, 31, 55, 151, 463, 1041, 2303, 4015, 3737}}, {1268, 14, 1750, {1, 1, 3, 11, 31, 9, 81, 213, 95, 215, 2031, 2129, 4299, 3021}}, {1269, 14, 1753, {1, 1, 1, 3, 25, 25, 115, 229, 101, 441, 783, 1729, 7905, 2375}}, {1270, 14, 1760, {1, 1, 5, 9, 3, 19, 73, 35, 379, 493, 1333, 1647, 13, 197}}, {1271, 14, 1789, {1, 1, 7, 9, 3, 55, 99, 43, 281, 9, 73, 2477, 8183, 11055}}, {1272, 14, 1792, {1, 3, 7, 13, 25, 19, 27, 195, 469, 175, 355, 1861, 7255, 15377}}, {1273, 14, 1802, {1, 1, 3, 11, 15, 19, 115, 31, 413, 835, 697, 879, 6515, 13465}}, {1274, 14, 1819, {1, 3, 3, 15, 3, 61, 105, 201, 151, 739, 49, 3963, 2573, 3303}}, {1275, 14, 1825, {1, 3, 5, 7, 23, 5, 11, 215, 19, 591, 509, 2887, 1631, 4391}}, {1276, 14, 1828, {1, 3, 3, 3, 25, 1, 109, 5, 363, 545, 1745, 503, 827, 4677}}, {1277, 14, 1832, {1, 1, 3, 15, 1, 45, 121, 141, 497, 745, 1825, 2041, 2561, 8153}}, {1278, 14, 1845, {1, 3, 1, 11, 29, 7, 71, 241, 7, 39, 1379, 2479, 7483, 7195}}, {1279, 14, 1846, {1, 1, 7, 11, 3, 27, 39, 97, 339, 217, 1409, 1569, 4761, 1567}}, {1280, 14, 1857, {1, 1, 5, 15, 11, 53, 87, 213, 297, 923, 393, 717, 3297, 16123}}, {1281, 14, 1869, {1, 1, 1, 11, 27, 41, 121, 49, 225, 379, 1305, 319, 2461, 5445}}, {1282, 14, 1897, {1, 1, 5, 5, 25, 3, 121, 23, 47, 843, 1679, 1427, 6393, 4199}}, {1283, 14, 1906, {1, 1, 5, 13, 17, 3, 17, 25, 161, 487, 121, 361, 1375, 10745}}, {1284, 14, 1908, {1, 1, 7, 3, 3, 37, 7, 245, 107, 107, 745, 2415, 2131, 11419}}, {1285, 14, 1911, {1, 1, 5, 3, 3, 23, 67, 91, 281, 387, 465, 905, 883, 9775}}, {1286, 14, 1934, {1, 3, 7, 15, 25, 55, 123, 49, 23, 983, 1903, 2589, 2073, 7823}}, {1287, 14, 1962, {1, 1, 5, 11, 25, 17, 63, 229, 267, 175, 1759, 1947, 479, 11089}}, {1288, 14, 1967, {1, 3, 7, 3, 11, 37, 83, 95, 415, 1003, 1175, 2361, 2117, 9809}}, {1289, 14, 1972, {1, 3, 1, 9, 5, 39, 51, 129, 249, 161, 1981, 2755, 8057, 13641}}, {1290, 14, 1975, {1, 1, 7, 1, 15, 47, 9, 197, 199, 549, 1091, 2853, 2331, 4535}}, {1291, 14, 1999, {1, 3, 3, 13, 15, 21, 23, 111, 463, 719, 1667, 377, 5039, 10723}}, {1292, 14, 2004, {1, 1, 3, 7, 23, 47, 39, 47, 307, 949, 1651, 2525, 5835, 1425}}, {1293, 14, 2011, {1, 3, 3, 9, 23, 47, 111, 39, 251, 1001, 179, 3985, 535, 15435}}, {1294, 14, 2013, {1, 1, 3, 13, 5, 45, 51, 123, 205, 651, 1583, 1691, 1631, 11975}}, {1295, 14, 2037, {1, 1, 7, 9, 1, 29, 59, 27, 389, 497, 1459, 1633, 521, 14037}}, {1296, 14, 2051, {1, 1, 3, 3, 3, 23, 35, 247, 371, 729, 931, 681, 1777, 8353}}, {1297, 14, 2063, {1, 3, 3, 1, 19, 15, 17, 191, 495, 643, 319, 37, 5691, 7049}}, {1298, 14, 2066, {1, 3, 5, 11, 5, 31, 123, 243, 335, 573, 113, 209, 4825, 7783}}, {1299, 14, 2094, {1, 3, 7, 7, 29, 19, 25, 191, 89, 515, 55, 3013, 4523, 12913}}, {1300, 14, 2128, {1, 1, 3, 3, 15, 3, 35, 37, 339, 7, 697, 359, 4553, 1431}}, {1301, 14, 2154, {1, 3, 1, 1, 9, 15, 33, 77, 161, 13, 255, 1187, 6587, 11715}}, {1302, 14, 2164, {1, 3, 7, 7, 25, 57, 61, 171, 231, 43, 1219, 903, 5623, 4781}}, {1303, 14, 2198, {1, 1, 5, 15, 29, 47, 117, 23, 213, 907, 1423, 369, 4529, 9651}}, {1304, 14, 2217, {1, 1, 5, 7, 15, 55, 105, 249, 401, 37, 1885, 3779, 3441, 9057}}, {1305, 14, 2220, {1, 1, 5, 3, 3, 27, 49, 89, 335, 561, 1235, 3251, 2731, 12711}}, {1306, 14, 2223, {1, 1, 1, 15, 29, 49, 37, 173, 25, 743, 1321, 821, 5899, 9213}}, {1307, 14, 2238, {1, 1, 7, 3, 1, 41, 61, 209, 275, 925, 521, 3029, 1569, 9277}}, {1308, 14, 2245, {1, 3, 5, 13, 17, 1, 11, 171, 441, 119, 1589, 299, 157, 11439}}, {1309, 14, 2252, {1, 1, 5, 9, 13, 33, 27, 77, 363, 939, 1103, 2135, 1759, 5429}}, {1310, 14, 2258, {1, 3, 7, 1, 17, 39, 49, 201, 49, 803, 2003, 1193, 7415, 13847}}, {1311, 14, 2264, {1, 1, 5, 5, 17, 49, 39, 19, 311, 801, 1441, 3263, 7973, 14181}}, {1312, 14, 2280, {1, 1, 3, 9, 9, 27, 59, 89, 81, 473, 1369, 3121, 7929, 10905}}, {1313, 14, 2285, {1, 3, 3, 5, 17, 35, 35, 239, 379, 431, 501, 3561, 2059, 9679}}, {1314, 14, 2293, {1, 3, 5, 15, 25, 29, 113, 179, 269, 891, 301, 2017, 7513, 9379}}, {1315, 14, 2294, {1, 3, 1, 11, 17, 35, 49, 149, 135, 661, 1691, 3169, 3765, 9003}}, {1316, 14, 2298, {1, 3, 7, 15, 5, 21, 53, 241, 475, 271, 683, 2351, 2181, 6333}}, {1317, 14, 2303, {1, 1, 7, 13, 25, 33, 71, 153, 221, 507, 2017, 2401, 7545, 8489}}, {1318, 14, 2306, {1, 1, 7, 5, 1, 49, 87, 1, 179, 331, 1597, 3713, 809, 11109}}, {1319, 14, 2311, {1, 3, 1, 5, 5, 61, 93, 39, 479, 977, 1099, 1291, 7049, 2797}}, {1320, 14, 2326, {1, 3, 1, 13, 19, 41, 57, 77, 5, 117, 125, 115, 3969, 1345}}, {1321, 14, 2354, {1, 1, 1, 9, 15, 9, 57, 7, 219, 41, 767, 23, 5771, 14175}}, {1322, 14, 2373, {1, 3, 7, 9, 17, 61, 1, 59, 227, 349, 63, 189, 3871, 7919}}, {1323, 14, 2380, {1, 3, 5, 5, 9, 29, 33, 203, 413, 701, 1129, 2103, 1889, 8377}}, {1324, 14, 2385, {1, 1, 3, 1, 9, 17, 69, 115, 123, 1001, 1, 2893, 3957, 8593}}, {1325, 14, 2392, {1, 1, 3, 1, 31, 41, 83, 91, 113, 195, 1121, 2665, 6815, 1189}}, {1326, 14, 2401, {1, 1, 1, 13, 3, 59, 13, 123, 95, 103, 1689, 2809, 5049, 4055}}, {1327, 14, 2402, {1, 1, 1, 15, 21, 41, 11, 167, 375, 589, 207, 1631, 1597, 8091}}, {1328, 14, 2408, {1, 3, 5, 5, 1, 33, 57, 89, 157, 921, 1353, 2777, 461, 14567}}, {1329, 14, 2419, {1, 1, 5, 1, 25, 5, 51, 247, 1, 577, 463, 3741, 303, 16059}}, {1330, 14, 2450, {1, 1, 7, 5, 13, 7, 17, 87, 51, 987, 835, 93, 5203, 3973}}, {1331, 14, 2452, {1, 1, 7, 7, 3, 27, 7, 1, 135, 171, 231, 3349, 4459, 2925}}, {1332, 14, 2477, {1, 1, 5, 5, 9, 51, 71, 153, 115, 315, 265, 2207, 4127, 12631}}, {1333, 14, 2509, {1, 1, 3, 15, 23, 59, 35, 121, 425, 921, 1255, 2123, 5811, 15937}}, {1334, 14, 2510, {1, 3, 7, 7, 11, 21, 45, 57, 269, 395, 555, 783, 6677, 2889}}, {1335, 14, 2515, {1, 3, 5, 7, 31, 19, 73, 35, 465, 349, 1429, 863, 4707, 6121}}, {1336, 14, 2524, {1, 3, 3, 9, 25, 27, 119, 159, 195, 949, 19, 73, 4511, 15711}}, {1337, 14, 2527, {1, 3, 3, 7, 9, 59, 47, 57, 91, 749, 1579, 1297, 2445, 5167}}, {1338, 14, 2531, {1, 3, 3, 3, 31, 57, 19, 203, 61, 927, 1477, 2863, 1305, 11673}}, {1339, 14, 2552, {1, 3, 7, 11, 29, 13, 3, 111, 351, 79, 1863, 2213, 3273, 7049}}, {1340, 14, 2561, {1, 3, 3, 9, 7, 23, 47, 237, 121, 877, 441, 119, 2723, 3989}}, {1341, 14, 2567, {1, 3, 3, 11, 17, 23, 63, 177, 231, 363, 1451, 33, 2169, 7251}}, {1342, 14, 2571, {1, 1, 5, 11, 31, 41, 93, 229, 39, 1009, 1061, 433, 2393, 15401}}, {1343, 14, 2586, {1, 1, 5, 15, 31, 37, 25, 135, 135, 897, 33, 3713, 7663, 8079}}, {1344, 14, 2588, {1, 1, 5, 7, 17, 49, 43, 89, 411, 731, 1431, 3893, 1635, 7063}}, {1345, 14, 2595, {1, 1, 1, 13, 29, 27, 5, 77, 283, 913, 789, 817, 3309, 475}}, {1346, 14, 2607, {1, 1, 3, 1, 19, 21, 67, 77, 423, 551, 5, 1057, 5469, 7859}}, {1347, 14, 2621, {1, 1, 5, 1, 1, 21, 99, 237, 215, 759, 1505, 1983, 1517, 8923}}, {1348, 14, 2630, {1, 3, 5, 7, 19, 61, 73, 215, 165, 127, 205, 259, 7755, 15395}}, {1349, 14, 2639, {1, 1, 5, 9, 15, 23, 17, 111, 471, 751, 1923, 775, 6901, 13095}}, {1350, 14, 2653, {1, 1, 7, 1, 25, 5, 63, 141, 461, 687, 1589, 1559, 7719, 11349}}, {1351, 14, 2670, {1, 1, 1, 3, 11, 63, 11, 27, 253, 439, 297, 1315, 829, 3765}}, {1352, 14, 2672, {1, 3, 1, 1, 9, 47, 127, 179, 173, 809, 241, 35, 7355, 5049}}, {1353, 14, 2700, {1, 3, 1, 11, 19, 63, 93, 1, 205, 977, 303, 3409, 6529, 10927}}, {1354, 14, 2711, {1, 3, 7, 9, 31, 63, 41, 79, 477, 91, 1801, 3487, 6885, 13341}}, {1355, 14, 2715, {1, 1, 3, 7, 15, 59, 9, 101, 459, 247, 549, 2855, 5765, 7785}}, {1356, 14, 2748, {1, 1, 7, 3, 13, 59, 71, 123, 93, 517, 1453, 2389, 4429, 5053}}, {1357, 14, 2751, {1, 1, 5, 3, 19, 21, 77, 53, 81, 879, 1653, 1637, 3667, 2623}}, {1358, 14, 2753, {1, 1, 1, 15, 17, 57, 65, 53, 407, 765, 417, 497, 5009, 2175}}, {1359, 14, 2754, {1, 3, 3, 7, 31, 13, 5, 203, 263, 17, 119, 1607, 6773, 11195}}, {1360, 14, 2760, {1, 3, 3, 13, 19, 13, 13, 147, 93, 735, 689, 781, 655, 6853}}, {1361, 14, 2774, {1, 1, 1, 1, 1, 25, 63, 159, 493, 987, 71, 1249, 5859, 11717}}, {1362, 14, 2784, {1, 1, 1, 15, 13, 23, 61, 61, 5, 947, 1853, 3331, 467, 8081}}, {1363, 14, 2793, {1, 1, 3, 9, 19, 61, 65, 189, 95, 309, 283, 1725, 5683, 15463}}, {1364, 14, 2804, {1, 1, 7, 5, 9, 33, 35, 75, 475, 831, 1445, 1485, 5047, 9631}}, {1365, 14, 2811, {1, 1, 3, 15, 11, 23, 59, 87, 433, 221, 685, 3113, 4095, 13819}}, {1366, 14, 2822, {1, 1, 7, 15, 25, 29, 67, 17, 349, 353, 1321, 563, 57, 533}}, {1367, 14, 2826, {1, 3, 3, 3, 5, 43, 109, 217, 15, 185, 1895, 1015, 1831, 10623}}, {1368, 14, 2836, {1, 1, 7, 1, 1, 47, 81, 185, 59, 691, 191, 3709, 1535, 13347}}, {1369, 14, 2839, {1, 1, 5, 1, 23, 57, 83, 217, 457, 771, 1877, 2789, 8143, 4797}}, {1370, 14, 2840, {1, 1, 3, 7, 23, 35, 79, 49, 227, 205, 1523, 3873, 4843, 10505}}, {1371, 14, 2893, {1, 1, 1, 1, 17, 43, 121, 95, 205, 35, 189, 2061, 1693, 13273}}, {1372, 14, 2901, {1, 1, 1, 15, 31, 49, 83, 249, 433, 497, 1949, 1845, 5215, 5971}}, {1373, 14, 2902, {1, 3, 1, 1, 21, 53, 73, 211, 265, 929, 923, 279, 3621, 9469}}, {1374, 14, 2905, {1, 3, 7, 7, 1, 57, 13, 45, 467, 705, 371, 1345, 1647, 3411}}, {1375, 14, 2912, {1, 3, 1, 11, 27, 29, 117, 163, 143, 669, 489, 3913, 7891, 9031}}, {1376, 14, 2915, {1, 3, 7, 15, 27, 15, 77, 217, 107, 839, 1517, 1543, 357, 10365}}, {1377, 14, 2918, {1, 1, 1, 5, 31, 17, 107, 245, 345, 939, 1453, 3645, 6865, 16173}}, {1378, 14, 2939, {1, 3, 5, 5, 9, 61, 43, 97, 453, 917, 945, 2143, 5473, 5611}}, {1379, 14, 2965, {1, 1, 5, 11, 3, 33, 71, 97, 137, 549, 1605, 3839, 4883, 2677}}, {1380, 14, 2966, {1, 3, 1, 11, 29, 23, 85, 47, 225, 633, 1613, 1297, 1415, 15813}}, {1381, 14, 2975, {1, 1, 3, 3, 9, 19, 57, 107, 79, 449, 1951, 753, 6317, 10377}}, {1382, 14, 2988, {1, 1, 1, 5, 21, 3, 39, 187, 299, 517, 1313, 741, 7259, 4197}}, {1383, 14, 2993, {1, 1, 5, 13, 1, 39, 39, 41, 381, 123, 1257, 3185, 493, 3723}}, {1384, 14, 3006, {1, 3, 7, 7, 3, 37, 15, 161, 129, 169, 555, 3605, 4287, 15831}}, {1385, 14, 3017, {1, 3, 7, 15, 15, 23, 81, 163, 257, 791, 505, 1903, 2703, 11919}}, {1386, 14, 3031, {1, 3, 7, 7, 27, 63, 17, 147, 111, 851, 1533, 1365, 5359, 3315}}, {1387, 14, 3038, {1, 3, 7, 1, 15, 5, 61, 143, 385, 261, 1019, 1705, 1737, 14485}}, {1388, 14, 3041, {1, 3, 5, 5, 25, 17, 49, 229, 431, 567, 1613, 3431, 2139, 2981}}, {1389, 14, 3042, {1, 3, 5, 11, 17, 57, 71, 241, 31, 1007, 1695, 2965, 149, 14125}}, {1390, 14, 3051, {1, 1, 3, 11, 7, 49, 39, 101, 5, 501, 1491, 3061, 225, 12255}}, {1391, 14, 3073, {1, 3, 5, 7, 17, 35, 37, 97, 415, 15, 1349, 997, 2949, 4511}}, {1392, 14, 3088, {1, 3, 1, 5, 25, 35, 99, 183, 161, 59, 1363, 515, 3767, 3641}}, {1393, 14, 3097, {1, 1, 7, 15, 7, 15, 127, 137, 281, 67, 139, 2315, 3517, 13371}}, {1394, 14, 3098, {1, 1, 5, 15, 23, 49, 19, 79, 425, 805, 1035, 429, 7707, 14195}}, {1395, 14, 3103, {1, 3, 5, 3, 21, 25, 123, 11, 425, 475, 961, 2995, 7405, 5449}}, {1396, 14, 3104, {1, 1, 7, 1, 21, 1, 75, 231, 451, 595, 719, 2369, 5907, 1227}}, {1397, 14, 3146, {1, 1, 1, 9, 21, 57, 45, 255, 19, 79, 481, 3363, 3451, 8399}}, {1398, 14, 3148, {1, 1, 7, 13, 31, 49, 95, 69, 483, 427, 37, 4047, 7057, 9111}}, {1399, 14, 3153, {1, 3, 3, 11, 3, 61, 87, 79, 499, 91, 771, 1987, 2017, 3381}}, {1400, 14, 3159, {1, 3, 1, 7, 5, 57, 1, 121, 155, 225, 501, 477, 6555, 9863}}, {1401, 14, 3182, {1, 3, 7, 11, 27, 49, 83, 213, 61, 283, 1599, 3205, 2525, 8553}}, {1402, 14, 3187, {1, 1, 1, 9, 9, 49, 3, 51, 141, 33, 301, 2167, 587, 15067}}, {1403, 14, 3189, {1, 1, 1, 11, 7, 55, 99, 81, 191, 553, 953, 3753, 6731, 1093}}, {1404, 14, 3199, {1, 1, 3, 3, 11, 59, 57, 235, 297, 197, 853, 1411, 3799, 7527}}, {1405, 14, 3239, {1, 3, 5, 3, 7, 7, 5, 201, 393, 95, 91, 3273, 6285, 10661}}, {1406, 14, 3263, {1, 1, 5, 7, 17, 57, 87, 3, 413, 915, 659, 369, 3593, 14429}}, {1407, 14, 3271, {1, 3, 7, 1, 31, 31, 45, 115, 417, 427, 745, 4087, 953, 1119}}, {1408, 14, 3275, {1, 3, 7, 3, 29, 43, 45, 221, 41, 641, 451, 173, 2999, 12103}}, {1409, 14, 3278, {1, 1, 3, 11, 25, 57, 117, 201, 135, 787, 1525, 3879, 3247, 8907}}, {1410, 14, 3280, {1, 1, 7, 11, 3, 35, 69, 157, 331, 615, 573, 2169, 3575, 289}}, {1411, 14, 3283, {1, 3, 3, 13, 15, 51, 67, 127, 265, 495, 103, 3145, 2685, 15919}}, {1412, 14, 3290, {1, 3, 5, 11, 31, 27, 65, 57, 153, 465, 1163, 467, 4103, 4713}}, {1413, 14, 3311, {1, 3, 7, 3, 23, 31, 9, 51, 239, 417, 1597, 229, 2865, 15199}}, {1414, 14, 3316, {1, 3, 5, 3, 11, 45, 123, 217, 31, 765, 1009, 2001, 3645, 9407}}, {1415, 14, 3343, {1, 3, 3, 9, 5, 23, 117, 83, 237, 1017, 251, 1187, 2631, 5151}}, {1416, 14, 3346, {1, 1, 1, 7, 23, 55, 97, 141, 501, 305, 467, 4061, 2369, 15973}}, {1417, 14, 3357, {1, 1, 7, 5, 31, 51, 125, 191, 219, 495, 37, 3337, 813, 241}}, {1418, 14, 3358, {1, 3, 1, 1, 11, 39, 93, 109, 285, 147, 1297, 737, 4051, 7223}}, {1419, 14, 3361, {1, 3, 1, 15, 13, 17, 57, 171, 463, 163, 609, 1681, 7583, 9231}}, {1420, 14, 3362, {1, 3, 1, 1, 23, 5, 51, 5, 205, 415, 419, 989, 4239, 10943}}, {1421, 14, 3364, {1, 1, 3, 15, 3, 13, 65, 145, 387, 59, 395, 1067, 4143, 5649}}, {1422, 14, 3386, {1, 3, 1, 13, 9, 59, 121, 127, 95, 71, 1541, 1423, 1753, 8041}}, {1423, 14, 3418, {1, 1, 3, 15, 7, 5, 69, 167, 181, 991, 1189, 4017, 5935, 6669}}, {1424, 14, 3424, {1, 3, 5, 7, 23, 41, 53, 21, 47, 261, 1231, 2011, 133, 2247}}, {1425, 14, 3433, {1, 1, 1, 5, 17, 47, 77, 19, 331, 609, 1893, 3965, 3123, 9093}}, {1426, 14, 3434, {1, 3, 1, 3, 9, 39, 103, 231, 249, 75, 373, 107, 1823, 10801}}, {1427, 14, 3436, {1, 3, 3, 7, 1, 51, 35, 111, 137, 879, 1221, 225, 4285, 2287}}, {1428, 14, 3463, {1, 1, 7, 9, 23, 17, 75, 245, 409, 163, 395, 3731, 7111, 6845}}, {1429, 14, 3467, {1, 1, 3, 13, 29, 47, 75, 153, 497, 621, 1691, 3187, 2125, 10533}}, {1430, 14, 3477, {1, 1, 7, 7, 9, 7, 55, 159, 255, 417, 1335, 643, 3843, 3733}}, {1431, 14, 3484, {1, 3, 3, 1, 21, 41, 7, 21, 5, 679, 1655, 95, 5699, 5785}}, {1432, 14, 3505, {1, 1, 1, 13, 19, 7, 85, 7, 195, 357, 1097, 2893, 2913, 9635}}, {1433, 14, 3508, {1, 1, 5, 9, 25, 33, 41, 155, 39, 655, 1993, 3117, 3639, 7977}}, {1434, 14, 3515, {1, 1, 1, 13, 3, 63, 121, 247, 151, 673, 609, 285, 2299, 7663}}, {1435, 14, 3532, {1, 3, 7, 11, 17, 13, 49, 253, 245, 21, 273, 993, 911, 863}}, {1436, 14, 3553, {1, 1, 5, 5, 23, 1, 121, 95, 225, 9, 1237, 1183, 6461, 559}}, {1437, 14, 3554, {1, 3, 7, 13, 3, 7, 121, 151, 233, 561, 281, 3583, 897, 1767}}, {1438, 14, 3568, {1, 1, 7, 7, 9, 47, 107, 41, 25, 569, 1697, 2299, 6231, 12209}}, {1439, 14, 3573, {1, 3, 7, 7, 27, 43, 59, 37, 31, 51, 503, 149, 4043, 11847}}, {1440, 14, 3587, {1, 3, 3, 11, 5, 1, 119, 181, 47, 641, 685, 4017, 637, 16251}}, {1441, 14, 3589, {1, 3, 3, 7, 11, 1, 101, 7, 239, 747, 307, 1721, 5979, 4367}}, {1442, 14, 3596, {1, 3, 5, 7, 1, 63, 19, 151, 469, 333, 1587, 2453, 897, 4711}}, {1443, 14, 3608, {1, 3, 1, 5, 11, 61, 21, 253, 91, 993, 1347, 1993, 5607, 13031}}, {1444, 14, 3620, {1, 3, 5, 5, 1, 39, 65, 71, 189, 389, 1437, 1055, 6439, 3989}}, {1445, 14, 3630, {1, 1, 3, 3, 19, 15, 93, 3, 339, 165, 1675, 3953, 2145, 12113}}, {1446, 14, 3644, {1, 1, 3, 13, 13, 45, 5, 175, 211, 993, 705, 2761, 3023, 13633}}, {1447, 14, 3649, {1, 1, 3, 1, 19, 39, 121, 29, 287, 87, 281, 3491, 7107, 13007}}, {1448, 14, 3664, {1, 1, 7, 1, 29, 49, 103, 187, 39, 923, 51, 1533, 3249, 4399}}, {1449, 14, 3679, {1, 1, 5, 5, 5, 43, 25, 107, 453, 955, 115, 57, 4589, 14573}}, {1450, 14, 3680, {1, 1, 3, 5, 21, 45, 103, 99, 183, 987, 1207, 1697, 8033, 13703}}, {1451, 14, 3685, {1, 1, 5, 7, 11, 23, 9, 17, 261, 749, 1957, 935, 6283, 8625}}, {1452, 14, 3686, {1, 1, 1, 9, 9, 51, 69, 225, 265, 323, 1161, 2993, 7305, 2249}}, {1453, 14, 3698, {1, 3, 1, 9, 23, 19, 57, 205, 503, 489, 1499, 3277, 817, 11931}}, {1454, 14, 3714, {1, 3, 3, 5, 1, 7, 49, 1, 313, 123, 643, 2027, 1469, 3585}}, {1455, 14, 3726, {1, 3, 7, 11, 27, 47, 95, 111, 27, 213, 465, 3693, 3661, 7531}}, {1456, 14, 3737, {1, 1, 7, 9, 3, 37, 115, 189, 31, 613, 1393, 1229, 4767, 12425}}, {1457, 14, 3767, {1, 1, 3, 3, 25, 17, 99, 47, 161, 931, 959, 1293, 7095, 8325}}, {1458, 14, 3782, {1, 1, 1, 7, 23, 9, 11, 51, 205, 419, 479, 1497, 2493, 13921}}, {1459, 14, 3786, {1, 3, 1, 9, 17, 29, 51, 79, 159, 435, 477, 413, 3815, 5589}}, {1460, 14, 3793, {1, 3, 7, 5, 7, 23, 99, 43, 169, 665, 403, 1163, 4337, 1335}}, {1461, 14, 3796, {1, 3, 1, 5, 25, 27, 125, 249, 421, 267, 1259, 4089, 59, 9377}}, {1462, 14, 3805, {1, 3, 3, 1, 27, 37, 91, 17, 123, 597, 1749, 3449, 6503, 11043}}, {1463, 14, 3815, {1, 3, 7, 7, 23, 41, 19, 245, 109, 569, 547, 1917, 7943, 2697}}, {1464, 14, 3841, {1, 3, 7, 7, 9, 1, 123, 105, 329, 435, 2013, 2745, 347, 11045}}, {1465, 14, 3847, {1, 1, 1, 13, 29, 53, 51, 67, 105, 89, 1887, 3543, 963, 8159}}, {1466, 14, 3853, {1, 1, 5, 3, 5, 27, 41, 67, 67, 883, 973, 1785, 901, 14969}}, {1467, 14, 3862, {1, 3, 3, 13, 17, 11, 117, 115, 163, 939, 79, 641, 4365, 2267}}, {1468, 14, 3875, {1, 1, 3, 3, 9, 5, 41, 123, 149, 9, 1533, 3939, 5995, 12701}}, {1469, 14, 3902, {1, 1, 1, 15, 31, 1, 101, 229, 191, 965, 61, 2671, 4177, 15779}}, {1470, 14, 3904, {1, 1, 5, 15, 1, 25, 49, 185, 33, 697, 1043, 2639, 7819, 3171}}, {1471, 14, 3916, {1, 3, 5, 13, 19, 9, 111, 49, 47, 847, 1865, 717, 5287, 13417}}, {1472, 14, 3947, {1, 3, 7, 11, 5, 61, 63, 111, 171, 735, 2003, 73, 5701, 647}}, {1473, 14, 3949, {1, 3, 1, 11, 1, 49, 121, 79, 431, 671, 1241, 1161, 2057, 263}}, {1474, 14, 3955, {1, 3, 3, 1, 1, 23, 75, 15, 117, 641, 313, 1525, 2041, 1409}}, {1475, 14, 3962, {1, 3, 5, 11, 15, 57, 13, 67, 139, 131, 1339, 2419, 7945, 11877}}, {1476, 14, 3971, {1, 3, 1, 1, 19, 39, 97, 83, 297, 595, 1611, 5, 4753, 3435}}, {1477, 14, 3980, {1, 3, 1, 9, 7, 49, 125, 101, 383, 717, 63, 2295, 3873, 13461}}, {1478, 14, 3985, {1, 1, 3, 3, 15, 29, 89, 77, 269, 689, 229, 1207, 7311, 8663}}, {1479, 14, 3998, {1, 1, 1, 1, 1, 61, 25, 255, 203, 233, 271, 987, 2277, 8735}}, {1480, 14, 4001, {1, 1, 5, 7, 21, 27, 63, 79, 337, 133, 1453, 3633, 6157, 15875}}, {1481, 14, 4002, {1, 3, 1, 7, 7, 55, 31, 81, 203, 709, 1743, 1677, 4247, 11411}}, {1482, 14, 4016, {1, 1, 3, 3, 29, 51, 37, 17, 487, 325, 1393, 1433, 3467, 2851}}, {1483, 14, 4021, {1, 1, 7, 9, 3, 41, 99, 177, 241, 869, 739, 2729, 4585, 14801}}, {1484, 14, 4026, {1, 1, 3, 1, 9, 43, 97, 65, 99, 295, 1693, 2083, 3241, 4073}}, {1485, 14, 4043, {1, 1, 1, 9, 5, 39, 67, 119, 235, 543, 795, 2773, 3195, 6273}}, {1486, 14, 4079, {1, 1, 5, 5, 21, 41, 89, 1, 85, 81, 57, 2951, 1531, 10101}}, {1487, 14, 4102, {1, 1, 1, 7, 3, 35, 127, 69, 39, 265, 1643, 2973, 267, 12365}}, {1488, 14, 4106, {1, 3, 1, 1, 21, 57, 99, 205, 119, 477, 1771, 1989, 2761, 12573}}, {1489, 14, 4119, {1, 1, 3, 13, 1, 59, 93, 125, 279, 935, 1877, 2061, 4845, 7835}}, {1490, 14, 4126, {1, 1, 7, 9, 7, 45, 69, 99, 273, 35, 1579, 2137, 7175, 6999}}, {1491, 14, 4147, {1, 1, 7, 7, 29, 21, 127, 91, 9, 383, 787, 1783, 601, 5047}}, {1492, 14, 4149, {1, 1, 7, 13, 7, 29, 35, 219, 43, 581, 2043, 2211, 6169, 12173}}, {1493, 14, 4164, {1, 3, 5, 13, 29, 29, 39, 63, 411, 645, 415, 2383, 1989, 11411}}, {1494, 14, 4174, {1, 1, 7, 9, 15, 9, 87, 95, 321, 709, 543, 3831, 2453, 4167}}, {1495, 14, 4181, {1, 3, 1, 5, 31, 25, 5, 85, 239, 487, 1613, 3937, 4661, 3535}}, {1496, 14, 4185, {1, 3, 5, 11, 27, 41, 3, 201, 39, 91, 1997, 237, 5639, 14703}}, {1497, 14, 4188, {1, 1, 7, 3, 27, 49, 87, 71, 473, 247, 1007, 47, 475, 5413}}, {1498, 14, 4202, {1, 3, 7, 15, 9, 57, 81, 149, 287, 333, 1911, 3417, 1081, 8995}}, {1499, 14, 4228, {1, 1, 5, 1, 3, 63, 43, 151, 97, 431, 961, 1019, 5153, 2407}}, {1500, 14, 4232, {1, 1, 5, 5, 27, 21, 127, 161, 507, 311, 129, 3489, 1133, 3241}}, {1501, 14, 4246, {1, 3, 7, 15, 21, 33, 117, 83, 497, 667, 1399, 931, 1695, 8171}}, {1502, 14, 4252, {1, 1, 1, 13, 3, 39, 53, 27, 193, 993, 671, 1871, 7579, 11457}}, {1503, 14, 4256, {1, 1, 5, 11, 7, 39, 81, 107, 195, 387, 849, 395, 1317, 6487}}, {1504, 14, 4286, {1, 3, 3, 3, 3, 15, 45, 127, 279, 111, 331, 357, 4637, 4697}}, {1505, 14, 4303, {1, 1, 3, 9, 21, 49, 47, 97, 61, 101, 181, 1867, 1201, 14099}}, {1506, 14, 4306, {1, 1, 5, 11, 25, 19, 51, 51, 101, 451, 545, 101, 7497, 9141}}, {1507, 14, 4311, {1, 1, 1, 3, 13, 53, 119, 81, 377, 245, 765, 251, 3757, 16045}}, {1508, 14, 4317, {1, 1, 1, 3, 5, 61, 65, 37, 331, 925, 1439, 3219, 2843, 11397}}, {1509, 14, 4342, {1, 3, 5, 9, 23, 31, 95, 155, 83, 641, 1129, 135, 477, 1623}}, {1510, 14, 4346, {1, 1, 3, 9, 9, 61, 93, 11, 331, 585, 799, 1417, 1533, 463}}, {1511, 14, 4377, {1, 1, 7, 7, 21, 51, 61, 29, 467, 935, 11, 3357, 1087, 12337}}, {1512, 14, 4401, {1, 3, 3, 11, 1, 39, 103, 153, 351, 893, 1823, 835, 2149, 4203}}, {1513, 14, 4407, {1, 1, 1, 9, 31, 13, 61, 235, 369, 359, 835, 2067, 2697, 15289}}, {1514, 14, 4414, {1, 1, 7, 1, 15, 1, 107, 27, 201, 451, 1521, 313, 3195, 3847}}, {1515, 14, 4422, {1, 1, 5, 13, 1, 27, 63, 137, 355, 489, 2039, 1015, 2519, 13797}}, {1516, 14, 4431, {1, 1, 7, 9, 29, 33, 23, 197, 49, 555, 1087, 3447, 7299, 15513}}, {1517, 14, 4434, {1, 3, 5, 11, 7, 37, 55, 63, 443, 573, 1715, 631, 3405, 6155}}, {1518, 14, 4436, {1, 3, 3, 3, 31, 35, 51, 167, 225, 617, 2007, 2555, 6819, 12709}}, {1519, 14, 4443, {1, 1, 1, 13, 15, 5, 73, 85, 109, 43, 1067, 3941, 1125, 10269}}, {1520, 14, 4459, {1, 1, 7, 11, 17, 3, 127, 145, 279, 19, 1007, 3287, 4751, 12507}}, {1521, 14, 4461, {1, 3, 7, 3, 19, 1, 117, 111, 193, 435, 47, 1801, 529, 8547}}, {1522, 14, 4462, {1, 3, 3, 13, 1, 19, 101, 19, 469, 187, 207, 1243, 8153, 3273}}, {1523, 14, 4473, {1, 3, 1, 5, 11, 51, 69, 189, 453, 775, 241, 3331, 4067, 14759}}, {1524, 14, 4497, {1, 1, 1, 1, 23, 55, 113, 133, 497, 731, 391, 2777, 3529, 955}}, {1525, 14, 4504, {1, 3, 1, 11, 5, 49, 59, 35, 261, 949, 325, 3595, 7433, 11099}}, {1526, 14, 4507, {1, 3, 5, 9, 13, 37, 103, 219, 329, 865, 1787, 2497, 7249, 9877}}, {1527, 14, 4525, {1, 3, 7, 9, 11, 33, 19, 255, 191, 935, 1115, 1901, 1577, 9623}}, {1528, 14, 4534, {1, 1, 5, 7, 29, 23, 77, 43, 283, 143, 1211, 73, 2835, 10235}}, {1529, 14, 4538, {1, 1, 7, 3, 3, 27, 35, 173, 453, 425, 1225, 3023, 2159, 8433}}, {1530, 14, 4548, {1, 1, 1, 5, 27, 21, 35, 25, 71, 145, 1545, 523, 4527, 7655}}, {1531, 14, 4552, {1, 1, 5, 3, 13, 49, 61, 157, 113, 775, 763, 1785, 225, 11851}}, {1532, 14, 4560, {1, 1, 3, 1, 31, 57, 97, 229, 291, 777, 213, 4067, 921, 8203}}, {1533, 14, 4575, {1, 1, 5, 1, 25, 13, 125, 123, 263, 207, 119, 3111, 3841, 843}}, {1534, 14, 4599, {1, 1, 7, 7, 25, 57, 81, 129, 31, 133, 1869, 2949, 5563, 14965}}, {1535, 14, 4612, {1, 3, 3, 7, 3, 51, 33, 127, 281, 425, 1253, 405, 7941, 8799}}, {1536, 14, 4619, {1, 1, 3, 9, 3, 63, 93, 173, 255, 609, 49, 111, 7785, 15865}}, {1537, 14, 4640, {1, 1, 1, 3, 17, 59, 113, 55, 155, 789, 1335, 177, 3071, 1851}}, {1538, 14, 4643, {1, 3, 7, 15, 15, 23, 35, 35, 131, 623, 47, 437, 1337, 9891}}, {1539, 14, 4677, {1, 3, 7, 5, 29, 57, 39, 31, 111, 271, 59, 1473, 949, 3899}}, {1540, 14, 4687, {1, 1, 3, 11, 17, 19, 41, 229, 259, 691, 1455, 3023, 7455, 9711}}, {1541, 14, 4723, {1, 3, 5, 11, 29, 13, 9, 165, 499, 355, 1415, 1395, 7595, 15571}}, {1542, 14, 4730, {1, 3, 1, 9, 5, 5, 25, 247, 185, 241, 1325, 3133, 7471, 2649}}, {1543, 14, 4736, {1, 3, 3, 11, 17, 29, 57, 61, 51, 203, 993, 1837, 3785, 15163}}, {1544, 14, 4741, {1, 1, 7, 7, 21, 57, 79, 165, 277, 133, 93, 1055, 7169, 15685}}, {1545, 14, 4763, {1, 1, 5, 3, 5, 17, 25, 177, 95, 323, 367, 1359, 4915, 6409}}, {1546, 14, 4765, {1, 1, 1, 1, 11, 25, 115, 45, 373, 221, 1483, 591, 6561, 4527}}, {1547, 14, 4770, {1, 3, 5, 3, 5, 23, 69, 77, 313, 473, 1037, 4045, 3969, 5445}}, {1548, 14, 4781, {1, 3, 1, 5, 1, 15, 73, 83, 439, 463, 203, 361, 6835, 1061}}, {1549, 14, 4808, {1, 1, 3, 11, 21, 5, 89, 233, 405, 253, 773, 3901, 6085, 5677}}, {1550, 14, 4822, {1, 1, 3, 9, 15, 53, 71, 29, 101, 599, 1073, 705, 4507, 12779}}, {1551, 14, 4828, {1, 1, 3, 1, 3, 9, 27, 97, 207, 859, 417, 735, 2179, 5071}}, {1552, 14, 4831, {1, 1, 1, 3, 13, 63, 65, 125, 195, 611, 649, 2221, 3143, 143}}, {1553, 14, 4842, {1, 3, 3, 15, 17, 57, 99, 119, 243, 407, 1229, 813, 5245, 1893}}, {1554, 14, 4855, {1, 1, 1, 5, 27, 27, 49, 13, 313, 287, 473, 2629, 3509, 11371}}, {1555, 14, 4859, {1, 1, 7, 7, 23, 3, 75, 59, 245, 689, 1215, 2375, 3325, 1593}}, {1556, 14, 4867, {1, 3, 1, 5, 21, 51, 43, 107, 91, 611, 1405, 677, 2087, 9565}}, {1557, 14, 4870, {1, 3, 7, 11, 9, 27, 81, 101, 449, 201, 1507, 2217, 6767, 8059}}, {1558, 14, 4881, {1, 1, 3, 9, 13, 41, 21, 195, 421, 315, 347, 2621, 2359, 9247}}, {1559, 14, 4893, {1, 1, 5, 7, 31, 45, 77, 229, 455, 575, 1087, 1147, 2273, 13773}}, {1560, 14, 4910, {1, 1, 1, 1, 9, 5, 87, 19, 207, 545, 1435, 495, 1299, 4947}}, {1561, 14, 4917, {1, 1, 3, 3, 15, 9, 63, 67, 219, 735, 1911, 2361, 6503, 11977}}, {1562, 14, 4929, {1, 3, 1, 9, 31, 27, 103, 153, 81, 939, 461, 2753, 697, 537}}, {1563, 14, 4939, {1, 3, 3, 9, 21, 53, 49, 211, 415, 817, 321, 3775, 2921, 9473}}, {1564, 14, 4947, {1, 1, 7, 3, 23, 55, 15, 51, 435, 1013, 73, 3967, 4575, 13099}}, {1565, 14, 4949, {1, 1, 3, 7, 5, 27, 43, 225, 267, 21, 1261, 603, 6913, 4421}}, {1566, 14, 4954, {1, 1, 7, 13, 25, 31, 101, 109, 237, 91, 1587, 1987, 2795, 6991}}, {1567, 14, 4972, {1, 1, 3, 13, 23, 51, 91, 89, 287, 39, 1513, 463, 6135, 10469}}, {1568, 14, 4975, {1, 3, 3, 1, 9, 43, 125, 157, 369, 495, 1849, 785, 6357, 6557}}, {1569, 14, 5000, {1, 3, 1, 13, 5, 25, 107, 139, 367, 239, 1671, 1239, 7027, 5291}}, {1570, 14, 5005, {1, 3, 5, 13, 11, 13, 35, 177, 45, 939, 251, 59, 333, 13105}}, {1571, 14, 5029, {1, 3, 5, 7, 29, 57, 109, 227, 435, 739, 423, 1941, 3345, 12731}}, {1572, 14, 5039, {1, 3, 3, 9, 23, 51, 19, 207, 69, 99, 955, 519, 7305, 2415}}, {1573, 14, 5044, {1, 1, 5, 13, 17, 1, 67, 201, 61, 403, 1059, 2915, 2419, 12773}}, {1574, 14, 5051, {1, 3, 1, 11, 17, 19, 25, 27, 207, 299, 143, 1955, 5669, 2301}}, {1575, 14, 5056, {1, 1, 5, 3, 25, 57, 45, 255, 489, 1011, 1699, 2637, 5279, 12211}}, {1576, 14, 5073, {1, 3, 3, 15, 7, 47, 113, 33, 511, 907, 1815, 1741, 2091, 13857}}, {1577, 14, 5096, {1, 3, 3, 5, 5, 27, 95, 3, 353, 253, 947, 393, 1815, 14551}}, {1578, 14, 5128, {1, 1, 5, 11, 29, 19, 63, 117, 293, 861, 2039, 9, 5999, 6909}}, {1579, 14, 5134, {1, 3, 7, 3, 15, 63, 107, 173, 509, 817, 99, 2825, 131, 7917}}, {1580, 14, 5161, {1, 3, 1, 1, 29, 49, 33, 153, 119, 777, 1315, 3581, 5675, 4043}}, {1581, 14, 5179, {1, 3, 5, 15, 13, 11, 17, 147, 327, 305, 367, 3237, 5423, 13757}}, {1582, 14, 5193, {1, 1, 5, 13, 1, 39, 35, 29, 25, 751, 1365, 2243, 8181, 7063}}, {1583, 14, 5199, {1, 3, 7, 11, 25, 53, 11, 111, 289, 755, 1201, 691, 3679, 3725}}, {1584, 14, 5202, {1, 1, 1, 11, 11, 37, 33, 211, 395, 691, 1817, 861, 6485, 12077}}, {1585, 14, 5204, {1, 3, 3, 11, 21, 3, 111, 171, 305, 561, 1501, 2011, 7841, 10931}}, {1586, 14, 5218, {1, 3, 7, 9, 9, 59, 109, 113, 31, 915, 103, 1861, 2779, 10619}}, {1587, 14, 5247, {1, 1, 1, 1, 7, 25, 61, 97, 103, 723, 1145, 3105, 371, 339}}, {1588, 14, 5260, {1, 1, 7, 13, 17, 9, 113, 51, 233, 209, 1117, 211, 6969, 2347}}, {1589, 14, 5271, {1, 1, 5, 9, 25, 43, 21, 217, 327, 735, 197, 1063, 799, 801}}, {1590, 14, 5301, {1, 1, 7, 13, 9, 13, 73, 33, 415, 923, 863, 1999, 5383, 8119}}, {1591, 14, 5305, {1, 3, 1, 5, 7, 33, 51, 185, 289, 967, 1277, 1011, 767, 15505}}, {1592, 14, 5319, {1, 3, 3, 13, 21, 11, 105, 235, 343, 1021, 2009, 2251, 3865, 6923}}, {1593, 14, 5326, {1, 3, 5, 9, 29, 11, 33, 17, 149, 155, 1739, 3039, 7015, 2401}}, {1594, 14, 5328, {1, 3, 7, 7, 17, 13, 89, 177, 297, 267, 545, 3861, 329, 13267}}, {1595, 14, 5333, {1, 3, 5, 15, 27, 33, 1, 231, 181, 557, 447, 379, 7845, 1295}}, {1596, 14, 5364, {1, 1, 5, 13, 3, 63, 59, 33, 263, 877, 1867, 1383, 641, 7139}}, {1597, 14, 5376, {1, 3, 7, 5, 13, 51, 9, 113, 223, 605, 1189, 4063, 6925, 9563}}, {1598, 14, 5399, {1, 1, 1, 13, 5, 35, 83, 107, 295, 231, 265, 5, 4087, 6407}}, {1599, 14, 5416, {1, 1, 5, 1, 7, 25, 95, 137, 97, 987, 1753, 2781, 1369, 6903}}, {1600, 14, 5421, {1, 1, 5, 13, 19, 61, 77, 229, 193, 165, 811, 249, 79, 10719}}, {1601, 14, 5427, {1, 3, 7, 7, 27, 9, 119, 193, 459, 43, 1989, 2959, 3595, 6341}}, {1602, 14, 5429, {1, 1, 5, 11, 5, 43, 35, 33, 25, 581, 897, 351, 4201, 3971}}, {1603, 14, 5430, {1, 1, 7, 11, 21, 29, 53, 45, 359, 197, 313, 3825, 6717, 4077}}, {1604, 14, 5434, {1, 1, 1, 15, 3, 45, 99, 133, 357, 315, 1159, 241, 2463, 11253}}, {1605, 14, 5441, {1, 1, 7, 11, 9, 33, 111, 85, 443, 601, 447, 337, 6471, 7029}}, {1606, 14, 5451, {1, 3, 7, 9, 13, 33, 25, 31, 9, 729, 1763, 4077, 7575, 7877}}, {1607, 14, 5465, {1, 3, 5, 13, 13, 37, 29, 103, 53, 229, 591, 1073, 1323, 14405}}, {1608, 14, 5466, {1, 1, 5, 1, 17, 33, 15, 183, 473, 297, 2003, 93, 4955, 1787}}, {1609, 14, 5471, {1, 1, 5, 13, 5, 29, 113, 161, 267, 451, 1193, 149, 273, 11809}}, {1610, 14, 5477, {1, 1, 1, 9, 17, 39, 47, 233, 165, 373, 955, 2891, 7523, 7235}}, {1611, 14, 5492, {1, 1, 1, 3, 7, 21, 115, 205, 153, 449, 339, 2073, 1077, 5749}}, {1612, 14, 5495, {1, 1, 7, 13, 9, 39, 117, 187, 37, 753, 227, 3519, 7391, 5751}}, {1613, 14, 5505, {1, 1, 1, 9, 5, 19, 41, 161, 141, 195, 1719, 3321, 5, 12877}}, {1614, 14, 5515, {1, 3, 7, 11, 21, 13, 83, 55, 299, 75, 1905, 3765, 4685, 12297}}, {1615, 14, 5525, {1, 1, 7, 3, 3, 23, 111, 243, 187, 297, 1061, 2515, 977, 9555}}, {1616, 14, 5529, {1, 3, 7, 3, 29, 11, 103, 177, 225, 875, 1649, 1401, 6383, 8309}}, {1617, 14, 5532, {1, 3, 5, 3, 3, 41, 71, 3, 373, 757, 701, 2825, 1521, 13217}}, {1618, 14, 5539, {1, 1, 5, 3, 11, 5, 103, 227, 209, 723, 1543, 3895, 6345, 7901}}, {1619, 14, 5541, {1, 1, 5, 1, 9, 51, 77, 67, 359, 937, 557, 993, 3871, 3577}}, {1620, 14, 5556, {1, 3, 7, 1, 1, 15, 121, 239, 29, 113, 1123, 3877, 6941, 14129}}, {1621, 14, 5566, {1, 1, 5, 1, 27, 61, 83, 113, 185, 601, 947, 3933, 381, 13869}}, {1622, 14, 5568, {1, 1, 5, 3, 5, 37, 97, 31, 81, 367, 747, 1811, 5313, 14151}}, {1623, 14, 5574, {1, 3, 5, 9, 27, 61, 87, 31, 185, 521, 837, 959, 5001, 3957}}, {1624, 14, 5595, {1, 3, 5, 3, 11, 61, 37, 19, 107, 749, 1345, 3829, 6701, 4315}}, {1625, 14, 5602, {1, 3, 1, 15, 13, 45, 101, 113, 243, 963, 1861, 3283, 1419, 12131}}, {1626, 14, 5611, {1, 1, 7, 1, 11, 63, 17, 117, 271, 819, 677, 669, 1991, 12511}}, {1627, 14, 5616, {1, 1, 1, 13, 13, 33, 41, 73, 187, 537, 993, 3147, 1013, 16063}}, {1628, 14, 5622, {1, 3, 1, 1, 25, 21, 107, 81, 117, 917, 113, 349, 4475, 9149}}, {1629, 14, 5628, {1, 1, 1, 11, 21, 21, 29, 251, 125, 681, 141, 2893, 5843, 14359}}, {1630, 14, 5655, {1, 3, 3, 1, 5, 41, 85, 163, 387, 29, 1593, 221, 2769, 10809}}, {1631, 14, 5662, {1, 3, 5, 11, 1, 17, 69, 127, 273, 449, 1855, 2971, 7031, 10583}}, {1632, 14, 5675, {1, 1, 5, 7, 1, 61, 9, 211, 123, 563, 111, 1883, 5801, 2191}}, {1633, 14, 5689, {1, 1, 3, 11, 11, 51, 1, 81, 405, 803, 2017, 161, 5429, 731}}, {1634, 14, 5722, {1, 1, 7, 9, 15, 55, 65, 51, 459, 485, 1539, 3135, 2929, 7867}}, {1635, 14, 5724, {1, 1, 7, 11, 3, 45, 15, 7, 331, 417, 1813, 4009, 1341, 10965}}, {1636, 14, 5728, {1, 1, 1, 5, 9, 29, 89, 121, 277, 509, 1989, 1293, 4787, 16097}}, {1637, 14, 5731, {1, 1, 3, 9, 17, 45, 97, 197, 339, 943, 1377, 2947, 5833, 7}}, {1638, 14, 5746, {1, 1, 7, 9, 15, 61, 75, 233, 401, 705, 825, 2521, 3787, 14387}}, {1639, 14, 5764, {1, 1, 7, 15, 25, 57, 3, 43, 361, 459, 1551, 1859, 6787, 2293}}, {1640, 14, 5771, {1, 3, 3, 11, 11, 35, 91, 65, 43, 509, 1829, 1149, 4801, 4109}}, {1641, 14, 5781, {1, 3, 5, 9, 15, 3, 81, 109, 231, 481, 417, 2505, 315, 6693}}, {1642, 14, 5801, {1, 1, 3, 9, 3, 7, 107, 221, 297, 543, 149, 579, 927, 79}}, {1643, 14, 5809, {1, 3, 1, 11, 17, 3, 81, 137, 157, 587, 741, 1277, 2631, 3953}}, {1644, 14, 5810, {1, 1, 7, 5, 13, 43, 117, 19, 495, 185, 1105, 605, 5249, 11099}}, {1645, 14, 5812, {1, 1, 7, 9, 23, 55, 91, 213, 21, 779, 857, 2047, 7813, 10053}}, {1646, 14, 5841, {1, 1, 1, 1, 27, 7, 39, 181, 63, 519, 1073, 3147, 4111, 363}}, {1647, 14, 5848, {1, 3, 7, 9, 15, 61, 7, 139, 495, 805, 1545, 3789, 2411, 3989}}, {1648, 14, 5853, {1, 1, 3, 1, 25, 11, 23, 241, 167, 607, 479, 153, 7787, 13929}}, {1649, 14, 5854, {1, 3, 5, 15, 29, 35, 45, 71, 457, 297, 883, 3021, 5361, 15427}}, {1650, 14, 5858, {1, 3, 1, 7, 29, 27, 93, 241, 427, 89, 1185, 37, 3863, 14095}}, {1651, 14, 5892, {1, 3, 1, 5, 5, 45, 51, 15, 235, 889, 1649, 2331, 2713, 10943}}, {1652, 14, 5907, {1, 1, 3, 11, 11, 15, 71, 85, 135, 163, 139, 1147, 1043, 3195}}, {1653, 14, 5910, {1, 3, 5, 13, 3, 43, 71, 131, 473, 933, 569, 2491, 7751, 1865}}, {1654, 14, 5913, {1, 1, 7, 9, 21, 37, 105, 227, 329, 509, 1319, 307, 1557, 14625}}, {1655, 14, 5920, {1, 1, 3, 13, 15, 1, 25, 93, 335, 953, 769, 4039, 369, 10727}}, {1656, 14, 5929, {1, 3, 7, 5, 17, 21, 59, 89, 437, 679, 437, 1543, 7663, 5005}}, {1657, 14, 5949, {1, 1, 7, 15, 27, 49, 125, 13, 397, 877, 1087, 2191, 4711, 9065}}, {1658, 14, 5952, {1, 1, 7, 5, 15, 47, 115, 125, 187, 31, 1003, 2575, 5397, 3883}}, {1659, 14, 5955, {1, 1, 7, 11, 15, 1, 127, 207, 383, 707, 183, 1053, 3123, 14071}}, {1660, 14, 5962, {1, 3, 3, 1, 31, 53, 15, 19, 477, 245, 777, 1613, 5813, 7443}}, {1661, 14, 5975, {1, 3, 1, 11, 23, 59, 65, 23, 493, 157, 1389, 2833, 4535, 3907}}, {1662, 14, 5985, {1, 1, 7, 1, 19, 7, 51, 135, 327, 441, 1841, 3091, 3451, 14381}}, {1663, 14, 5997, {1, 1, 7, 7, 3, 37, 29, 249, 437, 319, 1693, 945, 7639, 5923}}, {1664, 14, 5998, {1, 3, 7, 15, 7, 61, 81, 127, 383, 99, 23, 3833, 3973, 7651}}, {1665, 14, 6012, {1, 3, 1, 7, 7, 21, 119, 185, 243, 619, 1363, 2033, 4835, 5089}}, {1666, 14, 6016, {1, 3, 1, 1, 3, 27, 63, 145, 271, 735, 695, 3981, 3049, 5433}}, {1667, 14, 6026, {1, 3, 3, 1, 3, 29, 79, 211, 279, 819, 501, 3665, 1455, 10455}}, {1668, 14, 6036, {1, 1, 3, 3, 31, 61, 113, 5, 411, 91, 489, 3257, 5939, 6715}}, {1669, 14, 6040, {1, 1, 5, 1, 23, 11, 103, 89, 377, 441, 43, 967, 3383, 8717}}, {1670, 14, 6045, {1, 1, 5, 13, 29, 39, 97, 189, 197, 621, 1755, 333, 6783, 9711}}, {1671, 14, 6055, {1, 1, 5, 13, 27, 17, 97, 197, 351, 799, 335, 765, 5329, 12549}}, {1672, 14, 6059, {1, 1, 5, 11, 29, 17, 9, 211, 127, 633, 1187, 3965, 4145, 12667}}, {1673, 14, 6088, {1, 1, 7, 5, 27, 29, 65, 115, 287, 325, 461, 5, 899, 2027}}, {1674, 14, 6115, {1, 1, 1, 5, 27, 17, 31, 13, 231, 627, 1163, 649, 1693, 9975}}, {1675, 14, 6124, {1, 3, 1, 15, 7, 49, 113, 123, 427, 603, 347, 2785, 7129, 4645}}, {1676, 14, 6127, {1, 1, 3, 7, 1, 33, 113, 105, 411, 939, 205, 3965, 4361, 4649}}, {1677, 14, 6132, {1, 1, 1, 1, 5, 21, 35, 159, 275, 929, 1193, 3205, 4787, 3515}}, {1678, 14, 6146, {1, 1, 1, 5, 1, 21, 29, 191, 275, 233, 1239, 515, 4349, 14989}}, {1679, 14, 6158, {1, 1, 5, 11, 27, 43, 111, 83, 153, 577, 1537, 149, 231, 839}}, {1680, 14, 6169, {1, 3, 5, 13, 21, 19, 57, 69, 87, 163, 271, 3535, 1057, 8517}}, {1681, 14, 6206, {1, 3, 3, 13, 17, 49, 65, 45, 457, 241, 391, 2033, 2507, 7771}}, {1682, 14, 6228, {1, 1, 5, 7, 11, 19, 79, 133, 341, 761, 27, 3905, 4137, 14363}}, {1683, 14, 6237, {1, 3, 3, 13, 19, 1, 11, 139, 249, 245, 1393, 2151, 2857, 1665}}, {1684, 14, 6244, {1, 1, 3, 15, 11, 7, 127, 47, 385, 1007, 713, 2235, 5489, 8755}}, {1685, 14, 6247, {1, 3, 5, 13, 19, 21, 21, 167, 405, 655, 1653, 889, 7367, 4177}}, {1686, 14, 6256, {1, 1, 5, 3, 19, 63, 99, 39, 89, 415, 951, 2863, 6569, 3797}}, {1687, 14, 6281, {1, 1, 1, 13, 31, 29, 119, 35, 311, 839, 1749, 941, 7487, 2385}}, {1688, 14, 6282, {1, 3, 7, 3, 17, 3, 97, 143, 465, 345, 1457, 2201, 5329, 359}}, {1689, 14, 6284, {1, 3, 7, 11, 1, 15, 3, 115, 335, 567, 1749, 1811, 3491, 15939}}, {1690, 14, 6296, {1, 1, 3, 13, 3, 21, 7, 141, 149, 571, 1877, 473, 2143, 9569}}, {1691, 14, 6299, {1, 3, 3, 11, 23, 61, 47, 179, 297, 453, 181, 3405, 2981, 13409}}, {1692, 14, 6302, {1, 3, 1, 13, 1, 43, 5, 201, 371, 1003, 367, 2709, 7675, 14973}}, {1693, 14, 6325, {1, 3, 3, 15, 29, 17, 19, 241, 495, 317, 1135, 2227, 6457, 4783}}, {1694, 14, 6349, {1, 3, 3, 7, 29, 9, 57, 95, 261, 531, 1717, 3389, 7991, 3793}}, {1695, 14, 6352, {1, 1, 1, 5, 31, 43, 73, 119, 499, 589, 1529, 3337, 4097, 15641}}, {1696, 14, 6362, {1, 1, 7, 9, 29, 43, 127, 91, 243, 979, 1325, 2835, 2787, 9445}}, {1697, 14, 6383, {1, 1, 7, 5, 9, 3, 115, 199, 219, 901, 747, 1077, 3197, 2443}}, {1698, 14, 6386, {1, 3, 5, 1, 3, 43, 7, 117, 297, 313, 1043, 1579, 5099, 13289}}, {1699, 14, 6395, {1, 1, 7, 11, 29, 33, 15, 121, 131, 579, 317, 1871, 1121, 11653}}, {1700, 14, 6397, {1, 1, 5, 9, 25, 25, 43, 89, 355, 1011, 1385, 2901, 6387, 1653}}, {1701, 14, 6415, {1, 1, 1, 9, 5, 47, 61, 165, 85, 757, 1397, 1177, 1657, 4899}}, {1702, 14, 6424, {1, 1, 3, 9, 11, 49, 15, 139, 261, 613, 931, 1299, 2777, 2835}}, {1703, 14, 6429, {1, 1, 1, 5, 3, 55, 83, 227, 125, 581, 1607, 1171, 6681, 14463}}, {1704, 14, 6439, {1, 3, 5, 13, 5, 55, 3, 247, 493, 155, 1073, 3743, 5719, 4019}}, {1705, 14, 6451, {1, 1, 7, 1, 11, 23, 13, 75, 399, 847, 499, 1643, 6977, 3699}}, {1706, 14, 6489, {1, 3, 1, 9, 11, 41, 47, 131, 313, 627, 481, 2469, 3281, 979}}, {1707, 14, 6496, {1, 3, 5, 13, 29, 3, 65, 101, 11, 29, 1807, 153, 1487, 16109}}, {1708, 14, 6502, {1, 1, 5, 9, 13, 31, 83, 195, 351, 355, 467, 3871, 3085, 4441}}, {1709, 14, 6511, {1, 3, 5, 3, 19, 21, 111, 179, 143, 361, 1619, 1547, 3409, 6905}}, {1710, 14, 6514, {1, 1, 5, 9, 31, 1, 93, 199, 491, 135, 1627, 2559, 1389, 14561}}, {1711, 14, 6520, {1, 3, 3, 9, 25, 53, 3, 105, 39, 445, 259, 1045, 1129, 9153}}, {1712, 14, 6523, {1, 1, 5, 9, 19, 63, 71, 9, 73, 435, 1377, 4015, 1821, 6453}}, {1713, 14, 6529, {1, 3, 7, 13, 19, 13, 37, 247, 391, 23, 1491, 1257, 6395, 237}}, {1714, 14, 6532, {1, 1, 3, 3, 19, 55, 109, 23, 227, 747, 729, 2221, 727, 2209}}, {1715, 14, 6547, {1, 1, 5, 11, 25, 21, 75, 37, 219, 355, 1005, 1895, 7039, 5225}}, {1716, 14, 6549, {1, 3, 5, 13, 11, 43, 9, 67, 87, 797, 1077, 245, 4521, 11845}}, {1717, 14, 6598, {1, 3, 5, 3, 15, 29, 127, 237, 277, 373, 1859, 3083, 587, 1123}}, {1718, 14, 6601, {1, 1, 7, 15, 13, 7, 103, 53, 13, 965, 1497, 775, 3439, 1501}}, {1719, 14, 6610, {1, 3, 3, 15, 17, 13, 97, 169, 67, 953, 189, 2739, 1459, 10543}}, {1720, 14, 6622, {1, 1, 5, 1, 17, 39, 15, 127, 327, 989, 1471, 3235, 2801, 15311}}, {1721, 14, 6632, {1, 1, 1, 15, 5, 37, 55, 155, 47, 463, 1851, 3467, 2765, 9359}}, {1722, 14, 6655, {1, 3, 3, 15, 1, 13, 93, 239, 291, 115, 365, 61, 395, 15853}}, {1723, 14, 6665, {1, 1, 5, 1, 19, 27, 61, 95, 105, 369, 1557, 961, 6917, 3621}}, {1724, 14, 6666, {1, 3, 3, 9, 7, 35, 115, 53, 111, 345, 1145, 1687, 3401, 12107}}, {1725, 14, 6695, {1, 1, 1, 5, 7, 31, 63, 19, 373, 79, 1369, 3037, 2835, 4439}}, {1726, 14, 6701, {1, 3, 7, 9, 11, 17, 29, 33, 331, 447, 1981, 3333, 6535, 6557}}, {1727, 14, 6709, {1, 3, 3, 5, 11, 41, 29, 43, 365, 279, 1919, 945, 179, 1987}}, {1728, 14, 6710, {1, 3, 1, 13, 7, 7, 25, 33, 103, 367, 1267, 763, 5691, 8643}}, {1729, 14, 6741, {1, 3, 1, 5, 11, 15, 3, 213, 511, 211, 1069, 4047, 3335, 12729}}, {1730, 14, 6745, {1, 1, 3, 1, 5, 11, 27, 201, 361, 537, 679, 3709, 293, 2997}}, {1731, 14, 6758, {1, 1, 3, 1, 25, 15, 19, 185, 369, 577, 1625, 655, 2363, 3861}}, {1732, 14, 6767, {1, 1, 5, 5, 1, 47, 61, 45, 411, 597, 955, 1007, 3775, 5809}}, {1733, 14, 6772, {1, 1, 5, 3, 27, 51, 101, 167, 429, 333, 1703, 3541, 2947, 3695}}, {1734, 14, 6782, {1, 3, 5, 5, 1, 53, 17, 63, 141, 215, 1223, 3129, 635, 15919}}, {1735, 14, 6797, {1, 3, 3, 1, 23, 31, 25, 11, 195, 241, 995, 3941, 573, 13855}}, {1736, 14, 6800, {1, 3, 3, 7, 17, 13, 71, 203, 465, 479, 1857, 1493, 8067, 7113}}, {1737, 14, 6843, {1, 1, 5, 3, 11, 57, 9, 59, 225, 691, 425, 2423, 6031, 6631}}, {1738, 14, 6845, {1, 3, 7, 1, 29, 57, 103, 123, 401, 807, 471, 2759, 5113, 15937}}, {1739, 14, 6860, {1, 3, 1, 1, 3, 1, 67, 123, 157, 655, 519, 323, 1853, 15041}}, {1740, 14, 6865, {1, 1, 7, 5, 11, 11, 105, 135, 247, 689, 1141, 2347, 7113, 9347}}, {1741, 14, 6878, {1, 1, 3, 11, 15, 37, 87, 3, 209, 575, 1521, 3863, 3893, 211}}, {1742, 14, 6887, {1, 3, 1, 3, 29, 55, 115, 31, 19, 195, 985, 3275, 363, 9801}}, {1743, 14, 6888, {1, 1, 3, 9, 13, 31, 57, 251, 201, 275, 1751, 389, 1463, 13159}}, {1744, 14, 6901, {1, 3, 5, 15, 19, 51, 127, 255, 397, 243, 29, 3007, 7845, 4687}}, {1745, 14, 6906, {1, 1, 7, 15, 9, 37, 39, 217, 509, 137, 1123, 3361, 6323, 5323}}, {1746, 14, 6940, {1, 3, 7, 5, 25, 3, 93, 203, 345, 581, 261, 2811, 4829, 6977}}, {1747, 14, 6947, {1, 1, 7, 1, 15, 41, 51, 227, 447, 893, 1209, 3865, 5229, 4277}}, {1748, 14, 6953, {1, 1, 1, 5, 31, 19, 23, 195, 359, 853, 595, 337, 2503, 16371}}, {1749, 14, 6954, {1, 3, 7, 5, 5, 13, 89, 157, 351, 777, 151, 3565, 4219, 7423}}, {1750, 14, 6959, {1, 1, 1, 5, 7, 1, 9, 89, 175, 909, 1523, 2295, 7949, 6739}}, {1751, 14, 6961, {1, 3, 5, 15, 27, 17, 11, 235, 19, 105, 457, 465, 3819, 11335}}, {1752, 14, 6964, {1, 3, 1, 13, 3, 41, 85, 221, 451, 613, 543, 2265, 6831, 1725}}, {1753, 14, 6991, {1, 1, 7, 7, 3, 29, 9, 197, 455, 665, 343, 1811, 5395, 393}}, {1754, 14, 6993, {1, 1, 3, 13, 29, 55, 71, 95, 475, 615, 2029, 123, 413, 16127}}, {1755, 14, 6999, {1, 1, 5, 9, 15, 61, 9, 51, 105, 271, 511, 2801, 693, 11839}}, {1756, 14, 7016, {1, 1, 7, 13, 29, 9, 105, 59, 377, 635, 717, 4033, 6963, 10541}}, {1757, 14, 7029, {1, 1, 1, 13, 7, 13, 59, 17, 335, 355, 77, 3665, 7003, 9521}}, {1758, 14, 7036, {1, 3, 1, 1, 23, 43, 51, 209, 151, 365, 1021, 2859, 3937, 2899}}, {1759, 14, 7045, {1, 1, 3, 3, 31, 41, 111, 107, 171, 433, 1233, 505, 2971, 6927}}, {1760, 14, 7076, {1, 3, 7, 13, 17, 25, 127, 195, 257, 551, 1867, 2145, 3695, 14567}}, {1761, 14, 7083, {1, 1, 5, 13, 13, 45, 39, 195, 55, 991, 1981, 1043, 5875, 581}}, {1762, 14, 7094, {1, 3, 3, 11, 25, 31, 91, 153, 415, 449, 1301, 563, 7755, 10671}}, {1763, 14, 7097, {1, 1, 3, 5, 31, 63, 1, 157, 229, 949, 971, 137, 6589, 8387}}, {1764, 14, 7123, {1, 3, 7, 15, 25, 7, 89, 133, 73, 497, 1361, 613, 455, 1005}}, {1765, 14, 7130, {1, 3, 3, 1, 13, 5, 119, 93, 175, 511, 1923, 763, 7573, 7545}}, {1766, 14, 7139, {1, 1, 3, 15, 27, 59, 49, 205, 497, 485, 117, 2523, 4495, 15153}}, {1767, 14, 7145, {1, 3, 7, 9, 15, 47, 111, 31, 363, 11, 475, 2931, 6813, 1259}}, {1768, 14, 7146, {1, 1, 5, 5, 1, 35, 95, 225, 17, 991, 809, 2601, 6455, 13803}}, {1769, 14, 7178, {1, 1, 5, 5, 15, 1, 1, 171, 433, 887, 1813, 3431, 2471, 7803}}, {1770, 14, 7186, {1, 3, 3, 15, 1, 15, 43, 179, 15, 949, 1881, 1027, 6989, 8955}}, {1771, 14, 7192, {1, 3, 7, 13, 1, 3, 49, 183, 373, 175, 1733, 913, 929, 1065}}, {1772, 14, 7198, {1, 3, 5, 7, 15, 51, 107, 115, 323, 357, 167, 2069, 7541, 9601}}, {1773, 14, 7222, {1, 1, 3, 5, 5, 21, 31, 107, 21, 299, 1937, 43, 3673, 8155}}, {1774, 14, 7269, {1, 3, 5, 11, 9, 55, 35, 113, 29, 99, 161, 1607, 8141, 4951}}, {1775, 14, 7270, {1, 3, 7, 15, 25, 7, 113, 179, 213, 19, 1717, 1027, 2021, 11263}}, {1776, 14, 7276, {1, 1, 5, 1, 31, 33, 85, 111, 67, 95, 2013, 2217, 871, 5329}}, {1777, 14, 7287, {1, 1, 1, 7, 7, 63, 67, 145, 495, 419, 1945, 3437, 6255, 151}}, {1778, 14, 7307, {1, 3, 5, 7, 17, 37, 97, 187, 215, 399, 1603, 2195, 5923, 769}}, {1779, 14, 7315, {1, 1, 3, 9, 25, 1, 119, 193, 385, 861, 2005, 2769, 675, 767}}, {1780, 14, 7334, {1, 3, 1, 15, 19, 7, 5, 227, 173, 383, 289, 461, 579, 3689}}, {1781, 14, 7340, {1, 3, 1, 11, 1, 37, 93, 239, 465, 891, 1479, 921, 4439, 15265}}, {1782, 14, 7351, {1, 1, 1, 13, 27, 61, 99, 69, 279, 655, 1853, 1593, 6319, 9003}}, {1783, 14, 7352, {1, 1, 1, 11, 5, 7, 19, 7, 387, 303, 321, 931, 5809, 16029}}, {1784, 14, 7357, {1, 1, 1, 15, 21, 55, 43, 107, 217, 687, 19, 3225, 3419, 9991}}, {1785, 14, 7360, {1, 1, 7, 5, 7, 55, 79, 41, 317, 357, 859, 1205, 191, 9395}}, {1786, 14, 7363, {1, 1, 3, 11, 3, 43, 7, 133, 115, 995, 1205, 1055, 4153, 10481}}, {1787, 14, 7384, {1, 1, 7, 11, 31, 57, 53, 9, 459, 223, 1969, 3513, 7033, 8505}}, {1788, 14, 7396, {1, 1, 3, 7, 17, 11, 115, 255, 281, 97, 1685, 2039, 2845, 11637}}, {1789, 14, 7403, {1, 3, 7, 1, 23, 41, 69, 199, 53, 105, 657, 1453, 4429, 1101}}, {1790, 14, 7406, {1, 3, 1, 5, 11, 33, 91, 131, 191, 73, 823, 117, 1053, 127}}, {1791, 14, 7425, {1, 3, 7, 11, 7, 3, 21, 65, 187, 103, 1393, 1797, 6673, 1409}}, {1792, 14, 7437, {1, 3, 7, 1, 31, 25, 25, 161, 299, 275, 417, 2267, 6861, 1255}}, {1793, 14, 7445, {1, 3, 5, 13, 5, 11, 61, 155, 115, 1001, 747, 889, 3235, 5709}}, {1794, 14, 7450, {1, 3, 7, 7, 7, 1, 97, 177, 507, 273, 1781, 3455, 5123, 15607}}, {1795, 14, 7455, {1, 1, 7, 5, 1, 7, 59, 49, 147, 343, 97, 3517, 5611, 8705}}, {1796, 14, 7461, {1, 1, 5, 13, 21, 29, 13, 21, 503, 515, 1217, 3905, 5513, 15849}}, {1797, 14, 7466, {1, 3, 1, 9, 9, 39, 65, 111, 385, 757, 583, 2225, 2039, 2817}}, {1798, 14, 7488, {1, 3, 3, 15, 23, 17, 63, 169, 503, 949, 849, 461, 6799, 669}}, {1799, 14, 7494, {1, 1, 1, 3, 1, 41, 63, 159, 251, 457, 521, 1653, 623, 3287}}, {1800, 14, 7515, {1, 1, 7, 3, 9, 1, 41, 37, 441, 921, 1415, 2955, 5841, 1451}}, {1801, 14, 7517, {1, 1, 5, 11, 23, 29, 89, 185, 413, 357, 1131, 2369, 3835, 6233}}, {1802, 14, 7521, {1, 1, 5, 15, 27, 35, 17, 73, 315, 911, 1761, 797, 5349, 3219}}, {1803, 14, 7536, {1, 3, 7, 11, 21, 9, 119, 233, 249, 901, 189, 3625, 2691, 16201}}, {1804, 14, 7546, {1, 3, 3, 13, 29, 61, 105, 145, 187, 79, 609, 321, 4289, 3933}}, {1805, 14, 7569, {1, 3, 1, 15, 19, 63, 13, 185, 115, 219, 1021, 1205, 4273, 11521}}, {1806, 14, 7591, {1, 1, 3, 3, 23, 31, 93, 153, 87, 947, 1039, 469, 4047, 8869}}, {1807, 14, 7592, {1, 1, 1, 1, 9, 1, 85, 3, 15, 995, 455, 2769, 6781, 16203}}, {1808, 14, 7598, {1, 1, 3, 3, 13, 7, 55, 215, 185, 367, 765, 441, 4497, 1521}}, {1809, 14, 7612, {1, 1, 1, 5, 1, 31, 13, 95, 417, 735, 975, 3407, 4871, 16133}}, {1810, 14, 7623, {1, 1, 3, 3, 5, 43, 111, 107, 419, 515, 1075, 3597, 1187, 4143}}, {1811, 14, 7632, {1, 1, 3, 13, 31, 51, 83, 163, 489, 887, 863, 599, 9, 13861}}, {1812, 14, 7637, {1, 3, 3, 3, 19, 27, 91, 115, 103, 969, 593, 3667, 1867, 15433}}, {1813, 14, 7644, {1, 3, 3, 13, 7, 25, 47, 141, 57, 553, 1785, 1709, 7453, 2209}}, {1814, 14, 7657, {1, 3, 1, 13, 11, 13, 71, 219, 5, 451, 2043, 1605, 6439, 12203}}, {1815, 14, 7665, {1, 3, 1, 13, 5, 57, 61, 223, 401, 413, 321, 1365, 619, 12477}}, {1816, 14, 7672, {1, 3, 1, 5, 25, 57, 89, 211, 195, 455, 1165, 3979, 6313, 5751}}, {1817, 14, 7682, {1, 1, 1, 9, 31, 23, 71, 145, 89, 285, 1593, 1171, 5685, 15459}}, {1818, 14, 7699, {1, 3, 7, 7, 9, 41, 65, 251, 65, 137, 1577, 3027, 5555, 2865}}, {1819, 14, 7702, {1, 1, 5, 13, 27, 5, 125, 21, 171, 647, 983, 2921, 6623, 5695}}, {1820, 14, 7724, {1, 1, 1, 13, 15, 9, 117, 197, 123, 953, 1191, 3657, 5757, 15957}}, {1821, 14, 7749, {1, 1, 3, 7, 29, 13, 5, 175, 395, 127, 679, 255, 6055, 7639}}, {1822, 14, 7753, {1, 3, 7, 15, 15, 51, 77, 147, 319, 147, 1775, 3983, 3175, 5723}}, {1823, 14, 7754, {1, 3, 3, 3, 7, 11, 119, 41, 43, 153, 975, 679, 3081, 10359}}, {1824, 14, 7761, {1, 1, 5, 13, 3, 7, 65, 67, 63, 399, 1561, 2789, 2083, 12289}}, {1825, 14, 7771, {1, 1, 7, 3, 19, 53, 103, 67, 35, 865, 161, 93, 2533, 3851}}, {1826, 14, 7777, {1, 1, 1, 11, 31, 9, 29, 189, 199, 817, 1571, 395, 345, 3777}}, {1827, 14, 7784, {1, 3, 5, 11, 31, 3, 9, 67, 277, 735, 181, 2777, 3009, 7233}}, {1828, 14, 7804, {1, 1, 3, 3, 17, 7, 17, 3, 375, 933, 237, 3919, 5409, 3355}}, {1829, 14, 7807, {1, 3, 3, 5, 9, 27, 19, 77, 221, 3, 1965, 309, 3001, 15977}}, {1830, 14, 7808, {1, 1, 5, 1, 3, 33, 35, 133, 37, 709, 627, 1705, 2525, 4307}}, {1831, 14, 7818, {1, 1, 7, 3, 25, 21, 105, 55, 375, 681, 881, 1299, 5879, 459}}, {1832, 14, 7835, {1, 3, 7, 1, 13, 7, 113, 103, 313, 515, 1041, 3683, 4619, 5093}}, {1833, 14, 7842, {1, 1, 3, 7, 19, 43, 83, 37, 39, 133, 1759, 1171, 1521, 13717}}, {1834, 14, 7865, {1, 1, 7, 13, 7, 35, 15, 155, 293, 1001, 157, 3883, 405, 1797}}, {1835, 14, 7868, {1, 1, 3, 3, 13, 19, 125, 49, 333, 387, 339, 1815, 4503, 7359}}, {1836, 14, 7880, {1, 1, 3, 13, 19, 19, 105, 225, 151, 27, 1251, 885, 4815, 7863}}, {1837, 14, 7883, {1, 1, 1, 5, 7, 59, 17, 145, 77, 117, 1355, 1429, 2301, 16177}}, {1838, 14, 7891, {1, 3, 3, 13, 5, 31, 119, 167, 459, 727, 1799, 2537, 695, 13637}}, {1839, 14, 7897, {1, 3, 3, 3, 27, 51, 107, 85, 267, 57, 1279, 823, 6247, 3603}}, {1840, 14, 7907, {1, 1, 7, 15, 29, 17, 67, 197, 215, 465, 109, 3461, 5269, 15287}}, {1841, 14, 7910, {1, 1, 3, 5, 11, 15, 123, 53, 293, 797, 1105, 1777, 6509, 217}}, {1842, 14, 7924, {1, 3, 3, 13, 3, 5, 109, 53, 203, 693, 871, 135, 369, 11149}}, {1843, 14, 7933, {1, 3, 5, 15, 17, 43, 81, 235, 119, 817, 1777, 261, 8049, 4251}}, {1844, 14, 7934, {1, 1, 3, 7, 7, 13, 87, 99, 481, 931, 1507, 651, 5267, 8281}}, {1845, 14, 7942, {1, 3, 1, 13, 27, 43, 77, 225, 341, 163, 933, 429, 4943, 7781}}, {1846, 14, 7948, {1, 1, 7, 1, 1, 49, 85, 211, 449, 479, 1395, 787, 5653, 14891}}, {1847, 14, 7959, {1, 1, 5, 9, 25, 13, 49, 85, 125, 85, 1281, 3365, 4305, 11791}}, {1848, 14, 7984, {1, 3, 1, 13, 3, 31, 117, 39, 43, 151, 663, 669, 1571, 5207}}, {1849, 14, 7994, {1, 3, 7, 15, 17, 7, 79, 163, 37, 841, 1799, 1787, 4501, 3785}}, {1850, 14, 7999, {1, 1, 3, 9, 1, 23, 67, 191, 449, 931, 1521, 2705, 887, 7037}}, {1851, 14, 8014, {1, 1, 1, 1, 5, 13, 55, 161, 419, 577, 1703, 2589, 2651, 2873}}, {1852, 14, 8021, {1, 3, 3, 3, 5, 19, 37, 169, 69, 1003, 1755, 3101, 1469, 8583}}, {1853, 14, 8041, {1, 1, 1, 1, 11, 33, 105, 79, 283, 91, 299, 835, 3193, 5593}}, {1854, 14, 8049, {1, 3, 3, 13, 25, 21, 81, 213, 465, 475, 331, 457, 61, 9511}}, {1855, 14, 8050, {1, 1, 3, 11, 1, 11, 77, 95, 455, 949, 1999, 1833, 1275, 5631}}, {1856, 14, 8068, {1, 1, 1, 1, 15, 25, 51, 137, 275, 451, 1179, 3595, 5177, 7105}}, {1857, 14, 8080, {1, 3, 3, 3, 3, 59, 79, 143, 393, 583, 349, 3039, 7079, 14245}}, {1858, 14, 8095, {1, 1, 7, 9, 21, 11, 123, 105, 53, 297, 803, 4025, 5421, 14527}}, {1859, 14, 8102, {1, 3, 7, 11, 21, 15, 103, 109, 311, 321, 1217, 2777, 5457, 1823}}, {1860, 14, 8106, {1, 3, 5, 11, 19, 31, 79, 89, 295, 413, 817, 499, 3699, 14411}}, {1861, 14, 8120, {1, 1, 1, 5, 11, 3, 81, 13, 315, 841, 1543, 411, 6883, 6347}}, {1862, 14, 8133, {1, 3, 3, 11, 23, 43, 23, 131, 17, 517, 995, 2687, 7443, 15085}}, {1863, 14, 8134, {1, 1, 1, 1, 11, 57, 73, 9, 123, 905, 1763, 1789, 3701, 7131}}, {1864, 14, 8143, {1, 1, 3, 5, 9, 53, 99, 229, 43, 207, 625, 1583, 6727, 15249}}, {1865, 14, 8162, {1, 1, 7, 7, 17, 39, 91, 1, 297, 711, 225, 513, 7391, 291}}, {1866, 14, 8168, {1, 1, 7, 11, 7, 55, 111, 129, 423, 521, 1807, 3015, 1449, 12321}}, {1867, 14, 8179, {1, 3, 7, 3, 13, 9, 125, 187, 11, 485, 647, 275, 3495, 11989}}, {1868, 15, 1, {1, 1, 3, 11, 11, 25, 49, 33, 361, 105, 271, 3841, 4837, 2437, 30181}}, {1869, 15, 8, {1, 3, 5, 1, 27, 15, 119, 35, 159, 273, 1489, 3157, 5433, 3337, 26859}}, {1870, 15, 11, {1, 3, 5, 13, 23, 31, 97, 145, 41, 605, 1455, 59, 5389, 5527, 14447}}, {1871, 15, 22, {1, 1, 7, 9, 7, 41, 61, 193, 353, 879, 1805, 581, 5447, 11177, 7331}}, {1872, 15, 26, {1, 1, 7, 11, 29, 19, 55, 207, 361, 759, 63, 2255, 2119, 14671, 21783}}, {1873, 15, 47, {1, 3, 1, 13, 17, 7, 73, 179, 103, 23, 917, 1205, 4925, 1691, 5419}}, {1874, 15, 59, {1, 3, 5, 3, 15, 3, 9, 109, 227, 861, 867, 3529, 1535, 489, 22873}}, {1875, 15, 64, {1, 3, 3, 9, 15, 15, 95, 193, 385, 997, 1525, 1865, 1425, 4079, 14771}}, {1876, 15, 67, {1, 1, 3, 5, 5, 29, 49, 171, 171, 623, 1167, 3743, 1809, 12009, 7043}}, {1877, 15, 73, {1, 3, 7, 5, 23, 11, 87, 183, 299, 555, 1857, 489, 3505, 9161, 28763}}, {1878, 15, 82, {1, 3, 5, 9, 19, 21, 85, 127, 337, 439, 1183, 1891, 1877, 4373, 10451}}, {1879, 15, 97, {1, 3, 7, 13, 27, 17, 29, 83, 463, 385, 1167, 3453, 4523, 4759, 9321}}, {1880, 15, 103, {1, 1, 3, 7, 21, 59, 65, 83, 177, 763, 317, 2913, 7527, 5967, 17167}}, {1881, 15, 110, {1, 1, 7, 15, 13, 27, 49, 35, 253, 101, 1699, 355, 2181, 10859, 24221}}, {1882, 15, 115, {1, 1, 5, 1, 17, 17, 81, 91, 349, 655, 1373, 2225, 945, 899, 31801}}, {1883, 15, 122, {1, 3, 7, 11, 5, 1, 81, 53, 215, 587, 167, 4045, 5671, 5597, 13529}}, {1884, 15, 128, {1, 3, 5, 15, 1, 9, 59, 235, 315, 195, 909, 2237, 505, 10415, 28145}}, {1885, 15, 138, {1, 1, 1, 3, 9, 31, 41, 43, 275, 921, 25, 671, 5737, 11241, 4193}}, {1886, 15, 146, {1, 3, 3, 13, 29, 13, 95, 213, 317, 995, 1489, 3779, 3043, 8569, 28823}}, {1887, 15, 171, {1, 1, 7, 5, 9, 49, 125, 241, 87, 153, 1673, 3849, 7253, 1715, 11627}}, {1888, 15, 174, {1, 1, 3, 9, 27, 27, 19, 223, 63, 463, 1095, 1395, 6643, 11589, 2145}}, {1889, 15, 176, {1, 1, 3, 15, 21, 17, 45, 23, 357, 11, 1307, 1791, 2481, 2123, 24341}}, {1890, 15, 182, {1, 3, 5, 15, 31, 53, 117, 51, 433, 193, 1239, 3329, 2403, 12745, 32219}}, {1891, 15, 194, {1, 1, 5, 9, 7, 27, 9, 115, 417, 579, 83, 173, 4717, 15665, 27463}}, {1892, 15, 208, {1, 3, 5, 7, 9, 9, 31, 35, 249, 567, 331, 905, 5101, 14817, 14255}}, {1893, 15, 211, {1, 3, 7, 3, 1, 61, 29, 129, 119, 421, 1597, 2987, 3041, 7629, 23451}}, {1894, 15, 220, {1, 1, 7, 9, 13, 1, 99, 105, 107, 509, 989, 2259, 1009, 6827, 8903}}, {1895, 15, 229, {1, 3, 5, 15, 11, 29, 85, 29, 265, 105, 2035, 3349, 3543, 13903, 10213}}, {1896, 15, 230, {1, 3, 1, 1, 25, 19, 53, 139, 467, 485, 491, 3067, 7353, 13861, 25819}}, {1897, 15, 239, {1, 1, 5, 3, 3, 43, 41, 185, 45, 463, 351, 2823, 2519, 6705, 11395}}, {1898, 15, 254, {1, 3, 7, 13, 11, 15, 87, 221, 427, 673, 1631, 599, 3259, 10691, 31283}}, {1899, 15, 265, {1, 3, 5, 11, 9, 9, 15, 49, 275, 335, 1613, 3587, 5309, 14849, 26475}}, {1900, 15, 285, {1, 3, 7, 9, 29, 13, 79, 225, 381, 781, 1411, 2761, 7157, 14983, 19717}}, {1901, 15, 290, {1, 1, 7, 11, 29, 25, 117, 183, 101, 651, 653, 3157, 445, 14389, 23293}}, {1902, 15, 319, {1, 1, 1, 3, 5, 33, 73, 155, 473, 387, 591, 2045, 5965, 16299, 31499}}, {1903, 15, 324, {1, 3, 1, 7, 11, 33, 29, 21, 491, 937, 729, 4075, 975, 2461, 18991}}, {1904, 15, 327, {1, 3, 7, 15, 29, 39, 105, 111, 173, 943, 69, 295, 8175, 13037, 26131}}, {1905, 15, 333, {1, 1, 5, 15, 7, 5, 97, 147, 105, 887, 443, 2595, 5889, 10753, 1619}}, {1906, 15, 357, {1, 3, 3, 15, 11, 45, 87, 207, 353, 909, 1847, 323, 2283, 12885, 16415}}, {1907, 15, 364, {1, 1, 5, 3, 19, 33, 43, 79, 115, 653, 359, 2873, 4609, 12439, 6339}}, {1908, 15, 395, {1, 3, 7, 9, 17, 61, 49, 227, 291, 69, 1753, 3899, 483, 3187, 29041}}, {1909, 15, 397, {1, 3, 5, 3, 25, 35, 61, 211, 393, 199, 691, 1779, 6295, 13371, 15817}}, {1910, 15, 405, {1, 3, 7, 5, 7, 23, 37, 91, 245, 915, 579, 867, 6193, 1063, 17363}}, {1911, 15, 409, {1, 3, 7, 7, 23, 51, 41, 63, 375, 3, 159, 1889, 4419, 1687, 17977}}, {1912, 15, 419, {1, 1, 1, 7, 13, 11, 53, 43, 317, 325, 1749, 2423, 4123, 8595, 20773}}, {1913, 15, 422, {1, 1, 7, 7, 9, 9, 61, 113, 437, 213, 1407, 645, 4345, 807, 30411}}, {1914, 15, 431, {1, 3, 3, 11, 17, 39, 17, 113, 391, 385, 581, 2023, 7449, 10153, 22033}}, {1915, 15, 433, {1, 1, 3, 5, 29, 31, 101, 215, 379, 377, 1113, 2855, 7147, 14377, 25515}}, {1916, 15, 436, {1, 3, 5, 5, 13, 3, 121, 125, 227, 969, 11, 1115, 5657, 9209, 6117}}, {1917, 15, 440, {1, 3, 7, 15, 29, 17, 33, 123, 317, 301, 749, 1365, 5619, 605, 1613}}, {1918, 15, 453, {1, 3, 1, 15, 7, 53, 125, 249, 219, 655, 105, 2825, 1649, 12783, 19777}}, {1919, 15, 460, {1, 1, 7, 1, 25, 53, 19, 53, 157, 373, 1855, 495, 5065, 9465, 2313}}, {1920, 15, 471, {1, 3, 5, 13, 3, 57, 57, 161, 431, 415, 1859, 1033, 6349, 1577, 31579}}, {1921, 15, 478, {1, 1, 7, 5, 23, 63, 29, 221, 13, 965, 1997, 2265, 1583, 10491, 9551}}, {1922, 15, 482, {1, 1, 3, 13, 31, 25, 23, 61, 285, 5, 2005, 879, 795, 13299, 19685}}, {1923, 15, 488, {1, 1, 7, 1, 21, 45, 121, 89, 263, 543, 1333, 2711, 219, 10823, 26139}}, {1924, 15, 524, {1, 1, 3, 3, 27, 13, 19, 117, 161, 457, 1541, 295, 4953, 12125, 14503}}, {1925, 15, 529, {1, 3, 5, 3, 7, 63, 13, 247, 439, 681, 977, 2537, 6923, 10323, 7349}}, {1926, 15, 535, {1, 3, 5, 9, 3, 51, 81, 251, 349, 983, 581, 2515, 2281, 2849, 31915}}, {1927, 15, 536, {1, 3, 5, 3, 11, 63, 47, 137, 303, 627, 91, 2269, 7097, 2145, 31059}}, {1928, 15, 539, {1, 1, 3, 15, 13, 17, 53, 27, 133, 13, 117, 1837, 4103, 5843, 29153}}, {1929, 15, 563, {1, 1, 5, 13, 21, 33, 37, 253, 465, 209, 309, 49, 3209, 15677, 14569}}, {1930, 15, 566, {1, 1, 7, 15, 13, 21, 33, 203, 499, 141, 1155, 3893, 1663, 2115, 27459}}, {1931, 15, 572, {1, 3, 5, 11, 21, 9, 39, 157, 257, 273, 1257, 1831, 515, 7969, 20133}}, {1932, 15, 577, {1, 1, 3, 13, 19, 29, 15, 189, 103, 219, 1395, 517, 7425, 6585, 15865}}, {1933, 15, 587, {1, 1, 5, 11, 21, 31, 49, 151, 39, 537, 1783, 3449, 6915, 223, 11587}}, {1934, 15, 592, {1, 3, 3, 11, 7, 63, 69, 31, 27, 911, 1903, 2821, 7977, 12949, 32257}}, {1935, 15, 602, {1, 1, 7, 9, 25, 45, 23, 233, 511, 595, 1383, 1721, 6789, 12055, 21179}}, {1936, 15, 623, {1, 1, 7, 13, 1, 27, 123, 49, 439, 683, 501, 641, 1947, 6111, 25423}}, {1937, 15, 635, {1, 3, 3, 5, 1, 23, 57, 241, 243, 593, 2039, 1617, 2209, 5171, 9675}}, {1938, 15, 638, {1, 1, 1, 7, 5, 19, 83, 55, 481, 125, 177, 1021, 1139, 11403, 23099}}, {1939, 15, 654, {1, 1, 3, 5, 29, 39, 33, 217, 461, 907, 733, 3795, 4811, 12939, 27715}}, {1940, 15, 656, {1, 3, 7, 3, 7, 11, 39, 165, 495, 147, 999, 1827, 817, 603, 9293}}, {1941, 15, 659, {1, 3, 7, 15, 25, 53, 35, 15, 431, 733, 1213, 2907, 8087, 3939, 27363}}, {1942, 15, 665, {1, 3, 7, 13, 13, 9, 33, 27, 485, 183, 455, 3341, 2555, 4985, 8793}}, {1943, 15, 675, {1, 1, 1, 15, 25, 47, 75, 21, 205, 15, 1639, 3067, 1295, 11693, 16903}}, {1944, 15, 677, {1, 1, 1, 15, 3, 31, 93, 57, 43, 185, 251, 1899, 7885, 10829, 3609}}, {1945, 15, 687, {1, 1, 3, 1, 29, 9, 69, 223, 221, 537, 365, 3411, 5771, 15279, 5309}}, {1946, 15, 696, {1, 1, 7, 5, 1, 5, 125, 243, 213, 1003, 1571, 3355, 3981, 8781, 25993}}, {1947, 15, 701, {1, 1, 1, 13, 7, 19, 53, 243, 301, 75, 1183, 2723, 6687, 13, 16581}}, {1948, 15, 704, {1, 3, 1, 13, 17, 51, 91, 239, 437, 191, 1065, 2495, 5755, 3405, 8299}}, {1949, 15, 710, {1, 1, 5, 5, 11, 59, 21, 169, 299, 123, 1845, 2199, 2157, 14461, 10327}}, {1950, 15, 721, {1, 3, 7, 7, 19, 47, 51, 179, 41, 19, 1347, 2325, 8063, 5993, 15653}}, {1951, 15, 728, {1, 1, 1, 9, 25, 27, 7, 133, 223, 533, 719, 353, 7093, 8285, 10375}}, {1952, 15, 738, {1, 3, 5, 15, 31, 5, 67, 39, 441, 495, 977, 3699, 1435, 11385, 14567}}, {1953, 15, 740, {1, 1, 3, 15, 15, 39, 25, 33, 91, 523, 249, 4035, 769, 5181, 9691}}, {1954, 15, 749, {1, 1, 3, 3, 3, 57, 83, 187, 423, 165, 161, 3453, 2241, 981, 8429}}, {1955, 15, 758, {1, 1, 7, 15, 1, 17, 57, 189, 283, 11, 823, 3505, 7025, 11879, 15441}}, {1956, 15, 761, {1, 1, 3, 11, 1, 41, 7, 255, 385, 339, 607, 1405, 1473, 13697, 9491}}, {1957, 15, 772, {1, 1, 7, 15, 5, 9, 91, 99, 211, 233, 51, 2663, 1165, 9283, 18495}}, {1958, 15, 776, {1, 1, 3, 7, 21, 37, 13, 91, 39, 27, 1021, 2813, 5937, 6645, 3403}}, {1959, 15, 782, {1, 3, 1, 1, 29, 29, 5, 69, 399, 665, 1407, 3921, 2653, 11753, 18925}}, {1960, 15, 789, {1, 3, 7, 15, 13, 41, 39, 1, 437, 549, 161, 2315, 5631, 8335, 22661}}, {1961, 15, 810, {1, 1, 3, 1, 7, 17, 115, 61, 69, 955, 475, 3763, 8035, 927, 17893}}, {1962, 15, 812, {1, 3, 1, 13, 21, 59, 81, 145, 463, 145, 1941, 2777, 7453, 14229, 11281}}, {1963, 15, 818, {1, 1, 1, 15, 15, 11, 27, 165, 461, 395, 1645, 3611, 7463, 12379, 26787}}, {1964, 15, 830, {1, 1, 7, 9, 29, 19, 27, 123, 21, 149, 1643, 4001, 7207, 6769, 4647}}, {1965, 15, 832, {1, 1, 1, 11, 13, 9, 103, 139, 185, 587, 591, 1113, 2223, 11667, 32671}}, {1966, 15, 852, {1, 3, 1, 1, 31, 13, 19, 93, 229, 125, 1471, 2369, 3055, 10277, 28563}}, {1967, 15, 855, {1, 3, 7, 5, 7, 53, 99, 175, 161, 851, 617, 4027, 2357, 11199, 1931}}, {1968, 15, 859, {1, 3, 5, 11, 3, 31, 111, 179, 237, 845, 539, 1057, 259, 3417, 26637}}, {1969, 15, 865, {1, 1, 5, 3, 21, 49, 125, 119, 463, 403, 737, 1811, 3941, 13015, 29081}}, {1970, 15, 877, {1, 3, 5, 13, 5, 29, 69, 251, 313, 357, 663, 1097, 3307, 12845, 28495}}, {1971, 15, 895, {1, 3, 3, 5, 29, 17, 89, 15, 411, 409, 2013, 757, 4085, 12521, 11131}}, {1972, 15, 901, {1, 1, 1, 15, 7, 51, 3, 193, 493, 133, 381, 2027, 227, 6635, 12931}}, {1973, 15, 902, {1, 1, 1, 15, 7, 23, 99, 203, 323, 1007, 1465, 2887, 2215, 1787, 22069}}, {1974, 15, 906, {1, 1, 5, 9, 29, 59, 77, 151, 509, 313, 415, 3977, 5431, 8019, 8571}}, {1975, 15, 916, {1, 3, 1, 15, 19, 13, 57, 217, 87, 119, 25, 1149, 5667, 3765, 6959}}, {1976, 15, 920, {1, 3, 7, 13, 19, 31, 119, 3, 457, 117, 905, 361, 1483, 12405, 27005}}, {1977, 15, 949, {1, 3, 5, 11, 15, 35, 61, 77, 119, 51, 1753, 2765, 1091, 10573, 23595}}, {1978, 15, 962, {1, 3, 3, 7, 1, 35, 17, 93, 197, 511, 1253, 3031, 2739, 15127, 15147}}, {1979, 15, 964, {1, 3, 3, 1, 11, 55, 55, 107, 161, 75, 129, 2195, 2023, 4877, 25797}}, {1980, 15, 967, {1, 3, 5, 7, 23, 19, 113, 167, 167, 271, 1303, 125, 5057, 1323, 5165}}, {1981, 15, 981, {1, 1, 5, 3, 21, 31, 11, 119, 215, 483, 1535, 407, 6485, 15401, 30297}}, {1982, 15, 982, {1, 3, 5, 9, 21, 5, 77, 95, 443, 247, 913, 605, 365, 7465, 19707}}, {1983, 15, 985, {1, 3, 1, 7, 17, 59, 9, 35, 391, 767, 1493, 475, 4725, 7529, 31579}}, {1984, 15, 991, {1, 3, 3, 7, 31, 21, 61, 31, 421, 179, 273, 771, 5745, 10575, 32765}}, {1985, 15, 1007, {1, 3, 5, 15, 27, 13, 125, 55, 423, 1021, 497, 3521, 6903, 15111, 8285}}, {1986, 15, 1016, {1, 1, 5, 9, 13, 31, 105, 93, 421, 709, 643, 1079, 1533, 9149, 10799}}, {1987, 15, 1024, {1, 3, 1, 11, 19, 29, 53, 199, 319, 247, 655, 3039, 6411, 12267, 14245}}, {1988, 15, 1051, {1, 3, 1, 11, 9, 57, 5, 91, 469, 149, 259, 329, 5433, 6941, 15093}}, {1989, 15, 1060, {1, 3, 1, 5, 5, 51, 59, 25, 455, 367, 1623, 441, 3155, 11695, 20767}}, {1990, 15, 1070, {1, 3, 7, 7, 11, 49, 113, 95, 91, 389, 605, 1973, 2051, 2315, 22229}}, {1991, 15, 1072, {1, 3, 5, 3, 19, 11, 99, 135, 433, 781, 1473, 885, 1105, 3573, 3739}}, {1992, 15, 1084, {1, 3, 1, 11, 3, 25, 9, 227, 433, 723, 317, 139, 6627, 8067, 28439}}, {1993, 15, 1089, {1, 1, 1, 9, 9, 9, 5, 63, 241, 215, 1991, 2949, 3943, 775, 31511}}, {1994, 15, 1095, {1, 1, 3, 7, 17, 49, 35, 167, 131, 107, 1295, 2465, 4577, 11147, 29833}}, {1995, 15, 1114, {1, 1, 5, 1, 5, 25, 119, 129, 391, 743, 1069, 2957, 349, 6891, 13635}}, {1996, 15, 1123, {1, 3, 1, 7, 9, 31, 63, 253, 215, 51, 1347, 2361, 3125, 13049, 28461}}, {1997, 15, 1132, {1, 1, 7, 9, 3, 31, 21, 163, 255, 47, 259, 535, 5461, 3349, 30649}}, {1998, 15, 1154, {1, 3, 3, 13, 17, 33, 87, 47, 243, 709, 929, 3943, 3107, 3421, 13721}}, {1999, 15, 1156, {1, 3, 5, 11, 25, 61, 61, 173, 397, 735, 2005, 3355, 8121, 11593, 27697}}, {2000, 15, 1163, {1, 3, 5, 15, 17, 43, 63, 231, 275, 311, 1277, 2669, 7307, 2099, 9755}}, {2001, 15, 1171, {1, 3, 5, 3, 25, 43, 71, 191, 9, 121, 1873, 3747, 7491, 14055, 24293}}, {2002, 15, 1202, {1, 3, 5, 13, 17, 35, 113, 113, 385, 941, 39, 2705, 1225, 5167, 1373}}, {2003, 15, 1228, {1, 3, 5, 5, 7, 35, 19, 105, 487, 71, 139, 627, 4187, 3183, 713}}, {2004, 15, 1239, {1, 1, 5, 13, 29, 29, 103, 5, 157, 869, 1675, 423, 6689, 10697, 5303}}, {2005, 15, 1255, {1, 1, 5, 1, 29, 31, 61, 111, 473, 963, 685, 1483, 2383, 8109, 8495}}, {2006, 15, 1256, {1, 1, 5, 3, 19, 13, 95, 113, 217, 59, 1353, 1647, 3617, 3271, 2321}}, {2007, 15, 1262, {1, 3, 5, 7, 25, 35, 59, 131, 309, 445, 415, 93, 1453, 8789, 30201}}, {2008, 15, 1270, {1, 1, 5, 1, 5, 43, 71, 241, 123, 189, 831, 3469, 8093, 6187, 32721}}, {2009, 15, 1279, {1, 3, 7, 5, 25, 31, 123, 171, 319, 379, 889, 2365, 4881, 12225, 16609}}, {2010, 15, 1308, {1, 3, 1, 11, 27, 43, 121, 63, 291, 591, 811, 1995, 4777, 2083, 31385}}, {2011, 15, 1322, {1, 1, 5, 11, 27, 53, 85, 187, 461, 823, 703, 399, 6925, 11517, 28697}}, {2012, 15, 1329, {1, 1, 3, 5, 13, 11, 33, 121, 93, 717, 1275, 3877, 4247, 5845, 26909}}, {2013, 15, 1330, {1, 3, 1, 9, 7, 5, 47, 199, 367, 561, 185, 2855, 5997, 2699, 7581}}, {2014, 15, 1336, {1, 1, 5, 9, 23, 11, 71, 201, 61, 729, 1011, 3529, 663, 1413, 25675}}, {2015, 15, 1341, {1, 3, 7, 13, 27, 21, 11, 127, 281, 487, 1217, 3129, 5541, 3129, 17783}}, {2016, 15, 1347, {1, 1, 5, 9, 1, 29, 85, 193, 213, 743, 1473, 611, 391, 9405, 21137}}, {2017, 15, 1349, {1, 3, 3, 3, 31, 63, 37, 147, 39, 351, 79, 3069, 2441, 8901, 8777}}, {2018, 15, 1359, {1, 1, 7, 7, 25, 49, 55, 47, 441, 343, 1267, 1123, 5917, 14395, 10579}}, {2019, 15, 1367, {1, 1, 7, 1, 13, 55, 55, 123, 103, 773, 125, 2145, 4743, 13347, 2589}}, {2020, 15, 1368, {1, 3, 7, 3, 9, 33, 25, 183, 469, 213, 291, 75, 6725, 6847, 26745}}, {2021, 15, 1390, {1, 3, 3, 7, 15, 43, 7, 79, 171, 21, 1767, 2537, 4285, 12007, 24039}}, {2022, 15, 1413, {1, 3, 7, 13, 9, 61, 125, 23, 227, 879, 215, 1635, 2835, 883, 15939}}, {2023, 15, 1414, {1, 1, 5, 13, 25, 45, 63, 43, 183, 829, 149, 989, 987, 3819, 12181}}, {2024, 15, 1437, {1, 1, 3, 7, 19, 27, 35, 83, 135, 459, 785, 131, 2655, 3329, 3009}}, {2025, 15, 1441, {1, 1, 7, 5, 11, 41, 9, 219, 475, 985, 1329, 3787, 1975, 4679, 8627}}, {2026, 15, 1462, {1, 1, 7, 3, 1, 17, 91, 155, 3, 763, 1879, 233, 215, 2955, 25993}}, {2027, 15, 1465, {1, 1, 1, 11, 25, 11, 23, 227, 453, 775, 1935, 3833, 4583, 269, 705}}, {2028, 15, 1480, {1, 3, 3, 11, 7, 25, 105, 21, 449, 555, 1275, 3475, 5503, 15617, 813}}, {2029, 15, 1486, {1, 3, 7, 13, 31, 37, 25, 255, 233, 663, 1155, 1563, 4775, 7449, 29949}}, {2030, 15, 1504, {1, 1, 3, 1, 23, 51, 51, 137, 63, 809, 349, 2789, 6953, 10605, 18959}}, {2031, 15, 1509, {1, 3, 3, 13, 21, 45, 15, 161, 393, 229, 437, 2967, 4019, 3893, 21305}}, {2032, 15, 1514, {1, 1, 3, 7, 5, 11, 15, 211, 287, 131, 1847, 2569, 7881, 15669, 31037}}, {2033, 15, 1522, {1, 3, 3, 15, 27, 19, 85, 251, 221, 639, 665, 3729, 5771, 7873, 28005}}, {2034, 15, 1528, {1, 3, 7, 15, 15, 47, 93, 215, 343, 85, 1401, 1375, 2949, 13661, 25453}}, {2035, 15, 1552, {1, 1, 1, 9, 7, 51, 53, 217, 471, 389, 551, 1141, 1767, 2237, 17797}}, {2036, 15, 1555, {1, 1, 7, 9, 3, 29, 65, 29, 223, 591, 1719, 1049, 7643, 3853, 29867}}, {2037, 15, 1571, {1, 1, 1, 11, 13, 41, 85, 29, 451, 387, 1783, 3733, 8033, 4711, 31643}}, {2038, 15, 1578, {1, 3, 1, 11, 11, 57, 75, 153, 7, 373, 2011, 271, 469, 3267, 18969}}, {2039, 15, 1585, {1, 1, 5, 3, 19, 43, 7, 243, 385, 293, 923, 843, 4895, 469, 8421}}, {2040, 15, 1588, {1, 3, 1, 15, 29, 47, 17, 125, 471, 927, 349, 3859, 3059, 11483, 14791}}, {2041, 15, 1603, {1, 3, 1, 11, 17, 17, 111, 109, 9, 213, 1313, 3903, 4411, 4329, 28277}}, {2042, 15, 1609, {1, 3, 3, 15, 1, 55, 47, 69, 143, 789, 1149, 3833, 5053, 6949, 10569}}, {2043, 15, 1617, {1, 3, 5, 7, 11, 15, 79, 83, 123, 937, 1115, 2775, 3041, 11869, 21167}}, {2044, 15, 1620, {1, 3, 7, 13, 9, 47, 45, 221, 139, 923, 1661, 1379, 2485, 7233, 6035}}, {2045, 15, 1629, {1, 1, 3, 3, 11, 55, 77, 3, 87, 693, 1991, 1145, 2783, 16207, 24569}}, {2046, 15, 1636, {1, 1, 5, 11, 3, 35, 91, 9, 391, 927, 101, 1839, 3755, 10345, 16907}}, {2047, 15, 1648, {1, 3, 5, 3, 5, 49, 79, 91, 205, 443, 1369, 197, 2537, 11219, 17765}}, {2048, 15, 1667, {1, 1, 3, 15, 9, 7, 25, 25, 357, 247, 477, 421, 7679, 5987, 30079}}, {2049, 15, 1669, {1, 1, 5, 3, 29, 5, 89, 117, 481, 491, 371, 389, 7101, 2253, 23617}}, {2050, 15, 1682, {1, 1, 5, 13, 29, 59, 17, 181, 511, 291, 1991, 3499, 8177, 5559, 30045}}, {2051, 15, 1697, {1, 3, 3, 11, 23, 31, 117, 217, 241, 115, 749, 945, 1897, 12253, 8473}}, {2052, 15, 1704, {1, 1, 7, 15, 25, 47, 31, 1, 165, 311, 635, 3629, 1593, 8305, 30033}}, {2053, 15, 1709, {1, 3, 5, 9, 3, 17, 101, 237, 379, 503, 49, 929, 1687, 3865, 26723}}, {2054, 15, 1727, {1, 3, 5, 5, 15, 41, 1, 239, 53, 215, 1733, 827, 579, 4089, 6579}}, {2055, 15, 1730, {1, 3, 1, 15, 15, 21, 35, 21, 403, 257, 1475, 2403, 4705, 11553, 203}}, {2056, 15, 1732, {1, 3, 5, 11, 9, 53, 113, 9, 447, 511, 543, 3141, 7389, 11249, 431}}, {2057, 15, 1741, {1, 3, 5, 9, 9, 11, 55, 93, 325, 411, 305, 2573, 6871, 12339, 6435}}, {2058, 15, 1744, {1, 3, 3, 7, 31, 27, 21, 113, 99, 853, 365, 589, 3731, 10875, 12767}}, {2059, 15, 1759, {1, 3, 1, 7, 15, 27, 31, 17, 275, 93, 1161, 2619, 1329, 7307, 587}}, {2060, 15, 1765, {1, 3, 5, 9, 17, 47, 49, 237, 27, 193, 1237, 591, 5151, 5521, 31583}}, {2061, 15, 1766, {1, 3, 5, 3, 13, 1, 27, 87, 43, 977, 305, 3293, 2475, 14571, 18321}}, {2062, 15, 1778, {1, 1, 5, 7, 15, 13, 101, 1, 291, 807, 1711, 2277, 5573, 11051, 13133}}, {2063, 15, 1780, {1, 3, 3, 1, 9, 3, 65, 81, 415, 733, 1527, 2747, 6069, 159, 7095}}, {2064, 15, 1783, {1, 3, 3, 15, 27, 1, 71, 49, 231, 851, 2039, 613, 1899, 2537, 14511}}, {2065, 15, 1797, {1, 1, 1, 11, 3, 41, 55, 23, 247, 1011, 581, 2363, 2745, 1337, 20931}}, {2066, 15, 1807, {1, 1, 3, 11, 17, 61, 67, 255, 143, 357, 945, 3407, 5817, 4155, 23851}}, {2067, 15, 1821, {1, 3, 5, 3, 23, 1, 75, 247, 265, 413, 1899, 2565, 6629, 15655, 16117}}, {2068, 15, 1832, {1, 1, 1, 9, 11, 49, 11, 189, 223, 177, 1457, 1931, 163, 15905, 17297}}, {2069, 15, 1835, {1, 3, 7, 13, 17, 1, 111, 189, 343, 961, 427, 2507, 2393, 8653, 6353}}, {2070, 15, 1849, {1, 3, 7, 13, 23, 61, 59, 51, 313, 963, 791, 3681, 5637, 3965, 9263}}, {2071, 15, 1850, {1, 3, 7, 7, 21, 53, 127, 141, 499, 859, 337, 2835, 3195, 4351, 32369}}, {2072, 15, 1863, {1, 1, 7, 5, 1, 5, 53, 63, 497, 535, 35, 305, 4395, 9757, 13193}}, {2073, 15, 1867, {1, 1, 5, 13, 13, 31, 59, 229, 211, 745, 1453, 3677, 3005, 7703, 23907}}, {2074, 15, 1869, {1, 3, 5, 5, 7, 63, 17, 197, 493, 861, 499, 3015, 6349, 1815, 7437}}, {2075, 15, 1872, {1, 1, 1, 13, 13, 37, 29, 189, 253, 1017, 321, 3145, 407, 7547, 17099}}, {2076, 15, 1887, {1, 3, 3, 3, 23, 53, 69, 77, 175, 17, 1831, 841, 3851, 1295, 32107}}, {2077, 15, 1888, {1, 3, 7, 13, 13, 39, 107, 237, 389, 729, 635, 3717, 3041, 3169, 14987}}, {2078, 15, 1897, {1, 1, 3, 1, 25, 7, 69, 35, 495, 49, 659, 2783, 6051, 13875, 23927}}, {2079, 15, 1906, {1, 3, 7, 5, 5, 25, 49, 7, 193, 493, 93, 657, 1515, 13975, 14155}}, {2080, 15, 1917, {1, 3, 1, 1, 11, 15, 113, 45, 21, 595, 731, 3397, 4117, 9711, 16625}}, {2081, 15, 1927, {1, 3, 3, 9, 19, 19, 59, 7, 105, 579, 599, 2859, 97, 14717, 15361}}, {2082, 15, 1939, {1, 1, 1, 5, 27, 49, 113, 5, 367, 563, 1397, 2805, 3021, 3111, 20671}}, {2083, 15, 1941, {1, 3, 3, 15, 27, 51, 99, 167, 109, 365, 1959, 1523, 6959, 14405, 18191}}, {2084, 15, 1948, {1, 3, 1, 5, 21, 51, 125, 67, 123, 45, 1657, 51, 4825, 14081, 31049}}, {2085, 15, 1970, {1, 1, 5, 7, 21, 59, 21, 249, 77, 793, 1687, 2561, 2241, 4321, 7477}}, {2086, 15, 1979, {1, 1, 1, 7, 15, 35, 71, 29, 267, 611, 1813, 1823, 7039, 3299, 9919}}, {2087, 15, 1982, {1, 3, 7, 11, 21, 59, 109, 213, 371, 785, 659, 1687, 4827, 6017, 19619}}, {2088, 15, 2002, {1, 1, 3, 11, 27, 17, 1, 55, 367, 939, 333, 127, 5105, 2405, 28139}}, {2089, 15, 2020, {1, 1, 7, 13, 5, 35, 59, 133, 509, 573, 625, 3857, 7935, 5279, 3727}}, {2090, 15, 2024, {1, 1, 1, 7, 11, 47, 127, 157, 19, 403, 151, 1143, 7407, 8985, 32521}}, {2091, 15, 2032, {1, 3, 1, 1, 5, 13, 105, 123, 63, 139, 1569, 1983, 563, 7175, 27705}}, {2092, 15, 2053, {1, 1, 3, 13, 9, 35, 105, 227, 145, 21, 1369, 57, 393, 2921, 18511}}, {2093, 15, 2060, {1, 3, 1, 7, 17, 61, 99, 187, 261, 281, 437, 2219, 5999, 1857, 18001}}, {2094, 15, 2063, {1, 3, 3, 5, 1, 59, 67, 45, 451, 439, 2005, 3607, 3, 7167, 14227}}, {2095, 15, 2066, {1, 3, 3, 3, 29, 19, 25, 251, 275, 733, 1749, 4021, 871, 3227, 13701}}, {2096, 15, 2075, {1, 3, 3, 13, 27, 53, 57, 243, 491, 521, 1921, 1037, 5013, 5703, 15261}}, {2097, 15, 2078, {1, 3, 1, 11, 13, 57, 1, 15, 123, 533, 785, 335, 1423, 14269, 3483}}, {2098, 15, 2081, {1, 3, 7, 13, 15, 55, 5, 139, 385, 47, 1981, 1291, 7397, 12925, 29445}}, {2099, 15, 2091, {1, 1, 7, 1, 23, 23, 59, 93, 117, 57, 63, 3047, 4849, 11637, 25311}}, {2100, 15, 2096, {1, 1, 7, 13, 19, 37, 25, 203, 477, 447, 1345, 3485, 2099, 13347, 11621}}, {2101, 15, 2102, {1, 1, 7, 3, 11, 23, 81, 17, 41, 735, 1149, 3253, 7665, 8291, 22293}}, {2102, 15, 2106, {1, 1, 5, 3, 15, 9, 57, 167, 463, 493, 747, 1947, 6471, 1111, 31619}}, {2103, 15, 2116, {1, 1, 5, 15, 7, 15, 107, 205, 325, 167, 1749, 927, 3589, 6127, 7617}}, {2104, 15, 2120, {1, 1, 1, 13, 21, 25, 83, 147, 411, 399, 1423, 2279, 3661, 7591, 17429}}, {2105, 15, 2125, {1, 1, 1, 9, 5, 17, 69, 205, 243, 647, 473, 1717, 1977, 10725, 2913}}, {2106, 15, 2134, {1, 1, 3, 5, 5, 37, 103, 15, 485, 641, 1761, 3755, 6997, 10985, 11773}}, {2107, 15, 2178, {1, 1, 5, 13, 9, 51, 87, 195, 97, 807, 1801, 961, 6341, 4307, 29105}}, {2108, 15, 2180, {1, 3, 1, 13, 9, 35, 83, 61, 387, 817, 951, 3993, 7831, 8479, 23941}}, {2109, 15, 2187, {1, 1, 7, 11, 19, 47, 75, 37, 91, 337, 953, 1169, 163, 2259, 24713}}, {2110, 15, 2189, {1, 1, 1, 11, 13, 15, 83, 171, 159, 87, 619, 2973, 2653, 13725, 12499}}, {2111, 15, 2190, {1, 3, 5, 3, 5, 63, 119, 25, 343, 269, 553, 2183, 959, 3825, 22189}}, {2112, 15, 2208, {1, 1, 5, 15, 5, 37, 89, 109, 497, 1013, 265, 669, 1859, 2647, 3445}}, {2113, 15, 2214, {1, 3, 3, 9, 21, 21, 15, 245, 107, 649, 367, 1601, 7279, 15783, 4943}}, {2114, 15, 2237, {1, 3, 3, 15, 5, 41, 125, 113, 159, 161, 1191, 3491, 3531, 55, 20857}}, {2115, 15, 2252, {1, 3, 5, 9, 21, 57, 21, 195, 99, 193, 1915, 2923, 6349, 15085, 24929}}, {2116, 15, 2257, {1, 1, 1, 11, 31, 11, 73, 141, 361, 621, 1021, 2067, 5115, 12665, 26845}}, {2117, 15, 2260, {1, 1, 1, 3, 29, 11, 43, 61, 209, 923, 1753, 1937, 843, 205, 8367}}, {2118, 15, 2264, {1, 1, 1, 5, 15, 33, 119, 209, 215, 973, 1775, 815, 6693, 7957, 14517}}, {2119, 15, 2270, {1, 1, 1, 5, 17, 57, 27, 147, 489, 59, 1439, 2279, 445, 11791, 19739}}, {2120, 15, 2279, {1, 3, 1, 7, 11, 55, 1, 83, 305, 17, 1909, 405, 2325, 5293, 28559}}, {2121, 15, 2288, {1, 3, 3, 7, 11, 27, 103, 157, 455, 1005, 2033, 3145, 1919, 15723, 25197}}, {2122, 15, 2305, {1, 1, 5, 11, 15, 51, 37, 131, 503, 1007, 1795, 2421, 1335, 7413, 21741}}, {2123, 15, 2312, {1, 1, 3, 1, 23, 63, 69, 83, 419, 283, 583, 123, 7725, 2243, 8403}}, {2124, 15, 2317, {1, 1, 5, 5, 27, 45, 109, 17, 299, 65, 351, 947, 1165, 10723, 2053}}, {2125, 15, 2323, {1, 1, 3, 3, 23, 61, 115, 253, 1, 931, 1481, 3187, 441, 14735, 27207}}, {2126, 15, 2329, {1, 1, 5, 3, 25, 11, 83, 141, 359, 343, 901, 1629, 731, 12841, 14357}}, {2127, 15, 2335, {1, 1, 3, 9, 7, 45, 97, 3, 299, 217, 663, 1527, 6379, 4527, 26147}}, {2128, 15, 2342, {1, 1, 7, 9, 11, 53, 9, 203, 337, 713, 1517, 719, 4587, 11443, 26905}}, {2129, 15, 2345, {1, 1, 7, 9, 11, 41, 125, 213, 237, 377, 361, 3231, 4223, 3263, 12655}}, {2130, 15, 2365, {1, 3, 7, 7, 7, 33, 99, 19, 117, 273, 985, 107, 3831, 10135, 19423}}, {2131, 15, 2371, {1, 1, 5, 15, 25, 41, 13, 125, 449, 169, 1149, 4021, 5663, 3077, 19163}}, {2132, 15, 2378, {1, 3, 5, 9, 25, 57, 47, 103, 269, 51, 1805, 2503, 6687, 8065, 12045}}, {2133, 15, 2385, {1, 3, 5, 7, 3, 35, 87, 225, 189, 229, 931, 3293, 1347, 1427, 3269}}, {2134, 15, 2395, {1, 1, 1, 3, 5, 31, 61, 19, 247, 9, 1667, 343, 559, 2703, 3763}}, {2135, 15, 2404, {1, 3, 5, 15, 31, 19, 57, 187, 109, 121, 1287, 2269, 659, 16235, 1273}}, {2136, 15, 2414, {1, 1, 1, 3, 5, 47, 59, 243, 255, 97, 1959, 1723, 1347, 3019, 26989}}, {2137, 15, 2426, {1, 3, 3, 15, 29, 35, 75, 67, 497, 731, 193, 3307, 3579, 12005, 7209}}, {2138, 15, 2428, {1, 1, 5, 9, 13, 35, 79, 213, 51, 983, 1927, 1793, 5037, 5463, 965}}, {2139, 15, 2441, {1, 1, 7, 11, 5, 41, 7, 83, 15, 411, 1775, 3515, 6755, 3249, 16425}}, {2140, 15, 2456, {1, 3, 5, 1, 19, 61, 3, 19, 395, 819, 1331, 179, 5225, 5333, 3601}}, {2141, 15, 2466, {1, 1, 3, 9, 7, 5, 87, 15, 387, 609, 1465, 277, 987, 8377, 903}}, {2142, 15, 2468, {1, 1, 1, 3, 15, 11, 123, 107, 355, 333, 285, 1801, 6989, 1549, 25791}}, {2143, 15, 2475, {1, 1, 7, 13, 27, 13, 73, 111, 481, 227, 1091, 365, 5713, 5087, 27217}}, {2144, 15, 2489, {1, 3, 3, 15, 1, 55, 95, 213, 377, 405, 139, 1867, 2175, 4217, 28813}}, {2145, 15, 2495, {1, 3, 5, 11, 21, 43, 109, 155, 181, 901, 1951, 507, 4389, 10815, 3141}}, {2146, 15, 2497, {1, 1, 1, 15, 17, 11, 43, 215, 501, 19, 259, 3479, 6381, 6927, 31247}}, {2147, 15, 2510, {1, 3, 5, 15, 19, 61, 75, 41, 391, 95, 865, 1441, 7993, 13979, 24663}}, {2148, 15, 2512, {1, 3, 1, 3, 21, 15, 115, 213, 1, 645, 777, 1517, 2543, 11223, 3633}}, {2149, 15, 2522, {1, 3, 5, 3, 9, 57, 39, 211, 407, 65, 1795, 2805, 2799, 8691, 1987}}, {2150, 15, 2533, {1, 1, 3, 13, 17, 55, 47, 113, 29, 139, 1301, 3303, 1129, 13947, 29821}}, {2151, 15, 2543, {1, 1, 3, 13, 5, 35, 97, 151, 477, 409, 1397, 3399, 4421, 15929, 6163}}, {2152, 15, 2551, {1, 3, 1, 9, 21, 51, 99, 133, 149, 763, 623, 173, 4311, 11081, 1095}}, {2153, 15, 2552, {1, 3, 7, 15, 13, 3, 99, 3, 195, 907, 1335, 1355, 7977, 5773, 32383}}, {2154, 15, 2557, {1, 1, 3, 9, 17, 43, 43, 217, 475, 917, 1373, 1677, 4871, 9619, 16657}}, {2155, 15, 2567, {1, 3, 3, 7, 31, 31, 55, 11, 73, 693, 25, 417, 1195, 6225, 32279}}, {2156, 15, 2581, {1, 3, 5, 9, 21, 57, 127, 149, 79, 379, 1609, 2543, 6473, 16033, 27191}}, {2157, 15, 2586, {1, 1, 5, 1, 13, 9, 81, 153, 297, 789, 1749, 2819, 3961, 11231, 24927}}, {2158, 15, 2597, {1, 3, 5, 3, 23, 61, 45, 43, 43, 133, 1481, 1543, 2991, 13739, 10287}}, {2159, 15, 2601, {1, 1, 3, 9, 25, 43, 31, 177, 337, 193, 1083, 1, 991, 9725, 8379}}, {2160, 15, 2622, {1, 3, 5, 11, 13, 33, 65, 83, 421, 149, 409, 2443, 7423, 8847, 29599}}, {2161, 15, 2633, {1, 1, 5, 11, 11, 1, 23, 225, 77, 585, 1505, 2525, 739, 10915, 25733}}, {2162, 15, 2636, {1, 3, 7, 13, 7, 55, 3, 223, 415, 521, 1865, 2349, 5663, 7455, 16569}}, {2163, 15, 2642, {1, 1, 7, 13, 1, 45, 121, 49, 463, 99, 1061, 2559, 5087, 13389, 11035}}, {2164, 15, 2644, {1, 3, 7, 11, 31, 51, 35, 235, 385, 1023, 1771, 2013, 5437, 4877, 22119}}, {2165, 15, 2653, {1, 3, 3, 11, 21, 3, 11, 119, 81, 737, 1093, 2377, 4055, 1121, 15767}}, {2166, 15, 2667, {1, 1, 5, 13, 9, 3, 83, 217, 387, 249, 1047, 1861, 4103, 15367, 24545}}, {2167, 15, 2669, {1, 3, 3, 1, 5, 37, 43, 183, 383, 463, 937, 1165, 1481, 959, 17047}}, {2168, 15, 2672, {1, 1, 3, 5, 7, 43, 127, 243, 81, 1021, 165, 753, 4711, 12965, 22049}}, {2169, 15, 2675, {1, 1, 5, 5, 3, 61, 65, 53, 425, 89, 5, 1467, 1395, 9579, 8961}}, {2170, 15, 2682, {1, 3, 7, 13, 11, 35, 123, 21, 83, 689, 667, 1203, 5959, 15697, 26885}}, {2171, 15, 2687, {1, 1, 5, 13, 9, 49, 41, 101, 291, 339, 1067, 657, 4453, 1137, 21131}}, {2172, 15, 2691, {1, 3, 3, 3, 17, 61, 11, 213, 27, 805, 1691, 1057, 6011, 11941, 18883}}, {2173, 15, 2698, {1, 3, 1, 7, 3, 51, 5, 63, 121, 3, 245, 2631, 3737, 16121, 26803}}, {2174, 15, 2708, {1, 3, 1, 1, 23, 51, 79, 19, 161, 107, 609, 3489, 3389, 4035, 2427}}, {2175, 15, 2712, {1, 3, 1, 1, 17, 11, 101, 101, 373, 63, 1641, 285, 1333, 165, 14025}}, {2176, 15, 2718, {1, 1, 1, 5, 1, 51, 83, 137, 45, 1019, 821, 867, 6055, 10443, 9857}}, {2177, 15, 2722, {1, 3, 1, 5, 17, 23, 25, 181, 429, 495, 317, 3219, 5963, 13945, 9969}}, {2178, 15, 2736, {1, 3, 7, 3, 3, 15, 123, 191, 369, 177, 1697, 2113, 3889, 5201, 21839}}, {2179, 15, 2741, {1, 3, 1, 11, 21, 39, 51, 139, 271, 605, 1007, 3513, 3365, 3781, 6799}}, {2180, 15, 2756, {1, 1, 7, 5, 13, 19, 47, 165, 249, 405, 255, 1295, 4513, 14395, 5587}}, {2181, 15, 2765, {1, 1, 3, 7, 5, 17, 99, 1, 393, 31, 621, 797, 6113, 16003, 32043}}, {2182, 15, 2774, {1, 3, 5, 13, 11, 21, 65, 81, 147, 443, 775, 3671, 7029, 11749, 3339}}, {2183, 15, 2799, {1, 3, 7, 1, 23, 33, 99, 177, 161, 577, 1729, 617, 3465, 11787, 17577}}, {2184, 15, 2804, {1, 1, 5, 7, 15, 15, 53, 193, 97, 255, 1223, 545, 5153, 873, 24525}}, {2185, 15, 2825, {1, 3, 5, 1, 7, 57, 47, 121, 383, 835, 1709, 2363, 4731, 12163, 7001}}, {2186, 15, 2826, {1, 3, 3, 11, 19, 33, 63, 99, 387, 95, 783, 1009, 6373, 4021, 7685}}, {2187, 15, 2840, {1, 1, 1, 15, 25, 33, 73, 135, 335, 785, 935, 1927, 5847, 10501, 7719}}, {2188, 15, 2843, {1, 1, 5, 3, 27, 45, 71, 215, 489, 157, 1189, 2577, 6901, 10219, 3025}}, {2189, 15, 2846, {1, 1, 7, 7, 21, 3, 97, 225, 101, 159, 293, 2789, 7955, 14829, 1209}}, {2190, 15, 2849, {1, 3, 1, 5, 23, 41, 83, 63, 361, 195, 1707, 2081, 5363, 6327, 179}}, {2191, 15, 2867, {1, 1, 3, 1, 21, 51, 59, 67, 175, 363, 825, 2971, 3321, 8837, 11805}}, {2192, 15, 2876, {1, 3, 7, 1, 19, 3, 15, 21, 429, 675, 1589, 2615, 2575, 1537, 7139}}, {2193, 15, 2891, {1, 3, 3, 5, 21, 29, 17, 115, 345, 397, 523, 1699, 7043, 11173, 3023}}, {2194, 15, 2902, {1, 1, 5, 7, 19, 63, 99, 175, 91, 433, 153, 3749, 517, 13667, 7423}}, {2195, 15, 2912, {1, 3, 7, 3, 25, 23, 53, 149, 65, 551, 1231, 365, 6637, 15137, 16319}}, {2196, 15, 2917, {1, 3, 7, 13, 5, 45, 11, 151, 323, 31, 1749, 409, 6753, 10503, 14991}}, {2197, 15, 2927, {1, 3, 7, 3, 5, 21, 29, 117, 321, 341, 1811, 3619, 4337, 12255, 8629}}, {2198, 15, 2941, {1, 3, 7, 3, 7, 3, 5, 221, 407, 671, 1763, 3669, 2353, 8175, 23489}}, {2199, 15, 2965, {1, 1, 3, 7, 11, 55, 53, 185, 247, 35, 1823, 513, 1379, 11827, 20069}}, {2200, 15, 2970, {1, 3, 3, 5, 29, 51, 73, 191, 185, 961, 881, 2019, 5651, 1019, 15587}}, {2201, 15, 2982, {1, 3, 7, 13, 7, 55, 59, 5, 417, 829, 453, 2339, 587, 13283, 797}}, {2202, 15, 2993, {1, 3, 7, 3, 11, 41, 75, 85, 65, 149, 1583, 529, 2707, 11479, 7109}}, {2203, 15, 3018, {1, 3, 7, 9, 13, 57, 37, 243, 91, 613, 665, 171, 1631, 13737, 2377}}, {2204, 15, 3023, {1, 1, 3, 7, 5, 43, 97, 53, 477, 793, 999, 3647, 2555, 7371, 19295}}, {2205, 15, 3025, {1, 1, 7, 1, 1, 9, 99, 253, 317, 817, 1559, 2081, 2529, 14611, 15997}}, {2206, 15, 3026, {1, 3, 3, 1, 5, 41, 57, 121, 387, 441, 709, 1511, 7045, 8409, 13297}}, {2207, 15, 3028, {1, 1, 1, 13, 29, 57, 63, 183, 327, 473, 1943, 213, 3973, 16289, 2739}}, {2208, 15, 3032, {1, 3, 7, 9, 25, 15, 75, 185, 335, 881, 1041, 3339, 4471, 6823, 21121}}, {2209, 15, 3053, {1, 3, 3, 13, 23, 3, 57, 117, 511, 927, 771, 3229, 949, 15487, 11963}}, {2210, 15, 3054, {1, 1, 3, 7, 27, 19, 55, 207, 331, 705, 1945, 797, 7125, 10493, 16585}}, {2211, 15, 3065, {1, 3, 1, 1, 29, 7, 91, 93, 459, 93, 1501, 1927, 6415, 16255, 9823}}, {2212, 15, 3071, {1, 1, 5, 5, 31, 11, 97, 179, 505, 807, 877, 4003, 4377, 8851, 4239}}, {2213, 15, 3076, {1, 1, 3, 5, 11, 25, 17, 131, 23, 95, 311, 1429, 2029, 13091, 23739}}, {2214, 15, 3088, {1, 1, 3, 11, 13, 27, 33, 127, 481, 117, 1127, 1619, 6493, 8507, 6615}}, {2215, 15, 3107, {1, 3, 1, 13, 19, 27, 89, 101, 27, 235, 1579, 1701, 4421, 16037, 16239}}, {2216, 15, 3146, {1, 3, 1, 15, 1, 15, 3, 117, 317, 475, 1691, 2423, 5519, 1703, 2969}}, {2217, 15, 3148, {1, 1, 3, 1, 13, 15, 19, 37, 237, 467, 1321, 453, 2169, 13313, 31499}}, {2218, 15, 3159, {1, 1, 3, 15, 29, 55, 31, 199, 85, 285, 967, 367, 3941, 151, 20587}}, {2219, 15, 3165, {1, 3, 7, 15, 7, 13, 31, 35, 117, 543, 1179, 3441, 3039, 11225, 30229}}, {2220, 15, 3170, {1, 1, 3, 15, 3, 43, 1, 63, 353, 395, 1775, 3493, 5175, 13193, 25343}}, {2221, 15, 3179, {1, 3, 3, 15, 17, 25, 57, 205, 411, 83, 1877, 2093, 5599, 12115, 8751}}, {2222, 15, 3182, {1, 1, 1, 11, 15, 9, 115, 99, 85, 887, 987, 4015, 7077, 3739, 21505}}, {2223, 15, 3205, {1, 3, 1, 11, 25, 39, 127, 37, 329, 273, 1531, 3211, 7115, 15501, 26575}}, {2224, 15, 3212, {1, 1, 5, 13, 15, 3, 3, 101, 431, 645, 493, 723, 8083, 1423, 14879}}, {2225, 15, 3218, {1, 3, 3, 5, 31, 35, 37, 131, 259, 849, 325, 3403, 3627, 3295, 30885}}, {2226, 15, 3220, {1, 3, 7, 1, 9, 3, 31, 201, 379, 907, 1005, 3333, 7457, 2533, 30357}}, {2227, 15, 3223, {1, 3, 1, 9, 7, 7, 95, 103, 121, 157, 895, 2683, 5839, 12403, 14327}}, {2228, 15, 3227, {1, 3, 7, 3, 13, 5, 55, 233, 3, 855, 859, 1115, 3883, 8041, 3353}}, {2229, 15, 3233, {1, 1, 5, 9, 3, 55, 99, 79, 263, 831, 1579, 205, 5673, 1999, 14879}}, {2230, 15, 3234, {1, 3, 1, 5, 17, 25, 85, 19, 189, 141, 877, 667, 4461, 11915, 23247}}, {2231, 15, 3254, {1, 1, 5, 5, 1, 35, 15, 219, 469, 725, 1793, 3683, 3661, 15627, 30197}}, {2232, 15, 3263, {1, 1, 7, 5, 27, 3, 41, 153, 431, 487, 759, 1345, 6735, 9937, 26277}}, {2233, 15, 3268, {1, 1, 1, 11, 11, 13, 41, 121, 265, 465, 1447, 5, 3407, 1907, 10037}}, {2234, 15, 3272, {1, 3, 5, 9, 15, 63, 5, 7, 407, 83, 365, 3687, 7721, 6973, 16967}}, {2235, 15, 3277, {1, 1, 7, 7, 5, 41, 75, 155, 417, 565, 1199, 1111, 2823, 10703, 22561}}, {2236, 15, 3292, {1, 3, 7, 5, 7, 43, 39, 185, 105, 327, 1977, 1137, 3261, 10583, 11661}}, {2237, 15, 3295, {1, 3, 7, 7, 19, 19, 103, 137, 169, 273, 1357, 3413, 7647, 10531, 32489}}, {2238, 15, 3296, {1, 1, 3, 13, 13, 3, 81, 23, 161, 295, 735, 2031, 1027, 15513, 20165}}, {2239, 15, 3301, {1, 1, 5, 1, 15, 1, 91, 35, 375, 207, 1417, 1115, 2237, 11749, 8509}}, {2240, 15, 3306, {1, 3, 7, 3, 25, 51, 49, 219, 195, 417, 1523, 3953, 5739, 7499, 27071}}, {2241, 15, 3313, {1, 1, 3, 11, 23, 29, 19, 81, 421, 633, 513, 547, 7545, 29, 11909}}, {2242, 15, 3346, {1, 1, 1, 7, 13, 61, 33, 243, 221, 231, 111, 879, 2861, 1795, 27531}}, {2243, 15, 3367, {1, 3, 7, 3, 19, 21, 1, 141, 159, 605, 969, 3013, 6583, 2447, 19919}}, {2244, 15, 3371, {1, 3, 7, 3, 31, 9, 91, 83, 29, 873, 929, 43, 2253, 12539, 23951}}, {2245, 15, 3373, {1, 1, 5, 3, 31, 15, 87, 105, 319, 973, 1489, 3417, 3377, 15749, 2357}}, {2246, 15, 3374, {1, 1, 3, 15, 7, 23, 3, 81, 383, 419, 713, 997, 6873, 593, 285}}, {2247, 15, 3376, {1, 3, 3, 1, 29, 13, 29, 101, 441, 693, 2039, 2951, 5921, 12129, 12053}}, {2248, 15, 3382, {1, 1, 3, 15, 9, 29, 97, 117, 421, 433, 1017, 125, 3607, 9415, 6843}}, {2249, 15, 3388, {1, 3, 5, 9, 11, 13, 75, 155, 413, 75, 109, 1599, 6161, 16115, 12621}}, {2250, 15, 3391, {1, 3, 3, 3, 11, 13, 49, 225, 401, 599, 1815, 1643, 7853, 13305, 25195}}, {2251, 15, 3403, {1, 3, 7, 5, 15, 11, 27, 95, 387, 931, 549, 2179, 3397, 15883, 16563}}, {2252, 15, 3406, {1, 1, 7, 3, 9, 39, 121, 5, 453, 27, 1747, 657, 2593, 1289, 12577}}, {2253, 15, 3413, {1, 3, 7, 5, 25, 25, 109, 49, 185, 985, 631, 803, 3865, 8955, 17901}}, {2254, 15, 3420, {1, 1, 3, 13, 3, 59, 47, 49, 139, 275, 1471, 2995, 5593, 14011, 18741}}, {2255, 15, 3427, {1, 1, 5, 15, 29, 11, 97, 225, 245, 291, 1873, 2365, 767, 3419, 14943}}, {2256, 15, 3441, {1, 3, 3, 5, 15, 17, 19, 209, 359, 891, 1375, 2003, 7247, 5299, 28841}}, {2257, 15, 3453, {1, 3, 7, 7, 9, 55, 105, 35, 77, 47, 1023, 13, 2901, 847, 10265}}, {2258, 15, 3464, {1, 3, 7, 7, 7, 5, 65, 233, 141, 277, 1333, 2357, 443, 7257, 21979}}, {2259, 15, 3469, {1, 3, 5, 11, 13, 63, 41, 87, 193, 737, 1085, 2317, 7869, 10149, 12163}}, {2260, 15, 3481, {1, 3, 1, 1, 7, 57, 75, 235, 461, 857, 155, 2679, 5925, 2565, 10881}}, {2261, 15, 3488, {1, 1, 7, 15, 13, 41, 63, 135, 433, 387, 1943, 2249, 5469, 11679, 28661}}, {2262, 15, 3497, {1, 3, 3, 13, 5, 3, 103, 161, 367, 649, 789, 1179, 4163, 5699, 16787}}, {2263, 15, 3503, {1, 3, 7, 7, 31, 13, 45, 141, 113, 769, 1035, 457, 6709, 14989, 27311}}, {2264, 15, 3511, {1, 1, 3, 1, 1, 43, 119, 145, 111, 593, 1139, 417, 637, 4437, 17285}}, {2265, 15, 3515, {1, 3, 5, 9, 9, 33, 19, 99, 201, 685, 1793, 2621, 6857, 8769, 5623}}, {2266, 15, 3525, {1, 3, 5, 5, 23, 43, 27, 189, 325, 415, 215, 1253, 3599, 1215, 10093}}, {2267, 15, 3529, {1, 1, 3, 13, 11, 35, 113, 173, 503, 19, 1459, 503, 5363, 3967, 13945}}, {2268, 15, 3547, {1, 1, 5, 11, 31, 49, 13, 173, 199, 623, 1231, 2495, 6581, 7957, 25321}}, {2269, 15, 3550, {1, 3, 1, 9, 23, 3, 79, 149, 505, 937, 1839, 3701, 1673, 8589, 8031}}, {2270, 15, 3573, {1, 3, 3, 5, 21, 27, 107, 11, 505, 407, 177, 3593, 4729, 12773, 11685}}, {2271, 15, 3583, {1, 3, 1, 11, 29, 49, 79, 53, 61, 895, 2035, 563, 5613, 6065, 6207}}, {2272, 15, 3594, {1, 1, 3, 7, 1, 53, 3, 215, 99, 865, 1749, 3533, 4305, 1243, 28463}}, {2273, 15, 3607, {1, 1, 1, 13, 31, 59, 115, 53, 403, 909, 847, 103, 4967, 10623, 30073}}, {2274, 15, 3613, {1, 1, 7, 5, 27, 1, 119, 83, 457, 81, 395, 811, 6221, 14337, 541}}, {2275, 15, 3624, {1, 1, 5, 5, 5, 53, 83, 117, 269, 327, 875, 101, 3343, 715, 26339}}, {2276, 15, 3630, {1, 1, 1, 11, 31, 39, 121, 147, 305, 383, 1211, 1897, 7647, 11687, 18907}}, {2277, 15, 3635, {1, 3, 3, 15, 23, 53, 17, 85, 395, 503, 61, 1745, 4713, 4641, 13787}}, {2278, 15, 3642, {1, 1, 7, 7, 27, 1, 105, 29, 287, 37, 959, 975, 4427, 4705, 10175}}, {2279, 15, 3644, {1, 3, 3, 5, 7, 63, 57, 199, 27, 107, 1095, 3923, 6969, 713, 11619}}, {2280, 15, 3650, {1, 3, 5, 1, 5, 49, 85, 45, 449, 45, 49, 3419, 1109, 455, 15917}}, {2281, 15, 3679, {1, 1, 1, 5, 13, 15, 39, 27, 467, 85, 1537, 3055, 1977, 8829, 25231}}, {2282, 15, 3690, {1, 1, 1, 15, 1, 47, 23, 121, 147, 547, 1865, 1491, 779, 3515, 12667}}, {2283, 15, 3698, {1, 3, 3, 1, 19, 5, 77, 101, 1, 721, 1149, 2967, 4925, 11889, 16655}}, {2284, 15, 3704, {1, 1, 1, 7, 1, 35, 95, 239, 127, 855, 1031, 455, 7631, 6039, 21983}}, {2285, 15, 3707, {1, 3, 7, 9, 23, 43, 75, 105, 335, 223, 1825, 3217, 413, 7473, 30005}}, {2286, 15, 3713, {1, 1, 5, 15, 29, 9, 43, 145, 223, 523, 511, 323, 5955, 11141, 22533}}, {2287, 15, 3754, {1, 1, 3, 1, 13, 61, 93, 133, 461, 233, 383, 693, 7347, 3165, 27493}}, {2288, 15, 3756, {1, 3, 7, 1, 13, 45, 113, 207, 53, 1007, 815, 1145, 2937, 289, 22195}}, {2289, 15, 3761, {1, 3, 5, 5, 19, 17, 113, 89, 19, 1023, 1625, 3277, 697, 5187, 15433}}, {2290, 15, 3776, {1, 1, 3, 13, 21, 15, 15, 197, 409, 391, 1993, 2475, 3189, 4431, 29585}}, {2291, 15, 3781, {1, 1, 5, 5, 31, 7, 111, 231, 187, 543, 45, 3863, 3811, 4573, 4437}}, {2292, 15, 3788, {1, 3, 3, 7, 19, 7, 123, 23, 79, 513, 189, 3663, 1291, 13257, 8949}}, {2293, 15, 3791, {1, 1, 5, 13, 3, 53, 109, 133, 157, 223, 651, 3059, 6055, 14455, 26903}}, {2294, 15, 3794, {1, 1, 7, 1, 23, 63, 59, 229, 17, 199, 643, 637, 7631, 13647, 7399}}, {2295, 15, 3806, {1, 1, 1, 3, 1, 51, 119, 67, 335, 543, 913, 3565, 4795, 13405, 7463}}, {2296, 15, 3841, {1, 1, 5, 3, 31, 5, 91, 97, 23, 223, 837, 1353, 1929, 12043, 10039}}, {2297, 15, 3848, {1, 3, 5, 7, 19, 3, 79, 171, 301, 687, 1545, 355, 4709, 12965, 16797}}, {2298, 15, 3851, {1, 3, 5, 11, 11, 49, 111, 123, 251, 569, 1605, 401, 5439, 13519, 8847}}, {2299, 15, 3856, {1, 3, 1, 3, 3, 53, 7, 55, 369, 633, 181, 4037, 2993, 15815, 8661}}, {2300, 15, 3868, {1, 1, 1, 13, 31, 29, 75, 167, 279, 597, 539, 1791, 8013, 4387, 9717}}, {2301, 15, 3875, {1, 1, 5, 7, 17, 15, 99, 183, 211, 49, 225, 3143, 4537, 13141, 23375}}, {2302, 15, 3882, {1, 1, 3, 5, 3, 59, 25, 149, 467, 69, 1939, 1007, 2765, 4693, 29815}}, {2303, 15, 3884, {1, 3, 1, 3, 17, 33, 119, 189, 447, 251, 879, 177, 5395, 13487, 9587}}, {2304, 15, 3889, {1, 3, 3, 7, 15, 31, 115, 3, 21, 817, 475, 1849, 6041, 12541, 18701}}, {2305, 15, 3892, {1, 1, 5, 13, 31, 33, 7, 115, 361, 587, 1919, 1007, 3537, 7493, 19357}}, {2306, 15, 3919, {1, 3, 7, 13, 23, 35, 15, 111, 123, 633, 805, 1983, 2109, 14477, 4985}}, {2307, 15, 3921, {1, 3, 3, 11, 25, 13, 11, 205, 97, 893, 927, 1291, 4007, 13593, 29693}}, {2308, 15, 3958, {1, 3, 5, 15, 9, 13, 121, 89, 215, 823, 1389, 1581, 8095, 4707, 16061}}, {2309, 15, 3961, {1, 3, 1, 3, 23, 39, 83, 23, 47, 941, 1419, 2389, 5699, 7519, 5829}}, {2310, 15, 3973, {1, 3, 1, 9, 23, 43, 79, 237, 93, 203, 695, 225, 5645, 3591, 16775}}, {2311, 15, 3977, {1, 3, 5, 3, 15, 19, 89, 129, 375, 125, 225, 1323, 2267, 11607, 17937}}, {2312, 15, 3985, {1, 3, 3, 1, 31, 37, 93, 133, 377, 959, 707, 621, 7179, 15493, 30287}}, {2313, 15, 3991, {1, 3, 7, 13, 5, 13, 15, 1, 37, 525, 1641, 2829, 6139, 4069, 19187}}, {2314, 15, 4004, {1, 3, 3, 9, 17, 3, 67, 97, 375, 845, 403, 973, 3919, 2275, 31627}}, {2315, 15, 4007, {1, 1, 3, 3, 25, 7, 91, 67, 271, 465, 481, 3477, 5229, 241, 8411}}, {2316, 15, 4019, {1, 1, 1, 11, 1, 41, 109, 115, 75, 787, 309, 2887, 179, 9073, 13895}}, {2317, 15, 4045, {1, 3, 3, 15, 11, 31, 113, 91, 303, 907, 1933, 2167, 7799, 11821, 20659}}, {2318, 15, 4054, {1, 3, 1, 15, 27, 17, 21, 41, 99, 137, 1397, 929, 5819, 11977, 6201}}, {2319, 15, 4057, {1, 1, 7, 13, 21, 29, 47, 239, 287, 305, 899, 2711, 1723, 3315, 199}}, {2320, 15, 4058, {1, 1, 1, 3, 31, 21, 101, 149, 107, 761, 1197, 1703, 4803, 8411, 10649}}, {2321, 15, 4070, {1, 1, 5, 15, 23, 45, 109, 221, 85, 619, 169, 1013, 3305, 9451, 26189}}, {2322, 15, 4101, {1, 3, 5, 13, 7, 57, 19, 153, 231, 627, 565, 1595, 6309, 5037, 25505}}, {2323, 15, 4113, {1, 1, 7, 7, 1, 45, 43, 79, 271, 59, 219, 2255, 1785, 7919, 24061}}, {2324, 15, 4114, {1, 3, 7, 5, 31, 57, 57, 231, 33, 227, 531, 679, 1141, 85, 19777}}, {2325, 15, 4119, {1, 1, 3, 15, 11, 59, 59, 169, 459, 693, 907, 1191, 3783, 12809, 6263}}, {2326, 15, 4129, {1, 1, 7, 13, 19, 21, 105, 65, 267, 141, 1547, 781, 7295, 13565, 17775}}, {2327, 15, 4141, {1, 3, 3, 5, 31, 63, 97, 155, 477, 661, 329, 797, 2539, 4061, 10537}}, {2328, 15, 4142, {1, 3, 3, 7, 11, 17, 119, 89, 71, 103, 1043, 413, 6035, 12829, 11559}}, {2329, 15, 4147, {1, 3, 1, 9, 5, 19, 53, 185, 103, 629, 2015, 1257, 5163, 10581, 13449}}, {2330, 15, 4149, {1, 1, 1, 5, 23, 35, 25, 129, 179, 959, 677, 2249, 6315, 12151, 3459}}, {2331, 15, 4150, {1, 1, 1, 1, 9, 47, 93, 45, 35, 45, 265, 2065, 6225, 25, 27135}}, {2332, 15, 4164, {1, 3, 1, 11, 21, 53, 127, 163, 311, 667, 597, 1561, 4515, 23, 9551}}, {2333, 15, 4168, {1, 1, 3, 3, 7, 47, 105, 211, 241, 95, 389, 899, 6001, 8129, 19889}}, {2334, 15, 4186, {1, 1, 3, 15, 29, 45, 9, 27, 483, 799, 269, 1811, 4493, 7109, 22149}}, {2335, 15, 4198, {1, 1, 3, 3, 29, 5, 57, 205, 187, 615, 1677, 3987, 4577, 8799, 16311}}, {2336, 15, 4207, {1, 1, 5, 3, 15, 5, 91, 101, 319, 445, 1261, 2039, 4071, 8249, 11611}}, {2337, 15, 4221, {1, 3, 7, 11, 19, 17, 1, 185, 153, 579, 1001, 2031, 2295, 16335, 24771}}, {2338, 15, 4225, {1, 3, 3, 15, 13, 45, 93, 185, 319, 667, 1085, 93, 577, 11551, 11355}}, {2339, 15, 4231, {1, 1, 7, 13, 3, 61, 45, 191, 51, 981, 1151, 2715, 2503, 4147, 4587}}, {2340, 15, 4238, {1, 1, 3, 3, 27, 17, 71, 141, 57, 981, 1033, 333, 4639, 15885, 1039}}, {2341, 15, 4243, {1, 3, 3, 15, 21, 55, 33, 123, 357, 893, 829, 4045, 5027, 11727, 13357}}, {2342, 15, 4249, {1, 1, 1, 9, 31, 47, 27, 223, 311, 205, 179, 3411, 4019, 10997, 28115}}, {2343, 15, 4250, {1, 3, 5, 1, 3, 39, 15, 7, 501, 641, 735, 295, 2005, 12641, 19779}}, {2344, 15, 4252, {1, 3, 3, 1, 15, 1, 75, 243, 329, 267, 1323, 2285, 5389, 11881, 15737}}, {2345, 15, 4259, {1, 1, 3, 3, 13, 17, 101, 99, 209, 939, 1147, 3221, 5159, 3435, 183}}, {2346, 15, 4279, {1, 1, 1, 1, 27, 43, 29, 179, 179, 659, 807, 313, 4165, 963, 11317}}, {2347, 15, 4285, {1, 1, 3, 13, 9, 51, 125, 245, 381, 555, 1383, 3887, 2045, 12829, 12029}}, {2348, 15, 4288, {1, 1, 1, 9, 29, 39, 55, 127, 235, 617, 1553, 3133, 7735, 14725, 16733}}, {2349, 15, 4303, {1, 1, 3, 5, 15, 9, 47, 217, 89, 987, 1083, 1045, 4745, 12915, 13719}}, {2350, 15, 4312, {1, 3, 3, 7, 23, 3, 35, 79, 45, 435, 1549, 2645, 2831, 10359, 10041}}, {2351, 15, 4322, {1, 1, 7, 15, 31, 61, 25, 223, 511, 319, 487, 1677, 739, 7097, 18417}}, {2352, 15, 4327, {1, 1, 7, 5, 19, 21, 123, 237, 299, 367, 1341, 1449, 2949, 8629, 11051}}, {2353, 15, 4336, {1, 3, 7, 7, 31, 53, 125, 33, 257, 719, 1297, 895, 5095, 10237, 12309}}, {2354, 15, 4359, {1, 3, 1, 5, 31, 59, 73, 211, 97, 209, 1289, 4033, 6143, 14275, 7997}}, {2355, 15, 4384, {1, 1, 5, 7, 31, 5, 75, 105, 389, 985, 9, 4033, 1185, 7821, 19083}}, {2356, 15, 4387, {1, 1, 1, 15, 11, 39, 73, 253, 275, 813, 25, 3441, 2493, 5873, 3739}}, {2357, 15, 4401, {1, 3, 7, 1, 31, 19, 119, 5, 109, 397, 1329, 3347, 5941, 12449, 2533}}, {2358, 15, 4407, {1, 1, 1, 1, 5, 59, 61, 175, 435, 985, 65, 3781, 5425, 15073, 16361}}, {2359, 15, 4428, {1, 3, 5, 7, 31, 13, 53, 87, 69, 305, 1455, 273, 2197, 4277, 24423}}, {2360, 15, 4436, {1, 3, 3, 15, 13, 13, 91, 171, 71, 583, 15, 3599, 6801, 10041, 26097}}, {2361, 15, 4450, {1, 3, 3, 5, 5, 13, 91, 225, 63, 69, 1795, 341, 461, 5015, 9471}}, {2362, 15, 4452, {1, 3, 7, 5, 21, 55, 109, 39, 459, 925, 229, 2855, 5807, 2117, 31739}}, {2363, 15, 4459, {1, 1, 3, 3, 1, 5, 17, 177, 401, 727, 1555, 3097, 1243, 5933, 14579}}, {2364, 15, 4461, {1, 1, 7, 3, 19, 19, 37, 87, 105, 73, 197, 4067, 6237, 10553, 9207}}, {2365, 15, 4470, {1, 1, 3, 15, 1, 55, 119, 115, 441, 3, 1003, 1631, 197, 12929, 25385}}, {2366, 15, 4483, {1, 3, 7, 11, 31, 1, 119, 49, 467, 647, 685, 2771, 3689, 11049, 26787}}, {2367, 15, 4485, {1, 1, 1, 11, 19, 19, 21, 73, 459, 935, 615, 371, 1099, 14407, 10375}}, {2368, 15, 4486, {1, 3, 5, 13, 15, 3, 107, 179, 259, 677, 1101, 315, 7673, 14639, 11241}}, {2369, 15, 4492, {1, 1, 7, 9, 15, 21, 93, 25, 349, 23, 1087, 27, 5691, 12997, 29301}}, {2370, 15, 4497, {1, 3, 3, 5, 7, 43, 1, 195, 69, 753, 1315, 2629, 3259, 5595, 19439}}, {2371, 15, 4514, {1, 3, 5, 5, 31, 9, 75, 217, 217, 197, 1925, 2033, 3585, 15219, 20251}}, {2372, 15, 4533, {1, 1, 5, 11, 17, 31, 3, 209, 315, 49, 949, 2267, 4611, 4375, 16431}}, {2373, 15, 4537, {1, 1, 7, 9, 17, 35, 13, 115, 119, 553, 1527, 2857, 3599, 391, 25101}}, {2374, 15, 4546, {1, 3, 3, 15, 13, 59, 17, 177, 301, 719, 909, 1663, 5033, 1129, 529}}, {2375, 15, 4551, {1, 1, 7, 5, 15, 13, 99, 157, 379, 975, 1019, 2251, 3807, 10621, 351}}, {2376, 15, 4555, {1, 3, 3, 13, 5, 57, 5, 31, 361, 981, 883, 3723, 2259, 5151, 11783}}, {2377, 15, 4560, {1, 1, 1, 13, 1, 43, 125, 19, 77, 509, 1817, 3795, 1863, 8401, 27253}}, {2378, 15, 4569, {1, 1, 5, 7, 19, 41, 21, 151, 89, 189, 769, 1937, 4497, 13607, 24691}}, {2379, 15, 4576, {1, 1, 1, 9, 21, 9, 1, 195, 31, 907, 1719, 1549, 809, 13629, 16597}}, {2380, 15, 4582, {1, 1, 1, 3, 21, 61, 103, 219, 311, 849, 523, 21, 4533, 6367, 3935}}, {2381, 15, 4586, {1, 1, 7, 9, 7, 33, 77, 19, 489, 933, 1729, 1813, 6741, 10701, 7}}, {2382, 15, 4609, {1, 1, 1, 5, 23, 53, 43, 63, 453, 209, 1313, 2847, 2641, 13783, 14983}}, {2383, 15, 4610, {1, 3, 7, 7, 15, 45, 83, 241, 509, 659, 213, 221, 5205, 6019, 18945}}, {2384, 15, 4612, {1, 1, 5, 9, 25, 43, 37, 9, 191, 505, 765, 295, 953, 1045, 11203}}, {2385, 15, 4649, {1, 3, 7, 11, 5, 49, 45, 177, 379, 695, 355, 1711, 7747, 497, 7597}}, {2386, 15, 4652, {1, 1, 5, 13, 23, 47, 101, 145, 301, 207, 195, 2225, 8093, 15345, 14097}}, {2387, 15, 4672, {1, 3, 7, 13, 9, 9, 55, 223, 343, 921, 1825, 3281, 2627, 855, 27651}}, {2388, 15, 4677, {1, 1, 7, 1, 21, 1, 67, 149, 433, 111, 577, 3675, 495, 9043, 23613}}, {2389, 15, 4684, {1, 3, 1, 13, 9, 39, 37, 73, 117, 559, 1131, 2511, 7599, 8393, 24747}}, {2390, 15, 4690, {1, 3, 3, 7, 11, 15, 85, 229, 7, 21, 1649, 739, 375, 13991, 27053}}, {2391, 15, 4695, {1, 1, 5, 5, 15, 41, 49, 117, 173, 825, 1343, 377, 1789, 12519, 30667}}, {2392, 15, 4696, {1, 1, 7, 15, 9, 11, 97, 99, 347, 729, 9, 1703, 1177, 5189, 9061}}, {2393, 15, 4702, {1, 1, 5, 11, 15, 25, 99, 63, 89, 675, 561, 215, 8111, 3955, 24635}}, {2394, 15, 4705, {1, 1, 1, 1, 7, 53, 99, 193, 233, 731, 733, 1883, 7783, 14413, 14003}}, {2395, 15, 4717, {1, 3, 5, 7, 31, 23, 45, 153, 337, 293, 443, 2301, 5135, 7455, 13123}}, {2396, 15, 4726, {1, 3, 1, 3, 23, 53, 23, 165, 53, 875, 1543, 1035, 4247, 5101, 28445}}, {2397, 15, 4736, {1, 1, 1, 15, 13, 41, 77, 93, 205, 743, 1101, 1413, 2371, 7183, 12337}}, {2398, 15, 4753, {1, 1, 3, 15, 17, 63, 25, 101, 147, 149, 1207, 3525, 2661, 9539, 11145}}, {2399, 15, 4754, {1, 3, 1, 9, 17, 5, 3, 35, 389, 909, 1017, 2803, 5243, 13025, 8851}}, {2400, 15, 4756, {1, 1, 7, 15, 19, 27, 69, 91, 71, 547, 1421, 831, 6969, 5517, 28233}}, {2401, 15, 4775, {1, 1, 3, 3, 17, 45, 55, 63, 263, 819, 1211, 2739, 655, 13269, 22281}}, {2402, 15, 4801, {1, 3, 1, 5, 23, 13, 81, 251, 83, 551, 491, 1029, 3561, 357, 23393}}, {2403, 15, 4819, {1, 3, 1, 13, 25, 27, 93, 143, 407, 403, 1395, 1733, 3187, 1917, 31453}}, {2404, 15, 4828, {1, 1, 7, 13, 3, 21, 85, 113, 483, 461, 1343, 561, 2081, 10857, 24253}}, {2405, 15, 4838, {1, 1, 1, 1, 11, 11, 53, 135, 25, 163, 1729, 617, 1533, 10881, 16041}}, {2406, 15, 4852, {1, 1, 5, 1, 3, 49, 125, 139, 77, 891, 815, 3431, 4875, 12513, 4595}}, {2407, 15, 4856, {1, 1, 1, 1, 27, 63, 111, 109, 421, 425, 345, 1613, 5447, 1357, 32413}}, {2408, 15, 4873, {1, 3, 5, 3, 17, 5, 37, 171, 259, 281, 1003, 2901, 3241, 15557, 21415}}, {2409, 15, 4887, {1, 1, 5, 11, 15, 55, 75, 199, 493, 215, 1625, 2345, 7873, 2325, 11003}}, {2410, 15, 4891, {1, 3, 7, 1, 21, 33, 23, 5, 495, 941, 1185, 475, 5799, 15161, 10677}}, {2411, 15, 4904, {1, 1, 5, 9, 31, 37, 37, 29, 217, 389, 297, 3097, 7319, 2601, 15307}}, {2412, 15, 4912, {1, 3, 7, 5, 7, 45, 111, 167, 297, 275, 1669, 2489, 1511, 15753, 1289}}, {2413, 15, 4921, {1, 3, 1, 7, 3, 45, 19, 11, 189, 199, 1227, 2647, 1897, 9077, 17189}}, {2414, 15, 4936, {1, 1, 1, 13, 15, 39, 19, 179, 147, 341, 283, 3029, 7599, 8937, 18761}}, {2415, 15, 4941, {1, 3, 3, 9, 3, 11, 41, 255, 365, 835, 921, 389, 919, 15223, 14541}}, {2416, 15, 4942, {1, 1, 3, 3, 5, 37, 29, 203, 313, 271, 1207, 487, 3711, 3811, 26757}}, {2417, 15, 4963, {1, 3, 7, 9, 19, 53, 49, 139, 351, 537, 1681, 1595, 5399, 13839, 28685}}, {2418, 15, 4984, {1, 3, 1, 1, 15, 35, 21, 37, 247, 891, 1855, 1243, 3137, 10381, 30379}}, {2419, 15, 4990, {1, 3, 7, 5, 9, 47, 91, 25, 479, 337, 781, 3545, 1045, 9491, 22853}}, {2420, 15, 5005, {1, 1, 5, 15, 19, 31, 81, 5, 117, 923, 565, 2443, 7383, 1795, 11685}}, {2421, 15, 5013, {1, 3, 3, 5, 17, 15, 21, 245, 489, 889, 2047, 2737, 7445, 14785, 13401}}, {2422, 15, 5020, {1, 1, 1, 15, 19, 45, 67, 117, 299, 607, 953, 743, 6863, 12123, 6701}}, {2423, 15, 5039, {1, 1, 3, 1, 1, 43, 19, 129, 345, 861, 209, 2387, 7205, 7131, 8235}}, {2424, 15, 5048, {1, 3, 5, 1, 1, 13, 75, 99, 333, 157, 23, 1217, 1857, 15479, 16031}}, {2425, 15, 5062, {1, 3, 3, 11, 7, 61, 119, 89, 491, 401, 227, 1739, 3807, 16003, 2875}}, {2426, 15, 5080, {1, 3, 7, 15, 13, 55, 3, 159, 405, 593, 975, 361, 2563, 6061, 28087}}, {2427, 15, 5085, {1, 1, 3, 13, 19, 5, 5, 9, 119, 41, 33, 1111, 4443, 4663, 28841}}, {2428, 15, 5086, {1, 1, 7, 7, 25, 59, 125, 255, 49, 947, 1673, 2947, 6369, 2267, 8813}}, {2429, 15, 5095, {1, 1, 5, 15, 25, 25, 111, 193, 217, 193, 821, 2779, 69, 2957, 27043}}, {2430, 15, 5096, {1, 3, 5, 7, 21, 19, 51, 157, 203, 487, 1745, 1875, 911, 14071, 7557}}, {2431, 15, 5102, {1, 1, 5, 9, 3, 15, 55, 73, 313, 245, 1061, 1929, 3035, 607, 11563}}, {2432, 15, 5107, {1, 1, 5, 7, 3, 57, 105, 121, 461, 43, 803, 1801, 4059, 2157, 17547}}, {2433, 15, 5141, {1, 3, 7, 7, 19, 11, 1, 121, 499, 841, 601, 3515, 2969, 13697, 8917}}, {2434, 15, 5145, {1, 3, 3, 3, 13, 35, 113, 231, 391, 689, 697, 2871, 7387, 715, 27005}}, {2435, 15, 5148, {1, 1, 1, 13, 19, 5, 17, 43, 175, 291, 987, 1917, 7635, 15655, 10689}}, {2436, 15, 5157, {1, 1, 7, 15, 19, 37, 121, 243, 125, 623, 1231, 29, 2325, 5147, 21435}}, {2437, 15, 5158, {1, 3, 5, 15, 25, 27, 57, 187, 77, 401, 1489, 2977, 5415, 3381, 2551}}, {2438, 15, 5162, {1, 1, 1, 7, 1, 1, 85, 27, 115, 559, 9, 2365, 711, 5733, 2819}}, {2439, 15, 5172, {1, 3, 1, 15, 9, 29, 61, 113, 169, 349, 591, 1061, 6041, 7613, 23691}}, {2440, 15, 5182, {1, 1, 5, 1, 13, 45, 49, 227, 345, 563, 87, 3597, 3961, 7205, 8441}}, {2441, 15, 5184, {1, 1, 1, 5, 3, 21, 121, 183, 463, 83, 1365, 539, 1485, 10063, 24867}}, {2442, 15, 5193, {1, 3, 5, 5, 3, 61, 101, 237, 41, 147, 1907, 3049, 7583, 8283, 6099}}, {2443, 15, 5199, {1, 3, 1, 15, 31, 57, 19, 155, 445, 805, 1793, 207, 1975, 3357, 14281}}, {2444, 15, 5201, {1, 1, 7, 13, 9, 39, 27, 73, 165, 345, 543, 4095, 133, 10469, 11573}}, {2445, 15, 5204, {1, 1, 7, 15, 17, 57, 99, 81, 359, 367, 1057, 1173, 4225, 15127, 2615}}, {2446, 15, 5211, {1, 3, 5, 3, 31, 23, 113, 111, 495, 947, 1625, 1195, 2053, 1509, 1347}}, {2447, 15, 5223, {1, 1, 5, 5, 9, 47, 25, 63, 455, 107, 771, 3815, 3827, 16287, 11615}}, {2448, 15, 5230, {1, 1, 7, 9, 17, 61, 51, 215, 63, 123, 1253, 3927, 721, 9647, 3283}}, {2449, 15, 5232, {1, 1, 5, 15, 11, 17, 83, 255, 473, 107, 681, 763, 7855, 8043, 31503}}, {2450, 15, 5253, {1, 3, 1, 7, 7, 31, 37, 5, 253, 155, 2017, 609, 1421, 14927, 25241}}, {2451, 15, 5257, {1, 3, 3, 13, 31, 25, 21, 241, 431, 193, 681, 2265, 5091, 11479, 21443}}, {2452, 15, 5260, {1, 3, 5, 5, 15, 9, 49, 255, 157, 995, 631, 1995, 3605, 9085, 24245}}, {2453, 15, 5284, {1, 3, 3, 7, 19, 31, 85, 153, 493, 951, 451, 1587, 6609, 3681, 13205}}, {2454, 15, 5306, {1, 1, 5, 1, 17, 41, 107, 231, 307, 361, 575, 3239, 3443, 16159, 20625}}, {2455, 15, 5331, {1, 1, 7, 9, 31, 49, 93, 79, 181, 117, 1241, 3645, 4901, 12599, 13247}}, {2456, 15, 5334, {1, 3, 3, 9, 7, 31, 127, 201, 11, 199, 1851, 23, 5667, 8159, 20951}}, {2457, 15, 5364, {1, 3, 3, 7, 3, 37, 29, 189, 65, 461, 769, 321, 6577, 16223, 16865}}, {2458, 15, 5367, {1, 1, 5, 11, 1, 13, 91, 167, 33, 111, 1445, 1047, 2479, 12623, 22893}}, {2459, 15, 5371, {1, 1, 3, 1, 3, 1, 47, 185, 329, 903, 1651, 3005, 907, 1255, 8303}}, {2460, 15, 5382, {1, 3, 5, 13, 19, 31, 5, 233, 265, 769, 1303, 2503, 2229, 14019, 20257}}, {2461, 15, 5386, {1, 3, 7, 3, 27, 11, 67, 195, 5, 661, 125, 3761, 7211, 16043, 7267}}, {2462, 15, 5399, {1, 1, 1, 3, 27, 13, 115, 25, 473, 417, 1751, 2223, 2099, 5913, 14273}}, {2463, 15, 5400, {1, 3, 7, 15, 13, 53, 99, 115, 225, 737, 1621, 539, 4131, 471, 31865}}, {2464, 15, 5409, {1, 1, 5, 5, 25, 19, 39, 207, 153, 569, 1755, 2477, 3065, 7383, 29919}}, {2465, 15, 5415, {1, 3, 5, 11, 13, 59, 33, 3, 435, 273, 701, 3819, 7291, 11803, 26111}}, {2466, 15, 5416, {1, 1, 3, 9, 29, 19, 71, 59, 93, 1019, 887, 83, 4675, 7541, 26821}}, {2467, 15, 5424, {1, 3, 1, 3, 21, 53, 71, 73, 43, 321, 1581, 1399, 4043, 12995, 16825}}, {2468, 15, 5436, {1, 3, 7, 15, 3, 13, 37, 11, 93, 873, 1193, 3481, 451, 15869, 17879}}, {2469, 15, 5454, {1, 3, 1, 11, 31, 19, 101, 57, 129, 753, 853, 463, 6757, 11083, 8667}}, {2470, 15, 5462, {1, 3, 5, 15, 25, 41, 25, 197, 235, 609, 905, 993, 3233, 1935, 24661}}, {2471, 15, 5468, {1, 3, 1, 5, 21, 7, 53, 107, 473, 77, 1135, 1045, 4933, 5615, 15931}}, {2472, 15, 5481, {1, 3, 7, 11, 3, 9, 105, 183, 151, 527, 425, 975, 4073, 913, 2793}}, {2473, 15, 5505, {1, 1, 7, 13, 19, 61, 81, 9, 413, 851, 1723, 1113, 1453, 8635, 3353}}, {2474, 15, 5511, {1, 3, 7, 15, 19, 53, 83, 31, 441, 343, 575, 935, 4543, 1303, 12567}}, {2475, 15, 5518, {1, 1, 1, 5, 29, 19, 119, 75, 3, 591, 845, 649, 1717, 13695, 26905}}, {2476, 15, 5530, {1, 1, 7, 9, 5, 53, 127, 191, 15, 773, 1433, 2899, 21, 4977, 17839}}, {2477, 15, 5532, {1, 1, 5, 9, 21, 9, 99, 115, 397, 99, 725, 3835, 973, 1219, 21159}}, {2478, 15, 5539, {1, 3, 5, 3, 7, 39, 29, 93, 303, 913, 981, 3549, 5225, 10907, 393}}, {2479, 15, 5553, {1, 3, 3, 11, 9, 25, 105, 101, 1, 867, 389, 2241, 773, 14123, 10015}}, {2480, 15, 5573, {1, 1, 5, 1, 1, 37, 117, 213, 391, 779, 1851, 1485, 1277, 5607, 819}}, {2481, 15, 5580, {1, 3, 7, 1, 3, 5, 43, 47, 483, 367, 749, 1693, 4961, 15257, 3775}}, {2482, 15, 5597, {1, 3, 3, 1, 27, 11, 21, 83, 437, 379, 1041, 393, 5611, 2421, 31739}}, {2483, 15, 5602, {1, 3, 5, 7, 19, 1, 79, 63, 53, 201, 1159, 2501, 6327, 11317, 9537}}, {2484, 15, 5608, {1, 3, 5, 13, 9, 37, 61, 217, 427, 913, 1311, 3503, 5473, 10583, 19723}}, {2485, 15, 5611, {1, 1, 3, 9, 11, 29, 121, 175, 141, 515, 925, 837, 6011, 10419, 32157}}, {2486, 15, 5613, {1, 3, 5, 9, 27, 57, 97, 175, 365, 367, 1737, 3845, 1257, 12243, 2201}}, {2487, 15, 5625, {1, 3, 3, 9, 23, 1, 53, 123, 127, 333, 1335, 707, 5747, 6541, 9809}}, {2488, 15, 5632, {1, 3, 1, 9, 17, 37, 101, 41, 91, 61, 433, 979, 4345, 12351, 10829}}, {2489, 15, 5635, {1, 3, 3, 13, 3, 21, 15, 49, 257, 99, 1793, 2987, 5233, 11625, 28069}}, {2490, 15, 5638, {1, 1, 7, 11, 21, 13, 89, 11, 135, 153, 783, 2893, 6815, 12007, 15605}}, {2491, 15, 5652, {1, 3, 7, 13, 5, 61, 73, 5, 269, 699, 925, 2925, 5919, 5841, 24875}}, {2492, 15, 5659, {1, 3, 5, 5, 25, 45, 43, 93, 15, 927, 1253, 319, 1173, 14559, 20221}}, {2493, 15, 5677, {1, 1, 3, 3, 27, 45, 9, 103, 447, 627, 1239, 3869, 2169, 49, 17917}}, {2494, 15, 5686, {1, 3, 7, 7, 11, 9, 1, 1, 1, 527, 825, 3295, 623, 2095, 10537}}, {2495, 15, 5689, {1, 3, 3, 11, 21, 11, 59, 165, 33, 743, 1461, 1535, 6393, 1301, 17823}}, {2496, 15, 5698, {1, 1, 7, 3, 19, 43, 47, 245, 469, 551, 1447, 1963, 169, 1481, 31925}}, {2497, 15, 5703, {1, 1, 3, 1, 11, 21, 51, 7, 251, 199, 1153, 767, 6417, 3417, 30171}}, {2498, 15, 5707, {1, 3, 7, 1, 31, 5, 41, 103, 447, 263, 211, 2029, 8021, 4705, 10579}}, {2499, 15, 5731, {1, 1, 3, 5, 17, 25, 55, 75, 393, 107, 2017, 2389, 1685, 14021, 9161}}, {2500, 15, 5738, {1, 1, 1, 9, 13, 1, 75, 237, 205, 461, 689, 2531, 2839, 13925, 23351}}, {2501, 15, 5743, {1, 3, 7, 1, 23, 39, 33, 189, 157, 571, 239, 1053, 1559, 1685, 23059}}, {2502, 15, 5748, {1, 3, 3, 3, 27, 61, 71, 121, 49, 157, 1341, 1707, 2417, 11689, 26507}}, {2503, 15, 5758, {1, 3, 7, 7, 19, 63, 47, 53, 95, 791, 1467, 1273, 2045, 755, 8555}}, {2504, 15, 5762, {1, 1, 3, 15, 27, 33, 21, 253, 317, 153, 1509, 1765, 3809, 601, 5907}}, {2505, 15, 5768, {1, 3, 5, 15, 11, 17, 97, 91, 165, 199, 1751, 2135, 1315, 3077, 29995}}, {2506, 15, 5773, {1, 3, 1, 5, 3, 33, 93, 49, 39, 743, 341, 2549, 7603, 3369, 30889}}, {2507, 15, 5776, {1, 1, 3, 13, 3, 5, 87, 63, 293, 785, 1591, 675, 3915, 2209, 18201}}, {2508, 15, 5815, {1, 3, 3, 11, 3, 15, 69, 231, 241, 127, 429, 2201, 8173, 12549, 25745}}, {2509, 15, 5841, {1, 1, 5, 11, 15, 39, 3, 29, 125, 685, 643, 1385, 829, 7347, 28793}}, {2510, 15, 5847, {1, 1, 7, 15, 27, 15, 59, 237, 299, 773, 1097, 3875, 6503, 7129, 28495}}, {2511, 15, 5860, {1, 3, 5, 13, 9, 17, 31, 227, 69, 443, 1633, 525, 1659, 14681, 15209}}, {2512, 15, 5870, {1, 3, 5, 5, 13, 51, 69, 173, 111, 433, 279, 2145, 2091, 9741, 24881}}, {2513, 15, 5875, {1, 3, 1, 7, 7, 35, 55, 51, 357, 99, 1789, 333, 2073, 10151, 14527}}, {2514, 15, 5877, {1, 3, 3, 7, 13, 41, 101, 87, 425, 701, 1143, 2733, 6473, 8667, 17419}}, {2515, 15, 5884, {1, 1, 5, 5, 25, 29, 63, 31, 385, 537, 563, 607, 6723, 9251, 6531}}, {2516, 15, 5892, {1, 3, 5, 5, 9, 63, 111, 131, 239, 723, 705, 2805, 6579, 12691, 17521}}, {2517, 15, 5902, {1, 3, 1, 7, 31, 55, 101, 225, 477, 271, 611, 3179, 7859, 9835, 2165}}, {2518, 15, 5910, {1, 1, 3, 3, 5, 15, 81, 127, 391, 333, 419, 1091, 5997, 12315, 31521}}, {2519, 15, 5916, {1, 3, 5, 15, 23, 7, 35, 109, 181, 295, 825, 419, 969, 15753, 9365}}, {2520, 15, 5919, {1, 3, 5, 5, 25, 23, 69, 177, 325, 359, 1577, 619, 6233, 11753, 8103}}, {2521, 15, 5935, {1, 3, 5, 11, 31, 13, 79, 61, 241, 1011, 1961, 949, 6211, 497, 7099}}, {2522, 15, 5937, {1, 3, 5, 3, 25, 19, 67, 235, 337, 1015, 1485, 355, 3653, 12735, 14503}}, {2523, 15, 5944, {1, 3, 5, 7, 31, 23, 35, 231, 147, 15, 263, 1995, 431, 5941, 18931}}, {2524, 15, 5947, {1, 3, 3, 7, 1, 35, 37, 7, 85, 443, 715, 743, 2189, 12537, 17427}}, {2525, 15, 5958, {1, 1, 3, 1, 7, 41, 1, 209, 121, 929, 661, 3999, 955, 5123, 31115}}, {2526, 15, 5962, {1, 1, 3, 5, 11, 43, 127, 125, 107, 293, 273, 2071, 3003, 11631, 7769}}, {2527, 15, 5969, {1, 1, 1, 13, 13, 29, 39, 217, 111, 779, 1287, 1675, 4201, 4869, 20403}}, {2528, 15, 5981, {1, 1, 3, 15, 25, 53, 25, 135, 389, 925, 1971, 663, 7545, 2673, 7725}}, {2529, 15, 5995, {1, 1, 5, 13, 3, 59, 97, 91, 357, 45, 947, 3031, 8095, 6269, 13975}}, {2530, 15, 5998, {1, 1, 5, 15, 25, 31, 1, 171, 375, 939, 507, 3591, 1089, 13605, 2813}}, {2531, 15, 6003, {1, 1, 3, 7, 25, 21, 41, 131, 147, 737, 9, 1603, 1859, 11573, 28397}}, {2532, 15, 6010, {1, 3, 3, 9, 21, 9, 59, 27, 169, 875, 711, 1389, 2899, 7937, 4173}}, {2533, 15, 6016, {1, 1, 5, 9, 13, 29, 71, 39, 51, 337, 1067, 2661, 1203, 5967, 19249}}, {2534, 15, 6025, {1, 3, 7, 1, 17, 21, 43, 79, 181, 741, 1901, 3445, 7171, 2109, 1589}}, {2535, 15, 6031, {1, 1, 3, 9, 23, 37, 105, 51, 227, 775, 1265, 2987, 2197, 13903, 28891}}, {2536, 15, 6036, {1, 1, 1, 13, 23, 47, 111, 41, 93, 261, 75, 2155, 4301, 11517, 16101}}, {2537, 15, 6039, {1, 1, 3, 3, 27, 27, 123, 125, 501, 775, 413, 1065, 7607, 15065, 26013}}, {2538, 15, 6045, {1, 3, 7, 3, 27, 11, 59, 87, 207, 743, 1765, 2969, 913, 8101, 11583}}, {2539, 15, 6049, {1, 3, 3, 1, 23, 7, 113, 17, 285, 993, 695, 2399, 5019, 4779, 28917}}, {2540, 15, 6052, {1, 3, 1, 5, 11, 51, 49, 139, 213, 435, 1475, 2209, 6695, 12981, 9851}}, {2541, 15, 6067, {1, 3, 5, 7, 1, 63, 31, 151, 173, 767, 1453, 1497, 6911, 9597, 25551}}, {2542, 15, 6074, {1, 1, 7, 7, 21, 53, 39, 159, 389, 231, 309, 359, 7701, 14819, 5175}}, {2543, 15, 6087, {1, 1, 1, 1, 11, 47, 83, 29, 247, 89, 369, 2727, 3103, 14421, 17369}}, {2544, 15, 6101, {1, 3, 1, 5, 25, 25, 111, 245, 239, 755, 113, 1765, 3583, 917, 403}}, {2545, 15, 6121, {1, 3, 3, 3, 5, 59, 85, 151, 463, 591, 743, 3767, 121, 2927, 11031}}, {2546, 15, 6129, {1, 3, 5, 9, 11, 39, 77, 161, 275, 233, 1991, 2683, 6545, 2423, 32113}}, {2547, 15, 6142, {1, 3, 5, 11, 5, 57, 13, 229, 329, 757, 1863, 3959, 4243, 7265, 15599}}, {2548, 15, 6151, {1, 1, 1, 1, 1, 23, 19, 67, 453, 593, 2011, 1813, 4695, 8903, 9623}}, {2549, 15, 6157, {1, 3, 3, 7, 1, 29, 103, 255, 493, 647, 1709, 4065, 4199, 949, 28829}}, {2550, 15, 6166, {1, 1, 7, 9, 3, 55, 53, 33, 5, 223, 423, 3347, 7647, 7211, 25157}}, {2551, 15, 6170, {1, 3, 5, 13, 3, 43, 79, 255, 471, 573, 1007, 2119, 6731, 10047, 23179}}, {2552, 15, 6175, {1, 1, 1, 3, 7, 39, 55, 61, 53, 377, 435, 401, 3307, 12621, 14299}}, {2553, 15, 6186, {1, 3, 3, 7, 21, 31, 67, 17, 243, 425, 747, 2995, 1389, 2557, 18415}}, {2554, 15, 6203, {1, 3, 1, 3, 3, 39, 75, 11, 447, 249, 1135, 1011, 1657, 10767, 19501}}, {2555, 15, 6217, {1, 3, 1, 11, 17, 51, 117, 129, 17, 143, 785, 103, 5049, 14703, 28479}}, {2556, 15, 6231, {1, 3, 7, 5, 13, 17, 75, 255, 75, 661, 1175, 477, 1811, 1479, 15783}}, {2557, 15, 6241, {1, 3, 7, 9, 11, 57, 101, 77, 431, 247, 997, 3657, 5117, 6815, 3841}}, {2558, 15, 6242, {1, 1, 5, 1, 17, 21, 101, 183, 209, 69, 299, 1585, 6381, 12983, 10053}}, {2559, 15, 6248, {1, 1, 7, 3, 5, 13, 21, 63, 83, 857, 749, 1251, 5363, 9629, 16563}}, {2560, 15, 6256, {1, 3, 3, 9, 3, 59, 9, 45, 55, 489, 137, 2423, 2661, 12111, 4375}}, {2561, 15, 6265, {1, 1, 5, 9, 23, 9, 41, 177, 447, 671, 1631, 3115, 4215, 14435, 8743}}, {2562, 15, 6275, {1, 3, 7, 11, 19, 23, 15, 221, 413, 783, 1247, 2343, 4397, 3145, 32043}}, {2563, 15, 6277, {1, 3, 3, 1, 31, 55, 31, 87, 333, 849, 1777, 343, 5199, 1507, 11621}}, {2564, 15, 6302, {1, 3, 7, 3, 17, 57, 63, 63, 111, 977, 631, 3019, 2953, 14273, 29209}}, {2565, 15, 6315, {1, 3, 1, 13, 9, 39, 87, 15, 397, 185, 701, 1487, 3807, 13727, 19883}}, {2566, 15, 6318, {1, 3, 7, 1, 17, 57, 57, 157, 119, 181, 899, 353, 3603, 15041, 7421}}, {2567, 15, 6330, {1, 1, 7, 3, 29, 13, 29, 191, 105, 373, 961, 1991, 5531, 6793, 29497}}, {2568, 15, 6343, {1, 3, 3, 11, 7, 61, 65, 39, 215, 187, 191, 1651, 2481, 3951, 24965}}, {2569, 15, 6347, {1, 1, 7, 5, 25, 11, 105, 23, 257, 771, 1359, 2837, 7821, 12223, 28033}}, {2570, 15, 6350, {1, 3, 5, 11, 3, 3, 23, 139, 407, 885, 1679, 2979, 8149, 14281, 12487}}, {2571, 15, 6352, {1, 3, 7, 3, 21, 45, 13, 85, 249, 1015, 2023, 1429, 965, 7091, 31721}}, {2572, 15, 6371, {1, 1, 1, 13, 19, 5, 119, 47, 91, 285, 211, 2607, 4287, 9197, 455}}, {2573, 15, 6383, {1, 3, 1, 1, 9, 59, 25, 137, 121, 287, 577, 3325, 2365, 8823, 5033}}, {2574, 15, 6386, {1, 3, 3, 13, 25, 63, 99, 43, 15, 855, 245, 3189, 59, 5181, 21299}}, {2575, 15, 6405, {1, 3, 5, 11, 7, 9, 41, 157, 359, 773, 1347, 2049, 4589, 13731, 32133}}, {2576, 15, 6409, {1, 1, 7, 11, 31, 37, 83, 105, 183, 375, 79, 1821, 1989, 15199, 22207}}, {2577, 15, 6410, {1, 1, 5, 3, 23, 37, 127, 9, 467, 651, 993, 69, 6943, 4093, 20871}}, {2578, 15, 6433, {1, 1, 3, 15, 31, 49, 123, 149, 211, 371, 1825, 3011, 485, 1251, 17343}}, {2579, 15, 6436, {1, 1, 1, 15, 11, 33, 127, 251, 89, 317, 1869, 219, 2275, 14201, 27063}}, {2580, 15, 6439, {1, 1, 5, 5, 19, 5, 81, 35, 233, 95, 9, 863, 725, 11095, 16217}}, {2581, 15, 6463, {1, 1, 1, 15, 23, 47, 51, 43, 169, 637, 865, 57, 1509, 1683, 7587}}, {2582, 15, 6468, {1, 3, 1, 3, 7, 7, 117, 187, 273, 303, 717, 3091, 2083, 3315, 647}}, {2583, 15, 6477, {1, 1, 5, 15, 13, 27, 23, 227, 145, 547, 1783, 987, 6895, 7135, 11023}}, {2584, 15, 6496, {1, 1, 5, 11, 21, 39, 57, 203, 477, 17, 985, 1729, 4297, 7483, 13263}}, {2585, 15, 6511, {1, 3, 7, 9, 3, 49, 71, 45, 143, 967, 39, 583, 2123, 5165, 17437}}, {2586, 15, 6516, {1, 1, 1, 9, 21, 51, 71, 163, 441, 709, 397, 445, 6167, 7753, 11513}}, {2587, 15, 6519, {1, 1, 7, 7, 27, 35, 5, 181, 449, 53, 621, 3401, 5263, 4557, 9141}}, {2588, 15, 6523, {1, 1, 5, 7, 7, 37, 83, 111, 485, 881, 465, 3371, 5603, 371, 29393}}, {2589, 15, 6530, {1, 3, 1, 15, 7, 47, 41, 245, 377, 823, 309, 3929, 2159, 13917, 13365}}, {2590, 15, 6539, {1, 3, 7, 7, 7, 29, 25, 141, 19, 611, 79, 2689, 109, 12321, 8345}}, {2591, 15, 6547, {1, 1, 1, 13, 3, 53, 113, 151, 381, 791, 137, 3185, 3567, 211, 597}}, {2592, 15, 6589, {1, 1, 3, 9, 7, 53, 87, 89, 491, 861, 467, 3763, 2025, 4187, 9637}}, {2593, 15, 6592, {1, 1, 7, 1, 27, 33, 71, 41, 63, 1011, 741, 1135, 175, 3739, 21493}}, {2594, 15, 6601, {1, 3, 3, 5, 9, 19, 55, 175, 325, 55, 1193, 1423, 2049, 9633, 17515}}, {2595, 15, 6610, {1, 1, 3, 1, 27, 55, 69, 103, 401, 707, 825, 399, 6799, 13199, 6295}}, {2596, 15, 6616, {1, 3, 7, 3, 19, 63, 25, 151, 17, 159, 1673, 615, 6317, 13261, 26267}}, {2597, 15, 6619, {1, 3, 7, 9, 27, 1, 77, 129, 423, 647, 707, 2579, 3525, 6723, 31615}}, {2598, 15, 6626, {1, 3, 3, 7, 7, 31, 35, 241, 309, 369, 895, 3683, 4795, 11319, 451}}, {2599, 15, 6635, {1, 3, 5, 7, 17, 7, 117, 141, 267, 713, 569, 1915, 4369, 7793, 30853}}, {2600, 15, 6637, {1, 3, 7, 1, 29, 61, 81, 73, 413, 13, 1977, 3229, 5853, 8451, 15539}}, {2601, 15, 6638, {1, 3, 7, 1, 5, 45, 109, 21, 431, 487, 2019, 2647, 927, 16015, 10711}}, {2602, 15, 6652, {1, 3, 1, 3, 11, 19, 37, 183, 451, 377, 269, 3993, 3229, 4899, 26561}}, {2603, 15, 6656, {1, 3, 1, 11, 5, 19, 121, 55, 57, 117, 687, 83, 3047, 1367, 17595}}, {2604, 15, 6662, {1, 3, 1, 7, 17, 31, 41, 219, 239, 963, 199, 2895, 5599, 7639, 17201}}, {2605, 15, 6689, {1, 3, 3, 5, 27, 53, 71, 183, 509, 771, 1809, 1539, 2229, 4893, 17115}}, {2606, 15, 6699, {1, 1, 3, 9, 9, 9, 13, 49, 265, 643, 1929, 859, 497, 9797, 27771}}, {2607, 15, 6710, {1, 3, 7, 11, 19, 39, 115, 139, 207, 903, 963, 1849, 4403, 6229, 10021}}, {2608, 15, 6714, {1, 3, 7, 13, 3, 57, 99, 223, 503, 423, 1755, 807, 1885, 213, 18723}}, {2609, 15, 6719, {1, 3, 7, 15, 11, 15, 111, 193, 243, 599, 593, 3385, 5393, 15073, 17777}}, {2610, 15, 6739, {1, 1, 5, 3, 19, 63, 121, 207, 99, 435, 1961, 2747, 6405, 3971, 23481}}, {2611, 15, 6751, {1, 3, 5, 13, 9, 29, 79, 131, 415, 49, 229, 1003, 3263, 12975, 15987}}, {2612, 15, 6775, {1, 1, 3, 7, 1, 41, 127, 155, 29, 73, 963, 659, 2741, 3465, 2595}}, {2613, 15, 6779, {1, 1, 3, 5, 23, 23, 93, 233, 113, 521, 427, 1557, 6917, 12953, 22441}}, {2614, 15, 6788, {1, 1, 5, 13, 5, 25, 85, 191, 387, 69, 955, 243, 4473, 9813, 21711}}, {2615, 15, 6798, {1, 3, 3, 7, 1, 53, 95, 65, 231, 995, 539, 2103, 5513, 14087, 28655}}, {2616, 15, 6815, {1, 3, 5, 3, 17, 13, 19, 227, 197, 91, 1437, 1121, 3307, 6903, 3297}}, {2617, 15, 6819, {1, 1, 5, 11, 31, 29, 109, 171, 257, 783, 861, 9, 4895, 1859, 10909}}, {2618, 15, 6825, {1, 1, 7, 13, 5, 47, 61, 5, 363, 351, 1525, 823, 2883, 12435, 17629}}, {2619, 15, 6826, {1, 1, 5, 11, 9, 3, 69, 159, 371, 477, 1223, 1973, 2757, 413, 31223}}, {2620, 15, 6836, {1, 1, 3, 5, 23, 45, 43, 195, 423, 829, 1673, 1563, 6633, 14775, 21097}}, {2621, 15, 6843, {1, 1, 3, 3, 13, 9, 107, 209, 49, 609, 1047, 3691, 7483, 4269, 7557}}, {2622, 15, 6845, {1, 1, 3, 15, 3, 43, 73, 161, 53, 813, 325, 3439, 7009, 8691, 11711}}, {2623, 15, 6858, {1, 1, 3, 3, 23, 45, 99, 61, 407, 15, 1515, 1557, 953, 8567, 13729}}, {2624, 15, 6868, {1, 1, 5, 9, 31, 35, 117, 57, 227, 923, 1373, 1811, 3405, 11979, 10149}}, {2625, 15, 6877, {1, 1, 3, 9, 15, 53, 105, 209, 153, 67, 1477, 667, 3077, 4911, 3871}}, {2626, 15, 6881, {1, 1, 3, 3, 21, 53, 93, 101, 183, 1023, 3, 3041, 5815, 9043, 5801}}, {2627, 15, 6891, {1, 3, 3, 5, 17, 49, 127, 161, 321, 869, 1369, 923, 3235, 711, 30007}}, {2628, 15, 6896, {1, 1, 3, 3, 15, 17, 97, 229, 389, 159, 1075, 2001, 7905, 15191, 14693}}, {2629, 15, 6899, {1, 1, 5, 11, 5, 5, 121, 173, 95, 173, 1883, 3915, 1439, 9981, 24375}}, {2630, 15, 6901, {1, 3, 3, 1, 31, 53, 29, 189, 37, 623, 217, 949, 3959, 7189, 25427}}, {2631, 15, 6908, {1, 3, 5, 9, 21, 45, 101, 23, 355, 729, 797, 2317, 2931, 7433, 29175}}, {2632, 15, 6914, {1, 3, 7, 1, 1, 63, 63, 155, 237, 865, 1169, 43, 7335, 6445, 7979}}, {2633, 15, 6916, {1, 3, 7, 7, 11, 51, 37, 199, 503, 991, 319, 3013, 7885, 12837, 32419}}, {2634, 15, 6923, {1, 3, 7, 7, 27, 31, 101, 243, 37, 811, 1909, 109, 6455, 7903, 11821}}, {2635, 15, 6925, {1, 1, 3, 13, 23, 21, 89, 99, 243, 605, 1017, 1871, 1101, 12825, 8227}}, {2636, 15, 6928, {1, 3, 3, 13, 19, 3, 51, 59, 501, 605, 385, 2189, 3229, 7981, 31407}}, {2637, 15, 6931, {1, 1, 1, 1, 25, 11, 127, 215, 295, 237, 1245, 3657, 7803, 3897, 655}}, {2638, 15, 6934, {1, 1, 7, 7, 5, 9, 63, 129, 143, 417, 795, 3409, 2847, 5887, 3093}}, {2639, 15, 6937, {1, 3, 3, 13, 7, 57, 67, 57, 5, 847, 1185, 3349, 4841, 11457, 8857}}, {2640, 15, 6938, {1, 1, 3, 3, 9, 53, 51, 43, 85, 437, 13, 2543, 3651, 15493, 767}}, {2641, 15, 6949, {1, 1, 7, 9, 1, 49, 97, 115, 133, 1011, 1399, 2653, 7765, 13999, 12097}}, {2642, 15, 6956, {1, 1, 5, 1, 3, 27, 123, 107, 389, 401, 1759, 1333, 1371, 5277, 14865}}, {2643, 15, 6973, {1, 1, 5, 1, 13, 23, 3, 123, 137, 821, 399, 1671, 3095, 3121, 31387}}, {2644, 15, 6976, {1, 1, 5, 3, 7, 35, 57, 237, 509, 753, 1783, 2815, 6495, 13283, 7091}}, {2645, 15, 6981, {1, 1, 7, 11, 5, 37, 77, 109, 7, 969, 1087, 3705, 1695, 14223, 28959}}, {2646, 15, 6988, {1, 3, 1, 11, 25, 5, 25, 163, 179, 185, 671, 1031, 4537, 11601, 9323}}, {2647, 15, 6999, {1, 1, 3, 7, 17, 25, 49, 221, 183, 619, 1953, 343, 4523, 14883, 6833}}, {2648, 15, 7016, {1, 3, 7, 5, 27, 19, 59, 153, 11, 807, 513, 3019, 6875, 5307, 8405}}, {2649, 15, 7027, {1, 1, 1, 13, 25, 41, 21, 109, 321, 135, 497, 1235, 5177, 5167, 18609}}, {2650, 15, 7029, {1, 1, 7, 5, 21, 53, 25, 197, 411, 503, 1009, 1921, 4305, 2633, 31415}}, {2651, 15, 7055, {1, 3, 5, 1, 25, 45, 27, 227, 271, 903, 639, 3805, 657, 8683, 29585}}, {2652, 15, 7058, {1, 1, 5, 3, 9, 49, 37, 35, 351, 491, 851, 2983, 31, 5619, 6919}}, {2653, 15, 7074, {1, 1, 5, 3, 11, 49, 33, 153, 393, 1017, 1561, 2795, 4435, 12589, 22349}}, {2654, 15, 7083, {1, 1, 1, 15, 17, 29, 49, 245, 217, 359, 1133, 393, 3317, 415, 16407}}, {2655, 15, 7093, {1, 1, 3, 5, 3, 9, 95, 63, 319, 319, 1009, 19, 6453, 16279, 6975}}, {2656, 15, 7100, {1, 1, 5, 9, 3, 25, 67, 95, 369, 237, 285, 2409, 671, 5143, 121}}, {2657, 15, 7105, {1, 1, 3, 1, 9, 49, 35, 87, 317, 185, 445, 2263, 7923, 10183, 26615}}, {2658, 15, 7112, {1, 3, 3, 11, 9, 59, 29, 135, 129, 477, 353, 3571, 1057, 16329, 23523}}, {2659, 15, 7118, {1, 1, 1, 15, 13, 11, 19, 5, 133, 827, 1799, 1893, 1939, 1101, 12147}}, {2660, 15, 7120, {1, 1, 3, 3, 15, 49, 33, 185, 511, 1013, 41, 3499, 6235, 7643, 16725}}, {2661, 15, 7129, {1, 1, 5, 11, 27, 45, 89, 157, 63, 137, 2047, 1275, 4995, 625, 6111}}, {2662, 15, 7166, {1, 3, 7, 11, 3, 1, 121, 1, 341, 33, 1895, 3033, 3929, 10257, 21037}}, {2663, 15, 7207, {1, 3, 3, 11, 7, 11, 117, 5, 115, 287, 335, 3415, 5397, 15065, 19121}}, {2664, 15, 7216, {1, 3, 3, 13, 21, 25, 15, 125, 277, 125, 801, 3761, 2623, 11333, 16867}}, {2665, 15, 7226, {1, 3, 5, 11, 19, 33, 21, 71, 499, 747, 1515, 185, 1759, 14623, 895}}, {2666, 15, 7234, {1, 3, 7, 1, 29, 35, 9, 203, 277, 299, 1509, 2017, 2897, 14175, 1643}}, {2667, 15, 7236, {1, 3, 5, 11, 7, 47, 111, 197, 459, 941, 1619, 2119, 2191, 11049, 6811}}, {2668, 15, 7246, {1, 1, 5, 9, 7, 43, 103, 115, 87, 269, 1235, 77, 5887, 1611, 29041}}, {2669, 15, 7248, {1, 1, 5, 7, 1, 61, 83, 225, 179, 81, 1145, 2403, 1485, 8967, 20607}}, {2670, 15, 7254, {1, 3, 3, 1, 25, 47, 27, 157, 359, 803, 1683, 1995, 6445, 13113, 17899}}, {2671, 15, 7263, {1, 3, 1, 7, 21, 37, 43, 119, 245, 49, 1581, 2275, 3311, 4087, 29765}}, {2672, 15, 7273, {1, 1, 3, 13, 5, 33, 49, 191, 455, 105, 665, 3855, 3207, 2671, 32203}}, {2673, 15, 7274, {1, 3, 1, 1, 25, 63, 19, 217, 17, 353, 947, 1951, 4097, 9041, 11921}}, {2674, 15, 7293, {1, 3, 1, 7, 21, 31, 113, 97, 347, 993, 1799, 3831, 3711, 6193, 1235}}, {2675, 15, 7297, {1, 1, 1, 5, 3, 63, 11, 203, 425, 445, 1361, 531, 1265, 1755, 11685}}, {2676, 15, 7310, {1, 3, 1, 7, 13, 29, 23, 85, 57, 467, 1835, 133, 7961, 4175, 2445}}, {2677, 15, 7315, {1, 1, 1, 15, 23, 27, 37, 5, 123, 913, 1293, 1633, 3113, 5413, 26407}}, {2678, 15, 7317, {1, 1, 5, 13, 27, 1, 121, 151, 303, 931, 375, 3679, 1863, 12301, 30907}}, {2679, 15, 7331, {1, 3, 1, 9, 31, 9, 49, 203, 177, 937, 1503, 933, 5867, 12533, 13621}}, {2680, 15, 7338, {1, 3, 3, 15, 1, 41, 23, 191, 191, 931, 837, 3553, 2611, 4735, 18105}}, {2681, 15, 7340, {1, 1, 5, 7, 27, 49, 51, 111, 435, 195, 1229, 711, 7145, 14571, 31707}}, {2682, 15, 7346, {1, 1, 7, 7, 3, 41, 59, 203, 291, 903, 1727, 2757, 1463, 6287, 31535}}, {2683, 15, 7355, {1, 1, 7, 13, 23, 5, 75, 3, 207, 525, 411, 2133, 2231, 477, 7155}}, {2684, 15, 7366, {1, 3, 5, 7, 13, 19, 111, 225, 489, 83, 1177, 4077, 4617, 14413, 7133}}, {2685, 15, 7383, {1, 3, 1, 7, 9, 59, 3, 113, 379, 803, 1289, 3347, 4127, 6669, 14867}}, {2686, 15, 7389, {1, 3, 7, 3, 31, 37, 87, 79, 399, 749, 995, 1611, 3137, 12543, 31955}}, {2687, 15, 7393, {1, 1, 5, 7, 21, 59, 49, 45, 511, 639, 1033, 2169, 3265, 15001, 10745}}, {2688, 15, 7396, {1, 1, 5, 1, 25, 19, 23, 203, 11, 883, 1031, 4087, 5059, 11321, 21675}}, {2689, 15, 7400, {1, 3, 7, 5, 11, 27, 33, 205, 163, 289, 501, 3505, 1515, 1895, 15889}}, {2690, 15, 7414, {1, 3, 1, 1, 23, 7, 39, 239, 29, 119, 1499, 2071, 6495, 12107, 5339}}, {2691, 15, 7417, {1, 3, 1, 1, 23, 29, 55, 181, 327, 905, 427, 1033, 427, 3687, 5367}}, {2692, 15, 7426, {1, 3, 3, 7, 21, 27, 115, 127, 393, 855, 1291, 2121, 381, 9995, 29757}}, {2693, 15, 7432, {1, 3, 5, 1, 25, 13, 15, 183, 269, 1005, 1531, 3451, 3975, 9479, 23695}}, {2694, 15, 7452, {1, 3, 7, 7, 19, 31, 111, 97, 33, 179, 1343, 2069, 977, 5043, 9129}}, {2695, 15, 7468, {1, 3, 1, 5, 17, 57, 99, 129, 379, 829, 837, 1845, 3613, 7351, 19291}}, {2696, 15, 7488, {1, 3, 3, 5, 31, 23, 119, 229, 135, 389, 9, 705, 6697, 15441, 5303}}, {2697, 15, 7491, {1, 1, 1, 11, 25, 31, 105, 95, 5, 931, 789, 375, 7543, 9957, 28627}}, {2698, 15, 7494, {1, 1, 7, 15, 21, 17, 19, 103, 389, 545, 1725, 2867, 4251, 3829, 6907}}, {2699, 15, 7497, {1, 3, 7, 7, 15, 37, 97, 65, 337, 409, 1649, 2869, 7929, 8905, 21989}}, {2700, 15, 7515, {1, 3, 5, 3, 11, 15, 69, 29, 353, 207, 233, 411, 2047, 10303, 31655}}, {2701, 15, 7531, {1, 3, 3, 7, 27, 43, 125, 107, 69, 981, 215, 1955, 3589, 597, 12703}}, {2702, 15, 7552, {1, 1, 7, 9, 25, 13, 109, 73, 227, 663, 1115, 285, 471, 3359, 15787}}, {2703, 15, 7562, {1, 3, 7, 5, 1, 45, 7, 79, 441, 149, 701, 1457, 6595, 14829, 20865}}, {2704, 15, 7564, {1, 3, 7, 15, 15, 47, 83, 239, 295, 23, 1085, 813, 1209, 3573, 2855}}, {2705, 15, 7569, {1, 1, 3, 15, 13, 7, 59, 67, 255, 537, 1841, 3857, 6821, 15175, 13997}}, {2706, 15, 7582, {1, 3, 1, 1, 9, 57, 59, 21, 21, 41, 1693, 2805, 7953, 1389, 14105}}, {2707, 15, 7585, {1, 3, 5, 15, 19, 49, 107, 117, 99, 607, 145, 53, 1863, 9383, 12029}}, {2708, 15, 7588, {1, 3, 3, 13, 1, 39, 5, 141, 503, 265, 281, 1785, 2673, 6597, 6333}}, {2709, 15, 7592, {1, 1, 5, 3, 3, 19, 3, 181, 169, 269, 955, 2399, 3157, 11053, 8563}}, {2710, 15, 7597, {1, 3, 3, 13, 11, 1, 95, 43, 179, 507, 443, 209, 3239, 14239, 21829}}, {2711, 15, 7603, {1, 1, 7, 9, 3, 17, 99, 179, 445, 479, 1897, 1507, 5753, 4757, 2135}}, {2712, 15, 7610, {1, 3, 3, 1, 9, 51, 29, 13, 295, 291, 927, 85, 5707, 7447, 32319}}, {2713, 15, 7624, {1, 1, 1, 3, 13, 11, 21, 157, 213, 327, 1071, 591, 2639, 15405, 6617}}, {2714, 15, 7642, {1, 3, 5, 1, 7, 25, 55, 47, 495, 681, 727, 2707, 2955, 705, 7489}}, {2715, 15, 7647, {1, 1, 3, 9, 17, 3, 73, 67, 465, 367, 1473, 3195, 7825, 5299, 1817}}, {2716, 15, 7653, {1, 1, 1, 1, 19, 31, 77, 253, 71, 599, 1601, 871, 2243, 6699, 13013}}, {2717, 15, 7654, {1, 1, 7, 9, 21, 1, 71, 115, 5, 65, 767, 925, 7901, 10761, 19431}}, {2718, 15, 7666, {1, 3, 1, 7, 23, 31, 31, 15, 105, 391, 585, 2995, 2635, 10607, 24951}}, {2719, 15, 7668, {1, 3, 3, 1, 19, 25, 71, 211, 41, 197, 787, 225, 6781, 813, 10117}}, {2720, 15, 7684, {1, 3, 3, 3, 17, 29, 3, 153, 231, 643, 1151, 447, 3699, 9625, 26677}}, {2721, 15, 7705, {1, 1, 5, 9, 1, 25, 71, 21, 395, 297, 557, 3841, 233, 1877, 4569}}, {2722, 15, 7732, {1, 1, 3, 13, 1, 45, 115, 61, 5, 937, 173, 2109, 2927, 9599, 9155}}, {2723, 15, 7741, {1, 1, 3, 3, 15, 21, 61, 121, 253, 285, 1083, 3545, 5537, 6773, 2629}}, {2724, 15, 7749, {1, 3, 3, 15, 13, 63, 33, 77, 49, 849, 1795, 2771, 5481, 9833, 603}}, {2725, 15, 7750, {1, 1, 7, 5, 1, 39, 113, 237, 225, 1005, 1687, 2297, 3213, 2605, 14669}}, {2726, 15, 7759, {1, 1, 3, 1, 11, 1, 39, 23, 67, 441, 1235, 2545, 3139, 15901, 29243}}, {2727, 15, 7764, {1, 3, 1, 3, 15, 49, 39, 57, 311, 345, 525, 223, 4923, 6311, 25275}}, {2728, 15, 7777, {1, 1, 5, 7, 9, 13, 69, 11, 349, 423, 1773, 1055, 1001, 9359, 17025}}, {2729, 15, 7790, {1, 1, 1, 13, 15, 63, 89, 207, 335, 591, 1223, 2701, 55, 12471, 13127}}, {2730, 15, 7817, {1, 1, 3, 5, 15, 19, 83, 67, 407, 113, 1961, 779, 5803, 12417, 21751}}, {2731, 15, 7826, {1, 3, 3, 1, 21, 53, 81, 95, 405, 427, 1047, 2443, 4153, 5843, 22511}}, {2732, 15, 7831, {1, 1, 7, 7, 7, 25, 115, 155, 453, 537, 741, 2379, 2343, 16035, 19587}}, {2733, 15, 7859, {1, 3, 3, 11, 27, 21, 111, 121, 503, 437, 803, 3399, 5303, 10163, 18199}}, {2734, 15, 7871, {1, 1, 5, 13, 19, 27, 7, 81, 259, 545, 965, 743, 4533, 8813, 21253}}, {2735, 15, 7873, {1, 1, 5, 5, 1, 59, 37, 11, 105, 343, 75, 1319, 6317, 9593, 1699}}, {2736, 15, 7876, {1, 3, 1, 9, 13, 9, 115, 131, 387, 1023, 253, 693, 5191, 12777, 10565}}, {2737, 15, 7900, {1, 3, 1, 15, 7, 35, 111, 195, 287, 305, 533, 1901, 3363, 10085, 30791}}, {2738, 15, 7904, {1, 1, 3, 9, 27, 51, 21, 77, 413, 925, 717, 791, 4147, 585, 5649}}, {2739, 15, 7913, {1, 3, 3, 5, 25, 59, 79, 249, 185, 567, 71, 1997, 7373, 2327, 18637}}, {2740, 15, 7916, {1, 3, 3, 11, 15, 21, 97, 99, 391, 57, 1973, 29, 7451, 2529, 25737}}, {2741, 15, 7922, {1, 3, 7, 5, 7, 59, 93, 5, 287, 469, 1639, 3637, 5465, 14431, 32265}}, {2742, 15, 7946, {1, 1, 3, 11, 3, 1, 71, 75, 427, 299, 811, 3697, 3529, 5433, 26957}}, {2743, 15, 7953, {1, 3, 1, 9, 19, 59, 37, 255, 165, 1005, 19, 2851, 4309, 455, 9485}}, {2744, 15, 7956, {1, 1, 1, 5, 1, 55, 15, 233, 133, 47, 1831, 713, 2601, 1017, 3201}}, {2745, 15, 7963, {1, 1, 5, 5, 21, 55, 127, 69, 377, 41, 25, 2295, 7595, 4733, 11615}}, {2746, 15, 7979, {1, 1, 5, 3, 23, 5, 7, 181, 161, 775, 1095, 2271, 6637, 14489, 6873}}, {2747, 15, 7981, {1, 3, 5, 9, 9, 15, 5, 133, 357, 21, 127, 2685, 6299, 4363, 17573}}, {2748, 15, 7984, {1, 3, 3, 9, 13, 39, 51, 223, 201, 401, 1839, 2461, 7633, 6039, 10445}}, {2749, 15, 7989, {1, 1, 5, 1, 9, 21, 19, 249, 227, 359, 255, 2895, 4117, 2073, 27687}}, {2750, 15, 7999, {1, 1, 5, 15, 5, 61, 113, 161, 95, 3, 877, 2775, 293, 6655, 4023}}, {2751, 15, 8001, {1, 3, 7, 1, 7, 55, 73, 39, 295, 403, 985, 2315, 1667, 13525, 1453}}, {2752, 15, 8021, {1, 1, 5, 1, 27, 1, 85, 195, 11, 713, 1841, 3895, 3131, 2193, 17607}}, {2753, 15, 8056, {1, 3, 5, 13, 25, 1, 119, 97, 239, 167, 1393, 1753, 6989, 12155, 12509}}, {2754, 15, 8080, {1, 1, 7, 15, 31, 21, 41, 255, 425, 445, 165, 2097, 5627, 4971, 13207}}, {2755, 15, 8083, {1, 1, 1, 15, 13, 33, 81, 105, 453, 197, 13, 1547, 7381, 8709, 15103}}, {2756, 15, 8089, {1, 1, 3, 11, 11, 33, 107, 123, 483, 367, 121, 995, 1911, 8205, 22577}}, {2757, 15, 8090, {1, 1, 1, 9, 9, 43, 71, 49, 273, 431, 1705, 3313, 4259, 16291, 14345}}, {2758, 15, 8114, {1, 1, 1, 7, 3, 1, 43, 213, 97, 547, 1559, 1149, 2791, 3751, 887}}, {2759, 15, 8128, {1, 1, 3, 15, 25, 47, 49, 251, 425, 35, 295, 3767, 6305, 9633, 5045}}, {2760, 15, 8133, {1, 3, 3, 1, 5, 55, 91, 245, 27, 981, 331, 555, 6553, 11017, 15289}}, {2761, 15, 8145, {1, 1, 3, 7, 1, 23, 23, 155, 223, 565, 1005, 3211, 3847, 7479, 3643}}, {2762, 15, 8155, {1, 1, 5, 1, 17, 7, 47, 95, 35, 779, 1685, 2099, 7505, 15425, 18089}}, {2763, 15, 8161, {1, 3, 3, 7, 3, 63, 83, 151, 211, 147, 611, 1171, 1681, 7687, 13423}}, {2764, 15, 8182, {1, 3, 3, 1, 3, 27, 107, 117, 497, 537, 195, 3075, 2753, 1665, 19399}}, {2765, 15, 8186, {1, 1, 1, 7, 23, 5, 103, 209, 117, 845, 1243, 1283, 4253, 9723, 20937}}, {2766, 15, 8191, {1, 3, 1, 1, 5, 49, 7, 13, 419, 125, 287, 1599, 8161, 1275, 24661}}, {2767, 15, 8192, {1, 3, 3, 3, 13, 63, 23, 183, 39, 979, 1301, 2349, 905, 15805, 30151}}, {2768, 15, 8195, {1, 1, 3, 9, 17, 11, 97, 189, 189, 511, 1779, 2077, 6891, 11623, 23949}}, {2769, 15, 8201, {1, 1, 7, 11, 13, 45, 15, 37, 11, 853, 915, 1569, 6103, 10633, 3137}}, {2770, 15, 8207, {1, 3, 3, 5, 15, 61, 91, 255, 131, 821, 1755, 1501, 2663, 1747, 941}}, {2771, 15, 8210, {1, 1, 3, 7, 19, 19, 65, 95, 499, 239, 2023, 3185, 4649, 3861, 3767}}, {2772, 15, 8228, {1, 3, 5, 15, 15, 63, 55, 93, 127, 303, 171, 1763, 4991, 9479, 9917}}, {2773, 15, 8249, {1, 3, 7, 5, 31, 53, 111, 35, 433, 163, 1903, 3991, 3585, 643, 21941}}, {2774, 15, 8252, {1, 3, 1, 9, 27, 39, 67, 89, 487, 349, 587, 1723, 4311, 11321, 25785}}, {2775, 15, 8258, {1, 3, 5, 7, 1, 63, 23, 237, 507, 689, 1341, 441, 1721, 843, 20335}}, {2776, 15, 8267, {1, 1, 3, 3, 31, 63, 83, 103, 25, 799, 1379, 1817, 3809, 12285, 16673}}, {2777, 15, 8270, {1, 1, 5, 3, 25, 29, 99, 193, 21, 549, 33, 3109, 4135, 10071, 32355}}, {2778, 15, 8275, {1, 3, 1, 7, 13, 27, 83, 189, 121, 167, 379, 1503, 7955, 13189, 313}}, {2779, 15, 8284, {1, 3, 5, 15, 25, 19, 83, 87, 257, 237, 709, 1169, 1561, 7117, 4785}}, {2780, 15, 8293, {1, 1, 1, 7, 9, 55, 21, 5, 439, 367, 403, 2311, 6243, 8349, 13127}}, {2781, 15, 8298, {1, 3, 7, 3, 5, 35, 51, 67, 453, 767, 29, 3293, 6665, 11459, 2799}}, {2782, 15, 8305, {1, 3, 3, 3, 5, 19, 59, 7, 367, 683, 783, 1317, 7119, 6129, 19525}}, {2783, 15, 8317, {1, 1, 5, 5, 5, 19, 61, 67, 381, 291, 875, 2179, 2481, 9325, 11253}}, {2784, 15, 8328, {1, 3, 5, 5, 7, 47, 107, 9, 141, 667, 1989, 821, 3909, 1733, 10187}}, {2785, 15, 8336, {1, 1, 7, 7, 31, 61, 1, 71, 477, 689, 1539, 3617, 8105, 6535, 3293}}, {2786, 15, 8345, {1, 1, 5, 5, 23, 9, 103, 197, 241, 249, 297, 3607, 6217, 1673, 30103}}, {2787, 15, 8351, {1, 3, 1, 5, 23, 15, 115, 105, 365, 51, 825, 2687, 359, 16325, 15083}}, {2788, 15, 8367, {1, 1, 3, 11, 29, 45, 65, 251, 169, 189, 1243, 2345, 1345, 14471, 25631}}, {2789, 15, 8379, {1, 1, 5, 9, 7, 63, 81, 167, 309, 539, 1169, 3949, 4193, 12047, 1491}}, {2790, 15, 8381, {1, 3, 1, 9, 29, 33, 89, 167, 67, 73, 1885, 477, 5745, 13365, 6819}}, {2791, 15, 8382, {1, 3, 7, 9, 9, 49, 95, 13, 157, 997, 1725, 935, 7543, 6349, 18277}}, {2792, 15, 8393, {1, 1, 5, 5, 11, 59, 97, 17, 303, 469, 93, 2761, 7395, 9021, 24299}}, {2793, 15, 8402, {1, 1, 7, 3, 27, 63, 71, 99, 407, 139, 711, 2589, 4715, 5405, 3277}}, {2794, 15, 8414, {1, 3, 7, 3, 11, 15, 49, 57, 271, 493, 1165, 2839, 8191, 2609, 14759}}, {2795, 15, 8417, {1, 1, 1, 7, 21, 15, 71, 245, 413, 473, 1321, 1165, 1027, 6983, 12867}}, {2796, 15, 8420, {1, 1, 5, 3, 15, 21, 19, 197, 401, 627, 2047, 2761, 5807, 5751, 28025}}, {2797, 15, 8429, {1, 1, 3, 3, 5, 57, 19, 209, 341, 165, 489, 455, 231, 14385, 12457}}, {2798, 15, 8435, {1, 3, 3, 11, 13, 63, 79, 129, 17, 315, 1881, 1069, 177, 12013, 29567}}, {2799, 15, 8438, {1, 1, 3, 7, 31, 29, 51, 235, 475, 375, 617, 437, 6379, 8505, 23079}}, {2800, 15, 8450, {1, 1, 3, 7, 27, 3, 3, 137, 203, 959, 363, 371, 2899, 13491, 22979}}, {2801, 15, 8452, {1, 3, 3, 3, 9, 1, 57, 7, 363, 537, 713, 2417, 509, 7747, 22135}}, {2802, 15, 8459, {1, 3, 3, 3, 13, 21, 79, 121, 487, 921, 113, 281, 2853, 14855, 19747}}, {2803, 15, 8470, {1, 1, 1, 11, 3, 53, 89, 123, 307, 585, 567, 1925, 505, 15935, 20419}}, {2804, 15, 8486, {1, 1, 3, 3, 15, 45, 77, 197, 499, 683, 1405, 3573, 981, 14135, 19763}}, {2805, 15, 8490, {1, 1, 1, 11, 27, 31, 61, 191, 29, 601, 373, 2011, 6193, 3599, 4387}}, {2806, 15, 8500, {1, 3, 5, 9, 7, 13, 1, 193, 469, 603, 1315, 3329, 3761, 8355, 10425}}, {2807, 15, 8524, {1, 1, 3, 9, 29, 61, 103, 17, 117, 251, 2029, 2963, 3763, 16117, 6627}}, {2808, 15, 8536, {1, 3, 1, 3, 7, 51, 91, 145, 497, 657, 871, 3707, 5905, 10449, 14901}}, {2809, 15, 8552, {1, 1, 3, 1, 3, 53, 23, 149, 461, 333, 1809, 1315, 1815, 8223, 13297}}, {2810, 15, 8558, {1, 1, 1, 7, 15, 31, 3, 47, 443, 829, 1305, 893, 4191, 9681, 32661}}, {2811, 15, 8570, {1, 3, 1, 3, 27, 43, 51, 221, 295, 825, 649, 2953, 6203, 8237, 20253}}, {2812, 15, 8576, {1, 3, 1, 3, 9, 35, 41, 195, 249, 225, 387, 3789, 1499, 2559, 28413}}, {2813, 15, 8582, {1, 1, 5, 15, 19, 29, 13, 115, 333, 787, 787, 723, 2987, 6227, 10865}}, {2814, 15, 8594, {1, 3, 5, 13, 5, 59, 5, 251, 79, 387, 11, 3167, 6619, 13317, 18979}}, {2815, 15, 8606, {1, 1, 7, 11, 31, 51, 43, 1, 189, 519, 1945, 2129, 4365, 14059, 3139}}, {2816, 15, 8619, {1, 1, 7, 5, 31, 9, 43, 19, 151, 533, 1061, 3849, 6871, 6941, 14935}}, {2817, 15, 8621, {1, 3, 7, 5, 19, 57, 7, 129, 25, 353, 17, 1739, 6513, 399, 28835}}, {2818, 15, 8624, {1, 3, 5, 15, 25, 15, 37, 125, 39, 239, 271, 65, 2189, 10449, 11815}}, {2819, 15, 8633, {1, 3, 7, 15, 19, 57, 47, 245, 509, 945, 385, 3987, 3585, 14711, 9655}}, {2820, 15, 8641, {1, 1, 3, 13, 21, 31, 13, 81, 9, 489, 1321, 63, 1363, 2219, 19541}}, {2821, 15, 8653, {1, 1, 5, 7, 3, 57, 25, 147, 23, 553, 889, 307, 6429, 15807, 12861}}, {2822, 15, 8654, {1, 1, 3, 15, 29, 21, 99, 237, 151, 881, 675, 3625, 1159, 11759, 21347}}, {2823, 15, 8662, {1, 1, 7, 1, 9, 13, 111, 239, 235, 609, 1569, 3271, 2837, 13807, 7301}}, {2824, 15, 8675, {1, 3, 1, 15, 7, 59, 27, 81, 129, 9, 647, 3595, 1877, 1067, 1859}}, {2825, 15, 8689, {1, 3, 7, 1, 3, 25, 119, 57, 145, 441, 1045, 789, 215, 1265, 9369}}, {2826, 15, 8695, {1, 3, 7, 3, 17, 25, 87, 211, 441, 229, 223, 2795, 7241, 7007, 20575}}, {2827, 15, 8702, {1, 1, 3, 1, 13, 1, 55, 227, 389, 141, 1097, 2487, 7603, 4161, 5025}}, {2828, 15, 8706, {1, 1, 3, 5, 15, 29, 29, 145, 233, 209, 891, 89, 8097, 2897, 26685}}, {2829, 15, 8720, {1, 1, 3, 1, 29, 53, 19, 95, 161, 359, 435, 3313, 4955, 7965, 21015}}, {2830, 15, 8729, {1, 3, 5, 9, 19, 3, 109, 77, 29, 937, 1663, 125, 2453, 1069, 20639}}, {2831, 15, 8739, {1, 3, 7, 13, 5, 23, 43, 231, 347, 591, 1963, 2491, 4045, 16029, 8149}}, {2832, 15, 8741, {1, 1, 5, 1, 13, 3, 75, 211, 419, 929, 901, 3453, 8121, 799, 8897}}, {2833, 15, 8751, {1, 1, 7, 15, 11, 11, 123, 111, 309, 415, 1071, 975, 2009, 12945, 19617}}, {2834, 15, 8759, {1, 1, 1, 7, 31, 35, 81, 255, 89, 643, 451, 513, 497, 11751, 24215}}, {2835, 15, 8766, {1, 3, 5, 5, 25, 17, 5, 165, 139, 929, 1927, 1353, 7427, 9719, 17087}}, {2836, 15, 8777, {1, 3, 5, 1, 21, 55, 79, 85, 333, 847, 1305, 851, 5057, 8361, 18269}}, {2837, 15, 8783, {1, 3, 7, 15, 27, 17, 55, 125, 395, 223, 271, 781, 1639, 10569, 11143}}, {2838, 15, 8786, {1, 1, 7, 9, 7, 33, 127, 85, 209, 339, 483, 241, 2523, 14951, 6855}}, {2839, 15, 8795, {1, 1, 3, 9, 5, 19, 9, 183, 435, 343, 1105, 3139, 7617, 1311, 267}}, {2840, 15, 8802, {1, 1, 5, 1, 15, 53, 11, 63, 113, 241, 855, 3123, 4777, 3495, 23345}}, {2841, 15, 8814, {1, 3, 1, 5, 19, 29, 119, 205, 167, 683, 289, 1629, 4977, 8981, 6867}}, {2842, 15, 8821, {1, 3, 1, 1, 31, 63, 95, 159, 267, 231, 863, 3385, 5315, 7267, 13757}}, {2843, 15, 8828, {1, 3, 5, 11, 19, 21, 53, 41, 125, 179, 533, 1279, 3759, 7073, 13905}}, {2844, 15, 8831, {1, 3, 5, 9, 17, 7, 27, 67, 97, 809, 1423, 2743, 2859, 16121, 329}}, {2845, 15, 8837, {1, 3, 1, 15, 1, 41, 59, 155, 509, 51, 1827, 3739, 3879, 13369, 30821}}, {2846, 15, 8842, {1, 3, 3, 7, 21, 31, 7, 13, 347, 919, 1225, 497, 5051, 3769, 20211}}, {2847, 15, 8855, {1, 3, 7, 13, 31, 9, 127, 195, 123, 387, 3, 3593, 6623, 9827, 29319}}, {2848, 15, 8856, {1, 1, 3, 9, 7, 27, 95, 211, 287, 189, 1683, 1999, 7641, 14983, 4699}}, {2849, 15, 8868, {1, 1, 5, 3, 7, 21, 29, 189, 101, 423, 885, 3275, 6569, 11023, 22265}}, {2850, 15, 8877, {1, 3, 5, 3, 9, 33, 79, 75, 327, 975, 287, 3025, 2157, 7301, 24447}}, {2851, 15, 8890, {1, 3, 3, 15, 31, 27, 63, 1, 71, 119, 1151, 517, 6131, 11055, 179}}, {2852, 15, 8892, {1, 3, 7, 11, 23, 15, 101, 247, 349, 735, 673, 997, 6451, 229, 32103}}, {2853, 15, 8900, {1, 3, 5, 15, 7, 1, 51, 135, 207, 741, 1831, 1235, 4747, 11915, 22009}}, {2854, 15, 8909, {1, 3, 1, 13, 9, 31, 19, 221, 465, 681, 627, 2595, 5617, 14201, 30355}}, {2855, 15, 8912, {1, 1, 3, 1, 13, 49, 55, 155, 11, 885, 1275, 3591, 2217, 6659, 30885}}, {2856, 15, 8921, {1, 1, 7, 11, 27, 57, 93, 95, 243, 63, 1405, 2049, 7689, 15943, 18503}}, {2857, 15, 8922, {1, 1, 7, 7, 5, 11, 47, 189, 467, 631, 1665, 2717, 4285, 2087, 1435}}, {2858, 15, 8927, {1, 1, 3, 11, 7, 27, 127, 3, 231, 757, 435, 2545, 3537, 9127, 19915}}, {2859, 15, 8943, {1, 1, 5, 13, 5, 29, 85, 127, 339, 875, 497, 1573, 6553, 11983, 18029}}, {2860, 15, 8948, {1, 3, 1, 1, 21, 3, 15, 91, 231, 683, 1529, 2651, 4147, 13437, 23861}}, {2861, 15, 8951, {1, 3, 1, 7, 27, 17, 19, 179, 243, 223, 1037, 1501, 5935, 2259, 25185}}, {2862, 15, 8958, {1, 1, 3, 15, 11, 19, 127, 27, 483, 219, 583, 2555, 531, 3451, 17875}}, {2863, 15, 8984, {1, 1, 1, 13, 31, 39, 89, 149, 363, 741, 1355, 4067, 3171, 6783, 1799}}, {2864, 15, 8994, {1, 1, 3, 11, 25, 51, 45, 235, 379, 123, 1701, 725, 1991, 7471, 9833}}, {2865, 15, 9000, {1, 1, 5, 13, 15, 47, 13, 201, 263, 57, 375, 2963, 7475, 15929, 13775}}, {2866, 15, 9013, {1, 1, 3, 1, 29, 29, 11, 161, 345, 253, 97, 255, 7267, 2379, 3933}}, {2867, 15, 9018, {1, 3, 1, 15, 3, 47, 11, 69, 347, 747, 795, 2401, 3367, 2383, 6125}}, {2868, 15, 9020, {1, 1, 7, 3, 1, 49, 101, 47, 71, 761, 1503, 2619, 191, 8895, 873}}, {2869, 15, 9031, {1, 3, 3, 5, 25, 41, 93, 85, 427, 109, 1675, 2409, 4317, 9233, 30283}}, {2870, 15, 9035, {1, 1, 3, 9, 11, 3, 67, 159, 425, 751, 887, 1415, 403, 15977, 10739}}, {2871, 15, 9045, {1, 1, 5, 13, 9, 1, 9, 103, 481, 601, 931, 1957, 5763, 7095, 27141}}, {2872, 15, 9052, {1, 1, 3, 15, 29, 13, 43, 33, 297, 269, 1041, 1411, 3461, 12043, 10045}}, {2873, 15, 9056, {1, 3, 5, 3, 3, 3, 5, 7, 185, 753, 133, 1561, 5595, 13777, 25795}}, {2874, 15, 9059, {1, 3, 5, 5, 1, 19, 29, 145, 163, 149, 619, 2603, 7757, 10035, 10189}}, {2875, 15, 9066, {1, 3, 7, 15, 27, 15, 111, 173, 135, 117, 157, 2601, 7919, 12111, 22795}}, {2876, 15, 9076, {1, 3, 1, 1, 29, 27, 65, 31, 101, 715, 289, 3643, 2335, 6789, 23397}}, {2877, 15, 9089, {1, 3, 1, 3, 11, 45, 71, 109, 321, 423, 1695, 169, 3075, 12423, 11391}}, {2878, 15, 9129, {1, 1, 3, 9, 13, 51, 35, 121, 203, 279, 433, 2725, 7951, 2105, 27333}}, {2879, 15, 9132, {1, 1, 1, 15, 23, 31, 25, 105, 501, 441, 1511, 3133, 2811, 10595, 21779}}, {2880, 15, 9147, {1, 1, 5, 13, 7, 1, 97, 193, 121, 993, 1347, 1903, 1883, 6583, 24535}}, {2881, 15, 9164, {1, 1, 7, 9, 7, 29, 17, 41, 101, 447, 1289, 387, 1891, 2723, 26091}}, {2882, 15, 9167, {1, 1, 3, 3, 3, 53, 81, 81, 177, 165, 195, 3413, 8177, 3817, 8453}}, {2883, 15, 9185, {1, 3, 7, 15, 15, 31, 23, 31, 337, 439, 1773, 63, 5351, 5491, 1767}}, {2884, 15, 9195, {1, 3, 1, 11, 5, 15, 23, 75, 437, 553, 429, 2705, 3625, 13851, 19865}}, {2885, 15, 9197, {1, 3, 3, 9, 13, 15, 33, 235, 215, 415, 1737, 1409, 2101, 14623, 14717}}, {2886, 15, 9210, {1, 3, 7, 7, 13, 51, 101, 217, 175, 813, 1639, 4009, 1625, 4991, 17525}}, {2887, 15, 9217, {1, 1, 5, 13, 23, 33, 29, 175, 39, 673, 557, 3239, 5129, 11049, 27227}}, {2888, 15, 9229, {1, 3, 7, 13, 1, 37, 33, 139, 493, 891, 1883, 2525, 5741, 15795, 5875}}, {2889, 15, 9248, {1, 3, 1, 15, 15, 27, 127, 111, 147, 363, 725, 3077, 4341, 9131, 24635}}, {2890, 15, 9254, {1, 1, 7, 3, 17, 25, 59, 135, 177, 635, 73, 3455, 3083, 6009, 13033}}, {2891, 15, 9263, {1, 1, 1, 5, 15, 53, 93, 161, 215, 459, 1087, 179, 2235, 8885, 15309}}, {2892, 15, 9266, {1, 1, 7, 13, 7, 17, 75, 173, 449, 855, 103, 2739, 3421, 11811, 18805}}, {2893, 15, 9268, {1, 1, 7, 9, 5, 11, 53, 75, 247, 249, 1201, 953, 2455, 4589, 6027}}, {2894, 15, 9290, {1, 1, 5, 13, 27, 51, 119, 39, 137, 11, 1435, 3773, 3889, 6081, 11829}}, {2895, 15, 9310, {1, 1, 5, 5, 5, 35, 1, 197, 501, 185, 1039, 1563, 6421, 14373, 25655}}, {2896, 15, 9316, {1, 1, 3, 13, 31, 55, 115, 183, 483, 655, 1351, 3203, 725, 3299, 22579}}, {2897, 15, 9338, {1, 3, 5, 11, 31, 31, 83, 59, 395, 21, 1881, 2821, 2251, 11781, 26265}}, {2898, 15, 9340, {1, 3, 7, 13, 21, 19, 103, 21, 403, 443, 1951, 55, 985, 15983, 15087}}, {2899, 15, 9343, {1, 1, 5, 15, 29, 11, 51, 53, 255, 183, 1475, 1491, 259, 387, 10303}}, {2900, 15, 9344, {1, 3, 5, 7, 21, 37, 45, 39, 479, 637, 1325, 3753, 3319, 7403, 31759}}, {2901, 15, 9350, {1, 1, 3, 5, 7, 43, 89, 53, 269, 187, 995, 141, 119, 8139, 29699}}, {2902, 15, 9354, {1, 1, 1, 5, 1, 53, 3, 23, 379, 223, 1889, 4035, 1437, 12425, 9051}}, {2903, 15, 9359, {1, 3, 1, 13, 3, 31, 61, 43, 249, 449, 901, 1921, 3495, 8599, 5263}}, {2904, 15, 9361, {1, 1, 3, 5, 3, 25, 35, 133, 25, 597, 915, 3663, 5147, 11831, 24269}}, {2905, 15, 9364, {1, 1, 1, 9, 21, 27, 93, 93, 217, 299, 1881, 3647, 4825, 7989, 24121}}, {2906, 15, 9368, {1, 3, 1, 15, 5, 15, 49, 129, 315, 631, 2037, 1567, 4043, 15589, 30905}}, {2907, 15, 9371, {1, 3, 3, 7, 25, 5, 123, 51, 47, 471, 1563, 3947, 7975, 3681, 9611}}, {2908, 15, 9373, {1, 3, 7, 15, 1, 17, 73, 245, 465, 95, 95, 1159, 1319, 4675, 8841}}, {2909, 15, 9389, {1, 1, 3, 15, 5, 51, 35, 71, 423, 651, 753, 173, 2131, 15799, 29601}}, {2910, 15, 9390, {1, 1, 1, 1, 3, 53, 83, 187, 445, 827, 1549, 979, 5363, 1701, 2149}}, {2911, 15, 9409, {1, 1, 7, 9, 3, 15, 65, 161, 37, 233, 771, 3749, 727, 6857, 17175}}, {2912, 15, 9443, {1, 1, 7, 7, 27, 29, 107, 247, 249, 353, 773, 3677, 7273, 5419, 29397}}, {2913, 15, 9445, {1, 3, 3, 7, 31, 49, 87, 159, 145, 497, 1715, 2115, 5035, 6431, 7245}}, {2914, 15, 9446, {1, 3, 3, 5, 7, 31, 51, 117, 101, 617, 557, 2551, 6589, 13295, 31975}}, {2915, 15, 9452, {1, 1, 3, 3, 15, 27, 125, 163, 169, 893, 1771, 25, 5787, 10267, 10297}}, {2916, 15, 9490, {1, 1, 1, 5, 9, 47, 85, 65, 289, 783, 1105, 4035, 4111, 2589, 24575}}, {2917, 15, 9492, {1, 3, 3, 13, 23, 33, 7, 49, 301, 531, 1713, 2755, 5543, 8153, 24099}}, {2918, 15, 9495, {1, 1, 5, 9, 7, 39, 101, 67, 417, 923, 757, 1537, 5553, 12233, 20881}}, {2919, 15, 9508, {1, 1, 5, 1, 19, 7, 25, 123, 125, 183, 573, 3317, 6867, 871, 17631}}, {2920, 15, 9523, {1, 1, 3, 15, 19, 13, 117, 41, 129, 715, 1525, 2257, 2179, 10807, 23271}}, {2921, 15, 9543, {1, 3, 1, 5, 25, 53, 19, 169, 289, 569, 1135, 1967, 7001, 15883, 15113}}, {2922, 15, 9558, {1, 3, 7, 15, 7, 37, 127, 147, 415, 313, 1541, 1889, 3763, 16199, 12681}}, {2923, 15, 9567, {1, 1, 3, 9, 1, 35, 95, 137, 237, 951, 899, 3177, 6073, 10655, 31687}}, {2924, 15, 9580, {1, 1, 5, 5, 29, 57, 45, 253, 297, 529, 1553, 467, 8035, 15675, 21691}}, {2925, 15, 9585, {1, 3, 7, 15, 25, 41, 59, 81, 87, 985, 1001, 2369, 661, 7551, 11829}}, {2926, 15, 9591, {1, 1, 7, 9, 27, 21, 7, 233, 309, 67, 701, 2737, 4261, 2467, 15691}}, {2927, 15, 9611, {1, 3, 7, 1, 19, 55, 47, 155, 333, 101, 517, 1991, 4619, 10435, 27241}}, {2928, 15, 9613, {1, 1, 7, 3, 23, 35, 7, 125, 157, 537, 933, 3281, 4975, 8969, 27581}}, {2929, 15, 9614, {1, 1, 3, 7, 19, 53, 81, 103, 461, 435, 777, 335, 5261, 12249, 9695}}, {2930, 15, 9621, {1, 3, 1, 7, 19, 9, 75, 245, 355, 37, 1855, 1339, 3107, 7251, 16543}}, {2931, 15, 9631, {1, 1, 1, 3, 5, 35, 39, 223, 113, 423, 1423, 713, 6113, 349, 24147}}, {2932, 15, 9642, {1, 3, 1, 1, 15, 31, 11, 75, 499, 345, 1253, 2629, 2551, 7483, 25395}}, {2933, 15, 9656, {1, 1, 3, 11, 25, 25, 3, 211, 185, 45, 1865, 1805, 3303, 11091, 529}}, {2934, 15, 9661, {1, 3, 1, 1, 9, 21, 7, 165, 107, 641, 1083, 2805, 2099, 5855, 18477}}, {2935, 15, 9667, {1, 3, 5, 3, 9, 21, 77, 103, 505, 277, 335, 797, 3869, 2957, 1979}}, {2936, 15, 9694, {1, 3, 5, 15, 31, 23, 77, 247, 303, 891, 1261, 3233, 3495, 13111, 13185}}, {2937, 15, 9715, {1, 3, 5, 11, 11, 35, 49, 229, 149, 931, 881, 775, 2949, 3141, 29157}}, {2938, 15, 9722, {1, 1, 3, 5, 19, 57, 23, 95, 347, 221, 195, 3561, 1481, 2063, 3979}}, {2939, 15, 9738, {1, 3, 5, 3, 13, 1, 23, 173, 431, 29, 421, 3235, 2751, 4447, 28283}}, {2940, 15, 9745, {1, 1, 5, 13, 23, 3, 1, 9, 327, 855, 1251, 2997, 6129, 4223, 11555}}, {2941, 15, 9758, {1, 3, 7, 13, 29, 21, 37, 229, 217, 353, 1239, 3955, 491, 12183, 14777}}, {2942, 15, 9764, {1, 1, 5, 5, 1, 33, 103, 187, 183, 939, 1873, 2633, 6143, 15405, 17353}}, {2943, 15, 9782, {1, 1, 1, 9, 21, 27, 71, 129, 499, 279, 1181, 4053, 2485, 1961, 30603}}, {2944, 15, 9791, {1, 1, 3, 15, 21, 37, 45, 201, 221, 187, 727, 1241, 6171, 1383, 22277}}, {2945, 15, 9793, {1, 3, 7, 5, 21, 17, 67, 177, 323, 601, 633, 865, 6131, 10329, 8689}}, {2946, 15, 9794, {1, 3, 5, 9, 15, 45, 71, 43, 359, 651, 103, 403, 3249, 11769, 6567}}, {2947, 15, 9805, {1, 3, 3, 13, 3, 23, 101, 145, 367, 999, 1489, 3673, 2959, 10855, 16029}}, {2948, 15, 9808, {1, 3, 7, 3, 13, 43, 123, 87, 55, 1015, 141, 2917, 6567, 16025, 25555}}, {2949, 15, 9811, {1, 3, 1, 3, 17, 7, 21, 161, 41, 889, 1315, 1897, 639, 15451, 3049}}, {2950, 15, 9817, {1, 3, 5, 15, 27, 33, 55, 17, 81, 431, 325, 909, 3547, 10121, 17815}}, {2951, 15, 9824, {1, 1, 3, 1, 15, 37, 43, 137, 203, 191, 1129, 1585, 435, 3177, 769}}, {2952, 15, 9836, {1, 3, 7, 11, 21, 23, 125, 41, 17, 951, 465, 3691, 3465, 13247, 13779}}, {2953, 15, 9851, {1, 3, 3, 1, 31, 23, 43, 101, 405, 739, 1061, 2955, 5643, 16137, 8763}}, {2954, 15, 9853, {1, 1, 5, 1, 19, 33, 99, 109, 203, 65, 395, 2775, 1373, 2557, 5875}}, {2955, 15, 9854, {1, 3, 3, 3, 27, 51, 79, 63, 331, 365, 1071, 1661, 4549, 8561, 1719}}, {2956, 15, 9877, {1, 3, 3, 9, 3, 17, 53, 161, 141, 489, 1325, 1709, 1381, 5093, 171}}, {2957, 15, 9881, {1, 1, 7, 15, 9, 3, 95, 237, 197, 949, 7, 1837, 729, 10111, 6637}}, {2958, 15, 9923, {1, 1, 3, 3, 19, 31, 57, 173, 483, 861, 1001, 1919, 3389, 11777, 20693}}, {2959, 15, 9935, {1, 3, 1, 9, 27, 13, 113, 177, 75, 925, 949, 119, 4759, 7775, 23033}}, {2960, 15, 9937, {1, 1, 7, 15, 23, 15, 65, 61, 137, 653, 1843, 323, 379, 15157, 29885}}, {2961, 15, 9954, {1, 3, 3, 7, 29, 3, 11, 205, 347, 745, 1477, 3929, 5749, 4735, 29435}}, {2962, 15, 9959, {1, 3, 5, 9, 1, 11, 111, 15, 7, 69, 45, 3607, 1099, 9203, 21301}}, {2963, 15, 9963, {1, 3, 3, 3, 23, 3, 83, 173, 73, 485, 681, 1867, 3839, 11823, 13339}}, {2964, 15, 9968, {1, 1, 3, 11, 31, 43, 107, 127, 465, 389, 1595, 427, 1571, 5885, 29569}}, {2965, 15, 9973, {1, 1, 7, 9, 27, 25, 117, 27, 287, 391, 279, 3247, 35, 12973, 5483}}, {2966, 15, 9974, {1, 3, 7, 11, 19, 55, 45, 127, 245, 945, 305, 3907, 2455, 3163, 31}}, {2967, 15, 9980, {1, 1, 7, 11, 15, 17, 65, 15, 37, 207, 1447, 3027, 2281, 6557, 16717}}, {2968, 15, 9983, {1, 1, 1, 13, 5, 27, 33, 213, 29, 603, 1171, 3235, 2255, 2017, 30999}}, {2969, 15, 9985, {1, 3, 1, 5, 11, 1, 73, 233, 69, 125, 397, 297, 3337, 6191, 31055}}, {2970, 15, 10003, {1, 1, 1, 15, 1, 1, 65, 145, 201, 917, 1891, 2999, 4069, 10413, 15819}}, {2971, 15, 10010, {1, 3, 5, 13, 15, 51, 115, 167, 311, 375, 1069, 2595, 3337, 753, 11903}}, {2972, 15, 10034, {1, 1, 3, 1, 1, 23, 69, 125, 147, 915, 1945, 411, 979, 13863, 30443}}, {2973, 15, 10040, {1, 3, 1, 11, 5, 1, 93, 23, 135, 93, 1689, 23, 3519, 4491, 24673}}, {2974, 15, 10063, {1, 1, 7, 3, 11, 59, 93, 153, 487, 475, 1191, 1455, 5963, 8259, 18811}}, {2975, 15, 10077, {1, 1, 3, 1, 13, 15, 55, 71, 433, 33, 491, 1835, 5695, 10509, 347}}, {2976, 15, 10081, {1, 1, 1, 15, 19, 1, 23, 47, 235, 101, 1057, 901, 5477, 7079, 30885}}, {2977, 15, 10082, {1, 1, 5, 13, 11, 43, 119, 77, 441, 121, 783, 827, 1757, 12751, 31593}}, {2978, 15, 10084, {1, 3, 7, 11, 19, 17, 37, 225, 329, 231, 515, 1541, 7371, 6355, 10905}}, {2979, 15, 10088, {1, 1, 5, 13, 7, 11, 35, 215, 345, 577, 147, 2803, 3291, 4631, 5329}}, {2980, 15, 10091, {1, 1, 3, 9, 21, 55, 113, 251, 25, 221, 1445, 3385, 1589, 4109, 29897}}, {2981, 15, 10105, {1, 1, 5, 7, 9, 45, 5, 33, 331, 285, 1101, 3131, 2713, 5653, 3823}}, {2982, 15, 10111, {1, 3, 7, 7, 5, 39, 43, 167, 481, 629, 777, 1827, 4653, 403, 4781}}, {2983, 15, 10118, {1, 3, 3, 7, 31, 33, 31, 159, 313, 673, 1425, 663, 5819, 1297, 26627}}, {2984, 15, 10127, {1, 3, 3, 1, 19, 61, 117, 93, 373, 491, 1031, 757, 4185, 771, 7265}}, {2985, 15, 10135, {1, 1, 7, 9, 3, 45, 65, 223, 437, 41, 1139, 2733, 5963, 2709, 25429}}, {2986, 15, 10169, {1, 3, 5, 11, 21, 27, 31, 127, 255, 761, 1865, 1319, 6583, 9235, 10717}}, {2987, 15, 10172, {1, 1, 1, 5, 21, 1, 63, 43, 413, 557, 567, 2893, 8017, 2307, 29525}}, {2988, 15, 10183, {1, 1, 7, 3, 31, 1, 15, 235, 215, 395, 1971, 469, 5275, 431, 5349}}, {2989, 15, 10190, {1, 1, 1, 13, 25, 59, 71, 245, 389, 279, 1293, 89, 6551, 10285, 14495}}, {2990, 15, 10192, {1, 1, 5, 5, 9, 63, 17, 229, 425, 939, 877, 3689, 7229, 6707, 30771}}, {2991, 15, 10211, {1, 3, 7, 7, 11, 29, 43, 41, 25, 237, 1585, 3735, 2617, 7541, 26243}}, {2992, 15, 10218, {1, 1, 7, 9, 21, 5, 69, 231, 361, 39, 1695, 3043, 2973, 5487, 12857}}, {2993, 15, 10228, {1, 1, 5, 3, 17, 63, 91, 217, 407, 133, 1373, 4021, 1737, 10043, 4561}}, {2994, 15, 10235, {1, 3, 7, 9, 31, 13, 101, 231, 175, 457, 89, 2167, 2725, 8505, 375}}, {2995, 15, 10242, {1, 1, 3, 15, 31, 11, 27, 211, 347, 291, 1881, 3091, 3307, 5117, 13341}}, {2996, 15, 10244, {1, 3, 5, 5, 13, 25, 5, 197, 237, 135, 635, 1175, 5085, 14737, 10807}}, {2997, 15, 10271, {1, 3, 3, 9, 7, 63, 107, 127, 147, 477, 1813, 2619, 8089, 2651, 26549}}, {2998, 15, 10278, {1, 1, 5, 11, 15, 45, 27, 133, 45, 621, 707, 2679, 5929, 19, 9599}}, {2999, 15, 10296, {1, 3, 7, 9, 21, 37, 41, 255, 69, 1009, 1999, 367, 6177, 10017, 3549}}, {3000, 15, 10299, {1, 1, 1, 15, 19, 55, 73, 189, 423, 983, 1811, 2551, 4765, 12077, 18205}}, {3001, 15, 10307, {1, 1, 5, 7, 17, 13, 25, 225, 463, 471, 631, 1811, 5797, 3235, 32253}}, {3002, 15, 10309, {1, 3, 7, 1, 29, 7, 123, 187, 331, 735, 1757, 1115, 2077, 15725, 2183}}, {3003, 15, 10310, {1, 3, 7, 9, 17, 61, 111, 93, 21, 1003, 1905, 3719, 2111, 11845, 6427}}, {3004, 15, 10314, {1, 3, 7, 7, 17, 21, 51, 59, 115, 723, 2039, 2833, 5969, 5737, 18407}}, {3005, 15, 10316, {1, 3, 3, 13, 9, 47, 95, 233, 13, 281, 1049, 619, 405, 16205, 20097}}, {3006, 15, 10321, {1, 3, 7, 13, 9, 41, 11, 171, 453, 713, 587, 1669, 2489, 10277, 18599}}, {3007, 15, 10328, {1, 3, 3, 13, 21, 41, 123, 173, 511, 399, 859, 1515, 5773, 12535, 26289}}, {3008, 15, 10338, {1, 1, 7, 15, 11, 3, 113, 111, 73, 7, 1191, 2573, 7713, 465, 27615}}, {3009, 15, 10343, {1, 1, 7, 15, 5, 5, 39, 11, 489, 13, 1041, 1639, 7879, 11899, 6899}}, {3010, 15, 10344, {1, 1, 5, 9, 27, 31, 15, 237, 401, 795, 1675, 2361, 7333, 12507, 14627}}, {3011, 15, 10347, {1, 3, 1, 7, 21, 53, 31, 81, 189, 683, 1283, 419, 7585, 9207, 15053}}, {3012, 15, 10352, {1, 3, 5, 11, 21, 1, 49, 251, 403, 489, 1235, 429, 4855, 4081, 17575}}, {3013, 15, 10364, {1, 3, 1, 15, 29, 33, 77, 53, 105, 731, 749, 2677, 3967, 7967, 18723}}, {3014, 15, 10373, {1, 3, 3, 11, 9, 47, 11, 95, 137, 923, 599, 1585, 1969, 9625, 19171}}, {3015, 15, 10386, {1, 1, 1, 5, 7, 7, 85, 49, 339, 883, 261, 2125, 3831, 9797, 16395}}, {3016, 15, 10391, {1, 3, 3, 3, 5, 9, 33, 99, 75, 889, 101, 2099, 6635, 11511, 21573}}, {3017, 15, 10398, {1, 1, 5, 11, 1, 11, 79, 49, 7, 131, 471, 1235, 3287, 14777, 12053}}, {3018, 15, 10408, {1, 1, 5, 15, 9, 9, 83, 15, 21, 899, 1785, 2349, 3471, 6723, 1405}}, {3019, 15, 10413, {1, 3, 5, 11, 1, 7, 121, 223, 509, 859, 1037, 491, 5529, 481, 17029}}, {3020, 15, 10422, {1, 1, 7, 5, 17, 35, 91, 171, 113, 65, 423, 2371, 5105, 12827, 31087}}, {3021, 15, 10445, {1, 1, 3, 3, 21, 47, 55, 11, 159, 51, 263, 2113, 661, 9147, 28929}}, {3022, 15, 10460, {1, 1, 1, 9, 19, 7, 43, 223, 207, 787, 543, 2141, 4247, 7369, 29031}}, {3023, 15, 10463, {1, 1, 7, 11, 11, 51, 121, 9, 211, 905, 687, 889, 1827, 13395, 3507}}, {3024, 15, 10464, {1, 3, 1, 7, 15, 23, 5, 139, 469, 569, 33, 3477, 5391, 13665, 17011}}, {3025, 15, 10474, {1, 1, 1, 15, 29, 29, 29, 201, 63, 1019, 97, 1671, 9, 4617, 19833}}, {3026, 15, 10476, {1, 1, 5, 15, 25, 5, 67, 225, 189, 919, 1471, 1451, 5017, 16189, 31555}}, {3027, 15, 10487, {1, 3, 5, 5, 15, 51, 89, 221, 149, 863, 43, 2381, 1767, 8037, 5319}}, {3028, 15, 10494, {1, 3, 3, 1, 15, 17, 5, 77, 69, 27, 1883, 63, 5987, 1497, 3723}}, {3029, 15, 10499, {1, 3, 7, 11, 7, 5, 113, 229, 123, 709, 1531, 641, 6655, 14923, 22947}}, {3030, 15, 10506, {1, 3, 1, 13, 21, 15, 45, 175, 81, 499, 1113, 587, 7573, 11689, 15651}}, {3031, 15, 10513, {1, 3, 1, 1, 29, 43, 101, 37, 131, 757, 465, 743, 2737, 8063, 23967}}, {3032, 15, 10516, {1, 1, 7, 13, 9, 21, 39, 177, 51, 691, 2047, 1519, 6137, 5271, 8703}}, {3033, 15, 10523, {1, 1, 3, 3, 5, 55, 63, 21, 3, 317, 461, 527, 2673, 16211, 6721}}, {3034, 15, 10539, {1, 3, 5, 5, 5, 47, 7, 241, 387, 589, 323, 203, 7241, 14761, 13287}}, {3035, 15, 10549, {1, 3, 5, 3, 23, 63, 55, 61, 231, 1023, 1315, 1181, 243, 7389, 25639}}, {3036, 15, 10550, {1, 1, 7, 13, 31, 43, 41, 81, 127, 887, 1513, 4055, 1361, 2443, 6963}}, {3037, 15, 10567, {1, 1, 1, 5, 7, 43, 43, 33, 323, 911, 1373, 3053, 6503, 513, 6457}}, {3038, 15, 10576, {1, 1, 7, 11, 25, 61, 21, 149, 205, 349, 1433, 1587, 149, 7275, 5465}}, {3039, 15, 10625, {1, 3, 5, 5, 11, 9, 31, 217, 119, 511, 209, 3325, 2023, 2877, 463}}, {3040, 15, 10635, {1, 3, 5, 15, 21, 47, 89, 41, 347, 849, 1375, 3311, 807, 11443, 27643}}, {3041, 15, 10643, {1, 1, 5, 7, 29, 43, 123, 191, 321, 373, 447, 2145, 1221, 2071, 12689}}, {3042, 15, 10656, {1, 3, 5, 15, 1, 21, 43, 141, 461, 779, 1109, 2915, 909, 8585, 19859}}, {3043, 15, 10671, {1, 3, 3, 11, 5, 17, 57, 13, 393, 661, 1761, 2455, 43, 8593, 20505}}, {3044, 15, 10676, {1, 3, 5, 1, 31, 47, 65, 249, 77, 513, 851, 2381, 3447, 693, 7729}}, {3045, 15, 10683, {1, 3, 5, 15, 31, 19, 83, 47, 369, 697, 1815, 819, 7573, 9245, 8013}}, {3046, 15, 10685, {1, 3, 5, 5, 11, 25, 27, 151, 107, 339, 299, 3869, 3393, 5661, 2947}}, {3047, 15, 10688, {1, 1, 3, 1, 1, 59, 85, 57, 175, 465, 239, 3115, 7157, 7035, 11463}}, {3048, 15, 10697, {1, 1, 7, 5, 31, 41, 53, 149, 121, 743, 189, 159, 5289, 2945, 1179}}, {3049, 15, 10700, {1, 3, 3, 15, 23, 51, 83, 25, 159, 163, 61, 713, 4529, 5253, 1603}}, {3050, 15, 10712, {1, 3, 5, 11, 7, 29, 15, 177, 507, 695, 1305, 1863, 7525, 3063, 27433}}, {3051, 15, 10724, {1, 1, 3, 11, 5, 41, 115, 227, 409, 951, 591, 4003, 7717, 4369, 15637}}, {3052, 15, 10728, {1, 1, 7, 11, 23, 55, 71, 135, 51, 411, 2003, 2375, 6823, 1711, 4443}}, {3053, 15, 10734, {1, 3, 1, 3, 31, 47, 31, 233, 243, 3, 313, 1649, 6955, 13679, 32327}}, {3054, 15, 10739, {1, 1, 3, 11, 29, 9, 1, 79, 247, 677, 685, 3107, 5987, 9675, 29523}}, {3055, 15, 10762, {1, 1, 1, 7, 25, 31, 39, 241, 483, 839, 1143, 437, 2317, 2437, 173}}, {3056, 15, 10772, {1, 1, 5, 1, 17, 19, 83, 57, 39, 479, 715, 1911, 1091, 10937, 22145}}, {3057, 15, 10781, {1, 1, 7, 1, 27, 45, 35, 55, 477, 719, 217, 3349, 7717, 6853, 9699}}, {3058, 15, 10800, {1, 3, 1, 11, 9, 39, 25, 223, 303, 713, 151, 2611, 4629, 5855, 31729}}, {3059, 15, 10805, {1, 1, 1, 11, 13, 35, 53, 39, 167, 779, 1673, 1221, 6281, 15113, 32027}}, {3060, 15, 10827, {1, 1, 5, 9, 19, 63, 89, 113, 199, 107, 1015, 835, 2879, 9499, 25597}}, {3061, 15, 10830, {1, 1, 7, 3, 19, 37, 15, 23, 449, 641, 1811, 3407, 6775, 6283, 31157}}, {3062, 15, 10837, {1, 1, 3, 1, 19, 15, 31, 99, 511, 897, 1693, 2093, 955, 15897, 26693}}, {3063, 15, 10841, {1, 1, 5, 1, 5, 15, 47, 19, 441, 541, 1621, 3877, 6407, 15991, 1931}}, {3064, 15, 10847, {1, 3, 5, 9, 21, 61, 15, 77, 265, 351, 879, 3835, 6555, 2349, 23235}}, {3065, 15, 10848, {1, 1, 5, 11, 25, 37, 29, 181, 341, 641, 1213, 1319, 6359, 6231, 32573}}, {3066, 15, 10857, {1, 1, 1, 7, 1, 37, 87, 123, 33, 913, 111, 2613, 4895, 12595, 26633}}, {3067, 15, 10866, {1, 3, 5, 3, 27, 11, 45, 89, 183, 241, 1355, 783, 3343, 239, 8643}}, {3068, 15, 10868, {1, 3, 7, 7, 9, 35, 67, 187, 233, 577, 1445, 3063, 6039, 16233, 1453}}, {3069, 15, 10872, {1, 1, 3, 13, 27, 11, 23, 15, 95, 63, 1931, 911, 8149, 6833, 3051}}, {3070, 15, 10887, {1, 3, 3, 5, 29, 49, 125, 117, 47, 143, 423, 3215, 3605, 3677, 17155}}, {3071, 15, 10899, {1, 3, 1, 1, 31, 1, 123, 195, 83, 893, 1947, 339, 2927, 7183, 15443}}, {3072, 15, 10901, {1, 1, 7, 13, 31, 15, 91, 207, 39, 275, 439, 2617, 3093, 11041, 24997}}, {3073, 15, 10915, {1, 1, 5, 3, 3, 41, 13, 67, 361, 497, 25, 3807, 3551, 9681, 21043}}, {3074, 15, 10924, {1, 3, 3, 3, 11, 27, 103, 59, 427, 327, 1705, 29, 8127, 1641, 20847}}, {3075, 15, 10929, {1, 3, 7, 5, 3, 37, 81, 137, 225, 101, 187, 3067, 2491, 12687, 16227}}, {3076, 15, 10942, {1, 3, 5, 15, 15, 33, 69, 223, 225, 771, 1917, 2293, 2889, 12083, 23971}}, {3077, 15, 10971, {1, 1, 3, 5, 11, 9, 121, 81, 203, 425, 1189, 2011, 3041, 3247, 739}}, {3078, 15, 10992, {1, 3, 1, 1, 13, 9, 39, 169, 437, 571, 1481, 3355, 3895, 8975, 31031}}, {3079, 15, 10995, {1, 3, 1, 11, 1, 43, 35, 35, 293, 11, 657, 1415, 5021, 14463, 17945}}, {3080, 15, 11002, {1, 1, 5, 5, 13, 47, 91, 15, 159, 23, 971, 3575, 757, 13477, 31757}}, {3081, 15, 11010, {1, 1, 7, 1, 5, 63, 69, 27, 71, 129, 123, 3767, 89, 7865, 1189}}, {3082, 15, 11027, {1, 3, 3, 5, 23, 1, 83, 3, 487, 491, 217, 2583, 3889, 15009, 9227}}, {3083, 15, 11029, {1, 3, 5, 15, 25, 1, 73, 107, 245, 191, 1449, 571, 1403, 6953, 17457}}, {3084, 15, 11045, {1, 3, 3, 3, 27, 19, 25, 105, 207, 857, 1161, 3657, 2107, 7955, 517}}, {3085, 15, 11057, {1, 3, 3, 9, 21, 29, 5, 103, 219, 35, 3, 1635, 4815, 15797, 29839}}, {3086, 15, 11070, {1, 1, 7, 7, 3, 63, 75, 77, 13, 57, 603, 2333, 7761, 14397, 10875}}, {3087, 15, 11092, {1, 3, 7, 13, 3, 11, 5, 255, 1, 947, 1695, 1927, 7447, 7407, 20797}}, {3088, 15, 11099, {1, 1, 5, 1, 1, 21, 105, 73, 429, 973, 1801, 3943, 6161, 1309, 3359}}, {3089, 15, 11106, {1, 1, 3, 15, 27, 9, 9, 129, 117, 545, 9, 1983, 6351, 10925, 27337}}, {3090, 15, 11115, {1, 3, 3, 5, 5, 5, 13, 155, 503, 875, 1243, 2259, 3445, 11953, 6517}}, {3091, 15, 11120, {1, 1, 7, 3, 29, 21, 121, 147, 413, 423, 1887, 2429, 2765, 16335, 3071}}, {3092, 15, 11126, {1, 1, 7, 9, 5, 53, 41, 137, 463, 583, 1627, 1731, 6675, 3703, 8177}}, {3093, 15, 11153, {1, 3, 5, 11, 31, 29, 67, 159, 425, 25, 1457, 139, 5019, 701, 7357}}, {3094, 15, 11190, {1, 3, 1, 5, 25, 15, 123, 123, 245, 859, 249, 2175, 2137, 5765, 4873}}, {3095, 15, 11199, {1, 1, 3, 5, 23, 1, 111, 111, 111, 469, 1473, 1777, 3579, 13503, 2569}}, {3096, 15, 11222, {1, 1, 7, 3, 17, 23, 51, 23, 499, 135, 713, 3317, 807, 9589, 11349}}, {3097, 15, 11225, {1, 1, 1, 15, 9, 51, 75, 159, 359, 773, 1521, 2913, 5901, 3047, 14649}}, {3098, 15, 11226, {1, 1, 3, 1, 13, 61, 117, 195, 49, 267, 57, 1769, 3621, 9415, 29443}}, {3099, 15, 11231, {1, 3, 7, 11, 3, 25, 33, 31, 315, 191, 359, 3399, 2481, 13831, 20205}}, {3100, 15, 11244, {1, 3, 3, 5, 31, 43, 35, 125, 291, 51, 1469, 3857, 1707, 2641, 32137}}, {3101, 15, 11259, {1, 3, 5, 1, 25, 11, 113, 137, 211, 159, 1667, 939, 6439, 5337, 32059}}, {3102, 15, 11261, {1, 3, 3, 11, 31, 61, 99, 49, 383, 343, 395, 51, 6931, 16039, 5901}}, {3103, 15, 11270, {1, 1, 3, 5, 9, 63, 63, 49, 405, 915, 1505, 2141, 6749, 7799, 17313}}, {3104, 15, 11273, {1, 3, 7, 11, 15, 11, 49, 161, 155, 869, 121, 301, 6561, 4279, 15233}}, {3105, 15, 11300, {1, 1, 5, 13, 19, 13, 103, 59, 503, 293, 701, 2527, 5327, 13927, 5025}}, {3106, 15, 11307, {1, 1, 7, 1, 1, 37, 55, 155, 485, 399, 855, 2677, 5927, 9657, 2795}}, {3107, 15, 11318, {1, 1, 1, 5, 19, 15, 121, 69, 385, 75, 1567, 2649, 5601, 12981, 15903}}, {3108, 15, 11332, {1, 1, 1, 11, 19, 21, 45, 59, 505, 737, 15, 1383, 1177, 8375, 15557}}, {3109, 15, 11335, {1, 1, 7, 13, 29, 19, 123, 127, 469, 773, 733, 3289, 8087, 5803, 27897}}, {3110, 15, 11341, {1, 3, 3, 11, 19, 55, 101, 67, 485, 939, 607, 1521, 6161, 12235, 16499}}, {3111, 15, 11347, {1, 3, 5, 13, 29, 31, 31, 9, 453, 151, 1055, 3873, 405, 12877, 29829}}, {3112, 15, 11354, {1, 3, 5, 1, 17, 1, 17, 131, 107, 1003, 1749, 1849, 6207, 2153, 21275}}, {3113, 15, 11360, {1, 3, 7, 15, 7, 25, 51, 143, 51, 517, 1841, 1771, 5389, 4633, 11123}}, {3114, 15, 11369, {1, 3, 7, 11, 23, 7, 89, 95, 403, 361, 835, 585, 2783, 8091, 5141}}, {3115, 15, 11372, {1, 3, 1, 9, 1, 53, 115, 11, 493, 587, 305, 3605, 1711, 4169, 20013}}, {3116, 15, 11378, {1, 3, 7, 3, 17, 59, 55, 251, 49, 759, 1227, 3685, 7765, 1445, 20385}}, {3117, 15, 11396, {1, 1, 5, 7, 29, 55, 19, 157, 129, 927, 893, 1235, 1955, 8153, 2865}}, {3118, 15, 11405, {1, 3, 1, 15, 21, 35, 81, 53, 175, 939, 1635, 3597, 747, 14011, 12867}}, {3119, 15, 11417, {1, 3, 7, 1, 27, 61, 91, 73, 405, 677, 603, 2715, 7099, 941, 24523}}, {3120, 15, 11424, {1, 3, 5, 9, 13, 45, 35, 167, 57, 483, 735, 2777, 7847, 6257, 13109}}, {3121, 15, 11427, {1, 3, 5, 7, 1, 3, 97, 13, 159, 533, 1791, 1061, 981, 10795, 26165}}, {3122, 15, 11430, {1, 1, 5, 13, 27, 5, 125, 25, 251, 221, 1909, 197, 6987, 11537, 15287}}, {3123, 15, 11439, {1, 3, 5, 5, 27, 15, 1, 131, 375, 923, 81, 3153, 6071, 2515, 23729}}, {3124, 15, 11442, {1, 3, 3, 9, 9, 23, 71, 13, 465, 261, 937, 1549, 5993, 11325, 15065}}, {3125, 15, 11448, {1, 3, 1, 3, 7, 63, 17, 129, 435, 23, 215, 2251, 1561, 9703, 26483}}, {3126, 15, 11461, {1, 1, 3, 1, 5, 53, 77, 109, 9, 605, 371, 2081, 6023, 7145, 15837}}, {3127, 15, 11468, {1, 3, 7, 11, 27, 39, 115, 47, 259, 337, 1857, 3465, 1549, 7747, 8525}}, {3128, 15, 11471, {1, 3, 7, 7, 29, 29, 75, 77, 29, 661, 899, 3137, 2661, 15271, 28093}}, {3129, 15, 11473, {1, 1, 1, 3, 3, 3, 11, 219, 39, 757, 1465, 249, 7445, 7013, 15187}}, {3130, 15, 11476, {1, 3, 7, 15, 15, 1, 39, 245, 427, 1003, 1493, 1913, 6435, 14787, 13481}}, {3131, 15, 11480, {1, 1, 7, 3, 3, 37, 5, 97, 343, 833, 1379, 1551, 5403, 1843, 5877}}, {3132, 15, 11489, {1, 3, 1, 1, 3, 17, 17, 163, 339, 691, 1707, 1845, 5941, 4259, 24531}}, {3133, 15, 11499, {1, 1, 1, 1, 27, 21, 85, 221, 71, 949, 1753, 391, 6349, 15901, 20811}}, {3134, 15, 11516, {1, 1, 1, 5, 31, 19, 45, 99, 469, 783, 1747, 3807, 5889, 9485, 13715}}, {3135, 15, 11522, {1, 3, 1, 9, 23, 21, 39, 25, 421, 713, 461, 2857, 5023, 5341, 6409}}, {3136, 15, 11531, {1, 3, 7, 5, 25, 19, 59, 147, 387, 857, 375, 3103, 1261, 13697, 25675}}, {3137, 15, 11539, {1, 3, 5, 5, 31, 21, 49, 251, 463, 441, 473, 3487, 3915, 11151, 17721}}, {3138, 15, 11546, {1, 1, 3, 9, 15, 47, 81, 219, 143, 141, 81, 1705, 5847, 3437, 30521}}, {3139, 15, 11551, {1, 1, 7, 3, 25, 19, 97, 41, 77, 105, 1337, 695, 7589, 8587, 7509}}, {3140, 15, 11564, {1, 1, 5, 13, 3, 11, 61, 19, 139, 667, 963, 1567, 5715, 7079, 15967}}, {3141, 15, 11582, {1, 1, 5, 5, 5, 29, 67, 57, 477, 173, 1163, 727, 823, 15635, 17705}}, {3142, 15, 11589, {1, 3, 7, 11, 13, 39, 57, 193, 73, 617, 535, 1623, 4581, 4451, 2589}}, {3143, 15, 11593, {1, 1, 5, 5, 9, 27, 75, 127, 325, 413, 1669, 1749, 8045, 16199, 12237}}, {3144, 15, 11601, {1, 1, 3, 1, 17, 23, 27, 189, 319, 953, 347, 909, 4401, 12791, 25077}}, {3145, 15, 11608, {1, 1, 3, 3, 17, 51, 37, 79, 301, 607, 885, 1169, 3275, 3327, 20013}}, {3146, 15, 11617, {1, 3, 5, 3, 21, 9, 99, 213, 387, 889, 575, 3591, 5377, 2981, 23989}}, {3147, 15, 11630, {1, 3, 3, 13, 11, 7, 23, 255, 279, 853, 453, 2377, 8123, 15393, 9669}}, {3148, 15, 11663, {1, 3, 1, 7, 11, 9, 109, 35, 405, 449, 1967, 2943, 3485, 5031, 14273}}, {3149, 15, 11666, {1, 3, 3, 1, 25, 27, 43, 115, 435, 675, 1937, 1477, 4831, 9417, 7017}}, {3150, 15, 11668, {1, 1, 7, 13, 19, 45, 83, 241, 487, 215, 1453, 209, 4061, 1765, 15623}}, {3151, 15, 11677, {1, 1, 7, 7, 21, 31, 95, 9, 287, 1005, 1933, 3405, 6913, 7733, 18975}}, {3152, 15, 11682, {1, 1, 1, 11, 13, 11, 25, 39, 283, 57, 255, 2809, 5767, 6127, 6705}}, {3153, 15, 11687, {1, 3, 1, 11, 1, 51, 73, 181, 261, 215, 385, 2777, 5169, 12431, 23563}}, {3154, 15, 11696, {1, 3, 3, 9, 9, 39, 123, 197, 501, 679, 109, 3369, 4817, 8855, 7997}}, {3155, 15, 11713, {1, 1, 5, 1, 29, 61, 15, 183, 453, 999, 1211, 3217, 8035, 5153, 19975}}, {3156, 15, 11728, {1, 3, 7, 11, 11, 21, 51, 45, 379, 793, 289, 309, 1229, 7159, 581}}, {3157, 15, 11747, {1, 1, 3, 9, 17, 11, 75, 67, 289, 191, 1083, 2949, 6063, 6611, 21595}}, {3158, 15, 11750, {1, 3, 7, 3, 27, 45, 59, 193, 485, 277, 27, 1219, 2389, 15875, 6273}}, {3159, 15, 11754, {1, 1, 5, 3, 31, 29, 65, 197, 115, 163, 9, 783, 5573, 2833, 12603}}, {3160, 15, 11759, {1, 1, 3, 7, 5, 53, 115, 181, 175, 749, 1335, 1151, 2131, 12467, 15811}}, {3161, 15, 11761, {1, 1, 1, 9, 27, 39, 11, 1, 443, 677, 777, 1857, 7459, 3177, 3875}}, {3162, 15, 11764, {1, 1, 7, 7, 17, 3, 23, 161, 105, 603, 1991, 3845, 465, 11467, 2077}}, {3163, 15, 11767, {1, 1, 3, 13, 5, 23, 39, 35, 399, 795, 265, 207, 1823, 15069, 31839}}, {3164, 15, 11797, {1, 1, 1, 1, 29, 61, 89, 193, 41, 99, 315, 1021, 6109, 12507, 19973}}, {3165, 15, 11804, {1, 1, 5, 3, 13, 57, 119, 251, 215, 695, 1521, 4081, 2481, 657, 855}}, {3166, 15, 11808, {1, 1, 7, 3, 25, 5, 3, 133, 111, 385, 773, 1027, 4327, 3031, 3537}}, {3167, 15, 11831, {1, 3, 7, 5, 5, 27, 43, 117, 479, 83, 1421, 2791, 6551, 6231, 10353}}, {3168, 15, 11832, {1, 1, 1, 13, 3, 29, 35, 71, 85, 821, 1671, 3057, 797, 13683, 7025}}, {3169, 15, 11849, {1, 3, 7, 1, 1, 47, 117, 233, 141, 993, 1381, 2551, 1031, 11765, 18429}}, {3170, 15, 11855, {1, 3, 1, 3, 13, 3, 77, 29, 35, 807, 1109, 695, 5605, 5477, 449}}, {3171, 15, 11863, {1, 1, 1, 15, 21, 37, 117, 105, 273, 311, 1287, 1415, 1221, 1847, 19487}}, {3172, 15, 11880, {1, 3, 1, 11, 21, 61, 107, 225, 335, 501, 1995, 2399, 5475, 12613, 18877}}, {3173, 15, 11883, {1, 3, 3, 1, 31, 41, 27, 205, 103, 837, 639, 2007, 2759, 12471, 1457}}, {3174, 15, 11885, {1, 1, 7, 13, 29, 39, 71, 245, 105, 235, 1277, 1515, 6129, 15947, 26653}}, {3175, 15, 11898, {1, 1, 7, 5, 7, 13, 87, 251, 315, 1017, 587, 2917, 5911, 2919, 29715}}, {3176, 15, 11916, {1, 1, 1, 3, 7, 19, 81, 243, 177, 917, 2023, 2365, 7465, 4901, 29841}}, {3177, 15, 11924, {1, 3, 5, 15, 1, 31, 15, 147, 285, 1003, 1757, 47, 6925, 1197, 19633}}, {3178, 15, 11928, {1, 1, 5, 7, 27, 25, 47, 209, 85, 403, 1399, 2331, 3663, 595, 13407}}, {3179, 15, 11947, {1, 3, 5, 9, 7, 25, 7, 139, 389, 817, 1153, 1421, 5735, 9577, 10269}}, {3180, 15, 11955, {1, 1, 1, 9, 5, 61, 49, 117, 389, 541, 433, 1405, 2575, 223, 7265}}, {3181, 15, 11961, {1, 1, 5, 7, 15, 1, 81, 207, 435, 843, 835, 3797, 7637, 5333, 31115}}, {3182, 15, 11962, {1, 3, 7, 11, 13, 3, 47, 249, 301, 715, 2015, 3049, 8155, 10989, 26051}}, {3183, 15, 11982, {1, 1, 7, 7, 3, 33, 119, 113, 381, 575, 367, 41, 3317, 11727, 4351}}, {3184, 15, 11990, {1, 3, 3, 13, 9, 3, 51, 37, 173, 137, 533, 1827, 631, 10047, 6267}}, {3185, 15, 12010, {1, 3, 3, 11, 17, 39, 61, 245, 13, 139, 1281, 1319, 1233, 13629, 32269}}, {3186, 15, 12018, {1, 1, 1, 7, 15, 17, 91, 109, 163, 609, 11, 3251, 7653, 14035, 31755}}, {3187, 15, 12027, {1, 3, 3, 15, 13, 21, 55, 231, 385, 133, 1833, 2637, 6935, 14303, 26745}}, {3188, 15, 12029, {1, 1, 1, 7, 17, 41, 125, 141, 89, 823, 1411, 3637, 6211, 13323, 6111}}, {3189, 15, 12035, {1, 1, 1, 11, 1, 21, 9, 43, 97, 685, 1223, 1491, 121, 1793, 2397}}, {3190, 15, 12055, {1, 3, 5, 5, 17, 17, 5, 223, 129, 865, 1839, 1137, 6391, 4377, 9233}}, {3191, 15, 12062, {1, 3, 7, 15, 21, 55, 5, 77, 341, 637, 1853, 1435, 1195, 9283, 21257}}, {3192, 15, 12068, {1, 3, 5, 1, 9, 49, 43, 211, 127, 655, 1397, 1235, 5279, 2351, 24229}}, {3193, 15, 12071, {1, 3, 5, 3, 25, 29, 13, 229, 25, 675, 837, 2753, 2125, 9863, 11293}}, {3194, 15, 12072, {1, 3, 5, 7, 23, 43, 127, 1, 163, 237, 337, 3019, 7747, 16227, 2881}}, {3195, 15, 12086, {1, 3, 5, 5, 25, 9, 43, 171, 421, 521, 1885, 337, 7873, 6347, 13181}}, {3196, 15, 12097, {1, 3, 5, 5, 7, 47, 107, 173, 163, 191, 625, 3389, 2833, 7945, 24787}}, {3197, 15, 12098, {1, 1, 7, 3, 27, 57, 27, 209, 253, 815, 301, 1633, 3945, 5051, 28851}}, {3198, 15, 12100, {1, 3, 7, 9, 9, 51, 103, 213, 437, 189, 1857, 1331, 5551, 10641, 27405}}, {3199, 15, 12112, {1, 1, 5, 5, 15, 1, 25, 105, 117, 347, 161, 3369, 3589, 12903, 23559}}, {3200, 15, 12118, {1, 1, 1, 5, 3, 61, 93, 51, 81, 281, 1383, 745, 4137, 2005, 3635}}, {3201, 15, 12133, {1, 3, 7, 5, 13, 57, 111, 211, 303, 477, 359, 4019, 6779, 5129, 22035}}, {3202, 15, 12134, {1, 1, 1, 7, 17, 29, 113, 113, 201, 531, 749, 739, 2879, 3315, 18733}}, {3203, 15, 12137, {1, 3, 7, 13, 21, 55, 21, 183, 359, 75, 377, 2211, 4281, 14317, 28307}}, {3204, 15, 12161, {1, 3, 7, 1, 21, 1, 49, 213, 317, 75, 113, 1741, 7963, 12785, 11571}}, {3205, 15, 12162, {1, 3, 7, 9, 11, 31, 29, 101, 261, 141, 715, 2727, 8187, 2075, 32433}}, {3206, 15, 12171, {1, 3, 7, 3, 23, 9, 17, 143, 385, 211, 593, 241, 6567, 10777, 6677}}, {3207, 15, 12174, {1, 1, 3, 15, 3, 17, 117, 99, 91, 793, 989, 2421, 5643, 16103, 9759}}, {3208, 15, 12185, {1, 3, 7, 11, 23, 43, 107, 35, 421, 431, 743, 853, 7939, 12169, 4199}}, {3209, 15, 12204, {1, 1, 1, 11, 21, 53, 17, 203, 123, 395, 59, 929, 255, 7585, 10945}}, {3210, 15, 12212, {1, 3, 3, 15, 17, 57, 57, 133, 67, 71, 1685, 903, 4079, 15423, 26495}}, {3211, 15, 12215, {1, 1, 1, 15, 3, 47, 95, 39, 405, 407, 1557, 3001, 6225, 15187, 5663}}, {3212, 15, 12216, {1, 3, 5, 5, 13, 47, 33, 61, 375, 1023, 1981, 2773, 2375, 11321, 17731}}, {3213, 15, 12253, {1, 3, 5, 9, 17, 59, 117, 95, 493, 149, 1269, 2865, 369, 2109, 24601}}, {3214, 15, 12260, {1, 3, 5, 13, 17, 63, 67, 247, 95, 721, 67, 305, 6179, 15399, 32559}}, {3215, 15, 12277, {1, 1, 5, 1, 3, 21, 41, 15, 453, 475, 2017, 3193, 5903, 897, 4237}}, {3216, 15, 12289, {1, 1, 5, 3, 15, 41, 1, 141, 441, 575, 155, 3791, 7711, 11231, 24611}}, {3217, 15, 12295, {1, 3, 7, 1, 17, 53, 27, 169, 31, 437, 963, 1793, 7777, 1917, 29311}}, {3218, 15, 12314, {1, 3, 3, 13, 9, 27, 77, 87, 329, 885, 749, 1713, 6013, 6921, 629}}, {3219, 15, 12323, {1, 3, 5, 13, 3, 7, 53, 27, 353, 267, 925, 2141, 439, 15175, 30851}}, {3220, 15, 12325, {1, 3, 3, 13, 17, 57, 35, 101, 265, 901, 1825, 2159, 6149, 5967, 24023}}, {3221, 15, 12335, {1, 1, 5, 11, 13, 51, 99, 111, 193, 415, 1541, 2929, 5045, 3147, 12587}}, {3222, 15, 12349, {1, 3, 7, 11, 15, 9, 33, 17, 511, 815, 299, 1077, 6171, 10451, 15039}}, {3223, 15, 12358, {1, 1, 1, 15, 25, 63, 51, 137, 449, 951, 1051, 1101, 4725, 2463, 7355}}, {3224, 15, 12372, {1, 1, 1, 7, 27, 63, 29, 179, 317, 521, 1459, 827, 6599, 13459, 15439}}, {3225, 15, 12376, {1, 3, 3, 15, 17, 31, 37, 191, 229, 245, 181, 941, 5761, 1849, 31599}}, {3226, 15, 12379, {1, 1, 1, 9, 27, 45, 67, 239, 481, 615, 1667, 3751, 8141, 10013, 2125}}, {3227, 15, 12386, {1, 1, 1, 1, 13, 51, 117, 135, 73, 151, 1291, 2541, 1411, 3767, 26949}}, {3228, 15, 12395, {1, 3, 1, 9, 7, 11, 21, 187, 243, 857, 1951, 865, 7273, 2041, 8155}}, {3229, 15, 12416, {1, 1, 3, 3, 19, 33, 89, 115, 455, 137, 707, 1867, 4221, 2433, 9119}}, {3230, 15, 12421, {1, 1, 3, 11, 5, 3, 121, 1, 71, 951, 603, 3873, 723, 3285, 19289}}, {3231, 15, 12440, {1, 3, 7, 15, 21, 1, 117, 17, 455, 519, 731, 3003, 5741, 9557, 29163}}, {3232, 15, 12452, {1, 1, 3, 13, 25, 5, 43, 147, 209, 895, 255, 1231, 241, 487, 15593}}, {3233, 15, 12455, {1, 1, 3, 13, 7, 1, 89, 187, 217, 927, 2029, 3521, 2777, 8103, 22819}}, {3234, 15, 12456, {1, 1, 7, 11, 7, 33, 3, 73, 5, 489, 227, 2259, 7031, 6425, 26135}}, {3235, 15, 12462, {1, 3, 3, 7, 31, 19, 97, 201, 455, 819, 945, 2771, 8083, 8711, 2835}}, {3236, 15, 12467, {1, 1, 1, 5, 15, 45, 43, 157, 245, 967, 877, 2289, 4499, 9891, 18827}}, {3237, 15, 12479, {1, 3, 1, 7, 21, 59, 123, 63, 231, 485, 1781, 1211, 4597, 5269, 1607}}, {3238, 15, 12505, {1, 1, 1, 13, 23, 39, 105, 55, 249, 991, 1625, 3089, 3825, 4275, 29139}}, {3239, 15, 12521, {1, 3, 3, 1, 29, 29, 55, 169, 13, 895, 1355, 1101, 6063, 12935, 23215}}, {3240, 15, 12535, {1, 1, 5, 5, 31, 49, 99, 137, 209, 1017, 1179, 3931, 637, 14131, 19285}}, {3241, 15, 12547, {1, 1, 1, 1, 3, 11, 119, 11, 215, 337, 243, 3883, 3807, 7335, 11901}}, {3242, 15, 12556, {1, 3, 7, 3, 7, 27, 71, 225, 219, 367, 1213, 2739, 1185, 10175, 21313}}, {3243, 15, 12561, {1, 3, 7, 13, 7, 49, 23, 223, 61, 1011, 797, 1335, 6711, 5961, 5605}}, {3244, 15, 12568, {1, 3, 3, 11, 19, 37, 1, 149, 39, 661, 929, 2125, 2299, 5181, 28083}}, {3245, 15, 12578, {1, 3, 3, 13, 13, 9, 67, 21, 463, 279, 529, 523, 6705, 11011, 31695}}, {3246, 15, 12583, {1, 3, 1, 5, 13, 1, 123, 3, 291, 625, 1949, 2713, 5917, 10343, 13627}}, {3247, 15, 12595, {1, 1, 3, 9, 27, 41, 3, 207, 103, 265, 811, 549, 6109, 313, 8889}}, {3248, 15, 12604, {1, 3, 3, 13, 23, 43, 99, 33, 279, 463, 955, 793, 4113, 10615, 16957}}, {3249, 15, 12610, {1, 1, 5, 7, 11, 49, 79, 45, 17, 937, 359, 1037, 1099, 3003, 31561}}, {3250, 15, 12621, {1, 1, 1, 7, 3, 45, 111, 35, 109, 983, 53, 4057, 7349, 3599, 2209}}, {3251, 15, 12622, {1, 3, 7, 11, 9, 43, 27, 9, 85, 529, 1497, 347, 759, 12449, 11373}}, {3252, 15, 12624, {1, 1, 3, 9, 17, 1, 49, 31, 367, 813, 1385, 2025, 773, 4679, 4543}}, {3253, 15, 12629, {1, 1, 5, 15, 15, 9, 43, 97, 239, 995, 1037, 841, 4167, 12113, 23765}}, {3254, 15, 12630, {1, 3, 5, 9, 29, 53, 123, 49, 221, 113, 1157, 73, 6087, 1363, 11029}}, {3255, 15, 12639, {1, 3, 1, 13, 3, 15, 69, 199, 279, 919, 5, 161, 4817, 15031, 121}}, {3256, 15, 12640, {1, 3, 1, 9, 3, 31, 117, 77, 393, 241, 645, 3181, 1067, 15879, 2037}}, {3257, 15, 12650, {1, 3, 3, 15, 3, 63, 57, 33, 117, 789, 941, 1301, 5865, 12693, 3523}}, {3258, 15, 12679, {1, 1, 5, 13, 3, 61, 51, 151, 175, 305, 95, 1557, 6567, 7841, 13903}}, {3259, 15, 12680, {1, 3, 3, 5, 15, 25, 127, 79, 245, 767, 645, 3933, 1357, 12579, 4067}}, {3260, 15, 12698, {1, 3, 5, 11, 21, 31, 13, 251, 127, 231, 1795, 2627, 1191, 3363, 23543}}, {3261, 15, 12716, {1, 1, 3, 5, 7, 49, 121, 57, 131, 481, 1879, 525, 5225, 337, 1957}}, {3262, 15, 12721, {1, 1, 5, 13, 9, 55, 27, 37, 211, 125, 119, 3373, 251, 12357, 13975}}, {3263, 15, 12722, {1, 3, 3, 15, 1, 51, 91, 119, 233, 993, 203, 1635, 1167, 6327, 29119}}, {3264, 15, 12731, {1, 1, 7, 1, 13, 5, 23, 253, 121, 989, 1105, 3321, 3221, 6073, 21185}}, {3265, 15, 12742, {1, 1, 3, 15, 13, 49, 121, 247, 247, 133, 485, 1067, 7875, 411, 7647}}, {3266, 15, 12745, {1, 3, 7, 13, 31, 37, 127, 241, 145, 133, 53, 267, 2029, 3703, 16123}}, {3267, 15, 12751, {1, 3, 1, 15, 15, 9, 15, 89, 35, 367, 401, 61, 1953, 7873, 17861}}, {3268, 15, 12759, {1, 1, 1, 1, 1, 41, 71, 249, 213, 779, 1385, 1767, 999, 15151, 16647}}, {3269, 15, 12763, {1, 3, 7, 13, 31, 23, 123, 235, 343, 949, 309, 3777, 3587, 853, 19779}}, {3270, 15, 12769, {1, 1, 3, 13, 29, 35, 5, 37, 63, 757, 303, 1579, 3443, 243, 11873}}, {3271, 15, 12781, {1, 3, 1, 9, 19, 49, 81, 53, 11, 901, 1857, 147, 3103, 14019, 21}}, {3272, 15, 12793, {1, 3, 7, 13, 3, 39, 99, 99, 45, 91, 1567, 551, 3129, 4809, 29057}}, {3273, 15, 12799, {1, 3, 7, 3, 3, 27, 17, 231, 377, 381, 1479, 2525, 2595, 2799, 25737}}, {3274, 15, 12815, {1, 3, 5, 15, 15, 25, 103, 215, 301, 59, 1417, 981, 7579, 12731, 22329}}, {3275, 15, 12824, {1, 1, 1, 13, 5, 31, 61, 31, 349, 925, 1301, 685, 435, 11567, 10715}}, {3276, 15, 12836, {1, 1, 7, 9, 19, 57, 109, 1, 37, 377, 1015, 2273, 6741, 3191, 15949}}, {3277, 15, 12845, {1, 3, 3, 13, 3, 23, 103, 127, 11, 59, 1847, 1175, 425, 3423, 20643}}, {3278, 15, 12853, {1, 3, 3, 7, 3, 11, 105, 141, 55, 217, 1427, 477, 667, 9403, 11905}}, {3279, 15, 12854, {1, 3, 3, 5, 3, 27, 11, 187, 495, 907, 1925, 445, 6639, 8159, 15225}}, {3280, 15, 12857, {1, 3, 1, 5, 27, 31, 77, 213, 73, 343, 1123, 3609, 2431, 15329, 32165}}, {3281, 15, 12866, {1, 1, 7, 5, 1, 11, 105, 139, 485, 1007, 709, 3509, 5231, 11717, 31433}}, {3282, 15, 12872, {1, 1, 3, 15, 23, 49, 95, 169, 399, 1019, 19, 2013, 5311, 7951, 22609}}, {3283, 15, 12875, {1, 3, 1, 7, 13, 3, 29, 203, 209, 701, 1791, 2615, 5351, 4237, 12565}}, {3284, 15, 12878, {1, 3, 1, 15, 27, 11, 91, 31, 205, 205, 1683, 901, 5129, 6049, 11865}}, {3285, 15, 12880, {1, 1, 7, 7, 27, 59, 21, 3, 209, 79, 769, 4013, 2041, 2645, 11561}}, {3286, 15, 12885, {1, 3, 7, 11, 5, 45, 39, 243, 185, 871, 795, 1845, 8043, 6285, 20991}}, {3287, 15, 12901, {1, 1, 5, 7, 13, 7, 15, 165, 349, 179, 789, 1269, 3787, 5429, 26567}}, {3288, 15, 12902, {1, 3, 3, 13, 31, 23, 75, 41, 177, 735, 1889, 4039, 3519, 15003, 965}}, {3289, 15, 12920, {1, 3, 1, 7, 15, 57, 15, 139, 27, 469, 1003, 691, 7893, 9643, 30983}}, {3290, 15, 12926, {1, 3, 1, 13, 23, 27, 3, 237, 233, 875, 99, 883, 6167, 5463, 6245}}, {3291, 15, 12929, {1, 1, 5, 13, 25, 57, 79, 51, 147, 619, 1147, 279, 6583, 1939, 477}}, {3292, 15, 12939, {1, 3, 5, 5, 31, 61, 125, 163, 213, 699, 583, 3865, 615, 9707, 11651}}, {3293, 15, 12941, {1, 1, 5, 1, 5, 21, 93, 239, 31, 641, 777, 27, 5247, 8993, 21053}}, {3294, 15, 12950, {1, 3, 7, 9, 1, 13, 61, 57, 503, 453, 83, 3271, 2845, 1121, 18639}}, {3295, 15, 12953, {1, 1, 7, 5, 29, 53, 13, 219, 379, 441, 821, 3179, 4877, 2535, 7557}}, {3296, 15, 12992, {1, 1, 7, 13, 9, 53, 17, 183, 265, 393, 587, 2753, 6453, 7135, 24737}}, {3297, 15, 13002, {1, 1, 1, 13, 11, 23, 73, 109, 393, 1013, 559, 755, 7291, 6631, 26509}}, {3298, 15, 13010, {1, 3, 1, 5, 5, 15, 107, 103, 355, 307, 1559, 837, 5413, 5285, 17489}}, {3299, 15, 13058, {1, 1, 5, 7, 17, 21, 21, 23, 109, 709, 1947, 3585, 3629, 4669, 949}}, {3300, 15, 13072, {1, 3, 7, 1, 9, 33, 85, 147, 467, 259, 1913, 199, 7399, 9551, 22387}}, {3301, 15, 13084, {1, 3, 5, 11, 15, 53, 23, 41, 249, 515, 1161, 2467, 1299, 7449, 2613}}, {3302, 15, 13087, {1, 1, 5, 5, 5, 29, 91, 139, 487, 545, 321, 3035, 4545, 6747, 21673}}, {3303, 15, 13091, {1, 1, 3, 13, 23, 49, 95, 103, 25, 119, 469, 2515, 2551, 841, 25089}}, {3304, 15, 13097, {1, 1, 5, 7, 11, 31, 31, 197, 245, 715, 257, 4043, 8099, 11531, 5617}}, {3305, 15, 13108, {1, 1, 3, 3, 19, 7, 9, 179, 103, 995, 191, 179, 3843, 5215, 27639}}, {3306, 15, 13123, {1, 3, 1, 7, 23, 59, 25, 65, 399, 211, 1453, 3511, 7203, 16015, 32197}}, {3307, 15, 13149, {1, 3, 3, 5, 9, 35, 109, 67, 197, 449, 643, 519, 5751, 15551, 11331}}, {3308, 15, 13150, {1, 3, 5, 3, 1, 17, 53, 201, 265, 351, 467, 911, 1117, 7183, 20371}}, {3309, 15, 13163, {1, 1, 7, 7, 27, 17, 93, 81, 227, 619, 1191, 735, 815, 12615, 2719}}, {3310, 15, 13166, {1, 3, 1, 15, 19, 3, 83, 75, 343, 297, 1019, 3469, 4383, 13299, 29755}}, {3311, 15, 13178, {1, 1, 5, 3, 13, 55, 119, 169, 85, 595, 299, 2469, 5625, 2877, 16117}}, {3312, 15, 13180, {1, 1, 3, 5, 15, 17, 61, 161, 47, 393, 143, 867, 5517, 9495, 12795}}, {3313, 15, 13184, {1, 3, 5, 1, 27, 31, 113, 125, 251, 687, 969, 1473, 2245, 6355, 13655}}, {3314, 15, 13204, {1, 1, 1, 5, 5, 37, 29, 133, 443, 899, 277, 2353, 7223, 4459, 19159}}, {3315, 15, 13238, {1, 1, 3, 9, 19, 27, 53, 145, 195, 167, 2045, 447, 1803, 1895, 8431}}, {3316, 15, 13242, {1, 1, 3, 9, 5, 27, 91, 147, 233, 451, 475, 27, 4629, 16181, 16437}}, {3317, 15, 13249, {1, 3, 5, 3, 29, 17, 53, 167, 433, 689, 1131, 2985, 1553, 11697, 6993}}, {3318, 15, 13255, {1, 3, 3, 13, 21, 43, 69, 229, 399, 525, 179, 237, 7017, 5703, 17653}}, {3319, 15, 13269, {1, 1, 3, 15, 13, 39, 75, 163, 229, 875, 197, 477, 3667, 15501, 15801}}, {3320, 15, 13270, {1, 1, 7, 15, 15, 51, 81, 187, 487, 673, 865, 1915, 1009, 5935, 8097}}, {3321, 15, 13274, {1, 3, 5, 5, 7, 3, 63, 77, 495, 815, 391, 2321, 1007, 15661, 30715}}, {3322, 15, 13285, {1, 1, 7, 3, 17, 25, 83, 173, 173, 911, 1373, 2957, 4549, 15977, 17695}}, {3323, 15, 13289, {1, 1, 7, 13, 13, 23, 77, 147, 497, 1003, 1687, 1795, 1393, 1881, 8479}}, {3324, 15, 13298, {1, 3, 7, 11, 27, 43, 97, 25, 61, 457, 203, 2573, 5943, 15021, 4003}}, {3325, 15, 13307, {1, 3, 3, 13, 9, 37, 37, 25, 219, 889, 1535, 2791, 4531, 13679, 12663}}, {3326, 15, 13312, {1, 1, 3, 1, 17, 7, 51, 123, 89, 887, 1467, 1645, 3767, 6383, 30837}}, {3327, 15, 13335, {1, 3, 3, 1, 21, 47, 5, 151, 83, 257, 569, 2711, 637, 12569, 16893}}, {3328, 15, 13345, {1, 3, 7, 1, 31, 37, 73, 3, 115, 919, 1817, 2483, 4811, 15245, 4375}}, {3329, 15, 13357, {1, 1, 1, 5, 1, 39, 39, 231, 9, 733, 455, 3383, 4777, 7235, 12631}}, {3330, 15, 13366, {1, 1, 7, 9, 13, 25, 55, 25, 73, 59, 1699, 929, 755, 1279, 5583}}, {3331, 15, 13372, {1, 3, 5, 3, 9, 49, 79, 55, 479, 179, 1159, 4079, 3503, 11603, 12361}}, {3332, 15, 13380, {1, 1, 5, 9, 21, 45, 31, 163, 377, 817, 219, 147, 2581, 12769, 30783}}, {3333, 15, 13384, {1, 3, 1, 7, 15, 27, 39, 189, 493, 259, 1663, 1213, 961, 11089, 16079}}, {3334, 15, 13395, {1, 1, 5, 9, 5, 41, 13, 153, 313, 337, 1027, 1267, 4249, 13071, 27043}}, {3335, 15, 13407, {1, 3, 7, 3, 13, 11, 23, 255, 51, 527, 317, 3217, 5037, 12723, 17411}}, {3336, 15, 13408, {1, 1, 5, 1, 25, 57, 83, 97, 233, 513, 1283, 2675, 4111, 4111, 32141}}, {3337, 15, 13413, {1, 3, 3, 15, 25, 33, 103, 81, 155, 189, 139, 1179, 2691, 15119, 13959}}, {3338, 15, 13414, {1, 3, 3, 1, 25, 55, 67, 19, 19, 9, 437, 579, 4273, 10733, 7125}}, {3339, 15, 13417, {1, 1, 1, 7, 23, 41, 47, 5, 435, 749, 595, 199, 3941, 7199, 4795}}, {3340, 15, 13437, {1, 3, 1, 15, 5, 49, 35, 9, 199, 703, 1769, 3269, 5689, 13063, 22771}}, {3341, 15, 13441, {1, 1, 5, 5, 21, 55, 125, 55, 63, 149, 1167, 3577, 1051, 3921, 20545}}, {3342, 15, 13447, {1, 3, 7, 13, 29, 53, 107, 193, 163, 339, 1335, 1573, 5809, 5681, 29487}}, {3343, 15, 13456, {1, 1, 1, 9, 17, 9, 91, 177, 211, 453, 1807, 1881, 6051, 225, 6021}}, {3344, 15, 13459, {1, 1, 1, 13, 15, 1, 29, 43, 181, 105, 1945, 2313, 6429, 2901, 6221}}, {3345, 15, 13461, {1, 3, 5, 11, 29, 55, 115, 115, 187, 1013, 697, 1885, 121, 12387, 32443}}, {3346, 15, 13466, {1, 1, 1, 7, 19, 51, 21, 107, 55, 125, 1655, 2281, 3293, 15749, 27521}}, {3347, 15, 13484, {1, 1, 7, 9, 19, 9, 81, 93, 139, 401, 193, 73, 5159, 9323, 6019}}, {3348, 15, 13487, {1, 1, 7, 9, 15, 51, 115, 69, 247, 599, 1163, 2251, 1211, 8827, 15581}}, {3349, 15, 13489, {1, 1, 7, 9, 5, 39, 75, 185, 321, 911, 849, 843, 6791, 10407, 10513}}, {3350, 15, 13492, {1, 1, 5, 5, 15, 9, 21, 47, 459, 681, 2001, 1545, 5939, 7073, 29043}}, {3351, 15, 13496, {1, 3, 1, 11, 13, 25, 53, 97, 487, 797, 567, 3757, 5597, 6313, 18531}}, {3352, 15, 13510, {1, 1, 3, 3, 29, 55, 11, 219, 325, 591, 2015, 383, 2595, 11855, 22501}}, {3353, 15, 13531, {1, 1, 1, 5, 15, 57, 33, 125, 323, 749, 1843, 4019, 2075, 6673, 6957}}, {3354, 15, 13538, {1, 1, 5, 7, 19, 7, 47, 239, 51, 107, 1081, 467, 5493, 7617, 10355}}, {3355, 15, 13543, {1, 3, 1, 1, 11, 3, 67, 199, 175, 421, 935, 309, 4449, 6363, 9183}}, {3356, 15, 13547, {1, 1, 1, 7, 9, 33, 3, 219, 481, 513, 417, 1267, 2863, 765, 18431}}, {3357, 15, 13572, {1, 3, 1, 1, 19, 1, 89, 109, 415, 105, 487, 3241, 7465, 9233, 16307}}, {3358, 15, 13581, {1, 1, 3, 13, 9, 43, 25, 231, 383, 789, 1855, 691, 3465, 2387, 11715}}, {3359, 15, 13590, {1, 3, 3, 3, 13, 39, 63, 107, 33, 265, 437, 117, 3179, 5543, 28179}}, {3360, 15, 13605, {1, 3, 3, 13, 21, 5, 31, 111, 321, 425, 253, 3501, 3209, 15429, 18383}}, {3361, 15, 13612, {1, 3, 5, 9, 1, 27, 117, 187, 433, 459, 1999, 1069, 4857, 8591, 26343}}, {3362, 15, 13624, {1, 1, 7, 3, 15, 43, 11, 193, 391, 341, 1203, 1259, 7265, 1783, 13161}}, {3363, 15, 13630, {1, 1, 7, 1, 5, 15, 45, 143, 193, 985, 1105, 3483, 2421, 9687, 22347}}, {3364, 15, 13632, {1, 3, 7, 13, 21, 17, 79, 231, 487, 663, 1101, 1025, 5779, 14681, 29181}}, {3365, 15, 13638, {1, 1, 3, 9, 15, 19, 55, 219, 27, 963, 1513, 1017, 3907, 12279, 32655}}, {3366, 15, 13661, {1, 3, 7, 3, 31, 27, 17, 1, 51, 861, 529, 1225, 6395, 15787, 5231}}, {3367, 15, 13665, {1, 3, 3, 11, 27, 7, 101, 143, 21, 191, 1437, 2393, 4097, 14319, 6977}}, {3368, 15, 13668, {1, 3, 3, 3, 25, 35, 105, 141, 433, 269, 1469, 2939, 5387, 7373, 7863}}, {3369, 15, 13686, {1, 3, 7, 5, 5, 21, 23, 11, 217, 357, 1847, 101, 1161, 5297, 14879}}, {3370, 15, 13699, {1, 3, 1, 3, 25, 23, 81, 217, 505, 161, 1667, 1343, 1751, 2463, 26431}}, {3371, 15, 13701, {1, 1, 3, 1, 17, 51, 125, 205, 385, 351, 731, 2911, 2749, 2689, 27031}}, {3372, 15, 13708, {1, 1, 5, 5, 5, 17, 31, 171, 477, 671, 167, 1797, 8047, 10123, 4325}}, {3373, 15, 13716, {1, 1, 7, 1, 11, 23, 123, 161, 99, 1007, 765, 1965, 5395, 16193, 17751}}, {3374, 15, 13725, {1, 3, 1, 9, 13, 11, 111, 217, 31, 753, 377, 2267, 7893, 7195, 24999}}, {3375, 15, 13730, {1, 3, 1, 9, 21, 53, 127, 121, 151, 395, 1447, 1411, 5179, 12043, 27607}}, {3376, 15, 13742, {1, 1, 5, 3, 11, 37, 97, 139, 113, 835, 229, 3741, 827, 5527, 5779}}, {3377, 15, 13747, {1, 1, 7, 7, 27, 55, 11, 55, 429, 269, 1179, 233, 1053, 10225, 16703}}, {3378, 15, 13749, {1, 1, 1, 3, 15, 9, 67, 119, 95, 753, 511, 2507, 3953, 6403, 27635}}, {3379, 15, 13753, {1, 3, 3, 7, 27, 57, 25, 27, 249, 515, 193, 4043, 2017, 751, 10949}}, {3380, 15, 13754, {1, 3, 1, 9, 31, 57, 67, 21, 177, 573, 1835, 2015, 6201, 2383, 31087}}, {3381, 15, 13771, {1, 1, 5, 1, 19, 3, 89, 243, 69, 387, 1905, 3465, 2775, 7713, 30081}}, {3382, 15, 13773, {1, 1, 3, 3, 9, 59, 15, 89, 85, 605, 881, 263, 2551, 797, 16541}}, {3383, 15, 13782, {1, 3, 7, 11, 25, 41, 59, 139, 405, 571, 1147, 2963, 4175, 12901, 6309}}, {3384, 15, 13785, {1, 3, 1, 5, 29, 29, 11, 243, 183, 281, 807, 1, 7079, 10079, 13865}}, {3385, 15, 13798, {1, 3, 7, 5, 5, 1, 89, 55, 423, 157, 675, 1849, 241, 6467, 15459}}, {3386, 15, 13802, {1, 1, 7, 11, 15, 63, 89, 109, 501, 549, 317, 3043, 1151, 3895, 19851}}, {3387, 15, 13809, {1, 3, 1, 15, 7, 23, 97, 97, 225, 737, 1117, 3325, 209, 14169, 10813}}, {3388, 15, 13828, {1, 3, 7, 13, 13, 39, 91, 153, 395, 879, 1041, 3753, 5577, 1985, 25247}}, {3389, 15, 13832, {1, 1, 1, 3, 17, 15, 113, 143, 101, 901, 1119, 1819, 3577, 3441, 31511}}, {3390, 15, 13840, {1, 3, 1, 11, 15, 27, 21, 37, 287, 121, 451, 1353, 2173, 299, 18791}}, {3391, 15, 13850, {1, 3, 3, 5, 23, 1, 49, 145, 315, 769, 99, 1385, 5961, 9121, 1465}}, {3392, 15, 13861, {1, 3, 3, 13, 21, 39, 39, 233, 271, 113, 615, 2257, 3765, 5921, 313}}, {3393, 15, 13874, {1, 3, 7, 7, 25, 45, 11, 237, 83, 203, 929, 1819, 2679, 11583, 30091}}, {3394, 15, 13876, {1, 1, 1, 7, 21, 63, 85, 251, 133, 991, 1515, 2547, 6051, 7279, 3569}}, {3395, 15, 13886, {1, 3, 7, 15, 11, 19, 87, 17, 313, 283, 1021, 2743, 4855, 13741, 17955}}, {3396, 15, 13897, {1, 1, 7, 13, 29, 13, 61, 93, 81, 91, 995, 907, 4847, 2599, 20041}}, {3397, 15, 13900, {1, 1, 3, 11, 13, 45, 103, 33, 243, 109, 2029, 121, 231, 16179, 13741}}, {3398, 15, 13915, {1, 3, 5, 9, 9, 5, 73, 225, 199, 723, 611, 1909, 2345, 10257, 9909}}, {3399, 15, 13927, {1, 1, 3, 11, 7, 5, 33, 89, 431, 899, 803, 3173, 6131, 16097, 20561}}, {3400, 15, 13951, {1, 3, 3, 7, 7, 47, 23, 47, 411, 69, 239, 661, 5591, 10457, 24245}}, {3401, 15, 13955, {1, 1, 5, 15, 25, 35, 87, 23, 115, 939, 1579, 119, 4001, 13791, 9729}}, {3402, 15, 13962, {1, 3, 5, 11, 25, 45, 29, 195, 369, 237, 735, 155, 123, 4415, 32255}}, {3403, 15, 13969, {1, 3, 3, 9, 13, 53, 15, 77, 313, 75, 529, 925, 5679, 14585, 19889}}, {3404, 15, 13979, {1, 1, 7, 15, 15, 27, 105, 13, 31, 669, 563, 1809, 4321, 7797, 4177}}, {3405, 15, 13988, {1, 1, 5, 9, 3, 29, 111, 177, 33, 235, 1951, 1561, 141, 4803, 16327}}, {3406, 15, 13998, {1, 1, 1, 7, 9, 41, 1, 149, 95, 933, 115, 1619, 771, 8189, 8781}}, {3407, 15, 14000, {1, 1, 5, 3, 13, 41, 33, 159, 355, 159, 1243, 1439, 6571, 14397, 31321}}, {3408, 15, 14005, {1, 1, 7, 11, 9, 15, 91, 145, 457, 255, 1449, 611, 1449, 2521, 28949}}, {3409, 15, 14027, {1, 3, 7, 5, 27, 57, 35, 99, 447, 287, 743, 1163, 4379, 7361, 3831}}, {3410, 15, 14037, {1, 3, 3, 7, 15, 53, 41, 83, 133, 571, 1739, 531, 2921, 11527, 21941}}, {3411, 15, 14051, {1, 1, 1, 13, 9, 27, 39, 113, 429, 447, 595, 3171, 5245, 4095, 14847}}, {3412, 15, 14054, {1, 1, 3, 7, 19, 19, 21, 101, 489, 1011, 265, 3899, 3225, 11701, 5193}}, {3413, 15, 14060, {1, 3, 7, 3, 15, 25, 103, 213, 441, 215, 1483, 263, 3561, 7915, 7969}}, {3414, 15, 14063, {1, 3, 3, 3, 11, 47, 97, 29, 489, 867, 1347, 2155, 4871, 8001, 18305}}, {3415, 15, 14071, {1, 3, 1, 9, 25, 15, 61, 17, 343, 775, 1765, 3803, 4577, 8437, 12605}}, {3416, 15, 14078, {1, 1, 5, 3, 11, 39, 69, 23, 23, 65, 1967, 2429, 1703, 6671, 14981}}, {3417, 15, 14080, {1, 1, 5, 15, 23, 59, 125, 51, 225, 439, 2019, 2589, 7781, 13111, 2911}}, {3418, 15, 14085, {1, 1, 1, 3, 1, 31, 37, 245, 203, 305, 821, 367, 5211, 9791, 21777}}, {3419, 15, 14086, {1, 1, 5, 9, 9, 31, 97, 25, 271, 83, 343, 2461, 1805, 14383, 10059}}, {3420, 15, 14095, {1, 1, 5, 13, 15, 33, 127, 109, 137, 963, 961, 1647, 7881, 8133, 22359}}, {3421, 15, 14138, {1, 1, 3, 7, 25, 31, 123, 241, 283, 1, 1781, 23, 971, 6485, 127}}, {3422, 15, 14145, {1, 1, 5, 15, 15, 27, 25, 145, 395, 679, 979, 571, 1585, 14787, 7465}}, {3423, 15, 14158, {1, 1, 5, 7, 13, 11, 7, 131, 511, 597, 379, 1513, 6267, 16039, 1503}}, {3424, 15, 14166, {1, 1, 1, 13, 15, 49, 73, 217, 353, 577, 1913, 1127, 961, 11557, 24993}}, {3425, 15, 14179, {1, 3, 3, 9, 7, 3, 105, 141, 377, 687, 1917, 485, 983, 11149, 23303}}, {3426, 15, 14181, {1, 1, 3, 15, 11, 7, 117, 179, 505, 67, 1817, 913, 5757, 1981, 1637}}, {3427, 15, 14188, {1, 1, 1, 7, 5, 29, 3, 43, 223, 295, 1895, 3425, 5355, 5155, 17197}}, {3428, 15, 14193, {1, 1, 7, 9, 21, 59, 121, 245, 73, 233, 1527, 869, 4145, 7995, 6473}}, {3429, 15, 14200, {1, 1, 5, 13, 17, 21, 89, 179, 495, 669, 453, 2603, 5969, 6161, 4743}}, {3430, 15, 14203, {1, 1, 7, 11, 25, 21, 103, 131, 391, 249, 1633, 2603, 2207, 8987, 15487}}, {3431, 15, 14215, {1, 3, 7, 9, 13, 45, 99, 251, 115, 597, 1505, 2421, 1231, 10015, 24295}}, {3432, 15, 14224, {1, 1, 5, 5, 31, 49, 17, 67, 463, 813, 1491, 3309, 7881, 8109, 7289}}, {3433, 15, 14230, {1, 3, 1, 15, 23, 35, 123, 21, 169, 499, 95, 603, 1829, 7865, 26313}}, {3434, 15, 14233, {1, 1, 7, 1, 9, 29, 45, 65, 95, 97, 673, 3673, 2969, 2317, 22209}}, {3435, 15, 14236, {1, 1, 3, 7, 29, 33, 121, 17, 331, 487, 1901, 1951, 5383, 9375, 4029}}, {3436, 15, 14246, {1, 3, 7, 9, 25, 43, 91, 147, 141, 401, 1647, 2697, 4645, 7179, 31857}}, {3437, 15, 14267, {1, 3, 5, 11, 9, 31, 127, 105, 39, 883, 1635, 919, 5069, 2875, 24519}}, {3438, 15, 14282, {1, 1, 5, 9, 1, 63, 73, 135, 95, 503, 385, 3903, 545, 12635, 27569}}, {3439, 15, 14287, {1, 1, 3, 11, 27, 31, 47, 173, 55, 339, 1255, 1947, 793, 14133, 13963}}, {3440, 15, 14301, {1, 1, 3, 15, 17, 33, 113, 249, 401, 743, 1307, 3123, 627, 1253, 13285}}, {3441, 15, 14323, {1, 1, 3, 1, 9, 7, 39, 65, 281, 107, 833, 193, 2987, 12267, 31335}}, {3442, 15, 14325, {1, 1, 7, 3, 15, 21, 99, 211, 39, 179, 587, 1169, 6455, 8225, 2049}}, {3443, 15, 14329, {1, 3, 5, 13, 5, 13, 123, 1, 223, 273, 731, 2967, 4793, 4229, 26031}}, {3444, 15, 14339, {1, 1, 1, 1, 3, 17, 7, 23, 225, 757, 743, 1257, 2047, 12509, 25467}}, {3445, 15, 14342, {1, 1, 7, 15, 29, 3, 15, 113, 227, 675, 1295, 2777, 2921, 5485, 2577}}, {3446, 15, 14351, {1, 3, 7, 13, 19, 21, 85, 129, 45, 599, 317, 1513, 4953, 10383, 25253}}, {3447, 15, 14356, {1, 1, 7, 11, 13, 47, 127, 67, 219, 131, 905, 2005, 851, 15243, 5777}}, {3448, 15, 14359, {1, 1, 5, 3, 23, 57, 57, 189, 153, 37, 955, 2049, 1295, 15119, 27213}}, {3449, 15, 14370, {1, 3, 7, 11, 13, 61, 3, 241, 269, 789, 1595, 2369, 4843, 11347, 21543}}, {3450, 15, 14402, {1, 1, 5, 5, 25, 21, 19, 237, 3, 605, 1343, 3965, 3511, 7889, 27759}}, {3451, 15, 14411, {1, 3, 1, 15, 21, 15, 123, 5, 345, 945, 283, 1313, 335, 2085, 19505}}, {3452, 15, 14421, {1, 1, 3, 3, 5, 21, 123, 89, 67, 11, 1247, 1155, 287, 13455, 5693}}, {3453, 15, 14431, {1, 3, 3, 13, 1, 53, 101, 27, 387, 379, 19, 751, 2445, 11737, 975}}, {3454, 15, 14435, {1, 3, 3, 3, 9, 29, 81, 117, 443, 145, 1619, 1813, 8125, 5829, 28617}}, {3455, 15, 14442, {1, 1, 5, 15, 27, 15, 83, 83, 61, 715, 1655, 1631, 3457, 2727, 2163}}, {3456, 15, 14447, {1, 3, 1, 5, 11, 11, 121, 7, 135, 883, 927, 1817, 6839, 12361, 24119}}, {3457, 15, 14456, {1, 3, 7, 11, 23, 59, 39, 165, 109, 355, 1303, 381, 5697, 275, 3771}}, {3458, 15, 14459, {1, 3, 5, 11, 11, 5, 81, 157, 55, 435, 613, 127, 4087, 3791, 21627}}, {3459, 15, 14472, {1, 3, 7, 15, 13, 37, 83, 195, 207, 771, 51, 3685, 6389, 1229, 11101}}, {3460, 15, 14477, {1, 3, 7, 13, 31, 3, 9, 13, 487, 95, 77, 809, 5809, 12887, 29933}}, {3461, 15, 14490, {1, 1, 3, 7, 25, 9, 13, 29, 353, 659, 1785, 3825, 3729, 13109, 12973}}, {3462, 15, 14496, {1, 1, 1, 5, 21, 3, 97, 1, 245, 917, 29, 1429, 8141, 7569, 32493}}, {3463, 15, 14501, {1, 3, 1, 9, 19, 13, 13, 109, 377, 1007, 1737, 1939, 1419, 1145, 5065}}, {3464, 15, 14505, {1, 1, 7, 9, 27, 57, 53, 69, 423, 43, 1629, 1003, 1473, 10809, 5659}}, {3465, 15, 14513, {1, 1, 1, 9, 1, 45, 11, 231, 351, 155, 663, 2783, 3491, 5725, 25207}}, {3466, 15, 14520, {1, 1, 1, 3, 15, 25, 77, 89, 231, 813, 657, 2603, 4885, 1383, 14499}}, {3467, 15, 14534, {1, 3, 5, 5, 9, 21, 101, 181, 449, 491, 737, 803, 659, 11771, 545}}, {3468, 15, 14562, {1, 3, 7, 9, 7, 19, 27, 199, 265, 329, 1031, 1235, 3191, 10071, 16281}}, {3469, 15, 14576, {1, 1, 7, 11, 27, 55, 3, 127, 503, 1003, 1041, 1953, 5835, 4851, 13485}}, {3470, 15, 14579, {1, 1, 7, 15, 5, 45, 97, 61, 221, 497, 1949, 3163, 4707, 8441, 1437}}, {3471, 15, 14585, {1, 3, 5, 1, 3, 35, 107, 9, 473, 971, 227, 2225, 3999, 3095, 18879}}, {3472, 15, 14586, {1, 1, 1, 9, 21, 59, 21, 1, 41, 435, 575, 491, 1839, 1095, 9727}}, {3473, 15, 14606, {1, 3, 5, 9, 13, 29, 123, 251, 465, 701, 1105, 829, 573, 11503, 11861}}, {3474, 15, 14627, {1, 3, 3, 13, 27, 59, 29, 111, 225, 973, 561, 1481, 835, 9261, 13831}}, {3475, 15, 14630, {1, 1, 1, 7, 17, 3, 97, 211, 333, 315, 571, 3523, 7305, 6461, 20139}}, {3476, 15, 14634, {1, 3, 7, 11, 31, 21, 105, 247, 113, 863, 1767, 381, 4623, 8935, 7911}}, {3477, 15, 14636, {1, 1, 5, 7, 29, 45, 17, 155, 69, 17, 655, 1983, 6385, 6177, 7961}}, {3478, 15, 14647, {1, 3, 3, 15, 31, 15, 63, 81, 309, 115, 393, 3445, 689, 13963, 18887}}, {3479, 15, 14653, {1, 1, 5, 1, 19, 39, 127, 61, 357, 53, 195, 2745, 7853, 5753, 3669}}, {3480, 15, 14659, {1, 3, 7, 7, 17, 51, 57, 145, 451, 365, 1517, 909, 4265, 10737, 9579}}, {3481, 15, 14671, {1, 1, 3, 13, 3, 37, 121, 103, 257, 47, 1685, 2951, 5753, 15379, 8899}}, {3482, 15, 14674, {1, 1, 5, 7, 31, 63, 61, 197, 97, 773, 133, 1517, 3093, 14879, 22941}}, {3483, 15, 14701, {1, 1, 5, 1, 3, 9, 27, 53, 97, 663, 1915, 409, 471, 1391, 24853}}, {3484, 15, 14716, {1, 1, 1, 7, 21, 53, 69, 5, 187, 571, 2023, 997, 323, 12059, 7071}}, {3485, 15, 14719, {1, 3, 3, 1, 7, 59, 55, 157, 101, 123, 1301, 3709, 4673, 3897, 28791}}, {3486, 15, 14720, {1, 3, 7, 5, 5, 23, 39, 139, 365, 415, 1481, 3415, 6323, 11109, 5719}}, {3487, 15, 14725, {1, 3, 5, 3, 5, 11, 23, 143, 243, 229, 183, 3367, 3187, 8151, 28351}}, {3488, 15, 14730, {1, 3, 7, 9, 5, 37, 29, 23, 437, 827, 985, 2879, 7611, 1391, 19087}}, {3489, 15, 14743, {1, 3, 3, 5, 7, 9, 5, 143, 217, 757, 1697, 2459, 453, 8679, 4513}}, {3490, 15, 14747, {1, 3, 5, 5, 11, 33, 3, 143, 293, 921, 185, 2461, 5547, 12247, 28591}}, {3491, 15, 14786, {1, 3, 7, 5, 3, 53, 43, 179, 235, 417, 1307, 1367, 3695, 12809, 1807}}, {3492, 15, 14788, {1, 3, 1, 11, 15, 43, 115, 229, 157, 25, 687, 3347, 271, 5777, 8557}}, {3493, 15, 14792, {1, 3, 7, 5, 27, 37, 55, 135, 209, 47, 1603, 957, 5785, 11141, 10407}}, {3494, 15, 14795, {1, 1, 1, 15, 17, 17, 103, 29, 489, 493, 119, 1707, 3463, 1815, 32055}}, {3495, 15, 14809, {1, 3, 7, 11, 17, 13, 115, 145, 77, 515, 1911, 477, 5997, 8731, 3143}}, {3496, 15, 14831, {1, 3, 1, 13, 31, 41, 73, 91, 231, 1, 455, 2023, 4691, 3613, 16329}}, {3497, 15, 14834, {1, 1, 5, 15, 15, 39, 17, 117, 131, 657, 1939, 2245, 2575, 195, 25209}}, {3498, 15, 14850, {1, 3, 7, 15, 5, 51, 69, 141, 499, 931, 1165, 2119, 1703, 10867, 28443}}, {3499, 15, 14855, {1, 1, 1, 15, 13, 45, 45, 103, 115, 177, 651, 2545, 1417, 5349, 3385}}, {3500, 15, 14859, {1, 3, 3, 1, 1, 41, 117, 15, 225, 861, 843, 2775, 4543, 6275, 14671}}, {3501, 15, 14864, {1, 3, 5, 15, 5, 35, 87, 193, 341, 55, 1131, 945, 6865, 11271, 18705}}, {3502, 15, 14876, {1, 3, 5, 9, 13, 35, 71, 197, 79, 351, 3, 3939, 1105, 12455, 28921}}, {3503, 15, 14889, {1, 3, 1, 13, 9, 23, 89, 165, 59, 257, 1369, 161, 6255, 2997, 19175}}, {3504, 15, 14890, {1, 3, 5, 3, 5, 41, 107, 231, 111, 207, 1865, 2079, 5891, 2487, 5863}}, {3505, 15, 14898, {1, 3, 7, 15, 3, 3, 105, 235, 263, 991, 367, 1885, 1769, 7805, 11909}}, {3506, 15, 14909, {1, 3, 3, 5, 15, 59, 67, 247, 77, 367, 1641, 1959, 1921, 5939, 17355}}, {3507, 15, 14917, {1, 1, 7, 1, 3, 53, 37, 5, 221, 779, 1353, 1633, 2769, 6355, 8505}}, {3508, 15, 14924, {1, 1, 7, 13, 11, 13, 73, 227, 115, 523, 355, 3127, 7545, 8409, 22335}}, {3509, 15, 14929, {1, 1, 5, 11, 21, 15, 91, 115, 427, 683, 461, 2433, 6313, 4595, 24401}}, {3510, 15, 14942, {1, 3, 7, 5, 29, 21, 57, 215, 423, 717, 1455, 705, 6835, 4503, 26077}}, {3511, 15, 14951, {1, 1, 1, 15, 3, 33, 25, 227, 381, 477, 1023, 2751, 2229, 631, 16903}}, {3512, 15, 14969, {1, 3, 1, 11, 9, 17, 59, 73, 53, 671, 251, 1729, 7593, 12473, 22533}}, {3513, 15, 14970, {1, 3, 3, 1, 3, 35, 37, 173, 459, 143, 135, 3871, 2689, 8007, 4379}}, {3514, 15, 14972, {1, 3, 5, 9, 23, 19, 43, 45, 493, 509, 1851, 1615, 5675, 13793, 6973}}, {3515, 15, 14982, {1, 3, 3, 15, 5, 17, 77, 85, 451, 753, 579, 1057, 4851, 6017, 4195}}, {3516, 15, 14988, {1, 3, 3, 5, 31, 29, 81, 159, 103, 391, 15, 899, 4623, 5957, 31961}}, {3517, 15, 14994, {1, 1, 1, 7, 17, 57, 81, 17, 177, 633, 49, 2793, 5229, 5995, 9491}}, {3518, 15, 15005, {1, 1, 7, 15, 17, 19, 65, 57, 189, 239, 1229, 929, 2681, 12845, 29311}}, {3519, 15, 15016, {1, 3, 1, 11, 13, 47, 61, 203, 383, 875, 943, 139, 4217, 8279, 1047}}, {3520, 15, 15024, {1, 3, 7, 13, 23, 7, 1, 69, 47, 537, 1325, 3101, 685, 14057, 19953}}, {3521, 15, 15030, {1, 3, 3, 1, 1, 7, 39, 77, 47, 755, 527, 2985, 5433, 15095, 27741}}, {3522, 15, 15048, {1, 1, 7, 5, 23, 57, 79, 155, 81, 937, 1071, 3929, 1655, 3831, 17351}}, {3523, 15, 15054, {1, 3, 7, 1, 3, 41, 13, 235, 207, 487, 1883, 2247, 1231, 2751, 15615}}, {3524, 15, 15066, {1, 1, 7, 1, 21, 57, 95, 191, 119, 483, 283, 2221, 5665, 14819, 26097}}, {3525, 15, 15071, {1, 3, 1, 1, 9, 59, 27, 51, 393, 31, 925, 715, 7705, 14885, 28767}}, {3526, 15, 15072, {1, 1, 3, 3, 3, 61, 109, 131, 113, 249, 1331, 2521, 2973, 6375, 20093}}, {3527, 15, 15075, {1, 3, 7, 9, 31, 37, 125, 245, 237, 245, 111, 379, 7495, 15531, 2325}}, {3528, 15, 15119, {1, 3, 7, 13, 21, 21, 57, 21, 449, 969, 417, 2999, 509, 639, 7797}}, {3529, 15, 15121, {1, 3, 7, 7, 7, 29, 11, 175, 55, 705, 891, 863, 3021, 10071, 10267}}, {3530, 15, 15133, {1, 1, 3, 13, 19, 17, 127, 57, 449, 579, 337, 899, 1235, 11269, 4245}}, {3531, 15, 15138, {1, 1, 1, 11, 29, 61, 35, 75, 249, 683, 287, 45, 3277, 7521, 2073}}, {3532, 15, 15143, {1, 3, 5, 5, 15, 25, 77, 63, 63, 801, 1387, 1533, 2185, 10899, 28381}}, {3533, 15, 15170, {1, 3, 1, 1, 21, 49, 3, 249, 419, 575, 87, 3749, 2523, 16125, 9483}}, {3534, 15, 15194, {1, 1, 1, 11, 21, 43, 85, 211, 449, 439, 1495, 1841, 4765, 15253, 1467}}, {3535, 15, 15212, {1, 3, 3, 15, 3, 37, 31, 243, 187, 995, 1103, 2723, 1523, 15967, 28649}}, {3536, 15, 15223, {1, 1, 5, 11, 9, 11, 17, 87, 335, 125, 1079, 1657, 1237, 8059, 29833}}, {3537, 15, 15229, {1, 3, 1, 3, 3, 41, 35, 37, 33, 61, 505, 3203, 5, 101, 8571}}, {3538, 15, 15254, {1, 1, 3, 11, 9, 11, 85, 235, 261, 473, 109, 2127, 5745, 6389, 7431}}, {3539, 15, 15263, {1, 1, 5, 15, 3, 55, 77, 97, 17, 193, 1267, 3063, 6531, 9797, 8639}}, {3540, 15, 15270, {1, 1, 5, 5, 25, 41, 79, 83, 485, 697, 149, 1023, 89, 6115, 15227}}, {3541, 15, 15273, {1, 1, 3, 15, 1, 9, 73, 251, 33, 599, 1017, 353, 4305, 16033, 29663}}, {3542, 15, 15287, {1, 3, 7, 15, 3, 1, 89, 39, 125, 337, 1445, 3131, 3685, 9849, 25829}}, {3543, 15, 15299, {1, 3, 7, 3, 19, 1, 63, 179, 349, 135, 185, 2977, 2527, 15087, 18133}}, {3544, 15, 15301, {1, 1, 3, 3, 23, 7, 91, 221, 325, 723, 345, 81, 8077, 5501, 8453}}, {3545, 15, 15306, {1, 1, 3, 9, 7, 3, 13, 173, 479, 161, 1989, 3255, 2069, 6717, 559}}, {3546, 15, 15313, {1, 3, 3, 5, 9, 61, 93, 203, 277, 367, 1141, 981, 4745, 12625, 21003}}, {3547, 15, 15320, {1, 3, 5, 5, 27, 17, 5, 211, 403, 701, 5, 3091, 4611, 5615, 23667}}, {3548, 15, 15323, {1, 1, 3, 1, 21, 61, 125, 77, 57, 463, 1499, 791, 2087, 2805, 18829}}, {3549, 15, 15329, {1, 3, 5, 3, 11, 41, 125, 231, 119, 837, 831, 1331, 7439, 2381, 3759}}, {3550, 15, 15332, {1, 3, 1, 11, 19, 59, 117, 107, 443, 699, 315, 1491, 2581, 15871, 17159}}, {3551, 15, 15341, {1, 3, 5, 11, 5, 9, 121, 35, 209, 877, 527, 3493, 4657, 16093, 17589}}, {3552, 15, 15359, {1, 1, 7, 15, 9, 43, 119, 29, 381, 479, 1443, 3171, 5053, 9625, 21161}}, {3553, 15, 15361, {1, 1, 3, 5, 15, 21, 31, 223, 83, 399, 1529, 3605, 6343, 10469, 10099}}, {3554, 15, 15364, {1, 1, 3, 5, 5, 45, 23, 123, 353, 971, 85, 3069, 3245, 6569, 13241}}, {3555, 15, 15367, {1, 1, 1, 3, 25, 49, 5, 77, 491, 881, 993, 1195, 7677, 5709, 10807}}, {3556, 15, 15379, {1, 3, 3, 3, 5, 49, 127, 255, 183, 583, 1599, 987, 7281, 7149, 28507}}, {3557, 15, 15391, {1, 1, 5, 1, 13, 55, 55, 157, 197, 25, 1971, 3161, 3903, 8919, 13563}}, {3558, 15, 15415, {1, 3, 7, 9, 3, 37, 79, 193, 25, 103, 843, 2651, 6341, 2653, 24337}}, {3559, 15, 15416, {1, 1, 7, 3, 25, 49, 99, 139, 45, 211, 2033, 2331, 7037, 7177, 1755}}, {3560, 15, 15419, {1, 3, 7, 3, 5, 19, 127, 135, 403, 221, 141, 1065, 3935, 2745, 25979}}, {3561, 15, 15433, {1, 1, 3, 3, 31, 23, 111, 37, 261, 7, 835, 2379, 7927, 8181, 23751}}, {3562, 15, 15469, {1, 3, 7, 15, 1, 39, 79, 3, 103, 427, 1917, 809, 5039, 689, 1939}}, {3563, 15, 15478, {1, 1, 1, 15, 29, 37, 39, 243, 149, 353, 763, 3405, 5751, 9441, 6653}}, {3564, 15, 15481, {1, 3, 3, 11, 1, 57, 125, 151, 445, 423, 841, 2265, 5017, 15863, 13057}}, {3565, 15, 15482, {1, 3, 5, 13, 11, 49, 61, 159, 211, 917, 561, 1903, 3985, 11117, 28969}}, {3566, 15, 15498, {1, 3, 5, 13, 29, 5, 35, 51, 91, 291, 9, 3713, 3341, 4551, 12085}}, {3567, 15, 15505, {1, 3, 3, 1, 1, 39, 111, 141, 319, 179, 1709, 1605, 5063, 13279, 10003}}, {3568, 15, 15517, {1, 1, 3, 9, 7, 59, 91, 41, 343, 475, 1669, 2311, 5141, 12661, 25847}}, {3569, 15, 15518, {1, 3, 5, 9, 9, 11, 49, 221, 1, 243, 791, 229, 503, 373, 19189}}, {3570, 15, 15527, {1, 1, 5, 11, 17, 13, 45, 57, 215, 491, 1601, 2183, 3713, 429, 22007}}, {3571, 15, 15528, {1, 1, 3, 11, 31, 61, 23, 237, 261, 955, 1085, 1541, 2601, 909, 7749}}, {3572, 15, 15545, {1, 1, 3, 9, 13, 11, 121, 173, 177, 551, 1757, 2745, 2265, 4611, 743}}, {3573, 15, 15548, {1, 1, 3, 15, 23, 43, 107, 239, 463, 369, 1857, 1073, 1247, 1029, 22557}}, {3574, 15, 15554, {1, 1, 3, 11, 23, 35, 89, 93, 41, 941, 1141, 2339, 1423, 8007, 28685}}, {3575, 15, 15565, {1, 3, 5, 13, 29, 7, 79, 15, 59, 145, 1237, 2215, 1257, 12621, 31101}}, {3576, 15, 15577, {1, 1, 3, 7, 13, 55, 57, 229, 205, 1009, 341, 3901, 5189, 957, 32587}}, {3577, 15, 15580, {1, 3, 7, 11, 1, 1, 41, 7, 365, 407, 1609, 1423, 6483, 5171, 32519}}, {3578, 15, 15587, {1, 3, 7, 3, 17, 31, 125, 27, 125, 335, 1395, 2639, 329, 2549, 14449}}, {3579, 15, 15601, {1, 3, 3, 7, 19, 45, 11, 73, 123, 179, 1685, 3385, 2379, 3387, 16793}}, {3580, 15, 15604, {1, 3, 7, 5, 31, 25, 47, 153, 121, 453, 935, 3953, 2081, 12145, 24979}}, {3581, 15, 15611, {1, 1, 7, 13, 25, 11, 65, 3, 277, 237, 1129, 1801, 4165, 9065, 18747}}, {3582, 15, 15616, {1, 1, 7, 7, 13, 5, 37, 253, 507, 645, 1355, 3401, 6707, 6329, 11237}}, {3583, 15, 15619, {1, 1, 3, 15, 17, 49, 3, 233, 407, 451, 69, 3859, 3171, 12303, 21031}}, {3584, 15, 15625, {1, 1, 3, 3, 9, 53, 119, 117, 401, 903, 1449, 3639, 4083, 2095, 22085}}, {3585, 15, 15633, {1, 3, 7, 15, 5, 61, 117, 193, 137, 431, 195, 4019, 3047, 5049, 14281}}, {3586, 15, 15674, {1, 1, 1, 15, 17, 19, 29, 83, 449, 257, 1105, 1949, 1749, 3459, 6343}}, {3587, 15, 15681, {1, 1, 1, 15, 23, 39, 61, 219, 109, 365, 863, 1813, 6673, 15999, 5101}}, {3588, 15, 15691, {1, 1, 5, 5, 13, 11, 37, 151, 365, 719, 1233, 2425, 1285, 1721, 1205}}, {3589, 15, 15693, {1, 3, 3, 3, 7, 53, 109, 153, 45, 425, 1741, 1229, 4405, 8071, 25155}}, {3590, 15, 15696, {1, 3, 1, 1, 1, 13, 39, 49, 413, 77, 1367, 2553, 5563, 7659, 3467}}, {3591, 15, 15712, {1, 1, 5, 9, 3, 49, 23, 11, 445, 121, 1505, 877, 4137, 1809, 2429}}, {3592, 15, 15717, {1, 1, 1, 11, 21, 13, 93, 33, 493, 805, 775, 2939, 2961, 13625, 31879}}, {3593, 15, 15724, {1, 1, 7, 5, 1, 59, 63, 131, 373, 23, 337, 2107, 5315, 4889, 22851}}, {3594, 15, 15727, {1, 1, 3, 13, 21, 47, 15, 131, 353, 793, 1891, 1757, 5793, 1147, 23697}}, {3595, 15, 15730, {1, 3, 5, 13, 7, 59, 25, 135, 259, 109, 1835, 429, 8153, 7355, 145}}, {3596, 15, 15746, {1, 3, 3, 13, 9, 47, 121, 89, 89, 635, 1079, 2353, 4803, 11369, 12653}}, {3597, 15, 15751, {1, 3, 5, 9, 23, 39, 49, 231, 105, 603, 613, 2021, 6073, 11819, 10595}}, {3598, 15, 15760, {1, 3, 7, 7, 7, 19, 19, 155, 347, 387, 1459, 3793, 619, 14437, 2455}}, {3599, 15, 15770, {1, 1, 1, 15, 21, 35, 19, 185, 483, 425, 479, 3429, 5403, 10791, 14219}}, {3600, 15, 15782, {1, 1, 3, 11, 5, 51, 105, 63, 493, 677, 1457, 2865, 5619, 9321, 19583}}, {3601, 15, 15791, {1, 1, 3, 3, 23, 1, 77, 177, 263, 289, 1567, 3837, 5359, 3269, 16023}}, {3602, 15, 15796, {1, 1, 7, 3, 13, 61, 79, 77, 51, 953, 1417, 795, 4467, 2981, 25131}}, {3603, 15, 15808, {1, 1, 5, 13, 23, 13, 29, 185, 337, 7, 149, 3609, 8119, 9545, 16579}}, {3604, 15, 15814, {1, 3, 1, 5, 23, 9, 123, 15, 99, 55, 1021, 3709, 1521, 15189, 22193}}, {3605, 15, 15825, {1, 3, 7, 9, 13, 41, 39, 45, 49, 181, 1587, 3213, 1037, 14775, 3333}}, {3606, 15, 15828, {1, 1, 1, 7, 29, 55, 59, 31, 411, 601, 191, 283, 3211, 7951, 7919}}, {3607, 15, 15835, {1, 1, 7, 7, 21, 47, 7, 193, 343, 831, 1267, 3289, 1015, 13093, 2717}}, {3608, 15, 15844, {1, 3, 7, 1, 17, 9, 97, 19, 279, 827, 1699, 3573, 3137, 3535, 17791}}, {3609, 15, 15847, {1, 1, 5, 11, 27, 15, 103, 135, 35, 625, 1575, 97, 7013, 13353, 19333}}, {3610, 15, 15853, {1, 3, 3, 7, 17, 13, 49, 135, 435, 743, 1799, 2655, 4839, 2893, 31153}}, {3611, 15, 15856, {1, 1, 5, 1, 3, 41, 1, 195, 53, 803, 1575, 2939, 3873, 10495, 5211}}, {3612, 15, 15877, {1, 3, 1, 15, 19, 19, 37, 59, 355, 483, 685, 3899, 4645, 15127, 3479}}, {3613, 15, 15878, {1, 1, 5, 3, 25, 9, 9, 229, 101, 631, 1165, 4091, 3723, 10655, 9463}}, {3614, 15, 15887, {1, 3, 5, 15, 5, 13, 91, 61, 19, 469, 1675, 3331, 3121, 3435, 4111}}, {3615, 15, 15908, {1, 1, 7, 1, 31, 61, 23, 83, 165, 551, 1097, 3825, 5385, 4723, 3635}}, {3616, 15, 15917, {1, 3, 7, 15, 9, 31, 11, 121, 503, 855, 561, 1647, 1229, 1147, 15997}}, {3617, 15, 15923, {1, 3, 7, 13, 21, 47, 41, 195, 197, 719, 1263, 3609, 7515, 2659, 30713}}, {3618, 15, 15930, {1, 1, 1, 7, 31, 61, 101, 101, 479, 571, 605, 301, 6633, 15587, 23665}}, {3619, 15, 15937, {1, 3, 7, 3, 25, 39, 35, 225, 135, 463, 53, 709, 5129, 4135, 10421}}, {3620, 15, 15958, {1, 1, 5, 13, 19, 55, 107, 15, 163, 287, 673, 899, 5197, 4619, 3465}}, {3621, 15, 15977, {1, 3, 3, 5, 21, 49, 15, 105, 283, 877, 1875, 1079, 3431, 13053, 26599}}, {3622, 15, 15991, {1, 1, 7, 1, 1, 1, 95, 113, 119, 575, 1159, 2325, 6895, 12177, 4369}}, {3623, 15, 16007, {1, 1, 1, 11, 25, 25, 83, 207, 301, 729, 1947, 2321, 3621, 15707, 11303}}, {3624, 15, 16011, {1, 1, 5, 5, 7, 63, 83, 105, 211, 175, 1817, 2883, 5385, 7437, 24865}}, {3625, 15, 16014, {1, 3, 7, 5, 23, 39, 19, 211, 151, 295, 573, 223, 5065, 6345, 23187}}, {3626, 15, 16021, {1, 1, 7, 11, 15, 31, 89, 123, 57, 695, 685, 1799, 659, 9929, 22933}}, {3627, 15, 16022, {1, 1, 7, 7, 19, 17, 27, 137, 117, 141, 1481, 869, 7061, 3073, 19671}}, {3628, 15, 16028, {1, 3, 3, 11, 9, 19, 123, 93, 39, 517, 883, 3769, 2267, 8089, 6617}}, {3629, 15, 16035, {1, 3, 1, 7, 9, 61, 51, 241, 319, 853, 1239, 899, 105, 1677, 29351}}, {3630, 15, 16041, {1, 1, 7, 15, 13, 59, 85, 175, 223, 87, 905, 3175, 3405, 3489, 18475}}, {3631, 15, 16056, {1, 1, 1, 15, 1, 55, 79, 97, 315, 605, 851, 4015, 3689, 9371, 31523}}, {3632, 15, 16069, {1, 1, 5, 15, 1, 39, 91, 27, 211, 881, 1375, 2307, 5791, 10185, 23093}}, {3633, 15, 16076, {1, 3, 1, 5, 3, 17, 59, 219, 105, 623, 21, 2843, 3427, 4799, 3793}}, {3634, 15, 16081, {1, 3, 3, 7, 21, 55, 17, 29, 397, 93, 1981, 4047, 935, 5971, 14589}}, {3635, 15, 16087, {1, 1, 3, 9, 5, 57, 63, 27, 373, 815, 167, 205, 367, 4945, 30041}}, {3636, 15, 16088, {1, 1, 5, 9, 7, 3, 69, 35, 197, 309, 1729, 3735, 1523, 10427, 26253}}, {3637, 15, 16110, {1, 1, 3, 7, 7, 49, 35, 189, 297, 311, 2025, 305, 3863, 14393, 2533}}, {3638, 15, 16112, {1, 3, 3, 9, 17, 31, 5, 17, 167, 601, 909, 3149, 2533, 12123, 25325}}, {3639, 15, 16117, {1, 3, 5, 3, 11, 41, 69, 199, 79, 611, 133, 3519, 5955, 4609, 27403}}, {3640, 15, 16150, {1, 3, 3, 13, 3, 17, 53, 165, 361, 797, 1447, 869, 6707, 6541, 32249}}, {3641, 15, 16153, {1, 3, 1, 1, 29, 47, 17, 45, 473, 199, 1595, 3095, 3635, 6965, 21859}}, {3642, 15, 16160, {1, 1, 3, 9, 1, 15, 59, 163, 91, 811, 1087, 1707, 6743, 12643, 29901}}, {3643, 15, 16166, {1, 1, 1, 3, 19, 21, 7, 209, 121, 821, 709, 1085, 5333, 7689, 28355}}, {3644, 15, 16172, {1, 3, 1, 15, 5, 27, 115, 31, 37, 79, 1347, 155, 3709, 13251, 32151}}, {3645, 15, 16190, {1, 3, 7, 15, 27, 27, 127, 231, 137, 205, 1665, 1461, 299, 2797, 879}}, {3646, 15, 16195, {1, 1, 1, 7, 13, 3, 127, 13, 253, 481, 1435, 1895, 2665, 7611, 17761}}, {3647, 15, 16204, {1, 1, 3, 7, 7, 21, 71, 247, 301, 183, 1785, 331, 4835, 2251, 4493}}, {3648, 15, 16216, {1, 3, 7, 9, 9, 1, 77, 169, 103, 647, 1959, 1847, 5803, 3421, 15915}}, {3649, 15, 16222, {1, 3, 1, 7, 19, 17, 81, 45, 263, 549, 1607, 2177, 1117, 14427, 16451}}, {3650, 15, 16228, {1, 1, 7, 15, 27, 25, 27, 27, 33, 813, 1667, 253, 2749, 927, 29707}}, {3651, 15, 16245, {1, 1, 7, 3, 17, 29, 13, 67, 417, 303, 19, 3809, 7225, 12775, 3933}}, {3652, 15, 16255, {1, 1, 1, 11, 13, 41, 77, 217, 281, 659, 1099, 3047, 1619, 525, 4313}}, {3653, 15, 16265, {1, 3, 3, 9, 23, 47, 5, 33, 219, 531, 77, 2307, 1893, 8335, 8281}}, {3654, 15, 16273, {1, 3, 7, 3, 3, 35, 27, 249, 159, 495, 431, 3001, 1475, 11505, 15693}}, {3655, 15, 16276, {1, 1, 5, 9, 21, 49, 43, 159, 465, 959, 179, 993, 121, 11569, 21027}}, {3656, 15, 16283, {1, 3, 1, 5, 1, 61, 9, 221, 231, 55, 191, 2829, 3331, 8911, 15109}}, {3657, 15, 16295, {1, 1, 7, 1, 7, 35, 67, 97, 159, 191, 935, 3151, 6397, 10751, 1835}}, {3658, 15, 16304, {1, 1, 1, 7, 15, 39, 127, 163, 437, 333, 829, 753, 8151, 13239, 523}}, {3659, 15, 16313, {1, 1, 3, 13, 9, 25, 73, 155, 445, 239, 2035, 15, 5243, 15531, 1733}}, {3660, 15, 16319, {1, 3, 7, 15, 5, 25, 3, 55, 117, 57, 783, 1509, 7043, 13159, 8557}}, {3661, 15, 16328, {1, 3, 5, 1, 21, 55, 89, 119, 199, 79, 161, 1597, 3263, 3335, 5757}}, {3662, 15, 16345, {1, 3, 7, 5, 27, 23, 85, 113, 111, 211, 389, 1513, 2759, 7945, 931}}, {3663, 15, 16355, {1, 1, 1, 7, 1, 5, 17, 177, 357, 619, 5, 2583, 621, 2973, 28845}}, {3664, 15, 16364, {1, 3, 7, 13, 11, 21, 47, 99, 421, 279, 1541, 1305, 4571, 6127, 20735}}, {3665, 15, 16372, {1, 3, 5, 5, 23, 43, 19, 137, 425, 409, 1625, 2671, 4385, 3197, 25753}}, {3666, 15, 16375, {1, 1, 7, 5, 27, 17, 57, 15, 383, 181, 951, 2115, 5237, 1495, 9671}}, {3667, 15, 16382, {1, 3, 3, 11, 9, 1, 53, 127, 375, 499, 1487, 121, 1465, 3175, 24337}}, {3668, 16, 22, {1, 3, 7, 11, 29, 35, 67, 129, 221, 439, 1159, 3501, 7741, 8885, 11381, 20707}}, {3669, 16, 28, {1, 3, 5, 11, 29, 59, 23, 117, 343, 637, 1825, 1687, 2823, 11641, 3311, 23603}}, {3670, 16, 31, {1, 1, 5, 11, 1, 35, 103, 155, 233, 575, 1761, 503, 4175, 6105, 29737, 32681}}, {3671, 16, 41, {1, 3, 3, 1, 5, 63, 27, 71, 245, 433, 1779, 2475, 5479, 4705, 10795, 34247}}, {3672, 16, 94, {1, 3, 5, 7, 29, 45, 117, 5, 393, 849, 843, 3131, 6995, 9979, 28907, 30115}}, {3673, 16, 107, {1, 3, 5, 9, 27, 29, 69, 5, 395, 561, 1531, 409, 2779, 8785, 16405, 27315}}, {3674, 16, 151, {1, 3, 1, 9, 15, 29, 85, 3, 331, 19, 1941, 567, 6957, 747, 1627, 11347}}, {3675, 16, 158, {1, 1, 3, 9, 27, 45, 47, 127, 133, 921, 1817, 2231, 6333, 14371, 12799, 9831}}, {3676, 16, 167, {1, 1, 5, 15, 31, 7, 125, 13, 455, 159, 331, 3629, 4705, 11261, 3657, 36307}}, {3677, 16, 174, {1, 1, 5, 9, 11, 53, 51, 35, 87, 885, 1975, 3899, 1013, 7667, 32385, 33635}}, {3678, 16, 203, {1, 1, 1, 3, 7, 45, 107, 177, 193, 765, 731, 139, 5563, 623, 16485, 54999}}, {3679, 16, 208, {1, 1, 5, 9, 17, 53, 117, 69, 385, 587, 1483, 149, 2769, 3013, 18183, 10173}}, {3680, 16, 214, {1, 1, 5, 11, 5, 3, 25, 153, 351, 749, 801, 3077, 3209, 11189, 25241, 14115}}, {3681, 16, 223, {1, 1, 7, 9, 1, 47, 41, 247, 135, 163, 899, 1517, 5647, 10595, 32531, 12497}}, {3682, 16, 227, {1, 3, 5, 11, 5, 61, 111, 215, 251, 279, 825, 2155, 3527, 173, 10973, 59257}}, {3683, 16, 266, {1, 3, 5, 11, 25, 15, 71, 83, 135, 231, 1415, 3761, 7513, 8337, 28979, 43615}}, {3684, 16, 268, {1, 3, 5, 13, 19, 5, 55, 165, 141, 119, 1891, 2255, 4735, 16217, 26195, 50527}}, {3685, 16, 274, {1, 1, 7, 15, 23, 59, 59, 191, 1, 855, 453, 2619, 5013, 14749, 24335, 44339}}, {3686, 16, 279, {1, 1, 1, 13, 15, 41, 51, 147, 229, 495, 1191, 867, 1525, 581, 29713, 26391}}, {3687, 16, 302, {1, 1, 1, 9, 29, 5, 59, 127, 105, 417, 301, 2249, 6335, 3513, 17373, 52977}}, {3688, 16, 310, {1, 1, 3, 7, 21, 27, 109, 143, 63, 347, 1429, 2889, 2597, 10243, 9913, 22687}}, {3689, 16, 322, {1, 3, 5, 5, 7, 3, 125, 147, 313, 351, 1163, 415, 5615, 5571, 7089, 55621}}, {3690, 16, 328, {1, 3, 3, 3, 31, 43, 101, 93, 9, 671, 135, 333, 2169, 11169, 7403, 50707}}, {3691, 16, 336, {1, 1, 7, 13, 15, 33, 125, 155, 227, 827, 1047, 2441, 3007, 10881, 19969, 63805}}, {3692, 16, 370, {1, 3, 3, 5, 31, 33, 29, 249, 159, 797, 1475, 841, 6933, 6417, 25629, 61865}}, {3693, 16, 398, {1, 3, 3, 15, 11, 55, 11, 117, 149, 911, 1589, 3133, 6477, 6123, 10471, 41099}}, {3694, 16, 421, {1, 3, 3, 9, 27, 37, 1, 119, 509, 969, 831, 3771, 2093, 13621, 31737, 43269}}, {3695, 16, 436, {1, 1, 1, 1, 9, 23, 119, 109, 487, 753, 1673, 2163, 3349, 4741, 29971, 3407}}, {3696, 16, 440, {1, 3, 3, 7, 25, 7, 67, 9, 461, 631, 651, 2271, 5663, 2621, 3953, 20975}}, {3697, 16, 451, {1, 1, 5, 11, 13, 31, 29, 255, 371, 517, 845, 3649, 1187, 10061, 22887, 58417}}, {3698, 16, 454, {1, 3, 5, 13, 29, 1, 11, 137, 151, 249, 167, 1243, 997, 11023, 11875, 42315}}, {3699, 16, 463, {1, 1, 5, 5, 5, 55, 103, 71, 255, 1023, 209, 1005, 2147, 11527, 17863, 6661}}, {3700, 16, 465, {1, 1, 3, 3, 31, 39, 7, 151, 353, 775, 1313, 1257, 4197, 2625, 9571, 27269}}, {3701, 16, 494, {1, 1, 1, 3, 7, 17, 3, 127, 501, 503, 1879, 2329, 3049, 10603, 2111, 33189}}, {3702, 16, 508, {1, 3, 3, 7, 13, 59, 93, 13, 375, 483, 1991, 2257, 3003, 1699, 4339, 51827}}, {3703, 16, 532, {1, 3, 7, 15, 27, 41, 59, 225, 405, 807, 1545, 2581, 1173, 14137, 3413, 39299}}, {3704, 16, 555, {1, 1, 1, 3, 9, 23, 37, 123, 465, 1023, 1065, 1455, 5107, 3839, 20451, 11461}}, {3705, 16, 563, {1, 1, 1, 11, 19, 55, 91, 121, 317, 199, 215, 3031, 7223, 11891, 21463, 64921}}, {3706, 16, 577, {1, 3, 7, 11, 19, 5, 5, 115, 399, 219, 71, 1465, 281, 14451, 26807, 42541}}, {3707, 16, 580, {1, 3, 5, 13, 3, 33, 75, 35, 19, 559, 761, 947, 7479, 15325, 31453, 20561}}, {3708, 16, 584, {1, 3, 3, 13, 23, 47, 99, 73, 331, 353, 401, 1737, 6235, 13781, 5547, 56443}}, {3709, 16, 607, {1, 3, 3, 13, 21, 37, 41, 205, 87, 399, 51, 3175, 7403, 12875, 21129, 7079}}, {3710, 16, 608, {1, 3, 5, 11, 15, 47, 33, 39, 465, 871, 277, 2351, 695, 1953, 24293, 20595}}, {3711, 16, 665, {1, 1, 7, 11, 13, 15, 115, 59, 469, 715, 191, 1927, 905, 13463, 29005, 46789}}, {3712, 16, 675, {1, 3, 5, 9, 13, 55, 79, 17, 265, 887, 905, 3985, 6907, 3379, 20055, 58569}}, {3713, 16, 692, {1, 1, 7, 11, 21, 29, 23, 109, 17, 427, 1623, 2219, 3857, 3709, 25033, 63823}}, {3714, 16, 707, {1, 3, 5, 15, 19, 27, 113, 15, 25, 63, 1885, 2693, 5301, 9385, 14137, 26097}}, {3715, 16, 737, {1, 3, 3, 11, 17, 5, 73, 143, 79, 957, 461, 1709, 4909, 2285, 18113, 8401}}, {3716, 16, 750, {1, 1, 3, 7, 9, 9, 101, 127, 137, 755, 1359, 1965, 83, 13335, 27763, 7941}}, {3717, 16, 757, {1, 1, 1, 3, 13, 61, 95, 61, 295, 615, 555, 2163, 8155, 14043, 21465, 46741}}, {3718, 16, 800, {1, 1, 1, 13, 29, 19, 111, 17, 373, 153, 1703, 2199, 7209, 15845, 1879, 7493}}, {3719, 16, 805, {1, 3, 1, 13, 21, 51, 49, 51, 255, 151, 207, 1915, 7629, 2705, 8739, 7467}}, {3720, 16, 809, {1, 3, 7, 5, 21, 21, 23, 193, 467, 739, 519, 2315, 2953, 10633, 9163, 6007}}, {3721, 16, 837, {1, 3, 1, 5, 23, 19, 23, 247, 93, 297, 1089, 2349, 4683, 13609, 7615, 18647}}, {3722, 16, 865, {1, 1, 3, 3, 21, 39, 19, 71, 93, 1, 133, 3531, 7503, 2819, 24211, 1739}}, {3723, 16, 949, {1, 3, 5, 13, 9, 43, 31, 111, 493, 739, 705, 2715, 3613, 11877, 27945, 46053}}, {3724, 16, 950, {1, 1, 7, 13, 27, 59, 103, 129, 53, 531, 1379, 1441, 5341, 14937, 5079, 39881}}, {3725, 16, 956, {1, 1, 3, 3, 11, 63, 91, 95, 433, 393, 715, 809, 591, 4141, 17417, 54107}}, {3726, 16, 961, {1, 3, 5, 1, 7, 25, 25, 175, 205, 803, 183, 1441, 1279, 2753, 20001, 56677}}, {3727, 16, 1016, {1, 1, 5, 3, 13, 23, 77, 25, 133, 137, 1907, 1313, 2463, 14339, 13, 57757}}, {3728, 16, 1030, {1, 1, 5, 9, 23, 35, 1, 119, 111, 61, 403, 1815, 1985, 5651, 10883, 55943}}, {3729, 16, 1072, {1, 3, 1, 7, 21, 43, 115, 7, 107, 719, 759, 1521, 467, 8735, 29785, 63821}}, {3730, 16, 1119, {1, 1, 3, 13, 19, 17, 51, 141, 399, 569, 703, 2221, 2809, 13355, 1907, 15837}}, {3731, 16, 1130, {1, 1, 5, 15, 15, 53, 57, 31, 481, 69, 1439, 4049, 6727, 11307, 20683, 63517}}, {3732, 16, 1135, {1, 1, 1, 3, 13, 27, 9, 255, 363, 131, 1745, 2489, 6451, 6585, 12873, 35405}}, {3733, 16, 1137, {1, 3, 5, 1, 17, 31, 113, 135, 449, 915, 1017, 2317, 6821, 5483, 30707, 45279}}, {3734, 16, 1144, {1, 3, 5, 1, 13, 47, 25, 53, 413, 545, 1777, 3049, 7527, 9689, 25935, 9919}}, {3735, 16, 1149, {1, 3, 7, 11, 17, 39, 13, 131, 295, 517, 1755, 2977, 6267, 12351, 8957, 17765}}, {3736, 16, 1180, {1, 1, 7, 5, 27, 57, 47, 21, 125, 429, 1169, 1717, 5455, 16359, 29065, 6671}}, {3737, 16, 1214, {1, 1, 5, 5, 21, 15, 79, 241, 83, 515, 859, 2351, 3125, 7465, 30475, 19759}}, {3738, 16, 1221, {1, 3, 1, 9, 11, 5, 81, 11, 7, 221, 141, 3329, 3435, 323, 18999, 54735}}, {3739, 16, 1234, {1, 1, 1, 15, 7, 57, 87, 251, 63, 561, 929, 1367, 2511, 14527, 9335, 38775}}, {3740, 16, 1239, {1, 3, 3, 9, 23, 37, 59, 105, 179, 515, 235, 2445, 433, 13039, 27005, 48829}}, {3741, 16, 1249, {1, 1, 1, 1, 23, 37, 103, 31, 89, 921, 1687, 831, 387, 10237, 1241, 19295}}, {3742, 16, 1250, {1, 3, 3, 7, 25, 23, 57, 251, 309, 579, 603, 807, 7383, 8579, 4025, 16757}}, {3743, 16, 1267, {1, 1, 3, 15, 23, 59, 29, 33, 467, 641, 1271, 2915, 2549, 14767, 26557, 43483}}, {3744, 16, 1273, {1, 1, 7, 13, 1, 57, 23, 129, 321, 75, 189, 4087, 5011, 4355, 25759, 37153}}, {3745, 16, 1342, {1, 1, 5, 1, 21, 57, 25, 183, 37, 669, 259, 1381, 877, 10245, 16643, 61035}}, {3746, 16, 1344, {1, 1, 7, 5, 11, 11, 85, 141, 393, 957, 1745, 2243, 1681, 5583, 16527, 12017}}, {3747, 16, 1373, {1, 1, 5, 15, 23, 31, 5, 169, 287, 527, 1831, 2937, 7533, 9739, 24305, 2239}}, {3748, 16, 1378, {1, 1, 7, 1, 7, 13, 3, 243, 189, 309, 607, 3659, 6369, 7649, 24255, 55373}}, {3749, 16, 1408, {1, 1, 1, 3, 3, 59, 103, 209, 287, 913, 1223, 1063, 7715, 6073, 26697, 25671}}, {3750, 16, 1417, {1, 3, 7, 5, 19, 19, 117, 191, 275, 637, 991, 2199, 2921, 10553, 21211, 25981}}, {3751, 16, 1418, {1, 3, 3, 5, 29, 59, 17, 13, 127, 57, 1405, 3181, 2237, 1795, 21419, 43421}}, {3752, 16, 1448, {1, 1, 1, 15, 25, 41, 11, 117, 463, 425, 305, 1441, 4307, 7967, 17529, 4043}}, {3753, 16, 1454, {1, 3, 5, 5, 19, 53, 69, 73, 453, 611, 1583, 1721, 6303, 10561, 18527, 48973}}, {3754, 16, 1510, {1, 1, 7, 11, 15, 61, 87, 69, 463, 771, 819, 469, 8165, 8897, 29657, 55161}}, {3755, 16, 1513, {1, 1, 5, 1, 15, 25, 23, 47, 287, 457, 1219, 473, 4127, 3349, 9425, 41541}}, {3756, 16, 1522, {1, 3, 7, 5, 17, 17, 33, 161, 239, 231, 241, 1297, 4879, 12761, 20939, 65261}}, {3757, 16, 1543, {1, 3, 3, 9, 19, 53, 95, 89, 117, 333, 1815, 2217, 7779, 8213, 4667, 58395}}, {3758, 16, 1550, {1, 3, 3, 9, 17, 7, 41, 99, 371, 797, 729, 2851, 2003, 4463, 20793, 54315}}, {3759, 16, 1552, {1, 3, 5, 5, 23, 39, 19, 235, 163, 365, 141, 791, 455, 2761, 9115, 53351}}, {3760, 16, 1588, {1, 3, 3, 3, 9, 27, 29, 139, 165, 867, 2023, 1333, 3771, 10451, 9141, 41177}}, {3761, 16, 1592, {1, 1, 3, 7, 3, 11, 125, 157, 355, 519, 187, 3381, 1151, 1629, 25247, 42797}}, {3762, 16, 1597, {1, 3, 3, 3, 21, 25, 37, 155, 257, 311, 961, 1945, 1383, 5679, 7857, 7183}}, {3763, 16, 1606, {1, 3, 3, 5, 29, 11, 49, 125, 171, 605, 1923, 2781, 2555, 5063, 5075, 43301}}, {3764, 16, 1610, {1, 3, 5, 9, 27, 1, 27, 149, 253, 205, 1299, 2901, 2891, 975, 7641, 8115}}, {3765, 16, 1617, {1, 3, 5, 3, 31, 7, 49, 215, 81, 791, 1485, 837, 5051, 1947, 7521, 25723}}, {3766, 16, 1623, {1, 3, 5, 7, 23, 25, 69, 13, 3, 859, 441, 3577, 1687, 6559, 8687, 46757}}, {3767, 16, 1657, {1, 1, 1, 9, 1, 59, 3, 31, 251, 187, 617, 2607, 4635, 6121, 8565, 8871}}, {3768, 16, 1697, {1, 3, 3, 9, 29, 37, 127, 87, 153, 633, 1691, 2729, 3167, 3219, 21237, 25573}}, {3769, 16, 1729, {1, 1, 5, 13, 19, 63, 93, 235, 299, 621, 405, 663, 6639, 12265, 9303, 42719}}, {3770, 16, 1735, {1, 1, 3, 9, 25, 11, 9, 231, 101, 335, 1793, 1497, 7069, 4171, 30199, 63}}, {3771, 16, 1769, {1, 1, 1, 1, 5, 19, 17, 217, 165, 413, 925, 1409, 6559, 14537, 22057, 44331}}, {3772, 16, 1778, {1, 1, 3, 7, 11, 51, 45, 217, 57, 795, 951, 2933, 6705, 137, 30525, 9679}}, {3773, 16, 1826, {1, 1, 3, 15, 27, 47, 35, 125, 363, 619, 1027, 2861, 3923, 10459, 16789, 27277}}, {3774, 16, 1858, {1, 1, 7, 7, 13, 37, 33, 29, 385, 851, 143, 119, 7345, 4251, 25121, 31609}}, {3775, 16, 1870, {1, 3, 1, 1, 17, 25, 119, 7, 365, 397, 601, 2087, 6903, 15345, 14671, 37889}}, {3776, 16, 1875, {1, 3, 1, 13, 19, 51, 41, 139, 133, 723, 25, 2621, 1257, 7037, 9527, 50037}}, {3777, 16, 1922, {1, 1, 5, 11, 5, 59, 119, 75, 397, 545, 1095, 585, 3271, 1049, 123, 33029}}, {3778, 16, 1924, {1, 1, 7, 11, 9, 27, 21, 197, 177, 31, 453, 2457, 2733, 7787, 1923, 24639}}, {3779, 16, 1933, {1, 1, 7, 13, 29, 13, 91, 91, 243, 279, 601, 1699, 7169, 4727, 7815, 29099}}, {3780, 16, 1972, {1, 3, 7, 5, 1, 35, 27, 235, 163, 913, 1479, 769, 7179, 1983, 25977, 55373}}, {3781, 16, 1979, {1, 3, 5, 11, 9, 33, 99, 141, 301, 109, 1785, 129, 1707, 5181, 4797, 9979}}, {3782, 16, 1987, {1, 1, 1, 13, 3, 47, 89, 43, 293, 87, 1689, 3885, 7747, 5607, 477, 31887}}, {3783, 16, 1994, {1, 1, 5, 1, 9, 21, 73, 37, 45, 621, 1855, 3691, 4899, 2191, 13459, 23543}}, {3784, 16, 2008, {1, 1, 1, 1, 7, 39, 61, 125, 341, 905, 213, 1755, 241, 13407, 8791, 10165}}, {3785, 16, 2023, {1, 1, 1, 1, 19, 31, 79, 19, 55, 875, 1017, 1787, 4879, 533, 15029, 52295}}, {3786, 16, 2029, {1, 3, 1, 1, 9, 59, 113, 71, 113, 649, 561, 71, 5253, 783, 7389, 19361}}, {3787, 16, 2053, {1, 1, 1, 11, 5, 39, 61, 225, 291, 907, 795, 1099, 597, 11829, 15137, 42865}}, {3788, 16, 2081, {1, 3, 1, 5, 25, 11, 71, 155, 271, 309, 1981, 1253, 463, 1133, 20833, 48625}}, {3789, 16, 2087, {1, 3, 5, 9, 7, 41, 87, 241, 457, 899, 1493, 3675, 3025, 10607, 22569, 52813}}, {3790, 16, 2094, {1, 3, 7, 13, 7, 37, 37, 103, 281, 915, 1259, 4049, 559, 173, 4123, 63767}}, {3791, 16, 2111, {1, 3, 7, 15, 13, 57, 9, 51, 39, 549, 1431, 2887, 1081, 4643, 16331, 14221}}, {3792, 16, 2113, {1, 3, 5, 7, 13, 1, 101, 125, 25, 713, 1423, 513, 3323, 9951, 7163, 20969}}, {3793, 16, 2114, {1, 1, 7, 15, 11, 25, 25, 3, 47, 531, 1529, 471, 6191, 10051, 29671, 49085}}, {3794, 16, 2123, {1, 1, 3, 5, 23, 51, 117, 141, 55, 275, 761, 1923, 6267, 2291, 3701, 26615}}, {3795, 16, 2190, {1, 1, 7, 9, 15, 19, 111, 65, 137, 373, 1753, 3591, 1137, 11639, 28591, 27265}}, {3796, 16, 2231, {1, 3, 1, 15, 29, 5, 67, 13, 425, 961, 453, 2481, 1407, 3479, 23303, 30407}}, {3797, 16, 2276, {1, 1, 5, 3, 19, 39, 39, 123, 351, 77, 1339, 1765, 3767, 1907, 13627, 23877}}, {3798, 16, 2285, {1, 3, 5, 9, 23, 7, 103, 177, 221, 197, 561, 2121, 7231, 12053, 30127, 29849}}, {3799, 16, 2297, {1, 1, 5, 7, 15, 1, 3, 123, 197, 493, 171, 2425, 3865, 4061, 31883, 2491}}, {3800, 16, 2336, {1, 1, 3, 13, 29, 33, 99, 67, 327, 969, 1793, 1871, 1839, 13059, 7605, 16797}}, {3801, 16, 2345, {1, 3, 5, 11, 25, 53, 25, 93, 303, 623, 1889, 1471, 1213, 14459, 8527, 25095}}, {3802, 16, 2353, {1, 1, 1, 13, 15, 3, 115, 3, 289, 743, 1855, 359, 2375, 13765, 19711, 40765}}, {3803, 16, 2363, {1, 1, 7, 11, 27, 51, 85, 163, 219, 871, 637, 2011, 5981, 587, 17521, 17333}}, {3804, 16, 2368, {1, 3, 5, 1, 21, 59, 49, 39, 305, 513, 2017, 285, 5817, 13123, 27765, 46741}}, {3805, 16, 2373, {1, 3, 3, 7, 21, 39, 71, 163, 423, 845, 783, 397, 7319, 10677, 13407, 47471}}, {3806, 16, 2391, {1, 3, 7, 5, 21, 59, 99, 179, 473, 687, 1393, 723, 2245, 2933, 25943, 7769}}, {3807, 16, 2402, {1, 1, 5, 9, 5, 45, 71, 189, 165, 555, 643, 2289, 3133, 12319, 22209, 1533}}, {3808, 16, 2413, {1, 1, 3, 9, 7, 43, 1, 155, 323, 169, 339, 2561, 4049, 4953, 5289, 8783}}, {3809, 16, 2422, {1, 3, 1, 11, 15, 5, 25, 201, 267, 891, 561, 501, 575, 15147, 1743, 45237}}, {3810, 16, 2425, {1, 3, 5, 13, 25, 27, 105, 205, 165, 795, 975, 943, 7413, 10299, 14839, 54895}}, {3811, 16, 2461, {1, 1, 5, 1, 17, 43, 69, 103, 449, 917, 103, 945, 513, 709, 11647, 28065}}, {3812, 16, 2462, {1, 1, 3, 15, 23, 51, 23, 7, 159, 743, 177, 3457, 415, 1775, 25353, 36385}}, {3813, 16, 2490, {1, 3, 5, 13, 9, 63, 121, 19, 165, 449, 1523, 1959, 6901, 12281, 29149, 45999}}, {3814, 16, 2492, {1, 3, 7, 11, 17, 19, 9, 155, 373, 753, 1313, 2205, 3571, 16317, 16151, 15325}}, {3815, 16, 2510, {1, 3, 3, 7, 15, 43, 65, 183, 407, 123, 1151, 375, 3461, 6673, 12985, 21005}}, {3816, 16, 2564, {1, 3, 7, 7, 9, 1, 87, 247, 489, 123, 1677, 1947, 7961, 13497, 27919, 28993}}, {3817, 16, 2573, {1, 3, 3, 7, 19, 21, 95, 227, 217, 133, 69, 1535, 699, 3521, 29255, 34733}}, {3818, 16, 2598, {1, 3, 5, 3, 7, 57, 45, 251, 407, 81, 1259, 2425, 2217, 13097, 12773, 14643}}, {3819, 16, 2627, {1, 1, 1, 11, 23, 37, 13, 229, 467, 591, 1521, 469, 3763, 2289, 14233, 24053}}, {3820, 16, 2633, {1, 3, 5, 1, 27, 53, 105, 5, 85, 765, 1973, 2597, 5725, 1063, 18145, 961}}, {3821, 16, 2647, {1, 3, 7, 1, 21, 47, 115, 95, 403, 3, 1593, 3379, 7371, 15553, 12503, 57979}}, {3822, 16, 2660, {1, 1, 3, 1, 1, 35, 121, 29, 379, 245, 919, 2673, 3503, 14197, 31193, 8355}}, {3823, 16, 2664, {1, 3, 5, 11, 19, 49, 97, 7, 195, 1013, 1671, 3415, 2009, 13389, 4837, 27453}}, {3824, 16, 2678, {1, 1, 5, 13, 9, 15, 115, 97, 463, 449, 303, 2681, 1215, 12559, 15685, 21321}}, {3825, 16, 2684, {1, 3, 5, 13, 23, 5, 113, 193, 419, 301, 1121, 317, 5503, 4683, 25519, 65}}, {3826, 16, 2691, {1, 3, 3, 7, 15, 29, 45, 97, 323, 475, 143, 1173, 4033, 8939, 31849, 3575}}, {3827, 16, 2759, {1, 1, 7, 7, 21, 1, 101, 143, 197, 409, 855, 1753, 5211, 3763, 11139, 37309}}, {3828, 16, 2768, {1, 1, 3, 13, 25, 33, 55, 45, 381, 349, 991, 535, 4823, 3701, 31629, 48037}}, {3829, 16, 2773, {1, 3, 1, 11, 17, 51, 27, 57, 409, 551, 949, 365, 8093, 10831, 19697, 39437}}, {3830, 16, 2794, {1, 3, 5, 3, 31, 33, 81, 49, 91, 865, 469, 2115, 377, 8237, 31907, 38239}}, {3831, 16, 2813, {1, 1, 3, 7, 29, 59, 57, 17, 121, 889, 1557, 1797, 5001, 14209, 21355, 59739}}, {3832, 16, 2831, {1, 1, 5, 9, 11, 45, 89, 87, 397, 785, 525, 1593, 5251, 12449, 23579, 54265}}, {3833, 16, 2843, {1, 3, 5, 11, 5, 31, 19, 47, 207, 331, 91, 1691, 5171, 53, 15945, 33349}}, {3834, 16, 2846, {1, 1, 1, 15, 11, 41, 91, 177, 505, 871, 815, 3673, 5631, 9915, 1133, 37861}}, {3835, 16, 2849, {1, 3, 5, 5, 25, 63, 53, 231, 55, 51, 481, 303, 1859, 11973, 28557, 22045}}, {3836, 16, 2856, {1, 1, 5, 3, 27, 11, 37, 91, 363, 411, 1131, 3369, 377, 6585, 7353, 42949}}, {3837, 16, 2893, {1, 3, 1, 9, 31, 63, 83, 23, 405, 941, 119, 1471, 2509, 15507, 29239, 49613}}, {3838, 16, 2901, {1, 1, 5, 1, 11, 63, 117, 237, 407, 231, 1425, 71, 8005, 4023, 9029, 59819}}, {3839, 16, 2924, {1, 1, 5, 7, 1, 9, 43, 87, 351, 63, 1075, 3381, 5447, 2437, 24983, 26905}}, {3840, 16, 2942, {1, 3, 7, 5, 5, 35, 33, 89, 251, 819, 1735, 2625, 6363, 6837, 27603, 26669}}, {3841, 16, 2975, {1, 3, 7, 13, 29, 63, 51, 245, 371, 791, 907, 3499, 3033, 8443, 20023, 1805}}, {3842, 16, 2979, {1, 1, 5, 7, 13, 15, 109, 197, 451, 709, 929, 3193, 5727, 11185, 29479, 1671}}, {3843, 16, 2985, {1, 1, 7, 13, 19, 23, 97, 9, 359, 635, 777, 39, 893, 2531, 13563, 19295}}, {3844, 16, 3020, {1, 1, 5, 1, 31, 63, 55, 7, 157, 877, 991, 1317, 1595, 2019, 21435, 52255}}, {3845, 16, 3025, {1, 1, 5, 3, 19, 37, 23, 13, 335, 431, 483, 615, 2431, 505, 26245, 63323}}, {3846, 16, 3028, {1, 3, 7, 5, 5, 9, 37, 65, 303, 423, 1907, 2661, 7213, 2975, 29045, 16243}}, {3847, 16, 3051, {1, 3, 1, 5, 13, 37, 115, 217, 227, 159, 707, 1387, 943, 4935, 5503, 35171}}, {3848, 16, 3127, {1, 3, 7, 9, 19, 15, 87, 233, 453, 159, 169, 1077, 2129, 413, 19773, 629}}, {3849, 16, 3142, {1, 1, 5, 15, 29, 39, 37, 243, 233, 365, 1843, 2219, 1255, 15287, 603, 13511}}, {3850, 16, 3145, {1, 1, 3, 3, 31, 53, 33, 125, 497, 597, 127, 1829, 3905, 2611, 4263, 40971}}, {3851, 16, 3156, {1, 3, 5, 9, 11, 47, 71, 215, 383, 321, 1445, 135, 5953, 8791, 22073, 16537}}, {3852, 16, 3165, {1, 3, 3, 13, 15, 7, 7, 133, 401, 459, 1117, 3165, 4105, 11943, 22431, 56821}}, {3853, 16, 3196, {1, 1, 7, 9, 31, 39, 19, 7, 19, 401, 79, 3641, 6815, 1489, 7537, 49467}}, {3854, 16, 3199, {1, 3, 7, 7, 17, 11, 91, 205, 251, 321, 515, 3521, 311, 3169, 271, 34749}}, {3855, 16, 3217, {1, 3, 3, 7, 29, 15, 5, 153, 83, 603, 1373, 997, 4939, 9811, 243, 5375}}, {3856, 16, 3218, {1, 1, 3, 11, 21, 47, 25, 221, 237, 177, 535, 2819, 6213, 7877, 26795, 36609}}, {3857, 16, 3253, {1, 3, 7, 3, 31, 1, 69, 73, 47, 653, 139, 1649, 7183, 1293, 26507, 38415}}, {3858, 16, 3258, {1, 1, 1, 13, 17, 41, 23, 73, 115, 509, 787, 3733, 1871, 171, 29967, 39941}}, {3859, 16, 3260, {1, 3, 5, 1, 9, 7, 61, 23, 105, 381, 1421, 2887, 3717, 643, 26375, 57991}}, {3860, 16, 3289, {1, 3, 3, 3, 19, 3, 101, 117, 393, 83, 1255, 3331, 6481, 8661, 20855, 28875}}, {3861, 16, 3314, {1, 3, 5, 11, 21, 13, 111, 193, 51, 899, 159, 1989, 7931, 10511, 3933, 447}}, {3862, 16, 3326, {1, 1, 5, 15, 23, 35, 49, 139, 397, 145, 597, 1847, 7077, 715, 20227, 42183}}, {3863, 16, 3331, {1, 3, 3, 3, 17, 3, 87, 233, 35, 317, 337, 237, 6901, 3439, 20033, 10307}}, {3864, 16, 3371, {1, 3, 5, 3, 11, 35, 13, 171, 7, 963, 1443, 1501, 7617, 963, 25453, 62589}}, {3865, 16, 3381, {1, 1, 1, 5, 11, 9, 39, 175, 409, 411, 1407, 2743, 4255, 989, 15823, 1707}}, {3866, 16, 3396, {1, 1, 7, 13, 27, 55, 63, 239, 355, 417, 2007, 2299, 2921, 1637, 10687, 60615}}, {3867, 16, 3441, {1, 1, 7, 9, 5, 61, 57, 73, 263, 307, 2003, 1763, 639, 5885, 14709, 16985}}, {3868, 16, 3442, {1, 1, 3, 3, 21, 55, 19, 249, 509, 533, 1361, 1397, 2777, 15523, 4389, 13339}}, {3869, 16, 3460, {1, 3, 5, 15, 9, 3, 91, 237, 451, 299, 1541, 4083, 879, 7859, 21585, 14833}}, {3870, 16, 3477, {1, 1, 7, 3, 31, 47, 49, 231, 123, 391, 1633, 2567, 5577, 1631, 27951, 22913}}, {3871, 16, 3491, {1, 3, 7, 13, 11, 13, 1, 111, 183, 87, 839, 1915, 5523, 3677, 13065, 38225}}, {3872, 16, 3493, {1, 1, 3, 7, 15, 15, 63, 241, 167, 345, 653, 701, 4725, 12911, 11545, 24475}}, {3873, 16, 3543, {1, 1, 3, 7, 25, 15, 49, 235, 331, 639, 965, 1117, 7147, 3789, 3309, 20255}}, {3874, 16, 3549, {1, 3, 5, 7, 7, 63, 93, 241, 253, 31, 951, 3723, 3359, 7303, 191, 36427}}, {3875, 16, 3550, {1, 3, 7, 9, 9, 59, 5, 107, 181, 413, 1269, 3121, 1929, 11921, 8931, 47459}}, {3876, 16, 3553, {1, 3, 1, 15, 25, 27, 13, 47, 295, 111, 1287, 2551, 4887, 4145, 17063, 42037}}, {3877, 16, 3563, {1, 3, 3, 13, 17, 17, 21, 17, 491, 845, 1463, 1305, 1375, 16149, 19331, 25043}}, {3878, 16, 3568, {1, 3, 5, 1, 27, 5, 93, 139, 283, 711, 1141, 1743, 5001, 8851, 19351, 12275}}, {3879, 16, 3604, {1, 1, 1, 1, 23, 25, 51, 63, 429, 735, 201, 3785, 6677, 16375, 19681, 17857}}, {3880, 16, 3632, {1, 3, 3, 3, 9, 63, 71, 147, 463, 465, 1163, 1045, 6967, 12537, 31853, 38391}}, {3881, 16, 3650, {1, 3, 7, 1, 5, 51, 79, 239, 389, 3, 601, 3787, 7635, 16295, 1681, 63971}}, {3882, 16, 3662, {1, 3, 1, 3, 5, 31, 103, 89, 321, 971, 783, 3685, 1155, 10353, 2167, 35423}}, {3883, 16, 3674, {1, 1, 5, 15, 25, 19, 93, 59, 361, 217, 1141, 597, 5877, 15961, 1593, 22925}}, {3884, 16, 3685, {1, 3, 1, 9, 25, 59, 69, 89, 477, 89, 487, 237, 5625, 9579, 30421, 21883}}, {3885, 16, 3686, {1, 1, 3, 7, 1, 5, 13, 225, 9, 981, 1081, 1407, 6855, 15215, 21713, 62313}}, {3886, 16, 3700, {1, 1, 7, 15, 11, 13, 119, 109, 151, 245, 1195, 3741, 755, 8047, 15431, 21001}}, {3887, 16, 3703, {1, 3, 7, 3, 17, 47, 107, 137, 99, 255, 1597, 3281, 5779, 13487, 15061, 19199}}, {3888, 16, 3704, {1, 1, 3, 3, 9, 39, 77, 227, 511, 839, 1375, 3887, 25, 14763, 13259, 217}}, {3889, 16, 3723, {1, 3, 5, 7, 17, 3, 87, 61, 439, 287, 709, 4085, 4251, 8945, 28203, 24011}}, {3890, 16, 3743, {1, 3, 1, 1, 29, 25, 49, 101, 209, 359, 285, 1593, 4161, 2943, 23225, 6381}}, {3891, 16, 3753, {1, 1, 3, 13, 1, 45, 87, 7, 491, 399, 905, 1403, 4791, 7419, 14355, 47767}}, {3892, 16, 3756, {1, 1, 7, 15, 13, 25, 111, 197, 297, 301, 499, 4007, 2235, 7681, 4641, 32447}}, {3893, 16, 3759, {1, 1, 3, 3, 27, 41, 97, 83, 405, 353, 1609, 201, 1503, 10673, 29377, 20445}}, {3894, 16, 3762, {1, 1, 7, 3, 9, 47, 65, 191, 207, 545, 377, 3011, 7361, 3467, 14073, 46769}}, {3895, 16, 3771, {1, 1, 7, 5, 7, 39, 9, 91, 187, 949, 1829, 161, 3689, 4145, 32675, 23263}}, {3896, 16, 3776, {1, 1, 5, 9, 29, 9, 83, 113, 77, 673, 613, 3645, 6671, 8583, 27701, 18615}}, {3897, 16, 3779, {1, 3, 5, 9, 29, 13, 127, 247, 285, 845, 463, 539, 4441, 1867, 12469, 16213}}, {3898, 16, 3839, {1, 3, 7, 15, 1, 29, 47, 157, 239, 595, 563, 1103, 3431, 2849, 28125, 19969}}, {3899, 16, 3856, {1, 1, 1, 15, 25, 13, 1, 131, 57, 257, 2021, 169, 7603, 10721, 21675, 63171}}, {3900, 16, 3871, {1, 3, 5, 3, 5, 19, 31, 57, 275, 381, 775, 681, 1145, 12237, 5141, 29375}}, {3901, 16, 3887, {1, 3, 5, 13, 27, 13, 47, 201, 267, 581, 1563, 3845, 951, 7209, 27253, 19755}}, {3902, 16, 3896, {1, 3, 5, 15, 19, 35, 57, 17, 61, 273, 967, 3029, 1747, 1753, 31321, 23711}}, {3903, 16, 3901, {1, 1, 1, 5, 13, 13, 7, 177, 335, 393, 1401, 1411, 4703, 8259, 1281, 39835}}, {3904, 16, 3916, {1, 1, 3, 15, 25, 27, 27, 121, 183, 105, 663, 1375, 6987, 7151, 13763, 39323}}, {3905, 16, 3919, {1, 3, 7, 5, 15, 1, 81, 129, 455, 163, 675, 81, 3735, 14409, 7269, 16425}}, {3906, 16, 3937, {1, 3, 3, 11, 13, 7, 79, 157, 165, 663, 229, 3539, 1837, 6485, 30729, 42157}}, {3907, 16, 3943, {1, 1, 5, 15, 9, 9, 9, 47, 133, 863, 43, 1461, 511, 13991, 24781, 19221}}, {3908, 16, 3955, {1, 3, 1, 7, 31, 33, 103, 13, 159, 689, 1353, 4025, 6051, 7683, 1741, 30047}}, {3909, 16, 3961, {1, 1, 3, 11, 5, 45, 71, 219, 475, 585, 1207, 3163, 4661, 4713, 12729, 30445}}, {3910, 16, 3988, {1, 3, 7, 5, 5, 53, 101, 227, 129, 521, 91, 1129, 4683, 11235, 24697, 45055}}, {3911, 16, 3997, {1, 1, 3, 13, 1, 43, 7, 1, 73, 857, 1713, 185, 1685, 2369, 24187, 40419}}, {3912, 16, 4011, {1, 1, 7, 7, 21, 7, 13, 177, 503, 1003, 1091, 2411, 1433, 9063, 13901, 3329}}, {3913, 16, 4026, {1, 1, 7, 1, 7, 41, 99, 203, 325, 249, 1763, 545, 2981, 14125, 7815, 11385}}, {3914, 16, 4033, {1, 3, 7, 11, 3, 11, 95, 137, 325, 701, 1177, 1631, 4483, 2955, 30229, 25577}}, {3915, 16, 4045, {1, 1, 7, 7, 17, 45, 77, 103, 143, 97, 1963, 3635, 1539, 10491, 23483, 22767}}, {3916, 16, 4060, {1, 1, 7, 15, 7, 5, 81, 63, 243, 55, 39, 207, 2315, 8285, 8155, 11631}}, {3917, 16, 4063, {1, 3, 5, 15, 23, 19, 115, 9, 125, 851, 161, 3767, 3513, 1855, 11139, 1719}}, {3918, 16, 4064, {1, 3, 7, 11, 11, 23, 15, 13, 235, 5, 1039, 1425, 6485, 5539, 8967, 64809}}, {3919, 16, 4126, {1, 3, 5, 7, 19, 11, 83, 135, 45, 905, 1081, 1857, 3185, 13555, 21365, 38143}}, {3920, 16, 4136, {1, 1, 5, 1, 25, 27, 119, 109, 167, 847, 1539, 2653, 797, 11185, 23501, 22389}}, {3921, 16, 4167, {1, 1, 7, 7, 11, 3, 51, 97, 277, 557, 207, 3645, 825, 8521, 26653, 60071}}, {3922, 16, 4173, {1, 3, 3, 15, 17, 35, 57, 7, 267, 549, 97, 243, 1137, 10311, 6737, 19077}}, {3923, 16, 4188, {1, 1, 1, 15, 23, 33, 27, 203, 415, 1023, 1145, 1881, 7715, 4413, 3727, 5185}}, {3924, 16, 4195, {1, 1, 3, 3, 13, 47, 63, 13, 75, 505, 595, 2911, 4029, 14187, 23151, 42877}}, {3925, 16, 4226, {1, 1, 5, 15, 23, 5, 11, 65, 147, 675, 1961, 2177, 727, 15077, 23759, 10195}}, {3926, 16, 4291, {1, 3, 5, 9, 9, 39, 69, 229, 341, 627, 1331, 3139, 3921, 9219, 14887, 4659}}, {3927, 16, 4298, {1, 1, 7, 3, 1, 35, 49, 71, 165, 83, 719, 2771, 6475, 7821, 16709, 4449}}, {3928, 16, 4308, {1, 3, 5, 5, 23, 15, 3, 57, 465, 77, 121, 3767, 6841, 13601, 12035, 14075}}, {3929, 16, 4312, {1, 1, 7, 3, 3, 23, 45, 131, 287, 941, 713, 415, 6865, 14209, 29555, 55493}}, {3930, 16, 4336, {1, 3, 5, 11, 29, 35, 55, 75, 225, 779, 569, 1795, 1377, 12765, 19081, 47287}}, {3931, 16, 4371, {1, 3, 7, 3, 31, 47, 127, 89, 157, 737, 1395, 3615, 7923, 14731, 15797, 40061}}, {3932, 16, 4378, {1, 1, 1, 11, 21, 37, 21, 59, 9, 141, 193, 3095, 3435, 12371, 26931, 61861}}, {3933, 16, 4384, {1, 1, 3, 7, 13, 51, 15, 153, 77, 1013, 651, 3949, 6229, 14297, 1039, 46139}}, {3934, 16, 4393, {1, 3, 3, 13, 7, 43, 95, 61, 217, 3, 549, 739, 123, 3661, 15375, 13919}}, {3935, 16, 4421, {1, 3, 5, 9, 13, 37, 101, 89, 55, 413, 1089, 775, 7575, 13063, 31393, 29583}}, {3936, 16, 4425, {1, 1, 3, 9, 25, 63, 119, 143, 499, 145, 603, 2067, 4713, 13457, 14053, 117}}, {3937, 16, 4439, {1, 1, 5, 9, 7, 23, 57, 253, 115, 591, 2003, 63, 7615, 11493, 28519, 47087}}, {3938, 16, 4440, {1, 1, 7, 3, 7, 53, 121, 33, 233, 645, 1093, 1697, 7213, 2603, 10743, 51303}}, {3939, 16, 4500, {1, 3, 5, 7, 13, 31, 17, 125, 93, 969, 159, 1529, 7165, 7371, 8707, 56953}}, {3940, 16, 4514, {1, 3, 3, 1, 13, 9, 91, 25, 171, 843, 1635, 2043, 1043, 15893, 11409, 53689}}, {3941, 16, 4523, {1, 3, 5, 7, 13, 19, 89, 97, 203, 923, 1109, 2061, 463, 11703, 8925, 56015}}, {3942, 16, 4534, {1, 3, 5, 11, 5, 21, 79, 237, 195, 649, 717, 211, 919, 12855, 3045, 39659}}, {3943, 16, 4593, {1, 1, 1, 15, 13, 19, 21, 69, 393, 257, 1263, 309, 3209, 8403, 24467, 6467}}, {3944, 16, 4615, {1, 1, 1, 11, 7, 27, 59, 117, 379, 353, 943, 2513, 3869, 4567, 12989, 13139}}, {3945, 16, 4630, {1, 1, 1, 3, 13, 43, 11, 15, 149, 237, 1555, 71, 2357, 15773, 21419, 40571}}, {3946, 16, 4636, {1, 3, 1, 9, 19, 23, 59, 215, 15, 921, 1729, 249, 3785, 7171, 1233, 3449}}, {3947, 16, 4645, {1, 1, 1, 7, 7, 37, 63, 205, 75, 599, 951, 2513, 3347, 2497, 8019, 5433}}, {3948, 16, 4684, {1, 3, 3, 15, 27, 17, 25, 201, 23, 699, 1525, 465, 1115, 12299, 14747, 40363}}, {3949, 16, 4687, {1, 1, 1, 3, 29, 59, 115, 233, 107, 815, 291, 3821, 7325, 7381, 21445, 33917}}, {3950, 16, 4723, {1, 3, 1, 11, 11, 33, 107, 171, 421, 893, 587, 3373, 4101, 3885, 25383, 12035}}, {3951, 16, 4735, {1, 3, 3, 7, 5, 23, 43, 51, 357, 77, 1327, 2995, 1321, 1571, 26419, 23603}}, {3952, 16, 4746, {1, 3, 7, 9, 27, 57, 101, 51, 215, 215, 469, 303, 723, 2903, 30569, 42631}}, {3953, 16, 4779, {1, 3, 3, 13, 1, 7, 63, 205, 143, 321, 1439, 253, 2667, 1271, 11761, 55631}}, {3954, 16, 4782, {1, 1, 7, 9, 3, 7, 7, 15, 503, 875, 1619, 1715, 5047, 5665, 5503, 17745}}, {3955, 16, 4793, {1, 1, 7, 15, 19, 49, 65, 31, 245, 371, 377, 2963, 6185, 5519, 10743, 33231}}, {3956, 16, 4796, {1, 1, 7, 3, 25, 27, 115, 51, 299, 451, 285, 1709, 6153, 14881, 17861, 22071}}, {3957, 16, 4813, {1, 3, 1, 5, 21, 21, 127, 185, 325, 995, 213, 3279, 4769, 15943, 2589, 29567}}, {3958, 16, 4850, {1, 3, 7, 5, 21, 9, 63, 59, 159, 743, 663, 2965, 97, 8993, 25633, 29033}}, {3959, 16, 4867, {1, 3, 7, 13, 3, 35, 59, 101, 21, 659, 1531, 3995, 795, 2143, 21749, 52715}}, {3960, 16, 4874, {1, 3, 3, 15, 27, 29, 95, 1, 501, 425, 417, 2351, 7877, 4127, 3633, 23347}}, {3961, 16, 4881, {1, 3, 5, 7, 7, 49, 55, 19, 329, 467, 425, 1609, 6987, 16123, 26879, 42883}}, {3962, 16, 4894, {1, 1, 1, 15, 17, 21, 13, 13, 85, 7, 677, 3739, 5491, 6299, 29957, 55765}}, {3963, 16, 4904, {1, 1, 1, 7, 31, 21, 1, 5, 193, 659, 979, 3409, 3151, 6615, 7445, 8151}}, {3964, 16, 4927, {1, 3, 1, 1, 11, 61, 27, 205, 263, 805, 955, 3469, 1233, 1609, 15329, 13353}}, {3965, 16, 4929, {1, 3, 3, 9, 3, 29, 59, 75, 149, 557, 663, 3887, 3369, 3397, 10611, 9511}}, {3966, 16, 4989, {1, 1, 7, 13, 29, 21, 101, 139, 99, 411, 569, 2343, 6901, 1685, 20599, 49543}}, {3967, 16, 5000, {1, 3, 3, 15, 11, 3, 87, 89, 5, 293, 291, 1405, 1489, 9877, 32505, 32263}}, {3968, 16, 5020, {1, 1, 5, 5, 19, 45, 89, 5, 381, 253, 1339, 707, 4645, 14177, 29441, 8965}}, {3969, 16, 5036, {1, 3, 7, 15, 27, 45, 25, 177, 81, 229, 1339, 2143, 6547, 6841, 23449, 14813}}, {3970, 16, 5041, {1, 1, 1, 3, 27, 23, 81, 157, 53, 513, 1435, 277, 2353, 3545, 21461, 51479}}, {3971, 16, 5059, {1, 3, 1, 3, 3, 17, 75, 139, 283, 881, 1157, 2081, 937, 14549, 10215, 13053}}, {3972, 16, 5074, {1, 1, 7, 9, 25, 27, 27, 133, 21, 559, 225, 613, 6931, 11785, 23413, 35757}}, {3973, 16, 5090, {1, 1, 3, 13, 19, 9, 65, 49, 453, 779, 621, 1151, 1807, 13269, 6515, 17113}}, {3974, 16, 5110, {1, 1, 1, 13, 21, 49, 39, 79, 119, 401, 903, 493, 3779, 7389, 29425, 28091}}, {3975, 16, 5134, {1, 3, 1, 3, 23, 57, 59, 213, 463, 839, 1201, 1951, 5197, 13035, 29657, 35517}}, {3976, 16, 5152, {1, 3, 7, 7, 3, 49, 29, 181, 367, 101, 1277, 3329, 3563, 10373, 29757, 62555}}, {3977, 16, 5176, {1, 3, 1, 7, 31, 31, 117, 213, 373, 57, 1095, 2733, 3431, 3915, 7665, 44459}}, {3978, 16, 5181, {1, 1, 7, 5, 9, 25, 47, 117, 355, 495, 1367, 2579, 5617, 787, 27655, 18885}}, {3979, 16, 5204, {1, 1, 1, 3, 9, 39, 113, 87, 107, 477, 891, 2273, 4239, 7521, 147, 1737}}, {3980, 16, 5218, {1, 1, 1, 3, 13, 61, 81, 225, 113, 441, 889, 1915, 3897, 15179, 4053, 5925}}, {3981, 16, 5242, {1, 1, 5, 3, 15, 47, 59, 187, 475, 197, 1381, 33, 4605, 1487, 14359, 33769}}, {3982, 16, 5253, {1, 3, 7, 15, 23, 45, 53, 215, 129, 465, 795, 53, 7077, 9517, 2663, 55397}}, {3983, 16, 5260, {1, 1, 7, 13, 25, 49, 105, 255, 245, 153, 1093, 2123, 2823, 5125, 17483, 49003}}, {3984, 16, 5281, {1, 1, 1, 13, 31, 5, 7, 243, 255, 231, 1663, 1007, 7573, 405, 29183, 11367}}, {3985, 16, 5282, {1, 1, 5, 13, 15, 15, 115, 91, 63, 1013, 1713, 1945, 6397, 14213, 24417, 40807}}, {3986, 16, 5313, {1, 1, 5, 3, 19, 49, 91, 25, 43, 601, 25, 2405, 1973, 629, 497, 12625}}, {3987, 16, 5316, {1, 1, 3, 5, 13, 45, 11, 81, 251, 545, 1155, 1409, 7187, 847, 2835, 32909}}, {3988, 16, 5326, {1, 3, 1, 13, 27, 57, 1, 103, 465, 809, 1727, 3721, 3347, 3791, 17247, 8377}}, {3989, 16, 5340, {1, 3, 3, 15, 25, 31, 91, 91, 119, 205, 1431, 703, 5327, 7323, 30415, 61955}}, {3990, 16, 5347, {1, 3, 5, 11, 19, 39, 79, 243, 109, 463, 1869, 2133, 4139, 10461, 14793, 24025}}, {3991, 16, 5354, {1, 3, 5, 7, 23, 41, 5, 7, 249, 3, 1743, 489, 4921, 397, 30955, 22207}}, {3992, 16, 5368, {1, 3, 5, 15, 3, 7, 115, 19, 217, 231, 1183, 3723, 5055, 12967, 7855, 5067}}, {3993, 16, 5394, {1, 3, 3, 3, 11, 31, 113, 41, 429, 797, 557, 1199, 1819, 1933, 9917, 32229}}, {3994, 16, 5396, {1, 1, 5, 3, 13, 63, 31, 183, 465, 915, 723, 3227, 4125, 2813, 26313, 34287}}, {3995, 16, 5400, {1, 1, 7, 5, 31, 55, 117, 243, 37, 885, 85, 1067, 3895, 15655, 28527, 32109}}, {3996, 16, 5405, {1, 3, 7, 15, 17, 43, 43, 173, 119, 187, 1161, 599, 4595, 1681, 11981, 681}}, {3997, 16, 5439, {1, 1, 7, 7, 29, 47, 25, 93, 411, 103, 783, 1029, 1927, 3569, 27647, 8281}}, {3998, 16, 5442, {1, 3, 3, 9, 19, 57, 31, 183, 141, 889, 157, 2267, 5701, 6273, 25739, 34039}}, {3999, 16, 5459, {1, 3, 5, 1, 29, 35, 105, 165, 505, 299, 1149, 2397, 2013, 11591, 15917, 4791}}, {4000, 16, 5478, {1, 3, 3, 9, 7, 35, 47, 77, 69, 335, 585, 1131, 531, 8597, 307, 55985}}, {4001, 16, 5484, {1, 3, 7, 1, 29, 9, 25, 155, 149, 845, 567, 3735, 3501, 9365, 12025, 19131}}, {4002, 16, 5508, {1, 3, 5, 3, 11, 31, 25, 9, 411, 519, 1611, 1441, 1487, 10049, 14373, 24605}}, {4003, 16, 5523, {1, 3, 3, 5, 3, 7, 101, 107, 339, 155, 1843, 2529, 443, 8177, 28655, 8151}}, {4004, 16, 5545, {1, 1, 7, 5, 29, 37, 73, 131, 125, 451, 947, 797, 5053, 10155, 30801, 27235}}, {4005, 16, 5565, {1, 1, 7, 13, 19, 47, 101, 45, 495, 457, 1293, 1971, 5495, 12737, 17687, 26123}}, {4006, 16, 5566, {1, 1, 7, 7, 11, 11, 75, 177, 251, 553, 1883, 3379, 1429, 12227, 10301, 16467}}, {4007, 16, 5580, {1, 3, 3, 9, 3, 61, 95, 35, 97, 551, 233, 2045, 4873, 9109, 10019, 64523}}, {4008, 16, 5608, {1, 3, 1, 5, 11, 3, 15, 177, 301, 573, 2029, 191, 5551, 12083, 27287, 57235}}, {4009, 16, 5613, {1, 3, 5, 1, 21, 9, 121, 169, 347, 187, 57, 3163, 5609, 1921, 17581, 28351}}, {4010, 16, 5647, {1, 3, 3, 1, 31, 51, 15, 45, 429, 245, 573, 1595, 5343, 7519, 17009, 1299}}, {4011, 16, 5661, {1, 1, 7, 3, 13, 47, 109, 65, 389, 867, 963, 145, 1089, 9749, 19625, 43121}}, {4012, 16, 5671, {1, 3, 1, 7, 21, 61, 77, 67, 143, 579, 625, 2007, 6343, 4259, 21233, 237}}, {4013, 16, 5678, {1, 3, 5, 9, 27, 15, 107, 91, 399, 895, 645, 2301, 439, 6789, 18299, 47285}}, {4014, 16, 5680, {1, 3, 3, 5, 13, 11, 43, 199, 505, 409, 25, 2057, 479, 6031, 9561, 51613}}, {4015, 16, 5685, {1, 1, 7, 13, 15, 55, 105, 53, 171, 925, 1849, 2881, 6951, 13069, 865, 41019}}, {4016, 16, 5689, {1, 3, 1, 9, 17, 31, 45, 23, 411, 185, 189, 2123, 2583, 12713, 12681, 2231}}, {4017, 16, 5692, {1, 3, 7, 9, 3, 63, 11, 253, 177, 127, 545, 3293, 4449, 15995, 10223, 33529}}, {4018, 16, 5724, {1, 1, 5, 11, 13, 7, 53, 161, 421, 551, 697, 627, 3879, 1639, 24419, 3337}}, {4019, 16, 5745, {1, 1, 7, 7, 27, 7, 37, 205, 429, 407, 1133, 3563, 2921, 6173, 11173, 3009}}, {4020, 16, 5755, {1, 3, 3, 15, 31, 39, 117, 81, 337, 729, 567, 2299, 1481, 3189, 1795, 40299}}, {4021, 16, 5757, {1, 3, 5, 15, 15, 47, 91, 127, 275, 55, 951, 3423, 2879, 6115, 1549, 2287}}, {4022, 16, 5786, {1, 3, 3, 11, 17, 3, 127, 207, 141, 889, 185, 1095, 4567, 1371, 30545, 54445}}, {4023, 16, 5792, {1, 1, 7, 3, 25, 11, 11, 139, 43, 1, 1977, 397, 5775, 6913, 13249, 46767}}, {4024, 16, 5810, {1, 1, 7, 7, 27, 13, 31, 251, 191, 1015, 161, 3719, 5321, 13013, 25187, 51881}}, {4025, 16, 5824, {1, 1, 1, 1, 3, 3, 13, 19, 423, 349, 1955, 2103, 6395, 3315, 23809, 25925}}, {4026, 16, 5869, {1, 3, 5, 13, 3, 59, 41, 167, 423, 93, 1299, 2623, 5829, 8537, 8701, 43757}}, {4027, 16, 5872, {1, 3, 5, 11, 9, 19, 127, 119, 329, 819, 7, 3809, 5305, 3643, 27369, 61827}}, {4028, 16, 5895, {1, 3, 1, 15, 25, 43, 55, 159, 205, 911, 983, 2825, 3751, 7845, 12023, 18431}}, {4029, 16, 5923, {1, 3, 3, 13, 11, 1, 65, 133, 479, 181, 679, 981, 3317, 6241, 11693, 9619}}, {4030, 16, 5925, {1, 3, 3, 3, 21, 25, 117, 183, 127, 73, 703, 1469, 257, 11229, 10167, 50847}}, {4031, 16, 5926, {1, 1, 5, 13, 5, 5, 113, 15, 231, 269, 989, 465, 3267, 15239, 29503, 42855}}, {4032, 16, 5944, {1, 3, 3, 15, 9, 63, 79, 27, 21, 709, 1969, 3761, 1015, 13619, 4205, 40591}}, {4033, 16, 5986, {1, 1, 7, 11, 29, 3, 5, 45, 107, 131, 1287, 3551, 849, 2003, 27451, 47103}}, {4034, 16, 6012, {1, 3, 5, 11, 3, 47, 59, 53, 369, 249, 915, 2475, 7539, 763, 7063, 63971}}, {4035, 16, 6015, {1, 1, 5, 1, 7, 53, 45, 127, 321, 341, 635, 2277, 1383, 10951, 29055, 45087}}, {4036, 16, 6046, {1, 3, 7, 3, 5, 1, 119, 79, 487, 93, 25, 491, 4085, 6403, 27779, 8753}}, {4037, 16, 6049, {1, 1, 1, 3, 9, 59, 49, 141, 323, 703, 1175, 423, 4323, 10083, 4289, 28931}}, {4038, 16, 6061, {1, 3, 3, 15, 31, 31, 73, 15, 187, 653, 91, 1707, 1431, 9861, 19071, 8137}}, {4039, 16, 6067, {1, 1, 1, 5, 27, 63, 93, 1, 329, 353, 863, 473, 7681, 10653, 15819, 8495}}, {4040, 16, 6099, {1, 1, 1, 5, 25, 57, 119, 167, 219, 319, 231, 1065, 6217, 5131, 1513, 49281}}, {4041, 16, 6121, {1, 3, 7, 3, 17, 3, 113, 91, 201, 179, 1907, 3423, 821, 12927, 24827, 49403}}, {4042, 16, 6155, {1, 1, 5, 7, 19, 63, 75, 151, 387, 489, 777, 2049, 1151, 1351, 25687, 4143}}, {4043, 16, 6163, {1, 3, 5, 7, 9, 37, 9, 3, 87, 385, 1667, 2139, 7527, 16133, 30023, 28783}}, {4044, 16, 6203, {1, 1, 5, 9, 11, 55, 95, 73, 413, 867, 589, 2901, 3021, 413, 5955, 38921}}, {4045, 16, 6208, {1, 3, 5, 15, 1, 17, 17, 7, 485, 323, 519, 2325, 2255, 4211, 20661, 28931}}, {4046, 16, 6231, {1, 1, 5, 13, 21, 19, 85, 189, 167, 645, 1475, 3095, 7123, 3351, 7961, 20967}}, {4047, 16, 6241, {1, 1, 7, 13, 3, 47, 13, 213, 237, 291, 285, 1465, 1765, 12361, 32651, 54205}}, {4048, 16, 6254, {1, 3, 7, 13, 13, 27, 71, 35, 67, 117, 647, 2359, 3295, 8445, 24761, 29379}}, {4049, 16, 6262, {1, 1, 1, 3, 3, 19, 23, 37, 5, 1019, 5, 1605, 2291, 14015, 9311, 39751}}, {4050, 16, 6266, {1, 3, 3, 3, 31, 1, 65, 159, 221, 675, 1061, 971, 2333, 8265, 14361, 3263}}, {4051, 16, 6275, {1, 1, 3, 7, 3, 5, 81, 17, 101, 991, 753, 2883, 4977, 4409, 1757, 26803}}, {4052, 16, 6278, {1, 1, 5, 9, 13, 25, 45, 43, 199, 967, 829, 713, 4547, 7223, 6497, 53895}}, {4053, 16, 6292, {1, 1, 7, 5, 23, 15, 89, 179, 509, 147, 315, 133, 111, 15577, 23427, 5229}}, {4054, 16, 6329, {1, 3, 3, 7, 27, 7, 113, 65, 315, 135, 1309, 1179, 5755, 7513, 6815, 5137}}, {4055, 16, 6355, {1, 1, 3, 7, 1, 13, 29, 155, 477, 721, 71, 865, 3897, 3331, 30641, 65471}}, {4056, 16, 6357, {1, 1, 7, 3, 29, 45, 83, 3, 461, 109, 1545, 1365, 6633, 16137, 23859, 5995}}, {4057, 16, 6374, {1, 3, 1, 1, 3, 33, 77, 83, 459, 187, 879, 3731, 6939, 6707, 23409, 24245}}, {4058, 16, 6380, {1, 3, 5, 5, 13, 43, 127, 41, 29, 735, 1391, 2947, 4873, 4627, 15, 41719}}, {4059, 16, 6423, {1, 3, 1, 3, 17, 17, 51, 93, 189, 227, 449, 2809, 825, 2009, 9563, 41435}}, {4060, 16, 6427, {1, 3, 3, 11, 25, 47, 113, 173, 141, 919, 677, 117, 5293, 815, 23749, 19789}}, {4061, 16, 6430, {1, 1, 1, 13, 15, 61, 121, 223, 53, 389, 489, 1527, 4771, 8975, 8005, 14275}}, {4062, 16, 6436, {1, 1, 3, 15, 31, 57, 111, 145, 279, 991, 489, 3239, 7647, 473, 31279, 33447}}, {4063, 16, 6443, {1, 1, 7, 5, 31, 13, 75, 185, 395, 611, 609, 159, 7931, 9887, 4115, 53121}}, {4064, 16, 6445, {1, 3, 5, 5, 13, 39, 103, 237, 77, 913, 511, 1583, 6763, 14523, 4247, 63403}}, {4065, 16, 6458, {1, 1, 1, 15, 11, 5, 43, 43, 297, 827, 747, 5, 3785, 15021, 11291, 36743}}, {4066, 16, 6478, {1, 1, 7, 9, 9, 53, 113, 95, 403, 53, 1335, 4033, 8147, 11963, 6523, 23675}}, {4067, 16, 6490, {1, 1, 5, 9, 27, 29, 69, 79, 327, 409, 1147, 1579, 2625, 12227, 30933, 9057}}, {4068, 16, 6508, {1, 1, 1, 7, 1, 33, 29, 173, 5, 517, 437, 2035, 57, 12825, 22095, 65519}}, {4069, 16, 6519, {1, 1, 3, 7, 27, 29, 53, 79, 429, 707, 589, 2605, 339, 7039, 19319, 17649}}, {4070, 16, 6520, {1, 3, 3, 11, 9, 57, 43, 117, 39, 193, 1427, 2553, 6877, 7653, 29041, 44865}}, {4071, 16, 6530, {1, 3, 3, 7, 23, 45, 29, 151, 265, 739, 365, 3565, 6447, 9761, 24021, 679}}, {4072, 16, 6541, {1, 3, 5, 1, 1, 43, 73, 55, 131, 175, 959, 659, 7315, 15145, 18301, 14865}}, {4073, 16, 6556, {1, 1, 3, 5, 15, 15, 91, 113, 359, 241, 1627, 1069, 1761, 211, 32671, 58833}}, {4074, 16, 6607, {1, 3, 3, 7, 29, 27, 79, 53, 409, 81, 693, 3137, 7385, 11007, 28459, 28621}}, {4075, 16, 6612, {1, 1, 7, 5, 29, 7, 67, 195, 77, 773, 1361, 2153, 4459, 7301, 5129, 17797}}, {4076, 16, 6626, {1, 3, 3, 7, 25, 27, 91, 223, 115, 91, 1645, 2167, 1955, 9601, 22127, 13055}}, {4077, 16, 6632, {1, 3, 7, 3, 27, 53, 67, 249, 51, 151, 663, 3231, 895, 6777, 3037, 56755}}, {4078, 16, 6649, {1, 1, 5, 1, 25, 63, 71, 179, 375, 301, 1127, 2125, 783, 14481, 7293, 47883}}, {4079, 16, 6666, {1, 1, 3, 9, 25, 3, 39, 69, 1, 85, 1271, 1571, 1953, 5077, 20369, 44827}}, {4080, 16, 6674, {1, 3, 1, 13, 11, 61, 77, 59, 127, 475, 1609, 3553, 2553, 15589, 9351, 59787}}, {4081, 16, 6733, {1, 3, 1, 5, 21, 7, 61, 27, 199, 653, 1243, 2481, 5369, 12903, 30229, 39453}}, {4082, 16, 6782, {1, 3, 7, 3, 13, 15, 107, 153, 501, 573, 863, 3179, 6019, 15177, 16075, 43767}}, {4083, 16, 6786, {1, 1, 7, 1, 23, 55, 17, 35, 5, 137, 1707, 1377, 6857, 15361, 27299, 61871}}, {4084, 16, 6798, {1, 3, 5, 7, 27, 17, 87, 213, 95, 125, 1239, 3923, 4193, 11049, 12783, 45017}}, {4085, 16, 6821, {1, 1, 5, 15, 9, 55, 11, 217, 7, 249, 369, 205, 4251, 13785, 24781, 48929}}, {4086, 16, 6840, {1, 3, 7, 1, 15, 35, 33, 107, 503, 563, 1591, 3487, 7495, 1767, 24791, 31281}}, {4087, 16, 6846, {1, 3, 1, 11, 3, 15, 47, 193, 289, 253, 909, 1105, 5119, 1415, 7737, 4341}}, {4088, 16, 6865, {1, 1, 1, 3, 23, 33, 53, 187, 469, 573, 835, 2049, 791, 1177, 31051, 30955}}, {4089, 16, 6884, {1, 3, 3, 11, 15, 51, 77, 143, 369, 991, 1103, 1293, 6019, 6361, 26301, 20741}}, {4090, 16, 6891, {1, 1, 1, 5, 17, 19, 85, 135, 113, 593, 579, 1063, 7173, 2491, 9355, 19223}}, {4091, 16, 6925, {1, 1, 5, 15, 25, 51, 107, 193, 31, 1, 1693, 125, 6223, 14619, 22683, 26321}}, {4092, 16, 6938, {1, 1, 7, 1, 17, 45, 87, 39, 87, 499, 1185, 2763, 3989, 2863, 24555, 33817}}, {4093, 16, 6967, {1, 3, 1, 11, 31, 5, 121, 231, 185, 793, 255, 2785, 5261, 3687, 21711, 3941}}, {4094, 16, 6988, {1, 3, 7, 15, 5, 59, 73, 227, 365, 937, 893, 2155, 4385, 14345, 6813, 28461}}, {4095, 16, 6996, {1, 1, 5, 7, 7, 23, 7, 239, 431, 45, 1015, 1663, 1893, 5035, 24075, 2119}}, {4096, 16, 7009, {1, 3, 5, 1, 3, 15, 63, 103, 119, 801, 1681, 3463, 6083, 6453, 11379, 8205}}, {4097, 16, 7016, {1, 3, 7, 9, 21, 61, 9, 9, 433, 541, 603, 3905, 3787, 10187, 3643, 21319}}, {4098, 16, 7030, {1, 3, 5, 3, 11, 1, 101, 243, 363, 559, 561, 1163, 455, 4657, 1147, 39961}}, {4099, 16, 7043, {1, 3, 5, 13, 17, 37, 57, 47, 483, 571, 1579, 1137, 8125, 12271, 23279, 1615}}, {4100, 16, 7045, {1, 3, 5, 1, 21, 5, 13, 155, 75, 705, 389, 2855, 6345, 2279, 12627, 49451}}, {4101, 16, 7052, {1, 1, 3, 9, 15, 51, 73, 99, 445, 227, 1705, 2175, 8111, 9381, 31555, 48491}}, {4102, 16, 7073, {1, 3, 3, 5, 9, 63, 107, 51, 461, 979, 1033, 421, 4807, 11707, 13261, 26015}}, {4103, 16, 7142, {1, 1, 5, 3, 13, 53, 117, 249, 57, 851, 1391, 3245, 35, 16043, 24399, 63667}}, {4104, 16, 7153, {1, 3, 1, 11, 23, 33, 57, 125, 385, 495, 871, 199, 4269, 2269, 22897, 23597}}, {4105, 16, 7168, {1, 3, 5, 15, 29, 11, 77, 21, 479, 369, 723, 3721, 1121, 9463, 19775, 54525}}, {4106, 16, 7174, {1, 3, 5, 7, 7, 45, 29, 153, 395, 223, 1917, 3713, 5087, 10827, 1383, 36823}}, {4107, 16, 7183, {1, 3, 1, 3, 31, 19, 111, 55, 275, 923, 917, 2925, 673, 6579, 18783, 5137}}, {4108, 16, 7195, {1, 3, 1, 15, 25, 31, 59, 255, 31, 697, 1751, 381, 299, 295, 14037, 40953}}, {4109, 16, 7204, {1, 3, 1, 7, 15, 23, 69, 219, 351, 183, 1083, 2227, 6249, 9385, 13167, 2901}}, {4110, 16, 7214, {1, 3, 7, 1, 5, 61, 117, 13, 67, 521, 41, 2929, 3937, 1215, 25593, 32627}}, {4111, 16, 7222, {1, 3, 5, 1, 9, 47, 63, 39, 371, 657, 491, 2243, 4049, 10517, 12409, 40597}}, {4112, 16, 7267, {1, 3, 7, 15, 17, 3, 77, 13, 275, 225, 487, 2055, 1293, 15927, 31773, 18275}}, {4113, 16, 7269, {1, 1, 5, 13, 11, 57, 113, 27, 191, 363, 1341, 3487, 8031, 13801, 7563, 40675}}, {4114, 16, 7279, {1, 1, 3, 3, 27, 31, 103, 143, 271, 305, 2033, 3623, 4219, 9307, 7501, 8959}}, {4115, 16, 7293, {1, 1, 1, 13, 1, 3, 27, 97, 475, 143, 333, 2997, 1807, 4231, 27437, 59717}}, {4116, 16, 7312, {1, 3, 7, 5, 5, 3, 69, 233, 309, 511, 1429, 1887, 2745, 4969, 17595, 5451}}, {4117, 16, 7327, {1, 1, 7, 3, 23, 17, 115, 89, 265, 467, 257, 2027, 5331, 1195, 4451, 8621}}, {4118, 16, 7334, {1, 1, 7, 13, 29, 35, 117, 155, 99, 327, 853, 3595, 2997, 10745, 21619, 26549}}, {4119, 16, 7337, {1, 3, 3, 13, 1, 13, 75, 151, 67, 271, 1609, 1117, 4293, 4645, 12005, 55983}}, {4120, 16, 7343, {1, 1, 1, 13, 1, 61, 101, 63, 161, 261, 1759, 567, 665, 2339, 9157, 55603}}, {4121, 16, 7346, {1, 1, 7, 11, 25, 19, 71, 27, 255, 435, 227, 4087, 4309, 14903, 14513, 30207}}, {4122, 16, 7372, {1, 3, 3, 3, 11, 41, 1, 67, 383, 403, 45, 1521, 1535, 3353, 27361, 7549}}, {4123, 16, 7387, {1, 1, 1, 1, 13, 51, 31, 137, 147, 907, 19, 3639, 3739, 877, 15005, 60357}}, {4124, 16, 7390, {1, 1, 3, 11, 11, 23, 29, 173, 105, 873, 1727, 2761, 2015, 7491, 17491, 41065}}, {4125, 16, 7396, {1, 1, 5, 3, 31, 1, 119, 53, 11, 731, 393, 4031, 4421, 15715, 6431, 18089}}, {4126, 16, 7423, {1, 1, 3, 5, 15, 37, 55, 147, 307, 521, 711, 3085, 5989, 8081, 23351, 35259}}, {4127, 16, 7428, {1, 3, 5, 13, 21, 19, 47, 107, 447, 713, 1655, 2809, 4741, 2105, 9255, 103}}, {4128, 16, 7437, {1, 3, 1, 3, 17, 47, 63, 125, 343, 763, 1777, 607, 5625, 9517, 7221, 27257}}, {4129, 16, 7466, {1, 1, 7, 5, 31, 13, 67, 255, 41, 947, 99, 721, 7367, 11427, 1357, 12383}}, {4130, 16, 7474, {1, 1, 7, 3, 23, 27, 73, 185, 189, 545, 1877, 3169, 5419, 15873, 29059, 23983}}, {4131, 16, 7476, {1, 1, 3, 1, 5, 13, 81, 45, 79, 717, 819, 3539, 7561, 7319, 5113, 27273}}, {4132, 16, 7483, {1, 3, 7, 9, 21, 25, 71, 247, 41, 583, 771, 3745, 1883, 5717, 755, 14549}}, {4133, 16, 7518, {1, 1, 3, 7, 23, 25, 87, 143, 499, 515, 1753, 1229, 173, 10629, 30579, 29643}}, {4134, 16, 7527, {1, 3, 1, 13, 29, 33, 31, 69, 503, 117, 1717, 101, 7647, 1567, 28677, 3079}}, {4135, 16, 7545, {1, 3, 1, 15, 29, 45, 57, 81, 171, 813, 505, 3647, 3913, 5557, 2477, 42429}}, {4136, 16, 7572, {1, 1, 5, 13, 21, 13, 81, 5, 471, 221, 1563, 1741, 7269, 16327, 22687, 5291}}, {4137, 16, 7586, {1, 3, 5, 3, 23, 41, 107, 61, 95, 79, 467, 1533, 739, 6791, 26911, 20309}}, {4138, 16, 7597, {1, 3, 7, 7, 3, 53, 71, 163, 459, 975, 687, 1115, 5241, 299, 26361, 38583}}, {4139, 16, 7630, {1, 3, 1, 9, 3, 63, 7, 133, 421, 325, 823, 1175, 6201, 5707, 31539, 34645}}, {4140, 16, 7653, {1, 3, 7, 5, 27, 27, 107, 239, 247, 257, 1367, 3685, 7839, 11693, 3237, 13085}}, {4141, 16, 7657, {1, 1, 1, 3, 27, 41, 51, 69, 271, 809, 1453, 519, 1301, 2367, 637, 5267}}, {4142, 16, 7671, {1, 3, 7, 13, 19, 17, 3, 69, 369, 447, 1685, 4075, 6143, 11387, 5411, 29825}}, {4143, 16, 7672, {1, 1, 3, 1, 25, 61, 79, 163, 1, 905, 1969, 2735, 7709, 16121, 20441, 4543}}, {4144, 16, 7715, {1, 3, 7, 5, 15, 29, 7, 245, 343, 803, 1719, 3993, 983, 2925, 10393, 6053}}, {4145, 16, 7717, {1, 3, 1, 7, 17, 55, 63, 29, 441, 387, 885, 3269, 1977, 1927, 3657, 47043}}, {4146, 16, 7732, {1, 1, 3, 1, 17, 59, 51, 9, 173, 327, 1185, 3241, 3785, 10907, 19429, 22209}}, {4147, 16, 7735, {1, 1, 3, 13, 21, 57, 125, 5, 359, 437, 1231, 2441, 5813, 9991, 283, 52555}}, {4148, 16, 7753, {1, 3, 1, 7, 15, 19, 39, 125, 405, 381, 1757, 4075, 5565, 2065, 295, 8867}}, {4149, 16, 7811, {1, 3, 3, 11, 7, 33, 95, 19, 253, 141, 1093, 1787, 7495, 5229, 15923, 44157}}, {4150, 16, 7817, {1, 3, 7, 15, 1, 49, 69, 163, 85, 345, 901, 2329, 8003, 9915, 2209, 33979}}, {4151, 16, 7825, {1, 1, 1, 9, 23, 51, 125, 163, 257, 681, 565, 945, 6375, 8679, 5985, 28919}}, {4152, 16, 7832, {1, 3, 5, 7, 11, 23, 123, 231, 377, 121, 1519, 2061, 2957, 14537, 17625, 37773}}, {4153, 16, 7838, {1, 3, 5, 1, 17, 43, 89, 119, 455, 279, 1857, 3405, 5225, 13035, 6055, 30861}}, {4154, 16, 7841, {1, 3, 7, 15, 31, 63, 25, 225, 3, 527, 355, 1435, 5763, 15203, 26579, 45659}}, {4155, 16, 7844, {1, 1, 1, 3, 27, 43, 71, 193, 135, 5, 683, 925, 7023, 7711, 2807, 56003}}, {4156, 16, 7859, {1, 1, 1, 11, 3, 3, 109, 29, 109, 683, 419, 3295, 1961, 5953, 8887, 1523}}, {4157, 16, 7861, {1, 3, 3, 11, 17, 39, 19, 225, 103, 249, 81, 3875, 4515, 3969, 24745, 60031}}, {4158, 16, 7873, {1, 1, 3, 3, 3, 23, 15, 149, 305, 399, 1347, 1001, 597, 10003, 22123, 29919}}, {4159, 16, 7880, {1, 3, 5, 1, 23, 35, 123, 7, 283, 283, 759, 3061, 2011, 7771, 32201, 40667}}, {4160, 16, 7897, {1, 3, 7, 15, 23, 5, 81, 51, 357, 79, 133, 285, 425, 7743, 13499, 18983}}, {4161, 16, 7904, {1, 3, 3, 5, 17, 37, 75, 221, 473, 111, 335, 683, 7353, 2283, 13457, 61171}}, {4162, 16, 7910, {1, 3, 1, 7, 13, 45, 13, 223, 149, 209, 727, 3553, 2573, 177, 855, 44139}}, {4163, 16, 7960, {1, 1, 3, 15, 23, 5, 103, 139, 17, 29, 1961, 3021, 5745, 12963, 30669, 44171}}, {4164, 16, 7969, {1, 3, 1, 1, 3, 33, 67, 203, 29, 785, 71, 1693, 4487, 10221, 24523, 51223}}, {4165, 16, 7970, {1, 1, 5, 7, 7, 27, 17, 183, 229, 669, 1675, 3751, 3233, 10677, 7509, 52313}}, {4166, 16, 7976, {1, 1, 5, 5, 25, 35, 21, 163, 483, 399, 195, 3465, 6349, 545, 18861, 31759}}, {4167, 16, 7979, {1, 3, 1, 5, 15, 39, 13, 157, 71, 841, 447, 3625, 53, 12745, 2719, 27617}}, {4168, 16, 8007, {1, 1, 5, 5, 3, 45, 113, 121, 263, 887, 709, 2189, 3811, 1409, 10451, 48777}}, {4169, 16, 8041, {1, 1, 5, 15, 9, 41, 31, 95, 377, 215, 437, 3633, 433, 11935, 15283, 55451}}, {4170, 16, 8047, {1, 1, 7, 7, 13, 23, 79, 3, 451, 409, 1103, 1771, 553, 3175, 28703, 49357}}, {4171, 16, 8052, {1, 3, 1, 1, 13, 33, 95, 133, 419, 851, 955, 3985, 5869, 14219, 253, 46883}}, {4172, 16, 8061, {1, 3, 3, 3, 23, 55, 91, 207, 281, 355, 361, 261, 6837, 4401, 25455, 25313}}, {4173, 16, 8078, {1, 3, 5, 9, 27, 9, 107, 51, 69, 555, 835, 3541, 1827, 5737, 31225, 55619}}, {4174, 16, 8128, {1, 1, 1, 11, 27, 51, 79, 85, 447, 447, 9, 2803, 377, 4347, 2183, 61257}}, {4175, 16, 8146, {1, 1, 1, 3, 23, 21, 51, 217, 297, 135, 573, 689, 4947, 14143, 26247, 43061}}, {4176, 16, 8162, {1, 3, 1, 7, 15, 13, 27, 151, 463, 707, 43, 3641, 4999, 3783, 9083, 22085}}, {4177, 16, 8250, {1, 3, 3, 5, 3, 1, 15, 119, 343, 605, 105, 2939, 2259, 889, 21759, 34073}}, {4178, 16, 8270, {1, 1, 1, 7, 3, 63, 103, 1, 235, 317, 263, 2701, 7331, 15921, 17295, 613}}, {4179, 16, 8294, {1, 1, 7, 3, 19, 3, 5, 17, 105, 491, 755, 233, 5397, 12365, 16325, 59377}}, {4180, 16, 8324, {1, 3, 3, 15, 15, 27, 37, 151, 481, 949, 1473, 233, 1925, 15471, 24957, 3241}}, {4181, 16, 8351, {1, 1, 7, 5, 9, 61, 49, 91, 169, 179, 701, 3957, 473, 15087, 6109, 25083}}, {4182, 16, 8357, {1, 3, 3, 11, 27, 43, 5, 33, 69, 705, 733, 2675, 2677, 4235, 11109, 15557}}, {4183, 16, 8361, {1, 3, 1, 3, 17, 19, 101, 119, 289, 341, 1395, 563, 6859, 10359, 10077, 26905}}, {4184, 16, 8364, {1, 1, 1, 15, 21, 47, 41, 145, 439, 583, 1755, 1977, 5235, 15961, 21315, 60577}}, {4185, 16, 8393, {1, 1, 5, 3, 9, 59, 71, 143, 27, 1007, 313, 1567, 1685, 11063, 28889, 44253}}, {4186, 16, 8396, {1, 1, 5, 5, 29, 29, 43, 127, 13, 585, 1245, 187, 2697, 8791, 19561, 6463}}, {4187, 16, 8407, {1, 1, 3, 11, 29, 39, 127, 75, 23, 521, 421, 3115, 139, 5429, 23341, 58035}}, {4188, 16, 8413, {1, 1, 3, 1, 27, 35, 27, 9, 185, 653, 887, 2715, 3775, 1753, 22105, 62095}}, {4189, 16, 8414, {1, 1, 5, 5, 5, 63, 23, 31, 317, 1001, 1751, 1185, 7933, 525, 30501, 15565}}, {4190, 16, 8432, {1, 1, 1, 5, 9, 27, 79, 91, 453, 995, 1041, 3213, 8027, 5855, 7435, 64079}}, {4191, 16, 8435, {1, 1, 3, 11, 1, 51, 27, 195, 139, 41, 1891, 1437, 1033, 11671, 3235, 35083}}, {4192, 16, 8441, {1, 3, 1, 3, 11, 25, 33, 249, 373, 497, 1631, 293, 3657, 10741, 15831, 59545}}, {4193, 16, 8447, {1, 1, 1, 1, 15, 63, 13, 165, 113, 559, 1615, 3579, 1993, 1907, 22335, 47791}}, {4194, 16, 8449, {1, 1, 3, 15, 13, 49, 63, 235, 31, 811, 1729, 221, 5143, 11547, 30029, 52003}}, {4195, 16, 8456, {1, 1, 5, 13, 29, 61, 25, 221, 421, 221, 583, 373, 2341, 7493, 13981, 54141}}, {4196, 16, 8485, {1, 1, 5, 11, 21, 49, 71, 249, 237, 369, 1273, 1067, 4411, 409, 7219, 52933}}, {4197, 16, 8504, {1, 3, 1, 1, 13, 23, 53, 15, 137, 553, 401, 2247, 5591, 14021, 445, 20433}}, {4198, 16, 8512, {1, 1, 7, 7, 7, 23, 19, 189, 119, 643, 847, 2123, 5343, 11839, 4575, 60461}}, {4199, 16, 8532, {1, 1, 5, 5, 11, 19, 111, 219, 185, 499, 595, 723, 3519, 10891, 27603, 29261}}, {4200, 16, 8551, {1, 3, 3, 1, 9, 13, 95, 227, 459, 133, 1535, 3481, 7187, 14797, 16511, 6737}}, {4201, 16, 8560, {1, 1, 7, 7, 19, 57, 117, 7, 455, 941, 455, 797, 6313, 10071, 18651, 25013}}, {4202, 16, 8566, {1, 3, 7, 3, 25, 25, 79, 19, 383, 971, 1625, 2803, 2461, 633, 32317, 48407}}, {4203, 16, 8581, {1, 1, 7, 7, 25, 43, 93, 135, 155, 685, 2001, 3007, 7315, 15555, 30401, 36291}}, {4204, 16, 8609, {1, 1, 1, 5, 13, 33, 123, 221, 341, 105, 1075, 3125, 5323, 14293, 29875, 52215}}, {4205, 16, 8639, {1, 1, 3, 9, 29, 51, 25, 59, 171, 563, 1695, 2845, 6067, 10671, 2909, 33977}}, {4206, 16, 8641, {1, 3, 3, 7, 25, 21, 39, 65, 485, 949, 1773, 2775, 6019, 14587, 6715, 54793}}, {4207, 16, 8671, {1, 1, 7, 11, 17, 57, 125, 17, 111, 167, 289, 3939, 7357, 2289, 1717, 45225}}, {4208, 16, 8695, {1, 1, 7, 7, 21, 55, 3, 139, 471, 747, 1437, 1353, 7657, 13133, 14193, 38191}}, {4209, 16, 8701, {1, 3, 5, 7, 25, 57, 55, 17, 315, 159, 437, 933, 7493, 6025, 2775, 24287}}, {4210, 16, 8711, {1, 1, 7, 1, 15, 45, 67, 191, 355, 681, 1763, 1237, 105, 1425, 26089, 42879}}, {4211, 16, 8739, {1, 1, 5, 13, 13, 53, 25, 127, 103, 155, 935, 2561, 475, 4341, 30541, 43835}}, {4212, 16, 8763, {1, 1, 5, 15, 27, 59, 99, 173, 189, 41, 105, 3287, 4071, 15005, 18301, 34487}}, {4213, 16, 8778, {1, 1, 5, 11, 21, 9, 57, 115, 495, 561, 579, 397, 3049, 2007, 5041, 37345}}, {4214, 16, 8783, {1, 1, 5, 11, 15, 11, 101, 241, 69, 483, 1007, 4069, 5221, 5323, 20177, 24397}}, {4215, 16, 8785, {1, 1, 1, 7, 29, 15, 119, 161, 21, 517, 847, 2217, 4487, 4817, 24053, 21683}}, {4216, 16, 8797, {1, 3, 1, 3, 3, 51, 85, 63, 345, 799, 1699, 3961, 7109, 3931, 28173, 46851}}, {4217, 16, 8802, {1, 1, 5, 7, 15, 25, 97, 139, 331, 969, 1129, 2451, 3107, 12235, 12949, 29837}}, {4218, 16, 8816, {1, 3, 7, 1, 19, 21, 51, 155, 295, 565, 29, 2107, 341, 14611, 15281, 50727}}, {4219, 16, 8828, {1, 3, 1, 11, 3, 37, 13, 217, 429, 217, 301, 1217, 5655, 13845, 32465, 23559}}, {4220, 16, 8837, {1, 3, 3, 9, 9, 57, 79, 231, 433, 703, 699, 3813, 7035, 5885, 19185, 52551}}, {4221, 16, 8852, {1, 1, 1, 5, 19, 17, 31, 209, 49, 515, 279, 909, 5881, 2673, 23635, 23101}}, {4222, 16, 8859, {1, 1, 5, 7, 3, 3, 119, 139, 245, 775, 1009, 1157, 1405, 9737, 17671, 62981}}, {4223, 16, 8889, {1, 3, 7, 11, 17, 21, 105, 21, 67, 871, 233, 3607, 571, 9141, 9751, 28093}}, {4224, 16, 8900, {1, 1, 3, 13, 5, 53, 91, 181, 143, 375, 1113, 705, 837, 10505, 11459, 57753}}, {4225, 16, 8903, {1, 3, 5, 11, 9, 19, 107, 229, 305, 107, 1027, 691, 4677, 8987, 7931, 951}}, {4226, 16, 8909, {1, 1, 7, 9, 9, 17, 39, 195, 103, 315, 517, 123, 7167, 7039, 3571, 40469}}, {4227, 16, 8910, {1, 1, 1, 5, 1, 21, 121, 53, 427, 111, 717, 1065, 2843, 5873, 28411, 42443}}, {4228, 16, 8922, {1, 1, 3, 11, 27, 7, 37, 255, 429, 363, 997, 2429, 6871, 1271, 29375, 62897}}, {4229, 16, 8924, {1, 3, 3, 13, 23, 23, 123, 119, 213, 51, 771, 1603, 1621, 1497, 23667, 13443}}, {4230, 16, 8955, {1, 1, 3, 13, 17, 21, 81, 17, 211, 815, 1751, 3875, 4001, 3927, 6185, 28753}}, {4231, 16, 8958, {1, 3, 1, 5, 13, 41, 23, 187, 475, 353, 1307, 543, 5077, 3459, 20553, 29119}}, {4232, 16, 8980, {1, 1, 1, 7, 1, 39, 3, 247, 375, 101, 81, 1515, 1079, 15307, 18865, 63115}}, {4233, 16, 8994, {1, 1, 5, 9, 23, 7, 61, 45, 379, 553, 435, 1805, 4147, 2289, 22081, 40041}}, {4234, 16, 9006, {1, 1, 7, 3, 17, 13, 107, 169, 119, 981, 1825, 3329, 7779, 12245, 28367, 6749}}, {4235, 16, 9017, {1, 3, 3, 13, 29, 13, 93, 155, 331, 507, 1073, 279, 6615, 14077, 3005, 10171}}, {4236, 16, 9032, {1, 1, 5, 7, 29, 23, 81, 181, 321, 921, 1531, 2607, 7291, 1255, 29889, 30095}}, {4237, 16, 9040, {1, 1, 1, 5, 7, 1, 9, 231, 203, 559, 243, 3999, 3649, 7939, 14729, 34771}}, {4238, 16, 9061, {1, 3, 7, 3, 17, 29, 79, 251, 305, 641, 1125, 1155, 7139, 6721, 43, 34927}}, {4239, 16, 9066, {1, 1, 5, 13, 21, 39, 55, 103, 143, 487, 849, 1111, 1105, 8483, 5417, 10521}}, {4240, 16, 9071, {1, 1, 5, 5, 19, 5, 111, 49, 95, 917, 843, 2539, 6831, 9019, 16045, 59363}}, {4241, 16, 9076, {1, 3, 3, 11, 7, 45, 87, 51, 49, 615, 603, 1623, 5351, 11939, 21945, 40539}}, {4242, 16, 9086, {1, 1, 5, 9, 9, 33, 113, 37, 163, 853, 1313, 4021, 965, 11465, 8573, 24425}}, {4243, 16, 9104, {1, 3, 3, 9, 17, 19, 121, 95, 93, 441, 1951, 3335, 6279, 16087, 14763, 60771}}, {4244, 16, 9150, {1, 3, 3, 9, 13, 15, 19, 129, 257, 641, 533, 1667, 5959, 2259, 10439, 29745}}, {4245, 16, 9161, {1, 1, 7, 7, 11, 31, 45, 247, 233, 101, 899, 2033, 7803, 11423, 30645, 7723}}, {4246, 16, 9164, {1, 3, 5, 11, 23, 3, 69, 79, 319, 125, 1463, 2047, 7311, 5819, 445, 13725}}, {4247, 16, 9185, {1, 1, 1, 3, 7, 43, 83, 89, 467, 709, 1993, 3773, 7805, 305, 15701, 51101}}, {4248, 16, 9188, {1, 1, 7, 5, 19, 53, 77, 237, 27, 853, 1003, 2041, 5739, 4663, 9783, 23761}}, {4249, 16, 9212, {1, 1, 3, 7, 19, 31, 71, 33, 479, 693, 1503, 9, 2779, 1481, 9413, 36227}}, {4250, 16, 9230, {1, 3, 1, 11, 9, 23, 1, 99, 247, 33, 1987, 1577, 8029, 7785, 29947, 38751}}, {4251, 16, 9242, {1, 1, 1, 3, 15, 57, 23, 53, 431, 553, 1433, 2447, 1871, 10701, 30961, 12281}}, {4252, 16, 9247, {1, 3, 5, 9, 11, 49, 123, 91, 87, 155, 301, 3339, 6183, 15895, 17309, 45927}}, {4253, 16, 9260, {1, 1, 1, 9, 9, 41, 79, 123, 261, 547, 1931, 2553, 7405, 14431, 24079, 20769}}, {4254, 16, 9280, {1, 3, 1, 3, 31, 17, 17, 137, 419, 591, 1693, 3977, 861, 16025, 189, 60995}}, {4255, 16, 9300, {1, 3, 7, 11, 19, 47, 107, 243, 87, 135, 507, 189, 1397, 3841, 22999, 50781}}, {4256, 16, 9313, {1, 3, 5, 5, 15, 11, 19, 239, 133, 295, 673, 2389, 4753, 4363, 21669, 25579}}, {4257, 16, 9325, {1, 3, 5, 7, 19, 43, 55, 129, 239, 89, 1731, 1381, 5483, 11773, 9201, 17745}}, {4258, 16, 9343, {1, 3, 1, 13, 3, 15, 77, 131, 417, 845, 1953, 2871, 1789, 10343, 11363, 20699}}, {4259, 16, 9349, {1, 3, 7, 1, 9, 43, 55, 223, 239, 317, 1951, 2725, 209, 3853, 2201, 6839}}, {4260, 16, 9354, {1, 3, 1, 3, 7, 35, 29, 21, 149, 779, 467, 65, 811, 4859, 14021, 38429}}, {4261, 16, 9367, {1, 3, 7, 1, 19, 31, 97, 9, 11, 415, 689, 1513, 2475, 5039, 5669, 65103}}, {4262, 16, 9368, {1, 3, 3, 3, 11, 25, 37, 247, 189, 911, 429, 2395, 3653, 79, 28115, 23513}}, {4263, 16, 9455, {1, 1, 5, 5, 5, 27, 25, 45, 291, 455, 741, 2259, 8131, 11779, 14693, 58729}}, {4264, 16, 9458, {1, 3, 3, 7, 21, 33, 67, 49, 153, 491, 1811, 1955, 925, 15555, 13801, 48717}}, {4265, 16, 9469, {1, 3, 1, 3, 11, 53, 105, 129, 457, 225, 497, 1123, 973, 2901, 26655, 3643}}, {4266, 16, 9481, {1, 1, 7, 13, 29, 49, 71, 37, 321, 865, 735, 357, 7629, 6011, 28221, 39041}}, {4267, 16, 9482, {1, 3, 5, 3, 19, 59, 65, 199, 69, 391, 1735, 3075, 287, 16213, 3211, 22425}}, {4268, 16, 9495, {1, 1, 1, 5, 15, 61, 67, 255, 5, 689, 759, 155, 7245, 5881, 21685, 3863}}, {4269, 16, 9526, {1, 1, 3, 11, 23, 63, 69, 241, 359, 735, 371, 603, 2707, 15833, 31795, 14901}}, {4270, 16, 9530, {1, 1, 1, 7, 19, 33, 83, 19, 13, 667, 317, 3891, 5497, 8213, 4913, 22387}}, {4271, 16, 9558, {1, 3, 5, 9, 13, 21, 11, 187, 249, 647, 349, 605, 2199, 5033, 29773, 48953}}, {4272, 16, 9562, {1, 3, 3, 11, 3, 3, 93, 235, 441, 933, 383, 2007, 4015, 4175, 3937, 20623}}, {4273, 16, 9573, {1, 3, 7, 13, 3, 61, 87, 219, 263, 651, 1343, 2709, 31, 16249, 4749, 28909}}, {4274, 16, 9583, {1, 3, 1, 1, 17, 19, 101, 107, 499, 127, 13, 2123, 5597, 3751, 14527, 12009}}, {4275, 16, 9595, {1, 3, 5, 13, 27, 57, 1, 195, 107, 947, 1475, 2831, 6449, 16117, 20555, 61513}}, {4276, 16, 9597, {1, 3, 1, 9, 9, 47, 89, 187, 401, 299, 637, 197, 1235, 12655, 25025, 24443}}, {4277, 16, 9616, {1, 1, 3, 5, 9, 57, 33, 41, 451, 983, 391, 2707, 705, 13913, 28843, 34091}}, {4278, 16, 9638, {1, 3, 5, 3, 29, 19, 61, 31, 349, 253, 1267, 3345, 2151, 11309, 19623, 62407}}, {4279, 16, 9649, {1, 1, 1, 3, 11, 37, 31, 59, 1, 253, 103, 2811, 1871, 4239, 26311, 32507}}, {4280, 16, 9662, {1, 1, 5, 7, 7, 7, 69, 63, 281, 901, 1785, 2131, 4265, 253, 13997, 30177}}, {4281, 16, 9691, {1, 3, 1, 11, 3, 27, 111, 67, 411, 751, 241, 293, 6271, 4187, 22119, 63737}}, {4282, 16, 9700, {1, 3, 5, 5, 27, 19, 45, 203, 81, 59, 1839, 935, 4847, 1869, 12037, 30971}}, {4283, 16, 9703, {1, 1, 3, 9, 19, 25, 9, 27, 373, 875, 1735, 689, 2957, 7873, 29771, 4093}}, {4284, 16, 9710, {1, 1, 7, 11, 13, 39, 11, 129, 53, 433, 1731, 899, 5855, 10221, 24165, 50205}}, {4285, 16, 9721, {1, 3, 1, 15, 25, 31, 85, 49, 325, 299, 183, 287, 2425, 15353, 25999, 59129}}, {4286, 16, 9724, {1, 1, 5, 5, 17, 25, 23, 5, 287, 677, 591, 981, 429, 15297, 14573, 61095}}, {4287, 16, 9727, {1, 1, 5, 15, 5, 15, 67, 195, 209, 341, 1621, 1379, 3031, 5469, 31563, 49291}}, {4288, 16, 9743, {1, 1, 1, 1, 25, 33, 61, 201, 15, 125, 969, 1965, 2021, 10253, 23801, 28165}}, {4289, 16, 9779, {1, 1, 5, 5, 13, 17, 5, 245, 11, 133, 287, 1929, 4331, 15919, 29663, 10243}}, {4290, 16, 9785, {1, 1, 7, 9, 19, 33, 39, 191, 489, 631, 69, 1883, 2183, 14993, 32715, 62217}}, {4291, 16, 9811, {1, 3, 3, 13, 23, 61, 103, 193, 501, 431, 437, 417, 6557, 11701, 27577, 42943}}, {4292, 16, 9820, {1, 3, 3, 9, 9, 27, 69, 247, 469, 841, 733, 813, 2673, 7145, 5385, 44917}}, {4293, 16, 9827, {1, 1, 7, 9, 5, 13, 19, 71, 323, 923, 1885, 3031, 4507, 13787, 14149, 1483}}, {4294, 16, 9851, {1, 3, 1, 5, 1, 15, 89, 229, 301, 733, 1343, 2415, 6463, 1875, 9293, 6037}}, {4295, 16, 9854, {1, 3, 1, 5, 29, 57, 67, 121, 311, 441, 1079, 1963, 7137, 6745, 9893, 22811}}, {4296, 16, 9863, {1, 1, 7, 7, 25, 13, 27, 61, 331, 361, 481, 3783, 3061, 7827, 18885, 27583}}, {4297, 16, 9884, {1, 3, 1, 5, 17, 47, 19, 83, 309, 65, 1573, 3437, 5623, 12691, 21075, 27789}}, {4298, 16, 9894, {1, 1, 7, 9, 13, 51, 7, 209, 131, 111, 1143, 53, 7277, 9297, 20869, 33121}}, {4299, 16, 9903, {1, 1, 3, 9, 13, 17, 57, 89, 239, 281, 775, 333, 5631, 2805, 10195, 9665}}, {4300, 16, 9908, {1, 1, 3, 7, 19, 39, 71, 79, 63, 551, 103, 3169, 2761, 13929, 20751, 18951}}, {4301, 16, 9912, {1, 1, 7, 11, 5, 23, 7, 249, 447, 483, 433, 3117, 1421, 14991, 5397, 19813}}, {4302, 16, 9925, {1, 3, 1, 13, 3, 9, 109, 241, 181, 33, 853, 3939, 3751, 2151, 28375, 64443}}, {4303, 16, 9926, {1, 1, 7, 7, 3, 33, 65, 211, 251, 631, 1819, 3913, 3353, 12975, 19117, 51515}}, {4304, 16, 9971, {1, 1, 1, 13, 3, 21, 9, 203, 223, 229, 1399, 117, 6297, 11535, 16383, 12541}}, {4305, 16, 9973, {1, 1, 5, 7, 25, 9, 53, 27, 497, 103, 1915, 2179, 3679, 11375, 18907, 63385}}, {4306, 16, 9977, {1, 3, 1, 5, 1, 53, 91, 169, 87, 387, 377, 1121, 7241, 5133, 1949, 13433}}, {4307, 16, 10021, {1, 1, 1, 3, 27, 35, 61, 189, 241, 445, 287, 325, 127, 2363, 30663, 43557}}, {4308, 16, 10039, {1, 3, 1, 3, 17, 47, 59, 237, 213, 979, 807, 85, 4621, 9915, 13631, 55657}}, {4309, 16, 10048, {1, 3, 5, 7, 27, 5, 101, 89, 495, 675, 1181, 2295, 1913, 3731, 32639, 58297}}, {4310, 16, 10051, {1, 3, 3, 11, 5, 41, 49, 229, 93, 659, 927, 3425, 4083, 11859, 10603, 20631}}, {4311, 16, 10065, {1, 3, 5, 11, 31, 51, 67, 69, 253, 497, 1665, 1985, 5439, 15999, 4175, 62175}}, {4312, 16, 10071, {1, 1, 7, 11, 1, 21, 95, 19, 205, 513, 1329, 1821, 1251, 2381, 32623, 23923}}, {4313, 16, 10072, {1, 1, 5, 13, 3, 1, 29, 175, 315, 865, 599, 1695, 1391, 2313, 31035, 19159}}, {4314, 16, 10101, {1, 3, 3, 1, 3, 45, 109, 93, 481, 285, 869, 3441, 3715, 1355, 9581, 50173}}, {4315, 16, 10106, {1, 3, 7, 7, 15, 35, 107, 107, 315, 213, 281, 2073, 4689, 5877, 31, 40967}}, {4316, 16, 10130, {1, 1, 3, 11, 11, 3, 73, 41, 79, 37, 481, 1993, 931, 7677, 11321, 45735}}, {4317, 16, 10136, {1, 1, 7, 1, 15, 21, 65, 237, 263, 849, 863, 4039, 3171, 13381, 30373, 51639}}, {4318, 16, 10148, {1, 1, 1, 3, 21, 57, 113, 3, 487, 41, 1277, 633, 2839, 4977, 14537, 31749}}, {4319, 16, 10155, {1, 1, 5, 1, 1, 55, 71, 181, 147, 895, 1839, 2157, 3187, 6403, 30367, 48915}}, {4320, 16, 10157, {1, 1, 5, 3, 9, 17, 19, 127, 115, 875, 831, 2439, 7475, 1921, 18657, 27709}}, {4321, 16, 10160, {1, 3, 3, 13, 29, 11, 35, 81, 291, 483, 625, 3957, 6017, 12543, 18773, 2471}}, {4322, 16, 10166, {1, 3, 3, 13, 11, 39, 7, 85, 493, 209, 819, 3277, 4275, 8997, 22943, 33199}}, {4323, 16, 10183, {1, 1, 1, 7, 11, 25, 1, 57, 505, 135, 1713, 3051, 5893, 10711, 10681, 12235}}, {4324, 16, 10192, {1, 3, 5, 11, 23, 33, 13, 107, 289, 251, 235, 1747, 4097, 12237, 17559, 5063}}, {4325, 16, 10225, {1, 3, 3, 9, 19, 17, 23, 45, 297, 147, 1301, 2057, 7871, 9971, 1965, 62449}}, {4326, 16, 10241, {1, 1, 7, 3, 17, 21, 19, 203, 289, 897, 1967, 3519, 3261, 8199, 24181, 23273}}, {4327, 16, 10247, {1, 1, 7, 11, 1, 17, 25, 63, 509, 969, 47, 1329, 701, 5227, 419, 14839}}, {4328, 16, 10284, {1, 3, 5, 11, 1, 41, 81, 157, 395, 97, 1919, 3043, 6015, 15, 23733, 55485}}, {4329, 16, 10304, {1, 1, 3, 11, 17, 37, 17, 181, 179, 297, 1007, 1559, 6275, 11645, 7535, 28941}}, {4330, 16, 10322, {1, 3, 7, 15, 5, 47, 31, 237, 215, 563, 207, 1867, 6635, 6857, 11837, 22865}}, {4331, 16, 10331, {1, 3, 1, 7, 7, 39, 51, 179, 57, 987, 893, 2715, 1045, 5799, 19805, 54275}}, {4332, 16, 10333, {1, 1, 7, 15, 25, 9, 127, 243, 323, 1013, 929, 2891, 7549, 1071, 17663, 15247}}, {4333, 16, 10340, {1, 1, 1, 5, 25, 23, 101, 9, 371, 89, 1749, 3559, 8071, 13887, 14807, 42825}}, {4334, 16, 10347, {1, 3, 3, 11, 21, 41, 3, 77, 3, 709, 1745, 3615, 4141, 5275, 28329, 59739}}, {4335, 16, 10357, {1, 1, 7, 13, 1, 11, 73, 183, 363, 241, 863, 3983, 3235, 293, 649, 441}}, {4336, 16, 10371, {1, 1, 5, 3, 13, 27, 13, 191, 57, 639, 1803, 2353, 3143, 12763, 5771, 36155}}, {4337, 16, 10386, {1, 1, 5, 3, 1, 53, 85, 45, 283, 823, 1213, 3261, 4599, 13267, 4613, 12657}}, {4338, 16, 10404, {1, 3, 5, 15, 27, 49, 59, 123, 357, 527, 337, 2751, 3999, 8525, 12501, 40621}}, {4339, 16, 10414, {1, 1, 1, 7, 1, 55, 85, 17, 447, 599, 1315, 2313, 1649, 907, 25647, 3251}}, {4340, 16, 10422, {1, 3, 5, 13, 9, 1, 37, 121, 143, 1, 631, 2273, 1673, 3649, 27533, 28731}}, {4341, 16, 10448, {1, 1, 7, 13, 9, 31, 57, 249, 397, 815, 501, 895, 1217, 11387, 8635, 65193}}, {4342, 16, 10451, {1, 1, 5, 5, 9, 35, 95, 193, 133, 513, 1929, 3841, 3063, 2383, 24413, 51185}}, {4343, 16, 10473, {1, 1, 1, 13, 3, 49, 45, 191, 15, 181, 1819, 3741, 1227, 12775, 9461, 44951}}, {4344, 16, 10479, {1, 1, 1, 1, 3, 45, 121, 19, 269, 829, 517, 3913, 183, 11019, 24969, 21973}}, {4345, 16, 10501, {1, 1, 5, 11, 31, 39, 125, 189, 401, 57, 1557, 1727, 1415, 4025, 30353, 36589}}, {4346, 16, 10530, {1, 1, 3, 9, 3, 55, 125, 187, 409, 499, 1853, 2781, 4323, 16159, 16345, 34659}}, {4347, 16, 10542, {1, 3, 5, 11, 31, 5, 125, 137, 197, 475, 2003, 617, 1289, 8365, 28981, 57537}}, {4348, 16, 10544, {1, 1, 1, 5, 19, 29, 83, 127, 311, 177, 1635, 2187, 5377, 12841, 7591, 6095}}, {4349, 16, 10571, {1, 3, 5, 5, 21, 39, 65, 197, 115, 411, 1457, 3011, 7021, 14119, 61, 21107}}, {4350, 16, 10628, {1, 3, 3, 9, 19, 57, 99, 23, 451, 507, 973, 415, 7123, 11367, 29767, 23763}}, {4351, 16, 10643, {1, 1, 5, 7, 29, 23, 47, 11, 267, 873, 591, 373, 7097, 3783, 23289, 5547}}, {4352, 16, 10673, {1, 1, 5, 15, 7, 7, 7, 91, 389, 841, 1995, 459, 7013, 3109, 23615, 21519}}, {4353, 16, 10683, {1, 3, 1, 1, 13, 25, 87, 235, 193, 201, 713, 1633, 3117, 13609, 17211, 573}}, {4354, 16, 10736, {1, 1, 1, 9, 27, 53, 105, 39, 217, 781, 997, 661, 6243, 6427, 17739, 62239}}, {4355, 16, 10795, {1, 1, 7, 3, 3, 49, 75, 125, 239, 195, 215, 2983, 1185, 4743, 12069, 55509}}, {4356, 16, 10797, {1, 1, 5, 15, 31, 11, 9, 91, 253, 361, 571, 1589, 2425, 4279, 3765, 46519}}, {4357, 16, 10815, {1, 1, 3, 3, 21, 49, 49, 213, 399, 253, 1565, 2447, 453, 7957, 24799, 58503}}, {4358, 16, 10817, {1, 1, 7, 1, 5, 59, 81, 97, 209, 477, 17, 3085, 3655, 599, 24011, 14981}}, {4359, 16, 10842, {1, 3, 3, 13, 19, 49, 7, 35, 111, 169, 629, 1587, 5345, 13699, 21187, 30199}}, {4360, 16, 10844, {1, 1, 3, 13, 19, 59, 73, 127, 475, 509, 9, 2661, 711, 15835, 31429, 33885}}, {4361, 16, 10863, {1, 3, 5, 3, 31, 15, 43, 185, 29, 897, 1041, 1057, 6285, 13925, 4023, 25741}}, {4362, 16, 10899, {1, 3, 5, 11, 1, 33, 63, 155, 175, 501, 1147, 3395, 3285, 16237, 22315, 50945}}, {4363, 16, 10902, {1, 3, 3, 3, 5, 13, 77, 227, 85, 139, 139, 1, 7147, 2023, 32705, 38753}}, {4364, 16, 10917, {1, 3, 5, 11, 31, 59, 35, 179, 489, 537, 1537, 2877, 4937, 10825, 2445, 34907}}, {4365, 16, 10953, {1, 3, 7, 11, 17, 17, 95, 223, 165, 925, 829, 3971, 1, 7393, 8825, 25705}}, {4366, 16, 10967, {1, 1, 1, 1, 25, 17, 25, 143, 385, 907, 1381, 1823, 3819, 8475, 5321, 12037}}, {4367, 16, 11002, {1, 1, 5, 11, 7, 47, 97, 85, 105, 23, 263, 1329, 1905, 12121, 29635, 41249}}, {4368, 16, 11024, {1, 1, 7, 11, 1, 51, 13, 13, 5, 143, 83, 3831, 959, 6083, 16997, 59887}}, {4369, 16, 11029, {1, 3, 3, 13, 25, 9, 31, 5, 215, 791, 767, 1733, 2715, 14283, 25795, 54249}}, {4370, 16, 11030, {1, 3, 7, 5, 11, 19, 125, 81, 71, 131, 1869, 1111, 6763, 5275, 23095, 1139}}, {4371, 16, 11043, {1, 3, 3, 9, 25, 43, 119, 49, 133, 217, 521, 1367, 5867, 6829, 29871, 60383}}, {4372, 16, 11087, {1, 1, 7, 9, 5, 11, 59, 157, 279, 301, 481, 3273, 7943, 3273, 27783, 17271}}, {4373, 16, 11106, {1, 3, 3, 13, 11, 57, 13, 5, 435, 169, 541, 517, 2359, 9121, 27911, 15679}}, {4374, 16, 11130, {1, 1, 3, 9, 9, 55, 65, 113, 21, 807, 373, 2825, 1527, 15565, 8339, 7227}}, {4375, 16, 11156, {1, 3, 5, 9, 1, 1, 49, 255, 477, 821, 1647, 713, 6841, 3187, 22649, 51469}}, {4376, 16, 11176, {1, 3, 3, 11, 13, 43, 63, 139, 71, 809, 993, 2429, 833, 6545, 10987, 39567}}, {4377, 16, 11221, {1, 1, 1, 9, 19, 23, 47, 199, 191, 827, 391, 837, 1209, 2493, 24071, 46589}}, {4378, 16, 11267, {1, 1, 5, 13, 25, 51, 39, 43, 103, 899, 1729, 2389, 2965, 189, 3063, 50609}}, {4379, 16, 11282, {1, 1, 3, 1, 5, 29, 105, 201, 503, 199, 507, 205, 2389, 695, 15233, 50353}}, {4380, 16, 11294, {1, 3, 1, 7, 19, 53, 45, 21, 89, 545, 1885, 765, 6673, 13485, 9987, 2609}}, {4381, 16, 11332, {1, 3, 7, 13, 17, 7, 59, 23, 159, 309, 1407, 2483, 1807, 15733, 5603, 52989}}, {4382, 16, 11353, {1, 1, 1, 11, 13, 19, 123, 185, 413, 745, 361, 2391, 6697, 2281, 11999, 13175}}, {4383, 16, 11369, {1, 3, 5, 5, 11, 49, 123, 173, 325, 667, 895, 1067, 8121, 10577, 30561, 17391}}, {4384, 16, 11372, {1, 1, 5, 5, 23, 21, 77, 223, 281, 161, 141, 345, 3879, 11393, 26907, 53805}}, {4385, 16, 11375, {1, 3, 3, 5, 3, 47, 17, 109, 185, 139, 957, 1417, 4553, 6101, 29537, 34821}}, {4386, 16, 11413, {1, 1, 5, 3, 29, 49, 89, 61, 45, 593, 269, 1483, 2971, 991, 21239, 29301}}, {4387, 16, 11429, {1, 1, 3, 13, 29, 45, 33, 253, 291, 783, 737, 2363, 2651, 8627, 21785, 58419}}, {4388, 16, 11430, {1, 3, 7, 15, 29, 15, 81, 185, 363, 681, 1737, 3789, 4365, 3295, 23205, 4457}}, {4389, 16, 11444, {1, 3, 3, 11, 15, 39, 67, 167, 197, 357, 871, 2201, 5377, 6299, 20873, 59283}}, {4390, 16, 11462, {1, 3, 3, 5, 9, 15, 127, 49, 21, 719, 357, 425, 5507, 9639, 275, 47503}}, {4391, 16, 11465, {1, 1, 7, 1, 13, 63, 111, 121, 21, 481, 247, 3147, 5783, 8947, 20809, 42039}}, {4392, 16, 11471, {1, 1, 3, 3, 31, 33, 9, 69, 187, 517, 2029, 2205, 7661, 4757, 27525, 9665}}, {4393, 16, 11473, {1, 1, 1, 13, 7, 41, 103, 161, 233, 221, 693, 213, 4609, 7771, 28703, 17407}}, {4394, 16, 11495, {1, 3, 7, 15, 31, 47, 27, 111, 479, 1003, 1687, 347, 2179, 11861, 8169, 31941}}, {4395, 16, 11499, {1, 1, 3, 5, 5, 63, 25, 125, 199, 147, 589, 3565, 3449, 8331, 8923, 31207}}, {4396, 16, 11519, {1, 1, 3, 11, 19, 25, 77, 99, 299, 19, 1641, 2193, 4299, 3635, 20621, 267}}, {4397, 16, 11562, {1, 3, 7, 11, 9, 59, 7, 167, 1, 775, 29, 1935, 3723, 11835, 2887, 65285}}, {4398, 16, 11576, {1, 1, 7, 13, 5, 47, 101, 155, 235, 93, 465, 3581, 1837, 7675, 10789, 45167}}, {4399, 16, 11582, {1, 1, 3, 5, 9, 59, 121, 109, 59, 821, 1625, 343, 1591, 3875, 13729, 56381}}, {4400, 16, 11596, {1, 1, 1, 9, 27, 53, 93, 215, 133, 561, 39, 2591, 1041, 11913, 24493, 37921}}, {4401, 16, 11602, {1, 1, 1, 7, 23, 7, 81, 107, 219, 943, 563, 1083, 5803, 5687, 32559, 62727}}, {4402, 16, 11611, {1, 3, 7, 7, 21, 53, 3, 5, 231, 601, 1561, 103, 3837, 2675, 5263, 23375}}, {4403, 16, 11627, {1, 1, 3, 13, 15, 27, 89, 7, 251, 887, 951, 3001, 5687, 4921, 5091, 59337}}, {4404, 16, 11682, {1, 3, 7, 15, 25, 53, 19, 155, 185, 503, 547, 1917, 7633, 15167, 14177, 46761}}, {4405, 16, 11687, {1, 3, 5, 15, 21, 49, 13, 163, 471, 281, 1141, 3013, 6847, 9261, 15955, 9397}}, {4406, 16, 11691, {1, 3, 3, 3, 1, 21, 19, 239, 479, 609, 65, 2735, 5337, 6293, 19351, 34135}}, {4407, 16, 11733, {1, 1, 7, 1, 9, 1, 119, 23, 411, 535, 101, 1597, 2379, 2421, 31471, 36473}}, {4408, 16, 11747, {1, 3, 1, 11, 31, 63, 17, 225, 45, 409, 59, 3943, 8043, 11759, 10667, 58793}}, {4409, 16, 11759, {1, 1, 3, 3, 9, 49, 61, 239, 245, 765, 1945, 3567, 5355, 14799, 7141, 59511}}, {4410, 16, 11778, {1, 3, 7, 9, 3, 33, 103, 99, 35, 799, 1347, 2253, 8189, 14177, 13479, 13749}}, {4411, 16, 11852, {1, 3, 1, 15, 15, 51, 7, 179, 471, 265, 1571, 2983, 701, 15133, 7885, 29977}}, {4412, 16, 11857, {1, 1, 5, 9, 15, 37, 49, 213, 113, 729, 1115, 2727, 2635, 8433, 11145, 46779}}, {4413, 16, 11858, {1, 3, 5, 11, 7, 3, 115, 151, 133, 723, 7, 4063, 5807, 9845, 25829, 29315}}, {4414, 16, 11893, {1, 3, 5, 9, 25, 55, 17, 135, 145, 379, 1603, 3459, 5773, 6545, 17509, 25847}}, {4415, 16, 11907, {1, 1, 7, 11, 1, 61, 113, 147, 489, 775, 1347, 2199, 299, 9589, 19931, 1335}}, {4416, 16, 11928, {1, 3, 1, 3, 1, 7, 27, 243, 355, 425, 1215, 3723, 3489, 9285, 12739, 24797}}, {4417, 16, 11931, {1, 3, 5, 11, 15, 25, 57, 221, 247, 647, 259, 1665, 7055, 2835, 16411, 42999}}, {4418, 16, 11933, {1, 1, 3, 7, 9, 25, 61, 233, 73, 235, 1539, 1865, 5671, 1329, 5767, 43039}}, {4419, 16, 11967, {1, 1, 7, 9, 21, 11, 123, 7, 41, 407, 1485, 1723, 585, 10597, 16215, 63403}}, {4420, 16, 11976, {1, 1, 5, 7, 27, 9, 123, 101, 273, 673, 1141, 3841, 4041, 13169, 8221, 12915}}, {4421, 16, 11989, {1, 3, 1, 13, 3, 17, 105, 17, 237, 321, 855, 2821, 2467, 3503, 15187, 1689}}, {4422, 16, 12003, {1, 1, 5, 5, 19, 23, 9, 205, 87, 153, 1543, 1193, 6619, 6845, 8459, 37533}}, {4423, 16, 12024, {1, 1, 7, 15, 13, 29, 79, 9, 203, 211, 239, 2349, 3447, 7797, 19311, 58071}}, {4424, 16, 12030, {1, 3, 5, 11, 5, 49, 71, 151, 333, 895, 1095, 2471, 2477, 14493, 16711, 14393}}, {4425, 16, 12037, {1, 1, 5, 13, 17, 19, 25, 149, 111, 631, 763, 2535, 3631, 1809, 8163, 18037}}, {4426, 16, 12044, {1, 3, 3, 13, 23, 61, 25, 179, 351, 247, 1021, 2413, 2585, 3731, 5435, 52723}}, {4427, 16, 12052, {1, 1, 5, 11, 1, 39, 65, 59, 21, 927, 1989, 2823, 4857, 15521, 30495, 16067}}, {4428, 16, 12059, {1, 3, 3, 7, 17, 5, 17, 125, 379, 875, 1565, 2435, 933, 6809, 20129, 26339}}, {4429, 16, 12075, {1, 1, 7, 5, 3, 57, 51, 213, 455, 663, 2007, 3995, 4889, 9527, 23507, 3261}}, {4430, 16, 12083, {1, 3, 7, 5, 1, 29, 85, 151, 165, 123, 1425, 2851, 4427, 7683, 21085, 28925}}, {4431, 16, 12117, {1, 1, 5, 3, 11, 33, 127, 3, 41, 591, 1539, 3823, 125, 421, 9051, 55025}}, {4432, 16, 12138, {1, 3, 1, 5, 7, 9, 69, 35, 59, 477, 1207, 1245, 6423, 11329, 26535, 37621}}, {4433, 16, 12146, {1, 3, 1, 1, 15, 35, 17, 123, 303, 193, 1489, 2587, 1883, 4063, 1921, 60413}}, {4434, 16, 12202, {1, 1, 5, 1, 7, 61, 39, 247, 139, 1015, 757, 823, 4757, 9307, 32287, 37241}}, {4435, 16, 12230, {1, 1, 7, 15, 3, 5, 85, 93, 457, 999, 1331, 919, 5271, 11687, 24233, 38803}}, {4436, 16, 12254, {1, 3, 3, 9, 5, 43, 37, 13, 505, 603, 1857, 2675, 2017, 9481, 10873, 54755}}, {4437, 16, 12304, {1, 1, 5, 15, 13, 3, 7, 239, 471, 835, 553, 413, 4029, 8613, 15533, 58987}}, {4438, 16, 12316, {1, 3, 1, 5, 19, 27, 21, 43, 57, 755, 1245, 2805, 3799, 2013, 21145, 10317}}, {4439, 16, 12337, {1, 3, 5, 13, 9, 23, 35, 5, 315, 169, 399, 2641, 1525, 10561, 11917, 33009}}, {4440, 16, 12347, {1, 3, 5, 7, 23, 53, 101, 105, 451, 207, 1271, 3067, 6725, 15525, 7951, 1283}}, {4441, 16, 12367, {1, 1, 5, 5, 27, 21, 77, 143, 213, 443, 149, 2667, 5269, 10359, 25287, 5843}}, {4442, 16, 12398, {1, 3, 5, 5, 25, 27, 109, 157, 459, 767, 765, 2667, 1833, 3781, 9077, 64321}}, {4443, 16, 12421, {1, 3, 3, 13, 31, 25, 97, 237, 279, 431, 1713, 809, 1989, 10431, 5867, 42197}}, {4444, 16, 12428, {1, 3, 7, 3, 9, 5, 5, 191, 73, 521, 787, 903, 3073, 2067, 24741, 57029}}, {4445, 16, 12446, {1, 3, 3, 1, 3, 41, 125, 53, 125, 781, 865, 3677, 6279, 357, 10667, 1127}}, {4446, 16, 12449, {1, 1, 5, 11, 25, 19, 99, 121, 359, 73, 607, 2149, 5739, 15669, 29457, 57549}}, {4447, 16, 12467, {1, 1, 5, 3, 23, 5, 35, 55, 369, 239, 329, 3057, 3757, 12523, 5017, 52185}}, {4448, 16, 12479, {1, 3, 3, 13, 17, 61, 69, 165, 267, 323, 2007, 2025, 4423, 15975, 31897, 37013}}, {4449, 16, 12502, {1, 3, 7, 13, 19, 19, 87, 111, 389, 611, 1523, 963, 4671, 12569, 21839, 10919}}, {4450, 16, 12521, {1, 1, 1, 3, 1, 27, 13, 227, 29, 457, 221, 127, 5335, 16247, 19559, 19185}}, {4451, 16, 12553, {1, 3, 5, 7, 29, 21, 23, 157, 197, 87, 1591, 1829, 407, 15885, 14933, 1997}}, {4452, 16, 12568, {1, 1, 1, 9, 3, 35, 43, 187, 195, 325, 197, 2905, 7323, 1563, 7659, 45185}}, {4453, 16, 12573, {1, 1, 1, 15, 3, 23, 105, 33, 73, 495, 1409, 2583, 1099, 1041, 28955, 60293}}, {4454, 16, 12592, {1, 3, 7, 13, 25, 19, 99, 137, 139, 719, 529, 1147, 5813, 11551, 30183, 14593}}, {4455, 16, 12597, {1, 3, 3, 5, 17, 25, 73, 193, 309, 887, 1655, 1641, 2091, 12087, 21881, 1145}}, {4456, 16, 12601, {1, 3, 1, 1, 27, 41, 13, 151, 83, 645, 327, 1795, 2717, 12433, 22751, 9823}}, {4457, 16, 12615, {1, 1, 3, 7, 1, 43, 77, 229, 59, 499, 1883, 135, 3461, 9821, 219, 6111}}, {4458, 16, 12619, {1, 3, 3, 3, 23, 7, 17, 67, 361, 565, 1621, 3253, 7973, 281, 3209, 48215}}, {4459, 16, 12694, {1, 1, 3, 7, 31, 15, 97, 141, 197, 883, 1689, 269, 7487, 10403, 18903, 58147}}, {4460, 16, 12697, {1, 3, 3, 3, 23, 9, 87, 125, 359, 527, 1251, 637, 1145, 12721, 14693, 6021}}, {4461, 16, 12698, {1, 1, 3, 5, 13, 43, 105, 173, 205, 859, 1237, 1227, 1409, 15513, 25317, 30745}}, {4462, 16, 12713, {1, 3, 3, 15, 31, 43, 125, 149, 145, 109, 975, 1167, 7629, 8373, 5923, 64117}}, {4463, 16, 12722, {1, 3, 1, 15, 3, 33, 89, 173, 379, 615, 1401, 1567, 4453, 7461, 32555, 64369}}, {4464, 16, 12733, {1, 3, 7, 11, 27, 23, 45, 7, 15, 21, 1663, 3327, 5611, 8535, 27669, 25525}}, {4465, 16, 12736, {1, 1, 3, 15, 15, 61, 127, 145, 151, 41, 629, 767, 5801, 3395, 1157, 30033}}, {4466, 16, 12790, {1, 1, 1, 5, 9, 63, 73, 9, 299, 237, 369, 1295, 4869, 6821, 19961, 32129}}, {4467, 16, 12794, {1, 1, 5, 13, 19, 7, 119, 35, 319, 405, 1255, 1299, 4311, 14999, 24567, 4001}}, {4468, 16, 12803, {1, 1, 1, 13, 9, 39, 13, 207, 355, 691, 37, 3137, 6073, 16179, 28661, 41}}, {4469, 16, 12815, {1, 1, 3, 7, 21, 3, 123, 27, 187, 183, 769, 2367, 2957, 7065, 17855, 60805}}, {4470, 16, 12829, {1, 1, 1, 1, 19, 31, 71, 85, 303, 617, 1007, 283, 8087, 11079, 11463, 65295}}, {4471, 16, 12833, {1, 1, 3, 13, 25, 63, 61, 187, 401, 465, 1485, 801, 3649, 7763, 8495, 54479}}, {4472, 16, 12840, {1, 3, 7, 3, 13, 51, 41, 119, 311, 699, 1113, 3631, 1981, 3259, 25871, 45659}}, {4473, 16, 12875, {1, 3, 7, 13, 31, 27, 57, 181, 325, 107, 1745, 635, 3941, 3305, 14563, 29855}}, {4474, 16, 12877, {1, 3, 7, 15, 5, 55, 5, 147, 365, 485, 1841, 3673, 6513, 11121, 5725, 18027}}, {4475, 16, 12916, {1, 3, 5, 11, 13, 45, 35, 79, 109, 683, 1171, 3015, 2163, 4823, 4365, 42931}}, {4476, 16, 12923, {1, 1, 7, 7, 13, 45, 57, 39, 297, 985, 1559, 487, 5071, 2657, 9401, 41889}}, {4477, 16, 12935, {1, 1, 5, 9, 29, 33, 79, 237, 509, 537, 549, 3657, 7141, 15189, 30853, 36089}}, {4478, 16, 12949, {1, 3, 5, 7, 31, 15, 75, 73, 237, 273, 865, 743, 2607, 7611, 18441, 12703}}, {4479, 16, 12954, {1, 1, 1, 9, 27, 9, 35, 137, 265, 181, 1341, 1945, 5615, 161, 18369, 4791}}, {4480, 16, 12956, {1, 3, 7, 11, 27, 29, 29, 43, 489, 177, 1489, 2927, 623, 14571, 22447, 46905}}, {4481, 16, 12959, {1, 3, 3, 3, 19, 41, 107, 53, 239, 263, 1433, 1655, 7991, 7405, 2735, 25519}}, {4482, 16, 12978, {1, 3, 5, 7, 19, 37, 73, 243, 215, 445, 1781, 3223, 187, 8443, 18185, 45093}}, {4483, 16, 13001, {1, 1, 3, 13, 9, 57, 111, 111, 221, 505, 1261, 3045, 1655, 16247, 21033, 17993}}, {4484, 16, 13010, {1, 1, 7, 5, 7, 55, 77, 5, 131, 969, 1481, 2883, 2645, 3003, 5601, 37063}}, {4485, 16, 13043, {1, 1, 5, 15, 29, 55, 39, 197, 349, 29, 341, 67, 1977, 425, 4063, 42705}}, {4486, 16, 13049, {1, 1, 7, 13, 1, 57, 81, 81, 129, 681, 1407, 2465, 3627, 2325, 31649, 18449}}, {4487, 16, 13058, {1, 3, 5, 5, 23, 59, 35, 217, 393, 155, 1315, 105, 2285, 5167, 27997, 55193}}, {4488, 16, 13112, {1, 1, 7, 3, 11, 59, 53, 179, 319, 819, 947, 3881, 765, 4219, 16405, 48055}}, {4489, 16, 13140, {1, 1, 3, 9, 23, 9, 67, 67, 137, 523, 1585, 2441, 167, 5217, 12031, 14297}}, {4490, 16, 13149, {1, 1, 5, 13, 31, 63, 121, 91, 439, 917, 203, 1519, 4363, 2391, 25755, 26677}}, {4491, 16, 13163, {1, 1, 3, 5, 25, 31, 11, 95, 339, 817, 35, 3923, 7365, 10537, 5521, 54579}}, {4492, 16, 13187, {1, 3, 7, 1, 3, 33, 47, 13, 139, 445, 1357, 3907, 7495, 8789, 26589, 43479}}, {4493, 16, 13196, {1, 1, 1, 11, 5, 45, 61, 13, 167, 287, 931, 881, 5713, 12937, 12951, 21597}}, {4494, 16, 13237, {1, 3, 5, 1, 29, 23, 7, 117, 503, 897, 733, 1113, 7205, 11507, 561, 34011}}, {4495, 16, 13244, {1, 3, 5, 7, 3, 51, 21, 147, 35, 259, 689, 3801, 2481, 9673, 4065, 595}}, {4496, 16, 13264, {1, 3, 3, 9, 9, 29, 5, 191, 393, 979, 1627, 937, 75, 2339, 24007, 30555}}, {4497, 16, 13279, {1, 1, 5, 7, 9, 35, 111, 23, 113, 563, 1689, 1575, 6127, 9919, 2555, 52261}}, {4498, 16, 13292, {1, 3, 1, 5, 31, 21, 117, 159, 473, 279, 1281, 311, 159, 3343, 27761, 59989}}, {4499, 16, 13295, {1, 1, 5, 1, 23, 31, 67, 241, 401, 69, 933, 777, 267, 12411, 23767, 9047}}, {4500, 16, 13307, {1, 1, 5, 1, 15, 49, 99, 15, 267, 913, 1581, 3713, 651, 14275, 10103, 57619}}, {4501, 16, 13312, {1, 3, 5, 9, 19, 23, 95, 5, 449, 153, 1195, 1315, 2347, 12683, 10865, 50703}}, {4502, 16, 13317, {1, 1, 1, 13, 17, 17, 115, 31, 135, 725, 795, 1695, 6199, 4179, 5223, 48457}}, {4503, 16, 13327, {1, 3, 5, 15, 31, 15, 3, 247, 385, 269, 1665, 581, 2809, 6333, 7459, 14815}}, {4504, 16, 13348, {1, 3, 7, 5, 15, 35, 117, 85, 11, 621, 1523, 981, 511, 14113, 4673, 22683}}, {4505, 16, 13390, {1, 1, 7, 1, 27, 61, 119, 249, 431, 147, 173, 423, 1353, 4747, 12761, 32947}}, {4506, 16, 13413, {1, 3, 7, 1, 23, 39, 15, 153, 219, 359, 1233, 169, 2817, 11043, 12435, 30135}}, {4507, 16, 13417, {1, 1, 5, 1, 1, 55, 39, 1, 151, 865, 125, 2351, 6315, 1165, 20163, 43991}}, {4508, 16, 13418, {1, 1, 3, 9, 25, 41, 115, 221, 129, 265, 1887, 4057, 7523, 13591, 5735, 59645}}, {4509, 16, 13451, {1, 1, 5, 5, 19, 15, 9, 77, 511, 627, 153, 2015, 247, 15949, 9715, 45411}}, {4510, 16, 13475, {1, 1, 7, 7, 17, 17, 107, 183, 39, 647, 1339, 3915, 4937, 537, 27011, 58937}}, {4511, 16, 13482, {1, 3, 3, 13, 3, 3, 69, 201, 431, 65, 683, 121, 7017, 2791, 16713, 62555}}, {4512, 16, 13510, {1, 3, 7, 3, 7, 41, 117, 237, 23, 757, 545, 3899, 1837, 5555, 7891, 29151}}, {4513, 16, 13527, {1, 1, 1, 3, 27, 15, 39, 195, 353, 299, 1431, 2279, 1795, 13773, 24915, 49701}}, {4514, 16, 13543, {1, 1, 5, 5, 7, 7, 125, 5, 401, 523, 1967, 2471, 7279, 7559, 12025, 60599}}, {4515, 16, 13547, {1, 1, 1, 13, 13, 59, 13, 249, 465, 847, 1483, 975, 7729, 2773, 15745, 51237}}, {4516, 16, 13627, {1, 1, 7, 9, 31, 41, 115, 141, 247, 355, 1109, 3239, 6495, 4515, 30145, 47705}}, {4517, 16, 13650, {1, 1, 3, 13, 29, 41, 69, 179, 45, 271, 1909, 3095, 7199, 14049, 9903, 33383}}, {4518, 16, 13683, {1, 1, 3, 13, 7, 45, 105, 105, 243, 121, 67, 3169, 237, 137, 4175, 54325}}, {4519, 16, 13696, {1, 3, 3, 11, 19, 51, 93, 155, 79, 579, 1621, 1251, 7639, 15875, 25815, 56063}}, {4520, 16, 13702, {1, 3, 3, 9, 27, 27, 77, 45, 217, 965, 1045, 875, 4515, 11261, 27859, 757}}, {4521, 16, 13713, {1, 1, 3, 11, 17, 7, 81, 37, 299, 765, 977, 3371, 3163, 13267, 18345, 9239}}, {4522, 16, 13739, {1, 1, 1, 3, 15, 23, 115, 11, 183, 511, 557, 3253, 153, 8465, 22659, 42143}}, {4523, 16, 13749, {1, 1, 5, 13, 17, 61, 127, 219, 225, 981, 615, 731, 4069, 12637, 11601, 38257}}, {4524, 16, 13767, {1, 1, 5, 3, 29, 3, 73, 79, 393, 779, 823, 2473, 3811, 4417, 9399, 50011}}, {4525, 16, 13774, {1, 3, 3, 9, 21, 35, 61, 99, 115, 657, 629, 1129, 2355, 12665, 459, 40831}}, {4526, 16, 13781, {1, 3, 1, 7, 25, 61, 53, 249, 15, 649, 665, 595, 1441, 8035, 5381, 7147}}, {4527, 16, 13795, {1, 3, 1, 7, 19, 9, 27, 207, 205, 461, 1069, 4039, 6549, 2333, 29, 50067}}, {4528, 16, 13821, {1, 1, 5, 3, 15, 7, 115, 205, 71, 73, 53, 71, 6049, 15293, 17041, 20313}}, {4529, 16, 13825, {1, 1, 7, 7, 9, 7, 119, 99, 357, 729, 2041, 3355, 5333, 1263, 30521, 64867}}, {4530, 16, 13838, {1, 1, 1, 7, 31, 63, 63, 159, 281, 295, 913, 2161, 8033, 13789, 17711, 14915}}, {4531, 16, 13852, {1, 1, 7, 9, 29, 55, 69, 129, 453, 361, 1883, 17, 1765, 111, 10311, 55019}}, {4532, 16, 13879, {1, 1, 5, 9, 21, 15, 31, 57, 291, 915, 945, 1775, 5905, 9073, 3271, 15571}}, {4533, 16, 13888, {1, 1, 1, 7, 21, 11, 1, 9, 167, 143, 1535, 1267, 6675, 13037, 19513, 52027}}, {4534, 16, 13897, {1, 3, 3, 7, 31, 45, 57, 105, 63, 121, 631, 679, 3873, 16333, 32069, 64725}}, {4535, 16, 13906, {1, 1, 1, 9, 23, 41, 29, 207, 489, 319, 905, 3147, 4195, 2697, 5281, 1771}}, {4536, 16, 13939, {1, 1, 1, 9, 25, 33, 57, 201, 405, 111, 407, 3489, 449, 8601, 1273, 42105}}, {4537, 16, 13962, {1, 1, 1, 3, 19, 45, 123, 159, 237, 173, 781, 787, 7537, 15453, 25567, 53729}}, {4538, 16, 13981, {1, 1, 7, 3, 29, 9, 89, 207, 345, 685, 1701, 2859, 8065, 9289, 2459, 28367}}, {4539, 16, 13985, {1, 3, 1, 3, 31, 41, 55, 241, 81, 1001, 595, 1725, 853, 11427, 20617, 1717}}, {4540, 16, 14020, {1, 1, 3, 3, 9, 45, 121, 69, 177, 1017, 211, 2753, 6923, 1387, 32063, 45337}}, {4541, 16, 14030, {1, 1, 5, 15, 21, 23, 95, 61, 485, 403, 619, 3035, 4881, 13423, 17815, 35221}}, {4542, 16, 14041, {1, 1, 3, 3, 3, 59, 23, 69, 77, 309, 227, 2877, 3739, 3539, 20083, 23415}}, {4543, 16, 14047, {1, 3, 7, 3, 17, 43, 95, 239, 223, 353, 1237, 3239, 1369, 7245, 32401, 63889}}, {4544, 16, 14048, {1, 1, 1, 5, 25, 63, 123, 3, 291, 819, 793, 241, 5619, 8871, 18341, 2757}}, {4545, 16, 14066, {1, 3, 7, 15, 3, 21, 17, 97, 395, 333, 909, 3783, 3635, 751, 24227, 44281}}, {4546, 16, 14092, {1, 3, 7, 13, 29, 49, 123, 195, 191, 159, 211, 1887, 3047, 4871, 2607, 32425}}, {4547, 16, 14120, {1, 1, 7, 7, 15, 57, 91, 255, 267, 897, 441, 1581, 953, 6951, 17275, 50229}}, {4548, 16, 14126, {1, 3, 7, 15, 1, 35, 91, 219, 7, 117, 119, 2687, 1215, 9517, 10849, 28347}}, {4549, 16, 14131, {1, 1, 1, 1, 21, 55, 67, 221, 503, 883, 1037, 2965, 1485, 8557, 28091, 25459}}, {4550, 16, 14143, {1, 3, 5, 9, 19, 3, 73, 123, 95, 307, 1339, 3669, 5077, 12049, 523, 21457}}, {4551, 16, 14146, {1, 3, 1, 13, 3, 1, 111, 97, 371, 697, 1989, 3715, 7875, 6841, 7009, 17809}}, {4552, 16, 14152, {1, 1, 1, 9, 25, 21, 19, 43, 329, 531, 491, 1147, 1469, 12841, 29651, 29517}}, {4553, 16, 14155, {1, 1, 5, 1, 15, 63, 101, 197, 477, 245, 341, 61, 3803, 10001, 5519, 19083}}, {4554, 16, 14157, {1, 3, 7, 5, 13, 43, 7, 143, 291, 531, 1727, 871, 7091, 5737, 24285, 51017}}, {4555, 16, 14188, {1, 3, 5, 1, 17, 13, 15, 85, 361, 153, 989, 1367, 4705, 3599, 4441, 52471}}, {4556, 16, 14206, {1, 1, 7, 13, 21, 43, 111, 29, 299, 439, 1929, 283, 5901, 14113, 3929, 55843}}, {4557, 16, 14243, {1, 3, 3, 9, 31, 59, 63, 43, 91, 171, 733, 1359, 425, 8505, 19777, 54723}}, {4558, 16, 14278, {1, 1, 5, 7, 31, 1, 97, 253, 331, 307, 1749, 2115, 2535, 9945, 11013, 14231}}, {4559, 16, 14308, {1, 1, 5, 11, 13, 7, 109, 237, 301, 383, 683, 1603, 6393, 2437, 12101, 1767}}, {4560, 16, 14317, {1, 1, 3, 11, 15, 61, 119, 199, 109, 265, 1431, 1729, 3409, 10129, 16945, 34681}}, {4561, 16, 14335, {1, 3, 7, 9, 13, 59, 121, 73, 29, 513, 279, 457, 7985, 15199, 10185, 33621}}, {4562, 16, 14354, {1, 3, 7, 7, 23, 17, 27, 65, 387, 487, 1803, 2789, 461, 11201, 7001, 40229}}, {4563, 16, 14356, {1, 1, 3, 15, 9, 13, 55, 127, 33, 513, 1055, 643, 505, 3005, 6121, 64147}}, {4564, 16, 14379, {1, 3, 5, 15, 5, 11, 77, 233, 175, 691, 171, 2491, 6915, 14195, 7845, 36499}}, {4565, 16, 14381, {1, 1, 5, 11, 19, 45, 103, 207, 99, 645, 1739, 1517, 5907, 16035, 14559, 44007}}, {4566, 16, 14384, {1, 3, 7, 15, 21, 27, 53, 107, 89, 291, 983, 3527, 1025, 2985, 13747, 32715}}, {4567, 16, 14389, {1, 1, 3, 15, 23, 17, 27, 209, 77, 959, 813, 3597, 5809, 693, 10325, 16855}}, {4568, 16, 14390, {1, 1, 7, 11, 23, 53, 123, 99, 211, 935, 1371, 1657, 4699, 2683, 27933, 21451}}, {4569, 16, 14414, {1, 3, 3, 3, 17, 21, 93, 201, 423, 351, 1639, 227, 5719, 13111, 5993, 44615}}, {4570, 16, 14425, {1, 1, 7, 3, 13, 49, 59, 255, 213, 147, 1441, 3593, 6419, 15657, 1947, 62713}}, {4571, 16, 14462, {1, 3, 1, 7, 7, 41, 79, 135, 275, 585, 925, 3139, 4351, 1827, 23533, 63031}}, {4572, 16, 14472, {1, 1, 7, 3, 11, 1, 13, 149, 29, 897, 1043, 2393, 3931, 6741, 19973, 46303}}, {4573, 16, 14508, {1, 1, 1, 13, 13, 57, 9, 253, 149, 67, 1531, 4049, 3013, 13947, 3371, 35317}}, {4574, 16, 14511, {1, 3, 1, 1, 15, 19, 11, 125, 179, 383, 1273, 1551, 6441, 6579, 19659, 31005}}, {4575, 16, 14519, {1, 1, 3, 15, 29, 37, 11, 199, 273, 663, 549, 3167, 2049, 8815, 30719, 47905}}, {4576, 16, 14528, {1, 1, 1, 15, 7, 9, 113, 231, 155, 27, 419, 1303, 4493, 5633, 5743, 51335}}, {4577, 16, 14561, {1, 3, 5, 13, 21, 35, 7, 63, 391, 637, 2011, 841, 5933, 10563, 7593, 34767}}, {4578, 16, 14574, {1, 3, 1, 15, 19, 13, 89, 127, 507, 715, 1305, 2989, 7551, 1953, 26101, 54913}}, {4579, 16, 14588, {1, 1, 5, 1, 1, 33, 101, 211, 173, 761, 177, 2721, 6949, 15801, 6639, 21405}}, {4580, 16, 14594, {1, 3, 1, 13, 15, 23, 113, 177, 43, 743, 57, 3875, 7833, 13619, 17637, 5547}}, {4581, 16, 14606, {1, 1, 3, 13, 21, 7, 123, 83, 391, 731, 597, 2595, 1949, 14619, 17141, 60595}}, {4582, 16, 14614, {1, 3, 7, 13, 31, 55, 15, 43, 17, 855, 233, 1411, 1063, 12977, 22159, 59185}}, {4583, 16, 14639, {1, 3, 7, 7, 17, 53, 67, 37, 245, 941, 1213, 1965, 6635, 10189, 12979, 63503}}, {4584, 16, 14641, {1, 1, 5, 15, 31, 23, 15, 175, 177, 643, 1705, 3541, 2009, 12005, 27281, 16821}}, {4585, 16, 14648, {1, 3, 1, 13, 27, 37, 1, 171, 255, 445, 171, 3555, 8169, 399, 20975, 36195}}, {4586, 16, 14668, {1, 3, 7, 11, 13, 15, 123, 65, 173, 317, 1991, 2093, 8073, 12831, 15455, 30175}}, {4587, 16, 14673, {1, 3, 1, 7, 5, 53, 59, 219, 407, 501, 875, 2627, 1335, 14387, 25523, 28337}}, {4588, 16, 14679, {1, 3, 3, 13, 13, 41, 93, 125, 41, 461, 887, 1085, 3393, 11945, 16329, 43531}}, {4589, 16, 14695, {1, 3, 1, 11, 21, 39, 1, 185, 429, 285, 443, 1165, 451, 10903, 31511, 50555}}, {4590, 16, 14702, {1, 1, 7, 5, 11, 25, 61, 171, 493, 733, 215, 1871, 7783, 14113, 2061, 58961}}, {4591, 16, 14704, {1, 1, 7, 7, 27, 23, 53, 45, 131, 301, 275, 3855, 4883, 6303, 25269, 12697}}, {4592, 16, 14740, {1, 3, 5, 7, 11, 15, 71, 101, 377, 803, 1369, 3741, 633, 10571, 30659, 31101}}, {4593, 16, 14754, {1, 1, 5, 15, 19, 53, 3, 153, 411, 685, 1405, 109, 5755, 13311, 3713, 24579}}, {4594, 16, 14774, {1, 1, 3, 3, 27, 7, 89, 39, 5, 853, 1757, 2927, 2889, 9735, 17959, 39301}}, {4595, 16, 14792, {1, 3, 1, 3, 13, 41, 57, 71, 187, 285, 825, 1807, 7261, 2645, 21861, 1839}}, {4596, 16, 14797, {1, 3, 3, 5, 15, 21, 23, 7, 341, 981, 891, 721, 7221, 3137, 28725, 54993}}, {4597, 16, 14806, {1, 1, 5, 3, 3, 61, 59, 97, 205, 359, 185, 3361, 7637, 15473, 6351, 62097}}, {4598, 16, 14812, {1, 1, 1, 9, 13, 11, 123, 71, 199, 251, 535, 371, 1605, 12107, 13833, 2019}}, {4599, 16, 14856, {1, 1, 7, 13, 27, 1, 43, 73, 409, 601, 1481, 649, 3293, 12257, 23377, 17225}}, {4600, 16, 14876, {1, 1, 7, 11, 15, 55, 99, 45, 261, 461, 1507, 3575, 4425, 9895, 20191, 61863}}, {4601, 16, 14900, {1, 3, 7, 1, 3, 7, 19, 85, 139, 691, 1685, 137, 7547, 16143, 14193, 52479}}, {4602, 16, 14910, {1, 3, 5, 9, 17, 61, 7, 189, 31, 641, 1381, 3999, 4909, 8463, 31761, 54493}}, {4603, 16, 14912, {1, 1, 5, 15, 17, 15, 69, 111, 55, 1011, 1859, 2643, 6043, 5125, 15875, 611}}, {4604, 16, 14915, {1, 1, 3, 5, 3, 33, 73, 227, 327, 369, 189, 1841, 5625, 1179, 18651, 34951}}, {4605, 16, 14922, {1, 3, 7, 13, 1, 17, 109, 149, 89, 889, 799, 3423, 2599, 14525, 12763, 23855}}, {4606, 16, 14939, {1, 1, 3, 15, 5, 63, 87, 7, 63, 171, 1215, 557, 3009, 16305, 23517, 40101}}, {4607, 16, 14946, {1, 1, 3, 3, 29, 31, 79, 183, 401, 813, 41, 1111, 5669, 15697, 7813, 10215}}, {4608, 16, 14955, {1, 1, 5, 7, 9, 25, 25, 57, 343, 375, 535, 3405, 1909, 3201, 2417, 52285}}, {4609, 16, 14966, {1, 1, 5, 9, 25, 19, 33, 183, 29, 991, 1045, 2249, 2933, 12525, 13943, 10423}}, {4610, 16, 14976, {1, 3, 1, 7, 3, 45, 49, 37, 429, 67, 821, 1289, 7311, 16165, 25861, 57715}}, {4611, 16, 14986, {1, 1, 7, 3, 19, 3, 33, 153, 505, 683, 611, 1691, 6421, 15517, 19161, 49013}}, {4612, 16, 14993, {1, 3, 7, 7, 21, 21, 85, 55, 293, 199, 1671, 1881, 7147, 8241, 16173, 51873}}, {4613, 16, 15012, {1, 3, 1, 15, 3, 61, 97, 191, 435, 511, 1599, 2705, 1897, 2607, 1801, 48583}}, {4614, 16, 15041, {1, 1, 5, 3, 9, 23, 23, 185, 401, 947, 33, 385, 7491, 14129, 14561, 13759}}, {4615, 16, 15053, {1, 3, 5, 15, 19, 21, 37, 233, 149, 673, 29, 1315, 3487, 6705, 28283, 43135}}, {4616, 16, 15056, {1, 1, 1, 11, 9, 35, 101, 255, 345, 829, 689, 2747, 2145, 2101, 24863, 35529}}, {4617, 16, 15059, {1, 3, 7, 9, 5, 5, 53, 247, 157, 729, 1621, 129, 2485, 5371, 11115, 47771}}, {4618, 16, 15110, {1, 1, 3, 9, 29, 29, 13, 229, 87, 281, 1119, 1085, 4423, 1667, 27067, 50397}}, {4619, 16, 15116, {1, 1, 3, 7, 11, 29, 77, 85, 121, 495, 501, 3209, 3531, 2307, 11367, 34135}}, {4620, 16, 15133, {1, 1, 7, 9, 3, 37, 33, 209, 493, 869, 367, 3221, 1643, 3353, 22851, 4313}}, {4621, 16, 15134, {1, 1, 1, 7, 15, 53, 27, 17, 29, 345, 821, 1831, 1963, 10089, 5101, 32689}}, {4622, 16, 15137, {1, 1, 3, 9, 9, 61, 31, 215, 497, 591, 1301, 157, 3329, 13877, 9017, 34673}}, {4623, 16, 15147, {1, 1, 5, 1, 29, 49, 93, 139, 279, 167, 143, 279, 6145, 6247, 519, 8869}}, {4624, 16, 15182, {1, 3, 3, 1, 25, 41, 81, 219, 505, 335, 1941, 2963, 413, 775, 4181, 55269}}, {4625, 16, 15203, {1, 1, 1, 11, 27, 23, 91, 9, 497, 811, 1469, 1999, 5377, 2943, 17635, 11151}}, {4626, 16, 15215, {1, 1, 5, 15, 17, 23, 15, 235, 271, 749, 1873, 3805, 5405, 7421, 24339, 14351}}, {4627, 16, 15245, {1, 3, 7, 1, 5, 61, 81, 9, 269, 43, 1391, 2711, 6973, 11299, 2263, 8715}}, {4628, 16, 15246, {1, 1, 5, 13, 11, 1, 69, 235, 25, 227, 63, 2591, 913, 12555, 6263, 38981}}, {4629, 16, 15264, {1, 3, 1, 7, 17, 7, 97, 251, 149, 959, 1895, 1179, 4031, 15975, 20313, 64067}}, {4630, 16, 15269, {1, 3, 7, 15, 3, 17, 85, 229, 149, 925, 585, 3755, 2359, 13131, 12665, 28861}}, {4631, 16, 15296, {1, 3, 3, 9, 5, 31, 107, 93, 347, 851, 1249, 2161, 6095, 8315, 20259, 39527}}, {4632, 16, 15314, {1, 3, 7, 7, 21, 63, 85, 241, 501, 627, 1211, 1713, 6907, 4229, 7557, 55719}}, {4633, 16, 15323, {1, 1, 1, 13, 19, 43, 21, 177, 13, 353, 679, 511, 5565, 993, 25345, 25087}}, {4634, 16, 15364, {1, 3, 3, 15, 21, 15, 87, 83, 381, 547, 1429, 2417, 2425, 2097, 20889, 12353}}, {4635, 16, 15386, {1, 3, 1, 11, 23, 21, 69, 147, 427, 271, 1829, 525, 2951, 10773, 32425, 17685}}, {4636, 16, 15391, {1, 3, 1, 7, 15, 55, 21, 131, 195, 927, 635, 3505, 3817, 14883, 1149, 10079}}, {4637, 16, 15436, {1, 3, 3, 9, 23, 15, 45, 147, 249, 87, 377, 1551, 4343, 15373, 2895, 44973}}, {4638, 16, 15460, {1, 3, 1, 7, 31, 63, 67, 107, 109, 1019, 815, 231, 8135, 559, 8175, 21735}}, {4639, 16, 15464, {1, 1, 5, 7, 7, 63, 103, 133, 167, 883, 1647, 2827, 6015, 8541, 16963, 37129}}, {4640, 16, 15469, {1, 3, 5, 9, 27, 25, 59, 147, 29, 943, 865, 1233, 2165, 15259, 2235, 25831}}, {4641, 16, 15470, {1, 1, 5, 7, 25, 5, 67, 89, 493, 111, 359, 1115, 7963, 6545, 7749, 29179}}, {4642, 16, 15477, {1, 3, 7, 5, 19, 17, 89, 195, 337, 115, 1417, 3837, 4761, 1959, 16205, 61597}}, {4643, 16, 15488, {1, 1, 5, 11, 25, 43, 3, 111, 491, 897, 1541, 909, 4751, 739, 7827, 64485}}, {4644, 16, 15494, {1, 1, 5, 15, 19, 61, 39, 111, 451, 419, 1657, 2427, 4589, 5577, 23967, 19259}}, {4645, 16, 15548, {1, 3, 3, 1, 31, 15, 7, 131, 329, 847, 537, 1775, 3833, 5683, 17267, 16389}}, {4646, 16, 15551, {1, 1, 7, 1, 9, 29, 13, 25, 409, 513, 1695, 2175, 5099, 727, 5723, 43547}}, {4647, 16, 15560, {1, 1, 5, 7, 13, 11, 29, 123, 127, 193, 1647, 3157, 2149, 16209, 19909, 14473}}, {4648, 16, 15563, {1, 1, 1, 15, 15, 37, 125, 157, 487, 143, 1891, 2895, 4397, 10685, 1463, 55027}}, {4649, 16, 15604, {1, 3, 7, 1, 1, 15, 115, 105, 479, 529, 1095, 2687, 4483, 15027, 15487, 7113}}, {4650, 16, 15607, {1, 1, 3, 9, 23, 63, 113, 211, 155, 931, 175, 3037, 2359, 10413, 24561, 21099}}, {4651, 16, 15616, {1, 3, 3, 11, 5, 15, 13, 37, 257, 447, 203, 545, 2467, 9979, 17543, 62703}}, {4652, 16, 15631, {1, 1, 3, 7, 17, 31, 83, 91, 79, 265, 1415, 2347, 5337, 7615, 27739, 33841}}, {4653, 16, 15699, {1, 3, 5, 7, 17, 63, 37, 153, 347, 909, 1945, 7, 2071, 15195, 32083, 26713}}, {4654, 16, 15701, {1, 1, 3, 11, 19, 51, 69, 21, 323, 635, 443, 1685, 6275, 13787, 20921, 45553}}, {4655, 16, 15708, {1, 3, 3, 7, 15, 35, 67, 247, 257, 429, 2029, 523, 3219, 3893, 26677, 53273}}, {4656, 16, 15739, {1, 1, 7, 9, 9, 3, 119, 121, 445, 149, 1539, 1887, 2995, 14867, 809, 48065}}, {4657, 16, 15746, {1, 3, 5, 13, 15, 27, 75, 9, 217, 35, 1363, 2383, 4357, 1153, 20565, 62277}}, {4658, 16, 15772, {1, 1, 7, 1, 21, 1, 11, 53, 331, 765, 407, 453, 2725, 11199, 645, 14915}}, {4659, 16, 15793, {1, 1, 5, 1, 29, 11, 5, 159, 395, 53, 323, 1347, 5529, 8525, 24003, 20535}}, {4660, 16, 15832, {1, 3, 3, 15, 9, 19, 87, 181, 391, 639, 703, 611, 997, 359, 2471, 58465}}, {4661, 16, 15837, {1, 3, 5, 9, 27, 9, 117, 47, 223, 509, 1537, 1235, 3885, 6767, 17131, 63421}}, {4662, 16, 15866, {1, 1, 5, 1, 15, 15, 113, 67, 477, 597, 1795, 3065, 4565, 3609, 16419, 19667}}, {4663, 16, 15899, {1, 1, 7, 11, 1, 63, 33, 211, 271, 773, 499, 2309, 1303, 14015, 30377, 53195}}, {4664, 16, 15911, {1, 1, 7, 11, 5, 23, 17, 183, 321, 315, 203, 3371, 907, 9331, 21031, 33765}}, {4665, 16, 15918, {1, 3, 3, 7, 7, 53, 111, 69, 441, 283, 195, 2415, 7293, 7659, 2731, 5417}}, {4666, 16, 15952, {1, 3, 5, 15, 3, 61, 5, 241, 427, 463, 1729, 653, 7671, 10979, 7247, 36931}}, {4667, 16, 15962, {1, 3, 1, 9, 3, 5, 105, 117, 465, 853, 2005, 3925, 4419, 4441, 3701, 50747}}, {4668, 16, 15967, {1, 1, 3, 7, 1, 3, 3, 149, 65, 405, 299, 99, 481, 14323, 11565, 6227}}, {4669, 16, 15973, {1, 3, 7, 5, 29, 3, 19, 3, 253, 895, 879, 2435, 2151, 10673, 11013, 43055}}, {4670, 16, 15977, {1, 3, 1, 11, 15, 57, 127, 197, 319, 913, 1039, 811, 7767, 5791, 31725, 8733}}, {4671, 16, 16016, {1, 1, 7, 3, 13, 25, 25, 81, 229, 185, 39, 2789, 579, 4973, 28617, 60871}}, {4672, 16, 16035, {1, 1, 7, 3, 25, 17, 41, 7, 103, 269, 55, 2651, 7579, 10935, 8917, 14323}}, {4673, 16, 16044, {1, 3, 7, 7, 13, 7, 99, 205, 293, 877, 1893, 3013, 2389, 6021, 2645, 18175}}, {4674, 16, 16067, {1, 1, 3, 7, 9, 39, 59, 187, 191, 761, 339, 3381, 2921, 5197, 16963, 43019}}, {4675, 16, 16082, {1, 3, 3, 13, 7, 23, 41, 203, 311, 981, 323, 1675, 6689, 579, 3885, 64475}}, {4676, 16, 16084, {1, 3, 5, 15, 21, 39, 35, 193, 167, 1009, 493, 829, 6571, 1299, 13061, 1163}}, {4677, 16, 16098, {1, 1, 3, 5, 3, 19, 123, 123, 111, 599, 193, 3419, 7173, 5595, 12449, 52247}}, {4678, 16, 16107, {1, 3, 5, 11, 9, 25, 65, 49, 239, 953, 481, 3455, 4335, 305, 22469, 11949}}, {4679, 16, 16142, {1, 1, 3, 7, 15, 1, 13, 77, 147, 49, 1445, 931, 3405, 15951, 15215, 26451}}, {4680, 16, 16149, {1, 3, 1, 1, 21, 53, 17, 7, 247, 243, 805, 795, 489, 13351, 13493, 30937}}, {4681, 16, 16165, {1, 3, 7, 5, 5, 13, 39, 115, 397, 757, 423, 2559, 1677, 9449, 24563, 869}}, {4682, 16, 16172, {1, 1, 3, 11, 23, 9, 27, 233, 165, 853, 1721, 599, 551, 11657, 27623, 40119}}, {4683, 16, 16178, {1, 1, 3, 1, 3, 47, 75, 207, 113, 417, 1317, 2215, 2395, 1841, 23125, 50401}}, {4684, 16, 16197, {1, 3, 3, 1, 13, 55, 103, 55, 351, 785, 1665, 3603, 7705, 4811, 21129, 38115}}, {4685, 16, 16201, {1, 1, 1, 5, 5, 49, 93, 189, 317, 701, 1545, 1017, 4133, 7655, 19827, 52155}}, {4686, 16, 16215, {1, 3, 3, 13, 17, 37, 7, 249, 139, 529, 235, 3801, 7871, 459, 15127, 13231}}, {4687, 16, 16221, {1, 3, 7, 5, 7, 63, 99, 241, 131, 455, 1287, 3539, 8029, 12661, 23313, 54029}}, {4688, 16, 16226, {1, 3, 1, 3, 29, 63, 51, 227, 497, 685, 1351, 449, 7851, 10815, 17379, 62097}}, {4689, 16, 16232, {1, 3, 1, 11, 25, 61, 73, 29, 467, 533, 855, 853, 5557, 10953, 18307, 27135}}, {4690, 16, 16246, {1, 1, 7, 3, 13, 49, 63, 171, 177, 283, 1365, 3087, 5445, 15109, 12523, 25193}}, {4691, 16, 16261, {1, 3, 5, 15, 9, 39, 95, 81, 417, 199, 1653, 3673, 2663, 8101, 12199, 22759}}, {4692, 16, 16279, {1, 1, 3, 9, 29, 15, 29, 215, 21, 721, 245, 1197, 7251, 5721, 6735, 7751}}, {4693, 16, 16280, {1, 3, 5, 5, 21, 7, 81, 61, 157, 707, 819, 1689, 4203, 5559, 25483, 43325}}, {4694, 16, 16290, {1, 1, 7, 13, 15, 51, 47, 197, 269, 921, 353, 2865, 6227, 537, 20015, 53823}}, {4695, 16, 16314, {1, 1, 3, 5, 13, 25, 91, 221, 111, 587, 1119, 2343, 4651, 4641, 15915, 36323}}, {4696, 16, 16345, {1, 1, 7, 11, 1, 45, 7, 215, 483, 545, 731, 3041, 3121, 8681, 20651, 4069}}, {4697, 16, 16355, {1, 3, 7, 13, 13, 27, 109, 65, 103, 805, 299, 2069, 6017, 14565, 20505, 16161}}, {4698, 16, 16361, {1, 1, 7, 5, 11, 33, 105, 213, 237, 583, 1033, 2333, 845, 6493, 505, 2563}}, {4699, 16, 16393, {1, 1, 5, 7, 3, 5, 11, 173, 373, 341, 269, 177, 3175, 9413, 601, 13591}}, {4700, 16, 16394, {1, 1, 5, 13, 7, 57, 61, 187, 121, 405, 665, 111, 7535, 3355, 14051, 511}}, {4701, 16, 16438, {1, 1, 1, 3, 3, 29, 15, 253, 227, 123, 333, 1343, 7313, 1955, 17741, 30831}}, {4702, 16, 16450, {1, 3, 5, 1, 5, 47, 65, 183, 199, 839, 925, 2711, 4609, 201, 15177, 29817}}, {4703, 16, 16507, {1, 3, 7, 9, 21, 63, 5, 163, 265, 581, 1795, 3937, 4641, 2073, 32225, 60831}}, {4704, 16, 16523, {1, 1, 1, 5, 7, 47, 125, 203, 511, 841, 1937, 3431, 1495, 12827, 5893, 19265}}, {4705, 16, 16533, {1, 1, 5, 5, 9, 49, 17, 247, 391, 241, 3, 2253, 6319, 89, 4449, 6371}}, {4706, 16, 16603, {1, 3, 1, 1, 31, 7, 51, 61, 461, 391, 273, 1609, 5825, 16029, 3851, 39213}}, {4707, 16, 16648, {1, 3, 3, 7, 29, 21, 65, 75, 317, 925, 1319, 3827, 965, 5685, 17007, 64365}}, {4708, 16, 16653, {1, 3, 1, 5, 23, 23, 109, 59, 31, 659, 635, 2209, 857, 9847, 2507, 18325}}, {4709, 16, 16672, {1, 1, 1, 1, 17, 51, 53, 77, 461, 147, 229, 2821, 2405, 1259, 1121, 17429}}, {4710, 16, 16682, {1, 3, 5, 3, 31, 3, 57, 157, 321, 731, 1609, 2139, 899, 12599, 19803, 51083}}, {4711, 16, 16709, {1, 1, 3, 11, 27, 43, 73, 209, 431, 587, 1247, 2803, 3593, 1351, 18701, 33423}}, {4712, 16, 16713, {1, 3, 5, 13, 27, 19, 67, 245, 339, 879, 2035, 1801, 5845, 3883, 22057, 15771}}, {4713, 16, 16719, {1, 1, 3, 11, 11, 55, 93, 51, 57, 127, 1325, 3975, 3989, 2347, 18831, 2979}}, {4714, 16, 16733, {1, 1, 1, 13, 17, 1, 17, 103, 303, 777, 1973, 2943, 7439, 8953, 27227, 10229}}, {4715, 16, 16740, {1, 3, 3, 15, 1, 41, 53, 219, 415, 399, 995, 205, 7719, 10937, 31879, 755}}, {4716, 16, 16761, {1, 3, 7, 9, 13, 7, 99, 93, 419, 1019, 1605, 161, 3831, 9147, 7877, 1333}}, {4717, 16, 16767, {1, 3, 7, 15, 5, 51, 37, 115, 259, 549, 353, 2067, 7657, 1283, 20333, 2325}}, {4718, 16, 16771, {1, 1, 3, 3, 23, 33, 63, 233, 363, 719, 1099, 471, 3079, 10577, 19063, 31535}}, {4719, 16, 16788, {1, 3, 7, 15, 23, 19, 109, 105, 497, 881, 1055, 537, 4607, 239, 22785, 60201}}, {4720, 16, 16811, {1, 3, 3, 5, 19, 11, 1, 207, 163, 437, 713, 667, 1427, 7505, 28055, 43101}}, {4721, 16, 16814, {1, 3, 5, 5, 25, 45, 75, 9, 109, 545, 573, 2685, 1013, 2973, 18619, 55945}}, {4722, 16, 16816, {1, 1, 1, 3, 27, 27, 39, 33, 285, 453, 613, 2707, 2155, 4355, 21105, 7969}}, {4723, 16, 16828, {1, 3, 3, 9, 1, 31, 71, 101, 491, 409, 65, 1479, 5743, 525, 2863, 53657}}, {4724, 16, 16834, {1, 1, 3, 1, 17, 63, 55, 11, 125, 447, 275, 2243, 6827, 5753, 32401, 13819}}, {4725, 16, 16863, {1, 1, 3, 9, 21, 47, 5, 127, 285, 471, 1681, 945, 6141, 5651, 10273, 30811}}, {4726, 16, 16864, {1, 3, 3, 1, 13, 53, 91, 3, 255, 429, 107, 2937, 2971, 10251, 15009, 37477}}, {4727, 16, 16879, {1, 1, 7, 13, 21, 63, 73, 3, 63, 491, 101, 1981, 7457, 879, 6243, 22275}}, {4728, 16, 16888, {1, 3, 1, 1, 11, 43, 121, 101, 293, 639, 645, 2723, 2075, 3629, 22105, 18199}}, {4729, 16, 16904, {1, 1, 3, 1, 31, 9, 69, 97, 511, 663, 1147, 1237, 389, 255, 8661, 38533}}, {4730, 16, 16909, {1, 3, 3, 7, 3, 13, 23, 71, 197, 439, 2003, 1771, 8073, 1549, 29089, 5409}}, {4731, 16, 16921, {1, 3, 1, 1, 9, 23, 1, 221, 159, 699, 593, 3385, 3869, 10105, 22097, 34753}}, {4732, 16, 16934, {1, 1, 7, 1, 29, 47, 41, 137, 333, 357, 325, 3151, 6641, 3823, 8763, 28327}}, {4733, 16, 16951, {1, 3, 1, 7, 19, 19, 39, 225, 477, 619, 583, 229, 6177, 9615, 1203, 13711}}, {4734, 16, 16983, {1, 1, 3, 13, 9, 41, 127, 147, 13, 301, 861, 2019, 3517, 1147, 21587, 42387}}, {4735, 16, 16999, {1, 1, 5, 11, 9, 63, 11, 121, 251, 199, 483, 2287, 4667, 3887, 10611, 6019}}, {4736, 16, 17000, {1, 1, 3, 13, 23, 19, 89, 73, 355, 399, 749, 687, 5707, 11443, 817, 38967}}, {4737, 16, 17006, {1, 3, 5, 9, 3, 23, 115, 207, 373, 541, 73, 1285, 7245, 12505, 5787, 61207}}, {4738, 16, 17020, {1, 3, 5, 15, 27, 37, 115, 203, 195, 793, 1577, 1283, 7299, 4025, 5319, 5375}}, {4739, 16, 17030, {1, 1, 7, 15, 25, 19, 61, 11, 215, 771, 1057, 451, 1965, 13693, 25617, 42657}}, {4740, 16, 17033, {1, 3, 3, 7, 1, 19, 23, 217, 175, 901, 2009, 2989, 5111, 5027, 4805, 37843}}, {4741, 16, 17044, {1, 3, 1, 11, 11, 37, 3, 131, 459, 769, 201, 3979, 3009, 8691, 27005, 32175}}, {4742, 16, 17051, {1, 3, 5, 7, 27, 27, 117, 23, 403, 1003, 1501, 785, 6313, 10187, 5085, 30751}}, {4743, 16, 17072, {1, 1, 7, 3, 11, 41, 73, 151, 19, 657, 131, 1901, 3879, 14995, 24085, 56621}}, {4744, 16, 17078, {1, 3, 7, 15, 23, 3, 61, 199, 67, 483, 1961, 3583, 5937, 5749, 16685, 11831}}, {4745, 16, 17084, {1, 1, 3, 15, 25, 15, 97, 9, 299, 641, 883, 2901, 123, 1523, 7055, 15609}}, {4746, 16, 17087, {1, 3, 5, 5, 31, 55, 19, 45, 239, 543, 2005, 1041, 1711, 11059, 19927, 17475}}, {4747, 16, 17090, {1, 1, 3, 9, 5, 59, 105, 209, 323, 613, 1963, 2227, 2947, 11761, 21375, 13265}}, {4748, 16, 17123, {1, 3, 3, 15, 1, 5, 117, 37, 93, 243, 305, 2299, 5163, 9205, 28761, 35987}}, {4749, 16, 17132, {1, 1, 1, 5, 5, 29, 13, 147, 457, 187, 1729, 1547, 7745, 13155, 7833, 57449}}, {4750, 16, 17140, {1, 3, 3, 13, 1, 51, 49, 253, 23, 389, 1611, 3045, 5909, 3947, 25105, 3327}}, {4751, 16, 17149, {1, 3, 1, 11, 15, 47, 19, 15, 231, 57, 763, 1879, 1765, 14861, 22893, 19437}}, {4752, 16, 17157, {1, 1, 3, 15, 1, 19, 85, 65, 139, 629, 361, 3513, 3807, 799, 8349, 29247}}, {4753, 16, 17164, {1, 3, 3, 13, 9, 11, 65, 201, 471, 89, 355, 121, 3947, 10775, 3599, 6041}}, {4754, 16, 17170, {1, 3, 7, 3, 5, 53, 33, 167, 431, 129, 1449, 3263, 7691, 12569, 7551, 41101}}, {4755, 16, 17179, {1, 1, 3, 15, 9, 41, 5, 239, 361, 773, 955, 3663, 6051, 12889, 5841, 59615}}, {4756, 16, 17237, {1, 1, 7, 5, 5, 33, 97, 9, 495, 845, 1953, 3533, 5715, 15055, 25211, 9351}}, {4757, 16, 17248, {1, 3, 1, 11, 25, 37, 83, 153, 289, 739, 353, 1121, 7641, 2081, 28439, 38085}}, {4758, 16, 17260, {1, 3, 1, 1, 27, 9, 63, 135, 395, 641, 1759, 3727, 4371, 5193, 2783, 12389}}, {4759, 16, 17272, {1, 3, 3, 15, 3, 9, 5, 153, 111, 675, 1957, 3817, 4269, 10787, 3413, 34199}}, {4760, 16, 17275, {1, 3, 5, 9, 23, 23, 97, 137, 255, 249, 333, 2329, 1055, 13769, 13109, 33443}}, {4761, 16, 17287, {1, 1, 1, 15, 7, 37, 99, 219, 483, 755, 263, 3523, 6179, 4817, 29873, 12771}}, {4762, 16, 17294, {1, 1, 3, 5, 23, 7, 77, 97, 105, 631, 175, 1911, 7271, 1009, 24081, 61207}}, {4763, 16, 17296, {1, 3, 5, 3, 1, 31, 71, 91, 265, 669, 1839, 3989, 8127, 15001, 1419, 8895}}, {4764, 16, 17305, {1, 3, 1, 13, 27, 51, 93, 155, 49, 991, 653, 203, 3863, 5363, 31969, 36083}}, {4765, 16, 17312, {1, 3, 3, 7, 31, 27, 21, 73, 21, 675, 407, 1215, 2963, 6799, 15259, 13125}}, {4766, 16, 17321, {1, 3, 5, 13, 5, 53, 19, 215, 243, 487, 689, 2519, 6393, 3987, 30847, 37919}}, {4767, 16, 17367, {1, 3, 3, 7, 5, 31, 115, 231, 255, 955, 2023, 1487, 6575, 9873, 22585, 29951}}, {4768, 16, 17368, {1, 3, 5, 11, 11, 57, 109, 203, 417, 29, 1311, 893, 1047, 2413, 9305, 38219}}, {4769, 16, 17378, {1, 3, 1, 7, 23, 51, 113, 3, 105, 915, 1145, 3431, 7331, 3323, 31669, 21485}}, {4770, 16, 17433, {1, 1, 7, 13, 9, 29, 119, 205, 403, 1023, 257, 863, 2983, 1895, 16539, 23385}}, {4771, 16, 17455, {1, 1, 7, 13, 27, 21, 47, 139, 341, 509, 1107, 2197, 3649, 14301, 30789, 48783}}, {4772, 16, 17457, {1, 3, 3, 7, 25, 19, 99, 11, 309, 919, 1809, 3015, 1587, 3779, 1289, 30207}}, {4773, 16, 17508, {1, 3, 5, 11, 9, 43, 57, 171, 9, 151, 173, 2301, 7723, 2083, 319, 52883}}, {4774, 16, 17559, {1, 1, 3, 1, 3, 13, 63, 11, 231, 117, 1257, 237, 581, 13871, 15501, 8741}}, {4775, 16, 17560, {1, 3, 5, 9, 13, 63, 55, 155, 291, 721, 123, 929, 3351, 11651, 12513, 1779}}, {4776, 16, 17582, {1, 3, 7, 3, 31, 5, 61, 81, 465, 639, 1363, 3157, 2401, 9513, 32559, 34477}}, {4777, 16, 17596, {1, 3, 1, 15, 27, 25, 3, 117, 277, 13, 707, 3825, 7287, 10181, 30127, 57247}}, {4778, 16, 17599, {1, 1, 7, 11, 21, 21, 53, 17, 407, 851, 1191, 285, 6815, 1595, 25507, 8099}}, {4779, 16, 17613, {1, 3, 5, 9, 9, 61, 83, 61, 65, 671, 63, 311, 6897, 15327, 29809, 4899}}, {4780, 16, 17619, {1, 1, 7, 1, 21, 45, 99, 235, 477, 461, 1119, 4087, 2057, 14861, 31969, 24357}}, {4781, 16, 17622, {1, 1, 7, 9, 31, 9, 65, 123, 281, 273, 1059, 1625, 6265, 9635, 11563, 45053}}, {4782, 16, 17655, {1, 3, 3, 7, 1, 41, 15, 23, 43, 727, 1271, 1741, 765, 13265, 4145, 1335}}, {4783, 16, 17661, {1, 1, 3, 7, 17, 55, 107, 231, 263, 197, 659, 3621, 2789, 5171, 28635, 13595}}, {4784, 16, 17698, {1, 1, 5, 1, 27, 23, 13, 83, 431, 507, 1571, 1573, 1733, 12171, 8181, 30843}}, {4785, 16, 17712, {1, 3, 7, 11, 1, 53, 107, 39, 497, 579, 453, 1339, 1415, 10317, 2741, 34599}}, {4786, 16, 17715, {1, 3, 3, 5, 31, 41, 49, 41, 33, 665, 1783, 87, 317, 6603, 22603, 22879}}, {4787, 16, 17721, {1, 3, 1, 15, 5, 47, 41, 87, 231, 853, 1615, 2299, 4643, 9249, 15641, 14323}}, {4788, 16, 17722, {1, 3, 7, 9, 5, 45, 55, 153, 31, 247, 67, 2335, 6057, 4379, 27579, 38437}}, {4789, 16, 17742, {1, 1, 5, 7, 9, 3, 73, 81, 479, 909, 1097, 3945, 4485, 7815, 22855, 20825}}, {4790, 16, 17778, {1, 3, 1, 15, 19, 43, 97, 57, 339, 167, 135, 1777, 7681, 9715, 13863, 6347}}, {4791, 16, 17818, {1, 1, 1, 1, 5, 53, 33, 123, 449, 165, 1283, 2977, 5919, 12929, 32073, 61851}}, {4792, 16, 17836, {1, 1, 5, 15, 27, 27, 19, 157, 267, 651, 1319, 3841, 7739, 9947, 16801, 41325}}, {4793, 16, 17841, {1, 3, 7, 9, 19, 7, 83, 95, 401, 293, 437, 1983, 119, 7553, 11097, 11925}}, {4794, 16, 17856, {1, 1, 3, 5, 21, 1, 53, 201, 385, 843, 1801, 99, 2697, 9659, 28789, 31417}}, {4795, 16, 17883, {1, 1, 5, 5, 29, 57, 103, 89, 77, 597, 1849, 3433, 4267, 11167, 3841, 44023}}, {4796, 16, 17896, {1, 1, 7, 1, 21, 47, 113, 253, 249, 431, 1899, 2859, 7345, 5725, 14805, 19999}}, {4797, 16, 17901, {1, 3, 3, 5, 1, 11, 77, 213, 359, 665, 1855, 2743, 2407, 14677, 17957, 63257}}, {4798, 16, 17926, {1, 3, 7, 13, 23, 29, 127, 183, 275, 849, 1005, 3159, 3867, 13029, 7527, 13035}}, {4799, 16, 17937, {1, 1, 1, 15, 29, 47, 81, 225, 77, 879, 1279, 1929, 1457, 2025, 32229, 2847}}, {4800, 16, 17992, {1, 1, 1, 3, 29, 45, 37, 189, 217, 53, 281, 1785, 1929, 763, 5875, 34303}}, {4801, 16, 17995, {1, 3, 1, 9, 21, 61, 21, 149, 215, 13, 1221, 5, 7153, 14089, 3119, 33115}}, {4802, 16, 17998, {1, 3, 7, 11, 7, 57, 89, 185, 485, 649, 1765, 747, 2983, 6791, 25015, 13627}}, {4803, 16, 18021, {1, 1, 1, 9, 11, 53, 77, 203, 425, 237, 487, 2317, 1047, 8277, 23405, 30445}}, {4804, 16, 18039, {1, 1, 3, 5, 7, 29, 39, 195, 109, 381, 655, 931, 4469, 16215, 10627, 64171}}, {4805, 16, 18067, {1, 3, 1, 3, 5, 9, 89, 131, 509, 275, 489, 3161, 3701, 11951, 6579, 42839}}, {4806, 16, 18122, {1, 3, 7, 13, 15, 37, 65, 91, 305, 433, 1815, 169, 3117, 47, 30331, 34863}}, {4807, 16, 18129, {1, 3, 3, 9, 21, 3, 21, 113, 25, 833, 1579, 4021, 3481, 55, 20833, 46277}}, {4808, 16, 18130, {1, 1, 1, 5, 19, 37, 61, 229, 61, 363, 817, 1235, 6235, 7261, 29917, 43057}}, {4809, 16, 18142, {1, 3, 1, 9, 7, 59, 119, 189, 341, 945, 633, 3683, 2589, 15453, 4989, 40055}}, {4810, 16, 18148, {1, 1, 1, 5, 25, 63, 61, 73, 207, 205, 1011, 2857, 8137, 2121, 26731, 46011}}, {4811, 16, 18163, {1, 3, 7, 11, 13, 59, 107, 57, 49, 555, 441, 1771, 4939, 12107, 8263, 16243}}, {4812, 16, 18192, {1, 3, 5, 13, 15, 49, 89, 217, 83, 225, 2001, 2727, 4651, 619, 16473, 47525}}, {4813, 16, 18211, {1, 3, 5, 9, 5, 63, 115, 91, 337, 757, 703, 559, 1683, 14875, 30769, 30331}}, {4814, 16, 18228, {1, 3, 1, 15, 3, 3, 119, 79, 487, 519, 523, 1177, 7105, 12343, 24671, 31711}}, {4815, 16, 18264, {1, 1, 7, 15, 25, 63, 87, 23, 59, 277, 849, 953, 4567, 11309, 26181, 749}}, {4816, 16, 18347, {1, 3, 7, 15, 5, 33, 21, 127, 3, 239, 839, 997, 7253, 8183, 19779, 4185}}, {4817, 16, 18372, {1, 1, 5, 15, 25, 37, 99, 51, 465, 137, 1339, 541, 4319, 9883, 17425, 30743}}, {4818, 16, 18409, {1, 3, 3, 5, 13, 7, 3, 249, 365, 749, 527, 3675, 3005, 12905, 9621, 899}}, {4819, 16, 18412, {1, 3, 3, 7, 29, 31, 69, 21, 365, 1021, 1329, 2623, 3549, 5491, 21293, 63771}}, {4820, 16, 18418, {1, 1, 5, 9, 5, 35, 53, 247, 193, 17, 227, 381, 5233, 821, 3991, 4439}}, {4821, 16, 18423, {1, 1, 7, 15, 5, 59, 27, 167, 489, 335, 1565, 2999, 1777, 5009, 519, 57967}}, {4822, 16, 18433, {1, 1, 1, 11, 25, 47, 23, 155, 419, 863, 1905, 355, 1089, 5871, 10149, 53341}}, {4823, 16, 18439, {1, 1, 7, 7, 29, 55, 127, 83, 33, 309, 2017, 1021, 5987, 1101, 13657, 60587}}, {4824, 16, 18445, {1, 1, 1, 7, 3, 1, 9, 75, 257, 407, 659, 529, 2087, 14759, 14483, 36425}}, {4825, 16, 18451, {1, 3, 7, 3, 11, 29, 113, 255, 301, 799, 1171, 3721, 135, 3467, 7109, 50339}}, {4826, 16, 18467, {1, 1, 1, 7, 21, 25, 15, 31, 61, 491, 57, 189, 2033, 4363, 31295, 16313}}, {4827, 16, 18502, {1, 1, 5, 1, 5, 17, 33, 77, 483, 469, 355, 2245, 4165, 459, 30411, 29507}}, {4828, 16, 18514, {1, 1, 3, 13, 1, 27, 29, 85, 491, 787, 1157, 1299, 4743, 14795, 32587, 12807}}, {4829, 16, 18547, {1, 3, 3, 1, 23, 45, 35, 129, 3, 55, 969, 2387, 3929, 10397, 19879, 2723}}, {4830, 16, 18575, {1, 1, 1, 7, 19, 3, 9, 23, 497, 347, 2039, 913, 5925, 7965, 5789, 40949}}, {4831, 16, 18593, {1, 1, 7, 1, 29, 61, 89, 3, 133, 647, 1585, 2661, 1875, 1859, 3937, 12707}}, {4832, 16, 18613, {1, 3, 3, 7, 25, 11, 41, 149, 427, 463, 901, 2433, 2617, 13511, 3443, 39867}}, {4833, 16, 18620, {1, 1, 1, 5, 27, 33, 103, 251, 201, 1023, 1979, 3745, 6365, 14945, 22153, 55535}}, {4834, 16, 18637, {1, 3, 1, 15, 23, 25, 57, 215, 111, 181, 385, 1123, 3095, 7085, 31863, 37393}}, {4835, 16, 18640, {1, 3, 5, 13, 17, 35, 27, 159, 255, 241, 413, 1823, 5329, 1825, 28489, 58763}}, {4836, 16, 18712, {1, 3, 1, 15, 3, 33, 97, 27, 409, 889, 409, 2315, 4743, 14827, 3037, 57149}}, {4837, 16, 18728, {1, 1, 3, 5, 19, 63, 93, 51, 233, 715, 1571, 1101, 2751, 14805, 25683, 13323}}, {4838, 16, 18742, {1, 3, 7, 3, 21, 15, 117, 179, 263, 229, 199, 2597, 3999, 3037, 3801, 4775}}, {4839, 16, 18748, {1, 3, 3, 15, 1, 15, 49, 91, 383, 21, 1955, 773, 1213, 5971, 19525, 8699}}, {4840, 16, 18753, {1, 3, 1, 15, 29, 49, 11, 101, 261, 761, 709, 3811, 4055, 15675, 32305, 15173}}, {4841, 16, 18756, {1, 1, 1, 3, 9, 41, 127, 23, 413, 461, 237, 1595, 2257, 2971, 31845, 61485}}, {4842, 16, 18771, {1, 1, 1, 11, 23, 13, 63, 21, 23, 209, 1317, 1071, 3619, 7275, 9343, 21455}}, {4843, 16, 18814, {1, 1, 5, 9, 31, 35, 41, 249, 477, 569, 1175, 1571, 4679, 10337, 3507, 23415}}, {4844, 16, 18818, {1, 3, 5, 11, 29, 3, 117, 65, 301, 913, 1709, 1765, 1801, 15513, 31495, 38131}}, {4845, 16, 18827, {1, 3, 5, 11, 27, 3, 71, 195, 81, 313, 505, 3941, 3797, 2031, 24151, 65085}}, {4846, 16, 18835, {1, 1, 1, 5, 13, 17, 59, 151, 191, 489, 1267, 3207, 4495, 15145, 12789, 46313}}, {4847, 16, 18842, {1, 3, 1, 7, 29, 9, 25, 31, 33, 527, 1939, 4089, 333, 757, 8895, 25331}}, {4848, 16, 18854, {1, 1, 1, 1, 9, 27, 11, 205, 211, 141, 1171, 1881, 4029, 10587, 30103, 39661}}, {4849, 16, 18858, {1, 1, 3, 3, 23, 3, 23, 175, 355, 753, 183, 1331, 6403, 3369, 29891, 11109}}, {4850, 16, 18895, {1, 3, 7, 3, 17, 25, 95, 145, 135, 525, 1073, 1841, 3951, 2027, 23053, 19699}}, {4851, 16, 18914, {1, 1, 5, 3, 11, 43, 117, 67, 299, 885, 1095, 2777, 8185, 14331, 29543, 655}}, {4852, 16, 18925, {1, 3, 7, 7, 3, 59, 127, 147, 323, 713, 99, 1179, 6395, 1821, 12673, 35587}}, {4853, 16, 18933, {1, 3, 5, 3, 7, 11, 33, 87, 99, 967, 1443, 1585, 6215, 15125, 30747, 21513}}, {4854, 16, 18937, {1, 3, 7, 11, 23, 5, 91, 171, 229, 601, 833, 3157, 1691, 15081, 20607, 7643}}, {4855, 16, 18944, {1, 1, 3, 1, 5, 1, 39, 59, 157, 7, 601, 2079, 3045, 3693, 26511, 13245}}, {4856, 16, 18973, {1, 3, 5, 9, 9, 27, 83, 135, 185, 379, 2027, 1407, 7409, 7363, 26471, 35907}}, {4857, 16, 19001, {1, 3, 7, 15, 29, 49, 1, 69, 383, 915, 183, 3809, 4511, 8751, 4715, 7033}}, {4858, 16, 19012, {1, 3, 3, 3, 1, 17, 71, 233, 243, 933, 1165, 3089, 3565, 6521, 13203, 13065}}, {4859, 16, 19016, {1, 1, 5, 9, 9, 55, 53, 129, 331, 943, 587, 2573, 2247, 15101, 4987, 62983}}, {4860, 16, 19027, {1, 3, 1, 13, 11, 43, 45, 127, 129, 857, 669, 321, 3915, 4477, 26973, 19911}}, {4861, 16, 19040, {1, 3, 1, 13, 15, 3, 83, 23, 13, 441, 953, 2373, 3539, 4895, 26327, 61961}}, {4862, 16, 19074, {1, 1, 5, 13, 23, 11, 125, 83, 339, 901, 1809, 2691, 3789, 15007, 10569, 65399}}, {4863, 16, 19085, {1, 3, 1, 1, 17, 27, 105, 199, 435, 245, 1227, 3029, 3911, 1021, 2931, 24957}}, {4864, 16, 19093, {1, 3, 1, 11, 17, 5, 123, 39, 413, 627, 1149, 3925, 6635, 8959, 31387, 65047}}, {4865, 16, 19100, {1, 3, 5, 1, 23, 41, 93, 217, 21, 115, 1311, 3901, 2559, 2925, 30755, 7575}}, {4866, 16, 19107, {1, 1, 3, 9, 13, 11, 63, 171, 135, 983, 1679, 395, 7349, 5153, 26405, 40589}}, {4867, 16, 19128, {1, 3, 7, 13, 27, 47, 53, 169, 85, 871, 1087, 619, 7399, 9719, 6349, 59211}}, {4868, 16, 19141, {1, 3, 3, 15, 31, 45, 3, 33, 11, 879, 929, 1977, 1939, 1049, 16159, 41515}}, {4869, 16, 19142, {1, 3, 5, 11, 9, 27, 13, 23, 127, 747, 1121, 2497, 8141, 8601, 12431, 3243}}, {4870, 16, 19156, {1, 3, 7, 15, 23, 43, 23, 225, 283, 13, 1837, 2089, 6435, 10121, 22307, 58767}}, {4871, 16, 19169, {1, 1, 5, 11, 17, 3, 41, 221, 143, 669, 261, 1367, 7813, 15265, 32751, 62007}}, {4872, 16, 19176, {1, 1, 1, 1, 5, 45, 41, 161, 327, 185, 1403, 485, 2831, 10025, 12555, 47661}}, {4873, 16, 19222, {1, 3, 7, 1, 31, 55, 87, 83, 439, 929, 653, 4095, 5443, 7361, 27801, 12979}}, {4874, 16, 19226, {1, 3, 1, 7, 1, 57, 11, 145, 55, 269, 711, 1889, 8023, 7171, 3247, 35691}}, {4875, 16, 19247, {1, 1, 1, 3, 15, 1, 15, 131, 479, 797, 815, 2343, 1603, 10775, 21341, 20825}}, {4876, 16, 19259, {1, 3, 5, 9, 3, 27, 31, 117, 441, 177, 215, 3991, 3197, 8397, 19195, 3883}}, {4877, 16, 19262, {1, 1, 5, 13, 1, 19, 13, 27, 157, 1001, 43, 251, 7997, 7495, 16515, 44287}}, {4878, 16, 19291, {1, 1, 3, 5, 17, 57, 117, 53, 413, 905, 551, 149, 7531, 14885, 32493, 34961}}, {4879, 16, 19309, {1, 3, 3, 7, 27, 1, 7, 13, 259, 21, 189, 451, 6171, 3603, 12053, 45619}}, {4880, 16, 19324, {1, 1, 7, 11, 5, 41, 59, 119, 419, 93, 1399, 629, 1269, 3789, 17035, 61583}}, {4881, 16, 19334, {1, 3, 5, 11, 1, 11, 59, 83, 473, 273, 839, 3111, 3081, 10159, 6143, 16297}}, {4882, 16, 19338, {1, 1, 5, 15, 25, 15, 17, 63, 275, 927, 189, 89, 6595, 4399, 27201, 57205}}, {4883, 16, 19343, {1, 1, 7, 3, 31, 17, 63, 203, 321, 655, 1751, 2985, 3291, 11567, 15135, 49747}}, {4884, 16, 19376, {1, 3, 5, 13, 27, 25, 89, 39, 299, 833, 1269, 271, 6481, 3045, 7203, 20279}}, {4885, 16, 19408, {1, 3, 1, 1, 29, 13, 13, 37, 33, 563, 1825, 3257, 3153, 963, 25801, 15861}}, {4886, 16, 19413, {1, 3, 5, 11, 15, 7, 49, 117, 479, 221, 579, 2995, 1673, 14927, 2869, 35547}}, {4887, 16, 19420, {1, 3, 1, 11, 31, 11, 77, 161, 183, 187, 1967, 3037, 4441, 10547, 1443, 8619}}, {4888, 16, 19441, {1, 1, 3, 11, 27, 41, 83, 179, 293, 421, 1395, 1673, 6375, 9801, 14265, 18117}}, {4889, 16, 19444, {1, 1, 3, 7, 9, 19, 55, 235, 499, 637, 1121, 3583, 8007, 3749, 20903, 6179}}, {4890, 16, 19454, {1, 3, 7, 13, 9, 55, 125, 77, 395, 9, 2005, 2247, 1609, 6805, 13099, 26367}}, {4891, 16, 19461, {1, 3, 5, 13, 9, 41, 49, 133, 443, 995, 209, 341, 8013, 11037, 29663, 21161}}, {4892, 16, 19473, {1, 3, 1, 1, 1, 47, 45, 243, 161, 433, 129, 39, 4885, 8777, 6395, 16953}}, {4893, 16, 19479, {1, 3, 3, 15, 11, 13, 41, 113, 279, 657, 763, 2411, 7115, 463, 10759, 50493}}, {4894, 16, 19489, {1, 1, 5, 5, 31, 5, 25, 181, 385, 445, 625, 313, 4983, 11763, 6065, 63835}}, {4895, 16, 19591, {1, 3, 3, 15, 13, 25, 103, 5, 205, 223, 1327, 73, 677, 6751, 2071, 24963}}, {4896, 16, 19605, {1, 1, 7, 15, 21, 61, 21, 11, 47, 775, 113, 991, 1943, 1459, 18049, 45025}}, {4897, 16, 19616, {1, 3, 3, 1, 11, 43, 27, 89, 49, 711, 173, 181, 1261, 2751, 21321, 5467}}, {4898, 16, 19619, {1, 3, 3, 7, 17, 7, 57, 61, 87, 973, 985, 1849, 559, 7319, 11457, 46071}}, {4899, 16, 19653, {1, 1, 1, 1, 9, 37, 99, 157, 423, 189, 1355, 3983, 6357, 10825, 26517, 45815}}, {4900, 16, 19654, {1, 1, 3, 11, 23, 33, 57, 55, 59, 831, 339, 725, 359, 14859, 17523, 36149}}, {4901, 16, 19681, {1, 1, 5, 5, 27, 29, 47, 147, 153, 801, 1737, 3617, 5447, 8011, 30631, 7921}}, {4902, 16, 19711, {1, 1, 5, 1, 11, 43, 35, 105, 69, 453, 1023, 875, 6755, 6015, 12449, 50235}}, {4903, 16, 19719, {1, 3, 1, 5, 29, 31, 43, 89, 369, 891, 1447, 353, 8103, 2555, 1197, 64005}}, {4904, 16, 19726, {1, 3, 3, 9, 21, 33, 117, 205, 473, 289, 1699, 2361, 7083, 13001, 24127, 48611}}, {4905, 16, 19738, {1, 3, 3, 15, 3, 23, 79, 139, 475, 511, 181, 1331, 6137, 2653, 14071, 16947}}, {4906, 16, 19767, {1, 3, 3, 1, 11, 47, 51, 217, 305, 599, 1609, 237, 4537, 5377, 717, 13269}}, {4907, 16, 19819, {1, 1, 7, 3, 19, 31, 1, 173, 509, 817, 785, 1223, 5585, 8911, 643, 44575}}, {4908, 16, 19864, {1, 1, 3, 11, 5, 11, 31, 129, 269, 369, 1833, 2885, 441, 11517, 2323, 26735}}, {4909, 16, 19867, {1, 1, 5, 9, 7, 51, 31, 21, 5, 157, 541, 2939, 4569, 1679, 17467, 27995}}, {4910, 16, 19885, {1, 1, 7, 3, 21, 33, 85, 213, 41, 851, 1947, 3205, 5065, 6079, 30789, 63677}}, {4911, 16, 19894, {1, 1, 5, 3, 9, 53, 3, 179, 157, 407, 537, 1193, 4645, 13791, 28153, 11349}}, {4912, 16, 19900, {1, 1, 7, 13, 25, 61, 9, 151, 263, 143, 1583, 2859, 6617, 8861, 4163, 40695}}, {4913, 16, 19903, {1, 1, 1, 1, 7, 25, 19, 207, 335, 1019, 1919, 3893, 831, 12421, 4667, 38967}}, {4914, 16, 19941, {1, 3, 5, 3, 5, 51, 81, 9, 425, 333, 451, 2569, 2771, 12145, 26065, 14385}}, {4915, 16, 19951, {1, 1, 3, 7, 3, 49, 17, 147, 327, 331, 1197, 7, 3703, 15247, 9723, 52819}}, {4916, 16, 19959, {1, 3, 3, 7, 27, 21, 117, 229, 255, 603, 195, 1049, 6243, 13593, 14553, 8267}}, {4917, 16, 19966, {1, 1, 5, 15, 9, 53, 1, 187, 79, 151, 321, 1883, 6105, 13879, 8201, 53213}}, {4918, 16, 20009, {1, 1, 1, 7, 21, 27, 103, 147, 351, 901, 1927, 2145, 2685, 453, 15173, 7371}}, {4919, 16, 20018, {1, 1, 3, 5, 21, 27, 125, 77, 395, 27, 827, 3617, 6033, 1511, 29461, 18907}}, {4920, 16, 20020, {1, 3, 5, 3, 3, 27, 75, 129, 441, 831, 1213, 2499, 5829, 12181, 7991, 58167}}, {4921, 16, 20038, {1, 1, 1, 9, 3, 33, 85, 135, 45, 405, 1731, 551, 1251, 7895, 3975, 41621}}, {4922, 16, 20049, {1, 3, 5, 7, 19, 19, 25, 7, 477, 569, 1089, 2705, 6157, 10279, 14029, 36229}}, {4923, 16, 20066, {1, 3, 7, 3, 5, 19, 99, 137, 67, 361, 2021, 2891, 1957, 14961, 22673, 45707}}, {4924, 16, 20108, {1, 3, 7, 1, 21, 11, 81, 225, 151, 235, 1761, 3875, 7427, 11213, 27023, 17945}}, {4925, 16, 20130, {1, 1, 7, 1, 3, 1, 3, 123, 39, 769, 1467, 1907, 7833, 2099, 19, 54653}}, {4926, 16, 20132, {1, 1, 1, 3, 25, 35, 33, 111, 407, 497, 1527, 3999, 3083, 6221, 8319, 56959}}, {4927, 16, 20167, {1, 1, 3, 15, 21, 49, 113, 11, 191, 801, 1835, 3413, 3379, 13129, 3655, 23885}}, {4928, 16, 20219, {1, 3, 1, 5, 21, 57, 87, 133, 409, 325, 569, 2099, 8143, 315, 23287, 21905}}, {4929, 16, 20227, {1, 1, 5, 5, 21, 43, 25, 169, 265, 123, 81, 2683, 6137, 7341, 16383, 26435}}, {4930, 16, 20263, {1, 3, 1, 5, 23, 17, 125, 173, 3, 829, 693, 751, 8021, 3701, 32643, 35405}}, {4931, 16, 20267, {1, 1, 3, 1, 31, 13, 1, 195, 435, 487, 961, 1681, 1233, 6001, 3113, 29515}}, {4932, 16, 20272, {1, 1, 7, 5, 9, 41, 81, 137, 257, 337, 1837, 145, 4191, 6313, 9991, 25541}}, {4933, 16, 20289, {1, 1, 5, 13, 29, 13, 1, 117, 501, 991, 571, 793, 1433, 6005, 19, 61135}}, {4934, 16, 20296, {1, 1, 7, 1, 9, 43, 65, 69, 297, 331, 1777, 1843, 6477, 13943, 1301, 51001}}, {4935, 16, 20307, {1, 1, 1, 3, 7, 35, 23, 211, 33, 649, 255, 1831, 635, 9965, 16679, 14531}}, {4936, 16, 20316, {1, 1, 1, 13, 23, 57, 113, 247, 321, 401, 1761, 4001, 1823, 14457, 5251, 4965}}, {4937, 16, 20323, {1, 1, 5, 5, 31, 5, 53, 103, 297, 575, 1577, 2217, 977, 14415, 16953, 14793}}, {4938, 16, 20335, {1, 1, 5, 7, 9, 19, 25, 29, 121, 563, 1707, 901, 6167, 10799, 11897, 31187}}, {4939, 16, 20344, {1, 1, 5, 9, 17, 39, 89, 29, 251, 259, 411, 819, 6037, 4601, 11481, 46141}}, {4940, 16, 20354, {1, 1, 1, 15, 23, 9, 65, 95, 189, 93, 1485, 2417, 5183, 5513, 26623, 42637}}, {4941, 16, 20360, {1, 1, 5, 5, 3, 3, 113, 161, 463, 225, 1089, 2023, 2341, 14931, 28097, 56365}}, {4942, 16, 20368, {1, 1, 5, 9, 9, 3, 109, 141, 27, 473, 107, 4023, 3279, 7595, 13289, 35649}}, {4943, 16, 20390, {1, 1, 5, 3, 9, 37, 73, 153, 487, 57, 2035, 3583, 239, 2183, 10903, 171}}, {4944, 16, 20402, {1, 3, 3, 15, 23, 39, 87, 217, 451, 597, 1817, 2883, 145, 11341, 16015, 16765}}, {4945, 16, 20413, {1, 1, 7, 5, 19, 61, 45, 37, 473, 883, 277, 2801, 13, 7021, 3851, 53223}}, {4946, 16, 20425, {1, 3, 3, 9, 1, 35, 97, 237, 279, 541, 1911, 661, 7603, 8183, 22071, 37317}}, {4947, 16, 20428, {1, 3, 3, 11, 11, 63, 101, 71, 227, 259, 1545, 2779, 3859, 4859, 18957, 31749}}, {4948, 16, 20434, {1, 3, 3, 1, 27, 29, 91, 215, 381, 607, 1701, 1709, 247, 12403, 29943, 59533}}, {4949, 16, 20443, {1, 1, 7, 1, 11, 23, 47, 141, 37, 881, 1443, 3921, 3281, 7417, 1549, 50653}}, {4950, 16, 20488, {1, 1, 7, 11, 23, 61, 17, 39, 373, 871, 1107, 1875, 1419, 3981, 1333, 11485}}, {4951, 16, 20502, {1, 1, 7, 11, 21, 51, 127, 145, 129, 425, 1263, 1989, 699, 7317, 24827, 15049}}, {4952, 16, 20505, {1, 1, 1, 11, 9, 59, 59, 67, 329, 841, 905, 467, 1905, 895, 29711, 25585}}, {4953, 16, 20535, {1, 1, 1, 15, 3, 39, 11, 205, 297, 383, 445, 2139, 2935, 2399, 22237, 20355}}, {4954, 16, 20541, {1, 3, 7, 7, 17, 9, 17, 205, 369, 1019, 1703, 755, 5507, 14749, 16461, 14519}}, {4955, 16, 20554, {1, 3, 7, 3, 5, 31, 97, 35, 43, 249, 773, 4033, 6085, 1241, 24743, 22415}}, {4956, 16, 20577, {1, 3, 7, 3, 17, 11, 45, 203, 251, 669, 1463, 1897, 7913, 2315, 30307, 15431}}, {4957, 16, 20583, {1, 1, 5, 5, 7, 53, 83, 13, 1, 841, 423, 1059, 3951, 14209, 11113, 13931}}, {4958, 16, 20602, {1, 3, 3, 5, 5, 15, 11, 71, 237, 553, 829, 3653, 4991, 1003, 8353, 52173}}, {4959, 16, 20611, {1, 3, 3, 9, 27, 39, 83, 137, 315, 883, 1155, 3541, 3815, 10633, 13277, 20269}}, {4960, 16, 20614, {1, 3, 3, 15, 13, 55, 43, 19, 345, 351, 1117, 1747, 1949, 3195, 12241, 52441}}, {4961, 16, 20626, {1, 1, 3, 5, 1, 11, 113, 117, 37, 103, 1681, 3269, 1659, 14779, 30479, 31123}}, {4962, 16, 20628, {1, 3, 7, 13, 1, 63, 9, 63, 65, 737, 785, 1713, 8123, 10053, 29871, 17647}}, {4963, 16, 20635, {1, 1, 3, 5, 17, 45, 71, 37, 283, 145, 1927, 75, 7355, 4681, 2777, 31465}}, {4964, 16, 20642, {1, 1, 3, 7, 21, 19, 113, 89, 67, 751, 99, 421, 201, 6345, 9473, 39849}}, {4965, 16, 20674, {1, 1, 5, 11, 31, 57, 75, 79, 393, 745, 1435, 3039, 1175, 983, 923, 42867}}, {4966, 16, 20716, {1, 1, 5, 9, 31, 47, 31, 61, 85, 651, 1733, 3973, 1979, 7223, 13817, 30593}}, {4967, 16, 20734, {1, 1, 1, 11, 31, 21, 23, 177, 401, 55, 537, 3775, 3241, 15157, 11849, 15629}}, {4968, 16, 20765, {1, 1, 1, 13, 31, 53, 79, 57, 35, 617, 61, 89, 6917, 6045, 23879, 45485}}, {4969, 16, 20801, {1, 3, 7, 7, 3, 43, 57, 243, 107, 321, 273, 2171, 2069, 6171, 29181, 8281}}, {4970, 16, 20804, {1, 1, 1, 11, 3, 27, 51, 57, 81, 795, 1673, 2601, 7335, 16243, 863, 20663}}, {4971, 16, 20808, {1, 1, 5, 9, 7, 19, 31, 87, 509, 899, 1133, 1609, 2163, 7595, 10523, 43181}}, {4972, 16, 20831, {1, 1, 1, 7, 21, 53, 103, 43, 507, 317, 685, 1329, 7057, 7275, 2277, 28271}}, {4973, 16, 20832, {1, 1, 7, 7, 3, 35, 81, 81, 261, 587, 1571, 2771, 4653, 6517, 25101, 56753}}, {4974, 16, 20862, {1, 3, 1, 11, 17, 61, 29, 137, 7, 929, 393, 2513, 2423, 5457, 6285, 12525}}, {4975, 16, 20877, {1, 3, 1, 9, 25, 63, 17, 45, 439, 591, 273, 877, 7741, 8381, 32277, 24635}}, {4976, 16, 20880, {1, 3, 1, 5, 19, 11, 17, 175, 297, 77, 961, 3331, 5193, 14347, 12713, 32067}}, {4977, 16, 20885, {1, 1, 5, 11, 3, 17, 13, 21, 219, 653, 1279, 1657, 7659, 14459, 27661, 38093}}, {4978, 16, 20889, {1, 3, 7, 7, 29, 17, 67, 35, 451, 91, 919, 3163, 7459, 14971, 4317, 42503}}, {4979, 16, 20905, {1, 3, 3, 15, 7, 61, 69, 211, 349, 97, 911, 503, 3903, 12327, 11049, 29387}}, {4980, 16, 20914, {1, 1, 7, 3, 5, 7, 63, 237, 387, 931, 693, 1143, 6545, 8529, 25217, 53087}}, {4981, 16, 20967, {1, 1, 5, 7, 1, 13, 21, 169, 259, 289, 437, 649, 4905, 15261, 29997, 34043}}, {4982, 16, 21028, {1, 1, 1, 9, 25, 13, 19, 229, 29, 213, 1941, 1501, 3463, 15761, 15635, 39687}}, {4983, 16, 21031, {1, 1, 5, 7, 13, 29, 101, 57, 483, 913, 1025, 2139, 4327, 7847, 12455, 41797}}, {4984, 16, 21043, {1, 1, 3, 11, 17, 27, 97, 79, 411, 9, 1797, 3721, 5291, 859, 8889, 6151}}, {4985, 16, 21052, {1, 1, 1, 5, 17, 61, 45, 187, 157, 301, 1017, 1507, 6031, 4271, 32593, 23739}}, {4986, 16, 21058, {1, 1, 3, 11, 31, 39, 7, 169, 15, 799, 1585, 2055, 4683, 13247, 23743, 50399}}, {4987, 16, 21087, {1, 1, 1, 9, 25, 37, 15, 39, 339, 383, 1153, 1211, 5745, 15249, 26021, 39871}}, {4988, 16, 21088, {1, 1, 3, 13, 17, 51, 27, 137, 231, 877, 309, 3633, 2575, 12259, 2743, 14781}}, {4989, 16, 21093, {1, 1, 5, 7, 5, 33, 95, 19, 37, 829, 1489, 3525, 3887, 8277, 21867, 3581}}, {4990, 16, 21106, {1, 1, 1, 15, 11, 33, 99, 213, 365, 549, 1603, 777, 3787, 12209, 14999, 50607}}, {4991, 16, 21108, {1, 3, 1, 9, 23, 25, 57, 147, 73, 285, 1229, 1763, 4579, 14771, 4003, 38197}}, {4992, 16, 21118, {1, 1, 5, 1, 15, 55, 25, 209, 135, 895, 311, 139, 2445, 6903, 12129, 27907}}, {4993, 16, 21122, {1, 1, 5, 7, 23, 29, 33, 135, 325, 517, 2021, 1721, 4235, 2363, 12905, 18811}}, {4994, 16, 21131, {1, 1, 1, 9, 3, 19, 69, 29, 157, 787, 1969, 3711, 8179, 5691, 4059, 25541}}, {4995, 16, 21139, {1, 1, 5, 15, 1, 61, 11, 195, 317, 13, 923, 2149, 4001, 12843, 27109, 30625}}, {4996, 16, 21141, {1, 3, 1, 7, 3, 13, 45, 187, 445, 859, 53, 3227, 4381, 8273, 32699, 48719}}, {4997, 16, 21146, {1, 1, 7, 7, 21, 19, 47, 101, 119, 311, 577, 3309, 4585, 12109, 15153, 22915}}, {4998, 16, 21162, {1, 3, 5, 15, 21, 39, 15, 211, 349, 237, 1873, 3333, 7837, 12811, 14321, 20227}}, {4999, 16, 21164, {1, 1, 5, 5, 19, 47, 15, 239, 23, 763, 537, 1477, 2231, 10885, 19487, 47385}}, {5000, 16, 21184, {1, 1, 3, 1, 19, 37, 67, 85, 11, 817, 869, 2249, 4111, 12411, 10405, 20055}}, {5001, 16, 21208, {1, 1, 3, 3, 1, 41, 85, 137, 91, 369, 1863, 759, 303, 15859, 8063, 12811}}, {5002, 16, 21211, {1, 3, 1, 11, 23, 1, 11, 219, 201, 573, 1573, 619, 2959, 6485, 7483, 46099}}, {5003, 16, 21213, {1, 3, 3, 9, 13, 9, 9, 255, 47, 375, 409, 1435, 1665, 14967, 3247, 18193}}, {5004, 16, 21230, {1, 1, 1, 5, 9, 61, 121, 173, 51, 415, 1621, 3947, 1379, 847, 23187, 39259}}, {5005, 16, 21270, {1, 1, 1, 7, 3, 19, 95, 59, 187, 453, 1533, 445, 2699, 4817, 25983, 50925}}, {5006, 16, 21276, {1, 3, 5, 13, 25, 25, 33, 5, 497, 1, 535, 1653, 6541, 10939, 17721, 43829}}, {5007, 16, 21285, {1, 3, 7, 11, 9, 59, 115, 127, 85, 505, 541, 3243, 5853, 12673, 25275, 39577}}, {5008, 16, 21297, {1, 3, 7, 1, 17, 25, 83, 127, 225, 295, 1823, 2051, 847, 4249, 13763, 5723}}, {5009, 16, 21304, {1, 1, 1, 5, 3, 63, 39, 131, 191, 983, 119, 3287, 3335, 7969, 31347, 39439}}, {5010, 16, 21310, {1, 3, 7, 9, 19, 31, 19, 91, 35, 677, 1229, 1371, 6497, 3315, 15239, 54235}}, {5011, 16, 21330, {1, 1, 1, 15, 3, 49, 113, 199, 135, 35, 709, 385, 7923, 3711, 18351, 12711}}, {5012, 16, 21339, {1, 1, 3, 15, 31, 13, 41, 1, 183, 95, 1625, 1675, 7881, 6607, 4165, 27151}}, {5013, 16, 21346, {1, 3, 3, 15, 21, 57, 81, 49, 5, 297, 131, 883, 1113, 2497, 32129, 39139}}, {5014, 16, 21391, {1, 3, 5, 7, 29, 47, 101, 173, 299, 879, 143, 3341, 3929, 6797, 8753, 47963}}, {5015, 16, 21427, {1, 3, 3, 13, 11, 39, 27, 187, 27, 763, 1515, 1903, 5897, 10061, 14595, 12713}}, {5016, 16, 21451, {1, 3, 5, 11, 27, 35, 37, 213, 45, 867, 1591, 3083, 8123, 5045, 31703, 61487}}, {5017, 16, 21465, {1, 1, 3, 5, 3, 31, 23, 89, 369, 371, 1165, 3673, 6821, 333, 10881, 4153}}, {5018, 16, 21468, {1, 1, 7, 13, 1, 33, 49, 195, 223, 197, 1799, 2427, 6171, 493, 13503, 23619}}, {5019, 16, 21471, {1, 1, 3, 9, 5, 59, 105, 215, 449, 527, 1661, 2643, 309, 11239, 11633, 63459}}, {5020, 16, 21533, {1, 1, 3, 11, 13, 11, 15, 99, 409, 807, 1911, 883, 1323, 9037, 6401, 545}}, {5021, 16, 21610, {1, 1, 5, 7, 7, 7, 1, 167, 353, 923, 1403, 3109, 4981, 3877, 25451, 4667}}, {5022, 16, 21615, {1, 1, 5, 11, 11, 25, 121, 153, 111, 785, 1301, 1497, 6267, 14919, 24125, 52029}}, {5023, 16, 21630, {1, 3, 3, 5, 29, 55, 63, 177, 305, 41, 111, 1065, 1127, 113, 2815, 12979}}, {5024, 16, 21633, {1, 3, 5, 7, 23, 39, 17, 179, 267, 917, 511, 3923, 915, 14173, 10689, 50749}}, {5025, 16, 21657, {1, 1, 5, 3, 9, 45, 15, 157, 495, 625, 407, 2769, 3267, 7593, 17957, 54597}}, {5026, 16, 21658, {1, 3, 3, 11, 21, 13, 5, 207, 107, 965, 1803, 1541, 3487, 3483, 109, 26923}}, {5027, 16, 21669, {1, 1, 5, 11, 25, 49, 99, 135, 109, 371, 1307, 1815, 1095, 2329, 27101, 52269}}, {5028, 16, 21670, {1, 3, 5, 5, 13, 9, 109, 79, 151, 47, 311, 3873, 3645, 3773, 1083, 31599}}, {5029, 16, 21673, {1, 3, 5, 15, 1, 9, 87, 21, 145, 583, 159, 2435, 587, 10123, 24803, 19993}}, {5030, 16, 21701, {1, 3, 1, 1, 23, 11, 5, 45, 373, 1011, 1353, 277, 7051, 3845, 12391, 25313}}, {5031, 16, 21719, {1, 1, 1, 9, 13, 13, 109, 251, 97, 483, 1723, 2555, 813, 9345, 11351, 44705}}, {5032, 16, 21720, {1, 3, 5, 7, 21, 49, 63, 13, 119, 813, 1559, 983, 499, 15159, 24163, 59903}}, {5033, 16, 21747, {1, 1, 3, 5, 27, 33, 27, 165, 207, 693, 1401, 1357, 7637, 337, 10163, 43273}}, {5034, 16, 21819, {1, 1, 5, 13, 29, 7, 71, 187, 1, 655, 1829, 2645, 6969, 5435, 28415, 33199}}, {5035, 16, 21839, {1, 1, 1, 13, 17, 21, 13, 141, 41, 267, 1165, 1893, 3455, 10737, 16693, 33065}}, {5036, 16, 21854, {1, 1, 5, 1, 7, 27, 7, 67, 107, 11, 763, 2529, 3023, 15745, 17023, 51911}}, {5037, 16, 21857, {1, 3, 3, 3, 7, 57, 123, 249, 309, 511, 1655, 1379, 725, 7325, 20261, 65039}}, {5038, 16, 21864, {1, 1, 5, 11, 3, 27, 23, 27, 285, 771, 2017, 1727, 4847, 2665, 30655, 47625}}, {5039, 16, 21882, {1, 3, 7, 7, 17, 3, 93, 133, 427, 1021, 1135, 341, 6711, 11713, 24157, 1561}}, {5040, 16, 21900, {1, 1, 3, 7, 15, 55, 11, 247, 65, 115, 1967, 535, 841, 15131, 28381, 31337}}, {5041, 16, 21903, {1, 3, 1, 7, 9, 45, 73, 151, 127, 125, 767, 2003, 6893, 3875, 451, 30275}}, {5042, 16, 21928, {1, 1, 7, 3, 5, 55, 127, 123, 163, 763, 1165, 1637, 6267, 7215, 23403, 20961}}, {5043, 16, 21931, {1, 1, 1, 13, 1, 21, 65, 141, 369, 413, 1675, 27, 7357, 6929, 18083, 829}}, {5044, 16, 21946, {1, 3, 5, 13, 1, 17, 97, 107, 249, 931, 47, 3537, 2245, 9827, 13673, 23217}}, {5045, 16, 21971, {1, 1, 1, 11, 13, 19, 43, 31, 51, 727, 1001, 927, 771, 11853, 5761, 60537}}, {5046, 16, 21974, {1, 3, 1, 7, 23, 27, 115, 5, 201, 431, 1021, 585, 6069, 12511, 6129, 2105}}, {5047, 16, 21978, {1, 1, 3, 11, 3, 25, 75, 129, 389, 131, 223, 2263, 5377, 5561, 15633, 39527}}, {5048, 16, 21993, {1, 3, 3, 1, 27, 43, 101, 55, 319, 549, 1971, 2255, 353, 93, 25661, 59077}}, {5049, 16, 21994, {1, 1, 5, 11, 29, 57, 27, 135, 341, 913, 1637, 1781, 457, 11293, 1013, 53863}}, {5050, 16, 22030, {1, 1, 1, 11, 3, 51, 79, 251, 443, 651, 393, 3635, 7397, 5443, 4225, 991}}, {5051, 16, 22035, {1, 3, 7, 13, 31, 9, 3, 109, 427, 735, 891, 2789, 2169, 6459, 355, 43177}}, {5052, 16, 22063, {1, 3, 3, 3, 13, 7, 93, 195, 293, 37, 75, 2467, 933, 8017, 9925, 61397}}, {5053, 16, 22068, {1, 1, 5, 7, 25, 15, 69, 199, 161, 769, 387, 1491, 4553, 4173, 25631, 37089}}, {5054, 16, 22086, {1, 3, 1, 3, 7, 59, 53, 93, 103, 413, 531, 887, 6149, 2901, 22611, 27135}}, {5055, 16, 22104, {1, 1, 1, 13, 31, 39, 71, 215, 385, 821, 1603, 3043, 4967, 10953, 11543, 64433}}, {5056, 16, 22119, {1, 3, 1, 7, 7, 63, 5, 143, 1, 339, 1165, 3809, 4257, 12879, 21581, 21307}}, {5057, 16, 22153, {1, 1, 1, 15, 1, 35, 67, 227, 277, 879, 513, 3423, 6153, 11573, 12809, 34335}}, {5058, 16, 22168, {1, 3, 7, 9, 9, 39, 47, 17, 101, 179, 631, 1307, 481, 871, 16807, 39811}}, {5059, 16, 22183, {1, 3, 1, 1, 13, 25, 53, 179, 285, 267, 407, 3781, 3267, 3545, 525, 15733}}, {5060, 16, 22189, {1, 1, 1, 13, 11, 35, 45, 181, 319, 767, 283, 3021, 5405, 403, 3587, 7291}}, {5061, 16, 22204, {1, 1, 7, 3, 5, 9, 67, 129, 101, 117, 267, 1925, 1209, 13095, 7123, 62941}}, {5062, 16, 22230, {1, 1, 7, 3, 5, 63, 109, 199, 95, 421, 193, 3519, 6551, 955, 1679, 16627}}, {5063, 16, 22240, {1, 1, 5, 13, 1, 47, 71, 157, 343, 653, 981, 1335, 3737, 7185, 28861, 22883}}, {5064, 16, 22246, {1, 1, 3, 15, 7, 63, 7, 81, 481, 5, 1159, 1361, 4167, 2575, 7437, 16917}}, {5065, 16, 22269, {1, 3, 7, 1, 27, 17, 61, 193, 317, 841, 1149, 955, 5161, 4275, 1955, 15665}}, {5066, 16, 22282, {1, 1, 1, 7, 19, 63, 77, 57, 367, 237, 579, 3701, 5763, 4951, 24151, 45215}}, {5067, 16, 22302, {1, 1, 5, 11, 29, 7, 119, 155, 431, 999, 757, 2433, 5811, 3709, 29573, 23639}}, {5068, 16, 22330, {1, 3, 3, 3, 15, 35, 125, 13, 275, 507, 1719, 1537, 2349, 12909, 8107, 9845}}, {5069, 16, 22347, {1, 3, 1, 13, 27, 27, 11, 69, 15, 1017, 207, 625, 809, 2921, 8939, 30293}}, {5070, 16, 22349, {1, 1, 7, 11, 31, 51, 113, 193, 69, 845, 73, 919, 3523, 3987, 23665, 36527}}, {5071, 16, 22383, {1, 3, 7, 11, 21, 31, 103, 29, 5, 81, 1081, 3847, 4697, 8857, 30769, 40053}}, {5072, 16, 22386, {1, 1, 1, 1, 5, 11, 5, 169, 13, 899, 769, 3823, 5405, 5991, 3821, 27767}}, {5073, 16, 22432, {1, 1, 3, 15, 1, 35, 9, 83, 23, 701, 1807, 1681, 4009, 127, 31751, 38059}}, {5074, 16, 22450, {1, 3, 3, 7, 9, 61, 73, 111, 193, 607, 2001, 413, 3751, 16337, 16597, 23959}}, {5075, 16, 22473, {1, 1, 7, 7, 21, 29, 53, 253, 187, 507, 1191, 3521, 463, 2167, 23785, 19867}}, {5076, 16, 22487, {1, 3, 5, 3, 19, 43, 101, 93, 257, 61, 1589, 3883, 1975, 7283, 5253, 23257}}, {5077, 16, 22527, {1, 3, 1, 9, 1, 63, 25, 101, 377, 571, 1701, 3385, 243, 12051, 32619, 10459}}, {5078, 16, 22537, {1, 1, 1, 5, 17, 11, 37, 197, 205, 879, 625, 959, 7389, 7857, 20615, 20405}}, {5079, 16, 22557, {1, 3, 5, 5, 27, 41, 9, 109, 197, 623, 1045, 63, 7977, 11355, 28613, 5131}}, {5080, 16, 22561, {1, 1, 5, 11, 5, 29, 27, 85, 131, 247, 433, 3981, 2677, 15415, 869, 6045}}, {5081, 16, 22568, {1, 3, 1, 13, 9, 49, 25, 79, 135, 719, 93, 631, 2149, 5929, 29833, 38673}}, {5082, 16, 22573, {1, 3, 7, 11, 15, 13, 37, 233, 227, 205, 1579, 65, 1429, 13499, 26355, 63821}}, {5083, 16, 22591, {1, 1, 5, 11, 21, 19, 7, 183, 409, 275, 899, 3665, 6207, 849, 24339, 1617}}, {5084, 16, 22593, {1, 3, 1, 3, 21, 61, 23, 125, 463, 489, 1265, 2975, 3907, 11881, 7533, 43331}}, {5085, 16, 22605, {1, 3, 1, 15, 15, 51, 83, 31, 175, 47, 1791, 3651, 6735, 5013, 723, 24141}}, {5086, 16, 22620, {1, 3, 1, 9, 17, 41, 57, 43, 469, 911, 1251, 2105, 3133, 3437, 10097, 26687}}, {5087, 16, 22627, {1, 1, 3, 3, 9, 9, 125, 201, 141, 943, 1509, 1239, 6575, 8707, 363, 23309}}, {5088, 16, 22636, {1, 1, 5, 3, 19, 37, 43, 141, 413, 149, 1449, 1003, 4473, 12395, 4101, 61201}}, {5089, 16, 22647, {1, 1, 5, 11, 17, 37, 41, 33, 57, 627, 325, 1895, 1773, 1339, 24859, 587}}, {5090, 16, 22697, {1, 1, 1, 3, 5, 49, 127, 109, 361, 853, 1437, 3451, 4031, 5379, 27463, 47425}}, {5091, 16, 22715, {1, 3, 5, 7, 9, 57, 71, 219, 347, 791, 797, 73, 6241, 12717, 24429, 40977}}, {5092, 16, 22725, {1, 1, 5, 9, 27, 43, 43, 227, 433, 413, 1109, 2589, 4535, 8947, 8121, 43479}}, {5093, 16, 22732, {1, 3, 7, 1, 9, 21, 81, 23, 157, 313, 197, 2845, 8059, 15957, 28657, 28093}}, {5094, 16, 22749, {1, 3, 1, 11, 15, 17, 115, 27, 421, 743, 1885, 2089, 5011, 7137, 7395, 36853}}, {5095, 16, 22766, {1, 1, 5, 15, 5, 53, 69, 255, 63, 29, 1011, 3201, 1467, 15441, 26255, 62895}}, {5096, 16, 22768, {1, 3, 1, 11, 3, 47, 35, 195, 149, 849, 1317, 439, 3539, 845, 15295, 42183}}, {5097, 16, 22771, {1, 1, 5, 15, 15, 37, 67, 105, 495, 985, 1777, 3137, 8039, 11795, 29771, 35045}}, {5098, 16, 22788, {1, 1, 3, 1, 25, 17, 67, 227, 229, 419, 1319, 3325, 1293, 8585, 28425, 34013}}, {5099, 16, 22797, {1, 1, 5, 1, 27, 51, 71, 197, 375, 407, 259, 4005, 3309, 5475, 13421, 60065}}, {5100, 16, 22822, {1, 3, 1, 5, 11, 17, 89, 45, 311, 425, 1629, 773, 7267, 8699, 27547, 37081}}, {5101, 16, 22828, {1, 3, 1, 7, 9, 25, 101, 105, 489, 217, 103, 1959, 4049, 5793, 31201, 11947}}, {5102, 16, 22851, {1, 1, 5, 5, 19, 3, 63, 55, 431, 49, 273, 3253, 5357, 13801, 9735, 21883}}, {5103, 16, 22888, {1, 1, 1, 11, 13, 3, 75, 201, 477, 201, 1875, 657, 6217, 8651, 2207, 16421}}, {5104, 16, 22893, {1, 1, 5, 13, 5, 31, 75, 113, 25, 171, 1147, 3089, 7095, 4405, 26155, 42323}}, {5105, 16, 22901, {1, 3, 5, 5, 5, 49, 99, 171, 445, 1023, 1793, 3159, 5809, 12509, 31723, 60411}}, {5106, 16, 22902, {1, 3, 7, 3, 23, 51, 111, 27, 103, 159, 433, 293, 1741, 3599, 4067, 40667}}, {5107, 16, 22921, {1, 3, 3, 13, 11, 9, 11, 21, 453, 35, 1649, 1261, 3539, 14081, 5581, 57105}}, {5108, 16, 22929, {1, 3, 3, 13, 7, 9, 113, 87, 391, 647, 223, 1345, 4481, 9855, 20129, 10807}}, {5109, 16, 22946, {1, 3, 7, 15, 3, 61, 15, 117, 97, 495, 985, 819, 181, 1363, 13111, 35857}}, {5110, 16, 22948, {1, 3, 1, 9, 3, 27, 125, 151, 217, 961, 707, 2647, 5307, 621, 12581, 13941}}, {5111, 16, 22951, {1, 3, 1, 11, 17, 37, 35, 211, 179, 29, 627, 3623, 6429, 16237, 24699, 14385}}, {5112, 16, 22958, {1, 3, 3, 9, 3, 57, 35, 3, 85, 1017, 1739, 2241, 7297, 15637, 27085, 41237}}, {5113, 16, 22975, {1, 1, 3, 7, 7, 13, 5, 85, 505, 51, 409, 867, 677, 12451, 13633, 47883}}, {5114, 16, 22983, {1, 3, 5, 13, 5, 51, 37, 79, 237, 133, 1331, 3263, 349, 4971, 16067, 62485}}, {5115, 16, 22990, {1, 1, 7, 11, 29, 41, 101, 219, 391, 1023, 1681, 3163, 4071, 14665, 11041, 14523}}, {5116, 16, 23032, {1, 1, 3, 3, 13, 55, 37, 119, 471, 665, 1315, 3071, 5993, 12005, 13549, 63425}}, {5117, 16, 23047, {1, 3, 5, 7, 5, 25, 59, 71, 77, 841, 91, 1841, 6997, 1139, 11843, 52209}}, {5118, 16, 23053, {1, 3, 7, 15, 17, 25, 85, 173, 373, 459, 1713, 1055, 5337, 9921, 15213, 44235}}, {5119, 16, 23054, {1, 1, 1, 15, 7, 11, 89, 237, 131, 565, 745, 457, 4447, 5581, 11053, 43819}}, {5120, 16, 23082, {1, 3, 5, 1, 29, 21, 11, 7, 125, 851, 2023, 3321, 1885, 67, 8809, 43291}}, {5121, 16, 23095, {1, 3, 5, 11, 11, 43, 41, 97, 353, 813, 85, 2453, 769, 11709, 4697, 2849}}, {5122, 16, 23116, {1, 1, 5, 5, 21, 29, 87, 179, 157, 981, 129, 2139, 6841, 5479, 27111, 20749}}, {5123, 16, 23197, {1, 1, 3, 9, 31, 59, 61, 15, 423, 33, 467, 1817, 6535, 7341, 31061, 20937}}, {5124, 16, 23221, {1, 1, 7, 3, 1, 21, 127, 135, 321, 699, 727, 3079, 753, 3971, 5611, 28345}}, {5125, 16, 23257, {1, 3, 7, 11, 27, 3, 39, 63, 389, 433, 43, 1443, 6241, 10769, 20485, 58823}}, {5126, 16, 23260, {1, 1, 1, 11, 3, 13, 5, 57, 503, 707, 677, 3355, 6691, 8841, 20041, 11867}}, {5127, 16, 23263, {1, 1, 3, 11, 31, 39, 107, 221, 81, 125, 1439, 2429, 2109, 3931, 31007, 10915}}, {5128, 16, 23267, {1, 3, 3, 9, 17, 53, 13, 121, 127, 15, 1825, 1909, 5951, 13503, 31565, 56163}}, {5129, 16, 23282, {1, 1, 1, 1, 19, 55, 3, 153, 385, 277, 1297, 3655, 6027, 3057, 11341, 46989}}, {5130, 16, 23284, {1, 1, 5, 9, 3, 55, 37, 223, 353, 141, 1917, 3827, 2255, 7617, 10971, 10641}}, {5131, 16, 23314, {1, 3, 7, 9, 29, 41, 71, 19, 137, 243, 2047, 395, 6981, 15887, 9479, 60199}}, {5132, 16, 23326, {1, 1, 1, 9, 17, 43, 51, 191, 405, 727, 485, 987, 1855, 15801, 22529, 10165}}, {5133, 16, 23335, {1, 3, 1, 7, 27, 31, 69, 255, 153, 793, 1353, 1981, 83, 11387, 6747, 23379}}, {5134, 16, 23368, {1, 1, 5, 5, 31, 49, 83, 157, 63, 647, 1367, 3995, 5899, 8429, 18317, 3471}}, {5135, 16, 23373, {1, 3, 5, 13, 19, 15, 99, 13, 143, 887, 529, 2855, 573, 9799, 13585, 59263}}, {5136, 16, 23401, {1, 3, 5, 3, 13, 47, 103, 87, 11, 381, 397, 899, 71, 15539, 13005, 38297}}, {5137, 16, 23415, {1, 1, 1, 3, 1, 53, 45, 141, 1, 941, 261, 3291, 5177, 9843, 6309, 62799}}, {5138, 16, 23432, {1, 1, 5, 9, 29, 31, 107, 57, 135, 229, 1147, 247, 265, 12757, 21365, 7219}}, {5139, 16, 23476, {1, 1, 1, 3, 1, 49, 55, 247, 495, 449, 141, 1349, 7393, 2589, 23587, 1097}}, {5140, 16, 23479, {1, 3, 5, 1, 9, 11, 73, 153, 89, 575, 1805, 137, 435, 3687, 32169, 24275}}, {5141, 16, 23497, {1, 1, 7, 15, 25, 61, 51, 21, 109, 139, 611, 3907, 6721, 5081, 6665, 51463}}, {5142, 16, 23505, {1, 1, 1, 9, 13, 23, 59, 203, 33, 1013, 1533, 291, 6171, 15463, 8581, 9497}}, {5143, 16, 23508, {1, 3, 3, 9, 7, 25, 51, 189, 49, 265, 1163, 1141, 2467, 7839, 7083, 65527}}, {5144, 16, 23531, {1, 1, 3, 9, 19, 33, 77, 9, 181, 919, 623, 1521, 7853, 2199, 24115, 60607}}, {5145, 16, 23536, {1, 1, 3, 11, 9, 11, 27, 57, 355, 313, 151, 3391, 4869, 12541, 30031, 29455}}, {5146, 16, 23542, {1, 3, 5, 9, 17, 13, 91, 123, 235, 841, 1113, 1451, 501, 3863, 32483, 9445}}, {5147, 16, 23565, {1, 3, 7, 3, 13, 25, 87, 243, 449, 293, 1279, 3571, 2693, 13459, 5895, 38127}}, {5148, 16, 23573, {1, 1, 3, 15, 27, 61, 7, 57, 255, 971, 131, 2585, 2187, 7191, 17779, 34587}}, {5149, 16, 23590, {1, 3, 3, 7, 23, 29, 55, 41, 463, 873, 1781, 2851, 4731, 9819, 25587, 32199}}, {5150, 16, 23593, {1, 1, 1, 9, 29, 39, 25, 143, 171, 141, 223, 467, 4417, 9575, 23159, 33819}}, {5151, 16, 23604, {1, 1, 5, 13, 19, 61, 19, 75, 25, 361, 585, 1627, 2231, 1831, 24885, 37917}}, {5152, 16, 23621, {1, 3, 7, 7, 23, 19, 59, 55, 323, 55, 143, 131, 27, 15363, 26423, 43963}}, {5153, 16, 23622, {1, 1, 5, 5, 25, 9, 33, 17, 427, 481, 315, 3999, 4757, 4545, 7695, 56733}}, {5154, 16, 23636, {1, 3, 5, 13, 5, 59, 45, 117, 115, 263, 1441, 3307, 1085, 3875, 25869, 19725}}, {5155, 16, 23662, {1, 3, 3, 15, 13, 39, 31, 243, 293, 345, 343, 1911, 6123, 12577, 32081, 59993}}, {5156, 16, 23667, {1, 3, 5, 13, 17, 37, 105, 201, 205, 929, 435, 1467, 8063, 6963, 13709, 53275}}, {5157, 16, 23703, {1, 3, 7, 15, 31, 3, 65, 221, 191, 413, 427, 2579, 377, 2793, 26943, 61299}}, {5158, 16, 23725, {1, 3, 5, 3, 11, 61, 75, 107, 53, 689, 1845, 859, 333, 889, 27607, 48795}}, {5159, 16, 23734, {1, 1, 5, 7, 1, 11, 37, 181, 323, 187, 1511, 25, 5517, 11957, 7093, 429}}, {5160, 16, 23738, {1, 3, 3, 1, 25, 31, 125, 139, 433, 583, 683, 587, 5389, 1225, 26047, 18717}}, {5161, 16, 23752, {1, 3, 1, 15, 23, 33, 23, 147, 279, 513, 157, 4023, 2669, 7543, 2111, 9191}}, {5162, 16, 23800, {1, 3, 1, 1, 5, 39, 55, 127, 257, 649, 347, 3001, 2215, 15579, 29665, 10337}}, {5163, 16, 23803, {1, 1, 1, 15, 19, 55, 105, 183, 505, 1003, 1311, 2253, 1861, 3561, 19581, 46183}}, {5164, 16, 23818, {1, 3, 1, 9, 23, 5, 127, 215, 195, 817, 719, 1285, 919, 8627, 20427, 2723}}, {5165, 16, 23832, {1, 1, 1, 5, 15, 31, 43, 131, 377, 57, 1531, 915, 2871, 1805, 19765, 60529}}, {5166, 16, 23842, {1, 3, 3, 3, 15, 1, 93, 55, 477, 221, 643, 1319, 959, 475, 14015, 48823}}, {5167, 16, 23851, {1, 3, 3, 7, 19, 13, 13, 191, 421, 751, 1103, 2129, 1973, 14935, 26485, 41269}}, {5168, 16, 23873, {1, 1, 5, 13, 17, 43, 81, 83, 67, 643, 1799, 1157, 4365, 2815, 29871, 5351}}, {5169, 16, 23883, {1, 3, 1, 9, 21, 31, 87, 177, 25, 403, 1357, 4047, 959, 5133, 7307, 4333}}, {5170, 16, 23888, {1, 1, 7, 7, 29, 39, 27, 139, 159, 529, 1323, 3823, 4569, 12711, 30263, 10961}}, {5171, 16, 23910, {1, 3, 1, 13, 27, 15, 59, 1, 107, 723, 497, 43, 143, 16119, 29177, 5653}}, {5172, 16, 23934, {1, 1, 5, 9, 15, 41, 23, 109, 101, 639, 277, 1687, 1311, 1995, 5403, 6867}}, {5173, 16, 23938, {1, 1, 5, 3, 13, 1, 95, 177, 379, 545, 789, 3479, 4135, 445, 5869, 38923}}, {5174, 16, 23949, {1, 1, 3, 9, 21, 31, 23, 65, 209, 383, 271, 367, 6605, 1169, 27267, 9331}}, {5175, 16, 23955, {1, 1, 1, 1, 27, 39, 121, 29, 155, 465, 947, 2675, 6753, 11647, 29781, 30251}}, {5176, 16, 23967, {1, 3, 1, 5, 7, 45, 7, 21, 223, 363, 1021, 751, 2257, 14423, 19629, 64867}}, {5177, 16, 23973, {1, 3, 1, 9, 31, 53, 13, 99, 49, 389, 867, 327, 4145, 3265, 15423, 14985}}, {5178, 16, 23991, {1, 1, 1, 15, 11, 11, 27, 41, 333, 161, 1343, 2023, 3789, 13563, 16957, 26849}}, {5179, 16, 24024, {1, 3, 7, 1, 7, 51, 7, 163, 239, 393, 231, 3985, 309, 875, 837, 24791}}, {5180, 16, 24030, {1, 1, 1, 7, 1, 43, 105, 7, 351, 755, 1781, 1925, 4961, 2961, 13427, 44317}}, {5181, 16, 24039, {1, 3, 1, 9, 17, 39, 81, 75, 201, 931, 1547, 1857, 7251, 11687, 14437, 12603}}, {5182, 16, 24067, {1, 3, 3, 15, 15, 23, 95, 7, 193, 9, 1749, 809, 5083, 14645, 24893, 35979}}, {5183, 16, 24069, {1, 1, 7, 1, 9, 9, 127, 149, 433, 985, 1347, 3379, 2881, 681, 20777, 30703}}, {5184, 16, 24084, {1, 3, 1, 11, 1, 27, 121, 111, 251, 45, 1341, 1709, 3733, 11297, 29063, 57119}}, {5185, 16, 24112, {1, 3, 3, 1, 19, 3, 77, 127, 187, 831, 1125, 3119, 4665, 9857, 5301, 36755}}, {5186, 16, 24115, {1, 3, 3, 3, 29, 29, 61, 225, 257, 635, 665, 1279, 3019, 2401, 8253, 40251}}, {5187, 16, 24184, {1, 1, 7, 9, 29, 43, 47, 95, 221, 823, 257, 1485, 5183, 225, 27675, 60479}}, {5188, 16, 24187, {1, 1, 5, 3, 15, 49, 25, 69, 101, 393, 901, 305, 4917, 13479, 30209, 9199}}, {5189, 16, 24262, {1, 1, 3, 15, 1, 9, 47, 243, 403, 341, 143, 1365, 1817, 6017, 3853, 58625}}, {5190, 16, 24276, {1, 3, 3, 11, 9, 49, 93, 149, 39, 177, 1863, 1027, 659, 9253, 2131, 26943}}, {5191, 16, 24279, {1, 3, 1, 3, 25, 1, 43, 255, 217, 353, 957, 39, 4607, 15761, 24291, 33619}}, {5192, 16, 24313, {1, 1, 1, 7, 29, 51, 71, 237, 1, 703, 19, 213, 6429, 11783, 22049, 30597}}, {5193, 16, 24331, {1, 3, 1, 7, 31, 63, 105, 203, 473, 731, 257, 91, 5749, 4099, 30125, 40171}}, {5194, 16, 24336, {1, 3, 7, 9, 7, 29, 119, 181, 225, 743, 1031, 55, 3997, 16221, 11663, 14847}}, {5195, 16, 24348, {1, 3, 3, 11, 5, 21, 43, 17, 473, 981, 125, 2077, 6141, 4757, 7585, 29207}}, {5196, 16, 24367, {1, 1, 7, 1, 27, 61, 27, 45, 267, 483, 119, 767, 957, 3411, 2653, 53967}}, {5197, 16, 24372, {1, 1, 1, 3, 9, 41, 43, 17, 485, 253, 825, 3605, 5919, 9285, 1815, 6095}}, {5198, 16, 24402, {1, 1, 1, 11, 7, 5, 53, 107, 309, 609, 1389, 2035, 861, 15565, 9375, 42363}}, {5199, 16, 24420, {1, 3, 5, 3, 27, 57, 7, 177, 183, 227, 865, 183, 2903, 6325, 4393, 5257}}, {5200, 16, 24444, {1, 3, 1, 5, 21, 29, 79, 107, 365, 427, 813, 3563, 7713, 3865, 4289, 28555}}, {5201, 16, 24465, {1, 3, 5, 7, 11, 27, 1, 197, 425, 769, 1737, 3627, 1273, 4469, 11967, 823}}, {5202, 16, 24466, {1, 1, 1, 13, 3, 31, 127, 159, 471, 367, 2047, 949, 1591, 12429, 21497, 27153}}, {5203, 16, 24471, {1, 3, 1, 3, 3, 31, 31, 87, 243, 413, 1777, 1361, 4575, 1147, 17451, 33985}}, {5204, 16, 24475, {1, 3, 3, 5, 13, 47, 45, 3, 165, 329, 743, 397, 2479, 4999, 12921, 26689}}, {5205, 16, 24481, {1, 1, 5, 7, 17, 59, 25, 117, 217, 601, 235, 2691, 5569, 7853, 31063, 28281}}, {5206, 16, 24488, {1, 3, 1, 11, 11, 39, 71, 77, 481, 39, 363, 1921, 3263, 12849, 13325, 41803}}, {5207, 16, 24501, {1, 3, 7, 5, 19, 1, 59, 197, 239, 787, 1657, 1449, 4245, 1317, 19609, 53583}}, {5208, 16, 24514, {1, 1, 7, 1, 13, 33, 81, 53, 223, 323, 477, 2421, 4045, 1855, 5823, 9661}}, {5209, 16, 24531, {1, 3, 1, 7, 1, 3, 121, 19, 329, 569, 481, 3443, 499, 12407, 19625, 4627}}, {5210, 16, 24534, {1, 1, 1, 7, 3, 33, 91, 241, 69, 581, 1635, 1025, 4677, 14651, 5229, 19555}}, {5211, 16, 24559, {1, 3, 1, 15, 9, 11, 99, 47, 489, 755, 601, 1221, 4251, 4377, 20567, 33839}}, {5212, 16, 24602, {1, 3, 3, 5, 21, 21, 127, 151, 499, 971, 1627, 609, 2365, 3183, 7413, 697}}, {5213, 16, 24614, {1, 3, 7, 13, 5, 35, 61, 121, 51, 297, 29, 1825, 495, 1299, 12741, 3253}}, {5214, 16, 24637, {1, 1, 1, 1, 13, 15, 49, 205, 235, 9, 849, 1101, 4533, 10221, 32419, 50151}}, {5215, 16, 24664, {1, 1, 3, 13, 29, 31, 57, 77, 217, 195, 1951, 189, 981, 6169, 22677, 64415}}, {5216, 16, 24676, {1, 3, 1, 5, 15, 37, 25, 233, 43, 843, 1205, 153, 6339, 3767, 16725, 32699}}, {5217, 16, 24679, {1, 3, 3, 1, 19, 37, 11, 217, 461, 897, 1181, 2815, 295, 15153, 25351, 57211}}, {5218, 16, 24697, {1, 3, 5, 11, 15, 9, 5, 179, 353, 769, 1457, 2919, 1201, 14871, 29549, 52265}}, {5219, 16, 24709, {1, 1, 3, 3, 5, 51, 127, 221, 329, 543, 1537, 2701, 2709, 9311, 2715, 42669}}, {5220, 16, 24714, {1, 3, 5, 15, 5, 41, 79, 233, 445, 265, 2001, 935, 3133, 3977, 3601, 21389}}, {5221, 16, 24716, {1, 3, 5, 11, 3, 7, 115, 45, 311, 827, 1897, 3399, 4251, 5341, 22621, 25519}}, {5222, 16, 24731, {1, 3, 7, 1, 11, 57, 117, 103, 401, 505, 1683, 2161, 4363, 11189, 20263, 13065}}, {5223, 16, 24744, {1, 1, 1, 7, 23, 29, 31, 77, 63, 179, 195, 2747, 579, 11701, 5101, 11497}}, {5224, 16, 24762, {1, 3, 7, 3, 9, 33, 81, 165, 433, 545, 1893, 3709, 3813, 6615, 1485, 6395}}, {5225, 16, 24764, {1, 3, 1, 15, 9, 5, 27, 157, 389, 683, 1919, 509, 455, 3865, 2303, 6993}}, {5226, 16, 24769, {1, 3, 3, 9, 5, 5, 3, 5, 299, 59, 539, 1199, 2443, 10821, 3359, 44345}}, {5227, 16, 24806, {1, 3, 5, 9, 21, 37, 87, 35, 501, 943, 1313, 3929, 351, 9851, 22971, 35659}}, {5228, 16, 24812, {1, 3, 7, 11, 11, 33, 77, 175, 411, 315, 1797, 2731, 4611, 1809, 22027, 50595}}, {5229, 16, 24872, {1, 3, 7, 13, 15, 11, 13, 189, 209, 1015, 1869, 1593, 6887, 8571, 7217, 2641}}, {5230, 16, 24878, {1, 1, 3, 13, 29, 15, 119, 127, 329, 275, 865, 1693, 225, 15735, 11071, 37127}}, {5231, 16, 24883, {1, 3, 7, 13, 9, 31, 85, 25, 281, 401, 1923, 2391, 3875, 2079, 2055, 53275}}, {5232, 16, 24909, {1, 3, 1, 5, 23, 57, 79, 127, 209, 901, 315, 1165, 3393, 15095, 1981, 34993}}, {5233, 16, 24943, {1, 3, 7, 7, 25, 13, 15, 223, 157, 335, 1061, 395, 6895, 6283, 18375, 4887}}, {5234, 16, 24946, {1, 3, 7, 13, 9, 15, 99, 201, 105, 643, 117, 3027, 641, 13353, 4343, 11875}}, {5235, 16, 24964, {1, 1, 3, 11, 5, 51, 5, 77, 281, 207, 1201, 1187, 8107, 6625, 7517, 34377}}, {5236, 16, 24992, {1, 1, 1, 5, 29, 61, 3, 181, 297, 151, 565, 2713, 6611, 8665, 32425, 50399}}, {5237, 16, 25016, {1, 3, 1, 5, 1, 61, 41, 245, 95, 647, 49, 2195, 5927, 15531, 28547, 51075}}, {5238, 16, 25022, {1, 3, 3, 15, 15, 63, 123, 63, 77, 813, 423, 715, 91, 3793, 20901, 54927}}, {5239, 16, 25024, {1, 3, 7, 9, 15, 35, 31, 161, 127, 13, 1667, 1225, 5279, 15487, 18769, 24887}}, {5240, 16, 25039, {1, 1, 3, 5, 27, 25, 61, 21, 447, 175, 1419, 2691, 1993, 13059, 30809, 38325}}, {5241, 16, 25051, {1, 3, 1, 3, 15, 21, 15, 193, 233, 435, 1993, 4003, 4581, 13837, 16535, 43781}}, {5242, 16, 25060, {1, 1, 1, 5, 1, 11, 21, 253, 59, 59, 497, 77, 2165, 8197, 5933, 25743}}, {5243, 16, 25072, {1, 1, 3, 9, 25, 61, 29, 217, 95, 269, 799, 409, 801, 421, 19065, 53443}}, {5244, 16, 25097, {1, 1, 7, 1, 1, 41, 71, 59, 191, 867, 223, 1467, 6679, 16031, 4451, 15313}}, {5245, 16, 25122, {1, 1, 1, 11, 13, 27, 7, 241, 167, 969, 1267, 2953, 3769, 2415, 30065, 39483}}, {5246, 16, 25148, {1, 1, 1, 3, 25, 61, 103, 23, 53, 799, 989, 3859, 7299, 13613, 12007, 37535}}, {5247, 16, 25194, {1, 1, 7, 1, 29, 19, 121, 57, 355, 663, 643, 3723, 1775, 10363, 1389, 16039}}, {5248, 16, 25201, {1, 3, 7, 3, 21, 55, 51, 67, 363, 843, 1187, 1983, 7757, 5413, 26575, 53329}}, {5249, 16, 25204, {1, 3, 1, 3, 31, 55, 73, 55, 75, 533, 197, 1463, 2933, 6033, 24397, 41579}}, {5250, 16, 25238, {1, 3, 1, 11, 9, 15, 107, 141, 473, 825, 901, 937, 7433, 13119, 20047, 6695}}, {5251, 16, 25241, {1, 3, 5, 7, 19, 27, 3, 149, 507, 137, 1025, 1841, 33, 3113, 15101, 28187}}, {5252, 16, 25248, {1, 3, 5, 7, 31, 27, 53, 45, 177, 129, 1241, 1525, 991, 4141, 17681, 39435}}, {5253, 16, 25257, {1, 1, 1, 15, 31, 57, 29, 137, 395, 563, 101, 3367, 1277, 5431, 1169, 44321}}, {5254, 16, 25275, {1, 3, 5, 7, 21, 15, 123, 181, 113, 313, 1763, 1429, 2985, 715, 26129, 549}}, {5255, 16, 25278, {1, 3, 3, 1, 15, 27, 27, 139, 507, 79, 1999, 2505, 485, 7011, 13369, 7159}}, {5256, 16, 25304, {1, 3, 3, 11, 27, 53, 109, 179, 399, 657, 697, 421, 5467, 4273, 7837, 11631}}, {5257, 16, 25307, {1, 1, 1, 15, 1, 57, 91, 199, 443, 569, 1945, 2531, 6349, 4851, 3931, 20537}}, {5258, 16, 25320, {1, 1, 3, 13, 3, 3, 107, 237, 261, 377, 135, 2809, 7239, 1613, 24035, 26053}}, {5259, 16, 25334, {1, 3, 3, 5, 3, 59, 65, 197, 411, 363, 1729, 967, 3963, 4535, 111, 7273}}, {5260, 16, 25348, {1, 1, 7, 3, 13, 39, 105, 235, 203, 1015, 1031, 3127, 1209, 10817, 22177, 44117}}, {5261, 16, 25357, {1, 3, 3, 13, 19, 21, 123, 31, 59, 185, 1007, 1115, 1965, 13087, 18489, 34063}}, {5262, 16, 25372, {1, 1, 7, 5, 27, 7, 33, 159, 245, 57, 2003, 3229, 2095, 4939, 31355, 23121}}, {5263, 16, 25394, {1, 3, 3, 9, 9, 41, 49, 203, 397, 915, 821, 3685, 2269, 11159, 25441, 46377}}, {5264, 16, 25454, {1, 3, 7, 5, 29, 33, 29, 227, 361, 961, 1905, 1149, 2799, 8115, 28235, 25685}}, {5265, 16, 25465, {1, 3, 1, 1, 19, 13, 73, 103, 11, 183, 853, 2425, 3809, 2391, 18615, 32735}}, {5266, 16, 25472, {1, 1, 3, 3, 21, 57, 47, 57, 157, 43, 1085, 3319, 461, 11499, 6809, 10435}}, {5267, 16, 25492, {1, 1, 5, 5, 17, 21, 55, 17, 421, 865, 159, 1643, 4523, 1485, 11937, 8287}}, {5268, 16, 25505, {1, 1, 3, 11, 7, 43, 39, 37, 187, 797, 1273, 1227, 2683, 1249, 3375, 44499}}, {5269, 16, 25517, {1, 1, 5, 11, 17, 35, 27, 73, 97, 59, 921, 2171, 7577, 2847, 93, 35911}}, {5270, 16, 25530, {1, 1, 5, 1, 5, 17, 117, 189, 357, 581, 1945, 2141, 1679, 12019, 11249, 6809}}, {5271, 16, 25558, {1, 1, 5, 7, 15, 53, 9, 191, 153, 257, 533, 493, 2389, 4657, 20757, 57275}}, {5272, 16, 25562, {1, 1, 1, 11, 13, 35, 85, 37, 501, 525, 543, 4057, 2001, 6183, 949, 18465}}, {5273, 16, 25598, {1, 1, 1, 3, 15, 7, 39, 169, 359, 671, 731, 1523, 211, 1233, 29515, 57787}}, {5274, 16, 25609, {1, 1, 3, 7, 27, 7, 41, 15, 71, 733, 1919, 401, 1915, 4815, 10571, 839}}, {5275, 16, 25612, {1, 1, 7, 13, 27, 61, 5, 25, 293, 779, 477, 1537, 6695, 7435, 1281, 64369}}, {5276, 16, 25627, {1, 1, 7, 7, 19, 11, 101, 45, 449, 883, 1181, 3521, 6019, 16305, 23429, 43789}}, {5277, 16, 25651, {1, 1, 7, 5, 1, 49, 121, 89, 275, 367, 461, 1717, 2733, 4403, 9123, 35217}}, {5278, 16, 25653, {1, 1, 7, 1, 1, 37, 41, 221, 281, 531, 357, 3783, 3561, 8135, 18405, 56045}}, {5279, 16, 25668, {1, 3, 5, 7, 29, 9, 127, 37, 13, 519, 1059, 3973, 7253, 15159, 19337, 57103}}, {5280, 16, 25711, {1, 3, 3, 15, 3, 41, 91, 7, 63, 747, 1649, 3367, 5945, 3603, 28465, 511}}, {5281, 16, 25765, {1, 3, 3, 15, 27, 19, 67, 179, 505, 131, 149, 1753, 3603, 1135, 15811, 5305}}, {5282, 16, 25770, {1, 1, 1, 5, 5, 63, 71, 235, 151, 651, 1383, 249, 3223, 14559, 26809, 4551}}, {5283, 16, 25775, {1, 3, 3, 9, 29, 41, 67, 111, 175, 515, 1123, 1707, 6653, 8233, 22775, 61029}}, {5284, 16, 25777, {1, 3, 3, 9, 23, 1, 75, 145, 159, 785, 537, 1995, 2241, 8641, 30709, 41373}}, {5285, 16, 25783, {1, 1, 5, 9, 21, 1, 87, 233, 401, 643, 197, 3437, 8163, 6363, 6537, 17283}}, {5286, 16, 25801, {1, 3, 5, 3, 23, 19, 55, 243, 405, 369, 1221, 1959, 5455, 11729, 26117, 9097}}, {5287, 16, 25802, {1, 1, 3, 13, 3, 57, 71, 235, 125, 263, 873, 1079, 2627, 1343, 1979, 49519}}, {5288, 16, 25812, {1, 3, 1, 11, 21, 15, 27, 7, 425, 935, 305, 2593, 4437, 9517, 26207, 4229}}, {5289, 16, 25821, {1, 1, 3, 13, 11, 53, 1, 149, 97, 939, 147, 3365, 5023, 607, 2083, 8715}}, {5290, 16, 25897, {1, 1, 5, 3, 13, 13, 113, 51, 263, 837, 1145, 3621, 5697, 2867, 7975, 22839}}, {5291, 16, 25906, {1, 1, 3, 15, 31, 9, 91, 231, 399, 295, 1935, 4021, 7669, 3867, 28015, 9865}}, {5292, 16, 25929, {1, 1, 1, 1, 13, 59, 51, 35, 407, 733, 1629, 2429, 291, 11923, 32129, 28847}}, {5293, 16, 25940, {1, 3, 3, 11, 25, 21, 13, 117, 31, 547, 327, 2801, 2247, 4051, 27523, 4257}}, {5294, 16, 25950, {1, 1, 7, 7, 15, 33, 15, 17, 255, 363, 1013, 1463, 7537, 14093, 21883, 35389}}, {5295, 16, 25968, {1, 1, 5, 9, 11, 61, 7, 161, 121, 413, 515, 413, 4439, 15405, 30265, 23939}}, {5296, 16, 25971, {1, 3, 7, 7, 11, 15, 5, 181, 315, 231, 1567, 2985, 1653, 12251, 269, 37317}}, {5297, 16, 25977, {1, 3, 1, 11, 3, 15, 91, 45, 489, 571, 11, 1239, 7705, 4303, 12535, 21359}}, {5298, 16, 25994, {1, 1, 7, 15, 29, 43, 81, 63, 483, 851, 389, 1719, 6111, 15293, 2513, 44397}}, {5299, 16, 25996, {1, 1, 5, 15, 25, 33, 97, 131, 183, 269, 1903, 2733, 7197, 4507, 24471, 36871}}, {5300, 16, 25999, {1, 3, 3, 13, 17, 33, 73, 83, 247, 207, 79, 1139, 581, 12147, 3539, 45423}}, {5301, 16, 26001, {1, 1, 1, 15, 29, 49, 79, 151, 267, 393, 1995, 105, 2873, 3981, 19147, 53987}}, {5302, 16, 26030, {1, 1, 5, 1, 31, 25, 39, 203, 459, 181, 661, 717, 6235, 13413, 1197, 40665}}, {5303, 16, 26069, {1, 1, 5, 9, 19, 33, 65, 239, 463, 133, 461, 3601, 7755, 1771, 20683, 7417}}, {5304, 16, 26100, {1, 1, 1, 1, 25, 19, 25, 155, 431, 33, 341, 959, 5679, 1205, 2599, 37499}}, {5305, 16, 26109, {1, 1, 3, 5, 25, 5, 83, 87, 91, 991, 1833, 4063, 147, 14497, 25725, 4617}}, {5306, 16, 26131, {1, 3, 5, 7, 31, 7, 73, 51, 339, 313, 1593, 2089, 7387, 15759, 3249, 7953}}, {5307, 16, 26144, {1, 3, 7, 1, 27, 49, 35, 11, 21, 45, 1689, 1665, 4591, 3713, 12781, 4805}}, {5308, 16, 26149, {1, 1, 3, 9, 29, 51, 73, 51, 303, 179, 67, 3917, 7615, 6131, 26225, 55991}}, {5309, 16, 26162, {1, 3, 7, 11, 9, 63, 29, 47, 153, 883, 1859, 1913, 3563, 11451, 6333, 51367}}, {5310, 16, 26167, {1, 3, 1, 3, 5, 25, 69, 87, 389, 613, 989, 3557, 1339, 12503, 14505, 63209}}, {5311, 16, 26173, {1, 1, 3, 1, 5, 13, 37, 163, 499, 163, 2025, 1467, 5059, 8479, 2889, 62957}}, {5312, 16, 26179, {1, 1, 7, 9, 23, 31, 109, 49, 73, 197, 337, 2763, 4789, 8983, 9691, 32155}}, {5313, 16, 26193, {1, 3, 1, 3, 31, 25, 121, 91, 371, 339, 833, 2217, 4997, 9425, 10685, 60037}}, {5314, 16, 26230, {1, 1, 7, 11, 31, 3, 105, 125, 255, 175, 803, 1787, 6231, 4441, 5031, 29737}}, {5315, 16, 26234, {1, 1, 1, 11, 21, 63, 75, 209, 393, 437, 495, 2397, 4759, 15703, 29869, 62685}}, {5316, 16, 26246, {1, 1, 7, 7, 25, 33, 117, 7, 293, 623, 2001, 2409, 2487, 14803, 3329, 38277}}, {5317, 16, 26267, {1, 1, 7, 9, 31, 51, 75, 151, 487, 85, 639, 3529, 4491, 1957, 22099, 20263}}, {5318, 16, 26283, {1, 1, 7, 5, 3, 29, 11, 1, 255, 555, 1269, 779, 1525, 7689, 25847, 39347}}, {5319, 16, 26300, {1, 1, 7, 7, 19, 21, 9, 123, 3, 943, 1627, 2979, 919, 4565, 31435, 59789}}, {5320, 16, 26341, {1, 3, 7, 5, 29, 13, 57, 221, 9, 893, 1685, 1879, 4575, 7369, 26191, 6067}}, {5321, 16, 26356, {1, 3, 7, 9, 13, 11, 9, 27, 313, 751, 1377, 1121, 3799, 1673, 16305, 30665}}, {5322, 16, 26377, {1, 3, 3, 13, 23, 17, 59, 47, 499, 525, 681, 3195, 1611, 7003, 7325, 53019}}, {5323, 16, 26397, {1, 3, 1, 7, 23, 51, 59, 127, 67, 263, 1305, 2479, 637, 9441, 6329, 12857}}, {5324, 16, 26404, {1, 1, 7, 7, 9, 3, 51, 193, 205, 503, 19, 2513, 7489, 9241, 15371, 20875}}, {5325, 16, 26411, {1, 3, 3, 1, 1, 57, 17, 181, 23, 549, 769, 2325, 3669, 7017, 25601, 64479}}, {5326, 16, 26422, {1, 3, 1, 15, 5, 55, 53, 13, 327, 447, 1031, 1599, 3639, 15305, 1387, 16035}}, {5327, 16, 26451, {1, 3, 7, 15, 9, 41, 53, 113, 97, 99, 1377, 4047, 3713, 8891, 5601, 5853}}, {5328, 16, 26454, {1, 1, 7, 9, 9, 7, 29, 249, 411, 315, 181, 2153, 6135, 6947, 27595, 15553}}, {5329, 16, 26463, {1, 1, 7, 11, 3, 57, 35, 55, 165, 313, 577, 3049, 4259, 4231, 7225, 58973}}, {5330, 16, 26488, {1, 1, 1, 1, 15, 43, 53, 143, 157, 843, 465, 3897, 4797, 12305, 28807, 46381}}, {5331, 16, 26498, {1, 3, 7, 9, 17, 3, 99, 61, 475, 507, 831, 2207, 367, 27, 23205, 2303}}, {5332, 16, 26509, {1, 1, 3, 11, 27, 29, 99, 237, 43, 955, 361, 3231, 1863, 7973, 8969, 58663}}, {5333, 16, 26512, {1, 3, 1, 7, 15, 15, 11, 251, 135, 261, 675, 3723, 7675, 7993, 1725, 41149}}, {5334, 16, 26517, {1, 3, 3, 9, 29, 11, 105, 37, 151, 215, 1911, 4051, 5427, 11019, 9073, 33129}}, {5335, 16, 26534, {1, 3, 3, 1, 19, 7, 103, 81, 371, 253, 1043, 1231, 6497, 10377, 2349, 29047}}, {5336, 16, 26545, {1, 3, 7, 9, 15, 11, 85, 61, 507, 629, 811, 3883, 1435, 13035, 31913, 2153}}, {5337, 16, 26546, {1, 1, 5, 11, 13, 7, 63, 147, 117, 223, 1217, 3317, 3275, 6851, 2917, 55901}}, {5338, 16, 26636, {1, 3, 3, 9, 7, 21, 1, 63, 117, 297, 405, 797, 337, 10173, 8327, 29157}}, {5339, 16, 26749, {1, 1, 7, 11, 31, 63, 97, 191, 259, 421, 1829, 2117, 4203, 11919, 18001, 55791}}, {5340, 16, 26753, {1, 3, 7, 9, 21, 13, 125, 247, 133, 611, 463, 227, 7815, 8877, 17961, 3641}}, {5341, 16, 26759, {1, 1, 7, 9, 27, 21, 97, 165, 371, 715, 491, 3929, 3067, 12501, 5511, 18217}}, {5342, 16, 26774, {1, 3, 3, 15, 27, 17, 81, 161, 263, 273, 135, 1159, 7535, 4581, 16065, 11493}}, {5343, 16, 26789, {1, 3, 3, 7, 11, 59, 111, 47, 381, 413, 243, 2173, 4957, 2451, 15669, 22071}}, {5344, 16, 26808, {1, 3, 7, 5, 3, 31, 65, 131, 111, 141, 1891, 2983, 3331, 769, 24075, 40865}}, {5345, 16, 26825, {1, 3, 7, 11, 11, 63, 7, 213, 333, 111, 1235, 961, 3749, 9123, 5067, 9657}}, {5346, 16, 26831, {1, 3, 3, 1, 9, 33, 1, 225, 37, 951, 1995, 3215, 3117, 3723, 15013, 64525}}, {5347, 16, 26859, {1, 3, 3, 13, 29, 19, 103, 65, 67, 423, 1679, 3791, 5551, 11711, 195, 52291}}, {5348, 16, 26888, {1, 3, 1, 15, 31, 7, 65, 249, 489, 287, 1385, 1075, 1357, 13593, 20853, 46221}}, {5349, 16, 26918, {1, 1, 1, 13, 23, 45, 29, 175, 147, 101, 1007, 1867, 5387, 12683, 29609, 55861}}, {5350, 16, 26929, {1, 3, 5, 13, 21, 31, 85, 187, 183, 179, 1337, 481, 71, 6117, 2177, 27915}}, {5351, 16, 26950, {1, 3, 5, 1, 15, 5, 11, 141, 205, 177, 891, 3591, 4371, 889, 12957, 61083}}, {5352, 16, 26954, {1, 3, 7, 7, 11, 39, 81, 241, 13, 757, 521, 3029, 2345, 12385, 20683, 64053}}, {5353, 16, 26973, {1, 1, 5, 13, 7, 3, 77, 211, 215, 97, 1409, 1021, 1267, 4785, 27231, 2877}}, {5354, 16, 26997, {1, 3, 5, 3, 11, 57, 93, 39, 415, 179, 1033, 3267, 5383, 10451, 27117, 10711}}, {5355, 16, 26998, {1, 1, 1, 1, 3, 45, 93, 179, 453, 995, 1423, 3849, 4381, 15789, 20789, 18775}}, {5356, 16, 27008, {1, 3, 1, 3, 13, 25, 33, 165, 351, 887, 1109, 195, 8131, 3061, 16743, 22997}}, {5357, 16, 27038, {1, 3, 1, 5, 23, 35, 93, 155, 333, 603, 1571, 229, 2979, 6295, 20793, 40901}}, {5358, 16, 27109, {1, 3, 3, 11, 29, 57, 101, 61, 487, 719, 1009, 1933, 7815, 15329, 12489, 26105}}, {5359, 16, 27127, {1, 3, 3, 9, 23, 59, 73, 13, 141, 815, 1819, 3557, 2555, 5901, 23039, 62321}}, {5360, 16, 27150, {1, 1, 3, 5, 19, 49, 27, 139, 35, 995, 565, 323, 6439, 15679, 27017, 30889}}, {5361, 16, 27168, {1, 3, 7, 3, 1, 3, 27, 153, 235, 59, 989, 2763, 4197, 3931, 31227, 27129}}, {5362, 16, 27178, {1, 3, 1, 15, 23, 45, 71, 205, 465, 451, 347, 1909, 3287, 8363, 9081, 35641}}, {5363, 16, 27212, {1, 1, 5, 1, 25, 29, 17, 201, 463, 903, 1729, 3435, 2483, 10835, 14315, 52505}}, {5364, 16, 27224, {1, 1, 1, 15, 13, 23, 3, 175, 273, 305, 1945, 3319, 7777, 9411, 4209, 4047}}, {5365, 16, 27229, {1, 1, 5, 15, 25, 5, 71, 35, 307, 89, 301, 3465, 1497, 13467, 21911, 13611}}, {5366, 16, 27246, {1, 3, 1, 7, 11, 7, 33, 241, 349, 751, 633, 3281, 6733, 13833, 23605, 34307}}, {5367, 16, 27251, {1, 1, 1, 15, 17, 27, 45, 13, 259, 843, 1207, 1735, 4063, 6259, 1751, 45107}}, {5368, 16, 27257, {1, 1, 5, 15, 29, 51, 73, 95, 5, 31, 933, 423, 5505, 2193, 14919, 2715}}, {5369, 16, 27258, {1, 3, 1, 3, 23, 5, 29, 7, 271, 485, 827, 1159, 77, 16337, 27933, 18741}}, {5370, 16, 27260, {1, 3, 7, 9, 23, 33, 47, 191, 59, 301, 1277, 3745, 7837, 799, 2861, 25853}}, {5371, 16, 27287, {1, 3, 7, 13, 13, 39, 33, 91, 279, 855, 1917, 3601, 3971, 6193, 16951, 6115}}, {5372, 16, 27300, {1, 1, 3, 13, 15, 59, 89, 239, 313, 545, 431, 3823, 5741, 14981, 2647, 42813}}, {5373, 16, 27315, {1, 1, 1, 3, 17, 21, 45, 37, 343, 737, 1795, 2659, 2897, 7683, 15191, 1393}}, {5374, 16, 27329, {1, 1, 3, 3, 19, 55, 27, 201, 459, 953, 1531, 671, 5667, 11695, 149, 14605}}, {5375, 16, 27332, {1, 3, 7, 13, 9, 63, 67, 229, 69, 819, 859, 2035, 5725, 13403, 24197, 2599}}, {5376, 16, 27349, {1, 1, 7, 7, 1, 59, 45, 105, 327, 779, 59, 791, 7593, 8189, 28161, 13339}}, {5377, 16, 27350, {1, 3, 3, 15, 25, 55, 125, 189, 327, 733, 115, 3541, 5227, 12143, 32719, 15785}}, {5378, 16, 27354, {1, 3, 3, 7, 19, 51, 35, 63, 507, 89, 1441, 2369, 4927, 7953, 10193, 8331}}, {5379, 16, 27359, {1, 1, 5, 5, 21, 1, 41, 49, 217, 1001, 1649, 2789, 5267, 1525, 3811, 40785}}, {5380, 16, 27377, {1, 1, 7, 15, 31, 21, 33, 183, 425, 393, 367, 3253, 3047, 465, 28229, 44743}}, {5381, 16, 27378, {1, 3, 7, 5, 1, 23, 11, 71, 269, 707, 5, 2931, 1959, 15089, 9299, 43927}}, {5382, 16, 27383, {1, 3, 5, 15, 21, 51, 31, 15, 49, 481, 297, 3871, 751, 10661, 26401, 62923}}, {5383, 16, 27384, {1, 3, 1, 7, 17, 27, 35, 255, 205, 865, 1659, 1921, 5457, 11633, 2825, 13549}}, {5384, 16, 27387, {1, 1, 5, 15, 17, 35, 83, 237, 437, 7, 2001, 2225, 2601, 10841, 7953, 20651}}, {5385, 16, 27392, {1, 1, 1, 3, 3, 37, 43, 135, 451, 203, 1319, 261, 3889, 14489, 9635, 52545}}, {5386, 16, 27402, {1, 3, 3, 13, 15, 41, 95, 207, 43, 997, 207, 3459, 5995, 5187, 15851, 28551}}, {5387, 16, 27438, {1, 1, 1, 5, 23, 57, 49, 101, 303, 921, 745, 1407, 7071, 2765, 18703, 32671}}, {5388, 16, 27481, {1, 1, 7, 13, 9, 59, 65, 157, 209, 295, 107, 3175, 3401, 1197, 1875, 9033}}, {5389, 16, 27482, {1, 1, 3, 3, 17, 9, 101, 75, 177, 905, 1013, 397, 3421, 6475, 15897, 11269}}, {5390, 16, 27494, {1, 3, 1, 5, 29, 53, 105, 83, 383, 137, 1169, 1245, 6973, 8701, 317, 10073}}, {5391, 16, 27531, {1, 1, 1, 3, 15, 55, 69, 219, 507, 707, 945, 397, 779, 4157, 10333, 7869}}, {5392, 16, 27542, {1, 3, 1, 3, 9, 21, 125, 153, 107, 969, 1979, 651, 1199, 11419, 17043, 32269}}, {5393, 16, 27546, {1, 1, 1, 7, 1, 29, 71, 127, 209, 853, 1515, 1169, 5055, 9981, 30291, 29569}}, {5394, 16, 27564, {1, 3, 1, 11, 1, 1, 109, 251, 329, 633, 2021, 1237, 2147, 11471, 26025, 19649}}, {5395, 16, 27567, {1, 1, 5, 1, 5, 7, 77, 175, 251, 143, 711, 1241, 2133, 9993, 9203, 24949}}, {5396, 16, 27582, {1, 3, 5, 11, 19, 11, 101, 83, 91, 595, 753, 2389, 1887, 11569, 29759, 55785}}, {5397, 16, 27608, {1, 1, 1, 3, 29, 47, 49, 249, 495, 451, 1887, 2547, 543, 2755, 17207, 24379}}, {5398, 16, 27611, {1, 3, 7, 7, 19, 15, 95, 143, 109, 221, 2041, 3593, 4571, 14547, 14217, 16711}}, {5399, 16, 27624, {1, 3, 5, 13, 27, 55, 31, 209, 39, 989, 1435, 1665, 7265, 14127, 13517, 37647}}, {5400, 16, 27629, {1, 1, 3, 7, 1, 49, 63, 71, 249, 371, 435, 3591, 2677, 143, 28897, 38981}}, {5401, 16, 27655, {1, 1, 7, 7, 21, 9, 53, 221, 23, 515, 1971, 3759, 3511, 10207, 12929, 42021}}, {5402, 16, 27667, {1, 3, 1, 13, 25, 21, 3, 85, 421, 19, 663, 3219, 3541, 13021, 5765, 39623}}, {5403, 16, 27676, {1, 3, 1, 7, 11, 5, 125, 169, 293, 715, 1111, 2965, 4815, 6047, 27207, 23093}}, {5404, 16, 27710, {1, 1, 5, 13, 11, 15, 37, 201, 457, 551, 821, 25, 435, 14307, 25855, 1811}}, {5405, 16, 27724, {1, 3, 3, 9, 27, 15, 1, 253, 217, 549, 1013, 2277, 4171, 3813, 19857, 8641}}, {5406, 16, 27745, {1, 3, 5, 5, 29, 37, 71, 49, 163, 949, 425, 2459, 945, 13125, 13981, 21669}}, {5407, 16, 27752, {1, 3, 3, 9, 17, 23, 53, 235, 83, 887, 439, 1939, 7601, 15275, 15739, 17623}}, {5408, 16, 27770, {1, 3, 5, 13, 7, 51, 73, 67, 167, 849, 2021, 2977, 6591, 3721, 5827, 40897}}, {5409, 16, 27779, {1, 1, 5, 11, 27, 19, 81, 181, 383, 23, 1061, 3327, 1671, 7113, 7435, 17591}}, {5410, 16, 27781, {1, 3, 3, 7, 25, 33, 73, 23, 103, 821, 917, 1425, 4739, 7227, 12365, 29509}}, {5411, 16, 27791, {1, 1, 1, 7, 3, 37, 81, 231, 135, 663, 1983, 399, 6881, 14991, 4957, 20913}}, {5412, 16, 27809, {1, 3, 7, 15, 25, 41, 65, 215, 301, 471, 1669, 65, 227, 9307, 29867, 9503}}, {5413, 16, 27810, {1, 1, 7, 3, 25, 47, 31, 63, 53, 995, 33, 1297, 3423, 12301, 16255, 14467}}, {5414, 16, 27815, {1, 3, 1, 1, 31, 25, 79, 131, 353, 169, 1425, 2257, 2631, 1559, 793, 48383}}, {5415, 16, 27827, {1, 3, 3, 5, 31, 9, 93, 35, 503, 243, 595, 2939, 771, 7333, 13429, 59457}}, {5416, 16, 27834, {1, 3, 1, 7, 5, 51, 21, 237, 453, 743, 775, 2207, 453, 12077, 12283, 9735}}, {5417, 16, 27865, {1, 3, 1, 15, 5, 47, 59, 239, 87, 97, 885, 3191, 2547, 13227, 7433, 4989}}, {5418, 16, 27899, {1, 3, 5, 15, 21, 33, 41, 155, 509, 317, 517, 1101, 133, 1897, 8235, 57673}}, {5419, 16, 27901, {1, 1, 5, 15, 7, 9, 59, 155, 415, 831, 1173, 1263, 5451, 7181, 7233, 51483}}, {5420, 16, 27914, {1, 1, 7, 3, 31, 43, 71, 39, 155, 529, 895, 827, 3203, 4625, 32185, 53507}}, {5421, 16, 27950, {1, 3, 1, 11, 15, 17, 85, 141, 277, 439, 1775, 4015, 4457, 281, 22455, 47591}}, {5422, 16, 27994, {1, 3, 5, 11, 25, 41, 93, 39, 51, 655, 1347, 3109, 2479, 9057, 18939, 26217}}, {5423, 16, 28005, {1, 3, 3, 11, 31, 41, 7, 189, 241, 443, 65, 1723, 4817, 13405, 9641, 63965}}, {5424, 16, 28009, {1, 1, 5, 3, 19, 29, 111, 11, 399, 277, 425, 1331, 5365, 14521, 16449, 29411}}, {5425, 16, 28033, {1, 1, 3, 9, 25, 53, 91, 175, 481, 307, 1025, 71, 7425, 10667, 4053, 25605}}, {5426, 16, 28039, {1, 3, 7, 7, 3, 13, 75, 175, 467, 363, 1889, 1759, 1155, 5511, 13047, 39637}}, {5427, 16, 28060, {1, 3, 7, 9, 5, 21, 65, 43, 223, 97, 835, 2253, 3313, 9817, 23015, 55365}}, {5428, 16, 28067, {1, 1, 1, 13, 9, 63, 95, 61, 417, 713, 1469, 1815, 795, 13609, 1567, 33535}}, {5429, 16, 28069, {1, 3, 7, 1, 25, 45, 41, 27, 53, 407, 1633, 1317, 6267, 3293, 8899, 45235}}, {5430, 16, 28099, {1, 3, 5, 11, 23, 47, 91, 211, 41, 775, 1301, 1407, 7931, 4491, 7579, 62321}}, {5431, 16, 28113, {1, 1, 1, 7, 23, 15, 57, 31, 437, 293, 1999, 2589, 5453, 2519, 15533, 26949}}, {5432, 16, 28114, {1, 3, 1, 9, 1, 27, 41, 165, 129, 297, 1887, 1171, 201, 5817, 24503, 38911}}, {5433, 16, 28139, {1, 3, 1, 7, 1, 11, 63, 225, 191, 623, 1281, 3275, 167, 14697, 4905, 47289}}, {5434, 16, 28142, {1, 3, 7, 7, 15, 47, 87, 177, 303, 391, 355, 3997, 7557, 6201, 20531, 22483}}, {5435, 16, 28153, {1, 3, 3, 15, 17, 31, 111, 87, 61, 477, 1581, 3787, 5919, 10511, 2607, 62951}}, {5436, 16, 28166, {1, 3, 3, 9, 29, 19, 63, 27, 205, 915, 1131, 3821, 673, 2875, 12703, 14367}}, {5437, 16, 28172, {1, 3, 7, 1, 21, 19, 25, 97, 281, 635, 629, 181, 5207, 11133, 3687, 3489}}, {5438, 16, 28183, {1, 3, 3, 9, 5, 63, 3, 21, 385, 713, 1805, 3583, 2807, 15455, 13057, 39771}}, {5439, 16, 28194, {1, 3, 5, 9, 3, 59, 1, 253, 123, 405, 575, 3911, 4609, 11869, 23593, 947}}, {5440, 16, 28232, {1, 1, 7, 5, 21, 27, 101, 221, 413, 153, 1647, 3637, 803, 5697, 20761, 61137}}, {5441, 16, 28245, {1, 3, 7, 13, 31, 35, 111, 253, 187, 499, 465, 157, 5551, 10417, 323, 34913}}, {5442, 16, 28246, {1, 1, 1, 7, 11, 41, 29, 65, 393, 69, 1373, 2291, 7807, 13159, 13735, 31001}}, {5443, 16, 28252, {1, 3, 7, 13, 31, 49, 1, 35, 377, 11, 427, 2803, 1725, 9165, 22633, 63985}}, {5444, 16, 28265, {1, 3, 7, 13, 3, 41, 27, 43, 269, 599, 1035, 3681, 309, 6011, 1065, 27901}}, {5445, 16, 28301, {1, 3, 5, 13, 1, 19, 105, 143, 425, 883, 1669, 155, 189, 8573, 10759, 25507}}, {5446, 16, 28323, {1, 3, 5, 1, 15, 37, 115, 9, 149, 79, 1733, 1045, 1849, 3289, 13957, 63171}}, {5447, 16, 28344, {1, 1, 3, 9, 17, 27, 49, 201, 155, 901, 47, 1585, 4419, 8117, 25425, 14699}}, {5448, 16, 28362, {1, 1, 7, 13, 19, 55, 19, 21, 427, 77, 1295, 1471, 6271, 7985, 19337, 12701}}, {5449, 16, 28400, {1, 1, 1, 1, 11, 49, 101, 53, 175, 157, 839, 2713, 6149, 6391, 8089, 27739}}, {5450, 16, 28417, {1, 3, 1, 1, 5, 21, 121, 199, 107, 221, 993, 1737, 409, 2545, 9287, 54605}}, {5451, 16, 28454, {1, 1, 1, 3, 25, 25, 51, 121, 371, 861, 967, 3257, 6221, 11701, 27897, 42509}}, {5452, 16, 28466, {1, 1, 1, 3, 17, 25, 101, 191, 313, 817, 815, 1855, 7999, 12649, 23385, 26081}}, {5453, 16, 28468, {1, 1, 5, 1, 25, 55, 51, 237, 63, 943, 455, 619, 2381, 9773, 14575, 34205}}, {5454, 16, 28477, {1, 3, 3, 3, 13, 49, 101, 37, 457, 727, 1009, 2389, 4841, 16303, 9599, 17773}}, {5455, 16, 28498, {1, 1, 7, 9, 19, 59, 111, 205, 19, 229, 1755, 1169, 7767, 13335, 19669, 33269}}, {5456, 16, 28510, {1, 3, 1, 15, 29, 1, 51, 167, 7, 415, 1295, 3165, 1241, 12859, 5531, 20083}}, {5457, 16, 28513, {1, 1, 3, 7, 7, 51, 31, 221, 57, 643, 1461, 3951, 6237, 5757, 1907, 40471}}, {5458, 16, 28571, {1, 3, 3, 5, 23, 39, 49, 177, 183, 117, 1379, 3803, 771, 12723, 22291, 32667}}, {5459, 16, 28573, {1, 1, 3, 13, 27, 17, 39, 27, 313, 141, 1421, 2967, 2213, 1915, 23219, 15113}}, {5460, 16, 28578, {1, 1, 1, 11, 5, 55, 51, 55, 389, 895, 57, 1447, 1497, 2799, 19585, 11587}}, {5461, 16, 28587, {1, 1, 5, 13, 11, 55, 91, 77, 69, 131, 93, 1383, 3321, 10487, 15087, 8539}}, {5462, 16, 28601, {1, 1, 3, 9, 23, 49, 107, 131, 363, 733, 1189, 3575, 7815, 10071, 20291, 7533}}, {5463, 16, 28646, {1, 1, 3, 15, 31, 31, 73, 15, 199, 17, 761, 3271, 1419, 12985, 32717, 37317}}, {5464, 16, 28663, {1, 3, 1, 13, 23, 9, 3, 59, 109, 729, 1321, 4023, 7041, 14445, 22205, 8993}}, {5465, 16, 28681, {1, 1, 3, 15, 19, 43, 99, 59, 491, 479, 715, 2235, 7493, 889, 31465, 1375}}, {5466, 16, 28682, {1, 3, 3, 15, 9, 47, 35, 115, 227, 615, 605, 1143, 5923, 10939, 9497, 24911}}, {5467, 16, 28699, {1, 1, 3, 15, 23, 53, 111, 87, 423, 497, 85, 3525, 7341, 8885, 21543, 30083}}, {5468, 16, 28706, {1, 1, 5, 3, 21, 5, 117, 157, 407, 743, 715, 1883, 4425, 10187, 6395, 43673}}, {5469, 16, 28708, {1, 3, 3, 3, 31, 39, 119, 77, 269, 891, 1391, 3085, 2881, 10639, 3391, 44911}}, {5470, 16, 28717, {1, 3, 7, 5, 7, 5, 115, 91, 5, 107, 1401, 1409, 1811, 737, 5399, 9119}}, {5471, 16, 28720, {1, 1, 5, 9, 17, 45, 107, 15, 397, 299, 1219, 1675, 963, 10111, 31679, 13809}}, {5472, 16, 28735, {1, 1, 3, 7, 29, 17, 43, 95, 261, 601, 1091, 3633, 1357, 13461, 16583, 12183}}, {5473, 16, 28761, {1, 1, 5, 1, 19, 55, 5, 195, 187, 427, 421, 1717, 4223, 2943, 23147, 32985}}, {5474, 16, 28783, {1, 3, 1, 3, 3, 23, 69, 95, 347, 273, 1223, 3061, 1587, 4707, 32415, 53991}}, {5475, 16, 28788, {1, 1, 7, 13, 15, 13, 29, 151, 325, 949, 2029, 813, 5339, 14165, 1159, 56917}}, {5476, 16, 28811, {1, 1, 1, 13, 9, 33, 67, 109, 215, 313, 1407, 3543, 2403, 5051, 20367, 13527}}, {5477, 16, 28825, {1, 3, 1, 9, 5, 1, 9, 195, 497, 495, 1107, 745, 1647, 10637, 1933, 44965}}, {5478, 16, 28838, {1, 1, 3, 9, 13, 19, 49, 183, 497, 519, 1433, 519, 4317, 2359, 10349, 63789}}, {5479, 16, 28850, {1, 3, 5, 9, 29, 45, 55, 163, 189, 533, 275, 237, 5453, 8895, 6377, 14117}}, {5480, 16, 28891, {1, 3, 7, 5, 25, 3, 111, 241, 139, 383, 689, 3481, 2557, 11163, 5275, 14671}}, {5481, 16, 28897, {1, 3, 3, 9, 3, 5, 5, 141, 507, 331, 645, 1957, 5857, 2083, 24717, 11131}}, {5482, 16, 28932, {1, 1, 5, 1, 11, 49, 113, 45, 491, 945, 1467, 3485, 6369, 15983, 14489, 12679}}, {5483, 16, 28975, {1, 3, 7, 9, 11, 41, 77, 127, 147, 635, 1757, 587, 7423, 4233, 14875, 30531}}, {5484, 16, 28998, {1, 3, 3, 9, 17, 29, 21, 249, 155, 441, 1443, 2093, 1967, 2117, 5815, 3857}}, {5485, 16, 29052, {1, 3, 5, 3, 11, 55, 75, 157, 105, 507, 309, 3737, 2645, 7547, 29373, 62775}}, {5486, 16, 29090, {1, 1, 3, 3, 11, 29, 49, 241, 21, 653, 1273, 715, 8123, 14241, 25257, 1681}}, {5487, 16, 29096, {1, 1, 7, 5, 11, 31, 33, 215, 243, 369, 247, 3365, 4065, 9389, 32457, 58393}}, {5488, 16, 29104, {1, 3, 5, 3, 31, 55, 51, 201, 439, 835, 1805, 25, 7987, 10611, 26893, 43663}}, {5489, 16, 29113, {1, 1, 5, 9, 27, 51, 29, 31, 17, 163, 71, 603, 3083, 12439, 11043, 6471}}, {5490, 16, 29133, {1, 1, 5, 7, 13, 1, 91, 109, 213, 721, 1345, 3037, 3047, 5209, 15559, 17467}}, {5491, 16, 29142, {1, 1, 3, 9, 19, 37, 93, 185, 107, 859, 501, 3843, 1631, 4389, 2215, 52225}}, {5492, 16, 29170, {1, 1, 3, 3, 25, 5, 119, 17, 33, 841, 997, 439, 6135, 7405, 8445, 40087}}, {5493, 16, 29192, {1, 1, 7, 15, 19, 17, 101, 43, 423, 647, 29, 1143, 3259, 7807, 15929, 809}}, {5494, 16, 29221, {1, 1, 7, 13, 21, 57, 83, 101, 183, 309, 171, 3173, 7919, 7263, 29403, 11055}}, {5495, 16, 29236, {1, 1, 1, 13, 3, 1, 57, 15, 435, 713, 459, 847, 3115, 191, 19809, 43037}}, {5496, 16, 29246, {1, 1, 7, 7, 17, 45, 91, 117, 157, 647, 121, 4091, 3611, 14169, 19883, 9069}}, {5497, 16, 29293, {1, 1, 7, 7, 1, 47, 21, 253, 419, 157, 549, 2105, 4475, 3127, 3939, 5809}}, {5498, 16, 29305, {1, 1, 5, 7, 15, 7, 71, 195, 87, 757, 77, 1391, 151, 12995, 26403, 17789}}, {5499, 16, 29312, {1, 1, 1, 15, 15, 3, 79, 43, 475, 263, 1195, 2385, 5955, 7039, 15625, 19263}}, {5500, 16, 29339, {1, 1, 5, 13, 13, 29, 5, 29, 489, 929, 2027, 2771, 6899, 14173, 13747, 1019}}, {5501, 16, 29365, {1, 1, 7, 1, 5, 45, 37, 85, 221, 871, 627, 3445, 4853, 4243, 21651, 30201}}, {5502, 16, 29389, {1, 3, 7, 11, 9, 49, 73, 245, 161, 321, 579, 2641, 6653, 5513, 11555, 53091}}, {5503, 16, 29402, {1, 1, 7, 7, 25, 63, 101, 179, 497, 113, 9, 549, 5341, 6097, 13305, 52421}}, {5504, 16, 29423, {1, 3, 3, 7, 21, 7, 89, 79, 137, 651, 189, 3025, 1403, 4559, 32611, 1857}}, {5505, 16, 29443, {1, 3, 1, 13, 27, 55, 61, 135, 81, 195, 799, 3477, 4873, 2691, 29769, 59033}}, {5506, 16, 29445, {1, 3, 3, 15, 29, 11, 7, 11, 151, 649, 1511, 2327, 6921, 12911, 3571, 35039}}, {5507, 16, 29463, {1, 1, 5, 11, 25, 19, 49, 133, 455, 373, 1827, 3619, 2127, 3365, 11327, 52785}}, {5508, 16, 29473, {1, 3, 5, 1, 9, 19, 107, 171, 205, 93, 1557, 2693, 4297, 4415, 20407, 19221}}, {5509, 16, 29493, {1, 3, 3, 11, 15, 45, 37, 143, 61, 759, 2047, 2465, 3923, 9477, 30831, 46377}}, {5510, 16, 29506, {1, 3, 7, 11, 17, 51, 117, 129, 77, 579, 1167, 1575, 1967, 10099, 22137, 31431}}, {5511, 16, 29518, {1, 1, 5, 13, 31, 61, 67, 37, 49, 283, 235, 783, 7353, 5149, 12245, 18725}}, {5512, 16, 29532, {1, 1, 5, 3, 17, 33, 35, 83, 359, 253, 1911, 913, 6481, 4635, 24223, 19693}}, {5513, 16, 29560, {1, 1, 1, 13, 19, 15, 81, 131, 417, 969, 1911, 2829, 3097, 5333, 11175, 52269}}, {5514, 16, 29590, {1, 3, 7, 15, 5, 39, 19, 205, 329, 83, 1473, 3259, 6409, 12297, 30557, 40917}}, {5515, 16, 29594, {1, 3, 1, 15, 17, 33, 123, 185, 501, 299, 621, 929, 5797, 10539, 12321, 61043}}, {5516, 16, 29637, {1, 3, 3, 1, 7, 51, 119, 19, 17, 203, 373, 2145, 2367, 9965, 28071, 50083}}, {5517, 16, 29647, {1, 1, 1, 5, 1, 35, 43, 243, 91, 793, 1299, 2705, 7987, 1291, 10147, 17863}}, {5518, 16, 29650, {1, 3, 5, 15, 27, 13, 99, 33, 179, 479, 897, 1113, 1639, 12321, 23987, 36219}}, {5519, 16, 29655, {1, 1, 5, 9, 29, 41, 85, 9, 389, 583, 293, 1727, 2575, 13767, 15443, 40027}}, {5520, 16, 29661, {1, 1, 7, 11, 29, 33, 93, 115, 51, 747, 1569, 3557, 869, 1991, 29877, 44131}}, {5521, 16, 29680, {1, 3, 7, 7, 29, 11, 33, 137, 411, 689, 1815, 1789, 6557, 5973, 19445, 49449}}, {5522, 16, 29721, {1, 1, 5, 1, 17, 3, 77, 55, 351, 325, 983, 3935, 819, 14127, 18893, 62553}}, {5523, 16, 29751, {1, 3, 3, 1, 15, 33, 25, 159, 135, 385, 837, 3615, 1649, 1687, 3421, 47579}}, {5524, 16, 29755, {1, 3, 1, 7, 17, 25, 125, 169, 469, 919, 1789, 863, 2827, 949, 21347, 10517}}, {5525, 16, 29760, {1, 3, 1, 11, 27, 19, 45, 255, 175, 483, 1073, 3779, 611, 2809, 179, 19767}}, {5526, 16, 29772, {1, 1, 3, 1, 21, 61, 47, 171, 179, 85, 61, 1209, 4005, 11439, 8477, 27229}}, {5527, 16, 29778, {1, 1, 1, 1, 3, 1, 43, 159, 261, 411, 1449, 1621, 3681, 3465, 24029, 3493}}, {5528, 16, 29799, {1, 3, 1, 11, 5, 13, 9, 23, 369, 769, 363, 3329, 409, 13151, 30269, 9621}}, {5529, 16, 29824, {1, 1, 5, 1, 13, 39, 121, 39, 295, 981, 1151, 4039, 8179, 5007, 25527, 1249}}, {5530, 16, 29841, {1, 3, 7, 5, 17, 21, 47, 233, 211, 349, 643, 109, 7553, 11453, 30967, 30959}}, {5531, 16, 29842, {1, 1, 5, 3, 31, 39, 105, 137, 487, 855, 107, 1567, 2385, 2889, 25777, 33709}}, {5532, 16, 29853, {1, 1, 1, 9, 1, 7, 9, 69, 465, 965, 355, 299, 3327, 14997, 14599, 2241}}, {5533, 16, 29867, {1, 3, 5, 11, 5, 39, 69, 203, 367, 611, 199, 3931, 5039, 8683, 8675, 49151}}, {5534, 16, 29949, {1, 1, 7, 13, 31, 35, 101, 213, 273, 827, 203, 2773, 4131, 1397, 15311, 62903}}, {5535, 16, 29950, {1, 3, 7, 9, 23, 41, 33, 213, 411, 965, 563, 3035, 247, 15019, 20429, 61081}}, {5536, 16, 29964, {1, 1, 5, 5, 5, 1, 1, 203, 27, 199, 67, 1301, 7831, 12839, 2777, 6325}}, {5537, 16, 29967, {1, 3, 1, 11, 27, 3, 11, 173, 9, 121, 1701, 2741, 29, 16319, 15849, 11989}}, {5538, 16, 29985, {1, 1, 5, 13, 17, 49, 125, 153, 261, 603, 1617, 3967, 6083, 7745, 19683, 49885}}, {5539, 16, 29992, {1, 3, 3, 7, 23, 13, 39, 169, 135, 361, 579, 1443, 7615, 2389, 5669, 651}}, {5540, 16, 30000, {1, 3, 5, 9, 31, 19, 81, 83, 483, 93, 1895, 2285, 7771, 8281, 8353, 39677}}, {5541, 16, 30020, {1, 1, 7, 7, 23, 51, 127, 25, 101, 611, 1095, 3013, 2685, 8153, 22629, 53355}}, {5542, 16, 30024, {1, 1, 1, 11, 11, 37, 35, 127, 317, 877, 1591, 401, 4121, 9945, 12121, 28257}}, {5543, 16, 30030, {1, 3, 5, 11, 23, 9, 43, 135, 37, 405, 2009, 2903, 3065, 6591, 8473, 58231}}, {5544, 16, 30066, {1, 1, 3, 11, 21, 45, 21, 205, 425, 891, 357, 2609, 495, 7541, 2161, 37853}}, {5545, 16, 30071, {1, 3, 1, 1, 25, 9, 113, 243, 317, 491, 997, 2023, 5869, 13643, 11483, 6733}}, {5546, 16, 30078, {1, 3, 1, 15, 13, 3, 75, 25, 409, 421, 1817, 857, 4575, 12559, 1211, 62177}}, {5547, 16, 30082, {1, 1, 3, 7, 17, 35, 115, 195, 217, 223, 1195, 749, 5619, 7265, 7369, 46907}}, {5548, 16, 30096, {1, 1, 1, 13, 5, 57, 117, 161, 121, 533, 987, 3959, 5047, 15213, 15811, 41841}}, {5549, 16, 30101, {1, 3, 7, 1, 19, 55, 97, 191, 217, 75, 1881, 3351, 3737, 12179, 22875, 28767}}, {5550, 16, 30102, {1, 3, 1, 9, 15, 41, 9, 97, 491, 31, 1191, 963, 875, 8259, 2723, 9503}}, {5551, 16, 30122, {1, 3, 7, 9, 3, 17, 21, 71, 1, 523, 2031, 3469, 3181, 8707, 6093, 8837}}, {5552, 16, 30141, {1, 3, 5, 3, 5, 1, 11, 91, 33, 37, 643, 85, 4325, 4293, 8351, 28311}}, {5553, 16, 30159, {1, 3, 7, 5, 15, 45, 47, 183, 391, 113, 493, 3607, 2541, 13521, 31613, 36049}}, {5554, 16, 30168, {1, 1, 3, 9, 15, 33, 115, 69, 289, 217, 1875, 1339, 4995, 9073, 6909, 15977}}, {5555, 16, 30177, {1, 1, 7, 3, 9, 29, 39, 219, 119, 369, 893, 1293, 4511, 15703, 11093, 30259}}, {5556, 16, 30183, {1, 1, 5, 13, 19, 9, 17, 75, 149, 415, 35, 97, 563, 1689, 18311, 54291}}, {5557, 16, 30197, {1, 1, 7, 3, 17, 15, 71, 29, 25, 883, 1801, 1675, 5585, 9413, 3813, 26673}}, {5558, 16, 30213, {1, 1, 3, 15, 5, 13, 31, 41, 311, 411, 573, 281, 8075, 7163, 11817, 29121}}, {5559, 16, 30231, {1, 1, 7, 9, 7, 57, 15, 141, 337, 123, 269, 3737, 6455, 2539, 13655, 59809}}, {5560, 16, 30232, {1, 3, 1, 15, 15, 23, 111, 51, 429, 483, 1567, 1317, 8057, 1609, 30181, 35687}}, {5561, 16, 30241, {1, 3, 7, 9, 25, 43, 67, 13, 319, 587, 1827, 443, 2031, 8563, 16173, 58667}}, {5562, 16, 30253, {1, 3, 5, 13, 11, 63, 89, 105, 377, 257, 7, 4077, 5091, 5125, 25, 39033}}, {5563, 16, 30259, {1, 3, 3, 1, 9, 29, 7, 87, 239, 469, 1851, 1711, 5797, 7137, 11405, 20175}}, {5564, 16, 30262, {1, 3, 3, 1, 13, 17, 101, 209, 301, 95, 1181, 3091, 4451, 1241, 17057, 335}}, {5565, 16, 30268, {1, 1, 1, 9, 31, 7, 81, 161, 391, 677, 115, 141, 5375, 7279, 1887, 1645}}, {5566, 16, 30297, {1, 1, 1, 11, 27, 61, 3, 195, 189, 409, 1747, 331, 2931, 9535, 1369, 47233}}, {5567, 16, 30316, {1, 3, 5, 15, 7, 15, 105, 255, 491, 689, 97, 1131, 3459, 7147, 27541, 62307}}, {5568, 16, 30322, {1, 3, 5, 9, 5, 23, 1, 209, 233, 717, 1919, 1835, 5073, 10403, 28979, 1945}}, {5569, 16, 30344, {1, 1, 3, 9, 3, 35, 107, 209, 255, 447, 227, 273, 443, 9367, 24105, 34095}}, {5570, 16, 30350, {1, 1, 3, 11, 3, 33, 5, 165, 83, 787, 1555, 31, 4351, 16301, 27453, 56739}}, {5571, 16, 30355, {1, 1, 5, 5, 29, 9, 127, 253, 281, 487, 441, 1129, 2811, 9113, 28855, 57117}}, {5572, 16, 30429, {1, 1, 1, 13, 13, 1, 17, 143, 121, 917, 1571, 3777, 2297, 3691, 3001, 42327}}, {5573, 16, 30445, {1, 1, 5, 1, 25, 7, 41, 245, 241, 929, 1203, 3755, 7113, 9333, 22549, 12253}}, {5574, 16, 30477, {1, 3, 1, 11, 1, 13, 69, 73, 285, 975, 1331, 3411, 7777, 3489, 2763, 44297}}, {5575, 16, 30513, {1, 3, 5, 11, 3, 37, 21, 105, 153, 307, 989, 627, 3127, 6169, 10573, 22139}}, {5576, 16, 30520, {1, 3, 5, 15, 11, 11, 39, 21, 355, 437, 547, 2283, 6443, 5561, 6367, 53899}}, {5577, 16, 30540, {1, 1, 1, 9, 25, 51, 97, 175, 131, 207, 1367, 2561, 7455, 8289, 5877, 4383}}, {5578, 16, 30551, {1, 3, 7, 1, 29, 17, 7, 1, 43, 831, 591, 2145, 975, 909, 23107, 43987}}, {5579, 16, 30573, {1, 3, 5, 13, 5, 47, 65, 65, 439, 807, 271, 1615, 1873, 10905, 30537, 3337}}, {5580, 16, 30609, {1, 1, 1, 13, 29, 1, 53, 5, 307, 347, 1059, 545, 1129, 11883, 5969, 50433}}, {5581, 16, 30622, {1, 1, 3, 5, 31, 29, 63, 201, 255, 803, 677, 1499, 1691, 14037, 18251, 6881}}, {5582, 16, 30635, {1, 3, 1, 5, 5, 13, 13, 121, 505, 855, 467, 2803, 3297, 4689, 18443, 60757}}, {5583, 16, 30658, {1, 1, 5, 13, 11, 19, 11, 201, 101, 431, 693, 1267, 6909, 7759, 2265, 6125}}, {5584, 16, 30667, {1, 1, 7, 13, 9, 3, 37, 209, 269, 27, 1041, 2587, 4667, 11077, 27009, 27967}}, {5585, 16, 30681, {1, 1, 5, 5, 1, 5, 127, 179, 463, 949, 1525, 231, 1201, 3283, 9929, 46677}}, {5586, 16, 30684, {1, 3, 1, 15, 9, 11, 89, 129, 331, 833, 1415, 229, 2059, 13145, 30525, 33773}}, {5587, 16, 30703, {1, 1, 7, 15, 7, 43, 95, 177, 313, 989, 483, 825, 1885, 4535, 8213, 39835}}, {5588, 16, 30705, {1, 1, 7, 3, 19, 27, 45, 163, 17, 523, 1565, 3753, 7433, 14117, 8499, 40177}}, {5589, 16, 30715, {1, 3, 3, 15, 23, 45, 95, 31, 55, 469, 383, 237, 6287, 5561, 20901, 48259}}, {5590, 16, 30742, {1, 1, 3, 1, 23, 61, 101, 185, 35, 553, 463, 1169, 2875, 12491, 14327, 47999}}, {5591, 16, 30748, {1, 3, 3, 13, 23, 29, 77, 21, 19, 3, 769, 1943, 2081, 9135, 29767, 11367}}, {5592, 16, 30758, {1, 1, 5, 15, 5, 11, 59, 163, 355, 993, 375, 3181, 2675, 8515, 17007, 38467}}, {5593, 16, 30767, {1, 1, 5, 13, 19, 5, 107, 83, 123, 843, 413, 2137, 7531, 3833, 6149, 55925}}, {5594, 16, 30770, {1, 3, 1, 13, 23, 9, 41, 145, 265, 591, 1899, 3145, 5255, 13653, 12245, 25367}}, {5595, 16, 30772, {1, 1, 3, 15, 1, 45, 119, 79, 121, 137, 1945, 2041, 2409, 1377, 29501, 29885}}, {5596, 16, 30807, {1, 1, 7, 11, 27, 57, 75, 183, 341, 237, 1909, 2785, 5973, 9965, 21729, 45089}}, {5597, 16, 30814, {1, 3, 5, 7, 21, 1, 41, 189, 131, 1021, 1375, 1463, 5985, 12499, 4115, 9131}}, {5598, 16, 30824, {1, 3, 7, 15, 21, 19, 59, 171, 339, 841, 1725, 2909, 6437, 2499, 17191, 43275}}, {5599, 16, 30857, {1, 3, 1, 1, 15, 55, 31, 199, 351, 183, 1819, 1873, 7877, 12407, 7881, 1663}}, {5600, 16, 30875, {1, 1, 3, 15, 1, 61, 111, 61, 115, 243, 1281, 3195, 1229, 10973, 189, 36049}}, {5601, 16, 30931, {1, 1, 3, 15, 13, 13, 3, 49, 61, 839, 1615, 1853, 3619, 7805, 25441, 8789}}, {5602, 16, 30933, {1, 3, 1, 9, 27, 43, 7, 193, 397, 869, 1079, 1785, 6535, 1801, 29363, 59269}}, {5603, 16, 30949, {1, 3, 5, 5, 31, 57, 37, 53, 41, 871, 809, 1235, 1011, 12979, 8749, 52151}}, {5604, 16, 30953, {1, 1, 7, 13, 25, 59, 69, 117, 463, 587, 513, 297, 6991, 5905, 25737, 37249}}, {5605, 16, 30982, {1, 1, 5, 1, 27, 19, 121, 97, 349, 793, 1971, 3057, 4781, 15841, 22625, 58637}}, {5606, 16, 31010, {1, 1, 5, 5, 25, 31, 11, 133, 411, 239, 1071, 3473, 1733, 7175, 31841, 46665}}, {5607, 16, 31012, {1, 3, 3, 13, 19, 25, 99, 175, 271, 175, 1755, 3597, 4615, 15207, 25573, 16089}}, {5608, 16, 31039, {1, 1, 7, 11, 17, 19, 119, 91, 505, 791, 55, 2979, 7463, 10147, 23647, 33283}}, {5609, 16, 31041, {1, 3, 1, 1, 21, 11, 43, 173, 239, 839, 1533, 1559, 549, 15621, 22133, 46387}}, {5610, 16, 31061, {1, 1, 3, 13, 31, 15, 73, 15, 209, 267, 701, 2899, 1163, 10093, 7727, 44211}}, {5611, 16, 31082, {1, 3, 1, 11, 29, 21, 5, 39, 421, 375, 411, 3693, 3901, 8507, 10883, 16189}}, {5612, 16, 31087, {1, 3, 1, 7, 13, 13, 73, 167, 149, 677, 1435, 621, 2511, 13813, 13129, 55327}}, {5613, 16, 31096, {1, 3, 5, 15, 7, 59, 83, 221, 77, 357, 281, 2689, 5629, 5837, 1701, 30811}}, {5614, 16, 31115, {1, 3, 3, 11, 17, 1, 43, 95, 473, 981, 1487, 1337, 905, 3307, 22357, 181}}, {5615, 16, 31130, {1, 1, 3, 7, 1, 27, 9, 3, 489, 1, 1265, 2463, 539, 12769, 825, 6149}}, {5616, 16, 31168, {1, 3, 3, 3, 11, 27, 81, 237, 411, 241, 1613, 931, 6397, 4325, 29651, 49003}}, {5617, 16, 31171, {1, 3, 3, 13, 1, 19, 55, 73, 47, 203, 1661, 1245, 6847, 2457, 25427, 33069}}, {5618, 16, 31177, {1, 3, 7, 3, 7, 47, 11, 165, 391, 457, 301, 1213, 1913, 14531, 7847, 14811}}, {5619, 16, 31180, {1, 3, 1, 9, 1, 9, 57, 203, 15, 733, 1131, 2751, 5869, 3165, 21497, 28881}}, {5620, 16, 31191, {1, 3, 1, 5, 9, 7, 29, 85, 71, 571, 469, 2395, 2819, 8443, 2281, 50489}}, {5621, 16, 31207, {1, 3, 5, 11, 13, 63, 47, 47, 349, 21, 861, 2217, 2945, 6967, 6605, 16459}}, {5622, 16, 31247, {1, 1, 7, 5, 13, 3, 41, 53, 409, 289, 1225, 2965, 5283, 1785, 14443, 51755}}, {5623, 16, 31249, {1, 3, 7, 13, 19, 1, 29, 191, 119, 37, 697, 1909, 481, 14157, 13425, 60581}}, {5624, 16, 31285, {1, 3, 1, 13, 1, 15, 105, 79, 505, 681, 1741, 3683, 5775, 7479, 11387, 1321}}, {5625, 16, 31303, {1, 1, 1, 11, 9, 35, 77, 73, 351, 217, 2029, 2845, 5143, 5677, 15465, 33123}}, {5626, 16, 31310, {1, 1, 3, 3, 19, 49, 63, 109, 335, 743, 741, 1673, 3311, 3139, 25197, 13793}}, {5627, 16, 31337, {1, 3, 1, 3, 29, 63, 79, 1, 493, 13, 1487, 4015, 6983, 1433, 26023, 55591}}, {5628, 16, 31352, {1, 3, 3, 11, 1, 25, 57, 207, 309, 201, 1513, 1749, 3785, 9217, 11531, 40597}}, {5629, 16, 31357, {1, 3, 7, 13, 3, 23, 69, 253, 311, 773, 807, 1063, 745, 4843, 25221, 55885}}, {5630, 16, 31374, {1, 1, 3, 11, 29, 47, 67, 183, 11, 259, 5, 1935, 2295, 8105, 19139, 11707}}, {5631, 16, 31379, {1, 1, 3, 3, 23, 3, 53, 165, 255, 501, 1547, 3649, 5631, 13307, 8869, 5595}}, {5632, 16, 31388, {1, 1, 3, 5, 7, 29, 37, 223, 289, 925, 959, 309, 1479, 3141, 18661, 52123}}, {5633, 16, 31410, {1, 3, 1, 1, 7, 59, 101, 219, 91, 793, 1103, 1485, 7547, 12889, 19097, 15613}}, {5634, 16, 31416, {1, 1, 5, 15, 1, 17, 79, 83, 131, 683, 1611, 1635, 5405, 9621, 29489, 4801}}, {5635, 16, 31467, {1, 1, 5, 7, 31, 63, 59, 125, 401, 261, 1445, 33, 187, 12913, 8639, 48413}}, {5636, 16, 31495, {1, 3, 3, 13, 27, 37, 27, 99, 379, 851, 1311, 4051, 5483, 13935, 29679, 30905}}, {5637, 16, 31504, {1, 1, 3, 1, 7, 57, 79, 23, 97, 561, 1083, 2327, 1545, 5387, 12119, 29717}}, {5638, 16, 31507, {1, 1, 7, 7, 9, 41, 63, 165, 315, 247, 89, 2055, 7399, 1399, 2057, 39851}}, {5639, 16, 31509, {1, 1, 1, 15, 9, 23, 7, 15, 457, 669, 661, 3269, 915, 3475, 15845, 59769}}, {5640, 16, 31514, {1, 3, 7, 15, 17, 53, 83, 5, 457, 103, 1297, 2413, 1095, 7711, 27935, 56357}}, {5641, 16, 31516, {1, 1, 3, 5, 17, 3, 81, 23, 165, 341, 781, 3583, 1751, 6763, 13937, 35331}}, {5642, 16, 31530, {1, 1, 5, 11, 31, 21, 7, 63, 369, 867, 573, 45, 2781, 4507, 21553, 51933}}, {5643, 16, 31555, {1, 1, 5, 15, 1, 37, 85, 133, 489, 733, 1471, 2089, 979, 7723, 7339, 59595}}, {5644, 16, 31567, {1, 1, 1, 1, 7, 3, 3, 77, 137, 1009, 481, 1343, 397, 15865, 21701, 37509}}, {5645, 16, 31570, {1, 3, 7, 5, 17, 57, 19, 245, 249, 289, 1847, 3057, 4905, 5905, 32459, 41305}}, {5646, 16, 31586, {1, 1, 5, 1, 23, 23, 1, 177, 115, 337, 983, 421, 3135, 6319, 27109, 59641}}, {5647, 16, 31598, {1, 3, 1, 5, 25, 1, 63, 73, 61, 967, 1567, 2645, 7347, 11877, 28777, 38507}}, {5648, 16, 31605, {1, 1, 3, 9, 5, 41, 39, 101, 339, 337, 1079, 3861, 5049, 5601, 14377, 34093}}, {5649, 16, 31609, {1, 3, 7, 7, 3, 47, 95, 157, 167, 1011, 1117, 3669, 7993, 11735, 8505, 64713}}, {5650, 16, 31612, {1, 3, 1, 9, 3, 33, 11, 33, 65, 329, 401, 2659, 2851, 3903, 29791, 41613}}, {5651, 16, 31626, {1, 1, 1, 15, 15, 17, 9, 69, 359, 41, 1475, 1919, 5829, 2189, 21295, 33255}}, {5652, 16, 31634, {1, 3, 1, 3, 9, 23, 73, 247, 399, 775, 419, 3033, 865, 12595, 16345, 15079}}, {5653, 16, 31655, {1, 3, 1, 5, 1, 17, 33, 23, 419, 585, 673, 929, 6955, 10247, 12647, 29107}}, {5654, 16, 31681, {1, 3, 3, 13, 9, 33, 11, 13, 127, 529, 1219, 2401, 6459, 14745, 5123, 53023}}, {5655, 16, 31705, {1, 3, 5, 11, 23, 11, 5, 19, 281, 121, 1671, 2171, 4545, 10691, 24875, 28849}}, {5656, 16, 31706, {1, 3, 1, 3, 13, 25, 85, 131, 127, 977, 1599, 3319, 3107, 3185, 4879, 3455}}, {5657, 16, 31718, {1, 1, 5, 1, 3, 13, 77, 15, 133, 185, 1319, 727, 2181, 12175, 28017, 28023}}, {5658, 16, 31735, {1, 3, 7, 5, 29, 51, 113, 203, 331, 847, 1, 3445, 3669, 7711, 13647, 58651}}, {5659, 16, 31741, {1, 3, 1, 3, 31, 27, 35, 199, 491, 839, 1275, 3385, 4743, 821, 26259, 11345}}, {5660, 16, 31744, {1, 1, 7, 9, 21, 47, 9, 67, 119, 985, 127, 1987, 5451, 6403, 26183, 8349}}, {5661, 16, 31762, {1, 3, 5, 1, 19, 3, 91, 217, 301, 595, 1789, 735, 4993, 229, 18033, 59625}}, {5662, 16, 31774, {1, 3, 3, 3, 11, 25, 103, 211, 117, 9, 773, 1521, 2265, 8277, 23179, 22433}}, {5663, 16, 31864, {1, 1, 7, 9, 3, 27, 63, 255, 175, 699, 293, 2409, 3155, 285, 8663, 53503}}, {5664, 16, 31874, {1, 1, 5, 7, 27, 23, 63, 213, 323, 697, 1541, 3497, 2985, 12389, 11155, 26217}}, {5665, 16, 31900, {1, 3, 1, 3, 31, 7, 47, 207, 185, 873, 1063, 1055, 205, 12469, 23505, 56245}}, {5666, 16, 31910, {1, 3, 7, 13, 31, 17, 47, 95, 91, 483, 1997, 3273, 445, 2601, 15219, 10997}}, {5667, 16, 31928, {1, 3, 3, 5, 29, 45, 29, 83, 457, 823, 1395, 1411, 1879, 9409, 11609, 32001}}, {5668, 16, 31965, {1, 3, 5, 11, 21, 11, 43, 73, 159, 137, 29, 1957, 815, 5077, 16127, 42199}}, {5669, 16, 31976, {1, 3, 5, 13, 9, 59, 47, 215, 293, 807, 309, 1951, 2285, 9287, 1019, 49501}}, {5670, 16, 32016, {1, 1, 7, 13, 31, 7, 95, 189, 233, 363, 1039, 1675, 1715, 9049, 8537, 31051}}, {5671, 16, 32032, {1, 3, 7, 9, 23, 35, 125, 251, 107, 401, 1113, 3585, 6331, 2363, 27889, 28877}}, {5672, 16, 32037, {1, 1, 7, 13, 9, 1, 13, 69, 257, 369, 547, 1595, 1823, 9553, 25653, 31181}}, {5673, 16, 32062, {1, 1, 7, 11, 9, 43, 3, 93, 69, 1019, 1935, 3297, 47, 7101, 1037, 63473}}, {5674, 16, 32069, {1, 1, 7, 5, 21, 9, 97, 105, 405, 893, 1673, 3783, 2965, 7329, 4549, 25433}}, {5675, 16, 32115, {1, 1, 5, 13, 5, 17, 31, 123, 415, 173, 1333, 2245, 1557, 16011, 28321, 4039}}, {5676, 16, 32128, {1, 1, 5, 9, 15, 3, 27, 79, 511, 39, 945, 49, 3231, 9199, 21327, 11183}}, {5677, 16, 32171, {1, 3, 3, 9, 3, 15, 115, 141, 387, 341, 953, 399, 6109, 12037, 21079, 26745}}, {5678, 16, 32173, {1, 3, 3, 1, 5, 5, 31, 195, 477, 755, 687, 3811, 805, 679, 20687, 46299}}, {5679, 16, 32182, {1, 1, 7, 15, 1, 31, 67, 159, 205, 141, 1667, 3077, 451, 13161, 16211, 6887}}, {5680, 16, 32191, {1, 3, 3, 1, 7, 43, 87, 5, 49, 205, 231, 3957, 2947, 13199, 15743, 4681}}, {5681, 16, 32193, {1, 3, 3, 15, 25, 37, 95, 11, 439, 553, 59, 1241, 7407, 13467, 22403, 44441}}, {5682, 16, 32194, {1, 1, 1, 3, 21, 3, 127, 239, 491, 139, 1411, 3417, 4247, 6247, 13809, 31609}}, {5683, 16, 32229, {1, 1, 5, 1, 9, 13, 5, 155, 109, 593, 119, 4091, 1911, 8301, 4239, 50081}}, {5684, 16, 32230, {1, 3, 5, 13, 27, 3, 99, 225, 253, 169, 801, 3741, 1905, 12073, 31831, 17997}}, {5685, 16, 32248, {1, 3, 7, 15, 9, 23, 93, 171, 453, 983, 1657, 1133, 6381, 5229, 32303, 17439}}, {5686, 16, 32263, {1, 1, 7, 11, 7, 5, 125, 141, 63, 763, 1293, 1007, 4579, 1479, 11977, 59261}}, {5687, 16, 32264, {1, 3, 1, 7, 1, 15, 49, 41, 367, 639, 1933, 401, 2335, 2441, 13653, 55555}}, {5688, 16, 32269, {1, 3, 1, 7, 15, 23, 5, 213, 45, 721, 543, 2133, 4525, 9719, 28053, 54075}}, {5689, 16, 32298, {1, 3, 7, 3, 11, 7, 23, 35, 169, 829, 1957, 2423, 3583, 4951, 28957, 29753}}, {5690, 16, 32335, {1, 1, 3, 3, 1, 5, 19, 235, 175, 969, 229, 2335, 7215, 10195, 7487, 64191}}, {5691, 16, 32340, {1, 1, 7, 3, 27, 1, 73, 49, 445, 863, 69, 3555, 993, 9553, 31941, 29901}}, {5692, 16, 32356, {1, 3, 5, 11, 9, 25, 59, 177, 23, 997, 1041, 1135, 3879, 767, 2263, 51267}}, {5693, 16, 32374, {1, 1, 7, 3, 1, 63, 49, 51, 237, 569, 1293, 1143, 3125, 16315, 17009, 24821}}, {5694, 16, 32390, {1, 3, 3, 15, 11, 17, 121, 25, 349, 833, 557, 1975, 5405, 15189, 31243, 53541}}, {5695, 16, 32401, {1, 3, 7, 9, 11, 15, 39, 15, 75, 87, 55, 2069, 3291, 507, 16925, 57751}}, {5696, 16, 32414, {1, 1, 3, 15, 1, 21, 61, 139, 357, 931, 647, 947, 2291, 15557, 6739, 5881}}, {5697, 16, 32417, {1, 3, 1, 9, 1, 47, 73, 59, 115, 497, 733, 1777, 905, 16181, 4351, 7345}}, {5698, 16, 32442, {1, 3, 3, 7, 5, 21, 67, 113, 71, 743, 757, 1851, 7899, 10315, 15437, 61803}}, {5699, 16, 32450, {1, 3, 7, 1, 9, 23, 77, 131, 395, 767, 1229, 2629, 5731, 11907, 32217, 18473}}, {5700, 16, 32461, {1, 3, 5, 15, 1, 23, 123, 207, 291, 565, 1211, 501, 2111, 11381, 5171, 54841}}, {5701, 16, 32473, {1, 1, 1, 15, 21, 13, 3, 175, 405, 109, 1353, 2495, 7619, 14971, 28179, 34737}}, {5702, 16, 32479, {1, 3, 5, 3, 17, 25, 53, 71, 229, 729, 1953, 3119, 7747, 1551, 23417, 35563}}, {5703, 16, 32530, {1, 1, 7, 7, 11, 31, 81, 43, 149, 537, 1253, 2759, 431, 4813, 8375, 46329}}, {5704, 16, 32536, {1, 1, 1, 5, 11, 27, 61, 199, 239, 889, 723, 2353, 5663, 7385, 28165, 14675}}, {5705, 16, 32548, {1, 3, 1, 7, 3, 3, 83, 247, 247, 57, 579, 1163, 2615, 4051, 2809, 46413}}, {5706, 16, 32577, {1, 1, 3, 11, 13, 47, 11, 235, 475, 35, 843, 2329, 3519, 8899, 14533, 24889}}, {5707, 16, 32628, {1, 3, 1, 1, 7, 31, 15, 101, 327, 499, 471, 1001, 339, 11863, 24787, 47191}}, {5708, 16, 32642, {1, 1, 7, 1, 3, 55, 93, 43, 11, 65, 289, 1249, 5325, 13867, 29841, 34333}}, {5709, 16, 32665, {1, 3, 3, 1, 25, 61, 87, 113, 115, 265, 1007, 1129, 7633, 6109, 5733, 22649}}, {5710, 16, 32666, {1, 3, 1, 11, 31, 59, 127, 83, 33, 419, 1037, 3777, 6383, 2711, 2113, 17233}}, {5711, 16, 32668, {1, 1, 5, 13, 11, 17, 73, 41, 257, 223, 359, 3821, 4617, 1943, 11331, 40153}}, {5712, 16, 32696, {1, 1, 1, 1, 9, 25, 43, 179, 17, 1021, 1323, 761, 5861, 11547, 26017, 5165}}, {5713, 16, 32722, {1, 3, 5, 3, 29, 21, 53, 111, 213, 717, 1101, 3215, 3021, 16343, 23387, 33439}}, {5714, 16, 32757, {1, 3, 5, 13, 29, 11, 21, 89, 107, 111, 1121, 2785, 3493, 9873, 13, 40863}}, {5715, 16, 32758, {1, 1, 5, 13, 15, 15, 111, 219, 59, 43, 333, 3581, 1311, 2799, 23987, 21637}}, {5716, 17, 4, {1, 3, 1, 11, 21, 57, 115, 247, 499, 525, 1629, 3679, 2109, 6607, 27435, 1745, 71201}}, {5717, 17, 7, {1, 3, 3, 3, 31, 17, 113, 165, 189, 361, 103, 1775, 3001, 3865, 30591, 2873, 17129}}, {5718, 17, 16, {1, 1, 5, 5, 15, 47, 47, 85, 247, 471, 713, 3571, 2407, 9811, 8187, 32133, 8541}}, {5719, 17, 22, {1, 3, 3, 1, 15, 1, 59, 151, 469, 351, 671, 2925, 7207, 5061, 28691, 4363, 50767}}, {5720, 17, 25, {1, 1, 5, 7, 11, 35, 67, 45, 193, 3, 627, 3333, 6497, 12307, 28807, 13997, 108645}}, {5721, 17, 31, {1, 3, 1, 1, 17, 63, 125, 185, 485, 759, 717, 1993, 6707, 3993, 2181, 8173, 18057}}, {5722, 17, 32, {1, 1, 3, 13, 7, 15, 113, 207, 103, 191, 1895, 2595, 3873, 12021, 19259, 12553, 119119}}, {5723, 17, 42, {1, 3, 7, 1, 17, 11, 101, 209, 315, 9, 901, 2303, 7623, 7459, 26391, 45143, 5753}}, {5724, 17, 52, {1, 1, 5, 15, 1, 5, 71, 155, 167, 89, 145, 3483, 2385, 15205, 9193, 20637, 58473}}, {5725, 17, 61, {1, 1, 5, 7, 25, 55, 57, 51, 333, 299, 1721, 1667, 6513, 10191, 29405, 21923, 76593}}, {5726, 17, 70, {1, 1, 5, 1, 7, 37, 107, 91, 241, 137, 627, 2749, 5573, 11243, 26197, 4545, 105599}}, {5727, 17, 76, {1, 3, 1, 5, 25, 37, 73, 61, 57, 249, 1953, 1385, 6479, 3701, 10693, 617, 62535}}, {5728, 17, 81, {1, 1, 1, 15, 5, 63, 41, 151, 395, 681, 227, 3027, 8123, 15091, 15475, 35671, 21129}}, {5729, 17, 87, {1, 3, 5, 11, 29, 21, 15, 233, 103, 463, 1829, 2257, 1717, 2249, 9599, 5097, 55705}}, {5730, 17, 93, {1, 3, 5, 1, 29, 3, 35, 151, 193, 105, 1107, 827, 7169, 1843, 15225, 29025, 43165}}, {5731, 17, 98, {1, 1, 7, 15, 17, 51, 93, 199, 205, 41, 113, 1081, 1571, 11471, 11057, 16149, 66905}}, {5732, 17, 122, {1, 1, 3, 11, 5, 25, 107, 195, 51, 675, 1683, 3739, 1653, 611, 23249, 53157, 127785}}, {5733, 17, 133, {1, 1, 7, 5, 7, 3, 25, 145, 453, 735, 441, 77, 8171, 9281, 22749, 36973, 106237}}, {5734, 17, 134, {1, 1, 3, 13, 13, 5, 95, 33, 223, 369, 453, 2031, 3531, 6931, 8977, 54109, 115487}}, {5735, 17, 140, {1, 1, 7, 7, 1, 61, 33, 183, 245, 623, 529, 1831, 1867, 2845, 8311, 10143, 67897}}, {5736, 17, 146, {1, 3, 7, 11, 27, 23, 93, 9, 61, 451, 67, 1695, 4227, 2415, 19249, 44765, 24611}}, {5737, 17, 158, {1, 3, 3, 11, 29, 57, 65, 117, 349, 149, 363, 1095, 4989, 3071, 17519, 18079, 7277}}, {5738, 17, 171, {1, 3, 5, 9, 1, 7, 59, 87, 307, 111, 1291, 789, 7361, 6477, 11229, 36785, 33303}}, {5739, 17, 176, {1, 3, 5, 1, 19, 47, 53, 81, 127, 849, 1479, 1459, 1889, 15087, 22115, 20587, 121005}}, {5740, 17, 179, {1, 1, 7, 15, 31, 31, 71, 55, 253, 927, 277, 2087, 1313, 3721, 22729, 34709, 9821}}, {5741, 17, 182, {1, 3, 5, 13, 13, 63, 73, 41, 165, 315, 1907, 2005, 691, 725, 22685, 8673, 76011}}, {5742, 17, 191, {1, 1, 5, 9, 23, 61, 47, 167, 279, 683, 683, 1261, 4037, 15251, 9421, 45359, 38001}}, {5743, 17, 193, {1, 1, 7, 3, 17, 33, 69, 139, 235, 709, 1475, 2483, 7559, 8581, 23965, 31153, 5097}}, {5744, 17, 224, {1, 1, 7, 15, 23, 61, 43, 5, 433, 531, 761, 2749, 2881, 5225, 13491, 16479, 50203}}, {5745, 17, 227, {1, 1, 3, 9, 29, 7, 9, 23, 339, 315, 1723, 779, 2983, 6571, 16025, 63055, 111103}}, {5746, 17, 229, {1, 1, 7, 13, 23, 55, 71, 121, 297, 193, 41, 3165, 4419, 5853, 28127, 56151, 16597}}, {5747, 17, 236, {1, 1, 5, 7, 7, 23, 93, 11, 261, 297, 1769, 1239, 2579, 531, 4423, 7891, 21729}}, {5748, 17, 248, {1, 3, 5, 1, 13, 35, 83, 85, 125, 887, 161, 3311, 7261, 9557, 28975, 28643, 21479}}, {5749, 17, 262, {1, 3, 5, 3, 27, 5, 47, 175, 287, 867, 141, 3079, 7583, 4997, 18271, 24097, 96319}}, {5750, 17, 273, {1, 3, 5, 1, 21, 51, 47, 67, 211, 281, 1861, 1169, 6403, 4229, 3995, 9921, 41515}}, {5751, 17, 276, {1, 3, 3, 11, 23, 23, 81, 55, 441, 211, 169, 3197, 7213, 7205, 15, 11771, 129091}}, {5752, 17, 280, {1, 3, 7, 3, 23, 39, 23, 163, 253, 1005, 1775, 3393, 7659, 8065, 30021, 61065, 35171}}, {5753, 17, 283, {1, 3, 1, 1, 29, 29, 39, 143, 191, 711, 1077, 13, 4137, 15425, 11139, 1269, 71915}}, {5754, 17, 290, {1, 3, 3, 5, 11, 41, 101, 127, 301, 335, 45, 2065, 5835, 7801, 2639, 5735, 63445}}, {5755, 17, 309, {1, 3, 5, 9, 3, 39, 51, 53, 489, 663, 951, 3931, 3075, 753, 22179, 20573, 10775}}, {5756, 17, 316, {1, 3, 3, 15, 13, 31, 1, 237, 79, 587, 395, 591, 607, 13105, 21301, 26829, 112181}}, {5757, 17, 319, {1, 1, 7, 7, 5, 55, 31, 117, 247, 229, 247, 307, 3821, 6483, 31317, 22975, 40535}}, {5758, 17, 321, {1, 3, 7, 15, 15, 59, 101, 17, 437, 373, 1727, 471, 2783, 7825, 24555, 58765, 5097}}, {5759, 17, 328, {1, 1, 3, 9, 31, 27, 71, 147, 71, 871, 793, 2363, 3213, 13383, 29801, 53187, 70021}}, {5760, 17, 346, {1, 3, 1, 1, 19, 47, 121, 61, 303, 565, 1371, 3703, 2201, 6835, 26041, 56039, 80227}}, {5761, 17, 355, {1, 1, 5, 5, 3, 45, 91, 61, 257, 947, 1449, 4031, 4925, 8627, 11909, 9529, 3429}}, {5762, 17, 367, {1, 1, 1, 7, 9, 63, 69, 233, 141, 361, 1443, 2157, 2877, 643, 2779, 8109, 126911}}, {5763, 17, 369, {1, 1, 5, 1, 5, 3, 67, 157, 21, 1, 361, 35, 1475, 12877, 22169, 6653, 85005}}, {5764, 17, 372, {1, 1, 7, 9, 25, 1, 7, 175, 47, 963, 405, 3955, 3905, 8429, 8483, 62037, 11323}}, {5765, 17, 382, {1, 1, 5, 11, 29, 23, 77, 211, 319, 745, 1935, 2429, 1687, 2173, 1571, 19457, 117777}}, {5766, 17, 388, {1, 1, 7, 5, 15, 57, 121, 189, 303, 79, 527, 1801, 71, 9857, 14197, 59007, 75341}}, {5767, 17, 392, {1, 3, 3, 5, 25, 3, 19, 141, 155, 157, 287, 769, 5789, 8443, 31823, 1019, 79111}}, {5768, 17, 395, {1, 1, 5, 11, 27, 27, 117, 141, 355, 1023, 869, 995, 6311, 6573, 11721, 1565, 35517}}, {5769, 17, 397, {1, 1, 1, 9, 1, 33, 107, 51, 41, 889, 1191, 1055, 503, 14779, 6641, 58117, 74157}}, {5770, 17, 403, {1, 1, 7, 5, 13, 39, 39, 33, 293, 75, 963, 3379, 1847, 12371, 9005, 38107, 69753}}, {5771, 17, 409, {1, 1, 5, 5, 7, 37, 19, 241, 427, 635, 1711, 3835, 773, 10525, 17207, 1675, 127255}}, {5772, 17, 410, {1, 1, 3, 7, 17, 19, 11, 113, 191, 947, 1133, 3173, 213, 10125, 1373, 56797, 111011}}, {5773, 17, 425, {1, 3, 1, 1, 29, 45, 65, 237, 223, 695, 697, 3197, 6887, 8079, 22099, 12079, 54847}}, {5774, 17, 443, {1, 3, 3, 7, 5, 47, 19, 215, 341, 863, 1879, 571, 7113, 2465, 23407, 52555, 44375}}, {5775, 17, 472, {1, 3, 5, 11, 25, 31, 109, 73, 429, 553, 1905, 1753, 6733, 4433, 13785, 32041, 27115}}, {5776, 17, 475, {1, 1, 1, 3, 27, 5, 97, 47, 343, 977, 1241, 721, 3355, 3559, 28349, 56389, 63103}}, {5777, 17, 481, {1, 3, 3, 9, 21, 53, 57, 211, 73, 155, 1855, 715, 3179, 5963, 10061, 35141, 63131}}, {5778, 17, 488, {1, 3, 1, 15, 21, 25, 51, 73, 31, 25, 1385, 637, 6585, 49, 2105, 6829, 9353}}, {5779, 17, 493, {1, 1, 7, 5, 11, 55, 31, 69, 145, 637, 1131, 2175, 3547, 13031, 2131, 12361, 74737}}, {5780, 17, 501, {1, 3, 3, 5, 31, 7, 119, 119, 309, 925, 895, 3813, 1131, 4765, 17865, 48707, 113577}}, {5781, 17, 515, {1, 3, 3, 9, 13, 33, 127, 177, 323, 727, 1881, 775, 7329, 11881, 28309, 987, 116093}}, {5782, 17, 522, {1, 1, 3, 5, 31, 55, 39, 41, 511, 157, 1655, 2991, 3633, 8521, 27049, 18771, 54015}}, {5783, 17, 524, {1, 3, 5, 13, 11, 45, 113, 185, 375, 661, 1331, 4013, 5521, 1037, 23365, 30239, 76957}}, {5784, 17, 527, {1, 3, 3, 7, 19, 7, 23, 17, 435, 913, 1985, 353, 6049, 7549, 3371, 60867, 41099}}, {5785, 17, 535, {1, 3, 3, 15, 17, 9, 53, 127, 149, 849, 1181, 2237, 1345, 539, 19715, 26277, 125445}}, {5786, 17, 542, {1, 1, 1, 3, 1, 9, 67, 79, 79, 795, 1793, 3167, 5917, 5323, 22043, 22007, 3917}}, {5787, 17, 545, {1, 3, 5, 9, 15, 19, 59, 37, 141, 145, 413, 1095, 7709, 669, 27061, 40171, 101499}}, {5788, 17, 555, {1, 3, 1, 1, 9, 49, 109, 7, 119, 861, 875, 1049, 4125, 6113, 15699, 6105, 48799}}, {5789, 17, 558, {1, 1, 3, 9, 11, 29, 43, 175, 371, 357, 1181, 3933, 43, 4559, 10333, 23603, 83095}}, {5790, 17, 560, {1, 3, 3, 9, 9, 7, 57, 61, 409, 143, 591, 761, 4107, 8117, 1051, 4471, 91771}}, {5791, 17, 563, {1, 1, 3, 11, 3, 53, 119, 21, 213, 219, 51, 3491, 7143, 937, 24693, 3211, 99463}}, {5792, 17, 570, {1, 1, 3, 3, 1, 47, 53, 153, 211, 523, 1637, 3351, 3753, 12489, 31825, 27613, 96431}}, {5793, 17, 578, {1, 1, 5, 15, 23, 57, 81, 231, 147, 9, 1043, 3157, 1463, 4835, 22435, 57407, 59615}}, {5794, 17, 583, {1, 3, 3, 13, 15, 63, 111, 5, 449, 957, 1175, 2887, 7741, 8975, 28775, 4067, 69283}}, {5795, 17, 590, {1, 3, 1, 1, 5, 61, 109, 211, 349, 179, 951, 153, 3147, 7555, 27037, 59829, 16077}}, {5796, 17, 597, {1, 3, 3, 7, 15, 33, 53, 61, 309, 991, 227, 3437, 3983, 14559, 13065, 46387, 49105}}, {5797, 17, 604, {1, 3, 5, 3, 25, 23, 97, 139, 315, 601, 1179, 1083, 6799, 1813, 15511, 60433, 65641}}, {5798, 17, 608, {1, 1, 7, 1, 11, 43, 87, 87, 173, 161, 91, 3011, 1869, 2313, 13691, 3509, 39433}}, {5799, 17, 614, {1, 3, 5, 7, 15, 5, 39, 251, 269, 819, 815, 2283, 5635, 6953, 27017, 65143, 45281}}, {5800, 17, 635, {1, 3, 7, 9, 1, 37, 9, 57, 467, 37, 1743, 4031, 3751, 8105, 23789, 46847, 21911}}, {5801, 17, 637, {1, 1, 7, 1, 23, 47, 63, 99, 59, 951, 1837, 2829, 161, 857, 4045, 9945, 53487}}, {5802, 17, 653, {1, 3, 7, 7, 11, 47, 43, 99, 279, 945, 1189, 2091, 4597, 183, 15527, 7151, 112403}}, {5803, 17, 654, {1, 3, 3, 15, 9, 53, 63, 135, 119, 95, 131, 2461, 157, 10631, 20847, 51699, 58865}}, {5804, 17, 659, {1, 1, 3, 1, 25, 3, 115, 29, 303, 361, 1529, 3993, 5899, 11501, 4463, 47121, 75333}}, {5805, 17, 666, {1, 3, 1, 15, 9, 39, 31, 199, 305, 279, 15, 611, 561, 6593, 3189, 1863, 61875}}, {5806, 17, 671, {1, 3, 5, 15, 5, 49, 87, 17, 87, 5, 1179, 1351, 7647, 7529, 15901, 30351, 31959}}, {5807, 17, 689, {1, 3, 3, 9, 31, 57, 127, 239, 349, 773, 547, 2649, 1309, 8071, 10741, 57645, 14423}}, {5808, 17, 690, {1, 1, 5, 9, 5, 15, 59, 185, 315, 411, 1425, 3905, 853, 12393, 21, 15195, 114291}}, {5809, 17, 695, {1, 3, 1, 5, 29, 47, 19, 203, 319, 673, 1169, 2413, 5295, 6251, 19883, 2725, 28937}}, {5810, 17, 713, {1, 3, 1, 5, 21, 55, 19, 185, 103, 827, 117, 341, 3315, 5625, 345, 63845, 49081}}, {5811, 17, 722, {1, 1, 7, 9, 27, 51, 105, 15, 243, 735, 1221, 1641, 293, 14423, 5363, 60873, 66223}}, {5812, 17, 733, {1, 1, 5, 1, 19, 5, 109, 131, 131, 67, 231, 2907, 4389, 5079, 20503, 59045, 33625}}, {5813, 17, 758, {1, 3, 1, 5, 5, 15, 79, 67, 287, 225, 519, 1543, 2389, 671, 7767, 62625, 61639}}, {5814, 17, 770, {1, 1, 1, 9, 25, 35, 83, 15, 291, 207, 1757, 3691, 5669, 11255, 27939, 57813, 46251}}, {5815, 17, 782, {1, 3, 1, 1, 29, 3, 83, 109, 323, 179, 1855, 3205, 7665, 16201, 13863, 16347, 98977}}, {5816, 17, 784, {1, 3, 1, 13, 17, 1, 101, 183, 153, 985, 125, 999, 855, 15897, 19491, 8953, 23277}}, {5817, 17, 793, {1, 1, 7, 11, 9, 33, 45, 229, 411, 155, 537, 3037, 1785, 11719, 8589, 16617, 47339}}, {5818, 17, 803, {1, 1, 5, 5, 9, 11, 7, 163, 305, 621, 1647, 2609, 7901, 14421, 23447, 1205, 52681}}, {5819, 17, 805, {1, 3, 3, 1, 7, 29, 39, 227, 419, 561, 129, 3299, 3123, 4243, 18689, 12335, 71783}}, {5820, 17, 812, {1, 3, 1, 9, 11, 61, 65, 207, 123, 763, 485, 1943, 3617, 415, 22397, 58597, 128017}}, {5821, 17, 838, {1, 1, 5, 13, 25, 43, 115, 73, 269, 137, 1765, 705, 1705, 16137, 22751, 60021, 4333}}, {5822, 17, 849, {1, 1, 5, 13, 3, 57, 9, 141, 75, 695, 597, 3435, 1085, 4905, 19625, 16061, 12111}}, {5823, 17, 875, {1, 1, 5, 9, 29, 13, 119, 251, 353, 421, 1955, 3503, 2605, 2587, 12503, 46419, 128815}}, {5824, 17, 877, {1, 3, 5, 7, 7, 29, 67, 25, 37, 327, 1607, 1899, 1691, 5801, 17441, 9755, 24993}}, {5825, 17, 880, {1, 1, 3, 11, 17, 29, 121, 201, 371, 597, 213, 2361, 6615, 169, 24801, 56175, 129241}}, {5826, 17, 892, {1, 3, 5, 1, 31, 63, 85, 77, 151, 599, 103, 677, 4431, 12897, 6373, 40349, 100819}}, {5827, 17, 895, {1, 3, 5, 9, 25, 9, 119, 219, 379, 939, 1907, 945, 5819, 7433, 32519, 56493, 50441}}, {5828, 17, 899, {1, 1, 3, 9, 13, 1, 63, 189, 135, 839, 1821, 2247, 2547, 965, 6847, 63335, 32921}}, {5829, 17, 919, {1, 3, 5, 13, 21, 25, 111, 37, 319, 469, 1999, 1637, 8167, 2641, 24615, 63713, 115923}}, {5830, 17, 920, {1, 3, 5, 9, 9, 27, 1, 63, 275, 223, 1675, 3833, 7377, 9755, 6279, 37161, 108805}}, {5831, 17, 932, {1, 3, 3, 13, 29, 23, 21, 73, 401, 863, 701, 2527, 4557, 5549, 22493, 6651, 39167}}, {5832, 17, 935, {1, 1, 3, 15, 25, 21, 97, 25, 83, 925, 2029, 3789, 3241, 7617, 13699, 31123, 124619}}, {5833, 17, 936, {1, 3, 7, 5, 23, 7, 95, 227, 123, 215, 359, 2099, 4505, 8477, 32665, 18211, 99679}}, {5834, 17, 941, {1, 3, 1, 9, 11, 57, 75, 17, 105, 175, 831, 1033, 5425, 8419, 16163, 23901, 33889}}, {5835, 17, 950, {1, 1, 7, 1, 17, 49, 71, 23, 129, 413, 333, 2547, 4627, 14961, 16745, 53649, 73059}}, {5836, 17, 961, {1, 3, 5, 3, 13, 33, 121, 147, 443, 187, 1949, 319, 8141, 14359, 11203, 53569, 70415}}, {5837, 17, 962, {1, 3, 1, 11, 15, 1, 23, 29, 509, 985, 1217, 3755, 385, 3697, 24631, 37619, 62435}}, {5838, 17, 971, {1, 3, 3, 3, 17, 11, 107, 37, 227, 913, 259, 2799, 3249, 2347, 9703, 52741, 101187}}, {5839, 17, 982, {1, 1, 5, 13, 25, 25, 47, 77, 405, 415, 1947, 1675, 5079, 1333, 10059, 32033, 88975}}, {5840, 17, 986, {1, 3, 5, 9, 27, 7, 19, 241, 445, 205, 333, 285, 7997, 6339, 29643, 10229, 29965}}, {5841, 17, 1012, {1, 3, 5, 11, 17, 9, 91, 223, 173, 1013, 779, 3967, 781, 5471, 4309, 24795, 99203}}, {5842, 17, 1021, {1, 1, 1, 3, 19, 53, 7, 159, 351, 515, 223, 3375, 1, 4985, 16729, 43333, 85917}}, {5843, 17, 1024, {1, 3, 3, 1, 19, 35, 95, 69, 19, 157, 1177, 579, 7109, 3499, 3219, 26641, 49491}}, {5844, 17, 1029, {1, 3, 3, 5, 25, 21, 125, 5, 39, 857, 615, 2925, 2005, 5503, 25523, 36711, 30939}}, {5845, 17, 1030, {1, 3, 1, 5, 11, 33, 29, 5, 425, 125, 939, 1641, 321, 1023, 12551, 4587, 116617}}, {5846, 17, 1051, {1, 3, 3, 13, 9, 59, 93, 137, 103, 517, 1555, 13, 7965, 13629, 14339, 37425, 65891}}, {5847, 17, 1054, {1, 3, 7, 1, 31, 31, 87, 237, 365, 951, 267, 2019, 5085, 6133, 29371, 50319, 94313}}, {5848, 17, 1064, {1, 3, 5, 7, 17, 19, 23, 225, 501, 189, 1291, 603, 6873, 8633, 11425, 30565, 26355}}, {5849, 17, 1067, {1, 3, 7, 11, 23, 17, 91, 111, 415, 225, 1287, 2081, 4683, 12069, 3627, 32281, 17995}}, {5850, 17, 1082, {1, 1, 5, 15, 25, 59, 75, 203, 179, 405, 1711, 3147, 7483, 5583, 3729, 11765, 61019}}, {5851, 17, 1096, {1, 3, 3, 9, 3, 43, 65, 7, 269, 33, 829, 1789, 967, 13119, 26329, 16937, 18533}}, {5852, 17, 1116, {1, 1, 3, 15, 11, 39, 73, 11, 31, 143, 1913, 1227, 1363, 11831, 28687, 50489, 106373}}, {5853, 17, 1119, {1, 1, 3, 3, 25, 19, 15, 11, 349, 1011, 421, 3193, 3665, 6149, 20729, 6997, 51437}}, {5854, 17, 1129, {1, 3, 5, 9, 13, 63, 73, 55, 417, 223, 1753, 2913, 4809, 3947, 10769, 5751, 93867}}, {5855, 17, 1130, {1, 3, 7, 13, 31, 39, 39, 133, 483, 839, 1137, 3303, 7285, 4309, 24079, 60529, 103337}}, {5856, 17, 1132, {1, 1, 3, 7, 1, 55, 3, 253, 435, 589, 1949, 1461, 513, 381, 29455, 4263, 16831}}, {5857, 17, 1137, {1, 1, 1, 15, 25, 19, 77, 101, 299, 187, 1021, 1533, 8021, 4165, 2277, 18927, 110439}}, {5858, 17, 1147, {1, 1, 1, 11, 9, 35, 71, 159, 409, 527, 15, 4073, 5749, 8563, 2503, 53015, 111581}}, {5859, 17, 1150, {1, 1, 7, 5, 21, 47, 113, 23, 477, 559, 543, 409, 4701, 11479, 30761, 8373, 87777}}, {5860, 17, 1154, {1, 3, 5, 13, 9, 27, 25, 137, 81, 37, 799, 857, 3539, 4471, 15753, 59015, 48589}}, {5861, 17, 1165, {1, 1, 3, 7, 11, 57, 103, 83, 209, 71, 193, 3251, 4839, 13959, 32009, 6471, 23631}}, {5862, 17, 1166, {1, 1, 7, 11, 25, 33, 85, 31, 371, 253, 1667, 1627, 6159, 10039, 15177, 52121, 39475}}, {5863, 17, 1174, {1, 1, 5, 9, 13, 55, 37, 13, 95, 113, 1895, 1525, 1907, 6361, 5863, 27767, 108143}}, {5864, 17, 1177, {1, 1, 3, 13, 21, 5, 53, 39, 485, 171, 1355, 2117, 3127, 6467, 31697, 45343, 111477}}, {5865, 17, 1184, {1, 1, 7, 15, 13, 57, 11, 231, 329, 703, 1823, 2983, 215, 2835, 19719, 56637, 126169}}, {5866, 17, 1194, {1, 3, 5, 15, 13, 51, 13, 173, 301, 867, 127, 2391, 2795, 4945, 13293, 49947, 10765}}, {5867, 17, 1204, {1, 3, 3, 9, 23, 5, 29, 165, 467, 599, 1181, 3213, 4069, 5473, 8937, 51495, 42611}}, {5868, 17, 1208, {1, 1, 7, 15, 5, 5, 31, 125, 397, 519, 1465, 115, 7877, 7025, 14213, 50343, 85827}}, {5869, 17, 1213, {1, 3, 7, 3, 25, 59, 95, 103, 101, 347, 95, 3, 1251, 15109, 12615, 7511, 56789}}, {5870, 17, 1219, {1, 3, 5, 9, 13, 59, 71, 19, 107, 73, 345, 3177, 6519, 2407, 18033, 31075, 113185}}, {5871, 17, 1233, {1, 1, 1, 3, 27, 37, 5, 219, 169, 149, 355, 549, 1811, 11351, 22627, 53931, 88619}}, {5872, 17, 1264, {1, 3, 1, 3, 27, 7, 9, 97, 399, 947, 1393, 3917, 5439, 15845, 19465, 30123, 69099}}, {5873, 17, 1267, {1, 1, 7, 9, 13, 25, 107, 45, 111, 409, 967, 3359, 2499, 1703, 20763, 45187, 16265}}, {5874, 17, 1281, {1, 1, 1, 13, 5, 49, 43, 249, 49, 947, 597, 1773, 2387, 2693, 15297, 57969, 53385}}, {5875, 17, 1312, {1, 1, 7, 15, 27, 25, 27, 121, 421, 781, 143, 817, 7335, 14211, 139, 55601, 56671}}, {5876, 17, 1321, {1, 3, 1, 5, 29, 47, 77, 23, 413, 931, 785, 1221, 769, 13131, 26955, 56441, 85745}}, {5877, 17, 1330, {1, 1, 1, 11, 27, 3, 53, 21, 467, 43, 1533, 1053, 691, 6369, 8325, 51087, 71261}}, {5878, 17, 1332, {1, 1, 3, 15, 7, 9, 43, 225, 293, 143, 1049, 3095, 6119, 3165, 9913, 26023, 62657}}, {5879, 17, 1335, {1, 3, 7, 9, 11, 39, 99, 193, 217, 941, 259, 3811, 6757, 281, 10377, 46961, 48949}}, {5880, 17, 1341, {1, 1, 1, 1, 25, 1, 99, 61, 495, 861, 2013, 487, 2821, 12921, 30111, 27213, 97363}}, {5881, 17, 1356, {1, 1, 5, 9, 23, 33, 103, 237, 161, 721, 2021, 159, 995, 475, 20615, 30961, 31767}}, {5882, 17, 1371, {1, 3, 1, 1, 5, 59, 63, 139, 451, 789, 1285, 655, 5501, 273, 21061, 35937, 20811}}, {5883, 17, 1377, {1, 3, 3, 9, 9, 15, 121, 233, 287, 929, 1605, 1243, 417, 1695, 29903, 28699, 85981}}, {5884, 17, 1380, {1, 3, 3, 5, 7, 25, 27, 253, 469, 255, 285, 2467, 4897, 4079, 29759, 50351, 76451}}, {5885, 17, 1384, {1, 1, 3, 3, 5, 33, 29, 209, 291, 967, 1429, 1953, 5957, 14065, 8875, 32675, 4629}}, {5886, 17, 1395, {1, 3, 5, 9, 7, 31, 97, 21, 177, 485, 1115, 4051, 6683, 7761, 30181, 37531, 51789}}, {5887, 17, 1397, {1, 1, 7, 3, 25, 51, 23, 183, 57, 699, 1245, 2519, 2783, 4457, 6381, 43199, 40071}}, {5888, 17, 1411, {1, 3, 5, 5, 19, 55, 45, 101, 299, 461, 1009, 319, 7335, 7769, 5479, 61113, 7937}}, {5889, 17, 1414, {1, 1, 7, 3, 29, 21, 55, 55, 437, 771, 363, 683, 4299, 15569, 13813, 40663, 86285}}, {5890, 17, 1426, {1, 1, 1, 13, 31, 35, 93, 175, 451, 387, 1145, 3367, 3833, 13495, 11019, 48925, 85721}}, {5891, 17, 1432, {1, 1, 7, 15, 31, 21, 55, 205, 117, 895, 535, 2627, 1473, 10779, 24493, 42999, 130805}}, {5892, 17, 1435, {1, 1, 3, 13, 27, 11, 45, 37, 193, 237, 1505, 1405, 3613, 9565, 3037, 53643, 85211}}, {5893, 17, 1437, {1, 1, 3, 13, 9, 17, 19, 27, 117, 503, 65, 1033, 7891, 4005, 9229, 20999, 96601}}, {5894, 17, 1442, {1, 3, 3, 5, 17, 3, 71, 79, 145, 985, 935, 3997, 6239, 12511, 13895, 65031, 126383}}, {5895, 17, 1454, {1, 1, 5, 1, 23, 55, 3, 105, 71, 243, 1479, 111, 7103, 10753, 26193, 35833, 14583}}, {5896, 17, 1468, {1, 3, 3, 3, 15, 3, 73, 125, 267, 29, 1775, 1437, 8091, 10891, 25731, 54381, 12821}}, {5897, 17, 1473, {1, 1, 1, 3, 23, 15, 67, 123, 401, 347, 807, 1097, 31, 11209, 8727, 58149, 129099}}, {5898, 17, 1488, {1, 3, 3, 7, 7, 61, 49, 129, 423, 535, 135, 3587, 233, 4509, 23209, 59203, 41297}}, {5899, 17, 1491, {1, 3, 1, 7, 5, 29, 65, 31, 335, 855, 835, 1421, 3081, 14219, 16321, 48269, 41603}}, {5900, 17, 1509, {1, 1, 1, 13, 3, 21, 5, 117, 163, 603, 1519, 3789, 7873, 10981, 4615, 9165, 83929}}, {5901, 17, 1524, {1, 3, 5, 11, 15, 21, 75, 151, 193, 757, 647, 1603, 333, 10515, 22771, 55459, 3315}}, {5902, 17, 1533, {1, 1, 7, 1, 27, 3, 63, 197, 271, 175, 1599, 2119, 1031, 8671, 10893, 35641, 94535}}, {5903, 17, 1555, {1, 1, 1, 15, 1, 59, 93, 17, 5, 213, 1663, 941, 435, 8107, 1963, 34951, 106181}}, {5904, 17, 1567, {1, 1, 5, 11, 13, 35, 111, 97, 267, 737, 2023, 1301, 7407, 11249, 31785, 31933, 20673}}, {5905, 17, 1571, {1, 3, 3, 15, 5, 15, 29, 63, 189, 687, 27, 2005, 7129, 11377, 23175, 42389, 30933}}, {5906, 17, 1586, {1, 1, 1, 9, 13, 63, 7, 155, 67, 291, 1419, 755, 2623, 4749, 22971, 7545, 55711}}, {5907, 17, 1592, {1, 3, 7, 7, 23, 29, 83, 151, 213, 201, 157, 3051, 6553, 6401, 15931, 47941, 22869}}, {5908, 17, 1595, {1, 3, 5, 5, 7, 45, 33, 155, 225, 25, 49, 2419, 4241, 6835, 11401, 50725, 118343}}, {5909, 17, 1600, {1, 1, 3, 13, 31, 27, 37, 41, 19, 375, 1771, 1789, 2313, 2577, 12615, 22715, 22179}}, {5910, 17, 1606, {1, 3, 1, 11, 17, 53, 55, 229, 235, 837, 143, 3583, 2789, 5471, 6515, 44565, 8619}}, {5911, 17, 1627, {1, 1, 5, 15, 5, 17, 23, 95, 217, 551, 353, 27, 3973, 2547, 27903, 50611, 72277}}, {5912, 17, 1648, {1, 1, 3, 7, 5, 13, 41, 111, 157, 215, 1327, 3073, 1871, 11875, 24239, 40527, 97637}}, {5913, 17, 1651, {1, 3, 1, 1, 29, 63, 111, 187, 369, 395, 1197, 3229, 4353, 14715, 29671, 50503, 89321}}, {5914, 17, 1654, {1, 3, 1, 1, 5, 63, 11, 39, 171, 209, 463, 3421, 3451, 4453, 14397, 2219, 98261}}, {5915, 17, 1667, {1, 3, 3, 5, 1, 1, 13, 101, 67, 815, 1521, 1543, 7221, 7337, 10765, 30029, 47881}}, {5916, 17, 1669, {1, 1, 5, 7, 9, 9, 33, 197, 439, 893, 961, 11, 4319, 14265, 24839, 33581, 35531}}, {5917, 17, 1674, {1, 3, 3, 15, 29, 35, 43, 229, 313, 369, 955, 1069, 2939, 12623, 20373, 1533, 9105}}, {5918, 17, 1687, {1, 3, 1, 7, 21, 7, 127, 243, 103, 353, 859, 3789, 4369, 12063, 22369, 14531, 94289}}, {5919, 17, 1698, {1, 3, 5, 15, 1, 27, 65, 127, 229, 99, 627, 2693, 7173, 7305, 29971, 7097, 10113}}, {5920, 17, 1710, {1, 1, 5, 15, 3, 47, 61, 29, 155, 725, 1727, 2667, 7003, 16277, 21983, 21365, 129365}}, {5921, 17, 1717, {1, 1, 5, 7, 27, 61, 115, 133, 137, 661, 1201, 2151, 367, 3567, 12885, 62143, 53955}}, {5922, 17, 1722, {1, 1, 1, 11, 9, 41, 113, 103, 469, 687, 1541, 3679, 6833, 10493, 32747, 39909, 121445}}, {5923, 17, 1735, {1, 1, 7, 5, 5, 5, 91, 91, 5, 405, 529, 3999, 6783, 2387, 16621, 12919, 8659}}, {5924, 17, 1741, {1, 1, 7, 13, 21, 47, 125, 155, 83, 913, 1833, 4027, 6657, 7031, 31231, 58201, 88943}}, {5925, 17, 1749, {1, 3, 7, 3, 17, 55, 25, 29, 181, 205, 1173, 1081, 6475, 5037, 18461, 22487, 114131}}, {5926, 17, 1750, {1, 1, 7, 7, 25, 63, 101, 103, 171, 191, 1863, 3441, 2515, 14179, 30123, 19145, 31669}}, {5927, 17, 1769, {1, 3, 7, 11, 29, 49, 73, 163, 415, 821, 1809, 723, 7049, 14565, 4829, 19395, 61131}}, {5928, 17, 1775, {1, 1, 7, 9, 5, 25, 103, 167, 381, 757, 813, 471, 3021, 6619, 20929, 38133, 129505}}, {5929, 17, 1777, {1, 1, 5, 13, 25, 61, 59, 199, 257, 999, 169, 3289, 7181, 2049, 2185, 39045, 102703}}, {5930, 17, 1778, {1, 1, 3, 1, 21, 1, 111, 125, 289, 33, 701, 3491, 5569, 8055, 23149, 26793, 102563}}, {5931, 17, 1792, {1, 1, 7, 3, 25, 15, 105, 235, 307, 201, 1947, 699, 2519, 10615, 29345, 17061, 112949}}, {5932, 17, 1797, {1, 3, 3, 15, 19, 1, 93, 173, 399, 13, 269, 1189, 523, 5145, 32731, 54087, 94123}}, {5933, 17, 1802, {1, 3, 1, 15, 9, 41, 59, 79, 217, 833, 1993, 2429, 3599, 6919, 30911, 12615, 67947}}, {5934, 17, 1822, {1, 3, 3, 13, 31, 9, 95, 37, 343, 955, 1363, 3851, 4091, 13165, 15241, 14853, 35747}}, {5935, 17, 1825, {1, 1, 3, 5, 27, 39, 37, 217, 385, 473, 1997, 2247, 7353, 1503, 9003, 15055, 27289}}, {5936, 17, 1831, {1, 3, 7, 11, 1, 13, 21, 243, 375, 91, 1295, 1661, 203, 15251, 15355, 16065, 24183}}, {5937, 17, 1838, {1, 3, 1, 13, 11, 45, 85, 5, 275, 741, 1395, 4011, 7987, 16087, 24113, 50555, 128147}}, {5938, 17, 1852, {1, 1, 1, 7, 3, 11, 13, 189, 55, 151, 395, 657, 807, 11973, 26297, 13043, 109641}}, {5939, 17, 1855, {1, 1, 7, 13, 31, 19, 33, 235, 491, 647, 1115, 2299, 6381, 7525, 2237, 36197, 126457}}, {5940, 17, 1860, {1, 3, 5, 1, 21, 15, 53, 231, 77, 347, 969, 141, 4501, 9429, 1815, 50887, 74581}}, {5941, 17, 1867, {1, 1, 1, 9, 29, 43, 47, 103, 327, 131, 927, 441, 7517, 7277, 21065, 409, 50351}}, {5942, 17, 1869, {1, 1, 5, 1, 11, 13, 103, 157, 239, 69, 1347, 477, 5017, 9723, 28133, 65135, 12359}}, {5943, 17, 1875, {1, 1, 1, 13, 17, 63, 117, 189, 323, 565, 927, 1727, 5337, 13243, 5739, 31241, 14209}}, {5944, 17, 1882, {1, 1, 3, 9, 29, 9, 103, 61, 467, 217, 1367, 2405, 5355, 5743, 31469, 30149, 98775}}, {5945, 17, 1903, {1, 1, 1, 15, 23, 23, 17, 229, 103, 583, 179, 115, 7081, 9437, 32623, 62639, 72391}}, {5946, 17, 1908, {1, 1, 5, 11, 11, 39, 97, 209, 115, 107, 593, 2347, 1445, 6179, 32011, 8435, 65847}}, {5947, 17, 1917, {1, 3, 7, 3, 29, 27, 55, 111, 27, 731, 995, 1871, 5017, 1485, 11313, 2559, 6561}}, {5948, 17, 1927, {1, 3, 1, 3, 27, 9, 103, 247, 83, 197, 517, 1629, 2189, 7255, 183, 35111, 15077}}, {5949, 17, 1941, {1, 3, 7, 5, 31, 37, 87, 223, 343, 331, 1361, 3371, 2007, 13235, 10897, 63839, 109837}}, {5950, 17, 1945, {1, 1, 7, 11, 17, 5, 41, 197, 489, 625, 1595, 2663, 5941, 14029, 30999, 16781, 116001}}, {5951, 17, 1948, {1, 3, 3, 7, 19, 19, 61, 175, 125, 609, 1391, 147, 3001, 4189, 10133, 24031, 46219}}, {5952, 17, 1962, {1, 1, 3, 13, 13, 57, 117, 181, 299, 939, 583, 3151, 829, 6561, 30449, 12211, 107879}}, {5953, 17, 1975, {1, 1, 5, 11, 23, 45, 87, 115, 259, 613, 1001, 171, 57, 13789, 22173, 56837, 26263}}, {5954, 17, 1976, {1, 1, 3, 3, 7, 43, 45, 131, 87, 251, 1411, 2737, 2739, 4595, 12561, 12043, 82885}}, {5955, 17, 1987, {1, 3, 3, 7, 19, 39, 87, 223, 461, 37, 283, 3937, 6193, 10887, 11509, 41131, 38359}}, {5956, 17, 1993, {1, 3, 1, 11, 11, 37, 25, 133, 105, 1013, 925, 3301, 239, 16295, 4831, 8649, 125767}}, {5957, 17, 2004, {1, 3, 3, 11, 25, 11, 41, 155, 1, 717, 1587, 635, 279, 1803, 14817, 28669, 88835}}, {5958, 17, 2020, {1, 3, 3, 11, 29, 17, 39, 51, 13, 871, 1197, 2561, 6671, 8465, 22709, 15933, 15923}}, {5959, 17, 2029, {1, 3, 7, 1, 13, 17, 57, 43, 267, 261, 901, 241, 3767, 15053, 11017, 36321, 72497}}, {5960, 17, 2030, {1, 3, 1, 15, 23, 13, 17, 63, 171, 919, 1387, 2673, 7605, 8523, 14807, 21187, 56057}}, {5961, 17, 2038, {1, 3, 7, 15, 23, 41, 85, 95, 53, 629, 1877, 3167, 2411, 9619, 24621, 31213, 30069}}, {5962, 17, 2041, {1, 1, 5, 3, 3, 25, 99, 39, 321, 549, 599, 1279, 2401, 2335, 8227, 59429, 94549}}, {5963, 17, 2048, {1, 3, 3, 11, 9, 21, 29, 55, 477, 19, 1275, 29, 2253, 11421, 30401, 57059, 93219}}, {5964, 17, 2054, {1, 1, 7, 1, 27, 13, 117, 249, 463, 769, 281, 515, 7467, 11507, 1621, 39765, 31109}}, {5965, 17, 2057, {1, 3, 5, 7, 19, 7, 77, 107, 23, 895, 1013, 2701, 3805, 7327, 27247, 6119, 102395}}, {5966, 17, 2058, {1, 1, 3, 13, 21, 49, 99, 15, 163, 641, 1703, 3061, 163, 4265, 32571, 13957, 75005}}, {5967, 17, 2068, {1, 1, 5, 11, 27, 17, 87, 169, 427, 959, 361, 1023, 5727, 16279, 1099, 39081, 67215}}, {5968, 17, 2072, {1, 3, 3, 9, 23, 13, 1, 91, 173, 325, 1881, 1385, 8023, 935, 9221, 19673, 36949}}, {5969, 17, 2075, {1, 3, 1, 7, 7, 25, 119, 189, 107, 249, 811, 973, 6499, 101, 11281, 55227, 32361}}, {5970, 17, 2077, {1, 1, 5, 13, 19, 37, 117, 95, 463, 587, 1419, 445, 4019, 7257, 29757, 50773, 52247}}, {5971, 17, 2082, {1, 1, 1, 1, 17, 57, 81, 57, 43, 789, 1035, 625, 1707, 9683, 3681, 12411, 110623}}, {5972, 17, 2084, {1, 1, 7, 5, 7, 57, 49, 91, 459, 513, 1869, 3377, 139, 10037, 24091, 54247, 41279}}, {5973, 17, 2087, {1, 3, 3, 9, 9, 33, 29, 51, 355, 415, 1907, 809, 6543, 349, 18507, 12919, 41667}}, {5974, 17, 2101, {1, 1, 5, 11, 3, 17, 73, 201, 121, 909, 1623, 799, 3271, 9051, 5717, 15169, 127861}}, {5975, 17, 2111, {1, 1, 7, 7, 23, 31, 1, 155, 475, 87, 2001, 2459, 1285, 5931, 6803, 56757, 71671}}, {5976, 17, 2113, {1, 1, 5, 13, 5, 1, 21, 109, 263, 841, 723, 1539, 7529, 433, 23721, 33195, 57001}}, {5977, 17, 2119, {1, 3, 3, 13, 29, 55, 105, 231, 405, 265, 671, 351, 4693, 9033, 21963, 52073, 125131}}, {5978, 17, 2147, {1, 3, 1, 13, 25, 51, 55, 227, 245, 983, 251, 2553, 2017, 1381, 31461, 3953, 75775}}, {5979, 17, 2154, {1, 1, 1, 11, 31, 11, 91, 91, 287, 749, 1019, 4055, 3237, 6965, 14765, 1663, 82987}}, {5980, 17, 2161, {1, 1, 7, 3, 11, 15, 67, 161, 79, 729, 1115, 3713, 2715, 9361, 9365, 26093, 63409}}, {5981, 17, 2164, {1, 3, 1, 7, 1, 51, 125, 15, 457, 433, 405, 2329, 157, 4817, 25867, 38177, 45319}}, {5982, 17, 2177, {1, 3, 7, 9, 25, 57, 5, 233, 481, 781, 1313, 3179, 7219, 8717, 14825, 16079, 127149}}, {5983, 17, 2178, {1, 1, 7, 15, 27, 51, 5, 65, 77, 313, 1751, 1489, 4307, 10541, 11345, 52577, 18143}}, {5984, 17, 2184, {1, 1, 1, 15, 21, 5, 113, 71, 411, 327, 1681, 1023, 5661, 15815, 5387, 10351, 21121}}, {5985, 17, 2198, {1, 1, 5, 5, 29, 55, 25, 255, 69, 879, 501, 1915, 3731, 633, 12197, 5249, 31129}}, {5986, 17, 2201, {1, 3, 5, 7, 3, 23, 107, 163, 485, 853, 359, 3069, 4353, 371, 6027, 53239, 105541}}, {5987, 17, 2213, {1, 3, 5, 15, 7, 41, 9, 47, 33, 327, 621, 147, 577, 29, 14623, 3403, 9791}}, {5988, 17, 2217, {1, 3, 3, 15, 29, 47, 41, 149, 477, 127, 573, 877, 3101, 5963, 28457, 14231, 67425}}, {5989, 17, 2228, {1, 1, 1, 15, 31, 7, 55, 191, 101, 259, 1071, 219, 2233, 3583, 21969, 32745, 80529}}, {5990, 17, 2240, {1, 3, 7, 13, 17, 53, 115, 69, 241, 71, 1475, 191, 509, 3721, 15537, 53773, 18005}}, {5991, 17, 2245, {1, 1, 3, 9, 5, 57, 13, 95, 103, 871, 2043, 2239, 7833, 10727, 6513, 55273, 3781}}, {5992, 17, 2250, {1, 1, 5, 5, 9, 11, 55, 151, 239, 537, 135, 2779, 7393, 15393, 11097, 58593, 100745}}, {5993, 17, 2263, {1, 1, 1, 9, 15, 39, 29, 105, 441, 181, 1113, 2125, 8145, 11045, 6589, 33603, 83377}}, {5994, 17, 2267, {1, 3, 1, 1, 11, 63, 69, 153, 225, 845, 675, 407, 4691, 13383, 27359, 38881, 5509}}, {5995, 17, 2285, {1, 3, 7, 11, 23, 31, 69, 3, 41, 57, 683, 887, 6861, 12161, 14537, 27293, 113001}}, {5996, 17, 2286, {1, 1, 1, 11, 5, 1, 101, 175, 437, 3, 1477, 1005, 6607, 7429, 7213, 4025, 66479}}, {5997, 17, 2291, {1, 1, 7, 5, 19, 7, 99, 131, 273, 977, 1717, 3831, 175, 5673, 12577, 36787, 30945}}, {5998, 17, 2298, {1, 3, 1, 1, 15, 37, 105, 195, 61, 869, 255, 2625, 7401, 9361, 13217, 52811, 130811}}, {5999, 17, 2306, {1, 3, 5, 3, 29, 27, 105, 23, 511, 813, 1311, 2859, 1647, 1949, 1329, 27589, 125209}}, {6000, 17, 2325, {1, 3, 3, 1, 21, 11, 119, 247, 123, 401, 409, 1845, 2133, 10793, 221, 43217, 14069}}, {6001, 17, 2329, {1, 1, 5, 1, 29, 21, 51, 73, 501, 861, 725, 249, 4249, 8029, 15767, 11985, 18637}}, {6002, 17, 2332, {1, 1, 5, 11, 19, 39, 97, 65, 13, 283, 489, 2307, 5239, 4161, 18639, 60035, 22405}}, {6003, 17, 2335, {1, 3, 5, 1, 3, 7, 109, 27, 429, 663, 1569, 3001, 3453, 8627, 9719, 23941, 110451}}, {6004, 17, 2339, {1, 3, 7, 5, 17, 13, 125, 209, 347, 95, 1937, 1419, 5661, 7171, 20607, 9777, 68343}}, {6005, 17, 2346, {1, 1, 1, 1, 7, 41, 43, 229, 57, 49, 1863, 2819, 3735, 915, 1571, 11603, 116275}}, {6006, 17, 2351, {1, 1, 7, 9, 21, 27, 5, 199, 181, 521, 303, 1097, 5427, 8899, 30325, 55457, 16189}}, {6007, 17, 2353, {1, 3, 3, 7, 19, 41, 3, 205, 279, 223, 971, 633, 2617, 13191, 10193, 23375, 62563}}, {6008, 17, 2363, {1, 3, 3, 13, 23, 59, 85, 25, 253, 405, 65, 1625, 4401, 4679, 14381, 57833, 30001}}, {6009, 17, 2378, {1, 3, 3, 3, 13, 35, 11, 157, 123, 397, 119, 2513, 1919, 14583, 5469, 11463, 94711}}, {6010, 17, 2383, {1, 1, 1, 7, 17, 37, 83, 211, 451, 939, 449, 13, 6671, 1457, 19855, 15053, 52327}}, {6011, 17, 2391, {1, 1, 5, 3, 9, 57, 39, 183, 331, 451, 1391, 1865, 7801, 14293, 29069, 705, 109497}}, {6012, 17, 2401, {1, 3, 7, 7, 23, 21, 85, 81, 255, 9, 1685, 2879, 6327, 12675, 31657, 38877, 74131}}, {6013, 17, 2408, {1, 1, 5, 9, 25, 19, 41, 195, 31, 555, 927, 1445, 593, 11067, 10819, 17205, 82037}}, {6014, 17, 2414, {1, 3, 1, 13, 1, 35, 29, 71, 323, 705, 53, 3885, 6223, 1319, 30853, 59935, 35949}}, {6015, 17, 2419, {1, 1, 7, 3, 27, 63, 67, 31, 149, 61, 1611, 77, 4271, 3161, 12493, 38341, 53837}}, {6016, 17, 2428, {1, 1, 1, 15, 27, 53, 31, 249, 429, 925, 1485, 1855, 4421, 5703, 10097, 14827, 36685}}, {6017, 17, 2441, {1, 3, 7, 13, 7, 63, 53, 9, 317, 485, 1679, 3631, 3745, 5643, 21615, 45129, 48027}}, {6018, 17, 2444, {1, 1, 1, 1, 17, 43, 19, 163, 441, 847, 937, 959, 6649, 13071, 1065, 55193, 129509}}, {6019, 17, 2461, {1, 1, 1, 11, 29, 47, 9, 215, 397, 637, 961, 3139, 2007, 12603, 27657, 22825, 72873}}, {6020, 17, 2480, {1, 3, 3, 15, 7, 45, 55, 163, 259, 899, 951, 3245, 4191, 15813, 20195, 8361, 54025}}, {6021, 17, 2483, {1, 1, 5, 11, 3, 17, 13, 223, 289, 255, 875, 2937, 1593, 9729, 21569, 63199, 83875}}, {6022, 17, 2486, {1, 1, 1, 15, 19, 31, 17, 129, 267, 9, 2015, 3233, 6799, 12891, 18473, 37865, 19547}}, {6023, 17, 2489, {1, 1, 5, 5, 5, 29, 81, 37, 357, 539, 1525, 2839, 8041, 5569, 4423, 8907, 35461}}, {6024, 17, 2490, {1, 1, 5, 5, 29, 11, 85, 61, 333, 521, 1111, 3627, 325, 9805, 17889, 25655, 39537}}, {6025, 17, 2518, {1, 3, 5, 11, 11, 53, 81, 25, 79, 253, 1963, 287, 7487, 15045, 21431, 35417, 102391}}, {6026, 17, 2527, {1, 1, 1, 5, 11, 33, 45, 45, 425, 773, 1817, 4077, 1471, 11655, 683, 7115, 92651}}, {6027, 17, 2540, {1, 1, 3, 3, 21, 13, 101, 215, 311, 853, 41, 1007, 5511, 2581, 25565, 13155, 117225}}, {6028, 17, 2558, {1, 1, 3, 11, 19, 9, 125, 59, 273, 691, 499, 1547, 567, 10259, 21963, 48725, 3601}}, {6029, 17, 2567, {1, 1, 3, 7, 27, 31, 39, 125, 317, 625, 1329, 3947, 3943, 6889, 2811, 34055, 1449}}, {6030, 17, 2571, {1, 1, 1, 3, 29, 45, 73, 239, 319, 611, 647, 1839, 5277, 7807, 3107, 14683, 20203}}, {6031, 17, 2574, {1, 3, 3, 3, 5, 5, 107, 139, 103, 809, 1343, 4041, 3273, 1789, 16205, 47873, 27803}}, {6032, 17, 2579, {1, 3, 1, 9, 21, 23, 13, 131, 105, 741, 1773, 981, 5633, 14609, 12281, 50343, 14317}}, {6033, 17, 2585, {1, 1, 1, 5, 11, 5, 125, 171, 109, 555, 159, 905, 691, 12401, 22817, 41411, 70113}}, {6034, 17, 2615, {1, 3, 3, 9, 31, 37, 109, 231, 59, 615, 799, 319, 2459, 4521, 8525, 4827, 22969}}, {6035, 17, 2639, {1, 3, 1, 5, 11, 7, 49, 237, 345, 473, 981, 2073, 6525, 8805, 13403, 3659, 69897}}, {6036, 17, 2641, {1, 3, 1, 5, 9, 37, 13, 203, 141, 573, 745, 2613, 5589, 607, 24483, 38427, 95775}}, {6037, 17, 2644, {1, 1, 3, 1, 23, 61, 75, 57, 299, 191, 805, 2993, 5175, 12037, 13649, 58831, 48791}}, {6038, 17, 2663, {1, 3, 7, 13, 31, 57, 13, 219, 185, 717, 1607, 3785, 4719, 11583, 29285, 48207, 92021}}, {6039, 17, 2667, {1, 3, 7, 15, 23, 35, 23, 69, 411, 773, 1549, 1087, 1685, 15703, 27193, 62675, 43505}}, {6040, 17, 2669, {1, 1, 5, 3, 25, 19, 97, 75, 493, 549, 1655, 2881, 4989, 2765, 4797, 43143, 113955}}, {6041, 17, 2672, {1, 1, 5, 7, 21, 5, 65, 37, 383, 133, 1907, 3747, 1525, 5803, 19977, 50551, 23157}}, {6042, 17, 2687, {1, 1, 1, 11, 15, 61, 59, 109, 489, 901, 1787, 1611, 6101, 10653, 3071, 35643, 56227}}, {6043, 17, 2700, {1, 3, 1, 5, 15, 25, 121, 111, 25, 251, 1467, 1795, 1631, 13753, 32391, 14831, 90739}}, {6044, 17, 2705, {1, 1, 1, 13, 23, 55, 119, 147, 45, 871, 1389, 1929, 1023, 16131, 10041, 40055, 23337}}, {6045, 17, 2724, {1, 3, 1, 15, 27, 33, 23, 41, 463, 603, 1633, 3445, 2007, 5999, 11175, 18343, 13159}}, {6046, 17, 2728, {1, 3, 1, 9, 17, 15, 107, 63, 493, 411, 293, 3669, 6143, 3057, 8253, 25491, 58907}}, {6047, 17, 2733, {1, 3, 5, 11, 1, 43, 5, 117, 127, 813, 1881, 3711, 2567, 7819, 5809, 64471, 104221}}, {6048, 17, 2741, {1, 3, 5, 9, 25, 27, 49, 93, 77, 705, 1773, 1745, 4605, 16137, 14621, 62893, 81637}}, {6049, 17, 2748, {1, 3, 1, 15, 9, 29, 41, 101, 291, 763, 1475, 3185, 3661, 10351, 26645, 50375, 59373}}, {6050, 17, 2751, {1, 1, 5, 15, 9, 31, 107, 159, 125, 471, 1023, 2361, 4805, 8073, 21563, 14903, 77801}}, {6051, 17, 2756, {1, 3, 7, 1, 27, 17, 75, 129, 71, 697, 551, 1969, 6597, 13821, 2605, 61783, 74791}}, {6052, 17, 2771, {1, 1, 7, 15, 17, 27, 49, 47, 59, 47, 1671, 2535, 1299, 2387, 24349, 23661, 91123}}, {6053, 17, 2774, {1, 1, 5, 15, 21, 61, 45, 37, 415, 189, 143, 351, 1815, 3479, 2399, 56753, 123893}}, {6054, 17, 2793, {1, 1, 3, 7, 7, 19, 93, 249, 335, 305, 1437, 1329, 2693, 13201, 9589, 61513, 115995}}, {6055, 17, 2796, {1, 1, 1, 11, 21, 57, 33, 205, 235, 253, 751, 259, 6029, 9811, 10231, 36899, 78035}}, {6056, 17, 2804, {1, 1, 1, 11, 13, 25, 115, 195, 111, 913, 1851, 3283, 6083, 11717, 2773, 40727, 493}}, {6057, 17, 2814, {1, 3, 3, 9, 9, 17, 83, 137, 465, 671, 1277, 325, 2767, 12413, 21977, 47525, 23041}}, {6058, 17, 2822, {1, 1, 1, 11, 15, 47, 65, 219, 271, 197, 297, 3195, 1325, 9991, 26385, 46055, 43151}}, {6059, 17, 2845, {1, 1, 1, 13, 31, 21, 39, 89, 127, 629, 367, 2935, 6259, 6627, 15691, 55781, 97251}}, {6060, 17, 2846, {1, 1, 7, 13, 11, 45, 65, 75, 211, 785, 1221, 2087, 7751, 15619, 25489, 28195, 69007}}, {6061, 17, 2850, {1, 3, 5, 15, 27, 37, 75, 111, 487, 219, 233, 583, 6433, 15105, 355, 28331, 21105}}, {6062, 17, 2855, {1, 3, 3, 15, 31, 53, 33, 95, 27, 197, 1727, 1467, 7115, 15479, 26873, 31075, 12793}}, {6063, 17, 2856, {1, 3, 7, 1, 19, 3, 19, 105, 225, 599, 737, 107, 7951, 10193, 31699, 59207, 85619}}, {6064, 17, 2867, {1, 3, 1, 3, 7, 17, 73, 191, 247, 421, 537, 1473, 189, 4219, 29993, 25491, 21189}}, {6065, 17, 2891, {1, 3, 7, 7, 13, 21, 33, 95, 147, 699, 943, 2275, 4093, 6067, 9063, 25503, 111085}}, {6066, 17, 2894, {1, 1, 7, 9, 13, 47, 123, 121, 347, 467, 225, 957, 2329, 14075, 29843, 61753, 97179}}, {6067, 17, 2902, {1, 3, 3, 7, 17, 55, 37, 167, 215, 819, 163, 1747, 4485, 15991, 28011, 36351, 106495}}, {6068, 17, 2908, {1, 1, 3, 9, 25, 5, 83, 199, 209, 395, 1757, 1967, 5739, 2573, 13989, 32145, 4847}}, {6069, 17, 2951, {1, 3, 3, 13, 11, 21, 25, 223, 239, 569, 1877, 299, 8089, 3697, 801, 64775, 26827}}, {6070, 17, 2970, {1, 3, 5, 7, 17, 9, 127, 9, 65, 919, 1073, 2661, 1337, 10065, 30099, 30929, 90067}}, {6071, 17, 2972, {1, 3, 1, 13, 25, 41, 35, 251, 279, 351, 111, 3917, 2815, 7989, 9895, 54859, 126355}}, {6072, 17, 2975, {1, 1, 3, 7, 17, 61, 13, 73, 335, 831, 703, 37, 2765, 13169, 12513, 56301, 13907}}, {6073, 17, 2976, {1, 1, 5, 13, 11, 15, 33, 45, 505, 127, 1723, 17, 4927, 11453, 28859, 9671, 80041}}, {6074, 17, 2981, {1, 3, 1, 5, 9, 1, 25, 147, 281, 601, 243, 2687, 5533, 6725, 11075, 34807, 24619}}, {6075, 17, 2986, {1, 1, 3, 1, 7, 21, 71, 31, 485, 561, 1361, 1237, 8171, 15885, 7941, 4583, 32851}}, {6076, 17, 2999, {1, 3, 7, 1, 5, 35, 95, 155, 283, 959, 577, 1343, 4269, 13481, 30819, 40273, 8711}}, {6077, 17, 3000, {1, 3, 7, 3, 1, 53, 77, 45, 215, 537, 1045, 77, 2791, 3553, 13273, 23819, 62263}}, {6078, 17, 3006, {1, 3, 1, 15, 29, 59, 7, 145, 85, 3, 251, 2691, 7547, 11241, 32295, 24645, 75739}}, {6079, 17, 3014, {1, 1, 5, 9, 19, 9, 39, 163, 303, 233, 2039, 2027, 7169, 2773, 28649, 38317, 66761}}, {6080, 17, 3028, {1, 3, 7, 5, 21, 27, 93, 227, 131, 1019, 1619, 1497, 4043, 1131, 25761, 20173, 99957}}, {6081, 17, 3031, {1, 3, 7, 5, 19, 33, 15, 173, 435, 399, 531, 2001, 3221, 12627, 10153, 24421, 61805}}, {6082, 17, 3035, {1, 3, 1, 9, 11, 3, 69, 105, 289, 183, 1103, 831, 2297, 1613, 18801, 54395, 54243}}, {6083, 17, 3037, {1, 3, 3, 9, 3, 53, 113, 183, 79, 355, 1629, 1061, 3713, 4563, 14365, 43529, 56073}}, {6084, 17, 3053, {1, 3, 7, 11, 31, 39, 107, 139, 187, 873, 225, 33, 4943, 15837, 225, 6407, 85967}}, {6085, 17, 3059, {1, 3, 1, 11, 17, 47, 93, 233, 119, 699, 1429, 2845, 2061, 8887, 20665, 45497, 33107}}, {6086, 17, 3065, {1, 3, 5, 1, 25, 11, 55, 75, 91, 1009, 1887, 3167, 515, 15929, 11659, 57953, 63401}}, {6087, 17, 3080, {1, 1, 3, 15, 27, 59, 103, 53, 353, 553, 2021, 1543, 2785, 9373, 14609, 21213, 19911}}, {6088, 17, 3091, {1, 3, 7, 9, 3, 1, 101, 133, 437, 773, 1399, 1067, 7419, 1793, 16589, 3483, 42065}}, {6089, 17, 3094, {1, 3, 7, 1, 25, 57, 127, 113, 65, 577, 1865, 1527, 6485, 11273, 15803, 39625, 75219}}, {6090, 17, 3109, {1, 3, 5, 9, 7, 63, 29, 89, 155, 45, 1029, 2407, 6783, 4749, 4849, 26639, 54059}}, {6091, 17, 3110, {1, 3, 7, 9, 25, 13, 113, 41, 267, 767, 1071, 1689, 269, 14437, 21255, 39473, 65771}}, {6092, 17, 3113, {1, 3, 1, 15, 5, 3, 77, 43, 391, 763, 59, 1027, 6263, 3715, 31061, 43311, 130725}}, {6093, 17, 3116, {1, 3, 7, 7, 21, 51, 127, 71, 229, 171, 397, 1099, 871, 2717, 1643, 17363, 125979}}, {6094, 17, 3136, {1, 1, 5, 15, 25, 11, 11, 113, 203, 795, 1703, 3901, 1113, 12819, 25345, 46691, 112313}}, {6095, 17, 3139, {1, 3, 7, 5, 1, 59, 91, 81, 325, 483, 595, 1491, 7455, 6699, 199, 35597, 59851}}, {6096, 17, 3141, {1, 3, 5, 1, 3, 33, 43, 195, 201, 575, 1395, 1305, 7001, 2023, 22419, 15233, 120355}}, {6097, 17, 3154, {1, 1, 3, 3, 15, 37, 81, 59, 87, 675, 199, 3231, 4473, 5023, 16753, 51475, 102113}}, {6098, 17, 3160, {1, 1, 7, 9, 13, 39, 65, 9, 51, 565, 1171, 119, 7875, 12149, 6565, 56849, 123235}}, {6099, 17, 3169, {1, 3, 3, 7, 15, 45, 53, 93, 111, 533, 1849, 643, 2265, 10241, 24741, 11559, 74333}}, {6100, 17, 3182, {1, 3, 1, 1, 11, 61, 75, 51, 5, 199, 535, 279, 5821, 6005, 2907, 32521, 74121}}, {6101, 17, 3187, {1, 1, 3, 15, 3, 21, 29, 193, 71, 993, 1719, 1865, 6135, 7683, 12171, 29275, 14539}}, {6102, 17, 3189, {1, 1, 1, 7, 7, 13, 1, 61, 315, 431, 1145, 2067, 5745, 1641, 1047, 55111, 129477}}, {6103, 17, 3190, {1, 1, 5, 1, 21, 43, 115, 193, 153, 573, 1181, 3947, 7809, 11317, 30649, 56891, 47741}}, {6104, 17, 3203, {1, 1, 5, 7, 19, 15, 61, 239, 109, 683, 395, 2869, 3103, 1531, 12019, 45159, 37525}}, {6105, 17, 3217, {1, 1, 5, 7, 29, 55, 45, 7, 353, 659, 591, 3371, 5777, 8475, 2743, 47483, 11983}}, {6106, 17, 3229, {1, 3, 1, 3, 13, 17, 39, 195, 43, 5, 1749, 2559, 5843, 8719, 21421, 58511, 105637}}, {6107, 17, 3236, {1, 3, 5, 5, 5, 21, 29, 63, 387, 301, 567, 3325, 2109, 403, 23053, 24851, 14493}}, {6108, 17, 3248, {1, 1, 3, 3, 17, 57, 107, 131, 85, 855, 1101, 3199, 7159, 14739, 4197, 27943, 113009}}, {6109, 17, 3257, {1, 1, 3, 11, 1, 61, 31, 79, 33, 123, 1509, 507, 6679, 2279, 8465, 37279, 17553}}, {6110, 17, 3278, {1, 3, 1, 15, 7, 33, 11, 71, 217, 609, 1661, 3437, 5497, 13365, 6247, 649, 26407}}, {6111, 17, 3283, {1, 1, 3, 1, 19, 45, 49, 125, 5, 455, 1669, 4083, 253, 10101, 27327, 16401, 120399}}, {6112, 17, 3289, {1, 3, 1, 1, 27, 19, 117, 137, 261, 341, 1697, 457, 7553, 12169, 30049, 49281, 36937}}, {6113, 17, 3292, {1, 1, 1, 3, 9, 49, 33, 13, 461, 545, 1537, 2623, 883, 10921, 5583, 58997, 114183}}, {6114, 17, 3302, {1, 1, 7, 9, 29, 53, 29, 165, 205, 989, 1347, 2343, 7505, 7609, 18503, 51677, 105993}}, {6115, 17, 3316, {1, 1, 1, 13, 1, 29, 59, 121, 297, 659, 1965, 1765, 5255, 10971, 32613, 18763, 41983}}, {6116, 17, 3328, {1, 3, 7, 11, 21, 41, 19, 47, 125, 485, 475, 2745, 4075, 8101, 31227, 4679, 115473}}, {6117, 17, 3333, {1, 3, 3, 7, 21, 23, 55, 65, 223, 1001, 317, 1459, 183, 5139, 26553, 41471, 116373}}, {6118, 17, 3337, {1, 1, 7, 3, 1, 9, 29, 139, 343, 913, 1993, 3139, 3791, 5869, 6057, 23863, 35737}}, {6119, 17, 3340, {1, 3, 3, 3, 7, 21, 77, 197, 239, 467, 35, 591, 1061, 3417, 31811, 38825, 124981}}, {6120, 17, 3368, {1, 3, 3, 1, 21, 29, 5, 213, 417, 111, 1681, 1409, 2899, 16233, 1053, 51235, 87767}}, {6121, 17, 3371, {1, 1, 5, 3, 13, 47, 61, 203, 223, 73, 1947, 3613, 5885, 13567, 7593, 34329, 68597}}, {6122, 17, 3376, {1, 3, 1, 1, 17, 9, 11, 187, 361, 973, 781, 1835, 1539, 12917, 21725, 48279, 115037}}, {6123, 17, 3385, {1, 3, 1, 1, 9, 25, 117, 157, 433, 395, 403, 2183, 3327, 5427, 7505, 2673, 77137}}, {6124, 17, 3386, {1, 1, 7, 15, 31, 15, 27, 155, 441, 837, 1877, 3829, 5139, 16331, 31183, 15803, 95699}}, {6125, 17, 3393, {1, 1, 7, 15, 5, 51, 77, 179, 289, 727, 1763, 2529, 6715, 3967, 29267, 27293, 67953}}, {6126, 17, 3399, {1, 3, 7, 13, 7, 3, 3, 17, 311, 547, 1465, 1413, 3937, 2725, 24523, 12321, 109763}}, {6127, 17, 3405, {1, 3, 5, 15, 9, 5, 87, 135, 281, 97, 2021, 1903, 8007, 10321, 27989, 18993, 110407}}, {6128, 17, 3414, {1, 1, 1, 13, 25, 61, 89, 107, 233, 823, 1375, 3531, 1757, 1577, 29457, 1461, 17217}}, {6129, 17, 3433, {1, 1, 1, 13, 17, 17, 27, 193, 485, 759, 145, 3943, 4183, 14119, 11217, 3793, 1935}}, {6130, 17, 3436, {1, 1, 1, 3, 13, 31, 101, 227, 311, 363, 1925, 1525, 5275, 2385, 15093, 48769, 121189}}, {6131, 17, 3448, {1, 1, 5, 13, 11, 61, 89, 141, 117, 229, 417, 3935, 7249, 13869, 30591, 62763, 67521}}, {6132, 17, 3467, {1, 1, 3, 15, 7, 59, 105, 239, 453, 221, 1101, 395, 2031, 8941, 23155, 7077, 125593}}, {6133, 17, 3469, {1, 1, 1, 11, 7, 55, 99, 31, 305, 371, 1035, 577, 4473, 577, 371, 46093, 69157}}, {6134, 17, 3472, {1, 3, 1, 9, 9, 33, 35, 245, 95, 47, 1623, 2965, 6849, 7269, 5321, 31641, 73321}}, {6135, 17, 3477, {1, 1, 1, 15, 21, 61, 65, 65, 159, 151, 625, 2281, 2993, 1311, 29757, 24703, 71029}}, {6136, 17, 3484, {1, 3, 5, 15, 29, 59, 29, 69, 351, 901, 631, 3501, 7031, 703, 20805, 36437, 94931}}, {6137, 17, 3494, {1, 3, 7, 1, 21, 11, 19, 125, 237, 807, 1651, 2389, 7347, 11759, 27151, 38669, 965}}, {6138, 17, 3505, {1, 1, 5, 1, 15, 41, 1, 105, 89, 127, 895, 29, 2339, 15951, 18633, 2781, 67269}}, {6139, 17, 3515, {1, 1, 5, 15, 25, 7, 3, 33, 375, 447, 203, 2579, 6145, 14015, 9939, 52777, 123181}}, {6140, 17, 3523, {1, 3, 1, 15, 29, 7, 7, 27, 451, 869, 107, 2457, 5557, 11601, 28957, 36181, 41419}}, {6141, 17, 3530, {1, 1, 1, 7, 1, 57, 33, 213, 329, 763, 815, 169, 623, 155, 20529, 20603, 73311}}, {6142, 17, 3543, {1, 3, 5, 7, 25, 21, 7, 217, 159, 89, 1373, 1735, 705, 4093, 13083, 3855, 55875}}, {6143, 17, 3559, {1, 3, 1, 1, 29, 33, 105, 127, 95, 543, 235, 67, 691, 5015, 22139, 18251, 89945}}, {6144, 17, 3568, {1, 1, 3, 11, 27, 53, 105, 83, 337, 331, 1571, 1145, 745, 1845, 17881, 17697, 88139}}, {6145, 17, 3577, {1, 3, 7, 15, 19, 37, 119, 35, 35, 463, 1925, 1665, 673, 12193, 12137, 62371, 10957}}, {6146, 17, 3578, {1, 3, 3, 3, 19, 21, 113, 29, 459, 467, 623, 2661, 857, 16265, 27509, 46555, 18867}}, {6147, 17, 3594, {1, 3, 7, 5, 17, 49, 123, 41, 85, 673, 41, 1871, 7649, 8687, 28269, 64423, 93675}}, {6148, 17, 3601, {1, 3, 3, 3, 7, 23, 101, 171, 181, 527, 65, 2387, 6629, 6089, 17387, 46551, 36143}}, {6149, 17, 3607, {1, 1, 5, 1, 13, 51, 21, 251, 139, 429, 1993, 3767, 1089, 5459, 19407, 41747, 41033}}, {6150, 17, 3608, {1, 1, 1, 11, 15, 9, 81, 91, 73, 969, 1513, 2067, 7959, 2605, 26641, 37631, 124571}}, {6151, 17, 3620, {1, 1, 3, 15, 29, 15, 5, 57, 247, 901, 527, 3325, 5859, 11299, 9871, 63947, 125247}}, {6152, 17, 3629, {1, 3, 1, 5, 1, 35, 75, 21, 307, 43, 1111, 3299, 1647, 3585, 31045, 18217, 95169}}, {6153, 17, 3644, {1, 3, 1, 7, 23, 35, 11, 103, 3, 461, 1915, 4019, 453, 13111, 26941, 43091, 22917}}, {6154, 17, 3656, {1, 1, 5, 5, 1, 61, 121, 167, 475, 5, 1749, 887, 2237, 5055, 7077, 29453, 17691}}, {6155, 17, 3664, {1, 3, 3, 15, 15, 15, 9, 15, 171, 787, 1965, 577, 4507, 7325, 20901, 8557, 111909}}, {6156, 17, 3670, {1, 3, 5, 1, 27, 15, 123, 141, 63, 55, 599, 4095, 1245, 13919, 27485, 49977, 74551}}, {6157, 17, 3680, {1, 3, 5, 9, 21, 61, 79, 119, 7, 573, 1923, 2775, 3127, 12689, 12135, 53429, 130163}}, {6158, 17, 3685, {1, 3, 3, 13, 27, 41, 67, 249, 447, 277, 311, 775, 8187, 10161, 12953, 22885, 121247}}, {6159, 17, 3686, {1, 3, 5, 9, 21, 55, 115, 65, 45, 395, 481, 2063, 6493, 4199, 19219, 27119, 62255}}, {6160, 17, 3695, {1, 1, 3, 13, 7, 41, 3, 127, 383, 923, 1725, 1033, 7731, 11971, 3089, 46459, 98369}}, {6161, 17, 3698, {1, 1, 3, 11, 13, 39, 39, 149, 309, 311, 1491, 807, 2109, 363, 14637, 65429, 124731}}, {6162, 17, 3703, {1, 1, 7, 13, 13, 35, 67, 81, 493, 859, 1177, 237, 4605, 15319, 16669, 16661, 21385}}, {6163, 17, 3710, {1, 1, 3, 7, 7, 39, 57, 103, 239, 753, 221, 1611, 1557, 13317, 27453, 10245, 33839}}, {6164, 17, 3714, {1, 1, 5, 13, 27, 53, 97, 41, 123, 253, 535, 1839, 5827, 7587, 1261, 20313, 65961}}, {6165, 17, 3726, {1, 1, 7, 1, 11, 47, 93, 135, 223, 591, 1087, 3329, 3293, 14207, 6187, 54789, 23781}}, {6166, 17, 3731, {1, 3, 7, 7, 25, 21, 97, 105, 269, 515, 1805, 3711, 3295, 7307, 21065, 65205, 116969}}, {6167, 17, 3733, {1, 3, 1, 11, 25, 37, 21, 89, 109, 581, 1055, 2393, 1291, 1115, 25545, 36383, 93605}}, {6168, 17, 3737, {1, 3, 7, 1, 27, 13, 113, 11, 395, 473, 943, 4045, 5507, 15051, 25203, 2971, 31961}}, {6169, 17, 3756, {1, 1, 5, 5, 27, 35, 57, 219, 67, 949, 659, 203, 5235, 6509, 13731, 61533, 54963}}, {6170, 17, 3759, {1, 3, 1, 1, 15, 39, 85, 13, 347, 99, 25, 3595, 3081, 13617, 14373, 58909, 102181}}, {6171, 17, 3767, {1, 1, 7, 13, 3, 25, 97, 91, 287, 389, 665, 2981, 2301, 12625, 4495, 57489, 68677}}, {6172, 17, 3776, {1, 1, 5, 1, 15, 57, 77, 55, 299, 713, 1457, 3699, 2807, 5549, 467, 47367, 8163}}, {6173, 17, 3785, {1, 1, 7, 3, 23, 45, 91, 251, 501, 193, 1121, 2359, 4781, 12797, 13713, 55171, 927}}, {6174, 17, 3793, {1, 3, 3, 7, 7, 31, 87, 163, 249, 163, 937, 1293, 4827, 10299, 31935, 58787, 80589}}, {6175, 17, 3812, {1, 3, 1, 9, 7, 1, 73, 65, 475, 791, 1429, 3319, 7149, 433, 10373, 44061, 121195}}, {6176, 17, 3815, {1, 1, 5, 9, 9, 61, 27, 249, 435, 437, 1329, 2163, 5859, 13663, 623, 55569, 94283}}, {6177, 17, 3824, {1, 3, 7, 11, 1, 29, 117, 195, 399, 999, 1705, 1325, 6043, 9823, 27335, 30377, 16627}}, {6178, 17, 3844, {1, 1, 1, 15, 5, 11, 63, 185, 15, 741, 1061, 2961, 3455, 5, 26587, 54081, 18107}}, {6179, 17, 3859, {1, 1, 5, 7, 29, 57, 17, 203, 501, 177, 49, 2773, 8069, 12513, 14437, 64489, 58661}}, {6180, 17, 3866, {1, 3, 3, 9, 11, 23, 121, 3, 415, 447, 1773, 135, 5901, 4951, 2683, 437, 126251}}, {6181, 17, 3872, {1, 3, 3, 1, 7, 23, 17, 23, 115, 591, 1075, 3133, 49, 15183, 10615, 37857, 122609}}, {6182, 17, 3884, {1, 1, 3, 3, 13, 49, 63, 37, 275, 763, 1135, 2913, 1563, 11037, 6693, 18799, 32089}}, {6183, 17, 3889, {1, 3, 5, 11, 7, 29, 59, 45, 227, 941, 1947, 2733, 797, 10485, 7071, 14741, 11451}}, {6184, 17, 3899, {1, 1, 1, 9, 21, 19, 77, 97, 75, 991, 187, 1003, 5619, 11013, 3931, 19907, 79723}}, {6185, 17, 3902, {1, 1, 7, 13, 1, 57, 61, 177, 443, 227, 1347, 2665, 2011, 12329, 14137, 37795, 63331}}, {6186, 17, 3909, {1, 3, 3, 9, 31, 59, 87, 93, 485, 635, 901, 1845, 6153, 10797, 1289, 8989, 41717}}, {6187, 17, 3913, {1, 1, 1, 1, 3, 7, 85, 17, 67, 309, 1891, 435, 303, 8011, 32127, 54309, 21457}}, {6188, 17, 3933, {1, 3, 7, 1, 29, 27, 41, 239, 293, 717, 1331, 917, 6145, 7131, 28199, 35093, 103683}}, {6189, 17, 3938, {1, 3, 7, 3, 21, 63, 65, 233, 257, 789, 1095, 505, 4557, 16259, 7397, 24815, 89529}}, {6190, 17, 3949, {1, 3, 3, 11, 29, 41, 55, 17, 335, 715, 779, 2121, 6393, 8887, 32753, 45647, 82665}}, {6191, 17, 3952, {1, 1, 1, 11, 27, 47, 71, 13, 141, 283, 967, 3359, 4309, 6661, 20481, 23175, 50835}}, {6192, 17, 3980, {1, 3, 3, 7, 3, 25, 19, 241, 409, 573, 1565, 3355, 1307, 12205, 18017, 8271, 117007}}, {6193, 17, 3991, {1, 3, 3, 9, 21, 39, 21, 253, 439, 963, 341, 3637, 2275, 1845, 11015, 481, 83369}}, {6194, 17, 3992, {1, 3, 7, 9, 31, 29, 29, 163, 111, 983, 571, 713, 2621, 11569, 13341, 28341, 130381}}, {6195, 17, 4002, {1, 3, 7, 7, 11, 35, 89, 49, 81, 115, 113, 1857, 3527, 14819, 6909, 14659, 23557}}, {6196, 17, 4008, {1, 3, 3, 15, 29, 41, 85, 241, 317, 737, 213, 1667, 5789, 16321, 13991, 36165, 124151}}, {6197, 17, 4011, {1, 3, 1, 3, 31, 1, 75, 99, 495, 241, 1499, 1535, 2033, 2135, 6699, 58893, 37031}}, {6198, 17, 4016, {1, 1, 7, 9, 25, 15, 101, 23, 477, 563, 1691, 2655, 2321, 2323, 4255, 22055, 99661}}, {6199, 17, 4034, {1, 3, 7, 5, 7, 7, 49, 221, 51, 83, 279, 2205, 2939, 2119, 14073, 32839, 108075}}, {6200, 17, 4036, {1, 3, 5, 11, 17, 39, 3, 127, 87, 501, 799, 401, 4439, 9895, 13017, 64975, 67177}}, {6201, 17, 4063, {1, 3, 3, 9, 17, 41, 59, 95, 283, 309, 83, 1293, 6385, 5783, 30115, 33997, 12531}}, {6202, 17, 4067, {1, 3, 5, 3, 7, 31, 69, 171, 225, 409, 1237, 3343, 835, 8039, 16723, 37203, 129047}}, {6203, 17, 4073, {1, 3, 3, 15, 17, 23, 107, 1, 105, 135, 1245, 993, 4101, 7325, 7425, 17379, 98121}}, {6204, 17, 4082, {1, 1, 7, 9, 27, 5, 67, 111, 75, 531, 243, 2239, 2527, 4513, 27059, 40533, 88169}}, {6205, 17, 4091, {1, 3, 5, 7, 21, 63, 57, 15, 75, 679, 1729, 1845, 6259, 8531, 18691, 49321, 101599}}, {6206, 17, 4093, {1, 1, 5, 9, 3, 35, 7, 201, 351, 885, 669, 2339, 5009, 279, 26469, 54597, 67933}}, {6207, 17, 4101, {1, 3, 5, 13, 27, 5, 85, 161, 141, 733, 1017, 2021, 6951, 15595, 21817, 17243, 88607}}, {6208, 17, 4113, {1, 3, 5, 1, 11, 31, 117, 97, 175, 629, 995, 1207, 2941, 5825, 5319, 48191, 9505}}, {6209, 17, 4120, {1, 3, 3, 7, 25, 39, 45, 79, 21, 607, 1593, 1749, 7951, 10425, 17491, 16617, 56903}}, {6210, 17, 4125, {1, 1, 1, 5, 15, 41, 107, 115, 79, 693, 919, 3513, 6793, 6541, 5545, 58583, 27963}}, {6211, 17, 4126, {1, 3, 7, 11, 21, 19, 123, 1, 441, 531, 359, 2117, 2465, 11389, 13489, 32755, 4577}}, {6212, 17, 4139, {1, 1, 5, 13, 7, 7, 7, 127, 201, 377, 1423, 269, 2611, 3339, 19153, 25659, 33069}}, {6213, 17, 4142, {1, 3, 7, 1, 13, 35, 45, 5, 313, 739, 1779, 2983, 1815, 8817, 14239, 3921, 57975}}, {6214, 17, 4144, {1, 3, 1, 11, 9, 39, 33, 111, 39, 255, 159, 2345, 2193, 11475, 12841, 47579, 90309}}, {6215, 17, 4147, {1, 1, 1, 3, 27, 49, 85, 157, 243, 247, 1473, 323, 4631, 1787, 15193, 5533, 104999}}, {6216, 17, 4153, {1, 1, 7, 9, 11, 29, 23, 219, 57, 339, 1797, 409, 6025, 10569, 27409, 15147, 130281}}, {6217, 17, 4154, {1, 1, 7, 1, 31, 31, 113, 229, 63, 877, 319, 2655, 3335, 7743, 19593, 10089, 28215}}, {6218, 17, 4164, {1, 1, 3, 11, 23, 3, 71, 235, 329, 751, 159, 2579, 5363, 12681, 20233, 53855, 16407}}, {6219, 17, 4174, {1, 1, 5, 1, 7, 61, 21, 235, 379, 849, 61, 2969, 6399, 2655, 21635, 16955, 58675}}, {6220, 17, 4182, {1, 3, 7, 7, 29, 15, 5, 11, 143, 699, 1875, 2115, 6633, 6195, 5829, 53633, 111221}}, {6221, 17, 4185, {1, 3, 7, 11, 19, 41, 17, 219, 483, 829, 1233, 3183, 6283, 2363, 25245, 63075, 82733}}, {6222, 17, 4188, {1, 3, 7, 13, 21, 17, 1, 207, 443, 575, 521, 2585, 6875, 14871, 14739, 10211, 127435}}, {6223, 17, 4191, {1, 3, 7, 7, 15, 39, 99, 197, 219, 259, 1723, 3737, 6625, 849, 887, 41293, 53825}}, {6224, 17, 4195, {1, 3, 3, 3, 5, 3, 75, 155, 189, 935, 85, 2273, 1375, 4217, 10709, 58047, 81689}}, {6225, 17, 4219, {1, 3, 5, 5, 27, 27, 107, 229, 179, 887, 91, 421, 7313, 6495, 451, 43859, 40033}}, {6226, 17, 4225, {1, 3, 5, 11, 25, 49, 121, 73, 169, 311, 1387, 1037, 6519, 9317, 26975, 50627, 46805}}, {6227, 17, 4228, {1, 1, 5, 11, 17, 21, 19, 125, 387, 697, 1017, 1759, 7295, 9869, 28241, 9367, 119255}}, {6228, 17, 4232, {1, 1, 7, 5, 29, 27, 87, 187, 95, 625, 933, 1751, 5253, 313, 30841, 16349, 67347}}, {6229, 17, 4246, {1, 1, 3, 3, 15, 51, 23, 101, 183, 267, 243, 711, 983, 12461, 17801, 1429, 47273}}, {6230, 17, 4255, {1, 1, 1, 3, 17, 3, 73, 67, 49, 449, 879, 2559, 401, 11983, 13697, 12023, 78855}}, {6231, 17, 4274, {1, 3, 7, 15, 25, 25, 43, 81, 141, 161, 595, 621, 1165, 10869, 22875, 6741, 90017}}, {6232, 17, 4283, {1, 3, 5, 11, 13, 57, 53, 219, 145, 937, 769, 1961, 4725, 3335, 12623, 8335, 46305}}, {6233, 17, 4286, {1, 1, 3, 5, 7, 39, 19, 101, 313, 583, 483, 2515, 125, 5211, 2559, 11937, 126717}}, {6234, 17, 4306, {1, 3, 1, 7, 7, 1, 117, 49, 231, 133, 381, 697, 927, 8263, 26529, 64881, 25059}}, {6235, 17, 4311, {1, 1, 1, 15, 11, 25, 77, 149, 233, 215, 1239, 3045, 99, 11183, 30279, 32271, 100943}}, {6236, 17, 4317, {1, 1, 5, 7, 31, 25, 1, 51, 221, 607, 1733, 2145, 6765, 7011, 16927, 29257, 2445}}, {6237, 17, 4321, {1, 3, 5, 1, 19, 23, 123, 93, 381, 295, 765, 2335, 8025, 14003, 4801, 54243, 57297}}, {6238, 17, 4324, {1, 1, 7, 9, 9, 31, 63, 191, 495, 527, 251, 2119, 1663, 209, 7445, 1441, 4075}}, {6239, 17, 4331, {1, 3, 5, 5, 13, 17, 97, 79, 369, 55, 677, 2031, 7315, 4769, 31659, 21975, 22061}}, {6240, 17, 4333, {1, 3, 3, 7, 3, 63, 121, 243, 39, 917, 1917, 297, 7241, 1565, 31675, 14443, 67239}}, {6241, 17, 4359, {1, 3, 7, 1, 13, 25, 51, 65, 145, 475, 1853, 4023, 5121, 14411, 15993, 42165, 13615}}, {6242, 17, 4360, {1, 3, 3, 1, 3, 51, 75, 29, 169, 311, 1309, 2929, 7669, 1507, 14605, 32667, 103861}}, {6243, 17, 4368, {1, 3, 7, 1, 23, 37, 89, 211, 137, 495, 1469, 3425, 1167, 12429, 27301, 46857, 83007}}, {6244, 17, 4373, {1, 3, 7, 7, 27, 37, 33, 129, 73, 23, 761, 119, 6217, 4749, 20835, 47477, 33665}}, {6245, 17, 4389, {1, 1, 3, 5, 29, 35, 79, 21, 183, 933, 43, 3149, 5273, 12159, 20695, 5387, 23569}}, {6246, 17, 4394, {1, 1, 5, 5, 3, 11, 57, 205, 349, 657, 1509, 3693, 5495, 11865, 13861, 62215, 94141}}, {6247, 17, 4413, {1, 3, 1, 7, 17, 43, 117, 119, 75, 849, 1247, 643, 2691, 2289, 9759, 18683, 68649}}, {6248, 17, 4422, {1, 1, 1, 15, 5, 55, 89, 177, 427, 701, 735, 2993, 5293, 15395, 567, 5501, 102393}}, {6249, 17, 4431, {1, 3, 3, 15, 5, 37, 73, 111, 9, 141, 407, 1579, 6691, 11843, 6377, 64181, 97347}}, {6250, 17, 4436, {1, 1, 5, 1, 9, 17, 71, 127, 285, 929, 1243, 2605, 359, 14589, 32603, 39879, 115901}}, {6251, 17, 4440, {1, 3, 7, 15, 3, 27, 91, 121, 47, 631, 1589, 385, 5997, 14077, 21285, 33895, 36985}}, {6252, 17, 4445, {1, 3, 3, 9, 1, 47, 89, 79, 213, 27, 547, 1703, 4035, 13205, 4341, 21895, 34247}}, {6253, 17, 4452, {1, 3, 5, 7, 9, 9, 47, 89, 231, 857, 297, 2949, 2715, 1275, 14427, 20227, 21569}}, {6254, 17, 4462, {1, 3, 1, 3, 15, 57, 61, 183, 377, 477, 1135, 1729, 2863, 8607, 29241, 34983, 84443}}, {6255, 17, 4469, {1, 1, 7, 7, 5, 53, 91, 149, 71, 41, 1025, 3945, 3989, 15853, 20903, 26943, 99841}}, {6256, 17, 4470, {1, 3, 3, 3, 29, 21, 59, 217, 483, 257, 331, 657, 2935, 945, 9821, 42501, 98087}}, {6257, 17, 4473, {1, 3, 5, 3, 17, 39, 123, 103, 109, 957, 853, 3821, 555, 10869, 27673, 38315, 83105}}, {6258, 17, 4479, {1, 3, 1, 3, 27, 7, 97, 57, 429, 53, 1791, 1405, 4113, 8435, 12845, 21567, 91559}}, {6259, 17, 4480, {1, 3, 3, 1, 17, 61, 125, 77, 225, 395, 945, 3213, 1363, 15947, 27049, 4389, 64037}}, {6260, 17, 4483, {1, 1, 1, 3, 15, 51, 15, 189, 449, 989, 939, 985, 6929, 13779, 25011, 22277, 72543}}, {6261, 17, 4489, {1, 3, 3, 1, 25, 53, 5, 219, 195, 703, 163, 1405, 821, 6797, 14329, 1675, 96653}}, {6262, 17, 4503, {1, 1, 7, 13, 7, 1, 45, 135, 369, 125, 711, 2509, 131, 13663, 29769, 19497, 116779}}, {6263, 17, 4519, {1, 1, 7, 15, 23, 25, 7, 225, 435, 835, 1981, 2537, 5727, 15961, 30089, 58905, 100339}}, {6264, 17, 4520, {1, 3, 7, 3, 19, 9, 79, 63, 371, 419, 1357, 3649, 7987, 14541, 6631, 50555, 84217}}, {6265, 17, 4525, {1, 3, 3, 9, 7, 61, 11, 157, 99, 95, 945, 2803, 1703, 117, 12891, 21817, 84259}}, {6266, 17, 4526, {1, 3, 7, 7, 25, 37, 111, 99, 65, 599, 1313, 2557, 5489, 3625, 7429, 19309, 78111}}, {6267, 17, 4533, {1, 3, 1, 1, 19, 15, 85, 253, 347, 315, 1349, 983, 2507, 4155, 15311, 43535, 101409}}, {6268, 17, 4552, {1, 3, 3, 3, 1, 55, 3, 57, 375, 107, 177, 1673, 6871, 7137, 10297, 65363, 42293}}, {6269, 17, 4581, {1, 1, 1, 3, 9, 5, 83, 45, 139, 893, 63, 2859, 6333, 15591, 18491, 26387, 25573}}, {6270, 17, 4585, {1, 1, 7, 15, 1, 39, 113, 127, 503, 617, 1367, 1855, 185, 4233, 5787, 8265, 42097}}, {6271, 17, 4591, {1, 1, 3, 11, 11, 41, 119, 165, 331, 625, 81, 2495, 7247, 9139, 15269, 31447, 128425}}, {6272, 17, 4594, {1, 1, 5, 5, 17, 35, 39, 1, 91, 563, 1841, 2975, 1233, 3837, 22145, 36719, 104503}}, {6273, 17, 4596, {1, 1, 7, 3, 23, 35, 77, 69, 271, 487, 921, 2597, 8011, 13037, 6001, 20519, 32673}}, {6274, 17, 4599, {1, 1, 1, 1, 29, 17, 11, 145, 473, 877, 813, 727, 6805, 3563, 13371, 22169, 17239}}, {6275, 17, 4612, {1, 1, 1, 13, 17, 13, 1, 125, 313, 423, 1079, 2401, 2325, 2219, 24071, 25613, 34163}}, {6276, 17, 4621, {1, 1, 5, 7, 29, 33, 53, 215, 11, 555, 555, 1965, 3643, 5433, 12923, 59655, 25339}}, {6277, 17, 4630, {1, 3, 3, 3, 23, 37, 119, 117, 459, 359, 1849, 1019, 433, 15391, 5625, 52649, 81313}}, {6278, 17, 4636, {1, 3, 3, 1, 21, 31, 121, 161, 113, 667, 863, 105, 3805, 14459, 28235, 24543, 89755}}, {6279, 17, 4640, {1, 1, 5, 15, 17, 37, 15, 111, 511, 477, 611, 955, 2591, 16137, 14179, 30995, 129575}}, {6280, 17, 4649, {1, 3, 3, 3, 21, 49, 25, 37, 287, 263, 851, 1015, 8133, 9429, 10959, 64483, 82533}}, {6281, 17, 4650, {1, 1, 5, 1, 25, 19, 49, 159, 155, 443, 975, 1413, 321, 7871, 22935, 57303, 124027}}, {6282, 17, 4660, {1, 3, 1, 1, 19, 45, 47, 89, 409, 509, 1249, 2445, 2053, 3781, 7517, 61869, 125137}}, {6283, 17, 4677, {1, 1, 5, 13, 27, 57, 45, 43, 361, 329, 1321, 771, 4665, 12245, 18993, 15121, 127485}}, {6284, 17, 4687, {1, 3, 3, 7, 3, 41, 127, 75, 485, 821, 497, 2649, 6423, 12419, 31421, 9441, 63645}}, {6285, 17, 4696, {1, 1, 3, 5, 19, 61, 91, 35, 311, 287, 449, 3955, 5805, 5631, 25613, 55409, 104545}}, {6286, 17, 4701, {1, 3, 7, 11, 27, 19, 27, 53, 19, 35, 1687, 3923, 3379, 10435, 15053, 12343, 89077}}, {6287, 17, 4705, {1, 3, 5, 13, 31, 41, 15, 239, 349, 533, 1771, 737, 6503, 14355, 18781, 27805, 79049}}, {6288, 17, 4706, {1, 3, 1, 3, 13, 11, 69, 227, 169, 873, 533, 2217, 1047, 12415, 12271, 22447, 14163}}, {6289, 17, 4711, {1, 1, 3, 9, 7, 31, 23, 155, 133, 305, 1569, 521, 201, 10339, 16999, 29163, 32817}}, {6290, 17, 4720, {1, 1, 1, 5, 31, 57, 43, 223, 121, 803, 357, 1855, 4321, 10245, 25725, 2543, 47395}}, {6291, 17, 4723, {1, 3, 5, 9, 3, 5, 47, 189, 217, 899, 1455, 691, 1277, 7861, 3627, 14895, 41109}}, {6292, 17, 4732, {1, 3, 7, 3, 29, 9, 37, 63, 453, 709, 921, 771, 8069, 239, 22639, 59937, 10635}}, {6293, 17, 4736, {1, 3, 7, 1, 11, 51, 79, 131, 225, 757, 549, 1605, 3921, 1849, 16307, 29809, 120597}}, {6294, 17, 4742, {1, 3, 7, 7, 1, 45, 33, 185, 23, 881, 1941, 4093, 4741, 11633, 2059, 32007, 11103}}, {6295, 17, 4748, {1, 3, 5, 11, 17, 21, 43, 205, 363, 559, 697, 4057, 631, 6697, 883, 61705, 102791}}, {6296, 17, 4754, {1, 1, 7, 9, 29, 35, 109, 85, 373, 321, 415, 2969, 6163, 6999, 9999, 36435, 125267}}, {6297, 17, 4759, {1, 1, 7, 11, 25, 9, 113, 91, 337, 889, 947, 2093, 5289, 1367, 13297, 36155, 21825}}, {6298, 17, 4769, {1, 1, 3, 9, 17, 25, 35, 79, 275, 687, 335, 1181, 7327, 3729, 1561, 27441, 114355}}, {6299, 17, 4787, {1, 3, 3, 11, 25, 41, 27, 89, 115, 361, 871, 1497, 5735, 6365, 1737, 14277, 63847}}, {6300, 17, 4807, {1, 3, 7, 7, 1, 63, 31, 73, 289, 67, 277, 1821, 4883, 10795, 11755, 15471, 105871}}, {6301, 17, 4814, {1, 3, 7, 9, 23, 17, 37, 179, 409, 957, 373, 2393, 2363, 6735, 28737, 41927, 115735}}, {6302, 17, 4837, {1, 1, 3, 9, 15, 43, 111, 61, 455, 181, 1643, 3063, 4311, 13705, 29993, 21731, 25243}}, {6303, 17, 4867, {1, 1, 1, 15, 13, 13, 69, 187, 91, 395, 209, 3477, 4649, 7727, 30557, 14719, 1953}}, {6304, 17, 4873, {1, 1, 1, 15, 9, 39, 119, 193, 459, 135, 567, 25, 4583, 8401, 22161, 14771, 74165}}, {6305, 17, 4879, {1, 1, 3, 7, 5, 39, 77, 149, 293, 585, 1245, 3615, 357, 11613, 13865, 40227, 41023}}, {6306, 17, 4884, {1, 1, 7, 9, 9, 37, 5, 177, 121, 181, 771, 733, 7683, 4855, 13629, 8349, 46137}}, {6307, 17, 4898, {1, 1, 3, 13, 3, 37, 73, 69, 281, 109, 563, 1427, 5127, 8957, 16749, 41489, 49531}}, {6308, 17, 4907, {1, 1, 7, 11, 29, 63, 79, 127, 95, 809, 1175, 1567, 6353, 7505, 26551, 5073, 53733}}, {6309, 17, 4910, {1, 1, 1, 5, 25, 41, 59, 103, 59, 365, 1111, 3909, 3749, 14889, 3639, 10435, 45407}}, {6310, 17, 4918, {1, 1, 1, 5, 3, 61, 93, 199, 97, 779, 67, 241, 6197, 6785, 16869, 7573, 46745}}, {6311, 17, 4924, {1, 1, 5, 9, 27, 29, 21, 69, 165, 661, 1245, 1265, 2979, 9685, 17781, 23329, 48029}}, {6312, 17, 4953, {1, 1, 1, 7, 7, 23, 39, 197, 169, 561, 499, 2197, 4371, 157, 6837, 44635, 94861}}, {6313, 17, 4956, {1, 1, 5, 13, 7, 5, 9, 207, 321, 243, 899, 2967, 3553, 15413, 8961, 55039, 6459}}, {6314, 17, 4965, {1, 3, 5, 3, 13, 25, 33, 145, 45, 979, 33, 2211, 7003, 11147, 11327, 55151, 30697}}, {6315, 17, 4966, {1, 1, 3, 13, 7, 51, 25, 229, 231, 115, 1815, 3867, 1533, 15259, 8067, 64803, 87535}}, {6316, 17, 4970, {1, 1, 3, 3, 21, 51, 101, 49, 227, 393, 1659, 955, 545, 7395, 31563, 5499, 130541}}, {6317, 17, 4972, {1, 3, 1, 1, 21, 41, 57, 161, 269, 35, 893, 1817, 857, 7027, 973, 12529, 46659}}, {6318, 17, 4983, {1, 1, 3, 7, 17, 35, 23, 29, 335, 725, 453, 1051, 6019, 7595, 29451, 1853, 116615}}, {6319, 17, 4989, {1, 3, 3, 1, 3, 55, 73, 187, 213, 329, 997, 703, 5829, 7903, 1081, 33359, 119123}}, {6320, 17, 4994, {1, 3, 3, 15, 29, 55, 15, 17, 245, 117, 1735, 767, 4457, 8803, 17621, 26925, 72487}}, {6321, 17, 5000, {1, 3, 5, 3, 25, 7, 119, 139, 159, 199, 317, 3875, 8115, 7581, 29239, 50225, 48459}}, {6322, 17, 5005, {1, 3, 7, 11, 11, 41, 107, 225, 395, 545, 259, 2379, 6709, 11669, 14545, 43663, 69979}}, {6323, 17, 5014, {1, 3, 5, 13, 23, 45, 73, 137, 447, 305, 117, 2659, 7989, 233, 31991, 60495, 571}}, {6324, 17, 5018, {1, 3, 7, 9, 1, 37, 31, 1, 433, 701, 159, 3811, 4529, 6697, 7121, 31107, 61555}}, {6325, 17, 5023, {1, 3, 5, 5, 13, 21, 81, 63, 95, 741, 1189, 1567, 1223, 12371, 28435, 10537, 53785}}, {6326, 17, 5039, {1, 1, 1, 11, 17, 31, 67, 121, 281, 593, 561, 1759, 387, 9639, 28595, 22473, 4935}}, {6327, 17, 5053, {1, 3, 7, 3, 5, 43, 59, 151, 351, 263, 297, 423, 1681, 3785, 15171, 7145, 57531}}, {6328, 17, 5054, {1, 3, 7, 15, 9, 35, 105, 189, 261, 175, 1669, 1289, 5401, 12801, 19585, 48169, 93195}}, {6329, 17, 5061, {1, 1, 7, 1, 31, 41, 23, 237, 151, 549, 1079, 2933, 5509, 15593, 1791, 15757, 44607}}, {6330, 17, 5065, {1, 1, 1, 3, 29, 1, 59, 115, 13, 999, 1179, 3561, 2749, 10059, 12861, 6797, 11793}}, {6331, 17, 5080, {1, 3, 3, 7, 11, 5, 23, 217, 101, 775, 1497, 4047, 2427, 5117, 9683, 28895, 27557}}, {6332, 17, 5083, {1, 3, 7, 5, 31, 55, 99, 65, 55, 587, 1271, 2277, 7947, 12995, 13149, 4463, 37625}}, {6333, 17, 5107, {1, 1, 7, 11, 3, 63, 23, 191, 125, 365, 1153, 2657, 6763, 4557, 21643, 26885, 36753}}, {6334, 17, 5119, {1, 1, 1, 15, 25, 15, 111, 135, 507, 745, 1947, 2545, 4329, 14325, 8187, 52021, 63401}}, {6335, 17, 5146, {1, 1, 3, 3, 27, 25, 19, 211, 393, 467, 1015, 2495, 7135, 495, 10385, 26961, 49325}}, {6336, 17, 5151, {1, 1, 3, 5, 15, 35, 3, 203, 337, 337, 703, 1989, 6869, 6055, 21095, 4749, 125669}}, {6337, 17, 5152, {1, 1, 5, 1, 31, 39, 57, 101, 419, 717, 1489, 199, 5729, 3003, 2607, 64593, 11515}}, {6338, 17, 5155, {1, 3, 7, 13, 15, 3, 33, 61, 17, 433, 1097, 957, 5351, 3043, 3679, 44881, 126909}}, {6339, 17, 5169, {1, 1, 3, 11, 5, 1, 121, 175, 119, 367, 399, 2527, 2157, 2667, 31069, 24797, 119621}}, {6340, 17, 5170, {1, 3, 1, 7, 27, 47, 115, 229, 455, 775, 73, 837, 1181, 3457, 4057, 33907, 67151}}, {6341, 17, 5176, {1, 3, 3, 1, 7, 51, 71, 177, 463, 921, 393, 3137, 1225, 5709, 303, 20597, 77581}}, {6342, 17, 5179, {1, 3, 5, 3, 31, 1, 93, 53, 177, 433, 1471, 2191, 4471, 9211, 19397, 57727, 60367}}, {6343, 17, 5182, {1, 1, 3, 11, 29, 55, 121, 89, 67, 869, 1631, 2657, 7357, 7159, 22449, 16357, 20077}}, {6344, 17, 5189, {1, 3, 7, 15, 11, 39, 127, 63, 211, 359, 971, 1221, 1909, 9963, 7827, 60923, 98495}}, {6345, 17, 5193, {1, 1, 7, 9, 23, 47, 47, 85, 307, 471, 1287, 3825, 5451, 15151, 15647, 63043, 92443}}, {6346, 17, 5196, {1, 3, 7, 5, 19, 11, 11, 27, 307, 695, 99, 1037, 1997, 13673, 591, 8183, 82197}}, {6347, 17, 5204, {1, 3, 5, 5, 3, 53, 109, 227, 503, 855, 1269, 3903, 5049, 10647, 21751, 58707, 78311}}, {6348, 17, 5207, {1, 1, 3, 11, 31, 3, 51, 211, 285, 919, 487, 3393, 3463, 2271, 8053, 56791, 33763}}, {6349, 17, 5211, {1, 3, 3, 5, 21, 15, 5, 5, 327, 809, 915, 1365, 7323, 4247, 31603, 26261, 80389}}, {6350, 17, 5220, {1, 3, 7, 7, 15, 33, 31, 221, 291, 815, 1307, 929, 3249, 14573, 13613, 59509, 59741}}, {6351, 17, 5258, {1, 3, 7, 15, 19, 41, 61, 27, 353, 965, 1901, 87, 2669, 12757, 29723, 47165, 16521}}, {6352, 17, 5265, {1, 3, 5, 3, 11, 43, 97, 215, 361, 901, 1425, 4063, 5327, 14119, 457, 43145, 107401}}, {6353, 17, 5271, {1, 1, 3, 15, 19, 37, 101, 69, 131, 927, 897, 477, 7641, 4299, 21213, 26017, 123801}}, {6354, 17, 5277, {1, 3, 7, 7, 19, 5, 11, 51, 277, 985, 1071, 3437, 6595, 9547, 11855, 64249, 30957}}, {6355, 17, 5278, {1, 1, 7, 9, 21, 41, 89, 113, 61, 235, 685, 1419, 7619, 9863, 21221, 28685, 53409}}, {6356, 17, 5282, {1, 1, 1, 1, 27, 1, 19, 3, 473, 827, 269, 1659, 2621, 12347, 13359, 64687, 99293}}, {6357, 17, 5296, {1, 3, 7, 7, 29, 37, 61, 49, 215, 883, 625, 2671, 3743, 4517, 2075, 64865, 58611}}, {6358, 17, 5299, {1, 3, 3, 7, 15, 11, 35, 37, 255, 781, 613, 3587, 7643, 13081, 32467, 14427, 15235}}, {6359, 17, 5319, {1, 1, 1, 11, 31, 47, 107, 65, 489, 377, 425, 3453, 2901, 9999, 7687, 13311, 103947}}, {6360, 17, 5328, {1, 3, 3, 7, 9, 17, 7, 107, 33, 545, 407, 3335, 7563, 14315, 32725, 8483, 69093}}, {6361, 17, 5343, {1, 1, 1, 5, 17, 9, 87, 229, 417, 769, 423, 569, 7073, 8705, 24487, 63743, 69807}}, {6362, 17, 5353, {1, 3, 1, 9, 1, 29, 75, 25, 483, 259, 1941, 1533, 8147, 14127, 24087, 37475, 130961}}, {6363, 17, 5364, {1, 3, 3, 11, 15, 15, 51, 45, 215, 283, 1687, 185, 4521, 12205, 13041, 33283, 77007}}, {6364, 17, 5368, {1, 1, 3, 3, 5, 47, 107, 67, 325, 87, 1831, 2845, 1645, 1741, 10811, 8983, 58515}}, {6365, 17, 5379, {1, 3, 1, 13, 19, 17, 1, 151, 411, 915, 1739, 3781, 4939, 15767, 25897, 7205, 17285}}, {6366, 17, 5381, {1, 3, 5, 15, 19, 1, 125, 33, 321, 325, 639, 4013, 967, 4347, 19743, 13445, 61229}}, {6367, 17, 5399, {1, 3, 3, 13, 13, 37, 71, 85, 51, 775, 973, 739, 4341, 15707, 12221, 24321, 48073}}, {6368, 17, 5415, {1, 1, 7, 13, 15, 13, 9, 211, 331, 429, 1323, 3027, 1091, 13311, 289, 57789, 93261}}, {6369, 17, 5422, {1, 1, 1, 1, 27, 7, 13, 27, 67, 573, 455, 2353, 113, 11831, 9069, 4503, 89291}}, {6370, 17, 5441, {1, 1, 1, 7, 21, 63, 47, 39, 419, 991, 1623, 11, 3153, 12633, 9425, 65087, 44935}}, {6371, 17, 5451, {1, 3, 1, 7, 23, 11, 15, 11, 99, 543, 1739, 3955, 5883, 12469, 7529, 14177, 1945}}, {6372, 17, 5456, {1, 3, 1, 3, 5, 17, 31, 251, 387, 311, 725, 3827, 6835, 5065, 3141, 43441, 87955}}, {6373, 17, 5462, {1, 1, 1, 11, 25, 7, 75, 135, 67, 589, 889, 3429, 155, 9081, 28653, 8059, 57251}}, {6374, 17, 5490, {1, 3, 5, 15, 21, 15, 103, 149, 311, 407, 1391, 717, 1765, 14887, 14381, 37483, 29587}}, {6375, 17, 5495, {1, 3, 5, 5, 19, 31, 93, 5, 507, 193, 1735, 3841, 7895, 9853, 10317, 14867, 49529}}, {6376, 17, 5501, {1, 3, 7, 7, 19, 3, 99, 201, 479, 313, 693, 3435, 5453, 1157, 23127, 49005, 20167}}, {6377, 17, 5502, {1, 3, 7, 9, 15, 21, 123, 41, 19, 281, 1837, 2589, 1003, 1993, 18345, 10039, 89325}}, {6378, 17, 5505, {1, 3, 5, 1, 19, 21, 77, 151, 145, 951, 2017, 609, 5847, 4475, 12439, 6357, 108277}}, {6379, 17, 5512, {1, 1, 1, 9, 17, 21, 91, 91, 111, 951, 497, 1759, 503, 12787, 25117, 24323, 96447}}, {6380, 17, 5523, {1, 1, 3, 11, 13, 9, 73, 205, 329, 243, 1187, 829, 2821, 5563, 14391, 771, 116441}}, {6381, 17, 5529, {1, 1, 1, 1, 11, 57, 39, 221, 41, 521, 1541, 3515, 2367, 4179, 21039, 52943, 11627}}, {6382, 17, 5548, {1, 3, 3, 3, 23, 13, 103, 125, 67, 217, 863, 3755, 213, 12657, 31399, 3771, 54107}}, {6383, 17, 5551, {1, 3, 3, 7, 3, 9, 107, 217, 497, 935, 519, 3041, 323, 14895, 5695, 28789, 36085}}, {6384, 17, 5553, {1, 1, 5, 11, 23, 33, 81, 23, 167, 3, 1683, 2279, 5365, 847, 14717, 9689, 64481}}, {6385, 17, 5565, {1, 3, 1, 7, 1, 15, 107, 93, 429, 363, 1745, 1459, 5879, 8351, 17527, 44001, 70293}}, {6386, 17, 5568, {1, 3, 3, 9, 27, 55, 125, 211, 141, 827, 1239, 663, 4803, 11067, 32039, 28091, 56421}}, {6387, 17, 5577, {1, 3, 5, 5, 7, 13, 125, 231, 427, 483, 967, 549, 3105, 13919, 3017, 39207, 23253}}, {6388, 17, 5578, {1, 3, 7, 3, 21, 29, 79, 67, 39, 451, 157, 337, 3585, 3621, 9545, 31205, 63201}}, {6389, 17, 5583, {1, 3, 1, 1, 29, 25, 77, 57, 167, 899, 95, 2487, 3743, 5381, 3637, 56289, 39453}}, {6390, 17, 5585, {1, 1, 1, 9, 29, 19, 41, 97, 75, 199, 1709, 483, 4099, 3113, 10953, 20659, 109273}}, {6391, 17, 5588, {1, 3, 5, 15, 13, 9, 83, 43, 111, 789, 965, 4061, 1239, 14577, 10113, 26359, 52609}}, {6392, 17, 5613, {1, 3, 5, 5, 11, 39, 113, 31, 457, 119, 725, 831, 4143, 5675, 27431, 12431, 94977}}, {6393, 17, 5614, {1, 1, 3, 3, 25, 17, 93, 253, 307, 625, 143, 1061, 4415, 3563, 3313, 53527, 29537}}, {6394, 17, 5616, {1, 3, 5, 3, 29, 41, 43, 109, 147, 919, 1675, 465, 6101, 12251, 28915, 15397, 85233}}, {6395, 17, 5622, {1, 1, 1, 1, 31, 25, 59, 187, 439, 561, 559, 413, 1917, 9319, 27475, 49715, 32953}}, {6396, 17, 5631, {1, 1, 7, 13, 23, 31, 95, 231, 141, 207, 1373, 2173, 2905, 169, 23825, 55071, 6147}}, {6397, 17, 5637, {1, 1, 7, 13, 15, 39, 43, 117, 321, 297, 661, 2941, 7359, 11675, 15483, 24093, 7269}}, {6398, 17, 5638, {1, 3, 3, 13, 9, 59, 51, 49, 81, 563, 745, 1843, 295, 4689, 19847, 42137, 63197}}, {6399, 17, 5668, {1, 3, 1, 9, 5, 33, 21, 199, 509, 927, 1777, 1349, 3593, 1065, 24943, 55667, 73539}}, {6400, 17, 5675, {1, 3, 1, 11, 17, 15, 91, 21, 59, 587, 1207, 543, 6669, 10861, 24755, 1789, 91249}}, {6401, 17, 5683, {1, 3, 7, 15, 13, 47, 57, 147, 381, 1021, 921, 1347, 3847, 5969, 9075, 39081, 127241}}, {6402, 17, 5695, {1, 3, 3, 15, 19, 15, 1, 97, 203, 409, 1745, 1217, 2199, 7945, 24361, 41771, 123127}}, {6403, 17, 5703, {1, 3, 3, 5, 17, 17, 43, 255, 179, 717, 1993, 645, 6527, 1533, 32719, 27481, 122425}}, {6404, 17, 5710, {1, 3, 5, 9, 13, 59, 15, 157, 373, 937, 27, 3325, 2297, 89, 10861, 48615, 16083}}, {6405, 17, 5715, {1, 3, 1, 3, 19, 27, 109, 243, 189, 17, 99, 1879, 695, 11329, 12467, 6053, 41749}}, {6406, 17, 5727, {1, 1, 5, 5, 23, 41, 103, 69, 171, 917, 1303, 2101, 617, 10017, 26525, 11009, 66137}}, {6407, 17, 5738, {1, 1, 1, 9, 21, 45, 47, 171, 455, 257, 411, 4021, 6995, 12881, 4793, 51193, 60775}}, {6408, 17, 5752, {1, 3, 7, 5, 25, 31, 89, 53, 321, 593, 1795, 2435, 3833, 2767, 17241, 63373, 25457}}, {6409, 17, 5767, {1, 3, 1, 1, 3, 45, 19, 255, 179, 991, 1407, 3683, 1435, 6803, 12215, 12835, 2005}}, {6410, 17, 5773, {1, 3, 7, 3, 17, 5, 117, 251, 71, 983, 1391, 3499, 5119, 7257, 7325, 16565, 6321}}, {6411, 17, 5776, {1, 3, 5, 7, 5, 49, 47, 201, 297, 485, 1879, 2205, 4903, 13619, 22537, 5479, 121625}}, {6412, 17, 5781, {1, 1, 3, 5, 27, 27, 87, 61, 145, 943, 343, 1639, 6307, 4549, 20765, 33479, 113697}}, {6413, 17, 5791, {1, 1, 3, 9, 17, 5, 101, 129, 305, 653, 1901, 3901, 6361, 2369, 7449, 55259, 75215}}, {6414, 17, 5792, {1, 1, 7, 5, 31, 45, 117, 55, 335, 827, 1309, 2603, 2111, 11005, 14747, 56999, 97373}}, {6415, 17, 5795, {1, 1, 7, 11, 29, 29, 81, 175, 169, 453, 293, 2589, 1057, 15795, 32397, 65433, 79455}}, {6416, 17, 5798, {1, 1, 1, 5, 11, 7, 13, 249, 29, 407, 1289, 2385, 8113, 15327, 4029, 32005, 105901}}, {6417, 17, 5801, {1, 1, 5, 5, 7, 61, 103, 141, 109, 391, 631, 821, 1479, 14771, 25057, 1415, 8081}}, {6418, 17, 5810, {1, 3, 1, 1, 9, 37, 17, 231, 501, 745, 1695, 45, 7797, 2945, 5529, 34747, 39069}}, {6419, 17, 5812, {1, 1, 7, 9, 21, 59, 103, 103, 33, 875, 723, 3477, 4729, 7311, 29979, 60901, 72187}}, {6420, 17, 5836, {1, 3, 3, 3, 15, 63, 93, 237, 203, 635, 1189, 2035, 6499, 9943, 9133, 62977, 29657}}, {6421, 17, 5839, {1, 1, 1, 9, 3, 11, 63, 207, 95, 563, 775, 3009, 7125, 13141, 4489, 16343, 120951}}, {6422, 17, 5841, {1, 1, 3, 1, 21, 57, 15, 217, 185, 305, 463, 1597, 6529, 4989, 14011, 11265, 131031}}, {6423, 17, 5867, {1, 3, 5, 15, 17, 61, 35, 127, 411, 579, 1349, 615, 3293, 8475, 9773, 30635, 117639}}, {6424, 17, 5870, {1, 1, 7, 9, 11, 3, 55, 105, 305, 223, 1899, 2217, 1261, 9831, 23693, 3013, 30489}}, {6425, 17, 5877, {1, 3, 7, 15, 15, 29, 1, 99, 67, 293, 499, 1941, 5303, 1329, 24547, 14065, 7927}}, {6426, 17, 5881, {1, 1, 5, 11, 17, 55, 71, 49, 499, 435, 985, 2803, 6139, 1503, 24167, 47181, 102529}}, {6427, 17, 5899, {1, 3, 5, 1, 19, 53, 71, 17, 63, 469, 1871, 2051, 357, 11661, 5689, 36373, 13379}}, {6428, 17, 5914, {1, 1, 5, 1, 27, 47, 23, 247, 59, 381, 1895, 2453, 3665, 5487, 24081, 50501, 91659}}, {6429, 17, 5925, {1, 1, 5, 7, 29, 19, 3, 33, 83, 301, 133, 3603, 5133, 16171, 22905, 36271, 10405}}, {6430, 17, 5929, {1, 3, 7, 9, 11, 23, 57, 87, 9, 731, 631, 3703, 2593, 12851, 7115, 8801, 108919}}, {6431, 17, 5943, {1, 3, 3, 3, 23, 35, 33, 99, 343, 837, 231, 3921, 6975, 15093, 15049, 64623, 123523}}, {6432, 17, 5949, {1, 1, 7, 11, 15, 61, 113, 103, 501, 57, 1345, 3155, 2965, 4433, 10605, 43765, 42169}}, {6433, 17, 5962, {1, 1, 7, 13, 7, 53, 91, 121, 229, 127, 103, 833, 7829, 1571, 10847, 20861, 101155}}, {6434, 17, 5969, {1, 3, 7, 1, 9, 25, 71, 103, 37, 473, 1133, 1129, 1651, 6965, 6937, 16597, 20439}}, {6435, 17, 5976, {1, 1, 5, 9, 1, 9, 47, 131, 285, 967, 1869, 1075, 8127, 135, 15575, 38569, 123729}}, {6436, 17, 5988, {1, 1, 7, 9, 5, 31, 33, 227, 347, 41, 2025, 3755, 857, 7805, 13121, 38307, 125825}}, {6437, 17, 5997, {1, 3, 5, 7, 11, 11, 19, 55, 23, 627, 1477, 3093, 2779, 7653, 7165, 23053, 76123}}, {6438, 17, 6006, {1, 1, 3, 1, 3, 47, 83, 89, 177, 381, 1247, 141, 7051, 6443, 27369, 34323, 43063}}, {6439, 17, 6010, {1, 1, 7, 7, 13, 15, 55, 223, 351, 525, 1051, 3009, 5443, 11499, 8335, 37949, 69149}}, {6440, 17, 6016, {1, 1, 1, 3, 13, 61, 89, 33, 129, 921, 1905, 201, 3141, 5531, 135, 34103, 56883}}, {6441, 17, 6022, {1, 1, 5, 13, 17, 27, 13, 163, 169, 471, 1263, 1421, 7015, 7927, 21027, 58001, 26739}}, {6442, 17, 6026, {1, 1, 1, 15, 19, 49, 109, 207, 245, 49, 1271, 3635, 2561, 5091, 24415, 59195, 67701}}, {6443, 17, 6031, {1, 3, 5, 7, 27, 57, 99, 155, 461, 595, 1859, 1727, 857, 4993, 31733, 42141, 10035}}, {6444, 17, 6040, {1, 1, 1, 15, 11, 11, 85, 9, 251, 375, 155, 379, 7501, 12559, 32583, 36317, 4675}}, {6445, 17, 6043, {1, 1, 5, 13, 19, 57, 81, 69, 201, 293, 593, 3169, 4519, 9057, 16685, 12847, 123797}}, {6446, 17, 6050, {1, 3, 1, 5, 5, 1, 19, 243, 345, 661, 561, 3549, 2541, 5887, 25879, 41467, 72799}}, {6447, 17, 6059, {1, 1, 5, 13, 15, 51, 67, 61, 79, 89, 447, 1471, 4915, 10637, 10901, 48157, 103545}}, {6448, 17, 6079, {1, 3, 5, 13, 31, 25, 73, 129, 435, 659, 1851, 3595, 753, 7717, 10927, 30115, 109221}}, {6449, 17, 6099, {1, 1, 1, 3, 25, 3, 121, 43, 349, 205, 1209, 2671, 6445, 8755, 7171, 58631, 74319}}, {6450, 17, 6101, {1, 1, 3, 1, 11, 15, 83, 37, 483, 65, 759, 1835, 3883, 1693, 30051, 61077, 1187}}, {6451, 17, 6105, {1, 3, 7, 15, 29, 23, 85, 77, 139, 903, 1821, 943, 6453, 1523, 18539, 49039, 110787}}, {6452, 17, 6108, {1, 1, 7, 15, 15, 17, 69, 253, 507, 921, 523, 79, 747, 4011, 25795, 42029, 88309}}, {6453, 17, 6124, {1, 1, 7, 3, 25, 47, 119, 83, 313, 45, 985, 145, 205, 3407, 9013, 64517, 115811}}, {6454, 17, 6132, {1, 1, 7, 1, 29, 21, 9, 123, 97, 545, 1987, 2979, 6901, 12667, 23325, 63635, 70593}}, {6455, 17, 6145, {1, 3, 7, 3, 23, 45, 81, 255, 41, 29, 1493, 4065, 3201, 10479, 17193, 39999, 55493}}, {6456, 17, 6146, {1, 3, 1, 3, 9, 43, 43, 135, 235, 603, 481, 3139, 2729, 14759, 7269, 7995, 110351}}, {6457, 17, 6151, {1, 3, 1, 11, 17, 35, 113, 93, 417, 967, 755, 659, 3115, 16163, 22997, 38205, 126961}}, {6458, 17, 6152, {1, 1, 7, 11, 29, 57, 81, 235, 93, 869, 475, 825, 6269, 15819, 14977, 53057, 116021}}, {6459, 17, 6158, {1, 1, 7, 13, 5, 61, 5, 241, 245, 673, 1651, 3367, 2355, 713, 20107, 30133, 735}}, {6460, 17, 6160, {1, 1, 5, 9, 21, 3, 121, 241, 129, 703, 1435, 1943, 5087, 13123, 30023, 58287, 50377}}, {6461, 17, 6163, {1, 1, 1, 15, 23, 27, 67, 197, 123, 629, 169, 3303, 1679, 11051, 16875, 28055, 12379}}, {6462, 17, 6165, {1, 1, 3, 3, 7, 63, 97, 43, 89, 739, 779, 2893, 7763, 6351, 26135, 44647, 127987}}, {6463, 17, 6170, {1, 3, 3, 9, 31, 59, 95, 131, 131, 321, 1125, 127, 4865, 145, 26237, 47871, 114549}}, {6464, 17, 6182, {1, 3, 3, 13, 21, 3, 33, 17, 445, 693, 1599, 2517, 1679, 2237, 15053, 30983, 106755}}, {6465, 17, 6196, {1, 1, 5, 13, 31, 37, 49, 67, 403, 27, 575, 1795, 3385, 1067, 585, 60277, 123189}}, {6466, 17, 6199, {1, 3, 1, 15, 13, 35, 23, 247, 493, 305, 363, 451, 4011, 3679, 18281, 31751, 127933}}, {6467, 17, 6200, {1, 1, 7, 5, 21, 45, 123, 253, 469, 267, 985, 2349, 3427, 7653, 25685, 13747, 531}}, {6468, 17, 6205, {1, 1, 5, 11, 7, 59, 105, 209, 27, 847, 593, 3775, 6165, 1655, 29867, 28465, 92193}}, {6469, 17, 6226, {1, 3, 1, 11, 7, 25, 101, 81, 233, 311, 9, 2735, 3951, 485, 10105, 24489, 649}}, {6470, 17, 6228, {1, 3, 1, 7, 27, 5, 115, 243, 295, 659, 215, 1787, 5131, 2513, 29201, 21195, 103383}}, {6471, 17, 6237, {1, 3, 5, 13, 29, 21, 7, 57, 345, 467, 1297, 207, 5115, 335, 6153, 32959, 125697}}, {6472, 17, 6247, {1, 1, 1, 9, 3, 63, 63, 5, 373, 123, 1265, 2365, 1623, 1561, 14805, 17487, 104787}}, {6473, 17, 6251, {1, 3, 1, 5, 15, 13, 55, 69, 251, 341, 463, 2611, 4793, 12157, 4669, 11613, 128705}}, {6474, 17, 6253, {1, 3, 7, 13, 19, 7, 93, 149, 453, 693, 1731, 861, 6971, 943, 18891, 56547, 34411}}, {6475, 17, 6256, {1, 1, 7, 1, 27, 49, 27, 9, 281, 121, 581, 393, 2583, 1159, 26989, 39955, 100765}}, {6476, 17, 6268, {1, 1, 3, 9, 3, 43, 97, 207, 311, 617, 1987, 2559, 2101, 15791, 30085, 40713, 41909}}, {6477, 17, 6272, {1, 3, 1, 3, 15, 19, 53, 183, 375, 867, 397, 3203, 4207, 5381, 25065, 60357, 88739}}, {6478, 17, 6275, {1, 3, 3, 3, 27, 51, 85, 231, 19, 559, 567, 4049, 4875, 14201, 11623, 39763, 57339}}, {6479, 17, 6281, {1, 1, 5, 1, 19, 7, 81, 249, 41, 789, 985, 3725, 4053, 4255, 9861, 1609, 29511}}, {6480, 17, 6289, {1, 3, 5, 5, 21, 13, 49, 41, 367, 283, 1161, 2753, 4733, 3691, 27931, 53055, 83625}}, {6481, 17, 6335, {1, 3, 5, 11, 29, 47, 95, 51, 265, 85, 385, 833, 7957, 14985, 7017, 41937, 41377}}, {6482, 17, 6338, {1, 1, 7, 5, 1, 23, 17, 191, 185, 323, 515, 3183, 7685, 7361, 21143, 5227, 110297}}, {6483, 17, 6355, {1, 3, 3, 7, 11, 39, 31, 97, 237, 497, 1649, 3529, 6153, 5055, 29021, 35125, 121581}}, {6484, 17, 6362, {1, 3, 5, 3, 17, 47, 105, 75, 55, 343, 595, 2447, 5575, 10673, 32015, 37541, 127867}}, {6485, 17, 6373, {1, 3, 1, 7, 19, 39, 31, 135, 167, 979, 219, 1353, 489, 9667, 27107, 55565, 72291}}, {6486, 17, 6386, {1, 1, 3, 13, 31, 49, 87, 93, 235, 577, 1551, 2663, 387, 1129, 26683, 31285, 15913}}, {6487, 17, 6388, {1, 3, 3, 7, 15, 29, 61, 33, 115, 511, 1781, 2029, 4265, 6745, 1467, 34415, 40907}}, {6488, 17, 6391, {1, 1, 7, 5, 1, 55, 13, 129, 167, 937, 79, 2047, 3589, 1979, 4153, 15229, 85745}}, {6489, 17, 6397, {1, 1, 7, 15, 15, 25, 89, 129, 31, 435, 1359, 49, 2659, 2829, 8741, 25215, 4239}}, {6490, 17, 6405, {1, 3, 5, 3, 11, 39, 95, 239, 187, 615, 1481, 3509, 1133, 13497, 24833, 59635, 45695}}, {6491, 17, 6406, {1, 1, 5, 3, 19, 17, 17, 235, 315, 943, 883, 1381, 7129, 15709, 9847, 41183, 116071}}, {6492, 17, 6410, {1, 1, 1, 3, 9, 63, 109, 209, 309, 1015, 1391, 2617, 1481, 6483, 4151, 28063, 49887}}, {6493, 17, 6417, {1, 1, 5, 13, 23, 37, 31, 89, 501, 461, 41, 931, 7863, 15499, 25635, 16995, 41651}}, {6494, 17, 6443, {1, 1, 1, 9, 29, 29, 125, 161, 219, 439, 1465, 1615, 7483, 7497, 1121, 49693, 30269}}, {6495, 17, 6457, {1, 3, 1, 5, 7, 43, 27, 161, 431, 375, 419, 2995, 527, 8207, 747, 18491, 15351}}, {6496, 17, 6468, {1, 1, 3, 13, 25, 21, 67, 177, 9, 453, 1171, 65, 2845, 16147, 12699, 30905, 122255}}, {6497, 17, 6475, {1, 3, 1, 5, 29, 47, 77, 251, 473, 385, 947, 3239, 5375, 13617, 10639, 36005, 95821}}, {6498, 17, 6486, {1, 3, 1, 15, 13, 1, 75, 223, 509, 19, 175, 1541, 637, 5711, 1097, 44901, 35277}}, {6499, 17, 6489, {1, 3, 3, 7, 3, 27, 17, 151, 39, 583, 391, 2739, 7339, 2051, 17005, 49573, 85969}}, {6500, 17, 6495, {1, 3, 1, 11, 3, 25, 119, 125, 17, 629, 201, 2347, 2923, 1273, 14871, 58299, 97667}}, {6501, 17, 6499, {1, 1, 7, 1, 31, 39, 11, 121, 339, 667, 1863, 3479, 1895, 11319, 5683, 64969, 9261}}, {6502, 17, 6505, {1, 1, 5, 9, 27, 61, 101, 221, 221, 583, 287, 707, 5931, 4225, 29537, 46097, 114361}}, {6503, 17, 6511, {1, 1, 1, 9, 23, 47, 1, 35, 85, 1021, 151, 3153, 3867, 971, 31573, 4745, 107639}}, {6504, 17, 6520, {1, 1, 7, 13, 15, 15, 63, 37, 291, 907, 411, 1571, 6415, 7443, 26635, 27945, 130909}}, {6505, 17, 6529, {1, 3, 1, 9, 21, 13, 77, 147, 485, 107, 235, 481, 2389, 957, 11493, 53033, 46373}}, {6506, 17, 6542, {1, 3, 5, 7, 3, 55, 125, 237, 205, 411, 1911, 4053, 5983, 15489, 29333, 44727, 62167}}, {6507, 17, 6547, {1, 1, 3, 3, 17, 3, 59, 239, 209, 495, 447, 3427, 3425, 2347, 10057, 26147, 52243}}, {6508, 17, 6550, {1, 1, 3, 1, 11, 31, 3, 139, 441, 997, 295, 1267, 2181, 6047, 32419, 62657, 24921}}, {6509, 17, 6554, {1, 3, 7, 15, 5, 3, 11, 9, 211, 701, 1987, 2611, 6195, 14379, 22919, 15785, 52149}}, {6510, 17, 6556, {1, 1, 7, 9, 7, 27, 35, 253, 343, 679, 103, 1217, 3983, 8677, 17671, 41347, 89355}}, {6511, 17, 6560, {1, 1, 1, 5, 7, 55, 111, 115, 231, 999, 773, 2111, 3617, 2469, 16967, 60735, 24557}}, {6512, 17, 6569, {1, 3, 5, 1, 29, 5, 77, 217, 131, 307, 473, 3595, 2713, 6503, 18459, 57245, 91897}}, {6513, 17, 6572, {1, 3, 5, 13, 9, 33, 93, 31, 59, 343, 1337, 1971, 7593, 15629, 22693, 19885, 4139}}, {6514, 17, 6590, {1, 3, 3, 3, 21, 33, 115, 205, 373, 587, 739, 669, 8065, 5339, 16507, 29455, 15863}}, {6515, 17, 6592, {1, 3, 5, 11, 9, 43, 45, 41, 91, 87, 19, 1523, 5059, 9403, 6739, 36893, 6395}}, {6516, 17, 6601, {1, 1, 5, 15, 19, 43, 81, 3, 401, 621, 1839, 1443, 179, 8085, 27021, 7757, 95011}}, {6517, 17, 6610, {1, 3, 5, 15, 19, 21, 45, 167, 77, 977, 309, 431, 3437, 8327, 12895, 50521, 68473}}, {6518, 17, 6632, {1, 3, 3, 15, 7, 21, 49, 169, 327, 271, 7, 785, 1767, 14747, 7083, 65223, 24213}}, {6519, 17, 6635, {1, 1, 5, 9, 9, 51, 101, 197, 507, 839, 1413, 3131, 331, 15725, 32293, 60433, 86759}}, {6520, 17, 6640, {1, 1, 7, 1, 17, 39, 127, 201, 341, 607, 1565, 1615, 1367, 16043, 28265, 29139, 63813}}, {6521, 17, 6643, {1, 3, 5, 7, 9, 1, 107, 73, 121, 649, 1385, 3203, 2897, 8479, 28519, 34041, 1359}}, {6522, 17, 6649, {1, 1, 7, 7, 21, 55, 19, 13, 415, 647, 2015, 107, 4167, 5033, 16849, 41407, 94387}}, {6523, 17, 6659, {1, 3, 5, 13, 31, 27, 107, 95, 425, 679, 55, 3521, 6737, 11459, 19995, 64189, 44323}}, {6524, 17, 6662, {1, 1, 3, 9, 17, 47, 29, 167, 17, 63, 5, 2505, 6483, 14089, 7127, 7907, 68555}}, {6525, 17, 6666, {1, 1, 5, 3, 29, 3, 87, 107, 227, 893, 1821, 341, 5481, 13317, 10637, 8611, 28625}}, {6526, 17, 6690, {1, 1, 1, 13, 11, 19, 59, 157, 397, 103, 1821, 3913, 3083, 6053, 1015, 25475, 94813}}, {6527, 17, 6692, {1, 3, 1, 3, 15, 45, 1, 209, 335, 1015, 539, 2959, 1711, 2567, 30169, 147, 25383}}, {6528, 17, 6704, {1, 3, 7, 1, 17, 5, 99, 121, 91, 531, 865, 1667, 5615, 4729, 7473, 21445, 37925}}, {6529, 17, 6713, {1, 1, 7, 13, 3, 51, 27, 115, 439, 761, 1121, 1503, 3047, 2127, 29253, 48147, 10813}}, {6530, 17, 6728, {1, 3, 7, 15, 1, 51, 33, 161, 509, 159, 1705, 3365, 7953, 14027, 3873, 29609, 33101}}, {6531, 17, 6731, {1, 1, 5, 15, 15, 53, 119, 115, 433, 75, 497, 1259, 1681, 7715, 24767, 34647, 82007}}, {6532, 17, 6734, {1, 1, 5, 3, 27, 63, 41, 181, 393, 439, 95, 2765, 7617, 817, 1311, 18595, 16921}}, {6533, 17, 6746, {1, 3, 1, 15, 31, 7, 57, 89, 371, 745, 475, 3211, 6893, 10681, 18547, 28373, 127787}}, {6534, 17, 6755, {1, 3, 5, 13, 5, 55, 45, 167, 147, 833, 765, 1153, 4037, 8503, 10751, 49541, 77489}}, {6535, 17, 6757, {1, 3, 1, 11, 11, 7, 45, 167, 431, 759, 1035, 1367, 1649, 11711, 4915, 58915, 72479}}, {6536, 17, 6764, {1, 1, 5, 1, 11, 3, 15, 135, 427, 637, 879, 1667, 6139, 14759, 25665, 13083, 67961}}, {6537, 17, 6772, {1, 3, 3, 9, 1, 3, 73, 167, 269, 51, 1481, 3659, 7863, 7187, 3951, 10711, 5909}}, {6538, 17, 6792, {1, 1, 3, 3, 9, 53, 101, 209, 109, 691, 1641, 919, 1083, 6247, 23041, 44681, 130105}}, {6539, 17, 6797, {1, 3, 7, 5, 21, 55, 127, 9, 437, 225, 1599, 2575, 5407, 8099, 20009, 40339, 110581}}, {6540, 17, 6821, {1, 3, 3, 13, 7, 41, 15, 137, 363, 337, 995, 1215, 3651, 11011, 27209, 53927, 78065}}, {6541, 17, 6822, {1, 1, 1, 7, 11, 17, 27, 9, 481, 79, 905, 1297, 811, 10221, 463, 12979, 114731}}, {6542, 17, 6831, {1, 1, 3, 13, 7, 59, 105, 79, 253, 699, 139, 3823, 4939, 12955, 32069, 7255, 18159}}, {6543, 17, 6834, {1, 3, 5, 7, 29, 7, 79, 79, 147, 921, 425, 1423, 5967, 6397, 17393, 30009, 84075}}, {6544, 17, 6851, {1, 3, 7, 13, 23, 45, 51, 141, 237, 443, 1101, 309, 4533, 7479, 22415, 31517, 120407}}, {6545, 17, 6858, {1, 1, 5, 13, 3, 19, 97, 185, 59, 179, 1343, 2537, 3165, 16295, 25005, 49769, 78007}}, {6546, 17, 6860, {1, 3, 7, 15, 11, 53, 127, 195, 309, 121, 1741, 1415, 225, 15645, 16365, 38729, 70061}}, {6547, 17, 6871, {1, 3, 7, 11, 29, 35, 47, 109, 179, 3, 849, 2305, 3035, 15289, 31569, 28851, 90057}}, {6548, 17, 6875, {1, 1, 7, 1, 13, 27, 93, 119, 439, 45, 623, 1263, 6595, 6669, 12981, 64721, 130109}}, {6549, 17, 6884, {1, 1, 7, 13, 5, 43, 43, 99, 395, 417, 795, 3991, 5601, 13115, 12803, 52247, 39245}}, {6550, 17, 6888, {1, 3, 3, 3, 15, 61, 85, 91, 407, 391, 359, 3885, 1925, 4873, 169, 41727, 129471}}, {6551, 17, 6894, {1, 3, 3, 9, 11, 47, 3, 33, 355, 853, 1329, 1347, 1995, 8197, 10015, 787, 66773}}, {6552, 17, 6919, {1, 3, 3, 13, 31, 31, 49, 195, 55, 185, 1743, 3523, 1781, 8469, 7623, 55933, 74953}}, {6553, 17, 6940, {1, 3, 5, 15, 29, 31, 5, 45, 149, 71, 2033, 3171, 4601, 9941, 15005, 55709, 74403}}, {6554, 17, 6950, {1, 3, 5, 3, 1, 27, 105, 7, 139, 805, 1877, 915, 1843, 11897, 29485, 19275, 44711}}, {6555, 17, 6959, {1, 1, 5, 7, 25, 57, 111, 57, 401, 935, 1685, 2985, 2015, 13501, 14581, 53579, 117011}}, {6556, 17, 6968, {1, 1, 5, 11, 13, 47, 63, 137, 145, 77, 1727, 2629, 7377, 6311, 537, 13703, 129503}}, {6557, 17, 6981, {1, 1, 7, 9, 5, 49, 67, 51, 163, 989, 845, 7, 2141, 14467, 3197, 57581, 121087}}, {6558, 17, 6988, {1, 1, 5, 3, 31, 49, 57, 103, 171, 491, 1109, 1255, 4353, 11927, 29525, 16685, 48469}}, {6559, 17, 6996, {1, 1, 1, 3, 7, 29, 17, 111, 339, 747, 763, 179, 7747, 2483, 18415, 45301, 25155}}, {6560, 17, 6999, {1, 1, 7, 7, 1, 41, 71, 109, 401, 815, 1311, 3933, 1349, 13327, 20847, 44391, 49721}}, {6561, 17, 7015, {1, 1, 1, 15, 27, 57, 39, 129, 391, 701, 619, 3925, 701, 403, 11821, 30517, 22035}}, {6562, 17, 7019, {1, 1, 5, 11, 21, 49, 109, 101, 497, 417, 73, 2727, 2899, 2777, 22161, 35561, 70211}}, {6563, 17, 7022, {1, 1, 3, 3, 15, 43, 1, 159, 41, 833, 55, 2415, 5009, 9663, 31295, 29397, 3187}}, {6564, 17, 7040, {1, 1, 3, 7, 27, 5, 113, 187, 453, 753, 1649, 1605, 2405, 11791, 4239, 20915, 54033}}, {6565, 17, 7045, {1, 3, 1, 11, 1, 57, 49, 229, 283, 113, 345, 785, 8009, 11977, 30169, 63787, 32011}}, {6566, 17, 7049, {1, 1, 7, 3, 5, 59, 57, 91, 327, 685, 219, 1949, 3095, 8389, 2035, 11903, 73461}}, {6567, 17, 7055, {1, 1, 3, 3, 19, 59, 19, 37, 453, 1, 1811, 3263, 1807, 16147, 24861, 14003, 31747}}, {6568, 17, 7073, {1, 1, 3, 11, 1, 53, 93, 203, 429, 629, 1931, 1487, 3301, 8805, 4901, 2459, 98555}}, {6569, 17, 7076, {1, 1, 7, 5, 21, 5, 37, 135, 159, 749, 1589, 2631, 8145, 7279, 28397, 47113, 82309}}, {6570, 17, 7085, {1, 1, 5, 15, 25, 61, 19, 51, 217, 495, 109, 1179, 2743, 12107, 12509, 13003, 94375}}, {6571, 17, 7091, {1, 3, 3, 15, 11, 7, 67, 165, 57, 925, 427, 2549, 7189, 5917, 13113, 30933, 62703}}, {6572, 17, 7103, {1, 1, 5, 5, 9, 5, 43, 5, 485, 159, 757, 3979, 4963, 3389, 29731, 48477, 113429}}, {6573, 17, 7112, {1, 3, 5, 1, 5, 5, 81, 163, 493, 357, 2005, 1093, 5951, 1045, 10569, 40321, 56881}}, {6574, 17, 7117, {1, 3, 1, 5, 7, 29, 11, 7, 7, 13, 1641, 1031, 4025, 16337, 24333, 9589, 37779}}, {6575, 17, 7118, {1, 3, 5, 11, 15, 3, 69, 19, 141, 79, 749, 391, 4505, 6939, 3079, 3647, 22363}}, {6576, 17, 7123, {1, 3, 3, 3, 29, 3, 7, 189, 183, 513, 1225, 239, 4203, 9197, 23507, 33089, 124433}}, {6577, 17, 7126, {1, 3, 3, 13, 27, 37, 81, 221, 287, 891, 1197, 3501, 539, 2053, 20509, 48635, 50269}}, {6578, 17, 7154, {1, 1, 5, 7, 13, 3, 35, 79, 3, 885, 343, 3527, 1043, 7197, 6973, 8515, 39315}}, {6579, 17, 7180, {1, 3, 3, 9, 21, 53, 79, 225, 229, 759, 457, 293, 953, 12857, 20483, 3677, 93839}}, {6580, 17, 7192, {1, 3, 5, 3, 5, 17, 45, 107, 153, 279, 761, 1923, 7013, 2989, 10137, 19107, 126897}}, {6581, 17, 7195, {1, 3, 1, 3, 23, 53, 91, 1, 133, 729, 13, 2017, 6933, 7405, 1255, 49509, 105571}}, {6582, 17, 7207, {1, 3, 5, 1, 9, 45, 35, 153, 209, 289, 1779, 2557, 315, 981, 15347, 30391, 16027}}, {6583, 17, 7208, {1, 3, 3, 5, 17, 3, 51, 105, 263, 959, 1255, 1177, 8143, 10541, 7687, 38731, 93561}}, {6584, 17, 7214, {1, 1, 1, 13, 19, 1, 15, 135, 447, 847, 663, 3893, 3539, 6833, 13265, 62923, 8375}}, {6585, 17, 7222, {1, 3, 1, 15, 31, 11, 105, 1, 91, 523, 1583, 3493, 2665, 117, 10757, 29845, 127201}}, {6586, 17, 7234, {1, 1, 1, 3, 29, 49, 9, 103, 309, 605, 1751, 1981, 833, 3653, 14001, 16545, 58513}}, {6587, 17, 7254, {1, 1, 5, 9, 1, 19, 117, 71, 237, 765, 249, 1983, 2289, 6019, 26505, 31427, 64333}}, {6588, 17, 7258, {1, 1, 3, 11, 15, 31, 5, 207, 347, 143, 11, 1987, 3569, 2051, 31051, 22193, 93289}}, {6589, 17, 7264, {1, 1, 3, 5, 13, 15, 5, 73, 457, 611, 673, 2675, 8071, 13245, 19443, 14399, 99599}}, {6590, 17, 7279, {1, 1, 1, 9, 11, 5, 103, 231, 31, 457, 1031, 2257, 3159, 8323, 31585, 26163, 45159}}, {6591, 17, 7282, {1, 3, 1, 11, 29, 51, 29, 7, 89, 331, 783, 951, 6353, 15421, 12801, 8337, 119171}}, {6592, 17, 7293, {1, 1, 3, 13, 23, 57, 63, 43, 505, 1, 657, 4005, 6327, 7545, 15455, 27097, 53649}}, {6593, 17, 7297, {1, 1, 1, 5, 31, 7, 51, 107, 175, 461, 1893, 305, 157, 4819, 18549, 33087, 9499}}, {6594, 17, 7322, {1, 3, 1, 3, 19, 45, 37, 9, 459, 143, 1327, 3611, 1899, 15109, 30151, 17911, 13233}}, {6595, 17, 7324, {1, 1, 5, 15, 19, 49, 11, 227, 375, 661, 665, 259, 3659, 13723, 28239, 48159, 59209}}, {6596, 17, 7351, {1, 3, 7, 7, 17, 49, 77, 161, 505, 713, 1521, 935, 3629, 5033, 26717, 47199, 3693}}, {6597, 17, 7363, {1, 3, 5, 9, 17, 61, 1, 201, 259, 179, 1637, 2485, 4995, 2813, 19923, 43739, 32183}}, {6598, 17, 7380, {1, 1, 3, 5, 1, 23, 125, 61, 225, 703, 2011, 1013, 6651, 14029, 27375, 23301, 80269}}, {6599, 17, 7384, {1, 1, 3, 9, 11, 57, 37, 49, 321, 443, 1055, 1989, 4755, 8467, 22001, 18647, 112617}}, {6600, 17, 7389, {1, 3, 1, 5, 5, 39, 21, 139, 101, 583, 1881, 2599, 4185, 15679, 22215, 19093, 76737}}, {6601, 17, 7396, {1, 3, 1, 11, 31, 51, 85, 91, 159, 421, 2005, 1075, 7757, 12653, 25489, 3545, 62961}}, {6602, 17, 7413, {1, 1, 1, 15, 27, 57, 75, 151, 357, 571, 395, 299, 5607, 12865, 2149, 21059, 120753}}, {6603, 17, 7417, {1, 1, 1, 3, 15, 57, 63, 171, 265, 709, 1089, 677, 7243, 10207, 9789, 38431, 130415}}, {6604, 17, 7431, {1, 3, 7, 5, 21, 9, 73, 149, 197, 773, 773, 3931, 4135, 5671, 2733, 57173, 90693}}, {6605, 17, 7443, {1, 1, 5, 1, 23, 1, 47, 201, 33, 167, 1643, 4009, 2687, 5725, 28733, 27859, 55163}}, {6606, 17, 7445, {1, 1, 5, 15, 25, 11, 57, 139, 471, 625, 1067, 3647, 6213, 15605, 23537, 5005, 32593}}, {6607, 17, 7450, {1, 3, 1, 11, 17, 11, 25, 163, 199, 21, 1775, 3721, 2845, 15769, 2381, 27643, 19909}}, {6608, 17, 7456, {1, 3, 5, 5, 21, 41, 23, 125, 401, 483, 535, 925, 7065, 1727, 3761, 8485, 3519}}, {6609, 17, 7466, {1, 1, 3, 15, 27, 31, 11, 7, 93, 237, 611, 3635, 4747, 9751, 20607, 20473, 73935}}, {6610, 17, 7468, {1, 1, 7, 3, 15, 19, 69, 169, 387, 291, 1981, 635, 3387, 15817, 20357, 47537, 107311}}, {6611, 17, 7474, {1, 3, 7, 15, 13, 59, 31, 235, 399, 343, 1265, 2975, 6839, 13335, 5397, 58915, 31313}}, {6612, 17, 7479, {1, 1, 7, 1, 3, 35, 81, 243, 387, 421, 1533, 799, 2615, 13219, 9041, 26967, 22677}}, {6613, 17, 7486, {1, 1, 7, 15, 17, 41, 89, 115, 67, 569, 1647, 1831, 5533, 4629, 1413, 20037, 97343}}, {6614, 17, 7497, {1, 1, 5, 1, 23, 41, 11, 149, 319, 377, 439, 1237, 4819, 14303, 14657, 61711, 129235}}, {6615, 17, 7508, {1, 3, 3, 7, 9, 11, 79, 219, 249, 607, 1453, 2931, 3407, 13725, 28289, 42869, 96759}}, {6616, 17, 7515, {1, 1, 5, 11, 7, 9, 101, 51, 11, 893, 697, 1221, 4237, 1873, 11191, 25517, 119861}}, {6617, 17, 7533, {1, 1, 3, 11, 23, 23, 19, 245, 485, 317, 1945, 2339, 193, 9389, 30709, 33927, 95089}}, {6618, 17, 7542, {1, 1, 3, 1, 27, 55, 5, 81, 63, 185, 223, 3639, 6093, 10053, 1793, 11885, 29307}}, {6619, 17, 7546, {1, 1, 7, 13, 15, 41, 33, 133, 467, 457, 213, 3687, 1313, 2555, 19487, 44257, 108667}}, {6620, 17, 7551, {1, 1, 3, 5, 31, 51, 53, 115, 449, 273, 1043, 2743, 1759, 2013, 28171, 57091, 76837}}, {6621, 17, 7569, {1, 1, 5, 15, 21, 43, 11, 215, 151, 253, 913, 1889, 2799, 13787, 3869, 54413, 50991}}, {6622, 17, 7572, {1, 1, 3, 13, 29, 19, 81, 123, 461, 203, 81, 555, 6601, 15689, 12637, 41467, 105343}}, {6623, 17, 7595, {1, 1, 3, 13, 7, 21, 75, 111, 47, 481, 1519, 3299, 6199, 3501, 31323, 29215, 45607}}, {6624, 17, 7603, {1, 3, 1, 3, 17, 51, 45, 223, 321, 233, 267, 3333, 3803, 3099, 4601, 29061, 88441}}, {6625, 17, 7605, {1, 1, 5, 13, 23, 27, 7, 57, 273, 893, 773, 239, 6357, 15875, 5497, 21775, 108291}}, {6626, 17, 7629, {1, 3, 1, 15, 25, 17, 11, 229, 175, 909, 691, 3507, 5247, 2933, 1741, 35059, 62841}}, {6627, 17, 7632, {1, 3, 5, 1, 29, 7, 11, 69, 345, 87, 99, 3243, 5669, 11053, 1185, 6979, 117069}}, {6628, 17, 7638, {1, 3, 5, 11, 13, 33, 23, 183, 89, 475, 643, 2773, 7899, 15219, 133, 5073, 129355}}, {6629, 17, 7648, {1, 3, 7, 9, 23, 17, 31, 53, 455, 193, 1695, 2557, 1645, 12675, 27857, 50447, 121335}}, {6630, 17, 7654, {1, 1, 3, 11, 15, 19, 41, 57, 305, 235, 1131, 1165, 1857, 13667, 19285, 29755, 118885}}, {6631, 17, 7663, {1, 3, 7, 3, 9, 43, 107, 3, 275, 673, 677, 3769, 3097, 5497, 24911, 4617, 80505}}, {6632, 17, 7675, {1, 1, 7, 9, 21, 39, 107, 155, 471, 753, 579, 2929, 4951, 4245, 25035, 41795, 86955}}, {6633, 17, 7693, {1, 3, 1, 7, 31, 51, 27, 165, 147, 751, 709, 399, 45, 947, 9893, 32721, 122127}}, {6634, 17, 7705, {1, 3, 3, 1, 31, 31, 73, 59, 351, 293, 845, 3139, 4177, 3537, 9465, 20689, 65837}}, {6635, 17, 7717, {1, 3, 5, 9, 27, 29, 13, 115, 417, 435, 465, 1291, 5225, 11687, 29207, 39895, 55443}}, {6636, 17, 7724, {1, 3, 3, 15, 29, 49, 111, 179, 221, 565, 787, 1811, 4055, 7863, 27273, 32975, 26985}}, {6637, 17, 7727, {1, 1, 1, 7, 15, 49, 121, 145, 277, 27, 149, 965, 4903, 3497, 32333, 37217, 105073}}, {6638, 17, 7735, {1, 1, 7, 1, 23, 29, 31, 77, 353, 349, 755, 2081, 4291, 567, 641, 41751, 20397}}, {6639, 17, 7761, {1, 1, 5, 3, 25, 31, 97, 3, 405, 607, 965, 2981, 3217, 14695, 25977, 22457, 113539}}, {6640, 17, 7767, {1, 3, 3, 15, 25, 3, 91, 125, 269, 825, 1163, 2181, 4247, 6813, 4699, 35091, 87771}}, {6641, 17, 7783, {1, 1, 5, 9, 25, 23, 113, 145, 71, 31, 1115, 3729, 6793, 11869, 26509, 18779, 99499}}, {6642, 17, 7784, {1, 1, 1, 9, 31, 51, 77, 217, 247, 599, 1541, 3217, 1383, 5203, 27971, 23647, 71823}}, {6643, 17, 7798, {1, 1, 5, 7, 17, 35, 113, 73, 475, 511, 35, 1961, 5311, 2257, 1935, 58963, 94349}}, {6644, 17, 7802, {1, 3, 1, 7, 27, 31, 67, 253, 95, 883, 1213, 855, 3429, 15049, 26715, 56099, 101797}}, {6645, 17, 7811, {1, 1, 3, 5, 9, 9, 61, 57, 511, 537, 1803, 949, 1327, 3921, 11297, 13807, 64629}}, {6646, 17, 7817, {1, 1, 5, 1, 31, 57, 105, 161, 309, 283, 1291, 2737, 7141, 7497, 25893, 14453, 35375}}, {6647, 17, 7823, {1, 1, 3, 1, 21, 3, 77, 37, 13, 211, 1863, 1895, 8035, 5801, 25981, 12317, 48375}}, {6648, 17, 7832, {1, 3, 7, 7, 25, 45, 13, 77, 185, 553, 1501, 1349, 5951, 15581, 32657, 18467, 128363}}, {6649, 17, 7837, {1, 3, 5, 9, 23, 63, 105, 239, 213, 935, 1331, 3653, 2775, 6591, 6067, 34597, 19217}}, {6650, 17, 7842, {1, 3, 7, 13, 15, 19, 79, 91, 391, 637, 1685, 2263, 3507, 2025, 2111, 15875, 14831}}, {6651, 17, 7853, {1, 3, 3, 5, 7, 29, 81, 69, 511, 399, 343, 737, 2833, 1021, 10471, 18689, 36181}}, {6652, 17, 7854, {1, 1, 5, 11, 21, 17, 39, 137, 145, 857, 583, 789, 8057, 15995, 32113, 64163, 37153}}, {6653, 17, 7856, {1, 3, 3, 11, 9, 61, 87, 131, 487, 667, 1295, 493, 4629, 7719, 18157, 49715, 2051}}, {6654, 17, 7861, {1, 3, 5, 9, 19, 5, 85, 3, 491, 353, 571, 2829, 4411, 343, 24781, 62325, 123959}}, {6655, 17, 7862, {1, 1, 7, 13, 13, 39, 11, 31, 413, 285, 27, 2433, 3307, 6165, 26565, 40065, 102655}}, {6656, 17, 7873, {1, 1, 5, 11, 25, 45, 7, 97, 9, 973, 1833, 2537, 1457, 7389, 24087, 38061, 122805}}, {6657, 17, 7874, {1, 3, 5, 3, 21, 63, 77, 21, 249, 525, 1145, 1421, 8011, 3357, 15051, 30293, 127017}}, {6658, 17, 7886, {1, 1, 5, 3, 13, 53, 81, 185, 303, 307, 1579, 841, 2277, 607, 10899, 34209, 215}}, {6659, 17, 7914, {1, 3, 3, 13, 17, 1, 125, 145, 205, 763, 127, 1865, 4129, 849, 27247, 29845, 36515}}, {6660, 17, 7927, {1, 3, 7, 13, 5, 59, 19, 71, 227, 111, 365, 1309, 5857, 6035, 32379, 11303, 127329}}, {6661, 17, 7936, {1, 1, 1, 1, 19, 61, 79, 253, 459, 23, 725, 3615, 4583, 429, 13215, 31879, 4523}}, {6662, 17, 7951, {1, 1, 1, 7, 19, 13, 53, 41, 243, 107, 1767, 983, 3483, 2249, 2209, 58895, 14805}}, {6663, 17, 7963, {1, 1, 1, 9, 5, 63, 31, 85, 119, 307, 633, 3295, 841, 3495, 22965, 57587, 108271}}, {6664, 17, 7966, {1, 3, 5, 9, 17, 13, 57, 49, 97, 613, 405, 2637, 3229, 14253, 4663, 61345, 33415}}, {6665, 17, 7976, {1, 3, 1, 1, 17, 37, 63, 3, 5, 375, 1073, 3971, 665, 4445, 153, 20437, 38513}}, {6666, 17, 7993, {1, 3, 3, 15, 5, 9, 77, 161, 409, 461, 443, 567, 5581, 8623, 27735, 9041, 5517}}, {6667, 17, 8001, {1, 3, 5, 13, 13, 5, 19, 53, 263, 155, 557, 3973, 6841, 4829, 30751, 30025, 121973}}, {6668, 17, 8004, {1, 3, 7, 9, 27, 37, 49, 243, 107, 1013, 1743, 1509, 4465, 15415, 4741, 41409, 72695}}, {6669, 17, 8013, {1, 1, 3, 5, 11, 49, 39, 45, 21, 463, 875, 3681, 1901, 15325, 24553, 51369, 82227}}, {6670, 17, 8021, {1, 1, 3, 15, 11, 35, 21, 91, 383, 149, 1815, 911, 4633, 12027, 12413, 22307, 120049}}, {6671, 17, 8026, {1, 3, 5, 7, 7, 3, 15, 83, 477, 687, 145, 1705, 6893, 5233, 20171, 43337, 72603}}, {6672, 17, 8028, {1, 1, 3, 9, 25, 35, 19, 173, 67, 5, 561, 2139, 4557, 4911, 26273, 38409, 22801}}, {6673, 17, 8031, {1, 1, 3, 13, 15, 39, 85, 91, 91, 187, 1851, 1181, 4049, 16353, 26525, 43703, 19415}}, {6674, 17, 8035, {1, 3, 1, 9, 13, 41, 77, 179, 415, 705, 693, 3017, 5847, 16191, 11435, 28979, 51839}}, {6675, 17, 8042, {1, 1, 3, 5, 23, 15, 3, 159, 269, 67, 625, 4043, 4701, 1599, 6467, 10949, 80073}}, {6676, 17, 8071, {1, 3, 3, 15, 7, 43, 81, 157, 393, 321, 1875, 2801, 4359, 11703, 1063, 64015, 109997}}, {6677, 17, 8085, {1, 1, 7, 3, 25, 21, 37, 123, 133, 691, 973, 3115, 2291, 10519, 13339, 22751, 85445}}, {6678, 17, 8092, {1, 3, 1, 1, 21, 21, 9, 23, 431, 679, 1873, 289, 4503, 3939, 14417, 36081, 18709}}, {6679, 17, 8102, {1, 3, 5, 5, 1, 53, 109, 133, 33, 279, 727, 2233, 3065, 8557, 7487, 25797, 109177}}, {6680, 17, 8105, {1, 1, 7, 7, 1, 9, 47, 127, 179, 757, 1985, 547, 169, 13393, 22669, 58795, 92897}}, {6681, 17, 8114, {1, 3, 5, 11, 17, 21, 95, 219, 263, 579, 1493, 3283, 5461, 1235, 1749, 33325, 36033}}, {6682, 17, 8123, {1, 1, 3, 11, 21, 49, 45, 143, 511, 983, 1933, 965, 7905, 1925, 27857, 40723, 68251}}, {6683, 17, 8131, {1, 3, 7, 3, 27, 9, 73, 7, 441, 877, 107, 1599, 4795, 7251, 6819, 7671, 21137}}, {6684, 17, 8140, {1, 1, 3, 3, 21, 25, 49, 43, 247, 949, 627, 2859, 2507, 4787, 11269, 53221, 126387}}, {6685, 17, 8145, {1, 1, 5, 3, 5, 53, 127, 65, 353, 521, 1701, 2981, 3201, 611, 13475, 58015, 2605}}, {6686, 17, 8157, {1, 1, 5, 13, 9, 39, 55, 103, 53, 281, 705, 2433, 6179, 3381, 31973, 30267, 91307}}, {6687, 17, 8158, {1, 1, 7, 13, 31, 23, 29, 161, 347, 449, 123, 3427, 5731, 12691, 15175, 20487, 74695}}, {6688, 17, 8185, {1, 3, 3, 15, 13, 19, 83, 137, 437, 317, 921, 913, 7979, 6665, 5313, 1435, 60271}}, {6689, 17, 8186, {1, 3, 5, 7, 19, 23, 31, 131, 421, 95, 1999, 897, 4839, 1815, 12387, 45009, 2609}}, {6690, 17, 8188, {1, 1, 1, 7, 3, 53, 121, 33, 47, 283, 813, 3841, 4449, 2543, 15211, 59285, 42551}}, {6691, 17, 8192, {1, 3, 1, 13, 9, 43, 37, 167, 93, 417, 213, 2721, 3395, 2089, 13743, 32925, 91147}}, {6692, 17, 8212, {1, 3, 7, 5, 31, 25, 97, 25, 19, 11, 543, 1889, 455, 5765, 9517, 56963, 131069}}, {6693, 17, 8219, {1, 3, 1, 7, 3, 7, 87, 61, 209, 39, 1303, 1637, 6687, 8001, 5003, 47911, 110657}}, {6694, 17, 8221, {1, 1, 5, 3, 11, 25, 99, 77, 379, 843, 1423, 2933, 7535, 4181, 32223, 49327, 48041}}, {6695, 17, 8235, {1, 3, 3, 13, 9, 7, 85, 59, 47, 777, 401, 2449, 2795, 11289, 25023, 7725, 73887}}, {6696, 17, 8237, {1, 1, 3, 5, 11, 51, 93, 57, 369, 871, 1175, 2705, 1253, 5169, 24691, 14243, 119667}}, {6697, 17, 8249, {1, 3, 1, 3, 5, 7, 33, 171, 359, 115, 1909, 2003, 1413, 13829, 3471, 36185, 118399}}, {6698, 17, 8260, {1, 1, 1, 11, 5, 49, 97, 145, 415, 731, 671, 2309, 7211, 11359, 22757, 15415, 70951}}, {6699, 17, 8264, {1, 1, 3, 5, 7, 51, 61, 101, 375, 575, 1321, 2835, 7569, 9599, 4707, 7655, 53417}}, {6700, 17, 8270, {1, 3, 1, 15, 9, 63, 25, 117, 203, 5, 1345, 2571, 5273, 2059, 4689, 27237, 23199}}, {6701, 17, 8282, {1, 1, 3, 15, 15, 23, 69, 49, 349, 995, 5, 1565, 903, 10165, 9565, 6343, 16653}}, {6702, 17, 8291, {1, 1, 3, 9, 21, 15, 69, 9, 463, 69, 1447, 2347, 5125, 7479, 18257, 14405, 51321}}, {6703, 17, 8293, {1, 1, 7, 11, 23, 57, 57, 179, 17, 129, 999, 777, 6281, 1693, 31885, 31085, 29237}}, {6704, 17, 8297, {1, 3, 5, 1, 25, 55, 15, 21, 199, 271, 1645, 1719, 2023, 10049, 15215, 11959, 44875}}, {6705, 17, 8298, {1, 3, 1, 3, 29, 43, 83, 11, 281, 27, 429, 685, 7189, 9151, 8665, 9553, 115293}}, {6706, 17, 8305, {1, 3, 1, 7, 17, 43, 125, 11, 189, 803, 713, 683, 7285, 4455, 18195, 45333, 32281}}, {6707, 17, 8306, {1, 3, 3, 3, 11, 55, 21, 59, 173, 283, 709, 1561, 5391, 5097, 24725, 19217, 13769}}, {6708, 17, 8311, {1, 3, 5, 13, 7, 29, 117, 207, 415, 525, 567, 1741, 3553, 6729, 433, 17619, 45971}}, {6709, 17, 8318, {1, 1, 7, 7, 3, 23, 43, 43, 213, 823, 609, 1037, 3797, 4733, 30717, 61067, 89581}}, {6710, 17, 8327, {1, 3, 5, 7, 11, 7, 7, 241, 379, 217, 739, 2815, 2549, 14297, 10283, 1509, 80613}}, {6711, 17, 8345, {1, 1, 1, 1, 17, 45, 53, 229, 193, 893, 1881, 227, 6751, 7135, 20823, 36939, 27667}}, {6712, 17, 8379, {1, 3, 3, 1, 15, 39, 27, 217, 101, 949, 1963, 2213, 2357, 4129, 11925, 841, 59259}}, {6713, 17, 8390, {1, 1, 3, 3, 5, 53, 59, 255, 421, 1009, 683, 2171, 6691, 12489, 20865, 29363, 70611}}, {6714, 17, 8394, {1, 1, 7, 15, 7, 31, 105, 141, 153, 401, 549, 3045, 5443, 11147, 18159, 24283, 21859}}, {6715, 17, 8414, {1, 3, 7, 1, 11, 17, 17, 231, 175, 603, 1915, 111, 3203, 10627, 9687, 47235, 87057}}, {6716, 17, 8417, {1, 1, 1, 11, 19, 21, 115, 41, 45, 727, 1523, 739, 3025, 10321, 27353, 63139, 16051}}, {6717, 17, 8432, {1, 3, 7, 11, 13, 9, 33, 121, 237, 565, 2043, 2131, 3079, 12575, 2187, 14427, 85939}}, {6718, 17, 8437, {1, 3, 1, 15, 21, 19, 91, 227, 485, 49, 101, 15, 1903, 4039, 23819, 40001, 66405}}, {6719, 17, 8441, {1, 3, 1, 5, 15, 25, 65, 25, 393, 287, 1435, 1851, 6437, 5983, 13769, 37847, 120907}}, {6720, 17, 8449, {1, 3, 7, 15, 15, 21, 97, 37, 359, 155, 807, 1421, 517, 13135, 2955, 56979, 52299}}, {6721, 17, 8456, {1, 1, 5, 1, 27, 53, 79, 27, 467, 605, 267, 1193, 31, 6177, 12369, 32621, 38319}}, {6722, 17, 8473, {1, 1, 1, 11, 27, 15, 15, 231, 205, 677, 331, 133, 3313, 7193, 8059, 36449, 21671}}, {6723, 17, 8489, {1, 3, 3, 11, 19, 57, 113, 83, 399, 801, 1843, 2119, 2779, 14061, 30901, 28745, 120903}}, {6724, 17, 8495, {1, 1, 1, 11, 5, 27, 121, 247, 467, 251, 1487, 251, 897, 3171, 28383, 22473, 1709}}, {6725, 17, 8522, {1, 1, 1, 15, 7, 59, 123, 165, 123, 373, 167, 1323, 5239, 9027, 13791, 55593, 78785}}, {6726, 17, 8524, {1, 3, 1, 11, 31, 11, 81, 229, 123, 183, 461, 1751, 5713, 2615, 27795, 1657, 39253}}, {6727, 17, 8529, {1, 1, 7, 1, 21, 45, 107, 3, 283, 149, 549, 3731, 6435, 3595, 32753, 16079, 84257}}, {6728, 17, 8545, {1, 3, 3, 15, 19, 9, 81, 37, 51, 341, 909, 985, 1503, 12787, 16129, 37789, 113515}}, {6729, 17, 8557, {1, 3, 5, 13, 3, 33, 127, 219, 369, 341, 1191, 1305, 567, 2339, 31221, 49435, 114927}}, {6730, 17, 8565, {1, 1, 7, 15, 29, 47, 103, 107, 257, 15, 2029, 2133, 2129, 11235, 29553, 49139, 33809}}, {6731, 17, 8572, {1, 3, 3, 13, 23, 33, 105, 43, 155, 815, 1087, 2261, 2781, 3461, 7371, 4479, 123093}}, {6732, 17, 8576, {1, 1, 1, 13, 17, 7, 89, 107, 143, 349, 637, 3651, 4153, 12131, 28393, 45781, 84133}}, {6733, 17, 8582, {1, 3, 5, 11, 31, 47, 105, 101, 267, 403, 1853, 3977, 3277, 1737, 15503, 47365, 14361}}, {6734, 17, 8594, {1, 1, 1, 13, 1, 63, 125, 107, 123, 183, 1027, 3491, 3597, 15949, 5779, 34665, 81257}}, {6735, 17, 8629, {1, 3, 1, 9, 13, 5, 125, 41, 389, 73, 1487, 1983, 957, 12645, 13983, 7675, 72711}}, {6736, 17, 8636, {1, 3, 7, 5, 17, 5, 25, 63, 211, 591, 261, 2345, 3883, 4403, 773, 43963, 93509}}, {6737, 17, 8668, {1, 3, 3, 1, 11, 35, 15, 251, 225, 643, 537, 3769, 7593, 6113, 1377, 52185, 81459}}, {6738, 17, 8678, {1, 3, 5, 15, 27, 27, 51, 35, 389, 853, 1437, 2803, 5739, 1887, 15099, 3299, 111827}}, {6739, 17, 8701, {1, 1, 3, 15, 25, 63, 31, 201, 79, 131, 31, 3929, 4195, 13045, 8681, 48121, 110723}}, {6740, 17, 8702, {1, 1, 5, 7, 11, 43, 101, 57, 69, 271, 189, 3087, 4893, 11365, 6945, 14285, 41961}}, {6741, 17, 8708, {1, 1, 7, 9, 21, 61, 41, 123, 25, 947, 1619, 2895, 7879, 12397, 17405, 48139, 71519}}, {6742, 17, 8712, {1, 3, 1, 15, 1, 27, 113, 225, 441, 855, 541, 357, 3111, 4867, 20571, 30627, 70123}}, {6743, 17, 8745, {1, 3, 5, 3, 5, 33, 103, 1, 21, 93, 383, 407, 5145, 7857, 20289, 51943, 16223}}, {6744, 17, 8754, {1, 1, 7, 15, 1, 13, 41, 215, 463, 417, 513, 3417, 1755, 16165, 7271, 3101, 54353}}, {6745, 17, 8759, {1, 3, 3, 13, 19, 29, 5, 205, 245, 927, 1249, 773, 3653, 9959, 357, 40863, 37289}}, {6746, 17, 8763, {1, 3, 3, 7, 3, 5, 85, 241, 29, 627, 1963, 3133, 1369, 503, 11449, 4699, 2573}}, {6747, 17, 8766, {1, 1, 7, 15, 3, 35, 47, 157, 413, 437, 1627, 3953, 947, 12721, 22209, 34303, 81237}}, {6748, 17, 8780, {1, 1, 5, 5, 1, 45, 47, 245, 253, 349, 1853, 3481, 6105, 7267, 3159, 38833, 117889}}, {6749, 17, 8783, {1, 3, 7, 15, 23, 43, 25, 181, 121, 681, 479, 1239, 6155, 3317, 9419, 28717, 44643}}, {6750, 17, 8786, {1, 3, 3, 15, 31, 43, 111, 99, 405, 991, 301, 1689, 7107, 16131, 16703, 24059, 40345}}, {6751, 17, 8798, {1, 1, 3, 9, 25, 5, 107, 91, 117, 351, 1595, 163, 3007, 13743, 24535, 38671, 29745}}, {6752, 17, 8804, {1, 3, 3, 5, 27, 47, 15, 195, 119, 919, 665, 1903, 1981, 7753, 21709, 33699, 15963}}, {6753, 17, 8819, {1, 3, 1, 11, 23, 23, 75, 115, 477, 105, 541, 1111, 209, 13939, 17129, 7565, 75415}}, {6754, 17, 8826, {1, 1, 1, 11, 7, 61, 123, 201, 305, 713, 779, 2059, 4899, 13733, 20529, 15617, 39833}}, {6755, 17, 8835, {1, 1, 7, 11, 21, 7, 63, 113, 213, 871, 375, 29, 1925, 15237, 7091, 12229, 8457}}, {6756, 17, 8838, {1, 1, 1, 7, 19, 57, 83, 91, 297, 255, 1993, 63, 5337, 4569, 21243, 40867, 46969}}, {6757, 17, 8856, {1, 1, 3, 7, 13, 63, 91, 191, 281, 259, 1367, 3505, 5885, 10557, 12423, 56303, 14731}}, {6758, 17, 8862, {1, 1, 5, 15, 27, 15, 29, 67, 115, 287, 253, 1497, 3739, 2183, 14427, 44931, 11547}}, {6759, 17, 8871, {1, 3, 1, 9, 25, 61, 25, 113, 137, 819, 781, 3741, 2457, 7817, 31209, 20707, 93007}}, {6760, 17, 8875, {1, 1, 7, 3, 5, 13, 23, 3, 365, 77, 1117, 3061, 4707, 3013, 27899, 10887, 78677}}, {6761, 17, 8890, {1, 3, 1, 15, 1, 39, 85, 107, 483, 83, 603, 3121, 1995, 5241, 32319, 9515, 94551}}, {6762, 17, 8892, {1, 1, 7, 3, 27, 13, 105, 41, 285, 237, 1589, 517, 2009, 10833, 1459, 26217, 50759}}, {6763, 17, 8898, {1, 1, 3, 11, 27, 1, 127, 83, 355, 107, 1003, 657, 4997, 4123, 13151, 56601, 122307}}, {6764, 17, 8927, {1, 1, 1, 7, 13, 17, 93, 75, 481, 473, 131, 1359, 4859, 1319, 23919, 50079, 128849}}, {6765, 17, 8928, {1, 1, 3, 7, 9, 33, 111, 229, 11, 283, 1089, 3049, 1635, 959, 19109, 62821, 105391}}, {6766, 17, 8945, {1, 3, 1, 3, 9, 47, 49, 169, 343, 929, 1379, 1985, 5867, 6053, 12179, 39727, 116053}}, {6767, 17, 8952, {1, 3, 3, 15, 27, 39, 61, 113, 439, 719, 1313, 3701, 4793, 10275, 2943, 32405, 95457}}, {6768, 17, 8955, {1, 1, 1, 1, 27, 49, 121, 171, 319, 365, 1593, 1655, 63, 6257, 18097, 35285, 112245}}, {6769, 17, 8965, {1, 3, 1, 1, 19, 33, 89, 235, 281, 519, 1867, 525, 4475, 12059, 26611, 14789, 59541}}, {6770, 17, 8972, {1, 3, 1, 15, 1, 51, 65, 71, 131, 599, 117, 2459, 7421, 7157, 24393, 48139, 53701}}, {6771, 17, 8977, {1, 1, 7, 7, 1, 41, 57, 191, 207, 329, 43, 1235, 5671, 12243, 22549, 40751, 104513}}, {6772, 17, 8990, {1, 3, 5, 13, 15, 21, 55, 187, 283, 209, 1511, 1329, 6665, 15953, 4521, 16879, 57625}}, {6773, 17, 8996, {1, 1, 5, 3, 3, 53, 75, 123, 291, 663, 1893, 3669, 4903, 8575, 27971, 46977, 56357}}, {6774, 17, 9025, {1, 3, 1, 5, 27, 41, 19, 199, 489, 197, 439, 3299, 6315, 6957, 15809, 35297, 5559}}, {6775, 17, 9037, {1, 3, 5, 1, 3, 25, 109, 191, 33, 543, 125, 2309, 429, 14059, 3149, 45747, 47357}}, {6776, 17, 9040, {1, 1, 3, 11, 15, 61, 109, 103, 305, 1, 1479, 2781, 6521, 8921, 23681, 9583, 87257}}, {6777, 17, 9049, {1, 1, 7, 15, 5, 19, 121, 139, 177, 967, 1363, 705, 211, 11877, 22457, 34563, 7801}}, {6778, 17, 9062, {1, 1, 7, 13, 9, 21, 103, 95, 483, 567, 5, 2095, 4659, 2447, 23521, 27273, 85867}}, {6779, 17, 9068, {1, 3, 5, 15, 23, 55, 13, 237, 275, 113, 1431, 2931, 5165, 5317, 5625, 51865, 42177}}, {6780, 17, 9076, {1, 3, 3, 7, 1, 23, 15, 171, 303, 43, 1137, 1255, 3843, 9049, 1799, 7075, 2115}}, {6781, 17, 9079, {1, 1, 7, 5, 23, 53, 75, 129, 1, 511, 793, 265, 6535, 9641, 25173, 9449, 46949}}, {6782, 17, 9099, {1, 3, 3, 1, 19, 39, 51, 173, 5, 281, 2047, 4065, 3225, 14587, 16947, 1459, 87227}}, {6783, 17, 9107, {1, 3, 7, 13, 13, 53, 39, 115, 403, 37, 1533, 2727, 2229, 8291, 18687, 59553, 37629}}, {6784, 17, 9114, {1, 3, 1, 9, 3, 55, 63, 191, 147, 321, 1287, 2419, 6881, 2249, 11141, 54839, 50263}}, {6785, 17, 9123, {1, 1, 5, 3, 9, 61, 85, 139, 1, 409, 633, 53, 163, 14677, 13043, 12253, 106939}}, {6786, 17, 9126, {1, 1, 7, 3, 19, 3, 7, 165, 497, 621, 1563, 1267, 8113, 2383, 17205, 13337, 102547}}, {6787, 17, 9137, {1, 3, 3, 13, 15, 29, 23, 31, 481, 535, 471, 2125, 331, 9421, 29799, 27097, 5307}}, {6788, 17, 9149, {1, 1, 1, 1, 31, 45, 47, 139, 235, 509, 889, 685, 1855, 13599, 24431, 62105, 109509}}, {6789, 17, 9150, {1, 3, 1, 7, 3, 13, 25, 197, 111, 45, 1815, 1031, 4803, 349, 32369, 40837, 111529}}, {6790, 17, 9155, {1, 1, 7, 1, 27, 9, 3, 73, 403, 321, 967, 2713, 6953, 16123, 8611, 48651, 120635}}, {6791, 17, 9161, {1, 3, 5, 3, 3, 25, 69, 231, 249, 393, 1141, 1721, 7071, 3711, 15627, 21815, 104735}}, {6792, 17, 9162, {1, 3, 1, 11, 19, 63, 77, 5, 55, 481, 1021, 119, 3941, 1227, 10997, 29513, 18923}}, {6793, 17, 9167, {1, 3, 7, 5, 1, 11, 13, 99, 365, 797, 1993, 699, 3091, 11401, 3659, 15339, 90395}}, {6794, 17, 9172, {1, 3, 5, 7, 31, 43, 55, 143, 273, 379, 1189, 1689, 4811, 5159, 3281, 63819, 57065}}, {6795, 17, 9186, {1, 1, 1, 13, 9, 25, 9, 3, 461, 281, 959, 2439, 3187, 4837, 13857, 20221, 29733}}, {6796, 17, 9188, {1, 1, 7, 11, 31, 17, 13, 101, 81, 921, 1329, 2421, 2747, 9435, 23313, 7093, 7547}}, {6797, 17, 9191, {1, 1, 3, 3, 9, 51, 67, 95, 511, 1011, 1519, 4089, 5001, 1351, 15367, 50665, 92111}}, {6798, 17, 9198, {1, 1, 5, 13, 27, 43, 115, 77, 439, 589, 31, 915, 7027, 697, 25143, 1443, 59093}}, {6799, 17, 9200, {1, 1, 7, 3, 17, 5, 107, 117, 133, 649, 1309, 2979, 969, 9789, 12597, 24507, 106825}}, {6800, 17, 9205, {1, 1, 7, 13, 1, 27, 97, 35, 431, 183, 199, 2619, 515, 89, 20281, 30291, 97977}}, {6801, 17, 9206, {1, 1, 7, 1, 31, 9, 35, 11, 359, 21, 1875, 3227, 1307, 15691, 17343, 21163, 84671}}, {6802, 17, 9215, {1, 3, 1, 11, 29, 21, 47, 137, 441, 841, 1641, 3283, 1371, 8835, 16287, 45009, 13779}}, {6803, 17, 9227, {1, 1, 3, 9, 23, 53, 1, 99, 473, 649, 447, 2589, 5667, 15579, 6497, 44321, 46993}}, {6804, 17, 9232, {1, 1, 7, 9, 31, 63, 95, 81, 197, 373, 1027, 3959, 7189, 13369, 17287, 53643, 12673}}, {6805, 17, 9241, {1, 3, 1, 5, 25, 61, 79, 183, 489, 725, 1077, 1147, 113, 7357, 27505, 529, 61855}}, {6806, 17, 9244, {1, 1, 7, 11, 19, 35, 73, 223, 125, 765, 1303, 2887, 7861, 14839, 9537, 27027, 94327}}, {6807, 17, 9251, {1, 3, 1, 3, 17, 35, 63, 233, 317, 133, 1837, 3339, 4351, 10071, 5005, 13245, 34327}}, {6808, 17, 9254, {1, 3, 1, 3, 17, 13, 59, 113, 247, 1015, 1831, 3391, 6337, 6853, 7145, 64309, 40109}}, {6809, 17, 9275, {1, 3, 5, 13, 15, 23, 65, 203, 241, 545, 1521, 1253, 3171, 7777, 21145, 565, 87813}}, {6810, 17, 9283, {1, 1, 5, 15, 31, 9, 9, 145, 409, 155, 409, 2935, 5817, 11427, 32617, 38167, 69465}}, {6811, 17, 9285, {1, 1, 5, 11, 19, 31, 43, 85, 97, 931, 687, 1501, 3991, 2215, 11091, 64735, 56999}}, {6812, 17, 9303, {1, 1, 1, 3, 7, 11, 101, 21, 345, 829, 531, 1475, 6617, 1187, 26885, 32135, 9733}}, {6813, 17, 9304, {1, 3, 5, 11, 7, 49, 79, 197, 57, 15, 1845, 1485, 6167, 10887, 17083, 59367, 7411}}, {6814, 17, 9313, {1, 3, 7, 5, 9, 33, 7, 91, 311, 847, 1435, 3573, 3693, 5369, 26817, 30105, 115337}}, {6815, 17, 9314, {1, 3, 1, 9, 25, 43, 65, 69, 225, 337, 575, 1979, 5555, 8499, 8127, 33035, 52549}}, {6816, 17, 9320, {1, 1, 3, 11, 17, 29, 71, 99, 379, 145, 1067, 2561, 7635, 5647, 32491, 56621, 93603}}, {6817, 17, 9328, {1, 1, 5, 13, 25, 43, 75, 237, 407, 393, 1219, 3651, 7719, 11685, 26123, 62767, 1043}}, {6818, 17, 9333, {1, 1, 7, 15, 13, 59, 9, 163, 273, 225, 873, 3201, 633, 6121, 18777, 58763, 77731}}, {6819, 17, 9337, {1, 3, 7, 7, 3, 7, 99, 155, 279, 991, 799, 753, 7205, 9567, 23643, 38263, 19083}}, {6820, 17, 9338, {1, 3, 7, 11, 11, 29, 65, 3, 207, 575, 253, 2407, 7935, 11323, 23239, 1923, 47737}}, {6821, 17, 9340, {1, 1, 5, 9, 25, 47, 1, 25, 397, 1009, 193, 4031, 3023, 2029, 10561, 32363, 104405}}, {6822, 17, 9353, {1, 3, 7, 9, 19, 55, 63, 179, 385, 97, 461, 3393, 8137, 8929, 17621, 9611, 58925}}, {6823, 17, 9356, {1, 1, 1, 7, 1, 17, 127, 45, 157, 529, 809, 3545, 5173, 5083, 13325, 52295, 91261}}, {6824, 17, 9364, {1, 1, 7, 9, 25, 49, 99, 79, 157, 535, 1569, 2195, 1725, 1187, 18423, 47957, 10043}}, {6825, 17, 9373, {1, 1, 3, 7, 3, 31, 83, 45, 199, 665, 1261, 3497, 7885, 5761, 17187, 12041, 12867}}, {6826, 17, 9374, {1, 3, 1, 7, 3, 55, 73, 215, 41, 1011, 1883, 1051, 7293, 1881, 27435, 29459, 130933}}, {6827, 17, 9378, {1, 1, 3, 9, 21, 31, 113, 209, 35, 771, 365, 3151, 787, 3845, 26555, 13823, 36951}}, {6828, 17, 9380, {1, 3, 7, 15, 13, 21, 119, 91, 15, 251, 1337, 2715, 1665, 3451, 8309, 11033, 127159}}, {6829, 17, 9389, {1, 3, 1, 9, 9, 63, 5, 145, 357, 9, 859, 1565, 1141, 14689, 25121, 41337, 83357}}, {6830, 17, 9395, {1, 1, 7, 11, 13, 63, 57, 151, 33, 595, 2025, 571, 4713, 11019, 26771, 16221, 92439}}, {6831, 17, 9412, {1, 3, 3, 15, 29, 49, 93, 131, 167, 835, 33, 263, 93, 8475, 16139, 61237, 95081}}, {6832, 17, 9422, {1, 1, 7, 13, 1, 57, 43, 91, 485, 841, 1415, 3083, 2665, 8521, 9825, 59955, 21763}}, {6833, 17, 9439, {1, 1, 1, 1, 29, 47, 63, 107, 439, 847, 537, 2011, 7571, 3699, 23961, 54887, 92681}}, {6834, 17, 9450, {1, 3, 7, 5, 27, 41, 105, 161, 95, 821, 451, 2627, 4687, 1899, 18851, 35167, 6869}}, {6835, 17, 9452, {1, 1, 1, 11, 7, 7, 13, 163, 399, 471, 1587, 2561, 1241, 5365, 27189, 49883, 68101}}, {6836, 17, 9482, {1, 3, 7, 9, 19, 5, 119, 251, 151, 359, 235, 2387, 3919, 7135, 17591, 1053, 6265}}, {6837, 17, 9487, {1, 1, 5, 9, 13, 25, 43, 23, 453, 693, 517, 1235, 1045, 4299, 27877, 3733, 72269}}, {6838, 17, 9489, {1, 1, 7, 1, 27, 43, 103, 249, 487, 67, 855, 3239, 2157, 8121, 4701, 37803, 49971}}, {6839, 17, 9499, {1, 1, 3, 13, 1, 37, 125, 115, 365, 57, 1419, 4085, 7039, 10079, 14991, 48861, 61979}}, {6840, 17, 9501, {1, 1, 5, 5, 3, 35, 109, 19, 219, 653, 1219, 1625, 6847, 11271, 4525, 56341, 57801}}, {6841, 17, 9508, {1, 3, 7, 5, 31, 19, 37, 73, 185, 13, 1723, 1139, 5919, 11717, 27161, 13635, 51765}}, {6842, 17, 9515, {1, 1, 1, 1, 19, 61, 53, 111, 215, 189, 1199, 591, 943, 2111, 17171, 15621, 128459}}, {6843, 17, 9518, {1, 1, 7, 9, 17, 61, 101, 159, 85, 537, 15, 1427, 6139, 4091, 32639, 28655, 115385}}, {6844, 17, 9520, {1, 1, 7, 5, 23, 31, 125, 7, 151, 967, 1079, 4059, 3287, 11673, 19307, 49469, 65981}}, {6845, 17, 9526, {1, 3, 3, 1, 29, 59, 95, 119, 31, 427, 1653, 721, 5509, 6385, 17043, 45133, 74155}}, {6846, 17, 9537, {1, 1, 3, 9, 13, 61, 35, 189, 1, 559, 119, 3719, 4137, 1369, 19147, 10923, 43909}}, {6847, 17, 9552, {1, 3, 3, 13, 1, 41, 31, 185, 451, 379, 29, 153, 4121, 13153, 4171, 36993, 109241}}, {6848, 17, 9571, {1, 1, 1, 9, 15, 41, 99, 17, 21, 93, 649, 2765, 6955, 10843, 12547, 64989, 63713}}, {6849, 17, 9588, {1, 1, 7, 5, 5, 5, 73, 187, 473, 235, 1907, 409, 7335, 4429, 7493, 20703, 14505}}, {6850, 17, 9613, {1, 1, 3, 11, 27, 59, 17, 103, 337, 117, 1241, 951, 3701, 10407, 16741, 46531, 56485}}, {6851, 17, 9619, {1, 1, 3, 15, 11, 51, 111, 189, 137, 939, 97, 1563, 851, 13949, 1375, 41463, 61445}}, {6852, 17, 9622, {1, 1, 7, 9, 19, 39, 117, 173, 165, 547, 483, 361, 6819, 15093, 13631, 29785, 29593}}, {6853, 17, 9637, {1, 3, 3, 5, 15, 39, 41, 249, 455, 79, 233, 3133, 405, 9487, 23161, 32751, 117743}}, {6854, 17, 9652, {1, 1, 5, 15, 7, 63, 7, 57, 127, 349, 1913, 1145, 3371, 3733, 30971, 35717, 60935}}, {6855, 17, 9655, {1, 1, 7, 11, 7, 57, 49, 63, 51, 233, 855, 2125, 6961, 15011, 28503, 40549, 47175}}, {6856, 17, 9661, {1, 3, 7, 1, 25, 49, 35, 39, 237, 545, 1637, 1401, 3279, 10499, 14463, 34973, 29485}}, {6857, 17, 9664, {1, 3, 3, 13, 7, 13, 79, 141, 55, 277, 843, 3087, 2339, 6855, 10635, 13021, 11273}}, {6858, 17, 9669, {1, 3, 1, 1, 11, 39, 51, 255, 119, 691, 559, 3287, 5485, 791, 19283, 51027, 8061}}, {6859, 17, 9681, {1, 3, 7, 7, 3, 59, 119, 241, 185, 81, 1843, 2313, 7471, 15689, 2271, 59781, 107439}}, {6860, 17, 9682, {1, 3, 3, 3, 17, 63, 93, 217, 329, 39, 583, 3031, 4315, 4623, 12557, 42063, 11877}}, {6861, 17, 9688, {1, 1, 1, 1, 15, 57, 37, 233, 387, 639, 37, 425, 637, 1577, 16449, 33665, 80417}}, {6862, 17, 9697, {1, 1, 1, 15, 25, 1, 67, 159, 423, 961, 959, 417, 5657, 8417, 8127, 29251, 105893}}, {6863, 17, 9700, {1, 3, 5, 15, 31, 9, 87, 217, 259, 771, 1663, 2899, 1531, 7849, 1961, 61487, 55399}}, {6864, 17, 9715, {1, 1, 3, 9, 21, 13, 39, 107, 89, 811, 449, 2569, 4617, 8977, 1649, 37721, 48943}}, {6865, 17, 9722, {1, 3, 7, 15, 15, 59, 63, 195, 287, 677, 269, 1715, 3545, 3269, 5231, 46433, 25921}}, {6866, 17, 9727, {1, 1, 5, 7, 19, 27, 57, 221, 243, 47, 1791, 2309, 2751, 4403, 7083, 34223, 64905}}, {6867, 17, 9734, {1, 1, 1, 15, 1, 63, 119, 155, 383, 649, 429, 3857, 7309, 9823, 9539, 8933, 128573}}, {6868, 17, 9740, {1, 3, 7, 11, 17, 19, 99, 19, 321, 415, 1501, 2123, 6119, 9705, 11397, 39521, 34327}}, {6869, 17, 9743, {1, 1, 5, 15, 29, 37, 9, 95, 417, 19, 1637, 2949, 4961, 10743, 9619, 16045, 48083}}, {6870, 17, 9745, {1, 1, 1, 11, 21, 17, 57, 23, 247, 201, 1781, 779, 2207, 2511, 4829, 13847, 77593}}, {6871, 17, 9757, {1, 3, 1, 13, 7, 1, 95, 87, 223, 73, 1129, 383, 1355, 4965, 29645, 63465, 76281}}, {6872, 17, 9761, {1, 3, 3, 13, 3, 47, 33, 123, 155, 621, 1019, 1817, 4083, 4723, 24701, 47503, 18007}}, {6873, 17, 9762, {1, 1, 7, 15, 13, 41, 73, 93, 379, 923, 1183, 2475, 5901, 10599, 10053, 9941, 112107}}, {6874, 17, 9767, {1, 1, 3, 3, 13, 35, 59, 231, 45, 1011, 1101, 2467, 2703, 10305, 12575, 7587, 25737}}, {6875, 17, 9768, {1, 3, 7, 1, 21, 31, 9, 55, 373, 779, 397, 1551, 5139, 16339, 1769, 10413, 74059}}, {6876, 17, 9774, {1, 1, 7, 15, 7, 3, 67, 179, 411, 217, 1219, 13, 1577, 13463, 12263, 41465, 83001}}, {6877, 17, 9786, {1, 3, 7, 1, 21, 53, 7, 187, 395, 777, 391, 737, 47, 12681, 16749, 26507, 49415}}, {6878, 17, 9796, {1, 1, 5, 7, 5, 57, 93, 53, 419, 731, 825, 487, 45, 9199, 20947, 56067, 45343}}, {6879, 17, 9820, {1, 3, 3, 9, 31, 41, 35, 133, 63, 293, 1503, 51, 3111, 15711, 15051, 1965, 64951}}, {6880, 17, 9823, {1, 1, 5, 9, 9, 47, 53, 229, 405, 621, 1795, 1923, 6609, 6983, 1695, 18021, 71893}}, {6881, 17, 9839, {1, 1, 5, 9, 23, 13, 107, 13, 149, 759, 1113, 1329, 1747, 14159, 16705, 61841, 82955}}, {6882, 17, 9844, {1, 3, 3, 9, 25, 49, 31, 145, 481, 609, 1847, 1485, 6345, 7859, 21231, 37303, 69975}}, {6883, 17, 9851, {1, 3, 1, 15, 13, 49, 59, 221, 27, 517, 431, 3961, 6401, 8483, 10161, 37453, 128237}}, {6884, 17, 9853, {1, 1, 3, 1, 3, 55, 37, 111, 263, 735, 655, 2831, 2219, 9449, 8413, 49585, 91355}}, {6885, 17, 9863, {1, 3, 7, 1, 31, 33, 7, 55, 261, 977, 1215, 1967, 7297, 14815, 27009, 35001, 89671}}, {6886, 17, 9864, {1, 1, 7, 11, 13, 21, 33, 151, 195, 373, 181, 1631, 355, 7857, 12555, 7531, 50417}}, {6887, 17, 9877, {1, 3, 1, 15, 19, 25, 79, 195, 237, 385, 1531, 2509, 4371, 16103, 3575, 62265, 124251}}, {6888, 17, 9884, {1, 3, 1, 11, 5, 61, 21, 159, 51, 37, 845, 3075, 8039, 14269, 10505, 36369, 73793}}, {6889, 17, 9888, {1, 3, 5, 9, 11, 43, 67, 57, 271, 451, 989, 3705, 2481, 10717, 10861, 63785, 10183}}, {6890, 17, 9897, {1, 3, 3, 5, 13, 29, 119, 171, 439, 459, 479, 3173, 3781, 11131, 6827, 53925, 119939}}, {6891, 17, 9915, {1, 3, 7, 3, 27, 21, 1, 167, 79, 305, 1283, 1903, 5483, 5727, 17911, 16075, 97629}}, {6892, 17, 9925, {1, 3, 1, 3, 23, 21, 29, 185, 227, 295, 915, 2033, 6269, 2089, 20785, 15207, 115675}}, {6893, 17, 9949, {1, 3, 7, 15, 11, 15, 65, 103, 249, 27, 1805, 2079, 4797, 2535, 16865, 61449, 90923}}, {6894, 17, 9954, {1, 3, 7, 9, 27, 41, 77, 181, 457, 677, 633, 1601, 8085, 2431, 7957, 55913, 38677}}, {6895, 17, 9960, {1, 1, 5, 7, 11, 37, 3, 221, 79, 895, 1023, 653, 3925, 12755, 19729, 18221, 91123}}, {6896, 17, 9965, {1, 3, 1, 5, 23, 61, 119, 191, 425, 41, 853, 3497, 6915, 1927, 5513, 55303, 4895}}, {6897, 17, 9978, {1, 3, 5, 3, 7, 35, 47, 243, 167, 821, 267, 2149, 5797, 6329, 32495, 51037, 18313}}, {6898, 17, 9986, {1, 1, 7, 9, 23, 29, 79, 205, 115, 839, 1217, 479, 1601, 9681, 1, 35293, 28731}}, {6899, 17, 9992, {1, 3, 3, 5, 31, 17, 31, 161, 35, 953, 377, 451, 7985, 11371, 15115, 60131, 27033}}, {6900, 17, 9995, {1, 1, 3, 9, 15, 19, 43, 215, 327, 429, 145, 1837, 725, 14775, 10465, 7367, 21271}}, {6901, 17, 10005, {1, 3, 7, 13, 31, 17, 85, 49, 487, 795, 1679, 599, 3783, 3195, 2683, 53475, 38603}}, {6902, 17, 10026, {1, 1, 1, 7, 19, 11, 71, 143, 443, 199, 1117, 3445, 6429, 12037, 13751, 43609, 101563}}, {6903, 17, 10031, {1, 3, 5, 7, 29, 63, 65, 87, 305, 721, 851, 2235, 4987, 3051, 23015, 1281, 15755}}, {6904, 17, 10040, {1, 1, 3, 9, 17, 3, 57, 47, 223, 305, 1409, 235, 4379, 5779, 27695, 22535, 9387}}, {6905, 17, 10051, {1, 1, 3, 11, 25, 33, 75, 141, 155, 699, 85, 1729, 2551, 7101, 7739, 18025, 100819}}, {6906, 17, 10057, {1, 3, 3, 13, 5, 45, 63, 83, 141, 383, 1931, 3343, 7397, 4823, 28893, 41279, 67805}}, {6907, 17, 10072, {1, 3, 5, 7, 19, 29, 97, 67, 177, 583, 1783, 4007, 5087, 805, 30999, 23197, 117553}}, {6908, 17, 10096, {1, 3, 5, 1, 25, 41, 33, 109, 511, 449, 653, 995, 5881, 2163, 13689, 54385, 97419}}, {6909, 17, 10102, {1, 3, 3, 13, 25, 17, 49, 77, 497, 659, 783, 3513, 3735, 3541, 573, 50237, 99247}}, {6910, 17, 10105, {1, 3, 1, 7, 17, 13, 37, 169, 19, 965, 289, 455, 6855, 11233, 7553, 7007, 57389}}, {6911, 17, 10115, {1, 1, 7, 11, 5, 15, 11, 177, 75, 243, 453, 3861, 3091, 4625, 12489, 11537, 74199}}, {6912, 17, 10124, {1, 1, 5, 13, 17, 21, 23, 57, 343, 985, 1755, 3947, 3899, 11847, 19321, 62295, 51265}}, {6913, 17, 10139, {1, 1, 3, 9, 19, 37, 31, 243, 433, 725, 535, 3733, 33, 7885, 1425, 41919, 66507}}, {6914, 17, 10145, {1, 3, 5, 11, 15, 11, 25, 255, 93, 33, 71, 2389, 1855, 317, 12773, 13311, 81927}}, {6915, 17, 10148, {1, 3, 1, 3, 7, 55, 21, 175, 357, 235, 1679, 931, 2051, 14213, 20539, 38049, 122513}}, {6916, 17, 10157, {1, 1, 5, 15, 5, 51, 127, 79, 297, 135, 1423, 2783, 7229, 14451, 27619, 7299, 49189}}, {6917, 17, 10158, {1, 1, 1, 3, 5, 13, 9, 209, 455, 483, 1745, 323, 789, 7645, 26373, 61659, 23671}}, {6918, 17, 10163, {1, 1, 1, 9, 23, 63, 99, 91, 377, 275, 275, 3005, 1563, 5945, 23825, 33211, 52753}}, {6919, 17, 10180, {1, 1, 1, 1, 31, 55, 31, 109, 481, 581, 771, 197, 6155, 3465, 8451, 25925, 41159}}, {6920, 17, 10187, {1, 3, 7, 13, 5, 33, 113, 161, 265, 493, 1723, 513, 5111, 10177, 21755, 5321, 58831}}, {6921, 17, 10198, {1, 1, 7, 1, 21, 33, 117, 183, 89, 689, 1253, 2215, 6565, 3079, 16343, 22427, 96447}}, {6922, 17, 10208, {1, 1, 1, 5, 15, 61, 5, 139, 111, 463, 573, 1907, 4615, 14975, 5715, 51017, 69827}}, {6923, 17, 10214, {1, 1, 1, 13, 3, 3, 117, 249, 25, 361, 1177, 2901, 1601, 11381, 18981, 44811, 47117}}, {6924, 17, 10220, {1, 1, 5, 3, 29, 5, 49, 221, 247, 57, 553, 1889, 479, 15581, 7035, 7293, 53065}}, {6925, 17, 10237, {1, 3, 3, 3, 15, 49, 91, 187, 213, 981, 1417, 211, 3719, 13693, 17671, 16691, 57147}}, {6926, 17, 10238, {1, 1, 7, 9, 7, 17, 109, 185, 459, 769, 1783, 899, 885, 2291, 30023, 26315, 7337}}, {6927, 17, 10241, {1, 1, 5, 11, 11, 31, 73, 191, 95, 25, 1953, 1387, 1077, 7547, 9661, 57739, 76799}}, {6928, 17, 10244, {1, 1, 7, 13, 23, 41, 69, 177, 407, 699, 1055, 3653, 1239, 8113, 12823, 1803, 117815}}, {6929, 17, 10251, {1, 1, 1, 15, 1, 55, 71, 133, 401, 593, 605, 2855, 4569, 3533, 14141, 65457, 125655}}, {6930, 17, 10253, {1, 1, 7, 9, 31, 55, 53, 11, 65, 17, 561, 925, 1561, 8929, 19859, 57111, 12777}}, {6931, 17, 10256, {1, 3, 3, 11, 7, 59, 125, 205, 473, 655, 1429, 337, 6829, 7551, 27873, 11667, 39231}}, {6932, 17, 10259, {1, 3, 3, 9, 13, 23, 25, 161, 443, 545, 1967, 1895, 6929, 5975, 17801, 41769, 30429}}, {6933, 17, 10266, {1, 3, 7, 13, 15, 1, 99, 43, 45, 451, 21, 639, 7121, 4781, 2813, 419, 17761}}, {6934, 17, 10284, {1, 1, 5, 13, 11, 9, 53, 83, 443, 441, 1601, 3177, 1913, 12211, 25835, 1733, 4793}}, {6935, 17, 10290, {1, 3, 3, 1, 13, 15, 11, 187, 471, 699, 1751, 3279, 2305, 15259, 31541, 21357, 73763}}, {6936, 17, 10331, {1, 3, 5, 9, 23, 11, 125, 57, 261, 479, 879, 719, 3221, 2943, 10593, 11521, 83979}}, {6937, 17, 10334, {1, 3, 7, 13, 3, 39, 119, 135, 85, 417, 1675, 971, 7577, 12709, 20407, 26105, 97021}}, {6938, 17, 10350, {1, 1, 5, 11, 15, 63, 83, 141, 281, 663, 1745, 2775, 5605, 9127, 553, 7177, 115969}}, {6939, 17, 10355, {1, 1, 7, 1, 19, 47, 7, 165, 87, 95, 361, 1879, 6351, 2861, 9103, 37489, 24525}}, {6940, 17, 10357, {1, 3, 3, 11, 9, 21, 51, 149, 375, 967, 1583, 1427, 1223, 11611, 7481, 36619, 128429}}, {6941, 17, 10367, {1, 1, 5, 1, 3, 31, 7, 217, 453, 565, 1517, 2847, 6937, 1197, 24339, 44311, 66843}}, {6942, 17, 10368, {1, 1, 5, 3, 3, 17, 127, 59, 3, 905, 531, 1179, 3559, 5175, 24627, 60941, 129457}}, {6943, 17, 10377, {1, 1, 1, 7, 15, 15, 1, 31, 373, 643, 279, 3831, 4881, 9763, 17641, 43219, 83109}}, {6944, 17, 10388, {1, 3, 3, 9, 5, 21, 41, 71, 371, 201, 573, 1481, 3631, 10783, 6679, 1089, 117347}}, {6945, 17, 10407, {1, 1, 7, 7, 5, 25, 73, 63, 173, 197, 147, 981, 1491, 1597, 11733, 14285, 74021}}, {6946, 17, 10421, {1, 1, 5, 11, 17, 15, 3, 175, 391, 503, 1745, 319, 791, 5607, 18173, 37319, 92025}}, {6947, 17, 10434, {1, 3, 1, 1, 9, 37, 43, 81, 439, 951, 805, 251, 4625, 15617, 13715, 62263, 3827}}, {6948, 17, 10439, {1, 3, 1, 1, 25, 21, 67, 191, 499, 205, 1355, 105, 1637, 563, 22291, 9045, 6545}}, {6949, 17, 10440, {1, 1, 5, 5, 9, 3, 75, 75, 287, 303, 1767, 1789, 3437, 4637, 9605, 2537, 64935}}, {6950, 17, 10443, {1, 1, 3, 3, 1, 51, 27, 155, 375, 149, 885, 187, 1551, 13109, 27011, 57301, 41047}}, {6951, 17, 10446, {1, 1, 7, 5, 21, 23, 1, 81, 163, 231, 2039, 1519, 1279, 15379, 25549, 6711, 81499}}, {6952, 17, 10457, {1, 1, 3, 5, 3, 37, 71, 243, 165, 365, 379, 351, 4649, 4287, 13395, 30329, 78383}}, {6953, 17, 10469, {1, 3, 1, 1, 25, 63, 27, 215, 223, 699, 2029, 3737, 5947, 7287, 20813, 4931, 19345}}, {6954, 17, 10476, {1, 1, 3, 15, 21, 7, 25, 187, 219, 53, 1749, 1797, 3533, 14307, 53, 11095, 75469}}, {6955, 17, 10479, {1, 1, 3, 13, 27, 31, 91, 121, 481, 291, 915, 535, 4291, 5271, 12181, 55921, 125917}}, {6956, 17, 10481, {1, 3, 1, 1, 3, 29, 21, 251, 361, 747, 997, 2989, 1809, 7235, 17855, 31027, 100689}}, {6957, 17, 10494, {1, 3, 7, 1, 21, 13, 49, 93, 183, 673, 881, 1931, 7009, 2565, 26021, 53815, 19807}}, {6958, 17, 10501, {1, 1, 7, 13, 9, 23, 47, 237, 487, 843, 1357, 919, 1753, 903, 2911, 31527, 73027}}, {6959, 17, 10505, {1, 1, 1, 1, 25, 33, 97, 241, 421, 375, 73, 2541, 6231, 14659, 15335, 5915, 110791}}, {6960, 17, 10516, {1, 3, 3, 7, 21, 17, 97, 125, 7, 271, 167, 475, 4887, 1847, 30173, 25913, 36659}}, {6961, 17, 10532, {1, 1, 3, 15, 15, 37, 67, 5, 463, 423, 823, 941, 1551, 14175, 15377, 6017, 118297}}, {6962, 17, 10541, {1, 1, 1, 7, 31, 51, 71, 127, 73, 517, 881, 3205, 6219, 11213, 14783, 64275, 70033}}, {6963, 17, 10547, {1, 3, 1, 5, 17, 17, 57, 107, 359, 999, 1415, 757, 4743, 7775, 14111, 20075, 73269}}, {6964, 17, 10550, {1, 3, 5, 3, 21, 57, 87, 43, 307, 777, 717, 3329, 4159, 12545, 31355, 31329, 41377}}, {6965, 17, 10591, {1, 3, 7, 15, 25, 43, 19, 147, 487, 517, 977, 3625, 2311, 14173, 15167, 56563, 110417}}, {6966, 17, 10597, {1, 3, 3, 11, 23, 1, 67, 157, 461, 169, 231, 1977, 5657, 865, 711, 24213, 76895}}, {6967, 17, 10602, {1, 1, 7, 13, 5, 37, 51, 165, 331, 97, 431, 3819, 1379, 12083, 27521, 19689, 100119}}, {6968, 17, 10610, {1, 1, 7, 15, 29, 21, 59, 193, 397, 467, 951, 3037, 2955, 13235, 20981, 63865, 30069}}, {6969, 17, 10619, {1, 3, 3, 5, 7, 49, 41, 143, 319, 71, 353, 2159, 3043, 15317, 24095, 12017, 64393}}, {6970, 17, 10631, {1, 1, 5, 13, 25, 45, 57, 153, 311, 805, 953, 1763, 5655, 3961, 12085, 58761, 76533}}, {6971, 17, 10646, {1, 1, 3, 15, 29, 19, 71, 107, 203, 221, 1173, 1597, 1179, 9649, 21659, 10463, 8195}}, {6972, 17, 10655, {1, 1, 3, 9, 31, 29, 53, 151, 247, 577, 543, 459, 8141, 5613, 12029, 24199, 118603}}, {6973, 17, 10665, {1, 3, 1, 5, 1, 55, 103, 23, 405, 5, 181, 3805, 1103, 13389, 6725, 48733, 99639}}, {6974, 17, 10673, {1, 1, 5, 9, 1, 47, 115, 231, 151, 885, 427, 2849, 361, 12969, 705, 41711, 53587}}, {6975, 17, 10674, {1, 1, 3, 11, 9, 3, 11, 231, 77, 775, 657, 2721, 3431, 11919, 10425, 29405, 91561}}, {6976, 17, 10680, {1, 1, 1, 5, 5, 7, 79, 41, 181, 333, 963, 3117, 7703, 2259, 16671, 51139, 27997}}, {6977, 17, 10693, {1, 3, 7, 7, 13, 55, 59, 157, 377, 711, 1475, 1509, 1375, 6825, 13729, 28613, 109199}}, {6978, 17, 10700, {1, 3, 3, 3, 13, 11, 51, 1, 67, 609, 467, 2161, 7693, 9019, 1847, 27969, 74863}}, {6979, 17, 10721, {1, 1, 3, 3, 11, 33, 87, 217, 239, 505, 1451, 2801, 1417, 695, 29883, 15877, 99969}}, {6980, 17, 10727, {1, 3, 3, 5, 3, 61, 9, 171, 57, 547, 2003, 2335, 2259, 3205, 5639, 21721, 25893}}, {6981, 17, 10746, {1, 3, 1, 3, 19, 15, 83, 69, 47, 897, 627, 2839, 7123, 8567, 14707, 13159, 125139}}, {6982, 17, 10748, {1, 3, 7, 11, 1, 59, 53, 33, 135, 1009, 1829, 3011, 1245, 421, 28909, 45517, 55071}}, {6983, 17, 10757, {1, 1, 5, 9, 3, 27, 11, 243, 235, 683, 1329, 3145, 2141, 14027, 3707, 5933, 51965}}, {6984, 17, 10761, {1, 1, 5, 7, 13, 63, 79, 105, 27, 195, 1657, 3107, 1245, 1681, 29619, 10589, 78197}}, {6985, 17, 10770, {1, 3, 3, 7, 21, 1, 5, 79, 73, 125, 1587, 3053, 5977, 10745, 28343, 39023, 56201}}, {6986, 17, 10776, {1, 1, 3, 15, 23, 21, 39, 41, 173, 913, 1267, 1323, 2967, 1979, 16763, 53753, 21905}}, {6987, 17, 10782, {1, 1, 5, 7, 11, 11, 117, 151, 409, 345, 1461, 1703, 687, 557, 31651, 35507, 54909}}, {6988, 17, 10791, {1, 1, 1, 15, 15, 49, 55, 223, 289, 765, 1737, 1117, 3717, 15465, 31949, 55061, 97091}}, {6989, 17, 10792, {1, 1, 5, 9, 21, 29, 99, 13, 119, 35, 1461, 61, 5155, 6785, 15957, 11295, 52203}}, {6990, 17, 10805, {1, 3, 5, 7, 23, 39, 73, 161, 465, 715, 153, 3529, 2243, 13773, 16573, 26233, 130263}}, {6991, 17, 10810, {1, 3, 7, 9, 11, 51, 5, 149, 501, 119, 2047, 3417, 3955, 15055, 31633, 473, 127305}}, {6992, 17, 10832, {1, 1, 1, 9, 31, 57, 91, 119, 215, 11, 1013, 3969, 1285, 11521, 8039, 36737, 86365}}, {6993, 17, 10835, {1, 1, 5, 3, 7, 17, 9, 27, 59, 883, 541, 3027, 6219, 1091, 2453, 38247, 21323}}, {6994, 17, 10841, {1, 1, 1, 1, 25, 39, 55, 249, 61, 313, 467, 1763, 4067, 8367, 32431, 44463, 66439}}, {6995, 17, 10842, {1, 3, 3, 1, 13, 3, 37, 209, 21, 653, 1971, 3649, 6165, 3789, 12793, 56327, 60351}}, {6996, 17, 10847, {1, 1, 7, 9, 31, 33, 21, 51, 313, 631, 515, 1761, 4149, 2601, 12481, 25975, 94061}}, {6997, 17, 10853, {1, 1, 7, 15, 3, 7, 55, 129, 297, 735, 779, 633, 3265, 11713, 3893, 61197, 113991}}, {6998, 17, 10860, {1, 3, 5, 13, 1, 15, 27, 253, 435, 595, 1163, 2753, 7399, 15225, 26215, 59753, 74933}}, {6999, 17, 10871, {1, 1, 7, 7, 15, 23, 111, 43, 467, 957, 1687, 2893, 2315, 2025, 1475, 9061, 101611}}, {7000, 17, 10878, {1, 1, 3, 3, 29, 41, 53, 169, 125, 415, 361, 869, 3399, 8821, 18193, 38575, 73979}}, {7001, 17, 10881, {1, 1, 1, 15, 3, 5, 27, 5, 293, 765, 1809, 1961, 955, 12441, 10915, 2363, 49617}}, {7002, 17, 10888, {1, 1, 5, 15, 19, 11, 3, 91, 59, 323, 545, 1177, 7967, 2729, 14085, 3283, 79859}}, {7003, 17, 10894, {1, 1, 7, 13, 11, 17, 29, 163, 295, 951, 311, 3471, 1339, 10719, 701, 32377, 41685}}, {7004, 17, 10901, {1, 3, 5, 7, 21, 19, 81, 247, 495, 767, 251, 3455, 6383, 7221, 19943, 64865, 33193}}, {7005, 17, 10915, {1, 1, 7, 15, 23, 41, 63, 195, 311, 619, 211, 743, 889, 7627, 12527, 15865, 40103}}, {7006, 17, 10918, {1, 1, 3, 1, 23, 23, 57, 221, 153, 27, 939, 3949, 411, 6357, 31985, 939, 91001}}, {7007, 17, 10922, {1, 3, 5, 15, 7, 5, 35, 135, 245, 921, 307, 823, 775, 4891, 24575, 53503, 48147}}, {7008, 17, 10936, {1, 1, 5, 7, 9, 31, 23, 139, 477, 495, 287, 807, 1855, 8321, 13963, 52197, 78509}}, {7009, 17, 10954, {1, 3, 3, 3, 29, 59, 33, 83, 211, 65, 623, 1269, 1745, 16383, 10759, 57199, 14035}}, {7010, 17, 10968, {1, 3, 3, 15, 25, 55, 69, 171, 411, 937, 731, 2275, 2597, 4133, 5089, 50507, 39989}}, {7011, 17, 10971, {1, 3, 1, 9, 5, 47, 51, 21, 171, 913, 233, 43, 2673, 471, 27077, 57039, 32579}}, {7012, 17, 10973, {1, 3, 5, 3, 29, 35, 5, 105, 233, 379, 77, 1775, 2409, 4597, 19879, 12691, 49739}}, {7013, 17, 10978, {1, 3, 7, 13, 17, 29, 117, 177, 163, 927, 45, 3227, 7263, 5551, 9219, 32101, 122473}}, {7014, 17, 10998, {1, 1, 7, 5, 31, 39, 75, 147, 311, 991, 1431, 3821, 6891, 9637, 17887, 661, 23067}}, {7015, 17, 11009, {1, 3, 5, 13, 31, 53, 69, 79, 153, 329, 207, 479, 2395, 6505, 29553, 52023, 31531}}, {7016, 17, 11021, {1, 3, 1, 7, 15, 7, 87, 233, 25, 275, 981, 1207, 3083, 16349, 30185, 60611, 120607}}, {7017, 17, 11029, {1, 1, 5, 3, 21, 7, 47, 173, 291, 965, 65, 545, 7465, 4471, 2249, 34281, 107217}}, {7018, 17, 11030, {1, 1, 3, 11, 19, 53, 17, 243, 193, 297, 1937, 1513, 4979, 14867, 15497, 10049, 9135}}, {7019, 17, 11034, {1, 3, 1, 3, 25, 39, 29, 63, 231, 145, 247, 1745, 3439, 8635, 26687, 18595, 67123}}, {7020, 17, 11050, {1, 1, 7, 9, 29, 33, 89, 175, 429, 675, 891, 1739, 3567, 5453, 30427, 33671, 83395}}, {7021, 17, 11063, {1, 3, 1, 5, 31, 25, 69, 237, 235, 307, 1217, 3805, 153, 13387, 6209, 14179, 128725}}, {7022, 17, 11064, {1, 1, 3, 3, 19, 45, 117, 135, 67, 601, 369, 3369, 5505, 2049, 24099, 22515, 96575}}, {7023, 17, 11077, {1, 1, 1, 3, 3, 45, 29, 255, 327, 77, 1103, 4067, 2875, 6487, 5903, 26625, 19631}}, {7024, 17, 11078, {1, 3, 5, 1, 31, 63, 115, 7, 255, 855, 913, 1779, 7001, 14387, 26765, 51987, 3191}}, {7025, 17, 11105, {1, 1, 3, 11, 15, 43, 71, 247, 303, 231, 445, 3963, 3699, 11851, 18941, 43465, 63431}}, {7026, 17, 11106, {1, 1, 3, 5, 31, 33, 93, 127, 267, 399, 653, 1997, 5005, 14535, 4813, 64065, 2159}}, {7027, 17, 11126, {1, 3, 7, 13, 31, 39, 61, 155, 141, 515, 1217, 161, 4309, 3697, 22445, 43599, 43329}}, {7028, 17, 11129, {1, 3, 3, 3, 7, 51, 103, 147, 511, 971, 195, 3731, 6629, 12125, 12053, 34951, 60059}}, {7029, 17, 11135, {1, 1, 5, 11, 21, 49, 99, 31, 55, 309, 1805, 2253, 7095, 15265, 28445, 54813, 48615}}, {7030, 17, 11151, {1, 3, 1, 15, 9, 41, 61, 125, 65, 143, 1567, 3259, 6757, 653, 31601, 63127, 52179}}, {7031, 17, 11159, {1, 1, 5, 3, 29, 5, 19, 197, 153, 447, 7, 1713, 469, 6043, 1259, 63641, 29171}}, {7032, 17, 11165, {1, 3, 3, 7, 3, 41, 95, 245, 445, 15, 607, 565, 2361, 2673, 21077, 20153, 6199}}, {7033, 17, 11176, {1, 1, 5, 1, 5, 59, 93, 127, 485, 663, 683, 635, 1599, 16377, 31819, 6539, 27789}}, {7034, 17, 11179, {1, 3, 1, 3, 31, 3, 11, 215, 441, 1005, 1815, 3945, 5109, 5539, 23935, 62671, 90731}}, {7035, 17, 11182, {1, 3, 3, 1, 13, 47, 19, 229, 191, 427, 1141, 2321, 7105, 1587, 26347, 63265, 23377}}, {7036, 17, 11189, {1, 1, 5, 15, 31, 55, 61, 93, 89, 945, 1203, 3631, 4457, 15097, 32019, 41747, 46009}}, {7037, 17, 11204, {1, 1, 5, 13, 5, 33, 69, 59, 93, 247, 503, 421, 1923, 9855, 9825, 14257, 98663}}, {7038, 17, 11216, {1, 3, 1, 13, 27, 21, 91, 39, 131, 571, 1527, 2715, 2061, 627, 19705, 47165, 84345}}, {7039, 17, 11232, {1, 1, 1, 7, 3, 3, 7, 251, 225, 959, 1017, 2423, 6163, 1549, 7473, 3193, 104259}}, {7040, 17, 11235, {1, 3, 3, 1, 5, 5, 115, 221, 505, 649, 1525, 2459, 167, 1899, 23939, 29253, 122835}}, {7041, 17, 11242, {1, 3, 1, 5, 15, 9, 123, 221, 133, 43, 31, 1211, 4737, 5001, 20065, 6369, 93865}}, {7042, 17, 11250, {1, 1, 5, 11, 11, 5, 23, 29, 333, 133, 1469, 1895, 5879, 15599, 2131, 25005, 96271}}, {7043, 17, 11264, {1, 1, 3, 11, 25, 11, 19, 57, 397, 645, 1233, 2433, 6371, 10577, 15489, 60709, 3957}}, {7044, 17, 11273, {1, 3, 1, 1, 19, 3, 33, 131, 429, 835, 1363, 2213, 3185, 14385, 8831, 43159, 32975}}, {7045, 17, 11282, {1, 1, 5, 5, 23, 11, 127, 139, 213, 259, 897, 1913, 5737, 1287, 26617, 4885, 30193}}, {7046, 17, 11288, {1, 3, 5, 13, 3, 27, 99, 31, 11, 27, 1003, 2473, 7055, 12923, 4269, 41433, 90637}}, {7047, 17, 11291, {1, 3, 1, 7, 17, 25, 95, 151, 199, 237, 207, 1879, 2943, 9845, 3765, 53533, 111191}}, {7048, 17, 11293, {1, 3, 1, 9, 19, 27, 5, 249, 85, 185, 1883, 1401, 2041, 12721, 20593, 30993, 2601}}, {7049, 17, 11318, {1, 3, 3, 9, 23, 1, 15, 133, 387, 779, 707, 2723, 4485, 989, 27125, 37295, 125319}}, {7050, 17, 11321, {1, 1, 7, 3, 9, 41, 81, 151, 349, 941, 357, 3817, 7123, 10079, 27519, 107, 102281}}, {7051, 17, 11329, {1, 1, 1, 1, 13, 5, 111, 167, 73, 85, 1185, 1213, 333, 153, 13101, 38087, 39389}}, {7052, 17, 11336, {1, 3, 3, 15, 11, 41, 99, 231, 377, 539, 1335, 1059, 5373, 9611, 27927, 29801, 85749}}, {7053, 17, 11339, {1, 3, 1, 9, 19, 37, 125, 27, 15, 699, 1867, 2711, 1589, 1675, 32007, 61339, 96919}}, {7054, 17, 11342, {1, 3, 3, 3, 3, 27, 21, 159, 249, 783, 1517, 2923, 2609, 1207, 13705, 57371, 43603}}, {7055, 17, 11356, {1, 1, 5, 15, 17, 55, 77, 1, 401, 897, 987, 345, 5283, 5827, 17755, 44371, 13253}}, {7056, 17, 11383, {1, 3, 1, 7, 3, 3, 99, 237, 487, 405, 771, 3503, 1199, 4779, 26893, 45821, 46383}}, {7057, 17, 11389, {1, 1, 7, 3, 9, 47, 81, 27, 459, 989, 1891, 3997, 4081, 4075, 15079, 65081, 125185}}, {7058, 17, 11405, {1, 3, 5, 9, 25, 23, 71, 251, 251, 197, 353, 3553, 2165, 2953, 3733, 52369, 100641}}, {7059, 17, 11411, {1, 1, 1, 5, 25, 43, 63, 187, 495, 345, 1547, 2293, 7327, 7797, 14001, 61865, 40329}}, {7060, 17, 11423, {1, 1, 5, 15, 25, 37, 67, 23, 315, 801, 71, 1235, 7293, 7207, 30929, 9417, 94735}}, {7061, 17, 11424, {1, 1, 1, 3, 23, 29, 87, 171, 337, 457, 1597, 3933, 4151, 1237, 19563, 56997, 81497}}, {7062, 17, 11430, {1, 3, 3, 11, 3, 33, 79, 239, 277, 611, 205, 2283, 7459, 425, 21999, 26491, 58681}}, {7063, 17, 11444, {1, 1, 7, 1, 5, 37, 53, 93, 205, 97, 779, 3623, 7777, 521, 21915, 46539, 128811}}, {7064, 17, 11447, {1, 1, 5, 7, 19, 7, 39, 183, 299, 193, 1351, 3867, 5709, 11655, 1231, 15555, 128023}}, {7065, 17, 11459, {1, 3, 7, 11, 31, 13, 113, 57, 197, 841, 921, 2087, 2195, 8279, 8353, 1955, 22121}}, {7066, 17, 11465, {1, 3, 3, 11, 21, 55, 61, 105, 357, 747, 363, 3511, 2547, 16283, 25747, 56041, 33695}}, {7067, 17, 11473, {1, 3, 3, 13, 27, 13, 5, 27, 93, 691, 1869, 2331, 3131, 14411, 2355, 37195, 129273}}, {7068, 17, 11479, {1, 3, 3, 7, 27, 9, 11, 165, 435, 811, 215, 1617, 347, 4289, 29373, 15749, 91445}}, {7069, 17, 11501, {1, 1, 7, 13, 29, 3, 95, 53, 457, 633, 959, 3705, 7461, 9307, 21963, 51599, 6751}}, {7070, 17, 11510, {1, 1, 1, 15, 29, 25, 95, 1, 125, 61, 683, 2067, 6485, 9095, 5571, 61281, 70865}}, {7071, 17, 11514, {1, 1, 7, 7, 1, 35, 119, 107, 247, 991, 237, 1865, 3961, 12583, 11417, 14913, 90897}}, {7072, 17, 11522, {1, 3, 7, 15, 11, 51, 73, 193, 289, 381, 1767, 3803, 3197, 3797, 15059, 19393, 98947}}, {7073, 17, 11527, {1, 1, 5, 3, 13, 7, 91, 223, 347, 59, 1721, 1501, 6391, 4141, 14495, 47283, 47237}}, {7074, 17, 11533, {1, 3, 7, 11, 17, 39, 43, 247, 35, 423, 1859, 3199, 5343, 7061, 8609, 6819, 88575}}, {7075, 17, 11536, {1, 1, 5, 13, 31, 27, 57, 19, 499, 1007, 1965, 795, 1231, 12755, 24631, 53343, 82305}}, {7076, 17, 11548, {1, 1, 1, 9, 13, 23, 127, 161, 245, 467, 2025, 2545, 3085, 13035, 27087, 14461, 35971}}, {7077, 17, 11551, {1, 3, 5, 1, 7, 3, 99, 159, 75, 341, 1755, 2337, 5981, 5055, 19445, 30043, 61427}}, {7078, 17, 11552, {1, 1, 1, 7, 13, 33, 41, 73, 267, 21, 961, 3509, 6839, 13215, 8471, 46735, 93071}}, {7079, 17, 11555, {1, 3, 7, 7, 3, 25, 81, 239, 357, 445, 1483, 389, 3891, 5131, 21357, 34757, 111063}}, {7080, 17, 11572, {1, 3, 7, 1, 1, 37, 119, 121, 195, 935, 1711, 2049, 7001, 7117, 9957, 7309, 102293}}, {7081, 17, 11587, {1, 1, 7, 11, 1, 49, 107, 95, 149, 329, 289, 1121, 7217, 15091, 19071, 13801, 13}}, {7082, 17, 11601, {1, 1, 1, 13, 17, 17, 7, 105, 81, 1017, 1867, 1567, 5133, 7325, 19797, 16301, 40471}}, {7083, 17, 11613, {1, 3, 5, 5, 27, 45, 117, 135, 499, 53, 973, 121, 53, 8771, 11893, 35827, 57691}}, {7084, 17, 11614, {1, 1, 1, 1, 7, 23, 11, 163, 17, 871, 129, 2959, 5583, 12253, 1419, 28367, 32539}}, {7085, 17, 11618, {1, 1, 3, 5, 23, 31, 127, 33, 115, 799, 331, 1873, 1729, 1383, 23601, 51145, 72027}}, {7086, 17, 11624, {1, 1, 1, 9, 15, 49, 105, 163, 51, 539, 451, 3983, 6509, 1073, 30757, 13971, 51371}}, {7087, 17, 11630, {1, 1, 7, 1, 1, 57, 71, 135, 5, 171, 983, 951, 777, 9257, 3607, 3239, 76237}}, {7088, 17, 11663, {1, 1, 7, 7, 21, 17, 49, 175, 9, 807, 289, 2777, 7309, 14911, 28349, 43871, 96019}}, {7089, 17, 11682, {1, 3, 1, 13, 5, 7, 83, 215, 297, 319, 347, 633, 7285, 8293, 18811, 31065, 114077}}, {7090, 17, 11684, {1, 3, 1, 11, 3, 29, 91, 231, 161, 601, 355, 2719, 2941, 6065, 21849, 58051, 46515}}, {7091, 17, 11702, {1, 1, 3, 9, 25, 41, 111, 135, 71, 755, 29, 131, 1339, 5053, 15713, 14557, 106777}}, {7092, 17, 11705, {1, 1, 7, 13, 21, 59, 13, 45, 503, 71, 1611, 4021, 2359, 11653, 7261, 14537, 33031}}, {7093, 17, 11713, {1, 1, 1, 11, 5, 31, 1, 181, 37, 527, 1345, 1979, 4899, 3289, 25181, 49959, 44609}}, {7094, 17, 11731, {1, 3, 3, 13, 21, 25, 33, 105, 57, 637, 841, 1595, 3881, 5053, 9441, 58717, 127255}}, {7095, 17, 11734, {1, 3, 5, 7, 23, 57, 9, 117, 281, 769, 1573, 2857, 1139, 6413, 14001, 21097, 55215}}, {7096, 17, 11740, {1, 1, 7, 7, 3, 5, 75, 149, 269, 353, 437, 61, 2451, 11987, 17243, 5649, 105107}}, {7097, 17, 11747, {1, 1, 3, 3, 25, 61, 53, 21, 113, 57, 1415, 2825, 11, 14977, 6159, 4181, 96765}}, {7098, 17, 11754, {1, 1, 7, 5, 15, 25, 121, 159, 71, 773, 601, 147, 6507, 16171, 16607, 32017, 77845}}, {7099, 17, 11761, {1, 3, 1, 1, 27, 19, 59, 109, 347, 991, 165, 683, 6147, 493, 22017, 19069, 52857}}, {7100, 17, 11762, {1, 1, 5, 5, 21, 1, 93, 115, 407, 15, 421, 1305, 3495, 14287, 31831, 65347, 35339}}, {7101, 17, 11787, {1, 3, 5, 11, 29, 35, 87, 27, 453, 769, 1991, 2757, 2607, 9225, 293, 49441, 18185}}, {7102, 17, 11792, {1, 1, 5, 3, 23, 41, 67, 195, 499, 903, 197, 1121, 4691, 9277, 29225, 34597, 37395}}, {7103, 17, 11814, {1, 1, 7, 7, 21, 7, 65, 245, 241, 909, 1063, 2271, 1979, 10287, 1747, 61523, 72969}}, {7104, 17, 11823, {1, 3, 1, 13, 23, 25, 3, 89, 385, 481, 1463, 3431, 6907, 1129, 3519, 35789, 82585}}, {7105, 17, 11825, {1, 3, 5, 3, 31, 17, 11, 209, 77, 991, 885, 3341, 6895, 3429, 21611, 38555, 35475}}, {7106, 17, 11837, {1, 1, 3, 1, 9, 61, 27, 219, 433, 787, 281, 1155, 2915, 4449, 30881, 34461, 15357}}, {7107, 17, 11838, {1, 1, 3, 15, 27, 55, 51, 101, 117, 799, 1475, 4013, 5145, 14991, 27847, 49537, 57339}}, {7108, 17, 11846, {1, 3, 7, 13, 13, 9, 13, 167, 283, 883, 1501, 2635, 1463, 3353, 14961, 30349, 62043}}, {7109, 17, 11855, {1, 1, 7, 3, 3, 47, 119, 37, 389, 655, 701, 2471, 5749, 6645, 845, 27065, 82299}}, {7110, 17, 11864, {1, 1, 7, 15, 27, 5, 95, 195, 227, 991, 1137, 3715, 4901, 9459, 1917, 43857, 126505}}, {7111, 17, 11876, {1, 3, 7, 5, 29, 35, 45, 165, 361, 257, 641, 1265, 6533, 11333, 26081, 12621, 66909}}, {7112, 17, 11885, {1, 1, 1, 11, 19, 55, 73, 137, 29, 355, 725, 1161, 6717, 2035, 19769, 43531, 72577}}, {7113, 17, 11904, {1, 3, 7, 5, 19, 3, 99, 17, 387, 621, 137, 117, 6567, 7667, 14979, 17981, 68319}}, {7114, 17, 11909, {1, 1, 5, 5, 7, 53, 31, 33, 245, 371, 691, 2763, 95, 16369, 7853, 29839, 34957}}, {7115, 17, 11913, {1, 1, 3, 1, 9, 1, 83, 177, 17, 141, 1739, 1791, 3849, 3093, 22271, 53755, 7817}}, {7116, 17, 11916, {1, 3, 3, 1, 3, 51, 71, 69, 439, 987, 807, 3353, 4747, 16031, 29591, 61091, 95675}}, {7117, 17, 11940, {1, 3, 5, 1, 17, 47, 51, 211, 7, 5, 1751, 1735, 1647, 13389, 13861, 49427, 13577}}, {7118, 17, 11943, {1, 3, 7, 5, 11, 23, 17, 55, 11, 61, 809, 927, 6533, 1509, 29261, 21555, 55075}}, {7119, 17, 11972, {1, 3, 1, 1, 15, 51, 37, 47, 183, 117, 597, 3225, 1435, 13359, 19127, 17339, 17345}}, {7120, 17, 11981, {1, 1, 5, 3, 5, 11, 33, 179, 295, 129, 29, 713, 1561, 27, 21087, 50305, 39253}}, {7121, 17, 11990, {1, 1, 5, 7, 17, 25, 105, 241, 41, 915, 1223, 2625, 617, 10983, 10749, 2137, 101831}}, {7122, 17, 11993, {1, 3, 5, 7, 15, 15, 85, 23, 193, 625, 1803, 2903, 1935, 523, 8377, 12165, 105851}}, {7123, 17, 12000, {1, 3, 3, 7, 3, 35, 5, 107, 191, 855, 405, 1659, 5523, 5011, 6401, 45187, 31345}}, {7124, 17, 12005, {1, 3, 3, 1, 9, 21, 103, 75, 501, 669, 547, 3685, 411, 2663, 14743, 13869, 124389}}, {7125, 17, 12015, {1, 3, 5, 13, 15, 37, 39, 79, 19, 165, 1685, 1367, 5951, 12303, 13423, 51083, 119933}}, {7126, 17, 12020, {1, 1, 3, 1, 7, 25, 1, 221, 415, 591, 859, 1457, 1789, 2269, 15947, 31913, 86397}}, {7127, 17, 12038, {1, 3, 7, 15, 11, 49, 15, 171, 45, 925, 407, 1719, 4505, 5695, 17397, 28849, 77}}, {7128, 17, 12042, {1, 1, 3, 11, 21, 33, 91, 115, 263, 141, 753, 3335, 7695, 1981, 6029, 22629, 2467}}, {7129, 17, 12056, {1, 3, 5, 3, 25, 5, 21, 67, 429, 323, 223, 2395, 761, 14817, 12387, 37905, 19551}}, {7130, 17, 12065, {1, 3, 1, 15, 31, 43, 35, 255, 73, 533, 1093, 965, 557, 607, 6913, 35283, 12261}}, {7131, 17, 12066, {1, 3, 1, 15, 25, 13, 39, 83, 77, 269, 1205, 1577, 4095, 6669, 8643, 48807, 98227}}, {7132, 17, 12072, {1, 3, 3, 7, 31, 57, 25, 177, 441, 973, 1255, 675, 5579, 4899, 27925, 52555, 70845}}, {7133, 17, 12080, {1, 3, 1, 5, 13, 47, 15, 75, 387, 461, 1909, 841, 7, 9567, 913, 41411, 12565}}, {7134, 17, 12083, {1, 1, 5, 7, 5, 21, 17, 189, 319, 645, 403, 2723, 6747, 15471, 26533, 12709, 49417}}, {7135, 17, 12090, {1, 1, 5, 7, 7, 41, 99, 179, 137, 435, 1061, 3987, 4583, 4101, 23781, 54263, 36695}}, {7136, 17, 12092, {1, 3, 1, 11, 19, 37, 125, 177, 111, 921, 1003, 1433, 1399, 3991, 28193, 40471, 97041}}, {7137, 17, 12103, {1, 1, 7, 1, 5, 33, 7, 139, 127, 413, 1171, 2237, 265, 10145, 18793, 28957, 25037}}, {7138, 17, 12109, {1, 3, 1, 1, 25, 37, 13, 17, 471, 195, 1645, 3165, 5635, 8433, 28507, 453, 107709}}, {7139, 17, 12112, {1, 3, 3, 11, 1, 55, 119, 97, 243, 371, 95, 97, 7833, 777, 12177, 1861, 56323}}, {7140, 17, 12117, {1, 1, 7, 5, 7, 29, 59, 219, 405, 411, 275, 111, 4899, 10367, 24331, 57295, 47065}}, {7141, 17, 12121, {1, 1, 3, 3, 19, 23, 91, 111, 221, 195, 1013, 3001, 3227, 6359, 30383, 49699, 49157}}, {7142, 17, 12137, {1, 1, 5, 7, 1, 21, 125, 23, 177, 291, 249, 861, 1899, 14101, 5079, 5211, 14373}}, {7143, 17, 12143, {1, 1, 7, 11, 11, 59, 33, 41, 291, 919, 253, 609, 1657, 14633, 15189, 22245, 99815}}, {7144, 17, 12145, {1, 3, 5, 3, 23, 49, 71, 137, 393, 343, 1845, 343, 5853, 6639, 17435, 62143, 76041}}, {7145, 17, 12148, {1, 1, 5, 3, 9, 27, 55, 193, 25, 965, 1453, 2739, 3785, 12497, 29607, 11111, 25145}}, {7146, 17, 12168, {1, 1, 1, 1, 29, 11, 111, 73, 491, 629, 405, 2779, 5313, 589, 1459, 47555, 67945}}, {7147, 17, 12174, {1, 3, 1, 7, 13, 21, 99, 75, 79, 963, 207, 1725, 6875, 8359, 10573, 45219, 130463}}, {7148, 17, 12188, {1, 3, 7, 13, 1, 17, 105, 227, 487, 891, 1053, 1333, 7651, 5415, 18661, 22085, 82055}}, {7149, 17, 12191, {1, 1, 3, 3, 31, 27, 91, 93, 383, 331, 965, 3035, 4931, 13265, 9729, 28985, 118227}}, {7150, 17, 12192, {1, 3, 1, 1, 11, 9, 59, 191, 253, 909, 301, 3811, 255, 14937, 28627, 54509, 95993}}, {7151, 17, 12201, {1, 3, 3, 5, 11, 5, 105, 77, 323, 713, 637, 1857, 2697, 12473, 12261, 2933, 101287}}, {7152, 17, 12224, {1, 3, 3, 11, 9, 63, 19, 19, 213, 859, 1479, 2849, 1067, 5749, 13511, 14933, 11125}}, {7153, 17, 12230, {1, 1, 5, 9, 19, 19, 13, 49, 237, 511, 533, 543, 575, 8095, 27335, 18847, 18173}}, {7154, 17, 12239, {1, 3, 5, 5, 9, 53, 47, 157, 35, 827, 637, 2327, 787, 5269, 5145, 10135, 111273}}, {7155, 17, 12242, {1, 3, 3, 7, 27, 41, 69, 173, 53, 655, 809, 481, 6999, 3101, 20781, 2481, 94957}}, {7156, 17, 12251, {1, 1, 5, 11, 17, 23, 95, 201, 363, 613, 863, 1365, 1131, 15417, 20705, 8283, 55235}}, {7157, 17, 12258, {1, 1, 5, 13, 3, 15, 37, 219, 291, 595, 1665, 1861, 1953, 15385, 20569, 46085, 15163}}, {7158, 17, 12264, {1, 3, 3, 11, 23, 43, 125, 133, 85, 45, 819, 243, 7325, 8723, 1499, 58139, 120353}}, {7159, 17, 12310, {1, 1, 1, 11, 21, 49, 91, 145, 175, 619, 1817, 3533, 8155, 7521, 30361, 45431, 130175}}, {7160, 17, 12319, {1, 1, 3, 1, 11, 59, 57, 51, 37, 903, 1221, 3813, 8043, 14165, 31503, 7905, 61515}}, {7161, 17, 12323, {1, 1, 1, 1, 15, 9, 115, 175, 285, 839, 97, 3119, 719, 15283, 22947, 25417, 40665}}, {7162, 17, 12325, {1, 3, 1, 7, 5, 49, 127, 111, 373, 747, 393, 2351, 4577, 15227, 23149, 16901, 80253}}, {7163, 17, 12332, {1, 1, 5, 3, 15, 5, 95, 197, 251, 275, 831, 1389, 3907, 12343, 11599, 24369, 65361}}, {7164, 17, 12343, {1, 3, 7, 5, 25, 37, 11, 75, 417, 789, 745, 811, 2189, 15381, 4785, 41657, 2897}}, {7165, 17, 12344, {1, 3, 1, 13, 29, 55, 55, 33, 279, 383, 1645, 975, 4683, 1357, 1149, 30271, 90527}}, {7166, 17, 12352, {1, 3, 5, 3, 5, 3, 79, 61, 371, 225, 141, 369, 1037, 12249, 29431, 37253, 9899}}, {7167, 17, 12370, {1, 1, 3, 13, 13, 7, 127, 147, 507, 119, 1085, 1949, 6289, 10179, 10107, 55989, 74395}}, {7168, 17, 12388, {1, 3, 1, 7, 21, 35, 53, 209, 103, 365, 683, 553, 4977, 14371, 24037, 11453, 45369}}, {7169, 17, 12395, {1, 1, 5, 11, 27, 39, 41, 145, 437, 55, 893, 2375, 4977, 5451, 21225, 46815, 1423}}, {7170, 17, 12403, {1, 3, 5, 1, 23, 53, 113, 75, 209, 323, 1975, 3809, 1829, 14625, 3821, 53773, 129173}}, {7171, 17, 12409, {1, 1, 5, 3, 7, 51, 97, 73, 289, 481, 339, 1375, 3101, 4395, 13933, 33267, 68115}}, {7172, 17, 12410, {1, 3, 5, 1, 5, 45, 83, 57, 3, 667, 109, 3979, 6447, 8603, 20147, 49291, 18023}}, {7173, 17, 12415, {1, 3, 7, 1, 11, 7, 45, 233, 65, 745, 1009, 2979, 5965, 10681, 3499, 23077, 87479}}, {7174, 17, 12419, {1, 3, 3, 3, 13, 25, 25, 189, 197, 83, 1429, 2857, 2877, 8577, 24811, 33049, 46009}}, {7175, 17, 12426, {1, 1, 1, 7, 11, 47, 47, 255, 89, 625, 449, 3747, 2035, 3509, 4901, 2961, 14073}}, {7176, 17, 12439, {1, 1, 1, 13, 9, 55, 35, 47, 389, 573, 847, 1037, 1345, 5487, 7575, 57435, 77303}}, {7177, 17, 12445, {1, 1, 5, 11, 25, 51, 113, 109, 79, 339, 95, 2049, 5881, 13209, 20041, 26419, 110319}}, {7178, 17, 12459, {1, 1, 7, 1, 27, 15, 93, 145, 253, 917, 1211, 2221, 1087, 14209, 32097, 20083, 67841}}, {7179, 17, 12464, {1, 1, 3, 15, 13, 19, 67, 107, 75, 919, 2047, 3675, 6231, 1243, 14335, 35939, 17281}}, {7180, 17, 12474, {1, 3, 7, 5, 27, 47, 53, 239, 475, 231, 1645, 825, 4039, 15985, 10853, 32951, 34985}}, {7181, 17, 12484, {1, 1, 7, 5, 15, 61, 107, 93, 51, 221, 717, 2859, 7885, 9571, 11841, 45143, 33723}}, {7182, 17, 12491, {1, 1, 7, 7, 9, 25, 63, 25, 47, 55, 2041, 3965, 215, 14857, 31669, 54775, 42157}}, {7183, 17, 12501, {1, 3, 5, 1, 5, 45, 123, 109, 471, 599, 479, 475, 3499, 11963, 23709, 18851, 66861}}, {7184, 17, 12505, {1, 3, 3, 3, 5, 29, 71, 81, 315, 329, 1471, 3995, 623, 5871, 11171, 15645, 97251}}, {7185, 17, 12508, {1, 1, 7, 11, 15, 15, 101, 173, 445, 871, 765, 1121, 1937, 13055, 7309, 54175, 85559}}, {7186, 17, 12511, {1, 3, 5, 7, 7, 13, 43, 237, 361, 981, 19, 3113, 4681, 3313, 19147, 35193, 87281}}, {7187, 17, 12521, {1, 3, 5, 3, 27, 13, 37, 51, 233, 573, 1599, 2807, 7149, 12083, 28927, 7797, 130879}}, {7188, 17, 12522, {1, 1, 1, 13, 31, 63, 127, 89, 209, 717, 1075, 3887, 1427, 87, 18565, 39973, 55025}}, {7189, 17, 12530, {1, 3, 1, 5, 15, 11, 121, 247, 273, 613, 1857, 2059, 7399, 13951, 9025, 39523, 68121}}, {7190, 17, 12544, {1, 3, 7, 13, 31, 9, 61, 143, 375, 433, 471, 1315, 5299, 1167, 10099, 11445, 51693}}, {7191, 17, 12547, {1, 1, 7, 9, 25, 31, 125, 5, 13, 595, 621, 3551, 7959, 10643, 14345, 37683, 118377}}, {7192, 17, 12561, {1, 1, 5, 11, 1, 33, 45, 31, 447, 229, 893, 3777, 4101, 2505, 4855, 14057, 20133}}, {7193, 17, 12571, {1, 1, 1, 1, 7, 23, 89, 53, 483, 873, 521, 2115, 1461, 11241, 1003, 28749, 68227}}, {7194, 17, 12580, {1, 3, 5, 5, 3, 17, 23, 219, 281, 975, 895, 4043, 6505, 5991, 27401, 38791, 89239}}, {7195, 17, 12597, {1, 1, 1, 7, 29, 41, 63, 151, 195, 495, 469, 305, 7437, 1107, 31147, 30755, 116551}}, {7196, 17, 12607, {1, 3, 7, 3, 13, 25, 33, 193, 23, 135, 3, 513, 4169, 15355, 2255, 32167, 68691}}, {7197, 17, 12609, {1, 3, 3, 11, 29, 19, 125, 177, 83, 361, 393, 663, 1859, 1333, 17507, 10661, 72387}}, {7198, 17, 12610, {1, 1, 5, 11, 23, 13, 61, 33, 149, 145, 995, 649, 7587, 6743, 25225, 54997, 10193}}, {7199, 17, 12616, {1, 1, 7, 13, 29, 51, 107, 79, 467, 881, 1227, 1083, 3277, 2559, 26819, 57311, 48095}}, {7200, 17, 12621, {1, 3, 1, 1, 1, 19, 23, 25, 239, 703, 119, 2525, 8079, 5433, 8989, 42517, 116755}}, {7201, 17, 12624, {1, 1, 7, 11, 31, 9, 9, 113, 381, 363, 447, 3751, 7523, 15995, 3853, 42069, 81455}}, {7202, 17, 12639, {1, 1, 5, 9, 29, 41, 103, 179, 477, 527, 1593, 3003, 1095, 6823, 6911, 44987, 32445}}, {7203, 17, 12645, {1, 1, 7, 15, 5, 31, 55, 181, 149, 127, 1745, 2753, 801, 285, 20199, 33707, 118397}}, {7204, 17, 12652, {1, 3, 7, 7, 11, 29, 89, 215, 351, 303, 1519, 2593, 2045, 14699, 1657, 40799, 39641}}, {7205, 17, 12655, {1, 1, 7, 13, 3, 35, 73, 111, 15, 803, 1819, 3453, 3611, 8337, 14239, 14875, 83983}}, {7206, 17, 12660, {1, 1, 5, 15, 15, 49, 27, 101, 149, 3, 717, 2229, 7397, 6579, 10965, 35997, 28823}}, {7207, 17, 12667, {1, 1, 5, 7, 3, 17, 49, 245, 343, 657, 15, 749, 6413, 10811, 2909, 47309, 34613}}, {7208, 17, 12686, {1, 3, 5, 15, 13, 35, 67, 99, 481, 379, 2003, 3367, 3065, 5845, 7799, 43931, 15263}}, {7209, 17, 12688, {1, 1, 5, 13, 21, 49, 81, 77, 395, 919, 1931, 661, 123, 9965, 10487, 55131, 1567}}, {7210, 17, 12697, {1, 3, 5, 11, 23, 39, 41, 121, 159, 473, 191, 1983, 6411, 10503, 10523, 40601, 64153}}, {7211, 17, 12700, {1, 1, 5, 7, 9, 37, 73, 207, 497, 789, 1671, 325, 1697, 11281, 31185, 4961, 124431}}, {7212, 17, 12707, {1, 1, 5, 15, 7, 51, 71, 91, 449, 707, 621, 2427, 627, 1747, 12779, 17569, 98289}}, {7213, 17, 12710, {1, 1, 5, 5, 31, 3, 89, 163, 77, 647, 1747, 2965, 1669, 3311, 17651, 8111, 30739}}, {7214, 17, 12719, {1, 1, 3, 11, 15, 31, 77, 173, 405, 913, 459, 2955, 6153, 13391, 20439, 64433, 12371}}, {7215, 17, 12739, {1, 1, 3, 11, 13, 55, 29, 37, 379, 689, 407, 1373, 397, 5027, 15497, 25687, 48193}}, {7216, 17, 12742, {1, 3, 3, 15, 13, 7, 81, 207, 395, 901, 779, 1683, 2491, 3807, 31979, 32403, 81113}}, {7217, 17, 12746, {1, 3, 3, 13, 29, 31, 25, 81, 459, 991, 793, 3285, 2775, 16199, 11423, 52597, 86041}}, {7218, 17, 12754, {1, 3, 3, 13, 17, 17, 101, 183, 19, 735, 671, 1097, 2461, 9863, 25985, 31915, 73047}}, {7219, 17, 12765, {1, 3, 3, 3, 3, 11, 71, 63, 429, 899, 351, 1275, 3907, 14241, 19135, 14875, 43325}}, {7220, 17, 12772, {1, 1, 7, 11, 11, 61, 15, 213, 411, 13, 1409, 1741, 5257, 8729, 28351, 6381, 77501}}, {7221, 17, 12784, {1, 1, 7, 7, 29, 27, 51, 217, 411, 261, 599, 3027, 7871, 9133, 32423, 44275, 34701}}, {7222, 17, 12789, {1, 3, 7, 7, 1, 1, 127, 209, 151, 845, 1421, 3115, 7775, 10133, 6163, 41165, 91187}}, {7223, 17, 12800, {1, 3, 1, 9, 1, 35, 75, 3, 81, 477, 131, 1383, 1377, 6857, 3863, 12583, 7855}}, {7224, 17, 12805, {1, 3, 1, 3, 3, 11, 1, 167, 347, 317, 557, 3763, 7175, 13341, 759, 23275, 78039}}, {7225, 17, 12809, {1, 3, 5, 11, 19, 53, 85, 139, 67, 757, 487, 919, 6001, 16031, 24959, 28013, 65771}}, {7226, 17, 12815, {1, 1, 1, 1, 23, 9, 83, 55, 249, 305, 1305, 109, 5559, 5129, 30973, 19889, 6691}}, {7227, 17, 12827, {1, 1, 1, 3, 21, 19, 85, 89, 213, 847, 861, 1651, 6613, 6001, 8157, 2555, 98673}}, {7228, 17, 12830, {1, 1, 1, 15, 25, 15, 125, 133, 177, 295, 549, 1763, 2811, 4381, 1079, 7813, 87909}}, {7229, 17, 12833, {1, 1, 1, 5, 5, 17, 25, 225, 353, 997, 1565, 2225, 7265, 16227, 28209, 9011, 97193}}, {7230, 17, 12840, {1, 3, 7, 15, 13, 13, 35, 239, 331, 965, 1547, 1627, 6409, 7745, 30899, 36915, 59293}}, {7231, 17, 12851, {1, 1, 1, 13, 27, 45, 23, 179, 193, 801, 381, 3783, 3551, 11855, 11041, 49911, 62101}}, {7232, 17, 12868, {1, 1, 7, 3, 3, 31, 61, 5, 421, 939, 1637, 217, 389, 1797, 32141, 28817, 6997}}, {7233, 17, 12871, {1, 3, 3, 5, 21, 31, 83, 65, 421, 577, 1137, 2561, 2943, 4171, 2803, 23325, 92315}}, {7234, 17, 12886, {1, 1, 3, 3, 27, 33, 75, 81, 477, 3, 1903, 773, 5551, 10069, 7285, 58103, 98311}}, {7235, 17, 12899, {1, 3, 7, 15, 1, 17, 95, 209, 65, 747, 1633, 581, 7395, 1393, 21795, 15735, 129757}}, {7236, 17, 12923, {1, 3, 5, 3, 17, 3, 9, 131, 51, 693, 1571, 1865, 8137, 915, 13345, 35137, 59005}}, {7237, 17, 12926, {1, 1, 3, 7, 23, 27, 61, 163, 449, 87, 717, 1075, 4309, 4887, 11741, 24549, 96729}}, {7238, 17, 12932, {1, 3, 7, 13, 21, 5, 3, 97, 191, 999, 1193, 1215, 5907, 10491, 2281, 6455, 68625}}, {7239, 17, 12935, {1, 1, 5, 7, 9, 9, 101, 5, 375, 137, 1473, 1265, 5307, 259, 20699, 25367, 129393}}, {7240, 17, 12939, {1, 3, 7, 7, 21, 1, 77, 65, 23, 139, 945, 491, 1069, 253, 12335, 26861, 129467}}, {7241, 17, 12942, {1, 1, 3, 9, 15, 33, 85, 225, 45, 311, 281, 1601, 7325, 12265, 2591, 51955, 130681}}, {7242, 17, 12953, {1, 1, 1, 3, 27, 33, 17, 89, 495, 91, 527, 3347, 7883, 9481, 28731, 54729, 15265}}, {7243, 17, 12959, {1, 1, 3, 3, 9, 47, 115, 161, 299, 493, 1857, 3597, 7175, 15603, 11523, 33837, 57557}}, {7244, 17, 12960, {1, 3, 7, 3, 15, 47, 127, 195, 391, 869, 99, 429, 7125, 10413, 5063, 61845, 71843}}, {7245, 17, 13002, {1, 3, 3, 1, 7, 31, 27, 69, 7, 83, 315, 2749, 5693, 13377, 28091, 13065, 111029}}, {7246, 17, 13004, {1, 1, 3, 15, 15, 45, 125, 229, 459, 611, 1167, 3375, 3587, 81, 9275, 45327, 39749}}, {7247, 17, 13016, {1, 3, 7, 11, 9, 3, 43, 161, 221, 209, 51, 1475, 3577, 13973, 15285, 35553, 83935}}, {7248, 17, 13021, {1, 1, 7, 9, 15, 55, 25, 119, 39, 537, 317, 1331, 2161, 1791, 19221, 63459, 124595}}, {7249, 17, 13035, {1, 1, 1, 11, 9, 7, 113, 187, 295, 67, 1795, 113, 119, 9127, 32119, 7719, 67591}}, {7250, 17, 13038, {1, 3, 7, 13, 1, 53, 17, 19, 331, 711, 359, 2945, 5847, 7237, 23617, 17411, 2203}}, {7251, 17, 13052, {1, 3, 3, 7, 21, 63, 115, 159, 225, 161, 1255, 2381, 7411, 95, 1625, 30493, 56685}}, {7252, 17, 13058, {1, 1, 5, 9, 13, 57, 5, 107, 195, 271, 677, 2081, 6027, 11091, 14171, 19007, 102119}}, {7253, 17, 13069, {1, 3, 3, 3, 19, 13, 31, 155, 209, 89, 955, 523, 615, 5319, 16079, 9289, 49135}}, {7254, 17, 13082, {1, 3, 1, 13, 1, 31, 69, 143, 329, 813, 635, 891, 2967, 5563, 19643, 35813, 14345}}, {7255, 17, 13093, {1, 1, 5, 5, 17, 47, 97, 49, 123, 997, 15, 3685, 3925, 4973, 11195, 17115, 63709}}, {7256, 17, 13094, {1, 1, 7, 13, 13, 17, 99, 149, 309, 281, 329, 905, 6487, 4495, 31831, 24413, 26431}}, {7257, 17, 13100, {1, 1, 5, 5, 5, 47, 113, 115, 61, 157, 955, 2323, 4445, 229, 24049, 14753, 15189}}, {7258, 17, 13115, {1, 3, 7, 15, 25, 21, 13, 137, 377, 45, 629, 1339, 8037, 5073, 24741, 48589, 28953}}, {7259, 17, 13125, {1, 3, 3, 9, 3, 41, 7, 101, 333, 59, 1213, 1871, 3993, 11261, 4403, 42785, 58753}}, {7260, 17, 13132, {1, 3, 1, 7, 5, 33, 87, 73, 317, 575, 1459, 905, 1033, 14179, 19595, 30269, 103853}}, {7261, 17, 13143, {1, 1, 1, 1, 19, 49, 63, 181, 227, 401, 695, 1811, 2383, 3835, 14379, 30685, 114731}}, {7262, 17, 13144, {1, 1, 5, 15, 9, 41, 35, 91, 357, 659, 155, 3725, 6509, 405, 25449, 37719, 6013}}, {7263, 17, 13153, {1, 1, 7, 3, 11, 59, 33, 151, 291, 393, 741, 3961, 2787, 993, 10361, 11737, 42047}}, {7264, 17, 13160, {1, 3, 7, 3, 15, 15, 55, 59, 419, 203, 55, 801, 2719, 15487, 13213, 58473, 50315}}, {7265, 17, 13165, {1, 3, 7, 13, 17, 21, 113, 111, 159, 163, 711, 1135, 1133, 15519, 30515, 55777, 25025}}, {7266, 17, 13173, {1, 1, 3, 5, 13, 25, 23, 3, 93, 873, 559, 1815, 3381, 5311, 14365, 34349, 17333}}, {7267, 17, 13174, {1, 3, 5, 7, 15, 43, 85, 33, 23, 903, 1247, 3279, 1393, 12059, 19251, 19389, 5097}}, {7268, 17, 13187, {1, 3, 1, 11, 21, 59, 3, 153, 403, 95, 1939, 2679, 419, 9035, 31219, 2897, 15727}}, {7269, 17, 13190, {1, 3, 5, 1, 11, 21, 35, 169, 453, 15, 791, 3931, 1021, 16321, 6033, 10639, 16173}}, {7270, 17, 13204, {1, 3, 1, 11, 7, 57, 39, 61, 381, 465, 451, 2863, 575, 5597, 31041, 8625, 82373}}, {7271, 17, 13218, {1, 1, 3, 5, 13, 5, 63, 1, 75, 245, 1305, 285, 3367, 10107, 5853, 35275, 128255}}, {7272, 17, 13247, {1, 1, 1, 3, 1, 57, 21, 91, 139, 669, 765, 1867, 2153, 10347, 26119, 35517, 4725}}, {7273, 17, 13250, {1, 3, 5, 1, 21, 41, 59, 247, 473, 1015, 975, 485, 2161, 11941, 10341, 35245, 55587}}, {7274, 17, 13262, {1, 1, 5, 9, 7, 59, 33, 149, 97, 619, 393, 3613, 6037, 10895, 19461, 15975, 47919}}, {7275, 17, 13267, {1, 3, 3, 15, 7, 17, 95, 13, 147, 361, 915, 2585, 4483, 3159, 12255, 44685, 116163}}, {7276, 17, 13274, {1, 3, 1, 15, 27, 31, 75, 31, 423, 233, 1453, 2815, 3633, 6531, 25721, 29649, 80645}}, {7277, 17, 13304, {1, 3, 3, 3, 19, 7, 73, 33, 163, 495, 1483, 2277, 6455, 6523, 9331, 21869, 52175}}, {7278, 17, 13309, {1, 3, 5, 13, 5, 1, 63, 35, 335, 189, 713, 2997, 3277, 10049, 4681, 16753, 17107}}, {7279, 17, 13315, {1, 3, 5, 9, 3, 55, 29, 171, 395, 585, 671, 1875, 4449, 12895, 5455, 11023, 106189}}, {7280, 17, 13317, {1, 3, 5, 3, 25, 53, 33, 169, 109, 285, 787, 861, 5549, 5171, 15293, 2977, 14559}}, {7281, 17, 13324, {1, 3, 7, 1, 21, 25, 97, 115, 1, 999, 1033, 3471, 129, 16093, 495, 16859, 34615}}, {7282, 17, 13332, {1, 3, 5, 9, 13, 5, 109, 41, 57, 957, 231, 3771, 2917, 15649, 8869, 14857, 64943}}, {7283, 17, 13342, {1, 1, 7, 7, 21, 41, 101, 59, 167, 441, 997, 2951, 7891, 16325, 12669, 53829, 100705}}, {7284, 17, 13346, {1, 1, 7, 9, 19, 59, 23, 141, 193, 237, 1067, 1823, 3351, 3239, 3135, 9275, 37069}}, {7285, 17, 13355, {1, 3, 3, 9, 3, 17, 95, 73, 19, 231, 779, 3065, 2245, 2967, 24971, 62589, 16729}}, {7286, 17, 13358, {1, 3, 3, 13, 25, 19, 117, 147, 443, 123, 157, 2037, 327, 14715, 5693, 54641, 33325}}, {7287, 17, 13360, {1, 3, 1, 9, 21, 21, 21, 125, 49, 787, 767, 2831, 511, 2461, 31537, 27155, 44053}}, {7288, 17, 13369, {1, 3, 7, 9, 31, 19, 125, 67, 119, 465, 287, 1869, 3979, 15723, 21069, 8581, 66939}}, {7289, 17, 13372, {1, 1, 1, 11, 7, 37, 123, 237, 353, 499, 113, 3829, 217, 4751, 7385, 20343, 83699}}, {7290, 17, 13398, {1, 3, 7, 13, 9, 3, 53, 27, 487, 87, 35, 2645, 3481, 14409, 27875, 31695, 78489}}, {7291, 17, 13404, {1, 3, 3, 13, 9, 43, 67, 51, 153, 83, 591, 1991, 1787, 11973, 7273, 34801, 47199}}, {7292, 17, 13407, {1, 3, 7, 1, 15, 53, 71, 11, 205, 853, 2011, 581, 1281, 7819, 23083, 33731, 74951}}, {7293, 17, 13414, {1, 1, 5, 5, 17, 63, 109, 219, 225, 997, 1251, 3287, 1441, 13489, 22723, 45191, 50249}}, {7294, 17, 13426, {1, 1, 5, 3, 13, 1, 43, 53, 293, 685, 1369, 1515, 7479, 3233, 20007, 65235, 102467}}, {7295, 17, 13432, {1, 3, 5, 7, 29, 45, 63, 45, 219, 445, 2047, 317, 7553, 325, 1465, 949, 35163}}, {7296, 17, 13466, {1, 1, 3, 9, 7, 31, 73, 211, 501, 233, 1495, 701, 5857, 10763, 9743, 10289, 23801}}, {7297, 17, 13481, {1, 3, 7, 3, 23, 47, 99, 61, 179, 833, 1425, 1275, 4467, 4367, 5567, 23513, 68677}}, {7298, 17, 13490, {1, 1, 5, 5, 27, 33, 119, 229, 329, 51, 1025, 3167, 3405, 4039, 4135, 6655, 43771}}, {7299, 17, 13496, {1, 3, 7, 15, 5, 49, 91, 55, 425, 15, 2003, 1571, 3539, 10375, 29645, 5889, 51887}}, {7300, 17, 13504, {1, 1, 7, 3, 13, 55, 85, 91, 181, 723, 1941, 75, 4443, 11507, 7027, 14189, 50685}}, {7301, 17, 13516, {1, 3, 5, 5, 29, 49, 13, 3, 97, 165, 41, 3039, 3325, 2161, 775, 38501, 42381}}, {7302, 17, 13527, {1, 1, 5, 11, 9, 57, 47, 109, 9, 585, 375, 1839, 937, 6877, 29847, 60163, 103081}}, {7303, 17, 13533, {1, 1, 3, 13, 5, 47, 11, 195, 253, 235, 275, 2313, 163, 14683, 5681, 13381, 84553}}, {7304, 17, 13537, {1, 3, 3, 15, 15, 1, 93, 157, 437, 557, 307, 1179, 6857, 3101, 16723, 50579, 69603}}, {7305, 17, 13552, {1, 1, 5, 9, 11, 29, 23, 219, 337, 689, 1155, 2007, 6853, 6749, 20127, 13199, 48433}}, {7306, 17, 13561, {1, 1, 1, 13, 1, 61, 73, 213, 335, 539, 903, 2719, 775, 2775, 29109, 33367, 3281}}, {7307, 17, 13567, {1, 3, 1, 5, 15, 31, 65, 231, 439, 623, 1871, 2299, 5365, 10333, 9147, 2781, 63813}}, {7308, 17, 13582, {1, 1, 3, 1, 1, 25, 23, 229, 173, 279, 181, 1299, 2893, 15475, 12473, 46097, 123387}}, {7309, 17, 13587, {1, 1, 7, 13, 7, 43, 17, 187, 467, 113, 1293, 2013, 6091, 14621, 22195, 24079, 45379}}, {7310, 17, 13589, {1, 3, 1, 7, 1, 7, 119, 159, 377, 11, 705, 2853, 3767, 13739, 23375, 25563, 73987}}, {7311, 17, 13593, {1, 1, 3, 15, 21, 13, 111, 119, 401, 1005, 777, 1699, 2431, 15139, 27887, 28415, 71519}}, {7312, 17, 13596, {1, 1, 7, 9, 1, 49, 19, 171, 297, 77, 1343, 1249, 5769, 13889, 21401, 24915, 17641}}, {7313, 17, 13615, {1, 1, 7, 11, 31, 45, 51, 231, 123, 817, 13, 791, 6235, 2787, 475, 1717, 5071}}, {7314, 17, 13617, {1, 3, 3, 13, 5, 9, 21, 129, 253, 731, 785, 2275, 7343, 7841, 5477, 8973, 101033}}, {7315, 17, 13623, {1, 1, 7, 13, 23, 1, 119, 221, 293, 709, 2031, 3019, 1529, 2007, 10823, 43193, 82661}}, {7316, 17, 13641, {1, 3, 1, 11, 29, 29, 87, 79, 415, 679, 1899, 3453, 7355, 8627, 28225, 41857, 106645}}, {7317, 17, 13647, {1, 1, 5, 15, 9, 13, 21, 241, 491, 927, 999, 2131, 3501, 11063, 28595, 54691, 21297}}, {7318, 17, 13650, {1, 1, 1, 3, 5, 41, 85, 89, 483, 309, 791, 825, 3043, 2715, 16573, 6551, 77875}}, {7319, 17, 13659, {1, 3, 1, 1, 25, 21, 107, 123, 79, 1019, 821, 1251, 4943, 1429, 17843, 37013, 53285}}, {7320, 17, 13671, {1, 1, 5, 3, 7, 5, 35, 123, 445, 315, 627, 2543, 1261, 13737, 15991, 36591, 18309}}, {7321, 17, 13677, {1, 3, 3, 5, 25, 43, 65, 249, 309, 1023, 737, 1933, 4735, 7725, 12063, 53023, 126677}}, {7322, 17, 13678, {1, 3, 1, 9, 13, 37, 77, 61, 179, 275, 277, 1431, 2869, 14563, 665, 60553, 7661}}, {7323, 17, 13680, {1, 3, 5, 3, 29, 1, 127, 73, 363, 311, 1591, 3863, 6481, 4725, 8287, 61311, 39011}}, {7324, 17, 13685, {1, 3, 1, 7, 13, 23, 115, 215, 385, 563, 1033, 2343, 5023, 11013, 12131, 26997, 48645}}, {7325, 17, 13689, {1, 1, 5, 13, 3, 59, 41, 155, 263, 507, 1175, 2967, 7929, 8237, 11841, 15365, 51881}}, {7326, 17, 13701, {1, 1, 3, 11, 19, 35, 89, 115, 121, 315, 1697, 2121, 1867, 6865, 23639, 26525, 44687}}, {7327, 17, 13706, {1, 3, 5, 15, 9, 5, 125, 183, 149, 447, 309, 1743, 6089, 369, 16153, 63799, 57657}}, {7328, 17, 13720, {1, 1, 1, 7, 7, 39, 89, 139, 457, 741, 1613, 2883, 5057, 12495, 18669, 55469, 97941}}, {7329, 17, 13729, {1, 1, 5, 7, 29, 39, 97, 9, 481, 667, 1353, 3387, 2813, 16205, 8353, 22121, 92965}}, {7330, 17, 13735, {1, 3, 7, 9, 11, 55, 79, 159, 349, 717, 829, 3157, 1457, 6199, 5861, 2553, 20387}}, {7331, 17, 13736, {1, 1, 1, 11, 3, 51, 113, 53, 287, 109, 1717, 2405, 7207, 4473, 11145, 2549, 591}}, {7332, 17, 13756, {1, 1, 3, 13, 3, 61, 31, 141, 217, 487, 299, 2755, 3389, 10053, 1105, 21129, 74203}}, {7333, 17, 13759, {1, 1, 1, 3, 11, 55, 7, 113, 413, 449, 787, 3279, 5123, 16025, 15005, 12175, 6795}}, {7334, 17, 13761, {1, 3, 1, 1, 25, 23, 107, 191, 3, 3, 49, 1083, 3275, 10385, 7989, 53739, 25505}}, {7335, 17, 13771, {1, 1, 5, 13, 7, 17, 59, 13, 471, 147, 1627, 2119, 3555, 15555, 10333, 49363, 80959}}, {7336, 17, 13782, {1, 1, 1, 15, 23, 33, 61, 191, 207, 939, 45, 2781, 71, 9661, 28433, 13089, 76419}}, {7337, 17, 13786, {1, 3, 3, 7, 29, 47, 111, 19, 315, 381, 851, 1303, 2627, 6255, 30369, 37723, 12949}}, {7338, 17, 13798, {1, 1, 1, 13, 31, 43, 3, 193, 5, 99, 769, 2523, 1949, 129, 9693, 60535, 67059}}, {7339, 17, 13810, {1, 1, 3, 15, 5, 33, 73, 149, 253, 985, 863, 1551, 4369, 5911, 8269, 35463, 117055}}, {7340, 17, 13819, {1, 3, 1, 5, 27, 57, 3, 105, 253, 731, 119, 3287, 613, 4627, 22003, 56027, 123005}}, {7341, 17, 13826, {1, 1, 3, 3, 27, 47, 67, 147, 495, 865, 1233, 3707, 2511, 2951, 7367, 15625, 86417}}, {7342, 17, 13831, {1, 1, 7, 1, 7, 7, 13, 255, 457, 529, 953, 1481, 5565, 12495, 4723, 41615, 121829}}, {7343, 17, 13837, {1, 3, 5, 11, 1, 51, 91, 153, 323, 609, 1353, 2995, 4035, 13835, 28619, 46217, 4967}}, {7344, 17, 13846, {1, 1, 5, 7, 25, 59, 81, 101, 185, 709, 1249, 2285, 6579, 8655, 17563, 9707, 63845}}, {7345, 17, 13856, {1, 3, 3, 9, 31, 25, 17, 19, 111, 627, 1187, 2621, 6529, 9457, 25027, 18069, 47559}}, {7346, 17, 13862, {1, 3, 7, 15, 7, 15, 103, 201, 391, 1023, 817, 535, 2713, 1317, 13469, 56043, 70847}}, {7347, 17, 13866, {1, 1, 3, 7, 17, 57, 35, 99, 439, 367, 27, 2695, 3519, 8337, 14047, 58489, 69}}, {7348, 17, 13885, {1, 1, 1, 3, 17, 23, 71, 189, 57, 39, 715, 1779, 3081, 14657, 21895, 59203, 31005}}, {7349, 17, 13891, {1, 1, 7, 13, 1, 47, 69, 159, 353, 517, 271, 973, 5077, 15707, 11095, 19671, 3389}}, {7350, 17, 13893, {1, 1, 7, 13, 25, 55, 115, 21, 43, 939, 1697, 101, 4751, 1993, 2389, 28353, 45251}}, {7351, 17, 13905, {1, 3, 1, 15, 11, 57, 17, 49, 121, 419, 909, 121, 5047, 4235, 13051, 21529, 42097}}, {7352, 17, 13908, {1, 1, 1, 3, 19, 37, 31, 233, 251, 175, 929, 1527, 7527, 3605, 17075, 61053, 56235}}, {7353, 17, 13912, {1, 1, 1, 3, 9, 5, 117, 131, 251, 475, 1695, 1381, 2445, 5921, 14921, 937, 80791}}, {7354, 17, 13917, {1, 1, 3, 9, 11, 5, 31, 215, 37, 567, 1537, 2183, 3291, 1601, 14025, 48807, 7243}}, {7355, 17, 13918, {1, 3, 1, 9, 7, 13, 81, 249, 321, 473, 1419, 3977, 7037, 14191, 10865, 56131, 43225}}, {7356, 17, 13946, {1, 1, 1, 13, 15, 23, 31, 69, 449, 491, 1461, 729, 7955, 4003, 16817, 37273, 72025}}, {7357, 17, 13948, {1, 1, 5, 13, 7, 41, 93, 169, 347, 1013, 301, 2813, 1455, 13187, 10769, 60807, 46333}}, {7358, 17, 13964, {1, 1, 5, 3, 23, 15, 1, 161, 29, 35, 415, 235, 93, 14543, 29585, 29657, 36489}}, {7359, 17, 13970, {1, 3, 1, 3, 31, 63, 39, 235, 153, 549, 43, 147, 2317, 3537, 25561, 58287, 58725}}, {7360, 17, 13975, {1, 1, 3, 5, 5, 11, 59, 97, 349, 307, 501, 1701, 4243, 13717, 17419, 23387, 29533}}, {7361, 17, 13979, {1, 3, 1, 7, 7, 19, 33, 243, 67, 353, 2023, 3111, 7173, 10979, 28117, 40175, 45337}}, {7362, 17, 13997, {1, 1, 1, 5, 15, 59, 55, 135, 107, 543, 1743, 2695, 3293, 111, 32629, 8249, 52273}}, {7363, 17, 14000, {1, 3, 5, 13, 15, 57, 39, 79, 5, 451, 571, 1445, 1393, 2125, 31713, 59655, 20897}}, {7364, 17, 14006, {1, 1, 3, 11, 29, 61, 1, 37, 173, 513, 1779, 2649, 3289, 4679, 2039, 47587, 28973}}, {7365, 17, 14020, {1, 1, 5, 5, 15, 19, 17, 143, 387, 359, 275, 625, 7383, 15537, 10311, 40005, 20729}}, {7366, 17, 14023, {1, 1, 3, 9, 7, 23, 71, 179, 85, 447, 345, 3459, 2857, 8331, 5489, 62207, 64933}}, {7367, 17, 14024, {1, 1, 1, 1, 11, 61, 47, 131, 213, 611, 701, 713, 1269, 9563, 25223, 50697, 88679}}, {7368, 17, 14029, {1, 1, 5, 15, 21, 5, 77, 59, 455, 243, 459, 2809, 13, 9325, 32047, 3939, 48389}}, {7369, 17, 14035, {1, 3, 7, 1, 21, 53, 111, 225, 407, 119, 713, 3635, 1539, 15321, 29827, 36069, 74483}}, {7370, 17, 14044, {1, 1, 5, 13, 7, 45, 75, 43, 191, 715, 169, 759, 33, 11329, 1069, 36103, 28055}}, {7371, 17, 14047, {1, 3, 7, 5, 7, 13, 7, 35, 27, 391, 517, 1439, 5699, 1067, 23857, 7293, 66167}}, {7372, 17, 14058, {1, 1, 7, 11, 3, 31, 1, 83, 299, 345, 65, 669, 1529, 7569, 28959, 50561, 69493}}, {7373, 17, 14066, {1, 3, 1, 5, 25, 25, 43, 149, 83, 225, 1589, 1691, 7777, 773, 10421, 49523, 23533}}, {7374, 17, 14075, {1, 1, 5, 11, 25, 29, 81, 11, 497, 43, 951, 2551, 821, 13805, 12315, 61299, 81397}}, {7375, 17, 14080, {1, 3, 1, 9, 29, 23, 109, 123, 235, 255, 1519, 3289, 7761, 14575, 11851, 1719, 51655}}, {7376, 17, 14095, {1, 3, 5, 15, 21, 49, 13, 43, 87, 517, 687, 1457, 1501, 15959, 31907, 13771, 69379}}, {7377, 17, 14100, {1, 1, 5, 3, 21, 11, 87, 9, 343, 317, 845, 1663, 7933, 14063, 24915, 31487, 17445}}, {7378, 17, 14114, {1, 1, 3, 13, 21, 31, 87, 99, 185, 333, 993, 3899, 971, 2851, 23643, 195, 66957}}, {7379, 17, 14116, {1, 1, 1, 15, 19, 47, 23, 1, 67, 57, 165, 3903, 421, 10561, 11621, 13815, 10349}}, {7380, 17, 14123, {1, 3, 5, 11, 9, 19, 73, 17, 229, 913, 459, 3809, 2667, 9775, 3693, 52945, 90837}}, {7381, 17, 14134, {1, 1, 5, 15, 3, 25, 109, 131, 507, 637, 1615, 859, 6785, 14891, 24801, 39095, 79557}}, {7382, 17, 14143, {1, 1, 5, 7, 1, 51, 71, 251, 19, 799, 835, 1119, 2349, 15083, 16509, 55621, 123501}}, {7383, 17, 14151, {1, 3, 5, 9, 13, 39, 127, 1, 233, 37, 735, 3307, 5163, 4529, 5961, 12893, 103641}}, {7384, 17, 14160, {1, 1, 7, 5, 23, 15, 49, 123, 511, 201, 2025, 289, 3847, 15755, 24279, 52543, 42017}}, {7385, 17, 14163, {1, 1, 5, 3, 9, 61, 19, 37, 3, 361, 1065, 2971, 2517, 1259, 27359, 3823, 60181}}, {7386, 17, 14179, {1, 3, 1, 7, 15, 17, 57, 249, 57, 979, 147, 2407, 2579, 3159, 8467, 8433, 72873}}, {7387, 17, 14181, {1, 1, 3, 1, 25, 7, 47, 117, 449, 321, 143, 3867, 165, 7961, 27597, 10033, 2437}}, {7388, 17, 14193, {1, 3, 5, 13, 19, 49, 1, 83, 477, 549, 509, 2911, 1559, 14017, 10469, 62171, 82829}}, {7389, 17, 14209, {1, 3, 3, 7, 27, 21, 15, 63, 31, 45, 1223, 3903, 5469, 11983, 29627, 27453, 32019}}, {7390, 17, 14210, {1, 1, 7, 7, 9, 9, 7, 77, 349, 467, 61, 3465, 6921, 15761, 15179, 38649, 2469}}, {7391, 17, 14224, {1, 3, 1, 13, 9, 59, 55, 67, 271, 617, 643, 4071, 7963, 8153, 5121, 43917, 26219}}, {7392, 17, 14245, {1, 1, 3, 7, 29, 21, 63, 103, 327, 623, 931, 1511, 3125, 229, 28949, 61315, 72667}}, {7393, 17, 14249, {1, 3, 7, 1, 19, 37, 49, 63, 403, 885, 161, 121, 1447, 9227, 15019, 50049, 26939}}, {7394, 17, 14255, {1, 3, 3, 3, 23, 57, 95, 79, 485, 173, 93, 835, 7161, 11247, 3485, 5759, 36393}}, {7395, 17, 14267, {1, 3, 7, 13, 23, 33, 5, 97, 235, 531, 313, 2925, 2223, 847, 18591, 15477, 3129}}, {7396, 17, 14270, {1, 1, 3, 13, 25, 25, 101, 183, 477, 947, 1251, 2631, 7987, 13417, 23759, 55305, 123817}}, {7397, 17, 14277, {1, 1, 5, 9, 27, 63, 49, 137, 179, 861, 33, 2375, 3827, 6485, 19689, 7867, 124429}}, {7398, 17, 14305, {1, 3, 7, 3, 15, 43, 63, 103, 45, 947, 1837, 833, 7055, 7487, 19669, 12045, 78377}}, {7399, 17, 14308, {1, 3, 5, 3, 29, 35, 57, 19, 471, 985, 1147, 741, 5403, 10057, 25375, 50889, 82719}}, {7400, 17, 14312, {1, 3, 3, 1, 17, 19, 111, 13, 121, 821, 1831, 4043, 123, 9529, 1511, 10917, 105961}}, {7401, 17, 14325, {1, 1, 3, 11, 1, 43, 23, 75, 345, 9, 1379, 2157, 5887, 1197, 14849, 17103, 91925}}, {7402, 17, 14332, {1, 1, 3, 3, 19, 11, 1, 179, 343, 1023, 1801, 915, 255, 519, 5787, 32913, 43471}}, {7403, 17, 14345, {1, 3, 5, 5, 3, 3, 3, 211, 461, 55, 851, 3165, 2903, 15077, 8537, 2037, 109057}}, {7404, 17, 14354, {1, 1, 7, 15, 7, 7, 43, 249, 27, 511, 1369, 735, 6093, 12575, 26675, 21745, 117053}}, {7405, 17, 14372, {1, 1, 5, 7, 21, 53, 45, 83, 415, 645, 325, 4027, 5181, 8485, 1917, 55623, 45203}}, {7406, 17, 14387, {1, 1, 3, 15, 7, 1, 121, 221, 387, 403, 1877, 1671, 2113, 2379, 5667, 39867, 8079}}, {7407, 17, 14390, {1, 1, 1, 7, 5, 29, 35, 77, 197, 661, 1859, 2539, 4045, 13497, 305, 44987, 31215}}, {7408, 17, 14402, {1, 1, 5, 5, 13, 37, 13, 85, 287, 347, 579, 2283, 7911, 5463, 21141, 9035, 105067}}, {7409, 17, 14408, {1, 1, 1, 9, 17, 17, 63, 97, 57, 629, 1917, 1133, 779, 12365, 17127, 52549, 18755}}, {7410, 17, 14413, {1, 1, 7, 11, 7, 17, 65, 137, 485, 841, 653, 2921, 4935, 16273, 23333, 7399, 43129}}, {7411, 17, 14431, {1, 3, 1, 11, 31, 55, 93, 225, 319, 35, 947, 1909, 7733, 8303, 20739, 55713, 6633}}, {7412, 17, 14438, {1, 1, 1, 3, 11, 25, 1, 165, 305, 275, 607, 3845, 5203, 1989, 13803, 597, 39751}}, {7413, 17, 14447, {1, 1, 5, 11, 31, 43, 83, 237, 453, 59, 457, 741, 411, 15895, 18891, 30133, 66767}}, {7414, 17, 14455, {1, 3, 5, 11, 3, 23, 65, 81, 299, 527, 1057, 2731, 3839, 6023, 28887, 64929, 41405}}, {7415, 17, 14461, {1, 3, 1, 1, 3, 5, 11, 169, 123, 957, 1495, 1717, 4079, 13239, 28339, 33677, 30591}}, {7416, 17, 14466, {1, 1, 7, 15, 3, 1, 37, 245, 169, 273, 2039, 415, 6555, 13131, 11181, 62179, 36885}}, {7417, 17, 14480, {1, 1, 3, 11, 1, 55, 19, 19, 425, 113, 1367, 2101, 5581, 985, 2475, 53983, 68999}}, {7418, 17, 14490, {1, 1, 5, 9, 5, 33, 101, 193, 303, 579, 1265, 2791, 479, 12083, 17609, 31801, 113089}}, {7419, 17, 14492, {1, 1, 3, 3, 17, 61, 59, 249, 81, 821, 1, 431, 5327, 8675, 23469, 15349, 67711}}, {7420, 17, 14508, {1, 1, 7, 9, 31, 51, 89, 19, 469, 843, 561, 559, 4823, 7803, 31699, 44537, 56835}}, {7421, 17, 14513, {1, 3, 7, 9, 11, 57, 27, 43, 469, 655, 433, 3081, 6719, 6651, 30823, 61503, 110711}}, {7422, 17, 14516, {1, 3, 5, 11, 9, 53, 25, 147, 61, 533, 1369, 879, 7935, 13829, 26655, 17327, 52983}}, {7423, 17, 14519, {1, 3, 7, 11, 15, 27, 97, 175, 435, 53, 75, 807, 549, 5277, 1831, 19421, 55669}}, {7424, 17, 14525, {1, 1, 7, 15, 23, 5, 99, 133, 485, 587, 65, 2585, 7667, 2783, 19437, 52769, 1587}}, {7425, 17, 14534, {1, 1, 7, 7, 13, 39, 111, 165, 489, 355, 1963, 333, 2993, 5233, 9173, 18951, 93737}}, {7426, 17, 14537, {1, 1, 5, 7, 1, 29, 67, 135, 427, 91, 53, 3109, 3745, 9529, 17567, 42361, 84577}}, {7427, 17, 14543, {1, 3, 5, 1, 31, 35, 59, 181, 87, 345, 1975, 781, 603, 16365, 19453, 9933, 112739}}, {7428, 17, 14545, {1, 3, 3, 1, 31, 41, 127, 35, 263, 403, 1811, 383, 1523, 8477, 5973, 41569, 99309}}, {7429, 17, 14552, {1, 3, 7, 7, 5, 25, 11, 201, 231, 679, 519, 2481, 7415, 12397, 21265, 49419, 13903}}, {7430, 17, 14562, {1, 1, 7, 5, 1, 11, 63, 221, 327, 509, 419, 871, 7891, 11835, 11099, 10669, 43853}}, {7431, 17, 14571, {1, 1, 5, 11, 19, 11, 37, 105, 265, 513, 1013, 707, 6083, 14571, 17573, 7645, 5363}}, {7432, 17, 14574, {1, 1, 1, 13, 19, 19, 67, 93, 113, 509, 1013, 4037, 1939, 7015, 24487, 57183, 123463}}, {7433, 17, 14582, {1, 1, 1, 1, 21, 17, 95, 25, 261, 1005, 685, 691, 4467, 14723, 24043, 32287, 19651}}, {7434, 17, 14611, {1, 3, 1, 15, 15, 15, 57, 191, 27, 719, 229, 1977, 241, 9021, 21335, 30967, 81207}}, {7435, 17, 14614, {1, 3, 1, 9, 23, 61, 103, 67, 361, 925, 811, 1007, 5707, 11479, 5907, 3897, 65141}}, {7436, 17, 14620, {1, 3, 5, 9, 17, 61, 11, 15, 351, 715, 939, 2141, 4857, 8397, 9693, 26845, 120007}}, {7437, 17, 14633, {1, 3, 1, 5, 19, 55, 99, 19, 291, 309, 287, 1969, 4341, 7579, 30909, 37277, 54927}}, {7438, 17, 14641, {1, 3, 7, 3, 19, 29, 43, 163, 367, 753, 1733, 1463, 7927, 10671, 16817, 41229, 113887}}, {7439, 17, 14648, {1, 3, 7, 1, 11, 51, 39, 207, 283, 73, 1423, 2473, 7593, 3581, 30179, 6369, 112217}}, {7440, 17, 14671, {1, 1, 3, 15, 15, 25, 43, 5, 271, 611, 959, 537, 303, 3659, 18073, 8147, 81531}}, {7441, 17, 14674, {1, 3, 7, 1, 27, 55, 77, 11, 367, 209, 1967, 3409, 935, 5309, 18857, 46225, 8367}}, {7442, 17, 14689, {1, 1, 5, 11, 11, 63, 75, 73, 43, 869, 2021, 3285, 269, 9113, 32699, 2091, 17327}}, {7443, 17, 14690, {1, 1, 5, 11, 9, 25, 31, 245, 109, 805, 1645, 3607, 817, 9571, 12767, 65441, 129977}}, {7444, 17, 14692, {1, 3, 7, 5, 11, 61, 67, 223, 433, 387, 935, 1615, 7915, 6133, 24087, 55323, 100619}}, {7445, 17, 14699, {1, 1, 1, 15, 25, 61, 7, 39, 311, 353, 183, 33, 2591, 4951, 31377, 9081, 9707}}, {7446, 17, 14710, {1, 1, 3, 3, 1, 9, 65, 229, 185, 47, 1255, 1365, 2231, 6843, 26927, 27195, 60651}}, {7447, 17, 14719, {1, 1, 7, 5, 7, 25, 91, 133, 159, 737, 1767, 3117, 7321, 6159, 3361, 27793, 33473}}, {7448, 17, 14730, {1, 3, 7, 3, 11, 7, 5, 125, 369, 951, 1277, 65, 7703, 1817, 11773, 25657, 67045}}, {7449, 17, 14732, {1, 1, 3, 9, 21, 27, 21, 41, 131, 605, 1, 119, 1553, 1361, 31973, 43135, 119321}}, {7450, 17, 14743, {1, 3, 7, 1, 25, 63, 55, 173, 323, 403, 1401, 1367, 3455, 15335, 13045, 20759, 8309}}, {7451, 17, 14744, {1, 1, 3, 5, 3, 61, 59, 7, 39, 439, 721, 2829, 3035, 2293, 32015, 28509, 104831}}, {7452, 17, 14750, {1, 3, 5, 1, 29, 35, 71, 87, 351, 917, 1661, 547, 4501, 7107, 5493, 17833, 130729}}, {7453, 17, 14759, {1, 1, 5, 5, 7, 5, 69, 57, 319, 595, 1749, 3789, 1437, 6327, 24089, 7387, 125109}}, {7454, 17, 14763, {1, 3, 5, 9, 15, 53, 95, 59, 217, 37, 1561, 401, 5259, 4361, 1049, 3437, 30559}}, {7455, 17, 14768, {1, 3, 7, 13, 15, 15, 107, 167, 475, 157, 1565, 2219, 1891, 1433, 11829, 43433, 48111}}, {7456, 17, 14773, {1, 1, 1, 3, 11, 41, 25, 211, 243, 355, 1831, 2093, 2747, 2523, 9885, 9503, 120089}}, {7457, 17, 14777, {1, 3, 7, 5, 11, 3, 1, 231, 243, 541, 341, 887, 3567, 14759, 26763, 35705, 29417}}, {7458, 17, 14786, {1, 1, 7, 13, 17, 35, 117, 177, 81, 361, 1425, 2437, 6821, 1061, 15019, 19135, 106007}}, {7459, 17, 14795, {1, 3, 3, 11, 19, 5, 39, 23, 367, 9, 879, 3583, 2527, 14375, 28359, 27393, 55041}}, {7460, 17, 14800, {1, 1, 7, 11, 9, 41, 63, 125, 33, 337, 587, 3939, 2635, 4559, 1007, 38991, 35651}}, {7461, 17, 14812, {1, 1, 3, 1, 19, 11, 83, 13, 227, 649, 415, 1661, 3285, 55, 3683, 22319, 2127}}, {7462, 17, 14816, {1, 3, 7, 13, 19, 49, 113, 129, 83, 5, 19, 1095, 6561, 11049, 3805, 11355, 84265}}, {7463, 17, 14836, {1, 3, 1, 9, 19, 41, 111, 193, 429, 319, 67, 1717, 1819, 12959, 31449, 21035, 113161}}, {7464, 17, 14840, {1, 1, 5, 11, 19, 19, 115, 237, 145, 681, 1525, 2215, 7915, 15529, 7533, 45981, 85461}}, {7465, 17, 14856, {1, 1, 1, 1, 25, 3, 73, 207, 15, 69, 43, 1643, 7707, 12505, 27101, 40735, 6091}}, {7466, 17, 14859, {1, 1, 5, 11, 21, 61, 119, 7, 37, 147, 1379, 3165, 6555, 3867, 24027, 45161, 93015}}, {7467, 17, 14870, {1, 1, 3, 9, 9, 25, 51, 125, 511, 209, 75, 2849, 2299, 2901, 25157, 13079, 67733}}, {7468, 17, 14873, {1, 3, 7, 9, 31, 49, 99, 21, 89, 1, 1391, 1741, 2733, 7283, 12087, 9287, 39713}}, {7469, 17, 14879, {1, 1, 5, 5, 1, 5, 89, 109, 499, 343, 431, 401, 2023, 5541, 16615, 40059, 119195}}, {7470, 17, 14880, {1, 3, 5, 15, 27, 27, 9, 159, 395, 31, 865, 2793, 55, 10961, 23123, 63731, 54385}}, {7471, 17, 14889, {1, 3, 7, 1, 11, 47, 123, 239, 399, 383, 1497, 4075, 4659, 2911, 2101, 8295, 115717}}, {7472, 17, 14892, {1, 1, 3, 1, 11, 63, 125, 171, 65, 15, 349, 753, 2981, 6713, 6219, 14093, 78797}}, {7473, 17, 14895, {1, 1, 1, 13, 9, 15, 1, 113, 221, 867, 1907, 103, 1411, 27, 22743, 377, 116907}}, {7474, 17, 14900, {1, 3, 1, 5, 27, 5, 27, 245, 221, 575, 2009, 1561, 4263, 11843, 28331, 12865, 10483}}, {7475, 17, 14903, {1, 3, 7, 9, 1, 51, 119, 241, 439, 913, 1191, 2343, 2055, 10247, 18283, 40175, 63321}}, {7476, 17, 14910, {1, 1, 3, 15, 21, 59, 45, 151, 485, 293, 981, 3523, 7689, 2789, 5003, 62383, 126221}}, {7477, 17, 14912, {1, 1, 1, 1, 13, 15, 39, 201, 405, 513, 1721, 2077, 5995, 2433, 20421, 12695, 20393}}, {7478, 17, 14942, {1, 3, 5, 15, 11, 35, 113, 133, 187, 583, 577, 291, 7563, 12959, 9383, 44255, 81763}}, {7479, 17, 14948, {1, 3, 7, 15, 9, 55, 57, 227, 189, 595, 1311, 1131, 1323, 11347, 12777, 50963, 13827}}, {7480, 17, 14957, {1, 3, 5, 3, 11, 49, 77, 157, 107, 959, 761, 1457, 7121, 3027, 9269, 26291, 125261}}, {7481, 17, 14963, {1, 1, 5, 9, 23, 53, 125, 211, 303, 433, 1103, 41, 2643, 5325, 11885, 23825, 80415}}, {7482, 17, 14975, {1, 1, 7, 1, 29, 25, 51, 107, 209, 165, 707, 1855, 7429, 1583, 5941, 47509, 90105}}, {7483, 17, 14985, {1, 1, 3, 3, 1, 15, 121, 165, 181, 259, 1949, 3049, 3545, 3093, 5967, 49207, 37129}}, {7484, 17, 14993, {1, 1, 5, 13, 9, 59, 93, 87, 57, 343, 389, 1995, 4001, 11495, 12909, 13491, 61759}}, {7485, 17, 15003, {1, 3, 1, 5, 11, 27, 27, 133, 459, 733, 1845, 1795, 4613, 3397, 12313, 52839, 129583}}, {7486, 17, 15010, {1, 3, 5, 3, 19, 1, 7, 145, 255, 337, 1649, 1473, 4113, 4425, 12233, 55477, 69157}}, {7487, 17, 15022, {1, 1, 3, 1, 25, 27, 93, 59, 415, 437, 25, 1565, 319, 8981, 2453, 53579, 45033}}, {7488, 17, 15039, {1, 3, 7, 1, 27, 49, 47, 233, 341, 101, 2017, 2827, 8085, 237, 6363, 61139, 88903}}, {7489, 17, 15041, {1, 1, 1, 5, 23, 47, 65, 251, 423, 957, 1751, 3541, 5405, 1335, 22703, 12587, 60201}}, {7490, 17, 15047, {1, 1, 3, 3, 5, 51, 85, 195, 423, 519, 1797, 3821, 5915, 12257, 5377, 62733, 41197}}, {7491, 17, 15048, {1, 3, 7, 15, 3, 47, 97, 1, 5, 175, 1449, 1609, 6873, 12017, 5579, 2665, 58389}}, {7492, 17, 15056, {1, 3, 3, 15, 19, 37, 35, 29, 79, 767, 21, 1279, 1997, 11611, 14381, 35607, 127701}}, {7493, 17, 15066, {1, 3, 7, 7, 7, 43, 47, 33, 69, 155, 703, 1373, 1589, 6997, 8627, 50647, 16989}}, {7494, 17, 15068, {1, 3, 1, 5, 13, 33, 69, 133, 399, 361, 1633, 321, 2077, 8857, 13419, 23227, 40003}}, {7495, 17, 15075, {1, 1, 1, 15, 15, 9, 45, 181, 427, 1005, 341, 1697, 6423, 5727, 7163, 10401, 38957}}, {7496, 17, 15077, {1, 1, 7, 1, 17, 5, 17, 95, 279, 171, 825, 2459, 5243, 10683, 1849, 32809, 8995}}, {7497, 17, 15082, {1, 3, 5, 15, 27, 47, 103, 69, 69, 255, 961, 2173, 5297, 5987, 5863, 14311, 117569}}, {7498, 17, 15096, {1, 1, 1, 11, 21, 27, 61, 239, 183, 1013, 1955, 3171, 4183, 965, 14885, 49605, 87851}}, {7499, 17, 15102, {1, 1, 7, 9, 9, 53, 99, 211, 267, 803, 1545, 4011, 7613, 13889, 28277, 6817, 26515}}, {7500, 17, 15116, {1, 1, 3, 9, 1, 19, 33, 227, 461, 679, 499, 1069, 837, 12129, 20779, 12937, 104367}}, {7501, 17, 15122, {1, 3, 3, 15, 7, 3, 29, 245, 179, 1015, 1651, 3753, 4185, 15357, 17379, 52835, 51953}}, {7502, 17, 15127, {1, 3, 3, 3, 3, 25, 95, 239, 263, 427, 1749, 183, 5251, 361, 32549, 24331, 30789}}, {7503, 17, 15133, {1, 1, 7, 1, 5, 3, 79, 9, 403, 195, 1433, 385, 8105, 7893, 16415, 23253, 127837}}, {7504, 17, 15137, {1, 3, 7, 3, 23, 45, 115, 27, 473, 241, 361, 1787, 4247, 13451, 5627, 32923, 29375}}, {7505, 17, 15138, {1, 3, 7, 1, 5, 55, 43, 37, 481, 899, 51, 2459, 5005, 12365, 19261, 32797, 45843}}, {7506, 17, 15149, {1, 3, 7, 5, 9, 41, 83, 163, 241, 899, 567, 231, 4897, 15175, 10329, 6625, 95927}}, {7507, 17, 15152, {1, 3, 1, 1, 7, 51, 61, 55, 253, 315, 1893, 2635, 4061, 257, 14147, 36639, 24893}}, {7508, 17, 15155, {1, 1, 5, 1, 13, 63, 115, 119, 205, 309, 277, 2191, 341, 4715, 13111, 58043, 51241}}, {7509, 17, 15158, {1, 3, 1, 15, 17, 23, 89, 121, 205, 15, 295, 667, 421, 14071, 27719, 1335, 9887}}, {7510, 17, 15187, {1, 3, 5, 5, 17, 49, 5, 93, 251, 613, 1029, 945, 1547, 10479, 20183, 26787, 120441}}, {7511, 17, 15189, {1, 3, 3, 15, 17, 11, 63, 97, 499, 313, 881, 2233, 4287, 5141, 13841, 40725, 49285}}, {7512, 17, 15190, {1, 3, 3, 11, 19, 33, 105, 203, 325, 337, 353, 1923, 7157, 8623, 23881, 4513, 71495}}, {7513, 17, 15196, {1, 1, 5, 1, 3, 15, 119, 43, 85, 869, 1597, 2433, 845, 5065, 12813, 64849, 58491}}, {7514, 17, 15199, {1, 3, 7, 7, 25, 63, 119, 93, 303, 665, 571, 1795, 5853, 13527, 12715, 36483, 57723}}, {7515, 17, 15205, {1, 3, 7, 13, 19, 43, 55, 85, 189, 627, 1457, 3185, 3491, 1913, 13399, 30681, 69015}}, {7516, 17, 15212, {1, 3, 5, 9, 5, 41, 51, 65, 147, 425, 569, 1317, 1557, 7631, 17243, 37847, 51161}}, {7517, 17, 15236, {1, 1, 3, 7, 29, 39, 61, 127, 489, 89, 749, 2073, 195, 14367, 13533, 27403, 16365}}, {7518, 17, 15243, {1, 3, 7, 15, 13, 35, 45, 157, 373, 415, 725, 779, 3559, 7489, 11369, 36501, 60761}}, {7519, 17, 15246, {1, 3, 1, 3, 13, 45, 25, 215, 385, 709, 499, 3861, 761, 15597, 3335, 37013, 13173}}, {7520, 17, 15260, {1, 1, 7, 1, 13, 49, 89, 135, 175, 1015, 67, 957, 4893, 9843, 13027, 14709, 59721}}, {7521, 17, 15267, {1, 3, 3, 11, 19, 37, 109, 143, 135, 535, 1543, 3991, 189, 6739, 28087, 18845, 41819}}, {7522, 17, 15274, {1, 1, 7, 5, 1, 7, 11, 5, 211, 251, 1593, 2527, 3539, 10471, 25595, 60119, 89213}}, {7523, 17, 15279, {1, 1, 5, 7, 13, 51, 121, 167, 299, 403, 977, 521, 279, 15521, 15901, 935, 14065}}, {7524, 17, 15281, {1, 1, 7, 13, 7, 21, 27, 205, 377, 801, 1365, 1567, 6651, 139, 14229, 30827, 50429}}, {7525, 17, 15282, {1, 1, 1, 1, 17, 11, 75, 87, 217, 413, 1923, 1765, 2037, 14061, 12433, 30671, 24883}}, {7526, 17, 15284, {1, 1, 5, 13, 17, 51, 91, 241, 95, 505, 349, 2689, 1117, 4435, 1713, 44501, 125619}}, {7527, 17, 15291, {1, 1, 3, 15, 11, 21, 25, 59, 511, 353, 799, 91, 4517, 16005, 17061, 21841, 46311}}, {7528, 17, 15293, {1, 1, 1, 5, 19, 53, 109, 177, 213, 373, 761, 453, 5753, 69, 3503, 49411, 111105}}, {7529, 17, 15302, {1, 3, 1, 5, 21, 27, 103, 167, 109, 55, 1849, 3999, 7801, 4185, 9789, 7515, 124983}}, {7530, 17, 15319, {1, 3, 7, 7, 25, 9, 65, 127, 141, 169, 1079, 3377, 691, 5119, 6629, 3517, 28963}}, {7531, 17, 15329, {1, 1, 3, 11, 15, 61, 127, 35, 87, 891, 1459, 483, 6763, 16173, 5633, 6939, 63411}}, {7532, 17, 15336, {1, 3, 5, 3, 7, 63, 111, 85, 415, 273, 1705, 4045, 5551, 2377, 29025, 16831, 90203}}, {7533, 17, 15347, {1, 3, 5, 13, 7, 23, 103, 227, 477, 985, 1059, 1489, 7233, 1917, 10409, 38759, 86761}}, {7534, 17, 15353, {1, 3, 5, 7, 31, 33, 75, 41, 355, 577, 225, 5, 897, 15653, 27415, 83, 14911}}, {7535, 17, 15361, {1, 3, 5, 5, 23, 13, 5, 43, 165, 53, 149, 2005, 4545, 477, 17885, 21343, 35751}}, {7536, 17, 15371, {1, 3, 3, 3, 25, 51, 33, 203, 291, 835, 241, 3255, 3709, 3573, 9859, 33027, 122801}}, {7537, 17, 15397, {1, 3, 5, 7, 13, 7, 3, 141, 455, 67, 2003, 3411, 4717, 157, 29491, 14429, 44849}}, {7538, 17, 15404, {1, 1, 1, 11, 3, 33, 101, 93, 219, 371, 1191, 1521, 1663, 8485, 24815, 38283, 120867}}, {7539, 17, 15407, {1, 1, 3, 9, 25, 61, 71, 173, 69, 181, 1525, 2129, 2979, 19, 13489, 627, 72619}}, {7540, 17, 15421, {1, 3, 1, 7, 25, 33, 39, 247, 221, 7, 683, 1837, 8037, 9125, 4259, 63049, 63021}}, {7541, 17, 15433, {1, 3, 3, 9, 17, 15, 9, 189, 357, 707, 521, 711, 8189, 12945, 29675, 11851, 126813}}, {7542, 17, 15441, {1, 3, 1, 1, 23, 3, 57, 133, 245, 301, 957, 239, 3139, 7949, 27133, 18229, 93015}}, {7543, 17, 15442, {1, 1, 3, 1, 29, 23, 35, 87, 231, 257, 1997, 271, 3019, 3409, 10613, 42245, 111309}}, {7544, 17, 15463, {1, 1, 3, 3, 1, 21, 17, 37, 393, 943, 791, 3101, 6715, 11907, 25369, 9061, 75381}}, {7545, 17, 15472, {1, 1, 7, 7, 17, 31, 25, 7, 183, 819, 1265, 3343, 6845, 2039, 3779, 41861, 38309}}, {7546, 17, 15478, {1, 1, 1, 5, 17, 25, 1, 41, 173, 995, 863, 3515, 1779, 2159, 28223, 64661, 40697}}, {7547, 17, 15488, {1, 1, 3, 15, 29, 49, 81, 241, 511, 817, 1301, 3593, 6759, 7483, 8859, 30339, 106137}}, {7548, 17, 15493, {1, 3, 1, 11, 17, 61, 95, 231, 3, 693, 37, 1091, 3111, 11941, 17475, 8073, 62373}}, {7549, 17, 15498, {1, 1, 1, 3, 7, 25, 93, 7, 291, 957, 859, 2519, 241, 10963, 10403, 933, 50599}}, {7550, 17, 15511, {1, 1, 7, 1, 7, 33, 121, 91, 369, 333, 229, 4073, 6063, 6491, 31711, 65061, 107843}}, {7551, 17, 15521, {1, 1, 5, 15, 17, 1, 117, 195, 445, 547, 867, 2893, 4835, 6513, 29091, 60367, 33409}}, {7552, 17, 15534, {1, 3, 3, 7, 15, 5, 125, 131, 165, 127, 207, 853, 5927, 3605, 17083, 44481, 111333}}, {7553, 17, 15539, {1, 1, 1, 9, 3, 43, 75, 191, 319, 889, 1513, 3301, 1535, 4693, 10367, 12491, 43175}}, {7554, 17, 15541, {1, 3, 5, 5, 29, 19, 75, 221, 393, 977, 1373, 1571, 7377, 1763, 18073, 11381, 101241}}, {7555, 17, 15560, {1, 3, 1, 15, 3, 15, 73, 91, 165, 213, 1077, 1267, 2411, 15807, 3979, 12731, 86597}}, {7556, 17, 15563, {1, 1, 3, 7, 3, 21, 5, 135, 95, 337, 1853, 1675, 2449, 12535, 18505, 60127, 76949}}, {7557, 17, 15574, {1, 1, 7, 3, 15, 11, 63, 127, 329, 169, 1569, 675, 4801, 5859, 3243, 25811, 77841}}, {7558, 17, 15578, {1, 1, 1, 9, 19, 13, 73, 119, 105, 537, 951, 1033, 5303, 5775, 815, 19277, 57607}}, {7559, 17, 15584, {1, 3, 5, 5, 23, 21, 91, 231, 117, 1007, 1603, 841, 2595, 11223, 17171, 25963, 17049}}, {7560, 17, 15593, {1, 1, 5, 11, 15, 43, 7, 229, 55, 129, 599, 993, 563, 15677, 16703, 36253, 17847}}, {7561, 17, 15604, {1, 3, 1, 9, 25, 3, 109, 21, 87, 721, 1927, 3219, 3395, 3267, 9117, 13591, 89267}}, {7562, 17, 15614, {1, 1, 1, 15, 11, 17, 47, 49, 125, 925, 333, 945, 2411, 10907, 12021, 47857, 84303}}, {7563, 17, 15619, {1, 1, 1, 1, 23, 11, 99, 215, 105, 417, 823, 1289, 421, 12285, 17711, 35389, 1935}}, {7564, 17, 15622, {1, 1, 1, 15, 27, 7, 23, 141, 7, 929, 147, 681, 5473, 4173, 28645, 42053, 83573}}, {7565, 17, 15633, {1, 1, 1, 11, 5, 61, 71, 65, 287, 697, 1183, 3257, 7251, 14011, 21349, 42445, 4701}}, {7566, 17, 15639, {1, 3, 5, 9, 5, 23, 45, 217, 369, 189, 1495, 107, 425, 10467, 4909, 64293, 17885}}, {7567, 17, 15646, {1, 1, 3, 11, 21, 45, 75, 65, 57, 893, 783, 3429, 409, 13617, 483, 62489, 2919}}, {7568, 17, 15673, {1, 1, 7, 3, 5, 61, 51, 255, 501, 839, 367, 1165, 7055, 8139, 23891, 18807, 20739}}, {7569, 17, 15674, {1, 1, 3, 7, 23, 15, 97, 139, 323, 463, 921, 1529, 6655, 8697, 23577, 56761, 62023}}, {7570, 17, 15684, {1, 1, 5, 11, 13, 11, 57, 225, 277, 713, 1427, 95, 1135, 7721, 30731, 32625, 107891}}, {7571, 17, 15691, {1, 1, 5, 7, 23, 35, 39, 91, 291, 609, 919, 3325, 6843, 7659, 5603, 37471, 41495}}, {7572, 17, 15694, {1, 1, 1, 1, 25, 11, 117, 15, 389, 589, 1345, 423, 6531, 9903, 20243, 9523, 22991}}, {7573, 17, 15696, {1, 3, 5, 15, 29, 7, 57, 113, 387, 883, 1141, 3295, 2973, 4129, 16973, 33429, 109997}}, {7574, 17, 15701, {1, 3, 5, 3, 25, 1, 73, 207, 353, 203, 1479, 985, 6373, 3079, 28403, 63675, 21787}}, {7575, 17, 15705, {1, 3, 1, 5, 31, 39, 107, 197, 359, 45, 203, 559, 4721, 6579, 11305, 12957, 10061}}, {7576, 17, 15715, {1, 3, 7, 15, 9, 3, 55, 153, 373, 981, 575, 827, 4757, 15743, 14295, 43875, 17847}}, {7577, 17, 15729, {1, 3, 5, 1, 17, 1, 93, 87, 207, 997, 1695, 3643, 6973, 9507, 29309, 58531, 6849}}, {7578, 17, 15730, {1, 3, 1, 11, 3, 39, 17, 241, 83, 931, 39, 3839, 6437, 5159, 28869, 61859, 96873}}, {7579, 17, 15741, {1, 1, 5, 13, 29, 43, 71, 159, 261, 563, 695, 1205, 2273, 8077, 12569, 17187, 54369}}, {7580, 17, 15745, {1, 3, 7, 5, 11, 57, 17, 31, 311, 1001, 1419, 3899, 6679, 15531, 28877, 28221, 105413}}, {7581, 17, 15748, {1, 3, 3, 13, 23, 29, 127, 19, 345, 1003, 1571, 2219, 3199, 9903, 18701, 31865, 108879}}, {7582, 17, 15757, {1, 3, 7, 13, 23, 51, 95, 43, 35, 439, 25, 323, 2365, 12407, 27525, 57795, 74495}}, {7583, 17, 15765, {1, 1, 1, 1, 17, 43, 57, 185, 439, 929, 69, 813, 6205, 3139, 3853, 56967, 19073}}, {7584, 17, 15766, {1, 3, 7, 1, 27, 5, 43, 211, 395, 113, 1675, 1505, 6171, 5169, 9991, 21641, 27101}}, {7585, 17, 15775, {1, 3, 3, 1, 17, 41, 59, 131, 131, 339, 955, 1145, 5301, 4585, 20441, 43227, 23123}}, {7586, 17, 15776, {1, 1, 7, 9, 9, 55, 61, 31, 71, 229, 963, 3247, 4677, 9595, 21715, 36391, 86997}}, {7587, 17, 15779, {1, 1, 7, 5, 9, 17, 55, 179, 27, 229, 79, 1335, 5887, 1003, 22085, 34377, 51367}}, {7588, 17, 15786, {1, 1, 1, 5, 11, 45, 15, 219, 411, 27, 1003, 1553, 303, 13571, 13985, 6801, 52407}}, {7589, 17, 15788, {1, 3, 3, 7, 7, 55, 111, 255, 453, 409, 1863, 1449, 4103, 8725, 26923, 5017, 43657}}, {7590, 17, 15813, {1, 1, 1, 15, 23, 3, 95, 57, 29, 727, 1111, 3309, 1089, 471, 16099, 11517, 51563}}, {7591, 17, 15814, {1, 3, 1, 15, 17, 57, 83, 163, 251, 987, 1159, 2079, 3463, 13109, 7443, 8665, 123397}}, {7592, 17, 15842, {1, 1, 7, 1, 27, 13, 35, 209, 471, 843, 1029, 1383, 5413, 2085, 13431, 26557, 47033}}, {7593, 17, 15851, {1, 3, 1, 1, 21, 21, 83, 135, 303, 27, 1407, 1751, 331, 9207, 31891, 59287, 120687}}, {7594, 17, 15862, {1, 1, 1, 9, 11, 35, 103, 157, 1, 855, 175, 3203, 4381, 3113, 27589, 4567, 31897}}, {7595, 17, 15875, {1, 1, 3, 5, 21, 5, 123, 161, 301, 101, 909, 947, 6893, 15459, 29139, 49377, 94901}}, {7596, 17, 15878, {1, 3, 7, 7, 21, 27, 5, 69, 427, 409, 1389, 3737, 847, 2775, 603, 1001, 87651}}, {7597, 17, 15889, {1, 1, 3, 5, 1, 57, 109, 89, 99, 593, 581, 3527, 1557, 4971, 27523, 26909, 35787}}, {7598, 17, 15896, {1, 1, 7, 3, 31, 19, 83, 65, 239, 919, 15, 2289, 4117, 9127, 6033, 49667, 89343}}, {7599, 17, 15901, {1, 3, 7, 7, 9, 31, 87, 117, 195, 681, 1711, 1753, 2221, 10053, 1985, 6273, 21801}}, {7600, 17, 15908, {1, 3, 1, 7, 21, 61, 53, 231, 309, 115, 1729, 3883, 6085, 4825, 31455, 50097, 59779}}, {7601, 17, 15911, {1, 1, 1, 9, 29, 25, 45, 91, 145, 927, 147, 371, 2603, 12537, 17267, 59895, 128009}}, {7602, 17, 15915, {1, 1, 1, 1, 15, 41, 63, 43, 167, 215, 15, 3387, 1811, 12391, 25721, 6961, 13701}}, {7603, 17, 15938, {1, 1, 7, 1, 27, 63, 25, 85, 337, 799, 87, 2237, 4085, 14529, 11493, 60149, 86399}}, {7604, 17, 15944, {1, 3, 1, 11, 1, 41, 103, 145, 279, 805, 1201, 823, 5411, 4227, 25999, 14373, 36295}}, {7605, 17, 15950, {1, 1, 7, 3, 27, 51, 83, 105, 155, 657, 1879, 3869, 2559, 2939, 19785, 47167, 34503}}, {7606, 17, 15955, {1, 3, 1, 5, 3, 31, 47, 241, 257, 15, 983, 4095, 3745, 3901, 1639, 5421, 81585}}, {7607, 17, 15974, {1, 3, 3, 5, 31, 13, 127, 125, 175, 577, 1103, 3573, 6229, 13969, 6267, 19067, 3933}}, {7608, 17, 15978, {1, 1, 7, 1, 31, 17, 15, 15, 411, 553, 1929, 3731, 1955, 11749, 21991, 39189, 124427}}, {7609, 17, 15980, {1, 3, 5, 5, 19, 63, 93, 201, 491, 599, 1093, 767, 3411, 13087, 23569, 42981, 35757}}, {7610, 17, 15983, {1, 1, 1, 15, 27, 7, 51, 101, 429, 939, 111, 781, 2055, 14227, 17821, 42097, 32485}}, {7611, 17, 15991, {1, 3, 7, 13, 11, 21, 3, 161, 353, 389, 285, 2633, 6245, 7089, 21907, 40765, 88869}}, {7612, 17, 16004, {1, 1, 5, 9, 7, 27, 101, 203, 243, 897, 1375, 1619, 5275, 12935, 22103, 38005, 65603}}, {7613, 17, 16011, {1, 1, 5, 9, 13, 25, 15, 21, 447, 7, 947, 1613, 5055, 129, 18057, 58551, 6603}}, {7614, 17, 16016, {1, 3, 7, 15, 17, 41, 11, 55, 103, 339, 349, 1813, 7423, 11837, 20641, 51951, 61615}}, {7615, 17, 16019, {1, 3, 3, 15, 21, 59, 113, 3, 123, 689, 465, 3039, 4109, 3241, 30317, 65053, 117845}}, {7616, 17, 16025, {1, 3, 3, 1, 31, 33, 73, 155, 245, 401, 473, 51, 1387, 489, 10573, 55401, 106733}}, {7617, 17, 16041, {1, 3, 3, 1, 31, 37, 15, 139, 127, 201, 229, 1753, 7287, 9045, 18321, 63485, 26399}}, {7618, 17, 16064, {1, 3, 5, 5, 5, 23, 93, 3, 125, 715, 1827, 419, 1213, 9031, 25139, 20771, 41345}}, {7619, 17, 16067, {1, 3, 5, 15, 23, 15, 13, 145, 105, 477, 1131, 2699, 1929, 10447, 9655, 26791, 80101}}, {7620, 17, 16074, {1, 1, 1, 13, 1, 35, 75, 73, 269, 851, 737, 1909, 6805, 11359, 28991, 52435, 83767}}, {7621, 17, 16082, {1, 1, 7, 5, 11, 31, 31, 91, 111, 161, 1865, 2545, 133, 12215, 8957, 20671, 92975}}, {7622, 17, 16103, {1, 1, 7, 5, 25, 53, 55, 121, 53, 457, 831, 2493, 339, 10955, 30783, 9095, 97921}}, {7623, 17, 16109, {1, 1, 5, 3, 25, 33, 81, 51, 211, 737, 1865, 4039, 6931, 8473, 22459, 24885, 96355}}, {7624, 17, 16122, {1, 3, 7, 13, 23, 5, 101, 171, 65, 793, 443, 411, 7629, 14791, 28633, 9055, 123763}}, {7625, 17, 16149, {1, 3, 3, 1, 11, 7, 99, 79, 461, 481, 1689, 3777, 2125, 4783, 13061, 19537, 68109}}, {7626, 17, 16170, {1, 1, 3, 11, 31, 53, 109, 7, 49, 925, 1017, 2371, 1537, 13557, 75, 40677, 49181}}, {7627, 17, 16175, {1, 3, 3, 3, 9, 1, 95, 113, 189, 389, 377, 393, 6523, 3183, 6461, 30201, 66549}}, {7628, 17, 16178, {1, 1, 7, 15, 13, 19, 41, 171, 475, 157, 949, 3245, 5581, 2783, 25263, 53023, 11155}}, {7629, 17, 16189, {1, 3, 5, 7, 29, 63, 61, 65, 315, 595, 905, 899, 5059, 4243, 27287, 14023, 64213}}, {7630, 17, 16202, {1, 3, 1, 3, 15, 37, 109, 161, 9, 867, 1023, 2513, 4593, 7747, 1505, 4801, 127091}}, {7631, 17, 16204, {1, 3, 1, 7, 11, 59, 75, 129, 469, 695, 63, 2757, 6357, 8675, 6193, 23439, 66445}}, {7632, 17, 16222, {1, 1, 3, 13, 17, 9, 47, 91, 161, 265, 139, 129, 6707, 9659, 8917, 54757, 77835}}, {7633, 17, 16231, {1, 1, 3, 13, 19, 37, 113, 255, 99, 913, 1445, 487, 337, 1001, 16395, 37141, 66595}}, {7634, 17, 16238, {1, 1, 1, 15, 3, 63, 69, 43, 185, 293, 1137, 2061, 2377, 8741, 26817, 5833, 7807}}, {7635, 17, 16262, {1, 1, 1, 5, 3, 29, 39, 33, 263, 355, 597, 539, 5055, 13075, 8977, 19829, 88171}}, {7636, 17, 16265, {1, 3, 7, 9, 17, 49, 125, 101, 447, 597, 1337, 559, 2807, 7925, 12421, 17427, 34815}}, {7637, 17, 16276, {1, 3, 1, 9, 11, 57, 31, 163, 503, 925, 911, 3721, 2515, 8429, 25749, 55209, 90105}}, {7638, 17, 16285, {1, 3, 5, 3, 21, 57, 119, 233, 319, 745, 563, 3057, 2683, 7063, 11513, 49157, 64561}}, {7639, 17, 16313, {1, 1, 3, 9, 15, 21, 93, 99, 227, 479, 965, 51, 6941, 9887, 32409, 23171, 98387}}, {7640, 17, 16314, {1, 3, 5, 5, 19, 1, 47, 49, 233, 931, 971, 2369, 2827, 1291, 18653, 725, 19791}}, {7641, 17, 16321, {1, 1, 5, 15, 3, 7, 71, 251, 341, 861, 1203, 793, 7627, 10929, 10717, 10677, 49743}}, {7642, 17, 16327, {1, 3, 1, 7, 3, 43, 9, 187, 247, 621, 1069, 2875, 1525, 4221, 18813, 35807, 117609}}, {7643, 17, 16333, {1, 3, 3, 3, 29, 39, 83, 201, 205, 337, 231, 547, 2893, 2483, 6197, 26869, 18921}}, {7644, 17, 16334, {1, 1, 7, 3, 23, 29, 33, 137, 491, 691, 979, 65, 5711, 11685, 5137, 37993, 37075}}, {7645, 17, 16364, {1, 3, 3, 1, 11, 3, 99, 119, 203, 901, 1887, 879, 7547, 4613, 31233, 13279, 105089}}, {7646, 17, 16369, {1, 1, 1, 13, 25, 23, 111, 167, 313, 141, 127, 1223, 5711, 4101, 10977, 34695, 128303}}, {7647, 17, 16370, {1, 1, 7, 15, 5, 3, 89, 151, 289, 769, 539, 2883, 8121, 15403, 22345, 63765, 117015}}, {7648, 17, 16375, {1, 1, 1, 13, 15, 9, 71, 95, 37, 705, 1575, 3735, 7445, 2027, 27523, 53321, 106085}}, {7649, 17, 16376, {1, 3, 5, 7, 5, 29, 7, 25, 181, 491, 1173, 1947, 3321, 9233, 17265, 26999, 97783}}, {7650, 17, 16379, {1, 1, 3, 15, 1, 63, 111, 113, 279, 123, 345, 1529, 2725, 8643, 8551, 30073, 26689}}, {7651, 17, 16393, {1, 3, 7, 7, 5, 55, 117, 211, 293, 851, 1491, 3265, 4009, 14949, 10297, 16219, 69983}}, {7652, 17, 16402, {1, 1, 3, 11, 23, 45, 35, 91, 97, 191, 417, 3545, 1733, 3955, 10763, 10229, 75027}}, {7653, 17, 16408, {1, 1, 3, 13, 3, 61, 69, 205, 379, 627, 295, 3979, 85, 11305, 2493, 35583, 3133}}, {7654, 17, 16418, {1, 3, 5, 9, 5, 63, 67, 201, 351, 367, 1009, 739, 5409, 8715, 28939, 31511, 34599}}, {7655, 17, 16438, {1, 1, 1, 5, 3, 25, 21, 25, 477, 301, 623, 157, 563, 9457, 24515, 30135, 107165}}, {7656, 17, 16441, {1, 1, 3, 15, 5, 41, 49, 171, 469, 427, 857, 2165, 1437, 2151, 24061, 63243, 105331}}, {7657, 17, 16447, {1, 3, 5, 11, 21, 25, 59, 167, 29, 653, 1503, 2223, 3889, 4605, 28381, 36075, 74907}}, {7658, 17, 16450, {1, 3, 7, 7, 17, 55, 73, 127, 33, 319, 1565, 2761, 6473, 2187, 19939, 56687, 112137}}, {7659, 17, 16455, {1, 1, 1, 9, 7, 53, 105, 3, 299, 15, 1009, 607, 6885, 12875, 20719, 16841, 70471}}, {7660, 17, 16459, {1, 3, 5, 9, 7, 33, 23, 163, 279, 739, 1541, 3017, 2309, 11827, 3875, 44337, 82063}}, {7661, 17, 16483, {1, 1, 1, 5, 19, 53, 109, 193, 331, 339, 477, 4093, 5177, 13527, 25731, 64137, 81411}}, {7662, 17, 16490, {1, 3, 7, 13, 15, 63, 101, 145, 127, 13, 1431, 3581, 4993, 14287, 12125, 60217, 102563}}, {7663, 17, 16492, {1, 3, 1, 7, 17, 27, 127, 81, 223, 763, 761, 2061, 1031, 12251, 14141, 23587, 124813}}, {7664, 17, 16495, {1, 3, 5, 13, 27, 21, 9, 249, 285, 875, 65, 4075, 6749, 13417, 3079, 29343, 87075}}, {7665, 17, 16523, {1, 3, 5, 13, 1, 31, 61, 21, 169, 145, 1681, 1229, 5059, 13555, 21373, 35597, 70669}}, {7666, 17, 16528, {1, 3, 7, 15, 23, 31, 43, 237, 139, 9, 1905, 3197, 801, 14205, 13323, 18717, 88523}}, {7667, 17, 16543, {1, 1, 1, 11, 1, 7, 21, 83, 15, 459, 537, 4029, 6973, 4019, 1, 35147, 16329}}, {7668, 17, 16553, {1, 3, 7, 15, 23, 11, 17, 101, 235, 683, 913, 3529, 4363, 13899, 3603, 27741, 74143}}, {7669, 17, 16562, {1, 1, 7, 7, 3, 3, 91, 107, 499, 723, 315, 2805, 5909, 11041, 18281, 54981, 76041}}, {7670, 17, 16564, {1, 3, 7, 9, 15, 7, 93, 171, 275, 647, 655, 3565, 2199, 14795, 21945, 9373, 122299}}, {7671, 17, 16576, {1, 1, 1, 5, 27, 53, 73, 27, 431, 707, 53, 1281, 49, 13199, 1973, 18935, 114821}}, {7672, 17, 16588, {1, 1, 3, 3, 25, 1, 17, 159, 217, 413, 1393, 2119, 5611, 7659, 6003, 19927, 22287}}, {7673, 17, 16612, {1, 1, 7, 15, 29, 59, 77, 9, 205, 795, 627, 2167, 2477, 6841, 17663, 34871, 79823}}, {7674, 17, 16630, {1, 3, 5, 9, 13, 35, 79, 237, 11, 335, 789, 2291, 13, 853, 20373, 39049, 407}}, {7675, 17, 16654, {1, 1, 5, 7, 13, 27, 21, 173, 137, 659, 123, 2677, 2153, 14879, 26737, 56291, 47613}}, {7676, 17, 16656, {1, 3, 5, 15, 23, 47, 15, 109, 311, 597, 261, 2407, 8139, 3215, 28169, 60731, 79937}}, {7677, 17, 16668, {1, 3, 3, 5, 11, 61, 71, 29, 189, 741, 1171, 397, 2669, 10627, 20037, 51703, 6697}}, {7678, 17, 16672, {1, 3, 3, 3, 9, 41, 125, 1, 381, 399, 349, 3265, 6337, 8113, 14869, 5305, 83409}}, {7679, 17, 16675, {1, 1, 3, 13, 5, 19, 33, 225, 45, 55, 1809, 1037, 5443, 15719, 9963, 363, 15145}}, {7680, 17, 16678, {1, 3, 7, 1, 31, 25, 103, 29, 207, 169, 305, 913, 7501, 15323, 10575, 13477, 65245}}, {7681, 17, 16681, {1, 3, 3, 15, 13, 23, 69, 255, 333, 157, 279, 1989, 3439, 12955, 13649, 52431, 90009}}, {7682, 17, 16689, {1, 3, 7, 5, 23, 61, 111, 121, 79, 469, 89, 1545, 3405, 12393, 2035, 15989, 84855}}, {7683, 17, 16699, {1, 1, 7, 5, 17, 21, 127, 151, 283, 521, 5, 3023, 5365, 11633, 21177, 42207, 48925}}, {7684, 17, 16719, {1, 3, 7, 5, 21, 21, 61, 17, 415, 879, 1485, 3727, 935, 9899, 23241, 651, 103701}}, {7685, 17, 16734, {1, 3, 5, 15, 31, 47, 19, 245, 249, 467, 253, 1575, 337, 863, 19353, 13153, 125453}}, {7686, 17, 16737, {1, 1, 7, 15, 9, 41, 39, 63, 139, 875, 1011, 1961, 1627, 7461, 28961, 47195, 16239}}, {7687, 17, 16750, {1, 3, 3, 7, 27, 55, 51, 245, 231, 619, 43, 91, 2125, 2685, 23661, 10189, 43085}}, {7688, 17, 16752, {1, 1, 7, 9, 27, 55, 35, 139, 187, 143, 1545, 2685, 3173, 12065, 21607, 42619, 105279}}, {7689, 17, 16757, {1, 1, 5, 3, 29, 63, 15, 197, 49, 995, 389, 1959, 2441, 11509, 31753, 40539, 26989}}, {7690, 17, 16761, {1, 3, 7, 15, 19, 37, 17, 37, 305, 469, 945, 2335, 1493, 13843, 19905, 49031, 107893}}, {7691, 17, 16773, {1, 3, 1, 11, 3, 35, 113, 181, 223, 27, 485, 2435, 3423, 11321, 1687, 45755, 18017}}, {7692, 17, 16774, {1, 3, 3, 13, 17, 47, 109, 145, 287, 769, 1373, 3423, 1251, 14357, 3209, 28363, 97987}}, {7693, 17, 16801, {1, 1, 3, 13, 7, 25, 93, 11, 23, 331, 517, 1705, 1957, 291, 763, 10411, 120367}}, {7694, 17, 16802, {1, 3, 7, 15, 25, 9, 1, 33, 83, 61, 97, 509, 5387, 8701, 14243, 31883, 7375}}, {7695, 17, 16822, {1, 3, 1, 5, 19, 11, 59, 95, 265, 205, 533, 1857, 693, 12469, 24445, 19449, 130623}}, {7696, 17, 16831, {1, 1, 7, 7, 1, 5, 15, 159, 333, 361, 391, 1889, 2645, 15115, 30709, 60515, 13315}}, {7697, 17, 16840, {1, 3, 5, 15, 25, 61, 69, 213, 183, 575, 1573, 3147, 1753, 2387, 23063, 12853, 108507}}, {7698, 17, 16854, {1, 1, 1, 15, 17, 31, 11, 177, 411, 23, 469, 3985, 2159, 2273, 14175, 20425, 107741}}, {7699, 17, 16858, {1, 1, 3, 9, 5, 35, 55, 225, 263, 641, 1393, 1277, 595, 2671, 7039, 64999, 114387}}, {7700, 17, 16863, {1, 1, 3, 3, 11, 23, 1, 161, 77, 755, 1325, 1773, 4291, 13119, 29677, 27295, 81713}}, {7701, 17, 16867, {1, 1, 5, 13, 31, 45, 115, 141, 449, 171, 1413, 2411, 7937, 10859, 19453, 64403, 45169}}, {7702, 17, 16876, {1, 3, 5, 7, 1, 27, 117, 157, 99, 119, 1281, 2633, 5117, 16009, 19545, 7421, 30807}}, {7703, 17, 16891, {1, 1, 3, 13, 19, 11, 61, 239, 331, 731, 1723, 1773, 2623, 15255, 17197, 63793, 100433}}, {7704, 17, 16894, {1, 3, 7, 11, 11, 7, 119, 33, 195, 521, 811, 2599, 3113, 5497, 16751, 2541, 21813}}, {7705, 17, 16898, {1, 1, 1, 15, 23, 47, 25, 73, 429, 213, 557, 1613, 7055, 7211, 2225, 1345, 58033}}, {7706, 17, 16907, {1, 1, 1, 13, 15, 39, 69, 71, 11, 543, 267, 2803, 4853, 9819, 603, 4629, 78343}}, {7707, 17, 16915, {1, 1, 7, 1, 15, 55, 47, 223, 63, 679, 1135, 3225, 3845, 12031, 6761, 20337, 29021}}, {7708, 17, 16917, {1, 1, 3, 3, 3, 51, 127, 103, 43, 379, 169, 2549, 7775, 2553, 27415, 30671, 34043}}, {7709, 17, 16922, {1, 1, 3, 11, 1, 31, 89, 113, 475, 857, 499, 3901, 5343, 8819, 4503, 58757, 60513}}, {7710, 17, 16924, {1, 3, 5, 11, 27, 49, 97, 217, 91, 971, 1835, 3447, 2021, 3747, 20533, 13659, 84007}}, {7711, 17, 16933, {1, 1, 5, 1, 31, 39, 49, 21, 135, 983, 579, 3509, 3611, 15101, 29781, 49941, 14353}}, {7712, 17, 16938, {1, 1, 1, 9, 7, 17, 55, 233, 295, 161, 823, 3823, 4771, 13531, 24197, 42629, 60269}}, {7713, 17, 16952, {1, 1, 3, 15, 23, 5, 101, 167, 55, 297, 1733, 3819, 7041, 9915, 27803, 60359, 10249}}, {7714, 17, 16960, {1, 1, 7, 9, 25, 47, 67, 253, 303, 313, 1389, 3785, 2729, 11471, 27267, 42783, 111595}}, {7715, 17, 16963, {1, 1, 5, 13, 25, 63, 17, 195, 457, 793, 1553, 1673, 6799, 12171, 9003, 22195, 90229}}, {7716, 17, 16969, {1, 1, 3, 15, 11, 43, 43, 221, 423, 985, 873, 599, 1753, 4875, 7149, 34625, 8941}}, {7717, 17, 16978, {1, 3, 5, 11, 1, 7, 109, 163, 309, 477, 1291, 3019, 1933, 14055, 15005, 1141, 66867}}, {7718, 17, 17014, {1, 3, 3, 15, 21, 35, 95, 131, 413, 1009, 147, 2165, 6333, 8313, 20873, 18377, 23579}}, {7719, 17, 17020, {1, 3, 1, 5, 21, 49, 29, 187, 67, 419, 253, 2345, 3179, 12331, 23127, 8799, 102493}}, {7720, 17, 17034, {1, 1, 7, 5, 29, 59, 13, 189, 377, 595, 1893, 527, 7993, 14867, 24671, 14585, 38645}}, {7721, 17, 17036, {1, 3, 5, 13, 3, 11, 99, 69, 253, 833, 1961, 2719, 3953, 8143, 21277, 16257, 26929}}, {7722, 17, 17042, {1, 3, 7, 3, 3, 19, 19, 57, 393, 187, 945, 2107, 669, 14785, 13895, 26907, 92439}}, {7723, 17, 17047, {1, 3, 5, 15, 11, 5, 73, 167, 99, 887, 1213, 2019, 3781, 14345, 30249, 16215, 1893}}, {7724, 17, 17051, {1, 1, 5, 1, 17, 11, 69, 145, 97, 393, 1587, 2513, 1011, 6933, 7945, 41387, 34361}}, {7725, 17, 17054, {1, 1, 5, 1, 5, 59, 57, 1, 501, 855, 1485, 977, 4981, 7631, 31853, 30737, 103023}}, {7726, 17, 17063, {1, 3, 1, 5, 3, 27, 55, 171, 317, 641, 1875, 2523, 1631, 4971, 18743, 25119, 118913}}, {7727, 17, 17069, {1, 1, 3, 15, 7, 39, 73, 209, 125, 29, 1031, 1569, 1793, 5461, 985, 59441, 92997}}, {7728, 17, 17075, {1, 3, 5, 11, 27, 23, 57, 13, 65, 555, 1309, 1149, 5125, 11573, 3835, 57913, 78699}}, {7729, 17, 17077, {1, 3, 7, 5, 29, 7, 51, 131, 443, 623, 1491, 1067, 6647, 6277, 25799, 54843, 90869}}, {7730, 17, 17089, {1, 1, 1, 11, 7, 33, 67, 113, 319, 665, 11, 1225, 3137, 16269, 20101, 40263, 31091}}, {7731, 17, 17090, {1, 3, 5, 15, 7, 5, 101, 153, 165, 173, 97, 1651, 6633, 6071, 29079, 35641, 77305}}, {7732, 17, 17107, {1, 3, 7, 13, 9, 45, 103, 55, 121, 1021, 1841, 315, 8127, 6547, 1093, 7181, 39575}}, {7733, 17, 17126, {1, 3, 3, 11, 15, 17, 27, 55, 341, 443, 377, 681, 3635, 1091, 16719, 49403, 85507}}, {7734, 17, 17135, {1, 3, 5, 5, 29, 53, 51, 213, 273, 475, 981, 549, 539, 14989, 4037, 23911, 45997}}, {7735, 17, 17150, {1, 3, 5, 3, 27, 37, 73, 115, 331, 911, 991, 4049, 6299, 3919, 10231, 31507, 98651}}, {7736, 17, 17162, {1, 1, 5, 13, 21, 13, 1, 175, 137, 837, 1067, 2845, 307, 4399, 15671, 1309, 107409}}, {7737, 17, 17169, {1, 1, 3, 1, 5, 47, 111, 75, 193, 389, 157, 3731, 6237, 5053, 9933, 28413, 32939}}, {7738, 17, 17172, {1, 1, 7, 5, 29, 1, 51, 85, 267, 935, 1021, 3135, 3135, 9263, 32597, 6779, 71473}}, {7739, 17, 17175, {1, 3, 5, 9, 21, 59, 27, 99, 155, 507, 1911, 3501, 4307, 6755, 17127, 29815, 1577}}, {7740, 17, 17176, {1, 1, 5, 1, 15, 63, 45, 105, 125, 299, 689, 3935, 7229, 5007, 25003, 30453, 27819}}, {7741, 17, 17191, {1, 1, 7, 15, 19, 9, 67, 151, 45, 985, 2015, 833, 5435, 15383, 25881, 46735, 56717}}, {7742, 17, 17209, {1, 1, 5, 15, 27, 59, 119, 163, 293, 63, 1251, 1309, 485, 4937, 27207, 47481, 114357}}, {7743, 17, 17218, {1, 3, 5, 13, 23, 11, 111, 87, 329, 467, 1657, 3309, 3421, 12013, 23163, 14105, 88761}}, {7744, 17, 17220, {1, 1, 5, 11, 17, 63, 9, 61, 299, 585, 341, 3375, 3213, 15953, 11455, 5333, 66889}}, {7745, 17, 17227, {1, 3, 5, 5, 5, 35, 57, 235, 137, 543, 77, 2811, 857, 12793, 10791, 55711, 93353}}, {7746, 17, 17229, {1, 3, 7, 3, 23, 37, 19, 81, 321, 23, 1625, 2359, 3569, 4685, 7385, 32677, 18073}}, {7747, 17, 17238, {1, 3, 3, 7, 21, 35, 81, 229, 207, 547, 1397, 2709, 7159, 1265, 16823, 9921, 29159}}, {7748, 17, 17251, {1, 3, 7, 13, 27, 13, 107, 241, 395, 317, 307, 3927, 1153, 15915, 25179, 25173, 21503}}, {7749, 17, 17257, {1, 3, 1, 5, 1, 51, 25, 135, 381, 229, 1491, 2009, 3331, 16165, 8169, 65161, 9335}}, {7750, 17, 17258, {1, 1, 5, 5, 17, 15, 57, 221, 183, 225, 1649, 3701, 299, 12349, 4691, 64479, 82237}}, {7751, 17, 17272, {1, 3, 7, 7, 31, 39, 65, 183, 149, 67, 1697, 3933, 3709, 15501, 12583, 60117, 88691}}, {7752, 17, 17277, {1, 1, 5, 15, 17, 49, 117, 233, 161, 891, 789, 1347, 4887, 10713, 10613, 4389, 42619}}, {7753, 17, 17308, {1, 3, 5, 9, 13, 3, 83, 69, 381, 777, 743, 2843, 7233, 3285, 8931, 48667, 120777}}, {7754, 17, 17311, {1, 3, 1, 3, 11, 7, 55, 107, 165, 533, 1897, 3385, 1069, 12805, 30125, 42729, 123977}}, {7755, 17, 17321, {1, 1, 1, 5, 13, 17, 103, 237, 77, 537, 1843, 2817, 7467, 13647, 15259, 3525, 18313}}, {7756, 17, 17329, {1, 1, 7, 7, 13, 59, 29, 197, 309, 917, 1173, 2605, 4313, 12007, 25611, 60409, 104931}}, {7757, 17, 17342, {1, 3, 3, 3, 27, 57, 7, 207, 491, 467, 1973, 3075, 8043, 3977, 14517, 13179, 47111}}, {7758, 17, 17344, {1, 1, 7, 5, 31, 33, 125, 235, 79, 847, 1893, 3875, 7513, 1435, 24959, 46813, 82053}}, {7759, 17, 17350, {1, 3, 7, 5, 3, 53, 103, 1, 215, 71, 787, 223, 1399, 6793, 11281, 39201, 122119}}, {7760, 17, 17356, {1, 3, 3, 3, 3, 57, 7, 151, 319, 463, 685, 2917, 4037, 14929, 11971, 41827, 57449}}, {7761, 17, 17371, {1, 1, 7, 3, 5, 11, 15, 139, 379, 563, 135, 65, 5633, 7535, 1451, 18289, 62457}}, {7762, 17, 17374, {1, 1, 1, 15, 11, 23, 37, 57, 205, 107, 995, 151, 3279, 2015, 28927, 40731, 95551}}, {7763, 17, 17392, {1, 3, 5, 9, 15, 43, 95, 217, 203, 215, 203, 2207, 8189, 465, 2175, 29285, 25375}}, {7764, 17, 17402, {1, 3, 3, 5, 19, 59, 51, 123, 285, 721, 1335, 1777, 1645, 15811, 16539, 14637, 123323}}, {7765, 17, 17410, {1, 3, 5, 5, 11, 35, 23, 23, 259, 789, 567, 1921, 4743, 6635, 6965, 43025, 43175}}, {7766, 17, 17421, {1, 3, 7, 3, 7, 27, 77, 121, 285, 65, 647, 591, 2553, 7163, 12057, 43675, 24227}}, {7767, 17, 17424, {1, 1, 5, 9, 3, 25, 17, 85, 235, 715, 1913, 2391, 3719, 11029, 18359, 6323, 4703}}, {7768, 17, 17427, {1, 1, 1, 3, 25, 31, 37, 31, 89, 311, 1797, 3409, 6785, 9627, 29721, 58591, 111429}}, {7769, 17, 17434, {1, 3, 1, 5, 9, 37, 47, 45, 419, 115, 1009, 1359, 65, 1161, 15673, 16075, 63895}}, {7770, 17, 17449, {1, 1, 3, 5, 25, 47, 27, 87, 441, 547, 1801, 3589, 3773, 12215, 14509, 12669, 99983}}, {7771, 17, 17452, {1, 1, 1, 3, 19, 33, 51, 91, 447, 577, 491, 539, 3177, 7033, 21633, 51737, 47089}}, {7772, 17, 17463, {1, 1, 3, 15, 23, 53, 93, 113, 143, 973, 999, 2355, 1489, 3451, 29821, 23769, 74633}}, {7773, 17, 17470, {1, 3, 7, 11, 27, 1, 35, 109, 111, 51, 425, 3203, 2585, 11255, 20939, 281, 92133}}, {7774, 17, 17477, {1, 1, 1, 11, 13, 37, 13, 149, 421, 655, 79, 3093, 6429, 1145, 27663, 52861, 81431}}, {7775, 17, 17482, {1, 1, 5, 13, 19, 23, 105, 39, 97, 239, 469, 1047, 4727, 12009, 8055, 45557, 124219}}, {7776, 17, 17490, {1, 1, 1, 7, 7, 7, 5, 53, 269, 391, 1893, 2263, 2109, 11531, 12109, 31437, 20445}}, {7777, 17, 17496, {1, 1, 3, 11, 9, 35, 69, 209, 93, 455, 1117, 3297, 2597, 15035, 17943, 19955, 829}}, {7778, 17, 17508, {1, 1, 5, 7, 23, 23, 101, 71, 339, 553, 1653, 2997, 1191, 3121, 4575, 49979, 17353}}, {7779, 17, 17511, {1, 3, 3, 13, 13, 9, 51, 181, 33, 185, 111, 589, 3117, 10105, 28811, 31529, 79657}}, {7780, 17, 17536, {1, 1, 5, 3, 9, 57, 103, 65, 211, 473, 519, 3815, 4087, 2767, 10213, 37829, 9523}}, {7781, 17, 17563, {1, 1, 5, 7, 7, 31, 81, 161, 311, 617, 1689, 3133, 57, 14595, 22783, 18475, 85811}}, {7782, 17, 17570, {1, 3, 5, 5, 21, 51, 99, 249, 7, 525, 885, 3981, 2851, 529, 947, 29885, 122901}}, {7783, 17, 17581, {1, 3, 1, 5, 1, 23, 85, 91, 309, 747, 183, 1347, 2399, 15777, 16205, 15687, 117333}}, {7784, 17, 17590, {1, 3, 7, 3, 29, 21, 99, 137, 297, 229, 1063, 2747, 6415, 7791, 4775, 62863, 50849}}, {7785, 17, 17608, {1, 3, 1, 3, 11, 3, 53, 153, 103, 911, 1595, 1899, 1049, 11643, 21105, 61587, 92399}}, {7786, 17, 17616, {1, 1, 5, 15, 29, 55, 99, 101, 181, 453, 1917, 2081, 4687, 4335, 2817, 11861, 103167}}, {7787, 17, 17621, {1, 3, 7, 15, 11, 7, 9, 3, 477, 281, 1141, 453, 4993, 7843, 6169, 49785, 53827}}, {7788, 17, 17628, {1, 3, 7, 11, 25, 61, 77, 159, 83, 95, 1223, 85, 6309, 16145, 18729, 133, 14193}}, {7789, 17, 17644, {1, 3, 3, 1, 7, 27, 97, 183, 263, 59, 915, 3857, 3349, 8123, 11251, 55163, 125703}}, {7790, 17, 17649, {1, 3, 5, 5, 17, 33, 57, 55, 503, 811, 953, 349, 1949, 9127, 31015, 14475, 116769}}, {7791, 17, 17652, {1, 3, 1, 1, 3, 53, 59, 131, 421, 971, 89, 3047, 3513, 13599, 4569, 54525, 54779}}, {7792, 17, 17679, {1, 1, 3, 11, 9, 45, 95, 123, 197, 257, 1073, 1461, 5, 12701, 12559, 34989, 71631}}, {7793, 17, 17691, {1, 3, 3, 7, 1, 27, 55, 191, 447, 561, 1975, 2665, 1341, 8969, 18519, 47389, 70847}}, {7794, 17, 17693, {1, 1, 5, 5, 3, 31, 15, 165, 95, 423, 233, 2309, 7777, 3503, 20105, 3085, 92349}}, {7795, 17, 17697, {1, 3, 1, 13, 23, 61, 7, 55, 157, 1, 83, 515, 2169, 14397, 18149, 56855, 117265}}, {7796, 17, 17698, {1, 3, 3, 3, 3, 59, 69, 95, 127, 241, 65, 3145, 491, 13809, 17529, 20223, 96579}}, {7797, 17, 17700, {1, 1, 1, 5, 13, 43, 117, 163, 305, 955, 2007, 3337, 807, 16019, 5721, 5479, 90937}}, {7798, 17, 17704, {1, 3, 3, 1, 19, 9, 127, 5, 113, 491, 1873, 2127, 7949, 5207, 32531, 775, 131065}}, {7799, 17, 17707, {1, 1, 7, 3, 1, 3, 91, 187, 37, 873, 1039, 4075, 5645, 243, 15127, 45615, 3813}}, {7800, 17, 17715, {1, 1, 3, 11, 3, 37, 67, 59, 439, 763, 213, 1099, 1659, 12783, 30297, 60713, 43497}}, {7801, 17, 17718, {1, 3, 3, 13, 23, 49, 47, 191, 245, 985, 487, 3165, 7803, 2437, 19073, 30605, 119641}}, {7802, 17, 17721, {1, 3, 7, 7, 19, 43, 7, 253, 93, 99, 145, 219, 699, 2433, 3009, 565, 99671}}, {7803, 17, 17722, {1, 1, 3, 13, 7, 5, 9, 23, 219, 155, 925, 3427, 6631, 16353, 4115, 20831, 49525}}, {7804, 17, 17727, {1, 1, 7, 11, 15, 45, 41, 35, 301, 273, 241, 4031, 5441, 8281, 9341, 8499, 73841}}, {7805, 17, 17729, {1, 3, 7, 13, 9, 19, 79, 3, 163, 197, 509, 2301, 6971, 11525, 8805, 33805, 111595}}, {7806, 17, 17747, {1, 3, 3, 1, 15, 45, 69, 253, 155, 639, 1045, 749, 3619, 14871, 18063, 49763, 66687}}, {7807, 17, 17754, {1, 3, 3, 3, 29, 5, 41, 171, 265, 677, 1719, 2623, 1721, 12243, 18741, 39595, 92873}}, {7808, 17, 17756, {1, 3, 5, 7, 27, 23, 69, 61, 453, 399, 1857, 3901, 6565, 15595, 1083, 15065, 91249}}, {7809, 17, 17760, {1, 1, 5, 7, 1, 27, 9, 145, 95, 983, 685, 2079, 5117, 5037, 22695, 53135, 43569}}, {7810, 17, 17765, {1, 1, 3, 5, 5, 7, 69, 59, 331, 409, 179, 333, 1293, 3863, 9473, 12537, 55605}}, {7811, 17, 17778, {1, 3, 5, 1, 1, 19, 1, 49, 317, 769, 91, 2073, 1765, 1197, 15029, 52553, 57361}}, {7812, 17, 17784, {1, 1, 5, 1, 23, 13, 11, 69, 345, 877, 41, 817, 617, 14415, 8337, 53973, 50007}}, {7813, 17, 17794, {1, 1, 7, 3, 19, 27, 69, 103, 115, 893, 219, 2891, 2813, 9933, 26401, 63323, 30909}}, {7814, 17, 17805, {1, 1, 5, 5, 27, 15, 119, 3, 11, 783, 541, 2431, 2395, 3921, 15471, 34657, 100295}}, {7815, 17, 17806, {1, 1, 7, 11, 15, 25, 39, 191, 345, 1001, 1773, 715, 1627, 15957, 30085, 34097, 58747}}, {7816, 17, 17817, {1, 1, 1, 5, 17, 43, 65, 81, 487, 387, 1359, 145, 2231, 6693, 15857, 59539, 79615}}, {7817, 17, 17824, {1, 1, 3, 5, 15, 19, 17, 233, 247, 611, 587, 2587, 2321, 2835, 1477, 41991, 88143}}, {7818, 17, 17839, {1, 3, 3, 15, 27, 15, 53, 61, 359, 989, 283, 3569, 5551, 11849, 20995, 34065, 69407}}, {7819, 17, 17842, {1, 3, 3, 11, 13, 31, 41, 87, 379, 47, 1289, 3143, 4213, 8643, 17065, 10707, 62773}}, {7820, 17, 17844, {1, 3, 7, 1, 9, 61, 59, 121, 453, 663, 27, 793, 4501, 7713, 285, 13279, 11633}}, {7821, 17, 17851, {1, 1, 7, 5, 29, 51, 57, 15, 233, 743, 879, 2317, 3399, 15741, 605, 57529, 87427}}, {7822, 17, 17862, {1, 1, 1, 1, 19, 59, 51, 119, 273, 403, 1649, 3877, 3561, 10931, 21139, 2599, 77957}}, {7823, 17, 17868, {1, 3, 1, 3, 5, 1, 79, 131, 251, 585, 359, 2073, 7041, 13611, 22937, 24645, 72827}}, {7824, 17, 17871, {1, 3, 7, 9, 19, 39, 93, 137, 359, 565, 1123, 1301, 4111, 13683, 1361, 25147, 38315}}, {7825, 17, 17873, {1, 1, 5, 13, 27, 31, 11, 243, 111, 243, 1615, 1649, 2999, 15873, 19161, 57485, 35819}}, {7826, 17, 17896, {1, 3, 3, 5, 25, 57, 61, 207, 219, 969, 303, 1165, 6753, 13473, 10789, 52883, 45205}}, {7827, 17, 17904, {1, 1, 7, 11, 9, 53, 55, 175, 399, 981, 255, 2499, 373, 13131, 26803, 48017, 25599}}, {7828, 17, 17909, {1, 1, 3, 3, 11, 23, 73, 25, 83, 39, 1813, 747, 3287, 795, 11917, 55509, 105057}}, {7829, 17, 17920, {1, 3, 7, 15, 29, 59, 47, 171, 219, 875, 71, 123, 8131, 15595, 12471, 62439, 131}}, {7830, 17, 17923, {1, 3, 5, 13, 9, 27, 119, 233, 323, 943, 375, 3647, 185, 1639, 431, 27225, 130175}}, {7831, 17, 17947, {1, 3, 7, 3, 7, 17, 31, 155, 89, 835, 1015, 2019, 3973, 7087, 16899, 29591, 40797}}, {7832, 17, 17950, {1, 3, 3, 1, 3, 11, 83, 231, 209, 537, 1227, 1519, 1059, 14027, 18591, 34031, 125755}}, {7833, 17, 17956, {1, 3, 3, 1, 7, 39, 19, 99, 169, 961, 385, 1621, 7373, 7459, 8979, 23643, 17101}}, {7834, 17, 17959, {1, 1, 3, 11, 11, 23, 61, 37, 359, 981, 209, 2555, 2673, 6501, 12731, 10735, 97321}}, {7835, 17, 17966, {1, 1, 3, 13, 15, 61, 115, 119, 99, 755, 1933, 345, 3133, 12071, 26657, 7133, 18553}}, {7836, 17, 17971, {1, 3, 1, 5, 17, 7, 29, 119, 445, 911, 89, 19, 6137, 8037, 19527, 22467, 29253}}, {7837, 17, 17973, {1, 1, 3, 11, 31, 21, 119, 21, 249, 371, 343, 4037, 7539, 14473, 23829, 46415, 60911}}, {7838, 17, 17992, {1, 1, 7, 9, 21, 53, 29, 149, 467, 893, 479, 359, 1007, 13955, 9667, 10245, 74761}}, {7839, 17, 18006, {1, 3, 1, 7, 7, 45, 7, 77, 289, 271, 1329, 261, 5675, 8275, 7443, 57945, 117825}}, {7840, 17, 18009, {1, 1, 1, 3, 21, 57, 117, 77, 287, 119, 1073, 915, 2521, 455, 7433, 56953, 84433}}, {7841, 17, 18010, {1, 1, 1, 9, 27, 47, 1, 189, 303, 375, 215, 3117, 4541, 12877, 15523, 32317, 104213}}, {7842, 17, 18022, {1, 1, 3, 1, 13, 39, 37, 249, 371, 159, 1073, 1351, 4703, 2715, 17463, 3945, 51523}}, {7843, 17, 18039, {1, 3, 5, 5, 29, 15, 79, 25, 61, 995, 1081, 3377, 345, 13773, 4205, 20589, 83591}}, {7844, 17, 18046, {1, 1, 3, 1, 9, 1, 41, 39, 389, 509, 561, 3273, 1911, 15271, 22655, 34713, 2045}}, {7845, 17, 18069, {1, 3, 1, 15, 17, 1, 55, 55, 119, 707, 843, 2657, 3687, 11557, 18331, 4935, 110639}}, {7846, 17, 18074, {1, 3, 5, 1, 23, 35, 119, 215, 471, 643, 1581, 1965, 2627, 2991, 3361, 6737, 111657}}, {7847, 17, 18076, {1, 3, 5, 7, 9, 19, 33, 197, 33, 993, 1795, 595, 7113, 14721, 12647, 41035, 13669}}, {7848, 17, 18085, {1, 1, 7, 15, 31, 39, 51, 157, 373, 473, 665, 3541, 6695, 11741, 5617, 17189, 129851}}, {7849, 17, 18086, {1, 3, 3, 7, 15, 37, 33, 175, 391, 159, 717, 593, 113, 9331, 10685, 59003, 26975}}, {7850, 17, 18095, {1, 1, 3, 5, 13, 41, 11, 109, 9, 899, 1503, 901, 6237, 7789, 9963, 14923, 63665}}, {7851, 17, 18100, {1, 3, 7, 7, 25, 61, 3, 231, 235, 29, 1049, 1997, 5371, 9047, 29595, 49239, 108649}}, {7852, 17, 18109, {1, 1, 3, 5, 27, 1, 53, 209, 315, 747, 1803, 11, 1815, 6539, 8839, 18385, 88681}}, {7853, 17, 18121, {1, 1, 5, 13, 25, 55, 117, 197, 13, 689, 751, 1203, 2277, 1763, 23453, 54459, 118023}}, {7854, 17, 18127, {1, 3, 3, 11, 21, 1, 51, 101, 429, 723, 273, 3021, 1491, 9923, 6629, 63741, 98813}}, {7855, 17, 18129, {1, 1, 1, 15, 17, 25, 111, 251, 43, 403, 465, 17, 787, 6045, 32185, 22921, 115851}}, {7856, 17, 18132, {1, 1, 5, 11, 11, 13, 13, 93, 489, 941, 1391, 383, 7735, 1921, 16199, 53099, 25181}}, {7857, 17, 18141, {1, 3, 3, 7, 15, 1, 3, 159, 507, 867, 1589, 2111, 3839, 8989, 12589, 37657, 97055}}, {7858, 17, 18146, {1, 3, 3, 13, 25, 23, 7, 95, 489, 1001, 105, 2737, 5013, 14465, 25383, 57551, 77425}}, {7859, 17, 18151, {1, 3, 5, 3, 3, 7, 81, 15, 255, 297, 1183, 655, 741, 3081, 2141, 34493, 103707}}, {7860, 17, 18157, {1, 1, 7, 9, 27, 57, 49, 121, 21, 239, 829, 2001, 613, 9569, 4419, 20007, 59109}}, {7861, 17, 18160, {1, 3, 7, 1, 3, 21, 109, 255, 45, 333, 915, 1245, 5893, 765, 28289, 53927, 15335}}, {7862, 17, 18183, {1, 3, 3, 7, 5, 35, 33, 79, 111, 509, 347, 3915, 2017, 6461, 11847, 17807, 48601}}, {7863, 17, 18204, {1, 3, 5, 1, 13, 63, 87, 65, 507, 277, 339, 3637, 6289, 719, 9383, 38887, 55061}}, {7864, 17, 18218, {1, 1, 5, 15, 17, 5, 59, 107, 355, 1021, 1849, 1807, 7679, 305, 31533, 1221, 98165}}, {7865, 17, 18226, {1, 1, 1, 13, 19, 7, 37, 63, 267, 399, 1451, 2149, 1003, 13635, 18693, 215, 15887}}, {7866, 17, 18238, {1, 1, 3, 7, 11, 63, 81, 251, 253, 963, 635, 1697, 6393, 9775, 24189, 9099, 106277}}, {7867, 17, 18245, {1, 3, 3, 13, 17, 47, 63, 47, 279, 879, 271, 1655, 1897, 10743, 2607, 16695, 32779}}, {7868, 17, 18249, {1, 3, 5, 15, 3, 1, 121, 181, 303, 973, 19, 3327, 3827, 2197, 31857, 22835, 122611}}, {7869, 17, 18260, {1, 1, 5, 13, 25, 41, 105, 197, 195, 85, 1515, 2735, 7539, 7557, 24297, 38721, 46895}}, {7870, 17, 18267, {1, 1, 1, 1, 15, 63, 33, 7, 43, 971, 781, 1461, 4483, 2113, 32459, 37653, 68017}}, {7871, 17, 18270, {1, 3, 3, 9, 7, 1, 65, 183, 171, 695, 191, 3675, 6749, 6823, 3577, 45031, 81597}}, {7872, 17, 18273, {1, 3, 3, 3, 9, 61, 13, 159, 295, 329, 943, 3293, 79, 14497, 21461, 4667, 96435}}, {7873, 17, 18274, {1, 1, 7, 9, 29, 37, 117, 215, 295, 591, 1139, 3093, 7469, 7995, 13581, 48075, 5943}}, {7874, 17, 18276, {1, 3, 1, 9, 11, 11, 117, 255, 419, 551, 1445, 1987, 1169, 14227, 31095, 36041, 63739}}, {7875, 17, 18283, {1, 1, 7, 15, 17, 25, 81, 27, 87, 463, 1871, 551, 7449, 12231, 28645, 32663, 43037}}, {7876, 17, 18307, {1, 3, 5, 11, 3, 49, 109, 123, 397, 113, 1269, 2433, 4463, 1257, 2127, 6677, 96009}}, {7877, 17, 18314, {1, 1, 1, 11, 27, 19, 83, 123, 297, 867, 941, 3929, 3483, 4641, 32505, 48999, 66169}}, {7878, 17, 18321, {1, 1, 5, 11, 5, 21, 11, 255, 369, 859, 657, 587, 5245, 12973, 22403, 47935, 121375}}, {7879, 17, 18334, {1, 3, 1, 13, 17, 43, 83, 51, 339, 967, 499, 1485, 5203, 10053, 31707, 31443, 75033}}, {7880, 17, 18355, {1, 1, 5, 13, 11, 5, 121, 121, 73, 101, 1751, 3805, 1333, 14043, 26957, 27557, 110899}}, {7881, 17, 18364, {1, 3, 7, 11, 9, 7, 125, 237, 437, 177, 841, 175, 5509, 9157, 3129, 54119, 109315}}, {7882, 17, 18372, {1, 3, 7, 15, 1, 59, 87, 121, 43, 475, 1589, 1267, 1501, 1585, 31705, 33959, 27247}}, {7883, 17, 18390, {1, 1, 5, 3, 27, 63, 117, 205, 169, 701, 1081, 2835, 8049, 11875, 4143, 17663, 90043}}, {7884, 17, 18399, {1, 3, 1, 9, 23, 27, 31, 141, 411, 145, 1177, 3681, 3403, 6943, 10729, 47219, 102713}}, {7885, 17, 18415, {1, 1, 7, 11, 5, 49, 33, 27, 121, 865, 471, 1871, 6945, 10051, 4493, 7121, 65551}}, {7886, 17, 18420, {1, 1, 5, 1, 17, 27, 53, 13, 31, 403, 1319, 1381, 1371, 11693, 18805, 54683, 30137}}, {7887, 17, 18434, {1, 1, 7, 11, 9, 21, 71, 155, 79, 145, 943, 3891, 641, 3163, 28493, 14729, 83391}}, {7888, 17, 18443, {1, 3, 3, 13, 3, 53, 21, 189, 245, 803, 1625, 4005, 1163, 16033, 5549, 14301, 115859}}, {7889, 17, 18446, {1, 3, 1, 5, 17, 59, 61, 31, 293, 677, 1753, 1803, 1671, 14619, 22361, 61453, 78203}}, {7890, 17, 18460, {1, 3, 3, 1, 5, 51, 99, 231, 175, 97, 1335, 689, 1913, 6157, 22757, 52395, 118347}}, {7891, 17, 18467, {1, 3, 3, 7, 25, 11, 113, 19, 289, 507, 1143, 3437, 7965, 12551, 27603, 8423, 46713}}, {7892, 17, 18482, {1, 1, 3, 9, 13, 1, 73, 9, 425, 407, 363, 2915, 4269, 2903, 9251, 17733, 80321}}, {7893, 17, 18484, {1, 1, 3, 11, 31, 47, 37, 211, 433, 237, 1069, 1891, 6175, 9305, 30385, 2497, 94775}}, {7894, 17, 18501, {1, 1, 3, 1, 23, 5, 113, 103, 427, 587, 1863, 1863, 679, 2575, 13059, 16163, 42289}}, {7895, 17, 18506, {1, 1, 5, 3, 7, 17, 45, 33, 209, 609, 1897, 95, 5123, 2239, 5483, 60715, 126497}}, {7896, 17, 18516, {1, 1, 5, 11, 1, 55, 67, 223, 41, 967, 337, 2511, 7879, 1157, 17635, 64081, 421}}, {7897, 17, 18519, {1, 3, 3, 9, 27, 33, 87, 97, 231, 895, 1337, 829, 47, 8481, 14059, 57209, 109159}}, {7898, 17, 18547, {1, 3, 7, 1, 25, 5, 41, 161, 393, 523, 1623, 3761, 1933, 8319, 17309, 46717, 97299}}, {7899, 17, 18569, {1, 1, 1, 11, 5, 55, 19, 191, 41, 791, 1611, 59, 2633, 13873, 25859, 42879, 54807}}, {7900, 17, 18575, {1, 3, 1, 11, 11, 33, 5, 13, 199, 411, 895, 759, 2735, 16225, 31469, 24081, 31857}}, {7901, 17, 18589, {1, 1, 7, 13, 27, 57, 21, 191, 389, 977, 1013, 3493, 6401, 15957, 23181, 52461, 41853}}, {7902, 17, 18590, {1, 3, 7, 5, 23, 19, 117, 117, 427, 923, 1347, 3099, 247, 8879, 5309, 53277, 100625}}, {7903, 17, 18605, {1, 1, 5, 13, 11, 23, 69, 37, 119, 329, 1935, 2851, 5127, 6907, 24651, 11135, 118287}}, {7904, 17, 18611, {1, 1, 3, 15, 23, 1, 69, 107, 253, 771, 1697, 4035, 3219, 15011, 6995, 19255, 39909}}, {7905, 17, 18625, {1, 3, 1, 1, 5, 21, 35, 173, 407, 603, 27, 3589, 2879, 2755, 17679, 6145, 95989}}, {7906, 17, 18652, {1, 1, 5, 13, 31, 23, 61, 139, 341, 593, 1673, 4031, 4809, 1107, 22657, 29073, 53401}}, {7907, 17, 18665, {1, 3, 1, 15, 13, 37, 39, 61, 443, 417, 1125, 1529, 1943, 7317, 2985, 50285, 107069}}, {7908, 17, 18673, {1, 1, 3, 9, 5, 51, 87, 91, 31, 491, 1455, 1685, 2579, 6023, 10989, 64635, 130147}}, {7909, 17, 18674, {1, 3, 5, 5, 31, 23, 15, 163, 357, 161, 1597, 1571, 5039, 13213, 32221, 4405, 88079}}, {7910, 17, 18683, {1, 1, 1, 15, 13, 43, 7, 109, 243, 389, 683, 2671, 8003, 4187, 6507, 11171, 116727}}, {7911, 17, 18688, {1, 3, 7, 1, 17, 31, 53, 5, 227, 755, 1755, 2939, 1789, 8951, 16777, 30203, 79005}}, {7912, 17, 18691, {1, 3, 3, 9, 27, 5, 111, 241, 89, 333, 371, 1035, 5719, 2433, 29343, 50829, 25131}}, {7913, 17, 18698, {1, 1, 3, 13, 7, 37, 125, 69, 79, 397, 1595, 123, 255, 2257, 10881, 27085, 99411}}, {7914, 17, 18717, {1, 1, 3, 15, 1, 35, 61, 73, 507, 775, 1631, 2005, 4277, 8421, 5669, 39221, 19053}}, {7915, 17, 18733, {1, 1, 3, 7, 15, 17, 65, 157, 19, 997, 861, 1249, 4059, 7975, 955, 5833, 97733}}, {7916, 17, 18754, {1, 1, 5, 5, 21, 43, 1, 181, 1, 17, 1337, 3333, 3761, 12283, 20941, 231, 30457}}, {7917, 17, 18759, {1, 3, 3, 7, 7, 23, 105, 101, 101, 757, 1407, 565, 2187, 1529, 29385, 22847, 57675}}, {7918, 17, 18760, {1, 3, 3, 1, 11, 3, 65, 93, 201, 773, 1037, 1325, 673, 6625, 2909, 63435, 114311}}, {7919, 17, 18771, {1, 3, 5, 1, 21, 43, 87, 37, 491, 323, 1093, 2493, 4755, 7225, 12037, 9483, 70351}}, {7920, 17, 18777, {1, 1, 7, 9, 23, 39, 59, 117, 103, 645, 1975, 1177, 55, 325, 23781, 64365, 94915}}, {7921, 17, 18796, {1, 3, 7, 15, 21, 29, 109, 35, 307, 847, 777, 3457, 7899, 17, 24065, 10517, 35651}}, {7922, 17, 18799, {1, 1, 7, 9, 25, 35, 49, 131, 377, 429, 1773, 2107, 6305, 15209, 9567, 17685, 5599}}, {7923, 17, 18807, {1, 1, 3, 11, 13, 27, 47, 125, 483, 229, 921, 2733, 2217, 2615, 24135, 28759, 109411}}, {7924, 17, 18813, {1, 3, 1, 7, 19, 45, 23, 195, 445, 955, 853, 2877, 6889, 9507, 2009, 18747, 50545}}, {7925, 17, 18817, {1, 1, 1, 5, 15, 35, 75, 177, 145, 683, 309, 893, 4999, 827, 26563, 30819, 111115}}, {7926, 17, 18820, {1, 3, 3, 11, 5, 45, 49, 39, 93, 653, 1053, 2553, 863, 12185, 30261, 16459, 121061}}, {7927, 17, 18827, {1, 3, 7, 5, 11, 29, 57, 43, 409, 71, 67, 3537, 263, 13237, 8825, 58411, 44629}}, {7928, 17, 18829, {1, 1, 5, 13, 1, 37, 23, 171, 13, 309, 239, 2023, 6233, 8751, 11371, 5825, 77355}}, {7929, 17, 18838, {1, 3, 1, 13, 5, 1, 47, 217, 369, 609, 453, 879, 4337, 4441, 8785, 51963, 53819}}, {7930, 17, 18842, {1, 3, 5, 5, 23, 1, 67, 147, 27, 121, 1369, 569, 1519, 11585, 18193, 30889, 78055}}, {7931, 17, 18848, {1, 1, 1, 13, 11, 53, 33, 37, 419, 111, 1649, 2495, 6105, 12385, 30865, 3683, 63813}}, {7932, 17, 18853, {1, 3, 3, 5, 17, 35, 107, 235, 471, 735, 1093, 1007, 567, 173, 9623, 39533, 56455}}, {7933, 17, 18885, {1, 1, 7, 15, 27, 13, 123, 211, 407, 857, 801, 3951, 8153, 4427, 15333, 13217, 92675}}, {7934, 17, 18890, {1, 1, 1, 7, 11, 61, 99, 131, 121, 119, 1483, 1485, 3521, 13163, 24899, 56849, 111943}}, {7935, 17, 18898, {1, 3, 3, 1, 19, 1, 29, 139, 127, 557, 1913, 1487, 1381, 185, 11195, 52499, 45059}}, {7936, 17, 18903, {1, 3, 7, 11, 5, 29, 95, 111, 235, 55, 1101, 2631, 1219, 9867, 22209, 3095, 56793}}, {7937, 17, 18910, {1, 3, 7, 1, 31, 61, 37, 125, 241, 985, 1079, 1439, 433, 2779, 8463, 59985, 39667}}, {7938, 17, 18913, {1, 3, 7, 15, 5, 7, 71, 7, 435, 727, 1611, 135, 1421, 8329, 29995, 64243, 58285}}, {7939, 17, 18931, {1, 3, 3, 15, 27, 11, 121, 27, 281, 499, 267, 2651, 7575, 9499, 5051, 49475, 79573}}, {7940, 17, 18934, {1, 3, 3, 15, 29, 47, 11, 183, 235, 537, 79, 2467, 3751, 831, 6725, 52173, 108645}}, {7941, 17, 18956, {1, 3, 5, 13, 23, 31, 23, 19, 477, 511, 727, 183, 5955, 7613, 31979, 8441, 39835}}, {7942, 17, 18961, {1, 1, 5, 7, 17, 31, 53, 133, 387, 787, 1573, 89, 1975, 1825, 19963, 27203, 124923}}, {7943, 17, 18968, {1, 1, 1, 9, 3, 15, 125, 135, 89, 37, 517, 3931, 2013, 2143, 25413, 18421, 6097}}, {7944, 17, 18978, {1, 1, 3, 11, 23, 29, 89, 45, 53, 135, 223, 3523, 7921, 3271, 1819, 40931, 65471}}, {7945, 17, 18983, {1, 1, 1, 13, 17, 3, 121, 25, 509, 61, 1009, 2009, 7813, 8499, 5807, 63171, 75991}}, {7946, 17, 18987, {1, 3, 5, 13, 15, 35, 37, 45, 161, 683, 1665, 59, 6297, 9595, 10193, 46745, 105411}}, {7947, 17, 18992, {1, 3, 1, 7, 21, 19, 85, 107, 3, 845, 673, 1271, 7581, 15971, 27085, 35375, 29027}}, {7948, 17, 18997, {1, 3, 3, 9, 5, 17, 79, 137, 123, 809, 583, 3507, 7559, 2857, 13911, 57083, 8595}}, {7949, 17, 19002, {1, 1, 7, 5, 31, 29, 77, 33, 439, 787, 1223, 2471, 5851, 15891, 27925, 51661, 82645}}, {7950, 17, 19004, {1, 1, 7, 15, 19, 35, 35, 37, 197, 245, 799, 3971, 277, 11289, 20111, 13857, 104571}}, {7951, 17, 19010, {1, 3, 5, 15, 19, 3, 65, 17, 201, 1007, 1665, 107, 2409, 1469, 23265, 24547, 8189}}, {7952, 17, 19012, {1, 3, 1, 13, 29, 45, 109, 243, 43, 383, 631, 265, 6671, 15333, 21931, 30675, 103077}}, {7953, 17, 19030, {1, 1, 5, 1, 25, 25, 77, 189, 109, 777, 1485, 2265, 1403, 2627, 13843, 27263, 14263}}, {7954, 17, 19043, {1, 3, 5, 1, 13, 49, 73, 107, 225, 243, 1253, 3503, 735, 2605, 27165, 45467, 93001}}, {7955, 17, 19049, {1, 1, 5, 9, 15, 17, 1, 33, 69, 321, 1375, 3635, 8131, 6579, 1225, 38699, 17447}}, {7956, 17, 19079, {1, 3, 5, 3, 25, 49, 15, 149, 483, 37, 1929, 1219, 5841, 11975, 805, 31339, 130971}}, {7957, 17, 19086, {1, 3, 3, 3, 15, 29, 3, 143, 291, 593, 1769, 3603, 1693, 151, 27701, 9015, 25847}}, {7958, 17, 19100, {1, 3, 1, 11, 5, 35, 55, 127, 137, 71, 967, 2501, 1023, 2061, 31387, 44011, 130121}}, {7959, 17, 19103, {1, 1, 7, 1, 29, 13, 93, 41, 125, 263, 521, 2633, 4361, 12153, 30647, 55883, 65185}}, {7960, 17, 19107, {1, 3, 7, 9, 23, 19, 61, 197, 139, 463, 1867, 3627, 5185, 8251, 26977, 48027, 66301}}, {7961, 17, 19109, {1, 3, 3, 7, 27, 53, 25, 137, 175, 155, 1843, 2253, 4797, 4989, 32613, 55779, 91625}}, {7962, 17, 19113, {1, 3, 3, 11, 1, 5, 21, 233, 295, 675, 47, 2995, 8075, 8201, 3845, 23925, 82559}}, {7963, 17, 19116, {1, 1, 3, 7, 31, 53, 93, 21, 307, 709, 9, 3061, 3935, 11009, 13411, 3657, 30251}}, {7964, 17, 19127, {1, 3, 7, 13, 13, 25, 51, 205, 391, 897, 275, 333, 6831, 9383, 16101, 14301, 99101}}, {7965, 17, 19134, {1, 1, 5, 15, 17, 47, 119, 7, 189, 765, 753, 2909, 3373, 2379, 20331, 61535, 51345}}, {7966, 17, 19141, {1, 1, 3, 1, 27, 43, 9, 185, 9, 197, 1179, 67, 7689, 9679, 29683, 29905, 29393}}, {7967, 17, 19179, {1, 1, 5, 5, 31, 55, 69, 9, 477, 91, 1705, 1877, 5463, 15401, 13449, 27541, 125521}}, {7968, 17, 19193, {1, 1, 7, 15, 15, 33, 11, 233, 69, 771, 845, 2715, 5293, 10351, 19557, 15319, 36857}}, {7969, 17, 19194, {1, 3, 7, 7, 15, 9, 123, 47, 165, 739, 361, 1675, 2743, 8021, 10241, 48275, 51935}}, {7970, 17, 19201, {1, 1, 5, 1, 9, 25, 99, 83, 487, 627, 343, 3233, 6697, 13197, 19771, 38337, 89139}}, {7971, 17, 19208, {1, 3, 7, 13, 1, 31, 15, 63, 463, 621, 935, 1093, 6043, 14051, 13665, 43413, 104893}}, {7972, 17, 19214, {1, 1, 1, 3, 27, 1, 47, 151, 127, 357, 689, 3263, 141, 4459, 9847, 205, 88493}}, {7973, 17, 19225, {1, 3, 7, 15, 29, 13, 41, 113, 495, 421, 195, 197, 6857, 10555, 22861, 30229, 31707}}, {7974, 17, 19226, {1, 3, 5, 11, 11, 1, 89, 227, 425, 623, 1605, 1901, 7933, 7211, 16301, 3403, 59651}}, {7975, 17, 19235, {1, 1, 3, 3, 27, 41, 37, 89, 395, 903, 1641, 2739, 5599, 11371, 8683, 61125, 105231}}, {7976, 17, 19242, {1, 3, 7, 9, 1, 17, 51, 233, 507, 783, 459, 1187, 7281, 15809, 27637, 6067, 125877}}, {7977, 17, 19264, {1, 3, 1, 3, 13, 57, 5, 199, 261, 357, 1255, 1849, 8013, 10313, 9375, 1271, 64117}}, {7978, 17, 19267, {1, 3, 1, 11, 9, 59, 55, 95, 401, 423, 1657, 513, 3565, 12957, 19243, 53027, 11323}}, {7979, 17, 19293, {1, 3, 7, 13, 27, 35, 121, 215, 397, 991, 191, 3443, 3829, 6107, 5381, 48497, 107997}}, {7980, 17, 19309, {1, 1, 5, 5, 19, 15, 21, 53, 165, 835, 1599, 3245, 5609, 5991, 18141, 28075, 102809}}, {7981, 17, 19318, {1, 3, 5, 9, 25, 21, 71, 15, 453, 475, 915, 3097, 5869, 699, 13883, 34919, 127211}}, {7982, 17, 19324, {1, 1, 3, 7, 21, 53, 27, 207, 373, 703, 593, 17, 6991, 15013, 10125, 34801, 129245}}, {7983, 17, 19337, {1, 3, 3, 13, 17, 9, 89, 95, 291, 681, 1415, 2323, 2885, 11381, 7703, 3691, 51505}}, {7984, 17, 19340, {1, 1, 1, 11, 15, 63, 55, 153, 373, 665, 983, 3987, 5997, 6873, 27031, 65449, 22021}}, {7985, 17, 19345, {1, 1, 5, 5, 1, 55, 119, 61, 159, 889, 225, 709, 1879, 2521, 69, 7815, 18733}}, {7986, 17, 19346, {1, 3, 5, 11, 23, 53, 23, 61, 71, 993, 633, 1829, 3465, 12465, 30205, 40723, 74499}}, {7987, 17, 19352, {1, 3, 3, 1, 17, 37, 19, 43, 55, 133, 1171, 3101, 3963, 5177, 24791, 7255, 10263}}, {7988, 17, 19364, {1, 3, 7, 1, 21, 13, 21, 87, 237, 629, 1167, 3699, 597, 6251, 11545, 34429, 104393}}, {7989, 17, 19382, {1, 1, 7, 1, 11, 53, 105, 111, 463, 869, 549, 2423, 17, 917, 879, 49367, 72235}}, {7990, 17, 19391, {1, 1, 5, 15, 17, 51, 69, 55, 309, 867, 257, 573, 4821, 5245, 28033, 61801, 18253}}, {7991, 17, 19405, {1, 1, 5, 3, 1, 23, 103, 241, 13, 267, 21, 1751, 6637, 12537, 26741, 40651, 94493}}, {7992, 17, 19411, {1, 3, 3, 13, 25, 35, 21, 83, 337, 363, 1111, 1865, 7889, 985, 465, 40287, 64469}}, {7993, 17, 19439, {1, 1, 7, 5, 27, 1, 99, 95, 209, 211, 1445, 1577, 6097, 13813, 22463, 64395, 106383}}, {7994, 17, 19442, {1, 3, 1, 15, 1, 45, 77, 247, 273, 1023, 1377, 1989, 5787, 15267, 24363, 42717, 125617}}, {7995, 17, 19444, {1, 1, 1, 3, 9, 49, 79, 171, 427, 439, 1725, 3179, 6263, 12437, 31353, 22077, 94455}}, {7996, 17, 19451, {1, 3, 5, 11, 11, 45, 57, 97, 409, 935, 967, 2509, 3431, 5707, 19473, 15853, 129059}}, {7997, 17, 19465, {1, 1, 7, 5, 7, 21, 105, 29, 359, 145, 1691, 131, 6721, 10971, 16173, 38193, 37091}}, {7998, 17, 19471, {1, 1, 1, 15, 15, 35, 5, 185, 455, 507, 681, 3355, 2091, 3437, 27231, 28527, 5383}}, {7999, 17, 19474, {1, 3, 5, 3, 7, 29, 33, 127, 57, 495, 1069, 3635, 7461, 9861, 18757, 39039, 92421}}, {8000, 17, 19476, {1, 3, 5, 5, 11, 31, 51, 59, 413, 417, 1577, 2837, 5229, 4501, 18645, 37613, 31325}}, {8001, 17, 19479, {1, 1, 5, 13, 15, 61, 17, 247, 413, 817, 907, 2249, 3901, 11275, 7469, 33403, 30629}}, {8002, 17, 19485, {1, 3, 5, 7, 31, 7, 109, 177, 277, 75, 449, 3029, 7135, 427, 26641, 43157, 47671}}, {8003, 17, 19489, {1, 3, 7, 13, 29, 63, 21, 187, 471, 289, 835, 3885, 6111, 8721, 9841, 24017, 18673}}, {8004, 17, 19496, {1, 1, 5, 13, 25, 37, 15, 35, 227, 623, 47, 189, 3443, 1911, 8579, 50911, 10895}}, {8005, 17, 19507, {1, 3, 1, 1, 29, 53, 89, 101, 251, 203, 821, 2485, 633, 7943, 27563, 58735, 72057}}, {8006, 17, 19513, {1, 3, 7, 9, 23, 61, 121, 199, 19, 165, 131, 1373, 637, 7307, 7109, 42475, 126669}}, {8007, 17, 19514, {1, 3, 7, 13, 7, 5, 125, 173, 365, 65, 565, 751, 3343, 13421, 6177, 39095, 97375}}, {8008, 17, 19521, {1, 1, 7, 3, 1, 59, 65, 39, 307, 793, 887, 3291, 3405, 4497, 19351, 1821, 67861}}, {8009, 17, 19524, {1, 1, 1, 3, 19, 9, 101, 183, 163, 819, 769, 49, 5293, 3715, 4055, 32403, 90763}}, {8010, 17, 19546, {1, 3, 3, 1, 27, 31, 21, 123, 457, 1021, 1791, 2217, 6171, 11445, 15605, 59945, 19663}}, {8011, 17, 19552, {1, 1, 1, 9, 13, 53, 61, 201, 457, 111, 1217, 377, 5871, 4591, 16379, 42817, 129807}}, {8012, 17, 19555, {1, 3, 1, 5, 23, 37, 25, 7, 125, 651, 349, 3727, 1487, 5103, 31407, 40215, 16065}}, {8013, 17, 19557, {1, 1, 3, 11, 19, 29, 1, 193, 13, 287, 331, 985, 5391, 7307, 28075, 9939, 84999}}, {8014, 17, 19575, {1, 1, 1, 11, 21, 37, 117, 241, 229, 957, 2019, 819, 459, 6185, 21533, 64725, 24709}}, {8015, 17, 19579, {1, 3, 5, 13, 11, 25, 107, 245, 175, 519, 629, 537, 2227, 15123, 10619, 32611, 118697}}, {8016, 17, 19591, {1, 3, 1, 11, 5, 53, 119, 253, 489, 181, 1365, 3465, 1323, 949, 3657, 2467, 38545}}, {8017, 17, 19595, {1, 1, 3, 9, 27, 17, 109, 19, 297, 541, 89, 3021, 761, 5577, 907, 21405, 128029}}, {8018, 17, 19605, {1, 1, 3, 9, 31, 9, 61, 149, 267, 707, 671, 2733, 1247, 14623, 6395, 42579, 30845}}, {8019, 17, 19615, {1, 1, 7, 7, 25, 29, 63, 41, 309, 275, 2019, 1373, 1003, 13891, 16571, 16209, 30115}}, {8020, 17, 19616, {1, 3, 7, 1, 5, 21, 53, 97, 475, 799, 1963, 1181, 4187, 8767, 24779, 10403, 98349}}, {8021, 17, 19626, {1, 3, 3, 13, 19, 9, 125, 227, 347, 535, 353, 3087, 769, 9049, 20145, 27433, 23105}}, {8022, 17, 19631, {1, 1, 1, 15, 7, 61, 51, 113, 403, 501, 1767, 2785, 7151, 14517, 17533, 24913, 7121}}, {8023, 17, 19634, {1, 1, 1, 9, 7, 21, 27, 169, 425, 567, 31, 35, 7859, 929, 6545, 33983, 13227}}, {8024, 17, 19640, {1, 1, 5, 15, 11, 15, 69, 33, 127, 1005, 1947, 989, 6333, 15587, 18523, 53547, 115613}}, {8025, 17, 19645, {1, 3, 5, 3, 1, 55, 7, 99, 213, 737, 363, 3167, 3949, 3723, 15777, 23207, 22901}}, {8026, 17, 19678, {1, 1, 1, 9, 9, 29, 121, 85, 467, 811, 1, 3543, 6259, 4477, 31371, 27633, 22995}}, {8027, 17, 19681, {1, 3, 5, 3, 11, 21, 95, 19, 55, 71, 803, 3655, 3749, 5113, 13611, 38097, 20943}}, {8028, 17, 19682, {1, 3, 3, 11, 19, 25, 127, 105, 447, 499, 485, 881, 2649, 10297, 22283, 18305, 128919}}, {8029, 17, 19706, {1, 3, 7, 1, 11, 45, 21, 87, 481, 645, 815, 793, 5763, 3945, 14379, 19623, 103199}}, {8030, 17, 19708, {1, 3, 5, 1, 3, 45, 39, 229, 359, 151, 1079, 3955, 2107, 9593, 6701, 2811, 55215}}, {8031, 17, 19713, {1, 3, 7, 7, 27, 59, 69, 211, 373, 643, 977, 3545, 2647, 10473, 27919, 10719, 24823}}, {8032, 17, 19714, {1, 1, 3, 11, 7, 27, 117, 21, 59, 679, 969, 3813, 2701, 7363, 17525, 31229, 100665}}, {8033, 17, 19720, {1, 3, 3, 5, 29, 53, 113, 141, 197, 991, 81, 2701, 6831, 7949, 16569, 44185, 29631}}, {8034, 17, 19725, {1, 1, 1, 3, 1, 31, 9, 101, 347, 585, 577, 2529, 7461, 11921, 29475, 34505, 74911}}, {8035, 17, 19743, {1, 1, 1, 15, 25, 19, 95, 37, 93, 755, 1891, 2309, 623, 13503, 5811, 45863, 106501}}, {8036, 17, 19753, {1, 1, 5, 3, 15, 23, 51, 225, 87, 679, 1225, 4015, 3971, 163, 3185, 12921, 51267}}, {8037, 17, 19756, {1, 1, 5, 1, 1, 37, 105, 181, 379, 657, 571, 2775, 5905, 8391, 32069, 18713, 125833}}, {8038, 17, 19759, {1, 1, 7, 11, 11, 19, 109, 125, 371, 321, 629, 2165, 2861, 7883, 15503, 37679, 33057}}, {8039, 17, 19762, {1, 1, 3, 5, 7, 5, 21, 5, 169, 321, 1145, 2243, 6143, 2537, 4429, 56493, 39391}}, {8040, 17, 19776, {1, 3, 5, 5, 31, 7, 15, 175, 441, 663, 921, 3113, 2261, 13033, 19135, 28657, 92225}}, {8041, 17, 19786, {1, 3, 1, 11, 13, 9, 25, 57, 297, 3, 1561, 825, 2803, 11327, 2699, 28631, 57277}}, {8042, 17, 19799, {1, 1, 3, 9, 15, 25, 81, 197, 345, 341, 1557, 1375, 2509, 11949, 30201, 6807, 95199}}, {8043, 17, 19800, {1, 3, 5, 3, 15, 23, 91, 147, 277, 59, 495, 1423, 1775, 12065, 8401, 22639, 111199}}, {8044, 17, 19803, {1, 1, 5, 1, 1, 59, 35, 255, 229, 293, 187, 2663, 3967, 6493, 20103, 36703, 108939}}, {8045, 17, 19806, {1, 3, 7, 11, 15, 1, 23, 39, 27, 281, 11, 3119, 2791, 1691, 16521, 39715, 32145}}, {8046, 17, 19815, {1, 3, 5, 5, 9, 53, 43, 49, 107, 1015, 431, 3017, 3317, 9655, 19193, 45621, 56861}}, {8047, 17, 19816, {1, 3, 1, 15, 27, 63, 127, 31, 21, 245, 1503, 3339, 6375, 5411, 12369, 35973, 9473}}, {8048, 17, 19857, {1, 1, 3, 13, 31, 61, 19, 99, 25, 593, 539, 1807, 673, 12339, 23567, 22005, 130341}}, {8049, 17, 19860, {1, 1, 5, 3, 3, 3, 13, 183, 255, 41, 641, 581, 6509, 1891, 19195, 28277, 51725}}, {8050, 17, 19874, {1, 1, 3, 5, 3, 59, 17, 227, 9, 345, 1303, 1535, 3089, 2653, 20647, 63159, 124677}}, {8051, 17, 19883, {1, 3, 1, 11, 25, 19, 117, 29, 221, 461, 1285, 1427, 7183, 3051, 10839, 47491, 92613}}, {8052, 17, 19885, {1, 1, 3, 5, 27, 19, 1, 235, 51, 215, 783, 2325, 1191, 4679, 14365, 35479, 65083}}, {8053, 17, 19886, {1, 3, 3, 5, 27, 17, 79, 185, 259, 369, 1399, 1029, 2219, 10975, 30487, 15247, 39789}}, {8054, 17, 19893, {1, 3, 3, 1, 13, 13, 59, 119, 249, 471, 1433, 1165, 5345, 4431, 375, 64999, 85577}}, {8055, 17, 19932, {1, 1, 1, 3, 1, 19, 13, 243, 35, 675, 321, 3625, 7835, 6403, 651, 48283, 91819}}, {8056, 17, 19960, {1, 3, 3, 1, 27, 13, 73, 159, 145, 59, 287, 2419, 8115, 7923, 18933, 36109, 123879}}, {8057, 17, 19972, {1, 3, 1, 7, 21, 1, 83, 245, 477, 623, 391, 129, 6897, 3447, 11109, 17017, 68277}}, {8058, 17, 19975, {1, 1, 3, 11, 13, 43, 119, 93, 99, 393, 1219, 995, 1881, 7929, 4337, 33579, 103211}}, {8059, 17, 20005, {1, 1, 7, 7, 31, 5, 39, 25, 119, 819, 409, 2395, 151, 12763, 28265, 28909, 35685}}, {8060, 17, 20009, {1, 1, 1, 1, 3, 13, 59, 205, 19, 843, 1691, 955, 1859, 1791, 22083, 37843, 63615}}, {8061, 17, 20010, {1, 1, 1, 3, 11, 63, 41, 243, 103, 875, 1337, 3731, 6317, 12951, 31743, 56935, 55975}}, {8062, 17, 20012, {1, 1, 3, 13, 19, 11, 51, 97, 469, 279, 1621, 3521, 853, 11849, 3331, 27907, 119081}}, {8063, 17, 20023, {1, 1, 5, 1, 23, 55, 9, 141, 449, 41, 167, 2441, 6783, 2785, 3547, 35379, 74973}}, {8064, 17, 20024, {1, 1, 5, 3, 15, 55, 13, 75, 107, 153, 1841, 3991, 3229, 6523, 18541, 21571, 31539}}, {8065, 17, 20030, {1, 3, 1, 1, 27, 37, 35, 201, 401, 867, 1861, 1783, 6255, 14001, 29543, 25843, 39719}}, {8066, 17, 20038, {1, 1, 7, 15, 3, 43, 113, 173, 297, 457, 1369, 4053, 5033, 5513, 27387, 14725, 79937}}, {8067, 17, 20041, {1, 1, 5, 13, 5, 27, 109, 93, 187, 833, 1551, 2899, 1681, 6979, 1289, 3507, 66499}}, {8068, 17, 20055, {1, 1, 3, 11, 11, 47, 121, 29, 129, 807, 2037, 1527, 6083, 14803, 10669, 46047, 70241}}, {8069, 17, 20059, {1, 3, 1, 9, 29, 3, 19, 191, 461, 527, 1389, 3359, 81, 6773, 12185, 49207, 19091}}, {8070, 17, 20061, {1, 3, 7, 7, 5, 47, 33, 27, 445, 1, 149, 343, 4827, 91, 29233, 37775, 89321}}, {8071, 17, 20080, {1, 3, 5, 1, 13, 55, 107, 99, 259, 591, 983, 3863, 1231, 3457, 29645, 10709, 16543}}, {8072, 17, 20086, {1, 3, 7, 9, 29, 5, 9, 165, 337, 187, 219, 97, 6511, 193, 23947, 36329, 35317}}, {8073, 17, 20089, {1, 3, 7, 1, 31, 25, 5, 175, 409, 1021, 1873, 289, 7143, 15341, 31501, 25707, 106453}}, {8074, 17, 20095, {1, 3, 7, 7, 27, 1, 15, 221, 341, 987, 1739, 1183, 8139, 11081, 29721, 42991, 72805}}, {8075, 17, 20111, {1, 1, 1, 9, 11, 1, 13, 17, 501, 543, 1485, 987, 1861, 8527, 1621, 30461, 23057}}, {8076, 17, 20116, {1, 3, 7, 7, 9, 41, 1, 253, 71, 1009, 427, 3347, 6987, 3303, 30535, 33345, 126459}}, {8077, 17, 20130, {1, 1, 1, 7, 11, 11, 15, 11, 305, 559, 1805, 1111, 377, 1495, 13471, 34831, 123125}}, {8078, 17, 20136, {1, 1, 5, 7, 9, 37, 27, 45, 61, 705, 263, 3181, 7077, 5227, 28121, 42865, 3809}}, {8079, 17, 20147, {1, 1, 5, 1, 23, 25, 29, 199, 259, 959, 661, 43, 6157, 1547, 1497, 24077, 129939}}, {8080, 17, 20153, {1, 3, 5, 3, 13, 49, 33, 19, 367, 891, 1777, 3119, 5673, 8383, 14487, 1763, 63495}}, {8081, 17, 20156, {1, 1, 1, 13, 9, 57, 35, 181, 7, 225, 449, 3843, 6257, 4983, 31307, 16559, 27633}}, {8082, 17, 20167, {1, 3, 1, 11, 7, 33, 55, 81, 41, 61, 1711, 3273, 7629, 11283, 9103, 24105, 107547}}, {8083, 17, 20173, {1, 3, 5, 5, 13, 17, 13, 51, 235, 869, 1543, 1249, 7749, 14773, 21751, 53497, 108709}}, {8084, 17, 20182, {1, 1, 3, 9, 3, 63, 89, 43, 23, 479, 115, 3917, 7943, 7323, 5659, 64507, 46941}}, {8085, 17, 20185, {1, 1, 3, 1, 25, 63, 25, 169, 459, 633, 1785, 1059, 5113, 4799, 29281, 24561, 17017}}, {8086, 17, 20202, {1, 1, 3, 3, 15, 3, 11, 173, 493, 5, 1575, 653, 7391, 7453, 8297, 28653, 6213}}, {8087, 17, 20209, {1, 1, 7, 5, 29, 5, 1, 57, 75, 479, 787, 3417, 3349, 111, 17787, 41141, 97597}}, {8088, 17, 20229, {1, 3, 7, 1, 11, 7, 107, 159, 435, 159, 1401, 803, 7065, 5923, 4005, 37271, 113791}}, {8089, 17, 20233, {1, 1, 5, 1, 23, 55, 7, 59, 351, 801, 1279, 3231, 4561, 2857, 20563, 46115, 79489}}, {8090, 17, 20236, {1, 3, 3, 15, 19, 13, 113, 33, 149, 175, 1127, 3815, 4357, 12645, 4449, 61355, 83023}}, {8091, 17, 20241, {1, 1, 7, 15, 3, 17, 41, 57, 243, 319, 1631, 2751, 7853, 5977, 28367, 20023, 56049}}, {8092, 17, 20242, {1, 3, 1, 7, 27, 59, 7, 13, 497, 241, 1827, 2861, 1331, 1759, 6037, 18967, 42849}}, {8093, 17, 20248, {1, 3, 1, 1, 31, 43, 41, 183, 241, 219, 335, 2331, 755, 10589, 29431, 29007, 66667}}, {8094, 17, 20278, {1, 1, 3, 1, 27, 37, 61, 117, 471, 39, 139, 3821, 2945, 7035, 23673, 20167, 56169}}, {8095, 17, 20282, {1, 3, 1, 1, 9, 29, 123, 61, 171, 1015, 1029, 1695, 1039, 11883, 259, 10879, 97709}}, {8096, 17, 20299, {1, 3, 3, 5, 29, 39, 65, 193, 285, 635, 999, 717, 5465, 1849, 4293, 19775, 79121}}, {8097, 17, 20307, {1, 1, 7, 1, 3, 3, 103, 15, 451, 307, 1027, 263, 6585, 11651, 14457, 62695, 38407}}, {8098, 17, 20313, {1, 3, 7, 11, 13, 13, 29, 83, 267, 561, 2041, 13, 3167, 3475, 14735, 34455, 117533}}, {8099, 17, 20314, {1, 3, 1, 15, 5, 1, 35, 225, 151, 637, 1347, 833, 7077, 13145, 10285, 46583, 14351}}, {8100, 17, 20320, {1, 1, 3, 15, 27, 63, 119, 159, 209, 421, 1413, 2727, 1607, 7175, 6133, 29051, 97387}}, {8101, 17, 20326, {1, 1, 3, 5, 9, 29, 35, 93, 353, 903, 1037, 469, 5473, 7193, 21883, 14709, 89023}}, {8102, 17, 20332, {1, 1, 1, 11, 9, 17, 51, 155, 145, 443, 1985, 423, 4721, 15721, 9747, 10303, 21909}}, {8103, 17, 20350, {1, 3, 7, 15, 19, 49, 53, 153, 241, 739, 1585, 3945, 4869, 11, 15845, 17937, 69397}}, {8104, 17, 20360, {1, 1, 5, 7, 19, 53, 43, 211, 327, 723, 1513, 1569, 919, 1771, 11309, 50787, 7459}}, {8105, 17, 20371, {1, 1, 1, 9, 7, 29, 49, 89, 409, 685, 201, 1327, 2807, 13101, 2485, 62909, 102595}}, {8106, 17, 20373, {1, 3, 1, 13, 21, 51, 37, 231, 271, 475, 855, 3703, 4447, 5161, 17937, 14471, 47173}}, {8107, 17, 20377, {1, 1, 7, 3, 9, 7, 121, 197, 71, 147, 1669, 1745, 6589, 15029, 1529, 12625, 121925}}, {8108, 17, 20390, {1, 1, 1, 3, 7, 47, 63, 61, 187, 341, 919, 307, 389, 14141, 12941, 17917, 104289}}, {8109, 17, 20396, {1, 3, 5, 13, 19, 43, 57, 11, 383, 311, 1229, 3527, 3301, 12473, 24377, 16279, 92733}}, {8110, 17, 20404, {1, 3, 3, 5, 25, 35, 63, 23, 131, 481, 809, 3627, 5685, 13695, 14121, 64751, 66181}}, {8111, 17, 20413, {1, 3, 1, 5, 11, 43, 89, 55, 103, 219, 1861, 3223, 5111, 5879, 31399, 1395, 87419}}, {8112, 17, 20434, {1, 3, 1, 11, 21, 27, 123, 205, 47, 923, 7, 1635, 4019, 8431, 28313, 24275, 129617}}, {8113, 17, 20436, {1, 1, 1, 3, 1, 11, 91, 215, 393, 999, 1071, 3225, 4415, 759, 24499, 16109, 33791}}, {8114, 17, 20440, {1, 1, 3, 13, 19, 45, 77, 103, 105, 395, 529, 3631, 8179, 4467, 30263, 39379, 70507}}, {8115, 17, 20443, {1, 3, 3, 9, 17, 45, 101, 219, 433, 971, 471, 1243, 6955, 5941, 20641, 16119, 129383}}, {8116, 17, 20445, {1, 1, 7, 7, 9, 9, 91, 95, 503, 171, 129, 1509, 7179, 5367, 2219, 50445, 112459}}, {8117, 17, 20464, {1, 3, 7, 1, 17, 17, 19, 173, 229, 519, 147, 1835, 3797, 8091, 20335, 33177, 90197}}, {8118, 17, 20476, {1, 3, 3, 5, 23, 29, 107, 205, 43, 969, 799, 1239, 1353, 5221, 15175, 42945, 34043}}, {8119, 17, 20494, {1, 1, 5, 7, 31, 63, 67, 87, 189, 301, 1719, 3937, 965, 2505, 24781, 25133, 91675}}, {8120, 17, 20496, {1, 3, 1, 7, 15, 25, 11, 39, 281, 35, 1149, 1445, 6451, 12069, 20959, 29895, 60059}}, {8121, 17, 20501, {1, 1, 5, 1, 1, 17, 65, 213, 359, 561, 2015, 1629, 3521, 6877, 8099, 62483, 103903}}, {8122, 17, 20518, {1, 1, 7, 9, 7, 49, 1, 227, 49, 823, 1141, 2419, 2697, 13293, 14143, 6323, 16081}}, {8123, 17, 20527, {1, 3, 3, 1, 9, 13, 99, 235, 343, 601, 927, 183, 4545, 14529, 5521, 55571, 90675}}, {8124, 17, 20529, {1, 1, 5, 1, 13, 49, 95, 153, 131, 955, 283, 2951, 3651, 7743, 4285, 42621, 110577}}, {8125, 17, 20535, {1, 1, 1, 9, 19, 59, 97, 181, 67, 357, 497, 287, 3523, 3729, 28981, 59687, 39463}}, {8126, 17, 20544, {1, 1, 3, 7, 5, 19, 107, 55, 393, 225, 1953, 669, 8063, 6537, 15983, 59891, 95079}}, {8127, 17, 20568, {1, 3, 1, 5, 29, 21, 17, 169, 447, 697, 1613, 3483, 3139, 11175, 28865, 12065, 130241}}, {8128, 17, 20589, {1, 3, 5, 7, 5, 49, 35, 181, 85, 505, 1537, 1345, 773, 3255, 27405, 3959, 126377}}, {8129, 17, 20592, {1, 1, 7, 15, 9, 9, 17, 99, 409, 319, 807, 1721, 4023, 2171, 32657, 51663, 23253}}, {8130, 17, 20601, {1, 3, 5, 1, 5, 3, 37, 219, 89, 263, 397, 573, 6147, 9525, 2521, 11153, 94319}}, {8131, 17, 20617, {1, 1, 5, 5, 11, 39, 55, 205, 209, 239, 1443, 2477, 1941, 8337, 2883, 54593, 129859}}, {8132, 17, 20625, {1, 1, 1, 7, 11, 13, 127, 65, 127, 413, 1553, 413, 3395, 9451, 7517, 34103, 57029}}, {8133, 17, 20626, {1, 1, 1, 15, 5, 25, 109, 181, 399, 1023, 277, 3365, 6209, 827, 13933, 27483, 63835}}, {8134, 17, 20632, {1, 1, 3, 3, 21, 57, 95, 127, 481, 365, 197, 3631, 7443, 4925, 31277, 35061, 35875}}, {8135, 17, 20638, {1, 1, 7, 13, 3, 31, 59, 127, 441, 967, 1049, 1281, 3553, 375, 9683, 45755, 18889}}, {8136, 17, 20644, {1, 1, 1, 13, 11, 39, 49, 43, 383, 607, 157, 1887, 3623, 13335, 31949, 49843, 96781}}, {8137, 17, 20647, {1, 3, 7, 13, 19, 35, 21, 9, 299, 425, 1921, 3481, 6849, 4149, 5227, 56737, 27559}}, {8138, 17, 20662, {1, 3, 7, 5, 21, 11, 79, 97, 1, 849, 819, 1133, 3393, 5429, 10621, 38787, 120785}}, {8139, 17, 20671, {1, 1, 1, 13, 21, 29, 3, 239, 399, 619, 759, 2655, 3691, 655, 30979, 15507, 114791}}, {8140, 17, 20674, {1, 3, 5, 3, 1, 61, 79, 43, 273, 965, 1759, 3901, 2437, 1703, 20205, 46291, 23679}}, {8141, 17, 20683, {1, 1, 1, 9, 19, 57, 75, 245, 377, 261, 231, 3683, 6745, 7797, 28471, 56269, 109969}}, {8142, 17, 20704, {1, 3, 1, 11, 9, 55, 53, 87, 33, 431, 1805, 2933, 455, 12479, 16235, 2667, 70105}}, {8143, 17, 20724, {1, 3, 5, 1, 29, 1, 101, 17, 377, 499, 1365, 209, 4819, 15099, 8769, 37003, 53003}}, {8144, 17, 20742, {1, 3, 5, 11, 11, 39, 109, 235, 337, 393, 35, 1071, 7085, 7165, 25143, 24223, 71493}}, {8145, 17, 20748, {1, 3, 1, 5, 13, 49, 9, 205, 305, 943, 799, 2405, 319, 10755, 9785, 32023, 48015}}, {8146, 17, 20765, {1, 3, 1, 9, 29, 35, 123, 101, 73, 747, 1257, 407, 5871, 4271, 14837, 52727, 13339}}, {8147, 17, 20776, {1, 3, 3, 9, 31, 7, 113, 27, 89, 123, 1117, 531, 5531, 7897, 11209, 35267, 123457}}, {8148, 17, 20789, {1, 1, 1, 1, 29, 19, 93, 11, 61, 743, 267, 13, 6561, 7667, 20537, 12675, 10481}}, {8149, 17, 20796, {1, 1, 5, 13, 27, 47, 103, 171, 349, 139, 1709, 961, 783, 7147, 5569, 53395, 80797}}, {8150, 17, 20802, {1, 3, 1, 9, 21, 49, 41, 175, 507, 861, 1157, 1033, 6795, 5795, 603, 12485, 75263}}, {8151, 17, 20807, {1, 1, 5, 7, 23, 3, 21, 165, 123, 951, 785, 2065, 8001, 7009, 22981, 10011, 9807}}, {8152, 17, 20814, {1, 3, 7, 15, 1, 53, 49, 197, 231, 351, 141, 3465, 7907, 10695, 30913, 26753, 71079}}, {8153, 17, 20821, {1, 3, 5, 3, 29, 45, 23, 131, 65, 507, 75, 275, 7287, 187, 1093, 52657, 31533}}, {8154, 17, 20832, {1, 3, 5, 9, 9, 7, 113, 125, 441, 75, 663, 4081, 3147, 1469, 28375, 35747, 122965}}, {8155, 17, 20835, {1, 1, 7, 3, 3, 57, 5, 17, 183, 237, 965, 3709, 4161, 9513, 217, 58835, 78789}}, {8156, 17, 20847, {1, 1, 3, 1, 7, 25, 13, 29, 173, 319, 1723, 57, 2401, 10405, 15541, 52915, 93747}}, {8157, 17, 20859, {1, 1, 7, 5, 1, 31, 11, 61, 341, 97, 1199, 2585, 5909, 3707, 31507, 51233, 2389}}, {8158, 17, 20871, {1, 1, 5, 15, 15, 21, 127, 155, 229, 203, 1303, 3215, 1965, 9481, 31909, 52307, 112207}}, {8159, 17, 20883, {1, 3, 1, 13, 9, 45, 91, 39, 113, 587, 895, 637, 2475, 1695, 9347, 53255, 75797}}, {8160, 17, 20886, {1, 3, 5, 13, 17, 11, 35, 83, 69, 255, 741, 3927, 153, 11001, 29145, 37107, 51873}}, {8161, 17, 20892, {1, 1, 7, 5, 5, 37, 35, 219, 153, 1005, 973, 2555, 893, 5931, 23857, 34631, 74561}}, {8162, 17, 20906, {1, 3, 1, 11, 21, 63, 113, 29, 115, 307, 957, 407, 879, 4819, 2865, 1773, 116825}}, {8163, 17, 20908, {1, 3, 7, 3, 19, 55, 87, 21, 139, 571, 311, 2295, 2729, 6371, 11845, 30223, 19247}}, {8164, 17, 20957, {1, 3, 7, 5, 23, 9, 59, 25, 357, 863, 435, 2509, 5599, 14039, 25731, 41645, 255}}, {8165, 17, 20962, {1, 3, 7, 13, 9, 3, 63, 115, 503, 489, 1585, 813, 5419, 691, 23973, 18677, 59979}}, {8166, 17, 20968, {1, 1, 1, 1, 13, 3, 55, 23, 185, 731, 459, 1497, 433, 16243, 29995, 20777, 59513}}, {8167, 17, 20979, {1, 1, 7, 3, 27, 55, 77, 57, 349, 5, 617, 385, 6225, 7025, 23335, 877, 21973}}, {8168, 17, 20991, {1, 3, 3, 5, 3, 37, 105, 197, 153, 639, 1643, 1093, 801, 4605, 4551, 46081, 7739}}, {8169, 17, 20998, {1, 1, 5, 11, 29, 23, 5, 91, 39, 489, 2029, 887, 4451, 11463, 5641, 56299, 34027}}, {8170, 17, 21007, {1, 1, 7, 3, 17, 11, 25, 161, 317, 701, 155, 1989, 7549, 11529, 9945, 18395, 61251}}, {8171, 17, 21010, {1, 1, 7, 13, 23, 55, 113, 91, 17, 149, 1893, 2793, 8185, 81, 29487, 47925, 51837}}, {8172, 17, 21026, {1, 3, 7, 7, 9, 29, 103, 161, 215, 129, 113, 1987, 919, 9639, 20715, 6541, 15041}}, {8173, 17, 21037, {1, 1, 5, 9, 19, 19, 127, 43, 263, 997, 1687, 3801, 4249, 6309, 25889, 1787, 122771}}, {8174, 17, 21038, {1, 3, 5, 13, 17, 3, 91, 183, 349, 467, 333, 3299, 3085, 12135, 16801, 31471, 37227}}, {8175, 17, 21045, {1, 1, 5, 3, 7, 53, 11, 221, 407, 545, 237, 3631, 1791, 3729, 19737, 921, 57303}}, {8176, 17, 21057, {1, 3, 7, 15, 3, 27, 71, 45, 219, 9, 1135, 2267, 6841, 8637, 30317, 9397, 115425}}, {8177, 17, 21082, {1, 1, 3, 5, 29, 59, 121, 225, 419, 813, 1725, 3969, 3451, 8457, 31803, 57659, 33263}}, {8178, 17, 21093, {1, 3, 3, 3, 17, 3, 65, 249, 423, 293, 1333, 3947, 1477, 4005, 30445, 28171, 95823}}, {8179, 17, 21094, {1, 3, 3, 11, 29, 45, 67, 89, 75, 95, 555, 1823, 2795, 11929, 1995, 30013, 116241}}, {8180, 17, 21105, {1, 3, 3, 3, 23, 35, 87, 221, 385, 275, 803, 387, 7765, 15637, 27953, 20913, 25279}}, {8181, 17, 21117, {1, 3, 7, 15, 15, 43, 21, 179, 393, 95, 1913, 1715, 4467, 15093, 13613, 50775, 37133}}, {8182, 17, 21121, {1, 1, 7, 7, 31, 27, 49, 71, 323, 123, 597, 2395, 4449, 7249, 20197, 19789, 92685}}, {8183, 17, 21124, {1, 1, 5, 13, 31, 37, 89, 225, 357, 201, 1887, 3915, 2165, 10809, 21623, 34375, 110905}}, {8184, 17, 21136, {1, 1, 5, 7, 11, 53, 37, 55, 61, 679, 1465, 1587, 2215, 16237, 14985, 50507, 128637}}, {8185, 17, 21139, {1, 1, 7, 1, 15, 53, 115, 21, 279, 555, 43, 2429, 7251, 2141, 4813, 47047, 119551}}, {8186, 17, 21142, {1, 1, 5, 13, 11, 41, 59, 245, 337, 117, 1125, 4007, 947, 10591, 17795, 48535, 72171}}, {8187, 17, 21145, {1, 1, 5, 15, 27, 41, 71, 43, 505, 539, 975, 1567, 795, 4433, 11689, 53051, 98819}}, {8188, 17, 21167, {1, 1, 7, 9, 1, 57, 57, 137, 323, 311, 759, 3027, 3713, 13, 24133, 21451, 1153}}, {8189, 17, 21170, {1, 1, 5, 15, 31, 49, 23, 123, 271, 549, 1995, 5, 6065, 3797, 1085, 50137, 19741}}, {8190, 17, 21175, {1, 3, 3, 13, 5, 15, 21, 117, 487, 43, 1759, 2899, 4239, 9729, 16711, 31559, 34553}}, {8191, 17, 21179, {1, 1, 5, 13, 5, 23, 83, 49, 147, 267, 923, 1377, 1687, 1793, 30383, 19537, 66989}}, {8192, 17, 21182, {1, 1, 1, 13, 9, 41, 105, 241, 499, 891, 885, 3349, 4703, 5609, 11999, 58025, 69089}}, {8193, 17, 21193, {1, 1, 7, 9, 21, 11, 121, 69, 115, 895, 91, 3745, 41, 12787, 26181, 31399, 30463}}, {8194, 17, 21194, {1, 1, 7, 13, 11, 3, 23, 173, 5, 907, 45, 3465, 2807, 3731, 14347, 27973, 8567}}, {8195, 17, 21207, {1, 3, 7, 5, 27, 47, 43, 25, 499, 57, 649, 705, 6223, 4213, 4549, 23213, 13657}}, {8196, 17, 21217, {1, 1, 7, 11, 21, 35, 5, 79, 295, 359, 1993, 99, 7917, 14917, 2131, 45527, 31451}}, {8197, 17, 21224, {1, 1, 5, 15, 1, 39, 85, 93, 65, 991, 389, 585, 4835, 11671, 10913, 41787, 84953}}, {8198, 17, 21244, {1, 1, 1, 5, 27, 5, 1, 15, 11, 83, 1191, 3945, 4697, 7703, 6929, 6057, 88721}}, {8199, 17, 21247, {1, 1, 3, 7, 27, 39, 71, 181, 191, 997, 419, 1671, 7771, 15305, 18677, 45033, 64745}}, {8200, 17, 21252, {1, 3, 7, 3, 15, 41, 33, 239, 93, 307, 153, 2701, 1549, 5011, 6913, 19257, 55829}}, {8201, 17, 21264, {1, 3, 3, 11, 21, 47, 69, 223, 365, 877, 431, 1629, 4803, 11591, 13973, 56359, 11897}}, {8202, 17, 21273, {1, 3, 7, 7, 1, 59, 63, 129, 251, 873, 603, 2707, 2847, 8739, 31343, 63291, 5607}}, {8203, 17, 21289, {1, 3, 5, 5, 19, 13, 79, 235, 151, 571, 953, 2191, 5973, 4751, 11119, 14439, 97755}}, {8204, 17, 21290, {1, 1, 5, 1, 27, 3, 105, 139, 13, 821, 221, 2025, 7303, 1891, 28193, 45537, 92703}}, {8205, 17, 21295, {1, 3, 7, 9, 13, 63, 27, 149, 51, 121, 587, 3695, 4115, 3955, 22493, 34903, 51669}}, {8206, 17, 21297, {1, 1, 5, 7, 19, 5, 89, 87, 269, 585, 421, 3827, 315, 14739, 109, 43009, 94969}}, {8207, 17, 21309, {1, 1, 5, 15, 9, 53, 125, 83, 159, 917, 1583, 585, 6839, 14957, 20007, 60467, 96309}}, {8208, 17, 21318, {1, 3, 5, 1, 23, 49, 109, 91, 17, 731, 1083, 3153, 1825, 14293, 25639, 44599, 47541}}, {8209, 17, 21322, {1, 1, 3, 7, 21, 51, 45, 25, 367, 925, 799, 1673, 6977, 7155, 829, 25899, 104615}}, {8210, 17, 21324, {1, 3, 3, 13, 13, 49, 95, 239, 195, 353, 1967, 1419, 929, 503, 11717, 9485, 62885}}, {8211, 17, 21329, {1, 1, 1, 15, 3, 41, 109, 91, 327, 789, 1429, 1159, 2801, 4845, 19663, 47737, 11029}}, {8212, 17, 21332, {1, 3, 5, 1, 21, 63, 57, 107, 229, 771, 1911, 647, 6989, 12615, 23191, 64941, 97595}}, {8213, 17, 21336, {1, 1, 1, 15, 5, 13, 15, 109, 459, 447, 1625, 1269, 7629, 7929, 4405, 12143, 40481}}, {8214, 17, 21342, {1, 3, 3, 1, 23, 3, 95, 229, 363, 379, 1149, 1615, 5125, 3645, 27535, 58791, 38091}}, {8215, 17, 21351, {1, 1, 1, 1, 9, 45, 119, 85, 151, 171, 1123, 41, 6517, 8067, 17845, 23301, 95383}}, {8216, 17, 21355, {1, 3, 1, 15, 17, 31, 103, 71, 35, 1019, 1687, 1175, 6119, 14075, 26601, 28873, 36617}}, {8217, 17, 21363, {1, 3, 3, 9, 13, 39, 7, 17, 207, 219, 637, 3025, 1709, 4031, 563, 14865, 129389}}, {8218, 17, 21372, {1, 3, 7, 1, 21, 11, 121, 85, 111, 641, 1163, 3173, 5189, 13261, 19471, 39635, 76545}}, {8219, 17, 21382, {1, 3, 7, 15, 3, 45, 3, 37, 121, 967, 1861, 3257, 3699, 6881, 11905, 8413, 59397}}, {8220, 17, 21388, {1, 3, 3, 13, 25, 53, 85, 181, 1, 979, 2045, 297, 1739, 8139, 17897, 35251, 7193}}, {8221, 17, 21394, {1, 1, 1, 3, 5, 49, 77, 115, 377, 209, 1415, 3747, 485, 803, 2507, 27729, 52201}}, {8222, 17, 21403, {1, 3, 1, 5, 31, 55, 85, 171, 135, 893, 1423, 3693, 6155, 5321, 8297, 39183, 88377}}, {8223, 17, 21409, {1, 3, 3, 15, 1, 35, 73, 239, 181, 101, 509, 2449, 4955, 13049, 27631, 16871, 40151}}, {8224, 17, 21416, {1, 1, 7, 13, 27, 7, 109, 71, 437, 835, 563, 1355, 3681, 7431, 32743, 59693, 125055}}, {8225, 17, 21421, {1, 1, 7, 5, 19, 23, 29, 147, 291, 507, 1943, 2069, 3309, 11569, 1031, 49345, 86735}}, {8226, 17, 21424, {1, 1, 3, 13, 17, 45, 91, 167, 19, 137, 527, 961, 4435, 2277, 6863, 57917, 129407}}, {8227, 17, 21444, {1, 3, 5, 7, 11, 31, 79, 207, 43, 871, 1121, 2929, 6899, 4099, 29533, 45333, 33299}}, {8228, 17, 21453, {1, 1, 7, 5, 5, 49, 13, 95, 475, 91, 337, 3531, 3157, 1331, 32655, 46169, 3549}}, {8229, 17, 21466, {1, 3, 1, 5, 5, 9, 73, 177, 123, 251, 717, 541, 7083, 6907, 1417, 31203, 9755}}, {8230, 17, 21471, {1, 3, 1, 11, 21, 11, 91, 155, 447, 165, 1525, 2073, 5103, 193, 2677, 43673, 70579}}, {8231, 17, 21495, {1, 3, 7, 1, 7, 27, 115, 247, 211, 779, 1999, 209, 3215, 111, 25567, 34641, 130873}}, {8232, 17, 21499, {1, 1, 5, 9, 25, 7, 15, 19, 217, 831, 1577, 2051, 3533, 2337, 7675, 2845, 69135}}, {8233, 17, 21504, {1, 3, 5, 15, 29, 11, 91, 59, 221, 383, 1235, 1261, 2967, 14989, 11455, 6459, 58047}}, {8234, 17, 21507, {1, 3, 5, 1, 3, 35, 5, 127, 99, 981, 493, 3001, 5651, 3125, 27789, 57389, 115631}}, {8235, 17, 21521, {1, 3, 5, 5, 29, 63, 123, 161, 247, 177, 1653, 2665, 3903, 11129, 20961, 49429, 44075}}, {8236, 17, 21527, {1, 3, 1, 1, 13, 9, 57, 167, 291, 765, 1929, 397, 5503, 5601, 6957, 62003, 104631}}, {8237, 17, 21555, {1, 1, 7, 15, 9, 43, 57, 85, 157, 361, 1931, 2183, 8045, 14939, 2169, 25733, 29095}}, {8238, 17, 21558, {1, 1, 3, 15, 13, 35, 47, 123, 13, 667, 1373, 4069, 6259, 13453, 13439, 25349, 99437}}, {8239, 17, 21562, {1, 3, 7, 1, 31, 15, 69, 45, 355, 919, 415, 793, 3987, 8785, 4905, 8177, 123989}}, {8240, 17, 21570, {1, 3, 7, 13, 29, 27, 69, 57, 385, 185, 171, 2499, 3983, 13437, 23585, 21501, 88079}}, {8241, 17, 21576, {1, 1, 5, 11, 27, 3, 77, 99, 221, 997, 1653, 1963, 2251, 15505, 26347, 51933, 100679}}, {8242, 17, 21579, {1, 1, 1, 7, 19, 39, 49, 69, 193, 235, 959, 2823, 2573, 8001, 4389, 13217, 60975}}, {8243, 17, 21581, {1, 1, 7, 5, 1, 3, 3, 189, 199, 293, 1225, 1913, 7271, 2255, 661, 23293, 82069}}, {8244, 17, 21587, {1, 1, 5, 5, 21, 31, 35, 113, 47, 479, 325, 1663, 7409, 8975, 14151, 56317, 79663}}, {8245, 17, 21590, {1, 1, 5, 9, 15, 63, 99, 135, 277, 715, 667, 387, 6929, 12873, 12913, 2599, 84939}}, {8246, 17, 21599, {1, 1, 7, 15, 23, 39, 67, 25, 179, 313, 459, 295, 1103, 1737, 7529, 29463, 104693}}, {8247, 17, 21605, {1, 1, 3, 13, 23, 11, 111, 67, 105, 191, 1967, 3497, 7621, 487, 18545, 59521, 115315}}, {8248, 17, 21612, {1, 1, 1, 7, 25, 45, 83, 61, 231, 569, 155, 2817, 6985, 5289, 6731, 3087, 89749}}, {8249, 17, 21618, {1, 3, 7, 1, 1, 61, 103, 49, 135, 411, 659, 1735, 4461, 8077, 12885, 62791, 114769}}, {8250, 17, 21630, {1, 1, 7, 13, 3, 53, 21, 81, 433, 563, 857, 891, 195, 11669, 24769, 56539, 47601}}, {8251, 17, 21639, {1, 3, 1, 13, 3, 41, 59, 101, 67, 803, 1209, 3267, 1255, 5763, 5483, 36339, 38451}}, {8252, 17, 21640, {1, 3, 5, 3, 25, 51, 53, 213, 329, 11, 483, 81, 2151, 7623, 26309, 15289, 85103}}, {8253, 17, 21643, {1, 3, 3, 13, 23, 17, 9, 161, 417, 207, 39, 3615, 7567, 15207, 20383, 58885, 121765}}, {8254, 17, 21648, {1, 3, 1, 7, 15, 59, 9, 195, 187, 583, 341, 2737, 3891, 331, 18055, 60455, 113271}}, {8255, 17, 21669, {1, 1, 3, 3, 19, 25, 95, 37, 281, 59, 1613, 2733, 5715, 4067, 5509, 5851, 35189}}, {8256, 17, 21679, {1, 3, 1, 3, 31, 43, 125, 107, 341, 109, 1991, 849, 7795, 13607, 20421, 3339, 78979}}, {8257, 17, 21681, {1, 3, 7, 13, 15, 57, 87, 151, 479, 99, 479, 447, 7407, 303, 16397, 15699, 122273}}, {8258, 17, 21687, {1, 1, 3, 1, 27, 61, 79, 195, 5, 839, 1411, 3451, 4627, 13715, 18401, 24325, 44027}}, {8259, 17, 21688, {1, 1, 7, 15, 21, 39, 57, 207, 213, 367, 547, 1203, 6385, 2555, 31465, 15675, 7133}}, {8260, 17, 21706, {1, 1, 5, 15, 27, 3, 75, 123, 337, 1019, 1525, 3065, 1919, 10779, 27409, 6291, 86291}}, {8261, 17, 21713, {1, 1, 7, 11, 15, 27, 67, 145, 125, 521, 647, 2957, 6337, 14973, 24139, 29107, 27151}}, {8262, 17, 21714, {1, 1, 1, 13, 25, 57, 103, 83, 321, 111, 131, 2051, 5267, 4723, 1939, 40389, 4803}}, {8263, 17, 21716, {1, 3, 1, 7, 29, 7, 35, 133, 349, 855, 613, 2563, 2261, 2119, 13939, 24727, 26719}}, {8264, 17, 21730, {1, 3, 3, 1, 11, 61, 25, 177, 427, 1005, 2027, 649, 7871, 7803, 4717, 59207, 57945}}, {8265, 17, 21732, {1, 1, 7, 1, 15, 45, 75, 133, 193, 745, 485, 197, 6001, 13837, 615, 43629, 127321}}, {8266, 17, 21749, {1, 3, 3, 13, 5, 7, 101, 183, 211, 283, 1327, 1395, 8175, 13359, 18361, 54243, 3555}}, {8267, 17, 21756, {1, 1, 7, 13, 7, 43, 19, 41, 319, 701, 795, 1407, 7113, 9149, 31953, 17075, 53975}}, {8268, 17, 21774, {1, 3, 5, 13, 11, 19, 101, 125, 327, 75, 1471, 3465, 2247, 5107, 11519, 45161, 71373}}, {8269, 17, 21779, {1, 3, 7, 13, 23, 59, 53, 57, 137, 575, 59, 3829, 963, 11259, 25771, 29223, 79535}}, {8270, 17, 21781, {1, 3, 3, 11, 17, 31, 111, 147, 499, 441, 1385, 769, 6901, 8349, 1427, 16561, 7485}}, {8271, 17, 21786, {1, 1, 7, 9, 21, 7, 47, 83, 351, 867, 265, 1329, 7853, 6959, 11821, 44947, 42275}}, {8272, 17, 21792, {1, 1, 7, 15, 3, 17, 79, 143, 449, 577, 1007, 1101, 3229, 6861, 23921, 37551, 117309}}, {8273, 17, 21810, {1, 3, 5, 11, 27, 63, 107, 15, 289, 821, 1723, 1945, 1373, 14469, 30985, 55987, 21255}}, {8274, 17, 21819, {1, 3, 5, 3, 21, 39, 79, 85, 485, 733, 2031, 1573, 6873, 12225, 30471, 54233, 26967}}, {8275, 17, 21829, {1, 3, 5, 7, 17, 29, 93, 251, 437, 583, 825, 551, 6545, 10905, 27863, 37037, 52129}}, {8276, 17, 21830, {1, 3, 7, 9, 23, 1, 23, 85, 195, 319, 1759, 3985, 2413, 16205, 22197, 48821, 94907}}, {8277, 17, 21844, {1, 1, 3, 7, 17, 47, 3, 195, 167, 925, 11, 3431, 1767, 5917, 13915, 54565, 64625}}, {8278, 17, 21853, {1, 3, 1, 13, 23, 43, 97, 93, 313, 773, 591, 127, 6005, 11497, 32573, 8173, 92053}}, {8279, 17, 21867, {1, 1, 5, 9, 17, 47, 115, 237, 389, 619, 377, 561, 1333, 6433, 9743, 32673, 98039}}, {8280, 17, 21869, {1, 3, 7, 15, 23, 17, 99, 225, 145, 191, 2041, 581, 841, 9377, 18123, 32773, 66849}}, {8281, 17, 21882, {1, 3, 7, 15, 21, 49, 97, 41, 357, 527, 2019, 2083, 2611, 12449, 20037, 52503, 105991}}, {8282, 17, 21891, {1, 1, 5, 13, 17, 53, 41, 75, 355, 207, 1675, 591, 5797, 9217, 16443, 3205, 81905}}, {8283, 17, 21898, {1, 3, 7, 11, 1, 61, 29, 207, 449, 103, 1527, 2327, 7895, 10137, 25223, 51607, 60809}}, {8284, 17, 21917, {1, 3, 3, 5, 15, 57, 87, 233, 301, 989, 485, 2143, 7411, 5475, 23377, 56005, 59721}}, {8285, 17, 21934, {1, 3, 1, 15, 29, 7, 95, 141, 369, 231, 735, 1103, 1565, 11575, 571, 3257, 62961}}, {8286, 17, 21946, {1, 1, 5, 15, 27, 19, 25, 35, 303, 555, 95, 1323, 6139, 5079, 21763, 59591, 103537}}, {8287, 17, 21948, {1, 1, 1, 13, 25, 23, 85, 151, 135, 349, 1753, 1061, 7697, 1723, 5213, 12581, 103995}}, {8288, 17, 21963, {1, 3, 1, 9, 29, 51, 101, 195, 59, 809, 1527, 2179, 63, 3681, 29823, 57537, 121371}}, {8289, 17, 21966, {1, 1, 7, 11, 27, 61, 85, 213, 245, 261, 1649, 2423, 6127, 5687, 4247, 56061, 109793}}, {8290, 17, 21968, {1, 3, 5, 15, 11, 33, 127, 31, 269, 857, 2027, 2611, 1729, 11783, 16459, 31083, 30671}}, {8291, 17, 21973, {1, 1, 7, 9, 11, 29, 127, 177, 505, 227, 1499, 1309, 6855, 9999, 21815, 32987, 79109}}, {8292, 17, 21977, {1, 3, 7, 11, 7, 21, 107, 1, 493, 459, 867, 3199, 7985, 12957, 28197, 41133, 105985}}, {8293, 17, 21980, {1, 1, 3, 15, 1, 57, 113, 97, 213, 547, 1017, 2961, 461, 16125, 10621, 4243, 58277}}, {8294, 17, 21984, {1, 1, 3, 5, 11, 57, 61, 47, 209, 961, 333, 795, 4491, 15115, 25745, 62633, 66269}}, {8295, 17, 21994, {1, 1, 7, 3, 19, 13, 49, 167, 455, 863, 581, 1407, 4247, 15023, 2247, 19981, 125891}}, {8296, 17, 21999, {1, 1, 7, 15, 17, 55, 27, 35, 33, 349, 879, 1781, 1075, 2475, 30689, 42043, 29423}}, {8297, 17, 22018, {1, 1, 1, 11, 25, 53, 121, 117, 117, 845, 447, 3927, 1951, 8643, 24497, 44833, 99533}}, {8298, 17, 22020, {1, 1, 7, 13, 3, 59, 117, 9, 359, 453, 327, 3419, 5957, 97, 20541, 49441, 5673}}, {8299, 17, 22029, {1, 3, 5, 5, 31, 35, 95, 107, 435, 733, 827, 1361, 6627, 8905, 2681, 25473, 46093}}, {8300, 17, 22032, {1, 3, 3, 5, 7, 23, 75, 137, 231, 915, 637, 2963, 4409, 12799, 31587, 65363, 69539}}, {8301, 17, 22041, {1, 1, 1, 7, 15, 35, 19, 233, 189, 837, 243, 2525, 6185, 565, 8133, 4265, 3089}}, {8302, 17, 22047, {1, 1, 5, 5, 19, 59, 103, 201, 287, 449, 21, 2331, 341, 13145, 18607, 46407, 2767}}, {8303, 17, 22048, {1, 3, 3, 15, 19, 41, 49, 179, 109, 367, 1185, 1045, 1635, 9647, 16613, 25357, 34291}}, {8304, 17, 22071, {1, 3, 5, 1, 13, 11, 89, 25, 159, 637, 1979, 549, 3553, 9163, 227, 50553, 46307}}, {8305, 17, 22075, {1, 1, 3, 1, 17, 33, 73, 239, 261, 751, 1267, 2643, 2549, 8331, 25083, 9715, 67289}}, {8306, 17, 22078, {1, 1, 1, 13, 3, 49, 7, 35, 367, 293, 903, 1045, 569, 6017, 27635, 51833, 32963}}, {8307, 17, 22083, {1, 3, 5, 3, 31, 3, 69, 137, 57, 87, 719, 3977, 3031, 7675, 24605, 8757, 93173}}, {8308, 17, 22089, {1, 3, 3, 1, 7, 45, 97, 35, 233, 69, 1525, 4047, 2599, 13679, 4389, 49079, 121465}}, {8309, 17, 22097, {1, 1, 7, 13, 7, 25, 57, 211, 337, 189, 1825, 2451, 7651, 11277, 27763, 40671, 57223}}, {8310, 17, 22110, {1, 1, 1, 1, 15, 59, 55, 169, 461, 907, 407, 803, 3349, 4727, 20983, 47717, 51647}}, {8311, 17, 22113, {1, 3, 7, 1, 15, 51, 25, 119, 439, 593, 1289, 3959, 5489, 13283, 31837, 8441, 58373}}, {8312, 17, 22119, {1, 3, 1, 9, 5, 1, 81, 45, 13, 537, 1091, 3861, 6781, 5679, 2807, 29757, 40917}}, {8313, 17, 22120, {1, 3, 5, 3, 27, 41, 19, 235, 207, 697, 775, 837, 3431, 3175, 10807, 42775, 67987}}, {8314, 17, 22126, {1, 3, 7, 3, 29, 33, 35, 119, 271, 609, 1747, 2839, 3415, 2275, 30979, 41293, 99341}}, {8315, 17, 22133, {1, 3, 3, 3, 5, 17, 13, 169, 269, 709, 1449, 3169, 1545, 16075, 8937, 39705, 19609}}, {8316, 17, 22134, {1, 3, 5, 15, 29, 13, 1, 199, 65, 385, 977, 797, 1181, 10979, 241, 40393, 73663}}, {8317, 17, 22140, {1, 1, 3, 7, 17, 35, 47, 63, 193, 451, 151, 3415, 99, 14557, 26025, 31361, 112639}}, {8318, 17, 22147, {1, 1, 3, 5, 19, 13, 29, 33, 365, 311, 1241, 217, 6205, 13067, 18585, 21693, 97127}}, {8319, 17, 22161, {1, 1, 3, 15, 19, 7, 87, 25, 91, 13, 1839, 1445, 957, 9779, 25557, 37027, 38987}}, {8320, 17, 22164, {1, 1, 5, 1, 21, 5, 79, 67, 481, 455, 37, 1321, 7723, 1413, 7919, 11035, 5739}}, {8321, 17, 22173, {1, 1, 1, 15, 9, 55, 111, 1, 383, 439, 1037, 4055, 4243, 10443, 26737, 21039, 130847}}, {8322, 17, 22197, {1, 1, 7, 9, 13, 25, 71, 137, 307, 717, 1009, 2477, 3861, 14145, 14549, 59589, 93401}}, {8323, 17, 22207, {1, 1, 7, 5, 29, 63, 77, 49, 471, 267, 1457, 1743, 1915, 14793, 17899, 28011, 92183}}, {8324, 17, 22210, {1, 3, 7, 7, 7, 41, 47, 251, 75, 749, 1915, 1015, 5869, 3211, 24097, 14349, 130571}}, {8325, 17, 22216, {1, 1, 1, 1, 31, 63, 105, 83, 345, 147, 975, 135, 7299, 15801, 19311, 26143, 80293}}, {8326, 17, 22234, {1, 1, 3, 1, 7, 1, 47, 45, 251, 635, 583, 3515, 5233, 6281, 7797, 37949, 75877}}, {8327, 17, 22257, {1, 1, 3, 3, 5, 53, 99, 175, 155, 327, 1841, 211, 2811, 16099, 17255, 34253, 124141}}, {8328, 17, 22264, {1, 3, 1, 3, 13, 27, 81, 217, 115, 245, 101, 1641, 29, 1441, 4829, 28399, 102303}}, {8329, 17, 22278, {1, 3, 1, 5, 11, 55, 31, 91, 337, 203, 987, 977, 4929, 14933, 25149, 20493, 19783}}, {8330, 17, 22284, {1, 1, 5, 9, 9, 37, 103, 211, 349, 165, 1421, 3015, 5133, 4615, 28173, 45787, 10711}}, {8331, 17, 22287, {1, 1, 1, 1, 1, 17, 29, 117, 421, 651, 1617, 1677, 7841, 16303, 8843, 1321, 90701}}, {8332, 17, 22299, {1, 1, 1, 15, 27, 23, 49, 195, 139, 319, 1277, 901, 63, 14677, 21815, 19497, 24883}}, {8333, 17, 22301, {1, 3, 3, 13, 1, 23, 17, 189, 293, 765, 1503, 1485, 7427, 11807, 17629, 61739, 111365}}, {8334, 17, 22308, {1, 1, 5, 5, 15, 41, 25, 53, 221, 449, 1597, 2763, 4119, 6319, 17509, 23493, 104707}}, {8335, 17, 22337, {1, 3, 7, 11, 29, 21, 101, 197, 161, 457, 331, 3817, 5139, 14307, 23225, 55567, 62535}}, {8336, 17, 22349, {1, 1, 7, 5, 9, 57, 39, 101, 5, 847, 1311, 313, 2877, 14811, 21969, 31741, 8075}}, {8337, 17, 22350, {1, 3, 5, 3, 1, 11, 45, 163, 251, 775, 1031, 1957, 1631, 1691, 3191, 6255, 13037}}, {8338, 17, 22357, {1, 1, 3, 13, 7, 11, 95, 97, 409, 835, 707, 1579, 2409, 9451, 15069, 62425, 106499}}, {8339, 17, 22364, {1, 3, 3, 11, 5, 25, 23, 207, 429, 299, 537, 1467, 6309, 891, 15009, 56733, 60397}}, {8340, 17, 22373, {1, 3, 5, 3, 29, 47, 95, 115, 207, 177, 543, 427, 145, 11169, 7441, 10911, 87413}}, {8341, 17, 22377, {1, 3, 7, 11, 25, 53, 15, 225, 115, 295, 919, 39, 513, 9989, 11045, 24015, 102387}}, {8342, 17, 22380, {1, 1, 7, 15, 13, 31, 103, 143, 357, 825, 183, 137, 2671, 9803, 14777, 48333, 79483}}, {8343, 17, 22386, {1, 3, 5, 1, 25, 13, 65, 9, 461, 307, 1289, 1035, 7253, 14223, 16829, 23361, 84987}}, {8344, 17, 22391, {1, 3, 5, 7, 5, 57, 47, 251, 5, 9, 965, 2883, 3105, 13931, 807, 31977, 119035}}, {8345, 17, 22392, {1, 1, 3, 5, 3, 7, 55, 165, 3, 787, 1587, 989, 6049, 14021, 30789, 15283, 92851}}, {8346, 17, 22411, {1, 1, 5, 5, 3, 17, 11, 167, 487, 885, 193, 3485, 8179, 9485, 24913, 40267, 70625}}, {8347, 17, 22422, {1, 1, 7, 1, 27, 31, 9, 139, 73, 137, 783, 321, 691, 6157, 19905, 45525, 84877}}, {8348, 17, 22425, {1, 3, 1, 9, 17, 39, 127, 177, 301, 579, 1065, 3899, 281, 9177, 16295, 51217, 120293}}, {8349, 17, 22431, {1, 1, 7, 9, 31, 59, 17, 93, 247, 779, 847, 1183, 3453, 1073, 18597, 2655, 121633}}, {8350, 17, 22438, {1, 1, 7, 1, 25, 43, 47, 253, 23, 999, 973, 1201, 1061, 5947, 5619, 36311, 1545}}, {8351, 17, 22441, {1, 3, 5, 7, 11, 5, 103, 119, 229, 657, 1993, 1991, 1597, 13165, 19137, 7161, 83487}}, {8352, 17, 22442, {1, 1, 1, 1, 11, 23, 105, 183, 467, 83, 899, 2447, 4949, 4171, 28943, 4829, 13033}}, {8353, 17, 22449, {1, 3, 1, 7, 15, 7, 47, 215, 253, 109, 1975, 3337, 1553, 13575, 16835, 61525, 26423}}, {8354, 17, 22452, {1, 1, 7, 1, 21, 17, 53, 79, 175, 267, 999, 249, 6177, 10453, 12475, 59801, 47351}}, {8355, 17, 22461, {1, 3, 5, 11, 3, 57, 5, 193, 421, 799, 1833, 2635, 6537, 4669, 9597, 40661, 12113}}, {8356, 17, 22467, {1, 1, 7, 11, 9, 11, 69, 103, 139, 167, 159, 2469, 703, 1519, 21553, 62875, 60449}}, {8357, 17, 22479, {1, 1, 5, 3, 9, 11, 17, 183, 499, 301, 1275, 605, 7655, 12141, 7783, 39413, 116263}}, {8358, 17, 22484, {1, 1, 1, 7, 31, 55, 23, 79, 49, 247, 761, 3573, 8187, 4879, 27379, 15725, 81415}}, {8359, 17, 22487, {1, 3, 5, 5, 5, 49, 23, 205, 509, 383, 1165, 3839, 7663, 1539, 19967, 55901, 4351}}, {8360, 17, 22493, {1, 1, 1, 11, 7, 15, 3, 159, 235, 735, 391, 2231, 5043, 9759, 4569, 35601, 71989}}, {8361, 17, 22510, {1, 3, 3, 15, 23, 3, 49, 97, 99, 517, 1097, 3517, 1035, 2319, 27705, 25547, 101555}}, {8362, 17, 22521, {1, 3, 7, 11, 27, 29, 33, 241, 205, 113, 291, 1993, 3277, 13155, 1039, 42367, 130477}}, {8363, 17, 22533, {1, 1, 1, 3, 29, 19, 15, 159, 35, 153, 1177, 3011, 6271, 8203, 8971, 19183, 102871}}, {8364, 17, 22534, {1, 1, 1, 5, 5, 51, 19, 175, 209, 895, 229, 2355, 499, 7877, 4935, 22737, 35587}}, {8365, 17, 22543, {1, 3, 7, 11, 15, 9, 7, 113, 41, 835, 1593, 3933, 7165, 10959, 15487, 30019, 114505}}, {8366, 17, 22548, {1, 1, 7, 5, 31, 21, 27, 11, 421, 165, 1605, 1859, 29, 13051, 3273, 3893, 56089}}, {8367, 17, 22552, {1, 3, 5, 5, 17, 51, 55, 187, 401, 977, 95, 2617, 727, 9609, 5075, 48989, 120299}}, {8368, 17, 22558, {1, 1, 5, 7, 21, 31, 127, 87, 379, 125, 247, 3607, 2555, 11873, 32535, 16677, 122273}}, {8369, 17, 22561, {1, 1, 1, 5, 19, 21, 51, 185, 203, 145, 1073, 167, 235, 12753, 17315, 14683, 44101}}, {8370, 17, 22562, {1, 3, 3, 1, 5, 61, 71, 17, 63, 151, 823, 17, 5315, 4861, 17279, 23049, 84971}}, {8371, 17, 22568, {1, 3, 3, 5, 21, 63, 21, 235, 295, 467, 1661, 2487, 335, 6107, 28709, 55875, 129085}}, {8372, 17, 22571, {1, 3, 3, 5, 1, 55, 35, 187, 5, 687, 1633, 2999, 4513, 10105, 15249, 22591, 102857}}, {8373, 17, 22574, {1, 3, 1, 5, 19, 1, 113, 27, 261, 623, 831, 3011, 4091, 11967, 17191, 17433, 99925}}, {8374, 17, 22581, {1, 3, 5, 5, 25, 59, 81, 249, 463, 523, 183, 3049, 3675, 2705, 28379, 1279, 25579}}, {8375, 17, 22594, {1, 1, 3, 9, 19, 19, 71, 127, 189, 613, 647, 1449, 7755, 1415, 9067, 30683, 79703}}, {8376, 17, 22603, {1, 1, 7, 1, 27, 33, 61, 135, 233, 633, 1969, 2245, 5841, 14069, 6497, 63617, 101483}}, {8377, 17, 22605, {1, 3, 3, 9, 23, 3, 17, 163, 309, 741, 2023, 2647, 5847, 7871, 22311, 38377, 70663}}, {8378, 17, 22606, {1, 3, 5, 15, 31, 33, 51, 243, 209, 273, 1305, 1599, 6115, 6249, 8639, 5903, 17215}}, {8379, 17, 22623, {1, 1, 1, 1, 21, 11, 107, 185, 463, 435, 149, 3789, 6283, 1327, 20893, 10417, 78673}}, {8380, 17, 22630, {1, 1, 1, 13, 5, 53, 121, 129, 493, 419, 1711, 2765, 7673, 8979, 25845, 62759, 9669}}, {8381, 17, 22651, {1, 3, 5, 5, 1, 39, 123, 47, 449, 639, 625, 2355, 511, 1685, 1415, 32417, 76529}}, {8382, 17, 22657, {1, 3, 1, 11, 1, 49, 67, 237, 203, 967, 1401, 2773, 4951, 13889, 14147, 41031, 71897}}, {8383, 17, 22669, {1, 3, 5, 11, 13, 49, 17, 113, 315, 207, 1057, 3395, 6151, 2767, 16571, 1811, 66403}}, {8384, 17, 22670, {1, 1, 7, 7, 29, 63, 49, 115, 327, 987, 1853, 3355, 8139, 2703, 30039, 51343, 86999}}, {8385, 17, 22677, {1, 1, 3, 9, 1, 3, 45, 35, 509, 483, 159, 1795, 8023, 6989, 3755, 20887, 13587}}, {8386, 17, 22682, {1, 1, 3, 7, 1, 27, 39, 159, 283, 843, 317, 3229, 2297, 15031, 22039, 21721, 70583}}, {8387, 17, 22698, {1, 1, 3, 11, 9, 23, 1, 35, 79, 77, 1671, 2583, 647, 12313, 16271, 2959, 108389}}, {8388, 17, 22712, {1, 1, 1, 7, 5, 55, 1, 233, 429, 231, 833, 1279, 7815, 1051, 30627, 4435, 25997}}, {8389, 17, 22715, {1, 3, 1, 15, 19, 53, 9, 165, 307, 437, 551, 2477, 1841, 11799, 18477, 5871, 20065}}, {8390, 17, 22729, {1, 1, 1, 1, 21, 5, 65, 41, 77, 909, 93, 751, 2973, 7341, 30427, 60075, 71457}}, {8391, 17, 22732, {1, 1, 3, 11, 25, 51, 49, 63, 165, 263, 1915, 747, 8053, 6361, 4843, 20189, 110147}}, {8392, 17, 22735, {1, 3, 1, 9, 29, 9, 45, 177, 415, 557, 1555, 2967, 1239, 8115, 12853, 19193, 73681}}, {8393, 17, 22738, {1, 1, 5, 5, 11, 5, 51, 157, 325, 517, 1601, 3911, 1487, 13631, 7483, 61515, 48937}}, {8394, 17, 22740, {1, 3, 7, 5, 29, 31, 107, 47, 437, 837, 1791, 477, 1717, 7, 25855, 48793, 16385}}, {8395, 17, 22750, {1, 1, 1, 3, 29, 49, 31, 255, 233, 935, 1993, 125, 2255, 12785, 2807, 54697, 62591}}, {8396, 17, 22753, {1, 3, 1, 7, 15, 13, 9, 245, 79, 289, 841, 253, 5259, 16123, 29189, 63837, 127915}}, {8397, 17, 22760, {1, 3, 7, 15, 15, 55, 91, 103, 445, 289, 1471, 423, 3387, 15609, 19311, 28993, 23473}}, {8398, 17, 22765, {1, 1, 3, 11, 31, 39, 69, 125, 115, 309, 397, 3417, 5693, 10301, 1489, 25955, 2699}}, {8399, 17, 22768, {1, 3, 3, 5, 13, 21, 51, 207, 239, 311, 1601, 2925, 6285, 9597, 30579, 62957, 6153}}, {8400, 17, 22778, {1, 1, 7, 1, 27, 21, 63, 143, 399, 971, 1385, 1875, 5143, 6423, 6223, 27009, 14237}}, {8401, 17, 22785, {1, 3, 5, 1, 5, 59, 125, 133, 151, 997, 1315, 3007, 8173, 16289, 13409, 839, 103519}}, {8402, 17, 22809, {1, 1, 1, 13, 7, 57, 83, 33, 191, 121, 939, 3927, 6089, 10083, 5903, 52229, 78325}}, {8403, 17, 22810, {1, 1, 3, 5, 9, 61, 43, 107, 279, 135, 1109, 3779, 5305, 15333, 12217, 41257, 20265}}, {8404, 17, 22812, {1, 3, 7, 1, 31, 59, 83, 43, 219, 119, 511, 2973, 4587, 10701, 30959, 21489, 124077}}, {8405, 17, 22828, {1, 1, 7, 9, 17, 3, 59, 151, 281, 209, 1405, 173, 3589, 7679, 29803, 53947, 68291}}, {8406, 17, 22840, {1, 1, 7, 7, 5, 19, 53, 91, 1, 513, 1495, 231, 3627, 1115, 16121, 12953, 108343}}, {8407, 17, 22845, {1, 3, 1, 13, 17, 3, 35, 35, 211, 481, 2029, 1035, 3131, 5653, 18097, 10735, 102453}}, {8408, 17, 22848, {1, 3, 1, 11, 29, 7, 121, 135, 51, 837, 681, 1497, 7435, 2215, 26527, 33029, 93241}}, {8409, 17, 22857, {1, 3, 3, 15, 29, 43, 17, 243, 195, 315, 499, 3801, 5691, 12119, 4061, 51769, 80497}}, {8410, 17, 22877, {1, 1, 3, 1, 11, 1, 113, 11, 387, 579, 275, 2995, 895, 11859, 4017, 1543, 11853}}, {8411, 17, 22882, {1, 1, 7, 9, 31, 27, 63, 217, 97, 275, 435, 1355, 5205, 6587, 32589, 46485, 103587}}, {8412, 17, 22887, {1, 3, 7, 3, 7, 19, 51, 41, 81, 261, 1909, 1475, 425, 3173, 5679, 34701, 34977}}, {8413, 17, 22894, {1, 1, 7, 3, 27, 15, 35, 49, 387, 471, 1997, 3643, 2701, 11853, 21311, 36027, 104357}}, {8414, 17, 22912, {1, 3, 1, 9, 5, 47, 73, 163, 309, 891, 229, 2433, 6715, 6721, 25233, 37043, 29367}}, {8415, 17, 22930, {1, 1, 1, 7, 27, 15, 9, 185, 421, 597, 565, 143, 1531, 15585, 17057, 54309, 82915}}, {8416, 17, 22936, {1, 1, 7, 1, 5, 43, 87, 61, 121, 341, 25, 3795, 7161, 11985, 32197, 789, 69543}}, {8417, 17, 22939, {1, 3, 5, 13, 29, 39, 81, 39, 263, 729, 1833, 365, 1073, 9869, 1845, 52621, 5}}, {8418, 17, 22957, {1, 1, 7, 7, 5, 33, 117, 11, 371, 161, 1303, 629, 2285, 5827, 32355, 43359, 115595}}, {8419, 17, 22970, {1, 3, 5, 5, 13, 57, 63, 9, 243, 533, 173, 2197, 717, 13441, 22131, 17783, 3319}}, {8420, 17, 22980, {1, 1, 7, 11, 15, 31, 87, 255, 183, 273, 805, 2347, 5881, 15401, 273, 17397, 41827}}, {8421, 17, 22984, {1, 3, 1, 13, 7, 17, 121, 49, 47, 121, 333, 3629, 5337, 4117, 2735, 36581, 61345}}, {8422, 17, 22992, {1, 3, 3, 11, 9, 7, 25, 223, 379, 119, 385, 1217, 4803, 2947, 30665, 7733, 77893}}, {8423, 17, 22998, {1, 3, 3, 7, 31, 35, 127, 97, 5, 373, 7, 3035, 843, 5991, 9265, 34289, 42785}}, {8424, 17, 23001, {1, 3, 7, 3, 27, 19, 95, 253, 349, 871, 807, 413, 5847, 10467, 4277, 12429, 75773}}, {8425, 17, 23044, {1, 3, 3, 7, 21, 1, 79, 89, 219, 505, 41, 505, 5159, 12839, 3317, 49873, 73705}}, {8426, 17, 23061, {1, 3, 1, 7, 21, 43, 121, 113, 477, 559, 1831, 3759, 3315, 6367, 7149, 16395, 44703}}, {8427, 17, 23062, {1, 1, 1, 7, 13, 53, 35, 53, 489, 975, 631, 863, 3067, 1905, 21351, 14705, 80041}}, {8428, 17, 23071, {1, 1, 1, 5, 13, 27, 121, 65, 351, 123, 1731, 367, 8061, 5229, 8537, 20897, 130373}}, {8429, 17, 23075, {1, 1, 5, 11, 15, 63, 101, 107, 105, 619, 1771, 3549, 7191, 9083, 16827, 29639, 34219}}, {8430, 17, 23089, {1, 3, 1, 9, 15, 13, 87, 157, 379, 433, 217, 815, 5079, 1797, 26707, 35165, 92305}}, {8431, 17, 23090, {1, 1, 5, 13, 27, 35, 31, 65, 313, 629, 375, 1391, 5373, 3497, 7311, 23105, 45293}}, {8432, 17, 23096, {1, 3, 1, 3, 5, 39, 91, 37, 401, 419, 949, 2431, 3685, 6671, 20789, 8597, 44215}}, {8433, 17, 23101, {1, 1, 7, 11, 7, 15, 3, 181, 363, 913, 309, 2009, 3805, 6651, 27677, 37711, 40813}}, {8434, 17, 23114, {1, 3, 5, 5, 17, 11, 47, 9, 27, 459, 773, 1403, 7069, 12651, 8163, 42425, 126697}}, {8435, 17, 23121, {1, 3, 1, 3, 11, 21, 65, 103, 405, 843, 59, 3653, 1759, 5265, 401, 58019, 124999}}, {8436, 17, 23124, {1, 1, 3, 7, 11, 25, 61, 211, 199, 849, 1835, 1181, 5003, 3873, 23743, 45451, 54901}}, {8437, 17, 23127, {1, 3, 5, 3, 29, 25, 43, 199, 481, 991, 699, 3937, 7601, 1253, 24399, 6625, 93917}}, {8438, 17, 23128, {1, 1, 7, 3, 29, 33, 33, 151, 3, 825, 743, 773, 7825, 8157, 22121, 50095, 16435}}, {8439, 17, 23137, {1, 3, 1, 1, 27, 15, 81, 151, 271, 167, 1755, 1289, 7473, 8525, 12525, 63139, 48787}}, {8440, 17, 23138, {1, 1, 7, 13, 27, 33, 87, 125, 211, 631, 149, 3451, 643, 6975, 2659, 12629, 33187}}, {8441, 17, 23150, {1, 1, 3, 3, 5, 49, 99, 99, 85, 647, 351, 2829, 7005, 7283, 5857, 46157, 52061}}, {8442, 17, 23155, {1, 1, 3, 5, 11, 37, 43, 129, 21, 639, 187, 2279, 8189, 12877, 28707, 7133, 93639}}, {8443, 17, 23168, {1, 1, 3, 7, 19, 13, 35, 51, 77, 811, 1553, 2769, 763, 4965, 4643, 37639, 44229}}, {8444, 17, 23173, {1, 3, 5, 15, 11, 29, 103, 203, 435, 1017, 531, 1453, 1407, 6569, 619, 52103, 45213}}, {8445, 17, 23174, {1, 1, 7, 5, 25, 25, 47, 229, 201, 843, 473, 2637, 2265, 4627, 20013, 41217, 76095}}, {8446, 17, 23195, {1, 3, 3, 15, 23, 61, 109, 31, 57, 595, 1303, 3915, 67, 8205, 3553, 9543, 103385}}, {8447, 17, 23202, {1, 1, 3, 3, 21, 19, 21, 41, 137, 905, 2045, 491, 1783, 151, 20963, 38009, 735}}, {8448, 17, 23225, {1, 1, 7, 11, 13, 33, 95, 251, 179, 211, 1687, 3189, 6213, 3905, 2117, 15153, 4855}}, {8449, 17, 23226, {1, 1, 5, 3, 19, 9, 67, 243, 23, 611, 1007, 1317, 7303, 11065, 21157, 56677, 81683}}, {8450, 17, 23239, {1, 1, 3, 5, 19, 41, 63, 129, 233, 15, 37, 1445, 1095, 11309, 30181, 49199, 85113}}, {8451, 17, 23253, {1, 3, 7, 1, 21, 53, 83, 79, 155, 379, 773, 1823, 1003, 2787, 31107, 36115, 40987}}, {8452, 17, 23263, {1, 3, 3, 5, 3, 19, 7, 247, 417, 573, 407, 3577, 6079, 10275, 29791, 35149, 102565}}, {8453, 17, 23264, {1, 3, 3, 9, 21, 49, 57, 223, 125, 671, 655, 2995, 5849, 5355, 21171, 54857, 114841}}, {8454, 17, 23281, {1, 3, 7, 3, 27, 23, 125, 103, 485, 955, 963, 1865, 2321, 2263, 32497, 47973, 122111}}, {8455, 17, 23282, {1, 1, 3, 15, 3, 1, 37, 19, 287, 165, 1717, 851, 3619, 13623, 24295, 48253, 13143}}, {8456, 17, 23288, {1, 1, 7, 9, 13, 59, 69, 97, 113, 163, 871, 1795, 2719, 13675, 11767, 23687, 65841}}, {8457, 17, 23294, {1, 1, 5, 3, 21, 31, 41, 115, 469, 177, 137, 2129, 1385, 10835, 16471, 59411, 30795}}, {8458, 17, 23302, {1, 1, 7, 7, 13, 45, 73, 119, 457, 673, 1481, 3735, 2675, 11413, 9069, 34741, 8757}}, {8459, 17, 23311, {1, 3, 5, 3, 15, 9, 11, 191, 499, 51, 1963, 3957, 1341, 7129, 13491, 65369, 4339}}, {8460, 17, 23320, {1, 3, 7, 1, 5, 45, 103, 209, 183, 205, 525, 2417, 847, 10801, 10699, 16723, 36421}}, {8461, 17, 23325, {1, 3, 7, 13, 3, 57, 37, 75, 299, 359, 2017, 125, 6737, 4859, 18443, 20765, 40319}}, {8462, 17, 23356, {1, 1, 3, 5, 5, 17, 43, 141, 31, 141, 1019, 1685, 6831, 9433, 31245, 29227, 64083}}, {8463, 17, 23374, {1, 3, 1, 13, 25, 47, 107, 69, 459, 595, 1759, 3391, 1531, 15197, 25975, 16971, 70861}}, {8464, 17, 23388, {1, 1, 3, 11, 3, 53, 63, 211, 69, 469, 1407, 1435, 2763, 917, 19943, 16591, 97101}}, {8465, 17, 23402, {1, 3, 5, 13, 25, 41, 39, 61, 319, 809, 1109, 169, 3101, 8801, 21697, 50759, 130985}}, {8466, 17, 23415, {1, 3, 1, 9, 23, 1, 11, 249, 243, 605, 1419, 269, 1601, 2063, 5365, 38077, 106161}}, {8467, 17, 23421, {1, 1, 7, 7, 19, 55, 97, 155, 477, 845, 61, 263, 1337, 8857, 31611, 44417, 43111}}, {8468, 17, 23426, {1, 3, 3, 15, 7, 63, 45, 239, 291, 279, 1875, 3769, 1571, 15857, 13335, 17209, 34399}}, {8469, 17, 23443, {1, 1, 7, 11, 19, 19, 69, 111, 217, 927, 1643, 1077, 4763, 15893, 17491, 39737, 10705}}, {8470, 17, 23446, {1, 1, 5, 11, 3, 3, 31, 199, 109, 403, 973, 3833, 2729, 7285, 26743, 53915, 96203}}, {8471, 17, 23455, {1, 3, 3, 11, 9, 7, 19, 145, 495, 805, 381, 919, 1323, 4343, 15887, 5163, 68267}}, {8472, 17, 23461, {1, 1, 3, 11, 15, 31, 27, 201, 251, 279, 1377, 1313, 7143, 9731, 10451, 63431, 31307}}, {8473, 17, 23468, {1, 1, 7, 1, 1, 55, 35, 249, 133, 645, 425, 279, 6401, 11687, 751, 947, 21791}}, {8474, 17, 23471, {1, 3, 5, 9, 5, 43, 89, 31, 419, 573, 1087, 2197, 3451, 2393, 6569, 4859, 36607}}, {8475, 17, 23485, {1, 3, 5, 15, 25, 51, 11, 149, 483, 789, 661, 967, 3537, 15511, 26587, 29861, 120337}}, {8476, 17, 23486, {1, 3, 5, 13, 21, 39, 75, 111, 57, 321, 1591, 381, 7399, 10807, 26651, 62489, 78341}}, {8477, 17, 23488, {1, 3, 1, 13, 1, 1, 49, 137, 193, 967, 805, 221, 803, 11381, 27803, 51013, 10475}}, {8478, 17, 23498, {1, 3, 7, 5, 3, 13, 47, 195, 123, 753, 397, 1203, 981, 12863, 20845, 36155, 19055}}, {8479, 17, 23500, {1, 1, 1, 9, 9, 11, 53, 203, 3, 163, 1537, 2061, 941, 12629, 16053, 34881, 31489}}, {8480, 17, 23515, {1, 1, 1, 15, 5, 23, 51, 197, 459, 21, 1989, 2529, 4267, 1505, 8951, 15777, 20493}}, {8481, 17, 23521, {1, 1, 7, 3, 31, 55, 9, 55, 217, 695, 1563, 4077, 3207, 7029, 10881, 39581, 82511}}, {8482, 17, 23527, {1, 3, 1, 5, 1, 11, 81, 1, 505, 631, 1093, 3655, 2085, 7349, 5009, 49381, 30527}}, {8483, 17, 23534, {1, 1, 7, 1, 27, 51, 25, 235, 213, 59, 611, 3883, 2909, 6411, 19605, 49001, 114529}}, {8484, 17, 23546, {1, 3, 5, 3, 25, 29, 19, 137, 199, 681, 1625, 2711, 4873, 14677, 9767, 30441, 54673}}, {8485, 17, 23559, {1, 1, 1, 9, 27, 43, 109, 161, 139, 675, 741, 2839, 1425, 5701, 19897, 12787, 33069}}, {8486, 17, 23560, {1, 3, 5, 11, 21, 19, 77, 107, 197, 591, 1899, 1311, 3347, 6369, 26891, 3771, 32455}}, {8487, 17, 23566, {1, 1, 7, 15, 31, 13, 109, 69, 207, 349, 249, 971, 7891, 10919, 31579, 38453, 124601}}, {8488, 17, 23584, {1, 3, 5, 5, 27, 61, 67, 193, 53, 259, 1729, 4033, 2637, 8217, 22351, 4001, 118527}}, {8489, 17, 23587, {1, 1, 3, 5, 9, 45, 55, 73, 189, 131, 1947, 1889, 837, 4085, 10393, 64359, 1037}}, {8490, 17, 23594, {1, 3, 7, 3, 13, 51, 55, 37, 335, 939, 35, 461, 5057, 2595, 3305, 58823, 3941}}, {8491, 17, 23602, {1, 1, 7, 11, 7, 3, 121, 139, 241, 477, 615, 2707, 5391, 7611, 11563, 41083, 16719}}, {8492, 17, 23607, {1, 3, 3, 15, 27, 55, 13, 221, 195, 543, 215, 4035, 1647, 8111, 26425, 43571, 79893}}, {8493, 17, 23616, {1, 1, 1, 5, 31, 5, 35, 145, 481, 339, 1951, 2155, 1309, 9851, 31505, 37371, 21247}}, {8494, 17, 23621, {1, 1, 7, 9, 7, 5, 73, 119, 3, 741, 1351, 2855, 2207, 1465, 12047, 13507, 129173}}, {8495, 17, 23631, {1, 1, 7, 13, 5, 57, 119, 63, 367, 327, 1257, 3191, 6929, 9593, 16565, 54397, 100305}}, {8496, 17, 23634, {1, 3, 1, 11, 9, 1, 85, 53, 65, 945, 17, 1963, 4819, 16173, 11669, 53579, 33701}}, {8497, 17, 23636, {1, 1, 3, 15, 25, 27, 3, 25, 23, 429, 197, 2717, 6107, 6719, 12457, 31793, 78647}}, {8498, 17, 23649, {1, 1, 3, 1, 7, 63, 111, 235, 299, 91, 369, 1423, 7083, 4229, 18535, 33793, 19943}}, {8499, 17, 23652, {1, 1, 7, 13, 9, 11, 123, 9, 169, 895, 1989, 1047, 6139, 11773, 19381, 9593, 14809}}, {8500, 17, 23679, {1, 3, 1, 3, 29, 31, 63, 91, 59, 391, 1695, 2459, 3301, 5615, 3425, 8029, 16069}}, {8501, 17, 23686, {1, 1, 7, 1, 25, 25, 79, 49, 131, 695, 987, 2911, 1109, 8237, 18227, 37287, 22443}}, {8502, 17, 23697, {1, 3, 3, 3, 25, 21, 33, 207, 187, 381, 129, 445, 2967, 5119, 18777, 14849, 97115}}, {8503, 17, 23703, {1, 1, 7, 13, 19, 9, 93, 185, 391, 579, 1509, 3245, 3921, 9473, 4795, 6685, 49549}}, {8504, 17, 23714, {1, 1, 5, 11, 1, 49, 57, 127, 363, 811, 1383, 2869, 7625, 15177, 2581, 64253, 53677}}, {8505, 17, 23719, {1, 1, 7, 3, 7, 27, 73, 187, 31, 1011, 1013, 3269, 6625, 5001, 20805, 13331, 93725}}, {8506, 17, 23723, {1, 3, 7, 1, 23, 61, 123, 9, 141, 113, 1009, 3713, 4947, 9929, 24125, 1101, 104249}}, {8507, 17, 23726, {1, 3, 7, 3, 23, 17, 25, 187, 189, 875, 1435, 163, 4197, 6619, 29031, 23117, 45347}}, {8508, 17, 23728, {1, 1, 5, 7, 11, 17, 9, 55, 117, 223, 417, 3993, 1843, 5817, 20435, 56705, 98337}}, {8509, 17, 23733, {1, 1, 7, 3, 21, 59, 3, 77, 297, 61, 407, 1603, 3209, 1611, 30185, 50275, 56139}}, {8510, 17, 23740, {1, 1, 1, 5, 31, 3, 101, 167, 367, 543, 339, 1885, 7855, 9989, 30969, 6735, 108123}}, {8511, 17, 23751, {1, 1, 3, 9, 27, 63, 9, 79, 335, 351, 673, 3107, 3955, 1799, 16879, 57631, 109073}}, {8512, 17, 23755, {1, 1, 1, 3, 27, 17, 107, 115, 155, 371, 379, 2837, 6213, 2663, 1101, 451, 69517}}, {8513, 17, 23765, {1, 1, 3, 9, 13, 3, 55, 9, 449, 43, 1011, 3281, 5311, 223, 10715, 6639, 79949}}, {8514, 17, 23766, {1, 3, 3, 11, 23, 9, 43, 185, 271, 1005, 1041, 2633, 377, 4247, 10417, 51903, 19239}}, {8515, 17, 23769, {1, 3, 1, 9, 15, 39, 115, 233, 33, 425, 1979, 583, 1901, 8943, 1527, 56065, 50159}}, {8516, 17, 23779, {1, 1, 3, 1, 13, 1, 105, 149, 13, 625, 671, 1811, 3701, 241, 27357, 25835, 127265}}, {8517, 17, 23794, {1, 3, 1, 9, 11, 23, 107, 197, 21, 589, 1065, 2591, 1163, 15013, 8931, 6355, 87079}}, {8518, 17, 23796, {1, 3, 5, 3, 17, 5, 121, 61, 99, 987, 2033, 2237, 2299, 14689, 19785, 9599, 101035}}, {8519, 17, 23803, {1, 1, 1, 1, 17, 25, 5, 97, 55, 75, 1419, 2793, 7215, 3185, 7029, 23023, 89089}}, {8520, 17, 23813, {1, 3, 3, 3, 11, 57, 103, 191, 405, 463, 1421, 253, 6069, 10905, 18193, 719, 17337}}, {8521, 17, 23820, {1, 3, 5, 11, 23, 37, 39, 169, 295, 527, 1671, 3913, 6057, 689, 27719, 47245, 95895}}, {8522, 17, 23841, {1, 3, 7, 5, 13, 9, 43, 189, 411, 155, 559, 3701, 1623, 2401, 10359, 22675, 41897}}, {8523, 17, 23853, {1, 1, 1, 11, 17, 55, 47, 101, 357, 669, 857, 2745, 6425, 11839, 13095, 10757, 52383}}, {8524, 17, 23861, {1, 1, 7, 5, 11, 13, 53, 151, 93, 455, 133, 3353, 1417, 7917, 12913, 2615, 34281}}, {8525, 17, 23862, {1, 1, 3, 5, 29, 57, 43, 35, 203, 423, 311, 3133, 1757, 1291, 2019, 3115, 126939}}, {8526, 17, 23873, {1, 1, 3, 11, 9, 43, 119, 95, 135, 351, 1865, 2821, 717, 6275, 19713, 42315, 97935}}, {8527, 17, 23876, {1, 3, 7, 7, 31, 51, 7, 29, 405, 31, 1765, 3231, 1315, 1307, 26469, 62033, 35619}}, {8528, 17, 23897, {1, 1, 5, 7, 5, 17, 49, 137, 501, 631, 1401, 2851, 6971, 14721, 4329, 26483, 120007}}, {8529, 17, 23898, {1, 1, 5, 13, 21, 19, 95, 93, 125, 331, 1797, 1653, 1891, 11081, 30989, 24671, 95421}}, {8530, 17, 23903, {1, 3, 3, 11, 13, 29, 61, 157, 165, 39, 661, 89, 637, 1397, 12561, 62399, 129107}}, {8531, 17, 23904, {1, 3, 1, 15, 13, 19, 5, 115, 345, 903, 531, 4069, 6775, 7433, 569, 21779, 13271}}, {8532, 17, 23910, {1, 3, 3, 9, 5, 53, 17, 115, 67, 939, 1907, 3979, 4311, 3573, 857, 34931, 112397}}, {8533, 17, 23931, {1, 3, 7, 11, 9, 47, 83, 85, 277, 219, 1701, 3013, 3037, 3473, 3797, 40713, 118573}}, {8534, 17, 23933, {1, 1, 3, 13, 25, 33, 117, 115, 179, 119, 487, 3213, 2873, 17, 20865, 20043, 64381}}, {8535, 17, 23934, {1, 1, 1, 3, 1, 45, 73, 103, 75, 579, 981, 2449, 2141, 8697, 22995, 59693, 104461}}, {8536, 17, 23943, {1, 3, 1, 1, 29, 9, 9, 201, 55, 389, 1069, 2057, 4149, 9217, 10753, 7889, 95849}}, {8537, 17, 23952, {1, 3, 7, 9, 27, 39, 19, 223, 7, 253, 55, 503, 3339, 6049, 32603, 34807, 115403}}, {8538, 17, 23955, {1, 1, 5, 3, 13, 21, 67, 87, 205, 309, 1371, 1579, 281, 16135, 28403, 25951, 24109}}, {8539, 17, 23962, {1, 3, 1, 3, 17, 21, 49, 77, 393, 943, 1701, 2661, 5173, 12875, 2731, 40531, 19301}}, {8540, 17, 23971, {1, 3, 1, 5, 23, 29, 61, 161, 373, 389, 1699, 359, 2513, 4717, 30397, 24395, 20881}}, {8541, 17, 23978, {1, 3, 5, 5, 29, 3, 115, 251, 277, 487, 7, 3301, 7945, 14233, 20497, 62035, 21537}}, {8542, 17, 23998, {1, 1, 1, 9, 7, 59, 23, 85, 367, 109, 1761, 4011, 6535, 8263, 2081, 63647, 69807}}, {8543, 17, 24003, {1, 1, 7, 11, 21, 41, 29, 219, 271, 617, 929, 407, 2899, 14299, 7645, 44815, 58817}}, {8544, 17, 24009, {1, 3, 5, 7, 11, 29, 119, 33, 261, 571, 2013, 3327, 2181, 12767, 93, 2437, 76533}}, {8545, 17, 24017, {1, 1, 7, 13, 17, 39, 55, 203, 261, 917, 967, 3651, 7235, 13751, 14439, 7591, 96553}}, {8546, 17, 24045, {1, 1, 1, 1, 11, 39, 19, 21, 125, 93, 1773, 1155, 6213, 7173, 9057, 6219, 4643}}, {8547, 17, 24046, {1, 3, 1, 5, 1, 31, 55, 143, 425, 539, 61, 3377, 7647, 257, 15007, 24511, 8707}}, {8548, 17, 24060, {1, 3, 3, 11, 27, 51, 103, 197, 427, 139, 181, 1169, 3123, 11803, 5285, 1321, 62267}}, {8549, 17, 24064, {1, 3, 5, 9, 11, 3, 13, 149, 197, 37, 31, 927, 3313, 16149, 14209, 60177, 46525}}, {8550, 17, 24076, {1, 1, 5, 13, 15, 29, 103, 49, 355, 797, 1253, 1833, 621, 3877, 9981, 49207, 91035}}, {8551, 17, 24079, {1, 1, 3, 3, 13, 19, 27, 51, 151, 275, 35, 3755, 7511, 14197, 26141, 43765, 104327}}, {8552, 17, 24087, {1, 3, 5, 15, 23, 47, 101, 213, 97, 957, 831, 1533, 7913, 15763, 29717, 60425, 38559}}, {8553, 17, 24094, {1, 1, 7, 9, 29, 31, 49, 245, 361, 299, 151, 2969, 1487, 1761, 11697, 4043, 100909}}, {8554, 17, 24100, {1, 1, 1, 3, 17, 49, 99, 159, 3, 525, 1527, 3435, 5113, 459, 13341, 54103, 85813}}, {8555, 17, 24118, {1, 3, 1, 1, 5, 59, 35, 75, 107, 91, 1621, 3261, 619, 3271, 10813, 29857, 1547}}, {8556, 17, 24121, {1, 1, 5, 9, 9, 33, 85, 245, 39, 879, 1621, 2587, 3825, 12939, 30113, 24611, 68491}}, {8557, 17, 24132, {1, 3, 1, 3, 9, 39, 93, 241, 307, 237, 3, 1763, 7729, 9257, 31911, 32591, 77333}}, {8558, 17, 24147, {1, 3, 1, 3, 27, 7, 51, 121, 317, 361, 1027, 95, 7035, 3097, 21007, 38311, 88287}}, {8559, 17, 24165, {1, 3, 7, 3, 19, 3, 111, 115, 339, 793, 1571, 3101, 1911, 14929, 12841, 45871, 119905}}, {8560, 17, 24172, {1, 1, 5, 7, 31, 61, 37, 143, 279, 941, 1215, 2411, 7617, 1657, 10189, 19139, 6307}}, {8561, 17, 24177, {1, 1, 3, 9, 21, 35, 13, 157, 187, 79, 689, 1085, 37, 4549, 5901, 15321, 61627}}, {8562, 17, 24184, {1, 3, 1, 13, 15, 39, 21, 231, 39, 327, 801, 2321, 587, 1877, 3489, 54467, 95773}}, {8563, 17, 24187, {1, 1, 5, 7, 1, 9, 53, 1, 243, 365, 789, 3833, 317, 10697, 26567, 65187, 22507}}, {8564, 17, 24213, {1, 3, 3, 7, 9, 41, 31, 135, 425, 939, 15, 2043, 6593, 7651, 25467, 62549, 35847}}, {8565, 17, 24217, {1, 1, 1, 7, 15, 23, 19, 57, 421, 25, 1037, 3055, 6173, 12451, 485, 54567, 109561}}, {8566, 17, 24223, {1, 3, 5, 1, 3, 29, 67, 233, 157, 677, 1711, 513, 4673, 2895, 1983, 31075, 1861}}, {8567, 17, 24230, {1, 1, 1, 1, 7, 39, 115, 251, 275, 791, 15, 1685, 6835, 14685, 12607, 28213, 121475}}, {8568, 17, 24234, {1, 1, 5, 5, 13, 11, 103, 93, 489, 709, 1339, 2407, 1663, 10195, 3135, 15531, 88427}}, {8569, 17, 24241, {1, 1, 7, 7, 17, 1, 123, 143, 31, 721, 1739, 2273, 3785, 10261, 14741, 52573, 113677}}, {8570, 17, 24248, {1, 3, 7, 3, 9, 21, 77, 13, 241, 429, 165, 3399, 7543, 2633, 21129, 13537, 84473}}, {8571, 17, 24259, {1, 1, 1, 11, 21, 33, 125, 123, 189, 337, 163, 3727, 2101, 14113, 1719, 46017, 68601}}, {8572, 17, 24262, {1, 1, 7, 9, 9, 53, 101, 111, 125, 605, 1419, 3901, 1769, 4585, 20063, 20857, 21901}}, {8573, 17, 24271, {1, 3, 7, 11, 1, 19, 51, 7, 457, 119, 871, 3847, 57, 11437, 28763, 58831, 675}}, {8574, 17, 24279, {1, 3, 1, 15, 25, 63, 69, 25, 405, 823, 1701, 2441, 7561, 8679, 31643, 29325, 25563}}, {8575, 17, 24286, {1, 1, 3, 9, 15, 5, 89, 13, 73, 951, 959, 2693, 4565, 13095, 991, 12419, 8267}}, {8576, 17, 24289, {1, 1, 7, 1, 15, 1, 119, 223, 213, 585, 1047, 2623, 4141, 2043, 1583, 59155, 5133}}, {8577, 17, 24295, {1, 3, 3, 3, 17, 37, 81, 233, 87, 843, 1597, 1251, 4713, 10813, 24357, 48499, 84465}}, {8578, 17, 24296, {1, 1, 1, 1, 11, 55, 125, 5, 255, 809, 543, 2351, 7079, 7801, 29247, 23937, 97405}}, {8579, 17, 24299, {1, 3, 3, 5, 17, 55, 87, 245, 371, 679, 943, 655, 5857, 261, 28229, 22519, 35191}}, {8580, 17, 24314, {1, 1, 7, 15, 9, 49, 25, 155, 13, 893, 1303, 2317, 2903, 15601, 1433, 20397, 70125}}, {8581, 17, 24336, {1, 3, 5, 3, 11, 47, 99, 63, 253, 95, 1023, 397, 4307, 4771, 17027, 19833, 18269}}, {8582, 17, 24342, {1, 3, 3, 7, 25, 17, 69, 119, 475, 575, 1637, 3785, 649, 11557, 22457, 38633, 96153}}, {8583, 17, 24346, {1, 1, 1, 5, 31, 55, 85, 83, 307, 201, 1543, 727, 977, 15779, 21907, 31025, 38969}}, {8584, 17, 24357, {1, 3, 5, 1, 7, 53, 107, 239, 341, 237, 1567, 2717, 3197, 12419, 23733, 42119, 86619}}, {8585, 17, 24367, {1, 1, 5, 13, 3, 7, 105, 95, 201, 953, 781, 2043, 5263, 13427, 10303, 60027, 19297}}, {8586, 17, 24370, {1, 1, 5, 15, 25, 51, 5, 77, 165, 297, 1281, 1635, 4139, 11569, 32325, 23135, 27013}}, {8587, 17, 24372, {1, 1, 3, 9, 3, 59, 107, 137, 251, 715, 1477, 511, 5629, 12205, 7541, 62559, 4253}}, {8588, 17, 24387, {1, 1, 7, 11, 31, 29, 7, 251, 119, 547, 1179, 3063, 1625, 8941, 30515, 13601, 72741}}, {8589, 17, 24389, {1, 3, 7, 13, 27, 43, 31, 43, 465, 355, 1063, 2305, 1425, 11963, 27327, 53335, 127517}}, {8590, 17, 24402, {1, 3, 1, 3, 21, 17, 53, 171, 269, 783, 349, 1879, 575, 13537, 16931, 61171, 23499}}, {8591, 17, 24414, {1, 3, 5, 3, 11, 5, 121, 227, 237, 841, 431, 3209, 3241, 6071, 23465, 39533, 102391}}, {8592, 17, 24420, {1, 3, 5, 11, 9, 1, 59, 143, 181, 869, 1859, 1543, 6419, 13305, 29075, 28051, 105799}}, {8593, 17, 24435, {1, 1, 7, 13, 31, 1, 105, 169, 67, 693, 1667, 2181, 4127, 4605, 3701, 36467, 19631}}, {8594, 17, 24437, {1, 1, 7, 5, 31, 15, 119, 161, 55, 549, 1195, 4051, 1923, 2497, 8289, 60393, 96181}}, {8595, 17, 24442, {1, 1, 3, 3, 5, 43, 13, 123, 469, 603, 2047, 2347, 815, 3457, 7503, 25261, 71951}}, {8596, 17, 24444, {1, 1, 7, 3, 13, 25, 85, 141, 497, 405, 957, 1407, 2075, 12445, 6675, 9993, 40429}}, {8597, 17, 24447, {1, 1, 5, 13, 29, 43, 99, 113, 307, 1003, 859, 723, 7513, 12249, 12653, 57685, 89551}}, {8598, 17, 24468, {1, 3, 7, 3, 11, 3, 9, 141, 501, 113, 69, 2285, 4525, 9049, 24765, 11585, 53787}}, {8599, 17, 24475, {1, 1, 3, 1, 25, 41, 103, 159, 215, 871, 77, 1849, 609, 15877, 32515, 22931, 11933}}, {8600, 17, 24484, {1, 1, 5, 11, 3, 27, 27, 111, 479, 861, 1041, 3777, 4443, 3095, 30379, 6293, 30823}}, {8601, 17, 24493, {1, 3, 5, 5, 27, 45, 9, 25, 451, 845, 1153, 897, 325, 15679, 30151, 37695, 54593}}, {8602, 17, 24494, {1, 3, 7, 1, 15, 47, 87, 135, 87, 567, 221, 3173, 769, 8173, 2957, 51287, 20961}}, {8603, 17, 24496, {1, 3, 1, 9, 3, 33, 1, 71, 147, 983, 1485, 3531, 213, 2353, 28269, 49353, 88343}}, {8604, 17, 24514, {1, 1, 3, 11, 11, 63, 109, 255, 35, 127, 1777, 791, 1379, 9539, 4915, 21593, 98901}}, {8605, 17, 24519, {1, 1, 7, 5, 3, 47, 93, 219, 381, 963, 359, 2461, 7629, 2803, 17345, 54311, 79057}}, {8606, 17, 24533, {1, 3, 5, 13, 13, 21, 1, 65, 455, 203, 29, 3717, 4495, 1285, 25289, 38597, 42431}}, {8607, 17, 24538, {1, 1, 3, 3, 27, 57, 7, 171, 65, 469, 1921, 3855, 1637, 5517, 14907, 48239, 117573}}, {8608, 17, 24559, {1, 3, 5, 1, 11, 35, 105, 251, 19, 219, 1191, 2177, 7885, 8399, 30527, 61415, 122215}}, {8609, 17, 24568, {1, 3, 5, 5, 21, 25, 59, 193, 509, 147, 1805, 561, 3505, 9639, 14221, 31, 99261}}, {8610, 17, 24573, {1, 1, 5, 13, 31, 23, 35, 143, 367, 385, 1335, 2497, 3573, 8113, 16661, 16147, 8763}}, {8611, 17, 24577, {1, 1, 7, 13, 15, 27, 35, 15, 7, 539, 633, 1145, 2267, 11527, 20975, 16689, 58227}}, {8612, 17, 24587, {1, 1, 1, 15, 9, 11, 51, 121, 381, 331, 1445, 187, 519, 15827, 27611, 32891, 113671}}, {8613, 17, 24592, {1, 3, 1, 5, 19, 3, 77, 67, 107, 105, 1025, 3229, 6869, 5717, 4227, 28489, 59759}}, {8614, 17, 24601, {1, 1, 5, 15, 25, 23, 7, 25, 103, 733, 525, 453, 6467, 2901, 7197, 33267, 68177}}, {8615, 17, 24602, {1, 1, 5, 7, 27, 27, 41, 93, 449, 733, 571, 411, 1709, 9557, 549, 5925, 24123}}, {8616, 17, 24608, {1, 1, 7, 5, 31, 57, 119, 227, 105, 533, 717, 3357, 2495, 6467, 7211, 38169, 44603}}, {8617, 17, 24645, {1, 1, 5, 7, 29, 9, 125, 241, 471, 571, 1271, 2911, 8087, 5067, 31139, 39681, 28579}}, {8618, 17, 24650, {1, 3, 5, 11, 25, 53, 109, 35, 183, 109, 1961, 1681, 7773, 6935, 28049, 37279, 96829}}, {8619, 17, 24657, {1, 1, 1, 11, 1, 17, 47, 245, 231, 747, 1395, 1635, 5129, 3165, 627, 34463, 38967}}, {8620, 17, 24664, {1, 3, 5, 1, 9, 41, 25, 215, 251, 525, 1399, 3405, 7399, 11041, 5599, 51167, 38697}}, {8621, 17, 24670, {1, 3, 3, 13, 11, 15, 121, 95, 139, 611, 633, 3941, 2619, 15123, 28535, 64823, 17527}}, {8622, 17, 24673, {1, 3, 7, 13, 21, 53, 65, 175, 81, 5, 699, 1525, 7397, 2465, 4479, 58225, 26387}}, {8623, 17, 24676, {1, 1, 5, 7, 9, 31, 31, 149, 359, 613, 397, 153, 4861, 8195, 22969, 26003, 124423}}, {8624, 17, 24680, {1, 3, 1, 13, 27, 17, 107, 27, 19, 13, 1481, 573, 7701, 6273, 30255, 16125, 11809}}, {8625, 17, 24686, {1, 3, 1, 9, 15, 1, 45, 105, 287, 901, 667, 3197, 3493, 12259, 1511, 63361, 94257}}, {8626, 17, 24700, {1, 3, 1, 3, 25, 53, 19, 87, 365, 585, 1569, 1731, 3747, 11985, 22673, 17767, 113779}}, {8627, 17, 24704, {1, 3, 3, 9, 7, 21, 103, 201, 501, 149, 1939, 3111, 4739, 8389, 27127, 55889, 54487}}, {8628, 17, 24714, {1, 3, 5, 7, 25, 53, 75, 57, 19, 505, 849, 2631, 6999, 11269, 24541, 17695, 97671}}, {8629, 17, 24728, {1, 1, 7, 15, 5, 51, 123, 93, 445, 379, 1729, 2747, 5821, 10779, 29335, 57419, 109339}}, {8630, 17, 24731, {1, 1, 7, 3, 7, 57, 117, 65, 297, 891, 487, 1535, 2361, 10457, 30759, 34571, 129949}}, {8631, 17, 24733, {1, 3, 5, 5, 17, 51, 27, 103, 55, 925, 947, 1237, 1629, 12687, 14775, 49627, 100939}}, {8632, 17, 24747, {1, 3, 3, 15, 1, 11, 75, 177, 399, 55, 1705, 1165, 7525, 8909, 13071, 60703, 11561}}, {8633, 17, 24749, {1, 1, 1, 7, 13, 29, 23, 65, 279, 853, 637, 3947, 4099, 6465, 7061, 50417, 35015}}, {8634, 17, 24750, {1, 1, 3, 3, 15, 11, 111, 169, 135, 279, 1941, 3035, 3027, 6813, 13363, 20387, 3257}}, {8635, 17, 24764, {1, 3, 3, 11, 3, 5, 95, 181, 405, 313, 39, 1503, 2443, 3221, 17021, 23485, 43909}}, {8636, 17, 24782, {1, 1, 1, 3, 17, 63, 27, 247, 441, 533, 449, 3845, 4021, 14269, 31477, 7013, 37473}}, {8637, 17, 24784, {1, 1, 5, 13, 29, 39, 41, 95, 417, 21, 685, 609, 5787, 13145, 32677, 6121, 50919}}, {8638, 17, 24793, {1, 1, 5, 3, 17, 5, 93, 143, 171, 681, 1143, 2875, 805, 15823, 29649, 63327, 12041}}, {8639, 17, 24794, {1, 1, 1, 11, 3, 53, 123, 105, 59, 485, 1799, 2939, 657, 2485, 29563, 36221, 89095}}, {8640, 17, 24810, {1, 1, 5, 5, 15, 13, 127, 87, 211, 579, 175, 793, 6895, 9051, 17681, 28831, 31783}}, {8641, 17, 24817, {1, 3, 7, 5, 11, 37, 9, 219, 453, 697, 139, 335, 6411, 8495, 4203, 29065, 114837}}, {8642, 17, 24820, {1, 1, 3, 5, 31, 25, 89, 215, 249, 271, 1731, 3133, 3947, 10227, 9679, 51303, 82833}}, {8643, 17, 24823, {1, 3, 5, 1, 31, 15, 7, 131, 369, 757, 1963, 3223, 35, 13967, 31807, 5093, 113743}}, {8644, 17, 24832, {1, 1, 7, 3, 15, 23, 21, 173, 295, 929, 1137, 3943, 1985, 13015, 8523, 59117, 127}}, {8645, 17, 24855, {1, 3, 7, 1, 31, 1, 115, 229, 345, 859, 1757, 1835, 7491, 4545, 1483, 40149, 122321}}, {8646, 17, 24859, {1, 1, 1, 3, 13, 5, 3, 133, 177, 47, 1515, 17, 5663, 3185, 2775, 31389, 37409}}, {8647, 17, 24862, {1, 1, 3, 3, 31, 3, 43, 137, 185, 803, 709, 391, 3513, 8117, 32593, 46593, 61037}}, {8648, 17, 24877, {1, 1, 1, 7, 29, 27, 13, 35, 61, 961, 777, 2725, 7379, 7053, 21781, 60285, 49221}}, {8649, 17, 24890, {1, 3, 7, 15, 7, 7, 15, 123, 109, 97, 361, 791, 4773, 8111, 4319, 13981, 92505}}, {8650, 17, 24900, {1, 1, 3, 11, 21, 33, 113, 221, 453, 981, 341, 4041, 5129, 5981, 11051, 17243, 19023}}, {8651, 17, 24904, {1, 3, 1, 1, 19, 7, 75, 213, 467, 221, 1829, 1275, 5729, 6843, 23855, 44805, 89269}}, {8652, 17, 24909, {1, 1, 3, 7, 5, 29, 39, 125, 147, 329, 1485, 2793, 2329, 14979, 18395, 37951, 58699}}, {8653, 17, 24910, {1, 3, 1, 3, 11, 37, 117, 189, 103, 381, 39, 31, 5205, 5601, 17127, 49073, 121417}}, {8654, 17, 24915, {1, 3, 3, 13, 23, 49, 57, 187, 441, 189, 349, 2559, 3313, 1321, 7731, 57309, 80195}}, {8655, 17, 24922, {1, 3, 7, 1, 17, 9, 21, 15, 447, 333, 959, 3471, 5301, 8573, 9761, 23183, 57997}}, {8656, 17, 24937, {1, 3, 1, 9, 19, 1, 101, 71, 325, 309, 85, 2097, 8003, 12249, 1887, 2097, 68375}}, {8657, 17, 24945, {1, 1, 7, 7, 11, 39, 85, 241, 293, 205, 387, 1539, 6583, 1395, 8869, 48843, 49983}}, {8658, 17, 24962, {1, 3, 7, 13, 11, 23, 83, 125, 55, 429, 169, 1893, 4657, 643, 3405, 9943, 128753}}, {8659, 17, 24964, {1, 1, 3, 11, 19, 43, 13, 171, 495, 117, 437, 3697, 6723, 6199, 1859, 39637, 111499}}, {8660, 17, 24991, {1, 1, 1, 5, 1, 31, 83, 199, 129, 941, 1637, 1997, 5011, 14957, 32427, 60797, 4989}}, {8661, 17, 24992, {1, 3, 3, 3, 5, 61, 33, 225, 315, 157, 1709, 807, 7809, 11063, 319, 20901, 73599}}, {8662, 17, 24995, {1, 1, 7, 3, 27, 3, 1, 173, 125, 769, 1203, 3357, 4899, 13115, 7081, 42459, 18525}}, {8663, 17, 25001, {1, 1, 7, 9, 9, 27, 43, 115, 229, 867, 661, 1825, 2883, 4285, 22393, 65141, 24699}}, {8664, 17, 25009, {1, 1, 3, 7, 5, 9, 93, 47, 33, 823, 309, 2977, 5791, 9177, 27645, 35683, 57455}}, {8665, 17, 25019, {1, 1, 5, 7, 9, 53, 9, 77, 499, 1023, 917, 209, 7311, 249, 773, 18303, 41447}}, {8666, 17, 25021, {1, 1, 3, 5, 7, 9, 33, 73, 325, 369, 1657, 2257, 2893, 13911, 10797, 21055, 103511}}, {8667, 17, 25029, {1, 3, 1, 3, 21, 31, 125, 29, 149, 513, 979, 2271, 989, 9541, 4179, 13215, 71369}}, {8668, 17, 25034, {1, 1, 7, 7, 19, 41, 39, 165, 59, 79, 137, 3479, 3389, 6635, 21467, 51073, 20765}}, {8669, 17, 25036, {1, 3, 3, 5, 7, 13, 109, 53, 335, 627, 339, 3825, 287, 6077, 11319, 2377, 112693}}, {8670, 17, 25039, {1, 3, 3, 1, 3, 57, 9, 47, 437, 717, 563, 1219, 6191, 9081, 21533, 2651, 17275}}, {8671, 17, 25057, {1, 1, 1, 5, 21, 9, 109, 109, 339, 947, 1699, 1487, 6477, 12601, 12327, 39427, 80937}}, {8672, 17, 25063, {1, 1, 7, 9, 1, 5, 55, 43, 95, 733, 1151, 3657, 2119, 11947, 21279, 21581, 22053}}, {8673, 17, 25064, {1, 3, 5, 11, 7, 9, 97, 149, 55, 523, 1911, 1389, 5343, 5533, 15439, 65313, 73421}}, {8674, 17, 25075, {1, 1, 3, 7, 19, 15, 119, 141, 57, 243, 423, 981, 1407, 12633, 20455, 53069, 98593}}, {8675, 17, 25077, {1, 1, 3, 3, 15, 57, 71, 203, 15, 133, 601, 805, 2821, 11623, 147, 4333, 97681}}, {8676, 17, 25084, {1, 1, 5, 7, 17, 61, 15, 251, 53, 699, 105, 1195, 3979, 41, 9077, 5145, 80057}}, {8677, 17, 25088, {1, 1, 5, 15, 29, 33, 53, 19, 41, 471, 1143, 65, 5833, 8417, 17263, 35859, 45035}}, {8678, 17, 25091, {1, 1, 1, 1, 15, 51, 73, 131, 181, 147, 1863, 3777, 1749, 10135, 11591, 12395, 85163}}, {8679, 17, 25105, {1, 3, 1, 9, 23, 63, 83, 199, 87, 499, 2025, 863, 4665, 3941, 17647, 52463, 108615}}, {8680, 17, 25134, {1, 3, 5, 7, 11, 39, 65, 161, 367, 593, 699, 1807, 7217, 5221, 22093, 44933, 6201}}, {8681, 17, 25165, {1, 1, 7, 13, 9, 41, 35, 77, 353, 291, 1267, 3923, 5397, 15401, 30317, 14945, 8715}}, {8682, 17, 25183, {1, 3, 1, 15, 11, 3, 29, 25, 505, 945, 1425, 2297, 1133, 4675, 8069, 55115, 114177}}, {8683, 17, 25184, {1, 3, 1, 5, 27, 63, 25, 7, 5, 399, 473, 1325, 7391, 5953, 27755, 65407, 89435}}, {8684, 17, 25202, {1, 3, 3, 13, 21, 61, 5, 119, 23, 999, 849, 1225, 3077, 821, 12059, 43223, 45427}}, {8685, 17, 25204, {1, 3, 7, 13, 1, 5, 93, 173, 181, 453, 1449, 3823, 1713, 14737, 8891, 43643, 1983}}, {8686, 17, 25211, {1, 1, 3, 3, 29, 53, 31, 163, 321, 539, 1283, 429, 3449, 15617, 4761, 21187, 120725}}, {8687, 17, 25223, {1, 1, 1, 1, 13, 27, 49, 37, 33, 631, 375, 425, 2465, 8773, 2777, 2115, 35633}}, {8688, 17, 25224, {1, 3, 5, 3, 25, 25, 27, 201, 63, 259, 1571, 1143, 2325, 6773, 11941, 28897, 19719}}, {8689, 17, 25235, {1, 1, 3, 5, 11, 39, 59, 203, 37, 899, 559, 2599, 4397, 12159, 29579, 51251, 83213}}, {8690, 17, 25241, {1, 1, 1, 7, 9, 19, 63, 169, 257, 921, 381, 3605, 3479, 1739, 26599, 20599, 29617}}, {8691, 17, 25253, {1, 1, 1, 9, 7, 29, 123, 35, 419, 963, 855, 1903, 6199, 2727, 29811, 49279, 101673}}, {8692, 17, 25258, {1, 3, 5, 11, 29, 23, 73, 13, 467, 935, 181, 3837, 8117, 11501, 18361, 26803, 99471}}, {8693, 17, 25277, {1, 1, 1, 5, 31, 41, 109, 45, 115, 113, 1893, 727, 2453, 13463, 22339, 13495, 11473}}, {8694, 17, 25278, {1, 1, 5, 9, 5, 31, 109, 145, 511, 243, 57, 2219, 1601, 1821, 12787, 48239, 89645}}, {8695, 17, 25280, {1, 3, 1, 7, 19, 41, 25, 57, 45, 489, 1531, 3959, 2007, 14247, 13445, 1991, 114977}}, {8696, 17, 25290, {1, 3, 7, 15, 7, 17, 107, 27, 249, 207, 183, 2483, 5817, 8927, 10715, 63631, 51947}}, {8697, 17, 25295, {1, 3, 1, 3, 13, 21, 57, 113, 171, 885, 1335, 783, 7575, 4443, 19497, 13827, 130727}}, {8698, 17, 25300, {1, 1, 5, 7, 19, 33, 95, 13, 387, 297, 1597, 767, 7543, 16063, 10367, 51683, 119811}}, {8699, 17, 25307, {1, 3, 7, 9, 27, 57, 111, 209, 305, 139, 179, 25, 2295, 2593, 31361, 23677, 74501}}, {8700, 17, 25319, {1, 3, 7, 3, 21, 63, 97, 189, 3, 693, 209, 2227, 7169, 9, 32575, 61521, 115155}}, {8701, 17, 25323, {1, 1, 1, 11, 13, 21, 125, 249, 193, 895, 139, 1207, 5941, 5821, 6623, 7753, 80939}}, {8702, 17, 25326, {1, 3, 5, 5, 11, 49, 17, 21, 423, 497, 835, 539, 6195, 12783, 1271, 20069, 2657}}, {8703, 17, 25333, {1, 1, 7, 15, 13, 39, 83, 191, 77, 95, 661, 3627, 1853, 1349, 23109, 43583, 104121}}, {8704, 17, 25334, {1, 3, 1, 15, 31, 15, 71, 255, 489, 91, 351, 367, 309, 6275, 18325, 51231, 52159}}, {8705, 17, 25337, {1, 1, 7, 13, 21, 49, 37, 135, 355, 421, 507, 2563, 4955, 4095, 1933, 29517, 119699}}, {8706, 17, 25348, {1, 1, 1, 1, 27, 41, 15, 161, 475, 635, 863, 3773, 6015, 6197, 24261, 26271, 42375}}, {8707, 17, 25351, {1, 1, 7, 13, 25, 7, 23, 185, 129, 597, 1561, 3003, 2879, 15187, 4913, 24589, 12927}}, {8708, 17, 25372, {1, 1, 3, 3, 9, 23, 49, 233, 345, 83, 823, 2627, 5019, 2365, 23755, 9855, 48515}}, {8709, 17, 25381, {1, 3, 1, 1, 11, 7, 117, 213, 27, 923, 375, 2597, 8173, 8935, 16487, 49283, 104569}}, {8710, 17, 25403, {1, 1, 7, 7, 23, 13, 61, 131, 313, 883, 495, 1105, 6207, 1473, 21655, 51883, 403}}, {8711, 17, 25406, {1, 3, 3, 1, 25, 5, 5, 159, 243, 929, 1429, 1151, 5043, 11551, 21231, 38767, 105299}}, {8712, 17, 25431, {1, 3, 7, 7, 15, 37, 49, 219, 67, 147, 873, 2391, 455, 9565, 8977, 64759, 40347}}, {8713, 17, 25437, {1, 1, 1, 13, 21, 13, 13, 243, 303, 333, 187, 3591, 871, 2501, 30853, 5247, 48855}}, {8714, 17, 25453, {1, 1, 1, 5, 1, 5, 127, 249, 23, 79, 789, 3507, 8119, 5025, 26545, 54009, 100633}}, {8715, 17, 25459, {1, 3, 3, 11, 3, 31, 27, 115, 423, 309, 1805, 169, 789, 4081, 28139, 35355, 47991}}, {8716, 17, 25462, {1, 3, 1, 5, 19, 13, 43, 165, 165, 241, 309, 1703, 7631, 5899, 12041, 21235, 97045}}, {8717, 17, 25466, {1, 3, 1, 13, 15, 49, 29, 199, 93, 611, 77, 2681, 191, 10215, 8115, 11895, 108687}}, {8718, 17, 25477, {1, 1, 3, 3, 13, 45, 15, 151, 345, 111, 1829, 1357, 6317, 5239, 26193, 46763, 73101}}, {8719, 17, 25484, {1, 3, 7, 3, 1, 19, 119, 63, 23, 759, 173, 307, 967, 2731, 9353, 14479, 119}}, {8720, 17, 25495, {1, 3, 5, 15, 5, 21, 127, 21, 419, 575, 991, 3465, 7365, 5711, 30657, 43513, 22447}}, {8721, 17, 25501, {1, 3, 7, 1, 19, 5, 49, 7, 45, 963, 1755, 3745, 4061, 4619, 9089, 59953, 100265}}, {8722, 17, 25506, {1, 1, 1, 3, 25, 53, 97, 97, 347, 749, 823, 1499, 8151, 9957, 731, 22317, 121623}}, {8723, 17, 25511, {1, 3, 5, 5, 19, 3, 121, 127, 313, 457, 1737, 4065, 5295, 7957, 16373, 62085, 5711}}, {8724, 17, 25515, {1, 1, 7, 13, 7, 37, 97, 43, 179, 837, 161, 477, 5095, 4985, 111, 58743, 24049}}, {8725, 17, 25525, {1, 3, 1, 13, 27, 13, 91, 241, 339, 235, 111, 369, 3361, 15105, 11097, 23955, 53561}}, {8726, 17, 25529, {1, 3, 5, 3, 9, 17, 103, 133, 309, 683, 71, 3329, 7229, 8763, 4165, 9649, 8529}}, {8727, 17, 25532, {1, 3, 5, 13, 29, 55, 29, 205, 433, 1007, 1173, 731, 5653, 89, 18447, 37911, 65603}}, {8728, 17, 25538, {1, 3, 5, 1, 15, 1, 7, 195, 397, 877, 1433, 3487, 1581, 1539, 3361, 7453, 46451}}, {8729, 17, 25549, {1, 1, 5, 13, 23, 1, 47, 245, 19, 859, 681, 2971, 2531, 11393, 32765, 4595, 45213}}, {8730, 17, 25552, {1, 3, 1, 3, 1, 11, 85, 185, 467, 413, 25, 3677, 881, 1791, 14655, 44811, 50819}}, {8731, 17, 25564, {1, 3, 5, 9, 9, 21, 65, 99, 441, 215, 1453, 2873, 5883, 485, 20883, 1303, 11837}}, {8732, 17, 25567, {1, 3, 3, 5, 9, 37, 87, 211, 247, 535, 1163, 1785, 4219, 12559, 17419, 48201, 21725}}, {8733, 17, 25574, {1, 1, 1, 11, 29, 11, 9, 215, 375, 601, 627, 2641, 6961, 6175, 10995, 49299, 102891}}, {8734, 17, 25577, {1, 3, 1, 3, 7, 7, 23, 139, 89, 1005, 1815, 947, 1507, 10349, 35, 43595, 104697}}, {8735, 17, 25583, {1, 1, 5, 13, 29, 47, 77, 255, 341, 333, 1211, 3473, 1303, 11237, 28371, 43283, 77617}}, {8736, 17, 25588, {1, 3, 3, 13, 27, 17, 73, 95, 227, 241, 1369, 833, 6683, 2193, 309, 64249, 6731}}, {8737, 17, 25603, {1, 3, 3, 3, 15, 29, 45, 209, 401, 725, 1123, 1659, 6099, 15941, 5797, 30563, 119385}}, {8738, 17, 25610, {1, 1, 1, 1, 7, 55, 95, 151, 351, 373, 1131, 2357, 7535, 3899, 19047, 17879, 34623}}, {8739, 17, 25615, {1, 3, 1, 5, 31, 5, 33, 97, 477, 399, 1255, 1073, 1513, 11651, 2951, 31351, 102635}}, {8740, 17, 25624, {1, 1, 3, 13, 17, 63, 51, 209, 57, 87, 977, 3663, 6717, 15441, 10709, 607, 48297}}, {8741, 17, 25636, {1, 1, 5, 1, 9, 29, 1, 105, 343, 19, 977, 3401, 3873, 4259, 23057, 13071, 105771}}, {8742, 17, 25639, {1, 1, 1, 5, 1, 33, 59, 17, 115, 225, 853, 3295, 965, 12547, 26971, 50097, 54999}}, {8743, 17, 25643, {1, 3, 3, 13, 1, 51, 29, 19, 245, 781, 493, 1121, 2937, 4177, 3267, 47463, 101195}}, {8744, 17, 25645, {1, 3, 7, 5, 3, 51, 25, 131, 451, 997, 1809, 1583, 355, 15383, 28159, 39141, 109379}}, {8745, 17, 25648, {1, 1, 5, 7, 3, 19, 75, 103, 401, 115, 1627, 423, 2485, 7281, 6177, 54677, 31499}}, {8746, 17, 25671, {1, 1, 1, 11, 23, 7, 57, 121, 5, 921, 1191, 1779, 1979, 3427, 25617, 19423, 73835}}, {8747, 17, 25678, {1, 3, 3, 11, 17, 51, 15, 163, 265, 665, 1399, 1977, 3097, 7109, 14741, 24291, 79239}}, {8748, 17, 25689, {1, 1, 7, 3, 25, 61, 69, 77, 341, 23, 713, 2879, 8075, 14855, 9691, 58241, 113277}}, {8749, 17, 25708, {1, 3, 7, 9, 27, 43, 95, 11, 239, 445, 951, 3869, 1049, 6493, 9569, 9285, 29183}}, {8750, 17, 25716, {1, 1, 3, 1, 1, 23, 27, 101, 337, 171, 1977, 3181, 2693, 8591, 32309, 24909, 106535}}, {8751, 17, 25725, {1, 1, 1, 7, 23, 59, 79, 115, 49, 351, 871, 1209, 1045, 5985, 28427, 23047, 113571}}, {8752, 17, 25730, {1, 1, 7, 13, 27, 3, 35, 7, 319, 503, 977, 3747, 4859, 16315, 30375, 25999, 24341}}, {8753, 17, 25739, {1, 3, 3, 7, 23, 43, 67, 21, 399, 349, 1541, 2991, 5781, 14501, 5609, 65093, 12789}}, {8754, 17, 25747, {1, 3, 1, 11, 5, 21, 17, 157, 311, 663, 469, 4033, 1557, 7569, 31163, 14079, 127771}}, {8755, 17, 25753, {1, 1, 7, 15, 15, 31, 15, 183, 365, 35, 1433, 2793, 6685, 10565, 30409, 46815, 14173}}, {8756, 17, 25790, {1, 1, 7, 7, 7, 45, 61, 163, 99, 353, 1535, 3185, 4023, 7999, 26173, 12675, 98073}}, {8757, 17, 25797, {1, 1, 5, 13, 1, 11, 107, 41, 171, 773, 1513, 883, 2117, 14449, 32323, 58271, 97173}}, {8758, 17, 25804, {1, 1, 3, 13, 27, 15, 123, 247, 281, 851, 233, 1173, 6863, 14805, 12401, 30729, 104127}}, {8759, 17, 25809, {1, 1, 7, 11, 25, 9, 97, 215, 217, 51, 1865, 3897, 725, 4779, 21661, 11853, 72225}}, {8760, 17, 25816, {1, 1, 5, 3, 5, 31, 125, 81, 367, 705, 325, 519, 3879, 5607, 3247, 7149, 33177}}, {8761, 17, 25825, {1, 3, 3, 7, 17, 17, 19, 113, 331, 277, 317, 1893, 1287, 8965, 27523, 61355, 45331}}, {8762, 17, 25831, {1, 3, 7, 9, 27, 15, 87, 21, 343, 479, 11, 2945, 1235, 1591, 28195, 40559, 42773}}, {8763, 17, 25845, {1, 3, 3, 13, 1, 45, 115, 41, 263, 569, 71, 4051, 739, 1031, 19213, 23961, 110767}}, {8764, 17, 25846, {1, 3, 7, 1, 9, 41, 21, 131, 3, 617, 191, 4051, 2445, 13451, 11889, 25075, 82631}}, {8765, 17, 25867, {1, 3, 3, 15, 7, 55, 65, 67, 443, 1023, 1445, 1467, 3907, 11449, 2247, 65085, 102161}}, {8766, 17, 25870, {1, 3, 5, 15, 19, 27, 97, 181, 51, 591, 99, 1443, 4927, 9809, 29693, 44293, 29369}}, {8767, 17, 25897, {1, 1, 7, 7, 17, 59, 69, 163, 37, 171, 107, 2581, 3567, 9455, 19707, 6329, 27755}}, {8768, 17, 25908, {1, 1, 1, 11, 15, 17, 83, 223, 183, 861, 1047, 3739, 3509, 5571, 28259, 42781, 130657}}, {8769, 17, 25937, {1, 3, 3, 7, 15, 11, 33, 115, 297, 841, 1629, 1559, 2261, 11763, 22255, 63819, 55831}}, {8770, 17, 25940, {1, 3, 3, 5, 19, 49, 17, 251, 507, 251, 805, 1041, 3947, 2219, 19977, 65449, 25031}}, {8771, 17, 25944, {1, 1, 1, 11, 3, 7, 81, 17, 219, 729, 949, 3257, 6495, 4701, 2181, 7009, 106465}}, {8772, 17, 25949, {1, 3, 7, 5, 27, 35, 15, 83, 43, 1013, 1427, 1943, 7555, 6613, 26879, 42685, 22071}}, {8773, 17, 25954, {1, 1, 3, 13, 23, 55, 15, 87, 15, 579, 717, 777, 149, 11431, 26197, 17711, 7337}}, {8774, 17, 25960, {1, 1, 5, 1, 31, 45, 113, 253, 211, 915, 1855, 4043, 2159, 1803, 5061, 40473, 3657}}, {8775, 17, 25963, {1, 1, 3, 7, 25, 15, 37, 73, 467, 969, 1123, 4053, 4837, 10091, 25461, 40803, 91157}}, {8776, 17, 25966, {1, 1, 5, 1, 7, 31, 77, 207, 21, 623, 577, 1195, 5839, 13013, 11189, 61691, 33327}}, {8777, 17, 25978, {1, 3, 7, 7, 13, 3, 9, 55, 47, 779, 599, 3747, 1533, 14705, 23185, 4011, 36003}}, {8778, 17, 25996, {1, 1, 5, 5, 31, 17, 99, 253, 103, 957, 241, 1893, 7435, 14907, 9089, 23205, 70639}}, {8779, 17, 26007, {1, 3, 7, 15, 7, 55, 53, 101, 227, 541, 2017, 275, 577, 15621, 1799, 50373, 43197}}, {8780, 17, 26011, {1, 3, 1, 15, 29, 23, 69, 193, 429, 359, 1045, 4091, 6551, 1673, 29113, 43247, 80993}}, {8781, 17, 26027, {1, 3, 7, 11, 5, 37, 13, 27, 277, 65, 565, 2631, 6919, 5593, 8481, 14703, 9719}}, {8782, 17, 26032, {1, 3, 1, 15, 5, 7, 83, 51, 77, 307, 1299, 1373, 5281, 15359, 15569, 50093, 59661}}, {8783, 17, 26038, {1, 3, 5, 11, 13, 31, 99, 123, 263, 319, 2033, 4055, 2427, 103, 2009, 27517, 112467}}, {8784, 17, 26049, {1, 1, 7, 3, 13, 1, 51, 131, 17, 861, 459, 3925, 5511, 5255, 28553, 36437, 54591}}, {8785, 17, 26052, {1, 3, 7, 5, 9, 57, 49, 119, 291, 727, 1611, 4035, 4517, 10979, 28445, 26905, 57517}}, {8786, 17, 26055, {1, 1, 5, 9, 9, 55, 43, 209, 411, 137, 1619, 3965, 5253, 8217, 7569, 42043, 104163}}, {8787, 17, 26085, {1, 3, 3, 7, 21, 3, 107, 255, 353, 735, 71, 1789, 3351, 755, 22805, 53537, 126859}}, {8788, 17, 26089, {1, 1, 7, 5, 15, 55, 13, 167, 165, 289, 1231, 2547, 8135, 5475, 2361, 49019, 110579}}, {8789, 17, 26090, {1, 3, 1, 11, 17, 21, 59, 37, 177, 517, 499, 4035, 749, 14297, 22415, 54975, 29769}}, {8790, 17, 26098, {1, 3, 7, 3, 3, 59, 55, 17, 483, 625, 875, 1465, 7583, 2969, 2741, 36965, 80367}}, {8791, 17, 26104, {1, 1, 3, 13, 31, 5, 11, 149, 7, 297, 1485, 735, 4095, 10089, 5757, 64997, 56629}}, {8792, 17, 26110, {1, 3, 1, 13, 19, 43, 77, 209, 309, 739, 1765, 3297, 8167, 6523, 27987, 25235, 80555}}, {8793, 17, 26113, {1, 1, 3, 9, 31, 57, 125, 75, 3, 633, 85, 3339, 1691, 9721, 17465, 36801, 106147}}, {8794, 17, 26126, {1, 3, 5, 15, 27, 7, 111, 7, 475, 523, 1825, 1367, 1549, 15533, 13827, 14471, 100271}}, {8795, 17, 26133, {1, 1, 5, 3, 5, 61, 1, 221, 163, 183, 1701, 3549, 349, 10057, 26169, 20725, 55305}}, {8796, 17, 26138, {1, 1, 3, 1, 15, 41, 13, 71, 269, 909, 1253, 2553, 83, 10055, 1057, 39841, 20437}}, {8797, 17, 26140, {1, 3, 3, 5, 29, 39, 113, 23, 137, 601, 361, 1779, 279, 15803, 8993, 2633, 114847}}, {8798, 17, 26156, {1, 1, 3, 7, 29, 45, 35, 27, 71, 253, 231, 3449, 1955, 9109, 9043, 50593, 15023}}, {8799, 17, 26159, {1, 3, 1, 11, 17, 45, 85, 255, 341, 957, 769, 3009, 3997, 6435, 1161, 34219, 97077}}, {8800, 17, 26176, {1, 1, 5, 1, 1, 19, 9, 51, 477, 129, 1411, 3223, 5069, 3237, 15947, 27215, 70401}}, {8801, 17, 26186, {1, 1, 3, 1, 1, 1, 73, 31, 301, 227, 119, 607, 3379, 3907, 1263, 2651, 43769}}, {8802, 17, 26203, {1, 1, 1, 15, 21, 59, 109, 155, 473, 361, 1871, 3085, 513, 12607, 12747, 41067, 44977}}, {8803, 17, 26210, {1, 1, 7, 3, 27, 21, 89, 71, 437, 671, 1469, 2191, 4225, 6343, 1131, 29141, 25221}}, {8804, 17, 26222, {1, 1, 7, 9, 7, 45, 95, 197, 391, 11, 1913, 3107, 5247, 959, 30395, 32809, 20893}}, {8805, 17, 26224, {1, 3, 7, 15, 13, 49, 77, 245, 463, 769, 1807, 1311, 2715, 14819, 27595, 57521, 105221}}, {8806, 17, 26229, {1, 1, 1, 5, 23, 45, 119, 77, 325, 405, 1631, 461, 6357, 7037, 31699, 46295, 118577}}, {8807, 17, 26233, {1, 3, 5, 1, 21, 3, 31, 13, 7, 571, 633, 425, 6547, 3423, 19355, 49481, 76289}}, {8808, 17, 26236, {1, 1, 3, 9, 7, 51, 113, 173, 169, 97, 1821, 979, 2553, 11505, 20047, 39277, 122905}}, {8809, 17, 26239, {1, 1, 5, 13, 17, 9, 111, 205, 261, 671, 657, 507, 3903, 10767, 4387, 3045, 102617}}, {8810, 17, 26267, {1, 1, 3, 3, 5, 11, 19, 61, 401, 605, 455, 2457, 4471, 7255, 18435, 49673, 97289}}, {8811, 17, 26291, {1, 3, 1, 1, 31, 25, 77, 35, 65, 127, 929, 2325, 2315, 13819, 5509, 12515, 36991}}, {8812, 17, 26293, {1, 1, 7, 5, 21, 49, 33, 119, 181, 645, 1425, 2411, 245, 13755, 18775, 50061, 47119}}, {8813, 17, 26298, {1, 3, 7, 5, 27, 43, 81, 191, 233, 435, 829, 3881, 713, 11153, 4637, 37721, 115567}}, {8814, 17, 26303, {1, 3, 7, 1, 27, 59, 51, 165, 59, 931, 1921, 3059, 6843, 813, 22063, 29445, 114765}}, {8815, 17, 26308, {1, 1, 5, 11, 31, 53, 89, 69, 29, 893, 1241, 7, 1707, 16167, 8371, 14021, 103281}}, {8816, 17, 26312, {1, 3, 1, 1, 23, 21, 3, 35, 73, 769, 1417, 4051, 3223, 813, 1141, 18823, 31951}}, {8817, 17, 26315, {1, 3, 7, 11, 9, 17, 89, 85, 407, 137, 1865, 2881, 1495, 3757, 3711, 36651, 1797}}, {8818, 17, 26342, {1, 3, 5, 1, 25, 29, 29, 217, 15, 173, 479, 2363, 2341, 6193, 16403, 64097, 1173}}, {8819, 17, 26354, {1, 3, 3, 3, 11, 29, 113, 167, 333, 573, 1467, 2223, 5693, 1063, 20299, 40993, 69055}}, {8820, 17, 26363, {1, 1, 3, 7, 3, 51, 45, 139, 79, 393, 1251, 1087, 1423, 1827, 23445, 41635, 78511}}, {8821, 17, 26365, {1, 3, 3, 13, 29, 45, 85, 229, 33, 373, 113, 1205, 997, 11777, 7663, 18513, 5797}}, {8822, 17, 26383, {1, 1, 5, 5, 15, 5, 127, 85, 49, 345, 901, 3215, 2347, 2329, 19597, 39555, 25031}}, {8823, 17, 26391, {1, 1, 7, 11, 9, 25, 71, 183, 341, 1011, 439, 3649, 2859, 10183, 7635, 45297, 38581}}, {8824, 17, 26398, {1, 1, 1, 11, 23, 13, 1, 69, 461, 77, 1641, 2851, 1889, 2413, 1131, 39009, 33773}}, {8825, 17, 26416, {1, 3, 7, 7, 25, 19, 67, 233, 141, 207, 1501, 453, 4773, 7411, 22839, 25365, 53189}}, {8826, 17, 26421, {1, 1, 7, 3, 3, 17, 13, 167, 73, 1005, 887, 2595, 4351, 3249, 5653, 36025, 33733}}, {8827, 17, 26425, {1, 1, 7, 15, 11, 1, 105, 215, 329, 601, 1477, 723, 4597, 3525, 26235, 63957, 26677}}, {8828, 17, 26434, {1, 1, 1, 11, 27, 15, 111, 133, 327, 567, 845, 2135, 7905, 7297, 29255, 14947, 104885}}, {8829, 17, 26439, {1, 1, 7, 9, 21, 11, 67, 179, 459, 423, 295, 3445, 1681, 12907, 29281, 7445, 35539}}, {8830, 17, 26453, {1, 1, 3, 11, 23, 61, 111, 123, 81, 439, 299, 3557, 2821, 705, 15393, 37175, 11533}}, {8831, 17, 26454, {1, 1, 3, 1, 13, 15, 113, 227, 285, 313, 687, 2085, 6363, 8003, 32661, 36461, 68759}}, {8832, 17, 26470, {1, 3, 3, 1, 27, 7, 101, 177, 363, 461, 1519, 2339, 473, 7469, 4335, 30951, 130987}}, {8833, 17, 26491, {1, 1, 1, 3, 31, 39, 59, 159, 207, 93, 581, 1973, 945, 11343, 15901, 22001, 3515}}, {8834, 17, 26493, {1, 3, 7, 5, 11, 53, 125, 57, 389, 985, 1055, 3803, 3879, 5537, 28221, 36805, 16025}}, {8835, 17, 26500, {1, 1, 1, 9, 1, 63, 81, 57, 59, 813, 865, 3491, 3771, 6121, 6847, 14765, 68567}}, {8836, 17, 26509, {1, 1, 7, 7, 13, 17, 23, 211, 435, 167, 933, 357, 3567, 3019, 28439, 17701, 119937}}, {8837, 17, 26518, {1, 1, 1, 9, 7, 53, 103, 155, 211, 719, 413, 3673, 2795, 15687, 1737, 50855, 129133}}, {8838, 17, 26531, {1, 1, 3, 13, 11, 23, 53, 121, 497, 383, 1655, 937, 5563, 2549, 23183, 46149, 78875}}, {8839, 17, 26533, {1, 3, 5, 11, 25, 1, 45, 139, 437, 729, 2009, 3245, 4091, 551, 25993, 31655, 33641}}, {8840, 17, 26540, {1, 3, 1, 13, 7, 23, 87, 111, 471, 501, 1767, 1051, 7037, 3199, 19609, 43227, 53667}}, {8841, 17, 26552, {1, 3, 7, 1, 25, 1, 49, 189, 55, 375, 601, 2065, 2991, 7697, 25739, 14951, 43705}}, {8842, 17, 26566, {1, 1, 7, 5, 29, 21, 51, 111, 81, 809, 1963, 2143, 5529, 15701, 4719, 11857, 88207}}, {8843, 17, 26569, {1, 1, 5, 11, 27, 27, 7, 145, 281, 939, 537, 1255, 1475, 11383, 15081, 9105, 102775}}, {8844, 17, 26583, {1, 1, 5, 7, 9, 45, 67, 23, 65, 139, 1871, 3975, 6357, 6515, 25423, 23915, 76289}}, {8845, 17, 26590, {1, 1, 5, 11, 31, 31, 89, 65, 451, 341, 819, 2439, 6753, 15113, 9085, 32687, 5055}}, {8846, 17, 26596, {1, 1, 5, 1, 15, 29, 123, 83, 495, 185, 303, 315, 6015, 5257, 2467, 4903, 78269}}, {8847, 17, 26624, {1, 1, 3, 5, 31, 51, 49, 199, 501, 407, 733, 1181, 8023, 7321, 14765, 17535, 19893}}, {8848, 17, 26636, {1, 1, 5, 5, 19, 15, 103, 183, 13, 969, 1537, 3053, 3173, 12983, 21761, 33733, 67799}}, {8849, 17, 26667, {1, 3, 1, 1, 27, 55, 37, 149, 379, 11, 1655, 2317, 3135, 6459, 25941, 12679, 60245}}, {8850, 17, 26669, {1, 1, 3, 9, 9, 13, 33, 243, 337, 741, 1685, 1147, 5465, 4865, 559, 23993, 47273}}, {8851, 17, 26672, {1, 3, 5, 13, 21, 11, 39, 169, 135, 209, 1909, 3655, 3117, 1075, 8165, 54633, 28189}}, {8852, 17, 26675, {1, 3, 1, 15, 9, 23, 11, 123, 63, 133, 947, 907, 3853, 10291, 22905, 4561, 92497}}, {8853, 17, 26687, {1, 1, 3, 13, 17, 9, 5, 209, 429, 3, 2035, 1497, 6765, 5991, 24991, 8155, 103417}}, {8854, 17, 26689, {1, 1, 5, 13, 27, 47, 79, 11, 41, 791, 1939, 3099, 4069, 4665, 20801, 18659, 72163}}, {8855, 17, 26696, {1, 3, 1, 13, 25, 37, 79, 131, 233, 647, 291, 1419, 5157, 4261, 27715, 611, 83157}}, {8856, 17, 26702, {1, 1, 5, 1, 17, 61, 45, 163, 137, 937, 91, 1695, 1553, 543, 28615, 6855, 75201}}, {8857, 17, 26714, {1, 1, 3, 13, 7, 63, 109, 13, 351, 159, 1111, 2791, 4701, 5805, 9707, 18361, 98091}}, {8858, 17, 26716, {1, 1, 3, 11, 11, 21, 55, 247, 111, 801, 93, 3091, 1043, 9761, 23679, 5555, 195}}, {8859, 17, 26729, {1, 1, 1, 1, 13, 43, 123, 113, 265, 561, 659, 3755, 6605, 10949, 30511, 29495, 9075}}, {8860, 17, 26732, {1, 3, 1, 7, 23, 63, 19, 73, 233, 1017, 851, 1971, 3999, 7407, 25309, 63991, 92867}}, {8861, 17, 26737, {1, 3, 3, 3, 19, 63, 127, 107, 465, 463, 1507, 1323, 4729, 14717, 9129, 24859, 117565}}, {8862, 17, 26747, {1, 1, 7, 1, 19, 11, 13, 85, 339, 939, 895, 887, 765, 15501, 8783, 65087, 77899}}, {8863, 17, 26773, {1, 3, 7, 3, 7, 15, 43, 153, 365, 223, 1947, 2295, 787, 5549, 20089, 29203, 4807}}, {8864, 17, 26780, {1, 3, 7, 3, 31, 27, 51, 217, 483, 623, 633, 2123, 1211, 9173, 17949, 54251, 89161}}, {8865, 17, 26801, {1, 3, 3, 11, 3, 11, 111, 73, 283, 23, 1925, 253, 5141, 12545, 24913, 16847, 13067}}, {8866, 17, 26811, {1, 3, 5, 5, 31, 39, 35, 235, 135, 85, 191, 999, 6633, 12527, 21401, 61339, 81239}}, {8867, 17, 26813, {1, 1, 3, 15, 9, 13, 39, 125, 137, 639, 555, 813, 2821, 1199, 32075, 15079, 104609}}, {8868, 17, 26831, {1, 3, 7, 7, 15, 43, 99, 51, 245, 25, 147, 89, 6841, 5523, 28493, 13967, 113109}}, {8869, 17, 26836, {1, 1, 3, 13, 7, 5, 27, 121, 269, 231, 1011, 1365, 5055, 11619, 27393, 48033, 65725}}, {8870, 17, 26839, {1, 1, 7, 5, 9, 23, 41, 71, 327, 339, 1681, 3303, 4143, 421, 15213, 48405, 98067}}, {8871, 17, 26849, {1, 3, 7, 15, 15, 33, 73, 33, 351, 131, 1051, 3909, 7535, 7659, 9443, 35015, 329}}, {8872, 17, 26862, {1, 1, 3, 9, 19, 55, 97, 223, 265, 877, 235, 867, 4961, 3137, 19885, 10955, 7655}}, {8873, 17, 26869, {1, 3, 5, 13, 1, 11, 75, 215, 271, 793, 1691, 1437, 1317, 10977, 1311, 64865, 92361}}, {8874, 17, 26873, {1, 1, 1, 5, 23, 23, 35, 53, 187, 345, 115, 929, 3919, 4523, 31709, 16771, 33399}}, {8875, 17, 26874, {1, 3, 5, 11, 17, 7, 75, 57, 351, 359, 1737, 2665, 4259, 13905, 6999, 45359, 117891}}, {8876, 17, 26888, {1, 1, 5, 3, 23, 29, 49, 209, 417, 843, 531, 1649, 7829, 6271, 3759, 39727, 47415}}, {8877, 17, 26891, {1, 1, 7, 1, 21, 45, 101, 105, 385, 797, 985, 1447, 3757, 3287, 583, 29283, 96821}}, {8878, 17, 26896, {1, 1, 7, 9, 1, 29, 15, 207, 289, 465, 815, 2289, 449, 9403, 19197, 13797, 102651}}, {8879, 17, 26899, {1, 3, 7, 15, 5, 45, 81, 187, 21, 433, 679, 2759, 3375, 6935, 22595, 50149, 13557}}, {8880, 17, 26912, {1, 3, 3, 5, 11, 55, 69, 219, 95, 21, 645, 1955, 7527, 6037, 29427, 36297, 62013}}, {8881, 17, 26921, {1, 1, 7, 15, 13, 35, 25, 67, 383, 13, 539, 2399, 4611, 8065, 3815, 27771, 50411}}, {8882, 17, 26935, {1, 3, 1, 3, 27, 47, 65, 33, 393, 895, 1663, 1289, 1057, 11887, 1259, 53611, 36811}}, {8883, 17, 26941, {1, 3, 5, 3, 5, 1, 27, 65, 379, 15, 1643, 1461, 3009, 8177, 15589, 5889, 1103}}, {8884, 17, 26949, {1, 1, 5, 15, 27, 53, 43, 173, 377, 665, 581, 1061, 1363, 15015, 26709, 29507, 28075}}, {8885, 17, 26954, {1, 1, 7, 3, 9, 11, 45, 71, 23, 995, 1277, 855, 1001, 12927, 19753, 46639, 16949}}, {8886, 17, 26967, {1, 1, 7, 5, 15, 33, 27, 27, 437, 415, 1785, 2091, 279, 8041, 2209, 15821, 122363}}, {8887, 17, 26977, {1, 1, 7, 1, 21, 1, 47, 215, 463, 959, 849, 1703, 5175, 10043, 16991, 11023, 52201}}, {8888, 17, 27011, {1, 1, 1, 11, 21, 7, 121, 31, 95, 631, 1717, 3017, 2083, 2047, 12051, 63117, 25949}}, {8889, 17, 27018, {1, 1, 5, 5, 9, 5, 105, 121, 205, 643, 1721, 2601, 2991, 2381, 4873, 12049, 20043}}, {8890, 17, 27026, {1, 3, 5, 11, 7, 11, 97, 187, 253, 571, 101, 3077, 1479, 9513, 15451, 37105, 34445}}, {8891, 17, 27028, {1, 1, 7, 11, 19, 19, 39, 115, 221, 13, 217, 369, 6855, 14529, 143, 13461, 62927}}, {8892, 17, 27032, {1, 3, 3, 7, 29, 27, 9, 171, 419, 571, 837, 3829, 1871, 12691, 30693, 4195, 38905}}, {8893, 17, 27044, {1, 1, 1, 11, 5, 55, 17, 41, 241, 419, 337, 897, 4663, 14469, 18701, 18009, 44605}}, {8894, 17, 27053, {1, 1, 7, 7, 1, 33, 63, 197, 257, 655, 1287, 2571, 57, 13275, 29669, 8501, 61389}}, {8895, 17, 27062, {1, 3, 5, 3, 29, 39, 101, 215, 101, 271, 1373, 2171, 841, 9865, 28951, 20369, 42413}}, {8896, 17, 27065, {1, 3, 5, 1, 31, 23, 119, 137, 263, 633, 1239, 281, 4965, 14913, 30229, 14147, 37183}}, {8897, 17, 27068, {1, 3, 1, 3, 11, 55, 33, 45, 69, 913, 269, 1021, 4005, 15191, 11187, 45917, 76905}}, {8898, 17, 27080, {1, 1, 1, 13, 27, 11, 75, 139, 243, 221, 1289, 2195, 7041, 10053, 5731, 35245, 41317}}, {8899, 17, 27083, {1, 1, 7, 9, 25, 11, 81, 243, 233, 137, 831, 2825, 6007, 7305, 31733, 64343, 7047}}, {8900, 17, 27093, {1, 3, 5, 9, 17, 61, 25, 245, 285, 969, 1397, 1331, 5393, 3653, 15533, 9121, 111115}}, {8901, 17, 27098, {1, 1, 5, 9, 1, 9, 61, 205, 285, 849, 1071, 1013, 2655, 10121, 15165, 25189, 56207}}, {8902, 17, 27107, {1, 3, 5, 7, 19, 45, 121, 19, 237, 711, 1523, 3251, 693, 13567, 31993, 11239, 64127}}, {8903, 17, 27110, {1, 1, 1, 11, 23, 25, 33, 211, 321, 1021, 1855, 291, 2911, 11841, 21929, 64147, 63201}}, {8904, 17, 27114, {1, 1, 7, 3, 27, 21, 119, 219, 431, 819, 83, 2487, 7533, 10697, 3129, 53301, 104999}}, {8905, 17, 27121, {1, 3, 5, 15, 9, 25, 89, 65, 293, 411, 989, 3103, 5563, 15703, 8757, 32595, 43409}}, {8906, 17, 27127, {1, 3, 3, 1, 31, 31, 45, 173, 231, 171, 1185, 1499, 1713, 9945, 11575, 37113, 103989}}, {8907, 17, 27137, {1, 1, 5, 13, 27, 3, 93, 253, 23, 71, 1963, 2571, 6259, 15757, 9709, 42835, 42047}}, {8908, 17, 27144, {1, 1, 7, 11, 5, 11, 123, 117, 39, 559, 111, 527, 6253, 781, 9177, 47189, 94031}}, {8909, 17, 27155, {1, 1, 5, 15, 5, 49, 93, 185, 167, 787, 1553, 3291, 3723, 1651, 23225, 5643, 42967}}, {8910, 17, 27171, {1, 3, 1, 13, 15, 35, 19, 193, 505, 127, 661, 1943, 1249, 5103, 8233, 64319, 76955}}, {8911, 17, 27178, {1, 3, 7, 7, 17, 13, 97, 185, 415, 331, 283, 3341, 2903, 2927, 7729, 4095, 103083}}, {8912, 17, 27180, {1, 1, 3, 15, 15, 25, 65, 45, 413, 521, 747, 2605, 5845, 12909, 7651, 45937, 99043}}, {8913, 17, 27185, {1, 1, 5, 9, 9, 21, 3, 75, 335, 745, 1493, 1721, 1977, 11105, 22621, 49281, 107113}}, {8914, 17, 27191, {1, 3, 1, 11, 25, 11, 99, 53, 239, 831, 655, 615, 7565, 14039, 29115, 26165, 127159}}, {8915, 17, 27192, {1, 1, 7, 5, 31, 35, 75, 157, 441, 815, 119, 565, 2703, 14059, 7867, 42487, 93647}}, {8916, 17, 27195, {1, 3, 7, 3, 3, 59, 101, 223, 257, 989, 363, 1059, 5157, 11129, 1481, 19287, 117623}}, {8917, 17, 27212, {1, 1, 1, 1, 29, 27, 1, 129, 253, 673, 103, 1881, 7053, 1261, 32003, 23345, 102503}}, {8918, 17, 27215, {1, 3, 1, 9, 11, 37, 3, 99, 303, 519, 1175, 3021, 2275, 9919, 25011, 45865, 71351}}, {8919, 17, 27218, {1, 1, 7, 15, 27, 9, 107, 61, 385, 21, 861, 2119, 4643, 8379, 25455, 22425, 113387}}, {8920, 17, 27230, {1, 1, 1, 7, 27, 15, 73, 211, 497, 527, 873, 329, 2213, 415, 13987, 56581, 27829}}, {8921, 17, 27234, {1, 3, 5, 1, 31, 43, 107, 149, 209, 211, 2029, 2793, 2213, 12389, 27177, 51375, 51983}}, {8922, 17, 27245, {1, 3, 3, 7, 25, 57, 67, 101, 127, 43, 1775, 801, 3343, 12203, 8667, 58387, 10735}}, {8923, 17, 27248, {1, 1, 7, 5, 13, 47, 101, 123, 133, 593, 1409, 3525, 2545, 13009, 11873, 38463, 1075}}, {8924, 17, 27263, {1, 3, 3, 1, 3, 19, 75, 221, 157, 67, 397, 1141, 5073, 10795, 9857, 35459, 62701}}, {8925, 17, 27279, {1, 1, 7, 7, 23, 17, 41, 179, 83, 543, 1839, 3709, 131, 15681, 9147, 18685, 90389}}, {8926, 17, 27288, {1, 1, 5, 7, 17, 15, 31, 217, 79, 687, 1927, 2889, 6127, 15095, 28437, 16403, 123275}}, {8927, 17, 27294, {1, 3, 7, 15, 13, 17, 123, 75, 45, 635, 525, 3897, 6769, 13855, 16695, 18039, 37479}}, {8928, 17, 27303, {1, 1, 5, 1, 23, 15, 69, 161, 503, 339, 1061, 839, 9, 10013, 24493, 32711, 50147}}, {8929, 17, 27304, {1, 3, 3, 11, 5, 45, 9, 233, 131, 629, 1111, 3311, 2211, 9079, 19763, 23793, 85389}}, {8930, 17, 27312, {1, 1, 7, 7, 7, 27, 15, 85, 291, 925, 1545, 3061, 4867, 1613, 13467, 53731, 92811}}, {8931, 17, 27330, {1, 3, 5, 1, 21, 21, 71, 33, 141, 675, 1519, 3275, 1491, 10717, 28199, 14983, 18961}}, {8932, 17, 27341, {1, 3, 5, 5, 31, 13, 109, 239, 369, 373, 257, 3765, 2531, 13281, 11877, 29439, 106939}}, {8933, 17, 27342, {1, 3, 7, 15, 13, 39, 111, 203, 109, 179, 789, 3849, 433, 5745, 2343, 15795, 92603}}, {8934, 17, 27344, {1, 3, 5, 5, 11, 57, 3, 245, 289, 249, 713, 315, 2261, 1249, 6963, 44507, 100829}}, {8935, 17, 27353, {1, 3, 5, 11, 5, 49, 97, 245, 363, 315, 509, 17, 4485, 15393, 28491, 17945, 65663}}, {8936, 17, 27356, {1, 3, 5, 1, 5, 13, 15, 17, 141, 119, 1393, 581, 2439, 2015, 11527, 8537, 103005}}, {8937, 17, 27366, {1, 3, 5, 1, 25, 9, 117, 25, 99, 777, 985, 1159, 99, 3013, 21429, 19027, 61833}}, {8938, 17, 27369, {1, 1, 1, 5, 1, 47, 37, 83, 159, 29, 281, 3789, 2525, 15999, 8965, 11145, 14453}}, {8939, 17, 27377, {1, 1, 3, 1, 11, 63, 77, 207, 267, 473, 241, 629, 6969, 9093, 839, 3875, 18873}}, {8940, 17, 27387, {1, 3, 5, 7, 31, 57, 103, 65, 349, 321, 717, 2403, 105, 643, 27999, 2509, 123061}}, {8941, 17, 27409, {1, 1, 5, 7, 3, 31, 7, 113, 17, 995, 1211, 1749, 6757, 3391, 8011, 47715, 24301}}, {8942, 17, 27437, {1, 3, 7, 11, 7, 55, 29, 155, 373, 81, 1255, 2205, 3233, 9537, 22129, 24505, 79021}}, {8943, 17, 27443, {1, 1, 7, 5, 3, 49, 5, 51, 89, 107, 585, 3933, 745, 11685, 20663, 12521, 24357}}, {8944, 17, 27446, {1, 1, 7, 1, 17, 17, 83, 215, 357, 581, 2025, 3411, 7287, 11925, 2253, 43513, 98655}}, {8945, 17, 27450, {1, 3, 5, 3, 27, 27, 51, 147, 471, 509, 423, 3807, 677, 8429, 581, 47999, 35913}}, {8946, 17, 27452, {1, 3, 3, 9, 15, 31, 1, 93, 207, 759, 1991, 473, 2273, 43, 12547, 58085, 20953}}, {8947, 17, 27457, {1, 1, 3, 3, 1, 27, 39, 219, 381, 187, 159, 2333, 6141, 3775, 5693, 14853, 38765}}, {8948, 17, 27472, {1, 3, 1, 5, 19, 1, 19, 237, 231, 975, 1609, 723, 241, 10105, 18817, 58373, 118889}}, {8949, 17, 27475, {1, 1, 5, 7, 7, 43, 99, 181, 109, 529, 421, 1493, 1075, 12219, 24287, 33479, 29987}}, {8950, 17, 27487, {1, 1, 7, 1, 17, 11, 79, 85, 157, 851, 1429, 3355, 139, 14327, 30025, 60303, 109015}}, {8951, 17, 27488, {1, 3, 5, 9, 11, 15, 37, 79, 5, 169, 999, 815, 6255, 11763, 16299, 49891, 101917}}, {8952, 17, 27493, {1, 3, 5, 9, 29, 45, 51, 211, 159, 771, 1631, 2871, 4877, 4941, 18127, 15669, 57515}}, {8953, 17, 27506, {1, 1, 3, 3, 19, 29, 9, 205, 253, 399, 303, 2441, 3187, 641, 23341, 52951, 57559}}, {8954, 17, 27508, {1, 3, 3, 15, 11, 29, 121, 227, 69, 935, 365, 217, 4617, 13193, 27663, 46903, 107843}}, {8955, 17, 27521, {1, 1, 5, 11, 13, 31, 13, 243, 275, 685, 1613, 1915, 2775, 11225, 4729, 45549, 103875}}, {8956, 17, 27522, {1, 1, 5, 1, 9, 61, 35, 143, 165, 441, 517, 1735, 5281, 10139, 21107, 11713, 130483}}, {8957, 17, 27527, {1, 3, 5, 5, 13, 21, 7, 219, 97, 887, 1845, 469, 2523, 1569, 9959, 4397, 15823}}, {8958, 17, 27536, {1, 3, 7, 11, 15, 27, 73, 223, 365, 939, 331, 145, 683, 6441, 23421, 59177, 31763}}, {8959, 17, 27539, {1, 3, 1, 5, 9, 59, 85, 113, 343, 831, 121, 3157, 6059, 14923, 27401, 19759, 14223}}, {8960, 17, 27541, {1, 3, 1, 7, 17, 25, 3, 39, 471, 759, 2041, 609, 4293, 7491, 8041, 50857, 25601}}, {8961, 17, 27546, {1, 1, 5, 15, 19, 45, 21, 5, 269, 197, 527, 1839, 1719, 15105, 18671, 42167, 9617}}, {8962, 17, 27557, {1, 3, 1, 3, 5, 35, 3, 105, 395, 113, 1945, 3945, 3951, 12207, 32135, 34121, 10237}}, {8963, 17, 27564, {1, 1, 5, 13, 21, 43, 51, 255, 57, 399, 1937, 1573, 363, 11589, 26989, 54345, 94341}}, {8964, 17, 27572, {1, 3, 3, 3, 5, 45, 83, 125, 179, 923, 39, 3617, 7683, 8191, 31469, 23633, 79179}}, {8965, 17, 27576, {1, 3, 7, 9, 9, 37, 107, 65, 423, 77, 1779, 1375, 2085, 11779, 6535, 2973, 29425}}, {8966, 17, 27584, {1, 1, 7, 3, 11, 39, 101, 137, 407, 855, 1767, 1717, 2821, 10447, 31187, 6329, 124111}}, {8967, 17, 27608, {1, 1, 5, 11, 27, 27, 45, 103, 225, 681, 725, 1791, 2881, 2923, 14473, 12269, 58743}}, {8968, 17, 27611, {1, 1, 3, 11, 15, 39, 113, 167, 143, 677, 1189, 1571, 5339, 6065, 30187, 19639, 42227}}, {8969, 17, 27618, {1, 1, 1, 3, 13, 7, 113, 75, 129, 619, 1741, 1495, 4751, 11085, 22391, 199, 105463}}, {8970, 17, 27620, {1, 1, 3, 3, 19, 47, 77, 195, 209, 453, 495, 1605, 5255, 15327, 8941, 18239, 54511}}, {8971, 17, 27627, {1, 1, 7, 7, 21, 29, 95, 175, 3, 689, 611, 2467, 6919, 12399, 18869, 16171, 102753}}, {8972, 17, 27630, {1, 1, 5, 1, 27, 43, 61, 133, 37, 603, 315, 1915, 813, 15769, 27447, 29589, 122281}}, {8973, 17, 27637, {1, 1, 7, 3, 11, 1, 119, 235, 93, 481, 1811, 1643, 4853, 11313, 8991, 6153, 68985}}, {8974, 17, 27638, {1, 1, 1, 7, 1, 13, 99, 83, 221, 775, 1345, 219, 4445, 11837, 10405, 43563, 122111}}, {8975, 17, 27641, {1, 1, 5, 13, 21, 33, 105, 19, 343, 571, 703, 429, 2485, 15531, 9801, 24101, 88275}}, {8976, 17, 27647, {1, 3, 5, 1, 27, 55, 73, 49, 33, 773, 1411, 1227, 6827, 1271, 28897, 24265, 32383}}, {8977, 17, 27650, {1, 3, 7, 3, 9, 45, 59, 5, 157, 669, 261, 2077, 1425, 8221, 5849, 40857, 121029}}, {8978, 17, 27676, {1, 3, 7, 11, 23, 5, 87, 113, 279, 611, 1195, 1775, 5813, 6737, 18051, 41341, 93331}}, {8979, 17, 27683, {1, 1, 7, 7, 9, 55, 113, 3, 167, 295, 1579, 2833, 4003, 7583, 22833, 44427, 34781}}, {8980, 17, 27690, {1, 1, 5, 13, 21, 33, 127, 175, 153, 961, 819, 143, 3969, 6159, 29437, 14123, 65317}}, {8981, 17, 27695, {1, 1, 1, 15, 31, 27, 1, 17, 329, 963, 1907, 421, 535, 2323, 22749, 44375, 115531}}, {8982, 17, 27700, {1, 1, 5, 15, 15, 23, 57, 171, 253, 401, 1577, 3855, 197, 7979, 17577, 25275, 88831}}, {8983, 17, 27704, {1, 1, 7, 9, 27, 9, 7, 13, 381, 847, 533, 357, 6551, 13441, 5717, 20209, 64347}}, {8984, 17, 27709, {1, 1, 7, 9, 1, 1, 31, 245, 315, 901, 1857, 497, 4285, 13227, 3937, 45025, 59627}}, {8985, 17, 27715, {1, 1, 7, 3, 5, 23, 119, 147, 479, 71, 113, 3379, 863, 8285, 31259, 15863, 47267}}, {8986, 17, 27727, {1, 3, 5, 1, 5, 7, 77, 163, 421, 353, 1757, 1335, 4975, 3011, 11703, 56075, 12045}}, {8987, 17, 27745, {1, 1, 5, 3, 31, 25, 81, 59, 211, 463, 1693, 609, 3307, 3641, 19643, 29361, 8399}}, {8988, 17, 27763, {1, 1, 7, 13, 19, 47, 43, 43, 275, 735, 535, 3689, 3987, 10695, 17243, 60565, 72299}}, {8989, 17, 27769, {1, 3, 3, 5, 25, 35, 75, 63, 305, 127, 189, 1785, 731, 12089, 27811, 43259, 28191}}, {8990, 17, 27770, {1, 3, 7, 11, 17, 17, 59, 107, 139, 355, 1055, 3181, 4743, 14785, 26323, 441, 35613}}, {8991, 17, 27796, {1, 3, 1, 1, 17, 17, 39, 203, 373, 601, 449, 1837, 835, 7061, 14655, 61765, 80735}}, {8992, 17, 27810, {1, 3, 5, 7, 27, 17, 25, 41, 125, 895, 1843, 3167, 1527, 4707, 6477, 33575, 97247}}, {8993, 17, 27812, {1, 3, 3, 3, 13, 39, 25, 15, 279, 347, 1121, 3603, 3019, 9577, 16863, 61483, 15995}}, {8994, 17, 27834, {1, 3, 5, 11, 15, 33, 15, 81, 185, 289, 909, 1237, 3623, 3983, 24211, 62719, 79685}}, {8995, 17, 27847, {1, 1, 1, 7, 29, 1, 53, 17, 137, 269, 1209, 3937, 4167, 14057, 8061, 38863, 101477}}, {8996, 17, 27848, {1, 1, 1, 9, 5, 45, 95, 127, 507, 159, 1763, 1527, 5689, 11007, 549, 22837, 99207}}, {8997, 17, 27862, {1, 3, 3, 1, 15, 57, 127, 39, 73, 397, 67, 3159, 119, 8929, 29425, 57687, 68063}}, {8998, 17, 27868, {1, 3, 1, 3, 27, 7, 111, 209, 291, 17, 1381, 1597, 5389, 4577, 20463, 28325, 23743}}, {8999, 17, 27881, {1, 3, 3, 7, 23, 41, 83, 81, 213, 537, 1037, 2371, 1485, 8391, 12471, 58541, 27559}}, {9000, 17, 27884, {1, 3, 1, 15, 21, 43, 87, 75, 451, 851, 1917, 2739, 2167, 12531, 29931, 8017, 15163}}, {9001, 17, 27890, {1, 1, 3, 9, 27, 19, 41, 145, 401, 759, 527, 3085, 187, 10615, 4995, 22421, 69867}}, {9002, 17, 27895, {1, 3, 3, 13, 29, 51, 65, 47, 157, 609, 1061, 1913, 6195, 12503, 10375, 55819, 122091}}, {9003, 17, 27904, {1, 1, 3, 7, 1, 19, 3, 149, 453, 279, 569, 3429, 331, 711, 26773, 21163, 129339}}, {9004, 17, 27914, {1, 1, 5, 3, 7, 47, 39, 181, 115, 771, 2037, 411, 2697, 7501, 6393, 19461, 74967}}, {9005, 17, 27919, {1, 3, 3, 5, 5, 17, 89, 161, 409, 49, 1447, 3977, 4777, 15553, 3521, 32553, 126385}}, {9006, 17, 27921, {1, 3, 1, 3, 25, 59, 73, 105, 505, 1009, 1147, 317, 3457, 13743, 8337, 38077, 7709}}, {9007, 17, 27931, {1, 3, 3, 15, 23, 37, 25, 123, 413, 911, 637, 2345, 691, 15199, 22927, 52467, 126715}}, {9008, 17, 27933, {1, 1, 5, 1, 9, 51, 93, 123, 269, 45, 1947, 179, 5091, 3743, 31491, 39771, 119175}}, {9009, 17, 27938, {1, 3, 1, 5, 29, 23, 107, 183, 25, 115, 187, 857, 7337, 469, 8755, 17281, 45941}}, {9010, 17, 27943, {1, 3, 1, 13, 25, 61, 85, 115, 181, 955, 1365, 837, 5941, 13209, 27009, 58865, 115149}}, {9011, 17, 27949, {1, 1, 1, 11, 31, 63, 101, 29, 37, 185, 465, 2651, 6249, 6887, 25021, 60539, 50037}}, {9012, 17, 28005, {1, 3, 1, 7, 7, 61, 57, 243, 143, 223, 1759, 4085, 6765, 13293, 31929, 29579, 35053}}, {9013, 17, 28012, {1, 3, 1, 3, 29, 9, 121, 3, 285, 199, 1439, 3151, 5059, 8535, 17049, 38917, 46347}}, {9014, 17, 28017, {1, 3, 1, 3, 17, 43, 63, 87, 427, 341, 1251, 3775, 7729, 3183, 10579, 917, 49035}}, {9015, 17, 28024, {1, 1, 7, 3, 5, 59, 119, 227, 495, 345, 841, 2021, 2483, 15987, 24663, 9819, 33009}}, {9016, 17, 28030, {1, 1, 5, 11, 19, 57, 23, 181, 63, 991, 1, 2927, 4785, 9645, 17435, 55627, 1069}}, {9017, 17, 28034, {1, 1, 7, 1, 31, 11, 57, 123, 279, 815, 1407, 3509, 3963, 8503, 20345, 7777, 103701}}, {9018, 17, 28045, {1, 1, 5, 5, 19, 51, 37, 15, 363, 939, 1863, 3485, 7073, 3035, 31279, 7289, 39811}}, {9019, 17, 28048, {1, 1, 3, 3, 3, 41, 29, 37, 311, 535, 1993, 3937, 309, 13055, 22595, 59641, 95317}}, {9020, 17, 28054, {1, 3, 7, 9, 19, 29, 23, 181, 503, 223, 1655, 997, 7861, 5867, 16979, 4559, 7447}}, {9021, 17, 28063, {1, 3, 5, 3, 13, 13, 3, 137, 361, 101, 1005, 2339, 609, 11891, 15245, 9653, 63579}}, {9022, 17, 28069, {1, 1, 1, 15, 31, 15, 117, 151, 51, 805, 1403, 3243, 4007, 11979, 3945, 61935, 43225}}, {9023, 17, 28070, {1, 1, 7, 3, 1, 43, 93, 105, 9, 555, 731, 655, 2097, 8015, 27557, 27985, 11323}}, {9024, 17, 28073, {1, 3, 3, 9, 23, 35, 59, 217, 437, 755, 685, 1431, 2965, 5269, 25621, 21735, 1397}}, {9025, 17, 28084, {1, 1, 5, 1, 9, 61, 41, 53, 101, 111, 531, 3385, 4771, 9535, 15995, 29687, 99035}}, {9026, 17, 28096, {1, 1, 7, 7, 1, 3, 25, 251, 463, 99, 677, 1889, 3697, 5579, 11429, 38301, 57917}}, {9027, 17, 28114, {1, 1, 5, 9, 11, 15, 65, 31, 369, 825, 1229, 1595, 3891, 5235, 16973, 25307, 7805}}, {9028, 17, 28126, {1, 3, 7, 15, 27, 37, 35, 103, 393, 781, 1713, 2009, 1973, 15461, 6801, 17557, 105139}}, {9029, 17, 28141, {1, 3, 7, 7, 17, 51, 83, 29, 113, 173, 1733, 2137, 3041, 11361, 15999, 25779, 112493}}, {9030, 17, 28149, {1, 3, 5, 11, 19, 3, 89, 103, 449, 375, 437, 4077, 889, 12163, 29323, 48845, 7783}}, {9031, 17, 28165, {1, 3, 7, 1, 19, 25, 83, 35, 203, 27, 507, 25, 6629, 13941, 6187, 17533, 83349}}, {9032, 17, 28177, {1, 3, 5, 9, 15, 59, 3, 87, 473, 733, 1263, 1733, 4275, 9283, 32535, 20807, 59487}}, {9033, 17, 28189, {1, 3, 3, 9, 19, 11, 27, 83, 355, 949, 1339, 171, 921, 14171, 16271, 41485, 20405}}, {9034, 17, 28190, {1, 1, 3, 11, 25, 51, 9, 241, 367, 519, 1895, 429, 7689, 9469, 32709, 46363, 75767}}, {9035, 17, 28203, {1, 1, 7, 7, 27, 59, 85, 87, 467, 273, 1763, 391, 451, 16165, 7501, 44779, 68281}}, {9036, 17, 28206, {1, 1, 7, 5, 1, 35, 5, 217, 31, 145, 1151, 2255, 3543, 401, 17141, 5981, 25183}}, {9037, 17, 28208, {1, 1, 1, 13, 11, 11, 19, 93, 95, 751, 31, 1091, 2733, 10517, 2553, 5247, 42651}}, {9038, 17, 28220, {1, 3, 7, 5, 15, 1, 67, 21, 303, 137, 355, 1989, 5211, 4985, 645, 6867, 126931}}, {9039, 17, 28226, {1, 1, 3, 15, 21, 23, 59, 209, 121, 623, 575, 2447, 6149, 10481, 4959, 22913, 64963}}, {9040, 17, 28231, {1, 3, 1, 1, 25, 55, 47, 95, 215, 609, 639, 1023, 1579, 5953, 3063, 13721, 17607}}, {9041, 17, 28249, {1, 1, 1, 11, 7, 61, 127, 173, 307, 623, 453, 3827, 4847, 16085, 4407, 4043, 14881}}, {9042, 17, 28256, {1, 1, 7, 11, 5, 15, 51, 125, 439, 795, 203, 91, 3543, 6925, 32055, 52277, 26841}}, {9043, 17, 28259, {1, 1, 1, 13, 15, 9, 107, 183, 391, 751, 243, 1105, 8031, 7443, 137, 45695, 80163}}, {9044, 17, 28265, {1, 3, 5, 9, 5, 61, 117, 113, 121, 291, 225, 1705, 4017, 13113, 11035, 28613, 25927}}, {9045, 17, 28266, {1, 1, 3, 11, 27, 9, 45, 85, 309, 991, 1639, 1183, 8013, 14587, 7563, 21111, 48497}}, {9046, 17, 28271, {1, 3, 1, 9, 21, 61, 123, 189, 265, 593, 163, 3681, 2271, 2795, 753, 48019, 129507}}, {9047, 17, 28274, {1, 1, 1, 5, 31, 51, 127, 79, 333, 177, 1723, 1365, 2055, 3063, 10693, 61223, 60659}}, {9048, 17, 28280, {1, 3, 7, 15, 9, 11, 11, 223, 31, 397, 319, 3283, 3765, 4729, 4711, 58323, 114063}}, {9049, 17, 28296, {1, 1, 7, 11, 7, 63, 107, 215, 19, 491, 131, 2491, 6373, 11081, 2159, 1311, 109547}}, {9050, 17, 28316, {1, 3, 5, 5, 21, 13, 105, 21, 193, 447, 1331, 2439, 4165, 15689, 21273, 4007, 55161}}, {9051, 17, 28319, {1, 3, 5, 11, 19, 47, 25, 211, 335, 437, 1041, 2093, 7239, 2869, 18273, 40505, 13681}}, {9052, 17, 28343, {1, 3, 3, 15, 7, 13, 127, 59, 439, 163, 1841, 1945, 4915, 16269, 18315, 15057, 43197}}, {9053, 17, 28344, {1, 1, 3, 3, 15, 33, 101, 241, 131, 353, 1749, 3965, 1231, 8167, 9309, 40337, 4419}}, {9054, 17, 28357, {1, 3, 1, 1, 1, 43, 33, 129, 137, 889, 799, 2937, 3633, 4769, 2411, 56059, 585}}, {9055, 17, 28358, {1, 1, 3, 9, 25, 31, 45, 199, 229, 175, 1099, 1143, 1721, 11811, 22757, 59843, 117813}}, {9056, 17, 28364, {1, 1, 7, 7, 19, 45, 43, 101, 219, 209, 1169, 599, 5523, 2463, 15161, 16675, 85111}}, {9057, 17, 28370, {1, 1, 3, 15, 23, 27, 91, 51, 397, 705, 651, 2345, 3875, 10005, 29523, 42805, 76891}}, {9058, 17, 28372, {1, 3, 3, 5, 29, 49, 17, 233, 149, 821, 1953, 1931, 7127, 957, 6477, 21259, 126657}}, {9059, 17, 28379, {1, 3, 3, 3, 27, 49, 57, 145, 143, 1, 583, 3987, 651, 12285, 20139, 51063, 21449}}, {9060, 17, 28388, {1, 1, 3, 5, 29, 61, 41, 93, 277, 111, 395, 2929, 5325, 15183, 3981, 23799, 72781}}, {9061, 17, 28392, {1, 1, 7, 5, 25, 43, 85, 137, 401, 261, 1183, 3959, 1983, 16209, 30523, 429, 109181}}, {9062, 17, 28395, {1, 1, 1, 5, 7, 19, 79, 237, 373, 929, 907, 1771, 6991, 211, 5269, 2135, 32051}}, {9063, 17, 28406, {1, 1, 7, 5, 17, 15, 41, 49, 363, 15, 1483, 1017, 2439, 11713, 19983, 26275, 11945}}, {9064, 17, 28418, {1, 1, 7, 7, 19, 5, 55, 15, 15, 573, 1075, 3225, 6815, 11893, 18417, 50833, 71903}}, {9065, 17, 28423, {1, 1, 7, 9, 23, 37, 75, 3, 477, 291, 37, 1861, 2697, 13369, 24573, 27285, 96757}}, {9066, 17, 28435, {1, 1, 1, 13, 5, 29, 65, 195, 365, 465, 865, 2705, 5249, 7051, 3795, 56611, 72317}}, {9067, 17, 28444, {1, 1, 3, 9, 19, 9, 85, 239, 509, 313, 1137, 2221, 5475, 71, 11901, 1877, 68701}}, {9068, 17, 28454, {1, 3, 3, 7, 3, 53, 55, 223, 441, 159, 933, 2573, 3441, 3295, 25005, 29021, 97145}}, {9069, 17, 28468, {1, 3, 5, 5, 3, 11, 101, 181, 293, 319, 47, 2971, 387, 4697, 26613, 8531, 20461}}, {9070, 17, 28477, {1, 3, 3, 13, 17, 11, 41, 233, 455, 353, 1817, 3065, 4657, 1717, 3039, 10937, 107085}}, {9071, 17, 28478, {1, 1, 7, 1, 17, 23, 85, 5, 291, 725, 1791, 3525, 7705, 6561, 25311, 44679, 21419}}, {9072, 17, 28480, {1, 1, 7, 1, 23, 41, 97, 117, 435, 261, 2007, 965, 6913, 12245, 25723, 8445, 30871}}, {9073, 17, 28486, {1, 1, 1, 15, 29, 39, 101, 33, 55, 1019, 1431, 2601, 3837, 14873, 11785, 12449, 30815}}, {9074, 17, 28489, {1, 1, 5, 3, 15, 35, 101, 7, 479, 535, 1875, 2435, 1461, 13967, 2755, 45879, 93561}}, {9075, 17, 28500, {1, 3, 1, 5, 29, 57, 89, 209, 473, 289, 1843, 2051, 3997, 1753, 18179, 41355, 89301}}, {9076, 17, 28507, {1, 3, 1, 11, 17, 45, 47, 57, 109, 309, 1009, 653, 5175, 15599, 21617, 35353, 55253}}, {9077, 17, 28519, {1, 3, 5, 3, 1, 11, 57, 83, 385, 765, 1887, 785, 2115, 8689, 14783, 14841, 122221}}, {9078, 17, 28523, {1, 3, 5, 11, 11, 5, 77, 115, 189, 371, 887, 3653, 8159, 15737, 6763, 52807, 128841}}, {9079, 17, 28534, {1, 1, 1, 11, 11, 33, 9, 145, 439, 565, 171, 3867, 7149, 4369, 15073, 3277, 25873}}, {9080, 17, 28547, {1, 1, 3, 1, 11, 9, 17, 255, 129, 835, 1705, 1551, 877, 4831, 12717, 2549, 62723}}, {9081, 17, 28549, {1, 1, 7, 11, 17, 33, 21, 195, 143, 153, 1855, 1323, 1225, 16359, 16479, 8883, 76449}}, {9082, 17, 28562, {1, 1, 1, 5, 31, 23, 61, 53, 77, 465, 1983, 4019, 4865, 14721, 18601, 48179, 100453}}, {9083, 17, 28571, {1, 3, 1, 13, 19, 53, 83, 63, 165, 393, 469, 1465, 2669, 10155, 7029, 26185, 121223}}, {9084, 17, 28583, {1, 1, 1, 3, 3, 3, 123, 23, 45, 359, 1063, 847, 3943, 6113, 23749, 30323, 10583}}, {9085, 17, 28584, {1, 3, 5, 15, 1, 55, 65, 149, 139, 217, 141, 2425, 7019, 14127, 11725, 50821, 52643}}, {9086, 17, 28595, {1, 3, 5, 15, 13, 13, 15, 93, 457, 869, 117, 585, 7159, 5957, 15073, 21861, 118119}}, {9087, 17, 28597, {1, 3, 1, 15, 3, 31, 29, 245, 47, 895, 197, 1169, 945, 11503, 26615, 14079, 27175}}, {9088, 17, 28604, {1, 3, 5, 5, 31, 1, 107, 109, 253, 999, 1451, 2243, 6675, 10779, 26181, 64597, 16443}}, {9089, 17, 28607, {1, 3, 7, 15, 9, 53, 25, 41, 151, 197, 1955, 2365, 5305, 2901, 24825, 9595, 57377}}, {9090, 17, 28609, {1, 3, 1, 3, 25, 37, 37, 193, 417, 373, 1127, 3239, 4583, 2861, 14501, 64163, 30055}}, {9091, 17, 28612, {1, 3, 7, 9, 7, 21, 49, 231, 241, 95, 1757, 2281, 2679, 1611, 11115, 31743, 26851}}, {9092, 17, 28630, {1, 3, 5, 5, 1, 1, 23, 173, 195, 593, 1639, 1449, 4733, 2451, 12677, 31959, 128217}}, {9093, 17, 28640, {1, 1, 1, 7, 17, 49, 117, 253, 167, 721, 889, 3027, 7781, 13521, 15477, 17981, 95487}}, {9094, 17, 28669, {1, 1, 1, 15, 13, 47, 125, 9, 33, 567, 1733, 1263, 307, 10285, 6325, 55827, 39823}}, {9095, 17, 28677, {1, 1, 1, 15, 23, 3, 11, 169, 369, 667, 313, 2287, 6655, 16067, 5915, 8605, 92177}}, {9096, 17, 28682, {1, 3, 3, 15, 13, 21, 125, 111, 171, 785, 79, 2281, 1247, 11321, 30397, 28555, 84863}}, {9097, 17, 28690, {1, 1, 5, 13, 1, 31, 123, 97, 127, 245, 1213, 2381, 3545, 13545, 28657, 54087, 79039}}, {9098, 17, 28695, {1, 1, 7, 9, 9, 21, 87, 111, 27, 33, 843, 199, 1465, 6555, 8019, 39521, 98883}}, {9099, 17, 28696, {1, 3, 3, 5, 5, 55, 61, 219, 279, 207, 1811, 667, 2989, 3133, 25213, 51979, 87695}}, {9100, 17, 28717, {1, 1, 7, 3, 17, 11, 31, 97, 277, 385, 229, 3045, 557, 13521, 32733, 36831, 43003}}, {9101, 17, 28730, {1, 3, 5, 13, 27, 57, 31, 207, 147, 405, 1495, 2471, 4889, 14861, 4861, 28185, 62363}}, {9102, 17, 28737, {1, 1, 5, 13, 23, 19, 5, 21, 509, 299, 1077, 1747, 6229, 2375, 17903, 58473, 72637}}, {9103, 17, 28752, {1, 3, 7, 11, 15, 61, 63, 165, 27, 461, 1359, 3375, 3029, 9907, 17393, 11097, 43593}}, {9104, 17, 28761, {1, 3, 5, 1, 17, 29, 15, 5, 419, 19, 1981, 3169, 2389, 9169, 31697, 26201, 6997}}, {9105, 17, 28774, {1, 3, 3, 1, 29, 31, 89, 79, 347, 707, 505, 2087, 2163, 5465, 8677, 11421, 93217}}, {9106, 17, 28783, {1, 3, 7, 9, 3, 23, 75, 215, 7, 971, 925, 3223, 7825, 12347, 19763, 10927, 41245}}, {9107, 17, 28791, {1, 3, 5, 5, 3, 43, 119, 79, 373, 761, 709, 1897, 3953, 13895, 13421, 16939, 112449}}, {9108, 17, 28801, {1, 1, 3, 15, 11, 25, 65, 101, 315, 1005, 1319, 1163, 161, 15331, 4845, 40375, 121361}}, {9109, 17, 28802, {1, 1, 3, 7, 1, 57, 63, 131, 145, 1007, 549, 2327, 1513, 3591, 10839, 56297, 80613}}, {9110, 17, 28814, {1, 1, 3, 5, 1, 19, 79, 81, 505, 945, 65, 319, 6105, 5491, 13257, 4651, 48247}}, {9111, 17, 28837, {1, 3, 1, 9, 27, 41, 61, 41, 421, 707, 1279, 3699, 2403, 4075, 16947, 53435, 2917}}, {9112, 17, 28838, {1, 1, 5, 13, 11, 29, 35, 141, 313, 769, 749, 4025, 2597, 12197, 32265, 32159, 37003}}, {9113, 17, 28842, {1, 3, 7, 11, 25, 63, 121, 15, 273, 877, 637, 409, 5001, 4723, 27985, 55501, 43495}}, {9114, 17, 28844, {1, 3, 1, 13, 27, 29, 127, 65, 275, 967, 1723, 4007, 6147, 13277, 8361, 12305, 95433}}, {9115, 17, 28849, {1, 3, 3, 13, 11, 45, 7, 101, 169, 361, 517, 2897, 4283, 7587, 7495, 31549, 29113}}, {9116, 17, 28864, {1, 3, 3, 1, 9, 27, 65, 15, 279, 127, 1039, 829, 5739, 1949, 24789, 30433, 54503}}, {9117, 17, 28867, {1, 3, 7, 5, 13, 19, 95, 133, 25, 271, 1527, 3571, 101, 15987, 10985, 55761, 39833}}, {9118, 17, 28881, {1, 3, 5, 9, 27, 5, 37, 219, 249, 947, 1063, 4081, 1763, 15003, 23753, 3975, 109803}}, {9119, 17, 28882, {1, 3, 3, 5, 21, 37, 35, 145, 323, 573, 1939, 885, 4645, 4515, 16815, 28783, 76017}}, {9120, 17, 28893, {1, 3, 7, 13, 27, 41, 39, 123, 423, 949, 1487, 2207, 8069, 15337, 20671, 20163, 70667}}, {9121, 17, 28903, {1, 1, 3, 3, 15, 29, 69, 15, 151, 729, 35, 2067, 6715, 12759, 27611, 54133, 16561}}, {9122, 17, 28907, {1, 3, 7, 13, 21, 13, 7, 161, 327, 339, 535, 2059, 413, 11161, 18415, 12415, 63713}}, {9123, 17, 28909, {1, 3, 5, 5, 23, 49, 9, 181, 417, 339, 1013, 1707, 5097, 13319, 18951, 56415, 14397}}, {9124, 17, 28921, {1, 1, 5, 7, 29, 23, 117, 159, 287, 695, 71, 2393, 2655, 6417, 24349, 20441, 77987}}, {9125, 17, 28927, {1, 1, 5, 7, 31, 23, 81, 125, 145, 141, 1459, 4095, 713, 1817, 9263, 21025, 91983}}, {9126, 17, 28929, {1, 1, 1, 9, 17, 23, 91, 39, 459, 299, 1951, 3229, 6229, 3267, 15883, 31719, 96573}}, {9127, 17, 28935, {1, 1, 1, 15, 3, 51, 9, 7, 455, 653, 1447, 153, 8117, 723, 2177, 9107, 7757}}, {9128, 17, 28941, {1, 3, 1, 15, 27, 47, 49, 245, 499, 807, 175, 1653, 1693, 3931, 27479, 30095, 62353}}, {9129, 17, 28942, {1, 1, 5, 5, 23, 7, 15, 193, 499, 193, 201, 2771, 4153, 11533, 25883, 23337, 126685}}, {9130, 17, 28954, {1, 1, 1, 7, 9, 43, 125, 181, 425, 557, 1401, 2593, 1933, 6803, 20021, 32687, 126465}}, {9131, 17, 28959, {1, 3, 3, 13, 27, 19, 99, 29, 395, 765, 1137, 2963, 7397, 9695, 19259, 27965, 83157}}, {9132, 17, 28960, {1, 3, 7, 7, 17, 29, 7, 241, 5, 281, 1489, 1599, 5567, 4579, 7739, 41413, 110571}}, {9133, 17, 28990, {1, 3, 3, 9, 7, 5, 83, 1, 231, 1003, 631, 2557, 831, 6495, 30409, 53519, 79331}}, {9134, 17, 28992, {1, 1, 5, 1, 7, 49, 45, 241, 201, 551, 1645, 2003, 1455, 3317, 23639, 7841, 100765}}, {9135, 17, 29004, {1, 3, 5, 13, 25, 47, 103, 37, 81, 263, 1143, 801, 5863, 6871, 8615, 57363, 90161}}, {9136, 17, 29010, {1, 3, 7, 11, 27, 23, 119, 211, 473, 207, 605, 637, 3369, 7287, 27827, 25003, 65925}}, {9137, 17, 29012, {1, 3, 1, 15, 27, 31, 97, 247, 75, 893, 1099, 3609, 6807, 4393, 10253, 62759, 89971}}, {9138, 17, 29021, {1, 1, 7, 15, 27, 19, 43, 59, 419, 263, 387, 3193, 5589, 4197, 19143, 64749, 103093}}, {9139, 17, 29035, {1, 1, 7, 11, 21, 51, 97, 227, 251, 869, 1927, 2331, 7741, 8207, 12885, 13267, 17945}}, {9140, 17, 29040, {1, 1, 7, 7, 5, 53, 41, 147, 75, 709, 607, 1073, 2853, 8081, 12797, 5279, 86083}}, {9141, 17, 29059, {1, 1, 5, 5, 15, 21, 77, 189, 269, 595, 197, 3117, 5073, 14277, 26867, 49505, 75755}}, {9142, 17, 29068, {1, 3, 5, 15, 13, 55, 1, 223, 135, 367, 735, 3139, 4851, 9773, 11699, 19081, 26011}}, {9143, 17, 29080, {1, 3, 5, 7, 9, 3, 89, 103, 321, 727, 1809, 3527, 6881, 2399, 13593, 27867, 16219}}, {9144, 17, 29086, {1, 3, 3, 1, 23, 5, 53, 51, 403, 753, 2037, 1261, 7575, 2725, 11341, 18533, 98767}}, {9145, 17, 29089, {1, 1, 1, 11, 1, 13, 37, 141, 477, 689, 1789, 1913, 5753, 6069, 6965, 55209, 77329}}, {9146, 17, 29090, {1, 3, 7, 3, 17, 59, 79, 249, 381, 163, 1773, 1645, 7295, 2359, 21889, 28429, 117073}}, {9147, 17, 29095, {1, 3, 5, 15, 7, 45, 59, 3, 93, 259, 1257, 2967, 1175, 10171, 873, 51423, 67437}}, {9148, 17, 29113, {1, 1, 7, 13, 17, 33, 53, 217, 159, 683, 1169, 3363, 4591, 3959, 10089, 35443, 99677}}, {9149, 17, 29127, {1, 3, 7, 9, 3, 1, 5, 171, 17, 635, 369, 1529, 4861, 4977, 29303, 42357, 69309}}, {9150, 17, 29131, {1, 3, 7, 9, 21, 17, 77, 127, 105, 427, 525, 1123, 2365, 7487, 6315, 64773, 122747}}, {9151, 17, 29148, {1, 1, 1, 15, 19, 63, 65, 83, 219, 987, 169, 2589, 3809, 8807, 22473, 6479, 44617}}, {9152, 17, 29161, {1, 3, 1, 7, 11, 51, 107, 19, 379, 191, 1013, 3145, 1501, 11871, 14111, 18269, 98247}}, {9153, 17, 29172, {1, 1, 7, 5, 17, 63, 23, 231, 423, 855, 1955, 907, 4553, 16173, 7701, 40329, 42047}}, {9154, 17, 29179, {1, 3, 7, 1, 7, 45, 103, 127, 185, 721, 1035, 839, 691, 6823, 23819, 50781, 92767}}, {9155, 17, 29188, {1, 1, 1, 3, 9, 21, 57, 253, 285, 85, 1227, 365, 2347, 7491, 15183, 8619, 108819}}, {9156, 17, 29192, {1, 1, 3, 15, 27, 13, 5, 85, 45, 1009, 1315, 1749, 2797, 3941, 19367, 50855, 60693}}, {9157, 17, 29195, {1, 3, 5, 15, 29, 63, 115, 197, 317, 601, 711, 377, 7489, 4247, 4843, 56549, 108447}}, {9158, 17, 29206, {1, 3, 7, 15, 11, 25, 7, 145, 371, 395, 1743, 267, 2609, 15707, 13909, 55031, 71115}}, {9159, 17, 29210, {1, 3, 1, 1, 1, 53, 111, 245, 433, 309, 245, 15, 2091, 9051, 11095, 31821, 104535}}, {9160, 17, 29215, {1, 3, 1, 15, 25, 31, 99, 89, 259, 595, 1095, 3681, 5105, 8671, 23663, 29717, 126429}}, {9161, 17, 29221, {1, 3, 7, 7, 5, 31, 15, 59, 109, 527, 257, 1785, 6799, 1283, 11741, 34589, 102397}}, {9162, 17, 29222, {1, 3, 3, 15, 9, 27, 55, 35, 291, 587, 1281, 779, 4615, 373, 24037, 64671, 124019}}, {9163, 17, 29236, {1, 1, 5, 5, 13, 51, 49, 19, 37, 857, 539, 1291, 6021, 8645, 30351, 33839, 111515}}, {9164, 17, 29246, {1, 1, 5, 13, 3, 47, 9, 197, 19, 337, 2025, 3003, 7179, 5755, 31187, 59317, 69753}}, {9165, 17, 29248, {1, 1, 7, 3, 3, 43, 11, 3, 123, 29, 857, 3349, 791, 11157, 23967, 33729, 28445}}, {9166, 17, 29253, {1, 1, 5, 1, 1, 11, 73, 231, 173, 925, 331, 161, 3303, 11015, 17507, 21271, 56865}}, {9167, 17, 29272, {1, 1, 3, 9, 21, 21, 115, 145, 421, 981, 1789, 3343, 7591, 12043, 5795, 17737, 106501}}, {9168, 17, 29288, {1, 1, 7, 13, 7, 15, 51, 75, 497, 637, 1073, 1505, 5613, 1415, 30861, 26159, 79573}}, {9169, 17, 29293, {1, 1, 3, 15, 17, 35, 17, 129, 169, 283, 1383, 149, 211, 1381, 22205, 28367, 831}}, {9170, 17, 29294, {1, 3, 5, 5, 17, 11, 127, 183, 503, 499, 2011, 2721, 2717, 3105, 4731, 60319, 9361}}, {9171, 17, 29308, {1, 1, 1, 7, 27, 55, 77, 203, 255, 761, 1159, 2915, 4479, 13671, 19757, 65497, 4461}}, {9172, 17, 29318, {1, 3, 1, 9, 9, 51, 67, 205, 445, 35, 371, 1837, 3623, 10365, 19463, 59005, 3185}}, {9173, 17, 29321, {1, 3, 7, 3, 23, 5, 51, 141, 293, 489, 263, 2187, 1259, 2729, 1779, 61027, 53931}}, {9174, 17, 29322, {1, 1, 1, 15, 27, 7, 15, 109, 475, 839, 175, 953, 4531, 437, 22475, 24167, 19051}}, {9175, 17, 29339, {1, 1, 7, 9, 25, 23, 41, 107, 299, 115, 1713, 1559, 5701, 5427, 28813, 39913, 15941}}, {9176, 17, 29365, {1, 3, 5, 7, 5, 25, 99, 9, 307, 591, 1303, 3501, 1589, 12095, 26629, 52127, 60635}}, {9177, 17, 29369, {1, 3, 7, 3, 9, 23, 3, 29, 113, 49, 1601, 541, 1415, 11601, 19165, 46595, 111623}}, {9178, 17, 29372, {1, 1, 3, 11, 5, 53, 37, 153, 51, 41, 1267, 545, 2055, 13137, 7749, 30721, 119591}}, {9179, 17, 29377, {1, 3, 5, 11, 1, 15, 65, 17, 155, 65, 745, 2547, 6351, 2347, 13553, 5785, 129857}}, {9180, 17, 29392, {1, 3, 7, 13, 5, 53, 11, 59, 453, 467, 1275, 3669, 4481, 5229, 2953, 23369, 100161}}, {9181, 17, 29401, {1, 3, 1, 1, 13, 41, 91, 179, 331, 547, 1571, 1787, 6467, 12375, 4579, 45023, 119149}}, {9182, 17, 29402, {1, 3, 3, 5, 17, 55, 105, 57, 227, 323, 1517, 1215, 3149, 13919, 18595, 5525, 82445}}, {9183, 17, 29418, {1, 3, 1, 13, 19, 23, 17, 239, 81, 481, 1625, 2003, 7295, 2185, 7021, 19357, 37867}}, {9184, 17, 29437, {1, 3, 5, 9, 11, 15, 61, 223, 153, 139, 2023, 2579, 495, 14319, 2835, 26541, 113115}}, {9185, 17, 29445, {1, 1, 3, 13, 29, 9, 13, 149, 325, 87, 697, 2345, 2205, 5069, 9939, 61351, 127313}}, {9186, 17, 29446, {1, 1, 7, 11, 13, 53, 45, 197, 167, 551, 439, 3715, 4587, 8549, 28193, 35827, 96721}}, {9187, 17, 29460, {1, 3, 1, 1, 17, 7, 31, 205, 219, 739, 1165, 243, 3877, 15943, 15207, 43857, 120565}}, {9188, 17, 29467, {1, 3, 7, 9, 7, 43, 81, 203, 295, 553, 279, 2717, 9, 751, 24715, 21591, 11485}}, {9189, 17, 29473, {1, 1, 1, 11, 15, 17, 41, 121, 355, 157, 955, 3875, 7595, 235, 4937, 20607, 11401}}, {9190, 17, 29476, {1, 1, 7, 7, 13, 49, 33, 161, 65, 251, 1895, 2665, 3017, 9725, 10797, 46313, 43407}}, {9191, 17, 29488, {1, 1, 3, 9, 23, 17, 127, 69, 385, 875, 461, 3305, 3001, 5875, 13547, 61239, 113571}}, {9192, 17, 29511, {1, 3, 7, 5, 15, 47, 113, 131, 465, 89, 733, 433, 799, 5689, 723, 63479, 106945}}, {9193, 17, 29512, {1, 3, 3, 15, 29, 1, 51, 115, 317, 1021, 1219, 1797, 4005, 10435, 28935, 49467, 66833}}, {9194, 17, 29517, {1, 1, 3, 11, 15, 9, 51, 209, 477, 479, 1099, 2781, 5525, 12715, 9067, 18317, 121671}}, {9195, 17, 29523, {1, 3, 1, 7, 19, 35, 61, 27, 479, 815, 1639, 2825, 7449, 13697, 3079, 49833, 35119}}, {9196, 17, 29526, {1, 3, 7, 3, 17, 53, 95, 155, 505, 185, 717, 3419, 3857, 2369, 14525, 22797, 38553}}, {9197, 17, 29535, {1, 3, 1, 13, 27, 5, 11, 21, 507, 65, 39, 2841, 7887, 2783, 18767, 34171, 40527}}, {9198, 17, 29539, {1, 3, 1, 7, 9, 47, 69, 217, 251, 775, 631, 1967, 5541, 10679, 16439, 33533, 57817}}, {9199, 17, 29545, {1, 1, 5, 11, 27, 57, 103, 255, 359, 745, 63, 3725, 4113, 10943, 7833, 46857, 99239}}, {9200, 17, 29559, {1, 3, 1, 5, 31, 41, 69, 245, 401, 451, 959, 351, 6999, 6187, 21437, 55067, 53547}}, {9201, 17, 29560, {1, 1, 1, 13, 25, 49, 85, 181, 457, 731, 743, 1901, 7013, 12027, 14729, 24193, 89685}}, {9202, 17, 29589, {1, 3, 3, 1, 31, 29, 101, 137, 117, 135, 345, 1419, 7133, 2695, 3631, 53049, 45875}}, {9203, 17, 29593, {1, 1, 1, 13, 11, 51, 95, 221, 339, 655, 201, 3007, 8179, 8093, 22399, 59123, 127319}}, {9204, 17, 29599, {1, 3, 7, 3, 31, 37, 23, 199, 191, 649, 817, 1959, 893, 2333, 21477, 29087, 115667}}, {9205, 17, 29603, {1, 3, 3, 5, 9, 55, 123, 67, 39, 533, 797, 2575, 3955, 14585, 28587, 13079, 60053}}, {9206, 17, 29610, {1, 3, 1, 1, 17, 19, 15, 219, 185, 21, 967, 667, 3361, 3883, 8059, 26199, 80913}}, {9207, 17, 29629, {1, 3, 3, 11, 23, 5, 99, 57, 379, 151, 271, 3735, 7087, 12731, 2949, 54831, 37835}}, {9208, 17, 29644, {1, 3, 1, 7, 21, 25, 9, 195, 497, 585, 901, 19, 7675, 13611, 31155, 14567, 20545}}, {9209, 17, 29656, {1, 1, 3, 3, 27, 45, 51, 169, 397, 531, 673, 2935, 3779, 7169, 23479, 16157, 100237}}, {9210, 17, 29662, {1, 1, 1, 1, 19, 49, 3, 75, 455, 805, 591, 1929, 2883, 2797, 31379, 12025, 120929}}, {9211, 17, 29675, {1, 3, 5, 3, 17, 39, 115, 93, 341, 329, 1857, 2753, 4923, 12539, 25589, 19437, 29027}}, {9212, 17, 29692, {1, 3, 5, 9, 27, 37, 21, 235, 499, 369, 1341, 3719, 6819, 3153, 30619, 50901, 52999}}, {9213, 17, 29704, {1, 3, 1, 11, 3, 55, 43, 219, 83, 771, 783, 3569, 7879, 2363, 30605, 5965, 126855}}, {9214, 17, 29707, {1, 3, 7, 13, 7, 25, 111, 63, 355, 317, 1579, 1523, 2733, 11963, 25205, 20545, 67389}}, {9215, 17, 29715, {1, 3, 5, 7, 3, 17, 55, 99, 321, 633, 2013, 1991, 1019, 9223, 21117, 23337, 90589}}, {9216, 17, 29717, {1, 3, 1, 1, 17, 25, 79, 171, 303, 403, 2037, 2595, 3951, 8021, 8669, 9363, 20345}}, {9217, 17, 29722, {1, 1, 1, 7, 13, 7, 11, 7, 347, 53, 1763, 3097, 3353, 3769, 22947, 20919, 92247}}, {9218, 17, 29731, {1, 3, 5, 11, 19, 29, 91, 191, 511, 705, 1317, 3367, 7, 4999, 30251, 18299, 66983}}, {9219, 17, 29740, {1, 1, 3, 7, 19, 17, 71, 77, 285, 189, 853, 2305, 4205, 15603, 15501, 48073, 11411}}, {9220, 17, 29743, {1, 3, 7, 5, 21, 15, 47, 13, 277, 969, 1861, 3493, 6723, 11521, 22145, 43779, 44713}}, {9221, 17, 29752, {1, 1, 3, 5, 19, 47, 51, 207, 229, 957, 709, 267, 8081, 611, 26403, 14871, 111841}}, {9222, 17, 29760, {1, 3, 7, 1, 19, 43, 71, 73, 405, 351, 1131, 3527, 5949, 14363, 20041, 48123, 68123}}, {9223, 17, 29766, {1, 3, 3, 7, 23, 51, 81, 13, 161, 453, 365, 1089, 3505, 12359, 14277, 56113, 19717}}, {9224, 17, 29770, {1, 1, 1, 7, 29, 35, 103, 137, 317, 417, 1465, 2787, 6935, 9885, 12943, 43937, 28353}}, {9225, 17, 29794, {1, 1, 3, 13, 19, 37, 97, 5, 115, 89, 1005, 3033, 2011, 2633, 10615, 6641, 73385}}, {9226, 17, 29796, {1, 3, 7, 7, 31, 39, 107, 165, 61, 1009, 1159, 865, 3469, 11093, 10425, 43959, 37395}}, {9227, 17, 29814, {1, 3, 5, 9, 7, 51, 99, 91, 37, 457, 39, 2455, 7481, 4929, 29755, 50603, 48943}}, {9228, 17, 29817, {1, 1, 5, 13, 5, 39, 47, 149, 341, 303, 843, 3619, 7527, 8739, 5893, 42623, 99899}}, {9229, 17, 29829, {1, 1, 1, 1, 1, 41, 73, 71, 409, 351, 131, 515, 6657, 337, 23913, 583, 21665}}, {9230, 17, 29841, {1, 1, 3, 3, 11, 45, 39, 113, 315, 965, 1605, 2779, 501, 7429, 2567, 7011, 71445}}, {9231, 17, 29851, {1, 3, 7, 13, 21, 13, 45, 105, 385, 281, 1683, 3997, 6391, 10943, 22349, 37261, 57555}}, {9232, 17, 29860, {1, 1, 3, 5, 17, 55, 109, 71, 393, 561, 433, 1091, 1923, 13861, 12981, 5523, 15467}}, {9233, 17, 29864, {1, 3, 7, 5, 17, 11, 113, 119, 37, 989, 1609, 2191, 1511, 11835, 25423, 793, 15227}}, {9234, 17, 29869, {1, 3, 1, 5, 5, 55, 105, 225, 349, 351, 1259, 1309, 821, 2733, 1357, 3665, 38863}}, {9235, 17, 29870, {1, 3, 5, 1, 23, 61, 49, 113, 169, 319, 85, 1581, 97, 5271, 30625, 37693, 7297}}, {9236, 17, 29889, {1, 3, 5, 1, 1, 25, 31, 125, 307, 731, 1815, 1047, 7251, 12481, 20781, 63275, 51985}}, {9237, 17, 29896, {1, 3, 5, 9, 11, 9, 121, 111, 45, 751, 793, 2593, 6409, 4355, 30183, 36959, 105161}}, {9238, 17, 29901, {1, 1, 3, 9, 25, 37, 95, 253, 401, 481, 1521, 3555, 231, 15459, 1581, 36661, 121727}}, {9239, 17, 29913, {1, 3, 5, 3, 27, 11, 107, 115, 213, 813, 27, 1789, 603, 383, 1129, 63365, 51147}}, {9240, 17, 29919, {1, 1, 3, 13, 25, 7, 33, 1, 97, 907, 35, 4069, 5001, 507, 911, 62037, 22019}}, {9241, 17, 29920, {1, 1, 3, 5, 7, 55, 35, 95, 261, 217, 1565, 3473, 3475, 12181, 569, 27389, 81771}}, {9242, 17, 29947, {1, 1, 3, 5, 11, 33, 95, 121, 453, 711, 361, 3927, 5231, 15685, 31143, 56915, 23707}}, {9243, 17, 29958, {1, 1, 3, 11, 25, 15, 53, 155, 469, 647, 1547, 335, 3753, 12873, 13639, 25129, 79287}}, {9244, 17, 29975, {1, 3, 3, 3, 1, 21, 21, 121, 105, 903, 83, 2287, 4295, 14369, 29183, 26841, 38115}}, {9245, 17, 29981, {1, 1, 7, 11, 5, 29, 65, 191, 389, 419, 1315, 739, 3485, 10587, 2399, 36377, 28789}}, {9246, 17, 29985, {1, 3, 3, 11, 3, 29, 71, 169, 265, 747, 395, 1211, 3487, 15705, 25611, 18183, 85771}}, {9247, 17, 29998, {1, 1, 7, 3, 23, 5, 45, 47, 337, 571, 33, 1221, 5671, 1233, 28361, 36945, 911}}, {9248, 17, 30010, {1, 1, 5, 11, 17, 15, 57, 97, 185, 999, 1277, 3371, 2785, 3341, 13395, 11925, 86777}}, {9249, 17, 30012, {1, 1, 3, 1, 31, 37, 23, 105, 503, 869, 1309, 3733, 4629, 8263, 11763, 30669, 26179}}, {9250, 17, 30044, {1, 1, 3, 15, 25, 61, 37, 27, 325, 413, 809, 2959, 8137, 3397, 21185, 27995, 84297}}, {9251, 17, 30048, {1, 3, 5, 5, 1, 55, 95, 41, 493, 469, 331, 1789, 7037, 7947, 14239, 16109, 51795}}, {9252, 17, 30051, {1, 1, 1, 1, 19, 33, 111, 237, 261, 331, 871, 3539, 1731, 6953, 11345, 37901, 5623}}, {9253, 17, 30063, {1, 1, 5, 7, 21, 41, 49, 179, 49, 797, 231, 1299, 145, 7743, 725, 60595, 19581}}, {9254, 17, 30065, {1, 3, 7, 15, 7, 43, 67, 219, 133, 641, 1657, 2301, 1591, 12309, 6395, 3999, 92961}}, {9255, 17, 30072, {1, 1, 1, 5, 1, 49, 37, 81, 219, 323, 461, 1379, 1797, 14825, 21811, 7347, 35643}}, {9256, 17, 30077, {1, 1, 1, 11, 1, 3, 83, 31, 307, 83, 1169, 3277, 1875, 13397, 20265, 46707, 15205}}, {9257, 17, 30087, {1, 3, 7, 11, 29, 41, 69, 33, 405, 991, 1937, 1217, 2137, 8657, 4319, 41119, 43371}}, {9258, 17, 30088, {1, 3, 3, 3, 25, 49, 107, 197, 347, 923, 1585, 3023, 4087, 13875, 22015, 35733, 33755}}, {9259, 17, 30101, {1, 3, 3, 5, 15, 61, 89, 249, 141, 853, 1469, 999, 7425, 10015, 12341, 51535, 61619}}, {9260, 17, 30112, {1, 1, 7, 13, 31, 61, 89, 113, 117, 429, 1011, 1589, 1419, 5083, 4843, 26759, 47401}}, {9261, 17, 30121, {1, 1, 7, 9, 17, 37, 119, 39, 499, 93, 1155, 3069, 2033, 12483, 29849, 40077, 11103}}, {9262, 17, 30122, {1, 3, 1, 15, 11, 5, 23, 121, 283, 717, 1573, 3911, 2031, 2617, 20387, 33157, 301}}, {9263, 17, 30130, {1, 3, 5, 7, 17, 61, 109, 3, 205, 617, 1171, 223, 6609, 15027, 2629, 15801, 73749}}, {9264, 17, 30135, {1, 1, 3, 7, 5, 49, 9, 73, 333, 401, 675, 2765, 993, 77, 19237, 60929, 88703}}, {9265, 17, 30139, {1, 1, 1, 9, 21, 25, 53, 249, 241, 43, 1959, 545, 3729, 11395, 3027, 12661, 87729}}, {9266, 17, 30142, {1, 3, 3, 15, 15, 61, 33, 59, 155, 773, 1043, 3111, 6549, 5397, 29099, 57851, 107671}}, {9267, 17, 30164, {1, 3, 7, 1, 29, 29, 1, 161, 273, 883, 1913, 2389, 401, 9425, 17613, 50443, 84601}}, {9268, 17, 30167, {1, 3, 7, 11, 15, 63, 41, 53, 371, 153, 1491, 3013, 6635, 4955, 30145, 20175, 16541}}, {9269, 17, 30180, {1, 3, 3, 11, 31, 27, 127, 207, 11, 313, 1067, 3445, 3075, 4071, 28305, 58911, 85273}}, {9270, 17, 30202, {1, 1, 7, 11, 17, 47, 77, 119, 209, 657, 1181, 459, 5821, 4267, 5757, 53703, 35621}}, {9271, 17, 30211, {1, 3, 1, 15, 27, 41, 3, 217, 457, 531, 1749, 2847, 4715, 11451, 25071, 53999, 93503}}, {9272, 17, 30214, {1, 3, 5, 3, 19, 29, 9, 177, 355, 265, 883, 1113, 2397, 1819, 20757, 50389, 95551}}, {9273, 17, 30217, {1, 1, 3, 15, 3, 45, 85, 211, 377, 293, 1791, 1193, 1117, 9383, 28039, 27155, 129513}}, {9274, 17, 30223, {1, 1, 7, 5, 1, 17, 59, 215, 161, 933, 1653, 2407, 2693, 3655, 7515, 2239, 88985}}, {9275, 17, 30228, {1, 1, 3, 11, 31, 3, 1, 77, 459, 817, 651, 603, 1711, 9391, 20607, 48195, 127153}}, {9276, 17, 30235, {1, 1, 5, 13, 11, 49, 25, 13, 51, 443, 1877, 1257, 163, 4673, 30313, 18841, 24547}}, {9277, 17, 30256, {1, 1, 7, 7, 15, 33, 43, 79, 127, 625, 1991, 1311, 2095, 14659, 3477, 56023, 57955}}, {9278, 17, 30265, {1, 3, 7, 15, 29, 7, 119, 183, 123, 323, 1723, 959, 2733, 2097, 2927, 57595, 86067}}, {9279, 17, 30286, {1, 3, 5, 5, 29, 57, 93, 139, 495, 739, 1715, 713, 243, 2027, 11223, 44143, 119155}}, {9280, 17, 30293, {1, 3, 1, 9, 3, 63, 113, 29, 19, 439, 869, 1101, 4947, 2191, 14737, 57049, 93505}}, {9281, 17, 30298, {1, 1, 7, 1, 11, 39, 27, 29, 281, 829, 1979, 2185, 2207, 14969, 7447, 55541, 59593}}, {9282, 17, 30310, {1, 1, 7, 13, 11, 15, 15, 143, 383, 469, 1439, 2823, 7489, 7675, 15433, 26203, 80433}}, {9283, 17, 30314, {1, 1, 1, 7, 15, 45, 23, 93, 477, 1, 1431, 3173, 7879, 12211, 13051, 56971, 114289}}, {9284, 17, 30327, {1, 3, 1, 1, 27, 55, 61, 185, 323, 569, 1063, 1357, 7373, 14947, 15967, 64517, 104625}}, {9285, 17, 30333, {1, 1, 5, 11, 25, 1, 127, 163, 419, 657, 911, 361, 3675, 10765, 24565, 2661, 61979}}, {9286, 17, 30334, {1, 3, 7, 15, 29, 53, 29, 149, 465, 535, 1865, 2243, 4783, 9327, 24843, 52313, 15683}}, {9287, 17, 30337, {1, 1, 7, 7, 17, 7, 85, 187, 91, 1013, 1917, 2959, 3571, 12047, 25267, 34095, 9877}}, {9288, 17, 30338, {1, 1, 1, 7, 5, 27, 111, 107, 313, 571, 1081, 3193, 1025, 2589, 1523, 40453, 77065}}, {9289, 17, 30344, {1, 3, 7, 1, 19, 27, 1, 103, 479, 405, 583, 1737, 3495, 9093, 20397, 16429, 45609}}, {9290, 17, 30349, {1, 1, 3, 11, 17, 1, 125, 97, 261, 651, 901, 1245, 1181, 14469, 16229, 31935, 100227}}, {9291, 17, 30352, {1, 1, 7, 11, 15, 1, 19, 151, 453, 833, 1371, 1109, 5373, 25, 5619, 58351, 26349}}, {9292, 17, 30362, {1, 1, 7, 15, 17, 55, 51, 67, 123, 13, 1873, 1035, 5871, 11943, 11543, 43261, 62587}}, {9293, 17, 30374, {1, 3, 1, 13, 21, 15, 83, 205, 333, 379, 2021, 1389, 861, 10395, 20587, 38207, 49109}}, {9294, 17, 30380, {1, 1, 5, 3, 13, 49, 89, 85, 463, 1005, 1367, 3487, 581, 12145, 22445, 35343, 65745}}, {9295, 17, 30388, {1, 3, 3, 3, 29, 27, 99, 195, 89, 793, 1677, 3989, 4811, 8303, 9165, 50349, 96947}}, {9296, 17, 30391, {1, 1, 3, 5, 29, 11, 91, 107, 13, 659, 213, 1613, 2245, 11567, 28157, 2937, 53275}}, {9297, 17, 30395, {1, 3, 7, 5, 3, 41, 65, 27, 93, 747, 1143, 505, 3881, 2123, 2903, 54137, 96185}}, {9298, 17, 30403, {1, 1, 3, 15, 9, 49, 3, 25, 77, 681, 1709, 915, 2243, 2127, 18243, 13915, 67399}}, {9299, 17, 30409, {1, 3, 5, 7, 13, 49, 89, 67, 63, 271, 1651, 897, 4035, 1067, 13743, 56791, 44371}}, {9300, 17, 30424, {1, 1, 7, 9, 25, 19, 125, 15, 125, 705, 1359, 817, 1241, 12447, 19097, 33209, 89091}}, {9301, 17, 30427, {1, 3, 7, 3, 19, 43, 127, 197, 39, 709, 257, 3547, 3069, 1187, 21255, 6453, 40763}}, {9302, 17, 30430, {1, 3, 3, 5, 3, 53, 37, 65, 415, 183, 991, 533, 7805, 9905, 18925, 52665, 100987}}, {9303, 17, 30451, {1, 3, 3, 11, 17, 41, 17, 137, 143, 277, 945, 1531, 7427, 7287, 30869, 27651, 116507}}, {9304, 17, 30460, {1, 1, 1, 3, 13, 3, 9, 163, 113, 373, 1909, 1051, 97, 10729, 28615, 40081, 129297}}, {9305, 17, 30475, {1, 3, 3, 9, 11, 47, 113, 27, 307, 339, 1319, 3083, 7383, 1551, 26691, 28769, 114313}}, {9306, 17, 30480, {1, 3, 7, 7, 25, 49, 31, 231, 485, 629, 59, 283, 7463, 6603, 23055, 63643, 10121}}, {9307, 17, 30485, {1, 3, 7, 9, 5, 55, 53, 127, 147, 103, 1697, 485, 7051, 14153, 21631, 35561, 10393}}, {9308, 17, 30486, {1, 3, 3, 7, 23, 7, 83, 17, 135, 487, 315, 719, 7003, 3919, 13255, 24031, 110493}}, {9309, 17, 30489, {1, 3, 1, 15, 27, 55, 121, 177, 205, 733, 933, 1535, 2925, 4259, 22203, 59059, 89209}}, {9310, 17, 30492, {1, 1, 1, 11, 9, 11, 127, 47, 493, 349, 1415, 3089, 4739, 14347, 31579, 20739, 72997}}, {9311, 17, 30499, {1, 3, 1, 7, 9, 31, 121, 111, 163, 733, 1699, 1507, 5467, 13499, 25269, 6303, 70201}}, {9312, 17, 30511, {1, 3, 1, 5, 7, 23, 123, 203, 329, 387, 577, 2331, 2283, 14029, 19409, 103, 2477}}, {9313, 17, 30533, {1, 1, 7, 15, 11, 29, 29, 153, 289, 333, 1669, 2065, 5465, 8835, 28753, 21209, 34283}}, {9314, 17, 30534, {1, 3, 5, 11, 15, 33, 45, 81, 241, 461, 1167, 1073, 5511, 795, 30955, 49121, 42805}}, {9315, 17, 30540, {1, 1, 1, 13, 7, 33, 11, 201, 161, 475, 1359, 2329, 177, 9883, 8967, 21399, 73045}}, {9316, 17, 30545, {1, 3, 3, 1, 25, 59, 85, 51, 481, 751, 1213, 3019, 421, 9903, 30071, 50661, 94715}}, {9317, 17, 30552, {1, 3, 3, 1, 5, 61, 3, 179, 131, 233, 1627, 3577, 6323, 14161, 21595, 44963, 20215}}, {9318, 17, 30557, {1, 1, 1, 5, 9, 53, 45, 105, 275, 769, 105, 2757, 6769, 14987, 19955, 18291, 81707}}, {9319, 17, 30558, {1, 1, 7, 1, 1, 59, 33, 19, 385, 775, 423, 1799, 1325, 13545, 16027, 58347, 102397}}, {9320, 17, 30567, {1, 1, 3, 11, 15, 61, 63, 59, 355, 659, 1483, 3781, 7383, 5563, 32537, 34175, 40303}}, {9321, 17, 30568, {1, 3, 5, 7, 5, 37, 19, 223, 323, 129, 287, 2655, 3767, 16201, 4147, 315, 54885}}, {9322, 17, 30581, {1, 1, 7, 13, 13, 23, 43, 129, 405, 205, 1691, 2189, 3313, 11789, 10263, 16367, 65547}}, {9323, 17, 30597, {1, 3, 5, 1, 15, 21, 85, 233, 427, 71, 475, 3731, 3335, 11483, 28613, 4335, 35669}}, {9324, 17, 30607, {1, 1, 3, 3, 31, 47, 27, 109, 373, 451, 1459, 3103, 1941, 10405, 20233, 30517, 122787}}, {9325, 17, 30621, {1, 3, 1, 7, 3, 11, 113, 49, 355, 465, 1959, 1355, 6521, 10863, 11481, 13385, 31787}}, {9326, 17, 30632, {1, 3, 1, 1, 9, 45, 125, 69, 267, 413, 717, 2767, 833, 317, 23019, 37753, 3081}}, {9327, 17, 30650, {1, 1, 7, 7, 13, 55, 75, 105, 71, 505, 239, 3739, 4873, 4257, 18841, 41711, 24045}}, {9328, 17, 30655, {1, 1, 5, 13, 21, 59, 107, 229, 421, 441, 1079, 3727, 7941, 8443, 30433, 56419, 105751}}, {9329, 17, 30657, {1, 1, 1, 9, 15, 59, 29, 49, 117, 1009, 1971, 115, 2899, 1069, 29145, 11855, 35277}}, {9330, 17, 30660, {1, 3, 7, 15, 19, 55, 111, 77, 169, 537, 1695, 2687, 3871, 14017, 15119, 27313, 112807}}, {9331, 17, 30669, {1, 1, 3, 7, 29, 5, 41, 201, 211, 127, 1877, 643, 2441, 8743, 29393, 6077, 52597}}, {9332, 17, 30675, {1, 3, 1, 11, 7, 1, 95, 15, 229, 339, 475, 3463, 7827, 9943, 30903, 65013, 1145}}, {9333, 17, 30678, {1, 1, 1, 5, 23, 19, 81, 23, 475, 169, 373, 1147, 1805, 12779, 13173, 8945, 28175}}, {9334, 17, 30682, {1, 3, 5, 9, 3, 53, 127, 33, 237, 803, 121, 307, 4981, 8765, 12761, 23601, 92921}}, {9335, 17, 30687, {1, 1, 3, 7, 17, 63, 11, 37, 213, 619, 1095, 1693, 6747, 7373, 17355, 5987, 97923}}, {9336, 17, 30688, {1, 1, 3, 15, 11, 37, 109, 175, 503, 339, 591, 2745, 2387, 7419, 13915, 4769, 48229}}, {9337, 17, 30698, {1, 3, 5, 7, 19, 17, 5, 81, 471, 989, 249, 437, 7309, 5747, 25277, 31911, 87907}}, {9338, 17, 30711, {1, 3, 1, 7, 15, 25, 49, 243, 423, 911, 1957, 911, 6331, 9831, 26021, 58877, 99257}}, {9339, 17, 30728, {1, 3, 5, 11, 3, 55, 39, 129, 271, 145, 1973, 3391, 2905, 9229, 7989, 15641, 67933}}, {9340, 17, 30733, {1, 3, 5, 9, 13, 13, 43, 135, 183, 319, 1391, 2953, 2207, 14205, 31203, 6329, 98907}}, {9341, 17, 30741, {1, 3, 1, 9, 27, 41, 27, 155, 11, 191, 1747, 975, 7043, 13139, 30387, 47099, 120321}}, {9342, 17, 30746, {1, 1, 5, 9, 25, 27, 53, 235, 437, 77, 371, 2413, 4867, 14245, 27199, 37387, 88217}}, {9343, 17, 30752, {1, 1, 7, 7, 11, 59, 103, 15, 109, 65, 1987, 3695, 7737, 7341, 26963, 16075, 6301}}, {9344, 17, 30764, {1, 3, 7, 5, 7, 59, 109, 159, 121, 377, 1851, 3983, 5421, 7633, 7321, 14869, 54633}}, {9345, 17, 30769, {1, 1, 3, 15, 21, 51, 35, 243, 397, 411, 1107, 3689, 7913, 14715, 26349, 23361, 90665}}, {9346, 17, 30784, {1, 1, 1, 3, 5, 11, 77, 205, 187, 981, 1969, 1749, 6295, 8267, 16073, 54451, 103603}}, {9347, 17, 30796, {1, 3, 3, 9, 11, 13, 113, 83, 243, 1021, 2003, 2277, 6457, 10535, 13461, 52741, 9385}}, {9348, 17, 30799, {1, 3, 3, 11, 19, 9, 103, 13, 219, 269, 1805, 2689, 5219, 11497, 4909, 57985, 40141}}, {9349, 17, 30804, {1, 1, 1, 1, 29, 25, 15, 217, 69, 567, 839, 1515, 3627, 9837, 21433, 37177, 10487}}, {9350, 17, 30811, {1, 1, 7, 15, 15, 23, 119, 217, 277, 447, 551, 825, 7571, 3083, 16573, 1189, 64959}}, {9351, 17, 30814, {1, 1, 3, 11, 9, 13, 63, 77, 313, 195, 941, 1621, 165, 8905, 20265, 53761, 25091}}, {9352, 17, 30818, {1, 3, 3, 9, 17, 5, 9, 183, 175, 1015, 253, 233, 2883, 15587, 27175, 38517, 22707}}, {9353, 17, 30827, {1, 3, 3, 11, 23, 63, 83, 17, 49, 671, 749, 3249, 7821, 7189, 26735, 28995, 101737}}, {9354, 17, 30838, {1, 1, 7, 5, 25, 15, 97, 247, 161, 585, 1307, 3803, 1105, 9093, 23523, 1383, 65671}}, {9355, 17, 30842, {1, 1, 3, 15, 29, 51, 65, 237, 349, 709, 799, 1425, 6267, 6283, 4773, 18123, 74833}}, {9356, 17, 30854, {1, 1, 5, 5, 11, 13, 9, 251, 373, 189, 467, 945, 7279, 11349, 10917, 6581, 83967}}, {9357, 17, 30863, {1, 1, 7, 15, 23, 27, 1, 197, 41, 325, 757, 1229, 6295, 345, 26147, 40135, 123063}}, {9358, 17, 30865, {1, 1, 7, 9, 23, 9, 93, 225, 191, 837, 103, 3367, 5411, 8289, 7057, 55391, 10669}}, {9359, 17, 30877, {1, 1, 5, 15, 21, 17, 49, 221, 487, 23, 1943, 1563, 6157, 4035, 27769, 14933, 56913}}, {9360, 17, 30881, {1, 1, 5, 13, 13, 43, 67, 245, 457, 365, 1115, 2205, 6229, 4173, 25167, 56333, 55605}}, {9361, 17, 30887, {1, 1, 5, 11, 15, 59, 109, 83, 17, 913, 497, 1299, 5221, 321, 32139, 13717, 94311}}, {9362, 17, 30908, {1, 3, 3, 3, 31, 11, 5, 203, 3, 843, 2039, 25, 6211, 14927, 6015, 46269, 90369}}, {9363, 17, 30916, {1, 1, 3, 9, 21, 51, 91, 203, 149, 147, 197, 1771, 2921, 6609, 2343, 35249, 12963}}, {9364, 17, 30919, {1, 3, 1, 7, 17, 43, 91, 229, 107, 521, 737, 2355, 5855, 6707, 21217, 47041, 81833}}, {9365, 17, 30925, {1, 3, 3, 7, 7, 31, 97, 135, 503, 665, 1799, 2937, 6867, 4125, 7375, 34401, 18111}}, {9366, 17, 30928, {1, 1, 7, 1, 11, 29, 89, 185, 495, 633, 507, 3727, 5999, 5871, 5911, 24877, 10259}}, {9367, 17, 30944, {1, 1, 1, 13, 25, 3, 25, 65, 91, 411, 147, 3699, 7003, 3017, 25635, 56619, 101491}}, {9368, 17, 30947, {1, 3, 5, 7, 31, 1, 63, 255, 115, 179, 87, 735, 1649, 4767, 31093, 60149, 49829}}, {9369, 17, 30950, {1, 1, 3, 1, 21, 63, 67, 85, 399, 279, 1963, 1759, 4679, 15423, 11533, 54387, 36563}}, {9370, 17, 30968, {1, 3, 5, 3, 31, 53, 73, 73, 481, 443, 1393, 2763, 1199, 5375, 8977, 5369, 114603}}, {9371, 17, 30971, {1, 1, 1, 3, 29, 47, 73, 205, 469, 187, 815, 2787, 1431, 4705, 11455, 53643, 89269}}, {9372, 17, 30973, {1, 3, 3, 9, 27, 57, 93, 55, 287, 539, 1259, 3279, 1563, 11399, 22975, 27077, 41031}}, {9373, 17, 30976, {1, 1, 3, 15, 7, 27, 67, 25, 169, 263, 621, 1921, 509, 11715, 15363, 27447, 75535}}, {9374, 17, 30986, {1, 1, 1, 9, 29, 63, 31, 99, 321, 361, 1693, 763, 5593, 10815, 741, 31257, 70843}}, {9375, 17, 30993, {1, 1, 1, 9, 1, 17, 73, 141, 401, 549, 415, 1289, 1697, 1903, 8919, 59563, 60017}}, {9376, 17, 30994, {1, 3, 7, 3, 5, 51, 127, 221, 9, 929, 153, 1045, 6587, 13653, 5343, 14043, 116125}}, {9377, 17, 31012, {1, 3, 3, 13, 13, 17, 29, 93, 465, 59, 1207, 3121, 6331, 8647, 5047, 41869, 51969}}, {9378, 17, 31016, {1, 1, 1, 15, 23, 29, 47, 149, 119, 855, 367, 1419, 7739, 1141, 19787, 38185, 84403}}, {9379, 17, 31029, {1, 3, 1, 9, 29, 63, 5, 63, 435, 401, 1023, 1981, 6819, 7547, 30065, 33833, 7471}}, {9380, 17, 31039, {1, 3, 1, 15, 1, 47, 35, 161, 243, 225, 935, 2179, 7737, 7841, 28523, 11505, 103741}}, {9381, 17, 31041, {1, 1, 7, 3, 7, 57, 73, 55, 101, 905, 1705, 4057, 3781, 8213, 18997, 17185, 33265}}, {9382, 17, 31042, {1, 1, 5, 1, 7, 57, 31, 77, 323, 395, 927, 1969, 6973, 9013, 30789, 757, 84075}}, {9383, 17, 31044, {1, 1, 3, 7, 15, 53, 51, 205, 401, 679, 1295, 1955, 7739, 11423, 23207, 55449, 60419}}, {9384, 17, 31053, {1, 3, 5, 11, 23, 21, 67, 141, 157, 767, 219, 3607, 1847, 11051, 31499, 8461, 106353}}, {9385, 17, 31059, {1, 1, 3, 9, 17, 19, 123, 169, 1, 31, 1019, 1823, 6043, 1895, 17293, 62079, 16945}}, {9386, 17, 31062, {1, 3, 5, 9, 3, 15, 49, 27, 183, 293, 989, 2161, 1845, 1103, 20149, 11121, 31935}}, {9387, 17, 31077, {1, 3, 1, 3, 17, 39, 103, 45, 491, 91, 413, 487, 1381, 5457, 22503, 40477, 94297}}, {9388, 17, 31095, {1, 1, 3, 7, 29, 11, 87, 79, 349, 437, 945, 3753, 6691, 4373, 24875, 54397, 33697}}, {9389, 17, 31101, {1, 1, 7, 1, 9, 31, 105, 121, 97, 947, 129, 1909, 2371, 5493, 29523, 52685, 24325}}, {9390, 17, 31105, {1, 1, 5, 9, 19, 21, 63, 115, 511, 525, 49, 1879, 6075, 8181, 10135, 56785, 53309}}, {9391, 17, 31118, {1, 1, 5, 15, 3, 55, 75, 135, 451, 697, 1407, 2765, 2443, 11589, 24863, 47187, 98477}}, {9392, 17, 31129, {1, 1, 1, 13, 27, 37, 77, 157, 121, 603, 491, 2201, 619, 9157, 32511, 19843, 49919}}, {9393, 17, 31132, {1, 1, 3, 1, 23, 17, 23, 115, 119, 349, 987, 2587, 1847, 12099, 31955, 31685, 1989}}, {9394, 17, 31141, {1, 3, 7, 7, 5, 47, 63, 209, 69, 921, 1041, 1391, 7485, 11121, 30993, 5691, 74551}}, {9395, 17, 31159, {1, 3, 1, 3, 23, 61, 55, 253, 355, 299, 971, 279, 3543, 10073, 5199, 50539, 88303}}, {9396, 17, 31183, {1, 1, 1, 11, 13, 19, 7, 255, 189, 267, 2021, 93, 219, 10537, 28627, 58141, 53675}}, {9397, 17, 31185, {1, 3, 3, 7, 27, 61, 83, 95, 163, 777, 1533, 2485, 7211, 6979, 4013, 20797, 91411}}, {9398, 17, 31195, {1, 1, 7, 13, 15, 37, 5, 109, 133, 225, 59, 3855, 3351, 659, 24321, 63531, 15573}}, {9399, 17, 31202, {1, 1, 5, 1, 7, 55, 59, 213, 45, 77, 2003, 2921, 1105, 11089, 17197, 45459, 67681}}, {9400, 17, 31213, {1, 1, 1, 5, 13, 21, 107, 245, 505, 409, 1453, 1201, 6945, 2103, 7377, 59413, 8785}}, {9401, 17, 31238, {1, 1, 1, 13, 5, 37, 73, 55, 39, 219, 225, 3877, 6583, 3105, 25355, 14839, 23435}}, {9402, 17, 31241, {1, 1, 7, 1, 21, 35, 87, 227, 487, 767, 609, 1685, 2731, 10135, 381, 24021, 122137}}, {9403, 17, 31252, {1, 1, 1, 3, 29, 13, 19, 255, 355, 505, 1757, 3537, 3029, 11403, 22685, 61169, 397}}, {9404, 17, 31262, {1, 1, 7, 1, 29, 43, 11, 207, 83, 97, 435, 1453, 4709, 4193, 18517, 47203, 3255}}, {9405, 17, 31265, {1, 1, 1, 1, 21, 49, 39, 163, 459, 849, 561, 1207, 4109, 1435, 17519, 14839, 1331}}, {9406, 17, 31295, {1, 1, 3, 11, 27, 35, 65, 219, 135, 559, 1111, 2959, 7835, 5165, 26641, 22765, 121829}}, {9407, 17, 31300, {1, 3, 5, 3, 23, 31, 57, 149, 431, 451, 189, 1771, 5877, 3503, 7531, 46485, 129031}}, {9408, 17, 31303, {1, 1, 3, 11, 1, 13, 47, 17, 331, 1003, 215, 2797, 689, 6289, 12719, 37139, 35827}}, {9409, 17, 31317, {1, 3, 5, 9, 19, 13, 11, 29, 275, 165, 783, 313, 2153, 6009, 2247, 5699, 128753}}, {9410, 17, 31318, {1, 1, 7, 13, 5, 43, 51, 75, 411, 743, 335, 217, 559, 15389, 6567, 41193, 127443}}, {9411, 17, 31324, {1, 3, 5, 15, 5, 63, 7, 145, 445, 835, 825, 35, 5951, 5121, 16365, 36789, 2941}}, {9412, 17, 31338, {1, 3, 5, 5, 29, 1, 61, 19, 427, 245, 445, 3505, 3647, 8817, 8031, 64577, 60745}}, {9413, 17, 31340, {1, 1, 3, 9, 29, 9, 35, 225, 55, 535, 1537, 831, 6483, 16123, 26079, 32809, 62227}}, {9414, 17, 31345, {1, 3, 7, 7, 25, 33, 15, 61, 343, 749, 1963, 2763, 3171, 6755, 6529, 49449, 88903}}, {9415, 17, 31355, {1, 1, 7, 13, 17, 35, 91, 119, 87, 1023, 1101, 1785, 2005, 15947, 21679, 63179, 3389}}, {9416, 17, 31362, {1, 3, 1, 1, 1, 1, 123, 195, 315, 681, 153, 1621, 5097, 3669, 20505, 39305, 127065}}, {9417, 17, 31371, {1, 1, 5, 11, 1, 17, 73, 251, 185, 59, 1723, 2321, 2103, 6331, 29571, 63811, 66651}}, {9418, 17, 31373, {1, 1, 7, 13, 15, 19, 111, 91, 211, 85, 711, 2197, 3107, 2717, 16725, 52995, 65791}}, {9419, 17, 31381, {1, 3, 3, 9, 21, 41, 53, 145, 459, 155, 93, 2833, 6747, 737, 30625, 40581, 65825}}, {9420, 17, 31391, {1, 3, 3, 3, 1, 45, 119, 81, 185, 431, 1221, 3043, 7277, 10537, 12355, 42261, 126117}}, {9421, 17, 31409, {1, 3, 7, 7, 11, 47, 37, 41, 123, 643, 707, 2963, 6183, 15527, 10951, 24031, 38187}}, {9422, 17, 31410, {1, 3, 1, 7, 13, 57, 1, 149, 117, 627, 1999, 2805, 4857, 12805, 31453, 25699, 109447}}, {9423, 17, 31412, {1, 3, 5, 3, 9, 37, 83, 221, 77, 573, 661, 465, 1279, 7355, 24061, 36151, 96595}}, {9424, 17, 31434, {1, 1, 7, 15, 29, 31, 125, 205, 449, 563, 1263, 3427, 8013, 14025, 15235, 11833, 25601}}, {9425, 17, 31458, {1, 3, 7, 11, 31, 35, 99, 193, 163, 527, 1455, 395, 4853, 2561, 11909, 57311, 101007}}, {9426, 17, 31467, {1, 1, 5, 3, 17, 39, 99, 173, 497, 245, 1671, 3457, 83, 11959, 2963, 3401, 102259}}, {9427, 17, 31470, {1, 1, 1, 5, 25, 41, 119, 81, 301, 797, 661, 2543, 1195, 2111, 1785, 41533, 51947}}, {9428, 17, 31475, {1, 3, 3, 13, 5, 59, 61, 153, 213, 541, 1849, 249, 3897, 3877, 17095, 6857, 76781}}, {9429, 17, 31481, {1, 3, 7, 1, 19, 13, 57, 47, 359, 165, 1085, 2263, 3261, 12825, 17405, 25853, 20731}}, {9430, 17, 31482, {1, 1, 1, 7, 7, 43, 7, 65, 51, 503, 173, 1023, 283, 14809, 1183, 33497, 110683}}, {9431, 17, 31484, {1, 3, 5, 11, 19, 51, 29, 157, 159, 191, 1293, 2951, 6569, 12433, 14587, 30631, 30485}}, {9432, 17, 31492, {1, 3, 7, 5, 1, 27, 25, 221, 255, 471, 779, 3991, 6985, 1803, 28451, 33403, 5567}}, {9433, 17, 31507, {1, 1, 5, 5, 7, 29, 55, 241, 457, 863, 1715, 3393, 4127, 13985, 6313, 13683, 114837}}, {9434, 17, 31514, {1, 3, 5, 5, 11, 27, 55, 109, 247, 199, 1593, 2881, 307, 97, 24751, 35921, 121931}}, {9435, 17, 31538, {1, 3, 1, 13, 3, 59, 17, 161, 47, 467, 1019, 3629, 3017, 15645, 3983, 32393, 79213}}, {9436, 17, 31547, {1, 1, 3, 11, 19, 57, 67, 199, 319, 107, 2043, 2045, 4025, 5733, 29979, 37721, 117031}}, {9437, 17, 31549, {1, 3, 7, 11, 9, 23, 31, 81, 177, 801, 1177, 3451, 7777, 15351, 7579, 39033, 23847}}, {9438, 17, 31555, {1, 1, 3, 5, 17, 61, 63, 7, 371, 905, 1147, 1383, 4075, 6721, 17503, 32015, 112547}}, {9439, 17, 31557, {1, 1, 3, 13, 13, 25, 69, 159, 49, 133, 227, 2155, 1603, 10077, 3429, 39131, 18949}}, {9440, 17, 31597, {1, 3, 5, 3, 29, 5, 115, 93, 243, 791, 1113, 2841, 4733, 3041, 31733, 28539, 84567}}, {9441, 17, 31598, {1, 3, 3, 7, 21, 9, 5, 95, 489, 517, 1453, 2697, 7951, 12369, 19571, 29811, 51805}}, {9442, 17, 31610, {1, 1, 5, 9, 1, 29, 97, 191, 73, 357, 745, 2787, 7815, 4565, 19761, 33729, 86849}}, {9443, 17, 31625, {1, 3, 5, 13, 3, 5, 35, 79, 387, 813, 1673, 3187, 337, 5539, 6761, 46903, 122967}}, {9444, 17, 31634, {1, 1, 7, 11, 1, 15, 125, 175, 255, 35, 145, 2391, 887, 10505, 11587, 53941, 5089}}, {9445, 17, 31643, {1, 1, 7, 13, 9, 13, 15, 215, 361, 227, 1665, 3345, 3615, 14031, 16281, 4457, 52037}}, {9446, 17, 31645, {1, 3, 5, 9, 31, 21, 3, 189, 211, 855, 1781, 2097, 1345, 6763, 27651, 54137, 52689}}, {9447, 17, 31659, {1, 3, 1, 5, 29, 9, 99, 183, 183, 205, 149, 53, 7179, 3387, 9603, 4281, 47145}}, {9448, 17, 31669, {1, 3, 1, 11, 13, 35, 97, 21, 29, 877, 191, 1621, 2501, 4283, 1707, 48957, 129029}}, {9449, 17, 31670, {1, 3, 1, 9, 5, 19, 57, 219, 105, 467, 1179, 3155, 7743, 4835, 14845, 35671, 47655}}, {9450, 17, 31682, {1, 3, 1, 7, 27, 41, 27, 185, 271, 611, 1173, 2875, 529, 11619, 20231, 18741, 41799}}, {9451, 17, 31694, {1, 3, 7, 13, 9, 3, 35, 71, 467, 689, 1797, 319, 6657, 13193, 15861, 7567, 12891}}, {9452, 17, 31717, {1, 1, 7, 13, 19, 57, 25, 141, 195, 995, 859, 811, 4685, 6711, 8963, 49657, 54751}}, {9453, 17, 31718, {1, 1, 1, 11, 27, 25, 9, 91, 97, 251, 757, 2783, 5447, 3617, 26801, 32501, 55245}}, {9454, 17, 31729, {1, 3, 7, 1, 5, 1, 103, 129, 127, 593, 857, 3957, 3665, 10279, 26211, 2095, 15869}}, {9455, 17, 31736, {1, 1, 7, 1, 25, 49, 3, 139, 25, 545, 615, 1353, 4103, 1099, 21729, 45383, 110611}}, {9456, 17, 31742, {1, 3, 5, 3, 7, 49, 83, 41, 209, 357, 939, 849, 5851, 3945, 831, 8131, 105897}}, {9457, 17, 31749, {1, 1, 1, 3, 27, 19, 123, 71, 195, 1019, 1021, 1287, 5665, 5277, 8647, 27033, 89539}}, {9458, 17, 31773, {1, 1, 1, 9, 27, 51, 49, 159, 401, 1013, 763, 653, 1449, 12441, 21191, 28871, 106181}}, {9459, 17, 31777, {1, 1, 5, 7, 31, 7, 105, 137, 331, 367, 1305, 2761, 863, 3915, 12633, 32251, 82867}}, {9460, 17, 31778, {1, 3, 7, 11, 9, 47, 35, 57, 137, 269, 443, 79, 11, 11817, 28995, 46681, 104263}}, {9461, 17, 31784, {1, 3, 1, 5, 3, 25, 89, 179, 183, 835, 367, 2215, 295, 5365, 1899, 10785, 88979}}, {9462, 17, 31801, {1, 3, 7, 13, 3, 5, 93, 43, 409, 363, 267, 2077, 3745, 445, 25957, 34103, 29475}}, {9463, 17, 31812, {1, 1, 1, 7, 27, 21, 121, 29, 171, 783, 553, 265, 6835, 3929, 18127, 33463, 70999}}, {9464, 17, 31821, {1, 3, 3, 15, 15, 55, 13, 1, 297, 935, 1307, 1779, 2239, 15471, 32453, 30649, 45973}}, {9465, 17, 31822, {1, 3, 7, 5, 25, 41, 3, 171, 347, 607, 1873, 1087, 2433, 8377, 7959, 19941, 117319}}, {9466, 17, 31836, {1, 1, 1, 3, 5, 47, 107, 69, 431, 63, 325, 1241, 3487, 11249, 28559, 30001, 93789}}, {9467, 17, 31850, {1, 1, 1, 5, 15, 17, 9, 145, 335, 169, 1099, 3637, 5397, 6711, 16095, 27053, 124247}}, {9468, 17, 31855, {1, 3, 3, 5, 3, 9, 65, 97, 421, 951, 2003, 2837, 7095, 15685, 5147, 56801, 98679}}, {9469, 17, 31858, {1, 3, 7, 15, 1, 33, 115, 45, 215, 253, 361, 555, 787, 15483, 25531, 53273, 8933}}, {9470, 17, 31860, {1, 3, 1, 9, 3, 63, 47, 205, 457, 977, 991, 3189, 1369, 14899, 10937, 56999, 11525}}, {9471, 17, 31886, {1, 1, 7, 5, 11, 61, 53, 55, 231, 357, 1695, 2489, 2355, 7583, 14097, 50039, 96595}}, {9472, 17, 31891, {1, 3, 7, 7, 3, 57, 115, 245, 259, 573, 1275, 2971, 1793, 13683, 8683, 51815, 26807}}, {9473, 17, 31909, {1, 1, 5, 3, 17, 59, 55, 237, 491, 757, 1447, 2941, 2641, 14175, 4401, 4367, 36853}}, {9474, 17, 31928, {1, 3, 1, 15, 3, 63, 67, 1, 403, 79, 1161, 2379, 3337, 14447, 5877, 40759, 12573}}, {9475, 17, 31931, {1, 1, 7, 15, 17, 1, 91, 5, 173, 215, 1567, 1851, 3309, 9813, 21215, 19151, 96785}}, {9476, 17, 31934, {1, 1, 1, 9, 31, 45, 123, 221, 397, 51, 1489, 3247, 923, 10423, 10461, 51231, 92909}}, {9477, 17, 31941, {1, 1, 1, 13, 27, 17, 105, 163, 403, 193, 1487, 2421, 4415, 14303, 6419, 24105, 29997}}, {9478, 17, 31942, {1, 1, 5, 13, 31, 55, 17, 125, 341, 219, 401, 1611, 891, 12909, 13949, 46245, 26769}}, {9479, 17, 31945, {1, 3, 7, 3, 31, 41, 65, 207, 311, 643, 1617, 271, 3749, 14635, 26385, 55251, 50719}}, {9480, 17, 31951, {1, 3, 3, 13, 7, 55, 69, 241, 413, 399, 137, 2255, 5395, 12625, 26583, 64603, 22571}}, {9481, 17, 31959, {1, 3, 5, 3, 31, 15, 15, 161, 153, 445, 595, 273, 6631, 12845, 23331, 16963, 52099}}, {9482, 17, 31963, {1, 3, 3, 1, 27, 39, 71, 41, 455, 841, 831, 1719, 3531, 5113, 29183, 1933, 42227}}, {9483, 17, 31970, {1, 3, 7, 3, 1, 15, 31, 183, 429, 557, 1747, 1059, 2079, 16361, 29103, 43207, 921}}, {9484, 17, 31984, {1, 3, 1, 1, 31, 39, 97, 73, 339, 405, 1423, 2215, 5435, 9205, 1889, 58249, 61517}}, {9485, 17, 31987, {1, 3, 7, 1, 23, 59, 127, 245, 11, 627, 1555, 2497, 6427, 7205, 22675, 62847, 69691}}, {9486, 17, 31990, {1, 1, 3, 5, 1, 13, 95, 9, 167, 481, 947, 3181, 8057, 5559, 7537, 33757, 72419}}, {9487, 17, 32001, {1, 1, 7, 3, 15, 9, 105, 205, 287, 375, 115, 1731, 1063, 11551, 12077, 41013, 88853}}, {9488, 17, 32007, {1, 3, 3, 9, 5, 63, 127, 33, 409, 279, 1379, 4069, 4091, 14703, 27435, 19525, 71261}}, {9489, 17, 32008, {1, 3, 1, 13, 31, 31, 59, 205, 167, 131, 891, 1259, 6909, 211, 31517, 8085, 112065}}, {9490, 17, 32025, {1, 1, 5, 11, 17, 25, 119, 77, 449, 569, 381, 825, 2459, 983, 2959, 51611, 90721}}, {9491, 17, 32035, {1, 3, 1, 7, 17, 55, 91, 231, 133, 541, 499, 3609, 4237, 11627, 30007, 58911, 43443}}, {9492, 17, 32038, {1, 3, 7, 7, 29, 5, 47, 187, 71, 695, 1389, 2855, 5815, 11605, 3643, 24961, 25793}}, {9493, 17, 32047, {1, 3, 3, 5, 11, 31, 43, 31, 185, 1021, 795, 3585, 3981, 8627, 18117, 42351, 19513}}, {9494, 17, 32049, {1, 1, 5, 13, 9, 3, 115, 45, 39, 577, 1847, 653, 2625, 9367, 27923, 35661, 113613}}, {9495, 17, 32062, {1, 3, 7, 7, 17, 9, 69, 233, 367, 673, 11, 2215, 1177, 4501, 9693, 62013, 45647}}, {9496, 17, 32067, {1, 3, 5, 7, 7, 53, 11, 227, 465, 843, 2017, 689, 6767, 10321, 25163, 56561, 6865}}, {9497, 17, 32070, {1, 3, 3, 5, 13, 43, 119, 9, 185, 893, 133, 863, 7137, 6653, 7875, 23167, 13893}}, {9498, 17, 32073, {1, 3, 5, 9, 1, 47, 17, 85, 273, 901, 493, 2411, 983, 15717, 25151, 21323, 57939}}, {9499, 17, 32074, {1, 1, 7, 5, 19, 17, 49, 37, 425, 443, 781, 2593, 4929, 12313, 12727, 42285, 88451}}, {9500, 17, 32079, {1, 3, 3, 11, 9, 53, 17, 67, 237, 463, 1509, 2153, 3715, 7909, 21151, 64517, 87695}}, {9501, 17, 32081, {1, 3, 7, 1, 29, 39, 25, 83, 413, 1005, 2011, 3933, 2911, 7041, 10537, 23135, 22671}}, {9502, 17, 32082, {1, 1, 3, 9, 23, 61, 117, 33, 431, 181, 1819, 683, 1809, 1723, 27041, 29113, 99347}}, {9503, 17, 32107, {1, 1, 5, 11, 11, 7, 101, 181, 51, 857, 923, 3495, 7123, 7775, 30081, 48513, 116137}}, {9504, 17, 32127, {1, 1, 3, 11, 15, 31, 97, 127, 365, 799, 715, 2101, 6081, 11607, 1055, 35027, 62967}}, {9505, 17, 32145, {1, 3, 5, 7, 3, 31, 109, 247, 225, 221, 1093, 2633, 1847, 7427, 8767, 16581, 32145}}, {9506, 17, 32151, {1, 3, 1, 7, 15, 23, 43, 109, 327, 417, 1895, 2333, 6265, 6599, 6623, 47375, 92731}}, {9507, 17, 32152, {1, 3, 7, 1, 29, 29, 45, 217, 163, 941, 1327, 3685, 5481, 15783, 26281, 60339, 34277}}, {9508, 17, 32173, {1, 1, 7, 11, 1, 7, 119, 201, 29, 193, 1805, 1395, 267, 2011, 637, 26765, 48883}}, {9509, 17, 32174, {1, 1, 3, 7, 11, 63, 41, 89, 365, 729, 25, 3185, 2143, 1737, 29693, 7443, 78079}}, {9510, 17, 32186, {1, 3, 1, 13, 25, 27, 63, 233, 79, 1007, 1357, 679, 7581, 8333, 2469, 31787, 128531}}, {9511, 17, 32194, {1, 3, 1, 3, 23, 39, 53, 99, 219, 475, 931, 507, 3615, 10613, 14663, 1151, 123459}}, {9512, 17, 32196, {1, 1, 1, 1, 13, 15, 67, 45, 393, 791, 415, 2731, 1151, 8935, 28983, 7239, 106247}}, {9513, 17, 32200, {1, 3, 7, 7, 11, 35, 95, 153, 421, 193, 1997, 2587, 3183, 9229, 17663, 28221, 6759}}, {9514, 17, 32208, {1, 3, 1, 7, 5, 5, 123, 55, 509, 973, 261, 463, 2723, 15225, 1925, 62283, 86329}}, {9515, 17, 32218, {1, 1, 3, 13, 5, 47, 123, 239, 273, 407, 1725, 717, 1229, 1387, 11743, 13739, 104503}}, {9516, 17, 32236, {1, 3, 3, 13, 23, 35, 43, 113, 299, 847, 1903, 3445, 3395, 641, 11271, 61517, 40747}}, {9517, 17, 32260, {1, 3, 1, 15, 17, 49, 97, 9, 335, 731, 151, 167, 8129, 11845, 18285, 20113, 122397}}, {9518, 17, 32263, {1, 1, 5, 11, 11, 63, 3, 153, 345, 511, 1939, 1815, 7231, 10555, 14293, 50753, 14681}}, {9519, 17, 32288, {1, 3, 7, 5, 21, 31, 127, 223, 241, 783, 887, 3519, 4743, 3541, 4143, 57461, 27791}}, {9520, 17, 32298, {1, 1, 5, 7, 13, 15, 83, 225, 201, 979, 145, 769, 1491, 12155, 21307, 64877, 113277}}, {9521, 17, 32315, {1, 1, 7, 1, 27, 25, 105, 69, 239, 323, 1059, 573, 4913, 14215, 27007, 42351, 66315}}, {9522, 17, 32332, {1, 1, 3, 11, 21, 33, 93, 23, 363, 633, 935, 637, 6171, 12695, 14077, 17505, 69681}}, {9523, 17, 32340, {1, 3, 1, 5, 15, 11, 93, 211, 175, 377, 33, 1403, 5097, 1503, 8483, 2881, 85877}}, {9524, 17, 32354, {1, 1, 5, 3, 5, 51, 5, 255, 429, 661, 625, 3015, 4813, 3573, 22917, 45967, 70559}}, {9525, 17, 32359, {1, 1, 7, 3, 11, 41, 3, 197, 181, 897, 767, 1385, 7395, 15543, 4655, 40309, 73169}}, {9526, 17, 32366, {1, 1, 5, 9, 15, 35, 71, 119, 509, 817, 1169, 75, 1337, 2959, 611, 38243, 46987}}, {9527, 17, 32368, {1, 1, 1, 9, 1, 7, 43, 65, 479, 625, 1685, 1309, 5619, 14163, 13633, 18169, 8311}}, {9528, 17, 32377, {1, 3, 5, 9, 19, 39, 95, 105, 273, 1023, 79, 229, 6895, 2931, 5717, 27911, 22139}}, {9529, 17, 32384, {1, 3, 5, 7, 1, 55, 15, 15, 297, 731, 2029, 2789, 11, 1333, 26571, 62595, 15131}}, {9530, 17, 32399, {1, 1, 5, 7, 29, 35, 3, 125, 381, 709, 2047, 2395, 6315, 2301, 7175, 19857, 75085}}, {9531, 17, 32417, {1, 1, 5, 15, 23, 45, 95, 117, 49, 635, 1525, 1105, 7335, 4653, 18159, 29729, 62627}}, {9532, 17, 32424, {1, 3, 3, 11, 29, 19, 29, 169, 141, 243, 1765, 1829, 4555, 16299, 3053, 58933, 44605}}, {9533, 17, 32427, {1, 1, 3, 15, 5, 45, 35, 213, 385, 993, 1521, 9, 3561, 10497, 12601, 38163, 86501}}, {9534, 17, 32429, {1, 3, 3, 13, 9, 23, 109, 95, 491, 1003, 473, 3325, 6577, 14617, 17765, 33391, 82927}}, {9535, 17, 32438, {1, 3, 3, 11, 25, 31, 93, 111, 231, 71, 1233, 3581, 6789, 4569, 16741, 61967, 32249}}, {9536, 17, 32442, {1, 3, 3, 15, 15, 63, 39, 247, 79, 923, 327, 2639, 2013, 12325, 18133, 60623, 2215}}, {9537, 17, 32447, {1, 3, 5, 1, 5, 49, 121, 53, 283, 529, 37, 3233, 6285, 12447, 4355, 9343, 45631}}, {9538, 17, 32469, {1, 1, 7, 11, 11, 11, 111, 139, 429, 279, 1019, 2139, 2033, 6809, 8847, 22535, 107005}}, {9539, 17, 32479, {1, 3, 5, 1, 1, 21, 35, 97, 167, 57, 491, 511, 4065, 11699, 16851, 6847, 40929}}, {9540, 17, 32483, {1, 3, 1, 15, 3, 55, 113, 33, 255, 537, 835, 1867, 3927, 839, 955, 29079, 93727}}, {9541, 17, 32498, {1, 1, 7, 3, 5, 7, 35, 111, 165, 885, 115, 3051, 4541, 1701, 22827, 361, 91843}}, {9542, 17, 32503, {1, 1, 7, 11, 7, 55, 81, 43, 237, 725, 1761, 1599, 639, 14189, 31241, 52827, 107943}}, {9543, 17, 32507, {1, 3, 1, 3, 29, 35, 67, 119, 369, 877, 1861, 123, 8121, 13861, 31155, 60245, 79799}}, {9544, 17, 32521, {1, 1, 3, 13, 7, 49, 63, 19, 253, 723, 639, 1677, 291, 13697, 22231, 46893, 90069}}, {9545, 17, 32532, {1, 3, 5, 1, 7, 57, 29, 233, 35, 715, 515, 3221, 2715, 13839, 18321, 4445, 103843}}, {9546, 17, 32539, {1, 3, 1, 7, 1, 63, 33, 7, 481, 461, 1923, 2679, 2441, 5449, 13233, 2245, 48667}}, {9547, 17, 32551, {1, 1, 7, 11, 11, 9, 95, 151, 441, 333, 1871, 1181, 3027, 12887, 11923, 63847, 6953}}, {9548, 17, 32572, {1, 3, 5, 5, 15, 33, 53, 47, 351, 387, 55, 393, 5475, 3027, 18565, 37997, 120877}}, {9549, 17, 32577, {1, 3, 5, 9, 23, 43, 67, 97, 445, 783, 1499, 1977, 1441, 10159, 13479, 149, 4939}}, {9550, 17, 32578, {1, 3, 7, 3, 15, 41, 119, 55, 139, 25, 849, 857, 53, 10421, 2683, 24839, 107797}}, {9551, 17, 32587, {1, 1, 7, 13, 25, 51, 51, 13, 333, 93, 95, 1755, 3055, 12585, 3519, 44857, 11257}}, {9552, 17, 32592, {1, 1, 5, 11, 29, 55, 13, 235, 419, 327, 823, 2675, 8031, 9303, 8749, 20215, 12111}}, {9553, 17, 32602, {1, 1, 3, 5, 7, 31, 103, 19, 467, 255, 583, 419, 2845, 12179, 63, 51693, 9755}}, {9554, 17, 32604, {1, 1, 1, 13, 15, 29, 109, 81, 381, 659, 601, 3867, 7663, 7307, 16445, 56327, 48559}}, {9555, 17, 32613, {1, 3, 3, 15, 31, 35, 29, 153, 423, 247, 55, 3259, 6199, 4199, 13931, 14433, 52645}}, {9556, 17, 32625, {1, 1, 5, 11, 9, 17, 17, 191, 231, 977, 721, 2817, 2485, 4965, 32341, 55131, 4547}}, {9557, 17, 32631, {1, 1, 7, 7, 7, 7, 89, 69, 299, 503, 597, 311, 1321, 2335, 30193, 45347, 126631}}, {9558, 17, 32641, {1, 1, 7, 11, 13, 43, 105, 153, 89, 229, 1573, 1549, 3699, 15981, 28911, 45011, 83759}}, {9559, 17, 32642, {1, 3, 7, 3, 1, 3, 121, 137, 263, 325, 1449, 3793, 5795, 7715, 7449, 26453, 85081}}, {9560, 17, 32644, {1, 3, 1, 7, 23, 15, 39, 217, 99, 873, 1641, 1411, 4627, 283, 20707, 41795, 62239}}, {9561, 17, 32656, {1, 3, 5, 9, 15, 15, 35, 255, 501, 945, 79, 799, 2361, 4495, 27825, 27699, 129335}}, {9562, 17, 32678, {1, 3, 1, 7, 9, 19, 89, 31, 65, 905, 1475, 1353, 7253, 12825, 20723, 47757, 12007}}, {9563, 17, 32681, {1, 1, 3, 3, 15, 35, 83, 239, 463, 835, 1249, 2521, 3429, 14073, 13569, 6161, 71309}}, {9564, 17, 32701, {1, 1, 7, 11, 31, 43, 15, 57, 461, 917, 339, 3787, 2925, 1879, 7217, 17091, 108819}}, {9565, 17, 32713, {1, 3, 7, 3, 17, 51, 29, 105, 221, 941, 1291, 835, 1563, 15623, 2953, 62985, 63037}}, {9566, 17, 32721, {1, 1, 7, 3, 1, 39, 83, 41, 399, 465, 587, 2011, 137, 6017, 5067, 52389, 71053}}, {9567, 17, 32727, {1, 1, 7, 11, 17, 55, 103, 239, 173, 181, 1219, 2671, 5183, 3799, 19589, 31247, 68889}}, {9568, 17, 32731, {1, 1, 3, 3, 21, 43, 123, 253, 281, 627, 353, 3077, 1685, 12143, 19723, 57775, 70761}}, {9569, 17, 32734, {1, 1, 7, 15, 31, 13, 101, 159, 311, 305, 1783, 3523, 149, 9269, 7103, 40315, 30569}}, {9570, 17, 32740, {1, 1, 5, 3, 29, 47, 11, 219, 301, 207, 1361, 563, 7831, 14469, 18983, 54535, 64647}}, {9571, 17, 32773, {1, 1, 3, 15, 11, 37, 85, 237, 225, 1009, 1065, 985, 6849, 5395, 22853, 43965, 51363}}, {9572, 17, 32774, {1, 3, 3, 1, 11, 61, 45, 131, 201, 609, 757, 2539, 3817, 9309, 24759, 26789, 41437}}, {9573, 17, 32785, {1, 1, 7, 3, 21, 5, 19, 137, 75, 573, 583, 2499, 41, 3429, 24273, 36711, 110015}}, {9574, 17, 32788, {1, 3, 7, 9, 1, 51, 39, 75, 115, 269, 1983, 2709, 6989, 6521, 5551, 43675, 1019}}, {9575, 17, 32792, {1, 1, 3, 9, 27, 1, 125, 7, 67, 821, 275, 1253, 4635, 3557, 4155, 13831, 1523}}, {9576, 17, 32797, {1, 1, 5, 15, 23, 15, 79, 43, 275, 791, 1867, 2495, 2933, 2167, 22819, 52913, 88871}}, {9577, 17, 32801, {1, 1, 1, 5, 31, 59, 27, 153, 159, 919, 219, 3373, 3227, 6321, 27559, 33905, 126145}}, {9578, 17, 32811, {1, 3, 3, 13, 23, 21, 119, 175, 119, 741, 1745, 3985, 3847, 5163, 13699, 32373, 75201}}, {9579, 17, 32821, {1, 3, 7, 15, 1, 47, 101, 89, 425, 269, 713, 3587, 3373, 13315, 16481, 40031, 50353}}, {9580, 17, 32828, {1, 3, 7, 3, 19, 29, 5, 69, 385, 979, 1893, 1849, 8007, 14415, 18343, 60555, 109117}}, {9581, 17, 32839, {1, 1, 3, 13, 5, 35, 111, 239, 489, 395, 1565, 1607, 543, 89, 8971, 22311, 899}}, {9582, 17, 32854, {1, 1, 7, 7, 11, 51, 105, 211, 341, 85, 991, 1275, 3995, 12611, 2363, 29501, 44217}}, {9583, 17, 32867, {1, 1, 5, 13, 9, 17, 93, 69, 145, 917, 469, 1109, 7405, 12903, 8341, 50383, 20133}}, {9584, 17, 32870, {1, 3, 1, 7, 27, 45, 45, 85, 101, 161, 1117, 2757, 7847, 359, 17155, 27073, 123535}}, {9585, 17, 32873, {1, 3, 1, 3, 9, 11, 67, 205, 109, 257, 1635, 141, 3969, 11571, 211, 48683, 108671}}, {9586, 17, 32881, {1, 1, 3, 7, 13, 9, 29, 251, 113, 851, 1549, 981, 5553, 6095, 28885, 32953, 112563}}, {9587, 17, 32891, {1, 1, 5, 7, 11, 5, 13, 83, 343, 499, 587, 3887, 3859, 11459, 7361, 25665, 86151}}, {9588, 17, 32900, {1, 1, 5, 1, 13, 43, 3, 37, 273, 749, 1707, 2069, 3083, 1095, 3081, 23919, 21939}}, {9589, 17, 32903, {1, 3, 5, 13, 13, 49, 115, 99, 357, 95, 699, 2615, 1911, 12675, 8607, 12535, 118651}}, {9590, 17, 32910, {1, 1, 7, 7, 29, 43, 17, 131, 271, 895, 1427, 3659, 1843, 8247, 1175, 48239, 54435}}, {9591, 17, 32917, {1, 1, 1, 9, 1, 27, 85, 163, 353, 669, 745, 317, 2505, 7685, 14831, 31131, 106687}}, {9592, 17, 32922, {1, 1, 7, 9, 1, 23, 121, 53, 289, 651, 303, 3049, 6819, 6733, 17485, 20023, 110009}}, {9593, 17, 32928, {1, 3, 7, 3, 5, 47, 93, 75, 363, 479, 825, 1801, 6807, 3341, 6419, 9889, 5557}}, {9594, 17, 32945, {1, 1, 3, 15, 23, 5, 7, 25, 73, 811, 1597, 2041, 6707, 6817, 20427, 50749, 46255}}, {9595, 17, 32946, {1, 3, 7, 9, 1, 11, 61, 63, 435, 977, 1937, 93, 2685, 643, 20113, 25873, 63829}}, {9596, 17, 32951, {1, 1, 3, 15, 5, 41, 31, 53, 143, 271, 27, 3899, 5045, 1063, 17229, 52715, 67689}}, {9597, 17, 32958, {1, 1, 3, 11, 1, 57, 121, 13, 291, 861, 1547, 3899, 7949, 15401, 29807, 52307, 104359}}, {9598, 17, 32965, {1, 3, 5, 15, 23, 3, 95, 43, 377, 437, 1687, 3075, 5131, 11791, 3637, 12621, 105575}}, {9599, 17, 32978, {1, 3, 1, 3, 27, 1, 117, 11, 153, 401, 1971, 2097, 3227, 14603, 4757, 56281, 112263}}, {9600, 17, 32980, {1, 3, 3, 5, 13, 25, 51, 209, 367, 327, 1941, 1943, 1347, 14393, 31997, 16001, 129047}}, {9601, 17, 32983, {1, 1, 5, 11, 19, 51, 109, 229, 71, 923, 1741, 1193, 4657, 6043, 26703, 17757, 75009}}, {9602, 17, 32987, {1, 1, 7, 3, 23, 3, 125, 165, 137, 999, 1583, 3493, 859, 15603, 7143, 28791, 28201}}, {9603, 17, 33023, {1, 1, 5, 11, 29, 57, 65, 41, 295, 729, 635, 1871, 6347, 3509, 59, 40765, 42673}}, {9604, 17, 33031, {1, 3, 3, 3, 15, 59, 53, 97, 15, 131, 891, 1105, 841, 6065, 14427, 4721, 106433}}, {9605, 17, 33032, {1, 1, 1, 7, 19, 37, 101, 121, 141, 613, 1363, 691, 1731, 12477, 8339, 55669, 99379}}, {9606, 17, 33035, {1, 3, 5, 13, 17, 49, 75, 25, 447, 113, 1853, 3465, 5225, 4531, 14287, 1039, 17399}}, {9607, 17, 33038, {1, 3, 5, 3, 3, 49, 101, 79, 117, 939, 1161, 1991, 2343, 7183, 12599, 52877, 94337}}, {9608, 17, 33040, {1, 3, 1, 1, 19, 47, 73, 195, 475, 435, 1807, 2723, 7885, 15469, 26057, 37325, 57005}}, {9609, 17, 33043, {1, 1, 1, 11, 17, 7, 111, 143, 357, 977, 719, 553, 4559, 7225, 10405, 26895, 8385}}, {9610, 17, 33050, {1, 3, 3, 9, 17, 5, 1, 73, 125, 913, 1275, 2387, 5153, 13611, 20585, 8465, 27545}}, {9611, 17, 33059, {1, 1, 7, 5, 27, 51, 107, 147, 503, 699, 851, 1729, 2875, 16331, 28025, 26451, 92705}}, {9612, 17, 33080, {1, 1, 5, 9, 3, 37, 21, 139, 13, 427, 225, 1345, 2491, 15495, 25847, 3095, 128879}}, {9613, 17, 33098, {1, 1, 3, 11, 7, 47, 113, 133, 99, 871, 1151, 1953, 7931, 6389, 28715, 36861, 60017}}, {9614, 17, 33108, {1, 1, 7, 1, 21, 47, 35, 83, 137, 945, 2047, 3491, 3719, 3001, 20563, 51243, 14491}}, {9615, 17, 33115, {1, 1, 5, 15, 1, 13, 85, 61, 479, 853, 813, 805, 4931, 12651, 22757, 29531, 92861}}, {9616, 17, 33117, {1, 3, 7, 7, 27, 63, 31, 169, 43, 185, 637, 729, 7231, 2381, 23539, 53885, 90215}}, {9617, 17, 33133, {1, 1, 3, 13, 5, 51, 69, 111, 357, 277, 1889, 3809, 8031, 13341, 14261, 34001, 63317}}, {9618, 17, 33134, {1, 1, 7, 3, 11, 59, 1, 43, 227, 503, 1407, 3917, 7077, 847, 4513, 53007, 66721}}, {9619, 17, 33157, {1, 1, 5, 11, 15, 25, 109, 169, 25, 391, 597, 2997, 2377, 9045, 15239, 25291, 5451}}, {9620, 17, 33169, {1, 3, 3, 11, 15, 11, 1, 59, 347, 707, 239, 2473, 8057, 4787, 32247, 17955, 79151}}, {9621, 17, 33170, {1, 3, 7, 11, 9, 59, 9, 117, 137, 713, 451, 1105, 4485, 14979, 26271, 46017, 89211}}, {9622, 17, 33176, {1, 3, 3, 3, 3, 19, 95, 131, 413, 291, 1179, 3265, 7107, 10419, 13527, 19905, 8059}}, {9623, 17, 33182, {1, 3, 7, 9, 29, 43, 19, 243, 443, 27, 1401, 3469, 6925, 2833, 19715, 39667, 11983}}, {9624, 17, 33192, {1, 3, 3, 7, 23, 33, 115, 59, 29, 61, 1085, 1115, 4007, 12673, 26479, 22397, 95609}}, {9625, 17, 33205, {1, 3, 3, 5, 1, 47, 43, 83, 21, 621, 59, 1, 891, 12285, 31855, 48641, 52479}}, {9626, 17, 33212, {1, 3, 3, 5, 3, 9, 17, 181, 15, 315, 1705, 2461, 1853, 14007, 17665, 40593, 126179}}, {9627, 17, 33215, {1, 3, 5, 3, 3, 23, 83, 163, 29, 293, 1891, 2631, 2989, 7295, 2441, 21689, 8187}}, {9628, 17, 33217, {1, 3, 1, 1, 1, 23, 53, 215, 185, 843, 1083, 2603, 3857, 4981, 25079, 20249, 93717}}, {9629, 17, 33227, {1, 3, 5, 11, 7, 61, 127, 13, 449, 395, 1909, 3967, 2441, 3073, 8159, 33979, 26345}}, {9630, 17, 33229, {1, 1, 5, 1, 15, 5, 93, 87, 319, 173, 1729, 1395, 1019, 5139, 10819, 29877, 81025}}, {9631, 17, 33238, {1, 3, 3, 7, 17, 55, 61, 227, 299, 245, 849, 211, 895, 2999, 18215, 37069, 32821}}, {9632, 17, 33241, {1, 1, 5, 3, 17, 49, 115, 55, 447, 533, 1463, 2983, 3245, 9345, 11955, 49145, 128035}}, {9633, 17, 33260, {1, 3, 1, 7, 5, 17, 61, 71, 101, 529, 1761, 827, 7887, 5713, 31039, 18087, 82277}}, {9634, 17, 33271, {1, 3, 1, 11, 27, 59, 1, 231, 303, 431, 1279, 3647, 1333, 3675, 29401, 55533, 65997}}, {9635, 17, 33278, {1, 1, 5, 9, 7, 9, 111, 245, 269, 919, 1147, 1601, 6219, 4931, 3035, 12231, 4011}}, {9636, 17, 33293, {1, 3, 5, 15, 3, 19, 83, 25, 129, 979, 79, 3027, 3983, 7703, 16859, 12085, 83115}}, {9637, 17, 33294, {1, 1, 5, 11, 31, 41, 99, 3, 383, 943, 1579, 2435, 1209, 161, 31733, 11755, 95697}}, {9638, 17, 33296, {1, 1, 1, 9, 9, 55, 115, 187, 499, 165, 1081, 813, 2545, 8065, 10501, 15475, 85107}}, {9639, 17, 33302, {1, 1, 1, 3, 1, 31, 81, 213, 301, 575, 605, 543, 3347, 12759, 21645, 37173, 36127}}, {9640, 17, 33305, {1, 3, 3, 9, 21, 29, 51, 91, 307, 617, 1839, 443, 1013, 4473, 3885, 57669, 123271}}, {9641, 17, 33329, {1, 3, 1, 15, 31, 43, 83, 187, 51, 513, 1505, 3895, 3557, 9527, 27537, 6173, 99595}}, {9642, 17, 33330, {1, 3, 3, 1, 3, 53, 113, 27, 431, 505, 219, 2143, 6691, 3219, 9589, 9885, 24037}}, {9643, 17, 33332, {1, 1, 5, 9, 13, 3, 53, 145, 49, 411, 691, 289, 6443, 4963, 13815, 23663, 95497}}, {9644, 17, 33354, {1, 3, 5, 9, 19, 7, 53, 101, 199, 69, 1821, 3233, 3267, 5947, 4869, 30095, 21255}}, {9645, 17, 33383, {1, 1, 5, 11, 29, 7, 79, 11, 451, 585, 987, 2333, 1891, 1853, 14739, 34399, 62895}}, {9646, 17, 33387, {1, 3, 1, 7, 29, 43, 103, 219, 139, 359, 1663, 3453, 7469, 1943, 11457, 19227, 62211}}, {9647, 17, 33397, {1, 3, 3, 11, 9, 47, 17, 237, 87, 881, 583, 3473, 2579, 975, 1531, 50997, 76219}}, {9648, 17, 33408, {1, 1, 7, 15, 31, 37, 79, 115, 95, 515, 2003, 2595, 4077, 4537, 9171, 31183, 41219}}, {9649, 17, 33417, {1, 1, 1, 9, 21, 41, 93, 33, 211, 341, 233, 2217, 6657, 12913, 8329, 3881, 42563}}, {9650, 17, 33420, {1, 3, 3, 11, 25, 3, 23, 197, 49, 339, 877, 1117, 7817, 14143, 1575, 50301, 92367}}, {9651, 17, 33423, {1, 3, 5, 5, 19, 45, 69, 179, 447, 861, 1633, 1941, 5821, 1843, 4085, 23501, 109047}}, {9652, 17, 33431, {1, 3, 1, 3, 31, 29, 49, 183, 311, 133, 345, 1541, 111, 5571, 1943, 11039, 127673}}, {9653, 17, 33438, {1, 3, 1, 5, 3, 13, 63, 5, 59, 789, 71, 3271, 3871, 9105, 22525, 31, 117803}}, {9654, 17, 33442, {1, 3, 1, 13, 31, 43, 97, 133, 313, 729, 287, 2971, 5623, 13183, 15179, 47271, 28853}}, {9655, 17, 33444, {1, 1, 3, 13, 27, 15, 35, 37, 507, 139, 1933, 2847, 361, 10261, 21031, 3889, 56875}}, {9656, 17, 33448, {1, 3, 1, 15, 31, 13, 45, 73, 279, 331, 471, 3881, 3295, 12035, 28329, 899, 47397}}, {9657, 17, 33456, {1, 1, 3, 13, 1, 7, 81, 255, 315, 595, 43, 3919, 5229, 7953, 25711, 19509, 107181}}, {9658, 17, 33459, {1, 1, 3, 15, 7, 33, 117, 169, 71, 577, 629, 3665, 7761, 13529, 26375, 17181, 22125}}, {9659, 17, 33466, {1, 3, 5, 7, 5, 7, 1, 93, 489, 289, 329, 2273, 685, 14835, 11433, 26041, 112735}}, {9660, 17, 33473, {1, 3, 3, 3, 9, 39, 45, 23, 171, 35, 571, 551, 7815, 6169, 24283, 61477, 71877}}, {9661, 17, 33476, {1, 1, 5, 7, 23, 15, 81, 215, 297, 269, 655, 2059, 3643, 12741, 11955, 41085, 46047}}, {9662, 17, 33491, {1, 1, 7, 5, 3, 35, 125, 141, 419, 137, 1031, 2053, 7925, 7267, 6267, 34323, 77495}}, {9663, 17, 33494, {1, 1, 7, 11, 3, 57, 91, 43, 139, 691, 1569, 1825, 7855, 1093, 19263, 31601, 16019}}, {9664, 17, 33507, {1, 3, 1, 5, 21, 7, 11, 225, 105, 757, 1493, 455, 4757, 12007, 5139, 3545, 79717}}, {9665, 17, 33514, {1, 3, 1, 13, 17, 29, 125, 249, 475, 79, 1271, 341, 863, 853, 2105, 32897, 121261}}, {9666, 17, 33521, {1, 3, 1, 11, 17, 59, 3, 29, 61, 399, 1465, 4029, 2103, 12481, 28495, 34363, 63781}}, {9667, 17, 33528, {1, 3, 3, 15, 29, 13, 101, 191, 435, 215, 1355, 2263, 6059, 4545, 7535, 15041, 84091}}, {9668, 17, 33534, {1, 1, 3, 9, 29, 23, 99, 55, 91, 145, 235, 2847, 725, 209, 24565, 16545, 103669}}, {9669, 17, 33536, {1, 1, 1, 1, 31, 15, 93, 197, 207, 357, 667, 3511, 3865, 5329, 6491, 9027, 125979}}, {9670, 17, 33551, {1, 3, 3, 13, 17, 35, 99, 187, 153, 589, 1633, 4053, 1023, 9541, 9841, 39585, 24885}}, {9671, 17, 33554, {1, 3, 7, 11, 23, 5, 71, 89, 455, 665, 1221, 1821, 591, 11459, 503, 56777, 65691}}, {9672, 17, 33563, {1, 3, 1, 1, 9, 33, 51, 203, 223, 709, 1263, 3535, 7753, 8279, 8673, 60259, 2671}}, {9673, 17, 33575, {1, 1, 7, 9, 17, 63, 5, 229, 495, 435, 1711, 3359, 399, 15901, 28519, 56627, 8079}}, {9674, 17, 33579, {1, 3, 5, 11, 9, 25, 49, 143, 275, 989, 461, 447, 1917, 9253, 28421, 1803, 119725}}, {9675, 17, 33582, {1, 3, 3, 7, 25, 3, 39, 171, 303, 905, 1353, 2561, 7347, 7339, 15271, 61945, 26343}}, {9676, 17, 33601, {1, 1, 1, 3, 5, 63, 9, 229, 107, 815, 1705, 3621, 2345, 3065, 16315, 17017, 33667}}, {9677, 17, 33602, {1, 3, 5, 13, 29, 13, 91, 111, 475, 561, 443, 3825, 5331, 11211, 27639, 28305, 101831}}, {9678, 17, 33614, {1, 3, 1, 9, 15, 33, 17, 47, 249, 89, 429, 3819, 1959, 14317, 10737, 28151, 40395}}, {9679, 17, 33625, {1, 3, 7, 13, 19, 29, 83, 81, 511, 783, 823, 2865, 5823, 9459, 27413, 63297, 44181}}, {9680, 17, 33628, {1, 3, 1, 1, 19, 53, 45, 227, 193, 631, 289, 1227, 6241, 6915, 16051, 31237, 50201}}, {9681, 17, 33637, {1, 3, 7, 7, 15, 49, 77, 147, 421, 515, 927, 1561, 4391, 12943, 6807, 36889, 70249}}, {9682, 17, 33656, {1, 3, 7, 7, 17, 15, 63, 123, 101, 283, 59, 977, 5185, 16161, 5007, 36255, 11537}}, {9683, 17, 33665, {1, 1, 7, 1, 13, 17, 79, 35, 193, 947, 767, 1365, 2145, 13267, 30561, 51949, 37591}}, {9684, 17, 33683, {1, 1, 1, 13, 11, 13, 91, 129, 355, 549, 295, 673, 209, 15953, 14703, 30857, 47967}}, {9685, 17, 33695, {1, 3, 5, 9, 17, 17, 83, 161, 189, 585, 21, 1019, 4879, 15943, 17281, 46013, 94839}}, {9686, 17, 33696, {1, 3, 5, 9, 23, 39, 65, 25, 181, 3, 2005, 635, 201, 9391, 8755, 38535, 88697}}, {9687, 17, 33702, {1, 3, 1, 15, 13, 35, 47, 125, 429, 901, 895, 3495, 327, 397, 7847, 62157, 3489}}, {9688, 17, 33708, {1, 3, 5, 3, 19, 21, 81, 39, 85, 169, 1981, 3323, 113, 2057, 16617, 58051, 55059}}, {9689, 17, 33711, {1, 3, 1, 13, 9, 1, 101, 81, 129, 717, 1495, 4077, 5555, 93, 12957, 14805, 110219}}, {9690, 17, 33716, {1, 3, 5, 5, 5, 47, 107, 111, 387, 987, 2009, 179, 1111, 3443, 25579, 12293, 123035}}, {9691, 17, 33728, {1, 1, 7, 13, 21, 25, 33, 211, 9, 783, 1785, 2691, 6835, 2867, 22469, 17853, 90685}}, {9692, 17, 33737, {1, 1, 3, 3, 19, 57, 59, 203, 197, 347, 553, 1361, 7593, 91, 15303, 30045, 86605}}, {9693, 17, 33761, {1, 3, 5, 7, 29, 23, 1, 235, 159, 277, 1227, 1727, 1853, 9717, 2377, 13597, 18119}}, {9694, 17, 33774, {1, 1, 1, 11, 15, 29, 5, 15, 349, 685, 197, 3127, 1075, 8847, 27873, 539, 57149}}, {9695, 17, 33782, {1, 1, 7, 9, 23, 25, 121, 239, 219, 747, 1981, 2683, 5319, 75, 22569, 29697, 27627}}, {9696, 17, 33788, {1, 3, 7, 5, 31, 43, 95, 131, 423, 547, 1437, 127, 1953, 861, 839, 54503, 20465}}, {9697, 17, 33791, {1, 1, 5, 3, 29, 29, 71, 237, 275, 493, 513, 4067, 393, 9415, 20511, 29257, 86267}}, {9698, 17, 33793, {1, 1, 1, 1, 25, 11, 59, 185, 211, 175, 37, 2999, 4919, 10225, 16727, 60447, 59985}}, {9699, 17, 33811, {1, 1, 3, 3, 1, 9, 69, 195, 197, 677, 229, 599, 5613, 4537, 5495, 58801, 14297}}, {9700, 17, 33813, {1, 3, 1, 15, 17, 23, 5, 101, 331, 943, 1433, 2199, 313, 469, 3651, 3281, 100119}}, {9701, 17, 33818, {1, 1, 5, 15, 13, 25, 87, 45, 229, 821, 59, 761, 6259, 15159, 3197, 39763, 87301}}, {9702, 17, 33829, {1, 3, 5, 7, 19, 21, 89, 15, 19, 623, 603, 4069, 3531, 13353, 21267, 6355, 53821}}, {9703, 17, 33842, {1, 1, 5, 9, 13, 13, 111, 77, 439, 599, 1577, 959, 4567, 3117, 7127, 49265, 35667}}, {9704, 17, 33854, {1, 3, 7, 9, 27, 61, 1, 19, 43, 475, 221, 655, 4351, 15827, 30489, 22245, 41077}}, {9705, 17, 33856, {1, 1, 3, 13, 17, 17, 111, 85, 253, 11, 367, 2349, 4103, 12517, 27037, 42481, 84451}}, {9706, 17, 33868, {1, 3, 5, 7, 7, 25, 53, 27, 429, 503, 893, 2923, 2539, 15849, 30157, 12111, 108893}}, {9707, 17, 33879, {1, 1, 7, 9, 13, 29, 51, 113, 273, 745, 759, 263, 3031, 705, 23203, 64245, 127183}}, {9708, 17, 33885, {1, 1, 1, 9, 29, 5, 25, 165, 261, 319, 645, 2199, 3135, 10263, 10711, 18713, 63337}}, {9709, 17, 33886, {1, 1, 5, 1, 23, 41, 43, 71, 365, 683, 1107, 1671, 7079, 8933, 12815, 8095, 97955}}, {9710, 17, 33892, {1, 3, 1, 15, 9, 43, 105, 217, 131, 299, 1459, 1087, 3493, 15297, 11741, 43383, 35021}}, {9711, 17, 33907, {1, 3, 1, 3, 3, 57, 69, 7, 73, 977, 1163, 3591, 243, 13129, 23247, 20609, 22489}}, {9712, 17, 33913, {1, 3, 7, 5, 1, 57, 65, 27, 121, 575, 903, 3527, 5601, 5597, 1941, 60079, 88121}}, {9713, 17, 33923, {1, 3, 1, 3, 15, 3, 23, 87, 233, 389, 1671, 1557, 4825, 1017, 17697, 26735, 53421}}, {9714, 17, 33925, {1, 3, 5, 3, 5, 43, 61, 249, 273, 251, 1383, 2415, 1061, 12363, 3071, 23785, 127909}}, {9715, 17, 33935, {1, 3, 3, 13, 5, 63, 15, 165, 353, 603, 1627, 2037, 487, 11603, 719, 54693, 52645}}, {9716, 17, 33937, {1, 3, 5, 11, 31, 41, 41, 83, 481, 251, 1903, 2655, 5237, 6073, 20201, 14069, 91649}}, {9717, 17, 33954, {1, 3, 1, 15, 21, 41, 99, 61, 55, 63, 1595, 1805, 7625, 12261, 23275, 43471, 5147}}, {9718, 17, 33963, {1, 3, 1, 5, 23, 21, 71, 169, 197, 51, 1653, 3053, 4663, 293, 12751, 15641, 83993}}, {9719, 17, 33966, {1, 3, 5, 15, 29, 45, 55, 199, 275, 103, 1093, 3569, 5997, 9445, 2291, 30973, 68589}}, {9720, 17, 33977, {1, 3, 5, 7, 15, 3, 15, 3, 287, 961, 1759, 1153, 7613, 9885, 8981, 5109, 112865}}, {9721, 17, 33978, {1, 1, 1, 9, 1, 37, 111, 61, 309, 581, 875, 2121, 1035, 4345, 1351, 59743, 34955}}, {9722, 17, 33991, {1, 3, 7, 7, 11, 23, 51, 235, 23, 697, 991, 1995, 3615, 6665, 15885, 18555, 11711}}, {9723, 17, 33998, {1, 3, 7, 13, 3, 59, 87, 129, 405, 689, 1189, 2071, 877, 12347, 18381, 28367, 27247}}, {9724, 17, 34012, {1, 1, 1, 9, 23, 29, 113, 71, 479, 421, 215, 1029, 6125, 13575, 10823, 45303, 3153}}, {9725, 17, 34016, {1, 1, 3, 11, 13, 5, 31, 29, 279, 597, 791, 319, 1391, 14487, 3811, 36913, 11513}}, {9726, 17, 34025, {1, 3, 7, 11, 9, 11, 55, 167, 69, 519, 1887, 145, 6133, 1307, 14465, 17419, 18319}}, {9727, 17, 34033, {1, 1, 3, 1, 29, 25, 57, 75, 19, 187, 1591, 421, 959, 7499, 8377, 42811, 53423}}, {9728, 17, 34036, {1, 3, 1, 3, 7, 9, 73, 217, 383, 755, 1561, 3923, 3891, 16129, 13195, 62097, 67493}}, {9729, 17, 34045, {1, 3, 7, 9, 5, 7, 47, 29, 319, 243, 405, 2867, 5803, 2273, 4913, 54777, 88301}}, {9730, 17, 34065, {1, 3, 7, 1, 25, 11, 51, 183, 387, 863, 39, 2119, 2395, 10175, 20833, 3235, 108197}}, {9731, 17, 34078, {1, 1, 7, 13, 25, 43, 21, 67, 103, 709, 603, 1045, 7079, 8867, 29039, 61499, 39533}}, {9732, 17, 34093, {1, 1, 7, 5, 7, 55, 77, 115, 409, 287, 1149, 1535, 7459, 5525, 27129, 43659, 86953}}, {9733, 17, 34101, {1, 3, 5, 3, 21, 41, 47, 147, 267, 473, 1501, 2663, 5381, 41, 18265, 53845, 16039}}, {9734, 17, 34108, {1, 1, 7, 15, 27, 63, 95, 103, 169, 1, 133, 3103, 7539, 5765, 11453, 4133, 95133}}, {9735, 17, 34111, {1, 3, 3, 15, 3, 53, 121, 135, 385, 475, 889, 2557, 4937, 11129, 18461, 16757, 30339}}, {9736, 17, 34120, {1, 3, 1, 13, 11, 39, 111, 13, 475, 201, 1973, 2151, 6973, 4083, 12593, 44093, 108037}}, {9737, 17, 34123, {1, 3, 7, 9, 31, 31, 97, 235, 179, 689, 403, 1995, 7697, 7511, 29333, 11005, 50723}}, {9738, 17, 34125, {1, 1, 7, 13, 23, 5, 7, 171, 441, 921, 1455, 3865, 7089, 5469, 10423, 53013, 80559}}, {9739, 17, 34153, {1, 3, 5, 3, 25, 43, 105, 157, 507, 143, 297, 1111, 2761, 14103, 4965, 36733, 11741}}, {9740, 17, 34171, {1, 3, 7, 9, 29, 61, 49, 239, 271, 697, 211, 1633, 2991, 14933, 12347, 44291, 12219}}, {9741, 17, 34174, {1, 1, 7, 7, 17, 61, 29, 43, 87, 633, 937, 1931, 3541, 12259, 23045, 5923, 48479}}, {9742, 17, 34178, {1, 3, 3, 3, 15, 25, 105, 17, 159, 863, 1377, 331, 1475, 10573, 28947, 8141, 26671}}, {9743, 17, 34183, {1, 1, 7, 7, 31, 59, 81, 23, 467, 241, 1257, 1337, 7731, 9071, 3417, 51191, 78369}}, {9744, 17, 34190, {1, 1, 5, 9, 11, 45, 49, 227, 319, 63, 1339, 885, 4571, 11649, 5607, 10509, 55055}}, {9745, 17, 34201, {1, 3, 3, 9, 29, 17, 7, 235, 191, 927, 575, 1115, 4111, 14179, 2041, 13331, 29825}}, {9746, 17, 34211, {1, 1, 5, 9, 27, 61, 71, 201, 341, 577, 221, 1371, 1135, 4347, 24211, 36171, 23435}}, {9747, 17, 34220, {1, 3, 3, 1, 1, 29, 75, 121, 193, 647, 1429, 275, 5243, 783, 28533, 13941, 68035}}, {9748, 17, 34225, {1, 3, 5, 15, 21, 27, 117, 183, 251, 991, 935, 3119, 5133, 2765, 7423, 28867, 120565}}, {9749, 17, 34237, {1, 3, 5, 5, 13, 23, 29, 101, 299, 699, 1249, 1225, 1335, 6079, 17825, 60467, 87787}}, {9750, 17, 34249, {1, 1, 1, 9, 15, 19, 11, 163, 433, 553, 1487, 813, 3293, 1195, 895, 28431, 62905}}, {9751, 17, 34250, {1, 1, 1, 13, 25, 37, 111, 129, 391, 813, 1061, 4065, 7339, 10731, 23799, 41463, 99673}}, {9752, 17, 34264, {1, 1, 7, 15, 3, 21, 45, 77, 471, 155, 967, 711, 4947, 13983, 27827, 28653, 117839}}, {9753, 17, 34269, {1, 1, 5, 9, 13, 39, 107, 237, 233, 881, 297, 2189, 8085, 1221, 18659, 299, 90951}}, {9754, 17, 34276, {1, 1, 1, 13, 21, 53, 83, 17, 487, 215, 1203, 3017, 7887, 3759, 10521, 31223, 87917}}, {9755, 17, 34279, {1, 1, 7, 1, 13, 31, 123, 219, 127, 743, 1325, 3907, 129, 8901, 4855, 22509, 47331}}, {9756, 17, 34293, {1, 1, 7, 11, 29, 37, 11, 157, 401, 35, 2037, 2873, 7409, 7837, 1247, 33911, 3979}}, {9757, 17, 34303, {1, 1, 5, 15, 1, 13, 35, 253, 287, 1007, 1417, 1613, 6019, 11617, 6323, 56263, 45073}}, {9758, 17, 34310, {1, 3, 1, 15, 1, 59, 41, 239, 373, 443, 897, 275, 5783, 8619, 18559, 16279, 92063}}, {9759, 17, 34340, {1, 3, 1, 9, 23, 33, 83, 43, 231, 819, 1657, 1031, 5507, 12621, 8961, 23059, 63453}}, {9760, 17, 34349, {1, 1, 7, 5, 29, 49, 21, 251, 267, 43, 729, 4013, 1497, 15489, 16761, 49689, 122755}}, {9761, 17, 34352, {1, 3, 7, 1, 31, 21, 11, 149, 127, 711, 1249, 49, 5503, 677, 12313, 61301, 16279}}, {9762, 17, 34355, {1, 1, 5, 11, 9, 15, 41, 61, 81, 991, 1387, 3567, 221, 15835, 8609, 28265, 98199}}, {9763, 17, 34358, {1, 3, 1, 7, 21, 35, 13, 59, 173, 637, 107, 393, 4551, 6523, 27389, 33129, 45579}}, {9764, 17, 34362, {1, 1, 1, 9, 29, 51, 65, 199, 417, 553, 1321, 2513, 4749, 8477, 19721, 24301, 16301}}, {9765, 17, 34376, {1, 3, 5, 1, 25, 13, 7, 55, 163, 581, 1677, 2313, 6843, 15697, 3055, 53171, 59899}}, {9766, 17, 34381, {1, 3, 1, 5, 31, 13, 101, 195, 235, 359, 911, 1017, 2575, 12801, 997, 7819, 73243}}, {9767, 17, 34387, {1, 1, 7, 1, 9, 39, 59, 83, 57, 885, 317, 2689, 5741, 11833, 25563, 62581, 62239}}, {9768, 17, 34389, {1, 1, 5, 15, 25, 25, 55, 207, 223, 907, 913, 387, 5599, 15567, 8859, 13703, 66071}}, {9769, 17, 34394, {1, 1, 5, 15, 19, 39, 83, 177, 333, 531, 1257, 2687, 7793, 15967, 19175, 1381, 106629}}, {9770, 17, 34410, {1, 3, 5, 13, 29, 29, 77, 1, 273, 483, 725, 3825, 5115, 4043, 11571, 8693, 49761}}, {9771, 17, 34423, {1, 1, 7, 3, 5, 45, 37, 65, 267, 191, 301, 2863, 167, 9303, 14563, 41553, 119561}}, {9772, 17, 34434, {1, 1, 7, 5, 21, 41, 107, 213, 267, 427, 699, 1485, 2125, 16011, 29243, 4691, 50545}}, {9773, 17, 34436, {1, 3, 3, 9, 15, 29, 81, 53, 289, 689, 933, 2667, 5175, 10409, 28221, 56375, 49109}}, {9774, 17, 34448, {1, 1, 1, 15, 3, 11, 77, 107, 353, 349, 219, 1961, 7559, 10081, 25119, 46041, 103827}}, {9775, 17, 34453, {1, 3, 3, 1, 5, 27, 109, 17, 271, 543, 565, 397, 2649, 12037, 4525, 37835, 107071}}, {9776, 17, 34454, {1, 1, 5, 15, 3, 37, 123, 157, 389, 619, 1379, 4093, 6107, 4419, 21011, 36189, 21269}}, {9777, 17, 34460, {1, 3, 1, 7, 25, 17, 37, 133, 247, 113, 985, 815, 441, 7869, 25121, 49459, 429}}, {9778, 17, 34464, {1, 3, 3, 11, 7, 23, 59, 51, 403, 685, 2019, 1167, 7973, 6915, 10819, 43807, 127793}}, {9779, 17, 34479, {1, 1, 3, 1, 29, 3, 125, 107, 305, 101, 391, 2733, 6883, 5867, 5139, 16025, 112439}}, {9780, 17, 34491, {1, 1, 5, 5, 23, 23, 89, 33, 275, 451, 1033, 649, 3761, 4735, 26021, 9627, 102747}}, {9781, 17, 34501, {1, 1, 5, 13, 3, 17, 117, 251, 425, 917, 759, 3047, 8171, 14421, 27765, 11085, 64889}}, {9782, 17, 34508, {1, 3, 1, 9, 7, 23, 107, 143, 123, 413, 2045, 655, 6283, 8783, 20263, 55463, 33271}}, {9783, 17, 34516, {1, 3, 7, 11, 5, 49, 73, 55, 465, 43, 587, 3943, 521, 12357, 16273, 26603, 23219}}, {9784, 17, 34529, {1, 3, 5, 13, 9, 3, 127, 171, 271, 227, 993, 1427, 2235, 6325, 13501, 1411, 44393}}, {9785, 17, 34530, {1, 1, 1, 3, 13, 27, 19, 37, 175, 423, 5, 3403, 5427, 16345, 30297, 11909, 104647}}, {9786, 17, 34553, {1, 3, 1, 3, 3, 39, 111, 179, 487, 923, 1945, 1609, 4689, 11807, 13725, 3081, 48163}}, {9787, 17, 34564, {1, 3, 1, 1, 9, 35, 7, 151, 109, 925, 1249, 3171, 1207, 2053, 5135, 34821, 57291}}, {9788, 17, 34568, {1, 1, 5, 13, 31, 35, 101, 199, 499, 725, 1229, 2857, 6437, 503, 14437, 35721, 24971}}, {9789, 17, 34571, {1, 1, 1, 15, 3, 49, 75, 101, 373, 119, 875, 245, 15, 12937, 4731, 13037, 1555}}, {9790, 17, 34582, {1, 1, 1, 7, 15, 5, 53, 5, 423, 69, 73, 2139, 383, 4035, 6723, 59941, 124503}}, {9791, 17, 34586, {1, 1, 3, 13, 1, 23, 29, 47, 145, 785, 1013, 1579, 4579, 107, 17571, 46311, 27777}}, {9792, 17, 34598, {1, 1, 1, 5, 23, 25, 97, 75, 105, 183, 827, 3871, 2005, 6453, 28729, 42583, 62979}}, {9793, 17, 34604, {1, 3, 5, 9, 11, 49, 29, 201, 333, 441, 429, 1955, 5301, 11775, 22915, 58693, 111917}}, {9794, 17, 34610, {1, 3, 3, 1, 15, 37, 117, 223, 319, 181, 61, 177, 507, 14871, 16419, 34261, 106937}}, {9795, 17, 34619, {1, 3, 3, 9, 25, 27, 81, 253, 459, 5, 693, 1271, 485, 16171, 427, 17917, 4393}}, {9796, 17, 34621, {1, 3, 3, 1, 27, 47, 11, 57, 269, 95, 569, 2733, 3275, 1599, 15073, 58071, 86805}}, {9797, 17, 34633, {1, 3, 7, 13, 21, 57, 75, 63, 53, 487, 251, 3193, 4279, 2311, 6613, 38319, 93557}}, {9798, 17, 34634, {1, 3, 5, 5, 31, 35, 39, 255, 11, 81, 605, 1457, 6367, 14121, 8069, 46653, 79945}}, {9799, 17, 34657, {1, 1, 1, 7, 17, 19, 19, 247, 13, 757, 1069, 2811, 4969, 10943, 29399, 4153, 120817}}, {9800, 17, 34682, {1, 1, 1, 15, 31, 13, 1, 247, 157, 785, 1565, 897, 4825, 8375, 4933, 60671, 88403}}, {9801, 17, 34688, {1, 3, 3, 7, 31, 53, 117, 207, 243, 603, 625, 1039, 5725, 5021, 20227, 28613, 123759}}, {9802, 17, 34691, {1, 1, 5, 1, 7, 29, 65, 153, 393, 821, 295, 2705, 5999, 15801, 31301, 15545, 52917}}, {9803, 17, 34694, {1, 1, 1, 1, 11, 51, 97, 143, 27, 279, 1005, 1235, 5539, 1523, 26293, 35015, 47835}}, {9804, 17, 34706, {1, 3, 3, 13, 27, 17, 123, 147, 39, 35, 567, 961, 5431, 5557, 17849, 46675, 102181}}, {9805, 17, 34708, {1, 1, 7, 11, 7, 25, 73, 223, 459, 207, 1637, 647, 2057, 685, 24539, 48809, 26877}}, {9806, 17, 34724, {1, 3, 1, 3, 21, 43, 121, 11, 431, 383, 1703, 1451, 2349, 11845, 13801, 20589, 43125}}, {9807, 17, 34727, {1, 1, 5, 1, 27, 29, 89, 233, 437, 303, 853, 3425, 263, 2073, 14111, 39129, 59547}}, {9808, 17, 34751, {1, 1, 1, 3, 3, 47, 99, 207, 261, 179, 1761, 2657, 4339, 6567, 25455, 18729, 51431}}, {9809, 17, 34753, {1, 3, 3, 13, 5, 5, 109, 125, 123, 233, 1713, 1539, 4375, 12187, 18355, 49597, 109959}}, {9810, 17, 34759, {1, 3, 7, 7, 9, 23, 45, 193, 363, 837, 855, 1413, 7587, 9091, 27907, 17809, 63249}}, {9811, 17, 34763, {1, 3, 3, 9, 19, 23, 63, 85, 419, 1007, 1753, 539, 1471, 2171, 9239, 36289, 105503}}, {9812, 17, 34777, {1, 3, 1, 11, 23, 5, 105, 79, 473, 879, 1623, 3155, 5157, 4699, 697, 41919, 15441}}, {9813, 17, 34778, {1, 1, 7, 11, 5, 21, 43, 207, 491, 355, 857, 2325, 819, 15849, 24529, 5789, 110661}}, {9814, 17, 34780, {1, 1, 5, 15, 19, 33, 81, 137, 473, 853, 1681, 3841, 5617, 13715, 1987, 52983, 66327}}, {9815, 17, 34796, {1, 3, 5, 7, 11, 31, 69, 85, 33, 197, 1771, 1957, 1311, 169, 14159, 7327, 8577}}, {9816, 17, 34799, {1, 1, 3, 9, 11, 23, 19, 143, 9, 579, 111, 2973, 3567, 8561, 10447, 55875, 64305}}, {9817, 17, 34801, {1, 1, 5, 7, 1, 17, 93, 11, 423, 1007, 839, 719, 3965, 14531, 17301, 29577, 4083}}, {9818, 17, 34817, {1, 3, 5, 13, 19, 17, 123, 61, 59, 115, 1165, 579, 2545, 633, 5597, 21865, 109167}}, {9819, 17, 34824, {1, 1, 5, 3, 29, 29, 99, 163, 321, 367, 1523, 3719, 665, 15843, 28831, 63823, 113533}}, {9820, 17, 34827, {1, 1, 1, 3, 15, 7, 85, 1, 181, 759, 537, 3315, 7159, 4363, 4183, 53775, 8801}}, {9821, 17, 34837, {1, 3, 1, 1, 15, 53, 9, 35, 459, 417, 1169, 2055, 1175, 10923, 335, 24269, 93001}}, {9822, 17, 34841, {1, 3, 1, 5, 31, 43, 51, 149, 175, 541, 629, 1147, 7585, 9725, 18623, 13345, 65391}}, {9823, 17, 34853, {1, 3, 7, 1, 13, 39, 13, 217, 507, 765, 721, 1491, 5037, 6267, 2871, 19181, 123751}}, {9824, 17, 34858, {1, 1, 3, 5, 21, 9, 123, 195, 63, 347, 7, 531, 3015, 9457, 29543, 51479, 26607}}, {9825, 17, 34877, {1, 1, 1, 1, 21, 15, 81, 127, 429, 15, 901, 1503, 1919, 6515, 2477, 53571, 113447}}, {9826, 17, 34886, {1, 3, 1, 13, 9, 33, 79, 169, 499, 767, 441, 2085, 2429, 10213, 4125, 2611, 26137}}, {9827, 17, 34895, {1, 1, 3, 1, 19, 23, 83, 179, 447, 513, 913, 1201, 1861, 11595, 29037, 7775, 116417}}, {9828, 17, 34897, {1, 3, 3, 7, 3, 57, 47, 183, 413, 319, 1375, 1401, 2231, 14331, 28625, 43839, 102717}}, {9829, 17, 34898, {1, 1, 5, 11, 31, 27, 111, 85, 191, 155, 2025, 1501, 4991, 4655, 3451, 10219, 60391}}, {9830, 17, 34916, {1, 3, 3, 7, 17, 19, 113, 37, 423, 479, 709, 3659, 6567, 1709, 13483, 61821, 77101}}, {9831, 17, 34923, {1, 3, 1, 13, 3, 17, 73, 61, 275, 359, 1341, 449, 1373, 12047, 11207, 52651, 83305}}, {9832, 17, 34928, {1, 1, 7, 9, 9, 45, 15, 121, 15, 51, 509, 2189, 5057, 6119, 11669, 14559, 108323}}, {9833, 17, 34934, {1, 1, 7, 7, 25, 13, 13, 141, 157, 249, 823, 821, 1909, 5925, 3505, 13187, 19237}}, {9834, 17, 34940, {1, 3, 3, 1, 9, 51, 79, 91, 5, 709, 787, 2427, 4613, 7307, 20141, 1675, 49779}}, {9835, 17, 34944, {1, 1, 1, 11, 11, 13, 33, 81, 413, 981, 907, 2709, 4113, 10607, 2587, 12845, 11103}}, {9836, 17, 34947, {1, 1, 7, 9, 13, 25, 37, 81, 375, 1013, 2027, 321, 3947, 2269, 10687, 7537, 67495}}, {9837, 17, 34953, {1, 3, 5, 11, 9, 43, 53, 111, 339, 841, 503, 3209, 6437, 10893, 13627, 51809, 57229}}, {9838, 17, 34956, {1, 3, 1, 1, 21, 15, 71, 93, 453, 405, 1099, 2979, 7471, 10173, 17875, 13179, 48615}}, {9839, 17, 34967, {1, 3, 5, 9, 9, 1, 121, 117, 275, 157, 57, 3459, 4787, 15005, 24591, 23963, 45077}}, {9840, 17, 34968, {1, 1, 5, 3, 21, 57, 113, 207, 169, 603, 637, 1455, 6281, 6527, 17219, 32307, 18617}}, {9841, 17, 34971, {1, 3, 7, 5, 25, 15, 99, 91, 253, 267, 537, 713, 3929, 895, 7999, 47989, 118731}}, {9842, 17, 34974, {1, 3, 7, 15, 23, 17, 5, 129, 121, 251, 219, 2547, 7291, 1079, 14577, 56229, 35253}}, {9843, 17, 34977, {1, 3, 1, 15, 5, 61, 35, 135, 497, 681, 751, 2303, 6697, 11225, 30389, 61673, 87313}}, {9844, 17, 34980, {1, 3, 1, 7, 7, 37, 9, 85, 257, 805, 1325, 3597, 6065, 727, 18203, 57077, 437}}, {9845, 17, 34983, {1, 3, 5, 7, 5, 43, 29, 179, 73, 173, 1441, 1233, 1779, 7893, 10629, 27547, 7775}}, {9846, 17, 34998, {1, 1, 7, 5, 31, 29, 21, 35, 289, 423, 449, 3331, 2929, 6827, 15569, 9873, 76889}}, {9847, 17, 35004, {1, 1, 7, 13, 13, 37, 55, 99, 135, 797, 1263, 2539, 893, 4225, 16689, 38259, 50857}}, {9848, 17, 35010, {1, 1, 3, 1, 5, 3, 95, 29, 15, 539, 825, 3931, 4809, 8299, 29891, 61357, 97523}}, {9849, 17, 35012, {1, 3, 1, 9, 27, 25, 115, 239, 387, 163, 1153, 31, 2375, 7943, 31929, 1121, 33085}}, {9850, 17, 35030, {1, 3, 5, 9, 3, 53, 121, 159, 165, 81, 317, 3051, 1991, 493, 2029, 43305, 130209}}, {9851, 17, 35039, {1, 1, 1, 5, 9, 57, 39, 247, 73, 613, 1047, 3289, 2569, 5363, 18475, 32749, 39415}}, {9852, 17, 35058, {1, 3, 1, 5, 19, 23, 39, 33, 151, 463, 153, 737, 2501, 7531, 2769, 35595, 71799}}, {9853, 17, 35063, {1, 3, 5, 5, 29, 49, 105, 81, 67, 441, 1101, 2241, 6243, 6177, 7157, 51635, 81241}}, {9854, 17, 35082, {1, 3, 3, 3, 29, 53, 13, 239, 487, 503, 97, 1323, 1817, 13021, 12881, 26943, 21011}}, {9855, 17, 35095, {1, 1, 1, 15, 25, 9, 5, 205, 85, 635, 789, 2495, 5069, 4987, 847, 26857, 84225}}, {9856, 17, 35096, {1, 1, 3, 15, 9, 51, 79, 13, 377, 637, 159, 3407, 2057, 13967, 31781, 40869, 52987}}, {9857, 17, 35101, {1, 3, 1, 13, 11, 27, 103, 207, 383, 887, 749, 1119, 285, 4269, 31745, 57539, 5671}}, {9858, 17, 35102, {1, 3, 1, 13, 23, 19, 41, 43, 455, 425, 1653, 4091, 4855, 16321, 169, 59289, 82397}}, {9859, 17, 35105, {1, 3, 3, 15, 31, 39, 51, 127, 391, 989, 1831, 3327, 6487, 6077, 17277, 52093, 20389}}, {9860, 17, 35112, {1, 3, 5, 15, 19, 1, 21, 241, 15, 543, 1529, 2355, 1503, 12795, 17321, 41219, 61115}}, {9861, 17, 35118, {1, 1, 3, 11, 9, 33, 21, 197, 307, 141, 1663, 371, 1663, 8307, 3617, 56941, 62477}}, {9862, 17, 35120, {1, 3, 7, 9, 19, 53, 123, 3, 29, 635, 1795, 2471, 2491, 15847, 9169, 2561, 101515}}, {9863, 17, 35130, {1, 1, 5, 3, 19, 11, 117, 231, 475, 837, 1833, 3499, 4415, 9961, 28285, 37821, 81497}}, {9864, 17, 35143, {1, 1, 3, 5, 7, 11, 57, 89, 345, 157, 1519, 3021, 7157, 2159, 32557, 31559, 128907}}, {9865, 17, 35147, {1, 1, 7, 3, 27, 1, 15, 177, 489, 405, 811, 3597, 4939, 15595, 7279, 58097, 84703}}, {9866, 17, 35152, {1, 3, 1, 9, 25, 61, 119, 219, 111, 339, 1091, 759, 6087, 16001, 6757, 15627, 1691}}, {9867, 17, 35157, {1, 3, 7, 9, 1, 39, 107, 139, 143, 917, 421, 1623, 7135, 4851, 6687, 6177, 102425}}, {9868, 17, 35164, {1, 1, 7, 13, 23, 17, 19, 167, 317, 331, 743, 3737, 2195, 545, 2185, 9125, 30503}}, {9869, 17, 35178, {1, 1, 5, 13, 27, 33, 117, 141, 493, 129, 1553, 2335, 4161, 14205, 24177, 35163, 84869}}, {9870, 17, 35195, {1, 3, 7, 1, 11, 9, 75, 133, 113, 507, 2007, 2473, 4769, 14655, 17967, 17709, 90653}}, {9871, 17, 35197, {1, 1, 7, 11, 17, 11, 83, 23, 387, 61, 29, 3905, 4351, 15173, 28375, 9129, 111939}}, {9872, 17, 35201, {1, 1, 5, 15, 15, 53, 81, 125, 189, 937, 1607, 2595, 2847, 7229, 22241, 26269, 64781}}, {9873, 17, 35207, {1, 3, 1, 7, 5, 11, 61, 111, 13, 423, 885, 2329, 6003, 16331, 11207, 25743, 54619}}, {9874, 17, 35231, {1, 3, 5, 9, 1, 13, 95, 241, 237, 629, 263, 1629, 1063, 12695, 14501, 5455, 121483}}, {9875, 17, 35249, {1, 1, 7, 15, 5, 17, 45, 255, 143, 79, 87, 1755, 6215, 5095, 32411, 8695, 85511}}, {9876, 17, 35250, {1, 3, 7, 7, 21, 11, 117, 135, 333, 73, 1471, 2749, 5801, 4209, 9353, 46171, 90645}}, {9877, 17, 35256, {1, 1, 7, 13, 11, 35, 77, 149, 159, 783, 1527, 2881, 1409, 3455, 26991, 3225, 30693}}, {9878, 17, 35259, {1, 1, 3, 15, 19, 55, 21, 245, 207, 103, 775, 2041, 4637, 7333, 11267, 60509, 43099}}, {9879, 17, 35262, {1, 3, 3, 15, 17, 63, 23, 81, 183, 923, 75, 391, 615, 13343, 20839, 56529, 115747}}, {9880, 17, 35273, {1, 3, 1, 13, 5, 5, 15, 27, 263, 497, 1365, 2733, 5395, 7461, 2725, 24735, 89251}}, {9881, 17, 35282, {1, 1, 7, 7, 29, 17, 39, 117, 363, 915, 123, 283, 4575, 3497, 20995, 37883, 16645}}, {9882, 17, 35298, {1, 3, 3, 9, 1, 25, 79, 181, 331, 617, 393, 1807, 5145, 8007, 9173, 45189, 37945}}, {9883, 17, 35307, {1, 3, 1, 5, 1, 9, 127, 137, 379, 371, 367, 3237, 581, 15295, 18191, 37689, 103495}}, {9884, 17, 35328, {1, 1, 7, 1, 29, 53, 103, 173, 171, 973, 933, 3847, 3185, 10107, 31701, 45021, 106251}}, {9885, 17, 35334, {1, 1, 1, 7, 23, 9, 61, 25, 343, 471, 2041, 2179, 7647, 1885, 15353, 50379, 67681}}, {9886, 17, 35343, {1, 1, 5, 11, 31, 13, 51, 185, 83, 917, 85, 1317, 8185, 14949, 32455, 57939, 1217}}, {9887, 17, 35345, {1, 1, 7, 5, 23, 45, 101, 227, 497, 941, 985, 167, 6847, 9611, 20011, 40069, 83285}}, {9888, 17, 35355, {1, 1, 5, 13, 17, 33, 61, 197, 433, 255, 67, 1479, 5663, 6501, 30695, 27235, 80141}}, {9889, 17, 35388, {1, 1, 3, 5, 11, 45, 123, 49, 327, 893, 1963, 2225, 2611, 8925, 22811, 2313, 8411}}, {9890, 17, 35399, {1, 3, 7, 7, 15, 39, 75, 235, 13, 847, 575, 3947, 6947, 2061, 13467, 103, 86285}}, {9891, 17, 35403, {1, 1, 7, 3, 21, 43, 113, 197, 141, 873, 1139, 2707, 7235, 10683, 10831, 33695, 57063}}, {9892, 17, 35408, {1, 3, 5, 1, 3, 27, 45, 43, 119, 979, 1933, 1851, 6497, 14937, 4965, 41285, 120221}}, {9893, 17, 35413, {1, 1, 3, 1, 23, 59, 67, 7, 49, 351, 1053, 1837, 501, 7671, 26239, 51951, 95119}}, {9894, 17, 35418, {1, 3, 5, 11, 3, 19, 33, 33, 219, 175, 1439, 197, 1841, 159, 11229, 20463, 81797}}, {9895, 17, 35434, {1, 1, 7, 1, 13, 11, 79, 75, 53, 525, 91, 233, 5999, 2921, 21295, 56831, 116049}}, {9896, 17, 35436, {1, 3, 3, 13, 29, 7, 71, 207, 193, 635, 1393, 3093, 3775, 12445, 23281, 29401, 103225}}, {9897, 17, 35448, {1, 1, 7, 3, 29, 57, 111, 163, 63, 593, 881, 1587, 3027, 12599, 30977, 38891, 95495}}, {9898, 17, 35460, {1, 1, 5, 15, 17, 57, 111, 169, 149, 767, 377, 765, 7533, 1539, 22979, 55489, 29799}}, {9899, 17, 35475, {1, 3, 5, 15, 25, 7, 127, 71, 319, 389, 497, 1513, 1287, 7359, 12311, 45457, 45897}}, {9900, 17, 35494, {1, 1, 5, 3, 3, 35, 45, 17, 49, 483, 197, 727, 5355, 7201, 3035, 14313, 40933}}, {9901, 17, 35497, {1, 1, 7, 15, 1, 9, 27, 59, 455, 653, 1907, 281, 1435, 14593, 18909, 37655, 87603}}, {9902, 17, 35503, {1, 1, 7, 11, 29, 9, 67, 17, 353, 709, 859, 3687, 7741, 4251, 12263, 41717, 79393}}, {9903, 17, 35508, {1, 3, 3, 3, 1, 15, 113, 187, 255, 851, 503, 4089, 7923, 1701, 305, 8353, 16357}}, {9904, 17, 35511, {1, 1, 5, 3, 17, 31, 29, 233, 377, 215, 1889, 3459, 2443, 3907, 4193, 16519, 49089}}, {9905, 17, 35518, {1, 1, 3, 1, 17, 39, 11, 255, 247, 305, 669, 1769, 1355, 12055, 2275, 51681, 112337}}, {9906, 17, 35520, {1, 3, 1, 1, 17, 17, 75, 95, 409, 21, 1513, 1443, 4931, 6491, 1587, 62979, 90395}}, {9907, 17, 35530, {1, 1, 3, 5, 3, 19, 125, 175, 279, 911, 301, 407, 7773, 949, 32107, 13571, 58717}}, {9908, 17, 35537, {1, 3, 3, 15, 31, 35, 11, 223, 125, 209, 1719, 1725, 3387, 14879, 32243, 7219, 126791}}, {9909, 17, 35543, {1, 1, 3, 1, 31, 29, 67, 79, 93, 193, 1573, 2285, 3209, 8397, 17717, 5657, 61545}}, {9910, 17, 35560, {1, 3, 1, 9, 11, 33, 85, 121, 193, 63, 461, 1835, 889, 10687, 19831, 49551, 59087}}, {9911, 17, 35566, {1, 3, 3, 7, 11, 3, 9, 87, 91, 487, 289, 1113, 8135, 7971, 16693, 31009, 81197}}, {9912, 17, 35571, {1, 3, 3, 1, 23, 23, 61, 209, 409, 845, 547, 1493, 465, 6399, 17633, 53647, 52425}}, {9913, 17, 35598, {1, 1, 7, 7, 21, 31, 71, 249, 63, 895, 653, 93, 4429, 8951, 16873, 48089, 33947}}, {9914, 17, 35609, {1, 3, 5, 11, 3, 35, 49, 15, 379, 645, 855, 3657, 8019, 2141, 11233, 60731, 80455}}, {9915, 17, 35612, {1, 3, 1, 3, 1, 53, 101, 157, 255, 765, 1575, 1615, 7677, 9699, 13351, 2207, 90939}}, {9916, 17, 35615, {1, 3, 7, 7, 5, 43, 123, 109, 119, 391, 1889, 1991, 3151, 1457, 16321, 65245, 75891}}, {9917, 17, 35616, {1, 3, 1, 15, 9, 1, 113, 249, 1, 675, 501, 487, 2209, 4411, 6609, 29243, 100177}}, {9918, 17, 35622, {1, 1, 1, 7, 9, 23, 9, 197, 341, 191, 453, 3733, 5475, 15515, 28979, 36077, 17801}}, {9919, 17, 35626, {1, 1, 3, 13, 5, 35, 85, 121, 59, 429, 1251, 3437, 3121, 12411, 14713, 28125, 31921}}, {9920, 17, 35633, {1, 3, 5, 3, 27, 17, 61, 255, 485, 709, 83, 3201, 2191, 3371, 2941, 10931, 22141}}, {9921, 17, 35636, {1, 1, 1, 1, 19, 19, 25, 177, 397, 579, 529, 1619, 3887, 4537, 8123, 52481, 8305}}, {9922, 17, 35645, {1, 1, 3, 15, 3, 15, 77, 51, 31, 881, 203, 2359, 4947, 6321, 14705, 16471, 84395}}, {9923, 17, 35653, {1, 3, 7, 9, 13, 53, 67, 41, 289, 721, 1743, 2725, 435, 1327, 14953, 14283, 113211}}, {9924, 17, 35663, {1, 3, 1, 5, 19, 23, 73, 181, 187, 675, 125, 1877, 6167, 7919, 3955, 25007, 28299}}, {9925, 17, 35665, {1, 1, 3, 1, 5, 11, 123, 189, 173, 123, 499, 2175, 483, 13017, 14709, 5797, 36327}}, {9926, 17, 35682, {1, 3, 7, 5, 21, 39, 79, 229, 19, 203, 375, 3901, 1053, 14209, 13535, 63155, 99727}}, {9927, 17, 35687, {1, 1, 1, 13, 11, 29, 29, 173, 441, 271, 1147, 2891, 965, 10777, 16325, 37135, 101601}}, {9928, 17, 35688, {1, 1, 3, 3, 25, 13, 79, 233, 75, 191, 987, 3231, 3667, 1525, 14193, 62027, 77441}}, {9929, 17, 35691, {1, 3, 1, 1, 15, 53, 17, 45, 367, 263, 425, 1565, 6139, 13833, 12547, 61103, 75361}}, {9930, 17, 35696, {1, 1, 5, 15, 5, 57, 123, 47, 407, 887, 375, 1181, 5367, 10283, 24799, 33121, 76373}}, {9931, 17, 35727, {1, 1, 7, 3, 11, 17, 65, 133, 3, 609, 601, 3391, 7801, 4137, 32095, 55983, 23037}}, {9932, 17, 35741, {1, 3, 1, 3, 25, 5, 125, 5, 297, 571, 145, 3601, 1929, 13457, 16977, 21049, 92169}}, {9933, 17, 35742, {1, 3, 5, 13, 23, 29, 13, 143, 507, 187, 857, 427, 5125, 1377, 10947, 58473, 110541}}, {9934, 17, 35746, {1, 3, 3, 15, 15, 49, 39, 103, 193, 507, 639, 2399, 3829, 12105, 15993, 52975, 115935}}, {9935, 17, 35748, {1, 3, 7, 3, 7, 41, 95, 127, 193, 923, 1729, 3039, 7959, 3345, 7725, 35293, 34361}}, {9936, 17, 35752, {1, 3, 5, 13, 17, 53, 111, 141, 151, 389, 1955, 3333, 4523, 6331, 21239, 57447, 113325}}, {9937, 17, 35770, {1, 3, 7, 15, 31, 7, 11, 35, 105, 607, 1665, 3281, 487, 9417, 26205, 26963, 81537}}, {9938, 17, 35811, {1, 3, 1, 1, 17, 15, 3, 55, 451, 691, 1525, 2009, 6443, 4629, 15091, 46961, 83361}}, {9939, 17, 35817, {1, 3, 1, 15, 1, 29, 99, 79, 225, 665, 623, 2389, 3303, 7221, 20567, 15917, 24677}}, {9940, 17, 35832, {1, 1, 3, 15, 3, 17, 125, 239, 485, 849, 327, 1459, 3911, 2145, 14475, 24337, 19695}}, {9941, 17, 35838, {1, 3, 5, 7, 7, 37, 19, 51, 373, 587, 147, 563, 7623, 7781, 18289, 37239, 6803}}, {9942, 17, 35850, {1, 3, 5, 1, 9, 63, 5, 87, 171, 5, 1553, 429, 5001, 7881, 1493, 20425, 57727}}, {9943, 17, 35863, {1, 3, 5, 9, 25, 43, 17, 71, 87, 869, 1219, 2661, 4571, 9689, 18799, 62467, 128531}}, {9944, 17, 35870, {1, 1, 3, 3, 19, 53, 61, 9, 55, 433, 1555, 2369, 1423, 9081, 19185, 8513, 111079}}, {9945, 17, 35879, {1, 3, 5, 15, 11, 61, 1, 147, 17, 71, 1563, 1113, 4809, 16229, 23743, 59757, 64699}}, {9946, 17, 35880, {1, 1, 5, 11, 29, 23, 61, 43, 203, 97, 1119, 237, 6445, 14507, 9799, 18447, 14745}}, {9947, 17, 35891, {1, 3, 5, 15, 11, 17, 117, 139, 117, 537, 251, 149, 2731, 15863, 1381, 25435, 25501}}, {9948, 17, 35893, {1, 3, 3, 15, 31, 57, 53, 43, 95, 445, 1423, 3833, 2485, 11789, 16011, 8101, 39165}}, {9949, 17, 35903, {1, 1, 3, 11, 15, 37, 117, 3, 245, 57, 593, 2771, 7181, 11397, 5691, 3217, 44139}}, {9950, 17, 35905, {1, 3, 5, 1, 11, 13, 121, 85, 85, 511, 1837, 611, 237, 4893, 24025, 28903, 102025}}, {9951, 17, 35926, {1, 3, 1, 11, 5, 45, 43, 45, 393, 741, 1157, 1511, 1665, 2359, 19071, 24537, 122879}}, {9952, 17, 35930, {1, 3, 3, 3, 9, 59, 27, 11, 257, 203, 1535, 2729, 2313, 3539, 1689, 31901, 42949}}, {9953, 17, 35941, {1, 1, 1, 11, 17, 7, 21, 35, 479, 697, 107, 1317, 6585, 705, 3789, 20439, 33375}}, {9954, 17, 35956, {1, 1, 3, 11, 19, 37, 123, 233, 253, 733, 901, 3047, 3595, 2357, 24533, 40519, 109171}}, {9955, 17, 35963, {1, 3, 3, 13, 29, 51, 25, 149, 57, 253, 2001, 351, 7367, 15361, 4955, 60951, 19449}}, {9956, 17, 35970, {1, 1, 3, 15, 21, 53, 25, 239, 257, 437, 711, 3599, 5441, 7405, 15039, 19207, 63841}}, {9957, 17, 35984, {1, 3, 1, 9, 17, 41, 43, 231, 413, 747, 1447, 1407, 2615, 14529, 10781, 20001, 82713}}, {9958, 17, 35996, {1, 3, 7, 7, 9, 29, 25, 55, 53, 423, 1711, 2871, 2675, 421, 31703, 57099, 2955}}, {9959, 17, 36005, {1, 3, 1, 7, 31, 17, 113, 83, 387, 611, 1815, 2137, 3453, 4409, 20377, 60263, 81205}}, {9960, 17, 36012, {1, 1, 5, 3, 11, 1, 7, 225, 367, 267, 95, 939, 3801, 2619, 1207, 62695, 116407}}, {9961, 17, 36015, {1, 3, 3, 9, 5, 39, 85, 45, 247, 483, 491, 865, 3493, 8243, 8411, 26449, 50473}}, {9962, 17, 36030, {1, 3, 3, 9, 1, 53, 23, 127, 13, 529, 1925, 2629, 3451, 15073, 16075, 29909, 34101}}, {9963, 17, 36035, {1, 3, 1, 11, 1, 9, 125, 57, 79, 633, 979, 3843, 325, 883, 7769, 40155, 104057}}, {9964, 17, 36042, {1, 1, 7, 13, 23, 53, 27, 157, 493, 901, 1077, 1079, 1327, 15903, 20603, 64377, 103335}}, {9965, 17, 36047, {1, 3, 3, 3, 3, 35, 37, 167, 73, 301, 385, 1045, 6913, 2269, 22491, 19735, 70125}}, {9966, 17, 36049, {1, 1, 1, 11, 5, 23, 23, 85, 267, 845, 207, 77, 1245, 16209, 25579, 12417, 48723}}, {9967, 17, 36059, {1, 1, 5, 15, 11, 17, 43, 83, 373, 1005, 541, 115, 163, 2165, 8181, 35839, 44471}}, {9968, 17, 36071, {1, 3, 5, 7, 27, 41, 101, 13, 213, 235, 2037, 2179, 2121, 4481, 8127, 20011, 3981}}, {9969, 17, 36080, {1, 1, 5, 11, 7, 43, 59, 129, 127, 387, 489, 1985, 623, 13307, 19765, 62155, 93271}}, {9970, 17, 36085, {1, 1, 7, 5, 23, 63, 23, 177, 211, 233, 101, 1809, 7411, 8003, 25101, 32601, 75071}}, {9971, 17, 36097, {1, 1, 1, 11, 3, 25, 9, 91, 459, 611, 867, 3639, 5457, 9101, 15333, 40069, 67723}}, {9972, 17, 36110, {1, 3, 7, 5, 3, 29, 111, 75, 459, 195, 1405, 2281, 6085, 4425, 29061, 57335, 87449}}, {9973, 17, 36115, {1, 3, 7, 11, 21, 45, 53, 81, 77, 863, 1901, 3355, 5253, 10897, 26289, 48399, 26877}}, {9974, 17, 36118, {1, 3, 3, 13, 21, 37, 69, 87, 259, 101, 1203, 167, 6229, 145, 9355, 15347, 68047}}, {9975, 17, 36124, {1, 1, 3, 1, 31, 1, 15, 229, 429, 915, 929, 381, 1857, 8441, 22207, 47071, 127853}}, {9976, 17, 36137, {1, 3, 7, 3, 15, 9, 13, 161, 173, 573, 405, 3253, 7331, 13965, 3061, 40687, 130185}}, {9977, 17, 36138, {1, 3, 5, 5, 29, 29, 9, 115, 393, 377, 909, 321, 2861, 9881, 17863, 52033, 55133}}, {9978, 17, 36155, {1, 1, 7, 7, 27, 53, 101, 213, 199, 301, 1995, 2549, 5037, 13639, 18423, 23547, 79359}}, {9979, 17, 36160, {1, 3, 1, 7, 21, 51, 29, 151, 301, 665, 571, 53, 2637, 7229, 12517, 33647, 49413}}, {9980, 17, 36189, {1, 3, 3, 13, 13, 49, 49, 131, 325, 273, 1127, 2981, 2365, 14287, 23185, 26915, 81755}}, {9981, 17, 36190, {1, 1, 5, 3, 17, 45, 25, 79, 37, 265, 1205, 1805, 6707, 11525, 16473, 39525, 9571}}, {9982, 17, 36203, {1, 3, 3, 15, 9, 43, 55, 101, 469, 939, 365, 3443, 5759, 4751, 28893, 46727, 74569}}, {9983, 17, 36211, {1, 3, 7, 9, 5, 33, 11, 201, 263, 227, 1475, 2795, 1489, 11129, 18053, 31009, 73105}}, {9984, 17, 36218, {1, 3, 5, 5, 5, 25, 41, 151, 393, 237, 2017, 3811, 953, 13835, 28761, 22439, 76355}}, {9985, 17, 36230, {1, 1, 5, 13, 21, 37, 29, 11, 289, 67, 1317, 511, 685, 15227, 8731, 15039, 79491}}, {9986, 17, 36241, {1, 3, 1, 9, 31, 59, 123, 169, 473, 139, 575, 1057, 3213, 8213, 21845, 28123, 105335}}, {9987, 17, 36244, {1, 1, 1, 5, 21, 47, 23, 121, 403, 5, 1457, 2137, 569, 9267, 6367, 6991, 3113}}, {9988, 17, 36253, {1, 3, 3, 7, 13, 7, 25, 215, 81, 1003, 2041, 1317, 3913, 14705, 30551, 50889, 83441}}, {9989, 17, 36257, {1, 3, 3, 3, 13, 17, 63, 229, 83, 901, 953, 2603, 4685, 6961, 7519, 52441, 33223}}, {9990, 17, 36264, {1, 3, 7, 5, 7, 57, 65, 73, 243, 531, 261, 2517, 4083, 5889, 22913, 49603, 67135}}, {9991, 17, 36272, {1, 3, 5, 11, 15, 47, 81, 83, 35, 1021, 1313, 1109, 5103, 5469, 18149, 15307, 34939}}, {9992, 17, 36290, {1, 3, 7, 5, 21, 13, 105, 157, 435, 23, 931, 3565, 1, 4987, 8829, 7327, 51049}}, {9993, 17, 36292, {1, 1, 3, 11, 29, 9, 59, 49, 261, 1009, 1953, 2683, 8125, 10937, 16683, 36013, 5967}}, {9994, 17, 36301, {1, 1, 1, 1, 19, 29, 57, 9, 307, 457, 675, 3023, 495, 15257, 7945, 10449, 30155}}, {9995, 17, 36309, {1, 1, 7, 13, 25, 9, 51, 135, 491, 205, 1715, 3253, 1031, 4137, 14885, 39925, 6061}}, {9996, 17, 36313, {1, 1, 7, 7, 3, 13, 111, 91, 469, 133, 1221, 1035, 919, 3697, 26387, 41675, 487}}, {9997, 17, 36316, {1, 1, 3, 1, 19, 53, 11, 113, 245, 747, 189, 4051, 87, 1767, 3595, 10259, 100097}}, {9998, 17, 36319, {1, 1, 5, 3, 23, 49, 31, 47, 341, 1019, 723, 2353, 6191, 3809, 3297, 39443, 73529}}, {9999, 17, 36330, {1, 3, 3, 9, 25, 27, 123, 49, 51, 85, 1063, 2633, 6549, 14493, 7367, 3557, 60651}}, {10000, 17, 36335, {1, 3, 7, 5, 13, 27, 127, 65, 115, 731, 1147, 283, 91, 14205, 2457, 57083, 35815}}, {10001, 17, 36347, {1, 3, 3, 3, 25, 63, 99, 249, 25, 951, 733, 3621, 7139, 14223, 23641, 20287, 30743}}, {10002, 17, 36353, {1, 3, 3, 7, 21, 23, 83, 207, 235, 467, 1857, 2661, 1391, 10097, 12297, 54825, 5035}}, {10003, 17, 36356, {1, 1, 5, 3, 31, 17, 77, 9, 215, 553, 989, 3643, 729, 2057, 32053, 50305, 5499}}, {10004, 17, 36368, {1, 1, 7, 1, 23, 5, 111, 195, 431, 947, 403, 1781, 943, 15073, 67, 52225, 98987}}, {10005, 17, 36374, {1, 1, 5, 11, 23, 1, 41, 33, 457, 767, 275, 801, 5119, 3781, 14805, 52789, 41775}}, {10006, 17, 36377, {1, 1, 5, 3, 9, 53, 15, 183, 281, 691, 165, 3277, 7673, 1509, 16605, 53799, 100185}}, {10007, 17, 36384, {1, 3, 5, 11, 19, 45, 29, 159, 167, 67, 1259, 879, 7787, 8855, 24153, 42667, 102855}}, {10008, 17, 36407, {1, 1, 7, 13, 31, 19, 43, 133, 295, 287, 1985, 2451, 2297, 3853, 22401, 27659, 11149}}, {10009, 17, 36413, {1, 1, 7, 13, 31, 39, 125, 21, 173, 103, 1119, 3739, 6467, 2113, 4465, 26537, 129949}}, {10010, 17, 36419, {1, 1, 5, 15, 21, 47, 35, 125, 199, 335, 421, 31, 185, 12769, 30659, 33427, 106981}}, {10011, 17, 36425, {1, 3, 5, 13, 25, 35, 53, 253, 325, 921, 1705, 2735, 6437, 2287, 20479, 61107, 91453}}, {10012, 17, 36426, {1, 3, 7, 13, 25, 63, 83, 183, 5, 401, 329, 525, 3141, 393, 30469, 16529, 9605}}, {10013, 17, 36446, {1, 3, 3, 13, 19, 23, 15, 85, 323, 545, 149, 3645, 6269, 15595, 18453, 39, 128169}}, {10014, 17, 36461, {1, 3, 7, 15, 17, 5, 61, 61, 91, 353, 1039, 2959, 4147, 13205, 12599, 53281, 39509}}, {10015, 17, 36467, {1, 1, 3, 7, 21, 9, 97, 111, 249, 775, 845, 1789, 667, 489, 6689, 29217, 56527}}, {10016, 17, 36474, {1, 3, 5, 7, 11, 5, 59, 219, 29, 803, 923, 3861, 7953, 8969, 1819, 43501, 20513}}, {10017, 17, 36480, {1, 1, 5, 11, 7, 53, 63, 231, 193, 293, 1467, 1409, 6397, 13237, 15903, 19271, 66257}}, {10018, 17, 36486, {1, 3, 1, 15, 23, 15, 37, 123, 189, 63, 1121, 751, 6711, 10095, 6493, 40709, 47641}}, {10019, 17, 36489, {1, 3, 7, 3, 23, 59, 99, 183, 249, 479, 771, 1087, 7979, 409, 4819, 4337, 33345}}, {10020, 17, 36495, {1, 1, 5, 1, 17, 7, 15, 167, 305, 411, 1429, 3127, 23, 9123, 7185, 44405, 114841}}, {10021, 17, 36525, {1, 1, 5, 11, 3, 29, 29, 31, 399, 777, 251, 1841, 3607, 211, 23543, 29111, 54565}}, {10022, 17, 36526, {1, 3, 3, 9, 27, 33, 79, 27, 469, 67, 1327, 183, 5783, 10039, 13165, 20443, 4913}}, {10023, 17, 36533, {1, 3, 7, 15, 21, 23, 5, 227, 141, 1021, 69, 3347, 7221, 13837, 20921, 20525, 32567}}, {10024, 17, 36534, {1, 1, 5, 5, 25, 53, 73, 111, 319, 311, 1597, 1809, 5343, 13963, 6613, 14471, 53871}}, {10025, 17, 36540, {1, 3, 3, 1, 15, 57, 47, 205, 53, 471, 185, 273, 8077, 5031, 31195, 30859, 15979}}, {10026, 17, 36555, {1, 1, 3, 5, 23, 15, 87, 211, 83, 265, 1629, 2979, 69, 12559, 30455, 36363, 61461}}, {10027, 17, 36563, {1, 1, 7, 7, 1, 47, 5, 199, 95, 17, 57, 1887, 6847, 9501, 21361, 57763, 77069}}, {10028, 17, 36565, {1, 1, 3, 5, 9, 15, 15, 149, 141, 605, 639, 2197, 7237, 5753, 9415, 4677, 129947}}, {10029, 17, 36588, {1, 3, 7, 1, 7, 9, 29, 249, 275, 461, 1667, 4093, 5763, 3205, 24079, 11883, 86455}}, {10030, 17, 36593, {1, 1, 3, 5, 15, 39, 117, 145, 153, 671, 1819, 111, 3607, 12279, 4927, 63759, 42905}}, {10031, 17, 36596, {1, 1, 1, 5, 31, 5, 35, 183, 189, 839, 1811, 1877, 6545, 11373, 27947, 27183, 29857}}, {10032, 17, 36606, {1, 3, 5, 7, 29, 47, 3, 183, 511, 145, 1953, 3419, 6385, 7745, 12823, 59783, 69399}}, {10033, 17, 36614, {1, 3, 5, 9, 5, 39, 85, 145, 33, 899, 1009, 2035, 6145, 3855, 20583, 4329, 95231}}, {10034, 17, 36626, {1, 1, 3, 3, 15, 61, 85, 181, 247, 705, 413, 1633, 7489, 1785, 30397, 42851, 80197}}, {10035, 17, 36628, {1, 3, 3, 13, 23, 11, 3, 97, 307, 183, 113, 3881, 7455, 8327, 6749, 23977, 101629}}, {10036, 17, 36641, {1, 1, 7, 13, 1, 23, 59, 219, 125, 789, 1401, 707, 6915, 6275, 25813, 46595, 54119}}, {10037, 17, 36642, {1, 3, 7, 9, 5, 7, 37, 33, 165, 181, 833, 1993, 4541, 5799, 23323, 39825, 44575}}, {10038, 17, 36651, {1, 3, 1, 13, 13, 43, 69, 219, 437, 521, 503, 2293, 3607, 6845, 22583, 291, 65645}}, {10039, 17, 36653, {1, 1, 7, 9, 29, 13, 123, 67, 191, 933, 1875, 1223, 5525, 13797, 29771, 58191, 84469}}, {10040, 17, 36673, {1, 1, 7, 7, 3, 57, 101, 69, 23, 239, 1023, 3289, 1541, 6245, 23379, 161, 61155}}, {10041, 17, 36676, {1, 3, 7, 13, 25, 33, 49, 145, 487, 681, 451, 1719, 109, 16273, 20009, 3003, 115815}}, {10042, 17, 36679, {1, 1, 5, 11, 11, 59, 41, 133, 303, 469, 1975, 847, 5291, 13947, 8759, 8533, 25099}}, {10043, 17, 36694, {1, 1, 1, 1, 29, 31, 53, 11, 239, 57, 1627, 1247, 1577, 3269, 20751, 4627, 40499}}, {10044, 17, 36698, {1, 3, 7, 15, 1, 1, 51, 39, 383, 203, 1841, 3867, 4975, 9937, 1863, 52611, 83189}}, {10045, 17, 36704, {1, 3, 7, 7, 13, 59, 15, 217, 355, 945, 1317, 815, 2413, 10985, 30647, 37745, 126553}}, {10046, 17, 36714, {1, 1, 3, 11, 7, 29, 101, 137, 97, 119, 927, 3269, 6977, 4253, 10741, 61907, 122815}}, {10047, 17, 36721, {1, 3, 3, 1, 29, 5, 49, 137, 411, 349, 905, 2481, 4961, 4513, 29409, 19503, 77915}}, {10048, 17, 36722, {1, 1, 7, 13, 29, 59, 93, 61, 393, 29, 257, 3601, 6281, 5105, 17339, 53827, 83137}}, {10049, 17, 36727, {1, 1, 1, 13, 5, 23, 61, 7, 51, 161, 737, 1549, 6021, 3385, 5539, 21261, 69995}}, {10050, 17, 36749, {1, 1, 1, 15, 31, 1, 21, 113, 481, 7, 175, 717, 1593, 5937, 12347, 51835, 66649}}, {10051, 17, 36758, {1, 1, 3, 7, 9, 51, 9, 199, 39, 607, 1157, 3913, 7767, 14195, 28721, 27655, 34709}}, {10052, 17, 36761, {1, 3, 5, 5, 1, 15, 49, 33, 441, 721, 1749, 1497, 2023, 8351, 12641, 11861, 78545}}, {10053, 17, 36771, {1, 3, 1, 7, 7, 17, 103, 113, 243, 25, 889, 1419, 3163, 12401, 22459, 39037, 101719}}, {10054, 17, 36788, {1, 1, 7, 11, 17, 45, 121, 215, 3, 409, 1871, 2149, 4249, 5071, 14277, 55869, 91233}}, {10055, 17, 36797, {1, 1, 3, 7, 19, 31, 47, 241, 175, 749, 1709, 355, 6037, 10555, 24107, 64683, 42673}}, {10056, 17, 36805, {1, 3, 7, 11, 5, 21, 105, 137, 307, 101, 417, 1903, 1027, 10257, 27767, 9755, 92105}}, {10057, 17, 36830, {1, 1, 3, 13, 9, 59, 11, 63, 295, 923, 401, 1471, 3517, 7761, 28855, 11525, 72455}}, {10058, 17, 36833, {1, 1, 7, 15, 31, 51, 77, 29, 323, 579, 1313, 3441, 2903, 1683, 20605, 8185, 29753}}, {10059, 17, 36839, {1, 1, 5, 15, 11, 59, 119, 109, 233, 1001, 1527, 2709, 73, 5311, 18313, 27155, 85999}}, {10060, 17, 36843, {1, 3, 1, 5, 9, 59, 105, 93, 213, 401, 839, 3225, 3263, 13501, 2413, 60367, 121281}}, {10061, 17, 36860, {1, 1, 7, 3, 19, 25, 75, 27, 325, 435, 527, 1465, 3601, 5785, 6135, 32841, 60129}}, {10062, 17, 36866, {1, 1, 3, 7, 31, 19, 37, 157, 189, 51, 869, 2963, 5269, 9151, 14845, 30441, 89685}}, {10063, 17, 36871, {1, 3, 3, 9, 17, 51, 23, 177, 417, 255, 1739, 3085, 7811, 15177, 25433, 38487, 51021}}, {10064, 17, 36875, {1, 1, 3, 7, 27, 1, 45, 235, 59, 491, 1327, 3967, 7585, 4313, 29669, 47193, 89427}}, {10065, 17, 36877, {1, 1, 3, 9, 19, 5, 27, 63, 263, 593, 1599, 1311, 1029, 603, 25291, 51391, 98915}}, {10066, 17, 36880, {1, 3, 3, 15, 11, 7, 97, 99, 263, 155, 437, 3849, 2665, 3371, 8179, 51883, 3601}}, {10067, 17, 36892, {1, 1, 3, 15, 7, 35, 37, 149, 251, 619, 1423, 553, 4453, 16365, 22543, 6951, 34655}}, {10068, 17, 36911, {1, 3, 3, 11, 15, 21, 95, 143, 31, 425, 179, 2383, 4799, 7655, 26945, 9273, 103469}}, {10069, 17, 36914, {1, 3, 1, 9, 13, 49, 3, 117, 361, 459, 227, 2067, 4909, 13461, 22505, 10259, 59697}}, {10070, 17, 36916, {1, 1, 7, 7, 7, 23, 67, 217, 313, 965, 1747, 995, 579, 6217, 8915, 49329, 851}}, {10071, 17, 36923, {1, 1, 3, 1, 17, 19, 7, 99, 281, 207, 1685, 2401, 967, 9399, 28741, 28839, 6003}}, {10072, 17, 36940, {1, 3, 3, 5, 31, 61, 105, 251, 499, 319, 1167, 2203, 1195, 2663, 11797, 12981, 125523}}, {10073, 17, 36943, {1, 3, 1, 5, 23, 19, 99, 101, 85, 837, 501, 2737, 4051, 2413, 9275, 38995, 21633}}, {10074, 17, 36948, {1, 3, 7, 13, 17, 17, 119, 75, 281, 527, 1477, 1515, 7765, 5573, 10143, 6219, 57817}}, {10075, 17, 36957, {1, 1, 5, 11, 19, 35, 85, 171, 107, 905, 1395, 1199, 7345, 15719, 14021, 47425, 36081}}, {10076, 17, 36958, {1, 1, 3, 9, 9, 63, 109, 15, 323, 73, 1541, 2227, 5197, 12617, 23379, 53415, 105291}}, {10077, 17, 36967, {1, 3, 3, 5, 5, 41, 85, 99, 3, 895, 1383, 3627, 3897, 1893, 23673, 56501, 78411}}, {10078, 17, 36974, {1, 1, 7, 1, 25, 27, 45, 185, 475, 577, 1619, 727, 1407, 2383, 9215, 55295, 27349}}, {10079, 17, 36981, {1, 3, 7, 11, 3, 51, 53, 53, 399, 711, 1075, 511, 5369, 10777, 14419, 63217, 130181}}, {10080, 17, 37001, {1, 1, 7, 13, 25, 19, 107, 71, 151, 73, 735, 3837, 5307, 10229, 10529, 9989, 111925}}, {10081, 17, 37012, {1, 1, 1, 15, 19, 59, 65, 77, 465, 957, 1085, 1359, 3959, 15823, 6273, 12565, 126167}}, {10082, 17, 37015, {1, 1, 5, 5, 31, 53, 23, 173, 407, 795, 41, 3275, 1953, 13673, 26625, 33477, 14149}}, {10083, 17, 37019, {1, 1, 7, 7, 1, 11, 121, 139, 77, 321, 1939, 2597, 621, 9579, 11629, 13119, 30505}}, {10084, 17, 37035, {1, 1, 1, 5, 3, 33, 45, 127, 169, 581, 1521, 1019, 6489, 1069, 2469, 40255, 66619}}, {10085, 17, 37040, {1, 3, 7, 5, 29, 47, 7, 245, 459, 417, 1027, 857, 4905, 11255, 3267, 9491, 78013}}, {10086, 17, 37063, {1, 3, 5, 9, 25, 49, 61, 215, 19, 731, 303, 1001, 6031, 3705, 7797, 31957, 119383}}, {10087, 17, 37064, {1, 3, 5, 5, 1, 9, 37, 187, 235, 453, 963, 2833, 3501, 605, 2763, 41215, 93547}}, {10088, 17, 37069, {1, 3, 1, 1, 21, 3, 41, 53, 425, 687, 1051, 2365, 7835, 3981, 5557, 61993, 127417}}, {10089, 17, 37077, {1, 3, 3, 7, 13, 61, 41, 189, 261, 163, 1931, 1803, 2379, 16379, 25453, 17911, 123431}}, {10090, 17, 37093, {1, 1, 7, 15, 23, 21, 95, 7, 27, 897, 721, 3917, 7971, 4643, 5223, 46583, 32453}}, {10091, 17, 37097, {1, 1, 7, 7, 1, 25, 83, 109, 223, 573, 533, 449, 6477, 10719, 28705, 8283, 94963}}, {10092, 17, 37106, {1, 1, 5, 13, 21, 45, 63, 31, 21, 223, 31, 1249, 425, 7199, 11539, 7731, 44333}}, {10093, 17, 37115, {1, 1, 5, 15, 29, 5, 87, 215, 287, 567, 297, 451, 5867, 15511, 1005, 57469, 87257}}, {10094, 17, 37118, {1, 3, 5, 11, 13, 51, 117, 139, 377, 1015, 1237, 2053, 7625, 1003, 22673, 64345, 16203}}, {10095, 17, 37123, {1, 1, 3, 15, 19, 39, 73, 205, 185, 331, 869, 857, 5043, 7247, 25253, 5799, 64857}}, {10096, 17, 37129, {1, 3, 7, 1, 25, 63, 125, 47, 161, 289, 373, 1603, 1663, 1123, 28907, 37855, 47935}}, {10097, 17, 37130, {1, 1, 7, 15, 9, 17, 97, 63, 79, 123, 1357, 3055, 2323, 16083, 21861, 38743, 81291}}, {10098, 17, 37135, {1, 1, 3, 15, 5, 23, 7, 159, 127, 511, 55, 2691, 6823, 16151, 8059, 43021, 18911}}, {10099, 17, 37137, {1, 1, 3, 9, 27, 19, 41, 75, 375, 921, 1745, 35, 1189, 5857, 29869, 43827, 16899}}, {10100, 17, 37138, {1, 1, 1, 5, 3, 21, 13, 235, 51, 529, 291, 2619, 5419, 12573, 10907, 8865, 54987}}, {10101, 17, 37140, {1, 3, 1, 13, 7, 9, 85, 131, 159, 743, 1671, 3001, 4559, 12343, 27563, 49941, 68447}}, {10102, 17, 37144, {1, 1, 7, 5, 17, 61, 99, 63, 199, 383, 485, 2569, 5329, 645, 18805, 20421, 101229}}, {10103, 17, 37149, {1, 1, 1, 15, 3, 59, 41, 247, 213, 843, 2003, 125, 7755, 4203, 20277, 47195, 48249}}, {10104, 17, 37156, {1, 1, 5, 15, 15, 17, 113, 101, 27, 811, 1791, 1777, 749, 14317, 17267, 54467, 118369}}, {10105, 17, 37159, {1, 3, 3, 3, 19, 37, 23, 117, 275, 733, 1259, 567, 1769, 12071, 5413, 49411, 99259}}, {10106, 17, 37163, {1, 3, 1, 11, 3, 27, 103, 113, 251, 731, 481, 2771, 3205, 14151, 19403, 30307, 114691}}, {10107, 17, 37165, {1, 1, 5, 15, 19, 15, 103, 25, 357, 197, 1437, 3621, 4747, 773, 5769, 33465, 28307}}, {10108, 17, 37183, {1, 1, 5, 15, 5, 17, 89, 87, 423, 611, 549, 2549, 1275, 14545, 2931, 3853, 24577}}, {10109, 17, 37185, {1, 3, 5, 1, 15, 13, 29, 49, 279, 495, 697, 1015, 4899, 15977, 10765, 47979, 40237}}, {10110, 17, 37195, {1, 3, 3, 9, 31, 51, 21, 5, 279, 947, 1871, 3075, 5433, 1631, 30075, 30517, 99609}}, {10111, 17, 37198, {1, 1, 1, 15, 19, 63, 79, 81, 19, 629, 617, 1887, 4015, 15501, 10551, 56419, 108739}}, {10112, 17, 37203, {1, 1, 3, 9, 31, 15, 45, 37, 43, 349, 1357, 189, 4551, 9363, 15683, 48445, 89279}}, {10113, 17, 37212, {1, 1, 1, 1, 17, 19, 121, 119, 397, 947, 1797, 613, 1627, 9591, 15779, 62295, 118843}}, {10114, 17, 37233, {1, 1, 1, 7, 25, 55, 71, 227, 507, 497, 1209, 2919, 5733, 15785, 21437, 40043, 2325}}, {10115, 17, 37236, {1, 1, 1, 15, 11, 1, 59, 93, 69, 859, 67, 1831, 6345, 5643, 29515, 20337, 77281}}, {10116, 17, 37240, {1, 3, 5, 9, 19, 53, 59, 63, 161, 853, 697, 1441, 3457, 951, 29659, 15337, 38443}}, {10117, 17, 37256, {1, 3, 1, 9, 7, 21, 73, 81, 89, 291, 411, 3793, 4639, 2829, 6855, 38113, 32875}}, {10118, 17, 37264, {1, 1, 7, 1, 15, 3, 79, 35, 363, 459, 907, 1157, 5165, 8021, 10135, 36367, 111991}}, {10119, 17, 37267, {1, 3, 5, 13, 21, 23, 63, 155, 393, 869, 1553, 3345, 2711, 8249, 24907, 28111, 36667}}, {10120, 17, 37273, {1, 1, 7, 11, 15, 25, 29, 93, 45, 637, 1473, 2053, 313, 8047, 23411, 8643, 2925}}, {10121, 17, 37295, {1, 3, 7, 9, 11, 5, 73, 69, 311, 949, 2017, 259, 2861, 10547, 12017, 34125, 74101}}, {10122, 17, 37315, {1, 3, 1, 13, 19, 61, 115, 59, 447, 787, 1621, 2221, 7841, 5329, 18137, 13857, 51889}}, {10123, 17, 37330, {1, 3, 7, 13, 1, 23, 117, 49, 449, 541, 7, 3269, 1725, 6677, 15979, 4319, 40919}}, {10124, 17, 37336, {1, 3, 5, 5, 17, 29, 35, 123, 3, 481, 305, 1589, 4319, 5183, 31907, 53019, 49375}}, {10125, 17, 37339, {1, 3, 1, 7, 11, 59, 79, 89, 479, 821, 763, 3597, 7457, 13775, 11213, 22777, 80379}}, {10126, 17, 37342, {1, 1, 3, 7, 13, 17, 65, 155, 335, 671, 331, 895, 7459, 1719, 10675, 60109, 63143}}, {10127, 17, 37357, {1, 3, 5, 1, 29, 33, 105, 249, 61, 469, 1629, 3777, 4393, 14457, 11701, 6065, 2635}}, {10128, 17, 37365, {1, 3, 7, 3, 13, 13, 21, 15, 363, 63, 1263, 1479, 1459, 6577, 7481, 30393, 19831}}, {10129, 17, 37372, {1, 1, 3, 7, 29, 25, 71, 247, 501, 815, 1697, 2457, 4975, 3821, 25759, 24901, 120603}}, {10130, 17, 37381, {1, 1, 1, 5, 19, 3, 59, 163, 367, 779, 47, 905, 897, 3293, 13951, 25497, 99151}}, {10131, 17, 37399, {1, 3, 1, 5, 11, 47, 21, 171, 123, 215, 1797, 3741, 4921, 7213, 4847, 3239, 114839}}, {10132, 17, 37416, {1, 3, 3, 5, 23, 63, 57, 31, 409, 431, 1337, 3301, 4695, 7401, 9383, 12639, 34347}}, {10133, 17, 37429, {1, 3, 3, 5, 27, 57, 29, 147, 111, 1015, 815, 1509, 3967, 7255, 15109, 26001, 90775}}, {10134, 17, 37436, {1, 1, 7, 13, 31, 45, 21, 99, 377, 399, 255, 459, 6043, 11055, 5675, 3333, 32813}}, {10135, 17, 37442, {1, 3, 1, 7, 1, 55, 121, 77, 429, 433, 297, 3181, 3029, 6777, 22795, 61515, 58553}}, {10136, 17, 37451, {1, 3, 5, 9, 1, 19, 121, 1, 499, 589, 1597, 2219, 1029, 4223, 31613, 45685, 53517}}, {10137, 17, 37453, {1, 3, 1, 9, 29, 39, 83, 193, 43, 41, 467, 1711, 2761, 10635, 15503, 38043, 120615}}, {10138, 17, 37475, {1, 1, 7, 13, 27, 61, 1, 181, 163, 613, 221, 63, 6147, 8215, 15093, 2417, 71489}}, {10139, 17, 37482, {1, 1, 7, 15, 31, 63, 47, 139, 427, 847, 53, 1275, 1019, 9455, 12537, 22467, 129947}}, {10140, 17, 37489, {1, 1, 5, 3, 7, 1, 67, 189, 501, 319, 37, 2849, 2535, 10917, 11115, 48083, 67255}}, {10141, 17, 37490, {1, 1, 3, 13, 7, 31, 69, 137, 19, 73, 1553, 3945, 2381, 8761, 3977, 24291, 128189}}, {10142, 17, 37523, {1, 3, 5, 11, 1, 59, 43, 229, 301, 771, 559, 195, 1675, 12605, 22211, 2915, 90351}}, {10143, 17, 37525, {1, 3, 3, 9, 13, 27, 97, 33, 273, 229, 1537, 1179, 6985, 11679, 17889, 44673, 126641}}, {10144, 17, 37530, {1, 1, 7, 3, 31, 29, 41, 123, 491, 639, 269, 45, 2155, 14103, 6725, 50781, 42785}}, {10145, 17, 37535, {1, 3, 5, 9, 9, 11, 89, 249, 475, 701, 1029, 985, 8167, 439, 31897, 24529, 45759}}, {10146, 17, 37539, {1, 1, 5, 11, 9, 39, 127, 179, 15, 135, 1437, 3331, 5553, 939, 15319, 64937, 110783}}, {10147, 17, 37548, {1, 3, 1, 5, 7, 61, 1, 219, 111, 801, 85, 3427, 2533, 12861, 5395, 28969, 48091}}, {10148, 17, 37559, {1, 1, 1, 9, 23, 57, 77, 41, 61, 635, 457, 231, 8121, 5349, 27021, 64807, 87563}}, {10149, 17, 37560, {1, 3, 5, 7, 31, 31, 101, 155, 255, 199, 1973, 903, 7681, 15379, 12845, 47943, 60663}}, {10150, 17, 37566, {1, 1, 5, 7, 1, 7, 71, 121, 323, 669, 193, 1209, 267, 9, 21223, 22037, 121567}}, {10151, 17, 37597, {1, 3, 1, 5, 17, 29, 97, 189, 219, 813, 187, 1763, 5817, 13185, 467, 40159, 18037}}, {10152, 17, 37601, {1, 1, 7, 9, 7, 59, 3, 189, 379, 843, 631, 3945, 2909, 4191, 30343, 11223, 105629}}, {10153, 17, 37602, {1, 3, 1, 3, 15, 17, 23, 73, 439, 699, 657, 451, 6139, 15869, 4101, 32327, 55485}}, {10154, 17, 37604, {1, 3, 3, 5, 21, 37, 87, 157, 205, 493, 705, 1539, 2193, 13539, 2797, 49063, 55595}}, {10155, 17, 37616, {1, 1, 5, 11, 11, 41, 5, 131, 445, 781, 1153, 1371, 6763, 3101, 32449, 16065, 86579}}, {10156, 17, 37622, {1, 3, 5, 1, 23, 51, 97, 87, 161, 261, 269, 2035, 2139, 3049, 32217, 25189, 93571}}, {10157, 17, 37658, {1, 3, 1, 11, 23, 1, 111, 45, 19, 19, 1767, 3571, 6027, 3593, 17453, 53821, 28121}}, {10158, 17, 37660, {1, 3, 3, 5, 17, 5, 17, 247, 5, 73, 29, 443, 7713, 15803, 22311, 56755, 100119}}, {10159, 17, 37667, {1, 3, 1, 13, 7, 1, 41, 139, 317, 977, 1529, 1217, 529, 3231, 21491, 28461, 96699}}, {10160, 17, 37684, {1, 3, 1, 13, 11, 41, 103, 99, 81, 849, 231, 1729, 761, 711, 11499, 25581, 59433}}, {10161, 17, 37693, {1, 1, 5, 5, 13, 33, 79, 175, 89, 29, 295, 2867, 1197, 6137, 32063, 23471, 21721}}, {10162, 17, 37694, {1, 1, 5, 15, 17, 29, 123, 249, 273, 437, 443, 2601, 3957, 11955, 261, 54863, 85727}}, {10163, 17, 37696, {1, 1, 5, 13, 3, 31, 57, 205, 3, 903, 905, 3851, 757, 13761, 28615, 48185, 33227}}, {10164, 17, 37706, {1, 3, 7, 1, 1, 1, 107, 15, 307, 405, 45, 297, 4365, 1569, 9263, 13685, 36027}}, {10165, 17, 37711, {1, 3, 1, 9, 17, 61, 113, 121, 249, 743, 191, 2523, 6621, 5395, 23797, 57975, 51675}}, {10166, 17, 37730, {1, 3, 5, 3, 27, 21, 49, 113, 59, 989, 501, 2651, 3827, 5121, 29667, 32903, 84199}}, {10167, 17, 37735, {1, 1, 7, 7, 19, 43, 11, 191, 143, 93, 1167, 2521, 2569, 12187, 28575, 13073, 113545}}, {10168, 17, 37742, {1, 1, 7, 3, 27, 39, 11, 85, 61, 979, 49, 2191, 2607, 13967, 28123, 48903, 16327}}, {10169, 17, 37744, {1, 1, 5, 3, 17, 17, 1, 149, 189, 1017, 705, 3119, 6441, 1595, 30533, 18795, 34265}}, {10170, 17, 37759, {1, 1, 3, 11, 31, 11, 125, 109, 39, 41, 191, 2615, 1377, 16089, 8793, 31425, 90507}}, {10171, 17, 37777, {1, 1, 1, 1, 23, 15, 21, 245, 337, 649, 585, 2893, 927, 883, 15119, 2595, 127963}}, {10172, 17, 37783, {1, 3, 5, 3, 13, 17, 123, 167, 471, 5, 1671, 2787, 5081, 12903, 4257, 19213, 2503}}, {10173, 17, 37784, {1, 1, 5, 7, 21, 57, 75, 171, 509, 591, 85, 407, 1747, 6375, 19641, 55683, 111289}}, {10174, 17, 37793, {1, 1, 7, 7, 3, 31, 121, 111, 19, 361, 1033, 4033, 2359, 13451, 15095, 61817, 69683}}, {10175, 17, 37800, {1, 1, 5, 9, 21, 33, 83, 179, 387, 69, 1085, 2147, 2751, 10899, 16971, 40623, 110891}}, {10176, 17, 37818, {1, 1, 7, 9, 11, 45, 81, 71, 73, 551, 145, 159, 7519, 3459, 5197, 48913, 59045}}, {10177, 17, 37823, {1, 3, 1, 3, 7, 35, 17, 249, 207, 767, 1189, 1451, 4351, 3673, 28807, 671, 69271}}, {10178, 17, 37825, {1, 3, 1, 15, 21, 27, 81, 243, 55, 191, 1497, 3205, 1601, 705, 14891, 14403, 130729}}, {10179, 17, 37828, {1, 3, 1, 7, 17, 43, 41, 123, 507, 201, 1873, 3547, 5681, 1819, 4251, 39661, 57923}}, {10180, 17, 37832, {1, 3, 1, 9, 3, 59, 57, 235, 445, 479, 961, 1937, 2229, 2511, 15235, 59707, 72261}}, {10181, 17, 37849, {1, 1, 5, 13, 9, 63, 67, 217, 63, 259, 175, 2469, 3075, 12365, 7727, 42215, 12635}}, {10182, 17, 37856, {1, 1, 3, 13, 11, 9, 125, 131, 17, 399, 675, 767, 7349, 10433, 21615, 46823, 3955}}, {10183, 17, 37861, {1, 1, 3, 15, 19, 53, 73, 171, 125, 531, 1093, 1449, 2931, 10897, 12263, 9799, 98251}}, {10184, 17, 37862, {1, 1, 5, 5, 11, 27, 33, 9, 503, 545, 339, 1099, 1973, 13261, 26871, 14569, 22755}}, {10185, 17, 37886, {1, 3, 7, 1, 19, 5, 79, 133, 247, 1021, 1431, 3707, 4603, 3285, 5469, 46963, 98203}}, {10186, 17, 37893, {1, 3, 5, 7, 15, 11, 87, 169, 495, 763, 1295, 2533, 4213, 8671, 21683, 12521, 90071}}, {10187, 17, 37915, {1, 1, 3, 1, 17, 55, 7, 165, 313, 659, 49, 377, 6675, 15255, 9881, 11751, 87789}}, {10188, 17, 37922, {1, 3, 1, 15, 3, 49, 27, 109, 145, 1011, 1939, 3201, 6141, 7229, 20741, 59285, 129365}}, {10189, 17, 37936, {1, 1, 5, 5, 5, 51, 117, 17, 363, 795, 1343, 2637, 6209, 1045, 22515, 10687, 48487}}, {10190, 17, 37939, {1, 1, 5, 15, 1, 37, 91, 241, 245, 703, 505, 3369, 6163, 10265, 12497, 46301, 109523}}, {10191, 17, 37945, {1, 1, 7, 11, 3, 37, 67, 35, 229, 823, 193, 913, 3331, 4475, 9271, 11859, 52709}}, {10192, 17, 37956, {1, 1, 3, 3, 7, 25, 61, 159, 81, 1011, 1491, 1439, 1031, 765, 9839, 61891, 20969}}, {10193, 17, 37960, {1, 3, 3, 7, 25, 39, 73, 59, 101, 101, 225, 1105, 5943, 5223, 12585, 16411, 62699}}, {10194, 17, 37971, {1, 1, 7, 5, 25, 19, 27, 113, 465, 319, 2035, 2127, 1319, 11793, 26821, 44805, 28217}}, {10195, 17, 37980, {1, 3, 5, 11, 7, 9, 81, 107, 67, 31, 1503, 3303, 4451, 11417, 32681, 26861, 54845}}, {10196, 17, 38002, {1, 3, 1, 1, 3, 51, 93, 235, 93, 247, 2027, 1517, 6797, 1703, 10233, 45313, 60771}}, {10197, 17, 38007, {1, 3, 3, 15, 25, 11, 83, 77, 413, 189, 119, 597, 2199, 12347, 7935, 40191, 125569}}, {10198, 17, 38018, {1, 3, 7, 9, 11, 3, 77, 31, 89, 163, 1993, 3017, 3973, 10943, 22247, 45565, 7261}}, {10199, 17, 38020, {1, 3, 7, 7, 15, 13, 7, 155, 373, 893, 607, 3521, 7455, 13809, 6145, 31743, 86329}}, {10200, 17, 38038, {1, 1, 1, 15, 25, 41, 111, 65, 11, 627, 59, 2725, 995, 3761, 25361, 45189, 48355}}, {10201, 17, 38041, {1, 1, 7, 5, 29, 43, 91, 139, 323, 503, 679, 4079, 403, 1899, 1425, 26989, 117057}}, {10202, 17, 38044, {1, 3, 5, 13, 1, 17, 19, 61, 205, 833, 345, 1031, 7995, 999, 27469, 15943, 88011}}, {10203, 17, 38048, {1, 3, 1, 7, 23, 49, 123, 9, 11, 761, 1163, 669, 3837, 15225, 23393, 19513, 9457}}, {10204, 17, 38051, {1, 1, 5, 9, 9, 33, 29, 123, 277, 433, 1799, 1583, 3133, 13461, 26443, 15807, 80173}}, {10205, 17, 38054, {1, 3, 7, 3, 31, 29, 77, 105, 297, 617, 491, 647, 6541, 5033, 31841, 48405, 126985}}, {10206, 17, 38065, {1, 1, 5, 5, 31, 39, 17, 25, 3, 279, 89, 3985, 3333, 5681, 3701, 36319, 12585}}, {10207, 17, 38066, {1, 1, 7, 13, 13, 19, 93, 129, 51, 875, 1083, 1739, 5193, 6217, 10033, 51839, 66071}}, {10208, 17, 38077, {1, 1, 7, 9, 15, 23, 93, 121, 507, 115, 707, 3181, 1521, 9609, 4577, 54389, 19167}}, {10209, 17, 38090, {1, 3, 3, 7, 17, 51, 19, 29, 387, 711, 1105, 1627, 4421, 15183, 14149, 26485, 106425}}, {10210, 17, 38109, {1, 3, 3, 15, 25, 59, 11, 45, 259, 1019, 1997, 3373, 5083, 5701, 30217, 44845, 67559}}, {10211, 17, 38119, {1, 3, 3, 9, 17, 47, 5, 103, 477, 785, 235, 1523, 1505, 8811, 15255, 53493, 4383}}, {10212, 17, 38120, {1, 3, 7, 3, 7, 37, 73, 247, 397, 409, 1065, 525, 5665, 8533, 30627, 19035, 22937}}, {10213, 17, 38123, {1, 3, 3, 15, 15, 47, 123, 215, 413, 249, 55, 2563, 8033, 8743, 18659, 7947, 56057}}, {10214, 17, 38146, {1, 1, 7, 3, 11, 61, 103, 109, 313, 293, 149, 999, 901, 13387, 15351, 52973, 68385}}, {10215, 17, 38155, {1, 1, 1, 5, 31, 13, 57, 43, 263, 141, 335, 2777, 3435, 4231, 20623, 2597, 33481}}, {10216, 17, 38160, {1, 1, 7, 13, 21, 53, 101, 75, 237, 275, 1903, 3501, 8023, 3651, 19609, 44417, 60287}}, {10217, 17, 38181, {1, 1, 1, 1, 13, 43, 83, 255, 355, 567, 1781, 2943, 1061, 2701, 24861, 58381, 60255}}, {10218, 17, 38188, {1, 1, 3, 9, 25, 5, 81, 85, 445, 857, 517, 3687, 2641, 6699, 19273, 4481, 8715}}, {10219, 17, 38199, {1, 1, 3, 7, 17, 39, 33, 31, 29, 269, 379, 3149, 4731, 10387, 7941, 49199, 18423}}, {10220, 17, 38203, {1, 1, 7, 15, 19, 37, 105, 157, 185, 1023, 1865, 53, 6765, 3, 22897, 17019, 109521}}, {10221, 17, 38225, {1, 3, 7, 5, 5, 7, 117, 211, 19, 149, 1091, 3721, 201, 4455, 18965, 51401, 67225}}, {10222, 17, 38226, {1, 3, 5, 11, 1, 55, 101, 41, 469, 271, 1251, 949, 861, 11903, 14773, 25675, 114161}}, {10223, 17, 38231, {1, 1, 7, 7, 23, 13, 103, 185, 137, 575, 797, 1195, 5301, 13307, 12043, 26003, 31719}}, {10224, 17, 38244, {1, 1, 5, 7, 11, 51, 17, 71, 321, 559, 1461, 3571, 1033, 15575, 7097, 14703, 52359}}, {10225, 17, 38248, {1, 1, 1, 5, 21, 9, 123, 211, 233, 81, 111, 1433, 7825, 11771, 30743, 23993, 48717}}, {10226, 17, 38259, {1, 3, 5, 15, 7, 3, 109, 33, 99, 135, 393, 3463, 7271, 14387, 30723, 19079, 83073}}, {10227, 17, 38268, {1, 3, 3, 15, 3, 51, 77, 219, 409, 11, 67, 3787, 5155, 9259, 7185, 21611, 32577}}, {10228, 17, 38271, {1, 3, 7, 1, 5, 49, 125, 85, 151, 301, 887, 1765, 5, 12849, 11775, 11319, 29547}}, {10229, 17, 38272, {1, 1, 7, 11, 17, 15, 105, 29, 327, 637, 1493, 3361, 1823, 14709, 18355, 741, 57807}}, {10230, 17, 38278, {1, 1, 7, 7, 3, 27, 15, 113, 227, 617, 1543, 1719, 8065, 13627, 23525, 20511, 64759}}, {10231, 17, 38292, {1, 1, 3, 3, 21, 47, 89, 177, 381, 711, 1367, 2405, 887, 2351, 22957, 49679, 5963}}, {10232, 17, 38296, {1, 3, 7, 9, 7, 1, 39, 71, 9, 275, 875, 1385, 6215, 10419, 25921, 63427, 18031}}, {10233, 17, 38318, {1, 1, 7, 5, 23, 57, 27, 7, 445, 111, 953, 37, 2769, 1967, 8165, 35417, 36471}}, {10234, 17, 38326, {1, 3, 3, 11, 23, 17, 119, 113, 275, 625, 1957, 2795, 3815, 7937, 11049, 31939, 128053}}, {10235, 17, 38338, {1, 3, 3, 5, 7, 35, 45, 41, 251, 491, 1953, 3201, 751, 5705, 595, 27003, 77917}}, {10236, 17, 38347, {1, 3, 5, 3, 25, 17, 55, 137, 299, 541, 289, 2225, 4667, 3569, 13687, 36193, 75705}}, {10237, 17, 38373, {1, 1, 7, 15, 21, 9, 27, 157, 469, 441, 193, 2097, 4863, 2147, 31197, 24283, 102039}}, {10238, 17, 38378, {1, 1, 1, 11, 17, 39, 73, 37, 91, 121, 1283, 367, 1875, 14365, 28349, 60993, 10791}}, {10239, 17, 38380, {1, 3, 5, 9, 13, 63, 89, 53, 459, 347, 343, 2321, 5237, 2497, 279, 63833, 10709}}, {10240, 17, 38388, {1, 1, 1, 15, 11, 23, 41, 79, 45, 567, 1217, 1669, 1679, 2561, 16191, 49041, 4081}}, {10241, 17, 38392, {1, 3, 1, 5, 3, 9, 103, 245, 47, 561, 229, 2945, 6563, 797, 21571, 25769, 12995}}, {10242, 17, 38397, {1, 3, 5, 7, 5, 47, 99, 55, 49, 951, 765, 2095, 8021, 4389, 20501, 26047, 119967}}, {10243, 17, 38398, {1, 1, 5, 3, 15, 47, 81, 121, 379, 527, 419, 1093, 367, 10939, 17181, 13905, 49859}}, {10244, 17, 38401, {1, 3, 3, 5, 7, 59, 53, 255, 131, 685, 1677, 3757, 3601, 89, 6225, 32705, 28287}}, {10245, 17, 38404, {1, 3, 7, 1, 7, 55, 85, 47, 425, 793, 605, 2313, 791, 4247, 9693, 10633, 82915}}, {10246, 17, 38422, {1, 3, 5, 13, 13, 49, 127, 213, 27, 657, 419, 55, 6289, 295, 4211, 8899, 120237}}, {10247, 17, 38432, {1, 1, 7, 11, 11, 7, 75, 35, 315, 125, 517, 3677, 2323, 6897, 11535, 36789, 20179}}, {10248, 17, 38469, {1, 1, 5, 9, 11, 3, 77, 43, 323, 647, 383, 485, 3937, 9081, 27745, 59149, 103433}}, {10249, 17, 38482, {1, 3, 3, 13, 3, 47, 91, 81, 115, 625, 2003, 3601, 531, 113, 20719, 47391, 111039}}, {10250, 17, 38493, {1, 1, 3, 13, 5, 49, 123, 189, 109, 325, 497, 923, 3861, 14029, 22651, 19857, 104801}}, {10251, 17, 38507, {1, 1, 5, 3, 29, 23, 25, 23, 501, 371, 1983, 1303, 2261, 11865, 13281, 2587, 75741}}, {10252, 17, 38518, {1, 3, 5, 13, 27, 61, 45, 11, 157, 615, 897, 1529, 2213, 757, 30105, 2011, 27267}}, {10253, 17, 38521, {1, 3, 5, 13, 29, 31, 95, 159, 449, 307, 1575, 1897, 2301, 14023, 6921, 30543, 31843}}, {10254, 17, 38527, {1, 3, 3, 5, 1, 1, 79, 147, 437, 623, 1161, 3407, 3073, 15425, 4329, 19651, 90597}}, {10255, 17, 38533, {1, 1, 1, 11, 17, 7, 43, 171, 447, 841, 573, 3775, 5517, 3629, 18241, 31907, 51423}}, {10256, 17, 38534, {1, 1, 3, 7, 15, 53, 111, 203, 171, 963, 1983, 2017, 6067, 12281, 3417, 7431, 33803}}, {10257, 17, 38552, {1, 3, 1, 1, 31, 49, 125, 65, 7, 579, 1709, 1815, 2643, 11537, 30093, 11813, 65157}}, {10258, 17, 38561, {1, 3, 7, 15, 1, 3, 61, 21, 163, 809, 1263, 2577, 7811, 12611, 6921, 18529, 25709}}, {10259, 17, 38576, {1, 1, 3, 5, 17, 43, 13, 81, 29, 905, 1975, 589, 5875, 15683, 29447, 46453, 127911}}, {10260, 17, 38581, {1, 1, 5, 3, 19, 29, 11, 67, 375, 771, 755, 3939, 1465, 3275, 1119, 24695, 105105}}, {10261, 17, 38585, {1, 1, 3, 11, 23, 37, 33, 135, 329, 733, 245, 2353, 2547, 7823, 16265, 5975, 37877}}, {10262, 17, 38594, {1, 3, 7, 13, 15, 9, 47, 181, 239, 723, 1219, 409, 1685, 5493, 14189, 18107, 26231}}, {10263, 17, 38606, {1, 1, 5, 1, 9, 1, 65, 125, 439, 591, 1499, 3797, 5879, 4231, 18655, 9643, 42265}}, {10264, 17, 38613, {1, 1, 7, 7, 11, 51, 111, 47, 169, 39, 45, 2211, 6729, 10987, 22367, 27257, 112711}}, {10265, 17, 38617, {1, 3, 5, 3, 19, 61, 89, 185, 23, 793, 1457, 1743, 3743, 15063, 14053, 50201, 109175}}, {10266, 17, 38634, {1, 1, 5, 13, 31, 51, 69, 135, 427, 527, 1673, 2393, 5829, 683, 1509, 56617, 105735}}, {10267, 17, 38644, {1, 1, 1, 15, 31, 51, 3, 105, 125, 593, 1589, 3217, 7449, 525, 30599, 11689, 14781}}, {10268, 17, 38651, {1, 1, 1, 11, 9, 37, 113, 45, 487, 961, 87, 1461, 3521, 8645, 19771, 43817, 43277}}, {10269, 17, 38661, {1, 1, 7, 3, 7, 11, 45, 97, 11, 593, 319, 2597, 37, 4157, 6669, 29929, 17213}}, {10270, 17, 38665, {1, 3, 7, 3, 29, 21, 101, 93, 289, 975, 1937, 3423, 757, 7075, 12575, 26801, 90989}}, {10271, 17, 38668, {1, 1, 7, 15, 25, 49, 49, 149, 503, 365, 1359, 2155, 7977, 14955, 18439, 44269, 88995}}, {10272, 17, 38674, {1, 3, 7, 13, 25, 27, 15, 67, 157, 873, 339, 2143, 1405, 12209, 30939, 36109, 107699}}, {10273, 17, 38689, {1, 3, 5, 5, 21, 33, 121, 95, 61, 159, 1423, 2899, 3811, 263, 9139, 54481, 107375}}, {10274, 17, 38695, {1, 1, 7, 7, 13, 49, 83, 53, 267, 131, 673, 3945, 5255, 2009, 21017, 41749, 44817}}, {10275, 17, 38696, {1, 3, 1, 13, 25, 57, 125, 5, 323, 653, 221, 2013, 7225, 8719, 28049, 41953, 14725}}, {10276, 17, 38707, {1, 3, 7, 7, 5, 13, 35, 161, 221, 951, 769, 717, 267, 2233, 23387, 47411, 95739}}, {10277, 17, 38710, {1, 3, 7, 11, 23, 47, 37, 67, 501, 159, 763, 4045, 5125, 5667, 9895, 33041, 101171}}, {10278, 17, 38716, {1, 1, 7, 1, 31, 31, 111, 183, 33, 895, 1819, 3593, 1285, 10145, 3679, 36615, 82863}}, {10279, 17, 38733, {1, 3, 5, 7, 21, 59, 55, 163, 139, 855, 1903, 3229, 3745, 10289, 28831, 46895, 12647}}, {10280, 17, 38736, {1, 3, 7, 9, 25, 31, 113, 177, 459, 201, 565, 2089, 725, 9273, 26249, 5987, 49573}}, {10281, 17, 38742, {1, 1, 7, 15, 3, 37, 49, 145, 121, 803, 1197, 2797, 21, 833, 2277, 28189, 93171}}, {10282, 17, 38751, {1, 1, 7, 7, 13, 31, 93, 153, 345, 363, 1825, 1481, 3347, 13277, 26119, 63153, 118231}}, {10283, 17, 38752, {1, 3, 1, 11, 31, 9, 33, 95, 433, 595, 1131, 465, 1797, 15453, 32527, 40789, 37799}}, {10284, 17, 38775, {1, 1, 5, 11, 31, 29, 83, 33, 243, 633, 1325, 3843, 7717, 851, 29789, 48827, 89209}}, {10285, 17, 38779, {1, 1, 3, 7, 25, 31, 127, 219, 281, 51, 1843, 3363, 5985, 1697, 3083, 18967, 117421}}, {10286, 17, 38792, {1, 3, 7, 9, 1, 19, 125, 199, 41, 117, 903, 1131, 7731, 14431, 24753, 62841, 50251}}, {10287, 17, 38798, {1, 3, 5, 5, 11, 37, 19, 249, 97, 59, 1849, 1151, 2171, 1217, 31277, 26547, 86601}}, {10288, 17, 38819, {1, 3, 3, 7, 29, 35, 21, 7, 93, 971, 1155, 1847, 89, 6759, 29611, 40793, 88327}}, {10289, 17, 38822, {1, 3, 5, 5, 29, 23, 91, 71, 479, 943, 1839, 3699, 2491, 9603, 15061, 43221, 20435}}, {10290, 17, 38839, {1, 3, 3, 7, 29, 11, 15, 83, 21, 585, 501, 161, 4797, 11243, 14879, 12519, 19069}}, {10291, 17, 38851, {1, 1, 5, 15, 13, 37, 9, 215, 433, 925, 987, 3253, 8027, 7013, 20801, 12891, 36497}}, {10292, 17, 38854, {1, 3, 7, 1, 15, 31, 95, 85, 355, 1013, 1963, 2943, 1925, 13691, 15237, 28943, 63873}}, {10293, 17, 38863, {1, 3, 3, 1, 17, 21, 99, 201, 465, 819, 665, 901, 2671, 2457, 29603, 35275, 28339}}, {10294, 17, 38865, {1, 1, 1, 9, 5, 23, 111, 107, 27, 433, 1341, 91, 6879, 1933, 25433, 37435, 99061}}, {10295, 17, 38887, {1, 3, 5, 13, 11, 55, 27, 151, 397, 591, 89, 1221, 5581, 2701, 15033, 41879, 71415}}, {10296, 17, 38896, {1, 3, 3, 5, 17, 35, 15, 119, 487, 903, 875, 3391, 7731, 12181, 27823, 32561, 59133}}, {10297, 17, 38901, {1, 1, 5, 7, 15, 33, 67, 53, 307, 947, 857, 2713, 803, 765, 4175, 15513, 23985}}, {10298, 17, 38912, {1, 3, 1, 15, 23, 11, 15, 101, 467, 429, 153, 3205, 5627, 7555, 22515, 12721, 7905}}, {10299, 17, 38918, {1, 1, 3, 7, 19, 61, 55, 187, 413, 49, 1031, 3415, 3903, 6933, 20017, 50429, 116407}}, {10300, 17, 38929, {1, 3, 1, 13, 13, 15, 33, 1, 403, 441, 1969, 775, 2209, 15061, 15657, 28819, 62705}}, {10301, 17, 38941, {1, 1, 5, 13, 13, 47, 67, 97, 87, 677, 1639, 3281, 1395, 8499, 18449, 49935, 25775}}, {10302, 17, 38948, {1, 3, 3, 13, 7, 13, 77, 45, 405, 881, 293, 2263, 6517, 15415, 25809, 5681, 31327}}, {10303, 17, 38965, {1, 3, 7, 5, 5, 51, 63, 171, 401, 671, 1631, 1735, 7361, 8741, 31933, 44761, 12209}}, {10304, 17, 38969, {1, 1, 7, 3, 13, 3, 39, 223, 105, 781, 241, 2895, 5165, 12135, 5683, 63009, 58399}}, {10305, 17, 38977, {1, 1, 5, 11, 29, 11, 37, 1, 445, 157, 219, 2269, 3025, 5721, 24539, 41879, 128445}}, {10306, 17, 38987, {1, 3, 7, 15, 23, 21, 125, 105, 141, 101, 1981, 3765, 5349, 13781, 10055, 7069, 77721}}, {10307, 17, 38992, {1, 1, 7, 9, 3, 37, 111, 95, 33, 53, 1021, 1629, 6945, 4657, 19977, 36715, 101401}}, {10308, 17, 38995, {1, 3, 3, 1, 9, 5, 65, 77, 459, 471, 1045, 2351, 2787, 13001, 16211, 22585, 116205}}, {10309, 17, 39001, {1, 1, 7, 9, 25, 41, 21, 187, 471, 997, 583, 2243, 6537, 11837, 21089, 51051, 98517}}, {10310, 17, 39004, {1, 1, 7, 5, 13, 15, 81, 39, 223, 935, 951, 5, 4315, 11789, 18365, 49647, 92461}}, {10311, 17, 39011, {1, 3, 3, 5, 11, 15, 97, 245, 43, 819, 1415, 3287, 2051, 15879, 21727, 54467, 53875}}, {10312, 17, 39018, {1, 3, 1, 11, 7, 47, 125, 155, 301, 469, 805, 3789, 6967, 12117, 30369, 55183, 12671}}, {10313, 17, 39025, {1, 1, 3, 13, 17, 25, 45, 199, 69, 1015, 581, 3891, 7743, 9273, 7639, 59055, 93923}}, {10314, 17, 39031, {1, 1, 5, 11, 9, 47, 39, 251, 489, 47, 83, 2147, 943, 1959, 21361, 5325, 106079}}, {10315, 17, 39032, {1, 3, 5, 13, 27, 59, 35, 1, 155, 367, 165, 2665, 3021, 1127, 28585, 45347, 66763}}, {10316, 17, 39044, {1, 3, 1, 5, 31, 31, 15, 125, 485, 581, 1987, 2293, 4573, 11431, 20773, 58661, 79869}}, {10317, 17, 39056, {1, 3, 5, 15, 31, 11, 109, 229, 11, 831, 1545, 919, 6125, 9337, 4169, 58041, 67577}}, {10318, 17, 39065, {1, 1, 1, 3, 1, 43, 13, 89, 89, 863, 1607, 1897, 4831, 5239, 24503, 51853, 126983}}, {10319, 17, 39066, {1, 1, 5, 11, 11, 37, 11, 253, 495, 83, 941, 3665, 5187, 13679, 11811, 29563, 80571}}, {10320, 17, 39084, {1, 3, 7, 15, 3, 45, 45, 157, 477, 321, 1401, 1133, 271, 12455, 31543, 18223, 116701}}, {10321, 17, 39095, {1, 1, 5, 3, 7, 5, 17, 127, 195, 583, 715, 3975, 6865, 7617, 6749, 15687, 42375}}, {10322, 17, 39099, {1, 1, 1, 7, 5, 7, 21, 163, 303, 45, 1435, 1345, 2489, 15333, 18459, 60837, 104339}}, {10323, 17, 39101, {1, 3, 1, 1, 7, 23, 39, 93, 347, 947, 345, 1713, 6383, 15411, 10849, 32559, 126431}}, {10324, 17, 39102, {1, 3, 1, 5, 19, 41, 119, 213, 3, 991, 1745, 3989, 155, 7761, 28179, 59805, 106759}}, {10325, 17, 39104, {1, 1, 7, 5, 25, 11, 105, 89, 505, 711, 1213, 2831, 8087, 8855, 31171, 49749, 921}}, {10326, 17, 39109, {1, 1, 5, 5, 23, 61, 49, 101, 209, 805, 123, 17, 805, 9033, 25753, 33261, 33753}}, {10327, 17, 39114, {1, 1, 3, 5, 5, 17, 93, 223, 179, 307, 869, 1851, 4313, 477, 12925, 21365, 103999}}, {10328, 17, 39121, {1, 1, 7, 13, 21, 23, 105, 53, 393, 939, 291, 2407, 4815, 4961, 30305, 8613, 62599}}, {10329, 17, 39122, {1, 1, 1, 11, 9, 55, 55, 135, 411, 225, 205, 3357, 4553, 10139, 17649, 51209, 94037}}, {10330, 17, 39127, {1, 3, 5, 15, 17, 17, 119, 15, 121, 581, 169, 2495, 3673, 7173, 13099, 7683, 53397}}, {10331, 17, 39150, {1, 3, 1, 11, 29, 29, 119, 255, 447, 85, 845, 1015, 2793, 2471, 12639, 32155, 99193}}, {10332, 17, 39172, {1, 3, 3, 3, 9, 33, 77, 251, 425, 1007, 1003, 2697, 4989, 7799, 26581, 15963, 50443}}, {10333, 17, 39181, {1, 3, 1, 5, 13, 47, 13, 203, 473, 529, 147, 2061, 343, 4029, 14615, 51355, 27863}}, {10334, 17, 39184, {1, 1, 3, 15, 19, 63, 39, 25, 241, 487, 461, 3021, 3545, 4537, 8991, 17689, 77131}}, {10335, 17, 39193, {1, 3, 5, 5, 7, 1, 61, 89, 495, 943, 1061, 405, 449, 12785, 25151, 24497, 65709}}, {10336, 17, 39199, {1, 1, 5, 3, 7, 43, 51, 55, 193, 615, 37, 1377, 2541, 3861, 29447, 32269, 106335}}, {10337, 17, 39200, {1, 1, 5, 11, 21, 55, 103, 43, 421, 673, 175, 979, 5175, 1301, 8617, 55875, 111095}}, {10338, 17, 39206, {1, 3, 5, 13, 29, 31, 33, 241, 129, 473, 201, 2015, 447, 99, 23781, 33517, 107851}}, {10339, 17, 39209, {1, 3, 5, 3, 13, 27, 125, 205, 287, 957, 1609, 2907, 5481, 14239, 19719, 22459, 75365}}, {10340, 17, 39235, {1, 3, 3, 5, 27, 23, 53, 39, 329, 381, 745, 517, 7853, 5333, 2773, 29119, 7049}}, {10341, 17, 39238, {1, 3, 5, 15, 29, 11, 89, 3, 503, 755, 485, 2669, 6737, 16241, 7345, 50991, 107291}}, {10342, 17, 39242, {1, 1, 7, 3, 17, 45, 11, 3, 157, 715, 577, 1309, 3323, 9401, 10573, 55135, 100067}}, {10343, 17, 39244, {1, 1, 5, 9, 19, 21, 49, 103, 349, 503, 1447, 675, 4273, 7673, 27507, 57697, 80875}}, {10344, 17, 39280, {1, 1, 5, 1, 9, 53, 19, 99, 225, 915, 431, 781, 3291, 4383, 26505, 50339, 99799}}, {10345, 17, 39290, {1, 3, 1, 5, 7, 37, 87, 201, 481, 991, 1553, 1867, 7893, 13147, 18647, 10373, 51951}}, {10346, 17, 39292, {1, 1, 3, 13, 17, 37, 19, 199, 253, 901, 759, 3545, 3565, 10461, 11867, 57605, 75555}}, {10347, 17, 39296, {1, 1, 1, 5, 15, 23, 115, 69, 363, 673, 201, 2451, 3197, 10059, 1667, 47145, 89}}, {10348, 17, 39305, {1, 1, 7, 13, 19, 31, 63, 35, 93, 939, 1057, 3221, 951, 3575, 9659, 7005, 2087}}, {10349, 17, 39308, {1, 1, 7, 15, 15, 21, 79, 7, 23, 595, 1123, 1909, 6863, 7383, 28067, 30113, 107497}}, {10350, 17, 39311, {1, 3, 5, 7, 11, 47, 41, 177, 163, 855, 1853, 3837, 6995, 9727, 27285, 62667, 77531}}, {10351, 17, 39326, {1, 3, 7, 3, 3, 29, 99, 163, 95, 893, 1049, 2001, 2961, 601, 4613, 59745, 61203}}, {10352, 17, 39329, {1, 3, 5, 1, 27, 5, 5, 47, 119, 631, 1171, 3467, 2115, 8581, 24863, 64193, 52093}}, {10353, 17, 39330, {1, 1, 1, 5, 9, 51, 49, 251, 97, 177, 311, 993, 1103, 7875, 25273, 51587, 9081}}, {10354, 17, 39336, {1, 3, 7, 5, 31, 21, 43, 137, 143, 779, 691, 2331, 5073, 5409, 13335, 999, 127765}}, {10355, 17, 39339, {1, 1, 7, 1, 31, 33, 27, 193, 175, 755, 1559, 659, 5663, 10491, 29209, 50979, 116683}}, {10356, 17, 39353, {1, 3, 1, 7, 23, 49, 1, 39, 117, 45, 1767, 3503, 4901, 5699, 23613, 44195, 17867}}, {10357, 17, 39359, {1, 3, 7, 13, 3, 5, 105, 89, 343, 627, 1117, 3419, 2081, 5747, 7919, 44329, 125133}}, {10358, 17, 39374, {1, 3, 1, 9, 13, 33, 53, 203, 17, 927, 127, 2195, 415, 11301, 15115, 54467, 128777}}, {10359, 17, 39391, {1, 3, 7, 1, 9, 41, 15, 89, 403, 333, 57, 1159, 1325, 2335, 10609, 20485, 110317}}, {10360, 17, 39392, {1, 3, 3, 5, 3, 61, 25, 155, 477, 907, 359, 359, 5119, 8157, 29945, 38955, 106485}}, {10361, 17, 39402, {1, 1, 7, 5, 19, 47, 91, 89, 367, 703, 761, 431, 6813, 2983, 29739, 52453, 125935}}, {10362, 17, 39409, {1, 1, 1, 7, 7, 61, 127, 239, 277, 649, 1111, 2319, 1737, 5071, 13469, 52119, 48899}}, {10363, 17, 39410, {1, 3, 5, 15, 7, 17, 21, 209, 265, 895, 719, 263, 6871, 5835, 28483, 49859, 67619}}, {10364, 17, 39415, {1, 3, 3, 15, 3, 7, 113, 109, 333, 545, 597, 1193, 7593, 3961, 25169, 64673, 47839}}, {10365, 17, 39419, {1, 1, 1, 3, 15, 45, 55, 41, 317, 719, 1587, 2953, 2441, 1127, 9183, 21637, 69075}}, {10366, 17, 39431, {1, 3, 1, 9, 25, 57, 59, 29, 89, 833, 379, 1085, 763, 14747, 30797, 24089, 83367}}, {10367, 17, 39432, {1, 1, 5, 13, 29, 3, 117, 239, 453, 595, 243, 3103, 6047, 631, 22739, 41669, 11683}}, {10368, 17, 39438, {1, 1, 3, 1, 9, 53, 81, 21, 67, 735, 827, 3519, 7991, 16249, 4183, 61295, 4531}}, {10369, 17, 39443, {1, 3, 5, 3, 1, 57, 47, 99, 91, 71, 1421, 2949, 5951, 15439, 25239, 26453, 50199}}, {10370, 17, 39445, {1, 1, 3, 15, 21, 3, 93, 21, 41, 809, 855, 727, 7797, 6957, 15835, 27175, 60617}}, {10371, 17, 39449, {1, 1, 1, 13, 1, 3, 83, 135, 197, 171, 1459, 2841, 5021, 6961, 30675, 38295, 39555}}, {10372, 17, 39461, {1, 1, 7, 5, 7, 49, 83, 83, 117, 73, 639, 2717, 651, 3253, 31635, 14427, 116509}}, {10373, 17, 39462, {1, 3, 1, 3, 23, 63, 15, 23, 433, 539, 903, 2655, 1787, 12901, 12013, 41315, 128217}}, {10374, 17, 39485, {1, 3, 1, 7, 5, 19, 3, 137, 493, 681, 775, 3725, 4855, 10817, 25277, 3631, 60779}}, {10375, 17, 39508, {1, 3, 3, 5, 1, 7, 67, 39, 309, 77, 1679, 2853, 3803, 2065, 7461, 1555, 88219}}, {10376, 17, 39515, {1, 1, 3, 5, 3, 47, 17, 193, 429, 789, 1525, 969, 7905, 6523, 10149, 64689, 40037}}, {10377, 17, 39522, {1, 3, 5, 7, 21, 17, 65, 61, 255, 517, 1765, 2603, 4929, 11073, 7871, 29313, 84739}}, {10378, 17, 39533, {1, 1, 5, 7, 13, 55, 111, 63, 499, 9, 1715, 957, 6951, 15839, 13531, 45483, 17923}}, {10379, 17, 39541, {1, 1, 1, 1, 27, 7, 13, 135, 27, 259, 1735, 3847, 7931, 14777, 15249, 62367, 45773}}, {10380, 17, 39542, {1, 1, 5, 3, 5, 7, 99, 171, 491, 1007, 195, 2223, 2657, 13557, 6549, 47125, 25117}}, {10381, 17, 39557, {1, 1, 1, 9, 13, 21, 59, 205, 205, 951, 1707, 3387, 2901, 5463, 13403, 1917, 90591}}, {10382, 17, 39570, {1, 3, 3, 5, 21, 37, 71, 91, 297, 885, 1415, 355, 2877, 9261, 6485, 45855, 90081}}, {10383, 17, 39575, {1, 1, 5, 9, 23, 51, 107, 75, 93, 1015, 439, 3589, 3307, 337, 17247, 42285, 85417}}, {10384, 17, 39576, {1, 1, 7, 15, 29, 33, 51, 23, 269, 35, 1241, 1137, 729, 14531, 14603, 47547, 17151}}, {10385, 17, 39591, {1, 3, 3, 1, 25, 21, 51, 229, 55, 561, 653, 3289, 7629, 15445, 21115, 35941, 113669}}, {10386, 17, 39597, {1, 1, 5, 15, 1, 33, 119, 171, 75, 621, 2025, 3235, 1895, 8279, 13205, 61085, 105401}}, {10387, 17, 39603, {1, 3, 1, 7, 25, 33, 73, 25, 1, 531, 603, 77, 4939, 5957, 28065, 59467, 66659}}, {10388, 17, 39610, {1, 1, 7, 3, 17, 61, 103, 47, 289, 39, 917, 2515, 6607, 1129, 23361, 46321, 81929}}, {10389, 17, 39612, {1, 1, 7, 5, 29, 53, 5, 191, 151, 19, 895, 1215, 5401, 9861, 24751, 15481, 34179}}, {10390, 17, 39617, {1, 3, 7, 9, 5, 3, 29, 205, 173, 547, 727, 947, 5619, 4181, 30621, 5553, 37587}}, {10391, 17, 39620, {1, 1, 3, 9, 13, 59, 95, 145, 287, 849, 1483, 3375, 3531, 6585, 29565, 4243, 88333}}, {10392, 17, 39624, {1, 1, 7, 11, 21, 23, 59, 223, 71, 743, 443, 697, 7789, 10371, 28565, 45127, 37967}}, {10393, 17, 39627, {1, 3, 5, 11, 15, 25, 79, 71, 21, 817, 751, 189, 1769, 3835, 21465, 17991, 102043}}, {10394, 17, 39635, {1, 1, 7, 11, 3, 19, 25, 5, 261, 181, 49, 261, 7715, 2195, 19771, 43463, 36533}}, {10395, 17, 39641, {1, 1, 7, 13, 21, 21, 15, 235, 191, 197, 1305, 1351, 4511, 625, 6613, 37053, 59491}}, {10396, 17, 39666, {1, 1, 1, 13, 15, 13, 93, 239, 251, 1009, 527, 1347, 4173, 14753, 27389, 20397, 13101}}, {10397, 17, 39668, {1, 1, 3, 1, 15, 11, 127, 141, 277, 775, 1419, 2353, 6929, 2265, 7253, 19807, 74853}}, {10398, 17, 39686, {1, 3, 3, 15, 15, 49, 9, 183, 407, 377, 675, 871, 347, 3417, 4409, 7805, 40507}}, {10399, 17, 39692, {1, 3, 5, 3, 23, 11, 81, 53, 343, 681, 1777, 3411, 757, 10875, 3581, 56105, 79907}}, {10400, 17, 39700, {1, 3, 5, 1, 25, 9, 109, 55, 283, 311, 1607, 2479, 5675, 8819, 10853, 38719, 44471}}, {10401, 17, 39709, {1, 1, 7, 7, 9, 53, 33, 195, 503, 167, 993, 3203, 3885, 1921, 1039, 25785, 47411}}, {10402, 17, 39726, {1, 3, 3, 3, 31, 3, 11, 85, 475, 743, 1825, 2649, 2373, 12177, 21481, 35579, 85803}}, {10403, 17, 39728, {1, 3, 7, 3, 23, 45, 45, 207, 369, 773, 1579, 783, 2491, 7441, 21203, 57091, 107413}}, {10404, 17, 39737, {1, 1, 1, 5, 19, 7, 97, 213, 431, 533, 637, 1767, 4945, 4693, 977, 64781, 111811}}, {10405, 17, 39738, {1, 3, 7, 7, 1, 55, 101, 251, 153, 95, 1043, 3219, 3499, 6297, 11571, 9131, 61899}}, {10406, 17, 39755, {1, 3, 5, 5, 25, 53, 121, 255, 69, 661, 799, 3559, 2029, 11701, 14151, 37897, 18333}}, {10407, 17, 39757, {1, 1, 1, 9, 21, 19, 97, 21, 321, 957, 1115, 251, 5131, 8465, 24215, 34423, 12747}}, {10408, 17, 39758, {1, 3, 5, 7, 17, 19, 99, 135, 429, 625, 1401, 1025, 4193, 2911, 7349, 34135, 9341}}, {10409, 17, 39765, {1, 3, 5, 1, 5, 63, 97, 121, 307, 547, 1967, 641, 487, 4627, 30899, 62049, 94343}}, {10410, 17, 39766, {1, 3, 5, 13, 1, 1, 109, 23, 267, 843, 271, 2277, 855, 4245, 2177, 33633, 113835}}, {10411, 17, 39769, {1, 1, 3, 7, 3, 27, 91, 79, 27, 855, 2025, 443, 4797, 9005, 27533, 20497, 100431}}, {10412, 17, 39779, {1, 3, 3, 5, 23, 7, 73, 35, 395, 649, 881, 2923, 4065, 853, 10829, 19461, 82383}}, {10413, 17, 39785, {1, 3, 1, 5, 25, 13, 85, 93, 369, 259, 393, 3233, 799, 12409, 26631, 64291, 110133}}, {10414, 17, 39794, {1, 3, 5, 5, 31, 35, 25, 239, 455, 893, 573, 1449, 3359, 12077, 17149, 12921, 66931}}, {10415, 17, 39796, {1, 1, 7, 3, 25, 39, 67, 87, 215, 325, 627, 3609, 4417, 10021, 12047, 64593, 116525}}, {10416, 17, 39809, {1, 1, 5, 5, 23, 51, 125, 247, 83, 419, 655, 635, 7053, 4907, 12887, 18083, 49481}}, {10417, 17, 39815, {1, 1, 7, 11, 5, 25, 65, 139, 235, 331, 1885, 1851, 1061, 13265, 14371, 23067, 56757}}, {10418, 17, 39829, {1, 1, 7, 9, 11, 15, 29, 255, 509, 869, 561, 2201, 487, 2989, 14943, 65373, 35789}}, {10419, 17, 39834, {1, 1, 1, 3, 3, 33, 23, 121, 129, 351, 1481, 65, 321, 15927, 23849, 2813, 98547}}, {10420, 17, 39839, {1, 1, 1, 3, 23, 55, 121, 35, 339, 87, 1147, 401, 1477, 10617, 15943, 20535, 89321}}, {10421, 17, 39850, {1, 3, 5, 15, 25, 59, 111, 185, 305, 47, 523, 2801, 5485, 625, 30191, 58153, 9019}}, {10422, 17, 39857, {1, 1, 7, 13, 15, 51, 105, 55, 77, 419, 1011, 1117, 2705, 15093, 15629, 51429, 58487}}, {10423, 17, 39881, {1, 3, 7, 5, 15, 27, 19, 7, 401, 295, 1841, 1167, 2133, 1967, 6941, 13571, 29467}}, {10424, 17, 39905, {1, 1, 5, 15, 25, 43, 23, 253, 173, 927, 1299, 2779, 5489, 16135, 1503, 51097, 105751}}, {10425, 17, 39912, {1, 3, 3, 5, 9, 13, 5, 13, 411, 639, 1323, 1495, 2539, 15087, 21489, 49653, 76229}}, {10426, 17, 39938, {1, 1, 1, 11, 7, 51, 47, 99, 247, 541, 1355, 2373, 4121, 13621, 7715, 16763, 127985}}, {10427, 17, 39940, {1, 1, 3, 9, 7, 1, 85, 45, 269, 769, 581, 2229, 7143, 5203, 22483, 18511, 30997}}, {10428, 17, 39944, {1, 3, 5, 7, 21, 41, 97, 225, 109, 195, 1197, 3417, 7613, 13225, 29157, 18969, 82045}}, {10429, 17, 39955, {1, 3, 3, 3, 17, 41, 13, 77, 129, 679, 1659, 1299, 4809, 8537, 19081, 1281, 70793}}, {10430, 17, 39961, {1, 1, 5, 5, 5, 49, 5, 15, 313, 941, 775, 259, 6579, 7745, 20531, 51669, 35257}}, {10431, 17, 39977, {1, 1, 5, 5, 17, 35, 13, 235, 169, 699, 1365, 3907, 4231, 10965, 7737, 6735, 4253}}, {10432, 17, 39980, {1, 1, 5, 3, 29, 3, 1, 197, 133, 935, 571, 3977, 2467, 2029, 12803, 64559, 6427}}, {10433, 17, 39986, {1, 3, 5, 5, 27, 5, 69, 57, 439, 925, 1695, 827, 4685, 10971, 3011, 56821, 92187}}, {10434, 17, 39988, {1, 1, 1, 3, 9, 45, 77, 179, 173, 1023, 907, 1999, 3913, 6973, 26987, 30237, 62987}}, {10435, 17, 39991, {1, 3, 7, 3, 5, 21, 17, 97, 433, 277, 1515, 2923, 8025, 14119, 11243, 3983, 33943}}, {10436, 17, 39998, {1, 1, 5, 7, 15, 13, 119, 169, 21, 927, 439, 361, 2655, 2237, 19775, 4157, 84245}}, {10437, 17, 40003, {1, 3, 5, 5, 31, 41, 117, 159, 421, 505, 1617, 3855, 7835, 8105, 29525, 56735, 82335}}, {10438, 17, 40005, {1, 1, 5, 5, 1, 33, 51, 3, 79, 933, 389, 493, 5969, 12493, 26723, 61159, 116951}}, {10439, 17, 40023, {1, 3, 7, 13, 17, 23, 75, 13, 355, 111, 675, 3191, 3931, 5651, 17495, 4595, 49869}}, {10440, 17, 40024, {1, 1, 7, 7, 15, 21, 35, 125, 89, 903, 697, 3493, 4043, 6631, 4793, 45655, 86969}}, {10441, 17, 40045, {1, 3, 1, 15, 13, 43, 113, 213, 451, 473, 191, 2913, 6391, 1321, 29615, 24791, 26979}}, {10442, 17, 40046, {1, 3, 3, 13, 17, 25, 9, 163, 163, 161, 1647, 3949, 1343, 12881, 10931, 31365, 70013}}, {10443, 17, 40058, {1, 3, 7, 3, 3, 19, 1, 121, 387, 543, 1655, 1797, 6727, 2951, 21925, 21595, 73207}}, {10444, 17, 40088, {1, 1, 5, 9, 7, 19, 91, 9, 83, 893, 1393, 163, 2219, 7763, 32395, 29569, 98645}}, {10445, 17, 40091, {1, 1, 5, 7, 13, 63, 91, 115, 247, 387, 87, 3239, 7561, 297, 32615, 48817, 41761}}, {10446, 17, 40098, {1, 3, 5, 3, 21, 23, 27, 141, 257, 377, 1745, 443, 897, 9033, 1715, 9225, 110181}}, {10447, 17, 40109, {1, 1, 7, 9, 23, 49, 125, 131, 225, 253, 139, 2057, 3273, 4049, 6861, 4463, 11659}}, {10448, 17, 40112, {1, 1, 5, 11, 5, 41, 97, 213, 133, 481, 2009, 2039, 1533, 10765, 22427, 23297, 80661}}, {10449, 17, 40124, {1, 1, 5, 15, 9, 11, 77, 129, 421, 219, 1623, 703, 1611, 13377, 9859, 42869, 101943}}, {10450, 17, 40130, {1, 3, 3, 3, 17, 63, 55, 29, 317, 973, 1159, 11, 1733, 14551, 25911, 39151, 45861}}, {10451, 17, 40153, {1, 3, 7, 11, 29, 63, 107, 193, 263, 799, 1171, 543, 553, 12591, 21965, 8165, 64347}}, {10452, 17, 40166, {1, 1, 7, 15, 23, 49, 65, 65, 401, 897, 681, 1113, 6737, 9157, 1557, 55891, 129175}}, {10453, 17, 40175, {1, 3, 3, 1, 15, 23, 107, 123, 313, 633, 1009, 2615, 1155, 11701, 21945, 7939, 28111}}, {10454, 17, 40183, {1, 3, 1, 11, 15, 11, 47, 137, 299, 393, 877, 1989, 5903, 6505, 9599, 4129, 23073}}, {10455, 17, 40184, {1, 1, 7, 15, 9, 49, 67, 15, 79, 125, 505, 17, 8071, 12957, 13855, 23611, 66465}}, {10456, 17, 40207, {1, 1, 5, 13, 31, 49, 1, 161, 121, 145, 711, 1347, 5297, 11309, 9871, 43075, 95541}}, {10457, 17, 40215, {1, 3, 3, 13, 19, 7, 55, 199, 469, 471, 1269, 3779, 6251, 3513, 1775, 19501, 94055}}, {10458, 17, 40225, {1, 3, 3, 13, 9, 41, 109, 211, 197, 227, 1211, 3327, 1247, 12253, 4493, 31507, 38677}}, {10459, 17, 40235, {1, 1, 7, 3, 11, 45, 11, 103, 325, 849, 1817, 3971, 1059, 9047, 27237, 32211, 121165}}, {10460, 17, 40240, {1, 3, 3, 3, 13, 43, 7, 35, 293, 3, 679, 1441, 5189, 7585, 32009, 6151, 89803}}, {10461, 17, 40255, {1, 1, 7, 9, 29, 41, 127, 255, 363, 913, 2027, 3891, 5187, 10233, 8871, 48085, 125609}}, {10462, 17, 40263, {1, 3, 1, 5, 21, 23, 59, 145, 171, 775, 535, 3803, 6981, 15901, 20255, 63199, 92905}}, {10463, 17, 40270, {1, 3, 5, 9, 7, 63, 53, 7, 145, 547, 1753, 3351, 1273, 8175, 24103, 42133, 87459}}, {10464, 17, 40277, {1, 3, 7, 7, 25, 33, 5, 217, 469, 473, 1573, 2525, 7345, 5261, 7023, 50893, 124129}}, {10465, 17, 40282, {1, 3, 5, 13, 5, 51, 23, 61, 429, 775, 519, 2671, 1979, 9005, 21617, 33611, 120487}}, {10466, 17, 40297, {1, 3, 3, 15, 23, 1, 73, 187, 47, 369, 943, 99, 2529, 5569, 13649, 51481, 128949}}, {10467, 17, 40306, {1, 3, 1, 5, 25, 55, 35, 191, 327, 845, 1353, 261, 6297, 6067, 22241, 32381, 17749}}, {10468, 17, 40315, {1, 1, 5, 15, 31, 5, 29, 129, 15, 47, 739, 755, 7595, 14743, 14705, 34347, 11805}}, {10469, 17, 40333, {1, 3, 1, 3, 15, 49, 119, 47, 185, 63, 2003, 2847, 5393, 855, 7699, 29521, 67011}}, {10470, 17, 40334, {1, 3, 7, 15, 11, 41, 37, 149, 173, 1015, 29, 1805, 1269, 16199, 32337, 11023, 60065}}, {10471, 17, 40336, {1, 1, 1, 7, 31, 19, 65, 81, 255, 875, 1379, 2347, 1873, 14427, 29523, 38413, 65583}}, {10472, 17, 40342, {1, 1, 1, 15, 13, 59, 3, 219, 127, 479, 1029, 3385, 563, 11825, 10081, 17423, 26431}}, {10473, 17, 40345, {1, 1, 1, 1, 25, 27, 79, 87, 489, 281, 457, 3527, 5117, 4705, 21167, 46211, 90383}}, {10474, 17, 40348, {1, 3, 7, 13, 7, 5, 67, 111, 53, 439, 1483, 3639, 7781, 9471, 10957, 60711, 64957}}, {10475, 17, 40355, {1, 3, 7, 9, 7, 7, 41, 137, 159, 245, 551, 4007, 1277, 4743, 4863, 48689, 123289}}, {10476, 17, 40372, {1, 3, 7, 9, 15, 49, 55, 77, 41, 475, 1563, 3569, 5993, 301, 14831, 44095, 22641}}, {10477, 17, 40381, {1, 1, 1, 1, 15, 33, 39, 135, 81, 533, 869, 305, 1125, 6399, 14321, 37217, 121081}}, {10478, 17, 40390, {1, 1, 7, 15, 21, 59, 43, 7, 225, 1, 115, 1531, 2931, 2593, 15935, 61973, 106899}}, {10479, 17, 40407, {1, 1, 1, 1, 13, 13, 99, 191, 437, 367, 641, 1933, 5807, 11677, 13557, 46475, 34875}}, {10480, 17, 40435, {1, 3, 7, 9, 21, 7, 119, 209, 31, 919, 901, 1229, 5823, 11439, 18151, 18991, 114743}}, {10481, 17, 40437, {1, 3, 3, 3, 19, 37, 109, 53, 411, 617, 1841, 2769, 1271, 5719, 22359, 1199, 72405}}, {10482, 17, 40441, {1, 1, 1, 5, 29, 3, 51, 59, 141, 897, 1907, 3799, 1463, 5661, 181, 50565, 95085}}, {10483, 17, 40444, {1, 1, 1, 7, 1, 35, 77, 225, 341, 587, 137, 35, 2177, 15177, 12869, 35013, 39471}}, {10484, 17, 40458, {1, 1, 3, 13, 15, 63, 45, 33, 337, 1, 1133, 263, 4985, 11591, 1085, 31197, 67897}}, {10485, 17, 40460, {1, 1, 5, 13, 23, 11, 123, 21, 185, 639, 145, 3865, 2999, 6261, 23247, 23055, 32755}}, {10486, 17, 40481, {1, 1, 5, 9, 19, 21, 47, 133, 281, 431, 1661, 3719, 3637, 973, 9727, 52627, 60035}}, {10487, 17, 40484, {1, 1, 3, 5, 3, 19, 19, 89, 63, 549, 551, 3357, 5665, 4781, 22437, 1149, 10825}}, {10488, 17, 40487, {1, 3, 5, 15, 3, 25, 81, 193, 11, 711, 1481, 1767, 1159, 4967, 16915, 3387, 26245}}, {10489, 17, 40493, {1, 1, 1, 3, 29, 39, 23, 131, 473, 107, 765, 2249, 6087, 9145, 20751, 21085, 42989}}, {10490, 17, 40494, {1, 3, 1, 9, 7, 39, 13, 199, 475, 333, 269, 1041, 5927, 14039, 19081, 9045, 119645}}, {10491, 17, 40501, {1, 1, 5, 13, 11, 61, 99, 71, 151, 175, 1327, 3397, 5063, 10683, 7895, 62255, 85749}}, {10492, 17, 40502, {1, 3, 7, 9, 1, 57, 21, 217, 423, 467, 1435, 2887, 1567, 8819, 19961, 36507, 110309}}, {10493, 17, 40525, {1, 3, 3, 11, 11, 35, 77, 127, 153, 357, 865, 1943, 1947, 10995, 13617, 44347, 26851}}, {10494, 17, 40550, {1, 3, 1, 11, 9, 43, 31, 81, 123, 813, 995, 169, 6593, 13621, 32195, 51125, 53509}}, {10495, 17, 40553, {1, 1, 5, 5, 27, 29, 77, 35, 93, 545, 377, 2345, 6475, 15729, 15103, 49591, 101121}}, {10496, 17, 40559, {1, 1, 5, 13, 1, 17, 97, 187, 129, 173, 641, 2937, 3277, 15087, 28111, 46905, 112367}}, {10497, 17, 40562, {1, 3, 7, 7, 1, 27, 75, 43, 305, 431, 571, 1327, 7419, 3093, 2691, 23417, 11975}}, {10498, 17, 40573, {1, 1, 5, 15, 17, 3, 91, 57, 417, 87, 1891, 1973, 5765, 5521, 21931, 60011, 20883}}, {10499, 17, 40574, {1, 3, 1, 3, 27, 13, 105, 153, 495, 371, 453, 1295, 5675, 6377, 8971, 40505, 41149}}, {10500, 17, 40578, {1, 1, 1, 15, 1, 17, 105, 177, 41, 455, 611, 3585, 2307, 2603, 20985, 5581, 14033}}, {10501, 17, 40583, {1, 3, 3, 9, 7, 41, 33, 145, 307, 293, 1321, 2151, 3265, 14845, 15687, 38715, 8041}}, {10502, 17, 40584, {1, 3, 3, 3, 5, 47, 127, 253, 129, 337, 1467, 5, 2743, 1921, 26979, 11737, 41479}}, {10503, 17, 40587, {1, 1, 1, 5, 15, 35, 37, 9, 5, 405, 1041, 1903, 3655, 14315, 9441, 20577, 50715}}, {10504, 17, 40597, {1, 1, 5, 15, 7, 5, 53, 61, 409, 353, 87, 1805, 4523, 11417, 24105, 21451, 56387}}, {10505, 17, 40620, {1, 3, 3, 5, 5, 9, 25, 249, 511, 795, 559, 2695, 3071, 3971, 29421, 46593, 96563}}, {10506, 17, 40623, {1, 1, 3, 1, 3, 39, 61, 85, 399, 105, 1253, 3787, 3065, 10553, 8195, 5637, 129579}}, {10507, 17, 40631, {1, 3, 3, 7, 23, 23, 23, 197, 263, 687, 943, 1977, 5767, 15373, 17995, 24509, 81293}}, {10508, 17, 40643, {1, 3, 1, 11, 15, 37, 15, 67, 207, 985, 895, 509, 3435, 11563, 2055, 19253, 42649}}, {10509, 17, 40660, {1, 1, 7, 3, 1, 51, 59, 133, 241, 569, 1575, 3633, 2243, 11939, 5501, 11249, 86013}}, {10510, 17, 40667, {1, 1, 7, 13, 25, 59, 97, 191, 385, 179, 1195, 1537, 1837, 11953, 14231, 37025, 49803}}, {10511, 17, 40676, {1, 3, 5, 5, 13, 49, 19, 171, 503, 433, 1633, 553, 2759, 4379, 18313, 62437, 37453}}, {10512, 17, 40693, {1, 3, 3, 15, 29, 49, 107, 239, 21, 913, 1095, 989, 4749, 10657, 27169, 15913, 1573}}, {10513, 17, 40697, {1, 1, 1, 1, 3, 3, 53, 241, 287, 149, 557, 2665, 2027, 449, 29231, 23025, 102521}}, {10514, 17, 40708, {1, 3, 5, 7, 23, 21, 9, 1, 11, 837, 1337, 2815, 7883, 16053, 10031, 43405, 5037}}, {10515, 17, 40718, {1, 3, 7, 1, 23, 53, 113, 125, 337, 491, 1125, 3083, 4941, 951, 15805, 1571, 79779}}, {10516, 17, 40726, {1, 3, 7, 13, 1, 3, 95, 105, 431, 723, 1771, 3773, 177, 2045, 24719, 57727, 79005}}, {10517, 17, 40735, {1, 3, 1, 1, 7, 17, 107, 171, 213, 437, 409, 2015, 7543, 12693, 23597, 44477, 72543}}, {10518, 17, 40739, {1, 3, 5, 9, 7, 21, 27, 167, 473, 901, 1245, 3737, 3485, 14593, 7619, 18753, 14209}}, {10519, 17, 40748, {1, 1, 1, 3, 25, 37, 51, 21, 363, 73, 711, 3749, 5147, 8495, 30151, 14275, 128217}}, {10520, 17, 40760, {1, 3, 1, 13, 17, 35, 69, 15, 293, 331, 301, 691, 7315, 6495, 315, 62909, 105047}}, {10521, 17, 40763, {1, 3, 5, 3, 25, 23, 105, 111, 213, 887, 1701, 2085, 5931, 9217, 4009, 2321, 103631}}, {10522, 17, 40773, {1, 1, 7, 15, 17, 57, 59, 249, 267, 941, 777, 2509, 6587, 12033, 24969, 31563, 129049}}, {10523, 17, 40774, {1, 1, 1, 5, 31, 23, 31, 217, 509, 973, 659, 673, 7759, 3865, 21221, 4319, 117411}}, {10524, 17, 40786, {1, 1, 3, 7, 13, 13, 103, 179, 107, 233, 753, 3121, 835, 13595, 9271, 31421, 45275}}, {10525, 17, 40791, {1, 3, 5, 13, 23, 61, 125, 189, 283, 83, 1087, 755, 3697, 14845, 27901, 16389, 82993}}, {10526, 17, 40798, {1, 3, 1, 3, 1, 55, 25, 139, 435, 681, 1913, 975, 3109, 6699, 12943, 50865, 71811}}, {10527, 17, 40801, {1, 3, 1, 5, 15, 61, 17, 219, 29, 805, 1881, 3761, 3535, 473, 15629, 26301, 51085}}, {10528, 17, 40808, {1, 3, 1, 1, 7, 43, 87, 93, 355, 247, 641, 2851, 4565, 9293, 6025, 1945, 112549}}, {10529, 17, 40811, {1, 3, 7, 5, 19, 55, 69, 227, 107, 443, 1587, 2457, 2873, 953, 27529, 57527, 54145}}, {10530, 17, 40813, {1, 1, 5, 9, 1, 33, 31, 241, 339, 791, 399, 3435, 1711, 10815, 32657, 59875, 31291}}, {10531, 17, 40825, {1, 1, 1, 7, 25, 59, 87, 115, 435, 47, 1907, 193, 6069, 10933, 9877, 46443, 3451}}, {10532, 17, 40831, {1, 3, 3, 15, 25, 33, 19, 121, 133, 253, 1227, 75, 2839, 3341, 30727, 52451, 44883}}, {10533, 17, 40835, {1, 1, 7, 11, 5, 47, 97, 255, 235, 565, 1701, 529, 839, 15473, 24471, 5749, 73135}}, {10534, 17, 40856, {1, 1, 3, 7, 21, 15, 31, 81, 389, 957, 603, 3879, 2875, 11987, 24625, 53667, 77775}}, {10535, 17, 40861, {1, 1, 5, 11, 29, 29, 31, 233, 107, 541, 561, 2533, 1421, 13587, 6943, 45635, 71315}}, {10536, 17, 40880, {1, 3, 1, 9, 25, 19, 33, 53, 509, 485, 1637, 2877, 5927, 16059, 195, 17279, 127025}}, {10537, 17, 40889, {1, 1, 1, 3, 9, 23, 97, 101, 337, 43, 1979, 1139, 3693, 2601, 8225, 53037, 63709}}, {10538, 17, 40912, {1, 1, 7, 7, 17, 25, 121, 253, 63, 105, 527, 1397, 121, 9665, 29151, 10795, 79077}}, {10539, 17, 40918, {1, 3, 3, 1, 27, 33, 123, 69, 209, 25, 1677, 1569, 4441, 7817, 5165, 29517, 117165}}, {10540, 17, 40924, {1, 1, 5, 15, 3, 59, 13, 25, 359, 71, 179, 3925, 6899, 6007, 9121, 36297, 88541}}, {10541, 17, 40927, {1, 1, 3, 11, 23, 17, 55, 133, 27, 277, 1055, 1057, 807, 1221, 1665, 64129, 102395}}, {10542, 17, 40928, {1, 3, 1, 15, 13, 15, 105, 141, 329, 73, 609, 1663, 3277, 1767, 6371, 34325, 109563}}, {10543, 17, 40938, {1, 1, 5, 1, 17, 21, 37, 81, 187, 403, 291, 1495, 5071, 14289, 29075, 44089, 95001}}, {10544, 17, 40952, {1, 3, 3, 3, 15, 33, 49, 155, 41, 853, 15, 3571, 1433, 8469, 18711, 59007, 98703}}, {10545, 17, 40957, {1, 3, 1, 13, 17, 47, 61, 151, 127, 87, 207, 3157, 5141, 14745, 32567, 18401, 7497}}, {10546, 17, 40961, {1, 3, 5, 1, 19, 25, 49, 147, 137, 603, 1223, 3195, 5965, 11335, 20343, 10109, 63975}}, {10547, 17, 40968, {1, 1, 7, 13, 29, 59, 1, 33, 157, 765, 961, 641, 7303, 3279, 20287, 37553, 114573}}, {10548, 17, 40974, {1, 3, 5, 1, 11, 63, 63, 41, 15, 717, 1037, 227, 7875, 8681, 26943, 11761, 28005}}, {10549, 17, 40986, {1, 3, 1, 3, 19, 5, 67, 169, 209, 293, 343, 2033, 7669, 1077, 15513, 54475, 15459}}, {10550, 17, 40992, {1, 1, 3, 3, 17, 47, 49, 187, 341, 767, 1463, 301, 2083, 9265, 12313, 14763, 126627}}, {10551, 17, 41001, {1, 3, 5, 13, 11, 15, 45, 237, 445, 55, 319, 2989, 5043, 1053, 22809, 23111, 7617}}, {10552, 17, 41004, {1, 1, 7, 9, 7, 15, 41, 185, 511, 701, 1279, 1995, 7829, 2947, 3431, 45799, 1709}}, {10553, 17, 41022, {1, 3, 7, 15, 5, 15, 85, 29, 487, 811, 1653, 483, 1193, 11331, 21815, 57215, 8373}}, {10554, 17, 41033, {1, 3, 1, 15, 27, 19, 111, 161, 19, 373, 419, 1547, 2415, 10705, 17283, 56663, 73625}}, {10555, 17, 41036, {1, 1, 3, 11, 27, 7, 75, 57, 411, 35, 685, 1249, 5227, 7313, 3167, 30537, 40655}}, {10556, 17, 41039, {1, 3, 1, 9, 7, 37, 9, 209, 353, 319, 843, 657, 2069, 6523, 611, 16291, 107121}}, {10557, 17, 41044, {1, 1, 5, 11, 11, 51, 25, 171, 315, 63, 207, 2279, 2379, 3583, 31927, 62451, 109911}}, {10558, 17, 41064, {1, 1, 7, 11, 15, 41, 19, 175, 103, 605, 1889, 3161, 1217, 3259, 29655, 11715, 35551}}, {10559, 17, 41078, {1, 3, 5, 13, 23, 11, 121, 147, 179, 397, 659, 3753, 2355, 1093, 25863, 39751, 112381}}, {10560, 17, 41091, {1, 3, 5, 7, 1, 23, 37, 117, 7, 361, 991, 661, 4427, 15333, 5307, 55171, 96959}}, {10561, 17, 41103, {1, 3, 1, 5, 17, 9, 77, 147, 289, 79, 295, 1271, 7809, 6387, 31785, 26489, 9335}}, {10562, 17, 41108, {1, 1, 1, 7, 17, 33, 63, 147, 17, 515, 1349, 1907, 7703, 5511, 27773, 54025, 30019}}, {10563, 17, 41112, {1, 3, 5, 3, 27, 57, 75, 129, 219, 533, 207, 3569, 5799, 6943, 12271, 53115, 120389}}, {10564, 17, 41127, {1, 1, 1, 13, 11, 25, 101, 251, 289, 215, 1875, 1821, 703, 15395, 27167, 43187, 63401}}, {10565, 17, 41128, {1, 1, 7, 15, 7, 39, 125, 41, 57, 513, 17, 965, 3225, 12833, 21131, 53243, 60377}}, {10566, 17, 41136, {1, 3, 5, 3, 21, 19, 43, 195, 259, 523, 587, 3393, 6621, 43, 10951, 51877, 79967}}, {10567, 17, 41141, {1, 3, 3, 7, 7, 19, 11, 89, 321, 821, 99, 2201, 1297, 949, 11539, 6295, 19721}}, {10568, 17, 41146, {1, 1, 5, 3, 29, 27, 123, 111, 441, 441, 337, 3849, 1677, 14403, 17203, 50661, 92177}}, {10569, 17, 41156, {1, 3, 5, 9, 23, 23, 73, 153, 241, 841, 371, 1503, 5815, 14117, 4679, 17997, 112269}}, {10570, 17, 41159, {1, 1, 1, 1, 7, 37, 105, 185, 453, 905, 15, 57, 6963, 9665, 3371, 2391, 96023}}, {10571, 17, 41163, {1, 3, 7, 1, 1, 21, 35, 43, 449, 111, 191, 2163, 3249, 15049, 30215, 43569, 127973}}, {10572, 17, 41165, {1, 3, 3, 3, 17, 13, 77, 123, 471, 929, 1797, 2061, 355, 4441, 1101, 24631, 128711}}, {10573, 17, 41166, {1, 3, 7, 7, 17, 51, 1, 69, 23, 1003, 535, 3751, 765, 5253, 21027, 52901, 61951}}, {10574, 17, 41184, {1, 1, 7, 9, 25, 13, 33, 13, 423, 787, 223, 729, 4443, 227, 11487, 14259, 52951}}, {10575, 17, 41193, {1, 3, 5, 5, 25, 27, 113, 93, 13, 679, 1295, 3773, 7253, 14629, 8907, 45885, 85387}}, {10576, 17, 41202, {1, 3, 3, 13, 15, 55, 99, 31, 119, 955, 1477, 3745, 6777, 973, 4723, 62133, 65093}}, {10577, 17, 41211, {1, 3, 3, 9, 13, 51, 105, 37, 477, 579, 765, 2573, 6869, 3891, 30969, 63413, 56603}}, {10578, 17, 41216, {1, 3, 1, 3, 15, 23, 67, 109, 75, 721, 523, 1433, 3455, 6377, 23795, 13711, 121349}}, {10579, 17, 41239, {1, 1, 3, 11, 5, 5, 99, 117, 233, 621, 509, 3235, 7483, 12325, 13203, 20075, 27537}}, {10580, 17, 41243, {1, 3, 3, 9, 23, 51, 93, 245, 307, 689, 1993, 3607, 1985, 11839, 25553, 54941, 68741}}, {10581, 17, 41249, {1, 1, 3, 5, 19, 21, 33, 71, 447, 539, 351, 2549, 87, 4317, 1287, 62289, 121065}}, {10582, 17, 41262, {1, 3, 5, 5, 9, 23, 37, 189, 449, 263, 37, 3127, 1709, 10793, 7379, 38565, 8267}}, {10583, 17, 41267, {1, 1, 7, 7, 7, 33, 23, 79, 457, 947, 1275, 2755, 3747, 9225, 31385, 8785, 76945}}, {10584, 17, 41276, {1, 3, 1, 9, 17, 33, 29, 59, 505, 649, 1679, 3609, 1361, 5987, 26455, 17295, 98697}}, {10585, 17, 41279, {1, 1, 3, 11, 7, 47, 127, 79, 419, 143, 349, 985, 6397, 10271, 29427, 19661, 32629}}, {10586, 17, 41305, {1, 1, 5, 13, 15, 5, 79, 171, 491, 223, 1601, 705, 623, 4405, 10065, 28057, 105737}}, {10587, 17, 41306, {1, 1, 7, 3, 29, 7, 81, 69, 265, 669, 1763, 2109, 6275, 7683, 19561, 26737, 54449}}, {10588, 17, 41312, {1, 1, 1, 7, 1, 1, 5, 9, 65, 487, 1663, 1021, 1819, 9971, 22065, 40407, 4187}}, {10589, 17, 41317, {1, 3, 5, 5, 21, 33, 11, 213, 309, 575, 427, 1421, 6435, 981, 31533, 16751, 47813}}, {10590, 17, 41321, {1, 3, 3, 13, 7, 59, 65, 65, 401, 195, 211, 421, 1139, 11729, 19717, 20699, 111863}}, {10591, 17, 41332, {1, 3, 7, 5, 17, 51, 25, 217, 223, 935, 431, 1703, 4869, 5635, 199, 5485, 37311}}, {10592, 17, 41335, {1, 1, 3, 11, 23, 25, 15, 37, 187, 1007, 857, 3327, 5471, 10089, 13745, 1741, 37769}}, {10593, 17, 41345, {1, 3, 5, 15, 31, 17, 75, 125, 1, 449, 1293, 3427, 709, 8285, 31143, 50655, 130793}}, {10594, 17, 41346, {1, 1, 7, 3, 25, 55, 105, 255, 319, 183, 1571, 2425, 5429, 7151, 8569, 37447, 23055}}, {10595, 17, 41351, {1, 3, 1, 1, 23, 37, 17, 61, 161, 559, 1025, 2651, 5861, 5231, 1365, 4853, 127301}}, {10596, 17, 41365, {1, 3, 1, 9, 17, 37, 87, 241, 411, 53, 1555, 3805, 6867, 125, 9829, 53581, 117413}}, {10597, 17, 41388, {1, 3, 3, 3, 23, 55, 121, 109, 441, 623, 1345, 3055, 2591, 11329, 16891, 61347, 125643}}, {10598, 17, 41399, {1, 3, 1, 1, 5, 29, 53, 97, 15, 275, 1587, 1245, 379, 16117, 24369, 26873, 39547}}, {10599, 17, 41405, {1, 3, 1, 5, 3, 63, 85, 167, 301, 45, 1357, 1185, 3939, 945, 24961, 59427, 128129}}, {10600, 17, 41414, {1, 3, 1, 7, 23, 25, 109, 253, 37, 151, 17, 1241, 787, 15895, 7947, 65071, 14765}}, {10601, 17, 41432, {1, 3, 3, 1, 7, 3, 103, 35, 73, 533, 1055, 823, 7403, 8117, 28813, 42457, 56037}}, {10602, 17, 41454, {1, 3, 5, 15, 1, 15, 97, 109, 293, 259, 935, 2977, 5257, 14563, 28871, 17647, 34185}}, {10603, 17, 41461, {1, 1, 1, 3, 29, 21, 101, 163, 173, 1019, 1025, 553, 945, 3781, 1097, 58025, 124819}}, {10604, 17, 41462, {1, 1, 3, 9, 7, 35, 65, 61, 31, 547, 75, 3515, 6719, 12809, 23287, 14609, 30341}}, {10605, 17, 41471, {1, 3, 7, 9, 3, 53, 21, 207, 383, 917, 1383, 2873, 1663, 15665, 1787, 50741, 35145}}, {10606, 17, 41478, {1, 3, 7, 5, 3, 35, 113, 191, 171, 635, 1597, 2943, 2421, 5555, 6457, 22087, 104221}}, {10607, 17, 41490, {1, 1, 1, 1, 29, 25, 3, 225, 175, 807, 1325, 215, 6475, 10729, 18619, 45401, 20627}}, {10608, 17, 41506, {1, 1, 5, 11, 23, 25, 39, 207, 81, 633, 403, 3369, 1295, 1289, 20853, 48899, 16613}}, {10609, 17, 41508, {1, 1, 7, 15, 5, 23, 17, 77, 169, 969, 1459, 3795, 3121, 5501, 32323, 46743, 124175}}, {10610, 17, 41512, {1, 1, 7, 13, 3, 25, 77, 153, 105, 1017, 1599, 237, 4691, 1993, 6707, 50265, 13529}}, {10611, 17, 41517, {1, 3, 3, 15, 7, 11, 81, 223, 61, 589, 1263, 3999, 7643, 12101, 19853, 49279, 29999}}, {10612, 17, 41520, {1, 3, 1, 13, 3, 31, 61, 59, 41, 313, 115, 561, 3973, 13513, 6359, 29395, 34565}}, {10613, 17, 41529, {1, 1, 7, 7, 7, 61, 91, 181, 307, 875, 2045, 1367, 3743, 6497, 2443, 12153, 96431}}, {10614, 17, 41530, {1, 1, 3, 7, 19, 63, 97, 211, 157, 945, 891, 3747, 5483, 3081, 28939, 11179, 15935}}, {10615, 17, 41544, {1, 3, 7, 3, 23, 39, 51, 137, 91, 179, 1515, 1397, 2783, 9343, 11483, 52407, 111725}}, {10616, 17, 41550, {1, 3, 3, 11, 11, 25, 111, 61, 115, 329, 485, 1713, 565, 8607, 18869, 6595, 18605}}, {10617, 17, 41571, {1, 1, 5, 1, 13, 59, 67, 231, 443, 695, 1185, 393, 6393, 12957, 15817, 37219, 113127}}, {10618, 17, 41577, {1, 3, 5, 3, 15, 57, 25, 97, 321, 627, 15, 2005, 3813, 10399, 26779, 24243, 66463}}, {10619, 17, 41580, {1, 3, 7, 7, 17, 43, 117, 179, 447, 1005, 2007, 1753, 7685, 13331, 5187, 49341, 111927}}, {10620, 17, 41595, {1, 1, 3, 3, 5, 53, 35, 185, 93, 847, 1523, 3039, 25, 3351, 23195, 41133, 38547}}, {10621, 17, 41613, {1, 1, 7, 5, 27, 59, 95, 137, 55, 129, 331, 127, 7421, 5633, 557, 18137, 89055}}, {10622, 17, 41622, {1, 3, 3, 11, 5, 53, 93, 137, 175, 191, 1645, 2047, 2569, 8177, 22691, 4037, 31823}}, {10623, 17, 41635, {1, 3, 3, 11, 11, 45, 77, 7, 21, 541, 49, 1689, 171, 829, 28917, 45095, 1807}}, {10624, 17, 41642, {1, 3, 7, 5, 21, 5, 113, 81, 33, 681, 361, 1107, 1597, 115, 11503, 27413, 9199}}, {10625, 17, 41661, {1, 1, 3, 11, 29, 57, 15, 249, 105, 683, 833, 2579, 3517, 16153, 17373, 32587, 124333}}, {10626, 17, 41676, {1, 3, 7, 13, 3, 35, 55, 23, 293, 5, 2003, 2741, 4237, 8117, 20569, 63967, 106041}}, {10627, 17, 41681, {1, 3, 3, 1, 1, 15, 57, 119, 135, 967, 1495, 801, 4959, 5037, 10051, 53915, 116891}}, {10628, 17, 41684, {1, 1, 7, 9, 15, 29, 53, 139, 505, 473, 1179, 3289, 369, 13147, 15739, 16739, 54949}}, {10629, 17, 41687, {1, 1, 5, 7, 7, 45, 17, 213, 381, 63, 437, 3099, 3765, 175, 13521, 11689, 58675}}, {10630, 17, 41688, {1, 1, 7, 1, 15, 35, 55, 43, 147, 873, 1193, 3801, 2301, 14569, 31789, 50443, 62577}}, {10631, 17, 41694, {1, 1, 5, 7, 21, 41, 3, 45, 43, 303, 1465, 1461, 5295, 13397, 30439, 7103, 87505}}, {10632, 17, 41698, {1, 1, 1, 15, 19, 27, 81, 141, 307, 259, 521, 1785, 6917, 15635, 27781, 64809, 53297}}, {10633, 17, 41710, {1, 1, 1, 7, 27, 15, 53, 99, 377, 935, 1869, 3835, 741, 8447, 18947, 10727, 72179}}, {10634, 17, 41712, {1, 1, 3, 5, 15, 51, 91, 207, 7, 997, 935, 591, 7325, 3025, 11335, 32087, 109535}}, {10635, 17, 41721, {1, 3, 1, 5, 11, 13, 1, 57, 45, 307, 1839, 1735, 2247, 13117, 17471, 16599, 103063}}, {10636, 17, 41722, {1, 3, 5, 11, 19, 7, 121, 3, 325, 731, 1945, 4025, 7649, 8939, 11147, 59065, 49971}}, {10637, 17, 41729, {1, 3, 1, 5, 29, 63, 95, 121, 467, 7, 1857, 2389, 5213, 3931, 21187, 43529, 6767}}, {10638, 17, 41744, {1, 1, 7, 7, 9, 53, 31, 227, 95, 827, 927, 3501, 2003, 12853, 2595, 33223, 125799}}, {10639, 17, 41747, {1, 3, 3, 3, 27, 25, 105, 143, 233, 887, 1135, 3449, 5767, 11447, 10251, 34621, 102113}}, {10640, 17, 41753, {1, 3, 3, 15, 3, 63, 85, 119, 103, 835, 443, 3861, 4957, 5389, 6137, 48851, 51887}}, {10641, 17, 41766, {1, 3, 7, 9, 23, 23, 45, 129, 463, 653, 1309, 3533, 1303, 2955, 18023, 37457, 114765}}, {10642, 17, 41783, {1, 3, 7, 1, 23, 17, 31, 151, 71, 515, 781, 1793, 3507, 6051, 30279, 29461, 48271}}, {10643, 17, 41790, {1, 3, 5, 15, 1, 31, 9, 187, 131, 571, 1309, 965, 7561, 16113, 23209, 54615, 16969}}, {10644, 17, 41810, {1, 3, 5, 11, 11, 9, 109, 161, 9, 697, 1683, 1245, 2223, 3571, 18117, 13085, 99315}}, {10645, 17, 41819, {1, 3, 3, 1, 13, 21, 27, 17, 11, 11, 1095, 1447, 6941, 3399, 21245, 36661, 54283}}, {10646, 17, 41825, {1, 3, 1, 3, 21, 51, 21, 197, 161, 689, 1219, 1337, 6623, 5765, 11579, 2679, 23889}}, {10647, 17, 41828, {1, 1, 5, 11, 7, 31, 101, 25, 231, 719, 1677, 1545, 459, 14735, 25153, 65079, 15141}}, {10648, 17, 41843, {1, 1, 7, 9, 17, 7, 49, 1, 83, 829, 815, 307, 3405, 15189, 23699, 50889, 70391}}, {10649, 17, 41846, {1, 1, 3, 15, 21, 57, 97, 191, 415, 899, 197, 2635, 7507, 14009, 8633, 48997, 93925}}, {10650, 17, 41862, {1, 3, 5, 15, 23, 13, 67, 127, 33, 551, 911, 3933, 2027, 10665, 19509, 18485, 76111}}, {10651, 17, 41871, {1, 1, 5, 7, 23, 63, 19, 149, 139, 155, 1621, 3391, 2337, 2809, 21161, 38565, 401}}, {10652, 17, 41874, {1, 1, 1, 7, 19, 23, 81, 49, 339, 879, 1903, 657, 2677, 2273, 10853, 3225, 57933}}, {10653, 17, 41876, {1, 3, 5, 5, 13, 31, 19, 203, 269, 1015, 997, 2151, 4471, 11331, 5363, 46519, 51709}}, {10654, 17, 41892, {1, 1, 5, 11, 29, 19, 17, 169, 511, 389, 1429, 2707, 1341, 10511, 6779, 43345, 68693}}, {10655, 17, 41899, {1, 1, 5, 11, 19, 25, 29, 37, 423, 345, 953, 2525, 5937, 6595, 31389, 39347, 36343}}, {10656, 17, 41916, {1, 3, 1, 3, 15, 25, 45, 95, 111, 207, 19, 1723, 4113, 421, 3297, 46771, 8639}}, {10657, 17, 41928, {1, 1, 3, 9, 9, 47, 27, 99, 327, 393, 1547, 1587, 4463, 719, 14609, 24347, 68107}}, {10658, 17, 41957, {1, 3, 7, 7, 29, 19, 57, 229, 131, 497, 109, 251, 6599, 8947, 10255, 12875, 83831}}, {10659, 17, 41964, {1, 3, 3, 7, 17, 5, 17, 45, 423, 393, 1793, 3, 603, 15221, 13141, 40585, 37489}}, {10660, 17, 41969, {1, 1, 1, 11, 5, 1, 53, 147, 129, 135, 1473, 17, 7539, 13513, 16045, 17375, 41261}}, {10661, 17, 41981, {1, 3, 1, 5, 3, 15, 75, 57, 47, 581, 739, 3529, 4323, 10225, 27861, 14431, 106811}}, {10662, 17, 41996, {1, 3, 3, 13, 23, 57, 41, 39, 217, 67, 595, 1381, 6281, 10125, 30605, 7935, 124219}}, {10663, 17, 41999, {1, 1, 7, 15, 15, 45, 1, 135, 495, 271, 2023, 3267, 39, 15025, 32763, 39023, 20041}}, {10664, 17, 42001, {1, 3, 7, 13, 23, 53, 75, 147, 187, 633, 1989, 1885, 6581, 12169, 13639, 19707, 96429}}, {10665, 17, 42017, {1, 1, 5, 9, 13, 55, 13, 41, 305, 105, 1983, 273, 35, 5185, 22569, 54203, 31641}}, {10666, 17, 42023, {1, 1, 3, 15, 21, 19, 59, 35, 165, 575, 1961, 1443, 4803, 2339, 28329, 47695, 21505}}, {10667, 17, 42027, {1, 3, 1, 3, 23, 45, 95, 85, 55, 457, 1957, 1243, 4091, 14669, 13213, 53901, 122605}}, {10668, 17, 42032, {1, 3, 7, 1, 13, 1, 61, 253, 195, 839, 181, 1153, 1391, 205, 6725, 1757, 86817}}, {10669, 17, 42035, {1, 1, 3, 9, 7, 13, 115, 137, 169, 851, 299, 509, 6709, 6331, 51, 31833, 25217}}, {10670, 17, 42044, {1, 1, 5, 15, 29, 23, 119, 15, 41, 585, 1713, 1203, 1653, 3287, 25333, 58873, 71853}}, {10671, 17, 42050, {1, 3, 5, 15, 1, 45, 35, 79, 97, 381, 2027, 3795, 2127, 4775, 4579, 63267, 24719}}, {10672, 17, 42061, {1, 1, 5, 7, 17, 21, 123, 75, 3, 887, 1537, 2017, 1623, 16315, 12535, 64281, 54925}}, {10673, 17, 42062, {1, 1, 3, 13, 5, 23, 117, 43, 305, 365, 775, 1599, 5917, 13995, 6353, 3113, 106317}}, {10674, 17, 42073, {1, 1, 3, 11, 21, 19, 9, 11, 129, 349, 579, 3523, 5259, 8083, 24513, 15077, 115377}}, {10675, 17, 42098, {1, 1, 7, 9, 19, 31, 107, 3, 185, 821, 907, 2389, 7015, 3161, 13603, 35063, 60641}}, {10676, 17, 42104, {1, 1, 3, 1, 19, 35, 105, 245, 363, 745, 1287, 4051, 5201, 7787, 20919, 26567, 37357}}, {10677, 17, 42109, {1, 3, 1, 1, 23, 31, 1, 149, 61, 489, 371, 987, 3689, 14275, 8581, 48221, 44183}}, {10678, 17, 42120, {1, 1, 5, 3, 9, 35, 51, 17, 439, 355, 461, 2129, 1567, 13261, 22347, 17013, 53857}}, {10679, 17, 42125, {1, 3, 3, 15, 3, 33, 59, 185, 157, 933, 1489, 647, 4839, 12139, 3145, 57819, 11731}}, {10680, 17, 42131, {1, 3, 5, 15, 17, 31, 59, 51, 117, 1001, 1585, 2861, 2785, 9579, 28013, 4481, 126723}}, {10681, 17, 42143, {1, 3, 7, 13, 27, 1, 41, 119, 179, 879, 1617, 4053, 3537, 15389, 16381, 40153, 68019}}, {10682, 17, 42153, {1, 1, 3, 13, 13, 35, 45, 203, 333, 337, 1415, 1889, 2361, 4207, 10411, 21013, 44009}}, {10683, 17, 42176, {1, 3, 3, 5, 27, 9, 17, 85, 331, 369, 1219, 247, 1977, 12267, 1181, 18811, 54017}}, {10684, 17, 42182, {1, 3, 5, 9, 21, 57, 57, 175, 283, 639, 1155, 1595, 8187, 9981, 21451, 7525, 52751}}, {10685, 17, 42188, {1, 3, 1, 5, 27, 61, 95, 25, 271, 81, 1335, 2821, 7805, 10167, 13197, 58341, 62325}}, {10686, 17, 42203, {1, 1, 7, 3, 15, 31, 75, 5, 211, 663, 551, 963, 6015, 11907, 17045, 22863, 32389}}, {10687, 17, 42216, {1, 1, 7, 5, 21, 53, 67, 71, 251, 135, 1153, 2247, 2499, 15431, 21419, 46737, 2827}}, {10688, 17, 42219, {1, 1, 5, 3, 31, 25, 39, 209, 437, 791, 1595, 637, 1581, 6575, 26407, 24043, 11277}}, {10689, 17, 42227, {1, 3, 3, 5, 21, 15, 13, 19, 259, 949, 1237, 239, 5739, 4661, 3405, 55775, 58781}}, {10690, 17, 42234, {1, 1, 3, 5, 1, 63, 5, 197, 329, 625, 981, 913, 3957, 2765, 8801, 56675, 129511}}, {10691, 17, 42251, {1, 3, 3, 3, 29, 53, 65, 145, 435, 937, 787, 2043, 4945, 14585, 2789, 15771, 112335}}, {10692, 17, 42254, {1, 3, 7, 13, 3, 23, 33, 141, 131, 375, 739, 711, 897, 469, 3635, 43335, 3069}}, {10693, 17, 42256, {1, 1, 7, 11, 29, 13, 111, 149, 197, 793, 1541, 1879, 7683, 9397, 6873, 43733, 118507}}, {10694, 17, 42259, {1, 3, 7, 7, 29, 21, 97, 113, 139, 573, 1099, 2615, 5123, 13021, 9533, 57673, 79283}}, {10695, 17, 42282, {1, 3, 1, 5, 11, 9, 59, 89, 469, 797, 1119, 1037, 1667, 5947, 6051, 65045, 98275}}, {10696, 17, 42289, {1, 3, 3, 9, 11, 7, 51, 191, 321, 677, 1601, 681, 3579, 14441, 26579, 18019, 43065}}, {10697, 17, 42302, {1, 3, 5, 11, 7, 11, 79, 21, 335, 537, 801, 3553, 4311, 375, 7333, 64839, 88841}}, {10698, 17, 42307, {1, 3, 1, 7, 5, 11, 15, 163, 69, 645, 57, 3685, 5143, 8275, 12763, 25035, 68949}}, {10699, 17, 42310, {1, 1, 3, 13, 29, 33, 125, 179, 431, 129, 1367, 951, 5843, 13419, 13897, 17315, 58083}}, {10700, 17, 42322, {1, 1, 3, 11, 31, 33, 3, 7, 185, 821, 231, 869, 6147, 15243, 32029, 20295, 60871}}, {10701, 17, 42328, {1, 1, 1, 1, 31, 43, 21, 103, 275, 573, 805, 225, 2049, 8375, 32595, 53201, 126487}}, {10702, 17, 42338, {1, 1, 1, 9, 31, 29, 7, 91, 277, 937, 1223, 2435, 4335, 7861, 9647, 13577, 30059}}, {10703, 17, 42349, {1, 1, 1, 1, 23, 25, 69, 175, 293, 905, 765, 1527, 6655, 15431, 2511, 3147, 75431}}, {10704, 17, 42367, {1, 3, 3, 3, 15, 53, 109, 195, 87, 557, 1277, 1471, 7401, 14127, 11479, 41505, 769}}, {10705, 17, 42386, {1, 1, 5, 11, 23, 37, 121, 181, 199, 359, 1521, 2561, 3641, 7621, 14219, 6959, 77529}}, {10706, 17, 42398, {1, 3, 1, 11, 5, 7, 69, 199, 501, 251, 707, 1485, 8125, 3209, 30883, 40259, 85087}}, {10707, 17, 42404, {1, 3, 5, 13, 9, 35, 5, 133, 505, 39, 581, 1605, 6303, 1211, 27211, 55591, 31689}}, {10708, 17, 42413, {1, 1, 5, 3, 17, 7, 11, 61, 483, 59, 1569, 2583, 759, 5759, 3575, 44547, 89783}}, {10709, 17, 42419, {1, 1, 7, 15, 5, 27, 107, 5, 471, 421, 383, 3591, 3609, 13817, 633, 22043, 83119}}, {10710, 17, 42421, {1, 1, 3, 7, 27, 55, 61, 249, 37, 241, 1483, 2839, 1231, 4765, 1551, 55801, 129679}}, {10711, 17, 42422, {1, 1, 1, 3, 11, 1, 19, 207, 143, 351, 409, 721, 4597, 13389, 30297, 43253, 129923}}, {10712, 17, 42431, {1, 3, 3, 7, 7, 53, 83, 27, 167, 163, 537, 3871, 2459, 12813, 30019, 41131, 56109}}, {10713, 17, 42445, {1, 1, 5, 1, 23, 37, 11, 67, 161, 751, 123, 307, 3341, 12983, 21565, 58529, 94503}}, {10714, 17, 42448, {1, 3, 3, 15, 11, 33, 39, 195, 467, 647, 1479, 1197, 7949, 6501, 18375, 15263, 21121}}, {10715, 17, 42451, {1, 3, 5, 13, 3, 35, 9, 253, 299, 679, 69, 165, 2735, 14725, 4217, 16391, 107017}}, {10716, 17, 42454, {1, 1, 1, 15, 3, 11, 87, 87, 391, 515, 843, 3957, 1365, 13201, 15983, 53647, 35643}}, {10717, 17, 42458, {1, 1, 3, 7, 9, 53, 45, 221, 209, 855, 169, 2729, 1219, 5229, 14111, 28877, 114653}}, {10718, 17, 42470, {1, 1, 5, 3, 11, 17, 5, 93, 303, 785, 1895, 2483, 7399, 14031, 1007, 2743, 47307}}, {10719, 17, 42476, {1, 1, 7, 11, 9, 13, 115, 31, 223, 1011, 723, 1291, 5183, 559, 15881, 43045, 28131}}, {10720, 17, 42500, {1, 3, 7, 11, 7, 59, 85, 111, 79, 227, 691, 1597, 2453, 10023, 19255, 47781, 88351}}, {10721, 17, 42509, {1, 3, 3, 7, 21, 33, 39, 35, 253, 743, 563, 2455, 8015, 13403, 24883, 47881, 115559}}, {10722, 17, 42538, {1, 3, 1, 1, 5, 33, 69, 37, 225, 157, 1347, 3241, 4981, 15985, 9949, 49189, 21267}}, {10723, 17, 42543, {1, 1, 3, 11, 9, 33, 123, 133, 215, 297, 961, 1571, 1133, 1, 31871, 25253, 100097}}, {10724, 17, 42545, {1, 1, 1, 7, 13, 29, 101, 127, 113, 785, 1257, 525, 7397, 13143, 30315, 5969, 37829}}, {10725, 17, 42546, {1, 1, 1, 7, 29, 33, 17, 95, 439, 577, 1857, 423, 63, 15365, 4777, 59073, 7773}}, {10726, 17, 42563, {1, 1, 5, 15, 3, 17, 89, 133, 217, 601, 1979, 391, 105, 13709, 10081, 37725, 40957}}, {10727, 17, 42570, {1, 1, 1, 15, 25, 7, 85, 197, 155, 367, 1927, 2007, 2563, 13147, 2345, 28735, 88243}}, {10728, 17, 42580, {1, 3, 5, 3, 5, 33, 87, 153, 153, 779, 825, 2163, 385, 11663, 2005, 51261, 25893}}, {10729, 17, 42584, {1, 3, 5, 5, 23, 15, 19, 99, 71, 723, 523, 3683, 7773, 191, 17423, 30497, 129889}}, {10730, 17, 42589, {1, 1, 7, 11, 1, 3, 49, 119, 39, 661, 297, 27, 1575, 12145, 18519, 57285, 50059}}, {10731, 17, 42608, {1, 3, 7, 5, 7, 37, 75, 235, 403, 743, 603, 1689, 5031, 8871, 28241, 16917, 16947}}, {10732, 17, 42618, {1, 1, 5, 13, 17, 41, 67, 219, 237, 365, 833, 3521, 3211, 1037, 5657, 34789, 119739}}, {10733, 17, 42629, {1, 1, 5, 7, 3, 61, 89, 107, 335, 825, 803, 2445, 6861, 5421, 14585, 44037, 92711}}, {10734, 17, 42636, {1, 3, 7, 3, 19, 25, 81, 51, 101, 477, 1653, 2841, 6597, 9261, 30609, 15681, 48897}}, {10735, 17, 42639, {1, 1, 7, 11, 17, 1, 43, 39, 133, 513, 1839, 553, 6379, 4865, 28161, 7249, 80073}}, {10736, 17, 42644, {1, 1, 5, 5, 13, 45, 19, 225, 399, 679, 195, 3613, 413, 2901, 26749, 39971, 31435}}, {10737, 17, 42647, {1, 3, 7, 3, 23, 55, 57, 77, 447, 721, 677, 271, 6211, 12631, 5843, 35991, 82653}}, {10738, 17, 42651, {1, 1, 1, 1, 3, 63, 23, 195, 1, 1019, 723, 3865, 5913, 5491, 5495, 27483, 73637}}, {10739, 17, 42654, {1, 3, 1, 11, 17, 31, 27, 211, 411, 789, 1049, 2487, 2203, 6457, 7275, 4833, 14131}}, {10740, 17, 42658, {1, 1, 5, 15, 15, 13, 65, 155, 127, 753, 1605, 1859, 2873, 9197, 1763, 11969, 82971}}, {10741, 17, 42669, {1, 1, 3, 11, 11, 63, 13, 29, 31, 851, 251, 3231, 1227, 5513, 9785, 34659, 123811}}, {10742, 17, 42678, {1, 3, 5, 1, 19, 57, 41, 205, 91, 39, 989, 1897, 4789, 16071, 6507, 29363, 75773}}, {10743, 17, 42689, {1, 1, 1, 1, 5, 29, 113, 203, 53, 599, 1529, 1417, 7017, 9609, 4867, 17659, 80719}}, {10744, 17, 42695, {1, 3, 7, 9, 27, 17, 77, 25, 461, 511, 781, 2977, 7601, 3551, 23615, 57669, 119723}}, {10745, 17, 42696, {1, 3, 3, 9, 23, 43, 115, 21, 125, 237, 893, 1431, 7423, 3717, 4371, 36193, 30481}}, {10746, 17, 42710, {1, 1, 5, 13, 3, 37, 13, 239, 267, 665, 205, 2745, 3865, 12167, 26689, 999, 9355}}, {10747, 17, 42716, {1, 1, 1, 1, 31, 35, 55, 115, 387, 217, 657, 2827, 2963, 3687, 24271, 41701, 5911}}, {10748, 17, 42730, {1, 1, 3, 3, 27, 57, 41, 183, 351, 841, 1327, 719, 7043, 12503, 17953, 60719, 98223}}, {10749, 17, 42732, {1, 3, 1, 1, 27, 1, 119, 85, 197, 673, 1951, 2949, 4783, 561, 12807, 43355, 63397}}, {10750, 17, 42747, {1, 1, 7, 7, 17, 63, 109, 87, 303, 439, 529, 685, 111, 8405, 21249, 33803, 77927}}, {10751, 17, 42750, {1, 1, 7, 9, 11, 63, 27, 185, 445, 25, 1313, 3979, 4229, 8797, 10671, 33995, 84463}}, {10752, 17, 42752, {1, 1, 1, 15, 27, 63, 67, 237, 39, 993, 851, 4075, 3417, 1077, 11939, 31737, 93897}}, {10753, 17, 42761, {1, 1, 3, 5, 25, 9, 51, 241, 213, 661, 1135, 213, 7027, 5933, 24485, 65029, 8583}}, {10754, 17, 42772, {1, 3, 5, 11, 31, 1, 17, 237, 107, 1021, 279, 181, 1741, 11099, 7871, 63231, 64445}}, {10755, 17, 42776, {1, 3, 5, 9, 17, 21, 11, 45, 23, 409, 519, 1703, 5467, 9591, 13555, 23739, 73837}}, {10756, 17, 42779, {1, 3, 3, 15, 3, 39, 11, 157, 273, 241, 413, 1723, 3179, 2125, 16859, 5231, 122969}}, {10757, 17, 42797, {1, 3, 5, 11, 21, 27, 29, 243, 255, 1011, 1179, 3545, 3557, 8091, 31569, 10217, 108361}}, {10758, 17, 42815, {1, 1, 5, 9, 25, 33, 29, 67, 395, 123, 1405, 3855, 7481, 5601, 21231, 17099, 13399}}, {10759, 17, 42824, {1, 1, 5, 5, 13, 17, 111, 47, 77, 827, 577, 1767, 3367, 11719, 8801, 22431, 85451}}, {10760, 17, 42837, {1, 3, 7, 11, 11, 31, 17, 141, 149, 293, 55, 3459, 19, 13709, 29135, 62765, 66455}}, {10761, 17, 42844, {1, 1, 7, 15, 13, 19, 59, 211, 189, 773, 1791, 2089, 2857, 1635, 17777, 46585, 70115}}, {10762, 17, 42868, {1, 1, 5, 11, 29, 29, 15, 7, 93, 733, 1605, 3731, 2381, 1063, 15565, 25081, 46651}}, {10763, 17, 42877, {1, 3, 1, 9, 25, 5, 87, 113, 25, 93, 881, 1137, 3237, 10983, 14317, 25945, 121493}}, {10764, 17, 42888, {1, 1, 5, 11, 29, 47, 99, 111, 165, 453, 259, 2001, 7715, 2609, 15633, 40273, 2065}}, {10765, 17, 42891, {1, 1, 7, 13, 11, 29, 33, 255, 149, 361, 89, 2837, 49, 3033, 1917, 9029, 38123}}, {10766, 17, 42912, {1, 1, 1, 7, 27, 31, 105, 61, 469, 497, 1919, 3005, 3651, 2143, 24359, 8053, 103647}}, {10767, 17, 42918, {1, 1, 3, 13, 31, 63, 101, 47, 397, 89, 1915, 2385, 5399, 8897, 21001, 42997, 110333}}, {10768, 17, 42921, {1, 3, 7, 5, 29, 1, 5, 119, 493, 349, 153, 1839, 283, 14343, 12975, 55597, 89467}}, {10769, 17, 42927, {1, 3, 5, 3, 5, 51, 71, 227, 63, 799, 745, 1387, 2435, 1003, 27937, 43421, 12279}}, {10770, 17, 42949, {1, 3, 3, 7, 7, 31, 37, 61, 11, 175, 581, 1583, 4737, 3087, 10335, 60683, 57085}}, {10771, 17, 42953, {1, 3, 1, 1, 1, 63, 59, 47, 417, 35, 1673, 3277, 1873, 14981, 22463, 26835, 91115}}, {10772, 17, 42967, {1, 1, 7, 5, 15, 23, 115, 13, 253, 583, 219, 1307, 1189, 9891, 641, 20841, 87133}}, {10773, 17, 42974, {1, 1, 5, 11, 1, 3, 71, 235, 429, 335, 1649, 1775, 3077, 13723, 3209, 19807, 7283}}, {10774, 17, 42989, {1, 1, 7, 1, 31, 49, 39, 141, 127, 63, 1561, 2559, 7661, 4825, 9419, 15327, 87145}}, {10775, 17, 42995, {1, 1, 5, 3, 17, 33, 51, 219, 467, 151, 161, 3301, 7509, 2235, 30371, 64031, 62741}}, {10776, 17, 42997, {1, 3, 1, 3, 23, 63, 43, 29, 399, 279, 271, 3537, 1863, 1811, 14917, 28247, 34807}}, {10777, 17, 43007, {1, 1, 3, 5, 13, 29, 37, 151, 129, 19, 149, 2145, 5363, 6835, 19655, 1207, 74527}}, {10778, 17, 43018, {1, 3, 5, 7, 27, 35, 63, 53, 247, 987, 1767, 483, 3489, 1711, 10763, 6981, 78251}}, {10779, 17, 43025, {1, 1, 3, 1, 15, 47, 83, 147, 375, 539, 1623, 29, 4599, 7981, 23533, 64659, 48753}}, {10780, 17, 43031, {1, 1, 1, 9, 21, 17, 85, 45, 167, 469, 1319, 2969, 1605, 1405, 9961, 28829, 125757}}, {10781, 17, 43032, {1, 3, 1, 11, 3, 45, 43, 159, 301, 579, 1821, 701, 1149, 457, 16601, 49377, 99845}}, {10782, 17, 43038, {1, 1, 7, 13, 11, 7, 37, 227, 345, 973, 1167, 1247, 5109, 10917, 3029, 60065, 127347}}, {10783, 17, 43041, {1, 1, 3, 5, 3, 63, 95, 233, 495, 225, 1225, 3451, 7731, 14677, 10437, 1417, 33293}}, {10784, 17, 43054, {1, 1, 7, 15, 1, 3, 3, 171, 201, 1009, 1481, 587, 7661, 10085, 4961, 46415, 28573}}, {10785, 17, 43074, {1, 1, 5, 1, 3, 45, 67, 79, 463, 733, 2007, 2811, 2943, 14857, 23469, 14479, 97875}}, {10786, 17, 43085, {1, 1, 1, 5, 19, 1, 29, 29, 447, 173, 1081, 153, 5343, 5707, 1357, 30169, 122527}}, {10787, 17, 43097, {1, 1, 1, 5, 15, 57, 33, 129, 71, 717, 173, 3271, 4741, 13211, 28321, 56793, 119833}}, {10788, 17, 43098, {1, 3, 3, 9, 9, 41, 47, 71, 103, 713, 725, 1335, 5261, 13835, 17619, 47429, 69815}}, {10789, 17, 43110, {1, 3, 3, 15, 7, 3, 71, 25, 75, 967, 1037, 3585, 3407, 9979, 2195, 51087, 126535}}, {10790, 17, 43119, {1, 3, 3, 11, 25, 7, 25, 249, 473, 339, 1211, 3503, 4343, 9707, 26127, 62061, 52479}}, {10791, 17, 43131, {1, 1, 3, 3, 27, 9, 79, 197, 207, 845, 377, 3231, 5177, 899, 19497, 41187, 105897}}, {10792, 17, 43143, {1, 3, 5, 15, 5, 27, 65, 151, 207, 677, 713, 2495, 681, 15341, 5389, 51965, 43761}}, {10793, 17, 43144, {1, 3, 3, 11, 19, 11, 55, 189, 291, 183, 1345, 2677, 791, 2391, 25771, 55147, 24223}}, {10794, 17, 43152, {1, 1, 3, 11, 31, 59, 29, 5, 275, 483, 1361, 1527, 3019, 245, 17667, 57905, 41329}}, {10795, 17, 43157, {1, 3, 3, 9, 7, 19, 83, 71, 147, 999, 793, 3535, 1931, 12817, 2707, 45735, 31311}}, {10796, 17, 43178, {1, 1, 5, 7, 5, 1, 117, 247, 127, 1011, 1441, 2449, 4095, 12239, 4743, 64781, 32621}}, {10797, 17, 43180, {1, 3, 1, 11, 19, 57, 43, 39, 97, 485, 951, 989, 5975, 5219, 14421, 43681, 37305}}, {10798, 17, 43192, {1, 1, 5, 15, 7, 49, 113, 161, 199, 545, 1113, 3821, 2019, 8747, 4085, 50823, 31955}}, {10799, 17, 43197, {1, 3, 3, 3, 19, 41, 47, 191, 403, 25, 2043, 3489, 6263, 4843, 12961, 63791, 5027}}, {10800, 17, 43203, {1, 1, 7, 1, 25, 55, 5, 51, 121, 273, 973, 3893, 1771, 9373, 21927, 29353, 95935}}, {10801, 17, 43220, {1, 3, 3, 3, 27, 1, 97, 63, 445, 179, 481, 2995, 3123, 4687, 24359, 35973, 74535}}, {10802, 17, 43236, {1, 1, 5, 1, 29, 23, 117, 183, 197, 819, 695, 641, 4155, 13593, 30965, 41407, 42433}}, {10803, 17, 43245, {1, 3, 5, 1, 23, 53, 61, 253, 87, 487, 1995, 1281, 3367, 15047, 3493, 41711, 53407}}, {10804, 17, 43246, {1, 1, 1, 9, 27, 49, 83, 21, 63, 181, 1661, 1649, 281, 12141, 25771, 35563, 42643}}, {10805, 17, 43260, {1, 3, 5, 13, 15, 59, 121, 113, 379, 487, 1929, 3725, 2477, 6527, 8619, 64869, 57103}}, {10806, 17, 43265, {1, 3, 1, 7, 27, 39, 69, 93, 193, 395, 433, 2091, 151, 6921, 11599, 36143, 41179}}, {10807, 17, 43271, {1, 1, 7, 1, 31, 33, 73, 199, 57, 37, 1387, 3505, 7919, 3507, 2855, 8239, 84527}}, {10808, 17, 43285, {1, 1, 7, 5, 15, 5, 119, 253, 263, 785, 1409, 1485, 3675, 5515, 13057, 30323, 98015}}, {10809, 17, 43286, {1, 3, 1, 1, 11, 5, 57, 83, 365, 703, 1923, 1397, 1103, 4015, 13123, 47093, 113793}}, {10810, 17, 43290, {1, 3, 3, 1, 5, 61, 29, 173, 189, 999, 897, 3389, 6745, 1487, 2349, 59105, 107407}}, {10811, 17, 43299, {1, 1, 1, 1, 17, 51, 65, 1, 249, 863, 399, 3819, 2485, 12215, 12365, 58909, 25559}}, {10812, 17, 43314, {1, 3, 7, 1, 31, 39, 43, 219, 51, 13, 779, 505, 2259, 14571, 9049, 21555, 11869}}, {10813, 17, 43323, {1, 1, 7, 7, 13, 5, 97, 85, 111, 511, 587, 63, 2395, 8099, 26223, 757, 119821}}, {10814, 17, 43337, {1, 3, 3, 5, 5, 19, 113, 35, 101, 41, 499, 1313, 6489, 6793, 31435, 45007, 95691}}, {10815, 17, 43348, {1, 3, 5, 15, 19, 37, 103, 187, 347, 667, 1957, 1825, 7447, 12359, 21779, 52749, 18679}}, {10816, 17, 43355, {1, 3, 5, 5, 17, 19, 19, 193, 435, 379, 439, 2093, 725, 2133, 15659, 54645, 59567}}, {10817, 17, 43357, {1, 3, 7, 3, 23, 35, 33, 13, 23, 349, 231, 1635, 1625, 5039, 21299, 36413, 104681}}, {10818, 17, 43358, {1, 1, 3, 13, 23, 49, 15, 253, 509, 9, 411, 2157, 3737, 11227, 6021, 42919, 100375}}, {10819, 17, 43361, {1, 1, 7, 1, 17, 11, 33, 167, 219, 63, 137, 741, 4193, 16149, 9657, 50223, 85213}}, {10820, 17, 43362, {1, 3, 7, 11, 23, 59, 113, 149, 427, 697, 1723, 255, 201, 10081, 1079, 323, 109091}}, {10821, 17, 43364, {1, 3, 3, 15, 11, 9, 89, 39, 67, 249, 1939, 1737, 3719, 10515, 16517, 22345, 83959}}, {10822, 17, 43368, {1, 3, 3, 13, 5, 33, 127, 9, 329, 429, 563, 1579, 4427, 8343, 22083, 5035, 124915}}, {10823, 17, 43376, {1, 1, 1, 5, 15, 57, 121, 171, 315, 983, 743, 2015, 2421, 12431, 2561, 13331, 73163}}, {10824, 17, 43385, {1, 1, 3, 9, 1, 39, 85, 159, 23, 979, 1467, 231, 4231, 3669, 16747, 24195, 46745}}, {10825, 17, 43386, {1, 1, 3, 7, 3, 11, 65, 67, 85, 455, 365, 2279, 3471, 12771, 14443, 42773, 28723}}, {10826, 17, 43391, {1, 3, 5, 1, 13, 9, 105, 237, 103, 59, 1301, 3125, 509, 12669, 3893, 9775, 81303}}, {10827, 17, 43397, {1, 1, 3, 11, 19, 9, 125, 23, 191, 979, 533, 429, 3239, 15013, 13833, 40689, 102827}}, {10828, 17, 43431, {1, 3, 3, 7, 15, 5, 83, 243, 467, 913, 1279, 3889, 8049, 8357, 5957, 39073, 93521}}, {10829, 17, 43438, {1, 3, 3, 3, 19, 5, 123, 77, 289, 57, 2001, 807, 5257, 1671, 20273, 10183, 128439}}, {10830, 17, 43440, {1, 1, 7, 13, 19, 45, 25, 47, 135, 929, 1353, 2731, 3351, 7637, 27037, 58835, 50285}}, {10831, 17, 43452, {1, 3, 1, 1, 13, 55, 55, 197, 409, 93, 1351, 161, 1885, 5913, 27937, 49793, 84541}}, {10832, 17, 43463, {1, 1, 3, 7, 29, 21, 113, 179, 203, 533, 1471, 2035, 447, 6781, 28729, 31099, 23027}}, {10833, 17, 43470, {1, 1, 3, 11, 27, 3, 5, 209, 367, 945, 749, 3637, 2881, 8139, 27875, 34223, 97263}}, {10834, 17, 43478, {1, 3, 5, 13, 25, 27, 35, 3, 13, 707, 303, 3663, 6617, 13501, 25537, 33077, 71485}}, {10835, 17, 43481, {1, 1, 7, 15, 11, 29, 65, 47, 235, 635, 133, 153, 6175, 2961, 8171, 28641, 122589}}, {10836, 17, 43488, {1, 1, 5, 15, 17, 41, 85, 147, 323, 673, 1629, 3477, 3341, 16373, 13901, 60961, 39451}}, {10837, 17, 43491, {1, 3, 1, 15, 29, 15, 37, 109, 293, 863, 1835, 1173, 2263, 13815, 24995, 6989, 103417}}, {10838, 17, 43506, {1, 3, 3, 15, 3, 31, 23, 47, 15, 717, 1457, 1067, 6229, 7051, 21771, 54815, 115827}}, {10839, 17, 43512, {1, 1, 1, 13, 21, 3, 45, 239, 89, 603, 407, 781, 8095, 7389, 18035, 32229, 39867}}, {10840, 17, 43539, {1, 1, 3, 7, 7, 59, 79, 51, 411, 917, 803, 2455, 2623, 12413, 23957, 44199, 67903}}, {10841, 17, 43567, {1, 3, 1, 9, 17, 37, 117, 47, 101, 733, 1861, 1111, 6785, 13743, 24371, 49427, 54711}}, {10842, 17, 43579, {1, 3, 1, 15, 27, 63, 107, 33, 351, 287, 1765, 1947, 6209, 8127, 30007, 18757, 31453}}, {10843, 17, 43584, {1, 3, 5, 13, 11, 13, 29, 247, 7, 609, 1235, 1767, 5365, 12673, 10151, 51579, 106407}}, {10844, 17, 43601, {1, 3, 7, 15, 5, 25, 81, 197, 51, 615, 1695, 259, 7983, 1403, 7903, 21441, 73263}}, {10845, 17, 43614, {1, 1, 5, 1, 13, 61, 55, 175, 445, 3, 1957, 1171, 6823, 4285, 11847, 12789, 79787}}, {10846, 17, 43617, {1, 1, 5, 15, 17, 51, 111, 201, 45, 97, 45, 2533, 1125, 3663, 13685, 45719, 51497}}, {10847, 17, 43623, {1, 3, 3, 13, 29, 59, 111, 97, 381, 477, 1229, 3709, 5185, 7055, 32729, 32881, 25539}}, {10848, 17, 43630, {1, 3, 1, 9, 1, 39, 57, 143, 189, 625, 1717, 1755, 3129, 807, 27975, 15511, 66123}}, {10849, 17, 43647, {1, 3, 3, 1, 5, 41, 25, 27, 163, 397, 1595, 2325, 1803, 12439, 25743, 24509, 72613}}, {10850, 17, 43658, {1, 1, 5, 13, 29, 41, 125, 113, 367, 709, 1911, 669, 831, 5375, 31145, 26197, 33543}}, {10851, 17, 43663, {1, 1, 5, 1, 1, 5, 91, 199, 133, 273, 393, 1179, 717, 12791, 17693, 6905, 20433}}, {10852, 17, 43665, {1, 1, 3, 15, 29, 35, 9, 127, 383, 673, 1821, 2765, 2425, 11789, 19741, 43189, 99557}}, {10853, 17, 43691, {1, 1, 7, 13, 9, 19, 119, 103, 11, 983, 623, 391, 1609, 2333, 19843, 28269, 41237}}, {10854, 17, 43701, {1, 3, 7, 5, 29, 3, 13, 213, 387, 361, 749, 669, 1625, 5687, 11369, 38119, 38389}}, {10855, 17, 43705, {1, 3, 5, 13, 13, 51, 47, 33, 1, 979, 1817, 2633, 7181, 47, 3603, 49211, 4377}}, {10856, 17, 43708, {1, 3, 1, 1, 11, 63, 5, 249, 13, 805, 1097, 1449, 5235, 16299, 25855, 30949, 3013}}, {10857, 17, 43719, {1, 3, 7, 9, 29, 35, 89, 135, 475, 945, 999, 771, 6023, 13317, 32611, 43971, 10393}}, {10858, 17, 43731, {1, 1, 1, 5, 23, 3, 37, 117, 95, 985, 1599, 2191, 3617, 5831, 31113, 10873, 112219}}, {10859, 17, 43737, {1, 3, 5, 7, 11, 15, 55, 65, 239, 365, 1209, 3509, 8101, 8619, 24775, 65291, 50589}}, {10860, 17, 43740, {1, 1, 7, 9, 21, 19, 123, 83, 317, 717, 433, 31, 2597, 14723, 28839, 7817, 126123}}, {10861, 17, 43747, {1, 1, 7, 11, 3, 33, 99, 39, 227, 279, 353, 1921, 7883, 16187, 5157, 41121, 89425}}, {10862, 17, 43749, {1, 3, 5, 9, 25, 7, 29, 165, 129, 77, 159, 923, 1357, 1159, 23537, 58087, 56443}}, {10863, 17, 43750, {1, 1, 7, 3, 13, 51, 45, 161, 27, 41, 1295, 2937, 7223, 5271, 17927, 23311, 2543}}, {10864, 17, 43754, {1, 1, 1, 1, 11, 53, 119, 165, 409, 785, 1649, 3587, 259, 10997, 3171, 31271, 104631}}, {10865, 17, 43764, {1, 1, 5, 7, 5, 7, 49, 201, 373, 825, 1755, 3751, 8041, 8133, 21347, 12039, 3049}}, {10866, 17, 43767, {1, 1, 1, 3, 7, 29, 103, 1, 473, 65, 761, 1611, 5121, 14345, 32535, 16679, 11321}}, {10867, 17, 43768, {1, 3, 3, 11, 21, 57, 35, 63, 237, 415, 1943, 483, 5377, 14647, 23433, 45459, 32535}}, {10868, 17, 43773, {1, 1, 1, 15, 21, 57, 7, 103, 493, 279, 665, 3699, 169, 7619, 3571, 11539, 31983}}, {10869, 17, 43785, {1, 1, 1, 1, 9, 5, 81, 159, 105, 927, 379, 1133, 1805, 14341, 9833, 63151, 70877}}, {10870, 17, 43788, {1, 1, 7, 5, 19, 5, 63, 127, 129, 43, 757, 2215, 3899, 643, 19731, 17345, 102611}}, {10871, 17, 43810, {1, 3, 7, 7, 27, 21, 3, 69, 475, 283, 319, 833, 3683, 11275, 18191, 44027, 24901}}, {10872, 17, 43819, {1, 1, 5, 5, 31, 25, 63, 33, 505, 765, 257, 1147, 779, 12505, 19971, 24695, 65935}}, {10873, 17, 43834, {1, 1, 1, 15, 23, 33, 31, 107, 59, 639, 1307, 3211, 6171, 15665, 16775, 61671, 25569}}, {10874, 17, 43853, {1, 3, 3, 9, 31, 3, 113, 199, 425, 895, 1051, 2125, 1525, 15199, 14845, 4213, 18449}}, {10875, 17, 43866, {1, 3, 5, 3, 3, 11, 75, 121, 33, 265, 459, 3879, 909, 6533, 18451, 32421, 117427}}, {10876, 17, 43871, {1, 1, 1, 9, 11, 9, 125, 175, 309, 847, 959, 2013, 1557, 9291, 2963, 43275, 9917}}, {10877, 17, 43872, {1, 1, 5, 3, 15, 39, 67, 35, 373, 601, 463, 1263, 1615, 15059, 31011, 36059, 114493}}, {10878, 17, 43881, {1, 1, 5, 15, 5, 43, 49, 239, 461, 171, 1863, 2249, 2923, 15897, 22941, 29925, 21429}}, {10879, 17, 43889, {1, 1, 1, 15, 13, 31, 127, 205, 361, 149, 1641, 1443, 5959, 13183, 13861, 9533, 1011}}, {10880, 17, 43902, {1, 1, 3, 13, 9, 49, 39, 67, 165, 695, 611, 2261, 3425, 6247, 23575, 51833, 106167}}, {10881, 17, 43926, {1, 1, 7, 9, 29, 21, 75, 251, 87, 263, 2035, 1007, 3821, 12719, 8889, 47901, 39037}}, {10882, 17, 43935, {1, 3, 1, 3, 15, 51, 79, 127, 201, 497, 1881, 3841, 1821, 14435, 4933, 6853, 104305}}, {10883, 17, 43946, {1, 1, 5, 11, 23, 47, 33, 109, 481, 585, 333, 2525, 593, 1625, 5787, 23839, 30647}}, {10884, 17, 43951, {1, 1, 5, 1, 17, 3, 7, 43, 113, 873, 1433, 3377, 45, 831, 17015, 21479, 7257}}, {10885, 17, 43953, {1, 1, 1, 1, 13, 21, 59, 159, 279, 871, 53, 3647, 2599, 12417, 25807, 6867, 18251}}, {10886, 17, 43971, {1, 1, 5, 9, 29, 61, 7, 81, 353, 761, 269, 4047, 3051, 8385, 2919, 18875, 15239}}, {10887, 17, 44008, {1, 1, 7, 13, 31, 17, 71, 103, 107, 655, 1263, 849, 1809, 349, 3239, 45381, 117451}}, {10888, 17, 44011, {1, 1, 5, 9, 27, 45, 83, 207, 117, 77, 437, 523, 851, 13595, 12381, 27271, 59951}}, {10889, 17, 44026, {1, 3, 3, 15, 3, 33, 103, 217, 61, 443, 1077, 2887, 1751, 11111, 465, 37051, 89687}}, {10890, 17, 44033, {1, 1, 1, 5, 15, 15, 13, 115, 275, 565, 1257, 1067, 6561, 8143, 2149, 53169, 123637}}, {10891, 17, 44048, {1, 3, 3, 15, 27, 63, 25, 191, 143, 103, 1247, 1053, 2469, 9823, 4437, 18195, 91751}}, {10892, 17, 44057, {1, 1, 7, 11, 1, 63, 31, 103, 249, 861, 983, 335, 35, 4291, 16307, 43669, 68065}}, {10893, 17, 44058, {1, 3, 1, 15, 13, 29, 51, 145, 177, 851, 39, 3531, 4477, 4243, 3301, 64293, 15741}}, {10894, 17, 44067, {1, 1, 7, 3, 29, 45, 5, 85, 185, 191, 1007, 3085, 2177, 14911, 18319, 265, 25435}}, {10895, 17, 44081, {1, 1, 5, 9, 9, 57, 47, 143, 217, 947, 2021, 1835, 4773, 15145, 26519, 46407, 103667}}, {10896, 17, 44087, {1, 3, 1, 11, 1, 7, 51, 75, 207, 757, 89, 1289, 39, 15641, 9477, 28503, 47113}}, {10897, 17, 44099, {1, 3, 1, 11, 9, 19, 21, 197, 429, 121, 813, 3447, 6091, 3167, 5401, 27791, 26499}}, {10898, 17, 44105, {1, 1, 7, 15, 1, 15, 85, 247, 3, 111, 433, 3103, 5049, 7929, 22645, 53247, 53417}}, {10899, 17, 44106, {1, 1, 7, 7, 27, 19, 125, 101, 269, 7, 777, 1289, 1429, 11561, 18043, 3601, 125857}}, {10900, 17, 44114, {1, 1, 1, 13, 11, 9, 127, 231, 239, 435, 1291, 4025, 1049, 15549, 7577, 51147, 38121}}, {10901, 17, 44116, {1, 1, 7, 3, 9, 55, 57, 137, 387, 565, 873, 1417, 5993, 4849, 1731, 51653, 105697}}, {10902, 17, 44130, {1, 1, 7, 9, 7, 47, 115, 119, 325, 881, 1687, 1009, 7007, 12541, 6737, 28471, 7369}}, {10903, 17, 44139, {1, 3, 1, 1, 11, 47, 25, 163, 399, 977, 1777, 727, 5575, 1311, 23843, 2199, 93229}}, {10904, 17, 44141, {1, 1, 7, 5, 13, 19, 53, 123, 439, 585, 1977, 3387, 5305, 1463, 14307, 9519, 537}}, {10905, 17, 44153, {1, 1, 7, 15, 1, 53, 13, 213, 323, 699, 1585, 3499, 2441, 3055, 31263, 63923, 9779}}, {10906, 17, 44159, {1, 1, 5, 5, 21, 43, 123, 43, 475, 521, 1301, 3185, 5627, 7443, 1195, 39485, 113125}}, {10907, 17, 44160, {1, 1, 5, 7, 9, 3, 39, 5, 237, 719, 1743, 1153, 6401, 14701, 5503, 38491, 24123}}, {10908, 17, 44170, {1, 3, 5, 9, 17, 33, 117, 23, 409, 63, 1829, 2587, 3489, 3209, 4775, 40069, 4721}}, {10909, 17, 44172, {1, 3, 3, 5, 21, 63, 95, 231, 25, 167, 1181, 813, 4591, 5227, 21999, 19633, 37547}}, {10910, 17, 44187, {1, 1, 7, 11, 13, 9, 13, 147, 239, 951, 1247, 1199, 7907, 12493, 25371, 1917, 107499}}, {10911, 17, 44190, {1, 1, 5, 15, 3, 49, 31, 103, 189, 561, 1763, 3941, 3525, 3165, 7789, 57729, 92635}}, {10912, 17, 44193, {1, 1, 1, 5, 3, 61, 107, 163, 465, 631, 1519, 169, 4469, 8153, 11039, 247, 37657}}, {10913, 17, 44199, {1, 3, 1, 5, 9, 37, 51, 195, 465, 975, 169, 1077, 995, 2669, 7663, 28997, 25779}}, {10914, 17, 44213, {1, 1, 7, 13, 7, 37, 3, 117, 147, 335, 629, 4077, 5855, 2893, 5629, 55075, 83359}}, {10915, 17, 44218, {1, 1, 5, 9, 9, 25, 53, 63, 315, 287, 1833, 1397, 2395, 5719, 6719, 18003, 101073}}, {10916, 17, 44223, {1, 1, 7, 1, 13, 19, 13, 81, 497, 399, 413, 2411, 3915, 14037, 19735, 4587, 69655}}, {10917, 17, 44235, {1, 3, 1, 7, 5, 61, 101, 209, 299, 729, 1359, 4013, 2057, 8439, 8113, 57417, 8951}}, {10918, 17, 44243, {1, 3, 5, 7, 29, 21, 67, 73, 107, 359, 1655, 3729, 4403, 10467, 28103, 10261, 74651}}, {10919, 17, 44262, {1, 1, 1, 9, 3, 39, 25, 91, 287, 497, 1743, 339, 4739, 1709, 16351, 45385, 64693}}, {10920, 17, 44283, {1, 3, 1, 1, 7, 13, 41, 93, 49, 285, 997, 891, 4353, 4249, 11269, 36935, 71249}}, {10921, 17, 44291, {1, 3, 3, 13, 13, 23, 97, 231, 101, 93, 1183, 201, 6795, 16287, 30707, 20845, 105873}}, {10922, 17, 44293, {1, 1, 1, 9, 7, 57, 123, 167, 451, 245, 1887, 1839, 2967, 2387, 15075, 11877, 629}}, {10923, 17, 44308, {1, 3, 3, 1, 13, 13, 83, 41, 219, 313, 1743, 1265, 4435, 11731, 17625, 64235, 24865}}, {10924, 17, 44327, {1, 3, 1, 9, 13, 17, 109, 235, 387, 581, 887, 1071, 603, 10955, 5001, 8419, 20997}}, {10925, 17, 44341, {1, 3, 1, 5, 31, 55, 1, 219, 27, 623, 1425, 1309, 5409, 9633, 3231, 15029, 22989}}, {10926, 17, 44346, {1, 3, 3, 13, 25, 47, 23, 223, 283, 189, 1665, 3743, 387, 1807, 16919, 8511, 15933}}, {10927, 17, 44348, {1, 1, 1, 1, 13, 11, 81, 59, 423, 1007, 317, 2761, 2617, 9715, 24853, 63585, 77083}}, {10928, 17, 44354, {1, 3, 1, 3, 3, 11, 103, 123, 401, 467, 1159, 2725, 3275, 15513, 2281, 21617, 87211}}, {10929, 17, 44366, {1, 1, 5, 7, 23, 17, 25, 83, 11, 901, 809, 3233, 3929, 8685, 7609, 50949, 104841}}, {10930, 17, 44368, {1, 3, 7, 1, 15, 33, 37, 245, 275, 453, 729, 721, 1589, 5417, 29839, 57315, 67227}}, {10931, 17, 44373, {1, 3, 7, 3, 21, 17, 51, 213, 225, 471, 1201, 931, 1229, 9503, 5507, 4057, 7737}}, {10932, 17, 44384, {1, 3, 1, 11, 29, 55, 19, 193, 9, 151, 597, 1377, 827, 8549, 1293, 10963, 86183}}, {10933, 17, 44390, {1, 3, 3, 15, 17, 23, 89, 47, 195, 333, 2001, 1001, 6715, 9797, 21631, 5723, 88847}}, {10934, 17, 44393, {1, 3, 5, 9, 21, 33, 111, 101, 503, 513, 785, 1947, 1139, 7921, 13189, 34831, 80963}}, {10935, 17, 44394, {1, 3, 3, 13, 9, 61, 35, 39, 451, 485, 661, 1993, 4705, 9477, 32541, 16553, 33167}}, {10936, 17, 44399, {1, 3, 3, 9, 29, 37, 115, 87, 367, 325, 539, 1975, 6769, 1453, 31099, 3335, 16939}}, {10937, 17, 44401, {1, 1, 1, 7, 15, 21, 113, 203, 97, 847, 625, 847, 1819, 1109, 14503, 25319, 100259}}, {10938, 17, 44408, {1, 1, 5, 11, 9, 13, 65, 21, 429, 865, 513, 2183, 3785, 11817, 6283, 23041, 7969}}, {10939, 17, 44411, {1, 1, 5, 13, 1, 41, 109, 43, 91, 211, 1477, 3543, 5217, 3133, 12503, 15523, 12917}}, {10940, 17, 44417, {1, 3, 7, 9, 23, 53, 109, 89, 229, 939, 1211, 2771, 541, 15915, 5411, 47273, 54453}}, {10941, 17, 44420, {1, 1, 1, 3, 3, 45, 31, 63, 99, 347, 17, 523, 441, 12325, 15673, 1887, 15289}}, {10942, 17, 44424, {1, 1, 1, 7, 29, 61, 35, 115, 345, 1011, 5, 595, 465, 3897, 28147, 791, 98757}}, {10943, 17, 44444, {1, 1, 5, 9, 27, 1, 21, 155, 467, 469, 1565, 1439, 5809, 851, 32503, 3025, 97231}}, {10944, 17, 44451, {1, 1, 1, 9, 3, 17, 15, 73, 487, 1011, 63, 2605, 6647, 9385, 4527, 21993, 19783}}, {10945, 17, 44453, {1, 1, 3, 9, 17, 17, 65, 75, 175, 897, 1317, 2593, 1495, 15835, 12025, 57457, 29577}}, {10946, 17, 44466, {1, 1, 1, 13, 7, 1, 13, 145, 491, 427, 375, 1235, 3045, 2991, 26607, 30581, 43377}}, {10947, 17, 44472, {1, 1, 1, 1, 31, 1, 75, 235, 345, 75, 1505, 1401, 6921, 6207, 13729, 21545, 34703}}, {10948, 17, 44475, {1, 3, 7, 9, 31, 35, 53, 233, 85, 385, 2045, 1401, 5365, 827, 13093, 41097, 97381}}, {10949, 17, 44486, {1, 3, 7, 15, 5, 9, 19, 125, 49, 29, 1553, 675, 3947, 4775, 8161, 12321, 55191}}, {10950, 17, 44500, {1, 3, 3, 7, 17, 17, 27, 237, 87, 927, 275, 1965, 4993, 1429, 31613, 38403, 119319}}, {10951, 17, 44510, {1, 3, 7, 13, 25, 61, 87, 133, 37, 725, 697, 371, 7607, 13861, 8015, 63997, 25745}}, {10952, 17, 44531, {1, 1, 5, 3, 1, 29, 115, 53, 355, 533, 1711, 3863, 6983, 4849, 15787, 38933, 100299}}, {10953, 17, 44534, {1, 1, 3, 5, 7, 11, 95, 21, 363, 1005, 425, 3497, 841, 8251, 11933, 47783, 122699}}, {10954, 17, 44553, {1, 1, 1, 11, 15, 41, 23, 159, 191, 433, 919, 3151, 5311, 2061, 11277, 4947, 10549}}, {10955, 17, 44559, {1, 1, 5, 1, 29, 57, 23, 239, 179, 821, 1825, 1745, 4357, 4041, 27517, 8557, 86969}}, {10956, 17, 44564, {1, 3, 1, 13, 3, 45, 91, 21, 221, 203, 683, 1787, 375, 4101, 13555, 43269, 8063}}, {10957, 17, 44580, {1, 1, 5, 15, 17, 61, 95, 95, 285, 597, 1967, 4061, 389, 3813, 6061, 50261, 56035}}, {10958, 17, 44583, {1, 1, 7, 9, 9, 35, 103, 255, 239, 77, 145, 4089, 757, 16151, 29963, 1229, 31895}}, {10959, 17, 44589, {1, 1, 7, 7, 29, 51, 63, 105, 55, 609, 665, 2101, 4605, 7085, 18543, 64221, 102503}}, {10960, 17, 44592, {1, 1, 3, 9, 23, 49, 83, 71, 191, 917, 39, 1013, 4689, 2407, 1733, 31113, 31263}}, {10961, 17, 44609, {1, 1, 5, 11, 31, 51, 17, 223, 325, 829, 541, 3561, 5319, 15397, 12479, 57199, 38611}}, {10962, 17, 44627, {1, 3, 1, 3, 19, 57, 19, 191, 427, 905, 1111, 695, 5447, 4061, 25543, 45699, 113283}}, {10963, 17, 44633, {1, 1, 3, 7, 5, 11, 59, 249, 375, 889, 563, 2757, 5857, 3595, 23183, 1785, 105017}}, {10964, 17, 44643, {1, 3, 5, 7, 11, 55, 95, 167, 27, 823, 903, 2403, 1137, 3209, 6313, 61871, 129865}}, {10965, 17, 44646, {1, 1, 3, 11, 25, 3, 89, 171, 209, 409, 1357, 3825, 5261, 10805, 13493, 3303, 129987}}, {10966, 17, 44650, {1, 1, 5, 1, 23, 21, 3, 207, 471, 375, 1785, 2555, 1613, 16235, 1585, 48221, 10197}}, {10967, 17, 44674, {1, 1, 1, 15, 13, 33, 89, 185, 331, 239, 1401, 789, 2687, 15193, 20911, 18935, 28751}}, {10968, 17, 44676, {1, 1, 1, 13, 27, 19, 111, 139, 385, 531, 1069, 2343, 7405, 10305, 7049, 48215, 77591}}, {10969, 17, 44680, {1, 3, 7, 13, 23, 9, 113, 107, 441, 265, 1617, 63, 7629, 5505, 7059, 47307, 82527}}, {10970, 17, 44683, {1, 3, 1, 9, 27, 27, 35, 233, 189, 517, 1285, 1843, 1569, 14921, 6617, 44337, 46917}}, {10971, 17, 44703, {1, 1, 3, 15, 7, 15, 9, 255, 109, 629, 437, 3601, 6591, 10873, 1765, 46459, 110991}}, {10972, 17, 44704, {1, 1, 5, 15, 17, 13, 115, 97, 401, 979, 1139, 2607, 6537, 5369, 17775, 7657, 57175}}, {10973, 17, 44716, {1, 1, 5, 15, 27, 15, 43, 95, 271, 945, 1205, 3505, 7403, 13203, 27259, 24821, 62921}}, {10974, 17, 44733, {1, 1, 7, 15, 9, 13, 53, 177, 93, 169, 1933, 1101, 4847, 15477, 22107, 13009, 93675}}, {10975, 17, 44748, {1, 3, 1, 3, 13, 57, 121, 229, 353, 449, 769, 1207, 557, 5673, 13129, 29383, 35925}}, {10976, 17, 44759, {1, 3, 3, 1, 31, 33, 5, 87, 461, 873, 795, 2715, 1421, 14723, 17917, 20681, 46103}}, {10977, 17, 44763, {1, 1, 7, 3, 29, 5, 49, 215, 341, 25, 1473, 177, 1443, 14181, 26723, 49143, 73461}}, {10978, 17, 44781, {1, 3, 1, 5, 17, 53, 5, 27, 1, 325, 1335, 2941, 7195, 8179, 26971, 63469, 49357}}, {10979, 17, 44782, {1, 3, 5, 3, 3, 5, 29, 241, 119, 415, 1371, 3201, 2815, 15567, 32521, 18635, 2101}}, {10980, 17, 44789, {1, 3, 1, 3, 7, 13, 127, 157, 271, 403, 187, 3663, 4073, 12613, 1305, 31061, 48361}}, {10981, 17, 44794, {1, 1, 3, 5, 1, 39, 41, 201, 113, 923, 621, 497, 3823, 12543, 27273, 58509, 21613}}, {10982, 17, 44799, {1, 1, 1, 11, 5, 51, 93, 39, 345, 175, 679, 617, 3445, 8591, 4017, 5147, 88847}}, {10983, 17, 44804, {1, 1, 7, 7, 7, 9, 63, 7, 89, 711, 487, 69, 447, 3355, 31929, 34719, 93629}}, {10984, 17, 44813, {1, 3, 1, 3, 27, 11, 51, 11, 471, 889, 1935, 2185, 1277, 3127, 8853, 17839, 40279}}, {10985, 17, 44822, {1, 3, 3, 15, 25, 35, 71, 213, 121, 935, 1601, 537, 5753, 8743, 15243, 59545, 60399}}, {10986, 17, 44838, {1, 1, 3, 15, 31, 41, 51, 205, 123, 215, 305, 3777, 4103, 7275, 21603, 56853, 54575}}, {10987, 17, 44842, {1, 3, 7, 9, 17, 19, 37, 59, 193, 303, 1079, 3627, 6503, 14649, 10283, 64469, 83677}}, {10988, 17, 44849, {1, 3, 1, 5, 11, 3, 115, 139, 213, 307, 721, 1611, 5093, 11817, 32503, 38559, 38449}}, {10989, 17, 44856, {1, 3, 1, 1, 17, 31, 41, 113, 135, 733, 723, 2021, 7397, 15917, 15741, 7295, 69885}}, {10990, 17, 44870, {1, 1, 7, 11, 31, 3, 125, 77, 89, 793, 1441, 1527, 457, 9457, 13581, 62979, 125279}}, {10991, 17, 44887, {1, 1, 1, 5, 9, 17, 19, 115, 43, 395, 183, 2091, 7021, 7555, 20165, 45165, 58925}}, {10992, 17, 44904, {1, 1, 1, 15, 23, 37, 97, 45, 357, 201, 425, 3605, 5305, 10079, 16397, 40635, 15355}}, {10993, 17, 44915, {1, 1, 3, 7, 3, 43, 65, 89, 51, 801, 917, 2835, 5675, 2347, 16587, 19701, 68655}}, {10994, 17, 44917, {1, 3, 7, 13, 11, 59, 93, 155, 53, 435, 165, 3231, 429, 12757, 27033, 14081, 12625}}, {10995, 17, 44921, {1, 3, 1, 15, 15, 33, 121, 157, 271, 295, 901, 1689, 709, 13395, 17773, 14397, 37743}}, {10996, 17, 44928, {1, 1, 1, 3, 7, 17, 125, 113, 223, 603, 425, 3213, 2781, 2921, 15181, 18649, 93493}}, {10997, 17, 44933, {1, 3, 3, 5, 1, 25, 3, 101, 151, 435, 1339, 1207, 7687, 12579, 29331, 4653, 67353}}, {10998, 17, 44934, {1, 1, 7, 1, 29, 53, 101, 61, 31, 633, 1899, 3919, 1879, 3143, 25319, 45809, 77425}}, {10999, 17, 44937, {1, 1, 5, 1, 17, 31, 79, 247, 77, 197, 1693, 313, 2183, 14343, 4511, 26009, 44943}}, {11000, 17, 44940, {1, 1, 7, 5, 31, 29, 119, 251, 345, 867, 271, 165, 6425, 8343, 11251, 28125, 34849}}, {11001, 17, 44951, {1, 3, 1, 1, 13, 35, 9, 103, 365, 675, 1653, 4095, 3123, 8245, 4679, 18951, 88543}}, {11002, 17, 44961, {1, 1, 1, 1, 23, 29, 109, 157, 253, 751, 145, 2077, 4555, 7523, 30099, 37709, 97369}}, {11003, 17, 44962, {1, 3, 3, 11, 5, 1, 51, 11, 203, 963, 1961, 351, 6697, 8137, 25933, 53505, 28531}}, {11004, 17, 44971, {1, 1, 7, 15, 27, 1, 31, 159, 447, 501, 1873, 2845, 875, 1671, 5049, 38901, 32559}}, {11005, 17, 44982, {1, 1, 3, 3, 29, 19, 33, 83, 71, 703, 1861, 3683, 3589, 15339, 21075, 40399, 47853}}, {11006, 17, 44985, {1, 3, 3, 7, 5, 41, 61, 181, 319, 77, 777, 2537, 3887, 2687, 29227, 55217, 55813}}, {11007, 17, 44996, {1, 3, 3, 1, 25, 41, 23, 31, 31, 775, 693, 891, 861, 7613, 9557, 43275, 36311}}, {11008, 17, 44999, {1, 1, 7, 13, 11, 5, 99, 217, 81, 441, 765, 3981, 2921, 9657, 6905, 30657, 18395}}, {11009, 17, 45014, {1, 3, 1, 11, 21, 55, 25, 209, 13, 1021, 1373, 785, 3243, 1541, 12033, 17309, 116517}}, {11010, 17, 45029, {1, 1, 1, 7, 3, 3, 61, 113, 453, 405, 1321, 2327, 3529, 12779, 11707, 55795, 105137}}, {11011, 17, 45033, {1, 3, 1, 13, 15, 53, 17, 189, 197, 459, 1999, 935, 7835, 9563, 31231, 47757, 80807}}, {11012, 17, 45036, {1, 3, 5, 13, 11, 15, 91, 115, 427, 723, 1815, 3527, 5917, 4931, 28297, 12257, 5587}}, {11013, 17, 45047, {1, 1, 5, 9, 31, 5, 77, 201, 373, 143, 581, 1199, 6807, 6059, 3133, 57069, 4895}}, {11014, 17, 45065, {1, 3, 1, 9, 17, 13, 127, 61, 235, 991, 279, 1545, 2875, 8453, 13329, 39763, 66897}}, {11015, 17, 45076, {1, 1, 3, 15, 31, 51, 3, 95, 221, 685, 635, 1747, 177, 9781, 4859, 45345, 37607}}, {11016, 17, 45085, {1, 3, 5, 1, 3, 55, 63, 51, 63, 707, 883, 2985, 3699, 3881, 8159, 41775, 41411}}, {11017, 17, 45086, {1, 1, 1, 11, 3, 41, 69, 181, 413, 33, 525, 1883, 6063, 13787, 1259, 19497, 8119}}, {11018, 17, 45090, {1, 1, 5, 15, 13, 27, 65, 63, 117, 831, 855, 369, 1005, 9069, 16179, 32027, 6527}}, {11019, 17, 45107, {1, 3, 7, 5, 25, 51, 63, 163, 101, 299, 1637, 641, 2077, 9195, 11181, 59783, 109481}}, {11020, 17, 45119, {1, 3, 5, 13, 27, 13, 117, 253, 257, 919, 709, 411, 5525, 1247, 19951, 51423, 34605}}, {11021, 17, 45121, {1, 1, 5, 5, 1, 37, 49, 125, 87, 291, 339, 3235, 1477, 9787, 19637, 22855, 103013}}, {11022, 17, 45128, {1, 3, 7, 15, 25, 17, 77, 23, 303, 739, 1921, 1425, 6451, 9521, 6311, 38551, 123683}}, {11023, 17, 45139, {1, 3, 1, 7, 13, 19, 33, 73, 347, 85, 1693, 3671, 713, 1191, 3285, 6815, 61833}}, {11024, 17, 45151, {1, 1, 3, 3, 13, 53, 81, 177, 305, 967, 551, 1177, 2315, 4899, 5733, 11147, 128895}}, {11025, 17, 45157, {1, 3, 5, 3, 17, 17, 93, 173, 417, 645, 1631, 1817, 6127, 3545, 6127, 22331, 59751}}, {11026, 17, 45162, {1, 1, 5, 11, 7, 53, 61, 117, 133, 141, 283, 3351, 6745, 599, 7221, 50583, 9067}}, {11027, 17, 45164, {1, 3, 7, 3, 29, 45, 71, 177, 97, 897, 589, 3319, 1821, 7207, 25715, 13043, 96695}}, {11028, 17, 45176, {1, 3, 3, 1, 13, 39, 19, 49, 419, 905, 1063, 4023, 145, 1479, 22197, 43883, 45503}}, {11029, 17, 45179, {1, 3, 3, 15, 9, 45, 45, 201, 61, 193, 375, 2439, 2339, 15981, 5197, 6285, 109389}}, {11030, 17, 45198, {1, 1, 7, 13, 29, 51, 93, 223, 509, 1003, 1861, 3715, 2511, 13843, 25297, 1241, 12157}}, {11031, 17, 45209, {1, 3, 5, 15, 19, 17, 95, 243, 251, 485, 1837, 1829, 2081, 15117, 29635, 63861, 100397}}, {11032, 17, 45231, {1, 1, 7, 3, 1, 37, 31, 53, 483, 849, 1197, 3069, 2539, 2529, 12749, 64331, 45757}}, {11033, 17, 45234, {1, 3, 7, 7, 1, 19, 25, 243, 335, 99, 1507, 2155, 6085, 2253, 32439, 16141, 6781}}, {11034, 17, 45236, {1, 3, 7, 15, 9, 13, 35, 63, 371, 373, 1891, 3913, 4577, 15553, 13079, 60251, 71193}}, {11035, 17, 45251, {1, 3, 1, 7, 15, 13, 105, 113, 409, 289, 57, 1095, 791, 15675, 21471, 42851, 29203}}, {11036, 17, 45260, {1, 1, 1, 13, 1, 57, 65, 7, 153, 929, 1325, 229, 3841, 8967, 29889, 49427, 46853}}, {11037, 17, 45268, {1, 1, 3, 11, 29, 1, 79, 111, 479, 931, 1619, 505, 4503, 4055, 18849, 3979, 46091}}, {11038, 17, 45277, {1, 1, 7, 3, 31, 27, 127, 63, 219, 43, 883, 1265, 5733, 9051, 17059, 61625, 93843}}, {11039, 17, 45299, {1, 1, 7, 7, 23, 21, 35, 211, 243, 399, 1225, 1415, 5923, 2143, 25303, 36171, 126349}}, {11040, 17, 45301, {1, 3, 1, 3, 3, 13, 77, 205, 271, 393, 769, 2101, 4045, 6159, 3409, 44065, 102799}}, {11041, 17, 45338, {1, 1, 5, 15, 19, 1, 67, 199, 367, 51, 495, 2051, 3195, 15239, 10525, 45319, 50489}}, {11042, 17, 45344, {1, 1, 1, 9, 3, 19, 105, 147, 417, 399, 373, 1025, 2727, 13779, 30079, 22723, 41551}}, {11043, 17, 45349, {1, 1, 3, 1, 9, 15, 105, 95, 267, 995, 275, 2627, 3883, 10785, 8075, 40591, 54647}}, {11044, 17, 45364, {1, 1, 1, 5, 31, 37, 117, 185, 55, 273, 525, 445, 4221, 2081, 16017, 19859, 3297}}, {11045, 17, 45367, {1, 3, 5, 13, 21, 13, 105, 231, 461, 831, 393, 3253, 1213, 2625, 3393, 36715, 104889}}, {11046, 17, 45371, {1, 3, 5, 15, 1, 17, 103, 129, 257, 1003, 285, 2927, 3967, 53, 5197, 39665, 50751}}, {11047, 17, 45373, {1, 1, 1, 13, 1, 61, 47, 255, 137, 849, 213, 301, 681, 9547, 28209, 32941, 72109}}, {11048, 17, 45376, {1, 1, 7, 11, 31, 15, 81, 117, 327, 289, 1861, 861, 6189, 13425, 18279, 7635, 116969}}, {11049, 17, 45381, {1, 3, 3, 3, 9, 11, 13, 181, 183, 621, 329, 2751, 3989, 6345, 20319, 52267, 79695}}, {11050, 17, 45400, {1, 1, 7, 13, 9, 1, 5, 125, 1, 735, 691, 13, 3961, 2273, 18299, 65221, 20115}}, {11051, 17, 45406, {1, 3, 7, 1, 7, 3, 87, 115, 241, 101, 523, 3019, 7571, 7721, 27409, 49751, 97859}}, {11052, 17, 45416, {1, 3, 5, 11, 9, 5, 33, 59, 299, 191, 307, 2115, 2823, 10187, 10437, 34137, 93217}}, {11053, 17, 45422, {1, 3, 3, 7, 21, 31, 5, 113, 77, 215, 177, 2029, 7241, 4465, 31489, 10165, 19035}}, {11054, 17, 45427, {1, 3, 5, 1, 27, 63, 11, 161, 435, 941, 1593, 1765, 1519, 9111, 12787, 35961, 105263}}, {11055, 17, 45440, {1, 1, 1, 9, 11, 57, 41, 229, 387, 617, 1991, 221, 2857, 4337, 13851, 23185, 111031}}, {11056, 17, 45458, {1, 1, 3, 5, 21, 27, 125, 83, 129, 919, 65, 403, 2981, 10111, 17017, 24829, 12205}}, {11057, 17, 45467, {1, 3, 3, 9, 25, 19, 109, 47, 199, 395, 1909, 2819, 5361, 6629, 7067, 18755, 17921}}, {11058, 17, 45474, {1, 1, 3, 15, 25, 37, 111, 129, 409, 291, 1403, 2785, 3819, 10245, 24647, 64799, 64951}}, {11059, 17, 45476, {1, 3, 5, 11, 1, 7, 105, 223, 427, 661, 1817, 1023, 145, 927, 6507, 13235, 30147}}, {11060, 17, 45488, {1, 3, 5, 13, 7, 15, 65, 125, 121, 113, 923, 2729, 1397, 14247, 8487, 54907, 41921}}, {11061, 17, 45494, {1, 1, 5, 1, 13, 15, 47, 111, 453, 375, 1705, 1539, 4103, 601, 7499, 33287, 123689}}, {11062, 17, 45497, {1, 1, 5, 3, 21, 11, 87, 115, 483, 617, 1593, 2817, 6519, 16203, 361, 34415, 100829}}, {11063, 17, 45500, {1, 3, 7, 15, 23, 25, 41, 193, 473, 517, 1195, 3627, 1089, 13391, 3653, 25637, 5643}}, {11064, 17, 45512, {1, 3, 1, 1, 13, 57, 29, 175, 35, 107, 5, 3641, 1843, 1507, 7591, 39967, 66859}}, {11065, 17, 45515, {1, 1, 3, 13, 1, 39, 31, 11, 493, 123, 523, 843, 133, 7971, 14131, 51927, 97943}}, {11066, 17, 45523, {1, 1, 3, 7, 23, 45, 5, 195, 195, 683, 497, 1215, 5855, 14569, 20441, 29541, 30431}}, {11067, 17, 45542, {1, 3, 1, 11, 31, 39, 127, 187, 187, 17, 817, 907, 4657, 8223, 13305, 36489, 28909}}, {11068, 17, 45553, {1, 1, 7, 13, 9, 1, 59, 27, 449, 887, 39, 191, 803, 2339, 5213, 2611, 93175}}, {11069, 17, 45559, {1, 1, 1, 1, 29, 17, 105, 13, 175, 401, 1145, 297, 6873, 889, 10301, 48993, 49959}}, {11070, 17, 45589, {1, 3, 5, 5, 1, 57, 81, 81, 403, 719, 1887, 2597, 1069, 5219, 29767, 46905, 8025}}, {11071, 17, 45594, {1, 1, 5, 11, 13, 37, 41, 3, 487, 895, 343, 1729, 3777, 8681, 24737, 34179, 15015}}, {11072, 17, 45596, {1, 1, 1, 15, 9, 43, 67, 203, 71, 399, 23, 529, 2375, 15373, 21013, 17389, 93809}}, {11073, 17, 45603, {1, 3, 7, 7, 9, 23, 81, 27, 39, 529, 631, 199, 3555, 953, 4249, 39297, 88107}}, {11074, 17, 45605, {1, 3, 1, 3, 31, 45, 33, 63, 319, 245, 1567, 3359, 2051, 11523, 30177, 20293, 13245}}, {11075, 17, 45610, {1, 1, 1, 13, 9, 61, 39, 127, 453, 1019, 2037, 3541, 6983, 10717, 19587, 8981, 99637}}, {11076, 17, 45630, {1, 3, 5, 9, 15, 7, 55, 79, 93, 303, 1423, 499, 5499, 795, 14553, 16945, 46161}}, {11077, 17, 45638, {1, 1, 7, 5, 21, 21, 27, 201, 147, 461, 363, 267, 2963, 3409, 17835, 40777, 71879}}, {11078, 17, 45641, {1, 1, 7, 9, 23, 63, 115, 243, 103, 119, 2023, 2223, 7989, 1365, 26181, 4631, 88001}}, {11079, 17, 45647, {1, 3, 5, 5, 27, 57, 101, 199, 461, 853, 449, 2733, 2225, 8609, 19461, 15265, 54079}}, {11080, 17, 45655, {1, 3, 3, 15, 29, 59, 115, 105, 145, 391, 303, 901, 5481, 1491, 30441, 22331, 3841}}, {11081, 17, 45659, {1, 1, 3, 1, 27, 45, 11, 167, 73, 181, 253, 1947, 1731, 15269, 16971, 12299, 46439}}, {11082, 17, 45665, {1, 1, 7, 13, 11, 21, 83, 157, 75, 705, 1709, 487, 5029, 9879, 27589, 21601, 50575}}, {11083, 17, 45689, {1, 1, 5, 3, 27, 37, 101, 163, 115, 903, 1137, 3807, 2899, 3407, 27935, 14203, 31009}}, {11084, 17, 45695, {1, 3, 5, 9, 31, 33, 63, 69, 159, 737, 1973, 3661, 6159, 1781, 9239, 12989, 82947}}, {11085, 17, 45702, {1, 3, 5, 9, 15, 33, 41, 89, 183, 933, 1305, 1013, 7245, 16225, 10891, 6641, 61699}}, {11086, 17, 45708, {1, 1, 5, 3, 25, 41, 91, 183, 45, 553, 1817, 3305, 5169, 9051, 24917, 52431, 52505}}, {11087, 17, 45726, {1, 3, 3, 9, 3, 9, 127, 59, 117, 1001, 1255, 3435, 3797, 8507, 28593, 24119, 75569}}, {11088, 17, 45729, {1, 3, 1, 5, 17, 43, 45, 21, 461, 339, 1127, 2213, 7351, 14585, 2001, 32619, 33825}}, {11089, 17, 45739, {1, 1, 5, 11, 3, 37, 61, 83, 101, 707, 861, 3037, 1867, 7747, 16313, 58745, 14387}}, {11090, 17, 45744, {1, 1, 5, 3, 27, 25, 99, 17, 293, 867, 1655, 2301, 2007, 7379, 14487, 18233, 3625}}, {11091, 17, 45747, {1, 1, 7, 13, 25, 29, 21, 133, 207, 119, 423, 1561, 6587, 1221, 27295, 48141, 125473}}, {11092, 17, 45762, {1, 3, 3, 1, 19, 45, 39, 85, 127, 249, 157, 1307, 7343, 6309, 31073, 16909, 93223}}, {11093, 17, 45764, {1, 1, 5, 13, 19, 43, 111, 109, 385, 847, 1071, 1009, 2783, 8471, 5719, 50459, 110507}}, {11094, 17, 45773, {1, 1, 5, 15, 1, 45, 39, 197, 209, 839, 485, 3943, 5939, 11835, 18297, 61217, 85015}}, {11095, 17, 45774, {1, 1, 1, 15, 5, 61, 1, 195, 415, 355, 1593, 151, 8143, 3527, 11633, 44337, 99749}}, {11096, 17, 45781, {1, 1, 5, 13, 11, 11, 117, 109, 91, 663, 1351, 2361, 1409, 9317, 31133, 17577, 123919}}, {11097, 17, 45785, {1, 3, 3, 9, 3, 5, 115, 173, 459, 937, 1581, 781, 1069, 573, 24025, 30721, 116837}}, {11098, 17, 45792, {1, 1, 1, 5, 21, 37, 47, 51, 21, 169, 119, 3285, 2543, 14023, 29179, 13407, 130491}}, {11099, 17, 45801, {1, 3, 5, 5, 25, 27, 41, 147, 485, 79, 737, 699, 6763, 16347, 9265, 52129, 41431}}, {11100, 17, 45802, {1, 1, 1, 3, 5, 33, 115, 187, 311, 717, 1897, 2215, 2639, 4167, 1429, 26359, 52703}}, {11101, 17, 45812, {1, 3, 5, 5, 13, 51, 103, 5, 47, 683, 319, 2969, 7701, 11031, 9257, 16725, 80825}}, {11102, 17, 45816, {1, 3, 1, 11, 31, 47, 17, 205, 11, 411, 523, 4053, 6743, 3095, 3219, 63163, 84547}}, {11103, 17, 45829, {1, 1, 7, 15, 9, 55, 109, 225, 273, 595, 1697, 2059, 21, 11319, 23277, 60613, 4539}}, {11104, 17, 45833, {1, 1, 5, 13, 3, 59, 49, 239, 509, 847, 975, 3361, 5443, 1941, 29277, 56379, 38997}}, {11105, 17, 45847, {1, 3, 1, 7, 15, 5, 49, 19, 235, 437, 1309, 827, 4123, 5839, 22409, 42535, 98041}}, {11106, 17, 45851, {1, 1, 5, 15, 9, 33, 57, 153, 165, 215, 177, 1271, 1861, 15489, 4183, 43701, 114169}}, {11107, 17, 45854, {1, 3, 5, 5, 13, 3, 119, 89, 17, 421, 1205, 835, 4917, 6113, 28991, 26839, 114871}}, {11108, 17, 45863, {1, 3, 5, 1, 7, 49, 49, 159, 205, 601, 1939, 4063, 5975, 11747, 10329, 21103, 16779}}, {11109, 17, 45870, {1, 1, 5, 15, 13, 33, 89, 21, 113, 639, 891, 989, 829, 1435, 11475, 42711, 67049}}, {11110, 17, 45901, {1, 1, 5, 5, 9, 59, 57, 105, 385, 733, 1175, 329, 6809, 7175, 27267, 9941, 14203}}, {11111, 17, 45910, {1, 3, 1, 13, 21, 53, 83, 139, 287, 659, 1991, 3225, 4153, 4325, 16803, 27719, 86263}}, {11112, 17, 45920, {1, 3, 5, 13, 27, 21, 111, 105, 29, 573, 405, 2781, 1737, 12057, 25263, 16903, 45389}}, {11113, 17, 45932, {1, 1, 5, 5, 23, 23, 61, 27, 335, 279, 937, 2509, 4751, 2993, 28069, 30187, 3595}}, {11114, 17, 45938, {1, 1, 5, 7, 29, 37, 117, 71, 221, 875, 1987, 2329, 5953, 15901, 29813, 17419, 4745}}, {11115, 17, 45940, {1, 3, 3, 13, 21, 51, 77, 85, 53, 573, 1129, 3415, 2283, 5221, 29991, 46091, 65843}}, {11116, 17, 45943, {1, 1, 1, 3, 17, 51, 89, 211, 463, 743, 1189, 4083, 1437, 5219, 8373, 15559, 18557}}, {11117, 17, 45949, {1, 1, 5, 3, 29, 27, 1, 207, 285, 739, 505, 1587, 6565, 14195, 4995, 39453, 61023}}, {11118, 17, 45953, {1, 3, 3, 15, 7, 57, 19, 45, 39, 881, 1207, 2829, 3265, 2637, 7843, 62889, 53289}}, {11119, 17, 45963, {1, 1, 1, 11, 31, 21, 73, 245, 87, 457, 1523, 2397, 1157, 8237, 26195, 23149, 106523}}, {11120, 17, 45971, {1, 3, 5, 13, 3, 55, 3, 179, 107, 85, 639, 2711, 6359, 1599, 2325, 59573, 111941}}, {11121, 17, 45989, {1, 1, 1, 13, 17, 61, 45, 253, 45, 149, 1251, 139, 7113, 6503, 27675, 37301, 21713}}, {11122, 17, 45999, {1, 3, 5, 9, 31, 31, 67, 79, 355, 225, 1187, 761, 4927, 5481, 9139, 13399, 35653}}, {11123, 17, 46001, {1, 1, 5, 3, 7, 3, 95, 119, 161, 529, 1443, 1099, 609, 3919, 10935, 37779, 92993}}, {11124, 17, 46008, {1, 1, 7, 9, 13, 21, 13, 7, 165, 173, 989, 2315, 2305, 13115, 6933, 56233, 112113}}, {11125, 17, 46022, {1, 1, 7, 3, 9, 11, 25, 45, 493, 119, 839, 3907, 2273, 14113, 29453, 55181, 667}}, {11126, 17, 46026, {1, 3, 5, 15, 25, 33, 15, 23, 245, 517, 1883, 2865, 1483, 7043, 32615, 12261, 49297}}, {11127, 17, 46034, {1, 3, 7, 9, 31, 35, 89, 103, 245, 441, 1709, 1321, 3743, 3767, 23885, 43587, 18017}}, {11128, 17, 46040, {1, 3, 7, 5, 23, 43, 103, 7, 47, 187, 1257, 3517, 591, 16263, 12047, 16699, 81633}}, {11129, 17, 46043, {1, 1, 5, 15, 5, 5, 79, 11, 327, 719, 37, 2913, 6107, 3463, 25901, 6125, 100647}}, {11130, 17, 46045, {1, 1, 1, 11, 13, 29, 83, 251, 41, 125, 1137, 2627, 4643, 29, 24631, 51435, 98643}}, {11131, 17, 46061, {1, 1, 7, 3, 27, 3, 69, 245, 365, 599, 1575, 2969, 3441, 12327, 18951, 56167, 13861}}, {11132, 17, 46062, {1, 3, 3, 11, 5, 47, 103, 233, 351, 821, 867, 3199, 6133, 4627, 22663, 14775, 83205}}, {11133, 17, 46076, {1, 3, 1, 13, 9, 35, 27, 251, 281, 727, 873, 3713, 5247, 8407, 17739, 57207, 126201}}, {11134, 17, 46084, {1, 1, 7, 11, 11, 35, 53, 115, 93, 663, 625, 565, 3137, 7869, 18845, 49155, 83395}}, {11135, 17, 46094, {1, 3, 3, 5, 21, 13, 99, 151, 319, 9, 1363, 1489, 2545, 1963, 1271, 24815, 43355}}, {11136, 17, 46102, {1, 3, 5, 9, 15, 51, 109, 85, 67, 131, 1947, 181, 7331, 15163, 2255, 33449, 78107}}, {11137, 17, 46118, {1, 1, 7, 9, 27, 61, 1, 163, 309, 739, 453, 1837, 2093, 16021, 8485, 19755, 61335}}, {11138, 17, 46149, {1, 3, 5, 7, 3, 13, 11, 195, 91, 143, 203, 2785, 7319, 7153, 19265, 11597, 63365}}, {11139, 17, 46154, {1, 3, 1, 9, 29, 1, 123, 247, 253, 757, 191, 1699, 6625, 1785, 29199, 29409, 32577}}, {11140, 17, 46167, {1, 3, 5, 11, 23, 21, 31, 35, 383, 587, 65, 1695, 4045, 12305, 12437, 5919, 51465}}, {11141, 17, 46173, {1, 1, 5, 9, 11, 13, 123, 171, 499, 877, 1785, 561, 2547, 1797, 27679, 56305, 93223}}, {11142, 17, 46177, {1, 3, 1, 3, 25, 41, 63, 243, 219, 533, 753, 1903, 3257, 11901, 4777, 28629, 111141}}, {11143, 17, 46192, {1, 3, 3, 5, 31, 47, 1, 253, 283, 995, 1787, 1767, 6599, 11913, 21515, 39259, 117727}}, {11144, 17, 46197, {1, 1, 7, 7, 31, 35, 39, 255, 463, 763, 881, 2583, 347, 14343, 22761, 45821, 119155}}, {11145, 17, 46201, {1, 3, 5, 9, 5, 37, 43, 55, 423, 525, 157, 3593, 2831, 11539, 15675, 11695, 100609}}, {11146, 17, 46214, {1, 3, 3, 5, 11, 9, 27, 57, 409, 201, 1029, 2461, 5823, 2593, 32031, 4203, 55327}}, {11147, 17, 46217, {1, 1, 7, 15, 15, 25, 69, 83, 309, 687, 1607, 819, 7381, 3697, 5289, 33153, 48157}}, {11148, 17, 46223, {1, 1, 5, 5, 31, 57, 41, 195, 201, 59, 2045, 2213, 6695, 3839, 17331, 4981, 26803}}, {11149, 17, 46226, {1, 1, 1, 11, 7, 53, 109, 169, 387, 181, 391, 19, 4159, 299, 29059, 27781, 110193}}, {11150, 17, 46228, {1, 3, 7, 15, 5, 31, 95, 155, 47, 601, 1463, 1799, 8027, 3003, 18067, 24589, 108171}}, {11151, 17, 46237, {1, 3, 3, 7, 11, 61, 21, 121, 117, 149, 1037, 3829, 3581, 15223, 17051, 34539, 37263}}, {11152, 17, 46241, {1, 3, 3, 3, 15, 15, 115, 91, 443, 309, 1073, 2053, 789, 7415, 26253, 62657, 49729}}, {11153, 17, 46251, {1, 3, 5, 5, 31, 19, 23, 221, 19, 105, 1105, 2025, 4209, 7531, 30191, 40777, 46069}}, {11154, 17, 46259, {1, 1, 1, 7, 29, 45, 29, 215, 33, 21, 1147, 1725, 3711, 2759, 12731, 57031, 42361}}, {11155, 17, 46262, {1, 1, 5, 15, 13, 59, 111, 169, 317, 841, 1387, 3513, 3137, 8265, 31789, 26963, 126219}}, {11156, 17, 46266, {1, 1, 3, 1, 23, 21, 13, 113, 71, 177, 345, 3149, 1461, 12945, 3971, 59759, 61839}}, {11157, 17, 46294, {1, 3, 5, 13, 9, 19, 103, 17, 95, 617, 1477, 263, 4259, 12899, 24351, 47431, 11583}}, {11158, 17, 46300, {1, 3, 5, 11, 13, 11, 7, 61, 13, 63, 1687, 631, 381, 5899, 10225, 19657, 37087}}, {11159, 17, 46303, {1, 3, 5, 3, 7, 53, 11, 193, 103, 427, 1097, 299, 2905, 5019, 31803, 28931, 47495}}, {11160, 17, 46309, {1, 3, 3, 11, 21, 31, 125, 249, 233, 941, 975, 2287, 7837, 6481, 11021, 52829, 63023}}, {11161, 17, 46321, {1, 1, 7, 15, 13, 17, 33, 85, 503, 11, 689, 637, 4063, 12223, 1835, 17161, 35213}}, {11162, 17, 46331, {1, 3, 5, 13, 25, 37, 21, 135, 377, 623, 895, 2547, 2757, 9055, 17337, 65457, 24737}}, {11163, 17, 46339, {1, 1, 1, 15, 25, 11, 17, 95, 65, 271, 1791, 841, 1441, 11177, 10087, 63963, 71481}}, {11164, 17, 46342, {1, 3, 5, 11, 31, 1, 37, 107, 109, 459, 1185, 2155, 271, 11775, 23243, 53517, 103669}}, {11165, 17, 46354, {1, 3, 1, 9, 1, 49, 23, 141, 169, 475, 469, 2271, 1379, 13139, 1765, 63625, 14143}}, {11166, 17, 46370, {1, 1, 1, 9, 13, 7, 23, 219, 381, 105, 743, 1745, 2999, 661, 7245, 39653, 99913}}, {11167, 17, 46372, {1, 3, 1, 11, 7, 35, 9, 215, 41, 537, 1569, 1803, 3613, 667, 15089, 39485, 85457}}, {11168, 17, 46379, {1, 1, 1, 15, 9, 49, 75, 235, 119, 97, 273, 209, 2707, 2071, 21943, 60249, 57737}}, {11169, 17, 46382, {1, 1, 5, 15, 31, 19, 33, 49, 279, 461, 143, 3001, 3539, 1015, 27597, 35389, 36483}}, {11170, 17, 46393, {1, 3, 7, 1, 23, 51, 123, 247, 485, 343, 1365, 593, 6465, 12305, 29375, 30641, 43165}}, {11171, 17, 46402, {1, 1, 7, 13, 15, 11, 125, 51, 235, 717, 1427, 3203, 1711, 12607, 8805, 5773, 27467}}, {11172, 17, 46407, {1, 3, 5, 5, 5, 13, 51, 181, 133, 977, 469, 2513, 6819, 12985, 8917, 47317, 47557}}, {11173, 17, 46416, {1, 1, 5, 7, 3, 7, 71, 17, 345, 921, 1621, 2801, 5825, 827, 17711, 33701, 113503}}, {11174, 17, 46425, {1, 3, 1, 1, 17, 7, 99, 83, 73, 349, 567, 713, 5639, 4969, 11549, 35317, 28995}}, {11175, 17, 46437, {1, 3, 3, 9, 11, 53, 123, 227, 391, 775, 1013, 3971, 6183, 14453, 6403, 57063, 7123}}, {11176, 17, 46444, {1, 1, 1, 15, 27, 13, 51, 147, 151, 535, 2017, 3019, 6791, 3931, 12529, 30855, 33243}}, {11177, 17, 46447, {1, 3, 1, 1, 27, 43, 103, 85, 135, 207, 621, 251, 3723, 10893, 29533, 31023, 11043}}, {11178, 17, 46449, {1, 3, 7, 5, 7, 39, 55, 133, 141, 63, 237, 3299, 861, 15123, 11859, 13271, 32893}}, {11179, 17, 46456, {1, 3, 7, 9, 23, 17, 73, 197, 113, 725, 137, 2835, 2877, 6913, 22949, 56071, 67597}}, {11180, 17, 46462, {1, 3, 7, 7, 15, 3, 15, 253, 51, 443, 15, 2549, 7833, 4713, 29211, 22339, 6009}}, {11181, 17, 46472, {1, 3, 5, 15, 19, 55, 35, 59, 281, 995, 1113, 605, 2345, 10009, 14629, 11757, 53241}}, {11182, 17, 46475, {1, 1, 1, 11, 3, 31, 11, 193, 437, 1003, 873, 909, 6513, 2045, 10495, 17387, 25461}}, {11183, 17, 46486, {1, 1, 3, 5, 21, 61, 47, 177, 379, 773, 951, 419, 4455, 10171, 17403, 19045, 87327}}, {11184, 17, 46490, {1, 3, 3, 11, 31, 41, 69, 229, 207, 299, 1743, 1417, 4785, 1327, 26967, 43077, 124319}}, {11185, 17, 46495, {1, 3, 7, 15, 19, 37, 65, 219, 33, 691, 205, 1577, 4775, 8427, 28315, 53559, 100789}}, {11186, 17, 46501, {1, 3, 5, 11, 5, 39, 55, 147, 139, 871, 1563, 3661, 4791, 423, 30007, 1589, 20255}}, {11187, 17, 46514, {1, 1, 3, 15, 5, 61, 89, 83, 261, 519, 1367, 2019, 3799, 8237, 9011, 28995, 1587}}, {11188, 17, 46526, {1, 1, 7, 15, 17, 55, 49, 41, 353, 507, 1565, 3365, 7947, 10391, 1323, 61591, 126305}}, {11189, 17, 46528, {1, 3, 3, 5, 13, 19, 49, 195, 355, 915, 1867, 3513, 1239, 4809, 16925, 22947, 92641}}, {11190, 17, 46538, {1, 1, 7, 3, 31, 51, 45, 241, 55, 195, 1233, 3675, 8077, 4981, 17679, 53025, 77927}}, {11191, 17, 46551, {1, 3, 5, 11, 23, 5, 93, 49, 277, 979, 1093, 3031, 6131, 8085, 19121, 45305, 6705}}, {11192, 17, 46552, {1, 1, 7, 13, 29, 25, 83, 105, 469, 729, 1495, 2607, 2681, 13959, 101, 1913, 2671}}, {11193, 17, 46564, {1, 1, 1, 15, 7, 19, 63, 105, 253, 807, 1889, 2433, 1591, 16267, 11997, 18939, 113313}}, {11194, 17, 46579, {1, 1, 5, 3, 13, 23, 29, 227, 337, 115, 783, 475, 6949, 9485, 1797, 18713, 123981}}, {11195, 17, 46586, {1, 3, 3, 9, 21, 43, 115, 225, 147, 753, 919, 1157, 2901, 14813, 30035, 52553, 30225}}, {11196, 17, 46602, {1, 1, 3, 15, 23, 19, 65, 83, 457, 965, 579, 2133, 291, 2033, 7533, 52995, 92243}}, {11197, 17, 46615, {1, 1, 1, 5, 11, 3, 23, 245, 255, 373, 1119, 3695, 6449, 13497, 817, 32215, 103599}}, {11198, 17, 46616, {1, 3, 1, 5, 5, 19, 57, 53, 145, 441, 1253, 929, 1299, 11491, 29457, 11245, 55717}}, {11199, 17, 46621, {1, 1, 7, 13, 9, 13, 73, 85, 127, 29, 629, 409, 2487, 13079, 3767, 27985, 110139}}, {11200, 17, 46635, {1, 1, 5, 11, 29, 39, 27, 9, 487, 623, 757, 2879, 669, 12521, 23471, 47933, 41721}}, {11201, 17, 46643, {1, 1, 7, 15, 21, 9, 59, 39, 325, 787, 1347, 3039, 7333, 9793, 19337, 41285, 48339}}, {11202, 17, 46645, {1, 3, 3, 11, 11, 21, 127, 45, 173, 981, 483, 3707, 3651, 10545, 16865, 62105, 114847}}, {11203, 17, 46649, {1, 3, 5, 11, 11, 49, 89, 179, 393, 455, 1775, 1903, 8173, 12589, 17281, 57687, 56153}}, {11204, 17, 46667, {1, 3, 1, 3, 7, 7, 59, 223, 255, 559, 375, 2427, 6921, 3709, 24767, 16213, 60373}}, {11205, 17, 46670, {1, 1, 7, 15, 3, 31, 37, 129, 307, 1023, 1807, 519, 6779, 8997, 15383, 4391, 61161}}, {11206, 17, 46672, {1, 1, 1, 1, 9, 25, 53, 27, 263, 459, 1015, 417, 4195, 10931, 20507, 19299, 82371}}, {11207, 17, 46678, {1, 1, 3, 1, 7, 7, 49, 221, 47, 7, 1747, 1533, 3089, 14369, 32609, 64157, 78139}}, {11208, 17, 46681, {1, 3, 7, 5, 5, 13, 101, 231, 227, 19, 1359, 3017, 1405, 3715, 3541, 933, 1117}}, {11209, 17, 46684, {1, 1, 7, 15, 5, 63, 59, 253, 269, 781, 1639, 2247, 1041, 667, 7055, 21221, 84447}}, {11210, 17, 46687, {1, 1, 7, 3, 9, 13, 115, 247, 215, 173, 457, 1125, 5613, 13171, 17847, 26323, 68461}}, {11211, 17, 46705, {1, 3, 5, 9, 15, 19, 95, 213, 425, 567, 1625, 1659, 6961, 10569, 20985, 17255, 89919}}, {11212, 17, 46708, {1, 3, 5, 5, 3, 11, 107, 123, 265, 743, 499, 1885, 6079, 7791, 24953, 30925, 112517}}, {11213, 17, 46721, {1, 1, 5, 15, 29, 27, 103, 195, 119, 873, 1751, 2091, 6623, 7583, 20413, 52367, 16831}}, {11214, 17, 46724, {1, 1, 7, 7, 21, 15, 111, 197, 89, 107, 1317, 2107, 1951, 189, 31663, 63007, 21405}}, {11215, 17, 46739, {1, 3, 1, 13, 27, 15, 93, 251, 209, 93, 1419, 3785, 1899, 3143, 3205, 16309, 121455}}, {11216, 17, 46757, {1, 1, 7, 7, 17, 43, 23, 251, 425, 591, 1101, 1317, 6369, 14209, 10257, 33813, 59557}}, {11217, 17, 46762, {1, 1, 7, 3, 5, 41, 65, 59, 327, 369, 1867, 1045, 4953, 3155, 25679, 8545, 22753}}, {11218, 17, 46764, {1, 1, 5, 3, 5, 25, 117, 97, 369, 721, 1459, 2501, 4899, 5299, 3859, 2509, 127723}}, {11219, 17, 46776, {1, 3, 3, 1, 27, 13, 65, 185, 255, 543, 2013, 2027, 1131, 4067, 1327, 44639, 53275}}, {11220, 17, 46784, {1, 1, 7, 3, 11, 15, 53, 67, 265, 477, 971, 3201, 51, 10599, 23691, 10493, 130347}}, {11221, 17, 46790, {1, 3, 7, 7, 19, 35, 47, 61, 375, 547, 1867, 1147, 7775, 12757, 15101, 63243, 89817}}, {11222, 17, 46796, {1, 1, 5, 3, 5, 21, 57, 59, 145, 901, 835, 1093, 6487, 12727, 20585, 6309, 67803}}, {11223, 17, 46799, {1, 1, 1, 11, 13, 31, 75, 171, 189, 741, 1923, 3503, 4887, 15423, 2499, 39125, 4125}}, {11224, 17, 46802, {1, 3, 7, 1, 29, 31, 103, 207, 383, 631, 1017, 1693, 6251, 9429, 17491, 60959, 68131}}, {11225, 17, 46813, {1, 1, 1, 1, 19, 45, 127, 105, 451, 287, 657, 3521, 2021, 15793, 8993, 34837, 65441}}, {11226, 17, 46814, {1, 1, 7, 9, 17, 15, 13, 189, 255, 753, 1779, 3047, 1179, 13201, 28249, 5909, 35775}}, {11227, 17, 46824, {1, 3, 3, 3, 5, 11, 125, 207, 375, 375, 135, 2939, 1141, 12211, 727, 16137, 52253}}, {11228, 17, 46832, {1, 3, 7, 9, 29, 3, 83, 221, 281, 299, 667, 3435, 589, 8039, 7991, 24289, 13079}}, {11229, 17, 46841, {1, 3, 5, 13, 9, 11, 11, 99, 337, 155, 233, 2497, 3385, 15045, 5783, 40915, 19201}}, {11230, 17, 46856, {1, 1, 7, 5, 5, 23, 25, 223, 341, 149, 505, 893, 4933, 14899, 29899, 207, 125359}}, {11231, 17, 46862, {1, 3, 3, 15, 3, 5, 43, 165, 21, 993, 1091, 3849, 6005, 1905, 7199, 13495, 76915}}, {11232, 17, 46864, {1, 1, 1, 15, 1, 19, 55, 217, 179, 431, 935, 2219, 8135, 15071, 17437, 43271, 115963}}, {11233, 17, 46869, {1, 1, 7, 15, 7, 61, 45, 157, 441, 107, 1955, 2877, 5285, 12157, 21783, 60999, 102949}}, {11234, 17, 46874, {1, 1, 1, 3, 9, 29, 41, 75, 81, 73, 1859, 2923, 3009, 10847, 30257, 44527, 21933}}, {11235, 17, 46895, {1, 1, 3, 3, 29, 29, 103, 3, 401, 197, 237, 3727, 7919, 13669, 26869, 64987, 1581}}, {11236, 17, 46900, {1, 1, 5, 13, 13, 47, 99, 209, 45, 745, 1239, 663, 5535, 3777, 10479, 15327, 1441}}, {11237, 17, 46903, {1, 3, 1, 9, 1, 49, 31, 231, 15, 1001, 773, 2113, 1957, 15271, 25355, 7461, 33089}}, {11238, 17, 46927, {1, 1, 1, 5, 13, 31, 123, 123, 439, 373, 1817, 2555, 7905, 3151, 2311, 62083, 45535}}, {11239, 17, 46946, {1, 3, 1, 3, 31, 37, 83, 117, 177, 483, 1285, 1725, 821, 2115, 12893, 54301, 36491}}, {11240, 17, 46948, {1, 3, 3, 3, 9, 13, 87, 7, 467, 287, 1173, 2739, 3293, 883, 9123, 30799, 110221}}, {11241, 17, 46955, {1, 3, 1, 15, 3, 5, 119, 235, 393, 789, 67, 1193, 1613, 8607, 17371, 16723, 103747}}, {11242, 17, 46965, {1, 3, 1, 13, 13, 47, 61, 51, 447, 1, 1221, 1619, 3785, 5851, 10557, 51181, 6535}}, {11243, 17, 46972, {1, 3, 5, 11, 1, 1, 85, 119, 195, 177, 805, 1161, 4851, 15765, 24405, 41757, 110081}}, {11244, 17, 46976, {1, 1, 7, 1, 17, 21, 89, 13, 59, 169, 1847, 2401, 6243, 2841, 6153, 16039, 47407}}, {11245, 17, 46985, {1, 1, 3, 15, 21, 53, 103, 187, 143, 897, 65, 3677, 213, 4027, 22365, 53703, 82951}}, {11246, 17, 46999, {1, 3, 5, 5, 25, 5, 39, 49, 55, 71, 825, 2123, 2345, 5683, 18027, 29897, 53023}}, {11247, 17, 47003, {1, 1, 3, 5, 13, 55, 27, 77, 327, 429, 1219, 2103, 7095, 13461, 31027, 15383, 98485}}, {11248, 17, 47006, {1, 3, 1, 3, 9, 41, 33, 241, 487, 229, 1743, 951, 2319, 15595, 3213, 5959, 90721}}, {11249, 17, 47016, {1, 1, 7, 1, 29, 45, 45, 163, 123, 227, 305, 1577, 5465, 5639, 14507, 65155, 71425}}, {11250, 17, 47030, {1, 1, 5, 1, 3, 5, 33, 15, 203, 141, 465, 3509, 6653, 14193, 7073, 22525, 22951}}, {11251, 17, 47034, {1, 1, 7, 3, 27, 39, 3, 27, 75, 821, 1329, 3655, 4715, 7659, 31957, 60219, 79123}}, {11252, 17, 47053, {1, 3, 5, 13, 29, 45, 111, 19, 207, 387, 87, 3731, 7427, 13351, 9497, 34285, 25623}}, {11253, 17, 47056, {1, 1, 3, 11, 19, 39, 79, 219, 97, 125, 947, 1397, 3645, 1021, 9403, 38695, 54985}}, {11254, 17, 47059, {1, 3, 3, 7, 3, 3, 45, 93, 65, 289, 1843, 1599, 897, 16159, 23485, 24699, 43123}}, {11255, 17, 47072, {1, 3, 5, 3, 15, 1, 81, 219, 299, 429, 1115, 1763, 6381, 869, 7817, 143, 23583}}, {11256, 17, 47077, {1, 1, 3, 5, 1, 35, 95, 147, 425, 1011, 1039, 2875, 3089, 3685, 9995, 13279, 60923}}, {11257, 17, 47099, {1, 1, 5, 7, 5, 59, 105, 241, 151, 307, 735, 1541, 3115, 12331, 19535, 56965, 127015}}, {11258, 17, 47105, {1, 3, 5, 7, 5, 33, 83, 179, 65, 397, 787, 3425, 1305, 10713, 6973, 9007, 112081}}, {11259, 17, 47108, {1, 3, 7, 13, 29, 11, 37, 31, 271, 501, 897, 1383, 5333, 13627, 22091, 38421, 94575}}, {11260, 17, 47112, {1, 3, 1, 1, 9, 61, 87, 115, 13, 79, 391, 2385, 7157, 3369, 26035, 883, 34705}}, {11261, 17, 47115, {1, 1, 3, 9, 21, 29, 15, 165, 53, 719, 1509, 1295, 4437, 8229, 17961, 55297, 62635}}, {11262, 17, 47117, {1, 1, 7, 5, 27, 21, 23, 141, 341, 423, 9, 2693, 5555, 5797, 13179, 1107, 33489}}, {11263, 17, 47120, {1, 3, 1, 13, 27, 33, 101, 29, 379, 119, 1259, 861, 6843, 69, 3253, 61977, 80061}}, {11264, 17, 47129, {1, 1, 3, 11, 1, 37, 35, 43, 105, 655, 221, 873, 91, 9095, 8999, 44033, 24807}}, {11265, 17, 47135, {1, 3, 3, 7, 29, 15, 23, 227, 399, 305, 2007, 747, 2717, 14767, 6515, 40617, 7873}}, {11266, 17, 47151, {1, 1, 5, 15, 21, 43, 39, 7, 261, 421, 505, 1433, 1155, 5621, 2337, 54027, 54039}}, {11267, 17, 47154, {1, 1, 1, 9, 15, 39, 49, 185, 503, 895, 1321, 375, 4245, 4929, 9637, 50561, 65733}}, {11268, 17, 47156, {1, 1, 5, 15, 7, 29, 27, 155, 423, 631, 1295, 973, 4227, 2637, 8479, 29527, 70505}}, {11269, 17, 47166, {1, 3, 1, 3, 31, 33, 13, 67, 195, 335, 1577, 3715, 559, 7251, 7215, 46443, 125359}}, {11270, 17, 47171, {1, 3, 1, 9, 17, 37, 15, 119, 79, 851, 911, 3549, 99, 9221, 29897, 63489, 34937}}, {11271, 17, 47195, {1, 3, 5, 9, 31, 11, 125, 1, 265, 467, 835, 2997, 2401, 9615, 19397, 50947, 29963}}, {11272, 17, 47204, {1, 1, 5, 3, 11, 21, 63, 15, 471, 763, 1963, 2815, 4419, 11457, 7151, 27009, 124847}}, {11273, 17, 47213, {1, 1, 7, 3, 19, 9, 97, 59, 375, 109, 519, 305, 2787, 3001, 14199, 27415, 35403}}, {11274, 17, 47222, {1, 1, 1, 3, 13, 47, 3, 93, 307, 979, 419, 2817, 3741, 305, 1813, 34549, 116959}}, {11275, 17, 47228, {1, 3, 5, 13, 13, 19, 35, 231, 493, 973, 895, 1583, 1843, 9057, 27705, 32333, 130347}}, {11276, 17, 47241, {1, 1, 1, 13, 31, 35, 81, 11, 363, 229, 1865, 2849, 7805, 877, 3965, 45337, 33239}}, {11277, 17, 47242, {1, 3, 5, 1, 15, 3, 125, 93, 191, 405, 1359, 929, 3085, 7907, 7777, 7815, 103717}}, {11278, 17, 47247, {1, 1, 3, 7, 15, 33, 61, 235, 283, 141, 817, 1611, 665, 13113, 4197, 45831, 44505}}, {11279, 17, 47249, {1, 1, 5, 5, 25, 3, 63, 159, 223, 531, 1147, 2323, 2715, 10319, 32203, 23943, 95407}}, {11280, 17, 47250, {1, 3, 3, 3, 3, 33, 37, 99, 317, 811, 515, 339, 6527, 11149, 13071, 7177, 1549}}, {11281, 17, 47261, {1, 3, 1, 11, 31, 53, 9, 17, 297, 259, 1235, 53, 7065, 1721, 8191, 21663, 13393}}, {11282, 17, 47266, {1, 3, 7, 7, 29, 41, 127, 179, 113, 191, 783, 861, 6509, 5199, 3369, 18327, 30647}}, {11283, 17, 47268, {1, 3, 1, 7, 23, 41, 49, 155, 135, 513, 1127, 1443, 8081, 2553, 10389, 35459, 122513}}, {11284, 17, 47278, {1, 1, 7, 3, 25, 3, 117, 125, 283, 165, 1409, 1587, 7915, 12899, 12239, 48161, 7385}}, {11285, 17, 47286, {1, 3, 7, 3, 23, 19, 29, 47, 7, 723, 455, 4013, 2739, 12303, 29883, 51485, 1571}}, {11286, 17, 47312, {1, 1, 1, 11, 1, 31, 111, 199, 207, 209, 1163, 2865, 5335, 2647, 9125, 6737, 99881}}, {11287, 17, 47315, {1, 3, 1, 11, 31, 19, 59, 153, 65, 133, 1399, 2709, 905, 3257, 13603, 46299, 15139}}, {11288, 17, 47321, {1, 3, 1, 1, 23, 19, 123, 115, 59, 667, 333, 2461, 1843, 16049, 12353, 17297, 107779}}, {11289, 17, 47322, {1, 1, 5, 1, 5, 29, 91, 241, 97, 557, 1701, 2441, 2995, 13103, 9261, 55833, 843}}, {11290, 17, 47324, {1, 1, 1, 5, 15, 19, 23, 189, 69, 91, 427, 3149, 5199, 13073, 32273, 41503, 98749}}, {11291, 17, 47331, {1, 3, 5, 11, 19, 3, 71, 125, 307, 241, 861, 681, 5657, 5189, 7555, 2037, 72921}}, {11292, 17, 47338, {1, 1, 5, 5, 29, 61, 93, 61, 421, 685, 883, 1559, 5875, 10561, 11761, 18879, 31577}}, {11293, 17, 47366, {1, 3, 7, 15, 9, 29, 41, 241, 365, 941, 1087, 3743, 6781, 9467, 1409, 20605, 2361}}, {11294, 17, 47372, {1, 1, 5, 13, 25, 29, 7, 21, 41, 621, 1751, 3731, 2667, 8613, 20999, 3851, 39677}}, {11295, 17, 47375, {1, 1, 7, 5, 17, 23, 25, 43, 401, 749, 975, 91, 5277, 2711, 19847, 41419, 11851}}, {11296, 17, 47378, {1, 1, 7, 9, 13, 37, 113, 89, 435, 749, 1553, 1853, 7709, 5449, 25055, 45207, 2269}}, {11297, 17, 47387, {1, 3, 1, 11, 3, 59, 79, 13, 35, 901, 165, 907, 7579, 12739, 24679, 54163, 61059}}, {11298, 17, 47389, {1, 1, 5, 7, 9, 47, 101, 61, 25, 461, 1737, 2825, 4439, 5363, 28433, 61979, 120401}}, {11299, 17, 47390, {1, 3, 3, 3, 1, 55, 103, 1, 449, 473, 375, 2609, 4933, 3411, 19663, 6067, 61129}}, {11300, 17, 47396, {1, 1, 3, 9, 27, 29, 53, 151, 391, 507, 425, 3469, 6605, 5783, 31747, 37677, 116037}}, {11301, 17, 47400, {1, 1, 1, 5, 5, 43, 61, 67, 319, 553, 1163, 3095, 4447, 7505, 15617, 26167, 11145}}, {11302, 17, 47405, {1, 1, 5, 7, 3, 3, 9, 161, 155, 869, 337, 3693, 6847, 8449, 15077, 54769, 123335}}, {11303, 17, 47408, {1, 3, 3, 7, 11, 19, 17, 71, 105, 649, 323, 3033, 1695, 15973, 6361, 3163, 17669}}, {11304, 17, 47411, {1, 3, 7, 13, 13, 9, 3, 251, 149, 513, 637, 2211, 6397, 1741, 8547, 3165, 38241}}, {11305, 17, 47431, {1, 1, 5, 5, 1, 57, 73, 35, 287, 347, 221, 3261, 7693, 5443, 6175, 18181, 23733}}, {11306, 17, 47443, {1, 3, 7, 5, 5, 19, 1, 167, 5, 825, 815, 1369, 7657, 6169, 9583, 34761, 81003}}, {11307, 17, 47459, {1, 3, 3, 5, 15, 17, 23, 157, 475, 297, 1495, 811, 8135, 11453, 9683, 55505, 84361}}, {11308, 17, 47466, {1, 1, 1, 11, 1, 63, 59, 189, 205, 1023, 1065, 1095, 2293, 14629, 29399, 2925, 28327}}, {11309, 17, 47479, {1, 3, 1, 3, 31, 33, 85, 183, 383, 731, 1223, 3353, 3703, 5655, 31265, 12249, 22127}}, {11310, 17, 47480, {1, 3, 5, 7, 7, 29, 61, 3, 375, 95, 1815, 4065, 6287, 3797, 32397, 50581, 123371}}, {11311, 17, 47495, {1, 3, 1, 9, 13, 37, 57, 139, 43, 561, 425, 3603, 1167, 10281, 31825, 32673, 106169}}, {11312, 17, 47504, {1, 3, 5, 3, 15, 41, 29, 223, 79, 851, 1741, 2241, 5659, 9773, 18369, 37239, 14831}}, {11313, 17, 47519, {1, 3, 1, 1, 7, 11, 83, 63, 51, 521, 1911, 475, 5207, 3219, 10257, 40461, 9087}}, {11314, 17, 47520, {1, 3, 5, 7, 23, 17, 97, 195, 5, 451, 1971, 1881, 921, 8729, 3443, 64529, 67747}}, {11315, 17, 47530, {1, 1, 3, 9, 21, 63, 45, 181, 429, 605, 169, 3493, 2381, 2887, 19515, 53151, 60147}}, {11316, 17, 47537, {1, 3, 3, 7, 15, 11, 117, 161, 333, 139, 587, 2331, 3175, 12093, 12649, 52381, 107117}}, {11317, 17, 47555, {1, 1, 5, 15, 23, 57, 19, 57, 507, 461, 799, 611, 1589, 10909, 7649, 17817, 24677}}, {11318, 17, 47558, {1, 1, 3, 15, 1, 61, 9, 201, 401, 387, 527, 2855, 2339, 3813, 11825, 14273, 73745}}, {11319, 17, 47567, {1, 3, 1, 5, 1, 37, 27, 105, 475, 335, 1169, 3233, 3225, 12861, 10133, 36673, 55025}}, {11320, 17, 47569, {1, 1, 1, 9, 27, 53, 55, 197, 229, 5, 93, 1157, 7929, 9745, 5295, 15359, 75567}}, {11321, 17, 47572, {1, 1, 7, 5, 11, 3, 109, 81, 457, 159, 1899, 557, 1067, 295, 2661, 1145, 8745}}, {11322, 17, 47582, {1, 1, 1, 15, 31, 29, 77, 171, 411, 425, 1041, 2791, 2567, 5357, 21871, 27689, 103485}}, {11323, 17, 47591, {1, 3, 5, 11, 19, 47, 23, 97, 405, 667, 2045, 2951, 2063, 7775, 20629, 34283, 26925}}, {11324, 17, 47595, {1, 3, 5, 7, 5, 51, 125, 67, 165, 145, 733, 1649, 5787, 4333, 24355, 33397, 101001}}, {11325, 17, 47598, {1, 3, 7, 11, 13, 7, 117, 147, 449, 201, 953, 553, 1839, 6903, 10417, 42751, 36823}}, {11326, 17, 47609, {1, 1, 3, 5, 3, 21, 109, 35, 95, 953, 211, 2849, 5681, 16287, 16553, 30345, 69729}}, {11327, 17, 47612, {1, 3, 7, 5, 25, 37, 21, 143, 317, 621, 1417, 283, 3801, 15375, 3799, 13345, 59727}}, {11328, 17, 47616, {1, 3, 3, 9, 3, 37, 113, 127, 123, 979, 1225, 2585, 2055, 2571, 16727, 38863, 74347}}, {11329, 17, 47625, {1, 3, 3, 3, 23, 13, 49, 111, 277, 143, 1171, 605, 91, 13693, 1971, 18209, 114203}}, {11330, 17, 47640, {1, 1, 1, 9, 27, 33, 73, 9, 93, 343, 55, 3045, 2029, 3665, 28483, 6601, 72085}}, {11331, 17, 47649, {1, 1, 1, 15, 17, 55, 87, 231, 103, 1005, 1451, 3617, 7477, 2045, 10683, 39053, 1289}}, {11332, 17, 47655, {1, 3, 7, 7, 25, 55, 39, 89, 489, 609, 1969, 159, 7485, 10713, 28371, 14935, 95347}}, {11333, 17, 47661, {1, 3, 3, 13, 25, 9, 83, 167, 25, 135, 2017, 3313, 1493, 7799, 22479, 49471, 20149}}, {11334, 17, 47688, {1, 1, 1, 15, 25, 13, 63, 117, 97, 449, 1331, 229, 6027, 1023, 26705, 15283, 60385}}, {11335, 17, 47711, {1, 1, 7, 5, 5, 37, 3, 79, 337, 861, 1549, 915, 7303, 1503, 19245, 60721, 45313}}, {11336, 17, 47717, {1, 3, 7, 15, 19, 1, 11, 39, 505, 757, 1627, 2137, 3209, 7651, 31291, 45913, 26851}}, {11337, 17, 47721, {1, 3, 1, 5, 25, 21, 85, 233, 171, 269, 367, 1651, 3961, 2487, 1977, 7027, 2725}}, {11338, 17, 47724, {1, 1, 5, 15, 13, 23, 81, 145, 201, 323, 425, 2785, 1149, 12617, 11451, 23205, 117691}}, {11339, 17, 47727, {1, 1, 7, 11, 29, 37, 69, 141, 15, 773, 1299, 2147, 8129, 12227, 27811, 58701, 103637}}, {11340, 17, 47730, {1, 3, 5, 13, 3, 33, 29, 227, 261, 221, 823, 1399, 5107, 2423, 23809, 42175, 28207}}, {11341, 17, 47739, {1, 3, 1, 15, 21, 1, 121, 255, 259, 441, 45, 1899, 2489, 4155, 18317, 52695, 607}}, {11342, 17, 47745, {1, 3, 5, 9, 25, 43, 115, 111, 329, 997, 753, 1513, 6949, 3197, 28275, 48855, 25089}}, {11343, 17, 47752, {1, 3, 3, 3, 25, 9, 21, 213, 111, 173, 913, 1465, 4437, 9725, 1455, 53517, 81843}}, {11344, 17, 47758, {1, 3, 5, 5, 5, 25, 3, 159, 19, 203, 181, 3447, 6395, 2145, 11289, 16797, 59567}}, {11345, 17, 47765, {1, 3, 3, 1, 29, 25, 43, 115, 257, 833, 379, 941, 4389, 5795, 12593, 2471, 127149}}, {11346, 17, 47770, {1, 3, 1, 9, 3, 15, 81, 141, 155, 515, 1677, 2569, 1105, 15653, 24143, 3439, 17317}}, {11347, 17, 47782, {1, 3, 1, 13, 27, 13, 103, 87, 27, 971, 671, 629, 4943, 13897, 4003, 21507, 40193}}, {11348, 17, 47786, {1, 3, 5, 9, 1, 49, 11, 15, 511, 837, 1953, 1585, 1867, 9095, 543, 16993, 115187}}, {11349, 17, 47791, {1, 1, 5, 11, 21, 49, 37, 61, 9, 629, 1025, 1635, 4047, 15491, 28481, 43235, 53165}}, {11350, 17, 47793, {1, 1, 5, 7, 15, 57, 121, 119, 405, 29, 655, 3085, 7131, 14761, 2273, 47113, 8603}}, {11351, 17, 47796, {1, 1, 3, 3, 11, 45, 51, 107, 367, 235, 675, 3777, 6081, 16319, 19499, 36893, 25579}}, {11352, 17, 47814, {1, 1, 7, 11, 1, 13, 43, 159, 415, 423, 1223, 2201, 1089, 10189, 12457, 26691, 3603}}, {11353, 17, 47823, {1, 1, 3, 3, 3, 37, 109, 67, 487, 785, 637, 3931, 929, 14153, 25283, 483, 14371}}, {11354, 17, 47826, {1, 1, 7, 9, 31, 59, 9, 245, 479, 113, 1419, 3265, 8131, 11123, 32519, 12141, 82059}}, {11355, 17, 47837, {1, 1, 1, 7, 25, 25, 31, 13, 81, 217, 997, 1161, 1049, 5487, 8487, 57807, 126115}}, {11356, 17, 47854, {1, 1, 3, 15, 1, 23, 63, 39, 503, 933, 1915, 687, 547, 779, 7689, 38607, 125229}}, {11357, 17, 47856, {1, 1, 3, 3, 31, 49, 51, 87, 99, 327, 783, 3487, 7307, 2759, 22781, 56343, 126805}}, {11358, 17, 47871, {1, 3, 3, 11, 27, 43, 99, 197, 275, 19, 775, 329, 3815, 14277, 3363, 26375, 75427}}, {11359, 17, 47879, {1, 1, 5, 15, 15, 19, 65, 109, 103, 411, 1591, 2569, 1981, 4773, 7861, 6303, 127421}}, {11360, 17, 47880, {1, 3, 1, 13, 1, 53, 107, 151, 317, 201, 1053, 2701, 5039, 2179, 10085, 31727, 85579}}, {11361, 17, 47885, {1, 3, 1, 9, 5, 55, 71, 143, 187, 29, 1363, 2403, 2675, 2187, 12123, 32825, 56461}}, {11362, 17, 47886, {1, 1, 7, 11, 5, 57, 91, 95, 85, 597, 925, 11, 1915, 9159, 9997, 29565, 111655}}, {11363, 17, 47903, {1, 1, 5, 9, 25, 57, 79, 189, 205, 687, 471, 601, 5343, 9031, 7853, 6079, 40567}}, {11364, 17, 47907, {1, 1, 3, 1, 31, 53, 67, 191, 511, 369, 1273, 3859, 4253, 14469, 3427, 17691, 22599}}, {11365, 17, 47913, {1, 1, 3, 9, 17, 53, 101, 219, 41, 663, 635, 3889, 2197, 8125, 8313, 14957, 111445}}, {11366, 17, 47916, {1, 1, 5, 5, 7, 49, 113, 9, 399, 257, 617, 63, 2773, 4411, 1193, 54449, 89003}}, {11367, 17, 47928, {1, 1, 7, 11, 13, 29, 77, 73, 161, 419, 985, 303, 2237, 15217, 26621, 20441, 113955}}, {11368, 17, 47936, {1, 3, 3, 9, 17, 39, 37, 139, 289, 421, 1021, 2635, 2805, 5815, 9101, 48077, 114009}}, {11369, 17, 47945, {1, 1, 1, 15, 25, 43, 71, 35, 103, 827, 1301, 3567, 3425, 3689, 14453, 10733, 81257}}, {11370, 17, 47948, {1, 3, 5, 5, 15, 31, 41, 161, 481, 231, 1135, 3045, 439, 11785, 14863, 39729, 59539}}, {11371, 17, 47956, {1, 1, 5, 7, 27, 9, 81, 141, 395, 105, 41, 3719, 3105, 13685, 7451, 31381, 82907}}, {11372, 17, 47965, {1, 3, 1, 13, 15, 25, 127, 231, 433, 837, 1923, 1301, 2479, 3243, 21605, 55789, 11311}}, {11373, 17, 47970, {1, 3, 5, 7, 17, 5, 27, 111, 217, 445, 1245, 1029, 7663, 10291, 16483, 37503, 110205}}, {11374, 17, 47972, {1, 1, 1, 7, 31, 21, 51, 235, 487, 457, 1687, 2947, 5067, 13779, 7671, 7257, 119141}}, {11375, 17, 47981, {1, 1, 5, 13, 25, 31, 59, 183, 33, 887, 469, 813, 7939, 11775, 5795, 26227, 57703}}, {11376, 17, 47987, {1, 3, 3, 15, 17, 7, 19, 87, 365, 177, 1157, 1023, 3055, 15439, 27187, 32593, 112507}}, {11377, 17, 48010, {1, 1, 1, 9, 19, 49, 103, 239, 207, 409, 1613, 2793, 5477, 11221, 21611, 19963, 99333}}, {11378, 17, 48012, {1, 3, 3, 11, 17, 1, 103, 77, 93, 197, 1883, 4053, 4613, 11571, 1841, 23189, 4235}}, {11379, 17, 48023, {1, 3, 5, 9, 9, 49, 29, 231, 167, 593, 1909, 2457, 323, 10549, 6551, 45597, 96591}}, {11380, 17, 48033, {1, 1, 7, 11, 15, 39, 33, 61, 13, 879, 1589, 2169, 125, 2427, 13029, 24919, 14147}}, {11381, 17, 48051, {1, 3, 5, 5, 25, 53, 49, 255, 263, 917, 1997, 171, 2945, 14243, 12983, 21821, 119547}}, {11382, 17, 48071, {1, 1, 1, 15, 5, 25, 113, 235, 311, 377, 1059, 1365, 3457, 8699, 18617, 25119, 110659}}, {11383, 17, 48075, {1, 1, 5, 1, 9, 61, 1, 137, 301, 85, 1527, 3831, 923, 13753, 20909, 14007, 22939}}, {11384, 17, 48077, {1, 1, 7, 9, 23, 17, 31, 107, 55, 293, 425, 3513, 3503, 10075, 6299, 40007, 54355}}, {11385, 17, 48080, {1, 3, 5, 5, 27, 39, 95, 187, 239, 949, 531, 3541, 99, 6339, 32295, 10377, 111287}}, {11386, 17, 48099, {1, 1, 5, 15, 19, 39, 23, 89, 185, 47, 87, 1721, 2471, 13221, 13201, 31, 12897}}, {11387, 17, 48106, {1, 3, 1, 9, 7, 7, 109, 241, 39, 687, 175, 139, 583, 1629, 19775, 6371, 121879}}, {11388, 17, 48114, {1, 1, 1, 13, 13, 9, 73, 153, 367, 425, 217, 3981, 5203, 1111, 12333, 59799, 105259}}, {11389, 17, 48120, {1, 1, 3, 5, 7, 33, 27, 123, 335, 727, 1619, 3999, 7799, 2807, 2251, 45835, 113193}}, {11390, 17, 48128, {1, 3, 1, 7, 25, 3, 49, 163, 447, 555, 647, 1461, 5881, 15755, 32233, 48915, 96203}}, {11391, 17, 48145, {1, 3, 7, 7, 21, 11, 61, 101, 323, 165, 1489, 2933, 3363, 8471, 4311, 65279, 123813}}, {11392, 17, 48152, {1, 3, 1, 1, 15, 1, 101, 225, 473, 479, 1237, 113, 7591, 2883, 3891, 53703, 14607}}, {11393, 17, 48155, {1, 3, 5, 3, 17, 51, 23, 31, 487, 957, 1623, 2329, 2801, 6213, 7523, 14131, 23893}}, {11394, 17, 48182, {1, 1, 5, 7, 9, 39, 93, 105, 13, 481, 53, 3785, 5621, 11889, 993, 23611, 73651}}, {11395, 17, 48188, {1, 3, 7, 15, 21, 57, 97, 69, 339, 289, 1805, 2661, 1165, 6079, 1127, 51285, 54453}}, {11396, 17, 48203, {1, 1, 3, 3, 3, 3, 1, 179, 123, 1011, 1363, 231, 6983, 9499, 91, 52573, 32565}}, {11397, 17, 48217, {1, 3, 3, 15, 5, 37, 97, 7, 189, 547, 1965, 3821, 4907, 8181, 12857, 7907, 19361}}, {11398, 17, 48218, {1, 1, 5, 3, 29, 33, 45, 99, 359, 337, 1377, 577, 3117, 9545, 30093, 26147, 128509}}, {11399, 17, 48236, {1, 3, 5, 11, 7, 49, 99, 249, 37, 755, 383, 2845, 4153, 695, 11099, 33653, 105155}}, {11400, 17, 48241, {1, 3, 1, 1, 19, 3, 3, 177, 97, 323, 1367, 213, 4391, 11223, 26497, 12289, 39047}}, {11401, 17, 48244, {1, 1, 3, 7, 3, 33, 73, 199, 339, 479, 1797, 3905, 2849, 5667, 18015, 36653, 83491}}, {11402, 17, 48264, {1, 1, 5, 3, 27, 59, 27, 241, 49, 161, 451, 3993, 2489, 10681, 11895, 60405, 47021}}, {11403, 17, 48269, {1, 1, 7, 5, 9, 23, 115, 131, 383, 895, 1591, 585, 2571, 7485, 31535, 12871, 95717}}, {11404, 17, 48278, {1, 1, 1, 15, 13, 49, 3, 157, 311, 159, 1239, 159, 5643, 6405, 11763, 34609, 75259}}, {11405, 17, 48282, {1, 1, 1, 13, 11, 41, 119, 3, 165, 943, 2035, 179, 357, 14591, 20099, 4787, 12659}}, {11406, 17, 48288, {1, 1, 5, 11, 13, 9, 67, 139, 259, 947, 1559, 283, 1557, 11297, 29753, 21953, 100317}}, {11407, 17, 48311, {1, 1, 7, 11, 13, 39, 105, 83, 109, 723, 1643, 3599, 1471, 13653, 4583, 18595, 91935}}, {11408, 17, 48315, {1, 1, 5, 9, 25, 5, 69, 189, 209, 779, 1421, 467, 849, 12887, 10317, 3005, 100813}}, {11409, 17, 48317, {1, 3, 7, 11, 19, 1, 93, 239, 333, 713, 1525, 813, 5913, 10811, 7077, 20573, 86999}}, {11410, 17, 48329, {1, 3, 1, 5, 25, 1, 107, 153, 225, 889, 1319, 497, 2193, 11511, 17553, 23733, 83179}}, {11411, 17, 48330, {1, 3, 3, 3, 5, 45, 51, 37, 443, 851, 263, 4067, 2629, 10887, 29081, 30489, 1161}}, {11412, 17, 48337, {1, 1, 3, 9, 25, 19, 115, 31, 347, 641, 1103, 1121, 7051, 14071, 16663, 48517, 24655}}, {11413, 17, 48350, {1, 1, 3, 15, 11, 33, 123, 181, 225, 437, 875, 1997, 209, 5487, 1989, 6745, 38423}}, {11414, 17, 48353, {1, 3, 7, 5, 27, 5, 105, 203, 51, 683, 1523, 347, 6881, 4353, 4531, 29589, 108053}}, {11415, 17, 48360, {1, 1, 3, 9, 15, 33, 127, 145, 125, 429, 915, 1307, 1495, 3553, 26797, 36819, 121375}}, {11416, 17, 48374, {1, 3, 5, 15, 7, 1, 55, 99, 7, 405, 885, 59, 5359, 13969, 32037, 53399, 77293}}, {11417, 17, 48380, {1, 1, 7, 1, 29, 31, 89, 69, 405, 837, 1949, 2337, 1139, 14129, 16867, 15167, 21117}}, {11418, 17, 48405, {1, 1, 3, 5, 3, 25, 61, 175, 135, 109, 959, 501, 13, 16057, 25031, 16321, 27617}}, {11419, 17, 48406, {1, 3, 1, 5, 17, 39, 59, 113, 25, 707, 1641, 3489, 6193, 10085, 13837, 57851, 77475}}, {11420, 17, 48409, {1, 1, 3, 5, 17, 35, 111, 163, 253, 641, 715, 1101, 4411, 10771, 20241, 46415, 114719}}, {11421, 17, 48412, {1, 3, 1, 1, 7, 11, 77, 59, 71, 869, 1505, 751, 4367, 9603, 29735, 7333, 62487}}, {11422, 17, 48416, {1, 3, 7, 9, 3, 51, 93, 195, 497, 659, 1563, 3801, 6933, 9089, 10891, 9853, 93611}}, {11423, 17, 48419, {1, 3, 1, 7, 21, 47, 61, 117, 293, 281, 1547, 3437, 4947, 12119, 21425, 5591, 23951}}, {11424, 17, 48425, {1, 1, 7, 13, 19, 59, 121, 249, 147, 759, 1963, 465, 7785, 7015, 81, 47869, 123845}}, {11425, 17, 48434, {1, 1, 7, 13, 5, 35, 45, 69, 167, 263, 979, 2855, 1845, 5531, 17167, 7363, 89233}}, {11426, 17, 48443, {1, 3, 3, 3, 17, 43, 109, 193, 389, 867, 1403, 1271, 7127, 13977, 22547, 53997, 24475}}, {11427, 17, 48445, {1, 1, 1, 5, 25, 43, 47, 163, 417, 967, 819, 2433, 439, 8499, 29705, 32697, 109963}}, {11428, 17, 48453, {1, 1, 1, 15, 19, 5, 83, 237, 431, 697, 1383, 2499, 6907, 9033, 12147, 23479, 17649}}, {11429, 17, 48454, {1, 3, 5, 13, 27, 35, 103, 95, 239, 903, 537, 601, 417, 15859, 16533, 16753, 128229}}, {11430, 17, 48482, {1, 1, 3, 1, 11, 55, 57, 9, 229, 135, 805, 2745, 2023, 12645, 29135, 39051, 17065}}, {11431, 17, 48491, {1, 3, 5, 3, 13, 25, 77, 29, 449, 31, 1733, 1451, 3895, 11551, 1011, 22817, 35959}}, {11432, 17, 48501, {1, 3, 3, 3, 1, 31, 93, 47, 255, 393, 571, 443, 6079, 6245, 11773, 42087, 40651}}, {11433, 17, 48517, {1, 3, 1, 5, 17, 49, 119, 219, 375, 337, 29, 3409, 3187, 15243, 25853, 44385, 103675}}, {11434, 17, 48518, {1, 3, 7, 15, 15, 21, 79, 109, 81, 119, 603, 1665, 7813, 3485, 11801, 48693, 108307}}, {11435, 17, 48545, {1, 1, 1, 15, 9, 5, 103, 141, 181, 841, 7, 1217, 7713, 4843, 9089, 53641, 3029}}, {11436, 17, 48548, {1, 3, 3, 1, 29, 47, 13, 179, 439, 387, 1553, 3141, 947, 4893, 29119, 30865, 14207}}, {11437, 17, 48552, {1, 1, 1, 15, 29, 1, 41, 135, 43, 673, 1527, 883, 3211, 5195, 30219, 47133, 56819}}, {11438, 17, 48569, {1, 3, 5, 13, 13, 47, 97, 219, 277, 397, 1901, 821, 1961, 705, 7291, 19435, 123563}}, {11439, 17, 48575, {1, 1, 7, 15, 5, 49, 93, 59, 221, 205, 115, 559, 5633, 5819, 6923, 18301, 72639}}, {11440, 17, 48580, {1, 3, 5, 13, 29, 49, 25, 203, 125, 385, 487, 1897, 2177, 6859, 6105, 763, 36673}}, {11441, 17, 48584, {1, 3, 3, 9, 23, 63, 9, 115, 489, 89, 1113, 1351, 8181, 2569, 18263, 32619, 24795}}, {11442, 17, 48590, {1, 1, 5, 11, 25, 51, 97, 155, 15, 139, 1275, 3479, 5851, 3099, 7417, 57155, 90185}}, {11443, 17, 48595, {1, 3, 1, 11, 1, 37, 67, 221, 493, 475, 1881, 2277, 4365, 9411, 16629, 65229, 28803}}, {11444, 17, 48602, {1, 3, 1, 1, 15, 53, 39, 141, 453, 151, 335, 795, 1515, 2719, 24197, 21153, 129549}}, {11445, 17, 48604, {1, 1, 1, 7, 19, 31, 59, 123, 73, 149, 469, 1199, 3603, 1539, 29157, 50031, 22109}}, {11446, 17, 48618, {1, 1, 3, 15, 23, 51, 45, 211, 423, 553, 1289, 1125, 6347, 6711, 23761, 14109, 17261}}, {11447, 17, 48625, {1, 3, 5, 13, 5, 7, 35, 185, 263, 791, 161, 325, 4771, 11913, 31595, 56675, 68615}}, {11448, 17, 48626, {1, 1, 5, 9, 19, 27, 89, 147, 55, 197, 1695, 99, 755, 15115, 1933, 41439, 85063}}, {11449, 17, 48638, {1, 1, 7, 7, 17, 11, 103, 55, 281, 707, 1973, 2055, 5015, 5713, 3717, 44149, 8033}}, {11450, 17, 48668, {1, 3, 1, 5, 21, 49, 55, 93, 161, 565, 81, 3241, 3709, 8185, 16935, 60369, 118127}}, {11451, 17, 48677, {1, 3, 7, 9, 27, 1, 105, 133, 397, 351, 1021, 739, 161, 9971, 24733, 29239, 68853}}, {11452, 17, 48678, {1, 1, 7, 1, 1, 19, 97, 243, 73, 969, 313, 399, 2955, 2467, 18265, 60637, 35457}}, {11453, 17, 48687, {1, 3, 1, 11, 29, 25, 35, 35, 469, 143, 1195, 911, 1023, 14685, 10933, 16449, 102113}}, {11454, 17, 48692, {1, 1, 5, 3, 31, 21, 65, 181, 13, 235, 501, 3621, 3567, 8771, 32747, 59231, 91551}}, {11455, 17, 48696, {1, 1, 1, 13, 29, 21, 13, 33, 193, 565, 203, 3927, 4749, 9897, 26109, 14221, 27733}}, {11456, 17, 48704, {1, 1, 1, 5, 29, 41, 7, 125, 391, 295, 533, 2135, 3107, 7711, 27811, 55767, 78821}}, {11457, 17, 48707, {1, 1, 7, 3, 19, 25, 117, 195, 155, 685, 147, 2049, 3751, 4585, 24893, 36895, 80371}}, {11458, 17, 48714, {1, 3, 5, 5, 23, 41, 9, 125, 315, 809, 1019, 1453, 4605, 13753, 30641, 50677, 94781}}, {11459, 17, 48731, {1, 1, 1, 7, 27, 45, 103, 199, 37, 291, 651, 185, 6715, 15387, 30873, 63051, 123231}}, {11460, 17, 48740, {1, 1, 5, 7, 17, 5, 75, 129, 401, 107, 1681, 2039, 299, 12399, 30947, 26327, 91589}}, {11461, 17, 48750, {1, 3, 3, 15, 17, 19, 109, 19, 493, 797, 209, 929, 2821, 395, 22173, 27803, 87953}}, {11462, 17, 48761, {1, 3, 7, 5, 7, 5, 71, 159, 483, 389, 1817, 4093, 963, 4253, 31267, 63919, 62113}}, {11463, 17, 48785, {1, 3, 3, 15, 9, 49, 89, 49, 15, 61, 2041, 2357, 2173, 3349, 32565, 23207, 21177}}, {11464, 17, 48786, {1, 1, 1, 13, 15, 21, 31, 143, 387, 371, 567, 1903, 3793, 9559, 7055, 31251, 13663}}, {11465, 17, 48798, {1, 1, 3, 13, 3, 7, 49, 31, 255, 581, 627, 1947, 2965, 2787, 8275, 59785, 19979}}, {11466, 17, 48807, {1, 3, 3, 13, 29, 47, 53, 133, 301, 253, 1215, 3409, 5745, 247, 31585, 5555, 31011}}, {11467, 17, 48808, {1, 3, 7, 15, 23, 49, 1, 89, 141, 423, 707, 645, 7955, 10485, 27223, 35867, 45461}}, {11468, 17, 48814, {1, 1, 3, 3, 29, 25, 123, 63, 197, 429, 169, 3229, 3797, 4029, 29947, 52781, 16065}}, {11469, 17, 48826, {1, 3, 3, 7, 29, 17, 83, 95, 199, 253, 133, 265, 6723, 6207, 12863, 61311, 21937}}, {11470, 17, 48828, {1, 3, 7, 13, 19, 61, 89, 151, 249, 597, 1389, 717, 5111, 3285, 6251, 50237, 108703}}, {11471, 17, 48834, {1, 3, 5, 11, 1, 23, 35, 61, 143, 45, 625, 1693, 4943, 2213, 9317, 7601, 28359}}, {11472, 17, 48840, {1, 3, 3, 15, 29, 43, 115, 23, 167, 355, 977, 439, 4767, 9967, 22997, 54725, 125637}}, {11473, 17, 48845, {1, 3, 7, 1, 29, 45, 83, 71, 395, 247, 1, 113, 6393, 12445, 16137, 35125, 102053}}, {11474, 17, 48858, {1, 1, 1, 7, 17, 55, 17, 159, 33, 237, 207, 1297, 5611, 6023, 17709, 60905, 3533}}, {11475, 17, 48864, {1, 3, 1, 13, 27, 57, 27, 235, 141, 917, 1655, 659, 939, 559, 2651, 705, 80141}}, {11476, 17, 48869, {1, 3, 7, 3, 3, 17, 111, 117, 467, 129, 1105, 3457, 2093, 8513, 19941, 22111, 54597}}, {11477, 17, 48870, {1, 3, 7, 3, 5, 17, 59, 195, 23, 547, 1799, 1427, 391, 4043, 10407, 31055, 38495}}, {11478, 17, 48879, {1, 1, 1, 7, 21, 9, 71, 33, 209, 773, 1243, 3239, 3763, 15229, 9609, 24395, 56145}}, {11479, 17, 48887, {1, 3, 5, 13, 13, 45, 71, 91, 23, 553, 665, 1753, 5173, 4355, 14317, 42517, 32307}}, {11480, 17, 48899, {1, 3, 5, 11, 31, 3, 37, 95, 63, 425, 1611, 2983, 5075, 1375, 14305, 11099, 101203}}, {11481, 17, 48911, {1, 1, 3, 1, 21, 7, 15, 141, 389, 871, 617, 271, 1037, 13569, 13019, 58899, 54097}}, {11482, 17, 48920, {1, 3, 7, 1, 13, 25, 21, 251, 467, 373, 1539, 4065, 1871, 791, 26315, 64187, 119455}}, {11483, 17, 48926, {1, 3, 1, 3, 25, 37, 43, 9, 187, 323, 409, 443, 2861, 14145, 26185, 24049, 109613}}, {11484, 17, 48929, {1, 1, 3, 7, 21, 61, 3, 81, 445, 673, 1269, 613, 1279, 8209, 22911, 48017, 54181}}, {11485, 17, 48971, {1, 1, 1, 15, 25, 63, 71, 147, 217, 491, 183, 977, 4967, 3471, 8791, 11843, 68005}}, {11486, 17, 48974, {1, 1, 1, 5, 25, 43, 13, 237, 57, 919, 1641, 399, 4269, 7357, 3465, 63901, 61329}}, {11487, 17, 48981, {1, 1, 7, 15, 27, 57, 47, 187, 295, 117, 1223, 2963, 4995, 13279, 25107, 56089, 37293}}, {11488, 17, 48998, {1, 1, 5, 13, 29, 19, 83, 121, 129, 931, 1933, 1141, 3125, 3321, 22019, 52729, 119643}}, {11489, 17, 49007, {1, 1, 1, 1, 21, 19, 49, 241, 227, 57, 1919, 113, 6993, 4687, 1043, 5247, 15565}}, {11490, 17, 49028, {1, 3, 3, 15, 5, 21, 65, 129, 485, 173, 1663, 2419, 4279, 4167, 25827, 28457, 68219}}, {11491, 17, 49031, {1, 1, 3, 1, 17, 9, 65, 21, 487, 875, 1111, 1679, 6451, 14825, 23931, 16053, 79687}}, {11492, 17, 49056, {1, 3, 3, 5, 13, 5, 49, 15, 267, 389, 1111, 1505, 5815, 6285, 26075, 167, 70325}}, {11493, 17, 49065, {1, 1, 3, 11, 5, 15, 57, 171, 407, 497, 1979, 2819, 1267, 6893, 6601, 30971, 24477}}, {11494, 17, 49079, {1, 1, 1, 15, 7, 5, 69, 181, 195, 847, 1245, 4019, 2469, 1407, 17013, 43437, 16307}}, {11495, 17, 49083, {1, 3, 1, 11, 15, 17, 115, 197, 215, 35, 1489, 659, 4725, 11339, 30259, 52539, 13365}}, {11496, 17, 49088, {1, 1, 1, 13, 23, 43, 21, 33, 17, 969, 1321, 2469, 4371, 7685, 6817, 20179, 113483}}, {11497, 17, 49093, {1, 3, 7, 3, 31, 11, 79, 55, 123, 263, 1061, 2087, 183, 11623, 20703, 60291, 115261}}, {11498, 17, 49100, {1, 1, 5, 13, 5, 53, 21, 71, 399, 165, 1997, 2667, 7361, 8863, 27859, 17235, 77623}}, {11499, 17, 49103, {1, 3, 3, 15, 21, 55, 27, 31, 371, 289, 253, 1453, 105, 7035, 14787, 2281, 128359}}, {11500, 17, 49124, {1, 1, 3, 15, 23, 29, 3, 143, 47, 255, 115, 2741, 6773, 16267, 5975, 3689, 97497}}, {11501, 17, 49136, {1, 1, 1, 15, 9, 57, 109, 43, 359, 365, 1577, 4091, 7399, 10521, 7983, 56119, 65451}}, {11502, 17, 49139, {1, 3, 7, 7, 29, 55, 115, 155, 121, 679, 663, 2345, 3765, 4493, 9555, 24043, 41467}}, {11503, 17, 49142, {1, 1, 3, 1, 19, 55, 67, 255, 355, 701, 2027, 3703, 7839, 1701, 7657, 36429, 36623}}, {11504, 17, 49145, {1, 3, 5, 5, 29, 7, 31, 123, 21, 901, 1581, 3993, 5105, 9715, 18347, 27415, 19253}}, {11505, 17, 49146, {1, 3, 5, 3, 3, 53, 121, 105, 51, 577, 157, 2151, 5105, 7855, 8595, 24457, 55931}}, {11506, 17, 49171, {1, 3, 1, 9, 23, 25, 67, 115, 79, 809, 1215, 943, 1075, 7103, 729, 18791, 115977}}, {11507, 17, 49187, {1, 3, 1, 13, 3, 57, 105, 161, 277, 393, 1671, 2765, 5781, 13429, 24075, 10931, 50951}}, {11508, 17, 49190, {1, 3, 5, 9, 19, 61, 9, 227, 455, 541, 721, 2855, 949, 10159, 13801, 48199, 26747}}, {11509, 17, 49194, {1, 3, 1, 3, 25, 61, 53, 177, 441, 697, 1845, 3573, 6673, 9691, 911, 46387, 64727}}, {11510, 17, 49196, {1, 1, 1, 11, 7, 13, 95, 221, 455, 967, 869, 883, 6301, 5261, 18401, 35745, 114645}}, {11511, 17, 49207, {1, 3, 1, 11, 15, 7, 115, 217, 235, 539, 491, 603, 2201, 241, 25445, 29773, 122695}}, {11512, 17, 49216, {1, 1, 5, 3, 19, 9, 71, 193, 131, 927, 1931, 3981, 7537, 10811, 27285, 45865, 106171}}, {11513, 17, 49219, {1, 1, 7, 5, 5, 21, 107, 77, 363, 733, 1011, 3259, 5263, 15043, 19153, 32117, 129409}}, {11514, 17, 49222, {1, 1, 3, 13, 21, 5, 9, 103, 369, 699, 329, 1065, 895, 13211, 19017, 5359, 38335}}, {11515, 17, 49240, {1, 1, 7, 15, 21, 11, 73, 153, 371, 753, 805, 3519, 5839, 1809, 7201, 8189, 68361}}, {11516, 17, 49250, {1, 3, 7, 9, 27, 45, 25, 175, 317, 381, 961, 619, 4827, 15161, 19091, 29369, 21097}}, {11517, 17, 49262, {1, 1, 5, 5, 7, 7, 21, 69, 23, 589, 1413, 653, 911, 13599, 18349, 47307, 64047}}, {11518, 17, 49276, {1, 1, 1, 13, 27, 23, 87, 249, 135, 727, 375, 3641, 1489, 13053, 5151, 62689, 101347}}, {11519, 17, 49289, {1, 1, 5, 11, 7, 39, 1, 109, 203, 961, 973, 1181, 2357, 5123, 31481, 58345, 52705}}, {11520, 17, 49292, {1, 1, 1, 15, 25, 15, 85, 49, 77, 235, 1761, 2731, 4157, 2057, 27587, 30299, 52997}}, {11521, 17, 49298, {1, 1, 5, 3, 1, 13, 47, 219, 51, 521, 625, 3243, 7093, 10823, 9559, 58191, 95573}}, {11522, 17, 49319, {1, 3, 5, 13, 27, 63, 13, 7, 167, 909, 1559, 2103, 1807, 943, 28997, 31015, 85407}}, {11523, 17, 49320, {1, 1, 3, 5, 17, 21, 101, 163, 477, 223, 175, 3435, 7071, 5121, 28015, 33365, 121057}}, {11524, 17, 49325, {1, 3, 7, 1, 11, 35, 111, 41, 261, 45, 1009, 2827, 4019, 5029, 22289, 20235, 13481}}, {11525, 17, 49333, {1, 3, 5, 5, 15, 41, 109, 7, 329, 447, 65, 1317, 6169, 15947, 31191, 47091, 60643}}, {11526, 17, 49340, {1, 3, 7, 7, 21, 13, 29, 113, 511, 407, 1211, 2065, 455, 10049, 5745, 48589, 48669}}, {11527, 17, 49343, {1, 1, 5, 5, 21, 45, 89, 19, 279, 165, 1897, 957, 8045, 565, 4959, 37173, 100773}}, {11528, 17, 49352, {1, 3, 1, 15, 9, 17, 99, 143, 489, 633, 1721, 1255, 3655, 10083, 29079, 17109, 10035}}, {11529, 17, 49363, {1, 1, 3, 3, 3, 23, 47, 9, 255, 169, 1103, 1799, 7899, 7673, 19259, 61919, 112831}}, {11530, 17, 49375, {1, 1, 5, 5, 31, 37, 83, 229, 93, 575, 1589, 2353, 185, 7783, 9413, 9617, 123197}}, {11531, 17, 49391, {1, 3, 5, 7, 31, 7, 113, 255, 231, 309, 1215, 737, 3635, 14631, 28737, 45127, 111399}}, {11532, 17, 49405, {1, 1, 7, 1, 11, 5, 55, 235, 369, 983, 873, 655, 6277, 11425, 11191, 38231, 88941}}, {11533, 17, 49413, {1, 3, 1, 9, 3, 1, 119, 93, 245, 167, 853, 2543, 203, 5313, 14129, 6283, 107117}}, {11534, 17, 49420, {1, 3, 3, 13, 21, 33, 59, 167, 435, 163, 1873, 3341, 2895, 13205, 14147, 19567, 100127}}, {11535, 17, 49425, {1, 1, 5, 9, 7, 15, 39, 81, 475, 511, 1585, 63, 6861, 10055, 3577, 48999, 80979}}, {11536, 17, 49431, {1, 1, 5, 13, 21, 29, 17, 3, 499, 739, 1257, 2925, 8179, 13367, 18879, 19917, 109907}}, {11537, 17, 49432, {1, 3, 7, 13, 15, 57, 109, 19, 265, 579, 233, 2507, 5059, 14713, 9549, 41915, 56199}}, {11538, 17, 49441, {1, 3, 3, 5, 31, 25, 85, 163, 187, 795, 1597, 1963, 473, 4673, 4555, 51365, 73817}}, {11539, 17, 49456, {1, 3, 3, 13, 25, 35, 71, 251, 33, 971, 235, 1919, 6705, 14657, 23417, 56377, 21071}}, {11540, 17, 49476, {1, 3, 3, 11, 3, 29, 85, 193, 11, 831, 29, 1233, 6199, 11991, 9205, 3323, 23749}}, {11541, 17, 49479, {1, 3, 7, 7, 11, 15, 1, 17, 87, 665, 1593, 2331, 845, 7821, 89, 7057, 114975}}, {11542, 17, 49504, {1, 1, 5, 11, 9, 37, 39, 79, 455, 397, 1431, 1541, 7629, 15133, 21395, 35619, 123801}}, {11543, 17, 49514, {1, 1, 1, 7, 11, 59, 67, 45, 169, 869, 1547, 2947, 3025, 12967, 29927, 22181, 44783}}, {11544, 17, 49528, {1, 1, 5, 7, 3, 57, 123, 253, 369, 537, 83, 1147, 3469, 9775, 14137, 38899, 101143}}, {11545, 17, 49543, {1, 3, 5, 3, 19, 35, 11, 215, 343, 677, 1873, 1211, 3129, 9017, 29595, 1291, 39397}}, {11546, 17, 49544, {1, 1, 7, 3, 25, 7, 61, 229, 187, 839, 747, 3347, 4321, 13201, 19665, 56951, 85273}}, {11547, 17, 49550, {1, 1, 1, 1, 11, 5, 51, 41, 227, 895, 553, 2673, 6581, 6583, 15429, 33211, 100599}}, {11548, 17, 49558, {1, 3, 3, 5, 21, 27, 91, 65, 213, 341, 723, 567, 4761, 11549, 15041, 23079, 55245}}, {11549, 17, 49568, {1, 1, 3, 1, 15, 43, 83, 57, 473, 453, 1351, 2055, 5769, 3887, 29481, 57915, 14017}}, {11550, 17, 49578, {1, 3, 3, 3, 21, 29, 121, 137, 99, 527, 711, 1169, 7869, 6245, 25423, 38989, 87019}}, {11551, 17, 49600, {1, 1, 5, 11, 9, 61, 125, 7, 207, 245, 1019, 635, 7099, 13133, 11809, 56705, 18801}}, {11552, 17, 49612, {1, 3, 7, 9, 15, 31, 37, 205, 439, 651, 255, 971, 4311, 7137, 11821, 45041, 31081}}, {11553, 17, 49633, {1, 1, 5, 9, 7, 55, 51, 147, 371, 881, 359, 3021, 1141, 14515, 14605, 64067, 98231}}, {11554, 17, 49634, {1, 3, 1, 3, 29, 9, 109, 21, 437, 321, 753, 3227, 2929, 14787, 2451, 54331, 115921}}, {11555, 17, 49636, {1, 3, 5, 7, 1, 29, 13, 167, 89, 185, 409, 209, 6625, 5237, 22513, 2095, 26427}}, {11556, 17, 49643, {1, 1, 1, 3, 3, 31, 25, 145, 27, 345, 957, 823, 7873, 9469, 29115, 12455, 39447}}, {11557, 17, 49654, {1, 1, 3, 3, 31, 15, 99, 181, 247, 165, 441, 59, 1181, 2851, 1337, 4929, 31079}}, {11558, 17, 49657, {1, 1, 3, 11, 3, 47, 41, 53, 41, 435, 945, 3839, 8083, 4927, 26919, 24689, 61015}}, {11559, 17, 49663, {1, 3, 3, 9, 7, 21, 121, 233, 493, 271, 549, 1627, 5861, 377, 20751, 52927, 3649}}, {11560, 17, 49667, {1, 1, 1, 7, 15, 49, 29, 149, 57, 513, 873, 93, 337, 12559, 24287, 27771, 28207}}, {11561, 17, 49693, {1, 1, 5, 7, 7, 7, 75, 161, 419, 601, 55, 2599, 5325, 12419, 26755, 5103, 10231}}, {11562, 17, 49700, {1, 3, 5, 15, 3, 55, 67, 183, 7, 371, 141, 4093, 4567, 13971, 3327, 20701, 78819}}, {11563, 17, 49703, {1, 1, 1, 13, 15, 41, 45, 29, 375, 235, 1985, 1051, 5863, 7043, 11143, 59381, 55007}}, {11564, 17, 49712, {1, 3, 1, 15, 15, 29, 15, 101, 395, 39, 1839, 1689, 429, 405, 29337, 28573, 10599}}, {11565, 17, 49717, {1, 3, 3, 11, 7, 5, 11, 153, 235, 227, 561, 1037, 2283, 6657, 6729, 17939, 29809}}, {11566, 17, 49718, {1, 1, 1, 5, 15, 59, 33, 69, 275, 447, 661, 2071, 5811, 10463, 32707, 64503, 106313}}, {11567, 17, 49721, {1, 1, 7, 1, 21, 53, 21, 235, 497, 309, 1207, 1613, 7739, 12785, 7743, 37671, 29197}}, {11568, 17, 49727, {1, 3, 5, 9, 9, 51, 33, 105, 275, 917, 1911, 3607, 865, 899, 5405, 59593, 113965}}, {11569, 17, 49730, {1, 3, 1, 7, 7, 63, 51, 83, 481, 347, 1323, 3549, 2873, 12527, 16515, 61077, 63239}}, {11570, 17, 49735, {1, 1, 1, 1, 13, 21, 87, 139, 461, 215, 1173, 1197, 2091, 11247, 25647, 23443, 105761}}, {11571, 17, 49739, {1, 1, 1, 1, 27, 33, 21, 27, 365, 75, 351, 2111, 3897, 13325, 4821, 41355, 95681}}, {11572, 17, 49747, {1, 3, 5, 5, 15, 41, 15, 93, 397, 461, 1993, 321, 4375, 1205, 18417, 37549, 30181}}, {11573, 17, 49765, {1, 3, 5, 15, 1, 49, 101, 129, 215, 773, 1265, 2245, 2517, 16261, 32149, 3545, 27631}}, {11574, 17, 49770, {1, 1, 1, 15, 5, 5, 3, 127, 265, 721, 875, 3117, 2177, 7843, 15871, 22687, 89347}}, {11575, 17, 49772, {1, 3, 7, 11, 29, 23, 69, 41, 155, 257, 563, 509, 6105, 9169, 18341, 25373, 127397}}, {11576, 17, 49777, {1, 1, 5, 13, 31, 23, 65, 131, 131, 61, 1979, 2737, 3793, 3617, 14385, 189, 84567}}, {11577, 17, 49789, {1, 1, 1, 13, 21, 33, 43, 97, 83, 903, 1971, 3209, 5391, 7703, 13795, 3895, 78045}}, {11578, 17, 49817, {1, 3, 3, 5, 17, 53, 113, 237, 269, 83, 589, 4029, 3309, 14531, 11359, 25803, 25525}}, {11579, 17, 49829, {1, 1, 7, 1, 21, 35, 43, 73, 251, 705, 1737, 3341, 1581, 9663, 6251, 16329, 44491}}, {11580, 17, 49839, {1, 3, 3, 7, 17, 5, 65, 19, 203, 717, 807, 1759, 6907, 15801, 30369, 2655, 69565}}, {11581, 17, 49844, {1, 1, 1, 1, 31, 21, 75, 221, 115, 395, 1495, 2739, 1745, 5981, 28045, 56581, 130695}}, {11582, 17, 49851, {1, 3, 1, 9, 27, 5, 113, 123, 367, 701, 647, 117, 2389, 12309, 1747, 23421, 21583}}, {11583, 17, 49854, {1, 1, 1, 15, 27, 57, 95, 81, 347, 765, 1435, 1727, 153, 6051, 27085, 62787, 40903}}, {11584, 17, 49874, {1, 1, 3, 11, 23, 29, 23, 29, 169, 653, 835, 357, 5113, 5293, 11779, 23567, 64569}}, {11585, 17, 49883, {1, 1, 7, 13, 31, 7, 101, 235, 99, 247, 1267, 509, 3927, 14317, 3217, 24389, 34215}}, {11586, 17, 49886, {1, 3, 3, 5, 21, 27, 33, 229, 33, 551, 815, 3551, 4261, 13325, 31117, 40689, 66549}}, {11587, 17, 49892, {1, 3, 7, 1, 23, 1, 99, 11, 139, 569, 365, 1233, 3281, 7817, 8833, 47699, 97825}}, {11588, 17, 49895, {1, 1, 3, 1, 19, 39, 19, 151, 25, 73, 1271, 1435, 3109, 2571, 9191, 48257, 61001}}, {11589, 17, 49914, {1, 3, 7, 1, 23, 63, 1, 115, 159, 943, 1637, 1443, 809, 10705, 12563, 63111, 96343}}, {11590, 17, 49931, {1, 1, 7, 15, 5, 17, 65, 157, 45, 199, 371, 2497, 4367, 9109, 31955, 64253, 69279}}, {11591, 17, 49933, {1, 3, 3, 15, 29, 45, 103, 183, 87, 543, 97, 1545, 2719, 5619, 28871, 4049, 111825}}, {11592, 17, 49934, {1, 1, 5, 7, 27, 63, 65, 241, 103, 483, 579, 3589, 5673, 13283, 24193, 31993, 72713}}, {11593, 17, 49941, {1, 3, 7, 9, 21, 35, 59, 183, 459, 211, 753, 3941, 5389, 10535, 2895, 44307, 26577}}, {11594, 17, 49952, {1, 3, 1, 3, 9, 11, 15, 141, 159, 853, 1975, 4027, 8053, 16129, 32687, 29117, 67507}}, {11595, 17, 49967, {1, 3, 3, 1, 19, 51, 55, 167, 85, 869, 437, 457, 7879, 2097, 4403, 2139, 10589}}, {11596, 17, 49969, {1, 3, 3, 15, 19, 33, 63, 229, 197, 269, 1189, 317, 5087, 3147, 787, 64317, 43293}}, {11597, 17, 49972, {1, 3, 5, 11, 25, 25, 121, 37, 371, 117, 1683, 2921, 671, 11353, 32273, 57597, 56901}}, {11598, 17, 49976, {1, 3, 7, 7, 9, 37, 91, 159, 195, 1, 77, 2085, 985, 9999, 5639, 25041, 66393}}, {11599, 17, 49979, {1, 1, 7, 5, 11, 17, 67, 21, 301, 971, 591, 3809, 4795, 12301, 16977, 27495, 98539}}, {11600, 17, 49999, {1, 3, 1, 9, 13, 53, 83, 205, 111, 609, 631, 23, 1781, 15401, 1563, 34367, 40345}}, {11601, 17, 50008, {1, 3, 7, 1, 31, 23, 101, 47, 55, 905, 953, 733, 5173, 5937, 17703, 31077, 49707}}, {11602, 17, 50030, {1, 3, 5, 3, 5, 3, 127, 171, 511, 289, 685, 1157, 6521, 3301, 3017, 58857, 55289}}, {11603, 17, 50041, {1, 1, 5, 1, 1, 29, 59, 7, 423, 83, 797, 2633, 2015, 1657, 7575, 39819, 181}}, {11604, 17, 50042, {1, 3, 5, 15, 25, 27, 39, 99, 83, 381, 401, 1033, 867, 15645, 28643, 34917, 53215}}, {11605, 17, 50044, {1, 3, 5, 15, 17, 1, 67, 63, 355, 841, 681, 2807, 531, 15295, 7859, 64031, 121519}}, {11606, 17, 50057, {1, 3, 1, 5, 21, 57, 63, 247, 467, 101, 129, 2627, 4763, 479, 11145, 8861, 69803}}, {11607, 17, 50060, {1, 3, 1, 15, 13, 13, 77, 39, 297, 401, 1653, 659, 3909, 13179, 10477, 45967, 1665}}, {11608, 17, 50075, {1, 3, 7, 5, 29, 17, 35, 157, 309, 747, 1717, 1279, 6103, 3509, 17499, 22989, 43157}}, {11609, 17, 50077, {1, 1, 1, 7, 11, 51, 55, 119, 145, 505, 179, 3979, 1237, 12801, 15921, 13561, 69161}}, {11610, 17, 50091, {1, 1, 5, 7, 13, 9, 73, 203, 247, 257, 1607, 1183, 6237, 12327, 5059, 51645, 88781}}, {11611, 17, 50096, {1, 3, 5, 9, 1, 9, 27, 59, 235, 81, 689, 2457, 893, 6107, 27643, 40145, 2329}}, {11612, 17, 50099, {1, 1, 1, 11, 11, 19, 65, 63, 27, 513, 1473, 2955, 8037, 4991, 22035, 41965, 82589}}, {11613, 17, 50106, {1, 3, 1, 1, 9, 53, 97, 95, 247, 379, 259, 2789, 1433, 15299, 18309, 51813, 63271}}, {11614, 17, 50116, {1, 1, 5, 1, 11, 41, 69, 193, 391, 27, 1511, 1575, 1161, 14741, 25193, 31149, 79573}}, {11615, 17, 50133, {1, 3, 7, 15, 19, 31, 101, 9, 111, 427, 531, 1335, 767, 15075, 28373, 54015, 108021}}, {11616, 17, 50144, {1, 3, 1, 3, 29, 17, 83, 163, 179, 703, 2027, 3027, 5267, 16111, 23929, 9653, 38633}}, {11617, 17, 50153, {1, 3, 5, 9, 3, 7, 111, 1, 311, 143, 1563, 2605, 301, 2447, 5009, 63767, 37529}}, {11618, 17, 50154, {1, 3, 5, 5, 23, 23, 97, 11, 475, 741, 1385, 2491, 1717, 14587, 6289, 27651, 21873}}, {11619, 17, 50168, {1, 1, 5, 1, 31, 31, 119, 93, 209, 861, 1591, 1233, 3469, 9799, 5969, 35965, 110841}}, {11620, 17, 50179, {1, 1, 5, 13, 19, 31, 69, 107, 423, 651, 757, 665, 1297, 9985, 14983, 3153, 26425}}, {11621, 17, 50188, {1, 1, 5, 3, 23, 5, 89, 77, 461, 799, 683, 2885, 845, 12847, 26721, 13145, 88689}}, {11622, 17, 50194, {1, 1, 3, 3, 19, 3, 41, 71, 247, 293, 1047, 2349, 6815, 2413, 13683, 51421, 110737}}, {11623, 17, 50203, {1, 3, 3, 9, 19, 51, 91, 193, 447, 305, 751, 1757, 1547, 12683, 4645, 39767, 6433}}, {11624, 17, 50212, {1, 1, 7, 1, 11, 51, 83, 175, 461, 259, 1337, 175, 877, 15895, 22487, 8079, 71291}}, {11625, 17, 50216, {1, 1, 1, 11, 13, 23, 19, 69, 285, 629, 563, 2433, 815, 4851, 10617, 59949, 59119}}, {11626, 17, 50222, {1, 3, 5, 5, 19, 49, 47, 27, 343, 579, 197, 35, 7051, 2441, 30091, 9645, 101899}}, {11627, 17, 50229, {1, 1, 3, 3, 21, 25, 125, 215, 159, 259, 1915, 2193, 4213, 16157, 8665, 10967, 112793}}, {11628, 17, 50230, {1, 1, 5, 11, 29, 11, 53, 45, 121, 533, 257, 1749, 6311, 7715, 12037, 12003, 38987}}, {11629, 17, 50234, {1, 3, 1, 11, 25, 31, 93, 191, 231, 801, 361, 1275, 5031, 7927, 26333, 39795, 45875}}, {11630, 17, 50251, {1, 1, 5, 1, 7, 37, 117, 35, 257, 225, 1769, 1805, 1593, 1507, 27741, 31561, 52107}}, {11631, 17, 50253, {1, 1, 3, 3, 27, 23, 55, 5, 137, 677, 459, 2821, 1331, 5845, 17751, 17557, 60495}}, {11632, 17, 50262, {1, 1, 7, 7, 5, 47, 85, 17, 287, 757, 2013, 2233, 2975, 13769, 23199, 32117, 84429}}, {11633, 17, 50266, {1, 3, 3, 11, 1, 15, 39, 133, 79, 915, 147, 1489, 2319, 13715, 31317, 46785, 64147}}, {11634, 17, 50272, {1, 1, 3, 11, 1, 25, 83, 69, 395, 537, 895, 565, 2781, 12685, 7831, 36369, 27871}}, {11635, 17, 50287, {1, 1, 1, 1, 13, 17, 59, 179, 509, 979, 315, 3495, 1773, 16375, 27873, 18065, 20285}}, {11636, 17, 50295, {1, 1, 5, 1, 27, 31, 39, 251, 121, 899, 751, 1603, 7501, 425, 25791, 35407, 110405}}, {11637, 17, 50305, {1, 1, 7, 11, 11, 3, 107, 247, 79, 349, 405, 3469, 2201, 8007, 22891, 7901, 11413}}, {11638, 17, 50306, {1, 1, 1, 11, 15, 55, 121, 151, 127, 239, 115, 611, 6191, 15435, 19831, 64745, 110473}}, {11639, 17, 50311, {1, 1, 7, 1, 21, 25, 57, 11, 31, 823, 1855, 2337, 7655, 10845, 22167, 36977, 94265}}, {11640, 17, 50320, {1, 3, 5, 1, 31, 11, 117, 97, 341, 953, 1499, 2487, 559, 8609, 6321, 20669, 28945}}, {11641, 17, 50323, {1, 3, 7, 1, 5, 27, 15, 161, 83, 139, 75, 3645, 5227, 16199, 1833, 21767, 67579}}, {11642, 17, 50325, {1, 1, 7, 5, 31, 35, 75, 115, 451, 773, 1987, 1069, 651, 961, 16317, 18391, 56519}}, {11643, 17, 50339, {1, 1, 1, 1, 31, 11, 23, 255, 215, 251, 867, 2381, 2351, 13189, 17705, 33569, 102361}}, {11644, 17, 50356, {1, 3, 7, 1, 17, 49, 49, 125, 445, 947, 1985, 2113, 3025, 6277, 1981, 33329, 99413}}, {11645, 17, 50365, {1, 3, 3, 3, 27, 7, 59, 109, 37, 777, 1359, 2157, 3185, 7317, 30887, 10499, 126563}}, {11646, 17, 50366, {1, 3, 3, 9, 27, 5, 99, 167, 457, 363, 2031, 1805, 4661, 8695, 4667, 61129, 81143}}, {11647, 17, 50368, {1, 1, 5, 13, 5, 47, 95, 249, 289, 631, 1739, 2947, 7169, 13019, 10429, 16197, 11539}}, {11648, 17, 50377, {1, 3, 7, 15, 27, 45, 93, 131, 269, 835, 399, 1133, 6509, 1279, 3635, 17977, 38667}}, {11649, 17, 50386, {1, 1, 5, 3, 17, 51, 1, 77, 105, 237, 995, 2643, 6921, 6707, 30129, 1543, 94501}}, {11650, 17, 50397, {1, 1, 1, 7, 29, 1, 117, 33, 141, 805, 1553, 3943, 45, 8911, 24191, 45191, 36525}}, {11651, 17, 50411, {1, 1, 7, 7, 31, 21, 97, 29, 179, 345, 1059, 701, 7709, 15831, 22923, 57233, 58961}}, {11652, 17, 50414, {1, 1, 3, 15, 15, 5, 85, 227, 13, 351, 1167, 3283, 6833, 565, 21019, 53249, 4639}}, {11653, 17, 50425, {1, 3, 3, 5, 27, 1, 5, 89, 101, 295, 481, 2397, 1459, 3729, 3703, 25109, 69237}}, {11654, 17, 50451, {1, 3, 7, 13, 31, 37, 69, 147, 505, 487, 1701, 1145, 2061, 10067, 18269, 13049, 92091}}, {11655, 17, 50463, {1, 3, 3, 1, 29, 39, 33, 199, 499, 377, 1081, 3787, 4843, 16287, 23397, 19083, 91381}}, {11656, 17, 50467, {1, 1, 1, 13, 21, 61, 121, 251, 511, 615, 625, 2245, 5951, 16165, 2155, 37301, 68319}}, {11657, 17, 50473, {1, 1, 1, 15, 19, 35, 57, 99, 1, 97, 1177, 3109, 7213, 5447, 25251, 24803, 107449}}, {11658, 17, 50487, {1, 3, 1, 11, 11, 59, 95, 135, 329, 931, 843, 2847, 463, 10725, 3933, 32325, 44545}}, {11659, 17, 50501, {1, 1, 7, 13, 13, 57, 29, 175, 11, 701, 231, 2907, 5555, 16159, 1249, 38049, 40115}}, {11660, 17, 50505, {1, 1, 5, 15, 23, 37, 47, 221, 465, 631, 57, 1189, 2083, 6561, 10725, 8015, 21231}}, {11661, 17, 50514, {1, 3, 7, 5, 9, 25, 31, 47, 139, 639, 999, 2909, 39, 16227, 16967, 30555, 125541}}, {11662, 17, 50516, {1, 3, 3, 9, 5, 3, 9, 9, 43, 999, 159, 3063, 3661, 7089, 28929, 55305, 105521}}, {11663, 17, 50536, {1, 3, 1, 11, 17, 7, 3, 57, 457, 753, 135, 3721, 1111, 7267, 12603, 50511, 85433}}, {11664, 17, 50547, {1, 3, 5, 1, 27, 3, 107, 187, 247, 891, 1311, 423, 1767, 14769, 22119, 36225, 94267}}, {11665, 17, 50566, {1, 3, 5, 15, 1, 13, 65, 35, 435, 557, 1755, 1343, 2647, 179, 7781, 62903, 18741}}, {11666, 17, 50572, {1, 1, 7, 15, 29, 57, 63, 227, 407, 163, 1207, 2717, 2731, 1737, 6379, 14937, 46683}}, {11667, 17, 50583, {1, 1, 1, 9, 25, 35, 93, 1, 77, 677, 875, 3787, 3075, 14033, 23017, 3487, 14999}}, {11668, 17, 50593, {1, 3, 3, 9, 3, 45, 115, 61, 437, 823, 1401, 459, 301, 5519, 31003, 64499, 1757}}, {11669, 17, 50599, {1, 3, 1, 11, 23, 37, 69, 215, 197, 961, 1501, 2953, 3679, 6775, 24679, 44215, 52357}}, {11670, 17, 50613, {1, 3, 1, 15, 29, 23, 1, 133, 451, 677, 687, 1269, 5987, 11975, 11929, 63691, 48683}}, {11671, 17, 50617, {1, 1, 1, 7, 13, 31, 13, 71, 355, 345, 1193, 3421, 7601, 7413, 6719, 28681, 97605}}, {11672, 17, 50618, {1, 1, 5, 13, 23, 3, 15, 253, 109, 17, 341, 471, 1131, 14901, 31783, 41369, 64139}}, {11673, 17, 50620, {1, 1, 3, 1, 25, 25, 85, 157, 443, 83, 269, 3789, 7977, 7783, 28433, 30563, 82805}}, {11674, 17, 50628, {1, 1, 7, 5, 3, 11, 83, 63, 253, 349, 217, 2733, 4183, 2759, 7617, 41749, 14015}}, {11675, 17, 50638, {1, 1, 5, 7, 7, 7, 91, 201, 449, 247, 889, 3829, 3529, 14253, 24091, 33521, 6049}}, {11676, 17, 50652, {1, 1, 3, 7, 25, 7, 123, 161, 227, 965, 511, 619, 4359, 11833, 12859, 26091, 3867}}, {11677, 17, 50655, {1, 1, 7, 9, 5, 41, 71, 111, 95, 261, 1809, 3835, 7625, 12085, 28885, 64829, 48981}}, {11678, 17, 50662, {1, 1, 5, 3, 13, 55, 57, 79, 457, 785, 653, 1429, 3879, 13559, 3953, 18205, 5777}}, {11679, 17, 50665, {1, 3, 5, 9, 23, 25, 107, 255, 151, 191, 119, 3367, 1081, 12691, 3575, 38171, 42573}}, {11680, 17, 50673, {1, 1, 7, 15, 3, 23, 115, 233, 265, 187, 1961, 1303, 5101, 1035, 6803, 14557, 4527}}, {11681, 17, 50683, {1, 1, 3, 11, 19, 37, 45, 167, 17, 793, 1361, 3571, 5889, 14421, 20453, 5093, 59927}}, {11682, 17, 50689, {1, 1, 7, 15, 3, 53, 1, 11, 159, 389, 171, 2351, 7189, 3109, 1541, 53595, 24247}}, {11683, 17, 50690, {1, 1, 7, 1, 7, 43, 75, 175, 253, 687, 1811, 3277, 447, 8711, 14281, 53265, 7379}}, {11684, 17, 50692, {1, 1, 5, 3, 21, 45, 113, 25, 309, 31, 1765, 305, 1423, 115, 26421, 50267, 122115}}, {11685, 17, 50696, {1, 3, 5, 13, 15, 47, 17, 17, 445, 775, 243, 3959, 7263, 9375, 12017, 57399, 58203}}, {11686, 17, 50704, {1, 3, 3, 1, 31, 37, 37, 213, 125, 929, 243, 1011, 2841, 4499, 16961, 12639, 23381}}, {11687, 17, 50713, {1, 3, 1, 3, 7, 53, 31, 165, 311, 239, 731, 1759, 1769, 203, 23201, 20267, 33381}}, {11688, 17, 50719, {1, 3, 3, 11, 1, 1, 73, 57, 497, 693, 693, 861, 5587, 16307, 8559, 28785, 91147}}, {11689, 17, 50738, {1, 3, 1, 3, 11, 61, 11, 241, 473, 479, 1831, 1771, 25, 10217, 32683, 40165, 98433}}, {11690, 17, 50757, {1, 1, 5, 3, 17, 51, 39, 27, 189, 631, 689, 2849, 1849, 9143, 19263, 32729, 23031}}, {11691, 17, 50761, {1, 1, 5, 9, 15, 39, 103, 83, 485, 689, 1561, 55, 5219, 12069, 32225, 7781, 114299}}, {11692, 17, 50764, {1, 1, 1, 1, 31, 49, 71, 145, 485, 907, 1551, 3931, 4081, 2159, 24747, 6953, 15887}}, {11693, 17, 50770, {1, 1, 3, 7, 27, 61, 57, 153, 15, 881, 271, 267, 5827, 7625, 18179, 3769, 42211}}, {11694, 17, 50776, {1, 3, 1, 3, 21, 49, 65, 177, 341, 851, 1825, 3347, 113, 8077, 1117, 9463, 115821}}, {11695, 17, 50803, {1, 3, 5, 11, 27, 17, 75, 35, 475, 389, 313, 2187, 7005, 911, 21921, 10979, 13705}}, {11696, 17, 50805, {1, 1, 5, 9, 1, 49, 15, 21, 163, 355, 193, 3473, 4451, 5325, 28343, 251, 125963}}, {11697, 17, 50806, {1, 3, 7, 1, 9, 63, 9, 129, 453, 887, 1841, 597, 1989, 14755, 7847, 7581, 251}}, {11698, 17, 50816, {1, 3, 7, 13, 31, 15, 123, 3, 427, 101, 1039, 1355, 3653, 2871, 28937, 31243, 108827}}, {11699, 17, 50826, {1, 3, 7, 13, 3, 17, 71, 243, 145, 747, 1933, 1105, 455, 6355, 20321, 60075, 31575}}, {11700, 17, 50840, {1, 3, 5, 5, 11, 25, 95, 85, 461, 459, 313, 173, 1413, 15761, 31481, 63793, 29047}}, {11701, 17, 50845, {1, 3, 7, 7, 3, 5, 3, 95, 107, 995, 1203, 2965, 2419, 5325, 17667, 40205, 91059}}, {11702, 17, 50852, {1, 1, 3, 9, 25, 3, 113, 79, 359, 69, 93, 1539, 483, 12701, 19075, 35021, 17929}}, {11703, 17, 50855, {1, 3, 5, 1, 31, 35, 67, 97, 105, 381, 973, 1355, 3901, 3847, 12343, 64309, 29835}}, {11704, 17, 50862, {1, 3, 7, 1, 11, 33, 117, 237, 449, 101, 317, 23, 5157, 8187, 28839, 29465, 97485}}, {11705, 17, 50876, {1, 3, 5, 5, 1, 49, 93, 71, 89, 607, 1143, 3271, 5825, 8529, 18479, 23859, 40571}}, {11706, 17, 50879, {1, 3, 1, 3, 13, 35, 79, 9, 315, 943, 1199, 1521, 2023, 11745, 8273, 27643, 89545}}, {11707, 17, 50882, {1, 3, 5, 1, 21, 3, 15, 111, 19, 895, 1539, 3331, 6741, 9087, 5231, 13435, 60645}}, {11708, 17, 50894, {1, 3, 1, 9, 25, 9, 109, 253, 263, 425, 915, 1955, 659, 6249, 11803, 34523, 22645}}, {11709, 17, 50899, {1, 1, 1, 9, 15, 23, 13, 79, 369, 689, 565, 743, 3897, 8837, 13753, 17213, 86801}}, {11710, 17, 50905, {1, 1, 1, 5, 31, 27, 111, 231, 25, 617, 897, 1325, 4885, 5731, 2027, 34639, 67863}}, {11711, 17, 50924, {1, 1, 3, 13, 1, 9, 29, 23, 95, 113, 1035, 2729, 6555, 335, 24795, 35387, 31301}}, {11712, 17, 50936, {1, 1, 1, 7, 3, 53, 91, 143, 167, 773, 207, 31, 4993, 7953, 26997, 40031, 113939}}, {11713, 17, 50944, {1, 1, 3, 5, 17, 43, 121, 231, 411, 575, 1621, 3079, 535, 3313, 19443, 58271, 54207}}, {11714, 17, 50973, {1, 1, 1, 7, 11, 41, 61, 81, 97, 91, 1987, 981, 3745, 819, 23785, 48331, 63761}}, {11715, 17, 50974, {1, 1, 5, 13, 7, 29, 25, 73, 355, 669, 241, 65, 2249, 5551, 5217, 58573, 34049}}, {11716, 17, 51002, {1, 1, 7, 11, 1, 45, 125, 107, 127, 639, 1989, 2727, 2103, 8985, 30249, 40037, 40931}}, {11717, 17, 51007, {1, 1, 5, 13, 21, 59, 99, 131, 359, 615, 665, 577, 2559, 3555, 11355, 26213, 76427}}, {11718, 17, 51009, {1, 3, 3, 1, 19, 9, 85, 111, 381, 661, 561, 3419, 1355, 8473, 329, 4989, 9087}}, {11719, 17, 51029, {1, 1, 7, 5, 11, 23, 33, 95, 343, 9, 1579, 2663, 6245, 267, 7187, 25381, 103181}}, {11720, 17, 51036, {1, 1, 7, 11, 23, 7, 113, 49, 89, 587, 1221, 409, 873, 15531, 2721, 44519, 25349}}, {11721, 17, 51063, {1, 3, 3, 1, 17, 17, 45, 239, 453, 639, 1433, 2829, 6009, 12447, 9393, 59979, 93343}}, {11722, 17, 51067, {1, 1, 3, 15, 19, 61, 125, 101, 219, 327, 1551, 1623, 951, 8379, 21009, 64089, 21891}}, {11723, 17, 51070, {1, 1, 5, 7, 23, 5, 111, 43, 57, 71, 407, 4027, 4869, 12033, 19941, 51969, 120115}}, {11724, 17, 51074, {1, 3, 7, 15, 17, 49, 31, 145, 185, 169, 1559, 4011, 5293, 7559, 23487, 12213, 2757}}, {11725, 17, 51079, {1, 3, 7, 3, 3, 59, 119, 3, 509, 539, 1623, 539, 1405, 3913, 213, 30293, 68497}}, {11726, 17, 51083, {1, 1, 1, 9, 15, 43, 67, 171, 397, 233, 379, 1681, 6877, 9169, 19667, 1971, 115347}}, {11727, 17, 51093, {1, 1, 5, 15, 1, 45, 25, 133, 99, 181, 1825, 3485, 5633, 4629, 30181, 15761, 87161}}, {11728, 17, 51094, {1, 1, 5, 3, 5, 55, 97, 117, 303, 591, 733, 3631, 4305, 169, 5361, 64491, 71793}}, {11729, 17, 51124, {1, 1, 5, 11, 19, 9, 5, 147, 223, 51, 1763, 3899, 7393, 8107, 19619, 60509, 61427}}, {11730, 17, 51131, {1, 1, 1, 15, 15, 3, 103, 15, 423, 649, 613, 1387, 6229, 4147, 17517, 225, 35697}}, {11731, 17, 51151, {1, 3, 1, 3, 21, 57, 77, 193, 203, 649, 631, 3753, 4259, 3983, 27707, 33623, 83857}}, {11732, 17, 51153, {1, 3, 3, 5, 11, 37, 95, 201, 83, 643, 1639, 153, 7683, 15249, 23859, 27021, 43321}}, {11733, 17, 51156, {1, 3, 5, 13, 23, 31, 69, 215, 303, 433, 1325, 1013, 2903, 12659, 3813, 34497, 59651}}, {11734, 17, 51165, {1, 3, 1, 9, 15, 39, 113, 253, 173, 393, 19, 2343, 2939, 8871, 29741, 2141, 121675}}, {11735, 17, 51175, {1, 1, 7, 9, 7, 9, 91, 211, 169, 299, 507, 2849, 1321, 15397, 23949, 32387, 108691}}, {11736, 17, 51184, {1, 1, 7, 13, 1, 21, 119, 127, 229, 253, 39, 323, 1831, 121, 17385, 45511, 43743}}, {11737, 17, 51187, {1, 1, 1, 15, 25, 25, 97, 209, 375, 945, 1343, 2205, 1701, 13085, 25547, 55555, 129395}}, {11738, 17, 51203, {1, 1, 1, 5, 31, 25, 91, 255, 163, 169, 703, 1607, 4731, 7413, 10013, 10925, 109151}}, {11739, 17, 51220, {1, 3, 3, 9, 15, 47, 71, 219, 9, 37, 231, 3227, 3447, 8129, 23421, 30113, 120725}}, {11740, 17, 51224, {1, 3, 3, 11, 15, 47, 93, 203, 299, 865, 151, 3999, 1245, 8487, 13355, 27373, 93583}}, {11741, 17, 51233, {1, 3, 7, 5, 13, 7, 97, 81, 271, 95, 513, 365, 5039, 403, 5285, 29475, 129347}}, {11742, 17, 51234, {1, 1, 7, 7, 9, 27, 25, 207, 161, 785, 1453, 3031, 763, 2313, 29347, 61457, 52561}}, {11743, 17, 51239, {1, 3, 3, 11, 25, 25, 39, 61, 165, 803, 1435, 3643, 299, 13751, 24239, 53955, 94889}}, {11744, 17, 51246, {1, 3, 5, 9, 9, 13, 63, 221, 123, 947, 905, 913, 953, 7429, 25409, 43017, 2217}}, {11745, 17, 51248, {1, 1, 3, 3, 31, 19, 107, 211, 503, 675, 1921, 3027, 1273, 5699, 20683, 55605, 119803}}, {11746, 17, 51251, {1, 1, 3, 3, 9, 17, 115, 183, 325, 259, 2013, 1505, 6999, 11573, 5315, 18731, 9405}}, {11747, 17, 51257, {1, 3, 1, 5, 29, 37, 81, 145, 5, 851, 1803, 2011, 6655, 3601, 11325, 17137, 68501}}, {11748, 17, 51266, {1, 3, 5, 1, 25, 51, 111, 19, 75, 765, 1843, 139, 7253, 12967, 13387, 48631, 124881}}, {11749, 17, 51280, {1, 3, 3, 7, 15, 29, 7, 231, 13, 901, 1913, 3817, 3993, 3049, 32367, 4201, 90837}}, {11750, 17, 51285, {1, 3, 1, 11, 27, 5, 109, 57, 81, 147, 1141, 2153, 5255, 6367, 189, 5959, 88843}}, {11751, 17, 51286, {1, 3, 5, 5, 19, 35, 17, 149, 407, 889, 1583, 1727, 465, 10785, 6043, 21785, 80935}}, {11752, 17, 51289, {1, 1, 3, 7, 15, 21, 105, 249, 427, 491, 923, 3189, 8103, 3875, 18347, 35799, 36703}}, {11753, 17, 51295, {1, 1, 3, 15, 3, 45, 93, 197, 265, 309, 1909, 1635, 1743, 9499, 21897, 36889, 67449}}, {11754, 17, 51296, {1, 3, 1, 11, 15, 57, 31, 231, 363, 879, 1377, 1941, 6969, 10721, 21933, 33419, 102939}}, {11755, 17, 51311, {1, 1, 3, 9, 3, 57, 49, 51, 71, 991, 885, 1367, 2937, 9301, 29893, 9867, 113711}}, {11756, 17, 51329, {1, 3, 7, 7, 11, 59, 123, 247, 51, 659, 1323, 3371, 3417, 12295, 2021, 62753, 28059}}, {11757, 17, 51350, {1, 1, 7, 11, 3, 57, 53, 1, 203, 287, 219, 3531, 1365, 6235, 30187, 4479, 29567}}, {11758, 17, 51356, {1, 1, 7, 9, 5, 41, 41, 39, 137, 495, 149, 2421, 7365, 11381, 25403, 16063, 47491}}, {11759, 17, 51363, {1, 1, 5, 13, 25, 25, 47, 25, 213, 661, 1345, 883, 7573, 3291, 21303, 8033, 102639}}, {11760, 17, 51365, {1, 1, 5, 3, 9, 49, 75, 221, 455, 139, 1533, 3155, 1023, 7249, 10129, 63165, 1713}}, {11761, 17, 51370, {1, 3, 5, 11, 17, 1, 23, 241, 83, 359, 1243, 2791, 2975, 6271, 19035, 55057, 7625}}, {11762, 17, 51372, {1, 3, 1, 9, 17, 61, 109, 255, 447, 939, 899, 551, 7049, 4247, 17333, 43369, 30105}}, {11763, 17, 51377, {1, 1, 3, 5, 3, 31, 79, 39, 225, 605, 1893, 3523, 5391, 6879, 18619, 2339, 108295}}, {11764, 17, 51383, {1, 1, 5, 1, 29, 15, 123, 39, 239, 57, 843, 2799, 4755, 4993, 23383, 45559, 48359}}, {11765, 17, 51384, {1, 1, 5, 5, 7, 5, 99, 1, 351, 213, 1061, 721, 343, 16071, 29641, 55607, 76727}}, {11766, 17, 51397, {1, 3, 1, 7, 9, 9, 15, 25, 87, 595, 71, 3769, 2583, 10105, 28639, 48899, 49753}}, {11767, 17, 51407, {1, 3, 5, 3, 31, 29, 99, 77, 323, 615, 581, 1725, 2471, 16263, 4903, 205, 55441}}, {11768, 17, 51422, {1, 1, 5, 11, 17, 53, 47, 53, 125, 717, 867, 1251, 4009, 13981, 10165, 4769, 117431}}, {11769, 17, 51435, {1, 1, 3, 7, 7, 19, 119, 27, 163, 11, 693, 3197, 3981, 12591, 26017, 62113, 48391}}, {11770, 17, 51440, {1, 1, 3, 15, 13, 17, 13, 81, 19, 821, 677, 233, 5227, 14855, 18269, 18895, 90041}}, {11771, 17, 51446, {1, 1, 3, 9, 27, 61, 125, 221, 415, 183, 1137, 1879, 3451, 3599, 27317, 53449, 35499}}, {11772, 17, 51463, {1, 3, 3, 15, 3, 27, 53, 93, 17, 405, 373, 2531, 3121, 2299, 1593, 34623, 102389}}, {11773, 17, 51467, {1, 1, 1, 11, 23, 19, 85, 87, 209, 17, 1805, 4067, 7401, 6097, 5865, 61383, 42971}}, {11774, 17, 51491, {1, 1, 7, 9, 29, 43, 99, 125, 385, 347, 97, 1121, 1533, 10545, 17383, 48649, 78443}}, {11775, 17, 51493, {1, 3, 3, 13, 7, 9, 95, 105, 463, 911, 357, 423, 5701, 2389, 16307, 17817, 108775}}, {11776, 17, 51494, {1, 3, 5, 11, 21, 21, 79, 53, 511, 995, 1709, 1715, 6031, 10507, 10735, 48817, 28569}}, {11777, 17, 51508, {1, 3, 5, 7, 31, 49, 43, 109, 267, 981, 1529, 3611, 3379, 1295, 27489, 46721, 58423}}, {11778, 17, 51518, {1, 3, 3, 11, 3, 31, 21, 3, 79, 31, 1885, 3029, 6337, 15457, 8995, 9955, 95019}}, {11779, 17, 51520, {1, 1, 7, 13, 9, 9, 77, 73, 111, 769, 813, 1599, 5925, 1063, 12151, 54125, 67723}}, {11780, 17, 51526, {1, 1, 1, 7, 13, 5, 43, 201, 379, 199, 769, 3227, 3995, 1543, 21903, 10651, 122007}}, {11781, 17, 51529, {1, 3, 7, 13, 11, 53, 83, 201, 231, 137, 617, 2395, 2513, 6659, 9387, 15653, 96927}}, {11782, 17, 51530, {1, 3, 1, 13, 29, 19, 97, 57, 231, 985, 805, 1169, 831, 15867, 20195, 53533, 99735}}, {11783, 17, 51537, {1, 1, 3, 13, 19, 15, 19, 39, 99, 31, 421, 755, 7439, 4927, 19893, 15449, 47937}}, {11784, 17, 51547, {1, 3, 3, 9, 1, 17, 71, 37, 289, 537, 69, 3687, 6537, 12295, 28403, 6627, 72991}}, {11785, 17, 51559, {1, 3, 3, 15, 31, 53, 21, 223, 451, 309, 895, 3923, 3149, 5167, 1979, 31425, 53485}}, {11786, 17, 51565, {1, 3, 1, 1, 29, 7, 5, 197, 445, 455, 185, 633, 897, 4561, 28833, 39477, 46665}}, {11787, 17, 51568, {1, 1, 3, 9, 29, 19, 45, 239, 323, 1005, 101, 2083, 7403, 10401, 987, 32301, 58141}}, {11788, 17, 51580, {1, 3, 3, 5, 31, 17, 7, 141, 245, 301, 1607, 3381, 7517, 6663, 6327, 15321, 19963}}, {11789, 17, 51583, {1, 1, 7, 5, 5, 37, 109, 31, 285, 767, 1689, 2961, 5511, 15415, 32011, 14889, 7237}}, {11790, 17, 51584, {1, 1, 3, 7, 31, 35, 47, 157, 407, 719, 1213, 1241, 2475, 10321, 11547, 52641, 21603}}, {11791, 17, 51593, {1, 1, 1, 7, 5, 45, 35, 137, 403, 321, 1151, 529, 6297, 3059, 27791, 18387, 101431}}, {11792, 17, 51594, {1, 1, 3, 11, 21, 19, 97, 121, 377, 325, 741, 1601, 1115, 6233, 19089, 40491, 53259}}, {11793, 17, 51607, {1, 1, 1, 9, 3, 13, 83, 243, 443, 91, 1455, 1875, 3327, 7245, 12735, 14943, 44163}}, {11794, 17, 51608, {1, 3, 5, 11, 1, 15, 107, 211, 25, 125, 623, 1319, 6133, 12177, 1377, 32547, 110919}}, {11795, 17, 51620, {1, 1, 3, 3, 7, 39, 23, 99, 433, 581, 53, 3421, 733, 12767, 23595, 22957, 88821}}, {11796, 17, 51624, {1, 1, 1, 13, 5, 53, 103, 127, 409, 379, 1155, 3097, 6529, 11685, 22147, 46003, 59771}}, {11797, 17, 51642, {1, 3, 3, 3, 15, 37, 9, 67, 237, 79, 697, 1943, 1021, 3217, 16013, 14727, 105729}}, {11798, 17, 51649, {1, 1, 7, 1, 9, 43, 55, 79, 63, 553, 871, 2881, 6487, 4667, 24263, 41995, 60907}}, {11799, 17, 51652, {1, 1, 7, 7, 23, 31, 55, 23, 451, 593, 85, 43, 965, 12491, 15121, 16129, 90639}}, {11800, 17, 51659, {1, 1, 7, 13, 11, 53, 21, 123, 237, 147, 511, 2105, 5961, 4465, 4015, 19069, 89203}}, {11801, 17, 51661, {1, 3, 5, 1, 1, 39, 59, 239, 391, 91, 923, 85, 1047, 1489, 31119, 58485, 129171}}, {11802, 17, 51670, {1, 3, 5, 13, 3, 21, 35, 205, 219, 795, 901, 2465, 5887, 275, 22003, 29659, 50589}}, {11803, 17, 51674, {1, 3, 1, 5, 1, 35, 127, 147, 159, 791, 1643, 1811, 1199, 3851, 9681, 19845, 127075}}, {11804, 17, 51698, {1, 3, 3, 7, 17, 19, 13, 223, 395, 971, 125, 181, 4455, 13305, 30433, 46161, 122277}}, {11805, 17, 51707, {1, 3, 1, 3, 19, 1, 15, 71, 425, 459, 655, 2251, 5525, 7611, 5819, 1255, 43107}}, {11806, 17, 51725, {1, 1, 5, 15, 3, 9, 83, 191, 439, 663, 399, 2263, 1857, 15421, 2079, 2381, 59193}}, {11807, 17, 51737, {1, 3, 5, 5, 1, 7, 9, 77, 347, 419, 1329, 3173, 7295, 3631, 13435, 3217, 18053}}, {11808, 17, 51753, {1, 3, 3, 7, 29, 39, 35, 71, 119, 745, 603, 2247, 377, 3297, 30983, 27857, 105739}}, {11809, 17, 51754, {1, 1, 5, 13, 9, 59, 57, 239, 247, 921, 1383, 2315, 241, 4435, 24661, 6129, 122727}}, {11810, 17, 51779, {1, 1, 5, 7, 3, 15, 39, 165, 27, 803, 609, 3081, 6009, 12665, 24155, 51647, 3857}}, {11811, 17, 51791, {1, 3, 5, 11, 27, 41, 61, 255, 195, 169, 557, 1739, 4029, 1791, 471, 16321, 49801}}, {11812, 17, 51796, {1, 3, 7, 13, 17, 45, 35, 177, 109, 113, 551, 219, 4065, 303, 15489, 25427, 12349}}, {11813, 17, 51809, {1, 3, 5, 5, 25, 15, 79, 165, 231, 867, 483, 3563, 6611, 11277, 3193, 37455, 127373}}, {11814, 17, 51816, {1, 3, 3, 11, 25, 21, 47, 255, 27, 543, 485, 2675, 5893, 3029, 3857, 50967, 14681}}, {11815, 17, 51819, {1, 3, 7, 11, 3, 23, 81, 135, 77, 227, 417, 1733, 5175, 15295, 15985, 50329, 48641}}, {11816, 17, 51827, {1, 3, 5, 1, 3, 47, 33, 67, 201, 235, 1299, 3703, 1959, 8091, 11115, 10869, 9595}}, {11817, 17, 51829, {1, 3, 7, 13, 1, 45, 61, 49, 471, 923, 1827, 2175, 1433, 3473, 3781, 7923, 121525}}, {11818, 17, 51834, {1, 3, 5, 7, 25, 59, 113, 19, 415, 839, 167, 3549, 7435, 6573, 767, 2751, 18383}}, {11819, 17, 51836, {1, 3, 3, 1, 5, 11, 125, 241, 395, 423, 955, 2551, 963, 8197, 30253, 10473, 28505}}, {11820, 17, 51846, {1, 1, 1, 3, 5, 31, 69, 103, 153, 505, 1507, 2827, 165, 4943, 8343, 54253, 87593}}, {11821, 17, 51849, {1, 3, 3, 1, 7, 37, 27, 75, 251, 623, 965, 1907, 6063, 761, 765, 10103, 43479}}, {11822, 17, 51855, {1, 1, 1, 13, 7, 21, 53, 219, 267, 57, 959, 579, 2951, 13797, 3249, 29895, 47467}}, {11823, 17, 51858, {1, 1, 5, 9, 13, 7, 85, 107, 3, 635, 1235, 1339, 3263, 3895, 25911, 7521, 34149}}, {11824, 17, 51869, {1, 1, 5, 15, 29, 37, 73, 43, 413, 993, 499, 719, 1557, 14397, 11245, 58197, 127901}}, {11825, 17, 51870, {1, 1, 5, 15, 9, 37, 87, 57, 63, 337, 927, 1887, 6407, 11237, 23233, 53567, 120449}}, {11826, 17, 51874, {1, 1, 3, 7, 27, 11, 85, 227, 159, 849, 647, 1977, 4623, 7343, 8089, 4251, 26609}}, {11827, 17, 51918, {1, 1, 5, 11, 11, 3, 105, 191, 189, 627, 367, 3935, 6647, 13069, 26195, 23137, 56427}}, {11828, 17, 51926, {1, 1, 3, 3, 29, 51, 39, 3, 437, 1011, 1061, 1747, 3051, 11165, 8155, 9723, 41035}}, {11829, 17, 51932, {1, 3, 7, 15, 9, 43, 79, 195, 265, 395, 1349, 337, 911, 15767, 3593, 42859, 70181}}, {11830, 17, 51936, {1, 3, 7, 7, 11, 47, 11, 85, 489, 801, 1177, 3861, 3517, 9209, 27505, 12291, 35691}}, {11831, 17, 51948, {1, 1, 3, 9, 15, 61, 71, 123, 287, 419, 1079, 3489, 3519, 12739, 21341, 24323, 33961}}, {11832, 17, 51954, {1, 3, 7, 3, 9, 17, 119, 137, 389, 391, 601, 1875, 2197, 5271, 13289, 43597, 43279}}, {11833, 17, 51959, {1, 3, 7, 15, 29, 35, 41, 171, 183, 701, 1673, 981, 5479, 21, 11353, 64953, 88189}}, {11834, 17, 51971, {1, 3, 3, 13, 15, 35, 35, 81, 297, 245, 475, 393, 5401, 12369, 21129, 65213, 125013}}, {11835, 17, 51983, {1, 1, 7, 13, 15, 57, 25, 143, 389, 111, 1219, 2195, 769, 9005, 10367, 39435, 3631}}, {11836, 17, 51992, {1, 3, 3, 13, 9, 29, 9, 47, 127, 377, 1195, 1221, 5751, 15481, 10537, 29909, 112691}}, {11837, 17, 51997, {1, 1, 3, 5, 17, 47, 29, 1, 299, 651, 1023, 1601, 5917, 3781, 18421, 42393, 51789}}, {11838, 17, 52016, {1, 3, 3, 15, 31, 51, 101, 147, 367, 159, 359, 705, 3773, 8649, 31373, 5733, 58287}}, {11839, 17, 52021, {1, 3, 5, 11, 11, 51, 55, 79, 147, 917, 1945, 1725, 289, 12777, 30099, 3013, 91527}}, {11840, 17, 52031, {1, 1, 7, 13, 1, 51, 33, 27, 169, 573, 117, 2479, 761, 1283, 32723, 13589, 88821}}, {11841, 17, 52033, {1, 1, 1, 3, 23, 13, 33, 207, 137, 391, 1309, 4093, 6889, 827, 9331, 57113, 110193}}, {11842, 17, 52034, {1, 1, 1, 13, 15, 57, 115, 53, 59, 443, 1, 3545, 6923, 6603, 8631, 41703, 8519}}, {11843, 17, 52048, {1, 1, 5, 5, 25, 29, 53, 153, 107, 423, 1829, 2469, 1843, 889, 31727, 20701, 6343}}, {11844, 17, 52053, {1, 1, 7, 13, 11, 41, 7, 219, 77, 663, 329, 2639, 1111, 1293, 16771, 20731, 46973}}, {11845, 17, 52057, {1, 3, 3, 15, 23, 19, 45, 107, 111, 155, 1595, 1821, 471, 6089, 21587, 49259, 85393}}, {11846, 17, 52067, {1, 3, 1, 3, 27, 21, 39, 227, 359, 885, 449, 2615, 3519, 5377, 16017, 57159, 82399}}, {11847, 17, 52076, {1, 3, 3, 15, 31, 33, 77, 33, 87, 821, 701, 2859, 1777, 3007, 16757, 5447, 3557}}, {11848, 17, 52079, {1, 1, 1, 15, 11, 31, 127, 79, 363, 341, 169, 3451, 6351, 6867, 13511, 833, 103151}}, {11849, 17, 52081, {1, 3, 5, 7, 27, 23, 5, 67, 159, 535, 103, 843, 8187, 6891, 19169, 22565, 95255}}, {11850, 17, 52109, {1, 3, 5, 5, 15, 27, 53, 49, 343, 815, 1203, 1031, 6359, 1337, 1629, 47783, 103391}}, {11851, 17, 52127, {1, 3, 1, 1, 13, 19, 51, 185, 45, 549, 619, 2247, 2541, 10421, 31507, 60785, 87139}}, {11852, 17, 52128, {1, 3, 1, 15, 29, 9, 47, 127, 41, 767, 1375, 2183, 7169, 12855, 15021, 377, 69327}}, {11853, 17, 52133, {1, 1, 3, 9, 5, 23, 23, 203, 101, 809, 1155, 2885, 3901, 3081, 1827, 65373, 106133}}, {11854, 17, 52148, {1, 3, 3, 13, 3, 21, 73, 135, 353, 905, 1757, 1361, 3801, 15541, 2261, 17159, 18037}}, {11855, 17, 52155, {1, 1, 7, 7, 27, 23, 57, 33, 225, 407, 1709, 1159, 6353, 13341, 15883, 17339, 50423}}, {11856, 17, 52157, {1, 1, 3, 15, 13, 21, 33, 91, 183, 975, 1623, 3187, 5495, 8947, 7031, 19687, 104483}}, {11857, 17, 52172, {1, 3, 5, 7, 17, 25, 77, 1, 335, 85, 1783, 2617, 4463, 3807, 12883, 24487, 66205}}, {11858, 17, 52178, {1, 1, 3, 15, 23, 37, 83, 93, 211, 757, 903, 2681, 49, 435, 21057, 63635, 36489}}, {11859, 17, 52184, {1, 3, 1, 13, 3, 45, 63, 57, 65, 21, 627, 1467, 51, 15887, 27465, 59227, 108233}}, {11860, 17, 52199, {1, 1, 7, 5, 15, 41, 53, 57, 301, 677, 803, 1675, 6937, 3159, 14281, 22355, 37783}}, {11861, 17, 52200, {1, 1, 5, 13, 15, 43, 39, 245, 191, 875, 1505, 2085, 3903, 185, 24461, 28939, 98771}}, {11862, 17, 52205, {1, 1, 7, 9, 17, 25, 29, 31, 439, 159, 533, 3177, 4155, 403, 23735, 61817, 121909}}, {11863, 17, 52206, {1, 1, 3, 15, 29, 43, 111, 47, 483, 513, 63, 2423, 4979, 5159, 15499, 33391, 51575}}, {11864, 17, 52232, {1, 1, 5, 15, 15, 43, 13, 41, 445, 929, 1365, 2023, 6173, 6067, 30969, 51457, 51179}}, {11865, 17, 52237, {1, 3, 3, 11, 15, 17, 93, 235, 159, 599, 635, 1113, 1017, 7413, 7737, 20051, 79127}}, {11866, 17, 52243, {1, 1, 1, 15, 5, 19, 81, 65, 479, 119, 1831, 2515, 2929, 15395, 31607, 29969, 49935}}, {11867, 17, 52246, {1, 3, 1, 13, 23, 47, 45, 151, 51, 217, 803, 3265, 5907, 14371, 8287, 25659, 27655}}, {11868, 17, 52252, {1, 1, 1, 13, 13, 53, 11, 63, 501, 487, 1683, 1147, 4693, 2761, 19359, 2215, 112393}}, {11869, 17, 52261, {1, 3, 3, 1, 31, 15, 61, 237, 129, 119, 135, 39, 6509, 3753, 16997, 3841, 24521}}, {11870, 17, 52265, {1, 3, 5, 7, 5, 27, 113, 251, 217, 923, 229, 2259, 5241, 6331, 6773, 41929, 89605}}, {11871, 17, 52266, {1, 1, 5, 9, 17, 41, 21, 185, 95, 137, 1151, 195, 913, 531, 15731, 22893, 93521}}, {11872, 17, 52273, {1, 1, 5, 1, 29, 57, 123, 11, 345, 581, 227, 1539, 7527, 8537, 16429, 8437, 18953}}, {11873, 17, 52274, {1, 1, 3, 7, 7, 21, 103, 239, 115, 513, 1287, 3717, 331, 5453, 18943, 17247, 64975}}, {11874, 17, 52288, {1, 3, 7, 11, 21, 37, 79, 83, 93, 155, 1297, 1371, 1109, 6569, 21137, 29237, 24007}}, {11875, 17, 52300, {1, 1, 1, 13, 17, 11, 127, 89, 397, 497, 1017, 721, 2837, 5623, 31745, 52243, 107225}}, {11876, 17, 52303, {1, 1, 7, 9, 15, 43, 29, 215, 449, 233, 313, 2587, 2903, 2735, 4539, 50481, 85279}}, {11877, 17, 52321, {1, 1, 3, 15, 13, 35, 109, 211, 299, 255, 1595, 533, 1801, 13965, 25277, 52347, 13447}}, {11878, 17, 52322, {1, 1, 1, 15, 9, 23, 115, 119, 207, 973, 1339, 1315, 6465, 9917, 4593, 65435, 2515}}, {11879, 17, 52328, {1, 3, 3, 3, 7, 25, 115, 115, 213, 845, 1445, 1217, 1563, 12491, 5197, 44409, 79895}}, {11880, 17, 52333, {1, 1, 1, 3, 9, 33, 31, 203, 19, 895, 1145, 2893, 4807, 7501, 6999, 54883, 13797}}, {11881, 17, 52351, {1, 1, 3, 1, 19, 51, 73, 29, 451, 533, 83, 2477, 335, 9703, 9747, 57427, 69443}}, {11882, 17, 52357, {1, 1, 7, 5, 21, 11, 53, 133, 165, 291, 591, 1419, 3661, 4697, 21363, 53467, 84063}}, {11883, 17, 52372, {1, 1, 7, 3, 13, 7, 85, 49, 193, 289, 1531, 709, 2351, 12085, 28553, 57145, 129517}}, {11884, 17, 52381, {1, 1, 1, 1, 17, 19, 13, 213, 75, 977, 811, 1813, 7293, 13795, 28569, 28133, 11949}}, {11885, 17, 52386, {1, 1, 5, 1, 27, 11, 47, 89, 271, 65, 1651, 2331, 3289, 6227, 15027, 19959, 22945}}, {11886, 17, 52395, {1, 3, 7, 9, 17, 37, 17, 245, 249, 501, 405, 951, 3005, 9757, 10265, 35575, 70529}}, {11887, 17, 52403, {1, 3, 1, 15, 21, 47, 15, 75, 113, 45, 125, 1393, 3361, 13477, 24325, 39743, 67409}}, {11888, 17, 52423, {1, 3, 5, 1, 13, 3, 33, 51, 463, 241, 1421, 1607, 3937, 3405, 26653, 33955, 97915}}, {11889, 17, 52427, {1, 3, 7, 13, 29, 17, 41, 193, 461, 787, 459, 4019, 1887, 13831, 9387, 25215, 69801}}, {11890, 17, 52432, {1, 3, 1, 11, 31, 55, 13, 235, 85, 953, 109, 233, 1893, 13225, 26165, 59237, 15845}}, {11891, 17, 52438, {1, 1, 1, 13, 11, 43, 127, 193, 143, 831, 875, 2471, 7011, 3063, 21979, 42113, 80581}}, {11892, 17, 52444, {1, 3, 7, 1, 5, 1, 63, 55, 349, 525, 441, 2695, 3301, 15737, 13355, 16727, 25001}}, {11893, 17, 52457, {1, 3, 7, 7, 31, 23, 87, 99, 331, 101, 1341, 3, 1447, 9507, 18627, 2503, 57597}}, {11894, 17, 52468, {1, 1, 1, 9, 11, 19, 89, 141, 269, 31, 1933, 429, 7765, 5905, 15327, 25913, 17281}}, {11895, 17, 52480, {1, 3, 1, 9, 23, 61, 75, 15, 121, 635, 1409, 615, 7841, 11993, 1637, 26073, 70763}}, {11896, 17, 52498, {1, 3, 3, 1, 5, 63, 85, 3, 443, 87, 1201, 275, 3457, 16187, 26839, 16593, 36335}}, {11897, 17, 52516, {1, 1, 5, 5, 27, 61, 1, 145, 287, 563, 1135, 2703, 733, 10209, 3937, 23807, 56857}}, {11898, 17, 52520, {1, 3, 3, 7, 1, 41, 97, 155, 305, 395, 1607, 1171, 1061, 12301, 8041, 12111, 66831}}, {11899, 17, 52525, {1, 3, 7, 15, 9, 61, 127, 225, 125, 231, 87, 2433, 6951, 2999, 24859, 61685, 111943}}, {11900, 17, 52531, {1, 3, 5, 15, 13, 39, 87, 57, 305, 469, 1929, 1559, 1383, 2779, 3883, 845, 45181}}, {11901, 17, 52540, {1, 1, 1, 15, 19, 1, 23, 41, 207, 731, 501, 1147, 6543, 5011, 483, 56889, 48993}}, {11902, 17, 52545, {1, 3, 3, 15, 21, 35, 75, 129, 441, 497, 953, 201, 6849, 2893, 6351, 62163, 84127}}, {11903, 17, 52546, {1, 1, 1, 9, 21, 31, 91, 79, 345, 649, 1529, 805, 4931, 12887, 30167, 52305, 92561}}, {11904, 17, 52552, {1, 1, 5, 1, 3, 21, 121, 223, 67, 185, 801, 889, 7443, 8419, 19929, 11451, 11487}}, {11905, 17, 52557, {1, 1, 3, 15, 21, 51, 119, 31, 197, 773, 617, 2055, 799, 9105, 12353, 33635, 27589}}, {11906, 17, 52569, {1, 3, 5, 3, 27, 11, 41, 105, 289, 877, 1175, 3111, 3161, 12537, 18001, 38061, 59089}}, {11907, 17, 52575, {1, 3, 3, 5, 3, 27, 101, 253, 225, 915, 1757, 1601, 3391, 10443, 3983, 58427, 93391}}, {11908, 17, 52582, {1, 3, 1, 7, 9, 43, 85, 115, 169, 285, 1267, 3791, 2701, 5599, 10099, 48105, 45219}}, {11909, 17, 52594, {1, 1, 7, 13, 25, 57, 35, 223, 265, 451, 1913, 2715, 8017, 3725, 7079, 34611, 61159}}, {11910, 17, 52615, {1, 1, 3, 7, 23, 27, 93, 195, 449, 845, 865, 655, 4263, 12743, 7467, 7929, 7095}}, {11911, 17, 52619, {1, 3, 5, 5, 29, 51, 109, 123, 227, 693, 2033, 3829, 7187, 4027, 17861, 45093, 7355}}, {11912, 17, 52624, {1, 1, 1, 11, 27, 31, 127, 75, 443, 479, 865, 1377, 711, 3791, 27235, 17405, 25975}}, {11913, 17, 52645, {1, 3, 5, 7, 1, 49, 79, 167, 471, 453, 211, 265, 8163, 6517, 3413, 17283, 51961}}, {11914, 17, 52663, {1, 3, 1, 5, 17, 29, 15, 239, 385, 239, 425, 2197, 3553, 14913, 14889, 31645, 67477}}, {11915, 17, 52664, {1, 3, 3, 5, 1, 11, 25, 105, 367, 253, 1395, 2077, 2613, 4535, 18215, 37657, 48283}}, {11916, 17, 52675, {1, 3, 3, 1, 1, 41, 7, 161, 437, 659, 833, 3175, 2063, 14497, 6655, 8817, 127321}}, {11917, 17, 52687, {1, 3, 1, 11, 17, 27, 3, 51, 75, 183, 1889, 287, 5429, 14007, 14445, 47395, 94543}}, {11918, 17, 52696, {1, 1, 7, 13, 29, 9, 109, 19, 73, 3, 1529, 457, 6413, 4113, 14733, 24455, 44623}}, {11919, 17, 52701, {1, 3, 1, 15, 15, 31, 83, 25, 263, 229, 1801, 377, 1703, 8571, 10393, 52021, 100937}}, {11920, 17, 52706, {1, 3, 5, 9, 25, 57, 79, 19, 117, 437, 275, 3439, 6393, 2111, 8317, 3521, 96927}}, {11921, 17, 52708, {1, 3, 1, 13, 27, 43, 103, 171, 361, 949, 347, 809, 5819, 2763, 10447, 35129, 46985}}, {11922, 17, 52711, {1, 3, 5, 11, 17, 1, 27, 37, 473, 851, 1057, 831, 4373, 5179, 18193, 48731, 64317}}, {11923, 17, 52726, {1, 3, 1, 7, 17, 5, 19, 217, 439, 549, 1983, 2473, 6059, 5271, 10279, 7793, 114357}}, {11924, 17, 52748, {1, 3, 1, 5, 25, 19, 99, 65, 507, 527, 825, 2517, 2299, 1725, 9913, 5779, 12207}}, {11925, 17, 52754, {1, 3, 1, 1, 29, 41, 119, 27, 411, 475, 461, 1885, 2339, 4945, 24665, 13621, 78129}}, {11926, 17, 52756, {1, 3, 1, 11, 27, 29, 119, 155, 487, 29, 1545, 675, 1417, 6119, 12451, 21345, 39377}}, {11927, 17, 52759, {1, 1, 3, 7, 19, 5, 111, 227, 49, 307, 549, 737, 4793, 13885, 22971, 18653, 69573}}, {11928, 17, 52769, {1, 3, 3, 1, 27, 59, 87, 7, 379, 497, 903, 591, 6105, 1957, 25849, 55957, 120181}}, {11929, 17, 52784, {1, 3, 5, 15, 19, 31, 43, 1, 35, 341, 311, 1343, 3625, 16181, 31047, 59679, 89231}}, {11930, 17, 52790, {1, 1, 1, 15, 21, 19, 93, 229, 49, 597, 1465, 2027, 5935, 12269, 20239, 17861, 26311}}, {11931, 17, 52804, {1, 1, 1, 1, 3, 31, 115, 87, 129, 419, 871, 2469, 3807, 4473, 25025, 36923, 67959}}, {11932, 17, 52807, {1, 1, 1, 3, 23, 31, 41, 247, 295, 369, 1131, 2183, 8097, 7609, 4387, 37565, 50177}}, {11933, 17, 52808, {1, 3, 1, 11, 9, 17, 111, 249, 417, 775, 217, 1435, 6295, 5065, 2967, 55361, 91933}}, {11934, 17, 52819, {1, 3, 5, 7, 19, 21, 71, 219, 411, 31, 335, 2915, 3687, 5691, 12405, 34659, 76721}}, {11935, 17, 52826, {1, 3, 5, 13, 29, 31, 95, 203, 149, 399, 547, 2529, 2485, 3371, 20219, 33647, 34217}}, {11936, 17, 52828, {1, 3, 5, 13, 31, 41, 97, 115, 427, 35, 1319, 2335, 715, 2541, 4507, 49395, 33895}}, {11937, 17, 52832, {1, 3, 7, 15, 3, 49, 3, 49, 153, 93, 1343, 1035, 5685, 15855, 15751, 27663, 99553}}, {11938, 17, 52835, {1, 1, 7, 5, 27, 7, 53, 135, 453, 981, 1767, 3503, 1259, 11973, 23259, 41051, 96593}}, {11939, 17, 52849, {1, 1, 7, 9, 5, 59, 57, 141, 41, 639, 1681, 145, 7019, 6621, 14221, 12051, 71871}}, {11940, 17, 52859, {1, 1, 3, 1, 13, 39, 7, 187, 7, 919, 1555, 2111, 6507, 2099, 10643, 22851, 82033}}, {11941, 17, 52877, {1, 3, 7, 9, 25, 59, 27, 225, 239, 715, 1115, 2309, 7785, 11849, 8991, 54305, 107305}}, {11942, 17, 52880, {1, 1, 7, 11, 21, 51, 1, 223, 481, 195, 2005, 2651, 6797, 12201, 11013, 1843, 65167}}, {11943, 17, 52896, {1, 3, 3, 11, 27, 3, 117, 5, 255, 595, 399, 1329, 1437, 12061, 32679, 16655, 76235}}, {11944, 17, 52899, {1, 1, 7, 13, 21, 1, 35, 159, 329, 37, 1247, 2663, 3889, 14603, 25799, 45363, 87963}}, {11945, 17, 52905, {1, 1, 7, 7, 7, 11, 53, 215, 351, 329, 1039, 969, 4449, 14785, 28617, 25953, 78663}}, {11946, 17, 52913, {1, 1, 7, 7, 27, 17, 19, 223, 143, 433, 789, 1941, 5527, 711, 25097, 4571, 121975}}, {11947, 17, 52933, {1, 3, 1, 13, 11, 47, 31, 249, 325, 1003, 509, 2741, 3953, 1691, 12661, 16097, 80211}}, {11948, 17, 52934, {1, 3, 7, 9, 27, 11, 21, 129, 25, 57, 1523, 3631, 2639, 2541, 14249, 34539, 70551}}, {11949, 17, 52938, {1, 1, 5, 3, 31, 47, 47, 73, 71, 783, 1353, 2157, 2563, 14015, 997, 31611, 118649}}, {11950, 17, 52957, {1, 1, 5, 5, 25, 35, 25, 207, 349, 503, 121, 3455, 5783, 10899, 12745, 35117, 36679}}, {11951, 17, 52979, {1, 3, 1, 3, 11, 39, 123, 177, 19, 441, 1979, 1257, 1351, 4253, 15145, 44559, 59379}}, {11952, 17, 52981, {1, 3, 7, 3, 7, 35, 41, 203, 439, 1013, 1055, 1165, 1043, 11183, 1795, 31253, 113693}}, {11953, 17, 52986, {1, 3, 1, 13, 7, 43, 57, 1, 229, 345, 631, 841, 7923, 5971, 20489, 47917, 66833}}, {11954, 17, 53005, {1, 1, 1, 15, 27, 5, 31, 117, 153, 755, 1207, 619, 8185, 4329, 9979, 57255, 79045}}, {11955, 17, 53008, {1, 3, 3, 7, 23, 1, 7, 227, 337, 417, 1895, 765, 7799, 13599, 27253, 4485, 112391}}, {11956, 17, 53024, {1, 3, 5, 13, 27, 63, 5, 87, 101, 351, 953, 2235, 1587, 5479, 26529, 34165, 83303}}, {11957, 17, 53029, {1, 1, 5, 15, 1, 43, 63, 193, 143, 711, 1779, 3531, 1355, 16253, 14595, 32343, 131021}}, {11958, 17, 53054, {1, 1, 1, 9, 29, 37, 29, 71, 11, 877, 1301, 2415, 5593, 1855, 25223, 6805, 12901}}, {11959, 17, 53073, {1, 1, 7, 9, 31, 5, 49, 63, 185, 373, 129, 1695, 7841, 4477, 17809, 42771, 120221}}, {11960, 17, 53083, {1, 1, 5, 3, 15, 43, 49, 45, 47, 775, 699, 2787, 7831, 4189, 18317, 63933, 83669}}, {11961, 17, 53086, {1, 3, 5, 3, 23, 33, 85, 255, 119, 685, 1245, 1647, 1999, 13063, 9241, 49017, 32619}}, {11962, 17, 53095, {1, 1, 7, 15, 29, 15, 125, 233, 189, 411, 1251, 3459, 7213, 10081, 4403, 56819, 17103}}, {11963, 17, 53102, {1, 3, 3, 11, 21, 13, 93, 125, 213, 793, 1057, 2363, 661, 12213, 2259, 3787, 91451}}, {11964, 17, 53107, {1, 3, 5, 5, 19, 35, 5, 153, 507, 691, 1743, 1777, 7579, 14229, 10155, 18529, 35945}}, {11965, 17, 53126, {1, 3, 7, 5, 27, 35, 13, 77, 189, 793, 877, 643, 2787, 5817, 22589, 58363, 49059}}, {11966, 17, 53130, {1, 3, 7, 9, 9, 37, 21, 251, 119, 895, 1023, 91, 4317, 10943, 7355, 36961, 36903}}, {11967, 17, 53138, {1, 3, 3, 13, 19, 49, 15, 105, 399, 29, 1903, 3503, 3453, 15429, 31503, 57815, 34009}}, {11968, 17, 53144, {1, 1, 5, 1, 19, 35, 49, 97, 335, 665, 1871, 887, 4713, 517, 9571, 41601, 9673}}, {11969, 17, 53156, {1, 3, 5, 13, 29, 45, 111, 233, 251, 407, 1135, 2791, 6525, 11633, 22295, 65381, 117511}}, {11970, 17, 53163, {1, 1, 3, 3, 17, 7, 65, 43, 391, 91, 315, 3559, 479, 7337, 25629, 785, 19855}}, {11971, 17, 53165, {1, 1, 5, 9, 29, 31, 67, 17, 381, 875, 1001, 415, 2263, 4415, 11263, 309, 117623}}, {11972, 17, 53173, {1, 1, 7, 11, 25, 1, 59, 61, 247, 649, 687, 907, 1037, 13935, 7229, 39769, 92755}}, {11973, 17, 53177, {1, 3, 5, 15, 21, 51, 27, 79, 343, 785, 1567, 1349, 7991, 8531, 11243, 61351, 21297}}, {11974, 17, 53183, {1, 1, 1, 3, 31, 41, 67, 169, 83, 959, 813, 1953, 2467, 12369, 31431, 50761, 75731}}, {11975, 17, 53192, {1, 1, 5, 11, 25, 37, 83, 163, 3, 161, 1249, 3009, 7167, 5473, 10561, 44899, 130879}}, {11976, 17, 53195, {1, 1, 7, 11, 9, 61, 61, 113, 81, 205, 731, 3887, 5525, 13415, 25181, 11557, 59343}}, {11977, 17, 53200, {1, 3, 7, 5, 19, 27, 107, 89, 295, 715, 1439, 1285, 5813, 8895, 7233, 32905, 3273}}, {11978, 17, 53212, {1, 1, 5, 1, 29, 11, 125, 253, 445, 295, 1721, 1271, 2203, 2215, 7613, 55655, 112157}}, {11979, 17, 53219, {1, 1, 5, 11, 11, 13, 111, 55, 19, 551, 1365, 477, 2513, 12311, 22485, 23291, 92447}}, {11980, 17, 53221, {1, 1, 7, 11, 9, 5, 3, 109, 507, 441, 1767, 1781, 3077, 219, 29293, 21237, 71159}}, {11981, 17, 53245, {1, 1, 3, 11, 3, 45, 99, 113, 367, 569, 1907, 1281, 51, 13693, 14639, 32999, 77461}}, {11982, 17, 53254, {1, 3, 5, 11, 5, 19, 97, 11, 473, 937, 1623, 1507, 3245, 9331, 16005, 37505, 40085}}, {11983, 17, 53257, {1, 1, 7, 13, 21, 61, 103, 111, 35, 141, 61, 1043, 1989, 1311, 29021, 2617, 89915}}, {11984, 17, 53265, {1, 3, 7, 15, 19, 31, 39, 175, 371, 459, 1293, 1645, 1125, 1199, 4811, 55721, 76071}}, {11985, 17, 53266, {1, 1, 7, 3, 3, 35, 17, 7, 91, 317, 1615, 3559, 191, 2579, 15027, 58711, 36009}}, {11986, 17, 53268, {1, 1, 1, 13, 1, 27, 45, 87, 443, 443, 853, 3917, 1437, 4053, 14861, 2897, 109853}}, {11987, 17, 53275, {1, 1, 5, 3, 21, 47, 73, 195, 115, 517, 1781, 2341, 805, 5679, 12053, 29113, 100479}}, {11988, 17, 53277, {1, 1, 7, 1, 25, 27, 61, 167, 203, 57, 527, 1071, 7131, 8403, 9943, 11503, 33081}}, {11989, 17, 53284, {1, 1, 5, 13, 31, 43, 35, 195, 177, 229, 1401, 4011, 2363, 15787, 21125, 32103, 62337}}, {11990, 17, 53294, {1, 1, 5, 11, 19, 13, 3, 249, 119, 35, 747, 1419, 5451, 13043, 19813, 54859, 94825}}, {11991, 17, 53308, {1, 3, 1, 9, 17, 13, 51, 125, 391, 157, 1199, 1805, 1763, 11831, 20915, 38547, 14221}}, {11992, 17, 53314, {1, 1, 7, 1, 23, 61, 25, 69, 435, 183, 1379, 1211, 5529, 9447, 4575, 14127, 91867}}, {11993, 17, 53319, {1, 3, 3, 15, 11, 15, 101, 135, 419, 685, 1097, 787, 2045, 3393, 26221, 23653, 116917}}, {11994, 17, 53326, {1, 3, 1, 11, 29, 23, 13, 153, 27, 683, 1569, 413, 261, 10291, 23763, 15579, 39337}}, {11995, 17, 53328, {1, 3, 7, 7, 19, 23, 121, 23, 339, 165, 1137, 2791, 319, 16111, 14847, 28171, 79237}}, {11996, 17, 53340, {1, 3, 1, 5, 9, 59, 33, 19, 191, 707, 1883, 1683, 1161, 12905, 12299, 22201, 19811}}, {11997, 17, 53364, {1, 3, 1, 3, 27, 11, 69, 199, 415, 251, 1079, 1709, 4539, 7867, 21321, 33617, 53459}}, {11998, 17, 53367, {1, 1, 3, 9, 19, 59, 21, 95, 275, 213, 1819, 721, 6271, 11845, 9573, 16105, 12755}}, {11999, 17, 53377, {1, 1, 1, 15, 23, 7, 91, 235, 43, 95, 913, 715, 3229, 12339, 23089, 30963, 129525}}, {12000, 17, 53395, {1, 1, 7, 9, 7, 41, 43, 131, 485, 621, 1293, 1955, 5215, 6545, 29225, 53587, 46901}}, {12001, 17, 53398, {1, 3, 1, 5, 7, 57, 97, 199, 225, 707, 1223, 1829, 497, 12587, 24551, 12907, 82411}}, {12002, 17, 53407, {1, 1, 3, 7, 21, 9, 63, 15, 263, 957, 155, 4021, 4455, 2025, 16981, 19743, 88619}}, {12003, 17, 53413, {1, 1, 7, 5, 31, 3, 27, 45, 369, 747, 1559, 1429, 8049, 15069, 19897, 50067, 52861}}, {12004, 17, 53414, {1, 1, 5, 13, 23, 35, 91, 139, 73, 275, 207, 2709, 3801, 12755, 19155, 61629, 5513}}, {12005, 17, 53417, {1, 1, 5, 7, 5, 25, 33, 45, 325, 847, 81, 891, 3191, 14115, 25095, 39867, 3839}}, {12006, 17, 53443, {1, 3, 5, 13, 9, 31, 31, 113, 507, 833, 691, 2041, 4873, 81, 21365, 35265, 37627}}, {12007, 17, 53473, {1, 1, 5, 13, 9, 51, 127, 131, 285, 683, 593, 3411, 6685, 3601, 12255, 8337, 80597}}, {12008, 17, 53476, {1, 1, 5, 15, 29, 13, 79, 199, 157, 421, 1697, 2063, 2213, 4141, 21045, 45785, 124023}}, {12009, 17, 53480, {1, 3, 1, 11, 19, 5, 79, 57, 71, 373, 487, 671, 3671, 9093, 20989, 48477, 104951}}, {12010, 17, 53486, {1, 3, 5, 15, 13, 7, 39, 243, 507, 739, 1905, 3431, 4141, 9345, 27877, 64735, 112997}}, {12011, 17, 53506, {1, 3, 3, 5, 17, 25, 31, 243, 393, 61, 199, 2825, 6981, 5887, 22289, 9201, 77689}}, {12012, 17, 53542, {1, 3, 5, 15, 15, 63, 77, 39, 463, 883, 671, 3285, 6925, 15085, 1665, 64005, 130619}}, {12013, 17, 53546, {1, 3, 3, 11, 21, 15, 7, 115, 9, 879, 1097, 3993, 3929, 9809, 22105, 9549, 31819}}, {12014, 17, 53554, {1, 1, 7, 15, 3, 9, 19, 97, 327, 105, 1915, 205, 3873, 1229, 29915, 57375, 108217}}, {12015, 17, 53563, {1, 1, 3, 11, 29, 41, 77, 11, 183, 73, 1651, 3739, 3911, 8695, 15339, 19293, 1827}}, {12016, 17, 53580, {1, 1, 1, 5, 23, 49, 35, 175, 99, 49, 615, 1733, 6901, 2351, 18765, 55553, 99791}}, {12017, 17, 53591, {1, 3, 7, 3, 25, 17, 67, 161, 507, 941, 35, 2619, 339, 791, 6485, 64277, 123867}}, {12018, 17, 53598, {1, 1, 3, 13, 11, 9, 79, 193, 75, 391, 1753, 3537, 6971, 6607, 11933, 4447, 87793}}, {12019, 17, 53611, {1, 1, 1, 5, 19, 9, 63, 203, 51, 395, 1365, 2393, 7265, 11709, 13721, 4519, 118765}}, {12020, 17, 53621, {1, 1, 3, 9, 17, 53, 29, 103, 325, 973, 903, 785, 7535, 9951, 8121, 12603, 38679}}, {12021, 17, 53625, {1, 3, 1, 7, 7, 63, 1, 123, 439, 181, 1373, 2705, 995, 10789, 7495, 54543, 120109}}, {12022, 17, 53628, {1, 1, 7, 3, 17, 13, 79, 179, 165, 965, 1537, 3753, 3497, 12127, 6983, 48605, 113057}}, {12023, 17, 53632, {1, 1, 5, 7, 3, 7, 41, 25, 267, 633, 19, 1317, 3445, 12377, 27881, 55249, 40841}}, {12024, 17, 53650, {1, 3, 5, 1, 31, 55, 43, 129, 411, 281, 1, 851, 2419, 7943, 13721, 39371, 114557}}, {12025, 17, 53655, {1, 1, 7, 7, 23, 19, 83, 37, 9, 161, 125, 3179, 7973, 9703, 23199, 32723, 130915}}, {12026, 17, 53675, {1, 1, 7, 5, 27, 21, 11, 219, 403, 239, 1723, 2957, 3029, 9911, 10981, 35421, 74025}}, {12027, 17, 53677, {1, 3, 1, 1, 31, 59, 69, 77, 395, 1, 157, 1259, 4913, 2089, 17619, 51033, 130899}}, {12028, 17, 53680, {1, 3, 3, 3, 19, 11, 83, 237, 103, 921, 487, 1833, 8187, 3811, 18887, 9389, 80927}}, {12029, 17, 53683, {1, 3, 7, 3, 17, 51, 107, 209, 187, 831, 1501, 1337, 803, 10361, 11347, 65291, 42219}}, {12030, 17, 53700, {1, 3, 3, 15, 7, 29, 61, 25, 413, 257, 1185, 4009, 7463, 1839, 6645, 28389, 14449}}, {12031, 17, 53709, {1, 3, 1, 9, 5, 31, 83, 55, 375, 399, 945, 997, 7649, 12631, 7691, 53325, 50173}}, {12032, 17, 53724, {1, 1, 5, 9, 13, 9, 83, 37, 487, 975, 487, 3587, 7285, 7505, 10155, 673, 126505}}, {12033, 17, 53731, {1, 3, 5, 7, 21, 3, 35, 21, 367, 323, 1579, 3351, 5465, 13719, 17033, 42573, 55079}}, {12034, 17, 53733, {1, 3, 3, 15, 11, 27, 121, 109, 267, 855, 1417, 3839, 6535, 1051, 29355, 23815, 76031}}, {12035, 17, 53738, {1, 1, 7, 9, 5, 31, 35, 53, 369, 137, 1545, 927, 825, 1333, 13637, 11003, 96963}}, {12036, 17, 53762, {1, 1, 5, 3, 29, 41, 31, 85, 35, 477, 227, 3325, 1213, 681, 14591, 31325, 12199}}, {12037, 17, 53767, {1, 3, 7, 11, 11, 11, 33, 255, 335, 747, 855, 31, 6101, 293, 20423, 47521, 62573}}, {12038, 17, 53785, {1, 1, 1, 15, 31, 15, 33, 175, 321, 441, 1197, 3579, 4989, 9275, 30485, 1077, 122947}}, {12039, 17, 53786, {1, 3, 5, 15, 23, 21, 127, 223, 249, 373, 1309, 1469, 5701, 9097, 29897, 26627, 38489}}, {12040, 17, 53795, {1, 3, 7, 3, 3, 35, 83, 149, 259, 315, 1467, 1953, 6035, 7961, 10901, 25171, 130713}}, {12041, 17, 53802, {1, 1, 3, 9, 7, 63, 55, 33, 375, 421, 151, 1721, 1999, 14937, 17539, 48323, 97345}}, {12042, 17, 53812, {1, 1, 5, 5, 3, 21, 47, 19, 227, 131, 1591, 3779, 929, 13879, 13489, 19805, 20135}}, {12043, 17, 53821, {1, 1, 7, 1, 31, 25, 87, 125, 213, 135, 809, 3067, 5035, 7407, 2193, 31423, 123973}}, {12044, 17, 53827, {1, 3, 5, 13, 17, 19, 77, 169, 345, 115, 227, 649, 3609, 15063, 1895, 17533, 95859}}, {12045, 17, 53833, {1, 3, 5, 15, 17, 29, 17, 11, 145, 601, 1871, 851, 8161, 14029, 10039, 4247, 62393}}, {12046, 17, 53841, {1, 1, 7, 13, 25, 5, 49, 231, 261, 71, 335, 4081, 7915, 11367, 17087, 26041, 128737}}, {12047, 17, 53848, {1, 1, 1, 13, 13, 21, 77, 113, 373, 1005, 109, 2877, 3001, 15011, 2465, 37015, 69049}}, {12048, 17, 53869, {1, 1, 3, 15, 31, 33, 119, 121, 41, 9, 1567, 577, 1687, 12117, 17049, 675, 10729}}, {12049, 17, 53897, {1, 3, 5, 11, 31, 7, 47, 41, 127, 81, 273, 1649, 975, 3953, 17021, 24163, 12599}}, {12050, 17, 53905, {1, 3, 1, 3, 27, 41, 75, 237, 317, 85, 1995, 2255, 2191, 6441, 26629, 25797, 97681}}, {12051, 17, 53912, {1, 1, 1, 3, 11, 5, 31, 109, 227, 977, 59, 793, 3305, 10905, 16529, 21345, 2403}}, {12052, 17, 53921, {1, 3, 5, 9, 9, 37, 107, 129, 421, 383, 1415, 885, 3383, 9547, 7303, 41745, 59919}}, {12053, 17, 53928, {1, 1, 7, 7, 29, 27, 59, 177, 97, 299, 1019, 1393, 7763, 5715, 9253, 58035, 23431}}, {12054, 17, 53948, {1, 3, 3, 3, 23, 13, 51, 101, 75, 857, 1699, 2687, 3983, 10427, 19845, 49503, 96033}}, {12055, 17, 53954, {1, 1, 1, 7, 21, 51, 25, 71, 265, 999, 1259, 625, 775, 11045, 20769, 42597, 115521}}, {12056, 17, 53968, {1, 3, 1, 13, 25, 47, 21, 245, 201, 667, 1193, 1087, 407, 6057, 14929, 35291, 57615}}, {12057, 17, 53977, {1, 1, 1, 7, 27, 25, 93, 85, 321, 1009, 1045, 1901, 349, 11393, 10917, 10413, 94125}}, {12058, 17, 53983, {1, 1, 1, 15, 3, 63, 59, 51, 307, 135, 785, 1921, 6921, 5689, 8487, 21061, 69903}}, {12059, 17, 53984, {1, 3, 7, 1, 13, 47, 59, 155, 107, 573, 843, 2849, 6685, 5927, 31747, 21541, 94271}}, {12060, 17, 54002, {1, 1, 7, 15, 23, 7, 85, 169, 209, 527, 1027, 3745, 4773, 14893, 10789, 1243, 87133}}, {12061, 17, 54007, {1, 1, 5, 9, 1, 1, 53, 57, 245, 899, 1785, 1951, 7651, 10909, 30167, 40789, 66965}}, {12062, 17, 54013, {1, 1, 1, 7, 17, 33, 65, 79, 455, 677, 157, 1313, 1573, 9697, 4161, 4609, 42783}}, {12063, 17, 54014, {1, 3, 7, 7, 27, 15, 109, 113, 239, 521, 563, 2493, 1471, 15817, 14515, 48465, 66009}}, {12064, 17, 54021, {1, 3, 5, 3, 29, 33, 125, 169, 483, 593, 1665, 657, 3799, 15829, 29591, 25813, 40987}}, {12065, 17, 54026, {1, 3, 1, 11, 15, 25, 21, 215, 341, 241, 1599, 3807, 6633, 15137, 15377, 56881, 47499}}, {12066, 17, 54028, {1, 3, 3, 3, 15, 49, 89, 117, 191, 641, 675, 2671, 4243, 1617, 20261, 42669, 119173}}, {12067, 17, 54031, {1, 1, 1, 13, 13, 43, 73, 103, 183, 239, 555, 2121, 4889, 1431, 20601, 21545, 11809}}, {12068, 17, 54036, {1, 3, 1, 9, 9, 9, 121, 51, 77, 455, 1481, 427, 1961, 12149, 21273, 16295, 21909}}, {12069, 17, 54067, {1, 1, 5, 11, 19, 55, 37, 63, 493, 663, 945, 2191, 2491, 11545, 7407, 36295, 94293}}, {12070, 17, 54069, {1, 3, 5, 15, 25, 35, 103, 33, 171, 425, 409, 5, 2519, 2239, 30557, 20007, 69079}}, {12071, 17, 54074, {1, 1, 5, 11, 13, 29, 71, 21, 35, 833, 191, 365, 7013, 12413, 10227, 56705, 61705}}, {12072, 17, 54076, {1, 1, 1, 1, 21, 13, 87, 113, 63, 537, 283, 925, 2147, 1683, 31239, 2775, 131021}}, {12073, 17, 54105, {1, 1, 3, 9, 23, 1, 117, 19, 487, 235, 877, 149, 369, 9615, 12501, 60175, 35741}}, {12074, 17, 54111, {1, 1, 7, 9, 5, 25, 107, 199, 339, 755, 245, 2861, 1119, 14683, 2221, 5227, 81479}}, {12075, 17, 54118, {1, 1, 1, 15, 5, 15, 37, 63, 511, 219, 783, 3245, 5563, 13231, 22311, 16803, 10393}}, {12076, 17, 54129, {1, 3, 7, 5, 1, 15, 9, 21, 287, 991, 555, 771, 7683, 1661, 6553, 43735, 118713}}, {12077, 17, 54145, {1, 3, 1, 3, 3, 29, 119, 157, 13, 599, 537, 2921, 5207, 11621, 1515, 6351, 118429}}, {12078, 17, 54157, {1, 1, 5, 1, 27, 39, 111, 117, 481, 25, 549, 913, 6427, 7703, 23099, 50501, 7617}}, {12079, 17, 54158, {1, 1, 7, 5, 29, 63, 43, 151, 63, 43, 197, 3165, 3879, 12435, 461, 64475, 60597}}, {12080, 17, 54163, {1, 3, 1, 11, 31, 35, 59, 207, 387, 441, 1293, 2117, 3751, 12653, 2811, 42585, 33297}}, {12081, 17, 54166, {1, 3, 7, 15, 27, 47, 13, 15, 135, 433, 615, 1, 171, 11503, 27117, 64635, 122191}}, {12082, 17, 54172, {1, 1, 7, 1, 23, 23, 107, 135, 311, 395, 373, 2771, 81, 12513, 16739, 6715, 94999}}, {12083, 17, 54185, {1, 3, 5, 7, 19, 9, 21, 139, 307, 231, 65, 59, 7767, 2897, 3503, 58163, 48807}}, {12084, 17, 54186, {1, 3, 5, 13, 23, 5, 51, 247, 125, 911, 1395, 1337, 3215, 15811, 12729, 21495, 22597}}, {12085, 17, 54188, {1, 3, 5, 5, 1, 19, 123, 125, 197, 533, 1699, 1397, 3473, 15201, 24493, 3395, 98261}}, {12086, 17, 54208, {1, 1, 3, 7, 29, 39, 69, 97, 353, 293, 1103, 543, 5015, 9913, 6965, 61921, 122073}}, {12087, 17, 54223, {1, 1, 3, 13, 19, 41, 117, 253, 449, 231, 865, 3055, 4751, 3277, 22863, 3249, 38359}}, {12088, 17, 54237, {1, 3, 5, 13, 9, 7, 107, 17, 251, 501, 1925, 3733, 5035, 13213, 12535, 13705, 73047}}, {12089, 17, 54241, {1, 3, 7, 5, 23, 5, 83, 45, 457, 667, 913, 1167, 7063, 10915, 10911, 20501, 61823}}, {12090, 17, 54244, {1, 3, 3, 13, 7, 15, 29, 223, 503, 713, 667, 3989, 5927, 5909, 27633, 17615, 97931}}, {12091, 17, 54259, {1, 3, 7, 13, 19, 53, 25, 41, 311, 327, 1323, 3361, 1095, 12701, 1065, 34155, 34705}}, {12092, 17, 54273, {1, 1, 7, 7, 11, 35, 63, 73, 179, 477, 467, 4043, 3097, 16089, 12749, 18233, 50299}}, {12093, 17, 54276, {1, 3, 3, 13, 5, 27, 31, 207, 357, 469, 607, 961, 7393, 6707, 25833, 22337, 119083}}, {12094, 17, 54280, {1, 1, 3, 3, 7, 53, 47, 55, 267, 107, 1307, 2151, 793, 15605, 12153, 13075, 76529}}, {12095, 17, 54294, {1, 3, 5, 1, 13, 35, 63, 191, 375, 221, 1603, 2049, 5363, 1481, 32271, 22635, 118603}}, {12096, 17, 54298, {1, 1, 1, 11, 17, 63, 13, 3, 353, 943, 443, 141, 7441, 12335, 4499, 15923, 63677}}, {12097, 17, 54303, {1, 3, 7, 13, 21, 51, 125, 61, 203, 1, 707, 3893, 4627, 3125, 14629, 62721, 85101}}, {12098, 17, 54304, {1, 1, 3, 5, 31, 23, 63, 241, 41, 721, 599, 1761, 2593, 1685, 31247, 7811, 87561}}, {12099, 17, 54309, {1, 1, 7, 9, 7, 53, 51, 9, 303, 675, 1261, 1591, 4363, 15, 29723, 54533, 103869}}, {12100, 17, 54310, {1, 3, 5, 7, 27, 21, 103, 113, 463, 379, 635, 2363, 607, 11445, 22475, 58433, 93071}}, {12101, 17, 54316, {1, 1, 5, 5, 5, 63, 23, 67, 399, 279, 829, 945, 6545, 14951, 5135, 22889, 87625}}, {12102, 17, 54336, {1, 1, 7, 15, 1, 59, 69, 123, 169, 821, 1125, 2051, 3375, 11691, 1379, 57461, 124209}}, {12103, 17, 54354, {1, 1, 5, 15, 31, 57, 51, 59, 297, 459, 701, 241, 2801, 11893, 4007, 13165, 79403}}, {12104, 17, 54359, {1, 1, 5, 9, 11, 41, 79, 47, 19, 529, 21, 1871, 371, 6269, 7433, 36183, 96113}}, {12105, 17, 54375, {1, 1, 7, 5, 29, 3, 33, 191, 119, 501, 1637, 2903, 3347, 4581, 17407, 18169, 10595}}, {12106, 17, 54376, {1, 3, 5, 11, 9, 35, 95, 193, 413, 727, 1157, 3331, 5993, 1781, 22653, 3975, 110557}}, {12107, 17, 54381, {1, 1, 1, 1, 23, 5, 35, 65, 57, 515, 569, 4031, 7983, 4603, 29419, 44847, 63601}}, {12108, 17, 54390, {1, 3, 1, 7, 21, 5, 77, 23, 317, 803, 723, 3229, 7171, 2883, 10943, 50323, 108579}}, {12109, 17, 54396, {1, 3, 5, 11, 15, 53, 75, 127, 177, 19, 501, 1201, 5113, 9069, 8817, 14725, 104737}}, {12110, 17, 54399, {1, 3, 7, 9, 7, 39, 5, 121, 409, 103, 1075, 451, 7603, 16023, 32557, 43159, 94385}}, {12111, 17, 54409, {1, 3, 1, 11, 29, 57, 123, 141, 57, 945, 1777, 2427, 2359, 12839, 7325, 7945, 129811}}, {12112, 17, 54424, {1, 3, 5, 15, 5, 3, 17, 55, 467, 61, 131, 2891, 6331, 5859, 20437, 49425, 80731}}, {12113, 17, 54434, {1, 1, 1, 15, 29, 13, 127, 181, 361, 1019, 1675, 2755, 6533, 8957, 14691, 4285, 65459}}, {12114, 17, 54436, {1, 1, 7, 11, 23, 43, 111, 183, 103, 269, 229, 3291, 1873, 11349, 29319, 64829, 19639}}, {12115, 17, 54439, {1, 3, 7, 11, 15, 63, 1, 253, 489, 863, 1707, 2769, 3201, 7901, 18161, 12515, 130237}}, {12116, 17, 54445, {1, 3, 1, 7, 1, 25, 43, 159, 505, 511, 1745, 1421, 6779, 11103, 23535, 61129, 124571}}, {12117, 17, 54448, {1, 1, 3, 13, 19, 33, 17, 243, 481, 617, 1061, 1891, 7165, 6821, 18505, 8965, 70179}}, {12118, 17, 54457, {1, 1, 7, 13, 17, 17, 65, 23, 255, 361, 1873, 1605, 2041, 11119, 11419, 63131, 49207}}, {12119, 17, 54465, {1, 1, 5, 13, 15, 57, 27, 223, 199, 529, 1115, 1513, 8083, 11713, 21005, 50741, 122223}}, {12120, 17, 54471, {1, 3, 5, 15, 29, 35, 107, 85, 141, 505, 1553, 1283, 4581, 5077, 9461, 59853, 23219}}, {12121, 17, 54472, {1, 3, 5, 11, 11, 45, 53, 195, 199, 773, 1911, 721, 1563, 3769, 3267, 30673, 80313}}, {12122, 17, 54485, {1, 3, 7, 7, 21, 37, 9, 129, 431, 79, 1559, 2125, 7781, 6441, 23533, 46919, 25315}}, {12123, 17, 54508, {1, 1, 5, 15, 11, 61, 77, 231, 349, 647, 225, 85, 6789, 12557, 6505, 21985, 54965}}, {12124, 17, 54513, {1, 1, 5, 1, 19, 21, 33, 211, 347, 491, 1119, 1619, 3739, 11255, 26705, 59691, 35337}}, {12125, 17, 54528, {1, 1, 3, 3, 29, 15, 7, 23, 279, 145, 699, 289, 475, 1681, 3201, 64477, 24919}}, {12126, 17, 54534, {1, 1, 7, 7, 23, 53, 75, 71, 315, 403, 1521, 1417, 3749, 11243, 3951, 61039, 51143}}, {12127, 17, 54537, {1, 3, 7, 3, 15, 21, 81, 219, 249, 387, 1405, 3495, 7143, 2599, 25435, 15259, 66069}}, {12128, 17, 54540, {1, 1, 5, 7, 31, 9, 63, 55, 409, 421, 1851, 847, 1593, 10447, 2833, 13209, 47285}}, {12129, 17, 54551, {1, 1, 3, 7, 15, 3, 35, 49, 253, 21, 1705, 357, 2751, 9671, 12429, 4549, 118691}}, {12130, 17, 54561, {1, 1, 5, 15, 1, 3, 97, 197, 43, 923, 1273, 663, 4291, 12357, 28221, 15291, 60989}}, {12131, 17, 54573, {1, 1, 7, 7, 15, 3, 35, 115, 449, 641, 743, 1855, 359, 10983, 2831, 43983, 56465}}, {12132, 17, 54579, {1, 3, 7, 11, 1, 51, 69, 27, 29, 187, 1673, 1273, 7987, 1223, 8971, 53805, 4413}}, {12133, 17, 54586, {1, 1, 3, 11, 1, 55, 91, 241, 35, 97, 1027, 3967, 703, 3535, 21681, 55825, 50423}}, {12134, 17, 54591, {1, 1, 7, 11, 21, 53, 111, 125, 11, 355, 1585, 3603, 1705, 16311, 7045, 15503, 63625}}, {12135, 17, 54596, {1, 1, 5, 15, 25, 47, 31, 29, 333, 361, 1831, 1545, 7751, 8679, 32453, 61755, 94637}}, {12136, 17, 54599, {1, 1, 3, 3, 23, 3, 79, 11, 367, 551, 281, 1273, 5097, 12527, 473, 33855, 85783}}, {12137, 17, 54605, {1, 1, 1, 15, 27, 21, 107, 121, 187, 495, 1877, 1957, 3647, 13263, 30729, 18131, 33689}}, {12138, 17, 54613, {1, 1, 5, 13, 3, 43, 41, 53, 127, 299, 839, 3327, 7929, 9921, 29471, 18075, 34283}}, {12139, 17, 54623, {1, 1, 7, 13, 31, 5, 59, 75, 335, 929, 379, 139, 7121, 9281, 31161, 3177, 2615}}, {12140, 17, 54654, {1, 3, 7, 1, 11, 19, 81, 199, 425, 639, 497, 693, 1271, 7363, 10543, 52513, 130549}}, {12141, 17, 54667, {1, 3, 3, 7, 21, 41, 101, 67, 363, 5, 1455, 1433, 81, 15609, 16231, 13285, 38995}}, {12142, 17, 54681, {1, 1, 3, 15, 11, 19, 123, 177, 429, 27, 141, 3095, 5379, 2241, 29877, 59383, 25199}}, {12143, 17, 54684, {1, 1, 7, 7, 19, 63, 93, 217, 279, 349, 149, 2479, 2355, 6475, 29993, 37941, 58715}}, {12144, 17, 54687, {1, 3, 7, 3, 21, 23, 59, 177, 489, 817, 1209, 1629, 5805, 3137, 23767, 62967, 16609}}, {12145, 17, 54694, {1, 3, 3, 7, 9, 55, 59, 31, 191, 891, 833, 1059, 3007, 2331, 385, 58247, 110697}}, {12146, 17, 54706, {1, 1, 3, 3, 11, 61, 9, 189, 79, 621, 209, 2785, 2959, 4133, 20691, 45605, 117089}}, {12147, 17, 54712, {1, 3, 3, 5, 5, 47, 31, 1, 451, 765, 2027, 2327, 1725, 14341, 7997, 6449, 77893}}, {12148, 17, 54715, {1, 1, 7, 1, 7, 27, 27, 129, 227, 505, 1461, 783, 945, 12653, 17913, 61631, 41875}}, {12149, 17, 54723, {1, 1, 1, 11, 13, 41, 41, 221, 483, 825, 451, 493, 1717, 10389, 7805, 37707, 30733}}, {12150, 17, 54725, {1, 1, 5, 3, 31, 31, 75, 3, 323, 83, 563, 919, 7387, 1673, 6157, 7415, 14947}}, {12151, 17, 54726, {1, 1, 7, 13, 19, 37, 29, 93, 153, 491, 1033, 1389, 6361, 11133, 20049, 24585, 107325}}, {12152, 17, 54740, {1, 1, 1, 15, 3, 35, 79, 251, 383, 665, 2033, 3165, 3411, 15965, 28281, 56521, 56479}}, {12153, 17, 54750, {1, 3, 1, 15, 23, 1, 87, 145, 443, 405, 635, 1597, 1455, 5983, 12741, 55133, 2815}}, {12154, 17, 54760, {1, 1, 1, 13, 11, 25, 19, 129, 23, 913, 1121, 223, 1991, 13449, 30443, 50573, 108467}}, {12155, 17, 54768, {1, 1, 7, 11, 29, 31, 49, 51, 415, 293, 173, 4091, 159, 2679, 30643, 58725, 109287}}, {12156, 17, 54771, {1, 1, 1, 7, 15, 53, 69, 231, 387, 693, 1299, 1383, 7935, 10313, 22403, 59341, 3347}}, {12157, 17, 54773, {1, 3, 3, 5, 9, 21, 111, 11, 469, 109, 1565, 3107, 2975, 12491, 26773, 33245, 27589}}, {12158, 17, 54796, {1, 1, 3, 5, 3, 9, 103, 127, 345, 301, 857, 2035, 3269, 13819, 7555, 5197, 94557}}, {12159, 17, 54801, {1, 3, 7, 3, 31, 3, 61, 253, 221, 359, 1281, 1405, 4819, 1329, 17773, 29539, 127043}}, {12160, 17, 54808, {1, 1, 7, 11, 17, 47, 105, 253, 253, 531, 119, 2009, 6125, 9387, 13141, 29079, 28361}}, {12161, 17, 54814, {1, 1, 3, 5, 21, 13, 21, 223, 79, 819, 1425, 1001, 6517, 8883, 29997, 30637, 7717}}, {12162, 17, 54837, {1, 3, 1, 3, 1, 23, 113, 69, 235, 95, 1873, 689, 4611, 13209, 12681, 16057, 114071}}, {12163, 17, 54847, {1, 3, 3, 13, 25, 21, 93, 55, 253, 373, 1659, 829, 6539, 7453, 28195, 33131, 92559}}, {12164, 17, 54849, {1, 1, 3, 11, 25, 29, 81, 235, 429, 811, 1867, 2923, 5949, 4423, 93, 64631, 48357}}, {12165, 17, 54864, {1, 3, 5, 13, 29, 27, 35, 15, 105, 849, 247, 3999, 6441, 12443, 19817, 49897, 21515}}, {12166, 17, 54867, {1, 1, 5, 15, 13, 59, 3, 199, 267, 463, 655, 3875, 2895, 13411, 5081, 22069, 6053}}, {12167, 17, 54889, {1, 1, 5, 9, 5, 13, 111, 83, 281, 543, 629, 1349, 1863, 9523, 19201, 39229, 78265}}, {12168, 17, 54895, {1, 3, 7, 1, 29, 23, 109, 75, 347, 643, 97, 1981, 2797, 11201, 28355, 54105, 45551}}, {12169, 17, 54907, {1, 3, 1, 7, 9, 5, 77, 17, 179, 957, 621, 779, 7117, 1491, 11563, 10131, 98335}}, {12170, 17, 54919, {1, 3, 3, 1, 3, 53, 39, 217, 309, 105, 485, 3123, 3143, 2359, 4923, 22307, 120319}}, {12171, 17, 54923, {1, 1, 7, 7, 11, 5, 65, 165, 321, 455, 625, 2417, 999, 14999, 6777, 13319, 43399}}, {12172, 17, 54926, {1, 1, 7, 3, 11, 55, 43, 119, 135, 129, 581, 3593, 3475, 14667, 30509, 5007, 120135}}, {12173, 17, 54940, {1, 1, 1, 11, 7, 17, 95, 169, 401, 87, 1425, 1821, 7619, 3605, 10993, 35837, 87311}}, {12174, 17, 54950, {1, 1, 7, 11, 11, 35, 29, 63, 395, 301, 373, 2457, 6859, 1915, 11215, 41075, 78219}}, {12175, 17, 54954, {1, 3, 5, 7, 25, 3, 97, 43, 273, 459, 103, 3441, 71, 10269, 29893, 46053, 104801}}, {12176, 17, 54961, {1, 3, 3, 7, 31, 3, 121, 255, 73, 783, 977, 513, 6527, 1189, 8925, 23245, 22287}}, {12177, 17, 54973, {1, 3, 3, 13, 15, 53, 51, 135, 465, 341, 263, 1687, 4085, 14257, 18745, 46945, 115475}}, {12178, 17, 54974, {1, 3, 1, 5, 31, 1, 1, 91, 511, 771, 1501, 2613, 991, 3859, 28911, 65417, 201}}, {12179, 17, 54976, {1, 1, 7, 1, 27, 21, 107, 153, 163, 949, 811, 3087, 3443, 5621, 28795, 58311, 63763}}, {12180, 17, 54986, {1, 1, 7, 5, 29, 29, 57, 175, 29, 821, 1545, 2643, 725, 16225, 29111, 19675, 129995}}, {12181, 17, 54993, {1, 1, 7, 3, 31, 31, 61, 155, 265, 323, 1829, 3891, 6393, 8573, 10627, 10839, 78683}}, {12182, 17, 55000, {1, 3, 5, 7, 29, 7, 67, 181, 313, 731, 1761, 1681, 3673, 8939, 811, 48931, 82021}}, {12183, 17, 55010, {1, 3, 1, 3, 11, 51, 81, 67, 173, 881, 855, 3627, 1613, 4825, 7035, 36261, 64899}}, {12184, 17, 55019, {1, 3, 7, 7, 15, 53, 123, 41, 265, 817, 807, 3875, 7675, 16225, 13313, 62217, 47647}}, {12185, 17, 55021, {1, 1, 3, 13, 23, 47, 125, 155, 403, 651, 1693, 2185, 5565, 9947, 20893, 11287, 118943}}, {12186, 17, 55030, {1, 3, 7, 3, 19, 47, 69, 5, 209, 259, 367, 3929, 7579, 12687, 18109, 51885, 128281}}, {12187, 17, 55033, {1, 1, 7, 5, 27, 41, 45, 41, 205, 1001, 1509, 2649, 1141, 5355, 10265, 34131, 112111}}, {12188, 17, 55039, {1, 3, 7, 5, 19, 41, 103, 63, 49, 25, 271, 793, 3217, 4741, 2563, 61333, 113205}}, {12189, 17, 55047, {1, 3, 3, 15, 15, 35, 13, 233, 277, 673, 545, 545, 7419, 6707, 1867, 58873, 110027}}, {12190, 17, 55048, {1, 1, 7, 3, 9, 23, 67, 55, 3, 1019, 2001, 2909, 7311, 9295, 26953, 43217, 54597}}, {12191, 17, 55054, {1, 3, 5, 7, 13, 33, 67, 27, 75, 569, 1777, 791, 1223, 1805, 19167, 60537, 60039}}, {12192, 17, 55059, {1, 1, 5, 13, 15, 61, 49, 59, 289, 907, 1055, 3579, 8169, 12119, 25479, 32867, 65343}}, {12193, 17, 55068, {1, 3, 5, 9, 5, 63, 91, 225, 377, 469, 891, 891, 5115, 11487, 30151, 44357, 120077}}, {12194, 17, 55071, {1, 1, 1, 15, 29, 59, 19, 51, 295, 585, 149, 497, 5837, 11629, 7825, 18129, 113797}}, {12195, 17, 55075, {1, 1, 3, 7, 31, 25, 77, 209, 183, 337, 1753, 2703, 2559, 11847, 17349, 27359, 21771}}, {12196, 17, 55077, {1, 1, 7, 7, 13, 23, 69, 61, 353, 339, 833, 1935, 4333, 10521, 20331, 62145, 59245}}, {12197, 17, 55081, {1, 1, 5, 13, 19, 57, 35, 59, 203, 99, 487, 2747, 637, 8213, 27053, 29, 64335}}, {12198, 17, 55095, {1, 3, 5, 7, 27, 5, 71, 147, 339, 313, 913, 2845, 5713, 4383, 18969, 54871, 51931}}, {12199, 17, 55099, {1, 1, 1, 5, 7, 23, 19, 11, 111, 543, 311, 1519, 387, 10175, 18209, 14115, 123421}}, {12200, 17, 55110, {1, 3, 7, 11, 7, 7, 123, 193, 417, 65, 1317, 3821, 2315, 14527, 14113, 25873, 23977}}, {12201, 17, 55116, {1, 1, 3, 15, 21, 11, 3, 37, 115, 395, 877, 1227, 6997, 4357, 11397, 52855, 24899}}, {12202, 17, 55122, {1, 1, 7, 5, 15, 45, 45, 17, 441, 605, 429, 739, 4759, 5249, 11311, 55049, 56909}}, {12203, 17, 55134, {1, 1, 1, 5, 3, 5, 77, 31, 407, 703, 385, 235, 7751, 617, 16013, 27269, 66971}}, {12204, 17, 55144, {1, 3, 3, 15, 25, 27, 19, 251, 465, 197, 1039, 3261, 4557, 4821, 16083, 43997, 61371}}, {12205, 17, 55147, {1, 3, 3, 15, 21, 45, 13, 139, 213, 797, 619, 2125, 3805, 4149, 11427, 59807, 104587}}, {12206, 17, 55158, {1, 3, 1, 1, 29, 27, 25, 7, 371, 535, 1613, 1083, 4221, 8913, 10601, 6447, 17619}}, {12207, 17, 55162, {1, 1, 3, 3, 13, 35, 37, 127, 285, 899, 307, 123, 129, 14035, 26503, 64103, 27155}}, {12208, 17, 55171, {1, 1, 7, 7, 27, 25, 45, 245, 271, 281, 69, 3505, 7087, 1529, 7121, 30327, 89131}}, {12209, 17, 55185, {1, 1, 3, 11, 13, 57, 31, 23, 455, 427, 1683, 3019, 5827, 8817, 12943, 321, 39951}}, {12210, 17, 55192, {1, 3, 1, 3, 31, 41, 69, 211, 385, 275, 1569, 2265, 4017, 11057, 15, 16619, 126967}}, {12211, 17, 55197, {1, 3, 3, 1, 27, 27, 21, 145, 125, 929, 1371, 1469, 1591, 5283, 4651, 1265, 17161}}, {12212, 17, 55207, {1, 3, 7, 5, 29, 31, 41, 141, 49, 967, 1421, 663, 6089, 3831, 11353, 38809, 108605}}, {12213, 17, 55228, {1, 1, 7, 15, 11, 23, 91, 31, 9, 717, 265, 1729, 3563, 8145, 20441, 22933, 103683}}, {12214, 17, 55246, {1, 1, 7, 3, 17, 13, 47, 13, 241, 1017, 1803, 2091, 7379, 2941, 11783, 36189, 53513}}, {12215, 17, 55253, {1, 3, 1, 11, 31, 63, 107, 79, 427, 385, 1497, 1265, 5135, 13597, 27343, 56733, 100595}}, {12216, 17, 55254, {1, 3, 7, 3, 9, 15, 119, 29, 205, 151, 1453, 3575, 3627, 7815, 3553, 31457, 14267}}, {12217, 17, 55281, {1, 3, 1, 7, 15, 21, 73, 47, 417, 29, 1231, 2477, 161, 15997, 4457, 3939, 43929}}, {12218, 17, 55300, {1, 1, 5, 5, 19, 49, 103, 251, 359, 69, 669, 299, 8161, 10579, 13999, 26859, 92199}}, {12219, 17, 55303, {1, 1, 3, 1, 9, 27, 81, 7, 115, 29, 1067, 1933, 3061, 2885, 27883, 65227, 59365}}, {12220, 17, 55307, {1, 1, 1, 5, 23, 17, 1, 113, 495, 155, 1673, 3945, 8053, 7935, 3537, 65141, 11809}}, {12221, 17, 55312, {1, 1, 1, 15, 15, 59, 61, 213, 303, 851, 1893, 615, 6659, 9351, 16621, 6097, 114383}}, {12222, 17, 55328, {1, 3, 1, 7, 19, 11, 95, 127, 277, 677, 1631, 2563, 3295, 7029, 4059, 44079, 128857}}, {12223, 17, 55331, {1, 3, 7, 11, 27, 49, 99, 43, 279, 771, 123, 2969, 699, 12915, 22039, 62257, 79359}}, {12224, 17, 55337, {1, 1, 7, 3, 19, 45, 45, 113, 251, 883, 715, 1541, 1573, 3345, 23855, 62681, 57591}}, {12225, 17, 55348, {1, 1, 5, 15, 11, 1, 51, 15, 135, 519, 961, 1447, 4425, 2139, 3309, 35111, 74143}}, {12226, 17, 55352, {1, 3, 7, 7, 17, 39, 109, 25, 11, 549, 315, 2175, 685, 11837, 9151, 6277, 45011}}, {12227, 17, 55357, {1, 1, 1, 9, 27, 7, 95, 1, 385, 167, 453, 1027, 4105, 16351, 19, 10375, 62833}}, {12228, 17, 55372, {1, 3, 7, 13, 17, 19, 107, 11, 441, 171, 185, 3567, 1245, 12161, 30257, 48105, 87105}}, {12229, 17, 55375, {1, 3, 3, 9, 15, 5, 109, 225, 85, 919, 513, 3559, 5411, 9009, 27391, 25115, 84875}}, {12230, 17, 55377, {1, 3, 3, 7, 11, 37, 81, 51, 121, 25, 1897, 2121, 6425, 16087, 4259, 29501, 118067}}, {12231, 17, 55394, {1, 1, 7, 3, 5, 53, 73, 127, 137, 739, 543, 1723, 1163, 2791, 18519, 1459, 50869}}, {12232, 17, 55406, {1, 1, 3, 11, 29, 51, 101, 189, 193, 839, 25, 3109, 3035, 3917, 23929, 38577, 129705}}, {12233, 17, 55424, {1, 3, 7, 15, 9, 29, 93, 101, 271, 791, 1257, 1843, 2701, 8205, 15195, 9109, 120835}}, {12234, 17, 55429, {1, 3, 3, 5, 29, 47, 31, 135, 483, 385, 1395, 2955, 7291, 12885, 9491, 14581, 66293}}, {12235, 17, 55430, {1, 1, 7, 1, 5, 37, 105, 149, 63, 617, 1611, 3025, 3177, 15463, 3373, 3503, 95001}}, {12236, 17, 55436, {1, 1, 5, 13, 1, 57, 19, 35, 127, 423, 1221, 1547, 4083, 347, 17131, 60087, 27437}}, {12237, 17, 55439, {1, 3, 7, 9, 25, 1, 105, 39, 25, 921, 1897, 1729, 2207, 7761, 24197, 457, 64241}}, {12238, 17, 55447, {1, 3, 7, 9, 15, 21, 13, 113, 379, 1021, 489, 1757, 5869, 4833, 24717, 52227, 3209}}, {12239, 17, 55453, {1, 3, 1, 5, 9, 61, 25, 41, 183, 473, 383, 2259, 6939, 3, 32161, 6319, 93099}}, {12240, 17, 55458, {1, 1, 5, 13, 13, 47, 97, 3, 357, 837, 1655, 485, 4251, 12153, 9013, 25121, 51877}}, {12241, 17, 55460, {1, 1, 1, 15, 7, 59, 65, 119, 467, 313, 1333, 2007, 5165, 13935, 13679, 3999, 81811}}, {12242, 17, 55478, {1, 1, 5, 13, 13, 1, 63, 117, 449, 13, 1017, 1583, 7599, 3669, 32699, 59455, 32363}}, {12243, 17, 55489, {1, 1, 7, 9, 7, 15, 37, 251, 167, 25, 1085, 2067, 2771, 5737, 20661, 19231, 59547}}, {12244, 17, 55501, {1, 1, 5, 13, 29, 11, 63, 37, 281, 657, 1567, 2879, 7601, 15617, 16527, 51695, 5583}}, {12245, 17, 55502, {1, 1, 5, 3, 31, 17, 19, 65, 315, 413, 927, 3617, 4089, 11899, 3759, 47991, 1685}}, {12246, 17, 55519, {1, 1, 1, 1, 13, 47, 89, 91, 379, 429, 283, 3765, 2923, 14955, 26399, 9579, 39817}}, {12247, 17, 55525, {1, 1, 1, 9, 1, 17, 91, 119, 327, 291, 39, 2883, 6265, 553, 7559, 60577, 34393}}, {12248, 17, 55530, {1, 3, 5, 5, 9, 33, 123, 219, 103, 529, 181, 1321, 6815, 2411, 10555, 43911, 18889}}, {12249, 17, 55544, {1, 1, 5, 7, 9, 13, 7, 45, 427, 523, 1189, 255, 2103, 7217, 16249, 14631, 90409}}, {12250, 17, 55550, {1, 1, 1, 9, 11, 35, 55, 71, 89, 637, 1417, 411, 5305, 10125, 20715, 62927, 4993}}, {12251, 17, 55558, {1, 3, 1, 9, 1, 59, 27, 221, 267, 797, 1081, 951, 1369, 2677, 20763, 63301, 61963}}, {12252, 17, 55561, {1, 3, 5, 5, 17, 9, 67, 177, 89, 953, 1329, 1649, 989, 7773, 28747, 26231, 42331}}, {12253, 17, 55569, {1, 3, 3, 9, 23, 35, 17, 145, 53, 519, 1173, 2079, 2593, 3633, 32005, 30573, 55651}}, {12254, 17, 55586, {1, 1, 7, 7, 17, 41, 47, 253, 107, 843, 9, 323, 2391, 3267, 25813, 1741, 93493}}, {12255, 17, 55591, {1, 1, 1, 9, 31, 43, 47, 91, 235, 569, 2017, 2385, 5055, 5747, 26471, 48819, 47315}}, {12256, 17, 55598, {1, 3, 5, 9, 1, 17, 87, 91, 55, 287, 995, 2577, 1151, 9119, 22791, 50899, 16423}}, {12257, 17, 55605, {1, 3, 7, 1, 3, 29, 9, 193, 269, 201, 325, 2209, 1061, 7957, 23265, 65083, 27575}}, {12258, 17, 55609, {1, 3, 7, 15, 27, 23, 37, 239, 165, 959, 1965, 2105, 1581, 6621, 17315, 49255, 62487}}, {12259, 17, 55618, {1, 3, 7, 7, 11, 31, 73, 145, 429, 421, 571, 3375, 2797, 15889, 26523, 12315, 48061}}, {12260, 17, 55630, {1, 3, 3, 15, 23, 27, 105, 75, 497, 137, 475, 1343, 537, 10499, 27807, 46623, 32435}}, {12261, 17, 55642, {1, 1, 7, 15, 15, 11, 51, 107, 225, 557, 1461, 3447, 1243, 13827, 23675, 26139, 54603}}, {12262, 17, 55644, {1, 3, 5, 5, 7, 25, 51, 3, 85, 371, 1503, 3217, 1779, 7141, 29471, 42247, 107699}}, {12263, 17, 55653, {1, 3, 7, 15, 23, 53, 127, 229, 241, 165, 1985, 1921, 5917, 15743, 18349, 23981, 58241}}, {12264, 17, 55654, {1, 1, 3, 13, 9, 63, 49, 67, 21, 57, 377, 1807, 5603, 13651, 28039, 3745, 4903}}, {12265, 17, 55660, {1, 3, 7, 11, 1, 43, 17, 95, 79, 343, 1939, 2349, 5195, 3047, 4325, 27829, 53809}}, {12266, 17, 55671, {1, 1, 5, 9, 7, 43, 111, 221, 493, 151, 1635, 3949, 6661, 4861, 17661, 61909, 4975}}, {12267, 17, 55693, {1, 3, 1, 3, 31, 47, 63, 45, 401, 153, 1139, 2125, 6639, 14093, 31607, 20645, 52245}}, {12268, 17, 55706, {1, 1, 3, 1, 19, 31, 59, 139, 285, 749, 751, 775, 7795, 14917, 30295, 61037, 12315}}, {12269, 17, 55712, {1, 3, 3, 9, 15, 55, 79, 183, 373, 663, 497, 2589, 4955, 5409, 23527, 2683, 5487}}, {12270, 17, 55718, {1, 3, 7, 11, 25, 47, 53, 225, 197, 109, 1937, 1375, 7347, 7353, 2335, 21775, 14877}}, {12271, 17, 55739, {1, 3, 1, 9, 23, 61, 51, 221, 129, 57, 115, 1031, 6793, 14773, 3331, 24951, 94761}}, {12272, 17, 55747, {1, 1, 5, 15, 31, 9, 69, 117, 295, 147, 673, 3627, 7167, 13835, 20593, 53163, 83033}}, {12273, 17, 55754, {1, 3, 7, 9, 15, 63, 111, 225, 147, 863, 691, 629, 7485, 483, 21835, 46251, 94645}}, {12274, 17, 55771, {1, 3, 3, 3, 11, 41, 23, 159, 133, 787, 1617, 629, 5047, 4465, 29051, 47499, 7211}}, {12275, 17, 55774, {1, 1, 3, 13, 21, 61, 29, 159, 73, 165, 917, 2577, 7237, 11807, 3767, 56861, 51395}}, {12276, 17, 55780, {1, 1, 5, 3, 15, 31, 37, 233, 283, 265, 1645, 3843, 1971, 4989, 26823, 15243, 74931}}, {12277, 17, 55783, {1, 3, 7, 11, 9, 51, 7, 119, 237, 905, 1211, 3041, 7641, 3387, 8373, 38961, 68925}}, {12278, 17, 55784, {1, 1, 7, 3, 17, 53, 55, 195, 57, 957, 2027, 3965, 2993, 411, 13947, 58349, 32169}}, {12279, 17, 55789, {1, 1, 7, 9, 7, 37, 55, 93, 173, 769, 1381, 3977, 5293, 5051, 21455, 45547, 64653}}, {12280, 17, 55798, {1, 3, 5, 7, 1, 41, 89, 161, 315, 361, 1675, 2993, 3281, 13043, 19003, 22129, 130379}}, {12281, 17, 55802, {1, 3, 1, 9, 13, 37, 85, 197, 465, 177, 661, 943, 541, 11117, 9751, 4193, 98291}}, {12282, 17, 55823, {1, 1, 3, 7, 21, 7, 67, 17, 41, 817, 1159, 1483, 6937, 10079, 3639, 27887, 14541}}, {12283, 17, 55828, {1, 3, 3, 15, 17, 63, 69, 215, 437, 883, 1857, 3319, 3107, 16279, 10709, 30433, 52551}}, {12284, 17, 55837, {1, 1, 3, 11, 1, 5, 69, 37, 419, 999, 1711, 875, 3807, 10811, 16345, 61155, 116043}}, {12285, 17, 55838, {1, 3, 7, 13, 17, 7, 57, 237, 81, 691, 1143, 4075, 2481, 643, 8091, 8243, 80111}}, {12286, 17, 55847, {1, 1, 7, 7, 17, 61, 73, 215, 113, 885, 159, 2243, 1177, 10981, 10123, 48995, 123349}}, {12287, 17, 55848, {1, 1, 1, 7, 31, 47, 99, 15, 371, 343, 1483, 1985, 25, 11125, 8357, 10677, 130895}}, {12288, 17, 55885, {1, 3, 1, 13, 25, 41, 83, 37, 129, 493, 641, 185, 6607, 7213, 13285, 10439, 73227}}, {12289, 17, 55897, {1, 1, 5, 7, 17, 15, 93, 53, 281, 91, 115, 3675, 3081, 9825, 23653, 40095, 91803}}, {12290, 17, 55904, {1, 1, 1, 5, 3, 25, 39, 207, 419, 361, 953, 2823, 8105, 15763, 29199, 61607, 32633}}, {12291, 17, 55910, {1, 1, 3, 1, 31, 51, 55, 3, 277, 639, 191, 1783, 139, 29, 16659, 30199, 69109}}, {12292, 17, 55919, {1, 1, 1, 7, 31, 59, 25, 13, 239, 617, 115, 1787, 5757, 9927, 2417, 37313, 115135}}, {12293, 17, 55922, {1, 1, 3, 5, 19, 35, 5, 187, 483, 823, 1875, 163, 4235, 853, 23679, 50899, 94981}}, {12294, 17, 55931, {1, 3, 3, 11, 9, 39, 121, 201, 189, 543, 1493, 1215, 351, 16063, 1701, 56559, 108053}}, {12295, 17, 55933, {1, 3, 1, 7, 1, 39, 31, 163, 347, 307, 349, 4081, 1729, 16265, 363, 28297, 50631}}, {12296, 17, 55937, {1, 3, 7, 13, 21, 55, 127, 161, 75, 9, 1285, 1839, 5283, 5667, 10979, 22185, 7581}}, {12297, 17, 55943, {1, 1, 3, 5, 13, 45, 17, 181, 117, 395, 1685, 663, 3441, 5359, 7157, 27759, 102343}}, {12298, 17, 55955, {1, 3, 1, 7, 7, 31, 97, 187, 383, 769, 1469, 4007, 5521, 13973, 49, 43823, 75649}}, {12299, 17, 55957, {1, 3, 5, 7, 31, 13, 47, 11, 335, 961, 321, 3367, 1903, 503, 8409, 1101, 58215}}, {12300, 17, 55968, {1, 1, 7, 7, 25, 49, 39, 1, 453, 419, 333, 1759, 2287, 6243, 10723, 13687, 56853}}, {12301, 17, 55980, {1, 3, 3, 7, 11, 55, 125, 197, 19, 591, 1969, 511, 2501, 8429, 29467, 27917, 63457}}, {12302, 17, 55986, {1, 1, 3, 11, 11, 43, 35, 213, 231, 119, 379, 3761, 4891, 5677, 20317, 5459, 55487}}, {12303, 17, 55992, {1, 1, 5, 7, 21, 9, 127, 59, 97, 963, 847, 2131, 7907, 11409, 8785, 48197, 96907}}, {12304, 17, 56005, {1, 3, 5, 3, 23, 7, 45, 95, 179, 691, 1571, 3091, 6359, 9105, 26021, 26925, 43}}, {12305, 17, 56034, {1, 3, 3, 7, 21, 7, 11, 219, 439, 465, 1983, 117, 4639, 8387, 27637, 15883, 5567}}, {12306, 17, 56051, {1, 1, 7, 3, 1, 3, 51, 205, 425, 133, 563, 1317, 533, 1227, 8361, 23407, 39825}}, {12307, 17, 56054, {1, 1, 5, 3, 3, 39, 19, 69, 477, 605, 3, 1887, 2077, 13673, 2763, 64415, 104519}}, {12308, 17, 56065, {1, 1, 5, 15, 11, 45, 89, 245, 177, 591, 1313, 587, 4781, 5103, 26401, 12643, 38959}}, {12309, 17, 56080, {1, 1, 1, 5, 11, 13, 15, 95, 271, 99, 2001, 2701, 6065, 3527, 7423, 37525, 117161}}, {12310, 17, 56101, {1, 3, 7, 7, 21, 17, 111, 149, 373, 591, 1461, 809, 3877, 8635, 13209, 31439, 64285}}, {12311, 17, 56113, {1, 3, 1, 15, 25, 51, 55, 161, 357, 181, 41, 2345, 3553, 9917, 30123, 40683, 122497}}, {12312, 17, 56126, {1, 3, 7, 15, 5, 55, 119, 239, 291, 665, 1537, 3309, 2519, 12397, 25897, 51529, 28673}}, {12313, 17, 56131, {1, 1, 1, 9, 25, 45, 21, 119, 19, 145, 313, 2509, 1031, 3319, 14863, 10759, 22577}}, {12314, 17, 56134, {1, 3, 1, 15, 1, 61, 87, 229, 511, 83, 79, 51, 1407, 16293, 26217, 25839, 86207}}, {12315, 17, 56143, {1, 3, 7, 7, 23, 43, 89, 11, 43, 801, 569, 3273, 315, 9537, 681, 34783, 97101}}, {12316, 17, 56148, {1, 1, 5, 1, 13, 31, 77, 115, 501, 669, 27, 3765, 6789, 9139, 30587, 45995, 102433}}, {12317, 17, 56152, {1, 1, 7, 1, 15, 21, 57, 197, 243, 353, 71, 341, 7319, 8467, 9779, 15755, 4185}}, {12318, 17, 56174, {1, 1, 1, 1, 17, 21, 3, 185, 277, 585, 265, 3189, 3975, 353, 8541, 23905, 21881}}, {12319, 17, 56181, {1, 3, 5, 3, 5, 23, 113, 253, 343, 73, 1419, 2529, 4333, 2007, 14307, 60591, 55411}}, {12320, 17, 56182, {1, 1, 7, 3, 25, 35, 109, 173, 351, 487, 1551, 3207, 1189, 5091, 3581, 4699, 22085}}, {12321, 17, 56185, {1, 1, 3, 11, 9, 9, 71, 173, 17, 595, 2015, 2543, 4889, 6025, 15265, 6459, 3977}}, {12322, 17, 56192, {1, 3, 5, 15, 11, 13, 11, 189, 431, 307, 317, 3131, 1421, 10863, 5311, 25273, 43187}}, {12323, 17, 56201, {1, 1, 1, 7, 7, 41, 103, 231, 321, 327, 1849, 2485, 6461, 10259, 4577, 52951, 33053}}, {12324, 17, 56215, {1, 3, 3, 15, 11, 33, 73, 155, 453, 597, 575, 2119, 327, 4227, 32271, 7429, 102007}}, {12325, 17, 56219, {1, 1, 3, 7, 15, 9, 95, 177, 21, 245, 257, 3637, 821, 16351, 1733, 10635, 59885}}, {12326, 17, 56222, {1, 1, 3, 7, 23, 41, 107, 147, 57, 877, 1609, 3275, 339, 12997, 5989, 62293, 21549}}, {12327, 17, 56258, {1, 1, 7, 13, 19, 39, 111, 229, 321, 487, 873, 3365, 4915, 251, 30629, 45775, 73549}}, {12328, 17, 56264, {1, 1, 1, 13, 25, 61, 43, 111, 135, 463, 1921, 1723, 7505, 13805, 30633, 51683, 7353}}, {12329, 17, 56269, {1, 1, 1, 1, 31, 41, 35, 205, 375, 189, 635, 3589, 3507, 8131, 13437, 22823, 68451}}, {12330, 17, 56272, {1, 3, 7, 5, 31, 47, 13, 229, 105, 195, 685, 529, 39, 2651, 6821, 11043, 112123}}, {12331, 17, 56278, {1, 3, 7, 13, 3, 23, 21, 203, 89, 957, 1577, 1711, 585, 3937, 17681, 55577, 61075}}, {12332, 17, 56282, {1, 3, 3, 3, 17, 37, 49, 7, 287, 183, 1185, 2979, 2103, 1217, 22105, 11677, 19603}}, {12333, 17, 56306, {1, 1, 1, 9, 29, 35, 93, 179, 403, 563, 441, 3485, 6909, 12647, 3885, 60089, 29275}}, {12334, 17, 56308, {1, 3, 3, 9, 15, 37, 49, 103, 509, 77, 495, 921, 2599, 14735, 30951, 22779, 47747}}, {12335, 17, 56318, {1, 3, 3, 11, 17, 45, 43, 235, 379, 51, 925, 89, 2241, 10273, 27649, 8101, 93977}}, {12336, 17, 56329, {1, 3, 3, 3, 11, 7, 25, 163, 405, 997, 847, 2743, 4705, 7041, 10997, 50189, 10775}}, {12337, 17, 56356, {1, 1, 1, 13, 19, 43, 3, 125, 37, 41, 5, 965, 2681, 3737, 29057, 37777, 119537}}, {12338, 17, 56360, {1, 1, 1, 1, 11, 27, 101, 67, 73, 199, 1739, 2835, 5837, 10595, 9865, 38493, 99323}}, {12339, 17, 56383, {1, 3, 1, 13, 27, 43, 21, 79, 419, 847, 843, 2563, 8133, 10295, 10127, 30839, 104863}}, {12340, 17, 56388, {1, 3, 3, 11, 15, 37, 71, 251, 157, 971, 165, 1647, 2583, 205, 23555, 55297, 106893}}, {12341, 17, 56391, {1, 1, 5, 15, 1, 21, 113, 107, 287, 727, 71, 2655, 1435, 11125, 15257, 18899, 37737}}, {12342, 17, 56405, {1, 1, 3, 3, 27, 49, 17, 85, 57, 237, 349, 4049, 1103, 2523, 3919, 36587, 128595}}, {12343, 17, 56406, {1, 3, 5, 9, 13, 1, 65, 13, 361, 409, 413, 2153, 5953, 10651, 25383, 49777, 65399}}, {12344, 17, 56416, {1, 1, 7, 9, 19, 47, 69, 127, 121, 925, 57, 2775, 4981, 3643, 4077, 3081, 56093}}, {12345, 17, 56426, {1, 3, 3, 13, 1, 53, 45, 13, 489, 445, 623, 3547, 1659, 1899, 11971, 3725, 12445}}, {12346, 17, 56439, {1, 3, 7, 11, 13, 9, 59, 157, 125, 975, 1283, 297, 3609, 3179, 31341, 54727, 112515}}, {12347, 17, 56446, {1, 1, 1, 13, 23, 63, 69, 249, 159, 593, 47, 3957, 757, 14693, 26345, 18839, 111263}}, {12348, 17, 56450, {1, 1, 1, 1, 31, 37, 37, 199, 7, 425, 337, 1475, 271, 16215, 12089, 16765, 13519}}, {12349, 17, 56459, {1, 1, 7, 11, 31, 59, 121, 139, 413, 807, 737, 1235, 3505, 5859, 14205, 31939, 4713}}, {12350, 17, 56461, {1, 1, 1, 9, 21, 51, 113, 159, 345, 807, 635, 523, 5535, 13307, 4239, 14847, 23711}}, {12351, 17, 56464, {1, 3, 5, 13, 31, 7, 33, 1, 293, 271, 1829, 2535, 6333, 12037, 29401, 35009, 37789}}, {12352, 17, 56469, {1, 1, 7, 3, 7, 57, 31, 45, 177, 475, 843, 1265, 585, 16099, 29293, 52407, 56131}}, {12353, 17, 56489, {1, 3, 3, 11, 1, 25, 117, 205, 139, 141, 1229, 903, 1883, 11269, 30493, 3979, 4263}}, {12354, 17, 56490, {1, 1, 5, 13, 25, 43, 9, 237, 347, 869, 1765, 1389, 1931, 13331, 17325, 45999, 121201}}, {12355, 17, 56497, {1, 3, 3, 11, 3, 13, 95, 49, 389, 53, 491, 1467, 5105, 16053, 6305, 15759, 51991}}, {12356, 17, 56509, {1, 3, 5, 15, 1, 53, 85, 69, 75, 409, 1299, 1245, 7951, 10709, 9157, 3509, 103975}}, {12357, 17, 56515, {1, 1, 1, 13, 1, 33, 97, 235, 463, 413, 1759, 1891, 1781, 5261, 5759, 201, 69199}}, {12358, 17, 56518, {1, 1, 3, 13, 21, 27, 101, 143, 123, 705, 969, 2461, 6057, 13091, 6077, 38311, 30379}}, {12359, 17, 56524, {1, 3, 3, 1, 13, 11, 73, 33, 495, 513, 763, 3089, 421, 13663, 30169, 56599, 38847}}, {12360, 17, 56535, {1, 1, 7, 13, 13, 31, 91, 63, 233, 137, 859, 2449, 539, 12461, 13477, 31605, 58919}}, {12361, 17, 56542, {1, 1, 1, 9, 13, 49, 107, 45, 451, 707, 1735, 1881, 3451, 9131, 25481, 10841, 116067}}, {12362, 17, 56545, {1, 3, 7, 1, 27, 21, 51, 117, 63, 53, 575, 3325, 1099, 11181, 23609, 47141, 115421}}, {12363, 17, 56551, {1, 3, 1, 13, 25, 29, 53, 135, 165, 319, 1695, 341, 8157, 10671, 7095, 60749, 31513}}, {12364, 17, 56555, {1, 1, 7, 5, 3, 53, 123, 137, 449, 87, 951, 693, 6943, 15331, 1515, 24019, 56613}}, {12365, 17, 56560, {1, 3, 7, 5, 25, 17, 43, 251, 301, 203, 633, 1271, 6253, 4475, 10773, 25003, 67599}}, {12366, 17, 56569, {1, 1, 3, 9, 1, 25, 117, 159, 13, 155, 851, 2497, 6155, 6549, 27909, 24423, 82357}}, {12367, 17, 56580, {1, 1, 1, 1, 21, 59, 103, 43, 291, 111, 1355, 401, 5129, 16017, 25947, 15391, 46745}}, {12368, 17, 56584, {1, 1, 1, 13, 13, 51, 95, 111, 17, 963, 1535, 3003, 6163, 11377, 6787, 57275, 109559}}, {12369, 17, 56598, {1, 1, 5, 11, 11, 3, 85, 207, 489, 117, 269, 747, 5719, 8501, 7307, 59223, 18941}}, {12370, 17, 56601, {1, 1, 5, 1, 9, 53, 41, 255, 271, 995, 1939, 2739, 2221, 14841, 22617, 10643, 6427}}, {12371, 17, 56602, {1, 3, 3, 9, 7, 55, 109, 143, 427, 45, 579, 115, 2061, 8447, 29469, 5523, 129063}}, {12372, 17, 56623, {1, 3, 7, 5, 23, 63, 119, 31, 53, 821, 135, 2677, 807, 4685, 24391, 55165, 88079}}, {12373, 17, 56637, {1, 3, 5, 9, 15, 11, 73, 177, 243, 375, 115, 1633, 7983, 15039, 21169, 25325, 128479}}, {12374, 17, 56638, {1, 3, 3, 5, 21, 51, 13, 51, 75, 993, 77, 209, 2761, 451, 11987, 40297, 2383}}, {12375, 17, 56643, {1, 3, 7, 1, 19, 9, 11, 161, 19, 851, 1313, 1169, 4405, 7493, 23935, 37323, 107387}}, {12376, 17, 56650, {1, 3, 5, 15, 5, 11, 79, 129, 507, 247, 811, 1145, 3893, 5205, 11309, 38205, 2051}}, {12377, 17, 56673, {1, 1, 5, 1, 11, 13, 33, 155, 21, 185, 771, 3261, 981, 743, 12479, 22611, 25321}}, {12378, 17, 56676, {1, 1, 5, 9, 7, 25, 11, 235, 429, 563, 1647, 1429, 1385, 14411, 3831, 19769, 67599}}, {12379, 17, 56686, {1, 3, 3, 5, 5, 7, 109, 117, 251, 823, 669, 2043, 1843, 11829, 27051, 35865, 11461}}, {12380, 17, 56704, {1, 3, 5, 5, 7, 3, 45, 63, 305, 99, 393, 1765, 1711, 15569, 27295, 16555, 77631}}, {12381, 17, 56710, {1, 3, 5, 11, 23, 33, 49, 125, 85, 677, 1589, 2667, 5723, 15619, 30415, 39561, 122763}}, {12382, 17, 56721, {1, 3, 7, 13, 27, 21, 99, 209, 481, 123, 1285, 115, 6517, 11753, 11365, 44959, 89}}, {12383, 17, 56731, {1, 1, 1, 7, 15, 15, 45, 151, 489, 169, 933, 2987, 657, 3095, 6745, 131, 37767}}, {12384, 17, 56738, {1, 3, 1, 15, 1, 37, 99, 137, 151, 891, 715, 383, 1293, 719, 10957, 5557, 92841}}, {12385, 17, 56747, {1, 1, 1, 3, 27, 59, 93, 49, 473, 313, 431, 1129, 5995, 13101, 13185, 7091, 109677}}, {12386, 17, 56750, {1, 3, 3, 7, 1, 41, 55, 135, 271, 527, 1919, 1093, 2579, 3725, 22853, 31613, 4729}}, {12387, 17, 56752, {1, 1, 7, 1, 7, 13, 63, 255, 219, 837, 117, 2323, 4295, 15697, 8607, 47047, 117869}}, {12388, 17, 56757, {1, 1, 1, 7, 29, 29, 55, 171, 437, 733, 491, 1037, 7221, 5705, 31819, 19583, 103991}}, {12389, 17, 56787, {1, 3, 7, 1, 31, 19, 65, 39, 151, 517, 1985, 2251, 6147, 12983, 28263, 35891, 7545}}, {12390, 17, 56796, {1, 1, 7, 7, 21, 41, 97, 253, 427, 391, 849, 611, 4827, 10807, 6267, 22513, 62803}}, {12391, 17, 56803, {1, 3, 7, 7, 25, 9, 49, 245, 491, 39, 603, 1853, 5655, 3517, 10745, 55069, 121497}}, {12392, 17, 56812, {1, 3, 1, 5, 9, 39, 109, 195, 283, 141, 2007, 3, 1267, 13053, 8387, 48665, 48877}}, {12393, 17, 56815, {1, 1, 3, 7, 27, 61, 49, 43, 229, 497, 2015, 1345, 3195, 7139, 13453, 56993, 15099}}, {12394, 17, 56824, {1, 3, 5, 11, 31, 53, 87, 97, 385, 387, 1107, 3287, 2517, 7421, 1007, 37421, 124113}}, {12395, 17, 56829, {1, 3, 3, 11, 9, 55, 51, 215, 181, 419, 863, 3149, 5815, 15579, 28527, 34715, 61375}}, {12396, 17, 56833, {1, 3, 3, 3, 31, 57, 5, 35, 445, 957, 1897, 105, 2533, 10255, 19795, 49127, 38491}}, {12397, 17, 56839, {1, 3, 3, 13, 25, 53, 1, 159, 443, 541, 439, 3377, 5511, 9667, 26777, 32599, 36981}}, {12398, 17, 56840, {1, 1, 1, 3, 23, 29, 97, 131, 59, 143, 1601, 2765, 4569, 11081, 6027, 38641, 100745}}, {12399, 17, 56845, {1, 3, 3, 15, 9, 15, 19, 35, 321, 935, 465, 2707, 4799, 7455, 12743, 31029, 114149}}, {12400, 17, 56853, {1, 1, 1, 1, 11, 51, 23, 79, 387, 701, 107, 623, 231, 12571, 7719, 3061, 79605}}, {12401, 17, 56854, {1, 3, 5, 15, 17, 49, 109, 83, 185, 295, 853, 219, 3615, 535, 32001, 6655, 4185}}, {12402, 17, 56858, {1, 3, 3, 15, 15, 7, 35, 151, 305, 705, 1383, 1595, 5595, 11995, 15491, 49119, 83383}}, {12403, 17, 56863, {1, 3, 7, 9, 3, 25, 57, 47, 359, 719, 1937, 1403, 1399, 10827, 24181, 29141, 79017}}, {12404, 17, 56864, {1, 3, 5, 1, 1, 21, 21, 245, 361, 485, 1521, 3935, 1587, 8653, 25871, 49449, 103413}}, {12405, 17, 56881, {1, 3, 3, 3, 9, 61, 31, 69, 401, 261, 1217, 3069, 4045, 12437, 32017, 15113, 10769}}, {12406, 17, 56882, {1, 3, 1, 1, 21, 33, 123, 87, 481, 793, 625, 4087, 1361, 11077, 18835, 13287, 40107}}, {12407, 17, 56896, {1, 3, 7, 3, 9, 49, 101, 213, 467, 77, 1691, 2621, 4411, 8025, 30247, 13691, 20559}}, {12408, 17, 56901, {1, 1, 1, 9, 29, 49, 47, 135, 1, 337, 1649, 389, 3845, 7213, 19527, 2619, 78841}}, {12409, 17, 56902, {1, 3, 7, 9, 23, 23, 47, 97, 493, 767, 137, 1467, 7015, 2883, 12749, 9267, 12441}}, {12410, 17, 56908, {1, 1, 3, 15, 9, 57, 53, 19, 401, 385, 1159, 1185, 6977, 14027, 3183, 59119, 42065}}, {12411, 17, 56923, {1, 1, 1, 15, 21, 33, 83, 251, 147, 395, 321, 443, 6893, 1877, 6687, 28863, 86531}}, {12412, 17, 56925, {1, 3, 3, 1, 3, 47, 27, 247, 121, 827, 1399, 4079, 7545, 11691, 27915, 28811, 17099}}, {12413, 17, 56926, {1, 3, 5, 7, 5, 59, 73, 69, 117, 897, 905, 3273, 2935, 11077, 32443, 60959, 16081}}, {12414, 17, 56932, {1, 1, 7, 5, 27, 49, 107, 169, 75, 435, 1913, 2089, 5733, 2361, 5163, 52239, 87411}}, {12415, 17, 56939, {1, 1, 7, 13, 1, 13, 123, 89, 427, 301, 1217, 1491, 5361, 10381, 28971, 57655, 108607}}, {12416, 17, 56947, {1, 1, 7, 11, 13, 5, 23, 151, 117, 369, 623, 2263, 2609, 109, 32485, 52133, 69391}}, {12417, 17, 56954, {1, 3, 7, 11, 7, 33, 127, 43, 123, 203, 775, 3215, 5115, 1805, 14581, 46791, 128781}}, {12418, 17, 56970, {1, 3, 3, 1, 7, 23, 37, 99, 1, 719, 293, 2727, 6859, 683, 13241, 17839, 4215}}, {12419, 17, 56972, {1, 1, 1, 13, 27, 41, 93, 25, 59, 947, 971, 1523, 4443, 1209, 32317, 58651, 11121}}, {12420, 17, 56977, {1, 1, 1, 3, 31, 33, 23, 87, 349, 265, 445, 3489, 783, 7833, 5767, 59295, 45057}}, {12421, 17, 56980, {1, 1, 1, 1, 15, 47, 19, 15, 217, 837, 2043, 2805, 4701, 5873, 1517, 46743, 61655}}, {12422, 17, 56993, {1, 3, 7, 1, 27, 27, 9, 107, 25, 897, 955, 3763, 821, 1535, 14557, 38537, 128737}}, {12423, 17, 57013, {1, 3, 3, 7, 19, 49, 121, 217, 401, 975, 1189, 715, 3113, 4219, 4885, 57861, 6833}}, {12424, 17, 57017, {1, 3, 3, 1, 17, 59, 53, 15, 259, 791, 2035, 499, 7707, 13685, 14367, 20155, 91033}}, {12425, 17, 57018, {1, 3, 5, 5, 11, 11, 69, 237, 139, 73, 541, 1135, 2647, 14109, 18113, 8051, 31917}}, {12426, 17, 57031, {1, 1, 1, 15, 11, 23, 89, 181, 295, 743, 29, 4009, 4683, 13989, 4575, 38865, 30449}}, {12427, 17, 57059, {1, 1, 1, 11, 21, 63, 31, 121, 55, 153, 1143, 4059, 3247, 11725, 17659, 48935, 118369}}, {12428, 17, 57062, {1, 1, 7, 9, 17, 29, 27, 167, 69, 957, 2009, 2795, 3161, 3493, 16365, 43637, 102321}}, {12429, 17, 57065, {1, 3, 5, 13, 27, 23, 17, 7, 345, 253, 631, 1389, 2523, 9993, 32619, 46731, 4757}}, {12430, 17, 57071, {1, 1, 1, 11, 17, 1, 41, 107, 25, 183, 1361, 1211, 3607, 12713, 16011, 42987, 36415}}, {12431, 17, 57083, {1, 1, 7, 5, 13, 29, 33, 69, 261, 213, 73, 3737, 3867, 503, 28225, 53735, 91695}}, {12432, 17, 57093, {1, 3, 7, 7, 21, 63, 75, 39, 259, 367, 487, 2087, 5411, 1925, 29589, 39019, 73283}}, {12433, 17, 57097, {1, 3, 1, 7, 29, 29, 25, 191, 91, 509, 1485, 853, 7011, 13321, 27769, 10249, 87341}}, {12434, 17, 57106, {1, 1, 7, 7, 1, 9, 115, 71, 321, 913, 1679, 2129, 771, 9217, 4731, 24353, 35631}}, {12435, 17, 57118, {1, 3, 1, 13, 5, 45, 53, 255, 429, 805, 1983, 1437, 2677, 6337, 22221, 55455, 39855}}, {12436, 17, 57133, {1, 1, 1, 1, 1, 5, 111, 231, 321, 961, 371, 3825, 3623, 3985, 32151, 6113, 130687}}, {12437, 17, 57134, {1, 3, 7, 3, 15, 29, 103, 181, 261, 149, 1161, 1745, 1765, 1677, 20051, 47033, 84997}}, {12438, 17, 57141, {1, 3, 7, 1, 25, 21, 7, 229, 407, 673, 1525, 1207, 3099, 14849, 22103, 45695, 85951}}, {12439, 17, 57146, {1, 3, 7, 1, 9, 5, 105, 149, 181, 81, 1589, 3477, 5387, 7943, 29203, 50355, 39001}}, {12440, 17, 57156, {1, 3, 7, 1, 21, 31, 39, 121, 397, 1023, 711, 623, 6193, 12315, 11101, 11911, 50033}}, {12441, 17, 57174, {1, 3, 7, 3, 7, 19, 73, 69, 201, 337, 1037, 3663, 2679, 5153, 28171, 24455, 74685}}, {12442, 17, 57183, {1, 3, 1, 1, 21, 35, 121, 111, 217, 809, 507, 1347, 4439, 4601, 26371, 23595, 3583}}, {12443, 17, 57189, {1, 3, 3, 7, 1, 51, 83, 231, 419, 597, 305, 3405, 5831, 11845, 1861, 48671, 105315}}, {12444, 17, 57190, {1, 3, 1, 15, 25, 37, 103, 141, 495, 727, 1919, 2821, 4689, 6727, 27117, 2259, 54559}}, {12445, 17, 57193, {1, 3, 5, 3, 27, 55, 5, 117, 199, 979, 1745, 401, 7967, 5345, 29747, 54085, 124765}}, {12446, 17, 57196, {1, 3, 3, 15, 23, 61, 1, 29, 489, 131, 583, 389, 6033, 8007, 22933, 44513, 111845}}, {12447, 17, 57207, {1, 1, 7, 13, 3, 55, 119, 147, 181, 485, 793, 3593, 6971, 2227, 28507, 62393, 127303}}, {12448, 17, 57211, {1, 1, 5, 3, 29, 53, 37, 59, 213, 283, 1809, 3685, 2677, 5761, 19705, 47079, 3477}}, {12449, 17, 57214, {1, 1, 1, 7, 21, 63, 91, 13, 347, 605, 589, 415, 5737, 10281, 30941, 25609, 67973}}, {12450, 17, 57218, {1, 1, 3, 1, 27, 49, 87, 161, 507, 693, 59, 1375, 6737, 1029, 14731, 32335, 51961}}, {12451, 17, 57230, {1, 3, 3, 9, 11, 15, 121, 121, 151, 335, 221, 3099, 1999, 1047, 20891, 23015, 95809}}, {12452, 17, 57235, {1, 1, 7, 7, 1, 49, 63, 227, 113, 161, 863, 801, 2559, 7737, 27619, 27419, 128009}}, {12453, 17, 57241, {1, 1, 7, 1, 25, 59, 67, 111, 435, 309, 807, 2107, 8077, 9671, 6739, 53757, 41259}}, {12454, 17, 57251, {1, 3, 7, 3, 3, 19, 7, 111, 237, 981, 1717, 3131, 6631, 467, 13103, 61435, 126469}}, {12455, 17, 57260, {1, 1, 7, 9, 19, 31, 59, 185, 199, 111, 351, 611, 6355, 1095, 28549, 32871, 44537}}, {12456, 17, 57263, {1, 1, 3, 11, 23, 25, 31, 1, 461, 83, 1723, 1711, 3679, 10963, 14927, 17377, 911}}, {12457, 17, 57265, {1, 1, 5, 13, 3, 37, 127, 159, 199, 223, 1097, 3033, 5825, 13777, 22189, 44305, 20509}}, {12458, 17, 57271, {1, 1, 5, 15, 13, 49, 17, 79, 289, 601, 1023, 657, 1687, 14477, 15929, 4279, 68007}}, {12459, 17, 57272, {1, 1, 5, 7, 29, 3, 45, 225, 65, 711, 1039, 3585, 4957, 9041, 22761, 26649, 95627}}, {12460, 17, 57290, {1, 3, 5, 5, 13, 29, 33, 211, 461, 799, 1437, 1057, 485, 9535, 8133, 57527, 12873}}, {12461, 17, 57295, {1, 1, 3, 3, 15, 43, 53, 15, 395, 561, 1371, 3543, 7707, 2399, 13311, 25641, 58865}}, {12462, 17, 57298, {1, 3, 1, 7, 1, 9, 115, 39, 249, 87, 835, 97, 8137, 6665, 11951, 21045, 76387}}, {12463, 17, 57325, {1, 3, 3, 9, 5, 63, 115, 163, 331, 1007, 733, 4027, 2911, 5329, 6967, 3535, 107293}}, {12464, 17, 57328, {1, 3, 1, 11, 5, 55, 81, 63, 345, 535, 1093, 207, 4053, 9129, 10397, 26641, 95171}}, {12465, 17, 57340, {1, 1, 3, 3, 13, 27, 65, 37, 255, 69, 19, 2565, 4329, 11223, 18131, 18701, 31111}}, {12466, 17, 57344, {1, 3, 7, 7, 25, 57, 81, 189, 227, 377, 829, 1583, 1343, 4643, 23485, 47463, 83535}}, {12467, 17, 57353, {1, 3, 5, 9, 13, 33, 103, 75, 501, 803, 427, 1171, 1187, 2655, 24187, 32907, 120239}}, {12468, 17, 57368, {1, 3, 1, 7, 31, 63, 21, 137, 241, 63, 1925, 2193, 1135, 11159, 14685, 28397, 59}}, {12469, 17, 57371, {1, 1, 7, 1, 15, 7, 85, 87, 493, 63, 561, 1069, 5481, 12253, 25149, 35283, 16123}}, {12470, 17, 57383, {1, 3, 3, 5, 19, 17, 23, 95, 429, 805, 1343, 2243, 233, 7219, 6549, 21477, 83679}}, {12471, 17, 57402, {1, 3, 3, 1, 3, 55, 83, 107, 131, 311, 741, 781, 6227, 10059, 3903, 235, 45971}}, {12472, 17, 57407, {1, 1, 3, 13, 21, 43, 79, 149, 367, 755, 463, 221, 5117, 7015, 17599, 64665, 37443}}, {12473, 17, 57419, {1, 1, 7, 15, 3, 59, 107, 13, 213, 287, 1505, 2131, 6965, 12873, 23973, 8449, 24829}}, {12474, 17, 57424, {1, 3, 5, 11, 25, 45, 39, 17, 175, 749, 1179, 3349, 6723, 12543, 3557, 34521, 103197}}, {12475, 17, 57433, {1, 1, 3, 13, 23, 41, 21, 25, 91, 941, 879, 4015, 137, 12949, 17245, 41903, 39803}}, {12476, 17, 57452, {1, 1, 7, 15, 11, 33, 45, 127, 321, 895, 1543, 4013, 6179, 14209, 13317, 46803, 99891}}, {12477, 17, 57458, {1, 3, 3, 13, 13, 11, 101, 11, 177, 869, 509, 2323, 449, 16379, 31965, 2899, 59229}}, {12478, 17, 57467, {1, 1, 5, 7, 15, 37, 113, 237, 463, 489, 1145, 1629, 3101, 10305, 31705, 29957, 99665}}, {12479, 17, 57470, {1, 3, 5, 7, 21, 29, 45, 133, 367, 657, 1315, 537, 6069, 8141, 31479, 32983, 57}}, {12480, 17, 57473, {1, 1, 3, 9, 13, 39, 109, 125, 467, 975, 829, 4007, 773, 6639, 8793, 4579, 60547}}, {12481, 17, 57479, {1, 1, 1, 15, 21, 5, 113, 51, 159, 501, 1921, 4095, 5603, 16055, 16649, 50229, 49863}}, {12482, 17, 57480, {1, 1, 5, 13, 9, 21, 77, 187, 355, 299, 1017, 491, 6725, 4177, 16739, 15909, 84069}}, {12483, 17, 57486, {1, 3, 7, 5, 13, 13, 51, 19, 159, 339, 735, 933, 2523, 11435, 20793, 21975, 19007}}, {12484, 17, 57491, {1, 1, 7, 5, 1, 11, 61, 111, 129, 643, 1741, 945, 7349, 11579, 24793, 1751, 2367}}, {12485, 17, 57493, {1, 1, 5, 5, 29, 45, 63, 177, 507, 277, 1789, 729, 4277, 10099, 28985, 43009, 2319}}, {12486, 17, 57524, {1, 3, 3, 13, 19, 53, 73, 227, 487, 131, 1227, 3735, 3979, 7383, 6923, 31979, 6651}}, {12487, 17, 57528, {1, 3, 3, 15, 7, 47, 31, 255, 317, 621, 497, 4069, 5249, 15093, 18013, 6891, 81893}}, {12488, 17, 57534, {1, 1, 7, 5, 17, 23, 119, 27, 55, 555, 221, 2693, 1757, 11117, 23409, 21135, 122977}}, {12489, 17, 57542, {1, 1, 5, 1, 15, 17, 127, 109, 75, 1017, 1167, 2975, 3249, 5399, 12599, 50779, 78215}}, {12490, 17, 57560, {1, 3, 5, 5, 1, 13, 65, 199, 101, 75, 513, 493, 6931, 9363, 5607, 16331, 69219}}, {12491, 17, 57565, {1, 1, 1, 15, 19, 37, 63, 177, 397, 645, 905, 1599, 609, 14291, 14681, 46719, 117745}}, {12492, 17, 57570, {1, 3, 7, 13, 3, 57, 63, 49, 67, 913, 1659, 1857, 3595, 9219, 11341, 39735, 82275}}, {12493, 17, 57579, {1, 1, 5, 11, 19, 1, 5, 181, 55, 763, 469, 2417, 2349, 12437, 22589, 17867, 95701}}, {12494, 17, 57590, {1, 3, 7, 13, 1, 9, 11, 159, 103, 737, 1989, 59, 4711, 8093, 31703, 45663, 92913}}, {12495, 17, 57601, {1, 3, 3, 11, 15, 9, 35, 217, 299, 479, 1539, 2605, 2003, 8841, 27261, 28853, 98877}}, {12496, 17, 57604, {1, 1, 5, 5, 15, 45, 73, 159, 205, 1017, 159, 3659, 2377, 3651, 6489, 19711, 109959}}, {12497, 17, 57607, {1, 1, 3, 15, 7, 41, 7, 47, 357, 433, 211, 111, 2565, 8637, 15917, 47887, 128513}}, {12498, 17, 57621, {1, 3, 7, 3, 25, 9, 33, 33, 5, 805, 1541, 3333, 7257, 9011, 4813, 53195, 52469}}, {12499, 17, 57635, {1, 1, 7, 15, 27, 3, 11, 57, 415, 371, 563, 2515, 149, 6555, 31273, 51465, 2989}}, {12500, 17, 57642, {1, 1, 1, 11, 3, 41, 25, 175, 499, 879, 1145, 1083, 7857, 10497, 16991, 23351, 115353}}, {12501, 17, 57650, {1, 1, 3, 15, 15, 9, 39, 239, 285, 413, 989, 2927, 7205, 79, 20101, 30115, 113933}}, {12502, 17, 57655, {1, 1, 7, 5, 13, 29, 29, 69, 25, 533, 1731, 1391, 4065, 12597, 19167, 51989, 101273}}, {12503, 17, 57670, {1, 1, 5, 3, 9, 41, 83, 127, 197, 627, 173, 273, 593, 15733, 19285, 26517, 107877}}, {12504, 17, 57676, {1, 1, 1, 5, 29, 17, 89, 163, 125, 473, 1577, 2435, 3379, 3057, 1829, 64325, 111719}}, {12505, 17, 57682, {1, 3, 1, 11, 1, 29, 97, 53, 421, 941, 1737, 3337, 2715, 1633, 28485, 30369, 116047}}, {12506, 17, 57687, {1, 1, 5, 13, 25, 43, 39, 85, 385, 129, 819, 1647, 3527, 12319, 573, 58703, 29463}}, {12507, 17, 57691, {1, 3, 3, 9, 23, 59, 31, 215, 49, 451, 645, 3687, 4507, 9359, 28161, 34609, 123409}}, {12508, 17, 57700, {1, 3, 1, 9, 13, 25, 97, 239, 203, 31, 1465, 1089, 7665, 3007, 22465, 28389, 119869}}, {12509, 17, 57704, {1, 3, 3, 1, 29, 51, 19, 83, 443, 193, 647, 3125, 7269, 3031, 9967, 40447, 102179}}, {12510, 17, 57707, {1, 3, 5, 15, 5, 63, 125, 55, 295, 787, 559, 3309, 7491, 9907, 5775, 15155, 41793}}, {12511, 17, 57721, {1, 3, 7, 7, 21, 61, 125, 207, 43, 159, 539, 435, 1945, 725, 797, 47489, 43099}}, {12512, 17, 57731, {1, 1, 5, 7, 11, 11, 61, 103, 23, 693, 493, 1045, 4435, 9009, 22075, 24839, 125431}}, {12513, 17, 57733, {1, 3, 1, 9, 13, 61, 83, 181, 373, 949, 1397, 247, 5079, 10933, 31887, 14147, 55121}}, {12514, 17, 57738, {1, 1, 7, 15, 31, 47, 87, 219, 357, 409, 943, 2993, 7615, 7071, 14179, 41489, 104401}}, {12515, 17, 57745, {1, 3, 3, 1, 11, 15, 87, 241, 389, 761, 1523, 3049, 2111, 11581, 5493, 11301, 32017}}, {12516, 17, 57748, {1, 1, 7, 11, 29, 39, 37, 63, 411, 671, 1789, 3541, 5651, 11721, 10871, 53867, 112895}}, {12517, 17, 57751, {1, 3, 3, 1, 23, 21, 99, 161, 467, 197, 1263, 451, 5469, 7667, 22139, 31599, 8345}}, {12518, 17, 57757, {1, 3, 1, 3, 11, 41, 13, 79, 3, 377, 1865, 2297, 1383, 14033, 17141, 24787, 127911}}, {12519, 17, 57761, {1, 1, 1, 1, 5, 11, 5, 181, 323, 853, 831, 1599, 3939, 6391, 22817, 37969, 9997}}, {12520, 17, 57774, {1, 1, 3, 11, 29, 61, 11, 171, 181, 631, 757, 3879, 4779, 16183, 5969, 7909, 42855}}, {12521, 17, 57779, {1, 3, 3, 15, 19, 17, 107, 187, 19, 743, 909, 1963, 2131, 2107, 659, 35829, 57905}}, {12522, 17, 57786, {1, 1, 7, 1, 31, 29, 67, 99, 353, 715, 65, 3907, 1931, 1289, 9217, 60635, 32737}}, {12523, 17, 57808, {1, 3, 3, 13, 3, 17, 19, 173, 263, 203, 1233, 1407, 933, 8905, 26905, 63343, 64963}}, {12524, 17, 57814, {1, 3, 1, 13, 21, 43, 97, 79, 163, 529, 1571, 1027, 4339, 16235, 9189, 29203, 36789}}, {12525, 17, 57817, {1, 1, 7, 1, 31, 1, 117, 247, 193, 333, 1797, 3515, 285, 2803, 25345, 9101, 110569}}, {12526, 17, 57824, {1, 1, 5, 11, 17, 63, 45, 167, 35, 925, 569, 3687, 6739, 12453, 26171, 28249, 73827}}, {12527, 17, 57827, {1, 1, 5, 1, 19, 49, 107, 183, 435, 305, 1191, 2711, 891, 15813, 13449, 23489, 89749}}, {12528, 17, 57848, {1, 1, 1, 11, 7, 53, 105, 17, 433, 351, 1151, 4077, 5371, 10183, 18895, 13229, 101219}}, {12529, 17, 57853, {1, 3, 7, 9, 21, 33, 27, 125, 177, 607, 817, 2689, 2123, 2037, 29643, 27219, 44591}}, {12530, 17, 57857, {1, 3, 5, 11, 27, 51, 29, 161, 469, 349, 1445, 3613, 1487, 961, 29017, 2235, 45905}}, {12531, 17, 57858, {1, 1, 3, 11, 7, 15, 37, 195, 329, 875, 559, 1361, 7373, 7143, 15059, 59205, 37167}}, {12532, 17, 57867, {1, 1, 5, 1, 7, 25, 27, 211, 301, 369, 227, 123, 4415, 15993, 4829, 43801, 83639}}, {12533, 17, 57872, {1, 1, 3, 5, 25, 37, 31, 205, 69, 275, 855, 1407, 2989, 11001, 16963, 31497, 3505}}, {12534, 17, 57887, {1, 1, 7, 7, 25, 33, 81, 181, 197, 717, 207, 535, 8083, 5765, 2523, 40347, 27245}}, {12535, 17, 57894, {1, 3, 1, 5, 13, 3, 107, 143, 233, 419, 1831, 2149, 7277, 13449, 31609, 48345, 82621}}, {12536, 17, 57915, {1, 3, 5, 9, 31, 35, 39, 113, 415, 803, 1479, 3169, 8015, 4659, 2445, 9159, 91625}}, {12537, 17, 57920, {1, 3, 1, 5, 27, 25, 83, 165, 459, 955, 1535, 377, 5531, 2945, 18285, 18097, 21589}}, {12538, 17, 57923, {1, 1, 1, 15, 13, 23, 11, 159, 471, 951, 1971, 677, 2641, 3227, 14761, 39421, 29841}}, {12539, 17, 57932, {1, 1, 7, 11, 19, 37, 101, 97, 373, 559, 105, 905, 897, 15309, 14979, 52029, 38989}}, {12540, 17, 57937, {1, 1, 5, 15, 31, 43, 71, 75, 481, 997, 5, 1005, 4987, 7907, 16237, 43075, 94827}}, {12541, 17, 57943, {1, 3, 5, 11, 23, 55, 123, 91, 183, 307, 97, 1999, 3341, 4717, 19643, 9455, 26555}}, {12542, 17, 57950, {1, 1, 7, 3, 29, 61, 75, 197, 125, 579, 145, 1333, 85, 15655, 28177, 6169, 43289}}, {12543, 17, 57960, {1, 3, 7, 13, 21, 15, 1, 221, 293, 991, 35, 2701, 2909, 7333, 27319, 32281, 77861}}, {12544, 17, 57971, {1, 1, 3, 1, 17, 11, 81, 209, 499, 125, 105, 2987, 3891, 9531, 27963, 39611, 43633}}, {12545, 17, 57974, {1, 3, 3, 3, 29, 45, 51, 63, 209, 75, 1321, 4055, 7851, 12329, 8371, 59513, 49105}}, {12546, 17, 57983, {1, 1, 7, 5, 9, 63, 59, 127, 445, 899, 1857, 3737, 625, 15021, 25177, 21007, 25935}}, {12547, 17, 57987, {1, 1, 5, 9, 9, 57, 25, 63, 235, 191, 1527, 1783, 1401, 1813, 2553, 1241, 100029}}, {12548, 17, 57994, {1, 3, 1, 11, 27, 5, 49, 39, 505, 653, 1083, 921, 1045, 11337, 25499, 36211, 75851}}, {12549, 17, 58001, {1, 3, 3, 1, 29, 19, 71, 93, 223, 153, 561, 1657, 5821, 14181, 1275, 24633, 114787}}, {12550, 17, 58002, {1, 1, 1, 9, 7, 13, 17, 239, 457, 731, 1811, 3015, 4465, 5865, 2387, 30455, 17405}}, {12551, 17, 58013, {1, 3, 5, 1, 7, 45, 117, 207, 7, 645, 131, 863, 6443, 14455, 11885, 39257, 126431}}, {12552, 17, 58023, {1, 1, 3, 5, 17, 23, 3, 27, 475, 731, 431, 1967, 981, 12727, 1301, 17647, 62481}}, {12553, 17, 58027, {1, 1, 1, 13, 11, 53, 105, 109, 105, 461, 1787, 2851, 1299, 9925, 13055, 58301, 24483}}, {12554, 17, 58029, {1, 1, 1, 11, 7, 35, 11, 173, 247, 289, 1269, 361, 2059, 5051, 25731, 58085, 21387}}, {12555, 17, 58032, {1, 3, 1, 5, 9, 31, 59, 151, 435, 519, 1863, 2255, 2585, 10033, 29189, 27189, 25023}}, {12556, 17, 58041, {1, 1, 5, 5, 25, 17, 53, 189, 187, 847, 369, 3287, 6047, 2385, 26045, 48821, 23335}}, {12557, 17, 58047, {1, 1, 1, 9, 15, 55, 79, 21, 433, 131, 1677, 3681, 6173, 9189, 15053, 12971, 81135}}, {12558, 17, 58062, {1, 1, 3, 5, 29, 5, 11, 213, 151, 77, 1493, 3959, 7675, 7689, 10381, 15871, 123463}}, {12559, 17, 58086, {1, 3, 7, 11, 19, 47, 31, 81, 207, 789, 1945, 2671, 1987, 6363, 26401, 9799, 59531}}, {12560, 17, 58092, {1, 1, 1, 7, 17, 7, 83, 181, 339, 423, 267, 2251, 1847, 14883, 13423, 27223, 81799}}, {12561, 17, 58095, {1, 3, 5, 15, 9, 9, 73, 95, 197, 267, 743, 2369, 6417, 3555, 9885, 6373, 87651}}, {12562, 17, 58097, {1, 1, 3, 13, 21, 29, 57, 59, 395, 631, 993, 17, 2939, 14117, 27521, 61387, 74927}}, {12563, 17, 58100, {1, 1, 3, 13, 1, 29, 23, 151, 381, 591, 1217, 2295, 4403, 15865, 4325, 31329, 56989}}, {12564, 17, 58117, {1, 3, 5, 1, 27, 7, 111, 79, 287, 945, 1237, 2857, 1461, 2477, 10929, 17117, 98677}}, {12565, 17, 58121, {1, 1, 1, 5, 15, 35, 109, 39, 391, 57, 1783, 3133, 5563, 7721, 12651, 3437, 46697}}, {12566, 17, 58132, {1, 3, 5, 5, 13, 47, 123, 51, 383, 91, 641, 1607, 4461, 7, 6427, 42755, 130097}}, {12567, 17, 58142, {1, 1, 5, 5, 25, 49, 33, 59, 351, 1003, 301, 2721, 7705, 5447, 21367, 63007, 112465}}, {12568, 17, 58145, {1, 1, 5, 13, 31, 11, 73, 1, 359, 201, 1465, 187, 7385, 12817, 12911, 17775, 77937}}, {12569, 17, 58152, {1, 3, 1, 15, 29, 5, 117, 69, 79, 93, 947, 133, 1049, 13907, 3611, 42123, 8041}}, {12570, 17, 58155, {1, 1, 7, 7, 29, 17, 71, 171, 357, 619, 1199, 3817, 6889, 9607, 19075, 15539, 54939}}, {12571, 17, 58163, {1, 1, 1, 7, 23, 29, 91, 227, 119, 865, 943, 381, 5289, 189, 15917, 13875, 31095}}, {12572, 17, 58166, {1, 1, 7, 1, 9, 49, 93, 175, 105, 61, 1285, 3659, 2383, 505, 12337, 43801, 67035}}, {12573, 17, 58170, {1, 3, 5, 1, 31, 47, 75, 17, 455, 231, 1887, 2295, 2533, 733, 29001, 22001, 119423}}, {12574, 17, 58175, {1, 3, 7, 3, 5, 5, 69, 205, 459, 805, 1257, 3283, 3305, 6845, 1405, 56051, 63453}}, {12575, 17, 58184, {1, 3, 3, 3, 19, 57, 65, 149, 175, 683, 1719, 637, 4951, 13645, 30455, 22379, 105369}}, {12576, 17, 58197, {1, 3, 1, 11, 31, 27, 69, 13, 191, 645, 1563, 3897, 2387, 2269, 12999, 42217, 100853}}, {12577, 17, 58202, {1, 3, 1, 13, 31, 7, 11, 227, 267, 373, 1249, 2591, 4769, 303, 5865, 59911, 4991}}, {12578, 17, 58204, {1, 3, 7, 11, 7, 31, 87, 205, 45, 785, 1947, 1965, 5851, 7501, 89, 38897, 91939}}, {12579, 17, 58208, {1, 3, 5, 9, 21, 37, 79, 181, 163, 355, 1129, 3439, 5103, 15903, 2935, 22505, 97451}}, {12580, 17, 58213, {1, 1, 3, 9, 7, 37, 107, 255, 69, 133, 551, 1357, 31, 7059, 29195, 30151, 81785}}, {12581, 17, 58220, {1, 3, 3, 5, 3, 51, 3, 143, 305, 697, 1041, 1267, 7635, 1483, 649, 28275, 65059}}, {12582, 17, 58226, {1, 3, 1, 7, 11, 13, 113, 81, 159, 993, 797, 3207, 3787, 13005, 29393, 51107, 42709}}, {12583, 17, 58231, {1, 1, 3, 13, 7, 11, 113, 195, 349, 377, 2033, 197, 147, 13839, 5405, 29577, 64535}}, {12584, 17, 58235, {1, 3, 1, 9, 1, 1, 77, 73, 383, 463, 1871, 1589, 1805, 2085, 5195, 17805, 33159}}, {12585, 17, 58254, {1, 1, 1, 9, 25, 37, 123, 119, 507, 515, 1547, 139, 7501, 4725, 30195, 18199, 41145}}, {12586, 17, 58261, {1, 3, 3, 7, 17, 33, 99, 11, 487, 343, 403, 337, 3831, 6031, 20375, 2071, 39795}}, {12587, 17, 58271, {1, 1, 5, 1, 13, 57, 59, 11, 391, 953, 597, 1411, 3929, 13963, 15003, 59385, 12293}}, {12588, 17, 58278, {1, 3, 1, 15, 23, 61, 67, 129, 63, 555, 433, 631, 2725, 317, 10121, 9217, 124371}}, {12589, 17, 58287, {1, 1, 5, 7, 19, 23, 17, 45, 75, 819, 1879, 2315, 1439, 2643, 26561, 19209, 16081}}, {12590, 17, 58327, {1, 3, 5, 7, 5, 35, 121, 233, 91, 89, 1741, 3015, 4223, 9605, 22795, 55845, 47167}}, {12591, 17, 58333, {1, 3, 7, 7, 13, 23, 11, 51, 91, 367, 773, 1303, 2151, 14423, 22263, 28413, 107461}}, {12592, 17, 58337, {1, 1, 1, 11, 29, 17, 49, 53, 379, 819, 1551, 2907, 5805, 2167, 16123, 9263, 43903}}, {12593, 17, 58357, {1, 3, 1, 13, 19, 27, 33, 127, 131, 697, 489, 3289, 1895, 3243, 19497, 32419, 55741}}, {12594, 17, 58362, {1, 3, 1, 15, 7, 51, 91, 45, 251, 829, 2015, 2659, 151, 3327, 25281, 49291, 106343}}, {12595, 17, 58364, {1, 1, 5, 5, 27, 11, 85, 45, 203, 413, 293, 3067, 4109, 959, 22337, 38767, 75829}}, {12596, 17, 58375, {1, 1, 3, 5, 21, 35, 65, 173, 315, 423, 171, 3837, 817, 10153, 5517, 18115, 117437}}, {12597, 17, 58384, {1, 1, 1, 7, 9, 29, 101, 55, 253, 37, 1717, 7, 3181, 1067, 20637, 54773, 106777}}, {12598, 17, 58387, {1, 3, 7, 11, 13, 11, 87, 83, 83, 969, 589, 3625, 3373, 3921, 24487, 34235, 96289}}, {12599, 17, 58405, {1, 3, 1, 11, 25, 35, 65, 131, 491, 167, 449, 2949, 5807, 5649, 7569, 37363, 106819}}, {12600, 17, 58406, {1, 1, 5, 1, 9, 37, 33, 237, 79, 163, 1791, 3499, 4951, 2009, 16183, 10121, 40221}}, {12601, 17, 58417, {1, 1, 5, 15, 21, 49, 123, 53, 27, 273, 1655, 3713, 5699, 1659, 31985, 6779, 10195}}, {12602, 17, 58424, {1, 3, 5, 11, 27, 37, 93, 17, 263, 41, 1583, 703, 7689, 6667, 15497, 15255, 67153}}, {12603, 17, 58435, {1, 1, 5, 9, 19, 13, 121, 39, 321, 177, 711, 3223, 3859, 14775, 19061, 40587, 97199}}, {12604, 17, 58450, {1, 3, 7, 9, 23, 11, 93, 243, 3, 811, 679, 1103, 7579, 14147, 20255, 22485, 117179}}, {12605, 17, 58452, {1, 3, 3, 5, 23, 9, 21, 243, 27, 501, 1273, 1501, 5331, 15663, 19483, 10637, 90905}}, {12606, 17, 58459, {1, 3, 1, 15, 13, 11, 89, 37, 63, 463, 731, 3615, 3923, 4677, 21329, 1069, 57565}}, {12607, 17, 58461, {1, 1, 1, 13, 19, 39, 63, 59, 389, 367, 1285, 2005, 8103, 4179, 3805, 55475, 126589}}, {12608, 17, 58466, {1, 3, 5, 11, 27, 57, 27, 63, 365, 171, 665, 2035, 2831, 15955, 11551, 26741, 121059}}, {12609, 17, 58468, {1, 3, 3, 3, 23, 19, 13, 7, 331, 613, 1783, 733, 7465, 1089, 4683, 15695, 31125}}, {12610, 17, 58485, {1, 1, 5, 3, 3, 23, 95, 157, 303, 987, 307, 2679, 6173, 6633, 17727, 30901, 76109}}, {12611, 17, 58489, {1, 1, 1, 1, 11, 21, 111, 81, 31, 727, 1133, 4083, 5811, 2707, 31749, 42939, 92225}}, {12612, 17, 58492, {1, 3, 1, 11, 29, 21, 31, 115, 351, 213, 201, 3511, 3707, 12821, 8845, 59789, 59721}}, {12613, 17, 58495, {1, 3, 5, 9, 7, 27, 65, 1, 305, 937, 1201, 2045, 2431, 12275, 24431, 3317, 119671}}, {12614, 17, 58505, {1, 1, 7, 11, 19, 43, 107, 107, 261, 933, 1125, 1875, 1943, 7477, 20759, 57853, 29459}}, {12615, 17, 58523, {1, 1, 3, 3, 17, 43, 79, 19, 167, 341, 237, 677, 725, 2353, 12003, 48921, 20707}}, {12616, 17, 58535, {1, 3, 3, 5, 31, 39, 91, 81, 121, 59, 737, 1767, 4407, 9159, 10237, 25361, 38891}}, {12617, 17, 58536, {1, 1, 5, 7, 31, 47, 37, 47, 171, 623, 597, 2807, 4875, 15139, 18809, 24279, 36563}}, {12618, 17, 58549, {1, 3, 5, 3, 3, 7, 31, 135, 81, 777, 1055, 337, 4309, 9575, 11075, 54429, 30097}}, {12619, 17, 58550, {1, 1, 5, 1, 3, 57, 53, 25, 117, 961, 947, 257, 2645, 6935, 27511, 54051, 129095}}, {12620, 17, 58561, {1, 1, 1, 15, 23, 45, 11, 173, 407, 373, 1051, 3519, 1875, 1291, 4393, 9047, 102159}}, {12621, 17, 58562, {1, 1, 3, 5, 9, 51, 23, 253, 261, 339, 505, 3601, 265, 8375, 7241, 40715, 114439}}, {12622, 17, 58573, {1, 1, 7, 7, 3, 63, 5, 233, 259, 947, 1367, 2699, 6029, 9371, 6567, 39961, 31621}}, {12623, 17, 58576, {1, 1, 3, 3, 25, 43, 73, 61, 305, 257, 235, 421, 6621, 1025, 18831, 44525, 87665}}, {12624, 17, 58592, {1, 3, 5, 7, 19, 33, 77, 163, 191, 115, 1275, 3551, 3521, 6767, 30209, 48895, 114185}}, {12625, 17, 58601, {1, 1, 3, 3, 29, 37, 3, 165, 267, 807, 967, 2893, 3287, 12249, 21411, 19291, 91781}}, {12626, 17, 58622, {1, 1, 5, 5, 27, 55, 51, 137, 429, 775, 1525, 3911, 5367, 5981, 24373, 16331, 31887}}, {12627, 17, 58627, {1, 1, 5, 11, 17, 49, 37, 243, 509, 563, 1381, 2013, 7341, 10509, 10049, 29135, 32709}}, {12628, 17, 58629, {1, 1, 3, 13, 1, 33, 119, 5, 477, 701, 1329, 1023, 2091, 12895, 6443, 1053, 44741}}, {12629, 17, 58634, {1, 3, 5, 7, 13, 19, 1, 113, 3, 481, 1555, 2857, 3519, 7903, 16153, 62909, 78877}}, {12630, 17, 58639, {1, 1, 7, 11, 7, 27, 47, 175, 87, 605, 411, 4065, 8059, 5023, 27719, 3111, 62247}}, {12631, 17, 58641, {1, 3, 1, 15, 27, 37, 71, 77, 297, 647, 1651, 2543, 3925, 4827, 28587, 49663, 56581}}, {12632, 17, 58644, {1, 3, 5, 1, 19, 49, 63, 9, 43, 243, 931, 3577, 2371, 10513, 13691, 27739, 61011}}, {12633, 17, 58654, {1, 1, 3, 1, 23, 27, 53, 149, 157, 735, 1087, 1529, 6613, 2493, 4879, 26771, 123711}}, {12634, 17, 58663, {1, 3, 7, 13, 5, 3, 43, 3, 343, 497, 943, 3443, 4335, 4779, 4033, 25871, 10965}}, {12635, 17, 58667, {1, 3, 5, 1, 5, 11, 93, 73, 199, 455, 421, 3495, 4381, 717, 21033, 41287, 44743}}, {12636, 17, 58677, {1, 1, 3, 9, 13, 33, 77, 143, 81, 57, 1061, 3205, 2411, 1347, 23149, 21913, 119331}}, {12637, 17, 58682, {1, 3, 1, 7, 1, 15, 45, 247, 119, 905, 457, 3939, 4865, 11191, 27705, 46315, 68367}}, {12638, 17, 58690, {1, 3, 3, 15, 31, 5, 55, 169, 381, 1009, 1893, 2751, 411, 8653, 30367, 54919, 23541}}, {12639, 17, 58692, {1, 3, 7, 1, 29, 27, 77, 239, 109, 125, 355, 2759, 2229, 3435, 16241, 53309, 613}}, {12640, 17, 58695, {1, 3, 1, 3, 11, 27, 33, 167, 311, 1003, 1635, 2479, 1831, 6225, 17711, 30185, 87043}}, {12641, 17, 58710, {1, 3, 7, 13, 7, 61, 3, 243, 55, 259, 461, 3357, 121, 9107, 19393, 3719, 71403}}, {12642, 17, 58713, {1, 1, 7, 15, 23, 25, 55, 89, 241, 297, 113, 59, 4799, 381, 29127, 811, 91149}}, {12643, 17, 58723, {1, 1, 3, 3, 13, 35, 43, 163, 69, 69, 1949, 2383, 887, 2349, 12539, 167, 23697}}, {12644, 17, 58740, {1, 3, 3, 11, 3, 45, 23, 149, 55, 963, 1293, 2715, 1401, 16081, 12821, 2129, 26835}}, {12645, 17, 58749, {1, 3, 3, 13, 29, 47, 21, 249, 141, 179, 627, 329, 6377, 12049, 11715, 1447, 119359}}, {12646, 17, 58760, {1, 1, 5, 13, 7, 59, 103, 189, 401, 169, 455, 1197, 1881, 12679, 4533, 25561, 79281}}, {12647, 17, 58766, {1, 1, 7, 15, 21, 59, 97, 77, 397, 487, 647, 2277, 269, 713, 17741, 37387, 100143}}, {12648, 17, 58773, {1, 3, 5, 1, 1, 43, 31, 201, 21, 805, 1533, 1407, 4719, 2673, 22757, 7605, 72485}}, {12649, 17, 58780, {1, 1, 3, 11, 27, 25, 99, 135, 225, 367, 1311, 683, 7193, 8209, 17081, 55709, 3029}}, {12650, 17, 58787, {1, 3, 5, 5, 17, 9, 59, 27, 153, 353, 647, 2919, 1877, 5359, 19787, 46237, 7}}, {12651, 17, 58796, {1, 3, 3, 15, 11, 39, 75, 223, 489, 57, 1355, 3941, 6603, 12883, 20909, 24065, 53543}}, {12652, 17, 58816, {1, 1, 3, 9, 17, 47, 61, 49, 397, 23, 2019, 37, 23, 8967, 10357, 54419, 27279}}, {12653, 17, 58822, {1, 1, 1, 7, 31, 43, 87, 111, 293, 969, 1431, 2275, 3131, 2915, 24595, 63049, 71517}}, {12654, 17, 58831, {1, 1, 3, 11, 11, 63, 89, 33, 95, 299, 593, 3353, 7389, 841, 1895, 64835, 19915}}, {12655, 17, 58839, {1, 1, 1, 3, 13, 63, 51, 3, 327, 401, 1289, 2699, 5599, 5101, 3189, 23415, 53429}}, {12656, 17, 58849, {1, 1, 7, 13, 27, 15, 57, 201, 365, 643, 171, 2417, 1763, 7567, 5323, 50911, 24281}}, {12657, 17, 58859, {1, 3, 3, 13, 31, 37, 31, 243, 225, 431, 379, 1565, 1567, 11477, 4641, 58823, 88565}}, {12658, 17, 58870, {1, 3, 3, 7, 13, 39, 79, 169, 401, 177, 2023, 1703, 5563, 15619, 21445, 59287, 30141}}, {12659, 17, 58879, {1, 3, 3, 15, 17, 47, 13, 163, 361, 353, 1435, 2083, 4109, 14105, 28585, 1721, 119133}}, {12660, 17, 58889, {1, 3, 3, 3, 29, 41, 97, 131, 501, 415, 1735, 2315, 6499, 11417, 3879, 3957, 47117}}, {12661, 17, 58904, {1, 1, 3, 13, 5, 25, 29, 65, 235, 949, 1571, 927, 515, 7519, 23123, 4127, 71019}}, {12662, 17, 58914, {1, 1, 5, 13, 1, 41, 5, 137, 487, 711, 561, 2495, 5367, 6955, 9453, 54499, 118373}}, {12663, 17, 58923, {1, 3, 3, 5, 27, 15, 23, 237, 95, 873, 1949, 1579, 7089, 8837, 30463, 9903, 61919}}, {12664, 17, 58940, {1, 3, 1, 13, 5, 5, 15, 5, 429, 617, 383, 2495, 409, 15541, 11209, 20625, 58493}}, {12665, 17, 58945, {1, 1, 7, 11, 25, 21, 113, 219, 459, 777, 289, 2435, 6665, 83, 22997, 6561, 82923}}, {12666, 17, 58952, {1, 1, 1, 7, 19, 53, 37, 249, 273, 639, 2007, 1463, 7819, 9013, 19539, 41235, 58059}}, {12667, 17, 58960, {1, 1, 3, 11, 13, 51, 97, 55, 237, 159, 1305, 3705, 2527, 13065, 13873, 10275, 3769}}, {12668, 17, 58965, {1, 1, 5, 7, 13, 49, 41, 13, 301, 461, 1169, 3805, 7163, 4133, 17255, 48283, 87059}}, {12669, 17, 58986, {1, 3, 7, 15, 9, 19, 45, 195, 445, 145, 543, 2839, 315, 10991, 3317, 46501, 29209}}, {12670, 17, 59000, {1, 1, 3, 5, 23, 51, 53, 119, 217, 747, 1307, 3039, 5523, 5891, 21035, 56471, 80305}}, {12671, 17, 59006, {1, 3, 1, 3, 23, 17, 97, 71, 7, 839, 229, 3407, 3025, 1989, 16599, 38755, 11139}}, {12672, 17, 59027, {1, 1, 7, 7, 7, 19, 67, 43, 293, 191, 1549, 1621, 7083, 11633, 1899, 4515, 89753}}, {12673, 17, 59034, {1, 3, 7, 11, 1, 23, 17, 63, 265, 709, 453, 1309, 6861, 7257, 17705, 28565, 15231}}, {12674, 17, 59052, {1, 3, 5, 13, 1, 53, 99, 79, 241, 771, 497, 987, 2353, 6931, 227, 57781, 109583}}, {12675, 17, 59058, {1, 3, 3, 5, 31, 47, 17, 97, 93, 119, 2045, 3597, 7983, 4993, 30659, 3419, 32803}}, {12676, 17, 59081, {1, 3, 7, 1, 11, 41, 3, 7, 155, 627, 979, 2405, 7467, 6763, 28523, 56493, 1291}}, {12677, 17, 59082, {1, 1, 1, 7, 3, 43, 13, 187, 415, 1001, 667, 1371, 8075, 12855, 27215, 9399, 70657}}, {12678, 17, 59089, {1, 3, 1, 9, 29, 53, 117, 17, 443, 381, 507, 643, 5891, 10725, 20251, 497, 101313}}, {12679, 17, 59096, {1, 3, 3, 1, 31, 47, 59, 75, 173, 347, 1, 117, 3639, 10231, 863, 56795, 56107}}, {12680, 17, 59118, {1, 3, 1, 15, 11, 41, 97, 251, 177, 275, 1849, 1281, 3659, 9709, 16239, 7445, 47661}}, {12681, 17, 59123, {1, 3, 3, 5, 13, 1, 27, 251, 89, 863, 685, 3915, 2201, 4313, 32083, 37171, 120885}}, {12682, 17, 59126, {1, 3, 3, 3, 3, 11, 77, 135, 147, 475, 505, 611, 4763, 9445, 28639, 51343, 119093}}, {12683, 17, 59132, {1, 3, 7, 1, 11, 9, 67, 73, 375, 977, 1011, 1621, 6623, 8077, 26321, 7461, 130637}}, {12684, 17, 59135, {1, 3, 5, 15, 15, 59, 63, 217, 117, 375, 1151, 3451, 5843, 13221, 20673, 10817, 57711}}, {12685, 17, 59150, {1, 1, 3, 5, 19, 5, 9, 101, 321, 815, 451, 719, 523, 1299, 27823, 48041, 45939}}, {12686, 17, 59174, {1, 1, 1, 9, 5, 49, 59, 59, 409, 5, 1075, 21, 7837, 4543, 3085, 55473, 89309}}, {12687, 17, 59177, {1, 3, 3, 13, 9, 31, 93, 181, 153, 795, 713, 933, 6001, 9075, 29781, 14029, 46361}}, {12688, 17, 59185, {1, 3, 5, 3, 9, 21, 79, 129, 361, 627, 743, 3041, 5381, 3627, 12581, 35183, 83183}}, {12689, 17, 59195, {1, 3, 3, 3, 29, 29, 93, 187, 341, 727, 181, 133, 6525, 5673, 2739, 23349, 62505}}, {12690, 17, 59203, {1, 3, 5, 13, 27, 59, 127, 149, 321, 613, 1543, 1537, 2909, 5139, 3755, 49285, 35183}}, {12691, 17, 59206, {1, 3, 3, 9, 5, 31, 19, 173, 137, 19, 799, 1847, 3897, 15775, 22411, 55405, 95713}}, {12692, 17, 59234, {1, 3, 5, 5, 31, 1, 87, 97, 481, 797, 459, 793, 4339, 5443, 31717, 6691, 68841}}, {12693, 17, 59248, {1, 3, 3, 5, 3, 9, 123, 21, 393, 683, 1007, 971, 729, 7113, 2811, 51183, 37093}}, {12694, 17, 59258, {1, 3, 5, 5, 27, 31, 19, 227, 123, 937, 763, 2117, 3825, 9151, 95, 54963, 62919}}, {12695, 17, 59260, {1, 3, 1, 3, 23, 21, 21, 7, 7, 165, 99, 3073, 91, 8725, 17613, 47119, 41441}}, {12696, 17, 59270, {1, 3, 7, 9, 29, 49, 117, 49, 205, 605, 1567, 3323, 1559, 10949, 14349, 34951, 99901}}, {12697, 17, 59284, {1, 1, 1, 1, 15, 41, 31, 133, 439, 305, 719, 147, 6849, 5947, 31749, 45171, 15265}}, {12698, 17, 59291, {1, 1, 5, 11, 19, 37, 13, 253, 385, 625, 1801, 1191, 547, 12025, 17971, 54127, 97323}}, {12699, 17, 59293, {1, 3, 5, 5, 27, 9, 57, 245, 59, 211, 1195, 763, 6743, 6309, 25759, 26633, 27497}}, {12700, 17, 59297, {1, 3, 5, 5, 9, 51, 49, 29, 213, 855, 305, 3961, 3187, 6815, 19015, 2539, 81705}}, {12701, 17, 59312, {1, 1, 5, 7, 11, 61, 123, 163, 127, 871, 463, 2279, 5931, 2913, 23215, 40215, 91373}}, {12702, 17, 59315, {1, 1, 7, 1, 29, 57, 55, 189, 285, 603, 747, 3753, 3359, 10277, 25319, 17569, 80125}}, {12703, 17, 59327, {1, 3, 1, 9, 7, 53, 9, 55, 117, 495, 2045, 2487, 1625, 775, 17773, 62159, 79537}}, {12704, 17, 59332, {1, 1, 5, 1, 1, 11, 67, 79, 57, 677, 2045, 3913, 853, 3581, 10509, 35097, 24585}}, {12705, 17, 59347, {1, 3, 7, 7, 19, 15, 13, 237, 297, 807, 657, 2229, 2931, 10283, 49, 56485, 113889}}, {12706, 17, 59354, {1, 3, 5, 13, 11, 23, 37, 229, 253, 411, 39, 1069, 3683, 12141, 11087, 64875, 62991}}, {12707, 17, 59363, {1, 1, 1, 1, 13, 11, 21, 227, 305, 1021, 1039, 3095, 4621, 5723, 31989, 30681, 58487}}, {12708, 17, 59369, {1, 3, 3, 5, 17, 47, 127, 65, 85, 961, 277, 549, 2111, 4183, 771, 11921, 111489}}, {12709, 17, 59377, {1, 3, 3, 5, 31, 39, 89, 51, 277, 705, 375, 1603, 2793, 7425, 25065, 44945, 48391}}, {12710, 17, 59406, {1, 1, 5, 7, 9, 45, 21, 217, 183, 65, 625, 1239, 4241, 8043, 13615, 5611, 82501}}, {12711, 17, 59413, {1, 1, 7, 13, 15, 51, 29, 35, 73, 601, 233, 3117, 3031, 4229, 4299, 62761, 45291}}, {12712, 17, 59423, {1, 3, 5, 5, 27, 55, 7, 1, 333, 501, 913, 1939, 5131, 5597, 1271, 30195, 20947}}, {12713, 17, 59434, {1, 3, 5, 15, 19, 27, 43, 111, 435, 615, 811, 2113, 2503, 7553, 1619, 24773, 40881}}, {12714, 17, 59441, {1, 3, 5, 11, 11, 31, 21, 147, 151, 141, 527, 1839, 339, 1225, 29621, 19691, 22031}}, {12715, 17, 59442, {1, 1, 3, 13, 23, 35, 61, 181, 221, 837, 241, 3033, 1849, 12563, 11387, 3027, 33419}}, {12716, 17, 59456, {1, 3, 3, 7, 1, 39, 125, 249, 231, 575, 1847, 197, 3969, 12945, 10257, 27227, 94097}}, {12717, 17, 59465, {1, 3, 1, 11, 19, 7, 85, 119, 37, 253, 1575, 447, 6947, 14399, 32095, 15385, 62917}}, {12718, 17, 59479, {1, 3, 7, 11, 23, 53, 113, 193, 253, 651, 1717, 447, 4055, 13675, 18479, 28375, 66475}}, {12719, 17, 59501, {1, 1, 7, 3, 17, 27, 13, 209, 67, 271, 121, 1565, 2589, 8033, 3939, 14181, 111787}}, {12720, 17, 59504, {1, 1, 3, 3, 5, 57, 75, 87, 165, 947, 967, 3353, 2055, 16195, 3701, 62637, 58343}}, {12721, 17, 59507, {1, 1, 7, 13, 31, 41, 125, 111, 253, 257, 57, 679, 3333, 8259, 26331, 15883, 95023}}, {12722, 17, 59514, {1, 3, 7, 11, 1, 47, 5, 249, 353, 271, 1121, 1935, 4971, 8447, 9983, 55959, 66179}}, {12723, 17, 59523, {1, 3, 5, 11, 1, 61, 101, 43, 97, 241, 687, 4027, 4319, 4905, 12357, 51099, 97093}}, {12724, 17, 59525, {1, 1, 3, 15, 25, 25, 117, 139, 475, 961, 1585, 2795, 2411, 11049, 18209, 15511, 43193}}, {12725, 17, 59526, {1, 3, 3, 9, 9, 11, 107, 15, 189, 27, 289, 3111, 851, 3401, 31981, 7181, 47533}}, {12726, 17, 59537, {1, 1, 5, 15, 31, 57, 37, 77, 205, 707, 1505, 1343, 629, 13335, 6719, 35405, 38905}}, {12727, 17, 59543, {1, 3, 7, 7, 21, 63, 35, 125, 507, 285, 621, 2257, 3009, 13703, 9761, 54927, 16925}}, {12728, 17, 59560, {1, 1, 1, 11, 11, 53, 37, 17, 167, 663, 1349, 1395, 7721, 9329, 2161, 37093, 52425}}, {12729, 17, 59563, {1, 1, 7, 9, 1, 15, 113, 53, 87, 133, 131, 847, 609, 14737, 1639, 15511, 46987}}, {12730, 17, 59566, {1, 1, 7, 7, 25, 21, 125, 149, 201, 791, 1323, 2817, 1141, 289, 14349, 64461, 76575}}, {12731, 17, 59577, {1, 3, 3, 7, 15, 1, 123, 227, 83, 967, 2039, 3205, 715, 10787, 11235, 50375, 66911}}, {12732, 17, 59580, {1, 3, 3, 11, 9, 45, 41, 57, 327, 903, 1705, 3947, 3173, 1035, 25529, 15217, 80795}}, {12733, 17, 59586, {1, 3, 1, 13, 15, 63, 69, 57, 479, 277, 1641, 3465, 2629, 9901, 5781, 55101, 33049}}, {12734, 17, 59597, {1, 1, 3, 3, 31, 25, 57, 189, 491, 335, 373, 3069, 1623, 10781, 6559, 27057, 111491}}, {12735, 17, 59612, {1, 3, 3, 15, 19, 57, 67, 225, 343, 93, 315, 1011, 4437, 10371, 27927, 51269, 65653}}, {12736, 17, 59615, {1, 3, 5, 5, 21, 43, 105, 153, 65, 167, 369, 3167, 785, 7509, 3753, 9035, 29039}}, {12737, 17, 59622, {1, 1, 7, 3, 17, 9, 113, 21, 175, 967, 13, 2701, 5667, 9761, 20267, 33497, 88819}}, {12738, 17, 59631, {1, 1, 1, 7, 9, 61, 121, 205, 283, 259, 2027, 2361, 3995, 6787, 26867, 61681, 96149}}, {12739, 17, 59657, {1, 3, 3, 13, 31, 37, 125, 151, 317, 947, 423, 2907, 6905, 13247, 27997, 4755, 73173}}, {12740, 17, 59660, {1, 1, 7, 13, 1, 63, 85, 75, 33, 483, 85, 1583, 4783, 14003, 31147, 12643, 99447}}, {12741, 17, 59665, {1, 1, 1, 7, 31, 5, 93, 179, 213, 857, 3, 1015, 1481, 2413, 28759, 13941, 24851}}, {12742, 17, 59671, {1, 1, 5, 5, 5, 35, 73, 57, 469, 885, 1951, 3599, 5555, 7259, 22599, 7627, 109227}}, {12743, 17, 59675, {1, 1, 5, 13, 1, 1, 69, 107, 473, 793, 1851, 887, 2241, 7851, 21821, 25431, 118565}}, {12744, 17, 59688, {1, 1, 1, 3, 15, 51, 57, 175, 91, 113, 1671, 925, 2187, 1097, 28793, 45819, 41855}}, {12745, 17, 59706, {1, 1, 3, 3, 15, 51, 99, 177, 379, 713, 1273, 3245, 5515, 14657, 28981, 1197, 29283}}, {12746, 17, 59708, {1, 3, 3, 15, 13, 27, 29, 7, 17, 373, 779, 1589, 3077, 13673, 31029, 43765, 74339}}, {12747, 17, 59713, {1, 1, 3, 1, 25, 17, 15, 223, 219, 569, 155, 1307, 7143, 7975, 22581, 53223, 44271}}, {12748, 17, 59714, {1, 1, 1, 7, 11, 23, 67, 177, 189, 267, 1799, 2453, 2367, 4193, 1827, 10191, 12265}}, {12749, 17, 59720, {1, 3, 3, 11, 3, 29, 121, 231, 211, 191, 1803, 1171, 6801, 4007, 14111, 42951, 8311}}, {12750, 17, 59737, {1, 3, 3, 11, 9, 23, 11, 231, 349, 47, 1645, 345, 3681, 12227, 29955, 32131, 391}}, {12751, 17, 59743, {1, 1, 3, 11, 27, 17, 17, 49, 463, 173, 1993, 2339, 3763, 1931, 29969, 55579, 114805}}, {12752, 17, 59744, {1, 3, 5, 15, 5, 21, 105, 69, 173, 771, 815, 3807, 577, 12589, 32193, 37601, 23961}}, {12753, 17, 59749, {1, 1, 3, 9, 21, 63, 57, 213, 327, 765, 333, 2065, 719, 6159, 15769, 49335, 2289}}, {12754, 17, 59756, {1, 3, 3, 1, 27, 51, 13, 87, 465, 729, 507, 2811, 6721, 14279, 31733, 56165, 78169}}, {12755, 17, 59783, {1, 1, 1, 9, 25, 1, 47, 37, 407, 623, 1409, 3703, 4491, 3037, 8129, 13547, 50517}}, {12756, 17, 59784, {1, 3, 5, 13, 5, 51, 127, 225, 215, 377, 1013, 2387, 4237, 1317, 5245, 17535, 100707}}, {12757, 17, 59787, {1, 3, 5, 13, 31, 25, 123, 243, 317, 505, 483, 1743, 3097, 4139, 4525, 63143, 47665}}, {12758, 17, 59795, {1, 3, 3, 13, 27, 19, 21, 187, 211, 471, 1931, 2877, 3635, 9233, 12385, 15741, 50843}}, {12759, 17, 59804, {1, 1, 3, 13, 23, 33, 71, 45, 371, 621, 1057, 1605, 6329, 3763, 8613, 2965, 8141}}, {12760, 17, 59811, {1, 1, 5, 7, 7, 17, 33, 209, 293, 35, 1665, 3721, 6245, 14567, 15349, 16195, 59757}}, {12761, 17, 59814, {1, 1, 7, 7, 31, 19, 47, 83, 277, 323, 1225, 969, 2193, 10175, 27657, 50265, 9817}}, {12762, 17, 59823, {1, 1, 5, 7, 15, 21, 103, 95, 189, 737, 309, 357, 5953, 9701, 15757, 20753, 88647}}, {12763, 17, 59838, {1, 1, 5, 13, 5, 13, 61, 235, 333, 889, 1559, 1653, 1871, 10631, 18067, 47037, 9507}}, {12764, 17, 59840, {1, 3, 7, 1, 31, 61, 69, 159, 41, 107, 807, 1517, 3551, 3435, 6151, 50025, 126949}}, {12765, 17, 59846, {1, 1, 7, 15, 7, 41, 55, 103, 9, 105, 1397, 3955, 7723, 3389, 32435, 36005, 73733}}, {12766, 17, 59849, {1, 1, 1, 13, 15, 59, 43, 151, 321, 215, 411, 3103, 7455, 14041, 1673, 56425, 59085}}, {12767, 17, 59855, {1, 1, 1, 1, 5, 39, 81, 183, 509, 455, 753, 3743, 227, 7807, 23747, 42289, 122765}}, {12768, 17, 59860, {1, 1, 7, 3, 9, 29, 89, 131, 141, 851, 1221, 67, 3117, 1329, 13151, 36827, 34313}}, {12769, 17, 59867, {1, 3, 1, 5, 9, 29, 11, 189, 389, 79, 1903, 835, 6043, 8953, 18985, 8305, 51939}}, {12770, 17, 59869, {1, 3, 5, 3, 9, 49, 47, 43, 193, 917, 795, 2719, 5709, 9993, 30637, 26841, 93113}}, {12771, 17, 59885, {1, 3, 7, 5, 13, 15, 85, 169, 315, 963, 617, 1191, 6739, 11535, 3423, 6695, 2047}}, {12772, 17, 59888, {1, 3, 1, 3, 5, 49, 41, 255, 131, 255, 825, 1485, 7005, 10107, 3913, 4731, 33199}}, {12773, 17, 59893, {1, 3, 1, 9, 27, 63, 109, 29, 183, 381, 591, 617, 1187, 4381, 30543, 9933, 109785}}, {12774, 17, 59904, {1, 3, 7, 7, 13, 29, 125, 105, 353, 677, 623, 1553, 5435, 10853, 16663, 42277, 64333}}, {12775, 17, 59919, {1, 3, 3, 11, 3, 47, 49, 41, 249, 497, 963, 237, 625, 11303, 6871, 60441, 39559}}, {12776, 17, 59922, {1, 3, 3, 1, 1, 27, 107, 253, 59, 445, 1761, 2865, 7117, 2363, 4007, 46047, 10811}}, {12777, 17, 59927, {1, 3, 5, 5, 25, 13, 17, 107, 321, 691, 351, 577, 5001, 9437, 12451, 44997, 42727}}, {12778, 17, 59937, {1, 3, 1, 9, 1, 31, 87, 117, 111, 379, 1989, 1155, 4777, 8563, 14585, 33375, 66985}}, {12779, 17, 59940, {1, 3, 5, 5, 9, 51, 79, 135, 89, 929, 277, 763, 5569, 15545, 28393, 56921, 102093}}, {12780, 17, 59944, {1, 1, 3, 7, 7, 55, 15, 37, 3, 439, 577, 2051, 101, 13655, 11959, 38127, 6639}}, {12781, 17, 59947, {1, 1, 3, 9, 21, 11, 27, 221, 465, 565, 1313, 1405, 2421, 10543, 18369, 33751, 87785}}, {12782, 17, 59949, {1, 3, 5, 11, 21, 39, 105, 231, 469, 711, 997, 427, 5797, 3249, 15141, 29413, 66509}}, {12783, 17, 59961, {1, 3, 7, 5, 25, 31, 111, 37, 229, 773, 193, 553, 673, 4693, 24441, 8713, 121203}}, {12784, 17, 59975, {1, 3, 1, 9, 23, 27, 103, 7, 183, 549, 1433, 2831, 3383, 13229, 10005, 14135, 15967}}, {12785, 17, 59981, {1, 3, 3, 11, 11, 59, 11, 251, 373, 399, 255, 1177, 5493, 13559, 29037, 23405, 79495}}, {12786, 17, 59994, {1, 3, 1, 11, 25, 45, 69, 115, 153, 259, 527, 9, 5807, 6015, 3765, 61621, 8645}}, {12787, 17, 59999, {1, 3, 3, 9, 19, 5, 113, 191, 345, 655, 429, 3975, 4297, 5723, 5345, 64457, 79031}}, {12788, 17, 60018, {1, 3, 7, 7, 15, 59, 5, 87, 289, 1005, 931, 2403, 485, 16043, 15623, 39253, 61377}}, {12789, 17, 60023, {1, 3, 3, 9, 17, 53, 31, 9, 217, 711, 1007, 1375, 2733, 13735, 19825, 59741, 83827}}, {12790, 17, 60024, {1, 1, 3, 15, 11, 11, 41, 195, 79, 1013, 1353, 1961, 7365, 7533, 13315, 8441, 90705}}, {12791, 17, 60039, {1, 1, 5, 7, 23, 17, 93, 165, 371, 495, 865, 2753, 15, 10729, 16553, 6039, 96721}}, {12792, 17, 60043, {1, 3, 3, 3, 25, 25, 67, 119, 485, 63, 75, 2365, 4711, 16129, 5589, 50621, 1203}}, {12793, 17, 60048, {1, 1, 7, 1, 27, 57, 49, 79, 479, 79, 683, 753, 345, 2007, 18983, 42729, 56369}}, {12794, 17, 60054, {1, 1, 7, 7, 1, 23, 9, 155, 425, 735, 1625, 2271, 7875, 11219, 12147, 52351, 55845}}, {12795, 17, 60073, {1, 1, 1, 9, 13, 11, 67, 139, 259, 59, 1593, 1207, 237, 11683, 24719, 27689, 115617}}, {12796, 17, 60079, {1, 1, 5, 7, 7, 15, 9, 171, 35, 131, 133, 3939, 1401, 6347, 4051, 64235, 68581}}, {12797, 17, 60082, {1, 3, 3, 1, 27, 21, 29, 119, 201, 527, 763, 203, 1139, 3951, 3341, 17023, 13493}}, {12798, 17, 60102, {1, 1, 1, 15, 27, 31, 97, 203, 255, 573, 781, 4095, 3381, 363, 32733, 34517, 77973}}, {12799, 17, 60108, {1, 1, 3, 9, 29, 9, 115, 207, 267, 513, 1071, 3943, 5045, 10071, 6627, 18043, 44289}}, {12800, 17, 60111, {1, 1, 7, 7, 29, 25, 51, 31, 305, 239, 197, 3825, 2363, 4903, 16237, 37571, 66545}}, {12801, 17, 60120, {1, 1, 5, 11, 29, 11, 63, 145, 185, 359, 249, 1179, 105, 1745, 28819, 40513, 74525}}, {12802, 17, 60149, {1, 1, 7, 1, 15, 35, 39, 5, 139, 119, 2047, 3369, 2857, 11037, 30523, 24813, 89209}}, {12803, 17, 60153, {1, 1, 5, 11, 9, 41, 97, 15, 357, 95, 361, 3, 3227, 8445, 16541, 30661, 84215}}, {12804, 17, 60161, {1, 1, 7, 5, 11, 55, 77, 19, 331, 621, 893, 577, 1025, 1561, 32331, 59469, 67065}}, {12805, 17, 60168, {1, 3, 7, 7, 17, 53, 55, 65, 295, 391, 445, 33, 5361, 669, 6447, 3833, 129463}}, {12806, 17, 60176, {1, 3, 7, 5, 21, 5, 83, 207, 485, 597, 1429, 581, 6831, 2885, 24669, 35211, 69549}}, {12807, 17, 60182, {1, 3, 3, 1, 3, 33, 69, 199, 427, 893, 1823, 1291, 4533, 11779, 18515, 17597, 79159}}, {12808, 17, 60185, {1, 3, 1, 1, 17, 41, 91, 21, 509, 875, 777, 639, 4009, 12103, 12947, 58395, 36625}}, {12809, 17, 60204, {1, 1, 7, 15, 13, 11, 19, 243, 365, 661, 1193, 279, 6055, 13921, 5811, 14337, 105375}}, {12810, 17, 60212, {1, 3, 7, 3, 3, 51, 101, 175, 83, 921, 523, 3909, 8003, 1295, 4153, 4757, 107881}}, {12811, 17, 60215, {1, 1, 1, 3, 19, 15, 39, 125, 401, 399, 381, 1123, 2339, 12231, 13387, 50829, 79263}}, {12812, 17, 60219, {1, 3, 1, 1, 15, 13, 55, 181, 53, 671, 1929, 1003, 521, 15279, 1837, 11877, 79241}}, {12813, 17, 60222, {1, 3, 3, 9, 23, 45, 21, 37, 1, 701, 1253, 2595, 6261, 4139, 24443, 6655, 109755}}, {12814, 17, 60229, {1, 3, 7, 1, 1, 13, 57, 41, 95, 985, 1613, 3487, 7509, 213, 32139, 27869, 123589}}, {12815, 17, 60234, {1, 3, 7, 11, 15, 27, 27, 97, 167, 755, 1331, 3961, 3067, 13827, 8983, 8755, 77847}}, {12816, 17, 60241, {1, 1, 5, 13, 5, 59, 51, 193, 339, 837, 137, 3807, 2617, 14449, 11035, 16827, 24531}}, {12817, 17, 60248, {1, 1, 7, 15, 17, 37, 67, 99, 261, 743, 275, 33, 8107, 4959, 9683, 19757, 36471}}, {12818, 17, 60277, {1, 3, 5, 5, 29, 7, 107, 95, 235, 761, 1205, 3125, 4791, 4645, 25623, 6463, 121887}}, {12819, 17, 60282, {1, 3, 1, 1, 19, 19, 73, 189, 243, 669, 489, 1927, 1651, 11391, 30699, 64719, 60359}}, {12820, 17, 60287, {1, 3, 7, 3, 29, 47, 7, 21, 299, 739, 1605, 749, 5755, 11579, 793, 36845, 14695}}, {12821, 17, 60303, {1, 1, 5, 15, 17, 53, 107, 49, 103, 505, 1191, 2881, 7435, 7515, 24237, 5397, 47003}}, {12822, 17, 60306, {1, 1, 7, 15, 25, 45, 121, 157, 313, 709, 1519, 2195, 5487, 1789, 32401, 4197, 9329}}, {12823, 17, 60327, {1, 3, 3, 11, 21, 17, 77, 153, 275, 765, 1943, 3395, 5807, 12809, 29891, 42579, 75565}}, {12824, 17, 60333, {1, 3, 5, 11, 11, 3, 63, 9, 223, 441, 1047, 441, 867, 3399, 15813, 13, 25293}}, {12825, 17, 60334, {1, 1, 7, 1, 17, 25, 1, 7, 211, 117, 1417, 1057, 3369, 13211, 11437, 20877, 114867}}, {12826, 17, 60336, {1, 1, 1, 15, 5, 41, 89, 165, 343, 447, 55, 1013, 8179, 12295, 18615, 23885, 46149}}, {12827, 17, 60345, {1, 1, 5, 1, 15, 37, 109, 141, 323, 151, 1669, 1365, 3047, 13145, 30355, 12377, 102467}}, {12828, 17, 60359, {1, 1, 3, 15, 15, 49, 83, 127, 285, 715, 981, 1153, 3019, 11071, 24229, 63807, 16315}}, {12829, 17, 60368, {1, 1, 3, 1, 23, 35, 21, 179, 83, 929, 1033, 643, 3591, 10363, 7739, 259, 106879}}, {12830, 17, 60380, {1, 1, 5, 7, 19, 9, 63, 241, 387, 851, 1709, 1161, 7469, 2093, 6169, 6085, 29851}}, {12831, 17, 60389, {1, 3, 7, 5, 17, 59, 99, 87, 189, 853, 193, 1191, 5683, 15865, 27791, 55575, 13479}}, {12832, 17, 60390, {1, 3, 3, 3, 25, 51, 81, 129, 365, 319, 179, 2863, 511, 14471, 3689, 59505, 80105}}, {12833, 17, 60394, {1, 1, 1, 15, 5, 33, 69, 35, 429, 715, 1781, 783, 1089, 8969, 26987, 23519, 34227}}, {12834, 17, 60407, {1, 3, 5, 9, 1, 51, 9, 121, 325, 945, 2025, 1985, 7337, 10837, 21299, 20591, 76905}}, {12835, 17, 60414, {1, 3, 7, 3, 15, 51, 19, 109, 297, 491, 15, 1905, 1479, 1997, 18129, 43861, 84925}}, {12836, 17, 60419, {1, 1, 3, 5, 7, 21, 1, 137, 207, 943, 1171, 2019, 6687, 10683, 20937, 34033, 43907}}, {12837, 17, 60426, {1, 1, 1, 11, 25, 21, 47, 227, 247, 933, 471, 955, 4299, 5605, 18469, 62357, 98273}}, {12838, 17, 60428, {1, 1, 5, 13, 21, 39, 41, 23, 493, 311, 1401, 537, 2919, 11519, 12597, 58321, 41401}}, {12839, 17, 60431, {1, 1, 7, 5, 31, 55, 93, 151, 219, 765, 1247, 2775, 7167, 13413, 17071, 57969, 114069}}, {12840, 17, 60440, {1, 3, 1, 15, 31, 41, 85, 161, 379, 337, 1639, 933, 3511, 925, 3523, 52379, 18421}}, {12841, 17, 60450, {1, 3, 3, 11, 17, 17, 71, 11, 291, 305, 1295, 1175, 1803, 6247, 26523, 46467, 126999}}, {12842, 17, 60469, {1, 1, 1, 13, 9, 43, 113, 7, 1, 443, 719, 3045, 2527, 5233, 13969, 50463, 115629}}, {12843, 17, 60473, {1, 1, 1, 13, 9, 31, 87, 119, 351, 53, 985, 2017, 1187, 10429, 13719, 41383, 12749}}, {12844, 17, 60474, {1, 1, 1, 15, 23, 17, 5, 215, 383, 299, 305, 3577, 7707, 6927, 28591, 44287, 65697}}, {12845, 17, 60484, {1, 1, 5, 7, 23, 61, 89, 235, 97, 463, 237, 2117, 5503, 13693, 28231, 7745, 73631}}, {12846, 17, 60496, {1, 3, 7, 3, 17, 43, 73, 245, 145, 267, 855, 187, 6167, 3999, 9935, 14347, 57727}}, {12847, 17, 60502, {1, 1, 7, 3, 25, 47, 11, 221, 425, 527, 1341, 3973, 4635, 16321, 30021, 48547, 109409}}, {12848, 17, 60508, {1, 3, 1, 13, 5, 11, 41, 191, 121, 219, 1315, 583, 2997, 5883, 31689, 64835, 35351}}, {12849, 17, 60511, {1, 1, 3, 3, 15, 47, 49, 115, 107, 757, 329, 1653, 4633, 14605, 1579, 62413, 88685}}, {12850, 17, 60522, {1, 1, 1, 5, 19, 47, 63, 131, 427, 335, 269, 3581, 7613, 15685, 16957, 30487, 94965}}, {12851, 17, 60529, {1, 1, 3, 15, 31, 11, 77, 115, 467, 249, 247, 651, 3769, 3701, 21627, 36219, 77309}}, {12852, 17, 60530, {1, 3, 1, 5, 5, 29, 45, 21, 37, 733, 1773, 2467, 2747, 9391, 5449, 23285, 20089}}, {12853, 17, 60536, {1, 3, 5, 13, 29, 31, 51, 199, 77, 711, 1313, 3303, 2675, 177, 7915, 37129, 123641}}, {12854, 17, 60551, {1, 3, 7, 15, 17, 17, 99, 43, 9, 699, 491, 669, 1313, 1377, 30015, 59261, 97321}}, {12855, 17, 60557, {1, 3, 1, 13, 9, 13, 21, 199, 249, 775, 399, 897, 2205, 15357, 17281, 3193, 255}}, {12856, 17, 60566, {1, 3, 1, 13, 7, 23, 7, 181, 65, 253, 199, 333, 6507, 4409, 13319, 30165, 95191}}, {12857, 17, 60576, {1, 3, 3, 1, 31, 9, 31, 71, 301, 867, 1655, 2065, 597, 15247, 3019, 31763, 91889}}, {12858, 17, 60579, {1, 3, 5, 5, 3, 35, 113, 133, 39, 1013, 991, 3521, 5805, 87, 32393, 28619, 34325}}, {12859, 17, 60585, {1, 3, 1, 9, 15, 27, 45, 85, 61, 99, 1085, 3251, 7085, 4137, 27443, 42581, 94031}}, {12860, 17, 60588, {1, 1, 5, 7, 11, 49, 97, 129, 339, 259, 821, 165, 833, 11383, 21629, 17473, 2947}}, {12861, 17, 60600, {1, 3, 3, 3, 11, 7, 27, 231, 169, 847, 1767, 1823, 3855, 14277, 12457, 55825, 14377}}, {12862, 17, 60613, {1, 1, 7, 3, 27, 5, 47, 193, 207, 747, 271, 3155, 1097, 2229, 4919, 22327, 12659}}, {12863, 17, 60628, {1, 1, 5, 3, 27, 29, 105, 199, 31, 73, 1741, 2173, 4577, 3917, 31513, 45983, 118015}}, {12864, 17, 60631, {1, 1, 3, 1, 19, 5, 23, 249, 35, 891, 1105, 1907, 5453, 1877, 1965, 3169, 107091}}, {12865, 17, 60648, {1, 1, 7, 9, 11, 47, 57, 171, 255, 661, 1925, 2223, 525, 4775, 12327, 8067, 47083}}, {12866, 17, 60651, {1, 3, 3, 11, 29, 43, 37, 33, 459, 117, 7, 1739, 3585, 7429, 2217, 9533, 95299}}, {12867, 17, 60653, {1, 1, 5, 11, 23, 3, 33, 13, 45, 201, 467, 597, 4891, 2673, 32407, 56935, 121991}}, {12868, 17, 60671, {1, 1, 7, 5, 29, 63, 7, 59, 417, 547, 17, 3701, 5775, 1079, 26527, 47187, 14827}}, {12869, 17, 60673, {1, 1, 5, 3, 27, 11, 85, 129, 377, 497, 1659, 1965, 581, 15075, 31265, 195, 62307}}, {12870, 17, 60691, {1, 1, 3, 9, 3, 57, 33, 57, 279, 955, 741, 955, 6501, 8069, 27305, 15363, 34715}}, {12871, 17, 60697, {1, 3, 7, 13, 29, 23, 25, 171, 201, 529, 661, 4089, 5755, 12459, 31269, 9763, 53217}}, {12872, 17, 60700, {1, 3, 7, 1, 3, 19, 27, 201, 261, 421, 1487, 2907, 547, 15791, 7661, 42871, 116343}}, {12873, 17, 60714, {1, 3, 7, 9, 5, 59, 51, 91, 7, 399, 2001, 661, 6577, 7473, 5439, 29073, 3391}}, {12874, 17, 60724, {1, 1, 7, 1, 23, 39, 119, 105, 113, 913, 1097, 2547, 8143, 11409, 23197, 59527, 55677}}, {12875, 17, 60728, {1, 3, 3, 15, 31, 35, 103, 207, 247, 801, 1821, 1995, 4437, 12891, 659, 15687, 53}}, {12876, 17, 60733, {1, 3, 3, 5, 13, 5, 45, 187, 231, 661, 1553, 2909, 3715, 4499, 14773, 5957, 24171}}, {12877, 17, 60736, {1, 1, 1, 11, 3, 53, 93, 29, 379, 713, 299, 445, 2815, 9825, 30941, 22413, 91563}}, {12878, 17, 60745, {1, 3, 1, 1, 27, 31, 111, 83, 349, 895, 1007, 2649, 7139, 5863, 27739, 53099, 6837}}, {12879, 17, 60746, {1, 3, 1, 5, 23, 57, 121, 229, 487, 405, 2001, 2761, 3011, 2219, 10711, 31139, 83809}}, {12880, 17, 60753, {1, 3, 7, 5, 13, 51, 37, 181, 359, 909, 2001, 793, 1143, 9219, 5111, 23021, 126081}}, {12881, 17, 60754, {1, 3, 1, 13, 27, 27, 99, 25, 189, 129, 1831, 1005, 8119, 2557, 26985, 63447, 89693}}, {12882, 17, 60782, {1, 1, 7, 5, 1, 21, 79, 33, 99, 7, 433, 1343, 3121, 3705, 477, 41191, 13749}}, {12883, 17, 60784, {1, 1, 5, 5, 29, 53, 75, 243, 35, 461, 1399, 129, 177, 6533, 22209, 23503, 43819}}, {12884, 17, 60790, {1, 3, 7, 7, 31, 37, 109, 9, 255, 263, 35, 3451, 7629, 9849, 10387, 3165, 120623}}, {12885, 17, 60793, {1, 3, 5, 3, 27, 53, 93, 111, 239, 723, 293, 1481, 4427, 13623, 1989, 47705, 122069}}, {12886, 17, 60805, {1, 3, 7, 7, 31, 37, 37, 213, 191, 627, 1821, 3621, 2875, 15759, 17525, 50969, 35311}}, {12887, 17, 60830, {1, 3, 5, 5, 11, 41, 87, 233, 79, 251, 25, 1385, 3527, 7853, 5541, 36519, 42779}}, {12888, 17, 60836, {1, 3, 1, 5, 9, 1, 117, 11, 61, 879, 553, 383, 6237, 15207, 3057, 28051, 59149}}, {12889, 17, 60846, {1, 1, 1, 15, 15, 7, 37, 133, 81, 815, 893, 2281, 2459, 15325, 20107, 2289, 34535}}, {12890, 17, 60851, {1, 1, 5, 11, 17, 3, 45, 159, 409, 643, 969, 1289, 4353, 10465, 16233, 55561, 111667}}, {12891, 17, 60880, {1, 1, 5, 13, 23, 1, 79, 127, 485, 1013, 629, 791, 853, 9247, 26333, 1123, 17313}}, {12892, 17, 60896, {1, 1, 5, 11, 27, 17, 97, 157, 479, 421, 1739, 3257, 2419, 6673, 2759, 19399, 120305}}, {12893, 17, 60905, {1, 3, 5, 1, 3, 43, 71, 55, 111, 949, 1957, 3777, 3409, 8229, 26585, 49221, 33639}}, {12894, 17, 60923, {1, 3, 7, 9, 17, 45, 71, 71, 417, 1007, 213, 1069, 2693, 5065, 23489, 33363, 120459}}, {12895, 17, 60925, {1, 1, 1, 1, 25, 47, 81, 251, 341, 101, 1941, 1133, 3205, 4141, 26561, 56095, 37193}}, {12896, 17, 60932, {1, 1, 3, 7, 25, 45, 97, 95, 135, 871, 949, 3489, 7593, 10717, 26163, 12711, 76989}}, {12897, 17, 60939, {1, 3, 1, 9, 3, 11, 35, 7, 471, 509, 1335, 385, 1297, 11201, 28553, 51609, 45351}}, {12898, 17, 60942, {1, 1, 5, 11, 21, 23, 105, 31, 125, 5, 1721, 1503, 7807, 13093, 24873, 18467, 30183}}, {12899, 17, 60953, {1, 3, 7, 15, 15, 57, 61, 213, 79, 655, 517, 1031, 6719, 4807, 12805, 2605, 35407}}, {12900, 17, 60956, {1, 1, 3, 15, 21, 5, 93, 61, 103, 945, 935, 115, 1281, 7735, 20723, 37211, 50039}}, {12901, 17, 60959, {1, 3, 3, 15, 19, 51, 79, 187, 127, 205, 121, 701, 6065, 15185, 29343, 58249, 25331}}, {12902, 17, 60963, {1, 3, 3, 15, 17, 49, 23, 163, 201, 809, 1203, 687, 1777, 695, 18779, 31571, 118383}}, {12903, 17, 60969, {1, 1, 1, 5, 25, 45, 121, 223, 233, 193, 1459, 1889, 5537, 4421, 13659, 4591, 112563}}, {12904, 17, 60978, {1, 3, 5, 3, 31, 37, 109, 15, 381, 373, 993, 3633, 641, 4411, 32265, 46481, 49195}}, {12905, 17, 60980, {1, 3, 3, 11, 19, 21, 39, 67, 447, 829, 1163, 55, 2153, 15045, 6643, 48235, 59261}}, {12906, 17, 60987, {1, 3, 3, 1, 7, 63, 37, 71, 35, 601, 1719, 447, 8009, 7235, 13225, 44103, 82409}}, {12907, 17, 61007, {1, 3, 3, 7, 13, 33, 69, 115, 207, 807, 109, 2989, 3727, 9017, 29095, 11377, 122401}}, {12908, 17, 61012, {1, 1, 3, 15, 9, 9, 57, 197, 115, 73, 1277, 1727, 5275, 11897, 12157, 34763, 58273}}, {12909, 17, 61015, {1, 1, 3, 15, 19, 19, 127, 105, 289, 663, 877, 1303, 4901, 8897, 4803, 36853, 93361}}, {12910, 17, 61025, {1, 1, 3, 7, 23, 29, 121, 29, 439, 795, 1469, 523, 7767, 12061, 15613, 57343, 21291}}, {12911, 17, 61026, {1, 1, 1, 9, 25, 29, 15, 165, 383, 233, 91, 2065, 2741, 7809, 5325, 48581, 65551}}, {12912, 17, 61038, {1, 1, 5, 15, 29, 19, 103, 143, 283, 597, 1055, 3525, 6115, 11083, 22497, 42893, 86849}}, {12913, 17, 61040, {1, 1, 1, 15, 13, 43, 75, 157, 267, 519, 1231, 929, 1585, 16137, 1045, 4353, 63473}}, {12914, 17, 61052, {1, 1, 1, 9, 17, 25, 73, 227, 145, 921, 1845, 2057, 3099, 15523, 8993, 14135, 37811}}, {12915, 17, 61061, {1, 3, 3, 15, 17, 57, 107, 215, 271, 841, 1543, 2803, 625, 15359, 13341, 36879, 83191}}, {12916, 17, 61074, {1, 3, 5, 13, 3, 17, 127, 81, 193, 253, 71, 3205, 1157, 1313, 27341, 49657, 96539}}, {12917, 17, 61083, {1, 3, 1, 5, 27, 43, 1, 111, 23, 963, 1853, 925, 7401, 13999, 29797, 47125, 59955}}, {12918, 17, 61085, {1, 3, 3, 1, 31, 55, 107, 121, 37, 159, 61, 577, 5711, 6745, 20077, 42333, 37105}}, {12919, 17, 61086, {1, 1, 5, 3, 31, 11, 1, 7, 295, 515, 203, 707, 2919, 9619, 8877, 45143, 101861}}, {12920, 17, 61096, {1, 3, 7, 11, 5, 23, 71, 9, 99, 947, 1141, 1651, 1903, 13607, 15433, 55005, 127639}}, {12921, 17, 61119, {1, 1, 7, 3, 13, 61, 25, 111, 239, 243, 1069, 3551, 3339, 743, 29921, 21313, 54953}}, {12922, 17, 61124, {1, 1, 3, 3, 23, 7, 21, 47, 367, 871, 1647, 2183, 2615, 2257, 30447, 25761, 110221}}, {12923, 17, 61127, {1, 3, 7, 15, 13, 51, 115, 19, 277, 463, 475, 3467, 7313, 2477, 10841, 13585, 61449}}, {12924, 17, 61128, {1, 1, 7, 9, 1, 27, 111, 209, 391, 621, 1047, 549, 2013, 549, 24213, 6369, 68691}}, {12925, 17, 61133, {1, 1, 1, 11, 19, 59, 11, 107, 79, 1013, 357, 1729, 889, 12823, 6537, 35717, 42761}}, {12926, 17, 61134, {1, 1, 3, 15, 29, 41, 49, 177, 309, 293, 1035, 1481, 1395, 2009, 7917, 365, 28981}}, {12927, 17, 61146, {1, 3, 7, 11, 31, 19, 51, 113, 479, 347, 353, 929, 1089, 3373, 2807, 55201, 23137}}, {12928, 17, 61155, {1, 3, 1, 15, 7, 55, 79, 191, 267, 701, 1885, 1241, 7085, 9835, 24239, 7609, 13967}}, {12929, 17, 61161, {1, 1, 3, 15, 25, 33, 69, 5, 93, 375, 435, 2401, 1591, 8173, 17293, 20281, 63809}}, {12930, 17, 61162, {1, 3, 5, 3, 9, 49, 63, 47, 217, 773, 1241, 1131, 7521, 15607, 24341, 20353, 122801}}, {12931, 17, 61169, {1, 3, 7, 15, 21, 1, 57, 159, 279, 987, 1641, 3883, 1659, 7875, 24857, 33273, 88933}}, {12932, 17, 61179, {1, 1, 3, 11, 3, 23, 45, 31, 279, 643, 1285, 471, 137, 15871, 13927, 52361, 118901}}, {12933, 17, 61182, {1, 3, 1, 15, 27, 51, 83, 19, 299, 213, 1001, 897, 2751, 13085, 20841, 24891, 113173}}, {12934, 17, 61190, {1, 1, 7, 5, 5, 27, 77, 77, 165, 489, 359, 1607, 3903, 16241, 641, 25999, 29279}}, {12935, 17, 61201, {1, 3, 3, 7, 15, 23, 103, 49, 259, 519, 641, 1577, 3713, 12181, 287, 29483, 58505}}, {12936, 17, 61208, {1, 1, 7, 13, 11, 29, 125, 45, 45, 167, 261, 2735, 2421, 15457, 5965, 44005, 82141}}, {12937, 17, 61238, {1, 1, 3, 9, 25, 21, 9, 3, 57, 1017, 1359, 79, 6789, 7805, 20683, 25695, 38893}}, {12938, 17, 61241, {1, 1, 7, 1, 29, 53, 87, 171, 51, 5, 9, 3033, 787, 10611, 15913, 35703, 70459}}, {12939, 17, 61247, {1, 1, 3, 5, 1, 33, 111, 139, 477, 33, 1287, 3615, 5235, 15491, 2915, 47821, 55257}}, {12940, 17, 61259, {1, 1, 1, 13, 5, 23, 55, 225, 303, 587, 1595, 307, 3809, 8093, 13297, 63213, 104317}}, {12941, 17, 61267, {1, 1, 3, 15, 31, 29, 13, 33, 267, 481, 1039, 3805, 2549, 861, 12483, 61829, 127725}}, {12942, 17, 61269, {1, 3, 5, 11, 23, 17, 23, 117, 333, 167, 1965, 1387, 5453, 15545, 123, 12991, 36281}}, {12943, 17, 61295, {1, 3, 5, 1, 3, 9, 25, 55, 497, 951, 1377, 993, 6089, 4801, 32719, 31579, 126663}}, {12944, 17, 61304, {1, 3, 5, 11, 15, 37, 103, 51, 509, 585, 769, 425, 835, 14027, 30265, 55735, 36655}}, {12945, 17, 61309, {1, 1, 1, 13, 9, 49, 105, 61, 493, 3, 1663, 815, 8105, 16361, 32477, 30437, 61519}}, {12946, 17, 61310, {1, 3, 7, 11, 29, 23, 105, 87, 119, 399, 1405, 1515, 7017, 12729, 13769, 29741, 30921}}, {12947, 17, 61313, {1, 3, 7, 13, 13, 7, 93, 227, 489, 843, 923, 3373, 759, 5105, 9059, 21079, 101335}}, {12948, 17, 61320, {1, 1, 1, 1, 29, 53, 119, 227, 171, 363, 289, 827, 425, 12827, 25791, 21587, 109567}}, {12949, 17, 61325, {1, 1, 5, 11, 29, 29, 53, 127, 441, 219, 1049, 275, 525, 5535, 20907, 9299, 76319}}, {12950, 17, 61334, {1, 3, 7, 15, 3, 53, 109, 61, 275, 391, 1147, 2953, 1439, 4417, 679, 10949, 35101}}, {12951, 17, 61337, {1, 1, 5, 13, 9, 1, 109, 137, 249, 835, 721, 129, 2883, 13043, 31827, 36741, 107167}}, {12952, 17, 61386, {1, 1, 5, 9, 27, 17, 117, 121, 111, 433, 743, 1987, 6839, 8439, 2533, 62135, 54281}}, {12953, 17, 61399, {1, 3, 5, 15, 11, 61, 117, 103, 409, 485, 1047, 469, 2245, 7193, 2541, 9399, 88127}}, {12954, 17, 61422, {1, 3, 1, 9, 3, 49, 111, 201, 87, 181, 1243, 3261, 1827, 10385, 13045, 58331, 107729}}, {12955, 17, 61429, {1, 3, 5, 15, 13, 29, 61, 223, 227, 733, 1757, 755, 4231, 13537, 1509, 54623, 120221}}, {12956, 17, 61436, {1, 1, 1, 15, 13, 9, 7, 233, 391, 689, 355, 1203, 5811, 7759, 2647, 54949, 51891}}, {12957, 17, 61439, {1, 1, 3, 1, 3, 27, 95, 51, 497, 315, 915, 1055, 2917, 167, 1849, 26591, 102729}}, {12958, 17, 61466, {1, 3, 7, 13, 1, 51, 3, 113, 437, 449, 1889, 2887, 4735, 5693, 8191, 12847, 52651}}, {12959, 17, 61477, {1, 1, 7, 13, 1, 45, 41, 221, 403, 185, 1653, 1809, 6405, 9193, 1381, 36677, 43255}}, {12960, 17, 61478, {1, 1, 5, 1, 25, 51, 109, 245, 291, 809, 1381, 3235, 5933, 10185, 18663, 15589, 39539}}, {12961, 17, 61490, {1, 3, 3, 1, 27, 29, 3, 227, 275, 705, 489, 681, 323, 7453, 26005, 13791, 115219}}, {12962, 17, 61495, {1, 3, 5, 1, 3, 51, 101, 75, 157, 529, 45, 3105, 3617, 13081, 21665, 50065, 117823}}, {12963, 17, 61504, {1, 3, 5, 15, 9, 43, 41, 169, 391, 455, 1375, 253, 1257, 14427, 16325, 11571, 26361}}, {12964, 17, 61514, {1, 1, 5, 7, 5, 41, 81, 173, 275, 225, 301, 335, 5473, 1509, 20897, 21951, 103967}}, {12965, 17, 61516, {1, 3, 5, 1, 13, 27, 107, 19, 221, 609, 823, 1193, 665, 4947, 11967, 57373, 21665}}, {12966, 17, 61521, {1, 3, 7, 13, 7, 11, 109, 59, 193, 103, 943, 595, 5121, 6159, 2103, 52863, 57541}}, {12967, 17, 61527, {1, 3, 5, 3, 5, 51, 85, 227, 465, 1013, 601, 1687, 7615, 5991, 8635, 64487, 69967}}, {12968, 17, 61531, {1, 3, 1, 11, 29, 49, 79, 25, 447, 119, 569, 383, 5261, 6209, 21965, 40863, 96593}}, {12969, 17, 61540, {1, 1, 3, 13, 9, 49, 59, 93, 369, 789, 1373, 425, 3565, 13357, 17783, 46435, 129653}}, {12970, 17, 61550, {1, 3, 7, 5, 5, 39, 51, 15, 421, 531, 1855, 2105, 5335, 8509, 20841, 44997, 48235}}, {12971, 17, 61557, {1, 3, 7, 3, 27, 47, 113, 1, 453, 565, 1843, 243, 7663, 10697, 7725, 24485, 49435}}, {12972, 17, 61562, {1, 1, 1, 11, 25, 25, 47, 1, 475, 831, 1833, 391, 5173, 14873, 14263, 36061, 26781}}, {12973, 17, 61577, {1, 1, 7, 15, 21, 13, 5, 169, 241, 235, 547, 1565, 2053, 6877, 12811, 22213, 106907}}, {12974, 17, 61583, {1, 3, 7, 1, 21, 11, 101, 115, 243, 985, 1389, 2189, 563, 12453, 14951, 58889, 48079}}, {12975, 17, 61597, {1, 1, 5, 7, 9, 37, 33, 241, 337, 453, 1955, 1731, 4445, 8887, 27715, 63975, 95891}}, {12976, 17, 61602, {1, 1, 5, 1, 23, 21, 95, 237, 241, 991, 1159, 2417, 2279, 8941, 20987, 39773, 79327}}, {12977, 17, 61604, {1, 3, 3, 1, 19, 39, 73, 253, 137, 1009, 1793, 4007, 2017, 7503, 16689, 29013, 41571}}, {12978, 17, 61607, {1, 3, 7, 15, 3, 63, 77, 11, 293, 495, 339, 3525, 5747, 1807, 11705, 55807, 54163}}, {12979, 17, 61622, {1, 3, 7, 3, 25, 41, 127, 23, 113, 807, 387, 3529, 2173, 11217, 21257, 61169, 47749}}, {12980, 17, 61625, {1, 3, 3, 5, 27, 5, 43, 55, 207, 995, 811, 1473, 481, 4317, 2015, 49161, 94711}}, {12981, 17, 61633, {1, 3, 1, 9, 21, 61, 41, 147, 425, 353, 1943, 2455, 379, 10729, 3045, 16013, 44527}}, {12982, 17, 61640, {1, 3, 1, 5, 17, 43, 109, 231, 313, 277, 939, 3491, 5883, 2297, 4763, 33403, 62395}}, {12983, 17, 61643, {1, 1, 3, 9, 1, 49, 37, 145, 383, 467, 621, 2873, 873, 6163, 16475, 49045, 115599}}, {12984, 17, 61651, {1, 1, 1, 9, 5, 15, 125, 157, 459, 727, 807, 2769, 5531, 11531, 4277, 42301, 16969}}, {12985, 17, 61658, {1, 1, 3, 1, 15, 23, 39, 121, 163, 537, 409, 1217, 8007, 5671, 19681, 25371, 69227}}, {12986, 17, 61670, {1, 3, 7, 9, 23, 1, 93, 41, 267, 995, 1917, 3441, 6237, 7233, 30215, 31945, 33967}}, {12987, 17, 61674, {1, 1, 1, 15, 7, 5, 123, 53, 359, 677, 1061, 1649, 651, 14079, 30211, 14827, 123175}}, {12988, 17, 61676, {1, 3, 1, 5, 11, 19, 121, 135, 167, 293, 493, 949, 5459, 11785, 21445, 57161, 129737}}, {12989, 17, 61679, {1, 1, 3, 13, 19, 39, 43, 55, 149, 549, 479, 925, 341, 1151, 12007, 23473, 10671}}, {12990, 17, 61688, {1, 3, 5, 9, 7, 41, 37, 103, 381, 373, 1767, 3959, 3001, 7903, 24033, 55123, 93627}}, {12991, 17, 61693, {1, 3, 3, 3, 31, 27, 93, 175, 393, 575, 703, 3715, 6043, 11763, 7613, 15907, 56821}}, {12992, 17, 61701, {1, 3, 3, 13, 3, 13, 75, 85, 89, 851, 1171, 3075, 5265, 10293, 14745, 32153, 89877}}, {12993, 17, 61711, {1, 1, 7, 11, 1, 25, 101, 149, 187, 197, 1485, 1555, 1599, 7413, 23275, 27093, 73483}}, {12994, 17, 61714, {1, 3, 1, 1, 19, 15, 63, 111, 211, 197, 77, 1683, 3159, 235, 32601, 35715, 59537}}, {12995, 17, 61723, {1, 3, 5, 11, 23, 61, 91, 135, 403, 669, 267, 2507, 2931, 7813, 5047, 40027, 111705}}, {12996, 17, 61725, {1, 1, 5, 13, 7, 5, 65, 37, 87, 405, 335, 1095, 3717, 1717, 31551, 28181, 47407}}, {12997, 17, 61726, {1, 1, 5, 13, 3, 43, 67, 99, 507, 861, 1063, 3003, 6095, 11079, 6919, 41597, 97709}}, {12998, 17, 61729, {1, 1, 3, 1, 7, 23, 109, 161, 321, 499, 549, 363, 2061, 6519, 1531, 1969, 83845}}, {12999, 17, 61741, {1, 3, 7, 5, 17, 39, 55, 59, 455, 433, 601, 365, 7987, 2207, 3463, 31755, 94203}}, {13000, 17, 61761, {1, 3, 5, 5, 29, 61, 79, 101, 125, 1011, 867, 2935, 3269, 13601, 21935, 50355, 65883}}, {13001, 17, 61779, {1, 1, 1, 5, 3, 41, 101, 107, 299, 125, 81, 2421, 2937, 787, 19479, 25803, 74473}}, {13002, 17, 61781, {1, 3, 3, 1, 3, 15, 73, 13, 167, 387, 75, 601, 415, 6927, 32277, 16709, 12477}}, {13003, 17, 61782, {1, 1, 5, 1, 19, 37, 53, 45, 139, 737, 159, 2299, 6219, 11613, 22873, 18303, 56875}}, {13004, 17, 61797, {1, 1, 3, 9, 23, 15, 17, 37, 373, 445, 1369, 2997, 49, 13901, 13155, 37375, 29063}}, {13005, 17, 61809, {1, 3, 3, 11, 17, 1, 45, 91, 445, 631, 1297, 1907, 3765, 13893, 29379, 17939, 36573}}, {13006, 17, 61810, {1, 1, 7, 13, 11, 31, 101, 165, 413, 305, 361, 4019, 3183, 2321, 7819, 49275, 101041}}, {13007, 17, 61816, {1, 1, 7, 1, 13, 43, 125, 165, 357, 293, 1343, 2219, 4189, 6095, 28509, 27763, 53871}}, {13008, 17, 61822, {1, 3, 3, 11, 29, 33, 105, 71, 297, 637, 1493, 3797, 5525, 15093, 21647, 57647, 1467}}, {13009, 17, 61849, {1, 1, 1, 13, 19, 7, 5, 141, 71, 221, 923, 1039, 4777, 9481, 1267, 55345, 116061}}, {13010, 17, 61876, {1, 1, 7, 11, 19, 43, 57, 243, 21, 217, 1075, 569, 3735, 10477, 18595, 34133, 70391}}, {13011, 17, 61893, {1, 3, 3, 1, 21, 61, 7, 135, 401, 101, 321, 2959, 7371, 3303, 23023, 28163, 19833}}, {13012, 17, 61905, {1, 1, 3, 9, 31, 43, 27, 243, 297, 145, 663, 3951, 4283, 10421, 9355, 30381, 68317}}, {13013, 17, 61908, {1, 3, 7, 13, 29, 53, 101, 253, 49, 129, 831, 513, 5567, 5063, 157, 6465, 90983}}, {13014, 17, 61911, {1, 1, 5, 15, 27, 29, 3, 231, 503, 173, 913, 3971, 7685, 9679, 32243, 967, 73195}}, {13015, 17, 61912, {1, 1, 1, 15, 19, 55, 127, 3, 405, 239, 1063, 3473, 7543, 4049, 14509, 22657, 5611}}, {13016, 17, 61928, {1, 3, 7, 1, 21, 39, 61, 249, 421, 401, 1667, 1981, 5503, 9191, 24027, 35049, 12199}}, {13017, 17, 61934, {1, 3, 5, 5, 27, 1, 99, 83, 287, 997, 721, 1345, 2197, 6335, 4245, 42575, 102635}}, {13018, 17, 61957, {1, 3, 3, 1, 31, 7, 103, 107, 387, 273, 951, 2475, 1275, 15607, 2159, 55083, 86107}}, {13019, 17, 61961, {1, 3, 3, 5, 21, 59, 69, 55, 121, 601, 5, 1871, 7161, 4583, 23867, 7933, 3125}}, {13020, 17, 61969, {1, 1, 1, 15, 17, 41, 51, 45, 383, 579, 713, 275, 1395, 11665, 30521, 11683, 126493}}, {13021, 17, 61979, {1, 1, 1, 15, 17, 47, 15, 139, 175, 283, 1377, 827, 5753, 8855, 26437, 59219, 105601}}, {13022, 17, 61982, {1, 1, 7, 11, 13, 3, 27, 141, 137, 851, 767, 2575, 7685, 11719, 24401, 52547, 127299}}, {13023, 17, 62003, {1, 3, 3, 9, 11, 41, 75, 69, 167, 897, 1213, 3723, 6773, 12141, 28033, 19695, 128545}}, {13024, 17, 62006, {1, 1, 5, 13, 7, 61, 55, 131, 465, 169, 1669, 711, 5901, 10769, 11273, 23809, 63625}}, {13025, 17, 62010, {1, 1, 5, 1, 27, 25, 35, 167, 83, 921, 251, 2571, 6723, 14767, 26715, 21699, 60779}}, {13026, 17, 62015, {1, 3, 1, 9, 15, 5, 59, 241, 405, 323, 1917, 1161, 6079, 13443, 13079, 58617, 63381}}, {13027, 17, 62020, {1, 3, 1, 5, 9, 5, 79, 123, 87, 395, 667, 2787, 3711, 3613, 1803, 17885, 78975}}, {13028, 17, 62024, {1, 3, 3, 5, 17, 45, 61, 107, 485, 163, 33, 1491, 7131, 59, 27327, 8043, 14907}}, {13029, 17, 62029, {1, 3, 1, 11, 27, 37, 5, 251, 115, 339, 1621, 2013, 3517, 2213, 10145, 47121, 84485}}, {13030, 17, 62032, {1, 3, 3, 1, 9, 11, 71, 25, 363, 867, 1485, 3897, 3339, 7599, 20777, 52009, 127097}}, {13031, 17, 62035, {1, 1, 3, 9, 25, 37, 29, 231, 183, 315, 399, 879, 6169, 6355, 3729, 9187, 19405}}, {13032, 17, 62038, {1, 3, 5, 3, 31, 37, 127, 71, 171, 687, 1237, 151, 7391, 2395, 11979, 23381, 117879}}, {13033, 17, 62047, {1, 1, 1, 13, 13, 43, 71, 235, 131, 79, 1321, 235, 2221, 1133, 13509, 12205, 44771}}, {13034, 17, 62068, {1, 3, 7, 5, 29, 51, 125, 191, 153, 35, 1657, 2141, 3701, 7177, 31723, 15189, 55441}}, {13035, 17, 62071, {1, 1, 5, 1, 5, 35, 13, 165, 461, 255, 1825, 1531, 6195, 7717, 973, 12367, 71747}}, {13036, 17, 62082, {1, 3, 1, 9, 13, 57, 25, 83, 389, 405, 227, 1037, 3805, 15653, 25365, 47991, 54315}}, {13037, 17, 62088, {1, 1, 1, 13, 17, 55, 113, 151, 145, 951, 1849, 2205, 6513, 7845, 7947, 59429, 44911}}, {13038, 17, 62096, {1, 3, 5, 3, 25, 9, 99, 159, 183, 445, 153, 3053, 2537, 1787, 19029, 60047, 128203}}, {13039, 17, 62108, {1, 1, 5, 5, 31, 37, 13, 11, 271, 491, 1141, 1827, 3751, 9471, 7579, 35969, 95245}}, {13040, 17, 62124, {1, 3, 3, 15, 1, 43, 9, 109, 13, 991, 345, 1577, 947, 3197, 16747, 8127, 116937}}, {13041, 17, 62142, {1, 3, 3, 15, 11, 17, 103, 89, 33, 741, 1855, 2879, 3899, 9535, 15119, 56165, 86055}}, {13042, 17, 62147, {1, 3, 5, 1, 31, 41, 57, 205, 69, 163, 1383, 2087, 6483, 6281, 32079, 40825, 28709}}, {13043, 17, 62153, {1, 1, 1, 13, 23, 57, 103, 247, 421, 773, 1733, 3249, 6681, 9675, 11669, 51673, 86189}}, {13044, 17, 62159, {1, 1, 5, 15, 7, 37, 63, 123, 77, 941, 277, 1061, 803, 2135, 15745, 47413, 73843}}, {13045, 17, 62161, {1, 1, 3, 5, 19, 15, 35, 59, 321, 527, 1669, 2929, 513, 4453, 20521, 19781, 115501}}, {13046, 17, 62171, {1, 1, 7, 3, 23, 1, 99, 251, 129, 271, 1555, 1191, 2445, 11533, 11921, 19131, 80653}}, {13047, 17, 62189, {1, 1, 7, 15, 15, 33, 79, 89, 113, 517, 1655, 43, 6255, 15415, 19559, 63309, 16857}}, {13048, 17, 62207, {1, 3, 5, 1, 13, 61, 87, 159, 65, 875, 163, 663, 7651, 8775, 32505, 39313, 83331}}, {13049, 17, 62227, {1, 1, 7, 15, 27, 19, 63, 117, 427, 233, 1243, 755, 3201, 5153, 31959, 64545, 69219}}, {13050, 17, 62230, {1, 1, 5, 3, 3, 27, 15, 11, 427, 431, 107, 2433, 6923, 7503, 31347, 64849, 14541}}, {13051, 17, 62234, {1, 1, 3, 11, 7, 23, 53, 253, 483, 63, 1749, 2989, 5219, 7361, 6423, 1503, 95431}}, {13052, 17, 62236, {1, 1, 5, 9, 1, 19, 23, 25, 301, 665, 1457, 2423, 6623, 9771, 2755, 8963, 51037}}, {13053, 17, 62239, {1, 3, 3, 7, 21, 1, 3, 131, 377, 897, 15, 437, 4075, 7669, 31529, 64123, 101249}}, {13054, 17, 62257, {1, 3, 5, 3, 31, 41, 99, 27, 397, 393, 1895, 2249, 3925, 6393, 2839, 375, 56721}}, {13055, 17, 62270, {1, 3, 7, 15, 1, 45, 65, 113, 85, 557, 857, 2281, 1395, 2055, 2405, 34541, 63719}}, {13056, 17, 62278, {1, 3, 1, 15, 7, 43, 21, 29, 15, 229, 1287, 3005, 339, 5833, 21867, 21643, 37557}}, {13057, 17, 62287, {1, 3, 7, 3, 3, 51, 67, 119, 423, 539, 1995, 4039, 2999, 2787, 29327, 62687, 11893}}, {13058, 17, 62295, {1, 3, 7, 3, 25, 23, 85, 11, 105, 523, 889, 2983, 2031, 2049, 16119, 41925, 38345}}, {13059, 17, 62301, {1, 3, 7, 3, 13, 63, 59, 65, 183, 695, 293, 3301, 7895, 13915, 25847, 22819, 92189}}, {13060, 17, 62306, {1, 1, 3, 3, 7, 27, 101, 229, 435, 227, 1759, 1275, 5781, 6079, 25125, 64833, 69577}}, {13061, 17, 62312, {1, 1, 3, 1, 29, 1, 61, 45, 193, 441, 687, 841, 4491, 10683, 13989, 60461, 78071}}, {13062, 17, 62317, {1, 3, 1, 9, 5, 33, 99, 229, 181, 675, 1629, 1855, 4719, 9585, 8059, 26363, 31161}}, {13063, 17, 62330, {1, 3, 1, 11, 11, 37, 79, 53, 163, 49, 1173, 1715, 8087, 6535, 14985, 24069, 118597}}, {13064, 17, 62342, {1, 1, 7, 15, 9, 59, 123, 79, 237, 131, 1693, 2525, 6339, 9843, 24309, 24969, 37645}}, {13065, 17, 62359, {1, 3, 3, 7, 19, 49, 85, 133, 415, 239, 555, 2581, 6523, 2733, 19665, 19989, 105585}}, {13066, 17, 62365, {1, 3, 3, 7, 23, 37, 31, 121, 59, 7, 2031, 2893, 6429, 10305, 21221, 20105, 38879}}, {13067, 17, 62366, {1, 3, 1, 13, 23, 21, 93, 93, 343, 641, 411, 971, 1777, 2135, 22895, 9055, 114457}}, {13068, 17, 62370, {1, 3, 5, 3, 15, 33, 23, 7, 59, 413, 277, 3551, 7737, 2285, 7951, 5013, 94469}}, {13069, 17, 62375, {1, 3, 1, 15, 25, 1, 109, 245, 153, 187, 1099, 1071, 145, 6735, 10327, 3921, 62123}}, {13070, 17, 62376, {1, 1, 7, 11, 11, 53, 51, 123, 277, 281, 1763, 3161, 7639, 14515, 29725, 3919, 5525}}, {13071, 17, 62387, {1, 3, 3, 15, 27, 47, 109, 121, 317, 221, 187, 617, 1331, 5401, 861, 62465, 9227}}, {13072, 17, 62404, {1, 3, 3, 15, 27, 25, 101, 111, 469, 85, 1285, 1621, 5393, 1367, 17115, 35141, 126989}}, {13073, 17, 62411, {1, 3, 5, 1, 15, 23, 25, 249, 69, 17, 1103, 2603, 59, 15637, 22051, 29243, 53113}}, {13074, 17, 62435, {1, 3, 1, 9, 17, 49, 73, 13, 207, 963, 379, 3561, 6447, 7895, 18651, 8109, 3943}}, {13075, 17, 62441, {1, 3, 5, 11, 7, 41, 55, 85, 481, 831, 593, 4093, 1151, 12353, 24231, 46091, 80967}}, {13076, 17, 62442, {1, 3, 7, 7, 5, 39, 47, 187, 427, 1007, 813, 3617, 6063, 12981, 18573, 34061, 85741}}, {13077, 17, 62452, {1, 3, 3, 11, 9, 17, 29, 141, 341, 485, 1075, 4067, 7247, 11295, 31803, 18347, 54985}}, {13078, 17, 62459, {1, 1, 3, 7, 17, 25, 7, 29, 355, 35, 1753, 669, 4123, 4293, 22875, 36677, 61201}}, {13079, 17, 62461, {1, 1, 5, 9, 13, 45, 29, 153, 169, 387, 1275, 3161, 4937, 5331, 16203, 43925, 129231}}, {13080, 17, 62473, {1, 3, 3, 9, 19, 27, 109, 95, 499, 929, 1627, 3215, 6097, 15837, 5655, 29877, 122513}}, {13081, 17, 62474, {1, 3, 7, 11, 1, 25, 15, 41, 65, 411, 289, 883, 5069, 8405, 11159, 57357, 114253}}, {13082, 17, 62493, {1, 1, 3, 11, 31, 57, 39, 89, 77, 321, 1667, 871, 6429, 1005, 18905, 13877, 9305}}, {13083, 17, 62510, {1, 1, 7, 7, 27, 57, 23, 37, 281, 625, 1871, 565, 5979, 13925, 22591, 2375, 8577}}, {13084, 17, 62518, {1, 1, 1, 7, 31, 35, 91, 221, 495, 811, 1321, 2235, 4287, 3009, 5745, 35013, 93715}}, {13085, 17, 62524, {1, 1, 7, 3, 11, 53, 17, 13, 319, 225, 117, 3365, 537, 5249, 14219, 23879, 4321}}, {13086, 17, 62549, {1, 3, 5, 1, 31, 57, 35, 95, 257, 933, 471, 627, 6733, 8707, 25173, 44291, 105041}}, {13087, 17, 62556, {1, 1, 3, 3, 31, 53, 69, 19, 277, 669, 497, 3957, 2781, 14107, 27741, 53519, 41057}}, {13088, 17, 62565, {1, 1, 3, 15, 11, 21, 11, 25, 257, 665, 491, 2119, 3893, 14401, 29147, 3369, 116569}}, {13089, 17, 62566, {1, 3, 1, 1, 13, 49, 31, 231, 217, 711, 1987, 1487, 7073, 473, 28781, 51283, 86049}}, {13090, 17, 62580, {1, 1, 1, 5, 23, 31, 119, 115, 381, 179, 1725, 2323, 8013, 15191, 13255, 57813, 95437}}, {13091, 17, 62584, {1, 1, 3, 15, 15, 37, 83, 223, 259, 605, 2013, 4089, 395, 2063, 11735, 51931, 74677}}, {13092, 17, 62589, {1, 1, 7, 3, 1, 61, 107, 169, 213, 789, 425, 2309, 225, 1305, 20697, 26281, 60129}}, {13093, 17, 62596, {1, 1, 5, 15, 27, 15, 69, 169, 289, 931, 1491, 3711, 6875, 7723, 21103, 31795, 53955}}, {13094, 17, 62608, {1, 1, 1, 3, 3, 43, 49, 205, 247, 817, 2037, 2305, 7935, 255, 18835, 49423, 90727}}, {13095, 17, 62636, {1, 3, 7, 9, 17, 3, 95, 239, 431, 665, 1271, 3559, 5703, 14607, 9723, 11807, 122937}}, {13096, 17, 62642, {1, 3, 5, 13, 5, 15, 13, 111, 375, 895, 833, 813, 5451, 13841, 1321, 25273, 25443}}, {13097, 17, 62651, {1, 1, 3, 1, 11, 49, 3, 97, 467, 631, 51, 3577, 1777, 15965, 6837, 38827, 68627}}, {13098, 17, 62654, {1, 1, 7, 1, 3, 11, 73, 155, 77, 623, 811, 337, 6837, 10925, 2097, 28325, 97487}}, {13099, 17, 62659, {1, 1, 1, 3, 29, 35, 9, 215, 415, 143, 1837, 3723, 73, 11305, 23187, 19995, 52987}}, {13100, 17, 62666, {1, 1, 7, 1, 25, 39, 35, 67, 245, 295, 1143, 2043, 1049, 629, 14111, 62893, 86899}}, {13101, 17, 62680, {1, 3, 7, 5, 3, 41, 123, 97, 241, 743, 259, 3163, 2289, 6363, 24033, 10789, 44117}}, {13102, 17, 62692, {1, 3, 1, 7, 25, 33, 33, 17, 359, 567, 901, 3595, 179, 8671, 841, 24787, 4367}}, {13103, 17, 62701, {1, 3, 1, 13, 5, 13, 57, 185, 321, 727, 789, 3081, 5345, 9721, 32029, 11663, 55695}}, {13104, 17, 62702, {1, 1, 7, 7, 5, 51, 85, 255, 329, 263, 297, 1687, 6799, 10973, 8265, 19615, 115333}}, {13105, 17, 62714, {1, 1, 1, 5, 29, 27, 55, 167, 465, 73, 661, 137, 7831, 2571, 15373, 64223, 27335}}, {13106, 17, 62716, {1, 3, 7, 13, 5, 23, 77, 15, 345, 21, 1729, 3231, 967, 12573, 31415, 24249, 110525}}, {13107, 17, 62733, {1, 1, 7, 9, 31, 37, 41, 119, 169, 891, 1845, 2139, 1747, 1147, 21983, 11617, 25963}}, {13108, 17, 62762, {1, 3, 3, 7, 23, 5, 1, 11, 95, 795, 1371, 2631, 3241, 6935, 17353, 25013, 89765}}, {13109, 17, 62769, {1, 3, 1, 7, 19, 3, 121, 19, 389, 117, 1905, 3135, 7601, 12541, 20855, 38613, 15005}}, {13110, 17, 62770, {1, 3, 3, 5, 17, 43, 91, 99, 113, 545, 1955, 37, 3411, 15173, 24961, 28761, 15245}}, {13111, 17, 62787, {1, 3, 3, 13, 25, 9, 83, 17, 17, 271, 1133, 3851, 4607, 11017, 14867, 20677, 42881}}, {13112, 17, 62794, {1, 1, 5, 15, 5, 9, 99, 179, 263, 623, 441, 2577, 189, 11595, 21505, 27215, 54081}}, {13113, 17, 62801, {1, 1, 7, 1, 1, 63, 123, 119, 245, 467, 169, 3075, 909, 3581, 14571, 33071, 6261}}, {13114, 17, 62807, {1, 1, 1, 13, 9, 35, 47, 161, 47, 893, 57, 703, 3373, 4167, 26555, 51265, 1391}}, {13115, 17, 62808, {1, 3, 1, 13, 9, 61, 9, 5, 47, 259, 579, 113, 355, 14539, 25757, 10119, 96869}}, {13116, 17, 62813, {1, 1, 5, 11, 3, 5, 61, 231, 291, 21, 1711, 2981, 4727, 14287, 12149, 40275, 51809}}, {13117, 17, 62817, {1, 3, 5, 3, 21, 5, 87, 251, 373, 679, 949, 1023, 5183, 14549, 4135, 54927, 20369}}, {13118, 17, 62818, {1, 3, 3, 11, 7, 43, 127, 97, 469, 81, 1843, 3955, 125, 8607, 27185, 50761, 122753}}, {13119, 17, 62832, {1, 3, 5, 5, 25, 61, 1, 55, 333, 949, 1005, 1051, 6291, 8343, 9627, 37739, 116911}}, {13120, 17, 62841, {1, 3, 3, 13, 21, 9, 67, 225, 179, 837, 2009, 3171, 217, 5629, 23451, 63171, 53225}}, {13121, 17, 62857, {1, 3, 7, 1, 23, 15, 91, 163, 351, 883, 579, 3923, 2641, 12735, 24955, 1131, 65119}}, {13122, 17, 62860, {1, 1, 1, 11, 29, 5, 113, 217, 171, 535, 913, 2419, 3843, 12365, 8287, 27367, 57369}}, {13123, 17, 62871, {1, 1, 5, 11, 9, 41, 57, 243, 123, 159, 1517, 2653, 4307, 4243, 2801, 43131, 18435}}, {13124, 17, 62882, {1, 1, 7, 9, 23, 59, 83, 159, 57, 723, 1635, 7, 1463, 121, 541, 7657, 83917}}, {13125, 17, 62888, {1, 3, 7, 7, 23, 27, 125, 103, 247, 1019, 1063, 3979, 8085, 6449, 12443, 63427, 106235}}, {13126, 17, 62913, {1, 1, 7, 5, 9, 31, 23, 83, 503, 605, 1731, 3341, 7427, 14571, 5981, 39043, 42965}}, {13127, 17, 62919, {1, 3, 5, 1, 17, 49, 109, 171, 301, 951, 1879, 1317, 457, 8085, 6803, 62521, 67871}}, {13128, 17, 62920, {1, 1, 7, 11, 11, 27, 1, 71, 335, 137, 265, 1267, 6399, 14823, 925, 49895, 19731}}, {13129, 17, 62925, {1, 3, 1, 13, 3, 35, 75, 253, 211, 483, 1495, 3695, 3033, 14643, 1861, 51269, 32655}}, {13130, 17, 62933, {1, 3, 7, 1, 5, 17, 63, 1, 83, 435, 2007, 2023, 57, 8639, 27067, 4039, 1955}}, {13131, 17, 62938, {1, 3, 5, 15, 27, 51, 59, 47, 77, 131, 507, 559, 645, 16067, 20989, 15565, 39925}}, {13132, 17, 62940, {1, 3, 3, 5, 11, 15, 63, 121, 39, 1019, 1027, 2821, 3297, 13769, 18587, 14199, 82251}}, {13133, 17, 62949, {1, 1, 5, 1, 31, 11, 89, 75, 147, 1007, 917, 3519, 5097, 5695, 15185, 14819, 38597}}, {13134, 17, 62956, {1, 3, 3, 3, 15, 7, 127, 55, 83, 887, 1901, 75, 639, 713, 13631, 27447, 106707}}, {13135, 17, 62971, {1, 3, 3, 15, 27, 25, 85, 163, 187, 959, 815, 1403, 6129, 6515, 31597, 28307, 30077}}, {13136, 17, 62978, {1, 3, 1, 13, 5, 19, 117, 89, 11, 489, 845, 2899, 3695, 3279, 22355, 38759, 85849}}, {13137, 17, 62990, {1, 3, 1, 7, 25, 59, 109, 185, 87, 591, 825, 1119, 7439, 5451, 17959, 51299, 76693}}, {13138, 17, 62995, {1, 1, 7, 5, 25, 29, 115, 249, 185, 529, 593, 103, 1739, 4769, 25925, 3317, 102445}}, {13139, 17, 62997, {1, 1, 3, 1, 3, 35, 19, 255, 279, 295, 1075, 2817, 3513, 7501, 15885, 21653, 113447}}, {13140, 17, 63004, {1, 3, 1, 5, 27, 1, 21, 137, 303, 981, 631, 2339, 397, 13075, 28815, 50925, 44379}}, {13141, 17, 63011, {1, 1, 7, 7, 31, 31, 59, 129, 105, 181, 1041, 2685, 1061, 1721, 30365, 6873, 30011}}, {13142, 17, 63032, {1, 1, 3, 1, 19, 31, 125, 39, 9, 631, 1239, 1061, 6313, 9639, 5991, 27293, 84635}}, {13143, 17, 63038, {1, 3, 3, 11, 17, 59, 17, 241, 195, 175, 1845, 251, 3323, 13399, 20493, 15241, 69303}}, {13144, 17, 63067, {1, 1, 5, 3, 9, 19, 59, 25, 49, 359, 263, 4045, 1527, 6703, 555, 26413, 42757}}, {13145, 17, 63069, {1, 1, 5, 9, 23, 5, 7, 223, 247, 407, 1079, 1069, 3417, 14795, 5015, 2965, 99059}}, {13146, 17, 63076, {1, 3, 7, 5, 27, 47, 9, 37, 47, 181, 819, 2049, 2643, 9231, 8173, 33495, 91321}}, {13147, 17, 63083, {1, 3, 5, 11, 5, 27, 5, 237, 349, 653, 1443, 137, 7969, 5961, 24749, 37523, 88921}}, {13148, 17, 63088, {1, 3, 7, 13, 11, 51, 49, 71, 339, 195, 1239, 3479, 2771, 15217, 23729, 7839, 32633}}, {13149, 17, 63094, {1, 1, 5, 5, 5, 13, 103, 185, 13, 273, 1793, 761, 5327, 8659, 32599, 38181, 121115}}, {13150, 17, 63097, {1, 3, 7, 15, 17, 55, 69, 151, 231, 421, 1679, 3657, 8001, 12599, 13761, 13517, 130199}}, {13151, 17, 63100, {1, 1, 5, 3, 5, 15, 15, 61, 489, 219, 925, 2329, 3415, 10779, 31297, 63805, 13375}}, {13152, 17, 63104, {1, 1, 7, 9, 7, 11, 87, 45, 39, 885, 87, 1877, 8135, 1247, 25685, 23631, 65579}}, {13153, 17, 63114, {1, 3, 3, 7, 1, 17, 31, 75, 455, 535, 509, 2151, 1737, 7579, 12727, 25139, 32659}}, {13154, 17, 63116, {1, 3, 5, 7, 15, 27, 111, 145, 99, 767, 167, 3391, 2155, 7895, 3405, 47451, 65185}}, {13155, 17, 63122, {1, 1, 1, 3, 23, 31, 15, 53, 59, 787, 431, 2691, 71, 2843, 13469, 54029, 2233}}, {13156, 17, 63128, {1, 1, 5, 1, 5, 39, 57, 31, 75, 507, 811, 2747, 317, 13545, 7395, 65161, 87987}}, {13157, 17, 63149, {1, 3, 5, 5, 13, 17, 11, 89, 371, 337, 913, 2775, 27, 4923, 24013, 62955, 65185}}, {13158, 17, 63150, {1, 3, 3, 7, 9, 27, 91, 187, 17, 443, 807, 853, 6243, 12351, 8123, 4203, 61021}}, {13159, 17, 63157, {1, 1, 1, 5, 9, 33, 101, 211, 205, 701, 1289, 1253, 653, 8591, 13009, 48525, 77051}}, {13160, 17, 63167, {1, 3, 5, 11, 5, 19, 1, 67, 259, 355, 15, 2169, 6785, 2019, 8675, 1019, 85903}}, {13161, 17, 63187, {1, 3, 7, 5, 27, 31, 103, 163, 369, 685, 659, 2009, 5819, 10437, 17311, 35083, 122125}}, {13162, 17, 63200, {1, 3, 5, 7, 19, 13, 93, 113, 377, 359, 1697, 4063, 4379, 9321, 7335, 25491, 85939}}, {13163, 17, 63220, {1, 3, 3, 5, 7, 25, 41, 225, 355, 257, 743, 2067, 7627, 14317, 7385, 25187, 63103}}, {13164, 17, 63223, {1, 1, 7, 7, 17, 43, 75, 1, 95, 547, 1937, 2263, 1709, 5067, 22651, 55733, 44619}}, {13165, 17, 63229, {1, 1, 7, 3, 5, 27, 45, 23, 107, 547, 1733, 1169, 6709, 861, 4439, 55381, 96447}}, {13166, 17, 63235, {1, 1, 7, 11, 25, 23, 127, 159, 489, 945, 843, 3715, 5215, 2131, 9681, 35515, 108109}}, {13167, 17, 63247, {1, 1, 3, 7, 5, 1, 67, 59, 83, 745, 1337, 855, 6087, 14319, 13405, 36261, 49091}}, {13168, 17, 63252, {1, 3, 1, 1, 13, 27, 41, 155, 463, 709, 1111, 2017, 4701, 8663, 29703, 45311, 113347}}, {13169, 17, 63255, {1, 1, 7, 5, 1, 11, 83, 101, 283, 505, 893, 705, 2331, 5127, 21793, 28095, 59055}}, {13170, 17, 63289, {1, 1, 5, 9, 25, 7, 97, 155, 71, 569, 1481, 897, 6177, 13367, 12163, 18171, 24785}}, {13171, 17, 63298, {1, 3, 5, 11, 19, 25, 7, 15, 511, 369, 957, 1247, 6097, 11181, 17265, 24777, 87377}}, {13172, 17, 63303, {1, 3, 1, 7, 11, 9, 39, 191, 9, 793, 867, 2779, 3447, 3805, 21025, 64719, 15669}}, {13173, 17, 63327, {1, 1, 3, 1, 31, 43, 107, 103, 175, 131, 1525, 993, 635, 14383, 26835, 15929, 109977}}, {13174, 17, 63328, {1, 1, 1, 3, 19, 17, 99, 249, 47, 467, 853, 2805, 3155, 1565, 17291, 18865, 11039}}, {13175, 17, 63348, {1, 1, 5, 13, 25, 61, 91, 67, 361, 947, 1909, 3403, 945, 3481, 16703, 50227, 43963}}, {13176, 17, 63355, {1, 3, 1, 3, 19, 27, 31, 219, 185, 579, 1539, 315, 4421, 9473, 30289, 48477, 61365}}, {13177, 17, 63357, {1, 1, 3, 1, 23, 11, 101, 1, 133, 305, 1107, 1145, 1733, 13275, 221, 5071, 81987}}, {13178, 17, 63368, {1, 1, 1, 13, 7, 61, 47, 5, 137, 979, 1183, 2049, 5263, 6515, 5585, 6093, 119689}}, {13179, 17, 63391, {1, 3, 1, 5, 19, 47, 83, 115, 215, 901, 1685, 755, 2327, 13297, 6847, 40329, 19225}}, {13180, 17, 63402, {1, 1, 3, 3, 3, 13, 31, 127, 199, 655, 55, 2183, 5031, 945, 6073, 54729, 108281}}, {13181, 17, 63409, {1, 1, 1, 1, 11, 51, 37, 19, 73, 205, 1377, 1881, 3679, 4487, 14693, 41735, 27349}}, {13182, 17, 63416, {1, 3, 7, 13, 1, 35, 37, 73, 45, 973, 209, 529, 5283, 9765, 26367, 12697, 8685}}, {13183, 17, 63419, {1, 3, 3, 9, 3, 45, 115, 35, 475, 663, 487, 3613, 4151, 15623, 3057, 31519, 87545}}, {13184, 17, 63430, {1, 3, 7, 5, 23, 13, 25, 255, 355, 433, 1671, 667, 7463, 14189, 14107, 1531, 11695}}, {13185, 17, 63442, {1, 1, 7, 3, 15, 25, 37, 127, 265, 493, 1763, 2721, 4335, 13753, 5947, 18375, 29911}}, {13186, 17, 63457, {1, 1, 3, 15, 1, 55, 25, 69, 335, 157, 1923, 1757, 5689, 6731, 723, 6471, 57415}}, {13187, 17, 63458, {1, 3, 3, 3, 1, 15, 127, 227, 401, 395, 503, 3783, 1737, 8785, 16287, 34949, 91683}}, {13188, 17, 63482, {1, 3, 5, 15, 23, 29, 55, 119, 115, 855, 657, 3729, 5309, 14773, 5647, 25953, 67303}}, {13189, 17, 63487, {1, 3, 5, 13, 23, 25, 1, 187, 67, 389, 359, 619, 2523, 11203, 11049, 60345, 53931}}, {13190, 17, 63488, {1, 3, 1, 7, 7, 45, 99, 123, 495, 797, 939, 3387, 7563, 16289, 8309, 14917, 99867}}, {13191, 17, 63500, {1, 3, 5, 11, 29, 49, 89, 205, 447, 541, 1279, 1153, 7277, 5393, 8743, 41057, 100119}}, {13192, 17, 63511, {1, 1, 1, 9, 1, 7, 43, 165, 259, 311, 993, 1381, 3363, 577, 4023, 443, 101785}}, {13193, 17, 63517, {1, 1, 7, 9, 25, 55, 93, 63, 423, 787, 549, 1039, 383, 15855, 6013, 51399, 60007}}, {13194, 17, 63528, {1, 3, 3, 1, 5, 17, 103, 91, 309, 85, 1319, 3869, 559, 3993, 18111, 17753, 66681}}, {13195, 17, 63531, {1, 3, 7, 9, 1, 11, 87, 151, 311, 597, 811, 3955, 275, 6555, 17005, 26763, 31227}}, {13196, 17, 63559, {1, 1, 3, 11, 19, 51, 41, 101, 183, 1003, 1635, 2061, 3305, 12925, 7223, 4859, 24433}}, {13197, 17, 63566, {1, 3, 7, 11, 7, 43, 79, 53, 43, 429, 947, 2533, 7005, 15147, 13435, 33997, 21201}}, {13198, 17, 63578, {1, 1, 3, 5, 15, 17, 61, 41, 383, 465, 1439, 3503, 3981, 14469, 5075, 25953, 70461}}, {13199, 17, 63580, {1, 1, 1, 13, 21, 53, 25, 59, 59, 195, 665, 3367, 2777, 9179, 24207, 56729, 94241}}, {13200, 17, 63584, {1, 3, 7, 15, 27, 13, 41, 147, 415, 351, 961, 3811, 1605, 14231, 31789, 41189, 50265}}, {13201, 17, 63587, {1, 3, 3, 7, 31, 39, 85, 219, 323, 657, 423, 1579, 3623, 7663, 14631, 47169, 88795}}, {13202, 17, 63594, {1, 3, 1, 3, 1, 3, 125, 65, 259, 3, 1897, 2203, 347, 4101, 23841, 20217, 117407}}, {13203, 17, 63607, {1, 1, 3, 7, 29, 1, 75, 255, 413, 237, 1531, 2103, 6847, 10395, 9817, 9383, 60679}}, {13204, 17, 63611, {1, 3, 5, 3, 7, 63, 17, 83, 375, 835, 1707, 3227, 327, 2205, 25025, 47471, 39967}}, {13205, 17, 63630, {1, 3, 7, 7, 9, 51, 23, 189, 157, 351, 755, 2695, 3923, 3481, 12159, 1041, 94563}}, {13206, 17, 63632, {1, 1, 3, 11, 25, 27, 39, 19, 221, 795, 523, 695, 3257, 8045, 2643, 43239, 13291}}, {13207, 17, 63641, {1, 3, 3, 5, 29, 1, 33, 117, 477, 147, 1117, 1943, 7967, 15999, 10673, 13349, 89471}}, {13208, 17, 63647, {1, 1, 3, 9, 17, 51, 55, 115, 147, 687, 1751, 3685, 3099, 15369, 371, 55673, 67951}}, {13209, 17, 63651, {1, 1, 7, 1, 5, 25, 67, 31, 103, 439, 1581, 705, 3855, 15985, 7151, 56511, 23697}}, {13210, 17, 63666, {1, 3, 5, 3, 21, 7, 11, 123, 121, 1009, 277, 623, 7913, 7525, 4759, 19245, 16735}}, {13211, 17, 63668, {1, 1, 5, 11, 7, 57, 103, 147, 199, 209, 233, 3665, 4215, 13511, 16393, 37873, 120857}}, {13212, 17, 63695, {1, 1, 7, 9, 27, 45, 29, 97, 279, 379, 1683, 1965, 1183, 11389, 20445, 38435, 56893}}, {13213, 17, 63697, {1, 3, 5, 5, 27, 23, 89, 169, 329, 659, 393, 903, 6217, 6459, 27327, 2843, 44889}}, {13214, 17, 63709, {1, 1, 1, 15, 3, 53, 109, 83, 195, 5, 1865, 729, 3627, 13307, 20761, 50375, 60379}}, {13215, 17, 63723, {1, 1, 1, 13, 25, 57, 17, 185, 359, 797, 469, 2637, 973, 2731, 25299, 15169, 90187}}, {13216, 17, 63737, {1, 3, 5, 1, 19, 39, 87, 161, 117, 565, 1737, 3995, 6487, 5067, 18531, 38803, 45453}}, {13217, 17, 63746, {1, 1, 1, 5, 19, 3, 93, 85, 479, 369, 469, 1407, 475, 7775, 12273, 34417, 65611}}, {13218, 17, 63752, {1, 1, 3, 15, 31, 11, 105, 19, 281, 711, 713, 3423, 797, 11215, 31409, 44891, 110413}}, {13219, 17, 63755, {1, 1, 3, 11, 13, 17, 59, 111, 59, 431, 1517, 2159, 1697, 12309, 16293, 2097, 107273}}, {13220, 17, 63775, {1, 3, 5, 15, 25, 19, 97, 107, 97, 563, 247, 3691, 2775, 10631, 15113, 25721, 12995}}, {13221, 17, 63781, {1, 1, 5, 3, 31, 25, 47, 201, 231, 123, 1923, 2287, 1711, 12271, 1573, 6605, 72991}}, {13222, 17, 63794, {1, 1, 5, 5, 27, 17, 109, 125, 423, 1, 819, 3041, 685, 8791, 19697, 13107, 67681}}, {13223, 17, 63796, {1, 1, 5, 3, 5, 63, 115, 95, 117, 715, 1523, 1231, 8171, 1615, 9819, 14361, 87075}}, {13224, 17, 63808, {1, 1, 7, 7, 7, 35, 35, 175, 349, 853, 1665, 3101, 6051, 10737, 933, 40591, 9419}}, {13225, 17, 63817, {1, 1, 1, 3, 23, 49, 65, 23, 103, 837, 403, 3799, 6515, 15363, 28079, 36381, 59523}}, {13226, 17, 63820, {1, 3, 1, 15, 15, 25, 119, 181, 229, 685, 1047, 2397, 4855, 15393, 2371, 42441, 30151}}, {13227, 17, 63826, {1, 3, 7, 11, 15, 5, 13, 93, 219, 203, 475, 523, 5827, 6579, 26759, 29795, 108463}}, {13228, 17, 63838, {1, 1, 7, 13, 25, 53, 75, 195, 443, 1003, 501, 2543, 5453, 3119, 19225, 59631, 16413}}, {13229, 17, 63848, {1, 1, 7, 13, 13, 25, 93, 211, 191, 1005, 1567, 3057, 3001, 1125, 6237, 35725, 108257}}, {13230, 17, 63861, {1, 1, 3, 7, 21, 11, 57, 205, 487, 263, 1801, 3235, 1819, 10875, 6063, 26211, 54699}}, {13231, 17, 63862, {1, 3, 3, 7, 11, 59, 89, 217, 15, 991, 1343, 1247, 277, 13377, 18499, 64987, 26053}}, {13232, 17, 63866, {1, 3, 3, 1, 15, 51, 111, 69, 137, 817, 1207, 1729, 3877, 9873, 18449, 50749, 57457}}, {13233, 17, 63878, {1, 3, 3, 5, 3, 39, 97, 147, 327, 257, 1547, 769, 7077, 5221, 13679, 44237, 70053}}, {13234, 17, 63889, {1, 1, 5, 11, 19, 15, 79, 187, 335, 645, 1235, 4041, 4831, 10847, 28135, 48353, 64921}}, {13235, 17, 63892, {1, 1, 7, 9, 3, 43, 41, 149, 71, 205, 1513, 2801, 6785, 3187, 25401, 55367, 114491}}, {13236, 17, 63901, {1, 1, 7, 1, 25, 11, 37, 205, 365, 435, 147, 1303, 587, 14563, 32461, 28983, 86157}}, {13237, 17, 63915, {1, 1, 7, 1, 31, 11, 51, 37, 401, 343, 1677, 991, 501, 11993, 14781, 37055, 30161}}, {13238, 17, 63917, {1, 3, 5, 9, 9, 21, 95, 45, 447, 957, 943, 3997, 4033, 8371, 25007, 52827, 50207}}, {13239, 17, 63926, {1, 1, 7, 1, 9, 45, 3, 255, 297, 341, 215, 3631, 7049, 7625, 4145, 50109, 48615}}, {13240, 17, 63932, {1, 3, 3, 9, 27, 49, 41, 143, 291, 343, 719, 311, 3819, 7699, 17631, 64785, 49239}}, {13241, 17, 63937, {1, 1, 7, 3, 27, 35, 61, 183, 153, 781, 979, 1465, 3315, 14893, 29847, 18461, 74949}}, {13242, 17, 63938, {1, 3, 5, 15, 19, 61, 39, 219, 279, 909, 1295, 1681, 8021, 957, 7675, 14001, 77669}}, {13243, 17, 63943, {1, 3, 1, 5, 15, 59, 127, 85, 229, 649, 503, 3267, 2465, 5637, 2729, 24831, 44791}}, {13244, 17, 63944, {1, 3, 7, 11, 23, 55, 61, 191, 345, 255, 105, 1361, 3913, 7655, 8865, 1825, 80619}}, {13245, 17, 63950, {1, 3, 3, 13, 29, 15, 53, 19, 1, 651, 917, 2043, 2333, 13695, 28225, 16457, 11287}}, {13246, 17, 63952, {1, 1, 3, 13, 15, 53, 41, 211, 13, 287, 383, 3923, 665, 10343, 4803, 22199, 90521}}, {13247, 17, 63955, {1, 3, 7, 11, 23, 27, 127, 241, 11, 451, 495, 2779, 319, 13119, 5575, 43043, 11659}}, {13248, 17, 63957, {1, 1, 1, 7, 17, 53, 55, 39, 233, 273, 1873, 843, 7885, 329, 6809, 33119, 116017}}, {13249, 17, 63961, {1, 1, 1, 7, 21, 41, 23, 113, 283, 265, 1535, 2371, 3975, 6293, 22497, 65349, 48653}}, {13250, 17, 63962, {1, 3, 7, 9, 25, 21, 61, 135, 245, 777, 679, 2603, 565, 3251, 32469, 12707, 40297}}, {13251, 17, 63978, {1, 1, 1, 5, 31, 49, 35, 215, 445, 669, 779, 2231, 5399, 5853, 17941, 33973, 126141}}, {13252, 17, 63983, {1, 3, 5, 5, 3, 31, 45, 235, 51, 65, 295, 3755, 8101, 821, 28331, 38837, 55235}}, {13253, 17, 63988, {1, 1, 5, 15, 23, 15, 37, 197, 59, 455, 1875, 1745, 7565, 8039, 15901, 63129, 36095}}, {13254, 17, 64008, {1, 1, 5, 11, 7, 1, 77, 235, 309, 245, 1539, 1421, 3401, 1477, 12655, 19851, 86147}}, {13255, 17, 64013, {1, 1, 3, 9, 27, 9, 113, 127, 167, 213, 161, 4065, 1275, 10699, 26111, 26213, 129091}}, {13256, 17, 64019, {1, 3, 5, 9, 9, 17, 109, 205, 23, 145, 1261, 51, 5855, 7411, 20551, 5801, 47841}}, {13257, 17, 64026, {1, 1, 3, 3, 15, 1, 1, 39, 431, 601, 177, 525, 6951, 6271, 27031, 37157, 73979}}, {13258, 17, 64028, {1, 3, 1, 3, 19, 61, 11, 131, 31, 223, 959, 3531, 2433, 15675, 29201, 49277, 43977}}, {13259, 17, 64032, {1, 1, 5, 9, 5, 27, 57, 3, 503, 755, 1261, 3659, 6685, 10041, 24739, 12201, 19753}}, {13260, 17, 64042, {1, 1, 7, 3, 31, 27, 7, 191, 7, 415, 1665, 1413, 7493, 2645, 23577, 46331, 9481}}, {13261, 17, 64044, {1, 1, 5, 1, 29, 59, 99, 231, 33, 613, 1347, 2671, 1767, 15685, 26583, 44699, 73511}}, {13262, 17, 64055, {1, 1, 3, 3, 9, 47, 93, 87, 45, 549, 219, 2141, 233, 10239, 30325, 14985, 70325}}, {13263, 17, 64070, {1, 1, 3, 3, 21, 39, 81, 179, 319, 853, 93, 2869, 59, 6675, 22391, 16089, 33949}}, {13264, 17, 64079, {1, 1, 3, 7, 31, 19, 73, 249, 175, 57, 1717, 3557, 2307, 4595, 22045, 33291, 123003}}, {13265, 17, 64084, {1, 1, 1, 3, 7, 23, 81, 229, 387, 1001, 1371, 17, 667, 3043, 30507, 44613, 32239}}, {13266, 17, 64087, {1, 1, 7, 15, 15, 59, 83, 99, 101, 863, 333, 845, 7547, 13345, 7599, 51, 10963}}, {13267, 17, 64093, {1, 1, 1, 3, 15, 55, 73, 37, 429, 711, 1315, 2911, 5109, 953, 14721, 25551, 33527}}, {13268, 17, 64100, {1, 1, 5, 9, 11, 57, 75, 107, 449, 293, 1267, 2633, 5291, 9939, 12365, 1975, 75705}}, {13269, 17, 64104, {1, 3, 3, 7, 19, 51, 111, 233, 369, 873, 1419, 425, 6587, 11371, 29613, 28041, 77405}}, {13270, 17, 64109, {1, 3, 1, 15, 11, 1, 65, 185, 301, 25, 75, 1353, 6879, 11519, 24093, 65223, 130659}}, {13271, 17, 64140, {1, 1, 3, 3, 17, 17, 33, 177, 467, 841, 949, 1119, 7869, 5835, 22175, 20439, 98923}}, {13272, 17, 64148, {1, 3, 1, 9, 1, 19, 1, 9, 487, 425, 1095, 1995, 693, 12661, 27717, 56167, 34829}}, {13273, 17, 64151, {1, 1, 7, 7, 27, 57, 85, 159, 109, 801, 477, 3953, 3195, 11079, 26885, 59833, 4971}}, {13274, 17, 64152, {1, 1, 1, 15, 25, 9, 89, 231, 499, 623, 1385, 3753, 4781, 15263, 12721, 17511, 67327}}, {13275, 17, 64171, {1, 1, 3, 7, 9, 11, 103, 65, 319, 681, 1423, 2355, 6243, 399, 8483, 23697, 107995}}, {13276, 17, 64179, {1, 1, 1, 1, 5, 7, 63, 117, 151, 905, 163, 3813, 6931, 13161, 15131, 63067, 15649}}, {13277, 17, 64186, {1, 3, 3, 3, 13, 57, 69, 199, 283, 153, 617, 123, 3125, 3057, 8121, 14483, 28085}}, {13278, 17, 64203, {1, 3, 7, 15, 25, 45, 25, 179, 91, 457, 681, 537, 243, 4369, 11395, 17565, 47875}}, {13279, 17, 64206, {1, 3, 1, 13, 29, 51, 101, 23, 143, 715, 1725, 791, 6001, 4283, 10689, 49237, 5231}}, {13280, 17, 64213, {1, 3, 3, 5, 27, 41, 39, 17, 501, 587, 1067, 1859, 9, 13449, 31257, 17675, 99769}}, {13281, 17, 64214, {1, 1, 1, 3, 15, 57, 119, 195, 15, 779, 761, 733, 3505, 4815, 23167, 411, 52303}}, {13282, 17, 64220, {1, 3, 1, 13, 9, 31, 5, 141, 19, 487, 739, 577, 4383, 1951, 24293, 45503, 111923}}, {13283, 17, 64233, {1, 3, 1, 11, 25, 37, 107, 245, 89, 107, 1969, 1569, 7475, 11795, 6123, 45311, 52251}}, {13284, 17, 64239, {1, 1, 7, 11, 15, 9, 67, 141, 199, 91, 819, 3721, 6251, 6107, 9393, 14941, 98545}}, {13285, 17, 64248, {1, 3, 3, 11, 23, 9, 31, 211, 339, 665, 1507, 2255, 3589, 11495, 28393, 2017, 106735}}, {13286, 17, 64251, {1, 3, 5, 11, 27, 13, 105, 217, 173, 337, 1573, 837, 3771, 8645, 28749, 27501, 45045}}, {13287, 17, 64259, {1, 1, 5, 1, 11, 43, 99, 217, 131, 545, 1323, 3089, 5689, 785, 9043, 29961, 17855}}, {13288, 17, 64268, {1, 1, 3, 9, 31, 41, 61, 239, 271, 123, 1583, 397, 4243, 12197, 9847, 12341, 130533}}, {13289, 17, 64273, {1, 3, 5, 3, 27, 11, 33, 31, 77, 403, 823, 2791, 3475, 4201, 15967, 39149, 107137}}, {13290, 17, 64279, {1, 3, 1, 11, 9, 5, 103, 145, 85, 341, 1615, 729, 7209, 10289, 20807, 54167, 15613}}, {13291, 17, 64283, {1, 3, 7, 1, 29, 33, 91, 219, 171, 367, 907, 3645, 1059, 9031, 247, 13231, 14323}}, {13292, 17, 64292, {1, 1, 1, 7, 19, 15, 65, 61, 221, 941, 1005, 1447, 3513, 8917, 17399, 52471, 64245}}, {13293, 17, 64296, {1, 1, 5, 7, 5, 35, 15, 253, 325, 313, 2015, 3239, 1633, 9745, 11617, 10575, 35877}}, {13294, 17, 64301, {1, 3, 5, 3, 13, 1, 115, 207, 227, 637, 1119, 781, 2897, 1573, 16499, 43167, 20631}}, {13295, 17, 64302, {1, 3, 5, 9, 17, 47, 117, 7, 303, 719, 975, 1167, 2463, 5255, 28237, 33495, 57133}}, {13296, 17, 64324, {1, 3, 5, 11, 5, 43, 123, 63, 19, 97, 1423, 695, 5985, 5923, 5755, 22721, 5411}}, {13297, 17, 64331, {1, 3, 1, 9, 9, 25, 87, 197, 325, 827, 1679, 1561, 101, 3951, 17453, 33537, 121431}}, {13298, 17, 64346, {1, 1, 7, 5, 13, 33, 3, 191, 171, 37, 619, 1917, 7525, 14103, 25807, 25455, 57455}}, {13299, 17, 64364, {1, 3, 3, 1, 9, 35, 93, 159, 455, 115, 479, 665, 477, 4483, 29751, 45047, 41251}}, {13300, 17, 64382, {1, 3, 1, 3, 11, 47, 41, 199, 511, 475, 151, 1163, 239, 6731, 4461, 39845, 99555}}, {13301, 17, 64386, {1, 1, 5, 7, 9, 5, 49, 221, 503, 637, 1323, 3303, 4137, 6675, 17709, 49233, 38325}}, {13302, 17, 64400, {1, 1, 5, 15, 1, 43, 55, 67, 291, 393, 237, 3555, 4171, 909, 8655, 46309, 61799}}, {13303, 17, 64409, {1, 3, 5, 3, 3, 37, 125, 249, 509, 611, 983, 4093, 1633, 10063, 10811, 60033, 40999}}, {13304, 17, 64419, {1, 3, 5, 11, 1, 37, 75, 255, 279, 545, 1999, 833, 2789, 14601, 16707, 64703, 53545}}, {13305, 17, 64433, {1, 1, 5, 7, 3, 15, 59, 11, 17, 711, 721, 765, 3747, 13549, 28641, 47437, 42261}}, {13306, 17, 64454, {1, 3, 7, 1, 3, 45, 65, 45, 279, 929, 933, 2215, 7095, 14593, 6047, 40747, 109789}}, {13307, 17, 64458, {1, 3, 7, 15, 15, 55, 89, 155, 345, 515, 1005, 2921, 1761, 1095, 28463, 20971, 62451}}, {13308, 17, 64482, {1, 3, 3, 1, 1, 41, 35, 149, 481, 171, 305, 1411, 237, 4515, 32375, 22645, 741}}, {13309, 17, 64494, {1, 1, 1, 15, 17, 1, 123, 235, 221, 495, 1693, 3109, 6453, 8827, 23775, 9303, 30237}}, {13310, 17, 64496, {1, 3, 3, 5, 7, 63, 37, 13, 457, 159, 1683, 2207, 1731, 3341, 7415, 21073, 119417}}, {13311, 17, 64505, {1, 1, 7, 15, 21, 27, 5, 67, 267, 919, 203, 1129, 4029, 3407, 16767, 35485, 66903}}, {13312, 17, 64514, {1, 1, 1, 5, 15, 29, 99, 5, 219, 677, 443, 3799, 2461, 747, 20885, 32661, 44079}}, {13313, 17, 64519, {1, 1, 1, 1, 3, 55, 53, 151, 195, 587, 1155, 2439, 3817, 8735, 30849, 54107, 14113}}, {13314, 17, 64525, {1, 1, 1, 9, 29, 15, 89, 175, 373, 925, 301, 3749, 5439, 2653, 22819, 41201, 77043}}, {13315, 17, 64528, {1, 1, 1, 1, 25, 49, 29, 129, 331, 539, 1247, 773, 7891, 5905, 19571, 17919, 6815}}, {13316, 17, 64534, {1, 1, 3, 15, 5, 63, 123, 133, 141, 383, 1893, 573, 629, 3939, 9455, 50433, 111415}}, {13317, 17, 64561, {1, 1, 7, 9, 15, 33, 119, 159, 17, 511, 1841, 427, 3911, 8609, 4215, 9799, 84397}}, {13318, 17, 64571, {1, 1, 7, 3, 9, 25, 63, 247, 235, 635, 915, 3423, 5421, 7021, 9203, 18121, 3683}}, {13319, 17, 64579, {1, 3, 1, 1, 25, 11, 105, 1, 491, 137, 1923, 103, 3371, 3543, 5173, 36777, 23417}}, {13320, 17, 64591, {1, 3, 3, 13, 19, 37, 93, 191, 101, 193, 351, 839, 7147, 5477, 29225, 45307, 1455}}, {13321, 17, 64606, {1, 3, 1, 5, 11, 17, 95, 239, 105, 407, 395, 919, 3317, 14825, 23447, 4897, 128363}}, {13322, 17, 64616, {1, 1, 1, 11, 27, 47, 83, 137, 163, 673, 1291, 3041, 4559, 7217, 23613, 19477, 93805}}, {13323, 17, 64619, {1, 1, 1, 15, 25, 51, 37, 9, 23, 757, 1921, 2649, 5677, 11421, 10231, 1775, 124709}}, {13324, 17, 64640, {1, 3, 1, 13, 31, 37, 37, 163, 59, 975, 1203, 1425, 1255, 3259, 16681, 38101, 118165}}, {13325, 17, 64645, {1, 1, 3, 11, 17, 17, 31, 23, 169, 305, 3, 1631, 6853, 7019, 14539, 57663, 70377}}, {13326, 17, 64649, {1, 1, 7, 3, 15, 61, 113, 31, 497, 935, 473, 819, 1223, 13907, 5075, 45177, 20255}}, {13327, 17, 64652, {1, 3, 7, 13, 9, 41, 123, 121, 497, 877, 915, 3323, 4815, 4175, 25979, 38751, 107099}}, {13328, 17, 64670, {1, 1, 3, 7, 13, 33, 31, 167, 331, 595, 517, 1237, 1947, 1905, 28155, 52431, 93065}}, {13329, 17, 64673, {1, 3, 1, 1, 11, 51, 7, 151, 323, 211, 523, 2929, 233, 3633, 2785, 6043, 100101}}, {13330, 17, 64674, {1, 1, 7, 13, 29, 3, 125, 247, 121, 567, 857, 3225, 7461, 15413, 773, 54939, 67443}}, {13331, 17, 64683, {1, 1, 1, 15, 19, 29, 101, 179, 369, 115, 1777, 3223, 1499, 12487, 41, 50607, 111137}}, {13332, 17, 64697, {1, 1, 3, 1, 9, 59, 21, 25, 173, 357, 1143, 1353, 3907, 10743, 30325, 39211, 116671}}, {13333, 17, 64703, {1, 1, 7, 15, 9, 63, 67, 229, 7, 399, 2037, 3531, 6393, 4273, 9365, 52009, 118093}}, {13334, 17, 64711, {1, 1, 7, 1, 31, 21, 5, 251, 433, 1, 481, 4041, 6179, 825, 8671, 20597, 103257}}, {13335, 17, 64723, {1, 1, 7, 1, 15, 41, 69, 93, 47, 17, 1901, 2671, 4739, 1883, 30239, 50763, 108295}}, {13336, 17, 64736, {1, 3, 7, 15, 29, 19, 63, 213, 475, 133, 43, 955, 2001, 555, 10479, 1333, 52807}}, {13337, 17, 64739, {1, 3, 3, 15, 27, 13, 91, 109, 71, 333, 1971, 3355, 2175, 11457, 31101, 30217, 68263}}, {13338, 17, 64741, {1, 1, 5, 1, 21, 33, 51, 169, 365, 475, 1015, 985, 7217, 15453, 7727, 49843, 57733}}, {13339, 17, 64748, {1, 1, 7, 1, 11, 37, 67, 135, 429, 403, 1663, 2037, 7849, 3757, 6373, 38703, 46393}}, {13340, 17, 64759, {1, 1, 1, 3, 15, 3, 29, 101, 327, 643, 47, 1805, 6873, 1659, 31097, 34847, 46843}}, {13341, 17, 64768, {1, 3, 1, 15, 9, 45, 7, 189, 175, 955, 45, 3545, 3595, 7443, 2913, 54501, 63279}}, {13342, 17, 64771, {1, 3, 7, 11, 1, 39, 59, 179, 209, 121, 445, 4077, 4851, 15161, 29133, 13543, 106247}}, {13343, 17, 64778, {1, 3, 7, 7, 5, 53, 73, 107, 409, 639, 1731, 1921, 999, 14445, 17629, 3667, 74819}}, {13344, 17, 64792, {1, 3, 3, 9, 23, 41, 117, 195, 497, 425, 627, 1599, 7715, 1401, 7217, 61113, 67135}}, {13345, 17, 64821, {1, 1, 5, 13, 9, 33, 97, 115, 233, 833, 1041, 1755, 5317, 12703, 25709, 62293, 2569}}, {13346, 17, 64831, {1, 1, 1, 11, 1, 7, 27, 151, 325, 905, 1279, 4093, 7495, 9803, 17339, 7977, 24009}}, {13347, 17, 64839, {1, 3, 1, 11, 25, 59, 89, 175, 67, 139, 1507, 411, 7863, 9585, 14869, 46655, 126021}}, {13348, 17, 64848, {1, 3, 3, 15, 29, 5, 111, 251, 69, 177, 519, 901, 4331, 5341, 22031, 3851, 114369}}, {13349, 17, 64860, {1, 3, 5, 3, 19, 9, 83, 69, 411, 673, 1549, 3429, 3647, 12601, 17177, 16161, 114561}}, {13350, 17, 64867, {1, 1, 5, 5, 21, 15, 65, 179, 405, 571, 1245, 3693, 7471, 12109, 20177, 28783, 124339}}, {13351, 17, 64870, {1, 1, 5, 5, 9, 61, 69, 99, 9, 829, 1823, 3803, 1181, 3073, 10069, 28689, 21347}}, {13352, 17, 64874, {1, 1, 5, 1, 3, 11, 25, 99, 241, 957, 1137, 7, 3809, 7073, 21217, 49447, 41425}}, {13353, 17, 64879, {1, 3, 1, 9, 15, 59, 13, 29, 467, 893, 1667, 31, 3269, 12599, 28673, 17101, 81591}}, {13354, 17, 64887, {1, 3, 7, 3, 15, 55, 79, 177, 1, 891, 217, 2725, 6171, 7779, 16173, 1003, 37093}}, {13355, 17, 64894, {1, 3, 7, 11, 15, 61, 13, 181, 421, 83, 905, 1089, 4597, 3291, 23243, 53123, 21315}}, {13356, 17, 64897, {1, 1, 3, 3, 21, 63, 113, 149, 203, 379, 583, 1955, 8087, 9155, 23019, 17757, 1537}}, {13357, 17, 64898, {1, 3, 5, 9, 27, 41, 61, 207, 213, 253, 693, 273, 1835, 14135, 11519, 40819, 50999}}, {13358, 17, 64921, {1, 3, 5, 3, 1, 51, 71, 237, 355, 327, 1903, 133, 6075, 4685, 29689, 48723, 67791}}, {13359, 17, 64933, {1, 3, 5, 9, 21, 13, 101, 23, 95, 369, 1657, 989, 4081, 1373, 29005, 7247, 53923}}, {13360, 17, 64940, {1, 1, 7, 13, 15, 3, 71, 189, 345, 771, 251, 937, 1041, 3017, 27279, 1635, 32581}}, {13361, 17, 64957, {1, 1, 5, 7, 23, 63, 99, 43, 237, 189, 1549, 25, 63, 14089, 14387, 51423, 57193}}, {13362, 17, 64969, {1, 1, 7, 15, 13, 55, 89, 87, 95, 241, 827, 501, 2341, 14357, 831, 27101, 98285}}, {13363, 17, 64972, {1, 1, 1, 9, 29, 29, 125, 81, 73, 123, 329, 2617, 1259, 4415, 30007, 19467, 117847}}, {13364, 17, 64978, {1, 3, 1, 11, 15, 63, 85, 121, 409, 885, 1197, 423, 2673, 12107, 1127, 14119, 90541}}, {13365, 17, 64984, {1, 3, 1, 3, 1, 35, 117, 149, 213, 925, 923, 1013, 3547, 6877, 3467, 47893, 38645}}, {13366, 17, 64993, {1, 1, 3, 15, 3, 21, 87, 199, 197, 851, 1711, 3449, 1771, 1727, 11651, 51903, 99835}}, {13367, 17, 64999, {1, 3, 3, 1, 5, 27, 57, 243, 465, 173, 697, 4011, 6177, 3019, 31317, 24699, 53151}}, {13368, 17, 65000, {1, 3, 5, 7, 7, 51, 61, 177, 489, 381, 493, 1975, 3143, 8003, 7735, 46363, 110705}}, {13369, 17, 65006, {1, 1, 7, 5, 27, 45, 69, 33, 229, 725, 2033, 3655, 3027, 11795, 2941, 7921, 117605}}, {13370, 17, 65011, {1, 3, 1, 7, 3, 37, 91, 255, 13, 651, 49, 309, 7425, 11641, 3661, 3929, 94199}}, {13371, 17, 65014, {1, 3, 7, 5, 7, 47, 121, 203, 297, 941, 1585, 3659, 265, 159, 30729, 31825, 343}}, {13372, 17, 65036, {1, 3, 5, 9, 3, 25, 95, 215, 125, 105, 37, 943, 4095, 8169, 26763, 20975, 122307}}, {13373, 17, 65044, {1, 1, 3, 15, 9, 13, 81, 25, 51, 15, 599, 835, 6723, 9487, 25219, 60401, 48749}}, {13374, 17, 65063, {1, 3, 3, 15, 15, 47, 41, 219, 77, 43, 1705, 2363, 7005, 7137, 17687, 665, 116097}}, {13375, 17, 65067, {1, 3, 5, 1, 17, 33, 71, 3, 253, 355, 117, 1995, 3339, 11789, 13563, 58889, 18553}}, {13376, 17, 65075, {1, 3, 5, 1, 21, 33, 89, 177, 9, 951, 1593, 1419, 3295, 9617, 31661, 7841, 119939}}, {13377, 17, 65077, {1, 3, 3, 1, 31, 35, 25, 9, 379, 271, 923, 2387, 3351, 5869, 4501, 6855, 28273}}, {13378, 17, 65082, {1, 1, 5, 9, 11, 15, 127, 79, 405, 579, 395, 2469, 5847, 7589, 17577, 61717, 6493}}, {13379, 17, 65095, {1, 3, 7, 13, 29, 13, 99, 209, 79, 469, 5, 2231, 89, 1557, 5123, 47169, 46529}}, {13380, 17, 65101, {1, 3, 7, 9, 13, 35, 119, 53, 7, 351, 601, 901, 5407, 13673, 6929, 38311, 2659}}, {13381, 17, 65104, {1, 3, 7, 9, 13, 23, 61, 255, 113, 331, 367, 2979, 2741, 6971, 26447, 6861, 116267}}, {13382, 17, 65109, {1, 1, 3, 3, 25, 57, 93, 5, 387, 87, 1765, 1277, 8175, 11185, 4377, 9779, 95569}}, {13383, 17, 65110, {1, 1, 7, 11, 29, 43, 31, 155, 111, 409, 733, 1919, 2681, 8435, 5877, 35439, 15435}}, {13384, 17, 65116, {1, 1, 1, 7, 19, 33, 109, 125, 51, 733, 997, 3467, 5081, 8371, 263, 31461, 46117}}, {13385, 17, 65126, {1, 3, 3, 7, 27, 61, 57, 75, 317, 247, 1535, 3757, 4617, 15627, 11191, 3581, 64475}}, {13386, 17, 65129, {1, 3, 3, 1, 31, 7, 95, 151, 159, 475, 559, 379, 361, 5953, 5551, 20313, 64015}}, {13387, 17, 65138, {1, 1, 5, 1, 11, 31, 71, 77, 493, 697, 345, 1809, 611, 14319, 6591, 23657, 44071}}, {13388, 17, 65160, {1, 1, 1, 13, 5, 1, 9, 233, 229, 397, 1201, 1817, 7409, 11521, 3753, 35611, 123037}}, {13389, 17, 65171, {1, 3, 7, 15, 9, 15, 85, 163, 99, 867, 265, 1021, 129, 11059, 123, 27185, 68435}}, {13390, 17, 65173, {1, 3, 1, 11, 25, 43, 105, 165, 291, 977, 463, 2699, 5361, 9951, 29735, 63501, 86235}}, {13391, 17, 65180, {1, 3, 7, 13, 9, 33, 39, 145, 441, 233, 373, 193, 1451, 7975, 2871, 64431, 43339}}, {13392, 17, 65189, {1, 1, 7, 13, 15, 25, 45, 27, 319, 719, 1801, 447, 3027, 769, 271, 37227, 26447}}, {13393, 17, 65193, {1, 1, 5, 1, 29, 1, 59, 59, 121, 251, 387, 55, 5957, 10527, 24227, 38841, 29115}}, {13394, 17, 65208, {1, 3, 1, 5, 31, 25, 67, 191, 137, 849, 631, 953, 3103, 9737, 28993, 49413, 60709}}, {13395, 17, 65214, {1, 3, 3, 15, 7, 5, 37, 179, 357, 961, 1649, 441, 5287, 4161, 24013, 39661, 76233}}, {13396, 17, 65216, {1, 1, 5, 1, 9, 1, 47, 209, 219, 1021, 969, 2343, 5675, 7137, 14247, 50305, 72613}}, {13397, 17, 65225, {1, 1, 3, 1, 9, 43, 43, 47, 35, 97, 617, 1033, 2387, 14155, 17049, 53333, 108619}}, {13398, 17, 65236, {1, 3, 1, 3, 1, 45, 11, 171, 349, 65, 909, 1801, 1075, 10905, 7395, 19997, 128205}}, {13399, 17, 65239, {1, 1, 7, 11, 19, 39, 117, 175, 459, 791, 1383, 3473, 6937, 8447, 10077, 13353, 122063}}, {13400, 17, 65273, {1, 3, 3, 9, 3, 27, 115, 29, 135, 305, 1023, 2517, 1981, 4969, 18149, 35565, 120785}}, {13401, 17, 65274, {1, 3, 3, 11, 15, 23, 27, 115, 411, 805, 841, 2205, 5997, 5141, 10679, 25235, 81989}}, {13402, 17, 65281, {1, 1, 3, 9, 11, 63, 27, 185, 337, 891, 1447, 1397, 8009, 4453, 23077, 37599, 93389}}, {13403, 17, 65294, {1, 1, 5, 13, 27, 11, 77, 11, 447, 81, 1603, 2317, 6499, 6631, 27305, 51049, 40967}}, {13404, 17, 65324, {1, 3, 7, 1, 7, 43, 83, 33, 69, 119, 139, 1391, 4879, 3759, 31211, 29203, 110229}}, {13405, 17, 65335, {1, 3, 7, 15, 31, 59, 53, 97, 135, 233, 1421, 587, 2985, 3627, 7355, 53829, 51581}}, {13406, 17, 65354, {1, 3, 7, 15, 1, 37, 39, 225, 147, 37, 327, 2819, 6081, 4337, 22063, 21177, 91065}}, {13407, 17, 65359, {1, 1, 3, 1, 13, 31, 61, 133, 433, 243, 131, 3625, 6389, 335, 24029, 33217, 80833}}, {13408, 17, 65373, {1, 1, 7, 11, 21, 39, 95, 181, 35, 499, 677, 3935, 1379, 6791, 12633, 13671, 28317}}, {13409, 17, 65383, {1, 3, 1, 5, 7, 57, 5, 229, 389, 197, 1523, 1221, 609, 10449, 6389, 9279, 53871}}, {13410, 17, 65387, {1, 3, 5, 7, 1, 39, 69, 131, 387, 839, 1375, 3841, 81, 7395, 5837, 32067, 51183}}, {13411, 17, 65397, {1, 1, 5, 3, 5, 27, 107, 171, 53, 923, 345, 445, 1101, 11201, 20563, 30889, 72361}}, {13412, 17, 65411, {1, 3, 7, 11, 19, 7, 99, 219, 485, 403, 293, 3967, 7517, 4765, 11331, 55, 92641}}, {13413, 17, 65413, {1, 1, 7, 13, 19, 9, 73, 31, 405, 513, 941, 3645, 7075, 8109, 21431, 52791, 120927}}, {13414, 17, 65418, {1, 1, 1, 15, 29, 33, 75, 65, 479, 47, 35, 4023, 4853, 2793, 29895, 2711, 83779}}, {13415, 17, 65441, {1, 1, 3, 15, 11, 1, 9, 149, 503, 845, 647, 1233, 4355, 3623, 3197, 36015, 24839}}, {13416, 17, 65444, {1, 1, 7, 1, 31, 35, 59, 25, 393, 503, 227, 3243, 301, 11121, 32463, 38185, 69969}}, {13417, 17, 65447, {1, 1, 1, 7, 9, 15, 11, 89, 19, 605, 1657, 3335, 1967, 29, 28619, 42301, 79909}}, {13418, 17, 65448, {1, 3, 7, 7, 19, 29, 111, 55, 299, 733, 547, 395, 4831, 1991, 7357, 25781, 115129}}, {13419, 17, 65473, {1, 1, 3, 7, 5, 33, 31, 101, 163, 389, 1163, 1843, 4105, 14209, 29261, 5821, 17929}}, {13420, 17, 65476, {1, 3, 5, 1, 11, 23, 53, 227, 497, 695, 313, 3305, 6549, 15401, 9339, 40283, 60531}}, {13421, 17, 65480, {1, 3, 5, 5, 3, 29, 77, 149, 509, 747, 85, 2561, 4435, 14475, 22887, 38177, 24535}}, {13422, 17, 65494, {1, 1, 7, 1, 1, 33, 7, 77, 153, 369, 689, 3325, 1173, 16203, 1499, 36627, 66915}}, {13423, 17, 65509, {1, 1, 5, 11, 23, 61, 95, 61, 289, 71, 653, 2817, 365, 7391, 1613, 48901, 57471}}, {13424, 17, 65519, {1, 3, 3, 7, 15, 29, 65, 133, 15, 921, 1601, 1941, 6917, 10945, 20101, 59809, 9017}}, {13425, 17, 65527, {1, 3, 3, 15, 7, 51, 95, 53, 87, 1017, 1039, 3405, 1967, 9855, 4905, 4651, 83487}}, {13426, 18, 19, {1, 3, 5, 13, 23, 27, 31, 179, 121, 597, 829, 4003, 2487, 3977, 3087, 26791, 28305, 138357}}, {13427, 18, 31, {1, 1, 5, 5, 5, 39, 95, 117, 461, 117, 109, 2571, 7651, 12361, 17921, 555, 33353, 186427}}, {13428, 18, 38, {1, 1, 3, 13, 23, 47, 89, 125, 271, 609, 215, 3861, 6883, 3217, 2547, 54943, 60565, 215939}}, {13429, 18, 61, {1, 1, 7, 15, 25, 61, 47, 93, 219, 919, 1551, 1417, 2753, 4353, 9201, 46423, 31227, 150649}}, {13430, 18, 64, {1, 1, 1, 3, 29, 39, 11, 61, 137, 809, 147, 2715, 5455, 9431, 5725, 46135, 118193, 54099}}, {13431, 18, 109, {1, 1, 3, 1, 25, 37, 83, 211, 423, 779, 1731, 2827, 883, 10477, 28771, 21723, 114333, 56293}}, {13432, 18, 115, {1, 1, 5, 5, 27, 17, 21, 125, 495, 655, 1803, 3555, 1997, 15593, 29705, 48537, 53935, 179773}}, {13433, 18, 118, {1, 1, 7, 5, 19, 63, 55, 15, 469, 769, 967, 3047, 1713, 11655, 15313, 29965, 78857, 223391}}, {13434, 18, 131, {1, 3, 3, 5, 27, 33, 51, 171, 417, 243, 1203, 3505, 2533, 2695, 219, 57423, 5145, 143165}}, {13435, 18, 167, {1, 3, 5, 9, 5, 19, 95, 97, 1, 863, 693, 2977, 4839, 6649, 22587, 40745, 113839, 69131}}, {13436, 18, 200, {1, 3, 5, 1, 31, 39, 53, 85, 509, 5, 359, 1947, 3279, 5433, 21763, 46713, 37289, 35911}}, {13437, 18, 241, {1, 3, 7, 13, 17, 35, 59, 63, 95, 667, 1775, 2165, 7861, 15731, 12159, 36179, 115457, 184819}}, {13438, 18, 244, {1, 3, 3, 15, 19, 51, 7, 83, 367, 573, 503, 535, 333, 13041, 7187, 14479, 57473, 242951}}, {13439, 18, 247, {1, 3, 5, 1, 7, 27, 65, 201, 365, 445, 985, 1175, 6391, 7345, 19935, 29085, 103001, 231855}}, {13440, 18, 261, {1, 3, 5, 13, 15, 61, 95, 125, 135, 217, 1787, 417, 7641, 11825, 14531, 48497, 125087, 73279}}, {13441, 18, 265, {1, 1, 5, 13, 7, 25, 77, 99, 341, 447, 1711, 137, 2749, 3465, 26255, 719, 102595, 112825}}, {13442, 18, 304, {1, 1, 7, 7, 15, 13, 127, 57, 359, 591, 713, 409, 1293, 4979, 7035, 11369, 85255, 207241}}, {13443, 18, 314, {1, 3, 3, 5, 1, 45, 123, 183, 297, 375, 1269, 1197, 2389, 6269, 24549, 44643, 75893, 161509}}, {13444, 18, 341, {1, 1, 5, 7, 17, 55, 67, 51, 449, 383, 2037, 871, 1359, 15317, 22055, 4655, 18065, 258271}}, {13445, 18, 376, {1, 1, 3, 11, 21, 27, 59, 205, 145, 195, 1747, 1121, 1061, 8879, 31455, 56541, 74765, 183047}}, {13446, 18, 395, {1, 1, 5, 15, 1, 11, 69, 157, 13, 185, 1355, 467, 4383, 13103, 21679, 35169, 33427, 32113}}, {13447, 18, 405, {1, 3, 1, 3, 29, 41, 15, 209, 313, 61, 1749, 2457, 1897, 15595, 24441, 39913, 40499, 5179}}, {13448, 18, 406, {1, 3, 7, 15, 25, 41, 87, 125, 239, 73, 207, 2043, 1133, 12845, 8533, 16339, 117913, 118677}}, {13449, 18, 443, {1, 1, 3, 15, 25, 9, 15, 97, 395, 99, 2017, 1003, 847, 2535, 11753, 54769, 54011, 73541}}, {13450, 18, 451, {1, 1, 7, 15, 11, 61, 13, 49, 319, 871, 893, 165, 3957, 8683, 31197, 39491, 58705, 213411}}, {13451, 18, 458, {1, 3, 7, 3, 17, 43, 29, 81, 461, 595, 541, 243, 5587, 13083, 29981, 16187, 124601, 89543}}, {13452, 18, 460, {1, 1, 5, 11, 7, 5, 61, 43, 445, 115, 1705, 419, 4627, 15063, 16053, 26249, 112243, 208711}}, {13453, 18, 468, {1, 3, 3, 9, 27, 21, 89, 49, 41, 859, 681, 2043, 7445, 9591, 13443, 36981, 66785, 227899}}, {13454, 18, 472, {1, 1, 3, 5, 11, 55, 51, 45, 41, 739, 1199, 191, 4563, 4035, 3657, 12189, 52879, 33961}}, {13455, 18, 482, {1, 1, 1, 3, 17, 59, 47, 217, 389, 783, 1501, 517, 6311, 7903, 1371, 50617, 41723, 116473}}, {13456, 18, 491, {1, 1, 5, 13, 29, 39, 101, 203, 101, 479, 1337, 2647, 6447, 563, 2593, 16533, 122535, 25587}}, {13457, 18, 496, {1, 1, 3, 3, 27, 21, 75, 173, 289, 279, 665, 3177, 559, 8539, 10903, 16779, 128219, 125907}}, {13458, 18, 524, {1, 1, 1, 11, 27, 1, 61, 247, 113, 585, 331, 3443, 5939, 5213, 27289, 57057, 17349, 62359}}, {13459, 18, 536, {1, 3, 5, 15, 21, 41, 67, 47, 121, 11, 545, 3609, 7745, 3669, 9045, 8377, 97655, 99631}}, {13460, 18, 542, {1, 3, 5, 9, 11, 15, 111, 61, 67, 775, 579, 3421, 7827, 13607, 32373, 43531, 86149, 238827}}, {13461, 18, 557, {1, 1, 1, 1, 9, 45, 79, 153, 331, 399, 1777, 3515, 3363, 3499, 13461, 48651, 21731, 220611}}, {13462, 18, 572, {1, 1, 1, 1, 31, 57, 117, 223, 139, 725, 1115, 3203, 8185, 11983, 20245, 55913, 36803, 68101}}, {13463, 18, 580, {1, 1, 1, 3, 31, 57, 53, 79, 225, 307, 1645, 3311, 643, 6587, 12037, 12453, 83461, 195503}}, {13464, 18, 592, {1, 3, 1, 7, 23, 25, 65, 233, 273, 97, 37, 1563, 3635, 9299, 24367, 42761, 55, 128675}}, {13465, 18, 656, {1, 3, 3, 11, 29, 21, 97, 143, 447, 345, 389, 381, 1403, 685, 309, 11103, 69769, 194441}}, {13466, 18, 713, {1, 3, 3, 11, 23, 55, 119, 71, 23, 291, 1241, 1723, 5025, 4499, 26617, 22875, 62185, 240321}}, {13467, 18, 719, {1, 1, 7, 11, 19, 63, 31, 131, 393, 99, 1061, 3805, 7477, 15357, 8269, 26067, 113349, 239333}}, {13468, 18, 738, {1, 3, 5, 1, 5, 37, 77, 83, 37, 759, 1297, 3067, 5369, 5977, 7531, 49079, 94503, 192765}}, {13469, 18, 749, {1, 1, 7, 1, 23, 9, 119, 137, 469, 73, 2001, 2629, 2681, 2295, 2055, 44027, 47627, 45283}}, {13470, 18, 752, {1, 3, 1, 7, 31, 17, 61, 137, 241, 325, 1417, 2383, 4171, 2495, 215, 59593, 98495, 74727}}, {13471, 18, 767, {1, 1, 7, 13, 7, 5, 59, 189, 131, 865, 1963, 1811, 5629, 16189, 16397, 58069, 72081, 191457}}, {13472, 18, 772, {1, 1, 7, 15, 23, 33, 93, 247, 395, 643, 693, 3587, 4375, 5519, 9449, 37515, 11455, 218337}}, {13473, 18, 782, {1, 1, 3, 1, 27, 63, 113, 91, 477, 55, 1461, 1547, 4743, 699, 21639, 1815, 169, 34239}}, {13474, 18, 789, {1, 1, 5, 15, 29, 37, 19, 19, 247, 771, 695, 319, 1779, 10553, 16165, 60507, 87161, 86967}}, {13475, 18, 830, {1, 1, 7, 1, 25, 61, 13, 167, 251, 861, 1717, 1533, 7323, 3945, 20879, 37759, 129689, 35901}}, {13476, 18, 838, {1, 3, 3, 7, 7, 61, 11, 25, 187, 949, 1393, 1743, 745, 16313, 5293, 16921, 17619, 237705}}, {13477, 18, 916, {1, 3, 5, 11, 7, 27, 11, 107, 299, 711, 149, 1581, 7747, 14285, 6411, 52209, 79043, 61117}}, {13478, 18, 920, {1, 1, 5, 1, 17, 19, 91, 185, 53, 699, 1185, 4007, 1099, 1965, 20239, 19547, 120859, 234149}}, {13479, 18, 936, {1, 1, 5, 5, 13, 61, 117, 187, 149, 957, 837, 3549, 6221, 501, 24755, 47975, 67007, 12329}}, {13480, 18, 991, {1, 1, 3, 15, 21, 41, 55, 81, 397, 403, 1699, 1057, 6125, 11987, 3103, 43361, 21277, 156577}}, {13481, 18, 998, {1, 1, 5, 11, 5, 27, 5, 177, 387, 859, 809, 3919, 4085, 1535, 6009, 13265, 3065, 217945}}, {13482, 18, 1016, {1, 3, 1, 13, 15, 57, 107, 81, 437, 305, 879, 1691, 3685, 11415, 3749, 46999, 113933, 10515}}, {13483, 18, 1024, {1, 1, 7, 13, 9, 43, 59, 223, 189, 329, 829, 2033, 1835, 8255, 8121, 46463, 61433, 86453}}, {13484, 18, 1053, {1, 3, 1, 9, 11, 49, 63, 125, 11, 987, 2017, 2623, 4753, 13889, 57, 24755, 108489, 175383}}, {13485, 18, 1081, {1, 1, 1, 3, 25, 33, 39, 151, 405, 657, 1755, 957, 5557, 7611, 25839, 51385, 92713, 64009}}, {13486, 18, 1090, {1, 3, 7, 9, 17, 17, 115, 89, 225, 715, 1085, 543, 1047, 15053, 14359, 43301, 31455, 156555}}, {13487, 18, 1125, {1, 1, 7, 11, 11, 21, 115, 5, 371, 1003, 1053, 1713, 5921, 7277, 799, 62483, 28079, 222319}}, {13488, 18, 1135, {1, 1, 3, 3, 31, 15, 127, 213, 459, 229, 1477, 1863, 1021, 14881, 16299, 5953, 121455, 49659}}, {13489, 18, 1143, {1, 1, 5, 9, 3, 39, 87, 219, 57, 479, 69, 2777, 8105, 11975, 14743, 26205, 93303, 45311}}, {13490, 18, 1150, {1, 1, 5, 13, 3, 43, 55, 139, 19, 715, 2035, 2993, 2945, 9075, 6275, 32233, 103127, 49523}}, {13491, 18, 1154, {1, 3, 1, 13, 19, 31, 109, 211, 261, 231, 697, 383, 2173, 14617, 11877, 37009, 5485, 236549}}, {13492, 18, 1171, {1, 1, 5, 3, 5, 23, 91, 115, 369, 11, 1021, 519, 655, 4461, 23743, 56981, 51687, 114845}}, {13493, 18, 1174, {1, 3, 7, 9, 29, 23, 19, 127, 17, 369, 1537, 2705, 4993, 1869, 15447, 28127, 73609, 97683}}, {13494, 18, 1202, {1, 1, 3, 9, 17, 61, 97, 187, 213, 861, 725, 3205, 103, 12729, 2915, 28389, 83123, 124065}}, {13495, 18, 1213, {1, 3, 1, 1, 5, 61, 47, 187, 471, 137, 1595, 707, 2449, 14315, 16409, 41467, 37533, 1649}}, {13496, 18, 1225, {1, 3, 5, 5, 7, 39, 1, 245, 361, 43, 1259, 3149, 3449, 15723, 6225, 27445, 80529, 215349}}, {13497, 18, 1233, {1, 3, 3, 11, 17, 27, 37, 47, 157, 345, 1437, 3219, 5663, 7299, 23925, 34067, 102379, 42767}}, {13498, 18, 1234, {1, 3, 5, 13, 21, 59, 43, 189, 17, 303, 1949, 3627, 3495, 7981, 18115, 34221, 43511, 255257}}, {13499, 18, 1252, {1, 3, 7, 15, 3, 29, 81, 243, 321, 853, 595, 2451, 1713, 11859, 27689, 12849, 24505, 9547}}, {13500, 18, 1255, {1, 3, 1, 3, 7, 7, 89, 183, 51, 901, 253, 2421, 7453, 15827, 21451, 58653, 51933, 239113}}, {13501, 18, 1294, {1, 1, 7, 3, 21, 59, 93, 25, 219, 805, 1699, 3777, 3683, 5351, 5481, 44797, 651, 32161}}, {13502, 18, 1349, {1, 3, 7, 5, 31, 15, 15, 167, 305, 545, 331, 3765, 8191, 5763, 16965, 7239, 73735, 1049}}, {13503, 18, 1354, {1, 3, 1, 15, 13, 19, 59, 107, 213, 39, 1547, 3413, 6175, 16195, 4635, 8945, 60301, 196697}}, {13504, 18, 1378, {1, 1, 3, 1, 29, 17, 51, 61, 261, 951, 643, 2329, 2235, 9171, 11265, 3523, 89781, 227125}}, {13505, 18, 1383, {1, 3, 5, 1, 1, 51, 75, 199, 479, 899, 1425, 3697, 2039, 4503, 11789, 16853, 94607, 236887}}, {13506, 18, 1387, {1, 3, 1, 9, 19, 43, 111, 41, 385, 677, 1067, 3391, 7819, 13663, 17713, 10155, 124243, 56005}}, {13507, 18, 1392, {1, 3, 5, 3, 15, 3, 105, 23, 307, 955, 843, 1277, 6697, 11903, 8901, 36129, 51685, 251115}}, {13508, 18, 1402, {1, 3, 1, 5, 27, 35, 95, 57, 207, 49, 1559, 171, 4703, 511, 4169, 23241, 111447, 173109}}, {13509, 18, 1420, {1, 3, 1, 13, 23, 5, 31, 15, 223, 673, 1333, 2243, 2479, 7489, 31891, 33909, 96803, 227027}}, {13510, 18, 1428, {1, 3, 5, 11, 5, 45, 19, 13, 367, 475, 1719, 3947, 5295, 2319, 20697, 181, 16925, 80239}}, {13511, 18, 1437, {1, 1, 5, 13, 15, 47, 89, 15, 153, 73, 523, 3529, 5401, 15881, 13779, 32123, 82347, 58749}}, {13512, 18, 1448, {1, 3, 5, 7, 5, 7, 123, 217, 261, 65, 685, 2175, 3289, 7473, 17857, 48335, 94183, 216857}}, {13513, 18, 1459, {1, 3, 7, 13, 7, 23, 85, 25, 231, 19, 1179, 2705, 6433, 10827, 1969, 51521, 76775, 260291}}, {13514, 18, 1473, {1, 3, 3, 13, 9, 39, 5, 141, 475, 777, 1809, 1975, 2347, 12611, 28303, 15239, 45429, 170015}}, {13515, 18, 1507, {1, 1, 7, 7, 31, 31, 39, 19, 317, 897, 739, 275, 2261, 16013, 1123, 33181, 96603, 37563}}, {13516, 18, 1516, {1, 1, 7, 13, 31, 55, 87, 239, 193, 435, 625, 2153, 3979, 15537, 19937, 50621, 48273, 31381}}, {13517, 18, 1528, {1, 1, 1, 15, 1, 57, 73, 237, 361, 749, 379, 2511, 501, 10783, 2787, 36983, 12393, 14345}}, {13518, 18, 1573, {1, 1, 1, 3, 25, 33, 85, 25, 83, 939, 139, 2601, 6385, 16041, 28463, 38977, 28163, 232165}}, {13519, 18, 1592, {1, 3, 5, 3, 9, 19, 119, 171, 499, 19, 569, 353, 1619, 6235, 24431, 47401, 48125, 168819}}, {13520, 18, 1597, {1, 1, 1, 3, 9, 27, 121, 137, 411, 391, 1437, 1339, 7475, 3889, 15451, 34809, 69807, 162851}}, {13521, 18, 1654, {1, 3, 5, 11, 31, 39, 41, 3, 171, 35, 81, 2713, 1077, 10697, 12343, 52133, 52825, 152255}}, {13522, 18, 1663, {1, 1, 3, 11, 17, 51, 83, 19, 357, 207, 897, 2167, 1333, 4111, 29295, 65371, 73447, 61765}}, {13523, 18, 1730, {1, 1, 3, 7, 9, 59, 17, 135, 365, 931, 1203, 277, 5531, 4213, 12969, 2617, 591, 154539}}, {13524, 18, 1739, {1, 3, 7, 11, 1, 53, 31, 49, 135, 603, 227, 911, 7371, 8559, 27195, 33065, 71351, 245255}}, {13525, 18, 1741, {1, 1, 7, 1, 15, 5, 31, 135, 197, 791, 1531, 2567, 2545, 15515, 25417, 27431, 15571, 176829}}, {13526, 18, 1753, {1, 3, 1, 1, 15, 7, 89, 217, 505, 859, 1329, 2285, 7921, 11839, 7699, 56867, 112483, 3895}}, {13527, 18, 1783, {1, 3, 1, 3, 27, 57, 37, 117, 491, 815, 275, 381, 7443, 3297, 1523, 34211, 97589, 232261}}, {13528, 18, 1804, {1, 1, 3, 3, 29, 63, 69, 153, 297, 423, 1435, 3927, 7265, 13223, 17607, 21201, 57929, 73037}}, {13529, 18, 1807, {1, 3, 1, 3, 23, 41, 1, 167, 121, 217, 973, 2149, 3807, 9895, 29635, 1625, 99829, 218541}}, {13530, 18, 1832, {1, 3, 5, 7, 31, 33, 53, 165, 51, 119, 7, 1655, 6521, 5481, 9503, 6833, 80483, 252111}}, {13531, 18, 1850, {1, 1, 7, 1, 5, 63, 25, 219, 165, 893, 1665, 2789, 1113, 9277, 3151, 12625, 82403, 59749}}, {13532, 18, 1852, {1, 3, 7, 3, 21, 13, 127, 127, 145, 993, 715, 1947, 7501, 4385, 11759, 2179, 26039, 28027}}, {13533, 18, 1881, {1, 3, 5, 9, 23, 27, 123, 1, 231, 709, 1615, 1433, 5991, 1045, 16269, 123, 110249, 154819}}, {13534, 18, 1894, {1, 1, 1, 5, 17, 11, 123, 151, 387, 905, 991, 1571, 4463, 6765, 31905, 59307, 75175, 204571}}, {13535, 18, 1927, {1, 3, 1, 11, 27, 49, 1, 181, 77, 1023, 807, 3479, 7965, 4633, 17495, 5991, 77081, 249343}}, {13536, 18, 1952, {1, 3, 1, 1, 13, 53, 105, 79, 269, 173, 1319, 1695, 1215, 3651, 25063, 34949, 77243, 214671}}, {13537, 18, 1969, {1, 1, 1, 1, 3, 19, 103, 233, 1, 507, 721, 1797, 5025, 405, 13027, 23693, 89963, 25771}}, {13538, 18, 1999, {1, 3, 5, 9, 21, 53, 1, 241, 405, 707, 1807, 3615, 1199, 11155, 27741, 53931, 55091, 248677}}, {13539, 18, 2018, {1, 3, 5, 7, 27, 27, 39, 77, 475, 845, 1393, 3779, 5261, 13017, 13517, 18595, 64485, 180577}}, {13540, 18, 2047, {1, 1, 3, 5, 7, 21, 95, 59, 203, 233, 1167, 3457, 3965, 4321, 14885, 6335, 78353, 39341}}, {13541, 18, 2066, {1, 1, 7, 13, 27, 19, 27, 133, 419, 507, 945, 3595, 131, 7981, 31451, 62347, 19151, 256127}}, {13542, 18, 2068, {1, 3, 7, 3, 7, 15, 9, 173, 257, 983, 223, 2881, 6911, 3681, 26183, 38943, 112171, 148627}}, {13543, 18, 2093, {1, 3, 3, 15, 5, 49, 91, 205, 303, 183, 775, 3841, 4943, 14417, 23013, 59337, 85835, 181771}}, {13544, 18, 2105, {1, 3, 5, 9, 21, 1, 117, 27, 509, 263, 1215, 893, 6677, 3275, 20831, 5045, 127323, 62589}}, {13545, 18, 2116, {1, 1, 1, 3, 17, 61, 77, 239, 379, 649, 1151, 2359, 2659, 13853, 30589, 55873, 50359, 184125}}, {13546, 18, 2149, {1, 1, 7, 5, 17, 33, 95, 111, 245, 873, 1721, 3079, 7753, 12889, 27107, 8267, 119413, 249045}}, {13547, 18, 2201, {1, 1, 1, 15, 13, 23, 59, 169, 449, 283, 913, 2099, 5337, 4307, 3701, 16395, 112987, 14183}}, {13548, 18, 2228, {1, 1, 5, 3, 5, 15, 3, 249, 97, 849, 1551, 3437, 1247, 10915, 24073, 53723, 40345, 37215}}, {13549, 18, 2245, {1, 1, 1, 5, 21, 59, 109, 79, 9, 827, 1329, 405, 3821, 8415, 11239, 1003, 78967, 112627}}, {13550, 18, 2246, {1, 1, 1, 11, 21, 7, 21, 45, 327, 365, 865, 1409, 1273, 15675, 21425, 45367, 22279, 240943}}, {13551, 18, 2283, {1, 3, 3, 7, 3, 19, 83, 163, 381, 547, 195, 1537, 7905, 9057, 1309, 41135, 118857, 101725}}, {13552, 18, 2288, {1, 1, 5, 9, 11, 19, 107, 247, 309, 343, 1697, 699, 7137, 12815, 18405, 42673, 505, 104801}}, {13553, 18, 2320, {1, 3, 5, 3, 13, 43, 55, 15, 441, 843, 1153, 3739, 67, 11053, 30985, 55329, 57301, 190991}}, {13554, 18, 2326, {1, 1, 5, 3, 23, 41, 9, 239, 227, 145, 1895, 2645, 945, 6421, 2859, 16173, 97043, 234649}}, {13555, 18, 2386, {1, 3, 1, 3, 23, 47, 57, 207, 441, 279, 1951, 3041, 2465, 6143, 27669, 41171, 89627, 2489}}, {13556, 18, 2392, {1, 3, 1, 11, 7, 9, 19, 51, 345, 187, 1699, 1483, 15, 10321, 25277, 34889, 85225, 259071}}, {13557, 18, 2395, {1, 1, 1, 15, 27, 15, 79, 51, 407, 757, 611, 3955, 1123, 14659, 11273, 56639, 64727, 183077}}, {13558, 18, 2413, {1, 3, 7, 1, 13, 61, 89, 157, 29, 561, 791, 995, 4233, 11351, 16335, 47041, 108671, 120115}}, {13559, 18, 2419, {1, 3, 3, 15, 17, 35, 15, 223, 57, 7, 961, 3327, 7287, 5537, 26231, 3289, 106555, 109781}}, {13560, 18, 2441, {1, 3, 7, 15, 17, 3, 25, 121, 349, 995, 1353, 2991, 3071, 3583, 26173, 42343, 60495, 44035}}, {13561, 18, 2466, {1, 3, 1, 11, 5, 5, 83, 249, 427, 173, 1733, 45, 3277, 7911, 18091, 61305, 130251, 31849}}, {13562, 18, 2477, {1, 1, 1, 9, 3, 23, 23, 127, 371, 1011, 573, 1769, 1707, 15351, 30077, 61139, 122963, 203481}}, {13563, 18, 2485, {1, 1, 1, 13, 27, 41, 97, 29, 461, 207, 1393, 707, 5633, 7155, 13455, 7305, 107539, 136413}}, {13564, 18, 2492, {1, 1, 1, 9, 3, 13, 61, 115, 297, 333, 1679, 127, 8049, 3129, 31845, 40039, 77087, 6831}}, {13565, 18, 2495, {1, 3, 3, 11, 27, 25, 49, 29, 423, 193, 1955, 2927, 5679, 3537, 16911, 47065, 126803, 129957}}, {13566, 18, 2498, {1, 1, 1, 3, 21, 31, 25, 187, 301, 883, 1301, 415, 1515, 14761, 227, 24377, 54415, 64553}}, {13567, 18, 2504, {1, 3, 7, 7, 3, 5, 69, 221, 357, 587, 1387, 3719, 5355, 10569, 14731, 22515, 107237, 1673}}, {13568, 18, 2515, {1, 1, 3, 15, 27, 7, 89, 23, 213, 655, 779, 1641, 1793, 1499, 27279, 59423, 56715, 90313}}, {13569, 18, 2521, {1, 3, 3, 7, 3, 33, 85, 181, 509, 327, 353, 1625, 4995, 15627, 17071, 31885, 122423, 100337}}, {13570, 18, 2561, {1, 3, 5, 9, 7, 39, 45, 157, 279, 211, 1163, 3283, 4419, 10187, 22397, 42119, 25105, 163925}}, {13571, 18, 2579, {1, 3, 3, 15, 17, 37, 75, 65, 501, 765, 1171, 2451, 309, 551, 15573, 65497, 106435, 20817}}, {13572, 18, 2604, {1, 1, 3, 1, 13, 1, 79, 117, 5, 285, 953, 2401, 2479, 15765, 25677, 63611, 91807, 78153}}, {13573, 18, 2657, {1, 1, 5, 15, 1, 7, 123, 159, 217, 307, 1779, 2625, 101, 13887, 31721, 55769, 94899, 183427}}, {13574, 18, 2681, {1, 3, 5, 5, 11, 13, 59, 205, 221, 871, 753, 823, 547, 11055, 31621, 54379, 23631, 137027}}, {13575, 18, 2691, {1, 3, 3, 7, 5, 17, 7, 31, 37, 237, 1633, 969, 4123, 6643, 28499, 3277, 130223, 37465}}, {13576, 18, 2731, {1, 3, 7, 5, 29, 41, 65, 159, 487, 61, 1217, 4093, 487, 15257, 13379, 46641, 88043, 107425}}, {13577, 18, 2739, {1, 1, 7, 7, 19, 29, 87, 119, 13, 877, 467, 2661, 7733, 9303, 20069, 8445, 126159, 69421}}, {13578, 18, 2765, {1, 3, 1, 13, 1, 57, 77, 241, 185, 479, 859, 2397, 1167, 6545, 20715, 50701, 107781, 149965}}, {13579, 18, 2790, {1, 1, 5, 1, 1, 3, 19, 31, 473, 685, 1455, 1537, 1843, 4051, 17475, 56717, 70257, 112815}}, {13580, 18, 2802, {1, 3, 7, 15, 9, 21, 19, 201, 13, 551, 1053, 1291, 3793, 7923, 30425, 55513, 30033, 70597}}, {13581, 18, 2819, {1, 3, 1, 15, 21, 47, 127, 117, 199, 655, 1979, 1291, 8017, 11769, 9071, 12029, 112369, 2529}}, {13582, 18, 2891, {1, 3, 5, 1, 15, 3, 25, 199, 101, 997, 597, 2485, 6509, 11913, 19573, 13985, 56165, 249}}, {13583, 18, 2905, {1, 1, 7, 3, 19, 45, 107, 229, 241, 747, 1219, 3133, 3675, 4441, 13933, 64571, 95445, 250713}}, {13584, 18, 2911, {1, 3, 1, 5, 11, 31, 89, 119, 503, 99, 75, 349, 7479, 15161, 6365, 62461, 39443, 188455}}, {13585, 18, 2912, {1, 1, 5, 13, 25, 31, 65, 237, 259, 329, 89, 1283, 6033, 4401, 7655, 38837, 62367, 76555}}, {13586, 18, 2921, {1, 1, 1, 7, 19, 61, 109, 41, 361, 89, 171, 2319, 3625, 8905, 24461, 36135, 28515, 101547}}, {13587, 18, 2924, {1, 3, 5, 3, 5, 45, 123, 227, 339, 79, 309, 2619, 1621, 1295, 6395, 6717, 119933, 187231}}, {13588, 18, 2945, {1, 1, 1, 3, 3, 45, 91, 225, 269, 475, 1159, 2599, 5087, 4141, 28375, 22413, 56235, 256559}}, {13589, 18, 2952, {1, 1, 1, 13, 7, 51, 27, 65, 65, 381, 169, 1759, 4653, 9885, 25839, 19851, 4965, 249097}}, {13590, 18, 2972, {1, 3, 7, 11, 25, 11, 83, 137, 419, 277, 503, 2823, 2759, 8173, 9405, 23731, 116087, 9735}}, {13591, 18, 2986, {1, 1, 5, 5, 27, 17, 123, 145, 41, 85, 1099, 1087, 1465, 7063, 8585, 39427, 15479, 243967}}, {13592, 18, 3000, {1, 1, 7, 3, 21, 53, 105, 185, 101, 763, 593, 2649, 3273, 5655, 12233, 11761, 27093, 121347}}, {13593, 18, 3008, {1, 1, 1, 5, 11, 55, 107, 167, 179, 681, 741, 1821, 4297, 14677, 9949, 9647, 60465, 36999}}, {13594, 18, 3011, {1, 1, 1, 7, 25, 43, 95, 71, 161, 517, 1475, 1989, 6273, 13295, 19681, 51773, 93523, 33441}}, {13595, 18, 3018, {1, 3, 1, 13, 23, 59, 95, 177, 73, 707, 37, 421, 3747, 14207, 17159, 4957, 20161, 26185}}, {13596, 18, 3047, {1, 1, 7, 13, 13, 1, 19, 153, 445, 429, 1911, 3515, 639, 16015, 833, 54347, 87717, 82175}}, {13597, 18, 3071, {1, 3, 5, 9, 1, 9, 115, 87, 341, 651, 1583, 807, 559, 13579, 9647, 37277, 125555, 169655}}, {13598, 18, 3079, {1, 1, 3, 5, 13, 23, 117, 229, 205, 803, 1381, 2773, 7099, 4031, 597, 37135, 11643, 92325}}, {13599, 18, 3083, {1, 3, 7, 9, 27, 15, 33, 147, 1, 799, 1511, 2609, 1419, 5991, 15571, 56995, 97695, 223969}}, {13600, 18, 3086, {1, 3, 1, 3, 17, 9, 17, 189, 407, 355, 765, 2545, 1079, 15253, 4785, 5187, 80775, 238775}}, {13601, 18, 3148, {1, 1, 3, 1, 31, 29, 3, 159, 263, 325, 125, 2221, 6369, 5717, 13985, 33829, 21375, 134249}}, {13602, 18, 3156, {1, 3, 7, 3, 5, 29, 39, 75, 183, 155, 1017, 637, 921, 9561, 14893, 59695, 38325, 15503}}, {13603, 18, 3194, {1, 1, 3, 13, 9, 31, 43, 71, 241, 661, 325, 357, 431, 903, 5039, 24535, 94241, 228605}}, {13604, 18, 3230, {1, 3, 1, 1, 17, 37, 93, 47, 25, 207, 611, 415, 6473, 15979, 2025, 19003, 8941, 248779}}, {13605, 18, 3233, {1, 1, 7, 15, 19, 17, 81, 201, 121, 11, 1975, 1289, 4405, 7851, 9707, 20057, 33749, 187161}}, {13606, 18, 3254, {1, 1, 3, 5, 29, 31, 47, 99, 435, 795, 947, 1299, 4011, 8315, 12827, 48071, 86567, 154655}}, {13607, 18, 3268, {1, 1, 5, 3, 9, 59, 115, 191, 177, 65, 1835, 3989, 1819, 14325, 8939, 25337, 16099, 200577}}, {13608, 18, 3305, {1, 3, 7, 9, 15, 47, 7, 195, 413, 1013, 1607, 3317, 6979, 13243, 275, 34125, 66069, 90201}}, {13609, 18, 3323, {1, 1, 3, 3, 29, 3, 51, 137, 341, 393, 897, 351, 1937, 6793, 12551, 18873, 110949, 133925}}, {13610, 18, 3326, {1, 3, 5, 9, 29, 41, 79, 169, 113, 123, 1229, 1885, 6153, 1549, 31729, 41949, 74083, 41387}}, {13611, 18, 3343, {1, 3, 1, 15, 31, 49, 7, 233, 305, 435, 1299, 3037, 2387, 15431, 817, 11783, 24067, 116527}}, {13612, 18, 3345, {1, 3, 5, 13, 7, 17, 49, 33, 133, 45, 689, 2381, 2649, 2433, 27535, 21755, 88611, 200585}}, {13613, 18, 3382, {1, 1, 5, 11, 1, 61, 87, 97, 91, 433, 313, 2541, 5289, 5769, 17963, 5719, 12165, 146849}}, {13614, 18, 3413, {1, 3, 7, 13, 17, 21, 37, 191, 489, 847, 841, 3567, 7339, 15233, 23973, 1209, 99741, 243303}}, {13615, 18, 3420, {1, 3, 1, 1, 5, 21, 11, 39, 69, 751, 1679, 143, 6187, 2963, 695, 45763, 126749, 243841}}, {13616, 18, 3434, {1, 3, 3, 9, 21, 55, 43, 73, 133, 417, 495, 2899, 5681, 13049, 30241, 44519, 19095, 30673}}, {13617, 18, 3453, {1, 1, 5, 9, 17, 51, 121, 205, 273, 597, 1325, 3755, 5113, 12287, 21323, 17947, 23807, 20025}}, {13618, 18, 3472, {1, 1, 7, 7, 21, 11, 25, 33, 207, 13, 1639, 1971, 7401, 11771, 7879, 59027, 111981, 65451}}, {13619, 18, 3488, {1, 3, 5, 15, 3, 15, 121, 23, 199, 839, 937, 3659, 5379, 2139, 31631, 17215, 65349, 157413}}, {13620, 18, 3503, {1, 1, 1, 7, 3, 7, 81, 49, 17, 693, 1819, 2737, 7329, 49, 1655, 42317, 31385, 11435}}, {13621, 18, 3506, {1, 3, 5, 15, 25, 51, 121, 133, 457, 159, 869, 855, 3529, 2691, 147, 58621, 78379, 148519}}, {13622, 18, 3518, {1, 1, 3, 7, 1, 53, 109, 81, 37, 553, 1921, 3081, 2665, 12665, 13887, 1035, 16987, 48883}}, {13623, 18, 3532, {1, 1, 5, 1, 19, 1, 121, 97, 143, 871, 1401, 2879, 5657, 5479, 14011, 65131, 56011, 241055}}, {13624, 18, 3543, {1, 1, 7, 5, 9, 21, 9, 43, 331, 183, 1313, 2495, 6905, 2763, 29567, 7579, 95169, 130937}}, {13625, 18, 3547, {1, 3, 7, 3, 3, 37, 65, 195, 339, 527, 1383, 3063, 7749, 11109, 8097, 27257, 107615, 134241}}, {13626, 18, 3573, {1, 1, 1, 5, 25, 25, 63, 179, 135, 65, 169, 2709, 5435, 12119, 21549, 59847, 129639, 220163}}, {13627, 18, 3574, {1, 3, 5, 1, 3, 17, 87, 181, 9, 923, 731, 3397, 7079, 3281, 10455, 35471, 20439, 206209}}, {13628, 18, 3587, {1, 1, 1, 5, 31, 25, 15, 89, 381, 675, 1217, 3175, 707, 585, 1695, 57771, 92433, 203523}}, {13629, 18, 3632, {1, 3, 5, 15, 5, 7, 9, 87, 461, 1017, 869, 1541, 7833, 3117, 24917, 13917, 104797, 149045}}, {13630, 18, 3664, {1, 1, 7, 15, 13, 49, 9, 89, 165, 827, 657, 1977, 7471, 15437, 25785, 1455, 52803, 198793}}, {13631, 18, 3713, {1, 3, 1, 15, 3, 39, 27, 205, 325, 345, 965, 1439, 4403, 10717, 9591, 46845, 123983, 76181}}, {13632, 18, 3726, {1, 3, 1, 1, 25, 23, 97, 135, 367, 179, 1563, 75, 455, 3517, 21539, 59565, 43449, 139495}}, {13633, 18, 3768, {1, 1, 5, 15, 13, 27, 55, 21, 1, 505, 1349, 409, 2491, 5299, 15771, 59389, 110377, 209275}}, {13634, 18, 3771, {1, 1, 7, 9, 31, 15, 63, 91, 3, 559, 419, 1237, 1157, 5811, 24335, 19215, 12581, 148813}}, {13635, 18, 3810, {1, 1, 7, 13, 23, 3, 81, 127, 33, 931, 867, 2905, 1011, 16207, 1543, 54309, 10611, 152733}}, {13636, 18, 3848, {1, 3, 5, 7, 21, 19, 45, 101, 439, 537, 267, 945, 8007, 9383, 13211, 21867, 5731, 150203}}, {13637, 18, 3868, {1, 1, 3, 9, 29, 3, 31, 219, 217, 775, 1011, 445, 2663, 1691, 9837, 5727, 116283, 128627}}, {13638, 18, 3896, {1, 3, 3, 3, 21, 1, 97, 239, 457, 925, 1923, 1693, 1187, 13437, 8529, 22081, 633, 76109}}, {13639, 18, 3910, {1, 3, 7, 7, 19, 5, 9, 15, 337, 855, 1563, 3159, 2799, 4103, 2013, 47789, 77027, 22425}}, {13640, 18, 3921, {1, 1, 3, 15, 15, 41, 27, 77, 489, 377, 1953, 305, 5081, 1895, 5117, 51455, 71859, 190289}}, {13641, 18, 3928, {1, 1, 5, 7, 7, 7, 13, 25, 115, 657, 223, 3185, 5327, 2559, 5147, 22237, 91933, 195429}}, {13642, 18, 3940, {1, 1, 3, 5, 5, 19, 3, 197, 371, 237, 555, 2873, 3401, 3329, 29165, 4593, 111677, 244025}}, {13643, 18, 3947, {1, 3, 5, 15, 15, 55, 29, 75, 329, 623, 279, 2831, 4489, 7803, 24119, 12959, 59783, 135213}}, {13644, 18, 3949, {1, 3, 5, 13, 31, 21, 93, 77, 401, 353, 893, 917, 4813, 8027, 7847, 55315, 60213, 102763}}, {13645, 18, 4001, {1, 1, 5, 13, 29, 49, 91, 35, 79, 625, 1539, 509, 823, 2239, 30867, 21729, 33195, 38189}}, {13646, 18, 4004, {1, 3, 3, 3, 19, 11, 39, 145, 5, 329, 1653, 3205, 4431, 9291, 30369, 63173, 72317, 236103}}, {13647, 18, 4022, {1, 3, 3, 15, 27, 9, 111, 191, 249, 845, 1845, 2097, 6529, 9559, 25757, 29085, 2615, 175759}}, {13648, 18, 4026, {1, 3, 7, 1, 17, 59, 119, 125, 213, 995, 601, 2517, 1225, 2301, 13031, 40881, 31623, 165799}}, {13649, 18, 4036, {1, 3, 3, 13, 25, 61, 97, 157, 347, 931, 1731, 3697, 5815, 7309, 30605, 3853, 72395, 103609}}, {13650, 18, 4073, {1, 1, 7, 5, 23, 13, 51, 117, 495, 683, 777, 1629, 5683, 801, 4907, 24935, 9457, 214131}}, {13651, 18, 4093, {1, 1, 5, 9, 1, 29, 107, 253, 195, 921, 345, 1451, 2253, 12723, 571, 12009, 34149, 140659}}, {13652, 18, 4099, {1, 1, 5, 9, 31, 17, 93, 5, 455, 205, 1439, 1199, 7371, 12973, 16455, 675, 60561, 99575}}, {13653, 18, 4120, {1, 3, 3, 3, 31, 37, 115, 49, 31, 285, 2029, 1369, 3443, 2411, 10367, 44859, 26737, 195703}}, {13654, 18, 4136, {1, 1, 3, 1, 15, 39, 113, 37, 257, 3, 817, 2901, 4029, 12595, 30475, 34883, 109133, 92159}}, {13655, 18, 4156, {1, 1, 7, 5, 9, 1, 9, 101, 317, 167, 1975, 411, 6875, 6951, 4401, 59483, 129813, 78289}}, {13656, 18, 4176, {1, 1, 7, 9, 9, 5, 73, 7, 57, 907, 1887, 2923, 961, 8521, 873, 33791, 114485, 43081}}, {13657, 18, 4182, {1, 1, 5, 7, 13, 45, 91, 179, 499, 197, 1337, 1321, 5307, 15503, 20449, 60813, 97393, 255741}}, {13658, 18, 4191, {1, 1, 1, 5, 25, 13, 69, 221, 207, 823, 845, 3845, 6743, 5123, 27447, 2079, 100635, 124157}}, {13659, 18, 4198, {1, 3, 5, 11, 13, 39, 121, 209, 137, 63, 1479, 323, 5347, 9797, 17785, 55541, 108713, 243347}}, {13660, 18, 4252, {1, 1, 3, 9, 29, 45, 43, 81, 115, 979, 727, 423, 1133, 8757, 27833, 39907, 104663, 33067}}, {13661, 18, 4259, {1, 3, 5, 1, 13, 61, 49, 17, 409, 567, 1035, 2299, 3711, 15485, 7767, 27809, 1275, 96455}}, {13662, 18, 4261, {1, 1, 5, 9, 5, 33, 13, 9, 505, 459, 747, 4079, 4271, 6925, 13933, 31349, 5793, 68381}}, {13663, 18, 4294, {1, 3, 3, 11, 15, 47, 15, 187, 349, 847, 817, 3551, 6059, 6451, 32615, 1635, 108889, 48003}}, {13664, 18, 4341, {1, 3, 5, 7, 3, 31, 11, 255, 367, 295, 1079, 2981, 5583, 10771, 25359, 16083, 24163, 111201}}, {13665, 18, 4348, {1, 3, 5, 5, 7, 5, 127, 19, 343, 849, 287, 1471, 7299, 1209, 31349, 33473, 4989, 229181}}, {13666, 18, 4356, {1, 1, 3, 9, 25, 61, 7, 65, 77, 745, 1871, 2427, 3669, 8965, 11177, 5531, 115801, 34327}}, {13667, 18, 4384, {1, 3, 3, 15, 1, 57, 125, 167, 173, 875, 347, 2317, 6687, 4339, 10573, 7841, 16241, 192225}}, {13668, 18, 4389, {1, 3, 1, 3, 15, 37, 45, 189, 75, 1017, 1919, 3401, 329, 2539, 32697, 60801, 52017, 192611}}, {13669, 18, 4401, {1, 3, 1, 5, 1, 23, 43, 55, 1, 443, 1769, 1633, 5225, 6855, 5419, 65139, 22237, 17415}}, {13670, 18, 4428, {1, 3, 5, 15, 25, 7, 107, 209, 325, 367, 373, 1855, 1313, 12899, 30137, 19007, 9911, 11791}}, {13671, 18, 4431, {1, 3, 7, 13, 3, 57, 123, 93, 279, 469, 1817, 3409, 565, 3997, 14119, 58341, 59691, 163323}}, {13672, 18, 4445, {1, 1, 3, 9, 3, 3, 69, 109, 47, 487, 1895, 2003, 7309, 9803, 9527, 52211, 31213, 41521}}, {13673, 18, 4470, {1, 1, 7, 7, 9, 15, 101, 227, 75, 501, 25, 1481, 4847, 13279, 28673, 11069, 61987, 5365}}, {13674, 18, 4473, {1, 3, 1, 1, 25, 5, 47, 125, 97, 969, 1077, 1185, 6033, 13927, 18149, 34255, 14353, 66323}}, {13675, 18, 4474, {1, 1, 3, 1, 25, 41, 19, 69, 385, 585, 1049, 3497, 3615, 13211, 18855, 61303, 115739, 42639}}, {13676, 18, 4490, {1, 3, 7, 7, 13, 15, 13, 133, 497, 265, 1809, 4073, 5673, 7543, 30823, 13505, 76167, 98683}}, {13677, 18, 4509, {1, 1, 5, 5, 3, 59, 47, 191, 419, 505, 2035, 329, 553, 1561, 27885, 39767, 102611, 12689}}, {13678, 18, 4510, {1, 3, 7, 3, 27, 49, 27, 133, 305, 537, 385, 335, 2417, 14891, 31299, 26201, 124655, 150545}}, {13679, 18, 4533, {1, 1, 1, 9, 7, 1, 27, 105, 347, 481, 2043, 1645, 4367, 10335, 16457, 48713, 64699, 63595}}, {13680, 18, 4548, {1, 1, 3, 3, 7, 57, 125, 209, 299, 525, 591, 1265, 7557, 15113, 19319, 56269, 43919, 215435}}, {13681, 18, 4558, {1, 1, 1, 11, 29, 59, 119, 245, 63, 919, 1913, 3969, 545, 1033, 20975, 61327, 36783, 124303}}, {13682, 18, 4594, {1, 1, 7, 7, 11, 63, 45, 135, 405, 931, 753, 2559, 5475, 2107, 6437, 6055, 43497, 133571}}, {13683, 18, 4596, {1, 3, 1, 13, 31, 39, 39, 141, 231, 83, 69, 473, 1095, 13617, 10909, 49861, 98029, 235003}}, {13684, 18, 4603, {1, 3, 7, 13, 13, 41, 73, 107, 505, 359, 957, 1599, 7617, 1843, 25531, 63755, 96295, 167955}}, {13685, 18, 4610, {1, 3, 3, 11, 13, 41, 61, 65, 165, 507, 1007, 1695, 91, 8781, 15017, 12063, 95331, 179853}}, {13686, 18, 4619, {1, 3, 7, 7, 29, 19, 7, 95, 303, 641, 581, 3539, 4495, 13549, 20195, 20845, 16961, 95053}}, {13687, 18, 4630, {1, 1, 7, 5, 15, 27, 13, 155, 345, 341, 1583, 2207, 2497, 6509, 24343, 3109, 71431, 184871}}, {13688, 18, 4652, {1, 1, 3, 15, 31, 35, 37, 249, 71, 1005, 681, 3457, 3387, 13797, 8781, 11789, 16825, 11133}}, {13689, 18, 4658, {1, 3, 7, 11, 5, 29, 121, 139, 77, 859, 163, 2749, 6401, 16303, 22659, 11817, 61667, 119993}}, {13690, 18, 4682, {1, 1, 7, 11, 15, 45, 71, 87, 293, 981, 1581, 2789, 4117, 12791, 13611, 489, 74823, 71263}}, {13691, 18, 4708, {1, 1, 3, 9, 15, 21, 59, 167, 469, 723, 1609, 2111, 6359, 10781, 1043, 51039, 24429, 14605}}, {13692, 18, 4736, {1, 3, 3, 9, 13, 25, 1, 43, 61, 869, 1919, 601, 8003, 15841, 10141, 33187, 124991, 94205}}, {13693, 18, 4753, {1, 1, 7, 5, 23, 13, 67, 43, 167, 667, 1743, 2523, 2245, 9287, 8115, 64995, 121371, 188321}}, {13694, 18, 4760, {1, 1, 1, 9, 13, 19, 45, 249, 21, 751, 239, 4035, 4549, 8905, 9377, 47535, 78135, 210429}}, {13695, 18, 4781, {1, 1, 3, 7, 5, 43, 13, 227, 75, 785, 631, 205, 3475, 9735, 17867, 61407, 75897, 51151}}, {13696, 18, 4784, {1, 3, 3, 9, 31, 21, 11, 53, 247, 717, 1505, 3903, 3249, 3185, 29007, 48795, 43413, 158653}}, {13697, 18, 4799, {1, 1, 5, 11, 19, 9, 37, 159, 183, 521, 743, 2877, 2291, 10317, 1211, 17951, 16335, 66439}}, {13698, 18, 4807, {1, 1, 3, 7, 3, 41, 15, 113, 125, 391, 201, 3841, 255, 15381, 16801, 47219, 119691, 51811}}, {13699, 18, 4808, {1, 1, 3, 1, 1, 29, 79, 181, 481, 969, 297, 625, 7449, 5813, 5915, 20011, 44853, 231933}}, {13700, 18, 4842, {1, 1, 1, 5, 5, 49, 63, 171, 93, 107, 1083, 1277, 121, 4421, 18951, 61155, 66643, 120049}}, {13701, 18, 4882, {1, 3, 7, 5, 25, 59, 111, 197, 459, 217, 1819, 1603, 5581, 11361, 17721, 57475, 11171, 186577}}, {13702, 18, 4897, {1, 3, 3, 1, 25, 19, 29, 157, 25, 595, 501, 2145, 7513, 10323, 11107, 13269, 21763, 9427}}, {13703, 18, 4900, {1, 3, 7, 3, 9, 49, 119, 117, 445, 91, 227, 1203, 6245, 9575, 30653, 65429, 64987, 81249}}, {13704, 18, 4922, {1, 1, 5, 5, 5, 5, 77, 77, 425, 789, 467, 3931, 4815, 11195, 21939, 59513, 78547, 238035}}, {13705, 18, 4936, {1, 3, 1, 11, 11, 29, 115, 37, 423, 997, 1231, 3987, 5057, 14533, 18005, 51513, 71851, 258137}}, {13706, 18, 4960, {1, 3, 1, 1, 27, 31, 7, 223, 23, 59, 1465, 2045, 6677, 15707, 25101, 22269, 46995, 89141}}, {13707, 18, 4970, {1, 1, 1, 5, 21, 7, 115, 133, 407, 373, 1495, 2551, 6947, 3309, 14903, 5683, 67345, 139381}}, {13708, 18, 4978, {1, 1, 5, 3, 13, 31, 5, 221, 187, 9, 165, 2295, 1239, 5665, 14543, 3963, 4931, 8269}}, {13709, 18, 4994, {1, 3, 5, 13, 15, 5, 37, 171, 419, 665, 765, 1619, 1561, 1661, 5873, 25595, 34827, 215599}}, {13710, 18, 5003, {1, 3, 1, 15, 13, 33, 45, 107, 275, 771, 1105, 2895, 187, 5173, 21179, 35047, 50825, 176775}}, {13711, 18, 5044, {1, 3, 7, 5, 17, 5, 59, 195, 441, 625, 1205, 207, 4703, 10627, 17123, 61785, 100779, 258597}}, {13712, 18, 5061, {1, 1, 1, 13, 17, 3, 13, 201, 241, 657, 153, 289, 5213, 2129, 13447, 28807, 25405, 33803}}, {13713, 18, 5107, {1, 3, 1, 9, 19, 9, 51, 133, 159, 743, 1023, 291, 7137, 6949, 30419, 13449, 111505, 212393}}, {13714, 18, 5127, {1, 3, 5, 7, 31, 29, 79, 211, 425, 93, 1173, 1957, 6737, 1725, 30703, 43237, 119747, 157395}}, {13715, 18, 5131, {1, 1, 7, 3, 17, 21, 39, 19, 485, 663, 19, 761, 1525, 11059, 12833, 17567, 61123, 124801}}, {13716, 18, 5136, {1, 1, 7, 3, 7, 25, 17, 199, 413, 821, 1561, 3855, 1871, 14041, 7525, 19383, 51017, 213357}}, {13717, 18, 5145, {1, 3, 3, 9, 25, 11, 63, 83, 217, 587, 47, 3775, 767, 9191, 5127, 9133, 97689, 122949}}, {13718, 18, 5146, {1, 1, 1, 9, 19, 7, 89, 125, 23, 813, 1277, 2965, 1939, 1453, 6349, 53127, 109813, 63767}}, {13719, 18, 5175, {1, 1, 5, 15, 29, 63, 117, 37, 185, 69, 1823, 2791, 4125, 11757, 14847, 15567, 126141, 185951}}, {13720, 18, 5218, {1, 3, 7, 1, 23, 11, 15, 113, 209, 785, 229, 3207, 97, 2489, 4587, 14253, 30421, 51027}}, {13721, 18, 5223, {1, 3, 1, 7, 7, 33, 57, 51, 219, 233, 89, 3781, 2055, 4163, 10935, 51913, 63507, 18645}}, {13722, 18, 5248, {1, 3, 1, 7, 7, 55, 107, 187, 109, 867, 955, 139, 4979, 8627, 5835, 28761, 72061, 99413}}, {13723, 18, 5294, {1, 1, 1, 3, 5, 59, 17, 121, 511, 29, 1009, 2875, 2459, 1817, 11741, 13869, 72543, 70485}}, {13724, 18, 5299, {1, 1, 5, 1, 27, 19, 125, 65, 379, 803, 411, 2403, 719, 10683, 23351, 18113, 66773, 252223}}, {13725, 18, 5301, {1, 1, 7, 9, 31, 51, 65, 233, 171, 357, 1465, 1609, 4263, 15207, 18825, 48831, 69459, 211321}}, {13726, 18, 5311, {1, 1, 3, 3, 5, 35, 53, 245, 469, 1011, 759, 455, 4487, 9835, 10349, 61755, 73279, 186049}}, {13727, 18, 5343, {1, 1, 7, 3, 27, 19, 105, 193, 403, 907, 295, 1445, 1867, 8867, 7821, 45309, 129069, 83953}}, {13728, 18, 5344, {1, 1, 7, 7, 7, 51, 85, 97, 473, 837, 201, 501, 2929, 9457, 6473, 3653, 126991, 218069}}, {13729, 18, 5396, {1, 3, 3, 5, 25, 49, 85, 223, 127, 563, 239, 1975, 119, 6029, 19349, 59533, 44173, 142229}}, {13730, 18, 5406, {1, 1, 3, 7, 23, 11, 27, 49, 467, 701, 2037, 2367, 5829, 12533, 9641, 38629, 90505, 132013}}, {13731, 18, 5410, {1, 1, 7, 1, 13, 25, 79, 107, 37, 331, 355, 3639, 4875, 6635, 21703, 18289, 36257, 201857}}, {13732, 18, 5424, {1, 1, 5, 1, 3, 39, 25, 101, 199, 401, 1495, 3683, 5447, 12313, 19707, 20853, 66821, 73959}}, {13733, 18, 5447, {1, 1, 1, 9, 15, 9, 3, 231, 479, 97, 221, 973, 839, 1757, 8759, 45625, 44691, 139803}}, {13734, 18, 5461, {1, 1, 7, 15, 9, 51, 23, 233, 311, 83, 287, 4035, 2087, 4245, 25457, 43105, 104903, 132811}}, {13735, 18, 5468, {1, 1, 1, 9, 5, 13, 33, 167, 363, 67, 601, 2143, 5495, 1277, 14615, 32759, 34935, 158625}}, {13736, 18, 5475, {1, 1, 5, 11, 5, 63, 35, 49, 183, 705, 377, 2607, 2947, 10119, 15631, 60247, 99309, 25747}}, {13737, 18, 5478, {1, 3, 7, 5, 7, 3, 127, 109, 165, 767, 1873, 3825, 441, 11957, 2581, 38309, 129623, 77451}}, {13738, 18, 5523, {1, 3, 1, 7, 19, 53, 101, 117, 505, 363, 1399, 1015, 631, 8309, 17507, 28941, 42585, 116283}}, {13739, 18, 5530, {1, 1, 7, 7, 9, 27, 127, 195, 499, 225, 153, 517, 3909, 9801, 3787, 32829, 6599, 190807}}, {13740, 18, 5535, {1, 1, 5, 1, 3, 49, 125, 235, 255, 329, 909, 1685, 759, 2287, 3479, 23491, 71157, 81457}}, {13741, 18, 5548, {1, 1, 3, 9, 19, 21, 93, 37, 259, 69, 219, 1943, 4747, 13951, 14945, 46099, 87189, 222287}}, {13742, 18, 5559, {1, 1, 7, 5, 21, 33, 61, 227, 167, 569, 1355, 2997, 4917, 10765, 7015, 54335, 125543, 112867}}, {13743, 18, 5580, {1, 1, 5, 3, 25, 35, 97, 23, 365, 159, 1211, 1283, 979, 8993, 21323, 6863, 46869, 36169}}, {13744, 18, 5604, {1, 1, 7, 13, 15, 49, 45, 209, 397, 785, 47, 2307, 4749, 2735, 29525, 54921, 23321, 216197}}, {13745, 18, 5622, {1, 1, 1, 11, 31, 23, 27, 127, 197, 595, 29, 773, 3291, 6355, 11891, 6635, 99871, 177531}}, {13746, 18, 5641, {1, 1, 7, 11, 9, 49, 85, 59, 211, 307, 1821, 3947, 4175, 11287, 27889, 107, 46463, 237129}}, {13747, 18, 5649, {1, 3, 3, 7, 31, 31, 9, 49, 365, 189, 1211, 943, 337, 13809, 16941, 17053, 70125, 149865}}, {13748, 18, 5656, {1, 3, 1, 13, 9, 21, 67, 1, 365, 77, 1701, 559, 3461, 8961, 13801, 16111, 65239, 157713}}, {13749, 18, 5671, {1, 3, 7, 13, 19, 49, 29, 233, 361, 1011, 1617, 2989, 2387, 14027, 4021, 28791, 33155, 171449}}, {13750, 18, 5689, {1, 1, 5, 13, 31, 19, 77, 69, 49, 513, 1411, 77, 4993, 907, 23483, 20129, 29491, 138187}}, {13751, 18, 5721, {1, 3, 3, 11, 23, 33, 19, 55, 307, 455, 1783, 3997, 6411, 3355, 8815, 39883, 124381, 49667}}, {13752, 18, 5731, {1, 3, 3, 15, 27, 7, 25, 243, 275, 27, 23, 3039, 6497, 15975, 5877, 58611, 6317, 209119}}, {13753, 18, 5734, {1, 3, 1, 5, 7, 21, 97, 247, 297, 181, 773, 3095, 2441, 15683, 29609, 50431, 92813, 723}}, {13754, 18, 5738, {1, 1, 1, 3, 17, 25, 69, 171, 27, 83, 173, 163, 7915, 13547, 5915, 20275, 101613, 225081}}, {13755, 18, 5740, {1, 1, 7, 15, 19, 13, 53, 95, 171, 889, 131, 1979, 2537, 7749, 77, 49293, 68875, 159125}}, {13756, 18, 5748, {1, 1, 1, 5, 11, 7, 7, 29, 397, 435, 1495, 2263, 3677, 11121, 1269, 5415, 44427, 249943}}, {13757, 18, 5791, {1, 3, 1, 5, 23, 21, 13, 185, 231, 757, 1647, 663, 1273, 11641, 25563, 46793, 54231, 113143}}, {13758, 18, 5801, {1, 3, 3, 7, 11, 21, 83, 109, 409, 923, 1541, 2805, 1781, 6903, 9093, 37327, 60923, 167271}}, {13759, 18, 5807, {1, 3, 7, 5, 29, 37, 87, 85, 93, 749, 875, 2869, 1023, 13303, 26865, 30971, 40863, 237075}}, {13760, 18, 5822, {1, 1, 7, 13, 21, 25, 39, 213, 303, 265, 1251, 2963, 3819, 8507, 23239, 52625, 123375, 58553}}, {13761, 18, 5829, {1, 1, 1, 1, 3, 1, 7, 67, 339, 583, 3, 2489, 5481, 12241, 21695, 31351, 39389, 131925}}, {13762, 18, 5834, {1, 1, 5, 11, 11, 3, 95, 23, 133, 415, 77, 1891, 4083, 7097, 26455, 28689, 83047, 49759}}, {13763, 18, 5847, {1, 3, 7, 15, 19, 31, 65, 189, 489, 461, 1255, 1897, 3361, 12223, 9721, 45937, 102695, 113431}}, {13764, 18, 5854, {1, 3, 1, 5, 9, 57, 3, 225, 241, 769, 1003, 2255, 7655, 4837, 25267, 35845, 49545, 24931}}, {13765, 18, 5878, {1, 1, 1, 1, 1, 43, 3, 217, 397, 419, 1189, 2037, 5941, 4341, 19851, 13773, 15225, 167581}}, {13766, 18, 5882, {1, 1, 1, 9, 3, 27, 65, 49, 115, 787, 1637, 1867, 7265, 8541, 1587, 58987, 82161, 19997}}, {13767, 18, 5919, {1, 3, 7, 11, 17, 17, 93, 103, 309, 159, 781, 3179, 5759, 7661, 5693, 48531, 127375, 141449}}, {13768, 18, 5947, {1, 3, 7, 5, 13, 39, 79, 241, 7, 137, 219, 523, 541, 4787, 23327, 41665, 111017, 118901}}, {13769, 18, 5981, {1, 1, 3, 15, 31, 23, 107, 221, 295, 935, 1165, 2463, 1635, 10205, 18057, 28217, 51755, 85579}}, {13770, 18, 5982, {1, 3, 1, 11, 23, 47, 7, 59, 75, 603, 1237, 2601, 6873, 12735, 32181, 46849, 106363, 171753}}, {13771, 18, 6025, {1, 1, 7, 13, 15, 31, 3, 113, 355, 955, 919, 1807, 7903, 5485, 1733, 64759, 15817, 93829}}, {13772, 18, 6028, {1, 1, 3, 15, 11, 33, 95, 67, 511, 971, 343, 41, 2849, 10695, 24487, 8971, 129279, 197635}}, {13773, 18, 6039, {1, 3, 1, 13, 13, 47, 77, 127, 193, 191, 1185, 3321, 1685, 1421, 28675, 12593, 86689, 186763}}, {13774, 18, 6056, {1, 3, 7, 13, 1, 11, 123, 91, 287, 751, 11, 2753, 7153, 5253, 21817, 10459, 122225, 105775}}, {13775, 18, 6064, {1, 3, 3, 13, 1, 17, 121, 13, 391, 253, 1323, 1515, 2067, 8009, 5173, 59543, 109511, 156821}}, {13776, 18, 6073, {1, 1, 5, 3, 7, 1, 119, 151, 281, 859, 675, 2923, 6627, 16071, 24653, 41325, 118413, 191981}}, {13777, 18, 6081, {1, 3, 5, 3, 31, 17, 57, 255, 473, 455, 203, 173, 345, 1477, 27939, 39289, 105081, 136179}}, {13778, 18, 6088, {1, 3, 3, 7, 1, 35, 29, 81, 337, 483, 951, 955, 4343, 14827, 17427, 59919, 81883, 114289}}, {13779, 18, 6101, {1, 3, 5, 11, 3, 39, 49, 177, 335, 57, 173, 1827, 5729, 2689, 12109, 13247, 117559, 31735}}, {13780, 18, 6139, {1, 3, 1, 3, 9, 9, 41, 97, 37, 897, 545, 2289, 7917, 5701, 21953, 1863, 33727, 28451}}, {13781, 18, 6142, {1, 1, 5, 3, 29, 61, 59, 129, 387, 965, 285, 3503, 1651, 10423, 24861, 31853, 38491, 155187}}, {13782, 18, 6194, {1, 3, 1, 13, 23, 33, 13, 161, 133, 29, 1073, 1491, 3687, 6821, 24153, 3675, 33771, 230087}}, {13783, 18, 6199, {1, 1, 7, 7, 29, 23, 23, 55, 189, 203, 641, 3391, 1217, 3199, 32531, 43103, 24007, 85613}}, {13784, 18, 6200, {1, 1, 1, 11, 7, 57, 117, 245, 467, 861, 1265, 2827, 2761, 2817, 15679, 53223, 47245, 139871}}, {13785, 18, 6203, {1, 1, 3, 15, 25, 1, 125, 237, 489, 1003, 515, 1117, 4427, 4877, 8685, 46211, 19889, 82491}}, {13786, 18, 6214, {1, 1, 3, 3, 25, 3, 63, 217, 485, 699, 161, 1459, 2973, 15949, 30681, 30991, 13933, 86505}}, {13787, 18, 6238, {1, 1, 7, 9, 27, 57, 23, 217, 401, 613, 277, 2827, 7111, 2133, 17489, 62059, 7273, 170917}}, {13788, 18, 6241, {1, 1, 3, 13, 7, 19, 39, 63, 203, 1001, 279, 879, 4293, 10121, 969, 11571, 96427, 218969}}, {13789, 18, 6244, {1, 3, 7, 7, 5, 21, 113, 203, 77, 971, 1351, 1097, 2581, 7519, 16049, 10565, 5055, 241561}}, {13790, 18, 6248, {1, 3, 3, 11, 1, 21, 93, 111, 221, 31, 1245, 1499, 2289, 2299, 23457, 49221, 68879, 125029}}, {13791, 18, 6256, {1, 1, 7, 3, 15, 19, 57, 189, 243, 785, 399, 3147, 6107, 2327, 6275, 9993, 53051, 34053}}, {13792, 18, 6266, {1, 3, 7, 15, 5, 63, 7, 193, 115, 579, 1987, 765, 7871, 14179, 26383, 61455, 14241, 123515}}, {13793, 18, 6271, {1, 3, 7, 13, 19, 13, 91, 225, 295, 675, 1995, 1145, 4929, 5163, 1101, 60681, 76777, 146875}}, {13794, 18, 6275, {1, 3, 7, 15, 21, 37, 57, 89, 297, 143, 717, 4021, 3259, 8869, 21189, 39333, 125045, 94469}}, {13795, 18, 6295, {1, 1, 5, 9, 27, 35, 69, 121, 433, 39, 889, 915, 4055, 11479, 24757, 53455, 17503, 113295}}, {13796, 18, 6315, {1, 1, 3, 3, 23, 19, 81, 191, 33, 865, 59, 603, 2819, 4919, 22495, 25089, 73905, 44971}}, {13797, 18, 6364, {1, 3, 3, 11, 19, 45, 125, 229, 143, 167, 867, 671, 2225, 16099, 14909, 14937, 78063, 135143}}, {13798, 18, 6368, {1, 1, 7, 11, 21, 55, 73, 247, 211, 895, 1147, 17, 2119, 3261, 19815, 28055, 50139, 178459}}, {13799, 18, 6377, {1, 1, 3, 1, 19, 3, 37, 221, 243, 459, 1539, 3899, 4597, 5503, 23015, 57019, 62637, 177821}}, {13800, 18, 6400, {1, 3, 1, 3, 9, 5, 91, 3, 319, 609, 1241, 3953, 5569, 8757, 6453, 8083, 55285, 38297}}, {13801, 18, 6430, {1, 3, 5, 15, 9, 51, 37, 53, 137, 95, 123, 157, 15, 7421, 22469, 49787, 96245, 199309}}, {13802, 18, 6477, {1, 3, 1, 1, 29, 61, 85, 211, 437, 1013, 1251, 61, 157, 4325, 24247, 1065, 24875, 31509}}, {13803, 18, 6480, {1, 3, 1, 13, 7, 43, 13, 171, 53, 567, 77, 3781, 5077, 6691, 32485, 24253, 83919, 159371}}, {13804, 18, 6490, {1, 1, 1, 13, 15, 15, 19, 53, 325, 309, 53, 1857, 7361, 8831, 31751, 44749, 109265, 227875}}, {13805, 18, 6526, {1, 3, 7, 3, 31, 19, 113, 253, 361, 697, 1137, 2029, 3673, 10323, 10455, 24935, 7325, 43673}}, {13806, 18, 6539, {1, 3, 1, 1, 17, 31, 3, 55, 121, 967, 1701, 2171, 4393, 11937, 3987, 5139, 68913, 134233}}, {13807, 18, 6556, {1, 1, 7, 15, 23, 37, 121, 241, 297, 419, 373, 1219, 739, 4567, 28593, 61267, 95711, 201299}}, {13808, 18, 6584, {1, 1, 1, 9, 23, 31, 101, 243, 163, 333, 1707, 2553, 5285, 12827, 5051, 14165, 505, 253585}}, {13809, 18, 6598, {1, 1, 1, 9, 11, 29, 81, 45, 101, 235, 1079, 4091, 1069, 3439, 23599, 6699, 71783, 236943}}, {13810, 18, 6601, {1, 3, 7, 11, 29, 49, 99, 59, 1, 267, 887, 2941, 6717, 7501, 22549, 53393, 34569, 34671}}, {13811, 18, 6609, {1, 3, 1, 15, 23, 13, 113, 47, 11, 79, 989, 1025, 35, 10475, 8079, 33121, 32477, 178595}}, {13812, 18, 6612, {1, 3, 7, 1, 21, 19, 51, 31, 393, 171, 553, 2221, 7017, 8567, 21803, 51803, 83737, 196409}}, {13813, 18, 6645, {1, 1, 3, 3, 1, 27, 117, 207, 37, 733, 2001, 2575, 4849, 5609, 743, 35987, 109993, 227663}}, {13814, 18, 6655, {1, 1, 7, 15, 29, 47, 85, 213, 335, 633, 849, 3269, 7723, 4651, 355, 54565, 58829, 22781}}, {13815, 18, 6679, {1, 3, 7, 5, 5, 3, 91, 243, 17, 85, 1983, 3909, 1839, 10403, 503, 28451, 3221, 215397}}, {13816, 18, 6683, {1, 1, 1, 15, 13, 3, 9, 25, 249, 113, 1619, 2313, 6461, 2323, 14319, 59635, 9569, 220583}}, {13817, 18, 6719, {1, 3, 5, 7, 31, 59, 41, 43, 43, 921, 647, 2141, 7011, 2749, 24711, 19067, 107895, 107145}}, {13818, 18, 6727, {1, 1, 3, 3, 15, 63, 41, 241, 181, 729, 843, 3569, 2645, 2727, 25331, 23067, 115421, 86025}}, {13819, 18, 6734, {1, 3, 1, 15, 11, 47, 9, 183, 341, 775, 1067, 1317, 6835, 7873, 2653, 33517, 103979, 196761}}, {13820, 18, 6770, {1, 1, 3, 13, 29, 11, 105, 9, 49, 823, 1343, 759, 1263, 12413, 26047, 54285, 57319, 215387}}, {13821, 18, 6776, {1, 1, 5, 13, 21, 55, 75, 149, 63, 737, 1305, 929, 4149, 2793, 24505, 11541, 74765, 8207}}, {13822, 18, 6791, {1, 3, 5, 9, 25, 1, 43, 157, 303, 395, 301, 1561, 5963, 3501, 2259, 59777, 100953, 16051}}, {13823, 18, 6798, {1, 3, 1, 13, 19, 25, 33, 209, 11, 95, 655, 595, 3081, 10345, 26615, 45129, 84023, 158079}}, {13824, 18, 6800, {1, 3, 1, 9, 31, 61, 103, 203, 471, 215, 1103, 759, 1197, 3333, 15859, 36103, 31563, 5987}}, {13825, 18, 6826, {1, 1, 1, 7, 1, 49, 121, 227, 153, 793, 1723, 1033, 6875, 6683, 2503, 57213, 97967, 120383}}, {13826, 18, 6833, {1, 3, 7, 11, 3, 15, 35, 181, 19, 249, 755, 1385, 3297, 4665, 2761, 22717, 126199, 85065}}, {13827, 18, 6836, {1, 3, 7, 15, 5, 45, 17, 55, 111, 597, 553, 1203, 7183, 8465, 28523, 50073, 90889, 187205}}, {13828, 18, 6858, {1, 3, 3, 9, 31, 57, 13, 139, 291, 881, 501, 2051, 617, 5151, 28225, 44777, 31645, 6805}}, {13829, 18, 6882, {1, 3, 5, 13, 1, 23, 107, 1, 201, 35, 1673, 2281, 7663, 1115, 25061, 59615, 127955, 169685}}, {13830, 18, 6901, {1, 1, 3, 15, 15, 5, 17, 75, 307, 591, 1661, 855, 4239, 13359, 20027, 51871, 35241, 32769}}, {13831, 18, 6923, {1, 1, 1, 15, 5, 23, 59, 205, 223, 103, 1889, 141, 6157, 9187, 23571, 15267, 1941, 119173}}, {13832, 18, 6967, {1, 3, 5, 9, 27, 63, 59, 11, 279, 493, 209, 4087, 1055, 9841, 31753, 37459, 27757, 213151}}, {13833, 18, 6979, {1, 1, 3, 11, 31, 33, 13, 87, 285, 847, 2005, 3431, 253, 15157, 31359, 45303, 114337, 42541}}, {13834, 18, 7022, {1, 1, 1, 7, 7, 3, 17, 203, 133, 321, 241, 1323, 5639, 10953, 10069, 4941, 17077, 54493}}, {13835, 18, 7060, {1, 1, 7, 1, 9, 5, 125, 5, 421, 609, 645, 1927, 3785, 2295, 1491, 23019, 85497, 161231}}, {13836, 18, 7064, {1, 3, 3, 11, 19, 35, 115, 95, 353, 773, 2025, 2621, 2821, 6361, 29589, 20989, 99645, 90387}}, {13837, 18, 7083, {1, 3, 1, 15, 23, 3, 71, 253, 467, 307, 1109, 2695, 7175, 15087, 1587, 48229, 104307, 218905}}, {13838, 18, 7093, {1, 3, 3, 5, 17, 29, 107, 153, 371, 205, 7, 597, 7393, 2345, 20149, 47417, 37983, 200683}}, {13839, 18, 7094, {1, 1, 7, 1, 3, 55, 113, 117, 241, 923, 1217, 3825, 2635, 8007, 12673, 9533, 7121, 3825}}, {13840, 18, 7120, {1, 1, 1, 3, 21, 63, 25, 111, 31, 151, 67, 3735, 7833, 749, 28743, 59291, 4989, 93329}}, {13841, 18, 7125, {1, 3, 5, 13, 31, 5, 91, 153, 235, 1019, 431, 1951, 7501, 8483, 19625, 57789, 13203, 36693}}, {13842, 18, 7142, {1, 1, 7, 3, 15, 51, 99, 29, 403, 343, 1903, 907, 3255, 4149, 29551, 18885, 74391, 96119}}, {13843, 18, 7151, {1, 1, 7, 11, 31, 11, 63, 213, 437, 879, 359, 555, 7549, 14269, 31489, 51001, 76857, 237305}}, {13844, 18, 7165, {1, 1, 1, 15, 23, 21, 31, 227, 311, 273, 253, 2439, 7217, 2191, 31743, 47669, 62279, 201305}}, {13845, 18, 7173, {1, 3, 5, 11, 3, 43, 97, 121, 363, 91, 201, 1095, 5267, 633, 19111, 36099, 23035, 205655}}, {13846, 18, 7188, {1, 3, 1, 9, 21, 31, 39, 11, 227, 699, 473, 2109, 2757, 13821, 31181, 40493, 57279, 260085}}, {13847, 18, 7191, {1, 1, 5, 7, 27, 57, 65, 11, 173, 709, 1139, 3735, 5291, 16053, 32579, 25275, 79865, 196033}}, {13848, 18, 7202, {1, 1, 1, 9, 19, 35, 83, 153, 287, 207, 593, 2177, 3243, 10433, 24583, 881, 71865, 250223}}, {13849, 18, 7216, {1, 3, 3, 9, 3, 35, 107, 3, 193, 1011, 463, 1643, 2733, 2157, 6329, 24583, 116901, 226385}}, {13850, 18, 7219, {1, 3, 1, 11, 3, 47, 39, 33, 495, 137, 1591, 1335, 1347, 4527, 389, 43341, 80163, 5219}}, {13851, 18, 7267, {1, 3, 3, 5, 19, 51, 121, 135, 93, 891, 13, 1339, 5187, 5005, 12823, 14465, 73845, 119685}}, {13852, 18, 7358, {1, 3, 7, 7, 19, 1, 57, 193, 325, 49, 813, 5, 4431, 1119, 13625, 43613, 127989, 42669}}, {13853, 18, 7383, {1, 3, 5, 15, 11, 33, 7, 45, 215, 469, 1059, 4095, 3549, 11839, 5463, 21383, 4831, 188345}}, {13854, 18, 7387, {1, 1, 1, 13, 5, 61, 7, 161, 99, 623, 1589, 1045, 2385, 8899, 19327, 41373, 109241, 111895}}, {13855, 18, 7396, {1, 1, 5, 7, 11, 39, 115, 41, 21, 491, 1221, 2805, 4311, 7137, 3151, 1387, 24633, 94679}}, {13856, 18, 7408, {1, 1, 3, 7, 3, 39, 71, 175, 443, 187, 1727, 2535, 5099, 1881, 21639, 5717, 48589, 95037}}, {13857, 18, 7432, {1, 1, 1, 11, 25, 21, 37, 227, 407, 73, 721, 3515, 381, 981, 21389, 5205, 31851, 140457}}, {13858, 18, 7462, {1, 3, 3, 3, 27, 35, 13, 129, 457, 315, 253, 2545, 5469, 6695, 25223, 20115, 38039, 133655}}, {13859, 18, 7480, {1, 1, 3, 11, 21, 47, 77, 231, 87, 245, 2039, 2515, 2873, 1711, 3361, 62123, 67117, 239047}}, {13860, 18, 7488, {1, 1, 7, 7, 29, 21, 39, 175, 477, 813, 447, 1109, 7391, 14631, 4437, 42539, 13003, 75403}}, {13861, 18, 7497, {1, 3, 1, 11, 11, 9, 119, 19, 99, 483, 61, 1883, 3415, 2137, 30415, 34519, 115191, 24437}}, {13862, 18, 7531, {1, 1, 1, 9, 7, 47, 115, 233, 419, 427, 1605, 3821, 6243, 10861, 28495, 48265, 80811, 147701}}, {13863, 18, 7561, {1, 3, 5, 5, 11, 61, 51, 155, 279, 463, 31, 1559, 2837, 8795, 4049, 13651, 109227, 52131}}, {13864, 18, 7582, {1, 1, 7, 9, 25, 33, 97, 79, 477, 83, 923, 3293, 6381, 3063, 23293, 35381, 82867, 233189}}, {13865, 18, 7591, {1, 1, 1, 9, 11, 39, 109, 189, 219, 1021, 137, 2041, 2719, 1763, 31787, 29377, 96287, 179685}}, {13866, 18, 7612, {1, 3, 7, 5, 3, 15, 37, 179, 77, 751, 709, 893, 7705, 1563, 7843, 29843, 1107, 35919}}, {13867, 18, 7677, {1, 3, 3, 3, 29, 17, 123, 201, 275, 487, 1979, 1361, 7523, 13783, 10129, 16877, 127049, 163221}}, {13868, 18, 7687, {1, 1, 1, 9, 27, 35, 69, 167, 509, 133, 1073, 3773, 265, 8455, 12341, 127, 115075, 94537}}, {13869, 18, 7701, {1, 3, 7, 9, 13, 35, 57, 83, 123, 211, 739, 253, 3907, 5405, 3229, 46837, 77483, 5915}}, {13870, 18, 7705, {1, 1, 7, 3, 7, 27, 71, 235, 133, 803, 611, 529, 4449, 16113, 8151, 36519, 34561, 36361}}, {13871, 18, 7712, {1, 1, 3, 1, 31, 9, 123, 85, 407, 415, 353, 3239, 673, 4641, 25883, 61117, 7669, 240851}}, {13872, 18, 7721, {1, 1, 5, 11, 29, 9, 49, 31, 3, 249, 1769, 3325, 503, 1397, 30677, 22515, 81279, 90309}}, {13873, 18, 7736, {1, 3, 5, 3, 15, 63, 121, 253, 421, 279, 497, 3881, 6977, 11061, 5883, 38347, 8351, 118123}}, {13874, 18, 7756, {1, 1, 1, 13, 1, 27, 3, 91, 281, 563, 1283, 1893, 7593, 12171, 27041, 7769, 95691, 13791}}, {13875, 18, 7777, {1, 1, 3, 3, 29, 59, 87, 153, 337, 819, 787, 2631, 1889, 13869, 29237, 57097, 91621, 4011}}, {13876, 18, 7783, {1, 1, 1, 15, 7, 49, 1, 83, 299, 353, 131, 1635, 3723, 16209, 1061, 50669, 68083, 133443}}, {13877, 18, 7792, {1, 3, 5, 5, 27, 17, 5, 239, 285, 831, 1487, 721, 4891, 4265, 23753, 43921, 116709, 105027}}, {13878, 18, 7797, {1, 1, 7, 7, 5, 35, 63, 97, 215, 447, 353, 495, 8119, 12537, 9679, 58641, 65057, 21999}}, {13879, 18, 7802, {1, 3, 7, 5, 23, 43, 69, 115, 59, 603, 493, 1665, 5003, 13607, 28491, 4439, 11855, 228183}}, {13880, 18, 7808, {1, 3, 3, 3, 15, 35, 19, 63, 241, 357, 979, 2891, 3105, 14085, 10539, 62335, 130903, 163153}}, {13881, 18, 7866, {1, 3, 5, 3, 23, 51, 23, 193, 129, 171, 1913, 1025, 6397, 15657, 19611, 57455, 87531, 51039}}, {13882, 18, 7885, {1, 1, 3, 9, 1, 9, 7, 239, 87, 527, 1401, 2703, 4021, 3845, 29269, 48217, 61091, 131949}}, {13883, 18, 7891, {1, 3, 1, 5, 17, 45, 59, 223, 287, 295, 1959, 3985, 3671, 14605, 18949, 34147, 51251, 10271}}, {13884, 18, 7913, {1, 3, 5, 9, 5, 49, 63, 105, 43, 157, 1827, 495, 5823, 6323, 6601, 51379, 64411, 204103}}, {13885, 18, 7936, {1, 1, 7, 1, 11, 31, 117, 9, 13, 965, 177, 1247, 2487, 9849, 20367, 49287, 2193, 235689}}, {13886, 18, 7946, {1, 1, 3, 11, 19, 31, 23, 215, 489, 657, 801, 3937, 379, 12083, 14969, 37857, 39027, 63985}}, {13887, 18, 7963, {1, 1, 5, 1, 9, 59, 53, 187, 341, 65, 1251, 767, 4897, 13263, 17439, 26625, 122107, 163653}}, {13888, 18, 7996, {1, 1, 3, 13, 31, 41, 125, 253, 481, 107, 233, 2305, 3321, 7303, 28585, 12787, 83307, 31497}}, {13889, 18, 7999, {1, 1, 3, 13, 25, 41, 55, 83, 101, 115, 549, 531, 3085, 9497, 27989, 28257, 121075, 189671}}, {13890, 18, 8011, {1, 3, 5, 11, 13, 53, 121, 85, 355, 275, 1925, 2117, 1349, 5903, 2041, 20963, 60803, 1121}}, {13891, 18, 8014, {1, 1, 5, 5, 13, 7, 125, 63, 311, 187, 1127, 643, 6137, 845, 23945, 9403, 451, 53027}}, {13892, 18, 8028, {1, 1, 3, 7, 19, 31, 27, 239, 337, 61, 641, 1693, 7289, 5675, 30067, 41091, 124607, 36971}}, {13893, 18, 8047, {1, 3, 1, 13, 25, 61, 11, 81, 165, 129, 241, 711, 5193, 13017, 30821, 35239, 110809, 60909}}, {13894, 18, 8077, {1, 3, 3, 13, 15, 13, 71, 19, 87, 499, 1395, 1191, 1445, 2687, 4691, 16773, 114269, 186237}}, {13895, 18, 8101, {1, 3, 3, 15, 1, 49, 33, 109, 241, 5, 431, 461, 3865, 14029, 9827, 54455, 52159, 211585}}, {13896, 18, 8119, {1, 3, 5, 7, 31, 27, 115, 113, 367, 591, 873, 1447, 6819, 7011, 14095, 55243, 4039, 226985}}, {13897, 18, 8125, {1, 1, 7, 3, 1, 19, 69, 239, 417, 833, 1867, 3111, 2617, 12781, 5531, 17345, 75717, 139667}}, {13898, 18, 8140, {1, 1, 5, 11, 11, 63, 23, 141, 221, 897, 1269, 2185, 6057, 8865, 20449, 58255, 27073, 158305}}, {13899, 18, 8152, {1, 3, 3, 5, 23, 23, 121, 39, 457, 935, 691, 2329, 7055, 2821, 12669, 28713, 82321, 245783}}, {13900, 18, 8209, {1, 1, 1, 9, 27, 9, 35, 23, 139, 823, 703, 917, 1281, 12155, 11681, 26083, 119445, 181489}}, {13901, 18, 8212, {1, 1, 3, 7, 27, 21, 35, 243, 17, 633, 1665, 3419, 6301, 16099, 17477, 24983, 128455, 127501}}, {13902, 18, 8231, {1, 3, 1, 1, 17, 19, 59, 165, 487, 985, 597, 689, 7103, 14475, 6985, 29755, 115977, 105943}}, {13903, 18, 8258, {1, 1, 5, 5, 23, 41, 67, 175, 3, 571, 1501, 3315, 6111, 1847, 28975, 54117, 66605, 69997}}, {13904, 18, 8275, {1, 3, 5, 5, 13, 37, 113, 75, 383, 297, 1187, 2055, 3433, 14651, 30393, 29647, 126403, 32265}}, {13905, 18, 8303, {1, 1, 3, 5, 31, 29, 25, 169, 465, 219, 81, 2019, 4255, 6003, 7425, 53269, 31105, 211937}}, {13906, 18, 8308, {1, 3, 7, 11, 13, 7, 11, 195, 327, 883, 1295, 3721, 1197, 7585, 5693, 993, 125017, 12007}}, {13907, 18, 8312, {1, 3, 3, 7, 5, 37, 71, 37, 63, 651, 669, 3445, 3959, 249, 10599, 22329, 107701, 107729}}, {13908, 18, 8345, {1, 1, 1, 9, 7, 47, 21, 181, 395, 345, 757, 481, 2759, 8157, 19847, 55743, 63137, 224765}}, {13909, 18, 8346, {1, 3, 5, 9, 29, 3, 61, 35, 271, 157, 549, 843, 2907, 91, 16325, 4241, 94495, 78861}}, {13910, 18, 8370, {1, 3, 1, 9, 17, 11, 53, 243, 49, 911, 1193, 793, 901, 3727, 21849, 33987, 565, 154171}}, {13911, 18, 8402, {1, 1, 5, 1, 9, 5, 89, 81, 65, 111, 781, 3775, 591, 4987, 29833, 58159, 7253, 206447}}, {13912, 18, 8411, {1, 3, 1, 7, 3, 59, 77, 83, 173, 545, 103, 2541, 8095, 10797, 11111, 62351, 88827, 55081}}, {13913, 18, 8414, {1, 1, 3, 11, 29, 37, 19, 47, 145, 19, 513, 3269, 2205, 5317, 19207, 38051, 5413, 78089}}, {13914, 18, 8424, {1, 1, 5, 9, 21, 57, 75, 249, 21, 879, 1377, 3407, 6123, 11917, 12493, 44873, 113539, 114717}}, {13915, 18, 8435, {1, 3, 3, 9, 7, 55, 121, 57, 491, 39, 1561, 2625, 639, 13553, 1159, 43071, 68869, 248837}}, {13916, 18, 8452, {1, 1, 1, 11, 25, 19, 107, 239, 171, 1001, 69, 4095, 49, 9569, 22613, 59865, 54959, 70031}}, {13917, 18, 8462, {1, 1, 3, 13, 27, 15, 105, 205, 205, 581, 1965, 1535, 6531, 15935, 7623, 33695, 9317, 44257}}, {13918, 18, 8479, {1, 1, 1, 3, 3, 51, 115, 185, 315, 763, 211, 339, 7083, 4895, 23277, 14165, 101731, 218903}}, {13919, 18, 8509, {1, 1, 3, 13, 29, 1, 69, 55, 423, 781, 183, 1417, 151, 14507, 5217, 27757, 52447, 145913}}, {13920, 18, 8515, {1, 3, 1, 11, 29, 39, 29, 151, 85, 387, 885, 507, 133, 9819, 12627, 30951, 79839, 206267}}, {13921, 18, 8522, {1, 3, 3, 7, 1, 53, 99, 141, 91, 51, 143, 1751, 3989, 6811, 7339, 52141, 43473, 18615}}, {13922, 18, 8541, {1, 3, 3, 15, 27, 11, 29, 37, 387, 655, 2019, 1135, 3619, 12995, 12755, 26063, 109419, 103875}}, {13923, 18, 8560, {1, 3, 3, 13, 31, 15, 93, 231, 195, 261, 1055, 2363, 1123, 3927, 6907, 365, 27043, 157049}}, {13924, 18, 8563, {1, 1, 1, 15, 7, 29, 105, 199, 507, 437, 117, 2963, 7801, 6291, 19261, 30377, 92205, 20723}}, {13925, 18, 8585, {1, 1, 1, 9, 29, 19, 75, 189, 3, 387, 1491, 2291, 7739, 12993, 11835, 10873, 54583, 207963}}, {13926, 18, 8594, {1, 3, 7, 3, 23, 11, 25, 105, 57, 713, 1291, 3293, 4693, 13859, 27541, 31529, 65929, 245143}}, {13927, 18, 8596, {1, 1, 7, 7, 19, 13, 19, 189, 253, 337, 351, 1751, 6173, 12207, 24483, 31381, 82035, 157143}}, {13928, 18, 8603, {1, 3, 3, 11, 11, 49, 117, 177, 301, 417, 855, 2433, 5619, 7339, 30361, 29251, 20411, 184981}}, {13929, 18, 8610, {1, 1, 1, 1, 11, 55, 77, 99, 209, 781, 1193, 2841, 783, 1485, 19413, 52255, 19529, 253927}}, {13930, 18, 8647, {1, 3, 1, 3, 15, 49, 85, 191, 389, 411, 479, 341, 4985, 6193, 19099, 11497, 103285, 162333}}, {13931, 18, 8661, {1, 3, 1, 3, 11, 31, 71, 91, 357, 615, 2007, 3601, 5393, 8079, 16811, 54127, 26049, 116341}}, {13932, 18, 8662, {1, 1, 3, 15, 9, 39, 121, 53, 43, 617, 905, 3629, 6327, 13453, 1435, 24113, 7523, 228523}}, {13933, 18, 8672, {1, 3, 5, 11, 21, 51, 11, 125, 33, 935, 1069, 2807, 4951, 13261, 17611, 38779, 62203, 135759}}, {13934, 18, 8690, {1, 1, 1, 13, 29, 59, 53, 245, 219, 423, 809, 1109, 7255, 14679, 25247, 43235, 129565, 72649}}, {13935, 18, 8696, {1, 3, 5, 7, 27, 29, 119, 91, 297, 407, 187, 2829, 5637, 13851, 14073, 461, 64081, 33971}}, {13936, 18, 8739, {1, 1, 5, 11, 15, 27, 29, 233, 487, 859, 1021, 3117, 1439, 16021, 31315, 35775, 117363, 131635}}, {13937, 18, 8783, {1, 1, 5, 3, 3, 1, 91, 229, 327, 777, 393, 3853, 3455, 1785, 13749, 25173, 51575, 167237}}, {13938, 18, 8811, {1, 3, 7, 9, 27, 7, 15, 71, 283, 71, 1783, 1357, 5581, 3143, 26075, 47751, 71001, 157107}}, {13939, 18, 8813, {1, 3, 3, 7, 23, 9, 69, 21, 333, 223, 1735, 1057, 8091, 1927, 8507, 40901, 40233, 164115}}, {13940, 18, 8821, {1, 3, 7, 3, 11, 49, 29, 81, 215, 289, 1137, 765, 6385, 5935, 3435, 11991, 30867, 60745}}, {13941, 18, 8856, {1, 1, 1, 1, 7, 39, 33, 173, 225, 533, 1927, 3607, 1059, 8779, 2649, 6801, 103963, 167471}}, {13942, 18, 8877, {1, 3, 3, 15, 27, 51, 107, 3, 195, 87, 739, 1425, 747, 1501, 22245, 59233, 124867, 79753}}, {13943, 18, 8885, {1, 1, 3, 3, 13, 41, 125, 101, 225, 749, 221, 2735, 6441, 11353, 3943, 35329, 53437, 149063}}, {13944, 18, 8897, {1, 3, 3, 15, 3, 53, 75, 77, 1, 907, 573, 1909, 363, 6913, 559, 58489, 1053, 25513}}, {13945, 18, 8898, {1, 1, 7, 11, 7, 15, 91, 155, 447, 555, 473, 3625, 7529, 16307, 32241, 64077, 46943, 85717}}, {13946, 18, 8934, {1, 1, 1, 13, 9, 61, 91, 41, 101, 107, 1081, 2511, 2881, 14095, 3861, 22771, 32687, 77287}}, {13947, 18, 8955, {1, 3, 3, 7, 21, 3, 51, 177, 203, 861, 1507, 1177, 2369, 11735, 1667, 28607, 97671, 123263}}, {13948, 18, 8972, {1, 1, 1, 3, 5, 57, 13, 127, 353, 65, 663, 3849, 3579, 5521, 11765, 63427, 76349, 102517}}, {13949, 18, 8977, {1, 1, 7, 11, 27, 55, 79, 249, 397, 77, 1543, 3787, 4889, 11145, 18691, 62899, 66425, 116195}}, {13950, 18, 9038, {1, 1, 1, 3, 5, 3, 1, 143, 73, 999, 2013, 2001, 4001, 6563, 30811, 61445, 2645, 203631}}, {13951, 18, 9045, {1, 1, 1, 15, 1, 49, 35, 61, 493, 101, 1407, 2211, 7467, 12321, 15901, 15479, 62939, 14643}}, {13952, 18, 9071, {1, 1, 3, 11, 21, 33, 123, 95, 449, 355, 1501, 1627, 1411, 6183, 17457, 2199, 96313, 25023}}, {13953, 18, 9085, {1, 1, 5, 5, 13, 49, 73, 203, 83, 3, 137, 119, 3001, 10685, 18231, 60727, 31785, 158605}}, {13954, 18, 9110, {1, 3, 1, 11, 23, 19, 123, 9, 269, 501, 2005, 3695, 3327, 5353, 12619, 12987, 18213, 29355}}, {13955, 18, 9120, {1, 3, 1, 5, 1, 25, 99, 197, 327, 575, 773, 2009, 6653, 1807, 20381, 55725, 124359, 176893}}, {13956, 18, 9157, {1, 1, 7, 15, 27, 9, 81, 175, 73, 727, 1907, 1237, 4983, 16123, 16479, 2283, 57805, 13593}}, {13957, 18, 9164, {1, 1, 3, 13, 7, 13, 13, 139, 283, 721, 487, 1821, 4257, 5105, 8057, 27193, 46857, 169927}}, {13958, 18, 9185, {1, 1, 5, 5, 29, 5, 81, 211, 441, 685, 981, 3097, 6253, 10673, 12253, 54943, 69401, 147769}}, {13959, 18, 9203, {1, 3, 3, 1, 13, 35, 73, 145, 139, 781, 37, 803, 3607, 4327, 1153, 11325, 131025, 168729}}, {13960, 18, 9235, {1, 3, 1, 13, 17, 41, 19, 59, 23, 561, 315, 719, 3325, 275, 12715, 59843, 16597, 81691}}, {13961, 18, 9278, {1, 3, 1, 11, 1, 53, 11, 237, 363, 345, 331, 129, 6885, 3105, 12487, 53803, 8897, 193777}}, {13962, 18, 9290, {1, 3, 7, 15, 3, 53, 55, 101, 389, 839, 413, 2851, 3989, 12857, 25723, 16595, 94145, 193049}}, {13963, 18, 9292, {1, 3, 1, 7, 15, 31, 3, 115, 197, 753, 1035, 1369, 4925, 4497, 1641, 63743, 127089, 114097}}, {13964, 18, 9319, {1, 3, 5, 5, 23, 1, 35, 99, 277, 769, 895, 581, 6969, 15339, 10309, 27101, 22611, 86179}}, {13965, 18, 9334, {1, 1, 1, 11, 19, 17, 45, 35, 257, 313, 815, 1469, 3651, 15101, 22775, 51729, 75401, 123653}}, {13966, 18, 9362, {1, 3, 1, 15, 5, 11, 83, 141, 373, 935, 1123, 1849, 1267, 15427, 10615, 63303, 109771, 188601}}, {13967, 18, 9387, {1, 3, 5, 3, 29, 23, 79, 193, 261, 29, 1857, 789, 4359, 14211, 22181, 64901, 129089, 65587}}, {13968, 18, 9404, {1, 3, 1, 3, 29, 15, 19, 239, 497, 771, 239, 2853, 2391, 8153, 31899, 53759, 127219, 78833}}, {13969, 18, 9407, {1, 1, 7, 7, 5, 57, 9, 93, 69, 993, 193, 3629, 5761, 9339, 28073, 50035, 81635, 83119}}, {13970, 18, 9410, {1, 1, 5, 13, 7, 35, 79, 247, 43, 1011, 1189, 2881, 1963, 8889, 9929, 50043, 112581, 224139}}, {13971, 18, 9422, {1, 3, 3, 7, 15, 63, 85, 33, 107, 37, 45, 1271, 4735, 1151, 19793, 6589, 50875, 185061}}, {13972, 18, 9478, {1, 3, 1, 15, 1, 63, 1, 201, 207, 179, 67, 3703, 2629, 10517, 1, 39645, 119733, 6449}}, {13973, 18, 9512, {1, 3, 5, 1, 3, 7, 97, 101, 233, 71, 255, 3767, 8127, 8041, 25001, 7601, 129595, 131657}}, {13974, 18, 9535, {1, 1, 7, 1, 25, 29, 105, 25, 267, 191, 267, 3141, 4445, 5043, 25203, 32055, 11035, 229031}}, {13975, 18, 9604, {1, 1, 1, 13, 3, 1, 1, 147, 63, 259, 1171, 401, 6289, 13577, 28129, 1349, 85027, 178123}}, {13976, 18, 9616, {1, 1, 1, 13, 1, 59, 109, 95, 49, 309, 1141, 1355, 3415, 11237, 21619, 12039, 1795, 57775}}, {13977, 18, 9622, {1, 3, 1, 11, 19, 3, 51, 227, 277, 49, 703, 2701, 515, 8893, 20163, 65297, 114781, 225687}}, {13978, 18, 9631, {1, 3, 7, 11, 19, 47, 121, 199, 173, 905, 1903, 1781, 2425, 13381, 25843, 23279, 87701, 10723}}, {13979, 18, 9656, {1, 3, 1, 13, 7, 21, 17, 15, 85, 241, 119, 2361, 7921, 6077, 955, 34221, 78179, 35511}}, {13980, 18, 9710, {1, 1, 7, 11, 9, 1, 1, 29, 445, 557, 241, 959, 6077, 3547, 30987, 48129, 79699, 236611}}, {13981, 18, 9721, {1, 3, 1, 15, 13, 29, 57, 117, 347, 719, 1435, 307, 5209, 4009, 10517, 3373, 67667, 260101}}, {13982, 18, 9728, {1, 1, 7, 13, 11, 41, 17, 143, 467, 993, 779, 3991, 623, 8915, 21615, 56477, 59721, 164241}}, {13983, 18, 9733, {1, 1, 3, 7, 15, 37, 53, 33, 395, 547, 1815, 2517, 6575, 14035, 1, 10919, 25467, 117521}}, {13984, 18, 9738, {1, 1, 3, 9, 17, 47, 45, 3, 509, 53, 1245, 883, 7917, 15445, 4169, 49637, 90933, 109469}}, {13985, 18, 9774, {1, 3, 1, 3, 27, 37, 3, 95, 31, 665, 701, 1979, 3735, 3257, 18943, 41201, 95721, 69451}}, {13986, 18, 9791, {1, 1, 1, 15, 19, 49, 61, 5, 115, 801, 805, 2723, 1387, 13165, 20717, 40767, 88857, 28207}}, {13987, 18, 9803, {1, 1, 5, 9, 21, 25, 23, 179, 59, 29, 547, 1829, 4411, 6689, 22363, 43975, 52259, 187563}}, {13988, 18, 9805, {1, 1, 5, 11, 13, 31, 97, 131, 135, 415, 53, 4015, 3629, 6613, 25541, 47221, 66483, 224545}}, {13989, 18, 9817, {1, 3, 1, 11, 19, 13, 65, 95, 381, 759, 1319, 2997, 6321, 9203, 24483, 9925, 10799, 117119}}, {13990, 18, 9823, {1, 3, 5, 13, 27, 17, 39, 225, 199, 125, 1125, 2673, 6787, 8861, 13139, 13849, 65459, 40183}}, {13991, 18, 9839, {1, 1, 5, 3, 17, 55, 23, 75, 457, 959, 1507, 1267, 6857, 16141, 1889, 10779, 41331, 166075}}, {13992, 18, 9847, {1, 3, 1, 15, 7, 55, 109, 59, 241, 431, 1281, 183, 1029, 14617, 4003, 41871, 36007, 129617}}, {13993, 18, 9854, {1, 3, 1, 1, 27, 61, 79, 93, 217, 251, 671, 989, 7031, 10035, 15455, 13685, 95471, 997}}, {13994, 18, 9863, {1, 1, 3, 13, 1, 5, 125, 179, 357, 537, 1303, 2653, 7319, 2075, 3861, 11743, 89659, 221705}}, {13995, 18, 9872, {1, 1, 1, 7, 3, 55, 5, 201, 153, 639, 835, 1913, 3331, 10727, 30365, 15133, 67911, 17851}}, {13996, 18, 9884, {1, 1, 3, 13, 21, 1, 67, 71, 265, 43, 279, 2009, 873, 4447, 32001, 50783, 76613, 63919}}, {13997, 18, 9935, {1, 1, 3, 11, 17, 43, 19, 195, 233, 17, 1855, 1227, 3435, 4313, 6417, 51019, 130091, 124947}}, {13998, 18, 9937, {1, 1, 7, 9, 19, 9, 95, 87, 297, 817, 1217, 3637, 2371, 7073, 387, 62121, 43507, 93927}}, {13999, 18, 9974, {1, 3, 5, 13, 1, 15, 29, 123, 137, 425, 531, 2659, 2077, 1345, 2803, 49469, 29031, 170825}}, {14000, 18, 9980, {1, 1, 5, 7, 15, 13, 119, 231, 139, 673, 1105, 2355, 3023, 4437, 17491, 47367, 12751, 183319}}, {14001, 18, 10003, {1, 1, 5, 15, 19, 5, 125, 121, 509, 539, 473, 2087, 4421, 4205, 23457, 34481, 111231, 145035}}, {14002, 18, 10015, {1, 3, 7, 5, 23, 21, 85, 23, 415, 715, 1579, 3447, 2373, 233, 19401, 54869, 15977, 138119}}, {14003, 18, 10016, {1, 1, 3, 11, 21, 1, 37, 127, 101, 943, 79, 2119, 5679, 10749, 16209, 16715, 29421, 259735}}, {14004, 18, 10066, {1, 3, 7, 7, 23, 25, 1, 73, 505, 979, 535, 87, 4165, 9353, 20075, 57597, 74651, 22133}}, {14005, 18, 10093, {1, 1, 7, 3, 11, 19, 75, 213, 293, 15, 1981, 1259, 5455, 2897, 18861, 6317, 10339, 123967}}, {14006, 18, 10118, {1, 3, 1, 3, 29, 5, 93, 169, 51, 519, 1649, 2789, 1251, 8359, 11489, 62443, 91549, 148357}}, {14007, 18, 10132, {1, 3, 3, 13, 5, 47, 39, 163, 341, 755, 737, 2335, 2389, 8351, 26193, 58111, 18425, 129313}}, {14008, 18, 10135, {1, 1, 3, 1, 31, 49, 101, 69, 345, 291, 1257, 1801, 1613, 1479, 4403, 21307, 44947, 68591}}, {14009, 18, 10151, {1, 3, 3, 9, 5, 23, 65, 65, 187, 709, 883, 2199, 1037, 8679, 31527, 23561, 92225, 254215}}, {14010, 18, 10158, {1, 3, 7, 7, 23, 13, 87, 209, 163, 705, 1199, 3007, 5469, 2453, 2691, 17841, 97045, 174149}}, {14011, 18, 10169, {1, 1, 1, 9, 5, 35, 21, 91, 145, 559, 131, 3911, 1777, 8225, 6077, 58223, 100827, 3641}}, {14012, 18, 10172, {1, 1, 5, 5, 7, 5, 31, 189, 117, 785, 1493, 3899, 471, 10971, 4607, 21063, 67225, 195367}}, {14013, 18, 10180, {1, 1, 7, 5, 31, 61, 63, 163, 417, 655, 2033, 1255, 1139, 6867, 28655, 55295, 100519, 166629}}, {14014, 18, 10187, {1, 3, 3, 3, 7, 35, 83, 55, 7, 607, 253, 915, 6801, 7505, 15929, 16829, 78469, 150947}}, {14015, 18, 10189, {1, 3, 3, 9, 29, 3, 127, 235, 347, 3, 193, 1547, 8073, 14963, 20351, 28951, 53855, 261375}}, {14016, 18, 10192, {1, 1, 7, 3, 31, 19, 75, 87, 23, 419, 75, 1677, 2371, 8875, 31993, 4465, 76085, 86499}}, {14017, 18, 10197, {1, 3, 5, 7, 1, 51, 47, 161, 415, 521, 1099, 1295, 2545, 15167, 13983, 7347, 60631, 4089}}, {14018, 18, 10211, {1, 1, 1, 9, 7, 59, 71, 187, 441, 273, 769, 2649, 3261, 12661, 23045, 32035, 104573, 120589}}, {14019, 18, 10214, {1, 3, 7, 13, 23, 51, 113, 205, 443, 291, 475, 2961, 7615, 105, 22099, 6045, 22667, 65515}}, {14020, 18, 10256, {1, 1, 5, 11, 1, 1, 23, 231, 413, 371, 1285, 2695, 2751, 4235, 15779, 1903, 24469, 259157}}, {14021, 18, 10278, {1, 3, 3, 7, 7, 47, 87, 105, 311, 251, 573, 3221, 5757, 11107, 11161, 8809, 14467, 33153}}, {14022, 18, 10290, {1, 1, 7, 1, 31, 49, 51, 31, 305, 315, 547, 1159, 2741, 3773, 13299, 40115, 62523, 108487}}, {14023, 18, 10301, {1, 3, 1, 11, 11, 43, 33, 213, 107, 467, 1509, 4081, 4723, 2409, 1447, 42759, 64717, 161991}}, {14024, 18, 10310, {1, 3, 7, 3, 31, 23, 25, 159, 95, 721, 1981, 3659, 4819, 10119, 25451, 10165, 31281, 238319}}, {14025, 18, 10344, {1, 3, 1, 5, 19, 27, 67, 125, 481, 585, 43, 3697, 4997, 581, 6439, 33477, 115023, 51759}}, {14026, 18, 10473, {1, 3, 7, 7, 15, 53, 89, 173, 369, 365, 91, 1583, 4611, 7189, 30383, 47397, 73657, 158695}}, {14027, 18, 10474, {1, 1, 1, 15, 1, 21, 125, 13, 243, 729, 1397, 2451, 3233, 15593, 2815, 56215, 22685, 167343}}, {14028, 18, 10482, {1, 3, 1, 13, 13, 29, 119, 223, 51, 695, 273, 2381, 4431, 4891, 29875, 49511, 111003, 174413}}, {14029, 18, 10499, {1, 3, 3, 15, 9, 13, 19, 177, 371, 957, 255, 115, 4701, 6089, 7237, 17077, 87949, 3111}}, {14030, 18, 10525, {1, 1, 7, 11, 29, 49, 59, 201, 145, 219, 1159, 3863, 715, 10489, 25883, 56445, 122103, 149877}}, {14031, 18, 10532, {1, 3, 1, 13, 15, 51, 91, 109, 433, 45, 2045, 3121, 1109, 14713, 2667, 40463, 52185, 64743}}, {14032, 18, 10535, {1, 3, 3, 7, 21, 31, 7, 155, 347, 305, 1557, 1311, 3315, 1363, 403, 62063, 114195, 44623}}, {14033, 18, 10556, {1, 3, 5, 11, 9, 11, 11, 245, 49, 21, 239, 3043, 3525, 1055, 21891, 19153, 123689, 170195}}, {14034, 18, 10568, {1, 1, 1, 11, 17, 51, 83, 249, 483, 489, 1063, 469, 6153, 15551, 13783, 27945, 103775, 68175}}, {14035, 18, 10579, {1, 3, 3, 13, 11, 61, 107, 113, 503, 819, 1593, 2851, 6711, 14623, 3709, 10931, 8743, 62321}}, {14036, 18, 10586, {1, 1, 5, 15, 5, 37, 23, 131, 329, 499, 1765, 1273, 819, 11573, 3307, 46933, 22087, 173459}}, {14037, 18, 10609, {1, 1, 1, 3, 31, 5, 49, 57, 239, 981, 1863, 3233, 2727, 7389, 7923, 63259, 62873, 113607}}, {14038, 18, 10612, {1, 1, 7, 7, 11, 27, 119, 137, 115, 211, 1239, 2153, 2579, 11501, 747, 31141, 129793, 151589}}, {14039, 18, 10650, {1, 3, 3, 9, 9, 55, 121, 199, 91, 835, 521, 2433, 8123, 2045, 32553, 48993, 9935, 220537}}, {14040, 18, 10665, {1, 3, 7, 11, 15, 57, 53, 145, 299, 623, 691, 1557, 785, 15851, 27075, 5983, 18043, 22241}}, {14041, 18, 10685, {1, 1, 3, 1, 1, 57, 57, 195, 381, 913, 167, 333, 5541, 2323, 17001, 34817, 30795, 144051}}, {14042, 18, 10686, {1, 3, 3, 3, 31, 1, 83, 31, 91, 855, 195, 3449, 8057, 11061, 29089, 1597, 127581, 189033}}, {14043, 18, 10688, {1, 3, 1, 1, 21, 59, 113, 179, 13, 523, 629, 3693, 7155, 893, 17449, 46535, 18051, 9191}}, {14044, 18, 10711, {1, 1, 1, 3, 27, 19, 75, 229, 181, 653, 1849, 501, 5871, 14769, 27461, 59193, 115013, 72227}}, {14045, 18, 10728, {1, 3, 3, 13, 17, 41, 111, 107, 453, 299, 1699, 2871, 2955, 4215, 13919, 19785, 30339, 148445}}, {14046, 18, 10748, {1, 3, 3, 11, 5, 19, 21, 87, 173, 439, 1651, 2393, 4137, 16285, 16093, 22953, 105663, 226575}}, {14047, 18, 10751, {1, 3, 5, 7, 19, 61, 101, 251, 295, 89, 1695, 1359, 5797, 8587, 18753, 65223, 51079, 96169}}, {14048, 18, 10781, {1, 1, 1, 5, 3, 1, 79, 63, 221, 601, 1385, 1963, 4601, 15217, 4861, 58295, 61043, 88523}}, {14049, 18, 10805, {1, 3, 3, 7, 31, 63, 73, 177, 455, 487, 1009, 2103, 4753, 3143, 10121, 36509, 24753, 230869}}, {14050, 18, 10823, {1, 1, 5, 1, 17, 27, 103, 63, 475, 665, 1189, 3513, 89, 2669, 1227, 20635, 121549, 248851}}, {14051, 18, 10838, {1, 1, 3, 7, 25, 19, 117, 243, 337, 207, 903, 3751, 3309, 11955, 12651, 25359, 83419, 19701}}, {14052, 18, 10857, {1, 1, 7, 15, 19, 21, 3, 235, 289, 185, 1175, 2291, 4003, 7753, 4775, 65321, 48957, 220261}}, {14053, 18, 10865, {1, 3, 5, 11, 23, 21, 107, 65, 117, 329, 1085, 3555, 1183, 15241, 32663, 50985, 66753, 38023}}, {14054, 18, 10872, {1, 1, 7, 9, 11, 49, 65, 17, 291, 435, 1221, 3829, 5467, 5181, 19891, 7091, 80673, 90495}}, {14055, 18, 10893, {1, 1, 1, 15, 17, 47, 119, 173, 297, 477, 859, 3661, 8081, 8257, 20841, 55123, 11231, 193669}}, {14056, 18, 10899, {1, 1, 7, 7, 27, 11, 119, 109, 199, 727, 1569, 3749, 4067, 11675, 30213, 58091, 64303, 92785}}, {14057, 18, 10917, {1, 3, 7, 15, 15, 39, 101, 149, 299, 449, 1017, 723, 7731, 7929, 22465, 61583, 69851, 150507}}, {14058, 18, 10935, {1, 3, 5, 15, 5, 13, 97, 127, 21, 673, 353, 3885, 5761, 11443, 10089, 23701, 85879, 42217}}, {14059, 18, 11001, {1, 3, 1, 5, 27, 55, 31, 167, 69, 453, 925, 555, 5135, 2759, 27077, 14497, 94333, 108729}}, {14060, 18, 11072, {1, 1, 7, 15, 11, 55, 9, 241, 55, 611, 149, 2605, 653, 1631, 15059, 6349, 12321, 124561}}, {14061, 18, 11089, {1, 1, 1, 9, 3, 11, 95, 67, 443, 103, 1687, 2667, 4567, 4271, 15601, 27859, 4757, 53289}}, {14062, 18, 11090, {1, 1, 5, 9, 23, 21, 1, 125, 105, 975, 1879, 1821, 5273, 7079, 25009, 10471, 29119, 73249}}, {14063, 18, 11108, {1, 1, 7, 1, 31, 61, 17, 23, 485, 565, 1325, 1559, 4131, 751, 2071, 4719, 15925, 101207}}, {14064, 18, 11117, {1, 1, 5, 5, 13, 53, 13, 93, 149, 139, 1429, 3605, 3545, 11193, 14139, 6093, 115727, 183105}}, {14065, 18, 11136, {1, 1, 1, 7, 15, 37, 51, 77, 177, 967, 405, 563, 3047, 8499, 26787, 27609, 23613, 239679}}, {14066, 18, 11148, {1, 1, 1, 5, 27, 37, 1, 129, 197, 133, 1329, 3673, 3143, 1059, 19209, 39027, 43787, 42821}}, {14067, 18, 11153, {1, 3, 7, 5, 5, 47, 105, 121, 219, 777, 1569, 1359, 1955, 13207, 14895, 7829, 40499, 182911}}, {14068, 18, 11181, {1, 3, 5, 7, 11, 41, 41, 155, 245, 383, 405, 2415, 5809, 5117, 31523, 16927, 76785, 113731}}, {14069, 18, 11190, {1, 3, 3, 9, 9, 21, 13, 197, 409, 931, 305, 1129, 865, 12961, 5239, 35823, 82565, 226765}}, {14070, 18, 11201, {1, 1, 5, 3, 17, 27, 59, 79, 359, 601, 979, 1355, 1657, 10479, 4741, 36391, 111527, 105139}}, {14071, 18, 11204, {1, 3, 5, 9, 13, 43, 31, 1, 309, 723, 1049, 803, 1653, 2551, 26317, 49731, 67799, 129225}}, {14072, 18, 11216, {1, 1, 5, 3, 1, 39, 95, 243, 499, 809, 1515, 981, 585, 7907, 16801, 43381, 117537, 99787}}, {14073, 18, 11237, {1, 1, 5, 5, 25, 23, 15, 127, 33, 799, 647, 2923, 7805, 2681, 14773, 42751, 106861, 119657}}, {14074, 18, 11259, {1, 3, 1, 1, 1, 47, 11, 179, 179, 659, 1061, 2511, 3601, 7107, 27887, 48427, 40559, 106043}}, {14075, 18, 11279, {1, 1, 7, 11, 5, 33, 115, 195, 431, 383, 1571, 3485, 5741, 5775, 14891, 26389, 71723, 198861}}, {14076, 18, 11282, {1, 1, 5, 5, 11, 55, 37, 57, 381, 607, 2017, 1981, 6113, 3771, 8827, 13335, 88587, 102791}}, {14077, 18, 11304, {1, 1, 1, 11, 29, 23, 73, 149, 405, 581, 721, 281, 5315, 4675, 13013, 39003, 20335, 109855}}, {14078, 18, 11312, {1, 1, 7, 15, 17, 57, 39, 51, 403, 979, 1543, 1235, 797, 5949, 26647, 15125, 33255, 152861}}, {14079, 18, 11332, {1, 1, 5, 3, 25, 27, 7, 147, 257, 163, 1297, 2289, 693, 7771, 6341, 22323, 1653, 177669}}, {14080, 18, 11341, {1, 1, 3, 9, 1, 39, 47, 231, 15, 705, 897, 3943, 6281, 6679, 21695, 29553, 39509, 83135}}, {14081, 18, 11354, {1, 3, 3, 15, 17, 43, 15, 195, 31, 501, 529, 3117, 6031, 12101, 30687, 52465, 66171, 149591}}, {14082, 18, 11356, {1, 1, 3, 5, 13, 17, 63, 41, 303, 671, 1225, 1761, 6159, 3203, 23611, 18309, 115027, 116325}}, {14083, 18, 11365, {1, 1, 5, 13, 17, 5, 97, 155, 479, 525, 1403, 4063, 8167, 6443, 20627, 41399, 26897, 102841}}, {14084, 18, 11377, {1, 3, 5, 9, 9, 27, 59, 177, 453, 659, 765, 431, 4209, 12679, 10719, 22473, 81597, 20057}}, {14085, 18, 11417, {1, 3, 3, 1, 3, 37, 91, 97, 159, 845, 519, 2603, 6979, 6711, 29781, 53639, 103357, 111671}}, {14086, 18, 11427, {1, 1, 3, 3, 25, 15, 27, 9, 503, 719, 153, 3071, 281, 5341, 32595, 13069, 6461, 160319}}, {14087, 18, 11433, {1, 3, 3, 5, 29, 7, 119, 229, 117, 925, 465, 1703, 7277, 10631, 9429, 41011, 45181, 229239}}, {14088, 18, 11434, {1, 1, 7, 7, 31, 63, 67, 55, 445, 39, 1363, 1369, 1061, 8555, 29263, 47341, 49563, 80445}}, {14089, 18, 11439, {1, 1, 7, 1, 23, 23, 49, 205, 371, 101, 1963, 2763, 3475, 835, 20371, 51343, 9771, 69713}}, {14090, 18, 11444, {1, 3, 3, 7, 3, 29, 7, 185, 511, 93, 1077, 3971, 2981, 16367, 12703, 36179, 47755, 42767}}, {14091, 18, 11448, {1, 1, 1, 11, 27, 47, 43, 39, 129, 337, 1249, 3557, 2871, 13565, 19525, 46263, 49203, 148235}}, {14092, 18, 11461, {1, 3, 5, 11, 19, 3, 83, 151, 425, 199, 847, 3751, 1729, 12457, 21819, 295, 53627, 17555}}, {14093, 18, 11466, {1, 1, 3, 5, 7, 43, 21, 221, 93, 785, 1851, 3891, 2103, 5219, 31845, 58943, 42461, 160149}}, {14094, 18, 11468, {1, 3, 5, 9, 25, 11, 43, 171, 445, 335, 1907, 3401, 815, 10341, 17779, 24895, 7727, 168143}}, {14095, 18, 11473, {1, 3, 1, 5, 27, 25, 41, 13, 239, 233, 1861, 3409, 4325, 2227, 30197, 59329, 48501, 168799}}, {14096, 18, 11489, {1, 3, 5, 13, 9, 55, 83, 185, 287, 83, 1545, 2803, 2177, 6195, 14455, 30541, 75731, 98915}}, {14097, 18, 11499, {1, 3, 3, 5, 25, 19, 5, 203, 303, 703, 1861, 3867, 2683, 8223, 11107, 54785, 106053, 135543}}, {14098, 18, 11516, {1, 1, 1, 13, 19, 7, 11, 197, 303, 541, 977, 2083, 4739, 7971, 2245, 11029, 77333, 16573}}, {14099, 18, 11531, {1, 1, 1, 3, 11, 33, 77, 59, 283, 791, 365, 4027, 487, 10559, 4543, 58111, 91861, 102905}}, {14100, 18, 11533, {1, 3, 7, 7, 15, 3, 19, 51, 339, 377, 929, 693, 1617, 14057, 7107, 27181, 7411, 202843}}, {14101, 18, 11557, {1, 3, 3, 9, 19, 9, 73, 109, 333, 917, 1227, 2871, 4893, 11029, 5619, 27091, 9381, 213403}}, {14102, 18, 11572, {1, 1, 1, 9, 9, 13, 77, 131, 163, 619, 169, 315, 1277, 13705, 16853, 1179, 86433, 135427}}, {14103, 18, 11608, {1, 3, 5, 9, 15, 47, 57, 119, 325, 529, 893, 2395, 5159, 5481, 18689, 6457, 114733, 159999}}, {14104, 18, 11635, {1, 3, 7, 5, 15, 9, 113, 235, 475, 93, 495, 2983, 2769, 5209, 7481, 49699, 46961, 246393}}, {14105, 18, 11638, {1, 1, 7, 1, 5, 31, 113, 27, 359, 635, 955, 2795, 6289, 11621, 11059, 2259, 57443, 243143}}, {14106, 18, 11644, {1, 3, 3, 13, 19, 33, 53, 141, 437, 415, 919, 1375, 2703, 13731, 31559, 14115, 50101, 85199}}, {14107, 18, 11684, {1, 1, 7, 13, 27, 57, 111, 89, 89, 313, 1107, 4049, 2485, 269, 10197, 36995, 71381, 112795}}, {14108, 18, 11702, {1, 1, 3, 7, 17, 23, 119, 123, 145, 213, 1273, 1707, 4005, 13815, 23495, 36359, 14391, 94287}}, {14109, 18, 11740, {1, 1, 7, 1, 5, 49, 81, 193, 105, 1003, 413, 2975, 1725, 5647, 25447, 43501, 4431, 115489}}, {14110, 18, 11749, {1, 3, 1, 5, 29, 13, 47, 37, 441, 955, 611, 853, 7225, 4959, 8739, 31703, 48095, 124085}}, {14111, 18, 11754, {1, 1, 5, 15, 31, 9, 125, 53, 229, 631, 1031, 3923, 4417, 12637, 22093, 46985, 103417, 193443}}, {14112, 18, 11764, {1, 1, 7, 1, 7, 9, 77, 11, 451, 615, 1259, 3097, 1513, 13641, 26845, 17399, 63661, 9231}}, {14113, 18, 11767, {1, 1, 7, 13, 25, 47, 125, 1, 333, 599, 1133, 3527, 7451, 2849, 27227, 40015, 118185, 24737}}, {14114, 18, 11784, {1, 1, 5, 5, 31, 15, 85, 37, 121, 677, 593, 2757, 739, 839, 3939, 36339, 116663, 955}}, {14115, 18, 11789, {1, 3, 1, 11, 19, 13, 87, 109, 149, 215, 1811, 3813, 7699, 16189, 12841, 52081, 104545, 245819}}, {14116, 18, 11795, {1, 1, 7, 3, 31, 17, 99, 23, 377, 131, 821, 1167, 4437, 15727, 20753, 8163, 43719, 7243}}, {14117, 18, 11798, {1, 3, 7, 13, 21, 5, 5, 167, 9, 1009, 1013, 797, 6145, 2855, 19969, 59887, 3419, 238661}}, {14118, 18, 11804, {1, 1, 7, 1, 5, 39, 47, 91, 185, 139, 959, 3149, 3423, 8909, 2045, 18187, 71935, 238605}}, {14119, 18, 11818, {1, 3, 5, 11, 29, 63, 105, 43, 27, 221, 879, 181, 1499, 10343, 27135, 823, 4893, 101707}}, {14120, 18, 11820, {1, 3, 5, 11, 5, 13, 59, 83, 315, 999, 1205, 939, 3661, 3081, 15551, 13791, 49027, 26843}}, {14121, 18, 11860, {1, 1, 1, 5, 3, 57, 105, 169, 123, 463, 1471, 445, 743, 13353, 17661, 23437, 35451, 115919}}, {14122, 18, 11869, {1, 1, 5, 11, 9, 3, 41, 63, 501, 861, 153, 1591, 1379, 5189, 24483, 8073, 43319, 248959}}, {14123, 18, 11874, {1, 1, 7, 3, 29, 45, 51, 177, 1, 961, 1493, 2179, 3723, 1923, 1517, 44823, 81613, 194641}}, {14124, 18, 11903, {1, 1, 5, 11, 17, 17, 61, 141, 5, 529, 379, 2509, 1487, 13141, 10877, 18603, 40569, 69639}}, {14125, 18, 11916, {1, 1, 5, 15, 1, 15, 33, 219, 269, 557, 7, 3627, 183, 6975, 4627, 15235, 51863, 172393}}, {14126, 18, 11927, {1, 3, 7, 9, 1, 37, 13, 75, 151, 153, 1693, 2835, 3093, 8847, 6721, 44135, 128931, 230745}}, {14127, 18, 11933, {1, 1, 3, 13, 29, 63, 33, 153, 503, 137, 401, 2315, 2223, 10843, 4235, 37295, 103249, 183899}}, {14128, 18, 11962, {1, 1, 7, 11, 15, 25, 49, 55, 39, 13, 269, 3119, 3445, 8265, 16781, 57239, 97489, 204841}}, {14129, 18, 12009, {1, 1, 1, 1, 25, 57, 117, 199, 41, 351, 477, 1891, 7913, 14439, 25305, 64811, 57731, 184265}}, {14130, 18, 12020, {1, 3, 3, 1, 13, 41, 33, 53, 381, 31, 1861, 2207, 1497, 15539, 23589, 53215, 36887, 134007}}, {14131, 18, 12035, {1, 1, 5, 7, 15, 37, 13, 99, 17, 325, 643, 2943, 7967, 11531, 21301, 5125, 63201, 101203}}, {14132, 18, 12041, {1, 1, 7, 11, 23, 21, 119, 151, 457, 929, 1917, 3123, 1133, 11861, 27889, 40421, 90949, 113237}}, {14133, 18, 12049, {1, 3, 5, 9, 13, 35, 111, 83, 371, 589, 1507, 3559, 773, 5895, 31453, 40865, 124103, 250473}}, {14134, 18, 12065, {1, 3, 3, 15, 11, 7, 93, 163, 285, 763, 2023, 1047, 3349, 13575, 22571, 21513, 56081, 204765}}, {14135, 18, 12072, {1, 3, 3, 5, 19, 19, 47, 25, 49, 717, 1155, 3901, 407, 2699, 30961, 55647, 96043, 185559}}, {14136, 18, 12098, {1, 1, 1, 7, 29, 1, 49, 87, 311, 435, 1235, 1041, 6595, 1639, 32495, 44245, 6593, 236331}}, {14137, 18, 12100, {1, 3, 7, 9, 27, 13, 1, 41, 75, 953, 1635, 101, 7231, 13019, 14773, 17315, 120993, 111215}}, {14138, 18, 12107, {1, 1, 5, 9, 23, 31, 87, 47, 83, 791, 1239, 1453, 5459, 4847, 7285, 32667, 45991, 103593}}, {14139, 18, 12167, {1, 3, 1, 3, 27, 47, 97, 191, 5, 961, 1191, 3897, 6821, 4257, 22047, 31557, 52603, 251405}}, {14140, 18, 12202, {1, 1, 5, 3, 23, 45, 103, 115, 287, 47, 93, 2761, 6467, 14031, 21881, 31631, 47605, 237635}}, {14141, 18, 12207, {1, 3, 7, 15, 23, 41, 63, 239, 115, 655, 1949, 1969, 3145, 91, 16735, 49295, 117995, 40537}}, {14142, 18, 12233, {1, 1, 7, 11, 5, 25, 99, 247, 11, 707, 1497, 785, 6055, 8521, 12179, 56363, 110131, 55449}}, {14143, 18, 12269, {1, 1, 1, 7, 5, 31, 99, 7, 285, 281, 1207, 1173, 7637, 9595, 31413, 16597, 96157, 39059}}, {14144, 18, 12290, {1, 3, 7, 7, 3, 49, 79, 69, 57, 523, 65, 2785, 2907, 11295, 16199, 25845, 51801, 67417}}, {14145, 18, 12304, {1, 1, 3, 1, 1, 53, 57, 117, 1, 927, 1787, 3059, 7441, 14663, 10881, 2225, 29375, 93717}}, {14146, 18, 12314, {1, 1, 5, 5, 29, 17, 67, 35, 475, 367, 155, 3463, 2339, 6239, 31073, 56169, 130309, 28981}}, {14147, 18, 12340, {1, 1, 1, 5, 7, 53, 61, 105, 355, 817, 869, 2863, 6041, 11459, 4151, 61115, 100689, 32917}}, {14148, 18, 12416, {1, 3, 5, 11, 31, 11, 33, 105, 437, 767, 101, 2979, 3911, 4859, 15551, 23545, 10705, 6271}}, {14149, 18, 12425, {1, 1, 7, 5, 1, 17, 109, 205, 409, 893, 889, 2181, 6167, 14273, 25389, 50279, 5497, 191755}}, {14150, 18, 12428, {1, 3, 7, 15, 29, 11, 79, 101, 123, 399, 1159, 1263, 3513, 13169, 2199, 41057, 98639, 227107}}, {14151, 18, 12446, {1, 1, 3, 11, 13, 31, 51, 119, 257, 829, 337, 3267, 7673, 15459, 26681, 4041, 89429, 198607}}, {14152, 18, 12462, {1, 3, 7, 11, 23, 29, 49, 159, 327, 415, 857, 2411, 2429, 11839, 20263, 61813, 31811, 225443}}, {14153, 18, 12476, {1, 1, 3, 11, 7, 61, 61, 119, 431, 299, 1815, 2857, 7605, 7517, 15137, 13727, 73021, 199325}}, {14154, 18, 12496, {1, 1, 7, 3, 5, 19, 51, 19, 59, 637, 591, 2999, 5997, 13487, 807, 4887, 112189, 226597}}, {14155, 18, 12511, {1, 1, 1, 13, 21, 5, 55, 167, 463, 679, 891, 3597, 785, 7717, 17495, 51681, 55957, 48561}}, {14156, 18, 12518, {1, 1, 5, 5, 9, 55, 55, 143, 193, 839, 785, 1713, 7457, 11591, 15803, 2479, 124663, 72631}}, {14157, 18, 12530, {1, 3, 5, 9, 21, 27, 109, 91, 483, 905, 1369, 2573, 7173, 13977, 20131, 17637, 127477, 66457}}, {14158, 18, 12532, {1, 1, 5, 7, 31, 17, 43, 153, 505, 413, 867, 769, 6947, 10815, 18805, 5957, 27715, 24529}}, {14159, 18, 12539, {1, 3, 5, 9, 13, 41, 107, 199, 69, 1019, 2037, 3221, 1081, 15051, 6713, 46379, 17223, 85453}}, {14160, 18, 12567, {1, 3, 3, 7, 23, 51, 45, 133, 227, 373, 1815, 3795, 5567, 7153, 25003, 64951, 75377, 174115}}, {14161, 18, 12597, {1, 1, 7, 15, 7, 51, 33, 239, 113, 133, 1213, 327, 4841, 11297, 1093, 40013, 60843, 99845}}, {14162, 18, 12601, {1, 1, 1, 11, 3, 37, 33, 107, 275, 747, 1451, 1787, 5029, 3101, 11575, 36555, 46181, 221643}}, {14163, 18, 12602, {1, 1, 3, 3, 29, 53, 57, 67, 209, 153, 345, 2897, 5657, 8907, 14159, 9899, 102487, 237721}}, {14164, 18, 12622, {1, 3, 1, 7, 7, 59, 17, 151, 423, 903, 2035, 861, 1057, 2399, 28547, 3659, 29583, 100651}}, {14165, 18, 12693, {1, 1, 5, 15, 27, 53, 101, 17, 405, 869, 1253, 1923, 999, 7787, 23621, 4351, 48611, 47129}}, {14166, 18, 12707, {1, 3, 7, 11, 13, 43, 61, 161, 43, 831, 2021, 579, 5353, 12451, 32261, 39885, 90051, 34407}}, {14167, 18, 12713, {1, 1, 1, 5, 25, 19, 37, 33, 37, 59, 1399, 1587, 1517, 4261, 31215, 33777, 50447, 87049}}, {14168, 18, 12716, {1, 1, 3, 1, 19, 17, 113, 31, 385, 135, 143, 3997, 1365, 2625, 22591, 8887, 31353, 240603}}, {14169, 18, 12734, {1, 3, 7, 11, 21, 7, 55, 171, 233, 1007, 1321, 2903, 2457, 3941, 19667, 49115, 99119, 185989}}, {14170, 18, 12763, {1, 3, 7, 9, 3, 31, 83, 99, 303, 443, 99, 2285, 1491, 15897, 21735, 1575, 74449, 59615}}, {14171, 18, 12765, {1, 3, 1, 5, 29, 37, 125, 213, 277, 115, 255, 137, 6071, 13561, 23871, 48129, 120211, 168603}}, {14172, 18, 12799, {1, 1, 7, 3, 9, 21, 93, 239, 399, 21, 9, 409, 3403, 9517, 6421, 17121, 65697, 251985}}, {14173, 18, 12843, {1, 1, 1, 15, 27, 35, 17, 113, 471, 357, 1703, 871, 1803, 3495, 27437, 48343, 86425, 155245}}, {14174, 18, 12853, {1, 3, 7, 11, 19, 45, 51, 195, 345, 77, 1403, 2527, 3405, 14057, 31965, 17375, 35107, 246545}}, {14175, 18, 12865, {1, 3, 5, 7, 7, 5, 115, 39, 51, 261, 1883, 1793, 3423, 3613, 20399, 27267, 99875, 119719}}, {14176, 18, 12866, {1, 3, 3, 9, 21, 23, 65, 69, 261, 79, 151, 3387, 7789, 13275, 30135, 52229, 40787, 181297}}, {14177, 18, 12919, {1, 1, 5, 13, 19, 49, 111, 125, 433, 99, 1673, 2091, 5447, 9377, 9085, 4659, 75121, 105809}}, {14178, 18, 12926, {1, 3, 7, 1, 3, 27, 107, 109, 245, 431, 1727, 3269, 2099, 10777, 21843, 63377, 47343, 126269}}, {14179, 18, 12936, {1, 3, 1, 15, 7, 17, 107, 153, 37, 287, 1873, 573, 5025, 3735, 32545, 35693, 38083, 89569}}, {14180, 18, 12944, {1, 3, 1, 3, 9, 51, 99, 247, 45, 703, 1231, 1895, 6309, 12137, 14697, 25441, 129701, 198811}}, {14181, 18, 12959, {1, 3, 3, 11, 5, 43, 1, 31, 359, 563, 1013, 3475, 3935, 7855, 10085, 15279, 25109, 225643}}, {14182, 18, 12965, {1, 3, 3, 3, 9, 47, 49, 193, 223, 23, 391, 847, 7233, 14955, 10645, 50535, 5415, 119791}}, {14183, 18, 12980, {1, 3, 1, 7, 3, 7, 57, 189, 219, 287, 401, 1767, 5585, 13983, 18485, 56725, 71905, 33779}}, {14184, 18, 13004, {1, 3, 5, 15, 23, 17, 115, 223, 35, 263, 345, 3459, 857, 1467, 30255, 50127, 72985, 62509}}, {14185, 18, 13016, {1, 3, 1, 9, 3, 27, 125, 43, 47, 183, 1421, 319, 4273, 10701, 21761, 23947, 22531, 10855}}, {14186, 18, 13019, {1, 1, 3, 15, 13, 55, 77, 1, 295, 841, 1115, 4093, 7993, 13309, 24851, 35411, 105201, 188543}}, {14187, 18, 13037, {1, 3, 3, 5, 19, 39, 101, 19, 225, 997, 1999, 407, 3147, 15393, 30379, 26221, 21685, 114167}}, {14188, 18, 13055, {1, 3, 3, 3, 23, 15, 3, 57, 45, 381, 47, 1839, 5491, 6775, 18477, 51443, 757, 183111}}, {14189, 18, 13063, {1, 3, 3, 7, 31, 27, 107, 229, 1, 977, 125, 1137, 4873, 14381, 8705, 64641, 38447, 239887}}, {14190, 18, 13098, {1, 1, 3, 13, 9, 35, 49, 187, 459, 407, 1677, 2007, 1091, 12385, 8911, 38221, 108681, 171641}}, {14191, 18, 13103, {1, 1, 3, 5, 7, 61, 115, 155, 437, 829, 1041, 2191, 1489, 1269, 27613, 48713, 40095, 206057}}, {14192, 18, 13106, {1, 3, 7, 1, 23, 1, 17, 215, 363, 119, 845, 987, 5619, 5857, 11307, 63171, 76921, 201767}}, {14193, 18, 13115, {1, 1, 7, 9, 29, 23, 63, 247, 37, 199, 103, 1215, 913, 12865, 24089, 35101, 117677, 261393}}, {14194, 18, 13143, {1, 1, 1, 1, 3, 19, 7, 159, 183, 275, 467, 3629, 6575, 3351, 26955, 29247, 119007, 67895}}, {14195, 18, 13144, {1, 1, 7, 13, 1, 33, 31, 211, 103, 495, 417, 817, 7129, 10169, 11445, 41511, 73101, 185357}}, {14196, 18, 13153, {1, 1, 3, 5, 3, 27, 99, 1, 425, 295, 131, 835, 1833, 4547, 8777, 29489, 60303, 191437}}, {14197, 18, 13171, {1, 1, 5, 5, 31, 63, 71, 189, 317, 61, 385, 891, 2257, 8281, 17325, 12207, 125847, 28259}}, {14198, 18, 13184, {1, 1, 3, 3, 19, 19, 97, 83, 495, 551, 1339, 1699, 3047, 13623, 27731, 28999, 101225, 146139}}, {14199, 18, 13193, {1, 3, 5, 7, 25, 9, 37, 73, 239, 47, 583, 3337, 1329, 79, 30109, 12451, 10163, 62943}}, {14200, 18, 13199, {1, 1, 3, 1, 9, 1, 31, 181, 231, 441, 1241, 233, 6049, 2401, 9867, 58911, 20599, 26321}}, {14201, 18, 13207, {1, 3, 1, 15, 21, 43, 21, 43, 273, 865, 79, 2069, 3375, 16069, 12355, 56355, 9735, 243719}}, {14202, 18, 13217, {1, 3, 5, 11, 13, 21, 5, 73, 423, 761, 1947, 2935, 3931, 5573, 83, 58251, 113115, 245767}}, {14203, 18, 13227, {1, 3, 7, 7, 15, 49, 73, 211, 309, 635, 1257, 2185, 7151, 11959, 26885, 45955, 103503, 161709}}, {14204, 18, 13232, {1, 3, 1, 15, 31, 53, 29, 35, 343, 87, 1833, 2483, 1847, 4709, 6105, 21961, 106541, 46741}}, {14205, 18, 13276, {1, 1, 7, 7, 21, 43, 41, 51, 29, 521, 713, 3693, 483, 11777, 10453, 43691, 97585, 133193}}, {14206, 18, 13283, {1, 3, 3, 11, 5, 45, 3, 179, 183, 255, 1291, 1795, 5721, 10911, 18395, 64349, 23141, 99481}}, {14207, 18, 13307, {1, 1, 1, 5, 5, 25, 61, 169, 475, 953, 617, 559, 5945, 16377, 30063, 30079, 83305, 81745}}, {14208, 18, 13317, {1, 1, 5, 11, 29, 59, 113, 37, 153, 807, 135, 2639, 4535, 7079, 6387, 63523, 89669, 198803}}, {14209, 18, 13330, {1, 1, 7, 7, 19, 23, 71, 51, 165, 733, 1427, 2473, 331, 5027, 9299, 20617, 126775, 91619}}, {14210, 18, 13345, {1, 3, 5, 7, 31, 35, 117, 235, 29, 677, 1243, 281, 6287, 535, 4783, 37781, 130929, 14193}}, {14211, 18, 13363, {1, 1, 5, 3, 25, 1, 29, 109, 289, 631, 41, 361, 5537, 9657, 7475, 63749, 50325, 169791}}, {14212, 18, 13387, {1, 3, 3, 15, 21, 53, 85, 43, 341, 907, 475, 3257, 2541, 10397, 30847, 63681, 121427, 192135}}, {14213, 18, 13426, {1, 1, 1, 1, 9, 59, 59, 233, 335, 345, 1749, 4007, 1833, 7789, 21015, 48939, 15967, 201321}}, {14214, 18, 13428, {1, 1, 1, 5, 11, 9, 101, 243, 391, 1003, 1019, 311, 3707, 10223, 21627, 8237, 53861, 159785}}, {14215, 18, 13431, {1, 3, 7, 15, 5, 3, 109, 197, 507, 947, 833, 1161, 4021, 5575, 8081, 45381, 112597, 70407}}, {14216, 18, 13489, {1, 1, 3, 1, 7, 63, 63, 53, 481, 1003, 43, 2503, 2303, 12593, 21403, 2965, 5377, 91491}}, {14217, 18, 13501, {1, 1, 1, 1, 29, 45, 49, 73, 253, 197, 1245, 1509, 4747, 6207, 28321, 59193, 112687, 83719}}, {14218, 18, 13533, {1, 1, 7, 3, 11, 51, 23, 83, 185, 643, 1427, 227, 2261, 12521, 27033, 5129, 53111, 34975}}, {14219, 18, 13589, {1, 1, 7, 3, 5, 41, 55, 175, 447, 603, 723, 2141, 1189, 4921, 16905, 2463, 83641, 247241}}, {14220, 18, 13600, {1, 3, 3, 13, 5, 11, 95, 59, 391, 319, 1675, 329, 7559, 11585, 28905, 27843, 106667, 15531}}, {14221, 18, 13603, {1, 3, 3, 3, 27, 17, 103, 115, 447, 657, 267, 2541, 665, 7819, 4155, 32191, 60999, 48737}}, {14222, 18, 13623, {1, 1, 5, 7, 7, 49, 87, 171, 457, 149, 1699, 4081, 3913, 7889, 29517, 3339, 33139, 8925}}, {14223, 18, 13665, {1, 1, 1, 9, 11, 51, 87, 115, 429, 505, 1665, 2361, 5811, 1621, 12727, 33703, 52255, 93835}}, {14224, 18, 13672, {1, 3, 3, 5, 27, 11, 35, 49, 281, 607, 1791, 4065, 5103, 5253, 975, 20353, 38253, 139363}}, {14225, 18, 13675, {1, 1, 5, 9, 29, 15, 37, 141, 445, 751, 1219, 2217, 7207, 14981, 21113, 3313, 107127, 135567}}, {14226, 18, 13708, {1, 3, 3, 15, 1, 41, 23, 27, 167, 609, 913, 631, 923, 6939, 9793, 57869, 126577, 145271}}, {14227, 18, 13713, {1, 1, 3, 7, 27, 47, 127, 5, 213, 575, 559, 2541, 3457, 2903, 19529, 53395, 105353, 212607}}, {14228, 18, 13720, {1, 3, 1, 13, 27, 41, 31, 111, 371, 1019, 241, 2075, 2571, 10739, 28163, 16093, 41127, 69783}}, {14229, 18, 13730, {1, 1, 5, 1, 21, 9, 15, 141, 287, 675, 1721, 2291, 6587, 7503, 6363, 9109, 33547, 259627}}, {14230, 18, 13735, {1, 3, 7, 3, 3, 53, 7, 153, 183, 761, 191, 3735, 2619, 11153, 19601, 33855, 82345, 72755}}, {14231, 18, 13767, {1, 3, 1, 9, 19, 21, 41, 105, 281, 833, 981, 2733, 7179, 14691, 18365, 56283, 53719, 191601}}, {14232, 18, 13773, {1, 1, 7, 11, 23, 1, 55, 213, 105, 517, 809, 4087, 825, 7011, 15701, 54047, 123831, 49833}}, {14233, 18, 13792, {1, 1, 7, 13, 27, 9, 111, 57, 357, 95, 1489, 887, 5273, 2833, 8757, 9371, 44637, 94939}}, {14234, 18, 13843, {1, 1, 3, 5, 1, 17, 43, 31, 509, 353, 401, 1077, 7567, 9657, 15065, 32017, 8491, 214477}}, {14235, 18, 13891, {1, 1, 1, 15, 7, 59, 41, 99, 101, 845, 1479, 2153, 4281, 12839, 237, 54095, 125873, 57165}}, {14236, 18, 13946, {1, 3, 7, 13, 5, 17, 1, 249, 309, 351, 709, 3943, 7775, 6449, 26611, 54019, 121015, 213535}}, {14237, 18, 13967, {1, 1, 1, 5, 7, 25, 33, 149, 291, 777, 161, 2729, 117, 4999, 16781, 23383, 85161, 71689}}, {14238, 18, 13976, {1, 1, 3, 11, 5, 63, 119, 165, 45, 135, 1723, 811, 1259, 11055, 28625, 37559, 128401, 100715}}, {14239, 18, 14017, {1, 3, 7, 1, 1, 39, 11, 255, 423, 289, 1359, 2827, 4637, 4089, 26659, 58701, 117403, 133971}}, {14240, 18, 14030, {1, 1, 7, 1, 25, 9, 127, 121, 147, 831, 17, 3521, 1535, 10931, 17305, 56671, 22425, 157341}}, {14241, 18, 14041, {1, 3, 1, 15, 5, 55, 95, 95, 169, 497, 739, 2031, 339, 13461, 20619, 24553, 81805, 90789}}, {14242, 18, 14054, {1, 1, 7, 7, 7, 19, 15, 203, 287, 673, 1033, 3857, 2761, 10835, 11039, 62329, 37893, 6119}}, {14243, 18, 14058, {1, 1, 3, 11, 19, 35, 55, 9, 399, 443, 583, 89, 2387, 747, 9551, 9907, 96871, 175457}}, {14244, 18, 14060, {1, 1, 3, 1, 11, 57, 121, 89, 491, 133, 545, 683, 5751, 839, 25975, 44725, 59863, 142671}}, {14245, 18, 14063, {1, 1, 3, 1, 23, 1, 111, 177, 1, 103, 1933, 2783, 6857, 51, 14547, 5945, 14757, 39783}}, {14246, 18, 14078, {1, 3, 7, 13, 25, 13, 51, 247, 325, 361, 1225, 15, 1929, 1729, 25293, 59495, 82111, 101809}}, {14247, 18, 14080, {1, 3, 3, 1, 19, 37, 67, 85, 105, 589, 1273, 2995, 8017, 1613, 22189, 2549, 22671, 72813}}, {14248, 18, 14089, {1, 3, 7, 9, 15, 41, 25, 43, 411, 663, 387, 2861, 3627, 5839, 733, 53479, 76241, 116763}}, {14249, 18, 14131, {1, 3, 3, 3, 17, 5, 73, 153, 133, 247, 881, 2853, 6059, 2259, 10181, 63251, 107089, 22579}}, {14250, 18, 14134, {1, 3, 1, 5, 11, 15, 17, 235, 23, 15, 521, 235, 4137, 12705, 24775, 18197, 56295, 28035}}, {14251, 18, 14137, {1, 3, 5, 5, 13, 9, 77, 69, 19, 755, 1663, 1499, 1049, 12935, 28835, 55413, 71511, 221223}}, {14252, 18, 14188, {1, 1, 1, 1, 27, 31, 21, 39, 197, 519, 1621, 3703, 2541, 8865, 21947, 53605, 114551, 205697}}, {14253, 18, 14215, {1, 1, 1, 13, 11, 53, 41, 245, 495, 275, 385, 3071, 1913, 11135, 8571, 58551, 39049, 5459}}, {14254, 18, 14222, {1, 3, 5, 5, 11, 63, 25, 173, 57, 441, 1749, 79, 3191, 7733, 13111, 23453, 118399, 101845}}, {14255, 18, 14249, {1, 1, 3, 11, 29, 25, 119, 39, 65, 623, 517, 1325, 5981, 8381, 32031, 25585, 105537, 214241}}, {14256, 18, 14292, {1, 3, 5, 9, 21, 43, 13, 69, 109, 311, 1893, 1941, 2491, 7815, 4067, 56749, 33761, 191145}}, {14257, 18, 14320, {1, 1, 1, 7, 9, 5, 123, 149, 65, 729, 1967, 3089, 3757, 2333, 24587, 36047, 118105, 146277}}, {14258, 18, 14339, {1, 3, 7, 13, 9, 35, 39, 219, 161, 93, 275, 3619, 353, 14595, 24673, 54753, 117175, 81891}}, {14259, 18, 14346, {1, 3, 3, 13, 15, 61, 95, 135, 271, 595, 1103, 877, 747, 2535, 7733, 25509, 65673, 62089}}, {14260, 18, 14353, {1, 3, 3, 5, 21, 21, 67, 5, 373, 377, 61, 2337, 489, 5801, 23203, 42377, 7801, 178095}}, {14261, 18, 14365, {1, 1, 7, 5, 25, 17, 61, 133, 181, 261, 1627, 1615, 6851, 4763, 30353, 53349, 7545, 66733}}, {14262, 18, 14384, {1, 3, 5, 7, 29, 3, 85, 231, 121, 669, 1925, 403, 777, 10605, 24125, 60819, 8253, 81209}}, {14263, 18, 14414, {1, 1, 5, 3, 5, 5, 1, 53, 9, 445, 1339, 2643, 5527, 13757, 9409, 31993, 80845, 97863}}, {14264, 18, 14428, {1, 1, 7, 13, 29, 49, 97, 89, 319, 349, 1739, 3615, 1113, 11791, 17429, 37195, 1159, 32211}}, {14265, 18, 14435, {1, 3, 5, 11, 9, 61, 109, 167, 119, 499, 1157, 3615, 5773, 8839, 27915, 47837, 14945, 187225}}, {14266, 18, 14483, {1, 1, 5, 1, 9, 3, 7, 179, 323, 279, 43, 1337, 4813, 9917, 2033, 34657, 130769, 208089}}, {14267, 18, 14486, {1, 1, 3, 1, 31, 57, 57, 73, 21, 661, 1861, 1661, 7619, 12155, 23123, 49751, 130697, 74143}}, {14268, 18, 14506, {1, 3, 3, 13, 11, 61, 95, 75, 227, 491, 463, 597, 2721, 12323, 26195, 53657, 44413, 68965}}, {14269, 18, 14513, {1, 1, 7, 11, 5, 51, 103, 123, 203, 911, 203, 1641, 7009, 9479, 303, 37649, 32751, 172777}}, {14270, 18, 14520, {1, 1, 3, 7, 11, 59, 111, 5, 271, 863, 269, 3457, 489, 10877, 8645, 62567, 24893, 201587}}, {14271, 18, 14526, {1, 1, 5, 7, 29, 23, 127, 151, 371, 121, 1103, 3951, 3107, 15563, 6243, 1631, 75065, 107681}}, {14272, 18, 14528, {1, 1, 7, 15, 27, 45, 43, 83, 461, 673, 715, 3245, 313, 13731, 21981, 58853, 46569, 165463}}, {14273, 18, 14533, {1, 1, 1, 9, 7, 53, 63, 43, 3, 187, 1325, 447, 5113, 4993, 21807, 24329, 4499, 30067}}, {14274, 18, 14576, {1, 3, 1, 9, 21, 45, 111, 231, 407, 213, 1977, 2269, 2323, 4595, 30427, 54753, 95049, 195409}}, {14275, 18, 14599, {1, 1, 1, 9, 29, 43, 89, 201, 499, 329, 847, 3831, 5403, 13001, 6037, 14371, 25805, 169237}}, {14276, 18, 14613, {1, 1, 1, 11, 29, 61, 61, 203, 91, 189, 1603, 939, 6575, 3195, 4731, 44923, 33627, 21683}}, {14277, 18, 14639, {1, 3, 3, 11, 7, 57, 93, 181, 479, 99, 681, 2875, 7649, 5555, 27087, 6841, 69859, 153689}}, {14278, 18, 14644, {1, 1, 1, 9, 17, 45, 97, 47, 91, 879, 1463, 3041, 2917, 769, 13675, 26489, 88559, 120991}}, {14279, 18, 14653, {1, 3, 7, 1, 11, 13, 43, 9, 483, 399, 793, 3965, 2375, 4957, 17747, 50905, 56987, 231265}}, {14280, 18, 14662, {1, 3, 3, 13, 23, 45, 69, 67, 397, 437, 1993, 2569, 8035, 8531, 27623, 53567, 123189, 242515}}, {14281, 18, 14695, {1, 1, 1, 3, 5, 9, 21, 227, 499, 205, 431, 3711, 5307, 15773, 11337, 6349, 123507, 95941}}, {14282, 18, 14704, {1, 3, 7, 1, 13, 15, 101, 91, 209, 611, 537, 1427, 101, 2619, 10513, 44323, 92745, 249127}}, {14283, 18, 14713, {1, 3, 3, 1, 21, 7, 79, 241, 273, 567, 605, 2371, 5427, 15147, 20139, 40987, 75551, 236213}}, {14284, 18, 14725, {1, 1, 7, 11, 25, 19, 77, 209, 313, 663, 115, 3697, 3641, 12461, 9877, 18331, 70809, 78923}}, {14285, 18, 14783, {1, 1, 5, 5, 29, 45, 7, 207, 1, 357, 1089, 3861, 4161, 3209, 27845, 20947, 68909, 125179}}, {14286, 18, 14810, {1, 3, 1, 13, 17, 11, 27, 165, 179, 489, 1611, 2801, 2385, 2971, 6777, 16149, 59811, 151043}}, {14287, 18, 14816, {1, 1, 3, 3, 17, 53, 121, 227, 7, 71, 1855, 639, 5135, 6349, 7163, 22997, 112551, 44167}}, {14288, 18, 14822, {1, 3, 1, 11, 15, 9, 125, 213, 485, 291, 1781, 3621, 7529, 13353, 13903, 24151, 130253, 187097}}, {14289, 18, 14828, {1, 3, 1, 3, 1, 61, 39, 157, 455, 945, 739, 589, 7259, 7149, 16455, 12649, 72003, 152419}}, {14290, 18, 14883, {1, 1, 3, 3, 31, 23, 17, 255, 319, 907, 563, 2571, 2149, 15323, 20289, 46061, 32769, 184353}}, {14291, 18, 14889, {1, 3, 7, 9, 21, 51, 27, 13, 495, 909, 2039, 1435, 4791, 10037, 30119, 3405, 22535, 42247}}, {14292, 18, 14904, {1, 1, 3, 15, 11, 25, 123, 149, 185, 635, 473, 527, 433, 10373, 18205, 853, 94619, 202507}}, {14293, 18, 14917, {1, 1, 7, 15, 7, 39, 7, 69, 157, 533, 369, 4031, 1335, 4279, 8049, 28491, 103753, 257477}}, {14294, 18, 14927, {1, 3, 1, 15, 29, 51, 113, 77, 5, 961, 1863, 1477, 5009, 9519, 32029, 2367, 55705, 149597}}, {14295, 18, 14941, {1, 3, 1, 5, 19, 43, 49, 107, 59, 693, 867, 3011, 2703, 3633, 24567, 52621, 35839, 134823}}, {14296, 18, 14946, {1, 3, 3, 7, 19, 15, 81, 105, 23, 375, 451, 3017, 1263, 7589, 24453, 21885, 57651, 52613}}, {14297, 18, 14952, {1, 1, 3, 7, 3, 59, 19, 1, 3, 243, 1891, 2041, 4707, 15557, 28885, 5959, 22517, 237131}}, {14298, 18, 15010, {1, 3, 7, 11, 25, 33, 105, 15, 245, 247, 1357, 1255, 7463, 4815, 13727, 41687, 112425, 58827}}, {14299, 18, 15012, {1, 1, 7, 1, 19, 31, 37, 201, 217, 127, 927, 763, 6359, 9951, 2581, 49171, 104305, 215923}}, {14300, 18, 15033, {1, 1, 7, 7, 13, 9, 9, 139, 363, 85, 1703, 3615, 2545, 15991, 20677, 12109, 54951, 2171}}, {14301, 18, 15041, {1, 3, 1, 13, 27, 3, 37, 195, 185, 829, 815, 1621, 2917, 8643, 29071, 45523, 38475, 243505}}, {14302, 18, 15047, {1, 1, 7, 3, 19, 29, 91, 85, 331, 231, 1609, 2583, 1091, 4191, 29929, 55377, 105077, 168425}}, {14303, 18, 15066, {1, 1, 5, 3, 29, 35, 3, 61, 389, 339, 705, 473, 2075, 7373, 9699, 38809, 60415, 66423}}, {14304, 18, 15068, {1, 3, 1, 5, 17, 25, 17, 37, 335, 787, 1891, 1861, 4325, 12721, 9675, 13671, 18655, 235443}}, {14305, 18, 15072, {1, 3, 3, 5, 23, 13, 83, 191, 263, 325, 1847, 1717, 7089, 15709, 26567, 44489, 66523, 3107}}, {14306, 18, 15095, {1, 3, 7, 7, 25, 29, 63, 55, 9, 481, 899, 669, 5481, 11227, 1637, 17017, 124509, 102775}}, {14307, 18, 15150, {1, 1, 1, 5, 21, 41, 101, 93, 129, 1023, 561, 2969, 1525, 2929, 32729, 54513, 4359, 28745}}, {14308, 18, 15152, {1, 1, 5, 13, 15, 13, 79, 9, 257, 535, 861, 2703, 6161, 6659, 10369, 7, 117467, 146651}}, {14309, 18, 15175, {1, 1, 3, 13, 31, 11, 43, 95, 441, 921, 1323, 343, 5339, 13149, 19643, 24253, 32055, 180327}}, {14310, 18, 15176, {1, 1, 5, 15, 11, 27, 109, 149, 255, 1021, 249, 1913, 5213, 301, 9939, 49779, 26097, 66007}}, {14311, 18, 15210, {1, 3, 1, 11, 15, 33, 53, 159, 433, 167, 1107, 3577, 6231, 8309, 28125, 55381, 127309, 14459}}, {14312, 18, 15245, {1, 3, 5, 9, 7, 3, 45, 139, 133, 359, 537, 805, 3931, 5181, 915, 63317, 86227, 231573}}, {14313, 18, 15258, {1, 1, 1, 3, 11, 31, 97, 127, 117, 151, 711, 2457, 2777, 3855, 21829, 7913, 30785, 141449}}, {14314, 18, 15263, {1, 3, 7, 13, 11, 17, 65, 63, 289, 851, 1929, 4021, 105, 5207, 17085, 64119, 48659, 31687}}, {14315, 18, 15264, {1, 1, 7, 11, 31, 57, 63, 251, 341, 727, 505, 1851, 783, 16191, 9335, 39421, 14793, 238215}}, {14316, 18, 15279, {1, 3, 3, 11, 23, 13, 119, 195, 117, 579, 693, 3059, 2967, 12791, 26905, 28527, 13393, 11869}}, {14317, 18, 15301, {1, 3, 7, 11, 23, 7, 61, 143, 409, 309, 651, 3321, 4027, 1351, 10339, 18451, 18447, 235665}}, {14318, 18, 15306, {1, 1, 1, 9, 13, 21, 7, 65, 103, 789, 973, 475, 2831, 13337, 18989, 40573, 105375, 2221}}, {14319, 18, 15313, {1, 3, 5, 15, 3, 59, 115, 61, 365, 653, 523, 3927, 8175, 6751, 32561, 55919, 64903, 139005}}, {14320, 18, 15329, {1, 3, 3, 13, 1, 7, 51, 63, 179, 525, 1899, 373, 3797, 6329, 5539, 32669, 65903, 154993}}, {14321, 18, 15341, {1, 3, 1, 1, 31, 53, 87, 39, 317, 71, 1899, 925, 4719, 11645, 27125, 50391, 116491, 219271}}, {14322, 18, 15367, {1, 3, 7, 13, 7, 23, 1, 57, 333, 277, 893, 3245, 1417, 13115, 21835, 25879, 91305, 54691}}, {14323, 18, 15368, {1, 3, 1, 11, 27, 5, 109, 69, 221, 453, 299, 517, 609, 11959, 27789, 33107, 46559, 121673}}, {14324, 18, 15386, {1, 3, 5, 7, 27, 7, 119, 169, 129, 643, 173, 2479, 6163, 11159, 11897, 57153, 11347, 135337}}, {14325, 18, 15404, {1, 1, 5, 13, 13, 59, 21, 13, 429, 601, 267, 1635, 2579, 12053, 31583, 14847, 78187, 217099}}, {14326, 18, 15422, {1, 3, 5, 9, 5, 3, 125, 159, 411, 15, 479, 933, 6307, 9707, 23491, 6501, 70993, 161365}}, {14327, 18, 15436, {1, 1, 7, 7, 3, 33, 87, 177, 283, 825, 1935, 1545, 7071, 9975, 1795, 48277, 115725, 173439}}, {14328, 18, 15444, {1, 3, 3, 9, 19, 63, 17, 119, 13, 337, 2021, 2221, 3237, 3253, 18661, 15479, 59377, 76095}}, {14329, 18, 15467, {1, 1, 1, 11, 17, 15, 93, 249, 333, 171, 575, 3251, 5413, 3587, 22807, 29273, 56461, 97801}}, {14330, 18, 15498, {1, 3, 3, 11, 13, 7, 27, 167, 389, 693, 1473, 555, 1603, 3167, 3985, 3841, 100283, 195253}}, {14331, 18, 15503, {1, 3, 7, 1, 23, 7, 89, 231, 85, 797, 1935, 2557, 4365, 2221, 21069, 44055, 77723, 226547}}, {14332, 18, 15528, {1, 3, 1, 5, 5, 49, 47, 187, 71, 903, 1279, 3219, 8041, 10915, 5249, 17755, 80077, 3479}}, {14333, 18, 15534, {1, 1, 3, 13, 5, 53, 35, 25, 183, 791, 1651, 1041, 1221, 2171, 26221, 20649, 126851, 163047}}, {14334, 18, 15536, {1, 1, 5, 9, 29, 3, 75, 31, 385, 293, 171, 3023, 2075, 14541, 30879, 13895, 67637, 87831}}, {14335, 18, 15559, {1, 3, 5, 7, 3, 41, 115, 213, 23, 895, 361, 27, 5839, 12447, 13829, 29183, 106539, 134891}}, {14336, 18, 15565, {1, 3, 7, 7, 11, 39, 99, 229, 195, 633, 837, 3697, 1161, 15119, 20831, 27371, 92195, 26993}}, {14337, 18, 15583, {1, 1, 5, 9, 25, 17, 5, 169, 475, 73, 1451, 2057, 3671, 12801, 9671, 57427, 25321, 154969}}, {14338, 18, 15599, {1, 3, 5, 11, 25, 23, 9, 145, 341, 339, 1855, 981, 8041, 569, 19851, 29521, 21767, 136505}}, {14339, 18, 15602, {1, 1, 1, 1, 3, 9, 101, 253, 475, 529, 387, 1893, 5509, 5763, 29555, 13307, 30001, 105057}}, {14340, 18, 15616, {1, 3, 3, 5, 17, 23, 127, 161, 375, 817, 1229, 1197, 1097, 3053, 14351, 21213, 12501, 137397}}, {14341, 18, 15626, {1, 1, 1, 9, 7, 1, 57, 185, 281, 65, 181, 2483, 4739, 4353, 29837, 40613, 32489, 23317}}, {14342, 18, 15667, {1, 1, 3, 9, 5, 35, 43, 191, 409, 95, 537, 2465, 515, 1633, 20887, 32535, 43863, 199885}}, {14343, 18, 15684, {1, 3, 3, 13, 19, 49, 41, 51, 3, 979, 1623, 3323, 7711, 3707, 29417, 58011, 114467, 227499}}, {14344, 18, 15711, {1, 1, 1, 11, 21, 7, 23, 51, 39, 25, 1971, 213, 369, 9149, 12845, 57631, 16597, 22031}}, {14345, 18, 15745, {1, 3, 3, 11, 27, 59, 71, 37, 461, 353, 2041, 1961, 4643, 6953, 18129, 60337, 82769, 20819}}, {14346, 18, 15763, {1, 1, 3, 11, 25, 19, 17, 5, 503, 227, 2021, 733, 2867, 201, 25779, 49811, 81167, 95437}}, {14347, 18, 15779, {1, 3, 3, 15, 7, 53, 35, 143, 27, 937, 215, 3249, 4151, 1933, 25267, 18047, 35131, 25903}}, {14348, 18, 15811, {1, 1, 1, 3, 3, 39, 71, 99, 291, 97, 1389, 3803, 2881, 9765, 11277, 20071, 15133, 37349}}, {14349, 18, 15814, {1, 1, 7, 11, 9, 55, 1, 241, 391, 935, 1555, 3585, 1807, 10057, 2633, 14023, 14409, 199643}}, {14350, 18, 15817, {1, 3, 3, 3, 19, 9, 57, 237, 107, 869, 147, 2673, 5271, 8999, 20723, 63017, 75989, 20131}}, {14351, 18, 15853, {1, 3, 3, 3, 25, 11, 61, 77, 119, 657, 2011, 3489, 7835, 4473, 2531, 65231, 104797, 161443}}, {14352, 18, 15881, {1, 1, 5, 5, 11, 63, 25, 93, 181, 797, 367, 3357, 5291, 5087, 28661, 34093, 75195, 165345}}, {14353, 18, 15890, {1, 1, 1, 7, 17, 1, 77, 149, 59, 633, 1551, 1305, 7677, 8671, 17457, 64037, 104451, 112387}}, {14354, 18, 15899, {1, 3, 1, 1, 15, 33, 37, 187, 247, 261, 1101, 3451, 7747, 12197, 22465, 30589, 12573, 204517}}, {14355, 18, 15905, {1, 3, 3, 11, 3, 39, 71, 139, 145, 139, 101, 2815, 3457, 14033, 4531, 42133, 54147, 71259}}, {14356, 18, 15915, {1, 3, 1, 1, 23, 37, 19, 113, 443, 57, 439, 2929, 3835, 5431, 11189, 4539, 72531, 124453}}, {14357, 18, 15937, {1, 3, 3, 5, 3, 17, 21, 217, 41, 665, 1565, 3753, 5289, 9789, 29205, 16453, 88979, 171387}}, {14358, 18, 15950, {1, 3, 3, 13, 27, 15, 15, 223, 231, 311, 311, 1143, 8113, 13863, 3191, 51103, 109437, 245557}}, {14359, 18, 16002, {1, 1, 3, 13, 11, 59, 7, 191, 477, 683, 353, 2845, 7623, 9035, 453, 48429, 40111, 162859}}, {14360, 18, 16041, {1, 3, 7, 5, 29, 37, 55, 59, 259, 851, 861, 1951, 7847, 8537, 30107, 2999, 59137, 155615}}, {14361, 18, 16042, {1, 3, 7, 11, 3, 13, 73, 147, 393, 327, 1289, 37, 795, 1413, 19215, 28345, 124301, 23135}}, {14362, 18, 16052, {1, 1, 5, 11, 29, 17, 107, 69, 433, 845, 1351, 2551, 807, 15315, 15511, 39475, 84879, 129405}}, {14363, 18, 16121, {1, 3, 3, 9, 15, 3, 23, 5, 211, 871, 689, 2319, 39, 2215, 25171, 43169, 113715, 186049}}, {14364, 18, 16132, {1, 1, 3, 7, 3, 37, 23, 9, 453, 649, 373, 1273, 1539, 6221, 27469, 44675, 13513, 131179}}, {14365, 18, 16136, {1, 3, 1, 5, 29, 41, 119, 133, 37, 761, 1193, 2311, 4945, 7337, 17027, 12873, 51489, 160633}}, {14366, 18, 16150, {1, 3, 1, 3, 21, 63, 75, 115, 105, 223, 933, 445, 5789, 4611, 13609, 2873, 16679, 222895}}, {14367, 18, 16153, {1, 1, 7, 5, 17, 13, 15, 217, 193, 863, 1319, 2337, 3055, 14879, 8669, 5705, 42965, 166443}}, {14368, 18, 16180, {1, 1, 7, 11, 3, 55, 57, 131, 289, 843, 1693, 881, 6737, 5557, 18365, 12393, 38479, 189177}}, {14369, 18, 16190, {1, 1, 3, 5, 3, 59, 13, 123, 397, 479, 79, 569, 535, 2529, 26225, 43475, 76925, 187763}}, {14370, 18, 16192, {1, 1, 5, 15, 15, 37, 1, 97, 489, 331, 1499, 1759, 3621, 5373, 1425, 6477, 45805, 235511}}, {14371, 18, 16195, {1, 3, 1, 3, 7, 51, 55, 157, 61, 751, 1881, 4093, 2557, 11129, 23239, 16335, 8949, 205007}}, {14372, 18, 16210, {1, 1, 1, 1, 13, 21, 67, 141, 85, 1023, 223, 747, 1951, 10279, 6399, 49887, 100437, 76757}}, {14373, 18, 16225, {1, 1, 3, 11, 1, 51, 29, 33, 173, 769, 879, 2883, 417, 15031, 13377, 63919, 118803, 87969}}, {14374, 18, 16256, {1, 1, 1, 5, 1, 1, 17, 153, 81, 691, 961, 3399, 5005, 10617, 18467, 13775, 34905, 241349}}, {14375, 18, 16266, {1, 1, 1, 13, 7, 37, 57, 187, 389, 575, 1827, 2017, 4541, 10513, 23409, 30945, 126855, 239657}}, {14376, 18, 16274, {1, 1, 5, 5, 17, 41, 83, 177, 285, 695, 29, 1653, 953, 6377, 13571, 58663, 9265, 100759}}, {14377, 18, 16302, {1, 3, 5, 3, 5, 13, 27, 153, 207, 699, 1805, 947, 979, 2719, 389, 61953, 16991, 160073}}, {14378, 18, 16310, {1, 1, 7, 13, 17, 37, 113, 185, 239, 455, 1557, 3201, 1111, 4875, 23197, 41883, 70507, 255047}}, {14379, 18, 16322, {1, 3, 5, 11, 9, 51, 47, 137, 413, 1015, 259, 1829, 6043, 11757, 22317, 15155, 107827, 171003}}, {14380, 18, 16339, {1, 1, 1, 13, 27, 7, 49, 91, 285, 13, 2007, 3469, 1223, 2483, 16155, 8413, 10529, 224195}}, {14381, 18, 16345, {1, 1, 7, 3, 9, 49, 119, 81, 331, 187, 1695, 1729, 533, 6359, 7053, 34665, 37541, 100225}}, {14382, 18, 16348, {1, 3, 7, 1, 7, 35, 115, 91, 479, 515, 1249, 121, 2885, 16383, 1777, 44205, 86459, 255885}}, {14383, 18, 16357, {1, 1, 7, 13, 13, 27, 11, 49, 221, 829, 1787, 2889, 3875, 1679, 25333, 1323, 9813, 189373}}, {14384, 18, 16382, {1, 3, 7, 5, 31, 5, 117, 77, 209, 619, 191, 2969, 2221, 15339, 11461, 64201, 130461, 204467}}, {14385, 18, 16402, {1, 3, 1, 1, 29, 5, 91, 31, 313, 901, 1501, 2837, 3615, 7765, 341, 13873, 21663, 260637}}, {14386, 18, 16461, {1, 1, 1, 9, 1, 41, 97, 15, 141, 901, 1309, 3341, 4871, 16033, 12343, 1555, 94989, 78295}}, {14387, 18, 16469, {1, 1, 7, 3, 3, 15, 1, 29, 445, 59, 475, 3033, 4227, 3219, 6093, 58953, 92179, 49343}}, {14388, 18, 16474, {1, 1, 5, 3, 27, 25, 109, 13, 219, 983, 131, 2517, 1161, 16063, 32737, 6077, 91183, 37457}}, {14389, 18, 16483, {1, 3, 3, 1, 3, 1, 85, 147, 17, 543, 1475, 3873, 3719, 2737, 30977, 15953, 66077, 258979}}, {14390, 18, 16497, {1, 3, 5, 1, 29, 9, 21, 51, 5, 985, 1177, 3287, 2183, 7301, 13713, 53403, 38439, 195863}}, {14391, 18, 16523, {1, 1, 7, 15, 31, 53, 47, 173, 477, 439, 751, 1019, 3371, 9319, 17995, 29029, 90657, 209277}}, {14392, 18, 16534, {1, 1, 5, 5, 17, 5, 59, 115, 375, 231, 1891, 1321, 3639, 16117, 32639, 28793, 68213, 41091}}, {14393, 18, 16550, {1, 3, 5, 11, 17, 15, 13, 11, 459, 767, 849, 1407, 6611, 6409, 21515, 63175, 127155, 171959}}, {14394, 18, 16564, {1, 1, 5, 1, 17, 49, 61, 161, 399, 137, 845, 2673, 2431, 15343, 389, 42337, 23031, 94811}}, {14395, 18, 16582, {1, 1, 1, 9, 21, 23, 75, 177, 351, 197, 1619, 2443, 6829, 3773, 16399, 31949, 44975, 221363}}, {14396, 18, 16591, {1, 1, 3, 1, 11, 19, 103, 61, 135, 863, 1427, 2657, 4553, 1277, 20249, 3973, 25467, 18847}}, {14397, 18, 16609, {1, 3, 3, 13, 17, 31, 19, 163, 323, 195, 603, 4069, 3181, 12069, 22117, 44229, 23585, 202785}}, {14398, 18, 16642, {1, 1, 7, 5, 17, 3, 77, 111, 491, 829, 1375, 2829, 5599, 14057, 21387, 52345, 108281, 211285}}, {14399, 18, 16648, {1, 3, 3, 1, 17, 43, 71, 13, 321, 393, 1803, 727, 5101, 13485, 8693, 60505, 13893, 3467}}, {14400, 18, 16656, {1, 1, 5, 1, 23, 31, 121, 15, 215, 215, 1113, 3335, 7431, 4863, 31429, 49903, 59403, 60797}}, {14401, 18, 16662, {1, 3, 3, 9, 21, 43, 61, 171, 361, 323, 1895, 3647, 729, 8809, 9351, 14573, 93593, 17485}}, {14402, 18, 16665, {1, 3, 3, 7, 7, 19, 45, 247, 203, 757, 1941, 3753, 5317, 13239, 18945, 26173, 43929, 66889}}, {14403, 18, 16678, {1, 1, 1, 15, 5, 17, 11, 21, 193, 941, 517, 191, 6067, 8403, 27339, 31035, 34767, 28675}}, {14404, 18, 16701, {1, 3, 1, 7, 27, 59, 27, 7, 491, 551, 867, 3693, 391, 9799, 11051, 28347, 57555, 23079}}, {14405, 18, 16713, {1, 3, 3, 1, 25, 21, 63, 253, 459, 603, 107, 1229, 1433, 4263, 24341, 20493, 40165, 254725}}, {14406, 18, 16716, {1, 3, 5, 3, 9, 7, 63, 195, 19, 973, 47, 811, 2207, 3613, 8911, 17495, 62403, 77951}}, {14407, 18, 16758, {1, 3, 5, 11, 5, 13, 83, 125, 467, 111, 1819, 3807, 4259, 2885, 29577, 13539, 69859, 97379}}, {14408, 18, 16768, {1, 1, 5, 15, 5, 33, 109, 203, 129, 587, 9, 3025, 2839, 11405, 11257, 7779, 30311, 14015}}, {14409, 18, 16797, {1, 1, 7, 15, 5, 47, 103, 199, 391, 61, 129, 3511, 1295, 15067, 23919, 2941, 120463, 21665}}, {14410, 18, 16804, {1, 1, 5, 5, 7, 7, 125, 153, 365, 815, 1423, 4053, 875, 2405, 21291, 26785, 31371, 211045}}, {14411, 18, 16811, {1, 3, 3, 9, 31, 47, 1, 247, 197, 1019, 985, 2277, 875, 3969, 15093, 15561, 110101, 156547}}, {14412, 18, 16813, {1, 1, 3, 1, 9, 47, 71, 125, 17, 501, 1783, 2337, 483, 12719, 22453, 16701, 102639, 152955}}, {14413, 18, 16881, {1, 1, 3, 11, 13, 31, 9, 63, 261, 257, 319, 1443, 5011, 9799, 18639, 53081, 56879, 102335}}, {14414, 18, 16888, {1, 3, 3, 1, 5, 59, 127, 163, 323, 997, 1755, 1445, 2285, 4935, 22123, 815, 115131, 1009}}, {14415, 18, 16893, {1, 1, 3, 11, 11, 43, 65, 127, 137, 583, 173, 2601, 5809, 15773, 16129, 2543, 68281, 96107}}, {14416, 18, 16922, {1, 3, 5, 9, 25, 25, 95, 73, 313, 893, 1805, 2301, 5917, 15159, 8637, 25505, 66053, 31627}}, {14417, 18, 16937, {1, 1, 3, 7, 25, 59, 55, 13, 297, 849, 187, 359, 3745, 12655, 29293, 58581, 89799, 195867}}, {14418, 18, 16958, {1, 1, 5, 13, 19, 5, 51, 85, 259, 59, 1003, 2991, 6605, 8405, 5221, 45607, 130729, 99641}}, {14419, 18, 16965, {1, 3, 5, 5, 25, 61, 51, 211, 143, 233, 1465, 1165, 1769, 3021, 9491, 30335, 34787, 142605}}, {14420, 18, 16978, {1, 3, 5, 13, 23, 9, 89, 249, 71, 179, 841, 3375, 21, 6757, 27495, 7531, 123725, 253855}}, {14421, 18, 16980, {1, 3, 7, 13, 9, 33, 109, 103, 475, 781, 493, 2079, 6529, 13443, 2181, 26925, 31345, 142863}}, {14422, 18, 16989, {1, 1, 7, 9, 15, 41, 17, 85, 503, 839, 533, 731, 2735, 12949, 11395, 22539, 130147, 40045}}, {14423, 18, 17011, {1, 1, 5, 9, 25, 21, 29, 79, 405, 383, 1271, 385, 7629, 3889, 5319, 57739, 51411, 50895}}, {14424, 18, 17014, {1, 3, 7, 5, 13, 35, 17, 97, 261, 437, 951, 1403, 2407, 11447, 13565, 10165, 100001, 253093}}, {14425, 18, 17023, {1, 3, 1, 3, 11, 39, 31, 187, 473, 565, 351, 4007, 2621, 14463, 9009, 40679, 81069, 51131}}, {14426, 18, 17063, {1, 3, 5, 5, 9, 17, 11, 151, 59, 249, 281, 203, 6423, 4977, 18557, 65383, 88361, 87437}}, {14427, 18, 17081, {1, 3, 5, 7, 15, 25, 3, 157, 179, 439, 1627, 3493, 6641, 6403, 2361, 3613, 33817, 22585}}, {14428, 18, 17084, {1, 3, 5, 1, 13, 63, 77, 195, 233, 175, 631, 1021, 637, 13231, 26187, 131, 127379, 256183}}, {14429, 18, 17099, {1, 1, 7, 9, 5, 13, 15, 187, 55, 37, 1113, 2191, 3439, 1073, 26239, 3049, 19807, 250869}}, {14430, 18, 17126, {1, 1, 7, 3, 13, 15, 77, 47, 317, 285, 753, 2419, 7795, 11423, 6043, 2913, 42819, 50603}}, {14431, 18, 17129, {1, 3, 7, 15, 21, 17, 63, 71, 97, 535, 1085, 1531, 5165, 13717, 1537, 26797, 111787, 189403}}, {14432, 18, 17138, {1, 1, 1, 7, 9, 3, 43, 209, 385, 851, 1411, 4039, 3259, 13387, 24505, 33325, 83741, 241255}}, {14433, 18, 17164, {1, 1, 1, 1, 3, 41, 13, 43, 303, 445, 1097, 3517, 7753, 8459, 3017, 16385, 13775, 248655}}, {14434, 18, 17170, {1, 3, 5, 15, 5, 61, 31, 57, 269, 931, 1071, 1137, 6181, 13005, 18493, 1345, 105203, 117309}}, {14435, 18, 17203, {1, 1, 3, 13, 21, 29, 3, 179, 367, 155, 993, 117, 5849, 10181, 1175, 55769, 16025, 67669}}, {14436, 18, 17206, {1, 1, 3, 9, 11, 9, 33, 131, 181, 1003, 253, 2759, 1877, 11851, 22959, 37823, 82737, 110329}}, {14437, 18, 17224, {1, 1, 1, 5, 7, 5, 107, 191, 385, 129, 567, 2585, 7295, 3005, 28185, 7095, 54851, 257587}}, {14438, 18, 17305, {1, 3, 7, 9, 21, 61, 103, 155, 503, 307, 993, 683, 1491, 14895, 9213, 34535, 17765, 12457}}, {14439, 18, 17322, {1, 3, 3, 1, 7, 47, 27, 173, 97, 889, 853, 3995, 4943, 71, 20479, 16741, 35479, 35307}}, {14440, 18, 17327, {1, 1, 5, 3, 15, 35, 29, 207, 117, 267, 1835, 2565, 1199, 3813, 13999, 10537, 129915, 210651}}, {14441, 18, 17332, {1, 3, 3, 13, 5, 57, 77, 193, 11, 279, 745, 2511, 5775, 13527, 26329, 16303, 111511, 70025}}, {14442, 18, 17342, {1, 3, 7, 9, 17, 1, 73, 1, 125, 939, 863, 2763, 1951, 3191, 5567, 59729, 32149, 149417}}, {14443, 18, 17387, {1, 3, 3, 1, 19, 25, 119, 63, 101, 33, 77, 3587, 6367, 8275, 24957, 32087, 7031, 217291}}, {14444, 18, 17410, {1, 1, 1, 13, 7, 25, 75, 161, 143, 353, 973, 2957, 749, 13519, 11295, 34287, 60727, 83731}}, {14445, 18, 17419, {1, 3, 7, 7, 17, 9, 59, 45, 97, 619, 895, 1955, 8143, 2507, 4673, 39425, 35679, 152069}}, {14446, 18, 17429, {1, 1, 5, 9, 31, 19, 115, 177, 349, 877, 525, 305, 2187, 12195, 13529, 61641, 102293, 69941}}, {14447, 18, 17439, {1, 3, 7, 11, 23, 59, 15, 243, 511, 465, 905, 1979, 2263, 2105, 9009, 3691, 22241, 97765}}, {14448, 18, 17440, {1, 1, 7, 9, 29, 13, 3, 207, 51, 405, 1703, 1923, 1781, 14723, 8103, 10707, 64799, 99349}}, {14449, 18, 17457, {1, 1, 7, 5, 23, 29, 51, 63, 489, 273, 1577, 2807, 5427, 9949, 1929, 19791, 109405, 241465}}, {14450, 18, 17458, {1, 3, 3, 7, 29, 61, 103, 55, 29, 17, 1081, 21, 5791, 9803, 19385, 45091, 118069, 61383}}, {14451, 18, 17469, {1, 3, 1, 7, 3, 15, 75, 47, 475, 87, 1541, 3933, 1081, 12361, 29213, 64333, 7229, 226909}}, {14452, 18, 17477, {1, 1, 5, 7, 21, 45, 19, 137, 351, 229, 1773, 1829, 5025, 12661, 18745, 54917, 10419, 176667}}, {14453, 18, 17512, {1, 1, 1, 3, 9, 37, 81, 25, 11, 327, 1653, 2751, 2823, 12575, 30287, 46265, 17299, 93595}}, {14454, 18, 17518, {1, 1, 1, 3, 15, 17, 43, 163, 223, 731, 631, 2813, 1723, 6089, 14245, 64339, 114291, 40331}}, {14455, 18, 17532, {1, 3, 7, 5, 21, 45, 41, 17, 495, 61, 1369, 369, 4493, 12071, 3813, 41455, 62561, 174399}}, {14456, 18, 17536, {1, 1, 1, 5, 9, 41, 95, 113, 109, 519, 1683, 2265, 2875, 12649, 15575, 53511, 100707, 224035}}, {14457, 18, 17559, {1, 3, 7, 9, 29, 7, 109, 109, 283, 111, 1167, 3679, 369, 11597, 19459, 759, 128667, 172427}}, {14458, 18, 17569, {1, 1, 1, 3, 13, 31, 97, 31, 477, 507, 835, 465, 7501, 2485, 19485, 51055, 56363, 229341}}, {14459, 18, 17641, {1, 3, 5, 11, 3, 23, 67, 173, 99, 963, 977, 1949, 1263, 2427, 15181, 23571, 23509, 26481}}, {14460, 18, 17667, {1, 3, 3, 1, 29, 3, 35, 191, 197, 277, 397, 205, 5945, 1069, 31789, 3551, 101901, 222609}}, {14461, 18, 17674, {1, 1, 5, 9, 11, 23, 109, 81, 295, 7, 755, 2345, 2823, 11133, 22623, 14515, 57059, 231099}}, {14462, 18, 17693, {1, 3, 1, 3, 21, 29, 37, 71, 111, 737, 1881, 871, 5843, 5889, 14615, 49909, 7105, 48335}}, {14463, 18, 17710, {1, 3, 1, 15, 23, 31, 87, 181, 483, 225, 2003, 365, 1569, 11153, 14673, 30085, 56497, 203723}}, {14464, 18, 17729, {1, 1, 3, 15, 17, 47, 99, 167, 485, 431, 1481, 2225, 1537, 8513, 19407, 34165, 27289, 84393}}, {14465, 18, 17754, {1, 3, 7, 3, 11, 17, 115, 205, 403, 831, 1869, 3623, 5215, 15511, 11297, 25181, 127491, 155887}}, {14466, 18, 17763, {1, 1, 7, 5, 31, 37, 23, 21, 403, 529, 1185, 3363, 6319, 2435, 2687, 39407, 121891, 133047}}, {14467, 18, 17780, {1, 3, 7, 1, 21, 31, 43, 61, 371, 987, 1783, 3811, 6227, 13199, 31799, 28863, 49329, 73947}}, {14468, 18, 17784, {1, 3, 1, 1, 13, 1, 5, 99, 35, 793, 483, 2573, 2249, 6345, 12793, 61917, 49419, 58011}}, {14469, 18, 17790, {1, 3, 1, 15, 3, 45, 35, 189, 67, 447, 1455, 3575, 8191, 7907, 21559, 38211, 26945, 240679}}, {14470, 18, 17830, {1, 1, 3, 11, 27, 49, 9, 109, 93, 473, 1465, 271, 7389, 47, 8101, 6219, 17437, 220461}}, {14471, 18, 17851, {1, 1, 7, 3, 23, 31, 75, 61, 375, 901, 1329, 2603, 3469, 12957, 23949, 62183, 126763, 68965}}, {14472, 18, 17868, {1, 1, 7, 9, 13, 59, 75, 233, 339, 29, 1117, 1693, 593, 15317, 29753, 3079, 43583, 79939}}, {14473, 18, 17879, {1, 1, 5, 1, 17, 57, 81, 123, 101, 765, 1941, 3143, 7403, 9105, 23197, 28983, 128059, 5931}}, {14474, 18, 17896, {1, 3, 5, 11, 19, 31, 89, 165, 213, 251, 965, 3203, 1621, 4323, 26877, 17109, 18321, 162413}}, {14475, 18, 17901, {1, 3, 3, 9, 11, 59, 123, 213, 335, 267, 1767, 3317, 5189, 10149, 27921, 19331, 71541, 170501}}, {14476, 18, 17916, {1, 3, 3, 15, 3, 3, 115, 235, 305, 219, 265, 1535, 4925, 5597, 20857, 32381, 117237, 197533}}, {14477, 18, 17935, {1, 3, 5, 13, 13, 59, 93, 85, 419, 337, 513, 2131, 5665, 12229, 1389, 34355, 65485, 81141}}, {14478, 18, 17953, {1, 3, 7, 7, 11, 59, 111, 219, 293, 289, 325, 623, 3853, 3775, 14771, 5945, 119451, 162861}}, {14479, 18, 17991, {1, 3, 1, 11, 19, 33, 119, 239, 431, 803, 1119, 2445, 3203, 7219, 31963, 34519, 104953, 254491}}, {14480, 18, 18009, {1, 3, 7, 9, 21, 53, 21, 115, 365, 419, 11, 3803, 4283, 417, 8937, 64533, 56433, 166025}}, {14481, 18, 18016, {1, 1, 7, 3, 17, 5, 99, 143, 485, 309, 1255, 2641, 3427, 1681, 3301, 64531, 38629, 20945}}, {14482, 18, 18034, {1, 1, 5, 1, 31, 3, 115, 217, 451, 5, 1447, 2317, 1725, 12931, 25799, 23569, 51747, 28821}}, {14483, 18, 18061, {1, 3, 7, 3, 31, 55, 109, 107, 211, 381, 1067, 3973, 5007, 8939, 8605, 55221, 124603, 47115}}, {14484, 18, 18070, {1, 1, 1, 11, 19, 13, 99, 241, 103, 711, 1823, 2671, 653, 10217, 14195, 39735, 54807, 105599}}, {14485, 18, 18079, {1, 3, 3, 7, 9, 33, 43, 131, 493, 141, 827, 2909, 2847, 12879, 7879, 6263, 25981, 57323}}, {14486, 18, 18132, {1, 1, 1, 1, 1, 41, 55, 175, 479, 725, 157, 3403, 5809, 10685, 20433, 21729, 9493, 205685}}, {14487, 18, 18145, {1, 1, 7, 5, 1, 33, 31, 245, 109, 711, 1047, 941, 449, 1055, 16249, 45211, 48311, 171339}}, {14488, 18, 18169, {1, 3, 3, 9, 27, 9, 113, 69, 269, 643, 1371, 3521, 4969, 5373, 11133, 63109, 42725, 126969}}, {14489, 18, 18170, {1, 1, 5, 15, 9, 21, 1, 195, 421, 429, 1103, 2727, 463, 9801, 8955, 62841, 94687, 114509}}, {14490, 18, 18190, {1, 1, 5, 5, 5, 47, 9, 221, 59, 115, 359, 1147, 749, 1009, 23129, 641, 39471, 23073}}, {14491, 18, 18192, {1, 3, 5, 13, 27, 29, 19, 3, 121, 773, 625, 2757, 6377, 15867, 14563, 40391, 4351, 21153}}, {14492, 18, 18201, {1, 1, 5, 9, 11, 25, 51, 101, 273, 541, 1761, 593, 7111, 4369, 30095, 34867, 103989, 19855}}, {14493, 18, 18228, {1, 1, 3, 13, 27, 55, 79, 115, 105, 855, 627, 2227, 2927, 8757, 8713, 54607, 43671, 130153}}, {14494, 18, 18243, {1, 1, 3, 5, 7, 45, 21, 71, 157, 773, 1265, 841, 2463, 2217, 6087, 28683, 21251, 72377}}, {14495, 18, 18260, {1, 1, 3, 1, 15, 11, 117, 211, 223, 713, 545, 907, 6907, 41, 17039, 23079, 86657, 5765}}, {14496, 18, 18279, {1, 1, 5, 3, 27, 33, 77, 137, 401, 585, 911, 1189, 2749, 3427, 2701, 2453, 84857, 176585}}, {14497, 18, 18285, {1, 1, 1, 3, 7, 39, 73, 143, 29, 569, 939, 301, 7827, 7691, 11513, 64517, 113679, 234165}}, {14498, 18, 18297, {1, 3, 1, 11, 29, 57, 127, 181, 175, 973, 1537, 761, 5205, 13641, 32649, 8621, 77509, 261235}}, {14499, 18, 18300, {1, 3, 5, 5, 13, 19, 117, 225, 477, 297, 1807, 2357, 5653, 3791, 6325, 54877, 120659, 91013}}, {14500, 18, 18321, {1, 3, 1, 1, 3, 55, 19, 99, 321, 877, 541, 511, 141, 15047, 26377, 9, 2765, 223533}}, {14501, 18, 18344, {1, 1, 1, 11, 13, 59, 121, 147, 215, 117, 1047, 3055, 2129, 15191, 14425, 28327, 108541, 114275}}, {14502, 18, 18358, {1, 1, 1, 15, 3, 21, 105, 61, 501, 899, 195, 2745, 5989, 4433, 19525, 35477, 22997, 241657}}, {14503, 18, 18364, {1, 1, 3, 5, 19, 47, 77, 247, 413, 317, 1255, 2087, 4493, 2211, 9003, 22145, 94001, 50579}}, {14504, 18, 18376, {1, 3, 7, 11, 31, 47, 25, 191, 65, 409, 1349, 2481, 7619, 223, 18051, 63609, 77187, 75483}}, {14505, 18, 18390, {1, 1, 1, 9, 21, 59, 115, 251, 401, 91, 627, 3273, 2393, 2949, 11475, 23669, 16171, 77507}}, {14506, 18, 18399, {1, 3, 5, 1, 19, 7, 65, 253, 217, 493, 227, 3269, 4261, 2295, 32037, 5773, 12925, 41821}}, {14507, 18, 18400, {1, 1, 5, 11, 5, 31, 71, 205, 285, 37, 1863, 1873, 191, 16137, 2955, 51993, 91401, 206967}}, {14508, 18, 18427, {1, 3, 1, 7, 23, 31, 21, 81, 37, 903, 817, 3447, 8067, 3087, 25831, 46247, 77255, 68365}}, {14509, 18, 18443, {1, 1, 7, 11, 7, 43, 21, 243, 431, 633, 2047, 577, 7297, 8151, 15951, 30313, 121569, 241687}}, {14510, 18, 18487, {1, 1, 3, 5, 7, 45, 35, 189, 381, 849, 1869, 1193, 6815, 9017, 29053, 63605, 113623, 249097}}, {14511, 18, 18493, {1, 3, 3, 11, 13, 1, 73, 151, 197, 591, 1101, 2437, 6695, 8337, 26539, 40147, 45673, 57727}}, {14512, 18, 18508, {1, 1, 5, 1, 19, 15, 61, 151, 37, 893, 1819, 2317, 6299, 13097, 5109, 32613, 123685, 128173}}, {14513, 18, 18532, {1, 1, 1, 7, 25, 29, 29, 203, 179, 211, 1483, 3315, 7125, 6931, 609, 849, 117571, 26829}}, {14514, 18, 18535, {1, 3, 3, 11, 11, 47, 33, 101, 181, 431, 183, 2777, 5269, 4177, 15727, 717, 111243, 34825}}, {14515, 18, 18580, {1, 3, 5, 11, 17, 19, 19, 143, 137, 537, 1249, 2889, 1911, 3895, 15433, 60165, 83815, 205569}}, {14516, 18, 18587, {1, 3, 3, 7, 9, 59, 13, 159, 307, 625, 1, 2887, 3307, 16371, 4269, 56253, 71171, 55543}}, {14517, 18, 18606, {1, 1, 1, 11, 7, 63, 15, 53, 409, 7, 1317, 473, 7481, 10321, 27941, 4941, 40003, 194153}}, {14518, 18, 18659, {1, 1, 1, 1, 11, 53, 93, 157, 289, 231, 31, 273, 8131, 7861, 31041, 55221, 58305, 203403}}, {14519, 18, 18662, {1, 1, 5, 11, 15, 53, 103, 41, 439, 601, 1949, 1087, 4275, 4675, 31879, 40909, 22365, 124781}}, {14520, 18, 18679, {1, 3, 5, 9, 1, 47, 81, 47, 197, 499, 329, 2387, 5455, 15571, 2289, 44121, 12105, 11883}}, {14521, 18, 18694, {1, 1, 3, 3, 7, 47, 93, 33, 265, 149, 845, 723, 7783, 6651, 22939, 58027, 66959, 3991}}, {14522, 18, 18697, {1, 1, 5, 11, 23, 35, 123, 143, 35, 981, 1269, 2853, 4547, 7877, 16181, 17155, 57605, 11589}}, {14523, 18, 18706, {1, 1, 7, 11, 9, 57, 87, 151, 333, 743, 1939, 3273, 1047, 5033, 16061, 37237, 12013, 17669}}, {14524, 18, 18708, {1, 3, 7, 5, 29, 15, 109, 185, 51, 159, 1353, 3041, 7821, 14053, 13643, 62045, 78475, 43603}}, {14525, 18, 18728, {1, 3, 1, 9, 29, 25, 121, 49, 415, 561, 325, 1139, 1993, 6437, 6025, 25225, 20761, 250589}}, {14526, 18, 18731, {1, 3, 5, 3, 15, 39, 33, 43, 437, 605, 1081, 2397, 3821, 10961, 4853, 19517, 95817, 142023}}, {14527, 18, 18733, {1, 1, 3, 11, 23, 51, 119, 13, 227, 981, 2017, 3265, 1215, 8737, 10719, 48027, 43239, 19425}}, {14528, 18, 18751, {1, 3, 1, 15, 5, 5, 33, 175, 509, 611, 451, 2653, 1553, 1941, 25221, 31259, 6027, 159847}}, {14529, 18, 18766, {1, 3, 7, 11, 7, 25, 71, 61, 89, 775, 609, 2363, 4261, 10677, 1243, 44895, 49113, 209603}}, {14530, 18, 18773, {1, 3, 5, 15, 23, 23, 3, 15, 489, 455, 1303, 745, 5311, 1639, 18317, 33729, 119303, 255359}}, {14531, 18, 18796, {1, 3, 7, 5, 13, 53, 29, 127, 159, 67, 469, 1735, 3497, 6985, 24735, 32957, 1225, 24447}}, {14532, 18, 18811, {1, 3, 5, 5, 9, 13, 119, 83, 387, 777, 361, 3183, 6351, 9071, 13699, 53873, 54663, 67453}}, {14533, 18, 18823, {1, 1, 5, 9, 17, 33, 9, 159, 143, 193, 1055, 2903, 2719, 12521, 5231, 37639, 94963, 105673}}, {14534, 18, 18832, {1, 3, 3, 1, 27, 53, 87, 49, 465, 517, 1333, 411, 4089, 9985, 12989, 59511, 49939, 223481}}, {14535, 18, 18854, {1, 1, 5, 9, 27, 59, 35, 125, 393, 271, 1565, 2847, 8139, 15627, 16059, 55319, 11131, 35141}}, {14536, 18, 18858, {1, 1, 1, 1, 25, 1, 27, 195, 113, 539, 1281, 2273, 4793, 695, 25599, 41145, 107431, 160137}}, {14537, 18, 18883, {1, 3, 3, 7, 13, 7, 35, 137, 83, 995, 1671, 1701, 3157, 15583, 7637, 18947, 59675, 9421}}, {14538, 18, 18900, {1, 1, 7, 15, 23, 37, 109, 93, 377, 885, 1843, 1867, 2013, 10535, 5717, 55463, 18307, 125537}}, {14539, 18, 18967, {1, 3, 7, 11, 25, 33, 91, 213, 109, 599, 131, 1879, 1375, 2911, 4649, 8809, 41199, 61629}}, {14540, 18, 18974, {1, 3, 1, 1, 11, 17, 117, 243, 427, 913, 495, 527, 4277, 8867, 3131, 14143, 81677, 177369}}, {14541, 18, 18990, {1, 3, 7, 11, 11, 37, 71, 185, 487, 161, 1773, 837, 243, 14105, 6881, 2155, 63679, 220387}}, {14542, 18, 19009, {1, 1, 5, 3, 11, 41, 33, 99, 495, 757, 1083, 1987, 1997, 11057, 18445, 61903, 78163, 121701}}, {14543, 18, 19055, {1, 1, 1, 1, 23, 37, 9, 19, 411, 11, 1487, 1279, 2129, 7449, 29631, 34559, 129753, 112627}}, {14544, 18, 19058, {1, 1, 3, 11, 31, 39, 41, 207, 141, 383, 723, 3053, 743, 4479, 12395, 56659, 130303, 152005}}, {14545, 18, 19074, {1, 3, 1, 7, 27, 25, 19, 37, 29, 781, 1115, 2569, 4113, 14033, 18653, 1055, 50639, 70413}}, {14546, 18, 19079, {1, 1, 3, 1, 9, 15, 109, 7, 221, 161, 569, 2915, 2717, 2439, 4257, 61851, 113183, 63139}}, {14547, 18, 19086, {1, 3, 5, 1, 17, 45, 3, 147, 207, 769, 321, 11, 2747, 7189, 8067, 34951, 50851, 42625}}, {14548, 18, 19128, {1, 1, 7, 11, 15, 53, 117, 161, 219, 937, 1661, 3767, 959, 10351, 26685, 40095, 109821, 140139}}, {14549, 18, 19145, {1, 3, 3, 9, 15, 47, 61, 35, 289, 743, 1723, 2189, 749, 13499, 22897, 55385, 114953, 67191}}, {14550, 18, 19163, {1, 3, 7, 3, 23, 19, 123, 217, 393, 889, 1665, 13, 5663, 8695, 29767, 13433, 65133, 226713}}, {14551, 18, 19175, {1, 1, 7, 11, 5, 57, 59, 171, 321, 519, 1333, 1975, 5331, 2383, 26863, 8989, 82167, 6915}}, {14552, 18, 19189, {1, 1, 3, 3, 7, 17, 105, 79, 7, 827, 1277, 3805, 5943, 3161, 28953, 15657, 615, 149131}}, {14553, 18, 19196, {1, 1, 5, 1, 5, 7, 99, 65, 295, 933, 365, 1867, 1959, 10733, 26947, 29659, 121889, 200379}}, {14554, 18, 19204, {1, 3, 1, 13, 25, 21, 89, 247, 251, 43, 1539, 1317, 1875, 9237, 20693, 58433, 16757, 25451}}, {14555, 18, 19213, {1, 3, 3, 13, 11, 47, 73, 21, 467, 337, 1881, 2723, 7023, 2767, 12553, 65533, 20517, 203749}}, {14556, 18, 19237, {1, 1, 1, 1, 1, 17, 85, 133, 369, 577, 71, 859, 8151, 919, 10843, 44017, 10097, 199893}}, {14557, 18, 19276, {1, 3, 5, 5, 23, 19, 21, 233, 475, 123, 621, 687, 6945, 2373, 6447, 31243, 3525, 256545}}, {14558, 18, 19287, {1, 1, 7, 5, 9, 5, 35, 21, 33, 353, 1429, 3249, 6159, 8757, 6213, 855, 75863, 74507}}, {14559, 18, 19291, {1, 1, 5, 11, 29, 21, 45, 155, 369, 769, 1041, 3929, 7377, 1621, 5285, 55213, 66143, 110251}}, {14560, 18, 19293, {1, 3, 7, 11, 13, 57, 45, 207, 259, 907, 573, 663, 7727, 12677, 5949, 57625, 42183, 217491}}, {14561, 18, 19304, {1, 3, 5, 3, 21, 63, 113, 159, 87, 551, 1405, 2867, 239, 10941, 27633, 13947, 69689, 225771}}, {14562, 18, 19371, {1, 1, 3, 1, 1, 59, 5, 41, 125, 707, 1457, 1, 4263, 5519, 26101, 46339, 44949, 63689}}, {14563, 18, 19379, {1, 1, 1, 1, 11, 9, 65, 155, 3, 85, 273, 2287, 6059, 3289, 19045, 14705, 112465, 202019}}, {14564, 18, 19381, {1, 3, 3, 3, 21, 49, 95, 75, 479, 519, 1511, 1609, 2421, 14435, 11749, 49627, 16221, 98351}}, {14565, 18, 19405, {1, 1, 3, 5, 25, 57, 1, 39, 377, 523, 529, 701, 6749, 10109, 15845, 53301, 70979, 210997}}, {14566, 18, 19417, {1, 3, 1, 3, 27, 29, 101, 87, 361, 1, 229, 2653, 769, 16121, 18221, 31937, 12187, 63801}}, {14567, 18, 19420, {1, 3, 3, 1, 25, 27, 49, 235, 309, 23, 1625, 589, 1251, 10305, 26943, 38949, 82539, 135491}}, {14568, 18, 19424, {1, 1, 7, 7, 13, 13, 13, 61, 509, 73, 201, 2309, 1601, 3145, 19867, 5623, 117455, 180681}}, {14569, 18, 19462, {1, 3, 3, 13, 13, 47, 71, 9, 123, 719, 701, 353, 1877, 3103, 20017, 64731, 72729, 147631}}, {14570, 18, 19474, {1, 3, 1, 7, 29, 29, 53, 97, 409, 67, 1033, 2403, 2471, 10869, 2837, 43459, 117415, 213371}}, {14571, 18, 19492, {1, 1, 7, 1, 7, 23, 103, 157, 315, 335, 375, 3493, 4095, 5331, 7773, 64173, 23167, 21259}}, {14572, 18, 19501, {1, 3, 5, 13, 13, 55, 107, 147, 447, 281, 401, 1897, 7887, 15005, 21645, 26007, 19673, 238931}}, {14573, 18, 19504, {1, 3, 1, 7, 17, 39, 109, 113, 143, 59, 1095, 225, 1455, 5021, 5011, 2039, 4381, 219847}}, {14574, 18, 19516, {1, 3, 3, 7, 1, 35, 121, 145, 297, 251, 1153, 1955, 7881, 15461, 26961, 915, 30253, 15289}}, {14575, 18, 19519, {1, 3, 5, 15, 5, 57, 43, 157, 49, 17, 993, 4085, 5639, 9405, 28661, 30191, 73291, 76913}}, {14576, 18, 19534, {1, 1, 7, 1, 25, 63, 117, 55, 63, 649, 1635, 2505, 2765, 2715, 30241, 62699, 19567, 65953}}, {14577, 18, 19555, {1, 3, 5, 13, 21, 49, 111, 127, 179, 819, 1737, 2519, 815, 10541, 15821, 54203, 71767, 7091}}, {14578, 18, 19597, {1, 1, 1, 3, 27, 41, 101, 139, 39, 995, 819, 319, 1481, 15265, 20611, 22445, 53733, 82871}}, {14579, 18, 19600, {1, 3, 3, 13, 7, 61, 103, 203, 353, 205, 1927, 2665, 757, 12277, 31217, 22247, 14527, 26385}}, {14580, 18, 19615, {1, 1, 7, 3, 5, 35, 87, 235, 139, 785, 417, 3975, 6753, 4267, 15201, 8747, 12491, 159979}}, {14581, 18, 19621, {1, 3, 1, 9, 9, 11, 117, 231, 503, 933, 1461, 2657, 7771, 2161, 26723, 4853, 23215, 162315}}, {14582, 18, 19646, {1, 1, 7, 15, 27, 25, 115, 9, 257, 89, 571, 41, 2169, 10619, 2695, 2107, 64747, 40489}}, {14583, 18, 19651, {1, 3, 7, 9, 29, 61, 91, 117, 279, 721, 233, 177, 5509, 7599, 2379, 20297, 75425, 25051}}, {14584, 18, 19693, {1, 1, 1, 15, 31, 41, 3, 57, 59, 47, 963, 2831, 1885, 1989, 26803, 48243, 112065, 27753}}, {14585, 18, 19702, {1, 1, 5, 15, 9, 57, 41, 255, 179, 719, 1463, 2857, 285, 9623, 13111, 20415, 28819, 149441}}, {14586, 18, 19726, {1, 3, 1, 9, 17, 63, 21, 79, 473, 525, 1557, 3205, 7097, 14379, 28039, 30731, 62383, 247429}}, {14587, 18, 19754, {1, 3, 3, 13, 25, 45, 97, 213, 11, 801, 1519, 1085, 6167, 13701, 6707, 47223, 69923, 66239}}, {14588, 18, 19759, {1, 1, 1, 13, 1, 1, 9, 21, 363, 729, 1715, 1249, 5299, 11357, 20627, 33559, 84255, 133743}}, {14589, 18, 19764, {1, 3, 3, 13, 17, 33, 23, 255, 309, 605, 1177, 1305, 2717, 6561, 29193, 7971, 117525, 79139}}, {14590, 18, 19788, {1, 3, 1, 1, 7, 15, 73, 171, 11, 791, 241, 2641, 5397, 10403, 22207, 64123, 124507, 63855}}, {14591, 18, 19793, {1, 3, 1, 11, 11, 7, 109, 103, 321, 1009, 1237, 3347, 287, 2389, 16529, 7789, 3347, 97827}}, {14592, 18, 19836, {1, 3, 3, 3, 1, 27, 17, 9, 223, 755, 559, 3811, 2997, 1543, 23197, 42371, 5837, 13809}}, {14593, 18, 19855, {1, 3, 1, 3, 7, 57, 31, 23, 35, 329, 1155, 2525, 3029, 5495, 12005, 18045, 4539, 75789}}, {14594, 18, 19858, {1, 1, 5, 13, 3, 31, 121, 161, 325, 869, 715, 851, 1273, 1871, 22711, 61499, 36291, 11663}}, {14595, 18, 19880, {1, 1, 5, 11, 7, 39, 23, 139, 197, 47, 513, 373, 6859, 11217, 17725, 60949, 19299, 91425}}, {14596, 18, 19883, {1, 1, 3, 7, 15, 63, 123, 11, 109, 829, 231, 2591, 7997, 9061, 18647, 3209, 38509, 211219}}, {14597, 18, 19917, {1, 1, 1, 11, 13, 35, 73, 223, 325, 49, 1317, 4063, 4127, 2755, 555, 51057, 44909, 205723}}, {14598, 18, 19918, {1, 3, 3, 13, 17, 41, 115, 141, 503, 525, 63, 2487, 3225, 959, 10623, 28577, 89127, 157269}}, {14599, 18, 19936, {1, 3, 1, 9, 25, 9, 43, 43, 279, 111, 1141, 3033, 7229, 5725, 8277, 59141, 116811, 127945}}, {14600, 18, 19946, {1, 3, 7, 11, 27, 27, 93, 243, 135, 333, 1475, 1259, 1583, 7191, 6831, 53485, 128819, 174211}}, {14601, 18, 19954, {1, 3, 3, 3, 17, 17, 43, 251, 433, 1011, 1817, 2835, 7721, 2449, 9463, 23779, 31427, 88127}}, {14602, 18, 19979, {1, 1, 3, 3, 11, 49, 61, 41, 211, 559, 1761, 1303, 2119, 5743, 25515, 60705, 54405, 241063}}, {14603, 18, 19993, {1, 1, 3, 11, 7, 61, 15, 115, 29, 35, 187, 3137, 6177, 1449, 32723, 15917, 107851, 101077}}, {14604, 18, 19994, {1, 3, 5, 13, 21, 7, 11, 231, 417, 73, 1175, 735, 627, 7393, 7233, 39883, 129481, 106733}}, {14605, 18, 20006, {1, 3, 1, 15, 27, 61, 63, 201, 27, 431, 1127, 1555, 1953, 13051, 18701, 30097, 95549, 198465}}, {14606, 18, 20017, {1, 1, 3, 1, 23, 25, 43, 85, 291, 85, 1861, 675, 7451, 14701, 3929, 10835, 25569, 154687}}, {14607, 18, 20032, {1, 3, 7, 15, 5, 43, 91, 225, 283, 259, 1311, 3977, 585, 14803, 14117, 2121, 106981, 157577}}, {14608, 18, 20038, {1, 1, 1, 11, 7, 51, 49, 115, 477, 861, 1115, 743, 5109, 959, 7105, 9245, 66297, 188751}}, {14609, 18, 20050, {1, 3, 3, 11, 23, 1, 11, 111, 163, 643, 1907, 3613, 2967, 10071, 6023, 1307, 62341, 241025}}, {14610, 18, 20080, {1, 3, 5, 5, 15, 29, 31, 43, 445, 219, 1261, 421, 6035, 6461, 25583, 817, 100509, 239637}}, {14611, 18, 20135, {1, 1, 7, 3, 27, 51, 121, 93, 349, 125, 2013, 1671, 8049, 7807, 7291, 64413, 93625, 245611}}, {14612, 18, 20142, {1, 3, 3, 9, 11, 1, 91, 137, 501, 617, 1513, 799, 1705, 15737, 14989, 53611, 48781, 64481}}, {14613, 18, 20159, {1, 3, 3, 1, 21, 55, 95, 79, 383, 617, 1589, 2671, 4057, 13525, 9269, 23539, 13317, 87701}}, {14614, 18, 20173, {1, 1, 3, 1, 29, 17, 121, 45, 91, 215, 325, 2853, 1213, 10221, 7233, 34063, 21887, 142943}}, {14615, 18, 20186, {1, 3, 3, 11, 27, 53, 55, 149, 107, 379, 441, 585, 5697, 16353, 5613, 4323, 55315, 197603}}, {14616, 18, 20229, {1, 3, 7, 3, 31, 9, 71, 175, 485, 35, 675, 2091, 2351, 7985, 14207, 52687, 8559, 1067}}, {14617, 18, 20234, {1, 1, 5, 15, 29, 37, 9, 73, 357, 961, 489, 875, 7465, 3231, 27821, 42499, 127837, 117215}}, {14618, 18, 20263, {1, 3, 7, 7, 19, 43, 75, 153, 27, 291, 2039, 2661, 5513, 13429, 27307, 5305, 44771, 200621}}, {14619, 18, 20270, {1, 1, 1, 15, 5, 39, 61, 107, 201, 485, 319, 335, 5537, 14195, 31861, 63637, 68497, 45637}}, {14620, 18, 20299, {1, 3, 7, 7, 23, 49, 95, 225, 25, 933, 667, 2993, 2181, 15659, 31343, 20249, 57039, 43399}}, {14621, 18, 20304, {1, 3, 3, 7, 17, 25, 29, 243, 511, 91, 1409, 203, 2749, 7067, 12471, 41737, 32761, 7535}}, {14622, 18, 20319, {1, 1, 7, 9, 27, 43, 63, 65, 325, 817, 1127, 2039, 6171, 5867, 10593, 17205, 95913, 207417}}, {14623, 18, 20329, {1, 1, 7, 3, 3, 51, 107, 153, 193, 579, 593, 2915, 7641, 5157, 1131, 29793, 66579, 81903}}, {14624, 18, 20337, {1, 1, 5, 15, 19, 61, 125, 107, 235, 513, 1897, 875, 6341, 1817, 10631, 63905, 42993, 150699}}, {14625, 18, 20353, {1, 1, 3, 11, 27, 1, 93, 107, 325, 459, 1733, 2527, 4557, 2277, 19345, 8205, 67337, 242559}}, {14626, 18, 20401, {1, 1, 7, 3, 3, 45, 27, 227, 201, 99, 589, 1665, 4851, 2655, 9915, 41321, 59865, 71501}}, {14627, 18, 20434, {1, 3, 1, 9, 3, 25, 117, 199, 125, 849, 135, 1771, 4743, 13475, 23711, 17389, 52711, 200143}}, {14628, 18, 20436, {1, 3, 1, 3, 11, 23, 67, 155, 133, 557, 1933, 3169, 1707, 16045, 11039, 13889, 71045, 245885}}, {14629, 18, 20473, {1, 1, 5, 9, 1, 7, 99, 13, 315, 251, 1289, 225, 2847, 8451, 3139, 46829, 124745, 64825}}, {14630, 18, 20488, {1, 3, 7, 13, 19, 45, 87, 161, 271, 401, 1995, 935, 1803, 4051, 11709, 26993, 120139, 147895}}, {14631, 18, 20512, {1, 1, 7, 5, 15, 11, 47, 215, 51, 1019, 2039, 3767, 929, 3845, 3939, 64077, 48115, 61845}}, {14632, 18, 20515, {1, 1, 1, 5, 1, 39, 15, 77, 179, 13, 1099, 203, 3363, 9071, 12033, 49159, 71137, 124177}}, {14633, 18, 20517, {1, 3, 5, 5, 1, 31, 83, 219, 387, 347, 1099, 925, 4423, 5081, 15981, 35881, 79131, 248301}}, {14634, 18, 20530, {1, 3, 7, 3, 25, 19, 53, 43, 347, 845, 1735, 3237, 2795, 2253, 2997, 43729, 122833, 124869}}, {14635, 18, 20571, {1, 3, 5, 11, 5, 19, 93, 55, 297, 231, 239, 3335, 253, 13607, 16769, 48879, 61439, 54827}}, {14636, 18, 20574, {1, 3, 7, 11, 11, 55, 121, 73, 19, 1017, 727, 579, 8011, 9559, 15051, 7895, 17609, 103061}}, {14637, 18, 20589, {1, 1, 7, 5, 19, 47, 85, 195, 75, 1003, 439, 3069, 2107, 12751, 26729, 2329, 1191, 86547}}, {14638, 18, 20592, {1, 3, 3, 9, 5, 31, 63, 227, 481, 793, 1853, 1491, 2109, 4199, 32149, 45229, 54685, 124819}}, {14639, 18, 20611, {1, 1, 1, 3, 15, 15, 41, 45, 153, 429, 1691, 1897, 7253, 7239, 26133, 36527, 90319, 186097}}, {14640, 18, 20613, {1, 3, 1, 13, 15, 33, 103, 113, 121, 387, 177, 1943, 3181, 5483, 18515, 38807, 22655, 59787}}, {14641, 18, 20628, {1, 1, 5, 7, 15, 3, 53, 155, 99, 133, 579, 2129, 6881, 11091, 26715, 15485, 108071, 230881}}, {14642, 18, 20637, {1, 1, 3, 13, 25, 61, 91, 81, 9, 1011, 1993, 2485, 3707, 11127, 21279, 15853, 104081, 203769}}, {14643, 18, 20638, {1, 1, 7, 3, 17, 23, 37, 171, 315, 247, 275, 3215, 7139, 11739, 25859, 34803, 124601, 9169}}, {14644, 18, 20719, {1, 3, 7, 9, 21, 29, 97, 213, 309, 865, 597, 1811, 5547, 3741, 31927, 53379, 43293, 23589}}, {14645, 18, 20724, {1, 3, 7, 9, 7, 43, 107, 187, 485, 977, 1329, 3037, 3701, 9667, 13581, 6283, 39221, 63841}}, {14646, 18, 20772, {1, 1, 3, 11, 3, 51, 117, 45, 293, 409, 689, 153, 1163, 10921, 22709, 30415, 120475, 120751}}, {14647, 18, 20796, {1, 3, 5, 15, 31, 59, 57, 63, 249, 763, 1627, 3039, 4309, 14115, 25489, 35009, 126609, 146041}}, {14648, 18, 20799, {1, 1, 1, 9, 3, 47, 21, 183, 495, 361, 1439, 407, 5757, 12645, 11425, 1923, 94511, 205127}}, {14649, 18, 20816, {1, 3, 1, 9, 15, 5, 101, 107, 385, 175, 791, 901, 4427, 10415, 8163, 14417, 62997, 139309}}, {14650, 18, 20841, {1, 3, 5, 3, 13, 57, 9, 99, 77, 123, 1607, 3643, 3879, 503, 6021, 60211, 106471, 221801}}, {14651, 18, 20844, {1, 1, 7, 5, 27, 35, 11, 33, 415, 387, 1461, 741, 55, 15095, 21177, 5715, 109893, 204843}}, {14652, 18, 20862, {1, 1, 1, 15, 7, 49, 51, 81, 157, 421, 279, 1951, 6847, 10259, 31925, 60761, 12395, 49511}}, {14653, 18, 20865, {1, 3, 7, 11, 5, 33, 27, 135, 247, 813, 1889, 2547, 2359, 9535, 4141, 59713, 88685, 214641}}, {14654, 18, 20902, {1, 1, 5, 15, 17, 61, 99, 103, 39, 151, 1033, 2743, 6639, 5271, 22059, 12681, 22763, 88255}}, {14655, 18, 20938, {1, 1, 7, 13, 5, 11, 39, 139, 353, 989, 1391, 169, 3709, 735, 22965, 227, 103623, 153893}}, {14656, 18, 20957, {1, 1, 7, 3, 9, 51, 53, 87, 411, 617, 671, 681, 5057, 6003, 23137, 30881, 2289, 187133}}, {14657, 18, 20971, {1, 1, 7, 7, 17, 59, 77, 219, 25, 53, 145, 129, 4289, 14257, 7159, 44833, 22131, 53393}}, {14658, 18, 20973, {1, 3, 7, 1, 9, 59, 79, 177, 149, 637, 1641, 3713, 2709, 12321, 5691, 18239, 8617, 225979}}, {14659, 18, 20981, {1, 1, 7, 5, 9, 9, 67, 51, 451, 815, 295, 813, 1257, 179, 28769, 57241, 51753, 164873}}, {14660, 18, 20982, {1, 3, 1, 9, 19, 61, 53, 65, 29, 503, 715, 1837, 7487, 16187, 27303, 54681, 98753, 100471}}, {14661, 18, 20985, {1, 1, 3, 1, 15, 51, 1, 79, 179, 367, 841, 1313, 797, 4777, 1369, 13317, 65059, 204877}}, {14662, 18, 20991, {1, 3, 5, 9, 15, 19, 109, 45, 473, 517, 1139, 15, 1997, 4245, 11169, 56417, 75017, 37957}}, {14663, 18, 21012, {1, 1, 7, 1, 3, 41, 75, 95, 59, 503, 1439, 2633, 3527, 5363, 24357, 43659, 10387, 208319}}, {14664, 18, 21022, {1, 1, 5, 1, 31, 7, 71, 231, 505, 241, 1579, 3517, 3995, 8269, 6793, 15883, 102779, 75589}}, {14665, 18, 21026, {1, 3, 5, 1, 13, 61, 87, 213, 501, 307, 1629, 2715, 7245, 747, 20601, 28105, 79249, 76231}}, {14666, 18, 21028, {1, 1, 7, 11, 5, 13, 69, 221, 485, 59, 2027, 483, 6851, 11719, 16787, 54111, 47579, 49959}}, {14667, 18, 21050, {1, 1, 3, 15, 3, 33, 57, 75, 375, 45, 851, 1673, 8167, 867, 32087, 34157, 96701, 72893}}, {14668, 18, 21075, {1, 1, 3, 1, 21, 31, 65, 85, 181, 453, 815, 3139, 205, 429, 7451, 50855, 41085, 137927}}, {14669, 18, 21077, {1, 3, 1, 9, 3, 57, 99, 183, 305, 991, 809, 4021, 3131, 4459, 5839, 32493, 116541, 59329}}, {14670, 18, 21078, {1, 3, 7, 1, 5, 19, 3, 91, 297, 715, 1081, 445, 393, 12685, 4457, 61437, 103701, 75917}}, {14671, 18, 21106, {1, 1, 7, 15, 17, 39, 19, 255, 247, 391, 1055, 1241, 4515, 10217, 23363, 40301, 115053, 234349}}, {14672, 18, 21122, {1, 3, 5, 1, 21, 9, 33, 243, 501, 793, 219, 3595, 2585, 5083, 15377, 35761, 90609, 93761}}, {14673, 18, 21127, {1, 1, 5, 13, 3, 1, 5, 77, 265, 525, 1107, 1879, 1119, 2277, 30557, 43547, 81947, 134075}}, {14674, 18, 21155, {1, 1, 7, 5, 11, 47, 71, 83, 255, 183, 515, 2591, 3933, 16025, 16727, 43421, 18725, 106675}}, {14675, 18, 21167, {1, 3, 1, 1, 5, 17, 57, 209, 509, 421, 1247, 3153, 1835, 8777, 13285, 27699, 34001, 186553}}, {14676, 18, 21169, {1, 1, 3, 11, 27, 19, 73, 65, 179, 115, 845, 2507, 7673, 14429, 10553, 4999, 82323, 247379}}, {14677, 18, 21204, {1, 3, 7, 7, 17, 59, 97, 183, 407, 697, 1423, 123, 6479, 3997, 729, 31587, 114383, 61673}}, {14678, 18, 21230, {1, 1, 5, 9, 21, 23, 21, 153, 187, 255, 125, 1469, 2639, 8099, 29689, 36415, 103959, 231621}}, {14679, 18, 21256, {1, 1, 3, 11, 19, 59, 115, 205, 123, 133, 1953, 3471, 2495, 329, 32385, 21931, 9691, 51405}}, {14680, 18, 21285, {1, 3, 3, 13, 7, 7, 115, 65, 301, 621, 1091, 2137, 5729, 5027, 21331, 24803, 114789, 142039}}, {14681, 18, 21312, {1, 1, 7, 5, 31, 19, 103, 69, 503, 663, 1497, 2867, 5295, 893, 15927, 37513, 94553, 72369}}, {14682, 18, 21329, {1, 3, 3, 15, 17, 33, 99, 249, 277, 259, 9, 99, 3073, 12017, 14847, 7685, 102499, 26489}}, {14683, 18, 21351, {1, 1, 1, 1, 5, 23, 31, 45, 29, 483, 1977, 1129, 6925, 2273, 16573, 53039, 90251, 137191}}, {14684, 18, 21372, {1, 3, 1, 13, 27, 47, 29, 51, 473, 895, 671, 3917, 6905, 15769, 9019, 28879, 120591, 220753}}, {14685, 18, 21376, {1, 3, 1, 13, 27, 29, 53, 255, 507, 819, 1251, 2463, 1717, 14461, 31997, 30829, 8803, 115539}}, {14686, 18, 21424, {1, 3, 3, 15, 27, 1, 109, 225, 451, 409, 2025, 2701, 4121, 9949, 1551, 13625, 73577, 211549}}, {14687, 18, 21448, {1, 1, 1, 3, 23, 57, 49, 35, 365, 711, 2001, 997, 1853, 2913, 15667, 30255, 19535, 2171}}, {14688, 18, 21465, {1, 1, 7, 1, 21, 37, 127, 3, 117, 449, 1689, 1391, 1427, 12641, 15199, 23769, 66553, 34669}}, {14689, 18, 21495, {1, 3, 7, 9, 31, 45, 51, 137, 181, 469, 573, 89, 7257, 10991, 30705, 37827, 75071, 152885}}, {14690, 18, 21509, {1, 3, 1, 1, 19, 13, 55, 223, 261, 353, 1497, 183, 8173, 14421, 9977, 24095, 47215, 155189}}, {14691, 18, 21550, {1, 1, 3, 15, 15, 41, 31, 105, 459, 27, 299, 159, 2167, 14809, 9983, 2755, 121715, 35921}}, {14692, 18, 21562, {1, 1, 3, 7, 31, 5, 85, 137, 431, 849, 1479, 2681, 167, 5727, 3211, 30765, 63295, 39509}}, {14693, 18, 21575, {1, 1, 5, 7, 5, 51, 21, 103, 175, 927, 1115, 1507, 505, 8093, 25831, 54303, 40397, 61249}}, {14694, 18, 21579, {1, 1, 7, 3, 23, 53, 49, 225, 7, 425, 403, 3949, 1081, 15335, 21737, 647, 107875, 236183}}, {14695, 18, 21582, {1, 1, 5, 7, 17, 21, 85, 229, 325, 57, 601, 2785, 6417, 5135, 17917, 12861, 97675, 115457}}, {14696, 18, 21600, {1, 1, 3, 3, 13, 23, 73, 111, 385, 47, 605, 1169, 1729, 2335, 18739, 61293, 41915, 237645}}, {14697, 18, 21615, {1, 1, 1, 5, 31, 11, 123, 13, 465, 755, 1073, 1885, 2105, 5971, 2347, 10911, 125823, 156037}}, {14698, 18, 21617, {1, 3, 7, 11, 17, 47, 3, 165, 227, 355, 87, 839, 7741, 12275, 28579, 25337, 87671, 224847}}, {14699, 18, 21624, {1, 1, 5, 15, 23, 33, 9, 1, 257, 121, 1049, 1009, 187, 9935, 26093, 21921, 130247, 240291}}, {14700, 18, 21633, {1, 1, 3, 13, 13, 27, 87, 221, 27, 117, 551, 2533, 7611, 5333, 14635, 9911, 37555, 250621}}, {14701, 18, 21636, {1, 3, 7, 15, 29, 39, 33, 1, 495, 889, 1397, 3415, 7193, 11533, 27379, 36425, 13739, 146635}}, {14702, 18, 21645, {1, 1, 7, 11, 1, 23, 85, 127, 79, 989, 321, 1913, 7571, 9889, 11803, 1307, 120513, 218077}}, {14703, 18, 21654, {1, 1, 7, 5, 5, 15, 35, 9, 351, 973, 1455, 2043, 5527, 9431, 16059, 53915, 105785, 180579}}, {14704, 18, 21660, {1, 1, 1, 13, 13, 45, 15, 41, 131, 463, 1011, 3559, 6393, 4737, 6041, 33073, 60989, 56761}}, {14705, 18, 21667, {1, 1, 3, 9, 31, 35, 23, 133, 33, 233, 543, 957, 4913, 12441, 10293, 31611, 83383, 154551}}, {14706, 18, 21702, {1, 3, 3, 1, 29, 37, 117, 247, 345, 197, 1617, 3333, 7901, 8343, 55, 16529, 34627, 172703}}, {14707, 18, 21714, {1, 1, 1, 13, 23, 51, 7, 219, 503, 215, 375, 2275, 5467, 13953, 13987, 22735, 67505, 185977}}, {14708, 18, 21719, {1, 3, 5, 5, 29, 53, 85, 147, 167, 409, 853, 667, 4431, 5227, 15535, 34375, 107135, 220637}}, {14709, 18, 21736, {1, 3, 7, 7, 19, 3, 73, 123, 455, 539, 1735, 1423, 5337, 16311, 15469, 36071, 126437, 219249}}, {14710, 18, 21767, {1, 1, 1, 3, 19, 49, 17, 133, 101, 1013, 683, 869, 6267, 409, 31379, 2535, 8039, 63205}}, {14711, 18, 21781, {1, 1, 1, 13, 13, 53, 25, 31, 501, 629, 645, 1811, 3675, 13317, 17009, 7359, 85475, 249823}}, {14712, 18, 21795, {1, 1, 3, 11, 5, 1, 41, 17, 159, 361, 1439, 2083, 1425, 7221, 9117, 59543, 59285, 188615}}, {14713, 18, 21841, {1, 3, 7, 1, 11, 27, 71, 121, 471, 749, 1983, 3715, 6463, 5793, 1063, 18201, 189, 243751}}, {14714, 18, 21853, {1, 3, 3, 11, 19, 17, 15, 175, 379, 683, 1491, 2385, 6981, 1183, 16829, 2103, 9309, 46119}}, {14715, 18, 21867, {1, 1, 7, 5, 17, 39, 109, 9, 279, 309, 1, 1523, 4551, 3855, 13277, 36125, 54191, 45085}}, {14716, 18, 21878, {1, 3, 5, 3, 9, 59, 51, 5, 431, 657, 161, 2725, 2401, 9743, 12925, 43501, 51551, 163737}}, {14717, 18, 21891, {1, 1, 5, 3, 9, 13, 7, 177, 121, 795, 1169, 3169, 3793, 3995, 29027, 32967, 82273, 207939}}, {14718, 18, 21897, {1, 3, 7, 13, 1, 1, 31, 91, 245, 775, 1589, 2263, 6303, 15787, 3111, 52553, 52507, 183971}}, {14719, 18, 21954, {1, 3, 5, 11, 15, 49, 73, 191, 67, 449, 1245, 2445, 5617, 8625, 27971, 35939, 76907, 76207}}, {14720, 18, 21956, {1, 3, 1, 11, 15, 47, 29, 91, 437, 895, 1941, 249, 2739, 15479, 29699, 7257, 39897, 65985}}, {14721, 18, 21965, {1, 3, 5, 7, 13, 23, 45, 113, 297, 373, 1505, 2317, 7509, 12059, 13737, 29081, 87337, 221917}}, {14722, 18, 21977, {1, 3, 3, 3, 1, 5, 13, 215, 221, 461, 1337, 3569, 2257, 12135, 14685, 39721, 16723, 234791}}, {14723, 18, 21978, {1, 1, 7, 5, 11, 25, 71, 103, 87, 533, 779, 379, 6695, 13451, 24801, 49235, 35109, 100865}}, {14724, 18, 21983, {1, 3, 3, 15, 13, 51, 27, 11, 279, 847, 135, 1119, 2765, 3805, 20273, 29089, 83379, 190353}}, {14725, 18, 22002, {1, 3, 7, 5, 17, 29, 111, 35, 189, 273, 503, 541, 6691, 9051, 10403, 7559, 54787, 25403}}, {14726, 18, 22013, {1, 3, 5, 9, 21, 29, 85, 235, 223, 677, 71, 1313, 6587, 10983, 199, 27721, 78627, 105505}}, {14727, 18, 22014, {1, 3, 1, 3, 13, 3, 123, 115, 173, 907, 1555, 1489, 2745, 6451, 25347, 24105, 66471, 181009}}, {14728, 18, 22054, {1, 1, 7, 1, 31, 15, 13, 97, 511, 827, 1193, 3081, 1517, 13511, 24887, 39239, 85175, 150213}}, {14729, 18, 22058, {1, 1, 1, 5, 17, 39, 121, 67, 207, 877, 1885, 171, 2687, 13081, 27267, 58699, 118575, 213025}}, {14730, 18, 22066, {1, 1, 3, 9, 9, 27, 101, 215, 31, 37, 1629, 3631, 3225, 9667, 31547, 41939, 38683, 150805}}, {14731, 18, 22085, {1, 3, 1, 11, 11, 59, 17, 15, 187, 667, 747, 2193, 6749, 6019, 31805, 52433, 4141, 52613}}, {14732, 18, 22103, {1, 3, 3, 13, 9, 1, 51, 101, 213, 881, 899, 2197, 3017, 1591, 9271, 44017, 99893, 192005}}, {14733, 18, 22138, {1, 3, 7, 13, 23, 41, 79, 83, 123, 585, 49, 849, 2133, 12473, 6907, 15487, 45783, 46609}}, {14734, 18, 22140, {1, 3, 7, 13, 27, 23, 71, 13, 319, 903, 1123, 933, 2603, 11631, 19953, 47001, 127751, 84547}}, {14735, 18, 22153, {1, 1, 1, 15, 3, 61, 79, 231, 43, 217, 801, 997, 6545, 13657, 25589, 30435, 49497, 1037}}, {14736, 18, 22164, {1, 3, 3, 3, 21, 29, 121, 35, 129, 239, 1645, 3147, 7647, 1201, 19287, 7075, 67961, 62481}}, {14737, 18, 22167, {1, 3, 7, 7, 3, 23, 45, 177, 469, 897, 359, 2521, 2079, 985, 14993, 56813, 20667, 187341}}, {14738, 18, 22189, {1, 3, 5, 7, 23, 53, 15, 45, 297, 93, 247, 1165, 2683, 5899, 7113, 14859, 22733, 173835}}, {14739, 18, 22202, {1, 1, 3, 15, 23, 17, 43, 179, 103, 197, 1857, 323, 267, 12417, 2343, 41527, 12243, 112023}}, {14740, 18, 22212, {1, 3, 7, 13, 7, 43, 75, 19, 169, 621, 735, 141, 3087, 765, 5901, 34029, 117603, 5137}}, {14741, 18, 22234, {1, 1, 3, 5, 15, 17, 67, 177, 371, 249, 99, 1651, 3701, 343, 435, 50307, 33915, 115391}}, {14742, 18, 22239, {1, 1, 3, 13, 19, 53, 69, 1, 435, 71, 339, 2289, 1591, 8783, 8087, 25855, 115311, 191115}}, {14743, 18, 22245, {1, 3, 5, 11, 1, 55, 59, 7, 101, 655, 353, 483, 5681, 12721, 15973, 51377, 94921, 246365}}, {14744, 18, 22272, {1, 3, 5, 3, 25, 23, 99, 145, 277, 741, 595, 2653, 1393, 2867, 271, 49131, 111973, 118869}}, {14745, 18, 22308, {1, 1, 7, 13, 11, 51, 127, 27, 305, 265, 1755, 3189, 4679, 9721, 24409, 46941, 94353, 95643}}, {14746, 18, 22318, {1, 1, 5, 11, 1, 63, 53, 149, 459, 155, 1431, 3969, 3417, 12121, 14535, 52089, 110745, 57}}, {14747, 18, 22320, {1, 1, 5, 9, 23, 33, 17, 175, 313, 185, 101, 531, 2941, 14999, 31413, 12103, 33709, 260555}}, {14748, 18, 22338, {1, 1, 3, 13, 3, 11, 67, 95, 211, 673, 23, 2379, 6985, 12101, 13021, 9255, 116437, 228877}}, {14749, 18, 22350, {1, 1, 3, 15, 7, 51, 25, 109, 45, 691, 869, 485, 111, 11465, 27953, 54375, 10805, 221023}}, {14750, 18, 22374, {1, 3, 7, 7, 17, 53, 59, 101, 221, 593, 587, 873, 931, 14617, 12067, 58655, 102437, 31675}}, {14751, 18, 22388, {1, 1, 3, 15, 25, 57, 35, 231, 491, 671, 933, 3525, 1237, 10155, 27501, 50781, 23183, 108283}}, {14752, 18, 22391, {1, 3, 5, 5, 31, 63, 117, 205, 199, 841, 1455, 3901, 2127, 13573, 20667, 49489, 60217, 197421}}, {14753, 18, 22422, {1, 1, 3, 7, 15, 21, 73, 211, 421, 873, 607, 709, 9, 10985, 28653, 64579, 118145, 3095}}, {14754, 18, 22426, {1, 1, 1, 13, 17, 53, 27, 105, 201, 399, 737, 3235, 1287, 13859, 6049, 62249, 88259, 52991}}, {14755, 18, 22441, {1, 3, 7, 7, 25, 45, 67, 147, 275, 315, 1675, 2289, 4611, 6325, 26617, 38079, 125219, 23569}}, {14756, 18, 22481, {1, 1, 7, 7, 9, 61, 115, 251, 297, 691, 1881, 1815, 7229, 10859, 8257, 38097, 87927, 162845}}, {14757, 18, 22488, {1, 3, 3, 9, 9, 59, 17, 207, 433, 825, 93, 697, 7263, 15983, 14829, 47471, 17579, 151519}}, {14758, 18, 22500, {1, 1, 1, 11, 21, 31, 7, 41, 383, 731, 2033, 3417, 4187, 5515, 10093, 15875, 78551, 2057}}, {14759, 18, 22517, {1, 3, 7, 15, 5, 29, 7, 171, 129, 727, 1815, 1361, 6137, 10333, 22203, 361, 92437, 6545}}, {14760, 18, 22531, {1, 1, 3, 13, 25, 45, 111, 69, 333, 365, 765, 2755, 3485, 2729, 23467, 64809, 120755, 169279}}, {14761, 18, 22552, {1, 1, 3, 1, 19, 13, 33, 165, 157, 429, 1175, 3435, 7523, 5055, 12295, 34309, 36933, 164037}}, {14762, 18, 22574, {1, 1, 3, 11, 31, 49, 37, 161, 465, 311, 1839, 689, 6837, 13473, 29883, 61587, 86077, 156921}}, {14763, 18, 22579, {1, 3, 3, 1, 3, 23, 69, 159, 501, 303, 1495, 9, 6055, 545, 12247, 23413, 67247, 38137}}, {14764, 18, 22582, {1, 1, 5, 15, 5, 39, 107, 121, 295, 167, 1055, 2703, 147, 7291, 3981, 51989, 92953, 225987}}, {14765, 18, 22586, {1, 3, 1, 1, 21, 5, 91, 129, 57, 53, 365, 2497, 5017, 13535, 19305, 60447, 115467, 225317}}, {14766, 18, 22594, {1, 3, 1, 7, 25, 17, 51, 15, 119, 1013, 719, 991, 2655, 12587, 15749, 11723, 18461, 155937}}, {14767, 18, 22611, {1, 3, 7, 3, 25, 33, 59, 135, 501, 813, 235, 3775, 2781, 13137, 32673, 31643, 78881, 207651}}, {14768, 18, 22614, {1, 1, 7, 13, 27, 51, 99, 189, 187, 577, 941, 1275, 7297, 14731, 12599, 49049, 96439, 35093}}, {14769, 18, 22700, {1, 3, 1, 15, 9, 45, 1, 149, 305, 231, 935, 1377, 6345, 14795, 20969, 26263, 5711, 146949}}, {14770, 18, 22711, {1, 1, 5, 9, 5, 9, 47, 127, 105, 517, 671, 67, 4639, 2477, 23109, 56707, 72131, 100709}}, {14771, 18, 22749, {1, 3, 5, 3, 21, 23, 7, 193, 491, 197, 319, 3207, 2183, 2133, 3127, 34555, 53707, 170875}}, {14772, 18, 22759, {1, 1, 3, 9, 5, 23, 109, 91, 359, 913, 179, 1031, 3617, 12497, 23299, 53293, 114603, 9931}}, {14773, 18, 22774, {1, 3, 1, 5, 1, 47, 73, 103, 333, 483, 1015, 3085, 5229, 3171, 16539, 13493, 68957, 177645}}, {14774, 18, 22777, {1, 1, 1, 9, 27, 15, 25, 255, 383, 501, 831, 2463, 237, 16065, 6991, 56503, 117303, 140573}}, {14775, 18, 22780, {1, 1, 3, 5, 9, 25, 15, 179, 415, 729, 1163, 2649, 2907, 9591, 29129, 42775, 80537, 139897}}, {14776, 18, 22783, {1, 1, 3, 7, 31, 15, 113, 1, 263, 685, 1953, 1479, 5143, 8585, 9057, 61479, 122065, 191541}}, {14777, 18, 22785, {1, 3, 1, 11, 25, 47, 25, 229, 463, 197, 1123, 2665, 2345, 11701, 10435, 15205, 35437, 137619}}, {14778, 18, 22840, {1, 3, 3, 5, 19, 57, 89, 101, 373, 283, 57, 1701, 5025, 6677, 20321, 58459, 9319, 161501}}, {14779, 18, 22878, {1, 1, 1, 13, 3, 51, 111, 23, 325, 813, 441, 2371, 1993, 6839, 359, 9873, 33719, 208163}}, {14780, 18, 22884, {1, 3, 1, 11, 23, 53, 35, 89, 91, 601, 433, 1671, 1919, 2115, 6355, 10639, 87305, 194185}}, {14781, 18, 22888, {1, 1, 5, 9, 29, 31, 43, 153, 209, 835, 865, 2431, 1085, 9771, 14483, 19551, 98673, 146881}}, {14782, 18, 22927, {1, 1, 7, 3, 7, 33, 49, 111, 111, 843, 479, 2113, 4575, 14911, 5161, 7153, 37525, 217887}}, {14783, 18, 22941, {1, 1, 7, 9, 27, 5, 23, 217, 11, 79, 1637, 2047, 6697, 5601, 2877, 63497, 100127, 157833}}, {14784, 18, 22951, {1, 1, 7, 11, 31, 41, 91, 39, 207, 185, 1163, 2115, 2963, 7605, 12597, 54175, 7221, 117129}}, {14785, 18, 22958, {1, 3, 7, 13, 9, 15, 3, 47, 281, 451, 1111, 3585, 4505, 9465, 8047, 45893, 27179, 124373}}, {14786, 18, 22980, {1, 3, 5, 11, 27, 29, 11, 221, 483, 29, 17, 1067, 6761, 39, 13419, 7263, 127547, 178951}}, {14787, 18, 23007, {1, 3, 5, 5, 19, 3, 51, 155, 41, 251, 851, 1191, 4445, 8337, 25339, 32931, 4743, 31883}}, {14788, 18, 23032, {1, 3, 7, 15, 9, 3, 113, 151, 239, 611, 381, 1141, 2865, 3071, 7293, 61997, 2891, 14533}}, {14789, 18, 23041, {1, 3, 5, 3, 15, 59, 3, 37, 385, 587, 837, 2483, 5493, 10571, 26129, 44835, 63425, 246953}}, {14790, 18, 23044, {1, 3, 5, 13, 9, 9, 93, 11, 139, 619, 581, 2859, 5481, 11941, 20661, 37463, 95369, 177009}}, {14791, 18, 23059, {1, 1, 7, 11, 7, 17, 89, 7, 479, 377, 1631, 509, 7429, 13733, 24011, 24191, 98409, 180761}}, {14792, 18, 23065, {1, 3, 7, 1, 5, 17, 51, 113, 181, 75, 1787, 2221, 6181, 16069, 3031, 32531, 107833, 239907}}, {14793, 18, 23072, {1, 1, 5, 11, 3, 25, 13, 35, 311, 865, 873, 1811, 3101, 4445, 18155, 18647, 55693, 144963}}, {14794, 18, 23137, {1, 3, 7, 13, 1, 9, 73, 189, 255, 301, 1579, 597, 6027, 15621, 27287, 14615, 76051, 143445}}, {14795, 18, 23144, {1, 3, 1, 13, 19, 59, 11, 97, 501, 857, 1071, 3633, 8059, 2469, 16803, 49395, 73631, 114297}}, {14796, 18, 23155, {1, 1, 1, 5, 19, 3, 59, 179, 343, 745, 497, 2965, 3841, 3119, 17707, 31577, 39801, 108819}}, {14797, 18, 23162, {1, 3, 3, 9, 11, 17, 19, 199, 283, 229, 493, 631, 8133, 1531, 25271, 11353, 114759, 70655}}, {14798, 18, 23167, {1, 1, 7, 7, 3, 11, 1, 95, 167, 863, 1009, 1695, 2773, 11667, 23515, 12927, 87883, 28773}}, {14799, 18, 23183, {1, 3, 1, 15, 9, 1, 31, 243, 57, 349, 483, 659, 1971, 7971, 23797, 4403, 83837, 239261}}, {14800, 18, 23192, {1, 3, 7, 5, 11, 17, 55, 5, 209, 233, 1969, 925, 695, 1321, 11965, 29849, 120519, 195105}}, {14801, 18, 23197, {1, 3, 7, 11, 9, 45, 27, 9, 57, 649, 1801, 2653, 1535, 45, 8901, 28755, 26475, 112341}}, {14802, 18, 23216, {1, 1, 3, 13, 11, 57, 103, 213, 193, 779, 541, 3685, 4191, 6105, 7199, 63659, 49673, 208361}}, {14803, 18, 23221, {1, 3, 3, 7, 15, 15, 9, 207, 387, 429, 1213, 1703, 5753, 10261, 8705, 62783, 9643, 248591}}, {14804, 18, 23228, {1, 3, 3, 15, 23, 17, 5, 83, 295, 685, 2003, 1723, 2799, 14699, 25171, 20275, 45597, 214107}}, {14805, 18, 23233, {1, 1, 1, 15, 13, 33, 111, 69, 329, 273, 1303, 3377, 4151, 12547, 20411, 54845, 7839, 173939}}, {14806, 18, 23234, {1, 1, 5, 15, 25, 31, 11, 75, 69, 501, 1485, 3659, 3889, 9715, 9633, 45313, 112377, 27799}}, {14807, 18, 23251, {1, 1, 3, 11, 31, 27, 7, 25, 315, 593, 315, 275, 1453, 9429, 10023, 17939, 37651, 217435}}, {14808, 18, 23257, {1, 3, 7, 7, 27, 41, 69, 95, 19, 763, 1733, 2097, 6723, 7051, 15209, 53047, 56117, 87639}}, {14809, 18, 23258, {1, 3, 7, 5, 15, 61, 31, 19, 361, 571, 727, 405, 835, 4847, 26777, 50311, 104125, 127197}}, {14810, 18, 23288, {1, 1, 1, 11, 11, 61, 59, 63, 409, 219, 1135, 3385, 5583, 16143, 22709, 31247, 19871, 68557}}, {14811, 18, 23302, {1, 3, 7, 1, 11, 3, 121, 41, 135, 427, 1267, 2169, 507, 757, 12411, 50655, 75625, 1199}}, {14812, 18, 23341, {1, 1, 7, 5, 17, 21, 89, 119, 55, 395, 979, 909, 1711, 3289, 8433, 9, 12743, 109027}}, {14813, 18, 23373, {1, 1, 1, 13, 5, 11, 93, 35, 437, 173, 1157, 2749, 6855, 8307, 26145, 22593, 125415, 65509}}, {14814, 18, 23402, {1, 1, 5, 3, 25, 27, 1, 173, 113, 373, 1769, 2941, 1895, 3399, 27665, 50613, 20747, 31903}}, {14815, 18, 23409, {1, 1, 1, 1, 9, 7, 53, 73, 465, 725, 1537, 579, 83, 925, 15507, 13595, 16927, 205087}}, {14816, 18, 23428, {1, 1, 3, 7, 7, 23, 31, 127, 27, 727, 1305, 3879, 817, 15995, 28607, 22695, 6367, 161587}}, {14817, 18, 23435, {1, 3, 1, 7, 29, 23, 27, 117, 279, 917, 1105, 2061, 7719, 13633, 16501, 33739, 71939, 143115}}, {14818, 18, 23440, {1, 3, 7, 11, 7, 27, 65, 133, 411, 441, 925, 1485, 2035, 3067, 14511, 58511, 120773, 228731}}, {14819, 18, 23449, {1, 1, 3, 9, 21, 55, 27, 73, 175, 395, 1201, 2599, 3839, 11163, 5057, 3385, 43265, 105211}}, {14820, 18, 23459, {1, 1, 1, 3, 7, 63, 91, 197, 417, 763, 1391, 3729, 2791, 1975, 23655, 50611, 110315, 86879}}, {14821, 18, 23473, {1, 3, 3, 5, 31, 35, 67, 67, 89, 933, 1005, 1837, 5947, 2559, 27731, 25151, 102959, 81557}}, {14822, 18, 23500, {1, 3, 3, 1, 3, 39, 57, 199, 87, 91, 1641, 3407, 2823, 10441, 26357, 56677, 17647, 86831}}, {14823, 18, 23511, {1, 3, 5, 7, 15, 5, 49, 227, 395, 837, 1707, 1677, 1907, 13101, 1929, 61701, 1479, 80671}}, {14824, 18, 23548, {1, 1, 1, 11, 17, 57, 37, 151, 61, 709, 2027, 2239, 3283, 5467, 17221, 40759, 91637, 258167}}, {14825, 18, 23560, {1, 3, 5, 11, 27, 29, 121, 181, 503, 705, 225, 1111, 7183, 3219, 3233, 2085, 113619, 32959}}, {14826, 18, 23563, {1, 1, 7, 5, 29, 31, 93, 113, 457, 161, 337, 2003, 1865, 13357, 19961, 51485, 62751, 111285}}, {14827, 18, 23594, {1, 3, 1, 1, 23, 25, 65, 99, 11, 835, 661, 3291, 2655, 1135, 19957, 5029, 110483, 2499}}, {14828, 18, 23601, {1, 1, 1, 1, 25, 21, 59, 203, 471, 697, 455, 1561, 3215, 609, 5097, 8715, 115705, 21441}}, {14829, 18, 23625, {1, 1, 5, 13, 27, 37, 15, 175, 191, 975, 977, 401, 7053, 14291, 14621, 48989, 113033, 172569}}, {14830, 18, 23640, {1, 3, 1, 1, 19, 11, 125, 53, 307, 421, 93, 2487, 5907, 2195, 30569, 21009, 20759, 246937}}, {14831, 18, 23650, {1, 3, 7, 3, 23, 21, 103, 115, 453, 537, 473, 1069, 3007, 15111, 3477, 5635, 46423, 68633}}, {14832, 18, 23662, {1, 3, 3, 1, 21, 1, 49, 197, 173, 775, 1877, 1309, 729, 3555, 5981, 32539, 22765, 171077}}, {14833, 18, 23692, {1, 1, 3, 13, 19, 5, 75, 149, 441, 665, 1567, 2433, 8173, 12639, 27479, 47221, 66203, 89017}}, {14834, 18, 23726, {1, 1, 1, 11, 1, 55, 99, 119, 491, 621, 619, 2521, 905, 11601, 26481, 2023, 127413, 220387}}, {14835, 18, 23738, {1, 1, 7, 11, 9, 21, 57, 93, 243, 229, 1445, 997, 1317, 2327, 14141, 45787, 82295, 72823}}, {14836, 18, 23743, {1, 3, 7, 3, 11, 7, 115, 143, 349, 507, 1047, 2573, 2491, 13351, 19019, 4857, 62781, 261261}}, {14837, 18, 23755, {1, 1, 3, 1, 1, 13, 45, 227, 41, 947, 693, 2853, 7459, 1485, 22087, 61195, 111771, 136389}}, {14838, 18, 23760, {1, 1, 3, 11, 13, 53, 49, 15, 425, 29, 681, 1493, 1385, 9555, 13291, 36735, 12351, 29293}}, {14839, 18, 23799, {1, 1, 3, 1, 5, 19, 37, 45, 69, 209, 365, 3949, 6163, 5207, 9297, 21147, 71437, 40487}}, {14840, 18, 23848, {1, 3, 3, 13, 31, 21, 9, 177, 95, 285, 1953, 1969, 7367, 7401, 12017, 9939, 11895, 213133}}, {14841, 18, 23859, {1, 1, 7, 1, 1, 63, 103, 141, 39, 679, 123, 2941, 4335, 199, 12237, 6599, 48641, 140063}}, {14842, 18, 23876, {1, 3, 7, 3, 31, 17, 21, 77, 65, 979, 109, 3325, 1781, 6983, 31477, 23149, 33943, 96137}}, {14843, 18, 23897, {1, 3, 3, 5, 21, 5, 125, 117, 427, 381, 511, 2643, 409, 4945, 3167, 45879, 1469, 56077}}, {14844, 18, 23907, {1, 3, 1, 5, 27, 43, 83, 31, 65, 645, 1205, 1387, 723, 15359, 13517, 23601, 61717, 47079}}, {14845, 18, 23919, {1, 3, 3, 13, 15, 37, 101, 175, 225, 513, 483, 1291, 669, 5335, 16023, 287, 51819, 239803}}, {14846, 18, 23921, {1, 3, 3, 3, 3, 1, 75, 175, 185, 949, 673, 2239, 4355, 10687, 27093, 37409, 23193, 211819}}, {14847, 18, 23931, {1, 1, 3, 13, 21, 3, 41, 55, 243, 501, 285, 7, 6291, 7725, 17051, 45753, 115117, 14323}}, {14848, 18, 23933, {1, 1, 1, 5, 13, 11, 51, 175, 435, 673, 67, 1525, 323, 5739, 19977, 62317, 97511, 130883}}, {14849, 18, 23943, {1, 3, 5, 11, 7, 11, 97, 59, 295, 409, 453, 2439, 5217, 10315, 469, 31187, 17325, 158079}}, {14850, 18, 23957, {1, 1, 3, 5, 31, 9, 15, 63, 411, 427, 277, 2687, 5021, 1507, 22453, 35559, 122081, 121669}}, {14851, 18, 23986, {1, 3, 5, 13, 3, 21, 69, 51, 27, 571, 1981, 2729, 5733, 1225, 26821, 43763, 57355, 169279}}, {14852, 18, 24020, {1, 1, 1, 13, 31, 37, 33, 19, 313, 341, 1141, 1689, 4511, 789, 15317, 61263, 79371, 65157}}, {14853, 18, 24043, {1, 3, 3, 15, 27, 41, 107, 23, 499, 339, 273, 1937, 2743, 10879, 27127, 64817, 1217, 45863}}, {14854, 18, 24064, {1, 1, 5, 9, 19, 43, 125, 223, 473, 489, 1999, 1513, 6479, 9511, 12503, 29419, 22559, 209499}}, {14855, 18, 24082, {1, 3, 1, 13, 25, 55, 53, 61, 303, 337, 1325, 2525, 6503, 1155, 6841, 58167, 8175, 183949}}, {14856, 18, 24084, {1, 3, 3, 11, 3, 15, 55, 105, 497, 527, 1007, 3545, 4187, 8723, 12761, 20751, 101583, 225373}}, {14857, 18, 24088, {1, 3, 3, 9, 19, 59, 57, 215, 313, 871, 407, 2475, 879, 15147, 31945, 23939, 104073, 217619}}, {14858, 18, 24117, {1, 1, 3, 1, 27, 23, 3, 43, 471, 757, 1525, 3003, 2779, 6731, 12423, 59621, 72935, 192283}}, {14859, 18, 24149, {1, 3, 1, 7, 13, 23, 13, 91, 95, 745, 639, 2627, 4595, 11735, 4143, 23573, 98647, 171201}}, {14860, 18, 24165, {1, 1, 1, 15, 3, 61, 33, 181, 351, 777, 1365, 1691, 2465, 5289, 24567, 8059, 95301, 75855}}, {14861, 18, 24223, {1, 3, 5, 13, 1, 57, 57, 187, 1, 601, 563, 1703, 1307, 14673, 7793, 44589, 7629, 254071}}, {14862, 18, 24247, {1, 1, 5, 13, 29, 17, 61, 233, 371, 909, 529, 185, 127, 15773, 19529, 49271, 26749, 70869}}, {14863, 18, 24259, {1, 1, 3, 9, 21, 41, 37, 71, 505, 969, 301, 1667, 5879, 13187, 2461, 17301, 103673, 235133}}, {14864, 18, 24283, {1, 3, 1, 3, 9, 13, 75, 63, 313, 273, 1061, 3821, 539, 9887, 19775, 17259, 93133, 217245}}, {14865, 18, 24296, {1, 3, 5, 5, 21, 27, 9, 11, 461, 575, 507, 577, 4559, 9995, 13953, 61023, 121941, 195419}}, {14866, 18, 24336, {1, 3, 3, 7, 17, 17, 45, 193, 271, 571, 1337, 2107, 1923, 4791, 23773, 60923, 58085, 81219}}, {14867, 18, 24342, {1, 3, 1, 7, 11, 7, 85, 33, 231, 307, 993, 1509, 1427, 9545, 7919, 39775, 81145, 79139}}, {14868, 18, 24389, {1, 3, 5, 3, 9, 57, 117, 187, 57, 719, 1635, 2499, 6747, 6649, 22643, 16429, 83233, 122057}}, {14869, 18, 24394, {1, 1, 3, 11, 7, 39, 103, 221, 167, 181, 1355, 989, 3399, 9471, 10493, 57267, 106551, 158599}}, {14870, 18, 24414, {1, 3, 1, 15, 23, 19, 29, 11, 355, 923, 1401, 509, 3647, 5663, 2353, 53217, 70687, 145613}}, {14871, 18, 24424, {1, 3, 3, 11, 11, 5, 21, 107, 177, 429, 119, 1029, 5931, 7543, 15455, 62797, 118095, 35387}}, {14872, 18, 24441, {1, 3, 5, 15, 19, 53, 17, 215, 279, 497, 1157, 2235, 5541, 5899, 20711, 20843, 113821, 164231}}, {14873, 18, 24491, {1, 1, 1, 15, 21, 33, 67, 247, 55, 573, 1863, 2703, 5267, 4071, 18235, 44659, 102379, 171529}}, {14874, 18, 24502, {1, 3, 1, 15, 5, 59, 69, 189, 313, 243, 339, 3097, 4999, 5909, 1903, 56143, 76209, 83073}}, {14875, 18, 24534, {1, 3, 5, 15, 11, 41, 65, 207, 95, 115, 1203, 3731, 6845, 11173, 8281, 40623, 97119, 218455}}, {14876, 18, 24540, {1, 3, 7, 13, 29, 57, 5, 31, 255, 539, 107, 953, 3707, 9233, 20295, 17459, 2005, 56193}}, {14877, 18, 24543, {1, 1, 1, 15, 5, 31, 83, 165, 211, 433, 1411, 2949, 4817, 1645, 1693, 9877, 118493, 142923}}, {14878, 18, 24549, {1, 3, 1, 11, 19, 61, 35, 21, 159, 159, 1717, 3227, 3351, 8641, 20575, 13721, 114649, 129201}}, {14879, 18, 24567, {1, 3, 1, 13, 9, 41, 17, 7, 209, 501, 445, 23, 7911, 5867, 30129, 643, 36363, 52037}}, {14880, 18, 24583, {1, 3, 5, 11, 31, 55, 27, 81, 413, 167, 599, 2231, 7055, 4013, 26729, 63927, 12075, 208123}}, {14881, 18, 24693, {1, 1, 7, 9, 11, 39, 99, 187, 169, 999, 609, 3647, 2497, 8969, 30919, 29145, 67699, 51601}}, {14882, 18, 24704, {1, 3, 1, 1, 11, 11, 69, 29, 197, 979, 1135, 869, 5435, 5151, 26349, 55911, 68051, 131849}}, {14883, 18, 24719, {1, 1, 1, 5, 27, 1, 85, 145, 439, 585, 1713, 677, 1833, 14139, 5547, 31265, 82223, 47605}}, {14884, 18, 24749, {1, 3, 5, 9, 17, 23, 31, 199, 447, 551, 683, 2977, 7839, 8681, 15923, 61057, 89875, 52945}}, {14885, 18, 24799, {1, 1, 3, 11, 9, 17, 29, 125, 195, 123, 1259, 2729, 3099, 2229, 9683, 13121, 105399, 111833}}, {14886, 18, 24830, {1, 3, 1, 3, 1, 47, 93, 117, 461, 633, 1641, 933, 7927, 13569, 483, 28159, 121561, 164325}}, {14887, 18, 24835, {1, 3, 1, 5, 21, 19, 79, 183, 395, 23, 767, 519, 4857, 10385, 12425, 26207, 114623, 37125}}, {14888, 18, 24907, {1, 1, 5, 5, 9, 47, 67, 217, 499, 843, 1539, 301, 1485, 3157, 22375, 47199, 26215, 182785}}, {14889, 18, 24917, {1, 1, 1, 13, 9, 37, 87, 49, 445, 681, 1097, 1049, 4093, 13167, 18447, 58243, 41797, 217929}}, {14890, 18, 24940, {1, 1, 5, 13, 13, 49, 21, 149, 79, 113, 1217, 921, 6321, 9345, 27987, 21723, 49249, 18813}}, {14891, 18, 24943, {1, 3, 1, 3, 15, 27, 67, 69, 131, 713, 1741, 1955, 5665, 8749, 11971, 11257, 13999, 124535}}, {14892, 18, 24958, {1, 3, 1, 3, 3, 11, 21, 167, 441, 557, 593, 3261, 3099, 2801, 21725, 23247, 106891, 129187}}, {14893, 18, 24962, {1, 1, 1, 11, 5, 55, 33, 71, 505, 85, 1609, 521, 5459, 12777, 13007, 255, 67537, 2877}}, {14894, 18, 24964, {1, 1, 1, 3, 31, 47, 49, 119, 351, 797, 1407, 4089, 2381, 12409, 12849, 23489, 53631, 119387}}, {14895, 18, 24968, {1, 3, 5, 11, 25, 11, 25, 185, 85, 849, 141, 385, 3663, 13133, 8451, 61463, 35129, 149933}}, {14896, 18, 25015, {1, 3, 7, 9, 23, 17, 21, 197, 15, 893, 939, 707, 5491, 7249, 14009, 18973, 111545, 36809}}, {14897, 18, 25024, {1, 3, 3, 13, 23, 15, 19, 193, 223, 627, 1529, 1963, 1003, 7199, 15361, 25233, 110281, 221761}}, {14898, 18, 25027, {1, 3, 3, 1, 17, 51, 61, 215, 311, 919, 349, 59, 2897, 12137, 5931, 37611, 124387, 83503}}, {14899, 18, 25033, {1, 3, 7, 9, 13, 47, 53, 139, 481, 733, 389, 1209, 3281, 593, 29103, 61521, 41445, 11015}}, {14900, 18, 25041, {1, 1, 1, 13, 3, 31, 19, 47, 151, 883, 1707, 827, 2129, 4333, 871, 42967, 79701, 192211}}, {14901, 18, 25047, {1, 3, 3, 11, 11, 51, 121, 241, 199, 881, 1493, 2381, 5161, 13287, 8155, 52481, 120307, 206203}}, {14902, 18, 25057, {1, 1, 1, 13, 15, 37, 27, 151, 17, 851, 1343, 1447, 43, 10267, 18267, 21347, 129277, 83987}}, {14903, 18, 25082, {1, 1, 3, 3, 13, 17, 53, 217, 253, 853, 1461, 1953, 617, 4209, 9925, 377, 42789, 150415}}, {14904, 18, 25093, {1, 3, 7, 11, 13, 23, 83, 235, 39, 701, 1091, 25, 1807, 15431, 2169, 5339, 123679, 117053}}, {14905, 18, 25105, {1, 3, 7, 13, 3, 29, 43, 149, 33, 873, 1177, 1961, 7943, 11317, 30725, 55765, 50929, 12335}}, {14906, 18, 25112, {1, 1, 3, 5, 25, 1, 91, 121, 295, 25, 1743, 2125, 2643, 11175, 15089, 44979, 28355, 543}}, {14907, 18, 25117, {1, 1, 1, 13, 27, 27, 43, 195, 377, 821, 437, 3445, 2673, 15221, 15101, 25143, 22347, 218549}}, {14908, 18, 25131, {1, 1, 3, 7, 9, 51, 121, 231, 91, 913, 1325, 167, 8067, 8119, 9307, 33551, 58069, 170567}}, {14909, 18, 25139, {1, 3, 7, 7, 15, 7, 85, 51, 11, 353, 1117, 2479, 3091, 2377, 23589, 38537, 113047, 261285}}, {14910, 18, 25194, {1, 1, 3, 5, 15, 33, 61, 145, 147, 815, 767, 9, 2059, 11463, 1883, 8565, 101043, 117565}}, {14911, 18, 25204, {1, 3, 5, 3, 5, 49, 5, 33, 15, 13, 895, 3973, 7963, 3831, 26817, 10799, 111409, 90679}}, {14912, 18, 25244, {1, 1, 5, 7, 5, 51, 35, 237, 217, 531, 719, 2711, 1937, 16071, 23233, 22799, 66023, 145739}}, {14913, 18, 25247, {1, 3, 5, 1, 5, 63, 1, 163, 9, 697, 1379, 2989, 7113, 9821, 15941, 6495, 7825, 29715}}, {14914, 18, 25253, {1, 3, 5, 7, 9, 41, 113, 173, 151, 963, 2019, 3531, 1133, 4287, 16917, 16929, 12345, 31201}}, {14915, 18, 25258, {1, 3, 7, 1, 25, 9, 5, 195, 175, 297, 717, 3725, 33, 5155, 4405, 56171, 105597, 132407}}, {14916, 18, 25275, {1, 1, 7, 7, 3, 59, 115, 95, 227, 951, 843, 619, 7791, 10981, 11773, 57651, 108391, 179561}}, {14917, 18, 25320, {1, 3, 3, 1, 9, 3, 59, 161, 417, 413, 1933, 1027, 4575, 10427, 15643, 16049, 120089, 176607}}, {14918, 18, 25338, {1, 3, 3, 3, 15, 1, 83, 195, 59, 859, 1669, 1063, 2069, 15875, 16459, 53741, 114521, 37641}}, {14919, 18, 25343, {1, 1, 1, 11, 11, 45, 47, 143, 11, 239, 1329, 865, 2693, 899, 26265, 43255, 125679, 130099}}, {14920, 18, 25351, {1, 3, 5, 3, 31, 51, 95, 127, 79, 167, 117, 3177, 5875, 14039, 20341, 47815, 118799, 211871}}, {14921, 18, 25358, {1, 1, 1, 1, 3, 21, 65, 203, 11, 565, 537, 1307, 8189, 11423, 7745, 56117, 110959, 95361}}, {14922, 18, 25372, {1, 1, 7, 7, 21, 63, 63, 231, 441, 127, 1943, 13, 4813, 10607, 23867, 43891, 15801, 173245}}, {14923, 18, 25399, {1, 3, 3, 5, 25, 23, 123, 133, 129, 303, 1993, 1453, 1109, 4649, 30315, 62399, 121575, 60069}}, {14924, 18, 25408, {1, 3, 5, 3, 29, 23, 69, 141, 137, 1017, 1915, 35, 3817, 6249, 22427, 7281, 88473, 230167}}, {14925, 18, 25432, {1, 3, 7, 7, 19, 37, 93, 217, 287, 731, 583, 3377, 2879, 4873, 5549, 52949, 127285, 211173}}, {14926, 18, 25442, {1, 1, 5, 7, 23, 41, 49, 145, 277, 571, 1225, 455, 2133, 1229, 25421, 20179, 70919, 242825}}, {14927, 18, 25462, {1, 3, 5, 5, 29, 3, 1, 89, 413, 901, 1343, 3963, 6969, 14649, 18331, 4573, 82077, 100693}}, {14928, 18, 25465, {1, 1, 1, 13, 31, 53, 107, 95, 151, 539, 1593, 3763, 1007, 8959, 25235, 16461, 121819, 106143}}, {14929, 18, 25468, {1, 1, 1, 3, 11, 15, 5, 157, 347, 81, 2013, 2025, 6541, 12287, 1315, 23285, 23539, 75027}}, {14930, 18, 25482, {1, 1, 5, 7, 17, 11, 65, 157, 93, 607, 1445, 4089, 3139, 4699, 1225, 58935, 93673, 146467}}, {14931, 18, 25489, {1, 3, 3, 13, 29, 59, 69, 141, 257, 463, 93, 649, 8179, 15205, 6943, 45317, 31269, 70825}}, {14932, 18, 25490, {1, 3, 5, 9, 23, 39, 113, 61, 315, 463, 1739, 149, 6007, 2789, 12021, 969, 18551, 153669}}, {14933, 18, 25505, {1, 1, 3, 15, 19, 9, 23, 211, 265, 877, 325, 2635, 8131, 4957, 24371, 60975, 3887, 198927}}, {14934, 18, 25511, {1, 1, 3, 11, 29, 31, 5, 105, 157, 573, 2009, 1701, 1549, 1641, 17429, 13587, 48421, 8675}}, {14935, 18, 25512, {1, 1, 5, 13, 3, 13, 17, 55, 101, 369, 705, 3635, 5195, 10439, 12881, 21565, 1671, 75489}}, {14936, 18, 25552, {1, 3, 3, 1, 1, 23, 85, 189, 347, 205, 5, 3465, 3269, 3347, 10163, 26921, 86555, 9387}}, {14937, 18, 25555, {1, 3, 7, 15, 27, 21, 79, 151, 279, 627, 1093, 1929, 5549, 12141, 5245, 55747, 65939, 193759}}, {14938, 18, 25595, {1, 1, 1, 5, 5, 23, 57, 235, 143, 129, 795, 35, 4375, 12577, 871, 20879, 82811, 52279}}, {14939, 18, 25636, {1, 3, 1, 5, 11, 1, 125, 99, 89, 629, 857, 2631, 393, 15075, 27473, 42695, 61505, 239651}}, {14940, 18, 25672, {1, 1, 5, 1, 9, 11, 55, 203, 453, 677, 259, 1979, 4101, 16067, 26783, 17907, 75349, 62797}}, {14941, 18, 25685, {1, 3, 7, 5, 5, 19, 85, 165, 341, 405, 1779, 87, 889, 265, 9851, 36175, 69697, 123769}}, {14942, 18, 25696, {1, 3, 7, 1, 7, 49, 93, 57, 85, 597, 183, 3253, 6301, 9307, 8753, 38133, 58743, 19621}}, {14943, 18, 25720, {1, 1, 3, 9, 1, 15, 125, 215, 391, 141, 87, 37, 4333, 5033, 30549, 64281, 18577, 156093}}, {14944, 18, 25730, {1, 3, 3, 15, 17, 25, 29, 81, 339, 865, 1619, 773, 901, 8163, 22275, 57159, 119951, 137451}}, {14945, 18, 25735, {1, 3, 5, 15, 7, 57, 113, 221, 13, 49, 1653, 3695, 4423, 4383, 28669, 64175, 130355, 202543}}, {14946, 18, 25753, {1, 1, 3, 9, 29, 21, 19, 119, 409, 717, 1853, 3981, 4489, 3985, 31205, 10423, 13223, 131973}}, {14947, 18, 25756, {1, 1, 3, 15, 29, 7, 1, 85, 133, 345, 317, 2363, 7803, 4975, 19441, 10497, 42059, 131531}}, {14948, 18, 25769, {1, 1, 7, 13, 3, 53, 49, 27, 487, 901, 801, 335, 6317, 14205, 26655, 52747, 102659, 231359}}, {14949, 18, 25821, {1, 3, 3, 3, 13, 33, 113, 107, 407, 499, 903, 3059, 1343, 11859, 6315, 23071, 73627, 44239}}, {14950, 18, 25825, {1, 3, 5, 15, 1, 53, 59, 247, 213, 981, 443, 3, 615, 12067, 3881, 61759, 101219, 110407}}, {14951, 18, 25840, {1, 3, 5, 13, 7, 31, 87, 161, 61, 1023, 147, 2075, 7245, 9025, 7229, 60935, 104481, 169561}}, {14952, 18, 25860, {1, 3, 1, 15, 25, 17, 53, 107, 311, 621, 1493, 2443, 4635, 12163, 12543, 43031, 90843, 139645}}, {14953, 18, 25869, {1, 3, 5, 11, 7, 49, 91, 165, 91, 329, 493, 3533, 7429, 7047, 14767, 31641, 62005, 77267}}, {14954, 18, 25872, {1, 1, 3, 9, 31, 21, 19, 167, 185, 199, 1989, 1093, 4213, 4769, 21659, 19685, 122123, 215233}}, {14955, 18, 25956, {1, 3, 3, 7, 27, 23, 99, 205, 365, 689, 1281, 419, 4207, 5355, 20245, 25029, 123029, 61499}}, {14956, 18, 25973, {1, 3, 3, 7, 19, 15, 29, 185, 165, 203, 1859, 2895, 6361, 6331, 13641, 42577, 33757, 41305}}, {14957, 18, 25994, {1, 3, 5, 11, 21, 43, 15, 11, 425, 125, 1597, 1109, 3335, 7009, 20799, 41261, 127813, 181261}}, {14958, 18, 26002, {1, 1, 5, 5, 27, 35, 35, 159, 111, 1011, 1487, 813, 4985, 2555, 23741, 44675, 97159, 250477}}, {14959, 18, 26020, {1, 3, 3, 7, 17, 41, 81, 187, 367, 767, 1345, 205, 5797, 9129, 21973, 39911, 130131, 96891}}, {14960, 18, 26023, {1, 3, 5, 1, 1, 47, 57, 177, 127, 791, 1427, 1895, 5995, 12569, 32711, 58599, 55641, 80405}}, {14961, 18, 26041, {1, 3, 3, 1, 23, 13, 115, 81, 511, 677, 775, 3143, 4963, 7093, 15963, 59893, 22609, 137601}}, {14962, 18, 26044, {1, 1, 5, 9, 17, 17, 115, 127, 397, 139, 1171, 207, 3485, 15869, 465, 26267, 29957, 205459}}, {14963, 18, 26069, {1, 3, 7, 3, 9, 29, 23, 189, 447, 481, 753, 2415, 2669, 6007, 15201, 7317, 18861, 173759}}, {14964, 18, 26097, {1, 3, 5, 7, 13, 43, 13, 163, 363, 683, 1869, 1237, 2523, 3661, 13887, 5593, 91513, 220177}}, {14965, 18, 26113, {1, 1, 1, 11, 7, 11, 43, 39, 319, 793, 375, 3159, 7621, 8965, 25743, 351, 31873, 18115}}, {14966, 18, 26138, {1, 1, 5, 5, 11, 57, 79, 147, 55, 553, 417, 1365, 3979, 9789, 22677, 58645, 104549, 9019}}, {14967, 18, 26167, {1, 1, 3, 11, 17, 37, 127, 5, 165, 867, 79, 2259, 197, 4789, 28109, 46721, 3431, 118939}}, {14968, 18, 26216, {1, 1, 5, 13, 19, 45, 113, 11, 125, 351, 1753, 3201, 1697, 2567, 9717, 22247, 84309, 248583}}, {14969, 18, 26230, {1, 1, 5, 9, 5, 37, 65, 47, 261, 855, 1573, 2267, 7977, 13029, 32527, 59805, 103591, 180041}}, {14970, 18, 26243, {1, 3, 3, 9, 31, 5, 115, 159, 111, 899, 1907, 2671, 1575, 7021, 10281, 34905, 641, 63549}}, {14971, 18, 26245, {1, 3, 5, 1, 17, 61, 45, 9, 375, 761, 117, 1767, 4657, 12217, 12067, 42807, 118587, 72715}}, {14972, 18, 26263, {1, 1, 1, 13, 3, 3, 93, 3, 351, 97, 119, 1743, 81, 12761, 22529, 47191, 111315, 256501}}, {14973, 18, 26264, {1, 1, 5, 7, 29, 23, 41, 9, 231, 567, 1565, 3539, 7241, 11535, 7375, 10391, 127045, 9371}}, {14974, 18, 26269, {1, 1, 1, 15, 23, 47, 39, 57, 73, 809, 513, 3233, 8071, 8595, 13817, 821, 89091, 107173}}, {14975, 18, 26311, {1, 1, 1, 13, 13, 43, 75, 239, 487, 175, 1561, 3925, 3743, 14247, 15713, 55005, 116135, 199827}}, {14976, 18, 26346, {1, 1, 3, 7, 13, 15, 67, 147, 77, 241, 1763, 651, 1107, 4943, 15651, 23259, 45931, 34717}}, {14977, 18, 26354, {1, 1, 3, 5, 15, 15, 67, 153, 163, 179, 1567, 685, 3245, 2205, 8373, 56567, 32091, 23313}}, {14978, 18, 26365, {1, 1, 7, 9, 1, 27, 79, 209, 263, 517, 635, 3, 103, 2173, 22659, 11319, 103757, 144449}}, {14979, 18, 26368, {1, 1, 1, 5, 11, 63, 21, 89, 443, 775, 327, 1559, 1421, 2309, 18597, 46385, 16547, 186813}}, {14980, 18, 26398, {1, 1, 7, 9, 27, 37, 43, 7, 305, 117, 1103, 1801, 3349, 12225, 28215, 8857, 118677, 88909}}, {14981, 18, 26401, {1, 3, 3, 7, 15, 59, 21, 19, 371, 81, 755, 1565, 4823, 16363, 20301, 33571, 74423, 177205}}, {14982, 18, 26426, {1, 1, 3, 9, 15, 33, 23, 31, 171, 713, 271, 2437, 3609, 4271, 24355, 46283, 121767, 188501}}, {14983, 18, 26436, {1, 1, 1, 1, 21, 3, 3, 241, 339, 211, 443, 1577, 343, 2625, 1077, 29933, 106401, 51439}}, {14984, 18, 26443, {1, 3, 5, 15, 13, 31, 11, 167, 15, 101, 373, 2095, 3017, 1347, 15029, 6579, 21233, 87589}}, {14985, 18, 26448, {1, 3, 1, 3, 15, 1, 61, 239, 13, 867, 1621, 2275, 5757, 8275, 7923, 44469, 113513, 84927}}, {14986, 18, 26458, {1, 1, 1, 13, 23, 27, 101, 25, 459, 517, 127, 1131, 669, 13209, 23671, 3379, 66091, 72919}}, {14987, 18, 26464, {1, 3, 5, 7, 29, 53, 25, 185, 101, 707, 281, 183, 2823, 7241, 3127, 48093, 20195, 208349}}, {14988, 18, 26476, {1, 3, 3, 15, 31, 11, 3, 165, 453, 609, 1053, 3937, 1989, 13887, 13415, 8005, 103537, 17853}}, {14989, 18, 26503, {1, 1, 3, 7, 3, 41, 13, 67, 227, 265, 767, 391, 1835, 8827, 13131, 42605, 117089, 12475}}, {14990, 18, 26504, {1, 1, 7, 3, 15, 31, 45, 157, 261, 207, 1109, 1587, 5389, 13239, 31697, 35969, 79839, 209633}}, {14991, 18, 26515, {1, 1, 5, 9, 31, 3, 35, 187, 5, 945, 633, 2645, 171, 2221, 18369, 41765, 82373, 8007}}, {14992, 18, 26531, {1, 1, 7, 7, 3, 57, 73, 103, 245, 811, 1637, 101, 6335, 9911, 663, 21779, 31681, 119141}}, {14993, 18, 26548, {1, 1, 5, 13, 27, 25, 5, 203, 183, 251, 1803, 665, 6295, 965, 5269, 379, 78455, 7097}}, {14994, 18, 26570, {1, 1, 5, 3, 19, 55, 45, 161, 481, 737, 1903, 1093, 3313, 4427, 7959, 6231, 94769, 123827}}, {14995, 18, 26589, {1, 1, 7, 11, 29, 41, 77, 165, 49, 875, 137, 2003, 8093, 1941, 25979, 10765, 99241, 71275}}, {14996, 18, 26594, {1, 3, 5, 3, 23, 1, 89, 163, 293, 701, 29, 2543, 4487, 14873, 28123, 48643, 31633, 74179}}, {14997, 18, 26608, {1, 1, 7, 1, 13, 33, 33, 173, 111, 959, 205, 1633, 3127, 3963, 6455, 41809, 60655, 247121}}, {14998, 18, 26623, {1, 3, 5, 13, 1, 49, 87, 217, 381, 125, 823, 837, 3967, 8157, 11097, 35721, 93591, 3939}}, {14999, 18, 26678, {1, 3, 7, 1, 7, 27, 29, 21, 295, 127, 823, 2409, 1873, 2417, 27961, 39211, 14785, 71557}}, {15000, 18, 26690, {1, 3, 1, 5, 31, 59, 43, 121, 217, 417, 2029, 3983, 5629, 10447, 1073, 57515, 58849, 178927}}, {15001, 18, 26709, {1, 3, 3, 11, 5, 59, 45, 39, 269, 483, 757, 3245, 4383, 11127, 26535, 17395, 60953, 259333}}, {15002, 18, 26725, {1, 1, 1, 5, 5, 49, 81, 241, 371, 353, 1293, 3375, 6725, 11891, 5973, 13901, 37999, 17751}}, {15003, 18, 26744, {1, 3, 3, 7, 31, 21, 45, 107, 33, 911, 1869, 2643, 2655, 3979, 5509, 33065, 128463, 246937}}, {15004, 18, 26763, {1, 1, 1, 1, 31, 33, 99, 29, 485, 11, 1423, 1775, 2045, 741, 30691, 53957, 13891, 57303}}, {15005, 18, 26765, {1, 1, 7, 13, 7, 37, 117, 121, 51, 743, 887, 1769, 1049, 12859, 1663, 27763, 90969, 38935}}, {15006, 18, 26768, {1, 3, 5, 7, 3, 41, 121, 89, 461, 979, 457, 2973, 8109, 13819, 30237, 54671, 66967, 135233}}, {15007, 18, 26784, {1, 1, 7, 13, 13, 47, 51, 121, 295, 847, 681, 1163, 8123, 14179, 26561, 54057, 74043, 146155}}, {15008, 18, 26802, {1, 3, 3, 11, 21, 15, 9, 85, 445, 11, 1525, 3165, 5929, 12481, 10769, 31885, 51487, 248933}}, {15009, 18, 26814, {1, 3, 1, 9, 25, 41, 59, 139, 293, 1021, 2043, 967, 3949, 7309, 6545, 62761, 37761, 22395}}, {15010, 18, 26856, {1, 3, 7, 15, 25, 45, 29, 75, 283, 845, 687, 3285, 7263, 10237, 5343, 58635, 85137, 2387}}, {15011, 18, 26861, {1, 1, 3, 15, 29, 33, 111, 175, 251, 181, 709, 1373, 1661, 1155, 30479, 57823, 28809, 74117}}, {15012, 18, 26862, {1, 3, 3, 5, 11, 37, 55, 155, 439, 173, 1861, 1713, 1675, 12119, 12531, 50995, 124657, 58321}}, {15013, 18, 26894, {1, 1, 5, 13, 1, 23, 27, 141, 3, 985, 1439, 781, 7381, 2223, 26673, 46607, 54953, 24547}}, {15014, 18, 26908, {1, 1, 5, 7, 5, 3, 41, 115, 503, 731, 633, 3631, 3455, 15937, 22639, 41163, 65243, 233749}}, {15015, 18, 26915, {1, 3, 1, 1, 5, 57, 89, 35, 53, 653, 1763, 1247, 6999, 1811, 28191, 52327, 129421, 191093}}, {15016, 18, 26929, {1, 3, 3, 9, 3, 27, 107, 13, 475, 409, 1623, 483, 3127, 12841, 4777, 36157, 24967, 89795}}, {15017, 18, 26930, {1, 1, 3, 5, 7, 29, 15, 225, 257, 923, 251, 21, 4559, 3571, 9351, 1739, 37393, 170789}}, {15018, 18, 26939, {1, 3, 7, 5, 11, 7, 107, 237, 343, 665, 767, 2293, 4781, 4811, 11227, 25045, 3951, 44307}}, {15019, 18, 26941, {1, 3, 7, 7, 13, 31, 47, 9, 121, 441, 1011, 2015, 8053, 355, 13441, 23213, 60675, 259761}}, {15020, 18, 26987, {1, 1, 5, 9, 21, 61, 85, 141, 271, 577, 17, 243, 3049, 2479, 28947, 53351, 67379, 211133}}, {15021, 18, 27023, {1, 1, 1, 15, 23, 1, 119, 141, 311, 543, 1463, 3633, 8111, 9439, 4147, 64913, 28261, 197217}}, {15022, 18, 27066, {1, 3, 1, 15, 15, 33, 125, 231, 225, 797, 605, 259, 3673, 10423, 7541, 26289, 61681, 136463}}, {15023, 18, 27079, {1, 3, 1, 13, 23, 15, 15, 151, 289, 657, 1883, 2923, 6861, 1411, 17159, 9353, 79463, 135813}}, {15024, 18, 27086, {1, 3, 7, 11, 5, 59, 101, 167, 291, 63, 753, 1105, 8173, 2389, 22097, 7207, 110377, 15797}}, {15025, 18, 27091, {1, 3, 7, 15, 7, 9, 7, 135, 303, 675, 1803, 2827, 1711, 9543, 16567, 24075, 17065, 22193}}, {15026, 18, 27113, {1, 3, 5, 7, 17, 7, 125, 57, 423, 733, 1813, 4031, 713, 10687, 27315, 37599, 78807, 103429}}, {15027, 18, 27157, {1, 1, 5, 15, 21, 11, 87, 21, 415, 571, 1169, 2561, 7071, 12499, 195, 20111, 116757, 157731}}, {15028, 18, 27174, {1, 3, 3, 15, 7, 33, 11, 241, 23, 189, 599, 2891, 2829, 13327, 21777, 57733, 38583, 162161}}, {15029, 18, 27188, {1, 1, 1, 15, 3, 49, 7, 143, 291, 301, 1439, 793, 3447, 1167, 2815, 24875, 117437, 112561}}, {15030, 18, 27191, {1, 3, 5, 13, 29, 11, 51, 255, 365, 741, 1919, 2091, 2865, 12721, 4329, 37281, 128703, 739}}, {15031, 18, 27197, {1, 1, 1, 13, 19, 31, 39, 141, 81, 133, 297, 3837, 7537, 16043, 11755, 10289, 74399, 95371}}, {15032, 18, 27206, {1, 1, 7, 5, 21, 35, 125, 109, 241, 217, 1219, 2617, 1925, 9573, 19305, 44689, 89365, 248869}}, {15033, 18, 27210, {1, 3, 5, 5, 13, 33, 43, 221, 325, 267, 837, 809, 6025, 9847, 9267, 13465, 45937, 204339}}, {15034, 18, 27245, {1, 3, 1, 3, 25, 53, 85, 249, 105, 619, 917, 1213, 5365, 6197, 22929, 27529, 71011, 141651}}, {15035, 18, 27254, {1, 1, 5, 1, 29, 9, 27, 161, 269, 775, 1043, 303, 4503, 5059, 479, 17237, 51383, 152495}}, {15036, 18, 27383, {1, 3, 1, 5, 19, 5, 127, 139, 1, 461, 943, 593, 7457, 3357, 1909, 64633, 91811, 92703}}, {15037, 18, 27387, {1, 1, 5, 7, 1, 21, 83, 29, 123, 83, 1085, 2727, 651, 15801, 20561, 34821, 17671, 162227}}, {15038, 18, 27416, {1, 3, 7, 1, 19, 59, 33, 195, 81, 69, 51, 1473, 3873, 4247, 3587, 4293, 30831, 245345}}, {15039, 18, 27422, {1, 3, 1, 3, 23, 27, 19, 115, 275, 293, 705, 131, 1001, 8881, 30165, 25149, 38679, 175167}}, {15040, 18, 27472, {1, 1, 3, 15, 11, 11, 79, 55, 323, 217, 859, 897, 6567, 12529, 3161, 13009, 100787, 3501}}, {15041, 18, 27478, {1, 3, 1, 15, 17, 63, 51, 71, 55, 207, 1095, 2527, 611, 9281, 7375, 14553, 16021, 88537}}, {15042, 18, 27548, {1, 1, 7, 9, 11, 23, 95, 25, 327, 873, 575, 3583, 6587, 137, 23737, 59341, 83281, 93541}}, {15043, 18, 27579, {1, 1, 5, 7, 15, 37, 89, 105, 471, 757, 103, 3747, 3565, 4957, 23537, 16193, 84843, 256757}}, {15044, 18, 27582, {1, 3, 5, 1, 15, 17, 119, 231, 387, 715, 797, 3807, 4985, 8335, 4885, 45541, 69597, 238599}}, {15045, 18, 27589, {1, 1, 3, 1, 7, 21, 87, 205, 39, 503, 433, 3643, 4719, 2051, 10049, 28997, 75981, 253647}}, {15046, 18, 27593, {1, 3, 1, 13, 9, 21, 103, 63, 27, 267, 185, 3507, 3009, 5183, 2261, 40249, 33733, 70493}}, {15047, 18, 27613, {1, 1, 3, 13, 7, 7, 79, 13, 141, 327, 1035, 1699, 6273, 5621, 13877, 57607, 50207, 184643}}, {15048, 18, 27649, {1, 1, 3, 1, 9, 19, 75, 99, 115, 469, 1025, 1999, 1985, 9975, 11069, 59113, 80877, 124153}}, {15049, 18, 27717, {1, 3, 5, 7, 19, 27, 47, 3, 313, 575, 107, 991, 2575, 11001, 12323, 21443, 126245, 219649}}, {15050, 18, 27729, {1, 1, 1, 5, 19, 33, 13, 1, 357, 225, 1355, 1827, 7127, 6387, 19299, 24935, 26847, 251433}}, {15051, 18, 27751, {1, 1, 1, 5, 3, 3, 113, 19, 425, 209, 159, 347, 1349, 6771, 13125, 8393, 21435, 186369}}, {15052, 18, 27757, {1, 1, 5, 11, 5, 39, 95, 3, 193, 741, 1755, 3361, 1927, 12909, 5413, 29111, 123429, 109191}}, {15053, 18, 27766, {1, 1, 1, 13, 31, 23, 43, 163, 421, 719, 457, 3149, 7741, 1465, 15719, 42831, 99051, 164675}}, {15054, 18, 27791, {1, 1, 1, 7, 15, 1, 29, 15, 9, 577, 269, 31, 4361, 5081, 32185, 54869, 115105, 151233}}, {15055, 18, 27794, {1, 1, 1, 11, 19, 3, 67, 3, 377, 487, 1287, 3463, 6523, 15237, 3171, 38673, 7359, 29739}}, {15056, 18, 27854, {1, 3, 5, 11, 9, 13, 47, 191, 97, 641, 807, 1085, 1537, 2855, 24615, 32383, 66425, 53713}}, {15057, 18, 27856, {1, 1, 5, 7, 19, 25, 93, 1, 21, 853, 813, 2535, 4291, 9051, 3385, 507, 73889, 85397}}, {15058, 18, 27866, {1, 1, 3, 13, 7, 15, 103, 199, 83, 585, 1859, 2089, 839, 8923, 14615, 3399, 7703, 229937}}, {15059, 18, 27875, {1, 1, 3, 3, 11, 23, 125, 135, 475, 613, 327, 339, 3081, 13221, 4889, 41233, 36547, 195357}}, {15060, 18, 27902, {1, 3, 7, 7, 19, 23, 85, 217, 501, 447, 1873, 2175, 6753, 2825, 5171, 47561, 13321, 59583}}, {15061, 18, 27916, {1, 1, 5, 13, 23, 59, 109, 195, 487, 785, 21, 1595, 5641, 10103, 8115, 60647, 78425, 237379}}, {15062, 18, 27924, {1, 1, 3, 15, 21, 17, 85, 51, 369, 475, 1021, 1129, 7233, 6593, 12467, 55399, 128157, 80539}}, {15063, 18, 27933, {1, 3, 3, 9, 31, 27, 69, 145, 489, 251, 1997, 1157, 2027, 16109, 4085, 24859, 63561, 79591}}, {15064, 18, 27940, {1, 3, 3, 5, 29, 49, 41, 185, 405, 471, 431, 3539, 6593, 1185, 24383, 17009, 111215, 79839}}, {15065, 18, 27947, {1, 1, 7, 3, 3, 15, 97, 157, 301, 227, 717, 3291, 2471, 11515, 30657, 30745, 72147, 98653}}, {15066, 18, 27969, {1, 3, 5, 1, 23, 21, 67, 223, 185, 385, 137, 2897, 2423, 6119, 28471, 52269, 95725, 9105}}, {15067, 18, 27981, {1, 3, 3, 11, 19, 1, 111, 131, 293, 495, 1043, 631, 1375, 15347, 22029, 29163, 120025, 81631}}, {15068, 18, 27996, {1, 1, 7, 5, 17, 55, 47, 183, 367, 81, 555, 2857, 4787, 5605, 32053, 11815, 81771, 234993}}, {15069, 18, 28005, {1, 3, 7, 15, 15, 49, 45, 221, 49, 299, 887, 3991, 2097, 10819, 23297, 1823, 11319, 205273}}, {15070, 18, 28030, {1, 1, 1, 1, 1, 15, 91, 253, 213, 849, 501, 1073, 5503, 1379, 28887, 51811, 109763, 226149}}, {15071, 18, 28064, {1, 1, 1, 7, 27, 39, 17, 29, 359, 655, 1695, 1781, 1203, 1125, 8983, 3477, 13925, 218399}}, {15072, 18, 28102, {1, 3, 7, 13, 1, 25, 33, 185, 87, 19, 151, 371, 1221, 4859, 20103, 11435, 104263, 218515}}, {15073, 18, 28108, {1, 1, 3, 5, 17, 43, 29, 149, 207, 39, 1539, 2933, 6825, 12391, 18163, 24543, 35305, 196295}}, {15074, 18, 28120, {1, 3, 7, 9, 21, 61, 69, 231, 401, 95, 1757, 839, 3395, 7573, 6583, 34621, 119303, 20767}}, {15075, 18, 28125, {1, 1, 7, 1, 25, 53, 63, 105, 241, 591, 23, 3219, 2387, 13945, 3047, 30939, 63243, 60941}}, {15076, 18, 28130, {1, 1, 5, 7, 25, 47, 7, 227, 57, 279, 81, 4017, 3117, 6229, 20029, 30031, 25049, 102291}}, {15077, 18, 28142, {1, 3, 3, 1, 21, 15, 69, 57, 311, 9, 853, 3377, 2949, 4781, 15419, 54741, 11603, 136821}}, {15078, 18, 28149, {1, 3, 3, 13, 13, 5, 103, 253, 27, 449, 821, 3241, 41, 6643, 15217, 61691, 58463, 46117}}, {15079, 18, 28165, {1, 1, 7, 7, 27, 51, 1, 239, 71, 955, 145, 1059, 5645, 7025, 4839, 11459, 3051, 235989}}, {15080, 18, 28169, {1, 1, 5, 15, 15, 13, 33, 21, 209, 681, 1163, 3109, 1441, 6895, 20829, 48769, 35373, 195171}}, {15081, 18, 28177, {1, 1, 7, 3, 11, 7, 25, 27, 463, 77, 1293, 1977, 4931, 8089, 11079, 14793, 123049, 32259}}, {15082, 18, 28211, {1, 3, 1, 15, 11, 49, 7, 103, 79, 773, 235, 1653, 6477, 8835, 26627, 61101, 40633, 98155}}, {15083, 18, 28213, {1, 3, 5, 7, 3, 53, 77, 197, 49, 57, 1533, 3485, 6603, 1131, 9073, 37023, 85293, 170883}}, {15084, 18, 28220, {1, 3, 7, 15, 23, 5, 125, 75, 413, 521, 1897, 1099, 35, 2013, 687, 51511, 21359, 19995}}, {15085, 18, 28261, {1, 3, 1, 11, 19, 13, 91, 181, 39, 613, 1917, 3149, 669, 9927, 20967, 38313, 13537, 181873}}, {15086, 18, 28271, {1, 3, 5, 7, 5, 23, 25, 145, 189, 679, 483, 2689, 2855, 9631, 8863, 34841, 83311, 211507}}, {15087, 18, 28299, {1, 3, 5, 15, 15, 15, 87, 53, 309, 807, 1405, 259, 3181, 12187, 31529, 8861, 70557, 247787}}, {15088, 18, 28326, {1, 1, 7, 13, 7, 15, 1, 205, 91, 325, 1371, 531, 4917, 10291, 30827, 32491, 34497, 250301}}, {15089, 18, 28330, {1, 3, 1, 11, 29, 17, 97, 37, 259, 1021, 1705, 4001, 4385, 7047, 14593, 63443, 3283, 18195}}, {15090, 18, 28350, {1, 1, 7, 9, 9, 55, 11, 113, 351, 513, 197, 873, 1595, 11331, 27711, 419, 73097, 144357}}, {15091, 18, 28355, {1, 3, 7, 15, 29, 31, 37, 15, 233, 573, 1457, 293, 5437, 15909, 3087, 24535, 6507, 173555}}, {15092, 18, 28367, {1, 1, 1, 7, 7, 47, 81, 241, 257, 389, 233, 3275, 919, 14911, 14473, 58457, 78195, 121421}}, {15093, 18, 28376, {1, 3, 7, 13, 1, 63, 9, 233, 231, 771, 1851, 3829, 7089, 4573, 13297, 58963, 2065, 8365}}, {15094, 18, 28379, {1, 1, 5, 1, 31, 45, 45, 209, 77, 977, 159, 1521, 969, 10115, 32387, 52821, 124209, 51841}}, {15095, 18, 28381, {1, 3, 5, 5, 13, 27, 53, 171, 91, 743, 217, 3805, 7721, 15127, 20679, 57459, 53649, 16381}}, {15096, 18, 28447, {1, 3, 1, 15, 23, 43, 105, 169, 143, 759, 463, 1237, 3311, 2919, 16675, 53049, 12403, 153651}}, {15097, 18, 28465, {1, 3, 3, 11, 5, 27, 1, 135, 17, 683, 679, 2591, 2929, 12417, 18379, 61903, 81991, 25231}}, {15098, 18, 28471, {1, 1, 1, 5, 13, 59, 73, 119, 369, 445, 553, 243, 7523, 1105, 20349, 8417, 87535, 148857}}, {15099, 18, 28472, {1, 3, 7, 15, 29, 3, 49, 49, 7, 753, 1597, 1427, 7485, 9119, 17427, 24961, 114897, 62841}}, {15100, 18, 28478, {1, 1, 7, 7, 17, 35, 49, 225, 267, 801, 1359, 2131, 6093, 3859, 11305, 6287, 106459, 31093}}, {15101, 18, 28480, {1, 1, 5, 3, 1, 45, 19, 89, 145, 23, 1071, 3053, 3463, 6781, 8635, 1961, 54403, 183401}}, {15102, 18, 28489, {1, 3, 1, 13, 17, 35, 105, 155, 145, 597, 1169, 3731, 725, 2185, 23365, 31849, 113717, 185413}}, {15103, 18, 28514, {1, 3, 3, 5, 3, 5, 13, 119, 39, 383, 1595, 63, 7003, 6465, 19847, 37213, 42921, 254479}}, {15104, 18, 28525, {1, 3, 3, 1, 3, 33, 43, 255, 227, 151, 1911, 2657, 6529, 3855, 24411, 8485, 30385, 193265}}, {15105, 18, 28537, {1, 1, 7, 7, 21, 53, 101, 37, 193, 107, 1095, 369, 6423, 3491, 1219, 53385, 31041, 122587}}, {15106, 18, 28550, {1, 1, 7, 3, 13, 39, 101, 109, 113, 201, 619, 2489, 4545, 5017, 25519, 44281, 128605, 128595}}, {15107, 18, 28559, {1, 1, 3, 13, 25, 7, 99, 141, 465, 625, 667, 1633, 6719, 16195, 365, 34355, 65025, 128025}}, {15108, 18, 28595, {1, 1, 1, 7, 15, 51, 43, 159, 223, 493, 411, 65, 5753, 10219, 21885, 33267, 116643, 76777}}, {15109, 18, 28601, {1, 3, 5, 13, 25, 39, 97, 31, 245, 367, 685, 103, 4093, 10449, 3849, 52659, 63355, 262059}}, {15110, 18, 28629, {1, 3, 3, 1, 9, 49, 25, 157, 107, 821, 265, 2939, 6365, 7539, 17935, 50147, 88907, 214317}}, {15111, 18, 28657, {1, 1, 1, 13, 17, 5, 55, 217, 137, 915, 121, 3187, 3111, 7145, 30477, 20023, 71969, 179417}}, {15112, 18, 28667, {1, 1, 1, 5, 7, 15, 47, 71, 197, 725, 523, 2207, 5729, 741, 8595, 39125, 25431, 101093}}, {15113, 18, 28711, {1, 3, 1, 7, 19, 37, 117, 235, 353, 459, 207, 953, 4955, 14979, 22897, 53911, 7783, 203667}}, {15114, 18, 28718, {1, 1, 5, 13, 9, 17, 21, 95, 37, 751, 1463, 2491, 791, 1569, 32055, 61415, 113885, 259285}}, {15115, 18, 28730, {1, 1, 3, 11, 1, 23, 5, 73, 61, 719, 215, 469, 3267, 12003, 16535, 46913, 58321, 2407}}, {15116, 18, 28732, {1, 1, 5, 11, 5, 9, 81, 1, 275, 877, 791, 1591, 2109, 9983, 29085, 15069, 44757, 17887}}, {15117, 18, 28777, {1, 3, 7, 11, 23, 47, 121, 53, 55, 677, 1239, 2591, 579, 11321, 14231, 53701, 71947, 56793}}, {15118, 18, 28801, {1, 1, 5, 1, 7, 31, 39, 205, 231, 843, 159, 2301, 7765, 3317, 8935, 60647, 110545, 142543}}, {15119, 18, 28822, {1, 3, 3, 11, 25, 39, 9, 131, 145, 373, 41, 1687, 417, 9427, 8657, 18315, 18505, 144055}}, {15120, 18, 28855, {1, 3, 7, 3, 1, 51, 61, 223, 409, 607, 1281, 1767, 4719, 10741, 21537, 17307, 5473, 76127}}, {15121, 18, 28859, {1, 1, 1, 1, 1, 43, 35, 157, 183, 835, 1141, 3235, 1383, 11381, 4503, 20435, 73125, 196955}}, {15122, 18, 28869, {1, 1, 5, 7, 13, 47, 9, 191, 349, 587, 1887, 3667, 619, 9443, 28781, 7759, 6023, 81595}}, {15123, 18, 28893, {1, 3, 5, 9, 31, 27, 77, 47, 375, 229, 989, 1241, 4937, 5881, 18797, 21743, 49947, 246165}}, {15124, 18, 28904, {1, 1, 5, 1, 29, 23, 43, 237, 293, 391, 243, 3471, 5205, 9951, 29329, 19873, 114325, 19239}}, {15125, 18, 28922, {1, 3, 3, 5, 19, 49, 23, 149, 419, 23, 21, 515, 3321, 3157, 28559, 8521, 11119, 192881}}, {15126, 18, 28930, {1, 3, 1, 9, 29, 17, 15, 13, 171, 57, 1849, 3815, 7361, 7723, 23657, 60883, 54953, 159861}}, {15127, 18, 28949, {1, 1, 3, 5, 13, 57, 35, 227, 143, 725, 2023, 2583, 2277, 4721, 4395, 61479, 112487, 211861}}, {15128, 18, 28972, {1, 1, 5, 7, 7, 25, 83, 95, 281, 931, 415, 1661, 1543, 5313, 13317, 21203, 23965, 60891}}, {15129, 18, 29002, {1, 3, 3, 1, 25, 51, 65, 147, 7, 521, 235, 2165, 6219, 14247, 30621, 43245, 8133, 49481}}, {15130, 18, 29009, {1, 1, 5, 11, 13, 27, 39, 51, 213, 811, 151, 1157, 7821, 6481, 32097, 12319, 52005, 33291}}, {15131, 18, 29061, {1, 1, 1, 13, 19, 15, 39, 205, 481, 253, 1643, 2969, 3181, 13995, 29877, 1307, 101721, 119111}}, {15132, 18, 29068, {1, 1, 1, 11, 5, 63, 57, 53, 187, 315, 1521, 847, 5955, 3179, 21459, 25937, 83215, 181599}}, {15133, 18, 29107, {1, 1, 7, 13, 17, 35, 113, 73, 105, 497, 1183, 3397, 4443, 14697, 29201, 40737, 40943, 3529}}, {15134, 18, 29119, {1, 3, 5, 5, 3, 53, 101, 125, 173, 137, 333, 381, 1143, 1165, 789, 50013, 23595, 50235}}, {15135, 18, 29142, {1, 1, 3, 1, 23, 3, 21, 143, 475, 337, 1693, 2341, 6509, 4167, 21031, 13887, 83191, 85187}}, {15136, 18, 29146, {1, 1, 3, 1, 29, 59, 39, 217, 77, 943, 1531, 383, 6535, 2593, 8601, 61865, 26629, 57313}}, {15137, 18, 29152, {1, 3, 5, 15, 17, 15, 19, 31, 273, 507, 1193, 2501, 4677, 13355, 5287, 1155, 102959, 185219}}, {15138, 18, 29200, {1, 1, 1, 9, 3, 3, 5, 111, 159, 913, 331, 303, 3673, 12227, 5245, 63749, 107123, 26315}}, {15139, 18, 29206, {1, 3, 5, 11, 13, 13, 115, 237, 481, 793, 1783, 1107, 4811, 3965, 29571, 63237, 15013, 176925}}, {15140, 18, 29245, {1, 1, 7, 1, 13, 57, 85, 15, 19, 889, 1637, 1721, 6299, 6659, 5541, 24365, 38363, 67749}}, {15141, 18, 29254, {1, 1, 3, 1, 9, 39, 15, 183, 133, 821, 1361, 2617, 7197, 8251, 12599, 60549, 42947, 72519}}, {15142, 18, 29258, {1, 3, 1, 5, 19, 17, 69, 189, 309, 33, 2003, 569, 6189, 7845, 22351, 14623, 35287, 160511}}, {15143, 18, 29260, {1, 1, 7, 13, 25, 3, 1, 203, 163, 661, 513, 3513, 741, 16259, 29817, 6059, 23823, 51869}}, {15144, 18, 29268, {1, 3, 3, 1, 9, 43, 59, 77, 465, 223, 2007, 2187, 1499, 9373, 10535, 22207, 111689, 108485}}, {15145, 18, 29281, {1, 1, 5, 15, 1, 21, 87, 163, 177, 751, 115, 3981, 4257, 5345, 31211, 44075, 16983, 69783}}, {15146, 18, 29306, {1, 1, 1, 3, 29, 31, 7, 41, 181, 979, 1661, 1403, 2577, 983, 545, 6205, 20183, 44735}}, {15147, 18, 29317, {1, 3, 3, 15, 5, 1, 85, 243, 59, 161, 1053, 803, 1813, 13583, 2559, 62761, 105337, 83209}}, {15148, 18, 29324, {1, 3, 3, 3, 5, 21, 101, 61, 379, 369, 1865, 3289, 2643, 951, 26493, 17915, 8185, 42387}}, {15149, 18, 29342, {1, 3, 5, 15, 15, 13, 119, 103, 141, 735, 1317, 3345, 2885, 4145, 30719, 965, 10819, 90295}}, {15150, 18, 29375, {1, 3, 7, 13, 15, 11, 19, 163, 495, 369, 1285, 609, 1559, 9965, 31123, 55101, 76743, 104435}}, {15151, 18, 29384, {1, 1, 5, 1, 25, 5, 5, 139, 441, 447, 353, 1369, 959, 14593, 30991, 20651, 126945, 2219}}, {15152, 18, 29389, {1, 3, 5, 9, 21, 9, 113, 83, 115, 15, 161, 1559, 3095, 1447, 10253, 51481, 114541, 248375}}, {15153, 18, 29411, {1, 3, 3, 1, 31, 61, 111, 69, 495, 195, 1153, 2605, 5061, 15509, 8253, 41909, 126033, 51173}}, {15154, 18, 29413, {1, 1, 7, 15, 15, 41, 121, 75, 471, 539, 341, 441, 5357, 11509, 32525, 65477, 101251, 164835}}, {15155, 18, 29446, {1, 1, 5, 7, 3, 63, 13, 123, 285, 499, 1023, 3533, 483, 13747, 26515, 52381, 9073, 256319}}, {15156, 18, 29457, {1, 3, 1, 13, 29, 41, 75, 43, 229, 557, 1775, 1933, 5567, 11439, 22045, 10571, 96761, 98559}}, {15157, 18, 29458, {1, 1, 3, 11, 19, 39, 3, 93, 435, 433, 2005, 1561, 385, 15865, 19763, 44105, 48107, 163063}}, {15158, 18, 29483, {1, 1, 7, 5, 29, 37, 53, 19, 335, 325, 133, 2055, 3029, 14573, 30395, 38599, 97637, 203443}}, {15159, 18, 29488, {1, 1, 7, 15, 29, 51, 7, 145, 21, 955, 1013, 579, 4971, 4849, 11691, 23725, 71079, 102641}}, {15160, 18, 29494, {1, 1, 7, 3, 9, 49, 79, 187, 237, 823, 1951, 2947, 3633, 9119, 14393, 52969, 44703, 222389}}, {15161, 18, 29506, {1, 3, 5, 11, 13, 9, 13, 245, 499, 661, 1899, 1313, 6907, 12259, 4577, 38547, 79687, 17555}}, {15162, 18, 29553, {1, 3, 3, 1, 5, 59, 123, 197, 293, 247, 687, 695, 7493, 3115, 28535, 44335, 31905, 81607}}, {15163, 18, 29569, {1, 3, 1, 3, 19, 5, 45, 101, 457, 395, 565, 3155, 8081, 4863, 1199, 32133, 73087, 27025}}, {15164, 18, 29587, {1, 3, 7, 1, 31, 35, 111, 95, 379, 663, 731, 1813, 4551, 13105, 18275, 19729, 121971, 139959}}, {15165, 18, 29590, {1, 1, 7, 3, 23, 47, 11, 117, 323, 943, 183, 2169, 4625, 12931, 1305, 23345, 119521, 67911}}, {15166, 18, 29600, {1, 1, 1, 13, 19, 45, 37, 77, 301, 741, 747, 241, 5865, 11141, 7961, 10609, 97833, 256555}}, {15167, 18, 29612, {1, 1, 1, 11, 27, 21, 119, 103, 277, 761, 201, 2063, 1043, 13303, 6535, 15553, 57695, 124187}}, {15168, 18, 29665, {1, 3, 7, 3, 1, 11, 79, 143, 345, 237, 1421, 193, 1889, 2515, 11729, 559, 35227, 9393}}, {15169, 18, 29722, {1, 3, 1, 1, 27, 27, 117, 159, 183, 871, 47, 989, 999, 303, 30833, 8229, 116301, 199439}}, {15170, 18, 29745, {1, 1, 1, 1, 31, 27, 41, 83, 435, 409, 999, 2275, 4489, 1985, 21455, 23275, 125039, 192979}}, {15171, 18, 29746, {1, 3, 7, 3, 19, 49, 27, 185, 9, 385, 191, 735, 3439, 16307, 21181, 58749, 128393, 140383}}, {15172, 18, 29752, {1, 3, 7, 3, 15, 5, 65, 89, 11, 915, 673, 947, 3847, 6833, 10095, 34261, 101645, 42131}}, {15173, 18, 29775, {1, 3, 5, 11, 11, 25, 79, 225, 495, 951, 1033, 5, 699, 9621, 1791, 48221, 59275, 49875}}, {15174, 18, 29778, {1, 3, 7, 13, 29, 59, 105, 101, 233, 901, 863, 413, 2087, 16209, 445, 27463, 61465, 121795}}, {15175, 18, 29800, {1, 1, 1, 11, 5, 19, 11, 51, 503, 313, 195, 3, 7249, 4919, 11931, 15569, 118297, 115989}}, {15176, 18, 29829, {1, 3, 3, 13, 13, 61, 63, 57, 429, 487, 2033, 847, 7539, 1469, 3197, 1307, 124557, 211999}}, {15177, 18, 29830, {1, 3, 7, 13, 25, 27, 39, 103, 165, 39, 1587, 3103, 1745, 12593, 10779, 37105, 29059, 256739}}, {15178, 18, 29877, {1, 3, 3, 9, 25, 51, 105, 109, 99, 267, 623, 1351, 3837, 793, 28609, 52199, 15621, 77873}}, {15179, 18, 29881, {1, 1, 3, 7, 29, 61, 45, 237, 431, 791, 91, 1259, 8071, 11103, 27257, 10153, 18639, 248949}}, {15180, 18, 29884, {1, 1, 1, 9, 15, 47, 113, 189, 291, 837, 1317, 2263, 7183, 6669, 17241, 35275, 9087, 241577}}, {15181, 18, 29895, {1, 1, 3, 1, 15, 59, 85, 21, 69, 569, 1473, 2735, 713, 3817, 14677, 26897, 75291, 251255}}, {15182, 18, 29899, {1, 1, 1, 7, 17, 21, 105, 77, 367, 905, 513, 1807, 5571, 14627, 10349, 47821, 34395, 51143}}, {15183, 18, 29916, {1, 3, 7, 13, 27, 19, 123, 145, 371, 857, 1699, 2231, 373, 781, 28713, 21441, 64059, 10689}}, {15184, 18, 29923, {1, 1, 1, 7, 19, 57, 81, 223, 87, 315, 1253, 421, 1371, 1547, 1411, 6809, 23889, 213385}}, {15185, 18, 29935, {1, 3, 1, 5, 23, 57, 89, 15, 227, 965, 1247, 3861, 7723, 15621, 7151, 53961, 47167, 73679}}, {15186, 18, 29955, {1, 3, 7, 15, 31, 21, 9, 79, 87, 561, 1001, 3395, 2095, 15381, 30725, 48111, 68031, 121687}}, {15187, 18, 29962, {1, 3, 1, 9, 15, 29, 83, 87, 377, 331, 2035, 93, 2319, 3637, 4809, 40091, 93141, 39881}}, {15188, 18, 29969, {1, 3, 3, 11, 21, 39, 27, 159, 161, 439, 1417, 595, 4873, 15703, 32743, 56603, 35881, 160727}}, {15189, 18, 29997, {1, 1, 3, 5, 21, 37, 55, 159, 497, 425, 469, 1185, 5015, 7045, 7179, 65325, 97167, 75723}}, {15190, 18, 30032, {1, 3, 1, 7, 31, 21, 125, 223, 479, 765, 1115, 33, 2765, 12781, 22923, 36051, 103749, 33703}}, {15191, 18, 30041, {1, 1, 7, 1, 9, 3, 29, 125, 337, 973, 253, 3179, 3269, 8801, 19369, 20693, 17331, 190295}}, {15192, 18, 30048, {1, 1, 3, 3, 13, 5, 115, 31, 481, 45, 855, 81, 3663, 10443, 13853, 29847, 99471, 249943}}, {15193, 18, 30060, {1, 1, 3, 7, 3, 1, 47, 31, 169, 625, 201, 2257, 4617, 1633, 26681, 53793, 78257, 8955}}, {15194, 18, 30063, {1, 1, 5, 1, 23, 3, 95, 89, 429, 559, 119, 2619, 1235, 7609, 21905, 45495, 19461, 189091}}, {15195, 18, 30105, {1, 3, 5, 5, 11, 33, 123, 45, 89, 899, 1607, 3717, 6745, 15199, 22955, 15891, 50411, 148201}}, {15196, 18, 30122, {1, 3, 5, 9, 19, 23, 87, 21, 39, 117, 603, 823, 3015, 14853, 4341, 49029, 97183, 218713}}, {15197, 18, 30141, {1, 1, 3, 7, 11, 55, 31, 255, 399, 861, 745, 1013, 4583, 15871, 32453, 25357, 90645, 100835}}, {15198, 18, 30142, {1, 1, 1, 11, 13, 27, 57, 233, 45, 339, 305, 3689, 5273, 11801, 29109, 44139, 83171, 250559}}, {15199, 18, 30153, {1, 3, 7, 13, 19, 1, 29, 113, 207, 313, 1465, 3563, 2535, 3307, 14921, 1923, 31429, 59815}}, {15200, 18, 30171, {1, 3, 1, 5, 29, 25, 59, 95, 177, 795, 353, 3973, 8029, 1687, 5045, 16157, 30361, 218479}}, {15201, 18, 30192, {1, 3, 5, 3, 5, 27, 109, 239, 121, 347, 93, 1645, 3293, 13181, 23793, 42935, 98659, 85385}}, {15202, 18, 30197, {1, 1, 7, 9, 9, 37, 127, 211, 77, 557, 177, 2465, 7895, 5523, 26665, 23463, 71715, 126673}}, {15203, 18, 30223, {1, 3, 7, 1, 27, 55, 125, 85, 47, 739, 1513, 3763, 5335, 3135, 11913, 22405, 90785, 88845}}, {15204, 18, 30235, {1, 3, 3, 9, 29, 21, 123, 211, 491, 83, 697, 929, 3507, 7139, 30569, 16365, 122657, 77523}}, {15205, 18, 30241, {1, 3, 5, 5, 27, 21, 41, 129, 67, 503, 877, 1893, 6055, 12709, 24613, 43831, 124035, 62631}}, {15206, 18, 30256, {1, 3, 3, 1, 21, 15, 59, 185, 405, 487, 627, 3737, 345, 14751, 2947, 15815, 55047, 207137}}, {15207, 18, 30291, {1, 1, 1, 9, 15, 29, 19, 155, 101, 405, 597, 329, 2977, 4333, 5465, 43863, 6009, 229481}}, {15208, 18, 30293, {1, 1, 1, 11, 7, 27, 93, 207, 43, 599, 1899, 3979, 4219, 10199, 2901, 34261, 19435, 58317}}, {15209, 18, 30300, {1, 1, 7, 15, 9, 47, 33, 209, 235, 655, 253, 3507, 3355, 1685, 7045, 58907, 41791, 175835}}, {15210, 18, 30331, {1, 3, 3, 11, 11, 43, 21, 255, 45, 831, 1051, 1271, 7945, 9793, 11125, 17709, 118267, 169981}}, {15211, 18, 30349, {1, 3, 7, 13, 27, 37, 45, 221, 243, 37, 1493, 2773, 6655, 7451, 22609, 56559, 12063, 221143}}, {15212, 18, 30361, {1, 3, 1, 1, 9, 15, 97, 61, 241, 825, 735, 3953, 5331, 16373, 19403, 28933, 31881, 111545}}, {15213, 18, 30367, {1, 1, 1, 15, 29, 1, 127, 111, 329, 741, 1589, 1653, 5949, 8703, 27617, 65285, 122167, 11895}}, {15214, 18, 30392, {1, 1, 3, 3, 17, 31, 91, 197, 421, 865, 1901, 897, 6917, 15943, 12823, 15325, 17011, 110783}}, {15215, 18, 30405, {1, 1, 3, 15, 21, 57, 29, 179, 503, 929, 1513, 205, 6083, 4015, 32517, 26921, 54229, 147789}}, {15216, 18, 30410, {1, 1, 7, 15, 27, 21, 95, 59, 193, 97, 1235, 819, 4435, 371, 627, 24673, 1775, 261041}}, {15217, 18, 30415, {1, 1, 7, 15, 3, 37, 99, 85, 505, 1011, 19, 1241, 5299, 15661, 27323, 44625, 12683, 225687}}, {15218, 18, 30439, {1, 1, 7, 3, 25, 37, 111, 121, 217, 659, 365, 2627, 5499, 12911, 951, 54317, 51927, 235327}}, {15219, 18, 30446, {1, 1, 3, 9, 29, 31, 99, 195, 427, 735, 1817, 3675, 4269, 1579, 12593, 39285, 74909, 230613}}, {15220, 18, 30501, {1, 3, 1, 13, 7, 21, 37, 101, 111, 931, 1581, 465, 4753, 15607, 14515, 29769, 107711, 32703}}, {15221, 18, 30526, {1, 1, 7, 15, 25, 57, 117, 119, 309, 345, 491, 3647, 2933, 5409, 15431, 43731, 25537, 17269}}, {15222, 18, 30531, {1, 1, 5, 3, 15, 9, 83, 221, 501, 675, 1441, 129, 213, 5587, 22361, 16739, 118845, 192835}}, {15223, 18, 30537, {1, 3, 7, 13, 1, 31, 75, 23, 13, 447, 687, 2711, 7577, 8275, 5051, 61835, 22159, 56477}}, {15224, 18, 30546, {1, 1, 3, 1, 23, 19, 111, 45, 395, 841, 1665, 21, 7435, 12457, 11065, 20007, 48785, 15115}}, {15225, 18, 30568, {1, 3, 7, 7, 21, 3, 117, 35, 117, 433, 561, 3045, 2169, 3255, 18015, 41093, 99699, 3479}}, {15226, 18, 30581, {1, 1, 3, 7, 9, 59, 65, 143, 315, 63, 29, 3817, 1259, 7119, 20847, 44407, 80015, 37851}}, {15227, 18, 30588, {1, 3, 7, 13, 13, 33, 85, 75, 39, 163, 1759, 1197, 5971, 8815, 8745, 45625, 121873, 246197}}, {15228, 18, 30598, {1, 1, 1, 13, 31, 41, 61, 7, 145, 113, 943, 3757, 2141, 3523, 22351, 14143, 107683, 105579}}, {15229, 18, 30607, {1, 1, 5, 5, 23, 27, 75, 77, 25, 901, 1295, 3091, 981, 10109, 12649, 15123, 102433, 145557}}, {15230, 18, 30609, {1, 1, 7, 5, 9, 11, 19, 229, 301, 835, 1577, 3365, 425, 2271, 15647, 11685, 57315, 131043}}, {15231, 18, 30616, {1, 3, 1, 13, 31, 3, 113, 7, 473, 395, 1979, 61, 4205, 2031, 28007, 34789, 54463, 94741}}, {15232, 18, 30626, {1, 1, 3, 5, 7, 13, 35, 151, 461, 621, 185, 2645, 907, 9151, 25953, 26363, 105531, 235555}}, {15233, 18, 30628, {1, 3, 3, 13, 21, 5, 43, 183, 149, 607, 509, 777, 4089, 16365, 32201, 60431, 58773, 92719}}, {15234, 18, 30638, {1, 3, 3, 11, 25, 53, 103, 203, 269, 1017, 77, 3537, 4839, 15991, 29223, 57397, 122735, 67299}}, {15235, 18, 30658, {1, 3, 3, 1, 29, 45, 85, 171, 307, 455, 1399, 2367, 5991, 5751, 27957, 36649, 9251, 38581}}, {15236, 18, 30663, {1, 1, 5, 13, 29, 15, 127, 1, 175, 921, 671, 2469, 3137, 3679, 32521, 5321, 92505, 45901}}, {15237, 18, 30675, {1, 3, 3, 11, 23, 23, 113, 255, 443, 609, 1085, 133, 5369, 885, 17043, 20961, 36137, 260457}}, {15238, 18, 30698, {1, 3, 3, 9, 13, 55, 117, 19, 111, 323, 275, 495, 6679, 2217, 12015, 3053, 32745, 189413}}, {15239, 18, 30708, {1, 3, 5, 13, 31, 43, 37, 225, 67, 755, 1427, 3967, 6497, 9987, 28145, 50583, 59457, 213217}}, {15240, 18, 30712, {1, 3, 1, 15, 1, 5, 121, 249, 293, 695, 1697, 313, 61, 4037, 11757, 53739, 5693, 106225}}, {15241, 18, 30727, {1, 1, 7, 1, 23, 9, 111, 211, 303, 147, 1291, 3807, 1969, 4115, 7473, 50077, 60745, 41605}}, {15242, 18, 30736, {1, 3, 3, 15, 21, 51, 63, 171, 197, 403, 1327, 1851, 6991, 9069, 19221, 45765, 55489, 34853}}, {15243, 18, 30748, {1, 1, 5, 3, 5, 53, 87, 241, 255, 309, 1319, 3727, 3189, 10887, 13401, 32371, 24479, 170571}}, {15244, 18, 30758, {1, 1, 7, 11, 5, 5, 59, 177, 317, 835, 527, 165, 2137, 9597, 30181, 1779, 75407, 185827}}, {15245, 18, 30775, {1, 3, 3, 7, 25, 15, 15, 183, 235, 955, 27, 2223, 5587, 11301, 17653, 56697, 70787, 198347}}, {15246, 18, 30793, {1, 3, 5, 5, 11, 63, 123, 41, 169, 975, 1709, 2965, 7491, 4183, 15217, 41343, 36139, 9649}}, {15247, 18, 30802, {1, 1, 3, 7, 5, 37, 87, 247, 379, 603, 781, 463, 8063, 13681, 32005, 43485, 107401, 42303}}, {15248, 18, 30820, {1, 3, 5, 9, 19, 53, 61, 219, 217, 361, 769, 1687, 5643, 3145, 12885, 40303, 86377, 255051}}, {15249, 18, 30823, {1, 1, 7, 11, 15, 49, 127, 99, 127, 515, 647, 1725, 1605, 2357, 2069, 31803, 14179, 180367}}, {15250, 18, 30827, {1, 3, 5, 15, 9, 7, 41, 3, 49, 485, 1471, 207, 6477, 4463, 12255, 53481, 110785, 909}}, {15251, 18, 30848, {1, 1, 5, 9, 23, 51, 107, 227, 205, 987, 1525, 2739, 6761, 12343, 32311, 12523, 93351, 29663}}, {15252, 18, 30893, {1, 3, 5, 11, 21, 19, 53, 169, 197, 21, 825, 4029, 6733, 8943, 13475, 60677, 31001, 242291}}, {15253, 18, 30906, {1, 3, 7, 13, 9, 27, 87, 37, 265, 877, 735, 2249, 4801, 2365, 16923, 40451, 29693, 222483}}, {15254, 18, 30950, {1, 1, 3, 9, 31, 61, 71, 103, 215, 421, 193, 3451, 6181, 4271, 30875, 59573, 80773, 100369}}, {15255, 18, 30956, {1, 1, 3, 13, 17, 55, 73, 191, 233, 821, 961, 1637, 2393, 3453, 25959, 5069, 114585, 186001}}, {15256, 18, 30996, {1, 1, 7, 5, 15, 27, 39, 23, 69, 811, 709, 2349, 6011, 803, 12497, 7387, 62023, 247875}}, {15257, 18, 31015, {1, 1, 5, 13, 29, 55, 51, 41, 121, 599, 1633, 3813, 1913, 3803, 26097, 53799, 30997, 261965}}, {15258, 18, 31016, {1, 1, 1, 11, 31, 25, 19, 195, 87, 657, 1005, 3853, 61, 6585, 24665, 38283, 5495, 257201}}, {15259, 18, 31034, {1, 1, 1, 11, 23, 43, 91, 121, 49, 491, 1443, 1873, 7689, 15957, 30463, 64079, 100003, 325}}, {15260, 18, 31099, {1, 1, 7, 1, 25, 51, 27, 105, 119, 233, 513, 3403, 2647, 2847, 12687, 15619, 71225, 243759}}, {15261, 18, 31123, {1, 1, 7, 3, 17, 49, 19, 123, 307, 463, 1619, 1853, 7019, 2605, 17351, 7971, 20675, 235929}}, {15262, 18, 31145, {1, 1, 5, 3, 17, 29, 71, 215, 365, 955, 1631, 3549, 1379, 13881, 25409, 55703, 29863, 135401}}, {15263, 18, 31166, {1, 3, 7, 15, 3, 27, 107, 149, 65, 681, 505, 3957, 6697, 11203, 9321, 63323, 98587, 199241}}, {15264, 18, 31168, {1, 1, 1, 13, 27, 41, 59, 223, 431, 339, 1805, 899, 639, 6559, 13233, 4773, 37415, 110477}}, {15265, 18, 31174, {1, 3, 7, 9, 1, 59, 79, 161, 311, 905, 1755, 3915, 6259, 8955, 14187, 11331, 86185, 209805}}, {15266, 18, 31216, {1, 1, 7, 9, 5, 27, 75, 93, 285, 89, 891, 3341, 1157, 11219, 8883, 8093, 68949, 189643}}, {15267, 18, 31219, {1, 3, 1, 5, 1, 43, 97, 71, 67, 605, 739, 1641, 4415, 4487, 13437, 12755, 121595, 55761}}, {15268, 18, 31238, {1, 1, 1, 3, 1, 13, 61, 77, 297, 507, 1527, 3585, 4515, 13913, 7679, 28461, 61807, 196517}}, {15269, 18, 31256, {1, 1, 1, 3, 21, 23, 101, 135, 59, 485, 1601, 3713, 7409, 349, 16543, 18897, 97253, 149055}}, {15270, 18, 31304, {1, 1, 1, 13, 5, 37, 15, 37, 109, 1005, 363, 1925, 2701, 13169, 17027, 58453, 27667, 234027}}, {15271, 18, 31315, {1, 1, 7, 1, 1, 41, 67, 231, 143, 951, 2023, 3465, 1717, 645, 17353, 9037, 129127, 199467}}, {15272, 18, 31324, {1, 1, 1, 11, 27, 29, 65, 139, 425, 947, 141, 2601, 7339, 4451, 25065, 62691, 62355, 91819}}, {15273, 18, 31364, {1, 3, 7, 15, 29, 29, 93, 25, 139, 267, 1319, 3839, 7295, 11855, 17775, 30199, 44127, 150875}}, {15274, 18, 31379, {1, 3, 5, 1, 3, 55, 23, 191, 199, 583, 1167, 1357, 6477, 11827, 15581, 56541, 16603, 120139}}, {15275, 18, 31382, {1, 1, 1, 3, 5, 47, 103, 211, 443, 491, 1043, 4001, 121, 1637, 5685, 42675, 13009, 22979}}, {15276, 18, 31412, {1, 1, 1, 9, 21, 7, 77, 17, 303, 955, 51, 2389, 3573, 8817, 28053, 40269, 35457, 211023}}, {15277, 18, 31451, {1, 3, 5, 15, 3, 39, 17, 75, 223, 37, 1231, 2127, 3575, 9085, 10715, 41871, 103703, 154181}}, {15278, 18, 31487, {1, 3, 3, 15, 25, 31, 31, 223, 473, 267, 1519, 3205, 7029, 10753, 24757, 28187, 117921, 26783}}, {15279, 18, 31509, {1, 3, 7, 1, 5, 21, 105, 191, 55, 115, 1813, 3701, 1673, 4199, 2441, 19737, 46913, 208725}}, {15280, 18, 31510, {1, 1, 5, 5, 19, 63, 89, 141, 143, 783, 545, 883, 2979, 9219, 24983, 41793, 88441, 207095}}, {15281, 18, 31520, {1, 1, 1, 9, 21, 21, 93, 161, 93, 733, 417, 3133, 8155, 12415, 16343, 11727, 82877, 94469}}, {15282, 18, 31535, {1, 1, 5, 15, 5, 39, 33, 203, 213, 731, 1849, 1675, 6029, 2743, 1529, 16345, 13955, 54929}}, {15283, 18, 31564, {1, 1, 7, 7, 23, 47, 121, 211, 271, 737, 1015, 1021, 5641, 12659, 27545, 52363, 104761, 150143}}, {15284, 18, 31585, {1, 3, 1, 11, 11, 51, 79, 141, 255, 1007, 481, 3221, 7741, 6861, 24943, 63091, 46741, 33359}}, {15285, 18, 31586, {1, 1, 3, 3, 27, 47, 85, 27, 423, 811, 75, 3911, 1951, 10821, 7487, 18971, 83355, 197479}}, {15286, 18, 31600, {1, 1, 5, 5, 1, 63, 125, 251, 457, 795, 557, 217, 2335, 5659, 18375, 52183, 9789, 31417}}, {15287, 18, 31643, {1, 3, 3, 3, 19, 61, 41, 129, 345, 361, 187, 3881, 43, 7197, 7673, 25011, 115155, 16375}}, {15288, 18, 31646, {1, 3, 3, 7, 13, 7, 55, 91, 153, 341, 2003, 2013, 6891, 2411, 14825, 39555, 50267, 61405}}, {15289, 18, 31649, {1, 3, 5, 7, 13, 57, 21, 91, 331, 615, 1297, 2881, 2011, 1907, 16489, 43061, 75731, 76675}}, {15290, 18, 31650, {1, 1, 5, 5, 25, 15, 77, 175, 101, 885, 835, 529, 2787, 547, 20191, 50457, 58557, 61807}}, {15291, 18, 31674, {1, 3, 7, 1, 13, 47, 101, 117, 179, 245, 861, 611, 4377, 5257, 12807, 26667, 19889, 112485}}, {15292, 18, 31679, {1, 3, 7, 1, 27, 3, 23, 109, 197, 187, 963, 1827, 5741, 11921, 6359, 3989, 108939, 5761}}, {15293, 18, 31684, {1, 1, 7, 5, 27, 7, 119, 159, 53, 969, 557, 597, 7821, 7121, 17341, 11233, 10811, 23969}}, {15294, 18, 31688, {1, 1, 3, 13, 23, 55, 75, 131, 339, 917, 317, 2645, 5973, 9939, 26375, 29261, 80883, 229897}}, {15295, 18, 31706, {1, 1, 5, 13, 3, 63, 41, 191, 315, 191, 649, 2119, 317, 14699, 4097, 19557, 97015, 124557}}, {15296, 18, 31735, {1, 3, 7, 15, 13, 29, 29, 43, 47, 37, 729, 185, 4477, 15091, 13991, 18701, 56785, 218823}}, {15297, 18, 31754, {1, 3, 7, 15, 31, 39, 17, 133, 469, 509, 995, 1683, 391, 1775, 15431, 63489, 7405, 122125}}, {15298, 18, 31761, {1, 3, 7, 5, 15, 63, 5, 235, 193, 411, 1493, 3967, 3279, 6421, 13359, 20949, 68097, 69469}}, {15299, 18, 31774, {1, 3, 3, 13, 7, 37, 7, 207, 399, 553, 1629, 1903, 329, 7577, 5813, 17151, 40889, 174811}}, {15300, 18, 31807, {1, 3, 1, 13, 7, 39, 119, 109, 323, 61, 749, 1377, 911, 8195, 19753, 6265, 60783, 182339}}, {15301, 18, 31812, {1, 1, 5, 11, 3, 21, 89, 61, 243, 273, 1317, 3443, 117, 6205, 13907, 12903, 95485, 103355}}, {15302, 18, 31821, {1, 3, 7, 13, 19, 27, 45, 251, 405, 289, 121, 1501, 2599, 8111, 5163, 17437, 75095, 165847}}, {15303, 18, 31855, {1, 3, 3, 5, 23, 13, 29, 145, 333, 573, 1939, 2133, 5797, 5263, 18835, 11945, 42161, 103123}}, {15304, 18, 31919, {1, 3, 5, 13, 9, 31, 45, 17, 181, 111, 219, 3451, 1591, 5823, 20307, 41207, 77047, 173401}}, {15305, 18, 31934, {1, 3, 1, 9, 19, 63, 73, 111, 377, 875, 1749, 2887, 7035, 14209, 1805, 20527, 93839, 225185}}, {15306, 18, 31956, {1, 3, 1, 9, 15, 45, 97, 235, 11, 803, 899, 427, 3353, 7363, 26687, 1307, 5451, 176233}}, {15307, 18, 31965, {1, 3, 7, 5, 7, 51, 59, 53, 3, 263, 159, 1005, 6079, 7237, 17419, 56653, 61091, 182209}}, {15308, 18, 31975, {1, 1, 3, 15, 19, 47, 17, 185, 167, 219, 233, 2921, 5755, 1277, 27281, 33671, 3191, 169477}}, {15309, 18, 31981, {1, 3, 7, 1, 25, 27, 99, 81, 57, 969, 821, 2397, 2947, 5913, 15247, 47651, 449, 183295}}, {15310, 18, 31999, {1, 3, 1, 15, 3, 63, 83, 75, 41, 959, 1005, 153, 97, 15381, 6901, 55141, 90215, 161321}}, {15311, 18, 32014, {1, 3, 1, 9, 1, 1, 29, 191, 43, 241, 607, 667, 1189, 4389, 31335, 14133, 104049, 100925}}, {15312, 18, 32022, {1, 1, 3, 1, 1, 61, 109, 23, 325, 27, 1601, 3957, 7181, 8375, 9823, 50533, 114895, 73825}}, {15313, 18, 32049, {1, 1, 7, 7, 1, 25, 51, 19, 383, 955, 1717, 2953, 5431, 7883, 14451, 18619, 9601, 153151}}, {15314, 18, 32055, {1, 3, 1, 5, 1, 1, 35, 3, 141, 37, 1531, 1855, 7905, 6509, 6223, 45911, 54267, 172275}}, {15315, 18, 32082, {1, 1, 3, 15, 23, 39, 109, 145, 215, 147, 1191, 2425, 301, 5543, 997, 31071, 101697, 169677}}, {15316, 18, 32087, {1, 1, 3, 5, 17, 23, 41, 191, 367, 967, 1625, 3669, 769, 7599, 111, 4399, 64121, 232275}}, {15317, 18, 32100, {1, 3, 5, 1, 25, 61, 47, 247, 413, 605, 399, 1233, 2789, 9775, 7111, 42853, 2305, 87423}}, {15318, 18, 32104, {1, 3, 7, 3, 1, 25, 73, 247, 221, 235, 169, 889, 5635, 4325, 27015, 39549, 107545, 80885}}, {15319, 18, 32109, {1, 1, 7, 11, 15, 55, 61, 103, 179, 157, 481, 3089, 4539, 375, 25425, 14995, 60119, 31031}}, {15320, 18, 32138, {1, 3, 3, 1, 31, 17, 87, 123, 27, 309, 1693, 3871, 7319, 15615, 20113, 18239, 86407, 172381}}, {15321, 18, 32140, {1, 1, 1, 13, 17, 31, 83, 149, 451, 305, 847, 223, 5705, 9697, 4967, 34273, 4041, 252891}}, {15322, 18, 32148, {1, 3, 3, 15, 7, 27, 105, 207, 443, 825, 701, 1159, 5267, 14085, 28295, 41757, 47799, 14835}}, {15323, 18, 32161, {1, 3, 7, 3, 1, 31, 77, 219, 139, 497, 1575, 905, 4341, 4611, 27861, 59871, 45525, 21735}}, {15324, 18, 32162, {1, 3, 3, 3, 7, 17, 65, 183, 231, 955, 1111, 1899, 1677, 13685, 29395, 10449, 62505, 125643}}, {15325, 18, 32174, {1, 3, 5, 7, 27, 57, 81, 165, 279, 989, 1569, 573, 7593, 10067, 1343, 12039, 117175, 225125}}, {15326, 18, 32196, {1, 3, 3, 15, 19, 37, 47, 175, 87, 153, 1137, 1985, 2473, 14767, 19587, 41751, 98937, 66667}}, {15327, 18, 32220, {1, 3, 5, 3, 19, 51, 25, 155, 37, 597, 719, 1039, 165, 1871, 15677, 59891, 29899, 231979}}, {15328, 18, 32223, {1, 3, 5, 13, 15, 39, 17, 21, 73, 695, 1813, 2463, 3549, 3081, 14037, 13077, 40417, 258995}}, {15329, 18, 32267, {1, 1, 5, 9, 29, 5, 105, 75, 97, 937, 1767, 975, 637, 9419, 30673, 33537, 979, 45381}}, {15330, 18, 32272, {1, 1, 5, 9, 3, 31, 91, 193, 171, 163, 925, 3519, 3621, 4943, 14093, 22881, 18459, 110155}}, {15331, 18, 32308, {1, 1, 3, 7, 29, 1, 39, 107, 359, 805, 91, 2911, 4741, 3099, 16967, 45849, 95255, 63225}}, {15332, 18, 32315, {1, 1, 5, 13, 25, 41, 49, 145, 345, 823, 1571, 341, 6323, 9679, 14855, 19965, 108367, 99833}}, {15333, 18, 32317, {1, 3, 5, 3, 27, 35, 87, 83, 373, 425, 281, 1313, 5153, 6301, 2745, 12677, 34603, 181835}}, {15334, 18, 32347, {1, 1, 7, 7, 13, 17, 83, 101, 141, 789, 1403, 2777, 2749, 1551, 9009, 9909, 48443, 176679}}, {15335, 18, 32360, {1, 3, 5, 9, 7, 25, 125, 109, 155, 357, 1111, 3057, 771, 11253, 25811, 60333, 68505, 146987}}, {15336, 18, 32394, {1, 3, 7, 7, 29, 19, 69, 115, 411, 793, 51, 715, 3035, 11577, 14237, 23963, 13915, 196771}}, {15337, 18, 32411, {1, 1, 3, 3, 27, 37, 61, 163, 131, 749, 37, 1333, 47, 2519, 25473, 40851, 55861, 113961}}, {15338, 18, 32420, {1, 3, 5, 1, 3, 49, 19, 251, 125, 387, 1887, 3571, 1465, 4831, 3859, 43357, 20859, 225835}}, {15339, 18, 32423, {1, 3, 5, 9, 27, 53, 53, 143, 383, 781, 819, 2921, 3499, 11551, 18761, 14453, 58209, 181763}}, {15340, 18, 32455, {1, 3, 7, 9, 17, 17, 79, 61, 145, 413, 541, 895, 2077, 6957, 28681, 44821, 30609, 131705}}, {15341, 18, 32456, {1, 1, 3, 15, 1, 57, 17, 125, 11, 43, 1079, 1023, 5391, 67, 31701, 5737, 429, 75411}}, {15342, 18, 32510, {1, 1, 7, 7, 21, 45, 65, 127, 447, 793, 161, 333, 637, 7403, 12861, 30173, 125121, 254687}}, {15343, 18, 32517, {1, 1, 3, 9, 27, 53, 85, 223, 297, 455, 919, 2371, 7049, 7167, 18075, 22815, 10265, 14765}}, {15344, 18, 32541, {1, 1, 3, 7, 1, 53, 91, 181, 471, 101, 771, 4043, 3039, 1215, 19289, 15941, 55187, 147355}}, {15345, 18, 32552, {1, 3, 1, 1, 13, 19, 13, 47, 159, 965, 1383, 297, 4299, 7181, 1271, 17057, 114847, 180883}}, {15346, 18, 32555, {1, 3, 1, 15, 29, 55, 113, 243, 215, 665, 641, 1975, 5907, 2617, 17077, 43697, 61101, 70007}}, {15347, 18, 32580, {1, 3, 1, 11, 5, 55, 109, 145, 307, 663, 1327, 1247, 8033, 15425, 18539, 57027, 72161, 181655}}, {15348, 18, 32598, {1, 3, 5, 9, 25, 17, 3, 57, 7, 449, 1049, 3423, 5769, 12713, 29849, 1017, 92579, 131255}}, {15349, 18, 32654, {1, 1, 7, 13, 25, 13, 55, 217, 461, 595, 931, 1883, 2645, 9625, 20467, 45825, 72027, 163767}}, {15350, 18, 32662, {1, 3, 5, 15, 29, 49, 23, 47, 45, 645, 973, 3837, 621, 7373, 3585, 16083, 93823, 184593}}, {15351, 18, 32665, {1, 3, 7, 11, 27, 19, 59, 125, 447, 33, 541, 1067, 6983, 3779, 27275, 34269, 106937, 65085}}, {15352, 18, 32678, {1, 3, 1, 9, 23, 23, 51, 43, 475, 861, 1759, 2559, 3059, 1175, 31555, 27671, 117653, 162735}}, {15353, 18, 32682, {1, 1, 7, 13, 7, 61, 33, 49, 23, 737, 949, 1785, 2921, 873, 26631, 61941, 14467, 76225}}, {15354, 18, 32687, {1, 3, 7, 5, 31, 11, 49, 149, 7, 85, 1929, 1001, 4185, 221, 23719, 52265, 52973, 67967}}, {15355, 18, 32692, {1, 3, 1, 13, 17, 31, 35, 191, 65, 527, 51, 1093, 3673, 11167, 29985, 59739, 43567, 109817}}, {15356, 18, 32710, {1, 1, 1, 11, 23, 39, 95, 121, 501, 355, 1043, 993, 7533, 15763, 18399, 31601, 49373, 243209}}, {15357, 18, 32791, {1, 1, 3, 3, 15, 37, 57, 183, 27, 981, 153, 1481, 549, 7847, 2689, 57401, 46359, 175401}}, {15358, 18, 32792, {1, 3, 5, 9, 31, 19, 83, 79, 413, 597, 1957, 3027, 4751, 1437, 11255, 39513, 56927, 166841}}, {15359, 18, 32813, {1, 3, 7, 5, 27, 61, 69, 65, 143, 321, 1129, 2521, 4467, 4369, 11727, 35643, 80155, 184241}}, {15360, 18, 32826, {1, 3, 7, 1, 25, 27, 107, 219, 481, 457, 2027, 1057, 6409, 5641, 19711, 11009, 44295, 28171}}, {15361, 18, 32831, {1, 3, 3, 9, 3, 17, 85, 5, 341, 107, 2037, 93, 741, 5279, 20093, 28637, 80823, 210279}}, {15362, 18, 32836, {1, 1, 7, 15, 5, 9, 33, 167, 451, 463, 1951, 2395, 3821, 2915, 15195, 34517, 113545, 22173}}, {15363, 18, 32843, {1, 1, 3, 1, 23, 55, 113, 159, 139, 795, 69, 2021, 6769, 10807, 18605, 54161, 39501, 233797}}, {15364, 18, 32854, {1, 1, 7, 11, 17, 53, 103, 131, 385, 909, 629, 3127, 6117, 11457, 31115, 8255, 33227, 170877}}, {15365, 18, 32893, {1, 1, 3, 9, 23, 19, 99, 221, 141, 731, 311, 2617, 2763, 375, 26763, 56473, 6613, 60519}}, {15366, 18, 32897, {1, 3, 1, 9, 7, 29, 15, 105, 243, 159, 1755, 3999, 5861, 12009, 30111, 48269, 70427, 187173}}, {15367, 18, 32912, {1, 1, 3, 13, 1, 35, 39, 121, 409, 571, 1835, 1535, 4671, 12671, 4503, 4783, 48009, 216837}}, {15368, 18, 32951, {1, 1, 1, 9, 25, 61, 87, 109, 489, 107, 1741, 859, 237, 7161, 27117, 58587, 55445, 155763}}, {15369, 18, 32963, {1, 1, 7, 15, 9, 21, 61, 159, 301, 863, 1823, 11, 419, 6717, 28199, 24129, 58419, 22147}}, {15370, 18, 32970, {1, 3, 1, 5, 9, 7, 13, 205, 185, 759, 777, 2877, 5991, 14555, 18793, 51485, 6373, 232105}}, {15371, 18, 32975, {1, 1, 3, 5, 7, 25, 51, 79, 227, 447, 867, 2709, 2677, 15249, 22957, 45577, 39011, 16839}}, {15372, 18, 33028, {1, 1, 1, 3, 5, 51, 69, 135, 395, 339, 685, 3657, 3789, 16345, 2911, 51737, 97471, 126605}}, {15373, 18, 33052, {1, 3, 7, 15, 15, 5, 85, 153, 507, 347, 1457, 527, 1055, 7773, 4161, 10487, 92373, 256535}}, {15374, 18, 33061, {1, 3, 3, 3, 1, 9, 25, 1, 155, 321, 1739, 555, 7719, 10501, 19075, 12529, 75975, 229905}}, {15375, 18, 33083, {1, 1, 1, 3, 29, 31, 89, 23, 283, 875, 1653, 855, 7613, 15277, 23845, 47443, 287, 217441}}, {15376, 18, 33103, {1, 3, 3, 1, 25, 7, 75, 119, 493, 131, 231, 3063, 7171, 5437, 16385, 50347, 87427, 53603}}, {15377, 18, 33117, {1, 3, 7, 7, 27, 55, 103, 223, 219, 103, 733, 1233, 1931, 2119, 19333, 59839, 100421, 256811}}, {15378, 18, 33139, {1, 3, 7, 15, 23, 63, 77, 151, 285, 701, 1403, 1267, 6975, 11421, 24943, 51647, 75651, 191675}}, {15379, 18, 33151, {1, 1, 5, 7, 25, 23, 25, 7, 503, 759, 997, 1711, 1439, 12483, 30117, 55205, 8813, 221589}}, {15380, 18, 33162, {1, 3, 7, 5, 21, 3, 117, 65, 461, 851, 915, 575, 3061, 1055, 11999, 8375, 128677, 98005}}, {15381, 18, 33209, {1, 3, 7, 7, 19, 13, 123, 23, 41, 293, 79, 1435, 1175, 7399, 14907, 4671, 88029, 220627}}, {15382, 18, 33210, {1, 3, 3, 13, 11, 17, 65, 21, 143, 257, 1001, 2423, 5659, 11681, 23605, 40649, 49797, 55497}}, {15383, 18, 33223, {1, 3, 5, 5, 29, 15, 125, 83, 139, 381, 1435, 2129, 1699, 10725, 531, 767, 112477, 134223}}, {15384, 18, 33227, {1, 3, 7, 9, 9, 23, 35, 1, 127, 143, 707, 1475, 4705, 8921, 14919, 50909, 64425, 33381}}, {15385, 18, 33241, {1, 1, 1, 15, 11, 63, 87, 101, 243, 833, 707, 4095, 201, 4877, 10219, 39019, 129779, 229857}}, {15386, 18, 33263, {1, 1, 1, 11, 5, 9, 35, 177, 303, 545, 917, 1037, 1789, 12147, 29095, 27391, 112833, 104713}}, {15387, 18, 33341, {1, 1, 1, 5, 27, 23, 111, 219, 439, 445, 967, 3527, 6203, 1829, 19657, 48965, 85213, 58719}}, {15388, 18, 33344, {1, 3, 7, 11, 15, 7, 95, 113, 317, 225, 1229, 3033, 5777, 4075, 24093, 3539, 19333, 212757}}, {15389, 18, 33356, {1, 3, 7, 7, 1, 35, 35, 67, 459, 769, 1675, 3509, 7393, 10433, 12003, 7385, 4425, 188989}}, {15390, 18, 33390, {1, 1, 7, 9, 5, 45, 35, 27, 443, 301, 533, 2803, 99, 17, 20749, 58353, 93067, 118763}}, {15391, 18, 33398, {1, 1, 3, 3, 13, 51, 61, 181, 81, 859, 1461, 3455, 2277, 13769, 1251, 4313, 119973, 30693}}, {15392, 18, 33423, {1, 1, 3, 7, 15, 29, 23, 207, 239, 65, 1889, 151, 7793, 2657, 13673, 29033, 74477, 215027}}, {15393, 18, 33428, {1, 1, 5, 1, 19, 35, 19, 71, 187, 783, 543, 505, 347, 3191, 1087, 49735, 54109, 27979}}, {15394, 18, 33444, {1, 3, 3, 3, 3, 61, 67, 59, 207, 957, 1709, 1567, 7973, 5921, 29841, 8311, 81165, 91965}}, {15395, 18, 33454, {1, 1, 1, 7, 23, 47, 109, 189, 447, 861, 1615, 3283, 3059, 749, 28729, 8713, 38743, 211019}}, {15396, 18, 33479, {1, 3, 5, 1, 17, 51, 127, 181, 355, 515, 603, 465, 1825, 9281, 31971, 42793, 22467, 175777}}, {15397, 18, 33510, {1, 3, 1, 5, 3, 29, 111, 91, 99, 15, 535, 3047, 1083, 7181, 28003, 60719, 71825, 12293}}, {15398, 18, 33514, {1, 3, 5, 7, 1, 43, 83, 117, 221, 353, 139, 647, 6017, 4655, 31823, 22097, 118537, 71803}}, {15399, 18, 33528, {1, 1, 3, 3, 27, 11, 35, 169, 215, 883, 1195, 2983, 4651, 15893, 24051, 313, 103947, 5227}}, {15400, 18, 33548, {1, 3, 5, 13, 3, 51, 33, 159, 499, 763, 845, 1541, 3837, 9397, 855, 4187, 112167, 243817}}, {15401, 18, 33566, {1, 1, 7, 9, 1, 15, 19, 239, 227, 561, 1685, 2841, 53, 9753, 15105, 34277, 128859, 100085}}, {15402, 18, 33570, {1, 3, 5, 13, 15, 7, 57, 9, 415, 1005, 583, 1347, 4349, 3603, 9125, 15019, 77735, 237011}}, {15403, 18, 33593, {1, 1, 1, 13, 27, 21, 105, 17, 235, 605, 1417, 2053, 3233, 11617, 28651, 43161, 71663, 98373}}, {15404, 18, 33599, {1, 3, 5, 13, 29, 17, 123, 105, 477, 359, 613, 1699, 2581, 3007, 8507, 14391, 95487, 633}}, {15405, 18, 33619, {1, 1, 7, 7, 13, 55, 107, 211, 71, 339, 1169, 2629, 165, 16207, 25523, 7101, 47553, 261131}}, {15406, 18, 33635, {1, 3, 5, 15, 11, 7, 45, 207, 39, 41, 781, 3347, 2529, 4475, 9665, 31499, 119837, 128755}}, {15407, 18, 33659, {1, 3, 1, 15, 23, 59, 59, 17, 89, 823, 59, 3991, 305, 14893, 1411, 8015, 92193, 66935}}, {15408, 18, 33680, {1, 1, 7, 15, 19, 29, 11, 207, 429, 851, 1661, 2903, 4413, 447, 29447, 39243, 70435, 160451}}, {15409, 18, 33699, {1, 1, 3, 13, 17, 5, 93, 89, 455, 67, 33, 65, 7957, 14383, 28525, 56983, 71899, 4881}}, {15410, 18, 33713, {1, 3, 3, 5, 11, 7, 47, 233, 433, 791, 47, 2561, 6539, 1151, 2083, 12309, 62353, 69507}}, {15411, 18, 33758, {1, 3, 5, 11, 15, 55, 101, 251, 41, 39, 383, 3481, 1817, 3447, 6205, 38169, 98267, 157091}}, {15412, 18, 33771, {1, 3, 5, 7, 9, 47, 113, 55, 421, 703, 849, 2251, 129, 9257, 28097, 33475, 98933, 32041}}, {15413, 18, 33779, {1, 3, 3, 11, 9, 59, 1, 211, 277, 969, 977, 3079, 4707, 3341, 17679, 9469, 52859, 125883}}, {15414, 18, 33800, {1, 1, 7, 13, 29, 19, 49, 149, 259, 573, 1137, 2571, 2661, 12865, 24993, 10721, 96921, 85931}}, {15415, 18, 33829, {1, 3, 1, 9, 15, 27, 91, 127, 305, 159, 523, 2539, 1969, 4325, 595, 37077, 79919, 26889}}, {15416, 18, 33836, {1, 3, 1, 11, 1, 5, 65, 75, 317, 909, 1601, 2713, 6891, 4927, 28427, 5791, 82285, 35209}}, {15417, 18, 33844, {1, 3, 7, 7, 9, 5, 111, 167, 477, 437, 1133, 2715, 6189, 5051, 4765, 26267, 99819, 70419}}, {15418, 18, 33856, {1, 1, 3, 9, 27, 57, 23, 233, 423, 191, 1159, 1539, 6397, 16041, 8803, 19787, 114447, 17029}}, {15419, 18, 33859, {1, 1, 5, 1, 11, 3, 111, 125, 287, 487, 1663, 1953, 3771, 2011, 18167, 47471, 94041, 87569}}, {15420, 18, 33873, {1, 3, 1, 11, 5, 9, 75, 153, 37, 803, 971, 1667, 4631, 9183, 20179, 6905, 80949, 54443}}, {15421, 18, 33874, {1, 1, 1, 5, 13, 29, 91, 201, 49, 739, 1569, 2725, 257, 5505, 5289, 40731, 27843, 16565}}, {15422, 18, 33929, {1, 1, 7, 13, 27, 41, 81, 199, 99, 43, 1331, 3237, 6493, 3839, 19329, 44371, 19715, 60553}}, {15423, 18, 33944, {1, 1, 5, 7, 29, 41, 67, 163, 467, 93, 1977, 2625, 6967, 6655, 19835, 39517, 10259, 200487}}, {15424, 18, 33965, {1, 1, 3, 15, 23, 35, 31, 171, 175, 883, 593, 245, 6209, 7381, 5555, 54507, 66159, 40771}}, {15425, 18, 33978, {1, 3, 3, 11, 3, 63, 75, 177, 239, 77, 1543, 875, 7951, 7571, 961, 9909, 101781, 160399}}, {15426, 18, 33986, {1, 3, 1, 3, 3, 37, 71, 231, 373, 443, 835, 1321, 2107, 2929, 7527, 47969, 15329, 94537}}, {15427, 18, 34006, {1, 3, 3, 15, 7, 5, 127, 121, 159, 25, 399, 3009, 4401, 9649, 4311, 18045, 22557, 135177}}, {15428, 18, 34025, {1, 1, 1, 3, 29, 57, 75, 73, 261, 493, 1417, 1351, 3407, 8553, 4893, 10325, 123149, 161435}}, {15429, 18, 34106, {1, 3, 3, 11, 15, 5, 87, 115, 337, 213, 949, 1925, 5057, 5831, 6837, 51167, 25291, 182197}}, {15430, 18, 34126, {1, 3, 1, 11, 25, 49, 27, 101, 403, 989, 1129, 3933, 1147, 13091, 11965, 38075, 68251, 103293}}, {15431, 18, 34171, {1, 1, 7, 5, 7, 49, 1, 189, 275, 63, 149, 3255, 1175, 7811, 24845, 20755, 99391, 140673}}, {15432, 18, 34189, {1, 3, 1, 13, 17, 35, 37, 37, 415, 125, 643, 443, 6215, 299, 31237, 45687, 78535, 102123}}, {15433, 18, 34204, {1, 3, 5, 3, 27, 41, 85, 215, 47, 21, 725, 1967, 2317, 121, 7827, 48229, 82027, 60271}}, {15434, 18, 34260, {1, 3, 5, 1, 1, 55, 37, 183, 117, 421, 383, 3883, 5519, 6161, 6823, 18423, 77747, 215969}}, {15435, 18, 34270, {1, 3, 5, 13, 31, 3, 117, 59, 375, 797, 1129, 1283, 3245, 12775, 30353, 3837, 130273, 228899}}, {15436, 18, 34280, {1, 3, 5, 1, 7, 33, 17, 153, 179, 255, 537, 2911, 1223, 367, 18131, 25903, 33509, 220031}}, {15437, 18, 34298, {1, 3, 7, 5, 5, 7, 103, 233, 309, 947, 1835, 3509, 4267, 15619, 5895, 30707, 81841, 191899}}, {15438, 18, 34313, {1, 1, 5, 11, 3, 15, 91, 83, 319, 765, 895, 2565, 6833, 1719, 2971, 37483, 21709, 23193}}, {15439, 18, 34321, {1, 1, 3, 11, 31, 57, 83, 233, 439, 161, 1503, 749, 6347, 15379, 2317, 24671, 93399, 239585}}, {15440, 18, 34333, {1, 1, 3, 9, 29, 45, 19, 107, 295, 153, 189, 2521, 5465, 7321, 6143, 229, 100553, 258911}}, {15441, 18, 34370, {1, 3, 7, 11, 31, 27, 95, 21, 249, 981, 1725, 1481, 1025, 9301, 11809, 53109, 29007, 127683}}, {15442, 18, 34376, {1, 3, 1, 3, 1, 23, 97, 137, 5, 471, 1887, 1035, 2681, 5143, 3145, 1517, 88107, 245245}}, {15443, 18, 34387, {1, 1, 1, 1, 15, 11, 13, 9, 405, 607, 403, 1693, 4363, 9365, 6425, 48121, 78969, 87341}}, {15444, 18, 34389, {1, 1, 7, 15, 3, 17, 7, 51, 111, 1023, 9, 465, 1909, 16283, 4763, 50939, 119029, 198257}}, {15445, 18, 34417, {1, 3, 3, 1, 31, 11, 113, 13, 499, 433, 1941, 991, 5439, 3123, 24591, 16171, 55099, 206015}}, {15446, 18, 34429, {1, 3, 5, 15, 25, 49, 125, 101, 251, 619, 1895, 4063, 3065, 14965, 20081, 11233, 58253, 69633}}, {15447, 18, 34440, {1, 1, 1, 5, 21, 35, 29, 241, 359, 553, 1001, 1865, 5183, 5233, 16371, 55277, 102091, 143275}}, {15448, 18, 34443, {1, 1, 1, 3, 29, 37, 3, 191, 239, 961, 2031, 1337, 1169, 5229, 22861, 38257, 55027, 153703}}, {15449, 18, 34451, {1, 3, 5, 7, 7, 35, 49, 139, 509, 381, 1267, 2641, 747, 16239, 23133, 32111, 70471, 128427}}, {15450, 18, 34470, {1, 1, 1, 9, 23, 25, 117, 125, 369, 891, 103, 2215, 3571, 1291, 9001, 35671, 67119, 198847}}, {15451, 18, 34484, {1, 1, 5, 9, 17, 19, 27, 7, 207, 55, 1099, 2117, 7511, 14999, 7761, 32215, 103401, 68599}}, {15452, 18, 34493, {1, 1, 7, 9, 1, 59, 41, 91, 9, 225, 457, 3241, 4713, 2923, 11973, 2867, 130583, 202007}}, {15453, 18, 34496, {1, 3, 1, 9, 31, 47, 63, 49, 457, 757, 885, 937, 2973, 12147, 2607, 52907, 126047, 83275}}, {15454, 18, 34514, {1, 3, 5, 11, 17, 1, 79, 123, 505, 203, 1779, 71, 4357, 2285, 31625, 15225, 86519, 2021}}, {15455, 18, 34526, {1, 3, 1, 11, 21, 17, 41, 169, 125, 995, 351, 1235, 25, 7463, 2099, 18917, 71355, 26983}}, {15456, 18, 34535, {1, 1, 7, 1, 21, 23, 41, 5, 415, 405, 1235, 1245, 151, 11283, 25293, 45147, 12597, 39501}}, {15457, 18, 34585, {1, 1, 1, 5, 29, 29, 15, 165, 259, 179, 1479, 3535, 779, 6583, 885, 34331, 71193, 154417}}, {15458, 18, 34591, {1, 1, 1, 5, 3, 1, 13, 181, 507, 339, 333, 4059, 7963, 15649, 15507, 16913, 34741, 202039}}, {15459, 18, 34592, {1, 3, 7, 1, 1, 9, 17, 119, 77, 583, 259, 883, 4011, 4275, 9599, 58663, 73237, 202783}}, {15460, 18, 34602, {1, 1, 5, 11, 23, 27, 19, 171, 373, 779, 661, 1701, 3363, 13095, 897, 51233, 1319, 41093}}, {15461, 18, 34607, {1, 3, 3, 3, 29, 21, 105, 29, 429, 657, 1735, 1279, 809, 14963, 9735, 23251, 44879, 159371}}, {15462, 18, 34644, {1, 1, 5, 11, 17, 27, 117, 65, 193, 539, 1095, 439, 1687, 11277, 513, 30611, 88885, 69145}}, {15463, 18, 34657, {1, 3, 1, 7, 11, 1, 27, 41, 63, 501, 917, 2397, 6839, 10835, 26437, 56169, 46631, 64095}}, {15464, 18, 34675, {1, 1, 7, 15, 29, 5, 17, 217, 333, 389, 403, 3167, 3599, 12055, 30669, 44821, 109811, 237393}}, {15465, 18, 34681, {1, 3, 5, 13, 1, 39, 51, 233, 159, 135, 763, 2499, 7741, 13099, 8639, 8043, 39827, 5989}}, {15466, 18, 34693, {1, 1, 7, 3, 1, 61, 41, 37, 37, 67, 867, 2631, 6265, 5551, 161, 56643, 126087, 126829}}, {15467, 18, 34706, {1, 1, 7, 1, 21, 39, 101, 225, 489, 123, 661, 2489, 1865, 6809, 21663, 59405, 45579, 51257}}, {15468, 18, 34745, {1, 3, 7, 9, 27, 53, 11, 97, 369, 389, 1933, 3321, 543, 12331, 11571, 10685, 49049, 244027}}, {15469, 18, 34759, {1, 3, 5, 3, 7, 15, 21, 165, 181, 877, 1161, 1815, 2097, 449, 32411, 22843, 12467, 55397}}, {15470, 18, 34765, {1, 3, 1, 3, 11, 45, 23, 193, 287, 137, 333, 1831, 457, 583, 23081, 4525, 4781, 249509}}, {15471, 18, 34774, {1, 3, 5, 5, 15, 13, 27, 199, 267, 297, 923, 3861, 4949, 7945, 25291, 45407, 47529, 127287}}, {15472, 18, 34780, {1, 1, 5, 7, 19, 29, 113, 51, 503, 487, 699, 2097, 2957, 6519, 19487, 46873, 38871, 89997}}, {15473, 18, 34794, {1, 1, 5, 13, 17, 31, 57, 127, 335, 223, 1545, 3749, 1539, 3293, 21159, 13019, 48343, 190895}}, {15474, 18, 34807, {1, 1, 7, 9, 25, 19, 75, 41, 511, 269, 819, 3313, 6805, 15051, 4349, 1809, 34841, 190641}}, {15475, 18, 34808, {1, 3, 5, 9, 27, 7, 91, 187, 123, 519, 477, 2719, 211, 1225, 22689, 37043, 66291, 205441}}, {15476, 18, 34835, {1, 1, 5, 13, 5, 41, 95, 49, 187, 239, 1213, 2363, 8075, 12423, 6361, 42471, 70047, 188063}}, {15477, 18, 34842, {1, 3, 7, 3, 27, 23, 21, 217, 65, 143, 1171, 1441, 1603, 2235, 20923, 32611, 111903, 132771}}, {15478, 18, 34865, {1, 1, 7, 9, 3, 29, 33, 203, 497, 179, 1253, 2083, 7407, 12551, 8371, 62167, 93875, 193017}}, {15479, 18, 34907, {1, 1, 1, 13, 7, 61, 43, 107, 417, 757, 1701, 3187, 5489, 11359, 20469, 20249, 93581, 207969}}, {15480, 18, 34928, {1, 1, 7, 3, 31, 51, 51, 183, 483, 885, 1627, 3605, 6687, 1271, 27013, 40409, 103807, 189805}}, {15481, 18, 34949, {1, 1, 3, 1, 21, 21, 107, 185, 267, 981, 147, 1873, 1085, 15829, 10315, 21673, 7713, 120087}}, {15482, 18, 34961, {1, 1, 5, 3, 7, 27, 73, 131, 287, 657, 1351, 547, 3655, 2433, 6753, 2465, 110299, 194587}}, {15483, 18, 34964, {1, 1, 7, 7, 17, 55, 29, 223, 411, 775, 745, 3515, 4573, 4289, 7411, 55999, 22021, 110567}}, {15484, 18, 34987, {1, 3, 1, 3, 29, 55, 7, 183, 507, 773, 1299, 3653, 7693, 3773, 29549, 4171, 123039, 137495}}, {15485, 18, 34990, {1, 1, 1, 7, 5, 25, 53, 85, 41, 837, 587, 2997, 7281, 6821, 15609, 47855, 49017, 108557}}, {15486, 18, 35019, {1, 1, 5, 5, 1, 17, 109, 231, 295, 825, 1909, 683, 2197, 1895, 8641, 37917, 36347, 38683}}, {15487, 18, 35069, {1, 3, 7, 3, 23, 39, 91, 121, 223, 505, 127, 3439, 7779, 12917, 17351, 33063, 84019, 40077}}, {15488, 18, 35077, {1, 3, 3, 1, 19, 1, 125, 99, 143, 549, 709, 3605, 2377, 761, 14369, 52191, 80811, 214877}}, {15489, 18, 35090, {1, 1, 7, 9, 13, 57, 39, 91, 505, 299, 1241, 1697, 5821, 5327, 22439, 42321, 120941, 40009}}, {15490, 18, 35152, {1, 1, 3, 13, 15, 59, 15, 129, 265, 841, 1255, 1915, 4645, 5991, 26801, 7839, 66961, 59045}}, {15491, 18, 35173, {1, 3, 7, 15, 17, 57, 61, 173, 391, 1001, 1815, 2565, 1445, 13237, 2273, 61683, 62327, 180255}}, {15492, 18, 35174, {1, 1, 3, 3, 23, 29, 115, 185, 333, 103, 1807, 3271, 4803, 9743, 3031, 25263, 30761, 1899}}, {15493, 18, 35202, {1, 1, 1, 7, 1, 13, 63, 113, 467, 17, 1803, 3141, 7069, 8895, 25823, 40347, 11211, 88769}}, {15494, 18, 35214, {1, 3, 5, 1, 3, 3, 29, 101, 315, 915, 341, 287, 4167, 7579, 19797, 18287, 19079, 52805}}, {15495, 18, 35219, {1, 3, 7, 15, 31, 61, 27, 153, 387, 273, 343, 881, 2273, 6621, 19391, 41735, 123899, 117851}}, {15496, 18, 35226, {1, 1, 7, 11, 5, 49, 83, 223, 87, 341, 1023, 2785, 3635, 2651, 5179, 25907, 115249, 74001}}, {15497, 18, 35235, {1, 3, 3, 7, 31, 37, 123, 79, 365, 455, 639, 691, 2659, 12215, 26785, 48785, 120175, 155501}}, {15498, 18, 35255, {1, 3, 3, 11, 19, 49, 81, 97, 429, 317, 257, 663, 5009, 2855, 22721, 51553, 32511, 188977}}, {15499, 18, 35310, {1, 1, 7, 11, 5, 37, 1, 123, 477, 747, 839, 3975, 6347, 489, 31387, 56037, 62935, 177587}}, {15500, 18, 35318, {1, 1, 1, 1, 29, 7, 119, 233, 255, 25, 127, 1377, 991, 12151, 31259, 64863, 34733, 86101}}, {15501, 18, 35321, {1, 3, 7, 5, 19, 57, 67, 1, 81, 719, 891, 2485, 3817, 1055, 437, 9779, 23823, 173219}}, {15502, 18, 35333, {1, 1, 1, 5, 1, 63, 87, 163, 135, 809, 637, 1233, 5245, 481, 11011, 23477, 114963, 96051}}, {15503, 18, 35337, {1, 1, 7, 5, 25, 39, 57, 129, 311, 525, 1555, 179, 639, 4949, 8809, 31215, 95975, 79407}}, {15504, 18, 35346, {1, 3, 1, 1, 15, 59, 77, 87, 479, 889, 1619, 331, 4781, 10597, 935, 28105, 83861, 134273}}, {15505, 18, 35373, {1, 3, 5, 15, 21, 55, 61, 105, 373, 185, 1579, 3487, 2621, 8993, 6443, 31709, 57329, 128165}}, {15506, 18, 35414, {1, 3, 3, 3, 7, 21, 117, 159, 177, 927, 1873, 1865, 3219, 1693, 1173, 34365, 107053, 113949}}, {15507, 18, 35478, {1, 3, 7, 1, 17, 37, 35, 101, 305, 141, 1681, 1949, 47, 11351, 989, 13887, 127429, 13059}}, {15508, 18, 35497, {1, 1, 3, 7, 13, 41, 125, 115, 65, 621, 1401, 631, 5875, 8589, 17185, 22757, 83625, 92907}}, {15509, 18, 35503, {1, 3, 1, 5, 25, 37, 73, 39, 495, 645, 265, 2685, 5875, 5919, 23223, 44593, 26207, 49921}}, {15510, 18, 35512, {1, 3, 1, 13, 25, 31, 39, 15, 179, 791, 1817, 3617, 2139, 1827, 21215, 21767, 15009, 239443}}, {15511, 18, 35515, {1, 1, 3, 7, 17, 9, 33, 121, 235, 535, 1537, 3307, 2881, 4351, 4721, 34131, 129619, 137993}}, {15512, 18, 35526, {1, 1, 3, 1, 3, 51, 79, 213, 205, 323, 1749, 2563, 2013, 6519, 18923, 25937, 74445, 252283}}, {15513, 18, 35577, {1, 3, 5, 11, 3, 53, 17, 195, 305, 543, 1937, 2997, 4593, 7801, 15307, 46359, 39365, 59537}}, {15514, 18, 35585, {1, 1, 1, 13, 31, 53, 111, 163, 139, 163, 999, 83, 5125, 10047, 11143, 51407, 13627, 3621}}, {15515, 18, 35592, {1, 1, 3, 9, 5, 1, 125, 95, 281, 939, 913, 1441, 1209, 12983, 27759, 22393, 75985, 178997}}, {15516, 18, 35615, {1, 3, 5, 3, 5, 27, 91, 41, 51, 447, 491, 3405, 497, 2873, 17865, 30651, 104197, 71751}}, {15517, 18, 35616, {1, 3, 7, 1, 29, 61, 73, 31, 423, 933, 1327, 809, 1461, 269, 15121, 18649, 36095, 139429}}, {15518, 18, 35622, {1, 1, 7, 7, 19, 49, 51, 173, 297, 411, 1255, 1093, 2821, 6743, 1927, 27563, 68459, 261411}}, {15519, 18, 35634, {1, 3, 5, 1, 5, 33, 27, 119, 103, 615, 149, 2299, 6801, 15615, 7361, 31045, 87719, 9557}}, {15520, 18, 35657, {1, 1, 3, 9, 17, 23, 89, 35, 151, 385, 319, 2065, 1897, 1987, 15159, 34855, 5395, 110751}}, {15521, 18, 35672, {1, 3, 1, 13, 7, 47, 19, 185, 207, 787, 1179, 1073, 1463, 6277, 6129, 25031, 91969, 123235}}, {15522, 18, 35708, {1, 1, 7, 3, 19, 63, 97, 1, 381, 71, 1169, 339, 6585, 3629, 31357, 59451, 102735, 253667}}, {15523, 18, 35772, {1, 3, 3, 13, 9, 27, 69, 17, 509, 599, 1247, 2267, 3309, 1905, 17995, 41263, 5947, 51607}}, {15524, 18, 35790, {1, 3, 1, 9, 31, 45, 69, 243, 171, 555, 61, 1135, 1993, 8615, 18363, 19545, 64015, 81391}}, {15525, 18, 35804, {1, 1, 1, 1, 19, 49, 31, 65, 53, 123, 271, 3007, 4509, 9465, 3855, 12673, 19457, 14677}}, {15526, 18, 35811, {1, 3, 5, 13, 29, 53, 91, 145, 115, 53, 839, 1911, 2887, 6053, 18437, 42273, 63093, 70937}}, {15527, 18, 35814, {1, 1, 5, 5, 27, 13, 87, 175, 485, 699, 463, 811, 4991, 15303, 23007, 10021, 59125, 39997}}, {15528, 18, 35837, {1, 1, 5, 5, 27, 21, 89, 61, 109, 555, 953, 2811, 3015, 3249, 16085, 64413, 84605, 177333}}, {15529, 18, 35846, {1, 1, 7, 3, 1, 29, 83, 143, 67, 577, 971, 2339, 6521, 6341, 27141, 37149, 99813, 37579}}, {15530, 18, 35873, {1, 3, 3, 7, 23, 29, 117, 5, 287, 559, 667, 2349, 7481, 679, 9633, 40857, 89841, 98125}}, {15531, 18, 35883, {1, 1, 1, 3, 31, 31, 83, 117, 213, 213, 23, 3803, 5967, 7759, 19521, 13229, 62231, 150687}}, {15532, 18, 35918, {1, 3, 7, 9, 1, 15, 37, 191, 19, 107, 1723, 3517, 3477, 3777, 4359, 45815, 58661, 33217}}, {15533, 18, 35920, {1, 1, 5, 1, 17, 3, 3, 255, 501, 1021, 1731, 481, 6145, 3475, 3417, 11847, 92203, 75109}}, {15534, 18, 35925, {1, 1, 5, 1, 1, 61, 89, 107, 503, 627, 931, 1355, 2067, 12487, 20665, 61543, 15501, 103843}}, {15535, 18, 35926, {1, 1, 5, 9, 25, 17, 7, 255, 251, 939, 851, 2241, 939, 15331, 29357, 2485, 80791, 152601}}, {15536, 18, 35945, {1, 1, 5, 3, 13, 25, 35, 113, 83, 765, 1317, 1409, 369, 2215, 5659, 3581, 13925, 108673}}, {15537, 18, 35956, {1, 1, 1, 1, 13, 13, 83, 27, 5, 563, 723, 2733, 3155, 6567, 24595, 45569, 37587, 144401}}, {15538, 18, 36003, {1, 1, 1, 9, 31, 51, 73, 105, 299, 857, 669, 963, 4115, 14939, 11669, 46215, 92707, 149249}}, {15539, 18, 36023, {1, 1, 3, 5, 7, 41, 105, 213, 3, 999, 93, 1497, 6783, 1559, 20047, 40761, 88219, 64769}}, {15540, 18, 36024, {1, 3, 1, 5, 13, 17, 79, 29, 453, 75, 1095, 623, 7401, 4225, 30467, 60795, 130045, 154767}}, {15541, 18, 36059, {1, 1, 5, 3, 31, 59, 33, 129, 505, 277, 1623, 3531, 6841, 12903, 7231, 5801, 92405, 260195}}, {15542, 18, 36061, {1, 1, 3, 5, 27, 23, 63, 219, 225, 547, 1163, 1899, 4191, 9725, 30077, 30157, 73395, 38195}}, {15543, 18, 36072, {1, 1, 1, 11, 17, 27, 63, 127, 95, 205, 1753, 2023, 6803, 4355, 28169, 16691, 25105, 8969}}, {15544, 18, 36075, {1, 1, 5, 3, 23, 23, 89, 115, 231, 647, 513, 3161, 3175, 5061, 5797, 35387, 109827, 19511}}, {15545, 18, 36103, {1, 3, 5, 5, 11, 9, 39, 251, 367, 253, 2031, 3909, 1057, 12545, 25397, 51571, 91229, 83721}}, {15546, 18, 36110, {1, 3, 5, 7, 5, 35, 57, 153, 111, 789, 177, 2237, 1333, 13185, 993, 22099, 62113, 211815}}, {15547, 18, 36131, {1, 1, 5, 15, 19, 37, 123, 221, 375, 605, 791, 1663, 7537, 7193, 20149, 58077, 113129, 185493}}, {15548, 18, 36151, {1, 1, 1, 1, 1, 53, 117, 227, 441, 851, 1171, 4031, 2313, 2847, 25533, 31767, 18197, 153101}}, {15549, 18, 36160, {1, 1, 3, 3, 13, 9, 65, 225, 71, 763, 1507, 3795, 4321, 399, 12515, 4527, 89193, 236161}}, {15550, 18, 36199, {1, 1, 3, 11, 21, 63, 73, 125, 369, 309, 953, 3525, 3925, 13609, 26061, 21739, 112867, 112985}}, {15551, 18, 36223, {1, 1, 7, 1, 27, 25, 3, 129, 321, 193, 1871, 233, 837, 11163, 14861, 42721, 72849, 206739}}, {15552, 18, 36227, {1, 3, 7, 3, 5, 51, 43, 177, 167, 11, 1297, 1805, 515, 6485, 8253, 271, 47435, 252291}}, {15553, 18, 36234, {1, 3, 3, 3, 19, 47, 47, 47, 299, 101, 1535, 3593, 4669, 10367, 19219, 16579, 85269, 36115}}, {15554, 18, 36236, {1, 1, 7, 15, 7, 51, 53, 181, 379, 267, 985, 3401, 2189, 10197, 14183, 413, 76797, 24751}}, {15555, 18, 36284, {1, 1, 5, 7, 13, 27, 65, 119, 235, 131, 1921, 3411, 1511, 11221, 30315, 11799, 127563, 203533}}, {15556, 18, 36319, {1, 3, 1, 3, 13, 55, 101, 189, 483, 261, 467, 645, 417, 6203, 9221, 19671, 102331, 259335}}, {15557, 18, 36332, {1, 1, 5, 15, 19, 7, 81, 1, 371, 119, 1433, 1211, 303, 14393, 27107, 45295, 109211, 224661}}, {15558, 18, 36343, {1, 3, 7, 9, 19, 53, 31, 55, 103, 351, 1511, 377, 981, 6709, 19553, 53579, 55043, 170489}}, {15559, 18, 36373, {1, 3, 3, 15, 31, 49, 1, 251, 187, 73, 119, 3041, 5455, 5355, 22245, 7735, 14661, 258447}}, {15560, 18, 36401, {1, 3, 7, 11, 13, 1, 61, 97, 179, 975, 1653, 3301, 4303, 2271, 30171, 63287, 51271, 21909}}, {15561, 18, 36413, {1, 1, 5, 11, 21, 45, 101, 131, 121, 881, 1205, 1849, 4337, 5687, 31967, 22559, 98017, 202557}}, {15562, 18, 36433, {1, 3, 3, 7, 1, 49, 11, 35, 141, 309, 651, 3319, 4313, 3675, 27699, 49429, 109805, 167089}}, {15563, 18, 36459, {1, 1, 3, 13, 13, 15, 61, 251, 335, 365, 677, 2183, 6291, 8857, 15231, 551, 63149, 76729}}, {15564, 18, 36480, {1, 3, 3, 13, 1, 59, 85, 127, 409, 1007, 1947, 3495, 6227, 11447, 14329, 3769, 109619, 59063}}, {15565, 18, 36485, {1, 3, 5, 11, 11, 59, 67, 209, 491, 757, 1137, 1977, 3155, 9339, 11219, 20303, 66417, 187911}}, {15566, 18, 36510, {1, 1, 5, 9, 27, 51, 87, 249, 327, 867, 29, 3811, 4769, 12353, 24803, 35747, 84101, 210975}}, {15567, 18, 36513, {1, 3, 7, 7, 23, 37, 23, 55, 237, 543, 779, 1305, 1535, 13333, 1403, 10903, 113135, 195799}}, {15568, 18, 36523, {1, 1, 3, 11, 1, 1, 3, 153, 401, 35, 981, 79, 4227, 9203, 8179, 29325, 104809, 140613}}, {15569, 18, 36528, {1, 3, 5, 9, 13, 39, 101, 181, 507, 307, 1411, 1443, 6855, 8747, 22709, 37869, 102303, 577}}, {15570, 18, 36537, {1, 3, 5, 1, 25, 41, 3, 239, 195, 1, 1277, 2085, 4253, 14683, 24171, 56733, 82795, 213291}}, {15571, 18, 36558, {1, 1, 3, 5, 25, 55, 31, 55, 215, 149, 1813, 3775, 779, 6137, 10561, 41671, 96883, 177435}}, {15572, 18, 36563, {1, 1, 5, 11, 15, 5, 1, 237, 131, 13, 229, 3203, 2431, 1829, 31983, 59535, 31381, 175455}}, {15573, 18, 36576, {1, 3, 3, 7, 5, 19, 61, 253, 223, 609, 1395, 2495, 5501, 6571, 12989, 889, 49435, 200251}}, {15574, 18, 36608, {1, 1, 7, 13, 25, 49, 33, 157, 457, 259, 1935, 2249, 7419, 12685, 30509, 32187, 108839, 178963}}, {15575, 18, 36611, {1, 3, 3, 15, 19, 27, 91, 133, 369, 931, 359, 759, 2647, 13643, 14877, 14031, 115367, 201745}}, {15576, 18, 36617, {1, 1, 5, 3, 9, 23, 87, 27, 203, 995, 1759, 999, 949, 2733, 29053, 46581, 129003, 42585}}, {15577, 18, 36653, {1, 1, 3, 1, 1, 21, 63, 243, 257, 741, 681, 2471, 2455, 15145, 31739, 8751, 15963, 165405}}, {15578, 18, 36716, {1, 3, 3, 1, 25, 21, 69, 213, 219, 9, 199, 487, 4103, 141, 18177, 58797, 60415, 6313}}, {15579, 18, 36721, {1, 3, 1, 5, 23, 43, 61, 121, 123, 89, 283, 1313, 2707, 10199, 7699, 17437, 130995, 140327}}, {15580, 18, 36733, {1, 3, 5, 13, 31, 41, 111, 39, 403, 5, 1125, 2867, 3143, 7051, 9891, 43349, 20751, 88465}}, {15581, 18, 36761, {1, 1, 3, 1, 19, 53, 83, 207, 285, 789, 1515, 3455, 4057, 15777, 27879, 46971, 122661, 143407}}, {15582, 18, 36783, {1, 3, 3, 11, 25, 21, 127, 191, 313, 357, 1625, 1323, 1151, 12509, 22275, 23517, 12221, 258709}}, {15583, 18, 36786, {1, 1, 5, 7, 1, 47, 1, 107, 387, 965, 1319, 2911, 2121, 8595, 9, 21587, 81187, 2803}}, {15584, 18, 36795, {1, 3, 3, 5, 19, 55, 37, 213, 23, 767, 1493, 635, 4289, 2503, 16835, 47851, 77335, 60565}}, {15585, 18, 36800, {1, 1, 1, 7, 23, 9, 101, 145, 457, 691, 1895, 2145, 7527, 7687, 20781, 10957, 24859, 79137}}, {15586, 18, 36810, {1, 3, 7, 15, 9, 9, 15, 195, 493, 859, 687, 1445, 429, 8599, 24591, 40709, 118361, 148163}}, {15587, 18, 36812, {1, 1, 1, 3, 7, 51, 45, 143, 339, 475, 1177, 2829, 785, 10141, 4923, 29135, 22603, 119973}}, {15588, 18, 36817, {1, 3, 5, 15, 25, 37, 1, 13, 351, 127, 143, 2637, 1215, 14577, 12465, 10575, 67997, 21877}}, {15589, 18, 36818, {1, 3, 7, 3, 27, 19, 59, 241, 327, 307, 731, 3471, 6123, 13607, 8793, 14825, 110681, 83259}}, {15590, 18, 36851, {1, 1, 1, 11, 25, 5, 59, 85, 335, 189, 499, 1305, 5801, 7259, 2397, 14045, 55585, 258579}}, {15591, 18, 36853, {1, 1, 3, 5, 21, 49, 49, 63, 261, 657, 1453, 55, 1325, 15513, 14891, 60689, 15381, 252641}}, {15592, 18, 36868, {1, 1, 7, 15, 25, 3, 85, 33, 495, 867, 903, 1813, 2871, 365, 17399, 45695, 102851, 225873}}, {15593, 18, 36889, {1, 1, 1, 13, 13, 63, 29, 35, 325, 893, 1313, 133, 8169, 7791, 9271, 36759, 92275, 169717}}, {15594, 18, 36890, {1, 1, 7, 3, 21, 45, 7, 151, 387, 891, 1921, 1701, 307, 5323, 16321, 51229, 79369, 21513}}, {15595, 18, 36896, {1, 1, 1, 11, 7, 27, 17, 75, 161, 649, 337, 1731, 2905, 4589, 17387, 10455, 70673, 228373}}, {15596, 18, 36905, {1, 1, 3, 15, 17, 35, 45, 131, 469, 629, 1771, 1965, 5065, 6249, 29041, 52791, 55619, 154531}}, {15597, 18, 36919, {1, 1, 7, 3, 25, 53, 85, 233, 161, 163, 1155, 3159, 1551, 13099, 25647, 26777, 91647, 162755}}, {15598, 18, 36938, {1, 1, 3, 9, 17, 11, 39, 63, 503, 927, 1621, 3425, 4835, 7083, 16449, 47913, 127905, 165567}}, {15599, 18, 36946, {1, 1, 7, 1, 29, 9, 1, 111, 285, 1009, 1427, 3071, 205, 12269, 31337, 14501, 10923, 14277}}, {15600, 18, 36951, {1, 1, 5, 5, 1, 3, 51, 205, 477, 661, 1555, 2113, 6487, 4755, 13633, 16391, 35775, 52623}}, {15601, 18, 36952, {1, 3, 3, 3, 27, 23, 109, 49, 71, 19, 733, 1361, 4369, 14527, 20443, 10507, 120183, 246115}}, {15602, 18, 36964, {1, 3, 3, 5, 7, 47, 51, 197, 97, 471, 1631, 3317, 5857, 9405, 30359, 7741, 45079, 175929}}, {15603, 18, 36968, {1, 1, 3, 3, 13, 63, 39, 173, 511, 525, 1687, 1735, 6877, 7383, 27971, 26503, 6189, 232251}}, {15604, 18, 36979, {1, 1, 5, 3, 5, 31, 101, 99, 51, 987, 1627, 3899, 6321, 9441, 4983, 64001, 30923, 199495}}, {15605, 18, 36981, {1, 3, 1, 1, 11, 39, 119, 123, 33, 1017, 1477, 283, 4939, 453, 16445, 25599, 106857, 257811}}, {15606, 18, 37021, {1, 3, 1, 11, 13, 1, 3, 101, 275, 75, 1795, 1449, 2503, 11765, 19299, 14237, 157, 244825}}, {15607, 18, 37026, {1, 3, 7, 15, 23, 1, 85, 65, 55, 103, 1523, 1443, 1021, 5733, 3297, 10889, 22487, 82503}}, {15608, 18, 37075, {1, 1, 7, 3, 17, 59, 109, 113, 17, 173, 1709, 273, 5327, 3243, 10751, 58361, 42303, 78391}}, {15609, 18, 37077, {1, 1, 5, 15, 25, 11, 101, 133, 193, 131, 1671, 3045, 7111, 14331, 15665, 56407, 31561, 154555}}, {15610, 18, 37108, {1, 3, 3, 5, 15, 41, 105, 65, 81, 293, 389, 2653, 1883, 14741, 23553, 33349, 39665, 154233}}, {15611, 18, 37112, {1, 1, 5, 15, 31, 19, 121, 41, 261, 511, 1679, 957, 1647, 12647, 12285, 30291, 122483, 187911}}, {15612, 18, 37150, {1, 3, 1, 5, 27, 25, 17, 45, 303, 947, 1123, 2729, 281, 12389, 27987, 42667, 16089, 17129}}, {15613, 18, 37154, {1, 3, 7, 15, 13, 17, 25, 223, 125, 837, 159, 253, 2599, 11381, 639, 32545, 50633, 139025}}, {15614, 18, 37156, {1, 3, 1, 13, 23, 43, 25, 83, 507, 47, 99, 697, 4453, 2139, 17151, 50709, 37099, 212957}}, {15615, 18, 37163, {1, 1, 7, 7, 29, 7, 63, 141, 475, 853, 1073, 143, 6979, 5663, 29691, 59489, 89689, 223047}}, {15616, 18, 37178, {1, 1, 1, 1, 13, 27, 101, 61, 27, 735, 207, 2065, 5811, 5461, 21493, 15481, 103727, 80017}}, {15617, 18, 37183, {1, 3, 1, 11, 9, 9, 35, 251, 147, 841, 1891, 1909, 5053, 5103, 11751, 16209, 110475, 114875}}, {15618, 18, 37185, {1, 3, 3, 11, 13, 55, 117, 205, 71, 159, 1797, 989, 2221, 16087, 18287, 8355, 96403, 146613}}, {15619, 18, 37191, {1, 1, 5, 5, 29, 25, 73, 63, 299, 839, 1225, 3583, 5641, 1341, 29431, 7035, 99107, 13493}}, {15620, 18, 37198, {1, 1, 3, 5, 27, 53, 9, 51, 79, 701, 667, 1469, 4455, 13761, 18607, 39429, 7687, 201115}}, {15621, 18, 37203, {1, 3, 7, 11, 23, 35, 101, 129, 491, 369, 565, 2557, 2529, 1003, 16003, 33873, 52155, 861}}, {15622, 18, 37225, {1, 1, 1, 15, 27, 63, 1, 55, 331, 853, 899, 1027, 7389, 8935, 12559, 27315, 101753, 255331}}, {15623, 18, 37243, {1, 3, 3, 15, 5, 41, 93, 39, 473, 887, 1667, 847, 7619, 8407, 6539, 31989, 63807, 21861}}, {15624, 18, 37252, {1, 1, 5, 11, 27, 57, 73, 249, 331, 653, 21, 2937, 4403, 16195, 18785, 30375, 22939, 235291}}, {15625, 18, 37262, {1, 1, 7, 1, 7, 41, 59, 161, 295, 503, 595, 3021, 455, 3991, 8617, 65361, 107239, 83205}}, {15626, 18, 37264, {1, 3, 3, 15, 17, 41, 61, 229, 273, 687, 657, 1969, 2817, 2367, 29183, 41199, 24123, 184081}}, {15627, 18, 37276, {1, 3, 7, 5, 25, 63, 43, 65, 443, 423, 549, 2031, 3353, 7041, 6563, 18819, 46047, 239823}}, {15628, 18, 37327, {1, 3, 3, 3, 3, 17, 13, 115, 377, 623, 1959, 127, 5125, 13209, 24731, 23151, 21303, 7213}}, {15629, 18, 37355, {1, 1, 7, 1, 21, 11, 21, 41, 491, 37, 1759, 2771, 1301, 12995, 17621, 30907, 75511, 82321}}, {15630, 18, 37403, {1, 3, 3, 13, 13, 23, 77, 211, 215, 711, 427, 2213, 8041, 1595, 26105, 39051, 105407, 242141}}, {15631, 18, 37415, {1, 3, 3, 9, 13, 35, 117, 207, 75, 395, 723, 3321, 6643, 2429, 10043, 10585, 3529, 64067}}, {15632, 18, 37422, {1, 1, 1, 7, 3, 1, 83, 93, 311, 157, 891, 1717, 7669, 16067, 11775, 27693, 11757, 94471}}, {15633, 18, 37448, {1, 3, 3, 5, 17, 63, 23, 177, 289, 921, 315, 3083, 5903, 8697, 22425, 37845, 31171, 49237}}, {15634, 18, 37451, {1, 1, 7, 9, 21, 63, 29, 227, 427, 271, 525, 2071, 7103, 8389, 29185, 51601, 110737, 16949}}, {15635, 18, 37478, {1, 3, 3, 3, 3, 49, 25, 173, 79, 343, 509, 1939, 6389, 15501, 20135, 54365, 69931, 135269}}, {15636, 18, 37484, {1, 1, 3, 3, 21, 23, 41, 71, 169, 947, 1027, 2345, 3397, 12181, 15409, 31725, 41223, 58837}}, {15637, 18, 37525, {1, 3, 7, 1, 19, 23, 57, 201, 27, 449, 1479, 921, 4703, 10949, 14369, 27929, 45399, 46055}}, {15638, 18, 37553, {1, 1, 3, 9, 13, 17, 125, 17, 393, 295, 497, 3089, 6589, 4003, 8687, 48145, 2683, 175521}}, {15639, 18, 37640, {1, 3, 3, 15, 15, 13, 3, 31, 51, 101, 973, 101, 3709, 13437, 51, 14293, 21561, 136497}}, {15640, 18, 37645, {1, 1, 5, 11, 17, 27, 51, 45, 77, 539, 225, 2029, 533, 153, 26085, 33611, 28153, 75671}}, {15641, 18, 37658, {1, 1, 1, 15, 3, 59, 59, 123, 475, 225, 1613, 3121, 2865, 4647, 14553, 35449, 121657, 37457}}, {15642, 18, 37667, {1, 1, 5, 1, 27, 33, 121, 225, 57, 619, 1293, 3813, 2121, 3525, 21995, 47253, 33095, 257451}}, {15643, 18, 37708, {1, 3, 1, 11, 11, 43, 115, 233, 335, 185, 989, 3567, 4135, 2357, 20559, 43325, 43015, 51695}}, {15644, 18, 37723, {1, 1, 5, 9, 11, 49, 45, 187, 93, 967, 1609, 2511, 1549, 4045, 21309, 16341, 13495, 214827}}, {15645, 18, 37732, {1, 1, 1, 13, 21, 23, 81, 7, 259, 483, 1059, 773, 5297, 10123, 9857, 61187, 47355, 76307}}, {15646, 18, 37747, {1, 3, 7, 9, 29, 51, 113, 255, 223, 853, 1173, 1019, 1587, 9629, 22373, 32731, 125179, 193271}}, {15647, 18, 37753, {1, 1, 5, 11, 3, 55, 25, 145, 347, 451, 1447, 3399, 5873, 11579, 11107, 64707, 10161, 142003}}, {15648, 18, 37772, {1, 1, 1, 7, 15, 49, 109, 93, 267, 919, 177, 2247, 8129, 8039, 15629, 63767, 98153, 143255}}, {15649, 18, 37789, {1, 1, 5, 3, 3, 27, 47, 151, 231, 35, 155, 2745, 7349, 6543, 14117, 19549, 54927, 10819}}, {15650, 18, 37817, {1, 3, 7, 15, 31, 29, 17, 203, 249, 169, 1071, 3069, 6269, 3455, 27177, 33761, 111003, 4527}}, {15651, 18, 37826, {1, 3, 1, 5, 31, 15, 65, 189, 3, 917, 857, 1221, 3553, 2883, 3631, 32971, 68057, 109081}}, {15652, 18, 37831, {1, 3, 1, 9, 3, 55, 127, 57, 125, 463, 199, 317, 3373, 967, 5569, 55997, 17167, 33585}}, {15653, 18, 37845, {1, 3, 5, 1, 9, 57, 15, 89, 335, 119, 1445, 1931, 4177, 2495, 27507, 8209, 60003, 29657}}, {15654, 18, 37855, {1, 3, 5, 7, 15, 43, 83, 117, 283, 131, 653, 57, 6789, 7633, 30525, 64131, 101981, 122017}}, {15655, 18, 37859, {1, 3, 7, 11, 3, 17, 115, 217, 391, 825, 1633, 885, 7787, 5595, 12235, 30233, 53587, 62985}}, {15656, 18, 37866, {1, 1, 5, 3, 5, 13, 99, 1, 75, 329, 1247, 107, 2337, 4201, 6217, 12273, 41585, 46563}}, {15657, 18, 37880, {1, 3, 1, 15, 25, 53, 33, 125, 311, 955, 161, 3631, 581, 11915, 4223, 63207, 16517, 201665}}, {15658, 18, 37885, {1, 1, 5, 1, 27, 23, 93, 211, 483, 691, 949, 1825, 391, 12111, 13639, 61009, 88503, 104823}}, {15659, 18, 37897, {1, 3, 1, 13, 3, 9, 51, 133, 259, 977, 697, 661, 7661, 3987, 8327, 50155, 112235, 236135}}, {15660, 18, 37906, {1, 1, 3, 13, 7, 39, 121, 37, 151, 973, 1275, 2699, 3345, 7167, 19245, 55535, 12305, 33567}}, {15661, 18, 37948, {1, 1, 1, 1, 27, 5, 91, 63, 409, 579, 459, 2335, 4721, 3305, 11293, 15405, 74513, 157863}}, {15662, 18, 37954, {1, 1, 5, 1, 21, 45, 55, 111, 475, 381, 659, 1131, 3575, 5165, 27221, 46757, 53587, 90741}}, {15663, 18, 37978, {1, 1, 5, 15, 11, 31, 121, 209, 69, 389, 779, 2833, 4519, 1801, 4363, 24723, 105849, 54475}}, {15664, 18, 37980, {1, 1, 3, 9, 7, 19, 11, 75, 275, 77, 1997, 1661, 6139, 13165, 30653, 49469, 67053, 3811}}, {15665, 18, 37990, {1, 1, 3, 9, 5, 11, 5, 151, 395, 715, 1381, 3011, 5939, 1805, 8063, 62877, 99749, 112951}}, {15666, 18, 38001, {1, 1, 5, 13, 19, 15, 113, 47, 455, 173, 1897, 701, 6093, 2089, 3977, 20599, 60947, 23671}}, {15667, 18, 38020, {1, 1, 1, 13, 23, 19, 13, 117, 275, 313, 1683, 2975, 179, 3949, 4361, 60211, 91999, 211219}}, {15668, 18, 38029, {1, 3, 5, 15, 13, 53, 83, 161, 491, 1001, 1773, 1227, 1965, 14479, 17677, 24399, 86431, 203303}}, {15669, 18, 38047, {1, 1, 7, 15, 5, 51, 103, 131, 351, 747, 1227, 2859, 6693, 10615, 29485, 6619, 106239, 148739}}, {15670, 18, 38063, {1, 3, 5, 1, 9, 43, 91, 173, 223, 393, 1181, 3785, 6589, 1299, 10217, 20891, 64125, 63409}}, {15671, 18, 38077, {1, 1, 5, 7, 11, 23, 45, 57, 397, 771, 511, 1849, 343, 14139, 26271, 56241, 52581, 163187}}, {15672, 18, 38110, {1, 3, 7, 5, 15, 59, 89, 151, 255, 247, 291, 219, 995, 10821, 1445, 35581, 88767, 16871}}, {15673, 18, 38116, {1, 1, 7, 11, 7, 25, 3, 175, 253, 193, 1641, 1669, 7095, 11871, 10801, 42567, 120663, 109347}}, {15674, 18, 38119, {1, 3, 5, 7, 31, 41, 119, 39, 149, 653, 153, 2783, 1377, 5223, 17915, 3127, 41869, 193477}}, {15675, 18, 38176, {1, 3, 3, 13, 23, 19, 47, 85, 487, 103, 237, 2363, 4451, 5077, 23749, 17011, 73561, 169165}}, {15676, 18, 38186, {1, 1, 3, 9, 21, 25, 77, 235, 53, 681, 1463, 2093, 1525, 12797, 5469, 54277, 15587, 68395}}, {15677, 18, 38194, {1, 1, 1, 15, 23, 63, 63, 225, 239, 143, 1073, 199, 3231, 1371, 11215, 5999, 100705, 174681}}, {15678, 18, 38218, {1, 1, 1, 3, 17, 25, 69, 179, 445, 695, 281, 379, 8115, 9443, 13221, 50669, 37369, 62151}}, {15679, 18, 38241, {1, 3, 3, 9, 11, 29, 21, 89, 441, 353, 401, 1139, 5003, 8087, 24457, 50237, 110993, 117233}}, {15680, 18, 38247, {1, 3, 3, 1, 13, 45, 31, 249, 295, 149, 591, 2071, 3611, 931, 16261, 8239, 82767, 195665}}, {15681, 18, 38261, {1, 3, 3, 9, 19, 47, 69, 177, 493, 231, 431, 1359, 6867, 7641, 15661, 25285, 65477, 212643}}, {15682, 18, 38268, {1, 3, 3, 13, 19, 63, 83, 153, 367, 407, 547, 661, 7743, 5473, 2993, 62937, 33811, 101313}}, {15683, 18, 38277, {1, 3, 5, 3, 29, 17, 19, 203, 79, 279, 1333, 1851, 51, 9793, 12955, 17383, 73437, 121743}}, {15684, 18, 38287, {1, 1, 1, 11, 11, 43, 31, 187, 463, 827, 1511, 225, 845, 8963, 1553, 61269, 122033, 245633}}, {15685, 18, 38295, {1, 1, 3, 3, 31, 23, 9, 241, 377, 317, 655, 2197, 2461, 13239, 15649, 7879, 55085, 129855}}, {15686, 18, 38299, {1, 3, 5, 7, 9, 37, 1, 191, 185, 145, 1567, 3423, 1127, 1991, 10741, 38407, 22915, 222845}}, {15687, 18, 38301, {1, 1, 5, 3, 27, 31, 11, 227, 307, 973, 745, 1079, 7479, 10065, 31389, 19195, 114775, 246615}}, {15688, 18, 38305, {1, 3, 1, 11, 29, 27, 11, 83, 205, 399, 1489, 739, 715, 7955, 16473, 21127, 62379, 260399}}, {15689, 18, 38312, {1, 3, 3, 3, 25, 25, 123, 163, 399, 841, 963, 2089, 4949, 13085, 19831, 15345, 60377, 164235}}, {15690, 18, 38315, {1, 1, 1, 9, 3, 21, 101, 105, 397, 23, 1505, 3201, 547, 295, 23247, 18823, 115243, 151073}}, {15691, 18, 38317, {1, 3, 7, 1, 31, 27, 111, 23, 205, 709, 1625, 3921, 6225, 11039, 29549, 51239, 119003, 133663}}, {15692, 18, 38343, {1, 3, 3, 11, 21, 49, 111, 195, 25, 833, 1991, 563, 7031, 15429, 5707, 12351, 32221, 16599}}, {15693, 18, 38344, {1, 1, 5, 7, 5, 7, 39, 171, 39, 921, 385, 2343, 625, 15355, 4923, 36597, 56901, 148377}}, {15694, 18, 38350, {1, 1, 3, 15, 7, 43, 89, 217, 67, 271, 853, 147, 6767, 3183, 341, 40769, 116767, 22351}}, {15695, 18, 38358, {1, 3, 5, 7, 7, 3, 105, 27, 183, 59, 953, 4027, 1277, 10323, 29437, 56085, 32677, 198067}}, {15696, 18, 38364, {1, 1, 1, 15, 23, 29, 51, 209, 13, 177, 1103, 1723, 2877, 9199, 25601, 15537, 8599, 230819}}, {15697, 18, 38371, {1, 1, 7, 1, 29, 39, 41, 217, 467, 423, 431, 2707, 2017, 11865, 11989, 12045, 71349, 6311}}, {15698, 18, 38373, {1, 1, 1, 13, 15, 25, 3, 55, 403, 833, 1843, 1159, 1703, 2221, 15379, 65027, 18327, 108881}}, {15699, 18, 38377, {1, 3, 7, 13, 3, 27, 13, 227, 215, 873, 1073, 1117, 7941, 13607, 7571, 6957, 44991, 239761}}, {15700, 18, 38392, {1, 3, 7, 11, 23, 1, 95, 235, 283, 977, 1443, 161, 5937, 4351, 30835, 35569, 57509, 1835}}, {15701, 18, 38407, {1, 3, 3, 13, 11, 1, 85, 75, 261, 543, 9, 899, 5821, 5465, 9771, 53707, 101003, 219215}}, {15702, 18, 38408, {1, 3, 1, 7, 21, 49, 35, 19, 35, 759, 1467, 1423, 6355, 8415, 563, 24157, 121029, 87309}}, {15703, 18, 38421, {1, 1, 7, 1, 9, 13, 65, 85, 209, 583, 387, 1743, 2665, 12021, 7525, 27665, 45885, 135039}}, {15704, 18, 38438, {1, 1, 7, 11, 29, 41, 91, 17, 291, 211, 1801, 493, 899, 14491, 1741, 28971, 35205, 131417}}, {15705, 18, 38442, {1, 1, 5, 13, 23, 55, 119, 165, 61, 653, 1375, 3575, 5081, 7767, 19963, 61583, 107149, 240639}}, {15706, 18, 38464, {1, 3, 5, 15, 25, 3, 51, 27, 127, 259, 55, 2221, 3951, 6243, 15825, 42881, 37009, 254401}}, {15707, 18, 38473, {1, 3, 5, 11, 25, 63, 13, 105, 111, 677, 1545, 2399, 4419, 10853, 7213, 17183, 103411, 67459}}, {15708, 18, 38484, {1, 1, 1, 11, 11, 31, 73, 125, 155, 545, 1857, 2749, 6389, 4083, 16239, 23651, 68881, 43455}}, {15709, 18, 38491, {1, 3, 7, 7, 21, 3, 117, 237, 431, 17, 687, 2613, 7483, 3253, 30511, 53833, 33077, 157055}}, {15710, 18, 38510, {1, 1, 1, 1, 1, 57, 65, 97, 415, 477, 1003, 1415, 1493, 12993, 30965, 24809, 1467, 213021}}, {15711, 18, 38518, {1, 1, 3, 7, 25, 33, 45, 25, 511, 733, 1077, 2483, 5899, 14295, 11631, 50609, 128989, 45177}}, {15712, 18, 38531, {1, 1, 3, 3, 25, 17, 115, 31, 115, 191, 293, 3991, 3039, 6751, 16217, 16517, 21121, 193641}}, {15713, 18, 38537, {1, 3, 3, 13, 25, 23, 7, 51, 363, 641, 333, 2533, 605, 1105, 12941, 4195, 129571, 13253}}, {15714, 18, 38538, {1, 3, 1, 11, 17, 21, 7, 205, 293, 159, 9, 441, 3287, 10247, 2115, 54099, 128109, 8137}}, {15715, 18, 38567, {1, 1, 7, 5, 21, 17, 43, 87, 117, 737, 149, 3175, 343, 8509, 12147, 22041, 80037, 23277}}, {15716, 18, 38594, {1, 3, 3, 1, 3, 7, 101, 245, 11, 1003, 175, 2323, 7807, 15611, 5161, 10277, 37009, 83231}}, {15717, 18, 38647, {1, 3, 1, 5, 13, 17, 113, 75, 315, 237, 77, 587, 5409, 2053, 22551, 15205, 82545, 18531}}, {15718, 18, 38651, {1, 3, 5, 11, 9, 57, 61, 117, 281, 111, 369, 2411, 1691, 3391, 5379, 8237, 87329, 4253}}, {15719, 18, 38654, {1, 3, 3, 3, 19, 25, 101, 1, 495, 25, 1317, 2333, 6183, 12215, 27879, 56403, 37169, 71635}}, {15720, 18, 38686, {1, 1, 3, 5, 17, 63, 49, 127, 171, 405, 1763, 3697, 405, 2233, 4137, 28787, 108319, 53133}}, {15721, 18, 38702, {1, 1, 5, 7, 23, 43, 87, 189, 97, 239, 1459, 2115, 7517, 7799, 28957, 37105, 71835, 199195}}, {15722, 18, 38751, {1, 3, 1, 3, 25, 25, 23, 61, 369, 717, 1711, 1103, 7535, 9871, 25, 26849, 55955, 113389}}, {15723, 18, 38821, {1, 1, 1, 11, 25, 57, 33, 175, 127, 541, 1031, 2847, 2069, 4033, 25593, 10615, 50097, 122955}}, {15724, 18, 38825, {1, 3, 3, 13, 11, 27, 97, 171, 245, 33, 213, 4069, 753, 3535, 11727, 34941, 100543, 220789}}, {15725, 18, 38853, {1, 3, 3, 9, 3, 17, 13, 237, 477, 507, 1751, 3191, 3385, 13977, 23355, 57355, 64341, 37683}}, {15726, 18, 38863, {1, 1, 7, 13, 13, 43, 7, 153, 209, 7, 63, 585, 1715, 13313, 25355, 46759, 71893, 29755}}, {15727, 18, 38882, {1, 3, 3, 3, 11, 23, 11, 147, 135, 1011, 1105, 3931, 3861, 13589, 32183, 30727, 37685, 67123}}, {15728, 18, 38884, {1, 3, 7, 1, 11, 13, 25, 229, 147, 843, 329, 3337, 7559, 13193, 3011, 31549, 102461, 46195}}, {15729, 18, 38932, {1, 1, 5, 11, 5, 47, 127, 89, 53, 663, 261, 541, 7743, 13037, 9013, 23079, 81225, 239875}}, {15730, 18, 38941, {1, 1, 7, 3, 5, 39, 15, 177, 357, 357, 1959, 1721, 6703, 11829, 1195, 42113, 88699, 244347}}, {15731, 18, 38952, {1, 1, 5, 15, 25, 19, 7, 3, 225, 773, 1535, 99, 6555, 4105, 19137, 56155, 109141, 161015}}, {15732, 18, 38960, {1, 1, 5, 15, 5, 59, 41, 53, 203, 459, 1063, 3015, 5397, 1559, 20835, 57773, 67687, 206189}}, {15733, 18, 38980, {1, 3, 1, 11, 17, 25, 61, 221, 37, 809, 1461, 1961, 7697, 1777, 23179, 54761, 7787, 177737}}, {15734, 18, 38995, {1, 3, 7, 15, 27, 21, 49, 107, 353, 677, 461, 239, 5871, 1059, 3011, 32397, 13149, 103973}}, {15735, 18, 39004, {1, 1, 5, 3, 11, 53, 61, 239, 479, 913, 479, 3435, 4979, 7931, 16841, 60077, 26667, 212601}}, {15736, 18, 39013, {1, 1, 3, 5, 3, 19, 43, 143, 353, 507, 871, 2547, 7321, 6163, 9425, 62911, 86153, 239011}}, {15737, 18, 39017, {1, 1, 1, 3, 15, 7, 115, 43, 69, 299, 1235, 1511, 3111, 7465, 769, 46981, 127707, 195839}}, {15738, 18, 39026, {1, 1, 1, 5, 23, 27, 19, 21, 273, 291, 953, 3577, 3147, 3863, 18625, 53505, 33699, 123305}}, {15739, 18, 39056, {1, 3, 5, 9, 3, 11, 89, 27, 447, 119, 493, 2605, 8175, 8837, 27555, 2319, 99101, 79121}}, {15740, 18, 39121, {1, 1, 7, 11, 1, 11, 77, 129, 97, 261, 1241, 3117, 1627, 5397, 6495, 52339, 52711, 206237}}, {15741, 18, 39124, {1, 3, 7, 9, 27, 57, 77, 147, 35, 845, 1417, 1615, 6097, 12559, 10765, 19027, 91693, 204339}}, {15742, 18, 39133, {1, 1, 3, 5, 25, 47, 17, 145, 7, 969, 1981, 733, 4303, 7785, 4241, 39733, 82569, 78061}}, {15743, 18, 39157, {1, 1, 5, 1, 5, 47, 45, 111, 405, 943, 1911, 1613, 3817, 10483, 17729, 7201, 88033, 261701}}, {15744, 18, 39181, {1, 3, 3, 13, 9, 3, 87, 39, 277, 769, 57, 2503, 7803, 11041, 20945, 19623, 32617, 110027}}, {15745, 18, 39187, {1, 1, 3, 3, 27, 57, 1, 103, 427, 935, 1617, 665, 837, 8001, 13543, 44771, 64033, 65239}}, {15746, 18, 39212, {1, 1, 5, 3, 13, 21, 31, 59, 225, 945, 1825, 1511, 3273, 3171, 30347, 21993, 40203, 143297}}, {15747, 18, 39223, {1, 3, 5, 7, 11, 3, 3, 217, 167, 885, 975, 3249, 7909, 13621, 18697, 61021, 31497, 198033}}, {15748, 18, 39250, {1, 3, 5, 9, 11, 5, 87, 33, 117, 471, 267, 529, 5879, 13969, 5731, 52613, 106411, 74341}}, {15749, 18, 39265, {1, 1, 7, 11, 5, 31, 25, 55, 135, 779, 717, 1953, 7929, 11011, 6133, 14099, 106975, 178337}}, {15750, 18, 39320, {1, 3, 1, 1, 29, 17, 125, 7, 445, 299, 1897, 3235, 8189, 14339, 14725, 63185, 126751, 88747}}, {15751, 18, 39330, {1, 1, 5, 3, 1, 11, 65, 161, 243, 605, 1945, 3141, 6443, 9703, 13331, 2239, 6315, 247595}}, {15752, 18, 39335, {1, 3, 1, 7, 15, 23, 83, 215, 331, 631, 453, 879, 4109, 4897, 16535, 55749, 90799, 147287}}, {15753, 18, 39353, {1, 3, 5, 13, 25, 1, 109, 205, 49, 471, 1735, 973, 1279, 9917, 18225, 44921, 98519, 211541}}, {15754, 18, 39371, {1, 1, 5, 11, 29, 41, 113, 187, 75, 479, 1633, 841, 6259, 8919, 27751, 25179, 115369, 166567}}, {15755, 18, 39385, {1, 3, 5, 11, 17, 31, 107, 41, 435, 647, 811, 2937, 5819, 3483, 3835, 57033, 53543, 61973}}, {15756, 18, 39421, {1, 3, 3, 11, 15, 45, 33, 103, 505, 67, 463, 1275, 2449, 15261, 22867, 25215, 38793, 189309}}, {15757, 18, 39432, {1, 1, 1, 5, 19, 45, 35, 173, 365, 39, 1599, 3623, 2231, 12141, 19437, 27053, 15869, 104719}}, {15758, 18, 39443, {1, 3, 7, 7, 9, 17, 87, 151, 249, 81, 1109, 1951, 7475, 1699, 17847, 64149, 50285, 242793}}, {15759, 18, 39450, {1, 3, 5, 13, 15, 51, 35, 105, 479, 763, 1945, 2349, 2987, 621, 283, 20411, 65799, 86517}}, {15760, 18, 39455, {1, 3, 3, 1, 19, 31, 49, 229, 249, 689, 737, 4027, 5405, 15211, 26785, 39143, 93163, 190421}}, {15761, 18, 39468, {1, 3, 7, 5, 1, 21, 63, 97, 347, 73, 745, 3455, 2347, 3821, 31385, 6545, 91803, 72895}}, {15762, 18, 39473, {1, 1, 1, 15, 23, 11, 107, 47, 183, 235, 1985, 3277, 933, 8491, 14423, 24293, 6783, 162199}}, {15763, 18, 39488, {1, 3, 3, 9, 17, 3, 123, 59, 277, 773, 1617, 2979, 1555, 9753, 10947, 24745, 89043, 45185}}, {15764, 18, 39497, {1, 3, 7, 3, 25, 17, 79, 43, 311, 415, 1045, 1289, 7451, 11413, 11319, 37177, 101327, 147453}}, {15765, 18, 39521, {1, 3, 7, 7, 17, 45, 49, 33, 313, 613, 1773, 773, 161, 13579, 1207, 5681, 120597, 178639}}, {15766, 18, 39531, {1, 3, 5, 5, 17, 43, 65, 243, 287, 223, 253, 687, 887, 14887, 1077, 53337, 62381, 43531}}, {15767, 18, 39542, {1, 3, 5, 1, 21, 3, 39, 149, 497, 939, 1537, 437, 5345, 10321, 25151, 48785, 49879, 90945}}, {15768, 18, 39585, {1, 1, 7, 11, 1, 61, 113, 63, 285, 615, 343, 2897, 1939, 7911, 16387, 10781, 92769, 27995}}, {15769, 18, 39605, {1, 1, 3, 3, 19, 29, 85, 227, 355, 857, 883, 1853, 5065, 13795, 5749, 59107, 57947, 35775}}, {15770, 18, 39658, {1, 3, 5, 9, 23, 37, 119, 161, 23, 511, 81, 973, 4769, 10821, 32607, 61731, 64907, 99055}}, {15771, 18, 39677, {1, 3, 1, 3, 11, 17, 109, 241, 349, 887, 1651, 3865, 2045, 15893, 4597, 11557, 53313, 48489}}, {15772, 18, 39703, {1, 1, 5, 9, 31, 43, 49, 193, 171, 477, 363, 735, 1379, 8977, 9759, 56477, 99495, 170433}}, {15773, 18, 39726, {1, 1, 3, 7, 25, 25, 77, 31, 21, 1001, 1527, 1725, 6479, 8927, 11249, 63969, 86291, 74391}}, {15774, 18, 39731, {1, 3, 5, 13, 1, 43, 27, 7, 507, 569, 251, 2199, 3895, 7845, 13641, 1655, 112949, 119493}}, {15775, 18, 39745, {1, 3, 7, 15, 7, 1, 123, 27, 121, 261, 201, 1469, 4229, 2933, 25157, 1919, 127937, 21607}}, {15776, 18, 39776, {1, 1, 3, 9, 29, 59, 47, 81, 293, 191, 401, 849, 4355, 1643, 23533, 8469, 389, 97891}}, {15777, 18, 39796, {1, 3, 5, 5, 9, 55, 37, 175, 203, 179, 901, 3473, 1489, 1009, 24623, 54895, 8711, 190271}}, {15778, 18, 39809, {1, 1, 7, 1, 13, 39, 49, 105, 385, 189, 1079, 2799, 5901, 2511, 23199, 58925, 111727, 131193}}, {15779, 18, 39833, {1, 1, 1, 7, 31, 63, 37, 181, 493, 745, 1131, 223, 8055, 9507, 26667, 22163, 26495, 200945}}, {15780, 18, 39850, {1, 3, 7, 1, 25, 15, 127, 71, 445, 935, 1439, 1167, 3751, 799, 27253, 46209, 33413, 38553}}, {15781, 18, 39869, {1, 3, 3, 11, 29, 35, 125, 77, 129, 851, 731, 3259, 4651, 4137, 20921, 19779, 119261, 141507}}, {15782, 18, 39882, {1, 3, 1, 9, 11, 13, 31, 211, 87, 377, 547, 113, 1071, 7167, 28377, 52943, 50669, 156915}}, {15783, 18, 39906, {1, 1, 3, 7, 29, 55, 89, 215, 425, 513, 175, 1145, 6995, 1929, 14253, 20563, 118543, 104403}}, {15784, 18, 39918, {1, 1, 1, 5, 23, 25, 1, 23, 175, 571, 1597, 3801, 1411, 1783, 13045, 37499, 86831, 139101}}, {15785, 18, 39929, {1, 3, 3, 13, 15, 19, 35, 139, 483, 17, 1555, 3431, 3417, 13695, 15985, 65243, 96659, 76027}}, {15786, 18, 39947, {1, 3, 7, 9, 23, 7, 17, 89, 33, 353, 1999, 2561, 331, 15661, 25757, 63389, 112913, 131757}}, {15787, 18, 39985, {1, 3, 1, 11, 27, 59, 37, 75, 121, 429, 1833, 3243, 2029, 2601, 5013, 29433, 123565, 234803}}, {15788, 18, 39986, {1, 3, 1, 7, 31, 13, 33, 25, 459, 803, 267, 1573, 5579, 4575, 8125, 7491, 72681, 239409}}, {15789, 18, 40023, {1, 1, 3, 7, 31, 43, 93, 191, 237, 75, 1809, 3257, 4131, 1983, 29153, 23205, 38393, 197859}}, {15790, 18, 40024, {1, 3, 5, 5, 17, 47, 17, 153, 499, 529, 1515, 1587, 2951, 12431, 12787, 13245, 54117, 82663}}, {15791, 18, 40039, {1, 1, 1, 13, 7, 23, 23, 7, 441, 991, 641, 2713, 151, 1863, 6065, 47381, 60493, 136325}}, {15792, 18, 40053, {1, 3, 3, 11, 11, 15, 31, 137, 285, 439, 835, 3033, 6083, 7883, 3405, 35803, 65059, 150143}}, {15793, 18, 40079, {1, 1, 7, 3, 19, 47, 61, 163, 313, 813, 1315, 2995, 2805, 14397, 6589, 62123, 46229, 206697}}, {15794, 18, 40084, {1, 3, 5, 5, 27, 51, 25, 99, 241, 571, 1411, 1191, 7095, 8639, 29195, 53733, 53219, 42851}}, {15795, 18, 40087, {1, 3, 1, 5, 11, 29, 1, 49, 61, 149, 1931, 29, 7163, 3717, 525, 42375, 71451, 8345}}, {15796, 18, 40094, {1, 3, 3, 3, 13, 19, 97, 249, 265, 509, 1347, 3081, 6535, 7941, 31565, 59897, 91909, 171789}}, {15797, 18, 40100, {1, 3, 3, 1, 25, 17, 75, 169, 251, 607, 73, 549, 1397, 10661, 1743, 9615, 41327, 243207}}, {15798, 18, 40112, {1, 3, 1, 11, 7, 7, 15, 181, 385, 883, 651, 2939, 5457, 15309, 9807, 22221, 72893, 146331}}, {15799, 18, 40129, {1, 3, 3, 5, 7, 7, 53, 75, 139, 459, 1861, 917, 4101, 10379, 18555, 12633, 70023, 254761}}, {15800, 18, 40132, {1, 3, 3, 1, 17, 51, 5, 109, 471, 3, 1555, 3731, 6711, 9791, 63, 61931, 75269, 138697}}, {15801, 18, 40142, {1, 1, 7, 15, 11, 1, 53, 141, 423, 567, 1937, 849, 5657, 7437, 32657, 16253, 115219, 106027}}, {15802, 18, 40154, {1, 3, 5, 1, 17, 29, 65, 213, 443, 541, 697, 3859, 1463, 16081, 23299, 7645, 19475, 77857}}, {15803, 18, 40177, {1, 1, 7, 3, 21, 43, 99, 101, 329, 755, 1123, 1277, 1381, 7017, 21763, 28243, 109995, 178377}}, {15804, 18, 40178, {1, 3, 5, 7, 9, 31, 103, 123, 43, 895, 1925, 3383, 3539, 13669, 873, 57361, 45281, 256517}}, {15805, 18, 40202, {1, 1, 1, 13, 1, 37, 115, 55, 415, 703, 1217, 939, 1145, 4015, 7233, 44799, 79711, 164725}}, {15806, 18, 40219, {1, 1, 7, 1, 29, 17, 101, 15, 205, 281, 1059, 301, 753, 11953, 10533, 31881, 67741, 12683}}, {15807, 18, 40303, {1, 1, 7, 13, 9, 23, 31, 237, 181, 813, 1765, 2237, 4897, 9955, 2139, 13113, 123423, 227629}}, {15808, 18, 40305, {1, 1, 7, 15, 27, 57, 37, 75, 405, 185, 1671, 2245, 7151, 10531, 13161, 15695, 107547, 47689}}, {15809, 18, 40311, {1, 1, 5, 15, 17, 53, 75, 251, 277, 1001, 179, 589, 1401, 4937, 11601, 47113, 36677, 39263}}, {15810, 18, 40336, {1, 3, 5, 15, 23, 47, 53, 81, 115, 547, 1363, 2457, 4407, 10861, 25649, 64013, 44747, 97949}}, {15811, 18, 40342, {1, 1, 3, 1, 25, 29, 121, 43, 205, 591, 211, 1899, 5835, 739, 19627, 60387, 127369, 11255}}, {15812, 18, 40358, {1, 1, 3, 15, 31, 11, 93, 227, 501, 731, 1355, 3963, 347, 83, 12595, 56431, 80049, 42103}}, {15813, 18, 40381, {1, 3, 1, 11, 13, 17, 51, 165, 311, 67, 1873, 1493, 3815, 13209, 11637, 5809, 94219, 118077}}, {15814, 18, 40417, {1, 1, 7, 15, 19, 17, 13, 73, 365, 413, 1215, 2265, 2173, 8725, 4725, 1373, 76733, 95379}}, {15815, 18, 40438, {1, 3, 1, 7, 7, 61, 13, 145, 205, 113, 1579, 3851, 7515, 10659, 28665, 5277, 65925, 10141}}, {15816, 18, 40463, {1, 3, 7, 1, 9, 63, 11, 83, 197, 797, 1065, 1521, 1751, 7423, 7473, 4371, 29533, 225167}}, {15817, 18, 40471, {1, 3, 7, 7, 3, 63, 71, 177, 53, 279, 1837, 2609, 7819, 7285, 11059, 65247, 102869, 24429}}, {15818, 18, 40472, {1, 3, 3, 13, 9, 21, 123, 125, 367, 85, 85, 1009, 1009, 7779, 3375, 30999, 5035, 215107}}, {15819, 18, 40488, {1, 3, 3, 9, 31, 53, 5, 43, 483, 483, 1359, 2605, 377, 4243, 13291, 50211, 118603, 259865}}, {15820, 18, 40491, {1, 1, 1, 5, 19, 37, 109, 139, 373, 79, 1951, 3379, 5679, 6445, 29127, 56229, 97369, 232561}}, {15821, 18, 40525, {1, 1, 3, 5, 19, 37, 61, 225, 321, 573, 1831, 971, 6507, 10005, 6837, 16433, 70913, 170873}}, {15822, 18, 40526, {1, 1, 5, 11, 31, 17, 21, 29, 329, 679, 869, 389, 5121, 1819, 3539, 43793, 31617, 204983}}, {15823, 18, 40550, {1, 1, 7, 7, 21, 11, 83, 97, 297, 275, 1559, 1899, 4957, 11463, 25647, 21095, 70121, 113395}}, {15824, 18, 40553, {1, 3, 5, 11, 19, 57, 39, 37, 441, 715, 383, 4083, 1937, 12263, 6989, 36159, 118135, 238475}}, {15825, 18, 40562, {1, 1, 1, 3, 9, 53, 85, 201, 357, 807, 865, 1621, 1993, 7623, 3165, 1005, 93343, 227765}}, {15826, 18, 40568, {1, 1, 7, 7, 21, 29, 123, 175, 319, 621, 303, 117, 5589, 12511, 26053, 41603, 78439, 71819}}, {15827, 18, 40580, {1, 1, 7, 15, 31, 47, 75, 225, 295, 67, 1349, 1749, 1363, 8763, 9153, 4059, 72015, 3155}}, {15828, 18, 40608, {1, 3, 5, 13, 19, 23, 79, 25, 319, 475, 1517, 2757, 4009, 12663, 535, 51617, 55695, 64399}}, {15829, 18, 40613, {1, 3, 7, 13, 19, 39, 61, 235, 369, 951, 111, 2169, 353, 15371, 8611, 42477, 130981, 97419}}, {15830, 18, 40652, {1, 1, 3, 13, 27, 31, 115, 201, 3, 291, 793, 237, 3593, 2307, 12745, 54603, 96451, 80853}}, {15831, 18, 40703, {1, 3, 3, 11, 11, 35, 43, 1, 35, 415, 1307, 2303, 5407, 6883, 29023, 31271, 119721, 90599}}, {15832, 18, 40712, {1, 1, 5, 9, 21, 23, 3, 1, 333, 463, 1277, 1165, 6521, 4887, 16029, 32537, 43681, 21633}}, {15833, 18, 40720, {1, 1, 1, 13, 1, 35, 45, 57, 293, 435, 1113, 2477, 6641, 14083, 28489, 26189, 44695, 220481}}, {15834, 18, 40723, {1, 3, 5, 5, 5, 31, 75, 149, 309, 921, 941, 1063, 7041, 12651, 29533, 46955, 88133, 89989}}, {15835, 18, 40746, {1, 1, 3, 5, 15, 23, 127, 143, 193, 739, 281, 991, 3731, 16243, 25483, 24979, 102317, 186657}}, {15836, 18, 40759, {1, 1, 3, 13, 3, 63, 23, 69, 181, 163, 1733, 893, 5513, 1525, 31483, 15033, 108021, 167875}}, {15837, 18, 40765, {1, 1, 5, 15, 15, 51, 79, 59, 55, 243, 565, 159, 7925, 8393, 20059, 35011, 53779, 166241}}, {15838, 18, 40771, {1, 1, 3, 5, 11, 57, 85, 175, 495, 999, 1577, 2377, 715, 2473, 16979, 5949, 87691, 195607}}, {15839, 18, 40778, {1, 1, 1, 13, 17, 21, 53, 73, 187, 63, 335, 3251, 4439, 5701, 13469, 23567, 70125, 68931}}, {15840, 18, 40788, {1, 1, 1, 13, 23, 11, 55, 75, 37, 845, 745, 2193, 7113, 5657, 29449, 41153, 115547, 87261}}, {15841, 18, 40804, {1, 3, 3, 9, 21, 39, 47, 145, 301, 883, 625, 2479, 1089, 3393, 23265, 49577, 81027, 186485}}, {15842, 18, 40835, {1, 1, 3, 7, 3, 11, 37, 117, 79, 905, 493, 265, 1819, 12179, 12361, 27457, 14459, 231837}}, {15843, 18, 40841, {1, 3, 5, 11, 19, 45, 99, 5, 455, 497, 1851, 2349, 5213, 3671, 5871, 43187, 59011, 211167}}, {15844, 18, 40907, {1, 3, 7, 5, 23, 61, 63, 97, 413, 575, 1073, 2587, 573, 1805, 32307, 58463, 84927, 15065}}, {15845, 18, 40934, {1, 3, 1, 13, 23, 9, 39, 1, 53, 383, 1277, 3599, 7719, 16175, 4443, 53143, 24345, 111899}}, {15846, 18, 40955, {1, 1, 7, 1, 19, 37, 103, 245, 253, 5, 1367, 3127, 4689, 5089, 30697, 45513, 111291, 26599}}, {15847, 18, 40986, {1, 3, 3, 7, 31, 31, 107, 163, 1, 855, 163, 875, 7481, 5325, 30107, 19377, 3167, 5613}}, {15848, 18, 41007, {1, 1, 5, 13, 21, 17, 115, 203, 233, 333, 441, 3185, 3197, 3397, 8515, 61879, 11163, 233277}}, {15849, 18, 41016, {1, 3, 5, 3, 17, 53, 93, 233, 465, 573, 1075, 1905, 1141, 4965, 13469, 24901, 23653, 225233}}, {15850, 18, 41034, {1, 3, 7, 11, 11, 1, 95, 47, 85, 65, 9, 2413, 7347, 2127, 305, 4673, 79281, 188081}}, {15851, 18, 41041, {1, 1, 7, 5, 9, 5, 27, 23, 393, 201, 467, 3677, 2641, 4671, 24627, 18927, 45137, 74167}}, {15852, 18, 41063, {1, 3, 5, 11, 11, 9, 19, 247, 423, 693, 1885, 1129, 7459, 8411, 2573, 54111, 98919, 160075}}, {15853, 18, 41084, {1, 3, 3, 3, 1, 3, 67, 131, 317, 915, 151, 3609, 4083, 6395, 12877, 44017, 28877, 244165}}, {15854, 18, 41093, {1, 3, 1, 3, 1, 33, 29, 23, 19, 323, 873, 115, 2439, 4699, 5449, 51637, 68889, 105197}}, {15855, 18, 41097, {1, 1, 7, 1, 19, 55, 37, 241, 53, 695, 729, 1565, 19, 12875, 26993, 18511, 35615, 169281}}, {15856, 18, 41111, {1, 3, 3, 1, 1, 7, 121, 49, 345, 883, 1001, 657, 2647, 15387, 30633, 18107, 13745, 217735}}, {15857, 18, 41118, {1, 3, 5, 15, 11, 45, 73, 77, 307, 373, 1723, 335, 473, 5735, 11747, 39257, 87199, 47663}}, {15858, 18, 41121, {1, 1, 7, 7, 27, 21, 121, 169, 427, 605, 1593, 3147, 1001, 3773, 31505, 22823, 21543, 82931}}, {15859, 18, 41141, {1, 1, 1, 9, 11, 59, 91, 165, 249, 859, 483, 3133, 5729, 12675, 7761, 6475, 116823, 224187}}, {15860, 18, 41160, {1, 1, 3, 3, 27, 31, 51, 1, 429, 517, 1439, 3959, 2343, 6709, 5287, 24039, 52409, 20749}}, {15861, 18, 41207, {1, 3, 7, 7, 11, 31, 83, 111, 391, 729, 721, 1675, 5679, 14637, 22065, 49903, 113759, 40881}}, {15862, 18, 41214, {1, 3, 7, 1, 25, 15, 91, 59, 87, 313, 155, 1439, 2419, 2099, 22709, 10289, 40655, 17351}}, {15863, 18, 41255, {1, 3, 5, 1, 15, 5, 11, 21, 261, 227, 1563, 1177, 4731, 3487, 1607, 46599, 105599, 193425}}, {15864, 18, 41284, {1, 1, 5, 5, 5, 45, 77, 181, 431, 27, 1985, 881, 2555, 7589, 16199, 31041, 66683, 52499}}, {15865, 18, 41287, {1, 1, 1, 15, 5, 29, 111, 209, 335, 747, 93, 3551, 5951, 14995, 18451, 33329, 9117, 167455}}, {15866, 18, 41308, {1, 3, 1, 7, 25, 9, 113, 123, 387, 87, 267, 2251, 3509, 10829, 32733, 48025, 58267, 143553}}, {15867, 18, 41330, {1, 3, 5, 15, 17, 17, 65, 107, 175, 427, 733, 797, 3837, 12773, 27865, 29481, 4557, 196163}}, {15868, 18, 41336, {1, 3, 1, 3, 1, 53, 93, 175, 509, 351, 1093, 1039, 6931, 2691, 14957, 44395, 84383, 58915}}, {15869, 18, 41437, {1, 1, 1, 11, 1, 43, 61, 123, 377, 813, 1335, 1597, 147, 13663, 30781, 47635, 24111, 64307}}, {15870, 18, 41444, {1, 1, 3, 11, 25, 27, 15, 215, 125, 679, 1491, 3203, 5403, 4531, 11839, 44227, 49239, 110439}}, {15871, 18, 41456, {1, 1, 3, 13, 9, 35, 71, 127, 127, 629, 1363, 585, 6713, 10637, 6803, 20963, 47157, 157781}}, {15872, 18, 41481, {1, 1, 3, 11, 13, 21, 117, 241, 365, 175, 1397, 1279, 4117, 5427, 24007, 50711, 465, 225003}}, {15873, 18, 41489, {1, 1, 1, 9, 13, 63, 49, 189, 113, 61, 353, 2221, 7541, 4075, 5283, 5505, 51035, 35191}}, {15874, 18, 41499, {1, 1, 7, 9, 11, 37, 123, 63, 331, 691, 1299, 1661, 3769, 7827, 32127, 32149, 7271, 150363}}, {15875, 18, 41555, {1, 1, 1, 5, 25, 5, 127, 195, 413, 657, 479, 879, 6743, 8959, 791, 22425, 77119, 180721}}, {15876, 18, 41561, {1, 1, 7, 3, 13, 57, 123, 125, 135, 69, 455, 3363, 1783, 1557, 20401, 26707, 130345, 195881}}, {15877, 18, 41562, {1, 3, 3, 7, 27, 19, 125, 71, 201, 1017, 1285, 3955, 5255, 14375, 18163, 28537, 76157, 247193}}, {15878, 18, 41571, {1, 1, 3, 1, 27, 33, 123, 137, 189, 655, 1891, 2419, 5195, 97, 32565, 38581, 62715, 164697}}, {15879, 18, 41592, {1, 1, 1, 15, 9, 47, 23, 147, 197, 503, 1803, 2953, 2961, 13787, 10545, 35465, 53997, 198655}}, {15880, 18, 41631, {1, 3, 1, 9, 9, 43, 65, 237, 119, 621, 1517, 3479, 4165, 12797, 14731, 53131, 105501, 112845}}, {15881, 18, 41661, {1, 3, 3, 15, 3, 23, 47, 163, 469, 363, 1813, 3107, 6167, 8987, 26829, 33099, 6821, 203017}}, {15882, 18, 41682, {1, 1, 1, 9, 1, 11, 85, 11, 251, 907, 395, 3935, 3403, 229, 16825, 48337, 103647, 91425}}, {15883, 18, 41710, {1, 3, 1, 5, 17, 57, 21, 181, 31, 27, 235, 4041, 4927, 8319, 29765, 61603, 19081, 75879}}, {15884, 18, 41724, {1, 1, 5, 15, 11, 3, 7, 225, 247, 221, 251, 1979, 1151, 10829, 26491, 39705, 41587, 99063}}, {15885, 18, 41727, {1, 3, 5, 5, 19, 23, 57, 127, 467, 409, 43, 829, 3883, 10767, 24351, 31365, 115943, 209231}}, {15886, 18, 41730, {1, 1, 7, 15, 3, 51, 17, 251, 219, 33, 1511, 2027, 4995, 12277, 7639, 59895, 85267, 87735}}, {15887, 18, 41744, {1, 3, 7, 3, 7, 29, 93, 57, 427, 235, 1591, 3475, 1159, 2387, 851, 43307, 87081, 151543}}, {15888, 18, 41769, {1, 3, 7, 7, 1, 9, 21, 167, 73, 439, 2035, 2091, 4563, 4819, 5591, 57123, 78739, 63235}}, {15889, 18, 41795, {1, 1, 3, 13, 19, 35, 63, 17, 425, 277, 1669, 931, 597, 5621, 22367, 1155, 109099, 169965}}, {15890, 18, 41798, {1, 3, 7, 5, 11, 11, 41, 71, 35, 183, 555, 2631, 5199, 16381, 16319, 1851, 121551, 141711}}, {15891, 18, 41804, {1, 3, 5, 5, 21, 17, 3, 95, 47, 1011, 1757, 3295, 1111, 16043, 6377, 16257, 37941, 206637}}, {15892, 18, 41826, {1, 3, 1, 5, 25, 19, 19, 69, 395, 589, 1311, 1075, 5763, 12475, 3633, 40647, 54487, 97459}}, {15893, 18, 41852, {1, 3, 5, 7, 13, 23, 83, 91, 419, 415, 685, 1685, 2893, 12953, 30641, 43565, 11851, 187837}}, {15894, 18, 41868, {1, 1, 5, 11, 27, 1, 61, 155, 279, 737, 215, 2909, 969, 57, 17979, 34537, 41861, 243717}}, {15895, 18, 41910, {1, 1, 5, 1, 17, 61, 57, 199, 127, 569, 1109, 3057, 7301, 16097, 17579, 25753, 82653, 237273}}, {15896, 18, 41914, {1, 1, 7, 15, 17, 45, 19, 53, 153, 785, 51, 291, 5261, 1317, 21163, 44393, 108131, 254373}}, {15897, 18, 41942, {1, 1, 3, 11, 5, 19, 61, 125, 127, 961, 2019, 1725, 855, 677, 20853, 38845, 3239, 95697}}, {15898, 18, 41969, {1, 1, 3, 15, 3, 3, 117, 17, 61, 201, 241, 1759, 4465, 3985, 6985, 47703, 58657, 52633}}, {15899, 18, 41975, {1, 3, 3, 11, 31, 39, 107, 171, 19, 825, 1309, 807, 7787, 10761, 20215, 9287, 21553, 179599}}, {15900, 18, 41976, {1, 3, 7, 9, 5, 7, 121, 15, 3, 199, 97, 3177, 5461, 15713, 27609, 54349, 24963, 186279}}, {15901, 18, 41994, {1, 3, 1, 15, 11, 9, 123, 187, 363, 5, 837, 451, 1601, 6597, 10857, 46893, 83729, 20409}}, {15902, 18, 42002, {1, 3, 1, 9, 1, 53, 71, 191, 217, 165, 1709, 1827, 1977, 10073, 11373, 35311, 26637, 134519}}, {15903, 18, 42037, {1, 3, 5, 11, 31, 55, 101, 189, 277, 347, 629, 223, 785, 5739, 25505, 55601, 55017, 212837}}, {15904, 18, 42056, {1, 1, 5, 11, 3, 13, 45, 235, 65, 459, 621, 587, 7105, 6181, 13193, 5683, 42935, 198585}}, {15905, 18, 42079, {1, 1, 3, 1, 3, 17, 27, 109, 261, 979, 903, 1499, 4799, 11759, 10591, 65429, 74587, 16629}}, {15906, 18, 42085, {1, 1, 5, 1, 13, 63, 29, 11, 441, 151, 611, 4073, 3933, 6793, 28845, 39223, 120823, 49397}}, {15907, 18, 42089, {1, 3, 3, 5, 21, 13, 23, 53, 357, 197, 1327, 1773, 2961, 11509, 16585, 10201, 28451, 45109}}, {15908, 18, 42123, {1, 3, 5, 7, 19, 17, 97, 63, 295, 111, 85, 2981, 6719, 9193, 15197, 12117, 2553, 59909}}, {15909, 18, 42128, {1, 1, 5, 5, 15, 3, 9, 85, 333, 379, 1409, 1445, 4173, 3953, 833, 48089, 120249, 122703}}, {15910, 18, 42140, {1, 3, 7, 7, 29, 13, 57, 19, 141, 979, 1991, 4011, 8125, 3915, 15753, 1371, 113771, 117273}}, {15911, 18, 42149, {1, 3, 3, 13, 21, 53, 115, 187, 279, 29, 1355, 1843, 253, 3531, 8193, 54731, 6213, 123467}}, {15912, 18, 42156, {1, 3, 3, 1, 25, 29, 109, 19, 37, 385, 901, 3737, 6247, 9941, 13185, 2895, 88819, 53029}}, {15913, 18, 42186, {1, 1, 1, 1, 3, 31, 89, 157, 483, 657, 1833, 2975, 3187, 631, 28685, 7277, 4915, 115955}}, {15914, 18, 42191, {1, 3, 3, 1, 25, 41, 13, 99, 385, 303, 297, 419, 7919, 12411, 757, 9227, 47867, 120175}}, {15915, 18, 42205, {1, 3, 5, 11, 23, 15, 21, 157, 177, 301, 789, 2791, 5769, 7809, 2369, 26123, 116465, 22595}}, {15916, 18, 42221, {1, 1, 5, 9, 17, 63, 45, 239, 465, 811, 1157, 1443, 8137, 12587, 26209, 62057, 59299, 167171}}, {15917, 18, 42222, {1, 3, 3, 7, 3, 45, 41, 17, 341, 461, 571, 541, 989, 4069, 17531, 46729, 107915, 47871}}, {15918, 18, 42230, {1, 1, 7, 1, 1, 23, 45, 213, 125, 799, 5, 3443, 2535, 12983, 2133, 63411, 93027, 89831}}, {15919, 18, 42233, {1, 1, 1, 15, 7, 31, 49, 181, 213, 923, 281, 2059, 861, 6951, 25659, 32209, 66423, 225885}}, {15920, 18, 42241, {1, 3, 3, 7, 9, 39, 107, 197, 383, 179, 27, 1395, 6397, 16139, 32049, 33567, 43977, 203939}}, {15921, 18, 42247, {1, 1, 3, 5, 13, 37, 13, 31, 339, 527, 641, 181, 1413, 8145, 341, 57605, 108031, 109311}}, {15922, 18, 42248, {1, 1, 1, 1, 21, 35, 87, 15, 279, 967, 1003, 813, 5075, 10595, 5609, 33901, 86443, 150007}}, {15923, 18, 42254, {1, 3, 1, 5, 27, 9, 75, 199, 377, 889, 545, 1987, 6277, 361, 12563, 35699, 27105, 187995}}, {15924, 18, 42259, {1, 3, 7, 1, 11, 3, 41, 215, 273, 61, 821, 1207, 2809, 8731, 26409, 50323, 22355, 16521}}, {15925, 18, 42268, {1, 1, 7, 5, 29, 13, 99, 133, 15, 673, 215, 445, 4051, 2187, 9395, 62491, 58685, 224707}}, {15926, 18, 42295, {1, 3, 3, 13, 21, 59, 17, 1, 271, 613, 939, 1881, 2379, 16325, 3275, 63707, 59961, 106937}}, {15927, 18, 42304, {1, 3, 3, 1, 23, 53, 51, 181, 391, 375, 767, 239, 373, 4593, 25211, 37173, 70409, 252345}}, {15928, 18, 42322, {1, 3, 3, 11, 15, 17, 37, 145, 41, 107, 151, 1351, 3457, 14727, 755, 36321, 99397, 73359}}, {15929, 18, 42334, {1, 3, 5, 7, 25, 31, 39, 185, 341, 721, 1799, 1803, 5985, 10587, 11605, 9937, 23905, 56485}}, {15930, 18, 42355, {1, 3, 1, 3, 19, 35, 25, 71, 109, 209, 1675, 4043, 2053, 6285, 25317, 50171, 68293, 124385}}, {15931, 18, 42361, {1, 1, 1, 1, 21, 11, 63, 137, 361, 157, 1985, 2161, 7239, 1795, 10459, 38511, 36817, 253347}}, {15932, 18, 42373, {1, 1, 1, 5, 31, 3, 13, 83, 185, 175, 567, 295, 459, 11453, 3765, 9841, 30333, 201377}}, {15933, 18, 42374, {1, 1, 3, 13, 5, 57, 99, 125, 371, 903, 2001, 285, 2005, 8475, 31617, 58265, 641, 115507}}, {15934, 18, 42398, {1, 3, 5, 9, 11, 17, 123, 67, 77, 803, 815, 3173, 4795, 11917, 1187, 32389, 102289, 248359}}, {15935, 18, 42411, {1, 1, 5, 5, 27, 19, 59, 145, 361, 821, 33, 1465, 7643, 11101, 145, 21705, 55105, 181245}}, {15936, 18, 42443, {1, 3, 7, 5, 15, 55, 127, 133, 157, 989, 1211, 3573, 4021, 2967, 2941, 38657, 97681, 114505}}, {15937, 18, 42446, {1, 1, 7, 7, 23, 17, 39, 209, 117, 195, 931, 5, 7509, 9187, 6011, 10297, 13727, 258007}}, {15938, 18, 42463, {1, 3, 1, 13, 3, 17, 105, 69, 9, 163, 1615, 241, 5207, 13173, 28521, 51417, 130645, 106787}}, {15939, 18, 42479, {1, 1, 7, 13, 15, 3, 5, 187, 5, 239, 1799, 3083, 7801, 12781, 24817, 59341, 73867, 175273}}, {15940, 18, 42482, {1, 1, 3, 11, 11, 1, 89, 17, 497, 217, 1565, 2933, 6449, 7687, 6561, 57903, 92751, 261371}}, {15941, 18, 42484, {1, 1, 1, 1, 15, 39, 47, 249, 39, 765, 249, 2785, 4401, 16033, 11463, 127, 120109, 83133}}, {15942, 18, 42498, {1, 1, 3, 3, 19, 59, 47, 153, 505, 1009, 413, 1177, 5999, 6841, 12013, 40295, 115641, 189241}}, {15943, 18, 42534, {1, 3, 3, 11, 17, 51, 45, 101, 459, 971, 1133, 3467, 4945, 12445, 1267, 41783, 66825, 130167}}, {15944, 18, 42537, {1, 3, 1, 7, 17, 45, 77, 211, 387, 23, 1903, 2309, 2681, 6897, 6959, 30981, 113537, 207415}}, {15945, 18, 42557, {1, 1, 3, 1, 19, 9, 103, 89, 461, 881, 71, 2019, 6475, 13563, 18835, 2375, 34807, 1373}}, {15946, 18, 42570, {1, 1, 7, 11, 3, 31, 125, 121, 43, 737, 1995, 3043, 811, 8883, 8169, 22131, 29295, 194963}}, {15947, 18, 42599, {1, 3, 7, 11, 7, 45, 125, 149, 427, 187, 1361, 2405, 2815, 8877, 15255, 36867, 95517, 261969}}, {15948, 18, 42600, {1, 1, 7, 11, 9, 29, 89, 175, 467, 997, 937, 3869, 7843, 12629, 8701, 60717, 30443, 193427}}, {15949, 18, 42633, {1, 1, 5, 7, 3, 3, 57, 199, 315, 477, 189, 2029, 2059, 3473, 27411, 30419, 26465, 187807}}, {15950, 18, 42639, {1, 3, 1, 15, 3, 3, 11, 55, 233, 603, 1749, 1737, 5709, 4559, 13427, 39137, 44885, 61611}}, {15951, 18, 42672, {1, 1, 7, 1, 25, 15, 61, 199, 107, 737, 909, 3229, 1799, 5129, 27655, 45937, 919, 36161}}, {15952, 18, 42681, {1, 1, 3, 5, 31, 27, 99, 247, 425, 689, 1335, 1661, 625, 15817, 22601, 33293, 113927, 261931}}, {15953, 18, 42687, {1, 1, 1, 9, 5, 57, 117, 121, 465, 859, 335, 879, 665, 12787, 21313, 46387, 16437, 53769}}, {15954, 18, 42704, {1, 1, 3, 1, 11, 11, 75, 145, 307, 621, 833, 235, 3907, 11331, 6633, 51905, 72581, 129613}}, {15955, 18, 42713, {1, 1, 3, 13, 17, 13, 81, 125, 377, 499, 1597, 3437, 4323, 789, 23825, 46609, 105997, 159709}}, {15956, 18, 42714, {1, 3, 3, 9, 5, 29, 113, 51, 23, 957, 1981, 3205, 2549, 9771, 2555, 44289, 103893, 170241}}, {15957, 18, 42716, {1, 1, 5, 15, 13, 17, 101, 67, 71, 7, 185, 3775, 5399, 5213, 13095, 26045, 59467, 95547}}, {15958, 18, 42726, {1, 1, 5, 5, 31, 11, 77, 169, 3, 1007, 1853, 2245, 509, 13489, 2807, 55227, 67541, 242835}}, {15959, 18, 42730, {1, 3, 7, 15, 11, 63, 39, 97, 1, 219, 1827, 2343, 6009, 4909, 4327, 21853, 46079, 87719}}, {15960, 18, 42737, {1, 3, 1, 9, 17, 51, 119, 93, 179, 607, 1051, 2381, 619, 11215, 10839, 44771, 20555, 12721}}, {15961, 18, 42752, {1, 3, 3, 5, 21, 47, 35, 133, 61, 937, 1561, 1655, 6527, 5085, 4141, 60811, 59971, 6309}}, {15962, 18, 42757, {1, 3, 1, 7, 5, 63, 7, 235, 489, 675, 945, 943, 7107, 6005, 32695, 27655, 113219, 132963}}, {15963, 18, 42772, {1, 1, 1, 7, 7, 5, 81, 237, 365, 1, 811, 3075, 1771, 5223, 7337, 24601, 68383, 156975}}, {15964, 18, 42809, {1, 3, 1, 15, 5, 35, 39, 91, 301, 387, 805, 3537, 737, 7453, 4655, 16349, 108261, 123697}}, {15965, 18, 42853, {1, 3, 5, 3, 9, 59, 95, 187, 155, 183, 589, 2107, 967, 1095, 4875, 46131, 100699, 212797}}, {15966, 18, 42857, {1, 3, 1, 7, 27, 29, 77, 133, 397, 445, 933, 1483, 5027, 12569, 22163, 58989, 16657, 195347}}, {15967, 18, 42902, {1, 3, 5, 15, 21, 51, 97, 135, 165, 311, 525, 171, 4785, 7947, 14649, 40837, 58875, 222303}}, {15968, 18, 42912, {1, 3, 3, 5, 23, 47, 41, 23, 321, 709, 1555, 1139, 3775, 11617, 13001, 18235, 51803, 197863}}, {15969, 18, 42930, {1, 3, 5, 3, 3, 41, 91, 157, 29, 1005, 945, 3471, 2563, 8493, 24961, 44759, 103079, 50841}}, {15970, 18, 42936, {1, 1, 5, 11, 23, 19, 91, 115, 165, 291, 1653, 1061, 1067, 6171, 18441, 26067, 3569, 117329}}, {15971, 18, 42956, {1, 3, 7, 15, 17, 19, 89, 23, 103, 389, 623, 1071, 203, 9545, 21259, 36155, 55395, 141741}}, {15972, 18, 42959, {1, 3, 5, 11, 27, 43, 31, 193, 55, 489, 353, 1615, 7461, 13977, 31901, 64051, 82667, 258825}}, {15973, 18, 42978, {1, 1, 3, 7, 5, 39, 7, 245, 241, 843, 1545, 3499, 8117, 15057, 14153, 2665, 107401, 66059}}, {15974, 18, 43001, {1, 3, 5, 11, 9, 11, 41, 171, 255, 153, 1973, 759, 51, 15601, 327, 25889, 110861, 20555}}, {15975, 18, 43011, {1, 3, 5, 7, 5, 15, 41, 77, 87, 143, 1141, 3975, 2675, 7131, 5549, 52397, 42073, 27585}}, {15976, 18, 43047, {1, 1, 3, 7, 29, 5, 79, 243, 359, 817, 1053, 3509, 3347, 6207, 5147, 31063, 116851, 132627}}, {15977, 18, 43059, {1, 3, 7, 3, 27, 51, 39, 7, 95, 239, 263, 3497, 867, 1869, 16773, 46947, 59193, 37523}}, {15978, 18, 43094, {1, 3, 1, 1, 25, 31, 113, 127, 187, 77, 675, 3307, 999, 12255, 26441, 30933, 122761, 116783}}, {15979, 18, 43124, {1, 1, 5, 7, 7, 11, 87, 59, 437, 485, 685, 3159, 7259, 16271, 24899, 17919, 130271, 52953}}, {15980, 18, 43218, {1, 1, 3, 11, 7, 13, 61, 157, 149, 1001, 285, 3631, 1923, 16013, 19507, 64447, 8073, 261171}}, {15981, 18, 43220, {1, 3, 7, 9, 7, 13, 45, 7, 225, 671, 287, 1059, 5223, 2077, 7551, 58385, 92955, 162725}}, {15982, 18, 43240, {1, 1, 5, 11, 11, 21, 17, 145, 97, 633, 475, 2639, 2069, 9663, 23633, 50949, 109941, 119865}}, {15983, 18, 43258, {1, 1, 5, 13, 9, 49, 127, 171, 199, 413, 1315, 645, 305, 12123, 9559, 38319, 99945, 103313}}, {15984, 18, 43263, {1, 3, 5, 3, 19, 21, 119, 17, 301, 611, 1785, 2081, 2245, 8761, 4755, 9507, 23133, 144575}}, {15985, 18, 43265, {1, 3, 7, 11, 17, 25, 101, 59, 397, 249, 687, 715, 1151, 15941, 20525, 5171, 24073, 46257}}, {15986, 18, 43290, {1, 1, 3, 15, 11, 45, 9, 201, 421, 867, 389, 3615, 5965, 10561, 18309, 17143, 52771, 230743}}, {15987, 18, 43346, {1, 1, 3, 5, 9, 1, 109, 233, 431, 849, 421, 475, 1331, 9903, 20649, 34759, 118611, 38541}}, {15988, 18, 43364, {1, 3, 5, 15, 9, 55, 113, 217, 83, 409, 1449, 2325, 4825, 11311, 14565, 65075, 124399, 3591}}, {15989, 18, 43373, {1, 3, 3, 9, 27, 13, 101, 181, 255, 313, 693, 951, 1153, 13941, 14097, 8325, 4589, 102883}}, {15990, 18, 43401, {1, 3, 7, 3, 3, 1, 43, 65, 321, 623, 1389, 57, 3461, 9965, 6743, 34843, 91673, 249573}}, {15991, 18, 43416, {1, 3, 5, 5, 11, 29, 101, 79, 275, 685, 569, 59, 6921, 16065, 30625, 53339, 32283, 93401}}, {15992, 18, 43443, {1, 3, 1, 11, 29, 33, 103, 145, 431, 289, 1845, 1915, 23, 699, 5475, 18413, 127185, 162637}}, {15993, 18, 43458, {1, 3, 1, 11, 27, 23, 71, 63, 45, 579, 1187, 1189, 1781, 5595, 9043, 10155, 33321, 36487}}, {15994, 18, 43497, {1, 3, 3, 15, 17, 19, 85, 233, 293, 833, 1711, 857, 7573, 393, 23141, 58713, 21399, 228381}}, {15995, 18, 43506, {1, 3, 3, 15, 3, 35, 33, 35, 403, 123, 575, 3509, 6303, 13203, 17997, 15649, 64331, 124101}}, {15996, 18, 43545, {1, 1, 3, 9, 23, 25, 39, 53, 119, 879, 573, 3225, 5069, 15489, 21887, 11773, 37783, 169523}}, {15997, 18, 43558, {1, 3, 5, 5, 5, 25, 29, 189, 145, 863, 661, 3939, 1059, 11993, 1487, 3157, 118287, 69835}}, {15998, 18, 43576, {1, 3, 7, 3, 15, 9, 85, 107, 17, 965, 1097, 2087, 1947, 14649, 4099, 50941, 64511, 209153}}, {15999, 18, 43579, {1, 3, 5, 15, 19, 21, 127, 71, 429, 97, 1989, 835, 743, 11973, 14635, 45371, 114657, 208085}}, {16000, 18, 43624, {1, 3, 5, 7, 23, 61, 99, 133, 235, 237, 435, 2681, 331, 7859, 20859, 3573, 102901, 775}}, {16001, 18, 43630, {1, 3, 3, 9, 7, 57, 29, 15, 53, 569, 871, 1703, 2573, 10791, 719, 3487, 105709, 89573}}, {16002, 18, 43637, {1, 1, 1, 9, 7, 21, 21, 207, 459, 621, 737, 635, 5101, 4343, 4961, 32067, 64017, 73675}}, {16003, 18, 43654, {1, 1, 3, 9, 25, 27, 77, 69, 251, 327, 921, 3759, 1715, 14537, 21399, 10937, 9085, 241329}}, {16004, 18, 43660, {1, 1, 5, 1, 23, 13, 63, 117, 81, 427, 1063, 1987, 2433, 14837, 13473, 28623, 44799, 202223}}, {16005, 18, 43696, {1, 3, 1, 11, 17, 55, 89, 89, 455, 255, 1009, 1891, 2197, 9045, 23543, 48783, 22871, 58613}}, {16006, 18, 43706, {1, 3, 7, 15, 25, 5, 11, 71, 399, 23, 239, 93, 6681, 11311, 23403, 58131, 59549, 38917}}, {16007, 18, 43725, {1, 1, 1, 1, 19, 63, 73, 31, 69, 145, 921, 2475, 3505, 4797, 23805, 28621, 101153, 98895}}, {16008, 18, 43733, {1, 3, 3, 3, 9, 1, 113, 111, 275, 851, 519, 1607, 635, 13287, 6191, 24545, 112039, 114383}}, {16009, 18, 43753, {1, 3, 7, 9, 13, 13, 107, 97, 37, 133, 21, 1059, 4201, 6777, 2843, 43503, 23761, 13247}}, {16010, 18, 43756, {1, 1, 7, 9, 25, 23, 101, 135, 471, 901, 539, 4083, 1765, 15553, 5879, 10787, 67543, 104543}}, {16011, 18, 43761, {1, 3, 3, 13, 25, 63, 1, 49, 287, 357, 1701, 3689, 3895, 16313, 22619, 20203, 8195, 93127}}, {16012, 18, 43768, {1, 1, 1, 11, 15, 37, 75, 43, 311, 443, 1639, 549, 4707, 3099, 677, 59115, 11709, 71013}}, {16013, 18, 43812, {1, 1, 5, 11, 17, 43, 23, 21, 421, 613, 199, 1029, 5255, 271, 12911, 63431, 108889, 253379}}, {16014, 18, 43822, {1, 3, 7, 11, 27, 45, 9, 89, 65, 25, 1183, 3497, 8123, 2389, 215, 16819, 63777, 163423}}, {16015, 18, 43841, {1, 1, 5, 5, 29, 43, 65, 201, 391, 861, 1133, 3985, 983, 13039, 15545, 13695, 91467, 963}}, {16016, 18, 43861, {1, 3, 7, 3, 9, 55, 73, 205, 287, 765, 941, 353, 7379, 2511, 555, 64399, 77605, 121959}}, {16017, 18, 43868, {1, 3, 1, 11, 25, 15, 109, 35, 351, 675, 1219, 3791, 233, 15133, 30733, 24477, 86077, 85857}}, {16018, 18, 43877, {1, 1, 1, 7, 13, 33, 63, 45, 503, 525, 781, 517, 2187, 1587, 17297, 26147, 35421, 61269}}, {16019, 18, 43878, {1, 3, 1, 9, 9, 35, 69, 79, 447, 675, 803, 2793, 5793, 4433, 29227, 5437, 103347, 37713}}, {16020, 18, 43908, {1, 3, 1, 9, 27, 31, 65, 167, 327, 231, 1959, 657, 3141, 8659, 11055, 23923, 73597, 187139}}, {16021, 18, 43917, {1, 1, 5, 9, 29, 5, 37, 3, 281, 693, 133, 2139, 5867, 12073, 23669, 11427, 80627, 249003}}, {16022, 18, 43936, {1, 1, 1, 13, 9, 35, 89, 203, 381, 281, 535, 1061, 7417, 13373, 12149, 37943, 113133, 110797}}, {16023, 18, 43954, {1, 1, 7, 5, 7, 17, 71, 65, 385, 851, 1357, 3435, 4441, 6999, 27065, 32753, 129531, 52447}}, {16024, 18, 43963, {1, 3, 7, 1, 3, 21, 25, 113, 361, 219, 1345, 2193, 5711, 3331, 14343, 23075, 39955, 71223}}, {16025, 18, 43977, {1, 1, 7, 9, 15, 9, 101, 183, 59, 861, 931, 3385, 6517, 12067, 7753, 37997, 128361, 4591}}, {16026, 18, 44008, {1, 3, 5, 3, 23, 5, 37, 217, 203, 749, 993, 2537, 2425, 13949, 17235, 15461, 21275, 141815}}, {16027, 18, 44013, {1, 3, 5, 1, 19, 59, 63, 241, 211, 285, 2033, 1111, 2859, 14801, 9491, 14557, 12973, 223089}}, {16028, 18, 44026, {1, 1, 1, 11, 15, 41, 57, 59, 233, 897, 1193, 381, 2237, 5309, 19237, 57607, 97941, 116573}}, {16029, 18, 44028, {1, 1, 3, 9, 15, 17, 75, 15, 385, 129, 495, 887, 4933, 15113, 7449, 56213, 15841, 248029}}, {16030, 18, 44045, {1, 3, 1, 1, 29, 37, 19, 221, 47, 185, 1105, 3297, 5235, 6917, 12041, 10815, 54747, 132329}}, {16031, 18, 44046, {1, 3, 1, 5, 3, 17, 33, 35, 395, 491, 1157, 2563, 6257, 1025, 18295, 5293, 77851, 140157}}, {16032, 18, 44053, {1, 3, 1, 13, 7, 31, 95, 21, 347, 409, 1485, 925, 327, 11497, 7305, 6503, 111175, 70989}}, {16033, 18, 44091, {1, 3, 3, 1, 11, 41, 127, 93, 367, 649, 1585, 3379, 7269, 5537, 26077, 28541, 55379, 22989}}, {16034, 18, 44101, {1, 1, 1, 5, 27, 11, 35, 49, 7, 113, 1477, 3615, 7567, 505, 13915, 51023, 50783, 45031}}, {16035, 18, 44129, {1, 1, 7, 5, 25, 1, 35, 59, 269, 427, 791, 3179, 1423, 9801, 17717, 23631, 97947, 126861}}, {16036, 18, 44139, {1, 3, 5, 7, 1, 51, 77, 97, 19, 287, 303, 791, 307, 4939, 13615, 61225, 98127, 114693}}, {16037, 18, 44172, {1, 3, 3, 15, 5, 5, 93, 119, 429, 977, 1763, 3727, 1761, 3597, 16489, 71, 44103, 257929}}, {16038, 18, 44203, {1, 1, 5, 1, 15, 29, 79, 33, 335, 381, 1233, 47, 6741, 4953, 29689, 11223, 129185, 182487}}, {16039, 18, 44211, {1, 1, 1, 11, 29, 27, 27, 189, 507, 523, 1949, 2567, 4105, 1227, 16631, 34187, 28521, 265}}, {16040, 18, 44240, {1, 3, 3, 7, 3, 7, 39, 155, 315, 439, 1953, 1227, 6135, 16291, 453, 50929, 67507, 166981}}, {16041, 18, 44259, {1, 3, 1, 5, 7, 55, 121, 119, 87, 869, 1049, 575, 3675, 13505, 15661, 43899, 106877, 141691}}, {16042, 18, 44305, {1, 3, 1, 11, 23, 9, 117, 243, 329, 767, 335, 2951, 2887, 13441, 27579, 15437, 31699, 165177}}, {16043, 18, 44383, {1, 3, 7, 11, 5, 49, 47, 125, 431, 511, 299, 3215, 3287, 7029, 9737, 28317, 34355, 232365}}, {16044, 18, 44384, {1, 3, 7, 3, 17, 9, 29, 255, 509, 393, 1583, 1979, 6735, 941, 4393, 35741, 82019, 109633}}, {16045, 18, 44389, {1, 1, 5, 1, 13, 31, 95, 133, 117, 257, 993, 1513, 4669, 12239, 7841, 751, 79567, 23289}}, {16046, 18, 44390, {1, 1, 7, 9, 25, 33, 127, 181, 61, 333, 1087, 1661, 2715, 2569, 30041, 4937, 36053, 3435}}, {16047, 18, 44432, {1, 3, 1, 13, 15, 27, 123, 73, 377, 85, 435, 3435, 2079, 9271, 28685, 30089, 38799, 210247}}, {16048, 18, 44435, {1, 1, 5, 3, 5, 17, 93, 181, 313, 837, 1115, 3099, 3603, 3483, 23185, 9933, 53127, 123245}}, {16049, 18, 44468, {1, 1, 1, 13, 3, 57, 11, 67, 41, 273, 1005, 2313, 505, 6593, 27287, 47359, 104597, 45475}}, {16050, 18, 44472, {1, 1, 1, 5, 13, 41, 97, 251, 317, 483, 163, 1493, 6629, 11995, 31293, 4715, 98569, 178419}}, {16051, 18, 44483, {1, 3, 5, 5, 21, 7, 69, 169, 223, 953, 1573, 1137, 8075, 7733, 23031, 14589, 6453, 228883}}, {16052, 18, 44497, {1, 1, 7, 9, 27, 37, 3, 183, 41, 99, 111, 1713, 1291, 8263, 6373, 39549, 3099, 156793}}, {16053, 18, 44550, {1, 1, 3, 1, 23, 43, 15, 27, 223, 173, 1601, 2159, 3595, 15143, 31065, 35799, 77339, 141397}}, {16054, 18, 44577, {1, 1, 5, 13, 9, 35, 27, 93, 23, 999, 593, 563, 5333, 8825, 27277, 46381, 3171, 6311}}, {16055, 18, 44584, {1, 3, 7, 15, 25, 17, 7, 237, 379, 649, 1879, 2643, 5951, 4227, 4937, 24549, 43577, 116327}}, {16056, 18, 44601, {1, 1, 3, 9, 29, 35, 101, 105, 19, 151, 1135, 897, 2427, 15779, 31851, 29183, 44471, 187817}}, {16057, 18, 44674, {1, 3, 7, 11, 9, 55, 19, 115, 395, 559, 1883, 409, 2459, 201, 18975, 339, 108251, 19429}}, {16058, 18, 44683, {1, 3, 1, 13, 1, 11, 67, 45, 407, 169, 1401, 381, 3913, 6491, 28133, 63857, 52095, 115749}}, {16059, 18, 44688, {1, 1, 1, 11, 21, 45, 65, 253, 511, 51, 893, 3533, 2101, 4779, 23941, 22449, 82457, 44447}}, {16060, 18, 44694, {1, 1, 7, 11, 19, 33, 101, 241, 493, 111, 1967, 469, 6575, 10445, 733, 56467, 27403, 25863}}, {16061, 18, 44703, {1, 3, 1, 1, 5, 49, 21, 79, 53, 621, 43, 1183, 1385, 9129, 21727, 35559, 35269, 211383}}, {16062, 18, 44713, {1, 1, 1, 13, 23, 43, 53, 145, 149, 611, 745, 899, 7095, 3243, 1993, 35807, 110783, 246199}}, {16063, 18, 44721, {1, 1, 7, 9, 25, 37, 71, 233, 407, 1, 1749, 759, 7689, 15573, 7351, 33505, 22631, 49125}}, {16064, 18, 44722, {1, 3, 1, 13, 31, 49, 105, 13, 257, 843, 1171, 2819, 621, 12567, 24339, 6689, 127413, 249671}}, {16065, 18, 44733, {1, 1, 5, 11, 5, 1, 93, 21, 317, 789, 571, 2493, 7255, 6459, 14737, 13989, 47003, 246561}}, {16066, 18, 44746, {1, 3, 5, 7, 9, 11, 69, 143, 175, 581, 825, 2219, 1165, 9061, 6073, 57169, 18135, 94943}}, {16067, 18, 44748, {1, 1, 5, 7, 7, 55, 121, 107, 395, 939, 1291, 2497, 3757, 1361, 31823, 19375, 22551, 224653}}, {16068, 18, 44760, {1, 1, 7, 15, 15, 1, 47, 225, 223, 589, 1539, 173, 6257, 5461, 11197, 9801, 80687, 84279}}, {16069, 18, 44765, {1, 3, 7, 11, 23, 47, 83, 119, 367, 895, 431, 1949, 565, 1397, 24911, 29661, 67861, 74621}}, {16070, 18, 44766, {1, 3, 3, 9, 17, 29, 15, 65, 157, 255, 303, 1467, 3279, 8873, 31279, 431, 8497, 7209}}, {16071, 18, 44775, {1, 1, 5, 13, 9, 39, 85, 133, 427, 897, 1665, 2109, 2865, 15573, 27729, 59905, 2241, 83099}}, {16072, 18, 44794, {1, 3, 1, 13, 1, 45, 65, 65, 249, 79, 1515, 503, 953, 9859, 13307, 27419, 102209, 107529}}, {16073, 18, 44822, {1, 3, 7, 9, 17, 13, 79, 93, 231, 5, 1811, 557, 1837, 8077, 8109, 3497, 79985, 134375}}, {16074, 18, 44841, {1, 1, 5, 9, 15, 3, 23, 27, 491, 9, 1657, 3877, 3783, 12645, 2599, 10673, 40035, 197681}}, {16075, 18, 44859, {1, 1, 5, 3, 5, 13, 121, 145, 291, 621, 1731, 145, 2033, 341, 3667, 4139, 52035, 115865}}, {16076, 18, 44894, {1, 3, 5, 5, 3, 29, 115, 227, 339, 23, 1659, 2367, 1079, 10757, 30709, 41473, 55847, 228761}}, {16077, 18, 44900, {1, 3, 5, 7, 7, 61, 103, 57, 197, 31, 237, 2507, 5247, 10529, 13823, 47845, 129031, 47029}}, {16078, 18, 44904, {1, 3, 7, 5, 3, 17, 91, 31, 277, 977, 1905, 3991, 3657, 12197, 14535, 43263, 109629, 31665}}, {16079, 18, 44946, {1, 1, 5, 15, 29, 43, 121, 113, 159, 929, 669, 2067, 4999, 6847, 12369, 61795, 98525, 78051}}, {16080, 18, 44967, {1, 1, 3, 7, 25, 61, 65, 79, 373, 683, 113, 1495, 5447, 15507, 16731, 53959, 62905, 252173}}, {16081, 18, 44994, {1, 3, 1, 11, 1, 15, 101, 55, 477, 357, 333, 3243, 3325, 5885, 11385, 685, 90575, 23015}}, {16082, 18, 44999, {1, 3, 1, 7, 15, 13, 91, 141, 209, 865, 2035, 2791, 367, 9953, 29547, 36731, 13649, 192911}}, {16083, 18, 45013, {1, 1, 5, 15, 9, 59, 37, 131, 3, 299, 897, 119, 7515, 5271, 2207, 18187, 62613, 210345}}, {16084, 18, 45017, {1, 3, 1, 7, 29, 53, 95, 185, 327, 473, 1525, 3751, 915, 5883, 4137, 46343, 104917, 182895}}, {16085, 18, 45020, {1, 1, 7, 3, 31, 57, 53, 169, 215, 607, 541, 1081, 5265, 2509, 28379, 41767, 19435, 143693}}, {16086, 18, 45027, {1, 1, 7, 7, 31, 57, 19, 203, 467, 57, 1305, 1513, 6069, 15595, 31717, 44687, 65335, 159315}}, {16087, 18, 45029, {1, 1, 1, 1, 13, 1, 41, 39, 489, 465, 1645, 2847, 6193, 11025, 11297, 55945, 92085, 243061}}, {16088, 18, 45066, {1, 3, 3, 13, 15, 47, 87, 77, 321, 903, 181, 2093, 1673, 5375, 17969, 48467, 83441, 120867}}, {16089, 18, 45074, {1, 3, 3, 13, 13, 17, 65, 181, 283, 471, 745, 1091, 7255, 5987, 29423, 27579, 96201, 218157}}, {16090, 18, 45080, {1, 1, 1, 7, 13, 5, 101, 131, 309, 401, 99, 2353, 55, 2377, 6059, 64777, 33401, 225605}}, {16091, 18, 45090, {1, 3, 1, 15, 9, 35, 37, 197, 65, 593, 411, 2233, 1485, 9599, 9581, 31935, 115145, 76867}}, {16092, 18, 45101, {1, 3, 7, 9, 3, 41, 103, 237, 453, 335, 1831, 3947, 7573, 3859, 12495, 60617, 20715, 163119}}, {16093, 18, 45110, {1, 3, 5, 7, 9, 9, 25, 79, 421, 267, 585, 1093, 2237, 8881, 7311, 39417, 110901, 8969}}, {16094, 18, 45113, {1, 3, 3, 15, 1, 29, 75, 159, 89, 965, 457, 1645, 1485, 729, 30547, 2275, 79633, 126089}}, {16095, 18, 45134, {1, 3, 7, 7, 19, 47, 55, 115, 287, 477, 719, 3311, 2455, 12033, 13811, 34011, 45153, 126991}}, {16096, 18, 45136, {1, 3, 7, 5, 9, 33, 27, 215, 7, 113, 1027, 415, 1057, 13011, 1547, 7955, 21347, 79427}}, {16097, 18, 45148, {1, 3, 1, 11, 1, 41, 27, 29, 255, 763, 219, 897, 915, 453, 9417, 22845, 31655, 228869}}, {16098, 18, 45158, {1, 1, 7, 13, 7, 49, 105, 111, 53, 219, 171, 841, 5027, 5311, 28171, 58719, 32241, 170921}}, {16099, 18, 45176, {1, 3, 5, 7, 21, 53, 11, 169, 45, 429, 1727, 1953, 8119, 14955, 19997, 62665, 31345, 135715}}, {16100, 18, 45181, {1, 1, 5, 13, 17, 13, 125, 247, 411, 663, 1725, 2515, 7995, 8963, 5797, 32871, 66603, 137997}}, {16101, 18, 45185, {1, 1, 5, 5, 23, 37, 15, 63, 35, 817, 463, 1413, 1203, 8031, 4169, 45755, 93511, 134751}}, {16102, 18, 45188, {1, 1, 1, 1, 31, 17, 15, 125, 199, 57, 1499, 1567, 6113, 6503, 515, 57841, 49885, 213881}}, {16103, 18, 45203, {1, 1, 7, 7, 15, 1, 67, 213, 197, 471, 577, 27, 1533, 13009, 31861, 62435, 113139, 77057}}, {16104, 18, 45209, {1, 3, 7, 1, 29, 21, 99, 173, 137, 19, 1727, 1157, 5215, 4367, 28803, 26031, 120195, 60111}}, {16105, 18, 45231, {1, 1, 5, 9, 25, 55, 27, 45, 231, 693, 765, 429, 2897, 6045, 19705, 61903, 5385, 172967}}, {16106, 18, 45234, {1, 3, 1, 5, 9, 17, 35, 151, 91, 41, 89, 3751, 27, 5721, 26117, 6105, 31609, 79569}}, {16107, 18, 45239, {1, 3, 5, 11, 15, 3, 25, 73, 383, 765, 729, 51, 4245, 6215, 9435, 45223, 68071, 68453}}, {16108, 18, 45246, {1, 1, 7, 5, 31, 61, 19, 153, 331, 233, 11, 3047, 3939, 11959, 897, 4437, 2941, 174493}}, {16109, 18, 45260, {1, 1, 7, 11, 27, 11, 83, 33, 7, 761, 805, 2327, 2997, 12269, 18707, 10615, 114357, 54951}}, {16110, 18, 45284, {1, 3, 5, 9, 3, 45, 65, 193, 347, 771, 663, 2901, 6467, 14109, 5169, 38021, 39605, 216877}}, {16111, 18, 45301, {1, 1, 7, 1, 1, 13, 109, 179, 499, 325, 1763, 1923, 7429, 259, 20589, 48473, 49605, 124709}}, {16112, 18, 45333, {1, 3, 1, 3, 5, 27, 25, 127, 313, 541, 589, 751, 5959, 5801, 32467, 40597, 75625, 24827}}, {16113, 18, 45350, {1, 1, 1, 3, 13, 35, 71, 223, 281, 767, 447, 1253, 2227, 7305, 23125, 62847, 16783, 76145}}, {16114, 18, 45354, {1, 1, 5, 5, 11, 1, 95, 215, 351, 915, 1471, 143, 4011, 3373, 19019, 31797, 85891, 33871}}, {16115, 18, 45446, {1, 1, 3, 9, 15, 39, 125, 29, 85, 625, 1155, 753, 6679, 14239, 14597, 32715, 97313, 162291}}, {16116, 18, 45458, {1, 1, 1, 7, 13, 47, 127, 69, 199, 145, 123, 3207, 7673, 9991, 27501, 29189, 93027, 136881}}, {16117, 18, 45518, {1, 3, 1, 15, 9, 21, 121, 23, 457, 315, 437, 1919, 5531, 13817, 8883, 4421, 19487, 88591}}, {16118, 18, 45566, {1, 3, 1, 9, 15, 49, 101, 27, 11, 283, 1277, 971, 7697, 5915, 12709, 38251, 88165, 261609}}, {16119, 18, 45569, {1, 1, 3, 9, 17, 19, 53, 131, 327, 917, 603, 2451, 3597, 14731, 9223, 29719, 113507, 69875}}, {16120, 18, 45575, {1, 1, 5, 7, 1, 3, 77, 71, 149, 901, 283, 1599, 1053, 16305, 9937, 20907, 4133, 29623}}, {16121, 18, 45576, {1, 1, 3, 9, 25, 63, 101, 255, 397, 233, 1111, 1583, 3431, 5245, 30209, 33201, 63859, 16551}}, {16122, 18, 45587, {1, 1, 7, 5, 19, 25, 9, 137, 105, 363, 867, 811, 5829, 12595, 18867, 61021, 19425, 99399}}, {16123, 18, 45615, {1, 1, 3, 7, 11, 1, 119, 95, 367, 239, 1677, 67, 283, 5701, 3635, 26917, 112895, 224049}}, {16124, 18, 45661, {1, 3, 5, 11, 13, 33, 11, 191, 305, 551, 159, 1953, 4231, 811, 8711, 41291, 110917, 176177}}, {16125, 18, 45798, {1, 3, 5, 9, 15, 3, 27, 29, 77, 881, 849, 1113, 7151, 3433, 11199, 38409, 98173, 21373}}, {16126, 18, 45829, {1, 1, 5, 13, 25, 57, 81, 169, 215, 379, 1707, 493, 1071, 4869, 19149, 24585, 61803, 149305}}, {16127, 18, 45847, {1, 1, 5, 11, 13, 11, 9, 45, 207, 347, 1203, 185, 3919, 3119, 27879, 50793, 18499, 109239}}, {16128, 18, 45858, {1, 1, 1, 5, 3, 23, 123, 175, 445, 439, 215, 1883, 6857, 14837, 29411, 33633, 96241, 68361}}, {16129, 18, 45864, {1, 1, 5, 7, 31, 53, 19, 41, 477, 203, 1133, 1471, 5067, 3875, 30655, 9207, 24835, 22019}}, {16130, 18, 45899, {1, 3, 1, 11, 19, 9, 91, 217, 135, 169, 489, 727, 5471, 2125, 20867, 19689, 78859, 222433}}, {16131, 18, 45904, {1, 1, 1, 13, 5, 37, 37, 39, 397, 527, 789, 1447, 7123, 6099, 16849, 48895, 95543, 56135}}, {16132, 18, 45919, {1, 3, 7, 7, 15, 31, 81, 165, 31, 867, 1879, 1161, 3651, 5167, 12855, 60195, 85611, 191791}}, {16133, 18, 45974, {1, 1, 1, 9, 31, 35, 19, 123, 281, 445, 63, 2683, 7073, 1489, 9791, 40125, 43723, 103765}}, {16134, 18, 45987, {1, 3, 3, 9, 23, 31, 113, 241, 149, 463, 1047, 3737, 8105, 16295, 4565, 8095, 16617, 87455}}, {16135, 18, 45989, {1, 3, 5, 15, 1, 47, 29, 77, 27, 1013, 1091, 3657, 835, 563, 7139, 58839, 92697, 114523}}, {16136, 18, 46008, {1, 3, 1, 1, 5, 49, 87, 251, 473, 583, 2033, 809, 5341, 15835, 691, 57133, 75751, 127717}}, {16137, 18, 46036, {1, 3, 1, 11, 23, 51, 95, 167, 73, 739, 573, 1113, 7585, 5457, 25767, 5583, 29583, 48263}}, {16138, 18, 46039, {1, 1, 3, 5, 9, 59, 1, 235, 17, 973, 1987, 3629, 1739, 6419, 29943, 44963, 63943, 18571}}, {16139, 18, 46043, {1, 3, 7, 11, 9, 37, 25, 253, 307, 411, 891, 1977, 6979, 11287, 12619, 50327, 25831, 135673}}, {16140, 18, 46045, {1, 1, 5, 15, 23, 27, 83, 157, 253, 559, 1989, 2431, 4821, 6617, 4295, 16143, 249, 109855}}, {16141, 18, 46079, {1, 1, 3, 9, 31, 59, 117, 139, 379, 703, 49, 3013, 6383, 4019, 7289, 4567, 34931, 224967}}, {16142, 18, 46084, {1, 1, 1, 3, 3, 33, 49, 127, 177, 417, 723, 3259, 1547, 3297, 19733, 59465, 122179, 13209}}, {16143, 18, 46091, {1, 3, 3, 1, 3, 61, 23, 177, 77, 579, 1739, 2707, 5319, 13291, 10223, 45395, 62797, 124675}}, {16144, 18, 46105, {1, 1, 3, 15, 25, 47, 79, 111, 245, 853, 1103, 3741, 5783, 2075, 26371, 28801, 117831, 111735}}, {16145, 18, 46117, {1, 1, 5, 11, 3, 47, 43, 61, 75, 963, 1507, 3491, 6031, 14171, 32557, 23779, 44815, 168409}}, {16146, 18, 46141, {1, 3, 3, 7, 21, 39, 61, 109, 13, 833, 373, 4021, 4035, 7987, 18957, 10423, 82823, 8763}}, {16147, 18, 46147, {1, 1, 7, 3, 3, 33, 113, 77, 447, 127, 213, 1605, 3873, 12345, 7847, 63903, 80665, 6647}}, {16148, 18, 46162, {1, 3, 1, 5, 25, 11, 49, 233, 377, 791, 43, 195, 393, 1403, 27567, 29673, 11327, 190513}}, {16149, 18, 46184, {1, 3, 1, 15, 21, 3, 21, 169, 221, 495, 1045, 3715, 4923, 2437, 23203, 59905, 70285, 258455}}, {16150, 18, 46197, {1, 1, 7, 13, 29, 33, 91, 153, 31, 359, 25, 3947, 1699, 4081, 20907, 24953, 64977, 88115}}, {16151, 18, 46207, {1, 1, 5, 11, 17, 7, 17, 129, 91, 835, 139, 3823, 1827, 6787, 27367, 26801, 61513, 189677}}, {16152, 18, 46214, {1, 3, 3, 9, 23, 21, 97, 103, 481, 859, 413, 893, 4021, 8111, 23703, 18791, 102735, 82735}}, {16153, 18, 46218, {1, 1, 1, 7, 11, 53, 61, 3, 347, 633, 191, 3605, 41, 12605, 14381, 60403, 126223, 186157}}, {16154, 18, 46237, {1, 3, 5, 1, 11, 33, 61, 235, 245, 623, 2019, 3289, 5761, 15557, 1685, 2173, 104825, 245139}}, {16155, 18, 46247, {1, 1, 3, 7, 19, 55, 75, 219, 11, 75, 1765, 1833, 263, 6605, 26297, 24969, 17721, 109495}}, {16156, 18, 46251, {1, 1, 7, 5, 7, 33, 23, 109, 207, 137, 385, 3233, 6765, 3517, 31389, 57049, 25645, 176257}}, {16157, 18, 46327, {1, 1, 5, 5, 27, 63, 65, 23, 93, 721, 1665, 3805, 3611, 7543, 21119, 38565, 99921, 72773}}, {16158, 18, 46333, {1, 1, 1, 13, 13, 19, 23, 5, 425, 727, 1469, 1261, 6597, 725, 27129, 36953, 25781, 191581}}, {16159, 18, 46342, {1, 3, 3, 1, 3, 29, 25, 109, 237, 135, 409, 2239, 5033, 11007, 31861, 55171, 76313, 216271}}, {16160, 18, 46366, {1, 3, 7, 13, 31, 33, 11, 31, 179, 67, 755, 2513, 37, 12863, 24053, 12315, 45009, 166643}}, {16161, 18, 46376, {1, 1, 5, 13, 13, 37, 19, 223, 409, 387, 139, 3283, 243, 15573, 24173, 63271, 91561, 168665}}, {16162, 18, 46384, {1, 3, 5, 7, 17, 25, 63, 231, 23, 965, 1873, 1021, 7927, 11127, 19553, 9883, 83009, 258991}}, {16163, 18, 46404, {1, 3, 1, 7, 17, 21, 71, 65, 165, 845, 1739, 2395, 5959, 14803, 17333, 59003, 36477, 202511}}, {16164, 18, 46478, {1, 3, 5, 13, 15, 57, 59, 205, 507, 41, 703, 195, 4373, 4023, 13399, 62061, 43645, 204899}}, {16165, 18, 46511, {1, 3, 5, 11, 13, 13, 43, 19, 497, 599, 1345, 2001, 407, 2731, 16283, 55161, 130887, 189201}}, {16166, 18, 46540, {1, 1, 7, 5, 13, 3, 105, 83, 235, 363, 869, 1715, 4031, 3419, 15149, 10627, 47787, 226107}}, {16167, 18, 46638, {1, 3, 3, 3, 9, 49, 99, 161, 413, 739, 195, 2815, 1157, 9069, 15591, 4509, 30765, 184013}}, {16168, 18, 46700, {1, 3, 7, 5, 25, 63, 23, 91, 507, 647, 1249, 2035, 4341, 8811, 8345, 49463, 69023, 195775}}, {16169, 18, 46706, {1, 3, 5, 5, 5, 21, 117, 1, 321, 495, 251, 1961, 8043, 6593, 11017, 6167, 56607, 144009}}, {16170, 18, 46745, {1, 1, 3, 3, 15, 63, 41, 177, 403, 375, 1771, 3, 7481, 4887, 799, 59283, 106319, 32155}}, {16171, 18, 46757, {1, 1, 1, 7, 19, 57, 97, 91, 489, 561, 335, 3809, 3167, 8879, 1789, 22329, 58851, 84461}}, {16172, 18, 46772, {1, 3, 3, 11, 3, 23, 79, 25, 187, 497, 1343, 543, 4495, 14599, 29365, 14795, 26341, 26923}}, {16173, 18, 46776, {1, 3, 1, 13, 21, 35, 9, 227, 423, 761, 439, 3099, 5167, 12955, 12877, 5591, 123511, 74227}}, {16174, 18, 46790, {1, 1, 3, 7, 1, 49, 115, 95, 481, 659, 183, 2337, 39, 235, 30869, 10223, 59673, 65293}}, {16175, 18, 46794, {1, 1, 1, 13, 11, 29, 113, 37, 153, 993, 1195, 1695, 4741, 13671, 29097, 65023, 78281, 156235}}, {16176, 18, 46804, {1, 3, 5, 11, 19, 17, 47, 243, 273, 679, 393, 4059, 705, 12473, 1867, 13783, 86821, 240545}}, {16177, 18, 46820, {1, 3, 1, 11, 23, 35, 15, 31, 275, 261, 427, 909, 7925, 4737, 22825, 34859, 28593, 20071}}, {16178, 18, 46849, {1, 3, 1, 1, 13, 1, 115, 115, 103, 63, 1023, 815, 7007, 6063, 13329, 28051, 29807, 109861}}, {16179, 18, 46870, {1, 1, 1, 11, 19, 57, 49, 169, 33, 59, 579, 2409, 89, 9655, 18091, 57771, 34509, 175991}}, {16180, 18, 46876, {1, 1, 5, 9, 27, 19, 41, 217, 313, 359, 1745, 3887, 589, 3103, 10087, 30615, 56793, 102515}}, {16181, 18, 46903, {1, 3, 7, 11, 25, 43, 101, 245, 67, 1003, 1379, 2141, 8025, 15231, 20705, 45513, 82251, 147295}}, {16182, 18, 46904, {1, 3, 5, 5, 5, 47, 19, 33, 107, 773, 627, 4077, 5829, 6483, 25791, 35079, 103073, 201657}}, {16183, 18, 46907, {1, 1, 5, 15, 1, 37, 115, 15, 61, 987, 1029, 2125, 5357, 10233, 14907, 12077, 92143, 207301}}, {16184, 18, 46932, {1, 1, 7, 7, 3, 15, 95, 3, 393, 535, 819, 743, 3613, 11459, 2269, 17083, 65547, 74813}}, {16185, 18, 46955, {1, 1, 7, 5, 11, 27, 117, 65, 55, 87, 105, 3219, 1587, 383, 25349, 54561, 11935, 101203}}, {16186, 18, 46963, {1, 1, 5, 15, 23, 53, 37, 149, 191, 963, 1407, 4091, 1647, 9537, 30247, 23501, 123745, 76301}}, {16187, 18, 46991, {1, 3, 1, 1, 21, 31, 11, 107, 55, 823, 805, 141, 7177, 15883, 3307, 52245, 115171, 260589}}, {16188, 18, 47029, {1, 3, 7, 13, 25, 15, 5, 221, 347, 83, 51, 1227, 4591, 851, 10173, 37777, 82441, 175219}}, {16189, 18, 47036, {1, 1, 7, 15, 17, 41, 121, 215, 111, 999, 367, 1961, 3207, 10145, 10395, 24381, 95937, 12693}}, {16190, 18, 47054, {1, 1, 1, 11, 23, 27, 117, 255, 87, 519, 599, 3471, 3983, 2797, 13477, 56479, 27321, 101585}}, {16191, 18, 47099, {1, 1, 5, 9, 1, 3, 35, 15, 457, 209, 141, 1295, 1631, 9745, 30247, 44865, 78113, 13207}}, {16192, 18, 47106, {1, 3, 3, 1, 27, 63, 29, 31, 277, 173, 1321, 3847, 4127, 8713, 10507, 8697, 97025, 105995}}, {16193, 18, 47132, {1, 1, 5, 13, 13, 47, 33, 69, 113, 369, 539, 4075, 1013, 9733, 9291, 33377, 130567, 238331}}, {16194, 18, 47145, {1, 3, 7, 13, 15, 15, 125, 219, 205, 763, 1233, 1911, 7733, 7623, 27305, 6067, 16169, 238805}}, {16195, 18, 47151, {1, 3, 1, 9, 23, 17, 35, 175, 157, 627, 1045, 1791, 1675, 11699, 2151, 28293, 14529, 30523}}, {16196, 18, 47156, {1, 1, 5, 9, 5, 1, 23, 151, 295, 949, 371, 3317, 2557, 5815, 9699, 48379, 104561, 103747}}, {16197, 18, 47171, {1, 3, 5, 5, 11, 57, 125, 247, 29, 257, 979, 2437, 4391, 8229, 11231, 30145, 111165, 92347}}, {16198, 18, 47188, {1, 1, 3, 3, 27, 17, 71, 71, 357, 367, 1213, 2549, 6049, 15299, 2891, 21839, 109889, 34643}}, {16199, 18, 47201, {1, 1, 1, 11, 7, 21, 41, 77, 249, 567, 1947, 2989, 875, 12975, 23599, 49313, 67213, 98415}}, {16200, 18, 47219, {1, 1, 7, 7, 27, 51, 103, 221, 295, 247, 1579, 2435, 67, 3087, 9421, 59573, 111143, 42363}}, {16201, 18, 47226, {1, 1, 1, 13, 27, 27, 75, 33, 81, 841, 1295, 2823, 997, 16329, 6117, 43361, 63727, 113347}}, {16202, 18, 47241, {1, 1, 1, 3, 19, 7, 43, 93, 397, 293, 803, 3021, 3915, 1417, 22255, 38529, 53737, 133705}}, {16203, 18, 47252, {1, 3, 3, 13, 1, 33, 1, 235, 255, 345, 1621, 315, 2685, 6451, 7133, 239, 103075, 175033}}, {16204, 18, 47261, {1, 3, 1, 11, 29, 47, 61, 115, 395, 633, 1913, 2983, 4581, 3729, 22511, 16479, 80607, 232859}}, {16205, 18, 47295, {1, 3, 7, 7, 27, 25, 29, 121, 511, 533, 1791, 3349, 4915, 8213, 13913, 6595, 2353, 207495}}, {16206, 18, 47297, {1, 3, 7, 5, 21, 25, 77, 189, 473, 1015, 1455, 1923, 3281, 15163, 2329, 58529, 55369, 195007}}, {16207, 18, 47333, {1, 3, 1, 1, 25, 37, 117, 41, 207, 413, 143, 1707, 7463, 15399, 3013, 4141, 37669, 70953}}, {16208, 18, 47337, {1, 3, 5, 3, 31, 61, 41, 157, 141, 387, 1705, 1661, 3607, 6905, 3305, 63235, 7977, 253707}}, {16209, 18, 47360, {1, 1, 5, 11, 29, 15, 61, 127, 417, 795, 171, 415, 7935, 4553, 29979, 21153, 108811, 219959}}, {16210, 18, 47377, {1, 1, 5, 11, 17, 61, 3, 9, 297, 53, 933, 341, 507, 2683, 15313, 24113, 78617, 191127}}, {16211, 18, 47378, {1, 1, 7, 15, 5, 57, 65, 187, 15, 541, 1843, 731, 7331, 2479, 26259, 32685, 125259, 108693}}, {16212, 18, 47384, {1, 1, 7, 7, 11, 15, 33, 183, 225, 609, 1755, 3531, 2767, 6267, 30823, 36797, 59699, 136769}}, {16213, 18, 47389, {1, 3, 5, 13, 15, 19, 77, 239, 307, 691, 1165, 1327, 7901, 9299, 7777, 39151, 96261, 79791}}, {16214, 18, 47417, {1, 1, 3, 5, 29, 31, 85, 109, 381, 243, 955, 193, 3461, 5163, 18607, 51143, 74457, 84685}}, {16215, 18, 47420, {1, 1, 5, 9, 11, 23, 77, 247, 149, 759, 1153, 1781, 4107, 16315, 15513, 48545, 55607, 163947}}, {16216, 18, 47426, {1, 3, 3, 5, 21, 27, 57, 61, 75, 943, 97, 1507, 4091, 671, 23023, 49095, 61649, 222401}}, {16217, 18, 47443, {1, 1, 3, 13, 1, 3, 15, 105, 285, 255, 577, 1347, 2917, 10257, 21607, 63041, 79823, 6447}}, {16218, 18, 47504, {1, 1, 3, 1, 17, 25, 109, 47, 445, 225, 1729, 2835, 4569, 8755, 21847, 25839, 43503, 173599}}, {16219, 18, 47507, {1, 1, 5, 15, 19, 1, 121, 119, 33, 77, 1147, 359, 5747, 2785, 15567, 5409, 125979, 199183}}, {16220, 18, 47510, {1, 3, 1, 9, 17, 45, 85, 83, 427, 223, 531, 1681, 2343, 14959, 27297, 54607, 70889, 45529}}, {16221, 18, 47526, {1, 1, 5, 11, 31, 61, 109, 195, 505, 197, 159, 2799, 4517, 11549, 10297, 17415, 58277, 206577}}, {16222, 18, 47550, {1, 1, 3, 5, 17, 43, 107, 207, 453, 161, 1775, 1287, 5775, 12417, 14201, 48187, 75073, 121099}}, {16223, 18, 47552, {1, 1, 5, 7, 31, 27, 67, 251, 127, 443, 263, 895, 8081, 14053, 32023, 54743, 14723, 221285}}, {16224, 18, 47557, {1, 3, 3, 13, 27, 45, 51, 47, 243, 15, 1283, 2291, 3613, 14733, 8777, 3959, 36769, 104789}}, {16225, 18, 47564, {1, 3, 5, 1, 5, 31, 1, 139, 411, 79, 959, 1431, 2329, 3595, 19231, 55747, 18923, 223709}}, {16226, 18, 47591, {1, 3, 1, 1, 7, 9, 69, 201, 305, 411, 459, 3201, 2525, 6977, 16249, 17777, 114321, 243831}}, {16227, 18, 47610, {1, 3, 3, 5, 13, 7, 3, 27, 201, 279, 1253, 1725, 1481, 8885, 1233, 40699, 7267, 189095}}, {16228, 18, 47621, {1, 3, 5, 5, 31, 61, 53, 231, 93, 597, 2027, 2179, 4517, 565, 27807, 5447, 130341, 10411}}, {16229, 18, 47639, {1, 1, 7, 1, 9, 17, 63, 245, 405, 23, 1647, 285, 6625, 8935, 959, 29095, 657, 185511}}, {16230, 18, 47646, {1, 1, 7, 7, 5, 15, 49, 69, 479, 585, 437, 1097, 5933, 1709, 26169, 36895, 16981, 147033}}, {16231, 18, 47676, {1, 3, 7, 13, 29, 19, 89, 249, 195, 687, 379, 1291, 4791, 9039, 6381, 12965, 99995, 105107}}, {16232, 18, 47682, {1, 1, 5, 7, 13, 49, 101, 217, 205, 635, 577, 3301, 911, 1793, 22285, 20163, 22593, 45701}}, {16233, 18, 47732, {1, 3, 7, 9, 3, 21, 55, 123, 205, 309, 59, 3739, 1625, 839, 26733, 27443, 6699, 244287}}, {16234, 18, 47741, {1, 1, 1, 11, 29, 3, 33, 57, 481, 691, 1401, 3595, 5435, 571, 6945, 10911, 94721, 89751}}, {16235, 18, 47751, {1, 1, 3, 5, 21, 19, 23, 169, 263, 137, 771, 1995, 2211, 6287, 18691, 14219, 65647, 89885}}, {16236, 18, 47757, {1, 1, 3, 7, 7, 53, 9, 155, 327, 325, 301, 3703, 1069, 15573, 14873, 15665, 71617, 5079}}, {16237, 18, 47786, {1, 3, 1, 3, 27, 15, 1, 203, 465, 629, 71, 1093, 2071, 7743, 22441, 42997, 35249, 113329}}, {16238, 18, 47803, {1, 3, 5, 3, 21, 35, 107, 73, 247, 575, 719, 3215, 3181, 5861, 25169, 6503, 12347, 196371}}, {16239, 18, 47828, {1, 3, 1, 3, 7, 29, 117, 115, 221, 345, 165, 1367, 1491, 15791, 12647, 34679, 1043, 219311}}, {16240, 18, 47848, {1, 3, 5, 7, 19, 47, 65, 65, 101, 323, 1209, 3185, 3803, 1077, 18933, 17081, 7475, 165133}}, {16241, 18, 47853, {1, 1, 7, 1, 25, 9, 61, 245, 175, 201, 1837, 2119, 943, 14043, 14343, 46299, 81151, 5587}}, {16242, 18, 47856, {1, 1, 1, 1, 31, 27, 49, 89, 387, 975, 1203, 2995, 2969, 1465, 925, 39611, 38101, 126043}}, {16243, 18, 47862, {1, 3, 7, 13, 21, 17, 45, 139, 359, 11, 335, 79, 6629, 6137, 7879, 62735, 99493, 138943}}, {16244, 18, 47874, {1, 3, 5, 5, 9, 23, 91, 195, 89, 195, 1931, 3855, 387, 3491, 29643, 59939, 32347, 171539}}, {16245, 18, 47883, {1, 3, 3, 15, 21, 55, 5, 13, 139, 125, 1731, 3131, 1927, 16051, 8351, 18625, 32465, 255813}}, {16246, 18, 47916, {1, 3, 7, 11, 21, 45, 53, 225, 33, 733, 115, 639, 4801, 5529, 11041, 3557, 83521, 37525}}, {16247, 18, 47934, {1, 3, 7, 15, 3, 37, 111, 127, 463, 565, 543, 2593, 2203, 5719, 11667, 63735, 16481, 155613}}, {16248, 18, 47951, {1, 1, 3, 13, 31, 1, 17, 53, 479, 629, 1517, 89, 3377, 4831, 9213, 55029, 69547, 52363}}, {16249, 18, 47979, {1, 1, 7, 1, 5, 47, 115, 73, 59, 407, 1227, 2955, 5249, 7921, 4713, 28699, 41455, 1161}}, {16250, 18, 48010, {1, 1, 7, 7, 5, 7, 39, 7, 97, 867, 247, 639, 3125, 14961, 19737, 52589, 59821, 96095}}, {16251, 18, 48027, {1, 1, 7, 5, 11, 51, 63, 245, 385, 1003, 189, 4039, 6137, 3621, 13241, 55753, 14855, 50221}}, {16252, 18, 48046, {1, 3, 5, 3, 9, 61, 83, 209, 301, 917, 259, 187, 6253, 1579, 28285, 16571, 100945, 158067}}, {16253, 18, 48060, {1, 3, 5, 11, 5, 47, 123, 173, 253, 183, 1823, 459, 4719, 13639, 8455, 12217, 88779, 134863}}, {16254, 18, 48065, {1, 1, 1, 5, 1, 45, 43, 163, 371, 427, 1791, 1073, 1615, 14473, 15895, 4971, 105269, 109201}}, {16255, 18, 48075, {1, 3, 1, 15, 11, 9, 99, 99, 25, 21, 1499, 83, 6967, 12923, 13623, 27423, 4707, 477}}, {16256, 18, 48096, {1, 1, 3, 5, 15, 49, 45, 27, 51, 391, 1849, 347, 6841, 2831, 4425, 40701, 61135, 116945}}, {16257, 18, 48119, {1, 1, 3, 7, 21, 23, 15, 223, 403, 395, 1997, 3247, 6345, 11739, 6511, 44323, 86667, 213287}}, {16258, 18, 48173, {1, 3, 7, 11, 31, 21, 75, 129, 427, 777, 1787, 4031, 1493, 2279, 10681, 36675, 25527, 123533}}, {16259, 18, 48176, {1, 3, 5, 15, 9, 5, 117, 147, 259, 265, 1817, 583, 5341, 12115, 2369, 4023, 123479, 218877}}, {16260, 18, 48186, {1, 1, 1, 15, 5, 21, 87, 57, 487, 529, 1129, 2989, 39, 5995, 28779, 35813, 97425, 5227}}, {16261, 18, 48213, {1, 1, 7, 3, 7, 1, 41, 231, 195, 205, 1663, 3149, 4439, 8241, 3085, 43965, 58833, 216779}}, {16262, 18, 48223, {1, 1, 3, 1, 23, 45, 65, 3, 55, 653, 131, 2425, 5653, 9105, 16921, 55221, 29241, 220927}}, {16263, 18, 48224, {1, 3, 1, 3, 5, 47, 107, 49, 175, 957, 1287, 1299, 5215, 4141, 31697, 9371, 43339, 133933}}, {16264, 18, 48229, {1, 3, 1, 7, 13, 55, 33, 163, 361, 793, 101, 2159, 3457, 12893, 11627, 27115, 95201, 2945}}, {16265, 18, 48241, {1, 1, 7, 15, 11, 39, 79, 113, 385, 41, 1715, 3887, 1347, 8141, 6121, 18653, 50867, 55745}}, {16266, 18, 48281, {1, 1, 7, 13, 3, 5, 23, 59, 223, 665, 1823, 2989, 1069, 15161, 8917, 5539, 47437, 240933}}, {16267, 18, 48284, {1, 3, 7, 13, 13, 19, 73, 25, 413, 211, 439, 339, 1159, 16063, 9589, 33451, 28789, 118883}}, {16268, 18, 48291, {1, 1, 5, 11, 13, 61, 81, 63, 197, 569, 961, 253, 2065, 8969, 24045, 52811, 26929, 111329}}, {16269, 18, 48308, {1, 3, 7, 5, 19, 23, 27, 163, 37, 103, 1737, 175, 1853, 597, 14147, 46159, 26385, 69427}}, {16270, 18, 48340, {1, 3, 7, 9, 27, 43, 45, 209, 61, 115, 645, 1149, 1473, 10557, 8541, 51703, 29207, 92059}}, {16271, 18, 48344, {1, 1, 5, 5, 25, 53, 123, 243, 493, 403, 485, 1505, 6879, 1921, 13569, 28271, 24407, 73057}}, {16272, 18, 48368, {1, 1, 3, 11, 15, 31, 99, 29, 503, 819, 55, 773, 2993, 15341, 7625, 12835, 28555, 200609}}, {16273, 18, 48400, {1, 1, 7, 9, 21, 49, 47, 207, 13, 571, 57, 1727, 7441, 1703, 4253, 64851, 113, 180273}}, {16274, 18, 48406, {1, 3, 3, 9, 23, 1, 1, 53, 195, 569, 925, 1969, 3031, 14371, 17673, 39163, 11819, 117573}}, {16275, 18, 48409, {1, 1, 1, 11, 5, 3, 103, 133, 447, 1015, 1049, 3283, 7507, 233, 13721, 50721, 75511, 227561}}, {16276, 18, 48421, {1, 3, 1, 1, 17, 59, 79, 105, 503, 173, 1575, 1563, 5807, 12841, 7983, 28209, 27527, 229919}}, {16277, 18, 48448, {1, 1, 3, 9, 3, 41, 125, 213, 361, 939, 161, 2235, 2575, 13519, 7957, 21527, 40693, 51055}}, {16278, 18, 48453, {1, 3, 7, 11, 11, 7, 117, 21, 7, 745, 1109, 3393, 953, 5163, 19909, 49121, 85061, 209555}}, {16279, 18, 48457, {1, 1, 7, 5, 27, 59, 127, 199, 119, 461, 653, 497, 5867, 767, 16373, 21201, 87589, 171491}}, {16280, 18, 48478, {1, 1, 7, 11, 7, 21, 121, 97, 17, 827, 1191, 113, 6527, 14977, 32567, 15191, 104541, 140359}}, {16281, 18, 48493, {1, 1, 7, 13, 19, 29, 127, 207, 233, 511, 43, 3177, 7963, 5559, 24185, 13373, 37853, 150537}}, {16282, 18, 48527, {1, 3, 3, 9, 15, 17, 119, 201, 443, 51, 17, 605, 4191, 5251, 28903, 4861, 92571, 143499}}, {16283, 18, 48583, {1, 1, 5, 11, 21, 45, 111, 245, 115, 705, 1267, 3013, 7907, 14973, 30499, 44117, 118229, 136571}}, {16284, 18, 48597, {1, 3, 7, 7, 31, 35, 69, 143, 269, 27, 1365, 775, 6067, 11477, 28475, 54573, 92827, 226459}}, {16285, 18, 48641, {1, 1, 5, 1, 1, 29, 41, 189, 423, 245, 1031, 1667, 3465, 1491, 26787, 53851, 26189, 215443}}, {16286, 18, 48668, {1, 3, 3, 5, 23, 29, 97, 141, 135, 249, 767, 3627, 7867, 9311, 25411, 38325, 118643, 128453}}, {16287, 18, 48671, {1, 3, 7, 13, 3, 25, 61, 121, 285, 401, 1099, 2327, 5509, 16127, 2363, 52395, 114233, 216013}}, {16288, 18, 48682, {1, 1, 1, 13, 7, 37, 83, 151, 447, 605, 289, 2941, 6273, 5945, 7493, 29805, 34935, 101177}}, {16289, 18, 48709, {1, 1, 7, 13, 31, 51, 125, 9, 321, 293, 489, 4023, 2425, 7645, 2927, 20973, 111223, 71255}}, {16290, 18, 48719, {1, 1, 7, 3, 27, 9, 59, 143, 307, 543, 1995, 111, 5807, 4641, 3581, 2421, 64213, 187567}}, {16291, 18, 48731, {1, 3, 3, 9, 23, 33, 47, 81, 441, 995, 213, 3501, 1003, 9885, 24101, 58767, 49507, 30525}}, {16292, 18, 48780, {1, 3, 1, 3, 19, 51, 117, 53, 49, 167, 1799, 1421, 2473, 3183, 14421, 58621, 130703, 48095}}, {16293, 18, 48791, {1, 1, 7, 7, 5, 25, 33, 237, 447, 377, 517, 2047, 4357, 2747, 16491, 23935, 21655, 144151}}, {16294, 18, 48797, {1, 1, 7, 7, 17, 5, 57, 67, 89, 897, 1163, 3517, 1651, 6745, 23449, 2853, 43829, 50707}}, {16295, 18, 48807, {1, 1, 1, 13, 5, 45, 87, 139, 339, 1021, 649, 2957, 7887, 11957, 11235, 11063, 77329, 93121}}, {16296, 18, 48811, {1, 1, 1, 7, 11, 35, 73, 241, 11, 287, 551, 207, 4701, 2031, 27191, 44337, 35577, 226387}}, {16297, 18, 48814, {1, 3, 5, 11, 19, 3, 41, 211, 29, 913, 1455, 2525, 3935, 5581, 8043, 12033, 97479, 73521}}, {16298, 18, 48821, {1, 3, 5, 7, 15, 49, 53, 185, 229, 161, 121, 3407, 903, 7257, 19535, 42197, 3983, 222077}}, {16299, 18, 48836, {1, 1, 5, 7, 17, 33, 61, 121, 343, 111, 151, 1147, 3743, 2423, 24151, 42307, 50711, 140317}}, {16300, 18, 48846, {1, 3, 3, 7, 27, 1, 119, 209, 243, 185, 1253, 2307, 7659, 7839, 9697, 16799, 5189, 130005}}, {16301, 18, 48848, {1, 3, 3, 1, 27, 21, 115, 175, 157, 735, 1233, 1133, 1763, 1125, 4667, 42569, 125185, 218417}}, {16302, 18, 48854, {1, 3, 5, 9, 5, 37, 97, 165, 87, 447, 1491, 3141, 597, 10651, 9727, 65163, 2469, 141859}}, {16303, 18, 48874, {1, 1, 5, 13, 11, 53, 111, 123, 423, 413, 1519, 3715, 6623, 15415, 24085, 20925, 1529, 85183}}, {16304, 18, 48908, {1, 3, 7, 1, 31, 45, 93, 45, 363, 779, 443, 3687, 6051, 11683, 31733, 57251, 55087, 240877}}, {16305, 18, 48929, {1, 1, 1, 15, 1, 17, 53, 237, 131, 673, 1919, 1531, 7455, 5043, 1709, 23375, 75657, 194393}}, {16306, 18, 48941, {1, 3, 5, 9, 21, 3, 101, 141, 387, 887, 1329, 2627, 2865, 2685, 20273, 18901, 43805, 181049}}, {16307, 18, 48954, {1, 3, 5, 5, 7, 49, 55, 243, 311, 653, 959, 3157, 4891, 8777, 14381, 28105, 119323, 181129}}, {16308, 18, 48961, {1, 1, 1, 9, 17, 33, 97, 123, 71, 5, 793, 2829, 4385, 8577, 9927, 26213, 53287, 203555}}, {16309, 18, 48962, {1, 1, 1, 9, 15, 61, 51, 31, 195, 1003, 1915, 2349, 5319, 13411, 15265, 36321, 76157, 200437}}, {16310, 18, 48985, {1, 3, 1, 13, 19, 41, 11, 227, 447, 395, 1885, 2953, 3537, 3855, 21611, 14547, 106573, 233205}}, {16311, 18, 49001, {1, 3, 1, 11, 1, 1, 7, 61, 69, 631, 1687, 1131, 6901, 5801, 14431, 17807, 35777, 253941}}, {16312, 18, 49007, {1, 3, 5, 9, 15, 47, 71, 145, 419, 401, 1781, 2031, 3157, 14483, 2393, 4061, 122053, 81701}}, {16313, 18, 49015, {1, 3, 7, 13, 23, 21, 67, 147, 137, 277, 259, 3119, 4785, 5349, 3193, 21805, 108265, 231111}}, {16314, 18, 49035, {1, 1, 3, 9, 23, 63, 77, 153, 75, 643, 1341, 3607, 6001, 3387, 17485, 17893, 124699, 99515}}, {16315, 18, 49062, {1, 1, 7, 11, 9, 51, 79, 255, 255, 723, 1797, 2805, 2505, 3437, 4835, 30731, 73741, 8051}}, {16316, 18, 49066, {1, 1, 5, 7, 5, 19, 73, 75, 19, 889, 1443, 2263, 5773, 9997, 329, 46679, 82313, 130897}}, {16317, 18, 49085, {1, 3, 3, 9, 7, 53, 69, 11, 287, 861, 1367, 1433, 2693, 16255, 6785, 24705, 77463, 231247}}, {16318, 18, 49091, {1, 1, 3, 7, 21, 15, 115, 131, 169, 447, 1731, 2873, 119, 643, 31719, 22193, 17959, 150567}}, {16319, 18, 49094, {1, 3, 3, 9, 23, 21, 7, 39, 185, 837, 379, 3687, 3751, 14801, 15231, 7239, 77521, 80135}}, {16320, 18, 49127, {1, 1, 1, 1, 7, 33, 93, 247, 487, 873, 1951, 3273, 551, 3735, 29477, 62387, 30361, 145613}}, {16321, 18, 49134, {1, 1, 3, 7, 5, 47, 17, 31, 93, 517, 1175, 1033, 7421, 75, 541, 1967, 13059, 104751}}, {16322, 18, 49183, {1, 3, 5, 3, 19, 23, 123, 115, 99, 747, 655, 2885, 2991, 7497, 5989, 33419, 54363, 224947}}, {16323, 18, 49221, {1, 3, 3, 1, 15, 9, 51, 3, 307, 879, 1065, 1835, 2267, 11299, 21995, 2997, 102207, 39}}, {16324, 18, 49231, {1, 3, 5, 3, 9, 19, 19, 79, 499, 121, 951, 1151, 379, 5299, 13727, 49061, 32605, 208683}}, {16325, 18, 49250, {1, 3, 7, 7, 23, 41, 71, 23, 493, 969, 271, 3729, 6199, 14693, 17625, 52509, 121257, 151175}}, {16326, 18, 49252, {1, 1, 7, 15, 9, 51, 61, 9, 147, 527, 803, 3255, 723, 3241, 23961, 17497, 122569, 50863}}, {16327, 18, 49270, {1, 3, 5, 1, 19, 19, 31, 31, 95, 667, 377, 1193, 6759, 8583, 29801, 7989, 113899, 43481}}, {16328, 18, 49297, {1, 3, 7, 5, 17, 47, 1, 7, 305, 489, 1035, 1335, 5901, 9635, 10433, 4235, 108577, 52661}}, {16329, 18, 49313, {1, 1, 7, 3, 15, 7, 105, 189, 429, 287, 679, 111, 2087, 8479, 3053, 21763, 65655, 16207}}, {16330, 18, 49340, {1, 3, 5, 13, 19, 41, 45, 115, 311, 653, 1301, 3797, 6183, 7203, 9829, 13263, 71649, 255611}}, {16331, 18, 49365, {1, 3, 1, 9, 21, 33, 19, 233, 83, 423, 1701, 347, 3999, 11885, 19699, 61931, 63895, 59615}}, {16332, 18, 49379, {1, 1, 7, 7, 15, 19, 61, 43, 183, 223, 1135, 3099, 3137, 16181, 31019, 20151, 30169, 13125}}, {16333, 18, 49386, {1, 1, 1, 11, 9, 11, 3, 157, 495, 207, 603, 1919, 3565, 7639, 4281, 49179, 2465, 224033}}, {16334, 18, 49391, {1, 3, 1, 13, 13, 19, 127, 81, 475, 659, 1053, 3153, 5223, 12567, 30945, 47109, 98253, 41571}}, {16335, 18, 49417, {1, 1, 5, 11, 19, 1, 9, 67, 501, 149, 1695, 1265, 6467, 5285, 29865, 46777, 97581, 209395}}, {16336, 18, 49438, {1, 1, 1, 11, 21, 23, 123, 103, 419, 787, 111, 3327, 673, 3425, 8097, 2411, 107353, 121379}}, {16337, 18, 49444, {1, 1, 3, 3, 17, 7, 87, 35, 501, 973, 351, 751, 4813, 12245, 3053, 38633, 44995, 37151}}, {16338, 18, 49453, {1, 3, 5, 15, 7, 57, 99, 53, 3, 355, 153, 3897, 6923, 2075, 10821, 41819, 75665, 21237}}, {16339, 18, 49454, {1, 3, 5, 9, 3, 29, 85, 115, 191, 977, 1067, 1539, 5287, 3589, 18017, 35571, 41633, 148565}}, {16340, 18, 49480, {1, 1, 3, 9, 9, 57, 1, 63, 333, 107, 1173, 3377, 3599, 277, 20643, 19295, 91169, 168891}}, {16341, 18, 49485, {1, 1, 5, 13, 21, 7, 55, 15, 79, 995, 1553, 949, 6357, 8137, 9539, 861, 95635, 63021}}, {16342, 18, 49498, {1, 1, 5, 13, 31, 59, 11, 55, 159, 449, 307, 2725, 2305, 8259, 13823, 51225, 44775, 54253}}, {16343, 18, 49513, {1, 3, 3, 15, 19, 61, 105, 19, 211, 693, 835, 3607, 3703, 14007, 24597, 47109, 49855, 166115}}, {16344, 18, 49527, {1, 3, 1, 9, 27, 33, 81, 229, 445, 171, 247, 2019, 5227, 8759, 30155, 1851, 26909, 47145}}, {16345, 18, 49531, {1, 1, 3, 5, 23, 1, 57, 49, 177, 451, 1283, 3859, 4719, 13507, 29439, 9155, 129585, 94713}}, {16346, 18, 49564, {1, 3, 3, 5, 1, 9, 37, 23, 423, 611, 113, 119, 4307, 11747, 93, 51213, 5479, 172061}}, {16347, 18, 49588, {1, 3, 3, 15, 5, 35, 9, 43, 423, 877, 1563, 3411, 4233, 6961, 22421, 7347, 39553, 199745}}, {16348, 18, 49609, {1, 3, 1, 9, 15, 35, 85, 57, 151, 323, 1627, 27, 3603, 11475, 6561, 6091, 72099, 185321}}, {16349, 18, 49617, {1, 1, 3, 15, 17, 21, 3, 119, 455, 147, 1077, 3955, 1355, 3083, 28217, 50745, 114445, 46563}}, {16350, 18, 49645, {1, 1, 5, 3, 13, 11, 35, 185, 357, 447, 649, 139, 2847, 12011, 7753, 671, 113693, 236281}}, {16351, 18, 49646, {1, 3, 5, 1, 19, 27, 117, 195, 67, 259, 1073, 81, 5527, 6829, 26675, 60029, 8159, 13553}}, {16352, 18, 49654, {1, 3, 3, 7, 27, 63, 115, 191, 431, 191, 1547, 2261, 6527, 13459, 12773, 37485, 114847, 61709}}, {16353, 18, 49697, {1, 1, 3, 1, 29, 63, 47, 77, 415, 191, 325, 2487, 7457, 13721, 1573, 15037, 31941, 226651}}, {16354, 18, 49718, {1, 1, 5, 11, 29, 59, 49, 209, 195, 901, 691, 3167, 7471, 11609, 30135, 22067, 71395, 248151}}, {16355, 18, 49741, {1, 3, 7, 11, 7, 43, 55, 69, 289, 735, 1479, 139, 1395, 6463, 19827, 52151, 18963, 103367}}, {16356, 18, 49754, {1, 3, 5, 5, 27, 45, 77, 79, 89, 79, 913, 1437, 3337, 8861, 5477, 46195, 105869, 242599}}, {16357, 18, 49756, {1, 3, 5, 3, 3, 27, 103, 207, 233, 995, 1173, 1143, 3517, 3207, 8373, 45145, 79687, 150107}}, {16358, 18, 49833, {1, 3, 7, 3, 7, 37, 1, 137, 45, 479, 861, 3863, 4249, 3075, 23639, 12531, 118473, 255805}}, {16359, 18, 49834, {1, 1, 1, 9, 7, 23, 125, 57, 347, 215, 1749, 3029, 97, 14715, 16213, 29291, 104725, 92043}}, {16360, 18, 49879, {1, 3, 3, 15, 31, 39, 111, 97, 369, 675, 1471, 3889, 6437, 1499, 13325, 46141, 121087, 202493}}, {16361, 18, 49942, {1, 1, 1, 15, 15, 21, 3, 167, 251, 793, 1291, 427, 6407, 15521, 15441, 20071, 54513, 200485}}, {16362, 18, 49946, {1, 1, 7, 11, 27, 47, 123, 195, 241, 385, 609, 2323, 1221, 815, 279, 28553, 17663, 180977}}, {16363, 18, 49982, {1, 1, 3, 15, 23, 53, 21, 19, 329, 903, 561, 1539, 2829, 13037, 29867, 27825, 84005, 14853}}, {16364, 18, 49994, {1, 1, 5, 1, 21, 27, 103, 99, 31, 829, 515, 3949, 3635, 935, 2127, 56659, 123477, 47003}}, {16365, 18, 50001, {1, 3, 1, 11, 17, 63, 51, 15, 319, 539, 55, 2561, 1109, 16115, 23387, 20051, 120867, 4019}}, {16366, 18, 50023, {1, 3, 3, 7, 31, 11, 45, 251, 209, 21, 553, 887, 393, 15183, 14735, 13163, 123681, 15013}}, {16367, 18, 50047, {1, 3, 1, 7, 21, 41, 105, 39, 213, 477, 985, 2375, 937, 7099, 8867, 36519, 60503, 143225}}, {16368, 18, 50120, {1, 3, 1, 1, 19, 55, 73, 171, 379, 271, 791, 2477, 5381, 1703, 3805, 37227, 55553, 34549}}, {16369, 18, 50133, {1, 1, 5, 5, 29, 51, 127, 111, 209, 663, 975, 2293, 8155, 11263, 7891, 15463, 74889, 227403}}, {16370, 18, 50137, {1, 3, 5, 1, 15, 1, 115, 221, 23, 247, 1597, 87, 7513, 3329, 14491, 8961, 78147, 89499}}, {16371, 18, 50140, {1, 3, 5, 15, 25, 23, 99, 85, 189, 487, 1559, 427, 6179, 5291, 27279, 65507, 77347, 177073}}, {16372, 18, 50156, {1, 3, 7, 1, 23, 35, 7, 89, 455, 659, 2039, 3115, 4057, 139, 1269, 62319, 13629, 201571}}, {16373, 18, 50199, {1, 1, 1, 5, 9, 47, 55, 171, 213, 813, 135, 1545, 1421, 4055, 26697, 18889, 57653, 201369}}, {16374, 18, 50205, {1, 3, 1, 11, 9, 45, 5, 69, 261, 907, 1229, 1371, 1867, 1771, 17309, 41759, 119129, 43521}}, {16375, 18, 50215, {1, 1, 7, 5, 11, 27, 9, 237, 405, 53, 1359, 3665, 169, 3547, 23331, 14353, 106627, 219711}}, {16376, 18, 50216, {1, 3, 3, 5, 17, 23, 9, 41, 81, 601, 1447, 3225, 6721, 161, 16109, 54331, 111273, 81061}}, {16377, 18, 50224, {1, 1, 5, 7, 7, 37, 71, 13, 505, 671, 425, 2771, 1131, 1259, 13715, 45779, 114839, 217499}}, {16378, 18, 50229, {1, 1, 1, 5, 9, 51, 85, 223, 117, 403, 1117, 723, 2465, 11947, 7495, 62991, 17825, 169147}}, {16379, 18, 50233, {1, 1, 3, 13, 5, 57, 47, 35, 313, 901, 365, 1265, 137, 6335, 31419, 38497, 93285, 177187}}, {16380, 18, 50251, {1, 3, 5, 5, 7, 9, 21, 109, 47, 557, 1449, 3459, 5175, 5135, 727, 55425, 60593, 86571}}, {16381, 18, 50281, {1, 3, 7, 5, 1, 17, 119, 239, 347, 75, 1345, 2765, 1491, 16297, 25233, 60401, 85433, 59287}}, {16382, 18, 50326, {1, 1, 5, 5, 19, 57, 41, 53, 161, 475, 1791, 3617, 1651, 15227, 30357, 63547, 69937, 246473}}, {16383, 18, 50332, {1, 3, 7, 11, 11, 43, 79, 79, 195, 437, 39, 1259, 6041, 14989, 6615, 58747, 43583, 246979}}, {16384, 18, 50348, {1, 1, 7, 9, 11, 13, 49, 133, 365, 931, 1089, 713, 5997, 8759, 5789, 61329, 22639, 149845}}, {16385, 18, 50359, {1, 3, 7, 13, 9, 3, 11, 253, 339, 883, 1933, 443, 4265, 14165, 15845, 12625, 1453, 70961}}, {16386, 18, 50374, {1, 1, 7, 13, 21, 35, 113, 83, 473, 719, 1601, 1727, 3715, 631, 28075, 17725, 11393, 116883}}, {16387, 18, 50404, {1, 3, 7, 7, 7, 13, 117, 83, 365, 529, 1297, 3903, 2633, 9617, 15819, 38137, 49065, 189445}}, {16388, 18, 50443, {1, 1, 1, 7, 11, 41, 107, 33, 381, 395, 1993, 2819, 3301, 7543, 6787, 27437, 113681, 132403}}, {16389, 18, 50488, {1, 1, 1, 1, 3, 59, 91, 235, 67, 987, 1587, 1119, 5851, 13201, 1125, 49709, 381, 183295}}, {16390, 18, 50493, {1, 3, 5, 9, 3, 33, 45, 187, 455, 151, 823, 565, 5725, 1927, 25387, 61785, 130271, 134083}}, {16391, 18, 50505, {1, 1, 7, 5, 15, 25, 63, 231, 133, 401, 307, 2961, 4249, 2639, 10207, 8349, 8203, 72783}}, {16392, 18, 50511, {1, 1, 5, 13, 19, 27, 43, 153, 165, 815, 1385, 3041, 853, 7683, 1035, 13255, 69779, 128765}}, {16393, 18, 50525, {1, 1, 1, 3, 31, 61, 97, 15, 327, 717, 841, 643, 4781, 11609, 14181, 14625, 75369, 251015}}, {16394, 18, 50542, {1, 1, 5, 11, 17, 33, 9, 45, 111, 91, 1923, 967, 5649, 13647, 30497, 2925, 18395, 255089}}, {16395, 18, 50550, {1, 3, 3, 1, 3, 55, 33, 29, 101, 211, 1731, 2351, 7389, 14935, 29703, 60031, 122305, 174323}}, {16396, 18, 50560, {1, 1, 1, 3, 13, 23, 79, 117, 367, 267, 143, 1537, 3159, 2303, 9653, 12029, 2841, 226971}}, {16397, 18, 50570, {1, 1, 1, 13, 19, 57, 103, 159, 315, 895, 1879, 2153, 1901, 7635, 14145, 56495, 6203, 151203}}, {16398, 18, 50587, {1, 3, 3, 11, 31, 11, 75, 5, 419, 963, 1809, 3751, 7291, 12697, 2841, 17965, 91707, 80361}}, {16399, 18, 50593, {1, 1, 7, 7, 5, 23, 29, 199, 413, 501, 19, 697, 6523, 3997, 4945, 59817, 127613, 220399}}, {16400, 18, 50611, {1, 1, 7, 5, 1, 17, 51, 9, 183, 689, 325, 2391, 2095, 1907, 10325, 51045, 20097, 33719}}, {16401, 18, 50649, {1, 3, 5, 11, 3, 33, 45, 221, 325, 7, 253, 1323, 4959, 14067, 10035, 39463, 123171, 194581}}, {16402, 18, 50656, {1, 1, 3, 3, 15, 45, 25, 57, 357, 907, 1249, 3279, 2631, 9209, 7857, 58233, 29049, 173859}}, {16403, 18, 50685, {1, 3, 3, 9, 29, 39, 105, 55, 295, 583, 825, 1777, 2403, 9489, 9079, 24855, 18155, 252733}}, {16404, 18, 50686, {1, 1, 5, 15, 5, 63, 77, 215, 287, 743, 1937, 2103, 2673, 15487, 27855, 46683, 120215, 89721}}, {16405, 18, 50692, {1, 3, 3, 5, 27, 1, 45, 19, 309, 679, 1405, 415, 6107, 13567, 5803, 61941, 130285, 51847}}, {16406, 18, 50702, {1, 3, 1, 15, 23, 49, 47, 113, 401, 825, 1299, 2711, 6509, 12225, 16147, 20615, 121305, 121937}}, {16407, 18, 50704, {1, 3, 5, 5, 31, 41, 31, 57, 385, 919, 593, 1371, 6773, 12099, 23767, 17663, 128321, 188921}}, {16408, 18, 50709, {1, 1, 3, 15, 5, 41, 17, 7, 479, 143, 549, 1827, 8107, 14775, 28817, 12297, 119893, 191297}}, {16409, 18, 50720, {1, 3, 7, 5, 29, 61, 27, 123, 269, 223, 121, 1745, 3513, 1989, 9759, 8129, 78933, 40085}}, {16410, 18, 50726, {1, 1, 5, 13, 23, 49, 125, 225, 479, 123, 41, 2359, 4443, 4729, 31717, 3139, 3869, 118803}}, {16411, 18, 50729, {1, 3, 3, 3, 15, 7, 7, 87, 415, 95, 1799, 2009, 4711, 15635, 21997, 47201, 16815, 99815}}, {16412, 18, 50737, {1, 3, 3, 1, 31, 57, 73, 31, 423, 363, 1469, 2411, 6449, 15275, 14189, 51079, 130201, 130181}}, {16413, 18, 50758, {1, 1, 5, 3, 3, 31, 107, 11, 355, 647, 1463, 3019, 3263, 13727, 10461, 26577, 4439, 132737}}, {16414, 18, 50772, {1, 1, 1, 7, 13, 55, 31, 227, 71, 563, 1467, 3733, 725, 3443, 19279, 4111, 35749, 62275}}, {16415, 18, 50849, {1, 3, 3, 15, 9, 17, 61, 95, 43, 583, 1381, 1285, 2655, 9213, 27551, 16237, 29569, 216879}}, {16416, 18, 50850, {1, 1, 1, 3, 29, 3, 87, 193, 53, 599, 1581, 907, 4381, 8697, 27299, 40259, 122653, 43559}}, {16417, 18, 50881, {1, 3, 5, 3, 15, 49, 21, 27, 35, 353, 1281, 3253, 7339, 9333, 25253, 35035, 30379, 87387}}, {16418, 18, 50901, {1, 1, 1, 15, 7, 27, 69, 41, 45, 729, 1005, 3495, 1445, 7421, 27443, 29609, 70105, 93883}}, {16419, 18, 50906, {1, 1, 7, 7, 1, 41, 15, 149, 107, 121, 639, 3703, 3397, 1727, 14165, 2845, 78531, 175767}}, {16420, 18, 50915, {1, 3, 7, 15, 27, 17, 121, 175, 399, 551, 1889, 2283, 4343, 3633, 653, 3267, 101901, 162157}}, {16421, 18, 50961, {1, 3, 3, 15, 23, 41, 97, 251, 435, 955, 69, 509, 8001, 11783, 7397, 7587, 127089, 15391}}, {16422, 18, 50992, {1, 3, 5, 5, 25, 25, 63, 25, 203, 655, 2039, 2545, 5405, 1377, 30543, 65531, 122825, 6853}}, {16423, 18, 50997, {1, 1, 7, 9, 9, 43, 73, 195, 465, 497, 1085, 3821, 7115, 7513, 21913, 32499, 96467, 181905}}, {16424, 18, 51001, {1, 1, 3, 7, 29, 29, 63, 131, 409, 423, 687, 2549, 7367, 6867, 2685, 29137, 61845, 194409}}, {16425, 18, 51004, {1, 3, 7, 7, 3, 23, 47, 31, 121, 629, 1771, 2387, 861, 2269, 29565, 19599, 18051, 121531}}, {16426, 18, 51033, {1, 1, 1, 3, 21, 13, 109, 105, 163, 433, 521, 3467, 6225, 3705, 30605, 3265, 119313, 2535}}, {16427, 18, 51045, {1, 3, 5, 3, 25, 25, 89, 177, 415, 67, 361, 3317, 6411, 4857, 23249, 41959, 59931, 35797}}, {16428, 18, 51052, {1, 3, 7, 15, 5, 37, 37, 65, 71, 13, 1621, 2217, 3723, 2113, 23755, 46521, 48091, 44307}}, {16429, 18, 51064, {1, 1, 5, 13, 5, 5, 63, 75, 61, 443, 1663, 3239, 7717, 2623, 5723, 42673, 8519, 58773}}, {16430, 18, 51085, {1, 1, 3, 1, 29, 13, 35, 61, 391, 517, 1007, 17, 2519, 7121, 20095, 33449, 21397, 103787}}, {16431, 18, 51127, {1, 1, 5, 1, 9, 45, 49, 151, 39, 347, 1821, 2687, 1551, 12117, 29429, 40963, 77795, 20941}}, {16432, 18, 51139, {1, 1, 5, 3, 13, 49, 107, 105, 201, 601, 1335, 2389, 6837, 11123, 22985, 62705, 59057, 128333}}, {16433, 18, 51153, {1, 3, 3, 13, 5, 3, 21, 103, 481, 621, 2037, 2963, 425, 4685, 27475, 24363, 116419, 171743}}, {16434, 18, 51181, {1, 3, 3, 5, 27, 27, 5, 91, 245, 421, 795, 1869, 6455, 4463, 23467, 24039, 69681, 262127}}, {16435, 18, 51182, {1, 3, 1, 11, 11, 5, 31, 253, 469, 593, 877, 2041, 4615, 1541, 11823, 58525, 128689, 95985}}, {16436, 18, 51194, {1, 3, 5, 13, 31, 35, 115, 73, 97, 213, 1499, 1371, 4239, 7897, 3987, 4833, 115043, 222743}}, {16437, 18, 51196, {1, 3, 3, 5, 31, 15, 17, 233, 137, 521, 1721, 1913, 1881, 13457, 10733, 61527, 19825, 192601}}, {16438, 18, 51200, {1, 3, 1, 3, 11, 21, 81, 77, 377, 915, 321, 3925, 867, 5491, 4707, 37307, 52141, 29155}}, {16439, 18, 51239, {1, 1, 5, 1, 13, 51, 97, 161, 295, 159, 1717, 3817, 4687, 1907, 2655, 60577, 73867, 161851}}, {16440, 18, 51240, {1, 1, 3, 13, 21, 31, 33, 145, 375, 377, 1429, 1981, 4851, 9047, 2685, 49037, 67399, 124243}}, {16441, 18, 51254, {1, 1, 7, 13, 1, 55, 65, 147, 471, 277, 1585, 3949, 1885, 1635, 15687, 46367, 120931, 192097}}, {16442, 18, 51260, {1, 1, 7, 9, 13, 27, 33, 41, 377, 863, 1297, 181, 2685, 11285, 3961, 63201, 59757, 70231}}, {16443, 18, 51342, {1, 1, 3, 15, 29, 3, 79, 25, 147, 683, 1563, 805, 5891, 3355, 20113, 48261, 38195, 14589}}, {16444, 18, 51370, {1, 1, 7, 11, 9, 15, 21, 33, 47, 923, 1291, 4001, 203, 305, 21575, 41915, 74769, 114921}}, {16445, 18, 51372, {1, 3, 7, 11, 15, 1, 75, 173, 473, 493, 291, 811, 931, 10731, 9855, 57891, 81575, 250565}}, {16446, 18, 51377, {1, 3, 3, 3, 31, 31, 71, 141, 389, 661, 71, 3245, 6827, 9219, 26607, 50511, 94783, 130785}}, {16447, 18, 51398, {1, 1, 7, 3, 9, 15, 67, 141, 293, 779, 3, 3311, 7063, 13709, 29715, 55227, 11043, 150343}}, {16448, 18, 51402, {1, 3, 3, 3, 21, 9, 45, 111, 207, 715, 345, 1345, 3079, 3851, 23709, 33919, 108213, 25353}}, {16449, 18, 51407, {1, 3, 5, 13, 7, 3, 35, 95, 397, 397, 1159, 2759, 5233, 16237, 12469, 29543, 39133, 64429}}, {16450, 18, 51410, {1, 1, 5, 13, 19, 35, 9, 7, 153, 843, 2025, 1379, 3361, 15889, 7411, 26399, 106295, 19851}}, {16451, 18, 51412, {1, 3, 1, 1, 21, 15, 71, 143, 279, 431, 487, 967, 4445, 11969, 16671, 48891, 59605, 230607}}, {16452, 18, 51419, {1, 3, 5, 1, 25, 63, 23, 143, 221, 805, 377, 1441, 1971, 1985, 10055, 35991, 115873, 223455}}, {16453, 18, 51428, {1, 3, 1, 7, 21, 57, 1, 185, 117, 75, 1623, 3805, 2385, 10245, 29009, 59149, 130219, 114763}}, {16454, 18, 51431, {1, 3, 1, 13, 19, 13, 105, 241, 47, 597, 1725, 2579, 3785, 1667, 12427, 62623, 60883, 189977}}, {16455, 18, 51460, {1, 3, 5, 13, 1, 55, 59, 133, 263, 415, 1013, 139, 3037, 13661, 15303, 27279, 84095, 184807}}, {16456, 18, 51475, {1, 3, 1, 11, 7, 45, 3, 179, 315, 639, 875, 3299, 5221, 8463, 17507, 59673, 73865, 98867}}, {16457, 18, 51477, {1, 3, 7, 7, 3, 3, 53, 233, 219, 519, 585, 3029, 3623, 9559, 2251, 43735, 121513, 208007}}, {16458, 18, 51478, {1, 3, 1, 3, 17, 47, 47, 145, 445, 541, 163, 2653, 165, 7213, 3311, 57335, 43967, 191841}}, {16459, 18, 51482, {1, 3, 5, 5, 7, 47, 39, 119, 13, 727, 887, 3743, 3807, 15267, 3977, 52833, 14851, 61851}}, {16460, 18, 51511, {1, 1, 3, 5, 9, 9, 107, 119, 501, 723, 1965, 3093, 6947, 1783, 11287, 24243, 14005, 106677}}, {16461, 18, 51518, {1, 3, 3, 11, 11, 29, 85, 243, 359, 195, 221, 1767, 6969, 15275, 20853, 26921, 40903, 29849}}, {16462, 18, 51568, {1, 3, 1, 5, 31, 3, 11, 247, 371, 339, 1263, 119, 791, 7425, 18879, 11333, 34359, 178929}}, {16463, 18, 51607, {1, 1, 3, 7, 23, 15, 121, 203, 441, 499, 779, 1971, 339, 8737, 6859, 32417, 97073, 256143}}, {16464, 18, 51618, {1, 1, 5, 11, 3, 23, 25, 51, 407, 677, 97, 281, 427, 3671, 7939, 54485, 3967, 210199}}, {16465, 18, 51630, {1, 1, 5, 9, 5, 45, 23, 171, 255, 967, 313, 3881, 6039, 10545, 3591, 51985, 37145, 99291}}, {16466, 18, 51655, {1, 1, 5, 7, 3, 13, 55, 147, 83, 369, 1707, 1919, 491, 11507, 29559, 29169, 65897, 80587}}, {16467, 18, 51673, {1, 1, 3, 13, 31, 41, 41, 237, 245, 109, 969, 1797, 8169, 6351, 3657, 9655, 109201, 245117}}, {16468, 18, 51683, {1, 3, 7, 5, 17, 23, 17, 219, 473, 1, 865, 1949, 7589, 10107, 3035, 19903, 79579, 138695}}, {16469, 18, 51709, {1, 3, 1, 15, 13, 57, 109, 117, 277, 773, 31, 3807, 7615, 2453, 22655, 51513, 108367, 248473}}, {16470, 18, 51716, {1, 1, 7, 11, 17, 59, 27, 167, 63, 931, 13, 3721, 1789, 7621, 31093, 27541, 37283, 35193}}, {16471, 18, 51774, {1, 3, 3, 11, 13, 9, 7, 85, 45, 151, 1865, 4049, 4433, 9517, 231, 30733, 93701, 126585}}, {16472, 18, 51829, {1, 3, 1, 13, 21, 33, 19, 87, 77, 425, 351, 1163, 7453, 12567, 24615, 35563, 127643, 28625}}, {16473, 18, 51830, {1, 1, 3, 11, 7, 35, 27, 47, 465, 595, 985, 573, 2541, 7841, 14749, 43761, 26699, 135895}}, {16474, 18, 51839, {1, 1, 1, 7, 25, 51, 93, 237, 355, 575, 1, 443, 5697, 1997, 28801, 11621, 62531, 88449}}, {16475, 18, 51849, {1, 1, 1, 9, 23, 35, 23, 91, 161, 601, 1401, 2187, 6283, 10711, 21277, 47771, 12589, 176625}}, {16476, 18, 51869, {1, 3, 3, 5, 13, 23, 33, 65, 213, 835, 539, 2487, 273, 6113, 18327, 52493, 17571, 160909}}, {16477, 18, 51886, {1, 3, 1, 5, 25, 9, 117, 201, 457, 331, 1455, 439, 4891, 5515, 21701, 9343, 29085, 120299}}, {16478, 18, 51905, {1, 1, 1, 5, 29, 7, 43, 125, 155, 43, 1949, 2901, 7293, 13683, 18289, 16873, 27899, 168631}}, {16479, 18, 51906, {1, 1, 7, 3, 29, 33, 53, 137, 301, 27, 1101, 837, 5843, 13167, 6073, 49083, 120031, 45065}}, {16480, 18, 51915, {1, 3, 5, 1, 31, 47, 127, 185, 279, 603, 1699, 1693, 3263, 9055, 3525, 46065, 79305, 19949}}, {16481, 18, 51948, {1, 3, 7, 9, 17, 47, 25, 191, 369, 877, 1477, 3041, 5123, 1393, 5061, 1755, 61051, 55299}}, {16482, 18, 51988, {1, 1, 5, 13, 13, 7, 89, 141, 251, 321, 1515, 2677, 5103, 12901, 29875, 165, 15073, 47795}}, {16483, 18, 51998, {1, 3, 1, 7, 1, 37, 55, 173, 191, 981, 685, 4003, 6319, 3037, 30637, 11955, 81015, 89239}}, {16484, 18, 52004, {1, 3, 5, 5, 1, 5, 55, 251, 229, 153, 425, 2793, 6779, 15797, 10087, 7573, 121789, 115479}}, {16485, 18, 52026, {1, 3, 7, 13, 23, 39, 23, 21, 55, 543, 1539, 3055, 7825, 2865, 8967, 56719, 117219, 142137}}, {16486, 18, 52036, {1, 1, 5, 13, 1, 29, 81, 11, 509, 61, 1681, 1911, 829, 10583, 7105, 42047, 128579, 48891}}, {16487, 18, 52082, {1, 1, 3, 13, 7, 27, 81, 89, 129, 239, 309, 1353, 5265, 12255, 29391, 1659, 114857, 43551}}, {16488, 18, 52127, {1, 1, 7, 13, 23, 15, 9, 93, 35, 839, 549, 1793, 4693, 13295, 10603, 18179, 33141, 239555}}, {16489, 18, 52145, {1, 3, 1, 7, 17, 5, 11, 193, 143, 579, 1199, 1239, 4503, 15855, 23345, 34789, 59427, 235319}}, {16490, 18, 52157, {1, 3, 5, 3, 25, 63, 11, 203, 415, 135, 261, 1843, 3409, 4605, 15213, 28537, 75787, 100007}}, {16491, 18, 52165, {1, 1, 1, 5, 3, 37, 29, 157, 213, 235, 959, 1087, 2843, 10265, 28233, 14281, 25867, 204031}}, {16492, 18, 52193, {1, 3, 3, 7, 19, 49, 55, 111, 253, 823, 533, 941, 2509, 5595, 9267, 28457, 84301, 165385}}, {16493, 18, 52211, {1, 3, 5, 9, 5, 59, 13, 85, 339, 889, 597, 3517, 7001, 5525, 25451, 13855, 19033, 182677}}, {16494, 18, 52213, {1, 3, 1, 15, 23, 29, 31, 105, 353, 825, 1977, 2013, 131, 1969, 427, 16465, 90817, 257931}}, {16495, 18, 52218, {1, 3, 1, 3, 29, 9, 109, 243, 321, 15, 1479, 787, 4667, 13925, 7347, 7977, 105585, 143959}}, {16496, 18, 52220, {1, 1, 7, 15, 5, 45, 11, 95, 215, 719, 827, 77, 7263, 5705, 26971, 26845, 82127, 2849}}, {16497, 18, 52238, {1, 1, 7, 9, 5, 43, 103, 133, 203, 127, 2021, 3609, 6971, 13447, 27089, 62287, 104391, 147901}}, {16498, 18, 52240, {1, 3, 1, 3, 3, 41, 61, 101, 381, 985, 1795, 2465, 2899, 13517, 23953, 38831, 43569, 128643}}, {16499, 18, 52243, {1, 3, 5, 5, 9, 49, 13, 7, 215, 85, 1203, 647, 6627, 1861, 17901, 40203, 13007, 84975}}, {16500, 18, 52250, {1, 3, 5, 15, 31, 13, 55, 89, 397, 641, 1599, 3379, 3401, 4173, 5757, 42945, 59269, 106891}}, {16501, 18, 52279, {1, 1, 5, 13, 25, 17, 45, 27, 151, 725, 819, 581, 3675, 3983, 9499, 47511, 128039, 56825}}, {16502, 18, 52285, {1, 1, 5, 1, 7, 11, 65, 63, 301, 927, 409, 3729, 7227, 12849, 17855, 36527, 2907, 66819}}, {16503, 18, 52306, {1, 3, 3, 3, 29, 35, 39, 1, 349, 429, 805, 3639, 3909, 4211, 10393, 36223, 72543, 136375}}, {16504, 18, 52370, {1, 1, 1, 9, 23, 27, 25, 213, 195, 455, 883, 3357, 7277, 9061, 14103, 6005, 35031, 72703}}, {16505, 18, 52432, {1, 1, 3, 3, 11, 17, 19, 181, 25, 775, 897, 3809, 2031, 13017, 7505, 37469, 107335, 174309}}, {16506, 18, 52457, {1, 1, 7, 13, 7, 1, 57, 27, 159, 465, 533, 3409, 3863, 14001, 8011, 25873, 14971, 67243}}, {16507, 18, 52466, {1, 1, 3, 11, 19, 5, 11, 19, 75, 489, 1879, 1539, 6563, 4729, 15605, 35203, 47993, 110139}}, {16508, 18, 52514, {1, 3, 5, 9, 23, 17, 67, 89, 379, 849, 1667, 955, 1537, 11781, 9791, 46959, 79481, 237335}}, {16509, 18, 52557, {1, 1, 7, 9, 3, 31, 127, 145, 29, 35, 463, 4009, 4427, 16215, 12093, 50085, 51259, 45091}}, {16510, 18, 52560, {1, 1, 5, 9, 25, 3, 1, 131, 221, 951, 117, 3227, 797, 7617, 13243, 50139, 26737, 105875}}, {16511, 18, 52585, {1, 1, 5, 3, 11, 5, 7, 155, 211, 865, 27, 3943, 7923, 9973, 23233, 37399, 89951, 106555}}, {16512, 18, 52586, {1, 1, 3, 13, 21, 61, 77, 121, 227, 527, 1641, 3535, 3801, 7221, 6423, 9179, 114935, 33373}}, {16513, 18, 52603, {1, 3, 7, 5, 31, 7, 123, 159, 367, 369, 1905, 1689, 6773, 675, 30289, 54149, 71469, 232835}}, {16514, 18, 52650, {1, 1, 1, 13, 9, 23, 83, 237, 251, 941, 781, 1489, 6037, 6001, 15909, 50527, 60143, 238499}}, {16515, 18, 52672, {1, 3, 1, 11, 5, 7, 103, 43, 413, 247, 535, 2107, 1801, 16381, 32529, 2355, 39143, 71281}}, {16516, 18, 52681, {1, 1, 7, 5, 5, 31, 19, 11, 191, 643, 923, 1661, 2215, 11817, 23937, 62907, 128301, 21459}}, {16517, 18, 52692, {1, 3, 7, 15, 1, 51, 123, 61, 99, 751, 1819, 1191, 3865, 8765, 7131, 33965, 55697, 87059}}, {16518, 18, 52735, {1, 1, 5, 13, 5, 57, 41, 103, 135, 207, 517, 3995, 2537, 15705, 9123, 26193, 30653, 190549}}, {16519, 18, 52760, {1, 1, 3, 1, 23, 5, 109, 209, 407, 143, 943, 2325, 8087, 559, 23675, 31815, 43805, 67497}}, {16520, 18, 52772, {1, 1, 5, 9, 25, 33, 13, 21, 93, 357, 1551, 739, 5595, 16285, 30761, 54075, 75505, 177333}}, {16521, 18, 52781, {1, 3, 5, 11, 17, 59, 31, 249, 95, 561, 1849, 4061, 5577, 2607, 30083, 59033, 56697, 89761}}, {16522, 18, 52793, {1, 1, 3, 13, 27, 57, 9, 17, 323, 813, 1197, 2775, 3443, 9523, 24509, 12129, 89697, 169043}}, {16523, 18, 52796, {1, 3, 5, 13, 17, 51, 91, 1, 105, 345, 829, 1365, 2755, 7197, 26655, 1303, 52223, 133893}}, {16524, 18, 52807, {1, 1, 7, 1, 31, 3, 51, 21, 327, 851, 153, 3329, 3393, 8489, 5879, 25035, 124403, 172657}}, {16525, 18, 52821, {1, 1, 1, 5, 3, 21, 61, 29, 99, 343, 621, 3163, 3763, 9347, 7691, 34667, 24555, 125819}}, {16526, 18, 52849, {1, 1, 1, 1, 3, 17, 83, 191, 83, 315, 1091, 589, 5081, 4611, 15521, 25791, 9103, 13741}}, {16527, 18, 52866, {1, 3, 5, 3, 7, 53, 9, 227, 399, 857, 673, 3027, 5045, 5573, 7467, 4813, 99659, 142845}}, {16528, 18, 52868, {1, 1, 5, 11, 23, 37, 71, 151, 279, 879, 601, 2391, 7091, 12669, 10203, 11747, 9613, 248261}}, {16529, 18, 52872, {1, 1, 3, 3, 29, 25, 33, 25, 1, 683, 1475, 457, 3641, 14219, 20105, 21449, 6903, 43819}}, {16530, 18, 52875, {1, 1, 7, 7, 5, 1, 73, 79, 357, 971, 699, 1105, 1683, 1687, 32677, 62467, 47671, 88149}}, {16531, 18, 52886, {1, 3, 1, 15, 23, 13, 93, 75, 307, 81, 1607, 1333, 6969, 7747, 27135, 58941, 26355, 5565}}, {16532, 18, 52890, {1, 1, 7, 3, 27, 35, 85, 195, 421, 999, 1721, 2029, 283, 13995, 21649, 7519, 73357, 193171}}, {16533, 18, 52896, {1, 3, 7, 15, 17, 63, 21, 187, 475, 671, 1681, 2731, 8169, 3327, 19789, 53295, 43219, 6949}}, {16534, 18, 52925, {1, 1, 7, 13, 9, 33, 47, 115, 295, 123, 1293, 1627, 4261, 4503, 15925, 16521, 81759, 247089}}, {16535, 18, 52931, {1, 3, 1, 13, 11, 15, 83, 129, 409, 465, 873, 1333, 7939, 973, 2753, 33727, 128975, 43333}}, {16536, 18, 52937, {1, 3, 3, 3, 27, 59, 1, 137, 145, 29, 1189, 2615, 3249, 11197, 17165, 32313, 14065, 44199}}, {16537, 18, 52938, {1, 3, 3, 11, 17, 49, 107, 111, 45, 963, 1129, 1775, 7671, 1495, 14531, 49743, 63321, 159841}}, {16538, 18, 52952, {1, 1, 5, 9, 5, 11, 79, 99, 155, 347, 1777, 3793, 1765, 2319, 3135, 30237, 100845, 52689}}, {16539, 18, 52979, {1, 3, 7, 13, 21, 57, 71, 207, 149, 161, 265, 991, 6967, 8905, 21581, 13921, 79201, 95667}}, {16540, 18, 53013, {1, 3, 5, 15, 13, 53, 95, 81, 443, 161, 1071, 2749, 6637, 837, 15015, 62397, 33295, 112005}}, {16541, 18, 53023, {1, 3, 1, 1, 31, 25, 37, 111, 79, 293, 249, 1523, 1509, 1993, 17167, 62939, 118281, 62699}}, {16542, 18, 53027, {1, 3, 7, 7, 5, 33, 61, 179, 265, 405, 287, 1899, 437, 1609, 19617, 41093, 36341, 176593}}, {16543, 18, 53033, {1, 1, 5, 3, 9, 33, 97, 45, 23, 807, 1575, 627, 7465, 4805, 11191, 35439, 69433, 47275}}, {16544, 18, 53039, {1, 1, 1, 5, 1, 51, 51, 247, 453, 449, 1487, 141, 2501, 8039, 14749, 63733, 91963, 232951}}, {16545, 18, 53041, {1, 3, 3, 13, 15, 7, 81, 211, 445, 15, 899, 835, 5163, 3403, 7367, 29963, 80413, 87209}}, {16546, 18, 53048, {1, 3, 1, 11, 25, 43, 113, 139, 381, 391, 485, 1503, 4195, 10109, 13771, 35865, 50909, 224887}}, {16547, 18, 53073, {1, 1, 7, 9, 9, 51, 21, 85, 137, 765, 951, 2453, 227, 9177, 1457, 47937, 84203, 118987}}, {16548, 18, 53095, {1, 3, 5, 9, 1, 1, 21, 41, 133, 317, 519, 2249, 3453, 2957, 2029, 54737, 42515, 176017}}, {16549, 18, 53099, {1, 3, 1, 7, 9, 27, 79, 193, 209, 281, 267, 1267, 7013, 13667, 13331, 32863, 5289, 15077}}, {16550, 18, 53120, {1, 1, 5, 11, 29, 3, 3, 177, 75, 485, 1735, 3955, 4349, 7893, 13075, 58735, 8629, 78143}}, {16551, 18, 53154, {1, 1, 7, 13, 3, 15, 15, 77, 7, 843, 1561, 461, 6817, 4363, 7861, 45697, 115663, 93789}}, {16552, 18, 53168, {1, 1, 1, 7, 5, 35, 83, 213, 229, 383, 747, 337, 2589, 683, 18575, 42415, 74889, 227331}}, {16553, 18, 53192, {1, 3, 5, 3, 17, 35, 57, 213, 247, 273, 689, 1889, 5667, 357, 4267, 11611, 20621, 159039}}, {16554, 18, 53205, {1, 3, 3, 15, 7, 55, 25, 83, 293, 939, 1169, 2507, 3939, 7537, 2959, 40231, 124511, 181091}}, {16555, 18, 53206, {1, 1, 5, 9, 31, 51, 67, 149, 509, 695, 449, 2761, 6597, 4741, 4205, 49177, 45599, 167807}}, {16556, 18, 53234, {1, 1, 7, 15, 3, 7, 113, 71, 279, 885, 251, 2831, 855, 6673, 6511, 63861, 41109, 177119}}, {16557, 18, 53246, {1, 1, 5, 3, 7, 23, 125, 11, 217, 1023, 549, 529, 3891, 10595, 13751, 37729, 113469, 110549}}, {16558, 18, 53253, {1, 1, 3, 15, 21, 9, 13, 63, 93, 635, 659, 2837, 6303, 10083, 10107, 27859, 33891, 181229}}, {16559, 18, 53263, {1, 1, 7, 3, 3, 43, 5, 149, 353, 353, 565, 2441, 7113, 6493, 30355, 17887, 110787, 187199}}, {16560, 18, 53275, {1, 1, 3, 7, 19, 43, 99, 63, 169, 743, 185, 3817, 6677, 5549, 1609, 24701, 98669, 233701}}, {16561, 18, 53313, {1, 1, 1, 1, 21, 49, 73, 169, 223, 551, 553, 917, 4705, 14951, 14031, 19753, 96205, 131755}}, {16562, 18, 53331, {1, 1, 3, 3, 17, 49, 51, 249, 293, 921, 435, 2915, 3125, 3487, 11417, 35043, 29543, 35933}}, {16563, 18, 53349, {1, 1, 3, 9, 23, 43, 73, 151, 379, 911, 671, 151, 955, 11885, 28795, 23967, 117135, 137985}}, {16564, 18, 53367, {1, 1, 3, 7, 29, 3, 51, 231, 59, 227, 443, 3533, 7785, 12535, 25725, 7451, 9391, 239281}}, {16565, 18, 53383, {1, 3, 3, 9, 17, 37, 91, 195, 5, 843, 313, 1417, 1207, 3225, 15949, 34023, 1275, 221057}}, {16566, 18, 53392, {1, 1, 3, 15, 3, 51, 111, 135, 63, 495, 1967, 2151, 197, 10913, 20705, 1021, 68431, 67119}}, {16567, 18, 53404, {1, 1, 5, 3, 7, 29, 87, 219, 273, 267, 1317, 797, 6723, 947, 29867, 32571, 12337, 234715}}, {16568, 18, 53407, {1, 3, 5, 15, 1, 9, 91, 63, 97, 107, 451, 4025, 233, 7803, 17031, 7669, 49417, 256611}}, {16569, 18, 53411, {1, 1, 7, 3, 17, 17, 45, 197, 227, 133, 799, 411, 6739, 8037, 19553, 53009, 25201, 107625}}, {16570, 18, 53417, {1, 3, 5, 7, 3, 39, 25, 95, 197, 127, 45, 173, 3305, 6575, 19633, 54919, 35373, 59509}}, {16571, 18, 53425, {1, 3, 3, 3, 9, 1, 107, 211, 217, 715, 311, 3641, 8055, 1, 9017, 29329, 128467, 46911}}, {16572, 18, 53443, {1, 1, 1, 7, 1, 13, 13, 79, 259, 533, 1761, 449, 3363, 3061, 26227, 50407, 122951, 261425}}, {16573, 18, 53469, {1, 3, 5, 5, 29, 19, 41, 7, 25, 203, 587, 3321, 655, 15877, 10423, 41481, 70325, 165527}}, {16574, 18, 53480, {1, 3, 5, 9, 11, 45, 91, 253, 7, 137, 795, 2379, 4527, 1677, 5081, 6523, 97245, 3691}}, {16575, 18, 53508, {1, 3, 7, 9, 25, 43, 125, 243, 391, 785, 651, 3245, 7979, 14689, 15443, 40501, 5519, 96551}}, {16576, 18, 53535, {1, 1, 1, 3, 25, 53, 45, 159, 47, 701, 1655, 2019, 2355, 11213, 12403, 42291, 44925, 72689}}, {16577, 18, 53536, {1, 1, 1, 5, 21, 19, 77, 31, 3, 161, 149, 3759, 6331, 12311, 7021, 1117, 12459, 134821}}, {16578, 18, 53542, {1, 1, 3, 9, 9, 59, 23, 255, 437, 625, 719, 3727, 7157, 1889, 31523, 59127, 114143, 174179}}, {16579, 18, 53563, {1, 1, 1, 15, 23, 7, 47, 137, 77, 519, 1681, 1159, 6121, 14789, 21343, 43101, 44709, 179863}}, {16580, 18, 53577, {1, 3, 1, 3, 17, 27, 103, 11, 327, 735, 1949, 3719, 811, 2267, 13187, 29747, 98433, 242021}}, {16581, 18, 53591, {1, 1, 7, 15, 15, 63, 25, 203, 109, 585, 409, 4093, 6669, 2381, 30721, 58975, 17235, 257959}}, {16582, 18, 53607, {1, 3, 3, 5, 5, 19, 27, 69, 69, 193, 693, 1169, 6321, 3425, 9285, 28019, 128343, 185165}}, {16583, 18, 53626, {1, 1, 3, 9, 7, 51, 113, 93, 81, 385, 1811, 2601, 2065, 1029, 24515, 7199, 26425, 174283}}, {16584, 18, 53628, {1, 1, 1, 5, 29, 55, 93, 219, 281, 887, 891, 2763, 6083, 9627, 18559, 21329, 73887, 83699}}, {16585, 18, 53638, {1, 1, 1, 3, 21, 31, 49, 173, 15, 177, 1001, 3453, 5623, 14107, 8837, 10163, 26817, 41947}}, {16586, 18, 53675, {1, 1, 3, 5, 27, 63, 117, 49, 405, 281, 981, 2363, 1525, 9685, 29089, 16739, 66509, 125823}}, {16587, 18, 53685, {1, 3, 7, 13, 27, 29, 57, 189, 345, 135, 753, 463, 731, 4823, 14335, 33299, 105229, 54705}}, {16588, 18, 53692, {1, 3, 1, 1, 9, 43, 51, 25, 371, 261, 1409, 3493, 2811, 12915, 16075, 62159, 125945, 108453}}, {16589, 18, 53703, {1, 3, 7, 15, 13, 33, 47, 53, 263, 669, 1383, 3059, 4043, 4777, 14679, 2077, 11019, 5803}}, {16590, 18, 53722, {1, 1, 3, 11, 21, 7, 39, 71, 215, 79, 1849, 1261, 45, 1273, 27591, 4653, 25119, 30445}}, {16591, 18, 53738, {1, 3, 5, 9, 21, 3, 17, 207, 417, 777, 37, 3349, 2761, 4469, 3457, 15593, 87251, 38601}}, {16592, 18, 53748, {1, 1, 7, 13, 29, 29, 101, 103, 487, 87, 1129, 2497, 5501, 4813, 8623, 25077, 50487, 94053}}, {16593, 18, 53752, {1, 3, 3, 11, 7, 23, 95, 245, 127, 55, 431, 2707, 4955, 15871, 29589, 60023, 1921, 227623}}, {16594, 18, 53764, {1, 1, 3, 11, 17, 61, 103, 59, 477, 99, 1203, 157, 203, 557, 22921, 47363, 12853, 144067}}, {16595, 18, 53781, {1, 3, 1, 13, 15, 23, 51, 109, 499, 841, 1779, 2515, 2519, 4945, 20061, 12395, 9223, 157901}}, {16596, 18, 53788, {1, 3, 7, 9, 9, 15, 57, 223, 223, 463, 427, 2145, 1219, 12639, 28361, 46019, 128101, 198479}}, {16597, 18, 53791, {1, 3, 7, 7, 1, 1, 99, 101, 135, 169, 1885, 3979, 3051, 13649, 26607, 45067, 4503, 74087}}, {16598, 18, 53816, {1, 3, 7, 5, 17, 63, 27, 45, 447, 759, 1099, 3407, 489, 2719, 31577, 10355, 126835, 203439}}, {16599, 18, 53824, {1, 1, 5, 1, 21, 19, 1, 239, 433, 531, 1181, 2021, 423, 3235, 8457, 44459, 117401, 63545}}, {16600, 18, 53830, {1, 3, 7, 13, 21, 39, 25, 65, 405, 785, 137, 2899, 3255, 11165, 7827, 46425, 89063, 102787}}, {16601, 18, 53839, {1, 1, 1, 11, 25, 3, 39, 61, 395, 35, 2001, 3201, 2233, 9625, 26489, 54167, 88495, 127441}}, {16602, 18, 53844, {1, 1, 7, 7, 3, 27, 11, 49, 117, 711, 1881, 1457, 6759, 10517, 12733, 47435, 103111, 237237}}, {16603, 18, 53875, {1, 1, 5, 5, 1, 61, 121, 155, 223, 733, 1349, 2825, 2093, 4481, 21389, 40227, 20453, 116907}}, {16604, 18, 53921, {1, 3, 7, 7, 5, 11, 85, 131, 345, 723, 853, 3679, 7859, 11923, 16619, 63169, 127261, 155665}}, {16605, 18, 53922, {1, 1, 5, 1, 3, 51, 93, 225, 197, 893, 555, 2611, 6225, 7819, 31655, 12235, 24919, 31451}}, {16606, 18, 53927, {1, 1, 3, 3, 11, 23, 95, 205, 85, 705, 545, 155, 5533, 14837, 8341, 42473, 96891, 70695}}, {16607, 18, 53948, {1, 3, 3, 5, 17, 31, 99, 187, 219, 275, 685, 2933, 4535, 13495, 20351, 60667, 95211, 129233}}, {16608, 18, 53956, {1, 1, 1, 11, 9, 11, 123, 231, 127, 199, 733, 2495, 2601, 10565, 3155, 45251, 128319, 187457}}, {16609, 18, 53990, {1, 3, 1, 9, 3, 33, 41, 109, 279, 851, 1115, 3773, 2383, 1885, 6993, 59693, 69863, 88081}}, {16610, 18, 53994, {1, 1, 7, 13, 3, 27, 27, 203, 337, 965, 959, 1125, 2897, 8653, 15827, 51187, 12121, 4665}}, {16611, 18, 54001, {1, 3, 1, 9, 19, 7, 23, 113, 257, 671, 571, 1061, 4353, 217, 13603, 27961, 68431, 147187}}, {16612, 18, 54016, {1, 3, 5, 9, 25, 61, 7, 139, 237, 859, 761, 2005, 5981, 153, 6553, 53005, 72653, 33571}}, {16613, 18, 54019, {1, 3, 5, 5, 9, 35, 63, 149, 427, 65, 635, 1955, 1845, 13781, 9761, 36147, 91479, 141305}}, {16614, 18, 54070, {1, 1, 3, 5, 13, 39, 53, 113, 481, 933, 239, 3713, 7453, 12363, 14763, 46955, 108545, 74349}}, {16615, 18, 54074, {1, 3, 1, 7, 13, 41, 57, 225, 213, 617, 1947, 2855, 4885, 8553, 20259, 57125, 59369, 178553}}, {16616, 18, 54088, {1, 3, 5, 15, 31, 31, 19, 87, 461, 403, 1193, 2123, 4991, 14551, 17153, 14171, 17157, 194879}}, {16617, 18, 54102, {1, 1, 5, 11, 5, 27, 119, 65, 111, 455, 1949, 3441, 6951, 6819, 12839, 6913, 57695, 145925}}, {16618, 18, 54111, {1, 1, 1, 15, 19, 41, 55, 45, 33, 559, 589, 3773, 745, 8515, 32389, 47797, 145, 105503}}, {16619, 18, 54130, {1, 1, 3, 15, 13, 53, 35, 223, 247, 893, 149, 553, 829, 5129, 26417, 15769, 95411, 6595}}, {16620, 18, 54152, {1, 1, 5, 3, 3, 59, 35, 187, 387, 3, 847, 3579, 7869, 481, 23955, 22191, 21041, 230449}}, {16621, 18, 54170, {1, 1, 3, 15, 23, 11, 97, 199, 11, 647, 803, 2391, 5791, 2223, 22187, 49675, 87775, 196871}}, {16622, 18, 54172, {1, 3, 7, 5, 25, 63, 107, 227, 133, 337, 1767, 2459, 2987, 10463, 25001, 17047, 79901, 222877}}, {16623, 18, 54211, {1, 3, 1, 13, 25, 5, 47, 109, 473, 389, 1743, 3951, 4231, 827, 4189, 29903, 106909, 152835}}, {16624, 18, 54218, {1, 1, 5, 3, 7, 61, 121, 189, 303, 21, 957, 545, 7893, 3217, 25847, 29371, 100569, 132393}}, {16625, 18, 54228, {1, 1, 1, 15, 29, 17, 59, 37, 449, 149, 845, 555, 7603, 11911, 18477, 23279, 107167, 160339}}, {16626, 18, 54251, {1, 1, 7, 5, 13, 27, 43, 167, 443, 445, 2011, 2179, 2785, 13663, 21957, 2455, 18217, 19303}}, {16627, 18, 54253, {1, 1, 1, 5, 19, 45, 71, 39, 21, 791, 1467, 855, 3101, 8267, 15529, 919, 105313, 75627}}, {16628, 18, 54268, {1, 3, 1, 11, 31, 25, 57, 177, 211, 327, 679, 771, 7725, 6123, 23931, 48223, 9063, 133319}}, {16629, 18, 54271, {1, 3, 5, 3, 1, 11, 19, 153, 177, 563, 1919, 117, 5583, 1519, 16623, 10871, 15511, 66113}}, {16630, 18, 54274, {1, 1, 7, 7, 9, 45, 63, 253, 415, 347, 81, 2991, 2691, 2383, 15573, 33783, 12445, 224107}}, {16631, 18, 54288, {1, 3, 5, 5, 7, 17, 99, 231, 439, 1009, 623, 833, 685, 6419, 30313, 56197, 73239, 260007}}, {16632, 18, 54314, {1, 1, 5, 5, 5, 51, 97, 239, 267, 629, 1211, 2175, 5681, 3107, 11381, 57047, 120175, 131285}}, {16633, 18, 54319, {1, 1, 7, 7, 29, 11, 21, 49, 481, 279, 1795, 1295, 453, 15985, 19941, 51853, 15115, 107271}}, {16634, 18, 54321, {1, 1, 5, 1, 23, 61, 33, 21, 409, 57, 903, 557, 1673, 2759, 23705, 4109, 58865, 233081}}, {16635, 18, 54324, {1, 1, 1, 5, 11, 37, 79, 15, 213, 485, 1477, 3925, 3205, 9267, 22043, 54197, 57101, 66185}}, {16636, 18, 54341, {1, 1, 7, 13, 31, 27, 95, 141, 131, 43, 2039, 2257, 17, 14427, 5699, 22263, 86851, 226283}}, {16637, 18, 54353, {1, 3, 5, 5, 11, 5, 5, 217, 363, 163, 1241, 3683, 1409, 1731, 20973, 63849, 35041, 94859}}, {16638, 18, 54366, {1, 1, 7, 1, 25, 61, 67, 239, 369, 319, 1157, 2435, 2147, 12057, 4451, 3005, 31787, 199653}}, {16639, 18, 54370, {1, 3, 5, 1, 11, 57, 1, 163, 433, 11, 1299, 1711, 1601, 4677, 16481, 25175, 63893, 41853}}, {16640, 18, 54420, {1, 1, 3, 1, 29, 49, 91, 15, 313, 533, 115, 4005, 3157, 10615, 27915, 52613, 64447, 93091}}, {16641, 18, 54423, {1, 3, 7, 3, 7, 17, 103, 67, 237, 595, 1571, 3421, 3971, 11123, 145, 52087, 59273, 21417}}, {16642, 18, 54434, {1, 3, 5, 11, 31, 37, 105, 205, 377, 243, 841, 3153, 6847, 14171, 19947, 61561, 35, 261753}}, {16643, 18, 54440, {1, 3, 5, 9, 29, 21, 103, 219, 107, 427, 1841, 2015, 2919, 5721, 8631, 48841, 33281, 35835}}, {16644, 18, 54454, {1, 1, 3, 5, 25, 27, 67, 65, 305, 677, 1975, 1049, 7277, 15279, 30181, 48941, 119087, 130265}}, {16645, 18, 54495, {1, 1, 3, 9, 29, 27, 109, 167, 351, 463, 663, 3155, 919, 10627, 30163, 62233, 32927, 210775}}, {16646, 18, 54501, {1, 3, 5, 5, 19, 9, 17, 93, 33, 999, 1537, 3045, 3735, 4625, 31363, 46075, 80985, 108331}}, {16647, 18, 54526, {1, 3, 7, 7, 11, 63, 83, 157, 205, 505, 657, 1901, 1405, 8349, 16473, 29397, 130379, 167963}}, {16648, 18, 54639, {1, 3, 1, 15, 25, 49, 65, 189, 461, 923, 1839, 2597, 2471, 14103, 2915, 48429, 74387, 243465}}, {16649, 18, 54653, {1, 3, 7, 11, 31, 47, 109, 21, 205, 343, 1999, 315, 8119, 15937, 8761, 55257, 99983, 131641}}, {16650, 18, 54667, {1, 1, 3, 11, 3, 23, 73, 125, 17, 967, 1811, 1413, 4783, 8303, 25301, 26859, 90583, 140721}}, {16651, 18, 54678, {1, 1, 5, 5, 25, 41, 49, 127, 391, 381, 1575, 1697, 5205, 12805, 24365, 20275, 58819, 167845}}, {16652, 18, 54700, {1, 1, 7, 11, 17, 53, 51, 35, 383, 931, 359, 2863, 119, 6683, 26247, 14281, 49205, 256869}}, {16653, 18, 54717, {1, 1, 7, 9, 23, 5, 69, 97, 407, 15, 579, 2905, 47, 6227, 23997, 42459, 26569, 225467}}, {16654, 18, 54780, {1, 3, 3, 11, 7, 3, 125, 87, 347, 79, 1571, 1513, 285, 12101, 1731, 27887, 42009, 173243}}, {16655, 18, 54801, {1, 3, 7, 13, 3, 5, 99, 29, 77, 873, 1111, 1451, 5493, 10669, 22597, 54437, 55521, 101617}}, {16656, 18, 54813, {1, 3, 1, 3, 3, 17, 41, 215, 207, 71, 683, 1979, 4849, 2437, 5717, 28999, 55005, 233929}}, {16657, 18, 54814, {1, 1, 1, 1, 23, 21, 105, 223, 5, 235, 1533, 3715, 2689, 13937, 12125, 63879, 111537, 39817}}, {16658, 18, 54850, {1, 3, 3, 15, 25, 47, 71, 229, 21, 563, 1851, 2423, 131, 4431, 31567, 8883, 1311, 227893}}, {16659, 18, 54883, {1, 3, 5, 11, 7, 23, 19, 59, 397, 315, 1149, 3595, 5973, 11027, 5233, 55237, 102777, 137421}}, {16660, 18, 54907, {1, 1, 7, 9, 17, 61, 45, 235, 387, 171, 1079, 3119, 6933, 3591, 751, 35495, 49969, 204611}}, {16661, 18, 54919, {1, 1, 7, 7, 21, 7, 105, 79, 81, 245, 1229, 409, 5159, 9815, 6713, 4687, 120541, 246133}}, {16662, 18, 54931, {1, 3, 7, 13, 23, 31, 85, 97, 481, 497, 581, 1179, 243, 1767, 11855, 11599, 3141, 104741}}, {16663, 18, 54933, {1, 3, 7, 3, 3, 45, 15, 29, 413, 631, 273, 1007, 2979, 11307, 24535, 9305, 83591, 77121}}, {16664, 18, 54991, {1, 3, 7, 15, 21, 55, 11, 169, 417, 631, 141, 1489, 3371, 16073, 11215, 15479, 125341, 131731}}, {16665, 18, 55003, {1, 1, 7, 5, 13, 33, 7, 121, 295, 191, 497, 2233, 997, 13833, 14503, 38357, 79007, 53985}}, {16666, 18, 55009, {1, 3, 3, 3, 29, 63, 97, 27, 449, 643, 317, 1989, 1481, 2873, 21247, 35989, 61295, 101829}}, {16667, 18, 55030, {1, 3, 1, 7, 13, 49, 27, 227, 21, 983, 179, 2761, 2859, 2851, 26447, 33295, 126963, 41441}}, {16668, 18, 55034, {1, 1, 5, 13, 27, 1, 61, 115, 185, 867, 2017, 2257, 5035, 7855, 25849, 48189, 28287, 133261}}, {16669, 18, 55039, {1, 1, 7, 13, 27, 17, 13, 205, 379, 717, 247, 3341, 2841, 10845, 26979, 5589, 1935, 48371}}, {16670, 18, 55048, {1, 3, 1, 11, 9, 51, 25, 185, 65, 643, 1867, 3825, 3395, 8883, 29239, 20019, 19071, 3377}}, {16671, 18, 55059, {1, 1, 1, 1, 11, 57, 61, 113, 419, 249, 153, 2883, 87, 7919, 11941, 46725, 38701, 73715}}, {16672, 18, 55061, {1, 3, 3, 11, 3, 15, 19, 87, 27, 839, 463, 1757, 3137, 10821, 2857, 58101, 91983, 137045}}, {16673, 18, 55068, {1, 3, 3, 1, 25, 25, 15, 93, 359, 5, 53, 647, 6245, 1957, 4651, 14697, 12193, 231303}}, {16674, 18, 55077, {1, 1, 5, 9, 31, 49, 69, 223, 133, 595, 777, 1281, 727, 6671, 21453, 14193, 51769, 258301}}, {16675, 18, 55122, {1, 3, 5, 11, 29, 37, 75, 17, 229, 121, 313, 2873, 5233, 13231, 7589, 40075, 42101, 137697}}, {16676, 18, 55149, {1, 1, 7, 1, 31, 9, 15, 63, 149, 5, 1785, 21, 2619, 15071, 3243, 58023, 20697, 205181}}, {16677, 18, 55157, {1, 3, 7, 7, 25, 61, 59, 157, 251, 303, 1905, 2389, 1681, 319, 14155, 49089, 45381, 124447}}, {16678, 18, 55158, {1, 3, 5, 5, 25, 27, 41, 125, 105, 867, 365, 117, 7215, 2887, 28499, 9597, 105999, 150189}}, {16679, 18, 55178, {1, 1, 5, 13, 5, 33, 47, 221, 207, 641, 525, 3215, 5293, 16343, 16169, 44393, 26305, 194411}}, {16680, 18, 55222, {1, 3, 5, 13, 29, 17, 31, 77, 511, 465, 1141, 597, 5111, 6629, 14557, 13057, 11643, 250925}}, {16681, 18, 55234, {1, 1, 7, 11, 1, 5, 65, 139, 471, 265, 1145, 965, 47, 10971, 15615, 62031, 58523, 175593}}, {16682, 18, 55236, {1, 1, 5, 1, 23, 61, 57, 139, 377, 843, 79, 2873, 1823, 7551, 26741, 63031, 124879, 115295}}, {16683, 18, 55251, {1, 1, 5, 13, 9, 19, 1, 61, 331, 1015, 1035, 1691, 4057, 6071, 24929, 39569, 95695, 39307}}, {16684, 18, 55269, {1, 3, 3, 5, 23, 17, 13, 65, 381, 893, 1879, 3735, 1547, 6735, 30251, 11471, 102997, 126429}}, {16685, 18, 55270, {1, 1, 5, 13, 1, 43, 15, 1, 155, 221, 1463, 3793, 6467, 7221, 28027, 55357, 69397, 87565}}, {16686, 18, 55284, {1, 1, 7, 3, 17, 9, 71, 75, 77, 639, 1251, 701, 473, 12337, 1893, 6349, 10837, 27797}}, {16687, 18, 55309, {1, 3, 5, 11, 11, 11, 125, 23, 161, 937, 707, 2487, 695, 8495, 16219, 33671, 109463, 248305}}, {16688, 18, 55322, {1, 1, 1, 11, 5, 49, 15, 47, 393, 407, 39, 1867, 7727, 12701, 7805, 119, 77401, 186421}}, {16689, 18, 55334, {1, 1, 5, 5, 19, 21, 77, 187, 387, 51, 1497, 1225, 3101, 791, 529, 4321, 118435, 112889}}, {16690, 18, 55340, {1, 3, 1, 13, 27, 17, 11, 63, 201, 909, 1549, 3243, 1803, 9461, 20985, 24637, 100993, 200473}}, {16691, 18, 55348, {1, 3, 7, 13, 11, 35, 97, 213, 415, 467, 2013, 2159, 7017, 7895, 18235, 50659, 113169, 141887}}, {16692, 18, 55377, {1, 1, 3, 7, 13, 21, 119, 109, 471, 323, 277, 1685, 2399, 14777, 2643, 5879, 113043, 45223}}, {16693, 18, 55430, {1, 3, 1, 13, 19, 5, 1, 75, 499, 297, 1897, 591, 3223, 12939, 30593, 4053, 122207, 215171}}, {16694, 18, 55433, {1, 3, 3, 9, 21, 11, 29, 205, 13, 381, 569, 599, 7089, 8145, 18531, 34477, 101057, 64269}}, {16695, 18, 55441, {1, 1, 5, 15, 1, 19, 37, 131, 325, 441, 3, 4001, 6937, 9207, 27543, 30321, 37083, 241019}}, {16696, 18, 55470, {1, 3, 7, 13, 7, 15, 9, 159, 97, 905, 557, 1913, 7325, 4057, 19461, 14277, 36873, 25619}}, {16697, 18, 55535, {1, 3, 5, 7, 3, 51, 99, 9, 185, 227, 2041, 331, 3925, 12481, 17485, 37137, 3753, 125269}}, {16698, 18, 55561, {1, 1, 7, 11, 31, 49, 89, 37, 49, 863, 833, 3263, 351, 6277, 23055, 49727, 25005, 161585}}, {16699, 18, 55567, {1, 3, 5, 1, 9, 35, 89, 101, 117, 365, 1015, 1159, 4623, 4541, 6831, 28091, 10647, 221415}}, {16700, 18, 55597, {1, 1, 5, 5, 13, 47, 125, 209, 199, 885, 927, 1411, 795, 8835, 28589, 48753, 27191, 53455}}, {16701, 18, 55630, {1, 1, 5, 9, 7, 19, 3, 87, 157, 121, 1433, 1463, 3241, 5969, 203, 36723, 14779, 63949}}, {16702, 18, 55648, {1, 1, 3, 9, 1, 47, 71, 113, 405, 561, 1149, 3599, 4173, 6819, 5493, 45987, 41521, 221503}}, {16703, 18, 55653, {1, 3, 3, 1, 3, 55, 101, 103, 161, 549, 457, 2529, 2043, 8843, 5677, 7449, 45185, 178289}}, {16704, 18, 55657, {1, 1, 1, 3, 31, 25, 1, 161, 7, 503, 641, 2221, 749, 1521, 6151, 19245, 55913, 80141}}, {16705, 18, 55665, {1, 1, 1, 9, 3, 45, 73, 217, 249, 929, 163, 2139, 3921, 11223, 11161, 52697, 89633, 14243}}, {16706, 18, 55678, {1, 1, 7, 15, 17, 41, 5, 119, 211, 53, 985, 2679, 679, 9349, 25577, 26947, 35141, 93999}}, {16707, 18, 55684, {1, 3, 1, 15, 17, 43, 51, 15, 363, 615, 889, 195, 6279, 15477, 31545, 50941, 119711, 66535}}, {16708, 18, 55691, {1, 1, 1, 13, 7, 11, 17, 127, 131, 759, 739, 161, 5937, 13611, 31757, 10681, 101357, 82873}}, {16709, 18, 55693, {1, 3, 5, 7, 21, 63, 75, 33, 233, 981, 589, 3409, 3523, 1871, 8919, 38513, 32825, 56935}}, {16710, 18, 55702, {1, 3, 5, 3, 9, 9, 85, 221, 203, 727, 1035, 1069, 2409, 2687, 235, 23395, 64163, 193235}}, {16711, 18, 55708, {1, 3, 3, 7, 1, 35, 119, 175, 203, 819, 207, 2283, 4175, 3581, 11647, 43073, 104573, 86607}}, {16712, 18, 55715, {1, 3, 3, 15, 11, 63, 59, 153, 279, 779, 261, 3317, 7671, 11727, 19381, 33227, 79331, 187227}}, {16713, 18, 55739, {1, 1, 3, 1, 7, 1, 115, 15, 235, 9, 1877, 1911, 1089, 9939, 9537, 39563, 95327, 70323}}, {16714, 18, 55761, {1, 1, 5, 7, 25, 61, 63, 145, 425, 617, 1813, 3255, 6797, 16019, 18849, 44191, 69877, 179933}}, {16715, 18, 55767, {1, 1, 3, 13, 17, 45, 69, 247, 27, 367, 871, 1185, 895, 7991, 8145, 22869, 97609, 14673}}, {16716, 18, 55768, {1, 3, 3, 11, 19, 41, 99, 213, 159, 803, 121, 1197, 2849, 15191, 15603, 52445, 105077, 128231}}, {16717, 18, 55774, {1, 3, 1, 11, 21, 61, 117, 167, 437, 447, 419, 1673, 755, 15331, 29819, 16099, 130773, 177547}}, {16718, 18, 55787, {1, 3, 7, 7, 1, 15, 79, 109, 351, 71, 985, 89, 7517, 4175, 30533, 52125, 100863, 186477}}, {16719, 18, 55811, {1, 1, 3, 1, 15, 1, 103, 65, 511, 241, 1279, 3233, 7141, 255, 10925, 28271, 56151, 252121}}, {16720, 18, 55835, {1, 1, 1, 13, 17, 49, 59, 93, 19, 343, 979, 865, 3447, 4595, 3067, 26807, 98915, 126237}}, {16721, 18, 55894, {1, 3, 3, 5, 17, 5, 91, 199, 191, 775, 233, 919, 277, 3485, 9231, 37025, 23493, 186745}}, {16722, 18, 55897, {1, 3, 1, 1, 11, 5, 103, 187, 85, 47, 1111, 883, 6155, 15315, 9041, 58275, 75037, 7773}}, {16723, 18, 55904, {1, 3, 1, 3, 19, 5, 7, 211, 481, 713, 383, 1203, 6089, 15817, 31577, 7283, 25457, 101455}}, {16724, 18, 55931, {1, 3, 5, 7, 21, 9, 59, 127, 375, 477, 721, 3931, 7089, 9079, 5015, 62019, 113747, 36055}}, {16725, 18, 55950, {1, 3, 7, 13, 3, 17, 47, 177, 103, 535, 1787, 509, 5253, 2857, 13421, 19875, 37397, 251353}}, {16726, 18, 55961, {1, 1, 5, 7, 19, 31, 41, 93, 301, 45, 251, 2691, 4657, 2627, 17321, 24627, 80221, 117191}}, {16727, 18, 55973, {1, 3, 5, 7, 5, 31, 27, 3, 463, 549, 1669, 499, 815, 4091, 7049, 60957, 102849, 235617}}, {16728, 18, 56078, {1, 3, 5, 1, 21, 31, 57, 201, 503, 977, 893, 3927, 1605, 8265, 5137, 51009, 89375, 237909}}, {16729, 18, 56099, {1, 3, 3, 1, 27, 5, 11, 81, 445, 229, 5, 543, 3397, 12961, 31911, 36945, 59485, 305}}, {16730, 18, 56105, {1, 1, 5, 13, 31, 63, 39, 171, 243, 39, 1147, 459, 7215, 14603, 20625, 47369, 121495, 237741}}, {16731, 18, 56119, {1, 3, 3, 13, 15, 63, 39, 23, 305, 685, 1885, 571, 2657, 16031, 24759, 10639, 25619, 246137}}, {16732, 18, 56133, {1, 1, 1, 5, 19, 33, 5, 187, 167, 725, 1405, 511, 701, 13283, 3513, 16495, 8755, 221751}}, {16733, 18, 56168, {1, 1, 7, 11, 3, 27, 27, 237, 495, 637, 479, 3247, 3825, 2567, 12853, 52881, 34807, 161483}}, {16734, 18, 56191, {1, 3, 3, 9, 23, 43, 101, 175, 19, 443, 787, 1053, 4113, 12777, 4615, 53115, 2873, 117383}}, {16735, 18, 56202, {1, 3, 1, 13, 3, 23, 33, 93, 145, 937, 957, 2463, 827, 383, 16749, 61567, 10029, 188159}}, {16736, 18, 56209, {1, 1, 7, 15, 21, 23, 3, 71, 323, 995, 645, 1189, 1029, 519, 3479, 13587, 95641, 215337}}, {16737, 18, 56215, {1, 3, 7, 11, 9, 17, 101, 59, 421, 417, 797, 3089, 773, 15959, 18127, 13681, 104667, 217433}}, {16738, 18, 56232, {1, 3, 5, 7, 31, 21, 9, 7, 377, 589, 1497, 939, 5389, 10997, 22291, 19639, 72187, 66193}}, {16739, 18, 56240, {1, 1, 1, 13, 19, 1, 127, 185, 251, 167, 1289, 2715, 5885, 12715, 18261, 36861, 102721, 246917}}, {16740, 18, 56260, {1, 1, 7, 1, 23, 41, 19, 151, 125, 465, 813, 1711, 7933, 13561, 29737, 59207, 62533, 124149}}, {16741, 18, 56270, {1, 3, 5, 9, 7, 13, 17, 119, 425, 877, 1207, 2211, 2943, 13921, 28251, 44143, 112149, 152341}}, {16742, 18, 56278, {1, 3, 5, 9, 15, 21, 87, 83, 77, 731, 91, 3091, 5687, 9647, 2037, 39031, 106583, 66533}}, {16743, 18, 56281, {1, 1, 7, 9, 31, 49, 7, 119, 147, 599, 1191, 297, 1597, 10723, 16893, 47387, 106995, 165409}}, {16744, 18, 56288, {1, 3, 3, 3, 3, 63, 11, 193, 241, 63, 1671, 2139, 5689, 13967, 9239, 7535, 34237, 140283}}, {16745, 18, 56303, {1, 3, 5, 13, 9, 23, 65, 247, 473, 825, 109, 1897, 245, 10517, 8147, 25989, 96447, 118689}}, {16746, 18, 56308, {1, 1, 3, 5, 27, 35, 65, 23, 159, 729, 189, 2661, 4245, 14377, 21043, 15551, 2717, 146949}}, {16747, 18, 56312, {1, 1, 3, 13, 23, 5, 35, 63, 293, 347, 883, 149, 5145, 10821, 5813, 24183, 94711, 64787}}, {16748, 18, 56320, {1, 1, 5, 3, 27, 3, 127, 141, 237, 535, 1509, 2755, 5843, 2379, 19413, 52345, 100247, 42571}}, {16749, 18, 56326, {1, 3, 3, 9, 1, 55, 61, 105, 29, 1021, 1215, 2157, 7453, 4643, 26793, 33553, 2959, 51485}}, {16750, 18, 56392, {1, 1, 3, 7, 31, 51, 59, 49, 321, 207, 415, 2115, 219, 5045, 31133, 17961, 130779, 28255}}, {16751, 18, 56395, {1, 3, 7, 15, 9, 29, 31, 185, 111, 959, 7, 827, 7891, 5449, 22221, 49933, 2091, 194683}}, {16752, 18, 56403, {1, 3, 7, 1, 11, 59, 75, 255, 387, 913, 423, 2915, 5079, 6363, 5175, 57977, 5559, 13257}}, {16753, 18, 56419, {1, 1, 7, 1, 21, 3, 21, 13, 157, 3, 715, 3525, 7769, 5333, 25345, 53473, 44323, 203167}}, {16754, 18, 56428, {1, 1, 7, 11, 31, 25, 55, 5, 169, 695, 1599, 2357, 1427, 14469, 15223, 34275, 42605, 23005}}, {16755, 18, 56450, {1, 1, 1, 15, 19, 51, 117, 135, 297, 831, 329, 3793, 4673, 3795, 24185, 52971, 30423, 68771}}, {16756, 18, 56452, {1, 1, 7, 5, 19, 33, 79, 77, 315, 29, 307, 1709, 3489, 14515, 12477, 58939, 53753, 165031}}, {16757, 18, 56485, {1, 1, 7, 1, 27, 57, 119, 207, 355, 279, 1371, 3917, 2821, 5285, 12673, 28973, 54957, 94001}}, {16758, 18, 56486, {1, 3, 7, 3, 19, 57, 53, 199, 485, 805, 301, 1337, 5993, 2187, 30573, 12045, 101205, 129841}}, {16759, 18, 56492, {1, 1, 3, 9, 15, 45, 71, 119, 445, 759, 1361, 1299, 2927, 2343, 22085, 53733, 21241, 1553}}, {16760, 18, 56498, {1, 3, 5, 3, 27, 11, 1, 239, 497, 343, 1989, 1463, 2473, 5191, 6271, 14129, 124453, 96817}}, {16761, 18, 56510, {1, 3, 5, 7, 27, 19, 123, 27, 483, 557, 1545, 1871, 1297, 587, 1067, 51259, 119231, 173659}}, {16762, 18, 56512, {1, 3, 1, 1, 27, 45, 41, 113, 453, 553, 2019, 2039, 1709, 13017, 5497, 34459, 60295, 229405}}, {16763, 18, 56524, {1, 3, 1, 11, 1, 57, 51, 125, 261, 915, 1673, 25, 529, 653, 17247, 64225, 98991, 248143}}, {16764, 18, 56530, {1, 3, 5, 15, 25, 27, 31, 1, 463, 249, 113, 1955, 2223, 5463, 12281, 20843, 26495, 256759}}, {16765, 18, 56545, {1, 1, 3, 11, 27, 33, 57, 205, 89, 435, 1983, 1165, 3843, 127, 30179, 63971, 10211, 105403}}, {16766, 18, 56551, {1, 3, 3, 5, 21, 49, 35, 161, 273, 205, 41, 1881, 2013, 12549, 24859, 55711, 98235, 237281}}, {16767, 18, 56565, {1, 3, 3, 1, 15, 35, 95, 1, 221, 675, 385, 2257, 2531, 2129, 12895, 11565, 125977, 51973}}, {16768, 18, 56580, {1, 1, 1, 15, 19, 61, 35, 55, 9, 721, 499, 2577, 3001, 14861, 22293, 56195, 72855, 166703}}, {16769, 18, 56587, {1, 1, 1, 7, 5, 25, 59, 175, 81, 989, 935, 2579, 8183, 1109, 4645, 53753, 115795, 105091}}, {16770, 18, 56589, {1, 3, 3, 13, 7, 55, 7, 113, 197, 763, 1747, 3291, 1109, 4391, 18257, 28563, 97413, 5847}}, {16771, 18, 56592, {1, 1, 1, 7, 23, 55, 91, 83, 479, 305, 843, 2055, 3405, 15243, 31551, 5275, 8651, 66915}}, {16772, 18, 56611, {1, 3, 7, 9, 3, 19, 83, 229, 235, 903, 1495, 1033, 2729, 14927, 11847, 22979, 13905, 84413}}, {16773, 18, 56623, {1, 3, 3, 13, 27, 37, 83, 193, 475, 439, 745, 757, 7359, 6683, 5839, 50765, 6933, 117411}}, {16774, 18, 56635, {1, 3, 5, 11, 31, 25, 33, 77, 113, 815, 123, 2721, 2133, 8995, 15237, 54565, 5155, 51235}}, {16775, 18, 56646, {1, 3, 3, 7, 15, 31, 73, 91, 379, 39, 913, 53, 41, 1059, 25883, 11769, 63015, 48125}}, {16776, 18, 56660, {1, 1, 5, 5, 5, 13, 81, 169, 71, 529, 1429, 2101, 4069, 5509, 30283, 40625, 103673, 183243}}, {16777, 18, 56680, {1, 3, 3, 5, 23, 39, 39, 237, 445, 567, 343, 2521, 2287, 1851, 2315, 59979, 5015, 243349}}, {16778, 18, 56686, {1, 1, 7, 1, 1, 51, 89, 229, 187, 207, 245, 3521, 2987, 4347, 6997, 62565, 54397, 140473}}, {16779, 18, 56716, {1, 3, 1, 5, 7, 59, 45, 161, 457, 655, 1591, 215, 2213, 15101, 14791, 40397, 95811, 126291}}, {16780, 18, 56749, {1, 1, 3, 1, 5, 23, 7, 199, 143, 561, 1669, 17, 8109, 11003, 4535, 8593, 112021, 223153}}, {16781, 18, 56790, {1, 3, 5, 9, 3, 37, 111, 15, 235, 697, 385, 2197, 909, 1247, 26199, 50661, 100643, 122577}}, {16782, 18, 56809, {1, 3, 5, 11, 23, 53, 95, 75, 463, 137, 1511, 3373, 3071, 547, 22399, 51891, 9123, 240925}}, {16783, 18, 56869, {1, 3, 7, 3, 21, 35, 69, 197, 371, 15, 185, 3539, 29, 15071, 17069, 34669, 37023, 189385}}, {16784, 18, 56884, {1, 1, 1, 15, 5, 21, 7, 5, 201, 881, 841, 827, 503, 3545, 17771, 64481, 65105, 209947}}, {16785, 18, 56887, {1, 1, 1, 5, 3, 31, 83, 201, 455, 169, 1797, 1769, 1999, 8629, 14313, 16851, 64955, 180631}}, {16786, 18, 56893, {1, 1, 5, 5, 1, 35, 49, 61, 499, 619, 1509, 3015, 237, 8979, 3471, 11513, 80193, 24135}}, {16787, 18, 56906, {1, 3, 3, 9, 25, 29, 111, 19, 339, 739, 1751, 2671, 5399, 5965, 3943, 45577, 70605, 203117}}, {16788, 18, 56932, {1, 3, 3, 7, 3, 9, 15, 147, 177, 545, 161, 2211, 4653, 15891, 15939, 19153, 77827, 245787}}, {16789, 18, 56959, {1, 1, 1, 1, 25, 47, 37, 159, 273, 825, 1037, 2047, 7149, 5517, 699, 49687, 110115, 159475}}, {16790, 18, 56965, {1, 3, 1, 7, 7, 55, 77, 231, 197, 381, 2013, 2421, 7551, 9955, 21031, 11365, 48271, 190147}}, {16791, 18, 56983, {1, 1, 5, 9, 25, 1, 81, 145, 215, 427, 905, 2307, 6149, 12777, 131, 57091, 106137, 24625}}, {16792, 18, 57018, {1, 3, 1, 13, 13, 63, 103, 245, 275, 745, 841, 2993, 2083, 8903, 4499, 55979, 22323, 244447}}, {16793, 18, 57023, {1, 1, 5, 5, 15, 11, 59, 181, 191, 219, 599, 59, 1079, 4445, 16537, 31127, 103257, 233855}}, {16794, 18, 57025, {1, 3, 7, 9, 9, 37, 109, 41, 145, 1001, 609, 551, 6843, 13791, 15103, 27851, 7693, 145207}}, {16795, 18, 57032, {1, 3, 1, 9, 3, 35, 63, 219, 49, 567, 1537, 1327, 6487, 16039, 26019, 13851, 116929, 175121}}, {16796, 18, 57040, {1, 3, 7, 15, 17, 31, 27, 91, 241, 229, 485, 2601, 3859, 12609, 19847, 31939, 50815, 235529}}, {16797, 18, 57046, {1, 1, 5, 15, 27, 31, 3, 47, 69, 427, 95, 1445, 1223, 2953, 32343, 6841, 67851, 79561}}, {16798, 18, 57071, {1, 3, 5, 13, 13, 37, 19, 127, 259, 139, 1597, 651, 4845, 6413, 18205, 56005, 32107, 140783}}, {16799, 18, 57091, {1, 1, 7, 5, 15, 23, 81, 195, 127, 113, 499, 733, 5907, 12107, 18105, 28113, 16111, 152327}}, {16800, 18, 57094, {1, 1, 5, 15, 9, 49, 109, 181, 187, 591, 1625, 3641, 313, 1225, 11725, 9047, 30351, 124301}}, {16801, 18, 57108, {1, 3, 1, 1, 9, 45, 103, 219, 155, 805, 1775, 759, 1687, 11415, 21623, 37831, 18995, 21667}}, {16802, 18, 57122, {1, 3, 3, 5, 25, 13, 11, 37, 489, 935, 373, 811, 5045, 3615, 2111, 22909, 117155, 69483}}, {16803, 18, 57127, {1, 3, 3, 5, 9, 45, 71, 87, 265, 93, 161, 2983, 1023, 3633, 5965, 9499, 35653, 219257}}, {16804, 18, 57168, {1, 1, 5, 13, 21, 27, 101, 231, 85, 469, 1023, 3735, 5093, 253, 22585, 61975, 81041, 4175}}, {16805, 18, 57183, {1, 3, 1, 7, 5, 41, 105, 153, 391, 5, 1917, 331, 7679, 14359, 13177, 40755, 78669, 133527}}, {16806, 18, 57184, {1, 3, 3, 15, 21, 61, 87, 63, 227, 195, 1095, 1629, 7787, 5887, 20855, 30203, 61973, 30627}}, {16807, 18, 57193, {1, 3, 1, 15, 31, 41, 125, 223, 201, 717, 1309, 595, 5333, 10585, 32525, 8597, 92637, 111073}}, {16808, 18, 57202, {1, 3, 5, 3, 21, 29, 39, 105, 275, 515, 503, 79, 6715, 14203, 14035, 20871, 122417, 243167}}, {16809, 18, 57235, {1, 3, 7, 5, 29, 41, 3, 89, 165, 879, 773, 3989, 3945, 4771, 2809, 59105, 37177, 193887}}, {16810, 18, 57237, {1, 3, 3, 3, 27, 1, 91, 191, 135, 257, 527, 2971, 7117, 6013, 8735, 52363, 110617, 96959}}, {16811, 18, 57251, {1, 3, 7, 9, 3, 63, 67, 67, 231, 23, 1539, 771, 1485, 4331, 19231, 50539, 15081, 75945}}, {16812, 18, 57289, {1, 3, 3, 11, 29, 11, 77, 67, 497, 861, 21, 2939, 2463, 14435, 27399, 19733, 118207, 60909}}, {16813, 18, 57349, {1, 1, 5, 5, 1, 11, 117, 55, 485, 877, 1213, 2231, 2613, 14027, 18491, 45431, 113303, 28457}}, {16814, 18, 57359, {1, 3, 7, 1, 13, 49, 77, 59, 455, 251, 1033, 3451, 7641, 389, 3987, 62361, 90125, 94569}}, {16815, 18, 57374, {1, 1, 7, 15, 3, 5, 45, 173, 343, 445, 1871, 2505, 1385, 2641, 21299, 35139, 61781, 101195}}, {16816, 18, 57377, {1, 3, 1, 9, 25, 27, 89, 123, 473, 901, 1513, 2585, 5641, 13123, 22653, 32985, 15763, 9161}}, {16817, 18, 57387, {1, 3, 3, 9, 29, 41, 5, 127, 489, 715, 1981, 3953, 3557, 10081, 31913, 52191, 118727, 4443}}, {16818, 18, 57415, {1, 1, 5, 1, 19, 57, 125, 33, 253, 297, 265, 2249, 6859, 14971, 3519, 24783, 127491, 210441}}, {16819, 18, 57440, {1, 1, 7, 7, 31, 1, 47, 175, 305, 933, 679, 317, 7511, 13219, 9509, 61183, 58907, 72905}}, {16820, 18, 57446, {1, 1, 1, 7, 13, 49, 75, 85, 341, 911, 1217, 3631, 1849, 9715, 23193, 947, 106647, 180455}}, {16821, 18, 57450, {1, 1, 7, 7, 1, 49, 91, 195, 329, 771, 607, 1707, 2723, 291, 21393, 6549, 31645, 151431}}, {16822, 18, 57469, {1, 3, 7, 5, 17, 57, 7, 231, 247, 217, 1729, 3231, 7515, 15341, 18681, 21733, 28723, 228187}}, {16823, 18, 57491, {1, 1, 5, 9, 5, 19, 121, 251, 43, 951, 957, 173, 4863, 5027, 6781, 29421, 4877, 47749}}, {16824, 18, 57503, {1, 3, 7, 7, 11, 33, 107, 233, 329, 589, 869, 913, 7687, 13223, 27577, 24379, 13037, 214713}}, {16825, 18, 57507, {1, 3, 7, 13, 1, 13, 121, 103, 387, 193, 543, 3085, 4323, 9885, 24499, 34985, 45763, 13107}}, {16826, 18, 57542, {1, 1, 3, 15, 25, 63, 85, 41, 457, 779, 1199, 2235, 309, 2549, 3341, 36265, 17873, 32361}}, {16827, 18, 57569, {1, 3, 3, 3, 15, 31, 11, 57, 499, 415, 1625, 1195, 6863, 6073, 25083, 57705, 76203, 130993}}, {16828, 18, 57599, {1, 3, 5, 5, 21, 13, 43, 161, 255, 31, 1901, 3325, 3209, 9809, 8227, 9005, 57263, 95095}}, {16829, 18, 57601, {1, 1, 3, 15, 13, 33, 5, 123, 291, 579, 1747, 3319, 7351, 1679, 11365, 26909, 74445, 139017}}, {16830, 18, 57607, {1, 1, 3, 13, 17, 39, 1, 253, 487, 935, 1711, 1397, 503, 7817, 28509, 20665, 78551, 204319}}, {16831, 18, 57608, {1, 1, 3, 1, 5, 39, 123, 105, 305, 77, 63, 3285, 7463, 11199, 647, 37757, 91083, 108325}}, {16832, 18, 57625, {1, 1, 7, 5, 9, 49, 121, 155, 389, 119, 1327, 3583, 7715, 2705, 20047, 19151, 101455, 205263}}, {16833, 18, 57644, {1, 1, 5, 7, 31, 23, 13, 109, 103, 41, 433, 3609, 4973, 11481, 8381, 4725, 113633, 134651}}, {16834, 18, 57662, {1, 3, 7, 7, 25, 25, 107, 189, 89, 625, 187, 2185, 713, 10107, 11139, 63681, 97005, 79329}}, {16835, 18, 57664, {1, 3, 1, 11, 3, 41, 43, 161, 337, 955, 1035, 451, 5989, 3593, 18087, 22667, 110213, 128545}}, {16836, 18, 57674, {1, 1, 5, 1, 25, 31, 95, 113, 205, 565, 557, 3885, 7163, 10703, 27159, 11395, 117459, 52439}}, {16837, 18, 57698, {1, 1, 1, 5, 27, 31, 39, 61, 323, 983, 1361, 2387, 5401, 8287, 17855, 49783, 65327, 202861}}, {16838, 18, 57700, {1, 3, 5, 3, 31, 39, 105, 113, 183, 311, 667, 945, 3677, 14623, 27907, 16673, 77899, 182863}}, {16839, 18, 57709, {1, 1, 5, 3, 17, 27, 99, 93, 81, 805, 1799, 2855, 6859, 3917, 26177, 22307, 59213, 210123}}, {16840, 18, 57724, {1, 3, 5, 1, 19, 37, 51, 65, 495, 229, 229, 1283, 2967, 5329, 24339, 58739, 23145, 7033}}, {16841, 18, 57728, {1, 3, 3, 15, 11, 51, 121, 41, 75, 845, 1771, 3625, 6137, 3463, 11767, 45181, 70907, 42771}}, {16842, 18, 57740, {1, 3, 7, 9, 15, 25, 55, 219, 265, 655, 167, 1247, 5409, 5623, 21045, 12333, 25799, 218601}}, {16843, 18, 57745, {1, 3, 3, 13, 31, 39, 77, 155, 471, 969, 755, 2745, 3057, 3621, 32423, 48687, 9409, 90997}}, {16844, 18, 57751, {1, 1, 3, 15, 27, 1, 77, 231, 147, 235, 2027, 4045, 7431, 14655, 6361, 43155, 9839, 161713}}, {16845, 18, 57774, {1, 3, 7, 5, 25, 19, 25, 75, 415, 931, 457, 3691, 687, 4849, 15469, 42871, 37949, 74163}}, {16846, 18, 57782, {1, 3, 5, 9, 17, 19, 29, 117, 387, 1021, 1159, 2467, 2585, 2563, 9155, 44763, 93319, 6321}}, {16847, 18, 57796, {1, 3, 5, 7, 25, 33, 127, 175, 143, 705, 539, 2563, 945, 11369, 19971, 19019, 116195, 84121}}, {16848, 18, 57803, {1, 3, 7, 7, 5, 55, 29, 1, 419, 715, 1275, 2983, 7853, 12245, 32109, 27371, 123547, 82723}}, {16849, 18, 57823, {1, 1, 1, 13, 3, 29, 31, 213, 195, 609, 1465, 1711, 6747, 13309, 1131, 3151, 48779, 91571}}, {16850, 18, 57863, {1, 1, 5, 3, 17, 7, 103, 7, 217, 87, 1641, 833, 4551, 14205, 15119, 6711, 111273, 200545}}, {16851, 18, 57894, {1, 3, 1, 5, 3, 39, 99, 15, 433, 895, 165, 4049, 3183, 4385, 24695, 40009, 67151, 156643}}, {16852, 18, 57925, {1, 1, 7, 3, 29, 9, 15, 27, 109, 1019, 327, 2837, 5297, 12455, 2355, 37703, 122995, 177871}}, {16853, 18, 57971, {1, 1, 5, 15, 29, 5, 121, 117, 31, 155, 1027, 1105, 8057, 8677, 9523, 3019, 98801, 15539}}, {16854, 18, 58013, {1, 3, 7, 3, 1, 1, 37, 67, 471, 317, 1571, 2801, 7383, 4339, 8095, 45685, 95885, 39577}}, {16855, 18, 58020, {1, 3, 7, 13, 17, 13, 91, 79, 49, 321, 1235, 311, 129, 6537, 6643, 25813, 48251, 138823}}, {16856, 18, 58032, {1, 1, 5, 3, 21, 19, 67, 61, 153, 611, 1819, 3755, 5959, 3419, 6117, 1159, 68925, 146199}}, {16857, 18, 58038, {1, 1, 7, 9, 23, 3, 7, 13, 429, 463, 653, 3461, 6337, 4511, 18097, 44837, 99845, 37101}}, {16858, 18, 58061, {1, 3, 5, 13, 9, 5, 123, 199, 83, 409, 1391, 1567, 7327, 8173, 30971, 18241, 7755, 185375}}, {16859, 18, 58069, {1, 3, 1, 7, 19, 51, 51, 23, 85, 923, 1969, 2329, 7343, 12489, 16135, 64783, 117063, 141071}}, {16860, 18, 58080, {1, 3, 1, 3, 23, 29, 5, 77, 207, 351, 367, 2097, 2639, 9255, 21971, 64167, 98069, 81153}}, {16861, 18, 58089, {1, 1, 7, 15, 27, 1, 83, 255, 47, 935, 567, 3573, 3629, 5833, 483, 1001, 9337, 119847}}, {16862, 18, 58107, {1, 3, 7, 11, 31, 53, 25, 35, 463, 51, 401, 3279, 7709, 11265, 17905, 40423, 26277, 43355}}, {16863, 18, 58121, {1, 1, 7, 5, 9, 15, 73, 217, 239, 405, 1651, 2131, 6791, 11241, 21717, 7393, 77251, 28131}}, {16864, 18, 58130, {1, 3, 5, 3, 13, 43, 115, 159, 215, 811, 1349, 2941, 2073, 1821, 6891, 17285, 72027, 137849}}, {16865, 18, 58146, {1, 3, 3, 3, 15, 11, 29, 53, 307, 409, 1069, 3713, 3205, 6185, 2565, 14973, 46149, 162527}}, {16866, 18, 58190, {1, 1, 3, 15, 21, 39, 61, 209, 211, 123, 697, 2285, 859, 2501, 5847, 56449, 106575, 261069}}, {16867, 18, 58195, {1, 3, 3, 5, 25, 21, 39, 131, 189, 747, 1499, 1865, 3369, 9161, 12543, 63155, 70083, 69441}}, {16868, 18, 58202, {1, 3, 1, 15, 31, 43, 127, 57, 169, 109, 979, 1399, 3065, 5865, 16891, 56003, 14319, 94109}}, {16869, 18, 58237, {1, 1, 1, 13, 23, 57, 13, 239, 139, 41, 1959, 429, 209, 543, 21297, 15343, 16521, 52305}}, {16870, 18, 58253, {1, 1, 7, 1, 17, 1, 115, 139, 93, 123, 867, 3257, 8135, 12089, 1503, 33287, 79283, 151419}}, {16871, 18, 58299, {1, 3, 7, 7, 27, 17, 15, 253, 89, 959, 597, 2193, 3505, 13865, 2179, 58711, 114615, 15227}}, {16872, 18, 58302, {1, 3, 7, 5, 1, 5, 105, 241, 361, 229, 1069, 3815, 1409, 4909, 31785, 46555, 123523, 53259}}, {16873, 18, 58327, {1, 1, 5, 5, 15, 49, 13, 195, 467, 285, 1405, 3011, 2069, 8331, 13953, 31107, 46581, 154615}}, {16874, 18, 58328, {1, 3, 5, 7, 21, 23, 17, 17, 345, 369, 1521, 3755, 2165, 15387, 2851, 11115, 60483, 236049}}, {16875, 18, 58364, {1, 3, 3, 1, 5, 41, 53, 239, 127, 237, 609, 927, 3787, 5059, 1865, 52991, 56229, 102093}}, {16876, 18, 58367, {1, 1, 7, 5, 23, 7, 15, 199, 325, 695, 1525, 3435, 3997, 11577, 22985, 57713, 94309, 218433}}, {16877, 18, 58375, {1, 3, 3, 5, 25, 25, 61, 99, 237, 447, 1905, 783, 5239, 11415, 16833, 27815, 115539, 161111}}, {16878, 18, 58394, {1, 1, 5, 9, 31, 49, 55, 199, 159, 751, 849, 1045, 5485, 8883, 8549, 11735, 35983, 161067}}, {16879, 18, 58405, {1, 1, 5, 9, 23, 51, 79, 171, 87, 493, 1911, 3867, 3435, 493, 16639, 64085, 97797, 244959}}, {16880, 18, 58417, {1, 1, 5, 11, 29, 33, 15, 107, 283, 545, 1995, 995, 7181, 3581, 8621, 42391, 117997, 397}}, {16881, 18, 58424, {1, 3, 7, 13, 31, 25, 91, 75, 123, 451, 1023, 375, 4505, 13235, 8913, 34389, 77385, 168659}}, {16882, 18, 58430, {1, 1, 3, 3, 3, 3, 85, 143, 173, 709, 1313, 593, 6931, 14609, 13803, 30305, 109089, 11473}}, {16883, 18, 58452, {1, 3, 7, 5, 25, 45, 25, 223, 407, 597, 83, 2543, 3823, 13959, 9089, 28325, 29237, 57147}}, {16884, 18, 58466, {1, 1, 1, 3, 25, 53, 57, 255, 231, 361, 109, 113, 6091, 13043, 28399, 29111, 57987, 137709}}, {16885, 18, 58468, {1, 1, 1, 5, 11, 25, 53, 141, 275, 237, 1427, 1691, 6043, 8951, 10683, 17477, 117645, 89007}}, {16886, 18, 58495, {1, 3, 3, 13, 7, 23, 73, 213, 285, 667, 1765, 1545, 1401, 12483, 6349, 47205, 25791, 16749}}, {16887, 18, 58501, {1, 1, 1, 15, 31, 45, 105, 249, 385, 607, 723, 745, 7037, 15735, 3637, 29013, 127315, 165507}}, {16888, 18, 58544, {1, 1, 7, 5, 21, 63, 95, 247, 161, 839, 939, 931, 4277, 7363, 8289, 55183, 122413, 152997}}, {16889, 18, 58571, {1, 3, 7, 11, 15, 59, 91, 5, 209, 31, 1581, 979, 6289, 11443, 26641, 20183, 106907, 128647}}, {16890, 18, 58609, {1, 1, 3, 15, 21, 33, 117, 89, 457, 405, 1971, 2211, 4379, 16189, 7933, 39351, 79813, 56373}}, {16891, 18, 58610, {1, 3, 3, 9, 5, 9, 93, 75, 55, 271, 321, 3143, 3893, 2601, 26169, 35179, 43063, 156635}}, {16892, 18, 58616, {1, 3, 3, 11, 29, 37, 95, 249, 221, 965, 423, 1637, 4663, 14839, 16757, 4261, 128453, 165593}}, {16893, 18, 58619, {1, 3, 3, 7, 1, 55, 31, 235, 447, 839, 721, 1125, 6503, 4019, 23351, 37057, 96103, 143805}}, {16894, 18, 58641, {1, 3, 7, 5, 31, 39, 7, 157, 469, 719, 1613, 395, 8133, 9753, 17323, 13849, 45409, 7601}}, {16895, 18, 58642, {1, 3, 7, 7, 31, 37, 89, 215, 453, 659, 605, 3325, 987, 4611, 29667, 23229, 4201, 229675}}, {16896, 18, 58648, {1, 1, 5, 5, 3, 3, 21, 249, 377, 343, 1751, 891, 5275, 14853, 32703, 51001, 6759, 162991}}, {16897, 18, 58660, {1, 3, 1, 13, 11, 21, 55, 17, 495, 481, 1817, 919, 2495, 16367, 3343, 16997, 83437, 127791}}, {16898, 18, 58675, {1, 3, 1, 1, 5, 57, 65, 223, 33, 491, 1953, 1521, 4903, 5007, 14583, 17321, 82231, 206299}}, {16899, 18, 58678, {1, 3, 7, 11, 21, 45, 55, 141, 185, 379, 851, 885, 3385, 10311, 701, 2983, 71045, 171525}}, {16900, 18, 58690, {1, 3, 7, 3, 29, 1, 53, 139, 7, 985, 291, 3949, 1163, 14637, 363, 59679, 121571, 121081}}, {16901, 18, 58735, {1, 3, 7, 1, 31, 1, 111, 19, 421, 917, 1529, 1361, 4461, 12457, 9791, 19985, 77283, 117059}}, {16902, 18, 58760, {1, 3, 1, 5, 7, 55, 93, 243, 477, 193, 1983, 489, 3735, 1391, 24035, 36395, 49101, 175861}}, {16903, 18, 58766, {1, 1, 1, 11, 3, 25, 69, 167, 351, 193, 1299, 617, 7455, 2545, 18359, 9951, 119513, 128139}}, {16904, 18, 58799, {1, 3, 3, 7, 5, 23, 101, 47, 385, 591, 345, 3501, 531, 3277, 28945, 18695, 58587, 87221}}, {16905, 18, 58825, {1, 1, 3, 3, 29, 47, 5, 91, 365, 1, 2015, 323, 1601, 10615, 28975, 60263, 4813, 143351}}, {16906, 18, 58836, {1, 3, 1, 7, 25, 43, 65, 211, 91, 759, 985, 3675, 5701, 4373, 27781, 51949, 40667, 102665}}, {16907, 18, 58855, {1, 3, 3, 5, 3, 43, 91, 33, 247, 593, 849, 1955, 7769, 2307, 2877, 26037, 28907, 211021}}, {16908, 18, 58864, {1, 3, 5, 15, 29, 29, 85, 97, 99, 979, 2033, 1415, 2955, 15733, 5567, 6241, 100195, 89077}}, {16909, 18, 58910, {1, 3, 7, 13, 13, 19, 121, 211, 381, 73, 1131, 1881, 1693, 7873, 27557, 201, 24997, 202471}}, {16910, 18, 58937, {1, 3, 1, 15, 15, 33, 11, 99, 479, 271, 1873, 1117, 3559, 6605, 15995, 44805, 12465, 71933}}, {16911, 18, 58943, {1, 3, 5, 3, 19, 61, 15, 55, 423, 431, 1321, 3345, 1633, 4587, 24909, 54985, 31831, 181083}}, {16912, 18, 58952, {1, 1, 3, 5, 29, 43, 49, 205, 415, 907, 1651, 57, 3043, 10763, 16255, 9567, 59453, 135637}}, {16913, 18, 58965, {1, 3, 3, 1, 17, 11, 29, 33, 293, 203, 1687, 1565, 6131, 5435, 29023, 28425, 102151, 251913}}, {16914, 18, 58988, {1, 1, 5, 7, 9, 9, 43, 191, 269, 681, 607, 3045, 2799, 14919, 8083, 57781, 19345, 49365}}, {16915, 18, 58994, {1, 1, 5, 13, 11, 53, 67, 127, 117, 395, 575, 1651, 2601, 15019, 21413, 34433, 66847, 84159}}, {16916, 18, 58999, {1, 3, 5, 5, 15, 59, 33, 41, 301, 699, 1479, 2285, 1813, 2459, 4775, 53213, 26039, 223155}}, {16917, 18, 59006, {1, 3, 1, 15, 17, 57, 5, 211, 357, 175, 945, 3625, 3943, 12871, 26805, 29305, 8839, 107837}}, {16918, 18, 59029, {1, 3, 5, 15, 21, 41, 105, 229, 265, 777, 2047, 767, 2901, 8873, 7631, 18545, 86697, 252965}}, {16919, 18, 59033, {1, 1, 5, 11, 31, 63, 115, 119, 271, 921, 1221, 3341, 6083, 4293, 28581, 57323, 33889, 112577}}, {16920, 18, 59069, {1, 1, 5, 5, 31, 21, 119, 93, 287, 139, 451, 2535, 3925, 10671, 21279, 55071, 76127, 248203}}, {16921, 18, 59096, {1, 3, 7, 11, 19, 61, 61, 53, 203, 181, 963, 3581, 519, 14679, 7717, 31981, 128709, 197269}}, {16922, 18, 59106, {1, 1, 1, 13, 25, 23, 89, 95, 221, 803, 1433, 3617, 3217, 2033, 7859, 14279, 107239, 5139}}, {16923, 18, 59123, {1, 3, 7, 3, 29, 41, 87, 21, 71, 959, 1149, 2961, 7471, 11665, 16037, 5791, 110155, 35365}}, {16924, 18, 59130, {1, 1, 1, 11, 21, 49, 101, 45, 311, 529, 1301, 1377, 983, 3937, 6967, 8413, 33511, 9617}}, {16925, 18, 59152, {1, 3, 3, 5, 15, 41, 107, 49, 409, 537, 289, 3351, 5307, 16221, 907, 39847, 61579, 161487}}, {16926, 18, 59162, {1, 1, 3, 11, 5, 49, 71, 107, 431, 469, 453, 1367, 7811, 10485, 3861, 62797, 82025, 253785}}, {16927, 18, 59180, {1, 1, 3, 3, 27, 19, 89, 13, 445, 915, 1259, 1423, 3987, 3661, 18183, 18521, 18831, 191447}}, {16928, 18, 59183, {1, 1, 7, 5, 13, 15, 9, 89, 129, 949, 1733, 245, 6815, 8477, 1273, 34737, 33027, 191415}}, {16929, 18, 59195, {1, 1, 7, 15, 25, 63, 83, 195, 319, 987, 1395, 3559, 6287, 5139, 25967, 48711, 58467, 110983}}, {16930, 18, 59205, {1, 1, 3, 9, 5, 3, 35, 171, 15, 883, 915, 2451, 871, 11741, 32715, 33475, 81711, 259157}}, {16931, 18, 59210, {1, 1, 7, 13, 23, 63, 33, 11, 117, 351, 1701, 671, 6753, 5, 9477, 54701, 65507, 242621}}, {16932, 18, 59217, {1, 3, 7, 11, 21, 37, 127, 143, 369, 819, 1369, 93, 7009, 3773, 30153, 30181, 120783, 137857}}, {16933, 18, 59218, {1, 3, 3, 7, 27, 61, 15, 141, 67, 815, 1449, 1129, 4703, 3811, 3067, 61697, 8881, 110957}}, {16934, 18, 59236, {1, 1, 7, 13, 31, 21, 59, 75, 335, 851, 503, 251, 4869, 11789, 30871, 14641, 19319, 156843}}, {16935, 18, 59267, {1, 3, 5, 5, 9, 41, 11, 67, 231, 945, 37, 2925, 5723, 9053, 13477, 59735, 75181, 60335}}, {16936, 18, 59298, {1, 1, 5, 1, 13, 39, 81, 43, 363, 611, 1661, 3833, 7387, 10531, 21319, 55579, 102705, 103009}}, {16937, 18, 59318, {1, 3, 1, 7, 23, 25, 67, 179, 327, 401, 1693, 1453, 4773, 6363, 27169, 49747, 29055, 49145}}, {16938, 18, 59321, {1, 3, 5, 7, 13, 47, 5, 175, 369, 921, 507, 113, 6069, 10919, 11099, 19795, 95819, 52419}}, {16939, 18, 59327, {1, 1, 1, 5, 5, 53, 93, 47, 75, 837, 109, 3691, 6961, 10715, 14269, 63791, 1941, 136899}}, {16940, 18, 59354, {1, 1, 1, 3, 1, 63, 57, 117, 157, 327, 879, 2411, 3987, 15393, 8503, 29829, 77795, 121307}}, {16941, 18, 59363, {1, 3, 5, 1, 25, 5, 47, 45, 433, 121, 607, 1233, 6433, 3031, 16369, 58589, 79357, 151353}}, {16942, 18, 59377, {1, 1, 1, 1, 9, 15, 77, 163, 225, 445, 1479, 1267, 2571, 2661, 21489, 5433, 123969, 191967}}, {16943, 18, 59389, {1, 1, 7, 1, 9, 49, 17, 19, 449, 113, 1289, 2335, 3309, 2595, 17819, 18481, 86605, 125911}}, {16944, 18, 59403, {1, 1, 5, 11, 11, 23, 65, 147, 257, 625, 1901, 913, 5711, 8159, 16237, 25133, 100059, 11395}}, {16945, 18, 59420, {1, 3, 7, 13, 5, 33, 89, 189, 171, 185, 751, 2915, 5025, 15981, 14853, 12229, 52829, 59953}}, {16946, 18, 59444, {1, 3, 1, 13, 3, 37, 15, 87, 463, 655, 1927, 2705, 1885, 14801, 3491, 52835, 81761, 90273}}, {16947, 18, 59471, {1, 1, 7, 3, 5, 15, 29, 255, 199, 225, 647, 3215, 6795, 3821, 31763, 31059, 65495, 89981}}, {16948, 18, 59476, {1, 1, 7, 7, 9, 25, 11, 85, 111, 283, 507, 2077, 2993, 5415, 31785, 16495, 82361, 122105}}, {16949, 18, 59483, {1, 1, 3, 11, 27, 21, 127, 175, 397, 419, 1115, 2285, 223, 3881, 4187, 53759, 115035, 181647}}, {16950, 18, 59502, {1, 3, 7, 11, 27, 31, 29, 233, 137, 827, 1009, 3879, 7595, 12989, 27655, 8517, 28083, 214985}}, {16951, 18, 59509, {1, 3, 5, 9, 25, 23, 85, 191, 475, 445, 621, 1341, 4045, 4299, 24933, 32765, 20219, 86949}}, {16952, 18, 59538, {1, 3, 1, 5, 25, 35, 121, 33, 199, 405, 163, 3487, 1087, 743, 21989, 47273, 49221, 124831}}, {16953, 18, 59556, {1, 1, 5, 1, 7, 3, 91, 15, 335, 351, 1311, 777, 4303, 7203, 19465, 9135, 32251, 69805}}, {16954, 18, 59571, {1, 3, 3, 7, 23, 55, 73, 77, 189, 801, 1877, 1901, 2675, 1015, 3041, 35925, 125903, 126227}}, {16955, 18, 59592, {1, 3, 3, 1, 1, 23, 105, 75, 435, 743, 651, 1045, 579, 13637, 14821, 62683, 95229, 156475}}, {16956, 18, 59610, {1, 3, 3, 5, 1, 53, 89, 239, 439, 195, 189, 731, 1805, 15123, 23315, 47737, 29167, 112081}}, {16957, 18, 59654, {1, 1, 5, 7, 31, 11, 119, 191, 155, 61, 247, 915, 5813, 995, 20093, 23379, 118969, 65001}}, {16958, 18, 59677, {1, 3, 7, 3, 1, 61, 45, 85, 295, 269, 539, 1787, 6639, 11093, 11303, 18509, 77637, 200743}}, {16959, 18, 59699, {1, 3, 1, 1, 13, 17, 75, 51, 199, 151, 1529, 1443, 4983, 6723, 6071, 34711, 39159, 5441}}, {16960, 18, 59716, {1, 3, 3, 3, 31, 15, 91, 125, 261, 683, 1769, 1697, 2761, 11373, 13607, 24933, 19079, 55497}}, {16961, 18, 59719, {1, 1, 1, 15, 21, 49, 117, 99, 29, 969, 463, 3869, 1251, 8815, 16443, 46861, 82839, 233325}}, {16962, 18, 59737, {1, 3, 5, 3, 27, 39, 89, 225, 161, 63, 61, 2875, 4037, 10413, 5067, 27893, 78825, 250207}}, {16963, 18, 59747, {1, 1, 1, 9, 13, 49, 93, 11, 23, 25, 2003, 57, 3065, 11241, 13935, 2969, 44235, 39287}}, {16964, 18, 59789, {1, 3, 3, 9, 21, 5, 55, 247, 193, 523, 575, 1235, 3277, 5253, 5293, 7919, 7573, 168809}}, {16965, 18, 59807, {1, 3, 1, 13, 29, 39, 43, 21, 511, 205, 303, 703, 3861, 2467, 3909, 31597, 51081, 9863}}, {16966, 18, 59811, {1, 3, 7, 1, 25, 55, 11, 131, 5, 49, 371, 1683, 1907, 5661, 1015, 15171, 101477, 11221}}, {16967, 18, 59818, {1, 3, 5, 5, 9, 15, 93, 245, 357, 703, 701, 3675, 4527, 9225, 16137, 55433, 81887, 99153}}, {16968, 18, 59825, {1, 1, 3, 3, 11, 1, 39, 251, 291, 599, 643, 231, 4031, 7055, 99, 14039, 81811, 184251}}, {16969, 18, 59826, {1, 3, 5, 13, 29, 55, 11, 117, 325, 401, 2013, 3235, 995, 9255, 2741, 8211, 71451, 180619}}, {16970, 18, 59832, {1, 1, 1, 5, 31, 41, 41, 175, 247, 3, 739, 1391, 3311, 5975, 16921, 4291, 75065, 161745}}, {16971, 18, 59858, {1, 1, 7, 13, 23, 19, 13, 149, 203, 351, 2033, 1867, 3871, 14437, 3793, 17399, 99577, 171605}}, {16972, 18, 59860, {1, 1, 5, 11, 7, 9, 1, 195, 261, 977, 315, 3771, 1179, 16281, 20747, 56309, 108609, 209205}}, {16973, 18, 59873, {1, 3, 3, 5, 19, 15, 123, 153, 325, 601, 393, 753, 93, 4803, 24343, 42645, 128209, 45773}}, {16974, 18, 59876, {1, 3, 1, 13, 3, 29, 97, 95, 115, 539, 155, 2789, 1277, 13127, 20383, 52807, 97295, 54589}}, {16975, 18, 59907, {1, 1, 1, 3, 25, 59, 27, 149, 365, 317, 773, 3379, 5931, 14637, 19881, 37283, 118027, 21557}}, {16976, 18, 59928, {1, 3, 5, 3, 25, 11, 101, 221, 199, 689, 515, 2255, 6107, 6259, 2853, 19039, 117089, 107181}}, {16977, 18, 59933, {1, 3, 5, 7, 29, 63, 19, 113, 249, 147, 737, 3959, 209, 7001, 24263, 20443, 99923, 145709}}, {16978, 18, 59938, {1, 1, 5, 9, 25, 37, 69, 41, 87, 369, 1913, 2255, 7581, 5301, 25751, 24981, 1183, 171969}}, {16979, 18, 59940, {1, 3, 3, 1, 9, 25, 55, 5, 267, 295, 43, 819, 4569, 7065, 31527, 57811, 48721, 107707}}, {16980, 18, 59958, {1, 1, 7, 9, 19, 19, 1, 199, 371, 1003, 597, 2097, 4071, 6185, 879, 13545, 30033, 120313}}, {16981, 18, 59984, {1, 1, 1, 7, 9, 11, 51, 155, 309, 493, 899, 3121, 2085, 10541, 21979, 4725, 70381, 69643}}, {16982, 18, 60020, {1, 1, 1, 1, 13, 45, 123, 119, 459, 295, 1005, 4093, 393, 11063, 27235, 28209, 1671, 215619}}, {16983, 18, 60024, {1, 1, 7, 13, 19, 25, 125, 255, 509, 529, 1577, 3221, 4051, 7697, 2065, 42597, 86295, 131719}}, {16984, 18, 60033, {1, 3, 3, 9, 19, 13, 21, 199, 97, 949, 1297, 379, 1801, 13247, 22563, 49517, 22757, 87371}}, {16985, 18, 60034, {1, 3, 3, 1, 17, 63, 109, 175, 301, 565, 1181, 465, 3457, 7175, 21225, 33149, 122169, 148043}}, {16986, 18, 60063, {1, 1, 1, 1, 5, 7, 21, 251, 53, 369, 955, 583, 4703, 9729, 15853, 55701, 29317, 27}}, {16987, 18, 60070, {1, 3, 3, 1, 31, 3, 53, 57, 231, 441, 109, 149, 8107, 2303, 29729, 42279, 46909, 209877}}, {16988, 18, 60087, {1, 1, 1, 11, 23, 57, 63, 189, 259, 657, 1653, 1155, 2885, 3317, 22559, 3145, 19151, 172507}}, {16989, 18, 60091, {1, 3, 7, 5, 31, 63, 103, 147, 287, 685, 1197, 99, 4907, 12335, 12001, 20303, 75503, 231259}}, {16990, 18, 60105, {1, 3, 3, 13, 15, 33, 63, 11, 99, 299, 97, 2669, 3635, 9969, 1525, 36555, 85215, 86915}}, {16991, 18, 60126, {1, 3, 7, 5, 25, 47, 25, 61, 227, 939, 1719, 245, 2389, 14663, 30671, 22667, 38873, 245509}}, {16992, 18, 60132, {1, 1, 3, 5, 25, 15, 105, 203, 57, 961, 1941, 1241, 3163, 6203, 19631, 10383, 19235, 57569}}, {16993, 18, 60154, {1, 1, 3, 9, 1, 35, 41, 3, 449, 87, 641, 269, 1529, 14559, 16571, 4863, 21625, 921}}, {16994, 18, 60174, {1, 1, 7, 11, 25, 53, 85, 209, 181, 417, 1657, 2117, 4581, 7069, 15533, 64475, 82381, 146943}}, {16995, 18, 60181, {1, 3, 1, 7, 17, 53, 5, 199, 347, 887, 1041, 595, 1843, 10931, 30559, 42849, 73723, 220473}}, {16996, 18, 60198, {1, 3, 7, 7, 21, 53, 105, 21, 141, 575, 1965, 2187, 7293, 13675, 2471, 1259, 42485, 62911}}, {16997, 18, 60212, {1, 1, 3, 9, 5, 27, 21, 101, 101, 71, 1215, 3235, 2451, 14835, 27817, 30079, 124301, 253691}}, {16998, 18, 60247, {1, 1, 7, 1, 11, 37, 105, 127, 115, 157, 279, 2425, 2139, 131, 22717, 40803, 74867, 86021}}, {16999, 18, 60254, {1, 1, 1, 7, 11, 59, 95, 61, 255, 523, 501, 2895, 7531, 8151, 18393, 42069, 120809, 236537}}, {17000, 18, 60275, {1, 1, 1, 7, 17, 23, 31, 59, 377, 187, 873, 1565, 3459, 2975, 11633, 13247, 13095, 193803}}, {17001, 18, 60284, {1, 3, 7, 1, 25, 3, 85, 5, 485, 451, 1385, 1663, 4825, 14019, 29437, 33717, 105343, 161335}}, {17002, 18, 60317, {1, 1, 1, 3, 27, 43, 71, 167, 425, 579, 1739, 3557, 7403, 2023, 6533, 61177, 119273, 85229}}, {17003, 18, 60318, {1, 1, 7, 3, 31, 37, 19, 213, 373, 505, 97, 3669, 7005, 2205, 26519, 61999, 18395, 25967}}, {17004, 18, 60346, {1, 3, 3, 7, 29, 17, 9, 137, 265, 875, 887, 3029, 3295, 11619, 8357, 46241, 23543, 43191}}, {17005, 18, 60360, {1, 1, 5, 1, 25, 43, 33, 133, 65, 7, 1581, 3577, 5997, 6129, 30649, 18923, 56459, 227869}}, {17006, 18, 60380, {1, 1, 5, 13, 27, 45, 27, 111, 429, 565, 1449, 1475, 6613, 4469, 16083, 42349, 66843, 214875}}, {17007, 18, 60389, {1, 3, 1, 1, 21, 21, 107, 7, 15, 675, 233, 4021, 1097, 1393, 6445, 3323, 102435, 249355}}, {17008, 18, 60393, {1, 1, 5, 15, 17, 51, 99, 249, 437, 667, 1921, 2371, 3813, 10543, 19, 39079, 116825, 242821}}, {17009, 18, 60401, {1, 1, 1, 1, 7, 15, 27, 29, 161, 37, 1847, 287, 4379, 1399, 24547, 60361, 68131, 232883}}, {17010, 18, 60407, {1, 1, 3, 9, 17, 21, 41, 169, 61, 771, 241, 1435, 4151, 1789, 12195, 27239, 62371, 165145}}, {17011, 18, 60408, {1, 3, 5, 15, 31, 19, 127, 181, 463, 183, 749, 253, 2403, 1363, 3965, 7953, 124025, 226691}}, {17012, 18, 60462, {1, 1, 3, 7, 17, 57, 85, 89, 17, 33, 819, 2191, 1525, 15651, 23483, 26027, 86379, 40191}}, {17013, 18, 60484, {1, 1, 5, 1, 9, 45, 65, 65, 359, 5, 531, 2581, 6313, 13219, 6005, 36215, 16275, 208253}}, {17014, 18, 60505, {1, 3, 1, 1, 23, 15, 51, 43, 85, 461, 773, 219, 2681, 3377, 9797, 54469, 112871, 231533}}, {17015, 18, 60521, {1, 3, 7, 7, 15, 9, 97, 115, 301, 493, 1085, 2021, 2305, 15003, 11381, 9339, 63015, 179115}}, {17016, 18, 60527, {1, 3, 5, 3, 3, 61, 111, 103, 283, 7, 143, 353, 7815, 7901, 25795, 7577, 92991, 228315}}, {17017, 18, 60532, {1, 1, 7, 13, 29, 3, 53, 105, 83, 531, 497, 729, 1375, 7063, 18655, 35219, 9671, 102913}}, {17018, 18, 60545, {1, 1, 5, 15, 11, 7, 65, 31, 15, 921, 743, 1469, 5669, 5437, 20019, 28123, 5717, 6181}}, {17019, 18, 60546, {1, 3, 3, 15, 19, 1, 3, 183, 315, 595, 1033, 3259, 7815, 8281, 32103, 8699, 59149, 56657}}, {17020, 18, 60555, {1, 1, 1, 7, 9, 1, 87, 81, 267, 637, 1617, 2113, 487, 23, 11213, 29211, 92715, 177767}}, {17021, 18, 60563, {1, 3, 5, 13, 29, 37, 31, 55, 343, 759, 813, 2945, 7189, 4821, 30661, 38373, 2793, 98683}}, {17022, 18, 60586, {1, 3, 5, 7, 9, 43, 113, 145, 103, 303, 1065, 3781, 3527, 9449, 17355, 38301, 74859, 30735}}, {17023, 18, 60626, {1, 1, 1, 1, 3, 53, 53, 27, 119, 701, 1777, 3959, 5911, 8473, 24997, 17557, 11593, 201381}}, {17024, 18, 60637, {1, 3, 3, 9, 3, 3, 107, 115, 423, 531, 735, 931, 8053, 4661, 1919, 29551, 62515, 210255}}, {17025, 18, 60665, {1, 1, 3, 9, 21, 21, 117, 67, 301, 49, 2025, 781, 7951, 15719, 27287, 34551, 115241, 243981}}, {17026, 18, 60673, {1, 1, 7, 9, 9, 25, 87, 229, 375, 353, 445, 3169, 1865, 7305, 11175, 47081, 28609, 107301}}, {17027, 18, 60685, {1, 3, 3, 11, 7, 31, 19, 177, 17, 535, 1353, 2587, 7723, 8039, 13607, 5017, 104937, 207761}}, {17028, 18, 60703, {1, 1, 5, 3, 11, 27, 29, 193, 235, 435, 1451, 3487, 5749, 4825, 9487, 53933, 92061, 223305}}, {17029, 18, 60734, {1, 3, 3, 3, 5, 5, 99, 237, 91, 945, 1373, 3303, 3079, 5345, 6843, 34131, 62851, 259561}}, {17030, 18, 60742, {1, 1, 3, 7, 7, 25, 11, 27, 329, 37, 307, 771, 659, 13045, 25767, 18887, 54407, 251313}}, {17031, 18, 60790, {1, 1, 1, 11, 29, 59, 37, 121, 281, 55, 495, 159, 3925, 4447, 14825, 24831, 103147, 211951}}, {17032, 18, 60830, {1, 3, 3, 7, 23, 31, 59, 67, 303, 383, 1179, 2347, 4001, 14797, 14579, 55365, 112239, 65309}}, {17033, 18, 60848, {1, 3, 3, 9, 15, 17, 61, 123, 339, 319, 765, 1517, 1269, 69, 9065, 32347, 21377, 38449}}, {17034, 18, 60857, {1, 3, 5, 3, 7, 35, 71, 63, 251, 457, 351, 385, 4041, 11489, 14511, 11875, 45307, 205041}}, {17035, 18, 60871, {1, 1, 1, 7, 1, 25, 115, 195, 41, 1001, 835, 767, 7991, 7475, 22397, 36899, 77255, 194827}}, {17036, 18, 60875, {1, 3, 3, 11, 7, 49, 45, 13, 373, 167, 741, 2569, 3781, 1131, 2909, 40387, 77877, 201859}}, {17037, 18, 60913, {1, 3, 5, 3, 17, 11, 123, 137, 65, 835, 1385, 1157, 7387, 12301, 5759, 13137, 30595, 50923}}, {17038, 18, 60923, {1, 1, 5, 7, 1, 55, 57, 97, 377, 223, 115, 2515, 2565, 14965, 10485, 23957, 108239, 160707}}, {17039, 18, 60972, {1, 3, 1, 9, 15, 17, 81, 65, 387, 275, 997, 1485, 4129, 999, 4915, 55867, 103799, 191829}}, {17040, 18, 60989, {1, 1, 1, 5, 15, 5, 35, 167, 249, 419, 267, 503, 469, 3163, 19939, 65501, 88573, 11621}}, {17041, 18, 61001, {1, 3, 3, 13, 7, 9, 101, 125, 371, 97, 1855, 1755, 4103, 12283, 18655, 5965, 17743, 254779}}, {17042, 18, 61002, {1, 1, 3, 7, 13, 15, 119, 227, 451, 863, 1005, 491, 6515, 717, 12783, 14161, 106249, 185297}}, {17043, 18, 61019, {1, 1, 7, 13, 17, 23, 95, 143, 133, 219, 897, 2291, 7469, 923, 22323, 60583, 2457, 197231}}, {17044, 18, 61022, {1, 1, 1, 11, 3, 25, 115, 187, 319, 999, 867, 1725, 6969, 239, 2527, 55283, 91099, 252153}}, {17045, 18, 61059, {1, 1, 7, 9, 3, 37, 107, 25, 425, 95, 631, 2831, 1265, 11509, 18865, 39791, 22281, 220517}}, {17046, 18, 61065, {1, 3, 5, 1, 1, 47, 121, 173, 489, 241, 3, 3707, 7081, 5341, 23143, 7321, 30605, 191665}}, {17047, 18, 61066, {1, 1, 7, 7, 7, 27, 23, 43, 145, 11, 1155, 691, 6993, 9509, 5991, 40705, 58215, 202915}}, {17048, 18, 61071, {1, 3, 5, 1, 31, 1, 7, 189, 379, 431, 417, 3843, 3885, 3263, 16333, 58123, 68307, 33795}}, {17049, 18, 61076, {1, 1, 5, 5, 19, 27, 19, 217, 509, 535, 287, 1637, 4829, 2665, 15393, 35185, 125335, 10909}}, {17050, 18, 61141, {1, 3, 5, 7, 25, 13, 67, 243, 255, 1021, 1203, 821, 7811, 149, 26731, 12913, 18171, 101385}}, {17051, 18, 61148, {1, 1, 1, 3, 25, 61, 59, 207, 449, 789, 1831, 1731, 513, 10099, 291, 1963, 100233, 21847}}, {17052, 18, 61167, {1, 1, 7, 1, 27, 19, 45, 81, 479, 31, 707, 2669, 3589, 15411, 12089, 38235, 60897, 135451}}, {17053, 18, 61190, {1, 3, 5, 15, 11, 3, 113, 169, 171, 21, 1291, 2031, 2023, 5783, 6137, 54637, 50247, 233753}}, {17054, 18, 61218, {1, 1, 5, 1, 11, 13, 73, 97, 269, 801, 1015, 1329, 1779, 15225, 24251, 35191, 8619, 130993}}, {17055, 18, 61247, {1, 1, 7, 9, 9, 19, 35, 255, 505, 513, 547, 405, 3065, 4965, 30877, 50091, 81319, 29273}}, {17056, 18, 61256, {1, 1, 1, 9, 7, 61, 45, 75, 343, 911, 1683, 453, 1225, 10939, 19901, 63685, 123507, 252027}}, {17057, 18, 61289, {1, 1, 5, 11, 21, 55, 37, 161, 143, 463, 1937, 3349, 2953, 14827, 7893, 26581, 128459, 72325}}, {17058, 18, 61292, {1, 3, 5, 9, 31, 57, 115, 77, 225, 859, 621, 731, 5677, 759, 20773, 52285, 65555, 4303}}, {17059, 18, 61307, {1, 1, 3, 15, 23, 15, 49, 171, 137, 449, 855, 565, 5579, 5957, 13643, 8979, 90327, 116349}}, {17060, 18, 61319, {1, 1, 3, 5, 9, 13, 27, 43, 391, 595, 731, 101, 7121, 13555, 29181, 38273, 42309, 175297}}, {17061, 18, 61353, {1, 1, 3, 11, 3, 59, 17, 143, 251, 47, 1391, 1297, 23, 15871, 13153, 44081, 65423, 54875}}, {17062, 18, 61362, {1, 3, 7, 11, 25, 43, 3, 163, 273, 277, 755, 2743, 5909, 10841, 31331, 64131, 13945, 91557}}, {17063, 18, 61379, {1, 3, 1, 13, 31, 35, 5, 165, 417, 623, 1083, 1221, 1051, 8917, 6725, 11385, 76315, 119837}}, {17064, 18, 61382, {1, 1, 5, 3, 21, 53, 47, 247, 471, 877, 709, 2425, 3, 1963, 24331, 52151, 98859, 119033}}, {17065, 18, 61433, {1, 1, 7, 3, 29, 29, 43, 59, 503, 891, 763, 2927, 1613, 9091, 10393, 36003, 61147, 3437}}, {17066, 18, 61434, {1, 1, 5, 15, 27, 59, 73, 163, 425, 855, 349, 3451, 5779, 10523, 9103, 46477, 129873, 39091}}, {17067, 18, 61454, {1, 3, 7, 15, 25, 45, 77, 171, 467, 1017, 1553, 1877, 5507, 3909, 12157, 60441, 98261, 37781}}, {17068, 18, 61461, {1, 1, 7, 13, 13, 39, 99, 51, 197, 327, 1101, 2679, 8025, 11853, 7763, 62537, 96999, 88673}}, {17069, 18, 61475, {1, 3, 1, 11, 5, 61, 29, 219, 471, 387, 319, 433, 5383, 3933, 27603, 61171, 104711, 233295}}, {17070, 18, 61481, {1, 3, 5, 11, 15, 23, 91, 119, 207, 717, 1333, 783, 437, 13073, 10923, 27049, 87233, 174899}}, {17071, 18, 61534, {1, 1, 1, 1, 13, 19, 109, 139, 183, 299, 1023, 3265, 5153, 6307, 27879, 55311, 95201, 19481}}, {17072, 18, 61547, {1, 1, 5, 11, 13, 61, 81, 115, 53, 483, 693, 3527, 5033, 8527, 31345, 46155, 12403, 126815}}, {17073, 18, 61564, {1, 3, 7, 3, 27, 7, 73, 227, 269, 683, 719, 763, 5417, 9523, 13625, 6945, 116225, 223093}}, {17074, 18, 61568, {1, 3, 5, 9, 21, 51, 111, 157, 451, 247, 1375, 1631, 2783, 3371, 22713, 34153, 41949, 141351}}, {17075, 18, 61588, {1, 1, 5, 1, 21, 19, 45, 69, 41, 453, 523, 3163, 7351, 4467, 18865, 35371, 129577, 78039}}, {17076, 18, 61604, {1, 3, 5, 1, 29, 33, 13, 19, 341, 321, 117, 1187, 7021, 5785, 5553, 58055, 113557, 46957}}, {17077, 18, 61626, {1, 1, 5, 5, 13, 59, 47, 59, 69, 125, 1491, 2813, 5005, 5973, 3145, 27579, 7763, 129949}}, {17078, 18, 61645, {1, 1, 7, 11, 11, 7, 117, 235, 407, 749, 1925, 1735, 4499, 13027, 19355, 1981, 105657, 242853}}, {17079, 18, 61646, {1, 1, 7, 1, 15, 19, 5, 247, 203, 707, 809, 2085, 5801, 9947, 569, 9883, 109861, 156751}}, {17080, 18, 61654, {1, 3, 5, 3, 13, 59, 67, 181, 261, 873, 1589, 2249, 7213, 14625, 28403, 41101, 73439, 46873}}, {17081, 18, 61663, {1, 1, 5, 7, 3, 63, 79, 115, 123, 485, 1373, 3781, 4315, 4627, 29003, 64101, 67521, 184053}}, {17082, 18, 61669, {1, 1, 3, 9, 11, 57, 93, 243, 505, 189, 449, 643, 5267, 7447, 32265, 44095, 63015, 36905}}, {17083, 18, 61702, {1, 3, 7, 13, 25, 59, 31, 93, 401, 41, 183, 759, 2473, 8705, 8211, 13543, 59749, 235217}}, {17084, 18, 61705, {1, 1, 5, 5, 29, 3, 65, 133, 325, 239, 649, 3225, 4095, 11691, 4479, 15419, 100551, 261981}}, {17085, 18, 61714, {1, 3, 7, 1, 17, 11, 63, 97, 431, 161, 1437, 3679, 1643, 10583, 20731, 45919, 94093, 147067}}, {17086, 18, 61739, {1, 1, 7, 1, 25, 13, 63, 155, 221, 345, 189, 1199, 5465, 14767, 26263, 54093, 23697, 71231}}, {17087, 18, 61744, {1, 1, 7, 3, 3, 19, 23, 75, 381, 339, 1989, 1137, 6449, 1437, 32279, 17195, 117423, 259311}}, {17088, 18, 61749, {1, 3, 5, 3, 27, 45, 117, 113, 129, 585, 2019, 807, 5573, 7407, 9957, 8741, 52333, 115607}}, {17089, 18, 61776, {1, 1, 3, 7, 9, 5, 77, 9, 417, 725, 429, 1657, 5445, 1901, 28745, 26807, 111743, 169739}}, {17090, 18, 61786, {1, 3, 1, 5, 7, 63, 51, 183, 117, 383, 435, 755, 7849, 5997, 32697, 5789, 5189, 80645}}, {17091, 18, 61822, {1, 1, 3, 15, 5, 47, 105, 175, 41, 275, 1441, 3183, 3651, 9561, 5749, 20431, 45969, 59473}}, {17092, 18, 61826, {1, 1, 1, 11, 13, 35, 19, 129, 125, 35, 339, 3099, 5337, 15605, 10213, 1171, 61869, 216681}}, {17093, 18, 61862, {1, 3, 7, 1, 7, 25, 23, 9, 431, 73, 1803, 3969, 7853, 12845, 8075, 14553, 124825, 50561}}, {17094, 18, 61865, {1, 1, 1, 7, 29, 21, 79, 247, 313, 143, 59, 2689, 5643, 827, 26597, 56423, 107903, 180809}}, {17095, 18, 61868, {1, 3, 7, 1, 3, 3, 25, 39, 269, 529, 67, 3703, 2163, 12417, 6307, 29883, 40303, 171831}}, {17096, 18, 61879, {1, 3, 7, 13, 1, 19, 71, 245, 267, 105, 749, 1203, 7953, 1881, 9273, 4629, 71793, 195393}}, {17097, 18, 61885, {1, 1, 1, 15, 3, 49, 53, 145, 47, 959, 1107, 1361, 4517, 16055, 32119, 58433, 110123, 81487}}, {17098, 18, 61900, {1, 3, 1, 1, 5, 3, 99, 93, 257, 659, 19, 3789, 203, 6183, 11571, 54845, 80591, 243303}}, {17099, 18, 61905, {1, 3, 7, 1, 1, 7, 27, 11, 255, 261, 769, 2877, 6013, 8431, 25669, 43591, 122501, 208947}}, {17100, 18, 61906, {1, 1, 7, 7, 3, 25, 117, 19, 15, 843, 401, 613, 801, 10579, 129, 12249, 107465, 95953}}, {17101, 18, 61962, {1, 1, 3, 5, 1, 35, 95, 93, 243, 937, 1543, 3443, 175, 2199, 12521, 2521, 87225, 38631}}, {17102, 18, 61967, {1, 3, 7, 13, 21, 29, 81, 139, 247, 937, 1835, 3887, 6917, 15709, 20947, 3341, 125521, 247195}}, {17103, 18, 61972, {1, 1, 5, 11, 31, 19, 111, 215, 191, 347, 1215, 1757, 6751, 3099, 755, 43753, 2813, 159123}}, {17104, 18, 61976, {1, 3, 3, 3, 31, 5, 35, 87, 293, 581, 1501, 3255, 7041, 5233, 2053, 63403, 37943, 12115}}, {17105, 18, 62027, {1, 1, 7, 15, 11, 31, 5, 123, 225, 703, 733, 635, 2193, 3059, 30933, 43149, 79409, 106995}}, {17106, 18, 62048, {1, 3, 1, 7, 11, 21, 45, 135, 99, 883, 85, 3861, 6617, 7169, 29887, 329, 42487, 129001}}, {17107, 18, 62051, {1, 1, 1, 3, 11, 53, 31, 245, 141, 667, 1615, 3311, 1475, 12785, 3509, 47153, 105747, 141275}}, {17108, 18, 62066, {1, 1, 3, 15, 7, 15, 55, 13, 465, 707, 1299, 1393, 399, 9229, 4897, 50313, 1275, 131811}}, {17109, 18, 62081, {1, 1, 3, 15, 5, 57, 43, 19, 335, 929, 459, 327, 5715, 7173, 27643, 535, 46221, 144619}}, {17110, 18, 62108, {1, 3, 5, 1, 9, 1, 63, 187, 71, 899, 969, 1349, 1553, 15593, 22783, 211, 41643, 163981}}, {17111, 18, 62178, {1, 1, 1, 13, 3, 63, 35, 37, 311, 253, 1393, 629, 5299, 14837, 15053, 28041, 81541, 149037}}, {17112, 18, 62189, {1, 3, 3, 11, 13, 45, 17, 165, 497, 751, 635, 2939, 6891, 14877, 32763, 20671, 106845, 258033}}, {17113, 18, 62224, {1, 1, 3, 11, 21, 7, 3, 247, 243, 219, 1651, 929, 2737, 9507, 31819, 61389, 14593, 137207}}, {17114, 18, 62229, {1, 1, 7, 5, 15, 33, 31, 29, 467, 75, 523, 1067, 7313, 11715, 26581, 47037, 106385, 199859}}, {17115, 18, 62282, {1, 3, 1, 7, 19, 59, 35, 35, 3, 899, 799, 1379, 5113, 7653, 17977, 42197, 52397, 179705}}, {17116, 18, 62318, {1, 1, 7, 5, 13, 13, 67, 157, 181, 633, 21, 3107, 6301, 7523, 23981, 9079, 88875, 195869}}, {17117, 18, 62320, {1, 3, 7, 9, 7, 9, 115, 49, 293, 691, 1729, 4087, 6353, 963, 12433, 22135, 96383, 127745}}, {17118, 18, 62329, {1, 3, 7, 7, 21, 5, 43, 247, 89, 275, 1219, 311, 5677, 7161, 13853, 38613, 84935, 223563}}, {17119, 18, 62341, {1, 3, 1, 5, 29, 61, 17, 235, 127, 979, 973, 1463, 371, 5567, 6949, 34165, 3075, 169347}}, {17120, 18, 62353, {1, 3, 3, 15, 25, 51, 43, 73, 7, 123, 1761, 1461, 5291, 14271, 19335, 45379, 123469, 190439}}, {17121, 18, 62359, {1, 3, 3, 13, 19, 57, 25, 161, 351, 703, 819, 753, 3101, 9043, 19179, 22665, 118533, 45817}}, {17122, 18, 62382, {1, 3, 5, 15, 3, 33, 15, 63, 251, 87, 611, 1187, 2639, 6001, 16135, 27505, 71077, 34101}}, {17123, 18, 62389, {1, 1, 5, 3, 31, 5, 13, 239, 119, 803, 1881, 3479, 1933, 6421, 21411, 62923, 76851, 211029}}, {17124, 18, 62396, {1, 3, 1, 11, 13, 59, 13, 77, 87, 343, 1733, 3493, 5937, 15733, 7763, 12839, 68639, 70965}}, {17125, 18, 62425, {1, 1, 1, 3, 5, 19, 73, 109, 197, 1007, 1369, 623, 3249, 9263, 12463, 37105, 40599, 115323}}, {17126, 18, 62455, {1, 1, 7, 1, 21, 23, 27, 221, 117, 27, 1811, 837, 7355, 8083, 12657, 34137, 102025, 6511}}, {17127, 18, 62484, {1, 3, 7, 13, 13, 29, 7, 103, 511, 449, 1443, 775, 3503, 1057, 8809, 48583, 27649, 206219}}, {17128, 18, 62494, {1, 1, 7, 1, 15, 37, 53, 205, 393, 691, 989, 3493, 7813, 12371, 18125, 62569, 57075, 100625}}, {17129, 18, 62507, {1, 3, 5, 7, 11, 11, 55, 7, 487, 861, 1589, 1003, 607, 10031, 22481, 41905, 67791, 168167}}, {17130, 18, 62512, {1, 3, 1, 9, 21, 31, 25, 187, 315, 379, 961, 2721, 3395, 12321, 21693, 56977, 73197, 160023}}, {17131, 18, 62550, {1, 3, 3, 7, 9, 25, 103, 1, 13, 1021, 1777, 1015, 2269, 2131, 191, 2561, 74755, 27131}}, {17132, 18, 62577, {1, 1, 3, 13, 21, 29, 97, 153, 499, 207, 719, 585, 8155, 2873, 22073, 45933, 92875, 19205}}, {17133, 18, 62590, {1, 3, 7, 15, 13, 31, 43, 223, 405, 839, 1241, 2219, 6911, 9469, 24477, 63157, 95503, 128431}}, {17134, 18, 62599, {1, 3, 5, 15, 5, 11, 79, 129, 235, 171, 289, 1791, 6061, 9107, 13859, 55923, 30197, 111025}}, {17135, 18, 62617, {1, 1, 7, 11, 13, 23, 51, 139, 219, 467, 1923, 2847, 1977, 1503, 1939, 55579, 65357, 50047}}, {17136, 18, 62679, {1, 3, 7, 11, 27, 25, 91, 95, 73, 189, 1537, 273, 725, 1215, 15255, 18847, 67419, 162153}}, {17137, 18, 62702, {1, 3, 3, 11, 3, 63, 49, 131, 219, 285, 819, 2801, 2645, 2943, 15055, 15659, 130641, 82913}}, {17138, 18, 62745, {1, 1, 3, 7, 17, 19, 37, 59, 391, 1009, 1569, 2569, 2519, 33, 18827, 23277, 94797, 103673}}, {17139, 18, 62772, {1, 3, 5, 9, 27, 57, 69, 185, 49, 829, 29, 1247, 6129, 14935, 8005, 48343, 55789, 170099}}, {17140, 18, 62794, {1, 3, 3, 7, 19, 55, 77, 231, 79, 787, 1597, 2701, 4999, 4247, 31849, 7797, 118993, 77871}}, {17141, 18, 62835, {1, 1, 7, 13, 5, 45, 105, 137, 239, 923, 593, 3227, 3603, 15463, 15533, 55285, 95295, 141951}}, {17142, 18, 62842, {1, 3, 1, 5, 29, 3, 113, 241, 255, 181, 1933, 2579, 1865, 11083, 8023, 34271, 78603, 240781}}, {17143, 18, 62847, {1, 1, 3, 7, 17, 21, 123, 75, 305, 485, 9, 3037, 677, 8001, 16803, 25851, 121773, 77729}}, {17144, 18, 62857, {1, 3, 1, 5, 23, 7, 39, 25, 381, 1003, 361, 995, 1751, 9599, 6399, 9627, 19303, 249899}}, {17145, 18, 62894, {1, 3, 5, 5, 13, 39, 65, 145, 351, 135, 981, 3657, 4711, 13649, 17253, 46443, 99187, 176683}}, {17146, 18, 62911, {1, 3, 1, 9, 9, 41, 79, 237, 445, 507, 1947, 2905, 8161, 715, 24499, 62397, 26393, 197221}}, {17147, 18, 62928, {1, 3, 5, 3, 23, 9, 107, 121, 59, 265, 177, 3495, 391, 4537, 32099, 45217, 128285, 259285}}, {17148, 18, 62954, {1, 3, 3, 15, 5, 61, 87, 209, 139, 461, 485, 3261, 7425, 6193, 22221, 22145, 93989, 101459}}, {17149, 18, 62964, {1, 3, 1, 1, 15, 51, 29, 145, 385, 695, 375, 3743, 1387, 15385, 7995, 22993, 64115, 239897}}, {17150, 18, 62977, {1, 1, 5, 15, 9, 11, 73, 219, 293, 941, 477, 3935, 2717, 9559, 20537, 6935, 39711, 13623}}, {17151, 18, 62984, {1, 3, 3, 11, 3, 23, 127, 21, 61, 59, 1685, 507, 3883, 6587, 6355, 65407, 54311, 228555}}, {17152, 18, 63007, {1, 3, 1, 1, 25, 47, 51, 111, 77, 871, 1045, 4017, 7683, 7729, 24155, 3481, 31749, 245155}}, {17153, 18, 63017, {1, 3, 5, 1, 25, 29, 119, 131, 475, 763, 1639, 1937, 7387, 2307, 24081, 34797, 91785, 52055}}, {17154, 18, 63058, {1, 1, 5, 1, 29, 19, 119, 111, 119, 751, 1079, 1911, 4085, 8909, 4351, 30037, 37691, 57175}}, {17155, 18, 63067, {1, 1, 7, 7, 27, 33, 71, 189, 105, 821, 1543, 2939, 3829, 6485, 22235, 7097, 76987, 207121}}, {17156, 18, 63085, {1, 1, 3, 3, 7, 7, 65, 121, 355, 405, 1019, 1779, 7301, 10609, 25927, 16501, 37287, 133383}}, {17157, 18, 63150, {1, 1, 3, 11, 31, 57, 109, 197, 165, 711, 271, 653, 5835, 14905, 26065, 52287, 106215, 225075}}, {17158, 18, 63170, {1, 1, 3, 3, 1, 41, 5, 169, 15, 49, 1311, 2715, 579, 1693, 28001, 17935, 18585, 123531}}, {17159, 18, 63184, {1, 1, 7, 7, 1, 49, 59, 75, 173, 361, 1947, 2707, 1835, 12025, 24051, 24359, 121841, 215797}}, {17160, 18, 63210, {1, 1, 5, 13, 7, 49, 15, 181, 409, 1005, 383, 3449, 2987, 13051, 7097, 34571, 55495, 65251}}, {17161, 18, 63215, {1, 1, 3, 11, 5, 9, 67, 41, 9, 79, 401, 379, 4107, 5231, 519, 47877, 17273, 137479}}, {17162, 18, 63217, {1, 1, 3, 13, 25, 7, 9, 165, 103, 37, 1369, 933, 1119, 1025, 19767, 25765, 55487, 249709}}, {17163, 18, 63229, {1, 3, 5, 5, 19, 53, 105, 135, 245, 957, 185, 2901, 1741, 10429, 747, 23365, 49363, 84095}}, {17164, 18, 63237, {1, 1, 1, 15, 29, 17, 107, 193, 17, 447, 1261, 1935, 5749, 2303, 23287, 59883, 28655, 188055}}, {17165, 18, 63259, {1, 1, 5, 9, 13, 27, 99, 253, 299, 481, 89, 3041, 1549, 15417, 30495, 2063, 53649, 219883}}, {17166, 18, 63265, {1, 3, 3, 15, 19, 19, 7, 149, 67, 349, 789, 129, 2783, 2887, 28631, 26001, 62407, 151767}}, {17167, 18, 63271, {1, 3, 3, 13, 7, 29, 65, 25, 93, 627, 301, 721, 7249, 13295, 19995, 33715, 36441, 157625}}, {17168, 18, 63286, {1, 1, 1, 3, 29, 63, 85, 27, 507, 543, 1887, 3169, 4239, 4455, 22047, 15369, 48913, 192071}}, {17169, 18, 63298, {1, 3, 7, 5, 9, 33, 125, 41, 7, 723, 1091, 3311, 8173, 3861, 31507, 42669, 68853, 60043}}, {17170, 18, 63343, {1, 3, 1, 13, 13, 7, 121, 41, 181, 913, 371, 163, 7061, 8779, 18345, 41915, 1785, 107113}}, {17171, 18, 63355, {1, 1, 1, 9, 13, 41, 23, 35, 157, 247, 1243, 1101, 5193, 4027, 29917, 44099, 46211, 162059}}, {17172, 18, 63361, {1, 3, 1, 5, 15, 51, 3, 241, 131, 741, 1885, 2397, 5673, 9097, 9319, 15381, 55655, 207569}}, {17173, 18, 63362, {1, 1, 3, 15, 25, 15, 69, 55, 435, 727, 1007, 375, 7871, 10437, 11011, 36711, 11269, 105159}}, {17174, 18, 63379, {1, 3, 3, 13, 17, 1, 101, 189, 295, 185, 1715, 2609, 6767, 11751, 11469, 3951, 80743, 114439}}, {17175, 18, 63397, {1, 3, 1, 7, 21, 41, 93, 39, 433, 917, 279, 161, 267, 10201, 26583, 30363, 110187, 46501}}, {17176, 18, 63415, {1, 1, 7, 7, 13, 15, 89, 167, 365, 925, 107, 3537, 6815, 15251, 23149, 61821, 66569, 135353}}, {17177, 18, 63421, {1, 1, 1, 3, 13, 59, 21, 255, 111, 603, 547, 465, 3001, 16055, 26389, 64301, 112751, 219279}}, {17178, 18, 63463, {1, 1, 1, 15, 17, 3, 21, 49, 327, 349, 489, 957, 807, 11685, 23975, 34729, 100773, 223551}}, {17179, 18, 63491, {1, 3, 5, 15, 19, 59, 63, 71, 233, 767, 1789, 3609, 5911, 3405, 7519, 3611, 92015, 126669}}, {17180, 18, 63527, {1, 1, 1, 11, 7, 31, 79, 57, 115, 763, 1643, 3329, 7209, 1385, 15565, 64353, 60637, 59445}}, {17181, 18, 63545, {1, 1, 3, 1, 13, 3, 47, 89, 507, 523, 1, 1391, 6973, 7267, 32527, 52631, 20775, 234503}}, {17182, 18, 63553, {1, 3, 1, 9, 23, 23, 95, 57, 295, 857, 213, 1211, 3503, 3043, 24843, 16149, 118719, 171585}}, {17183, 18, 63560, {1, 3, 1, 5, 1, 13, 63, 167, 305, 711, 759, 2521, 5051, 9125, 22917, 24647, 100777, 261137}}, {17184, 18, 63563, {1, 1, 5, 9, 25, 19, 5, 225, 511, 543, 685, 733, 7249, 10447, 11115, 25927, 104327, 92861}}, {17185, 18, 63566, {1, 3, 1, 7, 15, 7, 15, 83, 379, 461, 943, 317, 7735, 12655, 7549, 6371, 20901, 170331}}, {17186, 18, 63589, {1, 1, 1, 13, 7, 17, 41, 51, 47, 15, 477, 1203, 819, 1615, 13805, 40147, 3967, 192647}}, {17187, 18, 63599, {1, 3, 7, 11, 9, 11, 111, 75, 171, 833, 1503, 2325, 7279, 2687, 16499, 11547, 99409, 186429}}, {17188, 18, 63601, {1, 1, 5, 3, 13, 21, 75, 17, 447, 647, 1309, 2297, 7911, 12093, 16237, 50831, 96123, 134479}}, {17189, 18, 63608, {1, 1, 5, 15, 19, 29, 35, 255, 291, 437, 85, 2143, 3281, 3629, 29339, 28169, 46561, 236595}}, {17190, 18, 63620, {1, 3, 7, 1, 31, 57, 125, 109, 317, 461, 681, 1379, 6387, 14971, 8451, 17655, 87619, 51721}}, {17191, 18, 63654, {1, 3, 7, 1, 23, 33, 45, 149, 43, 465, 997, 601, 693, 6273, 12867, 25885, 81353, 60437}}, {17192, 18, 63703, {1, 1, 7, 7, 31, 25, 113, 205, 481, 141, 1757, 587, 2981, 7637, 3869, 4151, 69541, 68587}}, {17193, 18, 63719, {1, 1, 7, 13, 17, 31, 69, 247, 137, 79, 1221, 1693, 3747, 10711, 1671, 31587, 12139, 248585}}, {17194, 18, 63758, {1, 1, 1, 3, 1, 61, 39, 139, 37, 79, 125, 1145, 7505, 10129, 29209, 52045, 99159, 195553}}, {17195, 18, 63769, {1, 1, 5, 3, 13, 41, 13, 11, 167, 953, 1961, 3557, 871, 1687, 28479, 10621, 27533, 243519}}, {17196, 18, 63782, {1, 1, 7, 7, 1, 35, 107, 227, 375, 225, 483, 1239, 7591, 8549, 7351, 62001, 70245, 102795}}, {17197, 18, 63803, {1, 1, 1, 9, 29, 35, 15, 3, 337, 1017, 1065, 2107, 2457, 9455, 7069, 55081, 57887, 149679}}, {17198, 18, 63811, {1, 1, 7, 1, 1, 1, 13, 63, 287, 895, 593, 1253, 4717, 10313, 10275, 22143, 59149, 38865}}, {17199, 18, 63851, {1, 1, 3, 15, 27, 39, 73, 11, 509, 391, 1901, 503, 5523, 6777, 30849, 41301, 35067, 68443}}, {17200, 18, 63854, {1, 3, 3, 15, 17, 57, 39, 229, 273, 917, 577, 3627, 3285, 4495, 28581, 34011, 38537, 194999}}, {17201, 18, 63872, {1, 1, 7, 3, 17, 51, 91, 203, 161, 757, 581, 1625, 477, 8839, 16515, 43101, 121497, 23603}}, {17202, 18, 63878, {1, 3, 3, 5, 19, 29, 55, 127, 283, 999, 1227, 1937, 4471, 11305, 8813, 40509, 78521, 175573}}, {17203, 18, 63895, {1, 3, 3, 3, 5, 29, 33, 249, 25, 213, 1315, 393, 6967, 12751, 7485, 39561, 14801, 191921}}, {17204, 18, 63917, {1, 3, 7, 9, 23, 15, 93, 69, 23, 239, 1993, 3375, 539, 14141, 10123, 33561, 127565, 181527}}, {17205, 18, 63930, {1, 3, 3, 15, 13, 15, 65, 241, 83, 351, 1943, 1305, 7181, 11803, 31907, 63623, 5439, 150661}}, {17206, 18, 63935, {1, 3, 7, 11, 13, 17, 17, 37, 409, 577, 973, 797, 1761, 5333, 13803, 22991, 29743, 53051}}, {17207, 18, 63955, {1, 3, 5, 5, 27, 25, 91, 225, 411, 23, 877, 2487, 8061, 12337, 11471, 8857, 10791, 112699}}, {17208, 18, 63964, {1, 1, 5, 3, 15, 1, 87, 249, 205, 1011, 2045, 1879, 4137, 5877, 12709, 5231, 74283, 124315}}, {17209, 18, 63967, {1, 1, 7, 7, 31, 37, 117, 71, 139, 391, 1085, 4033, 3087, 3063, 19991, 8787, 96899, 17279}}, {17210, 18, 63980, {1, 1, 7, 15, 19, 47, 45, 181, 303, 151, 337, 2557, 6131, 3161, 13097, 52777, 77783, 259817}}, {17211, 18, 63985, {1, 1, 3, 3, 1, 55, 115, 227, 83, 591, 967, 4067, 3441, 243, 13443, 4043, 129365, 161459}}, {17212, 18, 63992, {1, 1, 3, 15, 5, 23, 71, 31, 271, 585, 931, 909, 3375, 15063, 12111, 35811, 124047, 68225}}, {17213, 18, 64021, {1, 1, 5, 11, 1, 59, 19, 193, 323, 489, 837, 3709, 1807, 11617, 30931, 33561, 2805, 100979}}, {17214, 18, 64026, {1, 3, 5, 7, 27, 7, 71, 67, 167, 521, 1237, 2911, 3531, 2885, 4669, 25703, 87647, 36381}}, {17215, 18, 64044, {1, 3, 3, 13, 13, 21, 97, 225, 477, 1023, 2029, 877, 3849, 4675, 17665, 19257, 9697, 168577}}, {17216, 18, 64055, {1, 1, 7, 15, 25, 31, 19, 255, 45, 539, 1831, 2655, 7471, 12011, 12455, 3681, 123881, 234471}}, {17217, 18, 64056, {1, 1, 3, 9, 17, 39, 105, 73, 271, 555, 987, 873, 5371, 12381, 13469, 54961, 125701, 194063}}, {17218, 18, 64061, {1, 1, 5, 5, 7, 27, 15, 195, 121, 175, 991, 955, 5007, 11423, 1539, 21381, 79891, 162149}}, {17219, 18, 64067, {1, 3, 1, 7, 25, 23, 69, 69, 177, 545, 481, 3503, 3721, 1077, 8763, 6919, 64743, 172311}}, {17220, 18, 64081, {1, 1, 3, 15, 31, 5, 33, 45, 81, 795, 435, 399, 4591, 3741, 26493, 14791, 59529, 89989}}, {17221, 18, 64100, {1, 1, 7, 13, 21, 29, 95, 75, 213, 59, 1635, 479, 441, 14667, 16389, 9139, 30955, 169895}}, {17222, 18, 64109, {1, 3, 3, 3, 17, 61, 103, 85, 233, 287, 447, 2687, 4755, 9489, 1669, 10405, 58489, 170429}}, {17223, 18, 64112, {1, 1, 5, 5, 13, 9, 63, 129, 321, 531, 393, 3353, 5309, 16375, 20473, 12595, 52239, 183647}}, {17224, 18, 64118, {1, 1, 3, 7, 7, 31, 101, 253, 119, 325, 351, 2321, 1899, 14073, 8985, 13609, 32043, 33225}}, {17225, 18, 64124, {1, 1, 3, 13, 7, 25, 73, 191, 399, 591, 819, 2859, 6053, 815, 30417, 5709, 18277, 121991}}, {17226, 18, 64145, {1, 3, 3, 1, 7, 47, 7, 81, 451, 463, 699, 1857, 8169, 15649, 22693, 28673, 9717, 227583}}, {17227, 18, 64151, {1, 3, 3, 3, 31, 45, 123, 205, 23, 901, 1003, 1149, 7481, 6925, 23845, 18573, 97047, 248957}}, {17228, 18, 64203, {1, 1, 3, 3, 21, 9, 53, 241, 125, 583, 1055, 3981, 8113, 12477, 8455, 6289, 112253, 17321}}, {17229, 18, 64208, {1, 1, 7, 3, 19, 5, 51, 111, 443, 283, 117, 2127, 4273, 2335, 20373, 2885, 57439, 56839}}, {17230, 18, 64236, {1, 1, 5, 15, 7, 5, 65, 163, 27, 691, 1667, 69, 2459, 7477, 21349, 52417, 42299, 75965}}, {17231, 18, 64254, {1, 1, 1, 13, 13, 19, 87, 223, 475, 205, 1113, 887, 2213, 5533, 15875, 36173, 53933, 200173}}, {17232, 18, 64261, {1, 3, 3, 13, 23, 17, 93, 37, 391, 127, 873, 1445, 3007, 10863, 21245, 55025, 99275, 255329}}, {17233, 18, 64280, {1, 3, 1, 15, 1, 47, 57, 5, 207, 825, 161, 539, 6151, 12829, 14121, 51217, 25547, 234303}}, {17234, 18, 64296, {1, 1, 5, 1, 21, 63, 15, 83, 19, 817, 591, 3131, 889, 12451, 14363, 27295, 83877, 124701}}, {17235, 18, 64313, {1, 1, 7, 7, 11, 21, 87, 85, 13, 555, 163, 9, 5973, 14749, 19585, 57287, 43421, 66301}}, {17236, 18, 64314, {1, 3, 5, 5, 7, 33, 19, 7, 9, 819, 533, 2105, 4275, 10611, 30517, 35863, 84687, 245157}}, {17237, 18, 64316, {1, 3, 5, 13, 3, 55, 111, 157, 235, 405, 39, 2191, 905, 3099, 245, 37371, 365, 257385}}, {17238, 18, 64348, {1, 3, 3, 13, 29, 39, 125, 235, 213, 879, 497, 1659, 6689, 12165, 18621, 14657, 37079, 167867}}, {17239, 18, 64352, {1, 1, 5, 15, 5, 5, 27, 197, 77, 477, 1115, 3369, 2253, 5757, 20855, 4473, 112501, 76881}}, {17240, 18, 64355, {1, 3, 3, 13, 13, 61, 37, 97, 229, 743, 1381, 3979, 307, 319, 16765, 56295, 109303, 21361}}, {17241, 18, 64361, {1, 1, 7, 11, 19, 7, 63, 145, 129, 899, 93, 1851, 7901, 8767, 15553, 13913, 4897, 129483}}, {17242, 18, 64388, {1, 3, 5, 11, 7, 23, 19, 5, 465, 365, 883, 3563, 4395, 2759, 4273, 623, 75047, 249519}}, {17243, 18, 64398, {1, 3, 1, 5, 29, 43, 75, 7, 509, 373, 359, 2041, 5957, 1251, 32431, 37803, 120915, 45137}}, {17244, 18, 64403, {1, 3, 1, 5, 21, 9, 43, 1, 337, 743, 1359, 1629, 5117, 2499, 16129, 22831, 38795, 32137}}, {17245, 18, 64419, {1, 3, 3, 7, 23, 57, 9, 31, 351, 559, 1729, 1461, 3037, 12685, 8899, 14859, 108851, 170195}}, {17246, 18, 64421, {1, 1, 1, 15, 23, 57, 39, 23, 283, 487, 1055, 1265, 6781, 7955, 195, 37745, 66115, 56413}}, {17247, 18, 64428, {1, 1, 3, 7, 27, 35, 57, 17, 137, 17, 905, 4033, 5775, 5305, 22975, 17547, 106297, 146287}}, {17248, 18, 64453, {1, 1, 1, 3, 5, 39, 73, 151, 469, 523, 119, 539, 2817, 7783, 22957, 59937, 21331, 172437}}, {17249, 18, 64463, {1, 1, 3, 13, 21, 1, 23, 109, 113, 257, 817, 1671, 6729, 1571, 15009, 48539, 94025, 160379}}, {17250, 18, 64475, {1, 1, 1, 1, 31, 23, 83, 107, 225, 715, 949, 69, 2163, 4777, 7715, 25901, 82935, 81455}}, {17251, 18, 64511, {1, 3, 5, 13, 29, 11, 61, 169, 241, 973, 315, 3991, 1389, 3293, 31123, 59419, 7359, 170929}}, {17252, 18, 64537, {1, 1, 7, 3, 21, 15, 111, 41, 329, 513, 1175, 4037, 2747, 11465, 17253, 54055, 29409, 230925}}, {17253, 18, 64576, {1, 3, 5, 15, 31, 17, 105, 45, 61, 339, 1387, 1021, 4499, 13671, 25521, 52081, 49153, 31587}}, {17254, 18, 64579, {1, 3, 3, 3, 29, 17, 51, 103, 429, 849, 1759, 1267, 6255, 4631, 32643, 44977, 40875, 239457}}, {17255, 18, 64581, {1, 1, 7, 15, 3, 11, 123, 157, 73, 151, 777, 3855, 1913, 969, 11821, 16889, 63503, 197305}}, {17256, 18, 64606, {1, 3, 1, 5, 13, 49, 61, 209, 105, 523, 851, 3667, 7525, 5537, 12851, 42867, 50535, 131403}}, {17257, 18, 64615, {1, 3, 1, 7, 13, 19, 107, 71, 479, 895, 405, 89, 1345, 5543, 12709, 6093, 97581, 20483}}, {17258, 18, 64649, {1, 3, 3, 11, 3, 47, 117, 175, 175, 321, 1257, 365, 1193, 12813, 2713, 26941, 43605, 223323}}, {17259, 18, 64655, {1, 1, 7, 1, 19, 35, 45, 143, 395, 255, 1599, 575, 2637, 1287, 27673, 48329, 57975, 44173}}, {17260, 18, 64664, {1, 3, 5, 1, 1, 19, 107, 233, 465, 661, 91, 4007, 6409, 3399, 8175, 54171, 111417, 124955}}, {17261, 18, 64667, {1, 1, 5, 13, 9, 27, 121, 225, 55, 761, 779, 3015, 6333, 10779, 26531, 57103, 33463, 90219}}, {17262, 18, 64712, {1, 3, 1, 9, 17, 3, 85, 147, 111, 133, 869, 1833, 2401, 5811, 24415, 27095, 65529, 164121}}, {17263, 18, 64715, {1, 1, 5, 13, 11, 37, 13, 83, 391, 909, 2013, 1327, 6697, 1711, 29265, 10607, 20127, 57873}}, {17264, 18, 64718, {1, 3, 1, 11, 17, 17, 33, 101, 383, 837, 1769, 1711, 3735, 14777, 27101, 56853, 110643, 101917}}, {17265, 18, 64741, {1, 3, 5, 13, 25, 7, 37, 99, 473, 211, 1469, 1827, 6307, 8835, 15853, 22027, 43095, 15817}}, {17266, 18, 64766, {1, 3, 1, 5, 19, 13, 61, 193, 57, 359, 1277, 749, 5499, 11239, 20681, 48477, 7225, 259259}}, {17267, 18, 64780, {1, 1, 1, 7, 27, 17, 79, 213, 307, 761, 429, 1519, 7483, 6007, 11251, 13263, 24851, 7919}}, {17268, 18, 64788, {1, 1, 3, 5, 9, 37, 101, 149, 405, 413, 1213, 157, 3811, 4485, 13099, 32697, 75677, 127815}}, {17269, 18, 64791, {1, 3, 3, 7, 29, 29, 13, 113, 45, 885, 1471, 3433, 2289, 4375, 815, 16741, 20933, 9763}}, {17270, 18, 64795, {1, 3, 5, 15, 5, 3, 7, 37, 347, 41, 1977, 395, 6363, 3591, 21457, 31455, 60547, 108153}}, {17271, 18, 64798, {1, 3, 5, 7, 19, 9, 113, 1, 241, 439, 731, 1591, 3347, 1295, 6635, 25267, 13239, 214669}}, {17272, 18, 64816, {1, 1, 3, 5, 7, 7, 69, 77, 281, 851, 1533, 1, 7351, 3429, 29237, 54597, 11171, 66613}}, {17273, 18, 64819, {1, 1, 7, 15, 29, 7, 59, 9, 105, 129, 1397, 3841, 3945, 4755, 19877, 11109, 17497, 225473}}, {17274, 18, 64822, {1, 3, 7, 7, 15, 61, 3, 207, 97, 229, 1251, 101, 3157, 5729, 15579, 14849, 119119, 91891}}, {17275, 18, 64833, {1, 3, 3, 9, 27, 15, 85, 221, 231, 577, 1787, 3489, 2393, 7593, 13175, 25561, 108505, 97267}}, {17276, 18, 64836, {1, 3, 7, 13, 23, 3, 7, 85, 307, 899, 371, 3539, 3467, 7955, 9539, 53583, 125587, 30969}}, {17277, 18, 64876, {1, 1, 5, 7, 7, 31, 115, 245, 375, 803, 1121, 3775, 3565, 15283, 25981, 24681, 34469, 172003}}, {17278, 18, 64891, {1, 1, 5, 1, 31, 5, 5, 161, 153, 235, 1703, 2163, 1089, 16233, 6183, 25167, 102925, 36673}}, {17279, 18, 64907, {1, 3, 3, 5, 1, 57, 59, 5, 87, 497, 151, 1731, 2727, 4583, 28165, 63053, 76003, 29259}}, {17280, 18, 64943, {1, 1, 5, 7, 5, 21, 79, 111, 347, 879, 827, 3947, 4421, 9589, 23971, 11681, 104555, 226535}}, {17281, 18, 64965, {1, 1, 5, 1, 17, 35, 105, 159, 391, 495, 1709, 3731, 261, 2359, 1413, 37105, 8979, 189381}}, {17282, 18, 64977, {1, 3, 3, 1, 11, 23, 21, 213, 261, 755, 1503, 2369, 1765, 14531, 2605, 15609, 48691, 113059}}, {17283, 18, 64999, {1, 3, 5, 1, 1, 55, 87, 197, 89, 391, 1157, 3523, 385, 5871, 13681, 29097, 101903, 184553}}, {17284, 18, 65034, {1, 3, 7, 5, 17, 51, 87, 191, 495, 761, 1943, 1845, 2963, 13133, 22439, 20101, 96759, 215215}}, {17285, 18, 65036, {1, 3, 5, 11, 23, 9, 53, 41, 229, 233, 2025, 2835, 2359, 4755, 3015, 48267, 20721, 61001}}, {17286, 18, 65089, {1, 1, 7, 9, 27, 35, 45, 201, 137, 291, 151, 733, 6199, 3127, 3073, 14491, 95051, 12469}}, {17287, 18, 65107, {1, 1, 1, 9, 7, 49, 73, 233, 239, 881, 1991, 695, 5947, 9377, 12027, 41137, 80217, 122961}}, {17288, 18, 65110, {1, 1, 5, 11, 3, 15, 85, 203, 305, 945, 1007, 1831, 3999, 373, 21141, 63829, 91779, 122495}}, {17289, 18, 65120, {1, 1, 1, 11, 23, 51, 127, 215, 441, 467, 229, 3071, 2731, 8813, 30155, 60289, 54531, 196187}}, {17290, 18, 65132, {1, 3, 5, 15, 29, 31, 11, 129, 443, 649, 773, 3035, 7915, 13831, 31979, 5577, 42869, 153591}}, {17291, 18, 65143, {1, 1, 3, 11, 21, 37, 23, 79, 153, 7, 1801, 441, 8189, 7235, 6311, 965, 71993, 81755}}, {17292, 18, 65150, {1, 3, 5, 5, 23, 13, 93, 39, 247, 367, 811, 1381, 6809, 16219, 8755, 41923, 79873, 105781}}, {17293, 18, 65177, {1, 3, 5, 9, 19, 43, 21, 229, 251, 187, 1047, 2295, 5529, 2965, 1507, 16185, 121183, 30551}}, {17294, 18, 65201, {1, 3, 7, 9, 19, 11, 33, 213, 39, 811, 231, 1527, 6093, 1507, 3541, 37585, 78785, 215419}}, {17295, 18, 65214, {1, 3, 7, 7, 11, 13, 109, 119, 175, 311, 719, 3127, 6351, 1909, 5441, 5411, 58751, 80875}}, {17296, 18, 65234, {1, 1, 1, 7, 17, 35, 57, 139, 289, 137, 1919, 2131, 6145, 3953, 24887, 64737, 4677, 23833}}, {17297, 18, 65240, {1, 1, 3, 13, 1, 21, 83, 243, 27, 69, 501, 3925, 3339, 13313, 27021, 38319, 76441, 146397}}, {17298, 18, 65243, {1, 3, 7, 9, 15, 17, 97, 117, 505, 673, 1333, 3891, 7775, 6323, 12967, 17387, 19501, 68347}}, {17299, 18, 65259, {1, 1, 1, 5, 27, 55, 43, 47, 399, 147, 1539, 2663, 5555, 11993, 8759, 33783, 8361, 78633}}, {17300, 18, 65276, {1, 1, 1, 15, 1, 17, 21, 85, 129, 117, 339, 1319, 1119, 6869, 12913, 56873, 30795, 76849}}, {17301, 18, 65287, {1, 1, 5, 5, 11, 1, 11, 175, 355, 737, 1367, 3089, 5993, 4377, 10325, 3817, 61735, 187689}}, {17302, 18, 65306, {1, 3, 5, 5, 21, 41, 85, 219, 425, 611, 1219, 1849, 349, 925, 26185, 31591, 23855, 35549}}, {17303, 18, 65311, {1, 1, 3, 5, 21, 3, 77, 25, 265, 949, 1979, 1561, 4243, 12437, 5215, 23445, 33295, 130385}}, {17304, 18, 65321, {1, 1, 3, 1, 13, 7, 3, 81, 143, 735, 31, 1781, 1537, 10789, 11923, 61589, 75761, 178837}}, {17305, 18, 65350, {1, 1, 7, 7, 11, 47, 55, 37, 39, 533, 1773, 3121, 183, 7193, 19403, 45757, 20457, 158437}}, {17306, 18, 65364, {1, 1, 5, 5, 3, 15, 53, 41, 139, 529, 601, 2967, 4683, 3869, 13449, 30155, 85833, 190053}}, {17307, 18, 65451, {1, 1, 5, 1, 11, 39, 85, 131, 349, 175, 267, 779, 923, 5905, 32727, 22055, 63087, 247607}}, {17308, 18, 65488, {1, 3, 5, 7, 7, 59, 11, 49, 465, 617, 557, 251, 1303, 10369, 29207, 13457, 113591, 43717}}, {17309, 18, 65510, {1, 3, 5, 3, 27, 39, 21, 157, 39, 891, 1833, 2887, 7395, 7965, 21771, 42675, 71705, 177323}}, {17310, 18, 65528, {1, 3, 7, 7, 21, 51, 53, 83, 433, 889, 1033, 1701, 6285, 14335, 1683, 3637, 110241, 110355}}, {17311, 18, 65533, {1, 1, 7, 7, 11, 23, 35, 63, 71, 867, 79, 2551, 1837, 773, 21093, 60433, 67305, 70731}}, {17312, 18, 65553, {1, 3, 5, 11, 9, 25, 67, 23, 137, 75, 707, 2229, 6237, 9871, 29063, 30433, 112897, 68037}}, {17313, 18, 65563, {1, 3, 7, 13, 1, 45, 119, 149, 487, 667, 1177, 2927, 1875, 11963, 20771, 1177, 2331, 244039}}, {17314, 18, 65579, {1, 3, 3, 7, 19, 61, 89, 163, 91, 409, 1109, 1947, 1017, 12385, 13487, 45645, 64175, 184221}}, {17315, 18, 65621, {1, 1, 1, 15, 13, 47, 21, 203, 341, 845, 443, 1891, 2591, 2721, 7515, 52161, 70359, 173139}}, {17316, 18, 65625, {1, 3, 3, 11, 5, 3, 119, 179, 509, 33, 1909, 2531, 6713, 12447, 30157, 61019, 45857, 165557}}, {17317, 18, 65635, {1, 3, 7, 5, 3, 47, 79, 55, 321, 71, 1917, 4053, 6603, 3079, 28133, 15611, 99161, 118279}}, {17318, 18, 65644, {1, 1, 1, 7, 19, 13, 3, 31, 213, 705, 435, 2381, 991, 4719, 24473, 8907, 122013, 228081}}, {17319, 18, 65690, {1, 1, 7, 11, 27, 15, 5, 123, 169, 197, 361, 3803, 2001, 14547, 22967, 27575, 118325, 130651}}, {17320, 18, 65696, {1, 3, 3, 5, 29, 43, 77, 15, 463, 753, 695, 3489, 2023, 9913, 13029, 26621, 129393, 209439}}, {17321, 18, 65705, {1, 1, 5, 15, 1, 39, 55, 129, 247, 729, 1537, 2529, 3981, 13153, 1505, 12743, 104173, 218423}}, {17322, 18, 65716, {1, 3, 7, 3, 21, 3, 49, 173, 445, 821, 3, 2671, 1865, 1377, 7589, 65485, 96485, 80193}}, {17323, 18, 65725, {1, 3, 3, 11, 7, 21, 99, 143, 333, 869, 1469, 1579, 1749, 2203, 18773, 47377, 103211, 238357}}, {17324, 18, 65733, {1, 3, 5, 11, 11, 19, 25, 253, 229, 755, 101, 269, 6703, 5603, 23201, 57163, 28431, 159653}}, {17325, 18, 65740, {1, 3, 5, 3, 3, 15, 45, 225, 325, 997, 1061, 883, 3885, 7633, 461, 44411, 52129, 84535}}, {17326, 18, 65758, {1, 1, 7, 1, 27, 29, 51, 23, 473, 443, 117, 3021, 55, 7413, 7911, 3063, 47533, 234941}}, {17327, 18, 65786, {1, 3, 3, 15, 19, 43, 37, 95, 249, 805, 603, 865, 2115, 6999, 9739, 59029, 12181, 211159}}, {17328, 18, 65806, {1, 3, 7, 3, 3, 61, 105, 113, 11, 169, 1007, 689, 2553, 14561, 17473, 38249, 41225, 80021}}, {17329, 18, 65834, {1, 3, 7, 11, 5, 47, 69, 49, 457, 931, 435, 1423, 411, 15163, 3171, 29143, 101153, 240869}}, {17330, 18, 65844, {1, 3, 7, 1, 17, 1, 13, 45, 155, 551, 1783, 3583, 2767, 2761, 18019, 61635, 104527, 123817}}, {17331, 18, 65866, {1, 1, 5, 11, 9, 43, 101, 205, 233, 689, 1247, 2903, 3117, 12261, 11827, 50403, 103727, 35533}}, {17332, 18, 65895, {1, 1, 5, 13, 23, 37, 121, 195, 133, 265, 1517, 823, 5933, 13917, 6363, 8533, 58443, 178549}}, {17333, 18, 65902, {1, 1, 7, 9, 29, 1, 3, 195, 221, 877, 71, 473, 1173, 15285, 6057, 60005, 92401, 65357}}, {17334, 18, 65953, {1, 3, 7, 1, 5, 25, 15, 207, 455, 447, 1125, 3731, 1289, 867, 22111, 38893, 70779, 88277}}, {17335, 18, 65954, {1, 1, 1, 13, 31, 19, 15, 179, 183, 351, 1197, 1929, 3569, 12251, 17641, 4097, 24141, 186857}}, {17336, 18, 65983, {1, 1, 1, 9, 19, 9, 125, 23, 431, 225, 943, 479, 2615, 443, 30977, 10889, 17107, 116819}}, {17337, 18, 65985, {1, 3, 1, 9, 9, 13, 85, 123, 85, 857, 125, 3149, 1105, 3687, 2313, 38749, 52131, 259511}}, {17338, 18, 66003, {1, 3, 5, 7, 27, 33, 57, 105, 511, 871, 1089, 2311, 3291, 2245, 3365, 30211, 62549, 56207}}, {17339, 18, 66010, {1, 1, 7, 11, 1, 19, 75, 37, 139, 173, 391, 317, 2575, 11887, 4289, 32275, 43487, 487}}, {17340, 18, 66025, {1, 1, 7, 1, 11, 3, 9, 217, 343, 35, 59, 93, 1343, 5043, 14869, 63717, 40983, 235373}}, {17341, 18, 66050, {1, 1, 3, 5, 15, 13, 93, 247, 417, 179, 307, 3299, 4383, 5491, 21271, 37155, 32289, 75737}}, {17342, 18, 66074, {1, 3, 3, 9, 3, 39, 63, 243, 305, 729, 9, 3317, 3301, 13165, 20437, 36505, 32977, 2761}}, {17343, 18, 66076, {1, 3, 7, 5, 3, 37, 61, 109, 351, 641, 1699, 2517, 2637, 4995, 27365, 56971, 53609, 14373}}, {17344, 18, 66097, {1, 3, 1, 15, 31, 53, 127, 123, 219, 1003, 1425, 1201, 5303, 10369, 21481, 26987, 42541, 37855}}, {17345, 18, 66132, {1, 3, 3, 13, 9, 29, 35, 111, 395, 791, 1619, 2647, 713, 15955, 19145, 33883, 65215, 166267}}, {17346, 18, 66158, {1, 1, 7, 11, 17, 5, 45, 249, 421, 273, 411, 2885, 7027, 11933, 24847, 36969, 124701, 214931}}, {17347, 18, 66175, {1, 1, 3, 1, 27, 41, 125, 83, 327, 643, 223, 151, 6709, 15949, 125, 13275, 90405, 15759}}, {17348, 18, 66185, {1, 1, 5, 15, 19, 45, 55, 109, 497, 1011, 1363, 1937, 3697, 7475, 10533, 65325, 29681, 76275}}, {17349, 18, 66199, {1, 1, 1, 3, 23, 17, 59, 209, 229, 151, 1199, 279, 191, 8993, 25939, 13885, 113477, 166961}}, {17350, 18, 66206, {1, 3, 5, 1, 19, 61, 27, 129, 103, 721, 1451, 2803, 5879, 3523, 15443, 4047, 95927, 50339}}, {17351, 18, 66222, {1, 1, 1, 11, 27, 9, 53, 47, 331, 185, 1337, 3429, 807, 3341, 14871, 11035, 50651, 243843}}, {17352, 18, 66227, {1, 3, 5, 11, 7, 57, 125, 15, 271, 811, 1873, 3093, 7841, 5761, 19955, 571, 123319, 149465}}, {17353, 18, 66241, {1, 3, 1, 3, 31, 61, 71, 47, 477, 273, 167, 1069, 3513, 1463, 2667, 22097, 60367, 246045}}, {17354, 18, 66272, {1, 1, 1, 11, 1, 55, 35, 233, 37, 659, 1517, 411, 2981, 10339, 21857, 33701, 44393, 6861}}, {17355, 18, 66324, {1, 1, 5, 7, 11, 43, 109, 205, 103, 315, 1925, 2109, 6307, 7915, 19793, 61167, 27963, 251913}}, {17356, 18, 66424, {1, 1, 5, 11, 5, 63, 107, 219, 53, 251, 1053, 2035, 77, 15885, 22011, 3945, 91, 204899}}, {17357, 18, 66460, {1, 3, 7, 13, 21, 45, 51, 53, 99, 831, 1421, 3171, 4241, 14105, 26161, 45071, 2813, 54339}}, {17358, 18, 66464, {1, 3, 5, 1, 3, 61, 43, 141, 355, 699, 11, 2203, 8055, 14815, 24597, 65201, 32689, 70167}}, {17359, 18, 66481, {1, 3, 1, 5, 11, 27, 109, 239, 199, 23, 375, 1477, 3197, 4401, 29901, 46623, 79593, 133143}}, {17360, 18, 66482, {1, 1, 1, 3, 23, 9, 63, 103, 41, 177, 1365, 1971, 5937, 13055, 27713, 13535, 47371, 57841}}, {17361, 18, 66523, {1, 1, 5, 5, 19, 15, 5, 21, 307, 65, 215, 3801, 4149, 6565, 10249, 63541, 30867, 12129}}, {17362, 18, 66526, {1, 3, 3, 9, 11, 1, 107, 99, 235, 331, 1479, 1365, 2557, 9545, 25767, 12461, 6471, 184643}}, {17363, 18, 66532, {1, 3, 3, 5, 17, 13, 103, 223, 95, 955, 1479, 1825, 705, 5311, 28531, 22787, 118899, 181829}}, {17364, 18, 66539, {1, 3, 7, 1, 5, 59, 65, 11, 251, 419, 659, 2559, 5445, 4221, 5871, 51845, 33925, 167037}}, {17365, 18, 66541, {1, 3, 5, 13, 15, 45, 35, 181, 325, 293, 1897, 3321, 6081, 9919, 27641, 9407, 35263, 231009}}, {17366, 18, 66573, {1, 3, 3, 3, 3, 35, 85, 33, 293, 777, 1945, 3771, 6967, 12353, 2737, 12501, 127359, 163591}}, {17367, 18, 66582, {1, 3, 7, 9, 13, 7, 119, 107, 309, 811, 1113, 2465, 4867, 4295, 565, 59159, 94587, 119761}}, {17368, 18, 66591, {1, 3, 3, 1, 1, 31, 61, 49, 461, 635, 233, 175, 6237, 10463, 17847, 54925, 115675, 260575}}, {17369, 18, 66615, {1, 3, 5, 15, 25, 17, 61, 155, 235, 483, 1771, 2903, 3163, 2525, 17153, 54701, 49521, 11911}}, {17370, 18, 66622, {1, 3, 3, 5, 1, 35, 51, 23, 187, 107, 177, 1381, 165, 6149, 10841, 3619, 107811, 188811}}, {17371, 18, 66629, {1, 1, 5, 9, 7, 35, 5, 233, 43, 913, 939, 2195, 1369, 5355, 7941, 26075, 66813, 227623}}, {17372, 18, 66641, {1, 3, 7, 11, 5, 43, 97, 211, 427, 875, 1179, 3631, 7989, 2419, 17209, 15789, 128209, 224117}}, {17373, 18, 66712, {1, 1, 1, 7, 17, 7, 109, 255, 111, 883, 371, 3481, 6031, 14665, 5905, 28735, 113003, 327}}, {17374, 18, 66724, {1, 3, 5, 3, 5, 61, 7, 155, 87, 861, 39, 3163, 179, 15493, 16403, 18755, 116157, 233185}}, {17375, 18, 66731, {1, 3, 5, 5, 23, 45, 67, 205, 395, 417, 1235, 669, 5097, 6823, 31483, 61395, 36073, 24183}}, {17376, 18, 66745, {1, 1, 3, 1, 11, 35, 123, 171, 125, 759, 197, 907, 2273, 3623, 31861, 60071, 91857, 158011}}, {17377, 18, 66759, {1, 3, 7, 11, 19, 19, 25, 25, 167, 429, 1565, 3179, 5453, 15731, 30727, 32111, 63685, 113309}}, {17378, 18, 66808, {1, 3, 7, 9, 15, 33, 67, 225, 495, 19, 1881, 1357, 4311, 9547, 18717, 20749, 8819, 209979}}, {17379, 18, 66814, {1, 3, 5, 3, 13, 47, 107, 153, 461, 815, 1521, 2361, 7721, 10631, 2799, 62321, 59755, 170803}}, {17380, 18, 66821, {1, 3, 7, 5, 25, 61, 5, 235, 71, 349, 1555, 3419, 1159, 2027, 17391, 29849, 47145, 122057}}, {17381, 18, 66831, {1, 1, 5, 11, 19, 19, 101, 45, 333, 553, 1431, 4077, 2629, 15997, 19793, 65521, 124287, 174675}}, {17382, 18, 66834, {1, 3, 7, 11, 25, 39, 103, 219, 375, 27, 227, 1061, 445, 14803, 18883, 49191, 33303, 114467}}, {17383, 18, 66879, {1, 1, 5, 7, 3, 13, 117, 29, 387, 891, 371, 2199, 7023, 13671, 26291, 61563, 2733, 16093}}, {17384, 18, 66884, {1, 3, 5, 11, 29, 5, 17, 249, 149, 777, 1817, 319, 19, 12321, 15241, 29069, 58381, 157467}}, {17385, 18, 66899, {1, 3, 7, 9, 29, 17, 81, 141, 201, 383, 429, 3675, 69, 8155, 22821, 60707, 127015, 248279}}, {17386, 18, 66901, {1, 3, 7, 9, 25, 5, 11, 27, 423, 987, 99, 3599, 4849, 4513, 32119, 34301, 6327, 249457}}, {17387, 18, 66924, {1, 3, 3, 7, 13, 25, 71, 227, 307, 985, 665, 3097, 6713, 3823, 6357, 58199, 84057, 28055}}, {17388, 18, 66929, {1, 3, 5, 7, 19, 21, 93, 45, 159, 527, 493, 59, 1111, 1415, 1949, 28525, 50343, 11039}}, {17389, 18, 66942, {1, 3, 5, 13, 17, 35, 79, 229, 449, 533, 235, 3445, 8153, 15473, 12975, 53909, 24589, 237049}}, {17390, 18, 66985, {1, 1, 7, 5, 3, 53, 93, 33, 339, 423, 497, 2691, 6125, 3931, 25357, 27509, 92509, 227209}}, {17391, 18, 66986, {1, 1, 7, 3, 13, 49, 111, 179, 449, 279, 827, 1481, 2477, 6867, 18079, 6261, 30885, 205675}}, {17392, 18, 66994, {1, 3, 7, 7, 11, 9, 13, 105, 367, 639, 1307, 1617, 4759, 8387, 8909, 13715, 56599, 113259}}, {17393, 18, 67066, {1, 1, 3, 3, 15, 17, 103, 125, 205, 67, 999, 3965, 907, 13235, 15275, 58457, 66889, 227279}}, {17394, 18, 67075, {1, 3, 3, 3, 11, 35, 99, 81, 421, 75, 1757, 2413, 5655, 1227, 4019, 14503, 20719, 224807}}, {17395, 18, 67099, {1, 1, 7, 11, 17, 17, 109, 203, 331, 813, 987, 2925, 1601, 13617, 29, 8235, 95129, 117987}}, {17396, 18, 67130, {1, 3, 7, 5, 5, 33, 105, 191, 183, 899, 1949, 2923, 2473, 3435, 8097, 35615, 10109, 62563}}, {17397, 18, 67173, {1, 1, 7, 13, 5, 25, 21, 159, 487, 415, 1507, 2161, 649, 14425, 2605, 8357, 92441, 87323}}, {17398, 18, 67183, {1, 3, 7, 15, 3, 23, 87, 209, 407, 765, 975, 3859, 675, 6351, 18703, 44919, 57155, 134961}}, {17399, 18, 67186, {1, 3, 5, 15, 7, 59, 77, 37, 235, 565, 1707, 3531, 6733, 2223, 12621, 59523, 83547, 172355}}, {17400, 18, 67197, {1, 3, 7, 5, 23, 15, 57, 217, 151, 333, 1033, 2549, 303, 1455, 5329, 20187, 55415, 166093}}, {17401, 18, 67201, {1, 3, 1, 13, 21, 27, 1, 85, 335, 201, 135, 2603, 291, 10573, 28411, 1059, 129871, 98303}}, {17402, 18, 67208, {1, 1, 3, 5, 23, 61, 123, 169, 503, 629, 711, 2795, 2291, 13273, 32703, 63377, 72809, 214927}}, {17403, 18, 67221, {1, 3, 5, 13, 31, 11, 115, 133, 443, 709, 263, 3739, 2777, 11545, 19137, 61285, 64065, 214477}}, {17404, 18, 67238, {1, 3, 1, 11, 29, 25, 3, 5, 385, 613, 1277, 1445, 1643, 15137, 28041, 47713, 122051, 62915}}, {17405, 18, 67252, {1, 3, 5, 11, 3, 11, 1, 137, 457, 577, 783, 1745, 5, 5817, 26569, 50751, 14075, 246219}}, {17406, 18, 67256, {1, 1, 1, 9, 7, 9, 105, 27, 167, 939, 799, 2773, 6427, 15579, 1975, 10695, 111429, 227105}}, {17407, 18, 67270, {1, 3, 1, 11, 23, 23, 73, 103, 103, 61, 1743, 3061, 8127, 15893, 21223, 43549, 103659, 89129}}, {17408, 18, 67288, {1, 1, 7, 13, 5, 43, 59, 235, 139, 961, 839, 3843, 1317, 4903, 21043, 15479, 115065, 112531}}, {17409, 18, 67318, {1, 3, 1, 3, 19, 15, 57, 145, 193, 321, 1919, 385, 125, 15517, 14243, 62845, 38995, 120045}}, {17410, 18, 67329, {1, 3, 3, 7, 17, 61, 77, 75, 267, 203, 1911, 2599, 1797, 761, 28101, 58603, 107755, 158689}}, {17411, 18, 67349, {1, 1, 5, 11, 15, 21, 71, 227, 377, 361, 2013, 129, 6271, 1421, 6009, 52261, 113389, 74915}}, {17412, 18, 67369, {1, 1, 5, 7, 3, 39, 27, 49, 97, 885, 651, 1633, 3445, 3415, 20167, 26667, 52997, 221391}}, {17413, 18, 67392, {1, 1, 7, 9, 7, 59, 95, 127, 479, 871, 845, 2951, 673, 6385, 10057, 2605, 78529, 230771}}, {17414, 18, 67435, {1, 3, 5, 7, 31, 15, 53, 125, 223, 711, 875, 429, 7237, 4005, 2153, 26865, 63205, 144125}}, {17415, 18, 67473, {1, 1, 7, 9, 1, 57, 19, 189, 67, 423, 1937, 37, 4925, 15503, 25969, 20419, 59921, 58119}}, {17416, 18, 67496, {1, 1, 7, 7, 31, 51, 99, 189, 21, 1011, 1551, 3529, 7617, 15805, 11365, 43123, 84785, 203703}}, {17417, 18, 67507, {1, 1, 3, 15, 3, 63, 9, 67, 399, 151, 253, 1839, 1365, 16295, 13145, 29211, 48681, 177643}}, {17418, 18, 67514, {1, 1, 1, 5, 13, 37, 1, 21, 435, 483, 939, 535, 1505, 10879, 7027, 5599, 63261, 158573}}, {17419, 18, 67536, {1, 1, 7, 15, 13, 39, 113, 209, 213, 1017, 1197, 285, 4221, 6831, 13383, 2265, 34313, 160879}}, {17420, 18, 67555, {1, 3, 7, 15, 25, 23, 95, 217, 141, 681, 451, 1275, 4957, 10197, 21375, 50905, 11087, 96135}}, {17421, 18, 67598, {1, 3, 1, 11, 17, 35, 87, 15, 57, 777, 1429, 615, 681, 8437, 23981, 51781, 112169, 198471}}, {17422, 18, 67615, {1, 3, 1, 5, 21, 37, 113, 105, 123, 327, 549, 1641, 7697, 2127, 5709, 8351, 56787, 260157}}, {17423, 18, 67625, {1, 3, 7, 15, 19, 17, 51, 15, 367, 89, 1635, 353, 4855, 1551, 7197, 27403, 11259, 176029}}, {17424, 18, 67645, {1, 3, 1, 1, 27, 9, 3, 35, 213, 31, 885, 797, 7077, 15641, 22509, 35193, 112411, 157335}}, {17425, 18, 67651, {1, 1, 5, 1, 5, 9, 101, 149, 169, 581, 1927, 197, 5935, 6361, 3915, 15541, 69575, 102451}}, {17426, 18, 67663, {1, 3, 3, 13, 23, 63, 45, 205, 271, 17, 707, 937, 2547, 12019, 8559, 26163, 58117, 138625}}, {17427, 18, 67672, {1, 1, 3, 1, 19, 63, 125, 175, 253, 629, 1121, 3701, 7755, 61, 13037, 39417, 6179, 261923}}, {17428, 18, 67682, {1, 1, 5, 1, 25, 63, 27, 245, 371, 657, 157, 3821, 3279, 8977, 9065, 35611, 27325, 205737}}, {17429, 18, 67699, {1, 3, 7, 15, 7, 57, 19, 191, 1, 927, 1379, 2579, 4335, 7163, 4877, 51435, 17309, 100173}}, {17430, 18, 67718, {1, 1, 1, 5, 21, 59, 107, 195, 317, 691, 541, 69, 7235, 2175, 25191, 23913, 126369, 9263}}, {17431, 18, 67780, {1, 3, 5, 15, 17, 7, 67, 27, 263, 855, 1065, 973, 6705, 10729, 8719, 32741, 59207, 249107}}, {17432, 18, 67795, {1, 3, 1, 1, 21, 23, 115, 119, 351, 207, 1691, 1105, 7479, 3877, 24439, 29017, 34171, 133797}}, {17433, 18, 67804, {1, 3, 3, 3, 11, 23, 39, 165, 99, 1023, 309, 3933, 4235, 3891, 27237, 30887, 34363, 175017}}, {17434, 18, 67818, {1, 3, 1, 5, 17, 33, 79, 105, 253, 515, 823, 1783, 1523, 2095, 10355, 8929, 51001, 112815}}, {17435, 18, 67832, {1, 3, 7, 15, 11, 27, 123, 161, 279, 541, 1343, 1009, 6015, 8565, 27031, 233, 2153, 179243}}, {17436, 18, 67941, {1, 1, 7, 7, 1, 53, 1, 33, 75, 57, 723, 3855, 3301, 14941, 6637, 25181, 103441, 208339}}, {17437, 18, 67984, {1, 3, 7, 13, 3, 23, 11, 75, 55, 19, 1181, 3451, 4901, 2621, 18323, 42395, 95701, 237753}}, {17438, 18, 68044, {1, 1, 1, 5, 1, 1, 123, 203, 367, 71, 1897, 295, 6719, 2647, 7135, 34511, 79853, 58351}}, {17439, 18, 68059, {1, 3, 3, 7, 7, 63, 87, 91, 223, 265, 927, 3843, 1703, 11633, 8077, 26425, 46573, 181201}}, {17440, 18, 68062, {1, 3, 3, 3, 1, 51, 3, 99, 37, 251, 1739, 2813, 3955, 8745, 4425, 42419, 124177, 173997}}, {17441, 18, 68065, {1, 3, 5, 15, 9, 19, 11, 207, 123, 287, 1703, 2155, 2729, 4541, 4925, 4735, 77159, 97911}}, {17442, 18, 68071, {1, 3, 3, 15, 23, 31, 35, 33, 507, 315, 1071, 3001, 7569, 11749, 3183, 6989, 68637, 177803}}, {17443, 18, 68072, {1, 3, 5, 1, 31, 1, 113, 39, 295, 263, 1113, 619, 5523, 15385, 24115, 24233, 91943, 129299}}, {17444, 18, 68085, {1, 1, 5, 11, 9, 57, 89, 49, 67, 601, 1277, 2275, 6349, 4141, 28397, 47061, 28143, 126291}}, {17445, 18, 68090, {1, 3, 7, 15, 11, 63, 123, 187, 305, 1009, 1509, 2569, 2235, 8233, 27351, 53437, 34353, 105799}}, {17446, 18, 68101, {1, 1, 3, 1, 13, 9, 11, 169, 427, 171, 1031, 633, 4275, 1173, 11233, 57997, 107753, 257337}}, {17447, 18, 68102, {1, 3, 5, 5, 3, 39, 49, 233, 309, 999, 1275, 85, 1663, 16275, 9145, 18439, 59055, 249657}}, {17448, 18, 68106, {1, 1, 3, 7, 11, 55, 73, 75, 115, 397, 945, 3657, 6847, 7341, 21305, 30119, 65675, 169281}}, {17449, 18, 68164, {1, 1, 7, 7, 3, 5, 31, 179, 183, 479, 329, 217, 1077, 6893, 23425, 21903, 34293, 184819}}, {17450, 18, 68191, {1, 1, 3, 3, 7, 63, 97, 255, 289, 917, 1881, 3829, 2433, 3473, 11045, 37739, 73349, 171899}}, {17451, 18, 68192, {1, 3, 5, 5, 27, 23, 61, 151, 353, 667, 1889, 2323, 3261, 15999, 24225, 35265, 97301, 75743}}, {17452, 18, 68195, {1, 3, 7, 1, 19, 41, 81, 61, 461, 275, 131, 2665, 5615, 1719, 21047, 42025, 97725, 196587}}, {17453, 18, 68209, {1, 1, 7, 11, 3, 5, 47, 107, 397, 237, 1795, 3049, 5317, 14147, 15299, 50469, 83855, 75685}}, {17454, 18, 68245, {1, 1, 7, 7, 19, 31, 39, 153, 225, 591, 1547, 3755, 3219, 15823, 4015, 30977, 63999, 198023}}, {17455, 18, 68246, {1, 3, 1, 1, 17, 57, 91, 3, 425, 465, 735, 719, 2955, 3003, 6669, 14335, 32137, 82265}}, {17456, 18, 68274, {1, 3, 1, 9, 13, 25, 93, 187, 119, 735, 447, 3387, 5111, 6525, 28241, 37643, 99023, 58551}}, {17457, 18, 68293, {1, 1, 7, 1, 23, 15, 105, 89, 109, 743, 2007, 3131, 4839, 3285, 14681, 47097, 69531, 104647}}, {17458, 18, 68294, {1, 1, 5, 7, 27, 33, 85, 109, 165, 569, 511, 3223, 2201, 2869, 30457, 42585, 125187, 83115}}, {17459, 18, 68322, {1, 1, 7, 13, 1, 39, 55, 69, 279, 757, 425, 1317, 2403, 10711, 3341, 33491, 5607, 214161}}, {17460, 18, 68353, {1, 3, 3, 9, 23, 57, 109, 9, 473, 323, 1371, 657, 5039, 1947, 12787, 29099, 81887, 44039}}, {17461, 18, 68359, {1, 3, 1, 9, 21, 49, 39, 71, 493, 611, 1465, 3965, 7509, 5315, 4095, 21865, 123533, 148467}}, {17462, 18, 68377, {1, 1, 7, 5, 15, 45, 67, 109, 143, 423, 205, 849, 1291, 245, 26275, 62873, 69177, 173705}}, {17463, 18, 68401, {1, 3, 7, 13, 3, 13, 103, 45, 171, 919, 903, 2171, 5025, 14855, 895, 36937, 37643, 30311}}, {17464, 18, 68422, {1, 3, 1, 5, 31, 35, 67, 111, 201, 183, 375, 905, 5705, 8839, 31551, 22525, 53013, 34189}}, {17465, 18, 68434, {1, 1, 3, 7, 25, 11, 85, 231, 285, 957, 1731, 1267, 8179, 14195, 18405, 8489, 32503, 86257}}, {17466, 18, 68443, {1, 3, 7, 5, 29, 7, 73, 15, 501, 909, 1325, 793, 4479, 12137, 30871, 36243, 109781, 7235}}, {17467, 18, 68445, {1, 1, 3, 15, 13, 13, 75, 221, 497, 921, 1939, 2791, 5277, 6257, 11129, 109, 27549, 44901}}, {17468, 18, 68476, {1, 1, 7, 3, 21, 9, 35, 113, 101, 15, 545, 2429, 5869, 11379, 14427, 28605, 108313, 220523}}, {17469, 18, 68492, {1, 3, 5, 5, 21, 31, 79, 101, 11, 687, 609, 3741, 1259, 1529, 10185, 49863, 86529, 5147}}, {17470, 18, 68504, {1, 3, 1, 5, 5, 49, 105, 213, 435, 201, 511, 525, 5219, 9503, 32023, 25407, 2493, 51165}}, {17471, 18, 68525, {1, 1, 5, 9, 9, 61, 67, 107, 351, 519, 1373, 1261, 1069, 4325, 9579, 37117, 71759, 17601}}, {17472, 18, 68540, {1, 1, 7, 7, 27, 63, 63, 229, 239, 291, 1813, 3831, 8091, 2553, 18445, 60707, 88855, 224325}}, {17473, 18, 68543, {1, 1, 5, 7, 15, 23, 109, 7, 409, 447, 185, 3535, 4643, 13431, 11107, 48771, 95843, 155889}}, {17474, 18, 68555, {1, 3, 3, 11, 9, 47, 13, 31, 83, 837, 1661, 2283, 299, 13161, 25305, 6079, 107237, 58477}}, {17475, 18, 68563, {1, 3, 7, 15, 3, 31, 21, 245, 105, 141, 703, 71, 1887, 9345, 15719, 37737, 58431, 195997}}, {17476, 18, 68576, {1, 1, 1, 13, 25, 21, 23, 67, 349, 581, 1585, 809, 3955, 4621, 25989, 25633, 107229, 193271}}, {17477, 18, 68581, {1, 1, 5, 3, 15, 57, 111, 147, 243, 575, 851, 3461, 5171, 4203, 21855, 59579, 90509, 16897}}, {17478, 18, 68617, {1, 1, 5, 13, 5, 45, 83, 59, 253, 261, 1277, 3179, 6397, 4277, 6629, 10979, 55759, 3033}}, {17479, 18, 68631, {1, 1, 1, 9, 25, 1, 127, 159, 273, 357, 1343, 3209, 649, 6631, 1365, 40813, 98955, 181679}}, {17480, 18, 68656, {1, 3, 1, 11, 1, 9, 67, 5, 41, 661, 863, 3769, 2737, 7261, 26829, 43093, 113025, 127975}}, {17481, 18, 68666, {1, 1, 3, 3, 7, 5, 77, 207, 125, 625, 437, 1059, 2635, 1099, 25567, 63759, 97575, 231313}}, {17482, 18, 68714, {1, 3, 7, 5, 21, 41, 11, 177, 489, 405, 1831, 1373, 6267, 11275, 23613, 55565, 120353, 98771}}, {17483, 18, 68743, {1, 1, 3, 11, 15, 55, 103, 185, 493, 755, 1235, 3143, 4355, 4887, 11245, 60103, 4023, 184729}}, {17484, 18, 68761, {1, 3, 1, 1, 23, 5, 103, 117, 269, 101, 2013, 1781, 6445, 8753, 15041, 13993, 28753, 47133}}, {17485, 18, 68764, {1, 3, 7, 5, 9, 23, 1, 203, 19, 535, 1445, 1713, 5503, 11555, 6195, 35797, 55663, 10187}}, {17486, 18, 68767, {1, 3, 5, 1, 15, 3, 125, 225, 447, 269, 1663, 1823, 4309, 12243, 16689, 3889, 41111, 123355}}, {17487, 18, 68768, {1, 1, 1, 5, 21, 33, 83, 147, 243, 101, 1085, 121, 4939, 6081, 22621, 52995, 103047, 82531}}, {17488, 18, 68786, {1, 3, 5, 3, 21, 3, 5, 81, 431, 191, 1973, 3675, 6691, 8687, 31619, 51669, 95541, 110447}}, {17489, 18, 68788, {1, 1, 1, 15, 1, 11, 83, 145, 75, 133, 967, 2837, 5111, 6099, 9119, 53661, 128647, 40557}}, {17490, 18, 68848, {1, 1, 1, 7, 3, 57, 101, 231, 255, 117, 1903, 2133, 3867, 11299, 647, 58853, 22153, 135959}}, {17491, 18, 68851, {1, 3, 5, 5, 9, 19, 89, 229, 313, 421, 201, 953, 2487, 6283, 1305, 33421, 20933, 164841}}, {17492, 18, 68914, {1, 1, 3, 3, 1, 45, 93, 165, 343, 577, 1329, 3019, 2727, 14397, 7123, 63347, 45525, 35133}}, {17493, 18, 68946, {1, 3, 5, 5, 19, 1, 33, 55, 49, 1003, 1567, 2539, 7461, 14641, 7655, 37499, 65525, 84961}}, {17494, 18, 68952, {1, 3, 5, 5, 29, 3, 77, 39, 251, 791, 215, 3779, 1589, 3577, 22299, 24133, 105449, 257157}}, {17495, 18, 68973, {1, 3, 1, 5, 7, 23, 109, 209, 35, 571, 1047, 3453, 3657, 11713, 19379, 57101, 29943, 60909}}, {17496, 18, 69001, {1, 1, 7, 11, 17, 63, 15, 175, 333, 831, 1447, 1991, 3339, 2519, 30127, 51481, 71935, 144995}}, {17497, 18, 69016, {1, 3, 1, 11, 13, 51, 17, 67, 43, 209, 789, 1285, 5655, 5841, 10203, 32053, 15721, 211725}}, {17498, 18, 69035, {1, 1, 5, 7, 31, 49, 69, 255, 325, 819, 1769, 1961, 7403, 1241, 2241, 40425, 14839, 178969}}, {17499, 18, 69037, {1, 1, 3, 9, 1, 5, 9, 35, 167, 865, 337, 1079, 6195, 10139, 19215, 57607, 122437, 197147}}, {17500, 18, 69049, {1, 1, 1, 15, 23, 7, 47, 155, 345, 547, 333, 3747, 961, 1397, 17067, 33385, 48253, 138611}}, {17501, 18, 69052, {1, 1, 7, 9, 29, 27, 81, 183, 153, 171, 1125, 1929, 1047, 12463, 1543, 42981, 126163, 203259}}, {17502, 18, 69058, {1, 1, 5, 3, 1, 41, 123, 213, 7, 179, 1, 3527, 1437, 3545, 2025, 5325, 27097, 187823}}, {17503, 18, 69063, {1, 1, 7, 1, 19, 5, 111, 251, 431, 91, 1437, 1155, 335, 9587, 18287, 23937, 123331, 3939}}, {17504, 18, 69075, {1, 1, 1, 9, 13, 59, 75, 219, 225, 313, 525, 2003, 7829, 7063, 22123, 4263, 95491, 9375}}, {17505, 18, 69112, {1, 3, 1, 1, 27, 29, 71, 189, 169, 301, 165, 2967, 5147, 7127, 2191, 34259, 66605, 149603}}, {17506, 18, 69117, {1, 3, 5, 13, 29, 57, 105, 31, 495, 311, 1161, 2109, 1471, 1275, 12761, 58379, 46365, 229935}}, {17507, 18, 69124, {1, 1, 7, 3, 7, 49, 125, 189, 309, 399, 1361, 3969, 2177, 8171, 26623, 41855, 2809, 5825}}, {17508, 18, 69127, {1, 3, 5, 7, 17, 21, 77, 101, 37, 661, 1743, 2243, 823, 12431, 26931, 7163, 108093, 191305}}, {17509, 18, 69134, {1, 1, 7, 5, 27, 55, 109, 119, 13, 727, 421, 3469, 1137, 6125, 5107, 52733, 102891, 147425}}, {17510, 18, 69139, {1, 1, 3, 5, 17, 45, 17, 211, 137, 21, 689, 1487, 233, 9845, 6499, 52617, 73081, 198137}}, {17511, 18, 69161, {1, 3, 7, 1, 25, 27, 67, 7, 161, 633, 729, 807, 7371, 7301, 29499, 45939, 110565, 219491}}, {17512, 18, 69196, {1, 3, 3, 13, 17, 7, 55, 211, 103, 981, 1809, 1913, 5705, 14011, 7405, 13893, 92053, 17997}}, {17513, 18, 69224, {1, 1, 1, 1, 15, 9, 75, 37, 5, 443, 157, 2749, 5587, 16087, 14953, 26793, 21229, 226879}}, {17514, 18, 69238, {1, 3, 3, 3, 9, 13, 113, 7, 255, 647, 235, 1713, 525, 8579, 20873, 49565, 43869, 145823}}, {17515, 18, 69301, {1, 1, 5, 15, 9, 1, 119, 189, 73, 321, 1045, 467, 1565, 14381, 22683, 7939, 44337, 231901}}, {17516, 18, 69316, {1, 1, 3, 13, 21, 61, 35, 105, 425, 395, 381, 1205, 3631, 8099, 23723, 29435, 94683, 180367}}, {17517, 18, 69325, {1, 3, 3, 13, 19, 15, 59, 111, 355, 165, 857, 3131, 5037, 2527, 17533, 53563, 621, 89837}}, {17518, 18, 69334, {1, 3, 3, 11, 11, 41, 3, 75, 179, 325, 897, 3141, 75, 1735, 493, 1123, 126763, 68645}}, {17519, 18, 69347, {1, 3, 5, 7, 19, 61, 9, 99, 101, 583, 1967, 621, 1869, 10693, 2025, 62797, 85727, 212309}}, {17520, 18, 69359, {1, 3, 1, 13, 23, 47, 15, 29, 199, 889, 423, 3995, 1655, 10753, 25301, 55551, 94829, 205833}}, {17521, 18, 69381, {1, 1, 1, 1, 21, 1, 91, 237, 195, 721, 881, 1155, 4109, 10367, 1873, 6851, 13295, 182363}}, {17522, 18, 69388, {1, 1, 5, 15, 19, 35, 37, 197, 137, 255, 93, 681, 949, 15183, 24785, 39357, 65547, 149013}}, {17523, 18, 69393, {1, 3, 3, 3, 27, 27, 95, 239, 171, 513, 655, 1629, 4577, 3005, 1681, 2581, 59995, 83981}}, {17524, 18, 69409, {1, 3, 3, 7, 29, 33, 111, 85, 437, 297, 1563, 2411, 6171, 2043, 17625, 59093, 995, 211599}}, {17525, 18, 69422, {1, 3, 1, 13, 19, 35, 33, 9, 57, 153, 819, 2017, 5879, 13559, 23135, 25981, 41091, 50975}}, {17526, 18, 69453, {1, 3, 5, 11, 23, 53, 11, 123, 119, 57, 1775, 3457, 7939, 4999, 10771, 23571, 30099, 17361}}, {17527, 18, 69459, {1, 1, 7, 11, 27, 13, 7, 215, 7, 1009, 1967, 1845, 6679, 13781, 21797, 18755, 47131, 245907}}, {17528, 18, 69481, {1, 1, 1, 3, 19, 47, 35, 13, 287, 349, 439, 3125, 2387, 12483, 3833, 29399, 27037, 30235}}, {17529, 18, 69487, {1, 3, 1, 15, 17, 41, 15, 21, 499, 87, 1899, 2835, 1919, 925, 4525, 12935, 25021, 106657}}, {17530, 18, 69490, {1, 1, 1, 13, 17, 59, 73, 75, 443, 199, 1871, 3447, 4517, 8395, 16661, 30655, 17871, 231337}}, {17531, 18, 69495, {1, 1, 7, 1, 1, 53, 17, 49, 259, 77, 917, 631, 6061, 12291, 17715, 49761, 70699, 68313}}, {17532, 18, 69501, {1, 1, 3, 9, 13, 27, 67, 149, 229, 347, 1397, 3457, 6047, 13117, 11, 18121, 70323, 36441}}, {17533, 18, 69511, {1, 3, 5, 7, 27, 13, 69, 177, 451, 87, 647, 3797, 5433, 3137, 20213, 9809, 126877, 55243}}, {17534, 18, 69512, {1, 3, 7, 13, 21, 57, 73, 157, 173, 631, 1527, 337, 5605, 8041, 2181, 19567, 19829, 63353}}, {17535, 18, 69532, {1, 3, 3, 7, 11, 5, 111, 161, 247, 553, 435, 3883, 5639, 10889, 8953, 58297, 15197, 99711}}, {17536, 18, 69542, {1, 1, 7, 13, 11, 29, 71, 251, 387, 1003, 1275, 763, 67, 10597, 5995, 53677, 4683, 2157}}, {17537, 18, 69560, {1, 1, 3, 9, 23, 27, 93, 209, 325, 517, 297, 3215, 4359, 395, 10377, 36967, 69803, 190037}}, {17538, 18, 69565, {1, 1, 1, 3, 27, 61, 21, 229, 469, 3, 387, 523, 4753, 2267, 9879, 32113, 60837, 76205}}, {17539, 18, 69571, {1, 3, 1, 7, 31, 31, 67, 15, 161, 699, 713, 2973, 2007, 693, 21823, 57549, 28989, 157879}}, {17540, 18, 69611, {1, 3, 1, 1, 3, 63, 111, 61, 311, 685, 1029, 345, 6763, 16217, 14505, 9777, 3513, 160985}}, {17541, 18, 69633, {1, 1, 1, 11, 5, 25, 13, 79, 337, 3, 1997, 3489, 7621, 12115, 9221, 7953, 19067, 52697}}, {17542, 18, 69640, {1, 1, 1, 3, 19, 3, 85, 127, 475, 391, 293, 2249, 1211, 1185, 17133, 6753, 65517, 98157}}, {17543, 18, 69667, {1, 1, 5, 9, 11, 31, 57, 107, 315, 983, 1117, 2189, 4813, 9925, 26635, 30589, 32989, 44195}}, {17544, 18, 69669, {1, 1, 7, 7, 21, 1, 1, 221, 421, 199, 539, 3981, 4627, 15655, 12621, 20427, 11619, 187185}}, {17545, 18, 69679, {1, 1, 7, 5, 13, 19, 49, 31, 55, 35, 1847, 3173, 475, 15245, 30907, 50075, 130837, 87283}}, {17546, 18, 69688, {1, 1, 7, 15, 13, 47, 13, 17, 169, 185, 1411, 1689, 2339, 2159, 10591, 52283, 26785, 255707}}, {17547, 18, 69699, {1, 3, 5, 7, 3, 29, 7, 83, 329, 747, 1755, 1067, 2565, 2437, 12309, 15043, 97589, 69409}}, {17548, 18, 69756, {1, 3, 3, 9, 19, 49, 9, 231, 427, 131, 485, 1637, 1129, 14723, 19071, 47997, 74613, 171539}}, {17549, 18, 69759, {1, 1, 1, 1, 5, 17, 105, 39, 313, 407, 1321, 3013, 8035, 4395, 15917, 21105, 53599, 21341}}, {17550, 18, 69770, {1, 3, 1, 15, 7, 35, 5, 153, 485, 1019, 713, 1891, 5023, 13885, 15911, 48215, 81719, 228189}}, {17551, 18, 69772, {1, 1, 3, 3, 19, 3, 103, 55, 221, 847, 27, 1653, 4887, 3617, 30235, 42353, 67007, 21443}}, {17552, 18, 69826, {1, 1, 7, 15, 15, 39, 65, 189, 251, 411, 1953, 1187, 141, 14919, 7763, 50879, 2569, 63467}}, {17553, 18, 69840, {1, 1, 7, 1, 15, 3, 37, 133, 11, 745, 697, 3755, 1233, 2009, 25597, 40661, 40743, 198117}}, {17554, 18, 69846, {1, 1, 7, 15, 5, 17, 13, 253, 197, 491, 1499, 2141, 6803, 13833, 27297, 385, 54341, 64305}}, {17555, 18, 69868, {1, 3, 5, 7, 3, 11, 19, 193, 441, 575, 1649, 1821, 2621, 15803, 7343, 37361, 16467, 60629}}, {17556, 18, 69885, {1, 3, 3, 11, 11, 29, 109, 1, 83, 475, 1913, 1975, 1289, 5221, 24221, 7479, 26683, 203435}}, {17557, 18, 69946, {1, 1, 3, 13, 3, 35, 119, 131, 323, 413, 147, 4009, 3167, 11161, 30523, 65223, 109859, 239317}}, {17558, 18, 69966, {1, 3, 1, 11, 25, 17, 103, 165, 437, 163, 1141, 105, 3655, 8105, 20859, 50727, 27915, 19309}}, {17559, 18, 69973, {1, 3, 3, 11, 9, 59, 17, 135, 131, 781, 675, 2865, 7287, 11431, 3717, 56691, 54971, 83433}}, {17560, 18, 69977, {1, 1, 1, 11, 3, 1, 59, 35, 299, 927, 1761, 823, 287, 13271, 30321, 32895, 45961, 23151}}, {17561, 18, 69980, {1, 3, 3, 7, 11, 3, 11, 115, 241, 497, 1359, 1789, 6677, 2683, 21145, 58185, 46131, 17591}}, {17562, 18, 69984, {1, 3, 1, 3, 17, 5, 65, 169, 247, 1001, 1183, 1801, 759, 2797, 28721, 7549, 112463, 127451}}, {17563, 18, 69994, {1, 1, 1, 11, 1, 49, 5, 227, 333, 793, 759, 2845, 6261, 6325, 6581, 35853, 39737, 21457}}, {17564, 18, 70024, {1, 1, 1, 3, 7, 17, 81, 105, 453, 207, 1113, 301, 4933, 14715, 18815, 29165, 85251, 209171}}, {17565, 18, 70044, {1, 3, 1, 13, 3, 25, 7, 109, 249, 649, 1009, 937, 659, 14605, 13325, 26003, 45507, 166837}}, {17566, 18, 70053, {1, 3, 7, 11, 19, 57, 55, 213, 261, 325, 761, 3167, 6823, 15039, 13329, 30195, 52103, 27877}}, {17567, 18, 70086, {1, 3, 3, 11, 31, 45, 3, 185, 225, 143, 651, 327, 4263, 6005, 31577, 57779, 90485, 48393}}, {17568, 18, 70113, {1, 1, 3, 13, 9, 21, 97, 63, 285, 531, 1275, 175, 693, 3735, 15137, 62193, 80533, 196545}}, {17569, 18, 70120, {1, 1, 1, 11, 5, 25, 101, 111, 101, 17, 1999, 3709, 19, 5087, 20151, 4781, 88417, 186293}}, {17570, 18, 70131, {1, 1, 5, 7, 31, 37, 39, 85, 451, 189, 1521, 619, 5021, 2601, 32447, 43513, 8317, 170611}}, {17571, 18, 70150, {1, 1, 7, 1, 25, 45, 33, 111, 443, 719, 1869, 3619, 5751, 2649, 27823, 55465, 113203, 23875}}, {17572, 18, 70178, {1, 3, 5, 15, 19, 47, 49, 241, 75, 395, 307, 1001, 137, 7029, 21661, 39159, 94129, 106693}}, {17573, 18, 70198, {1, 3, 7, 1, 7, 35, 85, 27, 285, 975, 565, 2119, 5861, 9229, 15877, 25017, 10551, 155357}}, {17574, 18, 70227, {1, 3, 3, 5, 29, 41, 17, 159, 211, 571, 907, 1745, 6541, 11643, 4441, 54599, 83359, 57227}}, {17575, 18, 70285, {1, 3, 7, 5, 19, 11, 37, 191, 75, 443, 1833, 1715, 6949, 2477, 31161, 15647, 84305, 82887}}, {17576, 18, 70288, {1, 1, 3, 9, 29, 35, 87, 11, 147, 443, 1659, 2457, 1615, 16135, 10729, 31583, 111583, 52607}}, {17577, 18, 70291, {1, 3, 7, 1, 7, 47, 55, 133, 53, 23, 225, 2689, 3075, 12435, 8337, 37065, 58631, 247415}}, {17578, 18, 70309, {1, 3, 3, 9, 23, 39, 5, 17, 353, 443, 627, 1609, 5277, 3899, 31111, 5935, 25445, 161043}}, {17579, 18, 70334, {1, 3, 3, 11, 31, 11, 97, 99, 37, 169, 1361, 689, 5481, 5935, 11957, 36761, 105641, 250905}}, {17580, 18, 70339, {1, 1, 7, 15, 31, 33, 3, 201, 125, 649, 315, 497, 7715, 2331, 9081, 16073, 88459, 70475}}, {17581, 18, 70381, {1, 1, 7, 13, 25, 25, 39, 193, 185, 253, 495, 1143, 3745, 3459, 10935, 22029, 70213, 245827}}, {17582, 18, 70413, {1, 3, 3, 11, 1, 47, 93, 27, 117, 755, 1837, 4045, 4839, 3413, 21395, 41905, 6505, 158029}}, {17583, 18, 70414, {1, 3, 5, 5, 3, 41, 23, 207, 3, 409, 1635, 3511, 899, 747, 10623, 44933, 62439, 75577}}, {17584, 18, 70481, {1, 3, 7, 15, 1, 15, 113, 175, 43, 513, 515, 1295, 1903, 9961, 20995, 57319, 40649, 22799}}, {17585, 18, 70488, {1, 1, 5, 9, 7, 25, 99, 167, 117, 547, 777, 3819, 4409, 13465, 3963, 53355, 67895, 58007}}, {17586, 18, 70493, {1, 1, 5, 9, 25, 9, 11, 113, 455, 563, 143, 1507, 4055, 6805, 25027, 37645, 475, 193193}}, {17587, 18, 70515, {1, 1, 1, 11, 15, 27, 123, 199, 229, 27, 1285, 4013, 6541, 11203, 23705, 56821, 59665, 151109}}, {17588, 18, 70540, {1, 1, 3, 1, 31, 19, 27, 129, 235, 407, 865, 2723, 5387, 7727, 2309, 45787, 118107, 199907}}, {17589, 18, 70543, {1, 1, 5, 15, 17, 1, 21, 167, 165, 203, 745, 825, 7993, 15191, 13731, 13417, 543, 201511}}, {17590, 18, 70558, {1, 3, 1, 1, 29, 49, 45, 81, 321, 755, 1319, 633, 4889, 7809, 6305, 58233, 20213, 144915}}, {17591, 18, 70568, {1, 1, 3, 13, 1, 31, 73, 173, 111, 961, 1995, 3827, 879, 5567, 31103, 13227, 126611, 204507}}, {17592, 18, 70582, {1, 1, 3, 7, 21, 3, 75, 137, 125, 981, 1991, 1167, 1249, 3821, 19503, 52855, 122329, 68717}}, {17593, 18, 70593, {1, 1, 1, 13, 17, 17, 69, 167, 327, 635, 427, 2125, 7499, 9715, 24097, 39361, 64301, 63411}}, {17594, 18, 70596, {1, 1, 1, 1, 31, 57, 55, 31, 289, 251, 823, 2301, 5965, 3381, 479, 39545, 93051, 68683}}, {17595, 18, 70613, {1, 1, 3, 3, 15, 27, 117, 37, 29, 851, 1891, 3507, 6279, 323, 11451, 57961, 41487, 188359}}, {17596, 18, 70620, {1, 1, 5, 1, 25, 55, 125, 207, 129, 849, 589, 1381, 3395, 645, 1157, 29285, 105423, 104429}}, {17597, 18, 70647, {1, 1, 7, 7, 9, 47, 41, 103, 473, 395, 883, 1087, 2827, 9685, 6313, 15461, 39803, 254865}}, {17598, 18, 70666, {1, 1, 7, 3, 17, 55, 71, 119, 159, 185, 1415, 3033, 3045, 1403, 18349, 2727, 123995, 45953}}, {17599, 18, 70710, {1, 1, 3, 15, 17, 11, 19, 25, 483, 29, 1329, 1779, 2885, 6655, 28327, 42255, 87555, 211051}}, {17600, 18, 70719, {1, 3, 5, 11, 29, 19, 43, 141, 157, 87, 1091, 3505, 3139, 11919, 12123, 31581, 116229, 167875}}, {17601, 18, 70721, {1, 3, 1, 5, 25, 55, 113, 219, 491, 607, 1641, 3833, 3153, 1881, 16027, 39923, 38551, 204819}}, {17602, 18, 70722, {1, 1, 5, 3, 7, 9, 73, 181, 305, 211, 1699, 983, 3051, 11643, 12445, 44827, 74613, 199699}}, {17603, 18, 70742, {1, 1, 3, 5, 23, 21, 115, 49, 311, 205, 963, 1357, 4013, 8357, 7065, 47757, 7937, 249935}}, {17604, 18, 70757, {1, 1, 1, 9, 23, 61, 21, 165, 9, 829, 457, 3975, 5831, 10901, 15871, 36769, 45899, 162083}}, {17605, 18, 70764, {1, 1, 3, 3, 25, 41, 91, 45, 37, 939, 299, 3815, 6433, 3121, 10585, 62125, 51333, 171615}}, {17606, 18, 70781, {1, 1, 5, 11, 1, 1, 39, 45, 141, 803, 1493, 1151, 6243, 8683, 30223, 53661, 7949, 197291}}, {17607, 18, 70795, {1, 1, 3, 1, 17, 35, 29, 253, 395, 933, 1015, 3431, 139, 9095, 30745, 39747, 58837, 28517}}, {17608, 18, 70803, {1, 1, 5, 3, 21, 17, 105, 21, 249, 387, 1985, 951, 6323, 8221, 24601, 57367, 18751, 240661}}, {17609, 18, 70809, {1, 1, 7, 9, 5, 21, 23, 149, 243, 501, 935, 855, 1821, 15885, 2239, 39091, 93615, 31411}}, {17610, 18, 70821, {1, 1, 1, 3, 23, 11, 43, 5, 65, 193, 1723, 3253, 7533, 12987, 571, 56073, 125061, 97117}}, {17611, 18, 70846, {1, 1, 1, 13, 13, 21, 113, 79, 115, 867, 777, 2199, 501, 2913, 18697, 14959, 18369, 41631}}, {17612, 18, 70882, {1, 1, 7, 13, 13, 53, 101, 165, 447, 995, 587, 201, 1701, 6429, 8647, 59265, 27321, 110841}}, {17613, 18, 70887, {1, 3, 1, 3, 25, 35, 67, 95, 173, 877, 1133, 3027, 2321, 12517, 4313, 24469, 40313, 253095}}, {17614, 18, 70940, {1, 1, 1, 9, 17, 33, 103, 141, 259, 963, 1975, 2979, 5017, 15689, 30659, 55145, 73737, 43539}}, {17615, 18, 70961, {1, 3, 1, 15, 7, 7, 7, 1, 267, 415, 1591, 17, 2451, 13415, 6993, 16631, 90019, 237161}}, {17616, 18, 70996, {1, 1, 7, 11, 11, 37, 107, 143, 263, 49, 1391, 3269, 6139, 1413, 26557, 16369, 86789, 89151}}, {17617, 18, 71012, {1, 1, 7, 13, 27, 41, 3, 169, 453, 547, 157, 3219, 4711, 9805, 10657, 8121, 40229, 247825}}, {17618, 18, 71046, {1, 3, 3, 3, 25, 25, 109, 253, 67, 901, 259, 1159, 6161, 6763, 19669, 42775, 74089, 69821}}, {17619, 18, 71057, {1, 3, 7, 15, 11, 25, 91, 137, 247, 851, 511, 1847, 1179, 411, 9545, 31275, 46201, 169677}}, {17620, 18, 71060, {1, 1, 5, 3, 3, 61, 19, 167, 491, 765, 1997, 3267, 883, 15439, 27581, 24865, 128245, 130055}}, {17621, 18, 71063, {1, 1, 3, 9, 17, 61, 7, 109, 325, 347, 1109, 889, 2995, 4763, 21551, 60137, 91833, 126989}}, {17622, 18, 71079, {1, 3, 3, 7, 5, 17, 61, 107, 209, 577, 885, 2611, 1471, 7549, 16199, 12319, 48865, 242229}}, {17623, 18, 71080, {1, 3, 5, 1, 5, 49, 85, 177, 213, 583, 857, 179, 1805, 4297, 5835, 61923, 22741, 261983}}, {17624, 18, 71111, {1, 3, 1, 13, 1, 1, 83, 227, 457, 375, 567, 1563, 2085, 8153, 12563, 44561, 115487, 188351}}, {17625, 18, 71118, {1, 3, 1, 9, 15, 39, 127, 135, 181, 967, 1495, 3187, 7463, 9651, 26261, 57435, 42069, 48549}}, {17626, 18, 71129, {1, 3, 1, 7, 5, 31, 111, 19, 19, 855, 273, 2089, 6001, 2799, 26013, 6625, 75623, 150185}}, {17627, 18, 71136, {1, 1, 7, 1, 31, 19, 15, 159, 35, 791, 1005, 3947, 7031, 41, 28807, 45299, 37761, 101191}}, {17628, 18, 71142, {1, 3, 5, 3, 15, 7, 7, 67, 329, 367, 843, 2309, 3023, 5369, 21561, 18881, 14395, 193369}}, {17629, 18, 71145, {1, 3, 3, 11, 21, 53, 3, 251, 87, 131, 563, 847, 8049, 1639, 30103, 30461, 108427, 125197}}, {17630, 18, 71151, {1, 1, 1, 5, 21, 45, 79, 229, 29, 133, 1873, 261, 4221, 3091, 25569, 11219, 70693, 227025}}, {17631, 18, 71163, {1, 3, 1, 5, 17, 9, 75, 101, 155, 311, 789, 821, 7361, 3791, 18511, 57607, 97647, 42107}}, {17632, 18, 71218, {1, 3, 1, 11, 21, 39, 33, 179, 7, 775, 55, 3779, 6163, 3575, 27535, 32363, 9169, 57133}}, {17633, 18, 71223, {1, 3, 7, 3, 19, 33, 19, 11, 173, 175, 219, 3585, 1115, 15693, 23481, 45669, 94149, 19531}}, {17634, 18, 71232, {1, 1, 5, 11, 11, 49, 29, 217, 229, 757, 1031, 3833, 4235, 13535, 8765, 20707, 52851, 9037}}, {17635, 18, 71237, {1, 3, 1, 13, 25, 61, 65, 111, 95, 533, 1235, 2947, 3239, 9513, 11395, 9321, 117535, 228289}}, {17636, 18, 71272, {1, 1, 1, 3, 19, 33, 13, 233, 331, 811, 1931, 1109, 7705, 3129, 19757, 44325, 97903, 165311}}, {17637, 18, 71323, {1, 1, 3, 15, 13, 55, 57, 81, 257, 613, 1305, 653, 6059, 4935, 15707, 4717, 1859, 109265}}, {17638, 18, 71339, {1, 1, 7, 15, 15, 19, 19, 91, 213, 311, 1651, 2215, 6985, 2989, 11961, 28647, 111163, 217187}}, {17639, 18, 71341, {1, 3, 3, 5, 15, 31, 45, 193, 119, 11, 511, 3155, 5989, 813, 32655, 41531, 121007, 24733}}, {17640, 18, 71349, {1, 3, 7, 1, 19, 63, 61, 11, 225, 677, 1323, 1655, 7607, 15691, 27083, 56743, 116167, 250413}}, {17641, 18, 71368, {1, 1, 1, 15, 7, 25, 27, 213, 171, 1011, 1483, 119, 6849, 12527, 20601, 35701, 68377, 245669}}, {17642, 18, 71379, {1, 3, 7, 5, 27, 5, 7, 117, 127, 871, 631, 3395, 1501, 4839, 1857, 45769, 107597, 90385}}, {17643, 18, 71395, {1, 1, 3, 13, 1, 15, 49, 69, 479, 919, 881, 3069, 5609, 12795, 30225, 14411, 122847, 75569}}, {17644, 18, 71407, {1, 1, 5, 9, 1, 15, 91, 207, 235, 667, 321, 2047, 841, 16049, 12499, 8799, 8245, 42199}}, {17645, 18, 71421, {1, 3, 7, 15, 11, 19, 99, 163, 331, 953, 791, 3443, 3215, 8025, 1999, 43685, 72595, 153185}}, {17646, 18, 71430, {1, 3, 1, 13, 25, 23, 17, 133, 59, 233, 151, 1971, 3611, 3951, 16979, 991, 73325, 158475}}, {17647, 18, 71436, {1, 3, 5, 11, 1, 53, 123, 81, 285, 457, 1183, 489, 939, 3069, 15845, 24799, 81301, 105187}}, {17648, 18, 71454, {1, 3, 5, 1, 11, 5, 61, 151, 5, 813, 1347, 1107, 4915, 4035, 18709, 20909, 60569, 55007}}, {17649, 18, 71467, {1, 3, 3, 7, 27, 41, 79, 193, 471, 415, 937, 2561, 1669, 9213, 21145, 44917, 64763, 33195}}, {17650, 18, 71472, {1, 3, 7, 13, 31, 5, 71, 237, 419, 957, 1741, 2829, 5879, 8143, 8717, 48995, 114465, 110295}}, {17651, 18, 71478, {1, 1, 7, 3, 7, 23, 83, 161, 381, 313, 383, 2813, 333, 4647, 18321, 10437, 111645, 55509}}, {17652, 18, 71481, {1, 1, 5, 9, 23, 1, 83, 121, 245, 37, 1097, 1437, 3891, 2727, 30775, 27649, 95571, 216245}}, {17653, 18, 71501, {1, 1, 5, 7, 1, 43, 59, 253, 329, 421, 791, 3945, 2599, 2243, 11121, 37761, 27223, 176867}}, {17654, 18, 71519, {1, 3, 5, 5, 25, 59, 85, 155, 367, 291, 1025, 1415, 7871, 14191, 23249, 32233, 93253, 177869}}, {17655, 18, 71530, {1, 1, 1, 9, 21, 41, 111, 241, 177, 999, 779, 2827, 1683, 6405, 16133, 26523, 102567, 190313}}, {17656, 18, 71550, {1, 3, 3, 15, 13, 59, 69, 239, 231, 511, 1675, 147, 4041, 3723, 29191, 24913, 15601, 198141}}, {17657, 18, 71573, {1, 3, 3, 9, 17, 29, 1, 107, 243, 509, 1949, 205, 1693, 6339, 31591, 61527, 128043, 222497}}, {17658, 18, 71593, {1, 3, 7, 3, 21, 7, 87, 57, 9, 209, 1831, 2189, 5523, 8509, 23687, 46221, 87469, 146815}}, {17659, 18, 71608, {1, 3, 7, 9, 5, 45, 51, 207, 401, 681, 469, 1951, 793, 16379, 32143, 55457, 91787, 178569}}, {17660, 18, 71619, {1, 3, 3, 9, 19, 15, 121, 143, 243, 795, 1839, 2411, 7175, 11535, 31995, 4157, 20111, 92653}}, {17661, 18, 71622, {1, 3, 1, 1, 1, 5, 47, 107, 455, 429, 1411, 2375, 2823, 14657, 16297, 21893, 115257, 50343}}, {17662, 18, 71636, {1, 3, 5, 9, 19, 63, 55, 197, 281, 797, 1539, 2601, 4497, 1631, 26583, 23819, 104553, 27285}}, {17663, 18, 71650, {1, 1, 3, 9, 23, 41, 123, 37, 327, 789, 1711, 1299, 6735, 7243, 30635, 21251, 56081, 65623}}, {17664, 18, 71655, {1, 3, 7, 15, 25, 49, 89, 231, 133, 1003, 351, 765, 7115, 16239, 1141, 44063, 31519, 233719}}, {17665, 18, 71685, {1, 3, 7, 3, 13, 37, 93, 83, 59, 539, 1185, 525, 705, 993, 1113, 1871, 60817, 254075}}, {17666, 18, 71703, {1, 3, 7, 11, 25, 33, 23, 21, 141, 451, 25, 1321, 5139, 8947, 10305, 30175, 43123, 113049}}, {17667, 18, 71714, {1, 3, 5, 5, 17, 1, 125, 211, 143, 637, 1175, 1149, 6775, 11091, 12503, 5537, 35379, 30045}}, {17668, 18, 71748, {1, 1, 1, 15, 17, 31, 123, 33, 279, 831, 1247, 2305, 1033, 3201, 231, 23173, 34453, 66617}}, {17669, 18, 71758, {1, 3, 3, 1, 3, 1, 23, 115, 421, 553, 273, 4091, 5965, 7521, 18393, 31229, 78533, 243921}}, {17670, 18, 71766, {1, 1, 7, 15, 15, 29, 73, 165, 391, 215, 1801, 45, 7451, 6969, 27897, 36599, 103647, 145165}}, {17671, 18, 71772, {1, 3, 3, 13, 5, 7, 67, 81, 477, 301, 1397, 921, 3777, 12431, 14753, 50555, 24497, 52995}}, {17672, 18, 71785, {1, 1, 5, 5, 27, 21, 91, 155, 405, 347, 1135, 3701, 2471, 577, 3927, 52605, 1725, 25803}}, {17673, 18, 71794, {1, 3, 1, 3, 15, 57, 117, 175, 437, 13, 1821, 649, 899, 1295, 2753, 2183, 47923, 163407}}, {17674, 18, 71796, {1, 3, 5, 9, 23, 15, 103, 179, 233, 787, 715, 3751, 3321, 2069, 8299, 43417, 96549, 180737}}, {17675, 18, 71803, {1, 3, 7, 9, 1, 41, 81, 205, 141, 707, 397, 763, 4797, 8843, 3311, 37425, 43873, 131491}}, {17676, 18, 71809, {1, 1, 5, 3, 9, 29, 123, 163, 15, 871, 159, 2615, 6987, 471, 25653, 11295, 94481, 195409}}, {17677, 18, 71858, {1, 3, 7, 3, 13, 7, 9, 59, 59, 381, 2027, 2639, 59, 7977, 14505, 34327, 99113, 157439}}, {17678, 18, 71863, {1, 1, 5, 9, 27, 13, 87, 85, 443, 531, 1069, 3479, 6547, 13943, 13711, 11007, 37395, 190293}}, {17679, 18, 71878, {1, 3, 7, 9, 19, 47, 95, 229, 395, 979, 359, 1799, 7389, 14377, 19371, 56785, 6699, 215433}}, {17680, 18, 71895, {1, 1, 1, 5, 21, 15, 59, 17, 281, 585, 293, 3029, 2539, 16089, 19, 34757, 115811, 235565}}, {17681, 18, 71899, {1, 1, 7, 11, 27, 19, 55, 217, 475, 119, 1291, 1761, 6879, 4355, 30019, 17573, 14987, 204623}}, {17682, 18, 71906, {1, 1, 7, 11, 29, 47, 5, 201, 165, 845, 385, 2903, 7735, 10855, 14171, 17881, 45001, 100725}}, {17683, 18, 71908, {1, 1, 5, 5, 31, 57, 99, 35, 315, 363, 1135, 897, 1041, 729, 26987, 15299, 29563, 67293}}, {17684, 18, 71917, {1, 1, 5, 7, 27, 13, 99, 81, 491, 887, 1309, 3343, 7241, 1289, 12021, 52533, 101799, 238721}}, {17685, 18, 71952, {1, 1, 1, 11, 27, 49, 79, 235, 49, 215, 2003, 2771, 5943, 1183, 31931, 33885, 56971, 52665}}, {17686, 18, 71957, {1, 1, 1, 13, 13, 1, 123, 1, 191, 747, 859, 2287, 5113, 3715, 2217, 61483, 195, 237163}}, {17687, 18, 71961, {1, 3, 7, 15, 13, 13, 17, 207, 141, 821, 231, 1373, 5355, 6503, 2403, 18183, 83717, 170047}}, {17688, 18, 71973, {1, 3, 1, 3, 13, 11, 41, 51, 443, 201, 1349, 2331, 1009, 16169, 5247, 50315, 15589, 150497}}, {17689, 18, 71980, {1, 3, 5, 13, 29, 21, 93, 55, 27, 17, 1615, 3473, 3641, 10999, 31955, 4699, 23585, 141243}}, {17690, 18, 71997, {1, 3, 3, 11, 11, 27, 125, 139, 53, 637, 241, 2651, 4999, 5923, 16203, 13645, 95965, 94459}}, {17691, 18, 72017, {1, 3, 7, 3, 9, 53, 87, 171, 489, 691, 303, 3599, 6093, 841, 3527, 12953, 22907, 69823}}, {17692, 18, 72060, {1, 1, 5, 13, 31, 11, 33, 207, 437, 683, 703, 1757, 1443, 14269, 12677, 20877, 46791, 176135}}, {17693, 18, 72091, {1, 1, 7, 1, 13, 53, 123, 199, 173, 585, 1099, 3653, 2253, 13741, 15675, 38755, 74545, 139053}}, {17694, 18, 72097, {1, 3, 3, 3, 17, 11, 1, 161, 383, 409, 605, 889, 827, 263, 9677, 42857, 127691, 99621}}, {17695, 18, 72166, {1, 3, 5, 9, 21, 21, 11, 151, 199, 695, 493, 569, 881, 10533, 11255, 61997, 124921, 211139}}, {17696, 18, 72172, {1, 3, 5, 5, 9, 47, 109, 7, 195, 287, 97, 3691, 6929, 6985, 3063, 16185, 6313, 228147}}, {17697, 18, 72183, {1, 3, 1, 3, 3, 9, 107, 243, 391, 893, 1207, 2229, 5295, 723, 14753, 10921, 104147, 214941}}, {17698, 18, 72203, {1, 3, 1, 9, 5, 63, 63, 247, 413, 805, 285, 4001, 6735, 3531, 25949, 44845, 66959, 194429}}, {17699, 18, 72205, {1, 1, 3, 1, 15, 15, 43, 69, 419, 739, 1739, 1091, 1043, 3217, 1139, 44749, 74131, 165145}}, {17700, 18, 72213, {1, 1, 3, 9, 17, 53, 119, 25, 427, 791, 1873, 481, 6793, 4767, 30449, 18079, 52105, 260371}}, {17701, 18, 72214, {1, 1, 3, 15, 15, 41, 15, 53, 395, 571, 1727, 3081, 4531, 4215, 22359, 18165, 91843, 157273}}, {17702, 18, 72230, {1, 3, 3, 9, 19, 15, 55, 185, 321, 285, 695, 1067, 2551, 1401, 20023, 22671, 21365, 89053}}, {17703, 18, 72239, {1, 1, 7, 15, 23, 57, 71, 141, 57, 479, 543, 3783, 3635, 14011, 23603, 40877, 21837, 81079}}, {17704, 18, 72248, {1, 3, 7, 11, 31, 5, 83, 177, 105, 981, 331, 2901, 1781, 8407, 30199, 19287, 116219, 78471}}, {17705, 18, 72251, {1, 1, 1, 9, 7, 13, 61, 21, 299, 15, 1045, 475, 7141, 4827, 5921, 17323, 42909, 203623}}, {17706, 18, 72280, {1, 3, 7, 1, 17, 59, 99, 221, 77, 37, 1263, 2137, 1567, 12473, 20029, 9231, 32739, 17021}}, {17707, 18, 72313, {1, 1, 1, 5, 23, 61, 39, 13, 97, 191, 1479, 19, 1913, 3185, 32393, 59067, 5483, 158895}}, {17708, 18, 72338, {1, 1, 1, 7, 5, 51, 81, 223, 435, 939, 781, 1153, 6409, 6369, 30559, 19007, 50121, 26525}}, {17709, 18, 72340, {1, 3, 3, 5, 29, 1, 57, 127, 153, 897, 161, 683, 295, 11207, 245, 1819, 3061, 242609}}, {17710, 18, 72343, {1, 1, 1, 7, 5, 19, 105, 57, 263, 433, 1339, 1479, 6671, 9917, 26299, 4573, 68725, 195}}, {17711, 18, 72368, {1, 3, 5, 15, 1, 19, 45, 95, 155, 117, 367, 2051, 1053, 8847, 6399, 23641, 95355, 98415}}, {17712, 18, 72371, {1, 3, 3, 15, 3, 1, 5, 115, 349, 747, 1865, 1669, 659, 7097, 7871, 3685, 11013, 59837}}, {17713, 18, 72426, {1, 3, 3, 5, 9, 47, 51, 131, 327, 903, 975, 2481, 3509, 12481, 4049, 38053, 4629, 254415}}, {17714, 18, 72439, {1, 3, 5, 9, 31, 47, 1, 29, 37, 683, 1363, 2527, 4019, 4965, 14077, 14191, 101, 1945}}, {17715, 18, 72446, {1, 1, 7, 1, 9, 35, 41, 187, 509, 33, 385, 3907, 1461, 6827, 6931, 44723, 109495, 184641}}, {17716, 18, 72494, {1, 3, 5, 9, 5, 49, 21, 171, 353, 927, 409, 913, 5199, 11747, 8777, 19891, 63189, 118839}}, {17717, 18, 72519, {1, 3, 3, 1, 27, 49, 43, 157, 75, 469, 787, 3957, 4147, 13919, 17489, 57103, 62091, 135589}}, {17718, 18, 72573, {1, 1, 3, 11, 7, 45, 29, 177, 185, 185, 1537, 127, 121, 817, 31269, 1677, 20245, 3835}}, {17719, 18, 72577, {1, 1, 5, 3, 21, 9, 67, 79, 391, 971, 1711, 2607, 5705, 12863, 12415, 41255, 26447, 1643}}, {17720, 18, 72578, {1, 1, 5, 5, 9, 63, 67, 245, 31, 225, 309, 1753, 1507, 817, 4275, 51843, 22331, 196875}}, {17721, 18, 72614, {1, 3, 1, 13, 15, 39, 3, 245, 147, 485, 241, 2507, 1859, 7299, 15037, 41139, 82757, 224031}}, {17722, 18, 72628, {1, 3, 3, 15, 7, 51, 9, 103, 37, 643, 25, 2067, 7619, 11991, 12885, 46809, 109107, 22393}}, {17723, 18, 72640, {1, 1, 1, 9, 1, 55, 119, 85, 115, 827, 187, 2241, 2553, 577, 12115, 2391, 69705, 232101}}, {17724, 18, 72676, {1, 1, 5, 7, 13, 61, 125, 129, 475, 703, 1723, 3233, 5713, 1941, 21375, 42119, 75199, 73163}}, {17725, 18, 72708, {1, 1, 5, 5, 5, 21, 73, 155, 493, 81, 1627, 827, 5925, 7391, 1587, 39425, 11807, 64385}}, {17726, 18, 72717, {1, 3, 1, 15, 27, 35, 111, 183, 283, 335, 1387, 669, 6041, 11637, 26255, 21113, 121183, 219703}}, {17727, 18, 72766, {1, 3, 5, 15, 15, 23, 119, 91, 197, 809, 975, 3275, 6171, 11769, 8385, 5461, 4561, 29159}}, {17728, 18, 72786, {1, 1, 5, 9, 29, 9, 107, 233, 417, 1005, 799, 1437, 2679, 15643, 32341, 54055, 27861, 115483}}, {17729, 18, 72788, {1, 1, 5, 7, 27, 19, 95, 153, 175, 407, 215, 303, 8165, 14791, 2099, 61797, 129411, 10461}}, {17730, 18, 72795, {1, 1, 1, 13, 25, 51, 11, 77, 97, 495, 971, 449, 2833, 7121, 24105, 34527, 123135, 129305}}, {17731, 18, 72797, {1, 1, 7, 11, 23, 9, 111, 101, 169, 233, 267, 953, 6379, 15887, 22921, 33665, 95195, 159707}}, {17732, 18, 72798, {1, 1, 5, 15, 21, 3, 21, 57, 173, 513, 2027, 1235, 5031, 5375, 2717, 23361, 71817, 232101}}, {17733, 18, 72808, {1, 3, 3, 11, 7, 25, 43, 65, 19, 135, 1611, 85, 7673, 6459, 27813, 55557, 100989, 25205}}, {17734, 18, 72826, {1, 3, 7, 1, 15, 37, 55, 141, 239, 205, 647, 3715, 1617, 13507, 9847, 64681, 108711, 231329}}, {17735, 18, 72835, {1, 3, 5, 9, 21, 27, 79, 153, 335, 299, 493, 887, 1457, 16011, 13795, 50205, 43319, 130963}}, {17736, 18, 72837, {1, 1, 3, 1, 23, 59, 121, 83, 463, 151, 323, 2977, 4769, 6011, 20135, 59541, 23179, 203487}}, {17737, 18, 72865, {1, 1, 5, 7, 9, 17, 63, 149, 59, 281, 763, 619, 2551, 8179, 2963, 61283, 107727, 119817}}, {17738, 18, 72871, {1, 3, 7, 3, 15, 39, 11, 145, 141, 965, 505, 2625, 4335, 7619, 11007, 43321, 33199, 212661}}, {17739, 18, 72872, {1, 3, 5, 9, 9, 61, 27, 223, 5, 941, 513, 1437, 481, 9651, 6567, 57945, 52547, 21283}}, {17740, 18, 72898, {1, 3, 1, 1, 25, 1, 87, 25, 121, 757, 529, 3857, 1321, 13479, 5357, 49341, 5797, 235895}}, {17741, 18, 72907, {1, 3, 5, 1, 21, 35, 37, 215, 509, 165, 1423, 3067, 4779, 4693, 12523, 48099, 69283, 255111}}, {17742, 18, 72909, {1, 1, 3, 1, 31, 15, 45, 127, 339, 331, 1249, 1075, 6169, 2941, 30471, 46789, 118039, 224651}}, {17743, 18, 72917, {1, 1, 5, 13, 21, 37, 39, 61, 191, 17, 177, 3719, 2177, 11039, 20047, 14489, 20475, 171235}}, {17744, 18, 72934, {1, 1, 3, 9, 19, 11, 65, 111, 121, 901, 99, 1861, 3687, 765, 24861, 46315, 63433, 171679}}, {17745, 18, 72987, {1, 3, 1, 7, 1, 51, 87, 199, 241, 909, 353, 2471, 7163, 9547, 16351, 41129, 12217, 194099}}, {17746, 18, 73000, {1, 1, 7, 7, 17, 17, 127, 67, 51, 217, 1189, 19, 2099, 10281, 9071, 21185, 122821, 110211}}, {17747, 18, 73005, {1, 3, 3, 7, 15, 3, 53, 45, 77, 665, 701, 3175, 6151, 2639, 19819, 1063, 25079, 203343}}, {17748, 18, 73014, {1, 1, 5, 11, 11, 5, 103, 11, 481, 999, 713, 499, 5069, 921, 20619, 25623, 69601, 82941}}, {17749, 18, 73023, {1, 3, 5, 9, 15, 61, 67, 79, 371, 993, 475, 617, 1611, 12513, 14907, 55313, 39207, 112653}}, {17750, 18, 73025, {1, 1, 5, 15, 17, 45, 91, 187, 175, 465, 907, 3371, 3743, 15657, 30511, 58191, 105683, 216759}}, {17751, 18, 73074, {1, 1, 5, 9, 23, 1, 17, 79, 73, 717, 1785, 677, 7377, 4511, 21927, 34341, 47119, 193977}}, {17752, 18, 73076, {1, 3, 7, 13, 21, 1, 59, 179, 121, 641, 175, 563, 961, 10549, 15779, 49875, 8109, 1039}}, {17753, 18, 73113, {1, 1, 5, 7, 17, 9, 37, 171, 335, 135, 1403, 2541, 3845, 15311, 1905, 40853, 11013, 255669}}, {17754, 18, 73116, {1, 1, 7, 1, 5, 23, 113, 111, 337, 755, 2037, 3067, 2821, 10549, 28467, 22615, 71585, 61871}}, {17755, 18, 73140, {1, 1, 3, 9, 7, 3, 49, 229, 111, 871, 1711, 1793, 3089, 12571, 30883, 44773, 80827, 151709}}, {17756, 18, 73149, {1, 1, 5, 1, 13, 41, 3, 253, 399, 881, 1107, 4081, 1849, 115, 31557, 2515, 126751, 195663}}, {17757, 18, 73186, {1, 1, 3, 1, 13, 31, 113, 85, 57, 549, 1653, 2927, 5433, 11879, 22709, 41675, 13395, 46931}}, {17758, 18, 73188, {1, 1, 3, 9, 21, 1, 109, 65, 377, 63, 861, 1031, 2709, 7265, 9861, 64109, 34577, 9743}}, {17759, 18, 73191, {1, 1, 7, 7, 17, 31, 5, 177, 253, 387, 1271, 2805, 2211, 1813, 11649, 3217, 123793, 197753}}, {17760, 18, 73205, {1, 1, 3, 9, 15, 63, 89, 59, 455, 783, 1181, 7, 2309, 15961, 11231, 37389, 101221, 119331}}, {17761, 18, 73215, {1, 3, 3, 13, 7, 3, 15, 251, 431, 951, 639, 1585, 1247, 15927, 9695, 37469, 34945, 219723}}, {17762, 18, 73216, {1, 1, 5, 3, 21, 29, 83, 151, 383, 227, 215, 2329, 1297, 13709, 15653, 3119, 111319, 222877}}, {17763, 18, 73239, {1, 3, 1, 13, 1, 43, 127, 125, 243, 955, 583, 3497, 6605, 3821, 4657, 10599, 90927, 82725}}, {17764, 18, 73294, {1, 1, 1, 1, 15, 51, 61, 167, 489, 603, 873, 907, 575, 6957, 24409, 63587, 50205, 159291}}, {17765, 18, 73311, {1, 3, 3, 1, 19, 23, 7, 23, 239, 961, 1001, 1541, 2211, 4637, 19931, 39153, 102769, 242005}}, {17766, 18, 73330, {1, 1, 1, 15, 19, 31, 73, 121, 119, 199, 979, 4061, 3903, 12055, 27957, 15999, 5709, 210329}}, {17767, 18, 73366, {1, 1, 7, 13, 25, 35, 21, 25, 241, 937, 13, 947, 943, 3727, 15321, 46665, 99437, 233919}}, {17768, 18, 73379, {1, 1, 1, 9, 3, 51, 127, 113, 105, 335, 685, 2173, 4329, 7569, 5617, 32407, 21649, 30609}}, {17769, 18, 73386, {1, 3, 7, 9, 9, 13, 69, 191, 95, 727, 1649, 1201, 2093, 10053, 29381, 6207, 70755, 118505}}, {17770, 18, 73391, {1, 1, 1, 11, 21, 57, 77, 139, 271, 21, 1747, 2337, 7761, 7753, 6847, 5219, 87033, 229105}}, {17771, 18, 73418, {1, 3, 3, 1, 5, 51, 15, 235, 87, 567, 391, 3039, 2253, 11177, 11899, 25305, 14815, 51051}}, {17772, 18, 73438, {1, 3, 5, 7, 27, 51, 69, 93, 261, 947, 31, 2751, 6685, 3655, 24125, 22161, 108421, 230865}}, {17773, 18, 73476, {1, 1, 3, 3, 27, 17, 35, 97, 285, 855, 1767, 2545, 825, 11519, 11231, 50951, 32883, 78573}}, {17774, 18, 73503, {1, 3, 7, 13, 1, 57, 99, 193, 371, 839, 1319, 2295, 5897, 7893, 14339, 64217, 16951, 234953}}, {17775, 18, 73509, {1, 3, 1, 3, 11, 37, 13, 21, 299, 379, 63, 1209, 7879, 5001, 10181, 40173, 1753, 104821}}, {17776, 18, 73534, {1, 3, 5, 9, 23, 51, 75, 103, 249, 533, 621, 15, 1883, 2109, 20859, 4635, 120615, 135515}}, {17777, 18, 73545, {1, 1, 3, 3, 21, 45, 113, 57, 495, 457, 685, 3625, 243, 14831, 12351, 63001, 118191, 153875}}, {17778, 18, 73548, {1, 3, 5, 5, 21, 15, 65, 251, 183, 241, 1513, 2711, 4527, 12675, 26747, 5181, 4237, 246479}}, {17779, 18, 73563, {1, 1, 5, 3, 27, 29, 91, 93, 345, 893, 195, 3109, 2611, 12657, 10401, 15063, 95807, 244587}}, {17780, 18, 73575, {1, 3, 5, 13, 19, 49, 85, 155, 159, 939, 1139, 1569, 1129, 8641, 18391, 55201, 108491, 77863}}, {17781, 18, 73582, {1, 3, 5, 9, 25, 53, 75, 77, 85, 903, 1399, 2379, 2219, 14725, 21877, 24271, 40955, 61849}}, {17782, 18, 73603, {1, 1, 5, 9, 13, 49, 53, 177, 163, 331, 533, 1469, 1397, 8187, 12379, 10185, 125541, 260271}}, {17783, 18, 73609, {1, 1, 7, 9, 19, 31, 81, 89, 281, 397, 1917, 145, 2723, 15019, 18841, 13887, 11859, 171749}}, {17784, 18, 73610, {1, 3, 7, 13, 25, 17, 87, 189, 29, 283, 913, 3855, 5707, 15881, 12787, 42357, 84579, 78531}}, {17785, 18, 73645, {1, 1, 5, 15, 15, 31, 37, 249, 445, 119, 431, 4069, 5699, 10119, 31661, 9555, 6869, 1145}}, {17786, 18, 73646, {1, 3, 7, 1, 31, 29, 57, 177, 341, 411, 1019, 1889, 383, 1461, 26695, 61777, 18367, 137233}}, {17787, 18, 73678, {1, 3, 5, 1, 7, 53, 29, 53, 387, 675, 435, 461, 6247, 7519, 14003, 9037, 116599, 54471}}, {17788, 18, 73685, {1, 3, 3, 7, 17, 59, 91, 77, 169, 591, 95, 113, 6135, 10479, 17153, 52953, 16183, 90775}}, {17789, 18, 73708, {1, 3, 3, 15, 11, 11, 117, 141, 493, 163, 65, 1305, 7477, 7383, 22651, 64271, 80983, 154845}}, {17790, 18, 73747, {1, 1, 1, 3, 9, 15, 83, 11, 113, 77, 1115, 1417, 511, 6825, 21013, 37241, 104695, 31335}}, {17791, 18, 73765, {1, 1, 7, 3, 13, 33, 115, 121, 245, 673, 1991, 2157, 479, 9843, 5963, 4637, 8925, 27751}}, {17792, 18, 73797, {1, 3, 3, 7, 19, 11, 67, 125, 339, 27, 1545, 2319, 5977, 11603, 23219, 48273, 119265, 20151}}, {17793, 18, 73810, {1, 1, 5, 7, 27, 29, 31, 227, 279, 405, 1133, 689, 1133, 8957, 29629, 48849, 109995, 259749}}, {17794, 18, 73819, {1, 3, 5, 7, 7, 61, 95, 243, 91, 741, 1591, 3169, 2287, 11015, 15601, 43043, 65319, 50671}}, {17795, 18, 73825, {1, 1, 5, 5, 13, 47, 31, 95, 425, 715, 1603, 3485, 673, 12869, 32561, 42329, 112809, 181971}}, {17796, 18, 73845, {1, 3, 3, 3, 17, 51, 109, 45, 397, 457, 1379, 3845, 4215, 14185, 16597, 27711, 74283, 98151}}, {17797, 18, 73855, {1, 1, 1, 15, 7, 25, 13, 49, 441, 513, 1769, 707, 6037, 9689, 18915, 35647, 110823, 196633}}, {17798, 18, 73866, {1, 1, 1, 1, 23, 53, 93, 61, 277, 125, 55, 2453, 3331, 14037, 10809, 33205, 43785, 248743}}, {17799, 18, 73890, {1, 1, 3, 7, 23, 15, 93, 77, 333, 801, 1969, 31, 51, 5239, 24241, 5077, 113503, 132211}}, {17800, 18, 73919, {1, 3, 3, 1, 7, 55, 53, 5, 311, 657, 1507, 3413, 565, 15745, 6129, 40285, 91811, 90527}}, {17801, 18, 73922, {1, 3, 3, 13, 19, 23, 45, 25, 509, 313, 915, 2199, 5549, 8469, 32735, 37877, 11607, 37993}}, {17802, 18, 73936, {1, 1, 5, 11, 25, 33, 55, 31, 311, 851, 159, 2103, 2641, 8957, 9375, 37179, 33667, 100513}}, {17803, 18, 73939, {1, 3, 1, 1, 7, 7, 17, 75, 217, 171, 359, 1169, 4105, 929, 6427, 56349, 77985, 41941}}, {17804, 18, 73964, {1, 1, 1, 15, 5, 51, 73, 63, 259, 351, 1797, 1001, 5025, 11203, 30221, 54345, 11331, 158415}}, {17805, 18, 73976, {1, 3, 1, 5, 3, 21, 13, 3, 63, 779, 871, 2517, 6345, 4103, 16321, 30211, 120815, 83751}}, {17806, 18, 73984, {1, 1, 3, 13, 11, 7, 41, 255, 215, 37, 279, 2485, 6511, 12855, 22857, 55695, 122717, 238151}}, {17807, 18, 73990, {1, 3, 3, 3, 1, 55, 27, 193, 509, 677, 1861, 573, 5341, 5285, 6909, 51781, 91203, 139791}}, {17808, 18, 74013, {1, 3, 7, 11, 5, 63, 87, 215, 305, 235, 1049, 1339, 5301, 9639, 29861, 58415, 68303, 76907}}, {17809, 18, 74014, {1, 1, 5, 11, 13, 13, 67, 139, 19, 577, 165, 3067, 8023, 10905, 3159, 41289, 118231, 119673}}, {17810, 18, 74020, {1, 1, 3, 1, 15, 5, 69, 119, 363, 703, 461, 2293, 3801, 14217, 10709, 9553, 100651, 186115}}, {17811, 18, 74035, {1, 3, 7, 15, 19, 21, 59, 237, 227, 193, 827, 619, 3447, 13815, 3467, 38911, 41403, 99627}}, {17812, 18, 74038, {1, 1, 3, 3, 27, 23, 41, 199, 161, 555, 1629, 3187, 1355, 5947, 1157, 25877, 110989, 231285}}, {17813, 18, 74069, {1, 1, 3, 15, 3, 43, 103, 29, 179, 223, 375, 2877, 1917, 9367, 15337, 15381, 62833, 139003}}, {17814, 18, 74119, {1, 3, 3, 11, 23, 33, 107, 189, 511, 209, 1519, 2809, 6185, 5921, 20939, 63879, 113687, 79149}}, {17815, 18, 74123, {1, 3, 5, 15, 1, 63, 101, 227, 419, 803, 59, 2261, 6905, 10679, 5393, 54447, 58521, 59855}}, {17816, 18, 74126, {1, 1, 7, 13, 13, 21, 121, 123, 181, 371, 1485, 3191, 2627, 6197, 11169, 44927, 34739, 10687}}, {17817, 18, 74153, {1, 1, 3, 3, 25, 47, 13, 115, 187, 967, 1439, 1021, 4413, 3343, 31463, 3729, 13511, 162125}}, {17818, 18, 74179, {1, 3, 3, 15, 15, 59, 29, 129, 469, 171, 2045, 2859, 1097, 11199, 12147, 37465, 14179, 197923}}, {17819, 18, 74200, {1, 1, 7, 5, 13, 35, 41, 167, 207, 123, 1077, 3145, 2803, 15729, 767, 7321, 84375, 190855}}, {17820, 18, 74210, {1, 3, 5, 11, 3, 5, 65, 3, 111, 725, 143, 2945, 4755, 3407, 31801, 15329, 70311, 119197}}, {17821, 18, 74216, {1, 1, 5, 3, 17, 19, 61, 73, 261, 663, 821, 3389, 3883, 9961, 17727, 33113, 98371, 247097}}, {17822, 18, 74250, {1, 3, 1, 9, 29, 17, 43, 43, 481, 1015, 1249, 607, 3495, 13259, 29001, 23083, 51487, 81723}}, {17823, 18, 74263, {1, 3, 1, 3, 25, 57, 5, 33, 313, 21, 1731, 3417, 7033, 6609, 31631, 63231, 61107, 10941}}, {17824, 18, 74264, {1, 3, 3, 11, 29, 29, 117, 131, 417, 789, 1545, 1677, 3213, 13869, 5319, 41387, 13895, 252387}}, {17825, 18, 74279, {1, 3, 3, 13, 25, 47, 55, 213, 83, 345, 1453, 159, 1521, 14777, 24177, 7631, 81259, 135411}}, {17826, 18, 74285, {1, 1, 3, 15, 11, 63, 49, 69, 273, 843, 1661, 1157, 1285, 12751, 5, 54909, 114375, 6395}}, {17827, 18, 74294, {1, 3, 1, 11, 25, 1, 83, 55, 161, 125, 1547, 401, 7639, 4289, 7075, 9971, 33825, 135071}}, {17828, 18, 74298, {1, 3, 7, 9, 17, 5, 79, 131, 373, 1023, 573, 2219, 1789, 5789, 5347, 26455, 58661, 206417}}, {17829, 18, 74303, {1, 1, 7, 5, 1, 43, 83, 107, 125, 289, 793, 1731, 5167, 8943, 28397, 26877, 53781, 95899}}, {17830, 18, 74306, {1, 3, 3, 13, 21, 53, 123, 103, 385, 753, 1917, 2075, 4385, 5757, 9221, 35797, 86743, 69069}}, {17831, 18, 74366, {1, 3, 3, 3, 5, 19, 119, 221, 457, 907, 359, 3493, 2331, 5685, 11133, 29293, 27051, 213927}}, {17832, 18, 74369, {1, 1, 3, 11, 11, 31, 29, 129, 429, 601, 1217, 3653, 5935, 14823, 21161, 33423, 98391, 214703}}, {17833, 18, 74403, {1, 1, 3, 15, 31, 49, 109, 139, 349, 13, 205, 2483, 8083, 8391, 4789, 30355, 12165, 195263}}, {17834, 18, 74406, {1, 1, 1, 9, 19, 63, 15, 167, 45, 185, 811, 529, 6811, 13441, 27195, 59047, 106675, 167125}}, {17835, 18, 74442, {1, 1, 7, 1, 19, 19, 39, 1, 349, 467, 551, 4081, 4743, 11627, 607, 22005, 60893, 49101}}, {17836, 18, 74450, {1, 3, 7, 9, 9, 25, 105, 119, 113, 825, 1429, 2019, 5209, 8491, 6017, 47783, 88455, 119083}}, {17837, 18, 74452, {1, 3, 3, 13, 21, 39, 107, 119, 321, 251, 563, 311, 4441, 6491, 3157, 65479, 107349, 211621}}, {17838, 18, 74459, {1, 1, 7, 13, 9, 3, 17, 117, 327, 459, 489, 7, 6883, 10047, 31935, 28069, 37903, 188281}}, {17839, 18, 74461, {1, 1, 7, 1, 15, 53, 47, 127, 483, 595, 811, 1143, 4543, 10043, 30349, 24409, 91947, 240165}}, {17840, 18, 74477, {1, 1, 1, 13, 25, 43, 109, 161, 147, 1009, 1071, 1533, 2781, 13439, 20507, 41387, 26943, 84675}}, {17841, 18, 74478, {1, 3, 5, 13, 19, 21, 23, 167, 135, 257, 587, 2691, 5877, 3047, 11745, 24895, 114799, 48003}}, {17842, 18, 74489, {1, 3, 1, 1, 9, 57, 33, 51, 137, 109, 137, 195, 1233, 11139, 16833, 27545, 35877, 126627}}, {17843, 18, 74504, {1, 1, 1, 15, 5, 37, 7, 19, 363, 411, 1193, 767, 6209, 9115, 14699, 55515, 46023, 90693}}, {17844, 18, 74528, {1, 3, 5, 3, 19, 55, 85, 117, 391, 757, 861, 3537, 6507, 6993, 19589, 6843, 33557, 64683}}, {17845, 18, 74533, {1, 1, 7, 5, 5, 61, 99, 9, 311, 595, 807, 429, 63, 12359, 28289, 709, 129911, 143745}}, {17846, 18, 74538, {1, 1, 1, 7, 17, 9, 9, 117, 19, 985, 657, 2803, 2699, 829, 31069, 13277, 106769, 109231}}, {17847, 18, 74551, {1, 1, 5, 13, 25, 19, 63, 217, 419, 221, 1921, 215, 2631, 4659, 29855, 46549, 62257, 260113}}, {17848, 18, 74580, {1, 3, 3, 9, 13, 45, 63, 129, 147, 489, 879, 3025, 6777, 1119, 20963, 30553, 20863, 169837}}, {17849, 18, 74589, {1, 3, 5, 9, 25, 61, 79, 51, 495, 583, 1519, 1501, 123, 13871, 32239, 957, 31921, 255561}}, {17850, 18, 74590, {1, 3, 7, 3, 31, 61, 89, 65, 305, 429, 785, 3871, 7711, 2745, 24131, 43055, 51167, 87743}}, {17851, 18, 74593, {1, 3, 1, 11, 19, 23, 89, 117, 185, 121, 109, 1327, 6553, 14367, 16069, 28657, 81751, 10185}}, {17852, 18, 74608, {1, 3, 5, 5, 17, 33, 115, 61, 101, 367, 1465, 3899, 6601, 4483, 2447, 49575, 129987, 11703}}, {17853, 18, 74611, {1, 1, 3, 13, 13, 59, 79, 83, 253, 171, 53, 2467, 5005, 1045, 943, 62419, 98563, 78935}}, {17854, 18, 74617, {1, 1, 7, 15, 31, 17, 77, 73, 249, 247, 119, 1655, 7079, 14593, 105, 55767, 130401, 74189}}, {17855, 18, 74623, {1, 3, 5, 11, 19, 29, 79, 251, 75, 949, 527, 2779, 5839, 11451, 24125, 45991, 127437, 86541}}, {17856, 18, 74648, {1, 1, 5, 7, 1, 29, 127, 27, 477, 807, 829, 1569, 205, 13319, 16149, 26003, 38985, 188587}}, {17857, 18, 74704, {1, 1, 1, 3, 19, 29, 39, 71, 17, 51, 1169, 467, 7505, 1867, 4469, 32161, 43031, 31675}}, {17858, 18, 74735, {1, 1, 1, 15, 27, 45, 67, 107, 127, 469, 1955, 1933, 2379, 8513, 32071, 35043, 126537, 23303}}, {17859, 18, 74737, {1, 3, 7, 9, 23, 41, 23, 197, 97, 213, 17, 1751, 5467, 6179, 29291, 33397, 42131, 151093}}, {17860, 18, 74738, {1, 3, 7, 15, 27, 3, 39, 87, 365, 77, 487, 293, 6405, 2239, 30455, 44723, 12399, 100013}}, {17861, 18, 74779, {1, 3, 5, 9, 29, 21, 55, 183, 343, 263, 1643, 2027, 2255, 6259, 18277, 64661, 39391, 255839}}, {17862, 18, 74781, {1, 1, 7, 11, 21, 55, 11, 139, 261, 11, 1721, 3779, 85, 8203, 12089, 50579, 128341, 119043}}, {17863, 18, 74809, {1, 3, 5, 13, 27, 53, 109, 1, 313, 661, 431, 1543, 1571, 7337, 18857, 49951, 7881, 228161}}, {17864, 18, 74812, {1, 1, 7, 5, 5, 31, 27, 149, 239, 199, 1011, 1979, 5297, 14609, 26971, 65531, 64215, 115109}}, {17865, 18, 74827, {1, 1, 5, 13, 15, 11, 63, 225, 165, 405, 1367, 2291, 5171, 12419, 19561, 37719, 621, 137607}}, {17866, 18, 74868, {1, 3, 1, 15, 25, 1, 125, 243, 97, 455, 1977, 3333, 801, 1343, 993, 18453, 19285, 71547}}, {17867, 18, 74871, {1, 1, 5, 11, 9, 51, 109, 135, 73, 147, 649, 4071, 7425, 3093, 26417, 51139, 1523, 142225}}, {17868, 18, 74905, {1, 3, 7, 11, 1, 39, 109, 119, 337, 715, 1087, 4005, 1393, 6397, 31135, 38935, 106255, 60723}}, {17869, 18, 74930, {1, 1, 1, 9, 9, 11, 45, 11, 171, 671, 965, 109, 2261, 13775, 8539, 63669, 10507, 249113}}, {17870, 18, 74962, {1, 3, 1, 15, 21, 33, 127, 173, 419, 31, 299, 857, 4915, 11331, 29385, 47375, 111891, 14505}}, {17871, 18, 74990, {1, 3, 5, 13, 7, 43, 85, 183, 377, 275, 803, 1755, 8005, 15327, 31043, 18851, 122581, 229731}}, {17872, 18, 74995, {1, 3, 5, 1, 27, 9, 41, 73, 283, 475, 671, 747, 1419, 15209, 25465, 60061, 91417, 103203}}, {17873, 18, 75007, {1, 3, 1, 15, 15, 43, 13, 45, 217, 519, 363, 3265, 6213, 13045, 3709, 22119, 79733, 224195}}, {17874, 18, 75012, {1, 3, 1, 15, 15, 59, 95, 71, 171, 769, 1395, 2673, 4523, 749, 13411, 60431, 124651, 11475}}, {17875, 18, 75030, {1, 1, 7, 3, 1, 35, 13, 239, 101, 355, 1201, 3665, 5403, 11413, 11983, 52469, 63621, 155819}}, {17876, 18, 75033, {1, 1, 1, 7, 31, 59, 87, 25, 511, 483, 569, 3337, 4027, 8347, 3031, 24351, 57963, 79425}}, {17877, 18, 75039, {1, 3, 1, 3, 11, 17, 29, 249, 61, 923, 585, 2107, 2727, 8589, 22809, 3, 17937, 163267}}, {17878, 18, 75055, {1, 3, 5, 11, 27, 3, 73, 187, 19, 975, 257, 2361, 935, 9071, 29991, 13619, 92169, 101031}}, {17879, 18, 75078, {1, 1, 5, 13, 17, 53, 105, 157, 343, 673, 237, 3231, 7311, 1593, 18521, 57889, 79805, 97847}}, {17880, 18, 75120, {1, 3, 1, 3, 31, 55, 63, 167, 489, 167, 121, 3333, 2475, 1545, 13291, 921, 101757, 62147}}, {17881, 18, 75130, {1, 3, 3, 15, 13, 17, 9, 209, 339, 567, 2011, 1737, 1455, 9289, 6105, 49733, 74237, 93195}}, {17882, 18, 75159, {1, 1, 7, 11, 3, 13, 77, 115, 305, 327, 1005, 3381, 4269, 4835, 27221, 16301, 75173, 244603}}, {17883, 18, 75163, {1, 3, 5, 7, 7, 31, 47, 75, 499, 41, 281, 167, 3525, 8649, 23623, 4987, 2057, 204083}}, {17884, 18, 75170, {1, 3, 3, 5, 9, 5, 35, 53, 269, 437, 1035, 1675, 4567, 13291, 19787, 28937, 108915, 62545}}, {17885, 18, 75193, {1, 3, 1, 5, 15, 59, 57, 181, 321, 1, 791, 2149, 591, 6691, 8759, 62861, 10815, 257331}}, {17886, 18, 75228, {1, 1, 7, 1, 21, 25, 93, 39, 429, 455, 669, 1725, 7087, 11805, 22405, 13083, 88411, 225967}}, {17887, 18, 75244, {1, 1, 5, 15, 5, 45, 15, 1, 55, 281, 2027, 97, 2639, 57, 23717, 21669, 92181, 32731}}, {17888, 18, 75249, {1, 3, 7, 3, 7, 3, 67, 201, 445, 577, 1011, 793, 7763, 10823, 30309, 41565, 37263, 218909}}, {17889, 18, 75328, {1, 1, 7, 3, 17, 53, 51, 119, 399, 903, 1785, 1053, 4315, 2967, 17579, 64185, 55005, 12969}}, {17890, 18, 75357, {1, 3, 3, 13, 21, 63, 13, 1, 427, 39, 71, 1811, 1237, 1623, 11401, 14371, 44355, 93089}}, {17891, 18, 75373, {1, 1, 5, 1, 17, 39, 39, 105, 187, 691, 251, 3957, 931, 12149, 18299, 48819, 23061, 49179}}, {17892, 18, 75392, {1, 1, 5, 11, 31, 3, 23, 211, 101, 763, 237, 3635, 417, 4935, 14997, 3859, 22343, 153541}}, {17893, 18, 75428, {1, 3, 7, 5, 21, 37, 59, 137, 13, 179, 527, 895, 3451, 1743, 3149, 10665, 119427, 259343}}, {17894, 18, 75438, {1, 3, 5, 3, 7, 37, 103, 173, 453, 327, 131, 2453, 7795, 12585, 13947, 59161, 41845, 29527}}, {17895, 18, 75469, {1, 3, 3, 1, 17, 49, 57, 251, 295, 279, 1545, 3963, 589, 9211, 32371, 14963, 116927, 197321}}, {17896, 18, 75487, {1, 1, 3, 7, 17, 59, 37, 115, 315, 591, 481, 767, 4611, 14741, 6949, 19507, 6567, 143371}}, {17897, 18, 75494, {1, 1, 5, 3, 19, 53, 121, 229, 355, 909, 339, 1645, 2747, 7045, 9085, 5799, 50997, 17981}}, {17898, 18, 75515, {1, 3, 3, 9, 3, 1, 109, 7, 15, 177, 789, 3911, 6427, 8453, 22583, 12039, 124587, 123887}}, {17899, 18, 75526, {1, 1, 5, 1, 7, 23, 15, 193, 109, 685, 1147, 3921, 2329, 15153, 25045, 28389, 34759, 256611}}, {17900, 18, 75532, {1, 1, 3, 3, 23, 27, 55, 43, 485, 541, 1617, 3761, 1051, 7525, 19941, 52699, 35421, 162939}}, {17901, 18, 75543, {1, 3, 7, 1, 25, 9, 113, 251, 477, 1005, 9, 3321, 5817, 965, 18523, 29407, 53353, 205575}}, {17902, 18, 75549, {1, 1, 7, 11, 9, 31, 111, 175, 227, 33, 1745, 1141, 1547, 2113, 8785, 40273, 100301, 190749}}, {17903, 18, 75559, {1, 1, 5, 11, 19, 49, 45, 197, 457, 223, 91, 2769, 6331, 1161, 6609, 61905, 42257, 152117}}, {17904, 18, 75563, {1, 1, 7, 11, 1, 17, 37, 153, 431, 933, 269, 1529, 1297, 15567, 149, 41701, 59867, 93631}}, {17905, 18, 75568, {1, 1, 5, 9, 25, 33, 83, 127, 305, 667, 343, 185, 3527, 13079, 10567, 35753, 72191, 214091}}, {17906, 18, 75598, {1, 3, 7, 1, 1, 7, 75, 241, 185, 81, 2043, 3081, 3563, 385, 3055, 59421, 27081, 32521}}, {17907, 18, 75612, {1, 1, 3, 5, 31, 1, 101, 21, 69, 979, 917, 695, 5601, 12251, 15031, 18715, 116985, 53071}}, {17908, 18, 75622, {1, 1, 3, 9, 23, 57, 91, 127, 327, 979, 721, 3855, 1131, 997, 32227, 33843, 128299, 15239}}, {17909, 18, 75640, {1, 3, 7, 13, 23, 1, 87, 105, 259, 939, 1935, 1983, 6619, 1611, 31901, 14745, 96641, 211945}}, {17910, 18, 75683, {1, 1, 3, 5, 25, 17, 39, 95, 137, 971, 377, 2493, 981, 329, 25845, 44513, 100561, 57985}}, {17911, 18, 75689, {1, 1, 3, 9, 27, 37, 69, 103, 167, 131, 487, 2935, 7099, 15375, 4825, 12209, 117165, 84909}}, {17912, 18, 75690, {1, 3, 1, 15, 27, 19, 115, 239, 247, 243, 83, 1535, 8095, 3953, 25721, 62983, 89045, 16783}}, {17913, 18, 75692, {1, 1, 5, 1, 19, 13, 125, 39, 439, 411, 171, 155, 5117, 15137, 19851, 251, 37921, 97209}}, {17914, 18, 75752, {1, 1, 1, 5, 13, 41, 17, 97, 215, 323, 1333, 775, 1155, 15269, 19943, 48489, 71741, 202501}}, {17915, 18, 75766, {1, 3, 5, 3, 1, 31, 55, 125, 69, 437, 1649, 2791, 8027, 15509, 31575, 8491, 106953, 155215}}, {17916, 18, 75769, {1, 3, 3, 13, 19, 45, 39, 63, 227, 67, 2021, 1243, 6525, 7211, 6275, 39719, 74513, 6713}}, {17917, 18, 75791, {1, 1, 5, 11, 13, 45, 15, 101, 171, 613, 1561, 2939, 3849, 2917, 29765, 2027, 53617, 59939}}, {17918, 18, 75794, {1, 1, 5, 9, 27, 21, 119, 19, 441, 759, 703, 2985, 3007, 2087, 5207, 64403, 20273, 66181}}, {17919, 18, 75806, {1, 1, 7, 13, 21, 3, 49, 3, 485, 883, 1863, 1925, 877, 10009, 24191, 58639, 107755, 106539}}, {17920, 18, 75809, {1, 1, 1, 5, 27, 37, 23, 185, 281, 533, 437, 555, 8151, 6489, 22343, 4573, 91577, 167919}}, {17921, 18, 75819, {1, 1, 7, 15, 3, 61, 103, 221, 223, 703, 133, 2923, 1027, 14643, 26413, 16523, 107223, 97185}}, {17922, 18, 75834, {1, 3, 1, 11, 13, 15, 1, 203, 363, 675, 511, 3225, 1163, 741, 16063, 8097, 95905, 148465}}, {17923, 18, 75895, {1, 3, 1, 7, 11, 11, 11, 243, 371, 129, 209, 3533, 1279, 12181, 31973, 29165, 122089, 115117}}, {17924, 18, 75908, {1, 3, 1, 5, 25, 17, 31, 45, 215, 809, 1443, 3245, 1005, 2903, 20783, 23041, 96577, 192063}}, {17925, 18, 75951, {1, 3, 3, 3, 19, 17, 101, 219, 91, 805, 189, 761, 4771, 11629, 7285, 21631, 21691, 47421}}, {17926, 18, 75960, {1, 3, 7, 1, 31, 11, 71, 149, 303, 793, 35, 3109, 2769, 11593, 31839, 2053, 4541, 202997}}, {17927, 18, 75965, {1, 1, 1, 3, 11, 19, 113, 249, 141, 659, 1117, 2145, 2617, 1075, 25347, 12913, 27457, 222095}}, {17928, 18, 75974, {1, 3, 1, 3, 5, 23, 41, 57, 193, 815, 1293, 1109, 7597, 999, 10773, 41065, 18555, 35617}}, {17929, 18, 75978, {1, 1, 3, 1, 31, 11, 127, 99, 163, 293, 299, 3415, 3761, 8781, 5327, 47631, 56411, 242787}}, {17930, 18, 75998, {1, 3, 7, 13, 3, 41, 23, 169, 419, 725, 1419, 2643, 5265, 77, 24077, 18639, 78665, 205303}}, {17931, 18, 76001, {1, 1, 5, 1, 31, 39, 39, 205, 413, 393, 1713, 309, 707, 4153, 10461, 16053, 26963, 253993}}, {17932, 18, 76007, {1, 3, 7, 5, 23, 37, 125, 87, 199, 631, 1935, 551, 7047, 4585, 21257, 42345, 39365, 249393}}, {17933, 18, 76016, {1, 3, 5, 13, 17, 55, 29, 209, 151, 465, 155, 363, 3097, 4093, 9869, 23297, 33973, 115543}}, {17934, 18, 76091, {1, 1, 1, 13, 23, 59, 83, 71, 145, 717, 127, 1299, 1701, 10885, 5343, 40793, 87819, 66621}}, {17935, 18, 76119, {1, 3, 3, 9, 19, 37, 23, 11, 269, 603, 871, 851, 837, 15303, 7595, 56481, 57819, 185065}}, {17936, 18, 76135, {1, 3, 1, 1, 3, 15, 11, 249, 413, 723, 1403, 3233, 2747, 10335, 7127, 63285, 29237, 191953}}, {17937, 18, 76170, {1, 3, 1, 1, 11, 31, 67, 139, 51, 413, 521, 969, 171, 5943, 31613, 16477, 85771, 202139}}, {17938, 18, 76189, {1, 3, 7, 5, 5, 21, 109, 25, 463, 873, 493, 2673, 6409, 11199, 17195, 40623, 76821, 72509}}, {17939, 18, 76214, {1, 1, 7, 7, 11, 1, 95, 43, 243, 67, 1289, 3219, 2255, 4957, 17561, 40499, 48537, 108809}}, {17940, 18, 76225, {1, 1, 7, 15, 3, 39, 45, 75, 43, 821, 533, 4043, 1503, 83, 26937, 56327, 114149, 156845}}, {17941, 18, 76235, {1, 3, 1, 1, 31, 21, 59, 1, 77, 147, 137, 1827, 4123, 2791, 27859, 57921, 40569, 134753}}, {17942, 18, 76259, {1, 1, 5, 13, 31, 41, 111, 11, 181, 963, 459, 2771, 6123, 4035, 1627, 2047, 109537, 33653}}, {17943, 18, 76261, {1, 3, 5, 7, 31, 57, 17, 21, 5, 761, 1833, 1279, 1239, 10089, 22531, 32547, 82699, 28389}}, {17944, 18, 76262, {1, 3, 5, 13, 11, 39, 11, 61, 299, 753, 1067, 1347, 5189, 12859, 681, 46309, 31873, 90333}}, {17945, 18, 76266, {1, 3, 1, 5, 13, 27, 119, 205, 377, 457, 817, 3017, 279, 1859, 30241, 52089, 61445, 176203}}, {17946, 18, 76286, {1, 1, 3, 5, 11, 35, 17, 163, 27, 1001, 417, 2899, 1959, 5513, 1441, 19743, 67147, 236591}}, {17947, 18, 76289, {1, 3, 5, 13, 15, 39, 53, 179, 447, 675, 933, 1261, 4415, 9845, 28459, 33497, 107375, 156855}}, {17948, 18, 76310, {1, 3, 3, 13, 27, 31, 11, 191, 413, 1011, 2035, 3965, 2071, 5429, 16247, 7439, 15079, 225041}}, {17949, 18, 76319, {1, 3, 3, 11, 7, 23, 87, 215, 241, 687, 1351, 2399, 4677, 12967, 22957, 10443, 116701, 155477}}, {17950, 18, 76364, {1, 3, 7, 5, 25, 55, 5, 197, 359, 879, 619, 1969, 1513, 12743, 10953, 28343, 63685, 39115}}, {17951, 18, 76375, {1, 1, 3, 1, 19, 15, 63, 7, 305, 343, 1333, 3845, 377, 14031, 28383, 4271, 60063, 11827}}, {17952, 18, 76392, {1, 3, 5, 15, 25, 21, 115, 101, 171, 735, 787, 3143, 593, 8793, 4121, 15471, 53491, 20617}}, {17953, 18, 76422, {1, 1, 5, 15, 15, 51, 103, 17, 433, 611, 1351, 1729, 6147, 11623, 3, 6319, 6133, 19029}}, {17954, 18, 76450, {1, 3, 1, 13, 29, 15, 115, 97, 505, 985, 745, 745, 1459, 7193, 1247, 58901, 114255, 212849}}, {17955, 18, 76496, {1, 1, 7, 1, 1, 53, 99, 35, 377, 723, 1751, 2625, 5113, 13295, 20133, 26831, 41657, 51717}}, {17956, 18, 76521, {1, 3, 5, 15, 15, 39, 17, 227, 351, 435, 49, 203, 6959, 11673, 15755, 29733, 51445, 64619}}, {17957, 18, 76522, {1, 1, 1, 3, 25, 51, 57, 137, 415, 49, 355, 2149, 7607, 10781, 30363, 43889, 55543, 36637}}, {17958, 18, 76527, {1, 1, 7, 5, 5, 15, 73, 189, 153, 949, 527, 587, 513, 12891, 16765, 41477, 75569, 80747}}, {17959, 18, 76536, {1, 1, 5, 5, 9, 5, 3, 225, 115, 125, 821, 3551, 4833, 927, 24331, 63669, 26549, 220159}}, {17960, 18, 76541, {1, 1, 3, 9, 21, 7, 9, 183, 391, 783, 493, 2785, 3879, 8311, 9935, 60629, 119329, 5791}}, {17961, 18, 76553, {1, 1, 5, 15, 15, 41, 61, 97, 33, 29, 199, 3335, 1531, 6107, 757, 33797, 3001, 224507}}, {17962, 18, 76568, {1, 1, 3, 9, 13, 39, 25, 247, 407, 1, 1129, 1453, 7091, 5557, 8657, 33961, 100763, 25099}}, {17963, 18, 76574, {1, 3, 3, 13, 31, 21, 69, 73, 431, 827, 861, 235, 2369, 4283, 27183, 29095, 99957, 97577}}, {17964, 18, 76584, {1, 1, 7, 13, 1, 25, 21, 173, 365, 921, 21, 3527, 2481, 8795, 25621, 41755, 127249, 221385}}, {17965, 18, 76604, {1, 1, 1, 5, 25, 25, 65, 203, 305, 373, 527, 4033, 3483, 9403, 28669, 32083, 52273, 77037}}, {17966, 18, 76607, {1, 3, 1, 15, 9, 23, 19, 7, 29, 83, 1163, 1147, 5315, 2381, 21203, 33915, 109511, 40669}}, {17967, 18, 76609, {1, 3, 7, 15, 23, 19, 69, 127, 113, 937, 935, 1067, 2431, 7677, 21327, 44095, 82799, 5715}}, {17968, 18, 76669, {1, 1, 5, 5, 7, 37, 107, 223, 433, 515, 393, 1721, 1977, 6383, 18835, 54841, 103263, 196997}}, {17969, 18, 76683, {1, 1, 1, 3, 1, 11, 85, 173, 259, 685, 595, 1635, 6979, 4483, 8097, 42249, 56259, 105925}}, {17970, 18, 76745, {1, 1, 7, 7, 1, 23, 11, 253, 187, 665, 313, 3745, 2423, 15835, 32085, 48643, 75625, 47511}}, {17971, 18, 76753, {1, 1, 3, 5, 1, 59, 127, 83, 501, 387, 977, 3515, 7921, 12329, 14757, 20287, 49699, 91237}}, {17972, 18, 76754, {1, 3, 5, 11, 31, 45, 51, 109, 319, 621, 1013, 3519, 4023, 12099, 28829, 26691, 83131, 261497}}, {17973, 18, 76756, {1, 1, 3, 3, 5, 35, 51, 253, 253, 569, 1017, 2299, 8159, 13783, 22123, 55213, 111527, 110699}}, {17974, 18, 76760, {1, 3, 7, 3, 9, 5, 59, 129, 41, 845, 723, 1607, 3047, 14323, 19277, 39447, 12465, 45925}}, {17975, 18, 76782, {1, 1, 3, 1, 17, 35, 51, 79, 115, 361, 739, 2037, 6167, 14699, 28187, 65271, 67285, 48489}}, {17976, 18, 76821, {1, 3, 1, 11, 1, 29, 95, 181, 419, 235, 745, 621, 3889, 2933, 743, 23801, 32057, 54103}}, {17977, 18, 76828, {1, 3, 1, 11, 17, 47, 43, 55, 7, 695, 1653, 3983, 961, 3037, 8669, 10039, 86571, 6981}}, {17978, 18, 76849, {1, 1, 5, 15, 13, 19, 67, 141, 291, 511, 1913, 397, 7423, 6541, 21845, 49821, 126047, 218587}}, {17979, 18, 76850, {1, 1, 5, 3, 11, 13, 103, 213, 189, 115, 1495, 2695, 2127, 11979, 13609, 46615, 64775, 206417}}, {17980, 18, 76870, {1, 3, 1, 5, 5, 9, 57, 207, 253, 251, 1155, 1319, 6699, 6613, 21757, 49703, 124879, 89987}}, {17981, 18, 76874, {1, 3, 5, 7, 23, 25, 35, 81, 165, 789, 771, 415, 5557, 8431, 12043, 44359, 9447, 229481}}, {17982, 18, 76898, {1, 1, 1, 13, 17, 21, 63, 251, 387, 767, 85, 3901, 3227, 10329, 5049, 56173, 58065, 78595}}, {17983, 18, 76903, {1, 3, 1, 15, 23, 5, 45, 7, 123, 389, 1041, 1223, 5865, 5365, 2915, 24861, 106893, 170769}}, {17984, 18, 76910, {1, 3, 7, 15, 27, 61, 27, 59, 309, 103, 279, 1829, 1501, 11277, 4461, 34817, 60973, 99805}}, {17985, 18, 76921, {1, 1, 3, 9, 1, 25, 57, 85, 411, 699, 911, 1643, 2687, 13539, 10187, 21597, 18883, 212975}}, {17986, 18, 76968, {1, 1, 3, 7, 5, 7, 81, 209, 225, 321, 1867, 2189, 6315, 5393, 8859, 47471, 41677, 222455}}, {17987, 18, 77013, {1, 1, 5, 11, 27, 33, 119, 159, 273, 659, 883, 3773, 6519, 15449, 17219, 23923, 33749, 225489}}, {17988, 18, 77027, {1, 1, 7, 13, 29, 39, 1, 161, 165, 531, 1019, 2369, 2093, 4341, 24945, 28537, 49467, 258065}}, {17989, 18, 77042, {1, 3, 3, 3, 15, 59, 23, 143, 377, 943, 1329, 977, 7025, 2167, 17973, 65087, 115757, 75959}}, {17990, 18, 77059, {1, 1, 1, 15, 17, 55, 33, 167, 43, 719, 51, 3873, 3317, 10763, 639, 58195, 20023, 100725}}, {17991, 18, 77062, {1, 1, 7, 5, 17, 23, 71, 249, 23, 929, 467, 3073, 3355, 1343, 18755, 12247, 49737, 184103}}, {17992, 18, 77074, {1, 3, 3, 15, 1, 9, 17, 193, 157, 265, 983, 1825, 4805, 2131, 22117, 32937, 57, 261867}}, {17993, 18, 77076, {1, 3, 5, 9, 5, 1, 101, 141, 511, 489, 73, 1789, 1303, 2633, 709, 11891, 44897, 191229}}, {17994, 18, 77110, {1, 1, 7, 15, 1, 27, 121, 7, 129, 421, 725, 1421, 3883, 13335, 7247, 8393, 85029, 127691}}, {17995, 18, 77113, {1, 1, 3, 9, 19, 53, 121, 115, 85, 909, 1535, 3261, 7063, 16381, 1719, 19847, 19041, 215433}}, {17996, 18, 77131, {1, 1, 7, 3, 17, 45, 91, 187, 181, 829, 609, 931, 5727, 3971, 14567, 15871, 9825, 184165}}, {17997, 18, 77157, {1, 1, 1, 3, 5, 29, 7, 249, 361, 815, 1101, 1485, 6879, 5379, 7179, 27467, 101427, 196089}}, {17998, 18, 77158, {1, 1, 5, 7, 23, 11, 27, 175, 237, 747, 1911, 3107, 961, 6649, 29887, 11003, 27561, 233841}}, {17999, 18, 77216, {1, 1, 1, 5, 11, 5, 125, 227, 303, 315, 1879, 817, 7445, 1447, 9333, 54825, 118865, 216397}}, {18000, 18, 77246, {1, 1, 3, 13, 17, 33, 27, 95, 245, 25, 1741, 2633, 1869, 14111, 24507, 61287, 46397, 220803}}, {18001, 18, 77258, {1, 1, 7, 7, 25, 5, 41, 101, 171, 333, 497, 3417, 4921, 4553, 25487, 51529, 72873, 43525}}, {18002, 18, 77281, {1, 1, 7, 7, 9, 19, 25, 161, 235, 929, 1663, 3237, 323, 3889, 31423, 2345, 63113, 212659}}, {18003, 18, 77284, {1, 1, 5, 13, 29, 59, 39, 25, 393, 519, 429, 1461, 5867, 113, 28091, 36813, 47827, 163407}}, {18004, 18, 77294, {1, 3, 5, 13, 15, 49, 85, 161, 83, 389, 765, 3349, 4659, 11007, 24749, 51121, 93511, 229885}}, {18005, 18, 77302, {1, 3, 5, 11, 5, 27, 107, 233, 221, 425, 941, 1181, 5403, 4373, 32625, 41991, 2019, 245967}}, {18006, 18, 77306, {1, 3, 5, 9, 9, 53, 97, 27, 221, 731, 1301, 3517, 4407, 11369, 4251, 31121, 4813, 42029}}, {18007, 18, 77315, {1, 1, 1, 9, 17, 59, 107, 247, 231, 123, 1177, 3299, 6163, 4855, 14547, 63171, 45201, 27711}}, {18008, 18, 77352, {1, 3, 7, 3, 25, 31, 63, 37, 123, 457, 1531, 3723, 4807, 14665, 17973, 42547, 5417, 170323}}, {18009, 18, 77360, {1, 3, 7, 3, 17, 19, 57, 7, 359, 741, 385, 3127, 855, 10803, 30093, 24501, 53629, 40447}}, {18010, 18, 77365, {1, 3, 7, 15, 11, 45, 49, 125, 445, 795, 113, 2425, 7085, 7337, 16297, 26447, 94369, 12371}}, {18011, 18, 77370, {1, 3, 7, 9, 29, 59, 35, 191, 123, 619, 415, 1081, 2469, 4125, 25587, 7853, 119781, 9447}}, {18012, 18, 77378, {1, 3, 1, 15, 13, 13, 111, 89, 381, 757, 389, 253, 6929, 33, 8263, 17385, 122129, 146679}}, {18013, 18, 77380, {1, 1, 3, 3, 15, 35, 101, 95, 479, 577, 1645, 3781, 7533, 4665, 6561, 49897, 72413, 151383}}, {18014, 18, 77407, {1, 1, 1, 1, 7, 49, 23, 223, 189, 763, 227, 2805, 8093, 389, 11525, 30915, 91341, 210231}}, {18015, 18, 77408, {1, 1, 7, 3, 19, 23, 3, 137, 79, 569, 1833, 2091, 4235, 10739, 22855, 33845, 120141, 220267}}, {18016, 18, 77414, {1, 3, 7, 3, 11, 43, 85, 63, 419, 681, 365, 3017, 3603, 6413, 13515, 16003, 107949, 241261}}, {18017, 18, 77444, {1, 1, 5, 13, 3, 35, 41, 193, 189, 999, 1395, 2431, 2227, 7245, 23929, 16137, 14591, 54999}}, {18018, 18, 77454, {1, 1, 7, 15, 23, 51, 47, 77, 31, 25, 589, 611, 371, 13329, 5873, 2133, 40351, 145293}}, {18019, 18, 77481, {1, 1, 7, 15, 17, 19, 53, 155, 309, 573, 1059, 3557, 2445, 12205, 4497, 32061, 130293, 73859}}, {18020, 18, 77482, {1, 1, 7, 13, 3, 25, 71, 157, 237, 185, 1035, 1759, 1331, 13533, 25635, 811, 54391, 91109}}, {18021, 18, 77531, {1, 1, 1, 11, 5, 21, 99, 31, 259, 413, 2033, 2187, 755, 4591, 28641, 64031, 88499, 160789}}, {18022, 18, 77544, {1, 3, 7, 13, 29, 33, 13, 157, 97, 981, 329, 81, 6351, 4171, 10925, 22733, 72521, 105477}}, {18023, 18, 77552, {1, 3, 7, 9, 11, 31, 97, 35, 337, 309, 847, 3429, 2697, 3141, 19481, 43679, 11129, 205757}}, {18024, 18, 77569, {1, 3, 1, 7, 27, 45, 123, 193, 439, 639, 633, 1375, 7307, 1599, 23379, 56811, 100877, 228687}}, {18025, 18, 77579, {1, 3, 7, 1, 29, 43, 103, 131, 103, 933, 143, 2431, 2221, 4565, 20841, 58611, 49163, 13673}}, {18026, 18, 77610, {1, 3, 5, 13, 25, 17, 121, 17, 455, 941, 1577, 509, 5401, 797, 29573, 38373, 50527, 17951}}, {18027, 18, 77612, {1, 1, 1, 13, 25, 21, 77, 253, 199, 871, 935, 3919, 1687, 6653, 20345, 56969, 77989, 244767}}, {18028, 18, 77623, {1, 1, 3, 1, 17, 5, 5, 191, 279, 33, 579, 651, 969, 6091, 11659, 1643, 17935, 85145}}, {18029, 18, 77649, {1, 3, 3, 9, 29, 1, 103, 39, 83, 295, 1237, 207, 4837, 7899, 27879, 23195, 29549, 206885}}, {18030, 18, 77650, {1, 3, 5, 1, 9, 55, 115, 37, 225, 447, 943, 1133, 6203, 949, 9973, 4309, 43969, 166795}}, {18031, 18, 77661, {1, 1, 7, 7, 17, 43, 75, 251, 35, 489, 1011, 355, 4113, 2377, 13775, 34935, 84905, 252973}}, {18032, 18, 77675, {1, 3, 3, 3, 11, 45, 3, 1, 135, 499, 81, 3265, 6657, 3875, 27565, 60931, 13117, 87931}}, {18033, 18, 77686, {1, 1, 3, 1, 9, 1, 77, 69, 137, 241, 1613, 2607, 3307, 171, 13551, 54529, 45937, 180411}}, {18034, 18, 77742, {1, 1, 1, 1, 19, 29, 77, 255, 95, 461, 567, 1103, 2753, 10627, 19479, 43411, 128565, 29869}}, {18035, 18, 77791, {1, 1, 3, 5, 5, 63, 123, 159, 165, 733, 1107, 1711, 5039, 9221, 15541, 5527, 27629, 206505}}, {18036, 18, 77792, {1, 3, 1, 3, 7, 45, 73, 63, 413, 693, 433, 2281, 3981, 7719, 31473, 56939, 70391, 67467}}, {18037, 18, 77807, {1, 1, 1, 11, 19, 33, 113, 151, 427, 603, 1653, 2451, 5367, 12171, 14373, 33175, 62013, 209273}}, {18038, 18, 77815, {1, 3, 5, 5, 17, 37, 109, 5, 187, 293, 617, 2663, 7381, 14217, 23561, 48999, 108717, 248289}}, {18039, 18, 77842, {1, 1, 5, 1, 9, 27, 35, 127, 355, 479, 281, 2081, 7303, 259, 8893, 59141, 20927, 61611}}, {18040, 18, 77847, {1, 3, 3, 15, 31, 33, 71, 209, 315, 363, 593, 1035, 8029, 12501, 2859, 54745, 39391, 153259}}, {18041, 18, 77899, {1, 3, 3, 11, 21, 39, 35, 173, 171, 15, 987, 3737, 7415, 1827, 973, 6831, 108643, 241333}}, {18042, 18, 77901, {1, 3, 7, 9, 17, 37, 127, 243, 153, 195, 113, 309, 5301, 13619, 7927, 35385, 9501, 99241}}, {18043, 18, 77904, {1, 3, 5, 13, 23, 9, 81, 235, 139, 635, 443, 2235, 2613, 2389, 18431, 8409, 2885, 254811}}, {18044, 18, 77914, {1, 3, 7, 9, 1, 5, 15, 109, 141, 173, 1059, 1961, 7945, 10381, 17337, 19591, 42173, 119831}}, {18045, 18, 77925, {1, 3, 1, 13, 19, 7, 111, 111, 345, 327, 1147, 2293, 49, 16213, 25309, 60537, 50421, 108467}}, {18046, 18, 77950, {1, 1, 5, 1, 3, 23, 63, 219, 69, 879, 1397, 3857, 1859, 1939, 4851, 26549, 86019, 7927}}, {18047, 18, 77959, {1, 3, 1, 13, 23, 61, 25, 31, 301, 189, 1031, 2817, 829, 8777, 26869, 54405, 43535, 234687}}, {18048, 18, 77994, {1, 1, 1, 9, 11, 31, 13, 139, 77, 567, 949, 3415, 6955, 14973, 9565, 37911, 18395, 94167}}, {18049, 18, 78004, {1, 3, 5, 13, 17, 17, 21, 213, 171, 993, 1001, 979, 5085, 3909, 11797, 48669, 73541, 48979}}, {18050, 18, 78043, {1, 1, 7, 9, 7, 37, 35, 107, 347, 239, 585, 2883, 3235, 1053, 14871, 25799, 4861, 56335}}, {18051, 18, 78052, {1, 1, 3, 5, 19, 7, 91, 139, 325, 921, 863, 209, 845, 15943, 8281, 55103, 110193, 216091}}, {18052, 18, 78061, {1, 3, 1, 13, 31, 33, 65, 155, 177, 103, 1991, 343, 6299, 3587, 30215, 64335, 114301, 220403}}, {18053, 18, 78064, {1, 3, 5, 3, 31, 37, 121, 157, 443, 349, 1097, 3683, 503, 14061, 14685, 29755, 61543, 232983}}, {18054, 18, 78084, {1, 3, 3, 11, 17, 59, 29, 161, 381, 791, 1647, 1077, 6369, 1095, 17279, 43141, 65003, 144609}}, {18055, 18, 78094, {1, 1, 5, 1, 1, 15, 67, 77, 3, 585, 1909, 1485, 3003, 591, 4711, 10279, 75901, 226417}}, {18056, 18, 78099, {1, 3, 7, 5, 1, 5, 5, 193, 469, 631, 1065, 607, 2751, 8163, 13633, 40563, 1417, 118169}}, {18057, 18, 78129, {1, 1, 7, 9, 25, 25, 109, 27, 157, 495, 225, 1385, 4315, 995, 10591, 1629, 129939, 56765}}, {18058, 18, 78142, {1, 3, 1, 7, 9, 23, 61, 63, 35, 145, 1537, 1029, 4225, 1467, 10519, 32861, 519, 53983}}, {18059, 18, 78149, {1, 3, 3, 11, 7, 59, 25, 199, 403, 967, 1089, 1121, 1063, 6701, 16827, 55479, 72983, 36873}}, {18060, 18, 78153, {1, 1, 1, 13, 9, 27, 19, 23, 395, 229, 1837, 1231, 1737, 10475, 16743, 42369, 130331, 47255}}, {18061, 18, 78171, {1, 1, 5, 7, 29, 15, 95, 155, 339, 65, 751, 2399, 5615, 2987, 16769, 57381, 113021, 41417}}, {18062, 18, 78173, {1, 3, 1, 9, 15, 17, 1, 111, 197, 7, 417, 3999, 7261, 5939, 16773, 29275, 105559, 84685}}, {18063, 18, 78174, {1, 3, 3, 13, 19, 31, 103, 1, 37, 269, 1257, 1397, 4293, 3019, 6503, 7727, 93943, 237313}}, {18064, 18, 78195, {1, 1, 3, 9, 13, 37, 67, 129, 43, 669, 1331, 1787, 8185, 323, 18749, 13737, 86123, 154131}}, {18065, 18, 78201, {1, 3, 1, 11, 3, 51, 13, 35, 197, 867, 559, 1381, 1057, 13293, 20603, 18633, 50503, 169685}}, {18066, 18, 78202, {1, 3, 1, 11, 9, 35, 7, 51, 499, 885, 353, 4095, 6491, 5917, 15053, 18363, 99593, 213089}}, {18067, 18, 78241, {1, 1, 3, 9, 19, 23, 107, 147, 339, 331, 1349, 2855, 3721, 13317, 26457, 783, 93949, 196051}}, {18068, 18, 78247, {1, 1, 5, 1, 9, 61, 89, 217, 315, 385, 1729, 2641, 5753, 6269, 547, 33737, 20103, 31533}}, {18069, 18, 78274, {1, 3, 5, 13, 13, 61, 3, 191, 57, 683, 1227, 1255, 3651, 10687, 9049, 6529, 60783, 28639}}, {18070, 18, 78276, {1, 1, 7, 11, 25, 41, 79, 19, 383, 363, 1731, 1597, 1651, 15037, 22191, 51883, 41927, 82419}}, {18071, 18, 78303, {1, 3, 5, 9, 15, 61, 39, 149, 49, 633, 709, 1743, 621, 14659, 3309, 64129, 91897, 74235}}, {18072, 18, 78307, {1, 3, 7, 15, 5, 59, 7, 197, 111, 885, 1737, 855, 2807, 3817, 13759, 29989, 45105, 171689}}, {18073, 18, 78328, {1, 1, 3, 9, 21, 25, 55, 67, 483, 437, 303, 703, 6993, 1971, 4565, 56117, 6105, 254517}}, {18074, 18, 78344, {1, 3, 3, 13, 15, 13, 19, 3, 487, 751, 1185, 2985, 1619, 7139, 26087, 21105, 9049, 236153}}, {18075, 18, 78362, {1, 1, 5, 7, 15, 55, 51, 231, 85, 953, 713, 659, 2021, 4271, 15961, 26873, 31141, 76635}}, {18076, 18, 78367, {1, 3, 5, 1, 11, 39, 3, 223, 367, 903, 799, 415, 7247, 9539, 14479, 37195, 59951, 181935}}, {18077, 18, 78368, {1, 1, 5, 3, 13, 47, 17, 159, 439, 859, 1067, 3111, 5277, 13973, 21999, 28381, 115685, 231483}}, {18078, 18, 78409, {1, 1, 7, 15, 17, 21, 69, 131, 193, 479, 1075, 3271, 2057, 1295, 31235, 35027, 94145, 65419}}, {18079, 18, 78412, {1, 3, 3, 5, 5, 21, 5, 81, 113, 259, 837, 831, 5985, 6717, 12041, 40355, 50957, 111185}}, {18080, 18, 78417, {1, 1, 1, 9, 15, 47, 103, 195, 465, 739, 1415, 225, 3121, 12623, 7539, 17555, 36703, 217641}}, {18081, 18, 78430, {1, 3, 1, 3, 31, 17, 91, 153, 221, 217, 525, 981, 281, 9869, 9713, 10669, 12049, 97615}}, {18082, 18, 78433, {1, 1, 5, 7, 29, 1, 1, 199, 415, 843, 301, 941, 4589, 13301, 5833, 41311, 74019, 78537}}, {18083, 18, 78440, {1, 1, 5, 11, 13, 5, 41, 127, 213, 917, 1297, 2281, 3193, 3877, 9517, 40685, 14657, 185139}}, {18084, 18, 78451, {1, 1, 1, 7, 21, 45, 87, 33, 425, 487, 643, 271, 7087, 5979, 14795, 27575, 34541, 173251}}, {18085, 18, 78453, {1, 3, 7, 5, 21, 11, 7, 169, 325, 905, 973, 2853, 7929, 8801, 1005, 60641, 45973, 81859}}, {18086, 18, 78458, {1, 3, 3, 1, 1, 35, 39, 81, 93, 463, 697, 2309, 7769, 5169, 17595, 41447, 28837, 52613}}, {18087, 18, 78467, {1, 1, 7, 1, 1, 23, 37, 17, 137, 873, 1657, 681, 503, 7887, 24463, 32453, 112727, 133347}}, {18088, 18, 78479, {1, 1, 5, 9, 19, 35, 37, 85, 11, 245, 11, 3, 6475, 5953, 247, 49447, 32813, 243841}}, {18089, 18, 78507, {1, 3, 5, 3, 19, 53, 37, 45, 431, 259, 1831, 1443, 2237, 7651, 20701, 22857, 50041, 119667}}, {18090, 18, 78518, {1, 1, 7, 1, 5, 37, 113, 69, 389, 369, 1251, 1989, 7613, 10669, 4233, 33379, 72465, 256861}}, {18091, 18, 78535, {1, 1, 7, 5, 27, 55, 17, 75, 373, 325, 1981, 1743, 7341, 319, 28169, 3587, 66057, 169723}}, {18092, 18, 78542, {1, 3, 3, 15, 27, 31, 47, 91, 367, 245, 2045, 979, 2169, 10935, 29523, 64871, 119447, 92131}}, {18093, 18, 78549, {1, 3, 7, 15, 9, 11, 93, 61, 249, 107, 1883, 2547, 375, 4195, 6451, 14533, 62529, 93557}}, {18094, 18, 78554, {1, 1, 1, 3, 29, 61, 65, 155, 301, 1017, 131, 1567, 3649, 3447, 27943, 52111, 9133, 88147}}, {18095, 18, 78556, {1, 1, 1, 1, 21, 59, 107, 151, 265, 707, 767, 2325, 8095, 14027, 15355, 15465, 83143, 116199}}, {18096, 18, 78583, {1, 3, 1, 15, 23, 51, 31, 25, 439, 357, 1563, 1091, 2135, 1327, 18427, 60965, 29215, 157351}}, {18097, 18, 78590, {1, 3, 3, 13, 29, 37, 25, 215, 149, 487, 703, 1787, 3641, 8301, 8795, 13845, 95245, 169793}}, {18098, 18, 78615, {1, 3, 3, 11, 27, 3, 49, 87, 69, 687, 1181, 3405, 589, 12901, 14199, 48607, 74027, 181379}}, {18099, 18, 78635, {1, 3, 5, 13, 9, 15, 33, 229, 135, 769, 1005, 2435, 4831, 5493, 16745, 64379, 20253, 52661}}, {18100, 18, 78649, {1, 1, 1, 13, 9, 61, 33, 127, 339, 15, 945, 219, 4291, 6995, 29127, 61853, 40741, 170541}}, {18101, 18, 78684, {1, 3, 3, 15, 9, 33, 75, 39, 327, 133, 733, 1125, 2747, 15031, 24575, 65013, 41997, 158679}}, {18102, 18, 78691, {1, 1, 3, 9, 3, 9, 63, 83, 493, 175, 249, 1977, 8177, 4067, 2131, 12467, 86185, 73417}}, {18103, 18, 78705, {1, 1, 3, 13, 29, 55, 91, 109, 73, 913, 1343, 2147, 105, 8763, 7613, 55749, 4339, 61253}}, {18104, 18, 78724, {1, 1, 5, 5, 17, 19, 45, 57, 345, 835, 341, 1365, 5187, 7485, 22685, 32321, 67279, 141119}}, {18105, 18, 78755, {1, 1, 3, 11, 9, 47, 11, 231, 241, 681, 255, 3663, 5547, 997, 2445, 64413, 55349, 61785}}, {18106, 18, 78770, {1, 3, 5, 5, 23, 29, 23, 249, 149, 1011, 173, 271, 485, 1239, 81, 59277, 96669, 210859}}, {18107, 18, 78772, {1, 3, 3, 1, 17, 9, 41, 39, 309, 131, 1431, 1497, 1669, 14191, 22795, 48951, 101731, 70847}}, {18108, 18, 78818, {1, 1, 3, 15, 1, 11, 37, 79, 23, 1023, 585, 127, 7817, 15009, 3897, 44601, 83039, 240457}}, {18109, 18, 78837, {1, 3, 5, 9, 21, 33, 55, 31, 193, 745, 1741, 3637, 7265, 8969, 11797, 33239, 29123, 126077}}, {18110, 18, 78844, {1, 3, 3, 13, 31, 5, 87, 215, 271, 573, 1423, 2611, 947, 14669, 23785, 60579, 127099, 55877}}, {18111, 18, 78849, {1, 3, 1, 13, 5, 53, 103, 85, 237, 457, 739, 1201, 133, 8589, 13471, 6707, 42257, 141989}}, {18112, 18, 78909, {1, 1, 1, 5, 23, 3, 65, 159, 445, 823, 341, 1723, 6263, 9421, 16023, 19145, 52337, 229397}}, {18113, 18, 78915, {1, 3, 5, 3, 15, 3, 15, 251, 407, 137, 951, 1319, 1035, 7713, 29579, 19591, 77841, 84949}}, {18114, 18, 78941, {1, 1, 7, 15, 19, 25, 63, 141, 511, 11, 1027, 1209, 6627, 8127, 14879, 12965, 109973, 144501}}, {18115, 18, 78958, {1, 1, 1, 3, 11, 57, 65, 169, 453, 197, 1249, 2933, 3743, 1971, 19373, 32109, 73265, 46185}}, {18116, 18, 78975, {1, 1, 3, 1, 3, 1, 21, 47, 471, 565, 1795, 1771, 3187, 7189, 18627, 22993, 112319, 158693}}, {18117, 18, 78979, {1, 1, 5, 7, 5, 25, 127, 113, 31, 609, 1273, 2799, 5713, 16091, 22239, 43617, 126003, 218991}}, {18118, 18, 78986, {1, 3, 3, 7, 19, 59, 19, 185, 483, 431, 335, 565, 819, 2555, 18653, 36573, 50085, 31007}}, {18119, 18, 79029, {1, 1, 3, 13, 17, 61, 5, 219, 297, 755, 2005, 391, 4927, 1517, 11341, 9527, 51739, 182599}}, {18120, 18, 79030, {1, 3, 7, 9, 9, 3, 39, 211, 475, 717, 189, 819, 529, 469, 28559, 7321, 60213, 79505}}, {18121, 18, 79044, {1, 3, 1, 9, 17, 39, 53, 65, 247, 145, 9, 1669, 7221, 8359, 11021, 29775, 24693, 208655}}, {18122, 18, 79048, {1, 1, 5, 13, 7, 7, 31, 135, 375, 439, 1419, 3579, 4313, 14057, 31505, 55249, 5345, 69537}}, {18123, 18, 79056, {1, 3, 5, 9, 21, 3, 125, 223, 9, 73, 1693, 281, 3941, 10377, 29365, 19807, 73973, 169113}}, {18124, 18, 79095, {1, 3, 7, 15, 29, 41, 119, 75, 241, 79, 1969, 1091, 6241, 10685, 11579, 3791, 124443, 5051}}, {18125, 18, 79099, {1, 3, 7, 15, 23, 53, 13, 255, 205, 547, 255, 1589, 7261, 15735, 14521, 29679, 109373, 236433}}, {18126, 18, 79121, {1, 3, 7, 3, 17, 37, 71, 163, 95, 265, 1, 3239, 1779, 9047, 31387, 32291, 86741, 55317}}, {18127, 18, 79150, {1, 3, 1, 9, 31, 55, 117, 247, 317, 673, 749, 1155, 7743, 6427, 25273, 49701, 62345, 20913}}, {18128, 18, 79196, {1, 3, 3, 7, 27, 55, 35, 111, 69, 799, 213, 3011, 4359, 14763, 7387, 13281, 58397, 38415}}, {18129, 18, 79199, {1, 1, 5, 9, 5, 61, 49, 219, 419, 297, 1019, 2181, 6069, 12957, 24637, 23317, 6389, 240893}}, {18130, 18, 79220, {1, 1, 5, 15, 13, 57, 59, 43, 373, 647, 1407, 3955, 5583, 15229, 20935, 38007, 65971, 95987}}, {18131, 18, 79229, {1, 1, 7, 7, 23, 17, 77, 91, 449, 75, 1059, 3337, 2041, 261, 25077, 28161, 44537, 189443}}, {18132, 18, 79263, {1, 1, 7, 11, 9, 7, 117, 225, 457, 941, 161, 1825, 1101, 193, 32619, 37245, 102633, 86707}}, {18133, 18, 79264, {1, 1, 1, 7, 13, 43, 33, 137, 275, 691, 1387, 1265, 759, 1457, 4877, 41813, 4159, 234397}}, {18134, 18, 79296, {1, 3, 3, 1, 9, 23, 71, 39, 205, 175, 953, 2965, 3283, 6025, 5905, 34691, 120987, 71841}}, {18135, 18, 79302, {1, 3, 1, 13, 31, 63, 49, 73, 299, 169, 1265, 2205, 1299, 10045, 6919, 26067, 56909, 42549}}, {18136, 18, 79354, {1, 3, 3, 1, 31, 41, 75, 219, 457, 407, 5, 1901, 6823, 531, 3155, 64375, 38523, 68217}}, {18137, 18, 79387, {1, 1, 7, 9, 7, 35, 123, 193, 145, 1021, 757, 3775, 2313, 11885, 11649, 61071, 129363, 120467}}, {18138, 18, 79399, {1, 3, 7, 3, 29, 21, 127, 93, 415, 641, 453, 923, 7713, 9569, 5961, 25969, 31095, 93317}}, {18139, 18, 79435, {1, 3, 3, 1, 5, 15, 21, 235, 211, 663, 385, 2429, 319, 11571, 17539, 42975, 43179, 100105}}, {18140, 18, 79525, {1, 3, 7, 7, 25, 57, 51, 215, 393, 167, 1569, 3235, 5555, 3391, 2389, 36485, 21919, 164479}}, {18141, 18, 79540, {1, 3, 3, 3, 29, 21, 81, 59, 239, 671, 605, 583, 2341, 2321, 28593, 19035, 10209, 36433}}, {18142, 18, 79552, {1, 3, 3, 11, 31, 33, 1, 147, 111, 523, 427, 3545, 111, 8009, 29101, 34549, 122745, 82117}}, {18143, 18, 79562, {1, 3, 5, 15, 19, 37, 97, 141, 387, 523, 467, 1657, 4161, 5505, 18091, 39597, 124423, 74827}}, {18144, 18, 79576, {1, 1, 1, 11, 21, 63, 61, 13, 169, 851, 1863, 3307, 7189, 10791, 22619, 24431, 127781, 14717}}, {18145, 18, 79579, {1, 1, 3, 13, 27, 41, 69, 127, 497, 565, 1489, 277, 2551, 15409, 9885, 187, 101319, 194121}}, {18146, 18, 79605, {1, 1, 7, 7, 17, 45, 1, 139, 347, 503, 1189, 1459, 6117, 14319, 22153, 2915, 91991, 246679}}, {18147, 18, 79618, {1, 3, 3, 3, 9, 41, 25, 199, 327, 295, 945, 2765, 563, 11605, 24267, 37729, 80057, 169479}}, {18148, 18, 79648, {1, 1, 7, 3, 23, 19, 13, 219, 235, 837, 1015, 2071, 2727, 3989, 32539, 26713, 112391, 163943}}, {18149, 18, 79654, {1, 3, 3, 9, 21, 27, 17, 187, 315, 753, 817, 3053, 5961, 973, 23973, 37621, 105637, 247711}}, {18150, 18, 79666, {1, 1, 7, 1, 11, 15, 45, 25, 421, 213, 663, 3829, 469, 15889, 28773, 14323, 107705, 111729}}, {18151, 18, 79686, {1, 1, 1, 7, 7, 7, 51, 189, 457, 95, 1903, 639, 1933, 7409, 22327, 18959, 42679, 158987}}, {18152, 18, 79697, {1, 1, 5, 9, 13, 13, 49, 159, 387, 365, 1799, 2399, 6375, 14965, 32495, 5383, 73479, 5653}}, {18153, 18, 79700, {1, 1, 3, 1, 29, 23, 81, 73, 183, 563, 435, 133, 5731, 6663, 21219, 60007, 101215, 68775}}, {18154, 18, 79723, {1, 1, 7, 11, 31, 47, 43, 159, 221, 745, 1317, 2405, 4563, 4073, 27675, 14225, 114231, 222553}}, {18155, 18, 79749, {1, 1, 1, 5, 11, 63, 105, 99, 413, 81, 771, 547, 1633, 8097, 30431, 31417, 101379, 163575}}, {18156, 18, 79750, {1, 1, 3, 9, 23, 29, 123, 149, 241, 267, 1925, 467, 7743, 4473, 12223, 10521, 86265, 89949}}, {18157, 18, 79764, {1, 3, 5, 1, 31, 29, 111, 67, 311, 851, 1919, 2563, 3725, 4035, 7241, 13859, 105207, 200599}}, {18158, 18, 79771, {1, 3, 7, 3, 19, 53, 113, 107, 133, 243, 2021, 2669, 4633, 14393, 24827, 1233, 81471, 20105}}, {18159, 18, 79774, {1, 1, 1, 5, 3, 23, 43, 149, 157, 875, 1175, 963, 6189, 7343, 13913, 41375, 112857, 236047}}, {18160, 18, 79780, {1, 3, 5, 15, 11, 31, 43, 225, 469, 229, 703, 3033, 2341, 10309, 12057, 13325, 109019, 130789}}, {18161, 18, 79789, {1, 1, 1, 7, 27, 47, 45, 49, 371, 971, 1121, 2179, 1267, 9499, 10771, 28781, 77059, 90765}}, {18162, 18, 79798, {1, 1, 7, 1, 17, 27, 59, 169, 269, 217, 983, 1365, 1985, 12287, 5385, 46407, 24827, 155761}}, {18163, 18, 79821, {1, 1, 7, 11, 9, 5, 19, 205, 159, 937, 763, 3823, 3625, 14209, 32031, 58879, 118449, 50723}}, {18164, 18, 79850, {1, 1, 5, 3, 25, 55, 27, 35, 125, 999, 1541, 3883, 539, 5691, 18071, 63199, 112089, 194825}}, {18165, 18, 79864, {1, 3, 3, 1, 27, 43, 57, 225, 173, 673, 1339, 3433, 5743, 1375, 32429, 35071, 98035, 229973}}, {18166, 18, 79898, {1, 3, 3, 9, 3, 51, 5, 203, 439, 41, 529, 863, 6735, 13211, 7075, 55637, 24481, 46673}}, {18167, 18, 79904, {1, 1, 5, 11, 15, 23, 93, 7, 181, 843, 777, 1299, 1941, 7147, 26253, 10967, 5387, 84611}}, {18168, 18, 79934, {1, 3, 1, 7, 9, 57, 127, 155, 257, 423, 1421, 261, 4477, 11169, 22997, 12371, 8705, 135883}}, {18169, 18, 79936, {1, 3, 1, 9, 17, 9, 15, 209, 427, 889, 1939, 3623, 2587, 4037, 32233, 40391, 32529, 63851}}, {18170, 18, 79942, {1, 3, 3, 13, 3, 19, 49, 155, 213, 239, 817, 1787, 2999, 9955, 20155, 44711, 41367, 59623}}, {18171, 18, 79945, {1, 3, 7, 5, 5, 39, 103, 181, 405, 85, 1997, 3639, 1259, 10737, 189, 44377, 23589, 89371}}, {18172, 18, 79963, {1, 3, 5, 11, 15, 13, 57, 81, 203, 773, 1571, 3235, 6625, 13803, 2091, 64265, 131013, 189705}}, {18173, 18, 79987, {1, 1, 1, 13, 15, 3, 113, 159, 149, 55, 355, 2345, 5043, 4067, 23277, 32647, 43755, 5445}}, {18174, 18, 80057, {1, 3, 3, 9, 31, 7, 67, 177, 423, 269, 1731, 3957, 4383, 13483, 14653, 8243, 57689, 37375}}, {18175, 18, 80077, {1, 1, 3, 5, 25, 5, 77, 199, 161, 859, 497, 1679, 6809, 4877, 1107, 16443, 15505, 138155}}, {18176, 18, 80078, {1, 3, 5, 1, 11, 57, 7, 49, 145, 569, 571, 2679, 7531, 14517, 12425, 6285, 116961, 116397}}, {18177, 18, 80080, {1, 1, 7, 11, 1, 37, 65, 43, 151, 419, 801, 3231, 5321, 10725, 12885, 62771, 16507, 179009}}, {18178, 18, 80102, {1, 1, 5, 11, 29, 55, 89, 81, 325, 47, 1037, 3235, 2017, 10875, 8919, 25115, 118035, 178227}}, {18179, 18, 80106, {1, 3, 1, 7, 1, 43, 101, 25, 449, 617, 381, 3437, 6655, 1291, 18693, 53939, 99143, 195695}}, {18180, 18, 80111, {1, 3, 1, 5, 23, 7, 47, 159, 295, 939, 173, 3087, 1497, 6353, 13893, 13465, 118973, 193737}}, {18181, 18, 80152, {1, 1, 3, 9, 3, 41, 65, 79, 449, 345, 2039, 1193, 5915, 13689, 1257, 23273, 48515, 256793}}, {18182, 18, 80155, {1, 3, 5, 11, 11, 55, 13, 117, 343, 899, 1853, 373, 6885, 12863, 1209, 34433, 48215, 218187}}, {18183, 18, 80173, {1, 3, 7, 7, 3, 45, 103, 145, 55, 507, 743, 4027, 2075, 15707, 4473, 50077, 64551, 204305}}, {18184, 18, 80186, {1, 1, 3, 5, 31, 45, 123, 233, 363, 1003, 411, 1459, 6455, 985, 29451, 17625, 44153, 137097}}, {18185, 18, 80203, {1, 3, 3, 1, 27, 11, 53, 251, 41, 43, 495, 107, 6145, 8785, 28997, 7181, 92903, 105785}}, {18186, 18, 80223, {1, 1, 3, 11, 13, 5, 117, 141, 463, 639, 1857, 2873, 3627, 6081, 18207, 29451, 80909, 73557}}, {18187, 18, 80233, {1, 1, 1, 3, 29, 51, 15, 81, 85, 487, 307, 2481, 2769, 14901, 9407, 58321, 52813, 230393}}, {18188, 18, 80258, {1, 3, 3, 11, 31, 7, 107, 43, 205, 811, 1121, 2757, 2447, 6843, 21347, 9143, 41003, 80507}}, {18189, 18, 80281, {1, 1, 1, 1, 29, 19, 13, 203, 47, 689, 2003, 1477, 7857, 5031, 21781, 5745, 3649, 160389}}, {18190, 18, 80318, {1, 3, 3, 7, 21, 21, 65, 3, 351, 157, 167, 3425, 2395, 9165, 26143, 57221, 127171, 54461}}, {18191, 18, 80326, {1, 3, 1, 15, 13, 13, 65, 53, 305, 719, 181, 709, 5485, 13385, 30287, 52669, 82647, 83851}}, {18192, 18, 80330, {1, 1, 3, 11, 11, 23, 31, 109, 205, 123, 509, 3831, 7771, 7341, 31613, 28035, 38061, 49375}}, {18193, 18, 80337, {1, 3, 3, 3, 15, 33, 47, 159, 321, 589, 393, 3253, 3743, 6161, 445, 33129, 8181, 27793}}, {18194, 18, 80344, {1, 1, 1, 13, 9, 57, 111, 253, 203, 539, 673, 855, 1937, 2699, 25795, 6889, 13531, 63561}}, {18195, 18, 80365, {1, 1, 1, 13, 31, 45, 13, 101, 113, 903, 1699, 2423, 7967, 7957, 20303, 64395, 124447, 33947}}, {18196, 18, 80383, {1, 3, 5, 11, 17, 39, 59, 181, 421, 535, 1445, 3927, 5433, 12885, 12497, 47231, 39819, 46371}}, {18197, 18, 80389, {1, 3, 5, 7, 27, 3, 75, 49, 461, 781, 433, 1767, 6903, 11907, 2063, 55199, 82823, 229405}}, {18198, 18, 80413, {1, 3, 3, 15, 17, 61, 17, 23, 247, 683, 33, 4027, 341, 8069, 2529, 9757, 95653, 12927}}, {18199, 18, 80441, {1, 3, 3, 11, 17, 7, 29, 205, 353, 917, 219, 3509, 7803, 5939, 25111, 45357, 9259, 1549}}, {18200, 18, 80449, {1, 3, 3, 15, 21, 7, 23, 25, 459, 291, 31, 2091, 1177, 9311, 12231, 16617, 33575, 252643}}, {18201, 18, 80461, {1, 3, 5, 5, 3, 51, 113, 123, 453, 503, 1575, 2785, 5011, 1789, 819, 30857, 12955, 172421}}, {18202, 18, 80467, {1, 1, 5, 3, 15, 15, 125, 65, 113, 281, 53, 3417, 5279, 6351, 25931, 54835, 124077, 204241}}, {18203, 18, 80476, {1, 1, 3, 9, 29, 31, 19, 179, 275, 933, 711, 3351, 6221, 1711, 9375, 11645, 118911, 249395}}, {18204, 18, 80507, {1, 3, 7, 13, 23, 59, 43, 61, 85, 267, 691, 3949, 2135, 3203, 21455, 61895, 71157, 136739}}, {18205, 18, 80516, {1, 1, 7, 5, 19, 27, 69, 141, 9, 633, 95, 3789, 7823, 12635, 27661, 30285, 129469, 67163}}, {18206, 18, 80519, {1, 3, 3, 9, 11, 25, 103, 47, 425, 809, 1279, 411, 219, 6703, 24145, 17303, 56835, 84879}}, {18207, 18, 80568, {1, 1, 5, 13, 29, 41, 47, 133, 197, 615, 169, 2157, 1795, 4945, 31693, 57763, 39369, 83353}}, {18208, 18, 80571, {1, 3, 1, 3, 27, 23, 23, 213, 387, 239, 977, 221, 383, 11005, 7221, 8795, 100963, 163777}}, {18209, 18, 80579, {1, 1, 1, 1, 31, 29, 87, 93, 239, 399, 801, 3143, 6973, 16331, 16865, 1823, 1127, 41983}}, {18210, 18, 80586, {1, 1, 3, 13, 7, 39, 25, 251, 277, 417, 119, 3033, 6785, 9783, 1641, 60169, 25047, 182263}}, {18211, 18, 80599, {1, 1, 5, 5, 7, 35, 17, 47, 295, 861, 1671, 1971, 4583, 3925, 31013, 50039, 125191, 143019}}, {18212, 18, 80610, {1, 1, 5, 1, 3, 57, 11, 23, 273, 209, 617, 1499, 665, 1193, 7539, 1625, 48065, 82843}}, {18213, 18, 80629, {1, 1, 3, 15, 15, 17, 39, 145, 193, 503, 1305, 2071, 93, 11529, 14267, 14779, 49327, 51347}}, {18214, 18, 80642, {1, 3, 5, 3, 7, 39, 63, 171, 263, 493, 383, 3209, 4277, 6259, 1345, 48013, 110571, 127865}}, {18215, 18, 80690, {1, 3, 1, 7, 15, 29, 93, 75, 37, 235, 1095, 153, 745, 9785, 28831, 58899, 67091, 34743}}, {18216, 18, 80713, {1, 3, 7, 9, 27, 23, 67, 85, 491, 447, 1899, 709, 555, 13979, 12529, 38383, 16091, 117301}}, {18217, 18, 80716, {1, 1, 5, 3, 9, 55, 109, 173, 29, 19, 1265, 2391, 7761, 1953, 5643, 24079, 14187, 127017}}, {18218, 18, 80737, {1, 3, 7, 13, 21, 57, 105, 145, 73, 421, 403, 5, 3523, 7005, 1109, 63357, 111671, 191857}}, {18219, 18, 80743, {1, 1, 7, 13, 5, 27, 21, 5, 199, 515, 917, 365, 2775, 12453, 26989, 60593, 98977, 161759}}, {18220, 18, 80750, {1, 3, 1, 13, 15, 37, 71, 65, 27, 533, 1311, 2981, 1945, 7183, 5337, 20659, 67355, 185633}}, {18221, 18, 80786, {1, 1, 5, 7, 21, 39, 21, 195, 443, 979, 1033, 1823, 3045, 3023, 31783, 61803, 1023, 119291}}, {18222, 18, 80811, {1, 1, 3, 11, 5, 15, 107, 155, 465, 249, 1845, 357, 2769, 3313, 12335, 16615, 20809, 103469}}, {18223, 18, 80834, {1, 1, 3, 9, 13, 21, 11, 227, 173, 949, 1255, 3257, 601, 10865, 12779, 9173, 87255, 12867}}, {18224, 18, 80839, {1, 3, 3, 15, 3, 41, 97, 141, 385, 23, 1253, 2905, 1523, 7647, 7069, 61143, 101245, 59747}}, {18225, 18, 80840, {1, 3, 1, 3, 7, 35, 117, 93, 357, 741, 1673, 3295, 6809, 547, 22949, 42151, 91241, 16189}}, {18226, 18, 80846, {1, 3, 5, 9, 25, 31, 27, 221, 55, 595, 1513, 3963, 3143, 1189, 19843, 6361, 19575, 231765}}, {18227, 18, 80848, {1, 1, 5, 1, 3, 35, 91, 217, 385, 717, 57, 1471, 3529, 859, 15259, 4411, 54491, 79841}}, {18228, 18, 80876, {1, 1, 5, 9, 29, 47, 111, 89, 469, 975, 513, 1339, 1747, 8839, 30375, 46217, 128191, 95831}}, {18229, 18, 80911, {1, 1, 5, 13, 9, 45, 3, 221, 223, 461, 1353, 3953, 5505, 3139, 3407, 12953, 74487, 209401}}, {18230, 18, 80947, {1, 1, 7, 7, 7, 43, 33, 143, 427, 183, 573, 2881, 7355, 10693, 12841, 14267, 61847, 47689}}, {18231, 18, 81001, {1, 1, 3, 5, 23, 45, 53, 173, 347, 715, 173, 3385, 429, 8143, 2831, 57883, 77245, 37613}}, {18232, 18, 81031, {1, 1, 1, 13, 21, 47, 33, 157, 171, 47, 1981, 2003, 7401, 7687, 10553, 38083, 111901, 30251}}, {18233, 18, 81045, {1, 1, 5, 9, 23, 35, 121, 251, 7, 835, 1561, 1605, 7023, 15645, 14313, 6361, 107973, 211667}}, {18234, 18, 81056, {1, 3, 1, 13, 25, 39, 81, 31, 145, 483, 1587, 3457, 5293, 927, 3529, 22457, 69689, 190371}}, {18235, 18, 81073, {1, 1, 1, 3, 25, 61, 87, 111, 441, 829, 313, 2271, 205, 10187, 3003, 47237, 99899, 200553}}, {18236, 18, 81083, {1, 1, 7, 13, 31, 51, 9, 243, 219, 139, 1703, 2001, 959, 11265, 27897, 9081, 4473, 107737}}, {18237, 18, 81145, {1, 3, 5, 1, 25, 37, 61, 131, 487, 35, 1293, 833, 3847, 11315, 11811, 2763, 2199, 81127}}, {18238, 18, 81168, {1, 3, 7, 7, 31, 33, 87, 111, 429, 809, 173, 1093, 7719, 14307, 5735, 61019, 21223, 26361}}, {18239, 18, 81177, {1, 1, 3, 11, 17, 33, 31, 17, 49, 885, 1279, 2243, 3693, 61, 30909, 35807, 14027, 159225}}, {18240, 18, 81207, {1, 3, 7, 11, 9, 35, 61, 75, 171, 117, 1285, 935, 7271, 3509, 14119, 31065, 58181, 136623}}, {18241, 18, 81208, {1, 1, 3, 15, 3, 43, 93, 221, 239, 783, 37, 4007, 3637, 10461, 18425, 59629, 93781, 252689}}, {18242, 18, 81226, {1, 3, 5, 7, 5, 61, 19, 107, 123, 417, 1655, 2307, 8177, 13617, 17195, 31597, 66241, 107199}}, {18243, 18, 81245, {1, 3, 7, 7, 5, 5, 25, 69, 383, 217, 993, 2719, 3425, 8395, 1125, 10763, 80111, 70421}}, {18244, 18, 81269, {1, 1, 3, 9, 29, 45, 123, 45, 89, 1015, 1703, 4049, 4969, 3801, 23657, 41031, 66415, 34063}}, {18245, 18, 81285, {1, 1, 3, 3, 7, 53, 125, 63, 67, 335, 1937, 1793, 4641, 7115, 10951, 45503, 54723, 177433}}, {18246, 18, 81289, {1, 3, 5, 1, 21, 55, 83, 199, 509, 331, 695, 2133, 1881, 14369, 21687, 2343, 85895, 99255}}, {18247, 18, 81292, {1, 1, 5, 9, 11, 5, 111, 97, 433, 851, 1537, 411, 6629, 5185, 30749, 50017, 46177, 213347}}, {18248, 18, 81298, {1, 3, 3, 1, 7, 21, 95, 229, 311, 605, 1277, 2435, 5053, 3051, 15447, 35479, 2835, 204149}}, {18249, 18, 81310, {1, 3, 5, 9, 31, 27, 79, 201, 329, 735, 1933, 27, 6201, 9375, 24801, 34045, 16227, 61013}}, {18250, 18, 81346, {1, 1, 5, 5, 31, 7, 73, 197, 455, 835, 1845, 2733, 3371, 513, 10495, 43659, 4621, 68969}}, {18251, 18, 81348, {1, 1, 1, 15, 21, 55, 15, 83, 419, 471, 1427, 919, 7125, 7635, 25579, 19493, 37381, 191563}}, {18252, 18, 81355, {1, 1, 7, 3, 15, 35, 25, 73, 295, 507, 719, 3307, 4253, 945, 21005, 24903, 80287, 48885}}, {18253, 18, 81388, {1, 3, 7, 15, 27, 13, 71, 79, 189, 491, 1185, 3007, 4285, 13005, 18973, 33759, 15327, 45595}}, {18254, 18, 81396, {1, 3, 3, 9, 9, 33, 115, 103, 31, 949, 1817, 2865, 1215, 9611, 16019, 7925, 72945, 208301}}, {18255, 18, 81415, {1, 1, 1, 5, 19, 35, 89, 181, 409, 641, 1277, 2201, 2825, 5707, 13463, 34741, 39303, 217803}}, {18256, 18, 81460, {1, 1, 3, 11, 13, 31, 65, 191, 11, 179, 509, 2513, 3861, 13323, 11817, 24901, 53815, 44343}}, {18257, 18, 81482, {1, 3, 1, 5, 5, 57, 97, 25, 83, 177, 1963, 2367, 6703, 13361, 8749, 45533, 87883, 2977}}, {18258, 18, 81518, {1, 3, 5, 3, 15, 41, 113, 145, 39, 509, 81, 1387, 2881, 1441, 75, 28409, 61417, 79393}}, {18259, 18, 81523, {1, 3, 3, 3, 17, 1, 41, 19, 173, 133, 2033, 3637, 7415, 1841, 19497, 42643, 122885, 195301}}, {18260, 18, 81529, {1, 3, 3, 9, 15, 37, 11, 87, 291, 881, 1471, 2469, 6877, 6813, 8273, 1455, 30957, 181887}}, {18261, 18, 81545, {1, 3, 5, 9, 25, 41, 7, 71, 451, 831, 495, 3991, 4173, 4307, 31249, 7253, 57141, 35495}}, {18262, 18, 81570, {1, 1, 7, 9, 15, 39, 29, 193, 327, 837, 991, 3503, 1175, 14965, 18151, 22479, 51127, 159019}}, {18263, 18, 81576, {1, 3, 1, 9, 23, 41, 89, 211, 179, 507, 1005, 613, 8083, 15655, 1927, 23401, 51025, 21589}}, {18264, 18, 81604, {1, 1, 5, 15, 5, 63, 105, 229, 239, 399, 591, 2233, 391, 2871, 29829, 49961, 62045, 190437}}, {18265, 18, 81613, {1, 3, 5, 9, 7, 23, 85, 219, 163, 37, 1881, 589, 4239, 12845, 19993, 57267, 29519, 207597}}, {18266, 18, 81631, {1, 3, 7, 15, 19, 19, 115, 141, 41, 405, 657, 2517, 4231, 10247, 21383, 11479, 52955, 121545}}, {18267, 18, 81656, {1, 3, 1, 7, 23, 33, 65, 229, 287, 739, 1265, 1105, 487, 3801, 5211, 44731, 5359, 103685}}, {18268, 18, 81679, {1, 3, 1, 13, 23, 29, 101, 153, 395, 335, 899, 303, 2073, 15767, 1303, 15539, 12889, 35517}}, {18269, 18, 81684, {1, 1, 5, 11, 5, 63, 41, 53, 99, 339, 563, 2921, 4959, 13941, 13655, 10115, 56867, 42919}}, {18270, 18, 81698, {1, 3, 5, 5, 5, 35, 127, 225, 497, 27, 139, 3269, 3929, 3369, 22697, 19421, 2921, 171927}}, {18271, 18, 81736, {1, 1, 1, 15, 15, 21, 35, 251, 67, 447, 1045, 1173, 2951, 6589, 27261, 36597, 98721, 7205}}, {18272, 18, 81747, {1, 3, 3, 9, 11, 63, 83, 19, 163, 381, 87, 1211, 3007, 4971, 27105, 2341, 21389, 32995}}, {18273, 18, 81765, {1, 1, 3, 3, 21, 19, 63, 65, 505, 987, 1821, 2419, 3195, 2573, 1481, 35279, 45135, 597}}, {18274, 18, 81775, {1, 3, 1, 15, 29, 5, 77, 65, 121, 223, 2009, 593, 7929, 10353, 22301, 25137, 40289, 95847}}, {18275, 18, 81805, {1, 1, 3, 1, 17, 49, 9, 167, 69, 729, 1189, 1191, 1, 12603, 8281, 45193, 1427, 15887}}, {18276, 18, 81842, {1, 1, 3, 7, 17, 5, 11, 217, 505, 317, 505, 1201, 8025, 13255, 12591, 16207, 32387, 242425}}, {18277, 18, 81859, {1, 3, 7, 9, 25, 9, 97, 23, 91, 765, 653, 2689, 2787, 11719, 8455, 24665, 26907, 78525}}, {18278, 18, 81865, {1, 3, 3, 15, 27, 19, 79, 157, 117, 715, 1921, 2453, 499, 13593, 14173, 1993, 110087, 151427}}, {18279, 18, 81866, {1, 3, 1, 13, 5, 43, 59, 21, 451, 863, 533, 1723, 2059, 1611, 10403, 36479, 36999, 109553}}, {18280, 18, 81892, {1, 3, 7, 7, 29, 63, 51, 5, 475, 549, 123, 1949, 5279, 8581, 20053, 52287, 125223, 152299}}, {18281, 18, 81902, {1, 3, 1, 1, 7, 19, 1, 215, 273, 157, 1557, 425, 7549, 12337, 1735, 30917, 116487, 177335}}, {18282, 18, 81933, {1, 1, 1, 1, 7, 47, 61, 191, 73, 551, 1435, 2283, 3191, 8545, 11875, 41389, 17607, 26869}}, {18283, 18, 81934, {1, 1, 7, 9, 13, 61, 109, 121, 365, 223, 1729, 3311, 7249, 10765, 12419, 4235, 64127, 132257}}, {18284, 18, 81942, {1, 1, 3, 13, 17, 25, 65, 49, 417, 311, 141, 1127, 53, 945, 28277, 33347, 96399, 166049}}, {18285, 18, 81969, {1, 3, 7, 9, 5, 21, 93, 203, 467, 805, 115, 1757, 4535, 8687, 10423, 8065, 2955, 20403}}, {18286, 18, 81981, {1, 3, 3, 15, 7, 63, 103, 137, 227, 111, 735, 2139, 4293, 5347, 4131, 63405, 42599, 173299}}, {18287, 18, 81999, {1, 3, 7, 7, 17, 53, 127, 251, 57, 625, 843, 3045, 1319, 10085, 18591, 36115, 104193, 183891}}, {18288, 18, 82004, {1, 3, 7, 1, 31, 57, 107, 253, 207, 739, 1703, 1377, 3807, 10289, 22969, 13087, 2805, 261279}}, {18289, 18, 82008, {1, 1, 5, 5, 5, 59, 59, 63, 77, 663, 1109, 2159, 3725, 12355, 4805, 22433, 81851, 9419}}, {18290, 18, 82032, {1, 1, 7, 15, 1, 1, 101, 101, 295, 311, 447, 3931, 933, 15713, 8919, 7185, 38577, 254203}}, {18291, 18, 82035, {1, 1, 5, 15, 7, 35, 35, 141, 283, 665, 1685, 3875, 495, 1655, 8269, 23493, 1523, 248783}}, {18292, 18, 82060, {1, 1, 5, 9, 27, 35, 25, 57, 285, 469, 1491, 1479, 3705, 11357, 5319, 11575, 116207, 215961}}, {18293, 18, 82063, {1, 3, 5, 11, 7, 41, 67, 161, 73, 777, 247, 823, 6677, 1631, 3431, 2821, 25291, 17633}}, {18294, 18, 82071, {1, 1, 3, 9, 19, 17, 45, 181, 139, 85, 857, 1231, 7167, 2951, 26847, 39113, 51705, 104617}}, {18295, 18, 82081, {1, 3, 5, 1, 5, 55, 101, 209, 1, 47, 1059, 2175, 1549, 8007, 11267, 21863, 125567, 102775}}, {18296, 18, 82082, {1, 3, 3, 15, 15, 21, 79, 85, 427, 963, 1335, 2129, 6831, 6613, 13319, 15781, 3781, 222547}}, {18297, 18, 82105, {1, 3, 3, 13, 19, 63, 25, 123, 1, 215, 139, 1345, 5035, 3107, 14381, 6239, 18481, 202581}}, {18298, 18, 82106, {1, 1, 5, 1, 11, 11, 11, 53, 109, 533, 1113, 177, 609, 15391, 22735, 62229, 103591, 89143}}, {18299, 18, 82120, {1, 1, 5, 15, 3, 21, 115, 223, 167, 441, 277, 2971, 933, 2841, 26893, 48513, 74553, 250413}}, {18300, 18, 82125, {1, 1, 1, 7, 19, 17, 43, 181, 483, 897, 819, 1657, 5539, 8847, 23483, 57605, 104703, 242559}}, {18301, 18, 82156, {1, 3, 5, 11, 3, 63, 3, 129, 45, 981, 45, 845, 1481, 14735, 30451, 16937, 13789, 27107}}, {18302, 18, 82176, {1, 3, 3, 15, 25, 11, 33, 49, 155, 947, 521, 3417, 3299, 1123, 9517, 32127, 117795, 223167}}, {18303, 18, 82203, {1, 3, 5, 15, 3, 35, 27, 37, 287, 541, 727, 2779, 7033, 5189, 21579, 36895, 109645, 123353}}, {18304, 18, 82210, {1, 3, 7, 9, 15, 53, 123, 125, 405, 841, 119, 63, 853, 8693, 1537, 25509, 49345, 54301}}, {18305, 18, 82241, {1, 3, 7, 9, 11, 63, 65, 145, 283, 529, 1553, 883, 3319, 8601, 29379, 26991, 127343, 98701}}, {18306, 18, 82287, {1, 1, 1, 7, 23, 59, 11, 89, 407, 869, 445, 659, 3029, 5465, 5063, 36775, 69089, 205367}}, {18307, 18, 82323, {1, 3, 7, 5, 19, 35, 99, 49, 257, 287, 1113, 2825, 2797, 7283, 31757, 47015, 106987, 82589}}, {18308, 18, 82330, {1, 3, 7, 11, 15, 37, 41, 101, 493, 725, 1091, 503, 2611, 13025, 11071, 39311, 5193, 92127}}, {18309, 18, 82366, {1, 1, 3, 7, 9, 59, 69, 113, 381, 341, 1495, 3169, 5099, 69, 7911, 9721, 84609, 254171}}, {18310, 18, 82378, {1, 3, 5, 7, 21, 19, 75, 71, 7, 617, 1185, 2787, 4147, 16045, 18859, 52347, 66551, 161563}}, {18311, 18, 82395, {1, 3, 5, 3, 27, 39, 17, 205, 425, 3, 1443, 1947, 7645, 10125, 24577, 45373, 38015, 30407}}, {18312, 18, 82398, {1, 3, 3, 11, 1, 57, 105, 251, 65, 389, 1993, 3933, 3093, 1425, 9483, 5953, 13147, 234121}}, {18313, 18, 82401, {1, 3, 3, 3, 1, 27, 105, 45, 435, 393, 609, 291, 545, 4905, 22621, 62115, 78955, 84355}}, {18314, 18, 82404, {1, 3, 7, 9, 1, 15, 91, 183, 301, 223, 1183, 1877, 2141, 5549, 371, 44147, 6771, 136777}}, {18315, 18, 82419, {1, 1, 5, 15, 5, 49, 127, 161, 121, 979, 1247, 3681, 3805, 3363, 11643, 25735, 21193, 111657}}, {18316, 18, 82421, {1, 3, 5, 15, 15, 33, 47, 91, 137, 323, 1577, 3723, 3609, 11533, 4415, 26467, 120947, 200919}}, {18317, 18, 82428, {1, 3, 3, 3, 3, 33, 121, 161, 453, 205, 1815, 65, 5893, 4669, 14377, 10905, 9559, 56359}}, {18318, 18, 82442, {1, 1, 1, 7, 1, 55, 21, 143, 411, 65, 1009, 2989, 133, 7059, 30981, 15417, 2651, 110345}}, {18319, 18, 82452, {1, 1, 3, 7, 19, 25, 91, 241, 193, 903, 661, 665, 7681, 14111, 29197, 51299, 109519, 155827}}, {18320, 18, 82455, {1, 1, 1, 15, 25, 3, 79, 57, 417, 73, 705, 7, 4415, 7699, 28185, 53005, 88547, 7281}}, {18321, 18, 82466, {1, 1, 7, 13, 27, 21, 35, 197, 65, 171, 1773, 393, 3759, 8335, 5987, 20611, 91373, 80715}}, {18322, 18, 82510, {1, 3, 7, 3, 17, 51, 85, 229, 131, 733, 281, 3157, 1283, 10751, 20203, 49955, 23861, 128517}}, {18323, 18, 82524, {1, 1, 5, 15, 3, 27, 35, 87, 391, 509, 1627, 769, 701, 4933, 24597, 9695, 111441, 198493}}, {18324, 18, 82545, {1, 1, 1, 15, 3, 31, 73, 235, 341, 263, 883, 2369, 4887, 4659, 9493, 6763, 130625, 15031}}, {18325, 18, 82555, {1, 3, 1, 15, 1, 11, 63, 79, 389, 355, 619, 1361, 313, 1199, 555, 42213, 81089, 170863}}, {18326, 18, 82581, {1, 3, 1, 15, 21, 27, 1, 179, 19, 241, 1655, 1803, 5413, 5353, 65, 31211, 3501, 27205}}, {18327, 18, 82588, {1, 3, 3, 9, 9, 19, 63, 191, 217, 271, 1453, 2777, 2915, 13291, 31391, 37489, 86435, 22857}}, {18328, 18, 82591, {1, 3, 5, 9, 13, 41, 85, 11, 333, 479, 363, 2591, 697, 8587, 3647, 5741, 21627, 244573}}, {18329, 18, 82636, {1, 1, 3, 1, 5, 61, 83, 229, 193, 977, 677, 2585, 3273, 12035, 2621, 12943, 49293, 37985}}, {18330, 18, 82658, {1, 1, 5, 7, 27, 9, 69, 189, 489, 747, 519, 719, 1493, 13337, 14933, 44359, 11471, 57245}}, {18331, 18, 82675, {1, 3, 5, 1, 5, 17, 75, 89, 417, 367, 57, 1641, 1573, 1819, 31237, 5213, 78821, 149853}}, {18332, 18, 82678, {1, 1, 7, 3, 7, 17, 121, 91, 211, 101, 1145, 3753, 2997, 67, 10755, 11261, 122489, 61679}}, {18333, 18, 82716, {1, 3, 7, 7, 15, 17, 73, 133, 429, 285, 201, 1917, 5677, 1793, 21653, 49729, 68965, 5347}}, {18334, 18, 82725, {1, 3, 3, 13, 23, 17, 49, 249, 71, 169, 619, 843, 2163, 585, 23309, 39509, 68087, 232233}}, {18335, 18, 82743, {1, 1, 7, 15, 23, 15, 19, 227, 89, 719, 1247, 2521, 1509, 7553, 12225, 12865, 100107, 261847}}, {18336, 18, 82744, {1, 1, 5, 3, 23, 17, 117, 5, 401, 57, 1945, 1081, 1269, 5921, 31815, 42341, 112099, 130047}}, {18337, 18, 82762, {1, 1, 1, 1, 9, 5, 87, 203, 211, 1009, 403, 1617, 3969, 2541, 7261, 6989, 16579, 206159}}, {18338, 18, 82770, {1, 3, 7, 9, 5, 13, 93, 191, 79, 631, 1019, 3639, 7137, 13859, 19603, 63263, 82947, 181023}}, {18339, 18, 82809, {1, 1, 5, 11, 25, 17, 85, 51, 61, 311, 517, 2001, 6325, 6831, 10835, 20101, 115241, 15815}}, {18340, 18, 82846, {1, 3, 7, 13, 29, 19, 33, 115, 473, 477, 471, 773, 4097, 11697, 30781, 20843, 27089, 181927}}, {18341, 18, 82855, {1, 3, 5, 5, 21, 27, 3, 239, 45, 335, 505, 149, 3005, 3511, 18037, 31291, 6145, 2913}}, {18342, 18, 82882, {1, 1, 3, 1, 25, 49, 21, 225, 27, 395, 415, 1813, 5727, 7211, 9887, 63533, 99185, 119269}}, {18343, 18, 82899, {1, 3, 3, 5, 15, 53, 127, 195, 81, 895, 587, 561, 5951, 9901, 18117, 37855, 19393, 259031}}, {18344, 18, 82905, {1, 1, 7, 13, 9, 49, 109, 127, 53, 735, 391, 1523, 3759, 10363, 11299, 3203, 89121, 122643}}, {18345, 18, 82950, {1, 1, 5, 3, 13, 3, 21, 247, 259, 557, 977, 1465, 6889, 3879, 4627, 1439, 122809, 248941}}, {18346, 18, 82953, {1, 3, 7, 15, 7, 19, 113, 251, 245, 63, 267, 1873, 6601, 16253, 24643, 7433, 130051, 233047}}, {18347, 18, 82967, {1, 1, 3, 9, 29, 39, 47, 31, 493, 817, 1697, 2139, 1059, 11365, 31653, 56477, 119191, 45509}}, {18348, 18, 82971, {1, 1, 1, 15, 9, 29, 99, 61, 109, 341, 1009, 1551, 897, 13075, 10603, 25153, 65911, 228213}}, {18349, 18, 82987, {1, 3, 7, 7, 29, 47, 57, 85, 263, 767, 1633, 2473, 199, 49, 22287, 33345, 118877, 248435}}, {18350, 18, 83007, {1, 3, 1, 9, 5, 45, 5, 179, 9, 129, 1231, 4075, 7497, 2159, 18101, 31039, 95213, 171913}}, {18351, 18, 83009, {1, 1, 1, 13, 23, 1, 89, 63, 21, 983, 481, 773, 5957, 4823, 4483, 50405, 42979, 243567}}, {18352, 18, 83012, {1, 1, 5, 13, 15, 21, 65, 133, 347, 511, 1887, 743, 7825, 1681, 4857, 49247, 21277, 212995}}, {18353, 18, 83030, {1, 3, 7, 9, 7, 51, 3, 233, 287, 727, 815, 3609, 397, 5721, 16473, 7549, 100455, 136233}}, {18354, 18, 83045, {1, 3, 1, 1, 31, 51, 59, 37, 79, 623, 1219, 2655, 4619, 11967, 11377, 28985, 16069, 188773}}, {18355, 18, 83050, {1, 3, 3, 13, 13, 59, 93, 159, 197, 339, 1633, 1601, 255, 1631, 4989, 12019, 23921, 261273}}, {18356, 18, 83052, {1, 1, 3, 13, 27, 25, 55, 43, 147, 981, 65, 725, 5753, 115, 26125, 25501, 89099, 233419}}, {18357, 18, 83070, {1, 3, 7, 5, 25, 3, 95, 135, 191, 417, 929, 3855, 5829, 3827, 13979, 65367, 63683, 85911}}, {18358, 18, 83076, {1, 3, 5, 1, 7, 63, 45, 187, 355, 735, 1325, 1461, 3869, 2127, 18231, 45891, 24027, 202997}}, {18359, 18, 83086, {1, 3, 7, 13, 19, 47, 89, 229, 253, 659, 355, 3323, 4081, 8243, 32553, 46579, 46431, 53291}}, {18360, 18, 83128, {1, 1, 5, 11, 3, 61, 33, 65, 239, 779, 665, 1337, 6427, 12787, 1495, 27105, 71455, 89715}}, {18361, 18, 83141, {1, 3, 1, 11, 31, 33, 115, 69, 511, 187, 99, 1055, 1065, 9531, 29897, 23897, 80581, 166957}}, {18362, 18, 83153, {1, 1, 7, 13, 19, 1, 13, 241, 89, 761, 425, 3865, 961, 14999, 24175, 19103, 39095, 38899}}, {18363, 18, 83156, {1, 3, 7, 7, 11, 17, 25, 217, 113, 615, 1455, 1409, 5679, 2321, 28687, 8089, 74031, 230559}}, {18364, 18, 83194, {1, 3, 7, 1, 25, 15, 77, 111, 405, 523, 961, 647, 3857, 14355, 27063, 48829, 87913, 254965}}, {18365, 18, 83225, {1, 1, 3, 3, 5, 13, 67, 155, 393, 943, 1875, 1209, 3765, 8627, 15123, 43405, 78473, 146127}}, {18366, 18, 83261, {1, 1, 3, 7, 29, 43, 23, 33, 35, 883, 1859, 1559, 4163, 13277, 16971, 15289, 60305, 56743}}, {18367, 18, 83264, {1, 1, 1, 5, 19, 55, 37, 53, 123, 35, 1477, 1035, 4683, 259, 20079, 37041, 48081, 198685}}, {18368, 18, 83322, {1, 1, 3, 3, 1, 19, 27, 129, 427, 685, 959, 2501, 2761, 9495, 23649, 18789, 54521, 219547}}, {18369, 18, 83382, {1, 1, 7, 1, 31, 11, 65, 171, 229, 11, 1825, 1641, 2731, 11085, 2567, 30831, 20365, 242731}}, {18370, 18, 83391, {1, 1, 1, 13, 13, 5, 21, 175, 265, 271, 133, 407, 3415, 5943, 15385, 12817, 106159, 41859}}, {18371, 18, 83399, {1, 3, 7, 1, 11, 45, 105, 229, 395, 877, 1495, 2113, 1733, 10117, 1125, 9989, 109637, 124517}}, {18372, 18, 83406, {1, 1, 7, 3, 27, 43, 57, 77, 63, 907, 1137, 3333, 189, 15285, 13895, 23773, 73523, 47811}}, {18373, 18, 83427, {1, 3, 3, 11, 17, 19, 81, 197, 73, 897, 515, 3801, 5105, 6987, 10125, 7239, 32339, 124411}}, {18374, 18, 83439, {1, 3, 1, 9, 11, 15, 99, 109, 307, 133, 249, 1463, 5479, 8565, 19489, 13773, 11443, 149799}}, {18375, 18, 83444, {1, 3, 7, 7, 19, 53, 61, 75, 83, 545, 1449, 683, 5845, 8325, 18111, 35941, 51843, 97907}}, {18376, 18, 83453, {1, 1, 1, 3, 31, 23, 37, 187, 207, 51, 439, 3095, 2217, 6393, 9117, 2779, 47331, 118275}}, {18377, 18, 83457, {1, 1, 3, 9, 23, 17, 41, 37, 59, 281, 319, 1333, 6207, 2265, 4445, 50831, 115893, 120491}}, {18378, 18, 83475, {1, 3, 1, 13, 27, 23, 25, 23, 187, 51, 1257, 379, 921, 3801, 24537, 59547, 34191, 184625}}, {18379, 18, 83484, {1, 1, 5, 3, 23, 21, 23, 159, 163, 537, 1589, 2797, 8007, 6767, 31331, 20741, 119969, 174135}}, {18380, 18, 83488, {1, 3, 1, 1, 13, 35, 73, 147, 491, 317, 69, 1069, 5413, 13973, 19741, 44717, 63263, 77145}}, {18381, 18, 83493, {1, 3, 1, 15, 31, 41, 23, 79, 55, 863, 129, 2229, 3395, 1621, 6273, 44521, 100047, 42337}}, {18382, 18, 83512, {1, 3, 7, 3, 7, 5, 79, 1, 191, 227, 1039, 2909, 1085, 3173, 29311, 13861, 124785, 212453}}, {18383, 18, 83525, {1, 3, 1, 5, 13, 9, 99, 213, 61, 201, 889, 1171, 3981, 2091, 31679, 26643, 5611, 154339}}, {18384, 18, 83535, {1, 3, 3, 7, 27, 49, 53, 77, 285, 441, 1669, 2157, 223, 1899, 2725, 36547, 39273, 206653}}, {18385, 18, 83560, {1, 3, 3, 9, 29, 5, 91, 1, 13, 409, 1275, 891, 6557, 5157, 6481, 57381, 87683, 117277}}, {18386, 18, 83617, {1, 3, 3, 1, 11, 7, 13, 69, 9, 1015, 907, 2685, 6665, 16307, 24567, 13191, 9567, 55073}}, {18387, 18, 83664, {1, 3, 1, 5, 19, 15, 65, 13, 503, 427, 1947, 1869, 5857, 823, 20533, 25337, 83551, 128505}}, {18388, 18, 83676, {1, 1, 5, 11, 25, 53, 83, 175, 445, 5, 841, 2773, 4381, 2829, 1927, 63689, 63643, 246629}}, {18389, 18, 83757, {1, 3, 1, 11, 27, 63, 43, 95, 453, 235, 673, 117, 6617, 7589, 5767, 16465, 36961, 39395}}, {18390, 18, 83770, {1, 1, 3, 13, 3, 27, 119, 87, 209, 167, 721, 1499, 1955, 9151, 11649, 29009, 25249, 26125}}, {18391, 18, 83775, {1, 1, 5, 1, 9, 59, 47, 57, 81, 243, 485, 559, 7311, 15119, 9827, 47219, 5941, 16909}}, {18392, 18, 83835, {1, 3, 7, 11, 29, 13, 97, 63, 289, 653, 1811, 835, 801, 13103, 9333, 7785, 111587, 10021}}, {18393, 18, 83838, {1, 3, 3, 1, 27, 61, 73, 165, 279, 239, 865, 517, 7763, 1917, 9839, 20725, 50721, 171351}}, {18394, 18, 83848, {1, 3, 7, 1, 27, 29, 43, 137, 353, 927, 889, 2511, 709, 3309, 967, 18119, 48099, 98139}}, {18395, 18, 83856, {1, 3, 1, 1, 17, 5, 79, 23, 367, 231, 605, 3809, 7557, 14283, 18417, 15775, 107421, 9587}}, {18396, 18, 83878, {1, 1, 1, 7, 25, 9, 93, 41, 165, 509, 661, 2165, 3595, 2555, 11399, 2403, 76179, 176003}}, {18397, 18, 83884, {1, 3, 3, 7, 27, 19, 55, 213, 83, 601, 377, 2381, 6831, 5609, 31321, 26897, 105321, 144705}}, {18398, 18, 83896, {1, 3, 7, 7, 21, 11, 45, 55, 379, 133, 653, 3593, 7481, 15789, 12723, 9697, 20073, 58211}}, {18399, 18, 83902, {1, 3, 5, 1, 1, 57, 89, 159, 461, 719, 1251, 3899, 1063, 10753, 6509, 28391, 129377, 195279}}, {18400, 18, 83922, {1, 3, 7, 7, 5, 39, 59, 81, 27, 169, 1541, 2213, 3631, 11601, 13153, 43221, 14587, 29719}}, {18401, 18, 83977, {1, 1, 1, 1, 3, 29, 103, 125, 35, 455, 255, 3855, 567, 12013, 13285, 44753, 117415, 226285}}, {18402, 18, 83985, {1, 1, 5, 1, 21, 41, 59, 69, 83, 813, 1041, 2559, 1947, 7343, 5291, 39281, 56141, 54487}}, {18403, 18, 83988, {1, 1, 7, 15, 25, 17, 83, 115, 321, 659, 1625, 3253, 281, 6673, 26301, 45647, 92151, 150707}}, {18404, 18, 84034, {1, 1, 5, 15, 9, 19, 83, 167, 325, 869, 501, 483, 2155, 14697, 12755, 54687, 100637, 6791}}, {18405, 18, 84046, {1, 1, 7, 3, 3, 47, 91, 79, 347, 215, 847, 2957, 5881, 5371, 20099, 45603, 29349, 175357}}, {18406, 18, 84058, {1, 3, 1, 3, 13, 43, 101, 235, 505, 289, 691, 673, 5579, 8721, 9639, 18569, 44797, 250887}}, {18407, 18, 84069, {1, 1, 3, 11, 23, 27, 85, 223, 365, 767, 577, 2781, 4179, 12963, 25235, 51021, 84989, 149521}}, {18408, 18, 84107, {1, 1, 1, 1, 9, 51, 13, 129, 393, 725, 1301, 1391, 4693, 4979, 16801, 21361, 122157, 56675}}, {18409, 18, 84155, {1, 3, 5, 11, 7, 21, 97, 97, 17, 915, 255, 155, 3961, 7999, 7493, 52683, 49377, 131663}}, {18410, 18, 84157, {1, 3, 5, 15, 31, 23, 41, 187, 89, 933, 309, 2519, 6595, 13785, 14339, 44393, 64439, 142105}}, {18411, 18, 84160, {1, 1, 1, 11, 13, 57, 29, 249, 467, 863, 77, 3185, 6221, 13109, 32397, 13859, 27331, 35295}}, {18412, 18, 84165, {1, 3, 3, 3, 23, 31, 29, 189, 405, 855, 1597, 3167, 4171, 13801, 12297, 38019, 130141, 135517}}, {18413, 18, 84187, {1, 1, 5, 7, 13, 37, 87, 41, 503, 281, 103, 1997, 3603, 4185, 25331, 55123, 74263, 248695}}, {18414, 18, 84214, {1, 3, 1, 15, 13, 57, 67, 135, 429, 489, 829, 2069, 7657, 15713, 3907, 5819, 114005, 187859}}, {18415, 18, 84226, {1, 1, 3, 1, 23, 43, 93, 63, 5, 435, 1649, 1429, 2923, 9035, 28667, 13991, 74491, 236225}}, {18416, 18, 84235, {1, 3, 3, 7, 19, 29, 37, 143, 443, 955, 1431, 3193, 6023, 2421, 28955, 29171, 126785, 124709}}, {18417, 18, 84240, {1, 3, 7, 7, 23, 45, 59, 101, 25, 711, 1685, 851, 3101, 12273, 10775, 57633, 52739, 244681}}, {18418, 18, 84255, {1, 1, 1, 5, 3, 13, 97, 143, 367, 139, 1535, 873, 8005, 2795, 11103, 3837, 125833, 194903}}, {18419, 18, 84273, {1, 3, 5, 7, 23, 61, 61, 203, 443, 543, 573, 2835, 941, 12315, 18453, 34367, 94359, 132437}}, {18420, 18, 84291, {1, 1, 7, 5, 11, 21, 87, 27, 495, 67, 1267, 2029, 5041, 4133, 18821, 50249, 52397, 101431}}, {18421, 18, 84311, {1, 3, 3, 3, 13, 51, 89, 183, 61, 919, 1841, 373, 7091, 9413, 1227, 44515, 72869, 198769}}, {18422, 18, 84317, {1, 3, 3, 11, 13, 63, 13, 253, 203, 571, 91, 3477, 123, 15353, 7803, 62729, 14337, 252725}}, {18423, 18, 84328, {1, 1, 7, 1, 11, 57, 45, 251, 351, 895, 1813, 3857, 7545, 9739, 32029, 24915, 46261, 8149}}, {18424, 18, 84346, {1, 3, 1, 15, 25, 41, 71, 47, 265, 567, 307, 4079, 1943, 10407, 2999, 6605, 97621, 194711}}, {18425, 18, 84357, {1, 1, 3, 5, 17, 29, 97, 249, 449, 761, 1727, 1533, 7417, 16167, 421, 39075, 1029, 180923}}, {18426, 18, 84361, {1, 1, 1, 3, 11, 27, 67, 227, 131, 453, 951, 3897, 515, 4513, 17361, 50049, 4533, 35953}}, {18427, 18, 84372, {1, 1, 1, 13, 7, 53, 25, 163, 453, 195, 1115, 1019, 3799, 7489, 12419, 15141, 112001, 106459}}, {18428, 18, 84388, {1, 1, 3, 9, 27, 15, 63, 109, 293, 867, 645, 1821, 2867, 9653, 32617, 39617, 125589, 249169}}, {18429, 18, 84415, {1, 1, 7, 5, 19, 17, 15, 105, 65, 143, 961, 493, 7301, 11299, 4549, 49873, 82447, 107}}, {18430, 18, 84438, {1, 1, 7, 1, 31, 21, 19, 61, 255, 815, 421, 3097, 4993, 9709, 11529, 53839, 32653, 137861}}, {18431, 18, 84444, {1, 3, 1, 9, 5, 5, 59, 179, 115, 101, 407, 1143, 309, 843, 31143, 60639, 126659, 111695}}, {18432, 18, 84447, {1, 3, 7, 13, 7, 47, 65, 127, 159, 817, 1029, 2983, 5443, 11087, 10595, 47143, 128353, 195189}}, {18433, 18, 84451, {1, 3, 7, 1, 27, 21, 61, 235, 433, 929, 581, 1925, 8185, 6037, 28859, 16843, 43499, 217091}}, {18434, 18, 84465, {1, 3, 7, 11, 1, 11, 81, 187, 227, 967, 25, 2285, 1251, 10743, 2321, 29029, 89739, 188023}}, {18435, 18, 84471, {1, 3, 5, 11, 21, 25, 57, 201, 89, 965, 1593, 2879, 2469, 13675, 28789, 11407, 13109, 52749}}, {18436, 18, 84496, {1, 3, 3, 3, 19, 25, 87, 3, 127, 881, 645, 207, 1129, 4235, 1533, 52503, 128733, 238679}}, {18437, 18, 84554, {1, 3, 3, 1, 5, 5, 63, 181, 493, 457, 1529, 1795, 219, 10807, 26713, 49673, 47167, 103595}}, {18438, 18, 84561, {1, 1, 3, 3, 1, 31, 65, 79, 473, 257, 1477, 387, 2843, 4031, 8459, 44849, 115157, 8417}}, {18439, 18, 84571, {1, 3, 3, 5, 15, 1, 105, 67, 343, 333, 1961, 649, 5105, 11387, 27437, 35471, 26295, 220309}}, {18440, 18, 84580, {1, 3, 7, 15, 1, 7, 23, 113, 67, 1019, 1793, 3237, 7223, 5691, 6279, 50231, 49393, 84393}}, {18441, 18, 84598, {1, 1, 1, 7, 9, 29, 125, 249, 89, 813, 561, 871, 1957, 1095, 18563, 5257, 39563, 225651}}, {18442, 18, 84611, {1, 1, 1, 15, 17, 11, 51, 191, 217, 617, 793, 3633, 4673, 15463, 10621, 47221, 51611, 155937}}, {18443, 18, 84620, {1, 3, 7, 15, 13, 7, 63, 57, 45, 1005, 685, 2913, 3597, 9933, 14819, 26015, 80023, 60547}}, {18444, 18, 84625, {1, 1, 5, 5, 31, 43, 69, 63, 425, 439, 143, 933, 675, 11301, 31779, 53445, 25143, 213213}}, {18445, 18, 84632, {1, 1, 1, 5, 21, 9, 91, 89, 483, 153, 389, 7, 633, 15527, 21833, 45171, 88331, 150935}}, {18446, 18, 84648, {1, 3, 5, 5, 11, 31, 49, 139, 295, 289, 1623, 3359, 7551, 11285, 25083, 27699, 91869, 237571}}, {18447, 18, 84659, {1, 1, 1, 9, 9, 25, 55, 71, 51, 603, 1901, 2729, 6803, 11135, 5427, 37285, 69141, 262073}}, {18448, 18, 84662, {1, 1, 3, 11, 3, 7, 81, 89, 49, 303, 755, 223, 603, 12525, 26037, 47867, 118871, 238677}}, {18449, 18, 84683, {1, 3, 3, 11, 1, 53, 55, 15, 341, 151, 245, 1979, 3523, 15151, 25075, 21425, 48689, 125391}}, {18450, 18, 84697, {1, 3, 3, 7, 15, 21, 73, 247, 215, 339, 1995, 633, 2557, 5625, 28443, 16413, 34615, 260591}}, {18451, 18, 84698, {1, 3, 5, 1, 1, 59, 21, 247, 403, 15, 1129, 2263, 3361, 10675, 30417, 31285, 69913, 124329}}, {18452, 18, 84709, {1, 1, 5, 1, 17, 3, 103, 107, 333, 191, 345, 3219, 3845, 5953, 26403, 51115, 71623, 52293}}, {18453, 18, 84722, {1, 1, 7, 5, 29, 13, 59, 65, 185, 91, 717, 3179, 1237, 1187, 25485, 40119, 6069, 23567}}, {18454, 18, 84753, {1, 1, 1, 5, 17, 57, 27, 39, 269, 627, 1239, 135, 623, 483, 19229, 51939, 114387, 146431}}, {18455, 18, 84775, {1, 3, 7, 9, 21, 41, 119, 129, 177, 149, 1527, 3639, 4489, 11635, 23007, 59863, 85199, 87795}}, {18456, 18, 84789, {1, 3, 5, 9, 17, 25, 57, 237, 129, 855, 199, 1929, 2793, 4277, 4509, 46301, 32905, 102015}}, {18457, 18, 84885, {1, 1, 7, 1, 15, 23, 3, 131, 475, 347, 1301, 241, 153, 2801, 29271, 1337, 107613, 154105}}, {18458, 18, 84890, {1, 1, 1, 13, 5, 19, 43, 47, 381, 709, 637, 2565, 7503, 10027, 16873, 23511, 101785, 47987}}, {18459, 18, 84899, {1, 1, 5, 13, 31, 15, 125, 97, 361, 819, 121, 2723, 3395, 6943, 5279, 55977, 103559, 134177}}, {18460, 18, 84926, {1, 1, 7, 13, 17, 27, 105, 11, 327, 203, 1355, 1437, 959, 10113, 7405, 43511, 114073, 199463}}, {18461, 18, 84946, {1, 1, 7, 5, 29, 19, 7, 151, 107, 739, 1021, 1287, 6881, 2741, 3407, 13847, 75669, 116015}}, {18462, 18, 84958, {1, 1, 1, 5, 5, 17, 99, 67, 179, 319, 149, 4069, 7811, 3055, 24669, 21635, 68057, 72059}}, {18463, 18, 84976, {1, 3, 1, 11, 3, 3, 103, 45, 431, 159, 1693, 1069, 3403, 6121, 12695, 16565, 29787, 199327}}, {18464, 18, 84979, {1, 1, 5, 5, 5, 35, 97, 9, 7, 703, 1533, 847, 7693, 16041, 13127, 26829, 68801, 205219}}, {18465, 18, 85003, {1, 1, 5, 9, 25, 59, 3, 63, 305, 71, 1429, 1567, 2377, 12611, 9267, 62381, 32373, 187735}}, {18466, 18, 85014, {1, 1, 3, 15, 5, 31, 21, 113, 329, 573, 1975, 1615, 947, 987, 4655, 46803, 100251, 89729}}, {18467, 18, 85017, {1, 1, 5, 9, 15, 63, 83, 5, 71, 191, 1127, 3529, 7325, 1169, 4255, 6715, 42765, 73231}}, {18468, 18, 85024, {1, 3, 3, 9, 11, 1, 1, 23, 97, 967, 1465, 1305, 2073, 3143, 31333, 1409, 95321, 182333}}, {18469, 18, 85029, {1, 3, 5, 13, 21, 53, 47, 105, 75, 721, 239, 3619, 2581, 2063, 21227, 25579, 23729, 20067}}, {18470, 18, 85036, {1, 3, 5, 13, 1, 55, 55, 115, 391, 539, 869, 3347, 189, 11087, 11533, 18747, 25387, 19205}}, {18471, 18, 85042, {1, 3, 1, 15, 25, 57, 81, 27, 379, 635, 1697, 2805, 8071, 11407, 14843, 17593, 20819, 42891}}, {18472, 18, 85054, {1, 3, 5, 11, 1, 59, 51, 187, 11, 211, 1425, 3829, 3193, 15743, 16479, 4205, 108205, 205367}}, {18473, 18, 85056, {1, 1, 1, 5, 7, 7, 59, 85, 63, 509, 897, 2473, 7345, 111, 4431, 55273, 114037, 232541}}, {18474, 18, 85061, {1, 1, 5, 9, 29, 7, 25, 41, 401, 843, 115, 163, 6835, 13943, 5223, 31033, 10813, 250471}}, {18475, 18, 85066, {1, 1, 5, 11, 27, 45, 43, 233, 195, 151, 11, 1539, 4775, 15743, 15507, 26939, 30353, 162929}}, {18476, 18, 85073, {1, 3, 1, 7, 7, 39, 1, 87, 85, 1019, 1711, 2707, 735, 5093, 8231, 25069, 102861, 45751}}, {18477, 18, 85096, {1, 3, 7, 1, 19, 49, 55, 249, 255, 809, 1799, 3475, 7697, 5003, 12437, 52313, 96355, 138537}}, {18478, 18, 85101, {1, 1, 3, 5, 5, 43, 25, 95, 349, 775, 213, 3643, 1355, 7745, 9553, 53367, 123655, 195365}}, {18479, 18, 85109, {1, 1, 1, 1, 19, 53, 39, 105, 449, 447, 147, 2293, 7817, 1503, 31985, 37193, 51039, 209083}}, {18480, 18, 85114, {1, 3, 3, 15, 27, 15, 59, 51, 411, 543, 421, 3595, 2091, 7171, 23595, 33509, 37283, 105719}}, {18481, 18, 85119, {1, 3, 1, 11, 5, 37, 5, 203, 171, 853, 1875, 2735, 4003, 15163, 26193, 36149, 31389, 256631}}, {18482, 18, 85123, {1, 3, 5, 1, 21, 1, 127, 41, 185, 929, 1757, 2711, 2947, 9709, 18401, 45037, 1371, 242397}}, {18483, 18, 85149, {1, 1, 1, 1, 13, 43, 51, 187, 487, 759, 1579, 959, 2499, 4781, 27179, 6839, 43869, 36163}}, {18484, 18, 85185, {1, 3, 1, 15, 5, 3, 101, 25, 181, 107, 1105, 879, 5341, 12215, 21615, 9619, 129591, 108393}}, {18485, 18, 85228, {1, 1, 7, 1, 11, 39, 55, 101, 43, 935, 1703, 1269, 6751, 13723, 7463, 10055, 112971, 72789}}, {18486, 18, 85236, {1, 3, 5, 13, 7, 3, 81, 41, 55, 375, 663, 801, 5051, 14583, 30793, 63897, 127255, 174179}}, {18487, 18, 85281, {1, 3, 1, 7, 19, 31, 53, 29, 313, 57, 1411, 103, 6863, 10673, 4341, 5587, 106059, 222309}}, {18488, 18, 85282, {1, 3, 7, 3, 1, 33, 89, 199, 91, 557, 715, 2715, 4753, 5987, 30355, 13819, 57443, 112179}}, {18489, 18, 85293, {1, 3, 5, 7, 13, 27, 55, 11, 495, 29, 1273, 1727, 3397, 2739, 22907, 46203, 16687, 47385}}, {18490, 18, 85302, {1, 3, 5, 9, 13, 23, 23, 107, 353, 429, 359, 2667, 6137, 7213, 7977, 35903, 118507, 209243}}, {18491, 18, 85319, {1, 3, 1, 13, 9, 7, 37, 135, 377, 753, 1819, 113, 7379, 2795, 10373, 7131, 17845, 246101}}, {18492, 18, 85353, {1, 1, 3, 11, 11, 45, 53, 209, 49, 385, 1573, 1129, 2939, 10949, 413, 59193, 15399, 169355}}, {18493, 18, 85354, {1, 1, 5, 15, 29, 29, 89, 139, 403, 11, 1335, 2601, 3631, 15317, 1707, 3517, 1939, 121997}}, {18494, 18, 85356, {1, 3, 1, 7, 17, 3, 113, 97, 435, 911, 1743, 1649, 4829, 9995, 2873, 17527, 46931, 86199}}, {18495, 18, 85389, {1, 1, 7, 1, 13, 19, 83, 51, 49, 671, 1651, 3443, 2279, 5677, 8859, 41945, 110607, 200469}}, {18496, 18, 85418, {1, 1, 5, 13, 19, 63, 19, 73, 205, 571, 507, 1781, 1489, 5909, 10351, 64607, 67023, 49441}}, {18497, 18, 85446, {1, 1, 3, 5, 13, 35, 107, 63, 489, 69, 1541, 3761, 17, 9317, 20323, 35401, 61451, 116115}}, {18498, 18, 85450, {1, 3, 1, 5, 31, 35, 39, 119, 237, 533, 107, 3235, 4929, 15839, 9309, 50131, 110945, 24739}}, {18499, 18, 85463, {1, 3, 1, 5, 3, 25, 73, 145, 391, 481, 1927, 3071, 4347, 13415, 26723, 51629, 3003, 54575}}, {18500, 18, 85497, {1, 3, 3, 11, 29, 63, 63, 183, 11, 269, 153, 3379, 5603, 14279, 28579, 4653, 98179, 125693}}, {18501, 18, 85534, {1, 1, 5, 15, 1, 51, 101, 69, 177, 233, 213, 2389, 4963, 3391, 13419, 41283, 25667, 187239}}, {18502, 18, 85543, {1, 1, 1, 11, 13, 29, 95, 231, 481, 283, 1323, 521, 4689, 5311, 21949, 31851, 115845, 50433}}, {18503, 18, 85549, {1, 3, 7, 15, 11, 31, 67, 207, 57, 439, 1561, 2167, 673, 6467, 8189, 31783, 5051, 64097}}, {18504, 18, 85562, {1, 1, 7, 9, 17, 57, 77, 85, 119, 149, 211, 2727, 4921, 8701, 23121, 36355, 9179, 68003}}, {18505, 18, 85587, {1, 1, 5, 15, 1, 15, 123, 205, 79, 299, 71, 3413, 7635, 5699, 32393, 10253, 86205, 216015}}, {18506, 18, 85590, {1, 1, 5, 11, 23, 39, 105, 187, 487, 247, 333, 2423, 5643, 8111, 23549, 50153, 122859, 100361}}, {18507, 18, 85599, {1, 1, 1, 9, 11, 33, 65, 125, 67, 743, 1331, 1563, 6333, 11375, 15873, 18137, 52765, 224889}}, {18508, 18, 85630, {1, 3, 5, 9, 15, 17, 81, 165, 3, 609, 635, 2093, 6635, 8647, 25883, 18907, 73333, 80835}}, {18509, 18, 85660, {1, 1, 1, 11, 1, 1, 25, 115, 205, 941, 1917, 1295, 3659, 821, 11355, 1435, 40289, 115627}}, {18510, 18, 85669, {1, 3, 1, 9, 13, 23, 35, 105, 441, 777, 1255, 3315, 1157, 8719, 9939, 38931, 120723, 123201}}, {18511, 18, 85693, {1, 1, 5, 3, 1, 21, 95, 143, 23, 233, 73, 1223, 5619, 8583, 21417, 61971, 74565, 116249}}, {18512, 18, 85711, {1, 1, 7, 7, 23, 35, 21, 201, 441, 623, 419, 2375, 1189, 15681, 29469, 29437, 124525, 241899}}, {18513, 18, 85716, {1, 1, 3, 1, 11, 7, 23, 171, 435, 467, 1811, 63, 3705, 9395, 579, 58305, 86165, 67805}}, {18514, 18, 85773, {1, 3, 1, 3, 13, 11, 107, 243, 163, 79, 815, 1149, 2247, 12411, 30287, 56915, 26939, 85883}}, {18515, 18, 85801, {1, 3, 3, 1, 5, 23, 105, 63, 35, 57, 1815, 3325, 3727, 3623, 7203, 8301, 28073, 190053}}, {18516, 18, 85815, {1, 3, 1, 11, 23, 33, 121, 55, 287, 139, 491, 907, 4237, 17, 20055, 63729, 7517, 151597}}, {18517, 18, 85839, {1, 3, 5, 5, 21, 1, 37, 19, 159, 1013, 27, 2627, 851, 14021, 31311, 5871, 77613, 125311}}, {18518, 18, 85842, {1, 3, 3, 1, 27, 3, 51, 133, 459, 581, 383, 1351, 6149, 15611, 2631, 20797, 65955, 113665}}, {18519, 18, 85864, {1, 3, 1, 11, 23, 61, 75, 217, 283, 405, 767, 1151, 7501, 5553, 113, 48331, 49379, 191473}}, {18520, 18, 85867, {1, 3, 5, 5, 15, 3, 19, 27, 497, 519, 1611, 709, 405, 13329, 27861, 14981, 47197, 173979}}, {18521, 18, 85903, {1, 1, 7, 7, 25, 19, 99, 219, 349, 713, 1421, 3427, 153, 13319, 22415, 48617, 119637, 20835}}, {18522, 18, 85917, {1, 1, 1, 3, 13, 37, 43, 9, 317, 961, 1255, 2975, 2775, 12283, 29941, 57495, 77413, 256695}}, {18523, 18, 85921, {1, 1, 7, 5, 29, 37, 91, 199, 397, 739, 877, 251, 847, 2951, 19497, 57285, 76891, 258711}}, {18524, 18, 85928, {1, 1, 7, 15, 21, 55, 107, 115, 481, 845, 2015, 481, 3823, 14071, 4037, 39687, 62867, 170891}}, {18525, 18, 85934, {1, 3, 3, 1, 17, 51, 81, 195, 189, 455, 1343, 1493, 351, 361, 20289, 37423, 7747, 245861}}, {18526, 18, 85974, {1, 1, 5, 15, 9, 41, 71, 155, 197, 563, 1271, 2227, 2557, 6657, 13565, 8467, 96135, 5903}}, {18527, 18, 85994, {1, 1, 5, 13, 29, 33, 115, 131, 283, 435, 1327, 1113, 4729, 14125, 23743, 40121, 119955, 237453}}, {18528, 18, 85999, {1, 1, 1, 1, 13, 21, 109, 91, 105, 749, 1695, 1123, 4349, 9855, 31565, 64001, 7919, 83591}}, {18529, 18, 86004, {1, 3, 1, 1, 13, 19, 89, 83, 13, 609, 731, 2655, 1123, 13415, 5645, 10003, 69381, 187621}}, {18530, 18, 86008, {1, 3, 1, 15, 3, 37, 1, 139, 11, 917, 1191, 1381, 6035, 13851, 4565, 5427, 117703, 109965}}, {18531, 18, 86046, {1, 1, 5, 3, 17, 37, 15, 115, 19, 65, 1807, 3879, 2709, 9819, 11457, 53705, 14821, 156079}}, {18532, 18, 86067, {1, 1, 7, 13, 17, 29, 105, 77, 127, 457, 1287, 1533, 6879, 4001, 4083, 29523, 81175, 226409}}, {18533, 18, 86084, {1, 3, 1, 5, 5, 59, 21, 253, 459, 733, 409, 3359, 1913, 8893, 16113, 61063, 6511, 22441}}, {18534, 18, 86087, {1, 3, 5, 11, 7, 1, 121, 217, 63, 83, 173, 1869, 7931, 655, 21053, 20703, 116853, 131785}}, {18535, 18, 86093, {1, 1, 7, 7, 5, 13, 41, 57, 1, 17, 649, 233, 2867, 5577, 30553, 7635, 45305, 47979}}, {18536, 18, 86121, {1, 1, 7, 1, 1, 29, 61, 241, 107, 891, 49, 3433, 5045, 143, 22473, 29243, 82625, 184163}}, {18537, 18, 86122, {1, 3, 1, 11, 11, 21, 119, 43, 117, 429, 1569, 637, 67, 9475, 31779, 2237, 122037, 245361}}, {18538, 18, 86127, {1, 1, 7, 1, 31, 61, 9, 179, 467, 153, 1913, 2839, 6255, 12715, 28229, 20189, 3617, 213539}}, {18539, 18, 86151, {1, 1, 7, 13, 25, 61, 9, 109, 331, 577, 21, 1017, 6521, 5991, 26573, 56881, 58455, 169407}}, {18540, 18, 86166, {1, 1, 7, 9, 31, 57, 51, 41, 327, 859, 1295, 1577, 1071, 3277, 11685, 62129, 34111, 174639}}, {18541, 18, 86179, {1, 3, 5, 1, 7, 63, 35, 165, 43, 943, 1545, 3717, 1471, 11579, 29637, 22913, 8867, 12837}}, {18542, 18, 86188, {1, 1, 3, 1, 23, 7, 19, 151, 359, 347, 1085, 3923, 1039, 5149, 6047, 49811, 33099, 247983}}, {18543, 18, 86193, {1, 1, 1, 5, 29, 23, 73, 189, 59, 865, 1499, 1953, 1261, 1071, 26761, 26145, 129427, 223219}}, {18544, 18, 86206, {1, 3, 1, 9, 1, 29, 107, 173, 387, 703, 193, 1965, 6233, 10997, 32697, 31005, 15415, 94345}}, {18545, 18, 86214, {1, 1, 3, 9, 31, 35, 7, 15, 317, 79, 2045, 1455, 1559, 15087, 287, 46665, 37225, 149017}}, {18546, 18, 86226, {1, 1, 5, 13, 17, 27, 11, 107, 47, 803, 1487, 3049, 1171, 6237, 9157, 10037, 122349, 236877}}, {18547, 18, 86242, {1, 1, 7, 9, 21, 35, 53, 139, 165, 73, 1405, 2941, 3553, 11945, 2493, 5743, 63749, 140535}}, {18548, 18, 86256, {1, 3, 7, 11, 7, 57, 41, 187, 483, 499, 687, 117, 4951, 14709, 17025, 23027, 94863, 228465}}, {18549, 18, 86259, {1, 3, 7, 7, 27, 29, 85, 117, 201, 637, 823, 1135, 7595, 3323, 23579, 40759, 25087, 995}}, {18550, 18, 86298, {1, 3, 1, 9, 31, 53, 101, 29, 381, 101, 1939, 1973, 8191, 8155, 13881, 32309, 92907, 239525}}, {18551, 18, 86300, {1, 1, 5, 7, 3, 35, 15, 207, 1, 47, 325, 559, 3377, 3909, 31225, 28367, 63891, 19129}}, {18552, 18, 86307, {1, 1, 1, 5, 31, 61, 117, 211, 127, 969, 73, 1295, 7167, 14881, 9965, 28143, 28161, 131867}}, {18553, 18, 86310, {1, 3, 7, 5, 5, 57, 37, 207, 201, 79, 1151, 3685, 2071, 1751, 5481, 51447, 103437, 154895}}, {18554, 18, 86319, {1, 3, 5, 13, 9, 5, 57, 27, 131, 211, 1481, 2237, 4227, 6927, 18625, 49773, 55399, 15209}}, {18555, 18, 86321, {1, 3, 1, 7, 23, 29, 3, 179, 479, 787, 463, 2041, 2581, 6281, 1657, 51433, 93807, 160047}}, {18556, 18, 86328, {1, 1, 3, 13, 25, 35, 33, 231, 385, 479, 335, 3837, 5517, 13603, 15623, 46737, 42507, 208355}}, {18557, 18, 86356, {1, 1, 7, 9, 3, 25, 51, 125, 213, 175, 1575, 1755, 1843, 14361, 13155, 22445, 55435, 62793}}, {18558, 18, 86360, {1, 1, 1, 7, 25, 3, 21, 7, 309, 547, 19, 471, 2679, 16185, 12149, 41437, 47625, 75113}}, {18559, 18, 86375, {1, 1, 5, 1, 9, 23, 81, 95, 123, 143, 1111, 9, 3501, 11897, 26499, 10009, 48073, 182529}}, {18560, 18, 86399, {1, 3, 1, 1, 1, 17, 15, 157, 129, 1005, 543, 3917, 3493, 6537, 26997, 33217, 7987, 251635}}, {18561, 18, 86400, {1, 3, 1, 13, 11, 41, 9, 19, 173, 751, 491, 1645, 5205, 9907, 28503, 61137, 79727, 200851}}, {18562, 18, 86403, {1, 1, 1, 1, 3, 5, 105, 203, 97, 903, 1507, 2719, 5275, 1023, 29595, 42507, 39893, 151495}}, {18563, 18, 86430, {1, 1, 1, 11, 31, 53, 51, 65, 145, 671, 489, 109, 803, 8541, 4439, 33893, 98495, 114955}}, {18564, 18, 86446, {1, 1, 7, 11, 27, 63, 117, 235, 497, 841, 1461, 3757, 1077, 6997, 9611, 47453, 20197, 176939}}, {18565, 18, 86460, {1, 3, 3, 3, 31, 17, 85, 145, 377, 225, 1033, 3017, 735, 5811, 25503, 25457, 124623, 51713}}, {18566, 18, 86465, {1, 3, 3, 13, 19, 33, 127, 57, 321, 687, 1651, 3321, 5051, 8511, 19609, 49927, 30499, 102613}}, {18567, 18, 86486, {1, 1, 5, 13, 7, 17, 17, 147, 381, 137, 1007, 2607, 1071, 8921, 13955, 47223, 130359, 246265}}, {18568, 18, 86502, {1, 3, 7, 9, 13, 35, 71, 129, 57, 233, 357, 3181, 2841, 3707, 24947, 57777, 115133, 6049}}, {18569, 18, 86563, {1, 3, 7, 15, 23, 1, 107, 225, 57, 633, 1515, 1631, 4303, 4221, 8281, 59139, 45023, 70219}}, {18570, 18, 86595, {1, 1, 7, 5, 9, 9, 93, 131, 41, 245, 1261, 459, 4811, 10987, 10421, 63839, 34067, 196353}}, {18571, 18, 86635, {1, 3, 3, 13, 17, 3, 87, 255, 167, 701, 821, 1965, 1415, 4101, 549, 6347, 92421, 47193}}, {18572, 18, 86649, {1, 3, 7, 11, 23, 17, 51, 81, 71, 345, 971, 917, 1057, 3627, 20361, 13491, 12855, 234215}}, {18573, 18, 86661, {1, 1, 1, 13, 17, 9, 25, 155, 463, 851, 243, 3887, 2445, 7459, 19915, 21813, 86969, 85891}}, {18574, 18, 86674, {1, 1, 7, 1, 9, 15, 57, 201, 193, 169, 351, 1355, 1089, 4705, 15153, 51359, 49907, 66007}}, {18575, 18, 86689, {1, 3, 1, 9, 19, 13, 69, 83, 39, 667, 1549, 1503, 7167, 8657, 17269, 59357, 80091, 194007}}, {18576, 18, 86721, {1, 3, 5, 5, 17, 37, 125, 117, 355, 685, 637, 3159, 4783, 3159, 14953, 12731, 126759, 89149}}, {18577, 18, 86734, {1, 3, 3, 9, 15, 53, 7, 41, 473, 857, 511, 3741, 6837, 6167, 26351, 9885, 104819, 48221}}, {18578, 18, 86741, {1, 3, 7, 15, 21, 21, 21, 101, 465, 223, 13, 1773, 2763, 8621, 23591, 12633, 82143, 134899}}, {18579, 18, 86742, {1, 3, 1, 1, 29, 25, 67, 19, 349, 503, 655, 3567, 97, 6967, 18253, 42755, 33041, 250279}}, {18580, 18, 86784, {1, 1, 7, 9, 17, 1, 7, 165, 255, 613, 579, 127, 7567, 13181, 6255, 1785, 21527, 113815}}, {18581, 18, 86799, {1, 3, 1, 5, 27, 33, 61, 235, 37, 135, 1515, 3611, 1825, 9627, 18805, 37065, 126107, 23223}}, {18582, 18, 86808, {1, 3, 7, 5, 23, 11, 29, 121, 129, 311, 429, 1653, 5789, 7693, 18775, 18189, 97203, 213501}}, {18583, 18, 86837, {1, 3, 7, 3, 29, 61, 87, 197, 43, 509, 5, 3275, 345, 7885, 4381, 22059, 1395, 40125}}, {18584, 18, 86869, {1, 3, 5, 1, 1, 59, 69, 125, 297, 983, 641, 2665, 7045, 8591, 16581, 58657, 119189, 256579}}, {18585, 18, 86900, {1, 3, 7, 7, 7, 53, 65, 181, 149, 987, 1377, 4045, 971, 9827, 17727, 59357, 90975, 27395}}, {18586, 18, 86949, {1, 1, 7, 7, 1, 51, 109, 165, 361, 515, 739, 3709, 6431, 113, 21401, 41743, 53071, 134205}}, {18587, 18, 86993, {1, 3, 1, 13, 5, 51, 107, 99, 135, 163, 1705, 1683, 6221, 1377, 2211, 13379, 22801, 208753}}, {18588, 18, 86999, {1, 3, 5, 11, 11, 39, 49, 45, 503, 549, 821, 4077, 885, 13721, 29673, 28435, 6235, 212071}}, {18589, 18, 87030, {1, 3, 3, 11, 15, 25, 17, 67, 125, 7, 1163, 973, 5325, 12707, 12763, 9481, 21363, 195897}}, {18590, 18, 87041, {1, 1, 7, 9, 17, 19, 15, 13, 107, 919, 461, 343, 1101, 8195, 29293, 61643, 64995, 230469}}, {18591, 18, 87044, {1, 3, 5, 1, 9, 25, 39, 65, 27, 461, 669, 2841, 7973, 11565, 9531, 52235, 6741, 215513}}, {18592, 18, 87084, {1, 3, 3, 1, 7, 57, 101, 199, 37, 79, 2033, 1723, 6877, 2733, 26445, 62625, 21671, 238431}}, {18593, 18, 87116, {1, 1, 1, 9, 27, 31, 125, 199, 331, 611, 523, 407, 747, 9499, 4685, 17805, 43717, 253233}}, {18594, 18, 87138, {1, 1, 3, 7, 29, 7, 7, 153, 339, 337, 701, 2639, 6311, 6375, 26023, 27693, 59733, 260405}}, {18595, 18, 87162, {1, 1, 7, 7, 15, 27, 23, 49, 181, 433, 485, 2915, 6021, 9095, 15951, 47257, 104513, 208089}}, {18596, 18, 87188, {1, 1, 5, 7, 19, 19, 125, 153, 109, 829, 1967, 2567, 7157, 6001, 10151, 55323, 92405, 82549}}, {18597, 18, 87211, {1, 1, 3, 11, 13, 17, 85, 215, 265, 875, 311, 3773, 8059, 2115, 19259, 63999, 77411, 220267}}, {18598, 18, 87234, {1, 3, 1, 15, 15, 35, 81, 213, 411, 435, 105, 1487, 1991, 14539, 8175, 2115, 47259, 45893}}, {18599, 18, 87245, {1, 3, 1, 11, 9, 47, 27, 115, 449, 521, 321, 2463, 1355, 5785, 11269, 45337, 29049, 91675}}, {18600, 18, 87246, {1, 3, 1, 13, 21, 53, 49, 83, 373, 519, 757, 1241, 577, 14443, 449, 44773, 116673, 155209}}, {18601, 18, 87260, {1, 3, 3, 1, 29, 63, 97, 145, 371, 585, 1809, 3997, 249, 283, 28369, 27325, 61673, 12637}}, {18602, 18, 87270, {1, 3, 5, 9, 11, 55, 77, 89, 285, 297, 861, 2791, 3245, 15093, 32489, 40477, 97603, 35347}}, {18603, 18, 87284, {1, 1, 1, 3, 27, 33, 115, 209, 169, 893, 393, 1457, 6069, 12511, 20423, 11385, 86711, 197555}}, {18604, 18, 87293, {1, 3, 5, 15, 21, 25, 87, 159, 477, 177, 991, 495, 29, 9347, 9721, 4071, 30145, 214155}}, {18605, 18, 87296, {1, 1, 5, 3, 11, 45, 53, 251, 177, 651, 549, 3377, 3247, 8761, 20339, 27743, 103387, 159591}}, {18606, 18, 87299, {1, 3, 7, 11, 17, 27, 43, 179, 507, 553, 261, 3939, 6133, 6347, 12987, 46071, 42551, 99225}}, {18607, 18, 87305, {1, 3, 3, 11, 3, 33, 85, 51, 277, 117, 1295, 2435, 1467, 13787, 2209, 52673, 53515, 157625}}, {18608, 18, 87308, {1, 3, 3, 3, 9, 15, 121, 229, 227, 795, 541, 3727, 4333, 2251, 27833, 43567, 82505, 230427}}, {18609, 18, 87313, {1, 1, 5, 13, 29, 19, 119, 63, 207, 945, 761, 2601, 1391, 8939, 11683, 52433, 63301, 82501}}, {18610, 18, 87323, {1, 3, 7, 1, 3, 57, 127, 115, 209, 31, 1631, 347, 3937, 4015, 13313, 49507, 15103, 237071}}, {18611, 18, 87332, {1, 3, 1, 13, 3, 25, 85, 151, 115, 385, 303, 2453, 2417, 8051, 1447, 59517, 3711, 160345}}, {18612, 18, 87361, {1, 3, 1, 13, 1, 23, 49, 75, 117, 295, 1737, 2091, 6229, 3157, 32737, 13751, 101667, 96261}}, {18613, 18, 87376, {1, 3, 3, 5, 27, 19, 103, 201, 65, 757, 1847, 239, 2185, 15139, 8883, 17737, 9207, 147663}}, {18614, 18, 87392, {1, 3, 1, 9, 3, 39, 51, 1, 419, 929, 1049, 2891, 2585, 2759, 27587, 55711, 15461, 46851}}, {18615, 18, 87419, {1, 1, 5, 3, 23, 23, 23, 101, 249, 997, 1889, 2293, 5693, 939, 29619, 2775, 49293, 168895}}, {18616, 18, 87432, {1, 3, 1, 15, 9, 63, 17, 97, 385, 517, 1737, 713, 157, 2597, 20889, 35209, 47525, 14389}}, {18617, 18, 87435, {1, 3, 1, 1, 7, 27, 9, 147, 349, 493, 341, 2699, 7743, 4283, 24691, 11881, 78619, 153899}}, {18618, 18, 87445, {1, 3, 1, 9, 15, 25, 103, 177, 485, 355, 1319, 767, 6675, 3425, 7187, 53767, 92023, 151523}}, {18619, 18, 87466, {1, 1, 3, 3, 15, 35, 25, 177, 295, 5, 661, 3651, 2597, 16229, 1343, 54941, 72047, 169155}}, {18620, 18, 87491, {1, 1, 1, 1, 19, 29, 63, 229, 79, 551, 1401, 2851, 6935, 12485, 9243, 21671, 54209, 105347}}, {18621, 18, 87503, {1, 1, 3, 1, 13, 33, 53, 125, 261, 623, 65, 3863, 1899, 2453, 16483, 48655, 50771, 248555}}, {18622, 18, 87558, {1, 3, 5, 7, 25, 15, 107, 149, 485, 247, 1977, 3125, 4663, 4925, 15749, 39429, 52315, 30545}}, {18623, 18, 87570, {1, 1, 7, 13, 23, 13, 127, 111, 9, 17, 1887, 1341, 3017, 14333, 6003, 35113, 14935, 17593}}, {18624, 18, 87581, {1, 1, 1, 15, 23, 17, 111, 43, 71, 549, 1369, 1711, 3903, 13605, 14573, 18973, 28157, 128421}}, {18625, 18, 87603, {1, 1, 7, 15, 27, 23, 5, 99, 87, 865, 1979, 3287, 3977, 14989, 17439, 14593, 92711, 211259}}, {18626, 18, 87615, {1, 3, 3, 15, 5, 19, 3, 231, 127, 863, 1537, 369, 7915, 10281, 13925, 12931, 3905, 178609}}, {18627, 18, 87623, {1, 1, 3, 15, 13, 5, 17, 217, 383, 251, 1701, 3379, 8157, 4991, 8563, 24611, 66081, 205775}}, {18628, 18, 87635, {1, 3, 7, 11, 9, 25, 73, 131, 217, 601, 843, 807, 4509, 16209, 29581, 50869, 56595, 14283}}, {18629, 18, 87647, {1, 3, 5, 9, 5, 59, 57, 153, 359, 775, 859, 1897, 6415, 7389, 10851, 64247, 21627, 145017}}, {18630, 18, 87651, {1, 3, 7, 1, 27, 11, 117, 179, 175, 343, 687, 2775, 3655, 11655, 2641, 355, 83447, 237799}}, {18631, 18, 87657, {1, 1, 7, 11, 17, 59, 91, 21, 403, 797, 1839, 525, 3279, 6575, 30083, 12503, 83057, 109465}}, {18632, 18, 87665, {1, 3, 7, 1, 25, 27, 41, 223, 169, 679, 699, 3287, 6305, 6459, 23145, 45519, 127487, 183563}}, {18633, 18, 87694, {1, 3, 3, 1, 9, 45, 105, 57, 185, 97, 899, 3113, 7081, 7057, 14559, 53537, 105623, 155399}}, {18634, 18, 87701, {1, 3, 7, 5, 17, 35, 89, 13, 87, 587, 451, 4079, 1005, 4311, 15861, 49977, 59653, 12107}}, {18635, 18, 87705, {1, 3, 7, 3, 19, 55, 43, 77, 317, 369, 71, 937, 1905, 5005, 17715, 4005, 55445, 25159}}, {18636, 18, 87722, {1, 1, 7, 15, 15, 51, 87, 37, 59, 755, 763, 455, 711, 13399, 30999, 61269, 66037, 202793}}, {18637, 18, 87739, {1, 1, 3, 5, 11, 57, 111, 135, 325, 553, 273, 1533, 3431, 6427, 24771, 42143, 56711, 220873}}, {18638, 18, 87750, {1, 1, 1, 13, 3, 49, 53, 81, 491, 177, 1543, 1847, 7907, 7817, 15417, 9897, 101597, 160195}}, {18639, 18, 87790, {1, 3, 1, 15, 19, 15, 91, 123, 365, 113, 129, 3371, 5789, 13553, 6887, 62317, 84269, 44777}}, {18640, 18, 87795, {1, 3, 7, 13, 15, 63, 43, 175, 449, 437, 597, 1371, 5101, 13797, 28025, 15809, 7645, 21169}}, {18641, 18, 87797, {1, 1, 7, 13, 23, 63, 105, 69, 219, 153, 1539, 1537, 6899, 9363, 27459, 34551, 62563, 236679}}, {18642, 18, 87816, {1, 3, 7, 3, 9, 33, 3, 101, 135, 571, 127, 3881, 7017, 13403, 13817, 55167, 8645, 471}}, {18643, 18, 87884, {1, 3, 3, 13, 7, 53, 29, 89, 473, 135, 639, 3137, 93, 965, 4867, 58265, 114963, 175295}}, {18644, 18, 87917, {1, 3, 1, 1, 9, 11, 45, 123, 129, 441, 1601, 39, 4657, 3701, 29581, 16045, 57173, 75195}}, {18645, 18, 87930, {1, 1, 3, 11, 7, 21, 9, 73, 25, 891, 1625, 3019, 223, 14351, 30621, 3075, 79051, 178127}}, {18646, 18, 87942, {1, 1, 7, 3, 7, 43, 69, 209, 9, 857, 1539, 2629, 5277, 14583, 16443, 28275, 54143, 206479}}, {18647, 18, 87953, {1, 3, 5, 9, 27, 15, 109, 237, 323, 103, 837, 597, 3609, 6249, 795, 37191, 20997, 142079}}, {18648, 18, 87954, {1, 1, 3, 1, 27, 33, 123, 191, 55, 531, 1707, 2633, 6717, 9645, 21377, 51593, 9017, 178185}}, {18649, 18, 87984, {1, 1, 5, 15, 3, 3, 67, 225, 229, 161, 2039, 1499, 873, 8803, 29901, 58809, 35625, 207797}}, {18650, 18, 87989, {1, 3, 3, 7, 3, 47, 99, 237, 221, 31, 1043, 1081, 837, 1617, 17323, 43879, 55615, 238537}}, {18651, 18, 88008, {1, 3, 7, 1, 17, 37, 45, 211, 245, 657, 221, 1067, 1683, 16127, 585, 9067, 25935, 162469}}, {18652, 18, 88016, {1, 1, 5, 9, 23, 27, 5, 237, 137, 227, 129, 279, 4171, 5963, 349, 12387, 40701, 177255}}, {18653, 18, 88038, {1, 3, 7, 15, 17, 11, 95, 69, 49, 901, 509, 2541, 3001, 15501, 24235, 39863, 95381, 260793}}, {18654, 18, 88042, {1, 3, 3, 3, 29, 3, 125, 3, 423, 609, 1401, 2337, 1093, 11419, 29735, 9033, 115977, 210201}}, {18655, 18, 88044, {1, 1, 1, 9, 11, 21, 71, 33, 399, 1005, 1691, 1501, 2585, 7361, 21527, 7535, 87091, 192319}}, {18656, 18, 88049, {1, 1, 1, 11, 5, 49, 65, 115, 239, 255, 381, 2803, 3447, 5775, 18243, 16545, 108901, 81355}}, {18657, 18, 88083, {1, 3, 7, 15, 31, 5, 81, 213, 281, 903, 189, 1807, 3551, 4423, 3591, 27449, 71659, 255357}}, {18658, 18, 88119, {1, 1, 1, 15, 11, 1, 25, 213, 259, 215, 435, 3531, 4889, 9509, 21391, 21589, 89871, 85895}}, {18659, 18, 88134, {1, 3, 3, 9, 29, 29, 37, 127, 419, 631, 1793, 1547, 1463, 13265, 17233, 24627, 3687, 174179}}, {18660, 18, 88138, {1, 1, 1, 7, 27, 61, 105, 135, 439, 161, 721, 2779, 6731, 14575, 4565, 25869, 38981, 191683}}, {18661, 18, 88143, {1, 1, 7, 13, 21, 41, 43, 5, 313, 407, 505, 231, 5023, 8971, 15825, 38461, 38797, 136027}}, {18662, 18, 88191, {1, 3, 7, 3, 7, 59, 11, 255, 327, 843, 1179, 889, 4505, 10891, 7901, 14485, 72297, 255985}}, {18663, 18, 88216, {1, 1, 5, 3, 9, 37, 89, 59, 413, 51, 515, 4009, 6501, 8443, 14381, 60917, 43567, 234431}}, {18664, 18, 88231, {1, 1, 3, 9, 9, 57, 65, 205, 367, 935, 1975, 2561, 225, 12529, 4721, 56659, 87901, 219641}}, {18665, 18, 88232, {1, 3, 7, 15, 23, 55, 61, 15, 89, 267, 1245, 2703, 7471, 10499, 19, 19357, 72413, 199289}}, {18666, 18, 88297, {1, 1, 1, 13, 1, 29, 65, 11, 353, 509, 1831, 2181, 5265, 14761, 913, 17109, 113613, 37143}}, {18667, 18, 88300, {1, 1, 7, 5, 17, 37, 97, 249, 169, 223, 475, 2091, 3101, 8541, 325, 42359, 16121, 151739}}, {18668, 18, 88308, {1, 1, 3, 13, 1, 45, 13, 209, 395, 215, 15, 2287, 5365, 9887, 29799, 51957, 97483, 109467}}, {18669, 18, 88317, {1, 3, 7, 1, 9, 35, 91, 51, 387, 833, 783, 2483, 3743, 6155, 5881, 3047, 86191, 151867}}, {18670, 18, 88344, {1, 1, 1, 7, 15, 25, 13, 3, 119, 333, 761, 3459, 2555, 15737, 12945, 15225, 45487, 78235}}, {18671, 18, 88350, {1, 3, 1, 3, 13, 55, 111, 45, 121, 593, 633, 2705, 1653, 13275, 13533, 3559, 100573, 124363}}, {18672, 18, 88371, {1, 1, 3, 1, 29, 49, 65, 69, 133, 667, 653, 2559, 6335, 8019, 9251, 5415, 90125, 197413}}, {18673, 18, 88469, {1, 1, 1, 7, 23, 53, 99, 149, 39, 453, 129, 185, 1143, 12799, 23339, 41293, 94023, 105581}}, {18674, 18, 88483, {1, 3, 3, 13, 5, 3, 5, 215, 425, 455, 421, 3815, 5983, 3851, 19569, 17363, 6411, 60037}}, {18675, 18, 88485, {1, 3, 7, 1, 29, 7, 63, 207, 299, 17, 1915, 2041, 8129, 661, 32481, 55475, 72027, 239683}}, {18676, 18, 88518, {1, 1, 5, 13, 29, 11, 39, 177, 177, 479, 1291, 3931, 4353, 327, 7827, 9529, 6967, 6469}}, {18677, 18, 88586, {1, 1, 5, 3, 25, 39, 121, 15, 7, 715, 583, 3997, 1373, 7747, 1777, 7269, 105333, 201511}}, {18678, 18, 88605, {1, 3, 3, 9, 11, 7, 81, 109, 129, 359, 1281, 1163, 4895, 10303, 17801, 43461, 120271, 173027}}, {18679, 18, 88621, {1, 3, 5, 1, 23, 59, 123, 75, 505, 925, 637, 1713, 995, 14031, 13711, 62569, 90553, 242345}}, {18680, 18, 88651, {1, 3, 3, 15, 19, 11, 39, 203, 229, 619, 735, 1367, 4963, 5263, 30229, 17847, 9623, 3277}}, {18681, 18, 88656, {1, 1, 7, 13, 5, 27, 23, 223, 377, 335, 1821, 2481, 4111, 10373, 18423, 7237, 75225, 223433}}, {18682, 18, 88665, {1, 3, 7, 1, 21, 19, 71, 107, 19, 703, 945, 3831, 1099, 6267, 17489, 27665, 8861, 127499}}, {18683, 18, 88668, {1, 3, 5, 1, 19, 49, 117, 181, 245, 939, 1279, 3127, 4427, 3061, 23399, 64805, 43077, 100789}}, {18684, 18, 88712, {1, 1, 3, 3, 31, 55, 53, 205, 97, 645, 215, 2617, 7419, 7159, 27373, 62341, 58121, 248677}}, {18685, 18, 88717, {1, 1, 7, 5, 15, 41, 99, 75, 201, 187, 197, 3773, 3097, 6803, 5307, 31375, 26743, 142723}}, {18686, 18, 88751, {1, 3, 5, 11, 23, 61, 127, 15, 89, 245, 1345, 1305, 5937, 15917, 23867, 50319, 91921, 248663}}, {18687, 18, 88754, {1, 1, 3, 9, 27, 7, 1, 75, 181, 155, 1947, 577, 2975, 8855, 5295, 43403, 112497, 100679}}, {18688, 18, 88756, {1, 1, 1, 11, 29, 61, 35, 241, 207, 73, 1747, 1797, 3665, 14275, 25359, 28685, 79367, 81819}}, {18689, 18, 88785, {1, 3, 5, 9, 11, 1, 37, 79, 431, 157, 1979, 159, 3087, 1731, 26141, 31411, 56457, 94293}}, {18690, 18, 88801, {1, 3, 7, 1, 17, 35, 107, 243, 279, 79, 227, 1275, 761, 11485, 22181, 16415, 68801, 4577}}, {18691, 18, 88807, {1, 3, 1, 9, 21, 43, 115, 131, 129, 123, 1677, 1875, 7355, 15927, 845, 24101, 48985, 39703}}, {18692, 18, 88826, {1, 1, 7, 3, 17, 25, 105, 189, 317, 109, 1629, 3103, 615, 1047, 621, 62743, 43631, 9811}}, {18693, 18, 88848, {1, 3, 1, 3, 3, 45, 49, 73, 383, 761, 685, 3211, 3855, 16307, 30469, 1393, 52535, 165503}}, {18694, 18, 88854, {1, 3, 5, 15, 1, 41, 89, 105, 213, 33, 1477, 711, 4823, 503, 12533, 56781, 42825, 223399}}, {18695, 18, 88864, {1, 3, 5, 9, 17, 45, 63, 113, 359, 927, 1467, 2811, 4275, 5193, 6023, 32689, 87747, 234697}}, {18696, 18, 88879, {1, 1, 3, 1, 21, 49, 73, 157, 97, 915, 1689, 3289, 7515, 10759, 32253, 63175, 66175, 125813}}, {18697, 18, 88939, {1, 1, 1, 5, 19, 1, 127, 229, 453, 617, 511, 1515, 3815, 3125, 26851, 31635, 35389, 237483}}, {18698, 18, 88947, {1, 1, 1, 13, 27, 61, 75, 23, 289, 133, 975, 3217, 3777, 12095, 15235, 33845, 125503, 88417}}, {18699, 18, 88987, {1, 1, 3, 13, 27, 49, 29, 115, 221, 995, 1305, 2717, 2243, 13391, 20841, 863, 63195, 46829}}, {18700, 18, 88990, {1, 3, 1, 11, 31, 49, 43, 163, 503, 123, 657, 1285, 3695, 8401, 17087, 48289, 3947, 41495}}, {18701, 18, 88996, {1, 3, 7, 9, 21, 17, 125, 75, 395, 979, 781, 2501, 6511, 4619, 28943, 18295, 87547, 196289}}, {18702, 18, 89008, {1, 3, 3, 5, 3, 39, 107, 199, 7, 331, 77, 511, 5787, 3155, 29605, 44633, 51041, 89141}}, {18703, 18, 89011, {1, 1, 3, 7, 11, 37, 79, 69, 181, 623, 299, 2321, 4371, 7449, 3137, 25753, 116673, 30441}}, {18704, 18, 89043, {1, 1, 5, 9, 11, 13, 49, 207, 179, 671, 1469, 1005, 6887, 12203, 9365, 62455, 36283, 42053}}, {18705, 18, 89045, {1, 3, 1, 1, 7, 31, 115, 79, 435, 101, 1525, 3695, 3229, 11401, 23959, 62055, 37725, 219753}}, {18706, 18, 89050, {1, 3, 3, 7, 25, 49, 123, 161, 275, 291, 255, 2247, 4271, 10771, 2449, 26343, 61169, 30691}}, {18707, 18, 89097, {1, 1, 7, 1, 15, 3, 11, 15, 125, 1021, 1817, 417, 2721, 13985, 19039, 451, 32559, 199407}}, {18708, 18, 89100, {1, 1, 5, 15, 11, 25, 23, 101, 427, 431, 1353, 1957, 3529, 513, 11937, 14469, 89539, 242015}}, {18709, 18, 89106, {1, 1, 5, 13, 27, 5, 107, 29, 469, 3, 1427, 1949, 7007, 16339, 3375, 63545, 100739, 229487}}, {18710, 18, 89134, {1, 3, 5, 13, 15, 17, 59, 213, 417, 557, 11, 811, 5041, 4133, 25735, 46807, 65669, 148081}}, {18711, 18, 89178, {1, 1, 5, 13, 9, 47, 35, 173, 277, 805, 1249, 3707, 1079, 2833, 29383, 58995, 21005, 181567}}, {18712, 18, 89189, {1, 3, 5, 1, 5, 25, 125, 45, 157, 291, 1329, 3317, 2311, 9919, 31001, 65127, 19451, 117621}}, {18713, 18, 89202, {1, 1, 5, 9, 31, 21, 9, 193, 23, 879, 699, 1135, 7151, 8635, 20711, 45207, 67047, 4397}}, {18714, 18, 89211, {1, 3, 1, 11, 11, 49, 119, 129, 409, 491, 463, 833, 3661, 607, 25961, 6061, 12747, 160337}}, {18715, 18, 89224, {1, 3, 1, 15, 31, 35, 93, 95, 239, 695, 1113, 2371, 2625, 10371, 10781, 46209, 67051, 109923}}, {18716, 18, 89241, {1, 3, 5, 9, 5, 61, 25, 19, 99, 159, 55, 43, 3679, 1023, 17951, 44841, 101653, 195955}}, {18717, 18, 89251, {1, 1, 3, 11, 19, 45, 99, 47, 407, 115, 353, 3537, 7147, 5837, 27309, 44539, 30227, 93183}}, {18718, 18, 89254, {1, 1, 7, 15, 13, 59, 83, 215, 79, 865, 269, 2999, 2415, 10631, 23655, 51583, 46105, 43965}}, {18719, 18, 89258, {1, 3, 7, 5, 17, 1, 7, 119, 501, 25, 1097, 3639, 7017, 381, 4793, 37263, 60431, 77323}}, {18720, 18, 89295, {1, 3, 7, 13, 1, 37, 99, 103, 459, 853, 5, 3093, 6167, 14497, 7003, 36979, 71919, 64823}}, {18721, 18, 89328, {1, 3, 7, 5, 23, 7, 37, 255, 297, 115, 113, 579, 4561, 5245, 11173, 28645, 23989, 240777}}, {18722, 18, 89357, {1, 3, 5, 9, 29, 47, 43, 145, 481, 251, 737, 2531, 2425, 529, 3953, 13229, 35933, 187855}}, {18723, 18, 89403, {1, 3, 1, 15, 15, 15, 29, 73, 405, 91, 1399, 3599, 1517, 11075, 11265, 22817, 26619, 1183}}, {18724, 18, 89420, {1, 1, 5, 15, 21, 47, 93, 33, 47, 527, 877, 3453, 3867, 4007, 32503, 11789, 68333, 187419}}, {18725, 18, 89426, {1, 1, 3, 13, 5, 3, 99, 21, 17, 779, 541, 3919, 1339, 13507, 28965, 61145, 50421, 192319}}, {18726, 18, 89465, {1, 1, 3, 7, 31, 63, 17, 9, 331, 681, 515, 1067, 351, 2471, 31271, 36015, 72911, 32383}}, {18727, 18, 89471, {1, 1, 3, 7, 1, 55, 97, 211, 409, 499, 1207, 2405, 2291, 1373, 1263, 65303, 38655, 159965}}, {18728, 18, 89475, {1, 1, 1, 5, 23, 11, 21, 23, 35, 19, 1699, 2325, 6117, 14971, 32327, 31369, 28061, 112819}}, {18729, 18, 89547, {1, 3, 3, 13, 29, 63, 19, 201, 173, 395, 1437, 369, 7045, 14347, 5393, 11311, 28415, 161019}}, {18730, 18, 89549, {1, 3, 1, 5, 31, 15, 101, 13, 97, 865, 1063, 2129, 811, 3337, 7585, 54803, 122099, 149531}}, {18731, 18, 89558, {1, 3, 3, 13, 19, 5, 47, 13, 497, 683, 1197, 3509, 4375, 3353, 31847, 283, 95281, 7975}}, {18732, 18, 89564, {1, 1, 7, 5, 25, 19, 59, 105, 167, 775, 581, 2679, 3003, 9345, 20209, 31487, 25357, 226341}}, {18733, 18, 89611, {1, 1, 5, 5, 31, 61, 13, 77, 189, 141, 1157, 609, 7245, 15303, 32743, 50229, 67391, 173977}}, {18734, 18, 89616, {1, 3, 7, 13, 17, 11, 49, 135, 475, 303, 1373, 1437, 6119, 1729, 21347, 31643, 86523, 41223}}, {18735, 18, 89626, {1, 3, 7, 13, 3, 19, 103, 53, 209, 281, 77, 2009, 7911, 8549, 17655, 33165, 9685, 2289}}, {18736, 18, 89650, {1, 3, 3, 9, 5, 31, 71, 113, 93, 255, 165, 3465, 6769, 13047, 20701, 33669, 22537, 175209}}, {18737, 18, 89691, {1, 3, 1, 1, 15, 59, 89, 227, 275, 451, 869, 1865, 1327, 3895, 5459, 47997, 34287, 95343}}, {18738, 18, 89718, {1, 3, 7, 13, 27, 1, 25, 99, 475, 421, 693, 1955, 4017, 16037, 29915, 52415, 99913, 59151}}, {18739, 18, 89764, {1, 3, 5, 1, 9, 61, 107, 149, 465, 1003, 891, 2387, 407, 5851, 6287, 56401, 109693, 72035}}, {18740, 18, 89776, {1, 1, 1, 11, 25, 53, 101, 125, 35, 949, 1019, 3087, 2785, 11271, 25623, 57313, 115683, 101923}}, {18741, 18, 89785, {1, 3, 5, 13, 19, 13, 97, 147, 149, 483, 1727, 1771, 2089, 8661, 28223, 30437, 42565, 13261}}, {18742, 18, 89813, {1, 3, 3, 11, 17, 9, 13, 13, 419, 531, 1617, 1459, 411, 9953, 25581, 30305, 120721, 81113}}, {18743, 18, 89817, {1, 3, 3, 9, 9, 9, 83, 35, 367, 981, 911, 1915, 4937, 16187, 20441, 30433, 107605, 119939}}, {18744, 18, 89861, {1, 3, 7, 11, 11, 47, 31, 7, 141, 905, 1753, 3069, 47, 7347, 10517, 19515, 126827, 68669}}, {18745, 18, 89876, {1, 3, 3, 9, 17, 33, 121, 159, 265, 389, 261, 2479, 7705, 6453, 31963, 14123, 100201, 77235}}, {18746, 18, 89889, {1, 1, 5, 5, 13, 63, 3, 1, 107, 383, 633, 2183, 1437, 14525, 29315, 3277, 2153, 204061}}, {18747, 18, 89904, {1, 3, 3, 3, 17, 9, 47, 173, 17, 413, 451, 1127, 1807, 5265, 32543, 8215, 123601, 138777}}, {18748, 18, 89939, {1, 3, 1, 1, 7, 57, 93, 29, 101, 955, 1445, 4017, 2853, 3551, 22173, 40355, 34687, 133063}}, {18749, 18, 89948, {1, 1, 5, 11, 19, 15, 95, 177, 49, 971, 15, 2293, 2627, 7841, 2103, 64331, 60481, 182431}}, {18750, 18, 89952, {1, 3, 1, 15, 25, 57, 47, 85, 485, 11, 1669, 995, 6939, 4125, 19513, 62397, 62645, 82213}}, {18751, 18, 89964, {1, 1, 1, 11, 1, 37, 101, 157, 17, 261, 997, 817, 2195, 4141, 10505, 60685, 98165, 167391}}, {18752, 18, 89969, {1, 1, 1, 1, 31, 9, 103, 97, 161, 13, 1043, 307, 7321, 671, 12417, 58661, 23031, 207833}}, {18753, 18, 89979, {1, 1, 7, 9, 15, 49, 69, 117, 93, 95, 507, 393, 6169, 2111, 27179, 47217, 93699, 67315}}, {18754, 18, 90009, {1, 3, 7, 1, 23, 41, 115, 125, 343, 615, 397, 1199, 3041, 11019, 1071, 51069, 75757, 245765}}, {18755, 18, 90022, {1, 1, 1, 13, 7, 15, 111, 239, 29, 419, 203, 2395, 3995, 13, 32341, 17471, 53259, 3317}}, {18756, 18, 90031, {1, 3, 1, 11, 29, 27, 15, 217, 17, 163, 1847, 3549, 4911, 4539, 4927, 57157, 44893, 41669}}, {18757, 18, 90043, {1, 1, 7, 7, 25, 15, 101, 149, 433, 717, 1827, 3837, 4565, 14521, 28857, 27775, 117429, 136131}}, {18758, 18, 90045, {1, 1, 1, 3, 25, 35, 85, 3, 381, 253, 375, 3967, 3101, 12727, 31739, 48885, 35821, 92229}}, {18759, 18, 90068, {1, 3, 3, 7, 29, 5, 51, 157, 67, 467, 1957, 3453, 1353, 4839, 25379, 42731, 109385, 52479}}, {18760, 18, 90071, {1, 3, 7, 13, 3, 55, 61, 73, 257, 313, 89, 2557, 7467, 2223, 2951, 49265, 126605, 72007}}, {18761, 18, 90082, {1, 3, 7, 5, 5, 11, 83, 3, 347, 63, 479, 529, 5059, 7029, 20523, 58387, 44891, 168921}}, {18762, 18, 90087, {1, 3, 1, 11, 3, 51, 99, 5, 161, 279, 1509, 3659, 3107, 13925, 5117, 46153, 48731, 69767}}, {18763, 18, 90117, {1, 1, 5, 5, 3, 53, 49, 243, 383, 401, 1205, 975, 3305, 12769, 25533, 28733, 115161, 160885}}, {18764, 18, 90127, {1, 1, 1, 7, 15, 5, 43, 143, 493, 527, 1625, 2115, 3929, 12425, 16127, 25045, 55973, 202359}}, {18765, 18, 90163, {1, 3, 7, 7, 11, 9, 69, 79, 417, 941, 473, 1655, 5763, 9889, 22443, 12153, 103489, 74737}}, {18766, 18, 90166, {1, 1, 7, 9, 27, 31, 97, 253, 199, 99, 1955, 1481, 2509, 11923, 6337, 15899, 122515, 244721}}, {18767, 18, 90177, {1, 1, 5, 13, 29, 15, 35, 177, 261, 613, 1279, 2837, 2945, 4501, 22865, 36893, 51979, 245569}}, {18768, 18, 90211, {1, 1, 5, 9, 21, 5, 85, 5, 303, 165, 681, 3965, 2575, 1493, 10367, 55845, 92139, 92539}}, {18769, 18, 90218, {1, 3, 5, 1, 23, 49, 49, 161, 481, 181, 1991, 1845, 4541, 14187, 10893, 64931, 79943, 57907}}, {18770, 18, 90225, {1, 3, 1, 5, 11, 27, 19, 193, 371, 463, 1573, 271, 1127, 15091, 9967, 40337, 104163, 159339}}, {18771, 18, 90231, {1, 3, 1, 3, 13, 3, 57, 149, 465, 789, 1155, 2223, 2007, 13987, 19057, 40447, 5217, 86191}}, {18772, 18, 90235, {1, 3, 5, 5, 9, 45, 27, 155, 95, 171, 489, 2539, 843, 16125, 7047, 58541, 84641, 212013}}, {18773, 18, 90289, {1, 3, 5, 13, 13, 53, 101, 159, 7, 481, 143, 3869, 6629, 3527, 1555, 6019, 155, 230157}}, {18774, 18, 90344, {1, 3, 1, 1, 19, 59, 59, 129, 107, 887, 1595, 93, 6577, 3947, 14409, 31081, 68595, 226741}}, {18775, 18, 90347, {1, 3, 3, 11, 13, 49, 81, 253, 363, 875, 489, 2181, 3487, 1615, 31157, 32949, 44809, 119421}}, {18776, 18, 90379, {1, 1, 3, 1, 3, 19, 71, 93, 397, 521, 2015, 3829, 3013, 3941, 29437, 1959, 70283, 254361}}, {18777, 18, 90387, {1, 3, 1, 3, 27, 11, 95, 39, 299, 521, 389, 3451, 3047, 8637, 22537, 11279, 67407, 101511}}, {18778, 18, 90418, {1, 3, 1, 1, 27, 43, 123, 237, 315, 503, 1059, 2185, 3963, 1593, 19157, 13909, 58025, 91649}}, {18779, 18, 90435, {1, 1, 7, 1, 5, 19, 79, 109, 459, 541, 521, 89, 389, 13499, 9769, 1429, 117357, 153261}}, {18780, 18, 90444, {1, 1, 5, 3, 9, 29, 21, 97, 219, 915, 2013, 1955, 1015, 549, 9777, 5005, 110953, 16915}}, {18781, 18, 90472, {1, 1, 1, 9, 29, 11, 103, 167, 465, 515, 843, 151, 769, 12033, 9451, 14949, 110075, 113947}}, {18782, 18, 90478, {1, 3, 5, 1, 21, 1, 105, 49, 35, 737, 231, 2761, 1519, 9997, 601, 20883, 42575, 98081}}, {18783, 18, 90485, {1, 1, 1, 5, 13, 63, 47, 171, 187, 407, 643, 1423, 6325, 10079, 23781, 36353, 20655, 10231}}, {18784, 18, 90486, {1, 1, 7, 13, 13, 13, 91, 31, 19, 305, 505, 1937, 2683, 10791, 7719, 54797, 9405, 195819}}, {18785, 18, 90513, {1, 1, 1, 7, 17, 9, 21, 211, 85, 851, 211, 1533, 4035, 11, 26873, 16755, 77809, 44603}}, {18786, 18, 90514, {1, 1, 3, 1, 29, 47, 31, 141, 9, 881, 1229, 1261, 3747, 4603, 22177, 48937, 21435, 157029}}, {18787, 18, 90532, {1, 1, 1, 9, 11, 35, 109, 187, 319, 863, 1339, 2193, 4147, 3721, 7243, 18295, 92461, 88875}}, {18788, 18, 90567, {1, 1, 1, 1, 25, 41, 79, 191, 47, 819, 2013, 3133, 2763, 9231, 10343, 49693, 26753, 97465}}, {18789, 18, 90595, {1, 3, 1, 3, 17, 25, 63, 139, 179, 113, 1681, 1997, 4561, 14453, 30721, 7053, 22937, 183303}}, {18790, 18, 90597, {1, 1, 7, 3, 29, 11, 41, 157, 427, 887, 295, 443, 5593, 8633, 9757, 37595, 121655, 135739}}, {18791, 18, 90621, {1, 3, 1, 7, 29, 5, 23, 231, 85, 67, 103, 1395, 7821, 9551, 17019, 1825, 69963, 254583}}, {18792, 18, 90631, {1, 1, 7, 9, 7, 23, 7, 205, 17, 111, 1219, 3101, 7485, 11579, 11791, 10203, 119835, 175985}}, {18793, 18, 90668, {1, 3, 3, 13, 3, 57, 101, 255, 331, 911, 491, 3929, 2519, 2185, 21107, 24599, 92831, 75001}}, {18794, 18, 90706, {1, 3, 7, 1, 23, 53, 69, 229, 295, 881, 905, 3727, 3885, 7967, 2061, 53595, 16033, 36443}}, {18795, 18, 90708, {1, 1, 7, 15, 21, 1, 127, 115, 191, 53, 929, 1093, 5447, 1665, 4409, 22611, 38157, 139201}}, {18796, 18, 90715, {1, 3, 3, 13, 29, 31, 113, 215, 365, 41, 1977, 2839, 4147, 8321, 1361, 45717, 80505, 176631}}, {18797, 18, 90724, {1, 3, 5, 3, 3, 57, 25, 81, 41, 229, 669, 3371, 7505, 1197, 14921, 34365, 67571, 27355}}, {18798, 18, 90769, {1, 3, 7, 9, 17, 35, 7, 169, 13, 163, 2007, 3697, 5635, 8003, 26105, 62917, 19349, 47029}}, {18799, 18, 90791, {1, 1, 5, 5, 29, 27, 89, 137, 69, 189, 871, 3139, 6383, 14955, 15349, 60447, 122291, 26541}}, {18800, 18, 90792, {1, 1, 7, 13, 27, 49, 115, 111, 441, 865, 1397, 161, 755, 14461, 8601, 45533, 105309, 149799}}, {18801, 18, 90805, {1, 1, 7, 3, 9, 29, 91, 5, 239, 605, 491, 1705, 4099, 9111, 19821, 56903, 62815, 40615}}, {18802, 18, 90810, {1, 1, 7, 15, 5, 45, 71, 225, 211, 539, 1881, 1201, 5675, 6061, 12121, 13289, 30455, 33131}}, {18803, 18, 90820, {1, 1, 5, 15, 5, 59, 35, 121, 185, 143, 165, 2999, 7907, 5035, 8337, 11951, 66403, 219997}}, {18804, 18, 90844, {1, 1, 5, 9, 3, 7, 27, 129, 245, 93, 715, 1249, 1717, 13381, 31255, 23153, 22227, 8077}}, {18805, 18, 90907, {1, 3, 5, 11, 19, 49, 21, 163, 157, 615, 1475, 2453, 6315, 12325, 26565, 58399, 49385, 252127}}, {18806, 18, 90925, {1, 3, 7, 11, 23, 3, 35, 61, 409, 795, 1447, 3461, 535, 6533, 25757, 31783, 9509, 217589}}, {18807, 18, 90926, {1, 1, 5, 15, 9, 21, 67, 65, 399, 515, 777, 3183, 1155, 16071, 7339, 59985, 56659, 200701}}, {18808, 18, 90934, {1, 3, 3, 1, 15, 33, 119, 145, 71, 517, 1775, 163, 5307, 1549, 31071, 56289, 128395, 230381}}, {18809, 18, 90946, {1, 3, 1, 7, 7, 47, 97, 187, 193, 887, 515, 1301, 4841, 12069, 413, 41503, 36421, 45909}}, {18810, 18, 90981, {1, 1, 5, 3, 17, 21, 53, 227, 137, 865, 715, 3601, 5027, 2983, 24113, 23349, 106391, 188193}}, {18811, 18, 90999, {1, 3, 7, 15, 29, 37, 91, 235, 351, 15, 425, 681, 187, 1517, 30079, 41347, 49691, 66369}}, {18812, 18, 91003, {1, 1, 5, 5, 15, 25, 93, 245, 397, 517, 1635, 2475, 5543, 9597, 27721, 21475, 79571, 259011}}, {18813, 18, 91019, {1, 1, 1, 5, 21, 29, 5, 161, 37, 409, 1661, 3371, 5663, 4317, 9951, 23605, 7393, 90593}}, {18814, 18, 91022, {1, 1, 3, 15, 21, 51, 79, 159, 209, 891, 1391, 2895, 5003, 6601, 17983, 42359, 104497, 162181}}, {18815, 18, 91050, {1, 3, 7, 11, 23, 51, 99, 145, 21, 345, 1389, 1035, 5939, 8293, 22765, 23331, 7789, 115149}}, {18816, 18, 91055, {1, 1, 5, 11, 27, 61, 115, 123, 317, 607, 463, 779, 5121, 3861, 18761, 39407, 125837, 244163}}, {18817, 18, 91064, {1, 1, 7, 3, 15, 9, 33, 1, 437, 621, 31, 147, 8157, 3451, 18223, 61187, 125297, 211225}}, {18818, 18, 91078, {1, 3, 1, 11, 27, 55, 21, 251, 5, 57, 1889, 71, 3745, 499, 9043, 62683, 21945, 138615}}, {18819, 18, 91117, {1, 1, 3, 13, 25, 9, 1, 31, 277, 373, 507, 301, 2341, 1741, 11997, 47661, 44121, 183151}}, {18820, 18, 91120, {1, 3, 3, 5, 15, 51, 5, 233, 475, 397, 1833, 1267, 7025, 2593, 15425, 47053, 16205, 208007}}, {18821, 18, 91129, {1, 3, 3, 9, 31, 51, 123, 219, 493, 789, 659, 985, 7283, 11545, 15383, 25173, 130423, 196619}}, {18822, 18, 91140, {1, 1, 1, 15, 9, 17, 37, 145, 297, 933, 1019, 1699, 2149, 12391, 17003, 42157, 126283, 252231}}, {18823, 18, 91157, {1, 3, 5, 9, 17, 1, 91, 69, 335, 857, 925, 3855, 2225, 6909, 19101, 12191, 92117, 229077}}, {18824, 18, 91161, {1, 3, 5, 13, 5, 21, 67, 17, 307, 879, 1563, 3169, 745, 6799, 27237, 39621, 1413, 146295}}, {18825, 18, 91240, {1, 3, 7, 13, 17, 59, 23, 253, 415, 761, 451, 2773, 3523, 10985, 29853, 7275, 79521, 133447}}, {18826, 18, 91260, {1, 1, 1, 1, 15, 43, 89, 19, 85, 837, 1335, 1641, 105, 5429, 8317, 45555, 104447, 102313}}, {18827, 18, 91270, {1, 3, 3, 5, 17, 21, 67, 235, 367, 265, 1069, 835, 5457, 177, 26987, 39477, 6895, 123283}}, {18828, 18, 91287, {1, 1, 5, 15, 19, 61, 5, 15, 487, 291, 661, 825, 1569, 8795, 13035, 57077, 112847, 160267}}, {18829, 18, 91321, {1, 1, 7, 9, 27, 21, 91, 133, 361, 7, 447, 3035, 3523, 13167, 15927, 35555, 35713, 91291}}, {18830, 18, 91336, {1, 3, 7, 11, 17, 23, 77, 255, 437, 897, 1185, 1633, 6451, 13081, 29097, 61335, 39671, 177835}}, {18831, 18, 91341, {1, 1, 7, 5, 31, 49, 81, 221, 167, 241, 1895, 1813, 1493, 2475, 379, 5685, 116341, 121823}}, {18832, 18, 91378, {1, 3, 5, 9, 25, 11, 117, 253, 337, 381, 743, 69, 1641, 3649, 26335, 59683, 28729, 83449}}, {18833, 18, 91398, {1, 3, 1, 7, 15, 17, 59, 9, 129, 233, 1905, 1371, 6521, 8953, 26173, 9707, 70817, 260035}}, {18834, 18, 91437, {1, 3, 1, 5, 19, 53, 23, 255, 305, 835, 1387, 2947, 3013, 9117, 27571, 47123, 49881, 47229}}, {18835, 18, 91440, {1, 1, 3, 5, 23, 37, 123, 193, 365, 49, 1211, 3083, 8133, 14205, 11361, 55945, 23225, 159109}}, {18836, 18, 91475, {1, 1, 7, 11, 5, 49, 43, 165, 97, 581, 617, 3045, 6187, 8399, 24045, 46713, 28389, 156811}}, {18837, 18, 91494, {1, 3, 1, 5, 29, 17, 75, 231, 59, 143, 2041, 2319, 2289, 11805, 4039, 29895, 91305, 179091}}, {18838, 18, 91500, {1, 1, 7, 7, 29, 5, 13, 43, 409, 81, 751, 2157, 2543, 13317, 28275, 60871, 119833, 36743}}, {18839, 18, 91511, {1, 1, 5, 13, 5, 5, 21, 101, 497, 993, 157, 647, 3587, 1495, 20233, 30889, 112579, 172009}}, {18840, 18, 91567, {1, 1, 7, 13, 7, 19, 101, 217, 305, 897, 1305, 1693, 6881, 2415, 17373, 56327, 53971, 19021}}, {18841, 18, 91572, {1, 1, 7, 15, 31, 61, 93, 99, 459, 999, 239, 969, 2427, 12295, 23699, 4839, 73707, 110365}}, {18842, 18, 91601, {1, 3, 5, 9, 15, 59, 29, 35, 15, 331, 93, 529, 2651, 5675, 3039, 25967, 2907, 222053}}, {18843, 18, 91617, {1, 3, 3, 1, 1, 17, 59, 81, 495, 917, 1907, 3, 1989, 14339, 21311, 60909, 39393, 54115}}, {18844, 18, 91653, {1, 3, 1, 9, 1, 37, 31, 201, 251, 117, 1753, 2453, 5007, 6935, 1165, 49231, 51495, 200219}}, {18845, 18, 91678, {1, 1, 3, 3, 15, 47, 17, 175, 77, 363, 1455, 1417, 1357, 2295, 31165, 53337, 97891, 145621}}, {18846, 18, 91705, {1, 3, 3, 3, 27, 31, 41, 179, 47, 629, 5, 2543, 6817, 8953, 7151, 20715, 52363, 251037}}, {18847, 18, 91723, {1, 3, 1, 1, 21, 11, 103, 87, 285, 189, 1911, 2979, 7563, 13405, 2309, 25695, 106277, 179493}}, {18848, 18, 91725, {1, 1, 1, 5, 7, 19, 1, 233, 261, 825, 1071, 3529, 5617, 11207, 24559, 47461, 79753, 41009}}, {18849, 18, 91733, {1, 1, 3, 1, 15, 35, 65, 157, 381, 509, 1455, 3117, 31, 2251, 29729, 33687, 74999, 214765}}, {18850, 18, 91761, {1, 1, 7, 11, 31, 43, 11, 147, 509, 891, 1929, 357, 3905, 16251, 30169, 27787, 124003, 142587}}, {18851, 18, 91768, {1, 1, 7, 11, 3, 31, 93, 161, 311, 377, 1119, 2177, 4339, 3889, 24299, 35167, 87583, 145611}}, {18852, 18, 91790, {1, 1, 5, 9, 23, 9, 73, 85, 233, 919, 1319, 13, 3353, 1029, 31251, 17731, 86759, 11705}}, {18853, 18, 91804, {1, 1, 1, 7, 27, 23, 67, 235, 207, 161, 697, 2433, 833, 5305, 32695, 29327, 25285, 51289}}, {18854, 18, 91807, {1, 3, 3, 3, 31, 55, 107, 211, 61, 993, 1443, 463, 5029, 5401, 8821, 29721, 113939, 194839}}, {18855, 18, 91808, {1, 1, 1, 11, 11, 33, 39, 167, 17, 863, 363, 3967, 2277, 4053, 15403, 31887, 98565, 217953}}, {18856, 18, 91818, {1, 1, 7, 1, 21, 47, 97, 147, 155, 327, 1417, 3531, 7649, 8975, 21221, 57631, 72611, 97745}}, {18857, 18, 91840, {1, 3, 3, 1, 1, 63, 19, 91, 105, 991, 819, 673, 7845, 14947, 1633, 40517, 91525, 151041}}, {18858, 18, 91849, {1, 1, 7, 11, 25, 43, 57, 141, 65, 415, 1045, 3947, 7099, 11653, 29321, 51591, 2591, 44803}}, {18859, 18, 91869, {1, 3, 1, 9, 15, 19, 105, 37, 485, 3, 213, 1217, 951, 5637, 1589, 25501, 95073, 124683}}, {18860, 18, 91873, {1, 1, 5, 7, 13, 19, 55, 143, 507, 575, 715, 1633, 5201, 10493, 26041, 18407, 8097, 152313}}, {18861, 18, 91876, {1, 1, 3, 5, 9, 51, 5, 171, 143, 877, 1571, 2997, 4209, 13423, 9389, 23015, 6665, 254799}}, {18862, 18, 91888, {1, 3, 5, 15, 31, 43, 87, 79, 89, 463, 1075, 1257, 1631, 13225, 13529, 53267, 73651, 89125}}, {18863, 18, 91891, {1, 3, 7, 13, 23, 17, 93, 113, 45, 225, 1939, 3301, 6031, 9749, 16577, 12857, 68437, 169861}}, {18864, 18, 91897, {1, 3, 3, 15, 31, 11, 91, 127, 227, 813, 105, 901, 6861, 10627, 18425, 2553, 102503, 83167}}, {18865, 18, 91911, {1, 3, 3, 13, 17, 63, 83, 163, 451, 659, 1995, 2283, 6297, 8097, 20935, 6017, 4977, 5045}}, {18866, 18, 91965, {1, 1, 5, 13, 27, 47, 103, 129, 259, 975, 391, 2343, 6639, 1385, 30187, 35401, 74321, 24751}}, {18867, 18, 91971, {1, 3, 1, 13, 1, 57, 37, 65, 57, 413, 63, 3819, 5915, 3925, 20777, 48539, 3019, 54965}}, {18868, 18, 91988, {1, 1, 7, 3, 7, 13, 91, 33, 143, 489, 657, 3127, 707, 10841, 11307, 37855, 92697, 119189}}, {18869, 18, 91992, {1, 1, 3, 11, 25, 47, 11, 57, 463, 693, 55, 501, 3765, 15443, 12917, 61677, 97145, 213637}}, {18870, 18, 92004, {1, 3, 1, 1, 13, 49, 13, 225, 101, 475, 627, 1447, 7587, 11335, 3599, 20795, 72915, 174663}}, {18871, 18, 92021, {1, 3, 7, 5, 31, 15, 115, 255, 329, 365, 959, 3399, 4695, 14537, 1447, 17391, 88557, 130213}}, {18872, 18, 92035, {1, 1, 1, 9, 25, 47, 29, 173, 29, 149, 291, 691, 7621, 7607, 20769, 7149, 27323, 57689}}, {18873, 18, 92068, {1, 3, 5, 15, 3, 61, 119, 247, 25, 495, 1297, 1119, 8011, 16077, 21567, 30559, 88455, 68763}}, {18874, 18, 92098, {1, 1, 7, 1, 11, 47, 109, 115, 313, 517, 1951, 3319, 337, 11793, 22345, 33457, 47383, 213893}}, {18875, 18, 92104, {1, 1, 5, 11, 11, 53, 103, 237, 383, 927, 421, 4085, 3327, 169, 9941, 24753, 65437, 108173}}, {18876, 18, 92121, {1, 1, 5, 11, 17, 59, 107, 53, 479, 143, 825, 2667, 5219, 6143, 11573, 33637, 124981, 98195}}, {18877, 18, 92127, {1, 3, 3, 13, 3, 17, 61, 129, 475, 585, 1611, 1791, 7817, 4099, 20437, 51411, 130173, 220085}}, {18878, 18, 92151, {1, 3, 3, 3, 27, 25, 33, 255, 361, 967, 1415, 3213, 3341, 15875, 32359, 53267, 27665, 178301}}, {18879, 18, 92162, {1, 1, 5, 3, 13, 9, 91, 187, 173, 525, 1675, 2217, 4093, 2009, 16917, 18485, 104849, 163233}}, {18880, 18, 92186, {1, 1, 1, 11, 3, 17, 125, 157, 9, 429, 1573, 2257, 7943, 9893, 5611, 64619, 4509, 200181}}, {18881, 18, 92191, {1, 3, 1, 1, 3, 9, 83, 53, 315, 85, 1093, 2621, 663, 12369, 317, 6089, 16479, 225071}}, {18882, 18, 92192, {1, 3, 3, 1, 25, 47, 57, 45, 219, 45, 945, 3989, 4889, 8989, 381, 52483, 57029, 253899}}, {18883, 18, 92207, {1, 3, 3, 5, 3, 61, 75, 189, 53, 489, 553, 2381, 7485, 9941, 29733, 2611, 74119, 203647}}, {18884, 18, 92260, {1, 3, 1, 11, 27, 63, 53, 61, 59, 613, 465, 867, 1985, 7605, 14301, 53847, 68547, 14717}}, {18885, 18, 92282, {1, 3, 5, 11, 5, 41, 51, 11, 59, 761, 59, 267, 7273, 3061, 11223, 48825, 117869, 158551}}, {18886, 18, 92288, {1, 3, 7, 1, 31, 47, 111, 43, 435, 997, 135, 3369, 6439, 5637, 13629, 13221, 90607, 86359}}, {18887, 18, 92297, {1, 1, 1, 11, 23, 51, 109, 223, 495, 765, 1557, 3545, 305, 4949, 23931, 45115, 12121, 14487}}, {18888, 18, 92303, {1, 3, 5, 9, 5, 25, 41, 249, 27, 375, 1339, 3647, 3529, 2077, 21091, 45523, 67191, 1257}}, {18889, 18, 92315, {1, 1, 3, 7, 13, 15, 63, 45, 187, 761, 1245, 3381, 1817, 2491, 16469, 64417, 87333, 143103}}, {18890, 18, 92322, {1, 1, 3, 13, 11, 33, 87, 11, 279, 689, 1047, 3935, 5359, 11309, 19735, 33259, 12347, 183653}}, {18891, 18, 92327, {1, 1, 5, 7, 5, 49, 109, 221, 455, 167, 785, 1859, 4337, 14937, 209, 23435, 22923, 172985}}, {18892, 18, 92341, {1, 3, 7, 9, 13, 7, 127, 117, 147, 741, 531, 2627, 2565, 11083, 30577, 42471, 77065, 120983}}, {18893, 18, 92389, {1, 1, 7, 1, 5, 61, 115, 203, 15, 305, 1005, 2085, 2597, 4371, 11661, 33219, 53657, 40325}}, {18894, 18, 92390, {1, 3, 7, 13, 13, 15, 69, 167, 369, 747, 1115, 1493, 4881, 2693, 32281, 27089, 56821, 121693}}, {18895, 18, 92422, {1, 3, 5, 3, 19, 51, 101, 29, 411, 509, 847, 1033, 4135, 15561, 7045, 60757, 48479, 247295}}, {18896, 18, 92439, {1, 1, 5, 3, 27, 47, 103, 123, 413, 71, 689, 2113, 4347, 1983, 25727, 20095, 3271, 133081}}, {18897, 18, 92452, {1, 1, 3, 3, 5, 39, 87, 27, 505, 631, 689, 2591, 1955, 3205, 12681, 10821, 13343, 101505}}, {18898, 18, 92470, {1, 3, 7, 9, 31, 23, 103, 223, 499, 721, 13, 1399, 7369, 3945, 27727, 7923, 60265, 197793}}, {18899, 18, 92473, {1, 3, 3, 5, 27, 7, 119, 23, 371, 495, 1583, 3913, 5139, 12151, 17477, 10907, 121775, 13369}}, {18900, 18, 92493, {1, 3, 7, 1, 19, 53, 91, 235, 161, 97, 37, 1115, 5909, 1943, 8137, 1541, 16253, 252151}}, {18901, 18, 92508, {1, 3, 7, 5, 3, 1, 107, 241, 187, 253, 1225, 2827, 4191, 2749, 25629, 47465, 19969, 45035}}, {18902, 18, 92517, {1, 3, 1, 5, 1, 29, 47, 233, 175, 313, 793, 2089, 6235, 6595, 27599, 20505, 63379, 8729}}, {18903, 18, 92529, {1, 3, 7, 11, 15, 9, 87, 113, 389, 1, 1057, 3307, 3455, 1847, 1497, 28115, 92897, 2383}}, {18904, 18, 92551, {1, 3, 7, 13, 19, 59, 45, 59, 49, 273, 1619, 1975, 5949, 9951, 7685, 52559, 42377, 29855}}, {18905, 18, 92557, {1, 1, 3, 9, 19, 7, 119, 35, 85, 37, 269, 3443, 8015, 8061, 6001, 19123, 70643, 115513}}, {18906, 18, 92596, {1, 1, 3, 15, 3, 19, 83, 171, 259, 207, 1495, 513, 5455, 4071, 27471, 15773, 66301, 228743}}, {18907, 18, 92611, {1, 3, 7, 9, 3, 27, 93, 3, 471, 13, 677, 4067, 1941, 15345, 26629, 29419, 121593, 108669}}, {18908, 18, 92613, {1, 3, 7, 15, 29, 43, 97, 41, 15, 181, 1969, 1901, 7237, 3879, 19337, 17659, 17957, 164667}}, {18909, 18, 92642, {1, 3, 1, 1, 25, 33, 7, 41, 387, 469, 795, 781, 113, 4161, 29687, 32225, 73905, 137879}}, {18910, 18, 92666, {1, 1, 3, 13, 9, 59, 89, 23, 393, 111, 1957, 719, 6179, 16183, 31331, 48015, 32147, 31691}}, {18911, 18, 92684, {1, 3, 7, 5, 9, 45, 73, 219, 181, 51, 717, 1813, 2581, 1395, 17595, 23689, 89709, 201451}}, {18912, 18, 92723, {1, 3, 7, 3, 1, 21, 15, 35, 131, 515, 803, 1429, 3855, 349, 11795, 26787, 6109, 117745}}, {18913, 18, 92732, {1, 3, 3, 9, 7, 11, 57, 15, 491, 371, 1787, 85, 577, 11455, 27419, 20687, 2493, 209993}}, {18914, 18, 92738, {1, 3, 7, 15, 5, 5, 87, 197, 93, 643, 247, 31, 357, 7377, 10509, 29883, 42747, 248861}}, {18915, 18, 92783, {1, 3, 3, 3, 29, 33, 47, 253, 485, 25, 2003, 2953, 1629, 11549, 5697, 1135, 117761, 96411}}, {18916, 18, 92808, {1, 3, 5, 1, 29, 5, 27, 187, 235, 423, 41, 1855, 4359, 15627, 28409, 49331, 37735, 68823}}, {18917, 18, 92816, {1, 1, 5, 5, 21, 61, 67, 85, 41, 671, 1617, 3867, 7913, 1693, 18487, 1831, 100971, 168191}}, {18918, 18, 92835, {1, 1, 7, 3, 1, 61, 111, 87, 55, 229, 217, 2801, 563, 13617, 9641, 22247, 16039, 113541}}, {18919, 18, 92847, {1, 3, 5, 7, 5, 29, 67, 99, 91, 561, 1203, 643, 2607, 13421, 29695, 31925, 82985, 69031}}, {18920, 18, 92879, {1, 1, 1, 1, 27, 7, 63, 107, 269, 163, 1711, 587, 5657, 15077, 24709, 10235, 95483, 94799}}, {18921, 18, 92881, {1, 3, 3, 5, 29, 5, 127, 137, 67, 609, 1657, 1131, 959, 15773, 17295, 58575, 96525, 80529}}, {18922, 18, 92884, {1, 3, 7, 7, 25, 15, 89, 93, 145, 695, 367, 2853, 3073, 4867, 26823, 31467, 94769, 9145}}, {18923, 18, 92932, {1, 1, 7, 15, 15, 5, 1, 225, 57, 381, 1295, 2525, 1493, 2401, 91, 19809, 32803, 195289}}, {18924, 18, 92935, {1, 3, 3, 7, 29, 51, 29, 63, 249, 107, 1689, 3703, 7227, 6967, 27861, 39167, 20043, 218827}}, {18925, 18, 92960, {1, 1, 3, 13, 17, 1, 77, 143, 167, 255, 1709, 2089, 7465, 4805, 16185, 15167, 20493, 240855}}, {18926, 18, 92990, {1, 1, 5, 1, 11, 43, 107, 175, 93, 955, 615, 2923, 3637, 7451, 18847, 53467, 12463, 127249}}, {18927, 18, 93010, {1, 1, 3, 13, 31, 1, 61, 113, 479, 777, 1805, 3625, 6299, 12221, 29599, 60175, 31165, 122815}}, {18928, 18, 93025, {1, 3, 3, 11, 11, 29, 89, 129, 195, 337, 1843, 2769, 1747, 7137, 9901, 18459, 25215, 70609}}, {18929, 18, 93046, {1, 1, 3, 7, 17, 35, 55, 81, 413, 25, 1505, 2185, 3121, 11435, 17885, 12543, 36767, 64039}}, {18930, 18, 93085, {1, 3, 1, 13, 25, 9, 83, 25, 5, 49, 1975, 3967, 4135, 13213, 26479, 63913, 14921, 96193}}, {18931, 18, 93089, {1, 3, 7, 5, 17, 15, 101, 47, 245, 821, 1275, 3343, 5471, 5045, 31741, 3319, 8141, 95501}}, {18932, 18, 93096, {1, 3, 1, 13, 1, 5, 105, 39, 175, 439, 1625, 249, 4859, 12449, 30529, 45669, 49071, 214037}}, {18933, 18, 93145, {1, 1, 7, 7, 17, 21, 83, 123, 261, 559, 1967, 2933, 4417, 8331, 10119, 21793, 128729, 187247}}, {18934, 18, 93155, {1, 1, 7, 9, 15, 43, 77, 231, 241, 419, 503, 3335, 927, 2567, 31259, 52453, 114441, 257449}}, {18935, 18, 93169, {1, 3, 3, 1, 9, 29, 21, 89, 311, 185, 519, 271, 3595, 8951, 6105, 64593, 38209, 120491}}, {18936, 18, 93179, {1, 1, 7, 9, 1, 57, 65, 5, 275, 615, 801, 2839, 2851, 15609, 28731, 31223, 87725, 437}}, {18937, 18, 93184, {1, 3, 3, 5, 29, 3, 67, 53, 17, 499, 263, 651, 7963, 5371, 11593, 34761, 57427, 84979}}, {18938, 18, 93204, {1, 3, 7, 11, 15, 9, 33, 165, 313, 659, 909, 969, 2309, 2197, 27263, 35273, 52887, 236107}}, {18939, 18, 93211, {1, 1, 7, 1, 13, 17, 29, 3, 329, 573, 619, 1013, 6947, 7031, 30773, 41129, 116481, 184233}}, {18940, 18, 93213, {1, 1, 5, 9, 13, 5, 87, 235, 63, 759, 1143, 1861, 3783, 2735, 26191, 64387, 3651, 119447}}, {18941, 18, 93227, {1, 1, 3, 7, 15, 41, 117, 135, 273, 655, 251, 1859, 4363, 14725, 29385, 6269, 91505, 82679}}, {18942, 18, 93285, {1, 3, 7, 3, 13, 21, 21, 9, 121, 899, 199, 1973, 7437, 9771, 26647, 30909, 118573, 152913}}, {18943, 18, 93292, {1, 3, 3, 9, 31, 43, 5, 249, 109, 183, 161, 1185, 4025, 10331, 20983, 28549, 122687, 183429}}, {18944, 18, 93320, {1, 3, 7, 7, 11, 45, 111, 99, 487, 971, 597, 1555, 273, 10403, 25289, 45483, 35845, 35791}}, {18945, 18, 93356, {1, 1, 1, 7, 11, 49, 125, 229, 279, 289, 1945, 3575, 5683, 15659, 31123, 12517, 79303, 255797}}, {18946, 18, 93371, {1, 3, 1, 15, 9, 23, 61, 53, 383, 855, 1743, 407, 4401, 7507, 26307, 56205, 110943, 184183}}, {18947, 18, 93374, {1, 3, 5, 13, 23, 29, 101, 243, 417, 925, 1267, 257, 5893, 4335, 6309, 43519, 126035, 99205}}, {18948, 18, 93385, {1, 3, 1, 5, 5, 35, 83, 25, 31, 455, 1799, 2919, 7037, 11829, 12239, 12969, 108469, 89513}}, {18949, 18, 93403, {1, 3, 5, 9, 17, 29, 61, 217, 183, 131, 425, 4025, 7141, 5445, 21497, 10603, 53423, 5701}}, {18950, 18, 93406, {1, 1, 1, 15, 27, 35, 9, 139, 261, 43, 587, 3835, 4627, 11689, 15739, 6031, 73547, 134271}}, {18951, 18, 93427, {1, 1, 3, 3, 25, 15, 7, 225, 29, 785, 2047, 2219, 6083, 7973, 17053, 56167, 83915, 87597}}, {18952, 18, 93451, {1, 3, 7, 15, 13, 43, 85, 121, 421, 867, 1895, 2437, 6003, 5269, 8625, 26877, 100023, 110229}}, {18953, 18, 93454, {1, 3, 3, 3, 25, 49, 121, 1, 125, 353, 1811, 1575, 3925, 13897, 26087, 24977, 105995, 242817}}, {18954, 18, 93472, {1, 1, 1, 9, 31, 55, 71, 241, 439, 927, 955, 109, 7779, 2397, 18797, 34177, 1255, 178671}}, {18955, 18, 93482, {1, 1, 7, 7, 5, 15, 99, 225, 49, 407, 1711, 4027, 4845, 9209, 20983, 33969, 14205, 9351}}, {18956, 18, 93507, {1, 3, 5, 1, 9, 13, 113, 143, 97, 189, 929, 1163, 2261, 9761, 30011, 32911, 117043, 169493}}, {18957, 18, 93537, {1, 1, 3, 5, 9, 35, 95, 77, 5, 95, 1745, 2013, 7009, 5427, 18969, 2771, 5099, 52939}}, {18958, 18, 93562, {1, 3, 7, 9, 13, 19, 31, 189, 367, 569, 95, 1665, 6231, 2169, 22589, 8427, 116097, 41077}}, {18959, 18, 93564, {1, 3, 7, 3, 31, 61, 45, 233, 327, 541, 87, 3449, 2767, 12237, 17747, 53827, 80389, 121489}}, {18960, 18, 93608, {1, 3, 7, 15, 31, 1, 49, 73, 157, 131, 553, 3417, 5283, 4737, 31675, 63213, 43689, 261869}}, {18961, 18, 93636, {1, 3, 7, 1, 3, 5, 113, 43, 343, 39, 135, 1555, 7955, 9851, 30983, 21955, 34871, 147649}}, {18962, 18, 93640, {1, 3, 5, 3, 5, 27, 15, 179, 141, 983, 265, 2651, 5907, 10501, 6275, 29629, 115965, 125745}}, {18963, 18, 93653, {1, 3, 7, 13, 1, 1, 81, 105, 309, 457, 1817, 3435, 4615, 1181, 27835, 26075, 63447, 44701}}, {18964, 18, 93654, {1, 1, 5, 5, 25, 19, 85, 103, 409, 323, 2001, 3719, 3403, 1301, 19615, 47829, 109905, 65777}}, {18965, 18, 93664, {1, 3, 5, 3, 21, 15, 47, 75, 467, 273, 1885, 3929, 1877, 5209, 6881, 34431, 35663, 100205}}, {18966, 18, 93676, {1, 1, 5, 3, 3, 9, 47, 143, 471, 653, 1011, 2263, 3673, 11921, 31207, 50365, 27177, 214377}}, {18967, 18, 93721, {1, 3, 1, 15, 3, 43, 81, 253, 495, 139, 679, 2207, 4603, 5269, 27133, 46461, 120783, 185595}}, {18968, 18, 93740, {1, 1, 7, 3, 13, 3, 109, 197, 477, 101, 859, 1035, 777, 10153, 15581, 22715, 17493, 120851}}, {18969, 18, 93743, {1, 3, 1, 3, 23, 5, 121, 67, 265, 935, 741, 3311, 541, 1093, 1639, 5941, 5587, 150345}}, {18970, 18, 93745, {1, 3, 1, 5, 3, 13, 65, 173, 493, 303, 359, 3813, 6007, 1105, 12185, 10431, 17117, 164899}}, {18971, 18, 93751, {1, 3, 3, 1, 25, 33, 71, 181, 149, 7, 333, 1981, 2981, 14683, 10997, 63373, 22605, 119681}}, {18972, 18, 93770, {1, 1, 1, 15, 29, 35, 89, 21, 281, 175, 587, 3117, 7221, 8239, 26399, 49133, 65895, 142175}}, {18973, 18, 93796, {1, 3, 7, 15, 9, 9, 35, 161, 65, 749, 421, 3575, 6307, 2029, 11423, 63901, 102049, 26333}}, {18974, 18, 93820, {1, 3, 1, 13, 1, 45, 97, 41, 231, 245, 271, 1497, 3119, 6225, 21665, 12113, 67315, 62779}}, {18975, 18, 93824, {1, 1, 1, 7, 3, 29, 119, 193, 179, 353, 1015, 2803, 6869, 7653, 22309, 53421, 86969, 115549}}, {18976, 18, 93833, {1, 3, 3, 5, 17, 37, 49, 129, 195, 537, 1237, 2775, 6683, 699, 19181, 61125, 27483, 175645}}, {18977, 18, 93841, {1, 3, 7, 3, 7, 49, 107, 41, 285, 335, 1415, 4015, 1301, 6525, 32429, 9337, 87923, 176751}}, {18978, 18, 93847, {1, 1, 5, 9, 21, 43, 91, 25, 225, 311, 417, 303, 2629, 3609, 29987, 28647, 104173, 52383}}, {18979, 18, 93848, {1, 3, 5, 9, 13, 47, 75, 143, 109, 173, 503, 3843, 1767, 9433, 10009, 5653, 87339, 212975}}, {18980, 18, 93854, {1, 3, 1, 13, 13, 55, 123, 95, 499, 245, 1875, 3661, 7661, 6927, 21003, 51729, 88089, 89063}}, {18981, 18, 93882, {1, 1, 3, 1, 31, 7, 93, 35, 169, 191, 1079, 2137, 4401, 1563, 20021, 9101, 66881, 231589}}, {18982, 18, 93943, {1, 3, 1, 15, 21, 41, 75, 231, 459, 701, 1715, 2581, 4445, 5877, 4765, 1037, 15827, 189529}}, {18983, 18, 93958, {1, 3, 5, 13, 17, 23, 41, 133, 143, 297, 1335, 3907, 7745, 5139, 9397, 5765, 5347, 243091}}, {18984, 18, 93972, {1, 1, 5, 13, 7, 15, 31, 183, 315, 153, 785, 2723, 97, 14361, 10509, 17717, 46615, 133289}}, {18985, 18, 93975, {1, 3, 7, 9, 13, 3, 75, 103, 445, 409, 603, 201, 1873, 9277, 23953, 6881, 64327, 196771}}, {18986, 18, 94003, {1, 1, 7, 13, 15, 21, 73, 183, 419, 997, 857, 1373, 3855, 417, 10175, 5253, 66509, 15731}}, {18987, 18, 94009, {1, 3, 3, 9, 19, 7, 15, 119, 497, 25, 1165, 105, 2605, 15097, 28241, 2269, 519, 235655}}, {18988, 18, 94020, {1, 3, 3, 9, 27, 9, 103, 205, 97, 317, 1621, 971, 931, 9099, 24583, 12695, 122399, 78021}}, {18989, 18, 94072, {1, 1, 3, 5, 27, 45, 41, 239, 87, 603, 317, 3507, 7677, 9141, 26721, 40225, 80515, 205263}}, {18990, 18, 94081, {1, 1, 3, 1, 25, 3, 63, 165, 41, 783, 291, 1997, 3769, 1881, 30613, 18821, 86175, 38837}}, {18991, 18, 94093, {1, 1, 3, 5, 17, 19, 95, 17, 357, 587, 689, 3127, 6999, 6703, 23923, 55945, 97629, 210177}}, {18992, 18, 94102, {1, 1, 3, 15, 21, 55, 63, 229, 397, 1007, 779, 2105, 681, 10659, 26679, 681, 115901, 83627}}, {18993, 18, 94122, {1, 1, 7, 11, 25, 9, 47, 133, 109, 17, 697, 749, 5529, 9289, 29675, 2631, 15247, 13913}}, {18994, 18, 94135, {1, 1, 7, 7, 3, 55, 29, 13, 467, 889, 675, 1187, 3301, 13721, 13783, 44559, 78177, 114219}}, {18995, 18, 94136, {1, 3, 5, 13, 15, 11, 77, 71, 313, 427, 1385, 2007, 4003, 1529, 4797, 12289, 24897, 129513}}, {18996, 18, 94150, {1, 1, 3, 11, 9, 47, 103, 253, 345, 659, 1109, 3493, 2515, 5669, 30551, 25077, 97393, 252689}}, {18997, 18, 94184, {1, 3, 7, 9, 25, 19, 69, 161, 365, 51, 1365, 1045, 4319, 10035, 15529, 23251, 44359, 62163}}, {18998, 18, 94187, {1, 3, 1, 7, 3, 25, 119, 33, 19, 561, 659, 2741, 6177, 899, 30911, 9627, 83003, 12939}}, {18999, 18, 94258, {1, 3, 7, 1, 13, 37, 19, 161, 427, 621, 1045, 1963, 6067, 4439, 32507, 32775, 5201, 144645}}, {19000, 18, 94264, {1, 1, 5, 7, 31, 17, 89, 239, 317, 109, 1827, 1395, 1587, 14813, 29911, 63545, 22939, 235383}}, {19001, 18, 94272, {1, 1, 7, 15, 1, 17, 41, 123, 405, 539, 1063, 1443, 4611, 1847, 24107, 29365, 85859, 218601}}, {19002, 18, 94278, {1, 1, 5, 13, 21, 27, 101, 223, 245, 705, 1579, 679, 5461, 8955, 15031, 7731, 31219, 165033}}, {19003, 18, 94281, {1, 1, 7, 11, 19, 29, 13, 223, 179, 481, 761, 1543, 3195, 10695, 17147, 37577, 130901, 44699}}, {19004, 18, 94317, {1, 1, 7, 3, 19, 53, 49, 1, 393, 583, 1183, 2817, 1293, 12949, 15491, 44467, 86261, 220439}}, {19005, 18, 94348, {1, 3, 7, 15, 15, 47, 7, 125, 467, 511, 1207, 3787, 5575, 5359, 3859, 29933, 104627, 243073}}, {19006, 18, 94376, {1, 1, 1, 13, 27, 25, 17, 243, 477, 457, 1835, 2859, 1023, 10107, 26829, 49853, 114569, 250471}}, {19007, 18, 94382, {1, 3, 1, 15, 11, 43, 15, 235, 431, 671, 1935, 1143, 4121, 15403, 19313, 15919, 111961, 50455}}, {19008, 18, 94387, {1, 3, 3, 3, 11, 45, 107, 143, 353, 671, 1259, 1599, 6075, 10645, 9131, 28133, 58679, 29883}}, {19009, 18, 94389, {1, 3, 5, 15, 15, 43, 29, 171, 303, 71, 1751, 411, 7615, 12063, 26829, 31469, 34335, 3163}}, {19010, 18, 94393, {1, 1, 7, 7, 25, 63, 25, 25, 27, 671, 505, 1235, 1985, 2593, 30031, 3251, 94729, 248911}}, {19011, 18, 94402, {1, 1, 3, 1, 19, 15, 125, 133, 133, 209, 1749, 2091, 6325, 1275, 5675, 2249, 22631, 56293}}, {19012, 18, 94421, {1, 1, 5, 1, 19, 27, 25, 99, 211, 739, 565, 3903, 7701, 7547, 12303, 5421, 24663, 22807}}, {19013, 18, 94422, {1, 3, 5, 13, 5, 45, 99, 67, 21, 269, 851, 3333, 4555, 12483, 14645, 44757, 99047, 198521}}, {19014, 18, 94431, {1, 1, 5, 13, 19, 1, 123, 87, 109, 799, 591, 2997, 1005, 16369, 10329, 34541, 100935, 200397}}, {19015, 18, 94473, {1, 3, 5, 1, 13, 51, 93, 23, 19, 23, 965, 171, 6865, 3561, 23255, 44295, 87405, 222269}}, {19016, 18, 94487, {1, 1, 3, 5, 1, 53, 25, 129, 123, 737, 271, 61, 113, 8481, 27075, 58633, 21499, 156689}}, {19017, 18, 94504, {1, 3, 3, 11, 3, 43, 11, 123, 243, 1015, 1389, 3663, 1725, 6933, 5315, 7137, 127705, 56607}}, {19018, 18, 94510, {1, 1, 5, 13, 7, 23, 43, 103, 503, 173, 267, 1509, 3311, 9553, 28851, 15771, 28741, 236427}}, {19019, 18, 94522, {1, 1, 5, 15, 27, 43, 119, 3, 13, 107, 317, 3725, 6669, 4945, 30485, 10155, 96893, 154081}}, {19020, 18, 94532, {1, 3, 7, 5, 11, 21, 61, 99, 155, 45, 569, 1325, 673, 15803, 12047, 55431, 9515, 106969}}, {19021, 18, 94572, {1, 1, 7, 11, 27, 49, 121, 145, 105, 223, 1471, 1163, 3889, 4213, 21195, 45649, 14663, 82799}}, {19022, 18, 94589, {1, 1, 3, 3, 31, 21, 17, 85, 31, 695, 1591, 2465, 907, 11621, 29681, 13131, 77187, 175913}}, {19023, 18, 94599, {1, 3, 5, 5, 21, 49, 77, 229, 359, 825, 1851, 1223, 3351, 5349, 30971, 20797, 26975, 94425}}, {19024, 18, 94603, {1, 1, 3, 1, 3, 63, 23, 219, 503, 47, 1675, 1641, 5257, 8035, 29793, 30093, 44897, 235691}}, {19025, 18, 94647, {1, 1, 7, 9, 27, 37, 109, 33, 511, 203, 1195, 3281, 407, 15237, 28485, 21379, 106325, 231755}}, {19026, 18, 94665, {1, 3, 1, 3, 9, 45, 19, 31, 255, 799, 909, 767, 421, 3301, 18557, 15043, 48505, 36763}}, {19027, 18, 94695, {1, 3, 7, 13, 1, 45, 59, 233, 319, 265, 517, 1571, 4593, 12813, 30729, 19517, 70345, 142411}}, {19028, 18, 94716, {1, 1, 1, 13, 17, 15, 79, 93, 265, 381, 285, 253, 919, 3715, 30555, 38801, 30439, 51511}}, {19029, 18, 94738, {1, 1, 7, 15, 25, 39, 71, 57, 145, 487, 1655, 2589, 7655, 8413, 24537, 36761, 36427, 88929}}, {19030, 18, 94740, {1, 1, 3, 3, 29, 41, 61, 191, 97, 849, 911, 3269, 5425, 13997, 7749, 537, 113705, 179765}}, {19031, 18, 94778, {1, 1, 5, 9, 13, 55, 33, 221, 27, 521, 13, 2847, 6035, 8397, 6579, 29353, 101953, 88983}}, {19032, 18, 94803, {1, 3, 3, 13, 31, 47, 97, 177, 373, 353, 159, 249, 4741, 7427, 8353, 38617, 13857, 122081}}, {19033, 18, 94810, {1, 3, 5, 15, 13, 21, 1, 239, 369, 253, 1009, 1927, 5111, 2219, 28167, 32013, 51487, 210521}}, {19034, 18, 94815, {1, 3, 5, 9, 17, 21, 37, 105, 405, 39, 321, 1515, 3759, 15469, 13643, 60157, 72127, 233505}}, {19035, 18, 94821, {1, 3, 7, 5, 1, 3, 3, 125, 283, 757, 829, 2303, 3715, 6027, 17795, 37359, 54721, 5891}}, {19036, 18, 94862, {1, 3, 7, 15, 27, 63, 117, 101, 341, 965, 1543, 51, 3397, 14051, 9889, 64647, 111169, 249477}}, {19037, 18, 94886, {1, 1, 5, 13, 5, 29, 51, 61, 233, 685, 751, 163, 2319, 14691, 29881, 39029, 57093, 240147}}, {19038, 18, 94900, {1, 3, 5, 3, 9, 21, 107, 147, 263, 471, 621, 3485, 197, 13271, 24689, 64341, 110163, 142711}}, {19039, 18, 94924, {1, 3, 1, 7, 1, 23, 17, 31, 131, 631, 795, 3751, 5337, 9151, 2873, 31113, 65303, 244969}}, {19040, 18, 94952, {1, 1, 5, 11, 3, 51, 93, 155, 389, 859, 1181, 2711, 1375, 6119, 229, 47767, 115521, 114129}}, {19041, 18, 94963, {1, 3, 3, 15, 5, 7, 29, 187, 259, 911, 1537, 1885, 6139, 4549, 21655, 58771, 1003, 124609}}, {19042, 18, 94970, {1, 1, 3, 15, 25, 45, 97, 217, 331, 305, 1105, 3465, 3651, 10171, 31601, 6947, 4545, 232627}}, {19043, 18, 94980, {1, 1, 5, 5, 9, 53, 109, 201, 473, 201, 1113, 973, 1825, 13089, 1207, 9947, 92515, 216199}}, {19044, 18, 94992, {1, 3, 7, 3, 1, 49, 25, 109, 249, 489, 1663, 3493, 4615, 13899, 27851, 60711, 14351, 41787}}, {19045, 18, 95017, {1, 3, 3, 7, 3, 15, 29, 53, 61, 669, 371, 2187, 6769, 4623, 25785, 12997, 52263, 28387}}, {19046, 18, 95028, {1, 1, 1, 3, 9, 31, 69, 3, 441, 219, 285, 183, 1971, 10903, 8271, 19389, 61913, 203537}}, {19047, 18, 95031, {1, 1, 5, 3, 9, 63, 117, 131, 53, 525, 1349, 2701, 1317, 6047, 1661, 51785, 93199, 158645}}, {19048, 18, 95035, {1, 3, 5, 3, 21, 61, 11, 91, 317, 635, 61, 1919, 2139, 12817, 6587, 63201, 52659, 8971}}, {19049, 18, 95040, {1, 3, 1, 9, 11, 47, 49, 35, 115, 711, 511, 835, 3787, 837, 15737, 7467, 53263, 132047}}, {19050, 18, 95058, {1, 1, 5, 3, 27, 47, 121, 211, 65, 363, 1067, 3813, 6353, 13701, 23943, 7573, 112721, 219587}}, {19051, 18, 95079, {1, 1, 3, 7, 21, 39, 15, 199, 113, 517, 1429, 1399, 6007, 1389, 16425, 17709, 1231, 51803}}, {19052, 18, 95122, {1, 3, 5, 11, 5, 37, 35, 97, 215, 281, 517, 1777, 4171, 10161, 18369, 23233, 83005, 75519}}, {19053, 18, 95149, {1, 3, 7, 9, 3, 9, 69, 111, 135, 351, 971, 3551, 3739, 3571, 22861, 62669, 83723, 10707}}, {19054, 18, 95150, {1, 3, 3, 5, 31, 35, 103, 205, 321, 553, 409, 363, 4085, 7735, 5513, 64249, 127883, 147839}}, {19055, 18, 95167, {1, 1, 7, 3, 23, 35, 85, 231, 251, 237, 421, 757, 7081, 11247, 24941, 22649, 51111, 157383}}, {19056, 18, 95175, {1, 3, 7, 5, 23, 35, 7, 101, 491, 529, 1437, 489, 5057, 12955, 27543, 60903, 104151, 42545}}, {19057, 18, 95205, {1, 1, 3, 15, 23, 53, 85, 89, 247, 269, 1555, 3789, 467, 11145, 11751, 44343, 120117, 9975}}, {19058, 18, 95229, {1, 1, 5, 3, 29, 49, 123, 179, 311, 45, 1839, 2725, 7307, 5525, 32075, 7979, 107751, 133677}}, {19059, 18, 95321, {1, 1, 5, 3, 31, 21, 65, 229, 31, 597, 755, 2653, 2699, 2075, 11693, 28953, 55811, 13653}}, {19060, 18, 95345, {1, 1, 1, 7, 25, 51, 119, 21, 245, 493, 407, 2997, 4255, 15487, 26359, 24153, 42955, 142191}}, {19061, 18, 95364, {1, 1, 5, 3, 27, 61, 13, 209, 13, 401, 399, 2909, 3623, 8057, 21301, 32273, 112127, 210221}}, {19062, 18, 95379, {1, 3, 5, 13, 3, 19, 121, 19, 57, 583, 947, 3591, 5283, 10831, 20429, 54097, 7559, 112465}}, {19063, 18, 95386, {1, 3, 5, 1, 21, 1, 125, 245, 217, 165, 1319, 2119, 4641, 9481, 4147, 7079, 119015, 128401}}, {19064, 18, 95395, {1, 1, 5, 3, 3, 31, 25, 63, 17, 191, 497, 819, 1515, 11215, 24961, 7679, 125801, 239521}}, {19065, 18, 95416, {1, 1, 5, 1, 3, 25, 27, 43, 37, 863, 739, 2585, 773, 799, 17649, 21171, 123541, 164777}}, {19066, 18, 95419, {1, 3, 5, 7, 7, 25, 15, 251, 305, 159, 1941, 3655, 2881, 15123, 10911, 35541, 62221, 175845}}, {19067, 18, 95433, {1, 1, 1, 9, 19, 5, 103, 1, 417, 951, 139, 2413, 2983, 15471, 9495, 41349, 110175, 29501}}, {19068, 18, 95464, {1, 1, 1, 5, 29, 53, 95, 173, 211, 803, 1599, 4093, 5559, 15855, 12271, 12583, 102221, 203453}}, {19069, 18, 95490, {1, 3, 5, 5, 19, 43, 31, 175, 493, 289, 1865, 2925, 3833, 11327, 23337, 62669, 99485, 230583}}, {19070, 18, 95496, {1, 3, 3, 11, 11, 25, 95, 215, 501, 421, 725, 1571, 2133, 2761, 8649, 45359, 88851, 55057}}, {19071, 18, 95504, {1, 1, 7, 7, 21, 45, 69, 63, 399, 929, 1431, 3397, 3613, 14595, 10417, 62913, 106283, 120869}}, {19072, 18, 95513, {1, 3, 7, 15, 13, 45, 11, 177, 125, 611, 1115, 2441, 2689, 12517, 8989, 34991, 23789, 51543}}, {19073, 18, 95523, {1, 1, 3, 1, 3, 15, 5, 125, 511, 137, 1919, 2953, 5267, 3543, 5485, 7463, 130407, 255945}}, {19074, 18, 95525, {1, 1, 3, 7, 7, 21, 95, 97, 51, 91, 813, 2819, 2839, 12041, 26197, 20143, 51403, 171337}}, {19075, 18, 95558, {1, 1, 1, 1, 7, 27, 15, 125, 441, 387, 1869, 2157, 5863, 581, 893, 58827, 104063, 93735}}, {19076, 18, 95572, {1, 3, 3, 7, 27, 9, 79, 97, 465, 207, 931, 2809, 2225, 13749, 18819, 30605, 9829, 130743}}, {19077, 18, 95591, {1, 3, 5, 13, 31, 41, 19, 147, 293, 725, 297, 397, 1343, 12669, 15339, 58599, 12113, 149835}}, {19078, 18, 95609, {1, 3, 3, 13, 27, 13, 121, 253, 349, 229, 915, 1673, 3819, 77, 20691, 53823, 78265, 138743}}, {19079, 18, 95619, {1, 1, 5, 5, 29, 41, 65, 235, 123, 871, 1809, 3013, 3531, 1551, 8441, 23481, 58729, 117639}}, {19080, 18, 95625, {1, 1, 7, 5, 23, 55, 89, 81, 201, 313, 1307, 2427, 2025, 8543, 26631, 58655, 122095, 247579}}, {19081, 18, 95633, {1, 3, 1, 5, 3, 63, 89, 219, 449, 9, 1771, 2915, 5925, 13773, 26119, 61309, 65107, 33001}}, {19082, 18, 95649, {1, 3, 7, 1, 27, 11, 25, 221, 139, 665, 1543, 2157, 7617, 9135, 567, 64985, 88749, 54223}}, {19083, 18, 95652, {1, 1, 3, 9, 13, 41, 7, 99, 483, 115, 1499, 3343, 7207, 1805, 16031, 63707, 8555, 90959}}, {19084, 18, 95655, {1, 3, 1, 9, 15, 53, 41, 239, 295, 47, 1645, 1095, 5163, 7739, 26635, 28245, 9315, 100629}}, {19085, 18, 95696, {1, 3, 1, 5, 1, 19, 69, 5, 171, 669, 673, 633, 6895, 7571, 11539, 25133, 99235, 7991}}, {19086, 18, 95721, {1, 3, 5, 11, 21, 37, 63, 77, 281, 307, 1711, 2671, 1315, 14683, 28757, 22751, 56477, 190805}}, {19087, 18, 95766, {1, 3, 3, 5, 15, 1, 5, 21, 199, 161, 655, 1263, 3315, 16051, 2409, 773, 9075, 121265}}, {19088, 18, 95772, {1, 3, 3, 3, 7, 23, 71, 195, 11, 263, 1845, 165, 3489, 447, 11315, 23861, 110949, 78909}}, {19089, 18, 95775, {1, 1, 7, 5, 1, 53, 37, 9, 439, 135, 909, 457, 6993, 11401, 14065, 30795, 56149, 168013}}, {19090, 18, 95794, {1, 1, 1, 15, 23, 37, 13, 87, 113, 251, 233, 725, 7757, 14399, 3023, 54277, 87879, 54053}}, {19091, 18, 95796, {1, 3, 5, 11, 11, 57, 109, 171, 171, 17, 343, 2749, 6525, 9735, 11715, 23783, 54439, 82819}}, {19092, 18, 95818, {1, 1, 1, 15, 3, 47, 73, 237, 399, 301, 947, 2055, 1909, 14105, 26893, 47805, 25, 172957}}, {19093, 18, 95820, {1, 1, 7, 7, 11, 27, 93, 167, 117, 637, 351, 319, 4605, 12897, 31001, 39655, 53551, 246113}}, {19094, 18, 95832, {1, 3, 5, 15, 3, 37, 25, 9, 421, 519, 257, 3251, 1649, 4069, 999, 59367, 112383, 32095}}, {19095, 18, 95842, {1, 3, 7, 7, 25, 57, 11, 37, 271, 545, 1213, 1927, 6471, 5145, 22995, 51051, 126981, 260457}}, {19096, 18, 95851, {1, 3, 5, 11, 1, 61, 77, 201, 395, 199, 477, 103, 4069, 7003, 26371, 49145, 103839, 195661}}, {19097, 18, 95854, {1, 3, 3, 9, 13, 41, 25, 125, 161, 371, 179, 351, 7169, 7179, 21627, 57793, 104679, 158583}}, {19098, 18, 95859, {1, 3, 7, 11, 5, 7, 111, 163, 201, 783, 189, 273, 2751, 13917, 28501, 18261, 12755, 15521}}, {19099, 18, 95868, {1, 1, 5, 7, 3, 37, 121, 209, 503, 299, 1301, 3703, 2321, 99, 14953, 28087, 85059, 256911}}, {19100, 18, 95881, {1, 3, 3, 13, 3, 29, 95, 249, 383, 971, 1291, 13, 1587, 3447, 26477, 15837, 111141, 73899}}, {19101, 18, 95895, {1, 1, 7, 1, 17, 57, 31, 1, 219, 329, 19, 3841, 1829, 5179, 14945, 6625, 3783, 200583}}, {19102, 18, 95943, {1, 3, 1, 3, 1, 31, 23, 17, 209, 383, 297, 3065, 4323, 7847, 30189, 56541, 57535, 24853}}, {19103, 18, 95949, {1, 1, 3, 11, 31, 35, 125, 141, 251, 79, 161, 775, 2455, 6959, 26433, 39145, 26563, 665}}, {19104, 18, 95978, {1, 1, 7, 1, 11, 9, 9, 211, 231, 723, 1337, 1713, 3779, 2001, 23451, 27107, 64297, 254943}}, {19105, 18, 95980, {1, 3, 7, 15, 21, 55, 19, 159, 449, 837, 1259, 1851, 5061, 355, 21531, 63479, 114657, 139265}}, {19106, 18, 96010, {1, 1, 1, 3, 11, 55, 103, 179, 363, 567, 421, 981, 7221, 2077, 19339, 1155, 67019, 218231}}, {19107, 18, 96020, {1, 1, 7, 11, 3, 43, 55, 161, 347, 995, 1555, 3251, 1605, 13313, 4499, 19361, 60145, 71593}}, {19108, 18, 96024, {1, 1, 5, 3, 9, 15, 119, 213, 455, 241, 857, 683, 1247, 13085, 23919, 20365, 16303, 73263}}, {19109, 18, 96063, {1, 1, 3, 13, 25, 17, 45, 193, 375, 289, 1381, 3629, 3015, 15883, 20633, 7431, 108787, 233297}}, {19110, 18, 96108, {1, 1, 1, 15, 21, 57, 105, 91, 233, 961, 1623, 3849, 711, 3857, 32657, 5935, 85113, 38287}}, {19111, 18, 96125, {1, 3, 3, 3, 15, 31, 97, 217, 335, 385, 1661, 3927, 6849, 137, 28871, 56485, 32777, 260033}}, {19112, 18, 96154, {1, 1, 3, 13, 5, 61, 19, 255, 123, 481, 1865, 1815, 3047, 173, 25363, 1277, 6453, 174405}}, {19113, 18, 96172, {1, 3, 7, 13, 27, 9, 19, 21, 433, 857, 1931, 2927, 629, 7733, 13503, 48263, 67517, 26495}}, {19114, 18, 96189, {1, 1, 1, 3, 5, 43, 61, 239, 81, 585, 187, 1123, 3319, 8699, 20925, 40815, 76575, 169383}}, {19115, 18, 96204, {1, 3, 3, 3, 9, 49, 71, 225, 95, 365, 645, 237, 7829, 5727, 17031, 58971, 71415, 232423}}, {19116, 18, 96219, {1, 3, 5, 9, 25, 49, 113, 47, 105, 609, 1557, 2099, 2129, 8663, 24811, 25505, 38153, 185821}}, {19117, 18, 96256, {1, 3, 5, 13, 23, 55, 107, 17, 309, 807, 635, 1007, 6207, 3363, 7607, 25013, 4141, 171509}}, {19118, 18, 96261, {1, 1, 1, 13, 27, 35, 31, 89, 109, 879, 1845, 3999, 5415, 8777, 9605, 29703, 28149, 36469}}, {19119, 18, 96289, {1, 3, 1, 3, 13, 3, 51, 31, 479, 549, 1245, 2033, 961, 13893, 21829, 32791, 109497, 187425}}, {19120, 18, 96292, {1, 1, 5, 3, 19, 5, 25, 187, 173, 869, 201, 3851, 7369, 6229, 16577, 45623, 19859, 209855}}, {19121, 18, 96296, {1, 1, 7, 9, 1, 9, 53, 47, 289, 557, 999, 141, 3789, 3087, 30217, 24221, 81431, 157507}}, {19122, 18, 96324, {1, 1, 3, 9, 1, 25, 11, 73, 155, 155, 621, 4047, 6759, 5641, 28147, 8523, 69439, 92613}}, {19123, 18, 96345, {1, 3, 1, 5, 25, 23, 41, 79, 71, 793, 1381, 307, 7863, 16289, 28783, 5299, 128481, 222799}}, {19124, 18, 96346, {1, 1, 7, 1, 17, 33, 117, 111, 15, 249, 1397, 1349, 4883, 6009, 3179, 33509, 56355, 31937}}, {19125, 18, 96358, {1, 3, 5, 13, 29, 15, 41, 185, 91, 501, 571, 2889, 6901, 3875, 3737, 23657, 101587, 261181}}, {19126, 18, 96386, {1, 1, 7, 9, 21, 49, 33, 143, 19, 203, 75, 1353, 585, 7719, 11311, 48989, 10803, 51743}}, {19127, 18, 96412, {1, 1, 7, 13, 23, 31, 103, 209, 375, 817, 1461, 3657, 7931, 15893, 15065, 28721, 54299, 71147}}, {19128, 18, 96428, {1, 3, 7, 7, 7, 25, 37, 173, 355, 499, 247, 459, 7701, 2219, 11703, 20631, 128857, 125367}}, {19129, 18, 96445, {1, 1, 3, 5, 25, 61, 43, 135, 451, 667, 547, 443, 5071, 12671, 26975, 20131, 101545, 115281}}, {19130, 18, 96446, {1, 3, 3, 5, 9, 19, 75, 133, 211, 585, 1283, 3397, 3181, 65, 20213, 47725, 101883, 194749}}, {19131, 18, 96448, {1, 1, 1, 1, 19, 13, 75, 135, 111, 641, 765, 1631, 4711, 241, 15125, 38233, 95535, 177965}}, {19132, 18, 96458, {1, 1, 7, 13, 31, 1, 91, 61, 299, 35, 1327, 3903, 6193, 5589, 6331, 6321, 105741, 89639}}, {19133, 18, 96475, {1, 3, 3, 15, 1, 55, 11, 39, 171, 713, 973, 1827, 3487, 13057, 30775, 16881, 124989, 208193}}, {19134, 18, 96482, {1, 3, 7, 1, 21, 29, 19, 75, 397, 755, 1601, 2907, 6861, 10377, 23127, 2443, 86545, 3841}}, {19135, 18, 96494, {1, 3, 1, 11, 25, 33, 53, 195, 343, 425, 1523, 3051, 3115, 3205, 3457, 20521, 39187, 33307}}, {19136, 18, 96502, {1, 3, 5, 1, 25, 23, 47, 5, 133, 511, 1549, 2691, 7861, 4987, 2877, 38693, 37491, 22481}}, {19137, 18, 96508, {1, 1, 5, 15, 5, 55, 125, 231, 11, 451, 1443, 3865, 4115, 2379, 13675, 29953, 85721, 114859}}, {19138, 18, 96511, {1, 3, 1, 15, 19, 37, 29, 75, 483, 785, 1933, 2435, 1811, 2787, 32653, 23159, 80993, 26867}}, {19139, 18, 96516, {1, 1, 1, 15, 7, 27, 53, 99, 11, 693, 1085, 743, 939, 6461, 6391, 45913, 94037, 217039}}, {19140, 18, 96520, {1, 3, 3, 9, 19, 37, 93, 77, 363, 125, 1675, 347, 5599, 7771, 23549, 39945, 106931, 127959}}, {19141, 18, 96547, {1, 3, 1, 5, 27, 47, 107, 85, 31, 621, 1529, 2349, 7055, 889, 4663, 1705, 40011, 214775}}, {19142, 18, 96556, {1, 3, 1, 5, 11, 47, 35, 13, 139, 783, 1009, 845, 4139, 14713, 24191, 17597, 124923, 219657}}, {19143, 18, 96561, {1, 1, 7, 3, 3, 25, 63, 207, 361, 587, 763, 3027, 6523, 6783, 11203, 57313, 115397, 149921}}, {19144, 18, 96568, {1, 1, 7, 1, 21, 55, 109, 183, 487, 869, 195, 83, 3675, 13103, 12383, 63519, 48379, 256443}}, {19145, 18, 96581, {1, 3, 7, 13, 9, 21, 29, 163, 105, 871, 747, 2459, 7383, 439, 5223, 1655, 1469, 50345}}, {19146, 18, 96582, {1, 3, 1, 1, 15, 63, 37, 159, 385, 795, 1369, 1973, 6119, 6027, 23913, 52475, 80827, 198261}}, {19147, 18, 96679, {1, 3, 3, 11, 15, 5, 121, 231, 43, 907, 1621, 3895, 5075, 10865, 3123, 49657, 69827, 215813}}, {19148, 18, 96683, {1, 3, 1, 15, 7, 41, 75, 105, 87, 899, 629, 1699, 5861, 9279, 30107, 37443, 7555, 64461}}, {19149, 18, 96717, {1, 3, 1, 7, 9, 15, 119, 127, 121, 621, 1117, 1659, 605, 13705, 31181, 40063, 17257, 77645}}, {19150, 18, 96754, {1, 1, 5, 5, 3, 37, 95, 237, 379, 375, 903, 257, 4425, 14191, 9185, 57133, 82067, 73521}}, {19151, 18, 96769, {1, 1, 7, 15, 1, 43, 63, 45, 121, 669, 1775, 179, 7385, 3557, 17261, 379, 24759, 214831}}, {19152, 18, 96799, {1, 1, 3, 9, 31, 5, 43, 153, 451, 573, 1623, 2831, 4483, 7219, 27657, 47111, 58165, 145799}}, {19153, 18, 96805, {1, 1, 3, 11, 3, 11, 111, 83, 329, 807, 779, 1223, 6095, 7269, 22425, 19343, 11937, 10173}}, {19154, 18, 96809, {1, 1, 1, 13, 27, 15, 7, 111, 37, 663, 51, 3759, 6321, 8253, 737, 59501, 109595, 177827}}, {19155, 18, 96823, {1, 1, 3, 3, 29, 39, 79, 115, 307, 765, 331, 377, 1873, 14491, 11065, 11865, 76717, 29101}}, {19156, 18, 96829, {1, 3, 7, 3, 21, 45, 97, 213, 309, 3, 483, 3933, 1043, 8519, 22517, 34675, 78819, 172479}}, {19157, 18, 96832, {1, 3, 5, 3, 31, 51, 27, 137, 405, 427, 815, 43, 6551, 10971, 28589, 53077, 36639, 167661}}, {19158, 18, 96850, {1, 3, 1, 3, 29, 5, 111, 19, 343, 21, 557, 4067, 1525, 12793, 11513, 48869, 78035, 171531}}, {19159, 18, 96856, {1, 1, 5, 7, 25, 47, 53, 245, 135, 137, 1697, 2057, 3147, 15903, 26979, 2157, 43967, 207661}}, {19160, 18, 96906, {1, 1, 5, 3, 25, 11, 15, 59, 511, 307, 757, 3275, 1299, 10373, 11943, 54169, 32417, 21645}}, {19161, 18, 96962, {1, 3, 3, 11, 15, 15, 5, 137, 237, 741, 1613, 3565, 7359, 6181, 25953, 18137, 59759, 186693}}, {19162, 18, 96974, {1, 3, 5, 3, 19, 13, 99, 167, 45, 71, 1683, 3635, 7603, 14879, 23903, 14795, 58395, 11853}}, {19163, 18, 96979, {1, 3, 1, 7, 15, 45, 111, 111, 175, 567, 1031, 2255, 3895, 11861, 20195, 15461, 88411, 225713}}, {19164, 18, 96997, {1, 1, 7, 3, 5, 5, 85, 65, 231, 643, 1591, 219, 2929, 4845, 29327, 14769, 46629, 131367}}, {19165, 18, 96998, {1, 1, 5, 9, 29, 21, 47, 87, 113, 469, 1647, 2461, 3663, 5865, 6647, 41345, 39539, 220301}}, {19166, 18, 97002, {1, 1, 5, 11, 9, 55, 5, 147, 141, 181, 283, 1695, 6537, 11095, 10385, 36013, 111653, 182273}}, {19167, 18, 97054, {1, 1, 3, 5, 17, 45, 103, 253, 407, 151, 1585, 1585, 6661, 14579, 5723, 37641, 56813, 258819}}, {19168, 18, 97064, {1, 3, 3, 3, 5, 63, 85, 201, 87, 419, 1993, 737, 5859, 6049, 17393, 9453, 65915, 1731}}, {19169, 18, 97067, {1, 1, 3, 3, 3, 27, 97, 135, 137, 731, 1559, 3409, 5973, 15981, 19833, 8419, 33273, 44155}}, {19170, 18, 97110, {1, 3, 3, 9, 31, 55, 109, 191, 119, 59, 645, 1047, 7767, 8379, 13781, 52289, 31605, 186667}}, {19171, 18, 97116, {1, 3, 1, 15, 9, 1, 23, 31, 23, 311, 1879, 1939, 5509, 14573, 10501, 38867, 39131, 231151}}, {19172, 18, 97137, {1, 3, 7, 1, 31, 33, 33, 19, 475, 723, 795, 1793, 6639, 14349, 16639, 31473, 110411, 95703}}, {19173, 18, 97138, {1, 1, 5, 9, 11, 3, 39, 119, 455, 839, 513, 2423, 2219, 6059, 6125, 60995, 117701, 204057}}, {19174, 18, 97143, {1, 1, 1, 9, 5, 23, 87, 33, 59, 241, 1427, 3867, 1091, 14683, 21651, 7091, 38011, 63809}}, {19175, 18, 97183, {1, 1, 7, 15, 15, 23, 75, 227, 415, 1015, 2033, 1311, 6659, 5093, 14799, 65331, 96989, 170395}}, {19176, 18, 97187, {1, 3, 5, 15, 25, 61, 33, 179, 503, 875, 1853, 257, 6727, 9117, 16777, 29585, 110901, 231617}}, {19177, 18, 97190, {1, 1, 1, 15, 13, 53, 73, 151, 315, 887, 669, 3959, 5279, 1461, 15497, 40107, 9595, 252059}}, {19178, 18, 97202, {1, 3, 7, 13, 17, 45, 43, 61, 99, 555, 981, 3255, 6385, 8723, 24451, 45243, 68617, 171911}}, {19179, 18, 97219, {1, 3, 3, 11, 1, 29, 97, 219, 341, 597, 503, 773, 3777, 5431, 4581, 37169, 57269, 186377}}, {19180, 18, 97239, {1, 3, 1, 11, 15, 49, 119, 189, 279, 821, 1541, 1343, 4379, 5833, 26537, 29769, 121125, 202553}}, {19181, 18, 97245, {1, 3, 5, 9, 19, 23, 5, 197, 323, 101, 1155, 7, 5933, 3111, 19595, 36807, 40147, 153}}, {19182, 18, 97246, {1, 1, 5, 11, 17, 9, 83, 51, 185, 415, 367, 1431, 7803, 8253, 16283, 54545, 99733, 57777}}, {19183, 18, 97249, {1, 1, 5, 7, 5, 31, 41, 13, 33, 531, 1381, 781, 1699, 6321, 18125, 34567, 113253, 104181}}, {19184, 18, 97264, {1, 3, 1, 5, 1, 59, 37, 239, 343, 395, 121, 2181, 2485, 13825, 19127, 22689, 103023, 198213}}, {19185, 18, 97267, {1, 3, 1, 15, 29, 17, 11, 27, 413, 273, 1805, 2845, 8147, 10301, 5423, 29859, 85243, 190379}}, {19186, 18, 97269, {1, 3, 1, 15, 7, 61, 29, 135, 273, 951, 725, 1345, 4231, 13651, 31291, 6081, 85735, 96023}}, {19187, 18, 97274, {1, 1, 3, 11, 15, 29, 81, 129, 245, 295, 527, 3905, 4323, 5447, 21253, 51177, 105105, 48323}}, {19188, 18, 97282, {1, 1, 3, 13, 13, 45, 71, 43, 383, 95, 1689, 639, 4631, 15113, 28053, 49247, 128303, 183999}}, {19189, 18, 97287, {1, 1, 1, 3, 19, 31, 93, 35, 369, 765, 1201, 1625, 7683, 8719, 13843, 42723, 62323, 49431}}, {19190, 18, 97294, {1, 3, 3, 11, 5, 39, 49, 217, 109, 63, 1753, 2489, 6017, 403, 16657, 59577, 80255, 66071}}, {19191, 18, 97299, {1, 3, 5, 5, 11, 1, 79, 37, 261, 537, 1845, 3567, 3233, 16249, 9795, 2471, 69661, 118231}}, {19192, 18, 97306, {1, 3, 3, 1, 19, 61, 35, 253, 31, 19, 161, 2597, 5733, 8231, 26569, 38613, 121945, 137391}}, {19193, 18, 97347, {1, 3, 7, 3, 15, 25, 125, 231, 187, 797, 1237, 1767, 1557, 1095, 13613, 43325, 33801, 127881}}, {19194, 18, 97361, {1, 1, 1, 9, 23, 63, 75, 107, 311, 493, 471, 2985, 1861, 4285, 27125, 14961, 122567, 152033}}, {19195, 18, 97371, {1, 3, 5, 7, 9, 7, 43, 117, 203, 727, 101, 3831, 3201, 2327, 4675, 12085, 25131, 211835}}, {19196, 18, 97435, {1, 1, 7, 11, 17, 1, 5, 87, 291, 1023, 1345, 3879, 7739, 9201, 19573, 20037, 128711, 187263}}, {19197, 18, 97466, {1, 1, 3, 13, 25, 39, 71, 251, 365, 617, 1539, 2121, 3803, 8003, 23393, 56991, 56143, 223453}}, {19198, 18, 97473, {1, 3, 5, 13, 25, 61, 71, 139, 319, 399, 903, 3063, 3667, 275, 13297, 25285, 120417, 169613}}, {19199, 18, 97474, {1, 3, 1, 9, 9, 41, 59, 213, 195, 705, 313, 2313, 4993, 323, 24049, 30527, 27287, 80489}}, {19200, 18, 97559, {1, 1, 5, 1, 29, 57, 107, 161, 217, 295, 721, 3857, 1935, 14981, 12243, 38541, 51177, 248889}}, {19201, 18, 97565, {1, 1, 1, 15, 5, 25, 95, 137, 11, 215, 971, 1573, 4341, 4725, 8201, 33147, 87687, 187405}}, {19202, 18, 97587, {1, 3, 3, 9, 9, 13, 31, 3, 175, 309, 145, 2265, 4863, 7199, 23881, 15445, 123753, 126653}}, {19203, 18, 97611, {1, 1, 7, 3, 7, 43, 51, 191, 21, 639, 939, 691, 7823, 10529, 7757, 9291, 115045, 51539}}, {19204, 18, 97622, {1, 1, 7, 13, 7, 45, 91, 173, 73, 779, 1647, 2059, 1373, 16027, 4611, 45787, 699, 78905}}, {19205, 18, 97625, {1, 1, 5, 15, 5, 23, 123, 45, 265, 1009, 235, 1343, 5779, 209, 23263, 63163, 26079, 240905}}, {19206, 18, 97632, {1, 1, 1, 11, 19, 31, 75, 105, 71, 21, 1361, 2125, 6949, 2111, 10333, 61881, 112811, 85723}}, {19207, 18, 97635, {1, 3, 5, 7, 27, 17, 95, 35, 503, 181, 1885, 1097, 6019, 13745, 15009, 26343, 117727, 93017}}, {19208, 18, 97652, {1, 1, 3, 11, 27, 41, 109, 23, 365, 283, 1509, 3269, 5969, 14567, 27715, 429, 65813, 169391}}, {19209, 18, 97672, {1, 1, 5, 9, 11, 1, 23, 143, 401, 61, 993, 3029, 1901, 12947, 10439, 48661, 113863, 9353}}, {19210, 18, 97678, {1, 3, 7, 3, 15, 27, 123, 51, 403, 569, 75, 3837, 8167, 10875, 29861, 44133, 52385, 185515}}, {19211, 18, 97683, {1, 3, 3, 15, 15, 45, 3, 77, 439, 265, 103, 3715, 7889, 9241, 26511, 19063, 108239, 237233}}, {19212, 18, 97695, {1, 1, 5, 13, 7, 47, 7, 185, 155, 833, 1895, 1103, 6761, 4307, 19551, 2371, 41079, 207663}}, {19213, 18, 97705, {1, 1, 3, 7, 1, 49, 79, 127, 149, 383, 919, 3787, 6703, 8823, 15551, 28397, 11497, 144227}}, {19214, 18, 97713, {1, 1, 7, 15, 7, 5, 9, 161, 425, 275, 1943, 3003, 3615, 1417, 587, 20949, 9651, 101257}}, {19215, 18, 97719, {1, 3, 5, 11, 31, 11, 113, 201, 113, 889, 867, 3537, 7173, 3403, 4713, 29709, 50127, 55893}}, {19216, 18, 97757, {1, 3, 7, 11, 11, 17, 123, 97, 3, 1009, 1567, 3261, 8053, 4639, 24493, 64085, 73975, 123965}}, {19217, 18, 97761, {1, 1, 7, 1, 31, 7, 111, 137, 427, 615, 865, 2243, 3603, 5943, 1639, 22213, 81977, 77283}}, {19218, 18, 97762, {1, 1, 5, 11, 25, 63, 5, 19, 67, 469, 621, 2831, 1635, 11859, 23143, 29189, 43955, 87475}}, {19219, 18, 97771, {1, 3, 7, 15, 7, 61, 125, 207, 401, 567, 1943, 2645, 641, 15427, 24467, 41767, 122591, 48905}}, {19220, 18, 97795, {1, 3, 3, 5, 1, 61, 65, 169, 329, 489, 435, 1719, 491, 6189, 18383, 34973, 90611, 180991}}, {19221, 18, 97809, {1, 3, 7, 9, 25, 43, 115, 11, 289, 193, 263, 3885, 4881, 15669, 19757, 20073, 119873, 67069}}, {19222, 18, 97826, {1, 1, 7, 11, 3, 45, 93, 115, 233, 891, 1541, 2557, 2115, 2237, 4253, 30445, 32983, 86185}}, {19223, 18, 97845, {1, 3, 7, 3, 29, 23, 105, 51, 157, 505, 773, 2403, 1237, 5193, 32725, 53331, 66377, 25745}}, {19224, 18, 97877, {1, 3, 5, 11, 31, 5, 111, 251, 287, 225, 913, 97, 3429, 15111, 10637, 18843, 102589, 229667}}, {19225, 18, 97882, {1, 3, 7, 13, 21, 43, 27, 11, 265, 991, 1645, 1967, 2675, 3083, 2957, 65275, 7757, 201953}}, {19226, 18, 97891, {1, 3, 7, 7, 23, 59, 37, 105, 113, 961, 1585, 855, 6037, 8461, 24057, 46861, 42421, 21061}}, {19227, 18, 97903, {1, 1, 5, 1, 7, 45, 37, 147, 225, 793, 737, 753, 565, 5347, 15393, 42611, 39253, 246455}}, {19228, 18, 97961, {1, 3, 3, 5, 29, 59, 125, 69, 283, 677, 1615, 3341, 219, 10753, 445, 43343, 117035, 137907}}, {19229, 18, 97970, {1, 1, 5, 1, 19, 41, 93, 137, 481, 93, 703, 1211, 4051, 5591, 5913, 32831, 62027, 60519}}, {19230, 18, 97975, {1, 1, 7, 13, 17, 63, 65, 147, 361, 83, 1383, 1761, 579, 9493, 2611, 6951, 12197, 81857}}, {19231, 18, 97996, {1, 3, 3, 15, 11, 3, 25, 7, 221, 211, 1745, 1173, 5479, 12063, 5667, 43443, 4865, 193345}}, {19232, 18, 98001, {1, 1, 5, 11, 31, 11, 71, 61, 57, 851, 1089, 1395, 4525, 1223, 27681, 14355, 23125, 257233}}, {19233, 18, 98014, {1, 3, 1, 11, 25, 59, 17, 193, 229, 1005, 387, 3993, 2457, 4185, 18421, 1315, 125155, 142277}}, {19234, 18, 98023, {1, 1, 5, 11, 13, 55, 123, 191, 5, 1023, 705, 3481, 367, 12961, 11917, 12131, 99109, 105093}}, {19235, 18, 98035, {1, 1, 3, 11, 13, 29, 57, 57, 467, 19, 1409, 971, 3041, 13487, 24737, 3377, 97883, 248893}}, {19236, 18, 98052, {1, 3, 7, 3, 3, 37, 109, 77, 201, 469, 39, 1747, 2027, 14781, 18821, 34647, 123865, 195097}}, {19237, 18, 98059, {1, 3, 3, 5, 29, 27, 97, 217, 249, 141, 431, 1621, 539, 8945, 3443, 48227, 27867, 205355}}, {19238, 18, 98061, {1, 1, 3, 13, 7, 57, 65, 167, 103, 511, 239, 325, 1793, 2811, 14223, 40999, 12589, 149759}}, {19239, 18, 98086, {1, 3, 5, 11, 3, 1, 61, 87, 283, 29, 507, 3473, 2685, 13829, 32337, 8413, 12201, 152309}}, {19240, 18, 98098, {1, 3, 5, 15, 1, 23, 103, 173, 423, 915, 1519, 1859, 7341, 8689, 17141, 53769, 81189, 144305}}, {19241, 18, 98117, {1, 1, 1, 5, 31, 41, 89, 117, 329, 245, 381, 3357, 1053, 15079, 3569, 27665, 65645, 259279}}, {19242, 18, 98118, {1, 1, 7, 5, 3, 55, 91, 35, 463, 15, 1195, 533, 6013, 10755, 1919, 61169, 81285, 82757}}, {19243, 18, 98132, {1, 3, 5, 11, 3, 29, 85, 169, 163, 733, 939, 3401, 3709, 3307, 17329, 56873, 10721, 174235}}, {19244, 18, 98135, {1, 1, 5, 1, 11, 45, 75, 247, 435, 21, 1985, 2261, 7013, 4935, 2457, 41077, 53121, 143269}}, {19245, 18, 98145, {1, 3, 3, 13, 17, 59, 43, 149, 27, 1, 367, 957, 5607, 2591, 22161, 10095, 73769, 52455}}, {19246, 18, 98160, {1, 1, 3, 13, 15, 15, 121, 83, 469, 819, 1973, 3595, 2313, 1621, 3105, 42971, 7243, 98727}}, {19247, 18, 98194, {1, 1, 5, 7, 21, 53, 123, 9, 119, 437, 1567, 431, 3647, 10967, 22037, 8523, 81279, 126473}}, {19248, 18, 98205, {1, 1, 5, 13, 5, 23, 125, 119, 195, 555, 341, 2037, 313, 6323, 27201, 8377, 122793, 197781}}, {19249, 18, 98210, {1, 3, 3, 5, 17, 25, 67, 237, 349, 443, 1529, 3541, 3105, 10105, 13409, 20165, 64597, 244513}}, {19250, 18, 98224, {1, 1, 5, 1, 11, 43, 77, 245, 359, 625, 1171, 597, 3, 591, 2457, 20275, 75995, 204685}}, {19251, 18, 98227, {1, 3, 1, 11, 5, 13, 99, 107, 285, 617, 1687, 2959, 4439, 771, 3103, 62363, 89437, 172221}}, {19252, 18, 98254, {1, 3, 1, 11, 1, 63, 43, 85, 23, 95, 501, 1223, 669, 16101, 1071, 53175, 102101, 419}}, {19253, 18, 98271, {1, 3, 1, 5, 19, 23, 63, 105, 289, 419, 885, 441, 5107, 4213, 8683, 1847, 113301, 240821}}, {19254, 18, 98272, {1, 1, 1, 9, 9, 9, 111, 63, 53, 531, 517, 3463, 8171, 2645, 13883, 52213, 40707, 24637}}, {19255, 18, 98302, {1, 3, 1, 5, 15, 43, 71, 215, 117, 685, 1819, 1105, 5805, 8875, 31093, 31077, 93807, 65631}}, {19256, 18, 98320, {1, 1, 7, 7, 17, 15, 31, 87, 13, 615, 2003, 3461, 7585, 1947, 6693, 26141, 95059, 52229}}, {19257, 18, 98346, {1, 1, 3, 5, 5, 55, 7, 41, 473, 541, 545, 2901, 763, 12731, 24715, 43301, 7981, 123961}}, {19258, 18, 98356, {1, 3, 1, 11, 13, 29, 65, 47, 511, 931, 1681, 3813, 995, 4261, 32243, 21327, 33749, 52607}}, {19259, 18, 98360, {1, 1, 3, 1, 27, 51, 19, 119, 71, 989, 485, 1483, 4115, 11743, 5513, 32447, 62599, 163185}}, {19260, 18, 98366, {1, 3, 7, 13, 7, 5, 127, 67, 221, 773, 1641, 3763, 2061, 2025, 29813, 64385, 109219, 70149}}, {19261, 18, 98478, {1, 1, 5, 15, 9, 29, 105, 245, 333, 11, 803, 1877, 6735, 3797, 1913, 63837, 23649, 234721}}, {19262, 18, 98483, {1, 3, 7, 13, 11, 21, 113, 175, 385, 885, 1259, 983, 7715, 11889, 12515, 35723, 9897, 63415}}, {19263, 18, 98486, {1, 1, 5, 9, 31, 63, 53, 51, 375, 133, 2021, 3173, 3861, 9885, 4117, 37505, 73687, 16411}}, {19264, 18, 98497, {1, 3, 7, 7, 11, 13, 99, 235, 285, 159, 489, 917, 3033, 7711, 6545, 52893, 28549, 68791}}, {19265, 18, 98528, {1, 1, 5, 11, 31, 15, 89, 157, 105, 347, 455, 3391, 5341, 16035, 11819, 57679, 48057, 147673}}, {19266, 18, 98537, {1, 3, 1, 5, 21, 5, 1, 41, 213, 677, 1745, 2591, 6237, 14265, 5963, 30017, 47293, 199411}}, {19267, 18, 98551, {1, 3, 1, 15, 19, 9, 65, 103, 489, 977, 579, 2571, 2827, 12971, 24445, 17963, 68829, 89781}}, {19268, 18, 98557, {1, 3, 5, 7, 3, 45, 9, 223, 137, 749, 919, 2695, 7569, 6735, 16649, 55899, 91531, 10709}}, {19269, 18, 98572, {1, 1, 5, 11, 25, 51, 81, 243, 473, 85, 1189, 2317, 785, 9307, 25555, 36623, 66881, 150945}}, {19270, 18, 98575, {1, 1, 3, 7, 9, 17, 99, 57, 333, 891, 71, 2359, 2067, 13265, 30077, 17935, 47343, 22673}}, {19271, 18, 98600, {1, 1, 5, 7, 13, 17, 77, 109, 427, 667, 1367, 2383, 7505, 11239, 14229, 35431, 35473, 62447}}, {19272, 18, 98628, {1, 1, 1, 15, 27, 5, 51, 221, 471, 877, 449, 3961, 4197, 15713, 2955, 58985, 31431, 241539}}, {19273, 18, 98635, {1, 1, 7, 1, 13, 61, 55, 199, 87, 679, 723, 271, 1061, 8043, 13163, 8079, 81501, 60467}}, {19274, 18, 98645, {1, 1, 3, 3, 11, 1, 85, 65, 445, 731, 2017, 3113, 8085, 7133, 14789, 2435, 38459, 234997}}, {19275, 18, 98652, {1, 3, 3, 9, 23, 31, 49, 137, 349, 651, 1975, 3429, 7137, 7841, 28297, 58209, 36493, 259097}}, {19276, 18, 98655, {1, 1, 7, 15, 23, 11, 87, 133, 245, 445, 151, 4075, 141, 15395, 16649, 36925, 98421, 217265}}, {19277, 18, 98665, {1, 3, 3, 5, 25, 53, 57, 177, 481, 177, 671, 1249, 2663, 12855, 24537, 31867, 110323, 164113}}, {19278, 18, 98710, {1, 3, 5, 7, 23, 25, 19, 91, 447, 1023, 373, 3863, 4399, 12973, 7475, 37485, 8567, 53271}}, {19279, 18, 98719, {1, 1, 5, 7, 31, 33, 31, 75, 223, 299, 1549, 1863, 353, 4339, 8891, 10365, 3399, 185807}}, {19280, 18, 98720, {1, 1, 7, 9, 31, 53, 23, 203, 319, 915, 1923, 205, 3119, 7243, 25251, 12907, 101921, 102695}}, {19281, 18, 98786, {1, 1, 7, 9, 15, 1, 123, 173, 123, 215, 263, 3003, 5881, 1117, 15195, 47457, 66663, 224177}}, {19282, 18, 98792, {1, 1, 7, 13, 11, 25, 61, 121, 173, 115, 1897, 2145, 7783, 9673, 3321, 1707, 61475, 53875}}, {19283, 18, 98806, {1, 3, 7, 3, 31, 21, 27, 99, 421, 225, 1565, 2351, 2275, 10583, 7877, 43505, 27629, 140919}}, {19284, 18, 98816, {1, 3, 5, 5, 11, 45, 71, 105, 487, 867, 361, 3995, 2039, 1495, 27481, 4753, 20657, 67077}}, {19285, 18, 98836, {1, 1, 5, 1, 19, 33, 1, 77, 377, 353, 719, 1463, 7053, 7409, 32165, 15557, 117673, 69887}}, {19286, 18, 98859, {1, 1, 5, 7, 25, 5, 15, 231, 23, 213, 1627, 1801, 7793, 651, 9903, 51745, 111611, 39679}}, {19287, 18, 98864, {1, 3, 3, 5, 23, 43, 37, 199, 437, 19, 1853, 2119, 461, 12641, 15865, 39941, 122545, 213443}}, {19288, 18, 98879, {1, 3, 3, 11, 31, 45, 19, 227, 507, 909, 1501, 2021, 905, 1763, 1897, 3735, 81475, 30005}}, {19289, 18, 98905, {1, 1, 5, 5, 29, 9, 55, 25, 23, 59, 593, 2197, 6029, 8235, 8397, 27521, 96221, 168837}}, {19290, 18, 98917, {1, 3, 1, 15, 5, 33, 75, 121, 433, 557, 1011, 3785, 2545, 953, 17295, 14407, 94871, 60445}}, {19291, 18, 98929, {1, 3, 3, 7, 7, 53, 29, 75, 171, 587, 1701, 3815, 2761, 4403, 39, 17291, 34897, 187257}}, {19292, 18, 98969, {1, 3, 1, 15, 17, 57, 11, 95, 335, 13, 265, 1161, 7945, 6419, 26723, 31907, 89995, 82265}}, {19293, 18, 98975, {1, 1, 7, 5, 9, 59, 27, 153, 37, 165, 823, 3525, 621, 4777, 3485, 9109, 116567, 34691}}, {19294, 18, 98976, {1, 1, 5, 13, 23, 27, 11, 63, 35, 39, 995, 2101, 2611, 14139, 2683, 63787, 19813, 97497}}, {19295, 18, 98981, {1, 3, 7, 15, 31, 15, 3, 163, 167, 53, 71, 1881, 4213, 3485, 21525, 705, 122345, 203549}}, {19296, 18, 98999, {1, 3, 5, 5, 21, 33, 85, 133, 21, 505, 1639, 3989, 771, 7171, 21953, 34503, 31247, 247459}}, {19297, 18, 99020, {1, 1, 7, 7, 31, 1, 27, 39, 469, 243, 679, 4091, 7137, 8505, 13329, 34139, 69485, 259795}}, {19298, 18, 99026, {1, 3, 5, 5, 31, 43, 31, 161, 413, 657, 1407, 1417, 7349, 3301, 7691, 49355, 22929, 68043}}, {19299, 18, 99054, {1, 1, 7, 11, 15, 61, 73, 217, 163, 503, 193, 3795, 41, 16251, 1187, 65363, 113211, 100337}}, {19300, 18, 99083, {1, 3, 1, 11, 9, 15, 109, 187, 109, 865, 845, 1579, 321, 1269, 20613, 5693, 58421, 254959}}, {19301, 18, 99093, {1, 3, 1, 13, 11, 3, 19, 135, 93, 779, 1383, 219, 2737, 377, 1125, 35663, 130815, 103797}}, {19302, 18, 99103, {1, 1, 5, 11, 25, 25, 71, 249, 201, 679, 1677, 1817, 7619, 10327, 14821, 47847, 33629, 250979}}, {19303, 18, 99131, {1, 1, 7, 15, 23, 19, 69, 39, 25, 843, 99, 3499, 2457, 11681, 30009, 17609, 46653, 162427}}, {19304, 18, 99156, {1, 3, 3, 7, 23, 25, 77, 135, 61, 501, 1381, 3977, 1957, 11255, 16053, 30297, 58835, 97589}}, {19305, 18, 99159, {1, 3, 5, 3, 9, 31, 9, 55, 421, 109, 1823, 1921, 7349, 2661, 4503, 36691, 48843, 182631}}, {19306, 18, 99165, {1, 1, 1, 11, 7, 23, 107, 125, 393, 105, 1407, 3461, 4539, 6121, 7881, 32407, 83749, 98831}}, {19307, 18, 99170, {1, 3, 3, 13, 5, 59, 5, 3, 185, 959, 241, 819, 1443, 1789, 12771, 26703, 25399, 182583}}, {19308, 18, 99189, {1, 1, 1, 3, 3, 47, 7, 45, 93, 373, 175, 87, 649, 12903, 5029, 1945, 111967, 140889}}, {19309, 18, 99223, {1, 3, 1, 11, 9, 47, 25, 191, 215, 845, 1557, 9, 3451, 5837, 11763, 29127, 113115, 99039}}, {19310, 18, 99227, {1, 1, 1, 5, 23, 53, 45, 1, 361, 751, 807, 1765, 685, 2109, 28437, 60489, 65739, 234511}}, {19311, 18, 99271, {1, 3, 3, 7, 15, 57, 71, 61, 195, 123, 1745, 3249, 351, 14309, 2017, 15653, 110803, 45937}}, {19312, 18, 99277, {1, 3, 7, 9, 25, 11, 25, 29, 467, 313, 1927, 2423, 7311, 14299, 8145, 8123, 115103, 213881}}, {19313, 18, 99278, {1, 1, 3, 15, 1, 35, 111, 99, 507, 417, 1433, 129, 5565, 13365, 18853, 8607, 109739, 120623}}, {19314, 18, 99313, {1, 1, 1, 7, 13, 31, 93, 3, 327, 67, 1101, 1965, 5939, 6505, 3117, 3021, 33707, 79353}}, {19315, 18, 99314, {1, 1, 3, 7, 15, 21, 23, 117, 367, 137, 287, 903, 4685, 13943, 26779, 24607, 70853, 99743}}, {19316, 18, 99345, {1, 1, 7, 11, 25, 43, 67, 181, 459, 737, 1567, 3491, 5085, 6487, 23115, 62341, 102943, 77301}}, {19317, 18, 99361, {1, 1, 3, 15, 7, 35, 81, 199, 455, 851, 835, 3421, 4675, 15173, 9205, 7305, 109849, 15183}}, {19318, 18, 99367, {1, 3, 5, 11, 9, 55, 3, 53, 235, 271, 1265, 3681, 3627, 3485, 11591, 53097, 85949, 158173}}, {19319, 18, 99386, {1, 3, 7, 3, 15, 27, 57, 183, 487, 9, 1797, 2973, 3687, 12987, 9133, 14595, 52067, 131217}}, {19320, 18, 99394, {1, 1, 5, 3, 7, 25, 19, 215, 291, 325, 813, 577, 4249, 10373, 17233, 29557, 72979, 70721}}, {19321, 18, 99417, {1, 3, 1, 7, 25, 1, 107, 167, 367, 303, 883, 993, 4189, 6557, 13697, 15251, 77065, 116127}}, {19322, 18, 99418, {1, 3, 5, 11, 13, 59, 9, 121, 489, 593, 1503, 601, 5263, 13837, 20991, 35761, 45867, 155905}}, {19323, 18, 99453, {1, 1, 3, 3, 19, 47, 127, 115, 267, 261, 969, 961, 5919, 10085, 29363, 4935, 100485, 75561}}, {19324, 18, 99454, {1, 3, 1, 15, 11, 53, 39, 187, 53, 11, 1951, 913, 965, 2565, 5457, 3237, 24923, 245681}}, {19325, 18, 99477, {1, 1, 7, 3, 15, 5, 25, 45, 17, 45, 1317, 1853, 6627, 15879, 29935, 24749, 118149, 35359}}, {19326, 18, 99518, {1, 1, 7, 1, 21, 45, 67, 71, 25, 743, 925, 3441, 3013, 1613, 6321, 12491, 119931, 164701}}, {19327, 18, 99544, {1, 1, 7, 1, 13, 15, 35, 187, 91, 995, 401, 2443, 4183, 10823, 20589, 27413, 117095, 20359}}, {19328, 18, 99559, {1, 3, 3, 7, 15, 51, 55, 167, 409, 859, 719, 3223, 2457, 16013, 13639, 4027, 79339, 225113}}, {19329, 18, 99592, {1, 3, 1, 9, 3, 29, 105, 193, 279, 27, 1093, 2199, 6983, 619, 10163, 40365, 71015, 102191}}, {19330, 18, 99597, {1, 1, 3, 9, 29, 5, 33, 247, 27, 299, 2017, 379, 6199, 15047, 18329, 3493, 47679, 76703}}, {19331, 18, 99603, {1, 3, 5, 5, 9, 19, 51, 129, 157, 831, 1373, 653, 7489, 13125, 1815, 10915, 88679, 50269}}, {19332, 18, 99621, {1, 3, 3, 9, 9, 49, 79, 11, 181, 679, 1697, 3707, 205, 13305, 6293, 56653, 42619, 116257}}, {19333, 18, 99646, {1, 1, 5, 9, 23, 41, 17, 135, 145, 715, 257, 1561, 6941, 2411, 31459, 25055, 35807, 51579}}, {19334, 18, 99693, {1, 1, 1, 7, 11, 13, 49, 155, 403, 569, 751, 2959, 425, 13949, 22047, 49829, 71925, 101647}}, {19335, 18, 99722, {1, 1, 3, 15, 15, 15, 17, 213, 113, 395, 1999, 2039, 3623, 13255, 24435, 54487, 78773, 202637}}, {19336, 18, 99760, {1, 3, 7, 9, 5, 21, 61, 165, 97, 349, 1131, 2677, 333, 13129, 2137, 22909, 95795, 143081}}, {19337, 18, 99780, {1, 1, 1, 5, 31, 41, 109, 179, 295, 475, 639, 3929, 1841, 7545, 19411, 52573, 10173, 236769}}, {19338, 18, 99789, {1, 1, 1, 5, 27, 51, 9, 217, 393, 671, 931, 433, 7303, 16295, 6727, 5703, 88241, 132665}}, {19339, 18, 99804, {1, 1, 7, 13, 21, 33, 19, 241, 497, 519, 1413, 489, 4975, 1345, 24925, 40383, 110815, 136217}}, {19340, 18, 99823, {1, 3, 1, 9, 7, 51, 79, 15, 15, 601, 997, 3713, 7829, 903, 12393, 60059, 42057, 175141}}, {19341, 18, 99826, {1, 1, 5, 15, 9, 63, 107, 63, 495, 591, 207, 779, 8069, 3013, 23839, 3075, 127481, 193885}}, {19342, 18, 99832, {1, 1, 1, 7, 13, 17, 121, 171, 99, 59, 1043, 1109, 1337, 1179, 27635, 34063, 12945, 1431}}, {19343, 18, 99842, {1, 3, 1, 3, 5, 47, 101, 205, 157, 595, 263, 3887, 7015, 4693, 15211, 25381, 128803, 227233}}, {19344, 18, 99851, {1, 1, 3, 11, 17, 33, 1, 19, 153, 603, 119, 2305, 4041, 4011, 19849, 761, 52807, 129811}}, {19345, 18, 99862, {1, 3, 7, 15, 21, 7, 13, 225, 497, 459, 389, 911, 6349, 5059, 6363, 41915, 90687, 214501}}, {19346, 18, 99871, {1, 3, 1, 15, 1, 39, 31, 83, 147, 629, 185, 1913, 3217, 959, 651, 65267, 108613, 20391}}, {19347, 18, 99899, {1, 3, 1, 7, 9, 11, 29, 201, 245, 815, 1869, 2597, 5693, 15669, 23293, 30885, 4029, 225737}}, {19348, 18, 99940, {1, 3, 5, 11, 7, 29, 119, 207, 499, 23, 1563, 3645, 3839, 2509, 24043, 64231, 22509, 221835}}, {19349, 18, 99983, {1, 3, 3, 7, 11, 49, 13, 201, 353, 217, 831, 2803, 1521, 12989, 25339, 41035, 2125, 165271}}, {19350, 18, 99985, {1, 1, 5, 11, 1, 45, 93, 29, 55, 1007, 1919, 241, 5931, 9211, 17291, 39849, 25453, 96077}}, {19351, 18, 100025, {1, 3, 1, 1, 29, 43, 11, 105, 331, 693, 1363, 291, 8191, 7813, 14135, 38287, 15469, 256913}}, {19352, 18, 100043, {1, 3, 5, 11, 19, 21, 23, 117, 253, 111, 733, 3785, 5835, 423, 30251, 27283, 79561, 162095}}, {19353, 18, 100070, {1, 3, 3, 1, 9, 19, 83, 13, 37, 725, 1597, 1117, 8067, 8085, 1315, 41813, 8973, 175525}}, {19354, 18, 100076, {1, 1, 5, 3, 13, 39, 3, 213, 335, 907, 1143, 1729, 601, 11255, 24351, 41045, 11335, 186221}}, {19355, 18, 100084, {1, 3, 3, 9, 17, 11, 29, 33, 303, 815, 1607, 2403, 8095, 4213, 16697, 64733, 24439, 93081}}, {19356, 18, 100096, {1, 1, 1, 3, 13, 37, 35, 181, 243, 645, 1915, 3521, 569, 3005, 7271, 32755, 64575, 119813}}, {19357, 18, 100105, {1, 1, 5, 13, 25, 59, 77, 121, 459, 755, 385, 1893, 1227, 9957, 5069, 40063, 27261, 4703}}, {19358, 18, 100108, {1, 3, 1, 3, 29, 41, 95, 255, 219, 21, 317, 3021, 2615, 5101, 19413, 25795, 6521, 157749}}, {19359, 18, 100123, {1, 3, 3, 5, 7, 33, 7, 205, 415, 23, 1431, 117, 1605, 9541, 11825, 49195, 86341, 99673}}, {19360, 18, 100132, {1, 3, 3, 5, 17, 37, 33, 209, 49, 161, 321, 3697, 6483, 12859, 895, 675, 1899, 260289}}, {19361, 18, 100141, {1, 1, 3, 15, 1, 27, 83, 125, 309, 553, 505, 2209, 4931, 2593, 28253, 12879, 74971, 9047}}, {19362, 18, 100181, {1, 3, 7, 3, 15, 3, 105, 19, 41, 119, 149, 3847, 6593, 875, 23777, 4547, 57717, 139387}}, {19363, 18, 100191, {1, 1, 1, 3, 9, 43, 25, 15, 67, 609, 951, 273, 8095, 621, 24819, 17233, 53423, 192757}}, {19364, 18, 100202, {1, 3, 5, 3, 9, 49, 107, 215, 245, 217, 545, 2285, 2075, 401, 26599, 32967, 130457, 203755}}, {19365, 18, 100216, {1, 1, 5, 1, 7, 31, 87, 181, 135, 155, 9, 1431, 307, 13367, 31147, 10327, 2817, 63327}}, {19366, 18, 100246, {1, 3, 3, 3, 29, 17, 55, 201, 33, 275, 2005, 3037, 3439, 1513, 7563, 46491, 103319, 5279}}, {19367, 18, 100256, {1, 3, 7, 11, 31, 63, 105, 169, 257, 225, 711, 2041, 1519, 11801, 18543, 35173, 92125, 72729}}, {19368, 18, 100271, {1, 1, 3, 3, 11, 13, 127, 231, 229, 809, 303, 1167, 47, 4281, 2373, 10455, 74685, 131775}}, {19369, 18, 100285, {1, 1, 5, 15, 1, 5, 97, 139, 189, 39, 37, 3513, 2119, 1453, 11477, 45477, 75613, 169915}}, {19370, 18, 100294, {1, 3, 5, 1, 15, 27, 31, 87, 311, 785, 489, 1331, 5259, 6963, 26441, 41675, 107187, 60723}}, {19371, 18, 100305, {1, 1, 3, 5, 13, 9, 33, 3, 273, 357, 841, 1421, 5993, 12449, 6821, 4283, 9437, 215035}}, {19372, 18, 100321, {1, 3, 3, 1, 15, 43, 101, 35, 23, 743, 29, 3953, 3095, 14355, 25977, 12513, 54565, 20199}}, {19373, 18, 100331, {1, 3, 3, 1, 11, 53, 99, 95, 63, 503, 1361, 3231, 2445, 5073, 4667, 33033, 4575, 139475}}, {19374, 18, 100334, {1, 3, 3, 5, 19, 57, 15, 115, 125, 1017, 1913, 907, 2461, 3229, 16591, 6591, 26385, 228661}}, {19375, 18, 100345, {1, 3, 1, 11, 27, 19, 7, 121, 245, 997, 1743, 2571, 1333, 9603, 27811, 42081, 44365, 94943}}, {19376, 18, 100346, {1, 3, 1, 1, 13, 5, 127, 217, 63, 137, 989, 1441, 1133, 8273, 18091, 22243, 122931, 28867}}, {19377, 18, 100369, {1, 1, 7, 15, 23, 39, 57, 83, 321, 817, 819, 223, 4803, 6935, 2027, 20373, 119683, 29781}}, {19378, 18, 100372, {1, 1, 7, 7, 9, 1, 55, 211, 455, 283, 1647, 471, 4351, 14119, 6945, 63117, 109687, 200165}}, {19379, 18, 100382, {1, 1, 7, 7, 29, 45, 113, 253, 135, 375, 1091, 959, 1423, 1241, 31689, 33751, 73459, 91769}}, {19380, 18, 100403, {1, 3, 5, 11, 23, 63, 55, 181, 453, 267, 995, 1309, 2847, 3791, 21683, 59809, 81891, 132635}}, {19381, 18, 100451, {1, 1, 1, 13, 17, 37, 87, 17, 61, 689, 1895, 3877, 4717, 6447, 22329, 1619, 30069, 190887}}, {19382, 18, 100488, {1, 3, 1, 7, 27, 61, 17, 51, 99, 909, 85, 951, 107, 1923, 35, 63389, 90273, 152643}}, {19383, 18, 100499, {1, 1, 1, 1, 15, 39, 77, 255, 191, 613, 655, 1881, 267, 3927, 18025, 13825, 15381, 169193}}, {19384, 18, 100501, {1, 3, 3, 1, 31, 17, 73, 69, 231, 221, 501, 3755, 1671, 2049, 22493, 16353, 1775, 181783}}, {19385, 18, 100511, {1, 1, 7, 5, 31, 45, 125, 189, 287, 487, 1911, 3133, 3257, 8967, 21295, 1247, 72297, 68269}}, {19386, 18, 100536, {1, 3, 3, 1, 7, 9, 123, 147, 7, 381, 1597, 1289, 7831, 14493, 21145, 15487, 70353, 147891}}, {19387, 18, 100629, {1, 1, 5, 9, 15, 17, 43, 87, 101, 425, 1819, 163, 6741, 8255, 2591, 17719, 112871, 110793}}, {19388, 18, 100652, {1, 1, 3, 9, 3, 27, 7, 41, 43, 743, 131, 705, 2607, 9963, 26367, 41191, 126347, 164291}}, {19389, 18, 100655, {1, 3, 3, 15, 7, 17, 97, 153, 283, 461, 1723, 2421, 4973, 16369, 30633, 62299, 119425, 3591}}, {19390, 18, 100669, {1, 1, 1, 13, 7, 33, 95, 255, 429, 693, 849, 3783, 5985, 8551, 23227, 1015, 109023, 42493}}, {19391, 18, 100687, {1, 3, 1, 7, 3, 43, 53, 137, 413, 265, 2033, 1347, 335, 529, 24751, 16443, 122195, 158951}}, {19392, 18, 100692, {1, 1, 5, 9, 27, 21, 83, 185, 325, 557, 1247, 2739, 6925, 5459, 26027, 62217, 61113, 197743}}, {19393, 18, 100696, {1, 1, 3, 13, 9, 57, 79, 133, 137, 851, 863, 1605, 7839, 11809, 29941, 20473, 6687, 164479}}, {19394, 18, 100701, {1, 1, 3, 9, 9, 51, 123, 29, 139, 43, 1329, 2701, 3413, 3875, 19673, 62369, 10529, 226525}}, {19395, 18, 100706, {1, 3, 1, 5, 25, 47, 7, 201, 119, 623, 9, 25, 1713, 10817, 8201, 5847, 77477, 237883}}, {19396, 18, 100711, {1, 1, 5, 13, 15, 53, 39, 93, 235, 619, 1695, 2389, 2571, 2389, 4619, 45769, 17245, 69973}}, {19397, 18, 100726, {1, 1, 7, 1, 31, 9, 75, 143, 1, 67, 809, 1037, 2801, 16129, 22443, 26021, 119683, 14681}}, {19398, 18, 100754, {1, 3, 1, 9, 23, 49, 69, 71, 139, 953, 1053, 3059, 1061, 5881, 26207, 15907, 79389, 95341}}, {19399, 18, 100759, {1, 3, 5, 1, 19, 39, 69, 183, 95, 289, 847, 393, 1649, 1275, 21187, 34715, 67553, 123239}}, {19400, 18, 100790, {1, 1, 1, 5, 21, 39, 119, 193, 347, 87, 731, 3327, 6089, 13781, 20389, 52303, 11869, 48975}}, {19401, 18, 100838, {1, 3, 5, 1, 19, 17, 93, 33, 215, 457, 687, 1325, 1997, 2655, 21195, 54997, 36877, 57991}}, {19402, 18, 100878, {1, 1, 1, 3, 17, 45, 91, 45, 231, 611, 413, 2321, 7181, 13765, 7791, 6973, 24497, 231795}}, {19403, 18, 100880, {1, 3, 3, 15, 7, 29, 103, 31, 295, 637, 1775, 2293, 8001, 4175, 1257, 16881, 93695, 180591}}, {19404, 18, 100885, {1, 1, 1, 13, 31, 7, 47, 51, 267, 231, 463, 939, 7977, 8593, 15329, 36871, 50449, 222341}}, {19405, 18, 100886, {1, 3, 7, 3, 27, 31, 57, 135, 507, 177, 1455, 1963, 4473, 6449, 727, 49853, 65275, 237531}}, {19406, 18, 100943, {1, 3, 7, 11, 31, 21, 111, 231, 269, 27, 719, 3275, 2489, 3689, 3425, 23763, 39413, 64565}}, {19407, 18, 100948, {1, 1, 1, 11, 23, 27, 31, 153, 201, 985, 1553, 3061, 7663, 4079, 13549, 48765, 64169, 68223}}, {19408, 18, 100957, {1, 1, 7, 15, 11, 53, 125, 23, 73, 799, 591, 665, 127, 3941, 11251, 12649, 2657, 230923}}, {19409, 18, 100962, {1, 1, 7, 15, 29, 43, 95, 81, 337, 367, 779, 1237, 7627, 997, 3355, 1245, 70477, 159097}}, {19410, 18, 100968, {1, 3, 1, 13, 19, 31, 11, 91, 179, 425, 1395, 1439, 2723, 401, 26779, 36723, 115743, 179653}}, {19411, 18, 100981, {1, 1, 3, 1, 29, 35, 11, 217, 301, 421, 765, 1949, 5475, 2247, 3953, 27091, 16895, 194821}}, {19412, 18, 100986, {1, 1, 5, 9, 11, 21, 95, 135, 127, 65, 609, 3893, 7143, 13231, 29199, 36205, 38711, 159599}}, {19413, 18, 101001, {1, 3, 5, 13, 25, 25, 101, 221, 495, 993, 961, 2575, 907, 5277, 18415, 1797, 22043, 129889}}, {19414, 18, 101012, {1, 1, 1, 15, 21, 21, 99, 3, 175, 735, 659, 543, 7573, 15549, 14067, 60009, 65785, 112927}}, {19415, 18, 101015, {1, 3, 7, 7, 3, 39, 61, 203, 143, 581, 487, 2097, 3943, 6869, 14435, 46431, 101781, 233067}}, {19416, 18, 101019, {1, 1, 3, 1, 13, 27, 21, 147, 295, 89, 1845, 1017, 4621, 10029, 3517, 25371, 104531, 225179}}, {19417, 18, 101037, {1, 1, 3, 11, 25, 51, 45, 179, 299, 487, 2039, 85, 4643, 8211, 12051, 64819, 93481, 159511}}, {19418, 18, 101063, {1, 1, 5, 3, 21, 7, 73, 193, 415, 7, 125, 2487, 7369, 2043, 7633, 19265, 65337, 57399}}, {19419, 18, 101105, {1, 1, 5, 3, 3, 53, 51, 169, 313, 973, 1549, 243, 3155, 13827, 24971, 61393, 15147, 187397}}, {19420, 18, 101144, {1, 3, 3, 3, 29, 33, 91, 41, 367, 77, 1259, 1703, 2105, 14473, 17763, 29809, 47777, 205553}}, {19421, 18, 101147, {1, 3, 7, 3, 23, 61, 59, 235, 51, 41, 417, 691, 2953, 15577, 32283, 2793, 109557, 64729}}, {19422, 18, 101154, {1, 1, 5, 9, 13, 17, 93, 201, 151, 323, 1481, 3645, 3039, 5131, 503, 42055, 114939, 198755}}, {19423, 18, 101163, {1, 3, 5, 1, 21, 53, 75, 29, 283, 541, 499, 309, 1923, 995, 21479, 56183, 103743, 152113}}, {19424, 18, 101166, {1, 3, 1, 3, 21, 51, 67, 97, 481, 509, 805, 213, 5157, 13573, 16187, 8199, 28025, 208445}}, {19425, 18, 101173, {1, 1, 7, 7, 15, 25, 107, 127, 355, 249, 707, 1287, 6831, 5317, 15613, 12837, 48091, 27611}}, {19426, 18, 101174, {1, 3, 3, 7, 31, 53, 127, 239, 17, 709, 979, 4023, 7149, 4239, 20015, 44365, 113245, 75873}}, {19427, 18, 101219, {1, 3, 5, 11, 27, 37, 49, 123, 137, 967, 1857, 3961, 7429, 8355, 30733, 64587, 73903, 188581}}, {19428, 18, 101240, {1, 3, 3, 7, 19, 51, 69, 121, 345, 637, 1987, 335, 7071, 13849, 22369, 46895, 20761, 148227}}, {19429, 18, 101250, {1, 1, 3, 11, 9, 1, 93, 151, 487, 889, 919, 2429, 5425, 15303, 12583, 57627, 42683, 98265}}, {19430, 18, 101259, {1, 3, 5, 3, 1, 29, 87, 189, 285, 805, 933, 1381, 2789, 107, 14215, 33171, 110573, 250983}}, {19431, 18, 101273, {1, 3, 1, 1, 27, 43, 63, 115, 317, 401, 885, 1029, 7003, 10041, 15299, 42251, 58675, 177545}}, {19432, 18, 101274, {1, 3, 5, 7, 11, 33, 119, 5, 185, 777, 1795, 1585, 3543, 1801, 17681, 1041, 44513, 105435}}, {19433, 18, 101285, {1, 3, 1, 9, 19, 33, 15, 253, 299, 925, 241, 1333, 615, 12501, 499, 44449, 16595, 70357}}, {19434, 18, 101300, {1, 1, 3, 13, 13, 31, 17, 123, 215, 805, 1177, 3683, 27, 11881, 7645, 25575, 63057, 89547}}, {19435, 18, 101309, {1, 1, 5, 5, 17, 1, 57, 183, 267, 825, 1987, 329, 5603, 1295, 425, 61871, 27859, 157109}}, {19436, 18, 101310, {1, 3, 3, 11, 19, 45, 37, 79, 191, 17, 17, 3379, 7941, 3159, 20351, 26341, 34687, 116281}}, {19437, 18, 101321, {1, 1, 3, 7, 11, 7, 61, 199, 459, 993, 1729, 3751, 1067, 14965, 14669, 40281, 12579, 154601}}, {19438, 18, 101324, {1, 3, 3, 13, 19, 53, 17, 39, 137, 219, 1645, 2899, 505, 10057, 22891, 32317, 81201, 126291}}, {19439, 18, 101363, {1, 3, 5, 7, 21, 53, 65, 125, 69, 781, 761, 1683, 5817, 11859, 11543, 62853, 57149, 212261}}, {19440, 18, 101366, {1, 3, 5, 9, 13, 25, 81, 119, 439, 25, 239, 2867, 421, 12631, 22705, 31039, 96105, 79023}}, {19441, 18, 101377, {1, 3, 5, 3, 19, 9, 51, 135, 437, 393, 1711, 1205, 5195, 10927, 28583, 7513, 110227, 139295}}, {19442, 18, 101380, {1, 3, 7, 9, 31, 15, 5, 143, 49, 13, 1143, 2325, 5437, 14289, 31555, 58777, 102675, 64559}}, {19443, 18, 101389, {1, 1, 7, 3, 3, 21, 65, 127, 341, 109, 167, 1835, 6687, 1695, 15631, 47047, 127543, 51413}}, {19444, 18, 101407, {1, 1, 3, 1, 31, 49, 103, 147, 59, 701, 1251, 3391, 1935, 5371, 28585, 50023, 73839, 118205}}, {19445, 18, 101411, {1, 3, 3, 1, 5, 49, 91, 23, 91, 663, 1369, 1437, 2657, 11369, 29857, 53875, 127045, 242323}}, {19446, 18, 101432, {1, 3, 1, 3, 23, 33, 7, 105, 353, 863, 1211, 1175, 1347, 12913, 11973, 55255, 27145, 175539}}, {19447, 18, 101476, {1, 1, 1, 13, 9, 29, 71, 71, 509, 571, 2005, 3125, 2731, 6829, 26863, 16459, 113195, 80247}}, {19448, 18, 101488, {1, 3, 5, 1, 7, 11, 45, 177, 281, 695, 1197, 2035, 2137, 11833, 12417, 5805, 77211, 45553}}, {19449, 18, 101494, {1, 1, 7, 7, 27, 59, 91, 183, 267, 373, 677, 2431, 903, 4229, 31997, 19843, 125089, 242871}}, {19450, 18, 101514, {1, 3, 3, 13, 23, 23, 53, 101, 225, 247, 2013, 853, 279, 2161, 30045, 28255, 130907, 57157}}, {19451, 18, 101534, {1, 3, 5, 13, 5, 11, 63, 137, 219, 661, 773, 1991, 4081, 5963, 25207, 50461, 85293, 159441}}, {19452, 18, 101537, {1, 3, 1, 15, 5, 59, 43, 87, 429, 77, 73, 1275, 2619, 16133, 20009, 26089, 38129, 157267}}, {19453, 18, 101543, {1, 1, 5, 15, 9, 59, 37, 127, 127, 733, 1703, 1331, 4293, 3555, 22739, 49513, 34533, 143225}}, {19454, 18, 101547, {1, 1, 7, 7, 11, 51, 121, 59, 505, 147, 1855, 1661, 5539, 3421, 28863, 14811, 39811, 228927}}, {19455, 18, 101584, {1, 1, 5, 5, 1, 31, 57, 167, 107, 753, 1835, 2491, 3311, 8639, 8743, 17279, 77071, 8673}}, {19456, 18, 101589, {1, 1, 3, 3, 15, 39, 1, 223, 395, 603, 1095, 435, 1225, 4045, 21721, 40767, 48971, 1583}}, {19457, 18, 101590, {1, 1, 3, 13, 9, 17, 47, 175, 229, 827, 769, 2901, 137, 9931, 11115, 25337, 105811, 68413}}, {19458, 18, 101629, {1, 1, 1, 5, 29, 55, 43, 39, 319, 919, 749, 931, 1973, 13147, 913, 48353, 40955, 189783}}, {19459, 18, 101678, {1, 3, 5, 5, 13, 33, 81, 213, 79, 781, 1069, 3117, 5859, 9061, 30963, 17307, 6281, 208707}}, {19460, 18, 101683, {1, 1, 5, 13, 27, 63, 41, 91, 123, 763, 1115, 3193, 4571, 4573, 8235, 24291, 40911, 225985}}, {19461, 18, 101700, {1, 1, 1, 7, 13, 5, 77, 215, 67, 183, 1447, 1571, 213, 3481, 28349, 22451, 44951, 240257}}, {19462, 18, 101712, {1, 3, 7, 7, 3, 21, 39, 233, 263, 19, 489, 1511, 2313, 1799, 25173, 17913, 70593, 2969}}, {19463, 18, 101748, {1, 3, 7, 15, 3, 1, 93, 101, 393, 911, 1055, 953, 1279, 11947, 11963, 53443, 29105, 226057}}, {19464, 18, 101757, {1, 1, 3, 7, 7, 53, 119, 39, 439, 629, 1845, 3411, 3633, 16345, 27501, 59565, 39581, 85373}}, {19465, 18, 101762, {1, 1, 5, 7, 19, 39, 19, 191, 509, 239, 359, 645, 8107, 13721, 21289, 20763, 67727, 45957}}, {19466, 18, 101771, {1, 1, 1, 13, 5, 13, 113, 41, 135, 351, 311, 1099, 2391, 16165, 15805, 54737, 102645, 224417}}, {19467, 18, 101785, {1, 3, 3, 9, 17, 47, 95, 249, 45, 749, 313, 317, 2413, 15861, 27221, 35537, 6407, 50111}}, {19468, 18, 101795, {1, 1, 7, 5, 29, 57, 81, 7, 233, 393, 307, 1089, 1367, 12275, 11861, 29119, 27271, 36351}}, {19469, 18, 101822, {1, 3, 5, 15, 9, 15, 23, 241, 233, 305, 1025, 2035, 4897, 10321, 17345, 42873, 109045, 129533}}, {19470, 18, 101851, {1, 3, 5, 9, 21, 33, 111, 81, 311, 829, 1851, 1437, 5935, 7847, 15493, 28531, 74879, 40567}}, {19471, 18, 101863, {1, 3, 7, 7, 13, 21, 43, 119, 507, 701, 1385, 745, 799, 1567, 13271, 40267, 130843, 59951}}, {19472, 18, 101894, {1, 3, 3, 1, 19, 43, 45, 119, 87, 263, 1475, 3897, 2811, 2711, 4949, 48043, 125237, 230897}}, {19473, 18, 101903, {1, 1, 7, 1, 1, 53, 17, 71, 313, 373, 5, 2359, 1643, 9867, 18365, 5011, 40675, 105371}}, {19474, 18, 101924, {1, 3, 7, 11, 23, 49, 123, 255, 33, 241, 473, 959, 1859, 6109, 5433, 27625, 46839, 90727}}, {19475, 18, 101939, {1, 1, 1, 3, 31, 43, 33, 129, 159, 445, 1831, 1005, 587, 2091, 5749, 33271, 50909, 65057}}, {19476, 18, 101980, {1, 1, 7, 13, 3, 21, 17, 125, 357, 97, 1255, 669, 1583, 7433, 32287, 61795, 5915, 211593}}, {19477, 18, 101993, {1, 1, 7, 7, 31, 19, 71, 211, 213, 731, 1491, 3315, 3633, 14953, 21369, 4977, 33533, 12115}}, {19478, 18, 101994, {1, 3, 1, 1, 31, 1, 87, 253, 211, 57, 1431, 2613, 4075, 14463, 11287, 38671, 100129, 4241}}, {19479, 18, 101996, {1, 1, 1, 5, 21, 13, 27, 29, 31, 285, 179, 3861, 5319, 15683, 2579, 15663, 63357, 81849}}, {19480, 18, 102007, {1, 1, 3, 7, 23, 29, 29, 79, 263, 865, 1237, 3871, 2097, 5337, 2387, 59277, 28831, 57957}}, {19481, 18, 102044, {1, 3, 7, 15, 15, 31, 83, 195, 87, 691, 71, 1025, 3145, 675, 14619, 22399, 88885, 222969}}, {19482, 18, 102086, {1, 1, 5, 7, 19, 3, 121, 105, 383, 675, 777, 2073, 643, 14439, 19467, 13159, 115421, 250561}}, {19483, 18, 102097, {1, 3, 5, 9, 13, 41, 119, 23, 355, 765, 579, 849, 3313, 2443, 29521, 42965, 102559, 227707}}, {19484, 18, 102113, {1, 3, 3, 7, 23, 55, 115, 83, 331, 873, 797, 621, 1197, 15299, 26307, 34287, 120459, 260603}}, {19485, 18, 102123, {1, 1, 3, 5, 7, 11, 113, 119, 65, 691, 1169, 2291, 7283, 1391, 10737, 3801, 40649, 191009}}, {19486, 18, 102155, {1, 1, 7, 9, 3, 23, 95, 109, 457, 277, 871, 3013, 2833, 4131, 21081, 43635, 19875, 162173}}, {19487, 18, 102157, {1, 1, 3, 15, 25, 7, 45, 109, 195, 935, 1487, 1603, 1663, 15595, 10687, 4073, 34863, 45851}}, {19488, 18, 102169, {1, 1, 1, 5, 21, 19, 37, 141, 377, 553, 1225, 2485, 1235, 13179, 2587, 43659, 1405, 52023}}, {19489, 18, 102181, {1, 3, 1, 9, 5, 27, 1, 219, 397, 555, 533, 941, 2755, 1295, 16157, 30733, 54279, 168455}}, {19490, 18, 102182, {1, 3, 3, 1, 27, 41, 93, 177, 119, 581, 167, 3943, 5765, 15455, 555, 17419, 33117, 160599}}, {19491, 18, 102185, {1, 1, 3, 7, 15, 25, 29, 177, 503, 529, 229, 2535, 1493, 805, 30983, 26309, 123453, 118441}}, {19492, 18, 102199, {1, 1, 7, 15, 13, 33, 83, 151, 183, 433, 823, 4003, 1991, 6563, 18743, 61835, 56535, 191193}}, {19493, 18, 102208, {1, 1, 1, 13, 9, 31, 91, 63, 455, 67, 243, 1573, 3507, 9491, 4677, 13835, 121603, 241781}}, {19494, 18, 102213, {1, 1, 5, 5, 29, 13, 45, 29, 289, 909, 1923, 3371, 3675, 13119, 24599, 58511, 109467, 126865}}, {19495, 18, 102226, {1, 1, 5, 9, 21, 41, 41, 179, 25, 463, 949, 819, 397, 12329, 3461, 34773, 61337, 23579}}, {19496, 18, 102290, {1, 3, 3, 11, 1, 25, 17, 165, 77, 455, 1983, 143, 2763, 8165, 14849, 1601, 30093, 54599}}, {19497, 18, 102296, {1, 1, 7, 3, 7, 1, 117, 117, 53, 611, 1405, 3357, 1717, 8157, 247, 17501, 30201, 192485}}, {19498, 18, 102306, {1, 1, 1, 5, 23, 47, 95, 173, 133, 603, 1627, 4039, 5599, 10575, 30275, 60287, 3313, 77551}}, {19499, 18, 102317, {1, 1, 1, 9, 31, 49, 87, 169, 221, 561, 1045, 365, 1955, 9905, 13057, 33717, 91203, 57513}}, {19500, 18, 102337, {1, 3, 3, 1, 19, 25, 113, 231, 415, 717, 1767, 755, 4825, 7541, 10121, 9351, 72093, 255877}}, {19501, 18, 102344, {1, 3, 1, 7, 1, 35, 3, 231, 345, 375, 809, 2753, 849, 13915, 16127, 7575, 45259, 28917}}, {19502, 18, 102350, {1, 3, 3, 11, 23, 43, 13, 37, 305, 765, 517, 333, 473, 14949, 11939, 35171, 63963, 181825}}, {19503, 18, 102378, {1, 3, 3, 3, 5, 43, 35, 89, 293, 913, 1325, 2097, 603, 14365, 4005, 38935, 23837, 34271}}, {19504, 18, 102383, {1, 1, 3, 15, 1, 47, 67, 199, 167, 909, 1167, 1513, 7087, 5017, 23469, 2621, 24961, 226679}}, {19505, 18, 102391, {1, 3, 7, 15, 23, 37, 111, 217, 33, 423, 457, 1767, 4821, 10233, 27045, 33397, 85351, 156751}}, {19506, 18, 102400, {1, 3, 3, 7, 31, 25, 67, 65, 291, 169, 1505, 1707, 4833, 11541, 1189, 62959, 59831, 48729}}, {19507, 18, 102409, {1, 1, 5, 7, 27, 27, 15, 23, 189, 819, 709, 3591, 2781, 14807, 20303, 27795, 88349, 210251}}, {19508, 18, 102427, {1, 3, 7, 15, 1, 19, 49, 103, 219, 85, 1281, 3981, 7229, 10427, 11689, 1547, 90747, 12283}}, {19509, 18, 102434, {1, 1, 1, 13, 31, 49, 81, 121, 287, 851, 333, 353, 7373, 10165, 1157, 11713, 89445, 210709}}, {19510, 18, 102453, {1, 3, 7, 5, 31, 35, 3, 229, 443, 973, 1971, 1861, 5695, 6725, 6405, 45927, 115313, 228667}}, {19511, 18, 102472, {1, 3, 3, 11, 29, 17, 105, 203, 69, 945, 1239, 3213, 6005, 10095, 31233, 37421, 62911, 91371}}, {19512, 18, 102502, {1, 1, 7, 1, 21, 59, 7, 43, 391, 299, 1225, 283, 3351, 11495, 25071, 16619, 65127, 114033}}, {19513, 18, 102525, {1, 1, 3, 9, 17, 11, 71, 73, 377, 437, 311, 1083, 6941, 1039, 1047, 55647, 21239, 209201}}, {19514, 18, 102547, {1, 3, 7, 5, 29, 51, 113, 163, 215, 511, 615, 2427, 2747, 14389, 1005, 27015, 31809, 30603}}, {19515, 18, 102554, {1, 1, 1, 3, 9, 61, 9, 201, 259, 411, 175, 1003, 401, 13695, 13103, 3075, 43695, 177139}}, {19516, 18, 102560, {1, 1, 5, 3, 17, 47, 125, 173, 277, 17, 619, 2295, 3091, 5615, 4529, 54065, 81875, 97279}}, {19517, 18, 102578, {1, 3, 3, 9, 3, 61, 97, 151, 287, 671, 1439, 1129, 6343, 8161, 24593, 40371, 109705, 106279}}, {19518, 18, 102580, {1, 3, 3, 1, 5, 61, 21, 31, 41, 855, 1541, 3351, 575, 3195, 17155, 46913, 1797, 146401}}, {19519, 18, 102597, {1, 1, 7, 13, 11, 43, 27, 97, 479, 117, 1873, 3103, 1947, 9273, 29171, 35719, 10601, 209629}}, {19520, 18, 102616, {1, 3, 1, 9, 21, 47, 53, 129, 85, 505, 165, 3437, 5687, 10289, 6615, 46719, 50731, 25271}}, {19521, 18, 102625, {1, 1, 3, 1, 1, 33, 37, 239, 45, 565, 1907, 3831, 2177, 10967, 12689, 49395, 36289, 247507}}, {19522, 18, 102632, {1, 1, 5, 1, 19, 57, 75, 245, 59, 967, 1319, 3971, 5267, 11713, 15417, 60503, 63431, 157267}}, {19523, 18, 102663, {1, 1, 5, 7, 7, 15, 99, 87, 331, 261, 1973, 219, 3063, 4071, 19273, 48637, 128089, 55511}}, {19524, 18, 102669, {1, 3, 5, 13, 23, 43, 7, 171, 173, 1023, 1145, 3551, 5127, 6365, 18013, 1613, 51997, 107265}}, {19525, 18, 102681, {1, 3, 5, 3, 7, 7, 23, 195, 251, 387, 1889, 3645, 4221, 6025, 27291, 24831, 123749, 231403}}, {19526, 18, 102694, {1, 3, 1, 1, 29, 49, 107, 215, 93, 211, 1349, 1925, 7149, 1015, 27465, 34139, 126149, 121349}}, {19527, 18, 102706, {1, 1, 5, 5, 19, 15, 121, 189, 167, 801, 483, 1955, 8031, 4749, 26665, 64791, 18671, 123221}}, {19528, 18, 102715, {1, 3, 3, 15, 23, 57, 15, 249, 197, 103, 2021, 1897, 5975, 12821, 6441, 62719, 81415, 232417}}, {19529, 18, 102723, {1, 1, 3, 9, 17, 45, 111, 225, 103, 121, 1259, 2849, 2235, 2041, 13261, 7929, 76325, 38677}}, {19530, 18, 102730, {1, 1, 3, 9, 25, 17, 63, 63, 369, 387, 31, 1423, 5699, 12519, 27407, 53193, 963, 123473}}, {19531, 18, 102743, {1, 3, 3, 13, 3, 59, 59, 3, 367, 357, 1391, 1519, 2619, 2291, 1349, 28275, 21655, 8763}}, {19532, 18, 102856, {1, 1, 7, 1, 31, 51, 121, 49, 157, 509, 1513, 3247, 3439, 8691, 20729, 17585, 49013, 228695}}, {19533, 18, 102870, {1, 1, 5, 9, 11, 29, 103, 49, 209, 35, 673, 1409, 2483, 4561, 12435, 46139, 31019, 50929}}, {19534, 18, 102898, {1, 1, 3, 9, 11, 45, 77, 143, 277, 769, 1151, 3705, 7901, 3735, 31155, 46135, 84061, 254357}}, {19535, 18, 102926, {1, 3, 3, 3, 5, 51, 95, 7, 155, 121, 1899, 2261, 2915, 6637, 6557, 20535, 20937, 257275}}, {19536, 18, 102931, {1, 1, 7, 9, 13, 49, 125, 135, 7, 535, 1171, 3501, 1701, 5791, 10121, 9845, 21645, 56451}}, {19537, 18, 102938, {1, 1, 7, 5, 9, 1, 115, 27, 229, 813, 133, 753, 1959, 13121, 30425, 31059, 114619, 132257}}, {19538, 18, 102947, {1, 1, 5, 3, 23, 25, 41, 165, 21, 551, 1751, 3563, 731, 15811, 14777, 22327, 82853, 116699}}, {19539, 18, 102968, {1, 3, 1, 9, 3, 25, 95, 211, 457, 25, 349, 921, 213, 5721, 26725, 19541, 102473, 200845}}, {19540, 18, 102976, {1, 3, 1, 13, 5, 1, 31, 49, 493, 785, 61, 2603, 5997, 12545, 9793, 32521, 99859, 256105}}, {19541, 18, 102993, {1, 3, 3, 7, 31, 19, 31, 121, 507, 79, 685, 197, 4027, 12909, 30533, 38427, 38993, 14581}}, {19542, 18, 103005, {1, 3, 7, 13, 13, 23, 63, 15, 223, 25, 1957, 2527, 6061, 11753, 4835, 34553, 45579, 205805}}, {19543, 18, 103019, {1, 3, 3, 3, 5, 39, 55, 123, 275, 185, 749, 3227, 8137, 12959, 7243, 20613, 46247, 106127}}, {19544, 18, 103022, {1, 1, 7, 13, 1, 21, 49, 145, 237, 291, 1721, 2981, 267, 1255, 21817, 39553, 21937, 115307}}, {19545, 18, 103057, {1, 1, 1, 15, 5, 63, 3, 201, 117, 991, 1049, 1975, 5117, 5799, 28211, 37907, 46799, 240847}}, {19546, 18, 103080, {1, 3, 3, 5, 25, 15, 29, 111, 201, 857, 319, 2695, 4251, 4303, 28495, 12481, 31979, 107503}}, {19547, 18, 103100, {1, 1, 3, 11, 3, 27, 81, 55, 489, 983, 293, 3181, 4593, 4759, 18437, 51185, 47701, 75469}}, {19548, 18, 103106, {1, 3, 1, 3, 11, 25, 113, 243, 365, 299, 1717, 561, 5173, 5983, 7453, 33563, 98519, 162451}}, {19549, 18, 103126, {1, 3, 1, 5, 1, 21, 3, 87, 267, 483, 1397, 791, 4807, 4649, 13713, 19861, 110471, 51443}}, {19550, 18, 103173, {1, 3, 7, 5, 31, 9, 13, 251, 351, 609, 841, 3267, 4201, 8771, 6673, 44867, 105221, 189399}}, {19551, 18, 103202, {1, 1, 3, 1, 13, 43, 47, 153, 331, 1013, 705, 1867, 563, 6361, 7407, 46243, 30521, 213831}}, {19552, 18, 103207, {1, 3, 3, 7, 29, 41, 3, 179, 319, 877, 905, 3803, 2775, 9729, 5673, 9521, 117887, 37605}}, {19553, 18, 103219, {1, 1, 5, 5, 11, 49, 111, 195, 467, 931, 849, 2785, 7829, 2291, 29031, 52019, 86493, 213971}}, {19554, 18, 103226, {1, 1, 3, 11, 13, 11, 81, 81, 419, 621, 181, 1203, 7305, 7857, 16885, 2531, 53127, 35553}}, {19555, 18, 103228, {1, 1, 5, 1, 19, 35, 75, 131, 159, 211, 319, 2805, 6497, 14759, 28997, 62347, 4013, 233821}}, {19556, 18, 103248, {1, 3, 3, 15, 1, 55, 107, 105, 35, 369, 1259, 665, 6717, 2555, 7149, 10373, 33153, 105915}}, {19557, 18, 103274, {1, 3, 7, 5, 31, 13, 27, 207, 359, 355, 2047, 1777, 5555, 12659, 30547, 3655, 86189, 961}}, {19558, 18, 103288, {1, 3, 7, 9, 9, 55, 7, 117, 57, 115, 745, 501, 2341, 3899, 8229, 10625, 66905, 187959}}, {19559, 18, 103291, {1, 3, 3, 13, 25, 43, 87, 197, 303, 405, 1459, 3385, 4109, 8325, 24747, 18405, 48845, 96673}}, {19560, 18, 103293, {1, 3, 5, 3, 21, 37, 109, 9, 183, 585, 1287, 3851, 4939, 1057, 19489, 42603, 32447, 117957}}, {19561, 18, 103324, {1, 1, 5, 13, 3, 47, 109, 115, 73, 733, 1189, 3773, 7471, 10339, 5093, 50253, 122665, 254381}}, {19562, 18, 103358, {1, 1, 5, 5, 21, 33, 113, 187, 51, 245, 241, 3887, 4075, 11945, 20883, 18817, 43567, 851}}, {19563, 18, 103372, {1, 3, 7, 3, 1, 29, 87, 101, 29, 93, 643, 2659, 1753, 4797, 17477, 16087, 43453, 110383}}, {19564, 18, 103375, {1, 1, 7, 13, 17, 51, 75, 91, 445, 171, 1369, 499, 3753, 14035, 4445, 21437, 86205, 231163}}, {19565, 18, 103390, {1, 1, 7, 13, 17, 41, 67, 49, 225, 659, 1181, 1751, 5211, 6847, 20339, 34271, 60273, 52315}}, {19566, 18, 103414, {1, 1, 5, 5, 5, 17, 87, 223, 25, 773, 53, 2447, 6805, 6547, 4429, 46809, 51171, 66457}}, {19567, 18, 103432, {1, 1, 5, 3, 29, 49, 11, 205, 279, 821, 725, 2425, 443, 211, 6347, 59845, 90763, 237911}}, {19568, 18, 103446, {1, 1, 3, 9, 31, 7, 49, 1, 229, 755, 517, 809, 2955, 3571, 2385, 33097, 19659, 55397}}, {19569, 18, 103455, {1, 3, 5, 3, 5, 21, 67, 227, 359, 401, 1697, 2131, 4585, 2661, 3659, 22621, 51639, 245877}}, {19570, 18, 103471, {1, 1, 7, 5, 11, 7, 57, 133, 9, 917, 427, 2777, 6009, 11393, 29473, 59311, 77095, 176215}}, {19571, 18, 103474, {1, 1, 7, 5, 13, 29, 101, 15, 293, 7, 797, 437, 3739, 3369, 16917, 19047, 17773, 219541}}, {19572, 18, 103476, {1, 3, 1, 9, 13, 51, 15, 19, 209, 991, 413, 787, 3797, 14029, 23699, 8591, 40429, 56115}}, {19573, 18, 103515, {1, 3, 7, 3, 31, 9, 77, 33, 487, 155, 1903, 3023, 8163, 385, 4703, 57511, 102083, 85785}}, {19574, 18, 103527, {1, 1, 5, 11, 17, 59, 115, 73, 89, 723, 1523, 2671, 1755, 3463, 19861, 31573, 126405, 90215}}, {19575, 18, 103542, {1, 3, 3, 13, 17, 27, 123, 37, 71, 173, 203, 1245, 7905, 8955, 22589, 56705, 120473, 90129}}, {19576, 18, 103562, {1, 3, 3, 1, 17, 63, 55, 225, 259, 531, 1493, 2639, 1319, 10865, 17993, 11205, 13253, 111261}}, {19577, 18, 103569, {1, 1, 1, 11, 25, 17, 41, 45, 385, 1009, 1573, 1797, 527, 543, 14743, 35789, 63871, 112183}}, {19578, 18, 103572, {1, 1, 7, 15, 15, 57, 109, 127, 143, 955, 1091, 2585, 3429, 11763, 5849, 53805, 116865, 68895}}, {19579, 18, 103581, {1, 1, 7, 15, 9, 11, 1, 9, 491, 765, 1835, 3825, 5043, 13091, 4123, 19621, 17687, 241015}}, {19580, 18, 103609, {1, 3, 5, 7, 25, 51, 117, 193, 91, 451, 1871, 3819, 1881, 8065, 25809, 36257, 107955, 37109}}, {19581, 18, 103612, {1, 3, 1, 15, 5, 5, 101, 7, 59, 859, 977, 2673, 2825, 3291, 26283, 23467, 28383, 257775}}, {19582, 18, 103618, {1, 3, 3, 15, 17, 43, 87, 191, 85, 829, 653, 327, 1773, 10101, 2707, 18341, 61435, 242215}}, {19583, 18, 103637, {1, 3, 7, 13, 27, 43, 127, 253, 403, 81, 505, 2841, 1509, 4951, 23791, 18099, 46747, 192717}}, {19584, 18, 103644, {1, 1, 1, 9, 31, 15, 127, 29, 171, 999, 1919, 4059, 2781, 2475, 8997, 15459, 37003, 217141}}, {19585, 18, 103653, {1, 3, 3, 1, 31, 41, 67, 31, 171, 719, 789, 645, 3925, 11117, 1241, 63221, 1087, 59789}}, {19586, 18, 103663, {1, 1, 1, 9, 17, 41, 107, 13, 405, 879, 1955, 3309, 1281, 10601, 13883, 43987, 111691, 130555}}, {19587, 18, 103671, {1, 3, 7, 9, 21, 17, 127, 243, 51, 689, 1945, 3769, 7121, 7703, 16825, 34893, 32167, 20167}}, {19588, 18, 103678, {1, 1, 1, 5, 7, 7, 61, 149, 75, 289, 717, 1951, 5917, 13375, 15683, 27507, 10897, 199009}}, {19589, 18, 103695, {1, 3, 7, 9, 25, 61, 43, 167, 45, 299, 5, 125, 3289, 13685, 10843, 25535, 98383, 143401}}, {19590, 18, 103698, {1, 1, 3, 15, 21, 27, 37, 45, 233, 179, 611, 3025, 7887, 9421, 16791, 17147, 49013, 33249}}, {19591, 18, 103720, {1, 3, 7, 15, 19, 43, 43, 9, 255, 295, 649, 811, 1303, 1989, 5401, 53891, 42679, 66879}}, {19592, 18, 103723, {1, 1, 7, 7, 25, 31, 89, 199, 455, 733, 295, 1157, 4375, 7341, 7823, 6025, 56311, 257579}}, {19593, 18, 103738, {1, 1, 7, 3, 1, 51, 15, 29, 35, 917, 1839, 741, 1089, 8615, 4967, 34047, 32981, 200693}}, {19594, 18, 103743, {1, 3, 3, 11, 21, 13, 71, 53, 315, 801, 1015, 3829, 2297, 6649, 28501, 18173, 83121, 107195}}, {19595, 18, 103745, {1, 1, 7, 7, 1, 5, 127, 103, 435, 707, 7, 1045, 187, 10927, 32395, 24999, 58463, 94069}}, {19596, 18, 103757, {1, 1, 7, 9, 11, 25, 73, 57, 231, 455, 1033, 2899, 2861, 8811, 21671, 16115, 97807, 221791}}, {19597, 18, 103810, {1, 3, 5, 11, 11, 19, 105, 37, 181, 1, 1231, 2275, 4789, 13071, 24843, 25901, 123711, 145609}}, {19598, 18, 103822, {1, 3, 7, 13, 7, 7, 21, 215, 393, 43, 1713, 2921, 1959, 14417, 17109, 55793, 36285, 81731}}, {19599, 18, 103855, {1, 1, 5, 15, 29, 15, 5, 115, 15, 795, 1535, 2473, 3663, 10123, 20721, 32739, 21141, 217731}}, {19600, 18, 103887, {1, 1, 3, 1, 15, 13, 21, 49, 293, 689, 985, 3949, 3329, 7167, 16925, 15069, 47345, 192749}}, {19601, 18, 103905, {1, 3, 3, 7, 5, 27, 85, 11, 337, 651, 777, 1775, 5279, 15229, 21473, 36561, 85293, 27893}}, {19602, 18, 103915, {1, 3, 7, 1, 15, 29, 7, 199, 71, 893, 1587, 1831, 3891, 3299, 14323, 23165, 28199, 84055}}, {19603, 18, 103925, {1, 1, 1, 7, 9, 27, 15, 75, 497, 127, 433, 1781, 3711, 12659, 3765, 40827, 112425, 36281}}, {19604, 18, 103929, {1, 1, 5, 1, 31, 59, 9, 91, 301, 217, 2013, 2015, 265, 3795, 14609, 13389, 5451, 260169}}, {19605, 18, 103945, {1, 1, 1, 15, 19, 43, 85, 37, 33, 687, 1253, 2615, 4027, 3741, 13971, 21261, 106261, 204233}}, {19606, 18, 103954, {1, 1, 7, 9, 31, 45, 105, 111, 207, 433, 633, 3949, 8057, 5049, 23657, 12227, 86251, 218077}}, {19607, 18, 103969, {1, 3, 5, 11, 13, 33, 1, 67, 117, 595, 1835, 287, 2509, 14841, 1525, 15761, 61319, 182531}}, {19608, 18, 104011, {1, 1, 3, 9, 7, 43, 105, 85, 17, 349, 1769, 3945, 31, 4907, 9373, 22447, 70905, 29189}}, {19609, 18, 104055, {1, 1, 5, 5, 9, 19, 93, 179, 95, 255, 1807, 2717, 4757, 15025, 19479, 63499, 42441, 236519}}, {19610, 18, 104111, {1, 1, 1, 1, 21, 35, 1, 101, 343, 1023, 1311, 347, 301, 8419, 23367, 31543, 51661, 148277}}, {19611, 18, 104116, {1, 1, 7, 11, 23, 37, 113, 207, 147, 743, 1905, 1683, 3733, 5659, 22491, 62129, 111671, 227019}}, {19612, 18, 104125, {1, 1, 3, 13, 27, 5, 21, 207, 445, 319, 1355, 2541, 2853, 583, 1261, 64477, 18337, 91611}}, {19613, 18, 104145, {1, 3, 5, 3, 1, 31, 51, 55, 487, 735, 1599, 523, 5323, 10855, 28717, 62103, 18671, 143885}}, {19614, 18, 104162, {1, 3, 1, 1, 15, 5, 79, 107, 173, 747, 1213, 1151, 875, 12759, 27115, 16403, 31349, 208909}}, {19615, 18, 104176, {1, 3, 5, 9, 13, 57, 35, 121, 135, 237, 1707, 3655, 8109, 3623, 5119, 27645, 49401, 46453}}, {19616, 18, 104193, {1, 3, 7, 11, 27, 3, 103, 231, 43, 515, 1279, 499, 1355, 2605, 11587, 33641, 81661, 29441}}, {19617, 18, 104199, {1, 3, 5, 7, 13, 27, 55, 191, 81, 185, 527, 519, 4555, 3349, 24533, 60635, 40009, 230761}}, {19618, 18, 104224, {1, 1, 5, 3, 13, 35, 75, 211, 67, 305, 705, 543, 3819, 16265, 9867, 64309, 35047, 24873}}, {19619, 18, 104236, {1, 3, 1, 1, 11, 37, 75, 3, 145, 327, 1243, 3291, 7127, 5009, 7757, 59567, 90459, 98035}}, {19620, 18, 104247, {1, 3, 5, 9, 9, 5, 71, 29, 243, 41, 447, 2597, 1243, 12899, 19681, 30523, 90799, 142279}}, {19621, 18, 104254, {1, 3, 3, 3, 15, 21, 25, 101, 451, 651, 143, 3899, 3377, 4855, 23843, 25047, 87951, 239229}}, {19622, 18, 104289, {1, 1, 1, 1, 23, 29, 25, 31, 227, 43, 399, 723, 693, 12379, 11343, 46123, 105435, 224997}}, {19623, 18, 104325, {1, 1, 7, 3, 21, 47, 77, 57, 397, 689, 267, 813, 1279, 1727, 7451, 34025, 90273, 111663}}, {19624, 18, 104332, {1, 1, 5, 3, 25, 61, 7, 137, 271, 723, 495, 2575, 3695, 4947, 31973, 47835, 107003, 221839}}, {19625, 18, 104335, {1, 3, 1, 7, 5, 25, 21, 95, 323, 3, 613, 1721, 2551, 8803, 6803, 52765, 34543, 110945}}, {19626, 18, 104353, {1, 3, 5, 9, 27, 23, 123, 193, 63, 161, 1395, 679, 161, 13719, 29321, 19243, 51947, 229547}}, {19627, 18, 104363, {1, 3, 5, 15, 15, 37, 127, 103, 439, 513, 989, 1393, 3761, 9109, 20649, 18171, 69939, 117447}}, {19628, 18, 104371, {1, 1, 7, 9, 7, 57, 87, 159, 195, 821, 57, 2469, 7693, 6759, 32595, 41109, 94785, 53381}}, {19629, 18, 104373, {1, 3, 3, 7, 17, 63, 41, 7, 437, 469, 1453, 3741, 7591, 5563, 11819, 23861, 129777, 119731}}, {19630, 18, 104406, {1, 1, 3, 3, 27, 55, 21, 145, 243, 991, 687, 909, 2105, 4485, 9095, 3677, 53819, 183027}}, {19631, 18, 104412, {1, 1, 1, 15, 13, 61, 27, 81, 95, 37, 1439, 973, 7613, 5749, 16811, 26801, 105745, 8847}}, {19632, 18, 104440, {1, 3, 1, 9, 15, 17, 111, 61, 27, 373, 89, 2729, 6397, 4899, 11297, 4403, 30657, 207379}}, {19633, 18, 104459, {1, 3, 5, 15, 19, 9, 19, 19, 497, 667, 105, 601, 6715, 6355, 4231, 19241, 101771, 105651}}, {19634, 18, 104461, {1, 1, 3, 9, 11, 11, 115, 109, 177, 753, 997, 2119, 5969, 13377, 13285, 25373, 105023, 158393}}, {19635, 18, 104469, {1, 3, 5, 15, 27, 23, 19, 117, 129, 457, 1973, 2171, 8071, 2093, 13407, 9295, 82967, 184753}}, {19636, 18, 104479, {1, 1, 7, 5, 1, 45, 9, 25, 307, 629, 1169, 2859, 3987, 11411, 13609, 44993, 26019, 107003}}, {19637, 18, 104483, {1, 1, 1, 13, 29, 15, 13, 163, 203, 885, 281, 1605, 8001, 899, 4081, 65467, 61283, 198963}}, {19638, 18, 104490, {1, 1, 3, 5, 27, 9, 89, 193, 375, 633, 1807, 2069, 3467, 3167, 23751, 39115, 90093, 190365}}, {19639, 18, 104500, {1, 3, 3, 5, 1, 1, 19, 161, 21, 745, 493, 2227, 7993, 3337, 27041, 4817, 58963, 237015}}, {19640, 18, 104536, {1, 3, 5, 15, 15, 45, 51, 145, 299, 787, 1059, 2407, 1143, 775, 17473, 22235, 18241, 103897}}, {19641, 18, 104560, {1, 1, 1, 9, 11, 35, 75, 195, 281, 935, 113, 3009, 4797, 7221, 12475, 18563, 10315, 255541}}, {19642, 18, 104569, {1, 1, 5, 7, 25, 9, 121, 179, 303, 511, 2041, 1485, 529, 13843, 29013, 28139, 63237, 21259}}, {19643, 18, 104588, {1, 3, 7, 11, 9, 21, 61, 177, 63, 179, 679, 17, 4069, 8929, 14499, 53913, 27925, 48449}}, {19644, 18, 104591, {1, 3, 5, 3, 9, 27, 111, 247, 253, 175, 1591, 3583, 3351, 9039, 597, 23859, 126585, 157367}}, {19645, 18, 104621, {1, 1, 7, 9, 1, 9, 29, 1, 273, 89, 767, 1873, 39, 10487, 29857, 23577, 67457, 44571}}, {19646, 18, 104661, {1, 1, 7, 5, 5, 23, 13, 181, 283, 333, 21, 1409, 5937, 8981, 7445, 61267, 21729, 32677}}, {19647, 18, 104675, {1, 3, 1, 15, 31, 5, 45, 253, 179, 91, 341, 359, 4269, 7567, 23699, 30589, 42909, 126171}}, {19648, 18, 104684, {1, 3, 7, 7, 23, 45, 15, 93, 115, 873, 49, 845, 827, 14357, 20163, 41565, 37105, 120331}}, {19649, 18, 104713, {1, 1, 7, 7, 15, 25, 55, 175, 11, 457, 1537, 1937, 807, 11399, 27751, 16935, 75231, 204039}}, {19650, 18, 104747, {1, 3, 7, 13, 1, 37, 67, 145, 471, 1013, 1273, 4093, 4449, 4433, 29063, 205, 93249, 140383}}, {19651, 18, 104750, {1, 3, 1, 13, 1, 57, 85, 223, 349, 125, 863, 2179, 7813, 8817, 1767, 19169, 41367, 65883}}, {19652, 18, 104757, {1, 3, 3, 15, 21, 39, 3, 31, 67, 505, 271, 505, 5495, 4183, 3631, 4567, 48061, 149565}}, {19653, 18, 104775, {1, 1, 7, 11, 13, 39, 109, 201, 287, 1013, 1505, 3105, 3845, 1963, 4361, 61753, 29145, 146235}}, {19654, 18, 104782, {1, 3, 5, 3, 29, 39, 71, 99, 501, 53, 835, 3295, 5335, 1017, 25913, 63637, 115353, 210509}}, {19655, 18, 104803, {1, 3, 1, 13, 9, 53, 33, 177, 419, 63, 793, 1329, 2261, 11633, 18805, 49771, 47533, 74949}}, {19656, 18, 104820, {1, 3, 7, 11, 7, 49, 123, 237, 195, 17, 1919, 1911, 4135, 11829, 26307, 34905, 114361, 228655}}, {19657, 18, 104824, {1, 3, 5, 3, 5, 57, 65, 161, 195, 857, 1187, 2303, 1975, 2555, 26065, 17963, 57403, 136193}}, {19658, 18, 104829, {1, 1, 3, 11, 1, 5, 105, 217, 229, 769, 1393, 2419, 7751, 14293, 9407, 4569, 30663, 89345}}, {19659, 18, 104830, {1, 3, 3, 7, 23, 15, 15, 189, 67, 863, 485, 2435, 5145, 10537, 16485, 50369, 118245, 253201}}, {19660, 18, 104836, {1, 1, 1, 5, 27, 27, 47, 129, 383, 227, 115, 3027, 1575, 15765, 10207, 4885, 125707, 184703}}, {19661, 18, 104851, {1, 3, 5, 5, 17, 9, 45, 55, 151, 751, 415, 2139, 8071, 2309, 27641, 29743, 47183, 21437}}, {19662, 18, 104882, {1, 3, 3, 7, 9, 47, 51, 31, 261, 237, 1695, 1065, 4503, 7167, 25791, 39659, 90145, 130481}}, {19663, 18, 104920, {1, 1, 3, 3, 21, 27, 53, 249, 407, 779, 1315, 1005, 6953, 14959, 2265, 61645, 118623, 254067}}, {19664, 18, 104941, {1, 3, 1, 9, 13, 25, 33, 225, 467, 325, 1513, 1237, 1569, 8749, 1587, 4699, 19893, 163597}}, {19665, 18, 104963, {1, 3, 5, 5, 29, 29, 1, 55, 437, 575, 149, 791, 4243, 4405, 22963, 64125, 21631, 25819}}, {19666, 18, 104989, {1, 3, 5, 3, 25, 9, 19, 27, 419, 139, 2035, 2065, 1925, 11499, 20053, 13161, 15115, 120891}}, {19667, 18, 104999, {1, 1, 5, 9, 7, 9, 113, 3, 195, 555, 863, 595, 6569, 9819, 14727, 38285, 13737, 130903}}, {19668, 18, 105006, {1, 1, 3, 7, 19, 17, 35, 107, 489, 285, 247, 3103, 2919, 11163, 2811, 62081, 42989, 24495}}, {19669, 18, 105040, {1, 3, 1, 15, 17, 5, 123, 221, 117, 689, 1567, 3803, 5801, 14121, 23263, 8851, 41559, 226271}}, {19670, 18, 105066, {1, 1, 1, 15, 21, 39, 87, 135, 485, 59, 1899, 2483, 2599, 8783, 6129, 55407, 7291, 217117}}, {19671, 18, 105089, {1, 1, 3, 11, 27, 53, 45, 241, 51, 829, 121, 3047, 6785, 15127, 13923, 47913, 9087, 112005}}, {19672, 18, 105120, {1, 1, 1, 13, 5, 9, 45, 37, 235, 497, 871, 1471, 2895, 247, 9085, 39611, 63445, 218391}}, {19673, 18, 105125, {1, 1, 5, 3, 5, 29, 23, 155, 339, 293, 535, 1569, 2625, 2867, 4639, 53049, 88721, 96903}}, {19674, 18, 105137, {1, 1, 3, 15, 5, 25, 17, 45, 47, 683, 949, 1381, 5929, 9539, 3345, 59883, 19071, 200411}}, {19675, 18, 105179, {1, 1, 1, 11, 11, 5, 71, 15, 469, 749, 1763, 541, 7109, 11731, 8463, 35145, 121795, 219441}}, {19676, 18, 105215, {1, 3, 7, 11, 5, 17, 63, 159, 69, 993, 1519, 1531, 6913, 3901, 22131, 42909, 41299, 261813}}, {19677, 18, 105244, {1, 1, 3, 5, 21, 27, 27, 197, 339, 275, 2011, 2263, 855, 1939, 21561, 30577, 6515, 124417}}, {19678, 18, 105258, {1, 3, 5, 15, 25, 35, 91, 31, 269, 857, 327, 3643, 3211, 14401, 18399, 9007, 12897, 25555}}, {19679, 18, 105263, {1, 1, 7, 15, 19, 47, 127, 157, 407, 867, 943, 1509, 3113, 49, 32131, 46975, 130013, 66457}}, {19680, 18, 105280, {1, 3, 3, 13, 31, 45, 59, 135, 67, 825, 157, 2441, 2851, 2355, 28115, 14075, 106317, 145945}}, {19681, 18, 105286, {1, 1, 1, 15, 27, 27, 5, 211, 85, 749, 671, 1341, 6865, 10027, 14419, 20159, 126647, 147893}}, {19682, 18, 105380, {1, 1, 1, 7, 25, 49, 115, 231, 65, 161, 1409, 573, 2859, 639, 12567, 58459, 73781, 136893}}, {19683, 18, 105397, {1, 1, 1, 7, 11, 57, 97, 141, 327, 975, 1799, 3051, 365, 9331, 14583, 16723, 113153, 224127}}, {19684, 18, 105409, {1, 3, 1, 13, 13, 17, 105, 109, 151, 41, 1903, 1685, 2285, 5697, 16559, 34133, 106045, 203217}}, {19685, 18, 105427, {1, 1, 1, 3, 29, 61, 43, 255, 269, 277, 1847, 3781, 7991, 131, 9833, 34305, 10763, 41869}}, {19686, 18, 105452, {1, 1, 7, 3, 11, 1, 85, 89, 247, 99, 419, 2041, 3729, 10301, 5291, 36033, 31749, 261871}}, {19687, 18, 105469, {1, 3, 7, 9, 27, 27, 41, 3, 303, 893, 697, 1631, 5015, 4233, 22827, 3913, 22245, 121193}}, {19688, 18, 105472, {1, 3, 3, 13, 19, 11, 15, 239, 419, 123, 1213, 185, 4465, 4909, 25421, 18363, 72537, 167939}}, {19689, 18, 105477, {1, 1, 3, 5, 13, 49, 57, 197, 19, 877, 1465, 2933, 5909, 7147, 1039, 37035, 91209, 126013}}, {19690, 18, 105490, {1, 1, 3, 5, 23, 7, 63, 179, 59, 47, 1501, 1863, 2949, 13959, 28131, 29705, 107975, 155251}}, {19691, 18, 105505, {1, 1, 1, 5, 25, 51, 77, 169, 327, 585, 1531, 3367, 3075, 6313, 26725, 453, 68635, 173787}}, {19692, 18, 105529, {1, 3, 7, 9, 5, 15, 43, 45, 311, 367, 297, 2249, 7507, 4785, 22685, 37279, 121683, 141453}}, {19693, 18, 105530, {1, 3, 7, 15, 17, 33, 43, 251, 281, 345, 1659, 3729, 7629, 6179, 26107, 64255, 88003, 2545}}, {19694, 18, 105604, {1, 3, 7, 9, 17, 13, 71, 49, 341, 495, 1975, 173, 5773, 3821, 6615, 50917, 53781, 75557}}, {19695, 18, 105614, {1, 1, 5, 13, 17, 21, 121, 35, 195, 367, 1191, 1331, 6423, 8425, 7705, 59117, 44575, 225431}}, {19696, 18, 105622, {1, 1, 1, 5, 25, 39, 89, 65, 449, 491, 211, 2949, 4493, 23, 22571, 4801, 50525, 222563}}, {19697, 18, 105625, {1, 1, 7, 5, 7, 21, 15, 171, 443, 225, 577, 1841, 8139, 15071, 6095, 60185, 71957, 244753}}, {19698, 18, 105652, {1, 1, 5, 9, 31, 33, 21, 195, 415, 1003, 441, 627, 2339, 8245, 11187, 55933, 59045, 177455}}, {19699, 18, 105687, {1, 1, 3, 9, 31, 29, 7, 15, 31, 577, 1435, 1317, 2923, 3807, 29693, 45857, 61787, 213565}}, {19700, 18, 105693, {1, 3, 7, 15, 17, 51, 65, 87, 295, 811, 753, 1113, 7695, 275, 28331, 46363, 53247, 166993}}, {19701, 18, 105707, {1, 1, 5, 11, 15, 31, 31, 47, 273, 383, 1831, 3821, 1337, 13257, 415, 35453, 15293, 173095}}, {19702, 18, 105721, {1, 3, 1, 13, 19, 21, 63, 199, 159, 475, 1257, 3119, 7083, 2861, 21099, 16873, 83583, 186289}}, {19703, 18, 105730, {1, 1, 7, 13, 15, 23, 11, 103, 387, 899, 261, 2863, 3681, 5683, 5587, 64655, 7411, 148633}}, {19704, 18, 105736, {1, 3, 1, 13, 1, 45, 5, 173, 379, 287, 1451, 2253, 3811, 10963, 20285, 59681, 81285, 48523}}, {19705, 18, 105753, {1, 1, 5, 9, 27, 17, 57, 25, 499, 289, 1083, 3057, 793, 5251, 10519, 36647, 67751, 237487}}, {19706, 18, 105759, {1, 1, 3, 1, 17, 13, 23, 73, 1, 951, 111, 3769, 3611, 4827, 10081, 55919, 21411, 127303}}, {19707, 18, 105760, {1, 3, 1, 1, 29, 35, 93, 139, 179, 217, 1839, 1907, 4365, 1813, 31985, 28927, 39319, 233413}}, {19708, 18, 105802, {1, 1, 1, 7, 7, 47, 37, 127, 449, 473, 311, 3833, 3263, 4163, 15985, 50159, 82685, 73273}}, {19709, 18, 105822, {1, 1, 1, 3, 3, 5, 69, 95, 101, 115, 1575, 63, 1897, 13733, 22149, 8793, 82983, 192553}}, {19710, 18, 105832, {1, 3, 1, 5, 3, 57, 121, 13, 291, 975, 505, 3105, 6929, 12737, 25869, 29173, 16757, 17733}}, {19711, 18, 105865, {1, 1, 3, 13, 13, 23, 51, 51, 239, 795, 877, 1547, 6533, 11497, 14309, 32941, 128109, 187313}}, {19712, 18, 105873, {1, 1, 3, 5, 19, 37, 57, 223, 509, 379, 1235, 1881, 4133, 13219, 5479, 36781, 56155, 231001}}, {19713, 18, 105874, {1, 1, 1, 5, 25, 45, 111, 183, 37, 875, 1487, 3771, 5593, 6835, 10921, 40697, 114455, 259491}}, {19714, 18, 105880, {1, 1, 3, 11, 13, 5, 43, 47, 7, 435, 1543, 3835, 1631, 8889, 23567, 24705, 26687, 14261}}, {19715, 18, 105899, {1, 3, 3, 11, 1, 13, 51, 171, 433, 1011, 679, 1307, 1683, 7379, 7163, 29727, 40209, 259973}}, {19716, 18, 105902, {1, 3, 1, 5, 25, 33, 111, 11, 303, 815, 1883, 263, 7907, 12637, 19203, 64151, 55739, 240509}}, {19717, 18, 105909, {1, 3, 5, 7, 23, 51, 3, 183, 425, 47, 231, 807, 1891, 10943, 17873, 20209, 60871, 30269}}, {19718, 18, 105919, {1, 1, 1, 1, 1, 23, 11, 183, 351, 5, 37, 3883, 1291, 15933, 11379, 53057, 61389, 240547}}, {19719, 18, 105922, {1, 3, 1, 5, 7, 53, 97, 29, 239, 805, 1929, 1001, 5103, 11, 24695, 7825, 109755, 254717}}, {19720, 18, 105946, {1, 3, 3, 11, 15, 37, 115, 117, 391, 313, 1761, 3627, 3931, 10277, 1767, 25401, 123827, 60463}}, {19721, 18, 105975, {1, 1, 7, 9, 9, 61, 23, 65, 473, 579, 1979, 415, 629, 3613, 27409, 46909, 3281, 3883}}, {19722, 18, 105992, {1, 3, 3, 13, 25, 17, 71, 247, 297, 451, 153, 1949, 2727, 6427, 19815, 54013, 129363, 248237}}, {19723, 18, 106005, {1, 1, 7, 7, 29, 9, 57, 171, 159, 287, 693, 1365, 4665, 5255, 15013, 21225, 125409, 5893}}, {19724, 18, 106057, {1, 3, 3, 1, 9, 43, 13, 139, 359, 267, 115, 2025, 693, 4789, 10353, 60459, 30835, 56575}}, {19725, 18, 106081, {1, 1, 1, 7, 23, 35, 35, 77, 245, 705, 75, 2841, 1683, 6109, 19661, 49021, 25019, 7297}}, {19726, 18, 106093, {1, 3, 1, 5, 1, 19, 49, 53, 19, 435, 1471, 409, 7051, 7057, 3621, 42925, 59551, 70941}}, {19727, 18, 106117, {1, 3, 7, 5, 21, 27, 39, 221, 389, 255, 537, 597, 7729, 10473, 6657, 13261, 11303, 112409}}, {19728, 18, 106127, {1, 3, 7, 13, 29, 29, 81, 107, 329, 25, 537, 561, 2247, 10371, 30031, 20537, 28437, 113319}}, {19729, 18, 106135, {1, 1, 5, 9, 9, 7, 89, 155, 337, 829, 755, 3259, 3563, 11849, 31179, 43297, 79601, 187545}}, {19730, 18, 106141, {1, 3, 3, 5, 11, 63, 101, 159, 357, 627, 587, 3233, 405, 4083, 5953, 44541, 110723, 240573}}, {19731, 18, 106189, {1, 1, 3, 15, 5, 39, 87, 231, 455, 195, 1603, 315, 3869, 6375, 745, 28349, 56469, 119033}}, {19732, 18, 106190, {1, 1, 7, 1, 11, 7, 79, 47, 391, 585, 1299, 3237, 7345, 15959, 4293, 43285, 111737, 215923}}, {19733, 18, 106197, {1, 1, 3, 15, 21, 53, 113, 73, 265, 589, 299, 289, 3983, 1653, 17407, 15287, 53199, 44221}}, {19734, 18, 106214, {1, 3, 1, 3, 1, 13, 31, 41, 509, 523, 401, 2647, 2731, 5699, 15649, 51737, 81249, 230865}}, {19735, 18, 106237, {1, 3, 5, 3, 15, 53, 91, 209, 249, 243, 1119, 2531, 319, 9259, 26555, 59579, 28767, 235073}}, {19736, 18, 106245, {1, 1, 1, 13, 29, 25, 57, 3, 413, 945, 841, 1151, 7167, 2545, 7283, 3947, 109375, 148677}}, {19737, 18, 106257, {1, 3, 3, 7, 29, 27, 81, 141, 21, 771, 577, 897, 73, 13081, 30035, 49213, 90627, 7483}}, {19738, 18, 106300, {1, 3, 1, 13, 23, 11, 19, 159, 183, 789, 683, 2071, 7107, 3025, 27333, 9571, 69621, 48529}}, {19739, 18, 106335, {1, 3, 1, 9, 5, 43, 7, 123, 341, 75, 1709, 135, 7929, 14563, 6849, 32783, 91971, 223789}}, {19740, 18, 106351, {1, 1, 7, 3, 19, 13, 45, 229, 7, 559, 1895, 2649, 7593, 1063, 17715, 45019, 29743, 37819}}, {19741, 18, 106370, {1, 1, 5, 3, 11, 25, 11, 169, 249, 415, 249, 209, 2223, 5947, 23381, 12109, 37697, 131729}}, {19742, 18, 106375, {1, 1, 1, 7, 19, 47, 125, 117, 235, 825, 801, 921, 2363, 1261, 20529, 65445, 55315, 173561}}, {19743, 18, 106376, {1, 1, 1, 1, 5, 39, 31, 11, 239, 333, 727, 3991, 1453, 2201, 18129, 3513, 112057, 109673}}, {19744, 18, 106384, {1, 1, 7, 5, 21, 59, 37, 255, 261, 1, 1401, 1101, 1233, 3813, 22809, 39389, 66263, 191623}}, {19745, 18, 106403, {1, 3, 1, 7, 5, 51, 73, 85, 319, 671, 1149, 1631, 6021, 10711, 3813, 36485, 106147, 202021}}, {19746, 18, 106405, {1, 3, 3, 13, 7, 63, 59, 253, 337, 453, 61, 209, 2809, 10429, 28069, 55971, 57985, 244779}}, {19747, 18, 106406, {1, 1, 1, 9, 27, 59, 45, 101, 427, 713, 1667, 2965, 6161, 1235, 8793, 2387, 66031, 85151}}, {19748, 18, 106429, {1, 1, 3, 1, 5, 25, 101, 7, 449, 149, 823, 725, 6803, 11949, 13009, 14785, 45633, 241957}}, {19749, 18, 106447, {1, 3, 7, 15, 29, 45, 103, 151, 159, 23, 1353, 3541, 5909, 4173, 31391, 16179, 38289, 206603}}, {19750, 18, 106466, {1, 1, 7, 7, 23, 3, 97, 29, 141, 383, 379, 3189, 4399, 4545, 30797, 55827, 126223, 97049}}, {19751, 18, 106495, {1, 3, 3, 7, 25, 35, 61, 15, 349, 929, 65, 3697, 7637, 12239, 29051, 36001, 114513, 151069}}, {19752, 18, 106532, {1, 3, 3, 11, 19, 1, 23, 245, 9, 689, 1251, 1043, 2393, 15817, 31561, 21059, 3435, 228091}}, {19753, 18, 106542, {1, 3, 7, 3, 23, 17, 121, 147, 427, 47, 905, 3877, 2301, 15709, 13599, 48895, 108955, 53219}}, {19754, 18, 106547, {1, 3, 7, 3, 25, 31, 53, 143, 1, 841, 1691, 749, 6713, 5373, 23487, 25749, 13911, 240923}}, {19755, 18, 106564, {1, 3, 5, 3, 7, 39, 101, 83, 159, 187, 583, 721, 7745, 1119, 61, 27319, 35157, 241729}}, {19756, 18, 106576, {1, 1, 5, 11, 27, 21, 79, 199, 179, 463, 987, 3909, 1741, 503, 12339, 15323, 4063, 180337}}, {19757, 18, 106586, {1, 3, 7, 11, 23, 43, 7, 115, 489, 215, 209, 3213, 4057, 13221, 27061, 52037, 34921, 36385}}, {19758, 18, 106592, {1, 1, 7, 1, 15, 13, 113, 55, 207, 839, 1939, 4095, 5629, 7647, 12753, 59739, 60779, 196589}}, {19759, 18, 106597, {1, 1, 1, 5, 5, 13, 113, 243, 297, 513, 1615, 1513, 1247, 4025, 20901, 44775, 86987, 75437}}, {19760, 18, 106610, {1, 1, 3, 7, 7, 35, 77, 115, 223, 929, 1683, 949, 2191, 15533, 29471, 24103, 102475, 173027}}, {19761, 18, 106612, {1, 3, 1, 11, 23, 37, 7, 179, 287, 267, 319, 3147, 1481, 12297, 28185, 51423, 7505, 236225}}, {19762, 18, 106635, {1, 1, 3, 5, 27, 5, 71, 95, 289, 121, 939, 3543, 365, 4903, 10091, 3903, 111155, 83517}}, {19763, 18, 106640, {1, 1, 7, 9, 29, 3, 87, 245, 313, 973, 1181, 3389, 3697, 13237, 13703, 31557, 17269, 17329}}, {19764, 18, 106673, {1, 1, 5, 11, 5, 41, 117, 51, 239, 907, 809, 741, 5327, 3403, 11825, 46981, 93485, 38053}}, {19765, 18, 106691, {1, 1, 7, 1, 25, 41, 5, 169, 11, 599, 1451, 2189, 7255, 8441, 11169, 58313, 4387, 69}}, {19766, 18, 106724, {1, 3, 1, 13, 5, 21, 75, 229, 153, 355, 1511, 175, 4793, 12111, 25321, 39983, 84205, 195003}}, {19767, 18, 106731, {1, 1, 7, 1, 17, 61, 67, 181, 69, 149, 921, 1107, 6319, 431, 29481, 12507, 13109, 29527}}, {19768, 18, 106741, {1, 1, 5, 5, 27, 47, 69, 119, 469, 193, 513, 1573, 7421, 2723, 20997, 59585, 49645, 261259}}, {19769, 18, 106748, {1, 1, 3, 9, 27, 41, 41, 3, 181, 803, 1281, 2937, 6745, 5629, 8403, 18987, 98411, 128321}}, {19770, 18, 106765, {1, 3, 3, 9, 5, 29, 55, 223, 309, 841, 1049, 1163, 3497, 8935, 8529, 51367, 90693, 77463}}, {19771, 18, 106789, {1, 3, 5, 3, 3, 59, 23, 31, 309, 907, 107, 3471, 4365, 14463, 24093, 35435, 24587, 151163}}, {19772, 18, 106822, {1, 3, 3, 1, 11, 37, 99, 95, 485, 601, 1797, 891, 5645, 8927, 22085, 5185, 18495, 260455}}, {19773, 18, 106856, {1, 3, 7, 15, 31, 61, 5, 177, 159, 287, 311, 1377, 1419, 4387, 25297, 22505, 100937, 223785}}, {19774, 18, 106861, {1, 3, 3, 3, 27, 31, 45, 171, 95, 507, 1475, 4013, 2781, 133, 6857, 3367, 103455, 69559}}, {19775, 18, 106870, {1, 3, 3, 7, 9, 51, 47, 247, 213, 665, 1929, 2799, 5513, 9183, 20197, 14831, 75277, 187565}}, {19776, 18, 106883, {1, 3, 1, 9, 13, 11, 15, 253, 145, 31, 847, 1579, 5513, 9, 3327, 46049, 16709, 56353}}, {19777, 18, 106895, {1, 3, 3, 3, 9, 17, 59, 131, 3, 621, 1209, 3415, 2999, 127, 629, 7925, 6109, 59743}}, {19778, 18, 106928, {1, 1, 5, 15, 29, 35, 87, 197, 495, 671, 51, 293, 3943, 7969, 4739, 10161, 119943, 97217}}, {19779, 18, 106938, {1, 1, 1, 9, 25, 57, 61, 197, 139, 899, 783, 3835, 3407, 16301, 19033, 33359, 56309, 16237}}, {19780, 18, 106979, {1, 1, 5, 11, 25, 47, 95, 121, 197, 511, 227, 2281, 5805, 10581, 14885, 19685, 28075, 25431}}, {19781, 18, 106985, {1, 1, 3, 9, 1, 43, 59, 105, 319, 45, 1567, 905, 7641, 2199, 3979, 13717, 22829, 44777}}, {19782, 18, 107005, {1, 3, 7, 1, 19, 49, 105, 53, 227, 293, 989, 697, 2553, 4561, 14851, 8999, 74815, 207475}}, {19783, 18, 107012, {1, 1, 5, 11, 23, 3, 85, 29, 419, 847, 1385, 3857, 641, 14951, 25629, 18019, 2497, 24723}}, {19784, 18, 107019, {1, 3, 5, 15, 5, 11, 51, 225, 179, 695, 787, 663, 7051, 3595, 4987, 53315, 88693, 7915}}, {19785, 18, 107045, {1, 3, 1, 13, 17, 51, 51, 247, 431, 555, 603, 3301, 443, 629, 26509, 32047, 54433, 208297}}, {19786, 18, 107052, {1, 3, 7, 7, 13, 41, 95, 105, 135, 443, 377, 1259, 3301, 6945, 11677, 33869, 107799, 186567}}, {19787, 18, 107082, {1, 1, 5, 7, 31, 17, 85, 129, 409, 781, 983, 25, 6877, 83, 12625, 31919, 41989, 55195}}, {19788, 18, 107089, {1, 1, 3, 3, 7, 45, 37, 45, 237, 967, 1371, 657, 7983, 3121, 32707, 25757, 49987, 92683}}, {19789, 18, 107118, {1, 3, 1, 1, 19, 57, 63, 25, 355, 893, 2017, 1671, 7343, 4451, 28243, 22157, 103901, 178017}}, {19790, 18, 107163, {1, 3, 7, 13, 17, 59, 81, 99, 329, 117, 1395, 2565, 5725, 2371, 343, 4713, 35077, 49793}}, {19791, 18, 107202, {1, 3, 7, 15, 31, 19, 87, 243, 411, 339, 1063, 117, 1827, 1583, 12571, 23153, 3363, 81695}}, {19792, 18, 107238, {1, 3, 7, 1, 3, 49, 95, 133, 295, 433, 1885, 843, 6679, 13673, 32277, 59085, 46957, 217037}}, {19793, 18, 107242, {1, 1, 3, 9, 23, 53, 45, 183, 79, 55, 1267, 283, 3249, 4101, 8107, 54473, 126141, 127235}}, {19794, 18, 107244, {1, 3, 5, 7, 19, 57, 113, 205, 37, 817, 929, 3643, 2231, 15725, 1733, 7877, 116741, 254529}}, {19795, 18, 107264, {1, 3, 1, 9, 9, 7, 75, 45, 83, 203, 1401, 445, 1043, 239, 30865, 32189, 91081, 180681}}, {19796, 18, 107273, {1, 1, 7, 7, 1, 3, 61, 255, 483, 599, 897, 1601, 5189, 13279, 4981, 37235, 117505, 66625}}, {19797, 18, 107291, {1, 1, 3, 13, 29, 43, 65, 73, 213, 307, 959, 2735, 5155, 16063, 15745, 6225, 50159, 182445}}, {19798, 18, 107293, {1, 1, 3, 9, 31, 61, 73, 185, 457, 687, 1887, 4041, 3455, 4739, 16399, 40929, 32631, 179031}}, {19799, 18, 107312, {1, 3, 3, 15, 5, 45, 1, 241, 187, 23, 63, 2497, 7759, 9175, 11003, 40579, 45769, 107133}}, {19800, 18, 107318, {1, 3, 3, 7, 5, 63, 7, 67, 31, 917, 1825, 2037, 2527, 9767, 2665, 18573, 14289, 21583}}, {19801, 18, 107335, {1, 1, 5, 15, 15, 25, 51, 127, 261, 925, 1651, 769, 7779, 7327, 7239, 20437, 9947, 144697}}, {19802, 18, 107349, {1, 1, 5, 1, 5, 13, 99, 7, 269, 135, 345, 1851, 7963, 457, 24573, 32529, 127359, 157755}}, {19803, 18, 107350, {1, 3, 5, 15, 21, 17, 31, 115, 321, 351, 117, 1301, 2455, 3363, 14213, 62903, 75273, 261119}}, {19804, 18, 107363, {1, 3, 7, 1, 1, 9, 53, 209, 319, 489, 827, 1365, 4709, 7419, 28213, 56095, 9611, 234877}}, {19805, 18, 107390, {1, 1, 5, 5, 1, 7, 49, 15, 377, 309, 1701, 1775, 5571, 12437, 27521, 54753, 68977, 138549}}, {19806, 18, 107405, {1, 1, 3, 11, 9, 29, 67, 21, 411, 647, 983, 1075, 2387, 13355, 1781, 56129, 87235, 260133}}, {19807, 18, 107408, {1, 3, 1, 11, 5, 57, 71, 159, 345, 853, 745, 3733, 1607, 7265, 20097, 18911, 101141, 70495}}, {19808, 18, 107427, {1, 1, 3, 9, 1, 43, 127, 127, 471, 465, 1777, 1879, 4655, 12925, 24935, 58445, 78303, 200463}}, {19809, 18, 107433, {1, 1, 1, 15, 5, 33, 63, 17, 401, 831, 1559, 3547, 7869, 13901, 18185, 9399, 65859, 185315}}, {19810, 18, 107444, {1, 3, 7, 1, 25, 21, 17, 175, 401, 833, 847, 3593, 1283, 14745, 11827, 1987, 89299, 187369}}, {19811, 18, 107514, {1, 1, 7, 13, 29, 31, 45, 219, 177, 369, 1313, 3015, 5859, 1829, 8793, 49109, 97581, 233179}}, {19812, 18, 107522, {1, 3, 3, 15, 17, 31, 61, 215, 231, 495, 1307, 3067, 3187, 8813, 22505, 14055, 30773, 177955}}, {19813, 18, 107545, {1, 3, 7, 15, 9, 61, 57, 105, 89, 267, 233, 905, 3727, 1841, 31875, 32499, 27003, 208491}}, {19814, 18, 107582, {1, 3, 1, 11, 31, 9, 63, 55, 213, 209, 1625, 2635, 4335, 15201, 6127, 11097, 37991, 62813}}, {19815, 18, 107590, {1, 1, 1, 5, 13, 49, 127, 249, 339, 525, 1943, 2935, 3255, 5199, 6869, 6325, 731, 51085}}, {19816, 18, 107593, {1, 1, 5, 7, 7, 29, 59, 187, 463, 409, 1321, 377, 7361, 8303, 20385, 39649, 81379, 235555}}, {19817, 18, 107599, {1, 1, 5, 13, 15, 45, 99, 57, 217, 535, 1747, 4081, 4781, 1005, 25197, 23853, 90587, 189579}}, {19818, 18, 107604, {1, 1, 7, 7, 23, 31, 1, 151, 339, 447, 523, 2609, 5917, 6965, 25815, 62797, 104083, 245917}}, {19819, 18, 107608, {1, 3, 5, 3, 7, 37, 79, 253, 423, 511, 1477, 3121, 5557, 1413, 31075, 22249, 117639, 243543}}, {19820, 18, 107627, {1, 1, 3, 7, 5, 31, 93, 117, 135, 235, 745, 3287, 4451, 2487, 15179, 62229, 18247, 150277}}, {19821, 18, 107638, {1, 1, 7, 15, 31, 57, 125, 219, 433, 629, 1809, 2499, 6083, 7631, 31495, 63183, 28533, 120579}}, {19822, 18, 107666, {1, 1, 1, 13, 31, 47, 77, 73, 343, 867, 1055, 1121, 3035, 15693, 6971, 50231, 16527, 190795}}, {19823, 18, 107678, {1, 3, 7, 7, 11, 1, 5, 215, 87, 885, 1429, 1277, 3831, 9341, 22011, 34585, 56167, 65301}}, {19824, 18, 107701, {1, 3, 1, 15, 13, 53, 91, 59, 277, 819, 453, 3191, 757, 4729, 20605, 4283, 110745, 233655}}, {19825, 18, 107720, {1, 3, 3, 5, 17, 47, 69, 117, 113, 775, 935, 1879, 2239, 5877, 18337, 50895, 44891, 2759}}, {19826, 18, 107723, {1, 3, 5, 1, 27, 31, 77, 65, 355, 405, 825, 2419, 3337, 10179, 27665, 35459, 13721, 154227}}, {19827, 18, 107725, {1, 3, 3, 7, 23, 61, 9, 241, 239, 85, 485, 2659, 5371, 16175, 28691, 49109, 124433, 167033}}, {19828, 18, 107731, {1, 3, 3, 3, 11, 57, 37, 155, 443, 249, 1913, 1347, 6569, 5357, 4231, 58273, 50707, 57097}}, {19829, 18, 107737, {1, 1, 3, 3, 1, 7, 87, 115, 259, 807, 45, 2997, 63, 16313, 12507, 39925, 17699, 24411}}, {19830, 18, 107767, {1, 3, 3, 1, 19, 59, 97, 209, 247, 395, 21, 1803, 2547, 11607, 15703, 58099, 111907, 196101}}, {19831, 18, 107779, {1, 1, 7, 13, 27, 61, 73, 183, 493, 953, 445, 567, 7373, 15275, 30081, 539, 89365, 3455}}, {19832, 18, 107788, {1, 3, 1, 3, 25, 35, 3, 105, 243, 781, 1937, 2781, 7849, 2159, 2221, 58005, 89313, 182183}}, {19833, 18, 107799, {1, 1, 7, 15, 21, 7, 67, 163, 179, 453, 581, 2245, 3915, 8985, 16809, 35113, 93605, 79009}}, {19834, 18, 107819, {1, 1, 7, 5, 29, 57, 13, 75, 387, 511, 331, 1119, 307, 6145, 3841, 49987, 67335, 120419}}, {19835, 18, 107833, {1, 3, 1, 5, 13, 21, 119, 207, 453, 943, 137, 2245, 7771, 5737, 9541, 29209, 106867, 110513}}, {19836, 18, 107881, {1, 3, 7, 13, 7, 3, 99, 129, 245, 687, 883, 1321, 1131, 6661, 7437, 1345, 128247, 167877}}, {19837, 18, 107901, {1, 1, 3, 11, 7, 57, 59, 3, 217, 549, 85, 2607, 215, 2249, 3963, 42931, 33747, 226265}}, {19838, 18, 107911, {1, 1, 5, 5, 29, 23, 115, 215, 103, 427, 1689, 831, 3293, 14055, 3735, 49521, 17703, 182887}}, {19839, 18, 107930, {1, 1, 1, 15, 5, 43, 27, 181, 217, 955, 225, 2731, 7347, 14123, 26169, 4371, 26907, 15017}}, {19840, 18, 107936, {1, 1, 7, 7, 31, 55, 63, 223, 61, 63, 431, 2779, 3169, 14323, 2945, 63913, 85407, 76511}}, {19841, 18, 107980, {1, 1, 3, 11, 5, 27, 113, 75, 313, 697, 13, 1853, 7467, 5701, 16749, 17939, 13475, 39807}}, {19842, 18, 108004, {1, 1, 7, 5, 13, 53, 55, 115, 125, 341, 321, 3291, 2675, 13659, 16819, 45397, 42917, 104361}}, {19843, 18, 108008, {1, 3, 3, 15, 27, 47, 19, 213, 441, 605, 593, 2287, 4847, 10505, 22185, 36157, 10881, 87799}}, {19844, 18, 108016, {1, 1, 1, 11, 15, 39, 109, 3, 469, 371, 1743, 2789, 199, 8703, 7407, 3353, 103417, 73319}}, {19845, 18, 108066, {1, 3, 7, 5, 25, 61, 77, 111, 263, 399, 1579, 3447, 6205, 5945, 28099, 39183, 77003, 115001}}, {19846, 18, 108071, {1, 1, 1, 3, 1, 7, 57, 193, 379, 923, 151, 2227, 7285, 2371, 24567, 34037, 80655, 125499}}, {19847, 18, 108107, {1, 3, 5, 7, 13, 15, 5, 193, 55, 319, 1851, 2439, 8071, 5329, 3155, 64669, 18547, 238997}}, {19848, 18, 108110, {1, 3, 3, 11, 7, 23, 1, 203, 333, 951, 153, 1249, 5093, 407, 361, 14175, 45149, 186291}}, {19849, 18, 108124, {1, 3, 1, 11, 13, 19, 89, 229, 139, 981, 455, 907, 5109, 8513, 23823, 54933, 69985, 227679}}, {19850, 18, 108145, {1, 3, 5, 13, 23, 47, 65, 123, 115, 759, 375, 1283, 729, 11045, 22015, 18287, 112603, 75911}}, {19851, 18, 108148, {1, 1, 3, 1, 5, 43, 91, 123, 219, 409, 517, 3999, 1409, 5949, 15727, 62705, 73573, 198447}}, {19852, 18, 108158, {1, 3, 3, 3, 5, 23, 95, 51, 275, 455, 1831, 2427, 3779, 10209, 30839, 23393, 25681, 8715}}, {19853, 18, 108164, {1, 3, 5, 3, 9, 5, 61, 97, 497, 397, 695, 517, 3313, 4911, 1961, 45805, 99135, 216657}}, {19854, 18, 108197, {1, 1, 1, 7, 13, 41, 19, 31, 103, 1005, 73, 1855, 405, 12395, 19979, 17663, 105183, 28493}}, {19855, 18, 108198, {1, 3, 1, 11, 27, 27, 69, 149, 1, 225, 1809, 1367, 3663, 6545, 8475, 40837, 64459, 66705}}, {19856, 18, 108219, {1, 3, 3, 1, 29, 21, 113, 149, 215, 443, 1069, 3437, 1793, 13573, 28285, 33707, 29127, 40715}}, {19857, 18, 108222, {1, 3, 3, 5, 21, 9, 53, 181, 455, 283, 245, 3999, 875, 9799, 10963, 31603, 34907, 64977}}, {19858, 18, 108224, {1, 3, 1, 11, 31, 51, 29, 103, 61, 529, 777, 1097, 445, 9169, 6305, 4513, 60189, 164103}}, {19859, 18, 108227, {1, 1, 1, 3, 21, 5, 87, 11, 461, 637, 1283, 1471, 1429, 2401, 12163, 29401, 30089, 41745}}, {19860, 18, 108290, {1, 1, 3, 3, 17, 43, 13, 153, 73, 419, 747, 279, 7195, 4383, 26345, 28365, 97753, 208989}}, {19861, 18, 108302, {1, 3, 7, 1, 17, 55, 103, 151, 327, 575, 1923, 1533, 4699, 2171, 15447, 64047, 59007, 54523}}, {19862, 18, 108329, {1, 3, 7, 7, 3, 51, 79, 39, 403, 599, 161, 2465, 4911, 10327, 23599, 3267, 44177, 184231}}, {19863, 18, 108335, {1, 3, 3, 15, 5, 19, 57, 83, 507, 927, 665, 3471, 5037, 2051, 22923, 36813, 97393, 102715}}, {19864, 18, 108338, {1, 3, 3, 13, 11, 19, 91, 179, 113, 295, 855, 2071, 3265, 4089, 8627, 7461, 23855, 53675}}, {19865, 18, 108362, {1, 1, 3, 5, 21, 41, 11, 227, 87, 417, 209, 2013, 4849, 5291, 22073, 40235, 71283, 140785}}, {19866, 18, 108398, {1, 3, 3, 5, 29, 57, 95, 65, 177, 177, 1973, 563, 5249, 337, 7611, 45099, 15443, 46583}}, {19867, 18, 108405, {1, 1, 7, 3, 3, 5, 107, 75, 31, 293, 821, 1837, 2363, 13621, 8793, 29841, 127201, 131707}}, {19868, 18, 108409, {1, 1, 1, 5, 1, 45, 69, 61, 157, 999, 183, 3431, 3487, 9461, 17545, 26973, 115527, 58419}}, {19869, 18, 108431, {1, 1, 7, 7, 27, 5, 125, 153, 191, 745, 125, 2807, 5043, 10657, 24487, 19517, 31735, 42421}}, {19870, 18, 108449, {1, 1, 7, 9, 25, 37, 73, 255, 141, 229, 1723, 1331, 6089, 13109, 30683, 2335, 111517, 105411}}, {19871, 18, 108474, {1, 1, 5, 7, 3, 61, 79, 203, 423, 669, 1757, 1725, 4239, 7013, 28591, 61853, 81103, 39813}}, {19872, 18, 108488, {1, 1, 3, 7, 21, 27, 23, 119, 441, 113, 1019, 285, 53, 8643, 31689, 2629, 126573, 60835}}, {19873, 18, 108530, {1, 1, 5, 11, 29, 49, 23, 55, 441, 809, 1177, 1371, 5945, 6461, 11537, 12287, 85637, 232065}}, {19874, 18, 108545, {1, 3, 1, 15, 5, 13, 19, 209, 105, 897, 565, 3209, 487, 9837, 22169, 26317, 39907, 185193}}, {19875, 18, 108551, {1, 1, 1, 5, 23, 45, 49, 55, 501, 213, 1217, 3159, 733, 5889, 5475, 4953, 37317, 100369}}, {19876, 18, 108558, {1, 1, 5, 1, 19, 5, 57, 137, 361, 605, 1077, 2015, 5511, 4667, 18457, 45979, 120253, 203397}}, {19877, 18, 108585, {1, 1, 7, 9, 19, 19, 11, 187, 5, 647, 275, 1265, 7587, 16183, 369, 31885, 58347, 36829}}, {19878, 18, 108613, {1, 3, 5, 3, 31, 31, 7, 105, 359, 839, 641, 3215, 4807, 13397, 885, 52867, 57125, 180607}}, {19879, 18, 108638, {1, 1, 7, 9, 19, 45, 43, 211, 429, 757, 1637, 1569, 935, 8899, 24823, 18599, 111373, 190979}}, {19880, 18, 108642, {1, 1, 7, 7, 13, 47, 3, 241, 467, 209, 323, 3467, 4397, 15395, 15373, 14499, 92443, 65931}}, {19881, 18, 108653, {1, 3, 3, 5, 5, 9, 67, 115, 45, 279, 1753, 1575, 8127, 9651, 5169, 25643, 29671, 214383}}, {19882, 18, 108671, {1, 3, 7, 7, 29, 7, 37, 205, 495, 445, 1771, 1439, 3577, 10423, 10865, 26851, 15251, 63373}}, {19883, 18, 108675, {1, 3, 1, 9, 29, 13, 45, 61, 153, 193, 1407, 1075, 4023, 2367, 1147, 51277, 52975, 123061}}, {19884, 18, 108684, {1, 3, 3, 3, 31, 25, 113, 173, 345, 565, 145, 3437, 7051, 12557, 27919, 41733, 76717, 192645}}, {19885, 18, 108687, {1, 3, 3, 7, 3, 55, 35, 219, 55, 467, 635, 3833, 3753, 1099, 15301, 53121, 120807, 70481}}, {19886, 18, 108696, {1, 3, 7, 7, 13, 1, 121, 191, 71, 193, 1891, 2303, 1401, 9143, 31297, 38979, 43093, 138941}}, {19887, 18, 108786, {1, 3, 7, 5, 17, 51, 83, 201, 231, 423, 511, 1301, 6075, 475, 2603, 49327, 78565, 220827}}, {19888, 18, 108792, {1, 3, 1, 7, 5, 61, 23, 11, 9, 711, 251, 1383, 613, 6213, 8921, 27267, 66009, 28575}}, {19889, 18, 108795, {1, 3, 1, 3, 13, 13, 61, 211, 353, 883, 343, 1089, 2041, 7781, 25285, 9053, 76801, 153009}}, {19890, 18, 108818, {1, 3, 7, 5, 17, 61, 67, 69, 361, 937, 949, 1483, 2825, 3753, 16533, 17277, 16539, 140521}}, {19891, 18, 108830, {1, 3, 5, 9, 7, 19, 31, 239, 357, 561, 1583, 3059, 2023, 2213, 11283, 18603, 83487, 162415}}, {19892, 18, 108836, {1, 1, 3, 15, 15, 59, 9, 43, 353, 203, 765, 1907, 2733, 3747, 30617, 32671, 119005, 72131}}, {19893, 18, 108839, {1, 3, 1, 7, 17, 61, 55, 113, 439, 75, 703, 2741, 1059, 4561, 15923, 17153, 32563, 79681}}, {19894, 18, 108851, {1, 1, 1, 15, 11, 57, 91, 245, 187, 185, 1859, 1209, 3247, 10863, 22421, 47287, 26831, 200935}}, {19895, 18, 108875, {1, 1, 3, 13, 11, 39, 61, 211, 51, 197, 861, 2965, 4691, 9955, 2289, 28795, 61537, 235359}}, {19896, 18, 108883, {1, 1, 7, 1, 31, 37, 121, 107, 79, 521, 371, 983, 6189, 4515, 25691, 26933, 123189, 70033}}, {19897, 18, 108895, {1, 3, 3, 15, 19, 33, 31, 237, 35, 877, 1013, 3445, 573, 1145, 27781, 26327, 117451, 142339}}, {19898, 18, 108908, {1, 3, 3, 15, 15, 9, 17, 185, 151, 499, 493, 1331, 1587, 12657, 22577, 7957, 126253, 57971}}, {19899, 18, 108953, {1, 3, 7, 15, 3, 29, 43, 105, 423, 601, 793, 1011, 6657, 7287, 18561, 46993, 72945, 233051}}, {19900, 18, 108956, {1, 1, 7, 5, 15, 17, 125, 141, 75, 877, 281, 2011, 4217, 9785, 7587, 42863, 35585, 212795}}, {19901, 18, 108963, {1, 1, 3, 3, 3, 37, 67, 129, 433, 233, 115, 687, 6253, 12805, 10935, 49963, 91675, 241951}}, {19902, 18, 108989, {1, 3, 1, 5, 3, 41, 3, 233, 317, 959, 1407, 1251, 743, 4165, 15561, 41165, 22393, 111633}}, {19903, 18, 109001, {1, 3, 3, 15, 17, 15, 53, 245, 109, 413, 1149, 35, 2931, 11635, 27091, 63659, 33973, 16867}}, {19904, 18, 109009, {1, 3, 7, 13, 3, 43, 83, 201, 367, 275, 235, 1795, 4041, 13539, 22345, 31451, 83985, 3527}}, {19905, 18, 109052, {1, 3, 3, 9, 31, 47, 63, 117, 195, 497, 453, 1183, 3857, 14075, 28057, 13205, 54331, 54641}}, {19906, 18, 109083, {1, 1, 7, 11, 11, 39, 37, 183, 213, 537, 1371, 901, 5255, 11791, 18993, 58785, 114113, 229815}}, {19907, 18, 109090, {1, 3, 5, 5, 13, 45, 77, 165, 329, 439, 2011, 1845, 4577, 12457, 16959, 45943, 37715, 169775}}, {19908, 18, 109104, {1, 1, 3, 11, 5, 7, 21, 245, 365, 371, 1291, 2569, 1791, 6003, 18619, 18661, 98551, 89645}}, {19909, 18, 109121, {1, 3, 1, 7, 3, 51, 49, 245, 151, 919, 489, 3967, 3157, 7159, 17207, 19749, 94455, 112403}}, {19910, 18, 109128, {1, 3, 7, 5, 9, 15, 17, 201, 273, 669, 1571, 3915, 1859, 2569, 28855, 27225, 116711, 148377}}, {19911, 18, 109141, {1, 3, 7, 3, 19, 45, 115, 71, 201, 85, 1349, 3897, 4941, 10839, 14781, 36487, 107037, 109185}}, {19912, 18, 109146, {1, 3, 5, 13, 11, 11, 35, 19, 213, 41, 45, 4075, 3163, 12937, 17487, 28911, 21289, 198489}}, {19913, 18, 109155, {1, 1, 1, 11, 7, 35, 67, 23, 451, 235, 717, 181, 6697, 9359, 24561, 36187, 125179, 35119}}, {19914, 18, 109162, {1, 1, 7, 15, 7, 47, 55, 125, 465, 251, 211, 3137, 4101, 1341, 2287, 22149, 45089, 94173}}, {19915, 18, 109209, {1, 3, 1, 15, 19, 7, 15, 207, 7, 759, 869, 2337, 6805, 8287, 13447, 9963, 7177, 173505}}, {19916, 18, 109216, {1, 3, 7, 13, 15, 3, 65, 143, 291, 511, 939, 669, 4095, 1931, 26015, 18253, 102461, 93837}}, {19917, 18, 109243, {1, 3, 1, 5, 23, 3, 19, 121, 489, 583, 1425, 627, 4229, 5343, 3759, 17845, 105369, 132239}}, {19918, 18, 109265, {1, 3, 3, 9, 29, 9, 17, 153, 111, 879, 1225, 979, 2687, 10477, 10105, 18091, 37825, 28077}}, {19919, 18, 109282, {1, 1, 7, 9, 3, 51, 75, 101, 197, 551, 89, 1441, 607, 14025, 30411, 26887, 3435, 32977}}, {19920, 18, 109306, {1, 1, 7, 3, 25, 29, 95, 123, 197, 767, 1513, 721, 4149, 10873, 32247, 4469, 42297, 49651}}, {19921, 18, 109316, {1, 3, 5, 15, 11, 3, 77, 161, 309, 923, 513, 161, 6447, 9811, 9209, 21413, 8611, 237557}}, {19922, 18, 109334, {1, 3, 1, 3, 23, 11, 61, 107, 317, 771, 1469, 3367, 6607, 11495, 12271, 59989, 52483, 194761}}, {19923, 18, 109359, {1, 3, 7, 7, 23, 1, 37, 47, 185, 863, 1153, 3517, 6165, 3921, 19311, 37339, 112477, 204915}}, {19924, 18, 109373, {1, 3, 7, 7, 15, 61, 9, 113, 175, 305, 1759, 2933, 2139, 3591, 15303, 54479, 126511, 255205}}, {19925, 18, 109386, {1, 1, 1, 3, 29, 43, 19, 183, 121, 577, 1329, 1737, 4373, 5577, 24023, 40103, 22333, 123423}}, {19926, 18, 109394, {1, 3, 5, 1, 29, 1, 5, 177, 271, 431, 139, 705, 4319, 9301, 15887, 13253, 13275, 233317}}, {19927, 18, 109403, {1, 1, 3, 7, 21, 3, 13, 51, 459, 359, 1721, 193, 4887, 7805, 20615, 28813, 82427, 57853}}, {19928, 18, 109409, {1, 3, 3, 13, 3, 29, 43, 95, 339, 993, 979, 2323, 7505, 10203, 9475, 16513, 21651, 104871}}, {19929, 18, 109412, {1, 1, 3, 15, 11, 5, 97, 127, 397, 25, 507, 1839, 2313, 13399, 899, 25713, 94363, 178287}}, {19930, 18, 109427, {1, 1, 5, 5, 9, 53, 95, 171, 107, 129, 1041, 3583, 5479, 943, 21435, 36481, 85519, 169651}}, {19931, 18, 109439, {1, 1, 1, 1, 1, 11, 17, 249, 277, 805, 1827, 2705, 3015, 9033, 25019, 38593, 59235, 21145}}, {19932, 18, 109464, {1, 1, 7, 3, 7, 59, 107, 213, 109, 213, 555, 3463, 953, 3173, 18947, 2863, 27889, 32493}}, {19933, 18, 109467, {1, 3, 5, 15, 21, 11, 99, 131, 287, 513, 1393, 3327, 7347, 4343, 8805, 29571, 97151, 97313}}, {19934, 18, 109476, {1, 3, 5, 3, 17, 53, 23, 21, 227, 291, 111, 1951, 6593, 16325, 31725, 31997, 116907, 181027}}, {19935, 18, 109488, {1, 1, 5, 3, 15, 57, 93, 153, 345, 257, 169, 795, 3907, 5669, 25447, 28775, 1489, 216417}}, {19936, 18, 109497, {1, 1, 1, 5, 19, 19, 113, 55, 431, 685, 1839, 711, 4909, 10211, 25765, 37, 72657, 79769}}, {19937, 18, 109523, {1, 3, 5, 7, 19, 17, 93, 145, 99, 799, 1615, 1583, 7705, 1069, 30259, 37951, 78965, 16203}}, {19938, 18, 109551, {1, 3, 7, 13, 23, 61, 119, 49, 413, 1021, 415, 465, 7395, 31, 16415, 1009, 9843, 86531}}, {19939, 18, 109556, {1, 1, 3, 15, 17, 21, 83, 69, 411, 1, 269, 1391, 295, 13649, 21649, 62453, 11457, 215375}}, {19940, 18, 109566, {1, 3, 3, 7, 25, 53, 95, 99, 447, 323, 27, 1595, 3771, 16099, 31523, 14405, 66999, 65733}}, {19941, 18, 109598, {1, 1, 3, 11, 25, 29, 19, 95, 101, 661, 537, 641, 1455, 16151, 29087, 54009, 89395, 2223}}, {19942, 18, 109628, {1, 1, 1, 11, 11, 33, 91, 227, 449, 661, 1621, 1743, 2859, 9797, 32397, 41767, 116325, 6839}}, {19943, 18, 109643, {1, 3, 3, 7, 31, 41, 15, 139, 53, 789, 25, 67, 1131, 5987, 14091, 37259, 70313, 6633}}, {19944, 18, 109663, {1, 3, 7, 13, 21, 29, 71, 245, 497, 493, 207, 3221, 3695, 3045, 1497, 29235, 65113, 82015}}, {19945, 18, 109674, {1, 1, 7, 5, 29, 29, 87, 197, 123, 323, 773, 157, 2925, 9235, 31625, 58187, 121457, 25561}}, {19946, 18, 109688, {1, 1, 1, 9, 3, 15, 99, 55, 133, 757, 1405, 997, 5201, 8971, 6095, 33309, 35587, 254545}}, {19947, 18, 109691, {1, 3, 5, 9, 19, 57, 85, 45, 429, 823, 1369, 933, 1971, 13753, 11351, 45805, 16527, 129907}}, {19948, 18, 109704, {1, 3, 3, 15, 23, 15, 35, 89, 477, 875, 1087, 2837, 1093, 617, 18687, 53269, 63447, 226393}}, {19949, 18, 109715, {1, 1, 7, 9, 27, 37, 23, 107, 265, 485, 1975, 3159, 4065, 10089, 26975, 45067, 4241, 49051}}, {19950, 18, 109717, {1, 3, 3, 1, 29, 53, 89, 129, 149, 717, 749, 1481, 7829, 15887, 23185, 30667, 11749, 188963}}, {19951, 18, 109746, {1, 3, 5, 9, 13, 47, 119, 135, 407, 99, 1773, 2307, 7885, 4013, 25723, 53519, 37487, 205671}}, {19952, 18, 109789, {1, 1, 5, 1, 11, 27, 121, 213, 147, 669, 799, 485, 4275, 15909, 30583, 45925, 90365, 226901}}, {19953, 18, 109794, {1, 1, 3, 5, 1, 19, 81, 109, 217, 949, 1637, 3413, 5957, 7293, 17337, 63857, 103815, 80805}}, {19954, 18, 109868, {1, 3, 7, 3, 9, 43, 119, 251, 345, 3, 203, 829, 3391, 2575, 6859, 50849, 22221, 227581}}, {19955, 18, 109886, {1, 1, 7, 15, 13, 43, 7, 23, 101, 89, 1747, 1231, 1883, 13363, 10981, 59179, 59555, 242021}}, {19956, 18, 109888, {1, 1, 5, 5, 23, 15, 93, 183, 231, 891, 1745, 2665, 1689, 8515, 11717, 35643, 113067, 233757}}, {19957, 18, 109903, {1, 3, 7, 11, 29, 21, 13, 59, 103, 105, 483, 863, 2711, 7917, 29279, 53931, 7011, 60075}}, {19958, 18, 109908, {1, 1, 3, 15, 5, 37, 101, 163, 31, 575, 2029, 1625, 4545, 12579, 15175, 32667, 59497, 63653}}, {19959, 18, 109912, {1, 3, 5, 7, 23, 37, 61, 101, 273, 49, 1943, 3381, 491, 4079, 20341, 26463, 122261, 77965}}, {19960, 18, 109927, {1, 1, 3, 15, 9, 51, 53, 89, 175, 487, 1583, 1797, 4353, 1339, 19613, 26913, 78955, 166523}}, {19961, 18, 109936, {1, 3, 3, 9, 27, 57, 25, 207, 233, 675, 661, 2629, 6971, 8723, 31199, 47215, 36931, 28347}}, {19962, 18, 109979, {1, 3, 1, 3, 31, 15, 123, 17, 211, 883, 1861, 2747, 8075, 5373, 23521, 46217, 86629, 171777}}, {19963, 18, 110005, {1, 3, 5, 9, 11, 43, 45, 171, 465, 835, 603, 2121, 409, 1643, 20327, 63211, 129479, 223113}}, {19964, 18, 110010, {1, 1, 5, 7, 13, 57, 83, 233, 307, 489, 941, 1723, 6149, 5557, 2053, 17377, 31597, 176051}}, {19965, 18, 110017, {1, 1, 7, 3, 11, 11, 85, 163, 169, 989, 1289, 2749, 7681, 4679, 645, 36589, 85907, 194713}}, {19966, 18, 110041, {1, 1, 1, 7, 3, 57, 39, 149, 463, 947, 481, 1163, 7171, 8539, 28991, 61235, 74487, 107051}}, {19967, 18, 110042, {1, 1, 3, 7, 9, 57, 89, 101, 231, 163, 1355, 1393, 5823, 7565, 26285, 13523, 130329, 26099}}, {19968, 18, 110047, {1, 1, 7, 15, 13, 59, 111, 35, 265, 927, 125, 1881, 5397, 757, 23845, 9677, 76077, 163361}}, {19969, 18, 110048, {1, 1, 7, 9, 1, 63, 61, 157, 389, 143, 1445, 881, 3609, 9955, 11159, 59677, 45831, 138345}}, {19970, 18, 110053, {1, 3, 5, 7, 5, 45, 65, 23, 257, 589, 905, 3651, 743, 117, 30307, 7415, 103331, 252889}}, {19971, 18, 110054, {1, 1, 7, 13, 3, 57, 113, 91, 217, 967, 481, 989, 4795, 3549, 23717, 60793, 80281, 19977}}, {19972, 18, 110057, {1, 3, 3, 1, 15, 37, 113, 245, 239, 575, 197, 2803, 7743, 13447, 3601, 56981, 76381, 13321}}, {19973, 18, 110091, {1, 3, 1, 11, 27, 33, 99, 151, 43, 835, 1951, 1957, 2983, 6781, 9319, 2119, 40533, 118325}}, {19974, 18, 110093, {1, 3, 3, 7, 27, 19, 23, 243, 347, 477, 1661, 1891, 2439, 2485, 31743, 1427, 20317, 90803}}, {19975, 18, 110112, {1, 3, 1, 1, 3, 59, 71, 129, 21, 3, 449, 629, 3657, 4045, 8305, 40461, 60927, 38529}}, {19976, 18, 110127, {1, 3, 3, 7, 9, 11, 85, 185, 369, 451, 887, 3709, 6931, 111, 1379, 8741, 58777, 188045}}, {19977, 18, 110178, {1, 3, 7, 11, 23, 13, 77, 141, 99, 543, 725, 2439, 6825, 1361, 2785, 5345, 5941, 234751}}, {19978, 18, 110183, {1, 1, 5, 5, 17, 55, 69, 9, 431, 585, 1049, 165, 1705, 14907, 8655, 12485, 22783, 91195}}, {19979, 18, 110184, {1, 1, 7, 11, 29, 41, 91, 137, 17, 785, 1151, 2033, 7031, 15077, 2241, 21453, 117947, 128891}}, {19980, 18, 110195, {1, 1, 1, 11, 17, 53, 113, 195, 409, 275, 1757, 245, 6263, 14785, 29159, 43827, 65027, 248403}}, {19981, 18, 110307, {1, 3, 3, 3, 5, 15, 23, 41, 261, 891, 1021, 1999, 4883, 9233, 10385, 21953, 50711, 4247}}, {19982, 18, 110334, {1, 1, 1, 13, 23, 47, 33, 77, 317, 251, 617, 2265, 7549, 327, 2317, 41209, 41063, 120863}}, {19983, 18, 110336, {1, 1, 7, 11, 15, 17, 25, 105, 253, 713, 1147, 415, 5777, 2215, 4207, 33857, 17001, 260533}}, {19984, 18, 110354, {1, 1, 1, 11, 31, 45, 3, 25, 329, 45, 1563, 121, 1413, 16229, 32485, 54477, 101025, 64847}}, {19985, 18, 110356, {1, 3, 5, 1, 15, 59, 113, 203, 481, 545, 371, 1357, 5549, 3043, 397, 61483, 59779, 58159}}, {19986, 18, 110390, {1, 3, 3, 3, 25, 39, 29, 193, 379, 293, 1173, 3389, 4231, 11519, 6681, 28813, 63609, 13029}}, {19987, 18, 110419, {1, 3, 1, 1, 27, 57, 37, 249, 441, 905, 463, 3543, 7203, 10075, 5373, 46103, 6685, 146943}}, {19988, 18, 110452, {1, 3, 5, 7, 31, 51, 21, 139, 209, 219, 1663, 837, 3351, 6291, 735, 8715, 33751, 199485}}, {19989, 18, 110461, {1, 3, 5, 11, 19, 57, 41, 163, 287, 327, 243, 2891, 1095, 3959, 5067, 2867, 16207, 213089}}, {19990, 18, 110465, {1, 1, 5, 11, 21, 59, 97, 239, 309, 371, 797, 453, 2595, 4277, 3771, 5665, 10075, 56101}}, {19991, 18, 110466, {1, 1, 3, 15, 17, 29, 103, 33, 449, 525, 961, 3551, 3611, 14057, 15971, 26981, 35169, 130213}}, {19992, 18, 110468, {1, 1, 3, 1, 5, 13, 39, 211, 387, 797, 1051, 3287, 3737, 12953, 3387, 35107, 78809, 162907}}, {19993, 18, 110486, {1, 1, 7, 9, 7, 63, 127, 115, 173, 981, 623, 737, 7625, 12245, 4195, 61873, 104301, 250333}}, {19994, 18, 110511, {1, 1, 1, 5, 19, 5, 123, 43, 209, 741, 747, 1057, 2683, 15359, 24121, 38413, 5823, 62213}}, {19995, 18, 110531, {1, 1, 7, 1, 23, 13, 63, 165, 309, 323, 247, 3827, 5451, 4823, 23925, 56957, 69765, 259923}}, {19996, 18, 110561, {1, 1, 5, 1, 5, 49, 51, 65, 31, 257, 1363, 3031, 5765, 3645, 16383, 6347, 30429, 130557}}, {19997, 18, 110573, {1, 3, 5, 13, 9, 63, 31, 3, 317, 379, 1345, 2161, 7787, 2055, 21507, 20347, 97021, 183377}}, {19998, 18, 110593, {1, 3, 5, 11, 15, 59, 13, 139, 415, 821, 639, 1249, 6349, 15861, 21377, 22813, 42839, 76595}}, {19999, 18, 110611, {1, 1, 7, 9, 23, 11, 25, 115, 393, 153, 1269, 871, 1323, 1891, 11619, 3103, 79813, 39811}}, {20000, 18, 110614, {1, 3, 1, 15, 27, 37, 63, 253, 1, 855, 1651, 3111, 6693, 1825, 22549, 64189, 18347, 253425}}, {20001, 18, 110651, {1, 3, 1, 11, 23, 27, 119, 59, 421, 343, 831, 2679, 5899, 12087, 15953, 18601, 109551, 33895}}, {20002, 18, 110661, {1, 3, 1, 13, 29, 3, 91, 227, 301, 491, 1045, 2105, 5189, 13717, 1095, 6039, 16229, 215687}}, {20003, 18, 110665, {1, 1, 7, 3, 11, 53, 85, 25, 23, 293, 841, 3569, 5335, 8949, 28665, 15139, 100807, 155587}}, {20004, 18, 110701, {1, 1, 1, 9, 31, 1, 77, 149, 181, 5, 915, 1155, 4717, 2837, 17545, 3235, 26811, 124901}}, {20005, 18, 110730, {1, 1, 3, 5, 25, 27, 47, 215, 425, 195, 1575, 3961, 3521, 4197, 9565, 32523, 125091, 165543}}, {20006, 18, 110735, {1, 3, 7, 3, 17, 57, 7, 137, 507, 303, 1123, 1511, 2465, 4277, 19959, 31951, 83157, 62843}}, {20007, 18, 110738, {1, 3, 3, 1, 27, 43, 79, 191, 265, 167, 665, 4017, 6613, 1175, 5427, 47139, 91517, 32071}}, {20008, 18, 110759, {1, 1, 1, 11, 29, 63, 9, 39, 303, 1021, 415, 2157, 5227, 13557, 4931, 12541, 74101, 13189}}, {20009, 18, 110763, {1, 1, 3, 9, 15, 41, 45, 163, 301, 315, 1433, 1449, 3589, 15783, 16069, 16155, 10527, 69335}}, {20010, 18, 110768, {1, 3, 1, 1, 1, 5, 75, 169, 215, 115, 939, 1285, 43, 1941, 27847, 5245, 51211, 244817}}, {20011, 18, 110774, {1, 1, 1, 15, 7, 33, 31, 23, 397, 537, 1415, 329, 6705, 15015, 18883, 62895, 21435, 233075}}, {20012, 18, 110783, {1, 3, 3, 5, 11, 49, 73, 147, 183, 317, 11, 1997, 1045, 6015, 29159, 55195, 105711, 134727}}, {20013, 18, 110785, {1, 3, 3, 9, 21, 41, 5, 213, 421, 539, 1269, 1929, 3701, 2165, 14997, 21933, 58167, 239719}}, {20014, 18, 110809, {1, 3, 1, 5, 23, 63, 37, 27, 21, 547, 1499, 1621, 141, 5309, 32257, 47241, 123617, 243853}}, {20015, 18, 110812, {1, 1, 1, 13, 31, 45, 47, 91, 165, 1007, 1295, 4035, 1461, 10423, 7747, 7329, 114599, 169375}}, {20016, 18, 110840, {1, 1, 5, 3, 21, 9, 75, 61, 35, 745, 31, 4085, 3645, 16239, 14979, 15725, 108859, 56745}}, {20017, 18, 110853, {1, 1, 5, 15, 11, 31, 13, 229, 417, 147, 1993, 4043, 7757, 13507, 15297, 56119, 2223, 142275}}, {20018, 18, 110905, {1, 3, 5, 13, 3, 57, 45, 109, 135, 829, 159, 769, 865, 2583, 15755, 44343, 84561, 98621}}, {20019, 18, 110933, {1, 1, 7, 11, 17, 11, 115, 45, 371, 411, 863, 2139, 3897, 13981, 16771, 4587, 25195, 66077}}, {20020, 18, 110961, {1, 3, 7, 15, 17, 47, 51, 133, 133, 475, 1363, 3325, 4287, 4837, 22077, 60225, 3097, 246805}}, {20021, 18, 110962, {1, 3, 5, 9, 29, 51, 127, 125, 353, 519, 129, 1409, 1497, 3167, 14163, 24921, 81343, 129835}}, {20022, 18, 110974, {1, 3, 5, 5, 19, 39, 95, 109, 229, 1015, 367, 2373, 709, 6169, 4089, 13533, 22399, 118977}}, {20023, 18, 110987, {1, 1, 5, 5, 17, 21, 91, 131, 309, 739, 1373, 3723, 6659, 1119, 27521, 55589, 34967, 70831}}, {20024, 18, 110989, {1, 3, 1, 11, 5, 7, 85, 215, 425, 947, 589, 375, 5943, 13399, 18307, 27007, 18919, 200617}}, {20025, 18, 111007, {1, 1, 3, 15, 11, 37, 111, 179, 259, 517, 1679, 225, 3493, 15025, 21751, 40687, 73001, 214477}}, {20026, 18, 111011, {1, 1, 7, 15, 17, 41, 109, 129, 427, 847, 1965, 3269, 5871, 12331, 26899, 49791, 103471, 213789}}, {20027, 18, 111043, {1, 3, 3, 3, 9, 41, 25, 115, 95, 737, 717, 1545, 841, 14923, 7409, 45365, 100139, 77787}}, {20028, 18, 111070, {1, 1, 3, 15, 11, 3, 63, 23, 425, 433, 537, 1599, 2691, 11271, 1695, 40579, 53507, 73033}}, {20029, 18, 111088, {1, 3, 7, 13, 9, 21, 85, 31, 337, 583, 1883, 3877, 7197, 7715, 21525, 53273, 11263, 41907}}, {20030, 18, 111127, {1, 3, 7, 1, 7, 53, 61, 45, 299, 885, 1391, 3109, 6851, 6079, 18857, 44537, 95713, 146125}}, {20031, 18, 111140, {1, 1, 1, 3, 21, 49, 95, 105, 419, 315, 365, 3035, 4169, 5723, 26921, 62809, 27019, 243965}}, {20032, 18, 111149, {1, 1, 3, 5, 11, 39, 71, 89, 249, 11, 1395, 105, 6637, 4577, 22979, 32405, 93163, 58785}}, {20033, 18, 111229, {1, 1, 1, 1, 27, 25, 125, 85, 495, 697, 1793, 301, 7665, 12671, 25359, 38803, 58723, 189837}}, {20034, 18, 111230, {1, 3, 5, 11, 17, 11, 61, 211, 19, 901, 1701, 223, 2195, 15571, 3529, 34699, 94607, 196519}}, {20035, 18, 111243, {1, 3, 7, 11, 15, 1, 111, 1, 381, 145, 293, 3639, 6931, 13195, 19985, 58491, 53067, 184411}}, {20036, 18, 111267, {1, 3, 1, 15, 31, 39, 39, 101, 17, 431, 1151, 2465, 727, 12709, 5377, 5857, 49707, 76439}}, {20037, 18, 111287, {1, 3, 3, 5, 7, 1, 3, 39, 357, 339, 415, 567, 7245, 13943, 7495, 54133, 119705, 160615}}, {20038, 18, 111313, {1, 3, 5, 15, 9, 17, 13, 253, 337, 673, 1745, 2613, 4635, 14025, 11159, 50001, 40753, 172983}}, {20039, 18, 111356, {1, 3, 7, 11, 3, 15, 19, 107, 393, 1015, 1441, 181, 5721, 9987, 15557, 37263, 90053, 205685}}, {20040, 18, 111368, {1, 1, 5, 1, 9, 3, 69, 123, 245, 111, 283, 1581, 259, 275, 813, 12213, 19639, 7335}}, {20041, 18, 111409, {1, 3, 7, 7, 1, 55, 101, 63, 259, 705, 653, 3821, 2081, 6447, 25471, 15523, 38827, 68055}}, {20042, 18, 111419, {1, 1, 5, 7, 27, 9, 97, 149, 445, 341, 167, 3695, 375, 853, 8143, 36027, 62729, 197357}}, {20043, 18, 111430, {1, 3, 7, 1, 1, 37, 97, 103, 493, 319, 1287, 3787, 4079, 13049, 14305, 6665, 4631, 96225}}, {20044, 18, 111433, {1, 1, 5, 7, 1, 5, 127, 143, 251, 725, 1759, 2381, 181, 15741, 9395, 64441, 44347, 221697}}, {20045, 18, 111442, {1, 3, 1, 3, 25, 47, 29, 167, 397, 827, 1255, 3271, 6307, 13915, 3131, 19123, 88619, 62847}}, {20046, 18, 111467, {1, 3, 5, 1, 29, 11, 59, 203, 245, 553, 617, 1287, 205, 2291, 3613, 39933, 116981, 43595}}, {20047, 18, 111491, {1, 1, 3, 9, 27, 33, 35, 77, 437, 1003, 119, 253, 6643, 113, 10587, 41073, 55371, 233307}}, {20048, 18, 111503, {1, 3, 7, 1, 29, 63, 1, 231, 373, 995, 1063, 1385, 273, 14115, 6899, 62991, 112003, 80527}}, {20049, 18, 111527, {1, 3, 3, 1, 31, 21, 55, 115, 393, 685, 245, 1587, 5617, 267, 19639, 15169, 14073, 173091}}, {20050, 18, 111531, {1, 3, 1, 11, 29, 45, 53, 21, 433, 979, 1067, 2999, 6279, 4739, 30835, 61653, 112893, 75839}}, {20051, 18, 111541, {1, 1, 5, 11, 23, 25, 15, 107, 325, 981, 1057, 1181, 4465, 16291, 1523, 64497, 129437, 45067}}, {20052, 18, 111546, {1, 1, 1, 5, 1, 21, 79, 135, 419, 997, 1967, 747, 2097, 15397, 4415, 15807, 79583, 259561}}, {20053, 18, 111548, {1, 3, 1, 7, 5, 49, 105, 109, 243, 371, 13, 2297, 2845, 12569, 13165, 13551, 75471, 168579}}, {20054, 18, 111577, {1, 1, 1, 1, 9, 33, 7, 233, 43, 773, 1121, 3763, 4047, 15039, 8165, 25407, 82561, 215045}}, {20055, 18, 111625, {1, 3, 7, 1, 17, 41, 105, 129, 333, 687, 1357, 1197, 1271, 3835, 15823, 36777, 94311, 192321}}, {20056, 18, 111636, {1, 1, 5, 15, 13, 31, 93, 249, 81, 167, 1681, 1587, 179, 5755, 27741, 29437, 100407, 63287}}, {20057, 18, 111650, {1, 3, 3, 13, 11, 39, 85, 23, 37, 183, 547, 1255, 1167, 15961, 23281, 59989, 99393, 34983}}, {20058, 18, 111655, {1, 3, 7, 5, 13, 33, 17, 243, 321, 845, 447, 1997, 4639, 11175, 24651, 18281, 82677, 244543}}, {20059, 18, 111662, {1, 3, 5, 13, 3, 63, 75, 35, 493, 207, 1707, 1401, 3687, 11353, 5461, 23433, 71259, 93483}}, {20060, 18, 111673, {1, 1, 3, 1, 19, 61, 81, 133, 115, 957, 669, 647, 347, 8739, 18451, 39641, 118677, 136601}}, {20061, 18, 111699, {1, 1, 7, 13, 3, 13, 119, 187, 111, 181, 1865, 1613, 201, 3633, 17805, 46553, 8899, 100407}}, {20062, 18, 111727, {1, 3, 3, 9, 19, 33, 35, 215, 235, 893, 877, 3099, 7597, 13521, 22473, 65435, 3205, 44897}}, {20063, 18, 111729, {1, 3, 3, 11, 27, 3, 101, 201, 215, 373, 859, 1435, 2637, 6795, 21157, 3333, 27797, 199427}}, {20064, 18, 111741, {1, 1, 7, 13, 31, 33, 85, 205, 273, 565, 2033, 3451, 7581, 16223, 1383, 16297, 1263, 49065}}, {20065, 18, 111757, {1, 1, 1, 13, 11, 29, 65, 71, 395, 179, 1193, 3859, 3075, 10133, 6463, 34617, 20173, 203471}}, {20066, 18, 111781, {1, 1, 7, 3, 7, 29, 11, 115, 465, 695, 1759, 3137, 6337, 977, 43, 62501, 13297, 59319}}, {20067, 18, 111791, {1, 3, 5, 9, 31, 59, 11, 107, 109, 797, 177, 2891, 2535, 4305, 19255, 9591, 84417, 87381}}, {20068, 18, 111826, {1, 3, 3, 3, 1, 9, 45, 219, 73, 573, 1477, 3699, 8145, 835, 7123, 37167, 53411, 45397}}, {20069, 18, 111838, {1, 3, 5, 15, 15, 41, 37, 63, 233, 971, 1497, 1223, 3909, 11721, 9217, 41055, 9779, 199339}}, {20070, 18, 111854, {1, 3, 3, 7, 17, 61, 91, 237, 313, 841, 7, 3283, 4049, 10403, 22157, 4889, 31903, 188043}}, {20071, 18, 111861, {1, 3, 7, 1, 25, 3, 59, 87, 191, 725, 1615, 4057, 3037, 14597, 17371, 42221, 73919, 58009}}, {20072, 18, 111866, {1, 3, 5, 11, 27, 7, 45, 231, 315, 727, 843, 2191, 7909, 53, 23309, 55189, 96193, 174017}}, {20073, 18, 111868, {1, 3, 5, 11, 27, 51, 127, 187, 209, 883, 429, 137, 4585, 15195, 16527, 32571, 30905, 8137}}, {20074, 18, 111897, {1, 1, 1, 11, 15, 55, 13, 161, 183, 671, 659, 3669, 4461, 13691, 17119, 26877, 52041, 110103}}, {20075, 18, 111903, {1, 3, 5, 9, 5, 45, 29, 19, 415, 931, 683, 2987, 3839, 4529, 3091, 54457, 115537, 102671}}, {20076, 18, 111904, {1, 1, 7, 13, 23, 31, 61, 17, 327, 951, 1333, 713, 4309, 1955, 22797, 27007, 106673, 47177}}, {20077, 18, 111959, {1, 3, 3, 9, 31, 49, 19, 115, 413, 257, 1799, 3641, 2075, 15613, 14293, 16123, 45131, 209389}}, {20078, 18, 111975, {1, 1, 7, 15, 1, 15, 27, 63, 463, 825, 1081, 991, 2641, 5999, 8551, 41119, 80251, 189263}}, {20079, 18, 112018, {1, 1, 5, 9, 7, 55, 125, 97, 245, 997, 457, 1087, 1297, 3433, 14887, 24117, 30689, 184809}}, {20080, 18, 112023, {1, 3, 1, 9, 23, 59, 81, 233, 341, 943, 1335, 2819, 2625, 4957, 14925, 7917, 107383, 204493}}, {20081, 18, 112033, {1, 3, 5, 5, 5, 25, 79, 29, 191, 541, 1295, 269, 613, 5201, 28639, 52839, 52865, 75181}}, {20082, 18, 112036, {1, 3, 3, 7, 19, 45, 35, 201, 391, 317, 1323, 2733, 3407, 10273, 32689, 52153, 108751, 242493}}, {20083, 18, 112043, {1, 3, 1, 7, 15, 27, 45, 21, 383, 483, 1857, 3443, 2263, 11471, 3697, 63929, 116399, 229733}}, {20084, 18, 112095, {1, 1, 3, 9, 13, 27, 19, 37, 181, 811, 1833, 177, 7689, 10073, 20229, 31397, 65415, 68461}}, {20085, 18, 112113, {1, 1, 1, 15, 19, 53, 65, 209, 433, 783, 1647, 4075, 3155, 733, 25603, 39033, 43109, 151257}}, {20086, 18, 112136, {1, 3, 3, 5, 9, 37, 61, 75, 497, 825, 1785, 3709, 1731, 889, 19325, 57453, 39095, 190855}}, {20087, 18, 112153, {1, 3, 3, 13, 3, 53, 21, 39, 483, 833, 1191, 2829, 1323, 1877, 17257, 36077, 47997, 25349}}, {20088, 18, 112165, {1, 1, 7, 9, 29, 25, 7, 91, 87, 723, 777, 1865, 7763, 10995, 15953, 36111, 21313, 214417}}, {20089, 18, 112166, {1, 3, 5, 3, 17, 15, 85, 133, 245, 317, 879, 3237, 7049, 6501, 13359, 34063, 124703, 118289}}, {20090, 18, 112177, {1, 1, 1, 7, 11, 25, 111, 143, 369, 593, 237, 2787, 1015, 13059, 23275, 38453, 90809, 25803}}, {20091, 18, 112189, {1, 1, 7, 5, 13, 21, 39, 235, 381, 381, 949, 773, 1123, 9911, 18115, 47657, 47849, 197633}}, {20092, 18, 112226, {1, 1, 3, 13, 15, 57, 47, 203, 483, 341, 137, 1283, 2847, 5051, 22593, 60915, 45123, 258733}}, {20093, 18, 112237, {1, 1, 3, 5, 29, 7, 23, 127, 493, 543, 747, 3547, 4433, 5847, 28999, 18079, 81205, 231557}}, {20094, 18, 112240, {1, 1, 3, 15, 9, 63, 17, 197, 75, 387, 1679, 2631, 1033, 2757, 18365, 11957, 98915, 24223}}, {20095, 18, 112255, {1, 1, 3, 9, 27, 55, 67, 97, 345, 995, 1151, 1747, 4889, 13847, 13237, 9035, 13461, 10377}}, {20096, 18, 112265, {1, 1, 5, 9, 27, 13, 7, 77, 399, 191, 137, 2801, 6379, 15969, 1727, 27503, 97385, 147625}}, {20097, 18, 112280, {1, 3, 1, 7, 5, 9, 103, 163, 489, 615, 1359, 2635, 3115, 13795, 18853, 65225, 26545, 212065}}, {20098, 18, 112292, {1, 3, 7, 3, 13, 25, 125, 133, 359, 423, 751, 4045, 1209, 7521, 6653, 39171, 125083, 229399}}, {20099, 18, 112307, {1, 3, 1, 9, 15, 21, 121, 223, 283, 313, 1807, 3829, 5279, 10609, 20113, 7851, 23731, 245327}}, {20100, 18, 112316, {1, 1, 1, 11, 15, 13, 63, 253, 311, 369, 1549, 2803, 2029, 14967, 14217, 1387, 104669, 63375}}, {20101, 18, 112342, {1, 1, 3, 3, 31, 49, 59, 189, 249, 779, 275, 3761, 3465, 2205, 11543, 16973, 126249, 104769}}, {20102, 18, 112345, {1, 3, 1, 5, 11, 39, 59, 33, 121, 151, 467, 1011, 1379, 13955, 20117, 52537, 51049, 50663}}, {20103, 18, 112351, {1, 1, 1, 7, 5, 41, 121, 29, 357, 33, 849, 2441, 2127, 1337, 21147, 63869, 80215, 31211}}, {20104, 18, 112361, {1, 3, 3, 3, 25, 41, 17, 101, 173, 915, 463, 2391, 1671, 8789, 13357, 42127, 17599, 61087}}, {20105, 18, 112364, {1, 1, 3, 9, 29, 23, 47, 211, 435, 223, 1421, 2463, 4543, 8569, 30209, 46621, 14367, 13263}}, {20106, 18, 112372, {1, 3, 7, 7, 5, 9, 75, 209, 299, 81, 1705, 2335, 6703, 6309, 5859, 57889, 43219, 7667}}, {20107, 18, 112382, {1, 3, 3, 3, 19, 31, 107, 87, 413, 111, 215, 2711, 7053, 5223, 25241, 26675, 16067, 122719}}, {20108, 18, 112389, {1, 1, 1, 15, 21, 3, 15, 13, 281, 63, 725, 2025, 4813, 14177, 18577, 875, 118623, 192005}}, {20109, 18, 112408, {1, 3, 5, 9, 17, 21, 85, 173, 59, 153, 763, 3899, 1985, 2071, 10439, 44911, 60915, 122419}}, {20110, 18, 112417, {1, 3, 7, 13, 11, 63, 59, 95, 53, 927, 555, 1897, 5195, 13469, 16973, 3463, 125173, 256021}}, {20111, 18, 112423, {1, 1, 3, 7, 9, 63, 33, 193, 61, 445, 1247, 1379, 4701, 5311, 30709, 16795, 69871, 161113}}, {20112, 18, 112476, {1, 3, 1, 3, 21, 25, 125, 111, 109, 75, 455, 861, 6483, 4501, 19095, 45601, 78415, 30995}}, {20113, 18, 112480, {1, 1, 3, 5, 1, 25, 15, 25, 223, 961, 537, 1453, 4951, 5085, 19801, 9863, 108819, 7319}}, {20114, 18, 112483, {1, 3, 1, 5, 29, 21, 79, 113, 177, 691, 219, 3159, 3493, 25, 30655, 46257, 23707, 243377}}, {20115, 18, 112513, {1, 1, 3, 3, 27, 21, 11, 95, 43, 161, 2029, 4091, 6695, 7179, 9955, 45195, 32017, 128605}}, {20116, 18, 112538, {1, 1, 7, 5, 19, 37, 47, 83, 169, 143, 773, 2127, 347, 1887, 2861, 8155, 21437, 175641}}, {20117, 18, 112543, {1, 3, 1, 1, 27, 63, 119, 57, 77, 931, 629, 1807, 4469, 2315, 3767, 19207, 114581, 125135}}, {20118, 18, 112574, {1, 1, 5, 11, 13, 51, 51, 239, 333, 369, 1035, 3017, 103, 1809, 14579, 34425, 123915, 258397}}, {20119, 18, 112599, {1, 1, 1, 3, 3, 19, 63, 237, 141, 929, 943, 2597, 3983, 1043, 24269, 12325, 39013, 216689}}, {20120, 18, 112605, {1, 1, 3, 7, 9, 61, 73, 31, 287, 303, 1415, 3453, 2667, 8625, 14347, 51953, 9181, 251937}}, {20121, 18, 112667, {1, 1, 7, 1, 15, 41, 1, 197, 87, 311, 1147, 3799, 2585, 14027, 491, 54203, 124861, 227637}}, {20122, 18, 112688, {1, 3, 7, 3, 15, 35, 97, 89, 65, 493, 1897, 3345, 3807, 5911, 12461, 21393, 116975, 212801}}, {20123, 18, 112735, {1, 1, 7, 11, 29, 47, 61, 171, 399, 929, 93, 2815, 4933, 9209, 15053, 21911, 117217, 52539}}, {20124, 18, 112746, {1, 3, 1, 1, 19, 25, 11, 41, 73, 317, 215, 923, 5153, 8025, 18703, 11513, 107981, 2027}}, {20125, 18, 112810, {1, 1, 5, 7, 27, 33, 47, 99, 171, 259, 2017, 2055, 909, 4185, 26689, 23155, 109857, 213957}}, {20126, 18, 112817, {1, 3, 7, 3, 31, 17, 39, 203, 255, 345, 1461, 1561, 4349, 6451, 14763, 32993, 74475, 140557}}, {20127, 18, 112827, {1, 1, 5, 3, 21, 57, 75, 201, 371, 529, 1471, 243, 3751, 581, 18405, 40933, 106311, 745}}, {20128, 18, 112835, {1, 1, 3, 13, 7, 53, 125, 15, 55, 267, 1865, 3297, 4331, 2913, 21675, 58911, 28419, 105585}}, {20129, 18, 112892, {1, 3, 5, 13, 7, 13, 37, 37, 207, 127, 785, 1129, 8123, 7655, 16003, 18907, 48883, 2001}}, {20130, 18, 112898, {1, 1, 5, 3, 11, 3, 127, 149, 503, 1019, 887, 3429, 7775, 7113, 19571, 34461, 38889, 66981}}, {20131, 18, 112915, {1, 3, 7, 7, 1, 55, 87, 217, 465, 485, 411, 2955, 4899, 1741, 7051, 42885, 1837, 68175}}, {20132, 18, 112918, {1, 1, 7, 1, 7, 39, 25, 1, 185, 523, 273, 2409, 1867, 3101, 29823, 4509, 81621, 11815}}, {20133, 18, 112937, {1, 1, 1, 11, 13, 11, 89, 237, 355, 347, 91, 1791, 5745, 4181, 29207, 39495, 5275, 199395}}, {20134, 18, 112940, {1, 1, 7, 3, 17, 37, 109, 169, 191, 295, 1001, 2631, 1981, 11821, 8315, 40675, 1293, 220247}}, {20135, 18, 112958, {1, 3, 1, 7, 31, 25, 5, 55, 1, 795, 1663, 3177, 6821, 2073, 25789, 23691, 25015, 75203}}, {20136, 18, 113013, {1, 3, 5, 9, 19, 9, 97, 129, 351, 735, 1897, 3555, 1731, 5413, 32051, 12869, 111973, 100157}}, {20137, 18, 113014, {1, 3, 3, 15, 27, 1, 3, 167, 7, 851, 805, 713, 6389, 1455, 32371, 7617, 107157, 131299}}, {20138, 18, 113027, {1, 3, 1, 13, 31, 29, 91, 123, 387, 939, 223, 3583, 2889, 5307, 16561, 6055, 4437, 123229}}, {20139, 18, 113048, {1, 3, 5, 11, 27, 17, 5, 145, 369, 449, 1677, 1039, 3553, 3057, 11667, 51879, 20519, 41573}}, {20140, 18, 113051, {1, 3, 1, 9, 9, 1, 91, 33, 379, 35, 691, 375, 5937, 15019, 16177, 53457, 52015, 232257}}, {20141, 18, 113053, {1, 1, 3, 11, 23, 17, 75, 217, 377, 571, 1725, 2719, 3911, 12277, 27799, 55573, 21981, 112529}}, {20142, 18, 113102, {1, 3, 1, 11, 9, 37, 81, 95, 501, 615, 327, 3751, 7333, 15407, 7785, 29113, 116335, 221853}}, {20143, 18, 113104, {1, 1, 1, 3, 17, 1, 125, 157, 461, 845, 93, 107, 4429, 2271, 14445, 32919, 81175, 244557}}, {20144, 18, 113114, {1, 3, 3, 1, 27, 23, 33, 15, 29, 361, 409, 981, 7819, 10259, 21971, 23317, 66641, 54591}}, {20145, 18, 113130, {1, 3, 7, 13, 31, 63, 11, 167, 511, 81, 1165, 3973, 4275, 3315, 10227, 34973, 58505, 2333}}, {20146, 18, 113159, {1, 3, 1, 9, 3, 49, 111, 101, 41, 775, 449, 1349, 4411, 8691, 535, 60137, 3269, 204895}}, {20147, 18, 113180, {1, 3, 7, 15, 7, 43, 39, 147, 309, 185, 733, 1473, 5467, 6183, 17971, 56805, 111931, 163515}}, {20148, 18, 113189, {1, 3, 1, 3, 21, 31, 17, 129, 317, 587, 801, 2517, 2569, 765, 20869, 16461, 34425, 101123}}, {20149, 18, 113211, {1, 3, 1, 7, 13, 63, 117, 31, 25, 741, 365, 687, 6195, 2093, 14679, 16861, 123381, 25263}}, {20150, 18, 113245, {1, 1, 1, 3, 13, 59, 65, 131, 41, 39, 1659, 1491, 225, 10277, 12445, 4161, 92119, 146705}}, {20151, 18, 113261, {1, 3, 5, 1, 31, 11, 21, 203, 345, 473, 1643, 1377, 555, 11675, 15383, 30855, 41249, 231059}}, {20152, 18, 113273, {1, 1, 7, 15, 3, 23, 33, 133, 433, 407, 1217, 3345, 7455, 11489, 21463, 41621, 95755, 86971}}, {20153, 18, 113292, {1, 1, 1, 3, 13, 47, 45, 181, 489, 89, 427, 1915, 3993, 10133, 20437, 31811, 48421, 150009}}, {20154, 18, 113314, {1, 3, 1, 9, 9, 25, 89, 195, 503, 755, 59, 1869, 6645, 13841, 22973, 17761, 46759, 68717}}, {20155, 18, 113319, {1, 3, 1, 1, 19, 21, 119, 123, 481, 289, 1009, 3769, 3909, 1123, 17875, 17383, 71533, 45455}}, {20156, 18, 113323, {1, 1, 1, 3, 31, 33, 127, 43, 467, 749, 377, 3025, 511, 13335, 23987, 63627, 50211, 197253}}, {20157, 18, 113326, {1, 1, 5, 13, 29, 7, 101, 43, 299, 769, 1637, 3731, 1945, 9933, 22263, 1523, 127557, 116867}}, {20158, 18, 113337, {1, 1, 3, 11, 1, 59, 25, 45, 275, 535, 1349, 3625, 8125, 727, 1215, 15487, 86229, 124817}}, {20159, 18, 113338, {1, 3, 3, 13, 3, 11, 25, 237, 213, 331, 395, 1775, 1225, 6859, 16577, 39105, 118081, 74727}}, {20160, 18, 113355, {1, 1, 1, 9, 5, 27, 117, 75, 479, 757, 1299, 2273, 3221, 5297, 249, 60327, 48739, 107023}}, {20161, 18, 113365, {1, 1, 5, 9, 27, 9, 123, 49, 63, 763, 121, 3955, 2069, 5999, 25973, 64661, 6321, 1179}}, {20162, 18, 113376, {1, 3, 7, 11, 9, 51, 65, 93, 51, 51, 829, 3239, 7431, 3489, 7691, 38777, 28151, 96635}}, {20163, 18, 113408, {1, 3, 3, 13, 15, 51, 13, 203, 49, 73, 363, 2173, 7771, 11527, 27683, 39333, 2083, 178623}}, {20164, 18, 113462, {1, 1, 5, 5, 15, 27, 27, 127, 503, 955, 427, 3061, 6213, 917, 889, 12601, 72445, 105383}}, {20165, 18, 113476, {1, 3, 5, 3, 27, 43, 105, 187, 309, 747, 1843, 723, 539, 8829, 19171, 46009, 26129, 173145}}, {20166, 18, 113503, {1, 3, 7, 7, 9, 51, 121, 139, 107, 453, 1103, 2957, 633, 1435, 27275, 53231, 51393, 16847}}, {20167, 18, 113550, {1, 3, 7, 5, 25, 31, 71, 191, 169, 69, 1477, 1413, 7659, 11737, 12365, 25067, 21787, 16225}}, {20168, 18, 113578, {1, 1, 7, 1, 9, 33, 37, 123, 391, 341, 829, 1543, 7323, 14695, 16431, 20009, 95821, 182791}}, {20169, 18, 113580, {1, 3, 1, 5, 9, 59, 109, 39, 301, 977, 1963, 177, 8107, 16193, 5691, 14157, 71605, 250839}}, {20170, 18, 113634, {1, 3, 5, 9, 29, 33, 33, 153, 7, 217, 201, 563, 6577, 9605, 16671, 63949, 97937, 234309}}, {20171, 18, 113653, {1, 3, 7, 3, 25, 11, 81, 89, 275, 801, 477, 1921, 2279, 1651, 13333, 9127, 99693, 83141}}, {20172, 18, 113677, {1, 3, 7, 5, 23, 51, 23, 51, 447, 689, 387, 1845, 6033, 2037, 20139, 33165, 56111, 243353}}, {20173, 18, 113713, {1, 3, 5, 7, 5, 7, 105, 121, 439, 471, 721, 85, 1627, 3735, 29611, 15537, 36131, 30225}}, {20174, 18, 113751, {1, 1, 5, 5, 7, 29, 31, 209, 183, 217, 467, 1287, 6145, 14737, 16249, 8857, 101405, 103355}}, {20175, 18, 113771, {1, 3, 3, 5, 19, 1, 43, 15, 239, 63, 617, 2189, 3841, 1223, 12217, 4121, 88047, 14069}}, {20176, 18, 113781, {1, 3, 7, 1, 9, 49, 11, 65, 297, 943, 1739, 3797, 6169, 2057, 5031, 2149, 21439, 141039}}, {20177, 18, 113797, {1, 1, 1, 7, 15, 59, 35, 203, 347, 529, 1741, 1003, 6143, 4979, 15495, 48447, 2139, 187025}}, {20178, 18, 113846, {1, 1, 7, 13, 15, 17, 77, 225, 461, 691, 1067, 1133, 6555, 511, 25845, 39835, 11755, 142743}}, {20179, 18, 113849, {1, 3, 3, 11, 27, 25, 49, 51, 335, 1, 381, 2703, 7023, 14739, 19335, 39625, 82255, 76277}}, {20180, 18, 113855, {1, 3, 3, 7, 19, 3, 35, 95, 203, 991, 515, 2245, 6085, 4129, 9581, 38309, 114203, 136021}}, {20181, 18, 113878, {1, 1, 7, 7, 21, 61, 31, 57, 459, 119, 523, 1293, 3647, 735, 28849, 15581, 123943, 210069}}, {20182, 18, 113884, {1, 1, 7, 3, 9, 55, 103, 23, 401, 109, 23, 4083, 6179, 12817, 2787, 43337, 53647, 241507}}, {20183, 18, 113926, {1, 1, 5, 7, 9, 51, 37, 133, 97, 933, 1509, 2229, 1769, 12901, 15439, 25687, 128823, 72451}}, {20184, 18, 113938, {1, 3, 1, 13, 17, 19, 7, 109, 299, 799, 621, 3393, 3645, 283, 29889, 63215, 97805, 45795}}, {20185, 18, 113956, {1, 3, 1, 15, 21, 7, 65, 237, 221, 433, 1611, 2591, 3639, 3231, 6025, 53465, 88091, 17657}}, {20186, 18, 113980, {1, 1, 7, 9, 27, 13, 11, 185, 381, 43, 961, 2743, 2691, 10531, 3713, 61757, 124011, 209323}}, {20187, 18, 113986, {1, 3, 5, 1, 13, 7, 109, 65, 359, 577, 2001, 3085, 3519, 8577, 19299, 40145, 37159, 82421}}, {20188, 18, 113991, {1, 1, 3, 11, 7, 5, 21, 215, 391, 317, 879, 1835, 611, 7189, 3887, 45383, 41025, 175701}}, {20189, 18, 114005, {1, 1, 1, 1, 5, 17, 69, 115, 481, 477, 2017, 583, 8033, 11349, 16625, 213, 88033, 31707}}, {20190, 18, 114022, {1, 1, 7, 15, 19, 55, 121, 35, 1, 71, 1011, 3247, 4133, 1681, 29943, 30149, 96797, 177707}}, {20191, 18, 114036, {1, 3, 5, 13, 11, 45, 83, 153, 455, 223, 787, 2025, 5271, 229, 17549, 5775, 75311, 134523}}, {20192, 18, 114046, {1, 3, 5, 7, 21, 43, 3, 253, 395, 651, 1111, 1685, 539, 6555, 25761, 39477, 15823, 261825}}, {20193, 18, 114050, {1, 3, 7, 15, 27, 35, 43, 191, 269, 247, 883, 887, 1505, 7433, 6239, 5421, 49583, 17765}}, {20194, 18, 114061, {1, 1, 5, 15, 7, 19, 113, 177, 63, 119, 517, 3987, 971, 12071, 13107, 28913, 85675, 204921}}, {20195, 18, 114067, {1, 3, 7, 15, 31, 47, 21, 129, 31, 505, 661, 855, 6135, 13063, 27971, 63801, 27469, 75373}}, {20196, 18, 114117, {1, 1, 7, 5, 13, 23, 111, 85, 279, 969, 483, 831, 483, 9065, 10997, 59031, 5083, 150939}}, {20197, 18, 114142, {1, 3, 5, 7, 17, 55, 11, 223, 189, 209, 139, 577, 5443, 913, 19085, 53113, 8427, 11251}}, {20198, 18, 114158, {1, 1, 1, 7, 23, 61, 95, 213, 443, 803, 1545, 3625, 2195, 2649, 10913, 14339, 23001, 16735}}, {20199, 18, 114165, {1, 3, 3, 3, 13, 45, 15, 225, 419, 445, 527, 635, 2279, 5097, 25267, 199, 66187, 156717}}, {20200, 18, 114200, {1, 1, 1, 7, 23, 17, 113, 245, 99, 159, 919, 2961, 1731, 6241, 12749, 8925, 44153, 243249}}, {20201, 18, 114219, {1, 3, 1, 3, 29, 57, 43, 245, 389, 233, 135, 45, 3771, 14061, 10173, 51939, 128985, 81605}}, {20202, 18, 114254, {1, 1, 1, 15, 1, 19, 25, 111, 91, 193, 1185, 3679, 7155, 7077, 13743, 35631, 128975, 196979}}, {20203, 18, 114265, {1, 3, 3, 13, 31, 57, 25, 53, 149, 331, 643, 915, 1607, 14429, 29803, 23459, 72915, 39253}}, {20204, 18, 114272, {1, 3, 3, 9, 23, 45, 9, 29, 383, 277, 981, 1647, 5217, 4449, 26759, 63849, 98081, 37565}}, {20205, 18, 114312, {1, 1, 1, 15, 3, 23, 9, 121, 231, 27, 1961, 2389, 1689, 7041, 8069, 37973, 74601, 15553}}, {20206, 18, 114318, {1, 1, 5, 15, 15, 29, 11, 177, 355, 47, 1821, 393, 3383, 10439, 6357, 41119, 60323, 206253}}, {20207, 18, 114348, {1, 1, 1, 1, 21, 29, 87, 149, 157, 979, 1867, 729, 1949, 4409, 27495, 6841, 89033, 214957}}, {20208, 18, 114377, {1, 1, 3, 3, 9, 7, 115, 129, 141, 157, 881, 109, 5537, 303, 32549, 1953, 9903, 82401}}, {20209, 18, 114383, {1, 1, 5, 15, 9, 19, 93, 53, 319, 913, 1341, 705, 4639, 16189, 11375, 39155, 81393, 115843}}, {20210, 18, 114386, {1, 1, 5, 7, 31, 21, 3, 47, 437, 799, 359, 3291, 3917, 12983, 19283, 23769, 34033, 226041}}, {20211, 18, 114431, {1, 3, 7, 7, 27, 13, 65, 31, 181, 511, 1373, 3871, 1537, 6015, 12103, 42187, 121043, 95715}}, {20212, 18, 114448, {1, 1, 5, 11, 1, 55, 91, 11, 105, 137, 1787, 81, 5163, 5793, 17403, 59433, 113439, 65751}}, {20213, 18, 114479, {1, 1, 3, 13, 21, 57, 87, 157, 379, 5, 285, 3217, 4557, 3359, 28953, 63397, 110537, 230571}}, {20214, 18, 114487, {1, 3, 7, 7, 7, 27, 25, 109, 125, 337, 719, 561, 5903, 12913, 6987, 17157, 50655, 195109}}, {20215, 18, 114513, {1, 3, 3, 15, 3, 11, 97, 93, 441, 19, 1435, 515, 6129, 5177, 28075, 53495, 107817, 78399}}, {20216, 18, 114542, {1, 3, 1, 9, 13, 7, 89, 171, 165, 479, 223, 4001, 691, 4033, 13577, 33363, 63447, 46609}}, {20217, 18, 114572, {1, 3, 7, 1, 15, 47, 103, 45, 209, 639, 1465, 2795, 6025, 7981, 29491, 47743, 12861, 222445}}, {20218, 18, 114584, {1, 3, 3, 3, 1, 25, 121, 91, 253, 969, 1259, 1409, 1329, 15995, 17733, 24081, 101747, 120619}}, {20219, 18, 114600, {1, 3, 7, 11, 11, 5, 7, 241, 469, 411, 1733, 1385, 7005, 10977, 23369, 10675, 90341, 93077}}, {20220, 18, 114605, {1, 3, 3, 13, 17, 35, 107, 189, 437, 801, 1761, 3133, 3847, 14079, 22465, 45957, 38449, 54273}}, {20221, 18, 114623, {1, 1, 7, 9, 9, 47, 55, 107, 491, 281, 777, 2187, 6179, 6607, 2151, 9093, 42873, 104677}}, {20222, 18, 114628, {1, 1, 5, 3, 25, 3, 37, 55, 339, 619, 1227, 3859, 5593, 9639, 31199, 48155, 80779, 6497}}, {20223, 18, 114640, {1, 1, 7, 1, 21, 49, 105, 45, 119, 635, 163, 3821, 3689, 11395, 19265, 14289, 89259, 167433}}, {20224, 18, 114650, {1, 3, 3, 15, 29, 23, 11, 255, 425, 443, 1659, 3965, 4791, 10223, 11113, 48751, 7987, 166605}}, {20225, 18, 114668, {1, 1, 7, 3, 7, 1, 113, 153, 233, 803, 539, 297, 4847, 11203, 29393, 54319, 94373, 173471}}, {20226, 18, 114671, {1, 3, 3, 5, 27, 57, 23, 147, 423, 617, 103, 3369, 4825, 13613, 23635, 61977, 5331, 115243}}, {20227, 18, 114674, {1, 3, 3, 9, 11, 47, 41, 27, 345, 657, 1873, 365, 1685, 11181, 31977, 60489, 98741, 215357}}, {20228, 18, 114700, {1, 3, 1, 11, 19, 33, 39, 223, 151, 921, 309, 3413, 6735, 11971, 25583, 6927, 54821, 125203}}, {20229, 18, 114731, {1, 1, 5, 1, 27, 31, 61, 247, 207, 895, 1453, 3613, 7097, 6537, 29407, 9903, 39937, 98285}}, {20230, 18, 114748, {1, 3, 1, 5, 7, 11, 119, 7, 323, 27, 1069, 2033, 7387, 3381, 19007, 49039, 39453, 115411}}, {20231, 18, 114759, {1, 1, 7, 3, 9, 15, 51, 139, 353, 857, 1829, 3955, 7669, 3961, 22805, 39879, 26677, 66865}}, {20232, 18, 114766, {1, 3, 5, 7, 1, 11, 59, 95, 181, 645, 829, 3119, 3607, 5973, 12381, 41577, 79443, 226945}}, {20233, 18, 114768, {1, 3, 3, 5, 3, 13, 91, 119, 103, 889, 703, 3005, 541, 7529, 12613, 14267, 70445, 217543}}, {20234, 18, 114784, {1, 1, 5, 7, 17, 41, 5, 225, 85, 759, 1071, 2055, 1655, 14811, 25635, 50803, 58545, 105687}}, {20235, 18, 114808, {1, 3, 5, 13, 3, 7, 77, 209, 139, 717, 985, 1085, 831, 11011, 27313, 46423, 29435, 207359}}, {20236, 18, 114813, {1, 3, 1, 7, 27, 45, 39, 75, 311, 937, 1593, 1357, 4815, 1997, 1045, 48681, 49301, 155607}}, {20237, 18, 114829, {1, 3, 5, 11, 21, 9, 111, 39, 447, 241, 1613, 1799, 4817, 1861, 1263, 63641, 92081, 252051}}, {20238, 18, 114830, {1, 1, 1, 13, 31, 13, 39, 29, 349, 25, 1227, 2457, 3831, 7965, 16903, 25825, 62381, 101765}}, {20239, 18, 114842, {1, 1, 3, 7, 15, 17, 5, 29, 83, 607, 931, 261, 1087, 16247, 10129, 7813, 5445, 167723}}, {20240, 18, 114875, {1, 3, 5, 9, 15, 31, 69, 191, 139, 467, 1681, 1951, 7813, 4295, 18191, 11411, 15601, 13025}}, {20241, 18, 114898, {1, 1, 1, 11, 29, 53, 97, 205, 281, 917, 1009, 913, 1003, 16085, 30339, 55753, 53099, 30697}}, {20242, 18, 114903, {1, 1, 3, 15, 25, 35, 7, 227, 63, 251, 845, 843, 7117, 6021, 26917, 43611, 108643, 215471}}, {20243, 18, 114913, {1, 1, 3, 11, 19, 29, 75, 5, 131, 37, 1185, 2387, 8161, 1621, 19887, 20525, 33067, 30869}}, {20244, 18, 114928, {1, 1, 3, 3, 7, 37, 75, 159, 313, 17, 479, 2477, 7779, 309, 26095, 35693, 92561, 143151}}, {20245, 18, 114937, {1, 1, 5, 9, 5, 29, 65, 223, 331, 1013, 37, 1813, 1379, 9277, 14681, 61687, 24763, 124669}}, {20246, 18, 114958, {1, 3, 1, 1, 17, 47, 7, 219, 11, 13, 1517, 2583, 7483, 5399, 6883, 51387, 17901, 108659}}, {20247, 18, 114963, {1, 3, 7, 11, 9, 63, 81, 91, 411, 535, 255, 3683, 5285, 1787, 27205, 43651, 15647, 230651}}, {20248, 18, 115000, {1, 3, 1, 11, 7, 47, 35, 255, 341, 379, 421, 753, 7821, 13271, 13021, 463, 48457, 132521}}, {20249, 18, 115018, {1, 1, 5, 7, 21, 23, 53, 229, 393, 509, 1641, 2245, 6941, 10447, 3231, 5451, 18883, 47401}}, {20250, 18, 115023, {1, 3, 1, 7, 13, 61, 71, 49, 147, 625, 299, 3843, 4851, 3483, 27005, 23871, 18855, 124893}}, {20251, 18, 115028, {1, 3, 1, 7, 31, 13, 127, 177, 259, 179, 531, 1775, 5481, 13157, 23821, 31773, 93941, 237697}}, {20252, 18, 115042, {1, 1, 7, 1, 23, 21, 111, 219, 401, 455, 1603, 2077, 1537, 2063, 17821, 52087, 20707, 29535}}, {20253, 18, 115084, {1, 1, 3, 11, 17, 17, 13, 79, 49, 353, 1691, 361, 2805, 7121, 27013, 50631, 108235, 70513}}, {20254, 18, 115096, {1, 1, 5, 3, 15, 25, 103, 73, 377, 253, 1303, 501, 555, 15789, 16647, 9019, 60581, 157337}}, {20255, 18, 115105, {1, 3, 5, 9, 23, 45, 3, 251, 25, 559, 429, 1091, 5657, 15387, 5113, 64533, 131049, 127587}}, {20256, 18, 115117, {1, 1, 3, 15, 1, 53, 71, 141, 413, 849, 737, 3045, 7119, 8049, 18295, 31447, 70735, 117457}}, {20257, 18, 115149, {1, 1, 1, 11, 17, 11, 69, 155, 211, 249, 1869, 1575, 6859, 7045, 7015, 20135, 84157, 232621}}, {20258, 18, 115155, {1, 3, 7, 5, 19, 55, 15, 163, 457, 371, 1665, 1935, 601, 3629, 21975, 1191, 45133, 111649}}, {20259, 18, 115198, {1, 3, 7, 11, 23, 33, 5, 253, 355, 379, 933, 1781, 3989, 6191, 19081, 7651, 74671, 258799}}, {20260, 18, 115221, {1, 1, 3, 3, 23, 3, 63, 123, 273, 861, 369, 2409, 1505, 9059, 10727, 189, 122911, 44037}}, {20261, 18, 115222, {1, 1, 7, 13, 13, 23, 19, 87, 191, 397, 2027, 1689, 1143, 10919, 27073, 15013, 118429, 119165}}, {20262, 18, 115225, {1, 1, 5, 9, 15, 13, 29, 81, 409, 955, 1827, 1341, 3473, 16005, 29041, 57527, 7329, 167093}}, {20263, 18, 115276, {1, 1, 5, 3, 11, 31, 47, 13, 171, 995, 961, 3885, 3259, 2745, 12405, 49281, 2901, 207591}}, {20264, 18, 115294, {1, 3, 5, 13, 31, 3, 1, 215, 465, 279, 1697, 2449, 3829, 2053, 9877, 52911, 126077, 210515}}, {20265, 18, 115297, {1, 1, 3, 7, 11, 27, 55, 115, 249, 353, 407, 2567, 8105, 7747, 18111, 3383, 101875, 2185}}, {20266, 18, 115321, {1, 1, 3, 9, 25, 5, 35, 137, 405, 667, 1671, 2965, 5975, 4999, 18421, 43623, 64621, 129797}}, {20267, 18, 115348, {1, 3, 7, 13, 3, 17, 33, 191, 463, 787, 1795, 3037, 1679, 63, 12389, 3983, 22385, 84235}}, {20268, 18, 115364, {1, 1, 5, 9, 11, 25, 85, 215, 355, 553, 317, 1637, 3461, 15943, 2619, 14545, 125507, 18659}}, {20269, 18, 115376, {1, 1, 7, 5, 3, 41, 105, 179, 125, 557, 1345, 3631, 481, 10621, 11213, 40223, 46581, 113137}}, {20270, 18, 115385, {1, 3, 3, 15, 1, 63, 95, 213, 89, 21, 1249, 3063, 413, 4307, 26723, 10225, 115143, 144817}}, {20271, 18, 115386, {1, 3, 5, 15, 9, 43, 41, 117, 419, 143, 1651, 377, 4775, 8761, 23793, 8719, 76499, 208119}}, {20272, 18, 115400, {1, 3, 3, 1, 21, 29, 47, 117, 23, 333, 1153, 1067, 5859, 9375, 29997, 58991, 55895, 204933}}, {20273, 18, 115414, {1, 1, 3, 11, 11, 21, 115, 85, 223, 281, 701, 1331, 1341, 1149, 5993, 10885, 77353, 113553}}, {20274, 18, 115465, {1, 1, 5, 1, 25, 1, 1, 153, 449, 231, 593, 3061, 4157, 6661, 21735, 11361, 57751, 129569}}, {20275, 18, 115485, {1, 1, 3, 7, 27, 63, 81, 251, 125, 197, 1525, 1637, 4643, 4743, 17127, 51217, 95781, 973}}, {20276, 18, 115492, {1, 1, 3, 7, 11, 51, 13, 139, 83, 341, 543, 3061, 7777, 6705, 9609, 28933, 24669, 225275}}, {20277, 18, 115501, {1, 3, 1, 9, 25, 39, 99, 139, 5, 725, 1759, 1577, 1751, 3197, 3169, 39051, 1743, 108813}}, {20278, 18, 115519, {1, 1, 7, 5, 31, 15, 115, 229, 499, 291, 501, 3119, 2293, 14137, 625, 16379, 111057, 101643}}, {20279, 18, 115527, {1, 3, 7, 15, 31, 1, 51, 73, 455, 51, 1983, 3687, 6049, 3495, 26247, 6567, 28479, 158909}}, {20280, 18, 115531, {1, 3, 5, 5, 9, 11, 77, 181, 165, 773, 1611, 3945, 6787, 3827, 28597, 53269, 34003, 237291}}, {20281, 18, 115567, {1, 1, 5, 3, 31, 57, 15, 9, 163, 363, 1021, 2193, 8175, 3851, 26059, 63915, 114293, 163637}}, {20282, 18, 115572, {1, 1, 3, 7, 27, 49, 35, 121, 469, 833, 879, 1601, 6991, 13271, 8085, 45343, 5189, 109413}}, {20283, 18, 115631, {1, 3, 1, 15, 7, 11, 111, 153, 129, 769, 565, 2693, 333, 7343, 28535, 56937, 85641, 19871}}, {20284, 18, 115648, {1, 1, 5, 13, 7, 49, 121, 223, 55, 33, 19, 2291, 1847, 10173, 23337, 23431, 18181, 155663}}, {20285, 18, 115660, {1, 3, 1, 11, 25, 9, 3, 255, 425, 861, 1025, 3719, 6995, 14687, 31083, 60609, 115375, 17813}}, {20286, 18, 115672, {1, 1, 5, 13, 1, 55, 109, 239, 13, 939, 1077, 669, 1643, 10949, 25399, 55055, 125829, 253077}}, {20287, 18, 115681, {1, 1, 5, 3, 15, 51, 13, 133, 257, 387, 2017, 2223, 1479, 9377, 12867, 9833, 32323, 6255}}, {20288, 18, 115688, {1, 3, 1, 9, 1, 53, 121, 163, 349, 491, 1867, 3403, 6859, 459, 1483, 23893, 66851, 150843}}, {20289, 18, 115694, {1, 1, 1, 1, 1, 33, 51, 33, 177, 633, 449, 2705, 663, 3701, 8331, 43895, 87223, 48587}}, {20290, 18, 115699, {1, 3, 5, 7, 23, 7, 99, 43, 217, 31, 749, 2831, 1557, 3295, 6797, 45229, 46831, 62183}}, {20291, 18, 115719, {1, 1, 7, 7, 1, 45, 35, 51, 415, 693, 479, 1017, 6703, 241, 30887, 8953, 26901, 2951}}, {20292, 18, 115726, {1, 3, 3, 7, 29, 3, 25, 217, 67, 769, 653, 3983, 5513, 15481, 21399, 17525, 81747, 109843}}, {20293, 18, 115733, {1, 3, 5, 5, 29, 17, 97, 187, 157, 189, 1531, 1123, 4291, 14831, 15493, 62753, 53563, 153679}}, {20294, 18, 115796, {1, 3, 7, 13, 15, 63, 47, 5, 351, 275, 1177, 3947, 6755, 1319, 17053, 14267, 98215, 228795}}, {20295, 18, 115879, {1, 3, 7, 5, 19, 45, 43, 223, 213, 903, 539, 267, 83, 6951, 2979, 56929, 58405, 198373}}, {20296, 18, 115880, {1, 1, 5, 11, 21, 37, 109, 103, 29, 49, 17, 3987, 5679, 2559, 17391, 46157, 38743, 82245}}, {20297, 18, 115888, {1, 1, 3, 7, 7, 35, 57, 187, 113, 361, 721, 1821, 6473, 10233, 22549, 37725, 8445, 220669}}, {20298, 18, 115908, {1, 3, 3, 9, 21, 41, 73, 29, 163, 701, 1277, 3869, 1529, 4889, 10091, 65507, 53829, 191347}}, {20299, 18, 115925, {1, 1, 5, 15, 5, 21, 39, 39, 341, 271, 1543, 3161, 3935, 8319, 24921, 19575, 95009, 256221}}, {20300, 18, 115942, {1, 1, 1, 3, 11, 33, 63, 189, 21, 773, 1261, 3947, 183, 6769, 31337, 22179, 57255, 8323}}, {20301, 18, 115978, {1, 1, 3, 15, 29, 59, 103, 251, 107, 499, 915, 387, 3127, 5597, 3345, 15657, 979, 91685}}, {20302, 18, 115986, {1, 3, 3, 11, 13, 27, 9, 137, 177, 75, 567, 1511, 7355, 3087, 15309, 51733, 87329, 217125}}, {20303, 18, 116014, {1, 1, 1, 15, 9, 43, 113, 177, 507, 379, 765, 75, 6895, 7523, 24611, 7315, 49653, 59263}}, {20304, 18, 116019, {1, 3, 1, 5, 29, 23, 59, 215, 267, 161, 1957, 341, 4081, 9635, 3345, 12323, 128751, 144577}}, {20305, 18, 116031, {1, 3, 3, 13, 17, 55, 59, 73, 65, 697, 1209, 3345, 5629, 4545, 23043, 37649, 55015, 10263}}, {20306, 18, 116048, {1, 1, 7, 1, 21, 3, 7, 19, 445, 417, 1677, 799, 1241, 15463, 19815, 52845, 81309, 256713}}, {20307, 18, 116069, {1, 1, 3, 13, 13, 57, 17, 199, 3, 377, 1799, 2713, 3937, 12511, 7439, 33605, 56697, 168195}}, {20308, 18, 116091, {1, 3, 1, 7, 21, 53, 115, 97, 389, 83, 961, 813, 1499, 3411, 22377, 33323, 118405, 115947}}, {20309, 18, 116103, {1, 3, 7, 11, 23, 43, 85, 249, 151, 893, 833, 901, 7731, 13467, 14721, 38613, 104033, 136097}}, {20310, 18, 116107, {1, 3, 1, 11, 23, 23, 119, 129, 175, 159, 1031, 2379, 2753, 6755, 10979, 18225, 52375, 257003}}, {20311, 18, 116145, {1, 3, 1, 13, 1, 9, 61, 255, 433, 621, 1469, 705, 5841, 7421, 23873, 30487, 55823, 119705}}, {20312, 18, 116152, {1, 3, 1, 15, 19, 31, 29, 163, 87, 793, 885, 2495, 4609, 2757, 5333, 52937, 79187, 228777}}, {20313, 18, 116247, {1, 1, 1, 3, 17, 43, 69, 241, 143, 173, 327, 2747, 5617, 16347, 16155, 47775, 25917, 163663}}, {20314, 18, 116289, {1, 1, 1, 1, 19, 19, 15, 27, 25, 139, 691, 4019, 3055, 10301, 11281, 10957, 59117, 178149}}, {20315, 18, 116316, {1, 1, 1, 3, 15, 15, 37, 89, 103, 7, 527, 2823, 7205, 6831, 25179, 22249, 103323, 31251}}, {20316, 18, 116344, {1, 1, 3, 3, 7, 49, 7, 241, 37, 11, 577, 1987, 1935, 14787, 16411, 36305, 65185, 221253}}, {20317, 18, 116354, {1, 1, 1, 5, 31, 51, 123, 169, 441, 13, 721, 2359, 5687, 2641, 16339, 8441, 55967, 98775}}, {20318, 18, 116368, {1, 1, 7, 5, 21, 23, 91, 229, 23, 105, 339, 2371, 7803, 14913, 12651, 40573, 117399, 134865}}, {20319, 18, 116377, {1, 3, 1, 15, 19, 27, 127, 77, 469, 343, 451, 2251, 6705, 7765, 8623, 10367, 100379, 140899}}, {20320, 18, 116383, {1, 3, 1, 5, 1, 11, 93, 231, 33, 133, 1545, 1015, 7577, 8871, 29975, 12141, 130833, 103123}}, {20321, 18, 116387, {1, 3, 3, 5, 7, 25, 95, 93, 293, 543, 1785, 2097, 6045, 4225, 607, 443, 72055, 32269}}, {20322, 18, 116408, {1, 1, 1, 1, 5, 55, 47, 105, 189, 359, 1589, 765, 2303, 11963, 25565, 40669, 98977, 242089}}, {20323, 18, 116428, {1, 1, 1, 15, 13, 45, 121, 235, 125, 181, 1891, 3265, 2097, 3207, 31647, 13407, 22515, 15155}}, {20324, 18, 116445, {1, 1, 5, 15, 13, 11, 81, 233, 307, 505, 221, 813, 6483, 741, 9819, 19405, 74235, 144761}}, {20325, 18, 116476, {1, 3, 5, 7, 9, 25, 31, 209, 337, 473, 1831, 2711, 5551, 13531, 28747, 1875, 6401, 159995}}, {20326, 18, 116482, {1, 1, 7, 7, 29, 3, 127, 207, 387, 849, 1449, 2741, 2105, 885, 18115, 5433, 122119, 16969}}, {20327, 18, 116488, {1, 3, 7, 9, 25, 17, 43, 209, 41, 927, 409, 1567, 1609, 12487, 16305, 41365, 10991, 172127}}, {20328, 18, 116493, {1, 1, 3, 7, 27, 29, 63, 127, 81, 283, 1459, 143, 5993, 14027, 8055, 28065, 128389, 255307}}, {20329, 18, 116502, {1, 3, 7, 11, 13, 41, 63, 223, 215, 901, 1853, 2881, 5149, 7439, 4519, 33279, 127765, 139431}}, {20330, 18, 116518, {1, 3, 7, 7, 15, 61, 61, 173, 221, 711, 191, 3863, 2695, 9663, 6277, 8791, 128019, 256755}}, {20331, 18, 116524, {1, 3, 1, 9, 29, 45, 83, 43, 297, 605, 1887, 2421, 2307, 5199, 17275, 39225, 127215, 253687}}, {20332, 18, 116527, {1, 1, 5, 3, 21, 23, 121, 125, 497, 945, 1367, 2757, 3481, 8607, 32447, 62373, 32171, 226621}}, {20333, 18, 116549, {1, 3, 1, 5, 7, 1, 71, 255, 465, 951, 129, 1989, 6053, 3737, 6511, 54519, 16947, 124491}}, {20334, 18, 116561, {1, 3, 5, 1, 9, 21, 127, 49, 85, 615, 1897, 1715, 7923, 10309, 16919, 24131, 18015, 140195}}, {20335, 18, 116562, {1, 1, 1, 1, 5, 27, 3, 205, 29, 319, 485, 3941, 7829, 789, 4207, 39939, 67761, 152459}}, {20336, 18, 116568, {1, 3, 7, 11, 9, 41, 1, 129, 511, 831, 1007, 2011, 6211, 9179, 20877, 62121, 21879, 23661}}, {20337, 18, 116577, {1, 1, 7, 1, 19, 53, 75, 123, 181, 735, 925, 1065, 3317, 3201, 27473, 19379, 78223, 45725}}, {20338, 18, 116590, {1, 1, 5, 9, 9, 61, 3, 193, 441, 815, 583, 3235, 247, 14091, 19877, 33505, 3477, 20111}}, {20339, 18, 116602, {1, 1, 5, 13, 29, 53, 55, 165, 359, 889, 1833, 1543, 7913, 307, 22853, 37839, 15569, 140127}}, {20340, 18, 116607, {1, 1, 1, 15, 21, 53, 63, 195, 299, 1019, 1371, 1311, 5401, 8015, 30335, 56281, 61011, 59279}}, {20341, 18, 116611, {1, 1, 3, 13, 3, 57, 45, 239, 445, 419, 581, 3971, 4621, 9327, 27255, 53069, 126415, 250313}}, {20342, 18, 116626, {1, 3, 1, 9, 5, 63, 21, 25, 447, 961, 1857, 3123, 3029, 9743, 26069, 38251, 58475, 108737}}, {20343, 18, 116637, {1, 3, 1, 15, 13, 59, 5, 21, 171, 107, 1631, 2407, 6695, 8079, 2805, 50995, 53173, 104757}}, {20344, 18, 116647, {1, 3, 7, 7, 1, 55, 103, 67, 369, 533, 515, 2363, 5147, 11633, 20435, 24591, 68155, 140029}}, {20345, 18, 116665, {1, 3, 7, 13, 19, 51, 13, 149, 159, 915, 1029, 2825, 5259, 5139, 31325, 42825, 119923, 227811}}, {20346, 18, 116674, {1, 3, 3, 3, 23, 17, 121, 25, 403, 333, 491, 2869, 881, 12997, 5101, 48351, 90831, 143009}}, {20347, 18, 116700, {1, 1, 3, 15, 23, 63, 93, 43, 107, 393, 419, 3509, 1543, 10295, 11019, 8389, 73753, 42681}}, {20348, 18, 116714, {1, 1, 7, 1, 29, 49, 41, 189, 303, 955, 1241, 1623, 2269, 3413, 6261, 2155, 90945, 95117}}, {20349, 18, 116719, {1, 1, 3, 15, 31, 13, 103, 241, 189, 283, 1303, 1693, 1587, 16313, 205, 43421, 121799, 200151}}, {20350, 18, 116744, {1, 3, 5, 1, 29, 27, 105, 83, 345, 411, 1197, 3489, 5891, 1137, 7311, 681, 127991, 69533}}, {20351, 18, 116764, {1, 3, 5, 15, 31, 11, 105, 221, 57, 39, 145, 3233, 1431, 16271, 21225, 47989, 72583, 191327}}, {20352, 18, 116774, {1, 3, 7, 9, 25, 47, 109, 61, 257, 949, 981, 1383, 8003, 4661, 19555, 20191, 114641, 84817}}, {20353, 18, 116778, {1, 1, 5, 9, 17, 9, 19, 209, 73, 573, 1039, 2741, 1495, 1615, 6299, 20507, 84729, 166977}}, {20354, 18, 116798, {1, 3, 5, 13, 27, 51, 39, 203, 437, 725, 1479, 3071, 621, 15563, 28473, 58403, 25943, 116683}}, {20355, 18, 116803, {1, 1, 3, 9, 5, 29, 63, 61, 329, 305, 523, 2243, 6689, 11773, 19319, 57783, 24265, 218153}}, {20356, 18, 116806, {1, 3, 7, 5, 17, 27, 115, 9, 243, 613, 679, 1915, 7265, 2989, 13663, 15115, 50779, 235761}}, {20357, 18, 116827, {1, 1, 5, 5, 13, 35, 111, 151, 255, 569, 1209, 3277, 4503, 3797, 22601, 19523, 126339, 141289}}, {20358, 18, 116839, {1, 1, 3, 9, 15, 51, 85, 125, 233, 1011, 231, 2949, 1091, 8605, 14855, 62401, 14143, 212557}}, {20359, 18, 116863, {1, 3, 5, 11, 29, 53, 83, 31, 201, 219, 1083, 967, 6913, 10325, 1971, 55841, 7733, 208883}}, {20360, 18, 116873, {1, 3, 3, 1, 23, 33, 51, 103, 265, 285, 1363, 2813, 3327, 7921, 13537, 31483, 43405, 189641}}, {20361, 18, 116882, {1, 1, 7, 15, 27, 3, 5, 87, 117, 437, 1251, 189, 3271, 15579, 25025, 23203, 39421, 133581}}, {20362, 18, 116887, {1, 1, 5, 1, 9, 3, 91, 45, 71, 557, 2019, 2355, 5539, 2843, 13025, 61017, 3475, 179891}}, {20363, 18, 116915, {1, 1, 7, 5, 17, 11, 127, 241, 9, 971, 1699, 2719, 1947, 109, 19817, 13949, 120247, 60775}}, {20364, 18, 116939, {1, 1, 5, 9, 9, 39, 117, 221, 197, 767, 1691, 4075, 3665, 1271, 16119, 64129, 2681, 105325}}, {20365, 18, 116944, {1, 3, 3, 11, 31, 51, 5, 23, 419, 715, 1985, 4095, 7255, 10491, 25575, 6177, 35917, 178345}}, {20366, 18, 116953, {1, 3, 5, 7, 15, 23, 99, 203, 461, 509, 1501, 1965, 1105, 1341, 21713, 21901, 129905, 67937}}, {20367, 18, 116965, {1, 3, 3, 15, 25, 5, 55, 167, 477, 125, 163, 2379, 2433, 12975, 26259, 55825, 19913, 202873}}, {20368, 18, 117002, {1, 3, 3, 7, 15, 15, 67, 227, 413, 905, 1609, 2083, 4011, 10477, 22809, 61873, 96423, 119253}}, {20369, 18, 117007, {1, 3, 1, 11, 13, 17, 37, 147, 355, 445, 619, 3181, 5939, 6953, 15859, 37979, 24723, 133037}}, {20370, 18, 117015, {1, 1, 5, 15, 5, 25, 89, 3, 279, 569, 343, 2453, 5739, 2901, 6709, 43957, 75791, 20791}}, {20371, 18, 117032, {1, 1, 3, 5, 13, 39, 53, 203, 75, 945, 635, 349, 2339, 2549, 23827, 7903, 128005, 14949}}, {20372, 18, 117035, {1, 1, 7, 3, 7, 59, 59, 77, 143, 99, 1313, 3957, 3807, 15731, 20919, 60829, 105967, 226767}}, {20373, 18, 117052, {1, 1, 3, 7, 17, 49, 27, 245, 129, 583, 1055, 741, 5607, 689, 20075, 54837, 113257, 222677}}, {20374, 18, 117087, {1, 1, 7, 13, 17, 5, 19, 141, 205, 749, 1769, 2981, 5787, 4511, 135, 19475, 113735, 116859}}, {20375, 18, 117139, {1, 3, 7, 1, 9, 33, 111, 139, 77, 117, 363, 1171, 2587, 1539, 30791, 10697, 6879, 104827}}, {20376, 18, 117157, {1, 3, 3, 5, 27, 47, 49, 215, 65, 435, 1601, 231, 2047, 10405, 28409, 17013, 103909, 232051}}, {20377, 18, 117193, {1, 3, 3, 3, 13, 19, 3, 159, 293, 675, 247, 2829, 6703, 6085, 1935, 18209, 15709, 186669}}, {20378, 18, 117211, {1, 3, 3, 5, 21, 55, 17, 237, 121, 603, 953, 947, 6973, 15979, 11029, 12381, 12807, 131603}}, {20379, 18, 117214, {1, 3, 5, 3, 3, 41, 121, 203, 283, 349, 1841, 115, 6567, 2131, 883, 50515, 78381, 168189}}, {20380, 18, 117220, {1, 3, 7, 15, 5, 55, 85, 13, 77, 443, 1711, 1043, 1265, 3701, 5121, 41435, 40637, 69125}}, {20381, 18, 117238, {1, 1, 5, 15, 15, 33, 67, 235, 3, 95, 1685, 731, 2187, 11857, 7197, 62113, 12565, 127455}}, {20382, 18, 117248, {1, 3, 7, 7, 11, 45, 125, 231, 263, 611, 221, 195, 6347, 14029, 7823, 52295, 78879, 211441}}, {20383, 18, 117275, {1, 3, 7, 15, 9, 63, 75, 189, 187, 449, 27, 3647, 4705, 13037, 3773, 36441, 35445, 181793}}, {20384, 18, 117293, {1, 1, 5, 3, 31, 19, 123, 39, 297, 1017, 1191, 2227, 6085, 5117, 16569, 64743, 29329, 157279}}, {20385, 18, 117301, {1, 1, 5, 5, 15, 47, 111, 61, 435, 657, 141, 3445, 6921, 7759, 30141, 37631, 85969, 227563}}, {20386, 18, 117319, {1, 3, 1, 13, 27, 39, 15, 167, 151, 185, 1513, 211, 951, 12705, 25703, 29289, 120993, 156741}}, {20387, 18, 117338, {1, 3, 7, 7, 7, 39, 19, 221, 351, 951, 1231, 1915, 3043, 189, 18977, 50149, 56583, 122147}}, {20388, 18, 117347, {1, 1, 5, 15, 29, 37, 77, 207, 291, 851, 131, 1041, 1657, 4393, 5023, 12745, 32253, 204431}}, {20389, 18, 117361, {1, 1, 7, 15, 11, 59, 85, 255, 67, 23, 1321, 2153, 7043, 417, 15719, 59937, 37619, 109331}}, {20390, 18, 117380, {1, 3, 7, 15, 25, 37, 43, 15, 385, 735, 1741, 3655, 4215, 1097, 19519, 44313, 99851, 204717}}, {20391, 18, 117389, {1, 1, 3, 7, 15, 17, 17, 105, 399, 49, 105, 159, 465, 11991, 29797, 23907, 129609, 179013}}, {20392, 18, 117398, {1, 1, 7, 13, 9, 17, 87, 51, 391, 695, 545, 3061, 4499, 2059, 10095, 13847, 68519, 60611}}, {20393, 18, 117435, {1, 3, 3, 1, 31, 7, 11, 233, 231, 189, 1599, 1589, 401, 8759, 17273, 43613, 48709, 253521}}, {20394, 18, 117458, {1, 1, 1, 11, 5, 9, 27, 77, 491, 951, 579, 1635, 3241, 14497, 27149, 45001, 56769, 160731}}, {20395, 18, 117476, {1, 3, 7, 15, 29, 11, 125, 101, 19, 971, 107, 1525, 3939, 7633, 16355, 24727, 19475, 157571}}, {20396, 18, 117498, {1, 1, 1, 9, 25, 7, 35, 187, 321, 483, 1919, 1911, 7869, 12903, 26977, 49419, 24973, 214731}}, {20397, 18, 117500, {1, 1, 5, 3, 23, 1, 11, 143, 315, 1015, 1367, 1555, 1041, 6655, 10481, 49275, 49575, 101061}}, {20398, 18, 117529, {1, 3, 5, 15, 15, 59, 13, 117, 217, 975, 1821, 3829, 1545, 921, 20875, 43305, 18793, 158651}}, {20399, 18, 117554, {1, 3, 3, 11, 23, 23, 91, 7, 29, 613, 1093, 3881, 3301, 3751, 16137, 48277, 119813, 177341}}, {20400, 18, 117556, {1, 3, 3, 15, 7, 37, 115, 19, 147, 585, 1877, 2395, 3343, 9567, 16199, 13969, 89731, 124835}}, {20401, 18, 117565, {1, 1, 5, 7, 29, 3, 59, 141, 375, 527, 1219, 409, 7155, 2823, 32497, 23103, 73187, 53089}}, {20402, 18, 117580, {1, 1, 5, 3, 13, 27, 111, 63, 189, 813, 643, 19, 3461, 13891, 26651, 52395, 74729, 148397}}, {20403, 18, 117585, {1, 3, 5, 1, 27, 61, 97, 227, 123, 829, 1559, 2523, 7737, 6047, 213, 23613, 61571, 7093}}, {20404, 18, 117592, {1, 1, 1, 11, 17, 1, 73, 203, 391, 937, 321, 3431, 7163, 3547, 29467, 65271, 69775, 226405}}, {20405, 18, 117597, {1, 1, 5, 15, 25, 7, 75, 199, 511, 731, 1547, 2127, 1609, 5623, 26771, 29935, 76671, 178683}}, {20406, 18, 117616, {1, 3, 5, 15, 25, 49, 99, 23, 281, 81, 507, 1499, 5235, 9945, 14099, 5993, 319, 178581}}, {20407, 18, 117637, {1, 3, 7, 9, 5, 13, 105, 7, 135, 827, 927, 3463, 839, 7047, 19863, 63859, 13951, 221795}}, {20408, 18, 117644, {1, 1, 1, 13, 7, 21, 59, 9, 467, 299, 1035, 1395, 7413, 7313, 24769, 44043, 50679, 72867}}, {20409, 18, 117659, {1, 1, 7, 1, 31, 33, 95, 155, 429, 413, 493, 2025, 2069, 551, 507, 13515, 3507, 93873}}, {20410, 18, 117703, {1, 1, 3, 5, 3, 33, 109, 1, 299, 727, 495, 2981, 3795, 11467, 27173, 4171, 6859, 129961}}, {20411, 18, 117704, {1, 1, 7, 9, 23, 41, 113, 103, 161, 303, 1565, 2637, 7113, 11635, 13707, 3559, 21007, 250107}}, {20412, 18, 117727, {1, 1, 5, 13, 1, 49, 11, 87, 31, 77, 1847, 1137, 3031, 1943, 28755, 32197, 96043, 152447}}, {20413, 18, 117738, {1, 1, 3, 7, 3, 3, 123, 65, 175, 809, 681, 2135, 5279, 7119, 4573, 19287, 90235, 183391}}, {20414, 18, 117770, {1, 3, 1, 13, 7, 5, 25, 151, 437, 155, 1841, 219, 5641, 12097, 6153, 11, 60315, 169293}}, {20415, 18, 117796, {1, 1, 7, 5, 21, 29, 23, 83, 35, 651, 1507, 635, 3867, 12133, 25523, 55341, 105741, 240349}}, {20416, 18, 117799, {1, 1, 1, 15, 9, 29, 27, 151, 463, 747, 547, 577, 1263, 15235, 6695, 60849, 72231, 175671}}, {20417, 18, 117820, {1, 3, 5, 11, 11, 43, 81, 37, 505, 509, 1325, 3295, 839, 5855, 19795, 1403, 15711, 219481}}, {20418, 18, 117832, {1, 3, 3, 15, 25, 61, 121, 37, 201, 133, 537, 1345, 4213, 13023, 18795, 8949, 84431, 105521}}, {20419, 18, 117840, {1, 3, 7, 11, 13, 51, 87, 245, 357, 7, 699, 2003, 5963, 1399, 69, 19083, 114585, 232313}}, {20420, 18, 117843, {1, 1, 1, 13, 9, 29, 65, 123, 37, 885, 227, 2795, 1037, 10905, 21217, 4081, 77643, 254245}}, {20421, 18, 117865, {1, 3, 1, 3, 25, 23, 71, 189, 253, 785, 1337, 1275, 3285, 1067, 8607, 3883, 119099, 116637}}, {20422, 18, 117868, {1, 1, 1, 15, 19, 43, 17, 89, 257, 175, 1943, 207, 597, 9279, 405, 33209, 65221, 39557}}, {20423, 18, 117874, {1, 1, 7, 5, 7, 47, 127, 11, 197, 871, 23, 1951, 6829, 7831, 5223, 56287, 115649, 114283}}, {20424, 18, 117886, {1, 3, 1, 3, 1, 35, 81, 189, 19, 117, 1683, 469, 8117, 5449, 22871, 5505, 125111, 128717}}, {20425, 18, 117962, {1, 3, 7, 5, 7, 31, 105, 57, 387, 691, 1293, 3103, 2329, 16247, 18357, 55453, 112633, 225641}}, {20426, 18, 117967, {1, 3, 1, 3, 13, 3, 65, 25, 47, 413, 521, 3507, 1793, 14431, 22341, 39813, 46399, 204501}}, {20427, 18, 117995, {1, 3, 1, 1, 31, 37, 21, 45, 261, 665, 1243, 1937, 5001, 3789, 26473, 20153, 107131, 75523}}, {20428, 18, 118000, {1, 3, 5, 15, 27, 61, 109, 139, 19, 583, 353, 445, 53, 67, 20753, 57827, 116527, 55109}}, {20429, 18, 118017, {1, 1, 3, 3, 1, 37, 113, 21, 305, 967, 1703, 2095, 1059, 2843, 22381, 24871, 24765, 52425}}, {20430, 18, 118037, {1, 3, 7, 11, 27, 59, 111, 111, 283, 79, 1227, 3631, 4169, 5671, 7769, 56553, 75503, 206259}}, {20431, 18, 118038, {1, 1, 5, 11, 11, 1, 127, 13, 17, 255, 1383, 2879, 6785, 289, 7061, 53067, 11539, 131405}}, {20432, 18, 118051, {1, 1, 5, 15, 29, 27, 67, 15, 247, 689, 579, 3237, 5279, 13847, 20305, 60237, 115841, 144855}}, {20433, 18, 118057, {1, 1, 5, 1, 9, 25, 75, 11, 83, 1015, 281, 1617, 7449, 10673, 7033, 38839, 113703, 233101}}, {20434, 18, 118072, {1, 3, 3, 3, 23, 41, 81, 109, 199, 969, 935, 1793, 6921, 4013, 9625, 48149, 54395, 1193}}, {20435, 18, 118080, {1, 3, 5, 7, 19, 63, 25, 201, 63, 799, 765, 533, 1417, 3199, 7773, 44247, 112207, 11783}}, {20436, 18, 118098, {1, 3, 1, 11, 7, 25, 87, 159, 491, 749, 1157, 667, 2951, 12019, 22259, 36933, 124159, 176041}}, {20437, 18, 118107, {1, 1, 5, 15, 21, 19, 113, 175, 129, 385, 2025, 2685, 1925, 8547, 4835, 15953, 128023, 236341}}, {20438, 18, 118109, {1, 1, 1, 9, 13, 47, 25, 81, 389, 249, 1857, 1061, 4439, 3717, 16299, 23247, 95275, 222701}}, {20439, 18, 118114, {1, 3, 3, 1, 3, 61, 61, 117, 159, 689, 43, 113, 4203, 7699, 27607, 37195, 63415, 90481}}, {20440, 18, 118123, {1, 3, 1, 5, 11, 49, 73, 13, 307, 655, 645, 2765, 6079, 12687, 22417, 44713, 5247, 40265}}, {20441, 18, 118150, {1, 1, 7, 13, 5, 55, 57, 237, 317, 101, 481, 2515, 707, 6385, 9421, 50557, 92395, 193737}}, {20442, 18, 118159, {1, 3, 5, 1, 27, 35, 65, 107, 63, 57, 1699, 4077, 4279, 8547, 15137, 11533, 117641, 64925}}, {20443, 18, 118164, {1, 1, 5, 1, 13, 7, 7, 141, 305, 191, 2033, 2677, 6025, 12927, 4057, 12047, 60253, 90803}}, {20444, 18, 118173, {1, 1, 7, 3, 1, 9, 63, 233, 185, 97, 913, 187, 4321, 8951, 27669, 27035, 30029, 218725}}, {20445, 18, 118201, {1, 1, 7, 1, 11, 59, 41, 195, 335, 551, 491, 3079, 7777, 4003, 24543, 17165, 103261, 167505}}, {20446, 18, 118212, {1, 1, 3, 3, 9, 59, 37, 185, 289, 845, 1083, 63, 7439, 4677, 29245, 40813, 16295, 45499}}, {20447, 18, 118246, {1, 3, 5, 1, 1, 37, 89, 5, 277, 493, 155, 1641, 5395, 11389, 26247, 2833, 103803, 74447}}, {20448, 18, 118257, {1, 1, 3, 1, 29, 55, 83, 211, 377, 583, 1075, 2679, 7157, 11719, 1653, 5977, 52263, 45531}}, {20449, 18, 118303, {1, 1, 5, 15, 1, 31, 89, 7, 239, 821, 887, 1319, 225, 14555, 5443, 44717, 99803, 241577}}, {20450, 18, 118310, {1, 3, 5, 11, 7, 23, 81, 161, 67, 1011, 177, 2837, 7767, 14385, 29415, 9377, 7407, 128403}}, {20451, 18, 118313, {1, 1, 7, 11, 3, 13, 13, 237, 199, 601, 481, 3809, 6591, 8497, 25361, 22547, 28317, 22961}}, {20452, 18, 118324, {1, 3, 1, 1, 31, 29, 105, 161, 483, 391, 321, 1087, 4149, 8803, 22291, 24611, 114447, 33645}}, {20453, 18, 118334, {1, 3, 1, 11, 1, 47, 41, 45, 287, 503, 169, 2265, 1835, 6609, 25245, 7069, 61137, 160653}}, {20454, 18, 118336, {1, 1, 7, 13, 11, 39, 29, 39, 489, 205, 741, 2871, 377, 10679, 11689, 50947, 85309, 95697}}, {20455, 18, 118339, {1, 3, 7, 7, 23, 19, 103, 15, 79, 425, 369, 2009, 4417, 11031, 2113, 36969, 73241, 120903}}, {20456, 18, 118353, {1, 3, 1, 7, 27, 9, 43, 33, 123, 895, 223, 1045, 2701, 3339, 12099, 24449, 52973, 175671}}, {20457, 18, 118354, {1, 3, 5, 5, 3, 1, 13, 117, 429, 167, 1361, 2299, 7565, 1153, 9259, 29209, 25747, 71005}}, {20458, 18, 118390, {1, 3, 1, 15, 7, 7, 13, 209, 73, 523, 1549, 2545, 5583, 10209, 27205, 41243, 14217, 208993}}, {20459, 18, 118396, {1, 3, 5, 5, 3, 29, 99, 255, 479, 297, 1319, 2171, 7321, 14425, 15869, 44449, 10917, 171165}}, {20460, 18, 118436, {1, 3, 3, 11, 13, 49, 29, 95, 79, 987, 161, 859, 6503, 8839, 14131, 30249, 16183, 40257}}, {20461, 18, 118453, {1, 3, 3, 11, 27, 7, 27, 33, 255, 847, 789, 3897, 2599, 16107, 22379, 1853, 102713, 197547}}, {20462, 18, 118466, {1, 1, 3, 9, 29, 11, 107, 227, 35, 183, 639, 1585, 313, 1451, 19789, 13855, 94277, 85569}}, {20463, 18, 118492, {1, 3, 7, 7, 25, 33, 101, 49, 137, 457, 2027, 3317, 1961, 6097, 739, 12875, 69503, 95453}}, {20464, 18, 118506, {1, 3, 3, 11, 29, 13, 127, 3, 31, 319, 1341, 927, 5067, 13891, 31265, 41381, 49341, 160343}}, {20465, 18, 118525, {1, 1, 3, 15, 31, 21, 93, 155, 471, 707, 1395, 2995, 867, 10353, 8137, 44267, 24823, 6113}}, {20466, 18, 118557, {1, 3, 1, 7, 7, 33, 83, 79, 349, 687, 1045, 1183, 4441, 15199, 1953, 36395, 84691, 134939}}, {20467, 18, 118561, {1, 1, 3, 15, 13, 21, 41, 105, 189, 439, 1171, 4005, 7641, 1597, 24317, 58749, 35539, 220647}}, {20468, 18, 118586, {1, 1, 3, 15, 13, 39, 49, 5, 461, 613, 1633, 1951, 7959, 5733, 10061, 18829, 49505, 90033}}, {20469, 18, 118606, {1, 3, 5, 5, 29, 25, 19, 227, 379, 525, 687, 2629, 7729, 4791, 5911, 14481, 49063, 216669}}, {20470, 18, 118627, {1, 3, 7, 7, 7, 63, 93, 227, 79, 165, 1971, 1695, 4485, 6009, 8769, 12861, 83653, 27667}}, {20471, 18, 118641, {1, 1, 5, 5, 25, 11, 23, 89, 363, 491, 459, 4063, 3787, 9375, 28011, 44757, 56441, 116609}}, {20472, 18, 118654, {1, 3, 5, 9, 7, 53, 43, 149, 435, 35, 135, 1759, 3197, 7749, 12731, 28295, 25901, 125847}}, {20473, 18, 118687, {1, 1, 3, 5, 15, 15, 1, 215, 307, 711, 1971, 2795, 677, 11921, 10303, 37997, 6653, 51295}}, {20474, 18, 118688, {1, 1, 5, 15, 1, 59, 75, 195, 51, 215, 1303, 3023, 8023, 10951, 13015, 23513, 37029, 23581}}, {20475, 18, 118735, {1, 1, 1, 3, 27, 3, 77, 165, 97, 499, 937, 1129, 6649, 11305, 27763, 32849, 78251, 210407}}, {20476, 18, 118737, {1, 3, 3, 3, 9, 21, 19, 197, 339, 53, 1875, 1057, 3485, 14645, 13417, 39307, 81437, 45857}}, {20477, 18, 118750, {1, 1, 1, 5, 19, 5, 95, 205, 399, 699, 819, 1927, 7913, 8109, 1223, 28595, 397, 81051}}, {20478, 18, 118773, {1, 3, 7, 13, 23, 11, 37, 167, 189, 813, 1199, 3545, 655, 13239, 10469, 33895, 119025, 185361}}, {20479, 18, 118778, {1, 1, 5, 11, 9, 13, 41, 37, 443, 269, 1199, 1347, 7081, 11273, 14389, 64083, 117901, 51903}}, {20480, 18, 118786, {1, 1, 3, 13, 5, 17, 117, 151, 155, 637, 731, 1839, 855, 9749, 19529, 18101, 20341, 21941}}, {20481, 18, 118809, {1, 1, 1, 11, 15, 17, 35, 9, 91, 907, 667, 853, 1455, 10097, 31277, 749, 47089, 219517}}, {20482, 18, 118833, {1, 3, 7, 1, 27, 31, 9, 145, 309, 811, 5, 2645, 7851, 1953, 21427, 18805, 108755, 77215}}, {20483, 18, 118853, {1, 1, 7, 3, 21, 7, 25, 233, 145, 1015, 43, 2205, 4735, 13257, 24001, 50469, 42567, 253745}}, {20484, 18, 118854, {1, 3, 1, 15, 3, 53, 51, 45, 397, 379, 641, 895, 7569, 15783, 23923, 6147, 121395, 261853}}, {20485, 18, 118863, {1, 1, 1, 1, 23, 47, 35, 125, 289, 65, 1875, 2309, 519, 5435, 5271, 25319, 14557, 19389}}, {20486, 18, 118881, {1, 3, 5, 7, 27, 43, 15, 61, 357, 791, 1781, 3671, 3911, 1325, 5607, 44107, 67873, 119849}}, {20487, 18, 118896, {1, 3, 1, 5, 25, 37, 105, 51, 491, 407, 475, 1763, 1425, 14883, 31435, 48979, 120667, 131089}}, {20488, 18, 118917, {1, 3, 5, 13, 1, 51, 109, 161, 215, 871, 185, 2389, 7977, 6705, 14045, 45569, 44557, 114795}}, {20489, 18, 118921, {1, 3, 7, 11, 17, 21, 111, 183, 343, 593, 447, 3995, 759, 3709, 32655, 30141, 127225, 120899}}, {20490, 18, 118939, {1, 1, 5, 3, 17, 3, 69, 25, 113, 897, 1933, 2717, 2003, 5847, 2541, 62415, 50975, 97903}}, {20491, 18, 118948, {1, 1, 1, 1, 9, 35, 107, 81, 257, 57, 1719, 4049, 1237, 10659, 4689, 20887, 90791, 251911}}, {20492, 18, 118960, {1, 1, 7, 11, 1, 49, 83, 213, 169, 169, 825, 2983, 5833, 2413, 32165, 47459, 129021, 156217}}, {20493, 18, 118970, {1, 1, 5, 13, 15, 39, 61, 93, 407, 553, 839, 4035, 6609, 6327, 945, 49625, 127867, 240161}}, {20494, 18, 118983, {1, 1, 1, 15, 23, 47, 21, 235, 81, 431, 1819, 1141, 7973, 4623, 4539, 23201, 83111, 230857}}, {20495, 18, 119025, {1, 3, 3, 15, 9, 15, 15, 173, 29, 803, 1453, 2621, 8095, 6639, 6607, 21471, 44785, 122271}}, {20496, 18, 119026, {1, 3, 3, 7, 21, 5, 127, 203, 43, 581, 1925, 165, 4615, 9141, 18563, 54413, 71559, 172791}}, {20497, 18, 119064, {1, 3, 3, 3, 27, 31, 55, 3, 381, 971, 1087, 2659, 139, 10935, 9189, 3445, 15071, 218873}}, {20498, 18, 119069, {1, 3, 1, 3, 1, 57, 47, 71, 85, 335, 207, 225, 2931, 14721, 21431, 17199, 745, 177403}}, {20499, 18, 119079, {1, 3, 1, 7, 7, 17, 21, 57, 345, 29, 1147, 1179, 7371, 14725, 27445, 62061, 16483, 112489}}, {20500, 18, 119085, {1, 3, 7, 15, 23, 11, 91, 1, 1, 117, 1665, 3899, 5683, 14497, 25633, 6233, 104029, 22155}}, {20501, 18, 119115, {1, 3, 5, 9, 1, 27, 15, 187, 37, 329, 585, 729, 5651, 15715, 4339, 1899, 90611, 195643}}, {20502, 18, 119165, {1, 1, 3, 11, 1, 45, 95, 103, 13, 83, 319, 2295, 6333, 13469, 19237, 55985, 129725, 141699}}, {20503, 18, 119166, {1, 1, 5, 11, 7, 41, 97, 159, 511, 617, 1545, 3023, 7919, 8437, 8345, 16701, 69053, 105047}}, {20504, 18, 119193, {1, 3, 3, 11, 29, 35, 23, 95, 277, 931, 857, 3887, 4597, 10841, 12947, 18009, 61499, 242827}}, {20505, 18, 119194, {1, 1, 3, 3, 7, 63, 35, 161, 125, 637, 149, 1045, 3297, 16213, 1543, 8073, 80373, 61507}}, {20506, 18, 119199, {1, 1, 7, 5, 31, 43, 113, 189, 181, 659, 1971, 3309, 4237, 4279, 31563, 29429, 17443, 154385}}, {20507, 18, 119215, {1, 1, 1, 13, 19, 43, 99, 91, 47, 477, 153, 3295, 6281, 779, 17169, 343, 1723, 171133}}, {20508, 18, 119218, {1, 1, 1, 15, 9, 35, 123, 45, 417, 631, 1415, 1835, 3063, 897, 18947, 62477, 12759, 97831}}, {20509, 18, 119241, {1, 1, 3, 13, 31, 1, 31, 139, 411, 605, 1829, 303, 3891, 15807, 7335, 44833, 87427, 62183}}, {20510, 18, 119277, {1, 1, 3, 13, 29, 55, 97, 107, 241, 981, 1281, 3295, 6825, 15865, 4221, 24695, 54203, 252069}}, {20511, 18, 119301, {1, 3, 7, 13, 1, 3, 33, 165, 483, 813, 127, 1717, 8077, 3521, 23465, 41705, 2769, 173233}}, {20512, 18, 119306, {1, 3, 1, 11, 11, 51, 39, 125, 375, 825, 1775, 2923, 4903, 4779, 907, 47787, 22293, 169631}}, {20513, 18, 119335, {1, 3, 5, 5, 13, 27, 43, 229, 267, 153, 567, 3403, 2103, 6203, 29629, 29715, 116735, 122515}}, {20514, 18, 119344, {1, 3, 5, 13, 3, 3, 15, 5, 345, 343, 691, 3703, 361, 2019, 9309, 26909, 22897, 103555}}, {20515, 18, 119364, {1, 3, 1, 11, 9, 25, 123, 235, 131, 469, 1749, 3681, 3841, 10157, 15183, 61413, 42207, 170359}}, {20516, 18, 119373, {1, 1, 7, 3, 13, 9, 7, 191, 239, 417, 817, 1381, 1179, 2719, 21025, 17429, 50295, 196485}}, {20517, 18, 119382, {1, 1, 7, 9, 9, 31, 123, 229, 381, 569, 513, 1617, 6141, 9717, 31769, 30159, 113697, 254237}}, {20518, 18, 119410, {1, 1, 1, 15, 31, 43, 37, 17, 283, 905, 297, 1317, 1883, 11313, 5653, 55655, 121029, 149831}}, {20519, 18, 119425, {1, 1, 1, 7, 7, 47, 83, 101, 497, 465, 1133, 3877, 5371, 3355, 17161, 50185, 120837, 255103}}, {20520, 18, 119459, {1, 1, 3, 5, 5, 19, 3, 251, 433, 303, 1193, 1263, 2139, 473, 10725, 57725, 111411, 133687}}, {20521, 18, 119473, {1, 1, 1, 7, 3, 1, 99, 115, 481, 395, 115, 1699, 953, 2807, 7227, 52781, 2855, 161159}}, {20522, 18, 119486, {1, 1, 5, 9, 25, 25, 85, 3, 451, 847, 837, 3669, 4717, 3661, 29111, 43735, 49445, 100379}}, {20523, 18, 119500, {1, 1, 7, 9, 19, 61, 67, 123, 195, 483, 1741, 2719, 7809, 5035, 30689, 21325, 56191, 46127}}, {20524, 18, 119508, {1, 1, 3, 11, 15, 39, 101, 27, 103, 807, 1557, 1647, 1285, 16169, 20203, 57153, 60749, 71361}}, {20525, 18, 119511, {1, 3, 3, 3, 19, 1, 93, 31, 105, 925, 689, 3061, 7451, 12667, 27179, 36295, 61011, 90321}}, {20526, 18, 119517, {1, 3, 7, 15, 19, 35, 47, 241, 261, 935, 1033, 751, 6519, 6911, 13519, 2539, 40285, 81535}}, {20527, 18, 119528, {1, 1, 7, 13, 17, 31, 71, 135, 167, 5, 673, 2909, 4377, 3453, 31289, 38081, 21993, 192933}}, {20528, 18, 119533, {1, 1, 5, 15, 23, 49, 85, 127, 13, 849, 1661, 2099, 3479, 3613, 21723, 58147, 56321, 203171}}, {20529, 18, 119539, {1, 1, 7, 15, 23, 63, 3, 207, 445, 573, 1419, 1161, 2237, 1251, 23387, 65259, 81447, 74555}}, {20530, 18, 119542, {1, 3, 5, 3, 25, 61, 37, 25, 287, 969, 37, 1615, 7923, 4457, 27611, 8519, 113957, 237427}}, {20531, 18, 119546, {1, 3, 5, 11, 11, 25, 117, 169, 149, 701, 139, 2835, 6029, 9067, 841, 51707, 9287, 115825}}, {20532, 18, 119566, {1, 1, 1, 13, 31, 5, 9, 5, 313, 1023, 551, 3635, 6765, 13379, 29135, 39737, 80913, 256355}}, {20533, 18, 119587, {1, 3, 1, 13, 9, 23, 105, 117, 181, 211, 755, 555, 2763, 13965, 14743, 63725, 16377, 203435}}, {20534, 18, 119590, {1, 3, 1, 15, 11, 45, 111, 147, 471, 321, 381, 2921, 6423, 629, 25117, 51213, 126941, 181931}}, {20535, 18, 119607, {1, 1, 1, 11, 1, 49, 127, 105, 315, 1, 859, 1223, 5967, 2521, 14491, 58399, 45155, 192567}}, {20536, 18, 119614, {1, 1, 3, 9, 19, 21, 73, 93, 95, 307, 293, 3243, 4765, 2253, 16775, 29861, 3785, 90357}}, {20537, 18, 119625, {1, 1, 3, 7, 3, 53, 33, 167, 165, 509, 1133, 169, 6951, 7715, 26317, 5249, 86235, 39649}}, {20538, 18, 119633, {1, 1, 5, 5, 3, 47, 105, 89, 201, 1003, 877, 635, 2225, 6391, 21247, 5707, 1233, 87055}}, {20539, 18, 119634, {1, 1, 1, 1, 9, 39, 61, 201, 435, 843, 1245, 533, 1757, 1117, 19687, 54817, 32495, 228865}}, {20540, 18, 119643, {1, 3, 1, 1, 3, 61, 63, 117, 143, 217, 435, 1977, 2647, 7631, 12969, 50211, 26483, 256329}}, {20541, 18, 119683, {1, 3, 3, 9, 21, 25, 113, 243, 457, 143, 833, 1505, 3071, 1845, 17867, 58205, 103819, 185215}}, {20542, 18, 119704, {1, 1, 5, 7, 23, 51, 11, 117, 195, 535, 685, 31, 3037, 9719, 22811, 42959, 21021, 126297}}, {20543, 18, 119710, {1, 3, 3, 1, 1, 17, 107, 245, 257, 547, 887, 45, 5243, 2439, 22191, 19503, 2143, 75187}}, {20544, 18, 119734, {1, 3, 7, 9, 11, 27, 123, 197, 353, 151, 1115, 403, 1105, 7425, 7463, 42065, 116187, 154537}}, {20545, 18, 119752, {1, 3, 5, 15, 23, 5, 49, 177, 223, 615, 1255, 2081, 321, 8733, 19549, 53027, 275, 62739}}, {20546, 18, 119760, {1, 3, 7, 1, 17, 61, 3, 233, 249, 763, 369, 555, 1621, 7221, 22575, 13295, 99793, 233635}}, {20547, 18, 119826, {1, 1, 3, 1, 27, 41, 125, 113, 47, 583, 543, 453, 1213, 14187, 1645, 35761, 110051, 197081}}, {20548, 18, 119922, {1, 1, 7, 9, 29, 43, 105, 125, 489, 135, 153, 2279, 4079, 6731, 12055, 60181, 82563, 173991}}, {20549, 18, 119931, {1, 3, 7, 3, 29, 1, 67, 151, 127, 625, 113, 2127, 6723, 12359, 28609, 60605, 20375, 120129}}, {20550, 18, 119977, {1, 1, 5, 7, 9, 13, 27, 171, 129, 199, 303, 4045, 2047, 8887, 22233, 57571, 40545, 36479}}, {20551, 18, 120015, {1, 3, 1, 7, 1, 5, 127, 203, 213, 691, 1155, 27, 5409, 13519, 6747, 42371, 37089, 145855}}, {20552, 18, 120020, {1, 3, 3, 9, 3, 33, 119, 25, 337, 715, 1093, 987, 7157, 14975, 28595, 19021, 1243, 148707}}, {20553, 18, 120083, {1, 3, 1, 13, 3, 41, 81, 151, 23, 787, 181, 2357, 5077, 1997, 6451, 25505, 44875, 198341}}, {20554, 18, 120086, {1, 1, 7, 3, 5, 15, 9, 169, 337, 487, 1325, 1505, 465, 2339, 20747, 8269, 96875, 108985}}, {20555, 18, 120101, {1, 3, 1, 7, 23, 7, 113, 181, 25, 989, 1649, 1, 823, 6793, 18729, 3599, 97951, 239609}}, {20556, 18, 120105, {1, 3, 7, 7, 3, 63, 63, 207, 419, 355, 1133, 2979, 2071, 11699, 32565, 61347, 106475, 16893}}, {20557, 18, 120155, {1, 1, 7, 5, 7, 3, 119, 133, 189, 341, 1571, 1559, 4309, 16203, 22459, 21019, 80375, 3453}}, {20558, 18, 120188, {1, 1, 3, 11, 21, 21, 45, 69, 485, 21, 727, 703, 5209, 14745, 3437, 54603, 104357, 151207}}, {20559, 18, 120195, {1, 3, 7, 5, 25, 17, 13, 147, 329, 93, 121, 315, 2779, 6921, 425, 50441, 1133, 252291}}, {20560, 18, 120216, {1, 1, 3, 5, 5, 51, 15, 135, 323, 841, 409, 1067, 3243, 4207, 6833, 59329, 90545, 116661}}, {20561, 18, 120228, {1, 1, 3, 15, 25, 7, 43, 147, 153, 947, 79, 1897, 4519, 14441, 27181, 38517, 71673, 158597}}, {20562, 18, 120238, {1, 3, 3, 3, 3, 47, 109, 111, 273, 271, 741, 3999, 649, 7367, 14933, 11785, 92709, 133815}}, {20563, 18, 120255, {1, 1, 3, 13, 5, 41, 55, 15, 409, 355, 1255, 3043, 7503, 3523, 4261, 48927, 119901, 149411}}, {20564, 18, 120317, {1, 1, 5, 1, 11, 57, 3, 149, 409, 287, 909, 3541, 4243, 4485, 3611, 63213, 102575, 49863}}, {20565, 18, 120327, {1, 1, 3, 7, 15, 55, 119, 185, 511, 301, 237, 3701, 3195, 1323, 27511, 44635, 45363, 117683}}, {20566, 18, 120369, {1, 3, 3, 11, 3, 61, 125, 15, 235, 819, 467, 1097, 1055, 16343, 8329, 37807, 38663, 145625}}, {20567, 18, 120382, {1, 1, 7, 1, 25, 49, 117, 163, 413, 509, 63, 1313, 5113, 6505, 25475, 12059, 88021, 168037}}, {20568, 18, 120404, {1, 3, 3, 9, 9, 37, 15, 185, 359, 231, 1483, 2999, 773, 10375, 27103, 39899, 100187, 54485}}, {20569, 18, 120414, {1, 3, 3, 1, 13, 63, 111, 79, 133, 425, 1491, 3735, 533, 13417, 5161, 11455, 16907, 132267}}, {20570, 18, 120432, {1, 3, 1, 15, 15, 47, 57, 157, 453, 681, 1811, 1685, 4329, 131, 22763, 1017, 66637, 1673}}, {20571, 18, 120435, {1, 3, 7, 3, 31, 5, 105, 101, 431, 983, 1333, 845, 7369, 15041, 6527, 8617, 61911, 137513}}, {20572, 18, 120454, {1, 3, 7, 15, 3, 45, 57, 23, 393, 495, 769, 215, 3611, 12907, 20637, 52997, 88345, 37961}}, {20573, 18, 120463, {1, 3, 5, 7, 31, 3, 85, 249, 353, 559, 1803, 959, 4625, 9413, 22339, 6071, 124765, 43973}}, {20574, 18, 120471, {1, 3, 1, 9, 31, 15, 109, 197, 179, 293, 457, 709, 627, 7743, 1997, 59625, 36919, 252849}}, {20575, 18, 120505, {1, 1, 7, 11, 17, 21, 89, 11, 431, 617, 1029, 2649, 1725, 2723, 18367, 46103, 108063, 221855}}, {20576, 18, 120528, {1, 3, 7, 1, 29, 7, 81, 187, 353, 807, 965, 3655, 3255, 9139, 28619, 32127, 107901, 139099}}, {20577, 18, 120588, {1, 1, 5, 3, 17, 9, 39, 59, 431, 829, 525, 1885, 2387, 13381, 5271, 29739, 80413, 240595}}, {20578, 18, 120616, {1, 3, 1, 5, 1, 5, 25, 9, 193, 971, 681, 2921, 3271, 3891, 20123, 37477, 33141, 82481}}, {20579, 18, 120630, {1, 1, 3, 5, 1, 63, 77, 93, 63, 399, 1945, 387, 5457, 7339, 13279, 34119, 129903, 12621}}, {20580, 18, 120644, {1, 3, 3, 11, 17, 11, 117, 189, 473, 23, 13, 1261, 2153, 12181, 21075, 33179, 43355, 168293}}, {20581, 18, 120672, {1, 3, 5, 11, 21, 13, 73, 227, 211, 939, 885, 2091, 1123, 14809, 15705, 56675, 58087, 1451}}, {20582, 18, 120677, {1, 3, 7, 1, 15, 15, 101, 235, 287, 675, 1741, 3885, 6211, 14817, 10235, 29289, 60401, 27639}}, {20583, 18, 120718, {1, 3, 5, 13, 13, 7, 117, 31, 143, 505, 1823, 2841, 2133, 7305, 14093, 14229, 85179, 136793}}, {20584, 18, 120725, {1, 1, 3, 15, 27, 15, 67, 237, 315, 793, 207, 3781, 5201, 13191, 9601, 44041, 116097, 178543}}, {20585, 18, 120730, {1, 3, 1, 9, 9, 47, 53, 225, 109, 831, 1757, 349, 6353, 15417, 16395, 36295, 10901, 122349}}, {20586, 18, 120756, {1, 1, 1, 1, 1, 17, 109, 13, 123, 537, 1859, 3717, 4441, 4271, 29017, 13601, 18533, 216695}}, {20587, 18, 120759, {1, 3, 3, 13, 31, 23, 45, 233, 29, 295, 761, 757, 777, 3499, 26715, 24153, 113777, 256337}}, {20588, 18, 120765, {1, 3, 5, 7, 23, 57, 37, 179, 511, 897, 2031, 1285, 3957, 15085, 19993, 28819, 39959, 187445}}, {20589, 18, 120795, {1, 3, 1, 15, 25, 41, 121, 227, 433, 859, 357, 3107, 3241, 879, 10763, 59473, 73145, 258493}}, {20590, 18, 120821, {1, 3, 3, 5, 13, 9, 85, 117, 347, 161, 995, 549, 5443, 9057, 28931, 57549, 27523, 54717}}, {20591, 18, 120850, {1, 1, 5, 13, 13, 33, 97, 37, 55, 367, 403, 2361, 5717, 4433, 26921, 14227, 69445, 100337}}, {20592, 18, 120868, {1, 3, 5, 7, 1, 41, 89, 165, 163, 1, 685, 3577, 1079, 1057, 125, 35853, 8387, 113035}}, {20593, 18, 120880, {1, 3, 3, 13, 3, 59, 119, 51, 325, 205, 821, 1417, 2097, 13725, 31785, 53803, 15737, 2013}}, {20594, 18, 120885, {1, 3, 7, 7, 1, 45, 95, 221, 249, 65, 1479, 2163, 5761, 15321, 8013, 25771, 110897, 214127}}, {20595, 18, 120892, {1, 3, 3, 5, 25, 11, 27, 29, 95, 955, 1989, 3775, 609, 7073, 4571, 38857, 92205, 156209}}, {20596, 18, 120897, {1, 3, 1, 13, 29, 57, 97, 47, 499, 641, 587, 2125, 2257, 13911, 13993, 1715, 46233, 181279}}, {20597, 18, 120912, {1, 1, 7, 13, 7, 55, 69, 235, 379, 269, 1969, 2733, 3677, 1707, 26999, 64041, 98111, 138691}}, {20598, 18, 120934, {1, 1, 3, 5, 27, 63, 65, 251, 413, 903, 1307, 2941, 5649, 11271, 1935, 49389, 37995, 218197}}, {20599, 18, 120991, {1, 3, 3, 13, 7, 1, 45, 225, 13, 169, 581, 1657, 117, 10251, 23435, 40379, 127085, 88185}}, {20600, 18, 121004, {1, 1, 7, 5, 21, 63, 69, 37, 459, 115, 1403, 1939, 6437, 13149, 3597, 50115, 129075, 260613}}, {20601, 18, 121021, {1, 1, 3, 5, 29, 57, 15, 223, 131, 907, 1561, 1103, 4355, 2763, 6359, 55401, 1751, 53143}}, {20602, 18, 121022, {1, 1, 7, 11, 15, 5, 17, 159, 505, 407, 1873, 2501, 2203, 12559, 5123, 53281, 29307, 16215}}, {20603, 18, 121036, {1, 1, 1, 15, 9, 41, 77, 145, 325, 529, 1939, 3835, 3109, 12215, 18323, 2551, 89793, 94745}}, {20604, 18, 121041, {1, 3, 1, 9, 21, 5, 7, 57, 99, 1005, 1211, 4063, 6851, 7653, 29283, 15463, 121289, 187055}}, {20605, 18, 121069, {1, 1, 3, 3, 13, 11, 17, 125, 173, 283, 1419, 2533, 6875, 16031, 26633, 51027, 27343, 74257}}, {20606, 18, 121078, {1, 1, 3, 11, 29, 49, 87, 19, 367, 941, 983, 1041, 8099, 8735, 30123, 62665, 87051, 98745}}, {20607, 18, 121126, {1, 1, 1, 15, 25, 57, 97, 177, 467, 181, 923, 3833, 5405, 14335, 23495, 48323, 70331, 136825}}, {20608, 18, 121135, {1, 1, 1, 13, 21, 17, 29, 237, 305, 117, 1077, 2999, 1879, 6875, 19321, 10999, 130513, 160883}}, {20609, 18, 121138, {1, 3, 7, 15, 19, 47, 89, 153, 287, 7, 1429, 1507, 2853, 4197, 11195, 33891, 59063, 189601}}, {20610, 18, 121162, {1, 1, 3, 15, 31, 5, 113, 71, 13, 925, 147, 451, 5701, 13671, 13943, 13799, 59627, 115715}}, {20611, 18, 121176, {1, 1, 1, 5, 13, 25, 51, 11, 409, 393, 1479, 2583, 3101, 303, 17609, 10653, 69107, 150459}}, {20612, 18, 121186, {1, 1, 5, 7, 21, 27, 107, 77, 61, 467, 1723, 1247, 287, 1039, 25347, 18111, 24837, 42903}}, {20613, 18, 121209, {1, 3, 5, 5, 1, 29, 57, 177, 311, 9, 819, 3235, 3887, 9679, 11849, 31755, 68467, 135587}}, {20614, 18, 121212, {1, 1, 5, 5, 29, 15, 13, 69, 163, 709, 1405, 3835, 777, 7567, 10153, 5043, 129465, 59113}}, {20615, 18, 121221, {1, 1, 1, 13, 3, 47, 97, 101, 179, 53, 1919, 17, 3597, 11769, 17971, 39257, 76167, 255653}}, {20616, 18, 121225, {1, 1, 7, 5, 1, 45, 121, 223, 299, 271, 1857, 1955, 5509, 1245, 9519, 60547, 78497, 191251}}, {20617, 18, 121228, {1, 1, 1, 11, 5, 57, 87, 113, 59, 547, 1591, 1905, 475, 4687, 27591, 43807, 9617, 70769}}, {20618, 18, 121239, {1, 1, 7, 1, 1, 35, 35, 11, 107, 401, 827, 2271, 2131, 12751, 25771, 51311, 46897, 198655}}, {20619, 18, 121245, {1, 3, 3, 3, 15, 29, 91, 147, 9, 611, 1739, 3211, 3883, 14205, 24073, 37445, 54451, 208123}}, {20620, 18, 121264, {1, 3, 7, 1, 25, 53, 33, 161, 365, 651, 1263, 1623, 1767, 3789, 18013, 52133, 60119, 100859}}, {20621, 18, 121270, {1, 3, 5, 9, 15, 9, 97, 67, 379, 981, 1323, 1095, 3701, 3257, 13647, 12511, 53375, 156689}}, {20622, 18, 121299, {1, 1, 3, 5, 9, 23, 97, 239, 171, 501, 1549, 1029, 8019, 5023, 9439, 14223, 54433, 152855}}, {20623, 18, 121306, {1, 1, 7, 13, 17, 35, 111, 169, 81, 599, 1673, 3461, 7905, 7925, 16311, 20327, 57109, 158719}}, {20624, 18, 121315, {1, 1, 3, 15, 7, 33, 23, 33, 273, 987, 1489, 363, 4017, 8919, 28839, 10143, 114179, 218155}}, {20625, 18, 121317, {1, 3, 5, 13, 29, 5, 61, 133, 65, 933, 509, 551, 7365, 3703, 15003, 27849, 64211, 140383}}, {20626, 18, 121321, {1, 1, 1, 13, 7, 25, 49, 1, 269, 601, 251, 33, 2443, 13725, 5805, 63347, 109489, 111491}}, {20627, 18, 121324, {1, 1, 7, 9, 31, 23, 117, 71, 371, 733, 605, 4019, 4577, 3887, 31061, 24939, 57905, 148331}}, {20628, 18, 121330, {1, 3, 5, 1, 3, 35, 35, 227, 355, 27, 1673, 2173, 5001, 14613, 6343, 40775, 72349, 101287}}, {20629, 18, 121339, {1, 1, 7, 15, 29, 3, 43, 77, 43, 51, 1495, 2577, 2093, 7515, 20151, 44533, 32223, 6355}}, {20630, 18, 121346, {1, 1, 5, 5, 11, 47, 91, 221, 35, 969, 343, 3287, 857, 4851, 12599, 939, 53615, 262125}}, {20631, 18, 121370, {1, 1, 5, 7, 29, 11, 67, 155, 317, 629, 211, 583, 1061, 13243, 13999, 45405, 18187, 99021}}, {20632, 18, 121372, {1, 3, 7, 13, 3, 39, 5, 207, 175, 515, 1181, 739, 379, 9919, 12079, 18903, 62475, 239383}}, {20633, 18, 121393, {1, 1, 1, 15, 25, 15, 113, 215, 281, 861, 1055, 2577, 5545, 12365, 16097, 35775, 8331, 119353}}, {20634, 18, 121396, {1, 1, 1, 1, 25, 55, 111, 185, 485, 361, 155, 4077, 5517, 16057, 19069, 40129, 38959, 211233}}, {20635, 18, 121414, {1, 1, 3, 3, 13, 1, 93, 129, 243, 813, 115, 177, 53, 8251, 32351, 63847, 54537, 25527}}, {20636, 18, 121442, {1, 3, 5, 11, 25, 47, 113, 69, 285, 451, 2011, 81, 6535, 3409, 8647, 56575, 975, 149571}}, {20637, 18, 121475, {1, 1, 7, 7, 19, 1, 75, 123, 413, 697, 41, 3179, 4075, 15967, 2477, 17549, 54193, 258657}}, {20638, 18, 121499, {1, 1, 5, 5, 11, 23, 19, 253, 303, 255, 901, 875, 1517, 6953, 25189, 26763, 28843, 167705}}, {20639, 18, 121512, {1, 3, 7, 7, 17, 45, 31, 79, 279, 965, 1869, 1201, 1627, 14035, 11651, 45021, 76171, 49137}}, {20640, 18, 121518, {1, 3, 1, 15, 9, 55, 83, 59, 437, 915, 1667, 89, 2797, 1841, 29261, 23497, 55785, 102265}}, {20641, 18, 121588, {1, 1, 5, 5, 3, 59, 17, 131, 199, 541, 1647, 2175, 4449, 6081, 10609, 39467, 72945, 32423}}, {20642, 18, 121597, {1, 3, 1, 7, 5, 7, 85, 11, 255, 397, 87, 1661, 6523, 5699, 29407, 28015, 50783, 246625}}, {20643, 18, 121612, {1, 3, 3, 13, 5, 61, 123, 147, 295, 37, 301, 2549, 7615, 5725, 32477, 18121, 69353, 242579}}, {20644, 18, 121629, {1, 3, 5, 7, 9, 45, 83, 211, 475, 281, 743, 3955, 7811, 6043, 30547, 5315, 53345, 25775}}, {20645, 18, 121630, {1, 3, 3, 5, 7, 63, 125, 43, 131, 353, 345, 1689, 5483, 5467, 13445, 13041, 68381, 134567}}, {20646, 18, 121634, {1, 3, 5, 11, 31, 9, 123, 53, 237, 911, 349, 3737, 1867, 7375, 3031, 4191, 8697, 182255}}, {20647, 18, 121680, {1, 1, 3, 3, 11, 11, 89, 251, 69, 93, 1241, 1719, 2227, 1793, 21683, 58099, 110831, 24835}}, {20648, 18, 121725, {1, 1, 5, 9, 3, 57, 3, 17, 11, 217, 923, 3623, 727, 1837, 21203, 63007, 33691, 216259}}, {20649, 18, 121798, {1, 3, 3, 9, 21, 25, 83, 115, 325, 921, 811, 303, 3555, 10669, 5837, 45585, 61923, 159061}}, {20650, 18, 121815, {1, 3, 3, 15, 17, 29, 77, 75, 509, 363, 199, 317, 7375, 11971, 15679, 17135, 101925, 103375}}, {20651, 18, 121822, {1, 3, 5, 5, 29, 45, 85, 151, 73, 329, 911, 3055, 2381, 4717, 5133, 58987, 59885, 226689}}, {20652, 18, 121837, {1, 3, 5, 1, 11, 59, 17, 83, 385, 867, 215, 2275, 7247, 10613, 6493, 63843, 74483, 134271}}, {20653, 18, 121840, {1, 1, 7, 13, 29, 25, 77, 61, 281, 439, 353, 2213, 697, 14741, 1597, 7515, 7703, 149123}}, {20654, 18, 121869, {1, 3, 7, 7, 7, 53, 77, 21, 483, 793, 969, 123, 3581, 12489, 22943, 54573, 25785, 178419}}, {20655, 18, 121878, {1, 3, 5, 3, 17, 59, 75, 55, 125, 569, 1625, 77, 4593, 8493, 5259, 54537, 100479, 107509}}, {20656, 18, 121897, {1, 1, 1, 15, 5, 7, 11, 169, 349, 133, 1113, 2877, 6109, 16275, 9755, 1385, 55005, 36095}}, {20657, 18, 121920, {1, 1, 7, 7, 21, 25, 41, 161, 11, 321, 343, 705, 4601, 12867, 21997, 25283, 78467, 159089}}, {20658, 18, 121929, {1, 3, 7, 1, 15, 3, 71, 227, 427, 883, 1021, 1405, 7791, 12669, 9159, 30931, 105993, 40917}}, {20659, 18, 121944, {1, 1, 5, 5, 25, 41, 93, 57, 125, 915, 701, 2589, 7147, 15369, 28307, 54635, 13253, 97177}}, {20660, 18, 121999, {1, 3, 1, 13, 11, 63, 103, 241, 317, 927, 965, 3179, 5213, 13849, 11509, 52665, 1637, 235647}}, {20661, 18, 122008, {1, 3, 5, 3, 31, 31, 111, 9, 339, 1017, 1715, 101, 6849, 14329, 31607, 40741, 73067, 119001}}, {20662, 18, 122056, {1, 3, 1, 13, 3, 55, 53, 15, 185, 717, 1447, 3029, 4899, 14217, 19949, 32817, 24829, 206829}}, {20663, 18, 122062, {1, 3, 7, 9, 21, 11, 33, 213, 5, 769, 1807, 2179, 63, 5167, 23235, 25495, 113299, 129419}}, {20664, 18, 122067, {1, 3, 7, 11, 11, 33, 23, 125, 21, 609, 595, 1329, 6175, 15837, 3889, 57797, 81453, 211413}}, {20665, 18, 122083, {1, 1, 5, 11, 31, 7, 13, 73, 143, 559, 1541, 275, 3349, 2987, 21797, 32921, 125395, 247667}}, {20666, 18, 122095, {1, 1, 3, 11, 19, 1, 23, 167, 337, 75, 1597, 3591, 2705, 7323, 5957, 7317, 58945, 44625}}, {20667, 18, 122110, {1, 1, 5, 11, 27, 19, 63, 231, 353, 645, 531, 3861, 1681, 6901, 16217, 20639, 70077, 220233}}, {20668, 18, 122118, {1, 1, 5, 15, 31, 41, 19, 253, 147, 365, 509, 1199, 6699, 14633, 1339, 48203, 58707, 83315}}, {20669, 18, 122127, {1, 1, 5, 7, 19, 47, 47, 17, 267, 139, 549, 803, 4625, 6851, 32141, 12891, 43785, 211361}}, {20670, 18, 122189, {1, 3, 1, 13, 19, 35, 13, 45, 167, 627, 1449, 3041, 5043, 9279, 15889, 41675, 25769, 13835}}, {20671, 18, 122207, {1, 3, 7, 7, 19, 47, 13, 117, 403, 79, 1623, 3741, 3255, 2301, 25, 2311, 5237, 150879}}, {20672, 18, 122226, {1, 1, 1, 15, 29, 43, 75, 21, 237, 809, 129, 2637, 181, 15921, 30709, 61281, 82405, 232885}}, {20673, 18, 122253, {1, 1, 3, 15, 15, 15, 55, 217, 243, 579, 945, 3993, 1875, 2425, 25045, 36729, 42935, 213703}}, {20674, 18, 122301, {1, 3, 3, 1, 5, 59, 115, 71, 483, 327, 701, 2893, 1815, 4611, 3843, 5893, 126479, 167807}}, {20675, 18, 122324, {1, 3, 1, 7, 17, 59, 115, 191, 3, 615, 215, 2121, 5085, 15233, 16661, 6215, 31061, 192847}}, {20676, 18, 122337, {1, 3, 1, 1, 21, 25, 41, 195, 151, 905, 1587, 439, 3317, 2275, 4743, 33505, 1185, 254873}}, {20677, 18, 122362, {1, 1, 3, 9, 11, 49, 37, 117, 419, 1007, 789, 1323, 345, 2047, 20697, 57063, 69167, 219393}}, {20678, 18, 122368, {1, 3, 1, 1, 25, 49, 81, 79, 117, 1015, 1777, 2427, 527, 10139, 16261, 42587, 33933, 19749}}, {20679, 18, 122371, {1, 1, 5, 15, 31, 43, 19, 17, 97, 591, 891, 177, 7835, 3979, 15473, 2173, 65555, 182773}}, {20680, 18, 122378, {1, 1, 3, 15, 13, 53, 31, 179, 247, 635, 683, 423, 2981, 14401, 26385, 10935, 68497, 181703}}, {20681, 18, 122404, {1, 3, 3, 9, 25, 55, 43, 29, 487, 969, 989, 3561, 6425, 11619, 5773, 56515, 17461, 151239}}, {20682, 18, 122443, {1, 1, 5, 13, 3, 31, 73, 51, 213, 215, 297, 783, 697, 14197, 7277, 60697, 985, 189995}}, {20683, 18, 122451, {1, 3, 3, 5, 9, 47, 69, 27, 15, 407, 1029, 2541, 183, 4413, 5143, 33903, 49509, 49007}}, {20684, 18, 122457, {1, 1, 1, 3, 5, 3, 9, 165, 215, 577, 1657, 363, 737, 5483, 5955, 34533, 45861, 104645}}, {20685, 18, 122458, {1, 1, 5, 7, 31, 27, 37, 215, 125, 915, 1297, 3095, 1529, 12737, 25675, 29355, 83939, 106765}}, {20686, 18, 122479, {1, 1, 3, 3, 1, 49, 29, 115, 395, 647, 147, 3905, 1025, 8873, 10587, 25471, 72089, 171467}}, {20687, 18, 122484, {1, 3, 7, 1, 21, 55, 57, 233, 487, 883, 439, 929, 1405, 13709, 2389, 20205, 17579, 9129}}, {20688, 18, 122521, {1, 3, 5, 5, 23, 51, 55, 45, 307, 855, 933, 1443, 4757, 8719, 28401, 35189, 105329, 9211}}, {20689, 18, 122540, {1, 3, 7, 11, 29, 17, 17, 147, 221, 997, 1433, 59, 8027, 231, 30335, 2153, 21393, 116661}}, {20690, 18, 122545, {1, 1, 7, 3, 5, 43, 47, 155, 357, 915, 1923, 3315, 4107, 9785, 4847, 57683, 87569, 179583}}, {20691, 18, 122552, {1, 1, 7, 7, 27, 5, 37, 95, 265, 113, 143, 3755, 5793, 5601, 16621, 54777, 15989, 158933}}, {20692, 18, 122560, {1, 3, 1, 1, 13, 31, 113, 255, 367, 559, 1777, 4065, 8061, 15785, 10345, 54833, 95277, 159347}}, {20693, 18, 122575, {1, 1, 1, 15, 3, 43, 85, 251, 193, 19, 1685, 271, 1779, 11901, 18983, 65361, 128217, 248051}}, {20694, 18, 122578, {1, 3, 5, 7, 29, 21, 5, 47, 263, 913, 83, 3233, 113, 8341, 14473, 37405, 2363, 155931}}, {20695, 18, 122605, {1, 1, 7, 15, 7, 25, 41, 39, 315, 323, 827, 1277, 1211, 4465, 21161, 36865, 6689, 139147}}, {20696, 18, 122661, {1, 1, 1, 9, 11, 45, 81, 235, 31, 247, 77, 1877, 7119, 16007, 2225, 65, 85537, 99251}}, {20697, 18, 122673, {1, 1, 3, 11, 19, 5, 49, 179, 345, 961, 349, 2099, 2317, 12771, 27169, 59389, 116071, 68333}}, {20698, 18, 122722, {1, 3, 3, 5, 15, 53, 47, 177, 103, 941, 87, 2813, 7729, 8003, 7717, 40095, 74569, 106617}}, {20699, 18, 122728, {1, 1, 7, 7, 31, 23, 105, 205, 325, 855, 1529, 3601, 7151, 15827, 16241, 18221, 55771, 139225}}, {20700, 18, 122739, {1, 3, 5, 13, 13, 5, 95, 167, 25, 779, 1147, 221, 5055, 10943, 28077, 15131, 89501, 137407}}, {20701, 18, 122751, {1, 3, 7, 13, 31, 3, 105, 163, 41, 823, 1493, 2985, 5589, 3543, 24683, 34469, 40595, 200875}}, {20702, 18, 122762, {1, 3, 5, 3, 27, 35, 105, 163, 477, 667, 45, 319, 3201, 11535, 19349, 55253, 60275, 209597}}, {20703, 18, 122769, {1, 3, 1, 11, 5, 13, 25, 225, 169, 925, 1617, 537, 891, 5583, 7181, 39953, 97537, 104019}}, {20704, 18, 122772, {1, 3, 5, 9, 13, 1, 69, 147, 465, 259, 1219, 2407, 4015, 4883, 4333, 40441, 31289, 52989}}, {20705, 18, 122782, {1, 3, 5, 5, 17, 29, 105, 233, 307, 807, 1535, 251, 135, 925, 6865, 59739, 112757, 208275}}, {20706, 18, 122798, {1, 1, 1, 7, 9, 21, 49, 247, 33, 127, 1277, 1745, 139, 12165, 23517, 50235, 101003, 109031}}, {20707, 18, 122810, {1, 3, 5, 9, 19, 7, 9, 139, 511, 901, 551, 2717, 6091, 3213, 819, 51381, 108333, 119681}}, {20708, 18, 122812, {1, 1, 1, 3, 19, 17, 73, 19, 313, 589, 1965, 1745, 921, 4237, 12527, 10735, 110139, 171513}}, {20709, 18, 122818, {1, 1, 5, 15, 25, 29, 15, 217, 87, 793, 419, 915, 1359, 10507, 25343, 62977, 100913, 110041}}, {20710, 18, 122829, {1, 3, 7, 15, 15, 15, 91, 243, 441, 437, 1759, 2659, 2319, 7783, 16857, 19051, 15463, 253115}}, {20711, 18, 122851, {1, 1, 5, 13, 15, 5, 7, 165, 355, 559, 217, 235, 3565, 12047, 2387, 62285, 73363, 238551}}, {20712, 18, 122857, {1, 3, 7, 11, 5, 5, 69, 205, 179, 815, 335, 979, 2129, 6221, 31987, 13623, 23103, 24373}}, {20713, 18, 122868, {1, 1, 7, 11, 31, 51, 55, 93, 195, 219, 825, 2919, 4495, 5927, 11813, 16415, 121595, 188613}}, {20714, 18, 122893, {1, 1, 3, 1, 3, 11, 73, 45, 141, 219, 337, 2569, 6549, 3699, 2417, 2945, 19389, 82561}}, {20715, 18, 122894, {1, 3, 1, 13, 5, 47, 47, 81, 11, 57, 1965, 2173, 3209, 10617, 19887, 5571, 61403, 37401}}, {20716, 18, 122902, {1, 3, 3, 7, 3, 5, 99, 253, 287, 655, 813, 3365, 2387, 8951, 1561, 37637, 97625, 148699}}, {20717, 18, 122921, {1, 1, 3, 5, 9, 31, 49, 7, 55, 607, 1489, 3229, 5871, 1271, 22751, 32309, 16125, 93409}}, {20718, 18, 122959, {1, 3, 1, 5, 19, 35, 29, 233, 407, 297, 1465, 3089, 7535, 7221, 24469, 42653, 65719, 196771}}, {20719, 18, 122984, {1, 1, 7, 13, 17, 19, 37, 45, 211, 545, 963, 79, 13, 8319, 8045, 24975, 122749, 25845}}, {20720, 18, 123001, {1, 3, 5, 3, 23, 23, 53, 101, 363, 49, 1351, 3419, 1603, 10795, 5289, 63695, 113911, 228301}}, {20721, 18, 123038, {1, 3, 7, 9, 15, 59, 125, 59, 11, 397, 693, 397, 3829, 14349, 13973, 54739, 22093, 216009}}, {20722, 18, 123076, {1, 1, 1, 13, 5, 63, 21, 23, 421, 35, 589, 803, 6193, 11375, 9501, 34441, 68421, 120109}}, {20723, 18, 123100, {1, 3, 3, 7, 23, 25, 79, 203, 177, 173, 175, 809, 4331, 6953, 4999, 34345, 94481, 88683}}, {20724, 18, 123107, {1, 3, 3, 3, 1, 51, 109, 195, 83, 747, 63, 325, 927, 1757, 32055, 37185, 22697, 41509}}, {20725, 18, 123122, {1, 3, 5, 13, 1, 63, 45, 73, 121, 445, 1935, 3373, 563, 7503, 17941, 60313, 42219, 220917}}, {20726, 18, 123139, {1, 3, 5, 13, 27, 31, 7, 83, 109, 387, 447, 1691, 1301, 7449, 8075, 30713, 87207, 84855}}, {20727, 18, 123175, {1, 3, 1, 5, 25, 51, 83, 11, 261, 977, 1415, 2973, 1789, 12641, 16279, 4225, 44237, 173561}}, {20728, 18, 123190, {1, 1, 5, 15, 17, 47, 105, 199, 83, 705, 1215, 2759, 7509, 10407, 4005, 4575, 65961, 209933}}, {20729, 18, 123201, {1, 3, 1, 13, 27, 3, 5, 199, 405, 515, 291, 3399, 1497, 14755, 30229, 35075, 111585, 16633}}, {20730, 18, 123219, {1, 1, 1, 13, 17, 53, 93, 161, 447, 903, 947, 1871, 3597, 10575, 18389, 48551, 65229, 32591}}, {20731, 18, 123232, {1, 3, 5, 11, 9, 7, 53, 155, 299, 523, 1653, 3517, 2725, 9485, 27099, 47895, 30169, 260463}}, {20732, 18, 123255, {1, 1, 3, 13, 11, 45, 31, 183, 445, 21, 313, 2597, 195, 16053, 7323, 52951, 25919, 9323}}, {20733, 18, 123285, {1, 1, 1, 15, 1, 35, 15, 115, 53, 561, 1141, 3261, 83, 2547, 8925, 43455, 112755, 94157}}, {20734, 18, 123328, {1, 1, 3, 5, 27, 25, 81, 51, 209, 87, 379, 3167, 4953, 13885, 20159, 103, 115363, 123585}}, {20735, 18, 123385, {1, 3, 5, 1, 25, 29, 107, 225, 77, 435, 2009, 4069, 3703, 8855, 14101, 61683, 16993, 110823}}, {20736, 18, 123397, {1, 3, 7, 3, 31, 25, 51, 117, 397, 271, 89, 3571, 2357, 4923, 16303, 2357, 107775, 73809}}, {20737, 18, 123404, {1, 1, 3, 1, 29, 21, 33, 67, 363, 753, 915, 3715, 2013, 8439, 5779, 267, 32687, 104283}}, {20738, 18, 123419, {1, 3, 1, 11, 11, 7, 31, 43, 339, 917, 2005, 759, 4285, 1933, 4341, 19111, 130651, 122853}}, {20739, 18, 123435, {1, 1, 5, 1, 17, 63, 85, 63, 387, 127, 1313, 619, 6525, 9003, 10915, 64507, 13175, 45219}}, {20740, 18, 123437, {1, 3, 7, 9, 25, 15, 43, 13, 411, 391, 571, 527, 8175, 10849, 20093, 2987, 29869, 77207}}, {20741, 18, 123443, {1, 1, 5, 3, 29, 53, 105, 57, 91, 977, 1103, 2977, 5617, 7203, 26717, 28463, 55909, 59943}}, {20742, 18, 123500, {1, 3, 1, 7, 1, 47, 111, 215, 189, 377, 11, 871, 2267, 5705, 8165, 38895, 71025, 10921}}, {20743, 18, 123506, {1, 1, 7, 9, 29, 55, 1, 103, 505, 697, 317, 3209, 3643, 13689, 8499, 14671, 67937, 100467}}, {20744, 18, 123511, {1, 3, 1, 5, 25, 15, 99, 199, 117, 957, 1421, 1719, 5185, 15247, 28615, 2657, 46867, 190135}}, {20745, 18, 123512, {1, 1, 7, 9, 27, 55, 81, 47, 15, 497, 537, 857, 2905, 1909, 3341, 32625, 123189, 21875}}, {20746, 18, 123518, {1, 3, 1, 3, 19, 51, 97, 143, 305, 1021, 543, 829, 7593, 8101, 6337, 4869, 19177, 38981}}, {20747, 18, 123522, {1, 3, 3, 15, 9, 37, 51, 193, 295, 731, 809, 4065, 3377, 15303, 12505, 11327, 76191, 139899}}, {20748, 18, 123545, {1, 1, 5, 1, 3, 19, 5, 223, 379, 7, 755, 1127, 505, 9429, 27409, 50817, 97599, 179019}}, {20749, 18, 123572, {1, 3, 5, 3, 5, 11, 83, 119, 3, 311, 405, 2401, 1821, 1381, 4567, 44079, 61903, 183583}}, {20750, 18, 123587, {1, 3, 7, 9, 7, 11, 107, 95, 271, 537, 335, 3079, 6695, 1163, 32055, 44985, 29075, 94235}}, {20751, 18, 123594, {1, 3, 7, 7, 7, 57, 59, 85, 199, 563, 1835, 351, 7675, 2601, 3717, 57975, 92529, 101511}}, {20752, 18, 123607, {1, 1, 1, 5, 17, 5, 97, 43, 101, 141, 1511, 199, 7157, 3169, 24815, 55653, 104195, 37951}}, {20753, 18, 123608, {1, 1, 1, 11, 23, 29, 41, 47, 447, 583, 773, 859, 1657, 8707, 16709, 53477, 42037, 186809}}, {20754, 18, 123630, {1, 1, 1, 13, 13, 5, 85, 9, 213, 511, 1003, 811, 2271, 14715, 21423, 48127, 50613, 214031}}, {20755, 18, 123635, {1, 1, 3, 5, 7, 31, 87, 101, 297, 853, 1599, 1521, 4965, 9655, 23543, 62277, 11231, 49931}}, {20756, 18, 123659, {1, 1, 7, 7, 19, 31, 9, 165, 207, 919, 739, 3849, 2121, 867, 3233, 40867, 75721, 5327}}, {20757, 18, 123692, {1, 3, 7, 1, 17, 3, 27, 13, 431, 283, 465, 1427, 1937, 15601, 21793, 9315, 54285, 196453}}, {20758, 18, 123695, {1, 1, 7, 3, 17, 39, 65, 137, 511, 19, 1357, 3373, 5227, 2485, 1151, 25061, 117507, 119219}}, {20759, 18, 123700, {1, 3, 3, 9, 9, 23, 13, 235, 505, 625, 115, 3859, 6943, 14719, 6363, 14957, 28241, 187989}}, {20760, 18, 123730, {1, 3, 7, 13, 11, 31, 23, 39, 463, 441, 1145, 417, 4177, 1655, 26491, 16895, 26263, 198157}}, {20761, 18, 123748, {1, 3, 3, 7, 25, 55, 121, 157, 131, 537, 1891, 2367, 1717, 2331, 20251, 8679, 62657, 121957}}, {20762, 18, 123751, {1, 1, 1, 11, 7, 43, 59, 101, 333, 961, 569, 1603, 3009, 6539, 9627, 5759, 44401, 127613}}, {20763, 18, 123770, {1, 3, 3, 3, 1, 27, 15, 135, 235, 215, 627, 2427, 2647, 3201, 22873, 64445, 32635, 16587}}, {20764, 18, 123793, {1, 3, 7, 7, 5, 49, 63, 103, 467, 897, 117, 1149, 6045, 5003, 5005, 6183, 90815, 190909}}, {20765, 18, 123800, {1, 1, 3, 3, 31, 43, 45, 227, 363, 409, 1097, 3155, 1519, 14461, 29377, 19577, 52595, 94041}}, {20766, 18, 123803, {1, 3, 1, 1, 3, 25, 83, 243, 57, 243, 389, 1427, 5197, 13125, 18571, 17845, 74961, 125569}}, {20767, 18, 123851, {1, 3, 5, 5, 1, 39, 11, 175, 97, 1001, 143, 3653, 5887, 5845, 5691, 5433, 62629, 176261}}, {20768, 18, 123859, {1, 1, 1, 13, 11, 41, 41, 155, 17, 823, 1507, 733, 5663, 13657, 24133, 9971, 27179, 108075}}, {20769, 18, 123866, {1, 1, 7, 9, 19, 9, 103, 29, 427, 363, 931, 3959, 1629, 5127, 14807, 61937, 127175, 237233}}, {20770, 18, 123868, {1, 1, 1, 5, 29, 53, 51, 229, 123, 1001, 697, 411, 4669, 5051, 18447, 55437, 129269, 72613}}, {20771, 18, 123877, {1, 3, 7, 3, 19, 53, 111, 131, 255, 547, 653, 2839, 1447, 14397, 5707, 23773, 127897, 135177}}, {20772, 18, 123884, {1, 3, 3, 5, 21, 37, 53, 219, 359, 341, 489, 2477, 3383, 6931, 7753, 2619, 114267, 63271}}, {20773, 18, 123909, {1, 1, 3, 15, 15, 15, 95, 171, 301, 563, 603, 593, 4037, 7305, 10849, 11753, 103087, 74887}}, {20774, 18, 123910, {1, 1, 5, 3, 11, 51, 105, 35, 155, 643, 569, 1697, 1679, 7547, 19289, 7065, 57359, 142855}}, {20775, 18, 123919, {1, 1, 7, 15, 23, 55, 17, 67, 375, 559, 355, 165, 93, 973, 22831, 48027, 98435, 59945}}, {20776, 18, 123927, {1, 3, 7, 3, 5, 43, 9, 253, 111, 819, 45, 3461, 4821, 14735, 14469, 29793, 30681, 26359}}, {20777, 18, 123937, {1, 3, 3, 5, 15, 1, 39, 233, 63, 287, 131, 3453, 427, 4929, 30085, 18583, 50119, 262101}}, {20778, 18, 123950, {1, 3, 7, 9, 31, 7, 127, 157, 287, 57, 1091, 1989, 5045, 13071, 27705, 58125, 85317, 66649}}, {20779, 18, 123957, {1, 1, 1, 15, 17, 29, 25, 223, 311, 489, 1901, 3197, 1813, 10097, 31915, 54871, 32289, 227001}}, {20780, 18, 123979, {1, 3, 7, 5, 31, 35, 69, 87, 131, 963, 1125, 1109, 8037, 3257, 27655, 50999, 3715, 57851}}, {20781, 18, 123996, {1, 1, 5, 5, 27, 7, 119, 29, 425, 721, 541, 3069, 3349, 13623, 12293, 51395, 14033, 61545}}, {20782, 18, 124040, {1, 3, 7, 3, 17, 49, 103, 115, 387, 729, 1389, 2257, 3273, 3375, 23143, 2835, 28071, 79533}}, {20783, 18, 124054, {1, 1, 3, 7, 9, 19, 55, 159, 261, 467, 17, 2595, 3947, 7045, 193, 23629, 89067, 81197}}, {20784, 18, 124063, {1, 1, 1, 15, 13, 39, 103, 195, 251, 769, 1003, 2707, 3263, 8451, 8007, 53789, 112653, 258717}}, {20785, 18, 124067, {1, 3, 5, 1, 3, 21, 29, 217, 125, 779, 1597, 513, 2677, 3979, 31903, 64813, 69963, 92887}}, {20786, 18, 124088, {1, 1, 3, 11, 11, 59, 81, 237, 447, 703, 41, 3369, 3547, 14935, 31693, 52005, 74149, 131039}}, {20787, 18, 124101, {1, 1, 3, 1, 23, 1, 33, 93, 275, 847, 921, 2745, 533, 8975, 30529, 46809, 98975, 75541}}, {20788, 18, 124154, {1, 1, 7, 7, 15, 1, 3, 213, 71, 1009, 1951, 3015, 713, 9365, 21949, 60983, 117633, 225387}}, {20789, 18, 124162, {1, 1, 1, 11, 31, 27, 59, 179, 231, 635, 1555, 2765, 31, 15065, 22719, 59251, 84733, 96769}}, {20790, 18, 124167, {1, 3, 7, 3, 19, 5, 35, 207, 317, 735, 943, 3987, 4021, 11229, 13015, 713, 125167, 55887}}, {20791, 18, 124176, {1, 1, 3, 1, 27, 49, 81, 17, 253, 633, 43, 2953, 3151, 8429, 30625, 28551, 126683, 175087}}, {20792, 18, 124195, {1, 3, 3, 3, 9, 53, 111, 245, 57, 557, 945, 2957, 7669, 12537, 17291, 9713, 87727, 44739}}, {20793, 18, 124230, {1, 3, 1, 1, 5, 39, 77, 127, 87, 687, 1485, 1555, 2567, 13551, 17075, 24003, 47627, 129813}}, {20794, 18, 124267, {1, 3, 5, 9, 25, 35, 87, 233, 439, 563, 1719, 419, 4459, 4285, 25157, 943, 111543, 232107}}, {20795, 18, 124346, {1, 3, 5, 11, 1, 13, 97, 153, 459, 551, 73, 2087, 3985, 4661, 15603, 22211, 123163, 187233}}, {20796, 18, 124389, {1, 1, 7, 13, 17, 59, 5, 219, 353, 441, 387, 441, 3009, 485, 20081, 38023, 50659, 159243}}, {20797, 18, 124418, {1, 3, 1, 7, 21, 31, 117, 49, 227, 677, 417, 1153, 1611, 1669, 25161, 52223, 15109, 114759}}, {20798, 18, 124420, {1, 1, 7, 9, 19, 13, 111, 7, 1, 701, 731, 2075, 685, 15679, 19149, 44315, 41719, 243975}}, {20799, 18, 124454, {1, 3, 3, 7, 15, 63, 59, 105, 327, 39, 1497, 2407, 2865, 7065, 9957, 20031, 45359, 73657}}, {20800, 18, 124490, {1, 3, 1, 13, 7, 3, 55, 221, 443, 953, 15, 2455, 4681, 16247, 18179, 44731, 41323, 172621}}, {20801, 18, 124503, {1, 1, 3, 9, 1, 27, 65, 167, 115, 137, 819, 2129, 3393, 5901, 11735, 62753, 14941, 21425}}, {20802, 18, 124519, {1, 3, 7, 11, 7, 9, 41, 175, 237, 481, 59, 265, 2135, 9419, 3937, 55959, 48343, 172549}}, {20803, 18, 124533, {1, 1, 1, 13, 23, 33, 105, 87, 461, 297, 1345, 3715, 7715, 16369, 19017, 15141, 10873, 109641}}, {20804, 18, 124544, {1, 3, 5, 1, 11, 1, 13, 41, 447, 511, 447, 2295, 2401, 14171, 16269, 50453, 40361, 205857}}, {20805, 18, 124589, {1, 1, 3, 3, 27, 7, 35, 193, 113, 341, 335, 2113, 343, 4575, 20863, 40383, 86787, 142603}}, {20806, 18, 124616, {1, 1, 7, 11, 17, 25, 51, 89, 341, 237, 1233, 1505, 7401, 6887, 26897, 20127, 51077, 107559}}, {20807, 18, 124630, {1, 1, 1, 15, 9, 59, 29, 115, 339, 785, 201, 947, 1501, 6883, 169, 44059, 17527, 197623}}, {20808, 18, 124636, {1, 3, 7, 3, 17, 59, 15, 5, 379, 347, 821, 4047, 3565, 13689, 23275, 27901, 121401, 43077}}, {20809, 18, 124645, {1, 1, 1, 7, 15, 11, 35, 29, 59, 99, 181, 3035, 3239, 1553, 32319, 64195, 115247, 149211}}, {20810, 18, 124652, {1, 1, 5, 3, 31, 49, 87, 177, 231, 167, 373, 1125, 5919, 4805, 31983, 42873, 30169, 91853}}, {20811, 18, 124663, {1, 1, 5, 15, 7, 63, 37, 15, 459, 449, 1835, 1769, 2527, 2577, 4251, 62459, 76699, 81721}}, {20812, 18, 124667, {1, 1, 1, 3, 21, 15, 19, 183, 423, 827, 341, 2101, 3797, 7103, 30845, 24511, 115337, 117019}}, {20813, 18, 124690, {1, 3, 5, 5, 19, 1, 97, 13, 491, 51, 445, 1987, 7481, 2613, 23141, 36603, 26917, 177397}}, {20814, 18, 124755, {1, 1, 1, 5, 15, 43, 21, 167, 259, 989, 1937, 1519, 2201, 13973, 18031, 31583, 57557, 252737}}, {20815, 18, 124757, {1, 3, 3, 7, 31, 11, 89, 53, 279, 83, 1247, 1221, 5499, 1199, 361, 22269, 88633, 134975}}, {20816, 18, 124819, {1, 1, 3, 5, 9, 5, 113, 41, 143, 655, 1147, 2043, 4229, 10523, 1453, 1735, 76259, 30607}}, {20817, 18, 124862, {1, 1, 1, 11, 5, 7, 9, 155, 221, 619, 813, 3111, 6039, 10789, 10905, 33285, 62841, 229217}}, {20818, 18, 124864, {1, 3, 5, 9, 19, 19, 123, 65, 419, 597, 87, 3843, 4857, 15903, 23655, 13023, 8389, 230803}}, {20819, 18, 124874, {1, 3, 3, 15, 9, 19, 51, 223, 197, 759, 139, 59, 6547, 1043, 5077, 55267, 23681, 17099}}, {20820, 18, 124882, {1, 1, 3, 3, 15, 43, 63, 85, 227, 961, 1043, 1069, 6557, 7499, 31639, 4345, 26991, 132783}}, {20821, 18, 124903, {1, 3, 1, 1, 25, 33, 59, 219, 435, 105, 1001, 323, 2729, 12517, 16607, 57533, 101167, 53829}}, {20822, 18, 124915, {1, 3, 7, 7, 9, 55, 3, 247, 303, 453, 861, 817, 705, 14337, 15965, 28867, 126763, 204005}}, {20823, 18, 124938, {1, 1, 3, 7, 1, 39, 15, 39, 359, 313, 1753, 2835, 387, 16223, 10945, 19481, 19995, 29989}}, {20824, 18, 124945, {1, 1, 1, 5, 3, 31, 103, 123, 493, 1023, 119, 2175, 2273, 11637, 21605, 23349, 100759, 41227}}, {20825, 18, 124973, {1, 3, 7, 13, 5, 13, 17, 7, 341, 945, 621, 1421, 3893, 5825, 26777, 35497, 13791, 25415}}, {20826, 18, 124986, {1, 1, 5, 1, 19, 27, 39, 7, 177, 749, 1217, 2133, 6913, 13489, 23713, 1085, 31529, 179741}}, {20827, 18, 124991, {1, 3, 3, 3, 15, 21, 5, 145, 281, 131, 1347, 19, 4917, 8655, 2515, 36927, 56551, 202039}}, {20828, 18, 125011, {1, 1, 3, 7, 27, 31, 33, 255, 511, 195, 1493, 2221, 2157, 9303, 3957, 14163, 70435, 215763}}, {20829, 18, 125014, {1, 3, 3, 15, 31, 41, 33, 37, 239, 865, 375, 2217, 809, 11961, 29393, 52145, 76223, 202623}}, {20830, 18, 125082, {1, 3, 5, 11, 5, 57, 73, 193, 341, 843, 1817, 231, 65, 5941, 29693, 31751, 57081, 180977}}, {20831, 18, 125105, {1, 3, 1, 9, 29, 57, 85, 107, 343, 891, 465, 2413, 1965, 7303, 7461, 25857, 110517, 16995}}, {20832, 18, 125163, {1, 1, 7, 15, 7, 49, 121, 211, 253, 511, 1385, 1205, 33, 7713, 20059, 47353, 3267, 215759}}, {20833, 18, 125165, {1, 1, 3, 9, 15, 63, 45, 155, 415, 589, 651, 3707, 5429, 4497, 13733, 21231, 18953, 28671}}, {20834, 18, 125205, {1, 1, 5, 15, 7, 57, 31, 109, 427, 921, 629, 3439, 7615, 4535, 1507, 58931, 49597, 214397}}, {20835, 18, 125219, {1, 3, 3, 5, 21, 35, 9, 241, 67, 767, 659, 1639, 7797, 5209, 14851, 55311, 108549, 175937}}, {20836, 18, 125239, {1, 1, 7, 15, 21, 61, 13, 47, 267, 269, 1169, 257, 2481, 8345, 1061, 28119, 127197, 95379}}, {20837, 18, 125240, {1, 1, 3, 7, 21, 35, 121, 223, 145, 665, 1389, 2105, 5499, 1377, 32417, 39027, 5335, 248315}}, {20838, 18, 125257, {1, 3, 3, 9, 13, 33, 57, 225, 123, 703, 1049, 709, 7347, 11317, 12339, 23247, 62157, 85931}}, {20839, 18, 125284, {1, 3, 3, 3, 5, 3, 105, 115, 13, 675, 757, 987, 6429, 13017, 21347, 38829, 82153, 220677}}, {20840, 18, 125302, {1, 3, 1, 13, 5, 51, 75, 205, 7, 561, 207, 1133, 3303, 1889, 17093, 5933, 48109, 244387}}, {20841, 18, 125327, {1, 3, 3, 7, 11, 11, 71, 243, 235, 941, 1875, 2387, 1139, 16275, 4537, 18791, 67927, 156759}}, {20842, 18, 125336, {1, 3, 5, 5, 11, 35, 29, 5, 351, 223, 847, 1539, 4903, 7619, 24907, 37071, 57899, 32981}}, {20843, 18, 125355, {1, 3, 1, 7, 23, 7, 119, 17, 123, 845, 1423, 2995, 3595, 13287, 31217, 33939, 6891, 156477}}, {20844, 18, 125363, {1, 1, 1, 9, 11, 55, 121, 85, 175, 757, 1093, 513, 1117, 14049, 22377, 4623, 38511, 51391}}, {20845, 18, 125365, {1, 1, 7, 1, 17, 1, 7, 185, 173, 841, 61, 2735, 6679, 7617, 17309, 58047, 11791, 228635}}, {20846, 18, 125372, {1, 1, 5, 5, 1, 1, 61, 57, 37, 857, 531, 2655, 1907, 4245, 3047, 50489, 93447, 116637}}, {20847, 18, 125378, {1, 3, 5, 7, 27, 47, 121, 95, 73, 63, 539, 137, 1765, 4659, 31141, 24495, 109541, 16421}}, {20848, 18, 125383, {1, 3, 7, 13, 13, 25, 47, 45, 97, 243, 1509, 3539, 4791, 5627, 31981, 57663, 65359, 32183}}, {20849, 18, 125387, {1, 1, 1, 7, 15, 57, 117, 249, 183, 849, 557, 833, 5751, 8035, 3371, 11389, 125581, 248799}}, {20850, 18, 125390, {1, 3, 1, 15, 13, 31, 59, 243, 17, 473, 289, 1527, 649, 2807, 6183, 6173, 74381, 261673}}, {20851, 18, 125414, {1, 1, 7, 7, 19, 17, 95, 81, 191, 487, 2023, 307, 3261, 13885, 9285, 30831, 114009, 26483}}, {20852, 18, 125435, {1, 1, 3, 11, 17, 21, 85, 193, 477, 267, 393, 39, 5793, 8621, 25379, 9721, 13947, 44235}}, {20853, 18, 125466, {1, 1, 7, 5, 27, 33, 93, 9, 471, 751, 1279, 695, 2625, 7061, 29577, 5403, 80705, 77895}}, {20854, 18, 125481, {1, 1, 3, 11, 7, 25, 125, 9, 233, 935, 1897, 3685, 595, 15499, 43, 29251, 18029, 250231}}, {20855, 18, 125522, {1, 1, 5, 1, 9, 55, 125, 179, 287, 371, 233, 149, 5639, 5737, 25251, 103, 117015, 35579}}, {20856, 18, 125531, {1, 1, 5, 9, 17, 33, 69, 15, 209, 521, 1083, 2469, 679, 9307, 31539, 63889, 48825, 126327}}, {20857, 18, 125544, {1, 3, 5, 15, 15, 41, 105, 121, 21, 935, 721, 445, 6759, 4227, 15227, 54933, 69589, 2689}}, {20858, 18, 125564, {1, 1, 7, 15, 1, 15, 111, 141, 279, 1013, 825, 1069, 3793, 12929, 153, 11463, 87759, 179987}}, {20859, 18, 125588, {1, 1, 1, 9, 15, 59, 109, 103, 223, 695, 1979, 1241, 2559, 8627, 10559, 53319, 94311, 245193}}, {20860, 18, 125602, {1, 1, 5, 3, 1, 41, 51, 129, 297, 15, 637, 2489, 343, 13549, 7707, 36757, 55703, 161043}}, {20861, 18, 125613, {1, 3, 5, 1, 13, 35, 119, 219, 319, 733, 789, 1343, 8035, 15049, 981, 14477, 13717, 177481}}, {20862, 18, 125621, {1, 1, 1, 11, 5, 17, 3, 43, 129, 705, 1701, 3635, 1201, 12283, 27443, 54257, 102281, 211859}}, {20863, 18, 125648, {1, 3, 1, 13, 7, 63, 9, 45, 283, 41, 801, 131, 2797, 13329, 19011, 21055, 122965, 7961}}, {20864, 18, 125651, {1, 3, 3, 5, 9, 27, 99, 129, 499, 523, 1939, 3661, 455, 12601, 11723, 3727, 32671, 78251}}, {20865, 18, 125681, {1, 3, 7, 5, 9, 57, 63, 47, 49, 745, 945, 2927, 6659, 1023, 9991, 55379, 105295, 259901}}, {20866, 18, 125719, {1, 1, 3, 3, 3, 47, 15, 237, 193, 409, 1165, 3581, 719, 3049, 14679, 31559, 7825, 96083}}, {20867, 18, 125773, {1, 1, 7, 11, 9, 55, 29, 123, 163, 415, 2013, 97, 1471, 1409, 28867, 50405, 99417, 57113}}, {20868, 18, 125774, {1, 1, 7, 15, 5, 17, 57, 123, 25, 119, 1699, 1289, 3139, 7177, 13465, 33583, 34517, 182669}}, {20869, 18, 125779, {1, 1, 3, 1, 15, 45, 79, 7, 461, 223, 691, 3071, 6233, 14997, 4083, 65391, 60571, 82929}}, {20870, 18, 125786, {1, 3, 5, 1, 25, 39, 89, 105, 497, 685, 1921, 133, 4849, 8467, 609, 62183, 123787, 223025}}, {20871, 18, 125792, {1, 1, 1, 13, 3, 57, 117, 241, 501, 107, 1253, 3097, 603, 10645, 3395, 13997, 112527, 208263}}, {20872, 18, 125822, {1, 1, 7, 9, 7, 31, 25, 97, 205, 785, 517, 549, 6841, 7097, 9635, 17151, 57135, 105469}}, {20873, 18, 125828, {1, 3, 7, 1, 25, 35, 43, 75, 179, 1023, 1921, 1529, 2791, 6747, 9135, 61801, 46729, 26821}}, {20874, 18, 125831, {1, 1, 3, 1, 31, 49, 107, 219, 285, 501, 1503, 3103, 5257, 14561, 31493, 7753, 34375, 260357}}, {20875, 18, 125837, {1, 3, 7, 13, 15, 7, 75, 57, 329, 67, 1541, 2445, 3069, 6723, 10189, 22913, 110781, 243765}}, {20876, 18, 125880, {1, 1, 5, 3, 5, 45, 47, 39, 493, 787, 1019, 3933, 535, 1763, 139, 45967, 123167, 115019}}, {20877, 18, 125891, {1, 3, 1, 3, 23, 59, 93, 139, 349, 973, 1401, 2109, 701, 461, 19199, 21733, 80009, 37239}}, {20878, 18, 125922, {1, 1, 3, 5, 3, 39, 117, 77, 257, 117, 1991, 3371, 509, 3963, 14579, 62459, 52281, 99209}}, {20879, 18, 125928, {1, 3, 1, 15, 29, 47, 73, 157, 429, 497, 39, 123, 4851, 12871, 4567, 29453, 90777, 188683}}, {20880, 18, 125931, {1, 3, 3, 1, 17, 25, 5, 247, 61, 81, 1555, 2167, 6003, 15911, 16023, 7841, 50731, 229163}}, {20881, 18, 125941, {1, 1, 5, 9, 9, 39, 89, 37, 105, 133, 333, 2863, 7249, 2355, 9407, 28145, 25923, 68827}}, {20882, 18, 125948, {1, 3, 7, 13, 15, 55, 11, 93, 197, 447, 1793, 1793, 4639, 1869, 1711, 1439, 15899, 106931}}, {20883, 18, 125960, {1, 1, 5, 13, 23, 11, 67, 155, 511, 363, 1073, 2249, 719, 11167, 7953, 21699, 55735, 47353}}, {20884, 18, 125973, {1, 1, 3, 3, 21, 59, 123, 227, 65, 695, 1769, 4057, 7071, 1827, 13639, 45711, 84019, 96897}}, {20885, 18, 126014, {1, 3, 1, 11, 25, 51, 57, 139, 147, 589, 1565, 511, 3629, 7329, 9565, 62893, 85789, 112047}}, {20886, 18, 126016, {1, 3, 5, 5, 23, 11, 93, 75, 25, 947, 1489, 4081, 3395, 4655, 27853, 41299, 89447, 100971}}, {20887, 18, 126036, {1, 3, 5, 11, 25, 63, 93, 227, 411, 49, 403, 437, 1739, 8453, 31693, 51439, 89729, 113405}}, {20888, 18, 126043, {1, 3, 7, 9, 29, 13, 51, 155, 403, 627, 173, 2111, 833, 11453, 17673, 7121, 52943, 114835}}, {20889, 18, 126062, {1, 1, 5, 13, 11, 11, 105, 101, 309, 577, 1003, 3667, 3489, 11807, 6119, 13773, 89879, 12391}}, {20890, 18, 126076, {1, 3, 7, 9, 17, 11, 111, 239, 225, 723, 933, 3353, 2003, 5273, 207, 38539, 82539, 209781}}, {20891, 18, 126116, {1, 1, 7, 13, 15, 53, 69, 105, 155, 445, 353, 617, 5625, 13439, 29223, 60439, 119635, 49643}}, {20892, 18, 126125, {1, 1, 3, 11, 13, 25, 107, 27, 109, 313, 1721, 2647, 1861, 10631, 17131, 31365, 65319, 102905}}, {20893, 18, 126145, {1, 1, 1, 7, 21, 29, 39, 167, 341, 115, 1523, 2209, 95, 4399, 3881, 38875, 107691, 132471}}, {20894, 18, 126152, {1, 1, 1, 13, 15, 61, 125, 23, 301, 407, 1497, 3731, 7013, 5405, 31233, 51701, 45619, 107407}}, {20895, 18, 126175, {1, 3, 5, 5, 31, 27, 77, 21, 339, 1013, 371, 19, 5733, 2177, 15547, 27595, 6805, 172695}}, {20896, 18, 126188, {1, 3, 5, 11, 5, 15, 71, 23, 441, 169, 1715, 437, 1791, 293, 13441, 11225, 119119, 223035}}, {20897, 18, 126199, {1, 3, 1, 5, 11, 15, 95, 127, 433, 789, 899, 2591, 2339, 8237, 20765, 32897, 51511, 58437}}, {20898, 18, 126205, {1, 3, 5, 9, 11, 57, 103, 5, 401, 51, 1813, 923, 1983, 1853, 21913, 3051, 56309, 19423}}, {20899, 18, 126213, {1, 1, 3, 15, 3, 3, 41, 5, 231, 35, 391, 185, 7585, 1005, 20311, 11193, 18275, 114131}}, {20900, 18, 126220, {1, 1, 3, 9, 13, 13, 115, 203, 223, 575, 459, 1839, 3949, 16027, 23137, 13723, 19195, 249337}}, {20901, 18, 126286, {1, 1, 1, 9, 21, 51, 39, 245, 187, 609, 319, 2927, 3625, 10789, 31291, 45557, 45935, 132447}}, {20902, 18, 126294, {1, 3, 3, 9, 25, 37, 47, 55, 219, 409, 1927, 553, 3953, 6209, 11807, 11133, 48047, 132437}}, {20903, 18, 126300, {1, 3, 1, 13, 23, 31, 109, 167, 281, 179, 233, 1603, 7391, 9091, 27021, 31213, 13093, 86017}}, {20904, 18, 126322, {1, 3, 1, 13, 13, 15, 7, 29, 409, 59, 505, 1307, 6247, 6055, 5531, 59727, 58069, 84049}}, {20905, 18, 126324, {1, 1, 5, 7, 19, 7, 103, 245, 133, 609, 1087, 2365, 3341, 1689, 18841, 19625, 47413, 63445}}, {20906, 18, 126343, {1, 1, 7, 3, 11, 27, 79, 75, 97, 355, 493, 2035, 3413, 11835, 9157, 51173, 1, 71797}}, {20907, 18, 126344, {1, 1, 5, 5, 29, 1, 43, 135, 473, 329, 1197, 1693, 3823, 7723, 24771, 22349, 94383, 41461}}, {20908, 18, 126430, {1, 3, 3, 15, 25, 9, 79, 213, 317, 615, 541, 441, 505, 13665, 3691, 17825, 49303, 91783}}, {20909, 18, 126433, {1, 3, 1, 11, 27, 33, 65, 31, 469, 799, 1251, 3357, 5239, 5651, 13317, 28553, 64225, 9805}}, {20910, 18, 126448, {1, 1, 7, 13, 9, 49, 77, 43, 363, 719, 1943, 1285, 1587, 1047, 29419, 24025, 89901, 229095}}, {20911, 18, 126451, {1, 1, 1, 15, 19, 57, 33, 243, 111, 183, 497, 603, 923, 1957, 6493, 11833, 7331, 229975}}, {20912, 18, 126457, {1, 3, 1, 1, 13, 43, 31, 25, 169, 303, 69, 723, 1745, 1025, 14301, 2523, 111887, 179519}}, {20913, 18, 126458, {1, 3, 1, 5, 31, 55, 11, 103, 391, 881, 1885, 3923, 7507, 377, 29331, 32167, 56915, 44211}}, {20914, 18, 126463, {1, 1, 7, 1, 27, 55, 33, 141, 393, 73, 701, 3173, 973, 15553, 10219, 51441, 55201, 131055}}, {20915, 18, 126470, {1, 1, 3, 9, 1, 31, 115, 85, 173, 227, 163, 157, 5569, 8291, 27163, 7581, 8699, 104523}}, {20916, 18, 126484, {1, 1, 1, 5, 5, 19, 11, 55, 217, 571, 1001, 945, 6237, 1993, 11809, 63893, 60081, 102997}}, {20917, 18, 126518, {1, 3, 3, 15, 15, 7, 51, 161, 147, 263, 1701, 1079, 3027, 11779, 24885, 16127, 68985, 162975}}, {20918, 18, 126521, {1, 3, 1, 9, 25, 1, 47, 107, 149, 997, 1779, 2905, 4951, 10345, 31059, 63831, 117219, 251935}}, {20919, 18, 126547, {1, 3, 3, 9, 5, 23, 83, 95, 399, 343, 1597, 1733, 5959, 9685, 4721, 59109, 113633, 80365}}, {20920, 18, 126556, {1, 1, 7, 11, 31, 43, 71, 133, 305, 529, 645, 3095, 6273, 4019, 14433, 41609, 64093, 79051}}, {20921, 18, 126583, {1, 3, 5, 11, 1, 63, 123, 25, 245, 583, 1013, 3275, 2997, 13021, 27515, 16233, 113093, 249101}}, {20922, 18, 126584, {1, 1, 1, 9, 3, 59, 113, 155, 125, 423, 259, 1559, 3745, 9105, 27673, 36601, 36117, 47953}}, {20923, 18, 126633, {1, 3, 3, 7, 19, 41, 55, 87, 53, 801, 661, 329, 3391, 7581, 25487, 25751, 120171, 35953}}, {20924, 18, 126673, {1, 1, 7, 15, 31, 57, 49, 179, 147, 139, 957, 289, 4321, 8747, 53, 46003, 40219, 96855}}, {20925, 18, 126680, {1, 1, 7, 9, 29, 49, 71, 101, 389, 793, 1355, 3263, 6331, 4869, 28479, 8335, 74653, 8519}}, {20926, 18, 126686, {1, 1, 1, 13, 1, 19, 31, 161, 261, 679, 1115, 985, 2855, 4395, 15087, 18593, 98535, 52537}}, {20927, 18, 126689, {1, 1, 3, 11, 15, 51, 79, 7, 75, 75, 753, 2637, 7193, 7961, 21411, 24273, 7543, 6277}}, {20928, 18, 126702, {1, 3, 1, 5, 5, 51, 67, 191, 201, 777, 587, 1439, 1027, 3759, 31141, 42159, 58475, 7355}}, {20929, 18, 126710, {1, 3, 5, 3, 15, 37, 11, 251, 53, 799, 739, 2225, 6985, 9183, 12341, 29963, 44101, 23889}}, {20930, 18, 126722, {1, 1, 3, 3, 5, 33, 81, 223, 89, 531, 301, 305, 2401, 4015, 18607, 65041, 82447, 228487}}, {20931, 18, 126787, {1, 3, 1, 7, 15, 29, 71, 247, 445, 1005, 1229, 3897, 899, 11175, 6349, 29145, 103153, 90275}}, {20932, 18, 126789, {1, 3, 3, 7, 15, 7, 75, 13, 417, 719, 121, 1345, 3737, 4119, 15259, 33579, 57727, 111517}}, {20933, 18, 126794, {1, 3, 7, 3, 31, 11, 49, 61, 405, 741, 1607, 1561, 4655, 9775, 14349, 27431, 91791, 228607}}, {20934, 18, 126801, {1, 3, 5, 13, 17, 27, 93, 153, 99, 683, 219, 3783, 6963, 1633, 6621, 8133, 5111, 57333}}, {20935, 18, 126857, {1, 3, 3, 3, 25, 29, 75, 155, 159, 25, 637, 3053, 4737, 5831, 9651, 45331, 100407, 188607}}, {20936, 18, 126891, {1, 3, 1, 9, 21, 55, 123, 27, 509, 227, 1569, 1379, 7137, 11749, 14257, 38349, 459, 54873}}, {20937, 18, 126896, {1, 1, 7, 15, 29, 35, 81, 79, 237, 155, 1551, 343, 5127, 3233, 3691, 59917, 7367, 181979}}, {20938, 18, 126902, {1, 3, 1, 15, 1, 57, 111, 121, 375, 635, 1529, 635, 2337, 6553, 22067, 36047, 80099, 116411}}, {20939, 18, 126911, {1, 1, 3, 3, 29, 27, 19, 3, 69, 197, 1829, 1907, 5901, 12651, 3295, 7805, 57871, 47571}}, {20940, 18, 126919, {1, 1, 1, 13, 21, 5, 115, 51, 203, 991, 1731, 1101, 1607, 14323, 12233, 48047, 33969, 147621}}, {20941, 18, 126943, {1, 3, 3, 1, 25, 55, 41, 31, 101, 551, 1519, 1915, 6961, 13919, 15339, 13141, 107625, 9247}}, {20942, 18, 126947, {1, 1, 7, 11, 17, 25, 87, 175, 341, 445, 1813, 2995, 3217, 6015, 1637, 65243, 72743, 248715}}, {20943, 18, 126949, {1, 1, 5, 13, 11, 1, 61, 139, 233, 167, 1363, 1991, 7999, 16289, 25595, 8915, 32205, 169963}}, {20944, 18, 126953, {1, 1, 1, 13, 31, 33, 67, 57, 121, 477, 755, 2035, 3683, 16205, 5511, 25615, 5169, 128843}}, {20945, 18, 126971, {1, 3, 5, 15, 31, 1, 89, 29, 493, 379, 1627, 491, 2503, 8105, 30275, 27379, 43905, 46397}}, {20946, 18, 126976, {1, 1, 7, 9, 31, 41, 127, 121, 61, 561, 223, 3231, 7321, 3683, 15455, 8019, 116739, 96557}}, {20947, 18, 126982, {1, 1, 5, 9, 19, 41, 25, 65, 111, 535, 611, 1631, 4251, 107, 19787, 40749, 65701, 48749}}, {20948, 18, 127009, {1, 3, 3, 11, 27, 49, 75, 93, 15, 937, 1517, 1577, 7485, 8713, 15979, 13799, 103057, 144799}}, {20949, 18, 127021, {1, 1, 7, 7, 7, 29, 3, 63, 177, 781, 2001, 315, 6703, 8055, 19081, 33641, 44279, 87597}}, {20950, 18, 127027, {1, 1, 7, 11, 29, 53, 83, 223, 275, 951, 1883, 2447, 1815, 9313, 9247, 17185, 8143, 135247}}, {20951, 18, 127039, {1, 1, 5, 13, 21, 47, 87, 55, 169, 95, 777, 2787, 7227, 11373, 16707, 28237, 30789, 64589}}, {20952, 18, 127041, {1, 1, 1, 11, 15, 41, 1, 55, 337, 493, 1379, 2505, 6831, 10955, 1875, 21821, 54101, 9379}}, {20953, 18, 127044, {1, 3, 5, 15, 27, 9, 121, 49, 439, 781, 1457, 1341, 7433, 5879, 13039, 24001, 64059, 157077}}, {20954, 18, 127059, {1, 1, 1, 9, 19, 55, 89, 37, 255, 345, 215, 4067, 8151, 14253, 12121, 3637, 29185, 60643}}, {20955, 18, 127071, {1, 3, 1, 7, 31, 39, 71, 29, 71, 83, 1249, 871, 8037, 1001, 25245, 26651, 34509, 123607}}, {20956, 18, 127075, {1, 1, 3, 11, 13, 21, 15, 171, 255, 373, 429, 2179, 4431, 16087, 17949, 16307, 129877, 186495}}, {20957, 18, 127126, {1, 3, 3, 9, 17, 45, 75, 175, 3, 403, 215, 1781, 7875, 14113, 6967, 65263, 125885, 232983}}, {20958, 18, 127129, {1, 1, 7, 9, 21, 57, 73, 105, 163, 583, 587, 2743, 2199, 5187, 5571, 56399, 797, 192405}}, {20959, 18, 127145, {1, 1, 1, 3, 29, 27, 71, 145, 11, 455, 1505, 2789, 4083, 12345, 14785, 4981, 95121, 134977}}, {20960, 18, 127154, {1, 1, 1, 1, 1, 27, 1, 145, 473, 483, 83, 3009, 7241, 13633, 15071, 30767, 128103, 94727}}, {20961, 18, 127165, {1, 3, 5, 15, 17, 51, 71, 21, 237, 65, 901, 3365, 7831, 3027, 8751, 14435, 79445, 172587}}, {20962, 18, 127171, {1, 1, 5, 1, 9, 49, 49, 31, 395, 339, 343, 1813, 2607, 9347, 11239, 6761, 127623, 43459}}, {20963, 18, 127197, {1, 1, 1, 1, 13, 23, 71, 131, 225, 229, 117, 889, 8145, 5953, 10679, 38687, 80029, 63689}}, {20964, 18, 127198, {1, 1, 5, 1, 29, 1, 87, 181, 441, 353, 257, 335, 203, 10897, 24085, 26967, 62573, 170285}}, {20965, 18, 127207, {1, 1, 7, 3, 3, 39, 47, 135, 353, 977, 89, 259, 6411, 5511, 10697, 57623, 27367, 108451}}, {20966, 18, 127226, {1, 3, 3, 11, 9, 57, 95, 211, 237, 281, 1703, 2107, 2179, 3411, 32621, 5387, 29971, 102889}}, {20967, 18, 127240, {1, 1, 1, 13, 27, 49, 47, 49, 413, 985, 649, 1245, 807, 13637, 21741, 32565, 80135, 127971}}, {20968, 18, 127254, {1, 3, 7, 13, 3, 19, 57, 97, 493, 597, 135, 1689, 5011, 4579, 6093, 28341, 37279, 142197}}, {20969, 18, 127269, {1, 3, 1, 15, 15, 31, 3, 89, 327, 107, 827, 1111, 261, 6211, 4359, 38553, 43297, 75057}}, {20970, 18, 127305, {1, 1, 1, 9, 19, 19, 53, 195, 141, 297, 141, 3859, 4173, 12243, 31399, 6353, 110505, 172219}}, {20971, 18, 127323, {1, 3, 3, 9, 31, 51, 59, 53, 55, 723, 1575, 3399, 8057, 12317, 8393, 1719, 96987, 228955}}, {20972, 18, 127342, {1, 1, 7, 11, 19, 59, 41, 9, 217, 267, 629, 2977, 4515, 463, 31773, 61765, 78827, 51331}}, {20973, 18, 127347, {1, 3, 3, 13, 9, 55, 51, 177, 183, 431, 555, 3573, 7977, 3067, 21111, 12971, 78283, 260721}}, {20974, 18, 127363, {1, 1, 1, 11, 27, 5, 89, 69, 435, 199, 221, 1017, 7703, 7469, 7755, 46319, 37941, 55285}}, {20975, 18, 127394, {1, 1, 7, 13, 19, 55, 53, 207, 367, 177, 1483, 2857, 3753, 5493, 13349, 14033, 7933, 93457}}, {20976, 18, 127426, {1, 1, 7, 3, 27, 35, 19, 223, 341, 137, 1195, 1263, 5937, 13517, 55, 6391, 106173, 176503}}, {20977, 18, 127432, {1, 3, 7, 11, 23, 25, 37, 103, 351, 945, 1205, 2543, 3875, 155, 27777, 36647, 47979, 25113}}, {20978, 18, 127440, {1, 1, 3, 15, 25, 59, 79, 39, 17, 553, 1119, 3353, 2619, 3851, 5945, 47501, 17369, 89355}}, {20979, 18, 127462, {1, 1, 1, 13, 9, 55, 13, 173, 207, 925, 1855, 1871, 7851, 1361, 20117, 51677, 77703, 51309}}, {20980, 18, 127468, {1, 3, 1, 1, 31, 57, 3, 25, 329, 927, 1683, 1447, 6853, 103, 9549, 21393, 415, 122749}}, {20981, 18, 127473, {1, 1, 5, 5, 31, 61, 31, 213, 85, 531, 931, 999, 1189, 5189, 15127, 47799, 70769, 81901}}, {20982, 18, 127486, {1, 1, 3, 1, 5, 59, 89, 53, 105, 761, 313, 3013, 4093, 9595, 4287, 51505, 20095, 232933}}, {20983, 18, 127502, {1, 1, 7, 7, 23, 9, 41, 29, 399, 395, 759, 2541, 2373, 15365, 12083, 49579, 34401, 168121}}, {20984, 18, 127510, {1, 1, 3, 1, 7, 23, 37, 183, 205, 377, 1081, 1081, 7767, 363, 14571, 16265, 18267, 102155}}, {20985, 18, 127523, {1, 3, 3, 15, 19, 11, 59, 59, 465, 437, 965, 3707, 3505, 14785, 23605, 12505, 130607, 40693}}, {20986, 18, 127543, {1, 1, 3, 13, 5, 15, 91, 33, 235, 215, 1997, 2035, 7407, 3203, 27143, 14007, 96411, 593}}, {20987, 18, 127567, {1, 3, 7, 1, 19, 51, 1, 69, 489, 629, 1731, 393, 6807, 10521, 23971, 45649, 105183, 207351}}, {20988, 18, 127570, {1, 3, 5, 3, 5, 41, 89, 141, 469, 177, 109, 2439, 7155, 2083, 31993, 13933, 100557, 137255}}, {20989, 18, 127585, {1, 1, 7, 15, 21, 45, 41, 197, 365, 177, 61, 811, 2535, 5219, 3689, 53129, 42063, 60759}}, {20990, 18, 127588, {1, 3, 5, 1, 23, 7, 19, 193, 253, 793, 539, 3747, 2611, 16211, 17199, 14875, 95377, 6999}}, {20991, 18, 127619, {1, 1, 3, 5, 9, 5, 9, 129, 217, 473, 151, 3053, 6981, 8075, 32121, 31995, 41271, 208927}}, {20992, 18, 127621, {1, 1, 5, 9, 9, 9, 89, 139, 381, 937, 1937, 1879, 8191, 2237, 25629, 51471, 87639, 173697}}, {20993, 18, 127626, {1, 1, 5, 9, 17, 35, 81, 223, 161, 315, 139, 2597, 2599, 16191, 2567, 54947, 8603, 121589}}, {20994, 18, 127628, {1, 1, 5, 5, 9, 7, 33, 49, 49, 723, 1013, 1055, 4025, 1471, 30081, 17475, 127931, 63723}}, {20995, 18, 127640, {1, 3, 7, 7, 9, 49, 107, 17, 335, 119, 1959, 3613, 8129, 11033, 12197, 23803, 112595, 131655}}, {20996, 18, 127662, {1, 3, 5, 11, 3, 45, 91, 17, 181, 1005, 985, 3045, 853, 8181, 5517, 48515, 16225, 237151}}, {20997, 18, 127684, {1, 1, 3, 1, 3, 63, 35, 135, 61, 383, 1233, 675, 151, 2157, 18711, 37113, 40353, 61783}}, {20998, 18, 127687, {1, 3, 5, 5, 29, 3, 105, 11, 351, 761, 165, 911, 6903, 10111, 1779, 24601, 3177, 110301}}, {20999, 18, 127693, {1, 1, 3, 15, 25, 19, 73, 237, 263, 161, 731, 3853, 7705, 14497, 30799, 32979, 100729, 21761}}, {21000, 18, 127696, {1, 1, 3, 5, 27, 9, 3, 149, 207, 715, 1435, 2563, 2451, 7951, 26313, 55115, 99423, 231639}}, {21001, 18, 127708, {1, 1, 5, 15, 11, 51, 13, 47, 311, 969, 2013, 357, 4847, 1831, 2235, 22779, 32375, 40893}}, {21002, 18, 127711, {1, 1, 3, 9, 21, 45, 11, 99, 275, 849, 443, 1257, 7855, 9121, 6549, 20289, 101337, 13869}}, {21003, 18, 127722, {1, 1, 1, 15, 25, 27, 15, 111, 215, 437, 1923, 1985, 4603, 15469, 6667, 17941, 50433, 152759}}, {21004, 18, 127732, {1, 3, 7, 15, 7, 37, 119, 53, 337, 853, 1785, 3507, 3743, 14303, 22757, 5149, 1539, 227051}}, {21005, 18, 127747, {1, 1, 3, 13, 11, 23, 55, 19, 495, 531, 1021, 3831, 5993, 15819, 2121, 52773, 19775, 94643}}, {21006, 18, 127767, {1, 1, 3, 3, 23, 55, 55, 69, 457, 755, 1187, 3993, 613, 12691, 1779, 21251, 2293, 236725}}, {21007, 18, 127771, {1, 1, 5, 9, 23, 27, 61, 125, 113, 99, 503, 699, 6873, 13141, 10649, 65209, 21773, 162749}}, {21008, 18, 127790, {1, 1, 1, 11, 15, 27, 111, 227, 493, 361, 1071, 607, 1409, 9281, 24515, 26739, 82421, 30463}}, {21009, 18, 127816, {1, 3, 5, 1, 11, 57, 23, 239, 265, 675, 441, 4031, 5163, 15729, 2741, 26037, 32533, 140645}}, {21010, 18, 127824, {1, 3, 3, 7, 3, 45, 105, 135, 493, 579, 1707, 2933, 1135, 11891, 3171, 45401, 24993, 175681}}, {21011, 18, 127833, {1, 1, 1, 11, 11, 3, 67, 213, 483, 9, 1053, 213, 3205, 8487, 16093, 7305, 122591, 31811}}, {21012, 18, 127869, {1, 1, 5, 13, 19, 31, 13, 65, 29, 929, 343, 463, 1885, 13467, 14997, 22737, 42869, 128239}}, {21013, 18, 127910, {1, 3, 3, 13, 9, 47, 125, 33, 475, 285, 1901, 2525, 305, 11587, 27309, 30037, 70681, 180425}}, {21014, 18, 127928, {1, 3, 5, 15, 9, 37, 45, 149, 19, 135, 555, 4037, 5173, 12473, 983, 40923, 28561, 185941}}, {21015, 18, 127933, {1, 3, 3, 9, 23, 35, 35, 151, 113, 885, 1553, 2233, 351, 4071, 28127, 26109, 12299, 163973}}, {21016, 18, 127963, {1, 3, 3, 11, 17, 55, 125, 87, 315, 917, 383, 2397, 1573, 9255, 10499, 16051, 99487, 139415}}, {21017, 18, 127975, {1, 1, 3, 1, 29, 21, 101, 153, 5, 705, 1965, 1447, 8163, 13547, 25929, 28569, 57897, 173229}}, {21018, 18, 128016, {1, 1, 7, 15, 3, 37, 113, 213, 495, 935, 529, 2299, 6901, 1765, 4255, 14579, 14175, 112333}}, {21019, 18, 128031, {1, 3, 3, 9, 11, 53, 89, 27, 461, 235, 1525, 3533, 3061, 4351, 12847, 21649, 10843, 60901}}, {21020, 18, 128059, {1, 1, 5, 1, 17, 11, 17, 157, 387, 887, 2017, 3641, 923, 12659, 19691, 18657, 3127, 218819}}, {21021, 18, 128074, {1, 3, 1, 9, 5, 3, 49, 215, 379, 765, 1375, 345, 2285, 8197, 9531, 6725, 22475, 203883}}, {21022, 18, 128107, {1, 1, 3, 9, 19, 41, 13, 233, 97, 755, 249, 2011, 5815, 6317, 4121, 63637, 43353, 154753}}, {21023, 18, 128122, {1, 3, 7, 15, 31, 25, 93, 197, 455, 979, 1805, 2619, 803, 5705, 1679, 29317, 66477, 159187}}, {21024, 18, 128157, {1, 1, 1, 13, 11, 25, 61, 233, 339, 171, 559, 427, 3239, 8889, 3711, 19743, 18099, 49201}}, {21025, 18, 128161, {1, 3, 7, 13, 19, 5, 9, 183, 355, 137, 1767, 1113, 1149, 5791, 4099, 37911, 75945, 115397}}, {21026, 18, 128200, {1, 1, 3, 13, 27, 25, 121, 3, 337, 195, 1841, 2009, 4181, 3197, 20275, 42493, 7495, 24407}}, {21027, 18, 128213, {1, 1, 1, 15, 3, 43, 39, 25, 57, 829, 565, 1977, 4027, 11053, 13961, 13965, 4207, 1663}}, {21028, 18, 128229, {1, 3, 5, 9, 11, 7, 107, 205, 479, 961, 1549, 1701, 6305, 15419, 23331, 46443, 55171, 235109}}, {21029, 18, 128233, {1, 3, 5, 5, 19, 3, 39, 211, 429, 363, 765, 283, 2469, 1947, 10481, 1969, 95545, 187671}}, {21030, 18, 128241, {1, 1, 1, 1, 11, 55, 47, 121, 251, 63, 767, 3673, 3233, 14865, 25713, 48443, 79139, 225021}}, {21031, 18, 128259, {1, 1, 3, 11, 25, 35, 57, 103, 385, 155, 173, 4023, 489, 1733, 14423, 61843, 24793, 9871}}, {21032, 18, 128295, {1, 3, 1, 15, 9, 29, 99, 187, 471, 877, 1321, 2489, 7439, 4259, 32703, 1459, 42093, 261097}}, {21033, 18, 128299, {1, 1, 3, 11, 9, 25, 113, 251, 337, 405, 847, 2451, 5649, 3449, 11703, 18271, 108005, 208789}}, {21034, 18, 128313, {1, 3, 3, 7, 13, 53, 61, 251, 461, 461, 1557, 1215, 6731, 13349, 21003, 11573, 66751, 79733}}, {21035, 18, 128345, {1, 1, 5, 1, 23, 49, 101, 175, 251, 577, 1667, 2561, 6545, 16305, 18457, 65067, 35843, 123445}}, {21036, 18, 128362, {1, 1, 5, 3, 7, 9, 61, 107, 395, 137, 559, 2315, 2559, 11929, 4843, 41661, 61361, 146163}}, {21037, 18, 128375, {1, 3, 1, 5, 1, 3, 43, 251, 329, 289, 323, 2201, 4129, 4963, 27477, 18743, 46551, 93061}}, {21038, 18, 128376, {1, 1, 7, 3, 17, 63, 21, 159, 447, 377, 69, 2517, 8181, 6043, 3039, 7747, 72465, 41027}}, {21039, 18, 128406, {1, 1, 1, 1, 13, 3, 45, 93, 391, 509, 867, 1561, 5017, 11851, 24891, 22531, 18993, 129421}}, {21040, 18, 128410, {1, 3, 3, 11, 15, 1, 127, 9, 161, 321, 2003, 239, 1379, 11903, 13503, 26529, 57725, 214797}}, {21041, 18, 128416, {1, 1, 1, 13, 31, 11, 17, 25, 1, 645, 675, 735, 2083, 1919, 18977, 4995, 91559, 230463}}, {21042, 18, 128443, {1, 3, 1, 13, 17, 21, 107, 167, 135, 797, 715, 3275, 5437, 4253, 11671, 14867, 36041, 71751}}, {21043, 18, 128451, {1, 3, 5, 5, 11, 49, 93, 231, 431, 567, 1605, 3281, 7049, 2947, 863, 39593, 117167, 167301}}, {21044, 18, 128465, {1, 1, 1, 1, 5, 13, 61, 91, 127, 189, 1879, 3921, 4303, 4831, 6765, 31005, 107627, 80693}}, {21045, 18, 128466, {1, 3, 1, 3, 1, 49, 61, 9, 467, 891, 105, 317, 137, 12789, 12367, 57455, 39777, 88047}}, {21046, 18, 128484, {1, 1, 3, 13, 23, 63, 37, 103, 23, 223, 647, 2523, 3211, 14551, 22663, 48237, 54777, 180297}}, {21047, 18, 128499, {1, 3, 3, 7, 29, 51, 85, 179, 441, 431, 535, 2975, 8083, 8619, 30229, 31421, 54063, 163601}}, {21048, 18, 128502, {1, 3, 1, 1, 27, 39, 125, 171, 57, 729, 511, 957, 7541, 2347, 1669, 32323, 108531, 69943}}, {21049, 18, 128524, {1, 3, 3, 7, 1, 33, 89, 245, 95, 21, 699, 1441, 2659, 501, 32323, 39145, 82311, 155479}}, {21050, 18, 128536, {1, 1, 3, 11, 29, 13, 87, 251, 329, 667, 325, 2411, 7959, 8069, 20817, 42445, 121675, 113421}}, {21051, 18, 128541, {1, 1, 1, 7, 9, 57, 109, 237, 325, 535, 89, 1285, 5649, 13673, 29375, 51553, 81723, 11003}}, {21052, 18, 128542, {1, 3, 1, 1, 13, 5, 31, 109, 157, 817, 1303, 725, 1841, 5503, 2255, 34637, 93603, 82825}}, {21053, 18, 128592, {1, 3, 7, 7, 5, 33, 39, 233, 217, 157, 357, 2727, 3565, 1539, 5317, 23967, 30375, 260381}}, {21054, 18, 128598, {1, 1, 5, 3, 23, 51, 45, 181, 353, 519, 949, 3043, 1517, 3387, 15081, 5997, 31523, 80007}}, {21055, 18, 128623, {1, 1, 3, 5, 23, 21, 83, 51, 275, 629, 1433, 1821, 3761, 2367, 32089, 13813, 99629, 64603}}, {21056, 18, 128632, {1, 1, 5, 15, 11, 49, 69, 197, 193, 459, 1915, 787, 3631, 5219, 11109, 12311, 56625, 117439}}, {21057, 18, 128671, {1, 3, 3, 3, 31, 29, 57, 27, 43, 231, 777, 2139, 2609, 12273, 23777, 4151, 51749, 110013}}, {21058, 18, 128713, {1, 1, 5, 13, 9, 63, 83, 69, 225, 913, 99, 1167, 5279, 14163, 3979, 55151, 84387, 234583}}, {21059, 18, 128724, {1, 1, 7, 5, 9, 57, 87, 23, 335, 403, 1843, 725, 5187, 4137, 24299, 44807, 98523, 217815}}, {21060, 18, 128731, {1, 3, 3, 3, 3, 23, 115, 229, 193, 655, 1205, 3159, 1935, 113, 20943, 32917, 69633, 2133}}, {21061, 18, 128761, {1, 3, 3, 1, 17, 5, 59, 139, 75, 185, 1951, 3689, 4997, 2761, 8673, 41783, 75075, 101063}}, {21062, 18, 128767, {1, 3, 1, 13, 1, 51, 63, 127, 67, 743, 1049, 2055, 4249, 131, 8153, 50237, 28135, 76059}}, {21063, 18, 128782, {1, 3, 7, 13, 5, 39, 83, 63, 429, 573, 1915, 3801, 2223, 1585, 16997, 45571, 23311, 108099}}, {21064, 18, 128793, {1, 3, 1, 3, 15, 49, 19, 65, 433, 401, 1901, 3653, 2399, 15171, 9695, 30257, 104877, 181221}}, {21065, 18, 128805, {1, 3, 1, 1, 25, 37, 89, 7, 81, 343, 949, 3535, 1681, 10089, 23513, 3897, 127083, 214005}}, {21066, 18, 128820, {1, 3, 7, 13, 1, 1, 123, 89, 433, 541, 1579, 931, 3459, 11095, 20729, 13117, 59323, 90309}}, {21067, 18, 128830, {1, 1, 7, 1, 19, 9, 31, 211, 271, 25, 1053, 2249, 6549, 12785, 16947, 55633, 70155, 253741}}, {21068, 18, 128842, {1, 3, 5, 9, 7, 49, 11, 251, 101, 795, 1015, 2037, 1239, 10151, 22179, 749, 2373, 224517}}, {21069, 18, 128852, {1, 3, 7, 15, 21, 19, 15, 59, 439, 621, 1081, 3041, 1587, 3077, 2319, 51135, 110513, 222551}}, {21070, 18, 128859, {1, 1, 5, 5, 9, 61, 49, 97, 361, 647, 351, 1977, 3023, 10213, 6889, 8753, 72203, 37521}}, {21071, 18, 128866, {1, 3, 3, 1, 7, 29, 51, 117, 259, 81, 1263, 1829, 6541, 5699, 30367, 61325, 78795, 3491}}, {21072, 18, 128875, {1, 1, 1, 5, 5, 23, 19, 255, 267, 251, 239, 3561, 6771, 10647, 4129, 40285, 11041, 27023}}, {21073, 18, 128892, {1, 1, 7, 5, 29, 17, 121, 91, 427, 51, 243, 1617, 5389, 3633, 14105, 5329, 109507, 93719}}, {21074, 18, 128896, {1, 3, 7, 5, 7, 59, 107, 89, 181, 719, 1029, 585, 2415, 9175, 11605, 9271, 12105, 42503}}, {21075, 18, 128914, {1, 3, 5, 15, 27, 15, 83, 223, 489, 901, 1823, 1515, 6295, 12509, 27179, 181, 29813, 66163}}, {21076, 18, 128935, {1, 1, 7, 15, 5, 9, 79, 29, 201, 391, 609, 935, 4025, 201, 8333, 24557, 33739, 257979}}, {21077, 18, 128964, {1, 3, 3, 9, 9, 19, 55, 211, 347, 943, 559, 467, 1363, 10249, 7109, 41293, 28035, 205889}}, {21078, 18, 128973, {1, 1, 5, 3, 21, 25, 25, 163, 95, 119, 789, 1679, 3845, 1427, 25531, 13375, 121029, 194845}}, {21079, 18, 129001, {1, 1, 5, 3, 31, 21, 83, 27, 17, 59, 885, 3889, 4795, 4383, 28739, 55129, 10387, 176437}}, {21080, 18, 129007, {1, 3, 1, 5, 31, 39, 37, 79, 433, 313, 1155, 3025, 6141, 10695, 27819, 28227, 32161, 250515}}, {21081, 18, 129012, {1, 1, 5, 9, 27, 41, 3, 129, 235, 621, 1171, 3305, 6309, 5323, 15049, 16301, 13817, 238521}}, {21082, 18, 129021, {1, 3, 7, 7, 27, 31, 63, 143, 183, 625, 1627, 3093, 6597, 14089, 30197, 60411, 66221, 221691}}, {21083, 18, 129026, {1, 3, 7, 13, 21, 15, 59, 67, 441, 113, 1229, 1587, 5889, 6691, 10641, 11865, 89791, 82867}}, {21084, 18, 129055, {1, 1, 7, 9, 13, 21, 53, 145, 235, 877, 2005, 1005, 7137, 6091, 19611, 25959, 124019, 216269}}, {21085, 18, 129071, {1, 3, 7, 9, 17, 63, 5, 245, 397, 351, 1613, 4079, 7235, 4397, 18951, 11609, 71593, 148615}}, {21086, 18, 129093, {1, 3, 3, 11, 5, 59, 65, 221, 237, 527, 861, 397, 249, 15273, 8415, 61185, 59419, 98115}}, {21087, 18, 129105, {1, 1, 3, 5, 5, 59, 17, 247, 3, 765, 835, 1131, 3985, 9021, 18067, 28525, 86513, 250227}}, {21088, 18, 129124, {1, 3, 7, 15, 25, 47, 119, 143, 143, 283, 1791, 59, 8171, 12577, 17079, 9809, 100299, 63977}}, {21089, 18, 129148, {1, 3, 5, 13, 1, 47, 93, 159, 199, 863, 1279, 77, 4719, 3623, 30713, 39271, 126299, 130297}}, {21090, 18, 129151, {1, 1, 5, 3, 23, 11, 119, 187, 57, 373, 747, 1507, 5165, 12929, 903, 49041, 70215, 117113}}, {21091, 18, 129155, {1, 1, 5, 1, 3, 59, 23, 77, 151, 77, 627, 2865, 7055, 10469, 12095, 20481, 13429, 47573}}, {21092, 18, 129161, {1, 3, 1, 13, 27, 13, 115, 233, 343, 407, 1321, 4011, 5589, 15369, 23495, 4435, 75421, 229325}}, {21093, 18, 129200, {1, 3, 3, 3, 5, 51, 89, 53, 275, 279, 203, 2829, 4415, 4735, 25417, 17633, 99445, 183945}}, {21094, 18, 129224, {1, 3, 3, 15, 7, 9, 91, 63, 143, 945, 453, 4001, 3943, 7285, 9359, 27507, 8571, 31827}}, {21095, 18, 129230, {1, 3, 3, 11, 15, 49, 103, 25, 273, 791, 145, 2203, 4721, 7709, 25085, 33937, 98693, 97445}}, {21096, 18, 129237, {1, 1, 5, 15, 9, 13, 87, 27, 331, 137, 1031, 585, 7841, 12213, 32259, 46953, 17813, 203379}}, {21097, 18, 129298, {1, 3, 1, 5, 29, 53, 121, 179, 21, 311, 991, 2145, 6577, 12889, 8763, 46629, 128093, 105033}}, {21098, 18, 129300, {1, 3, 1, 9, 7, 29, 57, 137, 333, 109, 615, 749, 2665, 13087, 13989, 41857, 102937, 125183}}, {21099, 18, 129316, {1, 1, 5, 5, 3, 23, 107, 5, 319, 503, 1209, 47, 349, 11681, 28521, 44707, 112887, 232275}}, {21100, 18, 129345, {1, 3, 3, 13, 13, 51, 13, 5, 293, 15, 555, 135, 2565, 13325, 30411, 14837, 65591, 249205}}, {21101, 18, 129351, {1, 3, 5, 13, 17, 3, 73, 255, 447, 699, 503, 3655, 7735, 12163, 6167, 15027, 103831, 146395}}, {21102, 18, 129352, {1, 3, 1, 13, 5, 9, 27, 45, 397, 463, 1739, 3193, 6731, 7533, 11217, 22359, 82603, 231613}}, {21103, 18, 129363, {1, 1, 3, 15, 5, 43, 73, 191, 53, 187, 1905, 745, 1571, 9013, 8515, 59527, 104671, 227063}}, {21104, 18, 129393, {1, 1, 3, 1, 5, 47, 57, 179, 433, 979, 147, 1701, 4019, 6855, 24487, 65495, 69919, 6659}}, {21105, 18, 129410, {1, 3, 3, 1, 17, 17, 13, 75, 163, 781, 421, 1573, 2519, 9243, 20693, 60909, 65661, 208125}}, {21106, 18, 129415, {1, 3, 5, 7, 27, 57, 39, 79, 157, 415, 729, 3651, 3581, 9443, 6409, 45993, 99051, 140977}}, {21107, 18, 129449, {1, 3, 3, 13, 1, 7, 109, 77, 423, 185, 97, 3719, 2355, 10593, 2421, 37339, 24961, 24305}}, {21108, 18, 129477, {1, 3, 5, 13, 17, 7, 125, 43, 453, 43, 643, 3757, 3721, 16083, 20871, 26451, 95201, 29153}}, {21109, 18, 129501, {1, 1, 7, 3, 13, 49, 99, 253, 59, 21, 445, 3677, 6683, 2165, 32367, 55249, 5991, 155033}}, {21110, 18, 129518, {1, 1, 3, 9, 21, 9, 15, 219, 175, 631, 665, 2455, 4701, 10639, 13907, 26937, 58867, 259861}}, {21111, 18, 129520, {1, 3, 5, 5, 23, 5, 39, 233, 27, 811, 1435, 625, 4703, 3699, 20763, 50047, 123875, 10129}}, {21112, 18, 129545, {1, 1, 7, 5, 23, 1, 49, 223, 309, 691, 953, 575, 5279, 10515, 11519, 35387, 48417, 134001}}, {21113, 18, 129563, {1, 1, 7, 11, 3, 15, 125, 109, 39, 713, 1823, 1613, 4347, 6839, 29511, 26865, 102077, 31425}}, {21114, 18, 129594, {1, 1, 1, 7, 31, 43, 13, 221, 115, 993, 1155, 1641, 1063, 2065, 18909, 45769, 65331, 188455}}, {21115, 18, 129608, {1, 1, 7, 13, 21, 9, 59, 7, 79, 217, 2009, 667, 7685, 14761, 20149, 44133, 41037, 78369}}, {21116, 18, 129616, {1, 3, 1, 9, 23, 57, 1, 193, 77, 681, 1135, 3657, 8149, 3559, 25011, 55027, 121903, 240157}}, {21117, 18, 129652, {1, 3, 3, 5, 31, 41, 59, 5, 159, 627, 1569, 23, 2311, 2239, 20811, 54931, 130949, 193071}}, {21118, 18, 129659, {1, 1, 1, 1, 27, 45, 43, 1, 381, 801, 451, 1361, 1611, 5379, 27819, 8949, 4953, 222335}}, {21119, 18, 129680, {1, 1, 7, 7, 7, 11, 101, 17, 197, 561, 297, 159, 7443, 7273, 819, 23487, 24927, 151781}}, {21120, 18, 129692, {1, 3, 1, 3, 15, 43, 119, 193, 205, 835, 7, 689, 8045, 11167, 19521, 65075, 87265, 53669}}, {21121, 18, 129738, {1, 3, 7, 7, 9, 51, 43, 209, 239, 415, 995, 4037, 1219, 2683, 30459, 36161, 111157, 184551}}, {21122, 18, 129764, {1, 3, 7, 11, 27, 3, 81, 43, 407, 463, 231, 3545, 2691, 5235, 22053, 37233, 98757, 149111}}, {21123, 18, 129782, {1, 3, 1, 5, 17, 25, 47, 185, 487, 403, 1063, 1445, 4457, 15443, 11693, 54823, 131001, 9813}}, {21124, 18, 129793, {1, 3, 5, 3, 5, 35, 127, 253, 173, 491, 133, 3575, 1981, 12735, 26021, 61615, 74615, 159829}}, {21125, 18, 129820, {1, 1, 5, 9, 13, 37, 67, 155, 317, 389, 603, 4061, 3527, 9315, 32331, 43145, 82511, 240133}}, {21126, 18, 129824, {1, 1, 5, 1, 21, 41, 89, 3, 61, 627, 1301, 2073, 447, 8139, 2509, 52075, 50687, 240239}}, {21127, 18, 129829, {1, 3, 7, 13, 25, 61, 117, 107, 175, 7, 1173, 561, 5777, 10525, 20713, 34987, 48005, 214361}}, {21128, 18, 129848, {1, 3, 7, 15, 25, 31, 127, 147, 177, 881, 95, 2115, 4765, 10485, 9253, 721, 193, 222459}}, {21129, 18, 129854, {1, 3, 5, 3, 3, 13, 47, 77, 441, 1001, 215, 2365, 3603, 405, 11401, 14523, 65755, 258229}}, {21130, 18, 129861, {1, 1, 3, 9, 19, 29, 71, 153, 77, 613, 1815, 2033, 1821, 15497, 18805, 28851, 88247, 143115}}, {21131, 18, 129879, {1, 3, 1, 11, 21, 19, 37, 35, 427, 887, 1977, 1961, 3619, 10739, 30115, 55937, 102045, 110929}}, {21132, 18, 129886, {1, 3, 3, 13, 21, 27, 49, 15, 405, 629, 2015, 867, 2121, 13789, 19225, 22343, 105629, 123113}}, {21133, 18, 129907, {1, 1, 1, 1, 17, 19, 55, 207, 507, 1001, 1753, 315, 2799, 8643, 1519, 4057, 16599, 222223}}, {21134, 18, 129949, {1, 1, 5, 7, 21, 37, 63, 53, 103, 261, 595, 389, 6041, 11127, 23625, 61683, 80953, 255891}}, {21135, 18, 129953, {1, 1, 1, 5, 25, 21, 81, 233, 79, 57, 1311, 3965, 7747, 687, 32149, 397, 4551, 37657}}, {21136, 18, 129980, {1, 1, 1, 5, 9, 19, 87, 67, 325, 157, 317, 591, 1401, 8275, 20413, 39529, 75349, 183679}}, {21137, 18, 129998, {1, 3, 3, 15, 9, 3, 83, 205, 195, 599, 829, 3109, 3705, 13991, 8781, 41555, 31689, 86933}}, {21138, 18, 130031, {1, 3, 5, 1, 3, 9, 37, 235, 271, 883, 561, 1473, 7693, 177, 14113, 19507, 75221, 67517}}, {21139, 18, 130043, {1, 1, 1, 9, 7, 29, 87, 189, 239, 429, 537, 1657, 6373, 2449, 17621, 19649, 77235, 102775}}, {21140, 18, 130057, {1, 1, 7, 7, 1, 43, 69, 207, 241, 561, 1809, 3119, 4657, 15797, 18751, 52169, 105005, 172657}}, {21141, 18, 130065, {1, 1, 7, 5, 5, 59, 67, 231, 27, 435, 1073, 2689, 229, 733, 1579, 52289, 110285, 76721}}, {21142, 18, 130087, {1, 3, 5, 9, 31, 19, 87, 41, 489, 705, 1363, 963, 5865, 8237, 10295, 43169, 81561, 177209}}, {21143, 18, 130091, {1, 3, 3, 1, 25, 39, 63, 255, 403, 625, 1601, 71, 6609, 4165, 21987, 31269, 25473, 17063}}, {21144, 18, 130096, {1, 3, 3, 11, 19, 13, 101, 245, 17, 687, 1037, 3345, 7257, 13081, 5131, 29003, 72319, 223505}}, {21145, 18, 130101, {1, 3, 3, 3, 11, 49, 107, 29, 463, 465, 977, 4007, 2121, 4821, 1465, 53725, 36783, 247057}}, {21146, 18, 130111, {1, 1, 1, 3, 1, 43, 71, 49, 261, 965, 1041, 3951, 3791, 2503, 26009, 52039, 4639, 141281}}, {21147, 18, 130126, {1, 1, 3, 5, 29, 45, 79, 33, 119, 491, 1403, 1637, 853, 5609, 29853, 16435, 117877, 58443}}, {21148, 18, 130137, {1, 1, 3, 5, 13, 17, 109, 187, 201, 705, 235, 1485, 7673, 6335, 3341, 20451, 64697, 129519}}, {21149, 18, 130138, {1, 1, 7, 13, 11, 41, 95, 81, 135, 783, 1293, 2095, 3599, 10175, 3205, 56915, 131, 19281}}, {21150, 18, 130149, {1, 3, 5, 9, 13, 19, 53, 223, 283, 733, 1915, 3029, 2779, 8133, 28163, 37263, 91245, 1927}}, {21151, 18, 130177, {1, 3, 3, 3, 1, 55, 41, 123, 209, 195, 1423, 2467, 3809, 11169, 23593, 8703, 40975, 175651}}, {21152, 18, 130180, {1, 3, 7, 9, 31, 57, 31, 115, 415, 445, 557, 3971, 1565, 15223, 7799, 10463, 117387, 225127}}, {21153, 18, 130214, {1, 3, 5, 11, 31, 19, 3, 63, 315, 501, 903, 1925, 3393, 16149, 11013, 15483, 70765, 279}}, {21154, 18, 130228, {1, 3, 3, 9, 29, 21, 13, 227, 263, 815, 1259, 2549, 955, 9237, 16083, 38891, 31145, 731}}, {21155, 18, 130240, {1, 3, 3, 5, 27, 23, 33, 189, 107, 655, 889, 1549, 7315, 13341, 12721, 59339, 54503, 91679}}, {21156, 18, 130267, {1, 3, 7, 5, 15, 9, 1, 255, 451, 91, 1279, 2359, 5913, 5215, 23161, 29327, 45275, 206709}}, {21157, 18, 130280, {1, 3, 3, 9, 9, 41, 75, 91, 87, 695, 335, 3375, 7307, 14095, 5359, 7815, 9339, 46387}}, {21158, 18, 130294, {1, 1, 3, 15, 5, 47, 69, 231, 423, 255, 1335, 3395, 2799, 8955, 31445, 59849, 104955, 240587}}, {21159, 18, 130306, {1, 3, 5, 7, 7, 9, 21, 209, 321, 5, 653, 2199, 3657, 6397, 20229, 32349, 54543, 47971}}, {21160, 18, 130325, {1, 3, 7, 11, 31, 21, 85, 49, 197, 865, 53, 609, 1867, 14503, 12671, 61703, 39245, 8493}}, {21161, 18, 130398, {1, 3, 1, 13, 27, 31, 119, 247, 209, 65, 1729, 1563, 1597, 1617, 26597, 50139, 108667, 77035}}, {21162, 18, 130402, {1, 1, 5, 13, 3, 49, 53, 219, 71, 1013, 1239, 3725, 117, 9273, 8277, 32619, 45933, 71509}}, {21163, 18, 130421, {1, 3, 7, 13, 1, 3, 119, 153, 79, 555, 429, 1221, 3725, 6073, 1295, 7187, 117709, 258911}}, {21164, 18, 130438, {1, 3, 3, 13, 1, 13, 105, 185, 81, 989, 563, 3761, 6725, 4699, 10539, 50247, 95307, 211927}}, {21165, 18, 130441, {1, 3, 7, 3, 21, 11, 45, 81, 495, 391, 1437, 3495, 3789, 13701, 9479, 42505, 22561, 135019}}, {21166, 18, 130475, {1, 3, 3, 11, 7, 61, 65, 211, 269, 997, 385, 3843, 4905, 2939, 28551, 19515, 25177, 68137}}, {21167, 18, 130486, {1, 1, 3, 3, 3, 47, 73, 127, 15, 977, 209, 1791, 4711, 6733, 29093, 36311, 13665, 240603}}, {21168, 18, 130503, {1, 3, 5, 5, 19, 39, 29, 211, 463, 755, 1723, 397, 213, 14009, 22701, 7131, 35587, 183885}}, {21169, 18, 130551, {1, 3, 5, 9, 11, 29, 7, 25, 381, 631, 1343, 2255, 2535, 3239, 7287, 14161, 69295, 85245}}, {21170, 18, 130574, {1, 1, 5, 5, 17, 47, 19, 217, 289, 411, 1855, 323, 4109, 2601, 5835, 61909, 99333, 99959}}, {21171, 18, 130602, {1, 1, 3, 11, 1, 51, 121, 207, 403, 993, 1171, 3451, 3389, 957, 22125, 9333, 110775, 54125}}, {21172, 18, 130612, {1, 3, 5, 15, 9, 51, 13, 251, 203, 861, 321, 2017, 6933, 10785, 20089, 65213, 105451, 117319}}, {21173, 18, 130621, {1, 3, 3, 15, 19, 63, 89, 217, 269, 723, 57, 1923, 4267, 4895, 2191, 21605, 62401, 11063}}, {21174, 18, 130633, {1, 3, 1, 3, 21, 47, 103, 75, 167, 989, 1401, 575, 3717, 10373, 21321, 5487, 36063, 140411}}, {21175, 18, 130684, {1, 1, 7, 15, 19, 29, 121, 197, 429, 773, 901, 1875, 291, 11395, 31459, 55041, 49263, 185143}}, {21176, 18, 130688, {1, 3, 3, 1, 19, 17, 19, 21, 41, 885, 1665, 547, 5887, 6205, 3317, 59399, 125559, 82721}}, {21177, 18, 130698, {1, 3, 1, 9, 15, 39, 81, 9, 279, 33, 1287, 3035, 5759, 10647, 3933, 20953, 3137, 30693}}, {21178, 18, 130700, {1, 3, 5, 13, 3, 33, 33, 169, 233, 83, 467, 3719, 5617, 6165, 15631, 56059, 95541, 245233}}, {21179, 18, 130712, {1, 3, 5, 13, 5, 21, 81, 9, 413, 247, 1307, 3363, 3383, 11525, 1259, 8735, 36507, 98359}}, {21180, 18, 130739, {1, 1, 1, 13, 17, 49, 105, 131, 385, 309, 1295, 565, 8031, 15391, 31263, 52657, 102721, 212195}}, {21181, 18, 130748, {1, 3, 1, 7, 13, 41, 21, 103, 237, 649, 55, 1565, 6327, 8743, 15457, 29975, 34165, 80839}}, {21182, 18, 130774, {1, 3, 5, 11, 15, 31, 121, 219, 375, 159, 731, 59, 3205, 15039, 10023, 46209, 34619, 110253}}, {21183, 18, 130783, {1, 3, 3, 11, 31, 19, 79, 185, 363, 635, 463, 987, 2681, 6405, 30077, 21173, 14213, 58095}}, {21184, 18, 130802, {1, 1, 5, 13, 23, 37, 57, 111, 293, 553, 269, 3393, 345, 1983, 1097, 47217, 22281, 212607}}, {21185, 18, 130811, {1, 3, 5, 7, 7, 33, 65, 61, 185, 411, 187, 641, 6437, 4625, 17547, 38941, 81119, 48651}}, {21186, 18, 130836, {1, 1, 7, 3, 19, 25, 39, 243, 139, 465, 691, 713, 7879, 14539, 31669, 35871, 130681, 255929}}, {21187, 18, 130840, {1, 3, 1, 1, 3, 43, 87, 13, 179, 835, 719, 1189, 7207, 5863, 6077, 20669, 35469, 211155}}, {21188, 18, 130856, {1, 3, 7, 13, 25, 59, 97, 129, 151, 985, 739, 1919, 7729, 14057, 21721, 17603, 82797, 181319}}, {21189, 18, 130864, {1, 1, 7, 7, 5, 3, 21, 141, 379, 257, 207, 597, 4051, 7563, 25481, 59427, 45449, 61159}}, {21190, 18, 130873, {1, 3, 3, 9, 11, 25, 5, 29, 131, 603, 637, 189, 4033, 13099, 15219, 4447, 73501, 135795}}, {21191, 18, 130918, {1, 3, 1, 9, 1, 49, 57, 227, 141, 543, 1499, 3525, 3127, 11191, 4071, 47003, 7431, 155137}}, {21192, 18, 130927, {1, 3, 1, 11, 27, 31, 15, 31, 113, 135, 1251, 245, 6965, 14263, 5679, 55201, 121453, 132503}}, {21193, 18, 130929, {1, 1, 5, 15, 7, 23, 67, 163, 57, 513, 1809, 1343, 6165, 199, 31169, 30803, 86705, 71103}}, {21194, 18, 130958, {1, 1, 3, 1, 15, 9, 75, 143, 273, 797, 819, 4037, 2305, 4841, 15697, 41191, 38187, 174131}}, {21195, 18, 130966, {1, 3, 7, 7, 3, 55, 65, 135, 423, 185, 299, 2221, 7987, 4223, 28183, 32273, 95941, 260297}}, {21196, 18, 130970, {1, 1, 7, 7, 7, 11, 67, 109, 507, 673, 1555, 2537, 7553, 4659, 3945, 20839, 32539, 43053}}, {21197, 18, 130976, {1, 1, 7, 15, 1, 47, 61, 73, 211, 397, 1785, 4063, 6461, 13725, 11299, 17565, 80063, 118271}}, {21198, 18, 131006, {1, 1, 7, 5, 29, 27, 97, 105, 379, 153, 915, 2795, 4933, 6729, 21207, 9995, 70241, 85641}}, {21199, 18, 131008, {1, 3, 5, 5, 23, 13, 41, 67, 127, 649, 1351, 3597, 7077, 4989, 14649, 17401, 70883, 239841}}, {21200, 18, 131020, {1, 1, 5, 1, 19, 1, 83, 3, 425, 873, 1943, 3935, 4257, 14587, 11829, 55217, 21963, 39683}}, {21201, 18, 131059, {1, 1, 7, 11, 15, 7, 37, 239, 337, 245, 1557, 3681, 7357, 9639, 27367, 26869, 114603, 86317}} }; void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions) { assert(dimensions <= SOBOL_MAX_DIMENSIONS); const uint L = SOBOL_BITS; /* first dimension is exception */ uint *v = vectors[0]; for(uint i = 0; i < L; i++) v[i] = 1 << (31-i); // all m's = 1 for(int dim = 1; dim < dimensions; dim++) { SobolDirectionNumbers *numbers = &SOBOL_NUMBERS[dim-1]; uint s = numbers->s; uint a = numbers->a; uint *m = numbers->m; v = vectors[dim]; if(L <= s) { for(uint i = 0; i < L; i++) v[i] = m[i] << (31-i); } else { for(uint i = 0; i < s; i++) v[i] = m[i] << (31-i); for(uint i = s; i < L; i++) { v[i] = v[i-s] ^ (v[i-s] >> s); for(uint k = 1; k < s; k++) v[i] ^= (((a >> (s-1-k)) & 1) * v[i-k]); } } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/sobol.h000066400000000000000000000015631334742672700211500ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SOBOL_H__ #define __SOBOL_H__ #include "util/util_types.h" CCL_NAMESPACE_BEGIN #define SOBOL_BITS 32 #define SOBOL_MAX_DIMENSIONS 21201 void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions); CCL_NAMESPACE_END #endif /* __SOBOL_H__ */ goxel-0.8.1/ext_src/cycles/src/render/svm.cpp000066400000000000000000000655601334742672700212010ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/graph.h" #include "render/light.h" #include "render/mesh.h" #include "render/nodes.h" #include "render/scene.h" #include "render/shader.h" #include "render/svm.h" #include "util/util_logging.h" #include "util/util_foreach.h" #include "util/util_progress.h" #include "util/util_task.h" CCL_NAMESPACE_BEGIN /* Shader Manager */ SVMShaderManager::SVMShaderManager() { } SVMShaderManager::~SVMShaderManager() { } void SVMShaderManager::reset(Scene * /*scene*/) { } void SVMShaderManager::device_update_shader(Scene *scene, Shader *shader, Progress *progress, array *global_svm_nodes) { if(progress->get_cancel()) { return; } assert(shader->graph); array svm_nodes; svm_nodes.push_back_slow(make_int4(NODE_SHADER_JUMP, 0, 0, 0)); SVMCompiler::Summary summary; SVMCompiler compiler(scene->shader_manager, scene->image_manager); compiler.background = (shader == scene->default_background); compiler.compile(scene, shader, svm_nodes, 0, &summary); VLOG(2) << "Compilation summary:\n" << "Shader name: " << shader->name << "\n" << summary.full_report(); nodes_lock_.lock(); if(shader->use_mis && shader->has_surface_emission) { scene->light_manager->need_update = true; } /* The copy needs to be done inside the lock, if another thread resizes the array * while memcpy is running, it'll be copying into possibly invalid/freed ram. */ size_t global_nodes_size = global_svm_nodes->size(); global_svm_nodes->resize(global_nodes_size + svm_nodes.size()); /* Offset local SVM nodes to a global address space. */ int4& jump_node = (*global_svm_nodes)[shader->id]; jump_node.y = svm_nodes[0].y + global_nodes_size - 1; jump_node.z = svm_nodes[0].z + global_nodes_size - 1; jump_node.w = svm_nodes[0].w + global_nodes_size - 1; /* Copy new nodes to global storage. */ memcpy(&(*global_svm_nodes)[global_nodes_size], &svm_nodes[1], sizeof(int4) * (svm_nodes.size() - 1)); nodes_lock_.unlock(); } void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { if(!need_update) return; VLOG(1) << "Total " << scene->shaders.size() << " shaders."; double start_time = time_dt(); /* test if we need to update */ device_free(device, dscene, scene); /* determine which shaders are in use */ device_update_shaders_used(scene); /* svm_nodes */ array svm_nodes; size_t i; for(i = 0; i < scene->shaders.size(); i++) { svm_nodes.push_back_slow(make_int4(NODE_SHADER_JUMP, 0, 0, 0)); } TaskPool task_pool; foreach(Shader *shader, scene->shaders) { task_pool.push(function_bind(&SVMShaderManager::device_update_shader, this, scene, shader, &progress, &svm_nodes), false); } task_pool.wait_work(); if(progress.get_cancel()) { return; } dscene->svm_nodes.steal_data(svm_nodes); dscene->svm_nodes.copy_to_device(); for(i = 0; i < scene->shaders.size(); i++) { Shader *shader = scene->shaders[i]; shader->need_update = false; } device_update_common(device, dscene, scene, progress); need_update = false; VLOG(1) << "Shader manager updated " << scene->shaders.size() << " shaders in " << time_dt() - start_time << " seconds."; } void SVMShaderManager::device_free(Device *device, DeviceScene *dscene, Scene *scene) { device_free_common(device, dscene, scene); dscene->svm_nodes.free(); } /* Graph Compiler */ SVMCompiler::SVMCompiler(ShaderManager *shader_manager_, ImageManager *image_manager_) { shader_manager = shader_manager_; image_manager = image_manager_; max_stack_use = 0; current_type = SHADER_TYPE_SURFACE; current_shader = NULL; current_graph = NULL; background = false; mix_weight_offset = SVM_STACK_INVALID; compile_failed = false; } int SVMCompiler::stack_size(SocketType::Type type) { int size = 0; switch(type) { case SocketType::FLOAT: case SocketType::INT: size = 1; break; case SocketType::COLOR: case SocketType::VECTOR: case SocketType::NORMAL: case SocketType::POINT: size = 3; break; case SocketType::CLOSURE: size = 0; break; default: assert(0); break; } return size; } int SVMCompiler::stack_find_offset(int size) { int offset = -1; /* find free space in stack & mark as used */ for(int i = 0, num_unused = 0; i < SVM_STACK_SIZE; i++) { if(active_stack.users[i]) num_unused = 0; else num_unused++; if(num_unused == size) { offset = i+1 - size; max_stack_use = max(i+1, max_stack_use); while(i >= offset) active_stack.users[i--] = 1; return offset; } } if(!compile_failed) { compile_failed = true; fprintf(stderr, "Cycles: out of SVM stack space, shader \"%s\" too big.\n", current_shader->name.c_str()); } return 0; } int SVMCompiler::stack_find_offset(SocketType::Type type) { return stack_find_offset(stack_size(type)); } void SVMCompiler::stack_clear_offset(SocketType::Type type, int offset) { int size = stack_size(type); for(int i = 0; i < size; i++) active_stack.users[offset + i]--; } int SVMCompiler::stack_assign(ShaderInput *input) { /* stack offset assign? */ if(input->stack_offset == SVM_STACK_INVALID) { if(input->link) { /* linked to output -> use output offset */ input->stack_offset = input->link->stack_offset; } else { Node *node = input->parent; /* not linked to output -> add nodes to load default value */ input->stack_offset = stack_find_offset(input->type()); if(input->type() == SocketType::FLOAT) { add_node(NODE_VALUE_F, __float_as_int(node->get_float(input->socket_type)), input->stack_offset); } else if(input->type() == SocketType::INT) { add_node(NODE_VALUE_F, node->get_int(input->socket_type), input->stack_offset); } else if(input->type() == SocketType::VECTOR || input->type() == SocketType::NORMAL || input->type() == SocketType::POINT || input->type() == SocketType::COLOR) { add_node(NODE_VALUE_V, input->stack_offset); add_node(NODE_VALUE_V, node->get_float3(input->socket_type)); } else /* should not get called for closure */ assert(0); } } return input->stack_offset; } int SVMCompiler::stack_assign(ShaderOutput *output) { /* if no stack offset assigned yet, find one */ if(output->stack_offset == SVM_STACK_INVALID) output->stack_offset = stack_find_offset(output->type()); return output->stack_offset; } int SVMCompiler::stack_assign_if_linked(ShaderInput *input) { if(input->link) return stack_assign(input); return SVM_STACK_INVALID; } int SVMCompiler::stack_assign_if_linked(ShaderOutput *output) { if(!output->links.empty()) return stack_assign(output); return SVM_STACK_INVALID; } void SVMCompiler::stack_link(ShaderInput *input, ShaderOutput *output) { if(output->stack_offset == SVM_STACK_INVALID) { assert(input->link); assert(stack_size(output->type()) == stack_size(input->link->type())); output->stack_offset = input->link->stack_offset; int size = stack_size(output->type()); for(int i = 0; i < size; i++) active_stack.users[output->stack_offset + i]++; } } void SVMCompiler::stack_clear_users(ShaderNode *node, ShaderNodeSet& done) { /* optimization we should add: * find and lower user counts for outputs for which all inputs are done. * this is done before the node is compiled, under the assumption that the * node will first load all inputs from the stack and then writes its * outputs. this used to work, but was disabled because it gave trouble * with inputs getting stack positions assigned */ foreach(ShaderInput *input, node->inputs) { ShaderOutput *output = input->link; if(output && output->stack_offset != SVM_STACK_INVALID) { bool all_done = true; /* optimization we should add: verify if in->parent is actually used */ foreach(ShaderInput *in, output->links) if(in->parent != node && done.find(in->parent) == done.end()) all_done = false; if(all_done) { stack_clear_offset(output->type(), output->stack_offset); output->stack_offset = SVM_STACK_INVALID; foreach(ShaderInput *in, output->links) in->stack_offset = SVM_STACK_INVALID; } } } } void SVMCompiler::stack_clear_temporary(ShaderNode *node) { foreach(ShaderInput *input, node->inputs) { if(!input->link && input->stack_offset != SVM_STACK_INVALID) { stack_clear_offset(input->type(), input->stack_offset); input->stack_offset = SVM_STACK_INVALID; } } } uint SVMCompiler::encode_uchar4(uint x, uint y, uint z, uint w) { assert(x <= 255); assert(y <= 255); assert(z <= 255); assert(w <= 255); return (x) | (y << 8) | (z << 16) | (w << 24); } void SVMCompiler::add_node(int a, int b, int c, int d) { current_svm_nodes.push_back_slow(make_int4(a, b, c, d)); } void SVMCompiler::add_node(ShaderNodeType type, int a, int b, int c) { current_svm_nodes.push_back_slow(make_int4(type, a, b, c)); } void SVMCompiler::add_node(ShaderNodeType type, const float3& f) { current_svm_nodes.push_back_slow(make_int4(type, __float_as_int(f.x), __float_as_int(f.y), __float_as_int(f.z))); } void SVMCompiler::add_node(const float4& f) { current_svm_nodes.push_back_slow(make_int4( __float_as_int(f.x), __float_as_int(f.y), __float_as_int(f.z), __float_as_int(f.w))); } uint SVMCompiler::attribute(ustring name) { return shader_manager->get_attribute_id(name); } uint SVMCompiler::attribute(AttributeStandard std) { return shader_manager->get_attribute_id(std); } uint SVMCompiler::attribute_standard(ustring name) { AttributeStandard std = Attribute::name_standard(name.c_str()); return (std)? attribute(std): attribute(name); } bool SVMCompiler::node_skip_input(ShaderNode * /*node*/, ShaderInput *input) { /* nasty exception .. */ if(current_type == SHADER_TYPE_DISPLACEMENT && input->link && input->link->parent->special_type == SHADER_SPECIAL_TYPE_BUMP) return true; return false; } void SVMCompiler::find_dependencies(ShaderNodeSet& dependencies, const ShaderNodeSet& done, ShaderInput *input, ShaderNode *skip_node) { ShaderNode *node = (input->link)? input->link->parent: NULL; if(node != NULL && done.find(node) == done.end() && node != skip_node && dependencies.find(node) == dependencies.end()) { foreach(ShaderInput *in, node->inputs) if(!node_skip_input(node, in)) find_dependencies(dependencies, done, in, skip_node); dependencies.insert(node); } } void SVMCompiler::generate_node(ShaderNode *node, ShaderNodeSet& done) { node->compile(*this); stack_clear_users(node, done); stack_clear_temporary(node); if(current_type == SHADER_TYPE_SURFACE) { if(node->has_spatial_varying()) current_shader->has_surface_spatial_varying = true; } else if(current_type == SHADER_TYPE_VOLUME) { if(node->has_spatial_varying()) current_shader->has_volume_spatial_varying = true; } if(node->has_object_dependency()) { current_shader->has_object_dependency = true; } if(node->has_attribute_dependency()) { current_shader->has_attribute_dependency = true; } if(node->has_integrator_dependency()) { current_shader->has_integrator_dependency = true; } } void SVMCompiler::generate_svm_nodes(const ShaderNodeSet& nodes, CompilerState *state) { ShaderNodeSet& done = state->nodes_done; vector& done_flag = state->nodes_done_flag; bool nodes_done; do { nodes_done = true; foreach(ShaderNode *node, nodes) { if(!done_flag[node->id]) { bool inputs_done = true; foreach(ShaderInput *input, node->inputs) if(!node_skip_input(node, input)) if(input->link && !done_flag[input->link->parent->id]) inputs_done = false; if(inputs_done) { generate_node(node, done); done.insert(node); done_flag[node->id] = true; } else nodes_done = false; } } } while(!nodes_done); } void SVMCompiler::generate_closure_node(ShaderNode *node, CompilerState *state) { /* execute dependencies for closure */ foreach(ShaderInput *in, node->inputs) { if(!node_skip_input(node, in) && in->link) { ShaderNodeSet dependencies; find_dependencies(dependencies, state->nodes_done, in); generate_svm_nodes(dependencies, state); } } /* closure mix weight */ const char *weight_name = (current_type == SHADER_TYPE_VOLUME)? "VolumeMixWeight": "SurfaceMixWeight"; ShaderInput *weight_in = node->input(weight_name); if(weight_in && (weight_in->link || node->get_float(weight_in->socket_type) != 1.0f)) mix_weight_offset = stack_assign(weight_in); else mix_weight_offset = SVM_STACK_INVALID; /* compile closure itself */ generate_node(node, state->nodes_done); mix_weight_offset = SVM_STACK_INVALID; if(current_type == SHADER_TYPE_SURFACE) { if(node->has_surface_emission()) current_shader->has_surface_emission = true; if(node->has_surface_transparent()) current_shader->has_surface_transparent = true; if(node->has_surface_bssrdf()) { current_shader->has_surface_bssrdf = true; if(node->has_bssrdf_bump()) current_shader->has_bssrdf_bump = true; } if(node->has_bump()) { current_shader->has_bump = true; } } } void SVMCompiler::generated_shared_closure_nodes(ShaderNode *root_node, ShaderNode *node, CompilerState *state, const ShaderNodeSet& shared) { if(shared.find(node) != shared.end()) { generate_multi_closure(root_node, node, state); } else { foreach(ShaderInput *in, node->inputs) { if(in->type() == SocketType::CLOSURE && in->link) generated_shared_closure_nodes(root_node, in->link->parent, state, shared); } } } void SVMCompiler::generate_multi_closure(ShaderNode *root_node, ShaderNode *node, CompilerState *state) { /* only generate once */ if(state->closure_done.find(node) != state->closure_done.end()) return; state->closure_done.insert(node); if(node->special_type == SHADER_SPECIAL_TYPE_COMBINE_CLOSURE) { /* weighting is already taken care of in ShaderGraph::transform_multi_closure */ ShaderInput *cl1in = node->input("Closure1"); ShaderInput *cl2in = node->input("Closure2"); ShaderInput *facin = node->input("Fac"); /* skip empty mix/add closure nodes */ if(!cl1in->link && !cl2in->link) return; if(facin && facin->link) { /* mix closure: generate instructions to compute mix weight */ ShaderNodeSet dependencies; find_dependencies(dependencies, state->nodes_done, facin); generate_svm_nodes(dependencies, state); /* execute shared dependencies. this is needed to allow skipping * of zero weight closures and their dependencies later, so we * ensure that they only skip dependencies that are unique to them */ ShaderNodeSet cl1deps, cl2deps, shareddeps; find_dependencies(cl1deps, state->nodes_done, cl1in); find_dependencies(cl2deps, state->nodes_done, cl2in); ShaderNodeIDComparator node_id_comp; set_intersection(cl1deps.begin(), cl1deps.end(), cl2deps.begin(), cl2deps.end(), std::inserter(shareddeps, shareddeps.begin()), node_id_comp); /* it's possible some nodes are not shared between this mix node * inputs, but still needed to be always executed, this mainly * happens when a node of current subbranch is used by a parent * node or so */ if(root_node != node) { foreach(ShaderInput *in, root_node->inputs) { ShaderNodeSet rootdeps; find_dependencies(rootdeps, state->nodes_done, in, node); set_intersection(rootdeps.begin(), rootdeps.end(), cl1deps.begin(), cl1deps.end(), std::inserter(shareddeps, shareddeps.begin()), node_id_comp); set_intersection(rootdeps.begin(), rootdeps.end(), cl2deps.begin(), cl2deps.end(), std::inserter(shareddeps, shareddeps.begin()), node_id_comp); } } if(!shareddeps.empty()) { if(cl1in->link) { generated_shared_closure_nodes(root_node, cl1in->link->parent, state, shareddeps); } if(cl2in->link) { generated_shared_closure_nodes(root_node, cl2in->link->parent, state, shareddeps); } generate_svm_nodes(shareddeps, state); } /* generate instructions for input closure 1 */ if(cl1in->link) { /* Add instruction to skip closure and its dependencies if mix * weight is zero. */ current_svm_nodes.push_back_slow(make_int4(NODE_JUMP_IF_ONE, 0, stack_assign(facin), 0)); int node_jump_skip_index = current_svm_nodes.size() - 1; generate_multi_closure(root_node, cl1in->link->parent, state); /* Fill in jump instruction location to be after closure. */ current_svm_nodes[node_jump_skip_index].y = current_svm_nodes.size() - node_jump_skip_index - 1; } /* generate instructions for input closure 2 */ if(cl2in->link) { /* Add instruction to skip closure and its dependencies if mix * weight is zero. */ current_svm_nodes.push_back_slow(make_int4(NODE_JUMP_IF_ZERO, 0, stack_assign(facin), 0)); int node_jump_skip_index = current_svm_nodes.size() - 1; generate_multi_closure(root_node, cl2in->link->parent, state); /* Fill in jump instruction location to be after closure. */ current_svm_nodes[node_jump_skip_index].y = current_svm_nodes.size() - node_jump_skip_index - 1; } /* unassign */ facin->stack_offset = SVM_STACK_INVALID; } else { /* execute closures and their dependencies, no runtime checks * to skip closures here because was already optimized due to * fixed weight or add closure that always needs both */ if(cl1in->link) generate_multi_closure(root_node, cl1in->link->parent, state); if(cl2in->link) generate_multi_closure(root_node, cl2in->link->parent, state); } } else { generate_closure_node(node, state); } state->nodes_done.insert(node); state->nodes_done_flag[node->id] = true; } void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType type) { /* Converting a shader graph into svm_nodes that can be executed * sequentially on the virtual machine is fairly simple. We can keep * looping over nodes and each time all the inputs of a node are * ready, we add svm_nodes for it that read the inputs from the * stack and write outputs back to the stack. * * With the SVM, we always sample only a single closure. We can think * of all closures nodes as a binary tree with mix closures as inner * nodes and other closures as leafs. The SVM will traverse that tree, * each time deciding to go left or right depending on the mix weights, * until a closure is found. * * We only execute nodes that are needed for the mix weights and chosen * closure. */ current_type = type; current_graph = graph; /* get input in output node */ ShaderNode *node = graph->output(); ShaderInput *clin = NULL; switch(type) { case SHADER_TYPE_SURFACE: clin = node->input("Surface"); break; case SHADER_TYPE_VOLUME: clin = node->input("Volume"); break; case SHADER_TYPE_DISPLACEMENT: clin = node->input("Displacement"); break; case SHADER_TYPE_BUMP: clin = node->input("Normal"); break; default: assert(0); break; } /* clear all compiler state */ memset(&active_stack, 0, sizeof(active_stack)); current_svm_nodes.clear(); foreach(ShaderNode *node_iter, graph->nodes) { foreach(ShaderInput *input, node_iter->inputs) input->stack_offset = SVM_STACK_INVALID; foreach(ShaderOutput *output, node_iter->outputs) output->stack_offset = SVM_STACK_INVALID; } /* for the bump shader we need add a node to store the shader state */ bool need_bump_state = (type == SHADER_TYPE_BUMP) && (shader->displacement_method == DISPLACE_BOTH); int bump_state_offset = SVM_STACK_INVALID; if(need_bump_state) { bump_state_offset = stack_find_offset(SVM_BUMP_EVAL_STATE_SIZE); add_node(NODE_ENTER_BUMP_EVAL, bump_state_offset); } if(shader->used) { if(clin->link) { bool generate = false; switch(type) { case SHADER_TYPE_SURFACE: /* generate surface shader */ generate = true; shader->has_surface = true; break; case SHADER_TYPE_VOLUME: /* generate volume shader */ generate = true; shader->has_volume = true; break; case SHADER_TYPE_DISPLACEMENT: /* generate displacement shader */ generate = true; shader->has_displacement = true; break; case SHADER_TYPE_BUMP: /* generate bump shader */ generate = true; break; default: break; } if(generate) { CompilerState state(graph); generate_multi_closure(clin->link->parent, clin->link->parent, &state); } } /* compile output node */ node->compile(*this); } /* add node to restore state after bump shader has finished */ if(need_bump_state) { add_node(NODE_LEAVE_BUMP_EVAL, bump_state_offset); } /* if compile failed, generate empty shader */ if(compile_failed) { current_svm_nodes.clear(); compile_failed = false; } /* for bump shaders we fall thru to the surface shader, but if this is any other kind of shader it ends here */ if(type != SHADER_TYPE_BUMP) { add_node(NODE_END, 0, 0, 0); } } void SVMCompiler::compile(Scene *scene, Shader *shader, array& svm_nodes, int index, Summary *summary) { /* copy graph for shader with bump mapping */ ShaderNode *output = shader->graph->output(); int start_num_svm_nodes = svm_nodes.size(); const double time_start = time_dt(); bool has_bump = (shader->displacement_method != DISPLACE_TRUE) && output->input("Surface")->link && output->input("Displacement")->link; /* finalize */ { scoped_timer timer((summary != NULL)? &summary->time_finalize: NULL); shader->graph->finalize(scene, has_bump, shader->has_integrator_dependency, shader->displacement_method == DISPLACE_BOTH); } current_shader = shader; shader->has_surface = false; shader->has_surface_emission = false; shader->has_surface_transparent = false; shader->has_surface_bssrdf = false; shader->has_bump = has_bump; shader->has_bssrdf_bump = has_bump; shader->has_volume = false; shader->has_displacement = false; shader->has_surface_spatial_varying = false; shader->has_volume_spatial_varying = false; shader->has_object_dependency = false; shader->has_attribute_dependency = false; shader->has_integrator_dependency = false; /* generate bump shader */ if(has_bump) { scoped_timer timer((summary != NULL)? &summary->time_generate_bump: NULL); compile_type(shader, shader->graph, SHADER_TYPE_BUMP); svm_nodes[index].y = svm_nodes.size(); svm_nodes.append(current_svm_nodes); } /* generate surface shader */ { scoped_timer timer((summary != NULL)? &summary->time_generate_surface: NULL); compile_type(shader, shader->graph, SHADER_TYPE_SURFACE); /* only set jump offset if there's no bump shader, as the bump shader will fall thru to this one if it exists */ if(!has_bump) { svm_nodes[index].y = svm_nodes.size(); } svm_nodes.append(current_svm_nodes); } /* generate volume shader */ { scoped_timer timer((summary != NULL)? &summary->time_generate_volume: NULL); compile_type(shader, shader->graph, SHADER_TYPE_VOLUME); svm_nodes[index].z = svm_nodes.size(); svm_nodes.append(current_svm_nodes); } /* generate displacement shader */ { scoped_timer timer((summary != NULL)? &summary->time_generate_displacement: NULL); compile_type(shader, shader->graph, SHADER_TYPE_DISPLACEMENT); svm_nodes[index].w = svm_nodes.size(); svm_nodes.append(current_svm_nodes); } /* Fill in summary information. */ if(summary != NULL) { summary->time_total = time_dt() - time_start; summary->peak_stack_usage = max_stack_use; summary->num_svm_nodes = svm_nodes.size() - start_num_svm_nodes; } } /* Compiler summary implementation. */ SVMCompiler::Summary::Summary() : num_svm_nodes(0), peak_stack_usage(0), time_finalize(0.0), time_generate_surface(0.0), time_generate_bump(0.0), time_generate_volume(0.0), time_generate_displacement(0.0), time_total(0.0) { } string SVMCompiler::Summary::full_report() const { string report = ""; report += string_printf("Number of SVM nodes: %d\n", num_svm_nodes); report += string_printf("Peak stack usage: %d\n", peak_stack_usage); report += string_printf("Time (in seconds):\n"); report += string_printf("Finalize: %f\n", time_finalize); report += string_printf(" Surface: %f\n", time_generate_surface); report += string_printf(" Bump: %f\n", time_generate_bump); report += string_printf(" Volume: %f\n", time_generate_volume); report += string_printf(" Displacement: %f\n", time_generate_displacement); report += string_printf("Generate: %f\n", time_generate_surface + time_generate_bump + time_generate_volume + time_generate_displacement); report += string_printf("Total: %f\n", time_total); return report; } /* Global state of the compiler. */ SVMCompiler::CompilerState::CompilerState(ShaderGraph *graph) { int max_id = 0; foreach(ShaderNode *node, graph->nodes) { max_id = max(node->id, max_id); } nodes_done_flag.resize(max_id + 1, false); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/svm.h000066400000000000000000000144761334742672700206460ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SVM_H__ #define __SVM_H__ #include "render/attribute.h" #include "render/graph.h" #include "render/shader.h" #include "util/util_set.h" #include "util/util_string.h" #include "util/util_thread.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class ImageManager; class Scene; class ShaderGraph; class ShaderInput; class ShaderNode; class ShaderOutput; /* Shader Manager */ class SVMShaderManager : public ShaderManager { public: SVMShaderManager(); ~SVMShaderManager(); void reset(Scene *scene); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress); void device_free(Device *device, DeviceScene *dscene, Scene *scene); protected: /* Lock used to synchronize threaded nodes compilation. */ thread_spin_lock nodes_lock_; void device_update_shader(Scene *scene, Shader *shader, Progress *progress, array *global_svm_nodes); }; /* Graph Compiler */ class SVMCompiler { public: struct Summary { Summary(); /* Number of SVM nodes shader was compiled into. */ int num_svm_nodes; /* Peak stack usage during shader evaluation. */ int peak_stack_usage; /* Time spent on surface graph finalization. */ double time_finalize; /* Time spent on generating SVM nodes for surface shader. */ double time_generate_surface; /* Time spent on generating SVM nodes for bump shader. */ double time_generate_bump; /* Time spent on generating SVM nodes for volume shader. */ double time_generate_volume; /* Time spent on generating SVM nodes for displacement shader. */ double time_generate_displacement; /* Total time spent on all routines. */ double time_total; /* A full multiline description of the state of the compiler after * compilation. */ string full_report() const; }; SVMCompiler(ShaderManager *shader_manager, ImageManager *image_manager); void compile(Scene *scene, Shader *shader, array& svm_nodes, int index, Summary *summary = NULL); int stack_assign(ShaderOutput *output); int stack_assign(ShaderInput *input); int stack_assign_if_linked(ShaderInput *input); int stack_assign_if_linked(ShaderOutput *output); int stack_find_offset(int size); int stack_find_offset(SocketType::Type type); void stack_clear_offset(SocketType::Type type, int offset); void stack_link(ShaderInput *input, ShaderOutput *output); void add_node(ShaderNodeType type, int a = 0, int b = 0, int c = 0); void add_node(int a = 0, int b = 0, int c = 0, int d = 0); void add_node(ShaderNodeType type, const float3& f); void add_node(const float4& f); uint attribute(ustring name); uint attribute(AttributeStandard std); uint attribute_standard(ustring name); uint encode_uchar4(uint x, uint y = 0, uint z = 0, uint w = 0); uint closure_mix_weight_offset() { return mix_weight_offset; } ShaderType output_type() { return current_type; } ImageManager *image_manager; ShaderManager *shader_manager; bool background; protected: /* stack */ struct Stack { Stack() { memset(users, 0, sizeof(users)); } Stack(const Stack& other) { memcpy(users, other.users, sizeof(users)); } Stack& operator=(const Stack& other) { memcpy(users, other.users, sizeof(users)); return *this; } bool empty() { for(int i = 0; i < SVM_STACK_SIZE; i++) if(users[i]) return false; return true; } void print() { printf("stack <"); for(int i = 0; i < SVM_STACK_SIZE; i++) printf((users[i])? "*": " "); printf(">\n"); } int users[SVM_STACK_SIZE]; }; /* Global state of the compiler accessible from the compilation routines. */ struct CompilerState { explicit CompilerState(ShaderGraph *graph); /* ** Global state, used by various compilation steps. ** */ /* Set of nodes which were already compiled. */ ShaderNodeSet nodes_done; /* Set of closures which were already compiled. */ ShaderNodeSet closure_done; /* ** SVM nodes generation state ** */ /* Flag whether the node with corresponding ID was already compiled or * not. Array element with index i corresponds to a node with such if. * * TODO(sergey): This is actually a copy of nodes_done just in another * notation. We can de-duplicate this storage actually after switching * all areas to use this flags array. */ vector nodes_done_flag; }; void stack_clear_temporary(ShaderNode *node); int stack_size(SocketType::Type type); void stack_clear_users(ShaderNode *node, ShaderNodeSet& done); bool node_skip_input(ShaderNode *node, ShaderInput *input); /* single closure */ void find_dependencies(ShaderNodeSet& dependencies, const ShaderNodeSet& done, ShaderInput *input, ShaderNode *skip_node = NULL); void generate_node(ShaderNode *node, ShaderNodeSet& done); void generate_closure_node(ShaderNode *node, CompilerState *state); void generated_shared_closure_nodes(ShaderNode *root_node, ShaderNode *node, CompilerState *state, const ShaderNodeSet& shared); void generate_svm_nodes(const ShaderNodeSet& nodes, CompilerState *state); /* multi closure */ void generate_multi_closure(ShaderNode *root_node, ShaderNode *node, CompilerState *state); /* compile */ void compile_type(Shader *shader, ShaderGraph *graph, ShaderType type); array current_svm_nodes; ShaderType current_type; Shader *current_shader; ShaderGraph *current_graph; Stack active_stack; int max_stack_use; uint mix_weight_offset; bool compile_failed; }; CCL_NAMESPACE_END #endif /* __SVM_H__ */ goxel-0.8.1/ext_src/cycles/src/render/tables.cpp000066400000000000000000000052721334742672700216400ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device/device.h" #include "render/scene.h" #include "render/tables.h" #include "util/util_logging.h" CCL_NAMESPACE_BEGIN /* Lookup Tables */ LookupTables::LookupTables() { need_update = true; } LookupTables::~LookupTables() { assert(lookup_tables.size() == 0); } void LookupTables::device_update(Device *, DeviceScene *dscene) { if(!need_update) return; VLOG(1) << "Total " << lookup_tables.size() << " lookup tables."; if(lookup_tables.size() > 0) dscene->lookup_table.copy_to_device(); need_update = false; } void LookupTables::device_free(Device *, DeviceScene *dscene) { dscene->lookup_table.free(); } static size_t round_up_to_multiple(size_t size, size_t chunk) { return ((size + chunk - 1)/chunk) * chunk; } size_t LookupTables::add_table(DeviceScene *dscene, vector& data) { assert(data.size() > 0); need_update = true; Table new_table; new_table.offset = 0; new_table.size = round_up_to_multiple(data.size(), TABLE_CHUNK_SIZE); /* find space to put lookup table */ list::iterator table; for(table = lookup_tables.begin(); table != lookup_tables.end(); table++) { if(new_table.offset + new_table.size <= table->offset) { lookup_tables.insert(table, new_table); break; } else new_table.offset = table->offset + table->size; } if(table == lookup_tables.end()) { /* add at the end */ lookup_tables.push_back(new_table); dscene->lookup_table.resize(new_table.offset + new_table.size); } /* copy table data and return offset */ float *dtable = dscene->lookup_table.data(); memcpy(dtable + new_table.offset, &data[0], sizeof(float) * data.size()); return new_table.offset; } void LookupTables::remove_table(size_t *offset) { if(*offset == TABLE_OFFSET_INVALID) { /* The table isn't even allocated, so just return here. */ return; } need_update = true; list
::iterator table; for(table = lookup_tables.begin(); table != lookup_tables.end(); table++) { if(table->offset == *offset) { lookup_tables.erase(table); *offset = TABLE_OFFSET_INVALID; return; } } assert(table != lookup_tables.end()); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/tables.h000066400000000000000000000023321334742672700212770ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __TABLES_H__ #define __TABLES_H__ #include "util/util_list.h" CCL_NAMESPACE_BEGIN class Device; class DeviceScene; class Scene; enum { TABLE_CHUNK_SIZE = 256 }; enum { TABLE_OFFSET_INVALID = -1 }; class LookupTables { public: struct Table { size_t offset; size_t size; }; bool need_update; list
lookup_tables; LookupTables(); ~LookupTables(); void device_update(Device *device, DeviceScene *dscene); void device_free(Device *device, DeviceScene *dscene); size_t add_table(DeviceScene *dscene, vector& data); void remove_table(size_t *offset); }; CCL_NAMESPACE_END #endif /* __TABLES_H__ */ goxel-0.8.1/ext_src/cycles/src/render/tile.cpp000066400000000000000000000364461334742672700213320ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/tile.h" #include "util/util_algorithm.h" #include "util/util_foreach.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN namespace { class TileComparator { public: TileComparator(TileOrder order_, int2 center_, Tile *tiles_) : order(order_), center(center_), tiles(tiles_) {} bool operator()(int a, int b) { switch(order) { case TILE_CENTER: { float2 dist_a = make_float2(center.x - (tiles[a].x + tiles[a].w/2), center.y - (tiles[a].y + tiles[a].h/2)); float2 dist_b = make_float2(center.x - (tiles[b].x + tiles[b].w/2), center.y - (tiles[b].y + tiles[b].h/2)); return dot(dist_a, dist_a) < dot(dist_b, dist_b); } case TILE_LEFT_TO_RIGHT: return (tiles[a].x == tiles[b].x)? (tiles[a].y < tiles[b].y): (tiles[a].x < tiles[b].x); case TILE_RIGHT_TO_LEFT: return (tiles[a].x == tiles[b].x)? (tiles[a].y < tiles[b].y): (tiles[a].x > tiles[b].x); case TILE_TOP_TO_BOTTOM: return (tiles[a].y == tiles[b].y)? (tiles[a].x < tiles[b].x): (tiles[a].y > tiles[b].y); case TILE_BOTTOM_TO_TOP: default: return (tiles[a].y == tiles[b].y)? (tiles[a].x < tiles[b].x): (tiles[a].y < tiles[b].y); } } protected: TileOrder order; int2 center; Tile *tiles; }; inline int2 hilbert_index_to_pos(int n, int d) { int2 r, xy = make_int2(0, 0); for(int s = 1; s < n; s *= 2) { r.x = (d >> 1) & 1; r.y = (d ^ r.x) & 1; if(!r.y) { if(r.x) { xy = make_int2(s-1, s-1) - xy; } swap(xy.x, xy.y); } xy += r*make_int2(s, s); d >>= 2; } return xy; } enum SpiralDirection { DIRECTION_UP, DIRECTION_LEFT, DIRECTION_DOWN, DIRECTION_RIGHT, }; } /* namespace */ TileManager::TileManager(bool progressive_, int num_samples_, int2 tile_size_, int start_resolution_, bool preserve_tile_device_, bool background_, TileOrder tile_order_, int num_devices_, int pixel_size_) { progressive = progressive_; tile_size = tile_size_; tile_order = tile_order_; start_resolution = start_resolution_; pixel_size = pixel_size_; num_samples = num_samples_; num_devices = num_devices_; preserve_tile_device = preserve_tile_device_; background = background_; schedule_denoising = false; range_start_sample = 0; range_num_samples = -1; BufferParams buffer_params; reset(buffer_params, 0); } TileManager::~TileManager() { } void TileManager::device_free() { if(schedule_denoising || progressive) { for(int i = 0; i < state.tiles.size(); i++) { delete state.tiles[i].buffers; state.tiles[i].buffers = NULL; } } state.tiles.clear(); } static int get_divider(int w, int h, int start_resolution) { int divider = 1; if(start_resolution != INT_MAX) { while(w*h > start_resolution*start_resolution) { w = max(1, w/2); h = max(1, h/2); divider <<= 1; } } return divider; } void TileManager::reset(BufferParams& params_, int num_samples_) { params = params_; set_samples(num_samples_); state.buffer = BufferParams(); state.sample = range_start_sample - 1; state.num_tiles = 0; state.num_samples = 0; state.resolution_divider = get_divider(params.width, params.height, start_resolution); state.render_tiles.clear(); state.denoising_tiles.clear(); device_free(); } void TileManager::set_samples(int num_samples_) { num_samples = num_samples_; /* No real progress indication is possible when using unlimited samples. */ if(num_samples == INT_MAX) { state.total_pixel_samples = 0; } else { uint64_t pixel_samples = 0; /* While rendering in the viewport, the initial preview resolution is increased to the native resolution * before the actual rendering begins. Therefore, additional pixel samples will be rendered. */ int divider = max(get_divider(params.width, params.height, start_resolution) / 2, pixel_size); while(divider > pixel_size) { int image_w = max(1, params.width/divider); int image_h = max(1, params.height/divider); pixel_samples += image_w * image_h; divider >>= 1; } int image_w = max(1, params.width/divider); int image_h = max(1, params.height/divider); state.total_pixel_samples = pixel_samples + (uint64_t)get_num_effective_samples() * image_w*image_h; if(schedule_denoising) { state.total_pixel_samples += params.width*params.height; } } } /* If sliced is false, splits image into tiles and assigns equal amount of tiles to every render device. * If sliced is true, slice image into as much pieces as how many devices are rendering this image. */ int TileManager::gen_tiles(bool sliced) { int resolution = state.resolution_divider; int image_w = max(1, params.width/resolution); int image_h = max(1, params.height/resolution); int2 center = make_int2(image_w/2, image_h/2); int num_logical_devices = preserve_tile_device? num_devices: 1; int num = min(image_h, num_logical_devices); int slice_num = sliced? num: 1; int tile_w = (tile_size.x >= image_w) ? 1 : divide_up(image_w, tile_size.x); device_free(); state.render_tiles.clear(); state.denoising_tiles.clear(); state.render_tiles.resize(num); state.denoising_tiles.resize(num); state.tile_stride = tile_w; vector >::iterator tile_list; tile_list = state.render_tiles.begin(); if(tile_order == TILE_HILBERT_SPIRAL) { assert(!sliced); int tile_h = (tile_size.y >= image_h) ? 1 : divide_up(image_h, tile_size.y); state.tiles.resize(tile_w*tile_h); /* Size of blocks in tiles, must be a power of 2 */ const int hilbert_size = (max(tile_size.x, tile_size.y) <= 12)? 8: 4; int tiles_per_device = divide_up(tile_w * tile_h, num); int cur_device = 0, cur_tiles = 0; int2 block_size = tile_size * make_int2(hilbert_size, hilbert_size); /* Number of blocks to fill the image */ int blocks_x = (block_size.x >= image_w)? 1: divide_up(image_w, block_size.x); int blocks_y = (block_size.y >= image_h)? 1: divide_up(image_h, block_size.y); int n = max(blocks_x, blocks_y) | 0x1; /* Side length of the spiral (must be odd) */ /* Offset of spiral (to keep it centered) */ int2 offset = make_int2((image_w - n*block_size.x)/2, (image_h - n*block_size.y)/2); offset = (offset / tile_size) * tile_size; /* Round to tile border. */ int2 block = make_int2(0, 0); /* Current block */ SpiralDirection prev_dir = DIRECTION_UP, dir = DIRECTION_UP; for(int i = 0;;) { /* Generate the tiles in the current block. */ for(int hilbert_index = 0; hilbert_index < hilbert_size*hilbert_size; hilbert_index++) { int2 tile, hilbert_pos = hilbert_index_to_pos(hilbert_size, hilbert_index); /* Rotate block according to spiral direction. */ if(prev_dir == DIRECTION_UP && dir == DIRECTION_UP) { tile = make_int2(hilbert_pos.y, hilbert_pos.x); } else if(dir == DIRECTION_LEFT || prev_dir == DIRECTION_LEFT) { tile = hilbert_pos; } else if(dir == DIRECTION_DOWN) { tile = make_int2(hilbert_size-1-hilbert_pos.y, hilbert_size-1-hilbert_pos.x); } else { tile = make_int2(hilbert_size-1-hilbert_pos.x, hilbert_size-1-hilbert_pos.y); } int2 pos = block*block_size + tile*tile_size + offset; /* Only add tiles which are in the image (tiles outside of the image can be generated since the spiral is always square). */ if(pos.x >= 0 && pos.y >= 0 && pos.x < image_w && pos.y < image_h) { int w = min(tile_size.x, image_w - pos.x); int h = min(tile_size.y, image_h - pos.y); int2 ipos = pos / tile_size; int idx = ipos.y*tile_w + ipos.x; state.tiles[idx] = Tile(idx, pos.x, pos.y, w, h, cur_device, Tile::RENDER); tile_list->push_front(idx); cur_tiles++; if(cur_tiles == tiles_per_device) { tile_list++; cur_tiles = 0; cur_device++; } } } /* Stop as soon as the spiral has reached the center block. */ if(block.x == (n-1)/2 && block.y == (n-1)/2) break; /* Advance to next block. */ prev_dir = dir; switch(dir) { case DIRECTION_UP: block.y++; if(block.y == (n-i-1)) { dir = DIRECTION_LEFT; } break; case DIRECTION_LEFT: block.x++; if(block.x == (n-i-1)) { dir = DIRECTION_DOWN; } break; case DIRECTION_DOWN: block.y--; if(block.y == i) { dir = DIRECTION_RIGHT; } break; case DIRECTION_RIGHT: block.x--; if(block.x == i+1) { dir = DIRECTION_UP; i++; } break; } } return tile_w*tile_h; } int idx = 0; for(int slice = 0; slice < slice_num; slice++) { int slice_y = (image_h/slice_num)*slice; int slice_h = (slice == slice_num-1)? image_h - slice*(image_h/slice_num): image_h/slice_num; int tile_h = (tile_size.y >= slice_h)? 1: divide_up(slice_h, tile_size.y); int tiles_per_device = divide_up(tile_w * tile_h, num); int cur_device = 0, cur_tiles = 0; for(int tile_y = 0; tile_y < tile_h; tile_y++) { for(int tile_x = 0; tile_x < tile_w; tile_x++, idx++) { int x = tile_x * tile_size.x; int y = tile_y * tile_size.y; int w = (tile_x == tile_w-1)? image_w - x: tile_size.x; int h = (tile_y == tile_h-1)? slice_h - y: tile_size.y; state.tiles.push_back(Tile(idx, x, y + slice_y, w, h, sliced? slice: cur_device, Tile::RENDER)); tile_list->push_back(idx); if(!sliced) { cur_tiles++; if(cur_tiles == tiles_per_device) { /* Tiles are already generated in Bottom-to-Top order, so no sort is necessary in that case. */ if(tile_order != TILE_BOTTOM_TO_TOP) { tile_list->sort(TileComparator(tile_order, center, &state.tiles[0])); } tile_list++; cur_tiles = 0; cur_device++; } } } } if(sliced) { tile_list++; } } return idx; } void TileManager::gen_render_tiles() { /* Regenerate just the render tiles for progressive render. */ foreach(Tile& tile, state.tiles) { state.render_tiles[tile.device].push_back(tile.index); } } void TileManager::set_tiles() { int resolution = state.resolution_divider; int image_w = max(1, params.width/resolution); int image_h = max(1, params.height/resolution); state.num_tiles = gen_tiles(!background); state.buffer.width = image_w; state.buffer.height = image_h; state.buffer.full_x = params.full_x/resolution; state.buffer.full_y = params.full_y/resolution; state.buffer.full_width = max(1, params.full_width/resolution); state.buffer.full_height = max(1, params.full_height/resolution); } int TileManager::get_neighbor_index(int index, int neighbor) { static const int dx[] = {-1, 0, 1, -1, 1, -1, 0, 1, 0}, dy[] = {-1, -1, -1, 0, 0, 1, 1, 1, 0}; int resolution = state.resolution_divider; int image_w = max(1, params.width/resolution); int image_h = max(1, params.height/resolution); int tile_w = (tile_size.x >= image_w)? 1: divide_up(image_w, tile_size.x); int tile_h = (tile_size.y >= image_h)? 1: divide_up(image_h, tile_size.y); int nx = state.tiles[index].x/tile_size.x + dx[neighbor], ny = state.tiles[index].y/tile_size.y + dy[neighbor]; if(nx < 0 || ny < 0 || nx >= tile_w || ny >= tile_h) return -1; return ny*state.tile_stride + nx; } /* Checks whether all neighbors of a tile (as well as the tile itself) are at least at state min_state. */ bool TileManager::check_neighbor_state(int index, Tile::State min_state) { if(index < 0 || state.tiles[index].state < min_state) { return false; } for(int neighbor = 0; neighbor < 9; neighbor++) { int nindex = get_neighbor_index(index, neighbor); /* Out-of-bounds tiles don't matter. */ if(nindex >= 0 && state.tiles[nindex].state < min_state) { return false; } } return true; } /* Returns whether the tile should be written (and freed if no denoising is used) instead of updating. */ bool TileManager::finish_tile(int index, bool &delete_tile) { delete_tile = false; if(progressive) { return true; } switch(state.tiles[index].state) { case Tile::RENDER: { if(!schedule_denoising) { state.tiles[index].state = Tile::DONE; delete_tile = true; return true; } state.tiles[index].state = Tile::RENDERED; /* For each neighbor and the tile itself, check whether all of its neighbors have been rendered. If yes, it can be denoised. */ for(int neighbor = 0; neighbor < 9; neighbor++) { int nindex = get_neighbor_index(index, neighbor); if(check_neighbor_state(nindex, Tile::RENDERED)) { state.tiles[nindex].state = Tile::DENOISE; state.denoising_tiles[state.tiles[nindex].device].push_back(nindex); } } return false; } case Tile::DENOISE: { state.tiles[index].state = Tile::DENOISED; /* For each neighbor and the tile itself, check whether all of its neighbors have been denoised. If yes, it can be freed. */ for(int neighbor = 0; neighbor < 9; neighbor++) { int nindex = get_neighbor_index(index, neighbor); if(check_neighbor_state(nindex, Tile::DENOISED)) { state.tiles[nindex].state = Tile::DONE; /* It can happen that the tile just finished denoising and already can be freed here. * However, in that case it still has to be written before deleting, so we can't delete it yet. */ if(neighbor == 8) { delete_tile = true; } else { delete state.tiles[nindex].buffers; state.tiles[nindex].buffers = NULL; } } } return true; } default: assert(false); return true; } } bool TileManager::next_tile(Tile* &tile, int device) { int logical_device = preserve_tile_device? device: 0; if(logical_device >= state.render_tiles.size()) return false; if(!state.denoising_tiles[logical_device].empty()) { int idx = state.denoising_tiles[logical_device].front(); state.denoising_tiles[logical_device].pop_front(); tile = &state.tiles[idx]; return true; } if(state.render_tiles[logical_device].empty()) return false; int idx = state.render_tiles[logical_device].front(); state.render_tiles[logical_device].pop_front(); tile = &state.tiles[idx]; return true; } bool TileManager::done() { int end_sample = (range_num_samples == -1) ? num_samples : range_start_sample + range_num_samples; return (state.resolution_divider == pixel_size) && (state.sample+state.num_samples >= end_sample); } bool TileManager::next() { if(done()) return false; if(progressive && state.resolution_divider > pixel_size) { state.sample = 0; state.resolution_divider = max(state.resolution_divider/2, pixel_size); state.num_samples = 1; set_tiles(); } else { state.sample++; if(progressive) state.num_samples = 1; else if(range_num_samples == -1) state.num_samples = num_samples; else state.num_samples = range_num_samples; state.resolution_divider = pixel_size; if(state.sample == range_start_sample) { set_tiles(); } else { gen_render_tiles(); } } return true; } int TileManager::get_num_effective_samples() { return (range_num_samples == -1) ? num_samples : range_num_samples; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/render/tile.h000066400000000000000000000105611334742672700207650ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __TILE_H__ #define __TILE_H__ #include #include "render/buffers.h" #include "util/util_list.h" CCL_NAMESPACE_BEGIN /* Tile */ class Tile { public: int index; int x, y, w, h; int device; /* RENDER: The tile has to be rendered. * RENDERED: The tile has been rendered, but can't be denoised yet (waiting for neighbors). * DENOISE: The tile can be denoised now. * DENOISED: The tile has been denoised, but can't be freed yet (waiting for neighbors). * DONE: The tile is finished and has been freed. */ typedef enum { RENDER = 0, RENDERED, DENOISE, DENOISED, DONE } State; State state; RenderBuffers *buffers; Tile() {} Tile(int index_, int x_, int y_, int w_, int h_, int device_, State state_ = RENDER) : index(index_), x(x_), y(y_), w(w_), h(h_), device(device_), state(state_), buffers(NULL) {} }; /* Tile order */ /* Note: this should match enum_tile_order in properties.py */ enum TileOrder { TILE_CENTER = 0, TILE_RIGHT_TO_LEFT = 1, TILE_LEFT_TO_RIGHT = 2, TILE_TOP_TO_BOTTOM = 3, TILE_BOTTOM_TO_TOP = 4, TILE_HILBERT_SPIRAL = 5, }; /* Tile Manager */ class TileManager { public: BufferParams params; struct State { vector tiles; int tile_stride; BufferParams buffer; int sample; int num_samples; int resolution_divider; int num_tiles; /* Total samples over all pixels: Generally num_samples*num_pixels, * but can be higher due to the initial resolution division for previews. */ uint64_t total_pixel_samples; /* These lists contain the indices of the tiles to be rendered/denoised and are used * when acquiring a new tile for the device. * Each list in each vector is for one logical device. */ vector > render_tiles; vector > denoising_tiles; } state; int num_samples; TileManager(bool progressive, int num_samples, int2 tile_size, int start_resolution, bool preserve_tile_device, bool background, TileOrder tile_order, int num_devices = 1, int pixel_size = 1); ~TileManager(); void device_free(); void reset(BufferParams& params, int num_samples); void set_samples(int num_samples); bool next(); bool next_tile(Tile* &tile, int device = 0); bool finish_tile(int index, bool& delete_tile); bool done(); void set_tile_order(TileOrder tile_order_) { tile_order = tile_order_; } /* ** Sample range rendering. ** */ /* Start sample in the range. */ int range_start_sample; /* Number to samples in the rendering range. */ int range_num_samples; /* Get number of actual samples to render. */ int get_num_effective_samples(); /* Schedule tiles for denoising after they've been rendered. */ bool schedule_denoising; protected: void set_tiles(); bool progressive; int2 tile_size; TileOrder tile_order; int start_resolution; int pixel_size; int num_devices; /* in some cases it is important that the same tile will be returned for the same * device it was originally generated for (i.e. viewport rendering when buffer is * allocating once for tile and then always used by it) * * in other cases any tile could be handled by any device (i.e. final rendering * without progressive refine) */ bool preserve_tile_device; /* for background render tiles should exactly match render parts generated from * blender side, which means image first gets split into tiles and then tiles are * assigning to render devices * * however viewport rendering expects tiles to be allocated in a special way, * meaning image is being sliced horizontally first and every device handles * it's own slice */ bool background; /* Generate tile list, return number of tiles. */ int gen_tiles(bool sliced); void gen_render_tiles(); int get_neighbor_index(int index, int neighbor); bool check_neighbor_state(int index, Tile::State state); }; CCL_NAMESPACE_END #endif /* __TILE_H__ */ goxel-0.8.1/ext_src/cycles/src/subd/000077500000000000000000000000001334742672700173325ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/subd/subd_dice.cpp000066400000000000000000000216511334742672700217640ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/camera.h" #include "render/mesh.h" #include "subd/subd_dice.h" #include "subd/subd_patch.h" CCL_NAMESPACE_BEGIN /* EdgeDice Base */ EdgeDice::EdgeDice(const SubdParams& params_) : params(params_) { mesh_P = NULL; mesh_N = NULL; vert_offset = 0; params.mesh->attributes.add(ATTR_STD_VERTEX_NORMAL); if(params.ptex) { params.mesh->attributes.add(ATTR_STD_PTEX_UV); params.mesh->attributes.add(ATTR_STD_PTEX_FACE_ID); } } void EdgeDice::reserve(int num_verts) { Mesh *mesh = params.mesh; vert_offset = mesh->verts.size(); tri_offset = mesh->num_triangles(); /* todo: optimize so we can reserve in advance, this is like push_back_slow() */ if(vert_offset + num_verts > mesh->verts.capacity()) { mesh->reserve_mesh(size_t((vert_offset + num_verts) * 1.2), mesh->num_triangles()); } mesh->resize_mesh(vert_offset + num_verts, tri_offset); Attribute *attr_vN = mesh->attributes.add(ATTR_STD_VERTEX_NORMAL); mesh_P = mesh->verts.data(); mesh_N = attr_vN->data_float3(); } int EdgeDice::add_vert(Patch *patch, float2 uv) { float3 P, N; patch->eval(&P, NULL, NULL, &N, uv.x, uv.y); assert(vert_offset < params.mesh->verts.size()); mesh_P[vert_offset] = P; mesh_N[vert_offset] = N; params.mesh->vert_patch_uv[vert_offset] = make_float2(uv.x, uv.y); if(params.ptex) { Attribute *attr_ptex_uv = params.mesh->attributes.add(ATTR_STD_PTEX_UV); params.mesh->attributes.resize(); float3 *ptex_uv = attr_ptex_uv->data_float3(); ptex_uv[vert_offset] = make_float3(uv.x, uv.y, 0.0f); } params.mesh->num_subd_verts++; return vert_offset++; } void EdgeDice::add_triangle(Patch *patch, int v0, int v1, int v2) { Mesh *mesh = params.mesh; /* todo: optimize so we can reserve in advance, this is like push_back_slow() */ if(mesh->triangles.size() == mesh->triangles.capacity()) mesh->reserve_mesh(mesh->verts.size(), size_t(max(mesh->num_triangles() + 1, 1) * 1.2)); mesh->add_triangle(v0, v1, v2, patch->shader, true); params.mesh->triangle_patch[params.mesh->num_triangles()-1] = patch->patch_index; if(params.ptex) { Attribute *attr_ptex_face_id = params.mesh->attributes.add(ATTR_STD_PTEX_FACE_ID); params.mesh->attributes.resize(); float *ptex_face_id = attr_ptex_face_id->data_float(); ptex_face_id[tri_offset] = (float)patch->ptex_face_id(); } tri_offset++; } void EdgeDice::stitch_triangles(Patch *patch, vector& outer, vector& inner) { if(inner.size() == 0 || outer.size() == 0) return; // XXX avoid crashes for Mu or Mv == 1, missing polygons /* stitch together two arrays of verts with triangles. at each step, * we compare using the next verts on both sides, to find the split * direction with the smallest diagonal, and use that in order to keep * the triangle shape reasonable. */ for(size_t i = 0, j = 0; i+1 < inner.size() || j+1 < outer.size();) { int v0, v1, v2; v0 = inner[i]; v1 = outer[j]; if(j+1 == outer.size()) { v2 = inner[++i]; } else if(i+1 == inner.size()) { v2 = outer[++j]; } else { /* length of diagonals */ float len1 = len_squared(mesh_P[inner[i]] - mesh_P[outer[j+1]]); float len2 = len_squared(mesh_P[outer[j]] - mesh_P[inner[i+1]]); /* use smallest diagonal */ if(len1 < len2) v2 = outer[++j]; else v2 = inner[++i]; } add_triangle(patch, v0, v1, v2); } } /* QuadDice */ QuadDice::QuadDice(const SubdParams& params_) : EdgeDice(params_) { } void QuadDice::reserve(EdgeFactors& ef, int Mu, int Mv) { /* XXX need to make this also work for edge factor 0 and 1 */ int num_verts = (ef.tu0 + ef.tu1 + ef.tv0 + ef.tv1) + (Mu - 1)*(Mv - 1); EdgeDice::reserve(num_verts); } float2 QuadDice::map_uv(SubPatch& sub, float u, float v) { /* map UV from subpatch to patch parametric coordinates */ float2 d0 = interp(sub.P00, sub.P01, v); float2 d1 = interp(sub.P10, sub.P11, v); return interp(d0, d1, u); } float3 QuadDice::eval_projected(SubPatch& sub, float u, float v) { float2 uv = map_uv(sub, u, v); float3 P; sub.patch->eval(&P, NULL, NULL, NULL, uv.x, uv.y); if(params.camera) P = transform_perspective(¶ms.camera->worldtoraster, P); return P; } int QuadDice::add_vert(SubPatch& sub, float u, float v) { return EdgeDice::add_vert(sub.patch, map_uv(sub, u, v)); } void QuadDice::add_side_u(SubPatch& sub, vector& outer, vector& inner, int Mu, int Mv, int tu, int side, int offset) { outer.clear(); inner.clear(); /* set verts on the edge of the patch */ outer.push_back(offset + ((side)? 2: 0)); for(int i = 1; i < tu; i++) { float u = i/(float)tu; float v = (side)? 1.0f: 0.0f; outer.push_back(add_vert(sub, u, v)); } outer.push_back(offset + ((side)? 3: 1)); /* set verts on the edge of the inner grid */ for(int i = 0; i < Mu-1; i++) { int j = (side)? Mv-1-1: 0; inner.push_back(offset + 4 + i + j*(Mu-1)); } } void QuadDice::add_side_v(SubPatch& sub, vector& outer, vector& inner, int Mu, int Mv, int tv, int side, int offset) { outer.clear(); inner.clear(); /* set verts on the edge of the patch */ outer.push_back(offset + ((side)? 1: 0)); for(int j = 1; j < tv; j++) { float u = (side)? 1.0f: 0.0f; float v = j/(float)tv; outer.push_back(add_vert(sub, u, v)); } outer.push_back(offset + ((side)? 3: 2)); /* set verts on the edge of the inner grid */ for(int j = 0; j < Mv-1; j++) { int i = (side)? Mu-1-1: 0; inner.push_back(offset + 4 + i + j*(Mu-1)); } } float QuadDice::quad_area(const float3& a, const float3& b, const float3& c, const float3& d) { return triangle_area(a, b, d) + triangle_area(a, d, c); } float QuadDice::scale_factor(SubPatch& sub, EdgeFactors& ef, int Mu, int Mv) { /* estimate area as 4x largest of 4 quads */ float3 P[3][3]; for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) P[i][j] = eval_projected(sub, i*0.5f, j*0.5f); float A1 = quad_area(P[0][0], P[1][0], P[0][1], P[1][1]); float A2 = quad_area(P[1][0], P[2][0], P[1][1], P[2][1]); float A3 = quad_area(P[0][1], P[1][1], P[0][2], P[1][2]); float A4 = quad_area(P[1][1], P[2][1], P[1][2], P[2][2]); float Apatch = max(A1, max(A2, max(A3, A4)))*4.0f; /* solve for scaling factor */ float Atri = params.dicing_rate*params.dicing_rate*0.5f; float Ntris = Apatch/Atri; // XXX does the -sqrt solution matter // XXX max(D, 0.0) is highly suspicious, need to test cases // where D goes negative float N = 0.5f*(Ntris - (ef.tu0 + ef.tu1 + ef.tv0 + ef.tv1)); float D = 4.0f*N*Mu*Mv + (Mu + Mv)*(Mu + Mv); float S = (Mu + Mv + sqrtf(max(D, 0.0f)))/(2*Mu*Mv); return S; } void QuadDice::add_corners(SubPatch& sub) { /* add verts for patch corners */ add_vert(sub, 0.0f, 0.0f); add_vert(sub, 1.0f, 0.0f); add_vert(sub, 0.0f, 1.0f); add_vert(sub, 1.0f, 1.0f); } void QuadDice::add_grid(SubPatch& sub, int Mu, int Mv, int offset) { /* create inner grid */ float du = 1.0f/(float)Mu; float dv = 1.0f/(float)Mv; for(int j = 1; j < Mv; j++) { for(int i = 1; i < Mu; i++) { float u = i*du; float v = j*dv; add_vert(sub, u, v); if(i < Mu-1 && j < Mv-1) { int i1 = offset + 4 + (i-1) + (j-1)*(Mu-1); int i2 = offset + 4 + i + (j-1)*(Mu-1); int i3 = offset + 4 + i + j*(Mu-1); int i4 = offset + 4 + (i-1) + j*(Mu-1); add_triangle(sub.patch, i1, i2, i3); add_triangle(sub.patch, i1, i3, i4); } } } } void QuadDice::dice(SubPatch& sub, EdgeFactors& ef) { /* compute inner grid size with scale factor */ int Mu = max(ef.tu0, ef.tu1); int Mv = max(ef.tv0, ef.tv1); #if 0 /* Doesnt work very well, especially at grazing angles. */ float S = scale_factor(sub, ef, Mu, Mv); #else float S = 1.0f; #endif Mu = max((int)ceil(S*Mu), 2); // XXX handle 0 & 1? Mv = max((int)ceil(S*Mv), 2); // XXX handle 0 & 1? /* reserve space for new verts */ int offset = params.mesh->verts.size(); reserve(ef, Mu, Mv); /* corners and inner grid */ add_corners(sub); add_grid(sub, Mu, Mv, offset); /* bottom side */ vector outer, inner; add_side_u(sub, outer, inner, Mu, Mv, ef.tu0, 0, offset); stitch_triangles(sub.patch, outer, inner); /* top side */ add_side_u(sub, outer, inner, Mu, Mv, ef.tu1, 1, offset); stitch_triangles(sub.patch, inner, outer); /* left side */ add_side_v(sub, outer, inner, Mu, Mv, ef.tv0, 0, offset); stitch_triangles(sub.patch, inner, outer); /* right side */ add_side_v(sub, outer, inner, Mu, Mv, ef.tv1, 1, offset); stitch_triangles(sub.patch, outer, inner); assert(vert_offset == params.mesh->verts.size()); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/subd/subd_dice.h000066400000000000000000000061061334742672700214270ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SUBD_DICE_H__ #define __SUBD_DICE_H__ /* DX11 like EdgeDice implementation, with different tessellation factors for * each edge for watertight tessellation, with subpatch remapping to work with * DiagSplit. For more algorithm details, see the DiagSplit paper or the * ARB_tessellation_shader OpenGL extension, Section 2.X.2. */ #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Camera; class Mesh; class Patch; struct SubdParams { Mesh *mesh; bool ptex; int test_steps; int split_threshold; float dicing_rate; int max_level; Camera *camera; Transform objecttoworld; SubdParams(Mesh *mesh_, bool ptex_ = false) { mesh = mesh_; ptex = ptex_; test_steps = 3; split_threshold = 1; dicing_rate = 1.0f; max_level = 12; camera = NULL; } }; /* EdgeDice Base */ class EdgeDice { public: SubdParams params; float3 *mesh_P; float3 *mesh_N; size_t vert_offset; size_t tri_offset; explicit EdgeDice(const SubdParams& params); void reserve(int num_verts); int add_vert(Patch *patch, float2 uv); void add_triangle(Patch *patch, int v0, int v1, int v2); void stitch_triangles(Patch *patch, vector& outer, vector& inner); }; /* Quad EdgeDice * * Edge tessellation factors and subpatch coordinates are as follows: * * tu1 * P01 --------- P11 * | | * tv0 | | tv1 * | | * P00 --------- P10 * tu0 */ class QuadDice : public EdgeDice { public: struct SubPatch { Patch *patch; float2 P00; float2 P10; float2 P01; float2 P11; }; struct EdgeFactors { int tu0; int tu1; int tv0; int tv1; }; explicit QuadDice(const SubdParams& params); void reserve(EdgeFactors& ef, int Mu, int Mv); float3 eval_projected(SubPatch& sub, float u, float v); float2 map_uv(SubPatch& sub, float u, float v); int add_vert(SubPatch& sub, float u, float v); void add_corners(SubPatch& sub); void add_grid(SubPatch& sub, int Mu, int Mv, int offset); void add_side_u(SubPatch& sub, vector& outer, vector& inner, int Mu, int Mv, int tu, int side, int offset); void add_side_v(SubPatch& sub, vector& outer, vector& inner, int Mu, int Mv, int tv, int side, int offset); float quad_area(const float3& a, const float3& b, const float3& c, const float3& d); float scale_factor(SubPatch& sub, EdgeFactors& ef, int Mu, int Mv); void dice(SubPatch& sub, EdgeFactors& ef); }; CCL_NAMESPACE_END #endif /* __SUBD_DICE_H__ */ goxel-0.8.1/ext_src/cycles/src/subd/subd_patch.cpp000066400000000000000000000052601334742672700221550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Parts adapted from code in the public domain in NVidia Mesh Tools. */ #include "render/mesh.h" #include "subd/subd_patch.h" #include "util/util_math.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* De Casteljau Evaluation */ static void decasteljau_cubic(float3 *P, float3 *dt, float t, const float3 cp[4]) { float3 d0 = cp[0] + t*(cp[1] - cp[0]); float3 d1 = cp[1] + t*(cp[2] - cp[1]); float3 d2 = cp[2] + t*(cp[3] - cp[2]); d0 += t*(d1 - d0); d1 += t*(d2 - d1); *P = d0 + t*(d1 - d0); if(dt) *dt = d1 - d0; } static void decasteljau_bicubic(float3 *P, float3 *du, float3 *dv, const float3 cp[16], float u, float v) { float3 ucp[4], utn[4]; /* interpolate over u */ decasteljau_cubic(ucp+0, utn+0, u, cp); decasteljau_cubic(ucp+1, utn+1, u, cp+4); decasteljau_cubic(ucp+2, utn+2, u, cp+8); decasteljau_cubic(ucp+3, utn+3, u, cp+12); /* interpolate over v */ decasteljau_cubic(P, dv, v, ucp); if(du) decasteljau_cubic(du, NULL, v, utn); } /* Linear Quad Patch */ void LinearQuadPatch::eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v) { float3 d0 = interp(hull[0], hull[1], u); float3 d1 = interp(hull[2], hull[3], u); *P = interp(d0, d1, v); if(dPdu && dPdv) { *dPdu = interp(hull[1] - hull[0], hull[3] - hull[2], v); *dPdv = interp(hull[2] - hull[0], hull[3] - hull[1], u); } if(N) { *N = normalize(interp(interp(normals[0], normals[1], u), interp(normals[2], normals[3], u), v)); } } BoundBox LinearQuadPatch::bound() { BoundBox bbox = BoundBox::empty; for(int i = 0; i < 4; i++) bbox.grow(hull[i]); return bbox; } /* Bicubic Patch */ void BicubicPatch::eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v) { if(N) { float3 dPdu_, dPdv_; decasteljau_bicubic(P, &dPdu_, &dPdv_, hull, u, v); if(dPdu && dPdv) { *dPdu = dPdu_; *dPdv = dPdv_; } *N = normalize(cross(dPdu_, dPdv_)); } else { decasteljau_bicubic(P, dPdu, dPdv, hull, u, v); } } BoundBox BicubicPatch::bound() { BoundBox bbox = BoundBox::empty; for(int i = 0; i < 16; i++) bbox.grow(hull[i]); return bbox; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/subd/subd_patch.h000066400000000000000000000026311334742672700216210ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SUBD_PATCH_H__ #define __SUBD_PATCH_H__ #include "util/util_boundbox.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class Patch { public: virtual ~Patch() {} virtual void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v) = 0; virtual BoundBox bound() = 0; virtual int ptex_face_id() { return -1; } int patch_index; int shader; }; /* Linear Quad Patch */ class LinearQuadPatch : public Patch { public: float3 hull[4]; float3 normals[4]; void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v); BoundBox bound(); }; /* Bicubic Patch */ class BicubicPatch : public Patch { public: float3 hull[16]; void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v); BoundBox bound(); }; CCL_NAMESPACE_END #endif /* __SUBD_PATCH_H__ */ goxel-0.8.1/ext_src/cycles/src/subd/subd_patch_table.cpp000066400000000000000000000172101334742672700233220ustar00rootroot00000000000000/* * Based on code from OpenSubdiv released under this license: * * Copyright 2014 DreamWorks Animation LLC. * * Licensed under the Apache License, Version 2.0 (the "Apache License") * with the following modification; you may not use this file except in * compliance with the Apache License and the following modification to it: * Section 6. Trademarks. is deleted and replaced with: * * 6. Trademarks. This License does not grant permission to use the trade * names, trademarks, service marks, or product names of the Licensor * and its affiliates, except as required to comply with Section 4(c) of * the License and to reproduce the content of the NOTICE file. * * You may obtain a copy of the Apache License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the Apache License with the above modification is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the Apache License for the specific * language governing permissions and limitations under the Apache License. * */ #include "subd/subd_patch_table.h" #include "kernel/kernel_types.h" #include "util/util_math.h" #ifdef WITH_OPENSUBDIV #include #endif CCL_NAMESPACE_BEGIN #ifdef WITH_OPENSUBDIV using namespace OpenSubdiv; /* functions for building patch maps */ struct PatchMapQuadNode { /* sets all the children to point to the patch of index */ void set_child(int index) { for(int i = 0; i < 4; i++) { children[i] = index | PATCH_MAP_NODE_IS_SET | PATCH_MAP_NODE_IS_LEAF; } } /* sets the child in quadrant to point to the node or patch of the given index */ void set_child(unsigned char quadrant, int index, bool is_leaf=true) { assert(quadrant < 4); children[quadrant] = index | PATCH_MAP_NODE_IS_SET | (is_leaf ? PATCH_MAP_NODE_IS_LEAF : 0); } uint children[4]; }; template static int resolve_quadrant(T& median, T& u, T& v) { int quadrant = -1; if(u < median) { if(v < median) { quadrant = 0; } else { quadrant = 1; v -= median; } } else { if(v < median) { quadrant = 3; } else { quadrant = 2; v -= median; } u -= median; } return quadrant; } static void build_patch_map(PackedPatchTable& table, OpenSubdiv::Far::PatchTable* patch_table, int offset) { int num_faces = 0; for(int array = 0; array < table.num_arrays; array++) { Far::ConstPatchParamArray params = patch_table->GetPatchParams(array); for(int j = 0; j < patch_table->GetNumPatches(array); j++) { num_faces = max(num_faces, (int)params[j].GetFaceId()); } } num_faces++; vector quadtree; quadtree.reserve(num_faces + table.num_patches); quadtree.resize(num_faces); /* adjust offsets to make indices relative to the table */ int handle_index = -(table.num_patches * PATCH_HANDLE_SIZE); offset += table.total_size(); /* populate the quadtree from the FarPatchArrays sub-patches */ for(int array = 0; array < table.num_arrays; array++) { Far::ConstPatchParamArray params = patch_table->GetPatchParams(array); for(int i = 0; i < patch_table->GetNumPatches(array); i++, handle_index += PATCH_HANDLE_SIZE) { const Far::PatchParam& param = params[i]; unsigned short depth = param.GetDepth(); PatchMapQuadNode* node = &quadtree[params[i].GetFaceId()]; if(depth == (param.NonQuadRoot() ? 1 : 0)) { /* special case : regular BSpline face w/ no sub-patches */ node->set_child(handle_index + offset); continue; } int u = param.GetU(); int v = param.GetV(); int pdepth = param.NonQuadRoot() ? depth-2 : depth-1; int half = 1 << pdepth; for(int j = 0; j < depth; j++) { int delta = half >> 1; int quadrant = resolve_quadrant(half, u, v); assert(quadrant >= 0); half = delta; if(j == pdepth) { /* we have reached the depth of the sub-patch : add a leaf */ assert(!(node->children[quadrant] & PATCH_MAP_NODE_IS_SET)); node->set_child(quadrant, handle_index + offset, true); break; } else { /* travel down the child node of the corresponding quadrant */ if(!(node->children[quadrant] & PATCH_MAP_NODE_IS_SET)) { /* create a new branch in the quadrant */ quadtree.push_back(PatchMapQuadNode()); int idx = (int)quadtree.size() - 1; node->set_child(quadrant, idx*4 + offset, false); node = &quadtree[idx]; } else { /* travel down an existing branch */ uint idx = node->children[quadrant] & PATCH_MAP_NODE_INDEX_MASK; node = &(quadtree[(idx - offset)/4]); } } } } } /* copy into table */ assert(table.table.size() == table.total_size()); uint map_offset = table.total_size(); table.num_nodes = quadtree.size() * 4; table.table.resize(table.total_size()); uint* data = &table.table[map_offset]; for(int i = 0; i < quadtree.size(); i++) { for(int j = 0; j < 4; j++) { assert(quadtree[i].children[j] & PATCH_MAP_NODE_IS_SET); *(data++) = quadtree[i].children[j]; } } } #endif /* packed patch table functions */ size_t PackedPatchTable::total_size() { return num_arrays * PATCH_ARRAY_SIZE + num_indices + num_patches * (PATCH_PARAM_SIZE + PATCH_HANDLE_SIZE) + num_nodes * PATCH_NODE_SIZE; } void PackedPatchTable::pack(Far::PatchTable* patch_table, int offset) { num_arrays = 0; num_patches = 0; num_indices = 0; num_nodes = 0; #ifdef WITH_OPENSUBDIV num_arrays = patch_table->GetNumPatchArrays(); for(int i = 0; i < num_arrays; i++) { int patches = patch_table->GetNumPatches(i); int num_control = patch_table->GetPatchArrayDescriptor(i).GetNumControlVertices(); num_patches += patches; num_indices += patches * num_control; } table.resize(total_size()); uint* data = table.data(); uint* array = data; uint* index = array + num_arrays * PATCH_ARRAY_SIZE; uint* param = index + num_indices; uint* handle = param + num_patches * PATCH_PARAM_SIZE; uint current_param = 0; for(int i = 0; i < num_arrays; i++) { *(array++) = patch_table->GetPatchArrayDescriptor(i).GetType(); *(array++) = patch_table->GetNumPatches(i); *(array++) = (index - data) + offset; *(array++) = (param - data) + offset; Far::ConstIndexArray indices = patch_table->GetPatchArrayVertices(i); for(int j = 0; j < indices.size(); j++) { *(index++) = indices[j]; } const Far::PatchParamTable& param_table = patch_table->GetPatchParamTable(); int num_control = patch_table->GetPatchArrayDescriptor(i).GetNumControlVertices(); int patches = patch_table->GetNumPatches(i); for(int j = 0; j < patches; j++, current_param++) { *(param++) = param_table[current_param].field0; *(param++) = param_table[current_param].field1; *(handle++) = (array - data) - PATCH_ARRAY_SIZE + offset; *(handle++) = (param - data) - PATCH_PARAM_SIZE + offset; *(handle++) = j * num_control; } } build_patch_map(*this, patch_table, offset); #else (void)patch_table; (void)offset; #endif } void PackedPatchTable::copy_adjusting_offsets(uint* dest, int doffset) { uint* src = table.data(); /* arrays */ for(int i = 0; i < num_arrays; i++) { *(dest++) = *(src++); *(dest++) = *(src++); *(dest++) = *(src++) + doffset; *(dest++) = *(src++) + doffset; } /* indices */ for(int i = 0; i < num_indices; i++) { *(dest++) = *(src++); } /* params */ for(int i = 0; i < num_patches; i++) { *(dest++) = *(src++); *(dest++) = *(src++); } /* handles */ for(int i = 0; i < num_patches; i++) { *(dest++) = *(src++) + doffset; *(dest++) = *(src++) + doffset; *(dest++) = *(src++); } /* nodes */ for(int i = 0; i < num_nodes; i++) { *(dest++) = *(src++) + doffset; } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/subd/subd_patch_table.h000066400000000000000000000027331334742672700227730ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SUBD_PATCH_TABLE_H__ #define __SUBD_PATCH_TABLE_H__ #include "util/util_types.h" #include "util/util_vector.h" #ifdef WITH_OPENSUBDIV #ifdef _MSC_VER # include "iso646.h" #endif #include #endif CCL_NAMESPACE_BEGIN #ifdef WITH_OPENSUBDIV using namespace OpenSubdiv; #else /* forward declare for when OpenSubdiv is unavailable */ namespace Far { struct PatchTable; } #endif #define PATCH_ARRAY_SIZE 4 #define PATCH_PARAM_SIZE 2 #define PATCH_HANDLE_SIZE 3 #define PATCH_NODE_SIZE 1 struct PackedPatchTable { array table; size_t num_arrays; size_t num_indices; size_t num_patches; size_t num_nodes; /* calculated size from num_* members */ size_t total_size(); void pack(Far::PatchTable* patch_table, int offset = 0); void copy_adjusting_offsets(uint* dest, int doffset); }; CCL_NAMESPACE_END #endif /* __SUBD_PATCH_TABLE_H__ */ goxel-0.8.1/ext_src/cycles/src/subd/subd_split.cpp000066400000000000000000000146321334742672700222140ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "render/camera.h" #include "render/mesh.h" #include "subd/subd_dice.h" #include "subd/subd_patch.h" #include "subd/subd_split.h" #include "util/util_math.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* DiagSplit */ DiagSplit::DiagSplit(const SubdParams& params_) : params(params_) { } void DiagSplit::dispatch(QuadDice::SubPatch& sub, QuadDice::EdgeFactors& ef) { subpatches_quad.push_back(sub); edgefactors_quad.push_back(ef); } float3 DiagSplit::to_world(Patch *patch, float2 uv) { float3 P; patch->eval(&P, NULL, NULL, NULL, uv.x, uv.y); if(params.camera) P = transform_point(¶ms.objecttoworld, P); return P; } int DiagSplit::T(Patch *patch, float2 Pstart, float2 Pend) { float3 Plast = make_float3(0.0f, 0.0f, 0.0f); float Lsum = 0.0f; float Lmax = 0.0f; for(int i = 0; i < params.test_steps; i++) { float t = i/(float)(params.test_steps-1); float3 P = to_world(patch, Pstart + t*(Pend - Pstart)); if(i > 0) { float L; if(!params.camera) { L = len(P - Plast); } else { Camera* cam = params.camera; float pixel_width = cam->world_to_raster_size((P + Plast) * 0.5f); L = len(P - Plast) / pixel_width; } Lsum += L; Lmax = max(L, Lmax); } Plast = P; } int tmin = (int)ceil(Lsum/params.dicing_rate); int tmax = (int)ceil((params.test_steps-1)*Lmax/params.dicing_rate); // XXX paper says N instead of N-1, seems wrong? if(tmax - tmin > params.split_threshold) return DSPLIT_NON_UNIFORM; return tmax; } void DiagSplit::partition_edge(Patch *patch, float2 *P, int *t0, int *t1, float2 Pstart, float2 Pend, int t) { if(t == DSPLIT_NON_UNIFORM) { *P = (Pstart + Pend)*0.5f; *t0 = T(patch, Pstart, *P); *t1 = T(patch, *P, Pend); } else { int I = (int)floor((float)t*0.5f); *P = interp(Pstart, Pend, (t == 0)? 0: I/(float)t); /* XXX is t faces or verts */ *t0 = I; *t1 = t - I; } } static void limit_edge_factors(const QuadDice::SubPatch& sub, QuadDice::EdgeFactors& ef, int max_t) { float2 P00 = sub.P00; float2 P01 = sub.P01; float2 P10 = sub.P10; float2 P11 = sub.P11; int tu0 = int(max_t * len(P10 - P00)); int tu1 = int(max_t * len(P11 - P01)); int tv0 = int(max_t * len(P01 - P00)); int tv1 = int(max_t * len(P11 - P10)); ef.tu0 = tu0 <= 1 ? 1 : min(ef.tu0, tu0); ef.tu1 = tu1 <= 1 ? 1 : min(ef.tu1, tu1); ef.tv0 = tv0 <= 1 ? 1 : min(ef.tv0, tv0); ef.tv1 = tv1 <= 1 ? 1 : min(ef.tv1, tv1); } void DiagSplit::split(QuadDice::SubPatch& sub, QuadDice::EdgeFactors& ef, int depth) { if(depth > 32) { /* We should never get here, but just in case end recursion safely. */ ef.tu0 = 1; ef.tu1 = 1; ef.tv0 = 1; ef.tv1 = 1; dispatch(sub, ef); return; } bool split_u = (ef.tu0 == DSPLIT_NON_UNIFORM || ef.tu1 == DSPLIT_NON_UNIFORM); bool split_v = (ef.tv0 == DSPLIT_NON_UNIFORM || ef.tv1 == DSPLIT_NON_UNIFORM); /* Split subpatches such that the ratio of T for opposite edges doesn't * exceed 1.5, this reduces over tessellation for some patches */ bool tmp_split_v = split_v; if(!split_u && min(ef.tu0, ef.tu1) > 8 && min(ef.tu0, ef.tu1)*1.5f < max(ef.tu0, ef.tu1)) split_v = true; if(!tmp_split_v && min(ef.tu0, ef.tu1) > 8 && min(ef.tv0, ef.tv1)*1.5f < max(ef.tv0, ef.tv1)) split_u = true; /* alternate axis */ if(split_u && split_v) { split_u = depth % 2; } if(split_u) { /* partition edges */ QuadDice::EdgeFactors ef0, ef1; float2 Pu0, Pu1; partition_edge(sub.patch, &Pu0, &ef0.tu0, &ef1.tu0, sub.P00, sub.P10, ef.tu0); partition_edge(sub.patch, &Pu1, &ef0.tu1, &ef1.tu1, sub.P01, sub.P11, ef.tu1); /* split */ int tsplit = T(sub.patch, Pu0, Pu1); ef0.tv0 = ef.tv0; ef0.tv1 = tsplit; ef1.tv0 = tsplit; ef1.tv1 = ef.tv1; /* create subpatches */ QuadDice::SubPatch sub0 = {sub.patch, sub.P00, Pu0, sub.P01, Pu1}; QuadDice::SubPatch sub1 = {sub.patch, Pu0, sub.P10, Pu1, sub.P11}; limit_edge_factors(sub0, ef0, 1 << params.max_level); limit_edge_factors(sub1, ef1, 1 << params.max_level); split(sub0, ef0, depth+1); split(sub1, ef1, depth+1); } else if(split_v) { /* partition edges */ QuadDice::EdgeFactors ef0, ef1; float2 Pv0, Pv1; partition_edge(sub.patch, &Pv0, &ef0.tv0, &ef1.tv0, sub.P00, sub.P01, ef.tv0); partition_edge(sub.patch, &Pv1, &ef0.tv1, &ef1.tv1, sub.P10, sub.P11, ef.tv1); /* split */ int tsplit = T(sub.patch, Pv0, Pv1); ef0.tu0 = ef.tu0; ef0.tu1 = tsplit; ef1.tu0 = tsplit; ef1.tu1 = ef.tu1; /* create subpatches */ QuadDice::SubPatch sub0 = {sub.patch, sub.P00, sub.P10, Pv0, Pv1}; QuadDice::SubPatch sub1 = {sub.patch, Pv0, Pv1, sub.P01, sub.P11}; limit_edge_factors(sub0, ef0, 1 << params.max_level); limit_edge_factors(sub1, ef1, 1 << params.max_level); split(sub0, ef0, depth+1); split(sub1, ef1, depth+1); } else { dispatch(sub, ef); } } void DiagSplit::split_quad(Patch *patch, QuadDice::SubPatch *subpatch) { QuadDice::SubPatch sub_split; QuadDice::EdgeFactors ef_split; if(subpatch) { sub_split = *subpatch; } else { sub_split.patch = patch; sub_split.P00 = make_float2(0.0f, 0.0f); sub_split.P10 = make_float2(1.0f, 0.0f); sub_split.P01 = make_float2(0.0f, 1.0f); sub_split.P11 = make_float2(1.0f, 1.0f); } ef_split.tu0 = T(patch, sub_split.P00, sub_split.P10); ef_split.tu1 = T(patch, sub_split.P01, sub_split.P11); ef_split.tv0 = T(patch, sub_split.P00, sub_split.P01); ef_split.tv1 = T(patch, sub_split.P10, sub_split.P11); limit_edge_factors(sub_split, ef_split, 1 << params.max_level); split(sub_split, ef_split); QuadDice dice(params); for(size_t i = 0; i < subpatches_quad.size(); i++) { QuadDice::SubPatch& sub = subpatches_quad[i]; QuadDice::EdgeFactors& ef = edgefactors_quad[i]; ef.tu0 = max(ef.tu0, 1); ef.tu1 = max(ef.tu1, 1); ef.tv0 = max(ef.tv0, 1); ef.tv1 = max(ef.tv1, 1); dice.dice(sub, ef); } subpatches_quad.clear(); edgefactors_quad.clear(); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/subd/subd_split.h000066400000000000000000000033201334742672700216510ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __SUBD_SPLIT_H__ #define __SUBD_SPLIT_H__ /* DiagSplit: Parallel, Crack-free, Adaptive Tessellation for Micropolygon Rendering * Splits up patches and determines edge tessellation factors for dicing. Patch * evaluation at arbitrary points is required for this to work. See the paper * for more details. */ #include "subd/subd_dice.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Mesh; class Patch; #define DSPLIT_NON_UNIFORM -1 class DiagSplit { public: vector subpatches_quad; vector edgefactors_quad; SubdParams params; explicit DiagSplit(const SubdParams& params); float3 to_world(Patch *patch, float2 uv); int T(Patch *patch, float2 Pstart, float2 Pend); void partition_edge(Patch *patch, float2 *P, int *t0, int *t1, float2 Pstart, float2 Pend, int t); void dispatch(QuadDice::SubPatch& sub, QuadDice::EdgeFactors& ef); void split(QuadDice::SubPatch& sub, QuadDice::EdgeFactors& ef, int depth=0); void split_quad(Patch *patch, QuadDice::SubPatch *subpatch=NULL); }; CCL_NAMESPACE_END #endif /* __SUBD_SPLIT_H__ */ goxel-0.8.1/ext_src/cycles/src/util/000077500000000000000000000000001334742672700173525ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/src/util/util_algorithm.h000066400000000000000000000015161334742672700225510ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_ALGORITHM_H__ #define __UTIL_ALGORITHM_H__ #include CCL_NAMESPACE_BEGIN using std::sort; using std::swap; using std::max; using std::min; using std::remove; CCL_NAMESPACE_END #endif /* __UTIL_ALGORITHM_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_aligned_malloc.cpp000066400000000000000000000042501334742672700240460ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_aligned_malloc.h" #include "util/util_guarded_allocator.h" #include /* Adopted from Libmv. */ #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) /* Needed for memalign on Linux and _aligned_alloc on Windows. */ # ifdef FREE_WINDOWS /* Make sure _aligned_malloc is included. */ # ifdef __MSVCRT_VERSION__ # undef __MSVCRT_VERSION__ # endif # define __MSVCRT_VERSION__ 0x0700 # endif /* FREE_WINDOWS */ # include #else /* Apple's malloc is 16-byte aligned, and does not have malloc.h, so include * stdilb instead. */ # include #endif CCL_NAMESPACE_BEGIN void *util_aligned_malloc(size_t size, int alignment) { #ifdef WITH_BLENDER_GUARDEDALLOC return MEM_mallocN_aligned(size, alignment, "Cycles Aligned Alloc"); #elif defined(_WIN32) return _aligned_malloc(size, alignment); #elif defined(__APPLE__) /* On Mac OS X, both the heap and the stack are guaranteed 16-byte aligned so * they work natively with SSE types with no further work. */ assert(alignment == 16); return malloc(size); #elif defined(__FreeBSD__) || defined(__NetBSD__) void *result; if(posix_memalign(&result, alignment, size)) { /* Non-zero means allocation error * either no allocation or bad alignment value. */ return NULL; } return result; #else /* This is for Linux. */ return memalign(alignment, size); #endif } void util_aligned_free(void *ptr) { #if defined(WITH_BLENDER_GUARDEDALLOC) if(ptr != NULL) { MEM_freeN(ptr); } #elif defined(_WIN32) _aligned_free(ptr); #else free(ptr); #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_aligned_malloc.h000066400000000000000000000021261334742672700235130ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_ALIGNED_MALLOC_H__ #define __UTIL_ALIGNED_MALLOC_H__ #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* Minimum alignment needed by all CPU native data types (SSE, AVX). */ #define MIN_ALIGNMENT_CPU_DATA_TYPES 16 /* Allocate block of size bytes at least aligned to a given value. */ void *util_aligned_malloc(size_t size, int alignment); /* Free memory allocated by util_aligned_malloc. */ void util_aligned_free(void *ptr); CCL_NAMESPACE_END #endif /* __UTIL_ALIGNED_MALLOC_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_args.h000066400000000000000000000016021334742672700215130ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_ARGS_H__ #define __UTIL_ARGS_H__ /* Argument Parsing for command line, we use the OpenImageIO * library because it has nice functions to do this. */ #include CCL_NAMESPACE_BEGIN OIIO_NAMESPACE_USING CCL_NAMESPACE_END #endif /* __UTIL_ARGS_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_atomic.h000066400000000000000000000052741334742672700220440ustar00rootroot00000000000000/* * Copyright 2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_ATOMIC_H__ #define __UTIL_ATOMIC_H__ #ifndef __KERNEL_GPU__ /* Using atomic ops header from Blender. */ #include "atomic_ops.h" #define atomic_add_and_fetch_float(p, x) atomic_add_and_fetch_fl((p), (x)) #define atomic_fetch_and_inc_uint32(p) atomic_fetch_and_add_uint32((p), 1) #define atomic_fetch_and_dec_uint32(p) atomic_fetch_and_add_uint32((p), -1) #define CCL_LOCAL_MEM_FENCE 0 #define ccl_barrier(flags) (void)0 #else /* __KERNEL_GPU__ */ #ifdef __KERNEL_OPENCL__ /* Float atomics implementation credits: * http://suhorukov.blogspot.in/2011/12/opencl-11-atomic-operations-on-floating.html */ ccl_device_inline float atomic_add_and_fetch_float(volatile ccl_global float *source, const float operand) { union { unsigned int int_value; float float_value; } new_value; union { unsigned int int_value; float float_value; } prev_value; do { prev_value.float_value = *source; new_value.float_value = prev_value.float_value + operand; } while(atomic_cmpxchg((volatile ccl_global unsigned int *)source, prev_value.int_value, new_value.int_value) != prev_value.int_value); return new_value.float_value; } #define atomic_fetch_and_add_uint32(p, x) atomic_add((p), (x)) #define atomic_fetch_and_inc_uint32(p) atomic_inc((p)) #define atomic_fetch_and_dec_uint32(p) atomic_dec((p)) #define CCL_LOCAL_MEM_FENCE CLK_LOCAL_MEM_FENCE #define ccl_barrier(flags) barrier(flags) #endif /* __KERNEL_OPENCL__ */ #ifdef __KERNEL_CUDA__ #define atomic_add_and_fetch_float(p, x) (atomicAdd((float*)(p), (float)(x)) + (float)(x)) #define atomic_fetch_and_add_uint32(p, x) atomicAdd((unsigned int*)(p), (unsigned int)(x)) #define atomic_fetch_and_sub_uint32(p, x) atomicSub((unsigned int*)(p), (unsigned int)(x)) #define atomic_fetch_and_inc_uint32(p) atomic_fetch_and_add_uint32((p), 1) #define atomic_fetch_and_dec_uint32(p) atomic_fetch_and_sub_uint32((p), 1) #define CCL_LOCAL_MEM_FENCE #define ccl_barrier(flags) __syncthreads() #endif /* __KERNEL_CUDA__ */ #endif /* __KERNEL_GPU__ */ #endif /* __UTIL_ATOMIC_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_avxf.h000066400000000000000000000160621334742672700215310ustar00rootroot00000000000000/* * Copyright 2016 Intel Corporation * * Licensed under the Apache License, Version 2.0(the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_AVXF_H__ #define __UTIL_AVXF_H__ CCL_NAMESPACE_BEGIN #ifdef __KERNEL_AVX__ struct avxf { typedef avxf Float; enum { size = 8 }; /* Number of SIMD elements. */ union { __m256 m256; float f[8]; int i[8]; }; __forceinline avxf () {} __forceinline avxf (const avxf& other) { m256 = other.m256; } __forceinline avxf& operator=(const avxf& other) { m256 = other.m256; return *this; } __forceinline avxf(const __m256 a) : m256(a) {} __forceinline avxf(const __m256i a) : m256(_mm256_castsi256_ps (a)) {} __forceinline operator const __m256&(void) const { return m256; } __forceinline operator __m256&(void) { return m256; } __forceinline avxf (float a) : m256(_mm256_set1_ps(a)) {} __forceinline avxf(float high32x4, float low32x4) : m256(_mm256_set_ps(high32x4, high32x4, high32x4, high32x4, low32x4, low32x4, low32x4, low32x4)) {} __forceinline avxf(float a3, float a2, float a1, float a0) : m256(_mm256_set_ps(a3, a2, a1, a0, a3, a2, a1, a0)) {} __forceinline avxf(float a7, float a6, float a5, float a4, float a3, float a2, float a1, float a0) : m256(_mm256_set_ps(a7, a6, a5, a4, a3, a2, a1, a0)) {} __forceinline avxf(int a3, int a2, int a1, int a0) { const __m256i foo = _mm256_set_epi32(a3, a2, a1, a0, a3, a2, a1, a0); m256 = _mm256_castsi256_ps(foo); } __forceinline avxf(int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0) { const __m256i foo = _mm256_set_epi32(a7, a6, a5, a4, a3, a2, a1, a0); m256 = _mm256_castsi256_ps(foo); } __forceinline avxf(__m128 a, __m128 b) { const __m256 foo = _mm256_castps128_ps256(a); m256 = _mm256_insertf128_ps(foo, b, 1); } }; //////////////////////////////////////////////////////////////////////////////// /// Unary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const avxf mm256_sqrt(const avxf& a) { return _mm256_sqrt_ps(a.m256); } //////////////////////////////////////////////////////////////////////////////// /// Binary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const avxf operator +(const avxf& a, const avxf& b) { return _mm256_add_ps(a.m256, b.m256); } __forceinline const avxf operator +(const avxf& a, const float& b) { return a + avxf(b); } __forceinline const avxf operator +(const float& a, const avxf& b) { return avxf(a) + b; } __forceinline const avxf operator -(const avxf& a, const avxf& b) { return _mm256_sub_ps(a.m256, b.m256); } __forceinline const avxf operator -(const avxf& a, const float& b) { return a - avxf(b); } __forceinline const avxf operator -(const float& a, const avxf& b) { return avxf(a) - b; } __forceinline const avxf operator *(const avxf& a, const avxf& b) { return _mm256_mul_ps(a.m256, b.m256); } __forceinline const avxf operator *(const avxf& a, const float& b) { return a * avxf(b); } __forceinline const avxf operator *(const float& a, const avxf& b) { return avxf(a) * b; } __forceinline const avxf operator /(const avxf& a, const avxf& b) { return _mm256_div_ps(a.m256,b.m256); } __forceinline const avxf operator /(const avxf& a, const float& b) { return a/avxf(b); } __forceinline const avxf operator /(const float& a, const avxf& b) { return avxf(a)/b; } __forceinline const avxf operator|(const avxf& a, const avxf& b) { return _mm256_or_ps(a.m256,b.m256); } __forceinline const avxf operator^(const avxf& a, const avxf& b) { return _mm256_xor_ps(a.m256,b.m256); } __forceinline const avxf operator&(const avxf& a, const avxf& b) { return _mm256_and_ps(a.m256,b.m256); } //////////////////////////////////////////////////////////////////////////////// /// Movement/Shifting/Shuffling Functions //////////////////////////////////////////////////////////////////////////////// __forceinline const avxf shuffle(const avxf& a, const __m256i &shuf) { return _mm256_permutevar_ps(a, shuf); } template __forceinline const avxf shuffle(const avxf& a) { return _mm256_permutevar_ps(a, _mm256_set_epi32( i7,i6,i5,i4 ,i3,i2,i1,i0)); } template __forceinline const avxf shuffle(const avxf& a, const avxf& b) { return _mm256_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0)); } template __forceinline const avxf shuffle(const avxf& a) { return shuffle(a,a); } template __forceinline const avxf shuffle(const avxf& a, const avxf& b) { return shuffle(a, b); } template __forceinline const avxf shuffle(const avxf& a) { return shuffle(a,a); } template __forceinline const avxf permute(const avxf& a) { #ifdef __KERNEL_AVX2__ return _mm256_permutevar8x32_ps(a,_mm256_set_epi32( i7,i6,i5,i4 ,i3,i2,i1,i0)); #else float temp[8]; _mm256_storeu_ps((float*)&temp, a); return avxf(temp[i7], temp[i6], temp[i5], temp[i4], temp[i3], temp[i2], temp[i1], temp[i0]); #endif } template ccl_device_inline const avxf set_sign_bit(const avxf &a) { return a ^ avxf(S7 << 31, S6 << 31, S5 << 31, S4 << 31, S3 << 31,S2 << 31,S1 << 31,S0 << 31); } template ccl_device_inline const avxf blend(const avxf &a, const avxf &b) { return _mm256_blend_ps(a,b,S7 << 0 | S6 << 1 | S5 << 2 | S4 << 3 | S3 << 4 | S2 << 5 | S1 << 6 | S0 << 7); } template ccl_device_inline const avxf blend(const avxf &a, const avxf &b) { return blend(a,b); } //////////////////////////////////////////////////////////////////////////////// /// Ternary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const avxf madd (const avxf& a, const avxf& b, const avxf& c) { #ifdef __KERNEL_AVX2__ return _mm256_fmadd_ps(a,b,c); #else return c+(a*b); #endif } __forceinline const avxf nmadd(const avxf& a, const avxf& b, const avxf& c) { #ifdef __KERNEL_AVX2__ return _mm256_fnmadd_ps(a, b, c); #else return c-(a*b); #endif } #endif #ifndef _mm256_set_m128 # define _mm256_set_m128(/* __m128 */ hi, /* __m128 */ lo) \ _mm256_insertf128_ps(_mm256_castps128_ps256(lo), (hi), 0x1) #endif #define _mm256_loadu2_m128(/* float const* */ hiaddr, /* float const* */ loaddr) \ _mm256_set_m128(_mm_loadu_ps(hiaddr), _mm_loadu_ps(loaddr)) CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_boundbox.h000066400000000000000000000142271334742672700224060ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_BOUNDBOX_H__ #define __UTIL_BOUNDBOX_H__ #include #include #include "util/util_math.h" #include "util/util_string.h" #include "util/util_transform.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* 3D BoundBox */ class BoundBox { public: float3 min, max; __forceinline BoundBox() { } __forceinline BoundBox(const float3& pt) : min(pt), max(pt) { } __forceinline BoundBox(const float3& min_, const float3& max_) : min(min_), max(max_) { } enum empty_t { empty = 0}; __forceinline BoundBox(empty_t) : min(make_float3(FLT_MAX, FLT_MAX, FLT_MAX)), max(make_float3(-FLT_MAX, -FLT_MAX, -FLT_MAX)) { } __forceinline void grow(const float3& pt) { /* the order of arguments to min is such that if pt is nan, it will not * influence the resulting bounding box */ min = ccl::min(pt, min); max = ccl::max(pt, max); } __forceinline void grow(const float3& pt, float border) { float3 shift = make_float3(border, border, border); min = ccl::min(pt - shift, min); max = ccl::max(pt + shift, max); } __forceinline void grow(const BoundBox& bbox) { grow(bbox.min); grow(bbox.max); } __forceinline void grow_safe(const float3& pt) { /* the order of arguments to min is such that if pt is nan, it will not * influence the resulting bounding box */ if(isfinite(pt.x) && isfinite(pt.y) && isfinite(pt.z)) { min = ccl::min(pt, min); max = ccl::max(pt, max); } } __forceinline void grow_safe(const float3& pt, float border) { if(isfinite(pt.x) && isfinite(pt.y) && isfinite(pt.z) && isfinite(border)) { float3 shift = make_float3(border, border, border); min = ccl::min(pt - shift, min); max = ccl::max(pt + shift, max); } } __forceinline void grow_safe(const BoundBox& bbox) { grow_safe(bbox.min); grow_safe(bbox.max); } __forceinline void intersect(const BoundBox& bbox) { min = ccl::max(min, bbox.min); max = ccl::min(max, bbox.max); } /* todo: avoid using this */ __forceinline float safe_area() const { if(!((min.x <= max.x) && (min.y <= max.y) && (min.z <= max.z))) return 0.0f; return area(); } __forceinline float area() const { return half_area()*2.0f; } __forceinline float half_area() const { float3 d = max - min; return (d.x*d.z + d.y*d.z + d.x*d.y); } __forceinline float3 center() const { return 0.5f*(min + max); } __forceinline float3 center2() const { return min + max; } __forceinline float3 size() const { return max - min; } __forceinline bool valid() const { return (min.x <= max.x) && (min.y <= max.y) && (min.z <= max.z) && (isfinite(min.x) && isfinite(min.y) && isfinite(min.z)) && (isfinite(max.x) && isfinite(max.y) && isfinite(max.z)); } BoundBox transformed(const Transform *tfm) const { BoundBox result = BoundBox::empty; for(int i = 0; i < 8; i++) { float3 p; p.x = (i & 1)? min.x: max.x; p.y = (i & 2)? min.y: max.y; p.z = (i & 4)? min.z: max.z; result.grow(transform_point(tfm, p)); } return result; } __forceinline bool intersects(const BoundBox& other) { float3 center_diff = center() - other.center(), total_size = (size() + other.size()) * 0.5f; return fabsf(center_diff.x) <= total_size.x && fabsf(center_diff.y) <= total_size.y && fabsf(center_diff.z) <= total_size.z; } }; __forceinline BoundBox merge(const BoundBox& bbox, const float3& pt) { return BoundBox(min(bbox.min, pt), max(bbox.max, pt)); } __forceinline BoundBox merge(const BoundBox& a, const BoundBox& b) { return BoundBox(min(a.min, b.min), max(a.max, b.max)); } __forceinline BoundBox merge(const BoundBox& a, const BoundBox& b, const BoundBox& c, const BoundBox& d) { return merge(merge(a, b), merge(c, d)); } __forceinline BoundBox intersect(const BoundBox& a, const BoundBox& b) { return BoundBox(max(a.min, b.min), min(a.max, b.max)); } __forceinline BoundBox intersect(const BoundBox& a, const BoundBox& b, const BoundBox& c) { return intersect(a, intersect(b, c)); } /* 2D BoundBox */ class BoundBox2D { public: float left; float right; float bottom; float top; BoundBox2D() : left(0.0f), right(1.0f), bottom(0.0f), top(1.0f) { } bool operator==(const BoundBox2D& other) const { return (left == other.left && right == other.right && bottom == other.bottom && top == other.top); } float width() { return right - left; } float height() { return top - bottom; } BoundBox2D operator*(float f) const { BoundBox2D result; result.left = left*f; result.right = right*f; result.bottom = bottom*f; result.top = top*f; return result; } BoundBox2D subset(const BoundBox2D& other) const { BoundBox2D subset; subset.left = left + other.left*(right - left); subset.right = left + other.right*(right - left); subset.bottom = bottom + other.bottom*(top - bottom); subset.top = bottom + other.top*(top - bottom); return subset; } BoundBox2D make_relative_to(const BoundBox2D& other) const { BoundBox2D result; result.left = ((left - other.left) / (other.right - other.left)); result.right = ((right - other.left) / (other.right - other.left)); result.bottom = ((bottom - other.bottom) / (other.top - other.bottom)); result.top = ((top - other.bottom) / (other.top - other.bottom)); return result; } BoundBox2D clamp(float mn = 0.0f, float mx = 1.0f) { BoundBox2D result; result.left = ccl::clamp(left, mn, mx); result.right = ccl::clamp(right, mn, mx); result.bottom = ccl::clamp(bottom, mn, mx); result.top = ccl::clamp(top, mn, mx); return result; } }; CCL_NAMESPACE_END #endif /* __UTIL_BOUNDBOX_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_color.h000066400000000000000000000146151334742672700217050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_COLOR_H__ #define __UTIL_COLOR_H__ #include "util/util_math.h" #include "util/util_types.h" #ifdef __KERNEL_SSE2__ #include "util/util_simd.h" #endif CCL_NAMESPACE_BEGIN ccl_device uchar float_to_byte(float val) { return ((val <= 0.0f) ? 0 : ((val > (1.0f - 0.5f / 255.0f)) ? 255 : (uchar)((255.0f * val) + 0.5f))); } ccl_device uchar4 color_float_to_byte(float3 c) { uchar r, g, b; r = float_to_byte(c.x); g = float_to_byte(c.y); b = float_to_byte(c.z); return make_uchar4(r, g, b, 0); } ccl_device_inline float3 color_byte_to_float(uchar4 c) { return make_float3(c.x*(1.0f/255.0f), c.y*(1.0f/255.0f), c.z*(1.0f/255.0f)); } ccl_device float color_srgb_to_scene_linear(float c) { if(c < 0.04045f) return (c < 0.0f)? 0.0f: c * (1.0f/12.92f); else return powf((c + 0.055f) * (1.0f / 1.055f), 2.4f); } ccl_device float color_scene_linear_to_srgb(float c) { if(c < 0.0031308f) return (c < 0.0f)? 0.0f: c * 12.92f; else return 1.055f * powf(c, 1.0f / 2.4f) - 0.055f; } ccl_device float3 rgb_to_hsv(float3 rgb) { float cmax, cmin, h, s, v, cdelta; float3 c; cmax = fmaxf(rgb.x, fmaxf(rgb.y, rgb.z)); cmin = min(rgb.x, min(rgb.y, rgb.z)); cdelta = cmax - cmin; v = cmax; if(cmax != 0.0f) { s = cdelta/cmax; } else { s = 0.0f; h = 0.0f; } if(s != 0.0f) { float3 cmax3 = make_float3(cmax, cmax, cmax); c = (cmax3 - rgb)/cdelta; if (rgb.x == cmax) h = c.z - c.y; else if(rgb.y == cmax) h = 2.0f + c.x - c.z; else h = 4.0f + c.y - c.x; h /= 6.0f; if(h < 0.0f) h += 1.0f; } else { h = 0.0f; } return make_float3(h, s, v); } ccl_device float3 hsv_to_rgb(float3 hsv) { float i, f, p, q, t, h, s, v; float3 rgb; h = hsv.x; s = hsv.y; v = hsv.z; if(s != 0.0f) { if(h == 1.0f) h = 0.0f; h *= 6.0f; i = floorf(h); f = h - i; rgb = make_float3(f, f, f); p = v*(1.0f-s); q = v*(1.0f-(s*f)); t = v*(1.0f-(s*(1.0f-f))); if (i == 0.0f) rgb = make_float3(v, t, p); else if(i == 1.0f) rgb = make_float3(q, v, p); else if(i == 2.0f) rgb = make_float3(p, v, t); else if(i == 3.0f) rgb = make_float3(p, q, v); else if(i == 4.0f) rgb = make_float3(t, p, v); else rgb = make_float3(v, p, q); } else { rgb = make_float3(v, v, v); } return rgb; } ccl_device float3 xyY_to_xyz(float x, float y, float Y) { float X, Z; if(y != 0.0f) X = (x / y) * Y; else X = 0.0f; if(y != 0.0f && Y != 0.0f) Z = (1.0f - x - y) / y * Y; else Z = 0.0f; return make_float3(X, Y, Z); } ccl_device float3 xyz_to_rgb(float x, float y, float z) { return make_float3(3.240479f * x + -1.537150f * y + -0.498535f * z, -0.969256f * x + 1.875991f * y + 0.041556f * z, 0.055648f * x + -0.204043f * y + 1.057311f * z); } #ifdef __KERNEL_SSE2__ /* * Calculate initial guess for arg^exp based on float representation * This method gives a constant bias, which can be easily compensated by multiplication with bias_coeff. * Gives better results for exponents near 1 (e. g. 4/5). * exp = exponent, encoded as uint32_t * e2coeff = 2^(127/exponent - 127) * bias_coeff^(1/exponent), encoded as uint32_t */ template ccl_device_inline ssef fastpow(const ssef &arg) { ssef ret; ret = arg * cast(ssei(e2coeff)); ret = ssef(cast(ret)); ret = ret * cast(ssei(exp)); ret = cast(ssei(ret)); return ret; } /* Improve x ^ 1.0f/5.0f solution with Newton-Raphson method */ ccl_device_inline ssef improve_5throot_solution(const ssef &old_result, const ssef &x) { ssef approx2 = old_result * old_result; ssef approx4 = approx2 * approx2; ssef t = x / approx4; ssef summ = madd(ssef(4.0f), old_result, t); return summ * ssef(1.0f/5.0f); } /* Calculate powf(x, 2.4). Working domain: 1e-10 < x < 1e+10 */ ccl_device_inline ssef fastpow24(const ssef &arg) { /* max, avg and |avg| errors were calculated in gcc without FMA instructions * The final precision should be better than powf in glibc */ /* Calculate x^4/5, coefficient 0.994 was constructed manually to minimize avg error */ /* 0x3F4CCCCD = 4/5 */ /* 0x4F55A7FB = 2^(127/(4/5) - 127) * 0.994^(1/(4/5)) */ ssef x = fastpow<0x3F4CCCCD, 0x4F55A7FB>(arg); // error max = 0.17 avg = 0.0018 |avg| = 0.05 ssef arg2 = arg * arg; ssef arg4 = arg2 * arg2; x = improve_5throot_solution(x, arg4); /* error max = 0.018 avg = 0.0031 |avg| = 0.0031 */ x = improve_5throot_solution(x, arg4); /* error max = 0.00021 avg = 1.6e-05 |avg| = 1.6e-05 */ x = improve_5throot_solution(x, arg4); /* error max = 6.1e-07 avg = 5.2e-08 |avg| = 1.1e-07 */ return x * (x * x); } ccl_device ssef color_srgb_to_scene_linear(const ssef &c) { sseb cmp = c < ssef(0.04045f); ssef lt = max(c * ssef(1.0f/12.92f), ssef(0.0f)); ssef gtebase = (c + ssef(0.055f)) * ssef(1.0f/1.055f); /* fma */ ssef gte = fastpow24(gtebase); return select(cmp, lt, gte); } #endif /* __KERNEL_SSE2__ */ ccl_device float3 color_srgb_to_scene_linear_v3(float3 c) { return make_float3(color_srgb_to_scene_linear(c.x), color_srgb_to_scene_linear(c.y), color_srgb_to_scene_linear(c.z)); } ccl_device float3 color_scene_linear_to_srgb_v3(float3 c) { return make_float3(color_scene_linear_to_srgb(c.x), color_scene_linear_to_srgb(c.y), color_scene_linear_to_srgb(c.z)); } ccl_device float4 color_srgb_to_scene_linear_v4(float4 c) { #ifdef __KERNEL_SSE2__ ssef r_ssef; float4 &r = (float4 &)r_ssef; r = c; r_ssef = color_srgb_to_scene_linear(r_ssef); r.w = c.w; return r; #else return make_float4(color_srgb_to_scene_linear(c.x), color_srgb_to_scene_linear(c.y), color_srgb_to_scene_linear(c.z), c.w); #endif } ccl_device float linear_rgb_to_gray(float3 c) { return c.x*0.2126f + c.y*0.7152f + c.z*0.0722f; } CCL_NAMESPACE_END #endif /* __UTIL_COLOR_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_debug.cpp000066400000000000000000000127021334742672700222030ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_debug.h" #include #include "bvh/bvh_params.h" #include "util/util_logging.h" #include "util/util_string.h" CCL_NAMESPACE_BEGIN DebugFlags::CPU::CPU() : avx2(true), avx(true), sse41(true), sse3(true), sse2(true), bvh_layout(BVH_LAYOUT_DEFAULT), split_kernel(false) { reset(); } void DebugFlags::CPU::reset() { #define STRINGIFY(x) #x #define CHECK_CPU_FLAGS(flag, env) \ do { \ flag = (getenv(env) == NULL); \ if(!flag) { \ VLOG(1) << "Disabling " << STRINGIFY(flag) << " instruction set."; \ } \ } while(0) CHECK_CPU_FLAGS(avx2, "CYCLES_CPU_NO_AVX2"); CHECK_CPU_FLAGS(avx, "CYCLES_CPU_NO_AVX"); CHECK_CPU_FLAGS(sse41, "CYCLES_CPU_NO_SSE41"); CHECK_CPU_FLAGS(sse3, "CYCLES_CPU_NO_SSE3"); CHECK_CPU_FLAGS(sse2, "CYCLES_CPU_NO_SSE2"); #undef STRINGIFY #undef CHECK_CPU_FLAGS bvh_layout = BVH_LAYOUT_DEFAULT; split_kernel = false; } DebugFlags::CUDA::CUDA() : adaptive_compile(false), split_kernel(false) { reset(); } void DebugFlags::CUDA::reset() { if(getenv("CYCLES_CUDA_ADAPTIVE_COMPILE") != NULL) adaptive_compile = true; split_kernel = false; } DebugFlags::OpenCL::OpenCL() : device_type(DebugFlags::OpenCL::DEVICE_ALL), kernel_type(DebugFlags::OpenCL::KERNEL_DEFAULT), debug(false), single_program(false) { reset(); } void DebugFlags::OpenCL::reset() { /* Initialize device type from environment variables. */ device_type = DebugFlags::OpenCL::DEVICE_ALL; char *device = getenv("CYCLES_OPENCL_TEST"); if(device) { if(strcmp(device, "NONE") == 0) { device_type = DebugFlags::OpenCL::DEVICE_NONE; } else if(strcmp(device, "ALL") == 0) { device_type = DebugFlags::OpenCL::DEVICE_ALL; } else if(strcmp(device, "DEFAULT") == 0) { device_type = DebugFlags::OpenCL::DEVICE_DEFAULT; } else if(strcmp(device, "CPU") == 0) { device_type = DebugFlags::OpenCL::DEVICE_CPU; } else if(strcmp(device, "GPU") == 0) { device_type = DebugFlags::OpenCL::DEVICE_GPU; } else if(strcmp(device, "ACCELERATOR") == 0) { device_type = DebugFlags::OpenCL::DEVICE_ACCELERATOR; } } /* Initialize kernel type from environment variables. */ kernel_type = DebugFlags::OpenCL::KERNEL_DEFAULT; if(getenv("CYCLES_OPENCL_MEGA_KERNEL_TEST") != NULL) { kernel_type = DebugFlags::OpenCL::KERNEL_MEGA; } else if(getenv("CYCLES_OPENCL_SPLIT_KERNEL_TEST") != NULL) { kernel_type = DebugFlags::OpenCL::KERNEL_SPLIT; } /* Initialize other flags from environment variables. */ debug = (getenv("CYCLES_OPENCL_DEBUG") != NULL); single_program = (getenv("CYCLES_OPENCL_MULTI_PROGRAM") == NULL); } DebugFlags::DebugFlags() : viewport_static_bvh(false) { /* Nothing for now. */ } void DebugFlags::reset() { viewport_static_bvh = false; cpu.reset(); cuda.reset(); opencl.reset(); } std::ostream& operator <<(std::ostream &os, DebugFlagsConstRef debug_flags) { os << "CPU flags:\n" << " AVX2 : " << string_from_bool(debug_flags.cpu.avx2) << "\n" << " AVX : " << string_from_bool(debug_flags.cpu.avx) << "\n" << " SSE4.1 : " << string_from_bool(debug_flags.cpu.sse41) << "\n" << " SSE3 : " << string_from_bool(debug_flags.cpu.sse3) << "\n" << " SSE2 : " << string_from_bool(debug_flags.cpu.sse2) << "\n" << " BVH layout : " << bvh_layout_name(debug_flags.cpu.bvh_layout) << "\n" << " Split : " << string_from_bool(debug_flags.cpu.split_kernel) << "\n"; os << "CUDA flags:\n" << " Adaptive Compile: " << string_from_bool(debug_flags.cuda.adaptive_compile) << "\n"; const char *opencl_device_type, *opencl_kernel_type; switch(debug_flags.opencl.device_type) { case DebugFlags::OpenCL::DEVICE_NONE: opencl_device_type = "NONE"; break; case DebugFlags::OpenCL::DEVICE_ALL: opencl_device_type = "ALL"; break; case DebugFlags::OpenCL::DEVICE_DEFAULT: opencl_device_type = "DEFAULT"; break; case DebugFlags::OpenCL::DEVICE_CPU: opencl_device_type = "CPU"; break; case DebugFlags::OpenCL::DEVICE_GPU: opencl_device_type = "GPU"; break; case DebugFlags::OpenCL::DEVICE_ACCELERATOR: opencl_device_type = "ACCELERATOR"; break; } switch(debug_flags.opencl.kernel_type) { case DebugFlags::OpenCL::KERNEL_DEFAULT: opencl_kernel_type = "DEFAULT"; break; case DebugFlags::OpenCL::KERNEL_MEGA: opencl_kernel_type = "MEGA"; break; case DebugFlags::OpenCL::KERNEL_SPLIT: opencl_kernel_type = "SPLIT"; break; } os << "OpenCL flags:\n" << " Device type : " << opencl_device_type << "\n" << " Kernel type : " << opencl_kernel_type << "\n" << " Debug : " << string_from_bool(debug_flags.opencl.debug) << "\n" << " Single program : " << string_from_bool(debug_flags.opencl.single_program) << "\n" << " Memory limit : " << string_human_readable_size(debug_flags.opencl.mem_limit) << "\n"; return os; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_debug.h000066400000000000000000000106711334742672700216530ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_DEBUG_H__ #define __UTIL_DEBUG_H__ #include #include #include "bvh/bvh_params.h" CCL_NAMESPACE_BEGIN /* Global storage for all sort of flags used to fine-tune behavior of particular * areas for the development purposes, without officially exposing settings to * the interface. */ class DebugFlags { public: /* Use static BVH in viewport, to match final render exactly. */ bool viewport_static_bvh; /* Descriptor of CPU feature-set to be used. */ struct CPU { CPU(); /* Reset flags to their defaults. */ void reset(); /* Flags describing which instructions sets are allowed for use. */ bool avx2; bool avx; bool sse41; bool sse3; bool sse2; /* Check functions to see whether instructions up to the given one * are allowed for use. */ bool has_avx2() { return has_avx() && avx2; } bool has_avx() { return has_sse41() && avx; } bool has_sse41() { return has_sse3() && sse41; } bool has_sse3() { return has_sse2() && sse3; } bool has_sse2() { return sse2; } /* Requested BVH size. * * Rendering will use widest possible BVH which is below or equal * this one. */ BVHLayout bvh_layout; /* Whether split kernel is used */ bool split_kernel; }; /* Descriptor of CUDA feature-set to be used. */ struct CUDA { CUDA(); /* Reset flags to their defaults. */ void reset(); /* Whether adaptive feature based runtime compile is enabled or not. * Requires the CUDA Toolkit and only works on Linux atm. */ bool adaptive_compile; /* Whether split kernel is used */ bool split_kernel; }; /* Descriptor of OpenCL feature-set to be used. */ struct OpenCL { OpenCL(); /* Reset flags to their defaults. */ void reset(); /* Available device types. * Only gives a hint which devices to let user to choose from, does not * try to use any sort of optimal device or so. */ enum DeviceType { /* None of OpenCL devices will be used. */ DEVICE_NONE, /* All OpenCL devices will be used. */ DEVICE_ALL, /* Default system OpenCL device will be used. */ DEVICE_DEFAULT, /* Host processor will be used. */ DEVICE_CPU, /* GPU devices will be used. */ DEVICE_GPU, /* Dedicated OpenCL accelerator device will be used. */ DEVICE_ACCELERATOR, }; /* Available kernel types. */ enum KernelType { /* Do automated guess which kernel to use, based on the officially * supported GPUs and such. */ KERNEL_DEFAULT, /* Force mega kernel to be used. */ KERNEL_MEGA, /* Force split kernel to be used. */ KERNEL_SPLIT, }; /* Requested device type. */ DeviceType device_type; /* Requested kernel type. */ KernelType kernel_type; /* Use debug version of the kernel. */ bool debug; /* Use single program */ bool single_program; /* TODO(mai): Currently this is only for OpenCL, but we should have it implemented for all devices. */ /* Artificial memory limit in bytes (0 if disabled). */ size_t mem_limit; }; /* Get instance of debug flags registry. */ static DebugFlags& get() { static DebugFlags instance; return instance; } /* Reset flags to their defaults. */ void reset(); /* Requested CPU flags. */ CPU cpu; /* Requested CUDA flags. */ CUDA cuda; /* Requested OpenCL flags. */ OpenCL opencl; private: DebugFlags(); #if (__cplusplus > 199711L) public: explicit DebugFlags(DebugFlags const& /*other*/) = delete; void operator=(DebugFlags const& /*other*/) = delete; #else private: explicit DebugFlags(DebugFlags const& /*other*/); void operator=(DebugFlags const& /*other*/); #endif }; typedef DebugFlags& DebugFlagsRef; typedef const DebugFlags& DebugFlagsConstRef; inline DebugFlags& DebugFlags() { return DebugFlags::get(); } std::ostream& operator <<(std::ostream &os, DebugFlagsConstRef debug_flags); CCL_NAMESPACE_END #endif /* __UTIL_DEBUG_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_defines.h000066400000000000000000000106201334742672700221740ustar00rootroot00000000000000 /* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_DEFINES_H__ #define __UTIL_DEFINES_H__ /* Bitness */ #if defined(__ppc64__) || defined(__PPC64__) || defined(__x86_64__) || defined(__ia64__) || defined(_M_X64) # define __KERNEL_64_BIT__ #endif /* Qualifiers for kernel code shared by CPU and GPU */ #ifndef __KERNEL_GPU__ # define ccl_device static inline # define ccl_device_noinline static # define ccl_global # define ccl_static_constant static const # define ccl_constant const # define ccl_local # define ccl_local_param # define ccl_private # define ccl_restrict __restrict # define ccl_ref & # define __KERNEL_WITH_SSE_ALIGN__ # if defined(_WIN32) && !defined(FREE_WINDOWS) # define ccl_device_inline static __forceinline # define ccl_device_forceinline static __forceinline # define ccl_align(...) __declspec(align(__VA_ARGS__)) # ifdef __KERNEL_64_BIT__ # define ccl_try_align(...) __declspec(align(__VA_ARGS__)) # else /* __KERNEL_64_BIT__ */ # undef __KERNEL_WITH_SSE_ALIGN__ /* No support for function arguments (error C2719). */ # define ccl_try_align(...) # endif /* __KERNEL_64_BIT__ */ # define ccl_may_alias # define ccl_always_inline __forceinline # define ccl_never_inline __declspec(noinline) # define ccl_maybe_unused # else /* _WIN32 && !FREE_WINDOWS */ # define ccl_device_inline static inline __attribute__((always_inline)) # define ccl_device_forceinline static inline __attribute__((always_inline)) # define ccl_align(...) __attribute__((aligned(__VA_ARGS__))) # if !defined(FREE_WINDOWS64) && !defined(__forceinline) # define __forceinline inline __attribute__((always_inline)) # endif # define ccl_try_align(...) __attribute__((aligned(__VA_ARGS__))) # define ccl_may_alias __attribute__((__may_alias__)) # define ccl_always_inline __attribute__((always_inline)) # define ccl_never_inline __attribute__((noinline)) # define ccl_maybe_unused __attribute__((used)) # endif /* _WIN32 && !FREE_WINDOWS */ /* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */ # if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */ # define ATTR_FALLTHROUGH __attribute__((fallthrough)) # else # define ATTR_FALLTHROUGH ((void)0) # endif #endif /* __KERNEL_GPU__ */ /* macros */ /* hints for branch prediction, only use in code that runs a _lot_ */ #if defined(__GNUC__) && defined(__KERNEL_CPU__) # define LIKELY(x) __builtin_expect(!!(x), 1) # define UNLIKELY(x) __builtin_expect(!!(x), 0) #else # define LIKELY(x) (x) # define UNLIKELY(x) (x) #endif #if defined(__cplusplus) && ((__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1800)) # define HAS_CPP11_FEATURES #endif #if defined(__GNUC__) || defined(__clang__) # if defined(HAS_CPP11_FEATURES) /* Some magic to be sure we don't have reference in the type. */ template static inline T decltype_helper(T x) { return x; } # define TYPEOF(x) decltype(decltype_helper(x)) # else # define TYPEOF(x) typeof(x) # endif #endif /* Causes warning: * incompatible types when assigning to type 'Foo' from type 'Bar' * ... the compiler optimizes away the temp var */ #ifdef __GNUC__ #define CHECK_TYPE(var, type) { \ TYPEOF(var) *__tmp; \ __tmp = (type *)NULL; \ (void)__tmp; \ } (void)0 #define CHECK_TYPE_PAIR(var_a, var_b) { \ TYPEOF(var_a) *__tmp; \ __tmp = (typeof(var_b) *)NULL; \ (void)__tmp; \ } (void)0 #else # define CHECK_TYPE(var, type) # define CHECK_TYPE_PAIR(var_a, var_b) #endif /* can be used in simple macros */ #define CHECK_TYPE_INLINE(val, type) \ ((void)(((type)0) != (val))) #ifndef __KERNEL_GPU__ # include # define util_assert(statement) assert(statement) #else # define util_assert(statement) #endif #endif /* __UTIL_DEFINES_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_foreach.h000066400000000000000000000016611334742672700221730ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_FOREACH_H__ #define __UTIL_FOREACH_H__ /* Use Boost to get nice foreach() loops for STL data structures. */ #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) # define foreach(x, y) for(x : y) #else # include # define foreach BOOST_FOREACH #endif #endif /* __UTIL_FOREACH_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_function.h000066400000000000000000000026201334742672700224050ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_FUNCTION_H__ #define __UTIL_FUNCTION_H__ #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) # include #else # include # include #endif CCL_NAMESPACE_BEGIN #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) # define function_bind std::bind # define function_null nullptr using std::function; using std::placeholders::_1; using std::placeholders::_2; using std::placeholders::_3; using std::placeholders::_4; using std::placeholders::_5; using std::placeholders::_6; using std::placeholders::_7; using std::placeholders::_8; using std::placeholders::_9; #else using boost::function; # define function_bind boost::bind # define function_null NULL #endif CCL_NAMESPACE_END #endif /* __UTIL_FUNCTION_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_guarded_allocator.cpp000066400000000000000000000021051334742672700245640ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_guarded_allocator.h" #include "util/util_stats.h" CCL_NAMESPACE_BEGIN static Stats global_stats(Stats::static_init); /* Internal API. */ void util_guarded_mem_alloc(size_t n) { global_stats.mem_alloc(n); } void util_guarded_mem_free(size_t n) { global_stats.mem_free(n); } /* Public API. */ size_t util_guarded_get_mem_used(void) { return global_stats.mem_used; } size_t util_guarded_get_mem_peak(void) { return global_stats.mem_peak; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_guarded_allocator.h000066400000000000000000000107311334742672700242350ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_GUARDED_ALLOCATOR_H__ #define __UTIL_GUARDED_ALLOCATOR_H__ #include #include #ifdef WITH_BLENDER_GUARDEDALLOC # include "../../guardedalloc/MEM_guardedalloc.h" #endif CCL_NAMESPACE_BEGIN /* Internal use only. */ void util_guarded_mem_alloc(size_t n); void util_guarded_mem_free(size_t n); /* Guarded allocator for the use with STL. */ template class GuardedAllocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef T *pointer; typedef const T *const_pointer; typedef T& reference; typedef const T& const_reference; typedef T value_type; GuardedAllocator() {} GuardedAllocator(const GuardedAllocator&) {} T *allocate(size_t n, const void *hint = 0) { (void)hint; size_t size = n * sizeof(T); util_guarded_mem_alloc(size); if(n == 0) { return NULL; } T *mem; #ifdef WITH_BLENDER_GUARDEDALLOC /* C++ standard requires allocation functions to allocate memory suitably * aligned for any standard type. This is 16 bytes for 64 bit platform as * far as i concerned. We might over-align on 32bit here, but that should * be all safe actually. */ mem = (T*)MEM_mallocN_aligned(size, 16, "Cycles Alloc"); #else mem = (T*)malloc(size); #endif if(mem == NULL) { throw std::bad_alloc(); } return mem; } void deallocate(T *p, size_t n) { util_guarded_mem_free(n * sizeof(T)); if(p != NULL) { #ifdef WITH_BLENDER_GUARDEDALLOC MEM_freeN(p); #else free(p); #endif } } T *address(T& x) const { return &x; } const T *address(const T& x) const { return &x; } GuardedAllocator& operator=(const GuardedAllocator&) { return *this; } void construct(T *p, const T& val) { if(p != NULL) { new ((T *)p) T(val); } } void destroy(T *p) { p->~T(); } size_t max_size() const { return size_t(-1); } template struct rebind { typedef GuardedAllocator other; }; template GuardedAllocator(const GuardedAllocator&) {} template GuardedAllocator& operator=(const GuardedAllocator&) { return *this; } inline bool operator==(GuardedAllocator const& /*other*/) const { return true; } inline bool operator!=(GuardedAllocator const& other) const { return !operator==(other); } #ifdef _MSC_VER /* Welcome to the black magic here. * * The issue is that MSVC C++ allocates container proxy on any * vector initialization, including static vectors which don't * have any data yet. This leads to several issues: * * - Static objects initialization fiasco (global_stats from * util_stats.h might not be initialized yet). * - If main() function changes allocator type (for example, * this might happen with `blender --debug-memory`) nobody * will know how to convert already allocated memory to a new * guarded allocator. * * Here we work this around by making it so container proxy does * not use guarded allocation. A bit fragile, unfortunately. */ template<> struct rebind { typedef std::allocator other; }; operator std::allocator() const { return std::allocator(); } #endif }; /* Get memory usage and peak from the guarded STL allocator. */ size_t util_guarded_get_mem_used(void); size_t util_guarded_get_mem_peak(void); /* Call given function and keep track if it runs out of memory. * * If it does run out f memory, stop execution and set progress * to do a global cancel. * * It's not fully robust, but good enough to catch obvious issues * when running out of memory. */ #define MEM_GUARDED_CALL(progress, func, ...) \ do { \ try { \ (func)(__VA_ARGS__); \ } \ catch (std::bad_alloc&) { \ fprintf(stderr, "Error: run out of memory!\n"); \ fflush(stderr); \ (progress)->set_error("Out of memory"); \ } \ } while(false) CCL_NAMESPACE_END #endif /* __UTIL_GUARDED_ALLOCATOR_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_half.h000066400000000000000000000066241334742672700215020ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_HALF_H__ #define __UTIL_HALF_H__ #include "util/util_types.h" #include "util/util_math.h" #ifdef __KERNEL_SSE2__ #include "util/util_simd.h" #endif CCL_NAMESPACE_BEGIN /* Half Floats */ #ifdef __KERNEL_OPENCL__ #define float4_store_half(h, f, scale) vstore_half4(f * (scale), 0, h); #else /* CUDA has its own half data type, no need to define then */ #ifndef __KERNEL_CUDA__ typedef unsigned short half; #endif struct half4 { half x, y, z, w; }; #ifdef __KERNEL_CUDA__ ccl_device_inline void float4_store_half(half *h, float4 f, float scale) { h[0] = __float2half(f.x * scale); h[1] = __float2half(f.y * scale); h[2] = __float2half(f.z * scale); h[3] = __float2half(f.w * scale); } #else ccl_device_inline void float4_store_half(half *h, float4 f, float scale) { #ifndef __KERNEL_SSE2__ for(int i = 0; i < 4; i++) { /* optimized float to half for pixels: * assumes no negative, no nan, no inf, and sets denormal to 0 */ union { uint i; float f; } in; float fscale = f[i] * scale; in.f = (fscale > 0.0f)? ((fscale < 65504.0f)? fscale: 65504.0f): 0.0f; int x = in.i; int absolute = x & 0x7FFFFFFF; int Z = absolute + 0xC8000000; int result = (absolute < 0x38800000)? 0: Z; int rshift = (result >> 13); h[i] = (rshift & 0x7FFF); } #else /* same as above with SSE */ ssef fscale = load4f(f) * scale; ssef x = min(max(fscale, 0.0f), 65504.0f); #ifdef __KERNEL_AVX2__ ssei rpack = _mm_cvtps_ph(x, 0); #else ssei absolute = cast(x) & 0x7FFFFFFF; ssei Z = absolute + 0xC8000000; ssei result = andnot(absolute < 0x38800000, Z); ssei rshift = (result >> 13) & 0x7FFF; ssei rpack = _mm_packs_epi32(rshift, rshift); #endif _mm_storel_pi((__m64*)h, _mm_castsi128_ps(rpack)); #endif } ccl_device_inline float half_to_float(half h) { float f; *((int*) &f) = ((h & 0x8000) << 16) | (((h & 0x7c00) + 0x1C000) << 13) | ((h & 0x03FF) << 13); return f; } ccl_device_inline float4 half4_to_float4(half4 h) { float4 f; f.x = half_to_float(h.x); f.y = half_to_float(h.y); f.z = half_to_float(h.z); f.w = half_to_float(h.w); return f; } ccl_device_inline half float_to_half(float f) { const uint u = __float_as_uint(f); /* Sign bit, shifted to it's position. */ uint sign_bit = u & 0x80000000; sign_bit >>= 16; /* Exponent. */ uint exponent_bits = u & 0x7f800000; /* Non-sign bits. */ uint value_bits = u & 0x7fffffff; value_bits >>= 13; /* Align mantissa on MSB. */ value_bits -= 0x1c000; /* Adjust bias. */ /* Flush-to-zero. */ value_bits = (exponent_bits < 0x38800000) ? 0 : value_bits; /* Clamp-to-max. */ value_bits = (exponent_bits > 0x47000000) ? 0x7bff : value_bits; /* Denormals-as-zero. */ value_bits = (exponent_bits == 0 ? 0 : value_bits); /* Re-insert sign bit and return. */ return (value_bits | sign_bit); } #endif #endif CCL_NAMESPACE_END #endif /* __UTIL_HALF_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_hash.h000066400000000000000000000026671334742672700215160ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_HASH_H__ #define __UTIL_HASH_H__ #include "util/util_types.h" CCL_NAMESPACE_BEGIN ccl_device_inline uint hash_int_2d(uint kx, uint ky) { #define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) uint a, b, c; a = b = c = 0xdeadbeef + (2 << 2) + 13; a += kx; b += ky; c ^= b; c -= rot(b,14); a ^= c; a -= rot(c,11); b ^= a; b -= rot(a,25); c ^= b; c -= rot(b,16); a ^= c; a -= rot(c,4); b ^= a; b -= rot(a,14); c ^= b; c -= rot(b,24); return c; #undef rot } ccl_device_inline uint hash_int(uint k) { return hash_int_2d(k, 0); } #ifndef __KERNEL_GPU__ static inline uint hash_string(const char *str) { uint i = 0, c; while((c = *str++)) i = i * 37 + c; return i; } #endif ccl_device_inline float hash_int_01(uint k) { return (float)hash_int(k) * (1.0f/(float)0xFFFFFFFF); } CCL_NAMESPACE_END #endif /* __UTIL_HASH_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_image.h000066400000000000000000000062161334742672700216470ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_IMAGE_H__ #define __UTIL_IMAGE_H__ /* OpenImageIO is used for all image file reading and writing. */ #include "util/util_vector.h" #ifndef WITHOUT_OPENIMAGEIO #include namespace IMG = OIIO; #else /* Dummy OpenImageIO implementation, just so that the compilation works. */ namespace IMG { struct TypeDesc { enum BASETYPE { UNKNOWN, UINT8, HALF, FLOAT }; constexpr TypeDesc (BASETYPE btype=UNKNOWN) {} size_t basesize () const { return 0; } bool operator== (BASETYPE b) {return false;} }; struct ImageSpec { int width; int height; int depth; int nchannels; TypeDesc format; std::vector channelformats; ImageSpec() {}; ImageSpec(int xres, int yres, int nchans, TypeDesc fmt = TypeDesc::UINT8) {} std::string get_string_attribute(std::string name) const { return std::string(); } void attribute(std::string name, unsigned int value) {} }; typedef ptrdiff_t stride_t; const stride_t AutoStride = std::numeric_limits::min(); struct ImageInput { const char *format_name (void) const { return NULL; } static ImageInput *create (const std::string &filename) { return NULL; } bool open (const std::string &name, ImageSpec &newspec, const ImageSpec &conf = ImageSpec()) { return false; } bool read_image (TypeDesc format, void *data, stride_t xstride=AutoStride, stride_t ystride=AutoStride, stride_t zstride=AutoStride) { return false; } bool close () { return false; } }; struct ImageOutput { static ImageOutput *create (const std::string &filename) { return NULL; } bool open (const std::string &name, const ImageSpec &newspec) { return false; } bool write_image (TypeDesc format, const void *data, stride_t xstride=AutoStride, stride_t ystride=AutoStride, stride_t zstride=AutoStride) { return false; } bool close () { return false; } }; }; #endif CCL_NAMESPACE_BEGIN using namespace IMG; template void util_image_resize_pixels(const vector& input_pixels, const size_t input_width, const size_t input_height, const size_t input_depth, const size_t components, vector *output_pixels, size_t *output_width, size_t *output_height, size_t *output_depth); CCL_NAMESPACE_END #endif /* __UTIL_IMAGE_H__ */ #include "util/util_image_impl.h" goxel-0.8.1/ext_src/cycles/src/util/util_image_impl.h000066400000000000000000000160631334742672700226710ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_IMAGE_IMPL_H__ #define __UTIL_IMAGE_IMPL_H__ #include "util/util_algorithm.h" #include "util/util_half.h" #include "util/util_image.h" CCL_NAMESPACE_BEGIN namespace { template const T *util_image_read(const vector& pixels, const size_t width, const size_t height, const size_t /*depth*/, const size_t components, const size_t x, const size_t y, const size_t z) { const size_t index = ((size_t)z * (width * height) + (size_t)y * width + (size_t)x) * components; return &pixels[index]; } /* Cast input pixel from unknown storage to float. */ template inline float cast_to_float(T value); template<> inline float cast_to_float(float value) { return value; } template<> inline float cast_to_float(uchar value) { return (float)value / 255.0f; } template<> inline float cast_to_float(half value) { return half_to_float(value); } /* Cast float value to output pixel type. */ template inline T cast_from_float(float value); template<> inline float cast_from_float(float value) { return value; } template<> inline uchar cast_from_float(float value) { if(value < 0.0f) { return 0; } else if(value > (1.0f - 0.5f / 255.0f)) { return 255; } return (uchar)((255.0f * value) + 0.5f); } template<> inline half cast_from_float(float value) { return float_to_half(value); } template void util_image_downscale_sample(const vector& pixels, const size_t width, const size_t height, const size_t depth, const size_t components, const size_t kernel_size, const float x, const float y, const float z, T *result) { assert(components <= 4); const size_t ix = (size_t)x, iy = (size_t)y, iz = (size_t)z; /* TODO(sergey): Support something smarter than box filer. */ float accum[4] = {0}; size_t count = 0; for(size_t dz = 0; dz < kernel_size; ++dz) { for(size_t dy = 0; dy < kernel_size; ++dy) { for(size_t dx = 0; dx < kernel_size; ++dx) { const size_t nx = ix + dx, ny = iy + dy, nz = iz + dz; if(nx >= width || ny >= height || nz >= depth) { continue; } const T *pixel = util_image_read(pixels, width, height, depth, components, nx, ny, nz); for(size_t k = 0; k < components; ++k) { accum[k] += cast_to_float(pixel[k]); } ++count; } } } if(count != 0) { const float inv_count = 1.0f / (float)count; for(size_t k = 0; k < components; ++k) { result[k] = cast_from_float(accum[k] * inv_count); } } else { for(size_t k = 0; k < components; ++k) { result[k] = T(0.0f); } } } template void util_image_downscale_pixels(const vector& input_pixels, const size_t input_width, const size_t input_height, const size_t input_depth, const size_t components, const float inv_scale_factor, const size_t output_width, const size_t output_height, const size_t output_depth, vector *output_pixels) { const size_t kernel_size = (size_t)(inv_scale_factor + 0.5f); for(size_t z = 0; z < output_depth; ++z) { for(size_t y = 0; y < output_height; ++y) { for(size_t x = 0; x < output_width; ++x) { const float input_x = (float)x * inv_scale_factor, input_y = (float)y * inv_scale_factor, input_z = (float)z * inv_scale_factor; const size_t output_index = (z * output_width * output_height + y * output_width + x) * components; util_image_downscale_sample(input_pixels, input_width, input_height, input_depth, components, kernel_size, input_x, input_y, input_z, &output_pixels->at(output_index)); } } } } } /* namespace */ template void util_image_resize_pixels(const vector& input_pixels, const size_t input_width, const size_t input_height, const size_t input_depth, const size_t components, const float scale_factor, vector *output_pixels, size_t *output_width, size_t *output_height, size_t *output_depth) { /* Early output for case when no scaling is applied. */ if(scale_factor == 1.0f) { *output_width = input_width; *output_height = input_height; *output_depth = input_depth; *output_pixels = input_pixels; return; } /* First of all, we calculate output image dimensions. * We clamp them to be 1 pixel at least so we do not generate degenerate * image. */ *output_width = max((size_t)((float)input_width * scale_factor), (size_t)1); *output_height = max((size_t)((float)input_height * scale_factor), (size_t)1); *output_depth = max((size_t)((float)input_depth * scale_factor), (size_t)1); /* Prepare pixel storage for the result. */ const size_t num_output_pixels = ((*output_width) * (*output_height) * (*output_depth)) * components; output_pixels->resize(num_output_pixels); if(scale_factor < 1.0f) { const float inv_scale_factor = 1.0f / scale_factor; util_image_downscale_pixels(input_pixels, input_width, input_height, input_depth, components, inv_scale_factor, *output_width, *output_height, *output_depth, output_pixels); } else { /* TODO(sergey): Needs implementation. */ } } CCL_NAMESPACE_END #endif /* __UTIL_IMAGE_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_list.h000066400000000000000000000013661334742672700215410ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_LIST_H__ #define __UTIL_LIST_H__ #include CCL_NAMESPACE_BEGIN using std::list; CCL_NAMESPACE_END #endif /* __UTIL_LIST_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_logging.cpp000066400000000000000000000042711334742672700225450ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_logging.h" #include "util/util_math.h" #include #ifdef _MSC_VER # define snprintf _snprintf #endif CCL_NAMESPACE_BEGIN void util_logging_init(const char *argv0) { #ifdef WITH_CYCLES_LOGGING using CYCLES_GFLAGS_NAMESPACE::SetCommandLineOption; /* Make it so ERROR messages are always print into console. */ char severity_fatal[32]; snprintf(severity_fatal, sizeof(severity_fatal), "%d", google::GLOG_ERROR); google::InitGoogleLogging(argv0); SetCommandLineOption("logtostderr", "1"); SetCommandLineOption("v", "0"); SetCommandLineOption("stderrthreshold", severity_fatal); SetCommandLineOption("minloglevel", severity_fatal); #else (void) argv0; #endif } void util_logging_start(void) { #ifdef WITH_CYCLES_LOGGING using CYCLES_GFLAGS_NAMESPACE::SetCommandLineOption; SetCommandLineOption("logtostderr", "1"); SetCommandLineOption("v", "2"); SetCommandLineOption("stderrthreshold", "1"); SetCommandLineOption("minloglevel", "0"); #endif } void util_logging_verbosity_set(int verbosity) { #ifdef WITH_CYCLES_LOGGING using CYCLES_GFLAGS_NAMESPACE::SetCommandLineOption; char val[10]; snprintf(val, sizeof(val), "%d", verbosity); SetCommandLineOption("v", val); #else (void) verbosity; #endif } std::ostream& operator <<(std::ostream &os, const int2 &value) { os << "(" << value.x << ", " << value.y << ")"; return os; } std::ostream& operator <<(std::ostream &os, const float3 &value) { os << "(" << value.x << ", " << value.y << ", " << value.z << ")"; return os; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_logging.h000066400000000000000000000032201334742672700222030ustar00rootroot00000000000000/* * Copyright 2011-2014 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_LOGGING_H__ #define __UTIL_LOGGING_H__ #if defined(WITH_CYCLES_LOGGING) && !defined(__KERNEL_GPU__) # include #endif #include CCL_NAMESPACE_BEGIN #if !defined(WITH_CYCLES_LOGGING) || defined(__KERNEL_GPU__) class StubStream { public: template StubStream& operator<<(const T&) { return *this; } }; class LogMessageVoidify { public: LogMessageVoidify() { } void operator&(StubStream&) { } }; # define LOG_SUPPRESS() (true) ? (void) 0 : LogMessageVoidify() & StubStream() # define LOG(severity) LOG_SUPPRESS() # define VLOG(severity) LOG_SUPPRESS() #endif #define VLOG_ONCE(level, flag) if(!flag) flag = true, VLOG(level) struct int2; struct float3; void util_logging_init(const char *argv0); void util_logging_start(void); void util_logging_verbosity_set(int verbosity); std::ostream& operator <<(std::ostream &os, const int2 &value); std::ostream& operator <<(std::ostream &os, const float3 &value); CCL_NAMESPACE_END #endif /* __UTIL_LOGGING_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_map.h000066400000000000000000000031141334742672700213340ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MAP_H__ #define __UTIL_MAP_H__ #include #if defined(CYCLES_TR1_UNORDERED_MAP) # include #endif #if defined(CYCLES_STD_UNORDERED_MAP) || defined(CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE) # include #endif #if !defined(CYCLES_NO_UNORDERED_MAP) && !defined(CYCLES_TR1_UNORDERED_MAP) && \ !defined(CYCLES_STD_UNORDERED_MAP) && !defined(CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE) // NOLINT # error One of: CYCLES_NO_UNORDERED_MAP, CYCLES_TR1_UNORDERED_MAP,\ CYCLES_STD_UNORDERED_MAP, CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE must be defined! // NOLINT #endif CCL_NAMESPACE_BEGIN using std::map; using std::pair; #if defined(CYCLES_NO_UNORDERED_MAP) typedef std::map unordered_map; #endif #if defined(CYCLES_TR1_UNORDERED_MAP) || defined(CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE) using std::tr1::unordered_map; #endif #if defined(CYCLES_STD_UNORDERED_MAP) using std::unordered_map; #endif CCL_NAMESPACE_END #endif /* __UTIL_MAP_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math.h000066400000000000000000000264431334742672700215220ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_H__ #define __UTIL_MATH_H__ /* Math * * Basic math functions on scalar and vector types. This header is used by * both the kernel code when compiled as C++, and other C++ non-kernel code. */ #ifndef __KERNEL_GPU__ # include #endif #ifndef __KERNEL_OPENCL__ # include # include # include #endif /* __KERNEL_OPENCL__ */ #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* Float Pi variations */ /* Division */ #ifndef M_PI_F # define M_PI_F (3.1415926535897932f) /* pi */ #endif #ifndef M_PI_2_F # define M_PI_2_F (1.5707963267948966f) /* pi/2 */ #endif #ifndef M_PI_4_F # define M_PI_4_F (0.7853981633974830f) /* pi/4 */ #endif #ifndef M_1_PI_F # define M_1_PI_F (0.3183098861837067f) /* 1/pi */ #endif #ifndef M_2_PI_F # define M_2_PI_F (0.6366197723675813f) /* 2/pi */ #endif /* Multiplication */ #ifndef M_2PI_F # define M_2PI_F (6.2831853071795864f) /* 2*pi */ #endif #ifndef M_4PI_F # define M_4PI_F (12.566370614359172f) /* 4*pi */ #endif /* Float sqrt variations */ #ifndef M_SQRT2_F # define M_SQRT2_F (1.4142135623730950f) /* sqrt(2) */ #endif #ifndef M_LN2_F # define M_LN2_F (0.6931471805599453f) /* ln(2) */ #endif #ifndef M_LN10_F # define M_LN10_F (2.3025850929940457f) /* ln(10) */ #endif /* Scalar */ #ifdef _WIN32 # ifndef __KERNEL_OPENCL__ ccl_device_inline float fmaxf(float a, float b) { return (a > b)? a: b; } ccl_device_inline float fminf(float a, float b) { return (a < b)? a: b; } # endif /* !__KERNEL_OPENCL__ */ #endif /* _WIN32 */ #ifndef __KERNEL_GPU__ using std::isfinite; using std::isnan; using std::sqrt; ccl_device_inline int abs(int x) { return (x > 0)? x: -x; } ccl_device_inline int max(int a, int b) { return (a > b)? a: b; } ccl_device_inline int min(int a, int b) { return (a < b)? a: b; } ccl_device_inline float max(float a, float b) { return (a > b)? a: b; } ccl_device_inline float min(float a, float b) { return (a < b)? a: b; } ccl_device_inline double max(double a, double b) { return (a > b)? a: b; } ccl_device_inline double min(double a, double b) { return (a < b)? a: b; } /* These 2 guys are templated for usage with registers data. * * NOTE: Since this is CPU-only functions it is ok to use references here. * But for other devices we'll need to be careful about this. */ template ccl_device_inline T min4(const T& a, const T& b, const T& c, const T& d) { return min(min(a,b),min(c,d)); } template ccl_device_inline T max4(const T& a, const T& b, const T& c, const T& d) { return max(max(a,b),max(c,d)); } #endif /* __KERNEL_GPU__ */ ccl_device_inline float min4(float a, float b, float c, float d) { return min(min(a, b), min(c, d)); } ccl_device_inline float max4(float a, float b, float c, float d) { return max(max(a, b), max(c, d)); } #ifndef __KERNEL_OPENCL__ /* Int/Float conversion */ ccl_device_inline int as_int(uint i) { union { uint ui; int i; } u; u.ui = i; return u.i; } ccl_device_inline uint as_uint(int i) { union { uint ui; int i; } u; u.i = i; return u.ui; } ccl_device_inline uint as_uint(float f) { union { uint i; float f; } u; u.f = f; return u.i; } ccl_device_inline int __float_as_int(float f) { union { int i; float f; } u; u.f = f; return u.i; } ccl_device_inline float __int_as_float(int i) { union { int i; float f; } u; u.i = i; return u.f; } ccl_device_inline uint __float_as_uint(float f) { union { uint i; float f; } u; u.f = f; return u.i; } ccl_device_inline float __uint_as_float(uint i) { union { uint i; float f; } u; u.i = i; return u.f; } #endif /* __KERNEL_OPENCL__ */ /* Versions of functions which are safe for fast math. */ ccl_device_inline bool isnan_safe(float f) { unsigned int x = __float_as_uint(f); return (x << 1) > 0xff000000u; } ccl_device_inline bool isfinite_safe(float f) { /* By IEEE 754 rule, 2*Inf equals Inf */ unsigned int x = __float_as_uint(f); return (f == f) && (x == 0 || x == (1u << 31) || (f != 2.0f*f)) && !((x << 1) > 0xff000000u); } ccl_device_inline float ensure_finite(float v) { return isfinite_safe(v)? v : 0.0f; } #ifndef __KERNEL_OPENCL__ ccl_device_inline int clamp(int a, int mn, int mx) { return min(max(a, mn), mx); } ccl_device_inline float clamp(float a, float mn, float mx) { return min(max(a, mn), mx); } ccl_device_inline float mix(float a, float b, float t) { return a + t*(b - a); } #endif /* __KERNEL_OPENCL__ */ #ifndef __KERNEL_CUDA__ ccl_device_inline float saturate(float a) { return clamp(a, 0.0f, 1.0f); } #endif /* __KERNEL_CUDA__ */ ccl_device_inline int float_to_int(float f) { return (int)f; } ccl_device_inline int floor_to_int(float f) { return float_to_int(floorf(f)); } ccl_device_inline int ceil_to_int(float f) { return float_to_int(ceilf(f)); } ccl_device_inline float signf(float f) { return (f < 0.0f)? -1.0f: 1.0f; } ccl_device_inline float nonzerof(float f, float eps) { if(fabsf(f) < eps) return signf(f)*eps; else return f; } ccl_device_inline float smoothstepf(float f) { float ff = f*f; return (3.0f*ff - 2.0f*ff*f); } ccl_device_inline int mod(int x, int m) { return (x % m + m) % m; } ccl_device_inline float3 float2_to_float3(const float2 a) { return make_float3(a.x, a.y, 0.0f); } ccl_device_inline float3 float4_to_float3(const float4 a) { return make_float3(a.x, a.y, a.z); } ccl_device_inline float4 float3_to_float4(const float3 a) { return make_float4(a.x, a.y, a.z, 1.0f); } CCL_NAMESPACE_END #include "util/util_math_int2.h" #include "util/util_math_int3.h" #include "util/util_math_int4.h" #include "util/util_math_float2.h" #include "util/util_math_float3.h" #include "util/util_math_float4.h" #include "util/util_rect.h" CCL_NAMESPACE_BEGIN #ifndef __KERNEL_OPENCL__ /* Interpolation */ template A lerp(const A& a, const A& b, const B& t) { return (A)(a * ((B)1 - t) + b * t); } #endif /* __KERNEL_OPENCL__ */ /* Triangle */ #ifndef __KERNEL_OPENCL__ ccl_device_inline float triangle_area(const float3& v1, const float3& v2, const float3& v3) #else ccl_device_inline float triangle_area(const float3 v1, const float3 v2, const float3 v3) #endif { return len(cross(v3 - v2, v1 - v2))*0.5f; } /* Orthonormal vectors */ ccl_device_inline void make_orthonormals(const float3 N, float3 *a, float3 *b) { #if 0 if(fabsf(N.y) >= 0.999f) { *a = make_float3(1, 0, 0); *b = make_float3(0, 0, 1); return; } if(fabsf(N.z) >= 0.999f) { *a = make_float3(1, 0, 0); *b = make_float3(0, 1, 0); return; } #endif if(N.x != N.y || N.x != N.z) *a = make_float3(N.z-N.y, N.x-N.z, N.y-N.x); //(1,1,1)x N else *a = make_float3(N.z-N.y, N.x+N.z, -N.y-N.x); //(-1,1,1)x N *a = normalize(*a); *b = cross(N, *a); } /* Color division */ ccl_device_inline float3 safe_invert_color(float3 a) { float x, y, z; x = (a.x != 0.0f)? 1.0f/a.x: 0.0f; y = (a.y != 0.0f)? 1.0f/a.y: 0.0f; z = (a.z != 0.0f)? 1.0f/a.z: 0.0f; return make_float3(x, y, z); } ccl_device_inline float3 safe_divide_color(float3 a, float3 b) { float x, y, z; x = (b.x != 0.0f)? a.x/b.x: 0.0f; y = (b.y != 0.0f)? a.y/b.y: 0.0f; z = (b.z != 0.0f)? a.z/b.z: 0.0f; return make_float3(x, y, z); } ccl_device_inline float3 safe_divide_even_color(float3 a, float3 b) { float x, y, z; x = (b.x != 0.0f)? a.x/b.x: 0.0f; y = (b.y != 0.0f)? a.y/b.y: 0.0f; z = (b.z != 0.0f)? a.z/b.z: 0.0f; /* try to get gray even if b is zero */ if(b.x == 0.0f) { if(b.y == 0.0f) { x = z; y = z; } else if(b.z == 0.0f) { x = y; z = y; } else x = 0.5f*(y + z); } else if(b.y == 0.0f) { if(b.z == 0.0f) { y = x; z = x; } else y = 0.5f*(x + z); } else if(b.z == 0.0f) { z = 0.5f*(x + y); } return make_float3(x, y, z); } /* Rotation of point around axis and angle */ ccl_device_inline float3 rotate_around_axis(float3 p, float3 axis, float angle) { float costheta = cosf(angle); float sintheta = sinf(angle); float3 r; r.x = ((costheta + (1 - costheta) * axis.x * axis.x) * p.x) + (((1 - costheta) * axis.x * axis.y - axis.z * sintheta) * p.y) + (((1 - costheta) * axis.x * axis.z + axis.y * sintheta) * p.z); r.y = (((1 - costheta) * axis.x * axis.y + axis.z * sintheta) * p.x) + ((costheta + (1 - costheta) * axis.y * axis.y) * p.y) + (((1 - costheta) * axis.y * axis.z - axis.x * sintheta) * p.z); r.z = (((1 - costheta) * axis.x * axis.z - axis.y * sintheta) * p.x) + (((1 - costheta) * axis.y * axis.z + axis.x * sintheta) * p.y) + ((costheta + (1 - costheta) * axis.z * axis.z) * p.z); return r; } /* NaN-safe math ops */ ccl_device_inline float safe_sqrtf(float f) { return sqrtf(max(f, 0.0f)); } ccl_device float safe_asinf(float a) { return asinf(clamp(a, -1.0f, 1.0f)); } ccl_device float safe_acosf(float a) { return acosf(clamp(a, -1.0f, 1.0f)); } ccl_device float compatible_powf(float x, float y) { #ifdef __KERNEL_GPU__ if(y == 0.0f) /* x^0 -> 1, including 0^0 */ return 1.0f; /* GPU pow doesn't accept negative x, do manual checks here */ if(x < 0.0f) { if(fmodf(-y, 2.0f) == 0.0f) return powf(-x, y); else return -powf(-x, y); } else if(x == 0.0f) return 0.0f; #endif return powf(x, y); } ccl_device float safe_powf(float a, float b) { if(UNLIKELY(a < 0.0f && b != float_to_int(b))) return 0.0f; return compatible_powf(a, b); } ccl_device float safe_divide(float a, float b) { return (b != 0.0f)? a/b: 0.0f; } ccl_device float safe_logf(float a, float b) { if(UNLIKELY(a <= 0.0f || b <= 0.0f)) return 0.0f; return safe_divide(logf(a),logf(b)); } ccl_device float safe_modulo(float a, float b) { return (b != 0.0f)? fmodf(a, b): 0.0f; } ccl_device_inline float sqr(float a) { return a * a; } ccl_device_inline float beta(float x, float y) { #ifndef __KERNEL_OPENCL__ return expf(lgammaf(x) + lgammaf(y) - lgammaf(x+y)); #else return expf(lgamma(x) + lgamma(y) - lgamma(x+y)); #endif } ccl_device_inline float xor_signmask(float x, int y) { return __int_as_float(__float_as_int(x) ^ y); } /* projections */ ccl_device_inline float2 map_to_tube(const float3 co) { float len, u, v; len = sqrtf(co.x * co.x + co.y * co.y); if(len > 0.0f) { u = (1.0f - (atan2f(co.x / len, co.y / len) / M_PI_F)) * 0.5f; v = (co.z + 1.0f) * 0.5f; } else { u = v = 0.0f; } return make_float2(u, v); } ccl_device_inline float2 map_to_sphere(const float3 co) { float l = len(co); float u, v; if(l > 0.0f) { if(UNLIKELY(co.x == 0.0f && co.y == 0.0f)) { u = 0.0f; /* othwise domain error */ } else { u = (1.0f - atan2f(co.x, co.y) / M_PI_F) / 2.0f; } v = 1.0f - safe_acosf(co.z / l) / M_PI_F; } else { u = v = 0.0f; } return make_float2(u, v); } CCL_NAMESPACE_END #endif /* __UTIL_MATH_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_cdf.cpp000066400000000000000000000040211334742672700226550ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_math_cdf.h" #include "util/util_algorithm.h" #include "util/util_math.h" CCL_NAMESPACE_BEGIN /* Invert pre-calculated CDF function. */ void util_cdf_invert(const int resolution, const float from, const float to, const vector &cdf, const bool make_symmetric, vector &inv_cdf) { const float inv_resolution = 1.0f / (float)resolution; const float range = to - from; inv_cdf.resize(resolution); if(make_symmetric) { const int half_size = (resolution - 1) / 2; for(int i = 0; i <= half_size; i++) { float x = i / (float)half_size; int index = upper_bound(cdf.begin(), cdf.end(), x) - cdf.begin(); float t; if(index < cdf.size() - 1) { t = (x - cdf[index])/(cdf[index+1] - cdf[index]); } else { t = 0.0f; index = cdf.size() - 1; } float y = ((index + t) / (resolution - 1)) * (2.0f * range); inv_cdf[half_size+i] = 0.5f*(1.0f + y); inv_cdf[half_size-i] = 0.5f*(1.0f - y); } } else { for(int i = 0; i < resolution; i++) { float x = from + range * (float)i * inv_resolution; int index = upper_bound(cdf.begin(), cdf.end(), x) - cdf.begin(); float t; if(index < cdf.size() - 1) { t = (x - cdf[index])/(cdf[index+1] - cdf[index]); } else { t = 0.0f; index = resolution; } inv_cdf[i] = (index + t) * inv_resolution; } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_math_cdf.h000066400000000000000000000050151334742672700223260ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_CDF_H__ #define __UTIL_MATH_CDF_H__ #include "util/util_algorithm.h" #include "util/util_math.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN /* Evaluate CDF of a given functor with given range and resolution. */ template void util_cdf_evaluate(const int resolution, const float from, const float to, Functor functor, vector &cdf) { const int cdf_count = resolution + 1; const float range = to - from; cdf.resize(cdf_count); cdf[0] = 0.0f; /* Actual CDF evaluation. */ for(int i = 0; i < resolution; ++i) { float x = from + range * (float)i / (resolution - 1); float y = functor(x); cdf[i + 1] = cdf[i] + fabsf(y); } /* Normalize the CDF. */ for(int i = 0; i <= resolution; i++) { cdf[i] /= cdf[resolution]; } } /* Invert pre-calculated CDF function. */ void util_cdf_invert(const int resolution, const float from, const float to, const vector &cdf, const bool make_symmetric, vector &inv_cdf); /* Evaluate inverted CDF of a given functor with given range and resolution. */ template void util_cdf_inverted(const int resolution, const float from, const float to, Functor functor, const bool make_symmetric, vector &inv_cdf) { vector cdf; /* There is no much smartness going around lower resolution for the CDF table, * this just to match the old code from pixel filter so it all stays exactly * the same and no regression tests are failed. */ util_cdf_evaluate(resolution - 1, from, to, functor, cdf); util_cdf_invert(resolution, from, to, cdf, make_symmetric, inv_cdf); } CCL_NAMESPACE_END #endif /* __UTIL_MATH_H_CDF__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_fast.h000066400000000000000000000465051334742672700225400ustar00rootroot00000000000000/* * Adapted from OpenImageIO library with this license: * * Copyright 2008-2014 Larry Gritz and the other authors and contributors. * 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 the software's owners 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. * * (This is the Modified BSD License) * * A few bits here are based upon code from NVIDIA that was also released * under the same modified BSD license, and marked as: * Copyright 2004 NVIDIA Corporation. All Rights Reserved. * * Some parts of this file were first open-sourced in Open Shading Language, * then later moved here. The original copyright notice was: * Copyright (c) 2009-2014 Sony Pictures Imageworks Inc., et al. * * Many of the math functions were copied from or inspired by other * public domain sources or open source packages with compatible licenses. * The individual functions give references were applicable. */ #ifndef __UTIL_FAST_MATH__ #define __UTIL_FAST_MATH__ CCL_NAMESPACE_BEGIN ccl_device_inline float madd(const float a, const float b, const float c) { /* NOTE: In the future we may want to explicitly ask for a fused * multiply-add in a specialized version for float. * * NOTE: GCC/ICC will turn this (for float) into a FMA unless * explicitly asked not to, clang seems to leave the code alone. */ return a * b + c; } /* * FAST & APPROXIMATE MATH * * The functions named "fast_*" provide a set of replacements to libm that * are much faster at the expense of some accuracy and robust handling of * extreme values. One design goal for these approximation was to avoid * branches as much as possible and operate on single precision values only * so that SIMD versions should be straightforward ports We also try to * implement "safe" semantics (ie: clamp to valid range where possible) * natively since wrapping these inline calls in another layer would be * wasteful. * * Some functions are fast_safe_*, which is both a faster approximation as * well as clamped input domain to ensure no NaN, Inf, or divide by zero. */ /* Round to nearest integer, returning as an int. */ ccl_device_inline int fast_rint(float x) { /* used by sin/cos/tan range reduction. */ #ifdef __KERNEL_SSE4__ /* Single roundps instruction on SSE4.1+ (for gcc/clang at least). */ return float_to_int(rintf(x)); #else /* emulate rounding by adding/substracting 0.5. */ return float_to_int(x + copysignf(0.5f, x)); #endif } ccl_device float fast_sinf(float x) { /* Very accurate argument reduction from SLEEF, * starts failing around x=262000 * * Results on: [-2pi,2pi]. * * Examined 2173837240 values of sin: 0.00662760244 avg ulp diff, 2 max ulp, * 1.19209e-07 max error */ int q = fast_rint(x * M_1_PI_F); float qf = q; x = madd(qf, -0.78515625f*4, x); x = madd(qf, -0.00024187564849853515625f*4, x); x = madd(qf, -3.7747668102383613586e-08f*4, x); x = madd(qf, -1.2816720341285448015e-12f*4, x); x = M_PI_2_F - (M_PI_2_F - x); /* Crush denormals */ float s = x * x; if((q & 1) != 0) x = -x; /* This polynomial approximation has very low error on [-pi/2,+pi/2] * 1.19209e-07 max error in total over [-2pi,+2pi]. */ float u = 2.6083159809786593541503e-06f; u = madd(u, s, -0.0001981069071916863322258f); u = madd(u, s, +0.00833307858556509017944336f); u = madd(u, s, -0.166666597127914428710938f); u = madd(s, u * x, x); /* For large x, the argument reduction can fail and the polynomial can be * evaluated with arguments outside the valid internal. Just clamp the bad * values away (setting to 0.0f means no branches need to be generated). */ if(fabsf(u) > 1.0f) { u = 0.0f; } return u; } ccl_device float fast_cosf(float x) { /* Same argument reduction as fast_sinf(). */ int q = fast_rint(x * M_1_PI_F); float qf = q; x = madd(qf, -0.78515625f*4, x); x = madd(qf, -0.00024187564849853515625f*4, x); x = madd(qf, -3.7747668102383613586e-08f*4, x); x = madd(qf, -1.2816720341285448015e-12f*4, x); x = M_PI_2_F - (M_PI_2_F - x); /* Crush denormals. */ float s = x * x; /* Polynomial from SLEEF's sincosf, max error is * 4.33127e-07 over [-2pi,2pi] (98% of values are "exact"). */ float u = -2.71811842367242206819355e-07f; u = madd(u, s, +2.47990446951007470488548e-05f); u = madd(u, s, -0.00138888787478208541870117f); u = madd(u, s, +0.0416666641831398010253906f); u = madd(u, s, -0.5f); u = madd(u, s, +1.0f); if((q & 1) != 0) { u = -u; } if(fabsf(u) > 1.0f) { u = 0.0f; } return u; } ccl_device void fast_sincosf(float x, float* sine, float* cosine) { /* Same argument reduction as fast_sin. */ int q = fast_rint(x * M_1_PI_F); float qf = q; x = madd(qf, -0.78515625f*4, x); x = madd(qf, -0.00024187564849853515625f*4, x); x = madd(qf, -3.7747668102383613586e-08f*4, x); x = madd(qf, -1.2816720341285448015e-12f*4, x); x = M_PI_2_F - (M_PI_2_F - x); // crush denormals float s = x * x; /* NOTE: same exact polynomials as fast_sinf() and fast_cosf() above. */ if((q & 1) != 0) { x = -x; } float su = 2.6083159809786593541503e-06f; su = madd(su, s, -0.0001981069071916863322258f); su = madd(su, s, +0.00833307858556509017944336f); su = madd(su, s, -0.166666597127914428710938f); su = madd(s, su * x, x); float cu = -2.71811842367242206819355e-07f; cu = madd(cu, s, +2.47990446951007470488548e-05f); cu = madd(cu, s, -0.00138888787478208541870117f); cu = madd(cu, s, +0.0416666641831398010253906f); cu = madd(cu, s, -0.5f); cu = madd(cu, s, +1.0f); if((q & 1) != 0) { cu = -cu; } if(fabsf(su) > 1.0f) { su = 0.0f; } if(fabsf(cu) > 1.0f) { cu = 0.0f; } *sine = su; *cosine = cu; } /* NOTE: this approximation is only valid on [-8192.0,+8192.0], it starts * becoming really poor outside of this range because the reciprocal amplifies * errors. */ ccl_device float fast_tanf(float x) { /* Derived from SLEEF implementation. * * Note that we cannot apply the "denormal crush" trick everywhere because * we sometimes need to take the reciprocal of the polynomial */ int q = fast_rint(x * 2.0f * M_1_PI_F); float qf = q; x = madd(qf, -0.78515625f*2, x); x = madd(qf, -0.00024187564849853515625f*2, x); x = madd(qf, -3.7747668102383613586e-08f*2, x); x = madd(qf, -1.2816720341285448015e-12f*2, x); if((q & 1) == 0) { /* Crush denormals (only if we aren't inverting the result later). */ x = M_PI_4_F - (M_PI_4_F - x); } float s = x * x; float u = 0.00927245803177356719970703f; u = madd(u, s, 0.00331984995864331722259521f); u = madd(u, s, 0.0242998078465461730957031f); u = madd(u, s, 0.0534495301544666290283203f); u = madd(u, s, 0.133383005857467651367188f); u = madd(u, s, 0.333331853151321411132812f); u = madd(s, u * x, x); if((q & 1) != 0) { u = -1.0f / u; } return u; } /* Fast, approximate sin(x*M_PI) with maximum absolute error of 0.000918954611. * * Adapted from http://devmaster.net/posts/9648/fast-and-accurate-sine-cosine#comment-76773 */ ccl_device float fast_sinpif(float x) { /* Fast trick to strip the integral part off, so our domain is [-1, 1]. */ const float z = x - ((x + 25165824.0f) - 25165824.0f); const float y = z - z * fabsf(z); const float Q = 3.10396624f; const float P = 3.584135056f; /* P = 16-4*Q */ return y * (Q + P * fabsf(y)); /* The original article used used inferior constants for Q and P and * so had max error 1.091e-3. * * The optimal value for Q was determined by exhaustive search, minimizing * the absolute numerical error relative to float(std::sin(double(phi*M_PI))) * over the interval [0,2] (which is where most of the invocations happen). * * The basic idea of this approximation starts with the coarse approximation: * sin(pi*x) ~= f(x) = 4 * (x - x * abs(x)) * * This approximation always _over_ estimates the target. On the other hand, * the curve: * sin(pi*x) ~= f(x) * abs(f(x)) / 4 * * always lies _under_ the target. Thus we can simply numerically search for * the optimal constant to LERP these curves into a more precise * approximation. * * After folding the constants together and simplifying the resulting math, * we end up with the compact implementation above. * * NOTE: this function actually computes sin(x * pi) which avoids one or two * mults in many cases and guarantees exact values at integer periods. */ } /* Fast approximate cos(x*M_PI) with ~0.1% absolute error. */ ccl_device_inline float fast_cospif(float x) { return fast_sinpif(x+0.5f); } ccl_device float fast_acosf(float x) { const float f = fabsf(x); /* clamp and crush denormals. */ const float m = (f < 1.0f) ? 1.0f - (1.0f - f) : 1.0f; /* Based on http://www.pouet.net/topic.php?which=9132&page=2 * 85% accurate (ulp 0) * Examined 2130706434 values of acos: 15.2000597 avg ulp diff, 4492 max ulp, 4.51803e-05 max error // without "denormal crush" * Examined 2130706434 values of acos: 15.2007108 avg ulp diff, 4492 max ulp, 4.51803e-05 max error // with "denormal crush" */ const float a = sqrtf(1.0f - m) * (1.5707963267f + m * (-0.213300989f + m * (0.077980478f + m * -0.02164095f))); return x < 0 ? M_PI_F - a : a; } ccl_device float fast_asinf(float x) { /* Based on acosf approximation above. * Max error is 4.51133e-05 (ulps are higher because we are consistently off * by a little amount). */ const float f = fabsf(x); /* Clamp and crush denormals. */ const float m = (f < 1.0f) ? 1.0f - (1.0f - f) : 1.0f; const float a = M_PI_2_F - sqrtf(1.0f - m) * (1.5707963267f + m * (-0.213300989f + m * (0.077980478f + m * -0.02164095f))); return copysignf(a, x); } ccl_device float fast_atanf(float x) { const float a = fabsf(x); const float k = a > 1.0f ? 1 / a : a; const float s = 1.0f - (1.0f - k); /* Crush denormals. */ const float t = s * s; /* http://mathforum.org/library/drmath/view/62672.html * Examined 4278190080 values of atan: 2.36864877 avg ulp diff, 302 max ulp, 6.55651e-06 max error // (with denormals) * Examined 4278190080 values of atan: 171160502 avg ulp diff, 855638016 max ulp, 6.55651e-06 max error // (crush denormals) */ float r = s * madd(0.43157974f, t, 1.0f) / madd(madd(0.05831938f, t, 0.76443945f), t, 1.0f); if(a > 1.0f) { r = M_PI_2_F - r; } return copysignf(r, x); } ccl_device float fast_atan2f(float y, float x) { /* Based on atan approximation above. * * The special cases around 0 and infinity were tested explicitly. * * The only case not handled correctly is x=NaN,y=0 which returns 0 instead * of nan. */ const float a = fabsf(x); const float b = fabsf(y); const float k = (b == 0) ? 0.0f : ((a == b) ? 1.0f : (b > a ? a / b : b / a)); const float s = 1.0f - (1.0f - k); /* Crush denormals */ const float t = s * s; float r = s * madd(0.43157974f, t, 1.0f) / madd(madd(0.05831938f, t, 0.76443945f), t, 1.0f); if(b > a) { /* Account for arg reduction. */ r = M_PI_2_F - r; } /* Test sign bit of x. */ if(__float_as_uint(x) & 0x80000000u) { r = M_PI_F - r; } return copysignf(r, y); } /* Based on: * * https://github.com/LiraNuna/glsl-sse2/blob/master/source/vec4.h * */ ccl_device float fast_log2f(float x) { /* NOTE: clamp to avoid special cases and make result "safe" from large * negative values/nans. */ x = clamp(x, FLT_MIN, FLT_MAX); unsigned bits = __float_as_uint(x); int exponent = (int)(bits >> 23) - 127; float f = __uint_as_float((bits & 0x007FFFFF) | 0x3f800000) - 1.0f; /* Examined 2130706432 values of log2 on [1.17549435e-38,3.40282347e+38]: * 0.0797524457 avg ulp diff, 3713596 max ulp, 7.62939e-06 max error. * ulp histogram: * 0 = 97.46% * 1 = 2.29% * 2 = 0.11% */ float f2 = f * f; float f4 = f2 * f2; float hi = madd(f, -0.00931049621349f, 0.05206469089414f); float lo = madd(f, 0.47868480909345f, -0.72116591947498f); hi = madd(f, hi, -0.13753123777116f); hi = madd(f, hi, 0.24187369696082f); hi = madd(f, hi, -0.34730547155299f); lo = madd(f, lo, 1.442689881667200f); return ((f4 * hi) + (f * lo)) + exponent; } ccl_device_inline float fast_logf(float x) { /* Examined 2130706432 values of logf on [1.17549435e-38,3.40282347e+38]: * 0.313865375 avg ulp diff, 5148137 max ulp, 7.62939e-06 max error. */ return fast_log2f(x) * M_LN2_F; } ccl_device_inline float fast_log10(float x) { /* Examined 2130706432 values of log10f on [1.17549435e-38,3.40282347e+38]: * 0.631237033 avg ulp diff, 4471615 max ulp, 3.8147e-06 max error. */ return fast_log2f(x) * M_LN2_F / M_LN10_F; } ccl_device float fast_logb(float x) { /* Don't bother with denormals. */ x = fabsf(x); x = clamp(x, FLT_MIN, FLT_MAX); unsigned bits = __float_as_uint(x); return (int)(bits >> 23) - 127; } ccl_device float fast_exp2f(float x) { /* Clamp to safe range for final addition. */ x = clamp(x, -126.0f, 126.0f); /* Range reduction. */ int m = (int)x; x -= m; x = 1.0f - (1.0f - x); /* Crush denormals (does not affect max ulps!). */ /* 5th degree polynomial generated with sollya * Examined 2247622658 values of exp2 on [-126,126]: 2.75764912 avg ulp diff, * 232 max ulp. * * ulp histogram: * 0 = 87.81% * 1 = 4.18% */ float r = 1.33336498402e-3f; r = madd(x, r, 9.810352697968e-3f); r = madd(x, r, 5.551834031939e-2f); r = madd(x, r, 0.2401793301105f); r = madd(x, r, 0.693144857883f); r = madd(x, r, 1.0f); /* Multiply by 2 ^ m by adding in the exponent. */ /* NOTE: left-shift of negative number is undefined behavior. */ return __uint_as_float(__float_as_uint(r) + ((unsigned)m << 23)); } ccl_device_inline float fast_expf(float x) { /* Examined 2237485550 values of exp on [-87.3300018,87.3300018]: * 2.6666452 avg ulp diff, 230 max ulp. */ return fast_exp2f(x / M_LN2_F); } ccl_device_inline float fast_exp10(float x) { /* Examined 2217701018 values of exp10 on [-37.9290009,37.9290009]: * 2.71732409 avg ulp diff, 232 max ulp. */ return fast_exp2f(x * M_LN10_F / M_LN2_F); } ccl_device_inline float fast_expm1f(float x) { if(fabsf(x) < 1e-5f) { x = 1.0f - (1.0f - x); /* Crush denormals. */ return madd(0.5f, x * x, x); } else { return fast_expf(x) - 1.0f; } } ccl_device float fast_sinhf(float x) { float a = fabsf(x); if(a > 1.0f) { /* Examined 53389559 values of sinh on [1,87.3300018]: * 33.6886442 avg ulp diff, 178 max ulp. */ float e = fast_expf(a); return copysignf(0.5f * e - 0.5f / e, x); } else { a = 1.0f - (1.0f - a); /* Crush denorms. */ float a2 = a * a; /* Degree 7 polynomial generated with sollya. */ /* Examined 2130706434 values of sinh on [-1,1]: 1.19209e-07 max error. */ float r = 2.03945513931e-4f; r = madd(r, a2, 8.32990277558e-3f); r = madd(r, a2, 0.1666673421859f); r = madd(r * a, a2, a); return copysignf(r, x); } } ccl_device_inline float fast_coshf(float x) { /* Examined 2237485550 values of cosh on [-87.3300018,87.3300018]: * 1.78256726 avg ulp diff, 178 max ulp. */ float e = fast_expf(fabsf(x)); return 0.5f * e + 0.5f / e; } ccl_device_inline float fast_tanhf(float x) { /* Examined 4278190080 values of tanh on [-3.40282347e+38,3.40282347e+38]: * 3.12924e-06 max error. */ /* NOTE: ulp error is high because of sub-optimal handling around the origin. */ float e = fast_expf(2.0f * fabsf(x)); return copysignf(1.0f - 2.0f / (1.0f + e), x); } ccl_device float fast_safe_powf(float x, float y) { if(y == 0) return 1.0f; /* x^1=1 */ if(x == 0) return 0.0f; /* 0^y=0 */ float sign = 1.0f; if(x < 0.0f) { /* if x is negative, only deal with integer powers * powf returns NaN for non-integers, we will return 0 instead. */ int ybits = __float_as_int(y) & 0x7fffffff; if(ybits >= 0x4b800000) { // always even int, keep positive } else if(ybits >= 0x3f800000) { /* Bigger than 1, check. */ int k = (ybits >> 23) - 127; /* Get exponent. */ int j = ybits >> (23 - k); /* Shift out possible fractional bits. */ if((j << (23 - k)) == ybits) { /* rebuild number and check for a match. */ /* +1 for even, -1 for odd. */ sign = __int_as_float(0x3f800000 | (j << 31)); } else { /* Not an integer. */ return 0.0f; } } else { /* Not an integer. */ return 0.0f; } } return sign * fast_exp2f(y * fast_log2f(fabsf(x))); } /* TODO(sergey): Check speed with our erf functions implementation from * bsdf_microfacet.h. */ ccl_device_inline float fast_erff(float x) { /* Examined 1082130433 values of erff on [0,4]: 1.93715e-06 max error. */ /* Abramowitz and Stegun, 7.1.28. */ const float a1 = 0.0705230784f; const float a2 = 0.0422820123f; const float a3 = 0.0092705272f; const float a4 = 0.0001520143f; const float a5 = 0.0002765672f; const float a6 = 0.0000430638f; const float a = fabsf(x); if(a >= 12.3f) { return copysignf(1.0f, x); } const float b = 1.0f - (1.0f - a); /* Crush denormals. */ const float r = madd(madd(madd(madd(madd(madd(a6, b, a5), b, a4), b, a3), b, a2), b, a1), b, 1.0f); const float s = r * r; /* ^2 */ const float t = s * s; /* ^4 */ const float u = t * t; /* ^8 */ const float v = u * u; /* ^16 */ return copysignf(1.0f - 1.0f / v, x); } ccl_device_inline float fast_erfcf(float x) { /* Examined 2164260866 values of erfcf on [-4,4]: 1.90735e-06 max error. * * ulp histogram: * * 0 = 80.30% */ return 1.0f - fast_erff(x); } ccl_device_inline float fast_ierff(float x) { /* From: Approximating the erfinv function by Mike Giles. */ /* To avoid trouble at the limit, clamp input to 1-eps. */ float a = fabsf(x); if(a > 0.99999994f) { a = 0.99999994f; } float w = -fast_logf((1.0f - a) * (1.0f + a)), p; if(w < 5.0f) { w = w - 2.5f; p = 2.81022636e-08f; p = madd(p, w, 3.43273939e-07f); p = madd(p, w, -3.5233877e-06f); p = madd(p, w, -4.39150654e-06f); p = madd(p, w, 0.00021858087f); p = madd(p, w, -0.00125372503f); p = madd(p, w, -0.00417768164f); p = madd(p, w, 0.246640727f); p = madd(p, w, 1.50140941f); } else { w = sqrtf(w) - 3.0f; p = -0.000200214257f; p = madd(p, w, 0.000100950558f); p = madd(p, w, 0.00134934322f); p = madd(p, w, -0.00367342844f); p = madd(p, w, 0.00573950773f); p = madd(p, w, -0.0076224613f); p = madd(p, w, 0.00943887047f); p = madd(p, w, 1.00167406f); p = madd(p, w, 2.83297682f); } return p * x; } CCL_NAMESPACE_END #endif /* __UTIL_FAST_MATH__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_float2.h000066400000000000000000000136341334742672700227670ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_FLOAT2_H__ #define __UTIL_MATH_FLOAT2_H__ #ifndef __UTIL_MATH_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN /******************************************************************************* * Declaration. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline float2 operator-(const float2& a); ccl_device_inline float2 operator*(const float2& a, const float2& b); ccl_device_inline float2 operator*(const float2& a, float f); ccl_device_inline float2 operator*(float f, const float2& a); ccl_device_inline float2 operator/(float f, const float2& a); ccl_device_inline float2 operator/(const float2& a, float f); ccl_device_inline float2 operator/(const float2& a, const float2& b); ccl_device_inline float2 operator+(const float2& a, const float2& b); ccl_device_inline float2 operator-(const float2& a, const float2& b); ccl_device_inline float2 operator+=(float2& a, const float2& b); ccl_device_inline float2 operator*=(float2& a, const float2& b); ccl_device_inline float2 operator*=(float2& a, float f); ccl_device_inline float2 operator/=(float2& a, const float2& b); ccl_device_inline float2 operator/=(float2& a, float f); ccl_device_inline bool operator==(const float2& a, const float2& b); ccl_device_inline bool operator!=(const float2& a, const float2& b); ccl_device_inline bool is_zero(const float2& a); ccl_device_inline float average(const float2& a); ccl_device_inline float dot(const float2& a, const float2& b); ccl_device_inline float cross(const float2& a, const float2& b); ccl_device_inline float len(const float2& a); ccl_device_inline float2 normalize(const float2& a); ccl_device_inline float2 normalize_len(const float2& a, float *t); ccl_device_inline float2 safe_normalize(const float2& a); ccl_device_inline float2 min(const float2& a, const float2& b); ccl_device_inline float2 max(const float2& a, const float2& b); ccl_device_inline float2 clamp(const float2& a, const float2& mn, const float2& mx); ccl_device_inline float2 fabs(const float2& a); ccl_device_inline float2 as_float2(const float4& a); ccl_device_inline float2 interp(const float2& a, const float2& b, float t); #endif /* !__KERNEL_OPENCL__ */ /******************************************************************************* * Definition. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline float2 operator-(const float2& a) { return make_float2(-a.x, -a.y); } ccl_device_inline float2 operator*(const float2& a, const float2& b) { return make_float2(a.x*b.x, a.y*b.y); } ccl_device_inline float2 operator*(const float2& a, float f) { return make_float2(a.x*f, a.y*f); } ccl_device_inline float2 operator*(float f, const float2& a) { return make_float2(a.x*f, a.y*f); } ccl_device_inline float2 operator/(float f, const float2& a) { return make_float2(f/a.x, f/a.y); } ccl_device_inline float2 operator/(const float2& a, float f) { float invf = 1.0f/f; return make_float2(a.x*invf, a.y*invf); } ccl_device_inline float2 operator/(const float2& a, const float2& b) { return make_float2(a.x/b.x, a.y/b.y); } ccl_device_inline float2 operator+(const float2& a, const float2& b) { return make_float2(a.x+b.x, a.y+b.y); } ccl_device_inline float2 operator-(const float2& a, const float2& b) { return make_float2(a.x-b.x, a.y-b.y); } ccl_device_inline float2 operator+=(float2& a, const float2& b) { return a = a + b; } ccl_device_inline float2 operator*=(float2& a, const float2& b) { return a = a * b; } ccl_device_inline float2 operator*=(float2& a, float f) { return a = a * f; } ccl_device_inline float2 operator/=(float2& a, const float2& b) { return a = a / b; } ccl_device_inline float2 operator/=(float2& a, float f) { float invf = 1.0f/f; return a = a * invf; } ccl_device_inline bool operator==(const float2& a, const float2& b) { return (a.x == b.x && a.y == b.y); } ccl_device_inline bool operator!=(const float2& a, const float2& b) { return !(a == b); } ccl_device_inline bool is_zero(const float2& a) { return (a.x == 0.0f && a.y == 0.0f); } ccl_device_inline float average(const float2& a) { return (a.x + a.y)*(1.0f/2.0f); } ccl_device_inline float dot(const float2& a, const float2& b) { return a.x*b.x + a.y*b.y; } ccl_device_inline float cross(const float2& a, const float2& b) { return (a.x*b.y - a.y*b.x); } ccl_device_inline float len(const float2& a) { return sqrtf(dot(a, a)); } ccl_device_inline float2 normalize(const float2& a) { return a/len(a); } ccl_device_inline float2 normalize_len(const float2& a, float *t) { *t = len(a); return a/(*t); } ccl_device_inline float2 safe_normalize(const float2& a) { float t = len(a); return (t != 0.0f)? a/t: a; } ccl_device_inline float2 min(const float2& a, const float2& b) { return make_float2(min(a.x, b.x), min(a.y, b.y)); } ccl_device_inline float2 max(const float2& a, const float2& b) { return make_float2(max(a.x, b.x), max(a.y, b.y)); } ccl_device_inline float2 clamp(const float2& a, const float2& mn, const float2& mx) { return min(max(a, mn), mx); } ccl_device_inline float2 fabs(const float2& a) { return make_float2(fabsf(a.x), fabsf(a.y)); } ccl_device_inline float2 as_float2(const float4& a) { return make_float2(a.x, a.y); } ccl_device_inline float2 interp(const float2& a, const float2& b, float t) { return a + t*(b - a); } #endif /* !__KERNEL_OPENCL__ */ CCL_NAMESPACE_END #endif /* __UTIL_MATH_FLOAT2_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_float3.h000066400000000000000000000240311334742672700227610ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_FLOAT3_H__ #define __UTIL_MATH_FLOAT3_H__ #ifndef __UTIL_MATH_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN /******************************************************************************* * Declaration. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline float3 operator-(const float3& a); ccl_device_inline float3 operator*(const float3& a, const float3& b); ccl_device_inline float3 operator*(const float3& a, const float f); ccl_device_inline float3 operator*(const float f, const float3& a); ccl_device_inline float3 operator/(const float f, const float3& a); ccl_device_inline float3 operator/(const float3& a, const float f); ccl_device_inline float3 operator/(const float3& a, const float3& b); ccl_device_inline float3 operator+(const float3& a, const float3& b); ccl_device_inline float3 operator-(const float3& a, const float3& b); ccl_device_inline float3 operator+=(float3& a, const float3& b); ccl_device_inline float3 operator-=(float3& a, const float3& b); ccl_device_inline float3 operator*=(float3& a, const float3& b); ccl_device_inline float3 operator*=(float3& a, float f); ccl_device_inline float3 operator/=(float3& a, const float3& b); ccl_device_inline float3 operator/=(float3& a, float f); ccl_device_inline bool operator==(const float3& a, const float3& b); ccl_device_inline bool operator!=(const float3& a, const float3& b); ccl_device_inline float dot(const float3& a, const float3& b); ccl_device_inline float dot_xy(const float3& a, const float3& b); ccl_device_inline float3 cross(const float3& a, const float3& b); ccl_device_inline float3 normalize(const float3& a); ccl_device_inline float3 min(const float3& a, const float3& b); ccl_device_inline float3 max(const float3& a, const float3& b); ccl_device_inline float3 clamp(const float3& a, const float3& mn, const float3& mx); ccl_device_inline float3 fabs(const float3& a); ccl_device_inline float3 mix(const float3& a, const float3& b, float t); ccl_device_inline float3 rcp(const float3& a); ccl_device_inline float3 sqrt(const float3& a); #endif /* !__KERNEL_OPENCL__ */ ccl_device_inline float min3(float3 a); ccl_device_inline float max3(float3 a); ccl_device_inline float len(const float3 a); ccl_device_inline float len_squared(const float3 a); ccl_device_inline float3 saturate3(float3 a); ccl_device_inline float3 safe_normalize(const float3 a); ccl_device_inline float3 normalize_len(const float3 a, float *t);; ccl_device_inline float3 safe_normalize_len(const float3 a, float *t); ccl_device_inline float3 interp(float3 a, float3 b, float t); ccl_device_inline bool is_zero(const float3 a); ccl_device_inline float reduce_add(const float3 a); ccl_device_inline float average(const float3 a); ccl_device_inline bool isequal_float3(const float3 a, const float3 b); /******************************************************************************* * Definition. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline float3 operator-(const float3& a) { #ifdef __KERNEL_SSE__ return float3(_mm_xor_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x80000000)))); #else return make_float3(-a.x, -a.y, -a.z); #endif } ccl_device_inline float3 operator*(const float3& a, const float3& b) { #ifdef __KERNEL_SSE__ return float3(_mm_mul_ps(a.m128,b.m128)); #else return make_float3(a.x*b.x, a.y*b.y, a.z*b.z); #endif } ccl_device_inline float3 operator*(const float3& a, const float f) { #ifdef __KERNEL_SSE__ return float3(_mm_mul_ps(a.m128,_mm_set1_ps(f))); #else return make_float3(a.x*f, a.y*f, a.z*f); #endif } ccl_device_inline float3 operator*(const float f, const float3& a) { #if defined(__KERNEL_SSE__) return float3(_mm_mul_ps(_mm_set1_ps(f), a.m128)); #else return make_float3(a.x*f, a.y*f, a.z*f); #endif } ccl_device_inline float3 operator/(const float f, const float3& a) { #if defined(__KERNEL_SSE__) return float3(_mm_div_ps(_mm_set1_ps(f), a.m128)); #else return make_float3(f / a.x, f / a.y, f / a.z); #endif } ccl_device_inline float3 operator/(const float3& a, const float f) { float invf = 1.0f/f; return a * invf; } ccl_device_inline float3 operator/(const float3& a, const float3& b) { #if defined(__KERNEL_SSE__) return float3(_mm_div_ps(a.m128, b.m128)); #else return make_float3(a.x / b.x, a.y / b.y, a.z / b.z); #endif } ccl_device_inline float3 operator+(const float3& a, const float3& b) { #ifdef __KERNEL_SSE__ return float3(_mm_add_ps(a.m128, b.m128)); #else return make_float3(a.x + b.x, a.y + b.y, a.z + b.z); #endif } ccl_device_inline float3 operator-(const float3& a, const float3& b) { #ifdef __KERNEL_SSE__ return float3(_mm_sub_ps(a.m128, b.m128)); #else return make_float3(a.x - b.x, a.y - b.y, a.z - b.z); #endif } ccl_device_inline float3 operator+=(float3& a, const float3& b) { return a = a + b; } ccl_device_inline float3 operator-=(float3& a, const float3& b) { return a = a - b; } ccl_device_inline float3 operator*=(float3& a, const float3& b) { return a = a * b; } ccl_device_inline float3 operator*=(float3& a, float f) { return a = a * f; } ccl_device_inline float3 operator/=(float3& a, const float3& b) { return a = a / b; } ccl_device_inline float3 operator/=(float3& a, float f) { float invf = 1.0f/f; return a = a * invf; } ccl_device_inline bool operator==(const float3& a, const float3& b) { #ifdef __KERNEL_SSE__ return (_mm_movemask_ps(_mm_cmpeq_ps(a.m128, b.m128)) & 7) == 7; #else return (a.x == b.x && a.y == b.y && a.z == b.z); #endif } ccl_device_inline bool operator!=(const float3& a, const float3& b) { return !(a == b); } ccl_device_inline float dot(const float3& a, const float3& b) { #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) return _mm_cvtss_f32(_mm_dp_ps(a, b, 0x7F)); #else return a.x*b.x + a.y*b.y + a.z*b.z; #endif } ccl_device_inline float dot_xy(const float3& a, const float3& b) { #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) return _mm_cvtss_f32(_mm_hadd_ps(_mm_mul_ps(a,b),b)); #else return a.x*b.x + a.y*b.y; #endif } ccl_device_inline float3 cross(const float3& a, const float3& b) { float3 r = make_float3(a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x); return r; } ccl_device_inline float3 normalize(const float3& a) { #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) __m128 norm = _mm_sqrt_ps(_mm_dp_ps(a.m128, a.m128, 0x7F)); return float3(_mm_div_ps(a.m128, norm)); #else return a/len(a); #endif } ccl_device_inline float3 min(const float3& a, const float3& b) { #ifdef __KERNEL_SSE__ return float3(_mm_min_ps(a.m128, b.m128)); #else return make_float3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); #endif } ccl_device_inline float3 max(const float3& a, const float3& b) { #ifdef __KERNEL_SSE__ return float3(_mm_max_ps(a.m128, b.m128)); #else return make_float3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); #endif } ccl_device_inline float3 clamp(const float3& a, const float3& mn, const float3& mx) { return min(max(a, mn), mx); } ccl_device_inline float3 fabs(const float3& a) { #ifdef __KERNEL_SSE__ __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)); return float3(_mm_and_ps(a.m128, mask)); #else return make_float3(fabsf(a.x), fabsf(a.y), fabsf(a.z)); #endif } ccl_device_inline float3 sqrt(const float3& a) { #ifdef __KERNEL_SSE__ return float3(_mm_sqrt_ps(a)); #else return make_float3(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z)); #endif } ccl_device_inline float3 mix(const float3& a, const float3& b, float t) { return a + t*(b - a); } ccl_device_inline float3 rcp(const float3& a) { #ifdef __KERNEL_SSE__ /* Don't use _mm_rcp_ps due to poor precision. */ return float3(_mm_div_ps(_mm_set_ps1(1.0f), a.m128)); #else return make_float3(1.0f/a.x, 1.0f/a.y, 1.0f/a.z); #endif } #endif /* !__KERNEL_OPENCL__ */ ccl_device_inline float min3(float3 a) { return min(min(a.x, a.y), a.z); } ccl_device_inline float max3(float3 a) { return max(max(a.x, a.y), a.z); } ccl_device_inline float len(const float3 a) { #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) return _mm_cvtss_f32(_mm_sqrt_ss(_mm_dp_ps(a.m128, a.m128, 0x7F))); #else return sqrtf(dot(a, a)); #endif } ccl_device_inline float len_squared(const float3 a) { return dot(a, a); } ccl_device_inline float3 saturate3(float3 a) { return make_float3(saturate(a.x), saturate(a.y), saturate(a.z)); } ccl_device_inline float3 normalize_len(const float3 a, float *t) { *t = len(a); float x = 1.0f / *t; return a*x; } ccl_device_inline float3 safe_normalize(const float3 a) { float t = len(a); return (t != 0.0f)? a * (1.0f/t) : a; } ccl_device_inline float3 safe_normalize_len(const float3 a, float *t) { *t = len(a); return (*t != 0.0f)? a/(*t): a; } ccl_device_inline float3 interp(float3 a, float3 b, float t) { return a + t*(b - a); } ccl_device_inline bool is_zero(const float3 a) { #ifdef __KERNEL_SSE__ return a == make_float3(0.0f); #else return (a.x == 0.0f && a.y == 0.0f && a.z == 0.0f); #endif } ccl_device_inline float reduce_add(const float3 a) { return (a.x + a.y + a.z); } ccl_device_inline float average(const float3 a) { return reduce_add(a)*(1.0f/3.0f); } ccl_device_inline bool isequal_float3(const float3 a, const float3 b) { #ifdef __KERNEL_OPENCL__ return all(a == b); #else return a == b; #endif } ccl_device_inline bool isfinite3_safe(float3 v) { return isfinite_safe(v.x) && isfinite_safe(v.y) && isfinite_safe(v.z); } ccl_device_inline float3 ensure_finite3(float3 v) { if(!isfinite_safe(v.x)) v.x = 0.0f; if(!isfinite_safe(v.y)) v.y = 0.0f; if(!isfinite_safe(v.z)) v.z = 0.0f; return v; } CCL_NAMESPACE_END #endif /* __UTIL_MATH_FLOAT3_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_float4.h000066400000000000000000000301011334742672700227550ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_FLOAT4_H__ #define __UTIL_MATH_FLOAT4_H__ #ifndef __UTIL_MATH_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN /******************************************************************************* * Declaration. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline float4 operator-(const float4& a); ccl_device_inline float4 operator*(const float4& a, const float4& b); ccl_device_inline float4 operator*(const float4& a, float f); ccl_device_inline float4 operator*(float f, const float4& a); ccl_device_inline float4 operator/(const float4& a, float f); ccl_device_inline float4 operator/(const float4& a, const float4& b); ccl_device_inline float4 operator+(const float4& a, const float4& b); ccl_device_inline float4 operator-(const float4& a, const float4& b); ccl_device_inline float4 operator+=(float4& a, const float4& b); ccl_device_inline float4 operator*=(float4& a, const float4& b); ccl_device_inline float4 operator/=(float4& a, float f); ccl_device_inline int4 operator<(const float4& a, const float4& b); ccl_device_inline int4 operator>=(const float4& a, const float4& b); ccl_device_inline int4 operator<=(const float4& a, const float4& b); ccl_device_inline bool operator==(const float4& a, const float4& b); ccl_device_inline float dot(const float4& a, const float4& b); ccl_device_inline float len_squared(const float4& a); ccl_device_inline float4 rcp(const float4& a); ccl_device_inline float4 sqrt(const float4& a); ccl_device_inline float4 sqr(const float4& a); ccl_device_inline float4 cross(const float4& a, const float4& b); ccl_device_inline bool is_zero(const float4& a); ccl_device_inline float average(const float4& a); ccl_device_inline float len(const float4& a); ccl_device_inline float4 normalize(const float4& a); ccl_device_inline float4 safe_normalize(const float4& a); ccl_device_inline float4 min(const float4& a, const float4& b); ccl_device_inline float4 max(const float4& a, const float4& b); ccl_device_inline float4 fabs(const float4& a); #endif /* !__KERNEL_OPENCL__*/ #ifdef __KERNEL_SSE__ template __forceinline const float4 shuffle(const float4& b); template __forceinline const float4 shuffle(const float4& a, const float4& b); template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4& b); template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4& a, const float4& b); template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4& a, const float4& b); # ifdef __KERNEL_SSE3__ template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4& b); template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4& b); # endif #endif /* __KERNEL_SSE__ */ #ifndef __KERNEL_GPU__ ccl_device_inline float4 select(const int4& mask, const float4& a, const float4& b); ccl_device_inline float4 reduce_min(const float4& a); ccl_device_inline float4 reduce_max(const float4& a); ccl_device_inline float4 reduce_add(const float4& a); #endif /* !__KERNEL_GPU__ */ /******************************************************************************* * Definition. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline float4 operator-(const float4& a) { #ifdef __KERNEL_SSE__ __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000)); return float4(_mm_xor_ps(a.m128, mask)); #else return make_float4(-a.x, -a.y, -a.z, -a.w); #endif } ccl_device_inline float4 operator*(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return float4(_mm_mul_ps(a.m128, b.m128)); #else return make_float4(a.x*b.x, a.y*b.y, a.z*b.z, a.w*b.w); #endif } ccl_device_inline float4 operator*(const float4& a, float f) { #if defined(__KERNEL_SSE__) return a * make_float4(f); #else return make_float4(a.x*f, a.y*f, a.z*f, a.w*f); #endif } ccl_device_inline float4 operator*(float f, const float4& a) { return a * f; } ccl_device_inline float4 operator/(const float4& a, float f) { return a * (1.0f/f); } ccl_device_inline float4 operator/(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return float4(_mm_div_ps(a.m128, b.m128)); #else return make_float4(a.x/b.x, a.y/b.y, a.z/b.z, a.w/b.w); #endif } ccl_device_inline float4 operator+(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return float4(_mm_add_ps(a.m128, b.m128)); #else return make_float4(a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w); #endif } ccl_device_inline float4 operator-(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return float4(_mm_sub_ps(a.m128, b.m128)); #else return make_float4(a.x-b.x, a.y-b.y, a.z-b.z, a.w-b.w); #endif } ccl_device_inline float4 operator+=(float4& a, const float4& b) { return a = a + b; } ccl_device_inline float4 operator*=(float4& a, const float4& b) { return a = a * b; } ccl_device_inline float4 operator/=(float4& a, float f) { return a = a / f; } ccl_device_inline int4 operator<(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return int4(_mm_castps_si128(_mm_cmplt_ps(a.m128, b.m128))); #else return make_int4(a.x < b.x, a.y < b.y, a.z < b.z, a.w < b.w); #endif } ccl_device_inline int4 operator>=(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return int4(_mm_castps_si128(_mm_cmpge_ps(a.m128, b.m128))); #else return make_int4(a.x >= b.x, a.y >= b.y, a.z >= b.z, a.w >= b.w); #endif } ccl_device_inline int4 operator<=(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return int4(_mm_castps_si128(_mm_cmple_ps(a.m128, b.m128))); #else return make_int4(a.x <= b.x, a.y <= b.y, a.z <= b.z, a.w <= b.w); #endif } ccl_device_inline bool operator==(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return (_mm_movemask_ps(_mm_cmpeq_ps(a.m128, b.m128)) & 15) == 15; #else return (a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w); #endif } ccl_device_inline float dot(const float4& a, const float4& b) { #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) return _mm_cvtss_f32(_mm_dp_ps(a, b, 0xFF)); #else return (a.x*b.x + a.y*b.y) + (a.z*b.z + a.w*b.w); #endif } ccl_device_inline float len_squared(const float4& a) { return dot(a, a); } ccl_device_inline float4 rcp(const float4& a) { #ifdef __KERNEL_SSE__ /* Don't use _mm_rcp_ps due to poor precision. */ return float4(_mm_div_ps(_mm_set_ps1(1.0f), a.m128)); #else return make_float4(1.0f/a.x, 1.0f/a.y, 1.0f/a.z, 1.0f/a.w); #endif } ccl_device_inline float4 sqrt(const float4& a) { #ifdef __KERNEL_SSE__ return float4(_mm_sqrt_ps(a.m128)); #else return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w)); #endif } ccl_device_inline float4 sqr(const float4& a) { return a * a; } ccl_device_inline float4 cross(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return (shuffle<1,2,0,0>(a)*shuffle<2,0,1,0>(b)) - (shuffle<2,0,1,0>(a)*shuffle<1,2,0,0>(b)); #else return make_float4(a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x, 0.0f); #endif } ccl_device_inline bool is_zero(const float4& a) { #ifdef __KERNEL_SSE__ return a == make_float4(0.0f); #else return (a.x == 0.0f && a.y == 0.0f && a.z == 0.0f && a.w == 0.0f); #endif } ccl_device_inline float4 reduce_add(const float4& a) { #ifdef __KERNEL_SSE__ # ifdef __KERNEL_SSE3__ float4 h(_mm_hadd_ps(a.m128, a.m128)); return float4( _mm_hadd_ps(h.m128, h.m128)); # else float4 h(shuffle<1,0,3,2>(a) + a); return shuffle<2,3,0,1>(h) + h; # endif #else float sum = (a.x + a.y) + (a.z + a.w); return make_float4(sum, sum, sum, sum); #endif } ccl_device_inline float average(const float4& a) { return reduce_add(a).x * 0.25f; } ccl_device_inline float len(const float4& a) { return sqrtf(dot(a, a)); } ccl_device_inline float4 normalize(const float4& a) { return a/len(a); } ccl_device_inline float4 safe_normalize(const float4& a) { float t = len(a); return (t != 0.0f)? a/t: a; } ccl_device_inline float4 min(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return float4(_mm_min_ps(a.m128, b.m128)); #else return make_float4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); #endif } ccl_device_inline float4 max(const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return float4(_mm_max_ps(a.m128, b.m128)); #else return make_float4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); #endif } ccl_device_inline float4 fabs(const float4& a) { #ifdef __KERNEL_SSE__ return float4(_mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)))); #else return make_float4(fabsf(a.x), fabsf(a.y), fabsf(a.z), fabsf(a.w)); #endif } #endif /* !__KERNEL_OPENCL__*/ #ifdef __KERNEL_SSE__ template __forceinline const float4 shuffle(const float4& b) { return float4(_mm_castsi128_ps( _mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(index_3, index_2, index_1, index_0)))); } template __forceinline const float4 shuffle(const float4& a, const float4& b) { return float4(_mm_shuffle_ps(a.m128, b.m128, _MM_SHUFFLE(index_3, index_2, index_1, index_0))); } template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4& b) { return float4(_mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(b)))); } template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4& a, const float4& b) { return float4(_mm_movelh_ps(a.m128, b.m128)); } template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4& a, const float4& b) { return float4(_mm_movehl_ps(b.m128, a.m128)); } # ifdef __KERNEL_SSE3__ template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4& b) { return float4(_mm_moveldup_ps(b)); } template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4& b) { return float4(_mm_movehdup_ps(b)); } # endif /* __KERNEL_SSE3__ */ #endif /* __KERNEL_SSE__ */ #ifndef __KERNEL_GPU__ ccl_device_inline float4 select(const int4& mask, const float4& a, const float4& b) { #ifdef __KERNEL_SSE__ return float4(_mm_blendv_ps(b.m128, a.m128, _mm_castsi128_ps(mask.m128))); #else return make_float4((mask.x)? a.x: b.x, (mask.y)? a.y: b.y, (mask.z)? a.z: b.z, (mask.w)? a.w: b.w); #endif } ccl_device_inline float4 mask(const int4& mask, const float4& a) { /* Replace elements of x with zero where mask isn't set. */ return select(mask, a, make_float4(0.0f)); } ccl_device_inline float4 reduce_min(const float4& a) { #ifdef __KERNEL_SSE__ float4 h = min(shuffle<1,0,3,2>(a), a); return min(shuffle<2,3,0,1>(h), h); #else return make_float4(min(min(a.x, a.y), min(a.z, a.w))); #endif } ccl_device_inline float4 reduce_max(const float4& a) { #ifdef __KERNEL_SSE__ float4 h = max(shuffle<1,0,3,2>(a), a); return max(shuffle<2,3,0,1>(h), h); #else return make_float4(max(max(a.x, a.y), max(a.z, a.w))); #endif } ccl_device_inline float4 load_float4(const float *v) { #ifdef __KERNEL_SSE__ return float4(_mm_loadu_ps(v)); #else return make_float4(v[0], v[1], v[2], v[3]); #endif } #endif /* !__KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_MATH_FLOAT4_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_int2.h000066400000000000000000000041661334742672700224540ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_INT2_H__ #define __UTIL_MATH_INT2_H__ #ifndef __UTIL_MATH_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN /******************************************************************************* * Declaration. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline bool operator==(const int2 a, const int2 b); ccl_device_inline int2 operator+(const int2 &a, const int2 &b); ccl_device_inline int2 operator+=(int2 &a, const int2 &b); ccl_device_inline int2 operator-(const int2 &a, const int2 &b); ccl_device_inline int2 operator*(const int2 &a, const int2 &b); ccl_device_inline int2 operator/(const int2 &a, const int2 &b); #endif /* !__KERNEL_OPENCL__ */ /******************************************************************************* * Definition. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline bool operator==(const int2 a, const int2 b) { return (a.x == b.x && a.y == b.y); } ccl_device_inline int2 operator+(const int2 &a, const int2 &b) { return make_int2(a.x + b.x, a.y + b.y); } ccl_device_inline int2 operator+=(int2 &a, const int2 &b) { return a = a + b; } ccl_device_inline int2 operator-(const int2 &a, const int2 &b) { return make_int2(a.x - b.x, a.y - b.y); } ccl_device_inline int2 operator*(const int2 &a, const int2 &b) { return make_int2(a.x * b.x, a.y * b.y); } ccl_device_inline int2 operator/(const int2 &a, const int2 &b) { return make_int2(a.x / b.x, a.y / b.y); } #endif /* !__KERNEL_OPENCL__ */ CCL_NAMESPACE_END #endif /* __UTIL_MATH_INT2_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_int3.h000066400000000000000000000044261334742672700224540ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_INT3_H__ #define __UTIL_MATH_INT3_H__ #ifndef __UTIL_MATH_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN /******************************************************************************* * Declaration. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline int3 min(int3 a, int3 b); ccl_device_inline int3 max(int3 a, int3 b); ccl_device_inline int3 clamp(const int3& a, int mn, int mx); ccl_device_inline int3 clamp(const int3& a, int3& mn, int mx); #endif /* !__KERNEL_OPENCL__ */ /******************************************************************************* * Definition. */ #ifndef __KERNEL_OPENCL__ ccl_device_inline int3 min(int3 a, int3 b) { #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__) return int3(_mm_min_epi32(a.m128, b.m128)); #else return make_int3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); #endif } ccl_device_inline int3 max(int3 a, int3 b) { #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__) return int3(_mm_max_epi32(a.m128, b.m128)); #else return make_int3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); #endif } ccl_device_inline int3 clamp(const int3& a, int mn, int mx) { #ifdef __KERNEL_SSE__ return min(max(a, make_int3(mn)), make_int3(mx)); #else return make_int3(clamp(a.x, mn, mx), clamp(a.y, mn, mx), clamp(a.z, mn, mx)); #endif } ccl_device_inline int3 clamp(const int3& a, int3& mn, int mx) { #ifdef __KERNEL_SSE__ return min(max(a, mn), make_int3(mx)); #else return make_int3(clamp(a.x, mn.x, mx), clamp(a.y, mn.y, mx), clamp(a.z, mn.z, mx)); #endif } #endif /* !__KERNEL_OPENCL__ */ CCL_NAMESPACE_END #endif /* __UTIL_MATH_INT3_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_int4.h000066400000000000000000000063651334742672700224610ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_INT4_H__ #define __UTIL_MATH_INT4_H__ #ifndef __UTIL_MATH_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN /******************************************************************************* * Declaration. */ #ifndef __KERNEL_GPU__ ccl_device_inline int4 operator+(const int4& a, const int4& b); ccl_device_inline int4 operator+=(int4& a, const int4& b); ccl_device_inline int4 operator>>(const int4& a, int i); ccl_device_inline int4 min(int4 a, int4 b); ccl_device_inline int4 max(int4 a, int4 b); ccl_device_inline int4 clamp(const int4& a, const int4& mn, const int4& mx); ccl_device_inline int4 select(const int4& mask, const int4& a, const int4& b); #endif /* __KERNEL_GPU__ */ /******************************************************************************* * Definition. */ #ifndef __KERNEL_GPU__ ccl_device_inline int4 operator+(const int4& a, const int4& b) { #ifdef __KERNEL_SSE__ return int4(_mm_add_epi32(a.m128, b.m128)); #else return make_int4(a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w); #endif } ccl_device_inline int4 operator+=(int4& a, const int4& b) { return a = a + b; } ccl_device_inline int4 operator>>(const int4& a, int i) { #ifdef __KERNEL_SSE__ return int4(_mm_srai_epi32(a.m128, i)); #else return make_int4(a.x >> i, a.y >> i, a.z >> i, a.w >> i); #endif } ccl_device_inline int4 min(int4 a, int4 b) { #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__) return int4(_mm_min_epi32(a.m128, b.m128)); #else return make_int4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); #endif } ccl_device_inline int4 max(int4 a, int4 b) { #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__) return int4(_mm_max_epi32(a.m128, b.m128)); #else return make_int4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); #endif } ccl_device_inline int4 clamp(const int4& a, const int4& mn, const int4& mx) { return min(max(a, mn), mx); } ccl_device_inline int4 select(const int4& mask, const int4& a, const int4& b) { #ifdef __KERNEL_SSE__ const __m128 m = _mm_cvtepi32_ps(mask); /* TODO(sergey): avoid cvt. */ return int4(_mm_castps_si128( _mm_or_ps(_mm_and_ps(m, _mm_castsi128_ps(a)), _mm_andnot_ps(m, _mm_castsi128_ps(b))))); #else return make_int4((mask.x)? a.x: b.x, (mask.y)? a.y: b.y, (mask.z)? a.z: b.z, (mask.w)? a.w: b.w); #endif } ccl_device_inline int4 load_int4(const int *v) { #ifdef __KERNEL_SSE__ return int4(_mm_loadu_si128((__m128i*)v)); #else return make_int4(v[0], v[1], v[2], v[3]); #endif } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_MATH_INT4_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_intersect.h000066400000000000000000000140331334742672700235720ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_INTERSECT_H__ #define __UTIL_MATH_INTERSECT_H__ CCL_NAMESPACE_BEGIN /* Ray Intersection */ ccl_device bool ray_sphere_intersect( float3 ray_P, float3 ray_D, float ray_t, float3 sphere_P, float sphere_radius, float3 *isect_P, float *isect_t) { const float3 d = sphere_P - ray_P; const float radiussq = sphere_radius*sphere_radius; const float tsq = dot(d, d); if(tsq > radiussq) { /* Ray origin outside sphere. */ const float tp = dot(d, ray_D); if(tp < 0.0f) { /* Ray points away from sphere. */ return false; } const float dsq = tsq - tp*tp; /* pythagoras */ if(dsq > radiussq) { /* Closest point on ray outside sphere. */ return false; } const float t = tp - sqrtf(radiussq - dsq); /* pythagoras */ if(t < ray_t) { *isect_t = t; *isect_P = ray_P + ray_D*t; return true; } } return false; } ccl_device bool ray_aligned_disk_intersect( float3 ray_P, float3 ray_D, float ray_t, float3 disk_P, float disk_radius, float3 *isect_P, float *isect_t) { /* Aligned disk normal. */ float disk_t; const float3 disk_N = normalize_len(ray_P - disk_P, &disk_t); const float div = dot(ray_D, disk_N); if(UNLIKELY(div == 0.0f)) { return false; } /* Compute t to intersection point. */ const float t = -disk_t/div; if(t < 0.0f || t > ray_t) { return false; } /* Test if within radius. */ float3 P = ray_P + ray_D*t; if(len_squared(P - disk_P) > disk_radius*disk_radius) { return false; } *isect_P = P; *isect_t = t; return true; } ccl_device_forceinline bool ray_triangle_intersect( float3 ray_P, float3 ray_dir, float ray_t, #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const ssef *ssef_verts, #else const float3 tri_a, const float3 tri_b, const float3 tri_c, #endif float *isect_u, float *isect_v, float *isect_t) { #if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) typedef ssef float3; const float3 tri_a(ssef_verts[0]); const float3 tri_b(ssef_verts[1]); const float3 tri_c(ssef_verts[2]); const float3 P(ray_P); const float3 dir(ray_dir); #else # define dot3(a, b) dot(a, b) const float3 P = ray_P; const float3 dir = ray_dir; #endif /* Calculate vertices relative to ray origin. */ const float3 v0 = tri_c - P; const float3 v1 = tri_a - P; const float3 v2 = tri_b - P; /* Calculate triangle edges. */ const float3 e0 = v2 - v0; const float3 e1 = v0 - v1; const float3 e2 = v1 - v2; /* Perform edge tests. */ #if defined(__KERNEL_SSE2__) && defined (__KERNEL_SSE__) const float3 crossU = cross(v2 + v0, e0); const float3 crossV = cross(v0 + v1, e1); const float3 crossW = cross(v1 + v2, e2); ssef crossX(crossU); ssef crossY(crossV); ssef crossZ(crossW); ssef zero = _mm_setzero_ps(); _MM_TRANSPOSE4_PS(crossX, crossY, crossZ, zero); const ssef dirX(ray_dir.x); const ssef dirY(ray_dir.y); const ssef dirZ(ray_dir.z); ssef UVWW = madd(crossX, dirX, madd(crossY, dirY, crossZ * dirZ)); #else /* __KERNEL_SSE2__ */ const float U = dot(cross(v2 + v0, e0), ray_dir); const float V = dot(cross(v0 + v1, e1), ray_dir); const float W = dot(cross(v1 + v2, e2), ray_dir); #endif /* __KERNEL_SSE2__ */ #if defined(__KERNEL_SSE2__) && defined (__KERNEL_SSE__) int uvw_sign = movemask(UVWW) & 0x7; if (uvw_sign != 0) { if (uvw_sign != 0x7) return false; } #else const float minUVW = min(U, min(V, W)); const float maxUVW = max(U, max(V, W)); if(minUVW < 0.0f && maxUVW > 0.0f) { return false; } #endif /* Calculate geometry normal and denominator. */ const float3 Ng1 = cross(e1, e0); //const Vec3vfM Ng1 = stable_triangle_normal(e2,e1,e0); const float3 Ng = Ng1 + Ng1; const float den = dot3(Ng, dir); /* Avoid division by 0. */ if(UNLIKELY(den == 0.0f)) { return false; } /* Perform depth test. */ const float T = dot3(v0, Ng); const int sign_den = (__float_as_int(den) & 0x80000000); const float sign_T = xor_signmask(T, sign_den); if((sign_T < 0.0f) || (sign_T > ray_t * xor_signmask(den, sign_den))) { return false; } const float inv_den = 1.0f / den; #if defined(__KERNEL_SSE2__) && defined (__KERNEL_SSE__) UVWW *= inv_den; _mm_store_ss(isect_u, UVWW); _mm_store_ss(isect_v, shuffle<1,1,3,3>(UVWW)); #else *isect_u = U * inv_den; *isect_v = V * inv_den; #endif *isect_t = T * inv_den; return true; #undef dot3 } ccl_device bool ray_quad_intersect(float3 ray_P, float3 ray_D, float ray_mint, float ray_maxt, float3 quad_P, float3 quad_u, float3 quad_v, float3 quad_n, float3 *isect_P, float *isect_t, float *isect_u, float *isect_v) { /* Perform intersection test. */ float t = -(dot(ray_P, quad_n) - dot(quad_P, quad_n)) / dot(ray_D, quad_n); if(t < ray_mint || t > ray_maxt) { return false; } const float3 hit = ray_P + t*ray_D; const float3 inplane = hit - quad_P; const float u = dot(inplane, quad_u) / dot(quad_u, quad_u) + 0.5f; if(u < 0.0f || u > 1.0f) { return false; } const float v = dot(inplane, quad_v) / dot(quad_v, quad_v) + 0.5f; if(v < 0.0f || v > 1.0f) { return false; } /* Store the result. */ /* TODO(sergey): Check whether we can avoid some checks here. */ if(isect_P != NULL) *isect_P = hit; if(isect_t != NULL) *isect_t = t; if(isect_u != NULL) *isect_u = u; if(isect_v != NULL) *isect_v = v; return true; } CCL_NAMESPACE_END #endif /* __UTIL_MATH_INTERSECT_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_math_matrix.h000066400000000000000000000321261334742672700231010ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_MATH_MATRIX_H__ #define __UTIL_MATH_MATRIX_H__ CCL_NAMESPACE_BEGIN #define MAT(A, size, row, col) A[(row)*(size)+(col)] /* Variants that use a constant stride on GPUS. */ #ifdef __KERNEL_GPU__ # define MATS(A, n, r, c, s) A[((r)*(n)+(c))*(s)] /* Element access when only the lower-triangular elements are stored. */ # define MATHS(A, r, c, s) A[((r)*((r)+1)/2+(c))*(s)] # define VECS(V, i, s) V[(i)*(s)] #else # define MATS(A, n, r, c, s) MAT(A, n, r, c) # define MATHS(A, r, c, s) A[(r)*((r)+1)/2+(c)] # define VECS(V, i, s) V[i] #endif /* Zeroing helpers. */ ccl_device_inline void math_vector_zero(float *v, int n) { for(int i = 0; i < n; i++) { v[i] = 0.0f; } } ccl_device_inline void math_matrix_zero(float *A, int n) { for(int row = 0; row < n; row++) { for(int col = 0; col <= row; col++) { MAT(A, n, row, col) = 0.0f; } } } /* Elementary vector operations. */ ccl_device_inline void math_vector_add(float *a, const float *ccl_restrict b, int n) { for(int i = 0; i < n; i++) { a[i] += b[i]; } } ccl_device_inline void math_vector_mul(float *a, const float *ccl_restrict b, int n) { for(int i = 0; i < n; i++) { a[i] *= b[i]; } } ccl_device_inline void math_vector_mul_strided(ccl_global float *a, const float *ccl_restrict b, int astride, int n) { for(int i = 0; i < n; i++) { a[i*astride] *= b[i]; } } ccl_device_inline void math_vector_scale(float *a, float b, int n) { for(int i = 0; i < n; i++) { a[i] *= b; } } ccl_device_inline void math_vector_max(float *a, const float *ccl_restrict b, int n) { for(int i = 0; i < n; i++) { a[i] = max(a[i], b[i]); } } ccl_device_inline void math_vec3_add(float3 *v, int n, float *x, float3 w) { for(int i = 0; i < n; i++) { v[i] += w*x[i]; } } ccl_device_inline void math_vec3_add_strided(ccl_global float3 *v, int n, float *x, float3 w, int stride) { for(int i = 0; i < n; i++) { ccl_global float *elem = (ccl_global float*) (v + i*stride); atomic_add_and_fetch_float(elem+0, w.x*x[i]); atomic_add_and_fetch_float(elem+1, w.y*x[i]); atomic_add_and_fetch_float(elem+2, w.z*x[i]); } } /* Elementary matrix operations. * Note: TriMatrix refers to a square matrix that is symmetric, and therefore its upper-triangular part isn't stored. */ ccl_device_inline void math_trimatrix_add_diagonal(ccl_global float *A, int n, float val, int stride) { for(int row = 0; row < n; row++) { MATHS(A, row, row, stride) += val; } } /* Add Gramian matrix of v to A. * The Gramian matrix of v is vt*v, so element (i,j) is v[i]*v[j]. */ ccl_device_inline void math_matrix_add_gramian(float *A, int n, const float *ccl_restrict v, float weight) { for(int row = 0; row < n; row++) { for(int col = 0; col <= row; col++) { MAT(A, n, row, col) += v[row]*v[col]*weight; } } } /* Add Gramian matrix of v to A. * The Gramian matrix of v is vt*v, so element (i,j) is v[i]*v[j]. */ ccl_device_inline void math_trimatrix_add_gramian_strided(ccl_global float *A, int n, const float *ccl_restrict v, float weight, int stride) { for(int row = 0; row < n; row++) { for(int col = 0; col <= row; col++) { atomic_add_and_fetch_float(&MATHS(A, row, col, stride), v[row]*v[col]*weight); } } } /* Transpose matrix A inplace. */ ccl_device_inline void math_matrix_transpose(ccl_global float *A, int n, int stride) { for(int i = 0; i < n; i++) { for(int j = 0; j < i; j++) { float temp = MATS(A, n, i, j, stride); MATS(A, n, i, j, stride) = MATS(A, n, j, i, stride); MATS(A, n, j, i, stride) = temp; } } } /* Solvers for matrix problems */ /* In-place Cholesky-Banachiewicz decomposition of the square, positive-definite matrix A * into a lower triangular matrix L so that A = L*L^T. A is being overwritten by L. * Also, only the lower triangular part of A is ever accessed. */ ccl_device void math_trimatrix_cholesky(ccl_global float *A, int n, int stride) { for(int row = 0; row < n; row++) { for(int col = 0; col <= row; col++) { float sum_col = MATHS(A, row, col, stride); for(int k = 0; k < col; k++) { sum_col -= MATHS(A, row, k, stride) * MATHS(A, col, k, stride); } if(row == col) { sum_col = sqrtf(max(sum_col, 0.0f)); } else { sum_col /= MATHS(A, col, col, stride); } MATHS(A, row, col, stride) = sum_col; } } } /* Solve A*S=y for S given A and y, where A is symmetrical positive-semidefinite and both inputs are destroyed in the process. * * We can apply Cholesky decomposition to find a lower triangular L so that L*Lt = A. * With that we get (L*Lt)*S = L*(Lt*S) = L*b = y, defining b as Lt*S. * Since L is lower triangular, finding b is relatively easy since y is known. * Then, the remaining problem is Lt*S = b, which again can be solved easily. * * This is useful for solving the normal equation S=inv(Xt*W*X)*Xt*W*y, since Xt*W*X is * symmetrical positive-semidefinite by construction, so we can just use this function with A=Xt*W*X and y=Xt*W*y. */ ccl_device_inline void math_trimatrix_vec3_solve(ccl_global float *A, ccl_global float3 *y, int n, int stride) { /* Since the first entry of the design row is always 1, the upper-left element of XtWX is a good * heuristic for the amount of pixels considered (with weighting), therefore the amount of correction * is scaled based on it. */ math_trimatrix_add_diagonal(A, n, 3e-7f*A[0], stride); /* Improve the numerical stability. */ math_trimatrix_cholesky(A, n, stride); /* Replace A with L so that L*Lt = A. */ /* Use forward substitution to solve L*b = y, replacing y by b. */ for(int row = 0; row < n; row++) { float3 sum = VECS(y, row, stride); for(int col = 0; col < row; col++) sum -= MATHS(A, row, col, stride) * VECS(y, col, stride); VECS(y, row, stride) = sum / MATHS(A, row, row, stride); } /* Use backward substitution to solve Lt*S = b, replacing b by S. */ for(int row = n-1; row >= 0; row--) { float3 sum = VECS(y, row, stride); for(int col = row+1; col < n; col++) sum -= MATHS(A, col, row, stride) * VECS(y, col, stride); VECS(y, row, stride) = sum / MATHS(A, row, row, stride); } } /* Perform the Jacobi Eigenvalue Methon on matrix A. * A is assumed to be a symmetrical matrix, therefore only the lower-triangular part is ever accessed. * The algorithm overwrites the contents of A. * * After returning, A will be overwritten with D, which is (almost) diagonal, * and V will contain the eigenvectors of the original A in its rows (!), * so that A = V^T*D*V. Therefore, the diagonal elements of D are the (sorted) eigenvalues of A. */ ccl_device void math_matrix_jacobi_eigendecomposition(float *A, ccl_global float *V, int n, int v_stride) { const float singular_epsilon = 1e-9f; for(int row = 0; row < n; row++) { for(int col = 0; col < n; col++) { MATS(V, n, row, col, v_stride) = (col == row) ? 1.0f : 0.0f; } } for(int sweep = 0; sweep < 8; sweep++) { float off_diagonal = 0.0f; for(int row = 1; row < n; row++) { for(int col = 0; col < row; col++) { off_diagonal += fabsf(MAT(A, n, row, col)); } } if(off_diagonal < 1e-7f) { /* The matrix has nearly reached diagonal form. * Since the eigenvalues are only used to determine truncation, their exact values aren't required - a relative error of a few ULPs won't matter at all. */ break; } /* Set the threshold for the small element rotation skip in the first sweep: * Skip all elements that are less than a tenth of the average off-diagonal element. */ float threshold = 0.2f*off_diagonal / (n*n); for(int row = 1; row < n; row++) { for(int col = 0; col < row; col++) { /* Perform a Jacobi rotation on this element that reduces it to zero. */ float element = MAT(A, n, row, col); float abs_element = fabsf(element); /* If we're in a later sweep and the element already is very small, just set it to zero and skip the rotation. */ if(sweep > 3 && abs_element <= singular_epsilon*fabsf(MAT(A, n, row, row)) && abs_element <= singular_epsilon*fabsf(MAT(A, n, col, col))) { MAT(A, n, row, col) = 0.0f; continue; } if(element == 0.0f) { continue; } /* If we're in one of the first sweeps and the element is smaller than the threshold, skip it. */ if(sweep < 3 && (abs_element < threshold)) { continue; } /* Determine rotation: The rotation is characterized by its angle phi - or, in the actual implementation, sin(phi) and cos(phi). * To find those, we first compute their ratio - that might be unstable if the angle approaches 90°, so there's a fallback for that case. * Then, we compute sin(phi) and cos(phi) themselves. */ float singular_diff = MAT(A, n, row, row) - MAT(A, n, col, col); float ratio; if(abs_element > singular_epsilon*fabsf(singular_diff)) { float cot_2phi = 0.5f*singular_diff / element; ratio = 1.0f / (fabsf(cot_2phi) + sqrtf(1.0f + cot_2phi*cot_2phi)); if(cot_2phi < 0.0f) ratio = -ratio; /* Copy sign. */ } else { ratio = element / singular_diff; } float c = 1.0f / sqrtf(1.0f + ratio*ratio); float s = ratio*c; /* To improve numerical stability by avoiding cancellation, the update equations are reformulized to use sin(phi) and tan(phi/2) instead. */ float tan_phi_2 = s / (1.0f + c); /* Update the singular values in the diagonal. */ float singular_delta = ratio*element; MAT(A, n, row, row) += singular_delta; MAT(A, n, col, col) -= singular_delta; /* Set the element itself to zero. */ MAT(A, n, row, col) = 0.0f; /* Perform the actual rotations on the matrices. */ #define ROT(M, r1, c1, r2, c2, stride) \ { \ float M1 = MATS(M, n, r1, c1, stride); \ float M2 = MATS(M, n, r2, c2, stride); \ MATS(M, n, r1, c1, stride) -= s*(M2 + tan_phi_2*M1); \ MATS(M, n, r2, c2, stride) += s*(M1 - tan_phi_2*M2); \ } /* Split into three parts to ensure correct accesses since we only store the lower-triangular part of A. */ for(int i = 0 ; i < col; i++) ROT(A, col, i, row, i, 1); for(int i = col+1; i < row; i++) ROT(A, i, col, row, i, 1); for(int i = row+1; i < n ; i++) ROT(A, i, col, i, row, 1); for(int i = 0 ; i < n ; i++) ROT(V, col, i, row, i, v_stride); #undef ROT } } } /* Sort eigenvalues and the associated eigenvectors. */ for(int i = 0; i < n - 1; i++) { float v = MAT(A, n, i, i); int k = i; for(int j = i; j < n; j++) { if(MAT(A, n, j, j) >= v) { v = MAT(A, n, j, j); k = j; } } if(k != i) { /* Swap eigenvalues. */ MAT(A, n, k, k) = MAT(A, n, i, i); MAT(A, n, i, i) = v; /* Swap eigenvectors. */ for(int j = 0; j < n; j++) { float v = MATS(V, n, i, j, v_stride); MATS(V, n, i, j, v_stride) = MATS(V, n, k, j, v_stride); MATS(V, n, k, j, v_stride) = v; } } } } #ifdef __KERNEL_SSE3__ ccl_device_inline void math_vector_zero_sse(float4 *A, int n) { for(int i = 0; i < n; i++) { A[i] = make_float4(0.0f); } } ccl_device_inline void math_matrix_zero_sse(float4 *A, int n) { for(int row = 0; row < n; row++) { for(int col = 0; col <= row; col++) { MAT(A, n, row, col) = make_float4(0.0f); } } } /* Add Gramian matrix of v to A. * The Gramian matrix of v is v^T*v, so element (i,j) is v[i]*v[j]. */ ccl_device_inline void math_matrix_add_gramian_sse(float4 *A, int n, const float4 *ccl_restrict v, float4 weight) { for(int row = 0; row < n; row++) { for(int col = 0; col <= row; col++) { MAT(A, n, row, col) = MAT(A, n, row, col) + v[row] * v[col] * weight; } } } ccl_device_inline void math_vector_add_sse(float4 *V, int n, const float4 *ccl_restrict a) { for(int i = 0; i < n; i++) { V[i] += a[i]; } } ccl_device_inline void math_vector_mul_sse(float4 *V, int n, const float4 *ccl_restrict a) { for(int i = 0; i < n; i++) { V[i] *= a[i]; } } ccl_device_inline void math_vector_max_sse(float4 *a, const float4 *ccl_restrict b, int n) { for(int i = 0; i < n; i++) { a[i] = max(a[i], b[i]); } } ccl_device_inline void math_matrix_hsum(float *A, int n, const float4 *ccl_restrict B) { for(int row = 0; row < n; row++) { for(int col = 0; col <= row; col++) { MAT(A, n, row, col) = reduce_add(MAT(B, n, row, col))[0]; } } } #endif #undef MAT CCL_NAMESPACE_END #endif /* __UTIL_MATH_MATRIX_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_md5.cpp000066400000000000000000000253121334742672700216030ustar00rootroot00000000000000/* * Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * * L. Peter Deutsch * ghost@aladdin.com */ /* Minor modifications done to remove some code and change style. */ #include "util_md5.h" #include "util_path.h" #include #include CCL_NAMESPACE_BEGIN #define T_MASK ((uint32_t)~0) #define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87) #define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9) #define T3 0x242070db #define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111) #define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050) #define T6 0x4787c62a #define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec) #define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe) #define T9 0x698098d8 #define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850) #define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e) #define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841) #define T13 0x6b901122 #define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c) #define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71) #define T16 0x49b40821 #define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d) #define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf) #define T19 0x265e5a51 #define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855) #define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2) #define T22 0x02441453 #define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e) #define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437) #define T25 0x21e1cde6 #define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829) #define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278) #define T28 0x455a14ed #define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa) #define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07) #define T31 0x676f02d9 #define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375) #define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd) #define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e) #define T35 0x6d9d6122 #define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3) #define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb) #define T38 0x4bdecfa9 #define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f) #define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f) #define T41 0x289b7ec6 #define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805) #define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a) #define T44 0x04881d05 #define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6) #define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a) #define T47 0x1fa27cf8 #define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a) #define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb) #define T50 0x432aff97 #define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58) #define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6) #define T53 0x655b59c3 #define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d) #define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82) #define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e) #define T57 0x6fa87e4f #define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f) #define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb) #define T60 0x4e0811a1 #define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d) #define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca) #define T63 0x2ad7d2bb #define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e) void MD5Hash::process(const uint8_t *data /*[64]*/) { uint32_t a = abcd[0], b = abcd[1], c = abcd[2], d = abcd[3]; uint32_t t; /* Define storage for little-endian or both types of CPUs. */ uint32_t xbuf[16]; const uint32_t *X; { /* * Determine dynamically whether this is a big-endian or * little-endian machine, since we can use a more efficient * algorithm on the latter. */ static const int w = 1; if(*((const uint8_t *)&w)) /* dynamic little-endian */ { /* * On little-endian machines, we can process properly aligned * data without copying it. */ if(!((data - (const uint8_t *)0) & 3)) { /* data are properly aligned */ X = (const uint32_t *)data; } else { /* not aligned */ memcpy(xbuf, data, 64); X = xbuf; } } else { /* dynamic big-endian */ /* * On big-endian machines, we must arrange the bytes in the * right order. */ const uint8_t *xp = data; int i; X = xbuf; /* (dynamic only) */ for(i = 0; i < 16; ++i, xp += 4) xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); } } #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) /* Round 1. */ /* Let [abcd k s i] denote the operation * a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ #define F(x, y, z) (((x) & (y)) | (~(x) & (z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + F(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 7, T1); SET(d, a, b, c, 1, 12, T2); SET(c, d, a, b, 2, 17, T3); SET(b, c, d, a, 3, 22, T4); SET(a, b, c, d, 4, 7, T5); SET(d, a, b, c, 5, 12, T6); SET(c, d, a, b, 6, 17, T7); SET(b, c, d, a, 7, 22, T8); SET(a, b, c, d, 8, 7, T9); SET(d, a, b, c, 9, 12, T10); SET(c, d, a, b, 10, 17, T11); SET(b, c, d, a, 11, 22, T12); SET(a, b, c, d, 12, 7, T13); SET(d, a, b, c, 13, 12, T14); SET(c, d, a, b, 14, 17, T15); SET(b, c, d, a, 15, 22, T16); #undef SET /* Round 2. */ /* Let [abcd k s i] denote the operation * a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ #define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + G(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 1, 5, T17); SET(d, a, b, c, 6, 9, T18); SET(c, d, a, b, 11, 14, T19); SET(b, c, d, a, 0, 20, T20); SET(a, b, c, d, 5, 5, T21); SET(d, a, b, c, 10, 9, T22); SET(c, d, a, b, 15, 14, T23); SET(b, c, d, a, 4, 20, T24); SET(a, b, c, d, 9, 5, T25); SET(d, a, b, c, 14, 9, T26); SET(c, d, a, b, 3, 14, T27); SET(b, c, d, a, 8, 20, T28); SET(a, b, c, d, 13, 5, T29); SET(d, a, b, c, 2, 9, T30); SET(c, d, a, b, 7, 14, T31); SET(b, c, d, a, 12, 20, T32); #undef SET /* Round 3. */ /* Let [abcd k s t] denote the operation * a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ #define H(x, y, z) ((x) ^ (y) ^ (z)) #define SET(a, b, c, d, k, s, Ti)\ t = a + H(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 5, 4, T33); SET(d, a, b, c, 8, 11, T34); SET(c, d, a, b, 11, 16, T35); SET(b, c, d, a, 14, 23, T36); SET(a, b, c, d, 1, 4, T37); SET(d, a, b, c, 4, 11, T38); SET(c, d, a, b, 7, 16, T39); SET(b, c, d, a, 10, 23, T40); SET(a, b, c, d, 13, 4, T41); SET(d, a, b, c, 0, 11, T42); SET(c, d, a, b, 3, 16, T43); SET(b, c, d, a, 6, 23, T44); SET(a, b, c, d, 9, 4, T45); SET(d, a, b, c, 12, 11, T46); SET(c, d, a, b, 15, 16, T47); SET(b, c, d, a, 2, 23, T48); #undef SET /* Round 4. */ /* Let [abcd k s t] denote the operation * a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ #define I(x, y, z) ((y) ^ ((x) | ~(z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + I(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 6, T49); SET(d, a, b, c, 7, 10, T50); SET(c, d, a, b, 14, 15, T51); SET(b, c, d, a, 5, 21, T52); SET(a, b, c, d, 12, 6, T53); SET(d, a, b, c, 3, 10, T54); SET(c, d, a, b, 10, 15, T55); SET(b, c, d, a, 1, 21, T56); SET(a, b, c, d, 8, 6, T57); SET(d, a, b, c, 15, 10, T58); SET(c, d, a, b, 6, 15, T59); SET(b, c, d, a, 13, 21, T60); SET(a, b, c, d, 4, 6, T61); SET(d, a, b, c, 11, 10, T62); SET(c, d, a, b, 2, 15, T63); SET(b, c, d, a, 9, 21, T64); #undef SET /* Then perform the following additions. (That is increment each * of the four registers by the value it had before this block * was started.) */ abcd[0] += a; abcd[1] += b; abcd[2] += c; abcd[3] += d; } MD5Hash::MD5Hash() { count[0] = count[1] = 0; abcd[0] = 0x67452301; abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; abcd[3] = 0x10325476; } MD5Hash::~MD5Hash() { } void MD5Hash::append(const uint8_t *data, int nbytes) { const uint8_t *p = data; int left = nbytes; int offset = (count[0] >> 3) & 63; uint32_t nbits = (uint32_t)(nbytes << 3); if(nbytes <= 0) return; /* Update the message length. */ count[1] += nbytes >> 29; count[0] += nbits; if(count[0] < nbits) count[1]++; /* Process an initial partial block. */ if(offset) { int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); memcpy(buf + offset, p, copy); if(offset + copy < 64) return; p += copy; left -= copy; process(buf); } /* Process full blocks. */ for(; left >= 64; p += 64, left -= 64) process(p); /* Process a final partial block. */ if(left) memcpy(buf, p, left); } void MD5Hash::append(const string& str) { if(str.size()) { append((const uint8_t*)str.c_str(), str.size()); } } bool MD5Hash::append_file(const string& filepath) { FILE *f = path_fopen(filepath, "rb"); if(!f) { fprintf(stderr, "MD5: failed to open file %s\n", filepath.c_str()); return false; } const size_t buffer_size = 1024; uint8_t buffer[buffer_size]; size_t n; do { n = fread(buffer, 1, buffer_size, f); append(buffer, n); } while(n == buffer_size); bool success = (ferror(f) == 0); fclose(f); return success; } void MD5Hash::finish(uint8_t digest[16]) { static const uint8_t pad[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; uint8_t data[8]; int i; /* Save the length before padding. */ for(i = 0; i < 8; ++i) data[i] = (uint8_t)(count[i >> 2] >> ((i & 3) << 3)); /* Pad to 56 bytes mod 64. */ append(pad, ((55 - (count[0] >> 3)) & 63) + 1); /* Append the length. */ append(data, 8); for(i = 0; i < 16; ++i) digest[i] = (uint8_t)(abcd[i >> 2] >> ((i & 3) << 3)); } string MD5Hash::get_hex() { uint8_t digest[16]; char buf[16*2+1]; finish(digest); for(int i = 0; i < 16; i++) sprintf(buf + i*2, "%02X", (unsigned int)digest[i]); buf[sizeof(buf)-1] = '\0'; return string(buf); } string util_md5_string(const string& str) { MD5Hash md5; md5.append((uint8_t*)str.c_str(), str.size()); return md5.get_hex(); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_md5.h000066400000000000000000000034221334742672700212460ustar00rootroot00000000000000/* * Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * * L. Peter Deutsch * ghost@aladdin.com */ /* MD5 * * Simply MD5 hash computation, used by disk cache. Adapted from external * code, with minor code modifications done to remove some unused code and * change code style. */ #ifndef __UTIL_MD5_H__ #define __UTIL_MD5_H__ #include "util/util_string.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN class MD5Hash { public: MD5Hash(); ~MD5Hash(); void append(const uint8_t *data, int size); void append(const string& str); bool append_file(const string& filepath); string get_hex(); protected: void process(const uint8_t *data); void finish(uint8_t digest[16]); uint32_t count[2]; /* message length in bits, lsw first */ uint32_t abcd[4]; /* digest buffer */ uint8_t buf[64]; /* accumulate block */ }; string util_md5_string(const string& str); CCL_NAMESPACE_END #endif /* __UTIL_MD5_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_opengl.h000066400000000000000000000017061334742672700220500ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_OPENGL_H__ #define __UTIL_OPENGL_H__ /* OpenGL header includes, used everywhere we use OpenGL, to deal with * platform differences in one central place. */ #ifdef WITH_GLEW_MX # include "glew-mx.h" #else # include # define mxCreateContext() glewInit() # define mxMakeCurrentContext(x) (x) #endif #endif /* __UTIL_OPENGL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_optimization.h000066400000000000000000000034071334742672700233120ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_OPTIMIZATION_H__ #define __UTIL_OPTIMIZATION_H__ #ifndef __KERNEL_GPU__ /* x86 * * Compile a regular, SSE2 and SSE3 kernel. */ #if defined(i386) || defined(_M_IX86) /* We require minimum SSE2 support on x86, so auto enable. */ # define __KERNEL_SSE2__ # ifdef WITH_KERNEL_SSE2 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # endif # ifdef WITH_KERNEL_SSE3 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # endif #endif /* defined(i386) || defined(_M_IX86) */ /* x86-64 * * Compile a regular (includes SSE2), SSE3, SSE 4.1, AVX and AVX2 kernel. */ #if defined(__x86_64__) || defined(_M_X64) /* SSE2 is always available on x86-64 CPUs, so auto enable */ # define __KERNEL_SSE2__ /* no SSE2 kernel on x86-64, part of regular kernel */ # ifdef WITH_KERNEL_SSE3 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # endif # ifdef WITH_KERNEL_SSE41 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # endif # ifdef WITH_KERNEL_AVX # define WITH_CYCLES_OPTIMIZED_KERNEL_AVX # endif # ifdef WITH_KERNEL_AVX2 # define WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # endif #endif /* defined(__x86_64__) || defined(_M_X64) */ #endif #endif /* __UTIL_OPTIMIZATION_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_param.cpp000066400000000000000000000017251334742672700222200ustar00rootroot00000000000000/* * Copyright 2011-2018 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef WITHOUT_OPENIMAGEIO #include "util_param.h" CCL_NAMESPACE_BEGIN const TypeDesc TypeDesc::TypeColor("color"); const TypeDesc TypeDesc::TypeFloat("float"); const TypeDesc TypeDesc::TypePoint("point"); const TypeDesc TypeDesc::TypeNormal("normal"); const TypeDesc TypeDesc::TypeVector("vector"); const TypeDesc TypeDesc::TypeMatrix("matrix"); CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_param.h000066400000000000000000000033151334742672700216620ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_PARAM_H__ #define __UTIL_PARAM_H__ /* Parameter value lists from OpenImageIO are used to store custom properties * on various data, which can then later be used in shaders. */ #ifndef WITHOUT_OPENIMAGEIO #include #include CCL_NAMESPACE_BEGIN OIIO_NAMESPACE_USING CCL_NAMESPACE_END #else // WITHOUT_OPENIMAGEIO #include CCL_NAMESPACE_BEGIN class ParamValue { public: }; class TypeDesc : public std::string { public: enum BASETYPE { UNKNOWN, NONE, UCHAR, UINT8=UCHAR, CHAR, INT8=CHAR, USHORT, UINT16=USHORT, SHORT, INT16=SHORT, UINT, UINT32=UINT, INT, INT32=INT, ULONGLONG, UINT64=ULONGLONG, LONGLONG, INT64=LONGLONG, HALF, FLOAT, DOUBLE, STRING, PTR, LASTBASE }; TypeDesc() {} TypeDesc(std::string name) : std::string(name) { } static const TypeDesc TypeColor; static const TypeDesc TypeFloat; static const TypeDesc TypePoint; static const TypeDesc TypeNormal; static const TypeDesc TypeVector; static const TypeDesc TypeMatrix; }; CCL_NAMESPACE_END #endif // WITHOUT_OPENIMAGEIO #endif /* __UTIL_PARAM_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_path.cpp000066400000000000000000000562411334742672700220570ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_md5.h" #include "util/util_path.h" #include "util/util_string.h" #include #include #if defined(_WIN32) # define DIR_SEP '\\' # define DIR_SEP_ALT '/' # include #else # define DIR_SEP '/' # include # include # include # include #endif #ifdef HAVE_SHLWAPI_H # include #endif #include "util/util_map.h" #include "util/util_windows.h" CCL_NAMESPACE_BEGIN // Copied from OpenImageIO. static string this_program_path() { char filename[10240]; filename[0] = 0; #if defined(__linux__) unsigned int size = sizeof(filename); int r = readlink ("/proc/self/exe", filename, size); assert(r < int(size)); // user won't get the right answer if the filename is too long to store if (r > 0) filename[r] = 0; // readlink does not fill in the 0 byte #elif defined(__APPLE__) // For info: 'man 3 dyld' // For the moment I just disable on OSX! [Guillaume] /* unsigned int size = sizeof(filename); int r = _NSGetExecutablePath (filename, &size); if (r == 0) r = size; */ int r = 0; #elif defined(_WIN32) // According to MSDN... unsigned int size = sizeof(filename); int r = GetModuleFileName (NULL, filename, size); #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int mib[4]; mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PATHNAME; mib[3] = -1; size_t cb = sizeof(filename); int r=1; sysctl(mib, 4, filename, &cb, NULL, 0); #elif defined(__GNU__) || defined(__OpenBSD__) int r = 0; #else // No idea what platform this is static_assert(0, "this_program_path() unimplemented on this platform"); #endif if (r > 0) return std::string (filename); return std::string(); // Couldn't figure it out } #ifdef _WIN32 # if defined(_MSC_VER) || defined(__MINGW64__) typedef struct _stat64 path_stat_t; # elif defined(__MINGW32__) typedef struct _stati64 path_stat_t; # else typedef struct _stat path_stat_t; # endif # ifndef S_ISDIR # define S_ISDIR(x) (((x) & _S_IFDIR) == _S_IFDIR) # endif #else typedef struct stat path_stat_t; #endif static string cached_path = ""; static string cached_user_path = ""; static string cached_xdg_cache_path = ""; namespace { #ifdef _WIN32 class directory_iterator { public: class path_info { public: path_info(const string& path, const WIN32_FIND_DATAW& find_data) : path_(path), find_data_(find_data) { } string path() { return path_join(path_, string_from_wstring(find_data_.cFileName)); } protected: const string& path_; const WIN32_FIND_DATAW& find_data_; }; directory_iterator() : path_info_("", find_data_), h_find_(INVALID_HANDLE_VALUE) { } explicit directory_iterator(const string& path) : path_(path), path_info_(path, find_data_) { string wildcard = path; if(wildcard[wildcard.size() - 1] != DIR_SEP) { wildcard += DIR_SEP; } wildcard += "*"; h_find_ = FindFirstFileW(string_to_wstring(wildcard).c_str(), &find_data_); if(h_find_ != INVALID_HANDLE_VALUE) { skip_dots(); } } ~directory_iterator() { if(h_find_ != INVALID_HANDLE_VALUE) { FindClose(h_find_); } } directory_iterator& operator++() { step(); return *this; } path_info* operator-> () { return &path_info_; } bool operator!=(const directory_iterator& other) { return h_find_ != other.h_find_; } protected: bool step() { if(do_step()) { return skip_dots(); } return false; } bool do_step() { if(h_find_ != INVALID_HANDLE_VALUE) { bool result = FindNextFileW(h_find_, &find_data_) == TRUE; if(!result) { FindClose(h_find_); h_find_ = INVALID_HANDLE_VALUE; } return result; } return false; } bool skip_dots() { while(wcscmp(find_data_.cFileName, L".") == 0 || wcscmp(find_data_.cFileName, L"..") == 0) { if(!do_step()) { return false; } } return true; } string path_; path_info path_info_; WIN32_FIND_DATAW find_data_; HANDLE h_find_; }; #else /* _WIN32 */ class directory_iterator { public: class path_info { public: explicit path_info(const string& path) : path_(path), entry_(NULL) { } string path() { return path_join(path_, entry_->d_name); } void current_entry_set(const struct dirent *entry) { entry_ = entry; } protected: const string& path_; const struct dirent *entry_; }; directory_iterator() : path_info_(""), name_list_(NULL), num_entries_(-1), cur_entry_(-1) { } explicit directory_iterator(const string& path) : path_(path), path_info_(path_), cur_entry_(0) { num_entries_ = scandir(path.c_str(), &name_list_, NULL, alphasort); if(num_entries_ < 0) { perror("scandir"); } else { skip_dots(); } } ~directory_iterator() { destroy_name_list(); } directory_iterator& operator++() { step(); return *this; } path_info* operator-> () { path_info_.current_entry_set(name_list_[cur_entry_]); return &path_info_; } bool operator!=(const directory_iterator& other) { return name_list_ != other.name_list_; } protected: bool step() { if(do_step()) { return skip_dots(); } return false; } bool do_step() { ++cur_entry_; if(cur_entry_ >= num_entries_) { destroy_name_list(); return false; } return true; } /* Skip . and .. folders. */ bool skip_dots() { while(strcmp(name_list_[cur_entry_]->d_name, ".") == 0 || strcmp(name_list_[cur_entry_]->d_name, "..") == 0) { if(!step()) { return false; } } return true; } void destroy_name_list() { if(name_list_ == NULL) { return; } for(int i = 0; i < num_entries_; ++i) { free(name_list_[i]); } free(name_list_); name_list_ = NULL; } string path_; path_info path_info_; struct dirent **name_list_; int num_entries_, cur_entry_; }; #endif /* _WIN32 */ size_t find_last_slash(const string& path) { for(size_t i = 0; i < path.size(); ++i) { size_t index = path.size() - 1 - i; #ifdef _WIN32 if(path[index] == DIR_SEP || path[index] == DIR_SEP_ALT) #else if(path[index] == DIR_SEP) #endif { return index; } } return string::npos; } } /* namespace */ static char *path_specials(const string& sub) { static bool env_init = false; static char *env_shader_path; static char *env_source_path; if(!env_init) { env_shader_path = getenv("CYCLES_SHADER_PATH"); /* NOTE: It is KERNEL in env variable for compatibility reasons. */ env_source_path = getenv("CYCLES_KERNEL_PATH"); env_init = true; } if(env_shader_path != NULL && sub == "shader") { return env_shader_path; } else if(env_shader_path != NULL && sub == "source") { return env_source_path; } return NULL; } #if defined(__linux__) || defined(__APPLE__) static string path_xdg_cache_get() { const char *home = getenv("XDG_CACHE_HOME"); if(home) { return string(home); } else { home = getenv("HOME"); if(home == NULL) { home = getpwuid(getuid())->pw_dir; } return path_join(string(home), ".cache"); } } #endif void path_init(const string& path, const string& user_path) { cached_path = path; cached_user_path = user_path; #ifdef _MSC_VER // workaround for https://svn.boost.org/trac/boost/ticket/6320 // indirectly init boost codec here since it's not thread safe, and can // cause crashes when it happens in multithreaded image load OIIO::Filesystem::exists(path); #endif } string path_get(const string& sub) { char *special = path_specials(sub); if(special != NULL) return special; if(cached_path == "") cached_path = path_dirname(this_program_path()); return path_join(cached_path, sub); } string path_user_get(const string& sub) { if(cached_user_path == "") cached_user_path = path_dirname(this_program_path()); return path_join(cached_user_path, sub); } string path_cache_get(const string& sub) { #if defined(__linux__) || defined(__APPLE__) if(cached_xdg_cache_path == "") { cached_xdg_cache_path = path_xdg_cache_get(); } string result = path_join(cached_xdg_cache_path, "cycles"); return path_join(result, sub); #else /* TODO(sergey): What that should be on Windows? */ return path_user_get(path_join("cache", sub)); #endif } #if defined(__linux__) || defined(__APPLE__) string path_xdg_home_get(const string& sub = ""); #endif string path_filename(const string& path) { size_t index = find_last_slash(path); if(index != string::npos) { /* Corner cases to match boost behavior. */ #ifndef _WIN32 if(index == 0 && path.size() == 1) { return path; } #endif if(index == path.size() - 1) { #ifdef _WIN32 if(index == 2) { return string(1, DIR_SEP); } #endif return "."; } return path.substr(index + 1, path.size() - index - 1); } return path; } string path_dirname(const string& path) { size_t index = find_last_slash(path); if(index != string::npos) { #ifndef _WIN32 if(index == 0 && path.size() > 1) { return string(1, DIR_SEP); } #endif return path.substr(0, index); } return ""; } string path_join(const string& dir, const string& file) { if(dir.size() == 0) { return file; } if(file.size() == 0) { return dir; } string result = dir; #ifndef _WIN32 if(result[result.size() - 1] != DIR_SEP && file[0] != DIR_SEP) #else if(result[result.size() - 1] != DIR_SEP && result[result.size() - 1] != DIR_SEP_ALT && file[0] != DIR_SEP && file[0] != DIR_SEP_ALT) #endif { result += DIR_SEP; } result += file; return result; } string path_escape(const string& path) { string result = path; string_replace(result, " ", "\\ "); return result; } bool path_is_relative(const string& path) { #ifdef _WIN32 # ifdef HAVE_SHLWAPI_H return PathIsRelative(path.c_str()); # else /* HAVE_SHLWAPI_H */ if(path.size() >= 3) { return !(((path[0] >= 'a' && path[0] <= 'z') || (path[0] >= 'A' && path[0] <= 'Z')) && path[1] == ':' && path[2] == DIR_SEP); } return true; # endif /* HAVE_SHLWAPI_H */ #else /* _WIN32 */ if(path.size() == 0) { return 1; } return path[0] != DIR_SEP; #endif /* _WIN32 */ } #ifdef _WIN32 /* Add a slash if the UNC path points to a share. */ static string path_unc_add_slash_to_share(const string& path) { size_t slash_after_server = path.find(DIR_SEP, 2); if(slash_after_server != string::npos) { size_t slash_after_share = path.find(DIR_SEP, slash_after_server + 1); if(slash_after_share == string::npos) { return path + DIR_SEP; } } return path; } /* Convert: * \\?\UNC\server\share\folder\... to \\server\share\folder\... * \\?\C:\ to C:\ and \\?\C:\folder\... to C:\folder\... */ static string path_unc_to_short(const string& path) { size_t len = path.size(); if((len > 3) && (path[0] == DIR_SEP) && (path[1] == DIR_SEP) && (path[2] == '?') && ((path[3] == DIR_SEP) || (path[3] == DIR_SEP_ALT))) { if((len > 5) && (path[5] == ':')) { return path.substr(4, len - 4); } else if((len > 7) && (path.substr(4, 3) == "UNC") && ((path[7] == DIR_SEP) || (path[7] == DIR_SEP_ALT))) { return "\\\\" + path.substr(8, len - 8); } } return path; } static string path_cleanup_unc(const string& path) { string result = path_unc_to_short(path); if(path.size() > 2) { /* It's possible path is now a non-UNC. */ if(result[0] == DIR_SEP && result[1] == DIR_SEP) { return path_unc_add_slash_to_share(result); } } return result; } /* Make path compatible for stat() functions. */ static string path_make_compatible(const string& path) { string result = path; /* In Windows stat() doesn't recognize dir ending on a slash. */ if(result.size() > 3 && result[result.size() - 1] == DIR_SEP) { result.resize(result.size() - 1); } /* Clean up UNC path. */ if((path.size() >= 3) && (path[0] == DIR_SEP) && (path[1] == DIR_SEP)) { result = path_cleanup_unc(result); } /* Make sure volume-only path ends up wit ha directory separator. */ if(result.size() == 2 && result[1] == ':') { result += DIR_SEP; } return result; } static int path_wstat(const wstring& path_wc, path_stat_t *st) { #if defined(_MSC_VER) || defined(__MINGW64__) return _wstat64(path_wc.c_str(), st); #elif defined(__MINGW32__) return _wstati64(path_wc.c_str(), st); #else return _wstat(path_wc.c_str(), st); #endif } static int path_stat(const string& path, path_stat_t *st) { wstring path_wc = string_to_wstring(path); return path_wstat(path_wc, st); } #else /* _WIN32 */ static int path_stat(const string& path, path_stat_t *st) { return stat(path.c_str(), st); } #endif /* _WIN32 */ size_t path_file_size(const string& path) { path_stat_t st; if(path_stat(path, &st) != 0) { return -1; } return st.st_size; } bool path_exists(const string& path) { #ifdef _WIN32 string fixed_path = path_make_compatible(path); wstring path_wc = string_to_wstring(fixed_path); path_stat_t st; if(path_wstat(path_wc, &st) != 0) { return false; } return st.st_mode != 0; #else /* _WIN32 */ struct stat st; if(stat(path.c_str(), &st) != 0) { return 0; } return st.st_mode != 0; #endif /* _WIN32 */ } bool path_is_directory(const string& path) { path_stat_t st; if(path_stat(path, &st) != 0) { return false; } return S_ISDIR(st.st_mode); } static void path_files_md5_hash_recursive(MD5Hash& hash, const string& dir) { if(path_exists(dir)) { directory_iterator it(dir), it_end; for(; it != it_end; ++it) { if(path_is_directory(it->path())) { path_files_md5_hash_recursive(hash, it->path()); } else { string filepath = it->path(); hash.append((const uint8_t*)filepath.c_str(), filepath.size()); hash.append_file(filepath); } } } } string path_files_md5_hash(const string& dir) { /* computes md5 hash of all files in the directory */ MD5Hash hash; path_files_md5_hash_recursive(hash, dir); return hash.get_hex(); } static bool create_directories_recursivey(const string& path) { if(path_is_directory(path)) { /* Directory already exists, nothing to do. */ return true; } if(path_exists(path)) { /* File exists and it's not a directory. */ return false; } string parent = path_dirname(path); if(parent.size() > 0 && parent != path) { if(!create_directories_recursivey(parent)) { return false; } } #ifdef _WIN32 wstring path_wc = string_to_wstring(path); return _wmkdir(path_wc.c_str()) == 0; #else return mkdir(path.c_str(), 0777) == 0; #endif } void path_create_directories(const string& filepath) { string path = path_dirname(filepath); create_directories_recursivey(path); } bool path_write_binary(const string& path, const vector& binary) { path_create_directories(path); /* write binary file from memory */ FILE *f = path_fopen(path, "wb"); if(!f) return false; if(binary.size() > 0) fwrite(&binary[0], sizeof(uint8_t), binary.size(), f); fclose(f); return true; } bool path_write_text(const string& path, string& text) { vector binary(text.length(), 0); std::copy(text.begin(), text.end(), binary.begin()); return path_write_binary(path, binary); } bool path_read_binary(const string& path, vector& binary) { /* read binary file into memory */ FILE *f = path_fopen(path, "rb"); if(!f) { binary.resize(0); return false; } binary.resize(path_file_size(path)); if(binary.size() == 0) { fclose(f); return false; } if(fread(&binary[0], sizeof(uint8_t), binary.size(), f) != binary.size()) { fclose(f); return false; } fclose(f); return true; } bool path_read_text(const string& path, string& text) { vector binary; if(!path_exists(path) || !path_read_binary(path, binary)) return false; const char *str = (const char*)&binary[0]; size_t size = binary.size(); text = string(str, size); return true; } uint64_t path_modified_time(const string& path) { path_stat_t st; if(path_stat(path, &st) != 0) { return 0; } return st.st_mtime; } bool path_remove(const string& path) { return remove(path.c_str()) == 0; } struct SourceReplaceState { typedef map ProcessedMapping; /* Base director for all relative include headers. */ string base; /* Result of processed files. */ ProcessedMapping processed_files; /* Set of files which are considered "precompiled" and which are replaced * with and empty string on a subsequent occurrence in include statement. */ set precompiled_headers; }; static string path_source_replace_includes_recursive( const string& source, const string& source_filepath, SourceReplaceState *state); static string line_directive(const SourceReplaceState& state, const string& path, const int line) { string unescaped_path = path; /* First we make path relative. */ if(string_startswith(unescaped_path, state.base.c_str())) { const string base_file = path_filename(state.base); const size_t base_len = state.base.length(); unescaped_path = base_file + unescaped_path.substr(base_len, unescaped_path.length() - base_len); } /* Second, we replace all unsafe characters. */ const size_t length = unescaped_path.length(); string escaped_path = ""; for(size_t i = 0; i < length; ++i) { const char ch = unescaped_path[i]; if(strchr("\"\'\?\\", ch) != NULL) { escaped_path += "\\"; } escaped_path += ch; } /* TODO(sergey): Check whether using std::to_string combined with several * concatenation operations is any faster. */ return string_printf("#line %d \"%s\"", line, escaped_path.c_str()); } static string path_source_handle_preprocessor( const string& preprocessor_line, const string& source_filepath, const size_t line_number, SourceReplaceState *state) { string result = preprocessor_line; string token = string_strip( preprocessor_line.substr(1, preprocessor_line.size() - 1)); if(string_startswith(token, "include")) { token = string_strip(token.substr(7, token.size() - 7)); if(token[0] == '"') { const size_t n_start = 1; const size_t n_end = token.find("\"", n_start); const string filename = token.substr(n_start, n_end - n_start); const bool is_precompiled = string_endswith(token, "// PRECOMPILED"); string filepath = path_join(state->base, filename); if(!path_exists(filepath)) { filepath = path_join(path_dirname(source_filepath), filename); } if(is_precompiled) { state->precompiled_headers.insert(filepath); } string text; if(path_read_text(filepath, text)) { text = path_source_replace_includes_recursive( text, filepath, state); /* Use line directives for better error messages. */ result = line_directive(*state, filepath, 1) + "\n" + text + "\n" + line_directive(*state, source_filepath, line_number + 1); } } } return result; } /* Our own little c preprocessor that replaces #includes with the file * contents, to work around issue of OpenCL drivers not supporting * include paths with spaces in them. */ static string path_source_replace_includes_recursive( const string& source, const string& source_filepath, SourceReplaceState *state) { /* Try to re-use processed file without spending time on replacing all * include directives again. */ SourceReplaceState::ProcessedMapping::iterator replaced_file = state->processed_files.find(source_filepath); if(replaced_file != state->processed_files.end()) { if(state->precompiled_headers.find(source_filepath) != state->precompiled_headers.end()) { return ""; } return replaced_file->second; } /* Perform full file processing. */ string result = ""; const size_t source_length = source.length(); size_t index = 0; /* Information about where we are in the source. */ size_t line_number = 0, column_number = 1; /* Currently gathered non-preprocessor token. * Store as start/length rather than token itself to avoid overhead of * memory re-allocations on each character concatenation. */ size_t token_start = 0, token_length = 0; /* Denotes whether we're inside of preprocessor line, together with * preprocessor line itself. * * TODO(sergey): Investigate whether using token start/end position * gives measurable speedup. */ bool inside_preprocessor = false; string preprocessor_line = ""; /* Actual loop over the whole source. */ while(index < source_length) { const char ch = source[index]; if(ch == '\n') { if(inside_preprocessor) { result += path_source_handle_preprocessor(preprocessor_line, source_filepath, line_number, state); /* Start gathering net part of the token. */ token_start = index; token_length = 0; } inside_preprocessor = false; preprocessor_line = ""; column_number = 0; ++line_number; } else if(ch == '#' && column_number == 1 && !inside_preprocessor) { /* Append all possible non-preprocessor token to the result. */ if(token_length != 0) { result.append(source, token_start, token_length); token_start = index; token_length = 0; } inside_preprocessor = true; } if(inside_preprocessor) { preprocessor_line += ch; } else { ++token_length; } ++index; ++column_number; } /* Append possible tokens which happened before special events handled * above. */ if(token_length != 0) { result.append(source, token_start, token_length); } if(inside_preprocessor) { result += path_source_handle_preprocessor(preprocessor_line, source_filepath, line_number, state); } /* Store result for further reuse. */ state->processed_files[source_filepath] = result; return result; } string path_source_replace_includes(const string& source, const string& path, const string& source_filename) { SourceReplaceState state; state.base = path; return path_source_replace_includes_recursive( source, path_join(path, source_filename), &state); } FILE *path_fopen(const string& path, const string& mode) { #ifdef _WIN32 wstring path_wc = string_to_wstring(path); wstring mode_wc = string_to_wstring(mode); return _wfopen(path_wc.c_str(), mode_wc.c_str()); #else return fopen(path.c_str(), mode.c_str()); #endif } void path_cache_clear_except(const string& name, const set& except) { string dir = path_user_get("cache"); if(path_exists(dir)) { directory_iterator it(dir), it_end; for(; it != it_end; ++it) { string filename = path_filename(it->path()); if(string_startswith(filename, name.c_str())) if(except.find(filename) == except.end()) path_remove(it->path()); } } } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_path.h000066400000000000000000000051071334742672700215170ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_PATH_H__ #define __UTIL_PATH_H__ /* Utility functions to get paths to files distributed with the program. For * the standalone apps, paths are relative to the executable, for dynamically * linked libraries, the path to the library may be set with path_init, which * then makes all paths relative to that. */ #include #include "util/util_set.h" #include "util/util_string.h" #include "util/util_types.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN /* program paths */ void path_init(const string& path = "", const string& user_path = ""); string path_get(const string& sub = ""); string path_user_get(const string& sub = ""); string path_cache_get(const string& sub = ""); /* path string manipulation */ string path_filename(const string& path); string path_dirname(const string& path); string path_join(const string& dir, const string& file); string path_escape(const string& path); bool path_is_relative(const string& path); /* file info */ size_t path_file_size(const string& path); bool path_exists(const string& path); bool path_is_directory(const string& path); string path_files_md5_hash(const string& dir); uint64_t path_modified_time(const string& path); /* directory utility */ void path_create_directories(const string& path); /* file read/write utilities */ FILE *path_fopen(const string& path, const string& mode); bool path_write_binary(const string& path, const vector& binary); bool path_write_text(const string& path, string& text); bool path_read_binary(const string& path, vector& binary); bool path_read_text(const string& path, string& text); /* File manipulation. */ bool path_remove(const string& path); /* source code utility */ string path_source_replace_includes(const string& source, const string& path, const string& source_filename=""); /* cache utility */ void path_cache_clear_except(const string& name, const set& except); CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_progress.h000066400000000000000000000170561334742672700224350ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_PROGRESS_H__ #define __UTIL_PROGRESS_H__ /* Progress * * Simple class to communicate progress status messages, timing information, * update notifications from a job running in another thread. All methods * except for the constructor/destructor are thread safe. */ #include "util/util_function.h" #include "util/util_string.h" #include "util/util_time.h" #include "util/util_thread.h" CCL_NAMESPACE_BEGIN class Progress { public: Progress() { pixel_samples = 0; total_pixel_samples = 0; current_tile_sample = 0; rendered_tiles = 0; denoised_tiles = 0; start_time = time_dt(); render_start_time = time_dt(); end_time = 0.0; status = "Initializing"; substatus = ""; sync_status = ""; sync_substatus = ""; update_cb = function_null; cancel = false; cancel_message = ""; error = false; error_message = ""; cancel_cb = function_null; } Progress(Progress& progress) { *this = progress; } Progress& operator=(Progress& progress) { thread_scoped_lock lock(progress.progress_mutex); progress.get_status(status, substatus); pixel_samples = progress.pixel_samples; total_pixel_samples = progress.total_pixel_samples; current_tile_sample = progress.get_current_sample(); return *this; } void reset() { pixel_samples = 0; total_pixel_samples = 0; current_tile_sample = 0; rendered_tiles = 0; denoised_tiles = 0; start_time = time_dt(); render_start_time = time_dt(); end_time = 0.0; status = "Initializing"; substatus = ""; sync_status = ""; sync_substatus = ""; cancel = false; cancel_message = ""; error = false; error_message = ""; } /* cancel */ void set_cancel(const string& cancel_message_) { thread_scoped_lock lock(progress_mutex); cancel_message = cancel_message_; cancel = true; } bool get_cancel() { if(!cancel && cancel_cb) cancel_cb(); return cancel; } string get_cancel_message() { thread_scoped_lock lock(progress_mutex); return cancel_message; } void set_cancel_callback(function function) { cancel_cb = function; } /* error */ void set_error(const string& error_message_) { thread_scoped_lock lock(progress_mutex); error_message = error_message_; error = true; /* If error happens we also stop rendering. */ cancel_message = error_message_; cancel = true; } bool get_error() { return error; } string get_error_message() { thread_scoped_lock lock(progress_mutex); return error_message; } /* tile and timing information */ void set_start_time() { thread_scoped_lock lock(progress_mutex); start_time = time_dt(); end_time = 0.0; } void set_render_start_time() { thread_scoped_lock lock(progress_mutex); render_start_time = time_dt(); } void add_skip_time(const scoped_timer &start_timer, bool only_render) { double skip_time = time_dt() - start_timer.get_start(); render_start_time += skip_time; if(!only_render) { start_time += skip_time; } } void get_time(double& total_time_, double& render_time_) { thread_scoped_lock lock(progress_mutex); double time = (end_time > 0) ? end_time : time_dt(); total_time_ = time - start_time; render_time_ = time - render_start_time; } void set_end_time() { end_time = time_dt(); } void reset_sample() { thread_scoped_lock lock(progress_mutex); pixel_samples = 0; current_tile_sample = 0; rendered_tiles = 0; denoised_tiles = 0; } void set_total_pixel_samples(uint64_t total_pixel_samples_) { thread_scoped_lock lock(progress_mutex); total_pixel_samples = total_pixel_samples_; } float get_progress() { if(total_pixel_samples > 0) { return ((float) pixel_samples) / total_pixel_samples; } return 0.0f; } void add_samples(uint64_t pixel_samples_, int tile_sample) { thread_scoped_lock lock(progress_mutex); pixel_samples += pixel_samples_; current_tile_sample = tile_sample; } void add_samples_update(uint64_t pixel_samples_, int tile_sample) { add_samples(pixel_samples_, tile_sample); set_update(); } void add_finished_tile(bool denoised) { thread_scoped_lock lock(progress_mutex); if(denoised) { denoised_tiles++; } else { rendered_tiles++; } } int get_current_sample() { thread_scoped_lock lock(progress_mutex); /* Note that the value here always belongs to the last tile that updated, * so it's only useful if there is only one active tile. */ return current_tile_sample; } int get_rendered_tiles() { thread_scoped_lock lock(progress_mutex); return rendered_tiles; } int get_denoised_tiles() { thread_scoped_lock lock(progress_mutex); return denoised_tiles; } /* status messages */ void set_status(const string& status_, const string& substatus_ = "") { { thread_scoped_lock lock(progress_mutex); status = status_; substatus = substatus_; } set_update(); } void set_substatus(const string& substatus_) { { thread_scoped_lock lock(progress_mutex); substatus = substatus_; } set_update(); } void set_sync_status(const string& status_, const string& substatus_ = "") { { thread_scoped_lock lock(progress_mutex); sync_status = status_; sync_substatus = substatus_; } set_update(); } void set_sync_substatus(const string& substatus_) { { thread_scoped_lock lock(progress_mutex); sync_substatus = substatus_; } set_update(); } void get_status(string& status_, string& substatus_) { thread_scoped_lock lock(progress_mutex); if(sync_status != "") { status_ = sync_status; substatus_ = sync_substatus; } else { status_ = status; substatus_ = substatus; } } /* callback */ void set_update() { if(update_cb) { thread_scoped_lock lock(update_mutex); update_cb(); } } void set_update_callback(function function) { update_cb = function; } protected: thread_mutex progress_mutex; thread_mutex update_mutex; function update_cb; function cancel_cb; /* pixel_samples counts how many samples have been rendered over all pixel, not just per pixel. * This makes the progress estimate more accurate when tiles with different sizes are used. * * total_pixel_samples is the total amount of pixel samples that will be rendered. */ uint64_t pixel_samples, total_pixel_samples; /* Stores the current sample count of the last tile that called the update function. * It's used to display the sample count if only one tile is active. */ int current_tile_sample; /* Stores the number of tiles that's already finished. * Used to determine whether all but the last tile are finished rendering, in which case the current_tile_sample is displayed. */ int rendered_tiles, denoised_tiles; double start_time, render_start_time; /* End time written when render is done, so it doesn't keep increasing on redraws. */ double end_time; string status; string substatus; string sync_status; string sync_substatus; volatile bool cancel; string cancel_message; volatile bool error; string error_message; }; CCL_NAMESPACE_END #endif /* __UTIL_PROGRESS_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_queue.h000066400000000000000000000013721334742672700217070ustar00rootroot00000000000000/* * Copyright 2011-2015 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_QUEUE_H__ #define __UTIL_QUEUE_H__ #include CCL_NAMESPACE_BEGIN using std::queue; CCL_NAMESPACE_END #endif /* __UTIL_LIST_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_rect.h000066400000000000000000000037631334742672700215260ustar00rootroot00000000000000/* * Copyright 2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_RECT_H__ #define __UTIL_RECT_H__ #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* Rectangles are represented as a int4 containing the coordinates of the lower-left and * upper-right corners in the order (x0, y0, x1, y1). */ ccl_device_inline int4 rect_from_shape(int x0, int y0, int w, int h) { return make_int4(x0, y0, x0 + w, y0 + h); } ccl_device_inline int4 rect_expand(int4 rect, int d) { return make_int4(rect.x - d, rect.y - d, rect.z + d, rect.w + d); } /* Returns the intersection of two rects. */ ccl_device_inline int4 rect_clip(int4 a, int4 b) { return make_int4(max(a.x, b.x), max(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); } ccl_device_inline bool rect_is_valid(int4 rect) { return (rect.z > rect.x) && (rect.w > rect.y); } /* Returns the local row-major index of the pixel inside the rect. */ ccl_device_inline int coord_to_local_index(int4 rect, int x, int y) { int w = rect.z - rect.x; return (y - rect.y) * w + (x - rect.x); } /* Finds the coordinates of a pixel given by its row-major index in the rect, * and returns whether the pixel is inside it. */ ccl_device_inline bool local_index_to_coord(int4 rect, int idx, int *x, int *y) { int w = rect.z - rect.x; *x = (idx % w) + rect.x; *y = (idx / w) + rect.y; return (*y < rect.w); } ccl_device_inline int rect_size(int4 rect) { return (rect.z - rect.x) * (rect.w - rect.y); } CCL_NAMESPACE_END #endif /* __UTIL_RECT_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_set.h000066400000000000000000000036121334742672700213550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_SET_H__ #define __UTIL_SET_H__ #include #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) # include #else # if defined(CYCLES_TR1_UNORDERED_MAP) # include # endif # if defined(CYCLES_STD_UNORDERED_MAP) || \ defined(CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE) # include # endif # if !defined(CYCLES_NO_UNORDERED_MAP) && \ !defined(CYCLES_TR1_UNORDERED_MAP) && \ !defined(CYCLES_STD_UNORDERED_MAP) && \ !defined(CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE) # error One of: CYCLES_NO_UNORDERED_MAP, CYCLES_TR1_UNORDERED_MAP,\ CYCLES_STD_UNORDERED_MAP, CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE must be defined! // NOLINT # endif #endif #if defined(_MSC_VER) && (_MSC_VER >= 1900) # include #endif CCL_NAMESPACE_BEGIN using std::set; #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) using std::unordered_set; #else # if defined(CYCLES_NO_UNORDERED_MAP) typedef std::set unordered_set; # endif # if defined(CYCLES_TR1_UNORDERED_MAP) || defined(CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE) using std::tr1::unordered_set; # endif # if defined(CYCLES_STD_UNORDERED_MAP) using std::unordered_set; # endif #endif CCL_NAMESPACE_END #endif /* __UTIL_SET_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_simd.cpp000066400000000000000000000032011334742672700220430ustar00rootroot00000000000000/* * Copyright 2011-2013 Intel Corporation * Modifications Copyright 2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if (defined(WITH_KERNEL_SSE2)) || \ (defined(WITH_KERNEL_NATIVE) && defined(__SSE2__)) #define __KERNEL_SSE2__ #include "util/util_simd.h" CCL_NAMESPACE_BEGIN const __m128 _mm_lookupmask_ps[16] = { _mm_castsi128_ps(_mm_set_epi32( 0, 0, 0, 0)), _mm_castsi128_ps(_mm_set_epi32( 0, 0, 0,-1)), _mm_castsi128_ps(_mm_set_epi32( 0, 0,-1, 0)), _mm_castsi128_ps(_mm_set_epi32( 0, 0,-1,-1)), _mm_castsi128_ps(_mm_set_epi32( 0,-1, 0, 0)), _mm_castsi128_ps(_mm_set_epi32( 0,-1, 0,-1)), _mm_castsi128_ps(_mm_set_epi32( 0,-1,-1, 0)), _mm_castsi128_ps(_mm_set_epi32( 0,-1,-1,-1)), _mm_castsi128_ps(_mm_set_epi32(-1, 0, 0, 0)), _mm_castsi128_ps(_mm_set_epi32(-1, 0, 0,-1)), _mm_castsi128_ps(_mm_set_epi32(-1, 0,-1, 0)), _mm_castsi128_ps(_mm_set_epi32(-1, 0,-1,-1)), _mm_castsi128_ps(_mm_set_epi32(-1,-1, 0, 0)), _mm_castsi128_ps(_mm_set_epi32(-1,-1, 0,-1)), _mm_castsi128_ps(_mm_set_epi32(-1,-1,-1, 0)), _mm_castsi128_ps(_mm_set_epi32(-1,-1,-1,-1)) }; CCL_NAMESPACE_END #endif // WITH_KERNEL_SSE2 goxel-0.8.1/ext_src/cycles/src/util/util_simd.h000066400000000000000000000300121334742672700215100ustar00rootroot00000000000000/* * Copyright 2011-2013 Intel Corporation * Modifications Copyright 2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0(the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_SIMD_TYPES_H__ #define __UTIL_SIMD_TYPES_H__ #ifndef __KERNEL_GPU__ #include #include "util/util_defines.h" /* SSE Intrinsics includes * * We assume __KERNEL_SSEX__ flags to have been defined at this point */ /* SSE intrinsics headers */ #ifndef FREE_WINDOWS64 #ifdef _MSC_VER # include #elif (defined(__x86_64__) || defined(__i386__)) # include #endif #else /* MinGW64 has conflicting declarations for these SSE headers in . * Since we can't avoid including , better only include that */ #include "util/util_windows.h" #endif CCL_NAMESPACE_BEGIN #ifdef __KERNEL_SSE2__ extern const __m128 _mm_lookupmask_ps[16]; /* Special Types */ static struct TrueTy { __forceinline operator bool( ) const { return true; } } True ccl_maybe_unused; static struct FalseTy { __forceinline operator bool( ) const { return false; } } False ccl_maybe_unused; static struct NegInfTy { __forceinline operator float ( ) const { return -std::numeric_limits::infinity(); } __forceinline operator int ( ) const { return std::numeric_limits::min(); } } neg_inf ccl_maybe_unused; static struct PosInfTy { __forceinline operator float ( ) const { return std::numeric_limits::infinity(); } __forceinline operator int ( ) const { return std::numeric_limits::max(); } } inf ccl_maybe_unused, pos_inf ccl_maybe_unused; /* Intrinsics Functions */ #if defined(__BMI__) && defined(__GNUC__) # ifndef _tzcnt_u32 # define _tzcnt_u32 __tzcnt_u32 # endif # ifndef _tzcnt_u64 # define _tzcnt_u64 __tzcnt_u64 # endif #endif #if defined(__LZCNT__) #define _lzcnt_u32 __lzcnt32 #define _lzcnt_u64 __lzcnt64 #endif #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__clang__) __forceinline int __popcnt(int in) { return _mm_popcnt_u32(in); } #if !defined(_MSC_VER) __forceinline unsigned int __popcnt(unsigned int in) { return _mm_popcnt_u32(in); } #endif #if defined(__KERNEL_64_BIT__) __forceinline long long __popcnt(long long in) { return _mm_popcnt_u64(in); } __forceinline size_t __popcnt(size_t in) { return _mm_popcnt_u64(in); } #endif __forceinline int __bsf(int v) { #if defined(__KERNEL_AVX2__) return _tzcnt_u32(v); #else unsigned long r = 0; _BitScanForward(&r,v); return r; #endif } __forceinline unsigned int __bsf(unsigned int v) { #if defined(__KERNEL_AVX2__) return _tzcnt_u32(v); #else unsigned long r = 0; _BitScanForward(&r,v); return r; #endif } __forceinline int __bsr(int v) { unsigned long r = 0; _BitScanReverse(&r,v); return r; } __forceinline int __btc(int v, int i) { long r = v; _bittestandcomplement(&r,i); return r; } __forceinline int __bts(int v, int i) { long r = v; _bittestandset(&r,i); return r; } __forceinline int __btr(int v, int i) { long r = v; _bittestandreset(&r,i); return r; } __forceinline int bitscan(int v) { #if defined(__KERNEL_AVX2__) return _tzcnt_u32(v); #else return __bsf(v); #endif } __forceinline int clz(const int x) { #if defined(__KERNEL_AVX2__) return _lzcnt_u32(x); #else if(UNLIKELY(x == 0)) return 32; return 31 - __bsr(x); #endif } __forceinline int __bscf(int& v) { int i = __bsf(v); v &= v-1; return i; } __forceinline unsigned int __bscf(unsigned int& v) { unsigned int i = __bsf(v); v &= v-1; return i; } #if defined(__KERNEL_64_BIT__) __forceinline size_t __bsf(size_t v) { #if defined(__KERNEL_AVX2__) return _tzcnt_u64(v); #else unsigned long r = 0; _BitScanForward64(&r,v); return r; #endif } __forceinline size_t __bsr(size_t v) { unsigned long r = 0; _BitScanReverse64(&r,v); return r; } __forceinline size_t __btc(size_t v, size_t i) { size_t r = v; _bittestandcomplement64((__int64*)&r,i); return r; } __forceinline size_t __bts(size_t v, size_t i) { __int64 r = v; _bittestandset64(&r,i); return r; } __forceinline size_t __btr(size_t v, size_t i) { __int64 r = v; _bittestandreset64(&r,i); return r; } __forceinline size_t bitscan(size_t v) { #if defined(__KERNEL_AVX2__) #if defined(__KERNEL_64_BIT__) return _tzcnt_u64(v); #else return _tzcnt_u32(v); #endif #else return __bsf(v); #endif } __forceinline size_t __bscf(size_t& v) { size_t i = __bsf(v); v &= v-1; return i; } #endif /* __KERNEL_64_BIT__ */ #else /* _WIN32 */ __forceinline unsigned int __popcnt(unsigned int in) { int r = 0; asm ("popcnt %1,%0" : "=r"(r) : "r"(in)); return r; } __forceinline int __bsf(int v) { int r = 0; asm ("bsf %1,%0" : "=r"(r) : "r"(v)); return r; } __forceinline int __bsr(int v) { int r = 0; asm ("bsr %1,%0" : "=r"(r) : "r"(v)); return r; } __forceinline int __btc(int v, int i) { int r = 0; asm ("btc %1,%0" : "=r"(r) : "r"(i), "0"(v) : "flags" ); return r; } __forceinline int __bts(int v, int i) { int r = 0; asm ("bts %1,%0" : "=r"(r) : "r"(i), "0"(v) : "flags"); return r; } __forceinline int __btr(int v, int i) { int r = 0; asm ("btr %1,%0" : "=r"(r) : "r"(i), "0"(v) : "flags"); return r; } #if (defined(__KERNEL_64_BIT__) || defined(__APPLE__)) && !(defined(__ILP32__) && defined(__x86_64__)) __forceinline size_t __bsf(size_t v) { size_t r = 0; asm ("bsf %1,%0" : "=r"(r) : "r"(v)); return r; } #endif __forceinline unsigned int __bsf(unsigned int v) { unsigned int r = 0; asm ("bsf %1,%0" : "=r"(r) : "r"(v)); return r; } __forceinline size_t __bsr(size_t v) { size_t r = 0; asm ("bsr %1,%0" : "=r"(r) : "r"(v)); return r; } __forceinline size_t __btc(size_t v, size_t i) { size_t r = 0; asm ("btc %1,%0" : "=r"(r) : "r"(i), "0"(v) : "flags" ); return r; } __forceinline size_t __bts(size_t v, size_t i) { size_t r = 0; asm ("bts %1,%0" : "=r"(r) : "r"(i), "0"(v) : "flags"); return r; } __forceinline size_t __btr(size_t v, size_t i) { size_t r = 0; asm ("btr %1,%0" : "=r"(r) : "r"(i), "0"(v) : "flags"); return r; } __forceinline int bitscan(int v) { #if defined(__KERNEL_AVX2__) return _tzcnt_u32(v); #else return __bsf(v); #endif } __forceinline unsigned int bitscan(unsigned int v) { #if defined(__KERNEL_AVX2__) return _tzcnt_u32(v); #else return __bsf(v); #endif } #if (defined(__KERNEL_64_BIT__) || defined(__APPLE__)) && !(defined(__ILP32__) && defined(__x86_64__)) __forceinline size_t bitscan(size_t v) { #if defined(__KERNEL_AVX2__) #if defined(__KERNEL_64_BIT__) return _tzcnt_u64(v); #else return _tzcnt_u32(v); #endif #else return __bsf(v); #endif } #endif __forceinline int clz(const int x) { #if defined(__KERNEL_AVX2__) return _lzcnt_u32(x); #else if(UNLIKELY(x == 0)) return 32; return 31 - __bsr(x); #endif } __forceinline int __bscf(int& v) { int i = bitscan(v); #if defined(__KERNEL_AVX2__) v &= v-1; #else v = __btc(v,i); #endif return i; } __forceinline unsigned int __bscf(unsigned int& v) { unsigned int i = bitscan(v); v &= v-1; return i; } #if (defined(__KERNEL_64_BIT__) || defined(__APPLE__)) && !(defined(__ILP32__) && defined(__x86_64__)) __forceinline size_t __bscf(size_t& v) { size_t i = bitscan(v); #if defined(__KERNEL_AVX2__) v &= v-1; #else v = __btc(v,i); #endif return i; } #endif #endif /* _WIN32 */ /* Test __KERNEL_SSE41__ for MSVC which does not define __SSE4_1__, and test * __SSE4_1__ to avoid OpenImageIO conflicts with our emulation macros on other * platforms when compiling code outside the kernel. */ #if !(defined(__KERNEL_SSE41__) || defined(__SSE4_1__) || defined(__SSE4_2__)) /* Emulation of SSE4 functions with SSE2 */ #define _MM_FROUND_TO_NEAREST_INT 0x00 #define _MM_FROUND_TO_NEG_INF 0x01 #define _MM_FROUND_TO_POS_INF 0x02 #define _MM_FROUND_TO_ZERO 0x03 #define _MM_FROUND_CUR_DIRECTION 0x04 #undef _mm_blendv_ps #define _mm_blendv_ps _mm_blendv_ps_emu __forceinline __m128 _mm_blendv_ps_emu( __m128 value, __m128 input, __m128 mask) { __m128i isignmask = _mm_set1_epi32(0x80000000); __m128 signmask = _mm_castsi128_ps(isignmask); __m128i iandsign = _mm_castps_si128(_mm_and_ps(mask, signmask)); __m128i icmpmask = _mm_cmpeq_epi32(iandsign, isignmask); __m128 cmpmask = _mm_castsi128_ps(icmpmask); return _mm_or_ps(_mm_and_ps(cmpmask, input), _mm_andnot_ps(cmpmask, value)); } #undef _mm_blend_ps #define _mm_blend_ps _mm_blend_ps_emu __forceinline __m128 _mm_blend_ps_emu( __m128 value, __m128 input, const int mask) { assert(mask < 0x10); return _mm_blendv_ps(value, input, _mm_lookupmask_ps[mask]); } #undef _mm_blendv_epi8 #define _mm_blendv_epi8 _mm_blendv_epi8_emu __forceinline __m128i _mm_blendv_epi8_emu( __m128i value, __m128i input, __m128i mask) { return _mm_or_si128(_mm_and_si128(mask, input), _mm_andnot_si128(mask, value)); } #undef _mm_min_epi32 #define _mm_min_epi32 _mm_min_epi32_emu __forceinline __m128i _mm_min_epi32_emu( __m128i value, __m128i input) { return _mm_blendv_epi8(input, value, _mm_cmplt_epi32(value, input)); } #undef _mm_max_epi32 #define _mm_max_epi32 _mm_max_epi32_emu __forceinline __m128i _mm_max_epi32_emu( __m128i value, __m128i input) { return _mm_blendv_epi8(value, input, _mm_cmplt_epi32(value, input)); } #undef _mm_extract_epi32 #define _mm_extract_epi32 _mm_extract_epi32_emu __forceinline int _mm_extract_epi32_emu( __m128i input, const int index) { switch(index) { case 0: return _mm_cvtsi128_si32(input); case 1: return _mm_cvtsi128_si32(_mm_shuffle_epi32(input, _MM_SHUFFLE(1, 1, 1, 1))); case 2: return _mm_cvtsi128_si32(_mm_shuffle_epi32(input, _MM_SHUFFLE(2, 2, 2, 2))); case 3: return _mm_cvtsi128_si32(_mm_shuffle_epi32(input, _MM_SHUFFLE(3, 3, 3, 3))); default: assert(false); return 0; } } #undef _mm_insert_epi32 #define _mm_insert_epi32 _mm_insert_epi32_emu __forceinline __m128i _mm_insert_epi32_emu( __m128i value, int input, const int index) { assert(index >= 0 && index < 4); ((int*)&value)[index] = input; return value; } #undef _mm_insert_ps #define _mm_insert_ps _mm_insert_ps_emu __forceinline __m128 _mm_insert_ps_emu( __m128 value, __m128 input, const int index) { assert(index < 0x100); ((float*)&value)[(index >> 4)&0x3] = ((float*)&input)[index >> 6]; return _mm_andnot_ps(_mm_lookupmask_ps[index&0xf], value); } #undef _mm_round_ps #define _mm_round_ps _mm_round_ps_emu __forceinline __m128 _mm_round_ps_emu( __m128 value, const int flags) { switch(flags) { case _MM_FROUND_TO_NEAREST_INT: return _mm_cvtepi32_ps(_mm_cvtps_epi32(value)); case _MM_FROUND_TO_NEG_INF : return _mm_cvtepi32_ps(_mm_cvtps_epi32(_mm_add_ps(value, _mm_set1_ps(-0.5f)))); case _MM_FROUND_TO_POS_INF : return _mm_cvtepi32_ps(_mm_cvtps_epi32(_mm_add_ps(value, _mm_set1_ps( 0.5f)))); case _MM_FROUND_TO_ZERO : return _mm_cvtepi32_ps(_mm_cvttps_epi32(value)); } return value; } #endif /* !(defined(__KERNEL_SSE41__) || defined(__SSE4_1__) || defined(__SSE4_2__)) */ #else /* __KERNEL_SSE2__ */ /* This section is for utility functions which operates on non-register data * which might be used from a non-vectorized code. */ ccl_device_inline int bitscan(int value) { assert(value != 0); int bit = 0; while((value & (1 << bit)) == 0) { ++bit; } return bit; } ccl_device_inline int __bsr(int value) { assert(value != 0); int bit = 0; while(value >>= 1) { ++bit; } return bit; } #endif /* __KERNEL_SSE2__ */ /* quiet unused define warnings */ #if defined(__KERNEL_SSE2__) || \ defined(__KERNEL_SSE3__) || \ defined(__KERNEL_SSSE3__) || \ defined(__KERNEL_SSE41__) || \ defined(__KERNEL_AVX__) || \ defined(__KERNEL_AVX2__) /* do nothing */ #endif CCL_NAMESPACE_END #endif /* __KERNEL_GPU__ */ #endif /* __UTIL_SIMD_TYPES_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_sky_model.cpp000066400000000000000000000324641334742672700231120ustar00rootroot00000000000000/* This source is published under the following 3-clause BSD license. Copyright (c) 2012 - 2013, Lukas Hosek and Alexander Wilkie 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. * None of the names of the 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 HOLDERS 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. */ /* ============================================================================ This file is part of a sample implementation of the analytical skylight and solar radiance models presented in the SIGGRAPH 2012 paper "An Analytic Model for Full Spectral Sky-Dome Radiance" and the 2013 IEEE CG&A paper "Adding a Solar Radiance Function to the Hosek Skylight Model" both by Lukas Hosek and Alexander Wilkie Charles University in Prague, Czech Republic Version: 1.4a, February 22nd, 2013 Version history: 1.4a February 22nd, 2013 Removed unnecessary and counter-intuitive solar radius parameters from the interface of the colourspace sky dome initialisation functions. 1.4 February 11th, 2013 Fixed a bug which caused the relative brightness of the solar disc and the sky dome to be off by a factor of about 6. The sun was too bright: this affected both normal and alien sun scenarios. The coefficients of the solar radiance function were changed to fix this. 1.3 January 21st, 2013 (not released to the public) Added support for solar discs that are not exactly the same size as the terrestrial sun. Also added support for suns with a different emission spectrum ("Alien World" functionality). 1.2a December 18th, 2012 Fixed a mistake and some inaccuracies in the solar radiance function explanations found in ArHosekSkyModel.h. The actual source code is unchanged compared to version 1.2. 1.2 December 17th, 2012 Native RGB data and a solar radiance function that matches the turbidity conditions were added. 1.1 September 2012 The coefficients of the spectral model are now scaled so that the output is given in physical units: W / (m^-2 * sr * nm). Also, the output of the XYZ model is now no longer scaled to the range [0...1]. Instead, it is the result of a simple conversion from spectral data via the CIE 2 degree standard observer matching functions. Therefore, after multiplication with 683 lm / W, the Y channel now corresponds to luminance in lm. 1.0 May 11th, 2012 Initial release. Please visit http://cgg.mff.cuni.cz/projects/SkylightModelling/ to check if an updated version of this code has been published! ============================================================================ */ /* All instructions on how to use this code are in the accompanying header file. */ #include "util/util_sky_model.h" #include "util/util_sky_model_data.h" #include #include #include #include CCL_NAMESPACE_BEGIN // Some macro definitions that occur elsewhere in ART, and that have to be // replicated to make this a stand-alone module. #ifndef MATH_PI #define MATH_PI 3.141592653589793 #endif #ifndef MATH_DEG_TO_RAD #define MATH_DEG_TO_RAD ( MATH_PI / 180.0 ) #endif #ifndef DEGREES #define DEGREES * MATH_DEG_TO_RAD #endif #ifndef TERRESTRIAL_SOLAR_RADIUS #define TERRESTRIAL_SOLAR_RADIUS ( ( 0.51 DEGREES ) / 2.0 ) #endif #ifndef ALLOC #define ALLOC(_struct) ((_struct *)malloc(sizeof(_struct))) #endif // internal definitions typedef const double *ArHosekSkyModel_Dataset; typedef const double *ArHosekSkyModel_Radiance_Dataset; // internal functions static void ArHosekSkyModel_CookConfiguration( ArHosekSkyModel_Dataset dataset, ArHosekSkyModelConfiguration config, double turbidity, double albedo, double solar_elevation) { const double * elev_matrix; int int_turbidity = (int)turbidity; double turbidity_rem = turbidity - (double)int_turbidity; solar_elevation = pow(solar_elevation / (MATH_PI / 2.0), (1.0 / 3.0)); // alb 0 low turb elev_matrix = dataset + ( 9 * 6 * (int_turbidity-1)); for(unsigned int i = 0; i < 9; ++i) { //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; config[i] = (1.0-albedo) * (1.0 - turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + pow(solar_elevation, 5.0) * elev_matrix[i+45]); } // alb 1 low turb elev_matrix = dataset + (9*6*10 + 9*6*(int_turbidity-1)); for(unsigned int i = 0; i < 9; ++i) { //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; config[i] += (albedo) * (1.0 - turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + pow(solar_elevation, 5.0) * elev_matrix[i+45]); } if(int_turbidity == 10) return; // alb 0 high turb elev_matrix = dataset + (9*6*(int_turbidity)); for(unsigned int i = 0; i < 9; ++i) { //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; config[i] += (1.0-albedo) * (turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + pow(solar_elevation, 5.0) * elev_matrix[i+45]); } // alb 1 high turb elev_matrix = dataset + (9*6*10 + 9*6*(int_turbidity)); for(unsigned int i = 0; i < 9; ++i) { //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; config[i] += (albedo) * (turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + pow(solar_elevation, 5.0) * elev_matrix[i+45]); } } static double ArHosekSkyModel_CookRadianceConfiguration( ArHosekSkyModel_Radiance_Dataset dataset, double turbidity, double albedo, double solar_elevation) { const double* elev_matrix; int int_turbidity = (int)turbidity; double turbidity_rem = turbidity - (double)int_turbidity; double res; solar_elevation = pow(solar_elevation / (MATH_PI / 2.0), (1.0 / 3.0)); // alb 0 low turb elev_matrix = dataset + (6*(int_turbidity-1)); //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; res = (1.0-albedo) * (1.0 - turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + pow(solar_elevation, 5.0) * elev_matrix[5]); // alb 1 low turb elev_matrix = dataset + (6*10 + 6*(int_turbidity-1)); //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; res += (albedo) * (1.0 - turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + pow(solar_elevation, 5.0) * elev_matrix[5]); if(int_turbidity == 10) return res; // alb 0 high turb elev_matrix = dataset + (6*(int_turbidity)); //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; res += (1.0-albedo) * (turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + pow(solar_elevation, 5.0) * elev_matrix[5]); // alb 1 high turb elev_matrix = dataset + (6*10 + 6*(int_turbidity)); //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; res += (albedo) * (turbidity_rem) * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + pow(solar_elevation, 5.0) * elev_matrix[5]); return res; } static double ArHosekSkyModel_GetRadianceInternal( ArHosekSkyModelConfiguration configuration, double theta, double gamma) { const double expM = exp(configuration[4] * gamma); const double rayM = cos(gamma)*cos(gamma); const double mieM = (1.0 + cos(gamma)*cos(gamma)) / pow((1.0 + configuration[8]*configuration[8] - 2.0*configuration[8]*cos(gamma)), 1.5); const double zenith = sqrt(cos(theta)); return (1.0 + configuration[0] * exp(configuration[1] / (cos(theta) + 0.01))) * (configuration[2] + configuration[3] * expM + configuration[5] * rayM + configuration[6] * mieM + configuration[7] * zenith); } void arhosekskymodelstate_free(ArHosekSkyModelState * state) { free(state); } double arhosekskymodel_radiance(ArHosekSkyModelState *state, double theta, double gamma, double wavelength) { int low_wl = (int)((wavelength - 320.0) / 40.0); if(low_wl < 0 || low_wl >= 11) return 0.0; double interp = fmod((wavelength - 320.0 ) / 40.0, 1.0); double val_low = ArHosekSkyModel_GetRadianceInternal( state->configs[low_wl], theta, gamma) * state->radiances[low_wl] * state->emission_correction_factor_sky[low_wl]; if(interp < 1e-6) return val_low; double result = ( 1.0 - interp ) * val_low; if(low_wl+1 < 11) { result += interp * ArHosekSkyModel_GetRadianceInternal( state->configs[low_wl+1], theta, gamma) * state->radiances[low_wl+1] * state->emission_correction_factor_sky[low_wl+1]; } return result; } // xyz and rgb versions ArHosekSkyModelState * arhosek_xyz_skymodelstate_alloc_init( const double turbidity, const double albedo, const double elevation) { ArHosekSkyModelState * state = ALLOC(ArHosekSkyModelState); state->solar_radius = TERRESTRIAL_SOLAR_RADIUS; state->turbidity = turbidity; state->albedo = albedo; state->elevation = elevation; for(unsigned int channel = 0; channel < 3; ++channel) { ArHosekSkyModel_CookConfiguration( datasetsXYZ[channel], state->configs[channel], turbidity, albedo, elevation); state->radiances[channel] = ArHosekSkyModel_CookRadianceConfiguration( datasetsXYZRad[channel], turbidity, albedo, elevation); } return state; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_sky_model.h000066400000000000000000000463021334742672700225530ustar00rootroot00000000000000/* This source is published under the following 3-clause BSD license. Copyright (c) 2012 - 2013, Lukas Hosek and Alexander Wilkie 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. * None of the names of the 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 HOLDERS 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. */ /* ============================================================================ This file is part of a sample implementation of the analytical skylight and solar radiance models presented in the SIGGRAPH 2012 paper "An Analytic Model for Full Spectral Sky-Dome Radiance" and the 2013 IEEE CG&A paper "Adding a Solar Radiance Function to the Hosek Skylight Model" both by Lukas Hosek and Alexander Wilkie Charles University in Prague, Czech Republic Version: 1.4a, February 22nd, 2013 Version history: 1.4a February 22nd, 2013 Removed unnecessary and counter-intuitive solar radius parameters from the interface of the colourspace sky dome initialisation functions. 1.4 February 11th, 2013 Fixed a bug which caused the relative brightness of the solar disc and the sky dome to be off by a factor of about 6. The sun was too bright: this affected both normal and alien sun scenarios. The coefficients of the solar radiance function were changed to fix this. 1.3 January 21st, 2013 (not released to the public) Added support for solar discs that are not exactly the same size as the terrestrial sun. Also added support for suns with a different emission spectrum ("Alien World" functionality). 1.2a December 18th, 2012 Fixed a mistake and some inaccuracies in the solar radiance function explanations found in ArHosekSkyModel.h. The actual source code is unchanged compared to version 1.2. 1.2 December 17th, 2012 Native RGB data and a solar radiance function that matches the turbidity conditions were added. 1.1 September 2012 The coefficients of the spectral model are now scaled so that the output is given in physical units: W / (m^-2 * sr * nm). Also, the output of the XYZ model is now no longer scaled to the range [0...1]. Instead, it is the result of a simple conversion from spectral data via the CIE 2 degree standard observer matching functions. Therefore, after multiplication with 683 lm / W, the Y channel now corresponds to luminance in lm. 1.0 May 11th, 2012 Initial release. Please visit http://cgg.mff.cuni.cz/projects/SkylightModelling/ to check if an updated version of this code has been published! ============================================================================ */ /* This code is taken from ART, a rendering research system written in a mix of C99 / Objective C. Since ART is not a small system and is intended to be inter-operable with other libraries, and since C does not have namespaces, the structures and functions in ART all have to have somewhat wordy canonical names that begin with Ar.../ar..., like those seen in this example. Usage information: ================== Model initialisation -------------------- A separate ArHosekSkyModelState has to be maintained for each spectral band you want to use the model for. So in a renderer with 'num_channels' bands, you would need something like ArHosekSkyModelState * skymodel_state[num_channels]; You then have to allocate and initialise these states. In the following code snippet, we assume that 'albedo' is defined as double albedo[num_channels]; with a ground albedo value between [0,1] for each channel. The solar elevation is given in radians. for ( unsigned int i = 0; i < num_channels; i++ ) skymodel_state[i] = arhosekskymodelstate_alloc_init( turbidity, albedo[i], solarElevation ); Note that starting with version 1.3, there is also a second initialisation function which generates skydome states for different solar emission spectra and solar radii: 'arhosekskymodelstate_alienworld_alloc_init()'. See the notes about the "Alien World" functionality provided further down for a discussion of the usefulness and limits of that second initalisation function. Sky model states that have been initialized with either function behave in a completely identical fashion during use and cleanup. Using the model to generate skydome samples ------------------------------------------- Generating a skydome radiance spectrum "skydome_result" for a given location on the skydome determined via the angles theta and gamma works as follows: double skydome_result[num_channels]; for ( unsigned int i = 0; i < num_channels; i++ ) skydome_result[i] = arhosekskymodel_radiance( skymodel_state[i], theta, gamma, channel_center[i] ); The variable "channel_center" is assumed to hold the channel center wavelengths for each of the num_channels samples of the spectrum we are building. Cleanup after use ----------------- After rendering is complete, the content of the sky model states should be disposed of via for ( unsigned int i = 0; i < num_channels; i++ ) arhosekskymodelstate_free( skymodel_state[i] ); CIE XYZ Version of the Model ---------------------------- Usage of the CIE XYZ version of the model is exactly the same, except that num_channels is of course always 3, and that ArHosekTristimSkyModelState and arhosek_tristim_skymodel_radiance() have to be used instead of their spectral counterparts. RGB Version of the Model ------------------------ The RGB version uses sRGB primaries with a linear gamma ramp. The same set of functions as with the XYZ data is used, except the model is initialized by calling arhosek_rgb_skymodelstate_alloc_init. Solar Radiance Function ----------------------- For each position on the solar disc, this function returns the entire radiance one sees - direct emission, as well as in-scattered light in the area of the solar disc. The latter is important for low solar elevations - nice images of the setting sun would not be possible without this. This is also the reason why this function, just like the regular sky dome model evaluation function, needs access to the sky dome data structures, as these provide information on in-scattered radiance. CAVEAT #1: in this release, this function is only provided in spectral form! RGB/XYZ versions to follow at a later date. CAVEAT #2: (fixed from release 1.3 onwards) CAVEAT #3: limb darkening renders the brightness of the solar disc inhomogeneous even for high solar elevations - only taking a single sample at the centre of the sun will yield an incorrect power estimate for the solar disc! Always take multiple random samples across the entire solar disc to estimate its power! CAVEAT #4: in this version, the limb darkening calculations still use a fairly computationally expensive 5th order polynomial that was directly taken from astronomical literature. For the purposes of Computer Graphics, this is needlessly accurate, though, and will be replaced by a cheaper approximation in a future release. "Alien World" functionality --------------------------- The Hosek sky model can be used to roughly (!) predict the appearance of outdoor scenes on earth-like planets, i.e. planets of a similar size and atmospheric make-up. Since the spectral version of our model predicts sky dome luminance patterns and solar radiance independently for each waveband, and since the intensity of each waveband is solely dependent on the input radiance from the star that the world in question is orbiting, it is trivial to re-scale the wavebands to match a different star radiance. At least in theory, the spectral version of the model has always been capable of this sort of thing, and the actual sky dome and solar radiance models were actually not altered at all in this release. All we did was to add some support functionality for doing this more easily with the existing data and functions, and to add some explanations. Just use 'arhosekskymodelstate_alienworld_alloc_init()' to initialise the sky model states (you will have to provide values for star temperature and solar intensity compared to the terrestrial sun), and do everything else as you did before. CAVEAT #1: we assume the emission of the star that illuminates the alien world to be a perfect blackbody emission spectrum. This is never entirely realistic - real star emission spectra are considerably more complex than this, mainly due to absorption effects in the outer layers of stars. However, blackbody spectra are a reasonable first assumption in a usage scenario like this, where 100% accuracy is simply not necessary: for rendering purposes, there are likely no visible differences between a highly accurate solution based on a more involved simulation, and this approximation. CAVEAT #2: we always use limb darkening data from our own sun to provide this "appearance feature", even for suns of strongly different temperature. Which is presumably not very realistic, but (as with the unaltered blackbody spectrum from caveat #1) probably not a bad first guess, either. If you need more accuracy than we provide here, please make inquiries with a friendly astro-physicst of your choice. CAVEAT #3: you have to provide a value for the solar intensity of the star which illuminates the alien world. For this, please bear in mind that there is very likely a comparatively tight range of absolute solar irradiance values for which an earth-like planet with an atmosphere like the one we assume in our model can exist in the first place! Too much irradiance, and the atmosphere probably boils off into space, too little, it freezes. Which means that stars of considerably different emission colour than our sun will have to be fairly different in size from it, to still provide a reasonable and inhabitable amount of irradiance. Red stars will need to be much larger than our sun, while white or blue stars will have to be comparatively tiny. The initialisation function handles this and computes a plausible solar radius for a given emission spectrum. In terms of absolute radiometric values, you should probably not stray all too far from a solar intensity value of 1.0. CAVEAT #4: although we now support different solar radii for the actual solar disc, the sky dome luminance patterns are *not* parameterised by this value - i.e. the patterns stay exactly the same for different solar radii! Which is of course not correct. But in our experience, solar discs up to several degrees in diameter (! - our own sun is half a degree across) do not cause the luminance patterns on the sky to change perceptibly. The reason we know this is that we initially used unrealistically large suns in our brute force path tracer, in order to improve convergence speeds (which in the beginning were abysmal). Later, we managed to do the reference renderings much faster even with realistically small suns, and found that there was no real difference in skydome appearance anyway. Conclusion: changing the solar radius should not be over-done, so close orbits around red supergiants are a no-no. But for the purposes of getting a fairly credible first impression of what an alien world with a reasonably sized sun would look like, what we are doing here is probably still o.k. HINT #1: if you want to model the sky of an earth-like planet that orbits a binary star, just super-impose two of these models with solar intensity of ~0.5 each, and closely spaced solar positions. Light is additive, after all. Tattooine, here we come... :-) P.S. according to Star Wars canon, Tattooine orbits a binary that is made up of a G and K class star, respectively. So ~5500K and ~4200K should be good first guesses for their temperature. Just in case you were wondering, after reading the previous paragraph. */ CCL_NAMESPACE_BEGIN #ifndef _SKY_MODEL_H_ #define _SKY_MODEL_H_ typedef double ArHosekSkyModelConfiguration[9]; // Spectral version of the model /* ---------------------------------------------------------------------------- ArHosekSkyModelState struct --------------------------- This struct holds the pre-computation data for one particular albedo value. Most fields are self-explanatory, but users should never directly manipulate any of them anyway. The only consistent way to manipulate such structs is via the functions 'arhosekskymodelstate_alloc_init' and 'arhosekskymodelstate_free'. 'emission_correction_factor_sky' 'emission_correction_factor_sun' The original model coefficients were fitted against the emission of our local sun. If a different solar emission is desired (i.e. if the model is being used to predict skydome appearance for an earth-like planet that orbits a different star), these correction factors, which are determined during the alloc_init step, are applied to each waveband separately (they default to 1.0 in normal usage). This is the simplest way to retrofit this sort of capability to the existing model. The different factors for sky and sun are needed since the solar disc may be of a different size compared to the terrestrial sun. ---------------------------------------------------------------------------- */ typedef struct ArHosekSkyModelState { ArHosekSkyModelConfiguration configs[11]; double radiances[11]; double turbidity; double solar_radius; double emission_correction_factor_sky[11]; double emission_correction_factor_sun[11]; double albedo; double elevation; } ArHosekSkyModelState; /* ---------------------------------------------------------------------------- arhosekskymodelstate_alloc_init() function ------------------------------------------ Initialises an ArHosekSkyModelState struct for a terrestrial setting. ---------------------------------------------------------------------------- */ ArHosekSkyModelState *arhosekskymodelstate_alloc_init( const double solar_elevation, const double atmospheric_turbidity, const double ground_albedo); /* ---------------------------------------------------------------------------- arhosekskymodelstate_alienworld_alloc_init() function ----------------------------------------------------- Initialises an ArHosekSkyModelState struct for an "alien world" setting with a sun of a surface temperature given in 'kelvin'. The parameter 'solar_intensity' controls the overall brightness of the sky, relative to the solar irradiance on Earth. A value of 1.0 yields a sky dome that is, on average over the wavelenghts covered in the model (!), as bright as the terrestrial sky in radiometric terms. Which means that the solar radius has to be adjusted, since the emissivity of a solar surface with a given temperature is more or less fixed. So hotter suns have to be smaller to be equally bright as the terrestrial sun, while cooler suns have to be larger. Note that there are limits to the validity of the luminance patterns of the underlying model: see the discussion above for more on this. In particular, an alien sun with a surface temperature of only 2000 Kelvin has to be very large if it is to be as bright as the terrestrial sun - so large that the luminance patterns are no longer a really good fit in that case. If you need information about the solar radius that the model computes for a given temperature (say, for light source sampling purposes), you have to query the 'solar_radius' variable of the sky model state returned *after* running this function. ---------------------------------------------------------------------------- */ ArHosekSkyModelState* arhosekskymodelstate_alienworld_alloc_init( const double solar_elevation, const double solar_intensity, const double solar_surface_temperature_kelvin, const double atmospheric_turbidity, const double ground_albedo); void arhosekskymodelstate_free(ArHosekSkyModelState *state); double arhosekskymodel_radiance(ArHosekSkyModelState *state, double theta, double gamma, double wavelength); // CIE XYZ and RGB versions ArHosekSkyModelState * arhosek_xyz_skymodelstate_alloc_init( const double turbidity, const double albedo, const double elevation); ArHosekSkyModelState * arhosek_rgb_skymodelstate_alloc_init( const double turbidity, const double albedo, const double elevation); double arhosek_tristim_skymodel_radiance(ArHosekSkyModelState* state, double theta, double gamma, int channel); // Delivers the complete function: sky + sun, including limb darkening. // Please read the above description before using this - there are several // caveats! double arhosekskymodel_solar_radiance(ArHosekSkyModelState* state, double theta, double gamma, double wavelength); #endif // _SKY_MODEL_H_ CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_sky_model_data.h000066400000000000000000002026221334742672700235430ustar00rootroot00000000000000/* This source is published under the following 3-clause BSD license. Copyright (c) 2012 - 2013, Lukas Hosek and Alexander Wilkie 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. * None of the names of the 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 HOLDERS 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. */ /* ============================================================================ This file is part of a sample implementation of the analytical skylight and solar radiance models presented in the SIGGRAPH 2012 paper "An Analytic Model for Full Spectral Sky-Dome Radiance" and the 2013 IEEE CG&A paper "Adding a Solar Radiance Function to the Hosek Skylight Model" both by Lukas Hosek and Alexander Wilkie Charles University in Prague, Czech Republic Version: 1.4a, February 22nd, 2013 Version history: 1.4a February 22nd, 2013 Removed unnecessary and counter-intuitive solar radius parameters from the interface of the colourspace sky dome initialisation functions. 1.4 February 11th, 2013 Fixed a bug which caused the relative brightness of the solar disc and the sky dome to be off by a factor of about 6. The sun was too bright: this affected both normal and alien sun scenarios. The coefficients of the solar radiance function were changed to fix this. 1.3 January 21st, 2013 (not released to the public) Added support for solar discs that are not exactly the same size as the terrestrial sun. Also added support for suns with a different emission spectrum ("Alien World" functionality). 1.2a December 18th, 2012 Fixed a mistake and some inaccuracies in the solar radiance function explanations found in ArHosekSkyModel.h. The actual source code is unchanged compared to version 1.2. 1.2 December 17th, 2012 Native RGB data and a solar radiance function that matches the turbidity conditions were added. 1.1 September 2012 The coefficients of the spectral model are now scaled so that the output is given in physical units: W / (m^-2 * sr * nm). Also, the output of the XYZ model is now no longer scaled to the range [0...1]. Instead, it is the result of a simple conversion from spectral data via the CIE 2 degree standard observer matching functions. Therefore, after multiplication with 683 lm / W, the Y channel now corresponds to luminance in lm. 1.0 May 11th, 2012 Initial release. Please visit http://cgg.mff.cuni.cz/projects/SkylightModelling/ to check if an updated version of this code has been published! ============================================================================ */ CCL_NAMESPACE_BEGIN /* This file contains the coefficient data for the XYZ colour space version of the model. */ // Uses Sep 9 pattern / Aug 23 mean dataset static const double datasetXYZ1[] = { // albedo 0, turbidity 1 -1.117001e+000, -1.867262e-001, -1.113505e+001, 1.259865e+001, -3.937339e-002, 1.167571e+000, 7.100686e-003, 3.592678e+000, 6.083296e-001, -1.152006e+000, -1.926669e-001, 6.152049e+000, -4.770802e+000, -8.704701e-002, 7.483626e-001, 3.372718e-002, 4.464592e+000, 4.036546e-001, -1.072371e+000, -2.696632e-001, 2.816168e-001, 1.820571e+000, -3.742666e-001, 2.080607e+000, -7.675295e-002, -2.835366e+000, 1.129329e+000, -1.109935e+000, -1.532764e-001, 1.198787e+000, -9.015183e-001, 5.173015e-003, 5.749178e-001, 1.075633e-001, 4.387949e+000, 2.650413e-001, -1.052297e+000, -2.229452e-001, 1.952347e+000, 5.727205e-001, -4.885070e+000, 1.984016e+000, -1.106197e-001, -4.898361e-001, 8.907873e-001, -1.070108e+000, -1.600465e-001, 1.593886e+000, -4.479251e-005, -3.306541e+000, 9.390193e-001, 9.513168e-002, 2.343583e+000, 5.335404e-001, // albedo 0, turbidity 2 -1.113253e+000, -1.699600e-001, -1.038822e+001, 1.137513e+001, -4.040911e-002, 1.037455e+000, 4.991792e-002, 4.801919e+000, 6.302710e-001, -1.135747e+000, -1.678594e-001, 4.970755e+000, -4.430230e+000, -6.657408e-002, 3.636161e-001, 1.558009e-001, 6.013370e+000, 3.959601e-001, -1.095892e+000, -2.732595e-001, 7.666496e-001, 1.350731e+000, -4.401401e-001, 2.470135e+000, -1.707929e-001, -3.260793e+000, 1.170337e+000, -1.073668e+000, -2.603929e-002, -1.944589e-001, 4.575207e-001, 6.878164e-001, -1.390770e-001, 3.690299e-001, 7.885781e+000, 1.877694e-001, -1.070091e+000, -2.798957e-001, 2.338478e+000, -2.647221e+000, -7.387808e+000, 2.329210e+000, -1.644639e-001, -2.003710e+000, 9.874527e-001, -1.067120e+000, -1.418866e-001, 1.254090e+000, 6.053048e+000, -2.918892e+000, 5.322812e-001, 1.613053e-001, 3.018161e+000, 5.274090e-001, // albedo 0, turbidity 3 -1.129483e+000, -1.890619e-001, -9.065101e+000, 9.659923e+000, -3.607819e-002, 8.314359e-001, 8.181661e-002, 4.768868e+000, 6.339777e-001, -1.146420e+000, -1.883579e-001, 3.309173e+000, -3.127882e+000, -6.938176e-002, 3.987113e-001, 1.400581e-001, 6.283042e+000, 5.267076e-001, -1.128348e+000, -2.641305e-001, 1.223176e+000, 5.514952e-002, -3.490649e-001, 1.997784e+000, -4.123709e-002, -2.251251e+000, 9.483466e-001, -1.025820e+000, 1.404690e-002, -1.187406e+000, 2.729900e+000, 5.877588e-001, -2.761140e-001, 4.602633e-001, 8.305125e+000, 3.945001e-001, -1.083957e+000, -2.606679e-001, 2.207108e+000, -7.202803e+000, -5.968103e+000, 2.129455e+000, -7.789512e-002, -1.137688e+000, 8.871769e-001, -1.062465e+000, -1.512189e-001, 1.042881e+000, 1.427839e+001, -4.242214e+000, 4.038100e-001, 1.997780e-001, 2.814449e+000, 5.803196e-001, // albedo 0, turbidity 4 -1.175099e+000, -2.410789e-001, -1.108587e+001, 1.133404e+001, -1.819300e-002, 6.772942e-001, 9.605043e-002, 4.231166e+000, 6.239972e-001, -1.224207e+000, -2.883527e-001, 3.002206e+000, -2.649612e+000, -4.795418e-002, 4.984398e-001, 3.251434e-002, 4.851611e+000, 6.551019e-001, -1.136955e+000, -2.423048e-001, 1.058823e+000, -2.489236e-001, -2.462179e-001, 1.933140e+000, 9.106828e-002, -1.905869e-001, 8.171065e-001, -1.014535e+000, -8.262500e-003, -1.448017e+000, 2.295788e+000, 3.510334e-001, -1.477418e+000, 5.432449e-001, 5.762796e+000, 4.908751e-001, -1.070666e+000, -2.379780e-001, 1.844589e+000, -5.442448e+000, -4.012768e+000, 2.945275e+000, 9.854725e-003, 8.455959e-002, 8.145030e-001, -1.071525e+000, -1.777132e-001, 8.076590e-001, 9.925865e+000, -3.324623e+000, -6.367437e-001, 2.844581e-001, 2.248384e+000, 6.544022e-001, // albedo 0, turbidity 5 -1.218818e+000, -2.952382e-001, -1.345975e+001, 1.347153e+001, -6.814585e-003, 5.079068e-001, 1.197230e-001, 3.776949e+000, 5.836961e-001, -1.409868e+000, -5.114330e-001, 2.776539e+000, -2.039001e+000, -2.673769e-002, 4.145288e-001, 7.829342e-004, 2.275883e+000, 6.629691e-001, -1.069151e+000, -9.434247e-002, 7.293972e-001, -1.222473e+000, -1.533461e-001, 2.160357e+000, 4.626837e-002, 3.852415e+000, 8.593570e-001, -1.021306e+000, -1.149551e-001, -1.108414e+000, 4.178343e+000, 4.013665e-001, -2.222814e+000, 6.929462e-001, 1.392652e+000, 4.401662e-001, -1.074251e+000, -2.224002e-001, 1.372356e+000, -8.858704e+000, -3.922660e+000, 3.020018e+000, -1.458724e-002, 1.511186e+000, 8.288064e-001, -1.062048e+000, -1.526582e-001, 4.921067e-001, 1.485522e+001, -3.229936e+000, -8.426604e-001, 3.916243e-001, 2.678994e+000, 6.689264e-001, // albedo 0, turbidity 6 -1.257023e+000, -3.364700e-001, -1.527795e+001, 1.504223e+001, 2.717715e-003, 3.029910e-001, 1.636851e-001, 3.561663e+000, 5.283161e-001, -1.635124e+000, -7.329993e-001, 3.523939e+000, -2.566337e+000, -1.902543e-002, 5.505483e-001, -6.242176e-002, 1.065992e+000, 6.654236e-001, -9.295823e-001, 4.845834e-002, -2.992990e-001, -2.001327e-001, -8.019339e-002, 1.807806e+000, 9.020277e-002, 5.095372e+000, 8.639936e-001, -1.093740e+000, -2.148608e-001, -5.216240e-001, 2.119777e+000, 9.506454e-002, -1.831439e+000, 6.961204e-001, 1.102084e-001, 4.384319e-001, -1.044181e+000, -1.849257e-001, 9.071246e-001, -4.648901e+000, -2.279385e+000, 2.356502e+000, -4.169147e-002, 1.932557e+000, 8.296550e-001, -1.061451e+000, -1.458745e-001, 2.952267e-001, 8.967214e+000, -3.726228e+000, -5.022316e-001, 5.684877e-001, 3.102347e+000, 6.658443e-001, // albedo 0, turbidity 7 -1.332391e+000, -4.127769e-001, -9.328643e+000, 9.046194e+000, 3.457775e-003, 3.377425e-001, 1.530909e-001, 3.301209e+000, 4.997917e-001, -1.932002e+000, -9.947777e-001, -2.042329e+000, 3.586940e+000, -5.642182e-002, 8.130478e-001, -8.195988e-002, 1.118294e-001, 5.617231e-001, -8.707374e-001, 1.286999e-001, 1.820054e+000, -4.674706e+000, 3.317471e-003, 5.919018e-001, 1.975278e-001, 6.686519e+000, 9.631727e-001, -1.070378e+000, -3.030579e-001, -9.041938e-001, 6.200201e+000, 1.232207e-001, -3.650628e-001, 5.029403e-001, -2.903162e+000, 3.811408e-001, -1.063035e+000, -1.637545e-001, 5.853072e-001, -7.889906e+000, -1.200641e+000, 1.035018e+000, 1.192093e-001, 3.267054e+000, 8.416151e-001, -1.053655e+000, -1.562286e-001, 2.423683e-001, 1.128575e+001, -4.363262e+000, -7.314160e-002, 5.642088e-001, 2.514023e+000, 6.670457e-001, // albedo 0, turbidity 8 -1.366112e+000, -4.718287e-001, -7.876222e+000, 7.746900e+000, -9.182309e-003, 4.716076e-001, 8.320252e-002, 3.165603e+000, 5.392334e-001, -2.468204e+000, -1.336340e+000, -5.386723e+000, 7.072672e+000, -8.329266e-002, 8.636876e-001, -1.978177e-002, -1.326218e-001, 2.979222e-001, -9.653522e-001, -2.373416e-002, 1.810250e+000, -6.467262e+000, 1.410706e-001, -4.753717e-001, 3.003095e-001, 6.551163e+000, 1.151083e+000, -8.943186e-001, -2.487152e-001, -2.308960e-001, 8.512648e+000, 1.298402e-001, 1.034705e+000, 2.303509e-001, -3.924095e+000, 2.982717e-001, -1.146999e+000, -2.318784e-001, 8.992419e-002, -9.933614e+000, -8.860920e-001, -3.071656e-002, 2.852012e-001, 3.046199e+000, 8.599001e-001, -1.032399e+000, -1.645145e-001, 2.683599e-001, 1.327701e+001, -4.407670e+000, 7.709869e-002, 4.951727e-001, 1.957277e+000, 6.630943e-001, // albedo 0, turbidity 9 -1.469070e+000, -6.135092e-001, -6.506263e+000, 6.661315e+000, -3.835383e-002, 7.150413e-001, 7.784318e-003, 2.820577e+000, 6.756784e-001, -2.501583e+000, -1.247404e+000, -1.523462e+001, 1.633191e+001, -1.204803e-002, 5.896471e-001, -2.002023e-002, 1.144647e+000, 6.177874e-002, -2.438672e+000, -1.127291e+000, 5.731172e+000, -1.021350e+001, 6.165610e-002, -7.752641e-001, 4.708254e-001, 4.176847e+000, 1.200881e+000, -1.513427e-001, 9.792731e-002, -1.612349e+000, 9.814289e+000, 5.188921e-002, 1.716403e+000, -7.039255e-002, -2.815115e+000, 3.291874e-001, -1.318511e+000, -3.650554e-001, 4.221268e-001, -9.294529e+000, -4.397520e-002, -8.100625e-001, 3.742719e-001, 1.834166e+000, 8.223450e-001, -1.016009e+000, -1.820264e-001, 1.278426e-001, 1.182696e+001, -4.801528e+000, 4.947899e-001, 4.660378e-001, 1.601254e+000, 6.702359e-001, // albedo 0, turbidity 10 -1.841310e+000, -9.781779e-001, -4.610903e+000, 4.824662e+000, -5.100806e-002, 6.463776e-001, -6.377724e-006, 2.216875e+000, 8.618530e-001, -2.376373e+000, -1.108657e+000, -1.489799e+001, 1.546458e+001, 4.091025e-002, 9.761780e-002, -1.048958e-002, 2.165834e+000, -1.609171e-001, -4.710318e+000, -2.261963e+000, 6.947327e+000, -1.034828e+001, -1.325542e-001, 7.508674e-001, 2.247553e-001, 2.873142e+000, 1.297100e+000, 2.163750e-001, -1.944345e-001, -2.437860e+000, 1.011314e+001, 4.450500e-001, 3.111492e-001, 2.751323e-001, -1.627906e+000, 2.531213e-001, -1.258794e+000, -3.524641e-001, 8.425444e-001, -1.085313e+001, -1.154381e+000, -4.638014e-001, -2.781115e-003, 4.344498e-001, 8.507091e-001, -1.018938e+000, -1.804153e-001, -6.354054e-002, 1.573150e+001, -4.386999e+000, 6.211115e-001, 5.294648e-001, 1.580749e+000, 6.586655e-001, // albedo 1, turbidity 1 -1.116416e+000, -1.917524e-001, -1.068233e+001, 1.222221e+001, -3.668978e-002, 1.054022e+000, 1.592132e-002, 3.180583e+000, 5.627370e-001, -1.132341e+000, -1.671286e-001, 5.976499e+000, -4.227366e+000, -9.542489e-002, 8.664938e-001, 8.351793e-003, 4.876068e+000, 4.492779e-001, -1.087635e+000, -3.173679e-001, 4.314407e-001, 1.100555e+000, -4.410057e-001, 1.677253e+000, -3.005925e-002, -4.201249e+000, 1.070902e+000, -1.083031e+000, -8.847705e-002, 1.291773e+000, 4.546776e-001, 3.091894e-001, 7.261760e-001, 4.203659e-002, 5.990615e+000, 3.704756e-001, -1.057899e+000, -2.246706e-001, 2.329563e+000, -1.219656e+000, -5.335260e+000, 8.545378e-001, -3.906209e-002, -9.025499e-001, 7.797348e-001, -1.073305e+000, -1.522553e-001, 1.767063e+000, 1.904280e+000, -3.101673e+000, 3.995856e-001, 2.905192e-002, 2.563977e+000, 5.753067e-001, // albedo 1, turbidity 2 -1.113674e+000, -1.759694e-001, -9.754125e+000, 1.087391e+001, -3.841093e-002, 9.524272e-001, 5.680219e-002, 4.227034e+000, 6.029571e-001, -1.126496e+000, -1.680281e-001, 5.332352e+000, -4.575579e+000, -6.761755e-002, 3.295335e-001, 1.194896e-001, 5.570901e+000, 4.536185e-001, -1.103074e+000, -2.681801e-001, 6.571479e-002, 2.396522e+000, -4.551280e-001, 2.466331e+000, -1.232022e-001, -3.023201e+000, 1.086379e+000, -1.053299e+000, -2.697173e-002, 8.379121e-001, -9.681458e-001, 5.890692e-001, -4.872027e-001, 2.936929e-001, 7.510139e+000, 3.079122e-001, -1.079553e+000, -2.710448e-001, 2.462379e+000, -3.713554e-001, -8.534512e+000, 1.828242e+000, -1.686398e-001, -1.961340e+000, 8.941077e-001, -1.069741e+000, -1.396394e-001, 1.657868e+000, 3.236313e+000, -2.706344e+000, -2.948122e-001, 1.314816e-001, 2.868457e+000, 5.413403e-001, // albedo 1, turbidity 3 -1.131649e+000, -1.954455e-001, -7.751595e+000, 8.685861e+000, -4.910871e-002, 8.992952e-001, 4.710143e-002, 4.254818e+000, 6.821116e-001, -1.156689e+000, -1.884324e-001, 3.163519e+000, -3.091522e+000, -6.613927e-002, -2.575883e-002, 1.640065e-001, 6.073643e+000, 4.453468e-001, -1.079224e+000, -2.621389e-001, 9.446437e-001, 1.448479e+000, -3.969384e-001, 2.626638e+000, -8.101186e-002, -3.016355e+000, 1.076295e+000, -1.080832e+000, 1.033057e-002, -3.500156e-001, -3.281419e-002, 5.655512e-001, -1.156742e+000, 4.534710e-001, 8.774122e+000, 2.772869e-001, -1.051202e+000, -2.679975e-001, 2.719109e+000, -2.190316e+000, -6.878798e+000, 2.250481e+000, -2.030252e-001, -2.026527e+000, 9.701096e-001, -1.089849e+000, -1.598589e-001, 1.564748e+000, 6.869187e+000, -3.053670e+000, -6.110435e-001, 1.644472e-001, 2.370452e+000, 5.511770e-001, // albedo 1, turbidity 4 -1.171419e+000, -2.429746e-001, -8.991334e+000, 9.571216e+000, -2.772861e-002, 6.688262e-001, 7.683478e-002, 3.785611e+000, 6.347635e-001, -1.228554e+000, -2.917562e-001, 2.753986e+000, -2.491780e+000, -4.663434e-002, 3.118303e-001, 7.546506e-002, 4.463096e+000, 5.955071e-001, -1.093124e+000, -2.447767e-001, 9.097406e-001, 5.448296e-001, -2.957824e-001, 2.024167e+000, -5.152333e-004, -1.069081e+000, 9.369565e-001, -1.056994e+000, 1.569507e-002, -8.217491e-001, 1.870818e+000, 7.061930e-001, -1.483928e+000, 5.978206e-001, 6.864902e+000, 3.673332e-001, -1.054871e+000, -2.758129e-001, 2.712807e+000, -5.950110e+000, -6.554039e+000, 2.447523e+000, -1.895171e-001, -1.454292e+000, 9.131738e-001, -1.100218e+000, -1.746241e-001, 1.438505e+000, 1.115481e+001, -3.266076e+000, -8.837357e-001, 1.970100e-001, 1.991595e+000, 5.907821e-001, // albedo 1, turbidity 5 -1.207267e+000, -2.913610e-001, -1.103767e+001, 1.140724e+001, -1.416800e-002, 5.564047e-001, 8.476262e-002, 3.371255e+000, 6.221335e-001, -1.429698e+000, -5.374218e-001, 2.837524e+000, -2.221936e+000, -2.422337e-002, 9.313758e-002, 7.190250e-002, 1.869022e+000, 5.609035e-001, -1.002274e+000, -6.972810e-002, 4.031308e-001, -3.932997e-001, -1.521923e-001, 2.390646e+000, -6.893990e-002, 2.999661e+000, 1.017843e+000, -1.081168e+000, -1.178666e-001, -4.968080e-001, 3.919299e+000, 6.046866e-001, -2.440615e+000, 7.891538e-001, 2.140835e+000, 2.740470e-001, -1.050727e+000, -2.307688e-001, 2.276396e+000, -9.454407e+000, -5.505176e+000, 2.992620e+000, -2.450942e-001, 6.078372e-001, 9.606765e-001, -1.103752e+000, -1.810202e-001, 1.375044e+000, 1.589095e+001, -3.438954e+000, -1.265669e+000, 2.475172e-001, 1.680768e+000, 5.978056e-001, // albedo 1, turbidity 6 -1.244324e+000, -3.378542e-001, -1.111001e+001, 1.137784e+001, -7.896794e-003, 4.808023e-001, 9.249904e-002, 3.025816e+000, 5.880239e-001, -1.593165e+000, -7.027621e-001, 2.220896e+000, -1.437709e+000, -1.534738e-002, 6.286958e-002, 6.644555e-002, 1.091727e+000, 5.470080e-001, -9.136506e-001, 1.344874e-002, 7.772636e-001, -1.209396e+000, -1.408978e-001, 2.433718e+000, -1.041938e-001, 3.791244e+000, 1.037916e+000, -1.134968e+000, -1.803315e-001, -9.267335e-001, 4.576670e+000, 6.851928e-001, -2.805000e+000, 8.687208e-001, 1.161483e+000, 2.571688e-001, -1.017037e+000, -2.053943e-001, 2.361640e+000, -9.887818e+000, -5.122889e+000, 3.287088e+000, -2.594102e-001, 8.578927e-001, 9.592340e-001, -1.118723e+000, -1.934942e-001, 1.226023e+000, 1.674140e+001, -3.277335e+000, -1.629809e+000, 2.765232e-001, 1.637713e+000, 6.113963e-001, // albedo 1, turbidity 7 -1.314779e+000, -4.119915e-001, -1.241150e+001, 1.241578e+001, 2.344284e-003, 2.980837e-001, 1.414613e-001, 2.781731e+000, 4.998556e-001, -1.926199e+000, -1.020038e+000, 2.569200e+000, -1.081159e+000, -2.266833e-002, 3.588668e-001, 8.750078e-003, -2.452171e-001, 4.796758e-001, -7.780002e-001, 1.850647e-001, 4.445456e-002, -2.409297e+000, -7.816346e-002, 1.546790e+000, -2.807227e-002, 5.998176e+000, 1.132396e+000, -1.179326e+000, -3.578330e-001, -2.392933e-001, 6.467883e+000, 5.904596e-001, -1.869975e+000, 8.045839e-001, -2.498121e+000, 1.610633e-001, -1.009956e+000, -1.311896e-001, 1.726577e+000, -1.219356e+001, -3.466239e+000, 2.343602e+000, -2.252205e-001, 2.573681e+000, 1.027109e+000, -1.112460e+000, -2.063093e-001, 1.233051e+000, 2.058946e+001, -4.578074e+000, -1.145643e+000, 3.160192e-001, 1.420159e+000, 5.860212e-001, // albedo 1, turbidity 8 -1.371689e+000, -4.914196e-001, -1.076610e+001, 1.107405e+001, -1.485077e-002, 5.936218e-001, 3.685482e-002, 2.599968e+000, 6.002204e-001, -2.436997e+000, -1.377939e+000, 2.130141e-002, 1.079593e+000, -1.796232e-002, -3.933248e-002, 1.610711e-001, -6.901181e-001, 1.206416e-001, -8.743368e-001, 7.331370e-002, 8.734259e-001, -3.743126e+000, -3.151167e-002, 1.297596e+000, -7.634926e-002, 6.532873e+000, 1.435737e+000, -9.810197e-001, -3.521634e-001, -2.855205e-001, 7.134674e+000, 6.839748e-001, -1.394841e+000, 6.952036e-001, -4.633104e+000, -2.173401e-002, -1.122958e+000, -1.691536e-001, 1.382360e+000, -1.102913e+001, -2.608171e+000, 1.865111e+000, -1.345154e-001, 3.112342e+000, 1.094134e+000, -1.075586e+000, -2.077415e-001, 1.171477e+000, 1.793270e+001, -4.656858e+000, -1.036839e+000, 3.338295e-001, 1.042793e+000, 5.739374e-001, // albedo 1, turbidity 9 -1.465871e+000, -6.364486e-001, -8.833718e+000, 9.343650e+000, -3.223600e-002, 7.552848e-001, -3.121341e-006, 2.249164e+000, 8.094662e-001, -2.448924e+000, -1.270878e+000, -4.823703e+000, 5.853058e+000, -2.149127e-002, 3.581132e-002, -1.230276e-003, 4.892553e-001, -1.597657e-001, -2.419809e+000, -1.071337e+000, 1.575648e+000, -4.983580e+000, 9.545185e-003, 5.032615e-001, 4.186266e-001, 4.634147e+000, 1.433517e+000, -1.383278e-001, -2.797095e-002, -1.943067e-001, 6.679623e+000, 4.118280e-001, -2.744289e-001, -2.118722e-002, -4.337025e+000, 1.505072e-001, -1.341872e+000, -2.518572e-001, 1.027009e+000, -6.527103e+000, -1.081271e+000, 1.015465e+000, 2.845789e-001, 2.470371e+000, 9.278120e-001, -1.040640e+000, -2.367454e-001, 1.100744e+000, 8.827253e+000, -4.560794e+000, -7.287017e-001, 2.842503e-001, 6.336593e-001, 6.327335e-001, // albedo 1, turbidity 10 -1.877993e+000, -1.025135e+000, -4.311037e+000, 4.715016e+000, -4.711631e-002, 6.335844e-001, -7.665398e-006, 1.788017e+000, 9.001409e-001, -2.281540e+000, -1.137668e+000, -1.036869e+001, 1.136254e+001, 1.961739e-002, -9.836174e-002, -6.734567e-003, 1.320918e+000, -2.400807e-001, -4.904054e+000, -2.315781e+000, 5.735999e+000, -8.626257e+000, -1.255643e-001, 1.545446e+000, 1.396860e-001, 2.972897e+000, 1.429934e+000, 4.077067e-001, -1.833688e-001, -2.450939e+000, 9.119433e+000, 4.505361e-001, -1.340828e+000, 3.973690e-001, -1.785370e+000, 9.628711e-002, -1.296052e+000, -3.250526e-001, 1.813294e+000, -1.031485e+001, -1.388690e+000, 1.239733e+000, -8.989196e-002, -3.389637e-001, 9.639560e-001, -1.062181e+000, -2.423444e-001, 7.577592e-001, 1.566938e+001, -4.462264e+000, -5.742810e-001, 3.262259e-001, 9.461672e-001, 6.232887e-001, }; static const double datasetXYZRad1[] = { // albedo 0, turbidity 1 1.560219e+000, 1.417388e+000, 1.206927e+000, 1.091949e+001, 5.931416e+000, 7.304788e+000, // albedo 0, turbidity 2 1.533049e+000, 1.560532e+000, 3.685059e-001, 1.355040e+001, 5.543711e+000, 7.792189e+000, // albedo 0, turbidity 3 1.471043e+000, 1.746088e+000, -9.299697e-001, 1.720362e+001, 5.473384e+000, 8.336416e+000, // albedo 0, turbidity 4 1.355991e+000, 2.109348e+000, -3.295855e+000, 2.264843e+001, 5.454607e+000, 9.304656e+000, // albedo 0, turbidity 5 1.244963e+000, 2.547533e+000, -5.841485e+000, 2.756879e+001, 5.576104e+000, 1.043287e+001, // albedo 0, turbidity 6 1.175532e+000, 2.784634e+000, -7.212225e+000, 2.975347e+001, 6.472980e+000, 1.092331e+001, // albedo 0, turbidity 7 1.082973e+000, 3.118094e+000, -8.934293e+000, 3.186879e+001, 8.473885e+000, 1.174019e+001, // albedo 0, turbidity 8 9.692500e-001, 3.349574e+000, -1.003810e+001, 3.147654e+001, 1.338931e+001, 1.272547e+001, // albedo 0, turbidity 9 8.547044e-001, 3.151538e+000, -9.095567e+000, 2.554995e+001, 2.273219e+001, 1.410398e+001, // albedo 0, turbidity 10 7.580340e-001, 2.311153e+000, -5.170814e+000, 1.229669e+001, 3.686529e+001, 1.598882e+001, // albedo 1, turbidity 1 1.664273e+000, 1.574468e+000, 1.422078e+000, 9.768247e+000, 1.447338e+001, 1.644988e+001, // albedo 1, turbidity 2 1.638295e+000, 1.719586e+000, 5.786675e-001, 1.239846e+001, 1.415419e+001, 1.728605e+001, // albedo 1, turbidity 3 1.572623e+000, 1.921559e+000, -7.714802e-001, 1.609246e+001, 1.420954e+001, 1.825908e+001, // albedo 1, turbidity 4 1.468395e+000, 2.211970e+000, -2.845869e+000, 2.075027e+001, 1.524822e+001, 1.937622e+001, // albedo 1, turbidity 5 1.355047e+000, 2.556469e+000, -4.960920e+000, 2.460237e+001, 1.648360e+001, 2.065648e+001, // albedo 1, turbidity 6 1.291642e+000, 2.742036e+000, -6.061967e+000, 2.602002e+001, 1.819144e+001, 2.116712e+001, // albedo 1, turbidity 7 1.194565e+000, 2.972120e+000, -7.295779e+000, 2.691805e+001, 2.124880e+001, 2.201819e+001, // albedo 1, turbidity 8 1.083631e+000, 3.047021e+000, -7.766096e+000, 2.496261e+001, 2.744264e+001, 2.291875e+001, // albedo 1, turbidity 9 9.707994e-001, 2.736459e+000, -6.308284e+000, 1.760860e+001, 3.776291e+001, 2.392150e+001, // albedo 1, turbidity 10 8.574294e-001, 1.865155e+000, -2.364707e+000, 4.337793e+000, 5.092831e+001, 2.523432e+001, }; static const double datasetXYZ2[] = { // albedo 0, turbidity 1 -1.127942e+000, -1.905548e-001, -1.252356e+001, 1.375799e+001, -3.624732e-002, 1.055453e+000, 1.385036e-002, 4.176970e+000, 5.928345e-001, -1.155260e+000, -1.778135e-001, 6.216056e+000, -5.254116e+000, -8.787445e-002, 8.434621e-001, 4.025734e-002, 6.195322e+000, 3.111856e-001, -1.125624e+000, -3.217593e-001, 5.043919e-001, 1.686284e+000, -3.536071e-001, 1.476321e+000, -7.899019e-002, -4.522531e+000, 1.271691e+000, -1.081801e+000, -1.033234e-001, 9.995550e-001, 7.482946e-003, -6.776018e-002, 1.463141e+000, 9.492021e-002, 5.612723e+000, 1.298846e-001, -1.075320e+000, -2.402711e-001, 2.141284e+000, -1.203359e+000, -4.945188e+000, 1.437221e+000, -8.096750e-002, -1.028378e+000, 1.004164e+000, -1.073337e+000, -1.516517e-001, 1.639379e+000, 2.304669e+000, -3.214244e+000, 1.286245e+000, 5.613957e-002, 2.480902e+000, 4.999363e-001, // albedo 0, turbidity 2 -1.128399e+000, -1.857793e-001, -1.089863e+001, 1.172984e+001, -3.768099e-002, 9.439285e-001, 4.869335e-002, 4.845114e+000, 6.119211e-001, -1.114002e+000, -1.399280e-001, 4.963800e+000, -4.685500e+000, -7.780879e-002, 4.049736e-001, 1.586297e-001, 7.770264e+000, 3.449006e-001, -1.185472e+000, -3.403543e-001, 6.588322e-001, 1.133713e+000, -4.118674e-001, 2.061191e+000, -1.882768e-001, -4.372586e+000, 1.223530e+000, -1.002272e+000, 2.000703e-002, 7.073269e-002, 1.485075e+000, 5.005589e-001, 4.301494e-001, 3.626541e-001, 7.921098e+000, 1.574766e-001, -1.121006e+000, -3.007777e-001, 2.242051e+000, -4.571561e+000, -7.761071e+000, 2.053404e+000, -1.524018e-001, -1.886162e+000, 1.018208e+000, -1.058864e+000, -1.358673e-001, 1.389667e+000, 8.633409e+000, -3.437249e+000, 7.295429e-001, 1.514700e-001, 2.842513e+000, 5.014325e-001, // albedo 0, turbidity 3 -1.144464e+000, -2.043799e-001, -1.020188e+001, 1.071247e+001, -3.256693e-002, 7.860205e-001, 6.872719e-002, 4.824771e+000, 6.259836e-001, -1.170104e+000, -2.118626e-001, 4.391405e+000, -4.198900e+000, -7.111559e-002, 3.890442e-001, 1.024831e-001, 6.282535e+000, 5.365688e-001, -1.129171e+000, -2.552880e-001, 2.238298e-001, 7.314295e-001, -3.562730e-001, 1.881931e+000, -3.078716e-002, -1.039120e+000, 9.096301e-001, -1.042294e+000, 4.450203e-003, -5.116033e-001, 2.627589e+000, 6.098996e-001, -1.264638e-001, 4.325281e-001, 7.080503e+000, 4.583646e-001, -1.082293e+000, -2.723056e-001, 2.065076e+000, -8.143133e+000, -7.892212e+000, 2.142231e+000, -7.106240e-002, -1.122398e+000, 8.338505e-001, -1.071715e+000, -1.426568e-001, 1.095351e+000, 1.729783e+001, -3.851931e+000, 4.360514e-001, 2.114440e-001, 2.970832e+000, 5.944389e-001, // albedo 0, turbidity 4 -1.195909e+000, -2.590449e-001, -1.191037e+001, 1.207947e+001, -1.589842e-002, 6.297846e-001, 9.054772e-002, 4.285959e+000, 5.933752e-001, -1.245763e+000, -3.316637e-001, 4.293660e+000, -3.694011e+000, -4.699947e-002, 4.843684e-001, 2.130425e-002, 4.097549e+000, 6.530809e-001, -1.148742e+000, -1.902509e-001, -2.393233e-001, -2.441254e-001, -2.610918e-001, 1.846988e+000, 3.532866e-002, 2.660106e+000, 8.358294e-001, -1.016080e+000, -7.444960e-002, -5.053436e-001, 4.388855e+000, 6.054987e-001, -1.208300e+000, 5.817215e-001, 2.543570e+000, 4.726568e-001, -1.072027e+000, -2.101440e-001, 1.518378e+000, -1.060119e+001, -6.016546e+000, 2.649475e+000, -5.166992e-002, 1.571269e+000, 8.344622e-001, -1.072365e+000, -1.511201e-001, 7.478010e-001, 1.900732e+001, -3.950387e+000, -3.473907e-001, 3.797211e-001, 2.782949e+000, 6.296808e-001, // albedo 0, turbidity 5 -1.239423e+000, -3.136289e-001, -1.351100e+001, 1.349468e+001, -7.070423e-003, 5.012315e-001, 1.106008e-001, 3.803619e+000, 5.577948e-001, -1.452524e+000, -5.676944e-001, 2.993153e+000, -2.277288e+000, -2.168954e-002, 3.056720e-001, 1.152338e-002, 1.852697e+000, 6.427228e-001, -1.061421e+000, -4.590521e-002, 6.057022e-001, -1.096835e+000, -1.504952e-001, 2.344921e+000, -5.491832e-002, 5.268322e+000, 9.082253e-001, -1.042373e+000, -1.769498e-001, -1.075388e+000, 3.831712e+000, 3.154140e-001, -2.416458e+000, 7.909032e-001, -1.492892e-002, 3.854049e-001, -1.064159e+000, -1.892684e-001, 1.438685e+000, -8.166362e+000, -3.616364e+000, 3.275206e+000, -1.203825e-001, 2.039491e+000, 8.688057e-001, -1.070120e+000, -1.569508e-001, 4.124760e-001, 1.399683e+001, -3.547085e+000, -1.046326e+000, 4.973825e-001, 2.791231e+000, 6.503286e-001, // albedo 0, turbidity 6 -1.283579e+000, -3.609518e-001, -1.335397e+001, 1.315248e+001, -4.431938e-004, 3.769526e-001, 1.429824e-001, 3.573613e+000, 4.998696e-001, -1.657952e+000, -7.627948e-001, 1.958222e+000, -7.949816e-001, -2.882837e-002, 5.356149e-001, -5.191946e-002, 8.869955e-001, 6.263320e-001, -9.527600e-001, 6.494189e-002, 5.361303e-001, -2.129590e+000, -9.258630e-002, 1.604776e+000, 5.067770e-002, 6.376055e+000, 9.138052e-001, -1.080827e+000, -2.523120e-001, -7.154262e-001, 4.120085e+000, 1.878228e-001, -1.492158e+000, 6.881655e-001, -1.446611e+000, 4.040631e-001, -1.054075e+000, -1.665498e-001, 9.191052e-001, -6.636943e+000, -1.894826e+000, 2.107810e+000, -3.680499e-002, 2.655452e+000, 8.413840e-001, -1.061127e+000, -1.448849e-001, 2.667493e-001, 1.034103e+001, -4.285769e+000, -3.874504e-001, 5.998752e-001, 3.132426e+000, 6.652753e-001, // albedo 0, turbidity 7 -1.347345e+000, -4.287832e-001, -9.305553e+000, 9.133813e+000, -3.173527e-003, 3.977564e-001, 1.151420e-001, 3.320564e+000, 4.998134e-001, -1.927296e+000, -9.901372e-001, -2.593499e+000, 4.087421e+000, -5.833993e-002, 8.158929e-001, -4.681279e-002, 2.423716e-001, 4.938052e-001, -9.470092e-001, 7.325237e-002, 2.064735e+000, -5.167540e+000, -1.313751e-002, 4.832169e-001, 1.126295e-001, 6.970522e+000, 1.035022e+000, -1.022557e+000, -2.762616e-001, -9.375748e-001, 6.696739e+000, 2.200765e-001, -1.133253e-001, 5.492505e-001, -3.109391e+000, 3.321914e-001, -1.087444e+000, -1.836263e-001, 6.225024e-001, -8.576765e+000, -1.107637e+000, 7.859427e-001, 9.910909e-002, 3.112938e+000, 8.596261e-001, -1.051544e+000, -1.546262e-001, 2.371731e-001, 1.200502e+001, -4.527291e+000, 7.268862e-002, 5.571478e-001, 2.532873e+000, 6.662000e-001, // albedo 0, turbidity 8 -1.375576e+000, -4.840019e-001, -8.121290e+000, 8.058140e+000, -1.445661e-002, 5.123314e-001, 5.813321e-002, 3.203219e+000, 5.442318e-001, -2.325221e+000, -1.241463e+000, -7.063430e+000, 8.741369e+000, -7.829950e-002, 8.844273e-001, -3.471106e-002, 1.740583e-001, 2.814079e-001, -1.228700e+000, -2.013412e-001, 2.949042e+000, -7.371945e+000, 1.071753e-001, -2.491970e-001, 2.265223e-001, 6.391504e+000, 1.172389e+000, -7.601786e-001, -1.680631e-001, -7.584444e-001, 8.541356e+000, 8.222291e-002, 6.729633e-001, 3.206615e-001, -3.700940e+000, 2.710054e-001, -1.191166e+000, -2.672347e-001, 2.927498e-001, -9.713613e+000, -4.783721e-001, 2.352803e-001, 2.161949e-001, 2.691481e+000, 8.745447e-001, -1.030135e+000, -1.653301e-001, 2.263443e-001, 1.296157e+001, -4.650644e+000, 7.055709e-003, 5.091975e-001, 2.000370e+000, 6.603839e-001, // albedo 0, turbidity 9 -1.508018e+000, -6.460933e-001, -6.402745e+000, 6.545995e+000, -3.750320e-002, 6.921803e-001, 3.309819e-003, 2.797527e+000, 6.978446e-001, -2.333308e+000, -1.167837e+000, -1.746787e+001, 1.868630e+001, -8.948229e-003, 5.621946e-001, -3.402626e-002, 1.217943e+000, 1.149865e-002, -2.665953e+000, -1.226307e+000, 7.169725e+000, -1.159434e+001, 3.583420e-002, -3.074378e-001, 3.412248e-001, 4.422122e+000, 1.283791e+000, -9.705116e-002, 8.312991e-002, -2.160462e+000, 1.028235e+001, 3.543357e-002, 1.032049e+000, 1.058310e-001, -2.972898e+000, 2.418628e-001, -1.329617e+000, -3.699557e-001, 5.560117e-001, -9.730113e+000, 9.938865e-002, -3.071488e-001, 2.510691e-001, 1.777111e+000, 8.705142e-001, -1.019387e+000, -1.893247e-001, 1.194079e-001, 1.239436e+001, -4.799224e+000, 2.940213e-001, 4.841268e-001, 1.529724e+000, 6.582615e-001, // albedo 0, turbidity 10 -1.896737e+000, -1.005442e+000, -6.411032e+000, 6.548220e+000, -3.227596e-002, 5.717262e-001, -8.115192e-006, 2.296704e+000, 9.000749e-001, -2.411116e+000, -1.225587e+000, -1.753629e+001, 1.829393e+001, 1.247555e-002, 2.364616e-001, -5.114637e-003, 1.603778e+000, -2.224156e-001, -4.707121e+000, -2.074977e+000, 7.942300e+000, -1.132407e+001, -5.415654e-002, 5.446811e-001, 1.032493e-001, 4.010235e+000, 1.369802e+000, 1.010482e-001, -4.013305e-001, -2.674579e+000, 9.779409e+000, 1.782506e-001, 7.053045e-001, 4.200002e-001, -2.400671e+000, 1.953165e-001, -1.243526e+000, -3.391255e-001, 8.848882e-001, -9.789025e+000, -3.997324e-001, -9.546227e-001, -1.044017e-001, 6.010593e-001, 8.714462e-001, -1.014633e+000, -1.730009e-001, -7.738934e-002, 1.390903e+001, -4.847307e+000, 1.076059e+000, 5.685743e-001, 1.572992e+000, 6.561432e-001, // albedo 1, turbidity 1 -1.122998e+000, -1.881183e-001, -1.030709e+001, 1.158932e+001, -4.079495e-002, 9.603774e-001, 3.079436e-002, 4.009235e+000, 5.060745e-001, -1.134790e+000, -1.539688e-001, 5.478405e+000, -4.217270e+000, -1.043858e-001, 7.165008e-001, 1.524765e-002, 6.473623e+000, 4.207882e-001, -1.134957e+000, -3.513318e-001, 7.393837e-001, 1.354415e+000, -4.764078e-001, 1.690441e+000, -5.492640e-002, -5.563523e+000, 1.145743e+000, -1.058344e+000, -5.758503e-002, 1.168230e+000, 3.269824e-001, 1.795193e-001, 7.849011e-001, 7.441853e-002, 6.904804e+000, 2.818790e-001, -1.075194e+000, -2.355813e-001, 2.463685e+000, -1.536505e+000, -7.505771e+000, 9.619712e-001, -6.465851e-002, -1.355492e+000, 8.489847e-001, -1.079030e+000, -1.465328e-001, 1.773838e+000, 2.310131e+000, -3.136065e+000, 3.507952e-001, 4.435014e-002, 2.819225e+000, 5.689008e-001, // albedo 1, turbidity 2 -1.125833e+000, -1.870849e-001, -9.555833e+000, 1.059713e+001, -4.225402e-002, 9.164663e-001, 4.338796e-002, 4.400980e+000, 6.056119e-001, -1.127440e+000, -1.551891e-001, 4.755621e+000, -4.408806e+000, -7.851763e-002, 2.268284e-001, 1.460070e-001, 7.048003e+000, 3.525997e-001, -1.143788e+000, -3.170178e-001, 5.480669e-001, 2.041830e+000, -4.532139e-001, 2.302233e+000, -1.887419e-001, -4.489221e+000, 1.250967e+000, -1.032849e+000, 7.376031e-003, 5.666073e-001, -2.312203e-001, 4.862894e-001, -1.748294e-001, 3.572870e-001, 8.380522e+000, 1.302333e-001, -1.093728e+000, -2.786977e-001, 2.641272e+000, -1.507494e+000, -8.731243e+000, 1.684055e+000, -2.023377e-001, -2.176398e+000, 1.013249e+000, -1.076578e+000, -1.456205e-001, 1.693935e+000, 2.945003e+000, -2.822673e+000, -2.520033e-001, 1.517034e-001, 2.649109e+000, 5.179094e-001, // albedo 1, turbidity 3 -1.146417e+000, -2.119353e-001, -7.187525e+000, 8.058599e+000, -5.256438e-002, 8.375733e-001, 3.887093e-002, 4.222111e+000, 6.695347e-001, -1.173674e+000, -2.067025e-001, 2.899359e+000, -2.804918e+000, -8.473899e-002, 3.944225e-003, 1.340641e-001, 6.160887e+000, 4.527141e-001, -1.090098e+000, -2.599633e-001, 9.180856e-001, 1.092710e+000, -4.215019e-001, 2.427660e+000, -9.277667e-002, -2.123523e+000, 1.058159e+000, -1.084460e+000, 8.056181e-003, -2.453510e-001, 6.619567e-001, 4.668118e-001, -9.526719e-001, 4.648454e-001, 8.001572e+000, 3.054194e-001, -1.053728e+000, -2.765784e-001, 2.792388e+000, -3.489517e+000, -8.150535e+000, 2.195757e+000, -2.017234e-001, -2.128017e+000, 9.326589e-001, -1.099348e+000, -1.593939e-001, 1.568292e+000, 7.247853e+000, -2.933000e+000, -5.890481e-001, 1.724440e-001, 2.433484e+000, 5.736558e-001, // albedo 1, turbidity 4 -1.185983e+000, -2.581184e-001, -7.761056e+000, 8.317053e+000, -3.351773e-002, 6.676667e-001, 5.941733e-002, 3.820727e+000, 6.324032e-001, -1.268591e+000, -3.398067e-001, 2.348503e+000, -2.023779e+000, -5.368458e-002, 1.083282e-001, 8.402858e-002, 3.910254e+000, 5.577481e-001, -1.071353e+000, -1.992459e-001, 7.878387e-001, 1.974702e-001, -3.033058e-001, 2.335298e+000, -8.205259e-002, 7.954454e-001, 9.972312e-001, -1.089513e+000, -3.104364e-002, -5.995746e-001, 2.330281e+000, 6.581939e-001, -1.821467e+000, 6.679973e-001, 5.090195e+000, 3.125161e-001, -1.040214e+000, -2.570934e-001, 2.660489e+000, -6.506045e+000, -7.053586e+000, 2.763153e+000, -2.433632e-001, -7.648176e-001, 9.452937e-001, -1.116052e+000, -1.831993e-001, 1.457694e+000, 1.163608e+001, -3.216426e+000, -1.045594e+000, 2.285002e-001, 1.817407e+000, 5.810396e-001, // albedo 1, turbidity 5 -1.230134e+000, -3.136264e-001, -8.909301e+000, 9.145006e+000, -1.055387e-002, 4.467317e-001, 1.016826e-001, 3.342964e+000, 5.633840e-001, -1.442907e+000, -5.593147e-001, 2.156447e+000, -1.241657e+000, -3.512130e-002, 3.050274e-001, 1.797175e-002, 1.742358e+000, 5.977153e-001, -1.027627e+000, -6.481539e-002, 4.351975e-001, -1.051677e+000, -2.030672e-001, 1.942684e+000, -3.615993e-002, 4.050266e+000, 9.801624e-001, -1.082110e+000, -1.578209e-001, -3.397511e-001, 4.163851e+000, 6.650368e-001, -1.841730e+000, 7.062544e-001, 6.789881e-001, 3.172623e-001, -1.047447e+000, -1.977560e-001, 2.183364e+000, -8.805249e+000, -5.483962e+000, 2.551309e+000, -1.779640e-001, 1.519501e+000, 9.212536e-001, -1.111853e+000, -1.935736e-001, 1.394408e+000, 1.392405e+001, -3.465430e+000, -1.068432e+000, 2.388671e-001, 1.455336e+000, 6.233425e-001, // albedo 1, turbidity 6 -1.262238e+000, -3.546341e-001, -1.008703e+001, 1.020084e+001, -1.852187e-003, 3.537580e-001, 1.239199e-001, 3.056093e+000, 5.132052e-001, -1.613810e+000, -7.355585e-001, 2.760123e+000, -1.685253e+000, -2.517552e-002, 2.914258e-001, 4.743448e-003, 8.689596e-001, 5.674192e-001, -9.462336e-001, 2.950767e-002, -2.613816e-001, -7.398653e-001, -1.315558e-001, 1.901042e+000, -6.447844e-002, 4.969341e+000, 1.027342e+000, -1.111481e+000, -2.194054e-001, -9.004538e-002, 3.983442e+000, 4.871278e-001, -1.965315e+000, 7.956121e-001, -2.363225e-001, 2.718037e-001, -1.036397e+000, -1.827106e-001, 1.964747e+000, -8.870759e+000, -4.208011e+000, 2.461215e+000, -2.158905e-001, 1.561676e+000, 9.436866e-001, -1.113769e+000, -1.947819e-001, 1.300720e+000, 1.516476e+001, -4.088732e+000, -1.069384e+000, 2.836434e-001, 1.671451e+000, 6.229612e-001, // albedo 1, turbidity 7 -1.328069e+000, -4.244047e-001, -8.417040e+000, 8.552244e+000, -6.813504e-003, 4.127422e-001, 9.619897e-002, 2.854227e+000, 5.059880e-001, -1.927552e+000, -1.025290e+000, 9.529576e-001, 4.255950e-001, -3.738779e-002, 2.584586e-001, 4.911004e-002, -2.640913e-001, 4.138626e-001, -8.488094e-001, 1.435988e-001, 6.356807e-001, -2.895732e+000, -8.473961e-002, 1.701305e+000, -1.323908e-001, 6.499338e+000, 1.210928e+000, -1.128313e+000, -3.397048e-001, -4.043140e-001, 6.265097e+000, 5.482395e-001, -2.057614e+000, 8.884087e-001, -2.943879e+000, 9.760301e-002, -1.039764e+000, -1.494772e-001, 1.781915e+000, -1.153012e+001, -3.379232e+000, 2.517231e+000, -2.764393e-001, 2.588849e+000, 1.052120e+000, -1.108447e+000, -2.012251e-001, 1.198640e+000, 1.925331e+001, -4.423892e+000, -1.257122e+000, 3.395690e-001, 1.481220e+000, 5.880175e-001, // albedo 1, turbidity 8 -1.374185e+000, -4.967434e-001, -7.401318e+000, 7.724021e+000, -2.345723e-002, 5.979653e-001, 2.436346e-002, 2.658970e+000, 6.014891e-001, -2.310933e+000, -1.290290e+000, -1.301909e+000, 2.557806e+000, -3.744449e-002, 8.982861e-002, 1.090613e-001, -4.398363e-001, 1.184329e-001, -1.124730e+000, -9.921830e-002, 1.366902e+000, -4.172489e+000, -5.078016e-002, 1.393597e+000, -9.323843e-002, 6.452721e+000, 1.435913e+000, -8.468477e-001, -2.744819e-001, -4.347200e-001, 6.713362e+000, 6.127133e-001, -1.685634e+000, 7.360941e-001, -4.535502e+000, -2.920866e-002, -1.165242e+000, -2.008697e-001, 1.438778e+000, -1.008936e+001, -2.214771e+000, 2.102909e+000, -1.763085e-001, 2.859075e+000, 1.093470e+000, -1.074614e+000, -2.066374e-001, 1.131891e+000, 1.630063e+001, -4.801441e+000, -1.112590e+000, 3.595785e-001, 1.122227e+000, 5.794610e-001, // albedo 1, turbidity 9 -1.521515e+000, -6.835604e-001, -5.571044e+000, 6.028774e+000, -4.253715e-002, 6.875746e-001, -5.279456e-006, 2.180150e+000, 8.487705e-001, -2.240415e+000, -1.171166e+000, -7.182771e+000, 8.417068e+000, -1.932866e-002, 1.101887e-001, -1.098862e-002, 6.242195e-001, -2.393875e-001, -2.712354e+000, -1.198830e+000, 3.180200e+000, -6.768130e+000, -2.563386e-003, 7.984607e-001, 2.764376e-001, 4.695358e+000, 1.557045e+000, -3.655172e-002, -2.142321e-002, -9.138120e-001, 7.932786e+000, 3.516542e-001, -7.994343e-001, 1.786761e-001, -4.208399e+000, 1.820576e-002, -1.368610e+000, -2.656212e-001, 1.249397e+000, -8.317818e+000, -8.962772e-001, 1.423249e+000, 1.478381e-001, 2.191660e+000, 1.007748e+000, -1.041753e+000, -2.453366e-001, 1.061102e+000, 1.130172e+001, -4.739312e+000, -9.223334e-001, 2.982776e-001, 6.162931e-001, 6.080302e-001, // albedo 1, turbidity 10 -1.989159e+000, -1.095160e+000, -2.915550e+000, 3.275339e+000, -5.735765e-002, 5.742174e-001, -7.683288e-006, 1.763400e+000, 9.001342e-001, -2.070020e+000, -1.086338e+000, -1.095898e+001, 1.206960e+001, 3.780123e-002, -1.774699e-002, -5.881348e-004, 1.333819e+000, -2.605423e-001, -5.249653e+000, -2.383040e+000, 6.160406e+000, -9.097138e+000, -1.955319e-001, 1.651785e+000, 6.016463e-004, 3.021824e+000, 1.493574e+000, 4.685432e-001, -2.358662e-001, -2.666433e+000, 9.685763e+000, 5.804928e-001, -1.521875e+000, 5.668989e-001, -1.548136e+000, 1.688642e-002, -1.296891e+000, -3.449031e-001, 1.928548e+000, -1.167560e+001, -1.627615e+000, 1.355603e+000, -1.929074e-001, -6.568952e-001, 1.009774e+000, -1.067288e+000, -2.410392e-001, 7.147961e-001, 1.783840e+001, -4.374399e+000, -6.588777e-001, 3.329831e-001, 1.012066e+000, 6.118645e-001, }; static const double datasetXYZRad2[] = { // albedo 0, turbidity 1 1.632341e+000, 1.395230e+000, 1.375634e+000, 1.238193e+001, 5.921102e+000, 7.766508e+000, // albedo 0, turbidity 2 1.597115e+000, 1.554617e+000, 3.932382e-001, 1.505284e+001, 5.725234e+000, 8.158155e+000, // albedo 0, turbidity 3 1.522034e+000, 1.844545e+000, -1.322862e+000, 1.918382e+001, 5.440769e+000, 8.837119e+000, // albedo 0, turbidity 4 1.403048e+000, 2.290852e+000, -4.013792e+000, 2.485100e+001, 5.521888e+000, 9.845547e+000, // albedo 0, turbidity 5 1.286364e+000, 2.774498e+000, -6.648221e+000, 2.964151e+001, 5.923777e+000, 1.097075e+001, // albedo 0, turbidity 6 1.213544e+000, 3.040195e+000, -8.092676e+000, 3.186082e+001, 6.789782e+000, 1.158899e+001, // albedo 0, turbidity 7 1.122622e+000, 3.347465e+000, -9.649016e+000, 3.343824e+001, 9.347715e+000, 1.231374e+001, // albedo 0, turbidity 8 1.007356e+000, 3.543858e+000, -1.053520e+001, 3.239842e+001, 1.483962e+001, 1.331718e+001, // albedo 0, turbidity 9 8.956642e-001, 3.278700e+000, -9.254933e+000, 2.557923e+001, 2.489677e+001, 1.476166e+001, // albedo 0, turbidity 10 7.985143e-001, 2.340404e+000, -4.928274e+000, 1.141787e+001, 3.961501e+001, 1.682448e+001, // albedo 1, turbidity 1 1.745162e+000, 1.639467e+000, 1.342721e+000, 1.166033e+001, 1.490124e+001, 1.774031e+001, // albedo 1, turbidity 2 1.708439e+000, 1.819144e+000, 2.834399e-001, 1.448066e+001, 1.459214e+001, 1.858679e+001, // albedo 1, turbidity 3 1.631720e+000, 2.094799e+000, -1.378825e+000, 1.843198e+001, 1.463173e+001, 1.962881e+001, // albedo 1, turbidity 4 1.516536e+000, 2.438729e+000, -3.624121e+000, 2.298621e+001, 1.599782e+001, 2.070027e+001, // albedo 1, turbidity 5 1.405863e+000, 2.785191e+000, -5.705236e+000, 2.645121e+001, 1.768330e+001, 2.191903e+001, // albedo 1, turbidity 6 1.344052e+000, 2.951807e+000, -6.683851e+000, 2.744271e+001, 1.985706e+001, 2.229452e+001, // albedo 1, turbidity 7 1.245827e+000, 3.182923e+000, -7.822960e+000, 2.791395e+001, 2.327254e+001, 2.315910e+001, // albedo 1, turbidity 8 1.132305e+000, 3.202593e+000, -8.008429e+000, 2.521093e+001, 3.000014e+001, 2.405306e+001, // albedo 1, turbidity 9 1.020330e+000, 2.820556e+000, -6.238704e+000, 1.709276e+001, 4.077916e+001, 2.509949e+001, // albedo 1, turbidity 10 9.031570e-001, 1.863917e+000, -1.955738e+000, 3.032665e+000, 5.434290e+001, 2.641780e+001, }; static const double datasetXYZ3[] = { // albedo 0, turbidity 1 -1.310023e+000, -4.407658e-001, -3.640340e+001, 3.683292e+001, -8.124762e-003, 5.297961e-001, 1.188633e-002, 3.138320e+000, 5.134778e-001, -1.424100e+000, -5.501606e-001, -1.753510e+001, 1.822769e+001, -1.539272e-002, 6.366826e-001, 2.661996e-003, 2.659915e+000, 4.071138e-001, -1.103436e+000, -1.884105e-001, 6.425322e+000, -6.910579e+000, -2.019861e-002, 3.553271e-001, -1.589061e-002, 5.345985e+000, 8.790218e-001, -1.186200e+000, -4.307514e-001, -3.957947e+000, 5.979352e+000, -5.348869e-002, 1.736117e+000, 3.491346e-002, -2.692261e+000, 5.610506e-001, -1.006038e+000, -1.305995e-001, 4.473513e+000, -3.806719e+000, 1.419407e-001, -2.148238e-002, -5.081185e-002, 3.735362e+000, 5.358280e-001, -1.078507e+000, -1.633754e-001, -3.812368e+000, 4.381700e+000, 2.988122e-002, 1.754224e+000, 1.472376e-001, 3.722798e+000, 4.999157e-001, // albedo 0, turbidity 2 -1.333582e+000, -4.649908e-001, -3.359528e+001, 3.404375e+001, -9.384242e-003, 5.587511e-001, 5.726310e-003, 3.073145e+000, 5.425529e-001, -1.562624e+000, -7.107068e-001, -1.478170e+001, 1.559839e+001, -1.462375e-002, 5.050133e-001, 2.516017e-002, 1.604696e+000, 2.902403e-001, -8.930158e-001, 4.068077e-002, 1.373481e+000, -2.342752e+000, -2.098058e-002, 6.248686e-001, -5.258363e-002, 7.058214e+000, 1.150373e+000, -1.262823e+000, -4.818353e-001, 8.892610e-004, 1.923120e+000, -4.979718e-002, 1.040693e+000, 1.558103e-001, -2.852480e+000, 2.420691e-001, -9.968383e-001, -1.200648e-001, 1.324342e+000, -9.430889e-001, 1.931098e-001, 4.436916e-001, -7.320456e-002, 4.215931e+000, 7.898019e-001, -1.078185e+000, -1.718192e-001, -1.720191e+000, 2.358918e+000, 2.765637e-002, 1.260245e+000, 2.021941e-001, 3.395483e+000, 5.173628e-001, // albedo 0, turbidity 3 -1.353023e+000, -4.813523e-001, -3.104920e+001, 3.140156e+001, -9.510741e-003, 5.542030e-001, 8.135471e-003, 3.136646e+000, 5.215989e-001, -1.624704e+000, -7.990201e-001, -2.167125e+001, 2.246341e+001, -1.163533e-002, 5.415746e-001, 2.618378e-002, 1.139214e+000, 3.444357e-001, -7.983610e-001, 1.417476e-001, 9.914841e+000, -1.081503e+001, -1.218845e-002, 3.411392e-001, -6.137698e-002, 7.445848e+000, 1.180080e+000, -1.266679e+000, -4.288977e-001, -5.818701e+000, 6.986437e+000, -8.180711e-002, 1.397403e+000, 2.016916e-001, -1.275731e+000, 2.592773e-001, -1.009707e+000, -1.537754e-001, 3.496378e+000, -3.013726e+000, 2.421150e-001, -2.831925e-001, 3.003395e-002, 3.702862e+000, 7.746320e-001, -1.075646e+000, -1.768747e-001, -1.347762e+000, 1.989004e+000, 1.375836e-002, 1.764810e+000, 1.330018e-001, 3.230864e+000, 6.626210e-001, // albedo 0, turbidity 4 -1.375269e+000, -5.103569e-001, -3.442661e+001, 3.478703e+001, -8.460009e-003, 5.408643e-001, 4.813323e-003, 3.016078e+000, 5.062069e-001, -1.821679e+000, -9.766461e-001, -1.926488e+001, 1.997912e+001, -9.822567e-003, 3.649556e-001, 4.316092e-002, 8.930190e-001, 4.166527e-001, -6.633542e-001, 1.997841e-001, 2.395592e+000, -3.117175e+000, -1.080884e-002, 8.983814e-001, -1.375825e-001, 6.673463e+000, 1.115663e+000, -1.303240e+000, -3.612712e-001, 8.292959e-002, 3.381364e-001, -6.078648e-002, 3.229247e-001, 3.680987e-001, 7.046755e-001, 3.144924e-001, -9.952598e-001, -2.039076e-001, 4.026851e-001, 2.686684e-001, 1.640712e-001, 5.186341e-001, -1.205520e-002, 2.659613e+000, 8.030394e-001, -1.098579e+000, -2.151992e-001, 6.558198e-001, -7.436900e-004, -1.421817e-003, 1.073701e+000, 1.886875e-001, 2.536857e+000, 6.673923e-001, // albedo 0, turbidity 5 -1.457986e+000, -5.906842e-001, -3.812464e+001, 3.838539e+001, -6.024357e-003, 4.741484e-001, 1.209223e-002, 2.818432e+000, 5.012433e-001, -1.835728e+000, -1.003405e+000, -6.848129e+000, 7.601943e+000, -1.277375e-002, 4.785598e-001, 3.366853e-002, 1.097701e+000, 4.636635e-001, -8.491348e-001, 9.466365e-003, -2.685226e+000, 2.004060e+000, -1.168708e-002, 6.752316e-001, -1.543371e-001, 5.674759e+000, 1.039534e+000, -1.083379e+000, -1.506790e-001, 7.328236e-001, -5.095568e-001, -8.609153e-002, 4.448820e-001, 4.174662e-001, 1.481556e+000, 3.942551e-001, -1.117089e+000, -3.337605e-001, 2.502281e-001, 4.036323e-001, 2.673899e-001, 2.829817e-001, 2.242450e-002, 2.043207e+000, 7.706902e-001, -1.071648e+000, -2.126200e-001, 6.069466e-001, -1.456290e-003, -5.515960e-001, 1.046755e+000, 1.985021e-001, 2.290245e+000, 6.876058e-001, // albedo 0, turbidity 6 -1.483903e+000, -6.309647e-001, -4.380213e+001, 4.410537e+001, -5.712161e-003, 5.195992e-001, 2.028428e-003, 2.687114e+000, 5.098321e-001, -2.053976e+000, -1.141473e+000, 5.109183e-001, 8.060391e-002, -1.033983e-002, 4.066532e-001, 4.869627e-002, 1.161722e+000, 4.039525e-001, -6.348185e-001, 7.651292e-002, -1.031327e+001, 1.007598e+001, -2.083688e-002, 7.359516e-001, -2.029459e-001, 5.013257e+000, 1.077649e+000, -1.228630e+000, -1.650496e-001, 4.077157e-002, -7.189167e-001, -5.092220e-002, 2.959814e-001, 5.111496e-001, 2.540433e+000, 3.615330e-001, -1.041883e+000, -3.278413e-001, -6.691911e-002, 1.307364e+000, 2.166663e-001, 3.000595e-001, -3.157136e-003, 1.389208e+000, 7.999026e-001, -1.103556e+000, -2.443602e-001, 4.705347e-001, -9.296482e-004, -5.309920e-001, 9.654511e-001, 2.142587e-001, 2.244723e+000, 6.839976e-001, // albedo 0, turbidity 7 -1.555684e+000, -6.962113e-001, -4.647983e+001, 4.674270e+001, -5.034895e-003, 4.755090e-001, -9.502561e-007, 2.626569e+000, 5.056194e-001, -1.998288e+000, -1.124720e+000, -1.629586e+000, 2.187993e+000, -8.284384e-003, 3.845258e-001, 5.726240e-002, 1.185644e+000, 4.255812e-001, -1.032570e+000, -2.513850e-001, -3.721112e+000, 3.506967e+000, -2.186561e-002, 9.436049e-001, -2.451412e-001, 4.725724e+000, 1.039256e+000, -8.597532e-001, 9.073332e-002, -2.553741e+000, 1.993237e+000, -4.390891e-002, -2.046928e-001, 5.515623e-001, 1.909127e+000, 3.948212e-001, -1.210482e+000, -4.477622e-001, -2.267805e-001, 1.219488e+000, 1.336186e-001, 6.866897e-001, 2.808997e-002, 1.600403e+000, 7.816409e-001, -1.078168e+000, -2.699261e-001, 2.537282e-001, 3.820684e-001, -4.425103e-001, 5.298235e-001, 2.185217e-001, 1.728679e+000, 6.882743e-001, // albedo 0, turbidity 8 -1.697968e+000, -8.391488e-001, -5.790105e+001, 5.814120e+001, -3.404760e-003, 4.265140e-001, -1.796301e-006, 2.368442e+000, 5.324429e-001, -2.141552e+000, -1.172230e+000, 1.677872e+001, -1.641470e+001, -5.732425e-003, 2.002199e-001, 6.841834e-002, 1.485338e+000, 3.215763e-001, -1.442946e+000, -7.264245e-001, -9.503706e+000, 9.650462e+000, -2.120995e-002, 1.419263e+000, -2.893098e-001, 3.860731e+000, 1.120857e+000, -5.696752e-001, 3.411279e-001, -2.931035e-001, -6.512552e-001, -1.068437e-001, -1.085661e+000, 6.107549e-001, 1.459503e+000, 3.210336e-001, -1.313839e+000, -5.921371e-001, -2.332222e-001, 1.648196e+000, 2.492787e-001, 1.381033e+000, -1.993392e-002, 9.812560e-001, 8.316329e-001, -1.087464e+000, -3.195534e-001, 2.902095e-001, 3.383709e-001, -8.798482e-001, 1.494668e-002, 2.529703e-001, 1.452644e+000, 6.693870e-001, // albedo 0, turbidity 9 -2.068582e+000, -1.118605e+000, -5.081598e+001, 5.097486e+001, -3.280669e-003, 4.067371e-001, -2.544951e-006, 2.179497e+000, 5.778017e-001, -1.744693e+000, -8.537207e-001, 2.234361e+001, -2.208318e+001, -5.932616e-003, 1.035049e-001, 5.742772e-002, 1.977880e+000, 2.124846e-001, -3.287515e+000, -2.140268e+000, -1.249566e+001, 1.240091e+001, -2.409349e-002, 1.397821e+000, -2.371627e-001, 2.771192e+000, 1.170496e+000, 5.502311e-001, 1.046630e+000, 2.193517e+000, -2.220400e+000, -1.064394e-001, -1.017926e+000, 4.795457e-001, 1.030644e+000, 3.177516e-001, -1.719734e+000, -9.536198e-001, -6.586821e-001, 1.386361e+000, -2.513065e-002, 1.187011e+000, 6.542539e-002, 5.296055e-001, 8.082660e-001, -1.005700e+000, -3.028096e-001, 4.470957e-002, 1.007760e+000, -8.119016e-001, 3.153338e-002, 2.311321e-001, 1.182208e+000, 6.824758e-001, // albedo 0, turbidity 10 -2.728867e+000, -1.580388e+000, -3.079627e+001, 3.092586e+001, -4.197673e-003, 3.154759e-001, -3.897675e-006, 1.920567e+000, 6.664791e-001, -1.322495e+000, -7.249275e-001, 1.477660e+001, -1.468154e+001, -9.044857e-003, 5.624314e-002, 6.498392e-002, 2.047389e+000, 6.367540e-002, -6.102376e+000, -3.473018e+000, -9.926071e+000, 9.637797e+000, -1.097909e-002, 1.103498e+000, -2.424521e-001, 2.520748e+000, 1.240260e+000, 1.351796e+000, 1.018588e+000, 2.009081e+000, -1.333394e+000, -1.979125e-001, -3.318292e-001, 4.476624e-001, 9.095235e-001, 2.955611e-001, -1.774467e+000, -1.079880e+000, -8.084680e-002, 2.577697e-001, -1.149295e-001, 4.975303e-001, 2.931611e-003, -3.803171e-001, 8.002794e-001, -9.898401e-001, -2.542513e-001, -7.530911e-002, 1.870355e+000, -1.521918e+000, 2.405164e-001, 2.964615e-001, 1.334800e+000, 6.789053e-001, // albedo 1, turbidity 1 -1.279730e+000, -4.290674e-001, -4.277972e+001, 4.343305e+001, -6.541826e-003, 4.945086e-001, 1.425338e-002, 2.685244e+000, 5.011313e-001, -1.449506e+000, -5.766374e-001, -1.688496e+001, 1.781118e+001, -1.121649e-002, 3.545020e-001, 2.287338e-002, 1.904281e+000, 4.936998e-001, -1.021980e+000, -1.897574e-001, 2.482462e+000, -2.941725e+000, -1.570448e-002, 7.532578e-001, -4.256800e-002, 5.239660e+000, 4.983116e-001, -1.162608e+000, -3.428049e-001, 3.974358e+000, -1.527935e+000, -3.919201e-002, 8.758593e-001, 7.291363e-002, -3.455257e+000, 8.007426e-001, -9.929985e-001, -8.712006e-002, -7.397313e-001, 1.348372e+000, 9.511685e-002, 3.233584e-001, -7.549148e-002, 5.806452e+000, 4.990042e-001, -1.084996e+000, -1.739767e-001, 1.580475e-001, 9.088180e-001, 6.871433e-002, 5.933079e-001, 1.188921e-001, 3.074079e+000, 4.999327e-001, // albedo 1, turbidity 2 -1.317009e+000, -4.661946e-001, -4.255347e+001, 4.312782e+001, -5.727235e-003, 4.285447e-001, 2.189854e-002, 2.608310e+000, 5.190700e-001, -1.469236e+000, -6.282139e-001, -1.241404e+001, 1.348765e+001, -1.204770e-002, 5.070285e-001, -7.280216e-004, 1.491533e+000, 3.635064e-001, -9.713808e-001, -8.138038e-002, 3.709854e-001, -1.041174e+000, -1.814075e-002, 5.060860e-001, -2.053756e-002, 6.161431e+000, 1.093736e+000, -1.159057e+000, -3.698074e-001, 2.711209e+000, -6.006479e-001, -4.896926e-002, 9.273957e-001, 1.137712e-001, -3.496828e+000, 2.867109e-001, -1.011601e+000, -8.201890e-002, 2.105725e-001, 4.597520e-001, 1.478925e-001, 2.138940e-001, -5.660670e-002, 6.057755e+000, 7.859121e-001, -1.078020e+000, -1.811580e-001, 1.646622e-001, 8.348426e-001, 1.149064e-001, 4.985738e-001, 1.376605e-001, 2.746607e+000, 4.999626e-001, // albedo 1, turbidity 3 -1.325672e+000, -4.769313e-001, -4.111215e+001, 4.168293e+001, -6.274997e-003, 4.649469e-001, 1.119411e-002, 2.631267e+000, 5.234546e-001, -1.619391e+000, -8.000253e-001, -1.534098e+001, 1.632706e+001, -1.012023e-002, 4.242255e-001, 2.931597e-002, 8.925807e-001, 3.314765e-001, -7.356979e-001, 1.368406e-001, 2.972579e+000, -3.535359e+000, -1.318948e-002, 4.607620e-001, -7.182778e-002, 6.254100e+000, 1.236299e+000, -1.316217e+000, -4.194427e-001, 3.489902e-002, 1.289849e+000, -4.755960e-002, 1.138222e+000, 1.975992e-001, -8.991542e-001, 2.290572e-001, -9.502188e-001, -1.172703e-001, 1.405202e+000, -3.061919e-001, 1.058772e-001, -3.760592e-001, -1.983179e-002, 3.562353e+000, 7.895959e-001, -1.100117e+000, -1.900567e-001, 4.925030e-001, 5.250225e-001, 1.576804e-001, 1.042701e+000, 7.330743e-002, 2.796064e+000, 6.749783e-001, // albedo 1, turbidity 4 -1.354183e+000, -5.130625e-001, -4.219268e+001, 4.271772e+001, -5.365373e-003, 4.136743e-001, 1.235172e-002, 2.520122e+000, 5.187269e-001, -1.741434e+000, -9.589761e-001, -8.230339e+000, 9.296799e+000, -9.600162e-003, 4.994969e-001, 2.955452e-002, 3.667099e-001, 3.526999e-001, -6.917347e-001, 2.154887e-001, -8.760264e-001, 2.334121e-001, -1.909621e-002, 4.748033e-001, -1.138514e-001, 6.515360e+000, 1.225097e+000, -1.293189e+000, -4.218700e-001, 1.620952e+000, -7.858597e-001, -3.769410e-002, 6.636786e-001, 3.364945e-001, -5.341017e-001, 2.128347e-001, -9.735521e-001, -1.325495e-001, 1.007517e+000, 2.598258e-001, 6.762169e-002, 1.421018e-003, -6.915987e-002, 3.185897e+000, 8.641956e-001, -1.094800e+000, -1.962062e-001, 5.755591e-001, 2.906259e-001, 2.625748e-001, 7.644049e-001, 1.347492e-001, 2.677126e+000, 6.465460e-001, // albedo 1, turbidity 5 -1.393063e+000, -5.578338e-001, -4.185249e+001, 4.233504e+001, -5.435640e-003, 4.743765e-001, 7.422477e-003, 2.442801e+000, 5.211707e-001, -1.939487e+000, -1.128509e+000, -8.974257e+000, 9.978383e+000, -7.965597e-003, 2.948830e-001, 4.436763e-002, 2.839868e-001, 3.440424e-001, -6.011562e-001, 2.354877e-001, -3.079820e+000, 2.585094e+000, -2.002701e-002, 7.793909e-001, -1.598414e-001, 5.834678e+000, 1.202856e+000, -1.315676e+000, -3.903446e-001, 1.701900e+000, -1.304609e+000, -1.045121e-002, 2.747707e-001, 4.143967e-001, 3.197102e-001, 2.637580e-001, -9.618628e-001, -1.625841e-001, 1.187138e+000, 1.497802e-001, -5.590954e-006, 3.178475e-002, -4.153145e-002, 2.496096e+000, 8.195082e-001, -1.111554e+000, -2.365546e-001, 7.831875e-001, 2.018684e-001, 2.074369e-001, 7.395978e-001, 1.225730e-001, 1.876478e+000, 6.821167e-001, // albedo 1, turbidity 6 -1.427879e+000, -5.994879e-001, -3.531016e+001, 3.581581e+001, -6.431497e-003, 4.554192e-001, 7.348731e-004, 2.334619e+000, 5.233377e-001, -1.998177e+000, -1.206633e+000, -2.146510e+001, 2.242237e+001, -5.857596e-003, 2.755663e-001, 6.384795e-002, 1.358244e-001, 3.328437e-001, -6.440630e-001, 2.058571e-001, 2.155499e+000, -2.587968e+000, -1.840023e-002, 8.826555e-001, -2.222452e-001, 5.847073e+000, 1.228387e+000, -1.229071e+000, -3.360441e-001, -3.429599e-001, 6.179469e-001, 2.029610e-003, 8.899319e-002, 5.041624e-001, 1.882964e-001, 2.252040e-001, -1.022905e+000, -2.101621e-001, 1.915689e+000, -6.498794e-001, -3.463651e-002, 8.954605e-002, -6.797854e-002, 2.417705e+000, 8.568618e-001, -1.082538e+000, -2.007723e-001, 4.731009e-001, 4.077267e-001, 1.324289e-001, 6.514880e-001, 1.702912e-001, 2.309383e+000, 6.600895e-001, // albedo 1, turbidity 7 -1.472139e+000, -6.499815e-001, -3.428465e+001, 3.469659e+001, -5.747023e-003, 4.174167e-001, 1.688597e-003, 2.323046e+000, 5.395191e-001, -2.161176e+000, -1.353089e+000, -2.226827e+001, 2.329138e+001, -5.583808e-003, 2.364793e-001, 6.096656e-002, 1.944666e-003, 2.861624e-001, -6.593044e-001, 1.393558e-001, 4.698373e+000, -5.193883e+000, -1.998390e-002, 1.095635e+000, -2.391254e-001, 5.598103e+000, 1.236193e+000, -1.195717e+000, -2.972715e-001, 4.648953e-002, 3.024588e-001, 5.003313e-003, -3.754741e-001, 5.247265e-001, -1.381312e-001, 2.493896e-001, -1.020139e+000, -2.253524e-001, 3.548437e-001, 7.030485e-001, -2.107076e-002, 4.581395e-001, -3.243757e-002, 2.453259e+000, 8.323623e-001, -1.098770e+000, -2.435780e-001, 8.761614e-001, 1.941613e-001, -1.990692e-001, 3.761139e-001, 1.657412e-001, 1.590503e+000, 6.741417e-001, // albedo 1, turbidity 8 -1.648007e+000, -8.205121e-001, -4.435106e+001, 4.479801e+001, -4.181353e-003, 3.854830e-001, -1.842385e-006, 2.000281e+000, 5.518363e-001, -2.140986e+000, -1.282239e+000, -3.979213e+000, 4.672459e+000, -5.008582e-003, 2.421920e-001, 6.253602e-002, 6.612713e-001, 2.555851e-001, -1.300502e+000, -5.137898e-001, 5.179821e-001, -4.032341e-001, -2.066785e-002, 1.087929e+000, -2.615309e-001, 4.225887e+000, 1.229237e+000, -6.963340e-001, 9.241060e-002, 6.936356e-002, -3.588571e-001, -5.461843e-002, -5.616643e-001, 5.484166e-001, -4.776267e-002, 2.414935e-001, -1.233179e+000, -4.325498e-001, 6.479813e-001, 8.368356e-001, 2.458875e-001, 6.464752e-001, -2.897097e-002, 1.561773e+000, 8.518598e-001, -1.051023e+000, -2.533690e-001, 1.004294e+000, 3.028083e-001, -1.520108e+000, 1.607013e-001, 1.619975e-001, 1.131094e+000, 6.706655e-001, // albedo 1, turbidity 9 -1.948249e+000, -1.097383e+000, -4.453697e+001, 4.494902e+001, -3.579939e-003, 3.491605e-001, -2.500253e-006, 1.740442e+000, 6.188022e-001, -2.154253e+000, -1.209559e+000, 4.144894e+000, -3.562411e+000, -5.638843e-003, 1.067169e-001, 7.594858e-002, 1.005280e+000, 1.072543e-001, -2.513259e+000, -1.507208e+000, -1.602979e+000, 1.404154e+000, -5.560750e-003, 1.240490e+000, -2.852117e-001, 3.485252e+000, 1.349321e+000, -7.832214e-002, 3.655626e-001, 3.856288e-001, 6.867894e-001, -1.609523e-001, -6.704306e-001, 5.357301e-001, -6.457935e-001, 1.479503e-001, -1.354784e+000, -5.454375e-001, 8.797469e-001, -1.466514e+000, 7.134420e-001, 5.934903e-001, -2.911178e-002, 8.643737e-001, 9.030724e-001, -1.048324e+000, -2.738736e-001, 8.783074e-001, 3.246188e+000, -4.435369e+000, 1.251791e-001, 1.783486e-001, 1.064657e+000, 6.522878e-001, // albedo 1, turbidity 10 -2.770408e+000, -1.618911e+000, -2.504031e+001, 2.531674e+001, -4.239279e-003, 3.241013e-001, -3.764484e-006, 1.586843e+000, 7.035906e-001, -1.913500e+000, -1.144014e+000, -1.080587e+001, 1.153677e+001, -1.003197e-002, 1.577515e-001, 5.217789e-002, 1.225278e+000, 5.172771e-003, -5.293208e+000, -2.876463e+000, 2.087053e+000, -3.201552e+000, 3.892964e-003, 5.323930e-001, -2.034512e-001, 2.617760e+000, 1.273597e+000, 9.060340e-001, 3.773409e-001, -6.399945e-001, 3.213979e+000, -9.112172e-002, 6.494055e-001, 3.953280e-001, 5.047796e-001, 2.998695e-001, -1.482179e+000, -6.778310e-001, 1.161775e+000, -3.004872e+000, 4.774797e-001, -4.969248e-001, -3.512074e-003, -1.307190e+000, 7.927378e-001, -9.863181e-001, -1.803364e-001, 5.810824e-001, 4.580570e+000, -3.863454e+000, 5.328174e-001, 2.272821e-001, 1.771114e+000, 6.791814e-001, }; static const double datasetXYZRad3[] = { // albedo 0, turbidity 1 1.168084e+000, 2.156455e+000, -3.980314e+000, 1.989302e+001, 1.328335e+001, 1.435621e+001, // albedo 0, turbidity 2 1.135488e+000, 2.294701e+000, -4.585886e+000, 2.090208e+001, 1.347840e+001, 1.467658e+001, // albedo 0, turbidity 3 1.107408e+000, 2.382765e+000, -5.112357e+000, 2.147823e+001, 1.493128e+001, 1.460882e+001, // albedo 0, turbidity 4 1.054193e+000, 2.592891e+000, -6.115000e+000, 2.268967e+001, 1.635672e+001, 1.518999e+001, // albedo 0, turbidity 5 1.006946e+000, 2.705420e+000, -6.698930e+000, 2.291830e+001, 1.834324e+001, 1.570651e+001, // albedo 0, turbidity 6 9.794044e-001, 2.742440e+000, -6.805283e+000, 2.225271e+001, 2.050797e+001, 1.563130e+001, // albedo 0, turbidity 7 9.413577e-001, 2.722009e+000, -6.760707e+000, 2.098242e+001, 2.342588e+001, 1.605011e+001, // albedo 0, turbidity 8 8.917923e-001, 2.592780e+000, -6.152635e+000, 1.774141e+001, 2.858324e+001, 1.657910e+001, // albedo 0, turbidity 9 8.288391e-001, 2.153434e+000, -4.118327e+000, 1.078118e+001, 3.681710e+001, 1.738139e+001, // albedo 0, turbidity 10 7.623528e-001, 1.418187e+000, -8.845235e-001, 7.590129e-001, 4.629859e+001, 1.921657e+001, // albedo 1, turbidity 1 1.352858e+000, 2.048862e+000, -2.053393e+000, 1.405874e+001, 3.045344e+001, 3.044430e+001, // albedo 1, turbidity 2 1.330497e+000, 2.126497e+000, -2.466296e+000, 1.467559e+001, 3.090738e+001, 3.069707e+001, // albedo 1, turbidity 3 1.286344e+000, 2.200436e+000, -2.877228e+000, 1.492701e+001, 3.236288e+001, 3.077223e+001, // albedo 1, turbidity 4 1.234428e+000, 2.289628e+000, -3.404699e+000, 1.499436e+001, 3.468390e+001, 3.084842e+001, // albedo 1, turbidity 5 1.178660e+000, 2.306071e+000, -3.549159e+000, 1.411006e+001, 3.754188e+001, 3.079730e+001, // albedo 1, turbidity 6 1.151366e+000, 2.333005e+000, -3.728627e+000, 1.363374e+001, 3.905894e+001, 3.092599e+001, // albedo 1, turbidity 7 1.101593e+000, 2.299422e+000, -3.565787e+000, 1.196745e+001, 4.188472e+001, 3.102755e+001, // albedo 1, turbidity 8 1.038322e+000, 2.083539e+000, -2.649585e+000, 8.037389e+000, 4.700869e+001, 3.065948e+001, // albedo 1, turbidity 9 9.596146e-001, 1.671470e+000, -8.751538e-001, 1.679772e+000, 5.345784e+001, 3.054520e+001, // albedo 1, turbidity 10 8.640731e-001, 9.858301e-001, 1.854956e+000, -6.798097e+000, 5.936468e+001, 3.110255e+001, }; static const double* datasetsXYZ[] = { datasetXYZ1, datasetXYZ2, datasetXYZ3 }; static const double* datasetsXYZRad[] = { datasetXYZRad1, datasetXYZRad2, datasetXYZRad3 }; CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_sseb.h000066400000000000000000000177661334742672700215350ustar00rootroot00000000000000/* * Copyright 2011-2013 Intel Corporation * Modifications Copyright 2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0(the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_SSEB_H__ #define __UTIL_SSEB_H__ CCL_NAMESPACE_BEGIN #ifdef __KERNEL_SSE2__ struct ssei; struct ssef; /*! 4-wide SSE bool type. */ struct sseb { typedef sseb Mask; // mask type typedef ssei Int; // int type typedef ssef Float; // float type enum { size = 4 }; // number of SIMD elements union { __m128 m128; int32_t v[4]; }; // data //////////////////////////////////////////////////////////////////////////////// /// Constructors, Assignment & Cast Operators //////////////////////////////////////////////////////////////////////////////// __forceinline sseb ( ) {} __forceinline sseb ( const sseb& other ) { m128 = other.m128; } __forceinline sseb& operator=( const sseb& other ) { m128 = other.m128; return *this; } __forceinline sseb( const __m128 input ) : m128(input) {} __forceinline operator const __m128&( void ) const { return m128; } __forceinline operator const __m128i( void ) const { return _mm_castps_si128(m128); } __forceinline operator const __m128d( void ) const { return _mm_castps_pd(m128); } __forceinline sseb ( bool a ) : m128(_mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {} __forceinline sseb ( bool a, bool b) : m128(_mm_lookupmask_ps[(size_t(b) << 3) | (size_t(a) << 2) | (size_t(b) << 1) | size_t(a)]) {} __forceinline sseb ( bool a, bool b, bool c, bool d) : m128(_mm_lookupmask_ps[(size_t(d) << 3) | (size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {} __forceinline sseb(int mask) { assert(mask >= 0 && mask < 16); m128 = _mm_lookupmask_ps[mask]; } //////////////////////////////////////////////////////////////////////////////// /// Constants //////////////////////////////////////////////////////////////////////////////// __forceinline sseb( FalseTy ) : m128(_mm_setzero_ps()) {} __forceinline sseb( TrueTy ) : m128(_mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128()))) {} //////////////////////////////////////////////////////////////////////////////// /// Array Access //////////////////////////////////////////////////////////////////////////////// __forceinline bool operator []( const size_t i ) const { assert(i < 4); return (_mm_movemask_ps(m128) >> i) & 1; } __forceinline int32_t& operator []( const size_t i ) { assert(i < 4); return v[i]; } }; //////////////////////////////////////////////////////////////////////////////// /// Unary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const sseb operator !( const sseb& a ) { return _mm_xor_ps(a, sseb(True)); } //////////////////////////////////////////////////////////////////////////////// /// Binary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const sseb operator &( const sseb& a, const sseb& b ) { return _mm_and_ps(a, b); } __forceinline const sseb operator |( const sseb& a, const sseb& b ) { return _mm_or_ps (a, b); } __forceinline const sseb operator ^( const sseb& a, const sseb& b ) { return _mm_xor_ps(a, b); } //////////////////////////////////////////////////////////////////////////////// /// Assignment Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const sseb operator &=( sseb& a, const sseb& b ) { return a = a & b; } __forceinline const sseb operator |=( sseb& a, const sseb& b ) { return a = a | b; } __forceinline const sseb operator ^=( sseb& a, const sseb& b ) { return a = a ^ b; } //////////////////////////////////////////////////////////////////////////////// /// Comparison Operators + Select //////////////////////////////////////////////////////////////////////////////// __forceinline const sseb operator !=( const sseb& a, const sseb& b ) { return _mm_xor_ps(a, b); } __forceinline const sseb operator ==( const sseb& a, const sseb& b ) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); } __forceinline const sseb select( const sseb& m, const sseb& t, const sseb& f ) { #if defined(__KERNEL_SSE41__) return _mm_blendv_ps(f, t, m); #else return _mm_or_ps(_mm_and_ps(m, t), _mm_andnot_ps(m, f)); #endif } //////////////////////////////////////////////////////////////////////////////// /// Movement/Shifting/Shuffling Functions //////////////////////////////////////////////////////////////////////////////// __forceinline const sseb unpacklo( const sseb& a, const sseb& b ) { return _mm_unpacklo_ps(a, b); } __forceinline const sseb unpackhi( const sseb& a, const sseb& b ) { return _mm_unpackhi_ps(a, b); } template __forceinline const sseb shuffle( const sseb& a ) { return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)); } template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) { return _mm_movelh_ps(a, a); } template<> __forceinline const sseb shuffle<2, 3, 2, 3>( const sseb& a ) { return _mm_movehl_ps(a, a); } template __forceinline const sseb shuffle( const sseb& a, const sseb& b ) { return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0)); } template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a, const sseb& b ) { return _mm_movelh_ps(a, b); } template<> __forceinline const sseb shuffle<2, 3, 2, 3>( const sseb& a, const sseb& b ) { return _mm_movehl_ps(b, a); } #if defined(__KERNEL_SSE3__) template<> __forceinline const sseb shuffle<0, 0, 2, 2>( const sseb& a ) { return _mm_moveldup_ps(a); } template<> __forceinline const sseb shuffle<1, 1, 3, 3>( const sseb& a ) { return _mm_movehdup_ps(a); } #endif #if defined(__KERNEL_SSE41__) template __forceinline const sseb insert( const sseb& a, const sseb& b ) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); } template __forceinline const sseb insert( const sseb& a, const sseb& b ) { return insert(a, b); } template __forceinline const sseb insert( const sseb& a, const bool b ) { return insert(a, sseb(b)); } #endif //////////////////////////////////////////////////////////////////////////////// /// Reduction Operations //////////////////////////////////////////////////////////////////////////////// #if defined(__KERNEL_SSE41__) __forceinline size_t popcnt( const sseb& a ) { return __popcnt(_mm_movemask_ps(a)); } #else __forceinline size_t popcnt( const sseb& a ) { return bool(a[0])+bool(a[1])+bool(a[2])+bool(a[3]); } #endif __forceinline bool reduce_and( const sseb& a ) { return _mm_movemask_ps(a) == 0xf; } __forceinline bool reduce_or ( const sseb& a ) { return _mm_movemask_ps(a) != 0x0; } __forceinline bool all ( const sseb& b ) { return _mm_movemask_ps(b) == 0xf; } __forceinline bool any ( const sseb& b ) { return _mm_movemask_ps(b) != 0x0; } __forceinline bool none ( const sseb& b ) { return _mm_movemask_ps(b) == 0x0; } __forceinline size_t movemask( const sseb& a ) { return _mm_movemask_ps(a); } //////////////////////////////////////////////////////////////////////////////// /// Debug Functions //////////////////////////////////////////////////////////////////////////////// ccl_device_inline void print_sseb(const char *label, const sseb &a) { printf("%s: %df %df %df %d\n", label, a[0], a[1], a[2], a[3]); } #endif CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_ssef.h000066400000000000000000000607661334742672700215370ustar00rootroot00000000000000/* * Copyright 2011-2013 Intel Corporation * Modifications Copyright 2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0(the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_SSEF_H__ #define __UTIL_SSEF_H__ CCL_NAMESPACE_BEGIN #ifdef __KERNEL_SSE2__ struct sseb; struct ssef; /*! 4-wide SSE float type. */ struct ssef { typedef sseb Mask; // mask type typedef ssei Int; // int type typedef ssef Float; // float type enum { size = 4 }; // number of SIMD elements union { __m128 m128; float f[4]; int i[4]; }; // data //////////////////////////////////////////////////////////////////////////////// /// Constructors, Assignment & Cast Operators //////////////////////////////////////////////////////////////////////////////// __forceinline ssef () {} __forceinline ssef (const ssef& other) { m128 = other.m128; } __forceinline ssef& operator=(const ssef& other) { m128 = other.m128; return *this; } __forceinline ssef(const __m128 a) : m128(a) {} __forceinline operator const __m128&(void) const { return m128; } __forceinline operator __m128&(void) { return m128; } __forceinline ssef (float a) : m128(_mm_set1_ps(a)) {} __forceinline ssef (float a, float b, float c, float d) : m128(_mm_setr_ps(a, b, c, d)) {} __forceinline explicit ssef(const __m128i a) : m128(_mm_cvtepi32_ps(a)) {} //////////////////////////////////////////////////////////////////////////////// /// Loads and Stores //////////////////////////////////////////////////////////////////////////////// #if defined(__KERNEL_AVX__) static __forceinline ssef broadcast(const void* const a) { return _mm_broadcast_ss((float*)a); } #else static __forceinline ssef broadcast(const void* const a) { return _mm_set1_ps(*(float*)a); } #endif //////////////////////////////////////////////////////////////////////////////// /// Array Access //////////////////////////////////////////////////////////////////////////////// __forceinline const float& operator [](const size_t i) const { assert(i < 4); return f[i]; } __forceinline float& operator [](const size_t i) { assert(i < 4); return f[i]; } }; //////////////////////////////////////////////////////////////////////////////// /// Unary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const ssef cast (const __m128i& a) { return _mm_castsi128_ps(a); } __forceinline const ssef operator +(const ssef& a) { return a; } __forceinline const ssef operator -(const ssef& a) { return _mm_xor_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); } __forceinline const ssef abs (const ssef& a) { return _mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))); } #if defined(__KERNEL_SSE41__) __forceinline const ssef sign (const ssef& a) { return _mm_blendv_ps(ssef(1.0f), -ssef(1.0f), _mm_cmplt_ps(a,ssef(0.0f))); } #endif __forceinline const ssef signmsk (const ssef& a) { return _mm_and_ps(a.m128,_mm_castsi128_ps(_mm_set1_epi32(0x80000000))); } __forceinline const ssef rcp (const ssef& a) { const ssef r = _mm_rcp_ps(a.m128); return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a)); } __forceinline const ssef sqr (const ssef& a) { return _mm_mul_ps(a,a); } __forceinline const ssef mm_sqrt(const ssef& a) { return _mm_sqrt_ps(a.m128); } __forceinline const ssef rsqrt(const ssef& a) { const ssef r = _mm_rsqrt_ps(a.m128); return _mm_add_ps(_mm_mul_ps(_mm_set_ps(1.5f, 1.5f, 1.5f, 1.5f), r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set_ps(-0.5f, -0.5f, -0.5f, -0.5f)), r), _mm_mul_ps(r, r))); } //////////////////////////////////////////////////////////////////////////////// /// Binary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const ssef operator +(const ssef& a, const ssef& b) { return _mm_add_ps(a.m128, b.m128); } __forceinline const ssef operator +(const ssef& a, const float& b) { return a + ssef(b); } __forceinline const ssef operator +(const float& a, const ssef& b) { return ssef(a) + b; } __forceinline const ssef operator -(const ssef& a, const ssef& b) { return _mm_sub_ps(a.m128, b.m128); } __forceinline const ssef operator -(const ssef& a, const float& b) { return a - ssef(b); } __forceinline const ssef operator -(const float& a, const ssef& b) { return ssef(a) - b; } __forceinline const ssef operator *(const ssef& a, const ssef& b) { return _mm_mul_ps(a.m128, b.m128); } __forceinline const ssef operator *(const ssef& a, const float& b) { return a * ssef(b); } __forceinline const ssef operator *(const float& a, const ssef& b) { return ssef(a) * b; } __forceinline const ssef operator /(const ssef& a, const ssef& b) { return _mm_div_ps(a.m128,b.m128); } __forceinline const ssef operator /(const ssef& a, const float& b) { return a/ssef(b); } __forceinline const ssef operator /(const float& a, const ssef& b) { return ssef(a)/b; } __forceinline const ssef operator^(const ssef& a, const ssef& b) { return _mm_xor_ps(a.m128,b.m128); } __forceinline const ssef operator^(const ssef& a, const ssei& b) { return _mm_xor_ps(a.m128,_mm_castsi128_ps(b.m128)); } __forceinline const ssef operator&(const ssef& a, const ssef& b) { return _mm_and_ps(a.m128,b.m128); } __forceinline const ssef operator&(const ssef& a, const ssei& b) { return _mm_and_ps(a.m128,_mm_castsi128_ps(b.m128)); } __forceinline const ssef operator|(const ssef& a, const ssef& b) { return _mm_or_ps(a.m128,b.m128); } __forceinline const ssef operator|(const ssef& a, const ssei& b) { return _mm_or_ps(a.m128,_mm_castsi128_ps(b.m128)); } __forceinline const ssef andnot(const ssef& a, const ssef& b) { return _mm_andnot_ps(a.m128,b.m128); } __forceinline const ssef min(const ssef& a, const ssef& b) { return _mm_min_ps(a.m128,b.m128); } __forceinline const ssef min(const ssef& a, const float& b) { return _mm_min_ps(a.m128,ssef(b)); } __forceinline const ssef min(const float& a, const ssef& b) { return _mm_min_ps(ssef(a),b.m128); } __forceinline const ssef max(const ssef& a, const ssef& b) { return _mm_max_ps(a.m128,b.m128); } __forceinline const ssef max(const ssef& a, const float& b) { return _mm_max_ps(a.m128,ssef(b)); } __forceinline const ssef max(const float& a, const ssef& b) { return _mm_max_ps(ssef(a),b.m128); } #if defined(__KERNEL_SSE41__) __forceinline ssef mini(const ssef& a, const ssef& b) { const ssei ai = _mm_castps_si128(a); const ssei bi = _mm_castps_si128(b); const ssei ci = _mm_min_epi32(ai,bi); return _mm_castsi128_ps(ci); } #endif #if defined(__KERNEL_SSE41__) __forceinline ssef maxi(const ssef& a, const ssef& b) { const ssei ai = _mm_castps_si128(a); const ssei bi = _mm_castps_si128(b); const ssei ci = _mm_max_epi32(ai,bi); return _mm_castsi128_ps(ci); } #endif //////////////////////////////////////////////////////////////////////////////// /// Ternary Operators //////////////////////////////////////////////////////////////////////////////// #if defined(__KERNEL_AVX2__) __forceinline const ssef madd (const ssef& a, const ssef& b, const ssef& c) { return _mm_fmadd_ps(a,b,c); } __forceinline const ssef msub (const ssef& a, const ssef& b, const ssef& c) { return _mm_fmsub_ps(a,b,c); } __forceinline const ssef nmadd(const ssef& a, const ssef& b, const ssef& c) { return _mm_fnmadd_ps(a,b,c); } __forceinline const ssef nmsub(const ssef& a, const ssef& b, const ssef& c) { return _mm_fnmsub_ps(a,b,c); } #else __forceinline const ssef madd (const ssef& a, const ssef& b, const ssef& c) { return a*b+c; } __forceinline const ssef msub (const ssef& a, const ssef& b, const ssef& c) { return a*b-c; } __forceinline const ssef nmadd(const ssef& a, const ssef& b, const ssef& c) { return c-a*b;} __forceinline const ssef nmsub(const ssef& a, const ssef& b, const ssef& c) { return -a*b-c; } #endif //////////////////////////////////////////////////////////////////////////////// /// Assignment Operators //////////////////////////////////////////////////////////////////////////////// __forceinline ssef& operator +=(ssef& a, const ssef& b) { return a = a + b; } __forceinline ssef& operator +=(ssef& a, const float& b) { return a = a + b; } __forceinline ssef& operator -=(ssef& a, const ssef& b) { return a = a - b; } __forceinline ssef& operator -=(ssef& a, const float& b) { return a = a - b; } __forceinline ssef& operator *=(ssef& a, const ssef& b) { return a = a * b; } __forceinline ssef& operator *=(ssef& a, const float& b) { return a = a * b; } __forceinline ssef& operator /=(ssef& a, const ssef& b) { return a = a / b; } __forceinline ssef& operator /=(ssef& a, const float& b) { return a = a / b; } //////////////////////////////////////////////////////////////////////////////// /// Comparison Operators + Select //////////////////////////////////////////////////////////////////////////////// __forceinline const sseb operator ==(const ssef& a, const ssef& b) { return _mm_cmpeq_ps(a.m128, b.m128); } __forceinline const sseb operator ==(const ssef& a, const float& b) { return a == ssef(b); } __forceinline const sseb operator ==(const float& a, const ssef& b) { return ssef(a) == b; } __forceinline const sseb operator !=(const ssef& a, const ssef& b) { return _mm_cmpneq_ps(a.m128, b.m128); } __forceinline const sseb operator !=(const ssef& a, const float& b) { return a != ssef(b); } __forceinline const sseb operator !=(const float& a, const ssef& b) { return ssef(a) != b; } __forceinline const sseb operator <(const ssef& a, const ssef& b) { return _mm_cmplt_ps(a.m128, b.m128); } __forceinline const sseb operator <(const ssef& a, const float& b) { return a < ssef(b); } __forceinline const sseb operator <(const float& a, const ssef& b) { return ssef(a) < b; } __forceinline const sseb operator >=(const ssef& a, const ssef& b) { return _mm_cmpnlt_ps(a.m128, b.m128); } __forceinline const sseb operator >=(const ssef& a, const float& b) { return a >= ssef(b); } __forceinline const sseb operator >=(const float& a, const ssef& b) { return ssef(a) >= b; } __forceinline const sseb operator >(const ssef& a, const ssef& b) { return _mm_cmpnle_ps(a.m128, b.m128); } __forceinline const sseb operator >(const ssef& a, const float& b) { return a > ssef(b); } __forceinline const sseb operator >(const float& a, const ssef& b) { return ssef(a) > b; } __forceinline const sseb operator <=(const ssef& a, const ssef& b) { return _mm_cmple_ps(a.m128, b.m128); } __forceinline const sseb operator <=(const ssef& a, const float& b) { return a <= ssef(b); } __forceinline const sseb operator <=(const float& a, const ssef& b) { return ssef(a) <= b; } __forceinline const ssef select(const sseb& m, const ssef& t, const ssef& f) { #ifdef __KERNEL_SSE41__ return _mm_blendv_ps(f, t, m); #else return _mm_or_ps(_mm_and_ps(m, t), _mm_andnot_ps(m, f)); #endif } __forceinline const ssef select(const ssef& m, const ssef& t, const ssef& f) { #ifdef __KERNEL_SSE41__ return _mm_blendv_ps(f, t, m); #else return _mm_or_ps(_mm_and_ps(m, t), _mm_andnot_ps(m, f)); #endif } __forceinline const ssef select(const int mask, const ssef& t, const ssef& f) { #if defined(__KERNEL_SSE41__) && ((!defined(__clang__) && !defined(_MSC_VER)) || defined(__INTEL_COMPILER)) return _mm_blend_ps(f, t, mask); #else return select(sseb(mask),t,f); #endif } //////////////////////////////////////////////////////////////////////////////// /// Rounding Functions //////////////////////////////////////////////////////////////////////////////// #if defined(__KERNEL_SSE41__) __forceinline const ssef round_even(const ssef& a) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); } __forceinline const ssef round_down(const ssef& a) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); } __forceinline const ssef round_up (const ssef& a) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); } __forceinline const ssef round_zero(const ssef& a) { return _mm_round_ps(a, _MM_FROUND_TO_ZERO ); } __forceinline const ssef floor (const ssef& a) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); } __forceinline const ssef ceil (const ssef& a) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); } #endif __forceinline ssei truncatei(const ssef& a) { return _mm_cvttps_epi32(a.m128); } __forceinline ssei floori(const ssef& a) { #if defined(__KERNEL_SSE41__) return ssei(floor(a)); #else return ssei(a-ssef(0.5f)); #endif } //////////////////////////////////////////////////////////////////////////////// /// Movement/Shifting/Shuffling Functions //////////////////////////////////////////////////////////////////////////////// __forceinline ssef unpacklo(const ssef& a, const ssef& b) { return _mm_unpacklo_ps(a.m128, b.m128); } __forceinline ssef unpackhi(const ssef& a, const ssef& b) { return _mm_unpackhi_ps(a.m128, b.m128); } template __forceinline const ssef shuffle(const ssef& b) { return _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(i3, i2, i1, i0))); } template<> __forceinline const ssef shuffle<0, 1, 0, 1>(const ssef& a) { return _mm_movelh_ps(a, a); } template<> __forceinline const ssef shuffle<2, 3, 2, 3>(const ssef& a) { return _mm_movehl_ps(a, a); } template __forceinline const ssef shuffle(const ssef& a, const ssef& b) { return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0)); } template __forceinline const ssef shuffle(const ssef& a, const ssef& b) { return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i0, i0, i0, i0)); } template<> __forceinline const ssef shuffle<0, 1, 0, 1>(const ssef& a, const ssef& b) { return _mm_movelh_ps(a, b); } template<> __forceinline const ssef shuffle<2, 3, 2, 3>(const ssef& a, const ssef& b) { return _mm_movehl_ps(b, a); } #if defined(__KERNEL_SSSE3__) __forceinline const ssef shuffle8(const ssef& a, const ssei& shuf) { return _mm_castsi128_ps(_mm_shuffle_epi8(_mm_castps_si128(a), shuf)); } #endif #if defined(__KERNEL_SSE3__) template<> __forceinline const ssef shuffle<0, 0, 2, 2>(const ssef& b) { return _mm_moveldup_ps(b); } template<> __forceinline const ssef shuffle<1, 1, 3, 3>(const ssef& b) { return _mm_movehdup_ps(b); } #endif template __forceinline const ssef shuffle(const ssef& b) { return shuffle(b); } #if defined(__KERNEL_AVX__) __forceinline const ssef shuffle(const ssef& a, const ssei& shuf) { return _mm_permutevar_ps(a, shuf); } #endif template __forceinline float extract (const ssef& a) { return _mm_cvtss_f32(shuffle(a)); } template<> __forceinline float extract<0>(const ssef& a) { return _mm_cvtss_f32(a); } #if defined(__KERNEL_SSE41__) template __forceinline const ssef insert(const ssef& a, const ssef& b) { return _mm_insert_ps(a, b,(dst << 4) |(src << 6) | clr); } template __forceinline const ssef insert(const ssef& a, const ssef& b) { return insert(a, b); } template __forceinline const ssef insert(const ssef& a, const float b) { return insert(a, _mm_set_ss(b)); } #else template __forceinline const ssef insert(const ssef& a, const float b) { ssef c = a; c[dst] = b; return c; } #endif //////////////////////////////////////////////////////////////////////////////// /// Transpose //////////////////////////////////////////////////////////////////////////////// __forceinline void transpose(const ssef& r0, const ssef& r1, const ssef& r2, const ssef& r3, ssef& c0, ssef& c1, ssef& c2, ssef& c3) { ssef l02 = unpacklo(r0,r2); ssef h02 = unpackhi(r0,r2); ssef l13 = unpacklo(r1,r3); ssef h13 = unpackhi(r1,r3); c0 = unpacklo(l02,l13); c1 = unpackhi(l02,l13); c2 = unpacklo(h02,h13); c3 = unpackhi(h02,h13); } __forceinline void transpose(const ssef& r0, const ssef& r1, const ssef& r2, const ssef& r3, ssef& c0, ssef& c1, ssef& c2) { ssef l02 = unpacklo(r0,r2); ssef h02 = unpackhi(r0,r2); ssef l13 = unpacklo(r1,r3); ssef h13 = unpackhi(r1,r3); c0 = unpacklo(l02,l13); c1 = unpackhi(l02,l13); c2 = unpacklo(h02,h13); } //////////////////////////////////////////////////////////////////////////////// /// Reductions //////////////////////////////////////////////////////////////////////////////// __forceinline const ssef vreduce_min(const ssef& v) { ssef h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); } __forceinline const ssef vreduce_max(const ssef& v) { ssef h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); } __forceinline const ssef vreduce_add(const ssef& v) { ssef h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; } __forceinline float reduce_min(const ssef& v) { return _mm_cvtss_f32(vreduce_min(v)); } __forceinline float reduce_max(const ssef& v) { return _mm_cvtss_f32(vreduce_max(v)); } __forceinline float reduce_add(const ssef& v) { return _mm_cvtss_f32(vreduce_add(v)); } __forceinline size_t select_min(const ssef& v) { return __bsf(movemask(v == vreduce_min(v))); } __forceinline size_t select_max(const ssef& v) { return __bsf(movemask(v == vreduce_max(v))); } __forceinline size_t select_min(const sseb& valid, const ssef& v) { const ssef a = select(valid,v,ssef(pos_inf)); return __bsf(movemask(valid &(a == vreduce_min(a)))); } __forceinline size_t select_max(const sseb& valid, const ssef& v) { const ssef a = select(valid,v,ssef(neg_inf)); return __bsf(movemask(valid &(a == vreduce_max(a)))); } __forceinline size_t movemask( const ssef& a ) { return _mm_movemask_ps(a); } //////////////////////////////////////////////////////////////////////////////// /// Memory load and store operations //////////////////////////////////////////////////////////////////////////////// __forceinline ssef load4f(const float4& a) { #ifdef __KERNEL_WITH_SSE_ALIGN__ return _mm_load_ps(&a.x); #else return _mm_loadu_ps(&a.x); #endif } __forceinline ssef load4f(const float3& a) { #ifdef __KERNEL_WITH_SSE_ALIGN__ return _mm_load_ps(&a.x); #else return _mm_loadu_ps(&a.x); #endif } __forceinline ssef load4f(const void* const a) { return _mm_load_ps((float*)a); } __forceinline ssef load1f_first(const float a) { return _mm_set_ss(a); } __forceinline void store4f(void* ptr, const ssef& v) { _mm_store_ps((float*)ptr,v); } __forceinline ssef loadu4f(const void* const a) { return _mm_loadu_ps((float*)a); } __forceinline void storeu4f(void* ptr, const ssef& v) { _mm_storeu_ps((float*)ptr,v); } __forceinline void store4f(const sseb& mask, void* ptr, const ssef& f) { #if defined(__KERNEL_AVX__) _mm_maskstore_ps((float*)ptr,(__m128i)mask,f); #else *(ssef*)ptr = select(mask,f,*(ssef*)ptr); #endif } __forceinline ssef load4f_nt(void* ptr) { #if defined(__KERNEL_SSE41__) return _mm_castsi128_ps(_mm_stream_load_si128((__m128i*)ptr)); #else return _mm_load_ps((float*)ptr); #endif } __forceinline void store4f_nt(void* ptr, const ssef& v) { #if defined(__KERNEL_SSE41__) _mm_stream_ps((float*)ptr,v); #else _mm_store_ps((float*)ptr,v); #endif } //////////////////////////////////////////////////////////////////////////////// /// Euclidian Space Operators //////////////////////////////////////////////////////////////////////////////// __forceinline float dot(const ssef& a, const ssef& b) { return reduce_add(a*b); } /* calculate shuffled cross product, useful when order of components does not matter */ __forceinline ssef cross_zxy(const ssef& a, const ssef& b) { const ssef a0 = a; const ssef b0 = shuffle<1,2,0,3>(b); const ssef a1 = shuffle<1,2,0,3>(a); const ssef b1 = b; return msub(a0,b0,a1*b1); } __forceinline ssef cross(const ssef& a, const ssef& b) { return shuffle<1,2,0,3>(cross_zxy(a, b)); } ccl_device_inline const ssef dot3_splat(const ssef& a, const ssef& b) { #ifdef __KERNEL_SSE41__ return _mm_dp_ps(a.m128, b.m128, 0x7f); #else ssef t = a * b; return ssef(((float*)&t)[0] + ((float*)&t)[1] + ((float*)&t)[2]); #endif } /* squared length taking only specified axes into account */ template ccl_device_inline float len_squared(const ssef& a) { #ifndef __KERNEL_SSE41__ float4& t = (float4 &)a; return (X ? t.x * t.x : 0.0f) + (Y ? t.y * t.y : 0.0f) + (Z ? t.z * t.z : 0.0f) + (W ? t.w * t.w : 0.0f); #else return extract<0>(ssef(_mm_dp_ps(a.m128, a.m128, (X << 4) | (Y << 5) | (Z << 6) | (W << 7) | 0xf))); #endif } ccl_device_inline float dot3(const ssef& a, const ssef& b) { #ifdef __KERNEL_SSE41__ return extract<0>(ssef(_mm_dp_ps(a.m128, b.m128, 0x7f))); #else ssef t = a * b; return ((float*)&t)[0] + ((float*)&t)[1] + ((float*)&t)[2]; #endif } ccl_device_inline const ssef len3_squared_splat(const ssef& a) { return dot3_splat(a, a); } ccl_device_inline float len3_squared(const ssef& a) { return dot3(a, a); } ccl_device_inline float len3(const ssef& a) { return extract<0>(mm_sqrt(dot3_splat(a, a))); } /* SSE shuffle utility functions */ #ifdef __KERNEL_SSSE3__ /* faster version for SSSE3 */ typedef ssei shuffle_swap_t; ccl_device_inline shuffle_swap_t shuffle_swap_identity(void) { return _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); } ccl_device_inline shuffle_swap_t shuffle_swap_swap(void) { return _mm_set_epi8(7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8); } ccl_device_inline const ssef shuffle_swap(const ssef& a, const shuffle_swap_t& shuf) { return cast(_mm_shuffle_epi8(cast(a), shuf)); } #else /* somewhat slower version for SSE2 */ typedef int shuffle_swap_t; ccl_device_inline shuffle_swap_t shuffle_swap_identity(void) { return 0; } ccl_device_inline shuffle_swap_t shuffle_swap_swap(void) { return 1; } ccl_device_inline const ssef shuffle_swap(const ssef& a, shuffle_swap_t shuf) { /* shuffle value must be a constant, so we need to branch */ if(shuf) return ssef(_mm_shuffle_ps(a.m128, a.m128, _MM_SHUFFLE(1, 0, 3, 2))); else return ssef(_mm_shuffle_ps(a.m128, a.m128, _MM_SHUFFLE(3, 2, 1, 0))); } #endif #ifdef __KERNEL_SSE41__ ccl_device_inline void gen_idirsplat_swap(const ssef &pn, const shuffle_swap_t &shuf_identity, const shuffle_swap_t &shuf_swap, const float3& idir, ssef idirsplat[3], shuffle_swap_t shufflexyz[3]) { const __m128 idirsplat_raw[] = { _mm_set_ps1(idir.x), _mm_set_ps1(idir.y), _mm_set_ps1(idir.z) }; idirsplat[0] = _mm_xor_ps(idirsplat_raw[0], pn); idirsplat[1] = _mm_xor_ps(idirsplat_raw[1], pn); idirsplat[2] = _mm_xor_ps(idirsplat_raw[2], pn); const ssef signmask = cast(ssei(0x80000000)); const ssef shuf_identity_f = cast(shuf_identity); const ssef shuf_swap_f = cast(shuf_swap); shufflexyz[0] = _mm_castps_si128(_mm_blendv_ps(shuf_identity_f, shuf_swap_f, _mm_and_ps(idirsplat_raw[0], signmask))); shufflexyz[1] = _mm_castps_si128(_mm_blendv_ps(shuf_identity_f, shuf_swap_f, _mm_and_ps(idirsplat_raw[1], signmask))); shufflexyz[2] = _mm_castps_si128(_mm_blendv_ps(shuf_identity_f, shuf_swap_f, _mm_and_ps(idirsplat_raw[2], signmask))); } #else ccl_device_inline void gen_idirsplat_swap(const ssef &pn, const shuffle_swap_t &shuf_identity, const shuffle_swap_t &shuf_swap, const float3& idir, ssef idirsplat[3], shuffle_swap_t shufflexyz[3]) { idirsplat[0] = ssef(idir.x) ^ pn; idirsplat[1] = ssef(idir.y) ^ pn; idirsplat[2] = ssef(idir.z) ^ pn; shufflexyz[0] = (idir.x >= 0)? shuf_identity: shuf_swap; shufflexyz[1] = (idir.y >= 0)? shuf_identity: shuf_swap; shufflexyz[2] = (idir.z >= 0)? shuf_identity: shuf_swap; } #endif ccl_device_inline const ssef uint32_to_float(const ssei &in) { ssei a = _mm_srli_epi32(in, 16); ssei b = _mm_and_si128(in, _mm_set1_epi32(0x0000ffff)); ssei c = _mm_or_si128(a, _mm_set1_epi32(0x53000000)); ssef d = _mm_cvtepi32_ps(b); ssef e = _mm_sub_ps(_mm_castsi128_ps(c), _mm_castsi128_ps(_mm_set1_epi32(0x53000000))); return _mm_add_ps(e, d); } template ccl_device_inline const ssef set_sign_bit(const ssef &a) { return a ^ cast(ssei(S1 << 31, S2 << 31, S3 << 31, S4 << 31)); } //////////////////////////////////////////////////////////////////////////////// /// Debug Functions //////////////////////////////////////////////////////////////////////////////// ccl_device_inline void print_ssef(const char *label, const ssef &a) { printf("%s: %.8f %.8f %.8f %.8f\n", label, (double)a[0], (double)a[1], (double)a[2], (double)a[3]); } #endif CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_ssei.h000066400000000000000000000350001334742672700215210ustar00rootroot00000000000000/* * Copyright 2011-2013 Intel Corporation * Modifications Copyright 2014, Blender Foundation. * * Licensed under the Apache License, Version 2.0(the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_SSEI_H__ #define __UTIL_SSEI_H__ CCL_NAMESPACE_BEGIN #ifdef __KERNEL_SSE2__ struct sseb; struct ssef; /*! 4-wide SSE integer type. */ struct ssei { typedef sseb Mask; // mask type typedef ssei Int; // int type typedef ssef Float; // float type enum { size = 4 }; // number of SIMD elements union { __m128i m128; int32_t i[4]; }; // data //////////////////////////////////////////////////////////////////////////////// /// Constructors, Assignment & Cast Operators //////////////////////////////////////////////////////////////////////////////// __forceinline ssei ( ) {} __forceinline ssei ( const ssei& a ) { m128 = a.m128; } __forceinline ssei& operator=( const ssei& a ) { m128 = a.m128; return *this; } __forceinline ssei( const __m128i a ) : m128(a) {} __forceinline operator const __m128i&( void ) const { return m128; } __forceinline operator __m128i&( void ) { return m128; } __forceinline ssei ( const int a ) : m128(_mm_set1_epi32(a)) {} __forceinline ssei ( int a, int b, int c, int d ) : m128(_mm_setr_epi32(a, b, c, d)) {} __forceinline explicit ssei( const __m128 a ) : m128(_mm_cvtps_epi32(a)) {} //////////////////////////////////////////////////////////////////////////////// /// Array Access //////////////////////////////////////////////////////////////////////////////// __forceinline const int32_t& operator []( const size_t index ) const { assert(index < 4); return i[index]; } __forceinline int32_t& operator []( const size_t index ) { assert(index < 4); return i[index]; } }; //////////////////////////////////////////////////////////////////////////////// /// Unary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const ssei cast ( const __m128& a ) { return _mm_castps_si128(a); } __forceinline const ssei operator +( const ssei& a ) { return a; } __forceinline const ssei operator -( const ssei& a ) { return _mm_sub_epi32(_mm_setzero_si128(), a.m128); } #if defined(__KERNEL_SSSE3__) __forceinline const ssei abs ( const ssei& a ) { return _mm_abs_epi32(a.m128); } #endif //////////////////////////////////////////////////////////////////////////////// /// Binary Operators //////////////////////////////////////////////////////////////////////////////// __forceinline const ssei operator +( const ssei& a, const ssei& b ) { return _mm_add_epi32(a.m128, b.m128); } __forceinline const ssei operator +( const ssei& a, const int32_t& b ) { return a + ssei(b); } __forceinline const ssei operator +( const int32_t& a, const ssei& b ) { return ssei(a) + b; } __forceinline const ssei operator -( const ssei& a, const ssei& b ) { return _mm_sub_epi32(a.m128, b.m128); } __forceinline const ssei operator -( const ssei& a, const int32_t& b ) { return a - ssei(b); } __forceinline const ssei operator -( const int32_t& a, const ssei& b ) { return ssei(a) - b; } #if defined(__KERNEL_SSE41__) __forceinline const ssei operator *( const ssei& a, const ssei& b ) { return _mm_mullo_epi32(a.m128, b.m128); } __forceinline const ssei operator *( const ssei& a, const int32_t& b ) { return a * ssei(b); } __forceinline const ssei operator *( const int32_t& a, const ssei& b ) { return ssei(a) * b; } #endif __forceinline const ssei operator &( const ssei& a, const ssei& b ) { return _mm_and_si128(a.m128, b.m128); } __forceinline const ssei operator &( const ssei& a, const int32_t& b ) { return a & ssei(b); } __forceinline const ssei operator &( const int32_t& a, const ssei& b ) { return ssei(a) & b; } __forceinline const ssei operator |( const ssei& a, const ssei& b ) { return _mm_or_si128(a.m128, b.m128); } __forceinline const ssei operator |( const ssei& a, const int32_t& b ) { return a | ssei(b); } __forceinline const ssei operator |( const int32_t& a, const ssei& b ) { return ssei(a) | b; } __forceinline const ssei operator ^( const ssei& a, const ssei& b ) { return _mm_xor_si128(a.m128, b.m128); } __forceinline const ssei operator ^( const ssei& a, const int32_t& b ) { return a ^ ssei(b); } __forceinline const ssei operator ^( const int32_t& a, const ssei& b ) { return ssei(a) ^ b; } __forceinline const ssei operator <<( const ssei& a, const int32_t& n ) { return _mm_slli_epi32(a.m128, n); } __forceinline const ssei operator >>( const ssei& a, const int32_t& n ) { return _mm_srai_epi32(a.m128, n); } __forceinline const ssei andnot(const ssei& a, const ssei& b) { return _mm_andnot_si128(a.m128,b.m128); } __forceinline const ssei andnot(const sseb& a, const ssei& b) { return _mm_andnot_si128(cast(a.m128),b.m128); } __forceinline const ssei andnot(const ssei& a, const sseb& b) { return _mm_andnot_si128(a.m128,cast(b.m128)); } __forceinline const ssei sra ( const ssei& a, const int32_t& b ) { return _mm_srai_epi32(a.m128, b); } __forceinline const ssei srl ( const ssei& a, const int32_t& b ) { return _mm_srli_epi32(a.m128, b); } #if defined(__KERNEL_SSE41__) __forceinline const ssei min( const ssei& a, const ssei& b ) { return _mm_min_epi32(a.m128, b.m128); } __forceinline const ssei min( const ssei& a, const int32_t& b ) { return min(a,ssei(b)); } __forceinline const ssei min( const int32_t& a, const ssei& b ) { return min(ssei(a),b); } __forceinline const ssei max( const ssei& a, const ssei& b ) { return _mm_max_epi32(a.m128, b.m128); } __forceinline const ssei max( const ssei& a, const int32_t& b ) { return max(a,ssei(b)); } __forceinline const ssei max( const int32_t& a, const ssei& b ) { return max(ssei(a),b); } #endif //////////////////////////////////////////////////////////////////////////////// /// Assignment Operators //////////////////////////////////////////////////////////////////////////////// __forceinline ssei& operator +=( ssei& a, const ssei& b ) { return a = a + b; } __forceinline ssei& operator +=( ssei& a, const int32_t& b ) { return a = a + b; } __forceinline ssei& operator -=( ssei& a, const ssei& b ) { return a = a - b; } __forceinline ssei& operator -=( ssei& a, const int32_t& b ) { return a = a - b; } #if defined(__KERNEL_SSE41__) __forceinline ssei& operator *=( ssei& a, const ssei& b ) { return a = a * b; } __forceinline ssei& operator *=( ssei& a, const int32_t& b ) { return a = a * b; } #endif __forceinline ssei& operator &=( ssei& a, const ssei& b ) { return a = a & b; } __forceinline ssei& operator &=( ssei& a, const int32_t& b ) { return a = a & b; } __forceinline ssei& operator |=( ssei& a, const ssei& b ) { return a = a | b; } __forceinline ssei& operator |=( ssei& a, const int32_t& b ) { return a = a | b; } __forceinline ssei& operator <<=( ssei& a, const int32_t& b ) { return a = a << b; } __forceinline ssei& operator >>=( ssei& a, const int32_t& b ) { return a = a >> b; } //////////////////////////////////////////////////////////////////////////////// /// Comparison Operators + Select //////////////////////////////////////////////////////////////////////////////// __forceinline const sseb operator ==( const ssei& a, const ssei& b ) { return _mm_castsi128_ps(_mm_cmpeq_epi32 (a.m128, b.m128)); } __forceinline const sseb operator ==( const ssei& a, const int32_t& b ) { return a == ssei(b); } __forceinline const sseb operator ==( const int32_t& a, const ssei& b ) { return ssei(a) == b; } __forceinline const sseb operator !=( const ssei& a, const ssei& b ) { return !(a == b); } __forceinline const sseb operator !=( const ssei& a, const int32_t& b ) { return a != ssei(b); } __forceinline const sseb operator !=( const int32_t& a, const ssei& b ) { return ssei(a) != b; } __forceinline const sseb operator < ( const ssei& a, const ssei& b ) { return _mm_castsi128_ps(_mm_cmplt_epi32 (a.m128, b.m128)); } __forceinline const sseb operator < ( const ssei& a, const int32_t& b ) { return a < ssei(b); } __forceinline const sseb operator < ( const int32_t& a, const ssei& b ) { return ssei(a) < b; } __forceinline const sseb operator >=( const ssei& a, const ssei& b ) { return !(a < b); } __forceinline const sseb operator >=( const ssei& a, const int32_t& b ) { return a >= ssei(b); } __forceinline const sseb operator >=( const int32_t& a, const ssei& b ) { return ssei(a) >= b; } __forceinline const sseb operator > ( const ssei& a, const ssei& b ) { return _mm_castsi128_ps(_mm_cmpgt_epi32 (a.m128, b.m128)); } __forceinline const sseb operator > ( const ssei& a, const int32_t& b ) { return a > ssei(b); } __forceinline const sseb operator > ( const int32_t& a, const ssei& b ) { return ssei(a) > b; } __forceinline const sseb operator <=( const ssei& a, const ssei& b ) { return !(a > b); } __forceinline const sseb operator <=( const ssei& a, const int32_t& b ) { return a <= ssei(b); } __forceinline const sseb operator <=( const int32_t& a, const ssei& b ) { return ssei(a) <= b; } __forceinline const ssei select( const sseb& m, const ssei& t, const ssei& f ) { #ifdef __KERNEL_SSE41__ return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m)); #else return _mm_or_si128(_mm_and_si128(m, t), _mm_andnot_si128(m, f)); #endif } __forceinline const ssei select( const int mask, const ssei& t, const ssei& f ) { #if defined(__KERNEL_SSE41__) && ((!defined(__clang__) && !defined(_MSC_VER)) || defined(__INTEL_COMPILER)) return _mm_castps_si128(_mm_blend_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), mask)); #else return select(sseb(mask),t,f); #endif } //////////////////////////////////////////////////////////////////////////////// // Movement/Shifting/Shuffling Functions //////////////////////////////////////////////////////////////////////////////// __forceinline ssei unpacklo( const ssei& a, const ssei& b ) { return _mm_unpacklo_epi32(a, b); } __forceinline ssei unpackhi( const ssei& a, const ssei& b ) { return _mm_unpackhi_epi32(a, b); } template __forceinline const ssei shuffle( const ssei& a ) { return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)); } template __forceinline const ssei shuffle( const ssei& a, const ssei& b ) { return _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b), _MM_SHUFFLE(i3, i2, i1, i0))); } template __forceinline const ssei shuffle( const ssei& b ) { return shuffle(b); } #if defined(__KERNEL_SSE41__) template __forceinline int extract( const ssei& b ) { return _mm_extract_epi32(b, src); } template __forceinline const ssei insert( const ssei& a, const int32_t b ) { return _mm_insert_epi32(a, b, dst); } #else template __forceinline int extract( const ssei& b ) { return b[src]; } template __forceinline const ssei insert( const ssei& a, const int32_t b ) { ssei c = a; c[dst] = b; return c; } #endif //////////////////////////////////////////////////////////////////////////////// /// Reductions //////////////////////////////////////////////////////////////////////////////// #if defined(__KERNEL_SSE41__) __forceinline const ssei vreduce_min(const ssei& v) { ssei h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); } __forceinline const ssei vreduce_max(const ssei& v) { ssei h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); } __forceinline const ssei vreduce_add(const ssei& v) { ssei h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; } __forceinline int reduce_min(const ssei& v) { return extract<0>(vreduce_min(v)); } __forceinline int reduce_max(const ssei& v) { return extract<0>(vreduce_max(v)); } __forceinline int reduce_add(const ssei& v) { return extract<0>(vreduce_add(v)); } __forceinline size_t select_min(const ssei& v) { return __bsf(movemask(v == vreduce_min(v))); } __forceinline size_t select_max(const ssei& v) { return __bsf(movemask(v == vreduce_max(v))); } __forceinline size_t select_min(const sseb& valid, const ssei& v) { const ssei a = select(valid,v,ssei((int)pos_inf)); return __bsf(movemask(valid & (a == vreduce_min(a)))); } __forceinline size_t select_max(const sseb& valid, const ssei& v) { const ssei a = select(valid,v,ssei((int)neg_inf)); return __bsf(movemask(valid & (a == vreduce_max(a)))); } #else __forceinline int ssei_min(int a, int b) { return (a < b)? a: b; } __forceinline int ssei_max(int a, int b) { return (a > b)? a: b; } __forceinline int reduce_min(const ssei& v) { return ssei_min(ssei_min(v[0],v[1]),ssei_min(v[2],v[3])); } __forceinline int reduce_max(const ssei& v) { return ssei_max(ssei_max(v[0],v[1]),ssei_max(v[2],v[3])); } __forceinline int reduce_add(const ssei& v) { return v[0]+v[1]+v[2]+v[3]; } #endif //////////////////////////////////////////////////////////////////////////////// /// Memory load and store operations //////////////////////////////////////////////////////////////////////////////// __forceinline ssei load4i( const void* const a ) { return _mm_load_si128((__m128i*)a); } __forceinline void store4i(void* ptr, const ssei& v) { _mm_store_si128((__m128i*)ptr,v); } __forceinline void storeu4i(void* ptr, const ssei& v) { _mm_storeu_si128((__m128i*)ptr,v); } __forceinline void store4i( const sseb& mask, void* ptr, const ssei& i ) { #if defined (__KERNEL_AVX__) _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); #else *(ssei*)ptr = select(mask,i,*(ssei*)ptr); #endif } __forceinline ssei load4i_nt (void* ptr) { #if defined(__KERNEL_SSE41__) return _mm_stream_load_si128((__m128i*)ptr); #else return _mm_load_si128((__m128i*)ptr); #endif } __forceinline void store4i_nt(void* ptr, const ssei& v) { #if defined(__KERNEL_SSE41__) _mm_stream_ps((float*)ptr,_mm_castsi128_ps(v)); #else _mm_store_si128((__m128i*)ptr,v); #endif } //////////////////////////////////////////////////////////////////////////////// /// Debug Functions //////////////////////////////////////////////////////////////////////////////// ccl_device_inline void print_ssei(const char *label, const ssei &a) { printf("%s: %df %df %df %d\n", label, a[0], a[1], a[2], a[3]); } #endif CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_stack_allocator.h000066400000000000000000000062151334742672700237310ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_STACK_ALLOCATOR_H__ #define __UTIL_STACK_ALLOCATOR_H__ #include #include CCL_NAMESPACE_BEGIN /* Stack allocator for the use with STL. */ template class ccl_try_align(16) StackAllocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef T *pointer; typedef const T *const_pointer; typedef T& reference; typedef const T& const_reference; typedef T value_type; /* Allocator construction/destruction. */ StackAllocator() : pointer_(0), use_stack_(true) {} StackAllocator(const StackAllocator&) : pointer_(0), use_stack_(true) {} template StackAllocator(const StackAllocator&) : pointer_(0), use_stack_(false) {} /* Memory allocation/deallocation. */ T *allocate(size_t n, const void *hint = 0) { (void)hint; if(n == 0) { return NULL; } if(pointer_ + n >= SIZE || use_stack_ == false) { size_t size = n * sizeof(T); util_guarded_mem_alloc(size); T *mem; #ifdef WITH_BLENDER_GUARDEDALLOC mem = (T*)MEM_mallocN_aligned(size, 16, "Cycles Alloc"); #else mem = (T*)malloc(size); #endif if(mem == NULL) { throw std::bad_alloc(); } return mem; } T *mem = &data_[pointer_]; pointer_ += n; return mem; } void deallocate(T *p, size_t n) { if(p == NULL) { return; } if(p < data_ || p >= data_ + SIZE) { util_guarded_mem_free(n * sizeof(T)); #ifdef WITH_BLENDER_GUARDEDALLOC MEM_freeN(p); #else free(p); #endif return; } /* We don't support memory free for the stack allocator. */ } /* Address of an reference. */ T *address(T& x) const { return &x; } const T *address(const T& x) const { return &x; } /* Object construction/destruction. */ void construct(T *p, const T& val) { if(p != NULL) { new ((T *)p) T(val); } } void destroy(T *p) { p->~T(); } /* Maximum allocation size. */ size_t max_size() const { return size_t(-1); } /* Rebind to other ype of allocator. */ template struct rebind { typedef StackAllocator other; }; /* Operators */ template inline StackAllocator& operator=(const StackAllocator&) { return *this; } StackAllocator& operator=(const StackAllocator&) { return *this; } inline bool operator==(StackAllocator const& /*other*/) const { return true; } inline bool operator!=(StackAllocator const& other) const { return !operator==(other); } private: int pointer_; bool use_stack_; T data_[SIZE]; }; CCL_NAMESPACE_END #endif /* __UTIL_GUARDED_ALLOCATOR_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_static_assert.h000066400000000000000000000052101334742672700234260ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_STATIC_ASSERT_H__ #define __UTIL_STATIC_ASSERT_H__ CCL_NAMESPACE_BEGIN /* TODO(sergey): In theory CUDA might work with own static assert * implementation since it's just pure C++. */ #ifndef __KERNEL_GPU__ # if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) /* C++11 has built-in static_assert() */ # elif defined(static_assert) /* Some platforms might have static_assert() defined even tho their * C++ support wouldn't be declared to be C++11. */ # else /* C++11 or MSVC2015 */ template class StaticAssertFailure; template <> class StaticAssertFailure {}; # define _static_assert_private_glue_impl(A, B) A ## B # define _static_assert_glue(A, B) _static_assert_private_glue_impl(A, B) # ifdef __COUNTER__ # define static_assert(condition, message) \ enum {_static_assert_glue(q_static_assert_result, __COUNTER__) = sizeof(StaticAssertFailure)} // NOLINT # else /* __COUNTER__ */ # define static_assert(condition, message) \ enum {_static_assert_glue(q_static_assert_result, __LINE__) = sizeof(StaticAssertFailure)} // NOLINT # endif /* __COUNTER__ */ # endif /* C++11 or MSVC2015 */ #else /* __KERNEL_GPU__ */ # ifndef static_assert # define static_assert(statement, message) # endif #endif /* __KERNEL_GPU__ */ /* TODO(sergey): For until C++11 is a bare minimum for us, * we do a bit of a trickery to show meaningful message so * it's more or less clear what's wrong when building without * C++11. * * The thing here is: our non-C++11 implementation doesn't * have a way to print any message after preprocessor * substitution so we rely on the message which is passed to * static_assert() since that's the only message visible when * compilation fails. * * After C++11 bump it should be possible to glue structure * name to the error message, */ # define static_assert_align(st, align) \ static_assert((sizeof(st) % (align) == 0), "Structure must be strictly aligned") // NOLINT CCL_NAMESPACE_END #endif /* __UTIL_STATIC_ASSERT_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_stats.h000066400000000000000000000022231334742672700217150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_STATS_H__ #define __UTIL_STATS_H__ #include "util/util_atomic.h" CCL_NAMESPACE_BEGIN class Stats { public: enum static_init_t { static_init = 0 }; Stats() : mem_used(0), mem_peak(0) {} explicit Stats(static_init_t) {} void mem_alloc(size_t size) { atomic_add_and_fetch_z(&mem_used, size); atomic_fetch_and_update_max_z(&mem_peak, mem_used); } void mem_free(size_t size) { assert(mem_used >= size); atomic_sub_and_fetch_z(&mem_used, size); } size_t mem_used; size_t mem_peak; }; CCL_NAMESPACE_END #endif /* __UTIL_STATS_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_string.cpp000066400000000000000000000154371334742672700224330ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include "util/util_foreach.h" #include "util/util_string.h" #include "util/util_windows.h" #ifdef _WIN32 # ifndef vsnprintf # define vsnprintf _vsnprintf # endif #endif /* _WIN32 */ CCL_NAMESPACE_BEGIN string string_printf(const char *format, ...) { vector str(128, 0); while(1) { va_list args; int result; va_start(args, format); result = vsnprintf(&str[0], str.size(), format, args); va_end(args); if(result == -1) { /* not enough space or formatting error */ if(str.size() > 65536) { assert(0); return string(""); } str.resize(str.size()*2, 0); continue; } else if(result >= (int)str.size()) { /* not enough space */ str.resize(result + 1, 0); continue; } return string(&str[0]); } } bool string_iequals(const string& a, const string& b) { if(a.size() == b.size()) { for(size_t i = 0; i < a.size(); i++) if(toupper(a[i]) != toupper(b[i])) return false; return true; } return false; } void string_split(vector& tokens, const string& str, const string& separators, bool skip_empty_tokens) { size_t token_start = 0, token_length = 0; for(size_t i = 0; i < str.size(); ++i) { const char ch = str[i]; if(separators.find(ch) == string::npos) { /* Current character is not a separator, * append it to token by increasing token length. */ ++token_length; } else { /* Current character is a separator, * append current token to the list. */ if(!skip_empty_tokens || token_length > 0) { string token = str.substr(token_start, token_length); tokens.push_back(token); } token_start = i + 1; token_length = 0; } } /* Append token from the tail of the string if exists. */ if(token_length) { string token = str.substr(token_start, token_length); tokens.push_back(token); } } bool string_startswith(const string& s, const char *start) { size_t len = strlen(start); if(len > s.size()) return 0; else return strncmp(s.c_str(), start, len) == 0; } bool string_endswith(const string& s, const char *end) { size_t len = strlen(end); if(len > s.size()) return 0; else return strncmp(s.c_str() + s.size() - len, end, len) == 0; } string string_strip(const string& s) { string result = s; result.erase(0, result.find_first_not_of(' ')); result.erase(result.find_last_not_of(' ') + 1); return result; } void string_replace(string& haystack, const string& needle, const string& other) { size_t i = 0, index; while((index = haystack.find(needle, i)) != string::npos) { haystack.replace(index, needle.size(), other); i = index + other.size(); } } string string_remove_trademark(const string &s) { string result = s; /* Special case, so we don;t leave sequential spaces behind. */ /* TODO(sergey): Consider using regex perhaps? */ string_replace(result, " (TM)", ""); string_replace(result, " (R)", ""); string_replace(result, "(TM)", ""); string_replace(result, "(R)", ""); return string_strip(result); } string string_from_bool(bool var) { if(var) return "True"; else return "False"; } /* Wide char strings helpers for Windows. */ #ifdef _WIN32 wstring string_to_wstring(const string& str) { const int length_wc = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), NULL, 0); wstring str_wc(length_wc, 0); MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), &str_wc[0], length_wc); return str_wc; } string string_from_wstring(const wstring& str) { int length_mb = WideCharToMultiByte(CP_UTF8, 0, str.c_str(), str.size(), NULL, 0, NULL, NULL); string str_mb(length_mb, 0); WideCharToMultiByte(CP_UTF8, 0, str.c_str(), str.size(), &str_mb[0], length_mb, NULL, NULL); return str_mb; } string string_to_ansi(const string& str) { const int length_wc = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), NULL, 0); wstring str_wc(length_wc, 0); MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), &str_wc[0], length_wc); int length_mb = WideCharToMultiByte(CP_ACP, 0, str_wc.c_str(), str_wc.size(), NULL, 0, NULL, NULL); string str_mb(length_mb, 0); WideCharToMultiByte(CP_ACP, 0, str_wc.c_str(), str_wc.size(), &str_mb[0], length_mb, NULL, NULL); return str_mb; } #endif /* _WIN32 */ string string_human_readable_size(size_t size) { static const char suffixes[] = "BKMGTPEZY"; const char* suffix = suffixes; size_t r = 0; while(size >= 1024) { r = size % 1024; size /= 1024; suffix++; } if(*suffix != 'B') return string_printf("%.2f%c", double(size*1024+r)/1024.0, *suffix); else return string_printf("%u", (unsigned int)size); } string string_human_readable_number(size_t num) { if(num == 0) { return "0"; } /* Add thousands separators. */ char buf[32]; char* p = buf+31; *p = '\0'; int i = -1; while(num) { if(++i && i % 3 == 0) *(--p) = ','; *(--p) = '0' + (num % 10); num /= 10; } return p; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_string.h000066400000000000000000000045161334742672700220740ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_STRING_H__ #define __UTIL_STRING_H__ #include #include #include #include "util/util_vector.h" CCL_NAMESPACE_BEGIN using std::string; using std::stringstream; using std::ostringstream; using std::istringstream; #ifdef __GNUC__ #define PRINTF_ATTRIBUTE __attribute__((format(printf, 1, 2))) #else #define PRINTF_ATTRIBUTE #endif string string_printf(const char *format, ...) PRINTF_ATTRIBUTE; bool string_iequals(const string& a, const string& b); void string_split(vector& tokens, const string& str, const string& separators = "\t ", bool skip_empty_tokens = true); void string_replace(string& haystack, const string& needle, const string& other); bool string_startswith(const string& s, const char *start); bool string_endswith(const string& s, const char *end); string string_strip(const string& s); string string_remove_trademark(const string& s); string string_from_bool(const bool var); /* Wide char strings are only used on Windows to deal with non-ascii * characters in file names and such. No reason to use such strings * for something else at this moment. * * Please note that strings are expected to be in UTF-8 codepage, and * if ANSI is needed then explicit conversion required. * */ #ifdef _WIN32 using std::wstring; wstring string_to_wstring(const string& path); string string_from_wstring(const wstring& path); string string_to_ansi(const string& str); #endif /* Make a string from a size in bytes in human readable form */ string string_human_readable_size(size_t size); /* Make a string from a unitless quantity in human readable form */ string string_human_readable_number(size_t num); CCL_NAMESPACE_END #endif /* __UTIL_STRING_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_system.cpp000066400000000000000000000154451334742672700224500ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_system.h" #include "util/util_logging.h" #include "util/util_types.h" #include "util/util_string.h" #ifdef _WIN32 # if(!defined(FREE_WINDOWS)) # include # endif # include "util_windows.h" #elif defined(__APPLE__) # include # include #else # include #endif CCL_NAMESPACE_BEGIN int system_cpu_group_count() { #ifdef _WIN32 util_windows_init_numa_groups(); return GetActiveProcessorGroupCount(); #else /* TODO(sergey): Need to adopt for other platforms. */ return 1; #endif } int system_cpu_group_thread_count(int group) { /* TODO(sergey): Need make other platforms aware of groups. */ #ifdef _WIN32 util_windows_init_numa_groups(); return GetActiveProcessorCount(group); #elif defined(__APPLE__) (void)group; int count; size_t len = sizeof(count); int mib[2] = { CTL_HW, HW_NCPU }; sysctl(mib, 2, &count, &len, NULL, 0); return count; #else (void)group; return sysconf(_SC_NPROCESSORS_ONLN); #endif } int system_cpu_thread_count() { static uint count = 0; if(count > 0) { return count; } int max_group = system_cpu_group_count(); VLOG(1) << "Detected " << max_group << " CPU groups."; for(int group = 0; group < max_group; ++group) { int num_threads = system_cpu_group_thread_count(group); VLOG(1) << "Group " << group << " has " << num_threads << " threads."; count += num_threads; } if(count < 1) { count = 1; } return count; } unsigned short system_cpu_process_groups(unsigned short max_groups, unsigned short *groups) { #ifdef _WIN32 unsigned short group_count = max_groups; if(!GetProcessGroupAffinity(GetCurrentProcess(), &group_count, groups)) { return 0; } return group_count; #else (void) max_groups; (void) groups; return 0; #endif } #if !defined(_WIN32) || defined(FREE_WINDOWS) static void __cpuid(int data[4], int selector) { #ifdef __x86_64__ asm("cpuid" : "=a" (data[0]), "=b" (data[1]), "=c" (data[2]), "=d" (data[3]) : "a"(selector)); #else #ifdef __i386__ asm("pushl %%ebx \n\t" "cpuid \n\t" "movl %%ebx, %1 \n\t" "popl %%ebx \n\t" : "=a" (data[0]), "=r" (data[1]), "=c" (data[2]), "=d" (data[3]) : "a"(selector)); #else data[0] = data[1] = data[2] = data[3] = 0; #endif #endif } #endif string system_cpu_brand_string() { char buf[48]; int result[4]; __cpuid(result, 0x80000000); if(result[0] >= (int)0x80000004) { __cpuid((int*)(buf+0), 0x80000002); __cpuid((int*)(buf+16), 0x80000003); __cpuid((int*)(buf+32), 0x80000004); string brand = buf; /* make it a bit more presentable */ brand = string_remove_trademark(brand); return brand; } return "Unknown CPU"; } int system_cpu_bits() { return (sizeof(void*)*8); } #if defined(__x86_64__) || defined(_M_X64) || defined(i386) || defined(_M_IX86) struct CPUCapabilities { bool x64; bool mmx; bool sse; bool sse2; bool sse3; bool ssse3; bool sse41; bool sse42; bool sse4a; bool avx; bool f16c; bool avx2; bool xop; bool fma3; bool fma4; bool bmi1; bool bmi2; }; static CPUCapabilities& system_cpu_capabilities() { static CPUCapabilities caps; static bool caps_init = false; if(!caps_init) { int result[4], num; memset(&caps, 0, sizeof(caps)); __cpuid(result, 0); num = result[0]; if(num >= 1) { __cpuid(result, 0x00000001); caps.mmx = (result[3] & ((int)1 << 23)) != 0; caps.sse = (result[3] & ((int)1 << 25)) != 0; caps.sse2 = (result[3] & ((int)1 << 26)) != 0; caps.sse3 = (result[2] & ((int)1 << 0)) != 0; caps.ssse3 = (result[2] & ((int)1 << 9)) != 0; caps.sse41 = (result[2] & ((int)1 << 19)) != 0; caps.sse42 = (result[2] & ((int)1 << 20)) != 0; caps.fma3 = (result[2] & ((int)1 << 12)) != 0; caps.avx = false; bool os_uses_xsave_xrestore = (result[2] & ((int)1 << 27)) != 0; bool cpu_avx_support = (result[2] & ((int)1 << 28)) != 0; if( os_uses_xsave_xrestore && cpu_avx_support) { // Check if the OS will save the YMM registers uint32_t xcr_feature_mask; #if defined(__GNUC__) int edx; /* not used */ /* actual opcode for xgetbv */ __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (xcr_feature_mask) , "=d" (edx) : "c" (0) ); #elif defined(_MSC_VER) && defined(_XCR_XFEATURE_ENABLED_MASK) xcr_feature_mask = (uint32_t)_xgetbv(_XCR_XFEATURE_ENABLED_MASK); /* min VS2010 SP1 compiler is required */ #else xcr_feature_mask = 0; #endif caps.avx = (xcr_feature_mask & 0x6) == 0x6; } caps.f16c = (result[2] & ((int)1 << 29)) != 0; __cpuid(result, 0x00000007); caps.bmi1 = (result[1] & ((int)1 << 3)) != 0; caps.bmi2 = (result[1] & ((int)1 << 8)) != 0; caps.avx2 = (result[1] & ((int)1 << 5)) != 0; } caps_init = true; } return caps; } bool system_cpu_support_sse2() { CPUCapabilities& caps = system_cpu_capabilities(); return caps.sse && caps.sse2; } bool system_cpu_support_sse3() { CPUCapabilities& caps = system_cpu_capabilities(); return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3; } bool system_cpu_support_sse41() { CPUCapabilities& caps = system_cpu_capabilities(); return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41; } bool system_cpu_support_avx() { CPUCapabilities& caps = system_cpu_capabilities(); return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx; } bool system_cpu_support_avx2() { CPUCapabilities& caps = system_cpu_capabilities(); return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx && caps.f16c && caps.avx2 && caps.fma3 && caps.bmi1 && caps.bmi2; } #else bool system_cpu_support_sse2() { return false; } bool system_cpu_support_sse3() { return false; } bool system_cpu_support_sse41() { return false; } bool system_cpu_support_avx() { return false; } bool system_cpu_support_avx2() { return false; } #endif size_t system_physical_ram() { #ifdef _WIN32 MEMORYSTATUSEX ram; ram.dwLength = sizeof (ram); GlobalMemoryStatusEx(&ram); return ram.ullTotalPhys * 1024; #elif defined(__APPLE__) uint64_t ram = 0; size_t len = sizeof(ram); if (sysctlbyname("hw.memsize", &ram, &len, NULL, 0) == 0) { return ram; } return 0; #else size_t ps = sysconf(_SC_PAGESIZE); size_t pn = sysconf(_SC_PHYS_PAGES); return ps * pn; #endif } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_system.h000066400000000000000000000026421334742672700221100ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_SYSTEM_H__ #define __UTIL_SYSTEM_H__ #include "util/util_string.h" CCL_NAMESPACE_BEGIN /* Get number of available CPU groups. */ int system_cpu_group_count(); /* Get number of threads/processors in the specified group. */ int system_cpu_group_thread_count(int group); /* Get total number of threads in all groups. */ int system_cpu_thread_count(); /* Get current process groups. */ unsigned short system_cpu_process_groups(unsigned short max_groups, unsigned short *grpups); string system_cpu_brand_string(); int system_cpu_bits(); bool system_cpu_support_sse2(); bool system_cpu_support_sse3(); bool system_cpu_support_sse41(); bool system_cpu_support_avx(); bool system_cpu_support_avx2(); size_t system_physical_ram(); CCL_NAMESPACE_END #endif /* __UTIL_SYSTEM_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_task.cpp000066400000000000000000000245651334742672700220710ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_foreach.h" #include "util/util_logging.h" #include "util/util_system.h" #include "util/util_task.h" #include "util/util_time.h" //#define THREADING_DEBUG_ENABLED #ifdef THREADING_DEBUG_ENABLED #include #define THREADING_DEBUG(...) do { printf(__VA_ARGS__); fflush(stdout); } while(0) #else #define THREADING_DEBUG(...) #endif CCL_NAMESPACE_BEGIN /* Task Pool */ TaskPool::TaskPool() { num_tasks_handled = 0; num = 0; do_cancel = false; } TaskPool::~TaskPool() { stop(); } void TaskPool::push(Task *task, bool front) { TaskScheduler::Entry entry; entry.task = task; entry.pool = this; TaskScheduler::push(entry, front); } void TaskPool::push(const TaskRunFunction& run, bool front) { push(new Task(run), front); } void TaskPool::wait_work(Summary *stats) { thread_scoped_lock num_lock(num_mutex); while(num != 0) { num_lock.unlock(); thread_scoped_lock queue_lock(TaskScheduler::queue_mutex); /* find task from this pool. if we get a task from another pool, * we can get into deadlock */ TaskScheduler::Entry work_entry; bool found_entry = false; list::iterator it; for(it = TaskScheduler::queue.begin(); it != TaskScheduler::queue.end(); it++) { TaskScheduler::Entry& entry = *it; if(entry.pool == this) { work_entry = entry; found_entry = true; TaskScheduler::queue.erase(it); break; } } queue_lock.unlock(); /* if found task, do it, otherwise wait until other tasks are done */ if(found_entry) { /* run task */ work_entry.task->run(0); /* delete task */ delete work_entry.task; /* notify pool task was done */ num_decrease(1); } num_lock.lock(); if(num == 0) break; if(!found_entry) { THREADING_DEBUG("num==%d, Waiting for condition in TaskPool::wait_work !found_entry\n", num); num_cond.wait(num_lock); THREADING_DEBUG("num==%d, condition wait done in TaskPool::wait_work !found_entry\n", num); } } if(stats != NULL) { stats->time_total = time_dt() - start_time; stats->num_tasks_handled = num_tasks_handled; } } void TaskPool::cancel() { do_cancel = true; TaskScheduler::clear(this); { thread_scoped_lock num_lock(num_mutex); while(num) { THREADING_DEBUG("num==%d, Waiting for condition in TaskPool::cancel\n", num); num_cond.wait(num_lock); THREADING_DEBUG("num==%d condition wait done in TaskPool::cancel\n", num); } } do_cancel = false; } void TaskPool::stop() { TaskScheduler::clear(this); assert(num == 0); } bool TaskPool::canceled() { return do_cancel; } void TaskPool::num_decrease(int done) { num_mutex.lock(); num -= done; assert(num >= 0); if(num == 0) { THREADING_DEBUG("num==%d, notifying all in TaskPool::num_decrease\n", num); num_cond.notify_all(); } num_mutex.unlock(); } void TaskPool::num_increase() { thread_scoped_lock num_lock(num_mutex); if(num_tasks_handled == 0) { start_time = time_dt(); } num++; num_tasks_handled++; THREADING_DEBUG("num==%d, notifying all in TaskPool::num_increase\n", num); num_cond.notify_all(); } /* Task Scheduler */ thread_mutex TaskScheduler::mutex; int TaskScheduler::users = 0; vector TaskScheduler::threads; bool TaskScheduler::do_exit = false; list TaskScheduler::queue; thread_mutex TaskScheduler::queue_mutex; thread_condition_variable TaskScheduler::queue_cond; void TaskScheduler::init(int num_threads) { thread_scoped_lock lock(mutex); /* multiple cycles instances can use this task scheduler, sharing the same * threads, so we keep track of the number of users. */ if(users == 0) { do_exit = false; const bool use_auto_threads = (num_threads == 0); if(use_auto_threads) { /* automatic number of threads */ num_threads = system_cpu_thread_count(); } VLOG(1) << "Creating pool of " << num_threads << " threads."; /* launch threads that will be waiting for work */ threads.resize(num_threads); const int num_groups = system_cpu_group_count(); unsigned short num_process_groups = 0; vector process_groups; int current_group_threads = 0; if(num_groups > 1) { process_groups.resize(num_groups); num_process_groups = system_cpu_process_groups(num_groups, &process_groups[0]); if(num_process_groups == 1) { current_group_threads = system_cpu_group_thread_count(process_groups[0]); } } int thread_index = 0; for(int group = 0; group < num_groups; ++group) { /* NOTE: That's not really efficient from threading point of view, * but it is simple to read and it doesn't make sense to use more * user-specified threads than logical threads anyway. */ int num_group_threads = (group == num_groups - 1) ? (threads.size() - thread_index) : system_cpu_group_thread_count(group); for(int group_thread = 0; group_thread < num_group_threads && thread_index < threads.size(); ++group_thread, ++thread_index) { /* NOTE: Thread group of -1 means we would not force thread affinity. */ int thread_group; if(num_groups == 1) { /* Use default affinity if there's only one CPU group in the system. */ thread_group = -1; } else if(use_auto_threads && num_process_groups == 1 && num_threads <= current_group_threads) { /* If we fit into curent CPU group we also don't force any affinity. */ thread_group = -1; } else { thread_group = group; } threads[thread_index] = new thread(function_bind(&TaskScheduler::thread_run, thread_index + 1), thread_group); } } } users++; } void TaskScheduler::exit() { thread_scoped_lock lock(mutex); users--; if(users == 0) { /* stop all waiting threads */ TaskScheduler::queue_mutex.lock(); do_exit = true; TaskScheduler::queue_cond.notify_all(); TaskScheduler::queue_mutex.unlock(); /* delete threads */ foreach(thread *t, threads) { t->join(); delete t; } threads.clear(); } } void TaskScheduler::free_memory() { assert(users == 0); threads.free_memory(); } bool TaskScheduler::thread_wait_pop(Entry& entry) { thread_scoped_lock queue_lock(queue_mutex); while(queue.empty() && !do_exit) queue_cond.wait(queue_lock); if(queue.empty()) { assert(do_exit); return false; } entry = queue.front(); queue.pop_front(); return true; } void TaskScheduler::thread_run(int thread_id) { Entry entry; /* todo: test affinity/denormal mask */ /* keep popping off tasks */ while(thread_wait_pop(entry)) { /* run task */ entry.task->run(thread_id); /* delete task */ delete entry.task; /* notify pool task was done */ entry.pool->num_decrease(1); } } void TaskScheduler::push(Entry& entry, bool front) { entry.pool->num_increase(); /* add entry to queue */ TaskScheduler::queue_mutex.lock(); if(front) TaskScheduler::queue.push_front(entry); else TaskScheduler::queue.push_back(entry); TaskScheduler::queue_cond.notify_one(); TaskScheduler::queue_mutex.unlock(); } void TaskScheduler::clear(TaskPool *pool) { thread_scoped_lock queue_lock(TaskScheduler::queue_mutex); /* erase all tasks from this pool from the queue */ list::iterator it = queue.begin(); int done = 0; while(it != queue.end()) { Entry& entry = *it; if(entry.pool == pool) { done++; delete entry.task; it = queue.erase(it); } else it++; } queue_lock.unlock(); /* notify done */ pool->num_decrease(done); } /* Dedicated Task Pool */ DedicatedTaskPool::DedicatedTaskPool() { do_cancel = false; do_exit = false; num = 0; worker_thread = new thread(function_bind(&DedicatedTaskPool::thread_run, this)); } DedicatedTaskPool::~DedicatedTaskPool() { stop(); worker_thread->join(); delete worker_thread; } void DedicatedTaskPool::push(Task *task, bool front) { num_increase(); /* add task to queue */ queue_mutex.lock(); if(front) queue.push_front(task); else queue.push_back(task); queue_cond.notify_one(); queue_mutex.unlock(); } void DedicatedTaskPool::push(const TaskRunFunction& run, bool front) { push(new Task(run), front); } void DedicatedTaskPool::wait() { thread_scoped_lock num_lock(num_mutex); while(num) num_cond.wait(num_lock); } void DedicatedTaskPool::cancel() { do_cancel = true; clear(); wait(); do_cancel = false; } void DedicatedTaskPool::stop() { clear(); do_exit = true; queue_cond.notify_all(); wait(); assert(num == 0); } bool DedicatedTaskPool::canceled() { return do_cancel; } void DedicatedTaskPool::num_decrease(int done) { thread_scoped_lock num_lock(num_mutex); num -= done; assert(num >= 0); if(num == 0) num_cond.notify_all(); } void DedicatedTaskPool::num_increase() { thread_scoped_lock num_lock(num_mutex); num++; num_cond.notify_all(); } bool DedicatedTaskPool::thread_wait_pop(Task*& task) { thread_scoped_lock queue_lock(queue_mutex); while(queue.empty() && !do_exit) queue_cond.wait(queue_lock); if(queue.empty()) { assert(do_exit); return false; } task = queue.front(); queue.pop_front(); return true; } void DedicatedTaskPool::thread_run() { Task *task; /* keep popping off tasks */ while(thread_wait_pop(task)) { /* run task */ task->run(0); /* delete task */ delete task; /* notify task was done */ num_decrease(1); } } void DedicatedTaskPool::clear() { thread_scoped_lock queue_lock(queue_mutex); /* erase all tasks from the queue */ list::iterator it = queue.begin(); int done = 0; while(it != queue.end()) { done++; delete *it; it = queue.erase(it); } queue_lock.unlock(); /* notify done */ num_decrease(done); } string TaskPool::Summary::full_report() const { string report = ""; report += string_printf("Total time: %f\n", time_total); report += string_printf("Tasks handled: %d\n", num_tasks_handled); return report; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_task.h000066400000000000000000000115231334742672700215240ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TASK_H__ #define __UTIL_TASK_H__ #include "util/util_list.h" #include "util/util_string.h" #include "util/util_thread.h" #include "util/util_vector.h" CCL_NAMESPACE_BEGIN class Task; class TaskPool; class TaskScheduler; /* Notes on Thread ID * * Thread ID argument reports the 0-based ID of a working thread from which * the run() callback is being invoked. Thread ID of 0 denotes the thread from * which wait_work() was called. * * DO NOT use this ID to control execution flaw, use it only for things like * emulating TLS which does not affect on scheduling. Don't use this ID to make * any decisions. * * It is to be noted here that dedicated task pool will always report thread ID * of 0. */ typedef function TaskRunFunction; /* Task * * Base class for tasks to be executed in threads. */ class Task { public: Task() {}; explicit Task(const TaskRunFunction& run_) : run(run_) {} virtual ~Task() {} TaskRunFunction run; }; /* Task Pool * * Pool of tasks that will be executed by the central TaskScheduler.For each * pool, we can wait for all tasks to be done, or cancel them before they are * done. * * The run callback that actually executes the task may be created like this: * function_bind(&MyClass::task_execute, this, _1, _2) */ class TaskPool { public: struct Summary { /* Time spent to handle all tasks. */ double time_total; /* Number of all tasks handled by this pool. */ int num_tasks_handled; /* A full multiline description of the state of the pool after * all work is done. */ string full_report() const; }; TaskPool(); ~TaskPool(); void push(Task *task, bool front = false); void push(const TaskRunFunction& run, bool front = false); void wait_work(Summary *stats = NULL); /* work and wait until all tasks are done */ void cancel(); /* cancel all tasks, keep worker threads running */ void stop(); /* stop all worker threads */ bool canceled(); /* for worker threads, test if canceled */ protected: friend class TaskScheduler; void num_decrease(int done); void num_increase(); thread_mutex num_mutex; thread_condition_variable num_cond; int num; bool do_cancel; /* ** Statistics ** */ /* Time time stamp of first task pushed. */ double start_time; /* Number of all tasks handled by this pool. */ int num_tasks_handled; }; /* Task Scheduler * * Central scheduler that holds running threads ready to execute tasks. A singe * queue holds the task from all pools. */ class TaskScheduler { public: static void init(int num_threads = 0); static void exit(); static void free_memory(); /* number of threads that can work on task */ static int num_threads() { return threads.size(); } /* test if any session is using the scheduler */ static bool active() { return users != 0; } protected: friend class TaskPool; struct Entry { Task *task; TaskPool *pool; }; static thread_mutex mutex; static int users; static vector threads; static bool do_exit; static list queue; static thread_mutex queue_mutex; static thread_condition_variable queue_cond; static void thread_run(int thread_id); static bool thread_wait_pop(Entry& entry); static void push(Entry& entry, bool front); static void clear(TaskPool *pool); }; /* Dedicated Task Pool * * Like a TaskPool, but will launch one dedicated thread to execute all tasks. * * The run callback that actually executes the task may be created like this: * function_bind(&MyClass::task_execute, this, _1, _2) */ class DedicatedTaskPool { public: DedicatedTaskPool(); ~DedicatedTaskPool(); void push(Task *task, bool front = false); void push(const TaskRunFunction& run, bool front = false); void wait(); /* wait until all tasks are done */ void cancel(); /* cancel all tasks, keep worker thread running */ void stop(); /* stop worker thread */ bool canceled(); /* for worker thread, test if canceled */ protected: void num_decrease(int done); void num_increase(); void thread_run(); bool thread_wait_pop(Task*& entry); void clear(); thread_mutex num_mutex; thread_condition_variable num_cond; list queue; thread_mutex queue_mutex; thread_condition_variable queue_cond; int num; bool do_cancel; bool do_exit; thread *worker_thread; }; CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_texture.h000066400000000000000000000047251334742672700222700ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TEXTURE_H__ #define __UTIL_TEXTURE_H__ CCL_NAMESPACE_BEGIN /* Texture limits on devices. */ #define TEX_NUM_MAX (INT_MAX >> 4) /* Color to use when textures are not found. */ #define TEX_IMAGE_MISSING_R 1 #define TEX_IMAGE_MISSING_G 0 #define TEX_IMAGE_MISSING_B 1 #define TEX_IMAGE_MISSING_A 1 /* Texture type. */ #define kernel_tex_type(tex) (tex & IMAGE_DATA_TYPE_MASK) /* Interpolation types for textures * cuda also use texture space to store other objects */ typedef enum InterpolationType { INTERPOLATION_NONE = -1, INTERPOLATION_LINEAR = 0, INTERPOLATION_CLOSEST = 1, INTERPOLATION_CUBIC = 2, INTERPOLATION_SMART = 3, INTERPOLATION_NUM_TYPES, } InterpolationType; /* Texture types * Since we store the type in the lower bits of a flat index, * the shift and bit mask constant below need to be kept in sync. */ typedef enum ImageDataType { IMAGE_DATA_TYPE_FLOAT4 = 0, IMAGE_DATA_TYPE_BYTE4 = 1, IMAGE_DATA_TYPE_HALF4 = 2, IMAGE_DATA_TYPE_FLOAT = 3, IMAGE_DATA_TYPE_BYTE = 4, IMAGE_DATA_TYPE_HALF = 5, IMAGE_DATA_NUM_TYPES } ImageDataType; #define IMAGE_DATA_TYPE_SHIFT 3 #define IMAGE_DATA_TYPE_MASK 0x7 /* Extension types for textures. * * Defines how the image is extrapolated past its original bounds. */ typedef enum ExtensionType { /* Cause the image to repeat horizontally and vertically. */ EXTENSION_REPEAT = 0, /* Extend by repeating edge pixels of the image. */ EXTENSION_EXTEND = 1, /* Clip to image size and set exterior pixels as transparent. */ EXTENSION_CLIP = 2, EXTENSION_NUM_TYPES, } ExtensionType; typedef struct TextureInfo { /* Pointer, offset or texture depending on device. */ uint64_t data; /* Buffer number for OpenCL. */ uint cl_buffer; /* Interpolation and extension type. */ uint interpolation, extension; /* Dimensions. */ uint width, height, depth; } TextureInfo; CCL_NAMESPACE_END #endif /* __UTIL_TEXTURE_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_thread.cpp000066400000000000000000000031761334742672700223710ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_thread.h" #include "util/util_system.h" #include "util/util_windows.h" CCL_NAMESPACE_BEGIN thread::thread(function run_cb, int group) : run_cb_(run_cb), joined_(false), group_(group) { pthread_create(&pthread_id_, NULL, run, (void*)this); } thread::~thread() { if(!joined_) { join(); } } void *thread::run(void *arg) { thread *self = (thread*)(arg); if(self->group_ != -1) { #ifdef _WIN32 HANDLE thread_handle = GetCurrentThread(); GROUP_AFFINITY group_affinity = { 0 }; int num_threads = system_cpu_group_thread_count(self->group_); group_affinity.Group = self->group_; group_affinity.Mask = (num_threads == 64) ? -1 : (1ull << num_threads) - 1; if(SetThreadGroupAffinity(thread_handle, &group_affinity, NULL) == 0) { fprintf(stderr, "Error setting thread affinity.\n"); } #endif } self->run_cb_(); return NULL; } bool thread::join() { joined_ = true; return pthread_join(pthread_id_, NULL) == 0; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_thread.h000066400000000000000000000053611334742672700220340ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_THREAD_H__ #define __UTIL_THREAD_H__ #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) # include # include # include # include #else # include #endif #include #include #ifdef __APPLE__ # include #endif #include "util/util_function.h" CCL_NAMESPACE_BEGIN #if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) typedef std::mutex thread_mutex; typedef std::unique_lock thread_scoped_lock; typedef std::condition_variable thread_condition_variable; #else /* use boost for mutexes */ typedef boost::mutex thread_mutex; typedef boost::mutex::scoped_lock thread_scoped_lock; typedef boost::condition_variable thread_condition_variable; #endif /* own pthread based implementation, to avoid boost version conflicts with * dynamically loaded blender plugins */ class thread { public: thread(function run_cb, int group = -1); ~thread(); static void *run(void *arg); bool join(); protected: function run_cb_; pthread_t pthread_id_; bool joined_; int group_; }; /* Own wrapper around pthread's spin lock to make it's use easier. */ class thread_spin_lock { public: #ifdef __APPLE__ inline thread_spin_lock() { spin_ = OS_SPINLOCK_INIT; } inline void lock() { OSSpinLockLock(&spin_); } inline void unlock() { OSSpinLockUnlock(&spin_); } #else /* __APPLE__ */ inline thread_spin_lock() { pthread_spin_init(&spin_, 0); } inline ~thread_spin_lock() { pthread_spin_destroy(&spin_); } inline void lock() { pthread_spin_lock(&spin_); } inline void unlock() { pthread_spin_unlock(&spin_); } #endif /* __APPLE__ */ protected: #ifdef __APPLE__ OSSpinLock spin_; #else pthread_spinlock_t spin_; #endif }; class thread_scoped_spin_lock { public: explicit thread_scoped_spin_lock(thread_spin_lock& lock) : lock_(lock) { lock_.lock(); } ~thread_scoped_spin_lock() { lock_.unlock(); } /* TODO(sergey): Implement manual control over lock/unlock. */ protected: thread_spin_lock& lock_; }; CCL_NAMESPACE_END #endif /* __UTIL_THREAD_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_time.cpp000066400000000000000000000026741334742672700220620ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "util/util_time.h" #include "util/util_windows.h" #ifdef _WIN32 CCL_NAMESPACE_BEGIN double time_dt() { __int64 frequency, counter; QueryPerformanceFrequency((LARGE_INTEGER*)&frequency); QueryPerformanceCounter((LARGE_INTEGER*)&counter); return (double)counter/(double)frequency; } void time_sleep(double t) { Sleep((int)(t*1000)); } CCL_NAMESPACE_END #else #include #include CCL_NAMESPACE_BEGIN double time_dt() { struct timeval now; gettimeofday(&now, NULL); return now.tv_sec + now.tv_usec*1e-6; } /* sleep t seconds */ void time_sleep(double t) { /* get whole seconds */ int s = (int)t; if(s >= 1) { sleep(s); /* adjust parameter to remove whole seconds */ t -= s; } /* get microseconds */ int us = (int)(t * 1e6); if(us > 0) usleep(us); } CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_time.h000066400000000000000000000023401334742672700215150ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TIME_H__ #define __UTIL_TIME_H__ CCL_NAMESPACE_BEGIN /* Give current time in seconds in double precision, with good accuracy. */ double time_dt(); /* Sleep for the specified number of seconds */ void time_sleep(double t); class scoped_timer { public: explicit scoped_timer(double *value = NULL) : value_(value) { time_start_ = time_dt(); } ~scoped_timer() { if(value_ != NULL) { *value_ = get_time(); } } double get_start() const { return time_start_; } double get_time() const { return time_dt() - time_start_; } protected: double *value_; double time_start_; }; CCL_NAMESPACE_END #endif goxel-0.8.1/ext_src/cycles/src/util/util_transform.cpp000066400000000000000000000157611334742672700231400ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Adapted from code with license: * * Copyright (c) 2002, Industrial Light & Magic, a division of Lucas * Digital Ltd. LLC. 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 Industrial Light & Magic 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. */ #include "util/util_transform.h" #include "util/util_boundbox.h" #include "util/util_math.h" CCL_NAMESPACE_BEGIN /* Transform Inverse */ static bool transform_matrix4_gj_inverse(float R[][4], float M[][4]) { /* forward elimination */ for(int i = 0; i < 4; i++) { int pivot = i; float pivotsize = M[i][i]; if(pivotsize < 0) pivotsize = -pivotsize; for(int j = i + 1; j < 4; j++) { float tmp = M[j][i]; if(tmp < 0) tmp = -tmp; if(tmp > pivotsize) { pivot = j; pivotsize = tmp; } } if(UNLIKELY(pivotsize == 0.0f)) return false; if(pivot != i) { for(int j = 0; j < 4; j++) { float tmp; tmp = M[i][j]; M[i][j] = M[pivot][j]; M[pivot][j] = tmp; tmp = R[i][j]; R[i][j] = R[pivot][j]; R[pivot][j] = tmp; } } for(int j = i + 1; j < 4; j++) { float f = M[j][i] / M[i][i]; for(int k = 0; k < 4; k++) { M[j][k] -= f*M[i][k]; R[j][k] -= f*R[i][k]; } } } /* backward substitution */ for(int i = 3; i >= 0; --i) { float f; if(UNLIKELY((f = M[i][i]) == 0.0f)) return false; for(int j = 0; j < 4; j++) { M[i][j] /= f; R[i][j] /= f; } for(int j = 0; j < i; j++) { f = M[j][i]; for(int k = 0; k < 4; k++) { M[j][k] -= f*M[i][k]; R[j][k] -= f*R[i][k]; } } } return true; } Transform transform_inverse(const Transform& tfm) { Transform tfmR = transform_identity(); float M[4][4], R[4][4]; memcpy(R, &tfmR, sizeof(R)); memcpy(M, &tfm, sizeof(M)); if(UNLIKELY(!transform_matrix4_gj_inverse(R, M))) { /* matrix is degenerate (e.g. 0 scale on some axis), ideally we should * never be in this situation, but try to invert it anyway with tweak */ M[0][0] += 1e-8f; M[1][1] += 1e-8f; M[2][2] += 1e-8f; if(UNLIKELY(!transform_matrix4_gj_inverse(R, M))) { return transform_identity(); } } memcpy(&tfmR, R, sizeof(R)); return tfmR; } /* Motion Transform */ float4 transform_to_quat(const Transform& tfm) { double trace = (double)(tfm[0][0] + tfm[1][1] + tfm[2][2]); float4 qt; if(trace > 0.0) { double s = sqrt(trace + 1.0); qt.w = (float)(s/2.0); s = 0.5/s; qt.x = (float)((double)(tfm[2][1] - tfm[1][2]) * s); qt.y = (float)((double)(tfm[0][2] - tfm[2][0]) * s); qt.z = (float)((double)(tfm[1][0] - tfm[0][1]) * s); } else { int i = 0; if(tfm[1][1] > tfm[i][i]) i = 1; if(tfm[2][2] > tfm[i][i]) i = 2; int j = (i + 1)%3; int k = (j + 1)%3; double s = sqrt((double)(tfm[i][i] - (tfm[j][j] + tfm[k][k])) + 1.0); double q[3]; q[i] = s * 0.5; if(s != 0.0) s = 0.5/s; double w = (double)(tfm[k][j] - tfm[j][k]) * s; q[j] = (double)(tfm[j][i] + tfm[i][j]) * s; q[k] = (double)(tfm[k][i] + tfm[i][k]) * s; qt.x = (float)q[0]; qt.y = (float)q[1]; qt.z = (float)q[2]; qt.w = (float)w; } return qt; } static void transform_decompose(Transform *decomp, const Transform *tfm) { /* extract translation */ decomp->y = make_float4(tfm->x.w, tfm->y.w, tfm->z.w, 0.0f); /* extract rotation */ Transform M = *tfm; M.x.w = 0.0f; M.y.w = 0.0f; M.z.w = 0.0f; M.w.w = 1.0f; Transform R = M; float norm; int iteration = 0; do { Transform Rnext; Transform Rit = transform_inverse(transform_transpose(R)); for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) Rnext[i][j] = 0.5f * (R[i][j] + Rit[i][j]); norm = 0.0f; for(int i = 0; i < 3; i++) { norm = max(norm, fabsf(R[i][0] - Rnext[i][0]) + fabsf(R[i][1] - Rnext[i][1]) + fabsf(R[i][2] - Rnext[i][2])); } R = Rnext; iteration++; } while(iteration < 100 && norm > 1e-4f); if(transform_negative_scale(R)) R = R * transform_scale(-1.0f, -1.0f, -1.0f); decomp->x = transform_to_quat(R); /* extract scale and pack it */ Transform scale = transform_inverse(R) * M; decomp->y.w = scale.x.x; decomp->z = make_float4(scale.x.y, scale.x.z, scale.y.x, scale.y.y); decomp->w = make_float4(scale.y.z, scale.z.x, scale.z.y, scale.z.z); } void transform_motion_decompose(MotionTransform *decomp, const MotionTransform *motion, const Transform *mid) { transform_decompose(&decomp->pre, &motion->pre); transform_decompose(&decomp->mid, mid); transform_decompose(&decomp->post, &motion->post); /* ensure rotation around shortest angle, negated quaternions are the same * but this means we don't have to do the check in quat_interpolate */ if(dot(decomp->pre.x, decomp->mid.x) < 0.0f) decomp->pre.x = -decomp->pre.x; if(dot(decomp->mid.x, decomp->post.x) < 0.0f) decomp->mid.x = -decomp->mid.x; } Transform transform_from_viewplane(BoundBox2D& viewplane) { return transform_scale(1.0f / (viewplane.right - viewplane.left), 1.0f / (viewplane.top - viewplane.bottom), 1.0f) * transform_translate(-viewplane.left, -viewplane.bottom, 0.0f); } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_transform.h000066400000000000000000000376621334742672700226110ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TRANSFORM_H__ #define __UTIL_TRANSFORM_H__ #ifndef __KERNEL_GPU__ #include #endif #include "util/util_math.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* Data Types */ typedef struct Transform { float4 x, y, z, w; /* rows */ #ifndef __KERNEL_GPU__ float4 operator[](int i) const { return *(&x + i); } float4& operator[](int i) { return *(&x + i); } #endif } Transform; /* transform decomposed in rotation/translation/scale. we use the same data * structure as Transform, and tightly pack decomposition into it. first the * rotation (4), then translation (3), then 3x3 scale matrix (9). */ typedef struct ccl_may_alias MotionTransform { Transform pre; Transform mid; Transform post; } MotionTransform; typedef struct PerspectiveMotionTransform { Transform pre; Transform post; } PerspectiveMotionTransform; /* Functions */ ccl_device_inline float3 transform_perspective(const Transform *t, const float3 a) { float4 b = make_float4(a.x, a.y, a.z, 1.0f); float3 c = make_float3(dot(t->x, b), dot(t->y, b), dot(t->z, b)); float w = dot(t->w, b); return (w != 0.0f)? c/w: make_float3(0.0f, 0.0f, 0.0f); } ccl_device_inline float3 transform_point(const Transform *t, const float3 a) { /* TODO(sergey): Disabled for now, causes crashes in certain cases. */ #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) ssef x, y, z, w, aa; aa = a.m128; x = _mm_loadu_ps(&t->x.x); y = _mm_loadu_ps(&t->y.x); z = _mm_loadu_ps(&t->z.x); w = _mm_loadu_ps(&t->w.x); _MM_TRANSPOSE4_PS(x, y, z, w); ssef tmp = shuffle<0>(aa) * x; tmp = madd(shuffle<1>(aa), y, tmp); tmp = madd(shuffle<2>(aa), z, tmp); tmp += w; return float3(tmp.m128); #else float3 c = make_float3( a.x*t->x.x + a.y*t->x.y + a.z*t->x.z + t->x.w, a.x*t->y.x + a.y*t->y.y + a.z*t->y.z + t->y.w, a.x*t->z.x + a.y*t->z.y + a.z*t->z.z + t->z.w); return c; #endif } ccl_device_inline float3 transform_direction(const Transform *t, const float3 a) { #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) ssef x, y, z, w, aa; aa = a.m128; x = _mm_loadu_ps(&t->x.x); y = _mm_loadu_ps(&t->y.x); z = _mm_loadu_ps(&t->z.x); w = _mm_setzero_ps(); _MM_TRANSPOSE4_PS(x, y, z, w); ssef tmp = shuffle<0>(aa) * x; tmp = madd(shuffle<1>(aa), y, tmp); tmp = madd(shuffle<2>(aa), z, tmp); return float3(tmp.m128); #else float3 c = make_float3( a.x*t->x.x + a.y*t->x.y + a.z*t->x.z, a.x*t->y.x + a.y*t->y.y + a.z*t->y.z, a.x*t->z.x + a.y*t->z.y + a.z*t->z.z); return c; #endif } ccl_device_inline float3 transform_direction_transposed(const Transform *t, const float3 a) { float3 x = make_float3(t->x.x, t->y.x, t->z.x); float3 y = make_float3(t->x.y, t->y.y, t->z.y); float3 z = make_float3(t->x.z, t->y.z, t->z.z); return make_float3(dot(x, a), dot(y, a), dot(z, a)); } ccl_device_inline Transform transform_transpose(const Transform a) { Transform t; t.x.x = a.x.x; t.x.y = a.y.x; t.x.z = a.z.x; t.x.w = a.w.x; t.y.x = a.x.y; t.y.y = a.y.y; t.y.z = a.z.y; t.y.w = a.w.y; t.z.x = a.x.z; t.z.y = a.y.z; t.z.z = a.z.z; t.z.w = a.w.z; t.w.x = a.x.w; t.w.y = a.y.w; t.w.z = a.z.w; t.w.w = a.w.w; return t; } ccl_device_inline Transform make_transform(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float m, float n, float o, float p) { Transform t; t.x.x = a; t.x.y = b; t.x.z = c; t.x.w = d; t.y.x = e; t.y.y = f; t.y.z = g; t.y.w = h; t.z.x = i; t.z.y = j; t.z.z = k; t.z.w = l; t.w.x = m; t.w.y = n; t.w.z = o; t.w.w = p; return t; } /* Constructs a coordinate frame from a normalized normal. */ ccl_device_inline Transform make_transform_frame(float3 N) { const float3 dx0 = cross(make_float3(1.0f, 0.0f, 0.0f), N); const float3 dx1 = cross(make_float3(0.0f, 1.0f, 0.0f), N); const float3 dx = normalize((dot(dx0,dx0) > dot(dx1,dx1))? dx0: dx1); const float3 dy = normalize(cross(N, dx)); return make_transform(dx.x, dx.y, dx.z, 0.0f, dy.x, dy.y, dy.z, 0.0f, N.x , N.y, N.z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); } #ifndef __KERNEL_GPU__ ccl_device_inline Transform operator*(const Transform a, const Transform b) { Transform c = transform_transpose(b); Transform t; t.x = make_float4(dot(a.x, c.x), dot(a.x, c.y), dot(a.x, c.z), dot(a.x, c.w)); t.y = make_float4(dot(a.y, c.x), dot(a.y, c.y), dot(a.y, c.z), dot(a.y, c.w)); t.z = make_float4(dot(a.z, c.x), dot(a.z, c.y), dot(a.z, c.z), dot(a.z, c.w)); t.w = make_float4(dot(a.w, c.x), dot(a.w, c.y), dot(a.w, c.z), dot(a.w, c.w)); return t; } ccl_device_inline void print_transform(const char *label, const Transform& t) { print_float4(label, t.x); print_float4(label, t.y); print_float4(label, t.z); print_float4(label, t.w); printf("\n"); } ccl_device_inline Transform transform_translate(float3 t) { return make_transform( 1, 0, 0, t.x, 0, 1, 0, t.y, 0, 0, 1, t.z, 0, 0, 0, 1); } ccl_device_inline Transform transform_translate(float x, float y, float z) { return transform_translate(make_float3(x, y, z)); } ccl_device_inline Transform transform_scale(float3 s) { return make_transform( s.x, 0, 0, 0, 0, s.y, 0, 0, 0, 0, s.z, 0, 0, 0, 0, 1); } ccl_device_inline Transform transform_scale(float x, float y, float z) { return transform_scale(make_float3(x, y, z)); } ccl_device_inline Transform transform_perspective(float fov, float n, float f) { Transform persp = make_transform( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, f / (f - n), -f*n / (f - n), 0, 0, 1, 0); float inv_angle = 1.0f/tanf(0.5f*fov); Transform scale = transform_scale(inv_angle, inv_angle, 1); return scale * persp; } ccl_device_inline Transform transform_rotate(float angle, float3 axis) { float s = sinf(angle); float c = cosf(angle); float t = 1.0f - c; axis = normalize(axis); return make_transform( axis.x*axis.x*t + c, axis.x*axis.y*t - s*axis.z, axis.x*axis.z*t + s*axis.y, 0.0f, axis.y*axis.x*t + s*axis.z, axis.y*axis.y*t + c, axis.y*axis.z*t - s*axis.x, 0.0f, axis.z*axis.x*t - s*axis.y, axis.z*axis.y*t + s*axis.x, axis.z*axis.z*t + c, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); } /* Euler is assumed to be in XYZ order. */ ccl_device_inline Transform transform_euler(float3 euler) { return transform_rotate(euler.z, make_float3(0.0f, 0.0f, 1.0f)) * transform_rotate(euler.y, make_float3(0.0f, 1.0f, 0.0f)) * transform_rotate(euler.x, make_float3(1.0f, 0.0f, 0.0f)); } ccl_device_inline Transform transform_orthographic(float znear, float zfar) { return transform_scale(1.0f, 1.0f, 1.0f / (zfar-znear)) * transform_translate(0.0f, 0.0f, -znear); } ccl_device_inline Transform transform_identity() { return transform_scale(1.0f, 1.0f, 1.0f); } ccl_device_inline bool operator==(const Transform& A, const Transform& B) { return memcmp(&A, &B, sizeof(Transform)) == 0; } ccl_device_inline bool operator!=(const Transform& A, const Transform& B) { return !(A == B); } ccl_device_inline float3 transform_get_column(const Transform *t, int column) { return make_float3(t->x[column], t->y[column], t->z[column]); } ccl_device_inline void transform_set_column(Transform *t, int column, float3 value) { t->x[column] = value.x; t->y[column] = value.y; t->z[column] = value.z; } Transform transform_inverse(const Transform& a); ccl_device_inline bool transform_uniform_scale(const Transform& tfm, float& scale) { /* the epsilon here is quite arbitrary, but this function is only used for * surface area and bump, where we except it to not be so sensitive */ Transform ttfm = transform_transpose(tfm); float eps = 1e-6f; float sx = len_squared(float4_to_float3(tfm.x)); float sy = len_squared(float4_to_float3(tfm.y)); float sz = len_squared(float4_to_float3(tfm.z)); float stx = len_squared(float4_to_float3(ttfm.x)); float sty = len_squared(float4_to_float3(ttfm.y)); float stz = len_squared(float4_to_float3(ttfm.z)); if(fabsf(sx - sy) < eps && fabsf(sx - sz) < eps && fabsf(sx - stx) < eps && fabsf(sx - sty) < eps && fabsf(sx - stz) < eps) { scale = sx; return true; } return false; } ccl_device_inline bool transform_negative_scale(const Transform& tfm) { float3 c0 = transform_get_column(&tfm, 0); float3 c1 = transform_get_column(&tfm, 1); float3 c2 = transform_get_column(&tfm, 2); return (dot(cross(c0, c1), c2) < 0.0f); } ccl_device_inline Transform transform_clear_scale(const Transform& tfm) { Transform ntfm = tfm; transform_set_column(&ntfm, 0, normalize(transform_get_column(&ntfm, 0))); transform_set_column(&ntfm, 1, normalize(transform_get_column(&ntfm, 1))); transform_set_column(&ntfm, 2, normalize(transform_get_column(&ntfm, 2))); return ntfm; } ccl_device_inline Transform transform_empty() { return make_transform( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } #endif /* Motion Transform */ ccl_device_inline float4 quat_interpolate(float4 q1, float4 q2, float t) { /* use simpe nlerp instead of slerp. it's faster and almost the same */ return normalize((1.0f - t)*q1 + t*q2); #if 0 /* note: this does not ensure rotation around shortest angle, q1 and q2 * are assumed to be matched already in transform_motion_decompose */ float costheta = dot(q1, q2); /* possible optimization: it might be possible to precompute theta/qperp */ if(costheta > 0.9995f) { /* linear interpolation in degenerate case */ return normalize((1.0f - t)*q1 + t*q2); } else { /* slerp */ float theta = acosf(clamp(costheta, -1.0f, 1.0f)); float4 qperp = normalize(q2 - q1 * costheta); float thetap = theta * t; return q1 * cosf(thetap) + qperp * sinf(thetap); } #endif } ccl_device_inline Transform transform_quick_inverse(Transform M) { /* possible optimization: can we avoid doing this altogether and construct * the inverse matrix directly from negated translation, transposed rotation, * scale can be inverted but what about shearing? */ Transform R; float det = M.x.x*(M.z.z*M.y.y - M.z.y*M.y.z) - M.y.x*(M.z.z*M.x.y - M.z.y*M.x.z) + M.z.x*(M.y.z*M.x.y - M.y.y*M.x.z); if(det == 0.0f) { M.x.x += 1e-8f; M.y.y += 1e-8f; M.z.z += 1e-8f; det = M.x.x*(M.z.z*M.y.y - M.z.y*M.y.z) - M.y.x*(M.z.z*M.x.y - M.z.y*M.x.z) + M.z.x*(M.y.z*M.x.y - M.y.y*M.x.z); } det = (det != 0.0f)? 1.0f/det: 0.0f; float3 Rx = det*make_float3(M.z.z*M.y.y - M.z.y*M.y.z, M.z.y*M.x.z - M.z.z*M.x.y, M.y.z*M.x.y - M.y.y*M.x.z); float3 Ry = det*make_float3(M.z.x*M.y.z - M.z.z*M.y.x, M.z.z*M.x.x - M.z.x*M.x.z, M.y.x*M.x.z - M.y.z*M.x.x); float3 Rz = det*make_float3(M.z.y*M.y.x - M.z.x*M.y.y, M.z.x*M.x.y - M.z.y*M.x.x, M.y.y*M.x.x - M.y.x*M.x.y); float3 T = -make_float3(M.x.w, M.y.w, M.z.w); R.x = make_float4(Rx.x, Rx.y, Rx.z, dot(Rx, T)); R.y = make_float4(Ry.x, Ry.y, Ry.z, dot(Ry, T)); R.z = make_float4(Rz.x, Rz.y, Rz.z, dot(Rz, T)); R.w = make_float4(0.0f, 0.0f, 0.0f, 1.0f); return R; } ccl_device_inline void transform_compose(Transform *tfm, const Transform *decomp) { /* rotation */ float q0, q1, q2, q3, qda, qdb, qdc, qaa, qab, qac, qbb, qbc, qcc; q0 = M_SQRT2_F * decomp->x.w; q1 = M_SQRT2_F * decomp->x.x; q2 = M_SQRT2_F * decomp->x.y; q3 = M_SQRT2_F * decomp->x.z; qda = q0*q1; qdb = q0*q2; qdc = q0*q3; qaa = q1*q1; qab = q1*q2; qac = q1*q3; qbb = q2*q2; qbc = q2*q3; qcc = q3*q3; float3 rotation_x = make_float3(1.0f-qbb-qcc, -qdc+qab, qdb+qac); float3 rotation_y = make_float3(qdc+qab, 1.0f-qaa-qcc, -qda+qbc); float3 rotation_z = make_float3(-qdb+qac, qda+qbc, 1.0f-qaa-qbb); /* scale */ float3 scale_x = make_float3(decomp->y.w, decomp->z.z, decomp->w.y); float3 scale_y = make_float3(decomp->z.x, decomp->z.w, decomp->w.z); float3 scale_z = make_float3(decomp->z.y, decomp->w.x, decomp->w.w); /* compose with translation */ tfm->x = make_float4(dot(rotation_x, scale_x), dot(rotation_x, scale_y), dot(rotation_x, scale_z), decomp->y.x); tfm->y = make_float4(dot(rotation_y, scale_x), dot(rotation_y, scale_y), dot(rotation_y, scale_z), decomp->y.y); tfm->z = make_float4(dot(rotation_z, scale_x), dot(rotation_z, scale_y), dot(rotation_z, scale_z), decomp->y.z); tfm->w = make_float4(0.0f, 0.0f, 0.0f, 1.0f); } /* Disabled for now, need arc-length parametrization for constant speed motion. * #define CURVED_MOTION_INTERPOLATE */ ccl_device void transform_motion_interpolate(Transform *tfm, const MotionTransform *motion, float t) { /* possible optimization: is it worth it adding a check to skip scaling? * it's probably quite uncommon to have scaling objects. or can we skip * just shearing perhaps? */ Transform decomp; #ifdef CURVED_MOTION_INTERPOLATE /* 3 point bezier curve interpolation for position */ float3 Ppre = float4_to_float3(motion->pre.y); float3 Pmid = float4_to_float3(motion->mid.y); float3 Ppost = float4_to_float3(motion->post.y); float3 Pcontrol = 2.0f*Pmid - 0.5f*(Ppre + Ppost); float3 P = Ppre*t*t + Pcontrol*2.0f*t*(1.0f - t) + Ppost*(1.0f - t)*(1.0f - t); decomp.y.x = P.x; decomp.y.y = P.y; decomp.y.z = P.z; #endif /* linear interpolation for rotation and scale */ if(t < 0.5f) { t *= 2.0f; decomp.x = quat_interpolate(motion->pre.x, motion->mid.x, t); #ifdef CURVED_MOTION_INTERPOLATE decomp.y.w = (1.0f - t)*motion->pre.y.w + t*motion->mid.y.w; #else decomp.y = (1.0f - t)*motion->pre.y + t*motion->mid.y; #endif decomp.z = (1.0f - t)*motion->pre.z + t*motion->mid.z; decomp.w = (1.0f - t)*motion->pre.w + t*motion->mid.w; } else { t = (t - 0.5f)*2.0f; decomp.x = quat_interpolate(motion->mid.x, motion->post.x, t); #ifdef CURVED_MOTION_INTERPOLATE decomp.y.w = (1.0f - t)*motion->mid.y.w + t*motion->post.y.w; #else decomp.y = (1.0f - t)*motion->mid.y + t*motion->post.y; #endif decomp.z = (1.0f - t)*motion->mid.z + t*motion->post.z; decomp.w = (1.0f - t)*motion->mid.w + t*motion->post.w; } /* compose rotation, translation, scale into matrix */ transform_compose(tfm, &decomp); } #ifndef __KERNEL_GPU__ class BoundBox2D; ccl_device_inline bool operator==(const MotionTransform& A, const MotionTransform& B) { return (A.pre == B.pre && A.post == B.post); } float4 transform_to_quat(const Transform& tfm); void transform_motion_decompose(MotionTransform *decomp, const MotionTransform *motion, const Transform *mid); Transform transform_from_viewplane(BoundBox2D& viewplane); #endif /* TODO(sergey): This is only for until we've got OpenCL 2.0 * on all devices we consider supported. It'll be replaced with * generic address space. */ #ifdef __KERNEL_OPENCL__ #define OPENCL_TRANSFORM_ADDRSPACE_GLUE(a, b) a ## b #define OPENCL_TRANSFORM_ADDRSPACE_DECLARE(function) \ ccl_device_inline float3 OPENCL_TRANSFORM_ADDRSPACE_GLUE(function, _addrspace)( \ ccl_addr_space const Transform *t, const float3 a) \ { \ Transform private_tfm = *t; \ return function(&private_tfm, a); \ } OPENCL_TRANSFORM_ADDRSPACE_DECLARE(transform_point) OPENCL_TRANSFORM_ADDRSPACE_DECLARE(transform_direction) OPENCL_TRANSFORM_ADDRSPACE_DECLARE(transform_direction_transposed) # undef OPENCL_TRANSFORM_ADDRSPACE_DECLARE # undef OPENCL_TRANSFORM_ADDRSPACE_GLUE # define transform_point_auto transform_point_addrspace # define transform_direction_auto transform_direction_addrspace # define transform_direction_transposed_auto transform_direction_transposed_addrspace #else # define transform_point_auto transform_point # define transform_direction_auto transform_direction # define transform_direction_transposed_auto transform_direction_transposed #endif CCL_NAMESPACE_END #endif /* __UTIL_TRANSFORM_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types.h000066400000000000000000000070561334742672700217340ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_H__ #define __UTIL_TYPES_H__ #ifndef __KERNEL_OPENCL__ # include #endif /* Standard Integer Types */ #if !defined(__KERNEL_GPU__) && !defined(_WIN32) # include #endif #include "util/util_defines.h" #ifndef __KERNEL_GPU__ # include "util/util_optimization.h" # include "util/util_simd.h" #endif CCL_NAMESPACE_BEGIN /* Types * * Define simpler unsigned type names, and integer with defined number of bits. * Also vector types, named to be compatible with OpenCL builtin types, while * working for CUDA and C++ too. */ /* Shorter Unsigned Names */ #ifndef __KERNEL_OPENCL__ typedef unsigned char uchar; typedef unsigned int uint; typedef unsigned short ushort; #endif /* Fixed Bits Types */ #ifdef __KERNEL_OPENCL__ typedef ulong uint64_t; #endif #ifndef __KERNEL_GPU__ # ifdef _WIN32 typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; # ifdef __KERNEL_64_BIT__ typedef int64_t ssize_t; # else typedef int32_t ssize_t; # endif # endif /* _WIN32 */ /* Generic Memory Pointer */ typedef uint64_t device_ptr; #endif /* __KERNEL_GPU__ */ ccl_device_inline size_t align_up(size_t offset, size_t alignment) { return (offset + alignment - 1) & ~(alignment - 1); } ccl_device_inline size_t divide_up(size_t x, size_t y) { return (x + y - 1) / y; } ccl_device_inline size_t round_up(size_t x, size_t multiple) { return ((x + multiple - 1) / multiple) * multiple; } ccl_device_inline size_t round_down(size_t x, size_t multiple) { return (x / multiple) * multiple; } CCL_NAMESPACE_END /* Vectorized types declaration. */ #include "util/util_types_uchar2.h" #include "util/util_types_uchar3.h" #include "util/util_types_uchar4.h" #include "util/util_types_int2.h" #include "util/util_types_int3.h" #include "util/util_types_int4.h" #include "util/util_types_uint2.h" #include "util/util_types_uint3.h" #include "util/util_types_uint4.h" #include "util/util_types_float2.h" #include "util/util_types_float3.h" #include "util/util_types_float4.h" #include "util/util_types_vector3.h" /* Vectorized types implementation. */ #include "util/util_types_uchar2_impl.h" #include "util/util_types_uchar3_impl.h" #include "util/util_types_uchar4_impl.h" #include "util/util_types_int2_impl.h" #include "util/util_types_int3_impl.h" #include "util/util_types_int4_impl.h" #include "util/util_types_uint2_impl.h" #include "util/util_types_uint3_impl.h" #include "util/util_types_uint4_impl.h" #include "util/util_types_float2_impl.h" #include "util/util_types_float3_impl.h" #include "util/util_types_float4_impl.h" #include "util/util_types_vector3_impl.h" /* SSE types. */ #ifndef __KERNEL_GPU__ # include "util/util_sseb.h" # include "util/util_ssei.h" # include "util/util_ssef.h" # include "util/util_avxf.h" #endif #endif /* __UTIL_TYPES_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_float2.h000066400000000000000000000022071334742672700231740ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_FLOAT2_H__ #define __UTIL_TYPES_FLOAT2_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct float2 { float x, y; __forceinline float operator[](int i) const; __forceinline float& operator[](int i); }; ccl_device_inline float2 make_float2(float x, float y); ccl_device_inline void print_float2(const char *label, const float2& a); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT2_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_float2_impl.h000066400000000000000000000026341334742672700242210ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_FLOAT2_IMPL_H__ #define __UTIL_TYPES_FLOAT2_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif #ifndef __KERNEL_GPU__ # include #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ __forceinline float float2::operator[](int i) const { util_assert(i >= 0); util_assert(i < 2); return *(&x + i); } __forceinline float& float2::operator[](int i) { util_assert(i >= 0); util_assert(i < 2); return *(&x + i); } ccl_device_inline float2 make_float2(float x, float y) { float2 a = {x, y}; return a; } ccl_device_inline void print_float2(const char *label, const float2& a) { printf("%s: %.8f %.8f\n", label, (double)a.x, (double)a.y); } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT2_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_float3.h000066400000000000000000000031451334742672700231770ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_FLOAT3_H__ #define __UTIL_TYPES_FLOAT3_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct ccl_try_align(16) float3 { #ifdef __KERNEL_SSE__ union { __m128 m128; struct { float x, y, z, w; }; }; __forceinline float3(); __forceinline float3(const float3& a); __forceinline explicit float3(const __m128& a); __forceinline operator const __m128&(void) const; __forceinline operator __m128&(void); __forceinline float3& operator =(const float3& a); #else /* __KERNEL_SSE__ */ float x, y, z, w; #endif /* __KERNEL_SSE__ */ __forceinline float operator[](int i) const; __forceinline float& operator[](int i); }; ccl_device_inline float3 make_float3(float f); ccl_device_inline float3 make_float3(float x, float y, float z); ccl_device_inline void print_float3(const char *label, const float3& a); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT3_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_float3_impl.h000066400000000000000000000041571334742672700242240ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_FLOAT3_IMPL_H__ #define __UTIL_TYPES_FLOAT3_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif #ifndef __KERNEL_GPU__ # include #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ #ifdef __KERNEL_SSE__ __forceinline float3::float3() { } __forceinline float3::float3(const float3& a) : m128(a.m128) { } __forceinline float3::float3(const __m128& a) : m128(a) { } __forceinline float3::operator const __m128&(void) const { return m128; } __forceinline float3::operator __m128&(void) { return m128; } __forceinline float3& float3::operator =(const float3& a) { m128 = a.m128; return *this; } #endif /* __KERNEL_SSE__ */ __forceinline float float3::operator[](int i) const { util_assert(i >= 0); util_assert(i < 3); return *(&x + i); } __forceinline float& float3::operator[](int i) { util_assert(i >= 0); util_assert(i < 3); return *(&x + i); } ccl_device_inline float3 make_float3(float f) { #ifdef __KERNEL_SSE__ float3 a(_mm_set1_ps(f)); #else float3 a = {f, f, f, f}; #endif return a; } ccl_device_inline float3 make_float3(float x, float y, float z) { #ifdef __KERNEL_SSE__ float3 a(_mm_set_ps(0.0f, z, y, x)); #else float3 a = {x, y, z, 0.0f}; #endif return a; } ccl_device_inline void print_float3(const char *label, const float3& a) { printf("%s: %.8f %.8f %.8f\n", label, (double)a.x, (double)a.y, (double)a.z); } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT3_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_float4.h000066400000000000000000000032621334742672700232000ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_FLOAT4_H__ #define __UTIL_TYPES_FLOAT4_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct int4; struct ccl_try_align(16) float4 { #ifdef __KERNEL_SSE__ union { __m128 m128; struct { float x, y, z, w; }; }; __forceinline float4(); __forceinline float4(const float4& a); __forceinline explicit float4(const __m128& a); __forceinline operator const __m128&(void) const; __forceinline operator __m128&(void); __forceinline float4& operator =(const float4& a); #else /* __KERNEL_SSE__ */ float x, y, z, w; #endif /* __KERNEL_SSE__ */ __forceinline float operator[](int i) const; __forceinline float& operator[](int i); }; ccl_device_inline float4 make_float4(float f); ccl_device_inline float4 make_float4(float x, float y, float z, float w); ccl_device_inline float4 make_float4(const int4& i); ccl_device_inline void print_float4(const char *label, const float4& a); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT4_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_float4_impl.h000066400000000000000000000045361334742672700242260ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_FLOAT4_IMPL_H__ #define __UTIL_TYPES_FLOAT4_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif #ifndef __KERNEL_GPU__ # include #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ #ifdef __KERNEL_SSE__ __forceinline float4::float4() { } __forceinline float4::float4(const float4& a) : m128(a.m128) { } __forceinline float4::float4(const __m128& a) : m128(a) { } __forceinline float4::operator const __m128&(void) const { return m128; } __forceinline float4::operator __m128&(void) { return m128; } __forceinline float4& float4::operator =(const float4& a) { m128 = a.m128; return *this; } #endif /* __KERNEL_SSE__ */ __forceinline float float4::operator[](int i) const { util_assert(i >= 0); util_assert(i < 4); return *(&x + i); } __forceinline float& float4::operator[](int i) { util_assert(i >= 0); util_assert(i < 4); return *(&x + i); } ccl_device_inline float4 make_float4(float f) { #ifdef __KERNEL_SSE__ float4 a(_mm_set1_ps(f)); #else float4 a = {f, f, f, f}; #endif return a; } ccl_device_inline float4 make_float4(float x, float y, float z, float w) { #ifdef __KERNEL_SSE__ float4 a(_mm_set_ps(w, z, y, x)); #else float4 a = {x, y, z, w}; #endif return a; } ccl_device_inline float4 make_float4(const int4& i) { #ifdef __KERNEL_SSE__ float4 a(_mm_cvtepi32_ps(i.m128)); #else float4 a = {(float)i.x, (float)i.y, (float)i.z, (float)i.w}; #endif return a; } ccl_device_inline void print_float4(const char *label, const float4& a) { printf("%s: %.8f %.8f %.8f %.8f\n", label, (double)a.x, (double)a.y, (double)a.z, (double)a.w); } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_FLOAT4_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_int2.h000066400000000000000000000020501334742672700226550ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_INT2_H__ #define __UTIL_TYPES_INT2_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct int2 { int x, y; __forceinline int operator[](int i) const; __forceinline int& operator[](int i); }; ccl_device_inline int2 make_int2(int x, int y); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_INT2_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_int2_impl.h000066400000000000000000000022531334742672700237030ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_INT2_IMPL_H__ #define __UTIL_TYPES_INT2_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ int int2::operator[](int i) const { util_assert(i >= 0); util_assert(i < 2); return *(&x + i); } int& int2::operator[](int i) { util_assert(i >= 0); util_assert(i < 2); return *(&x + i); } ccl_device_inline int2 make_int2(int x, int y) { int2 a = {x, y}; return a; } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_INT2_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_int3.h000066400000000000000000000030711334742672700226620ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_INT3_H__ #define __UTIL_TYPES_INT3_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct ccl_try_align(16) int3 { #ifdef __KERNEL_SSE__ union { __m128i m128; struct { int x, y, z, w; }; }; __forceinline int3(); __forceinline int3(const int3& a); __forceinline explicit int3(const __m128i& a); __forceinline operator const __m128i&(void) const; __forceinline operator __m128i&(void); __forceinline int3& operator =(const int3& a); #else /* __KERNEL_SSE__ */ int x, y, z, w; #endif /* __KERNEL_SSE__ */ __forceinline int operator[](int i) const; __forceinline int& operator[](int i); }; ccl_device_inline int3 make_int3(int i); ccl_device_inline int3 make_int3(int x, int y, int z); ccl_device_inline void print_int3(const char *label, const int3& a); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_INT3_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_int3_impl.h000066400000000000000000000040231334742672700237010ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_INT3_IMPL_H__ #define __UTIL_TYPES_INT3_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif #ifndef __KERNEL_GPU__ # include #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ #ifdef __KERNEL_SSE__ __forceinline int3::int3() { } __forceinline int3::int3(const __m128i& a) : m128(a) { } __forceinline int3::int3(const int3& a) : m128(a.m128) { } __forceinline int3::operator const __m128i&(void) const { return m128; } __forceinline int3::operator __m128i&(void) { return m128; } __forceinline int3& int3::operator =(const int3& a) { m128 = a.m128; return *this; } #endif /* __KERNEL_SSE__ */ __forceinline int int3::operator[](int i) const { util_assert(i >= 0); util_assert(i < 3); return *(&x + i); } __forceinline int& int3::operator[](int i) { util_assert(i >= 0); util_assert(i < 3); return *(&x + i); } ccl_device_inline int3 make_int3(int i) { #ifdef __KERNEL_SSE__ int3 a(_mm_set1_epi32(i)); #else int3 a = {i, i, i, i}; #endif return a; } ccl_device_inline int3 make_int3(int x, int y, int z) { #ifdef __KERNEL_SSE__ int3 a(_mm_set_epi32(0, z, y, x)); #else int3 a = {x, y, z, 0}; #endif return a; } ccl_device_inline void print_int3(const char *label, const int3& a) { printf("%s: %d %d %d\n", label, a.x, a.y, a.z); } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_INT3_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_int4.h000066400000000000000000000032031334742672700226600ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_INT4_H__ #define __UTIL_TYPES_INT4_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct float3; struct ccl_try_align(16) int4 { #ifdef __KERNEL_SSE__ union { __m128i m128; struct { int x, y, z, w; }; }; __forceinline int4(); __forceinline int4(const int4& a); __forceinline explicit int4(const __m128i& a); __forceinline operator const __m128i&(void) const; __forceinline operator __m128i&(void); __forceinline int4& operator=(const int4& a); #else /* __KERNEL_SSE__ */ int x, y, z, w; #endif /* __KERNEL_SSE__ */ __forceinline int operator[](int i) const; __forceinline int& operator[](int i); }; ccl_device_inline int4 make_int4(int i); ccl_device_inline int4 make_int4(int x, int y, int z, int w); ccl_device_inline int4 make_int4(const float3& f); ccl_device_inline void print_int4(const char *label, const int4& a); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_INT4_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_int4_impl.h000066400000000000000000000043331334742672700237060ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_INT4_IMPL_H__ #define __UTIL_TYPES_INT4_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif #ifndef __KERNEL_GPU__ # include #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ #ifdef __KERNEL_SSE__ __forceinline int4::int4() { } __forceinline int4::int4(const int4& a) : m128(a.m128) { } __forceinline int4::int4(const __m128i& a) : m128(a) { } __forceinline int4::operator const __m128i&(void) const { return m128; } __forceinline int4::operator __m128i&(void) { return m128; } __forceinline int4& int4::operator=(const int4& a) { m128 = a.m128; return *this; } #endif /* __KERNEL_SSE__ */ __forceinline int int4::operator[](int i) const { util_assert(i >= 0); util_assert(i < 4); return *(&x + i); } __forceinline int& int4::operator[](int i) { util_assert(i >= 0); util_assert(i < 4); return *(&x + i); } ccl_device_inline int4 make_int4(int i) { #ifdef __KERNEL_SSE__ int4 a(_mm_set1_epi32(i)); #else int4 a = {i, i, i, i}; #endif return a; } ccl_device_inline int4 make_int4(int x, int y, int z, int w) { #ifdef __KERNEL_SSE__ int4 a(_mm_set_epi32(w, z, y, x)); #else int4 a = {x, y, z, w}; #endif return a; } ccl_device_inline int4 make_int4(const float3& f) { #ifdef __KERNEL_SSE__ int4 a(_mm_cvtps_epi32(f.m128)); #else int4 a = {(int)f.x, (int)f.y, (int)f.z, (int)f.w}; #endif return a; } ccl_device_inline void print_int4(const char *label, const int4& a) { printf("%s: %d %d %d %d\n", label, a.x, a.y, a.z, a.w); } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_INT4_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uchar2.h000066400000000000000000000020761334742672700231750ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UCHAR2_H__ #define __UTIL_TYPES_UCHAR2_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct uchar2 { uchar x, y; __forceinline uchar operator[](int i) const; __forceinline uchar& operator[](int i); }; ccl_device_inline uchar2 make_uchar2(uchar x, uchar y); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UCHAR2_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uchar2_impl.h000066400000000000000000000023031334742672700242070ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UCHAR2_IMPL_H__ #define __UTIL_TYPES_UCHAR2_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ uchar uchar2::operator[](int i) const { util_assert(i >= 0); util_assert(i < 2); return *(&x + i); } uchar& uchar2::operator[](int i) { util_assert(i >= 0); util_assert(i < 2); return *(&x + i); } ccl_device_inline uchar2 make_uchar2(uchar x, uchar y) { uchar2 a = {x, y}; return a; } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UCHAR2_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uchar3.h000066400000000000000000000021121334742672700231650ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UCHAR3_H__ #define __UTIL_TYPES_UCHAR3_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct uchar3 { uchar x, y, z; __forceinline uchar operator[](int i) const; __forceinline uchar& operator[](int i); }; ccl_device_inline uchar3 make_uchar3(uchar x, uchar y, uchar z); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UCHAR3_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uchar3_impl.h000066400000000000000000000023171334742672700242150ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UCHAR3_IMPL_H__ #define __UTIL_TYPES_UCHAR3_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ uchar uchar3::operator[](int i) const { util_assert(i >= 0); util_assert(i < 3); return *(&x + i); } uchar& uchar3::operator[](int i) { util_assert(i >= 0); util_assert(i < 3); return *(&x + i); } ccl_device_inline uchar3 make_uchar3(uchar x, uchar y, uchar z) { uchar3 a = {x, y, z}; return a; } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UCHAR3_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uchar4.h000066400000000000000000000021261334742672700231730ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UCHAR4_H__ #define __UTIL_TYPES_UCHAR4_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct uchar4 { uchar x, y, z, w; __forceinline uchar operator[](int i) const; __forceinline uchar& operator[](int i); }; ccl_device_inline uchar4 make_uchar4(uchar x, uchar y, uchar z, uchar w); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UCHAR4_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uchar4_impl.h000066400000000000000000000023331334742672700242140ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UCHAR4_IMPL_H__ #define __UTIL_TYPES_UCHAR4_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ uchar uchar4::operator[](int i) const { util_assert(i >= 0); util_assert(i < 4); return *(&x + i); } uchar& uchar4::operator[](int i) { util_assert(i >= 0); util_assert(i < 4); return *(&x + i); } ccl_device_inline uchar4 make_uchar4(uchar x, uchar y, uchar z, uchar w) { uchar4 a = {x, y, z, w}; return a; } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UCHAR4_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uint2.h000066400000000000000000000020651334742672700230500ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UINT2_H__ #define __UTIL_TYPES_UINT2_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct uint2 { uint x, y; __forceinline uint operator[](uint i) const; __forceinline uint& operator[](uint i); }; ccl_device_inline uint2 make_uint2(uint x, uint y); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UINT2_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uint2_impl.h000066400000000000000000000022511334742672700240660ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UINT2_IMPL_H__ #define __UTIL_TYPES_UINT2_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ __forceinline uint uint2::operator[](uint i) const { util_assert(i < 2); return *(&x + i); } __forceinline uint& uint2::operator[](uint i) { util_assert(i < 2); return *(&x + i); } ccl_device_inline uint2 make_uint2(uint x, uint y) { uint2 a = {x, y}; return a; } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UINT2_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uint3.h000066400000000000000000000021001334742672700230370ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UINT3_H__ #define __UTIL_TYPES_UINT3_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct uint3 { uint x, y, z; __forceinline uint operator[](uint i) const; __forceinline uint& operator[](uint i); }; ccl_device_inline uint3 make_uint3(uint x, uint y, uint z); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UINT3_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uint3_impl.h000066400000000000000000000022641334742672700240730ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UINT3_IMPL_H__ #define __UTIL_TYPES_UINT3_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ __forceinline uint uint3::operator[](uint i) const { util_assert(i < 3); return *(&x + i); } __forceinline uint& uint3::operator[](uint i) { util_assert(i < 3); return *(&x + i); } ccl_device_inline uint3 make_uint3(uint x, uint y, uint z) { uint3 a = {x, y, z}; return a; } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UINT3_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uint4.h000066400000000000000000000021131334742672700230440ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UINT4_H__ #define __UTIL_TYPES_UINT4_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ struct uint4 { uint x, y, z, w; __forceinline uint operator[](uint i) const; __forceinline uint& operator[](uint i); }; ccl_device_inline uint4 make_uint4(uint x, uint y, uint z, uint w); #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UINT4_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_uint4_impl.h000066400000000000000000000022771334742672700241000ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_UINT4_IMPL_H__ #define __UTIL_TYPES_UINT4_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ __forceinline uint uint4::operator[](uint i) const { util_assert(i < 3); return *(&x + i); } __forceinline uint& uint4::operator[](uint i) { util_assert(i < 3); return *(&x + i); } ccl_device_inline uint4 make_uint4(uint x, uint y, uint z, uint w) { uint4 a = {x, y, z, w}; return a; } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_UINT4_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_vector3.h000066400000000000000000000021071334742672700233710ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_VECTOR3_H__ #define __UTIL_TYPES_VECTOR3_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ template class vector3 { public: T x, y, z; __forceinline vector3(); __forceinline vector3(const T& a); __forceinline vector3(const T& x, const T& y, const T& z); }; #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_VECTOR3_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_types_vector3_impl.h000066400000000000000000000023061334742672700244130ustar00rootroot00000000000000/* * Copyright 2011-2017 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_TYPES_VECTOR3_IMPL_H__ #define __UTIL_TYPES_VECTOR3_IMPL_H__ #ifndef __UTIL_TYPES_H__ # error "Do not include this file directly, include util_types.h instead." #endif CCL_NAMESPACE_BEGIN #ifndef __KERNEL_GPU__ template ccl_always_inline vector3::vector3() { } template ccl_always_inline vector3::vector3(const T& a) : x(a), y(a), z(a) { } template ccl_always_inline vector3::vector3(const T& x, const T& y, const T& z) : x(x), y(y), z(z) { } #endif /* __KERNEL_GPU__ */ CCL_NAMESPACE_END #endif /* __UTIL_TYPES_VECTOR3_IMPL_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_ustring.h000066400000000000000000000027471334742672700222650ustar00rootroot00000000000000/* * Copyright 2011-2018 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_USTRING_H__ #define __UTIL_USTRING_H__ /* ustring class implementation. Follow std::string, but optimized for * comparisons */ #ifndef WITHOUT_OPENIMAGEIO #include CCL_NAMESPACE_BEGIN OIIO_NAMESPACE_USING CCL_NAMESPACE_END #else // WITHOUT_OPENIMAGEIO CCL_NAMESPACE_BEGIN // ustring implementation based on std::string. class ustring : public std::string { public: ustring() {} explicit ustring(const char *str) : std::string(str) {} ustring (const ustring &str) :std::string(str.c_str()) {} ustring (const std::string &str) : std::string(str) {} const std::string &string() const { return *this; } operator int(void) const { return !empty(); } const ustring &operator=(const char *str) { assign(str); return *this; } }; typedef std::hash ustringHash; CCL_NAMESPACE_END #endif // WITHOUT_OPENIMAGEIO #endif /* __UTIL_USTRING_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_vector.h000066400000000000000000000146151334742672700220710ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_VECTOR_H__ #define __UTIL_VECTOR_H__ /* Vector */ #include #include #include #include "util/util_aligned_malloc.h" #include "util/util_guarded_allocator.h" #include "util/util_types.h" CCL_NAMESPACE_BEGIN /* Vector * * Own subclass-ed vestion of std::vector. Subclass is needed because: * * - Use own allocator which keeps track of used/peak memory. * * - Have method to ensure capacity is re-set to 0. */ template > class vector : public std::vector { public: /* Default constructor. */ explicit vector() : std::vector() { } /* Fill constructor. */ explicit vector(size_t n, const value_type& val = value_type()) : std::vector(n, val) { } /* Range constructor. */ template vector(InputIterator first, InputIterator last) : std::vector(first, last) { } /* Copy constructor. */ vector(const vector &x) : std::vector(x) { } void shrink_to_fit(void) { #if __cplusplus < 201103L vector().swap(*this); #else std::vector::shrink_to_fit(); #endif } void free_memory(void) { std::vector::resize(0); shrink_to_fit(); } /* Some external API might demand working with std::vector. */ operator std::vector() { return std::vector(this->begin(), this->end()); } }; /* Array * * Simplified version of vector, serving multiple purposes: * - somewhat faster in that it does not clear memory on resize/alloc, * this was actually showing up in profiles quite significantly. it * also does not run any constructors/destructors * - if this is used, we are not tempted to use inefficient operations * - aligned allocation for CPU native data types */ template class array { public: array() : data_(NULL), datasize_(0), capacity_(0) {} explicit array(size_t newsize) { if(newsize == 0) { data_ = NULL; datasize_ = 0; capacity_ = 0; } else { data_ = mem_allocate(newsize); datasize_ = newsize; capacity_ = datasize_; } } array(const array& from) { if(from.datasize_ == 0) { data_ = NULL; datasize_ = 0; capacity_ = 0; } else { data_ = mem_allocate(from.datasize_); memcpy(data_, from.data_, from.datasize_*sizeof(T)); datasize_ = from.datasize_; capacity_ = datasize_; } } array& operator=(const array& from) { if(this != &from) { resize(from.size()); memcpy(data_, from.data_, datasize_*sizeof(T)); } return *this; } array& operator=(const vector& from) { resize(from.size()); if(from.size() > 0) { memcpy(data_, &from[0], datasize_*sizeof(T)); } return *this; } ~array() { mem_free(data_, capacity_); } bool operator==(const array& other) const { if(datasize_ != other.datasize_) { return false; } return memcmp(data_, other.data_, datasize_*sizeof(T)) == 0; } bool operator!=(const array& other) const { return !(*this == other); } void steal_data(array& from) { if(this != &from) { clear(); data_ = from.data_; datasize_ = from.datasize_; capacity_ = from.capacity_; from.data_ = NULL; from.datasize_ = 0; from.capacity_ = 0; } } T *steal_pointer() { T *ptr = data_; data_ = NULL; clear(); return ptr; } T* resize(size_t newsize) { if(newsize == 0) { clear(); } else if(newsize != datasize_) { if(newsize > capacity_) { T *newdata = mem_allocate(newsize); if(newdata == NULL) { /* Allocation failed, likely out of memory. */ clear(); return NULL; } else if(data_ != NULL) { memcpy(newdata, data_, ((datasize_ < newsize)? datasize_: newsize)*sizeof(T)); mem_free(data_, capacity_); } data_ = newdata; capacity_ = newsize; } datasize_ = newsize; } return data_; } void clear() { if(data_ != NULL) { mem_free(data_, capacity_); data_ = NULL; } datasize_ = 0; capacity_ = 0; } size_t empty() const { return datasize_ == 0; } size_t size() const { return datasize_; } T* data() { return data_; } const T* data() const { return data_; } T& operator[](size_t i) const { assert(i < datasize_); return data_[i]; } void reserve(size_t newcapacity) { if(newcapacity > capacity_) { T *newdata = mem_allocate(newcapacity); if(data_ != NULL) { memcpy(newdata, data_, ((datasize_ < newcapacity)? datasize_: newcapacity)*sizeof(T)); mem_free(data_, capacity_); } data_ = newdata; capacity_ = newcapacity; } } size_t capacity() const { return capacity_; } // do not use this method unless you are sure the code is not performance critical void push_back_slow(const T& t) { if(capacity_ == datasize_) { reserve(datasize_ == 0 ? 1 : (size_t)((datasize_ + 1) * 1.2)); } data_[datasize_++] = t; } void push_back_reserved(const T& t) { assert(datasize_ < capacity_); push_back_slow(t); } void append(const array& from) { if(from.size()) { size_t old_size = size(); resize(old_size + from.size()); memcpy(data_ + old_size, from.data(), sizeof(T) * from.size()); } } protected: inline T* mem_allocate(size_t N) { if(N == 0) { return NULL; } T *mem = (T*)util_aligned_malloc(sizeof(T)*N, alignment); if(mem != NULL) { util_guarded_mem_alloc(sizeof(T)*N); } else { throw std::bad_alloc(); } return mem; } inline void mem_free(T *mem, size_t N) { if(mem != NULL) { util_guarded_mem_free(sizeof(T)*N); util_aligned_free(mem); } } T *data_; size_t datasize_; size_t capacity_; }; CCL_NAMESPACE_END #endif /* __UTIL_VECTOR_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_version.h000066400000000000000000000022461334742672700222510ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_VERSION_H__ #define __UTIL_VERSION_H__ /* Cycles version number */ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 #define CYCLES_VERSION_MINOR 9 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a,b,c) #a "." #b "." #c #define CYCLES_MAKE_VERSION_STRING(a,b,c) CYCLES_MAKE_VERSION_STRING2(a,b,c) #define CYCLES_VERSION_STRING \ CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, \ CYCLES_VERSION_MINOR, \ CYCLES_VERSION_PATCH) CCL_NAMESPACE_END #endif /* __UTIL_VERSION_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_view.cpp000066400000000000000000000131461334742672700220720ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include "util/util_opengl.h" #include "util/util_string.h" #include "util/util_time.h" #include "util/util_version.h" #include "util/util_view.h" #ifdef __APPLE__ #include #else #include #endif CCL_NAMESPACE_BEGIN /* structs */ struct View { ViewInitFunc initf; ViewExitFunc exitf; ViewResizeFunc resize; ViewDisplayFunc display; ViewKeyboardFunc keyboard; ViewMotionFunc motion; bool first_display; bool redraw; int mouseX, mouseY; int mouseBut0, mouseBut2; int width, height; } V; /* public */ static void view_display_text(int x, int y, const char *text) { const char *c; glRasterPos3f(x, y, 0); for(c = text; *c != '\0'; c++) glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, *c); } void view_display_info(const char *info) { const int height = 20; glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.1f, 0.1f, 0.1f, 0.8f); glRectf(0.0f, V.height - height, V.width, V.height); glDisable(GL_BLEND); glColor3f(0.5f, 0.5f, 0.5f); view_display_text(10, 7 + V.height - height, info); glColor3f(1.0f, 1.0f, 1.0f); } void view_display_help() { const int w = (int)((float)V.width / 1.15f); const int h = (int)((float)V.height / 1.15f); const int x1 = (V.width - w) / 2; const int x2 = x1 + w; const int y1 = (V.height - h) / 2; const int y2 = y1 + h; glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.5f, 0.5f, 0.5f, 0.8f); glRectf(x1, y1, x2, y2); glDisable(GL_BLEND); glColor3f(0.8f, 0.8f, 0.8f); string info = string("Cycles Renderer ") + CYCLES_VERSION_STRING; view_display_text(x1+20, y2-20, info.c_str()); view_display_text(x1+20, y2-40, "(C) 2011-2016 Blender Foundation"); view_display_text(x1+20, y2-80, "Controls:"); view_display_text(x1+20, y2-100, "h: Info/Help"); view_display_text(x1+20, y2-120, "r: Reset"); view_display_text(x1+20, y2-140, "p: Pause"); view_display_text(x1+20, y2-160, "esc: Cancel"); view_display_text(x1+20, y2-180, "q: Quit program"); view_display_text(x1+20, y2-210, "i: Interactive mode"); view_display_text(x1+20, y2-230, "Left mouse: Move camera"); view_display_text(x1+20, y2-250, "Right mouse: Rotate camera"); view_display_text(x1+20, y2-270, "W/A/S/D: Move camera"); view_display_text(x1+20, y2-290, "0/1/2/3: Set max bounces"); glColor3f(1.0f, 1.0f, 1.0f); } static void view_display() { if(V.first_display) { if(V.initf) V.initf(); if(V.exitf) atexit(V.exitf); V.first_display = false; } glClearColor(0.05f, 0.05f, 0.05f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, V.width, 0, V.height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glRasterPos3f(0, 0, 0); if(V.display) V.display(); glutSwapBuffers(); } static void view_reshape(int width, int height) { if(width <= 0 || height <= 0) return; V.width = width; V.height = height; glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); if(V.resize) V.resize(width, height); } static void view_keyboard(unsigned char key, int x, int y) { if(V.keyboard) V.keyboard(key); if(key == 'm') printf("mouse %d %d\n", x, y); if(key == 'q') { if(V.exitf) V.exitf(); exit(0); } } static void view_mouse(int button, int state, int x, int y) { if(button == 0) { if(state == GLUT_DOWN) { V.mouseX = x; V.mouseY = y; V.mouseBut0 = 1; } else if(state == GLUT_UP) { V.mouseBut0 = 0; } } else if(button == 2) { if(state == GLUT_DOWN) { V.mouseX = x; V.mouseY = y; V.mouseBut2 = 1; } else if(state == GLUT_UP) { V.mouseBut2 = 0; } } } static void view_motion(int x, int y) { const int but = V.mouseBut0? 0:2; const int distX = x - V.mouseX; const int distY = y - V.mouseY; if(V.motion) V.motion(distX, distY, but); V.mouseX = x; V.mouseY = y; } static void view_idle(void) { if(V.redraw) { V.redraw = false; glutPostRedisplay(); } time_sleep(0.1); } void view_main_loop(const char *title, int width, int height, ViewInitFunc initf, ViewExitFunc exitf, ViewResizeFunc resize, ViewDisplayFunc display, ViewKeyboardFunc keyboard, ViewMotionFunc motion) { const char *name = "app"; char *argv = (char*)name; int argc = 1; memset(&V, 0, sizeof(V)); V.width = width; V.height = height; V.first_display = true; V.redraw = false; V.initf = initf; V.exitf = exitf; V.resize = resize; V.display = display; V.keyboard = keyboard; V.motion = motion; glutInit(&argc, &argv); glutInitWindowSize(width, height); glutInitWindowPosition(0, 0); glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE|GLUT_DEPTH); glutCreateWindow(title); mxMakeCurrentContext(mxCreateContext()); view_reshape(width, height); glutDisplayFunc(view_display); glutIdleFunc(view_idle); glutReshapeFunc(view_reshape); glutKeyboardFunc(view_keyboard); glutMouseFunc(view_mouse); glutMotionFunc(view_motion); glutMainLoop(); } void view_redraw() { V.redraw = true; } CCL_NAMESPACE_END goxel-0.8.1/ext_src/cycles/src/util/util_view.h000066400000000000000000000026401334742672700215340ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_VIEW_H__ #define __UTIL_VIEW_H__ /* Functions to display a simple OpenGL window using GLUT, simplified to the * bare minimum we need to reduce boilerplate code in tests apps. */ CCL_NAMESPACE_BEGIN typedef void (*ViewInitFunc)(void); typedef void (*ViewExitFunc)(void); typedef void (*ViewResizeFunc)(int width, int height); typedef void (*ViewDisplayFunc)(void); typedef void (*ViewKeyboardFunc)(unsigned char key); typedef void (*ViewMotionFunc)(int x, int y, int button); void view_main_loop(const char *title, int width, int height, ViewInitFunc initf, ViewExitFunc exitf, ViewResizeFunc resize, ViewDisplayFunc display, ViewKeyboardFunc keyboard, ViewMotionFunc motion); void view_display_info(const char *info); void view_display_help(); void view_redraw(); CCL_NAMESPACE_END #endif /*__UTIL_VIEW_H__*/ goxel-0.8.1/ext_src/cycles/src/util/util_windows.cpp000066400000000000000000000050571334742672700226140ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "util/util_windows.h" #ifdef _WIN32 CCL_NAMESPACE_BEGIN #ifdef _M_X64 # include #endif #if _WIN32_WINNT < 0x0601 tGetActiveProcessorGroupCount *GetActiveProcessorGroupCount; tGetActiveProcessorCount *GetActiveProcessorCount; tSetThreadGroupAffinity *SetThreadGroupAffinity; tGetProcessGroupAffinity *GetProcessGroupAffinity; #endif static WORD GetActiveProcessorGroupCount_stub() { return 1; } static DWORD GetActiveProcessorCount_stub(WORD /*GroupNumber*/) { SYSTEM_INFO info; GetSystemInfo(&info); return info.dwNumberOfProcessors; } static BOOL SetThreadGroupAffinity_stub( HANDLE /*hThread*/, const GROUP_AFFINITY * /*GroupAffinity*/, PGROUP_AFFINITY /*PreviousGroupAffinity*/) { return TRUE; } static BOOL GetProcessGroupAffinity_stub(HANDLE hProcess, PUSHORT GroupCount, PUSHORT GroupArray) { if(*GroupCount < 1) { return FALSE; } *GroupCount = 1; GroupArray[0] = 0; return TRUE; } static bool supports_numa() { #ifndef _M_X64 return false; #else return IsWindows7OrGreater(); #endif } void util_windows_init_numa_groups() { static bool initialized = false; if(initialized) { return; } initialized = true; #if _WIN32_WINNT < 0x0601 if(!supports_numa()) { /* Use stubs on platforms which doesn't have rean NUMA/Groups. */ GetActiveProcessorGroupCount = GetActiveProcessorGroupCount_stub; GetActiveProcessorCount = GetActiveProcessorCount_stub; SetThreadGroupAffinity = SetThreadGroupAffinity_stub; GetProcessGroupAffinity = GetProcessGroupAffinity_stub; return; } HMODULE kernel = GetModuleHandleA("kernel32.dll"); # define READ_SYMBOL(sym) sym = (t##sym*)GetProcAddress(kernel, #sym) READ_SYMBOL(GetActiveProcessorGroupCount); READ_SYMBOL(GetActiveProcessorCount); READ_SYMBOL(SetThreadGroupAffinity); READ_SYMBOL(GetProcessGroupAffinity); # undef READ_SUMBOL #endif } CCL_NAMESPACE_END #endif /* _WIN32 */ goxel-0.8.1/ext_src/cycles/src/util/util_windows.h000066400000000000000000000034001334742672700222470ustar00rootroot00000000000000/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_WINDOWS_H__ #define __UTIL_WINDOWS_H__ #ifdef _WIN32 #ifndef NOGDI # define NOGDI #endif #ifndef NOMINMAX # define NOMINMAX #endif #ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN #endif #include CCL_NAMESPACE_BEGIN #if _WIN32_WINNT < 0x0601 typedef WORD tGetActiveProcessorGroupCount(); typedef DWORD tGetActiveProcessorCount(WORD GroupNumber); typedef BOOL tSetThreadGroupAffinity(HANDLE hThread, const GROUP_AFFINITY *GroupAffinity, PGROUP_AFFINITY PreviousGroupAffinity); typedef BOOL tGetProcessGroupAffinity(HANDLE hProcess, PUSHORT GroupCount, PUSHORT GroupArray); extern tGetActiveProcessorGroupCount *GetActiveProcessorGroupCount; extern tGetActiveProcessorCount *GetActiveProcessorCount; extern tSetThreadGroupAffinity *SetThreadGroupAffinity; extern tGetProcessGroupAffinity *GetProcessGroupAffinity; #endif /* Make sure NUMA and processor groups API is initialized. */ void util_windows_init_numa_groups(); CCL_NAMESPACE_END #endif /* WIN32 */ #endif /* __UTIL_WINDOWS_H__ */ goxel-0.8.1/ext_src/cycles/src/util/util_xml.h000066400000000000000000000020501334742672700213550ustar00rootroot00000000000000/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __UTIL_XML_H__ #define __UTIL_XML_H__ /* PugiXML is used for XML parsing. */ #include CCL_NAMESPACE_BEGIN #ifdef WITH_SYSTEM_PUGIXML # define PUGIXML_NAMESPACE pugi #else # define PUGIXML_NAMESPACE OIIO_NAMESPACE::pugi #endif using PUGIXML_NAMESPACE::xml_attribute; using PUGIXML_NAMESPACE::xml_document; using PUGIXML_NAMESPACE::xml_node; using PUGIXML_NAMESPACE::xml_parse_result; CCL_NAMESPACE_END #endif /* __UTIL_XML_H__ */ goxel-0.8.1/ext_src/cycles/third_party/000077500000000000000000000000001334742672700201375ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/third_party/atomic/000077500000000000000000000000001334742672700214135ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/third_party/atomic/atomic_ops.h000066400000000000000000000140031334742672700237170ustar00rootroot00000000000000/* * Original code from jemalloc with this license: * * Copyright (C) 2002-2013 Jason Evans . * All rights reserved. * Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. * Copyright (C) 2009-2013 Facebook, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice(s), * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice(s), * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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. * * ***** BEGIN GPL LICENSE BLOCK ***** * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2016 Blender Foundation. * All rights reserved. * * The Original Code is: adapted from jemalloc. * * ***** END GPL LICENSE BLOCK ***** */ /** * \file atomic_ops.h * \ingroup Atomic * * \author Copyright (C) 2016 Blender Foundation, adapted from jemalloc. * \brief Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operations * over float numbers). */ #ifndef __ATOMIC_OPS_H__ #define __ATOMIC_OPS_H__ #if defined(__arm__) /* Attempt to fix compilation error on Debian armel kernel. * arm7 architecture does have both 32 and 64bit atomics, however * it's gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined. */ # define JE_FORCE_SYNC_COMPARE_AND_SWAP_1 # define JE_FORCE_SYNC_COMPARE_AND_SWAP_4 # define JE_FORCE_SYNC_COMPARE_AND_SWAP_8 #endif #include "intern/atomic_ops_utils.h" /******************************************************************************/ /* Function prototypes. */ #if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8) ATOMIC_INLINE uint64_t atomic_add_and_fetch_uint64(uint64_t *p, uint64_t x); ATOMIC_INLINE uint64_t atomic_sub_and_fetch_uint64(uint64_t *p, uint64_t x); ATOMIC_INLINE uint64_t atomic_fetch_and_add_uint64(uint64_t *p, uint64_t x); ATOMIC_INLINE uint64_t atomic_fetch_and_sub_uint64(uint64_t *p, uint64_t x); ATOMIC_INLINE uint64_t atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new); #endif ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32(uint32_t *p, uint32_t x); ATOMIC_INLINE uint32_t atomic_sub_and_fetch_uint32(uint32_t *p, uint32_t x); ATOMIC_INLINE uint32_t atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new); ATOMIC_INLINE uint32_t atomic_fetch_and_add_uint32(uint32_t *p, uint32_t x); ATOMIC_INLINE uint32_t atomic_fetch_and_or_uint32(uint32_t *p, uint32_t x); ATOMIC_INLINE uint32_t atomic_fetch_and_and_uint32(uint32_t *p, uint32_t x); ATOMIC_INLINE uint8_t atomic_fetch_and_or_uint8(uint8_t *p, uint8_t b); ATOMIC_INLINE uint8_t atomic_fetch_and_and_uint8(uint8_t *p, uint8_t b); ATOMIC_INLINE size_t atomic_add_and_fetch_z(size_t *p, size_t x); ATOMIC_INLINE size_t atomic_sub_and_fetch_z(size_t *p, size_t x); ATOMIC_INLINE size_t atomic_fetch_and_add_z(size_t *p, size_t x); ATOMIC_INLINE size_t atomic_fetch_and_sub_z(size_t *p, size_t x); ATOMIC_INLINE size_t atomic_cas_z(size_t *v, size_t old, size_t _new); ATOMIC_INLINE size_t atomic_fetch_and_update_max_z(size_t *p, size_t x); /* Uses CAS loop, see warning below. */ ATOMIC_INLINE unsigned int atomic_add_and_fetch_u(unsigned int *p, unsigned int x); ATOMIC_INLINE unsigned int atomic_sub_and_fetch_u(unsigned int *p, unsigned int x); ATOMIC_INLINE unsigned int atomic_fetch_and_add_u(unsigned int *p, unsigned int x); ATOMIC_INLINE unsigned int atomic_fetch_and_sub_u(unsigned int *p, unsigned int x); ATOMIC_INLINE unsigned int atomic_cas_u(unsigned int *v, unsigned int old, unsigned int _new); /* WARNING! Float 'atomics' are really faked ones, those are actually closer to some kind of spinlock-sync'ed operation, * which means they are only efficient if collisions are highly unlikely (i.e. if probability of two threads * working on the same pointer at the same time is very low). */ ATOMIC_INLINE float atomic_add_and_fetch_fl(float *p, const float x); /******************************************************************************/ /* Include system-dependent implementations. */ /* Note that we are using _unix flavor as fallback here (it will raise precompiler errors as needed). */ #if defined(_MSC_VER) # include "intern/atomic_ops_msvc.h" #else # include "intern/atomic_ops_unix.h" #endif /* Include 'fake' atomic extensions, built over real atomic primitives. */ #include "intern/atomic_ops_ext.h" #endif /* __ATOMIC_OPS_H__ */ goxel-0.8.1/ext_src/cycles/third_party/atomic/intern/000077500000000000000000000000001334742672700227125ustar00rootroot00000000000000goxel-0.8.1/ext_src/cycles/third_party/atomic/intern/atomic_ops_ext.h000066400000000000000000000157271334742672700261140ustar00rootroot00000000000000/* * Original code from jemalloc with this license: * * Copyright (C) 2002-2013 Jason Evans . * All rights reserved. * Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. * Copyright (C) 2009-2013 Facebook, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice(s), * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice(s), * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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. * * ***** BEGIN GPL LICENSE BLOCK ***** * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2016 Blender Foundation. * All rights reserved. * * The Original Code is: adapted from jemalloc. * * ***** END GPL LICENSE BLOCK ***** */ #ifndef __ATOMIC_OPS_EXT_H__ #define __ATOMIC_OPS_EXT_H__ #include "atomic_ops_utils.h" /******************************************************************************/ /* size_t operations. */ ATOMIC_INLINE size_t atomic_add_and_fetch_z(size_t *p, size_t x) { assert(sizeof(size_t) == LG_SIZEOF_PTR); #if (LG_SIZEOF_PTR == 8) return (size_t)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t)x); #elif (LG_SIZEOF_PTR == 4) return (size_t)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t)x); #endif } ATOMIC_INLINE size_t atomic_sub_and_fetch_z(size_t *p, size_t x) { assert(sizeof(size_t) == LG_SIZEOF_PTR); #if (LG_SIZEOF_PTR == 8) return (size_t)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_PTR == 4) return (size_t)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } ATOMIC_INLINE size_t atomic_fetch_and_add_z(size_t *p, size_t x) { assert(sizeof(size_t) == LG_SIZEOF_PTR); #if (LG_SIZEOF_PTR == 8) return (size_t)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t)x); #elif (LG_SIZEOF_PTR == 4) return (size_t)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t)x); #endif } ATOMIC_INLINE size_t atomic_fetch_and_sub_z(size_t *p, size_t x) { assert(sizeof(size_t) == LG_SIZEOF_PTR); #if (LG_SIZEOF_PTR == 8) return (size_t)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_PTR == 4) return (size_t)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } ATOMIC_INLINE size_t atomic_cas_z(size_t *v, size_t old, size_t _new) { assert(sizeof(size_t) == LG_SIZEOF_PTR); #if (LG_SIZEOF_PTR == 8) return (size_t)atomic_cas_uint64((uint64_t *)v, (uint64_t)old, (uint64_t)_new); #elif (LG_SIZEOF_PTR == 4) return (size_t)atomic_cas_uint32((uint32_t *)v, (uint32_t)old, (uint32_t)_new); #endif } ATOMIC_INLINE size_t atomic_fetch_and_update_max_z(size_t *p, size_t x) { size_t prev_value; while((prev_value = *p) < x) { if(atomic_cas_z(p, prev_value, x) == prev_value) { break; } } return prev_value; } /******************************************************************************/ /* unsigned operations. */ ATOMIC_INLINE unsigned int atomic_add_and_fetch_u(unsigned int *p, unsigned int x) { assert(sizeof(unsigned int) == LG_SIZEOF_INT); #if (LG_SIZEOF_INT == 8) return (unsigned int)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t)x); #elif (LG_SIZEOF_INT == 4) return (unsigned int)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t)x); #endif } ATOMIC_INLINE unsigned int atomic_sub_and_fetch_u(unsigned int *p, unsigned int x) { assert(sizeof(unsigned int) == LG_SIZEOF_INT); #if (LG_SIZEOF_INT == 8) return (unsigned int)atomic_add_and_fetch_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_INT == 4) return (unsigned int)atomic_add_and_fetch_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } ATOMIC_INLINE unsigned int atomic_fetch_and_add_u(unsigned int *p, unsigned int x) { assert(sizeof(unsigned int) == LG_SIZEOF_INT); #if (LG_SIZEOF_INT == 8) return (unsigned int)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t)x); #elif (LG_SIZEOF_INT == 4) return (unsigned int)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t)x); #endif } ATOMIC_INLINE unsigned int atomic_fetch_and_sub_u(unsigned int *p, unsigned int x) { assert(sizeof(unsigned int) == LG_SIZEOF_INT); #if (LG_SIZEOF_INT == 8) return (unsigned int)atomic_fetch_and_add_uint64((uint64_t *)p, (uint64_t)-((int64_t)x)); #elif (LG_SIZEOF_INT == 4) return (unsigned int)atomic_fetch_and_add_uint32((uint32_t *)p, (uint32_t)-((int32_t)x)); #endif } ATOMIC_INLINE unsigned int atomic_cas_u(unsigned int *v, unsigned int old, unsigned int _new) { assert(sizeof(unsigned int) == LG_SIZEOF_INT); #if (LG_SIZEOF_INT == 8) return (unsigned int)atomic_cas_uint64((uint64_t *)v, (uint64_t)old, (uint64_t)_new); #elif (LG_SIZEOF_INT == 4) return (unsigned int)atomic_cas_uint32((uint32_t *)v, (uint32_t)old, (uint32_t)_new); #endif } /******************************************************************************/ /* float operations. */ ATOMIC_INLINE float atomic_add_and_fetch_fl(float *p, const float x) { assert(sizeof(float) == sizeof(uint32_t)); float oldval, newval; uint32_t prevval; do { /* Note that since collisions are unlikely, loop will nearly always run once. */ oldval = *p; newval = oldval + x; prevval = atomic_cas_uint32((uint32_t *)p, *(uint32_t *)(&oldval), *(uint32_t *)(&newval)); } while (UNLIKELY(prevval != *(uint32_t *)(&oldval))); return newval; } #endif /* __ATOMIC_OPS_EXT_H__ */ goxel-0.8.1/ext_src/cycles/third_party/atomic/intern/atomic_ops_msvc.h000066400000000000000000000101361334742672700262510ustar00rootroot00000000000000/* * Adopted from jemalloc with this license: * * Copyright (C) 2002-2013 Jason Evans . * All rights reserved. * Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. * Copyright (C) 2009-2013 Facebook, Inc. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice(s), * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice(s), * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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 __ATOMIC_OPS_MSVC_H__ #define __ATOMIC_OPS_MSVC_H__ #include "atomic_ops_utils.h" #define NOGDI #ifndef NOMINMAX # define NOMINMAX #endif #define WIN32_LEAN_AND_MEAN #include #include /******************************************************************************/ /* 64-bit operations. */ #if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8) ATOMIC_INLINE uint64_t atomic_add_and_fetch_uint64(uint64_t *p, uint64_t x) { return InterlockedExchangeAdd64((int64_t *)p, (int64_t)x) + x; } ATOMIC_INLINE uint64_t atomic_sub_and_fetch_uint64(uint64_t *p, uint64_t x) { return InterlockedExchangeAdd64((int64_t *)p, -((int64_t)x)) - x; } ATOMIC_INLINE uint64_t atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new) { return InterlockedCompareExchange64((int64_t *)v, _new, old); } ATOMIC_INLINE uint64_t atomic_fetch_and_add_uint64(uint64_t *p, uint64_t x) { return InterlockedExchangeAdd64((int64_t *)p, (int64_t)x); } ATOMIC_INLINE uint64_t atomic_fetch_and_sub_uint64(uint64_t *p, uint64_t x) { return InterlockedExchangeAdd64((int64_t *)p, -((int64_t)x)); } #endif /******************************************************************************/ /* 32-bit operations. */ ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32(uint32_t *p, uint32_t x) { return InterlockedExchangeAdd(p, x) + x; } ATOMIC_INLINE uint32_t atomic_sub_and_fetch_uint32(uint32_t *p, uint32_t x) { return InterlockedExchangeAdd(p, -((int32_t)x)) - x; } ATOMIC_INLINE uint32_t atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new) { return InterlockedCompareExchange((long *)v, _new, old); } ATOMIC_INLINE uint32_t atomic_fetch_and_add_uint32(uint32_t *p, uint32_t x) { return InterlockedExchangeAdd(p, x); } ATOMIC_INLINE uint32_t atomic_fetch_and_or_uint32(uint32_t *p, uint32_t x) { return InterlockedOr((long *)p, x); } ATOMIC_INLINE uint32_t atomic_fetch_and_and_uint32(uint32_t *p, uint32_t x) { return InterlockedAnd((long *)p, x); } /******************************************************************************/ /* 8-bit operations. */ #pragma intrinsic(_InterlockedAnd8) ATOMIC_INLINE uint8_t atomic_fetch_and_and_uint8(uint8_t *p, uint8_t b) { #if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8) return InterlockedAnd8((char *)p, (char)b); #else return _InterlockedAnd8((char *)p, (char)b); #endif } #pragma intrinsic(_InterlockedOr8) ATOMIC_INLINE uint8_t atomic_fetch_and_or_uint8(uint8_t *p, uint8_t b) { #if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8) return InterlockedOr8((char *)p, (char)b); #else return _InterlockedOr8((char *)p, (char)b); #endif } #endif /* __ATOMIC_OPS_MSVC_H__ */ goxel-0.8.1/ext_src/cycles/third_party/atomic/intern/atomic_ops_unix.h000066400000000000000000000156131334742672700262710ustar00rootroot00000000000000/* * Original code from jemalloc with this license: * * Copyright (C) 2002-2013 Jason Evans . * All rights reserved. * Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. * Copyright (C) 2009-2013 Facebook, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice(s), * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice(s), * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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. * * ***** BEGIN GPL LICENSE BLOCK ***** * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2016 Blender Foundation. * All rights reserved. * * The Original Code is: adapted from jemalloc. * * ***** END GPL LICENSE BLOCK ***** */ #ifndef __ATOMIC_OPS_UNIX_H__ #define __ATOMIC_OPS_UNIX_H__ #include "atomic_ops_utils.h" /******************************************************************************/ /* 64-bit operations. */ #if (LG_SIZEOF_PTR == 8 || LG_SIZEOF_INT == 8) # if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) || defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_8)) ATOMIC_INLINE uint64_t atomic_add_and_fetch_uint64(uint64_t *p, uint64_t x) { return __sync_add_and_fetch(p, x); } ATOMIC_INLINE uint64_t atomic_sub_and_fetch_uint64(uint64_t *p, uint64_t x) { return __sync_sub_and_fetch(p, x); } ATOMIC_INLINE uint64_t atomic_fetch_and_add_uint64(uint64_t *p, uint64_t x) { return __sync_fetch_and_add(p, x); } ATOMIC_INLINE uint64_t atomic_fetch_and_sub_uint64(uint64_t *p, uint64_t x) { return __sync_fetch_and_sub(p, x); } ATOMIC_INLINE uint64_t atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new) { return __sync_val_compare_and_swap(v, old, _new); } # elif (defined(__amd64__) || defined(__x86_64__)) ATOMIC_INLINE uint64_t atomic_fetch_and_add_uint64(uint64_t *p, uint64_t x) { asm volatile ( "lock; xaddq %0, %1;" : "+r" (x), "=m" (*p) /* Outputs. */ : "m" (*p) /* Inputs. */ ); return x; } ATOMIC_INLINE uint64_t atomic_fetch_and_sub_uint64(uint64_t *p, uint64_t x) { x = (uint64_t)(-(int64_t)x); asm volatile ( "lock; xaddq %0, %1;" : "+r" (x), "=m" (*p) /* Outputs. */ : "m" (*p) /* Inputs. */ ); return x; } ATOMIC_INLINE uint64_t atomic_add_and_fetch_uint64(uint64_t *p, uint64_t x) { return atomic_fetch_and_add_uint64(p, x) + x; } ATOMIC_INLINE uint64_t atomic_sub_and_fetch_uint64(uint64_t *p, uint64_t x) { return atomic_fetch_and_sub_uint64(p, x) - x; } ATOMIC_INLINE uint64_t atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new) { uint64_t ret; asm volatile ( "lock; cmpxchgq %2,%1" : "=a" (ret), "+m" (*v) : "r" (_new), "0" (old) : "memory"); return ret; } # else # error "Missing implementation for 64-bit atomic operations" # endif #endif /******************************************************************************/ /* 32-bit operations. */ #if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_4)) ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32(uint32_t *p, uint32_t x) { return __sync_add_and_fetch(p, x); } ATOMIC_INLINE uint32_t atomic_sub_and_fetch_uint32(uint32_t *p, uint32_t x) { return __sync_sub_and_fetch(p, x); } ATOMIC_INLINE uint32_t atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new) { return __sync_val_compare_and_swap(v, old, _new); } #elif (defined(__i386__) || defined(__amd64__) || defined(__x86_64__)) ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32(uint32_t *p, uint32_t x) { uint32_t ret = x; asm volatile ( "lock; xaddl %0, %1;" : "+r" (ret), "=m" (*p) /* Outputs. */ : "m" (*p) /* Inputs. */ ); return ret+x; } ATOMIC_INLINE uint32_t atomic_sub_and_fetch_uint32(uint32_t *p, uint32_t x) { ret = (uint32_t)(-(int32_t)x); asm volatile ( "lock; xaddl %0, %1;" : "+r" (ret), "=m" (*p) /* Outputs. */ : "m" (*p) /* Inputs. */ ); return ret-x; } ATOMIC_INLINE uint32_t atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new) { uint32_t ret; asm volatile ( "lock; cmpxchgl %2,%1" : "=a" (ret), "+m" (*v) : "r" (_new), "0" (old) : "memory"); return ret; } #else # error "Missing implementation for 32-bit atomic operations" #endif #if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_4)) ATOMIC_INLINE uint32_t atomic_fetch_and_add_uint32(uint32_t *p, uint32_t x) { return __sync_fetch_and_add(p, x); } ATOMIC_INLINE uint32_t atomic_fetch_and_or_uint32(uint32_t *p, uint32_t x) { return __sync_fetch_and_or(p, x); } ATOMIC_INLINE uint32_t atomic_fetch_and_and_uint32(uint32_t *p, uint32_t x) { return __sync_fetch_and_and(p, x); } #else # error "Missing implementation for 32-bit atomic operations" #endif /******************************************************************************/ /* 8-bit operations. */ #if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1) || defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_1)) ATOMIC_INLINE uint8_t atomic_fetch_and_and_uint8(uint8_t *p, uint8_t b) { return __sync_fetch_and_and(p, b); } ATOMIC_INLINE uint8_t atomic_fetch_and_or_uint8(uint8_t *p, uint8_t b) { return __sync_fetch_and_or(p, b); } #else # error "Missing implementation for 8-bit atomic operations" #endif #endif /* __ATOMIC_OPS_UNIX_H__ */ goxel-0.8.1/ext_src/cycles/third_party/atomic/intern/atomic_ops_utils.h000066400000000000000000000073271334742672700264510ustar00rootroot00000000000000/* * Original code from jemalloc with this license: * * Copyright (C) 2002-2013 Jason Evans . * All rights reserved. * Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. * Copyright (C) 2009-2013 Facebook, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice(s), * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice(s), * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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. * * ***** BEGIN GPL LICENSE BLOCK ***** * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2016 Blender Foundation. * All rights reserved. * * The Original Code is: adapted from jemalloc. * * ***** END GPL LICENSE BLOCK ***** */ #ifndef __ATOMIC_OPS_UTILS_H__ #define __ATOMIC_OPS_UTILS_H__ #include #include #include #include #include /* little macro so inline keyword works */ #if defined(_MSC_VER) # define ATOMIC_INLINE static __forceinline #else # define ATOMIC_INLINE static inline __attribute__((always_inline)) #endif #ifndef LIKELY # ifdef __GNUC__ # define LIKELY(x) __builtin_expect(!!(x), 1) # define UNLIKELY(x) __builtin_expect(!!(x), 0) # else # define LIKELY(x) (x) # define UNLIKELY(x) (x) # endif #endif #if defined(__SIZEOF_POINTER__) # define LG_SIZEOF_PTR __SIZEOF_POINTER__ #elif defined(UINTPTR_MAX) # if (UINTPTR_MAX == 0xFFFFFFFF) # define LG_SIZEOF_PTR 4 # elif (UINTPTR_MAX == 0xFFFFFFFFFFFFFFFF) # define LG_SIZEOF_PTR 8 # endif #elif defined(__WORDSIZE) /* Fallback for older glibc and cpp */ # if (__WORDSIZE == 32) # define LG_SIZEOF_PTR 4 # elif (__WORDSIZE == 64) # define LG_SIZEOF_PTR 8 # endif #endif #ifndef LG_SIZEOF_PTR # error "Cannot find pointer size" #endif #if (UINT_MAX == 0xFFFFFFFF) # define LG_SIZEOF_INT 4 #elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF) # define LG_SIZEOF_INT 8 #else # error "Cannot find int size" #endif #endif /* __ATOMIC_OPS_UTILS_H__ */ goxel-0.8.1/ext_src/glew/000077500000000000000000000000001334742672700152625ustar00rootroot00000000000000goxel-0.8.1/ext_src/glew/GL/000077500000000000000000000000001334742672700155645ustar00rootroot00000000000000goxel-0.8.1/ext_src/glew/GL/glew.h000066400000000000000000037543421334742672700167150ustar00rootroot00000000000000/* ** The OpenGL Extension Wrangler Library ** Copyright (C) 2008-2015, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** 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. ** * The name of the author 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. */ /* * Mesa 3-D graphics library * Version: 7.0 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * 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 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* ** Copyright (c) 2007 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are 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 Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #ifndef __glew_h__ #define __glew_h__ #define __GLEW_H__ #if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H) #error gl.h included before glew.h #endif #if defined(__gl2_h_) #error gl2.h included before glew.h #endif #if defined(__gltypes_h_) #error gltypes.h included before glew.h #endif #if defined(__REGAL_H__) #error Regal.h included before glew.h #endif #if defined(__glext_h_) || defined(__GLEXT_H_) #error glext.h included before glew.h #endif #if defined(__gl_ATI_h_) #error glATI.h included before glew.h #endif #define __gl_h_ #define __gl2_h_ #define __GL_H__ #define _GL_H #define __gltypes_h_ #define __REGAL_H__ #define __X_GL_H #define __glext_h_ #define __GLEXT_H_ #define __gl_ATI_h_ #if defined(_WIN32) /* * GLEW does not include to avoid name space pollution. * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t * defined properly. */ /* and */ #ifdef APIENTRY # ifndef GLAPIENTRY # define GLAPIENTRY APIENTRY # endif # ifndef GLEWAPIENTRY # define GLEWAPIENTRY APIENTRY # endif #else #define GLEW_APIENTRY_DEFINED # if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) # define APIENTRY __stdcall # ifndef GLAPIENTRY # define GLAPIENTRY __stdcall # endif # ifndef GLEWAPIENTRY # define GLEWAPIENTRY __stdcall # endif # else # define APIENTRY # endif #endif #ifndef GLAPI # if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # endif #endif /* */ #ifndef CALLBACK #define GLEW_CALLBACK_DEFINED # if defined(__MINGW32__) || defined(__CYGWIN__) # define CALLBACK __attribute__ ((__stdcall__)) # elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) # define CALLBACK __stdcall # else # define CALLBACK # endif #endif /* and */ #ifndef WINGDIAPI #define GLEW_WINGDIAPI_DEFINED #define WINGDIAPI __declspec(dllimport) #endif /* */ #if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) typedef unsigned short wchar_t; # define _WCHAR_T_DEFINED #endif /* */ #if !defined(_W64) # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 # define _W64 __w64 # else # define _W64 # endif #endif #if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) # ifdef _WIN64 typedef __int64 ptrdiff_t; # else typedef _W64 int ptrdiff_t; # endif # define _PTRDIFF_T_DEFINED # define _PTRDIFF_T_ #endif #ifndef GLAPI # if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # else # define GLAPI WINGDIAPI # endif #endif /* * GLEW_STATIC is defined for static library. * GLEW_BUILD is defined for building the DLL library. */ #ifdef GLEW_STATIC # define GLEWAPI extern #else # ifdef GLEW_BUILD # define GLEWAPI extern __declspec(dllexport) # else # define GLEWAPI extern __declspec(dllimport) # endif #endif #else /* _UNIX */ /* * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO * C. On my system, this amounts to _3 lines_ of included code, all of * them pretty much harmless. If you know of a way of detecting 32 vs * 64 _targets_ at compile time you are free to replace this with * something that's portable. For now, _this_ is the portable solution. * (mem, 2004-01-04) */ #include /* SGI MIPSPro doesn't like stdint.h in C++ mode */ /* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ #if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) #include #else #include #endif #define GLEW_APIENTRY_DEFINED #define APIENTRY /* * GLEW_STATIC is defined for static library. */ #ifdef GLEW_STATIC # define GLEWAPI extern #else # if defined(__GNUC__) && __GNUC__>=4 # define GLEWAPI extern __attribute__ ((visibility("default"))) # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) # define GLEWAPI extern __global # else # define GLEWAPI extern # endif #endif /* */ #ifndef GLAPI #define GLAPI extern #endif #endif /* _WIN32 */ #ifndef GLAPIENTRY #define GLAPIENTRY #endif #ifndef GLEWAPIENTRY #define GLEWAPIENTRY #endif #ifdef __cplusplus extern "C" { #endif /* ----------------------------- GL_VERSION_1_1 ---------------------------- */ #ifndef GL_VERSION_1_1 #define GL_VERSION_1_1 1 typedef unsigned int GLenum; typedef unsigned int GLbitfield; typedef unsigned int GLuint; typedef int GLint; typedef int GLsizei; typedef unsigned char GLboolean; typedef signed char GLbyte; typedef short GLshort; typedef unsigned char GLubyte; typedef unsigned short GLushort; typedef unsigned long GLulong; typedef float GLfloat; typedef float GLclampf; typedef double GLdouble; typedef double GLclampd; typedef void GLvoid; #if defined(_MSC_VER) && _MSC_VER < 1400 typedef __int64 GLint64EXT; typedef unsigned __int64 GLuint64EXT; #elif defined(_MSC_VER) || defined(__BORLANDC__) typedef signed long long GLint64EXT; typedef unsigned long long GLuint64EXT; #else # if defined(__MINGW32__) || defined(__CYGWIN__) #include # endif typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; #endif typedef GLint64EXT GLint64; typedef GLuint64EXT GLuint64; typedef struct __GLsync *GLsync; typedef char GLchar; #define GL_ZERO 0 #define GL_FALSE 0 #define GL_LOGIC_OP 0x0BF1 #define GL_NONE 0 #define GL_TEXTURE_COMPONENTS 0x1003 #define GL_NO_ERROR 0 #define GL_POINTS 0x0000 #define GL_CURRENT_BIT 0x00000001 #define GL_TRUE 1 #define GL_ONE 1 #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 #define GL_POINT_BIT 0x00000002 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 #define GL_LINE_STRIP 0x0003 #define GL_LINE_BIT 0x00000004 #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 #define GL_QUADS 0x0007 #define GL_QUAD_STRIP 0x0008 #define GL_POLYGON_BIT 0x00000008 #define GL_POLYGON 0x0009 #define GL_POLYGON_STIPPLE_BIT 0x00000010 #define GL_PIXEL_MODE_BIT 0x00000020 #define GL_LIGHTING_BIT 0x00000040 #define GL_FOG_BIT 0x00000080 #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_ACCUM 0x0100 #define GL_LOAD 0x0101 #define GL_RETURN 0x0102 #define GL_MULT 0x0103 #define GL_ADD 0x0104 #define GL_NEVER 0x0200 #define GL_ACCUM_BUFFER_BIT 0x00000200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_FRONT_LEFT 0x0400 #define GL_FRONT_RIGHT 0x0401 #define GL_BACK_LEFT 0x0402 #define GL_BACK_RIGHT 0x0403 #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_LEFT 0x0406 #define GL_RIGHT 0x0407 #define GL_FRONT_AND_BACK 0x0408 #define GL_AUX0 0x0409 #define GL_AUX1 0x040A #define GL_AUX2 0x040B #define GL_AUX3 0x040C #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 #define GL_OUT_OF_MEMORY 0x0505 #define GL_2D 0x0600 #define GL_3D 0x0601 #define GL_3D_COLOR 0x0602 #define GL_3D_COLOR_TEXTURE 0x0603 #define GL_4D_COLOR_TEXTURE 0x0604 #define GL_PASS_THROUGH_TOKEN 0x0700 #define GL_POINT_TOKEN 0x0701 #define GL_LINE_TOKEN 0x0702 #define GL_POLYGON_TOKEN 0x0703 #define GL_BITMAP_TOKEN 0x0704 #define GL_DRAW_PIXEL_TOKEN 0x0705 #define GL_COPY_PIXEL_TOKEN 0x0706 #define GL_LINE_RESET_TOKEN 0x0707 #define GL_EXP 0x0800 #define GL_VIEWPORT_BIT 0x00000800 #define GL_EXP2 0x0801 #define GL_CW 0x0900 #define GL_CCW 0x0901 #define GL_COEFF 0x0A00 #define GL_ORDER 0x0A01 #define GL_DOMAIN 0x0A02 #define GL_CURRENT_COLOR 0x0B00 #define GL_CURRENT_INDEX 0x0B01 #define GL_CURRENT_NORMAL 0x0B02 #define GL_CURRENT_TEXTURE_COORDS 0x0B03 #define GL_CURRENT_RASTER_COLOR 0x0B04 #define GL_CURRENT_RASTER_INDEX 0x0B05 #define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 #define GL_CURRENT_RASTER_POSITION 0x0B07 #define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 #define GL_CURRENT_RASTER_DISTANCE 0x0B09 #define GL_POINT_SMOOTH 0x0B10 #define GL_POINT_SIZE 0x0B11 #define GL_POINT_SIZE_RANGE 0x0B12 #define GL_POINT_SIZE_GRANULARITY 0x0B13 #define GL_LINE_SMOOTH 0x0B20 #define GL_LINE_WIDTH 0x0B21 #define GL_LINE_WIDTH_RANGE 0x0B22 #define GL_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_LINE_STIPPLE 0x0B24 #define GL_LINE_STIPPLE_PATTERN 0x0B25 #define GL_LINE_STIPPLE_REPEAT 0x0B26 #define GL_LIST_MODE 0x0B30 #define GL_MAX_LIST_NESTING 0x0B31 #define GL_LIST_BASE 0x0B32 #define GL_LIST_INDEX 0x0B33 #define GL_POLYGON_MODE 0x0B40 #define GL_POLYGON_SMOOTH 0x0B41 #define GL_POLYGON_STIPPLE 0x0B42 #define GL_EDGE_FLAG 0x0B43 #define GL_CULL_FACE 0x0B44 #define GL_CULL_FACE_MODE 0x0B45 #define GL_FRONT_FACE 0x0B46 #define GL_LIGHTING 0x0B50 #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 #define GL_LIGHT_MODEL_AMBIENT 0x0B53 #define GL_SHADE_MODEL 0x0B54 #define GL_COLOR_MATERIAL_FACE 0x0B55 #define GL_COLOR_MATERIAL_PARAMETER 0x0B56 #define GL_COLOR_MATERIAL 0x0B57 #define GL_FOG 0x0B60 #define GL_FOG_INDEX 0x0B61 #define GL_FOG_DENSITY 0x0B62 #define GL_FOG_START 0x0B63 #define GL_FOG_END 0x0B64 #define GL_FOG_MODE 0x0B65 #define GL_FOG_COLOR 0x0B66 #define GL_DEPTH_RANGE 0x0B70 #define GL_DEPTH_TEST 0x0B71 #define GL_DEPTH_WRITEMASK 0x0B72 #define GL_DEPTH_CLEAR_VALUE 0x0B73 #define GL_DEPTH_FUNC 0x0B74 #define GL_ACCUM_CLEAR_VALUE 0x0B80 #define GL_STENCIL_TEST 0x0B90 #define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_VALUE_MASK 0x0B93 #define GL_STENCIL_FAIL 0x0B94 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_WRITEMASK 0x0B98 #define GL_MATRIX_MODE 0x0BA0 #define GL_NORMALIZE 0x0BA1 #define GL_VIEWPORT 0x0BA2 #define GL_MODELVIEW_STACK_DEPTH 0x0BA3 #define GL_PROJECTION_STACK_DEPTH 0x0BA4 #define GL_TEXTURE_STACK_DEPTH 0x0BA5 #define GL_MODELVIEW_MATRIX 0x0BA6 #define GL_PROJECTION_MATRIX 0x0BA7 #define GL_TEXTURE_MATRIX 0x0BA8 #define GL_ATTRIB_STACK_DEPTH 0x0BB0 #define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 #define GL_ALPHA_TEST 0x0BC0 #define GL_ALPHA_TEST_FUNC 0x0BC1 #define GL_ALPHA_TEST_REF 0x0BC2 #define GL_DITHER 0x0BD0 #define GL_BLEND_DST 0x0BE0 #define GL_BLEND_SRC 0x0BE1 #define GL_BLEND 0x0BE2 #define GL_LOGIC_OP_MODE 0x0BF0 #define GL_INDEX_LOGIC_OP 0x0BF1 #define GL_COLOR_LOGIC_OP 0x0BF2 #define GL_AUX_BUFFERS 0x0C00 #define GL_DRAW_BUFFER 0x0C01 #define GL_READ_BUFFER 0x0C02 #define GL_SCISSOR_BOX 0x0C10 #define GL_SCISSOR_TEST 0x0C11 #define GL_INDEX_CLEAR_VALUE 0x0C20 #define GL_INDEX_WRITEMASK 0x0C21 #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_INDEX_MODE 0x0C30 #define GL_RGBA_MODE 0x0C31 #define GL_DOUBLEBUFFER 0x0C32 #define GL_STEREO 0x0C33 #define GL_RENDER_MODE 0x0C40 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #define GL_POINT_SMOOTH_HINT 0x0C51 #define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_POLYGON_SMOOTH_HINT 0x0C53 #define GL_FOG_HINT 0x0C54 #define GL_TEXTURE_GEN_S 0x0C60 #define GL_TEXTURE_GEN_T 0x0C61 #define GL_TEXTURE_GEN_R 0x0C62 #define GL_TEXTURE_GEN_Q 0x0C63 #define GL_PIXEL_MAP_I_TO_I 0x0C70 #define GL_PIXEL_MAP_S_TO_S 0x0C71 #define GL_PIXEL_MAP_I_TO_R 0x0C72 #define GL_PIXEL_MAP_I_TO_G 0x0C73 #define GL_PIXEL_MAP_I_TO_B 0x0C74 #define GL_PIXEL_MAP_I_TO_A 0x0C75 #define GL_PIXEL_MAP_R_TO_R 0x0C76 #define GL_PIXEL_MAP_G_TO_G 0x0C77 #define GL_PIXEL_MAP_B_TO_B 0x0C78 #define GL_PIXEL_MAP_A_TO_A 0x0C79 #define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 #define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 #define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 #define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 #define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 #define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 #define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 #define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 #define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 #define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 #define GL_UNPACK_SWAP_BYTES 0x0CF0 #define GL_UNPACK_LSB_FIRST 0x0CF1 #define GL_UNPACK_ROW_LENGTH 0x0CF2 #define GL_UNPACK_SKIP_ROWS 0x0CF3 #define GL_UNPACK_SKIP_PIXELS 0x0CF4 #define GL_UNPACK_ALIGNMENT 0x0CF5 #define GL_PACK_SWAP_BYTES 0x0D00 #define GL_PACK_LSB_FIRST 0x0D01 #define GL_PACK_ROW_LENGTH 0x0D02 #define GL_PACK_SKIP_ROWS 0x0D03 #define GL_PACK_SKIP_PIXELS 0x0D04 #define GL_PACK_ALIGNMENT 0x0D05 #define GL_MAP_COLOR 0x0D10 #define GL_MAP_STENCIL 0x0D11 #define GL_INDEX_SHIFT 0x0D12 #define GL_INDEX_OFFSET 0x0D13 #define GL_RED_SCALE 0x0D14 #define GL_RED_BIAS 0x0D15 #define GL_ZOOM_X 0x0D16 #define GL_ZOOM_Y 0x0D17 #define GL_GREEN_SCALE 0x0D18 #define GL_GREEN_BIAS 0x0D19 #define GL_BLUE_SCALE 0x0D1A #define GL_BLUE_BIAS 0x0D1B #define GL_ALPHA_SCALE 0x0D1C #define GL_ALPHA_BIAS 0x0D1D #define GL_DEPTH_SCALE 0x0D1E #define GL_DEPTH_BIAS 0x0D1F #define GL_MAX_EVAL_ORDER 0x0D30 #define GL_MAX_LIGHTS 0x0D31 #define GL_MAX_CLIP_PLANES 0x0D32 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_PIXEL_MAP_TABLE 0x0D34 #define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 #define GL_MAX_NAME_STACK_DEPTH 0x0D37 #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B #define GL_SUBPIXEL_BITS 0x0D50 #define GL_INDEX_BITS 0x0D51 #define GL_RED_BITS 0x0D52 #define GL_GREEN_BITS 0x0D53 #define GL_BLUE_BITS 0x0D54 #define GL_ALPHA_BITS 0x0D55 #define GL_DEPTH_BITS 0x0D56 #define GL_STENCIL_BITS 0x0D57 #define GL_ACCUM_RED_BITS 0x0D58 #define GL_ACCUM_GREEN_BITS 0x0D59 #define GL_ACCUM_BLUE_BITS 0x0D5A #define GL_ACCUM_ALPHA_BITS 0x0D5B #define GL_NAME_STACK_DEPTH 0x0D70 #define GL_AUTO_NORMAL 0x0D80 #define GL_MAP1_COLOR_4 0x0D90 #define GL_MAP1_INDEX 0x0D91 #define GL_MAP1_NORMAL 0x0D92 #define GL_MAP1_TEXTURE_COORD_1 0x0D93 #define GL_MAP1_TEXTURE_COORD_2 0x0D94 #define GL_MAP1_TEXTURE_COORD_3 0x0D95 #define GL_MAP1_TEXTURE_COORD_4 0x0D96 #define GL_MAP1_VERTEX_3 0x0D97 #define GL_MAP1_VERTEX_4 0x0D98 #define GL_MAP2_COLOR_4 0x0DB0 #define GL_MAP2_INDEX 0x0DB1 #define GL_MAP2_NORMAL 0x0DB2 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3 #define GL_MAP2_TEXTURE_COORD_2 0x0DB4 #define GL_MAP2_TEXTURE_COORD_3 0x0DB5 #define GL_MAP2_TEXTURE_COORD_4 0x0DB6 #define GL_MAP2_VERTEX_3 0x0DB7 #define GL_MAP2_VERTEX_4 0x0DB8 #define GL_MAP1_GRID_DOMAIN 0x0DD0 #define GL_MAP1_GRID_SEGMENTS 0x0DD1 #define GL_MAP2_GRID_DOMAIN 0x0DD2 #define GL_MAP2_GRID_SEGMENTS 0x0DD3 #define GL_TEXTURE_1D 0x0DE0 #define GL_TEXTURE_2D 0x0DE1 #define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 #define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 #define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 #define GL_SELECTION_BUFFER_POINTER 0x0DF3 #define GL_SELECTION_BUFFER_SIZE 0x0DF4 #define GL_TEXTURE_WIDTH 0x1000 #define GL_TRANSFORM_BIT 0x00001000 #define GL_TEXTURE_HEIGHT 0x1001 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #define GL_TEXTURE_BORDER_COLOR 0x1004 #define GL_TEXTURE_BORDER 0x1005 #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 #define GL_AMBIENT 0x1200 #define GL_DIFFUSE 0x1201 #define GL_SPECULAR 0x1202 #define GL_POSITION 0x1203 #define GL_SPOT_DIRECTION 0x1204 #define GL_SPOT_EXPONENT 0x1205 #define GL_SPOT_CUTOFF 0x1206 #define GL_CONSTANT_ATTENUATION 0x1207 #define GL_LINEAR_ATTENUATION 0x1208 #define GL_QUADRATIC_ATTENUATION 0x1209 #define GL_COMPILE 0x1300 #define GL_COMPILE_AND_EXECUTE 0x1301 #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 #define GL_UNSIGNED_SHORT 0x1403 #define GL_INT 0x1404 #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 #define GL_2_BYTES 0x1407 #define GL_3_BYTES 0x1408 #define GL_4_BYTES 0x1409 #define GL_DOUBLE 0x140A #define GL_CLEAR 0x1500 #define GL_AND 0x1501 #define GL_AND_REVERSE 0x1502 #define GL_COPY 0x1503 #define GL_AND_INVERTED 0x1504 #define GL_NOOP 0x1505 #define GL_XOR 0x1506 #define GL_OR 0x1507 #define GL_NOR 0x1508 #define GL_EQUIV 0x1509 #define GL_INVERT 0x150A #define GL_OR_REVERSE 0x150B #define GL_COPY_INVERTED 0x150C #define GL_OR_INVERTED 0x150D #define GL_NAND 0x150E #define GL_SET 0x150F #define GL_EMISSION 0x1600 #define GL_SHININESS 0x1601 #define GL_AMBIENT_AND_DIFFUSE 0x1602 #define GL_COLOR_INDEXES 0x1603 #define GL_MODELVIEW 0x1700 #define GL_PROJECTION 0x1701 #define GL_TEXTURE 0x1702 #define GL_COLOR 0x1800 #define GL_DEPTH 0x1801 #define GL_STENCIL 0x1802 #define GL_COLOR_INDEX 0x1900 #define GL_STENCIL_INDEX 0x1901 #define GL_DEPTH_COMPONENT 0x1902 #define GL_RED 0x1903 #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_ALPHA 0x1906 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A #define GL_BITMAP 0x1A00 #define GL_POINT 0x1B00 #define GL_LINE 0x1B01 #define GL_FILL 0x1B02 #define GL_RENDER 0x1C00 #define GL_FEEDBACK 0x1C01 #define GL_SELECT 0x1C02 #define GL_FLAT 0x1D00 #define GL_SMOOTH 0x1D01 #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 #define GL_DECR 0x1E03 #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_S 0x2000 #define GL_ENABLE_BIT 0x00002000 #define GL_T 0x2001 #define GL_R 0x2002 #define GL_Q 0x2003 #define GL_MODULATE 0x2100 #define GL_DECAL 0x2101 #define GL_TEXTURE_ENV_MODE 0x2200 #define GL_TEXTURE_ENV_COLOR 0x2201 #define GL_TEXTURE_ENV 0x2300 #define GL_EYE_LINEAR 0x2400 #define GL_OBJECT_LINEAR 0x2401 #define GL_SPHERE_MAP 0x2402 #define GL_TEXTURE_GEN_MODE 0x2500 #define GL_OBJECT_PLANE 0x2501 #define GL_EYE_PLANE 0x2502 #define GL_NEAREST 0x2600 #define GL_LINEAR 0x2601 #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 #define GL_CLAMP 0x2900 #define GL_REPEAT 0x2901 #define GL_POLYGON_OFFSET_UNITS 0x2A00 #define GL_POLYGON_OFFSET_POINT 0x2A01 #define GL_POLYGON_OFFSET_LINE 0x2A02 #define GL_R3_G3_B2 0x2A10 #define GL_V2F 0x2A20 #define GL_V3F 0x2A21 #define GL_C4UB_V2F 0x2A22 #define GL_C4UB_V3F 0x2A23 #define GL_C3F_V3F 0x2A24 #define GL_N3F_V3F 0x2A25 #define GL_C4F_N3F_V3F 0x2A26 #define GL_T2F_V3F 0x2A27 #define GL_T4F_V4F 0x2A28 #define GL_T2F_C4UB_V3F 0x2A29 #define GL_T2F_C3F_V3F 0x2A2A #define GL_T2F_N3F_V3F 0x2A2B #define GL_T2F_C4F_N3F_V3F 0x2A2C #define GL_T4F_C4F_N3F_V4F 0x2A2D #define GL_CLIP_PLANE0 0x3000 #define GL_CLIP_PLANE1 0x3001 #define GL_CLIP_PLANE2 0x3002 #define GL_CLIP_PLANE3 0x3003 #define GL_CLIP_PLANE4 0x3004 #define GL_CLIP_PLANE5 0x3005 #define GL_LIGHT0 0x4000 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_LIGHT1 0x4001 #define GL_LIGHT2 0x4002 #define GL_LIGHT3 0x4003 #define GL_LIGHT4 0x4004 #define GL_LIGHT5 0x4005 #define GL_LIGHT6 0x4006 #define GL_LIGHT7 0x4007 #define GL_HINT_BIT 0x00008000 #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_ALPHA4 0x803B #define GL_ALPHA8 0x803C #define GL_ALPHA12 0x803D #define GL_ALPHA16 0x803E #define GL_LUMINANCE4 0x803F #define GL_LUMINANCE8 0x8040 #define GL_LUMINANCE12 0x8041 #define GL_LUMINANCE16 0x8042 #define GL_LUMINANCE4_ALPHA4 0x8043 #define GL_LUMINANCE6_ALPHA2 0x8044 #define GL_LUMINANCE8_ALPHA8 0x8045 #define GL_LUMINANCE12_ALPHA4 0x8046 #define GL_LUMINANCE12_ALPHA12 0x8047 #define GL_LUMINANCE16_ALPHA16 0x8048 #define GL_INTENSITY 0x8049 #define GL_INTENSITY4 0x804A #define GL_INTENSITY8 0x804B #define GL_INTENSITY12 0x804C #define GL_INTENSITY16 0x804D #define GL_RGB4 0x804F #define GL_RGB5 0x8050 #define GL_RGB8 0x8051 #define GL_RGB10 0x8052 #define GL_RGB12 0x8053 #define GL_RGB16 0x8054 #define GL_RGBA2 0x8055 #define GL_RGBA4 0x8056 #define GL_RGB5_A1 0x8057 #define GL_RGBA8 0x8058 #define GL_RGB10_A2 0x8059 #define GL_RGBA12 0x805A #define GL_RGBA16 0x805B #define GL_TEXTURE_RED_SIZE 0x805C #define GL_TEXTURE_GREEN_SIZE 0x805D #define GL_TEXTURE_BLUE_SIZE 0x805E #define GL_TEXTURE_ALPHA_SIZE 0x805F #define GL_TEXTURE_LUMINANCE_SIZE 0x8060 #define GL_TEXTURE_INTENSITY_SIZE 0x8061 #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 #define GL_TEXTURE_PRIORITY 0x8066 #define GL_TEXTURE_RESIDENT 0x8067 #define GL_TEXTURE_BINDING_1D 0x8068 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_VERTEX_ARRAY 0x8074 #define GL_NORMAL_ARRAY 0x8075 #define GL_COLOR_ARRAY 0x8076 #define GL_INDEX_ARRAY 0x8077 #define GL_TEXTURE_COORD_ARRAY 0x8078 #define GL_EDGE_FLAG_ARRAY 0x8079 #define GL_VERTEX_ARRAY_SIZE 0x807A #define GL_VERTEX_ARRAY_TYPE 0x807B #define GL_VERTEX_ARRAY_STRIDE 0x807C #define GL_NORMAL_ARRAY_TYPE 0x807E #define GL_NORMAL_ARRAY_STRIDE 0x807F #define GL_COLOR_ARRAY_SIZE 0x8081 #define GL_COLOR_ARRAY_TYPE 0x8082 #define GL_COLOR_ARRAY_STRIDE 0x8083 #define GL_INDEX_ARRAY_TYPE 0x8085 #define GL_INDEX_ARRAY_STRIDE 0x8086 #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A #define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C #define GL_VERTEX_ARRAY_POINTER 0x808E #define GL_NORMAL_ARRAY_POINTER 0x808F #define GL_COLOR_ARRAY_POINTER 0x8090 #define GL_INDEX_ARRAY_POINTER 0x8091 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 #define GL_COLOR_INDEX1_EXT 0x80E2 #define GL_COLOR_INDEX2_EXT 0x80E3 #define GL_COLOR_INDEX4_EXT 0x80E4 #define GL_COLOR_INDEX8_EXT 0x80E5 #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 #define GL_EVAL_BIT 0x00010000 #define GL_LIST_BIT 0x00020000 #define GL_TEXTURE_BIT 0x00040000 #define GL_SCISSOR_BIT 0x00080000 #define GL_ALL_ATTRIB_BITS 0x000fffff #define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); GLAPI void GLAPIENTRY glArrayElement (GLint i); GLAPI void GLAPIENTRY glBegin (GLenum mode); GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); GLAPI void GLAPIENTRY glCallList (GLuint list); GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const void *lists); GLAPI void GLAPIENTRY glClear (GLbitfield mask); GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); GLAPI void GLAPIENTRY glClearIndex (GLfloat c); GLAPI void GLAPIENTRY glClearStencil (GLint s); GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); GLAPI void GLAPIENTRY glColor3iv (const GLint *v); GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); GLAPI void GLAPIENTRY glColor4iv (const GLint *v); GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void GLAPIENTRY glCullFace (GLenum mode); GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); GLAPI void GLAPIENTRY glDepthFunc (GLenum func); GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); GLAPI void GLAPIENTRY glDisable (GLenum cap); GLAPI void GLAPIENTRY glDisableClientState (GLenum array); GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); GLAPI void GLAPIENTRY glEnable (GLenum cap); GLAPI void GLAPIENTRY glEnableClientState (GLenum array); GLAPI void GLAPIENTRY glEnd (void); GLAPI void GLAPIENTRY glEndList (void); GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); GLAPI void GLAPIENTRY glFinish (void); GLAPI void GLAPIENTRY glFlush (void); GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glFrontFace (GLenum mode); GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); GLAPI GLenum GLAPIENTRY glGetError (void); GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, void* *params); GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); GLAPI void GLAPIENTRY glIndexMask (GLuint mask); GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glIndexd (GLdouble c); GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); GLAPI void GLAPIENTRY glIndexf (GLfloat c); GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); GLAPI void GLAPIENTRY glIndexi (GLint c); GLAPI void GLAPIENTRY glIndexiv (const GLint *c); GLAPI void GLAPIENTRY glIndexs (GLshort c); GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); GLAPI void GLAPIENTRY glIndexub (GLubyte c); GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); GLAPI void GLAPIENTRY glInitNames (void); GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const void *pointer); GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); GLAPI void GLAPIENTRY glLineWidth (GLfloat width); GLAPI void GLAPIENTRY glListBase (GLuint base); GLAPI void GLAPIENTRY glLoadIdentity (void); GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); GLAPI void GLAPIENTRY glLoadName (GLuint name); GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLAPI void GLAPIENTRY glPassThrough (GLfloat token); GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); GLAPI void GLAPIENTRY glPointSize (GLfloat size); GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); GLAPI void GLAPIENTRY glPopAttrib (void); GLAPI void GLAPIENTRY glPopClientAttrib (void); GLAPI void GLAPIENTRY glPopMatrix (void); GLAPI void GLAPIENTRY glPopName (void); GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); GLAPI void GLAPIENTRY glPushMatrix (void); GLAPI void GLAPIENTRY glPushName (GLuint name); GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); GLAPI void GLAPIENTRY glShadeModel (GLenum mode); GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GLAPI void GLAPIENTRY glStencilMask (GLuint mask); GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord1i (GLint s); GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); #define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) #endif /* GL_VERSION_1_1 */ /* ---------------------------------- GLU ---------------------------------- */ #ifndef GLEW_NO_GLU # ifdef __APPLE__ # include # if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) # define GLEW_NO_GLU # endif # endif #endif #ifndef GLEW_NO_GLU /* this is where we can safely include GLU */ # if defined(__APPLE__) && defined(__MACH__) # include # else # include # endif #endif /* ----------------------------- GL_VERSION_1_2 ---------------------------- */ #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_INT_8_8_8_8 0x8035 #define GL_UNSIGNED_INT_10_10_10_2 0x8036 #define GL_RESCALE_NORMAL 0x803A #define GL_TEXTURE_BINDING_3D 0x806A #define GL_PACK_SKIP_IMAGES 0x806B #define GL_PACK_IMAGE_HEIGHT 0x806C #define GL_UNPACK_SKIP_IMAGES 0x806D #define GL_UNPACK_IMAGE_HEIGHT 0x806E #define GL_TEXTURE_3D 0x806F #define GL_PROXY_TEXTURE_3D 0x8070 #define GL_TEXTURE_DEPTH 0x8071 #define GL_TEXTURE_WRAP_R 0x8072 #define GL_MAX_3D_TEXTURE_SIZE 0x8073 #define GL_BGR 0x80E0 #define GL_BGRA 0x80E1 #define GL_MAX_ELEMENTS_VERTICES 0x80E8 #define GL_MAX_ELEMENTS_INDICES 0x80E9 #define GL_CLAMP_TO_EDGE 0x812F #define GL_TEXTURE_MIN_LOD 0x813A #define GL_TEXTURE_MAX_LOD 0x813B #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #define GL_SINGLE_COLOR 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); #define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) #define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) #define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) #define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) #define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) #endif /* GL_VERSION_1_2 */ /* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ #ifndef GL_VERSION_1_2_1 #define GL_VERSION_1_2_1 1 #define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) #endif /* GL_VERSION_1_2_1 */ /* ----------------------------- GL_VERSION_1_3 ---------------------------- */ #ifndef GL_VERSION_1_3 #define GL_VERSION_1_3 1 #define GL_MULTISAMPLE 0x809D #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_ALPHA_TO_ONE 0x809F #define GL_SAMPLE_COVERAGE 0x80A0 #define GL_SAMPLE_BUFFERS 0x80A8 #define GL_SAMPLES 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB #define GL_CLAMP_TO_BORDER 0x812D #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_TEXTURE2 0x84C2 #define GL_TEXTURE3 0x84C3 #define GL_TEXTURE4 0x84C4 #define GL_TEXTURE5 0x84C5 #define GL_TEXTURE6 0x84C6 #define GL_TEXTURE7 0x84C7 #define GL_TEXTURE8 0x84C8 #define GL_TEXTURE9 0x84C9 #define GL_TEXTURE10 0x84CA #define GL_TEXTURE11 0x84CB #define GL_TEXTURE12 0x84CC #define GL_TEXTURE13 0x84CD #define GL_TEXTURE14 0x84CE #define GL_TEXTURE15 0x84CF #define GL_TEXTURE16 0x84D0 #define GL_TEXTURE17 0x84D1 #define GL_TEXTURE18 0x84D2 #define GL_TEXTURE19 0x84D3 #define GL_TEXTURE20 0x84D4 #define GL_TEXTURE21 0x84D5 #define GL_TEXTURE22 0x84D6 #define GL_TEXTURE23 0x84D7 #define GL_TEXTURE24 0x84D8 #define GL_TEXTURE25 0x84D9 #define GL_TEXTURE26 0x84DA #define GL_TEXTURE27 0x84DB #define GL_TEXTURE28 0x84DC #define GL_TEXTURE29 0x84DD #define GL_TEXTURE30 0x84DE #define GL_TEXTURE31 0x84DF #define GL_ACTIVE_TEXTURE 0x84E0 #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 #define GL_MAX_TEXTURE_UNITS 0x84E2 #define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 #define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 #define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 #define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 #define GL_SUBTRACT 0x84E7 #define GL_COMPRESSED_ALPHA 0x84E9 #define GL_COMPRESSED_LUMINANCE 0x84EA #define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB #define GL_COMPRESSED_INTENSITY 0x84EC #define GL_COMPRESSED_RGB 0x84ED #define GL_COMPRESSED_RGBA 0x84EE #define GL_TEXTURE_COMPRESSION_HINT 0x84EF #define GL_NORMAL_MAP 0x8511 #define GL_REFLECTION_MAP 0x8512 #define GL_TEXTURE_CUBE_MAP 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C #define GL_COMBINE 0x8570 #define GL_COMBINE_RGB 0x8571 #define GL_COMBINE_ALPHA 0x8572 #define GL_RGB_SCALE 0x8573 #define GL_ADD_SIGNED 0x8574 #define GL_INTERPOLATE 0x8575 #define GL_CONSTANT 0x8576 #define GL_PRIMARY_COLOR 0x8577 #define GL_PREVIOUS 0x8578 #define GL_SOURCE0_RGB 0x8580 #define GL_SOURCE1_RGB 0x8581 #define GL_SOURCE2_RGB 0x8582 #define GL_SOURCE0_ALPHA 0x8588 #define GL_SOURCE1_ALPHA 0x8589 #define GL_SOURCE2_ALPHA 0x858A #define GL_OPERAND0_RGB 0x8590 #define GL_OPERAND1_RGB 0x8591 #define GL_OPERAND2_RGB 0x8592 #define GL_OPERAND0_ALPHA 0x8598 #define GL_OPERAND1_ALPHA 0x8599 #define GL_OPERAND2_ALPHA 0x859A #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 #define GL_TEXTURE_COMPRESSED 0x86A1 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_DOT3_RGB 0x86AE #define GL_DOT3_RGBA 0x86AF #define GL_MULTISAMPLE_BIT 0x20000000 typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, void *img); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); #define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) #define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) #define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) #define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) #define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) #define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) #define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) #define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) #define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) #define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) #define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) #define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) #define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) #define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) #define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) #define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) #define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) #define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) #define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) #define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) #define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) #define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) #define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) #define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) #define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) #define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) #define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) #define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) #define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) #define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) #define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) #define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) #define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) #define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) #define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) #define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) #define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) #define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) #define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) #define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) #define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) #define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) #define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) #define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) #define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) #define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) #define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) #endif /* GL_VERSION_1_3 */ /* ----------------------------- GL_VERSION_1_4 ---------------------------- */ #ifndef GL_VERSION_1_4 #define GL_VERSION_1_4 1 #define GL_BLEND_DST_RGB 0x80C8 #define GL_BLEND_SRC_RGB 0x80C9 #define GL_BLEND_DST_ALPHA 0x80CA #define GL_BLEND_SRC_ALPHA 0x80CB #define GL_POINT_SIZE_MIN 0x8126 #define GL_POINT_SIZE_MAX 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 #define GL_POINT_DISTANCE_ATTENUATION 0x8129 #define GL_GENERATE_MIPMAP 0x8191 #define GL_GENERATE_MIPMAP_HINT 0x8192 #define GL_DEPTH_COMPONENT16 0x81A5 #define GL_DEPTH_COMPONENT24 0x81A6 #define GL_DEPTH_COMPONENT32 0x81A7 #define GL_MIRRORED_REPEAT 0x8370 #define GL_FOG_COORDINATE_SOURCE 0x8450 #define GL_FOG_COORDINATE 0x8451 #define GL_FRAGMENT_DEPTH 0x8452 #define GL_CURRENT_FOG_COORDINATE 0x8453 #define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 #define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 #define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 #define GL_FOG_COORDINATE_ARRAY 0x8457 #define GL_COLOR_SUM 0x8458 #define GL_CURRENT_SECONDARY_COLOR 0x8459 #define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A #define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B #define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C #define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D #define GL_SECONDARY_COLOR_ARRAY 0x845E #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD #define GL_TEXTURE_FILTER_CONTROL 0x8500 #define GL_TEXTURE_LOD_BIAS 0x8501 #define GL_INCR_WRAP 0x8507 #define GL_DECR_WRAP 0x8508 #define GL_TEXTURE_DEPTH_SIZE 0x884A #define GL_DEPTH_TEXTURE_MODE 0x884B #define GL_TEXTURE_COMPARE_MODE 0x884C #define GL_TEXTURE_COMPARE_FUNC 0x884D #define GL_COMPARE_R_TO_TEXTURE 0x884E typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); #define glBlendColor GLEW_GET_FUN(__glewBlendColor) #define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) #define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) #define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) #define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) #define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) #define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) #define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) #define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) #define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) #define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) #define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) #define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) #define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) #define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) #define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) #define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) #define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) #define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) #define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) #define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) #define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) #define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) #define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) #define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) #define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) #define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) #define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) #define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) #define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) #define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) #define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) #define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) #define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) #define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) #define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) #define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) #define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) #define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) #define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) #define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) #define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) #define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) #define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) #define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) #define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) #define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) #define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) #endif /* GL_VERSION_1_4 */ /* ----------------------------- GL_VERSION_1_5 ---------------------------- */ #ifndef GL_VERSION_1_5 #define GL_VERSION_1_5 1 #define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE #define GL_FOG_COORD GL_FOG_COORDINATE #define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY #define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING #define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER #define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE #define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE #define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE #define GL_SRC0_ALPHA GL_SOURCE0_ALPHA #define GL_SRC0_RGB GL_SOURCE0_RGB #define GL_SRC1_ALPHA GL_SOURCE1_ALPHA #define GL_SRC1_RGB GL_SOURCE1_RGB #define GL_SRC2_ALPHA GL_SOURCE2_ALPHA #define GL_SRC2_RGB GL_SOURCE2_RGB #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 #define GL_QUERY_COUNTER_BITS 0x8864 #define GL_CURRENT_QUERY 0x8865 #define GL_QUERY_RESULT 0x8866 #define GL_QUERY_RESULT_AVAILABLE 0x8867 #define GL_ARRAY_BUFFER 0x8892 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_ARRAY_BUFFER_BINDING 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 #define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D #define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F #define GL_READ_ONLY 0x88B8 #define GL_WRITE_ONLY 0x88B9 #define GL_READ_WRITE 0x88BA #define GL_BUFFER_ACCESS 0x88BB #define GL_BUFFER_MAPPED 0x88BC #define GL_BUFFER_MAP_POINTER 0x88BD #define GL_STREAM_DRAW 0x88E0 #define GL_STREAM_READ 0x88E1 #define GL_STREAM_COPY 0x88E2 #define GL_STATIC_DRAW 0x88E4 #define GL_STATIC_READ 0x88E5 #define GL_STATIC_COPY 0x88E6 #define GL_DYNAMIC_DRAW 0x88E8 #define GL_DYNAMIC_READ 0x88E9 #define GL_DYNAMIC_COPY 0x88EA #define GL_SAMPLES_PASSED 0x8914 typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLsizeiptr; typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void* data, GLenum usage); typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void* data); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); typedef void* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); #define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) #define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) #define glBufferData GLEW_GET_FUN(__glewBufferData) #define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) #define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) #define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) #define glEndQuery GLEW_GET_FUN(__glewEndQuery) #define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) #define glGenQueries GLEW_GET_FUN(__glewGenQueries) #define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) #define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) #define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) #define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) #define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) #define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) #define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) #define glIsQuery GLEW_GET_FUN(__glewIsQuery) #define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) #define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) #define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) #endif /* GL_VERSION_1_5 */ /* ----------------------------- GL_VERSION_2_0 ---------------------------- */ #ifndef GL_VERSION_2_0 #define GL_VERSION_2_0 1 #define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 #define GL_CURRENT_VERTEX_ATTRIB 0x8626 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 #define GL_STENCIL_BACK_FUNC 0x8800 #define GL_STENCIL_BACK_FAIL 0x8801 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 #define GL_MAX_DRAW_BUFFERS 0x8824 #define GL_DRAW_BUFFER0 0x8825 #define GL_DRAW_BUFFER1 0x8826 #define GL_DRAW_BUFFER2 0x8827 #define GL_DRAW_BUFFER3 0x8828 #define GL_DRAW_BUFFER4 0x8829 #define GL_DRAW_BUFFER5 0x882A #define GL_DRAW_BUFFER6 0x882B #define GL_DRAW_BUFFER7 0x882C #define GL_DRAW_BUFFER8 0x882D #define GL_DRAW_BUFFER9 0x882E #define GL_DRAW_BUFFER10 0x882F #define GL_DRAW_BUFFER11 0x8830 #define GL_DRAW_BUFFER12 0x8831 #define GL_DRAW_BUFFER13 0x8832 #define GL_DRAW_BUFFER14 0x8833 #define GL_DRAW_BUFFER15 0x8834 #define GL_BLEND_EQUATION_ALPHA 0x883D #define GL_POINT_SPRITE 0x8861 #define GL_COORD_REPLACE 0x8862 #define GL_MAX_VERTEX_ATTRIBS 0x8869 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A #define GL_MAX_TEXTURE_COORDS 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A #define GL_MAX_VARYING_FLOATS 0x8B4B #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D #define GL_SHADER_TYPE 0x8B4F #define GL_FLOAT_VEC2 0x8B50 #define GL_FLOAT_VEC3 0x8B51 #define GL_FLOAT_VEC4 0x8B52 #define GL_INT_VEC2 0x8B53 #define GL_INT_VEC3 0x8B54 #define GL_INT_VEC4 0x8B55 #define GL_BOOL 0x8B56 #define GL_BOOL_VEC2 0x8B57 #define GL_BOOL_VEC3 0x8B58 #define GL_BOOL_VEC4 0x8B59 #define GL_FLOAT_MAT2 0x8B5A #define GL_FLOAT_MAT3 0x8B5B #define GL_FLOAT_MAT4 0x8B5C #define GL_SAMPLER_1D 0x8B5D #define GL_SAMPLER_2D 0x8B5E #define GL_SAMPLER_3D 0x8B5F #define GL_SAMPLER_CUBE 0x8B60 #define GL_SAMPLER_1D_SHADOW 0x8B61 #define GL_SAMPLER_2D_SHADOW 0x8B62 #define GL_DELETE_STATUS 0x8B80 #define GL_COMPILE_STATUS 0x8B81 #define GL_LINK_STATUS 0x8B82 #define GL_VALIDATE_STATUS 0x8B83 #define GL_INFO_LOG_LENGTH 0x8B84 #define GL_ATTACHED_SHADERS 0x8B85 #define GL_ACTIVE_UNIFORMS 0x8B86 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 #define GL_SHADER_SOURCE_LENGTH 0x8B88 #define GL_ACTIVE_ATTRIBUTES 0x8B89 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B #define GL_SHADING_LANGUAGE_VERSION 0x8B8C #define GL_CURRENT_PROGRAM 0x8B8D #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 #define GL_LOWER_LEFT 0x8CA1 #define GL_UPPER_LEFT 0x8CA2 #define GL_STENCIL_BACK_REF 0x8CA3 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const* string, const GLint* length); typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); #define glAttachShader GLEW_GET_FUN(__glewAttachShader) #define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) #define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) #define glCompileShader GLEW_GET_FUN(__glewCompileShader) #define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) #define glCreateShader GLEW_GET_FUN(__glewCreateShader) #define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) #define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) #define glDetachShader GLEW_GET_FUN(__glewDetachShader) #define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) #define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) #define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) #define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) #define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) #define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) #define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) #define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) #define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) #define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) #define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) #define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) #define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) #define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) #define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) #define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) #define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) #define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) #define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) #define glIsProgram GLEW_GET_FUN(__glewIsProgram) #define glIsShader GLEW_GET_FUN(__glewIsShader) #define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) #define glShaderSource GLEW_GET_FUN(__glewShaderSource) #define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) #define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) #define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) #define glUniform1f GLEW_GET_FUN(__glewUniform1f) #define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) #define glUniform1i GLEW_GET_FUN(__glewUniform1i) #define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) #define glUniform2f GLEW_GET_FUN(__glewUniform2f) #define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) #define glUniform2i GLEW_GET_FUN(__glewUniform2i) #define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) #define glUniform3f GLEW_GET_FUN(__glewUniform3f) #define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) #define glUniform3i GLEW_GET_FUN(__glewUniform3i) #define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) #define glUniform4f GLEW_GET_FUN(__glewUniform4f) #define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) #define glUniform4i GLEW_GET_FUN(__glewUniform4i) #define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) #define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) #define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) #define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) #define glUseProgram GLEW_GET_FUN(__glewUseProgram) #define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) #define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) #define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) #define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) #define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) #define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) #define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) #define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) #define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) #define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) #define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) #define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) #define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) #define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) #define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) #define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) #define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) #define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) #define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) #define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) #define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) #define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) #define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) #define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) #define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) #define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) #define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) #define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) #define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) #define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) #define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) #define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) #define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) #define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) #define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) #define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) #define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) #define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) #define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) #endif /* GL_VERSION_2_0 */ /* ----------------------------- GL_VERSION_2_1 ---------------------------- */ #ifndef GL_VERSION_2_1 #define GL_VERSION_2_1 1 #define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F #define GL_PIXEL_PACK_BUFFER 0x88EB #define GL_PIXEL_UNPACK_BUFFER 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF #define GL_FLOAT_MAT2x3 0x8B65 #define GL_FLOAT_MAT2x4 0x8B66 #define GL_FLOAT_MAT3x2 0x8B67 #define GL_FLOAT_MAT3x4 0x8B68 #define GL_FLOAT_MAT4x2 0x8B69 #define GL_FLOAT_MAT4x3 0x8B6A #define GL_SRGB 0x8C40 #define GL_SRGB8 0x8C41 #define GL_SRGB_ALPHA 0x8C42 #define GL_SRGB8_ALPHA8 0x8C43 #define GL_SLUMINANCE_ALPHA 0x8C44 #define GL_SLUMINANCE8_ALPHA8 0x8C45 #define GL_SLUMINANCE 0x8C46 #define GL_SLUMINANCE8 0x8C47 #define GL_COMPRESSED_SRGB 0x8C48 #define GL_COMPRESSED_SRGB_ALPHA 0x8C49 #define GL_COMPRESSED_SLUMINANCE 0x8C4A #define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) #define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) #define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) #define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) #define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) #define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) #define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) #endif /* GL_VERSION_2_1 */ /* ----------------------------- GL_VERSION_3_0 ---------------------------- */ #ifndef GL_VERSION_3_0 #define GL_VERSION_3_0 1 #define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 #define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 #define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 #define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 #define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 #define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 #define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB #define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES #define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 #define GL_MAJOR_VERSION 0x821B #define GL_MINOR_VERSION 0x821C #define GL_NUM_EXTENSIONS 0x821D #define GL_CONTEXT_FLAGS 0x821E #define GL_DEPTH_BUFFER 0x8223 #define GL_STENCIL_BUFFER 0x8224 #define GL_RGBA32F 0x8814 #define GL_RGB32F 0x8815 #define GL_RGBA16F 0x881A #define GL_RGB16F 0x881B #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 #define GL_CLAMP_VERTEX_COLOR 0x891A #define GL_CLAMP_FRAGMENT_COLOR 0x891B #define GL_CLAMP_READ_COLOR 0x891C #define GL_FIXED_ONLY 0x891D #define GL_TEXTURE_RED_TYPE 0x8C10 #define GL_TEXTURE_GREEN_TYPE 0x8C11 #define GL_TEXTURE_BLUE_TYPE 0x8C12 #define GL_TEXTURE_ALPHA_TYPE 0x8C13 #define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 #define GL_TEXTURE_INTENSITY_TYPE 0x8C15 #define GL_TEXTURE_DEPTH_TYPE 0x8C16 #define GL_TEXTURE_1D_ARRAY 0x8C18 #define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 #define GL_TEXTURE_2D_ARRAY 0x8C1A #define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B #define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D #define GL_R11F_G11F_B10F 0x8C3A #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B #define GL_RGB9_E5 0x8C3D #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E #define GL_TEXTURE_SHARED_SIZE 0x8C3F #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 #define GL_PRIMITIVES_GENERATED 0x8C87 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 #define GL_RASTERIZER_DISCARD 0x8C89 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B #define GL_INTERLEAVED_ATTRIBS 0x8C8C #define GL_SEPARATE_ATTRIBS 0x8C8D #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F #define GL_RGBA32UI 0x8D70 #define GL_RGB32UI 0x8D71 #define GL_RGBA16UI 0x8D76 #define GL_RGB16UI 0x8D77 #define GL_RGBA8UI 0x8D7C #define GL_RGB8UI 0x8D7D #define GL_RGBA32I 0x8D82 #define GL_RGB32I 0x8D83 #define GL_RGBA16I 0x8D88 #define GL_RGB16I 0x8D89 #define GL_RGBA8I 0x8D8E #define GL_RGB8I 0x8D8F #define GL_RED_INTEGER 0x8D94 #define GL_GREEN_INTEGER 0x8D95 #define GL_BLUE_INTEGER 0x8D96 #define GL_ALPHA_INTEGER 0x8D97 #define GL_RGB_INTEGER 0x8D98 #define GL_RGBA_INTEGER 0x8D99 #define GL_BGR_INTEGER 0x8D9A #define GL_BGRA_INTEGER 0x8D9B #define GL_SAMPLER_1D_ARRAY 0x8DC0 #define GL_SAMPLER_2D_ARRAY 0x8DC1 #define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5 #define GL_UNSIGNED_INT_VEC2 0x8DC6 #define GL_UNSIGNED_INT_VEC3 0x8DC7 #define GL_UNSIGNED_INT_VEC4 0x8DC8 #define GL_INT_SAMPLER_1D 0x8DC9 #define GL_INT_SAMPLER_2D 0x8DCA #define GL_INT_SAMPLER_3D 0x8DCB #define GL_INT_SAMPLER_CUBE 0x8DCC #define GL_INT_SAMPLER_1D_ARRAY 0x8DCE #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF #define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 #define GL_QUERY_WAIT 0x8E13 #define GL_QUERY_NO_WAIT 0x8E14 #define GL_QUERY_BY_REGION_WAIT 0x8E15 #define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint colorNumber, const GLchar* name); typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawBuffer, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawBuffer, const GLint* value); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawBuffer, const GLuint* value); typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum cap, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum cap, GLuint index); typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum pname, GLuint index, GLboolean* data); typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar* name); typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum cap, GLuint index); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer); #define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) #define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) #define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) #define glClampColor GLEW_GET_FUN(__glewClampColor) #define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) #define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) #define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) #define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) #define glColorMaski GLEW_GET_FUN(__glewColorMaski) #define glDisablei GLEW_GET_FUN(__glewDisablei) #define glEnablei GLEW_GET_FUN(__glewEnablei) #define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) #define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) #define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) #define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) #define glGetStringi GLEW_GET_FUN(__glewGetStringi) #define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) #define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) #define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) #define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) #define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) #define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) #define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) #define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) #define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) #define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) #define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) #define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) #define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) #define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) #define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) #define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) #define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) #define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) #define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) #define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) #define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) #define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) #define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) #define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) #define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) #define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) #define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) #define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) #define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) #define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) #define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) #define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) #define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) #define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) #define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) #define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) #define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) #define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) #define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) #define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) #endif /* GL_VERSION_3_0 */ /* ----------------------------- GL_VERSION_3_1 ---------------------------- */ #ifndef GL_VERSION_3_1 #define GL_VERSION_3_1 1 #define GL_TEXTURE_RECTANGLE 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 #define GL_SAMPLER_2D_RECT 0x8B63 #define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 #define GL_TEXTURE_BUFFER 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B #define GL_TEXTURE_BINDING_BUFFER 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D #define GL_TEXTURE_BUFFER_FORMAT 0x8C2E #define GL_SAMPLER_BUFFER 0x8DC2 #define GL_INT_SAMPLER_2D_RECT 0x8DCD #define GL_INT_SAMPLER_BUFFER 0x8DD0 #define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 #define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 #define GL_RED_SNORM 0x8F90 #define GL_RG_SNORM 0x8F91 #define GL_RGB_SNORM 0x8F92 #define GL_RGBA_SNORM 0x8F93 #define GL_R8_SNORM 0x8F94 #define GL_RG8_SNORM 0x8F95 #define GL_RGB8_SNORM 0x8F96 #define GL_RGBA8_SNORM 0x8F97 #define GL_R16_SNORM 0x8F98 #define GL_RG16_SNORM 0x8F99 #define GL_RGB16_SNORM 0x8F9A #define GL_RGBA16_SNORM 0x8F9B #define GL_SIGNED_NORMALIZED 0x8F9C #define GL_PRIMITIVE_RESTART 0x8F9D #define GL_PRIMITIVE_RESTART_INDEX 0x8F9E #define GL_BUFFER_ACCESS_FLAGS 0x911F #define GL_BUFFER_MAP_LENGTH 0x9120 #define GL_BUFFER_MAP_OFFSET 0x9121 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalFormat, GLuint buffer); #define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) #define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) #define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) #define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) #define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) #endif /* GL_VERSION_3_1 */ /* ----------------------------- GL_VERSION_3_2 ---------------------------- */ #ifndef GL_VERSION_3_2 #define GL_VERSION_3_2 1 #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 #define GL_LINES_ADJACENCY 0x000A #define GL_LINE_STRIP_ADJACENCY 0x000B #define GL_TRIANGLES_ADJACENCY 0x000C #define GL_TRIANGLE_STRIP_ADJACENCY 0x000D #define GL_PROGRAM_POINT_SIZE 0x8642 #define GL_GEOMETRY_VERTICES_OUT 0x8916 #define GL_GEOMETRY_INPUT_TYPE 0x8917 #define GL_GEOMETRY_OUTPUT_TYPE 0x8918 #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 #define GL_GEOMETRY_SHADER 0x8DD9 #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF #define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 #define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 #define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 #define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 #define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 #define GL_CONTEXT_PROFILE_MASK 0x9126 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum value, GLint64 * data); typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum pname, GLuint index, GLint64 * data); #define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) #define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) #define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) #define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) #endif /* GL_VERSION_3_2 */ /* ----------------------------- GL_VERSION_3_3 ---------------------------- */ #ifndef GL_VERSION_3_3 #define GL_VERSION_3_3 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE #define GL_RGB10_A2UI 0x906F typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); #define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) #define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) #endif /* GL_VERSION_3_3 */ /* ----------------------------- GL_VERSION_4_0 ---------------------------- */ #ifndef GL_VERSION_4_0 #define GL_VERSION_4_0 1 #define GL_SAMPLE_SHADING 0x8C36 #define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 #define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F #define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F #define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 #define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A #define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B #define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D #define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); #define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) #define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) #define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) #define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) #define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) #define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) #endif /* GL_VERSION_4_0 */ /* ----------------------------- GL_VERSION_4_1 ---------------------------- */ #ifndef GL_VERSION_4_1 #define GL_VERSION_4_1 1 #define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) #endif /* GL_VERSION_4_1 */ /* ----------------------------- GL_VERSION_4_2 ---------------------------- */ #ifndef GL_VERSION_4_2 #define GL_VERSION_4_2 1 #define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 #define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 #define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F #define GL_COPY_READ_BUFFER_BINDING 0x8F36 #define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 #define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) #endif /* GL_VERSION_4_2 */ /* ----------------------------- GL_VERSION_4_3 ---------------------------- */ #ifndef GL_VERSION_4_3 #define GL_VERSION_4_3 1 #define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 #define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E #define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) #endif /* GL_VERSION_4_3 */ /* ----------------------------- GL_VERSION_4_4 ---------------------------- */ #ifndef GL_VERSION_4_4 #define GL_VERSION_4_4 1 #define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 #define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 #define GL_TEXTURE_BUFFER_BINDING 0x8C2A #define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) #endif /* GL_VERSION_4_4 */ /* ----------------------------- GL_VERSION_4_5 ---------------------------- */ #ifndef GL_VERSION_4_5 #define GL_VERSION_4_5 1 #define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSPROC) (void); typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels); typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEPROC) (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); #define glGetGraphicsResetStatus GLEW_GET_FUN(__glewGetGraphicsResetStatus) #define glGetnCompressedTexImage GLEW_GET_FUN(__glewGetnCompressedTexImage) #define glGetnTexImage GLEW_GET_FUN(__glewGetnTexImage) #define glGetnUniformdv GLEW_GET_FUN(__glewGetnUniformdv) #define GLEW_VERSION_4_5 GLEW_GET_VAR(__GLEW_VERSION_4_5) #endif /* GL_VERSION_4_5 */ /* -------------------------- GL_3DFX_multisample -------------------------- */ #ifndef GL_3DFX_multisample #define GL_3DFX_multisample 1 #define GL_MULTISAMPLE_3DFX 0x86B2 #define GL_SAMPLE_BUFFERS_3DFX 0x86B3 #define GL_SAMPLES_3DFX 0x86B4 #define GL_MULTISAMPLE_BIT_3DFX 0x20000000 #define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) #endif /* GL_3DFX_multisample */ /* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ #ifndef GL_3DFX_tbuffer #define GL_3DFX_tbuffer 1 typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) #define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) #endif /* GL_3DFX_tbuffer */ /* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ #ifndef GL_3DFX_texture_compression_FXT1 #define GL_3DFX_texture_compression_FXT1 1 #define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 #define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 #define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) #endif /* GL_3DFX_texture_compression_FXT1 */ /* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ #ifndef GL_AMD_blend_minmax_factor #define GL_AMD_blend_minmax_factor 1 #define GL_FACTOR_MIN_AMD 0x901C #define GL_FACTOR_MAX_AMD 0x901D #define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) #endif /* GL_AMD_blend_minmax_factor */ /* ----------------------- GL_AMD_conservative_depth ----------------------- */ #ifndef GL_AMD_conservative_depth #define GL_AMD_conservative_depth 1 #define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) #endif /* GL_AMD_conservative_depth */ /* -------------------------- GL_AMD_debug_output -------------------------- */ #ifndef GL_AMD_debug_output #define GL_AMD_debug_output 1 #define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 #define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 #define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 #define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 #define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 #define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 #define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A #define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B #define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C #define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D #define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E #define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F #define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 typedef void (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); #define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) #define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) #define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) #define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) #define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) #endif /* GL_AMD_debug_output */ /* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ #ifndef GL_AMD_depth_clamp_separate #define GL_AMD_depth_clamp_separate 1 #define GL_DEPTH_CLAMP_NEAR_AMD 0x901E #define GL_DEPTH_CLAMP_FAR_AMD 0x901F #define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) #endif /* GL_AMD_depth_clamp_separate */ /* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ #ifndef GL_AMD_draw_buffers_blend #define GL_AMD_draw_buffers_blend 1 typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); #define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) #define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) #define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) #define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) #define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) #endif /* GL_AMD_draw_buffers_blend */ /* --------------------------- GL_AMD_gcn_shader --------------------------- */ #ifndef GL_AMD_gcn_shader #define GL_AMD_gcn_shader 1 #define GLEW_AMD_gcn_shader GLEW_GET_VAR(__GLEW_AMD_gcn_shader) #endif /* GL_AMD_gcn_shader */ /* ------------------------ GL_AMD_gpu_shader_int64 ------------------------ */ #ifndef GL_AMD_gpu_shader_int64 #define GL_AMD_gpu_shader_int64 1 #define GLEW_AMD_gpu_shader_int64 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int64) #endif /* GL_AMD_gpu_shader_int64 */ /* ---------------------- GL_AMD_interleaved_elements ---------------------- */ #ifndef GL_AMD_interleaved_elements #define GL_AMD_interleaved_elements 1 #define GL_RED 0x1903 #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_ALPHA 0x1906 #define GL_RG8UI 0x8238 #define GL_RG16UI 0x823A #define GL_RGBA8UI 0x8D7C #define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 #define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); #define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) #define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) #endif /* GL_AMD_interleaved_elements */ /* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ #ifndef GL_AMD_multi_draw_indirect #define GL_AMD_multi_draw_indirect 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); #define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) #define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) #define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) #endif /* GL_AMD_multi_draw_indirect */ /* ------------------------- GL_AMD_name_gen_delete ------------------------ */ #ifndef GL_AMD_name_gen_delete #define GL_AMD_name_gen_delete 1 #define GL_DATA_BUFFER_AMD 0x9151 #define GL_PERFORMANCE_MONITOR_AMD 0x9152 #define GL_QUERY_OBJECT_AMD 0x9153 #define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 #define GL_SAMPLER_OBJECT_AMD 0x9155 typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); #define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) #define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) #define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) #define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) #endif /* GL_AMD_name_gen_delete */ /* ---------------------- GL_AMD_occlusion_query_event --------------------- */ #ifndef GL_AMD_occlusion_query_event #define GL_AMD_occlusion_query_event 1 #define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 #define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 #define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 #define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 #define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F #define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); #define glQueryObjectParameteruiAMD GLEW_GET_FUN(__glewQueryObjectParameteruiAMD) #define GLEW_AMD_occlusion_query_event GLEW_GET_VAR(__GLEW_AMD_occlusion_query_event) #endif /* GL_AMD_occlusion_query_event */ /* ----------------------- GL_AMD_performance_monitor ---------------------- */ #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #define GL_COUNTER_TYPE_AMD 0x8BC0 #define GL_COUNTER_RANGE_AMD 0x8BC1 #define GL_UNSIGNED_INT64_AMD 0x8BC2 #define GL_PERCENTAGE_AMD 0x8BC3 #define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 #define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 #define GL_PERFMON_RESULT_AMD 0x8BC6 typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); #define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) #define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) #define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) #define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) #define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) #define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) #define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) #define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) #define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) #define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) #define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) #define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) #endif /* GL_AMD_performance_monitor */ /* -------------------------- GL_AMD_pinned_memory ------------------------- */ #ifndef GL_AMD_pinned_memory #define GL_AMD_pinned_memory 1 #define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 #define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) #endif /* GL_AMD_pinned_memory */ /* ----------------------- GL_AMD_query_buffer_object ---------------------- */ #ifndef GL_AMD_query_buffer_object #define GL_AMD_query_buffer_object 1 #define GL_QUERY_BUFFER_AMD 0x9192 #define GL_QUERY_BUFFER_BINDING_AMD 0x9193 #define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 #define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) #endif /* GL_AMD_query_buffer_object */ /* ------------------------ GL_AMD_sample_positions ------------------------ */ #ifndef GL_AMD_sample_positions #define GL_AMD_sample_positions 1 #define GL_SUBSAMPLE_DISTANCE_AMD 0x883F typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); #define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) #define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) #endif /* GL_AMD_sample_positions */ /* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ #ifndef GL_AMD_seamless_cubemap_per_texture #define GL_AMD_seamless_cubemap_per_texture 1 #define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F #define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) #endif /* GL_AMD_seamless_cubemap_per_texture */ /* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */ #ifndef GL_AMD_shader_atomic_counter_ops #define GL_AMD_shader_atomic_counter_ops 1 #define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops) #endif /* GL_AMD_shader_atomic_counter_ops */ /* ---------------------- GL_AMD_shader_stencil_export --------------------- */ #ifndef GL_AMD_shader_stencil_export #define GL_AMD_shader_stencil_export 1 #define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) #endif /* GL_AMD_shader_stencil_export */ /* ------------------- GL_AMD_shader_stencil_value_export ------------------ */ #ifndef GL_AMD_shader_stencil_value_export #define GL_AMD_shader_stencil_value_export 1 #define GLEW_AMD_shader_stencil_value_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_value_export) #endif /* GL_AMD_shader_stencil_value_export */ /* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ #ifndef GL_AMD_shader_trinary_minmax #define GL_AMD_shader_trinary_minmax 1 #define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) #endif /* GL_AMD_shader_trinary_minmax */ /* ------------------------- GL_AMD_sparse_texture ------------------------- */ #ifndef GL_AMD_sparse_texture #define GL_AMD_sparse_texture 1 #define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 #define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 #define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 #define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 #define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 #define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 #define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A #define GL_MIN_SPARSE_LEVEL_AMD 0x919B #define GL_MIN_LOD_WARNING_AMD 0x919C typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); #define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) #define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) #define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) #endif /* GL_AMD_sparse_texture */ /* ------------------- GL_AMD_stencil_operation_extended ------------------- */ #ifndef GL_AMD_stencil_operation_extended #define GL_AMD_stencil_operation_extended 1 #define GL_SET_AMD 0x874A #define GL_REPLACE_VALUE_AMD 0x874B #define GL_STENCIL_OP_VALUE_AMD 0x874C #define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); #define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) #define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) #endif /* GL_AMD_stencil_operation_extended */ /* ------------------------ GL_AMD_texture_texture4 ------------------------ */ #ifndef GL_AMD_texture_texture4 #define GL_AMD_texture_texture4 1 #define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) #endif /* GL_AMD_texture_texture4 */ /* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ #ifndef GL_AMD_transform_feedback3_lines_triangles #define GL_AMD_transform_feedback3_lines_triangles 1 #define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) #endif /* GL_AMD_transform_feedback3_lines_triangles */ /* ----------------------- GL_AMD_transform_feedback4 ---------------------- */ #ifndef GL_AMD_transform_feedback4 #define GL_AMD_transform_feedback4 1 #define GL_STREAM_RASTERIZATION_AMD 0x91A0 #define GLEW_AMD_transform_feedback4 GLEW_GET_VAR(__GLEW_AMD_transform_feedback4) #endif /* GL_AMD_transform_feedback4 */ /* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ #ifndef GL_AMD_vertex_shader_layer #define GL_AMD_vertex_shader_layer 1 #define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) #endif /* GL_AMD_vertex_shader_layer */ /* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ #ifndef GL_AMD_vertex_shader_tessellator #define GL_AMD_vertex_shader_tessellator 1 #define GL_SAMPLER_BUFFER_AMD 0x9001 #define GL_INT_SAMPLER_BUFFER_AMD 0x9002 #define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 #define GL_TESSELLATION_MODE_AMD 0x9004 #define GL_TESSELLATION_FACTOR_AMD 0x9005 #define GL_DISCRETE_AMD 0x9006 #define GL_CONTINUOUS_AMD 0x9007 typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); #define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) #define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) #define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) #endif /* GL_AMD_vertex_shader_tessellator */ /* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ #ifndef GL_AMD_vertex_shader_viewport_index #define GL_AMD_vertex_shader_viewport_index 1 #define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) #endif /* GL_AMD_vertex_shader_viewport_index */ /* ------------------------- GL_ANGLE_depth_texture ------------------------ */ #ifndef GL_ANGLE_depth_texture #define GL_ANGLE_depth_texture 1 #define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) #endif /* GL_ANGLE_depth_texture */ /* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ #ifndef GL_ANGLE_framebuffer_blit #define GL_ANGLE_framebuffer_blit 1 #define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 #define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 #define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) #define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) #endif /* GL_ANGLE_framebuffer_blit */ /* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ #ifndef GL_ANGLE_framebuffer_multisample #define GL_ANGLE_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 #define GL_MAX_SAMPLES_ANGLE 0x8D57 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) #define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) #endif /* GL_ANGLE_framebuffer_multisample */ /* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ #ifndef GL_ANGLE_instanced_arrays #define GL_ANGLE_instanced_arrays 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); #define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) #define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) #define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) #define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) #endif /* GL_ANGLE_instanced_arrays */ /* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ #ifndef GL_ANGLE_pack_reverse_row_order #define GL_ANGLE_pack_reverse_row_order 1 #define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 #define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) #endif /* GL_ANGLE_pack_reverse_row_order */ /* ------------------------ GL_ANGLE_program_binary ------------------------ */ #ifndef GL_ANGLE_program_binary #define GL_ANGLE_program_binary 1 #define GL_PROGRAM_BINARY_ANGLE 0x93A6 #define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) #endif /* GL_ANGLE_program_binary */ /* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ #ifndef GL_ANGLE_texture_compression_dxt1 #define GL_ANGLE_texture_compression_dxt1 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 #define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) #endif /* GL_ANGLE_texture_compression_dxt1 */ /* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ #ifndef GL_ANGLE_texture_compression_dxt3 #define GL_ANGLE_texture_compression_dxt3 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 #define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) #endif /* GL_ANGLE_texture_compression_dxt3 */ /* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ #ifndef GL_ANGLE_texture_compression_dxt5 #define GL_ANGLE_texture_compression_dxt5 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 #define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) #endif /* GL_ANGLE_texture_compression_dxt5 */ /* ------------------------- GL_ANGLE_texture_usage ------------------------ */ #ifndef GL_ANGLE_texture_usage #define GL_ANGLE_texture_usage 1 #define GL_TEXTURE_USAGE_ANGLE 0x93A2 #define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 #define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) #endif /* GL_ANGLE_texture_usage */ /* -------------------------- GL_ANGLE_timer_query ------------------------- */ #ifndef GL_ANGLE_timer_query #define GL_ANGLE_timer_query 1 #define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 #define GL_CURRENT_QUERY_ANGLE 0x8865 #define GL_QUERY_RESULT_ANGLE 0x8866 #define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 #define GL_TIME_ELAPSED_ANGLE 0x88BF #define GL_TIMESTAMP_ANGLE 0x8E28 typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); #define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) #define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) #define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) #define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) #define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) #define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) #define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) #define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) #define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) #define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) #define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) #define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) #endif /* GL_ANGLE_timer_query */ /* ------------------- GL_ANGLE_translated_shader_source ------------------- */ #ifndef GL_ANGLE_translated_shader_source #define GL_ANGLE_translated_shader_source 1 #define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); #define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) #define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) #endif /* GL_ANGLE_translated_shader_source */ /* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ #ifndef GL_APPLE_aux_depth_stencil #define GL_APPLE_aux_depth_stencil 1 #define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 #define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) #endif /* GL_APPLE_aux_depth_stencil */ /* ------------------------ GL_APPLE_client_storage ------------------------ */ #ifndef GL_APPLE_client_storage #define GL_APPLE_client_storage 1 #define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 #define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) #endif /* GL_APPLE_client_storage */ /* ------------------------- GL_APPLE_element_array ------------------------ */ #ifndef GL_APPLE_element_array #define GL_APPLE_element_array 1 #define GL_ELEMENT_ARRAY_APPLE 0x8A0C #define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D #define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); #define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) #define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) #define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) #define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) #define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) #define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) #endif /* GL_APPLE_element_array */ /* ----------------------------- GL_APPLE_fence ---------------------------- */ #ifndef GL_APPLE_fence #define GL_APPLE_fence 1 #define GL_DRAW_PIXELS_APPLE 0x8A0A #define GL_FENCE_APPLE 0x8A0B typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); #define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) #define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) #define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) #define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) #define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) #define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) #define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) #define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) #define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) #endif /* GL_APPLE_fence */ /* ------------------------- GL_APPLE_float_pixels ------------------------- */ #ifndef GL_APPLE_float_pixels #define GL_APPLE_float_pixels 1 #define GL_HALF_APPLE 0x140B #define GL_RGBA_FLOAT32_APPLE 0x8814 #define GL_RGB_FLOAT32_APPLE 0x8815 #define GL_ALPHA_FLOAT32_APPLE 0x8816 #define GL_INTENSITY_FLOAT32_APPLE 0x8817 #define GL_LUMINANCE_FLOAT32_APPLE 0x8818 #define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 #define GL_RGBA_FLOAT16_APPLE 0x881A #define GL_RGB_FLOAT16_APPLE 0x881B #define GL_ALPHA_FLOAT16_APPLE 0x881C #define GL_INTENSITY_FLOAT16_APPLE 0x881D #define GL_LUMINANCE_FLOAT16_APPLE 0x881E #define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F #define GL_COLOR_FLOAT_APPLE 0x8A0F #define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) #endif /* GL_APPLE_float_pixels */ /* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ #ifndef GL_APPLE_flush_buffer_range #define GL_APPLE_flush_buffer_range 1 #define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 #define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); #define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) #define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) #define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) #endif /* GL_APPLE_flush_buffer_range */ /* ----------------------- GL_APPLE_object_purgeable ----------------------- */ #ifndef GL_APPLE_object_purgeable #define GL_APPLE_object_purgeable 1 #define GL_BUFFER_OBJECT_APPLE 0x85B3 #define GL_RELEASED_APPLE 0x8A19 #define GL_VOLATILE_APPLE 0x8A1A #define GL_RETAINED_APPLE 0x8A1B #define GL_UNDEFINED_APPLE 0x8A1C #define GL_PURGEABLE_APPLE 0x8A1D typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); #define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) #define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) #define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) #define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) #endif /* GL_APPLE_object_purgeable */ /* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ #ifndef GL_APPLE_pixel_buffer #define GL_APPLE_pixel_buffer 1 #define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 #define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) #endif /* GL_APPLE_pixel_buffer */ /* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ #ifndef GL_APPLE_rgb_422 #define GL_APPLE_rgb_422 1 #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB #define GL_RGB_422_APPLE 0x8A1F #define GL_RGB_RAW_422_APPLE 0x8A51 #define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) #endif /* GL_APPLE_rgb_422 */ /* --------------------------- GL_APPLE_row_bytes -------------------------- */ #ifndef GL_APPLE_row_bytes #define GL_APPLE_row_bytes 1 #define GL_PACK_ROW_BYTES_APPLE 0x8A15 #define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 #define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) #endif /* GL_APPLE_row_bytes */ /* ------------------------ GL_APPLE_specular_vector ----------------------- */ #ifndef GL_APPLE_specular_vector #define GL_APPLE_specular_vector 1 #define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 #define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) #endif /* GL_APPLE_specular_vector */ /* ------------------------- GL_APPLE_texture_range ------------------------ */ #ifndef GL_APPLE_texture_range #define GL_APPLE_texture_range 1 #define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 #define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 #define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC #define GL_STORAGE_PRIVATE_APPLE 0x85BD #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, void *pointer); #define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) #define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) #define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) #endif /* GL_APPLE_texture_range */ /* ------------------------ GL_APPLE_transform_hint ------------------------ */ #ifndef GL_APPLE_transform_hint #define GL_APPLE_transform_hint 1 #define GL_TRANSFORM_HINT_APPLE 0x85B1 #define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) #endif /* GL_APPLE_transform_hint */ /* ---------------------- GL_APPLE_vertex_array_object --------------------- */ #ifndef GL_APPLE_vertex_array_object #define GL_APPLE_vertex_array_object 1 #define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) #define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) #define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) #define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) #define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) #endif /* GL_APPLE_vertex_array_object */ /* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ #ifndef GL_APPLE_vertex_array_range #define GL_APPLE_vertex_array_range 1 #define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D #define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E #define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 #define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 #define GL_STORAGE_CLIENT_APPLE 0x85B4 #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); #define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) #define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) #define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) #define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) #endif /* GL_APPLE_vertex_array_range */ /* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ #ifndef GL_APPLE_vertex_program_evaluators #define GL_APPLE_vertex_program_evaluators 1 #define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 #define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 #define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 #define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 #define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 #define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 #define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 #define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 #define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 #define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); #define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) #define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) #define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) #define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) #define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) #define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) #define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) #define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) #endif /* GL_APPLE_vertex_program_evaluators */ /* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ #ifndef GL_APPLE_ycbcr_422 #define GL_APPLE_ycbcr_422 1 #define GL_YCBCR_422_APPLE 0x85B9 #define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) #endif /* GL_APPLE_ycbcr_422 */ /* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ #ifndef GL_ARB_ES2_compatibility #define GL_ARB_ES2_compatibility 1 #define GL_FIXED 0x140C #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B #define GL_RGB565 0x8D62 #define GL_LOW_FLOAT 0x8DF0 #define GL_MEDIUM_FLOAT 0x8DF1 #define GL_HIGH_FLOAT 0x8DF2 #define GL_LOW_INT 0x8DF3 #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 #define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 #define GL_SHADER_COMPILER 0x8DFA #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB #define GL_MAX_VARYING_VECTORS 0x8DFC #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD typedef int GLfixed; typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const void*binary, GLsizei length); #define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) #define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) #define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) #define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) #define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) #define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) #endif /* GL_ARB_ES2_compatibility */ /* ----------------------- GL_ARB_ES3_1_compatibility ---------------------- */ #ifndef GL_ARB_ES3_1_compatibility #define GL_ARB_ES3_1_compatibility 1 typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); #define glMemoryBarrierByRegion GLEW_GET_FUN(__glewMemoryBarrierByRegion) #define GLEW_ARB_ES3_1_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_1_compatibility) #endif /* GL_ARB_ES3_1_compatibility */ /* ----------------------- GL_ARB_ES3_2_compatibility ---------------------- */ #ifndef GL_ARB_ES3_2_compatibility #define GL_ARB_ES3_2_compatibility 1 #define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE #define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 #define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 typedef void (GLAPIENTRY * PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); #define glPrimitiveBoundingBoxARB GLEW_GET_FUN(__glewPrimitiveBoundingBoxARB) #define GLEW_ARB_ES3_2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_2_compatibility) #endif /* GL_ARB_ES3_2_compatibility */ /* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ #ifndef GL_ARB_ES3_compatibility #define GL_ARB_ES3_compatibility 1 #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF #define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A #define GL_MAX_ELEMENT_INDEX 0x8D6B #define GL_COMPRESSED_R11_EAC 0x9270 #define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 #define GL_COMPRESSED_RG11_EAC 0x9272 #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 #define GL_COMPRESSED_RGB8_ETC2 0x9274 #define GL_COMPRESSED_SRGB8_ETC2 0x9275 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 #define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) #endif /* GL_ARB_ES3_compatibility */ /* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ #ifndef GL_ARB_arrays_of_arrays #define GL_ARB_arrays_of_arrays 1 #define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) #endif /* GL_ARB_arrays_of_arrays */ /* -------------------------- GL_ARB_base_instance ------------------------- */ #ifndef GL_ARB_base_instance #define GL_ARB_base_instance 1 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); #define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) #define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) #define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) #define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) #endif /* GL_ARB_base_instance */ /* ------------------------ GL_ARB_bindless_texture ------------------------ */ #ifndef GL_ARB_bindless_texture #define GL_ARB_bindless_texture 1 #define GL_UNSIGNED_INT64_ARB 0x140F typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); #define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) #define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) #define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) #define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) #define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) #define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) #define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) #define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) #define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) #define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) #define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) #define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) #define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) #define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) #define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) #define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) #define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) #endif /* GL_ARB_bindless_texture */ /* ----------------------- GL_ARB_blend_func_extended ---------------------- */ #ifndef GL_ARB_blend_func_extended #define GL_ARB_blend_func_extended 1 #define GL_SRC1_COLOR 0x88F9 #define GL_ONE_MINUS_SRC1_COLOR 0x88FA #define GL_ONE_MINUS_SRC1_ALPHA 0x88FB #define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); #define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) #define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) #define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) #endif /* GL_ARB_blend_func_extended */ /* ------------------------- GL_ARB_buffer_storage ------------------------- */ #ifndef GL_ARB_buffer_storage #define GL_ARB_buffer_storage 1 #define GL_MAP_READ_BIT 0x0001 #define GL_MAP_WRITE_BIT 0x0002 #define GL_MAP_PERSISTENT_BIT 0x00000040 #define GL_MAP_COHERENT_BIT 0x00000080 #define GL_DYNAMIC_STORAGE_BIT 0x0100 #define GL_CLIENT_STORAGE_BIT 0x0200 #define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 #define GL_BUFFER_IMMUTABLE_STORAGE 0x821F #define GL_BUFFER_STORAGE_FLAGS 0x8220 typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); #define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) #define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) #define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) #endif /* GL_ARB_buffer_storage */ /* ---------------------------- GL_ARB_cl_event ---------------------------- */ #ifndef GL_ARB_cl_event #define GL_ARB_cl_event 1 #define GL_SYNC_CL_EVENT_ARB 0x8240 #define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 typedef struct _cl_context *cl_context; typedef struct _cl_event *cl_event; typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); #define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) #define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) #endif /* GL_ARB_cl_event */ /* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ #ifndef GL_ARB_clear_buffer_object #define GL_ARB_clear_buffer_object 1 typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); #define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) #define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) #define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) #define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) #define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) #endif /* GL_ARB_clear_buffer_object */ /* -------------------------- GL_ARB_clear_texture ------------------------- */ #ifndef GL_ARB_clear_texture #define GL_ARB_clear_texture 1 #define GL_CLEAR_TEXTURE 0x9365 typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); #define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) #define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) #define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) #endif /* GL_ARB_clear_texture */ /* -------------------------- GL_ARB_clip_control -------------------------- */ #ifndef GL_ARB_clip_control #define GL_ARB_clip_control 1 #define GL_LOWER_LEFT 0x8CA1 #define GL_UPPER_LEFT 0x8CA2 #define GL_CLIP_ORIGIN 0x935C #define GL_CLIP_DEPTH_MODE 0x935D #define GL_NEGATIVE_ONE_TO_ONE 0x935E #define GL_ZERO_TO_ONE 0x935F typedef void (GLAPIENTRY * PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); #define glClipControl GLEW_GET_FUN(__glewClipControl) #define GLEW_ARB_clip_control GLEW_GET_VAR(__GLEW_ARB_clip_control) #endif /* GL_ARB_clip_control */ /* ----------------------- GL_ARB_color_buffer_float ----------------------- */ #ifndef GL_ARB_color_buffer_float #define GL_ARB_color_buffer_float 1 #define GL_RGBA_FLOAT_MODE_ARB 0x8820 #define GL_CLAMP_VERTEX_COLOR_ARB 0x891A #define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B #define GL_CLAMP_READ_COLOR_ARB 0x891C #define GL_FIXED_ONLY_ARB 0x891D typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); #define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) #define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) #endif /* GL_ARB_color_buffer_float */ /* -------------------------- GL_ARB_compatibility ------------------------- */ #ifndef GL_ARB_compatibility #define GL_ARB_compatibility 1 #define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) #endif /* GL_ARB_compatibility */ /* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ #ifndef GL_ARB_compressed_texture_pixel_storage #define GL_ARB_compressed_texture_pixel_storage 1 #define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 #define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 #define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 #define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A #define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B #define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C #define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D #define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E #define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) #endif /* GL_ARB_compressed_texture_pixel_storage */ /* ------------------------- GL_ARB_compute_shader ------------------------- */ #ifndef GL_ARB_compute_shader #define GL_ARB_compute_shader 1 #define GL_COMPUTE_SHADER_BIT 0x00000020 #define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 #define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 #define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 #define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 #define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 #define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 #define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB #define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED #define GL_DISPATCH_INDIRECT_BUFFER 0x90EE #define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF #define GL_COMPUTE_SHADER 0x91B9 #define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB #define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC #define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD #define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE #define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); #define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) #define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) #define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) #endif /* GL_ARB_compute_shader */ /* ------------------- GL_ARB_compute_variable_group_size ------------------ */ #ifndef GL_ARB_compute_variable_group_size #define GL_ARB_compute_variable_group_size 1 #define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB #define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF #define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 #define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); #define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) #define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) #endif /* GL_ARB_compute_variable_group_size */ /* ------------------- GL_ARB_conditional_render_inverted ------------------ */ #ifndef GL_ARB_conditional_render_inverted #define GL_ARB_conditional_render_inverted 1 #define GL_QUERY_WAIT_INVERTED 0x8E17 #define GL_QUERY_NO_WAIT_INVERTED 0x8E18 #define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 #define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A #define GLEW_ARB_conditional_render_inverted GLEW_GET_VAR(__GLEW_ARB_conditional_render_inverted) #endif /* GL_ARB_conditional_render_inverted */ /* ----------------------- GL_ARB_conservative_depth ----------------------- */ #ifndef GL_ARB_conservative_depth #define GL_ARB_conservative_depth 1 #define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) #endif /* GL_ARB_conservative_depth */ /* --------------------------- GL_ARB_copy_buffer -------------------------- */ #ifndef GL_ARB_copy_buffer #define GL_ARB_copy_buffer 1 #define GL_COPY_READ_BUFFER 0x8F36 #define GL_COPY_WRITE_BUFFER 0x8F37 typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); #define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) #define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) #endif /* GL_ARB_copy_buffer */ /* --------------------------- GL_ARB_copy_image --------------------------- */ #ifndef GL_ARB_copy_image #define GL_ARB_copy_image 1 typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); #define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) #define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) #endif /* GL_ARB_copy_image */ /* -------------------------- GL_ARB_cull_distance ------------------------- */ #ifndef GL_ARB_cull_distance #define GL_ARB_cull_distance 1 #define GL_MAX_CULL_DISTANCES 0x82F9 #define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA #define GLEW_ARB_cull_distance GLEW_GET_VAR(__GLEW_ARB_cull_distance) #endif /* GL_ARB_cull_distance */ /* -------------------------- GL_ARB_debug_output -------------------------- */ #ifndef GL_ARB_debug_output #define GL_ARB_debug_output 1 #define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 #define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 #define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 #define GL_DEBUG_SOURCE_API_ARB 0x8246 #define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 #define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 #define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 #define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A #define GL_DEBUG_SOURCE_OTHER_ARB 0x824B #define GL_DEBUG_TYPE_ERROR_ARB 0x824C #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D #define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E #define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F #define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 #define GL_DEBUG_TYPE_OTHER_ARB 0x8251 #define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 #define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 #define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 #define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 #define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 typedef void (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); #define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) #define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) #define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) #define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) #define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) #endif /* GL_ARB_debug_output */ /* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ #ifndef GL_ARB_depth_buffer_float #define GL_ARB_depth_buffer_float 1 #define GL_DEPTH_COMPONENT32F 0x8CAC #define GL_DEPTH32F_STENCIL8 0x8CAD #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD #define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) #endif /* GL_ARB_depth_buffer_float */ /* --------------------------- GL_ARB_depth_clamp -------------------------- */ #ifndef GL_ARB_depth_clamp #define GL_ARB_depth_clamp 1 #define GL_DEPTH_CLAMP 0x864F #define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) #endif /* GL_ARB_depth_clamp */ /* -------------------------- GL_ARB_depth_texture ------------------------- */ #ifndef GL_ARB_depth_texture #define GL_ARB_depth_texture 1 #define GL_DEPTH_COMPONENT16_ARB 0x81A5 #define GL_DEPTH_COMPONENT24_ARB 0x81A6 #define GL_DEPTH_COMPONENT32_ARB 0x81A7 #define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A #define GL_DEPTH_TEXTURE_MODE_ARB 0x884B #define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) #endif /* GL_ARB_depth_texture */ /* ----------------------- GL_ARB_derivative_control ----------------------- */ #ifndef GL_ARB_derivative_control #define GL_ARB_derivative_control 1 #define GLEW_ARB_derivative_control GLEW_GET_VAR(__GLEW_ARB_derivative_control) #endif /* GL_ARB_derivative_control */ /* ----------------------- GL_ARB_direct_state_access ---------------------- */ #ifndef GL_ARB_direct_state_access #define GL_ARB_direct_state_access 1 #define GL_TEXTURE_TARGET 0x1006 #define GL_QUERY_TARGET 0x82EA typedef void (GLAPIENTRY * PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); typedef void (GLAPIENTRY * PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLfloat depth, GLint stencil); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); typedef void (GLAPIENTRY * PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint* samplers); typedef void (GLAPIENTRY * PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint* textures); typedef void (GLAPIENTRY * PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64* param); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint* param); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat* param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); #define glBindTextureUnit GLEW_GET_FUN(__glewBindTextureUnit) #define glBlitNamedFramebuffer GLEW_GET_FUN(__glewBlitNamedFramebuffer) #define glCheckNamedFramebufferStatus GLEW_GET_FUN(__glewCheckNamedFramebufferStatus) #define glClearNamedBufferData GLEW_GET_FUN(__glewClearNamedBufferData) #define glClearNamedBufferSubData GLEW_GET_FUN(__glewClearNamedBufferSubData) #define glClearNamedFramebufferfi GLEW_GET_FUN(__glewClearNamedFramebufferfi) #define glClearNamedFramebufferfv GLEW_GET_FUN(__glewClearNamedFramebufferfv) #define glClearNamedFramebufferiv GLEW_GET_FUN(__glewClearNamedFramebufferiv) #define glClearNamedFramebufferuiv GLEW_GET_FUN(__glewClearNamedFramebufferuiv) #define glCompressedTextureSubImage1D GLEW_GET_FUN(__glewCompressedTextureSubImage1D) #define glCompressedTextureSubImage2D GLEW_GET_FUN(__glewCompressedTextureSubImage2D) #define glCompressedTextureSubImage3D GLEW_GET_FUN(__glewCompressedTextureSubImage3D) #define glCopyNamedBufferSubData GLEW_GET_FUN(__glewCopyNamedBufferSubData) #define glCopyTextureSubImage1D GLEW_GET_FUN(__glewCopyTextureSubImage1D) #define glCopyTextureSubImage2D GLEW_GET_FUN(__glewCopyTextureSubImage2D) #define glCopyTextureSubImage3D GLEW_GET_FUN(__glewCopyTextureSubImage3D) #define glCreateBuffers GLEW_GET_FUN(__glewCreateBuffers) #define glCreateFramebuffers GLEW_GET_FUN(__glewCreateFramebuffers) #define glCreateProgramPipelines GLEW_GET_FUN(__glewCreateProgramPipelines) #define glCreateQueries GLEW_GET_FUN(__glewCreateQueries) #define glCreateRenderbuffers GLEW_GET_FUN(__glewCreateRenderbuffers) #define glCreateSamplers GLEW_GET_FUN(__glewCreateSamplers) #define glCreateTextures GLEW_GET_FUN(__glewCreateTextures) #define glCreateTransformFeedbacks GLEW_GET_FUN(__glewCreateTransformFeedbacks) #define glCreateVertexArrays GLEW_GET_FUN(__glewCreateVertexArrays) #define glDisableVertexArrayAttrib GLEW_GET_FUN(__glewDisableVertexArrayAttrib) #define glEnableVertexArrayAttrib GLEW_GET_FUN(__glewEnableVertexArrayAttrib) #define glFlushMappedNamedBufferRange GLEW_GET_FUN(__glewFlushMappedNamedBufferRange) #define glGenerateTextureMipmap GLEW_GET_FUN(__glewGenerateTextureMipmap) #define glGetCompressedTextureImage GLEW_GET_FUN(__glewGetCompressedTextureImage) #define glGetNamedBufferParameteri64v GLEW_GET_FUN(__glewGetNamedBufferParameteri64v) #define glGetNamedBufferParameteriv GLEW_GET_FUN(__glewGetNamedBufferParameteriv) #define glGetNamedBufferPointerv GLEW_GET_FUN(__glewGetNamedBufferPointerv) #define glGetNamedBufferSubData GLEW_GET_FUN(__glewGetNamedBufferSubData) #define glGetNamedFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameteriv) #define glGetNamedFramebufferParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferParameteriv) #define glGetNamedRenderbufferParameteriv GLEW_GET_FUN(__glewGetNamedRenderbufferParameteriv) #define glGetQueryBufferObjecti64v GLEW_GET_FUN(__glewGetQueryBufferObjecti64v) #define glGetQueryBufferObjectiv GLEW_GET_FUN(__glewGetQueryBufferObjectiv) #define glGetQueryBufferObjectui64v GLEW_GET_FUN(__glewGetQueryBufferObjectui64v) #define glGetQueryBufferObjectuiv GLEW_GET_FUN(__glewGetQueryBufferObjectuiv) #define glGetTextureImage GLEW_GET_FUN(__glewGetTextureImage) #define glGetTextureLevelParameterfv GLEW_GET_FUN(__glewGetTextureLevelParameterfv) #define glGetTextureLevelParameteriv GLEW_GET_FUN(__glewGetTextureLevelParameteriv) #define glGetTextureParameterIiv GLEW_GET_FUN(__glewGetTextureParameterIiv) #define glGetTextureParameterIuiv GLEW_GET_FUN(__glewGetTextureParameterIuiv) #define glGetTextureParameterfv GLEW_GET_FUN(__glewGetTextureParameterfv) #define glGetTextureParameteriv GLEW_GET_FUN(__glewGetTextureParameteriv) #define glGetTransformFeedbacki64_v GLEW_GET_FUN(__glewGetTransformFeedbacki64_v) #define glGetTransformFeedbacki_v GLEW_GET_FUN(__glewGetTransformFeedbacki_v) #define glGetTransformFeedbackiv GLEW_GET_FUN(__glewGetTransformFeedbackiv) #define glGetVertexArrayIndexed64iv GLEW_GET_FUN(__glewGetVertexArrayIndexed64iv) #define glGetVertexArrayIndexediv GLEW_GET_FUN(__glewGetVertexArrayIndexediv) #define glGetVertexArrayiv GLEW_GET_FUN(__glewGetVertexArrayiv) #define glInvalidateNamedFramebufferData GLEW_GET_FUN(__glewInvalidateNamedFramebufferData) #define glInvalidateNamedFramebufferSubData GLEW_GET_FUN(__glewInvalidateNamedFramebufferSubData) #define glMapNamedBuffer GLEW_GET_FUN(__glewMapNamedBuffer) #define glMapNamedBufferRange GLEW_GET_FUN(__glewMapNamedBufferRange) #define glNamedBufferData GLEW_GET_FUN(__glewNamedBufferData) #define glNamedBufferStorage GLEW_GET_FUN(__glewNamedBufferStorage) #define glNamedBufferSubData GLEW_GET_FUN(__glewNamedBufferSubData) #define glNamedFramebufferDrawBuffer GLEW_GET_FUN(__glewNamedFramebufferDrawBuffer) #define glNamedFramebufferDrawBuffers GLEW_GET_FUN(__glewNamedFramebufferDrawBuffers) #define glNamedFramebufferParameteri GLEW_GET_FUN(__glewNamedFramebufferParameteri) #define glNamedFramebufferReadBuffer GLEW_GET_FUN(__glewNamedFramebufferReadBuffer) #define glNamedFramebufferRenderbuffer GLEW_GET_FUN(__glewNamedFramebufferRenderbuffer) #define glNamedFramebufferTexture GLEW_GET_FUN(__glewNamedFramebufferTexture) #define glNamedFramebufferTextureLayer GLEW_GET_FUN(__glewNamedFramebufferTextureLayer) #define glNamedRenderbufferStorage GLEW_GET_FUN(__glewNamedRenderbufferStorage) #define glNamedRenderbufferStorageMultisample GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisample) #define glTextureBuffer GLEW_GET_FUN(__glewTextureBuffer) #define glTextureBufferRange GLEW_GET_FUN(__glewTextureBufferRange) #define glTextureParameterIiv GLEW_GET_FUN(__glewTextureParameterIiv) #define glTextureParameterIuiv GLEW_GET_FUN(__glewTextureParameterIuiv) #define glTextureParameterf GLEW_GET_FUN(__glewTextureParameterf) #define glTextureParameterfv GLEW_GET_FUN(__glewTextureParameterfv) #define glTextureParameteri GLEW_GET_FUN(__glewTextureParameteri) #define glTextureParameteriv GLEW_GET_FUN(__glewTextureParameteriv) #define glTextureStorage1D GLEW_GET_FUN(__glewTextureStorage1D) #define glTextureStorage2D GLEW_GET_FUN(__glewTextureStorage2D) #define glTextureStorage2DMultisample GLEW_GET_FUN(__glewTextureStorage2DMultisample) #define glTextureStorage3D GLEW_GET_FUN(__glewTextureStorage3D) #define glTextureStorage3DMultisample GLEW_GET_FUN(__glewTextureStorage3DMultisample) #define glTextureSubImage1D GLEW_GET_FUN(__glewTextureSubImage1D) #define glTextureSubImage2D GLEW_GET_FUN(__glewTextureSubImage2D) #define glTextureSubImage3D GLEW_GET_FUN(__glewTextureSubImage3D) #define glTransformFeedbackBufferBase GLEW_GET_FUN(__glewTransformFeedbackBufferBase) #define glTransformFeedbackBufferRange GLEW_GET_FUN(__glewTransformFeedbackBufferRange) #define glUnmapNamedBuffer GLEW_GET_FUN(__glewUnmapNamedBuffer) #define glVertexArrayAttribBinding GLEW_GET_FUN(__glewVertexArrayAttribBinding) #define glVertexArrayAttribFormat GLEW_GET_FUN(__glewVertexArrayAttribFormat) #define glVertexArrayAttribIFormat GLEW_GET_FUN(__glewVertexArrayAttribIFormat) #define glVertexArrayAttribLFormat GLEW_GET_FUN(__glewVertexArrayAttribLFormat) #define glVertexArrayBindingDivisor GLEW_GET_FUN(__glewVertexArrayBindingDivisor) #define glVertexArrayElementBuffer GLEW_GET_FUN(__glewVertexArrayElementBuffer) #define glVertexArrayVertexBuffer GLEW_GET_FUN(__glewVertexArrayVertexBuffer) #define glVertexArrayVertexBuffers GLEW_GET_FUN(__glewVertexArrayVertexBuffers) #define GLEW_ARB_direct_state_access GLEW_GET_VAR(__GLEW_ARB_direct_state_access) #endif /* GL_ARB_direct_state_access */ /* -------------------------- GL_ARB_draw_buffers -------------------------- */ #ifndef GL_ARB_draw_buffers #define GL_ARB_draw_buffers 1 #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 #define GL_DRAW_BUFFER0_ARB 0x8825 #define GL_DRAW_BUFFER1_ARB 0x8826 #define GL_DRAW_BUFFER2_ARB 0x8827 #define GL_DRAW_BUFFER3_ARB 0x8828 #define GL_DRAW_BUFFER4_ARB 0x8829 #define GL_DRAW_BUFFER5_ARB 0x882A #define GL_DRAW_BUFFER6_ARB 0x882B #define GL_DRAW_BUFFER7_ARB 0x882C #define GL_DRAW_BUFFER8_ARB 0x882D #define GL_DRAW_BUFFER9_ARB 0x882E #define GL_DRAW_BUFFER10_ARB 0x882F #define GL_DRAW_BUFFER11_ARB 0x8830 #define GL_DRAW_BUFFER12_ARB 0x8831 #define GL_DRAW_BUFFER13_ARB 0x8832 #define GL_DRAW_BUFFER14_ARB 0x8833 #define GL_DRAW_BUFFER15_ARB 0x8834 typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); #define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) #define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) #endif /* GL_ARB_draw_buffers */ /* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ #ifndef GL_ARB_draw_buffers_blend #define GL_ARB_draw_buffers_blend 1 typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); #define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) #define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) #define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) #define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) #define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) #endif /* GL_ARB_draw_buffers_blend */ /* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ #ifndef GL_ARB_draw_elements_base_vertex #define GL_ARB_draw_elements_base_vertex 1 typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex); #define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) #define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) #define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) #define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) #define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) #endif /* GL_ARB_draw_elements_base_vertex */ /* -------------------------- GL_ARB_draw_indirect ------------------------- */ #ifndef GL_ARB_draw_indirect #define GL_ARB_draw_indirect 1 #define GL_DRAW_INDIRECT_BUFFER 0x8F3F #define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); #define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) #define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) #define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) #endif /* GL_ARB_draw_indirect */ /* ------------------------- GL_ARB_draw_instanced ------------------------- */ #ifndef GL_ARB_draw_instanced #define GL_ARB_draw_instanced 1 #define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) #endif /* GL_ARB_draw_instanced */ /* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ #ifndef GL_ARB_enhanced_layouts #define GL_ARB_enhanced_layouts 1 #define GL_LOCATION_COMPONENT 0x934A #define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B #define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C #define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) #endif /* GL_ARB_enhanced_layouts */ /* -------------------- GL_ARB_explicit_attrib_location -------------------- */ #ifndef GL_ARB_explicit_attrib_location #define GL_ARB_explicit_attrib_location 1 #define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) #endif /* GL_ARB_explicit_attrib_location */ /* -------------------- GL_ARB_explicit_uniform_location ------------------- */ #ifndef GL_ARB_explicit_uniform_location #define GL_ARB_explicit_uniform_location 1 #define GL_MAX_UNIFORM_LOCATIONS 0x826E #define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) #endif /* GL_ARB_explicit_uniform_location */ /* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ #ifndef GL_ARB_fragment_coord_conventions #define GL_ARB_fragment_coord_conventions 1 #define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) #endif /* GL_ARB_fragment_coord_conventions */ /* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ #ifndef GL_ARB_fragment_layer_viewport #define GL_ARB_fragment_layer_viewport 1 #define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) #endif /* GL_ARB_fragment_layer_viewport */ /* ------------------------ GL_ARB_fragment_program ------------------------ */ #ifndef GL_ARB_fragment_program #define GL_ARB_fragment_program 1 #define GL_FRAGMENT_PROGRAM_ARB 0x8804 #define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 #define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 #define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 #define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 #define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 #define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A #define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B #define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C #define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D #define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E #define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F #define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 #define GL_MAX_TEXTURE_COORDS_ARB 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 #define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) #endif /* GL_ARB_fragment_program */ /* --------------------- GL_ARB_fragment_program_shadow -------------------- */ #ifndef GL_ARB_fragment_program_shadow #define GL_ARB_fragment_program_shadow 1 #define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) #endif /* GL_ARB_fragment_program_shadow */ /* ------------------------- GL_ARB_fragment_shader ------------------------ */ #ifndef GL_ARB_fragment_shader #define GL_ARB_fragment_shader 1 #define GL_FRAGMENT_SHADER_ARB 0x8B30 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B #define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) #endif /* GL_ARB_fragment_shader */ /* -------------------- GL_ARB_fragment_shader_interlock ------------------- */ #ifndef GL_ARB_fragment_shader_interlock #define GL_ARB_fragment_shader_interlock 1 #define GLEW_ARB_fragment_shader_interlock GLEW_GET_VAR(__GLEW_ARB_fragment_shader_interlock) #endif /* GL_ARB_fragment_shader_interlock */ /* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ #ifndef GL_ARB_framebuffer_no_attachments #define GL_ARB_framebuffer_no_attachments 1 #define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 #define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 #define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 #define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 #define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 #define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 #define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 #define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 #define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); #define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) #define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) #define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) #define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) #define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) #endif /* GL_ARB_framebuffer_no_attachments */ /* ----------------------- GL_ARB_framebuffer_object ----------------------- */ #ifndef GL_ARB_framebuffer_object #define GL_ARB_framebuffer_object 1 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 #define GL_FRAMEBUFFER_DEFAULT 0x8218 #define GL_FRAMEBUFFER_UNDEFINED 0x8219 #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A #define GL_INDEX 0x8222 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8 #define GL_DEPTH_STENCIL 0x84F9 #define GL_UNSIGNED_INT_24_8 0x84FA #define GL_DEPTH24_STENCIL8 0x88F0 #define GL_TEXTURE_STENCIL_SIZE 0x88F1 #define GL_UNSIGNED_NORMALIZED 0x8C17 #define GL_SRGB 0x8C40 #define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 #define GL_FRAMEBUFFER_BINDING 0x8CA6 #define GL_RENDERBUFFER_BINDING 0x8CA7 #define GL_READ_FRAMEBUFFER 0x8CA8 #define GL_DRAW_FRAMEBUFFER 0x8CA9 #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA #define GL_RENDERBUFFER_SAMPLES 0x8CAB #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF #define GL_COLOR_ATTACHMENT0 0x8CE0 #define GL_COLOR_ATTACHMENT1 0x8CE1 #define GL_COLOR_ATTACHMENT2 0x8CE2 #define GL_COLOR_ATTACHMENT3 0x8CE3 #define GL_COLOR_ATTACHMENT4 0x8CE4 #define GL_COLOR_ATTACHMENT5 0x8CE5 #define GL_COLOR_ATTACHMENT6 0x8CE6 #define GL_COLOR_ATTACHMENT7 0x8CE7 #define GL_COLOR_ATTACHMENT8 0x8CE8 #define GL_COLOR_ATTACHMENT9 0x8CE9 #define GL_COLOR_ATTACHMENT10 0x8CEA #define GL_COLOR_ATTACHMENT11 0x8CEB #define GL_COLOR_ATTACHMENT12 0x8CEC #define GL_COLOR_ATTACHMENT13 0x8CED #define GL_COLOR_ATTACHMENT14 0x8CEE #define GL_COLOR_ATTACHMENT15 0x8CEF #define GL_DEPTH_ATTACHMENT 0x8D00 #define GL_STENCIL_ATTACHMENT 0x8D20 #define GL_FRAMEBUFFER 0x8D40 #define GL_RENDERBUFFER 0x8D41 #define GL_RENDERBUFFER_WIDTH 0x8D42 #define GL_RENDERBUFFER_HEIGHT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 #define GL_STENCIL_INDEX1 0x8D46 #define GL_STENCIL_INDEX4 0x8D47 #define GL_STENCIL_INDEX8 0x8D48 #define GL_STENCIL_INDEX16 0x8D49 #define GL_RENDERBUFFER_RED_SIZE 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 #define GL_MAX_SAMPLES 0x8D57 typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) #define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) #define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) #define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) #define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) #define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) #define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) #define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) #define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) #define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) #define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) #define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) #define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) #define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) #define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) #define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) #define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) #define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) #define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) #define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) #define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) #endif /* GL_ARB_framebuffer_object */ /* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ #ifndef GL_ARB_framebuffer_sRGB #define GL_ARB_framebuffer_sRGB 1 #define GL_FRAMEBUFFER_SRGB 0x8DB9 #define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) #endif /* GL_ARB_framebuffer_sRGB */ /* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ #ifndef GL_ARB_geometry_shader4 #define GL_ARB_geometry_shader4 1 #define GL_LINES_ADJACENCY_ARB 0xA #define GL_LINE_STRIP_ADJACENCY_ARB 0xB #define GL_TRIANGLES_ADJACENCY_ARB 0xC #define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD #define GL_PROGRAM_POINT_SIZE_ARB 0x8642 #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 #define GL_GEOMETRY_SHADER_ARB 0x8DD9 #define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA #define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB #define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC #define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD #define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); #define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) #define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) #define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) #define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) #define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) #endif /* GL_ARB_geometry_shader4 */ /* ----------------------- GL_ARB_get_program_binary ----------------------- */ #ifndef GL_ARB_get_program_binary #define GL_ARB_get_program_binary 1 #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 #define GL_PROGRAM_BINARY_LENGTH 0x8741 #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE #define GL_PROGRAM_BINARY_FORMATS 0x87FF typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, void*binary); typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); #define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) #define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) #define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) #define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) #endif /* GL_ARB_get_program_binary */ /* ---------------------- GL_ARB_get_texture_sub_image --------------------- */ #ifndef GL_ARB_get_texture_sub_image #define GL_ARB_get_texture_sub_image 1 typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); typedef void (GLAPIENTRY * PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); #define glGetCompressedTextureSubImage GLEW_GET_FUN(__glewGetCompressedTextureSubImage) #define glGetTextureSubImage GLEW_GET_FUN(__glewGetTextureSubImage) #define GLEW_ARB_get_texture_sub_image GLEW_GET_VAR(__GLEW_ARB_get_texture_sub_image) #endif /* GL_ARB_get_texture_sub_image */ /* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ #ifndef GL_ARB_gpu_shader5 #define GL_ARB_gpu_shader5 1 #define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F #define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A #define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B #define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C #define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D #define GL_MAX_VERTEX_STREAMS 0x8E71 #define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) #endif /* GL_ARB_gpu_shader5 */ /* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ #ifndef GL_ARB_gpu_shader_fp64 #define GL_ARB_gpu_shader_fp64 1 #define GL_DOUBLE_MAT2 0x8F46 #define GL_DOUBLE_MAT3 0x8F47 #define GL_DOUBLE_MAT4 0x8F48 #define GL_DOUBLE_MAT2x3 0x8F49 #define GL_DOUBLE_MAT2x4 0x8F4A #define GL_DOUBLE_MAT3x2 0x8F4B #define GL_DOUBLE_MAT3x4 0x8F4C #define GL_DOUBLE_MAT4x2 0x8F4D #define GL_DOUBLE_MAT4x3 0x8F4E #define GL_DOUBLE_VEC2 0x8FFC #define GL_DOUBLE_VEC3 0x8FFD #define GL_DOUBLE_VEC4 0x8FFE typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); #define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) #define glUniform1d GLEW_GET_FUN(__glewUniform1d) #define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) #define glUniform2d GLEW_GET_FUN(__glewUniform2d) #define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) #define glUniform3d GLEW_GET_FUN(__glewUniform3d) #define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) #define glUniform4d GLEW_GET_FUN(__glewUniform4d) #define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) #define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) #define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) #define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) #define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) #define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) #define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) #define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) #define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) #define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) #define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) #endif /* GL_ARB_gpu_shader_fp64 */ /* ------------------------ GL_ARB_gpu_shader_int64 ------------------------ */ #ifndef GL_ARB_gpu_shader_int64 #define GL_ARB_gpu_shader_int64 1 #define GL_INT64_ARB 0x140E #define GL_UNSIGNED_INT64_ARB 0x140F #define GL_INT64_VEC2_ARB 0x8FE9 #define GL_INT64_VEC3_ARB 0x8FEA #define GL_INT64_VEC4_ARB 0x8FEB #define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 #define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 #define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64* params); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); #define glGetUniformi64vARB GLEW_GET_FUN(__glewGetUniformi64vARB) #define glGetUniformui64vARB GLEW_GET_FUN(__glewGetUniformui64vARB) #define glGetnUniformi64vARB GLEW_GET_FUN(__glewGetnUniformi64vARB) #define glGetnUniformui64vARB GLEW_GET_FUN(__glewGetnUniformui64vARB) #define glProgramUniform1i64ARB GLEW_GET_FUN(__glewProgramUniform1i64ARB) #define glProgramUniform1i64vARB GLEW_GET_FUN(__glewProgramUniform1i64vARB) #define glProgramUniform1ui64ARB GLEW_GET_FUN(__glewProgramUniform1ui64ARB) #define glProgramUniform1ui64vARB GLEW_GET_FUN(__glewProgramUniform1ui64vARB) #define glProgramUniform2i64ARB GLEW_GET_FUN(__glewProgramUniform2i64ARB) #define glProgramUniform2i64vARB GLEW_GET_FUN(__glewProgramUniform2i64vARB) #define glProgramUniform2ui64ARB GLEW_GET_FUN(__glewProgramUniform2ui64ARB) #define glProgramUniform2ui64vARB GLEW_GET_FUN(__glewProgramUniform2ui64vARB) #define glProgramUniform3i64ARB GLEW_GET_FUN(__glewProgramUniform3i64ARB) #define glProgramUniform3i64vARB GLEW_GET_FUN(__glewProgramUniform3i64vARB) #define glProgramUniform3ui64ARB GLEW_GET_FUN(__glewProgramUniform3ui64ARB) #define glProgramUniform3ui64vARB GLEW_GET_FUN(__glewProgramUniform3ui64vARB) #define glProgramUniform4i64ARB GLEW_GET_FUN(__glewProgramUniform4i64ARB) #define glProgramUniform4i64vARB GLEW_GET_FUN(__glewProgramUniform4i64vARB) #define glProgramUniform4ui64ARB GLEW_GET_FUN(__glewProgramUniform4ui64ARB) #define glProgramUniform4ui64vARB GLEW_GET_FUN(__glewProgramUniform4ui64vARB) #define glUniform1i64ARB GLEW_GET_FUN(__glewUniform1i64ARB) #define glUniform1i64vARB GLEW_GET_FUN(__glewUniform1i64vARB) #define glUniform1ui64ARB GLEW_GET_FUN(__glewUniform1ui64ARB) #define glUniform1ui64vARB GLEW_GET_FUN(__glewUniform1ui64vARB) #define glUniform2i64ARB GLEW_GET_FUN(__glewUniform2i64ARB) #define glUniform2i64vARB GLEW_GET_FUN(__glewUniform2i64vARB) #define glUniform2ui64ARB GLEW_GET_FUN(__glewUniform2ui64ARB) #define glUniform2ui64vARB GLEW_GET_FUN(__glewUniform2ui64vARB) #define glUniform3i64ARB GLEW_GET_FUN(__glewUniform3i64ARB) #define glUniform3i64vARB GLEW_GET_FUN(__glewUniform3i64vARB) #define glUniform3ui64ARB GLEW_GET_FUN(__glewUniform3ui64ARB) #define glUniform3ui64vARB GLEW_GET_FUN(__glewUniform3ui64vARB) #define glUniform4i64ARB GLEW_GET_FUN(__glewUniform4i64ARB) #define glUniform4i64vARB GLEW_GET_FUN(__glewUniform4i64vARB) #define glUniform4ui64ARB GLEW_GET_FUN(__glewUniform4ui64ARB) #define glUniform4ui64vARB GLEW_GET_FUN(__glewUniform4ui64vARB) #define GLEW_ARB_gpu_shader_int64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_int64) #endif /* GL_ARB_gpu_shader_int64 */ /* ------------------------ GL_ARB_half_float_pixel ------------------------ */ #ifndef GL_ARB_half_float_pixel #define GL_ARB_half_float_pixel 1 #define GL_HALF_FLOAT_ARB 0x140B #define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) #endif /* GL_ARB_half_float_pixel */ /* ------------------------ GL_ARB_half_float_vertex ----------------------- */ #ifndef GL_ARB_half_float_vertex #define GL_ARB_half_float_vertex 1 #define GL_HALF_FLOAT 0x140B #define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) #endif /* GL_ARB_half_float_vertex */ /* ----------------------------- GL_ARB_imaging ---------------------------- */ #ifndef GL_ARB_imaging #define GL_ARB_imaging 1 #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_BLEND_COLOR 0x8005 #define GL_FUNC_ADD 0x8006 #define GL_MIN 0x8007 #define GL_MAX 0x8008 #define GL_BLEND_EQUATION 0x8009 #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B #define GL_CONVOLUTION_1D 0x8010 #define GL_CONVOLUTION_2D 0x8011 #define GL_SEPARABLE_2D 0x8012 #define GL_CONVOLUTION_BORDER_MODE 0x8013 #define GL_CONVOLUTION_FILTER_SCALE 0x8014 #define GL_CONVOLUTION_FILTER_BIAS 0x8015 #define GL_REDUCE 0x8016 #define GL_CONVOLUTION_FORMAT 0x8017 #define GL_CONVOLUTION_WIDTH 0x8018 #define GL_CONVOLUTION_HEIGHT 0x8019 #define GL_MAX_CONVOLUTION_WIDTH 0x801A #define GL_MAX_CONVOLUTION_HEIGHT 0x801B #define GL_POST_CONVOLUTION_RED_SCALE 0x801C #define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D #define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E #define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F #define GL_POST_CONVOLUTION_RED_BIAS 0x8020 #define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 #define GL_HISTOGRAM 0x8024 #define GL_PROXY_HISTOGRAM 0x8025 #define GL_HISTOGRAM_WIDTH 0x8026 #define GL_HISTOGRAM_FORMAT 0x8027 #define GL_HISTOGRAM_RED_SIZE 0x8028 #define GL_HISTOGRAM_GREEN_SIZE 0x8029 #define GL_HISTOGRAM_BLUE_SIZE 0x802A #define GL_HISTOGRAM_ALPHA_SIZE 0x802B #define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C #define GL_HISTOGRAM_SINK 0x802D #define GL_MINMAX 0x802E #define GL_MINMAX_FORMAT 0x802F #define GL_MINMAX_SINK 0x8030 #define GL_TABLE_TOO_LARGE 0x8031 #define GL_COLOR_MATRIX 0x80B1 #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 #define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 #define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 #define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 #define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA #define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB #define GL_COLOR_TABLE 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 #define GL_PROXY_COLOR_TABLE 0x80D3 #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 #define GL_COLOR_TABLE_SCALE 0x80D6 #define GL_COLOR_TABLE_BIAS 0x80D7 #define GL_COLOR_TABLE_FORMAT 0x80D8 #define GL_COLOR_TABLE_WIDTH 0x80D9 #define GL_COLOR_TABLE_RED_SIZE 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF #define GL_IGNORE_BORDER 0x8150 #define GL_CONSTANT_BORDER 0x8151 #define GL_WRAP_BORDER 0x8152 #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); #define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) #define glColorTable GLEW_GET_FUN(__glewColorTable) #define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) #define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) #define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) #define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) #define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) #define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) #define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) #define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) #define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) #define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) #define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) #define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) #define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) #define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) #define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) #define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) #define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) #define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) #define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) #define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) #define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) #define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) #define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) #define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) #define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) #define glHistogram GLEW_GET_FUN(__glewHistogram) #define glMinmax GLEW_GET_FUN(__glewMinmax) #define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) #define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) #define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) #define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) #endif /* GL_ARB_imaging */ /* ----------------------- GL_ARB_indirect_parameters ---------------------- */ #ifndef GL_ARB_indirect_parameters #define GL_ARB_indirect_parameters 1 #define GL_PARAMETER_BUFFER_ARB 0x80EE #define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); #define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) #define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) #define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) #endif /* GL_ARB_indirect_parameters */ /* ------------------------ GL_ARB_instanced_arrays ------------------------ */ #ifndef GL_ARB_instanced_arrays #define GL_ARB_instanced_arrays 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); #define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) #define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) #define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) #define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) #endif /* GL_ARB_instanced_arrays */ /* ---------------------- GL_ARB_internalformat_query ---------------------- */ #ifndef GL_ARB_internalformat_query #define GL_ARB_internalformat_query 1 #define GL_NUM_SAMPLE_COUNTS 0x9380 typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); #define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) #define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) #endif /* GL_ARB_internalformat_query */ /* ---------------------- GL_ARB_internalformat_query2 --------------------- */ #ifndef GL_ARB_internalformat_query2 #define GL_ARB_internalformat_query2 1 #define GL_INTERNALFORMAT_SUPPORTED 0x826F #define GL_INTERNALFORMAT_PREFERRED 0x8270 #define GL_INTERNALFORMAT_RED_SIZE 0x8271 #define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 #define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 #define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 #define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 #define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 #define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 #define GL_INTERNALFORMAT_RED_TYPE 0x8278 #define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 #define GL_INTERNALFORMAT_BLUE_TYPE 0x827A #define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B #define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C #define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D #define GL_MAX_WIDTH 0x827E #define GL_MAX_HEIGHT 0x827F #define GL_MAX_DEPTH 0x8280 #define GL_MAX_LAYERS 0x8281 #define GL_MAX_COMBINED_DIMENSIONS 0x8282 #define GL_COLOR_COMPONENTS 0x8283 #define GL_DEPTH_COMPONENTS 0x8284 #define GL_STENCIL_COMPONENTS 0x8285 #define GL_COLOR_RENDERABLE 0x8286 #define GL_DEPTH_RENDERABLE 0x8287 #define GL_STENCIL_RENDERABLE 0x8288 #define GL_FRAMEBUFFER_RENDERABLE 0x8289 #define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A #define GL_FRAMEBUFFER_BLEND 0x828B #define GL_READ_PIXELS 0x828C #define GL_READ_PIXELS_FORMAT 0x828D #define GL_READ_PIXELS_TYPE 0x828E #define GL_TEXTURE_IMAGE_FORMAT 0x828F #define GL_TEXTURE_IMAGE_TYPE 0x8290 #define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 #define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 #define GL_MIPMAP 0x8293 #define GL_MANUAL_GENERATE_MIPMAP 0x8294 #define GL_AUTO_GENERATE_MIPMAP 0x8295 #define GL_COLOR_ENCODING 0x8296 #define GL_SRGB_READ 0x8297 #define GL_SRGB_WRITE 0x8298 #define GL_SRGB_DECODE_ARB 0x8299 #define GL_FILTER 0x829A #define GL_VERTEX_TEXTURE 0x829B #define GL_TESS_CONTROL_TEXTURE 0x829C #define GL_TESS_EVALUATION_TEXTURE 0x829D #define GL_GEOMETRY_TEXTURE 0x829E #define GL_FRAGMENT_TEXTURE 0x829F #define GL_COMPUTE_TEXTURE 0x82A0 #define GL_TEXTURE_SHADOW 0x82A1 #define GL_TEXTURE_GATHER 0x82A2 #define GL_TEXTURE_GATHER_SHADOW 0x82A3 #define GL_SHADER_IMAGE_LOAD 0x82A4 #define GL_SHADER_IMAGE_STORE 0x82A5 #define GL_SHADER_IMAGE_ATOMIC 0x82A6 #define GL_IMAGE_TEXEL_SIZE 0x82A7 #define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 #define GL_IMAGE_PIXEL_FORMAT 0x82A9 #define GL_IMAGE_PIXEL_TYPE 0x82AA #define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC #define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD #define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE #define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF #define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 #define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 #define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 #define GL_CLEAR_BUFFER 0x82B4 #define GL_TEXTURE_VIEW 0x82B5 #define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 #define GL_FULL_SUPPORT 0x82B7 #define GL_CAVEAT_SUPPORT 0x82B8 #define GL_IMAGE_CLASS_4_X_32 0x82B9 #define GL_IMAGE_CLASS_2_X_32 0x82BA #define GL_IMAGE_CLASS_1_X_32 0x82BB #define GL_IMAGE_CLASS_4_X_16 0x82BC #define GL_IMAGE_CLASS_2_X_16 0x82BD #define GL_IMAGE_CLASS_1_X_16 0x82BE #define GL_IMAGE_CLASS_4_X_8 0x82BF #define GL_IMAGE_CLASS_2_X_8 0x82C0 #define GL_IMAGE_CLASS_1_X_8 0x82C1 #define GL_IMAGE_CLASS_11_11_10 0x82C2 #define GL_IMAGE_CLASS_10_10_10_2 0x82C3 #define GL_VIEW_CLASS_128_BITS 0x82C4 #define GL_VIEW_CLASS_96_BITS 0x82C5 #define GL_VIEW_CLASS_64_BITS 0x82C6 #define GL_VIEW_CLASS_48_BITS 0x82C7 #define GL_VIEW_CLASS_32_BITS 0x82C8 #define GL_VIEW_CLASS_24_BITS 0x82C9 #define GL_VIEW_CLASS_16_BITS 0x82CA #define GL_VIEW_CLASS_8_BITS 0x82CB #define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC #define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD #define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE #define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF #define GL_VIEW_CLASS_RGTC1_RED 0x82D0 #define GL_VIEW_CLASS_RGTC2_RG 0x82D1 #define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 #define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); #define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) #define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) #endif /* GL_ARB_internalformat_query2 */ /* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ #ifndef GL_ARB_invalidate_subdata #define GL_ARB_invalidate_subdata 1 typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); #define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) #define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) #define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) #define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) #define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) #define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) #define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) #endif /* GL_ARB_invalidate_subdata */ /* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ #ifndef GL_ARB_map_buffer_alignment #define GL_ARB_map_buffer_alignment 1 #define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC #define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) #endif /* GL_ARB_map_buffer_alignment */ /* ------------------------ GL_ARB_map_buffer_range ------------------------ */ #ifndef GL_ARB_map_buffer_range #define GL_ARB_map_buffer_range 1 #define GL_MAP_READ_BIT 0x0001 #define GL_MAP_WRITE_BIT 0x0002 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); #define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) #define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) #define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) #endif /* GL_ARB_map_buffer_range */ /* ------------------------- GL_ARB_matrix_palette ------------------------- */ #ifndef GL_ARB_matrix_palette #define GL_ARB_matrix_palette 1 #define GL_MATRIX_PALETTE_ARB 0x8840 #define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 #define GL_MAX_PALETTE_MATRICES_ARB 0x8842 #define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 #define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 #define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 #define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 #define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 #define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 #define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); #define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) #define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) #define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) #define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) #define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) #define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) #endif /* GL_ARB_matrix_palette */ /* --------------------------- GL_ARB_multi_bind --------------------------- */ #ifndef GL_ARB_multi_bind #define GL_ARB_multi_bind 1 typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); #define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) #define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) #define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) #define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) #define glBindTextures GLEW_GET_FUN(__glewBindTextures) #define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) #define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) #endif /* GL_ARB_multi_bind */ /* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ #ifndef GL_ARB_multi_draw_indirect #define GL_ARB_multi_draw_indirect 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); #define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) #define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) #define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) #endif /* GL_ARB_multi_draw_indirect */ /* --------------------------- GL_ARB_multisample -------------------------- */ #ifndef GL_ARB_multisample #define GL_ARB_multisample 1 #define GL_MULTISAMPLE_ARB 0x809D #define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E #define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F #define GL_SAMPLE_COVERAGE_ARB 0x80A0 #define GL_SAMPLE_BUFFERS_ARB 0x80A8 #define GL_SAMPLES_ARB 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA #define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB #define GL_MULTISAMPLE_BIT_ARB 0x20000000 typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); #define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) #define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) #endif /* GL_ARB_multisample */ /* -------------------------- GL_ARB_multitexture -------------------------- */ #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 #define GL_TEXTURE2_ARB 0x84C2 #define GL_TEXTURE3_ARB 0x84C3 #define GL_TEXTURE4_ARB 0x84C4 #define GL_TEXTURE5_ARB 0x84C5 #define GL_TEXTURE6_ARB 0x84C6 #define GL_TEXTURE7_ARB 0x84C7 #define GL_TEXTURE8_ARB 0x84C8 #define GL_TEXTURE9_ARB 0x84C9 #define GL_TEXTURE10_ARB 0x84CA #define GL_TEXTURE11_ARB 0x84CB #define GL_TEXTURE12_ARB 0x84CC #define GL_TEXTURE13_ARB 0x84CD #define GL_TEXTURE14_ARB 0x84CE #define GL_TEXTURE15_ARB 0x84CF #define GL_TEXTURE16_ARB 0x84D0 #define GL_TEXTURE17_ARB 0x84D1 #define GL_TEXTURE18_ARB 0x84D2 #define GL_TEXTURE19_ARB 0x84D3 #define GL_TEXTURE20_ARB 0x84D4 #define GL_TEXTURE21_ARB 0x84D5 #define GL_TEXTURE22_ARB 0x84D6 #define GL_TEXTURE23_ARB 0x84D7 #define GL_TEXTURE24_ARB 0x84D8 #define GL_TEXTURE25_ARB 0x84D9 #define GL_TEXTURE26_ARB 0x84DA #define GL_TEXTURE27_ARB 0x84DB #define GL_TEXTURE28_ARB 0x84DC #define GL_TEXTURE29_ARB 0x84DD #define GL_TEXTURE30_ARB 0x84DE #define GL_TEXTURE31_ARB 0x84DF #define GL_ACTIVE_TEXTURE_ARB 0x84E0 #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); #define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) #define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) #define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) #define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) #define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) #define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) #define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) #define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) #define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) #define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) #define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) #define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) #define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) #define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) #define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) #define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) #define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) #define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) #define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) #define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) #define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) #define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) #define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) #define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) #define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) #define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) #define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) #define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) #define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) #define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) #define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) #define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) #define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) #define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) #define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) #endif /* GL_ARB_multitexture */ /* ------------------------- GL_ARB_occlusion_query ------------------------ */ #ifndef GL_ARB_occlusion_query #define GL_ARB_occlusion_query 1 #define GL_QUERY_COUNTER_BITS_ARB 0x8864 #define GL_CURRENT_QUERY_ARB 0x8865 #define GL_QUERY_RESULT_ARB 0x8866 #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 #define GL_SAMPLES_PASSED_ARB 0x8914 typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); #define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) #define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) #define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) #define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) #define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) #define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) #define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) #define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) #define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) #endif /* GL_ARB_occlusion_query */ /* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ #ifndef GL_ARB_occlusion_query2 #define GL_ARB_occlusion_query2 1 #define GL_ANY_SAMPLES_PASSED 0x8C2F #define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) #endif /* GL_ARB_occlusion_query2 */ /* --------------------- GL_ARB_parallel_shader_compile -------------------- */ #ifndef GL_ARB_parallel_shader_compile #define GL_ARB_parallel_shader_compile 1 #define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 #define GL_COMPLETION_STATUS_ARB 0x91B1 typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); #define glMaxShaderCompilerThreadsARB GLEW_GET_FUN(__glewMaxShaderCompilerThreadsARB) #define GLEW_ARB_parallel_shader_compile GLEW_GET_VAR(__GLEW_ARB_parallel_shader_compile) #endif /* GL_ARB_parallel_shader_compile */ /* -------------------- GL_ARB_pipeline_statistics_query ------------------- */ #ifndef GL_ARB_pipeline_statistics_query #define GL_ARB_pipeline_statistics_query 1 #define GL_VERTICES_SUBMITTED_ARB 0x82EE #define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF #define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 #define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 #define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 #define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 #define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 #define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 #define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 #define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 #define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F #define GLEW_ARB_pipeline_statistics_query GLEW_GET_VAR(__GLEW_ARB_pipeline_statistics_query) #endif /* GL_ARB_pipeline_statistics_query */ /* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ #ifndef GL_ARB_pixel_buffer_object #define GL_ARB_pixel_buffer_object 1 #define GL_PIXEL_PACK_BUFFER_ARB 0x88EB #define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED #define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF #define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) #endif /* GL_ARB_pixel_buffer_object */ /* ------------------------ GL_ARB_point_parameters ------------------------ */ #ifndef GL_ARB_point_parameters #define GL_ARB_point_parameters 1 #define GL_POINT_SIZE_MIN_ARB 0x8126 #define GL_POINT_SIZE_MAX_ARB 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 #define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); #define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) #define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) #define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) #endif /* GL_ARB_point_parameters */ /* -------------------------- GL_ARB_point_sprite -------------------------- */ #ifndef GL_ARB_point_sprite #define GL_ARB_point_sprite 1 #define GL_POINT_SPRITE_ARB 0x8861 #define GL_COORD_REPLACE_ARB 0x8862 #define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) #endif /* GL_ARB_point_sprite */ /* ----------------------- GL_ARB_post_depth_coverage ---------------------- */ #ifndef GL_ARB_post_depth_coverage #define GL_ARB_post_depth_coverage 1 #define GLEW_ARB_post_depth_coverage GLEW_GET_VAR(__GLEW_ARB_post_depth_coverage) #endif /* GL_ARB_post_depth_coverage */ /* --------------------- GL_ARB_program_interface_query -------------------- */ #ifndef GL_ARB_program_interface_query #define GL_ARB_program_interface_query 1 #define GL_UNIFORM 0x92E1 #define GL_UNIFORM_BLOCK 0x92E2 #define GL_PROGRAM_INPUT 0x92E3 #define GL_PROGRAM_OUTPUT 0x92E4 #define GL_BUFFER_VARIABLE 0x92E5 #define GL_SHADER_STORAGE_BLOCK 0x92E6 #define GL_IS_PER_PATCH 0x92E7 #define GL_VERTEX_SUBROUTINE 0x92E8 #define GL_TESS_CONTROL_SUBROUTINE 0x92E9 #define GL_TESS_EVALUATION_SUBROUTINE 0x92EA #define GL_GEOMETRY_SUBROUTINE 0x92EB #define GL_FRAGMENT_SUBROUTINE 0x92EC #define GL_COMPUTE_SUBROUTINE 0x92ED #define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE #define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF #define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 #define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 #define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 #define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 #define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 #define GL_ACTIVE_RESOURCES 0x92F5 #define GL_MAX_NAME_LENGTH 0x92F6 #define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 #define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 #define GL_NAME_LENGTH 0x92F9 #define GL_TYPE 0x92FA #define GL_ARRAY_SIZE 0x92FB #define GL_OFFSET 0x92FC #define GL_BLOCK_INDEX 0x92FD #define GL_ARRAY_STRIDE 0x92FE #define GL_MATRIX_STRIDE 0x92FF #define GL_IS_ROW_MAJOR 0x9300 #define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 #define GL_BUFFER_BINDING 0x9302 #define GL_BUFFER_DATA_SIZE 0x9303 #define GL_NUM_ACTIVE_VARIABLES 0x9304 #define GL_ACTIVE_VARIABLES 0x9305 #define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 #define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 #define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 #define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 #define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A #define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B #define GL_TOP_LEVEL_ARRAY_SIZE 0x930C #define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D #define GL_LOCATION 0x930E #define GL_LOCATION_INDEX 0x930F typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); #define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) #define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) #define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) #define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) #define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) #define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) #define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) #endif /* GL_ARB_program_interface_query */ /* ------------------------ GL_ARB_provoking_vertex ------------------------ */ #ifndef GL_ARB_provoking_vertex #define GL_ARB_provoking_vertex 1 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C #define GL_FIRST_VERTEX_CONVENTION 0x8E4D #define GL_LAST_VERTEX_CONVENTION 0x8E4E #define GL_PROVOKING_VERTEX 0x8E4F typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); #define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) #define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) #endif /* GL_ARB_provoking_vertex */ /* ----------------------- GL_ARB_query_buffer_object ---------------------- */ #ifndef GL_ARB_query_buffer_object #define GL_ARB_query_buffer_object 1 #define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 #define GL_QUERY_BUFFER 0x9192 #define GL_QUERY_BUFFER_BINDING 0x9193 #define GL_QUERY_RESULT_NO_WAIT 0x9194 #define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) #endif /* GL_ARB_query_buffer_object */ /* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ #ifndef GL_ARB_robust_buffer_access_behavior #define GL_ARB_robust_buffer_access_behavior 1 #define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) #endif /* GL_ARB_robust_buffer_access_behavior */ /* --------------------------- GL_ARB_robustness --------------------------- */ #ifndef GL_ARB_robustness #define GL_ARB_robustness 1 #define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 #define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 #define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 #define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 #define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 #define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define GL_NO_RESET_NOTIFICATION_ARB 0x8261 typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span); typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); #define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) #define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) #define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) #define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) #define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) #define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) #define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) #define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) #define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) #define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) #define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) #define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) #define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) #define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) #define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) #define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) #define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) #define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) #define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) #define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) #define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) #endif /* GL_ARB_robustness */ /* ---------------- GL_ARB_robustness_application_isolation ---------------- */ #ifndef GL_ARB_robustness_application_isolation #define GL_ARB_robustness_application_isolation 1 #define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) #endif /* GL_ARB_robustness_application_isolation */ /* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ #ifndef GL_ARB_robustness_share_group_isolation #define GL_ARB_robustness_share_group_isolation 1 #define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) #endif /* GL_ARB_robustness_share_group_isolation */ /* ------------------------ GL_ARB_sample_locations ------------------------ */ #ifndef GL_ARB_sample_locations #define GL_ARB_sample_locations 1 #define GL_SAMPLE_LOCATION_ARB 0x8E50 #define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D #define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E #define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F #define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 #define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 #define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 #define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); #define glFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewFramebufferSampleLocationsfvARB) #define glNamedFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvARB) #define GLEW_ARB_sample_locations GLEW_GET_VAR(__GLEW_ARB_sample_locations) #endif /* GL_ARB_sample_locations */ /* ------------------------- GL_ARB_sample_shading ------------------------- */ #ifndef GL_ARB_sample_shading #define GL_ARB_sample_shading 1 #define GL_SAMPLE_SHADING_ARB 0x8C36 #define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); #define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) #define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) #endif /* GL_ARB_sample_shading */ /* ------------------------- GL_ARB_sampler_objects ------------------------ */ #ifndef GL_ARB_sampler_objects #define GL_ARB_sampler_objects 1 #define GL_SAMPLER_BINDING 0x8919 typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); #define glBindSampler GLEW_GET_FUN(__glewBindSampler) #define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) #define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) #define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) #define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) #define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) #define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) #define glIsSampler GLEW_GET_FUN(__glewIsSampler) #define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) #define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) #define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) #define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) #define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) #define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) #define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) #endif /* GL_ARB_sampler_objects */ /* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ #ifndef GL_ARB_seamless_cube_map #define GL_ARB_seamless_cube_map 1 #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F #define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) #endif /* GL_ARB_seamless_cube_map */ /* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ #ifndef GL_ARB_seamless_cubemap_per_texture #define GL_ARB_seamless_cubemap_per_texture 1 #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F #define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) #endif /* GL_ARB_seamless_cubemap_per_texture */ /* --------------------- GL_ARB_separate_shader_objects -------------------- */ #ifndef GL_ARB_separate_shader_objects #define GL_ARB_separate_shader_objects 1 #define GL_VERTEX_SHADER_BIT 0x00000001 #define GL_FRAGMENT_SHADER_BIT 0x00000002 #define GL_GEOMETRY_SHADER_BIT 0x00000004 #define GL_TESS_CONTROL_SHADER_BIT 0x00000008 #define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 #define GL_PROGRAM_SEPARABLE 0x8258 #define GL_ACTIVE_PROGRAM 0x8259 #define GL_PROGRAM_PIPELINE_BINDING 0x825A #define GL_ALL_SHADER_BITS 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar * const * strings); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); #define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) #define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) #define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) #define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) #define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) #define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) #define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) #define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) #define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) #define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) #define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) #define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) #define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) #define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) #define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) #define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) #define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) #define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) #define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) #define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) #define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) #define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) #define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) #define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) #define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) #define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) #define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) #define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) #define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) #define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) #define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) #define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) #define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) #define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) #define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) #define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) #define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) #define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) #define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) #define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) #define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) #define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) #define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) #define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) #define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) #define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) #define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) #define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) #define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) #define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) #define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) #define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) #define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) #define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) #define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) #define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) #define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) #define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) #define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) #define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) #define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) #endif /* GL_ARB_separate_shader_objects */ /* -------------------- GL_ARB_shader_atomic_counter_ops ------------------- */ #ifndef GL_ARB_shader_atomic_counter_ops #define GL_ARB_shader_atomic_counter_ops 1 #define GLEW_ARB_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counter_ops) #endif /* GL_ARB_shader_atomic_counter_ops */ /* --------------------- GL_ARB_shader_atomic_counters --------------------- */ #ifndef GL_ARB_shader_atomic_counters #define GL_ARB_shader_atomic_counters 1 #define GL_ATOMIC_COUNTER_BUFFER 0x92C0 #define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 #define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 #define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 #define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 #define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 #define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB #define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE #define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF #define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 #define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 #define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 #define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 #define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 #define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 #define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 #define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 #define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA #define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB #define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); #define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) #define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) #endif /* GL_ARB_shader_atomic_counters */ /* -------------------------- GL_ARB_shader_ballot ------------------------- */ #ifndef GL_ARB_shader_ballot #define GL_ARB_shader_ballot 1 #define GLEW_ARB_shader_ballot GLEW_GET_VAR(__GLEW_ARB_shader_ballot) #endif /* GL_ARB_shader_ballot */ /* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ #ifndef GL_ARB_shader_bit_encoding #define GL_ARB_shader_bit_encoding 1 #define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) #endif /* GL_ARB_shader_bit_encoding */ /* -------------------------- GL_ARB_shader_clock -------------------------- */ #ifndef GL_ARB_shader_clock #define GL_ARB_shader_clock 1 #define GLEW_ARB_shader_clock GLEW_GET_VAR(__GLEW_ARB_shader_clock) #endif /* GL_ARB_shader_clock */ /* --------------------- GL_ARB_shader_draw_parameters --------------------- */ #ifndef GL_ARB_shader_draw_parameters #define GL_ARB_shader_draw_parameters 1 #define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) #endif /* GL_ARB_shader_draw_parameters */ /* ------------------------ GL_ARB_shader_group_vote ----------------------- */ #ifndef GL_ARB_shader_group_vote #define GL_ARB_shader_group_vote 1 #define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) #endif /* GL_ARB_shader_group_vote */ /* --------------------- GL_ARB_shader_image_load_store -------------------- */ #ifndef GL_ARB_shader_image_load_store #define GL_ARB_shader_image_load_store 1 #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 #define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 #define GL_UNIFORM_BARRIER_BIT 0x00000004 #define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 #define GL_COMMAND_BARRIER_BIT 0x00000040 #define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 #define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 #define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 #define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 #define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 #define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 #define GL_MAX_IMAGE_UNITS 0x8F38 #define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 #define GL_IMAGE_BINDING_NAME 0x8F3A #define GL_IMAGE_BINDING_LEVEL 0x8F3B #define GL_IMAGE_BINDING_LAYERED 0x8F3C #define GL_IMAGE_BINDING_LAYER 0x8F3D #define GL_IMAGE_BINDING_ACCESS 0x8F3E #define GL_IMAGE_1D 0x904C #define GL_IMAGE_2D 0x904D #define GL_IMAGE_3D 0x904E #define GL_IMAGE_2D_RECT 0x904F #define GL_IMAGE_CUBE 0x9050 #define GL_IMAGE_BUFFER 0x9051 #define GL_IMAGE_1D_ARRAY 0x9052 #define GL_IMAGE_2D_ARRAY 0x9053 #define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 #define GL_IMAGE_2D_MULTISAMPLE 0x9055 #define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 #define GL_INT_IMAGE_1D 0x9057 #define GL_INT_IMAGE_2D 0x9058 #define GL_INT_IMAGE_3D 0x9059 #define GL_INT_IMAGE_2D_RECT 0x905A #define GL_INT_IMAGE_CUBE 0x905B #define GL_INT_IMAGE_BUFFER 0x905C #define GL_INT_IMAGE_1D_ARRAY 0x905D #define GL_INT_IMAGE_2D_ARRAY 0x905E #define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F #define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 #define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 #define GL_UNSIGNED_INT_IMAGE_1D 0x9062 #define GL_UNSIGNED_INT_IMAGE_2D 0x9063 #define GL_UNSIGNED_INT_IMAGE_3D 0x9064 #define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 #define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 #define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 #define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C #define GL_MAX_IMAGE_SAMPLES 0x906D #define GL_IMAGE_BINDING_FORMAT 0x906E #define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 #define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 #define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 #define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA #define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB #define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD #define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE #define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF #define GL_ALL_BARRIER_BITS 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); #define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) #define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) #define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) #endif /* GL_ARB_shader_image_load_store */ /* ------------------------ GL_ARB_shader_image_size ----------------------- */ #ifndef GL_ARB_shader_image_size #define GL_ARB_shader_image_size 1 #define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) #endif /* GL_ARB_shader_image_size */ /* ------------------------- GL_ARB_shader_objects ------------------------- */ #ifndef GL_ARB_shader_objects #define GL_ARB_shader_objects 1 #define GL_PROGRAM_OBJECT_ARB 0x8B40 #define GL_SHADER_OBJECT_ARB 0x8B48 #define GL_OBJECT_TYPE_ARB 0x8B4E #define GL_OBJECT_SUBTYPE_ARB 0x8B4F #define GL_FLOAT_VEC2_ARB 0x8B50 #define GL_FLOAT_VEC3_ARB 0x8B51 #define GL_FLOAT_VEC4_ARB 0x8B52 #define GL_INT_VEC2_ARB 0x8B53 #define GL_INT_VEC3_ARB 0x8B54 #define GL_INT_VEC4_ARB 0x8B55 #define GL_BOOL_ARB 0x8B56 #define GL_BOOL_VEC2_ARB 0x8B57 #define GL_BOOL_VEC3_ARB 0x8B58 #define GL_BOOL_VEC4_ARB 0x8B59 #define GL_FLOAT_MAT2_ARB 0x8B5A #define GL_FLOAT_MAT3_ARB 0x8B5B #define GL_FLOAT_MAT4_ARB 0x8B5C #define GL_SAMPLER_1D_ARB 0x8B5D #define GL_SAMPLER_2D_ARB 0x8B5E #define GL_SAMPLER_3D_ARB 0x8B5F #define GL_SAMPLER_CUBE_ARB 0x8B60 #define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 #define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 #define GL_SAMPLER_2D_RECT_ARB 0x8B63 #define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 #define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 #define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 #define GL_OBJECT_LINK_STATUS_ARB 0x8B82 #define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 #define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 #define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 #define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 #define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 #define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 typedef char GLcharARB; typedef unsigned int GLhandleARB; typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); #define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) #define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) #define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) #define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) #define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) #define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) #define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) #define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) #define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) #define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) #define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) #define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) #define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) #define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) #define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) #define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) #define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) #define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) #define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) #define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) #define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) #define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) #define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) #define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) #define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) #define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) #define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) #define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) #define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) #define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) #define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) #define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) #define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) #define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) #define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) #define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) #define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) #define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) #define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) #define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) #endif /* GL_ARB_shader_objects */ /* ------------------------ GL_ARB_shader_precision ------------------------ */ #ifndef GL_ARB_shader_precision #define GL_ARB_shader_precision 1 #define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) #endif /* GL_ARB_shader_precision */ /* ---------------------- GL_ARB_shader_stencil_export --------------------- */ #ifndef GL_ARB_shader_stencil_export #define GL_ARB_shader_stencil_export 1 #define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) #endif /* GL_ARB_shader_stencil_export */ /* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ #ifndef GL_ARB_shader_storage_buffer_object #define GL_ARB_shader_storage_buffer_object 1 #define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 #define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 #define GL_SHADER_STORAGE_BUFFER 0x90D2 #define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 #define GL_SHADER_STORAGE_BUFFER_START 0x90D4 #define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 #define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 #define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 #define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 #define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 #define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA #define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB #define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC #define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD #define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE #define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); #define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) #define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) #endif /* GL_ARB_shader_storage_buffer_object */ /* ------------------------ GL_ARB_shader_subroutine ----------------------- */ #ifndef GL_ARB_shader_subroutine #define GL_ARB_shader_subroutine 1 #define GL_ACTIVE_SUBROUTINES 0x8DE5 #define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 #define GL_MAX_SUBROUTINES 0x8DE7 #define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 #define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 #define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 #define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 #define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A #define GL_COMPATIBLE_SUBROUTINES 0x8E4B typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); #define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) #define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) #define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) #define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) #define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) #define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) #define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) #define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) #define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) #endif /* GL_ARB_shader_subroutine */ /* ------------------ GL_ARB_shader_texture_image_samples ------------------ */ #ifndef GL_ARB_shader_texture_image_samples #define GL_ARB_shader_texture_image_samples 1 #define GLEW_ARB_shader_texture_image_samples GLEW_GET_VAR(__GLEW_ARB_shader_texture_image_samples) #endif /* GL_ARB_shader_texture_image_samples */ /* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ #ifndef GL_ARB_shader_texture_lod #define GL_ARB_shader_texture_lod 1 #define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) #endif /* GL_ARB_shader_texture_lod */ /* ------------------- GL_ARB_shader_viewport_layer_array ------------------ */ #ifndef GL_ARB_shader_viewport_layer_array #define GL_ARB_shader_viewport_layer_array 1 #define GLEW_ARB_shader_viewport_layer_array GLEW_GET_VAR(__GLEW_ARB_shader_viewport_layer_array) #endif /* GL_ARB_shader_viewport_layer_array */ /* ---------------------- GL_ARB_shading_language_100 ---------------------- */ #ifndef GL_ARB_shading_language_100 #define GL_ARB_shading_language_100 1 #define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C #define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) #endif /* GL_ARB_shading_language_100 */ /* -------------------- GL_ARB_shading_language_420pack -------------------- */ #ifndef GL_ARB_shading_language_420pack #define GL_ARB_shading_language_420pack 1 #define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) #endif /* GL_ARB_shading_language_420pack */ /* -------------------- GL_ARB_shading_language_include -------------------- */ #ifndef GL_ARB_shading_language_include #define GL_ARB_shading_language_include 1 #define GL_SHADER_INCLUDE_ARB 0x8DAE #define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 #define GL_NAMED_STRING_TYPE_ARB 0x8DEA typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); #define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) #define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) #define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) #define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) #define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) #define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) #define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) #endif /* GL_ARB_shading_language_include */ /* -------------------- GL_ARB_shading_language_packing -------------------- */ #ifndef GL_ARB_shading_language_packing #define GL_ARB_shading_language_packing 1 #define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) #endif /* GL_ARB_shading_language_packing */ /* ----------------------------- GL_ARB_shadow ----------------------------- */ #ifndef GL_ARB_shadow #define GL_ARB_shadow 1 #define GL_TEXTURE_COMPARE_MODE_ARB 0x884C #define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D #define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E #define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) #endif /* GL_ARB_shadow */ /* ------------------------- GL_ARB_shadow_ambient ------------------------- */ #ifndef GL_ARB_shadow_ambient #define GL_ARB_shadow_ambient 1 #define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF #define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) #endif /* GL_ARB_shadow_ambient */ /* -------------------------- GL_ARB_sparse_buffer ------------------------- */ #ifndef GL_ARB_sparse_buffer #define GL_ARB_sparse_buffer 1 #define GL_SPARSE_STORAGE_BIT_ARB 0x0400 #define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 typedef void (GLAPIENTRY * PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); #define glBufferPageCommitmentARB GLEW_GET_FUN(__glewBufferPageCommitmentARB) #define GLEW_ARB_sparse_buffer GLEW_GET_VAR(__GLEW_ARB_sparse_buffer) #endif /* GL_ARB_sparse_buffer */ /* ------------------------- GL_ARB_sparse_texture ------------------------- */ #ifndef GL_ARB_sparse_texture #define GL_ARB_sparse_texture 1 #define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 #define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 #define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 #define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 #define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 #define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A #define GL_TEXTURE_SPARSE_ARB 0x91A6 #define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 #define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 #define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 #define GL_NUM_SPARSE_LEVELS_ARB 0x91AA typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); #define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) #define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) #define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) #endif /* GL_ARB_sparse_texture */ /* ------------------------- GL_ARB_sparse_texture2 ------------------------ */ #ifndef GL_ARB_sparse_texture2 #define GL_ARB_sparse_texture2 1 #define GLEW_ARB_sparse_texture2 GLEW_GET_VAR(__GLEW_ARB_sparse_texture2) #endif /* GL_ARB_sparse_texture2 */ /* ---------------------- GL_ARB_sparse_texture_clamp ---------------------- */ #ifndef GL_ARB_sparse_texture_clamp #define GL_ARB_sparse_texture_clamp 1 #define GLEW_ARB_sparse_texture_clamp GLEW_GET_VAR(__GLEW_ARB_sparse_texture_clamp) #endif /* GL_ARB_sparse_texture_clamp */ /* ------------------------ GL_ARB_stencil_texturing ----------------------- */ #ifndef GL_ARB_stencil_texturing #define GL_ARB_stencil_texturing 1 #define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA #define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) #endif /* GL_ARB_stencil_texturing */ /* ------------------------------ GL_ARB_sync ------------------------------ */ #ifndef GL_ARB_sync #define GL_ARB_sync 1 #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 #define GL_OBJECT_TYPE 0x9112 #define GL_SYNC_CONDITION 0x9113 #define GL_SYNC_STATUS 0x9114 #define GL_SYNC_FLAGS 0x9115 #define GL_SYNC_FENCE 0x9116 #define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 #define GL_UNSIGNALED 0x9118 #define GL_SIGNALED 0x9119 #define GL_ALREADY_SIGNALED 0x911A #define GL_TIMEOUT_EXPIRED 0x911B #define GL_CONDITION_SATISFIED 0x911C #define GL_WAIT_FAILED 0x911D #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); #define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) #define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) #define glFenceSync GLEW_GET_FUN(__glewFenceSync) #define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) #define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) #define glIsSync GLEW_GET_FUN(__glewIsSync) #define glWaitSync GLEW_GET_FUN(__glewWaitSync) #define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) #endif /* GL_ARB_sync */ /* ----------------------- GL_ARB_tessellation_shader ---------------------- */ #ifndef GL_ARB_tessellation_shader #define GL_ARB_tessellation_shader 1 #define GL_PATCHES 0xE #define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 #define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 #define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C #define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D #define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E #define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F #define GL_PATCH_VERTICES 0x8E72 #define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 #define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 #define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 #define GL_TESS_GEN_MODE 0x8E76 #define GL_TESS_GEN_SPACING 0x8E77 #define GL_TESS_GEN_VERTEX_ORDER 0x8E78 #define GL_TESS_GEN_POINT_MODE 0x8E79 #define GL_ISOLINES 0x8E7A #define GL_FRACTIONAL_ODD 0x8E7B #define GL_FRACTIONAL_EVEN 0x8E7C #define GL_MAX_PATCH_VERTICES 0x8E7D #define GL_MAX_TESS_GEN_LEVEL 0x8E7E #define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F #define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 #define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 #define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 #define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 #define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 #define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 #define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 #define GL_TESS_EVALUATION_SHADER 0x8E87 #define GL_TESS_CONTROL_SHADER 0x8E88 #define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 #define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); #define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) #define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) #define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) #endif /* GL_ARB_tessellation_shader */ /* ------------------------- GL_ARB_texture_barrier ------------------------ */ #ifndef GL_ARB_texture_barrier #define GL_ARB_texture_barrier 1 typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERPROC) (void); #define glTextureBarrier GLEW_GET_FUN(__glewTextureBarrier) #define GLEW_ARB_texture_barrier GLEW_GET_VAR(__GLEW_ARB_texture_barrier) #endif /* GL_ARB_texture_barrier */ /* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ #ifndef GL_ARB_texture_border_clamp #define GL_ARB_texture_border_clamp 1 #define GL_CLAMP_TO_BORDER_ARB 0x812D #define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) #endif /* GL_ARB_texture_border_clamp */ /* ---------------------- GL_ARB_texture_buffer_object --------------------- */ #ifndef GL_ARB_texture_buffer_object #define GL_ARB_texture_buffer_object 1 #define GL_TEXTURE_BUFFER_ARB 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B #define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D #define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); #define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) #define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) #endif /* GL_ARB_texture_buffer_object */ /* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ #ifndef GL_ARB_texture_buffer_object_rgb32 #define GL_ARB_texture_buffer_object_rgb32 1 #define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) #endif /* GL_ARB_texture_buffer_object_rgb32 */ /* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ #ifndef GL_ARB_texture_buffer_range #define GL_ARB_texture_buffer_range 1 #define GL_TEXTURE_BUFFER_OFFSET 0x919D #define GL_TEXTURE_BUFFER_SIZE 0x919E #define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); #define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) #define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) #define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) #endif /* GL_ARB_texture_buffer_range */ /* ----------------------- GL_ARB_texture_compression ---------------------- */ #ifndef GL_ARB_texture_compression #define GL_ARB_texture_compression 1 #define GL_COMPRESSED_ALPHA_ARB 0x84E9 #define GL_COMPRESSED_LUMINANCE_ARB 0x84EA #define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB #define GL_COMPRESSED_INTENSITY_ARB 0x84EC #define GL_COMPRESSED_RGB_ARB 0x84ED #define GL_COMPRESSED_RGBA_ARB 0x84EE #define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 #define GL_TEXTURE_COMPRESSED_ARB 0x86A1 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void *img); #define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) #define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) #define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) #define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) #define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) #define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) #define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) #define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) #endif /* GL_ARB_texture_compression */ /* -------------------- GL_ARB_texture_compression_bptc -------------------- */ #ifndef GL_ARB_texture_compression_bptc #define GL_ARB_texture_compression_bptc 1 #define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F #define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) #endif /* GL_ARB_texture_compression_bptc */ /* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ #ifndef GL_ARB_texture_compression_rgtc #define GL_ARB_texture_compression_rgtc 1 #define GL_COMPRESSED_RED_RGTC1 0x8DBB #define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC #define GL_COMPRESSED_RG_RGTC2 0x8DBD #define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE #define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) #endif /* GL_ARB_texture_compression_rgtc */ /* ------------------------ GL_ARB_texture_cube_map ------------------------ */ #ifndef GL_ARB_texture_cube_map #define GL_ARB_texture_cube_map 1 #define GL_NORMAL_MAP_ARB 0x8511 #define GL_REFLECTION_MAP_ARB 0x8512 #define GL_TEXTURE_CUBE_MAP_ARB 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C #define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) #endif /* GL_ARB_texture_cube_map */ /* --------------------- GL_ARB_texture_cube_map_array --------------------- */ #ifndef GL_ARB_texture_cube_map_array #define GL_ARB_texture_cube_map_array 1 #define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 #define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A #define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B #define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D #define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F #define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) #endif /* GL_ARB_texture_cube_map_array */ /* ------------------------- GL_ARB_texture_env_add ------------------------ */ #ifndef GL_ARB_texture_env_add #define GL_ARB_texture_env_add 1 #define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) #endif /* GL_ARB_texture_env_add */ /* ----------------------- GL_ARB_texture_env_combine ---------------------- */ #ifndef GL_ARB_texture_env_combine #define GL_ARB_texture_env_combine 1 #define GL_SUBTRACT_ARB 0x84E7 #define GL_COMBINE_ARB 0x8570 #define GL_COMBINE_RGB_ARB 0x8571 #define GL_COMBINE_ALPHA_ARB 0x8572 #define GL_RGB_SCALE_ARB 0x8573 #define GL_ADD_SIGNED_ARB 0x8574 #define GL_INTERPOLATE_ARB 0x8575 #define GL_CONSTANT_ARB 0x8576 #define GL_PRIMARY_COLOR_ARB 0x8577 #define GL_PREVIOUS_ARB 0x8578 #define GL_SOURCE0_RGB_ARB 0x8580 #define GL_SOURCE1_RGB_ARB 0x8581 #define GL_SOURCE2_RGB_ARB 0x8582 #define GL_SOURCE0_ALPHA_ARB 0x8588 #define GL_SOURCE1_ALPHA_ARB 0x8589 #define GL_SOURCE2_ALPHA_ARB 0x858A #define GL_OPERAND0_RGB_ARB 0x8590 #define GL_OPERAND1_RGB_ARB 0x8591 #define GL_OPERAND2_RGB_ARB 0x8592 #define GL_OPERAND0_ALPHA_ARB 0x8598 #define GL_OPERAND1_ALPHA_ARB 0x8599 #define GL_OPERAND2_ALPHA_ARB 0x859A #define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) #endif /* GL_ARB_texture_env_combine */ /* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ #ifndef GL_ARB_texture_env_crossbar #define GL_ARB_texture_env_crossbar 1 #define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) #endif /* GL_ARB_texture_env_crossbar */ /* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ #ifndef GL_ARB_texture_env_dot3 #define GL_ARB_texture_env_dot3 1 #define GL_DOT3_RGB_ARB 0x86AE #define GL_DOT3_RGBA_ARB 0x86AF #define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) #endif /* GL_ARB_texture_env_dot3 */ /* ---------------------- GL_ARB_texture_filter_minmax --------------------- */ #ifndef GL_ARB_texture_filter_minmax #define GL_ARB_texture_filter_minmax 1 #define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 #define GL_WEIGHTED_AVERAGE_ARB 0x9367 #define GLEW_ARB_texture_filter_minmax GLEW_GET_VAR(__GLEW_ARB_texture_filter_minmax) #endif /* GL_ARB_texture_filter_minmax */ /* -------------------------- GL_ARB_texture_float ------------------------- */ #ifndef GL_ARB_texture_float #define GL_ARB_texture_float 1 #define GL_RGBA32F_ARB 0x8814 #define GL_RGB32F_ARB 0x8815 #define GL_ALPHA32F_ARB 0x8816 #define GL_INTENSITY32F_ARB 0x8817 #define GL_LUMINANCE32F_ARB 0x8818 #define GL_LUMINANCE_ALPHA32F_ARB 0x8819 #define GL_RGBA16F_ARB 0x881A #define GL_RGB16F_ARB 0x881B #define GL_ALPHA16F_ARB 0x881C #define GL_INTENSITY16F_ARB 0x881D #define GL_LUMINANCE16F_ARB 0x881E #define GL_LUMINANCE_ALPHA16F_ARB 0x881F #define GL_TEXTURE_RED_TYPE_ARB 0x8C10 #define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 #define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 #define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 #define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 #define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 #define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 #define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 #define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) #endif /* GL_ARB_texture_float */ /* ------------------------- GL_ARB_texture_gather ------------------------- */ #ifndef GL_ARB_texture_gather #define GL_ARB_texture_gather 1 #define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F #define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F #define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) #endif /* GL_ARB_texture_gather */ /* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ #ifndef GL_ARB_texture_mirror_clamp_to_edge #define GL_ARB_texture_mirror_clamp_to_edge 1 #define GL_MIRROR_CLAMP_TO_EDGE 0x8743 #define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) #endif /* GL_ARB_texture_mirror_clamp_to_edge */ /* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ #ifndef GL_ARB_texture_mirrored_repeat #define GL_ARB_texture_mirrored_repeat 1 #define GL_MIRRORED_REPEAT_ARB 0x8370 #define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) #endif /* GL_ARB_texture_mirrored_repeat */ /* ----------------------- GL_ARB_texture_multisample ---------------------- */ #ifndef GL_ARB_texture_multisample #define GL_ARB_texture_multisample 1 #define GL_SAMPLE_POSITION 0x8E50 #define GL_SAMPLE_MASK 0x8E51 #define GL_SAMPLE_MASK_VALUE 0x8E52 #define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 #define GL_TEXTURE_2D_MULTISAMPLE 0x9100 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 #define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 #define GL_TEXTURE_SAMPLES 0x9106 #define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 #define GL_SAMPLER_2D_MULTISAMPLE 0x9108 #define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A #define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B #define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D #define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E #define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F #define GL_MAX_INTEGER_SAMPLES 0x9110 typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); #define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) #define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) #define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) #define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) #define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) #endif /* GL_ARB_texture_multisample */ /* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ #ifndef GL_ARB_texture_non_power_of_two #define GL_ARB_texture_non_power_of_two 1 #define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) #endif /* GL_ARB_texture_non_power_of_two */ /* ---------------------- GL_ARB_texture_query_levels ---------------------- */ #ifndef GL_ARB_texture_query_levels #define GL_ARB_texture_query_levels 1 #define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) #endif /* GL_ARB_texture_query_levels */ /* ------------------------ GL_ARB_texture_query_lod ----------------------- */ #ifndef GL_ARB_texture_query_lod #define GL_ARB_texture_query_lod 1 #define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) #endif /* GL_ARB_texture_query_lod */ /* ------------------------ GL_ARB_texture_rectangle ----------------------- */ #ifndef GL_ARB_texture_rectangle #define GL_ARB_texture_rectangle 1 #define GL_TEXTURE_RECTANGLE_ARB 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 #define GL_SAMPLER_2D_RECT_ARB 0x8B63 #define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 #define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) #endif /* GL_ARB_texture_rectangle */ /* --------------------------- GL_ARB_texture_rg --------------------------- */ #ifndef GL_ARB_texture_rg #define GL_ARB_texture_rg 1 #define GL_COMPRESSED_RED 0x8225 #define GL_COMPRESSED_RG 0x8226 #define GL_RG 0x8227 #define GL_RG_INTEGER 0x8228 #define GL_R8 0x8229 #define GL_R16 0x822A #define GL_RG8 0x822B #define GL_RG16 0x822C #define GL_R16F 0x822D #define GL_R32F 0x822E #define GL_RG16F 0x822F #define GL_RG32F 0x8230 #define GL_R8I 0x8231 #define GL_R8UI 0x8232 #define GL_R16I 0x8233 #define GL_R16UI 0x8234 #define GL_R32I 0x8235 #define GL_R32UI 0x8236 #define GL_RG8I 0x8237 #define GL_RG8UI 0x8238 #define GL_RG16I 0x8239 #define GL_RG16UI 0x823A #define GL_RG32I 0x823B #define GL_RG32UI 0x823C #define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) #endif /* GL_ARB_texture_rg */ /* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ #ifndef GL_ARB_texture_rgb10_a2ui #define GL_ARB_texture_rgb10_a2ui 1 #define GL_RGB10_A2UI 0x906F #define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) #endif /* GL_ARB_texture_rgb10_a2ui */ /* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ #ifndef GL_ARB_texture_stencil8 #define GL_ARB_texture_stencil8 1 #define GL_STENCIL_INDEX 0x1901 #define GL_STENCIL_INDEX8 0x8D48 #define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) #endif /* GL_ARB_texture_stencil8 */ /* ------------------------- GL_ARB_texture_storage ------------------------ */ #ifndef GL_ARB_texture_storage #define GL_ARB_texture_storage 1 #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) #define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) #define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) #define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) #define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) #define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) #define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) #endif /* GL_ARB_texture_storage */ /* ------------------- GL_ARB_texture_storage_multisample ------------------ */ #ifndef GL_ARB_texture_storage_multisample #define GL_ARB_texture_storage_multisample 1 typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); #define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) #define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) #define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) #define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) #define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) #endif /* GL_ARB_texture_storage_multisample */ /* ------------------------- GL_ARB_texture_swizzle ------------------------ */ #ifndef GL_ARB_texture_swizzle #define GL_ARB_texture_swizzle 1 #define GL_TEXTURE_SWIZZLE_R 0x8E42 #define GL_TEXTURE_SWIZZLE_G 0x8E43 #define GL_TEXTURE_SWIZZLE_B 0x8E44 #define GL_TEXTURE_SWIZZLE_A 0x8E45 #define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 #define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) #endif /* GL_ARB_texture_swizzle */ /* -------------------------- GL_ARB_texture_view -------------------------- */ #ifndef GL_ARB_texture_view #define GL_ARB_texture_view 1 #define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB #define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC #define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD #define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); #define glTextureView GLEW_GET_FUN(__glewTextureView) #define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) #endif /* GL_ARB_texture_view */ /* --------------------------- GL_ARB_timer_query -------------------------- */ #ifndef GL_ARB_timer_query #define GL_ARB_timer_query 1 #define GL_TIME_ELAPSED 0x88BF #define GL_TIMESTAMP 0x8E28 typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); #define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) #define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) #define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) #define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) #endif /* GL_ARB_timer_query */ /* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ #ifndef GL_ARB_transform_feedback2 #define GL_ARB_transform_feedback2 1 #define GL_TRANSFORM_FEEDBACK 0x8E22 #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 #define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); #define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) #define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) #define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) #define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) #define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) #define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) #define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) #define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) #endif /* GL_ARB_transform_feedback2 */ /* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ #ifndef GL_ARB_transform_feedback3 #define GL_ARB_transform_feedback3 1 #define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 #define GL_MAX_VERTEX_STREAMS 0x8E71 typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); #define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) #define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) #define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) #define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) #define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) #endif /* GL_ARB_transform_feedback3 */ /* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ #ifndef GL_ARB_transform_feedback_instanced #define GL_ARB_transform_feedback_instanced 1 typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); #define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) #define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) #define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) #endif /* GL_ARB_transform_feedback_instanced */ /* ---------------- GL_ARB_transform_feedback_overflow_query --------------- */ #ifndef GL_ARB_transform_feedback_overflow_query #define GL_ARB_transform_feedback_overflow_query 1 #define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC #define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED #define GLEW_ARB_transform_feedback_overflow_query GLEW_GET_VAR(__GLEW_ARB_transform_feedback_overflow_query) #endif /* GL_ARB_transform_feedback_overflow_query */ /* ------------------------ GL_ARB_transpose_matrix ------------------------ */ #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 #define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 #define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 #define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 #define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); #define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) #define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) #define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) #define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) #define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) #endif /* GL_ARB_transpose_matrix */ /* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ #ifndef GL_ARB_uniform_buffer_object #define GL_ARB_uniform_buffer_object 1 #define GL_UNIFORM_BUFFER 0x8A11 #define GL_UNIFORM_BUFFER_BINDING 0x8A28 #define GL_UNIFORM_BUFFER_START 0x8A29 #define GL_UNIFORM_BUFFER_SIZE 0x8A2A #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B #define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 #define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 #define GL_UNIFORM_TYPE 0x8A37 #define GL_UNIFORM_SIZE 0x8A38 #define GL_UNIFORM_NAME_LENGTH 0x8A39 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A #define GL_UNIFORM_OFFSET 0x8A3B #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E #define GL_UNIFORM_BLOCK_BINDING 0x8A3F #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 #define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 #define GL_INVALID_INDEX 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const * uniformNames, GLuint* uniformIndices); typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); #define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) #define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) #define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) #define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) #define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) #define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) #define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) #define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) #define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) #define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) #define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) #endif /* GL_ARB_uniform_buffer_object */ /* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ #ifndef GL_ARB_vertex_array_bgra #define GL_ARB_vertex_array_bgra 1 #define GL_BGRA 0x80E1 #define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) #endif /* GL_ARB_vertex_array_bgra */ /* ----------------------- GL_ARB_vertex_array_object ---------------------- */ #ifndef GL_ARB_vertex_array_object #define GL_ARB_vertex_array_object 1 #define GL_VERTEX_ARRAY_BINDING 0x85B5 typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); #define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) #define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) #define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) #define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) #define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) #endif /* GL_ARB_vertex_array_object */ /* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ #ifndef GL_ARB_vertex_attrib_64bit #define GL_ARB_vertex_attrib_64bit 1 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); #define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) #define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) #define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) #define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) #define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) #define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) #define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) #define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) #define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) #define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) #define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) #endif /* GL_ARB_vertex_attrib_64bit */ /* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ #ifndef GL_ARB_vertex_attrib_binding #define GL_ARB_vertex_attrib_binding 1 #define GL_VERTEX_ATTRIB_BINDING 0x82D4 #define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 #define GL_VERTEX_BINDING_DIVISOR 0x82D6 #define GL_VERTEX_BINDING_OFFSET 0x82D7 #define GL_VERTEX_BINDING_STRIDE 0x82D8 #define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 #define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA #define GL_VERTEX_BINDING_BUFFER 0x8F4F typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); #define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) #define glVertexArrayBindVertexBufferEXT GLEW_GET_FUN(__glewVertexArrayBindVertexBufferEXT) #define glVertexArrayVertexAttribBindingEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribBindingEXT) #define glVertexArrayVertexAttribFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribFormatEXT) #define glVertexArrayVertexAttribIFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIFormatEXT) #define glVertexArrayVertexAttribLFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLFormatEXT) #define glVertexArrayVertexBindingDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexBindingDivisorEXT) #define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) #define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) #define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) #define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) #define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) #define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) #endif /* GL_ARB_vertex_attrib_binding */ /* -------------------------- GL_ARB_vertex_blend -------------------------- */ #ifndef GL_ARB_vertex_blend #define GL_ARB_vertex_blend 1 #define GL_MODELVIEW0_ARB 0x1700 #define GL_MODELVIEW1_ARB 0x850A #define GL_MAX_VERTEX_UNITS_ARB 0x86A4 #define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 #define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 #define GL_VERTEX_BLEND_ARB 0x86A7 #define GL_CURRENT_WEIGHT_ARB 0x86A8 #define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 #define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA #define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB #define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC #define GL_WEIGHT_ARRAY_ARB 0x86AD #define GL_MODELVIEW2_ARB 0x8722 #define GL_MODELVIEW3_ARB 0x8723 #define GL_MODELVIEW4_ARB 0x8724 #define GL_MODELVIEW5_ARB 0x8725 #define GL_MODELVIEW6_ARB 0x8726 #define GL_MODELVIEW7_ARB 0x8727 #define GL_MODELVIEW8_ARB 0x8728 #define GL_MODELVIEW9_ARB 0x8729 #define GL_MODELVIEW10_ARB 0x872A #define GL_MODELVIEW11_ARB 0x872B #define GL_MODELVIEW12_ARB 0x872C #define GL_MODELVIEW13_ARB 0x872D #define GL_MODELVIEW14_ARB 0x872E #define GL_MODELVIEW15_ARB 0x872F #define GL_MODELVIEW16_ARB 0x8730 #define GL_MODELVIEW17_ARB 0x8731 #define GL_MODELVIEW18_ARB 0x8732 #define GL_MODELVIEW19_ARB 0x8733 #define GL_MODELVIEW20_ARB 0x8734 #define GL_MODELVIEW21_ARB 0x8735 #define GL_MODELVIEW22_ARB 0x8736 #define GL_MODELVIEW23_ARB 0x8737 #define GL_MODELVIEW24_ARB 0x8738 #define GL_MODELVIEW25_ARB 0x8739 #define GL_MODELVIEW26_ARB 0x873A #define GL_MODELVIEW27_ARB 0x873B #define GL_MODELVIEW28_ARB 0x873C #define GL_MODELVIEW29_ARB 0x873D #define GL_MODELVIEW30_ARB 0x873E #define GL_MODELVIEW31_ARB 0x873F typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); #define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) #define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) #define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) #define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) #define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) #define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) #define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) #define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) #define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) #define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) #define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) #endif /* GL_ARB_vertex_blend */ /* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 #define GL_BUFFER_SIZE_ARB 0x8764 #define GL_BUFFER_USAGE_ARB 0x8765 #define GL_ARRAY_BUFFER_ARB 0x8892 #define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 #define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 #define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 #define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 #define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 #define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D #define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F #define GL_READ_ONLY_ARB 0x88B8 #define GL_WRITE_ONLY_ARB 0x88B9 #define GL_READ_WRITE_ARB 0x88BA #define GL_BUFFER_ACCESS_ARB 0x88BB #define GL_BUFFER_MAPPED_ARB 0x88BC #define GL_BUFFER_MAP_POINTER_ARB 0x88BD #define GL_STREAM_DRAW_ARB 0x88E0 #define GL_STREAM_READ_ARB 0x88E1 #define GL_STREAM_COPY_ARB 0x88E2 #define GL_STATIC_DRAW_ARB 0x88E4 #define GL_STATIC_READ_ARB 0x88E5 #define GL_STATIC_COPY_ARB 0x88E6 #define GL_DYNAMIC_DRAW_ARB 0x88E8 #define GL_DYNAMIC_READ_ARB 0x88E9 #define GL_DYNAMIC_COPY_ARB 0x88EA typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); typedef void * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); #define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) #define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) #define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) #define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) #define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) #define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) #define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) #define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) #define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) #define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) #define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) #define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) #endif /* GL_ARB_vertex_buffer_object */ /* ------------------------- GL_ARB_vertex_program ------------------------- */ #ifndef GL_ARB_vertex_program #define GL_ARB_vertex_program 1 #define GL_COLOR_SUM_ARB 0x8458 #define GL_VERTEX_PROGRAM_ARB 0x8620 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 #define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 #define GL_PROGRAM_LENGTH_ARB 0x8627 #define GL_PROGRAM_STRING_ARB 0x8628 #define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E #define GL_MAX_PROGRAM_MATRICES_ARB 0x862F #define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 #define GL_CURRENT_MATRIX_ARB 0x8641 #define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 #define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 #define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 #define GL_PROGRAM_ERROR_POSITION_ARB 0x864B #define GL_PROGRAM_BINDING_ARB 0x8677 #define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A #define GL_PROGRAM_ERROR_STRING_ARB 0x8874 #define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 #define GL_PROGRAM_FORMAT_ARB 0x8876 #define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 #define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 #define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 #define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 #define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 #define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 #define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 #define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 #define GL_PROGRAM_PARAMETERS_ARB 0x88A8 #define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 #define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA #define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB #define GL_PROGRAM_ATTRIBS_ARB 0x88AC #define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD #define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE #define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF #define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 #define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 #define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 #define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 #define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 #define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 #define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 #define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 #define GL_MATRIX0_ARB 0x88C0 #define GL_MATRIX1_ARB 0x88C1 #define GL_MATRIX2_ARB 0x88C2 #define GL_MATRIX3_ARB 0x88C3 #define GL_MATRIX4_ARB 0x88C4 #define GL_MATRIX5_ARB 0x88C5 #define GL_MATRIX6_ARB 0x88C6 #define GL_MATRIX7_ARB 0x88C7 #define GL_MATRIX8_ARB 0x88C8 #define GL_MATRIX9_ARB 0x88C9 #define GL_MATRIX10_ARB 0x88CA #define GL_MATRIX11_ARB 0x88CB #define GL_MATRIX12_ARB 0x88CC #define GL_MATRIX13_ARB 0x88CD #define GL_MATRIX14_ARB 0x88CE #define GL_MATRIX15_ARB 0x88CF #define GL_MATRIX16_ARB 0x88D0 #define GL_MATRIX17_ARB 0x88D1 #define GL_MATRIX18_ARB 0x88D2 #define GL_MATRIX19_ARB 0x88D3 #define GL_MATRIX20_ARB 0x88D4 #define GL_MATRIX21_ARB 0x88D5 #define GL_MATRIX22_ARB 0x88D6 #define GL_MATRIX23_ARB 0x88D7 #define GL_MATRIX24_ARB 0x88D8 #define GL_MATRIX25_ARB 0x88D9 #define GL_MATRIX26_ARB 0x88DA #define GL_MATRIX27_ARB 0x88DB #define GL_MATRIX28_ARB 0x88DC #define GL_MATRIX29_ARB 0x88DD #define GL_MATRIX30_ARB 0x88DE #define GL_MATRIX31_ARB 0x88DF typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); #define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) #define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) #define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) #define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) #define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) #define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) #define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) #define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) #define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) #define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) #define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) #define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) #define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) #define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) #define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) #define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) #define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) #define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) #define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) #define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) #define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) #define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) #define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) #define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) #define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) #define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) #define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) #define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) #define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) #define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) #define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) #define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) #define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) #define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) #define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) #define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) #define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) #define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) #define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) #define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) #define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) #define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) #define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) #define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) #define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) #define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) #define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) #define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) #define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) #define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) #define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) #define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) #define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) #define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) #define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) #define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) #define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) #define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) #define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) #define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) #define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) #define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) #define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) #endif /* GL_ARB_vertex_program */ /* -------------------------- GL_ARB_vertex_shader ------------------------- */ #ifndef GL_ARB_vertex_shader #define GL_ARB_vertex_shader 1 #define GL_VERTEX_SHADER_ARB 0x8B31 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A #define GL_MAX_VARYING_FLOATS_ARB 0x8B4B #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D #define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 #define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); #define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) #define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) #define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) #define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) #endif /* GL_ARB_vertex_shader */ /* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ #ifndef GL_ARB_vertex_type_10f_11f_11f_rev #define GL_ARB_vertex_type_10f_11f_11f_rev 1 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B #define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) #endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ /* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ #ifndef GL_ARB_vertex_type_2_10_10_10_rev #define GL_ARB_vertex_type_2_10_10_10_rev 1 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #define GL_INT_2_10_10_10_REV 0x8D9F typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); #define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) #define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) #define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) #define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) #define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) #define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) #define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) #define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) #define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) #define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) #define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) #define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) #define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) #define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) #define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) #define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) #define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) #define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) #define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) #define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) #define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) #define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) #define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) #define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) #define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) #define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) #define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) #define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) #define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) #define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) #define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) #define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) #define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) #define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) #define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) #define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) #define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) #define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) #define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) #endif /* GL_ARB_vertex_type_2_10_10_10_rev */ /* ------------------------- GL_ARB_viewport_array ------------------------- */ #ifndef GL_ARB_viewport_array #define GL_ARB_viewport_array 1 #define GL_DEPTH_RANGE 0x0B70 #define GL_VIEWPORT 0x0BA2 #define GL_SCISSOR_BOX 0x0C10 #define GL_SCISSOR_TEST 0x0C11 #define GL_MAX_VIEWPORTS 0x825B #define GL_VIEWPORT_SUBPIXEL_BITS 0x825C #define GL_VIEWPORT_BOUNDS_RANGE 0x825D #define GL_LAYER_PROVOKING_VERTEX 0x825E #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F #define GL_UNDEFINED_VERTEX 0x8260 #define GL_FIRST_VERTEX_CONVENTION 0x8E4D #define GL_LAST_VERTEX_CONVENTION 0x8E4E #define GL_PROVOKING_VERTEX 0x8E4F typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); #define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) #define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) #define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) #define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) #define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) #define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) #define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) #define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) #define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) #define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) #define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) #endif /* GL_ARB_viewport_array */ /* --------------------------- GL_ARB_window_pos --------------------------- */ #ifndef GL_ARB_window_pos #define GL_ARB_window_pos 1 typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); #define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) #define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) #define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) #define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) #define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) #define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) #define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) #define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) #define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) #define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) #define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) #define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) #define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) #define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) #define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) #define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) #define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) #endif /* GL_ARB_window_pos */ /* ------------------------- GL_ATIX_point_sprites ------------------------- */ #ifndef GL_ATIX_point_sprites #define GL_ATIX_point_sprites 1 #define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 #define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 #define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 #define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 #define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 #define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 #define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) #endif /* GL_ATIX_point_sprites */ /* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ #ifndef GL_ATIX_texture_env_combine3 #define GL_ATIX_texture_env_combine3 1 #define GL_MODULATE_ADD_ATIX 0x8744 #define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 #define GL_MODULATE_SUBTRACT_ATIX 0x8746 #define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) #endif /* GL_ATIX_texture_env_combine3 */ /* ----------------------- GL_ATIX_texture_env_route ----------------------- */ #ifndef GL_ATIX_texture_env_route #define GL_ATIX_texture_env_route 1 #define GL_SECONDARY_COLOR_ATIX 0x8747 #define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 #define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 #define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) #endif /* GL_ATIX_texture_env_route */ /* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ #ifndef GL_ATIX_vertex_shader_output_point_size #define GL_ATIX_vertex_shader_output_point_size 1 #define GL_OUTPUT_POINT_SIZE_ATIX 0x610E #define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) #endif /* GL_ATIX_vertex_shader_output_point_size */ /* -------------------------- GL_ATI_draw_buffers -------------------------- */ #ifndef GL_ATI_draw_buffers #define GL_ATI_draw_buffers 1 #define GL_MAX_DRAW_BUFFERS_ATI 0x8824 #define GL_DRAW_BUFFER0_ATI 0x8825 #define GL_DRAW_BUFFER1_ATI 0x8826 #define GL_DRAW_BUFFER2_ATI 0x8827 #define GL_DRAW_BUFFER3_ATI 0x8828 #define GL_DRAW_BUFFER4_ATI 0x8829 #define GL_DRAW_BUFFER5_ATI 0x882A #define GL_DRAW_BUFFER6_ATI 0x882B #define GL_DRAW_BUFFER7_ATI 0x882C #define GL_DRAW_BUFFER8_ATI 0x882D #define GL_DRAW_BUFFER9_ATI 0x882E #define GL_DRAW_BUFFER10_ATI 0x882F #define GL_DRAW_BUFFER11_ATI 0x8830 #define GL_DRAW_BUFFER12_ATI 0x8831 #define GL_DRAW_BUFFER13_ATI 0x8832 #define GL_DRAW_BUFFER14_ATI 0x8833 #define GL_DRAW_BUFFER15_ATI 0x8834 typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); #define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) #define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) #endif /* GL_ATI_draw_buffers */ /* -------------------------- GL_ATI_element_array ------------------------- */ #ifndef GL_ATI_element_array #define GL_ATI_element_array 1 #define GL_ELEMENT_ARRAY_ATI 0x8768 #define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 #define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); #define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) #define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) #define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) #define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) #endif /* GL_ATI_element_array */ /* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ #ifndef GL_ATI_envmap_bumpmap #define GL_ATI_envmap_bumpmap 1 #define GL_BUMP_ROT_MATRIX_ATI 0x8775 #define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 #define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 #define GL_BUMP_TEX_UNITS_ATI 0x8778 #define GL_DUDV_ATI 0x8779 #define GL_DU8DV8_ATI 0x877A #define GL_BUMP_ENVMAP_ATI 0x877B #define GL_BUMP_TARGET_ATI 0x877C typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); #define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) #define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) #define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) #define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) #define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) #endif /* GL_ATI_envmap_bumpmap */ /* ------------------------- GL_ATI_fragment_shader ------------------------ */ #ifndef GL_ATI_fragment_shader #define GL_ATI_fragment_shader 1 #define GL_2X_BIT_ATI 0x00000001 #define GL_RED_BIT_ATI 0x00000001 #define GL_4X_BIT_ATI 0x00000002 #define GL_COMP_BIT_ATI 0x00000002 #define GL_GREEN_BIT_ATI 0x00000002 #define GL_8X_BIT_ATI 0x00000004 #define GL_BLUE_BIT_ATI 0x00000004 #define GL_NEGATE_BIT_ATI 0x00000004 #define GL_BIAS_BIT_ATI 0x00000008 #define GL_HALF_BIT_ATI 0x00000008 #define GL_QUARTER_BIT_ATI 0x00000010 #define GL_EIGHTH_BIT_ATI 0x00000020 #define GL_SATURATE_BIT_ATI 0x00000040 #define GL_FRAGMENT_SHADER_ATI 0x8920 #define GL_REG_0_ATI 0x8921 #define GL_REG_1_ATI 0x8922 #define GL_REG_2_ATI 0x8923 #define GL_REG_3_ATI 0x8924 #define GL_REG_4_ATI 0x8925 #define GL_REG_5_ATI 0x8926 #define GL_CON_0_ATI 0x8941 #define GL_CON_1_ATI 0x8942 #define GL_CON_2_ATI 0x8943 #define GL_CON_3_ATI 0x8944 #define GL_CON_4_ATI 0x8945 #define GL_CON_5_ATI 0x8946 #define GL_CON_6_ATI 0x8947 #define GL_CON_7_ATI 0x8948 #define GL_MOV_ATI 0x8961 #define GL_ADD_ATI 0x8963 #define GL_MUL_ATI 0x8964 #define GL_SUB_ATI 0x8965 #define GL_DOT3_ATI 0x8966 #define GL_DOT4_ATI 0x8967 #define GL_MAD_ATI 0x8968 #define GL_LERP_ATI 0x8969 #define GL_CND_ATI 0x896A #define GL_CND0_ATI 0x896B #define GL_DOT2_ADD_ATI 0x896C #define GL_SECONDARY_INTERPOLATOR_ATI 0x896D #define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E #define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F #define GL_NUM_PASSES_ATI 0x8970 #define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 #define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 #define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 #define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 #define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 #define GL_SWIZZLE_STR_ATI 0x8976 #define GL_SWIZZLE_STQ_ATI 0x8977 #define GL_SWIZZLE_STR_DR_ATI 0x8978 #define GL_SWIZZLE_STQ_DQ_ATI 0x8979 #define GL_SWIZZLE_STRQ_ATI 0x897A #define GL_SWIZZLE_STRQ_DQ_ATI 0x897B typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); #define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) #define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) #define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) #define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) #define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) #define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) #define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) #define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) #define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) #define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) #define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) #define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) #define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) #define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) #define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) #endif /* GL_ATI_fragment_shader */ /* ------------------------ GL_ATI_map_object_buffer ----------------------- */ #ifndef GL_ATI_map_object_buffer #define GL_ATI_map_object_buffer 1 typedef void * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); #define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) #define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) #define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) #endif /* GL_ATI_map_object_buffer */ /* ----------------------------- GL_ATI_meminfo ---------------------------- */ #ifndef GL_ATI_meminfo #define GL_ATI_meminfo 1 #define GL_VBO_FREE_MEMORY_ATI 0x87FB #define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC #define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD #define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) #endif /* GL_ATI_meminfo */ /* -------------------------- GL_ATI_pn_triangles -------------------------- */ #ifndef GL_ATI_pn_triangles #define GL_ATI_pn_triangles 1 #define GL_PN_TRIANGLES_ATI 0x87F0 #define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 #define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 #define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 #define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 #define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 #define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 #define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 #define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); #define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) #define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) #define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) #endif /* GL_ATI_pn_triangles */ /* ------------------------ GL_ATI_separate_stencil ------------------------ */ #ifndef GL_ATI_separate_stencil #define GL_ATI_separate_stencil 1 #define GL_STENCIL_BACK_FUNC_ATI 0x8800 #define GL_STENCIL_BACK_FAIL_ATI 0x8801 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 #define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); #define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) #define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) #define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) #endif /* GL_ATI_separate_stencil */ /* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ #ifndef GL_ATI_shader_texture_lod #define GL_ATI_shader_texture_lod 1 #define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) #endif /* GL_ATI_shader_texture_lod */ /* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ #ifndef GL_ATI_text_fragment_shader #define GL_ATI_text_fragment_shader 1 #define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 #define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) #endif /* GL_ATI_text_fragment_shader */ /* --------------------- GL_ATI_texture_compression_3dc -------------------- */ #ifndef GL_ATI_texture_compression_3dc #define GL_ATI_texture_compression_3dc 1 #define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 #define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) #endif /* GL_ATI_texture_compression_3dc */ /* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ #ifndef GL_ATI_texture_env_combine3 #define GL_ATI_texture_env_combine3 1 #define GL_MODULATE_ADD_ATI 0x8744 #define GL_MODULATE_SIGNED_ADD_ATI 0x8745 #define GL_MODULATE_SUBTRACT_ATI 0x8746 #define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) #endif /* GL_ATI_texture_env_combine3 */ /* -------------------------- GL_ATI_texture_float ------------------------- */ #ifndef GL_ATI_texture_float #define GL_ATI_texture_float 1 #define GL_RGBA_FLOAT32_ATI 0x8814 #define GL_RGB_FLOAT32_ATI 0x8815 #define GL_ALPHA_FLOAT32_ATI 0x8816 #define GL_INTENSITY_FLOAT32_ATI 0x8817 #define GL_LUMINANCE_FLOAT32_ATI 0x8818 #define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 #define GL_RGBA_FLOAT16_ATI 0x881A #define GL_RGB_FLOAT16_ATI 0x881B #define GL_ALPHA_FLOAT16_ATI 0x881C #define GL_INTENSITY_FLOAT16_ATI 0x881D #define GL_LUMINANCE_FLOAT16_ATI 0x881E #define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F #define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) #endif /* GL_ATI_texture_float */ /* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ #ifndef GL_ATI_texture_mirror_once #define GL_ATI_texture_mirror_once 1 #define GL_MIRROR_CLAMP_ATI 0x8742 #define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 #define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) #endif /* GL_ATI_texture_mirror_once */ /* ----------------------- GL_ATI_vertex_array_object ---------------------- */ #ifndef GL_ATI_vertex_array_object #define GL_ATI_vertex_array_object 1 #define GL_STATIC_ATI 0x8760 #define GL_DYNAMIC_ATI 0x8761 #define GL_PRESERVE_ATI 0x8762 #define GL_DISCARD_ATI 0x8763 #define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 #define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 #define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 #define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); #define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) #define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) #define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) #define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) #define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) #define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) #define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) #define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) #define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) #define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) #define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) #define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) #define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) #endif /* GL_ATI_vertex_array_object */ /* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ #ifndef GL_ATI_vertex_attrib_array_object #define GL_ATI_vertex_attrib_array_object 1 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); #define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) #define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) #define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) #define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) #endif /* GL_ATI_vertex_attrib_array_object */ /* ------------------------- GL_ATI_vertex_streams ------------------------- */ #ifndef GL_ATI_vertex_streams #define GL_ATI_vertex_streams 1 #define GL_MAX_VERTEX_STREAMS_ATI 0x876B #define GL_VERTEX_SOURCE_ATI 0x876C #define GL_VERTEX_STREAM0_ATI 0x876D #define GL_VERTEX_STREAM1_ATI 0x876E #define GL_VERTEX_STREAM2_ATI 0x876F #define GL_VERTEX_STREAM3_ATI 0x8770 #define GL_VERTEX_STREAM4_ATI 0x8771 #define GL_VERTEX_STREAM5_ATI 0x8772 #define GL_VERTEX_STREAM6_ATI 0x8773 #define GL_VERTEX_STREAM7_ATI 0x8774 typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); #define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) #define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) #define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) #define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) #define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) #define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) #define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) #define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) #define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) #define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) #define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) #define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) #define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) #define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) #define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) #define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) #define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) #define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) #define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) #define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) #define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) #define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) #define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) #define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) #define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) #define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) #define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) #define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) #define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) #define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) #define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) #define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) #define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) #define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) #define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) #define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) #define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) #define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) #define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) #define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) #define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) #define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) #define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) #define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) #define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) #define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) #endif /* GL_ATI_vertex_streams */ /* --------------------------- GL_EXT_422_pixels --------------------------- */ #ifndef GL_EXT_422_pixels #define GL_EXT_422_pixels 1 #define GL_422_EXT 0x80CC #define GL_422_REV_EXT 0x80CD #define GL_422_AVERAGE_EXT 0x80CE #define GL_422_REV_AVERAGE_EXT 0x80CF #define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) #endif /* GL_EXT_422_pixels */ /* ---------------------------- GL_EXT_Cg_shader --------------------------- */ #ifndef GL_EXT_Cg_shader #define GL_EXT_Cg_shader 1 #define GL_CG_VERTEX_SHADER_EXT 0x890E #define GL_CG_FRAGMENT_SHADER_EXT 0x890F #define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) #endif /* GL_EXT_Cg_shader */ /* ------------------------------ GL_EXT_abgr ------------------------------ */ #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #define GL_ABGR_EXT 0x8000 #define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) #endif /* GL_EXT_abgr */ /* ------------------------------ GL_EXT_bgra ------------------------------ */ #ifndef GL_EXT_bgra #define GL_EXT_bgra 1 #define GL_BGR_EXT 0x80E0 #define GL_BGRA_EXT 0x80E1 #define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) #endif /* GL_EXT_bgra */ /* ------------------------ GL_EXT_bindable_uniform ------------------------ */ #ifndef GL_EXT_bindable_uniform #define GL_EXT_bindable_uniform 1 #define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 #define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 #define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 #define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED #define GL_UNIFORM_BUFFER_EXT 0x8DEE #define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); #define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) #define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) #define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) #define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) #endif /* GL_EXT_bindable_uniform */ /* --------------------------- GL_EXT_blend_color -------------------------- */ #ifndef GL_EXT_blend_color #define GL_EXT_blend_color 1 #define GL_CONSTANT_COLOR_EXT 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 #define GL_CONSTANT_ALPHA_EXT 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 #define GL_BLEND_COLOR_EXT 0x8005 typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); #define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) #define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) #endif /* GL_EXT_blend_color */ /* --------------------- GL_EXT_blend_equation_separate -------------------- */ #ifndef GL_EXT_blend_equation_separate #define GL_EXT_blend_equation_separate 1 #define GL_BLEND_EQUATION_RGB_EXT 0x8009 #define GL_BLEND_EQUATION_ALPHA_EXT 0x883D typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); #define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) #define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) #endif /* GL_EXT_blend_equation_separate */ /* ----------------------- GL_EXT_blend_func_separate ---------------------- */ #ifndef GL_EXT_blend_func_separate #define GL_EXT_blend_func_separate 1 #define GL_BLEND_DST_RGB_EXT 0x80C8 #define GL_BLEND_SRC_RGB_EXT 0x80C9 #define GL_BLEND_DST_ALPHA_EXT 0x80CA #define GL_BLEND_SRC_ALPHA_EXT 0x80CB typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) #define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) #endif /* GL_EXT_blend_func_separate */ /* ------------------------- GL_EXT_blend_logic_op ------------------------- */ #ifndef GL_EXT_blend_logic_op #define GL_EXT_blend_logic_op 1 #define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) #endif /* GL_EXT_blend_logic_op */ /* -------------------------- GL_EXT_blend_minmax -------------------------- */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 #define GL_FUNC_ADD_EXT 0x8006 #define GL_MIN_EXT 0x8007 #define GL_MAX_EXT 0x8008 #define GL_BLEND_EQUATION_EXT 0x8009 typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) #define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) #endif /* GL_EXT_blend_minmax */ /* ------------------------- GL_EXT_blend_subtract ------------------------- */ #ifndef GL_EXT_blend_subtract #define GL_EXT_blend_subtract 1 #define GL_FUNC_SUBTRACT_EXT 0x800A #define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B #define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) #endif /* GL_EXT_blend_subtract */ /* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ #ifndef GL_EXT_clip_volume_hint #define GL_EXT_clip_volume_hint 1 #define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 #define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) #endif /* GL_EXT_clip_volume_hint */ /* ------------------------------ GL_EXT_cmyka ----------------------------- */ #ifndef GL_EXT_cmyka #define GL_EXT_cmyka 1 #define GL_CMYK_EXT 0x800C #define GL_CMYKA_EXT 0x800D #define GL_PACK_CMYK_HINT_EXT 0x800E #define GL_UNPACK_CMYK_HINT_EXT 0x800F #define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) #endif /* GL_EXT_cmyka */ /* ------------------------- GL_EXT_color_subtable ------------------------- */ #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) #define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) #define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) #endif /* GL_EXT_color_subtable */ /* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ #ifndef GL_EXT_compiled_vertex_array #define GL_EXT_compiled_vertex_array 1 #define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 #define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); #define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) #define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) #define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) #endif /* GL_EXT_compiled_vertex_array */ /* --------------------------- GL_EXT_convolution -------------------------- */ #ifndef GL_EXT_convolution #define GL_EXT_convolution 1 #define GL_CONVOLUTION_1D_EXT 0x8010 #define GL_CONVOLUTION_2D_EXT 0x8011 #define GL_SEPARABLE_2D_EXT 0x8012 #define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 #define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 #define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 #define GL_REDUCE_EXT 0x8016 #define GL_CONVOLUTION_FORMAT_EXT 0x8017 #define GL_CONVOLUTION_WIDTH_EXT 0x8018 #define GL_CONVOLUTION_HEIGHT_EXT 0x8019 #define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A #define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B #define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C #define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D #define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E #define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F #define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 #define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); #define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) #define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) #define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) #define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) #define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) #define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) #define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) #define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) #define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) #define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) #define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) #define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) #define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) #define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) #endif /* GL_EXT_convolution */ /* ------------------------ GL_EXT_coordinate_frame ------------------------ */ #ifndef GL_EXT_coordinate_frame #define GL_EXT_coordinate_frame 1 #define GL_TANGENT_ARRAY_EXT 0x8439 #define GL_BINORMAL_ARRAY_EXT 0x843A #define GL_CURRENT_TANGENT_EXT 0x843B #define GL_CURRENT_BINORMAL_EXT 0x843C #define GL_TANGENT_ARRAY_TYPE_EXT 0x843E #define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F #define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 #define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 #define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 #define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 #define GL_MAP1_TANGENT_EXT 0x8444 #define GL_MAP2_TANGENT_EXT 0x8445 #define GL_MAP1_BINORMAL_EXT 0x8446 #define GL_MAP2_BINORMAL_EXT 0x8447 typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); #define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) #define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) #define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) #endif /* GL_EXT_coordinate_frame */ /* -------------------------- GL_EXT_copy_texture -------------------------- */ #ifndef GL_EXT_copy_texture #define GL_EXT_copy_texture 1 typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) #define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) #define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) #define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) #define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) #define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) #endif /* GL_EXT_copy_texture */ /* --------------------------- GL_EXT_cull_vertex -------------------------- */ #ifndef GL_EXT_cull_vertex #define GL_EXT_cull_vertex 1 #define GL_CULL_VERTEX_EXT 0x81AA #define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB #define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); #define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) #define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) #define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) #endif /* GL_EXT_cull_vertex */ /* --------------------------- GL_EXT_debug_label -------------------------- */ #ifndef GL_EXT_debug_label #define GL_EXT_debug_label 1 #define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F #define GL_PROGRAM_OBJECT_EXT 0x8B40 #define GL_SHADER_OBJECT_EXT 0x8B48 #define GL_BUFFER_OBJECT_EXT 0x9151 #define GL_QUERY_OBJECT_EXT 0x9153 #define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label); typedef void (GLAPIENTRY * PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar* label); #define glGetObjectLabelEXT GLEW_GET_FUN(__glewGetObjectLabelEXT) #define glLabelObjectEXT GLEW_GET_FUN(__glewLabelObjectEXT) #define GLEW_EXT_debug_label GLEW_GET_VAR(__GLEW_EXT_debug_label) #endif /* GL_EXT_debug_label */ /* -------------------------- GL_EXT_debug_marker -------------------------- */ #ifndef GL_EXT_debug_marker #define GL_EXT_debug_marker 1 typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); #define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) #define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) #define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) #define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) #endif /* GL_EXT_debug_marker */ /* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 #define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 #define GL_DEPTH_BOUNDS_EXT 0x8891 typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); #define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) #define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) #endif /* GL_EXT_depth_bounds_test */ /* ----------------------- GL_EXT_direct_state_access ---------------------- */ #ifndef GL_EXT_direct_state_access #define GL_EXT_direct_state_access 1 #define GL_PROGRAM_MATRIX_EXT 0x8E2D #define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E #define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void *img); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void *img); typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void** params); typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void** params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void** param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void** param); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); #define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) #define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) #define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) #define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) #define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) #define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) #define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) #define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) #define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) #define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) #define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) #define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) #define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) #define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) #define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) #define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) #define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) #define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) #define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) #define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) #define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) #define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) #define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) #define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) #define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) #define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) #define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) #define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) #define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) #define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) #define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) #define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) #define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) #define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) #define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) #define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) #define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) #define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) #define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) #define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) #define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) #define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) #define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) #define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) #define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) #define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) #define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) #define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) #define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) #define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) #define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) #define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) #define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) #define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) #define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) #define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) #define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) #define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) #define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) #define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) #define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) #define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) #define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) #define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) #define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) #define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) #define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) #define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) #define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) #define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) #define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) #define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) #define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) #define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) #define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) #define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) #define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) #define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) #define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) #define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) #define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) #define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) #define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) #define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) #define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) #define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) #define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) #define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) #define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) #define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) #define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) #define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) #define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) #define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) #define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) #define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) #define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) #define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) #define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) #define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) #define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) #define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) #define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) #define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) #define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) #define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) #define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) #define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) #define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) #define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) #define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) #define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) #define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) #define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) #define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) #define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) #define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) #define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) #define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) #define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) #define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) #define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) #define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) #define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) #define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) #define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) #define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) #define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) #define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) #define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) #define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) #define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) #define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) #define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) #define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) #define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) #define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) #define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) #define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) #define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) #define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) #define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) #define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) #define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) #define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) #define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) #define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) #define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) #define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) #define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) #define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) #define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) #define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) #define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) #define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) #define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) #define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) #define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) #define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) #define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) #define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) #define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) #define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) #define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) #define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) #define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) #define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) #define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) #define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) #define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) #define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) #define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) #define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) #define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) #define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) #define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) #define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) #define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) #define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) #define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) #define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) #define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) #define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) #define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) #define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) #define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) #define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) #define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) #define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) #define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) #define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) #define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) #define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) #define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) #define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) #define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) #define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) #define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) #define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) #define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) #define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) #define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) #define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) #define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) #define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) #define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) #define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) #define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) #define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) #define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) #define glVertexArrayVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribDivisorEXT) #define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) #define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) #define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) #define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) #endif /* GL_EXT_direct_state_access */ /* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ #ifndef GL_EXT_draw_buffers2 #define GL_EXT_draw_buffers2 1 typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); #define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) #define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) #define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) #define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) #define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) #define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) #define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) #endif /* GL_EXT_draw_buffers2 */ /* ------------------------- GL_EXT_draw_instanced ------------------------- */ #ifndef GL_EXT_draw_instanced #define GL_EXT_draw_instanced 1 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) #define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) #define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) #endif /* GL_EXT_draw_instanced */ /* ----------------------- GL_EXT_draw_range_elements ---------------------- */ #ifndef GL_EXT_draw_range_elements #define GL_EXT_draw_range_elements 1 #define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 #define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); #define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) #define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) #endif /* GL_EXT_draw_range_elements */ /* ---------------------------- GL_EXT_fog_coord --------------------------- */ #ifndef GL_EXT_fog_coord #define GL_EXT_fog_coord 1 #define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 #define GL_FOG_COORDINATE_EXT 0x8451 #define GL_FRAGMENT_DEPTH_EXT 0x8452 #define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 #define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 #define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 #define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 #define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); #define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) #define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) #define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) #define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) #define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) #define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) #endif /* GL_EXT_fog_coord */ /* ------------------------ GL_EXT_fragment_lighting ----------------------- */ #ifndef GL_EXT_fragment_lighting #define GL_EXT_fragment_lighting 1 #define GL_FRAGMENT_LIGHTING_EXT 0x8400 #define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 #define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 #define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 #define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 #define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 #define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 #define GL_LIGHT_ENV_MODE_EXT 0x8407 #define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 #define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 #define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A #define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B #define GL_FRAGMENT_LIGHT0_EXT 0x840C #define GL_FRAGMENT_LIGHT7_EXT 0x8413 typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); #define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) #define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) #define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) #define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) #define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) #define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) #define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) #define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) #define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) #define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) #define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) #define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) #define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) #define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) #define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) #define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) #define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) #define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) #define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) #endif /* GL_EXT_fragment_lighting */ /* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ #ifndef GL_EXT_framebuffer_blit #define GL_EXT_framebuffer_blit 1 #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) #define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) #endif /* GL_EXT_framebuffer_blit */ /* --------------------- GL_EXT_framebuffer_multisample -------------------- */ #ifndef GL_EXT_framebuffer_multisample #define GL_EXT_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 #define GL_MAX_SAMPLES_EXT 0x8D57 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) #define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) #endif /* GL_EXT_framebuffer_multisample */ /* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ #ifndef GL_EXT_framebuffer_multisample_blit_scaled #define GL_EXT_framebuffer_multisample_blit_scaled 1 #define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA #define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB #define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) #endif /* GL_EXT_framebuffer_multisample_blit_scaled */ /* ----------------------- GL_EXT_framebuffer_object ----------------------- */ #ifndef GL_EXT_framebuffer_object #define GL_EXT_framebuffer_object 1 #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC #define GL_COLOR_ATTACHMENT13_EXT 0x8CED #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 #define GL_FRAMEBUFFER_EXT 0x8D40 #define GL_RENDERBUFFER_EXT 0x8D41 #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 #define GL_STENCIL_INDEX1_EXT 0x8D46 #define GL_STENCIL_INDEX4_EXT 0x8D47 #define GL_STENCIL_INDEX8_EXT 0x8D48 #define GL_STENCIL_INDEX16_EXT 0x8D49 #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); #define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) #define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) #define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) #define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) #define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) #define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) #define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) #define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) #define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) #define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) #define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) #define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) #define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) #define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) #define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) #define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) #define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) #define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) #endif /* GL_EXT_framebuffer_object */ /* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ #ifndef GL_EXT_framebuffer_sRGB #define GL_EXT_framebuffer_sRGB 1 #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 #define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA #define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) #endif /* GL_EXT_framebuffer_sRGB */ /* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ #ifndef GL_EXT_geometry_shader4 #define GL_EXT_geometry_shader4 1 #define GL_LINES_ADJACENCY_EXT 0xA #define GL_LINE_STRIP_ADJACENCY_EXT 0xB #define GL_TRIANGLES_ADJACENCY_EXT 0xC #define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD #define GL_PROGRAM_POINT_SIZE_EXT 0x8642 #define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 #define GL_GEOMETRY_SHADER_EXT 0x8DD9 #define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA #define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB #define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC #define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD #define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); #define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) #define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) #define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) #define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) #endif /* GL_EXT_geometry_shader4 */ /* --------------------- GL_EXT_gpu_program_parameters --------------------- */ #ifndef GL_EXT_gpu_program_parameters #define GL_EXT_gpu_program_parameters 1 typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); #define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) #define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) #define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) #endif /* GL_EXT_gpu_program_parameters */ /* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ #ifndef GL_EXT_gpu_shader4 #define GL_EXT_gpu_shader4 1 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD #define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 #define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 #define GL_SAMPLER_BUFFER_EXT 0x8DC2 #define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 #define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 #define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 #define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 #define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 #define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 #define GL_INT_SAMPLER_1D_EXT 0x8DC9 #define GL_INT_SAMPLER_2D_EXT 0x8DCA #define GL_INT_SAMPLER_3D_EXT 0x8DCB #define GL_INT_SAMPLER_CUBE_EXT 0x8DCC #define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD #define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE #define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF #define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 #define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 #define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 #define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 #define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 #define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 #define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); #define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) #define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) #define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) #define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) #define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) #define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) #define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) #define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) #define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) #define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) #define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) #define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) #define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) #define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) #define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) #define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) #define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) #define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) #define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) #define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) #define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) #define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) #define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) #define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) #define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) #define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) #define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) #define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) #define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) #define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) #define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) #define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) #define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) #define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) #define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) #endif /* GL_EXT_gpu_shader4 */ /* ---------------------------- GL_EXT_histogram --------------------------- */ #ifndef GL_EXT_histogram #define GL_EXT_histogram 1 #define GL_HISTOGRAM_EXT 0x8024 #define GL_PROXY_HISTOGRAM_EXT 0x8025 #define GL_HISTOGRAM_WIDTH_EXT 0x8026 #define GL_HISTOGRAM_FORMAT_EXT 0x8027 #define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 #define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 #define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A #define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B #define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C #define GL_HISTOGRAM_SINK_EXT 0x802D #define GL_MINMAX_EXT 0x802E #define GL_MINMAX_FORMAT_EXT 0x802F #define GL_MINMAX_SINK_EXT 0x8030 typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); #define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) #define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) #define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) #define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) #define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) #define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) #define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) #define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) #define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) #define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) #define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) #endif /* GL_EXT_histogram */ /* ----------------------- GL_EXT_index_array_formats ---------------------- */ #ifndef GL_EXT_index_array_formats #define GL_EXT_index_array_formats 1 #define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) #endif /* GL_EXT_index_array_formats */ /* --------------------------- GL_EXT_index_func --------------------------- */ #ifndef GL_EXT_index_func #define GL_EXT_index_func 1 typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); #define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) #define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) #endif /* GL_EXT_index_func */ /* ------------------------- GL_EXT_index_material ------------------------- */ #ifndef GL_EXT_index_material #define GL_EXT_index_material 1 typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) #define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) #endif /* GL_EXT_index_material */ /* -------------------------- GL_EXT_index_texture ------------------------- */ #ifndef GL_EXT_index_texture #define GL_EXT_index_texture 1 #define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) #endif /* GL_EXT_index_texture */ /* -------------------------- GL_EXT_light_texture ------------------------- */ #ifndef GL_EXT_light_texture #define GL_EXT_light_texture 1 #define GL_FRAGMENT_MATERIAL_EXT 0x8349 #define GL_FRAGMENT_NORMAL_EXT 0x834A #define GL_FRAGMENT_COLOR_EXT 0x834C #define GL_ATTENUATION_EXT 0x834D #define GL_SHADOW_ATTENUATION_EXT 0x834E #define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F #define GL_TEXTURE_LIGHT_EXT 0x8350 #define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 #define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); #define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) #define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) #define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) #define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) #endif /* GL_EXT_light_texture */ /* ------------------------- GL_EXT_misc_attribute ------------------------- */ #ifndef GL_EXT_misc_attribute #define GL_EXT_misc_attribute 1 #define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) #endif /* GL_EXT_misc_attribute */ /* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount); #define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) #define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) #define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) #endif /* GL_EXT_multi_draw_arrays */ /* --------------------------- GL_EXT_multisample -------------------------- */ #ifndef GL_EXT_multisample #define GL_EXT_multisample 1 #define GL_MULTISAMPLE_EXT 0x809D #define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E #define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F #define GL_SAMPLE_MASK_EXT 0x80A0 #define GL_1PASS_EXT 0x80A1 #define GL_2PASS_0_EXT 0x80A2 #define GL_2PASS_1_EXT 0x80A3 #define GL_4PASS_0_EXT 0x80A4 #define GL_4PASS_1_EXT 0x80A5 #define GL_4PASS_2_EXT 0x80A6 #define GL_4PASS_3_EXT 0x80A7 #define GL_SAMPLE_BUFFERS_EXT 0x80A8 #define GL_SAMPLES_EXT 0x80A9 #define GL_SAMPLE_MASK_VALUE_EXT 0x80AA #define GL_SAMPLE_MASK_INVERT_EXT 0x80AB #define GL_SAMPLE_PATTERN_EXT 0x80AC #define GL_MULTISAMPLE_BIT_EXT 0x20000000 typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) #define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) #define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) #endif /* GL_EXT_multisample */ /* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ #ifndef GL_EXT_packed_depth_stencil #define GL_EXT_packed_depth_stencil 1 #define GL_DEPTH_STENCIL_EXT 0x84F9 #define GL_UNSIGNED_INT_24_8_EXT 0x84FA #define GL_DEPTH24_STENCIL8_EXT 0x88F0 #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 #define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) #endif /* GL_EXT_packed_depth_stencil */ /* -------------------------- GL_EXT_packed_float -------------------------- */ #ifndef GL_EXT_packed_float #define GL_EXT_packed_float 1 #define GL_R11F_G11F_B10F_EXT 0x8C3A #define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B #define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C #define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) #endif /* GL_EXT_packed_float */ /* -------------------------- GL_EXT_packed_pixels ------------------------- */ #ifndef GL_EXT_packed_pixels #define GL_EXT_packed_pixels 1 #define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 #define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 #define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 #define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 #define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) #endif /* GL_EXT_packed_pixels */ /* ------------------------ GL_EXT_paletted_texture ------------------------ */ #ifndef GL_EXT_paletted_texture #define GL_EXT_paletted_texture 1 #define GL_TEXTURE_1D 0x0DE0 #define GL_TEXTURE_2D 0x0DE1 #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 #define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 #define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 #define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF #define GL_COLOR_INDEX1_EXT 0x80E2 #define GL_COLOR_INDEX2_EXT 0x80E3 #define GL_COLOR_INDEX4_EXT 0x80E4 #define GL_COLOR_INDEX8_EXT 0x80E5 #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED #define GL_TEXTURE_CUBE_MAP_ARB 0x8513 #define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); #define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) #define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) #define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) #define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) #define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) #endif /* GL_EXT_paletted_texture */ /* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ #ifndef GL_EXT_pixel_buffer_object #define GL_EXT_pixel_buffer_object 1 #define GL_PIXEL_PACK_BUFFER_EXT 0x88EB #define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED #define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF #define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) #endif /* GL_EXT_pixel_buffer_object */ /* ------------------------- GL_EXT_pixel_transform ------------------------ */ #ifndef GL_EXT_pixel_transform #define GL_EXT_pixel_transform 1 #define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 #define GL_PIXEL_MAG_FILTER_EXT 0x8331 #define GL_PIXEL_MIN_FILTER_EXT 0x8332 #define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 #define GL_CUBIC_EXT 0x8334 #define GL_AVERAGE_EXT 0x8335 #define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 #define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 #define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); #define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) #define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) #define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) #define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) #define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) #define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) #define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) #endif /* GL_EXT_pixel_transform */ /* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ #ifndef GL_EXT_pixel_transform_color_table #define GL_EXT_pixel_transform_color_table 1 #define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) #endif /* GL_EXT_pixel_transform_color_table */ /* ------------------------ GL_EXT_point_parameters ------------------------ */ #ifndef GL_EXT_point_parameters #define GL_EXT_point_parameters 1 #define GL_POINT_SIZE_MIN_EXT 0x8126 #define GL_POINT_SIZE_MAX_EXT 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 #define GL_DISTANCE_ATTENUATION_EXT 0x8129 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); #define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) #define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) #define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) #endif /* GL_EXT_point_parameters */ /* ------------------------- GL_EXT_polygon_offset ------------------------- */ #ifndef GL_EXT_polygon_offset #define GL_EXT_polygon_offset 1 #define GL_POLYGON_OFFSET_EXT 0x8037 #define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 #define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); #define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) #define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) #endif /* GL_EXT_polygon_offset */ /* ---------------------- GL_EXT_polygon_offset_clamp ---------------------- */ #ifndef GL_EXT_polygon_offset_clamp #define GL_EXT_polygon_offset_clamp 1 #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); #define glPolygonOffsetClampEXT GLEW_GET_FUN(__glewPolygonOffsetClampEXT) #define GLEW_EXT_polygon_offset_clamp GLEW_GET_VAR(__GLEW_EXT_polygon_offset_clamp) #endif /* GL_EXT_polygon_offset_clamp */ /* ----------------------- GL_EXT_post_depth_coverage ---------------------- */ #ifndef GL_EXT_post_depth_coverage #define GL_EXT_post_depth_coverage 1 #define GLEW_EXT_post_depth_coverage GLEW_GET_VAR(__GLEW_EXT_post_depth_coverage) #endif /* GL_EXT_post_depth_coverage */ /* ------------------------ GL_EXT_provoking_vertex ------------------------ */ #ifndef GL_EXT_provoking_vertex #define GL_EXT_provoking_vertex 1 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C #define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D #define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E #define GL_PROVOKING_VERTEX_EXT 0x8E4F typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); #define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) #define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) #endif /* GL_EXT_provoking_vertex */ /* ----------------------- GL_EXT_raster_multisample ----------------------- */ #ifndef GL_EXT_raster_multisample #define GL_EXT_raster_multisample 1 #define GL_COLOR_SAMPLES_NV 0x8E20 #define GL_RASTER_MULTISAMPLE_EXT 0x9327 #define GL_RASTER_SAMPLES_EXT 0x9328 #define GL_MAX_RASTER_SAMPLES_EXT 0x9329 #define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A #define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B #define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C #define GL_DEPTH_SAMPLES_NV 0x932D #define GL_STENCIL_SAMPLES_NV 0x932E #define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F #define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 #define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat* v); typedef void (GLAPIENTRY * PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); #define glCoverageModulationNV GLEW_GET_FUN(__glewCoverageModulationNV) #define glCoverageModulationTableNV GLEW_GET_FUN(__glewCoverageModulationTableNV) #define glGetCoverageModulationTableNV GLEW_GET_FUN(__glewGetCoverageModulationTableNV) #define glRasterSamplesEXT GLEW_GET_FUN(__glewRasterSamplesEXT) #define GLEW_EXT_raster_multisample GLEW_GET_VAR(__GLEW_EXT_raster_multisample) #endif /* GL_EXT_raster_multisample */ /* ------------------------- GL_EXT_rescale_normal ------------------------- */ #ifndef GL_EXT_rescale_normal #define GL_EXT_rescale_normal 1 #define GL_RESCALE_NORMAL_EXT 0x803A #define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) #endif /* GL_EXT_rescale_normal */ /* -------------------------- GL_EXT_scene_marker -------------------------- */ #ifndef GL_EXT_scene_marker #define GL_EXT_scene_marker 1 typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); #define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) #define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) #define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) #endif /* GL_EXT_scene_marker */ /* ------------------------- GL_EXT_secondary_color ------------------------ */ #ifndef GL_EXT_secondary_color #define GL_EXT_secondary_color 1 #define GL_COLOR_SUM_EXT 0x8458 #define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 #define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A #define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B #define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C #define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D #define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); #define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) #define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) #define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) #define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) #define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) #define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) #define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) #define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) #define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) #define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) #define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) #define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) #define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) #define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) #define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) #define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) #define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) #define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) #endif /* GL_EXT_secondary_color */ /* --------------------- GL_EXT_separate_shader_objects -------------------- */ #ifndef GL_EXT_separate_shader_objects #define GL_EXT_separate_shader_objects 1 #define GL_ACTIVE_PROGRAM_EXT 0x8B8D typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); #define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) #define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) #define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) #define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) #endif /* GL_EXT_separate_shader_objects */ /* --------------------- GL_EXT_separate_specular_color -------------------- */ #ifndef GL_EXT_separate_specular_color #define GL_EXT_separate_specular_color 1 #define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 #define GL_SINGLE_COLOR_EXT 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA #define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) #endif /* GL_EXT_separate_specular_color */ /* ------------------- GL_EXT_shader_image_load_formatted ------------------ */ #ifndef GL_EXT_shader_image_load_formatted #define GL_EXT_shader_image_load_formatted 1 #define GLEW_EXT_shader_image_load_formatted GLEW_GET_VAR(__GLEW_EXT_shader_image_load_formatted) #endif /* GL_EXT_shader_image_load_formatted */ /* --------------------- GL_EXT_shader_image_load_store -------------------- */ #ifndef GL_EXT_shader_image_load_store #define GL_EXT_shader_image_load_store 1 #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 #define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 #define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 #define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 #define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 #define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 #define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 #define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 #define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 #define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 #define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 #define GL_MAX_IMAGE_UNITS_EXT 0x8F38 #define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 #define GL_IMAGE_BINDING_NAME_EXT 0x8F3A #define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B #define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C #define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D #define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E #define GL_IMAGE_1D_EXT 0x904C #define GL_IMAGE_2D_EXT 0x904D #define GL_IMAGE_3D_EXT 0x904E #define GL_IMAGE_2D_RECT_EXT 0x904F #define GL_IMAGE_CUBE_EXT 0x9050 #define GL_IMAGE_BUFFER_EXT 0x9051 #define GL_IMAGE_1D_ARRAY_EXT 0x9052 #define GL_IMAGE_2D_ARRAY_EXT 0x9053 #define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 #define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 #define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 #define GL_INT_IMAGE_1D_EXT 0x9057 #define GL_INT_IMAGE_2D_EXT 0x9058 #define GL_INT_IMAGE_3D_EXT 0x9059 #define GL_INT_IMAGE_2D_RECT_EXT 0x905A #define GL_INT_IMAGE_CUBE_EXT 0x905B #define GL_INT_IMAGE_BUFFER_EXT 0x905C #define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D #define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E #define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F #define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 #define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 #define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 #define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 #define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 #define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 #define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 #define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 #define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C #define GL_MAX_IMAGE_SAMPLES_EXT 0x906D #define GL_IMAGE_BINDING_FORMAT_EXT 0x906E #define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); #define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) #define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) #define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) #endif /* GL_EXT_shader_image_load_store */ /* ----------------------- GL_EXT_shader_integer_mix ----------------------- */ #ifndef GL_EXT_shader_integer_mix #define GL_EXT_shader_integer_mix 1 #define GLEW_EXT_shader_integer_mix GLEW_GET_VAR(__GLEW_EXT_shader_integer_mix) #endif /* GL_EXT_shader_integer_mix */ /* -------------------------- GL_EXT_shadow_funcs -------------------------- */ #ifndef GL_EXT_shadow_funcs #define GL_EXT_shadow_funcs 1 #define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) #endif /* GL_EXT_shadow_funcs */ /* --------------------- GL_EXT_shared_texture_palette --------------------- */ #ifndef GL_EXT_shared_texture_palette #define GL_EXT_shared_texture_palette 1 #define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB #define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) #endif /* GL_EXT_shared_texture_palette */ /* ------------------------- GL_EXT_sparse_texture2 ------------------------ */ #ifndef GL_EXT_sparse_texture2 #define GL_EXT_sparse_texture2 1 #define GLEW_EXT_sparse_texture2 GLEW_GET_VAR(__GLEW_EXT_sparse_texture2) #endif /* GL_EXT_sparse_texture2 */ /* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ #ifndef GL_EXT_stencil_clear_tag #define GL_EXT_stencil_clear_tag 1 #define GL_STENCIL_TAG_BITS_EXT 0x88F2 #define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 #define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) #endif /* GL_EXT_stencil_clear_tag */ /* ------------------------ GL_EXT_stencil_two_side ------------------------ */ #ifndef GL_EXT_stencil_two_side #define GL_EXT_stencil_two_side 1 #define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 #define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) #define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) #endif /* GL_EXT_stencil_two_side */ /* -------------------------- GL_EXT_stencil_wrap -------------------------- */ #ifndef GL_EXT_stencil_wrap #define GL_EXT_stencil_wrap 1 #define GL_INCR_WRAP_EXT 0x8507 #define GL_DECR_WRAP_EXT 0x8508 #define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) #endif /* GL_EXT_stencil_wrap */ /* --------------------------- GL_EXT_subtexture --------------------------- */ #ifndef GL_EXT_subtexture #define GL_EXT_subtexture 1 typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); #define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) #define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) #define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) #define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) #endif /* GL_EXT_subtexture */ /* ----------------------------- GL_EXT_texture ---------------------------- */ #ifndef GL_EXT_texture #define GL_EXT_texture 1 #define GL_ALPHA4_EXT 0x803B #define GL_ALPHA8_EXT 0x803C #define GL_ALPHA12_EXT 0x803D #define GL_ALPHA16_EXT 0x803E #define GL_LUMINANCE4_EXT 0x803F #define GL_LUMINANCE8_EXT 0x8040 #define GL_LUMINANCE12_EXT 0x8041 #define GL_LUMINANCE16_EXT 0x8042 #define GL_LUMINANCE4_ALPHA4_EXT 0x8043 #define GL_LUMINANCE6_ALPHA2_EXT 0x8044 #define GL_LUMINANCE8_ALPHA8_EXT 0x8045 #define GL_LUMINANCE12_ALPHA4_EXT 0x8046 #define GL_LUMINANCE12_ALPHA12_EXT 0x8047 #define GL_LUMINANCE16_ALPHA16_EXT 0x8048 #define GL_INTENSITY_EXT 0x8049 #define GL_INTENSITY4_EXT 0x804A #define GL_INTENSITY8_EXT 0x804B #define GL_INTENSITY12_EXT 0x804C #define GL_INTENSITY16_EXT 0x804D #define GL_RGB2_EXT 0x804E #define GL_RGB4_EXT 0x804F #define GL_RGB5_EXT 0x8050 #define GL_RGB8_EXT 0x8051 #define GL_RGB10_EXT 0x8052 #define GL_RGB12_EXT 0x8053 #define GL_RGB16_EXT 0x8054 #define GL_RGBA2_EXT 0x8055 #define GL_RGBA4_EXT 0x8056 #define GL_RGB5_A1_EXT 0x8057 #define GL_RGBA8_EXT 0x8058 #define GL_RGB10_A2_EXT 0x8059 #define GL_RGBA12_EXT 0x805A #define GL_RGBA16_EXT 0x805B #define GL_TEXTURE_RED_SIZE_EXT 0x805C #define GL_TEXTURE_GREEN_SIZE_EXT 0x805D #define GL_TEXTURE_BLUE_SIZE_EXT 0x805E #define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F #define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 #define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 #define GL_REPLACE_EXT 0x8062 #define GL_PROXY_TEXTURE_1D_EXT 0x8063 #define GL_PROXY_TEXTURE_2D_EXT 0x8064 #define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) #endif /* GL_EXT_texture */ /* ---------------------------- GL_EXT_texture3D --------------------------- */ #ifndef GL_EXT_texture3D #define GL_EXT_texture3D 1 #define GL_PACK_SKIP_IMAGES_EXT 0x806B #define GL_PACK_IMAGE_HEIGHT_EXT 0x806C #define GL_UNPACK_SKIP_IMAGES_EXT 0x806D #define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E #define GL_TEXTURE_3D_EXT 0x806F #define GL_PROXY_TEXTURE_3D_EXT 0x8070 #define GL_TEXTURE_DEPTH_EXT 0x8071 #define GL_TEXTURE_WRAP_R_EXT 0x8072 #define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); #define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) #define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) #endif /* GL_EXT_texture3D */ /* -------------------------- GL_EXT_texture_array ------------------------- */ #ifndef GL_EXT_texture_array #define GL_EXT_texture_array 1 #define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E #define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF #define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 #define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 #define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A #define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B #define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C #define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); #define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) #define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) #endif /* GL_EXT_texture_array */ /* ---------------------- GL_EXT_texture_buffer_object --------------------- */ #ifndef GL_EXT_texture_buffer_object #define GL_EXT_texture_buffer_object 1 #define GL_TEXTURE_BUFFER_EXT 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B #define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D #define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); #define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) #define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) #endif /* GL_EXT_texture_buffer_object */ /* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_EXT_texture_compression_dxt1 1 #define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) #endif /* GL_EXT_texture_compression_dxt1 */ /* -------------------- GL_EXT_texture_compression_latc -------------------- */ #ifndef GL_EXT_texture_compression_latc #define GL_EXT_texture_compression_latc 1 #define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 #define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 #define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 #define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 #define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) #endif /* GL_EXT_texture_compression_latc */ /* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ #ifndef GL_EXT_texture_compression_rgtc #define GL_EXT_texture_compression_rgtc 1 #define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB #define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC #define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD #define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE #define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) #endif /* GL_EXT_texture_compression_rgtc */ /* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ #ifndef GL_EXT_texture_compression_s3tc #define GL_EXT_texture_compression_s3tc 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 #define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) #endif /* GL_EXT_texture_compression_s3tc */ /* ------------------------ GL_EXT_texture_cube_map ------------------------ */ #ifndef GL_EXT_texture_cube_map #define GL_EXT_texture_cube_map 1 #define GL_NORMAL_MAP_EXT 0x8511 #define GL_REFLECTION_MAP_EXT 0x8512 #define GL_TEXTURE_CUBE_MAP_EXT 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C #define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) #endif /* GL_EXT_texture_cube_map */ /* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ #ifndef GL_EXT_texture_edge_clamp #define GL_EXT_texture_edge_clamp 1 #define GL_CLAMP_TO_EDGE_EXT 0x812F #define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) #endif /* GL_EXT_texture_edge_clamp */ /* --------------------------- GL_EXT_texture_env -------------------------- */ #ifndef GL_EXT_texture_env #define GL_EXT_texture_env 1 #define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) #endif /* GL_EXT_texture_env */ /* ------------------------- GL_EXT_texture_env_add ------------------------ */ #ifndef GL_EXT_texture_env_add #define GL_EXT_texture_env_add 1 #define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) #endif /* GL_EXT_texture_env_add */ /* ----------------------- GL_EXT_texture_env_combine ---------------------- */ #ifndef GL_EXT_texture_env_combine #define GL_EXT_texture_env_combine 1 #define GL_COMBINE_EXT 0x8570 #define GL_COMBINE_RGB_EXT 0x8571 #define GL_COMBINE_ALPHA_EXT 0x8572 #define GL_RGB_SCALE_EXT 0x8573 #define GL_ADD_SIGNED_EXT 0x8574 #define GL_INTERPOLATE_EXT 0x8575 #define GL_CONSTANT_EXT 0x8576 #define GL_PRIMARY_COLOR_EXT 0x8577 #define GL_PREVIOUS_EXT 0x8578 #define GL_SOURCE0_RGB_EXT 0x8580 #define GL_SOURCE1_RGB_EXT 0x8581 #define GL_SOURCE2_RGB_EXT 0x8582 #define GL_SOURCE0_ALPHA_EXT 0x8588 #define GL_SOURCE1_ALPHA_EXT 0x8589 #define GL_SOURCE2_ALPHA_EXT 0x858A #define GL_OPERAND0_RGB_EXT 0x8590 #define GL_OPERAND1_RGB_EXT 0x8591 #define GL_OPERAND2_RGB_EXT 0x8592 #define GL_OPERAND0_ALPHA_EXT 0x8598 #define GL_OPERAND1_ALPHA_EXT 0x8599 #define GL_OPERAND2_ALPHA_EXT 0x859A #define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) #endif /* GL_EXT_texture_env_combine */ /* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ #ifndef GL_EXT_texture_env_dot3 #define GL_EXT_texture_env_dot3 1 #define GL_DOT3_RGB_EXT 0x8740 #define GL_DOT3_RGBA_EXT 0x8741 #define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) #endif /* GL_EXT_texture_env_dot3 */ /* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) #endif /* GL_EXT_texture_filter_anisotropic */ /* ---------------------- GL_EXT_texture_filter_minmax --------------------- */ #ifndef GL_EXT_texture_filter_minmax #define GL_EXT_texture_filter_minmax 1 #define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 #define GL_WEIGHTED_AVERAGE_EXT 0x9367 #define GLEW_EXT_texture_filter_minmax GLEW_GET_VAR(__GLEW_EXT_texture_filter_minmax) #endif /* GL_EXT_texture_filter_minmax */ /* ------------------------- GL_EXT_texture_integer ------------------------ */ #ifndef GL_EXT_texture_integer #define GL_EXT_texture_integer 1 #define GL_RGBA32UI_EXT 0x8D70 #define GL_RGB32UI_EXT 0x8D71 #define GL_ALPHA32UI_EXT 0x8D72 #define GL_INTENSITY32UI_EXT 0x8D73 #define GL_LUMINANCE32UI_EXT 0x8D74 #define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 #define GL_RGBA16UI_EXT 0x8D76 #define GL_RGB16UI_EXT 0x8D77 #define GL_ALPHA16UI_EXT 0x8D78 #define GL_INTENSITY16UI_EXT 0x8D79 #define GL_LUMINANCE16UI_EXT 0x8D7A #define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B #define GL_RGBA8UI_EXT 0x8D7C #define GL_RGB8UI_EXT 0x8D7D #define GL_ALPHA8UI_EXT 0x8D7E #define GL_INTENSITY8UI_EXT 0x8D7F #define GL_LUMINANCE8UI_EXT 0x8D80 #define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 #define GL_RGBA32I_EXT 0x8D82 #define GL_RGB32I_EXT 0x8D83 #define GL_ALPHA32I_EXT 0x8D84 #define GL_INTENSITY32I_EXT 0x8D85 #define GL_LUMINANCE32I_EXT 0x8D86 #define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 #define GL_RGBA16I_EXT 0x8D88 #define GL_RGB16I_EXT 0x8D89 #define GL_ALPHA16I_EXT 0x8D8A #define GL_INTENSITY16I_EXT 0x8D8B #define GL_LUMINANCE16I_EXT 0x8D8C #define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D #define GL_RGBA8I_EXT 0x8D8E #define GL_RGB8I_EXT 0x8D8F #define GL_ALPHA8I_EXT 0x8D90 #define GL_INTENSITY8I_EXT 0x8D91 #define GL_LUMINANCE8I_EXT 0x8D92 #define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 #define GL_RED_INTEGER_EXT 0x8D94 #define GL_GREEN_INTEGER_EXT 0x8D95 #define GL_BLUE_INTEGER_EXT 0x8D96 #define GL_ALPHA_INTEGER_EXT 0x8D97 #define GL_RGB_INTEGER_EXT 0x8D98 #define GL_RGBA_INTEGER_EXT 0x8D99 #define GL_BGR_INTEGER_EXT 0x8D9A #define GL_BGRA_INTEGER_EXT 0x8D9B #define GL_LUMINANCE_INTEGER_EXT 0x8D9C #define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D #define GL_RGBA_INTEGER_MODE_EXT 0x8D9E typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); #define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) #define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) #define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) #define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) #define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) #define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) #define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) #endif /* GL_EXT_texture_integer */ /* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ #ifndef GL_EXT_texture_lod_bias #define GL_EXT_texture_lod_bias 1 #define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD #define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 #define GL_TEXTURE_LOD_BIAS_EXT 0x8501 #define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) #endif /* GL_EXT_texture_lod_bias */ /* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ #ifndef GL_EXT_texture_mirror_clamp #define GL_EXT_texture_mirror_clamp 1 #define GL_MIRROR_CLAMP_EXT 0x8742 #define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 #define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 #define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) #endif /* GL_EXT_texture_mirror_clamp */ /* ------------------------- GL_EXT_texture_object ------------------------- */ #ifndef GL_EXT_texture_object #define GL_EXT_texture_object 1 #define GL_TEXTURE_PRIORITY_EXT 0x8066 #define GL_TEXTURE_RESIDENT_EXT 0x8067 #define GL_TEXTURE_1D_BINDING_EXT 0x8068 #define GL_TEXTURE_2D_BINDING_EXT 0x8069 #define GL_TEXTURE_3D_BINDING_EXT 0x806A typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); #define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) #define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) #define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) #define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) #define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) #define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) #define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) #endif /* GL_EXT_texture_object */ /* --------------------- GL_EXT_texture_perturb_normal --------------------- */ #ifndef GL_EXT_texture_perturb_normal #define GL_EXT_texture_perturb_normal 1 #define GL_PERTURB_EXT 0x85AE #define GL_TEXTURE_NORMAL_EXT 0x85AF typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) #define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) #endif /* GL_EXT_texture_perturb_normal */ /* ------------------------ GL_EXT_texture_rectangle ----------------------- */ #ifndef GL_EXT_texture_rectangle #define GL_EXT_texture_rectangle 1 #define GL_TEXTURE_RECTANGLE_EXT 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 #define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) #endif /* GL_EXT_texture_rectangle */ /* -------------------------- GL_EXT_texture_sRGB -------------------------- */ #ifndef GL_EXT_texture_sRGB #define GL_EXT_texture_sRGB 1 #define GL_SRGB_EXT 0x8C40 #define GL_SRGB8_EXT 0x8C41 #define GL_SRGB_ALPHA_EXT 0x8C42 #define GL_SRGB8_ALPHA8_EXT 0x8C43 #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 #define GL_SLUMINANCE_EXT 0x8C46 #define GL_SLUMINANCE8_EXT 0x8C47 #define GL_COMPRESSED_SRGB_EXT 0x8C48 #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F #define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) #endif /* GL_EXT_texture_sRGB */ /* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ #ifndef GL_EXT_texture_sRGB_decode #define GL_EXT_texture_sRGB_decode 1 #define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 #define GL_DECODE_EXT 0x8A49 #define GL_SKIP_DECODE_EXT 0x8A4A #define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) #endif /* GL_EXT_texture_sRGB_decode */ /* --------------------- GL_EXT_texture_shared_exponent -------------------- */ #ifndef GL_EXT_texture_shared_exponent #define GL_EXT_texture_shared_exponent 1 #define GL_RGB9_E5_EXT 0x8C3D #define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E #define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F #define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) #endif /* GL_EXT_texture_shared_exponent */ /* -------------------------- GL_EXT_texture_snorm ------------------------- */ #ifndef GL_EXT_texture_snorm #define GL_EXT_texture_snorm 1 #define GL_RED_SNORM 0x8F90 #define GL_RG_SNORM 0x8F91 #define GL_RGB_SNORM 0x8F92 #define GL_RGBA_SNORM 0x8F93 #define GL_R8_SNORM 0x8F94 #define GL_RG8_SNORM 0x8F95 #define GL_RGB8_SNORM 0x8F96 #define GL_RGBA8_SNORM 0x8F97 #define GL_R16_SNORM 0x8F98 #define GL_RG16_SNORM 0x8F99 #define GL_RGB16_SNORM 0x8F9A #define GL_RGBA16_SNORM 0x8F9B #define GL_SIGNED_NORMALIZED 0x8F9C #define GL_ALPHA_SNORM 0x9010 #define GL_LUMINANCE_SNORM 0x9011 #define GL_LUMINANCE_ALPHA_SNORM 0x9012 #define GL_INTENSITY_SNORM 0x9013 #define GL_ALPHA8_SNORM 0x9014 #define GL_LUMINANCE8_SNORM 0x9015 #define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 #define GL_INTENSITY8_SNORM 0x9017 #define GL_ALPHA16_SNORM 0x9018 #define GL_LUMINANCE16_SNORM 0x9019 #define GL_LUMINANCE16_ALPHA16_SNORM 0x901A #define GL_INTENSITY16_SNORM 0x901B #define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) #endif /* GL_EXT_texture_snorm */ /* ------------------------- GL_EXT_texture_swizzle ------------------------ */ #ifndef GL_EXT_texture_swizzle #define GL_EXT_texture_swizzle 1 #define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 #define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 #define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 #define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 #define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 #define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) #endif /* GL_EXT_texture_swizzle */ /* --------------------------- GL_EXT_timer_query -------------------------- */ #ifndef GL_EXT_timer_query #define GL_EXT_timer_query 1 #define GL_TIME_ELAPSED_EXT 0x88BF typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); #define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) #define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) #define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) #endif /* GL_EXT_timer_query */ /* ----------------------- GL_EXT_transform_feedback ----------------------- */ #ifndef GL_EXT_transform_feedback #define GL_EXT_transform_feedback 1 #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 #define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 #define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 #define GL_PRIMITIVES_GENERATED_EXT 0x8C87 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 #define GL_RASTERIZER_DISCARD_EXT 0x8C89 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B #define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C #define GL_SEPARATE_ATTRIBS_EXT 0x8C8D #define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); #define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) #define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) #define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) #define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) #define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) #define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) #define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) #define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) #endif /* GL_EXT_transform_feedback */ /* -------------------------- GL_EXT_vertex_array -------------------------- */ #ifndef GL_EXT_vertex_array #define GL_EXT_vertex_array 1 #define GL_DOUBLE_EXT 0x140A #define GL_VERTEX_ARRAY_EXT 0x8074 #define GL_NORMAL_ARRAY_EXT 0x8075 #define GL_COLOR_ARRAY_EXT 0x8076 #define GL_INDEX_ARRAY_EXT 0x8077 #define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 #define GL_EDGE_FLAG_ARRAY_EXT 0x8079 #define GL_VERTEX_ARRAY_SIZE_EXT 0x807A #define GL_VERTEX_ARRAY_TYPE_EXT 0x807B #define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C #define GL_VERTEX_ARRAY_COUNT_EXT 0x807D #define GL_NORMAL_ARRAY_TYPE_EXT 0x807E #define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F #define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 #define GL_COLOR_ARRAY_SIZE_EXT 0x8081 #define GL_COLOR_ARRAY_TYPE_EXT 0x8082 #define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 #define GL_COLOR_ARRAY_COUNT_EXT 0x8084 #define GL_INDEX_ARRAY_TYPE_EXT 0x8085 #define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 #define GL_INDEX_ARRAY_COUNT_EXT 0x8087 #define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 #define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 #define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A #define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B #define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C #define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D #define GL_VERTEX_ARRAY_POINTER_EXT 0x808E #define GL_NORMAL_ARRAY_POINTER_EXT 0x808F #define GL_COLOR_ARRAY_POINTER_EXT 0x8090 #define GL_INDEX_ARRAY_POINTER_EXT 0x8091 #define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); #define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) #define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) #define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) #define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) #define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) #define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) #define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) #define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) #define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) #endif /* GL_EXT_vertex_array */ /* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ #ifndef GL_EXT_vertex_array_bgra #define GL_EXT_vertex_array_bgra 1 #define GL_BGRA 0x80E1 #define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) #endif /* GL_EXT_vertex_array_bgra */ /* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ #ifndef GL_EXT_vertex_attrib_64bit #define GL_EXT_vertex_attrib_64bit 1 #define GL_DOUBLE_MAT2_EXT 0x8F46 #define GL_DOUBLE_MAT3_EXT 0x8F47 #define GL_DOUBLE_MAT4_EXT 0x8F48 #define GL_DOUBLE_MAT2x3_EXT 0x8F49 #define GL_DOUBLE_MAT2x4_EXT 0x8F4A #define GL_DOUBLE_MAT3x2_EXT 0x8F4B #define GL_DOUBLE_MAT3x4_EXT 0x8F4C #define GL_DOUBLE_MAT4x2_EXT 0x8F4D #define GL_DOUBLE_MAT4x3_EXT 0x8F4E #define GL_DOUBLE_VEC2_EXT 0x8FFC #define GL_DOUBLE_VEC3_EXT 0x8FFD #define GL_DOUBLE_VEC4_EXT 0x8FFE typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); #define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) #define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) #define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) #define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) #define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) #define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) #define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) #define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) #define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) #define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) #define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) #define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) #endif /* GL_EXT_vertex_attrib_64bit */ /* -------------------------- GL_EXT_vertex_shader ------------------------- */ #ifndef GL_EXT_vertex_shader #define GL_EXT_vertex_shader 1 #define GL_VERTEX_SHADER_EXT 0x8780 #define GL_VERTEX_SHADER_BINDING_EXT 0x8781 #define GL_OP_INDEX_EXT 0x8782 #define GL_OP_NEGATE_EXT 0x8783 #define GL_OP_DOT3_EXT 0x8784 #define GL_OP_DOT4_EXT 0x8785 #define GL_OP_MUL_EXT 0x8786 #define GL_OP_ADD_EXT 0x8787 #define GL_OP_MADD_EXT 0x8788 #define GL_OP_FRAC_EXT 0x8789 #define GL_OP_MAX_EXT 0x878A #define GL_OP_MIN_EXT 0x878B #define GL_OP_SET_GE_EXT 0x878C #define GL_OP_SET_LT_EXT 0x878D #define GL_OP_CLAMP_EXT 0x878E #define GL_OP_FLOOR_EXT 0x878F #define GL_OP_ROUND_EXT 0x8790 #define GL_OP_EXP_BASE_2_EXT 0x8791 #define GL_OP_LOG_BASE_2_EXT 0x8792 #define GL_OP_POWER_EXT 0x8793 #define GL_OP_RECIP_EXT 0x8794 #define GL_OP_RECIP_SQRT_EXT 0x8795 #define GL_OP_SUB_EXT 0x8796 #define GL_OP_CROSS_PRODUCT_EXT 0x8797 #define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 #define GL_OP_MOV_EXT 0x8799 #define GL_OUTPUT_VERTEX_EXT 0x879A #define GL_OUTPUT_COLOR0_EXT 0x879B #define GL_OUTPUT_COLOR1_EXT 0x879C #define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D #define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E #define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F #define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 #define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 #define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 #define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 #define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 #define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 #define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 #define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 #define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 #define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 #define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA #define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB #define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC #define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD #define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE #define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF #define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 #define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 #define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 #define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 #define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 #define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 #define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 #define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 #define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 #define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 #define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA #define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB #define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC #define GL_OUTPUT_FOG_EXT 0x87BD #define GL_SCALAR_EXT 0x87BE #define GL_VECTOR_EXT 0x87BF #define GL_MATRIX_EXT 0x87C0 #define GL_VARIANT_EXT 0x87C1 #define GL_INVARIANT_EXT 0x87C2 #define GL_LOCAL_CONSTANT_EXT 0x87C3 #define GL_LOCAL_EXT 0x87C4 #define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 #define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 #define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 #define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 #define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 #define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA #define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB #define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE #define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF #define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 #define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 #define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 #define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 #define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 #define GL_X_EXT 0x87D5 #define GL_Y_EXT 0x87D6 #define GL_Z_EXT 0x87D7 #define GL_W_EXT 0x87D8 #define GL_NEGATIVE_X_EXT 0x87D9 #define GL_NEGATIVE_Y_EXT 0x87DA #define GL_NEGATIVE_Z_EXT 0x87DB #define GL_NEGATIVE_W_EXT 0x87DC #define GL_ZERO_EXT 0x87DD #define GL_ONE_EXT 0x87DE #define GL_NEGATIVE_ONE_EXT 0x87DF #define GL_NORMALIZED_RANGE_EXT 0x87E0 #define GL_FULL_RANGE_EXT 0x87E1 #define GL_CURRENT_VERTEX_EXT 0x87E2 #define GL_MVP_MATRIX_EXT 0x87E3 #define GL_VARIANT_VALUE_EXT 0x87E4 #define GL_VARIANT_DATATYPE_EXT 0x87E5 #define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 #define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 #define GL_VARIANT_ARRAY_EXT 0x87E8 #define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 #define GL_INVARIANT_VALUE_EXT 0x87EA #define GL_INVARIANT_DATATYPE_EXT 0x87EB #define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC #define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, void *addr); typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, void *addr); typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, void *addr); typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); #define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) #define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) #define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) #define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) #define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) #define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) #define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) #define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) #define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) #define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) #define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) #define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) #define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) #define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) #define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) #define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) #define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) #define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) #define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) #define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) #define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) #define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) #define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) #define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) #define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) #define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) #define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) #define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) #define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) #define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) #define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) #define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) #define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) #define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) #define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) #define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) #define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) #define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) #define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) #define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) #define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) #define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) #define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) #endif /* GL_EXT_vertex_shader */ /* ------------------------ GL_EXT_vertex_weighting ------------------------ */ #ifndef GL_EXT_vertex_weighting #define GL_EXT_vertex_weighting 1 #define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 #define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 #define GL_MODELVIEW0_EXT 0x1700 #define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 #define GL_MODELVIEW1_MATRIX_EXT 0x8506 #define GL_VERTEX_WEIGHTING_EXT 0x8509 #define GL_MODELVIEW1_EXT 0x850A #define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B #define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C #define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D #define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E #define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); #define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) #define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) #define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) #define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) #endif /* GL_EXT_vertex_weighting */ /* ------------------------- GL_EXT_x11_sync_object ------------------------ */ #ifndef GL_EXT_x11_sync_object #define GL_EXT_x11_sync_object 1 #define GL_SYNC_X11_FENCE_EXT 0x90E1 typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); #define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) #define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) #endif /* GL_EXT_x11_sync_object */ /* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ #ifndef GL_GREMEDY_frame_terminator #define GL_GREMEDY_frame_terminator 1 typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); #define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) #define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) #endif /* GL_GREMEDY_frame_terminator */ /* ------------------------ GL_GREMEDY_string_marker ----------------------- */ #ifndef GL_GREMEDY_string_marker #define GL_GREMEDY_string_marker 1 typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); #define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) #define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) #endif /* GL_GREMEDY_string_marker */ /* --------------------- GL_HP_convolution_border_modes -------------------- */ #ifndef GL_HP_convolution_border_modes #define GL_HP_convolution_border_modes 1 #define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) #endif /* GL_HP_convolution_border_modes */ /* ------------------------- GL_HP_image_transform ------------------------- */ #ifndef GL_HP_image_transform #define GL_HP_image_transform 1 typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); #define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) #define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) #define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) #define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) #define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) #define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) #define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) #endif /* GL_HP_image_transform */ /* -------------------------- GL_HP_occlusion_test ------------------------- */ #ifndef GL_HP_occlusion_test #define GL_HP_occlusion_test 1 #define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) #endif /* GL_HP_occlusion_test */ /* ------------------------- GL_HP_texture_lighting ------------------------ */ #ifndef GL_HP_texture_lighting #define GL_HP_texture_lighting 1 #define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) #endif /* GL_HP_texture_lighting */ /* --------------------------- GL_IBM_cull_vertex -------------------------- */ #ifndef GL_IBM_cull_vertex #define GL_IBM_cull_vertex 1 #define GL_CULL_VERTEX_IBM 103050 #define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) #endif /* GL_IBM_cull_vertex */ /* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ #ifndef GL_IBM_multimode_draw_arrays #define GL_IBM_multimode_draw_arrays 1 typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const void *const *indices, GLsizei primcount, GLint modestride); #define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) #define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) #define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) #endif /* GL_IBM_multimode_draw_arrays */ /* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ #ifndef GL_IBM_rasterpos_clip #define GL_IBM_rasterpos_clip 1 #define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 #define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) #endif /* GL_IBM_rasterpos_clip */ /* --------------------------- GL_IBM_static_data -------------------------- */ #ifndef GL_IBM_static_data #define GL_IBM_static_data 1 #define GL_ALL_STATIC_DATA_IBM 103060 #define GL_STATIC_VERTEX_ARRAY_IBM 103061 #define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) #endif /* GL_IBM_static_data */ /* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ #ifndef GL_IBM_texture_mirrored_repeat #define GL_IBM_texture_mirrored_repeat 1 #define GL_MIRRORED_REPEAT_IBM 0x8370 #define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) #endif /* GL_IBM_texture_mirrored_repeat */ /* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ #ifndef GL_IBM_vertex_array_lists #define GL_IBM_vertex_array_lists 1 #define GL_VERTEX_ARRAY_LIST_IBM 103070 #define GL_NORMAL_ARRAY_LIST_IBM 103071 #define GL_COLOR_ARRAY_LIST_IBM 103072 #define GL_INDEX_ARRAY_LIST_IBM 103073 #define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 #define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 #define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 #define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 #define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 #define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 #define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 #define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 #define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 #define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 #define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 #define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); #define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) #define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) #define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) #define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) #define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) #define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) #define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) #define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) #define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) #endif /* GL_IBM_vertex_array_lists */ /* -------------------------- GL_INGR_color_clamp -------------------------- */ #ifndef GL_INGR_color_clamp #define GL_INGR_color_clamp 1 #define GL_RED_MIN_CLAMP_INGR 0x8560 #define GL_GREEN_MIN_CLAMP_INGR 0x8561 #define GL_BLUE_MIN_CLAMP_INGR 0x8562 #define GL_ALPHA_MIN_CLAMP_INGR 0x8563 #define GL_RED_MAX_CLAMP_INGR 0x8564 #define GL_GREEN_MAX_CLAMP_INGR 0x8565 #define GL_BLUE_MAX_CLAMP_INGR 0x8566 #define GL_ALPHA_MAX_CLAMP_INGR 0x8567 #define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) #endif /* GL_INGR_color_clamp */ /* ------------------------- GL_INGR_interlace_read ------------------------ */ #ifndef GL_INGR_interlace_read #define GL_INGR_interlace_read 1 #define GL_INTERLACE_READ_INGR 0x8568 #define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) #endif /* GL_INGR_interlace_read */ /* ------------------- GL_INTEL_fragment_shader_ordering ------------------- */ #ifndef GL_INTEL_fragment_shader_ordering #define GL_INTEL_fragment_shader_ordering 1 #define GLEW_INTEL_fragment_shader_ordering GLEW_GET_VAR(__GLEW_INTEL_fragment_shader_ordering) #endif /* GL_INTEL_fragment_shader_ordering */ /* ----------------------- GL_INTEL_framebuffer_CMAA ----------------------- */ #ifndef GL_INTEL_framebuffer_CMAA #define GL_INTEL_framebuffer_CMAA 1 #define GLEW_INTEL_framebuffer_CMAA GLEW_GET_VAR(__GLEW_INTEL_framebuffer_CMAA) #endif /* GL_INTEL_framebuffer_CMAA */ /* -------------------------- GL_INTEL_map_texture ------------------------- */ #ifndef GL_INTEL_map_texture #define GL_INTEL_map_texture 1 #define GL_LAYOUT_DEFAULT_INTEL 0 #define GL_LAYOUT_LINEAR_INTEL 1 #define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 #define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); #define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) #define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) #define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) #define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) #endif /* GL_INTEL_map_texture */ /* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ #ifndef GL_INTEL_parallel_arrays #define GL_INTEL_parallel_arrays 1 #define GL_PARALLEL_ARRAYS_INTEL 0x83F4 #define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 #define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 #define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 #define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); #define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) #define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) #define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) #define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) #define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) #endif /* GL_INTEL_parallel_arrays */ /* ----------------------- GL_INTEL_performance_query ---------------------- */ #ifndef GL_INTEL_performance_query #define GL_INTEL_performance_query 1 #define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 #define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 #define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 #define GL_PERFQUERY_FLUSH_INTEL 0x83FA #define GL_PERFQUERY_WAIT_INTEL 0x83FB #define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 #define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 #define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 #define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 #define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 #define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 #define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 #define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 #define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA #define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB #define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC #define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD #define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE #define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF #define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 typedef void (GLAPIENTRY * PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GLAPIENTRY * PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint* queryHandle); typedef void (GLAPIENTRY * PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GLAPIENTRY * PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GLAPIENTRY * PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint* queryId); typedef void (GLAPIENTRY * PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint* nextQueryId); typedef void (GLAPIENTRY * PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); typedef void (GLAPIENTRY * PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); typedef void (GLAPIENTRY * PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar* queryName, GLuint *queryId); typedef void (GLAPIENTRY * PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); #define glBeginPerfQueryINTEL GLEW_GET_FUN(__glewBeginPerfQueryINTEL) #define glCreatePerfQueryINTEL GLEW_GET_FUN(__glewCreatePerfQueryINTEL) #define glDeletePerfQueryINTEL GLEW_GET_FUN(__glewDeletePerfQueryINTEL) #define glEndPerfQueryINTEL GLEW_GET_FUN(__glewEndPerfQueryINTEL) #define glGetFirstPerfQueryIdINTEL GLEW_GET_FUN(__glewGetFirstPerfQueryIdINTEL) #define glGetNextPerfQueryIdINTEL GLEW_GET_FUN(__glewGetNextPerfQueryIdINTEL) #define glGetPerfCounterInfoINTEL GLEW_GET_FUN(__glewGetPerfCounterInfoINTEL) #define glGetPerfQueryDataINTEL GLEW_GET_FUN(__glewGetPerfQueryDataINTEL) #define glGetPerfQueryIdByNameINTEL GLEW_GET_FUN(__glewGetPerfQueryIdByNameINTEL) #define glGetPerfQueryInfoINTEL GLEW_GET_FUN(__glewGetPerfQueryInfoINTEL) #define GLEW_INTEL_performance_query GLEW_GET_VAR(__GLEW_INTEL_performance_query) #endif /* GL_INTEL_performance_query */ /* ------------------------ GL_INTEL_texture_scissor ----------------------- */ #ifndef GL_INTEL_texture_scissor #define GL_INTEL_texture_scissor 1 typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); #define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) #define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) #define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) #endif /* GL_INTEL_texture_scissor */ /* --------------------- GL_KHR_blend_equation_advanced -------------------- */ #ifndef GL_KHR_blend_equation_advanced #define GL_KHR_blend_equation_advanced 1 #define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 #define GL_MULTIPLY_KHR 0x9294 #define GL_SCREEN_KHR 0x9295 #define GL_OVERLAY_KHR 0x9296 #define GL_DARKEN_KHR 0x9297 #define GL_LIGHTEN_KHR 0x9298 #define GL_COLORDODGE_KHR 0x9299 #define GL_COLORBURN_KHR 0x929A #define GL_HARDLIGHT_KHR 0x929B #define GL_SOFTLIGHT_KHR 0x929C #define GL_DIFFERENCE_KHR 0x929E #define GL_EXCLUSION_KHR 0x92A0 #define GL_HSL_HUE_KHR 0x92AD #define GL_HSL_SATURATION_KHR 0x92AE #define GL_HSL_COLOR_KHR 0x92AF #define GL_HSL_LUMINOSITY_KHR 0x92B0 typedef void (GLAPIENTRY * PFNGLBLENDBARRIERKHRPROC) (void); #define glBlendBarrierKHR GLEW_GET_FUN(__glewBlendBarrierKHR) #define GLEW_KHR_blend_equation_advanced GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced) #endif /* GL_KHR_blend_equation_advanced */ /* ---------------- GL_KHR_blend_equation_advanced_coherent ---------------- */ #ifndef GL_KHR_blend_equation_advanced_coherent #define GL_KHR_blend_equation_advanced_coherent 1 #define GLEW_KHR_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced_coherent) #endif /* GL_KHR_blend_equation_advanced_coherent */ /* ---------------------- GL_KHR_context_flush_control --------------------- */ #ifndef GL_KHR_context_flush_control #define GL_KHR_context_flush_control 1 #define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC #define GLEW_KHR_context_flush_control GLEW_GET_VAR(__GLEW_KHR_context_flush_control) #endif /* GL_KHR_context_flush_control */ /* ------------------------------ GL_KHR_debug ----------------------------- */ #ifndef GL_KHR_debug #define GL_KHR_debug 1 #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 #define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 #define GL_DEBUG_CALLBACK_FUNCTION 0x8244 #define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 #define GL_DEBUG_SOURCE_API 0x8246 #define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 #define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 #define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 #define GL_DEBUG_SOURCE_APPLICATION 0x824A #define GL_DEBUG_SOURCE_OTHER 0x824B #define GL_DEBUG_TYPE_ERROR 0x824C #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D #define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E #define GL_DEBUG_TYPE_PORTABILITY 0x824F #define GL_DEBUG_TYPE_PERFORMANCE 0x8250 #define GL_DEBUG_TYPE_OTHER 0x8251 #define GL_DEBUG_TYPE_MARKER 0x8268 #define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 #define GL_DEBUG_TYPE_POP_GROUP 0x826A #define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B #define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C #define GL_DEBUG_GROUP_STACK_DEPTH 0x826D #define GL_BUFFER 0x82E0 #define GL_SHADER 0x82E1 #define GL_PROGRAM 0x82E2 #define GL_QUERY 0x82E3 #define GL_PROGRAM_PIPELINE 0x82E4 #define GL_SAMPLER 0x82E6 #define GL_DISPLAY_LIST 0x82E7 #define GL_MAX_LABEL_LENGTH 0x82E8 #define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 #define GL_DEBUG_LOGGED_MESSAGES 0x9145 #define GL_DEBUG_SEVERITY_HIGH 0x9146 #define GL_DEBUG_SEVERITY_MEDIUM 0x9147 #define GL_DEBUG_SEVERITY_LOW 0x9148 #define GL_DEBUG_OUTPUT 0x92E0 typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei* length, GLchar *label); typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar* label); typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); #define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) #define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) #define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) #define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) #define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) #define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) #define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) #define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) #define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) #define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) #define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) #endif /* GL_KHR_debug */ /* ---------------------------- GL_KHR_no_error ---------------------------- */ #ifndef GL_KHR_no_error #define GL_KHR_no_error 1 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 #define GLEW_KHR_no_error GLEW_GET_VAR(__GLEW_KHR_no_error) #endif /* GL_KHR_no_error */ /* ------------------ GL_KHR_robust_buffer_access_behavior ----------------- */ #ifndef GL_KHR_robust_buffer_access_behavior #define GL_KHR_robust_buffer_access_behavior 1 #define GLEW_KHR_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_KHR_robust_buffer_access_behavior) #endif /* GL_KHR_robust_buffer_access_behavior */ /* --------------------------- GL_KHR_robustness --------------------------- */ #ifndef GL_KHR_robustness #define GL_KHR_robustness 1 #define GL_CONTEXT_LOST 0x0507 #define GL_LOSE_CONTEXT_ON_RESET 0x8252 #define GL_GUILTY_CONTEXT_RESET 0x8253 #define GL_INNOCENT_CONTEXT_RESET 0x8254 #define GL_UNKNOWN_CONTEXT_RESET 0x8255 #define GL_RESET_NOTIFICATION_STRATEGY 0x8256 #define GL_NO_RESET_NOTIFICATION 0x8261 #define GL_CONTEXT_ROBUST_ACCESS 0x90F3 typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); typedef void (GLAPIENTRY * PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); #define glGetnUniformfv GLEW_GET_FUN(__glewGetnUniformfv) #define glGetnUniformiv GLEW_GET_FUN(__glewGetnUniformiv) #define glGetnUniformuiv GLEW_GET_FUN(__glewGetnUniformuiv) #define glReadnPixels GLEW_GET_FUN(__glewReadnPixels) #define GLEW_KHR_robustness GLEW_GET_VAR(__GLEW_KHR_robustness) #endif /* GL_KHR_robustness */ /* ------------------ GL_KHR_texture_compression_astc_hdr ------------------ */ #ifndef GL_KHR_texture_compression_astc_hdr #define GL_KHR_texture_compression_astc_hdr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 #define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 #define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 #define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 #define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 #define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 #define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 #define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 #define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 #define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA #define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB #define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC #define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD #define GLEW_KHR_texture_compression_astc_hdr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_hdr) #endif /* GL_KHR_texture_compression_astc_hdr */ /* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ #ifndef GL_KHR_texture_compression_astc_ldr #define GL_KHR_texture_compression_astc_ldr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 #define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 #define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 #define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 #define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 #define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 #define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 #define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 #define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 #define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA #define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB #define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC #define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD #define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) #endif /* GL_KHR_texture_compression_astc_ldr */ /* -------------------------- GL_KTX_buffer_region ------------------------- */ #ifndef GL_KTX_buffer_region #define GL_KTX_buffer_region 1 #define GL_KTX_FRONT_REGION 0x0 #define GL_KTX_BACK_REGION 0x1 #define GL_KTX_Z_REGION 0x2 #define GL_KTX_STENCIL_REGION 0x3 typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); #define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) #define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) #define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) #define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) #define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) #define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) #endif /* GL_KTX_buffer_region */ /* ------------------------- GL_MESAX_texture_stack ------------------------ */ #ifndef GL_MESAX_texture_stack #define GL_MESAX_texture_stack 1 #define GL_TEXTURE_1D_STACK_MESAX 0x8759 #define GL_TEXTURE_2D_STACK_MESAX 0x875A #define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B #define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C #define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D #define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E #define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) #endif /* GL_MESAX_texture_stack */ /* -------------------------- GL_MESA_pack_invert -------------------------- */ #ifndef GL_MESA_pack_invert #define GL_MESA_pack_invert 1 #define GL_PACK_INVERT_MESA 0x8758 #define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) #endif /* GL_MESA_pack_invert */ /* ------------------------- GL_MESA_resize_buffers ------------------------ */ #ifndef GL_MESA_resize_buffers #define GL_MESA_resize_buffers 1 typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); #define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) #define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) #endif /* GL_MESA_resize_buffers */ /* --------------------------- GL_MESA_window_pos -------------------------- */ #ifndef GL_MESA_window_pos #define GL_MESA_window_pos 1 typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); #define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) #define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) #define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) #define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) #define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) #define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) #define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) #define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) #define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) #define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) #define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) #define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) #define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) #define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) #define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) #define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) #define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) #define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) #define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) #define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) #define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) #define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) #define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) #define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) #define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) #endif /* GL_MESA_window_pos */ /* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ #ifndef GL_MESA_ycbcr_texture #define GL_MESA_ycbcr_texture 1 #define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB #define GL_YCBCR_MESA 0x8757 #define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) #endif /* GL_MESA_ycbcr_texture */ /* ----------------------- GL_NVX_conditional_render ----------------------- */ #ifndef GL_NVX_conditional_render #define GL_NVX_conditional_render 1 typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); #define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) #define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) #define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) #endif /* GL_NVX_conditional_render */ /* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ #ifndef GL_NVX_gpu_memory_info #define GL_NVX_gpu_memory_info 1 #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 #define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 #define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 #define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A #define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B #define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) #endif /* GL_NVX_gpu_memory_info */ /* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ #ifndef GL_NV_bindless_multi_draw_indirect #define GL_NV_bindless_multi_draw_indirect 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); #define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) #define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) #define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) #endif /* GL_NV_bindless_multi_draw_indirect */ /* ---------------- GL_NV_bindless_multi_draw_indirect_count --------------- */ #ifndef GL_NV_bindless_multi_draw_indirect_count #define GL_NV_bindless_multi_draw_indirect_count 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); #define glMultiDrawArraysIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessCountNV) #define glMultiDrawElementsIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessCountNV) #define GLEW_NV_bindless_multi_draw_indirect_count GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect_count) #endif /* GL_NV_bindless_multi_draw_indirect_count */ /* ------------------------- GL_NV_bindless_texture ------------------------ */ #ifndef GL_NV_bindless_texture #define GL_NV_bindless_texture 1 typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); #define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) #define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) #define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) #define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) #define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) #define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) #define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) #define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) #define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) #define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) #define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) #define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) #define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) #define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) #endif /* GL_NV_bindless_texture */ /* --------------------- GL_NV_blend_equation_advanced --------------------- */ #ifndef GL_NV_blend_equation_advanced #define GL_NV_blend_equation_advanced 1 #define GL_XOR_NV 0x1506 #define GL_RED_NV 0x1903 #define GL_GREEN_NV 0x1904 #define GL_BLUE_NV 0x1905 #define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 #define GL_BLEND_OVERLAP_NV 0x9281 #define GL_UNCORRELATED_NV 0x9282 #define GL_DISJOINT_NV 0x9283 #define GL_CONJOINT_NV 0x9284 #define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 #define GL_SRC_NV 0x9286 #define GL_DST_NV 0x9287 #define GL_SRC_OVER_NV 0x9288 #define GL_DST_OVER_NV 0x9289 #define GL_SRC_IN_NV 0x928A #define GL_DST_IN_NV 0x928B #define GL_SRC_OUT_NV 0x928C #define GL_DST_OUT_NV 0x928D #define GL_SRC_ATOP_NV 0x928E #define GL_DST_ATOP_NV 0x928F #define GL_PLUS_NV 0x9291 #define GL_PLUS_DARKER_NV 0x9292 #define GL_MULTIPLY_NV 0x9294 #define GL_SCREEN_NV 0x9295 #define GL_OVERLAY_NV 0x9296 #define GL_DARKEN_NV 0x9297 #define GL_LIGHTEN_NV 0x9298 #define GL_COLORDODGE_NV 0x9299 #define GL_COLORBURN_NV 0x929A #define GL_HARDLIGHT_NV 0x929B #define GL_SOFTLIGHT_NV 0x929C #define GL_DIFFERENCE_NV 0x929E #define GL_MINUS_NV 0x929F #define GL_EXCLUSION_NV 0x92A0 #define GL_CONTRAST_NV 0x92A1 #define GL_INVERT_RGB_NV 0x92A3 #define GL_LINEARDODGE_NV 0x92A4 #define GL_LINEARBURN_NV 0x92A5 #define GL_VIVIDLIGHT_NV 0x92A6 #define GL_LINEARLIGHT_NV 0x92A7 #define GL_PINLIGHT_NV 0x92A8 #define GL_HARDMIX_NV 0x92A9 #define GL_HSL_HUE_NV 0x92AD #define GL_HSL_SATURATION_NV 0x92AE #define GL_HSL_COLOR_NV 0x92AF #define GL_HSL_LUMINOSITY_NV 0x92B0 #define GL_PLUS_CLAMPED_NV 0x92B1 #define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 #define GL_MINUS_CLAMPED_NV 0x92B3 #define GL_INVERT_OVG_NV 0x92B4 typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); #define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) #define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) #define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) #endif /* GL_NV_blend_equation_advanced */ /* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ #ifndef GL_NV_blend_equation_advanced_coherent #define GL_NV_blend_equation_advanced_coherent 1 #define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) #endif /* GL_NV_blend_equation_advanced_coherent */ /* --------------------------- GL_NV_blend_square -------------------------- */ #ifndef GL_NV_blend_square #define GL_NV_blend_square 1 #define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) #endif /* GL_NV_blend_square */ /* ------------------------- GL_NV_compute_program5 ------------------------ */ #ifndef GL_NV_compute_program5 #define GL_NV_compute_program5 1 #define GL_COMPUTE_PROGRAM_NV 0x90FB #define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC #define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) #endif /* GL_NV_compute_program5 */ /* ------------------------ GL_NV_conditional_render ----------------------- */ #ifndef GL_NV_conditional_render #define GL_NV_conditional_render 1 #define GL_QUERY_WAIT_NV 0x8E13 #define GL_QUERY_NO_WAIT_NV 0x8E14 #define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 #define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); #define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) #define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) #define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) #endif /* GL_NV_conditional_render */ /* ----------------------- GL_NV_conservative_raster ----------------------- */ #ifndef GL_NV_conservative_raster #define GL_NV_conservative_raster 1 #define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 #define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 #define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 #define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 typedef void (GLAPIENTRY * PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); #define glSubpixelPrecisionBiasNV GLEW_GET_FUN(__glewSubpixelPrecisionBiasNV) #define GLEW_NV_conservative_raster GLEW_GET_VAR(__GLEW_NV_conservative_raster) #endif /* GL_NV_conservative_raster */ /* -------------------- GL_NV_conservative_raster_dilate ------------------- */ #ifndef GL_NV_conservative_raster_dilate #define GL_NV_conservative_raster_dilate 1 #define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 #define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A #define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); #define glConservativeRasterParameterfNV GLEW_GET_FUN(__glewConservativeRasterParameterfNV) #define GLEW_NV_conservative_raster_dilate GLEW_GET_VAR(__GLEW_NV_conservative_raster_dilate) #endif /* GL_NV_conservative_raster_dilate */ /* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ #ifndef GL_NV_copy_depth_to_color #define GL_NV_copy_depth_to_color 1 #define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E #define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F #define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) #endif /* GL_NV_copy_depth_to_color */ /* ---------------------------- GL_NV_copy_image --------------------------- */ #ifndef GL_NV_copy_image #define GL_NV_copy_image 1 typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); #define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) #define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) #endif /* GL_NV_copy_image */ /* -------------------------- GL_NV_deep_texture3D ------------------------- */ #ifndef GL_NV_deep_texture3D #define GL_NV_deep_texture3D 1 #define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 #define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 #define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) #endif /* GL_NV_deep_texture3D */ /* ------------------------ GL_NV_depth_buffer_float ----------------------- */ #ifndef GL_NV_depth_buffer_float #define GL_NV_depth_buffer_float 1 #define GL_DEPTH_COMPONENT32F_NV 0x8DAB #define GL_DEPTH32F_STENCIL8_NV 0x8DAC #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD #define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); #define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) #define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) #define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) #define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) #endif /* GL_NV_depth_buffer_float */ /* --------------------------- GL_NV_depth_clamp --------------------------- */ #ifndef GL_NV_depth_clamp #define GL_NV_depth_clamp 1 #define GL_DEPTH_CLAMP_NV 0x864F #define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) #endif /* GL_NV_depth_clamp */ /* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ #ifndef GL_NV_depth_range_unclamped #define GL_NV_depth_range_unclamped 1 #define GL_SAMPLE_COUNT_BITS_NV 0x8864 #define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 #define GL_QUERY_RESULT_NV 0x8866 #define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 #define GL_SAMPLE_COUNT_NV 0x8914 #define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) #endif /* GL_NV_depth_range_unclamped */ /* --------------------------- GL_NV_draw_texture -------------------------- */ #ifndef GL_NV_draw_texture #define GL_NV_draw_texture 1 typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); #define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) #define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) #endif /* GL_NV_draw_texture */ /* ---------------------------- GL_NV_evaluators --------------------------- */ #ifndef GL_NV_evaluators #define GL_NV_evaluators 1 #define GL_EVAL_2D_NV 0x86C0 #define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 #define GL_MAP_TESSELLATION_NV 0x86C2 #define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 #define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 #define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 #define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 #define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 #define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 #define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 #define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA #define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB #define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC #define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD #define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE #define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF #define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 #define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 #define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 #define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 #define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 #define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 #define GL_MAX_MAP_TESSELLATION_NV 0x86D6 #define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); #define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) #define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) #define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) #define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) #define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) #define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) #define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) #define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) #define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) #define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) #endif /* GL_NV_evaluators */ /* ----------------------- GL_NV_explicit_multisample ---------------------- */ #ifndef GL_NV_explicit_multisample #define GL_NV_explicit_multisample 1 #define GL_SAMPLE_POSITION_NV 0x8E50 #define GL_SAMPLE_MASK_NV 0x8E51 #define GL_SAMPLE_MASK_VALUE_NV 0x8E52 #define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 #define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 #define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 #define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 #define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 #define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 #define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); #define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) #define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) #define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) #define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) #endif /* GL_NV_explicit_multisample */ /* ------------------------------ GL_NV_fence ------------------------------ */ #ifndef GL_NV_fence #define GL_NV_fence 1 #define GL_ALL_COMPLETED_NV 0x84F2 #define GL_FENCE_STATUS_NV 0x84F3 #define GL_FENCE_CONDITION_NV 0x84F4 typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); #define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) #define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) #define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) #define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) #define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) #define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) #define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) #define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) #endif /* GL_NV_fence */ /* -------------------------- GL_NV_fill_rectangle ------------------------- */ #ifndef GL_NV_fill_rectangle #define GL_NV_fill_rectangle 1 #define GL_FILL_RECTANGLE_NV 0x933C #define GLEW_NV_fill_rectangle GLEW_GET_VAR(__GLEW_NV_fill_rectangle) #endif /* GL_NV_fill_rectangle */ /* --------------------------- GL_NV_float_buffer -------------------------- */ #ifndef GL_NV_float_buffer #define GL_NV_float_buffer 1 #define GL_FLOAT_R_NV 0x8880 #define GL_FLOAT_RG_NV 0x8881 #define GL_FLOAT_RGB_NV 0x8882 #define GL_FLOAT_RGBA_NV 0x8883 #define GL_FLOAT_R16_NV 0x8884 #define GL_FLOAT_R32_NV 0x8885 #define GL_FLOAT_RG16_NV 0x8886 #define GL_FLOAT_RG32_NV 0x8887 #define GL_FLOAT_RGB16_NV 0x8888 #define GL_FLOAT_RGB32_NV 0x8889 #define GL_FLOAT_RGBA16_NV 0x888A #define GL_FLOAT_RGBA32_NV 0x888B #define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C #define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D #define GL_FLOAT_RGBA_MODE_NV 0x888E #define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) #endif /* GL_NV_float_buffer */ /* --------------------------- GL_NV_fog_distance -------------------------- */ #ifndef GL_NV_fog_distance #define GL_NV_fog_distance 1 #define GL_FOG_DISTANCE_MODE_NV 0x855A #define GL_EYE_RADIAL_NV 0x855B #define GL_EYE_PLANE_ABSOLUTE_NV 0x855C #define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) #endif /* GL_NV_fog_distance */ /* -------------------- GL_NV_fragment_coverage_to_color ------------------- */ #ifndef GL_NV_fragment_coverage_to_color #define GL_NV_fragment_coverage_to_color 1 #define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD #define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE typedef void (GLAPIENTRY * PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); #define glFragmentCoverageColorNV GLEW_GET_FUN(__glewFragmentCoverageColorNV) #define GLEW_NV_fragment_coverage_to_color GLEW_GET_VAR(__GLEW_NV_fragment_coverage_to_color) #endif /* GL_NV_fragment_coverage_to_color */ /* ------------------------- GL_NV_fragment_program ------------------------ */ #ifndef GL_NV_fragment_program #define GL_NV_fragment_program 1 #define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 #define GL_FRAGMENT_PROGRAM_NV 0x8870 #define GL_MAX_TEXTURE_COORDS_NV 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 #define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 #define GL_PROGRAM_ERROR_STRING_NV 0x8874 typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); #define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) #define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) #define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) #define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) #define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) #define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) #define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) #endif /* GL_NV_fragment_program */ /* ------------------------ GL_NV_fragment_program2 ------------------------ */ #ifndef GL_NV_fragment_program2 #define GL_NV_fragment_program2 1 #define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 #define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 #define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 #define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 #define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 #define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) #endif /* GL_NV_fragment_program2 */ /* ------------------------ GL_NV_fragment_program4 ------------------------ */ #ifndef GL_NV_fragment_program4 #define GL_NV_fragment_program4 1 #define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) #endif /* GL_NV_fragment_program4 */ /* --------------------- GL_NV_fragment_program_option --------------------- */ #ifndef GL_NV_fragment_program_option #define GL_NV_fragment_program_option 1 #define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) #endif /* GL_NV_fragment_program_option */ /* -------------------- GL_NV_fragment_shader_interlock -------------------- */ #ifndef GL_NV_fragment_shader_interlock #define GL_NV_fragment_shader_interlock 1 #define GLEW_NV_fragment_shader_interlock GLEW_GET_VAR(__GLEW_NV_fragment_shader_interlock) #endif /* GL_NV_fragment_shader_interlock */ /* -------------------- GL_NV_framebuffer_mixed_samples -------------------- */ #ifndef GL_NV_framebuffer_mixed_samples #define GL_NV_framebuffer_mixed_samples 1 #define GL_COLOR_SAMPLES_NV 0x8E20 #define GL_RASTER_MULTISAMPLE_EXT 0x9327 #define GL_RASTER_SAMPLES_EXT 0x9328 #define GL_MAX_RASTER_SAMPLES_EXT 0x9329 #define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A #define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B #define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C #define GL_DEPTH_SAMPLES_NV 0x932D #define GL_STENCIL_SAMPLES_NV 0x932E #define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F #define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 #define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 #define GLEW_NV_framebuffer_mixed_samples GLEW_GET_VAR(__GLEW_NV_framebuffer_mixed_samples) #endif /* GL_NV_framebuffer_mixed_samples */ /* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ #ifndef GL_NV_framebuffer_multisample_coverage #define GL_NV_framebuffer_multisample_coverage 1 #define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB #define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 #define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 #define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); #define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) #define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) #endif /* GL_NV_framebuffer_multisample_coverage */ /* ------------------------ GL_NV_geometry_program4 ------------------------ */ #ifndef GL_NV_geometry_program4 #define GL_NV_geometry_program4 1 #define GL_GEOMETRY_PROGRAM_NV 0x8C26 #define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 #define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); #define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) #define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) #endif /* GL_NV_geometry_program4 */ /* ------------------------- GL_NV_geometry_shader4 ------------------------ */ #ifndef GL_NV_geometry_shader4 #define GL_NV_geometry_shader4 1 #define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) #endif /* GL_NV_geometry_shader4 */ /* ------------------- GL_NV_geometry_shader_passthrough ------------------- */ #ifndef GL_NV_geometry_shader_passthrough #define GL_NV_geometry_shader_passthrough 1 #define GLEW_NV_geometry_shader_passthrough GLEW_GET_VAR(__GLEW_NV_geometry_shader_passthrough) #endif /* GL_NV_geometry_shader_passthrough */ /* --------------------------- GL_NV_gpu_program4 -------------------------- */ #ifndef GL_NV_gpu_program4 #define GL_NV_gpu_program4 1 #define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 #define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 #define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 #define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 #define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 #define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 #define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 #define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); #define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) #define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) #define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) #define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) #define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) #define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) #define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) #define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) #define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) #define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) #define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) #define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) #define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) #endif /* GL_NV_gpu_program4 */ /* --------------------------- GL_NV_gpu_program5 -------------------------- */ #ifndef GL_NV_gpu_program5 #define GL_NV_gpu_program5 1 #define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A #define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B #define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C #define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D #define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F #define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) #endif /* GL_NV_gpu_program5 */ /* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ #ifndef GL_NV_gpu_program5_mem_extended #define GL_NV_gpu_program5_mem_extended 1 #define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) #endif /* GL_NV_gpu_program5_mem_extended */ /* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ #ifndef GL_NV_gpu_program_fp64 #define GL_NV_gpu_program_fp64 1 #define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) #endif /* GL_NV_gpu_program_fp64 */ /* --------------------------- GL_NV_gpu_shader5 --------------------------- */ #ifndef GL_NV_gpu_shader5 #define GL_NV_gpu_shader5 1 #define GL_INT64_NV 0x140E #define GL_UNSIGNED_INT64_NV 0x140F #define GL_INT8_NV 0x8FE0 #define GL_INT8_VEC2_NV 0x8FE1 #define GL_INT8_VEC3_NV 0x8FE2 #define GL_INT8_VEC4_NV 0x8FE3 #define GL_INT16_NV 0x8FE4 #define GL_INT16_VEC2_NV 0x8FE5 #define GL_INT16_VEC3_NV 0x8FE6 #define GL_INT16_VEC4_NV 0x8FE7 #define GL_INT64_VEC2_NV 0x8FE9 #define GL_INT64_VEC3_NV 0x8FEA #define GL_INT64_VEC4_NV 0x8FEB #define GL_UNSIGNED_INT8_NV 0x8FEC #define GL_UNSIGNED_INT8_VEC2_NV 0x8FED #define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE #define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF #define GL_UNSIGNED_INT16_NV 0x8FF0 #define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 #define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 #define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 #define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 #define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 #define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 #define GL_FLOAT16_NV 0x8FF8 #define GL_FLOAT16_VEC2_NV 0x8FF9 #define GL_FLOAT16_VEC3_NV 0x8FFA #define GL_FLOAT16_VEC4_NV 0x8FFB typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); #define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) #define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) #define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) #define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) #define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) #define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) #define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) #define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) #define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) #define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) #define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) #define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) #define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) #define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) #define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) #define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) #define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) #define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) #define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) #define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) #define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) #define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) #define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) #define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) #define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) #define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) #define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) #define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) #define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) #define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) #define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) #define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) #define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) #define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) #define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) #endif /* GL_NV_gpu_shader5 */ /* ---------------------------- GL_NV_half_float --------------------------- */ #ifndef GL_NV_half_float #define GL_NV_half_float 1 #define GL_HALF_FLOAT_NV 0x140B typedef unsigned short GLhalf; typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); #define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) #define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) #define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) #define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) #define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) #define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) #define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) #define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) #define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) #define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) #define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) #define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) #define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) #define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) #define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) #define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) #define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) #define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) #define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) #define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) #define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) #define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) #define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) #define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) #define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) #define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) #define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) #define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) #define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) #define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) #define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) #define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) #define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) #define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) #define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) #define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) #define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) #define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) #define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) #define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) #define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) #define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) #define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) #define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) #define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) #define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) #define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) #endif /* GL_NV_half_float */ /* ------------------- GL_NV_internalformat_sample_query ------------------- */ #ifndef GL_NV_internalformat_sample_query #define GL_NV_internalformat_sample_query 1 #define GL_MULTISAMPLES_NV 0x9371 #define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 #define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 #define GL_CONFORMANT_NV 0x9374 typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); #define glGetInternalformatSampleivNV GLEW_GET_FUN(__glewGetInternalformatSampleivNV) #define GLEW_NV_internalformat_sample_query GLEW_GET_VAR(__GLEW_NV_internalformat_sample_query) #endif /* GL_NV_internalformat_sample_query */ /* ------------------------ GL_NV_light_max_exponent ----------------------- */ #ifndef GL_NV_light_max_exponent #define GL_NV_light_max_exponent 1 #define GL_MAX_SHININESS_NV 0x8504 #define GL_MAX_SPOT_EXPONENT_NV 0x8505 #define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) #endif /* GL_NV_light_max_exponent */ /* ----------------------- GL_NV_multisample_coverage ---------------------- */ #ifndef GL_NV_multisample_coverage #define GL_NV_multisample_coverage 1 #define GL_COLOR_SAMPLES_NV 0x8E20 #define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) #endif /* GL_NV_multisample_coverage */ /* --------------------- GL_NV_multisample_filter_hint --------------------- */ #ifndef GL_NV_multisample_filter_hint #define GL_NV_multisample_filter_hint 1 #define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 #define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) #endif /* GL_NV_multisample_filter_hint */ /* ------------------------- GL_NV_occlusion_query ------------------------- */ #ifndef GL_NV_occlusion_query #define GL_NV_occlusion_query 1 #define GL_PIXEL_COUNTER_BITS_NV 0x8864 #define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 #define GL_PIXEL_COUNT_NV 0x8866 #define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); #define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) #define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) #define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) #define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) #define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) #define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) #define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) #define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) #endif /* GL_NV_occlusion_query */ /* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ #ifndef GL_NV_packed_depth_stencil #define GL_NV_packed_depth_stencil 1 #define GL_DEPTH_STENCIL_NV 0x84F9 #define GL_UNSIGNED_INT_24_8_NV 0x84FA #define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) #endif /* GL_NV_packed_depth_stencil */ /* --------------------- GL_NV_parameter_buffer_object --------------------- */ #ifndef GL_NV_parameter_buffer_object #define GL_NV_parameter_buffer_object 1 #define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 #define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 #define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 #define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 #define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); #define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) #define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) #define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) #define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) #endif /* GL_NV_parameter_buffer_object */ /* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ #ifndef GL_NV_parameter_buffer_object2 #define GL_NV_parameter_buffer_object2 1 #define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) #endif /* GL_NV_parameter_buffer_object2 */ /* -------------------------- GL_NV_path_rendering ------------------------- */ #ifndef GL_NV_path_rendering #define GL_NV_path_rendering 1 #define GL_CLOSE_PATH_NV 0x00 #define GL_BOLD_BIT_NV 0x01 #define GL_GLYPH_WIDTH_BIT_NV 0x01 #define GL_GLYPH_HEIGHT_BIT_NV 0x02 #define GL_ITALIC_BIT_NV 0x02 #define GL_MOVE_TO_NV 0x02 #define GL_RELATIVE_MOVE_TO_NV 0x03 #define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 #define GL_LINE_TO_NV 0x04 #define GL_RELATIVE_LINE_TO_NV 0x05 #define GL_HORIZONTAL_LINE_TO_NV 0x06 #define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 #define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 #define GL_VERTICAL_LINE_TO_NV 0x08 #define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 #define GL_QUADRATIC_CURVE_TO_NV 0x0A #define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B #define GL_CUBIC_CURVE_TO_NV 0x0C #define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D #define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E #define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F #define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 #define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 #define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 #define GL_SMALL_CCW_ARC_TO_NV 0x12 #define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 #define GL_SMALL_CW_ARC_TO_NV 0x14 #define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 #define GL_LARGE_CCW_ARC_TO_NV 0x16 #define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 #define GL_LARGE_CW_ARC_TO_NV 0x18 #define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 #define GL_CONIC_CURVE_TO_NV 0x1A #define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B #define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 #define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 #define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 #define GL_ROUNDED_RECT_NV 0xE8 #define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 #define GL_ROUNDED_RECT2_NV 0xEA #define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB #define GL_ROUNDED_RECT4_NV 0xEC #define GL_RELATIVE_ROUNDED_RECT4_NV 0xED #define GL_ROUNDED_RECT8_NV 0xEE #define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF #define GL_RESTART_PATH_NV 0xF0 #define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 #define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 #define GL_RECT_NV 0xF6 #define GL_RELATIVE_RECT_NV 0xF7 #define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 #define GL_CIRCULAR_CW_ARC_TO_NV 0xFA #define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC #define GL_ARC_TO_NV 0xFE #define GL_RELATIVE_ARC_TO_NV 0xFF #define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 #define GL_PRIMARY_COLOR_NV 0x852C #define GL_SECONDARY_COLOR_NV 0x852D #define GL_PRIMARY_COLOR 0x8577 #define GL_PATH_FORMAT_SVG_NV 0x9070 #define GL_PATH_FORMAT_PS_NV 0x9071 #define GL_STANDARD_FONT_NAME_NV 0x9072 #define GL_SYSTEM_FONT_NAME_NV 0x9073 #define GL_FILE_NAME_NV 0x9074 #define GL_PATH_STROKE_WIDTH_NV 0x9075 #define GL_PATH_END_CAPS_NV 0x9076 #define GL_PATH_INITIAL_END_CAP_NV 0x9077 #define GL_PATH_TERMINAL_END_CAP_NV 0x9078 #define GL_PATH_JOIN_STYLE_NV 0x9079 #define GL_PATH_MITER_LIMIT_NV 0x907A #define GL_PATH_DASH_CAPS_NV 0x907B #define GL_PATH_INITIAL_DASH_CAP_NV 0x907C #define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D #define GL_PATH_DASH_OFFSET_NV 0x907E #define GL_PATH_CLIENT_LENGTH_NV 0x907F #define GL_PATH_FILL_MODE_NV 0x9080 #define GL_PATH_FILL_MASK_NV 0x9081 #define GL_PATH_FILL_COVER_MODE_NV 0x9082 #define GL_PATH_STROKE_COVER_MODE_NV 0x9083 #define GL_PATH_STROKE_MASK_NV 0x9084 #define GL_PATH_STROKE_BOUND_NV 0x9086 #define GL_COUNT_UP_NV 0x9088 #define GL_COUNT_DOWN_NV 0x9089 #define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A #define GL_CONVEX_HULL_NV 0x908B #define GL_BOUNDING_BOX_NV 0x908D #define GL_TRANSLATE_X_NV 0x908E #define GL_TRANSLATE_Y_NV 0x908F #define GL_TRANSLATE_2D_NV 0x9090 #define GL_TRANSLATE_3D_NV 0x9091 #define GL_AFFINE_2D_NV 0x9092 #define GL_AFFINE_3D_NV 0x9094 #define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 #define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 #define GL_UTF8_NV 0x909A #define GL_UTF16_NV 0x909B #define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C #define GL_PATH_COMMAND_COUNT_NV 0x909D #define GL_PATH_COORD_COUNT_NV 0x909E #define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F #define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 #define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 #define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 #define GL_SQUARE_NV 0x90A3 #define GL_ROUND_NV 0x90A4 #define GL_TRIANGULAR_NV 0x90A5 #define GL_BEVEL_NV 0x90A6 #define GL_MITER_REVERT_NV 0x90A7 #define GL_MITER_TRUNCATE_NV 0x90A8 #define GL_SKIP_MISSING_GLYPH_NV 0x90A9 #define GL_USE_MISSING_GLYPH_NV 0x90AA #define GL_PATH_ERROR_POSITION_NV 0x90AB #define GL_PATH_FOG_GEN_MODE_NV 0x90AC #define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD #define GL_ADJACENT_PAIRS_NV 0x90AE #define GL_FIRST_TO_REST_NV 0x90AF #define GL_PATH_GEN_MODE_NV 0x90B0 #define GL_PATH_GEN_COEFF_NV 0x90B1 #define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 #define GL_PATH_GEN_COMPONENTS_NV 0x90B3 #define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 #define GL_MOVE_TO_RESETS_NV 0x90B5 #define GL_MOVE_TO_CONTINUES_NV 0x90B6 #define GL_PATH_STENCIL_FUNC_NV 0x90B7 #define GL_PATH_STENCIL_REF_NV 0x90B8 #define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 #define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD #define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE #define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF #define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 #define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 #define GL_FONT_UNAVAILABLE_NV 0x936A #define GL_FONT_UNINTELLIGIBLE_NV 0x936B #define GL_STANDARD_FONT_FORMAT_NV 0x936C #define GL_FRAGMENT_INPUT_NV 0x936D #define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 #define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 #define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 #define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 #define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 #define GL_FONT_ASCENDER_BIT_NV 0x00200000 #define GL_FONT_DESCENDER_BIT_NV 0x00400000 #define GL_FONT_HEIGHT_BIT_NV 0x00800000 #define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 #define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 #define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 #define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 #define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 #define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte* commands); typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat* coords); typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat* dashArray); typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat* value); typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint* value); typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params); typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (GLAPIENTRY * PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); typedef void (GLAPIENTRY * PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); #define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) #define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) #define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) #define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) #define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) #define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) #define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) #define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) #define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) #define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) #define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) #define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) #define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) #define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) #define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) #define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) #define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) #define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) #define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) #define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) #define glGetProgramResourcefvNV GLEW_GET_FUN(__glewGetProgramResourcefvNV) #define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) #define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) #define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) #define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) #define glMatrixLoad3x2fNV GLEW_GET_FUN(__glewMatrixLoad3x2fNV) #define glMatrixLoad3x3fNV GLEW_GET_FUN(__glewMatrixLoad3x3fNV) #define glMatrixLoadTranspose3x3fNV GLEW_GET_FUN(__glewMatrixLoadTranspose3x3fNV) #define glMatrixMult3x2fNV GLEW_GET_FUN(__glewMatrixMult3x2fNV) #define glMatrixMult3x3fNV GLEW_GET_FUN(__glewMatrixMult3x3fNV) #define glMatrixMultTranspose3x3fNV GLEW_GET_FUN(__glewMatrixMultTranspose3x3fNV) #define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) #define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) #define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) #define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) #define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) #define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) #define glPathGlyphIndexArrayNV GLEW_GET_FUN(__glewPathGlyphIndexArrayNV) #define glPathGlyphIndexRangeNV GLEW_GET_FUN(__glewPathGlyphIndexRangeNV) #define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) #define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) #define glPathMemoryGlyphIndexArrayNV GLEW_GET_FUN(__glewPathMemoryGlyphIndexArrayNV) #define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) #define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) #define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) #define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) #define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) #define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) #define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) #define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) #define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) #define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) #define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) #define glProgramPathFragmentInputGenNV GLEW_GET_FUN(__glewProgramPathFragmentInputGenNV) #define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) #define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) #define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) #define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) #define glStencilThenCoverFillPathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverFillPathInstancedNV) #define glStencilThenCoverFillPathNV GLEW_GET_FUN(__glewStencilThenCoverFillPathNV) #define glStencilThenCoverStrokePathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathInstancedNV) #define glStencilThenCoverStrokePathNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathNV) #define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) #define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) #define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) #endif /* GL_NV_path_rendering */ /* -------------------- GL_NV_path_rendering_shared_edge ------------------- */ #ifndef GL_NV_path_rendering_shared_edge #define GL_NV_path_rendering_shared_edge 1 #define GL_SHARED_EDGE_NV 0xC0 #define GLEW_NV_path_rendering_shared_edge GLEW_GET_VAR(__GLEW_NV_path_rendering_shared_edge) #endif /* GL_NV_path_rendering_shared_edge */ /* ------------------------- GL_NV_pixel_data_range ------------------------ */ #ifndef GL_NV_pixel_data_range #define GL_NV_pixel_data_range 1 #define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 #define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 #define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A #define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B #define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C #define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void *pointer); #define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) #define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) #define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) #endif /* GL_NV_pixel_data_range */ /* --------------------------- GL_NV_point_sprite -------------------------- */ #ifndef GL_NV_point_sprite #define GL_NV_point_sprite 1 #define GL_POINT_SPRITE_NV 0x8861 #define GL_COORD_REPLACE_NV 0x8862 #define GL_POINT_SPRITE_R_MODE_NV 0x8863 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); #define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) #define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) #define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) #endif /* GL_NV_point_sprite */ /* -------------------------- GL_NV_present_video -------------------------- */ #ifndef GL_NV_present_video #define GL_NV_present_video 1 #define GL_FRAME_NV 0x8E26 #define GL_FIELDS_NV 0x8E27 #define GL_CURRENT_TIME_NV 0x8E28 #define GL_NUM_FILL_STREAMS_NV 0x8E29 #define GL_PRESENT_TIME_NV 0x8E2A #define GL_PRESENT_DURATION_NV 0x8E2B typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); #define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) #define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) #define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) #define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) #define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) #define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) #define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) #endif /* GL_NV_present_video */ /* ------------------------ GL_NV_primitive_restart ------------------------ */ #ifndef GL_NV_primitive_restart #define GL_NV_primitive_restart 1 #define GL_PRIMITIVE_RESTART_NV 0x8558 #define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); #define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) #define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) #define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) #endif /* GL_NV_primitive_restart */ /* ------------------------ GL_NV_register_combiners ----------------------- */ #ifndef GL_NV_register_combiners #define GL_NV_register_combiners 1 #define GL_REGISTER_COMBINERS_NV 0x8522 #define GL_VARIABLE_A_NV 0x8523 #define GL_VARIABLE_B_NV 0x8524 #define GL_VARIABLE_C_NV 0x8525 #define GL_VARIABLE_D_NV 0x8526 #define GL_VARIABLE_E_NV 0x8527 #define GL_VARIABLE_F_NV 0x8528 #define GL_VARIABLE_G_NV 0x8529 #define GL_CONSTANT_COLOR0_NV 0x852A #define GL_CONSTANT_COLOR1_NV 0x852B #define GL_PRIMARY_COLOR_NV 0x852C #define GL_SECONDARY_COLOR_NV 0x852D #define GL_SPARE0_NV 0x852E #define GL_SPARE1_NV 0x852F #define GL_DISCARD_NV 0x8530 #define GL_E_TIMES_F_NV 0x8531 #define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 #define GL_UNSIGNED_IDENTITY_NV 0x8536 #define GL_UNSIGNED_INVERT_NV 0x8537 #define GL_EXPAND_NORMAL_NV 0x8538 #define GL_EXPAND_NEGATE_NV 0x8539 #define GL_HALF_BIAS_NORMAL_NV 0x853A #define GL_HALF_BIAS_NEGATE_NV 0x853B #define GL_SIGNED_IDENTITY_NV 0x853C #define GL_SIGNED_NEGATE_NV 0x853D #define GL_SCALE_BY_TWO_NV 0x853E #define GL_SCALE_BY_FOUR_NV 0x853F #define GL_SCALE_BY_ONE_HALF_NV 0x8540 #define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 #define GL_COMBINER_INPUT_NV 0x8542 #define GL_COMBINER_MAPPING_NV 0x8543 #define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 #define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 #define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 #define GL_COMBINER_MUX_SUM_NV 0x8547 #define GL_COMBINER_SCALE_NV 0x8548 #define GL_COMBINER_BIAS_NV 0x8549 #define GL_COMBINER_AB_OUTPUT_NV 0x854A #define GL_COMBINER_CD_OUTPUT_NV 0x854B #define GL_COMBINER_SUM_OUTPUT_NV 0x854C #define GL_MAX_GENERAL_COMBINERS_NV 0x854D #define GL_NUM_GENERAL_COMBINERS_NV 0x854E #define GL_COLOR_SUM_CLAMP_NV 0x854F #define GL_COMBINER0_NV 0x8550 #define GL_COMBINER1_NV 0x8551 #define GL_COMBINER2_NV 0x8552 #define GL_COMBINER3_NV 0x8553 #define GL_COMBINER4_NV 0x8554 #define GL_COMBINER5_NV 0x8555 #define GL_COMBINER6_NV 0x8556 #define GL_COMBINER7_NV 0x8557 typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); #define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) #define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) #define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) #define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) #define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) #define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) #define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) #define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) #define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) #define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) #define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) #define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) #define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) #define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) #endif /* GL_NV_register_combiners */ /* ----------------------- GL_NV_register_combiners2 ----------------------- */ #ifndef GL_NV_register_combiners2 #define GL_NV_register_combiners2 1 #define GL_PER_STAGE_CONSTANTS_NV 0x8535 typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); #define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) #define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) #define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) #endif /* GL_NV_register_combiners2 */ /* ------------------------- GL_NV_sample_locations ------------------------ */ #ifndef GL_NV_sample_locations #define GL_NV_sample_locations 1 #define GL_SAMPLE_LOCATION_NV 0x8E50 #define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D #define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E #define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F #define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 #define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 #define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 #define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); #define glFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewFramebufferSampleLocationsfvNV) #define glNamedFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvNV) #define GLEW_NV_sample_locations GLEW_GET_VAR(__GLEW_NV_sample_locations) #endif /* GL_NV_sample_locations */ /* ------------------ GL_NV_sample_mask_override_coverage ------------------ */ #ifndef GL_NV_sample_mask_override_coverage #define GL_NV_sample_mask_override_coverage 1 #define GLEW_NV_sample_mask_override_coverage GLEW_GET_VAR(__GLEW_NV_sample_mask_override_coverage) #endif /* GL_NV_sample_mask_override_coverage */ /* ---------------------- GL_NV_shader_atomic_counters --------------------- */ #ifndef GL_NV_shader_atomic_counters #define GL_NV_shader_atomic_counters 1 #define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) #endif /* GL_NV_shader_atomic_counters */ /* ----------------------- GL_NV_shader_atomic_float ----------------------- */ #ifndef GL_NV_shader_atomic_float #define GL_NV_shader_atomic_float 1 #define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) #endif /* GL_NV_shader_atomic_float */ /* -------------------- GL_NV_shader_atomic_fp16_vector -------------------- */ #ifndef GL_NV_shader_atomic_fp16_vector #define GL_NV_shader_atomic_fp16_vector 1 #define GLEW_NV_shader_atomic_fp16_vector GLEW_GET_VAR(__GLEW_NV_shader_atomic_fp16_vector) #endif /* GL_NV_shader_atomic_fp16_vector */ /* ----------------------- GL_NV_shader_atomic_int64 ----------------------- */ #ifndef GL_NV_shader_atomic_int64 #define GL_NV_shader_atomic_int64 1 #define GLEW_NV_shader_atomic_int64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_int64) #endif /* GL_NV_shader_atomic_int64 */ /* ------------------------ GL_NV_shader_buffer_load ----------------------- */ #ifndef GL_NV_shader_buffer_load #define GL_NV_shader_buffer_load 1 #define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D #define GL_GPU_ADDRESS_NV 0x8F34 #define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); #define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) #define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) #define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) #define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) #define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) #define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) #define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) #define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) #define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) #define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) #define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) #define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) #define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) #define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) #endif /* GL_NV_shader_buffer_load */ /* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ #ifndef GL_NV_shader_storage_buffer_object #define GL_NV_shader_storage_buffer_object 1 #define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) #endif /* GL_NV_shader_storage_buffer_object */ /* ----------------------- GL_NV_shader_thread_group ----------------------- */ #ifndef GL_NV_shader_thread_group #define GL_NV_shader_thread_group 1 #define GL_WARP_SIZE_NV 0x9339 #define GL_WARPS_PER_SM_NV 0x933A #define GL_SM_COUNT_NV 0x933B #define GLEW_NV_shader_thread_group GLEW_GET_VAR(__GLEW_NV_shader_thread_group) #endif /* GL_NV_shader_thread_group */ /* ---------------------- GL_NV_shader_thread_shuffle ---------------------- */ #ifndef GL_NV_shader_thread_shuffle #define GL_NV_shader_thread_shuffle 1 #define GLEW_NV_shader_thread_shuffle GLEW_GET_VAR(__GLEW_NV_shader_thread_shuffle) #endif /* GL_NV_shader_thread_shuffle */ /* ---------------------- GL_NV_tessellation_program5 ---------------------- */ #ifndef GL_NV_tessellation_program5 #define GL_NV_tessellation_program5 1 #define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 #define GL_TESS_CONTROL_PROGRAM_NV 0x891E #define GL_TESS_EVALUATION_PROGRAM_NV 0x891F #define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 #define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 #define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) #endif /* GL_NV_tessellation_program5 */ /* -------------------------- GL_NV_texgen_emboss -------------------------- */ #ifndef GL_NV_texgen_emboss #define GL_NV_texgen_emboss 1 #define GL_EMBOSS_LIGHT_NV 0x855D #define GL_EMBOSS_CONSTANT_NV 0x855E #define GL_EMBOSS_MAP_NV 0x855F #define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) #endif /* GL_NV_texgen_emboss */ /* ------------------------ GL_NV_texgen_reflection ------------------------ */ #ifndef GL_NV_texgen_reflection #define GL_NV_texgen_reflection 1 #define GL_NORMAL_MAP_NV 0x8511 #define GL_REFLECTION_MAP_NV 0x8512 #define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) #endif /* GL_NV_texgen_reflection */ /* ------------------------- GL_NV_texture_barrier ------------------------- */ #ifndef GL_NV_texture_barrier #define GL_NV_texture_barrier 1 typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); #define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) #define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) #endif /* GL_NV_texture_barrier */ /* --------------------- GL_NV_texture_compression_vtc --------------------- */ #ifndef GL_NV_texture_compression_vtc #define GL_NV_texture_compression_vtc 1 #define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) #endif /* GL_NV_texture_compression_vtc */ /* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ #ifndef GL_NV_texture_env_combine4 #define GL_NV_texture_env_combine4 1 #define GL_COMBINE4_NV 0x8503 #define GL_SOURCE3_RGB_NV 0x8583 #define GL_SOURCE3_ALPHA_NV 0x858B #define GL_OPERAND3_RGB_NV 0x8593 #define GL_OPERAND3_ALPHA_NV 0x859B #define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) #endif /* GL_NV_texture_env_combine4 */ /* ---------------------- GL_NV_texture_expand_normal ---------------------- */ #ifndef GL_NV_texture_expand_normal #define GL_NV_texture_expand_normal 1 #define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F #define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) #endif /* GL_NV_texture_expand_normal */ /* ----------------------- GL_NV_texture_multisample ----------------------- */ #ifndef GL_NV_texture_multisample #define GL_NV_texture_multisample 1 #define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 #define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); #define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) #define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) #define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) #define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) #define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) #define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) #define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) #endif /* GL_NV_texture_multisample */ /* ------------------------ GL_NV_texture_rectangle ------------------------ */ #ifndef GL_NV_texture_rectangle #define GL_NV_texture_rectangle 1 #define GL_TEXTURE_RECTANGLE_NV 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 #define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) #endif /* GL_NV_texture_rectangle */ /* -------------------------- GL_NV_texture_shader ------------------------- */ #ifndef GL_NV_texture_shader #define GL_NV_texture_shader 1 #define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C #define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D #define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E #define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 #define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA #define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB #define GL_DSDT_MAG_INTENSITY_NV 0x86DC #define GL_SHADER_CONSISTENT_NV 0x86DD #define GL_TEXTURE_SHADER_NV 0x86DE #define GL_SHADER_OPERATION_NV 0x86DF #define GL_CULL_MODES_NV 0x86E0 #define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 #define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 #define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 #define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 #define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 #define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 #define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 #define GL_CONST_EYE_NV 0x86E5 #define GL_PASS_THROUGH_NV 0x86E6 #define GL_CULL_FRAGMENT_NV 0x86E7 #define GL_OFFSET_TEXTURE_2D_NV 0x86E8 #define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 #define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA #define GL_DOT_PRODUCT_NV 0x86EC #define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED #define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE #define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 #define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 #define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 #define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 #define GL_HILO_NV 0x86F4 #define GL_DSDT_NV 0x86F5 #define GL_DSDT_MAG_NV 0x86F6 #define GL_DSDT_MAG_VIB_NV 0x86F7 #define GL_HILO16_NV 0x86F8 #define GL_SIGNED_HILO_NV 0x86F9 #define GL_SIGNED_HILO16_NV 0x86FA #define GL_SIGNED_RGBA_NV 0x86FB #define GL_SIGNED_RGBA8_NV 0x86FC #define GL_SIGNED_RGB_NV 0x86FE #define GL_SIGNED_RGB8_NV 0x86FF #define GL_SIGNED_LUMINANCE_NV 0x8701 #define GL_SIGNED_LUMINANCE8_NV 0x8702 #define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 #define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 #define GL_SIGNED_ALPHA_NV 0x8705 #define GL_SIGNED_ALPHA8_NV 0x8706 #define GL_SIGNED_INTENSITY_NV 0x8707 #define GL_SIGNED_INTENSITY8_NV 0x8708 #define GL_DSDT8_NV 0x8709 #define GL_DSDT8_MAG8_NV 0x870A #define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B #define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C #define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D #define GL_HI_SCALE_NV 0x870E #define GL_LO_SCALE_NV 0x870F #define GL_DS_SCALE_NV 0x8710 #define GL_DT_SCALE_NV 0x8711 #define GL_MAGNITUDE_SCALE_NV 0x8712 #define GL_VIBRANCE_SCALE_NV 0x8713 #define GL_HI_BIAS_NV 0x8714 #define GL_LO_BIAS_NV 0x8715 #define GL_DS_BIAS_NV 0x8716 #define GL_DT_BIAS_NV 0x8717 #define GL_MAGNITUDE_BIAS_NV 0x8718 #define GL_VIBRANCE_BIAS_NV 0x8719 #define GL_TEXTURE_BORDER_VALUES_NV 0x871A #define GL_TEXTURE_HI_SIZE_NV 0x871B #define GL_TEXTURE_LO_SIZE_NV 0x871C #define GL_TEXTURE_DS_SIZE_NV 0x871D #define GL_TEXTURE_DT_SIZE_NV 0x871E #define GL_TEXTURE_MAG_SIZE_NV 0x871F #define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) #endif /* GL_NV_texture_shader */ /* ------------------------- GL_NV_texture_shader2 ------------------------- */ #ifndef GL_NV_texture_shader2 #define GL_NV_texture_shader2 1 #define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA #define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB #define GL_DSDT_MAG_INTENSITY_NV 0x86DC #define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF #define GL_HILO_NV 0x86F4 #define GL_DSDT_NV 0x86F5 #define GL_DSDT_MAG_NV 0x86F6 #define GL_DSDT_MAG_VIB_NV 0x86F7 #define GL_HILO16_NV 0x86F8 #define GL_SIGNED_HILO_NV 0x86F9 #define GL_SIGNED_HILO16_NV 0x86FA #define GL_SIGNED_RGBA_NV 0x86FB #define GL_SIGNED_RGBA8_NV 0x86FC #define GL_SIGNED_RGB_NV 0x86FE #define GL_SIGNED_RGB8_NV 0x86FF #define GL_SIGNED_LUMINANCE_NV 0x8701 #define GL_SIGNED_LUMINANCE8_NV 0x8702 #define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 #define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 #define GL_SIGNED_ALPHA_NV 0x8705 #define GL_SIGNED_ALPHA8_NV 0x8706 #define GL_SIGNED_INTENSITY_NV 0x8707 #define GL_SIGNED_INTENSITY8_NV 0x8708 #define GL_DSDT8_NV 0x8709 #define GL_DSDT8_MAG8_NV 0x870A #define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B #define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C #define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D #define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) #endif /* GL_NV_texture_shader2 */ /* ------------------------- GL_NV_texture_shader3 ------------------------- */ #ifndef GL_NV_texture_shader3 #define GL_NV_texture_shader3 1 #define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 #define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 #define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 #define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 #define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 #define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 #define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 #define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 #define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 #define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 #define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A #define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B #define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C #define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D #define GL_HILO8_NV 0x885E #define GL_SIGNED_HILO8_NV 0x885F #define GL_FORCE_BLUE_TO_ONE_NV 0x8860 #define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) #endif /* GL_NV_texture_shader3 */ /* ------------------------ GL_NV_transform_feedback ----------------------- */ #ifndef GL_NV_transform_feedback #define GL_NV_transform_feedback 1 #define GL_BACK_PRIMARY_COLOR_NV 0x8C77 #define GL_BACK_SECONDARY_COLOR_NV 0x8C78 #define GL_TEXTURE_COORD_NV 0x8C79 #define GL_CLIP_DISTANCE_NV 0x8C7A #define GL_VERTEX_ID_NV 0x8C7B #define GL_PRIMITIVE_ID_NV 0x8C7C #define GL_GENERIC_ATTRIB_NV 0x8C7D #define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 #define GL_ACTIVE_VARYINGS_NV 0x8C81 #define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 #define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 #define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 #define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 #define GL_PRIMITIVES_GENERATED_NV 0x8C87 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 #define GL_RASTERIZER_DISCARD_NV 0x8C89 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B #define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C #define GL_SEPARATE_ATTRIBS_NV 0x8C8D #define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); #define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) #define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) #define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) #define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) #define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) #define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) #define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) #define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) #define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) #define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) #define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) #define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) #endif /* GL_NV_transform_feedback */ /* ----------------------- GL_NV_transform_feedback2 ----------------------- */ #ifndef GL_NV_transform_feedback2 #define GL_NV_transform_feedback2 1 #define GL_TRANSFORM_FEEDBACK_NV 0x8E22 #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 #define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); #define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) #define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) #define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) #define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) #define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) #define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) #define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) #define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) #endif /* GL_NV_transform_feedback2 */ /* ------------------ GL_NV_uniform_buffer_unified_memory ------------------ */ #ifndef GL_NV_uniform_buffer_unified_memory #define GL_NV_uniform_buffer_unified_memory 1 #define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E #define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F #define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 #define GLEW_NV_uniform_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_uniform_buffer_unified_memory) #endif /* GL_NV_uniform_buffer_unified_memory */ /* -------------------------- GL_NV_vdpau_interop -------------------------- */ #ifndef GL_NV_vdpau_interop #define GL_NV_vdpau_interop 1 #define GL_SURFACE_STATE_NV 0x86EB #define GL_SURFACE_REGISTERED_NV 0x86FD #define GL_SURFACE_MAPPED_NV 0x8700 #define GL_WRITE_DISCARD_NV 0x88BE typedef GLintptr GLvdpauSurfaceNV; typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const void*getProcAddress); typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); #define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) #define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) #define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) #define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) #define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) #define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) #define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) #define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) #define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) #define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) #define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) #endif /* GL_NV_vdpau_interop */ /* ------------------------ GL_NV_vertex_array_range ----------------------- */ #ifndef GL_NV_vertex_array_range #define GL_NV_vertex_array_range 1 #define GL_VERTEX_ARRAY_RANGE_NV 0x851D #define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E #define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 #define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void *pointer); #define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) #define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) #define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) #endif /* GL_NV_vertex_array_range */ /* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ #ifndef GL_NV_vertex_array_range2 #define GL_NV_vertex_array_range2 1 #define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 #define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) #endif /* GL_NV_vertex_array_range2 */ /* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ #ifndef GL_NV_vertex_attrib_integer_64bit #define GL_NV_vertex_attrib_integer_64bit 1 #define GL_INT64_NV 0x140E #define GL_UNSIGNED_INT64_NV 0x140F typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); #define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) #define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) #define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) #define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) #define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) #define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) #define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) #define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) #define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) #define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) #define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) #define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) #define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) #define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) #define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) #define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) #define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) #define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) #define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) #define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) #endif /* GL_NV_vertex_attrib_integer_64bit */ /* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ #ifndef GL_NV_vertex_buffer_unified_memory #define GL_NV_vertex_buffer_unified_memory 1 #define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E #define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F #define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 #define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 #define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 #define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 #define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 #define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 #define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 #define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 #define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 #define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 #define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A #define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B #define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C #define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D #define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E #define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F #define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 #define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 #define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 #define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 #define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 #define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 #define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); #define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) #define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) #define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) #define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) #define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) #define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) #define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) #define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) #define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) #define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) #define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) #define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) #define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) #endif /* GL_NV_vertex_buffer_unified_memory */ /* -------------------------- GL_NV_vertex_program ------------------------- */ #ifndef GL_NV_vertex_program #define GL_NV_vertex_program 1 #define GL_VERTEX_PROGRAM_NV 0x8620 #define GL_VERTEX_STATE_PROGRAM_NV 0x8621 #define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 #define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 #define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 #define GL_CURRENT_ATTRIB_NV 0x8626 #define GL_PROGRAM_LENGTH_NV 0x8627 #define GL_PROGRAM_STRING_NV 0x8628 #define GL_MODELVIEW_PROJECTION_NV 0x8629 #define GL_IDENTITY_NV 0x862A #define GL_INVERSE_NV 0x862B #define GL_TRANSPOSE_NV 0x862C #define GL_INVERSE_TRANSPOSE_NV 0x862D #define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E #define GL_MAX_TRACK_MATRICES_NV 0x862F #define GL_MATRIX0_NV 0x8630 #define GL_MATRIX1_NV 0x8631 #define GL_MATRIX2_NV 0x8632 #define GL_MATRIX3_NV 0x8633 #define GL_MATRIX4_NV 0x8634 #define GL_MATRIX5_NV 0x8635 #define GL_MATRIX6_NV 0x8636 #define GL_MATRIX7_NV 0x8637 #define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 #define GL_CURRENT_MATRIX_NV 0x8641 #define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 #define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 #define GL_PROGRAM_PARAMETER_NV 0x8644 #define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 #define GL_PROGRAM_TARGET_NV 0x8646 #define GL_PROGRAM_RESIDENT_NV 0x8647 #define GL_TRACK_MATRIX_NV 0x8648 #define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 #define GL_VERTEX_PROGRAM_BINDING_NV 0x864A #define GL_PROGRAM_ERROR_POSITION_NV 0x864B #define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 #define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 #define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 #define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 #define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 #define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 #define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 #define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 #define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 #define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 #define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A #define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B #define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C #define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D #define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E #define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F #define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 #define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 #define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 #define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 #define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 #define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 #define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 #define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 #define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 #define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 #define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A #define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B #define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C #define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D #define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E #define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F #define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 #define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 #define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 #define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 #define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 #define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 #define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 #define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 #define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 #define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 #define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A #define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B #define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C #define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D #define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E #define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); #define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) #define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) #define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) #define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) #define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) #define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) #define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) #define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) #define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) #define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) #define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) #define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) #define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) #define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) #define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) #define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) #define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) #define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) #define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) #define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) #define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) #define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) #define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) #define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) #define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) #define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) #define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) #define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) #define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) #define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) #define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) #define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) #define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) #define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) #define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) #define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) #define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) #define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) #define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) #define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) #define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) #define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) #define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) #define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) #define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) #define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) #define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) #define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) #define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) #define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) #define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) #define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) #define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) #define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) #define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) #define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) #define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) #define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) #define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) #define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) #define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) #define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) #define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) #define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) #define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) #endif /* GL_NV_vertex_program */ /* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ #ifndef GL_NV_vertex_program1_1 #define GL_NV_vertex_program1_1 1 #define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) #endif /* GL_NV_vertex_program1_1 */ /* ------------------------- GL_NV_vertex_program2 ------------------------- */ #ifndef GL_NV_vertex_program2 #define GL_NV_vertex_program2 1 #define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) #endif /* GL_NV_vertex_program2 */ /* ---------------------- GL_NV_vertex_program2_option --------------------- */ #ifndef GL_NV_vertex_program2_option #define GL_NV_vertex_program2_option 1 #define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 #define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 #define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) #endif /* GL_NV_vertex_program2_option */ /* ------------------------- GL_NV_vertex_program3 ------------------------- */ #ifndef GL_NV_vertex_program3 #define GL_NV_vertex_program3 1 #define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C #define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) #endif /* GL_NV_vertex_program3 */ /* ------------------------- GL_NV_vertex_program4 ------------------------- */ #ifndef GL_NV_vertex_program4 #define GL_NV_vertex_program4 1 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD #define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) #endif /* GL_NV_vertex_program4 */ /* -------------------------- GL_NV_video_capture -------------------------- */ #ifndef GL_NV_video_capture #define GL_NV_video_capture 1 #define GL_VIDEO_BUFFER_NV 0x9020 #define GL_VIDEO_BUFFER_BINDING_NV 0x9021 #define GL_FIELD_UPPER_NV 0x9022 #define GL_FIELD_LOWER_NV 0x9023 #define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 #define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 #define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 #define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 #define GL_VIDEO_BUFFER_PITCH_NV 0x9028 #define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 #define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A #define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B #define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C #define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D #define GL_PARTIAL_SUCCESS_NV 0x902E #define GL_SUCCESS_NV 0x902F #define GL_FAILURE_NV 0x9030 #define GL_YCBYCR8_422_NV 0x9031 #define GL_YCBAYCR8A_4224_NV 0x9032 #define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 #define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 #define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 #define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 #define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 #define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 #define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 #define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A #define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B #define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); #define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) #define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) #define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) #define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) #define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) #define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) #define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) #define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) #define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) #define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) #define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) #define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) #define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) #endif /* GL_NV_video_capture */ /* ------------------------- GL_NV_viewport_array2 ------------------------- */ #ifndef GL_NV_viewport_array2 #define GL_NV_viewport_array2 1 #define GLEW_NV_viewport_array2 GLEW_GET_VAR(__GLEW_NV_viewport_array2) #endif /* GL_NV_viewport_array2 */ /* ------------------------ GL_OES_byte_coordinates ------------------------ */ #ifndef GL_OES_byte_coordinates #define GL_OES_byte_coordinates 1 #define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) #endif /* GL_OES_byte_coordinates */ /* ------------------- GL_OES_compressed_paletted_texture ------------------ */ #ifndef GL_OES_compressed_paletted_texture #define GL_OES_compressed_paletted_texture 1 #define GL_PALETTE4_RGB8_OES 0x8B90 #define GL_PALETTE4_RGBA8_OES 0x8B91 #define GL_PALETTE4_R5_G6_B5_OES 0x8B92 #define GL_PALETTE4_RGBA4_OES 0x8B93 #define GL_PALETTE4_RGB5_A1_OES 0x8B94 #define GL_PALETTE8_RGB8_OES 0x8B95 #define GL_PALETTE8_RGBA8_OES 0x8B96 #define GL_PALETTE8_R5_G6_B5_OES 0x8B97 #define GL_PALETTE8_RGBA4_OES 0x8B98 #define GL_PALETTE8_RGB5_A1_OES 0x8B99 #define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) #endif /* GL_OES_compressed_paletted_texture */ /* --------------------------- GL_OES_read_format -------------------------- */ #ifndef GL_OES_read_format #define GL_OES_read_format 1 #define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B #define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) #endif /* GL_OES_read_format */ /* ------------------------ GL_OES_single_precision ------------------------ */ #ifndef GL_OES_single_precision #define GL_OES_single_precision 1 typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); #define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) #define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) #define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) #define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) #define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) #define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) #define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) #endif /* GL_OES_single_precision */ /* ---------------------------- GL_OML_interlace --------------------------- */ #ifndef GL_OML_interlace #define GL_OML_interlace 1 #define GL_INTERLACE_OML 0x8980 #define GL_INTERLACE_READ_OML 0x8981 #define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) #endif /* GL_OML_interlace */ /* ---------------------------- GL_OML_resample ---------------------------- */ #ifndef GL_OML_resample #define GL_OML_resample 1 #define GL_PACK_RESAMPLE_OML 0x8984 #define GL_UNPACK_RESAMPLE_OML 0x8985 #define GL_RESAMPLE_REPLICATE_OML 0x8986 #define GL_RESAMPLE_ZERO_FILL_OML 0x8987 #define GL_RESAMPLE_AVERAGE_OML 0x8988 #define GL_RESAMPLE_DECIMATE_OML 0x8989 #define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) #endif /* GL_OML_resample */ /* ---------------------------- GL_OML_subsample --------------------------- */ #ifndef GL_OML_subsample #define GL_OML_subsample 1 #define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 #define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 #define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) #endif /* GL_OML_subsample */ /* ---------------------------- GL_OVR_multiview --------------------------- */ #ifndef GL_OVR_multiview #define GL_OVR_multiview 1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 #define GL_MAX_VIEWS_OVR 0x9631 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 #define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); #define glFramebufferTextureMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultiviewOVR) #define GLEW_OVR_multiview GLEW_GET_VAR(__GLEW_OVR_multiview) #endif /* GL_OVR_multiview */ /* --------------------------- GL_OVR_multiview2 --------------------------- */ #ifndef GL_OVR_multiview2 #define GL_OVR_multiview2 1 #define GLEW_OVR_multiview2 GLEW_GET_VAR(__GLEW_OVR_multiview2) #endif /* GL_OVR_multiview2 */ /* --------------------------- GL_PGI_misc_hints --------------------------- */ #ifndef GL_PGI_misc_hints #define GL_PGI_misc_hints 1 #define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 #define GL_CONSERVE_MEMORY_HINT_PGI 107005 #define GL_RECLAIM_MEMORY_HINT_PGI 107006 #define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 #define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 #define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 #define GL_ALWAYS_FAST_HINT_PGI 107020 #define GL_ALWAYS_SOFT_HINT_PGI 107021 #define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 #define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 #define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 #define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 #define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 #define GL_STRICT_LIGHTING_HINT_PGI 107031 #define GL_STRICT_SCISSOR_HINT_PGI 107032 #define GL_FULL_STIPPLE_HINT_PGI 107033 #define GL_CLIP_NEAR_HINT_PGI 107040 #define GL_CLIP_FAR_HINT_PGI 107041 #define GL_WIDE_LINE_HINT_PGI 107042 #define GL_BACK_NORMALS_HINT_PGI 107043 #define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) #endif /* GL_PGI_misc_hints */ /* -------------------------- GL_PGI_vertex_hints -------------------------- */ #ifndef GL_PGI_vertex_hints #define GL_PGI_vertex_hints 1 #define GL_VERTEX23_BIT_PGI 0x00000004 #define GL_VERTEX4_BIT_PGI 0x00000008 #define GL_COLOR3_BIT_PGI 0x00010000 #define GL_COLOR4_BIT_PGI 0x00020000 #define GL_EDGEFLAG_BIT_PGI 0x00040000 #define GL_INDEX_BIT_PGI 0x00080000 #define GL_MAT_AMBIENT_BIT_PGI 0x00100000 #define GL_VERTEX_DATA_HINT_PGI 107050 #define GL_VERTEX_CONSISTENT_HINT_PGI 107051 #define GL_MATERIAL_SIDE_HINT_PGI 107052 #define GL_MAX_VERTEX_HINT_PGI 107053 #define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 #define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 #define GL_MAT_EMISSION_BIT_PGI 0x00800000 #define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 #define GL_MAT_SHININESS_BIT_PGI 0x02000000 #define GL_MAT_SPECULAR_BIT_PGI 0x04000000 #define GL_NORMAL_BIT_PGI 0x08000000 #define GL_TEXCOORD1_BIT_PGI 0x10000000 #define GL_TEXCOORD2_BIT_PGI 0x20000000 #define GL_TEXCOORD3_BIT_PGI 0x40000000 #define GL_TEXCOORD4_BIT_PGI 0x80000000 #define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) #endif /* GL_PGI_vertex_hints */ /* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ #ifndef GL_REGAL_ES1_0_compatibility #define GL_REGAL_ES1_0_compatibility 1 typedef int GLclampx; typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); #define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) #define glClearColorx GLEW_GET_FUN(__glewClearColorx) #define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) #define glColor4x GLEW_GET_FUN(__glewColor4x) #define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) #define glFogx GLEW_GET_FUN(__glewFogx) #define glFogxv GLEW_GET_FUN(__glewFogxv) #define glFrustumf GLEW_GET_FUN(__glewFrustumf) #define glFrustumx GLEW_GET_FUN(__glewFrustumx) #define glLightModelx GLEW_GET_FUN(__glewLightModelx) #define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) #define glLightx GLEW_GET_FUN(__glewLightx) #define glLightxv GLEW_GET_FUN(__glewLightxv) #define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) #define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) #define glMaterialx GLEW_GET_FUN(__glewMaterialx) #define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) #define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) #define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) #define glNormal3x GLEW_GET_FUN(__glewNormal3x) #define glOrthof GLEW_GET_FUN(__glewOrthof) #define glOrthox GLEW_GET_FUN(__glewOrthox) #define glPointSizex GLEW_GET_FUN(__glewPointSizex) #define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) #define glRotatex GLEW_GET_FUN(__glewRotatex) #define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) #define glScalex GLEW_GET_FUN(__glewScalex) #define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) #define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) #define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) #define glTranslatex GLEW_GET_FUN(__glewTranslatex) #define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) #endif /* GL_REGAL_ES1_0_compatibility */ /* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ #ifndef GL_REGAL_ES1_1_compatibility #define GL_REGAL_ES1_1_compatibility 1 typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); #define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) #define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) #define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) #define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) #define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) #define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) #define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) #define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) #define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) #define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) #define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) #define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) #define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) #define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) #endif /* GL_REGAL_ES1_1_compatibility */ /* ---------------------------- GL_REGAL_enable ---------------------------- */ #ifndef GL_REGAL_enable #define GL_REGAL_enable 1 #define GL_ERROR_REGAL 0x9322 #define GL_DEBUG_REGAL 0x9323 #define GL_LOG_REGAL 0x9324 #define GL_EMULATION_REGAL 0x9325 #define GL_DRIVER_REGAL 0x9326 #define GL_MISSING_REGAL 0x9360 #define GL_TRACE_REGAL 0x9361 #define GL_CACHE_REGAL 0x9362 #define GL_CODE_REGAL 0x9363 #define GL_STATISTICS_REGAL 0x9364 #define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) #endif /* GL_REGAL_enable */ /* ------------------------- GL_REGAL_error_string ------------------------- */ #ifndef GL_REGAL_error_string #define GL_REGAL_error_string 1 typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); #define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) #define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) #endif /* GL_REGAL_error_string */ /* ------------------------ GL_REGAL_extension_query ----------------------- */ #ifndef GL_REGAL_extension_query #define GL_REGAL_extension_query 1 typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); #define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) #define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) #define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) #endif /* GL_REGAL_extension_query */ /* ------------------------------ GL_REGAL_log ----------------------------- */ #ifndef GL_REGAL_log #define GL_REGAL_log 1 #define GL_LOG_ERROR_REGAL 0x9319 #define GL_LOG_WARNING_REGAL 0x931A #define GL_LOG_INFO_REGAL 0x931B #define GL_LOG_APP_REGAL 0x931C #define GL_LOG_DRIVER_REGAL 0x931D #define GL_LOG_INTERNAL_REGAL 0x931E #define GL_LOG_DEBUG_REGAL 0x931F #define GL_LOG_STATUS_REGAL 0x9320 #define GL_LOG_HTTP_REGAL 0x9321 typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context); typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); #define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) #define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) #endif /* GL_REGAL_log */ /* ------------------------- GL_REGAL_proc_address ------------------------- */ #ifndef GL_REGAL_proc_address #define GL_REGAL_proc_address 1 typedef void * (GLAPIENTRY * PFNGLGETPROCADDRESSREGALPROC) (const GLchar *name); #define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) #define GLEW_REGAL_proc_address GLEW_GET_VAR(__GLEW_REGAL_proc_address) #endif /* GL_REGAL_proc_address */ /* ----------------------- GL_REND_screen_coordinates ---------------------- */ #ifndef GL_REND_screen_coordinates #define GL_REND_screen_coordinates 1 #define GL_SCREEN_COORDINATES_REND 0x8490 #define GL_INVERTED_SCREEN_W_REND 0x8491 #define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) #endif /* GL_REND_screen_coordinates */ /* ------------------------------- GL_S3_s3tc ------------------------------ */ #ifndef GL_S3_s3tc #define GL_S3_s3tc 1 #define GL_RGB_S3TC 0x83A0 #define GL_RGB4_S3TC 0x83A1 #define GL_RGBA_S3TC 0x83A2 #define GL_RGBA4_S3TC 0x83A3 #define GL_RGBA_DXT5_S3TC 0x83A4 #define GL_RGBA4_DXT5_S3TC 0x83A5 #define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) #endif /* GL_S3_s3tc */ /* -------------------------- GL_SGIS_color_range -------------------------- */ #ifndef GL_SGIS_color_range #define GL_SGIS_color_range 1 #define GL_EXTENDED_RANGE_SGIS 0x85A5 #define GL_MIN_RED_SGIS 0x85A6 #define GL_MAX_RED_SGIS 0x85A7 #define GL_MIN_GREEN_SGIS 0x85A8 #define GL_MAX_GREEN_SGIS 0x85A9 #define GL_MIN_BLUE_SGIS 0x85AA #define GL_MAX_BLUE_SGIS 0x85AB #define GL_MIN_ALPHA_SGIS 0x85AC #define GL_MAX_ALPHA_SGIS 0x85AD #define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) #endif /* GL_SGIS_color_range */ /* ------------------------- GL_SGIS_detail_texture ------------------------ */ #ifndef GL_SGIS_detail_texture #define GL_SGIS_detail_texture 1 typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); #define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) #define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) #define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) #endif /* GL_SGIS_detail_texture */ /* -------------------------- GL_SGIS_fog_function ------------------------- */ #ifndef GL_SGIS_fog_function #define GL_SGIS_fog_function 1 typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); #define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) #define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) #define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) #endif /* GL_SGIS_fog_function */ /* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ #ifndef GL_SGIS_generate_mipmap #define GL_SGIS_generate_mipmap 1 #define GL_GENERATE_MIPMAP_SGIS 0x8191 #define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 #define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) #endif /* GL_SGIS_generate_mipmap */ /* -------------------------- GL_SGIS_multisample -------------------------- */ #ifndef GL_SGIS_multisample #define GL_SGIS_multisample 1 #define GL_MULTISAMPLE_SGIS 0x809D #define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E #define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F #define GL_SAMPLE_MASK_SGIS 0x80A0 #define GL_1PASS_SGIS 0x80A1 #define GL_2PASS_0_SGIS 0x80A2 #define GL_2PASS_1_SGIS 0x80A3 #define GL_4PASS_0_SGIS 0x80A4 #define GL_4PASS_1_SGIS 0x80A5 #define GL_4PASS_2_SGIS 0x80A6 #define GL_4PASS_3_SGIS 0x80A7 #define GL_SAMPLE_BUFFERS_SGIS 0x80A8 #define GL_SAMPLES_SGIS 0x80A9 #define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA #define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB #define GL_SAMPLE_PATTERN_SGIS 0x80AC typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); #define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) #define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) #define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) #endif /* GL_SGIS_multisample */ /* ------------------------- GL_SGIS_pixel_texture ------------------------- */ #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 #define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) #endif /* GL_SGIS_pixel_texture */ /* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ #ifndef GL_SGIS_point_line_texgen #define GL_SGIS_point_line_texgen 1 #define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 #define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 #define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 #define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 #define GL_EYE_POINT_SGIS 0x81F4 #define GL_OBJECT_POINT_SGIS 0x81F5 #define GL_EYE_LINE_SGIS 0x81F6 #define GL_OBJECT_LINE_SGIS 0x81F7 #define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) #endif /* GL_SGIS_point_line_texgen */ /* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ #ifndef GL_SGIS_sharpen_texture #define GL_SGIS_sharpen_texture 1 typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); #define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) #define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) #define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) #endif /* GL_SGIS_sharpen_texture */ /* --------------------------- GL_SGIS_texture4D --------------------------- */ #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); #define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) #define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) #define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) #endif /* GL_SGIS_texture4D */ /* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ #ifndef GL_SGIS_texture_border_clamp #define GL_SGIS_texture_border_clamp 1 #define GL_CLAMP_TO_BORDER_SGIS 0x812D #define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) #endif /* GL_SGIS_texture_border_clamp */ /* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ #ifndef GL_SGIS_texture_edge_clamp #define GL_SGIS_texture_edge_clamp 1 #define GL_CLAMP_TO_EDGE_SGIS 0x812F #define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) #endif /* GL_SGIS_texture_edge_clamp */ /* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ #ifndef GL_SGIS_texture_filter4 #define GL_SGIS_texture_filter4 1 typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); #define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) #define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) #define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) #endif /* GL_SGIS_texture_filter4 */ /* -------------------------- GL_SGIS_texture_lod -------------------------- */ #ifndef GL_SGIS_texture_lod #define GL_SGIS_texture_lod 1 #define GL_TEXTURE_MIN_LOD_SGIS 0x813A #define GL_TEXTURE_MAX_LOD_SGIS 0x813B #define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C #define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D #define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) #endif /* GL_SGIS_texture_lod */ /* ------------------------- GL_SGIS_texture_select ------------------------ */ #ifndef GL_SGIS_texture_select #define GL_SGIS_texture_select 1 #define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) #endif /* GL_SGIS_texture_select */ /* ----------------------------- GL_SGIX_async ----------------------------- */ #ifndef GL_SGIX_async #define GL_SGIX_async 1 #define GL_ASYNC_MARKER_SGIX 0x8329 typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); #define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) #define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) #define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) #define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) #define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) #define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) #define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) #endif /* GL_SGIX_async */ /* ------------------------ GL_SGIX_async_histogram ------------------------ */ #ifndef GL_SGIX_async_histogram #define GL_SGIX_async_histogram 1 #define GL_ASYNC_HISTOGRAM_SGIX 0x832C #define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D #define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) #endif /* GL_SGIX_async_histogram */ /* -------------------------- GL_SGIX_async_pixel -------------------------- */ #ifndef GL_SGIX_async_pixel #define GL_SGIX_async_pixel 1 #define GL_ASYNC_TEX_IMAGE_SGIX 0x835C #define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D #define GL_ASYNC_READ_PIXELS_SGIX 0x835E #define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F #define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 #define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 #define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) #endif /* GL_SGIX_async_pixel */ /* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ #ifndef GL_SGIX_blend_alpha_minmax #define GL_SGIX_blend_alpha_minmax 1 #define GL_ALPHA_MIN_SGIX 0x8320 #define GL_ALPHA_MAX_SGIX 0x8321 #define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) #endif /* GL_SGIX_blend_alpha_minmax */ /* ---------------------------- GL_SGIX_clipmap ---------------------------- */ #ifndef GL_SGIX_clipmap #define GL_SGIX_clipmap 1 #define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) #endif /* GL_SGIX_clipmap */ /* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ #ifndef GL_SGIX_convolution_accuracy #define GL_SGIX_convolution_accuracy 1 #define GL_CONVOLUTION_HINT_SGIX 0x8316 #define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) #endif /* GL_SGIX_convolution_accuracy */ /* ------------------------- GL_SGIX_depth_texture ------------------------- */ #ifndef GL_SGIX_depth_texture #define GL_SGIX_depth_texture 1 #define GL_DEPTH_COMPONENT16_SGIX 0x81A5 #define GL_DEPTH_COMPONENT24_SGIX 0x81A6 #define GL_DEPTH_COMPONENT32_SGIX 0x81A7 #define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) #endif /* GL_SGIX_depth_texture */ /* -------------------------- GL_SGIX_flush_raster ------------------------- */ #ifndef GL_SGIX_flush_raster #define GL_SGIX_flush_raster 1 typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); #define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) #define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) #endif /* GL_SGIX_flush_raster */ /* --------------------------- GL_SGIX_fog_offset -------------------------- */ #ifndef GL_SGIX_fog_offset #define GL_SGIX_fog_offset 1 #define GL_FOG_OFFSET_SGIX 0x8198 #define GL_FOG_OFFSET_VALUE_SGIX 0x8199 #define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) #endif /* GL_SGIX_fog_offset */ /* -------------------------- GL_SGIX_fog_texture -------------------------- */ #ifndef GL_SGIX_fog_texture #define GL_SGIX_fog_texture 1 #define GL_FOG_PATCHY_FACTOR_SGIX 0 #define GL_FRAGMENT_FOG_SGIX 0 #define GL_TEXTURE_FOG_SGIX 0 typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); #define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) #define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) #endif /* GL_SGIX_fog_texture */ /* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ #ifndef GL_SGIX_fragment_specular_lighting #define GL_SGIX_fragment_specular_lighting 1 typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); #define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) #define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) #define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) #define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) #define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) #define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) #define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) #define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) #define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) #define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) #define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) #define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) #define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) #define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) #define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) #define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) #define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) #define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) #endif /* GL_SGIX_fragment_specular_lighting */ /* --------------------------- GL_SGIX_framezoom --------------------------- */ #ifndef GL_SGIX_framezoom #define GL_SGIX_framezoom 1 typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) #define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) #endif /* GL_SGIX_framezoom */ /* --------------------------- GL_SGIX_interlace --------------------------- */ #ifndef GL_SGIX_interlace #define GL_SGIX_interlace 1 #define GL_INTERLACE_SGIX 0x8094 #define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) #endif /* GL_SGIX_interlace */ /* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ #ifndef GL_SGIX_ir_instrument1 #define GL_SGIX_ir_instrument1 1 #define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) #endif /* GL_SGIX_ir_instrument1 */ /* ------------------------- GL_SGIX_list_priority ------------------------- */ #ifndef GL_SGIX_list_priority #define GL_SGIX_list_priority 1 #define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) #endif /* GL_SGIX_list_priority */ /* ------------------------- GL_SGIX_pixel_texture ------------------------- */ #ifndef GL_SGIX_pixel_texture #define GL_SGIX_pixel_texture 1 typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) #define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) #endif /* GL_SGIX_pixel_texture */ /* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ #ifndef GL_SGIX_pixel_texture_bits #define GL_SGIX_pixel_texture_bits 1 #define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) #endif /* GL_SGIX_pixel_texture_bits */ /* ------------------------ GL_SGIX_reference_plane ------------------------ */ #ifndef GL_SGIX_reference_plane #define GL_SGIX_reference_plane 1 typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); #define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) #define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) #endif /* GL_SGIX_reference_plane */ /* ---------------------------- GL_SGIX_resample --------------------------- */ #ifndef GL_SGIX_resample #define GL_SGIX_resample 1 #define GL_PACK_RESAMPLE_SGIX 0x842E #define GL_UNPACK_RESAMPLE_SGIX 0x842F #define GL_RESAMPLE_DECIMATE_SGIX 0x8430 #define GL_RESAMPLE_REPLICATE_SGIX 0x8433 #define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 #define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) #endif /* GL_SGIX_resample */ /* ----------------------------- GL_SGIX_shadow ---------------------------- */ #ifndef GL_SGIX_shadow #define GL_SGIX_shadow 1 #define GL_TEXTURE_COMPARE_SGIX 0x819A #define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B #define GL_TEXTURE_LEQUAL_R_SGIX 0x819C #define GL_TEXTURE_GEQUAL_R_SGIX 0x819D #define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) #endif /* GL_SGIX_shadow */ /* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ #ifndef GL_SGIX_shadow_ambient #define GL_SGIX_shadow_ambient 1 #define GL_SHADOW_AMBIENT_SGIX 0x80BF #define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) #endif /* GL_SGIX_shadow_ambient */ /* ----------------------------- GL_SGIX_sprite ---------------------------- */ #ifndef GL_SGIX_sprite #define GL_SGIX_sprite 1 typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); #define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) #define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) #define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) #define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) #define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) #endif /* GL_SGIX_sprite */ /* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ #ifndef GL_SGIX_tag_sample_buffer #define GL_SGIX_tag_sample_buffer 1 typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) #define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) #endif /* GL_SGIX_tag_sample_buffer */ /* ------------------------ GL_SGIX_texture_add_env ------------------------ */ #ifndef GL_SGIX_texture_add_env #define GL_SGIX_texture_add_env 1 #define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) #endif /* GL_SGIX_texture_add_env */ /* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ #ifndef GL_SGIX_texture_coordinate_clamp #define GL_SGIX_texture_coordinate_clamp 1 #define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 #define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A #define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B #define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) #endif /* GL_SGIX_texture_coordinate_clamp */ /* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ #ifndef GL_SGIX_texture_lod_bias #define GL_SGIX_texture_lod_bias 1 #define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) #endif /* GL_SGIX_texture_lod_bias */ /* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ #ifndef GL_SGIX_texture_multi_buffer #define GL_SGIX_texture_multi_buffer 1 #define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E #define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) #endif /* GL_SGIX_texture_multi_buffer */ /* ------------------------- GL_SGIX_texture_range ------------------------- */ #ifndef GL_SGIX_texture_range #define GL_SGIX_texture_range 1 #define GL_RGB_SIGNED_SGIX 0x85E0 #define GL_RGBA_SIGNED_SGIX 0x85E1 #define GL_ALPHA_SIGNED_SGIX 0x85E2 #define GL_LUMINANCE_SIGNED_SGIX 0x85E3 #define GL_INTENSITY_SIGNED_SGIX 0x85E4 #define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 #define GL_RGB16_SIGNED_SGIX 0x85E6 #define GL_RGBA16_SIGNED_SGIX 0x85E7 #define GL_ALPHA16_SIGNED_SGIX 0x85E8 #define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 #define GL_INTENSITY16_SIGNED_SGIX 0x85EA #define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB #define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC #define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED #define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE #define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF #define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 #define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 #define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 #define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 #define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 #define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 #define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 #define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 #define GL_MIN_LUMINANCE_SGIS 0x85F8 #define GL_MAX_LUMINANCE_SGIS 0x85F9 #define GL_MIN_INTENSITY_SGIS 0x85FA #define GL_MAX_INTENSITY_SGIS 0x85FB #define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) #endif /* GL_SGIX_texture_range */ /* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ #ifndef GL_SGIX_texture_scale_bias #define GL_SGIX_texture_scale_bias 1 #define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 #define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A #define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B #define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C #define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) #endif /* GL_SGIX_texture_scale_bias */ /* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ #ifndef GL_SGIX_vertex_preclip #define GL_SGIX_vertex_preclip 1 #define GL_VERTEX_PRECLIP_SGIX 0x83EE #define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF #define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) #endif /* GL_SGIX_vertex_preclip */ /* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ #ifndef GL_SGIX_vertex_preclip_hint #define GL_SGIX_vertex_preclip_hint 1 #define GL_VERTEX_PRECLIP_SGIX 0x83EE #define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF #define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) #endif /* GL_SGIX_vertex_preclip_hint */ /* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ #ifndef GL_SGIX_ycrcb #define GL_SGIX_ycrcb 1 #define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) #endif /* GL_SGIX_ycrcb */ /* -------------------------- GL_SGI_color_matrix -------------------------- */ #ifndef GL_SGI_color_matrix #define GL_SGI_color_matrix 1 #define GL_COLOR_MATRIX_SGI 0x80B1 #define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 #define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 #define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 #define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 #define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 #define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA #define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB #define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) #endif /* GL_SGI_color_matrix */ /* --------------------------- GL_SGI_color_table -------------------------- */ #ifndef GL_SGI_color_table #define GL_SGI_color_table 1 #define GL_COLOR_TABLE_SGI 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 #define GL_PROXY_COLOR_TABLE_SGI 0x80D3 #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 #define GL_COLOR_TABLE_SCALE_SGI 0x80D6 #define GL_COLOR_TABLE_BIAS_SGI 0x80D7 #define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 #define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 #define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); #define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) #define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) #define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) #define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) #define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) #define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) #define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) #define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) #endif /* GL_SGI_color_table */ /* ----------------------- GL_SGI_texture_color_table ---------------------- */ #ifndef GL_SGI_texture_color_table #define GL_SGI_texture_color_table 1 #define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC #define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD #define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) #endif /* GL_SGI_texture_color_table */ /* ------------------------- GL_SUNX_constant_data ------------------------- */ #ifndef GL_SUNX_constant_data #define GL_SUNX_constant_data 1 #define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 #define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); #define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) #define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) #endif /* GL_SUNX_constant_data */ /* -------------------- GL_SUN_convolution_border_modes -------------------- */ #ifndef GL_SUN_convolution_border_modes #define GL_SUN_convolution_border_modes 1 #define GL_WRAP_BORDER_SUN 0x81D4 #define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) #endif /* GL_SUN_convolution_border_modes */ /* -------------------------- GL_SUN_global_alpha -------------------------- */ #ifndef GL_SUN_global_alpha #define GL_SUN_global_alpha 1 #define GL_GLOBAL_ALPHA_SUN 0x81D9 #define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); #define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) #define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) #define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) #define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) #define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) #define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) #define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) #define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) #define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) #endif /* GL_SUN_global_alpha */ /* --------------------------- GL_SUN_mesh_array --------------------------- */ #ifndef GL_SUN_mesh_array #define GL_SUN_mesh_array 1 #define GL_QUAD_MESH_SUN 0x8614 #define GL_TRIANGLE_MESH_SUN 0x8615 #define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) #endif /* GL_SUN_mesh_array */ /* ------------------------ GL_SUN_read_video_pixels ----------------------- */ #ifndef GL_SUN_read_video_pixels #define GL_SUN_read_video_pixels 1 typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); #define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) #define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) #endif /* GL_SUN_read_video_pixels */ /* --------------------------- GL_SUN_slice_accum -------------------------- */ #ifndef GL_SUN_slice_accum #define GL_SUN_slice_accum 1 #define GL_SLICE_ACCUM_SUN 0x85CC #define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) #endif /* GL_SUN_slice_accum */ /* -------------------------- GL_SUN_triangle_list ------------------------- */ #ifndef GL_SUN_triangle_list #define GL_SUN_triangle_list 1 #define GL_RESTART_SUN 0x01 #define GL_REPLACE_MIDDLE_SUN 0x02 #define GL_REPLACE_OLDEST_SUN 0x03 #define GL_TRIANGLE_LIST_SUN 0x81D7 #define GL_REPLACEMENT_CODE_SUN 0x81D8 #define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 #define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 #define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 #define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 #define GL_R1UI_V3F_SUN 0x85C4 #define GL_R1UI_C4UB_V3F_SUN 0x85C5 #define GL_R1UI_C3F_V3F_SUN 0x85C6 #define GL_R1UI_N3F_V3F_SUN 0x85C7 #define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 #define GL_R1UI_T2F_V3F_SUN 0x85C9 #define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA #define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); #define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) #define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) #define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) #define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) #define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) #define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) #define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) #define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) #endif /* GL_SUN_triangle_list */ /* ----------------------------- GL_SUN_vertex ----------------------------- */ #ifndef GL_SUN_vertex #define GL_SUN_vertex 1 typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); #define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) #define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) #define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) #define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) #define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) #define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) #define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) #define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) #define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) #define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) #define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) #define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) #define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) #define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) #define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) #define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) #define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) #define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) #define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) #define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) #define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) #define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) #define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) #define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) #define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) #define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) #define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) #define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) #define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) #define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) #define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) #define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) #define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) #define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) #define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) #define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) #define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) #define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) #define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) #define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) #define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) #endif /* GL_SUN_vertex */ /* -------------------------- GL_WIN_phong_shading ------------------------- */ #ifndef GL_WIN_phong_shading #define GL_WIN_phong_shading 1 #define GL_PHONG_WIN 0x80EA #define GL_PHONG_HINT_WIN 0x80EB #define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) #endif /* GL_WIN_phong_shading */ /* -------------------------- GL_WIN_specular_fog -------------------------- */ #ifndef GL_WIN_specular_fog #define GL_WIN_specular_fog 1 #define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC #define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) #endif /* GL_WIN_specular_fog */ /* ---------------------------- GL_WIN_swap_hint --------------------------- */ #ifndef GL_WIN_swap_hint #define GL_WIN_swap_hint 1 typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); #define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) #define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) #endif /* GL_WIN_swap_hint */ /* ------------------------------------------------------------------------- */ #if defined(GLEW_MX) && defined(_WIN32) #define GLEW_FUN_EXPORT #else #define GLEW_FUN_EXPORT GLEWAPI #endif /* GLEW_MX */ #if defined(GLEW_MX) #define GLEW_VAR_EXPORT #else #define GLEW_VAR_EXPORT GLEWAPI #endif /* GLEW_MX */ #if defined(GLEW_MX) && defined(_WIN32) struct GLEWContextStruct { #endif /* GLEW_MX */ GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus; GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage; GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEPROC __glewGetnTexImage; GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv; GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; GLEW_FUN_EXPORT PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD; GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; GLEW_FUN_EXPORT PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion; GLEW_FUN_EXPORT PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; GLEW_FUN_EXPORT PFNGLCLIPCONTROLPROC __glewClipControl; GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit; GLEW_FUN_EXPORT PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer; GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D; GLEW_FUN_EXPORT PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D; GLEW_FUN_EXPORT PFNGLCREATEBUFFERSPROC __glewCreateBuffers; GLEW_FUN_EXPORT PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines; GLEW_FUN_EXPORT PFNGLCREATEQUERIESPROC __glewCreateQueries; GLEW_FUN_EXPORT PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers; GLEW_FUN_EXPORT PFNGLCREATESAMPLERSPROC __glewCreateSamplers; GLEW_FUN_EXPORT PFNGLCREATETEXTURESPROC __glewCreateTextures; GLEW_FUN_EXPORT PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks; GLEW_FUN_EXPORT PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib; GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange; GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv; GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv; GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData; GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERPROC __glewTextureBuffer; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange; GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat; GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor; GLEW_FUN_EXPORT PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers; GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage; GLEW_FUN_EXPORT PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage; GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB; GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB; GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; GLEW_FUN_EXPORT PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB; GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERPROC __glewTextureBarrier; GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT; GLEW_FUN_EXPORT PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT; GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT; GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV; GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV; GLEW_FUN_EXPORT PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV; GLEW_FUN_EXPORT PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT; GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; GLEW_FUN_EXPORT PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL; GLEW_FUN_EXPORT PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL; GLEW_FUN_EXPORT PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL; GLEW_FUN_EXPORT PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL; GLEW_FUN_EXPORT PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL; GLEW_FUN_EXPORT PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL; GLEW_FUN_EXPORT PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL; GLEW_FUN_EXPORT PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL; GLEW_FUN_EXPORT PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL; GLEW_FUN_EXPORT PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL; GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; GLEW_FUN_EXPORT PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv; GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv; GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv; GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels; GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV; GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; GLEW_FUN_EXPORT PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV; GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV; GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; GLEW_FUN_EXPORT PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV; GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV; GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV; GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV; GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV; GLEW_FUN_EXPORT PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV; GLEW_FUN_EXPORT PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV; GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV; GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; GLEW_FUN_EXPORT PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; GLEW_FUN_EXPORT PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV; GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV; GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR; GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; GLEW_FUN_EXPORT PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL; GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; #if defined(GLEW_MX) && !defined(_WIN32) struct GLEWContextStruct { #endif /* GLEW_MX */ GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_5; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gcn_shader; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int64; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_occlusion_query_event; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_value_export; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback4; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_1_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_2_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clip_control; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conditional_render_inverted; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cull_distance; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_derivative_control; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_direct_state_access; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader_interlock; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_texture_sub_image; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_int64; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_parallel_shader_compile; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pipeline_statistics_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_post_depth_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_locations; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counter_ops; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_ballot; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_clock; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_image_samples; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_viewport_layer_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_barrier; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_overflow_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_label; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_post_depth_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_raster_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_formatted; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_integer_mix; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture2; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_fragment_shader_ordering; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_framebuffer_CMAA; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_performance_query; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced_coherent; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_context_flush_control; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_no_error; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robust_buffer_access_behavior; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robustness; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_hdr; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect_count; GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster; GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_dilate; GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fill_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_coverage_to_color; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_shader_interlock; GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_mixed_samples; GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader_passthrough; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; GLEW_VAR_EXPORT GLboolean __GLEW_NV_internalformat_sample_query; GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering_shared_edge; GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_locations; GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_mask_override_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_fp16_vector; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_int64; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_group; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_shuffle; GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_uniform_buffer_unified_memory; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array2; GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview; GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview2; GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_proc_address; GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; #ifdef GLEW_MX }; /* GLEWContextStruct */ #endif /* GLEW_MX */ /* ------------------------------------------------------------------------- */ /* error codes */ #define GLEW_OK 0 #define GLEW_NO_ERROR 0 #define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ #define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ #define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ /* string codes */ #define GLEW_VERSION 1 #define GLEW_VERSION_MAJOR 2 #define GLEW_VERSION_MINOR 3 #define GLEW_VERSION_MICRO 4 /* ------------------------------------------------------------------------- */ /* GLEW version info */ /* VERSION 1.13.0 VERSION_MAJOR 1 VERSION_MINOR 13 VERSION_MICRO 0 */ /* API */ #ifdef GLEW_MX typedef struct GLEWContextStruct GLEWContext; GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); #define glewInit() glewContextInit(glewGetContext()) #define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) #define glewIsExtensionSupported(x) glewIsSupported(x) #define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) #ifdef _WIN32 # define GLEW_GET_FUN(x) glewGetContext()->x #else # define GLEW_GET_FUN(x) x #endif #else /* GLEW_MX */ GLEWAPI GLenum GLEWAPIENTRY glewInit (void); GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); #define glewIsExtensionSupported(x) glewIsSupported(x) #define GLEW_GET_VAR(x) (*(const GLboolean*)&x) #define GLEW_GET_FUN(x) x #endif /* GLEW_MX */ GLEWAPI GLboolean glewExperimental; GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); #ifdef __cplusplus } #endif #ifdef GLEW_APIENTRY_DEFINED #undef GLEW_APIENTRY_DEFINED #undef APIENTRY #endif #ifdef GLEW_CALLBACK_DEFINED #undef GLEW_CALLBACK_DEFINED #undef CALLBACK #endif #ifdef GLEW_WINGDIAPI_DEFINED #undef GLEW_WINGDIAPI_DEFINED #undef WINGDIAPI #endif #undef GLAPI /* #undef GLEWAPI */ #endif /* __glew_h__ */ goxel-0.8.1/ext_src/glew/GL/wglew.h000066400000000000000000001765041334742672700170770ustar00rootroot00000000000000/* ** The OpenGL Extension Wrangler Library ** Copyright (C) 2008-2015, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** 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. ** * The name of the author 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. */ /* ** Copyright (c) 2007 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are 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 Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #ifndef __wglew_h__ #define __wglew_h__ #define __WGLEW_H__ #ifdef __wglext_h_ #error wglext.h included before wglew.h #endif #define __wglext_h_ #if !defined(WINAPI) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN 1 # endif #include # undef WIN32_LEAN_AND_MEAN #endif /* * GLEW_STATIC needs to be set when using the static version. * GLEW_BUILD is set when building the DLL version. */ #ifdef GLEW_STATIC # define GLEWAPI extern #else # ifdef GLEW_BUILD # define GLEWAPI extern __declspec(dllexport) # else # define GLEWAPI extern __declspec(dllimport) # endif #endif #ifdef __cplusplus extern "C" { #endif /* -------------------------- WGL_3DFX_multisample ------------------------- */ #ifndef WGL_3DFX_multisample #define WGL_3DFX_multisample 1 #define WGL_SAMPLE_BUFFERS_3DFX 0x2060 #define WGL_SAMPLES_3DFX 0x2061 #define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) #endif /* WGL_3DFX_multisample */ /* ------------------------- WGL_3DL_stereo_control ------------------------ */ #ifndef WGL_3DL_stereo_control #define WGL_3DL_stereo_control 1 #define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 #define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 #define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 #define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); #define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) #define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) #endif /* WGL_3DL_stereo_control */ /* ------------------------ WGL_AMD_gpu_association ------------------------ */ #ifndef WGL_AMD_gpu_association #define WGL_AMD_gpu_association 1 #define WGL_GPU_VENDOR_AMD 0x1F00 #define WGL_GPU_RENDERER_STRING_AMD 0x1F01 #define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 #define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 #define WGL_GPU_RAM_AMD 0x21A3 #define WGL_GPU_CLOCK_AMD 0x21A4 #define WGL_GPU_NUM_PIPES_AMD 0x21A5 #define WGL_GPU_NUM_SIMD_AMD 0x21A6 #define WGL_GPU_NUM_RB_AMD 0x21A7 #define WGL_GPU_NUM_SPI_AMD 0x21A8 typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); #define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) #define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) #define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) #define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) #define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) #define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) #define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) #define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) #define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) #define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) #endif /* WGL_AMD_gpu_association */ /* ------------------------- WGL_ARB_buffer_region ------------------------- */ #ifndef WGL_ARB_buffer_region #define WGL_ARB_buffer_region 1 #define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 #define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 #define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 #define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); #define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) #define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) #define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) #define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) #define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) #endif /* WGL_ARB_buffer_region */ /* --------------------- WGL_ARB_context_flush_control --------------------- */ #ifndef WGL_ARB_context_flush_control #define WGL_ARB_context_flush_control 1 #define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 #define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 #define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 #define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) #endif /* WGL_ARB_context_flush_control */ /* ------------------------- WGL_ARB_create_context ------------------------ */ #ifndef WGL_ARB_create_context #define WGL_ARB_create_context 1 #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 #define WGL_CONTEXT_FLAGS_ARB 0x2094 #define ERROR_INVALID_VERSION_ARB 0x2095 #define ERROR_INVALID_PROFILE_ARB 0x2096 typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); #define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) #define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) #endif /* WGL_ARB_create_context */ /* --------------------- WGL_ARB_create_context_profile -------------------- */ #ifndef WGL_ARB_create_context_profile #define WGL_ARB_create_context_profile 1 #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 #define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) #endif /* WGL_ARB_create_context_profile */ /* ------------------- WGL_ARB_create_context_robustness ------------------- */ #ifndef WGL_ARB_create_context_robustness #define WGL_ARB_create_context_robustness 1 #define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 #define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 #define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 #define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) #endif /* WGL_ARB_create_context_robustness */ /* ----------------------- WGL_ARB_extensions_string ----------------------- */ #ifndef WGL_ARB_extensions_string #define WGL_ARB_extensions_string 1 typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); #define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) #define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) #endif /* WGL_ARB_extensions_string */ /* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ #ifndef WGL_ARB_framebuffer_sRGB #define WGL_ARB_framebuffer_sRGB 1 #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 #define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) #endif /* WGL_ARB_framebuffer_sRGB */ /* ----------------------- WGL_ARB_make_current_read ----------------------- */ #ifndef WGL_ARB_make_current_read #define WGL_ARB_make_current_read 1 #define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 #define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); #define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) #define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) #define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) #endif /* WGL_ARB_make_current_read */ /* -------------------------- WGL_ARB_multisample -------------------------- */ #ifndef WGL_ARB_multisample #define WGL_ARB_multisample 1 #define WGL_SAMPLE_BUFFERS_ARB 0x2041 #define WGL_SAMPLES_ARB 0x2042 #define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) #endif /* WGL_ARB_multisample */ /* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ #ifndef WGL_ARB_pbuffer #define WGL_ARB_pbuffer 1 #define WGL_DRAW_TO_PBUFFER_ARB 0x202D #define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E #define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F #define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 #define WGL_PBUFFER_LARGEST_ARB 0x2033 #define WGL_PBUFFER_WIDTH_ARB 0x2034 #define WGL_PBUFFER_HEIGHT_ARB 0x2035 #define WGL_PBUFFER_LOST_ARB 0x2036 DECLARE_HANDLE(HPBUFFERARB); typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); #define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) #define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) #define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) #define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) #define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) #define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) #endif /* WGL_ARB_pbuffer */ /* -------------------------- WGL_ARB_pixel_format ------------------------- */ #ifndef WGL_ARB_pixel_format #define WGL_ARB_pixel_format 1 #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 #define WGL_DRAW_TO_WINDOW_ARB 0x2001 #define WGL_DRAW_TO_BITMAP_ARB 0x2002 #define WGL_ACCELERATION_ARB 0x2003 #define WGL_NEED_PALETTE_ARB 0x2004 #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 #define WGL_SWAP_METHOD_ARB 0x2007 #define WGL_NUMBER_OVERLAYS_ARB 0x2008 #define WGL_NUMBER_UNDERLAYS_ARB 0x2009 #define WGL_TRANSPARENT_ARB 0x200A #define WGL_SHARE_DEPTH_ARB 0x200C #define WGL_SHARE_STENCIL_ARB 0x200D #define WGL_SHARE_ACCUM_ARB 0x200E #define WGL_SUPPORT_GDI_ARB 0x200F #define WGL_SUPPORT_OPENGL_ARB 0x2010 #define WGL_DOUBLE_BUFFER_ARB 0x2011 #define WGL_STEREO_ARB 0x2012 #define WGL_PIXEL_TYPE_ARB 0x2013 #define WGL_COLOR_BITS_ARB 0x2014 #define WGL_RED_BITS_ARB 0x2015 #define WGL_RED_SHIFT_ARB 0x2016 #define WGL_GREEN_BITS_ARB 0x2017 #define WGL_GREEN_SHIFT_ARB 0x2018 #define WGL_BLUE_BITS_ARB 0x2019 #define WGL_BLUE_SHIFT_ARB 0x201A #define WGL_ALPHA_BITS_ARB 0x201B #define WGL_ALPHA_SHIFT_ARB 0x201C #define WGL_ACCUM_BITS_ARB 0x201D #define WGL_ACCUM_RED_BITS_ARB 0x201E #define WGL_ACCUM_GREEN_BITS_ARB 0x201F #define WGL_ACCUM_BLUE_BITS_ARB 0x2020 #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 #define WGL_DEPTH_BITS_ARB 0x2022 #define WGL_STENCIL_BITS_ARB 0x2023 #define WGL_AUX_BUFFERS_ARB 0x2024 #define WGL_NO_ACCELERATION_ARB 0x2025 #define WGL_GENERIC_ACCELERATION_ARB 0x2026 #define WGL_FULL_ACCELERATION_ARB 0x2027 #define WGL_SWAP_EXCHANGE_ARB 0x2028 #define WGL_SWAP_COPY_ARB 0x2029 #define WGL_SWAP_UNDEFINED_ARB 0x202A #define WGL_TYPE_RGBA_ARB 0x202B #define WGL_TYPE_COLORINDEX_ARB 0x202C #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); #define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) #define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) #define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) #define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) #endif /* WGL_ARB_pixel_format */ /* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ #ifndef WGL_ARB_pixel_format_float #define WGL_ARB_pixel_format_float 1 #define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 #define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) #endif /* WGL_ARB_pixel_format_float */ /* ------------------------- WGL_ARB_render_texture ------------------------ */ #ifndef WGL_ARB_render_texture #define WGL_ARB_render_texture 1 #define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 #define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 #define WGL_TEXTURE_FORMAT_ARB 0x2072 #define WGL_TEXTURE_TARGET_ARB 0x2073 #define WGL_MIPMAP_TEXTURE_ARB 0x2074 #define WGL_TEXTURE_RGB_ARB 0x2075 #define WGL_TEXTURE_RGBA_ARB 0x2076 #define WGL_NO_TEXTURE_ARB 0x2077 #define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 #define WGL_TEXTURE_1D_ARB 0x2079 #define WGL_TEXTURE_2D_ARB 0x207A #define WGL_MIPMAP_LEVEL_ARB 0x207B #define WGL_CUBE_MAP_FACE_ARB 0x207C #define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 #define WGL_FRONT_LEFT_ARB 0x2083 #define WGL_FRONT_RIGHT_ARB 0x2084 #define WGL_BACK_LEFT_ARB 0x2085 #define WGL_BACK_RIGHT_ARB 0x2086 #define WGL_AUX0_ARB 0x2087 #define WGL_AUX1_ARB 0x2088 #define WGL_AUX2_ARB 0x2089 #define WGL_AUX3_ARB 0x208A #define WGL_AUX4_ARB 0x208B #define WGL_AUX5_ARB 0x208C #define WGL_AUX6_ARB 0x208D #define WGL_AUX7_ARB 0x208E #define WGL_AUX8_ARB 0x208F #define WGL_AUX9_ARB 0x2090 typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); #define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) #define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) #define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) #define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) #endif /* WGL_ARB_render_texture */ /* ---------------- WGL_ARB_robustness_application_isolation --------------- */ #ifndef WGL_ARB_robustness_application_isolation #define WGL_ARB_robustness_application_isolation 1 #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 #define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) #endif /* WGL_ARB_robustness_application_isolation */ /* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ #ifndef WGL_ARB_robustness_share_group_isolation #define WGL_ARB_robustness_share_group_isolation 1 #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 #define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) #endif /* WGL_ARB_robustness_share_group_isolation */ /* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ #ifndef WGL_ATI_pixel_format_float #define WGL_ATI_pixel_format_float 1 #define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 #define GL_RGBA_FLOAT_MODE_ATI 0x8820 #define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 #define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) #endif /* WGL_ATI_pixel_format_float */ /* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ #ifndef WGL_ATI_render_texture_rectangle #define WGL_ATI_render_texture_rectangle 1 #define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 #define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) #endif /* WGL_ATI_render_texture_rectangle */ /* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ #ifndef WGL_EXT_create_context_es2_profile #define WGL_EXT_create_context_es2_profile 1 #define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 #define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) #endif /* WGL_EXT_create_context_es2_profile */ /* ------------------- WGL_EXT_create_context_es_profile ------------------- */ #ifndef WGL_EXT_create_context_es_profile #define WGL_EXT_create_context_es_profile 1 #define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 #define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) #endif /* WGL_EXT_create_context_es_profile */ /* -------------------------- WGL_EXT_depth_float -------------------------- */ #ifndef WGL_EXT_depth_float #define WGL_EXT_depth_float 1 #define WGL_DEPTH_FLOAT_EXT 0x2040 #define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) #endif /* WGL_EXT_depth_float */ /* ---------------------- WGL_EXT_display_color_table ---------------------- */ #ifndef WGL_EXT_display_color_table #define WGL_EXT_display_color_table 1 typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); #define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) #define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) #define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) #define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) #define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) #endif /* WGL_EXT_display_color_table */ /* ----------------------- WGL_EXT_extensions_string ----------------------- */ #ifndef WGL_EXT_extensions_string #define WGL_EXT_extensions_string 1 typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); #define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) #define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) #endif /* WGL_EXT_extensions_string */ /* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ #ifndef WGL_EXT_framebuffer_sRGB #define WGL_EXT_framebuffer_sRGB 1 #define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 #define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) #endif /* WGL_EXT_framebuffer_sRGB */ /* ----------------------- WGL_EXT_make_current_read ----------------------- */ #ifndef WGL_EXT_make_current_read #define WGL_EXT_make_current_read 1 #define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); #define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) #define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) #define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) #endif /* WGL_EXT_make_current_read */ /* -------------------------- WGL_EXT_multisample -------------------------- */ #ifndef WGL_EXT_multisample #define WGL_EXT_multisample 1 #define WGL_SAMPLE_BUFFERS_EXT 0x2041 #define WGL_SAMPLES_EXT 0x2042 #define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) #endif /* WGL_EXT_multisample */ /* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ #ifndef WGL_EXT_pbuffer #define WGL_EXT_pbuffer 1 #define WGL_DRAW_TO_PBUFFER_EXT 0x202D #define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E #define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F #define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 #define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 #define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 #define WGL_PBUFFER_LARGEST_EXT 0x2033 #define WGL_PBUFFER_WIDTH_EXT 0x2034 #define WGL_PBUFFER_HEIGHT_EXT 0x2035 DECLARE_HANDLE(HPBUFFEREXT); typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); #define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) #define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) #define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) #define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) #define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) #define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) #endif /* WGL_EXT_pbuffer */ /* -------------------------- WGL_EXT_pixel_format ------------------------- */ #ifndef WGL_EXT_pixel_format #define WGL_EXT_pixel_format 1 #define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 #define WGL_DRAW_TO_WINDOW_EXT 0x2001 #define WGL_DRAW_TO_BITMAP_EXT 0x2002 #define WGL_ACCELERATION_EXT 0x2003 #define WGL_NEED_PALETTE_EXT 0x2004 #define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 #define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 #define WGL_SWAP_METHOD_EXT 0x2007 #define WGL_NUMBER_OVERLAYS_EXT 0x2008 #define WGL_NUMBER_UNDERLAYS_EXT 0x2009 #define WGL_TRANSPARENT_EXT 0x200A #define WGL_TRANSPARENT_VALUE_EXT 0x200B #define WGL_SHARE_DEPTH_EXT 0x200C #define WGL_SHARE_STENCIL_EXT 0x200D #define WGL_SHARE_ACCUM_EXT 0x200E #define WGL_SUPPORT_GDI_EXT 0x200F #define WGL_SUPPORT_OPENGL_EXT 0x2010 #define WGL_DOUBLE_BUFFER_EXT 0x2011 #define WGL_STEREO_EXT 0x2012 #define WGL_PIXEL_TYPE_EXT 0x2013 #define WGL_COLOR_BITS_EXT 0x2014 #define WGL_RED_BITS_EXT 0x2015 #define WGL_RED_SHIFT_EXT 0x2016 #define WGL_GREEN_BITS_EXT 0x2017 #define WGL_GREEN_SHIFT_EXT 0x2018 #define WGL_BLUE_BITS_EXT 0x2019 #define WGL_BLUE_SHIFT_EXT 0x201A #define WGL_ALPHA_BITS_EXT 0x201B #define WGL_ALPHA_SHIFT_EXT 0x201C #define WGL_ACCUM_BITS_EXT 0x201D #define WGL_ACCUM_RED_BITS_EXT 0x201E #define WGL_ACCUM_GREEN_BITS_EXT 0x201F #define WGL_ACCUM_BLUE_BITS_EXT 0x2020 #define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 #define WGL_DEPTH_BITS_EXT 0x2022 #define WGL_STENCIL_BITS_EXT 0x2023 #define WGL_AUX_BUFFERS_EXT 0x2024 #define WGL_NO_ACCELERATION_EXT 0x2025 #define WGL_GENERIC_ACCELERATION_EXT 0x2026 #define WGL_FULL_ACCELERATION_EXT 0x2027 #define WGL_SWAP_EXCHANGE_EXT 0x2028 #define WGL_SWAP_COPY_EXT 0x2029 #define WGL_SWAP_UNDEFINED_EXT 0x202A #define WGL_TYPE_RGBA_EXT 0x202B #define WGL_TYPE_COLORINDEX_EXT 0x202C typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); #define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) #define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) #define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) #define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) #endif /* WGL_EXT_pixel_format */ /* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ #ifndef WGL_EXT_pixel_format_packed_float #define WGL_EXT_pixel_format_packed_float 1 #define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 #define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) #endif /* WGL_EXT_pixel_format_packed_float */ /* -------------------------- WGL_EXT_swap_control ------------------------- */ #ifndef WGL_EXT_swap_control #define WGL_EXT_swap_control 1 typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); #define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) #define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) #define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) #endif /* WGL_EXT_swap_control */ /* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ #ifndef WGL_EXT_swap_control_tear #define WGL_EXT_swap_control_tear 1 #define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) #endif /* WGL_EXT_swap_control_tear */ /* --------------------- WGL_I3D_digital_video_control --------------------- */ #ifndef WGL_I3D_digital_video_control #define WGL_I3D_digital_video_control 1 #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 #define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 #define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); #define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) #define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) #define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) #endif /* WGL_I3D_digital_video_control */ /* ----------------------------- WGL_I3D_gamma ----------------------------- */ #ifndef WGL_I3D_gamma #define WGL_I3D_gamma 1 #define WGL_GAMMA_TABLE_SIZE_I3D 0x204E #define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); #define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) #define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) #define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) #define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) #define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) #endif /* WGL_I3D_gamma */ /* ---------------------------- WGL_I3D_genlock ---------------------------- */ #ifndef WGL_I3D_genlock #define WGL_I3D_genlock 1 #define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 #define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 #define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 #define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 #define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 #define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 #define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A #define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B #define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); #define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) #define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) #define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) #define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) #define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) #define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) #define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) #define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) #define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) #define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) #define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) #define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) #define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) #endif /* WGL_I3D_genlock */ /* -------------------------- WGL_I3D_image_buffer ------------------------- */ #ifndef WGL_I3D_image_buffer #define WGL_I3D_image_buffer 1 #define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 #define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); #define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) #define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) #define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) #define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) #define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) #endif /* WGL_I3D_image_buffer */ /* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ #ifndef WGL_I3D_swap_frame_lock #define WGL_I3D_swap_frame_lock 1 typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); #define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) #define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) #define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) #define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) #define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) #endif /* WGL_I3D_swap_frame_lock */ /* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ #ifndef WGL_I3D_swap_frame_usage #define WGL_I3D_swap_frame_usage 1 typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); #define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) #define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) #define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) #define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) #define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) #endif /* WGL_I3D_swap_frame_usage */ /* --------------------------- WGL_NV_DX_interop --------------------------- */ #ifndef WGL_NV_DX_interop #define WGL_NV_DX_interop 1 #define WGL_ACCESS_READ_ONLY_NV 0x0000 #define WGL_ACCESS_READ_WRITE_NV 0x0001 #define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); #define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) #define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) #define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) #define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) #define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) #define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) #define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) #define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) #define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) #endif /* WGL_NV_DX_interop */ /* --------------------------- WGL_NV_DX_interop2 -------------------------- */ #ifndef WGL_NV_DX_interop2 #define WGL_NV_DX_interop2 1 #define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) #endif /* WGL_NV_DX_interop2 */ /* --------------------------- WGL_NV_copy_image --------------------------- */ #ifndef WGL_NV_copy_image #define WGL_NV_copy_image 1 typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); #define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) #define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) #endif /* WGL_NV_copy_image */ /* ------------------------ WGL_NV_delay_before_swap ----------------------- */ #ifndef WGL_NV_delay_before_swap #define WGL_NV_delay_before_swap 1 typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); #define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) #define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) #endif /* WGL_NV_delay_before_swap */ /* -------------------------- WGL_NV_float_buffer -------------------------- */ #ifndef WGL_NV_float_buffer #define WGL_NV_float_buffer 1 #define WGL_FLOAT_COMPONENTS_NV 0x20B0 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 #define WGL_TEXTURE_FLOAT_R_NV 0x20B5 #define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 #define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 #define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 #define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) #endif /* WGL_NV_float_buffer */ /* -------------------------- WGL_NV_gpu_affinity -------------------------- */ #ifndef WGL_NV_gpu_affinity #define WGL_NV_gpu_affinity 1 #define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 #define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 DECLARE_HANDLE(HGPUNV); typedef struct _GPU_DEVICE { DWORD cb; CHAR DeviceName[32]; CHAR DeviceString[128]; DWORD Flags; RECT rcVirtualScreen; } GPU_DEVICE, *PGPU_DEVICE; typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); #define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) #define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) #define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) #define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) #define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) #define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) #endif /* WGL_NV_gpu_affinity */ /* ---------------------- WGL_NV_multisample_coverage ---------------------- */ #ifndef WGL_NV_multisample_coverage #define WGL_NV_multisample_coverage 1 #define WGL_COVERAGE_SAMPLES_NV 0x2042 #define WGL_COLOR_SAMPLES_NV 0x20B9 #define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) #endif /* WGL_NV_multisample_coverage */ /* -------------------------- WGL_NV_present_video ------------------------- */ #ifndef WGL_NV_present_video #define WGL_NV_present_video 1 #define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); #define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) #define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) #define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) #define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) #endif /* WGL_NV_present_video */ /* ---------------------- WGL_NV_render_depth_texture ---------------------- */ #ifndef WGL_NV_render_depth_texture #define WGL_NV_render_depth_texture 1 #define WGL_NO_TEXTURE_ARB 0x2077 #define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 #define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 #define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 #define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 #define WGL_DEPTH_COMPONENT_NV 0x20A7 #define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) #endif /* WGL_NV_render_depth_texture */ /* -------------------- WGL_NV_render_texture_rectangle -------------------- */ #ifndef WGL_NV_render_texture_rectangle #define WGL_NV_render_texture_rectangle 1 #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 #define WGL_TEXTURE_RECTANGLE_NV 0x20A2 #define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) #endif /* WGL_NV_render_texture_rectangle */ /* --------------------------- WGL_NV_swap_group --------------------------- */ #ifndef WGL_NV_swap_group #define WGL_NV_swap_group 1 typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); #define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) #define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) #define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) #define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) #define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) #define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) #define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) #endif /* WGL_NV_swap_group */ /* ----------------------- WGL_NV_vertex_array_range ----------------------- */ #ifndef WGL_NV_vertex_array_range #define WGL_NV_vertex_array_range 1 typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); #define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) #define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) #define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) #endif /* WGL_NV_vertex_array_range */ /* -------------------------- WGL_NV_video_capture ------------------------- */ #ifndef WGL_NV_video_capture #define WGL_NV_video_capture 1 #define WGL_UNIQUE_ID_NV 0x20CE #define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF DECLARE_HANDLE(HVIDEOINPUTDEVICENV); typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); #define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) #define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) #define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) #define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) #define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) #define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) #endif /* WGL_NV_video_capture */ /* -------------------------- WGL_NV_video_output -------------------------- */ #ifndef WGL_NV_video_output #define WGL_NV_video_output 1 #define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 #define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 #define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 #define WGL_VIDEO_OUT_COLOR_NV 0x20C3 #define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 #define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 #define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 #define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 #define WGL_VIDEO_OUT_FRAME 0x20C8 #define WGL_VIDEO_OUT_FIELD_1 0x20C9 #define WGL_VIDEO_OUT_FIELD_2 0x20CA #define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB #define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC DECLARE_HANDLE(HPVIDEODEV); typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); #define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) #define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) #define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) #define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) #define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) #define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) #define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) #endif /* WGL_NV_video_output */ /* -------------------------- WGL_OML_sync_control ------------------------- */ #ifndef WGL_OML_sync_control #define WGL_OML_sync_control 1 typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); #define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) #define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) #define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) #define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) #define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) #define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) #define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) #endif /* WGL_OML_sync_control */ /* ------------------------------------------------------------------------- */ #ifdef GLEW_MX #define WGLEW_FUN_EXPORT #define WGLEW_VAR_EXPORT #else #define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT #define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT #endif /* GLEW_MX */ #ifdef GLEW_MX struct WGLEWContextStruct { #endif /* GLEW_MX */ WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; #ifdef GLEW_MX }; /* WGLEWContextStruct */ #endif /* GLEW_MX */ /* ------------------------------------------------------------------------- */ #ifdef GLEW_MX typedef struct WGLEWContextStruct WGLEWContext; GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); #define wglewInit() wglewContextInit(wglewGetContext()) #define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) #define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) #define WGLEW_GET_FUN(x) wglewGetContext()->x #else /* GLEW_MX */ GLEWAPI GLenum GLEWAPIENTRY wglewInit (); GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); #define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) #define WGLEW_GET_FUN(x) x #endif /* GLEW_MX */ GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); #ifdef __cplusplus } #endif #undef GLEWAPI #endif /* __wglew_h__ */ goxel-0.8.1/ext_src/glew/glew.c000066400000000000000000035750431334742672700164050ustar00rootroot00000000000000/* ** The OpenGL Extension Wrangler Library ** Copyright (C) 2008-2015, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** 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. ** * The name of the author 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. */ #include #if defined(_WIN32) # include #elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) # include #endif #include /* For size_t */ /* * Define glewGetContext and related helper macros. */ #ifdef GLEW_MX # define glewGetContext() ctx # ifdef _WIN32 # define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx # define GLEW_CONTEXT_ARG_VAR_INIT ctx # define wglewGetContext() ctx # define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx # define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx # else /* _WIN32 */ # define GLEW_CONTEXT_ARG_DEF_INIT void # define GLEW_CONTEXT_ARG_VAR_INIT # define glxewGetContext() ctx # define GLXEW_CONTEXT_ARG_DEF_INIT void # define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx # endif /* _WIN32 */ # define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx #else /* GLEW_MX */ # define GLEW_CONTEXT_ARG_DEF_INIT void # define GLEW_CONTEXT_ARG_VAR_INIT # define GLEW_CONTEXT_ARG_DEF_LIST void # define WGLEW_CONTEXT_ARG_DEF_INIT void # define WGLEW_CONTEXT_ARG_DEF_LIST void # define GLXEW_CONTEXT_ARG_DEF_INIT void # define GLXEW_CONTEXT_ARG_DEF_LIST void #endif /* GLEW_MX */ #if defined(GLEW_REGAL) /* In GLEW_REGAL mode we call direcly into the linked libRegal.so glGetProcAddressREGAL for looking up the GL function pointers. */ # undef glGetProcAddressREGAL # ifdef WIN32 extern void * __stdcall glGetProcAddressREGAL(const GLchar *name); static void * (__stdcall * regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; # else extern void * glGetProcAddressREGAL(const GLchar *name); static void * (*regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; # endif # define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) #elif defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX) #include #include #include void* dlGetProcAddress (const GLubyte* name) { static void* h = NULL; static void* gpa; if (h == NULL) { if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; gpa = dlsym(h, "glXGetProcAddress"); } if (gpa != NULL) return ((void*(*)(const GLubyte*))gpa)(name); else return dlsym(h, (const char*)name); } #endif /* __sgi || __sun || GLEW_APPLE_GLX */ #if defined(__APPLE__) #include #include #include #ifdef MAC_OS_X_VERSION_10_3 #include void* NSGLGetProcAddress (const GLubyte *name) { static void* image = NULL; void* addr; if (NULL == image) { image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); } if( !image ) return NULL; addr = dlsym(image, (const char*)name); if( addr ) return addr; #ifdef GLEW_APPLE_GLX return dlGetProcAddress( name ); // try next for glx symbols #else return NULL; #endif } #else #include void* NSGLGetProcAddress (const GLubyte *name) { static const struct mach_header* image = NULL; NSSymbol symbol; char* symbolName; if (NULL == image) { image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); } /* prepend a '_' for the Unix C symbol mangling convention */ symbolName = malloc(strlen((const char*)name) + 2); strcpy(symbolName+1, (const char*)name); symbolName[0] = '_'; symbol = NULL; /* if (NSIsSymbolNameDefined(symbolName)) symbol = NSLookupAndBindSymbol(symbolName); */ symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; free(symbolName); if( symbol ) return NSAddressOfSymbol(symbol); #ifdef GLEW_APPLE_GLX return dlGetProcAddress( name ); // try next for glx symbols #else return NULL; #endif } #endif /* MAC_OS_X_VERSION_10_3 */ #endif /* __APPLE__ */ /* * Define glewGetProcAddress. */ #if defined(GLEW_REGAL) # define glewGetProcAddress(name) regalGetProcAddress((const GLchar *) name) #elif defined(_WIN32) # define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) #elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) # define glewGetProcAddress(name) NSGLGetProcAddress(name) #elif defined(__sgi) || defined(__sun) || defined(__HAIKU__) # define glewGetProcAddress(name) dlGetProcAddress(name) #elif defined(__ANDROID__) # define glewGetProcAddress(name) NULL /* TODO */ #elif defined(__native_client__) # define glewGetProcAddress(name) NULL /* TODO */ #else /* __linux */ # define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) #endif /* * Redefine GLEW_GET_VAR etc without const cast */ #undef GLEW_GET_VAR #ifdef GLEW_MX # define GLEW_GET_VAR(x) (glewGetContext()->x) #else /* GLEW_MX */ # define GLEW_GET_VAR(x) (x) #endif /* GLEW_MX */ #ifdef WGLEW_GET_VAR # undef WGLEW_GET_VAR # ifdef GLEW_MX # define WGLEW_GET_VAR(x) (wglewGetContext()->x) # else /* GLEW_MX */ # define WGLEW_GET_VAR(x) (x) # endif /* GLEW_MX */ #endif /* WGLEW_GET_VAR */ #ifdef GLXEW_GET_VAR # undef GLXEW_GET_VAR # ifdef GLEW_MX # define GLXEW_GET_VAR(x) (glxewGetContext()->x) # else /* GLEW_MX */ # define GLXEW_GET_VAR(x) (x) # endif /* GLEW_MX */ #endif /* GLXEW_GET_VAR */ /* * GLEW, just like OpenGL or GLU, does not rely on the standard C library. * These functions implement the functionality required in this file. */ static GLuint _glewStrLen (const GLubyte* s) { GLuint i=0; if (s == NULL) return 0; while (s[i] != '\0') i++; return i; } static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) { GLuint i=0; if (s == NULL) return 0; while (s[i] != '\0' && s[i] != c) i++; return (s[i] == '\0' || s[i] == c) ? i : 0; } static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) { GLuint i=0; if(a == NULL || b == NULL) return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; return i == n ? GL_TRUE : GL_FALSE; } static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) { while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) { (*a)++; (*na)--; } if(*na >= nb) { GLuint i=0; while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; if(i == nb) { *a = *a + nb; *na = *na - nb; return GL_TRUE; } } return GL_FALSE; } static GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) { if(*na >= nb) { GLuint i=0; while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; if(i == nb) { *a = *a + nb; *na = *na - nb; return GL_TRUE; } } return GL_FALSE; } static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) { if(*na >= nb) { GLuint i=0; while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) { *a = *a + nb; *na = *na - nb; return GL_TRUE; } } return GL_FALSE; } /* * Search for name in the extensions string. Use of strstr() * is not sufficient because extension names can be prefixes of * other extension names. Could use strtok() but the constant * string returned by glGetString might be in read-only memory. */ static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) { const GLubyte* p; GLuint len = _glewStrLen((const GLubyte*)name); p = start; while (p < end) { GLuint n = _glewStrCLen(p, ' '); if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; p += n+1; } return GL_FALSE; } #if !defined(_WIN32) || !defined(GLEW_MX) PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; PFNGLBLENDCOLORPROC __glewBlendColor = NULL; PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; PFNGLBUFFERDATAPROC __glewBufferData = NULL; PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; PFNGLENDQUERYPROC __glewEndQuery = NULL; PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; PFNGLGENQUERIESPROC __glewGenQueries = NULL; PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; PFNGLISBUFFERPROC __glewIsBuffer = NULL; PFNGLISQUERYPROC __glewIsQuery = NULL; PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; PFNGLATTACHSHADERPROC __glewAttachShader = NULL; PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; PFNGLCREATESHADERPROC __glewCreateShader = NULL; PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; PFNGLDELETESHADERPROC __glewDeleteShader = NULL; PFNGLDETACHSHADERPROC __glewDetachShader = NULL; PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; PFNGLISPROGRAMPROC __glewIsProgram = NULL; PFNGLISSHADERPROC __glewIsShader = NULL; PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; PFNGLUNIFORM1FPROC __glewUniform1f = NULL; PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; PFNGLUNIFORM1IPROC __glewUniform1i = NULL; PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; PFNGLUNIFORM2FPROC __glewUniform2f = NULL; PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; PFNGLUNIFORM2IPROC __glewUniform2i = NULL; PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; PFNGLUNIFORM3FPROC __glewUniform3f = NULL; PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; PFNGLUNIFORM3IPROC __glewUniform3i = NULL; PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; PFNGLUNIFORM4FPROC __glewUniform4f = NULL; PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; PFNGLUNIFORM4IPROC __glewUniform4i = NULL; PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; PFNGLCLAMPCOLORPROC __glewClampColor = NULL; PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; PFNGLCOLORMASKIPROC __glewColorMaski = NULL; PFNGLDISABLEIPROC __glewDisablei = NULL; PFNGLENABLEIPROC __glewEnablei = NULL; PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; PFNGLGETSTRINGIPROC __glewGetStringi = NULL; PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus = NULL; PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage = NULL; PFNGLGETNTEXIMAGEPROC __glewGetnTexImage = NULL; PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv = NULL; PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD = NULL; PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD = NULL; PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD = NULL; PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD = NULL; PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE = NULL; PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE = NULL; PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE = NULL; PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE = NULL; PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE = NULL; PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE = NULL; PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE = NULL; PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE = NULL; PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE = NULL; PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE = NULL; PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE = NULL; PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE = NULL; PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE = NULL; PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE = NULL; PFNGLISQUERYANGLEPROC __glewIsQueryANGLE = NULL; PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE = NULL; PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE = NULL; PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion = NULL; PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB = NULL; PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB = NULL; PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB = NULL; PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB = NULL; PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB = NULL; PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB = NULL; PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB = NULL; PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB = NULL; PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB = NULL; PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB = NULL; PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB = NULL; PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB = NULL; PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB = NULL; PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB = NULL; PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB = NULL; PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB = NULL; PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB = NULL; PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; PFNGLBUFFERSTORAGEPROC __glewBufferStorage = NULL; PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT = NULL; PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; PFNGLCLEARTEXIMAGEPROC __glewClearTexImage = NULL; PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage = NULL; PFNGLCLIPCONTROLPROC __glewClipControl = NULL; PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB = NULL; PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit = NULL; PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer = NULL; PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus = NULL; PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData = NULL; PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData = NULL; PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi = NULL; PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv = NULL; PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv = NULL; PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D = NULL; PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData = NULL; PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D = NULL; PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D = NULL; PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D = NULL; PFNGLCREATEBUFFERSPROC __glewCreateBuffers = NULL; PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers = NULL; PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines = NULL; PFNGLCREATEQUERIESPROC __glewCreateQueries = NULL; PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers = NULL; PFNGLCREATESAMPLERSPROC __glewCreateSamplers = NULL; PFNGLCREATETEXTURESPROC __glewCreateTextures = NULL; PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks = NULL; PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays = NULL; PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib = NULL; PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib = NULL; PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange = NULL; PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap = NULL; PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage = NULL; PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v = NULL; PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv = NULL; PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv = NULL; PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData = NULL; PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv = NULL; PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv = NULL; PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv = NULL; PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v = NULL; PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv = NULL; PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v = NULL; PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv = NULL; PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage = NULL; PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv = NULL; PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv = NULL; PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv = NULL; PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv = NULL; PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv = NULL; PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv = NULL; PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v = NULL; PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v = NULL; PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv = NULL; PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv = NULL; PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv = NULL; PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv = NULL; PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData = NULL; PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData = NULL; PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer = NULL; PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange = NULL; PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData = NULL; PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage = NULL; PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData = NULL; PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer = NULL; PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers = NULL; PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri = NULL; PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer = NULL; PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer = NULL; PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture = NULL; PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer = NULL; PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage = NULL; PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample = NULL; PFNGLTEXTUREBUFFERPROC __glewTextureBuffer = NULL; PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange = NULL; PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv = NULL; PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv = NULL; PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf = NULL; PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv = NULL; PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri = NULL; PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv = NULL; PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D = NULL; PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D = NULL; PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample = NULL; PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D = NULL; PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample = NULL; PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D = NULL; PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D = NULL; PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D = NULL; PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase = NULL; PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange = NULL; PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer = NULL; PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding = NULL; PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat = NULL; PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat = NULL; PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat = NULL; PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor = NULL; PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer = NULL; PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer = NULL; PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers = NULL; PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage = NULL; PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage = NULL; PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; PFNGLUNIFORM1DPROC __glewUniform1d = NULL; PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; PFNGLUNIFORM2DPROC __glewUniform2d = NULL; PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; PFNGLUNIFORM3DPROC __glewUniform3d = NULL; PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; PFNGLUNIFORM4DPROC __glewUniform4d = NULL; PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB = NULL; PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB = NULL; PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB = NULL; PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB = NULL; PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB = NULL; PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB = NULL; PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB = NULL; PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB = NULL; PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB = NULL; PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB = NULL; PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB = NULL; PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB = NULL; PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB = NULL; PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB = NULL; PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB = NULL; PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB = NULL; PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB = NULL; PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB = NULL; PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB = NULL; PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB = NULL; PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB = NULL; PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB = NULL; PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB = NULL; PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB = NULL; PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB = NULL; PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB = NULL; PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB = NULL; PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB = NULL; PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB = NULL; PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB = NULL; PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB = NULL; PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB = NULL; PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB = NULL; PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB = NULL; PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB = NULL; PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB = NULL; PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; PFNGLCOLORTABLEPROC __glewColorTable = NULL; PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; PFNGLGETMINMAXPROC __glewGetMinmax = NULL; PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; PFNGLHISTOGRAMPROC __glewHistogram = NULL; PFNGLMINMAXPROC __glewMinmax = NULL; PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB = NULL; PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB = NULL; PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase = NULL; PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange = NULL; PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures = NULL; PFNGLBINDSAMPLERSPROC __glewBindSamplers = NULL; PFNGLBINDTEXTURESPROC __glewBindTextures = NULL; PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers = NULL; PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB = NULL; PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB = NULL; PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB = NULL; PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; PFNGLISSAMPLERPROC __glewIsSampler = NULL; PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB = NULL; PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB = NULL; PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT = NULL; PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; PFNGLDELETESYNCPROC __glewDeleteSync = NULL; PFNGLFENCESYNCPROC __glewFenceSync = NULL; PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; PFNGLISSYNCPROC __glewIsSync = NULL; PFNGLWAITSYNCPROC __glewWaitSync = NULL; PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; PFNGLTEXTUREBARRIERPROC __glewTextureBarrier = NULL; PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT = NULL; PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT = NULL; PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT = NULL; PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT = NULL; PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT = NULL; PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV = NULL; PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV = NULL; PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV = NULL; PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT = NULL; PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL = NULL; PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL = NULL; PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL = NULL; PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL = NULL; PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL = NULL; PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL = NULL; PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL = NULL; PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL = NULL; PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL = NULL; PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL = NULL; PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL = NULL; PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL = NULL; PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL = NULL; PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR = NULL; PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL; PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv = NULL; PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv = NULL; PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv = NULL; PFNGLREADNPIXELSPROC __glewReadnPixels = NULL; PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX = NULL; PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX = NULL; PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV = NULL; PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV = NULL; PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV = NULL; PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV = NULL; PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV = NULL; PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV = NULL; PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV = NULL; PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV = NULL; PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV = NULL; PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; PFNGLISFENCENVPROC __glewIsFenceNV = NULL; PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV = NULL; PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV = NULL; PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV = NULL; PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; PFNGLISPATHNVPROC __glewIsPathNV = NULL; PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV = NULL; PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV = NULL; PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV = NULL; PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV = NULL; PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV = NULL; PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV = NULL; PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV = NULL; PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV = NULL; PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV = NULL; PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV = NULL; PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV = NULL; PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV = NULL; PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV = NULL; PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV = NULL; PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV = NULL; PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV = NULL; PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; PFNGLORTHOFOESPROC __glewOrthofOES = NULL; PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR = NULL; PFNGLALPHAFUNCXPROC __glewAlphaFuncx = NULL; PFNGLCLEARCOLORXPROC __glewClearColorx = NULL; PFNGLCLEARDEPTHXPROC __glewClearDepthx = NULL; PFNGLCOLOR4XPROC __glewColor4x = NULL; PFNGLDEPTHRANGEXPROC __glewDepthRangex = NULL; PFNGLFOGXPROC __glewFogx = NULL; PFNGLFOGXVPROC __glewFogxv = NULL; PFNGLFRUSTUMFPROC __glewFrustumf = NULL; PFNGLFRUSTUMXPROC __glewFrustumx = NULL; PFNGLLIGHTMODELXPROC __glewLightModelx = NULL; PFNGLLIGHTMODELXVPROC __glewLightModelxv = NULL; PFNGLLIGHTXPROC __glewLightx = NULL; PFNGLLIGHTXVPROC __glewLightxv = NULL; PFNGLLINEWIDTHXPROC __glewLineWidthx = NULL; PFNGLLOADMATRIXXPROC __glewLoadMatrixx = NULL; PFNGLMATERIALXPROC __glewMaterialx = NULL; PFNGLMATERIALXVPROC __glewMaterialxv = NULL; PFNGLMULTMATRIXXPROC __glewMultMatrixx = NULL; PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x = NULL; PFNGLNORMAL3XPROC __glewNormal3x = NULL; PFNGLORTHOFPROC __glewOrthof = NULL; PFNGLORTHOXPROC __glewOrthox = NULL; PFNGLPOINTSIZEXPROC __glewPointSizex = NULL; PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx = NULL; PFNGLROTATEXPROC __glewRotatex = NULL; PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex = NULL; PFNGLSCALEXPROC __glewScalex = NULL; PFNGLTEXENVXPROC __glewTexEnvx = NULL; PFNGLTEXENVXVPROC __glewTexEnvxv = NULL; PFNGLTEXPARAMETERXPROC __glewTexParameterx = NULL; PFNGLTRANSLATEXPROC __glewTranslatex = NULL; PFNGLCLIPPLANEFPROC __glewClipPlanef = NULL; PFNGLCLIPPLANEXPROC __glewClipPlanex = NULL; PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef = NULL; PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex = NULL; PFNGLGETFIXEDVPROC __glewGetFixedv = NULL; PFNGLGETLIGHTXVPROC __glewGetLightxv = NULL; PFNGLGETMATERIALXVPROC __glewGetMaterialxv = NULL; PFNGLGETTEXENVXVPROC __glewGetTexEnvxv = NULL; PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv = NULL; PFNGLPOINTPARAMETERXPROC __glewPointParameterx = NULL; PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv = NULL; PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES = NULL; PFNGLTEXPARAMETERXVPROC __glewTexParameterxv = NULL; PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL = NULL; PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL = NULL; PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; #endif /* !WIN32 || !GLEW_MX */ #if !defined(GLEW_MX) GLboolean __GLEW_VERSION_1_1 = GL_FALSE; GLboolean __GLEW_VERSION_1_2 = GL_FALSE; GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; GLboolean __GLEW_VERSION_1_3 = GL_FALSE; GLboolean __GLEW_VERSION_1_4 = GL_FALSE; GLboolean __GLEW_VERSION_1_5 = GL_FALSE; GLboolean __GLEW_VERSION_2_0 = GL_FALSE; GLboolean __GLEW_VERSION_2_1 = GL_FALSE; GLboolean __GLEW_VERSION_3_0 = GL_FALSE; GLboolean __GLEW_VERSION_3_1 = GL_FALSE; GLboolean __GLEW_VERSION_3_2 = GL_FALSE; GLboolean __GLEW_VERSION_3_3 = GL_FALSE; GLboolean __GLEW_VERSION_4_0 = GL_FALSE; GLboolean __GLEW_VERSION_4_1 = GL_FALSE; GLboolean __GLEW_VERSION_4_2 = GL_FALSE; GLboolean __GLEW_VERSION_4_3 = GL_FALSE; GLboolean __GLEW_VERSION_4_4 = GL_FALSE; GLboolean __GLEW_VERSION_4_5 = GL_FALSE; GLboolean __GLEW_3DFX_multisample = GL_FALSE; GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; GLboolean __GLEW_AMD_debug_output = GL_FALSE; GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; GLboolean __GLEW_AMD_gcn_shader = GL_FALSE; GLboolean __GLEW_AMD_gpu_shader_int64 = GL_FALSE; GLboolean __GLEW_AMD_interleaved_elements = GL_FALSE; GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; GLboolean __GLEW_AMD_occlusion_query_event = GL_FALSE; GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; GLboolean __GLEW_AMD_sample_positions = GL_FALSE; GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; GLboolean __GLEW_AMD_shader_atomic_counter_ops = GL_FALSE; GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; GLboolean __GLEW_AMD_shader_stencil_value_export = GL_FALSE; GLboolean __GLEW_AMD_shader_trinary_minmax = GL_FALSE; GLboolean __GLEW_AMD_sparse_texture = GL_FALSE; GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; GLboolean __GLEW_AMD_transform_feedback4 = GL_FALSE; GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; GLboolean __GLEW_ANGLE_depth_texture = GL_FALSE; GLboolean __GLEW_ANGLE_framebuffer_blit = GL_FALSE; GLboolean __GLEW_ANGLE_framebuffer_multisample = GL_FALSE; GLboolean __GLEW_ANGLE_instanced_arrays = GL_FALSE; GLboolean __GLEW_ANGLE_pack_reverse_row_order = GL_FALSE; GLboolean __GLEW_ANGLE_program_binary = GL_FALSE; GLboolean __GLEW_ANGLE_texture_compression_dxt1 = GL_FALSE; GLboolean __GLEW_ANGLE_texture_compression_dxt3 = GL_FALSE; GLboolean __GLEW_ANGLE_texture_compression_dxt5 = GL_FALSE; GLboolean __GLEW_ANGLE_texture_usage = GL_FALSE; GLboolean __GLEW_ANGLE_timer_query = GL_FALSE; GLboolean __GLEW_ANGLE_translated_shader_source = GL_FALSE; GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; GLboolean __GLEW_APPLE_client_storage = GL_FALSE; GLboolean __GLEW_APPLE_element_array = GL_FALSE; GLboolean __GLEW_APPLE_fence = GL_FALSE; GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; GLboolean __GLEW_APPLE_texture_range = GL_FALSE; GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; GLboolean __GLEW_ARB_ES3_1_compatibility = GL_FALSE; GLboolean __GLEW_ARB_ES3_2_compatibility = GL_FALSE; GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; GLboolean __GLEW_ARB_base_instance = GL_FALSE; GLboolean __GLEW_ARB_bindless_texture = GL_FALSE; GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; GLboolean __GLEW_ARB_buffer_storage = GL_FALSE; GLboolean __GLEW_ARB_cl_event = GL_FALSE; GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_clear_texture = GL_FALSE; GLboolean __GLEW_ARB_clip_control = GL_FALSE; GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; GLboolean __GLEW_ARB_compatibility = GL_FALSE; GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; GLboolean __GLEW_ARB_compute_shader = GL_FALSE; GLboolean __GLEW_ARB_compute_variable_group_size = GL_FALSE; GLboolean __GLEW_ARB_conditional_render_inverted = GL_FALSE; GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; GLboolean __GLEW_ARB_copy_image = GL_FALSE; GLboolean __GLEW_ARB_cull_distance = GL_FALSE; GLboolean __GLEW_ARB_debug_output = GL_FALSE; GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; GLboolean __GLEW_ARB_depth_texture = GL_FALSE; GLboolean __GLEW_ARB_derivative_control = GL_FALSE; GLboolean __GLEW_ARB_direct_state_access = GL_FALSE; GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; GLboolean __GLEW_ARB_enhanced_layouts = GL_FALSE; GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; GLboolean __GLEW_ARB_fragment_program = GL_FALSE; GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; GLboolean __GLEW_ARB_fragment_shader_interlock = GL_FALSE; GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; GLboolean __GLEW_ARB_get_texture_sub_image = GL_FALSE; GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; GLboolean __GLEW_ARB_gpu_shader_int64 = GL_FALSE; GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; GLboolean __GLEW_ARB_imaging = GL_FALSE; GLboolean __GLEW_ARB_indirect_parameters = GL_FALSE; GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; GLboolean __GLEW_ARB_multi_bind = GL_FALSE; GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; GLboolean __GLEW_ARB_multisample = GL_FALSE; GLboolean __GLEW_ARB_multitexture = GL_FALSE; GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; GLboolean __GLEW_ARB_parallel_shader_compile = GL_FALSE; GLboolean __GLEW_ARB_pipeline_statistics_query = GL_FALSE; GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_point_parameters = GL_FALSE; GLboolean __GLEW_ARB_point_sprite = GL_FALSE; GLboolean __GLEW_ARB_post_depth_coverage = GL_FALSE; GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; GLboolean __GLEW_ARB_query_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; GLboolean __GLEW_ARB_robustness = GL_FALSE; GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; GLboolean __GLEW_ARB_sample_locations = GL_FALSE; GLboolean __GLEW_ARB_sample_shading = GL_FALSE; GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; GLboolean __GLEW_ARB_seamless_cubemap_per_texture = GL_FALSE; GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; GLboolean __GLEW_ARB_shader_atomic_counter_ops = GL_FALSE; GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; GLboolean __GLEW_ARB_shader_ballot = GL_FALSE; GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; GLboolean __GLEW_ARB_shader_clock = GL_FALSE; GLboolean __GLEW_ARB_shader_draw_parameters = GL_FALSE; GLboolean __GLEW_ARB_shader_group_vote = GL_FALSE; GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; GLboolean __GLEW_ARB_shader_objects = GL_FALSE; GLboolean __GLEW_ARB_shader_precision = GL_FALSE; GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; GLboolean __GLEW_ARB_shader_texture_image_samples = GL_FALSE; GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; GLboolean __GLEW_ARB_shader_viewport_layer_array = GL_FALSE; GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; GLboolean __GLEW_ARB_shadow = GL_FALSE; GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; GLboolean __GLEW_ARB_sparse_buffer = GL_FALSE; GLboolean __GLEW_ARB_sparse_texture = GL_FALSE; GLboolean __GLEW_ARB_sparse_texture2 = GL_FALSE; GLboolean __GLEW_ARB_sparse_texture_clamp = GL_FALSE; GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; GLboolean __GLEW_ARB_sync = GL_FALSE; GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; GLboolean __GLEW_ARB_texture_barrier = GL_FALSE; GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; GLboolean __GLEW_ARB_texture_compression = GL_FALSE; GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; GLboolean __GLEW_ARB_texture_filter_minmax = GL_FALSE; GLboolean __GLEW_ARB_texture_float = GL_FALSE; GLboolean __GLEW_ARB_texture_gather = GL_FALSE; GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge = GL_FALSE; GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; GLboolean __GLEW_ARB_texture_rg = GL_FALSE; GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; GLboolean __GLEW_ARB_texture_stencil8 = GL_FALSE; GLboolean __GLEW_ARB_texture_storage = GL_FALSE; GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; GLboolean __GLEW_ARB_texture_view = GL_FALSE; GLboolean __GLEW_ARB_timer_query = GL_FALSE; GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; GLboolean __GLEW_ARB_transform_feedback_overflow_query = GL_FALSE; GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; GLboolean __GLEW_ARB_vertex_program = GL_FALSE; GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev = GL_FALSE; GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; GLboolean __GLEW_ARB_viewport_array = GL_FALSE; GLboolean __GLEW_ARB_window_pos = GL_FALSE; GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; GLboolean __GLEW_ATI_element_array = GL_FALSE; GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; GLboolean __GLEW_ATI_meminfo = GL_FALSE; GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; GLboolean __GLEW_ATI_texture_float = GL_FALSE; GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; GLboolean __GLEW_EXT_422_pixels = GL_FALSE; GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; GLboolean __GLEW_EXT_abgr = GL_FALSE; GLboolean __GLEW_EXT_bgra = GL_FALSE; GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; GLboolean __GLEW_EXT_blend_color = GL_FALSE; GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; GLboolean __GLEW_EXT_cmyka = GL_FALSE; GLboolean __GLEW_EXT_color_subtable = GL_FALSE; GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; GLboolean __GLEW_EXT_convolution = GL_FALSE; GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; GLboolean __GLEW_EXT_copy_texture = GL_FALSE; GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; GLboolean __GLEW_EXT_debug_label = GL_FALSE; GLboolean __GLEW_EXT_debug_marker = GL_FALSE; GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; GLboolean __GLEW_EXT_fog_coord = GL_FALSE; GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; GLboolean __GLEW_EXT_histogram = GL_FALSE; GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; GLboolean __GLEW_EXT_index_func = GL_FALSE; GLboolean __GLEW_EXT_index_material = GL_FALSE; GLboolean __GLEW_EXT_index_texture = GL_FALSE; GLboolean __GLEW_EXT_light_texture = GL_FALSE; GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; GLboolean __GLEW_EXT_multisample = GL_FALSE; GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; GLboolean __GLEW_EXT_packed_float = GL_FALSE; GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; GLboolean __GLEW_EXT_point_parameters = GL_FALSE; GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; GLboolean __GLEW_EXT_polygon_offset_clamp = GL_FALSE; GLboolean __GLEW_EXT_post_depth_coverage = GL_FALSE; GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; GLboolean __GLEW_EXT_raster_multisample = GL_FALSE; GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; GLboolean __GLEW_EXT_scene_marker = GL_FALSE; GLboolean __GLEW_EXT_secondary_color = GL_FALSE; GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; GLboolean __GLEW_EXT_shader_image_load_formatted = GL_FALSE; GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; GLboolean __GLEW_EXT_shader_integer_mix = GL_FALSE; GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; GLboolean __GLEW_EXT_sparse_texture2 = GL_FALSE; GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; GLboolean __GLEW_EXT_subtexture = GL_FALSE; GLboolean __GLEW_EXT_texture = GL_FALSE; GLboolean __GLEW_EXT_texture3D = GL_FALSE; GLboolean __GLEW_EXT_texture_array = GL_FALSE; GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; GLboolean __GLEW_EXT_texture_env = GL_FALSE; GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; GLboolean __GLEW_EXT_texture_filter_minmax = GL_FALSE; GLboolean __GLEW_EXT_texture_integer = GL_FALSE; GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; GLboolean __GLEW_EXT_texture_object = GL_FALSE; GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; GLboolean __GLEW_EXT_timer_query = GL_FALSE; GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; GLboolean __GLEW_EXT_vertex_array = GL_FALSE; GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; GLboolean __GLEW_HP_image_transform = GL_FALSE; GLboolean __GLEW_HP_occlusion_test = GL_FALSE; GLboolean __GLEW_HP_texture_lighting = GL_FALSE; GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; GLboolean __GLEW_IBM_static_data = GL_FALSE; GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; GLboolean __GLEW_INGR_color_clamp = GL_FALSE; GLboolean __GLEW_INGR_interlace_read = GL_FALSE; GLboolean __GLEW_INTEL_fragment_shader_ordering = GL_FALSE; GLboolean __GLEW_INTEL_framebuffer_CMAA = GL_FALSE; GLboolean __GLEW_INTEL_map_texture = GL_FALSE; GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; GLboolean __GLEW_INTEL_performance_query = GL_FALSE; GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; GLboolean __GLEW_KHR_blend_equation_advanced = GL_FALSE; GLboolean __GLEW_KHR_blend_equation_advanced_coherent = GL_FALSE; GLboolean __GLEW_KHR_context_flush_control = GL_FALSE; GLboolean __GLEW_KHR_debug = GL_FALSE; GLboolean __GLEW_KHR_no_error = GL_FALSE; GLboolean __GLEW_KHR_robust_buffer_access_behavior = GL_FALSE; GLboolean __GLEW_KHR_robustness = GL_FALSE; GLboolean __GLEW_KHR_texture_compression_astc_hdr = GL_FALSE; GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; GLboolean __GLEW_KTX_buffer_region = GL_FALSE; GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; GLboolean __GLEW_MESA_pack_invert = GL_FALSE; GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; GLboolean __GLEW_MESA_window_pos = GL_FALSE; GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; GLboolean __GLEW_NVX_conditional_render = GL_FALSE; GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; GLboolean __GLEW_NV_bindless_multi_draw_indirect = GL_FALSE; GLboolean __GLEW_NV_bindless_multi_draw_indirect_count = GL_FALSE; GLboolean __GLEW_NV_bindless_texture = GL_FALSE; GLboolean __GLEW_NV_blend_equation_advanced = GL_FALSE; GLboolean __GLEW_NV_blend_equation_advanced_coherent = GL_FALSE; GLboolean __GLEW_NV_blend_square = GL_FALSE; GLboolean __GLEW_NV_compute_program5 = GL_FALSE; GLboolean __GLEW_NV_conditional_render = GL_FALSE; GLboolean __GLEW_NV_conservative_raster = GL_FALSE; GLboolean __GLEW_NV_conservative_raster_dilate = GL_FALSE; GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; GLboolean __GLEW_NV_copy_image = GL_FALSE; GLboolean __GLEW_NV_deep_texture3D = GL_FALSE; GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; GLboolean __GLEW_NV_depth_clamp = GL_FALSE; GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; GLboolean __GLEW_NV_draw_texture = GL_FALSE; GLboolean __GLEW_NV_evaluators = GL_FALSE; GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; GLboolean __GLEW_NV_fence = GL_FALSE; GLboolean __GLEW_NV_fill_rectangle = GL_FALSE; GLboolean __GLEW_NV_float_buffer = GL_FALSE; GLboolean __GLEW_NV_fog_distance = GL_FALSE; GLboolean __GLEW_NV_fragment_coverage_to_color = GL_FALSE; GLboolean __GLEW_NV_fragment_program = GL_FALSE; GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; GLboolean __GLEW_NV_fragment_shader_interlock = GL_FALSE; GLboolean __GLEW_NV_framebuffer_mixed_samples = GL_FALSE; GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; GLboolean __GLEW_NV_geometry_shader_passthrough = GL_FALSE; GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; GLboolean __GLEW_NV_gpu_program5_mem_extended = GL_FALSE; GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; GLboolean __GLEW_NV_half_float = GL_FALSE; GLboolean __GLEW_NV_internalformat_sample_query = GL_FALSE; GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; GLboolean __GLEW_NV_occlusion_query = GL_FALSE; GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; GLboolean __GLEW_NV_path_rendering = GL_FALSE; GLboolean __GLEW_NV_path_rendering_shared_edge = GL_FALSE; GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; GLboolean __GLEW_NV_point_sprite = GL_FALSE; GLboolean __GLEW_NV_present_video = GL_FALSE; GLboolean __GLEW_NV_primitive_restart = GL_FALSE; GLboolean __GLEW_NV_register_combiners = GL_FALSE; GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; GLboolean __GLEW_NV_sample_locations = GL_FALSE; GLboolean __GLEW_NV_sample_mask_override_coverage = GL_FALSE; GLboolean __GLEW_NV_shader_atomic_counters = GL_FALSE; GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; GLboolean __GLEW_NV_shader_atomic_fp16_vector = GL_FALSE; GLboolean __GLEW_NV_shader_atomic_int64 = GL_FALSE; GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; GLboolean __GLEW_NV_shader_storage_buffer_object = GL_FALSE; GLboolean __GLEW_NV_shader_thread_group = GL_FALSE; GLboolean __GLEW_NV_shader_thread_shuffle = GL_FALSE; GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; GLboolean __GLEW_NV_texture_barrier = GL_FALSE; GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; GLboolean __GLEW_NV_texture_multisample = GL_FALSE; GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; GLboolean __GLEW_NV_texture_shader = GL_FALSE; GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; GLboolean __GLEW_NV_transform_feedback = GL_FALSE; GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; GLboolean __GLEW_NV_uniform_buffer_unified_memory = GL_FALSE; GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; GLboolean __GLEW_NV_vertex_program = GL_FALSE; GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; GLboolean __GLEW_NV_video_capture = GL_FALSE; GLboolean __GLEW_NV_viewport_array2 = GL_FALSE; GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; GLboolean __GLEW_OES_read_format = GL_FALSE; GLboolean __GLEW_OES_single_precision = GL_FALSE; GLboolean __GLEW_OML_interlace = GL_FALSE; GLboolean __GLEW_OML_resample = GL_FALSE; GLboolean __GLEW_OML_subsample = GL_FALSE; GLboolean __GLEW_OVR_multiview = GL_FALSE; GLboolean __GLEW_OVR_multiview2 = GL_FALSE; GLboolean __GLEW_PGI_misc_hints = GL_FALSE; GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; GLboolean __GLEW_REGAL_ES1_0_compatibility = GL_FALSE; GLboolean __GLEW_REGAL_ES1_1_compatibility = GL_FALSE; GLboolean __GLEW_REGAL_enable = GL_FALSE; GLboolean __GLEW_REGAL_error_string = GL_FALSE; GLboolean __GLEW_REGAL_extension_query = GL_FALSE; GLboolean __GLEW_REGAL_log = GL_FALSE; GLboolean __GLEW_REGAL_proc_address = GL_FALSE; GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; GLboolean __GLEW_S3_s3tc = GL_FALSE; GLboolean __GLEW_SGIS_color_range = GL_FALSE; GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; GLboolean __GLEW_SGIS_fog_function = GL_FALSE; GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; GLboolean __GLEW_SGIS_multisample = GL_FALSE; GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; GLboolean __GLEW_SGIS_texture4D = GL_FALSE; GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; GLboolean __GLEW_SGIS_texture_select = GL_FALSE; GLboolean __GLEW_SGIX_async = GL_FALSE; GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; GLboolean __GLEW_SGIX_clipmap = GL_FALSE; GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; GLboolean __GLEW_SGIX_framezoom = GL_FALSE; GLboolean __GLEW_SGIX_interlace = GL_FALSE; GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; GLboolean __GLEW_SGIX_list_priority = GL_FALSE; GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; GLboolean __GLEW_SGIX_resample = GL_FALSE; GLboolean __GLEW_SGIX_shadow = GL_FALSE; GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; GLboolean __GLEW_SGIX_sprite = GL_FALSE; GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; GLboolean __GLEW_SGIX_texture_range = GL_FALSE; GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; GLboolean __GLEW_SGI_color_matrix = GL_FALSE; GLboolean __GLEW_SGI_color_table = GL_FALSE; GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; GLboolean __GLEW_SUNX_constant_data = GL_FALSE; GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; GLboolean __GLEW_SUN_global_alpha = GL_FALSE; GLboolean __GLEW_SUN_mesh_array = GL_FALSE; GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; GLboolean __GLEW_SUN_slice_accum = GL_FALSE; GLboolean __GLEW_SUN_triangle_list = GL_FALSE; GLboolean __GLEW_SUN_vertex = GL_FALSE; GLboolean __GLEW_WIN_phong_shading = GL_FALSE; GLboolean __GLEW_WIN_specular_fog = GL_FALSE; GLboolean __GLEW_WIN_swap_hint = GL_FALSE; #endif /* !GLEW_MX */ #ifdef GL_VERSION_1_2 static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; return r; } #endif /* GL_VERSION_1_2 */ #ifdef GL_VERSION_1_3 static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; return r; } #endif /* GL_VERSION_1_3 */ #ifdef GL_VERSION_1_4 static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; return r; } #endif /* GL_VERSION_1_4 */ #ifdef GL_VERSION_1_5 static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; return r; } #endif /* GL_VERSION_1_5 */ #ifdef GL_VERSION_2_0 static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; return r; } #endif /* GL_VERSION_2_0 */ #ifdef GL_VERSION_2_1 static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; return r; } #endif /* GL_VERSION_2_1 */ #ifdef GL_VERSION_3_0 static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; return r; } #endif /* GL_VERSION_3_0 */ #ifdef GL_VERSION_3_1 static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; return r; } #endif /* GL_VERSION_3_1 */ #ifdef GL_VERSION_3_2 static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; return r; } #endif /* GL_VERSION_3_2 */ #ifdef GL_VERSION_3_3 static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; return r; } #endif /* GL_VERSION_3_3 */ #ifdef GL_VERSION_4_0 static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; return r; } #endif /* GL_VERSION_4_0 */ #ifdef GL_VERSION_4_5 static GLboolean _glewInit_GL_VERSION_4_5 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatus")) == NULL) || r; r = ((glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImage")) == NULL) || r; r = ((glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImage")) == NULL) || r; r = ((glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdv")) == NULL) || r; return r; } #endif /* GL_VERSION_4_5 */ #ifdef GL_3DFX_tbuffer static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; return r; } #endif /* GL_3DFX_tbuffer */ #ifdef GL_AMD_debug_output static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; return r; } #endif /* GL_AMD_debug_output */ #ifdef GL_AMD_draw_buffers_blend static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; return r; } #endif /* GL_AMD_draw_buffers_blend */ #ifdef GL_AMD_interleaved_elements static GLboolean _glewInit_GL_AMD_interleaved_elements (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribParameteriAMD")) == NULL) || r; return r; } #endif /* GL_AMD_interleaved_elements */ #ifdef GL_AMD_multi_draw_indirect static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; return r; } #endif /* GL_AMD_multi_draw_indirect */ #ifdef GL_AMD_name_gen_delete static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; return r; } #endif /* GL_AMD_name_gen_delete */ #ifdef GL_AMD_occlusion_query_event static GLboolean _glewInit_GL_AMD_occlusion_query_event (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)glewGetProcAddress((const GLubyte*)"glQueryObjectParameteruiAMD")) == NULL) || r; return r; } #endif /* GL_AMD_occlusion_query_event */ #ifdef GL_AMD_performance_monitor static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; return r; } #endif /* GL_AMD_performance_monitor */ #ifdef GL_AMD_sample_positions static GLboolean _glewInit_GL_AMD_sample_positions (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; return r; } #endif /* GL_AMD_sample_positions */ #ifdef GL_AMD_sparse_texture static GLboolean _glewInit_GL_AMD_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTexStorageSparseAMD")) == NULL) || r; r = ((glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageSparseAMD")) == NULL) || r; return r; } #endif /* GL_AMD_sparse_texture */ #ifdef GL_AMD_stencil_operation_extended static GLboolean _glewInit_GL_AMD_stencil_operation_extended (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; return r; } #endif /* GL_AMD_stencil_operation_extended */ #ifdef GL_AMD_vertex_shader_tessellator static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; return r; } #endif /* GL_AMD_vertex_shader_tessellator */ #ifdef GL_ANGLE_framebuffer_blit static GLboolean _glewInit_GL_ANGLE_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferANGLE")) == NULL) || r; return r; } #endif /* GL_ANGLE_framebuffer_blit */ #ifdef GL_ANGLE_framebuffer_multisample static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleANGLE")) == NULL) || r; return r; } #endif /* GL_ANGLE_framebuffer_multisample */ #ifdef GL_ANGLE_instanced_arrays static GLboolean _glewInit_GL_ANGLE_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedANGLE")) == NULL) || r; r = ((glDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedANGLE")) == NULL) || r; r = ((glVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorANGLE")) == NULL) || r; return r; } #endif /* GL_ANGLE_instanced_arrays */ #ifdef GL_ANGLE_timer_query static GLboolean _glewInit_GL_ANGLE_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginQueryANGLE = (PFNGLBEGINQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryANGLE")) == NULL) || r; r = ((glDeleteQueriesANGLE = (PFNGLDELETEQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesANGLE")) == NULL) || r; r = ((glEndQueryANGLE = (PFNGLENDQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glEndQueryANGLE")) == NULL) || r; r = ((glGenQueriesANGLE = (PFNGLGENQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesANGLE")) == NULL) || r; r = ((glGetQueryObjecti64vANGLE = (PFNGLGETQUERYOBJECTI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vANGLE")) == NULL) || r; r = ((glGetQueryObjectivANGLE = (PFNGLGETQUERYOBJECTIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivANGLE")) == NULL) || r; r = ((glGetQueryObjectui64vANGLE = (PFNGLGETQUERYOBJECTUI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vANGLE")) == NULL) || r; r = ((glGetQueryObjectuivANGLE = (PFNGLGETQUERYOBJECTUIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivANGLE")) == NULL) || r; r = ((glGetQueryivANGLE = (PFNGLGETQUERYIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivANGLE")) == NULL) || r; r = ((glIsQueryANGLE = (PFNGLISQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glIsQueryANGLE")) == NULL) || r; r = ((glQueryCounterANGLE = (PFNGLQUERYCOUNTERANGLEPROC)glewGetProcAddress((const GLubyte*)"glQueryCounterANGLE")) == NULL) || r; return r; } #endif /* GL_ANGLE_timer_query */ #ifdef GL_ANGLE_translated_shader_source static GLboolean _glewInit_GL_ANGLE_translated_shader_source (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetTranslatedShaderSourceANGLE")) == NULL) || r; return r; } #endif /* GL_ANGLE_translated_shader_source */ #ifdef GL_APPLE_element_array static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_element_array */ #ifdef GL_APPLE_fence static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_fence */ #ifdef GL_APPLE_flush_buffer_range static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_flush_buffer_range */ #ifdef GL_APPLE_object_purgeable static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_object_purgeable */ #ifdef GL_APPLE_texture_range static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_texture_range */ #ifdef GL_APPLE_vertex_array_object static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_vertex_array_object */ #ifdef GL_APPLE_vertex_array_range static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_vertex_array_range */ #ifdef GL_APPLE_vertex_program_evaluators static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; return r; } #endif /* GL_APPLE_vertex_program_evaluators */ #ifdef GL_ARB_ES2_compatibility static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; return r; } #endif /* GL_ARB_ES2_compatibility */ #ifdef GL_ARB_ES3_1_compatibility static GLboolean _glewInit_GL_ARB_ES3_1_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierByRegion")) == NULL) || r; return r; } #endif /* GL_ARB_ES3_1_compatibility */ #ifdef GL_ARB_ES3_2_compatibility static GLboolean _glewInit_GL_ARB_ES3_2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveBoundingBoxARB")) == NULL) || r; return r; } #endif /* GL_ARB_ES3_2_compatibility */ #ifdef GL_ARB_base_instance static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; return r; } #endif /* GL_ARB_base_instance */ #ifdef GL_ARB_bindless_texture static GLboolean _glewInit_GL_ARB_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleARB")) == NULL) || r; r = ((glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleARB")) == NULL) || r; r = ((glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleARB")) == NULL) || r; r = ((glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vARB")) == NULL) || r; r = ((glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentARB")) == NULL) || r; r = ((glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentARB")) == NULL) || r; r = ((glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentARB")) == NULL) || r; r = ((glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentARB")) == NULL) || r; r = ((glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentARB")) == NULL) || r; r = ((glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentARB")) == NULL) || r; r = ((glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64ARB")) == NULL) || r; r = ((glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vARB")) == NULL) || r; r = ((glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64ARB")) == NULL) || r; r = ((glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vARB")) == NULL) || r; r = ((glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64ARB")) == NULL) || r; r = ((glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vARB")) == NULL) || r; return r; } #endif /* GL_ARB_bindless_texture */ #ifdef GL_ARB_blend_func_extended static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; return r; } #endif /* GL_ARB_blend_func_extended */ #ifdef GL_ARB_buffer_storage static GLboolean _glewInit_GL_ARB_buffer_storage (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBufferStorage = (PFNGLBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glBufferStorage")) == NULL) || r; r = ((glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageEXT")) == NULL) || r; return r; } #endif /* GL_ARB_buffer_storage */ #ifdef GL_ARB_cl_event static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; return r; } #endif /* GL_ARB_cl_event */ #ifdef GL_ARB_clear_buffer_object static GLboolean _glewInit_GL_ARB_clear_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; return r; } #endif /* GL_ARB_clear_buffer_object */ #ifdef GL_ARB_clear_texture static GLboolean _glewInit_GL_ARB_clear_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexImage")) == NULL) || r; r = ((glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImage")) == NULL) || r; return r; } #endif /* GL_ARB_clear_texture */ #ifdef GL_ARB_clip_control static GLboolean _glewInit_GL_ARB_clip_control (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClipControl = (PFNGLCLIPCONTROLPROC)glewGetProcAddress((const GLubyte*)"glClipControl")) == NULL) || r; return r; } #endif /* GL_ARB_clip_control */ #ifdef GL_ARB_color_buffer_float static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; return r; } #endif /* GL_ARB_color_buffer_float */ #ifdef GL_ARB_compute_shader static GLboolean _glewInit_GL_ARB_compute_shader (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; return r; } #endif /* GL_ARB_compute_shader */ #ifdef GL_ARB_compute_variable_group_size static GLboolean _glewInit_GL_ARB_compute_variable_group_size (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeGroupSizeARB")) == NULL) || r; return r; } #endif /* GL_ARB_compute_variable_group_size */ #ifdef GL_ARB_copy_buffer static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; return r; } #endif /* GL_ARB_copy_buffer */ #ifdef GL_ARB_copy_image static GLboolean _glewInit_GL_ARB_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; return r; } #endif /* GL_ARB_copy_image */ #ifdef GL_ARB_debug_output static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; return r; } #endif /* GL_ARB_debug_output */ #ifdef GL_ARB_direct_state_access static GLboolean _glewInit_GL_ARB_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnit")) == NULL) || r; r = ((glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitNamedFramebuffer")) == NULL) || r; r = ((glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatus")) == NULL) || r; r = ((glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferData")) == NULL) || r; r = ((glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubData")) == NULL) || r; r = ((glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfi")) == NULL) || r; r = ((glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfv")) == NULL) || r; r = ((glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferiv")) == NULL) || r; r = ((glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferuiv")) == NULL) || r; r = ((glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1D")) == NULL) || r; r = ((glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2D")) == NULL) || r; r = ((glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3D")) == NULL) || r; r = ((glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyNamedBufferSubData")) == NULL) || r; r = ((glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1D")) == NULL) || r; r = ((glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2D")) == NULL) || r; r = ((glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3D")) == NULL) || r; r = ((glCreateBuffers = (PFNGLCREATEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateBuffers")) == NULL) || r; r = ((glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateFramebuffers")) == NULL) || r; r = ((glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramPipelines")) == NULL) || r; r = ((glCreateQueries = (PFNGLCREATEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glCreateQueries")) == NULL) || r; r = ((glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateRenderbuffers")) == NULL) || r; r = ((glCreateSamplers = (PFNGLCREATESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glCreateSamplers")) == NULL) || r; r = ((glCreateTextures = (PFNGLCREATETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glCreateTextures")) == NULL) || r; r = ((glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glCreateTransformFeedbacks")) == NULL) || r; r = ((glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glCreateVertexArrays")) == NULL) || r; r = ((glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttrib")) == NULL) || r; r = ((glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttrib")) == NULL) || r; r = ((glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRange")) == NULL) || r; r = ((glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmap")) == NULL) || r; r = ((glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImage")) == NULL) || r; r = ((glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteri64v")) == NULL) || r; r = ((glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteriv")) == NULL) || r; r = ((glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointerv")) == NULL) || r; r = ((glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubData")) == NULL) || r; r = ((glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameteriv")) == NULL) || r; r = ((glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameteriv")) == NULL) || r; r = ((glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameteriv")) == NULL) || r; r = ((glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjecti64v")) == NULL) || r; r = ((glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectiv")) == NULL) || r; r = ((glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectui64v")) == NULL) || r; r = ((glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectuiv")) == NULL) || r; r = ((glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImage")) == NULL) || r; r = ((glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfv")) == NULL) || r; r = ((glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameteriv")) == NULL) || r; r = ((glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIiv")) == NULL) || r; r = ((glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuiv")) == NULL) || r; r = ((glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfv")) == NULL) || r; r = ((glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameteriv")) == NULL) || r; r = ((glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki64_v")) == NULL) || r; r = ((glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki_v")) == NULL) || r; r = ((glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackiv")) == NULL) || r; r = ((glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexed64iv")) == NULL) || r; r = ((glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexediv")) == NULL) || r; r = ((glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayiv")) == NULL) || r; r = ((glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferData")) == NULL) || r; r = ((glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferSubData")) == NULL) || r; r = ((glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBuffer")) == NULL) || r; r = ((glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRange")) == NULL) || r; r = ((glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferData")) == NULL) || r; r = ((glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorage")) == NULL) || r; r = ((glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubData")) == NULL) || r; r = ((glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffer")) == NULL) || r; r = ((glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffers")) == NULL) || r; r = ((glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteri")) == NULL) || r; r = ((glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferReadBuffer")) == NULL) || r; r = ((glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbuffer")) == NULL) || r; r = ((glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture")) == NULL) || r; r = ((glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayer")) == NULL) || r; r = ((glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorage")) == NULL) || r; r = ((glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisample")) == NULL) || r; r = ((glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTextureBuffer")) == NULL) || r; r = ((glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRange")) == NULL) || r; r = ((glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIiv")) == NULL) || r; r = ((glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuiv")) == NULL) || r; r = ((glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterf")) == NULL) || r; r = ((glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfv")) == NULL) || r; r = ((glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteri")) == NULL) || r; r = ((glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriv")) == NULL) || r; r = ((glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1D")) == NULL) || r; r = ((glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2D")) == NULL) || r; r = ((glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisample")) == NULL) || r; r = ((glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3D")) == NULL) || r; r = ((glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisample")) == NULL) || r; r = ((glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1D")) == NULL) || r; r = ((glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2D")) == NULL) || r; r = ((glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3D")) == NULL) || r; r = ((glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferBase")) == NULL) || r; r = ((glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferRange")) == NULL) || r; r = ((glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBuffer")) == NULL) || r; r = ((glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribBinding")) == NULL) || r; r = ((glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribFormat")) == NULL) || r; r = ((glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribIFormat")) == NULL) || r; r = ((glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribLFormat")) == NULL) || r; r = ((glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindingDivisor")) == NULL) || r; r = ((glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayElementBuffer")) == NULL) || r; r = ((glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffer")) == NULL) || r; r = ((glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffers")) == NULL) || r; return r; } #endif /* GL_ARB_direct_state_access */ #ifdef GL_ARB_draw_buffers static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; return r; } #endif /* GL_ARB_draw_buffers */ #ifdef GL_ARB_draw_buffers_blend static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; return r; } #endif /* GL_ARB_draw_buffers_blend */ #ifdef GL_ARB_draw_elements_base_vertex static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; return r; } #endif /* GL_ARB_draw_elements_base_vertex */ #ifdef GL_ARB_draw_indirect static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; return r; } #endif /* GL_ARB_draw_indirect */ #ifdef GL_ARB_framebuffer_no_attachments static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; return r; } #endif /* GL_ARB_framebuffer_no_attachments */ #ifdef GL_ARB_framebuffer_object static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; return r; } #endif /* GL_ARB_framebuffer_object */ #ifdef GL_ARB_geometry_shader4 static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; return r; } #endif /* GL_ARB_geometry_shader4 */ #ifdef GL_ARB_get_program_binary static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; return r; } #endif /* GL_ARB_get_program_binary */ #ifdef GL_ARB_get_texture_sub_image static GLboolean _glewInit_GL_ARB_get_texture_sub_image (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureSubImage")) == NULL) || r; r = ((glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSubImage")) == NULL) || r; return r; } #endif /* GL_ARB_get_texture_sub_image */ #ifdef GL_ARB_gpu_shader_fp64 static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; return r; } #endif /* GL_ARB_gpu_shader_fp64 */ #ifdef GL_ARB_gpu_shader_int64 static GLboolean _glewInit_GL_ARB_gpu_shader_int64 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vARB")) == NULL) || r; r = ((glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vARB")) == NULL) || r; r = ((glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformi64vARB")) == NULL) || r; r = ((glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformui64vARB")) == NULL) || r; r = ((glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64ARB")) == NULL) || r; r = ((glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vARB")) == NULL) || r; r = ((glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64ARB")) == NULL) || r; r = ((glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vARB")) == NULL) || r; r = ((glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64ARB")) == NULL) || r; r = ((glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vARB")) == NULL) || r; r = ((glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64ARB")) == NULL) || r; r = ((glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vARB")) == NULL) || r; r = ((glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64ARB")) == NULL) || r; r = ((glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vARB")) == NULL) || r; r = ((glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64ARB")) == NULL) || r; r = ((glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vARB")) == NULL) || r; r = ((glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64ARB")) == NULL) || r; r = ((glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vARB")) == NULL) || r; r = ((glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64ARB")) == NULL) || r; r = ((glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vARB")) == NULL) || r; r = ((glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64ARB")) == NULL) || r; r = ((glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vARB")) == NULL) || r; r = ((glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64ARB")) == NULL) || r; r = ((glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vARB")) == NULL) || r; r = ((glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64ARB")) == NULL) || r; r = ((glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vARB")) == NULL) || r; r = ((glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64ARB")) == NULL) || r; r = ((glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vARB")) == NULL) || r; r = ((glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64ARB")) == NULL) || r; r = ((glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vARB")) == NULL) || r; r = ((glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64ARB")) == NULL) || r; r = ((glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vARB")) == NULL) || r; r = ((glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64ARB")) == NULL) || r; r = ((glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vARB")) == NULL) || r; r = ((glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64ARB")) == NULL) || r; r = ((glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vARB")) == NULL) || r; return r; } #endif /* GL_ARB_gpu_shader_int64 */ #ifdef GL_ARB_imaging static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; return r; } #endif /* GL_ARB_imaging */ #ifdef GL_ARB_indirect_parameters static GLboolean _glewInit_GL_ARB_indirect_parameters (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCountARB")) == NULL) || r; r = ((glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCountARB")) == NULL) || r; return r; } #endif /* GL_ARB_indirect_parameters */ #ifdef GL_ARB_instanced_arrays static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; return r; } #endif /* GL_ARB_instanced_arrays */ #ifdef GL_ARB_internalformat_query static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; return r; } #endif /* GL_ARB_internalformat_query */ #ifdef GL_ARB_internalformat_query2 static GLboolean _glewInit_GL_ARB_internalformat_query2 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; return r; } #endif /* GL_ARB_internalformat_query2 */ #ifdef GL_ARB_invalidate_subdata static GLboolean _glewInit_GL_ARB_invalidate_subdata (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; return r; } #endif /* GL_ARB_invalidate_subdata */ #ifdef GL_ARB_map_buffer_range static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; return r; } #endif /* GL_ARB_map_buffer_range */ #ifdef GL_ARB_matrix_palette static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; return r; } #endif /* GL_ARB_matrix_palette */ #ifdef GL_ARB_multi_bind static GLboolean _glewInit_GL_ARB_multi_bind (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersBase")) == NULL) || r; r = ((glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersRange")) == NULL) || r; r = ((glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextures")) == NULL) || r; r = ((glBindSamplers = (PFNGLBINDSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glBindSamplers")) == NULL) || r; r = ((glBindTextures = (PFNGLBINDTEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindTextures")) == NULL) || r; r = ((glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffers")) == NULL) || r; return r; } #endif /* GL_ARB_multi_bind */ #ifdef GL_ARB_multi_draw_indirect static GLboolean _glewInit_GL_ARB_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; return r; } #endif /* GL_ARB_multi_draw_indirect */ #ifdef GL_ARB_multisample static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; return r; } #endif /* GL_ARB_multisample */ #ifdef GL_ARB_multitexture static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; return r; } #endif /* GL_ARB_multitexture */ #ifdef GL_ARB_occlusion_query static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; return r; } #endif /* GL_ARB_occlusion_query */ #ifdef GL_ARB_parallel_shader_compile static GLboolean _glewInit_GL_ARB_parallel_shader_compile (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)glewGetProcAddress((const GLubyte*)"glMaxShaderCompilerThreadsARB")) == NULL) || r; return r; } #endif /* GL_ARB_parallel_shader_compile */ #ifdef GL_ARB_point_parameters static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; return r; } #endif /* GL_ARB_point_parameters */ #ifdef GL_ARB_program_interface_query static GLboolean _glewInit_GL_ARB_program_interface_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; return r; } #endif /* GL_ARB_program_interface_query */ #ifdef GL_ARB_provoking_vertex static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; return r; } #endif /* GL_ARB_provoking_vertex */ #ifdef GL_ARB_robustness static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; return r; } #endif /* GL_ARB_robustness */ #ifdef GL_ARB_sample_locations static GLboolean _glewInit_GL_ARB_sample_locations (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvARB")) == NULL) || r; r = ((glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvARB")) == NULL) || r; return r; } #endif /* GL_ARB_sample_locations */ #ifdef GL_ARB_sample_shading static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; return r; } #endif /* GL_ARB_sample_shading */ #ifdef GL_ARB_sampler_objects static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; return r; } #endif /* GL_ARB_sampler_objects */ #ifdef GL_ARB_separate_shader_objects static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; return r; } #endif /* GL_ARB_separate_shader_objects */ #ifdef GL_ARB_shader_atomic_counters static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; return r; } #endif /* GL_ARB_shader_atomic_counters */ #ifdef GL_ARB_shader_image_load_store static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; return r; } #endif /* GL_ARB_shader_image_load_store */ #ifdef GL_ARB_shader_objects static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; return r; } #endif /* GL_ARB_shader_objects */ #ifdef GL_ARB_shader_storage_buffer_object static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; return r; } #endif /* GL_ARB_shader_storage_buffer_object */ #ifdef GL_ARB_shader_subroutine static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; return r; } #endif /* GL_ARB_shader_subroutine */ #ifdef GL_ARB_shading_language_include static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; return r; } #endif /* GL_ARB_shading_language_include */ #ifdef GL_ARB_sparse_buffer static GLboolean _glewInit_GL_ARB_sparse_buffer (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glBufferPageCommitmentARB")) == NULL) || r; return r; } #endif /* GL_ARB_sparse_buffer */ #ifdef GL_ARB_sparse_texture static GLboolean _glewInit_GL_ARB_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentARB")) == NULL) || r; r = ((glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexturePageCommitmentEXT")) == NULL) || r; return r; } #endif /* GL_ARB_sparse_texture */ #ifdef GL_ARB_sync static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; return r; } #endif /* GL_ARB_sync */ #ifdef GL_ARB_tessellation_shader static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; return r; } #endif /* GL_ARB_tessellation_shader */ #ifdef GL_ARB_texture_barrier static GLboolean _glewInit_GL_ARB_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrier")) == NULL) || r; return r; } #endif /* GL_ARB_texture_barrier */ #ifdef GL_ARB_texture_buffer_object static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; return r; } #endif /* GL_ARB_texture_buffer_object */ #ifdef GL_ARB_texture_buffer_range static GLboolean _glewInit_GL_ARB_texture_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; return r; } #endif /* GL_ARB_texture_buffer_range */ #ifdef GL_ARB_texture_compression static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; return r; } #endif /* GL_ARB_texture_compression */ #ifdef GL_ARB_texture_multisample static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; return r; } #endif /* GL_ARB_texture_multisample */ #ifdef GL_ARB_texture_storage static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; return r; } #endif /* GL_ARB_texture_storage */ #ifdef GL_ARB_texture_storage_multisample static GLboolean _glewInit_GL_ARB_texture_storage_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; return r; } #endif /* GL_ARB_texture_storage_multisample */ #ifdef GL_ARB_texture_view static GLboolean _glewInit_GL_ARB_texture_view (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; return r; } #endif /* GL_ARB_texture_view */ #ifdef GL_ARB_timer_query static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; return r; } #endif /* GL_ARB_timer_query */ #ifdef GL_ARB_transform_feedback2 static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; return r; } #endif /* GL_ARB_transform_feedback2 */ #ifdef GL_ARB_transform_feedback3 static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; return r; } #endif /* GL_ARB_transform_feedback3 */ #ifdef GL_ARB_transform_feedback_instanced static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; return r; } #endif /* GL_ARB_transform_feedback_instanced */ #ifdef GL_ARB_transpose_matrix static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; return r; } #endif /* GL_ARB_transpose_matrix */ #ifdef GL_ARB_uniform_buffer_object static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; return r; } #endif /* GL_ARB_uniform_buffer_object */ #ifdef GL_ARB_vertex_array_object static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_array_object */ #ifdef GL_ARB_vertex_attrib_64bit static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_attrib_64bit */ #ifdef GL_ARB_vertex_attrib_binding static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; r = ((glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindVertexBufferEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribBindingEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribFormatEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIFormatEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLFormatEXT")) == NULL) || r; r = ((glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBindingDivisorEXT")) == NULL) || r; r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_attrib_binding */ #ifdef GL_ARB_vertex_blend static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_blend */ #ifdef GL_ARB_vertex_buffer_object static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_buffer_object */ #ifdef GL_ARB_vertex_program static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_program */ #ifdef GL_ARB_vertex_shader static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_shader */ #ifdef GL_ARB_vertex_type_2_10_10_10_rev static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; return r; } #endif /* GL_ARB_vertex_type_2_10_10_10_rev */ #ifdef GL_ARB_viewport_array static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; return r; } #endif /* GL_ARB_viewport_array */ #ifdef GL_ARB_window_pos static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; return r; } #endif /* GL_ARB_window_pos */ #ifdef GL_ATI_draw_buffers static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; return r; } #endif /* GL_ATI_draw_buffers */ #ifdef GL_ATI_element_array static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; return r; } #endif /* GL_ATI_element_array */ #ifdef GL_ATI_envmap_bumpmap static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; return r; } #endif /* GL_ATI_envmap_bumpmap */ #ifdef GL_ATI_fragment_shader static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; return r; } #endif /* GL_ATI_fragment_shader */ #ifdef GL_ATI_map_object_buffer static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; return r; } #endif /* GL_ATI_map_object_buffer */ #ifdef GL_ATI_pn_triangles static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; return r; } #endif /* GL_ATI_pn_triangles */ #ifdef GL_ATI_separate_stencil static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; return r; } #endif /* GL_ATI_separate_stencil */ #ifdef GL_ATI_vertex_array_object static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; return r; } #endif /* GL_ATI_vertex_array_object */ #ifdef GL_ATI_vertex_attrib_array_object static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; return r; } #endif /* GL_ATI_vertex_attrib_array_object */ #ifdef GL_ATI_vertex_streams static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; return r; } #endif /* GL_ATI_vertex_streams */ #ifdef GL_EXT_bindable_uniform static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; return r; } #endif /* GL_EXT_bindable_uniform */ #ifdef GL_EXT_blend_color static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; return r; } #endif /* GL_EXT_blend_color */ #ifdef GL_EXT_blend_equation_separate static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; return r; } #endif /* GL_EXT_blend_equation_separate */ #ifdef GL_EXT_blend_func_separate static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; return r; } #endif /* GL_EXT_blend_func_separate */ #ifdef GL_EXT_blend_minmax static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; return r; } #endif /* GL_EXT_blend_minmax */ #ifdef GL_EXT_color_subtable static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; return r; } #endif /* GL_EXT_color_subtable */ #ifdef GL_EXT_compiled_vertex_array static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; return r; } #endif /* GL_EXT_compiled_vertex_array */ #ifdef GL_EXT_convolution static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; return r; } #endif /* GL_EXT_convolution */ #ifdef GL_EXT_coordinate_frame static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; return r; } #endif /* GL_EXT_coordinate_frame */ #ifdef GL_EXT_copy_texture static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; return r; } #endif /* GL_EXT_copy_texture */ #ifdef GL_EXT_cull_vertex static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; return r; } #endif /* GL_EXT_cull_vertex */ #ifdef GL_EXT_debug_label static GLboolean _glewInit_GL_EXT_debug_label (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabelEXT")) == NULL) || r; r = ((glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)glewGetProcAddress((const GLubyte*)"glLabelObjectEXT")) == NULL) || r; return r; } #endif /* GL_EXT_debug_label */ #ifdef GL_EXT_debug_marker static GLboolean _glewInit_GL_EXT_debug_marker (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; return r; } #endif /* GL_EXT_debug_marker */ #ifdef GL_EXT_depth_bounds_test static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; return r; } #endif /* GL_EXT_depth_bounds_test */ #ifdef GL_EXT_direct_state_access static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribDivisorEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; return r; } #endif /* GL_EXT_direct_state_access */ #ifdef GL_EXT_draw_buffers2 static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; return r; } #endif /* GL_EXT_draw_buffers2 */ #ifdef GL_EXT_draw_instanced static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; return r; } #endif /* GL_EXT_draw_instanced */ #ifdef GL_EXT_draw_range_elements static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; return r; } #endif /* GL_EXT_draw_range_elements */ #ifdef GL_EXT_fog_coord static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; return r; } #endif /* GL_EXT_fog_coord */ #ifdef GL_EXT_fragment_lighting static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; return r; } #endif /* GL_EXT_fragment_lighting */ #ifdef GL_EXT_framebuffer_blit static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; return r; } #endif /* GL_EXT_framebuffer_blit */ #ifdef GL_EXT_framebuffer_multisample static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; return r; } #endif /* GL_EXT_framebuffer_multisample */ #ifdef GL_EXT_framebuffer_object static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; return r; } #endif /* GL_EXT_framebuffer_object */ #ifdef GL_EXT_geometry_shader4 static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; return r; } #endif /* GL_EXT_geometry_shader4 */ #ifdef GL_EXT_gpu_program_parameters static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; return r; } #endif /* GL_EXT_gpu_program_parameters */ #ifdef GL_EXT_gpu_shader4 static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; return r; } #endif /* GL_EXT_gpu_shader4 */ #ifdef GL_EXT_histogram static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; return r; } #endif /* GL_EXT_histogram */ #ifdef GL_EXT_index_func static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; return r; } #endif /* GL_EXT_index_func */ #ifdef GL_EXT_index_material static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; return r; } #endif /* GL_EXT_index_material */ #ifdef GL_EXT_light_texture static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; return r; } #endif /* GL_EXT_light_texture */ #ifdef GL_EXT_multi_draw_arrays static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; return r; } #endif /* GL_EXT_multi_draw_arrays */ #ifdef GL_EXT_multisample static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; return r; } #endif /* GL_EXT_multisample */ #ifdef GL_EXT_paletted_texture static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; return r; } #endif /* GL_EXT_paletted_texture */ #ifdef GL_EXT_pixel_transform static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; return r; } #endif /* GL_EXT_pixel_transform */ #ifdef GL_EXT_point_parameters static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; return r; } #endif /* GL_EXT_point_parameters */ #ifdef GL_EXT_polygon_offset static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; return r; } #endif /* GL_EXT_polygon_offset */ #ifdef GL_EXT_polygon_offset_clamp static GLboolean _glewInit_GL_EXT_polygon_offset_clamp (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetClampEXT")) == NULL) || r; return r; } #endif /* GL_EXT_polygon_offset_clamp */ #ifdef GL_EXT_provoking_vertex static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; return r; } #endif /* GL_EXT_provoking_vertex */ #ifdef GL_EXT_raster_multisample static GLboolean _glewInit_GL_EXT_raster_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationNV")) == NULL) || r; r = ((glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationTableNV")) == NULL) || r; r = ((glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glGetCoverageModulationTableNV")) == NULL) || r; r = ((glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)glewGetProcAddress((const GLubyte*)"glRasterSamplesEXT")) == NULL) || r; return r; } #endif /* GL_EXT_raster_multisample */ #ifdef GL_EXT_scene_marker static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; return r; } #endif /* GL_EXT_scene_marker */ #ifdef GL_EXT_secondary_color static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; return r; } #endif /* GL_EXT_secondary_color */ #ifdef GL_EXT_separate_shader_objects static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; return r; } #endif /* GL_EXT_separate_shader_objects */ #ifdef GL_EXT_shader_image_load_store static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; return r; } #endif /* GL_EXT_shader_image_load_store */ #ifdef GL_EXT_stencil_two_side static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; return r; } #endif /* GL_EXT_stencil_two_side */ #ifdef GL_EXT_subtexture static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; return r; } #endif /* GL_EXT_subtexture */ #ifdef GL_EXT_texture3D static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; return r; } #endif /* GL_EXT_texture3D */ #ifdef GL_EXT_texture_array static GLboolean _glewInit_GL_EXT_texture_array (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; return r; } #endif /* GL_EXT_texture_array */ #ifdef GL_EXT_texture_buffer_object static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; return r; } #endif /* GL_EXT_texture_buffer_object */ #ifdef GL_EXT_texture_integer static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; return r; } #endif /* GL_EXT_texture_integer */ #ifdef GL_EXT_texture_object static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; return r; } #endif /* GL_EXT_texture_object */ #ifdef GL_EXT_texture_perturb_normal static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; return r; } #endif /* GL_EXT_texture_perturb_normal */ #ifdef GL_EXT_timer_query static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; return r; } #endif /* GL_EXT_timer_query */ #ifdef GL_EXT_transform_feedback static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; return r; } #endif /* GL_EXT_transform_feedback */ #ifdef GL_EXT_vertex_array static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; return r; } #endif /* GL_EXT_vertex_array */ #ifdef GL_EXT_vertex_attrib_64bit static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; return r; } #endif /* GL_EXT_vertex_attrib_64bit */ #ifdef GL_EXT_vertex_shader static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; return r; } #endif /* GL_EXT_vertex_shader */ #ifdef GL_EXT_vertex_weighting static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; return r; } #endif /* GL_EXT_vertex_weighting */ #ifdef GL_EXT_x11_sync_object static GLboolean _glewInit_GL_EXT_x11_sync_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; return r; } #endif /* GL_EXT_x11_sync_object */ #ifdef GL_GREMEDY_frame_terminator static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; return r; } #endif /* GL_GREMEDY_frame_terminator */ #ifdef GL_GREMEDY_string_marker static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; return r; } #endif /* GL_GREMEDY_string_marker */ #ifdef GL_HP_image_transform static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; return r; } #endif /* GL_HP_image_transform */ #ifdef GL_IBM_multimode_draw_arrays static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; return r; } #endif /* GL_IBM_multimode_draw_arrays */ #ifdef GL_IBM_vertex_array_lists static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; return r; } #endif /* GL_IBM_vertex_array_lists */ #ifdef GL_INTEL_map_texture static GLboolean _glewInit_GL_INTEL_map_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glMapTexture2DINTEL")) == NULL) || r; r = ((glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)glewGetProcAddress((const GLubyte*)"glSyncTextureINTEL")) == NULL) || r; r = ((glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glUnmapTexture2DINTEL")) == NULL) || r; return r; } #endif /* GL_INTEL_map_texture */ #ifdef GL_INTEL_parallel_arrays static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; return r; } #endif /* GL_INTEL_parallel_arrays */ #ifdef GL_INTEL_performance_query static GLboolean _glewInit_GL_INTEL_performance_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfQueryINTEL")) == NULL) || r; r = ((glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glCreatePerfQueryINTEL")) == NULL) || r; r = ((glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfQueryINTEL")) == NULL) || r; r = ((glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glEndPerfQueryINTEL")) == NULL) || r; r = ((glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetFirstPerfQueryIdINTEL")) == NULL) || r; r = ((glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetNextPerfQueryIdINTEL")) == NULL) || r; r = ((glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfCounterInfoINTEL")) == NULL) || r; r = ((glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryDataINTEL")) == NULL) || r; r = ((glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryIdByNameINTEL")) == NULL) || r; r = ((glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryInfoINTEL")) == NULL) || r; return r; } #endif /* GL_INTEL_performance_query */ #ifdef GL_INTEL_texture_scissor static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; return r; } #endif /* GL_INTEL_texture_scissor */ #ifdef GL_KHR_blend_equation_advanced static GLboolean _glewInit_GL_KHR_blend_equation_advanced (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierKHR")) == NULL) || r; return r; } #endif /* GL_KHR_blend_equation_advanced */ #ifdef GL_KHR_debug static GLboolean _glewInit_GL_KHR_debug (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; r = ((glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPopDebugGroup")) == NULL) || r; r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; return r; } #endif /* GL_KHR_debug */ #ifdef GL_KHR_robustness static GLboolean _glewInit_GL_KHR_robustness (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfv")) == NULL) || r; r = ((glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformiv")) == NULL) || r; r = ((glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuiv")) == NULL) || r; r = ((glReadnPixels = (PFNGLREADNPIXELSPROC)glewGetProcAddress((const GLubyte*)"glReadnPixels")) == NULL) || r; return r; } #endif /* GL_KHR_robustness */ #ifdef GL_KTX_buffer_region static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; return r; } #endif /* GL_KTX_buffer_region */ #ifdef GL_MESA_resize_buffers static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; return r; } #endif /* GL_MESA_resize_buffers */ #ifdef GL_MESA_window_pos static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; return r; } #endif /* GL_MESA_window_pos */ #ifdef GL_NVX_conditional_render static GLboolean _glewInit_GL_NVX_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNVX")) == NULL) || r; r = ((glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNVX")) == NULL) || r; return r; } #endif /* GL_NVX_conditional_render */ #ifdef GL_NV_bindless_multi_draw_indirect static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessNV")) == NULL) || r; r = ((glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessNV")) == NULL) || r; return r; } #endif /* GL_NV_bindless_multi_draw_indirect */ #ifdef GL_NV_bindless_multi_draw_indirect_count static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect_count (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessCountNV")) == NULL) || r; r = ((glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessCountNV")) == NULL) || r; return r; } #endif /* GL_NV_bindless_multi_draw_indirect_count */ #ifdef GL_NV_bindless_texture static GLboolean _glewInit_GL_NV_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; return r; } #endif /* GL_NV_bindless_texture */ #ifdef GL_NV_blend_equation_advanced static GLboolean _glewInit_GL_NV_blend_equation_advanced (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierNV")) == NULL) || r; r = ((glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glBlendParameteriNV")) == NULL) || r; return r; } #endif /* GL_NV_blend_equation_advanced */ #ifdef GL_NV_conditional_render static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; return r; } #endif /* GL_NV_conditional_render */ #ifdef GL_NV_conservative_raster static GLboolean _glewInit_GL_NV_conservative_raster (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)glewGetProcAddress((const GLubyte*)"glSubpixelPrecisionBiasNV")) == NULL) || r; return r; } #endif /* GL_NV_conservative_raster */ #ifdef GL_NV_conservative_raster_dilate static GLboolean _glewInit_GL_NV_conservative_raster_dilate (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glConservativeRasterParameterfNV")) == NULL) || r; return r; } #endif /* GL_NV_conservative_raster_dilate */ #ifdef GL_NV_copy_image static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; return r; } #endif /* GL_NV_copy_image */ #ifdef GL_NV_depth_buffer_float static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; return r; } #endif /* GL_NV_depth_buffer_float */ #ifdef GL_NV_draw_texture static GLboolean _glewInit_GL_NV_draw_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glDrawTextureNV")) == NULL) || r; return r; } #endif /* GL_NV_draw_texture */ #ifdef GL_NV_evaluators static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; return r; } #endif /* GL_NV_evaluators */ #ifdef GL_NV_explicit_multisample static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; return r; } #endif /* GL_NV_explicit_multisample */ #ifdef GL_NV_fence static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; return r; } #endif /* GL_NV_fence */ #ifdef GL_NV_fragment_coverage_to_color static GLboolean _glewInit_GL_NV_fragment_coverage_to_color (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)glewGetProcAddress((const GLubyte*)"glFragmentCoverageColorNV")) == NULL) || r; return r; } #endif /* GL_NV_fragment_coverage_to_color */ #ifdef GL_NV_fragment_program static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; return r; } #endif /* GL_NV_fragment_program */ #ifdef GL_NV_framebuffer_multisample_coverage static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; return r; } #endif /* GL_NV_framebuffer_multisample_coverage */ #ifdef GL_NV_geometry_program4 static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; return r; } #endif /* GL_NV_geometry_program4 */ #ifdef GL_NV_gpu_program4 static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; return r; } #endif /* GL_NV_gpu_program4 */ #ifdef GL_NV_gpu_shader5 static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; return r; } #endif /* GL_NV_gpu_shader5 */ #ifdef GL_NV_half_float static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; return r; } #endif /* GL_NV_half_float */ #ifdef GL_NV_internalformat_sample_query static GLboolean _glewInit_GL_NV_internalformat_sample_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformatSampleivNV")) == NULL) || r; return r; } #endif /* GL_NV_internalformat_sample_query */ #ifdef GL_NV_occlusion_query static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; return r; } #endif /* GL_NV_occlusion_query */ #ifdef GL_NV_parameter_buffer_object static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; return r; } #endif /* GL_NV_parameter_buffer_object */ #ifdef GL_NV_path_rendering static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; r = ((glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourcefvNV")) == NULL) || r; r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; r = ((glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x2fNV")) == NULL) || r; r = ((glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x3fNV")) == NULL) || r; r = ((glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTranspose3x3fNV")) == NULL) || r; r = ((glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x2fNV")) == NULL) || r; r = ((glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x3fNV")) == NULL) || r; r = ((glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTranspose3x3fNV")) == NULL) || r; r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; r = ((glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexArrayNV")) == NULL) || r; r = ((glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexRangeNV")) == NULL) || r; r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; r = ((glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathMemoryGlyphIndexArrayNV")) == NULL) || r; r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; r = ((glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)glewGetProcAddress((const GLubyte*)"glProgramPathFragmentInputGenNV")) == NULL) || r; r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; r = ((glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathInstancedNV")) == NULL) || r; r = ((glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathNV")) == NULL) || r; r = ((glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathInstancedNV")) == NULL) || r; r = ((glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathNV")) == NULL) || r; r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; return r; } #endif /* GL_NV_path_rendering */ #ifdef GL_NV_pixel_data_range static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; return r; } #endif /* GL_NV_pixel_data_range */ #ifdef GL_NV_point_sprite static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; return r; } #endif /* GL_NV_point_sprite */ #ifdef GL_NV_present_video static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; return r; } #endif /* GL_NV_present_video */ #ifdef GL_NV_primitive_restart static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; return r; } #endif /* GL_NV_primitive_restart */ #ifdef GL_NV_register_combiners static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; return r; } #endif /* GL_NV_register_combiners */ #ifdef GL_NV_register_combiners2 static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; return r; } #endif /* GL_NV_register_combiners2 */ #ifdef GL_NV_sample_locations static GLboolean _glewInit_GL_NV_sample_locations (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvNV")) == NULL) || r; r = ((glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvNV")) == NULL) || r; return r; } #endif /* GL_NV_sample_locations */ #ifdef GL_NV_shader_buffer_load static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; return r; } #endif /* GL_NV_shader_buffer_load */ #ifdef GL_NV_texture_barrier static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; return r; } #endif /* GL_NV_texture_barrier */ #ifdef GL_NV_texture_multisample static GLboolean _glewInit_GL_NV_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; return r; } #endif /* GL_NV_texture_multisample */ #ifdef GL_NV_transform_feedback static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; return r; } #endif /* GL_NV_transform_feedback */ #ifdef GL_NV_transform_feedback2 static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; return r; } #endif /* GL_NV_transform_feedback2 */ #ifdef GL_NV_vdpau_interop static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; return r; } #endif /* GL_NV_vdpau_interop */ #ifdef GL_NV_vertex_array_range static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; return r; } #endif /* GL_NV_vertex_array_range */ #ifdef GL_NV_vertex_attrib_integer_64bit static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; return r; } #endif /* GL_NV_vertex_attrib_integer_64bit */ #ifdef GL_NV_vertex_buffer_unified_memory static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; return r; } #endif /* GL_NV_vertex_buffer_unified_memory */ #ifdef GL_NV_vertex_program static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; return r; } #endif /* GL_NV_vertex_program */ #ifdef GL_NV_video_capture static GLboolean _glewInit_GL_NV_video_capture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; return r; } #endif /* GL_NV_video_capture */ #ifdef GL_OES_single_precision static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; return r; } #endif /* GL_OES_single_precision */ #ifdef GL_OVR_multiview static GLboolean _glewInit_GL_OVR_multiview (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureMultiviewOVR")) == NULL) || r; return r; } #endif /* GL_OVR_multiview */ #ifdef GL_REGAL_ES1_0_compatibility static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAlphaFuncx = (PFNGLALPHAFUNCXPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncx")) == NULL) || r; r = ((glClearColorx = (PFNGLCLEARCOLORXPROC)glewGetProcAddress((const GLubyte*)"glClearColorx")) == NULL) || r; r = ((glClearDepthx = (PFNGLCLEARDEPTHXPROC)glewGetProcAddress((const GLubyte*)"glClearDepthx")) == NULL) || r; r = ((glColor4x = (PFNGLCOLOR4XPROC)glewGetProcAddress((const GLubyte*)"glColor4x")) == NULL) || r; r = ((glDepthRangex = (PFNGLDEPTHRANGEXPROC)glewGetProcAddress((const GLubyte*)"glDepthRangex")) == NULL) || r; r = ((glFogx = (PFNGLFOGXPROC)glewGetProcAddress((const GLubyte*)"glFogx")) == NULL) || r; r = ((glFogxv = (PFNGLFOGXVPROC)glewGetProcAddress((const GLubyte*)"glFogxv")) == NULL) || r; r = ((glFrustumf = (PFNGLFRUSTUMFPROC)glewGetProcAddress((const GLubyte*)"glFrustumf")) == NULL) || r; r = ((glFrustumx = (PFNGLFRUSTUMXPROC)glewGetProcAddress((const GLubyte*)"glFrustumx")) == NULL) || r; r = ((glLightModelx = (PFNGLLIGHTMODELXPROC)glewGetProcAddress((const GLubyte*)"glLightModelx")) == NULL) || r; r = ((glLightModelxv = (PFNGLLIGHTMODELXVPROC)glewGetProcAddress((const GLubyte*)"glLightModelxv")) == NULL) || r; r = ((glLightx = (PFNGLLIGHTXPROC)glewGetProcAddress((const GLubyte*)"glLightx")) == NULL) || r; r = ((glLightxv = (PFNGLLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glLightxv")) == NULL) || r; r = ((glLineWidthx = (PFNGLLINEWIDTHXPROC)glewGetProcAddress((const GLubyte*)"glLineWidthx")) == NULL) || r; r = ((glLoadMatrixx = (PFNGLLOADMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glLoadMatrixx")) == NULL) || r; r = ((glMaterialx = (PFNGLMATERIALXPROC)glewGetProcAddress((const GLubyte*)"glMaterialx")) == NULL) || r; r = ((glMaterialxv = (PFNGLMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glMaterialxv")) == NULL) || r; r = ((glMultMatrixx = (PFNGLMULTMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glMultMatrixx")) == NULL) || r; r = ((glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4x")) == NULL) || r; r = ((glNormal3x = (PFNGLNORMAL3XPROC)glewGetProcAddress((const GLubyte*)"glNormal3x")) == NULL) || r; r = ((glOrthof = (PFNGLORTHOFPROC)glewGetProcAddress((const GLubyte*)"glOrthof")) == NULL) || r; r = ((glOrthox = (PFNGLORTHOXPROC)glewGetProcAddress((const GLubyte*)"glOrthox")) == NULL) || r; r = ((glPointSizex = (PFNGLPOINTSIZEXPROC)glewGetProcAddress((const GLubyte*)"glPointSizex")) == NULL) || r; r = ((glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetx")) == NULL) || r; r = ((glRotatex = (PFNGLROTATEXPROC)glewGetProcAddress((const GLubyte*)"glRotatex")) == NULL) || r; r = ((glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)glewGetProcAddress((const GLubyte*)"glSampleCoveragex")) == NULL) || r; r = ((glScalex = (PFNGLSCALEXPROC)glewGetProcAddress((const GLubyte*)"glScalex")) == NULL) || r; r = ((glTexEnvx = (PFNGLTEXENVXPROC)glewGetProcAddress((const GLubyte*)"glTexEnvx")) == NULL) || r; r = ((glTexEnvxv = (PFNGLTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glTexEnvxv")) == NULL) || r; r = ((glTexParameterx = (PFNGLTEXPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glTexParameterx")) == NULL) || r; r = ((glTranslatex = (PFNGLTRANSLATEXPROC)glewGetProcAddress((const GLubyte*)"glTranslatex")) == NULL) || r; return r; } #endif /* GL_REGAL_ES1_0_compatibility */ #ifdef GL_REGAL_ES1_1_compatibility static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glClipPlanef = (PFNGLCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glClipPlanef")) == NULL) || r; r = ((glClipPlanex = (PFNGLCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glClipPlanex")) == NULL) || r; r = ((glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanef")) == NULL) || r; r = ((glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanex")) == NULL) || r; r = ((glGetFixedv = (PFNGLGETFIXEDVPROC)glewGetProcAddress((const GLubyte*)"glGetFixedv")) == NULL) || r; r = ((glGetLightxv = (PFNGLGETLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glGetLightxv")) == NULL) || r; r = ((glGetMaterialxv = (PFNGLGETMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glGetMaterialxv")) == NULL) || r; r = ((glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexEnvxv")) == NULL) || r; r = ((glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterxv")) == NULL) || r; r = ((glPointParameterx = (PFNGLPOINTPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glPointParameterx")) == NULL) || r; r = ((glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterxv")) == NULL) || r; r = ((glPointSizePointerOES = (PFNGLPOINTSIZEPOINTEROESPROC)glewGetProcAddress((const GLubyte*)"glPointSizePointerOES")) == NULL) || r; r = ((glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterxv")) == NULL) || r; return r; } #endif /* GL_REGAL_ES1_1_compatibility */ #ifdef GL_REGAL_error_string static GLboolean _glewInit_GL_REGAL_error_string (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; return r; } #endif /* GL_REGAL_error_string */ #ifdef GL_REGAL_extension_query static GLboolean _glewInit_GL_REGAL_extension_query (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; return r; } #endif /* GL_REGAL_extension_query */ #ifdef GL_REGAL_log static GLboolean _glewInit_GL_REGAL_log (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glLogMessageCallbackREGAL = (PFNGLLOGMESSAGECALLBACKREGALPROC)glewGetProcAddress((const GLubyte*)"glLogMessageCallbackREGAL")) == NULL) || r; return r; } #endif /* GL_REGAL_log */ #ifdef GL_REGAL_proc_address static GLboolean _glewInit_GL_REGAL_proc_address (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetProcAddressREGAL = (PFNGLGETPROCADDRESSREGALPROC)glewGetProcAddress((const GLubyte*)"glGetProcAddressREGAL")) == NULL) || r; return r; } #endif /* GL_REGAL_proc_address */ #ifdef GL_SGIS_detail_texture static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; return r; } #endif /* GL_SGIS_detail_texture */ #ifdef GL_SGIS_fog_function static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; return r; } #endif /* GL_SGIS_fog_function */ #ifdef GL_SGIS_multisample static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; return r; } #endif /* GL_SGIS_multisample */ #ifdef GL_SGIS_sharpen_texture static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; return r; } #endif /* GL_SGIS_sharpen_texture */ #ifdef GL_SGIS_texture4D static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; return r; } #endif /* GL_SGIS_texture4D */ #ifdef GL_SGIS_texture_filter4 static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; return r; } #endif /* GL_SGIS_texture_filter4 */ #ifdef GL_SGIX_async static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_async */ #ifdef GL_SGIX_flush_raster static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_flush_raster */ #ifdef GL_SGIX_fog_texture static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_fog_texture */ #ifdef GL_SGIX_fragment_specular_lighting static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_fragment_specular_lighting */ #ifdef GL_SGIX_framezoom static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_framezoom */ #ifdef GL_SGIX_pixel_texture static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_pixel_texture */ #ifdef GL_SGIX_reference_plane static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_reference_plane */ #ifdef GL_SGIX_sprite static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_sprite */ #ifdef GL_SGIX_tag_sample_buffer static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; return r; } #endif /* GL_SGIX_tag_sample_buffer */ #ifdef GL_SGI_color_table static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; return r; } #endif /* GL_SGI_color_table */ #ifdef GL_SUNX_constant_data static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; return r; } #endif /* GL_SUNX_constant_data */ #ifdef GL_SUN_global_alpha static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; return r; } #endif /* GL_SUN_global_alpha */ #ifdef GL_SUN_read_video_pixels static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; return r; } #endif /* GL_SUN_read_video_pixels */ #ifdef GL_SUN_triangle_list static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; return r; } #endif /* GL_SUN_triangle_list */ #ifdef GL_SUN_vertex static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; return r; } #endif /* GL_SUN_vertex */ #ifdef GL_WIN_swap_hint static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; return r; } #endif /* GL_WIN_swap_hint */ /* ------------------------------------------------------------------------- */ GLboolean GLEWAPIENTRY glewGetExtension (const char* name) { const GLubyte* start; const GLubyte* end; start = (const GLubyte*)glGetString(GL_EXTENSIONS); if (start == 0) return GL_FALSE; end = start + _glewStrLen(start); return _glewSearchExtension(name, start, end); } /* ------------------------------------------------------------------------- */ #ifndef GLEW_MX static #endif GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) { const GLubyte* s; GLuint dot; GLint major, minor; const GLubyte* extStart; const GLubyte* extEnd; /* query opengl version */ s = glGetString(GL_VERSION); dot = _glewStrCLen(s, '.'); if (dot == 0) return GLEW_ERROR_NO_GL_VERSION; major = s[dot-1]-'0'; minor = s[dot+1]-'0'; if (minor < 0 || minor > 9) minor = 0; if (major<0 || major>9) return GLEW_ERROR_NO_GL_VERSION; if (major == 1 && minor == 0) { return GLEW_ERROR_GL_VERSION_10_ONLY; } else { GLEW_VERSION_4_5 = ( major > 4 ) || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_4_4 = GLEW_VERSION_4_5 == GL_TRUE || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_4_3 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_4_2 = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_4_1 = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_4_0 = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_3_3 = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_3_2 = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_3_1 = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_3_0 = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_2_1 = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_2_0 = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_1_5 = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_1_4 = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_1_3 = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_1_2_1 = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; GLEW_VERSION_1_2 = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; } /* query opengl extensions string */ extStart = glGetString(GL_EXTENSIONS); if (extStart == 0) extStart = (const GLubyte*)""; extEnd = extStart + _glewStrLen(extStart); /* initialize extensions */ #ifdef GL_VERSION_1_2 if (glewExperimental || GLEW_VERSION_1_2) GLEW_VERSION_1_2 = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_1_2 */ #ifdef GL_VERSION_1_2_1 #endif /* GL_VERSION_1_2_1 */ #ifdef GL_VERSION_1_3 if (glewExperimental || GLEW_VERSION_1_3) GLEW_VERSION_1_3 = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_1_3 */ #ifdef GL_VERSION_1_4 if (glewExperimental || GLEW_VERSION_1_4) GLEW_VERSION_1_4 = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_1_4 */ #ifdef GL_VERSION_1_5 if (glewExperimental || GLEW_VERSION_1_5) GLEW_VERSION_1_5 = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_1_5 */ #ifdef GL_VERSION_2_0 if (glewExperimental || GLEW_VERSION_2_0) GLEW_VERSION_2_0 = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_2_0 */ #ifdef GL_VERSION_2_1 if (glewExperimental || GLEW_VERSION_2_1) GLEW_VERSION_2_1 = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_2_1 */ #ifdef GL_VERSION_3_0 if (glewExperimental || GLEW_VERSION_3_0) GLEW_VERSION_3_0 = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_3_0 */ #ifdef GL_VERSION_3_1 if (glewExperimental || GLEW_VERSION_3_1) GLEW_VERSION_3_1 = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_3_1 */ #ifdef GL_VERSION_3_2 if (glewExperimental || GLEW_VERSION_3_2) GLEW_VERSION_3_2 = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_3_2 */ #ifdef GL_VERSION_3_3 if (glewExperimental || GLEW_VERSION_3_3) GLEW_VERSION_3_3 = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_3_3 */ #ifdef GL_VERSION_4_0 if (glewExperimental || GLEW_VERSION_4_0) GLEW_VERSION_4_0 = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_4_0 */ #ifdef GL_VERSION_4_1 #endif /* GL_VERSION_4_1 */ #ifdef GL_VERSION_4_2 #endif /* GL_VERSION_4_2 */ #ifdef GL_VERSION_4_3 #endif /* GL_VERSION_4_3 */ #ifdef GL_VERSION_4_4 #endif /* GL_VERSION_4_4 */ #ifdef GL_VERSION_4_5 if (glewExperimental || GLEW_VERSION_4_5) GLEW_VERSION_4_5 = !_glewInit_GL_VERSION_4_5(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_VERSION_4_5 */ #ifdef GL_3DFX_multisample GLEW_3DFX_multisample = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd); #endif /* GL_3DFX_multisample */ #ifdef GL_3DFX_tbuffer GLEW_3DFX_tbuffer = _glewSearchExtension("GL_3DFX_tbuffer", extStart, extEnd); if (glewExperimental || GLEW_3DFX_tbuffer) GLEW_3DFX_tbuffer = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_3DFX_tbuffer */ #ifdef GL_3DFX_texture_compression_FXT1 GLEW_3DFX_texture_compression_FXT1 = _glewSearchExtension("GL_3DFX_texture_compression_FXT1", extStart, extEnd); #endif /* GL_3DFX_texture_compression_FXT1 */ #ifdef GL_AMD_blend_minmax_factor GLEW_AMD_blend_minmax_factor = _glewSearchExtension("GL_AMD_blend_minmax_factor", extStart, extEnd); #endif /* GL_AMD_blend_minmax_factor */ #ifdef GL_AMD_conservative_depth GLEW_AMD_conservative_depth = _glewSearchExtension("GL_AMD_conservative_depth", extStart, extEnd); #endif /* GL_AMD_conservative_depth */ #ifdef GL_AMD_debug_output GLEW_AMD_debug_output = _glewSearchExtension("GL_AMD_debug_output", extStart, extEnd); if (glewExperimental || GLEW_AMD_debug_output) GLEW_AMD_debug_output = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_debug_output */ #ifdef GL_AMD_depth_clamp_separate GLEW_AMD_depth_clamp_separate = _glewSearchExtension("GL_AMD_depth_clamp_separate", extStart, extEnd); #endif /* GL_AMD_depth_clamp_separate */ #ifdef GL_AMD_draw_buffers_blend GLEW_AMD_draw_buffers_blend = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd); if (glewExperimental || GLEW_AMD_draw_buffers_blend) GLEW_AMD_draw_buffers_blend = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_draw_buffers_blend */ #ifdef GL_AMD_gcn_shader GLEW_AMD_gcn_shader = _glewSearchExtension("GL_AMD_gcn_shader", extStart, extEnd); #endif /* GL_AMD_gcn_shader */ #ifdef GL_AMD_gpu_shader_int64 GLEW_AMD_gpu_shader_int64 = _glewSearchExtension("GL_AMD_gpu_shader_int64", extStart, extEnd); #endif /* GL_AMD_gpu_shader_int64 */ #ifdef GL_AMD_interleaved_elements GLEW_AMD_interleaved_elements = _glewSearchExtension("GL_AMD_interleaved_elements", extStart, extEnd); if (glewExperimental || GLEW_AMD_interleaved_elements) GLEW_AMD_interleaved_elements = !_glewInit_GL_AMD_interleaved_elements(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_interleaved_elements */ #ifdef GL_AMD_multi_draw_indirect GLEW_AMD_multi_draw_indirect = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd); if (glewExperimental || GLEW_AMD_multi_draw_indirect) GLEW_AMD_multi_draw_indirect = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_multi_draw_indirect */ #ifdef GL_AMD_name_gen_delete GLEW_AMD_name_gen_delete = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd); if (glewExperimental || GLEW_AMD_name_gen_delete) GLEW_AMD_name_gen_delete = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_name_gen_delete */ #ifdef GL_AMD_occlusion_query_event GLEW_AMD_occlusion_query_event = _glewSearchExtension("GL_AMD_occlusion_query_event", extStart, extEnd); if (glewExperimental || GLEW_AMD_occlusion_query_event) GLEW_AMD_occlusion_query_event = !_glewInit_GL_AMD_occlusion_query_event(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_occlusion_query_event */ #ifdef GL_AMD_performance_monitor GLEW_AMD_performance_monitor = _glewSearchExtension("GL_AMD_performance_monitor", extStart, extEnd); if (glewExperimental || GLEW_AMD_performance_monitor) GLEW_AMD_performance_monitor = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_performance_monitor */ #ifdef GL_AMD_pinned_memory GLEW_AMD_pinned_memory = _glewSearchExtension("GL_AMD_pinned_memory", extStart, extEnd); #endif /* GL_AMD_pinned_memory */ #ifdef GL_AMD_query_buffer_object GLEW_AMD_query_buffer_object = _glewSearchExtension("GL_AMD_query_buffer_object", extStart, extEnd); #endif /* GL_AMD_query_buffer_object */ #ifdef GL_AMD_sample_positions GLEW_AMD_sample_positions = _glewSearchExtension("GL_AMD_sample_positions", extStart, extEnd); if (glewExperimental || GLEW_AMD_sample_positions) GLEW_AMD_sample_positions = !_glewInit_GL_AMD_sample_positions(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_sample_positions */ #ifdef GL_AMD_seamless_cubemap_per_texture GLEW_AMD_seamless_cubemap_per_texture = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd); #endif /* GL_AMD_seamless_cubemap_per_texture */ #ifdef GL_AMD_shader_atomic_counter_ops GLEW_AMD_shader_atomic_counter_ops = _glewSearchExtension("GL_AMD_shader_atomic_counter_ops", extStart, extEnd); #endif /* GL_AMD_shader_atomic_counter_ops */ #ifdef GL_AMD_shader_stencil_export GLEW_AMD_shader_stencil_export = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd); #endif /* GL_AMD_shader_stencil_export */ #ifdef GL_AMD_shader_stencil_value_export GLEW_AMD_shader_stencil_value_export = _glewSearchExtension("GL_AMD_shader_stencil_value_export", extStart, extEnd); #endif /* GL_AMD_shader_stencil_value_export */ #ifdef GL_AMD_shader_trinary_minmax GLEW_AMD_shader_trinary_minmax = _glewSearchExtension("GL_AMD_shader_trinary_minmax", extStart, extEnd); #endif /* GL_AMD_shader_trinary_minmax */ #ifdef GL_AMD_sparse_texture GLEW_AMD_sparse_texture = _glewSearchExtension("GL_AMD_sparse_texture", extStart, extEnd); if (glewExperimental || GLEW_AMD_sparse_texture) GLEW_AMD_sparse_texture = !_glewInit_GL_AMD_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_sparse_texture */ #ifdef GL_AMD_stencil_operation_extended GLEW_AMD_stencil_operation_extended = _glewSearchExtension("GL_AMD_stencil_operation_extended", extStart, extEnd); if (glewExperimental || GLEW_AMD_stencil_operation_extended) GLEW_AMD_stencil_operation_extended = !_glewInit_GL_AMD_stencil_operation_extended(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_stencil_operation_extended */ #ifdef GL_AMD_texture_texture4 GLEW_AMD_texture_texture4 = _glewSearchExtension("GL_AMD_texture_texture4", extStart, extEnd); #endif /* GL_AMD_texture_texture4 */ #ifdef GL_AMD_transform_feedback3_lines_triangles GLEW_AMD_transform_feedback3_lines_triangles = _glewSearchExtension("GL_AMD_transform_feedback3_lines_triangles", extStart, extEnd); #endif /* GL_AMD_transform_feedback3_lines_triangles */ #ifdef GL_AMD_transform_feedback4 GLEW_AMD_transform_feedback4 = _glewSearchExtension("GL_AMD_transform_feedback4", extStart, extEnd); #endif /* GL_AMD_transform_feedback4 */ #ifdef GL_AMD_vertex_shader_layer GLEW_AMD_vertex_shader_layer = _glewSearchExtension("GL_AMD_vertex_shader_layer", extStart, extEnd); #endif /* GL_AMD_vertex_shader_layer */ #ifdef GL_AMD_vertex_shader_tessellator GLEW_AMD_vertex_shader_tessellator = _glewSearchExtension("GL_AMD_vertex_shader_tessellator", extStart, extEnd); if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) GLEW_AMD_vertex_shader_tessellator = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_AMD_vertex_shader_tessellator */ #ifdef GL_AMD_vertex_shader_viewport_index GLEW_AMD_vertex_shader_viewport_index = _glewSearchExtension("GL_AMD_vertex_shader_viewport_index", extStart, extEnd); #endif /* GL_AMD_vertex_shader_viewport_index */ #ifdef GL_ANGLE_depth_texture GLEW_ANGLE_depth_texture = _glewSearchExtension("GL_ANGLE_depth_texture", extStart, extEnd); #endif /* GL_ANGLE_depth_texture */ #ifdef GL_ANGLE_framebuffer_blit GLEW_ANGLE_framebuffer_blit = _glewSearchExtension("GL_ANGLE_framebuffer_blit", extStart, extEnd); if (glewExperimental || GLEW_ANGLE_framebuffer_blit) GLEW_ANGLE_framebuffer_blit = !_glewInit_GL_ANGLE_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ANGLE_framebuffer_blit */ #ifdef GL_ANGLE_framebuffer_multisample GLEW_ANGLE_framebuffer_multisample = _glewSearchExtension("GL_ANGLE_framebuffer_multisample", extStart, extEnd); if (glewExperimental || GLEW_ANGLE_framebuffer_multisample) GLEW_ANGLE_framebuffer_multisample = !_glewInit_GL_ANGLE_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ANGLE_framebuffer_multisample */ #ifdef GL_ANGLE_instanced_arrays GLEW_ANGLE_instanced_arrays = _glewSearchExtension("GL_ANGLE_instanced_arrays", extStart, extEnd); if (glewExperimental || GLEW_ANGLE_instanced_arrays) GLEW_ANGLE_instanced_arrays = !_glewInit_GL_ANGLE_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ANGLE_instanced_arrays */ #ifdef GL_ANGLE_pack_reverse_row_order GLEW_ANGLE_pack_reverse_row_order = _glewSearchExtension("GL_ANGLE_pack_reverse_row_order", extStart, extEnd); #endif /* GL_ANGLE_pack_reverse_row_order */ #ifdef GL_ANGLE_program_binary GLEW_ANGLE_program_binary = _glewSearchExtension("GL_ANGLE_program_binary", extStart, extEnd); #endif /* GL_ANGLE_program_binary */ #ifdef GL_ANGLE_texture_compression_dxt1 GLEW_ANGLE_texture_compression_dxt1 = _glewSearchExtension("GL_ANGLE_texture_compression_dxt1", extStart, extEnd); #endif /* GL_ANGLE_texture_compression_dxt1 */ #ifdef GL_ANGLE_texture_compression_dxt3 GLEW_ANGLE_texture_compression_dxt3 = _glewSearchExtension("GL_ANGLE_texture_compression_dxt3", extStart, extEnd); #endif /* GL_ANGLE_texture_compression_dxt3 */ #ifdef GL_ANGLE_texture_compression_dxt5 GLEW_ANGLE_texture_compression_dxt5 = _glewSearchExtension("GL_ANGLE_texture_compression_dxt5", extStart, extEnd); #endif /* GL_ANGLE_texture_compression_dxt5 */ #ifdef GL_ANGLE_texture_usage GLEW_ANGLE_texture_usage = _glewSearchExtension("GL_ANGLE_texture_usage", extStart, extEnd); #endif /* GL_ANGLE_texture_usage */ #ifdef GL_ANGLE_timer_query GLEW_ANGLE_timer_query = _glewSearchExtension("GL_ANGLE_timer_query", extStart, extEnd); if (glewExperimental || GLEW_ANGLE_timer_query) GLEW_ANGLE_timer_query = !_glewInit_GL_ANGLE_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ANGLE_timer_query */ #ifdef GL_ANGLE_translated_shader_source GLEW_ANGLE_translated_shader_source = _glewSearchExtension("GL_ANGLE_translated_shader_source", extStart, extEnd); if (glewExperimental || GLEW_ANGLE_translated_shader_source) GLEW_ANGLE_translated_shader_source = !_glewInit_GL_ANGLE_translated_shader_source(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ANGLE_translated_shader_source */ #ifdef GL_APPLE_aux_depth_stencil GLEW_APPLE_aux_depth_stencil = _glewSearchExtension("GL_APPLE_aux_depth_stencil", extStart, extEnd); #endif /* GL_APPLE_aux_depth_stencil */ #ifdef GL_APPLE_client_storage GLEW_APPLE_client_storage = _glewSearchExtension("GL_APPLE_client_storage", extStart, extEnd); #endif /* GL_APPLE_client_storage */ #ifdef GL_APPLE_element_array GLEW_APPLE_element_array = _glewSearchExtension("GL_APPLE_element_array", extStart, extEnd); if (glewExperimental || GLEW_APPLE_element_array) GLEW_APPLE_element_array = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_element_array */ #ifdef GL_APPLE_fence GLEW_APPLE_fence = _glewSearchExtension("GL_APPLE_fence", extStart, extEnd); if (glewExperimental || GLEW_APPLE_fence) GLEW_APPLE_fence = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_fence */ #ifdef GL_APPLE_float_pixels GLEW_APPLE_float_pixels = _glewSearchExtension("GL_APPLE_float_pixels", extStart, extEnd); #endif /* GL_APPLE_float_pixels */ #ifdef GL_APPLE_flush_buffer_range GLEW_APPLE_flush_buffer_range = _glewSearchExtension("GL_APPLE_flush_buffer_range", extStart, extEnd); if (glewExperimental || GLEW_APPLE_flush_buffer_range) GLEW_APPLE_flush_buffer_range = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_flush_buffer_range */ #ifdef GL_APPLE_object_purgeable GLEW_APPLE_object_purgeable = _glewSearchExtension("GL_APPLE_object_purgeable", extStart, extEnd); if (glewExperimental || GLEW_APPLE_object_purgeable) GLEW_APPLE_object_purgeable = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_object_purgeable */ #ifdef GL_APPLE_pixel_buffer GLEW_APPLE_pixel_buffer = _glewSearchExtension("GL_APPLE_pixel_buffer", extStart, extEnd); #endif /* GL_APPLE_pixel_buffer */ #ifdef GL_APPLE_rgb_422 GLEW_APPLE_rgb_422 = _glewSearchExtension("GL_APPLE_rgb_422", extStart, extEnd); #endif /* GL_APPLE_rgb_422 */ #ifdef GL_APPLE_row_bytes GLEW_APPLE_row_bytes = _glewSearchExtension("GL_APPLE_row_bytes", extStart, extEnd); #endif /* GL_APPLE_row_bytes */ #ifdef GL_APPLE_specular_vector GLEW_APPLE_specular_vector = _glewSearchExtension("GL_APPLE_specular_vector", extStart, extEnd); #endif /* GL_APPLE_specular_vector */ #ifdef GL_APPLE_texture_range GLEW_APPLE_texture_range = _glewSearchExtension("GL_APPLE_texture_range", extStart, extEnd); if (glewExperimental || GLEW_APPLE_texture_range) GLEW_APPLE_texture_range = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_texture_range */ #ifdef GL_APPLE_transform_hint GLEW_APPLE_transform_hint = _glewSearchExtension("GL_APPLE_transform_hint", extStart, extEnd); #endif /* GL_APPLE_transform_hint */ #ifdef GL_APPLE_vertex_array_object GLEW_APPLE_vertex_array_object = _glewSearchExtension("GL_APPLE_vertex_array_object", extStart, extEnd); if (glewExperimental || GLEW_APPLE_vertex_array_object) GLEW_APPLE_vertex_array_object = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_vertex_array_object */ #ifdef GL_APPLE_vertex_array_range GLEW_APPLE_vertex_array_range = _glewSearchExtension("GL_APPLE_vertex_array_range", extStart, extEnd); if (glewExperimental || GLEW_APPLE_vertex_array_range) GLEW_APPLE_vertex_array_range = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_vertex_array_range */ #ifdef GL_APPLE_vertex_program_evaluators GLEW_APPLE_vertex_program_evaluators = _glewSearchExtension("GL_APPLE_vertex_program_evaluators", extStart, extEnd); if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) GLEW_APPLE_vertex_program_evaluators = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_APPLE_vertex_program_evaluators */ #ifdef GL_APPLE_ycbcr_422 GLEW_APPLE_ycbcr_422 = _glewSearchExtension("GL_APPLE_ycbcr_422", extStart, extEnd); #endif /* GL_APPLE_ycbcr_422 */ #ifdef GL_ARB_ES2_compatibility GLEW_ARB_ES2_compatibility = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd); if (glewExperimental || GLEW_ARB_ES2_compatibility) GLEW_ARB_ES2_compatibility = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_ES2_compatibility */ #ifdef GL_ARB_ES3_1_compatibility GLEW_ARB_ES3_1_compatibility = _glewSearchExtension("GL_ARB_ES3_1_compatibility", extStart, extEnd); if (glewExperimental || GLEW_ARB_ES3_1_compatibility) GLEW_ARB_ES3_1_compatibility = !_glewInit_GL_ARB_ES3_1_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_ES3_1_compatibility */ #ifdef GL_ARB_ES3_2_compatibility GLEW_ARB_ES3_2_compatibility = _glewSearchExtension("GL_ARB_ES3_2_compatibility", extStart, extEnd); if (glewExperimental || GLEW_ARB_ES3_2_compatibility) GLEW_ARB_ES3_2_compatibility = !_glewInit_GL_ARB_ES3_2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_ES3_2_compatibility */ #ifdef GL_ARB_ES3_compatibility GLEW_ARB_ES3_compatibility = _glewSearchExtension("GL_ARB_ES3_compatibility", extStart, extEnd); #endif /* GL_ARB_ES3_compatibility */ #ifdef GL_ARB_arrays_of_arrays GLEW_ARB_arrays_of_arrays = _glewSearchExtension("GL_ARB_arrays_of_arrays", extStart, extEnd); #endif /* GL_ARB_arrays_of_arrays */ #ifdef GL_ARB_base_instance GLEW_ARB_base_instance = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd); if (glewExperimental || GLEW_ARB_base_instance) GLEW_ARB_base_instance = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_base_instance */ #ifdef GL_ARB_bindless_texture GLEW_ARB_bindless_texture = _glewSearchExtension("GL_ARB_bindless_texture", extStart, extEnd); if (glewExperimental || GLEW_ARB_bindless_texture) GLEW_ARB_bindless_texture = !_glewInit_GL_ARB_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_bindless_texture */ #ifdef GL_ARB_blend_func_extended GLEW_ARB_blend_func_extended = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd); if (glewExperimental || GLEW_ARB_blend_func_extended) GLEW_ARB_blend_func_extended = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_blend_func_extended */ #ifdef GL_ARB_buffer_storage GLEW_ARB_buffer_storage = _glewSearchExtension("GL_ARB_buffer_storage", extStart, extEnd); if (glewExperimental || GLEW_ARB_buffer_storage) GLEW_ARB_buffer_storage = !_glewInit_GL_ARB_buffer_storage(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_buffer_storage */ #ifdef GL_ARB_cl_event GLEW_ARB_cl_event = _glewSearchExtension("GL_ARB_cl_event", extStart, extEnd); if (glewExperimental || GLEW_ARB_cl_event) GLEW_ARB_cl_event = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_cl_event */ #ifdef GL_ARB_clear_buffer_object GLEW_ARB_clear_buffer_object = _glewSearchExtension("GL_ARB_clear_buffer_object", extStart, extEnd); if (glewExperimental || GLEW_ARB_clear_buffer_object) GLEW_ARB_clear_buffer_object = !_glewInit_GL_ARB_clear_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_clear_buffer_object */ #ifdef GL_ARB_clear_texture GLEW_ARB_clear_texture = _glewSearchExtension("GL_ARB_clear_texture", extStart, extEnd); if (glewExperimental || GLEW_ARB_clear_texture) GLEW_ARB_clear_texture = !_glewInit_GL_ARB_clear_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_clear_texture */ #ifdef GL_ARB_clip_control GLEW_ARB_clip_control = _glewSearchExtension("GL_ARB_clip_control", extStart, extEnd); if (glewExperimental || GLEW_ARB_clip_control) GLEW_ARB_clip_control = !_glewInit_GL_ARB_clip_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_clip_control */ #ifdef GL_ARB_color_buffer_float GLEW_ARB_color_buffer_float = _glewSearchExtension("GL_ARB_color_buffer_float", extStart, extEnd); if (glewExperimental || GLEW_ARB_color_buffer_float) GLEW_ARB_color_buffer_float = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_color_buffer_float */ #ifdef GL_ARB_compatibility GLEW_ARB_compatibility = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd); #endif /* GL_ARB_compatibility */ #ifdef GL_ARB_compressed_texture_pixel_storage GLEW_ARB_compressed_texture_pixel_storage = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd); #endif /* GL_ARB_compressed_texture_pixel_storage */ #ifdef GL_ARB_compute_shader GLEW_ARB_compute_shader = _glewSearchExtension("GL_ARB_compute_shader", extStart, extEnd); if (glewExperimental || GLEW_ARB_compute_shader) GLEW_ARB_compute_shader = !_glewInit_GL_ARB_compute_shader(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_compute_shader */ #ifdef GL_ARB_compute_variable_group_size GLEW_ARB_compute_variable_group_size = _glewSearchExtension("GL_ARB_compute_variable_group_size", extStart, extEnd); if (glewExperimental || GLEW_ARB_compute_variable_group_size) GLEW_ARB_compute_variable_group_size = !_glewInit_GL_ARB_compute_variable_group_size(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_compute_variable_group_size */ #ifdef GL_ARB_conditional_render_inverted GLEW_ARB_conditional_render_inverted = _glewSearchExtension("GL_ARB_conditional_render_inverted", extStart, extEnd); #endif /* GL_ARB_conditional_render_inverted */ #ifdef GL_ARB_conservative_depth GLEW_ARB_conservative_depth = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd); #endif /* GL_ARB_conservative_depth */ #ifdef GL_ARB_copy_buffer GLEW_ARB_copy_buffer = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd); if (glewExperimental || GLEW_ARB_copy_buffer) GLEW_ARB_copy_buffer = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_copy_buffer */ #ifdef GL_ARB_copy_image GLEW_ARB_copy_image = _glewSearchExtension("GL_ARB_copy_image", extStart, extEnd); if (glewExperimental || GLEW_ARB_copy_image) GLEW_ARB_copy_image = !_glewInit_GL_ARB_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_copy_image */ #ifdef GL_ARB_cull_distance GLEW_ARB_cull_distance = _glewSearchExtension("GL_ARB_cull_distance", extStart, extEnd); #endif /* GL_ARB_cull_distance */ #ifdef GL_ARB_debug_output GLEW_ARB_debug_output = _glewSearchExtension("GL_ARB_debug_output", extStart, extEnd); if (glewExperimental || GLEW_ARB_debug_output) GLEW_ARB_debug_output = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_debug_output */ #ifdef GL_ARB_depth_buffer_float GLEW_ARB_depth_buffer_float = _glewSearchExtension("GL_ARB_depth_buffer_float", extStart, extEnd); #endif /* GL_ARB_depth_buffer_float */ #ifdef GL_ARB_depth_clamp GLEW_ARB_depth_clamp = _glewSearchExtension("GL_ARB_depth_clamp", extStart, extEnd); #endif /* GL_ARB_depth_clamp */ #ifdef GL_ARB_depth_texture GLEW_ARB_depth_texture = _glewSearchExtension("GL_ARB_depth_texture", extStart, extEnd); #endif /* GL_ARB_depth_texture */ #ifdef GL_ARB_derivative_control GLEW_ARB_derivative_control = _glewSearchExtension("GL_ARB_derivative_control", extStart, extEnd); #endif /* GL_ARB_derivative_control */ #ifdef GL_ARB_direct_state_access GLEW_ARB_direct_state_access = _glewSearchExtension("GL_ARB_direct_state_access", extStart, extEnd); if (glewExperimental || GLEW_ARB_direct_state_access) GLEW_ARB_direct_state_access = !_glewInit_GL_ARB_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_direct_state_access */ #ifdef GL_ARB_draw_buffers GLEW_ARB_draw_buffers = _glewSearchExtension("GL_ARB_draw_buffers", extStart, extEnd); if (glewExperimental || GLEW_ARB_draw_buffers) GLEW_ARB_draw_buffers = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_draw_buffers */ #ifdef GL_ARB_draw_buffers_blend GLEW_ARB_draw_buffers_blend = _glewSearchExtension("GL_ARB_draw_buffers_blend", extStart, extEnd); if (glewExperimental || GLEW_ARB_draw_buffers_blend) GLEW_ARB_draw_buffers_blend = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_draw_buffers_blend */ #ifdef GL_ARB_draw_elements_base_vertex GLEW_ARB_draw_elements_base_vertex = _glewSearchExtension("GL_ARB_draw_elements_base_vertex", extStart, extEnd); if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) GLEW_ARB_draw_elements_base_vertex = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_draw_elements_base_vertex */ #ifdef GL_ARB_draw_indirect GLEW_ARB_draw_indirect = _glewSearchExtension("GL_ARB_draw_indirect", extStart, extEnd); if (glewExperimental || GLEW_ARB_draw_indirect) GLEW_ARB_draw_indirect = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_draw_indirect */ #ifdef GL_ARB_draw_instanced GLEW_ARB_draw_instanced = _glewSearchExtension("GL_ARB_draw_instanced", extStart, extEnd); #endif /* GL_ARB_draw_instanced */ #ifdef GL_ARB_enhanced_layouts GLEW_ARB_enhanced_layouts = _glewSearchExtension("GL_ARB_enhanced_layouts", extStart, extEnd); #endif /* GL_ARB_enhanced_layouts */ #ifdef GL_ARB_explicit_attrib_location GLEW_ARB_explicit_attrib_location = _glewSearchExtension("GL_ARB_explicit_attrib_location", extStart, extEnd); #endif /* GL_ARB_explicit_attrib_location */ #ifdef GL_ARB_explicit_uniform_location GLEW_ARB_explicit_uniform_location = _glewSearchExtension("GL_ARB_explicit_uniform_location", extStart, extEnd); #endif /* GL_ARB_explicit_uniform_location */ #ifdef GL_ARB_fragment_coord_conventions GLEW_ARB_fragment_coord_conventions = _glewSearchExtension("GL_ARB_fragment_coord_conventions", extStart, extEnd); #endif /* GL_ARB_fragment_coord_conventions */ #ifdef GL_ARB_fragment_layer_viewport GLEW_ARB_fragment_layer_viewport = _glewSearchExtension("GL_ARB_fragment_layer_viewport", extStart, extEnd); #endif /* GL_ARB_fragment_layer_viewport */ #ifdef GL_ARB_fragment_program GLEW_ARB_fragment_program = _glewSearchExtension("GL_ARB_fragment_program", extStart, extEnd); #endif /* GL_ARB_fragment_program */ #ifdef GL_ARB_fragment_program_shadow GLEW_ARB_fragment_program_shadow = _glewSearchExtension("GL_ARB_fragment_program_shadow", extStart, extEnd); #endif /* GL_ARB_fragment_program_shadow */ #ifdef GL_ARB_fragment_shader GLEW_ARB_fragment_shader = _glewSearchExtension("GL_ARB_fragment_shader", extStart, extEnd); #endif /* GL_ARB_fragment_shader */ #ifdef GL_ARB_fragment_shader_interlock GLEW_ARB_fragment_shader_interlock = _glewSearchExtension("GL_ARB_fragment_shader_interlock", extStart, extEnd); #endif /* GL_ARB_fragment_shader_interlock */ #ifdef GL_ARB_framebuffer_no_attachments GLEW_ARB_framebuffer_no_attachments = _glewSearchExtension("GL_ARB_framebuffer_no_attachments", extStart, extEnd); if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) GLEW_ARB_framebuffer_no_attachments = !_glewInit_GL_ARB_framebuffer_no_attachments(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_framebuffer_no_attachments */ #ifdef GL_ARB_framebuffer_object GLEW_ARB_framebuffer_object = _glewSearchExtension("GL_ARB_framebuffer_object", extStart, extEnd); if (glewExperimental || GLEW_ARB_framebuffer_object) GLEW_ARB_framebuffer_object = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_framebuffer_object */ #ifdef GL_ARB_framebuffer_sRGB GLEW_ARB_framebuffer_sRGB = _glewSearchExtension("GL_ARB_framebuffer_sRGB", extStart, extEnd); #endif /* GL_ARB_framebuffer_sRGB */ #ifdef GL_ARB_geometry_shader4 GLEW_ARB_geometry_shader4 = _glewSearchExtension("GL_ARB_geometry_shader4", extStart, extEnd); if (glewExperimental || GLEW_ARB_geometry_shader4) GLEW_ARB_geometry_shader4 = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_geometry_shader4 */ #ifdef GL_ARB_get_program_binary GLEW_ARB_get_program_binary = _glewSearchExtension("GL_ARB_get_program_binary", extStart, extEnd); if (glewExperimental || GLEW_ARB_get_program_binary) GLEW_ARB_get_program_binary = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_get_program_binary */ #ifdef GL_ARB_get_texture_sub_image GLEW_ARB_get_texture_sub_image = _glewSearchExtension("GL_ARB_get_texture_sub_image", extStart, extEnd); if (glewExperimental || GLEW_ARB_get_texture_sub_image) GLEW_ARB_get_texture_sub_image = !_glewInit_GL_ARB_get_texture_sub_image(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_get_texture_sub_image */ #ifdef GL_ARB_gpu_shader5 GLEW_ARB_gpu_shader5 = _glewSearchExtension("GL_ARB_gpu_shader5", extStart, extEnd); #endif /* GL_ARB_gpu_shader5 */ #ifdef GL_ARB_gpu_shader_fp64 GLEW_ARB_gpu_shader_fp64 = _glewSearchExtension("GL_ARB_gpu_shader_fp64", extStart, extEnd); if (glewExperimental || GLEW_ARB_gpu_shader_fp64) GLEW_ARB_gpu_shader_fp64 = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_gpu_shader_fp64 */ #ifdef GL_ARB_gpu_shader_int64 GLEW_ARB_gpu_shader_int64 = _glewSearchExtension("GL_ARB_gpu_shader_int64", extStart, extEnd); if (glewExperimental || GLEW_ARB_gpu_shader_int64) GLEW_ARB_gpu_shader_int64 = !_glewInit_GL_ARB_gpu_shader_int64(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_gpu_shader_int64 */ #ifdef GL_ARB_half_float_pixel GLEW_ARB_half_float_pixel = _glewSearchExtension("GL_ARB_half_float_pixel", extStart, extEnd); #endif /* GL_ARB_half_float_pixel */ #ifdef GL_ARB_half_float_vertex GLEW_ARB_half_float_vertex = _glewSearchExtension("GL_ARB_half_float_vertex", extStart, extEnd); #endif /* GL_ARB_half_float_vertex */ #ifdef GL_ARB_imaging GLEW_ARB_imaging = _glewSearchExtension("GL_ARB_imaging", extStart, extEnd); if (glewExperimental || GLEW_ARB_imaging) GLEW_ARB_imaging = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_imaging */ #ifdef GL_ARB_indirect_parameters GLEW_ARB_indirect_parameters = _glewSearchExtension("GL_ARB_indirect_parameters", extStart, extEnd); if (glewExperimental || GLEW_ARB_indirect_parameters) GLEW_ARB_indirect_parameters = !_glewInit_GL_ARB_indirect_parameters(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_indirect_parameters */ #ifdef GL_ARB_instanced_arrays GLEW_ARB_instanced_arrays = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd); if (glewExperimental || GLEW_ARB_instanced_arrays) GLEW_ARB_instanced_arrays = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_instanced_arrays */ #ifdef GL_ARB_internalformat_query GLEW_ARB_internalformat_query = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd); if (glewExperimental || GLEW_ARB_internalformat_query) GLEW_ARB_internalformat_query = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_internalformat_query */ #ifdef GL_ARB_internalformat_query2 GLEW_ARB_internalformat_query2 = _glewSearchExtension("GL_ARB_internalformat_query2", extStart, extEnd); if (glewExperimental || GLEW_ARB_internalformat_query2) GLEW_ARB_internalformat_query2 = !_glewInit_GL_ARB_internalformat_query2(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_internalformat_query2 */ #ifdef GL_ARB_invalidate_subdata GLEW_ARB_invalidate_subdata = _glewSearchExtension("GL_ARB_invalidate_subdata", extStart, extEnd); if (glewExperimental || GLEW_ARB_invalidate_subdata) GLEW_ARB_invalidate_subdata = !_glewInit_GL_ARB_invalidate_subdata(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_invalidate_subdata */ #ifdef GL_ARB_map_buffer_alignment GLEW_ARB_map_buffer_alignment = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd); #endif /* GL_ARB_map_buffer_alignment */ #ifdef GL_ARB_map_buffer_range GLEW_ARB_map_buffer_range = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd); if (glewExperimental || GLEW_ARB_map_buffer_range) GLEW_ARB_map_buffer_range = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_map_buffer_range */ #ifdef GL_ARB_matrix_palette GLEW_ARB_matrix_palette = _glewSearchExtension("GL_ARB_matrix_palette", extStart, extEnd); if (glewExperimental || GLEW_ARB_matrix_palette) GLEW_ARB_matrix_palette = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_matrix_palette */ #ifdef GL_ARB_multi_bind GLEW_ARB_multi_bind = _glewSearchExtension("GL_ARB_multi_bind", extStart, extEnd); if (glewExperimental || GLEW_ARB_multi_bind) GLEW_ARB_multi_bind = !_glewInit_GL_ARB_multi_bind(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_multi_bind */ #ifdef GL_ARB_multi_draw_indirect GLEW_ARB_multi_draw_indirect = _glewSearchExtension("GL_ARB_multi_draw_indirect", extStart, extEnd); if (glewExperimental || GLEW_ARB_multi_draw_indirect) GLEW_ARB_multi_draw_indirect = !_glewInit_GL_ARB_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_multi_draw_indirect */ #ifdef GL_ARB_multisample GLEW_ARB_multisample = _glewSearchExtension("GL_ARB_multisample", extStart, extEnd); if (glewExperimental || GLEW_ARB_multisample) GLEW_ARB_multisample = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_multisample */ #ifdef GL_ARB_multitexture GLEW_ARB_multitexture = _glewSearchExtension("GL_ARB_multitexture", extStart, extEnd); if (glewExperimental || GLEW_ARB_multitexture) GLEW_ARB_multitexture = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_multitexture */ #ifdef GL_ARB_occlusion_query GLEW_ARB_occlusion_query = _glewSearchExtension("GL_ARB_occlusion_query", extStart, extEnd); if (glewExperimental || GLEW_ARB_occlusion_query) GLEW_ARB_occlusion_query = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_occlusion_query */ #ifdef GL_ARB_occlusion_query2 GLEW_ARB_occlusion_query2 = _glewSearchExtension("GL_ARB_occlusion_query2", extStart, extEnd); #endif /* GL_ARB_occlusion_query2 */ #ifdef GL_ARB_parallel_shader_compile GLEW_ARB_parallel_shader_compile = _glewSearchExtension("GL_ARB_parallel_shader_compile", extStart, extEnd); if (glewExperimental || GLEW_ARB_parallel_shader_compile) GLEW_ARB_parallel_shader_compile = !_glewInit_GL_ARB_parallel_shader_compile(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_parallel_shader_compile */ #ifdef GL_ARB_pipeline_statistics_query GLEW_ARB_pipeline_statistics_query = _glewSearchExtension("GL_ARB_pipeline_statistics_query", extStart, extEnd); #endif /* GL_ARB_pipeline_statistics_query */ #ifdef GL_ARB_pixel_buffer_object GLEW_ARB_pixel_buffer_object = _glewSearchExtension("GL_ARB_pixel_buffer_object", extStart, extEnd); #endif /* GL_ARB_pixel_buffer_object */ #ifdef GL_ARB_point_parameters GLEW_ARB_point_parameters = _glewSearchExtension("GL_ARB_point_parameters", extStart, extEnd); if (glewExperimental || GLEW_ARB_point_parameters) GLEW_ARB_point_parameters = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_point_parameters */ #ifdef GL_ARB_point_sprite GLEW_ARB_point_sprite = _glewSearchExtension("GL_ARB_point_sprite", extStart, extEnd); #endif /* GL_ARB_point_sprite */ #ifdef GL_ARB_post_depth_coverage GLEW_ARB_post_depth_coverage = _glewSearchExtension("GL_ARB_post_depth_coverage", extStart, extEnd); #endif /* GL_ARB_post_depth_coverage */ #ifdef GL_ARB_program_interface_query GLEW_ARB_program_interface_query = _glewSearchExtension("GL_ARB_program_interface_query", extStart, extEnd); if (glewExperimental || GLEW_ARB_program_interface_query) GLEW_ARB_program_interface_query = !_glewInit_GL_ARB_program_interface_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_program_interface_query */ #ifdef GL_ARB_provoking_vertex GLEW_ARB_provoking_vertex = _glewSearchExtension("GL_ARB_provoking_vertex", extStart, extEnd); if (glewExperimental || GLEW_ARB_provoking_vertex) GLEW_ARB_provoking_vertex = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_provoking_vertex */ #ifdef GL_ARB_query_buffer_object GLEW_ARB_query_buffer_object = _glewSearchExtension("GL_ARB_query_buffer_object", extStart, extEnd); #endif /* GL_ARB_query_buffer_object */ #ifdef GL_ARB_robust_buffer_access_behavior GLEW_ARB_robust_buffer_access_behavior = _glewSearchExtension("GL_ARB_robust_buffer_access_behavior", extStart, extEnd); #endif /* GL_ARB_robust_buffer_access_behavior */ #ifdef GL_ARB_robustness GLEW_ARB_robustness = _glewSearchExtension("GL_ARB_robustness", extStart, extEnd); if (glewExperimental || GLEW_ARB_robustness) GLEW_ARB_robustness = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_robustness */ #ifdef GL_ARB_robustness_application_isolation GLEW_ARB_robustness_application_isolation = _glewSearchExtension("GL_ARB_robustness_application_isolation", extStart, extEnd); #endif /* GL_ARB_robustness_application_isolation */ #ifdef GL_ARB_robustness_share_group_isolation GLEW_ARB_robustness_share_group_isolation = _glewSearchExtension("GL_ARB_robustness_share_group_isolation", extStart, extEnd); #endif /* GL_ARB_robustness_share_group_isolation */ #ifdef GL_ARB_sample_locations GLEW_ARB_sample_locations = _glewSearchExtension("GL_ARB_sample_locations", extStart, extEnd); if (glewExperimental || GLEW_ARB_sample_locations) GLEW_ARB_sample_locations = !_glewInit_GL_ARB_sample_locations(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_sample_locations */ #ifdef GL_ARB_sample_shading GLEW_ARB_sample_shading = _glewSearchExtension("GL_ARB_sample_shading", extStart, extEnd); if (glewExperimental || GLEW_ARB_sample_shading) GLEW_ARB_sample_shading = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_sample_shading */ #ifdef GL_ARB_sampler_objects GLEW_ARB_sampler_objects = _glewSearchExtension("GL_ARB_sampler_objects", extStart, extEnd); if (glewExperimental || GLEW_ARB_sampler_objects) GLEW_ARB_sampler_objects = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_sampler_objects */ #ifdef GL_ARB_seamless_cube_map GLEW_ARB_seamless_cube_map = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd); #endif /* GL_ARB_seamless_cube_map */ #ifdef GL_ARB_seamless_cubemap_per_texture GLEW_ARB_seamless_cubemap_per_texture = _glewSearchExtension("GL_ARB_seamless_cubemap_per_texture", extStart, extEnd); #endif /* GL_ARB_seamless_cubemap_per_texture */ #ifdef GL_ARB_separate_shader_objects GLEW_ARB_separate_shader_objects = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd); if (glewExperimental || GLEW_ARB_separate_shader_objects) GLEW_ARB_separate_shader_objects = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_separate_shader_objects */ #ifdef GL_ARB_shader_atomic_counter_ops GLEW_ARB_shader_atomic_counter_ops = _glewSearchExtension("GL_ARB_shader_atomic_counter_ops", extStart, extEnd); #endif /* GL_ARB_shader_atomic_counter_ops */ #ifdef GL_ARB_shader_atomic_counters GLEW_ARB_shader_atomic_counters = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd); if (glewExperimental || GLEW_ARB_shader_atomic_counters) GLEW_ARB_shader_atomic_counters = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_shader_atomic_counters */ #ifdef GL_ARB_shader_ballot GLEW_ARB_shader_ballot = _glewSearchExtension("GL_ARB_shader_ballot", extStart, extEnd); #endif /* GL_ARB_shader_ballot */ #ifdef GL_ARB_shader_bit_encoding GLEW_ARB_shader_bit_encoding = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd); #endif /* GL_ARB_shader_bit_encoding */ #ifdef GL_ARB_shader_clock GLEW_ARB_shader_clock = _glewSearchExtension("GL_ARB_shader_clock", extStart, extEnd); #endif /* GL_ARB_shader_clock */ #ifdef GL_ARB_shader_draw_parameters GLEW_ARB_shader_draw_parameters = _glewSearchExtension("GL_ARB_shader_draw_parameters", extStart, extEnd); #endif /* GL_ARB_shader_draw_parameters */ #ifdef GL_ARB_shader_group_vote GLEW_ARB_shader_group_vote = _glewSearchExtension("GL_ARB_shader_group_vote", extStart, extEnd); #endif /* GL_ARB_shader_group_vote */ #ifdef GL_ARB_shader_image_load_store GLEW_ARB_shader_image_load_store = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd); if (glewExperimental || GLEW_ARB_shader_image_load_store) GLEW_ARB_shader_image_load_store = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_shader_image_load_store */ #ifdef GL_ARB_shader_image_size GLEW_ARB_shader_image_size = _glewSearchExtension("GL_ARB_shader_image_size", extStart, extEnd); #endif /* GL_ARB_shader_image_size */ #ifdef GL_ARB_shader_objects GLEW_ARB_shader_objects = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd); if (glewExperimental || GLEW_ARB_shader_objects) GLEW_ARB_shader_objects = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_shader_objects */ #ifdef GL_ARB_shader_precision GLEW_ARB_shader_precision = _glewSearchExtension("GL_ARB_shader_precision", extStart, extEnd); #endif /* GL_ARB_shader_precision */ #ifdef GL_ARB_shader_stencil_export GLEW_ARB_shader_stencil_export = _glewSearchExtension("GL_ARB_shader_stencil_export", extStart, extEnd); #endif /* GL_ARB_shader_stencil_export */ #ifdef GL_ARB_shader_storage_buffer_object GLEW_ARB_shader_storage_buffer_object = _glewSearchExtension("GL_ARB_shader_storage_buffer_object", extStart, extEnd); if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) GLEW_ARB_shader_storage_buffer_object = !_glewInit_GL_ARB_shader_storage_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_shader_storage_buffer_object */ #ifdef GL_ARB_shader_subroutine GLEW_ARB_shader_subroutine = _glewSearchExtension("GL_ARB_shader_subroutine", extStart, extEnd); if (glewExperimental || GLEW_ARB_shader_subroutine) GLEW_ARB_shader_subroutine = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_shader_subroutine */ #ifdef GL_ARB_shader_texture_image_samples GLEW_ARB_shader_texture_image_samples = _glewSearchExtension("GL_ARB_shader_texture_image_samples", extStart, extEnd); #endif /* GL_ARB_shader_texture_image_samples */ #ifdef GL_ARB_shader_texture_lod GLEW_ARB_shader_texture_lod = _glewSearchExtension("GL_ARB_shader_texture_lod", extStart, extEnd); #endif /* GL_ARB_shader_texture_lod */ #ifdef GL_ARB_shader_viewport_layer_array GLEW_ARB_shader_viewport_layer_array = _glewSearchExtension("GL_ARB_shader_viewport_layer_array", extStart, extEnd); #endif /* GL_ARB_shader_viewport_layer_array */ #ifdef GL_ARB_shading_language_100 GLEW_ARB_shading_language_100 = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd); #endif /* GL_ARB_shading_language_100 */ #ifdef GL_ARB_shading_language_420pack GLEW_ARB_shading_language_420pack = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd); #endif /* GL_ARB_shading_language_420pack */ #ifdef GL_ARB_shading_language_include GLEW_ARB_shading_language_include = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd); if (glewExperimental || GLEW_ARB_shading_language_include) GLEW_ARB_shading_language_include = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_shading_language_include */ #ifdef GL_ARB_shading_language_packing GLEW_ARB_shading_language_packing = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd); #endif /* GL_ARB_shading_language_packing */ #ifdef GL_ARB_shadow GLEW_ARB_shadow = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd); #endif /* GL_ARB_shadow */ #ifdef GL_ARB_shadow_ambient GLEW_ARB_shadow_ambient = _glewSearchExtension("GL_ARB_shadow_ambient", extStart, extEnd); #endif /* GL_ARB_shadow_ambient */ #ifdef GL_ARB_sparse_buffer GLEW_ARB_sparse_buffer = _glewSearchExtension("GL_ARB_sparse_buffer", extStart, extEnd); if (glewExperimental || GLEW_ARB_sparse_buffer) GLEW_ARB_sparse_buffer = !_glewInit_GL_ARB_sparse_buffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_sparse_buffer */ #ifdef GL_ARB_sparse_texture GLEW_ARB_sparse_texture = _glewSearchExtension("GL_ARB_sparse_texture", extStart, extEnd); if (glewExperimental || GLEW_ARB_sparse_texture) GLEW_ARB_sparse_texture = !_glewInit_GL_ARB_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_sparse_texture */ #ifdef GL_ARB_sparse_texture2 GLEW_ARB_sparse_texture2 = _glewSearchExtension("GL_ARB_sparse_texture2", extStart, extEnd); #endif /* GL_ARB_sparse_texture2 */ #ifdef GL_ARB_sparse_texture_clamp GLEW_ARB_sparse_texture_clamp = _glewSearchExtension("GL_ARB_sparse_texture_clamp", extStart, extEnd); #endif /* GL_ARB_sparse_texture_clamp */ #ifdef GL_ARB_stencil_texturing GLEW_ARB_stencil_texturing = _glewSearchExtension("GL_ARB_stencil_texturing", extStart, extEnd); #endif /* GL_ARB_stencil_texturing */ #ifdef GL_ARB_sync GLEW_ARB_sync = _glewSearchExtension("GL_ARB_sync", extStart, extEnd); if (glewExperimental || GLEW_ARB_sync) GLEW_ARB_sync = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_sync */ #ifdef GL_ARB_tessellation_shader GLEW_ARB_tessellation_shader = _glewSearchExtension("GL_ARB_tessellation_shader", extStart, extEnd); if (glewExperimental || GLEW_ARB_tessellation_shader) GLEW_ARB_tessellation_shader = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_tessellation_shader */ #ifdef GL_ARB_texture_barrier GLEW_ARB_texture_barrier = _glewSearchExtension("GL_ARB_texture_barrier", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_barrier) GLEW_ARB_texture_barrier = !_glewInit_GL_ARB_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_barrier */ #ifdef GL_ARB_texture_border_clamp GLEW_ARB_texture_border_clamp = _glewSearchExtension("GL_ARB_texture_border_clamp", extStart, extEnd); #endif /* GL_ARB_texture_border_clamp */ #ifdef GL_ARB_texture_buffer_object GLEW_ARB_texture_buffer_object = _glewSearchExtension("GL_ARB_texture_buffer_object", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_buffer_object) GLEW_ARB_texture_buffer_object = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_buffer_object */ #ifdef GL_ARB_texture_buffer_object_rgb32 GLEW_ARB_texture_buffer_object_rgb32 = _glewSearchExtension("GL_ARB_texture_buffer_object_rgb32", extStart, extEnd); #endif /* GL_ARB_texture_buffer_object_rgb32 */ #ifdef GL_ARB_texture_buffer_range GLEW_ARB_texture_buffer_range = _glewSearchExtension("GL_ARB_texture_buffer_range", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_buffer_range) GLEW_ARB_texture_buffer_range = !_glewInit_GL_ARB_texture_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_buffer_range */ #ifdef GL_ARB_texture_compression GLEW_ARB_texture_compression = _glewSearchExtension("GL_ARB_texture_compression", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_compression) GLEW_ARB_texture_compression = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_compression */ #ifdef GL_ARB_texture_compression_bptc GLEW_ARB_texture_compression_bptc = _glewSearchExtension("GL_ARB_texture_compression_bptc", extStart, extEnd); #endif /* GL_ARB_texture_compression_bptc */ #ifdef GL_ARB_texture_compression_rgtc GLEW_ARB_texture_compression_rgtc = _glewSearchExtension("GL_ARB_texture_compression_rgtc", extStart, extEnd); #endif /* GL_ARB_texture_compression_rgtc */ #ifdef GL_ARB_texture_cube_map GLEW_ARB_texture_cube_map = _glewSearchExtension("GL_ARB_texture_cube_map", extStart, extEnd); #endif /* GL_ARB_texture_cube_map */ #ifdef GL_ARB_texture_cube_map_array GLEW_ARB_texture_cube_map_array = _glewSearchExtension("GL_ARB_texture_cube_map_array", extStart, extEnd); #endif /* GL_ARB_texture_cube_map_array */ #ifdef GL_ARB_texture_env_add GLEW_ARB_texture_env_add = _glewSearchExtension("GL_ARB_texture_env_add", extStart, extEnd); #endif /* GL_ARB_texture_env_add */ #ifdef GL_ARB_texture_env_combine GLEW_ARB_texture_env_combine = _glewSearchExtension("GL_ARB_texture_env_combine", extStart, extEnd); #endif /* GL_ARB_texture_env_combine */ #ifdef GL_ARB_texture_env_crossbar GLEW_ARB_texture_env_crossbar = _glewSearchExtension("GL_ARB_texture_env_crossbar", extStart, extEnd); #endif /* GL_ARB_texture_env_crossbar */ #ifdef GL_ARB_texture_env_dot3 GLEW_ARB_texture_env_dot3 = _glewSearchExtension("GL_ARB_texture_env_dot3", extStart, extEnd); #endif /* GL_ARB_texture_env_dot3 */ #ifdef GL_ARB_texture_filter_minmax GLEW_ARB_texture_filter_minmax = _glewSearchExtension("GL_ARB_texture_filter_minmax", extStart, extEnd); #endif /* GL_ARB_texture_filter_minmax */ #ifdef GL_ARB_texture_float GLEW_ARB_texture_float = _glewSearchExtension("GL_ARB_texture_float", extStart, extEnd); #endif /* GL_ARB_texture_float */ #ifdef GL_ARB_texture_gather GLEW_ARB_texture_gather = _glewSearchExtension("GL_ARB_texture_gather", extStart, extEnd); #endif /* GL_ARB_texture_gather */ #ifdef GL_ARB_texture_mirror_clamp_to_edge GLEW_ARB_texture_mirror_clamp_to_edge = _glewSearchExtension("GL_ARB_texture_mirror_clamp_to_edge", extStart, extEnd); #endif /* GL_ARB_texture_mirror_clamp_to_edge */ #ifdef GL_ARB_texture_mirrored_repeat GLEW_ARB_texture_mirrored_repeat = _glewSearchExtension("GL_ARB_texture_mirrored_repeat", extStart, extEnd); #endif /* GL_ARB_texture_mirrored_repeat */ #ifdef GL_ARB_texture_multisample GLEW_ARB_texture_multisample = _glewSearchExtension("GL_ARB_texture_multisample", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_multisample) GLEW_ARB_texture_multisample = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_multisample */ #ifdef GL_ARB_texture_non_power_of_two GLEW_ARB_texture_non_power_of_two = _glewSearchExtension("GL_ARB_texture_non_power_of_two", extStart, extEnd); #endif /* GL_ARB_texture_non_power_of_two */ #ifdef GL_ARB_texture_query_levels GLEW_ARB_texture_query_levels = _glewSearchExtension("GL_ARB_texture_query_levels", extStart, extEnd); #endif /* GL_ARB_texture_query_levels */ #ifdef GL_ARB_texture_query_lod GLEW_ARB_texture_query_lod = _glewSearchExtension("GL_ARB_texture_query_lod", extStart, extEnd); #endif /* GL_ARB_texture_query_lod */ #ifdef GL_ARB_texture_rectangle GLEW_ARB_texture_rectangle = _glewSearchExtension("GL_ARB_texture_rectangle", extStart, extEnd); #endif /* GL_ARB_texture_rectangle */ #ifdef GL_ARB_texture_rg GLEW_ARB_texture_rg = _glewSearchExtension("GL_ARB_texture_rg", extStart, extEnd); #endif /* GL_ARB_texture_rg */ #ifdef GL_ARB_texture_rgb10_a2ui GLEW_ARB_texture_rgb10_a2ui = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd); #endif /* GL_ARB_texture_rgb10_a2ui */ #ifdef GL_ARB_texture_stencil8 GLEW_ARB_texture_stencil8 = _glewSearchExtension("GL_ARB_texture_stencil8", extStart, extEnd); #endif /* GL_ARB_texture_stencil8 */ #ifdef GL_ARB_texture_storage GLEW_ARB_texture_storage = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_storage) GLEW_ARB_texture_storage = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_storage */ #ifdef GL_ARB_texture_storage_multisample GLEW_ARB_texture_storage_multisample = _glewSearchExtension("GL_ARB_texture_storage_multisample", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_storage_multisample) GLEW_ARB_texture_storage_multisample = !_glewInit_GL_ARB_texture_storage_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_storage_multisample */ #ifdef GL_ARB_texture_swizzle GLEW_ARB_texture_swizzle = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd); #endif /* GL_ARB_texture_swizzle */ #ifdef GL_ARB_texture_view GLEW_ARB_texture_view = _glewSearchExtension("GL_ARB_texture_view", extStart, extEnd); if (glewExperimental || GLEW_ARB_texture_view) GLEW_ARB_texture_view = !_glewInit_GL_ARB_texture_view(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_texture_view */ #ifdef GL_ARB_timer_query GLEW_ARB_timer_query = _glewSearchExtension("GL_ARB_timer_query", extStart, extEnd); if (glewExperimental || GLEW_ARB_timer_query) GLEW_ARB_timer_query = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_timer_query */ #ifdef GL_ARB_transform_feedback2 GLEW_ARB_transform_feedback2 = _glewSearchExtension("GL_ARB_transform_feedback2", extStart, extEnd); if (glewExperimental || GLEW_ARB_transform_feedback2) GLEW_ARB_transform_feedback2 = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_transform_feedback2 */ #ifdef GL_ARB_transform_feedback3 GLEW_ARB_transform_feedback3 = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd); if (glewExperimental || GLEW_ARB_transform_feedback3) GLEW_ARB_transform_feedback3 = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_transform_feedback3 */ #ifdef GL_ARB_transform_feedback_instanced GLEW_ARB_transform_feedback_instanced = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd); if (glewExperimental || GLEW_ARB_transform_feedback_instanced) GLEW_ARB_transform_feedback_instanced = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_transform_feedback_instanced */ #ifdef GL_ARB_transform_feedback_overflow_query GLEW_ARB_transform_feedback_overflow_query = _glewSearchExtension("GL_ARB_transform_feedback_overflow_query", extStart, extEnd); #endif /* GL_ARB_transform_feedback_overflow_query */ #ifdef GL_ARB_transpose_matrix GLEW_ARB_transpose_matrix = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd); if (glewExperimental || GLEW_ARB_transpose_matrix) GLEW_ARB_transpose_matrix = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_transpose_matrix */ #ifdef GL_ARB_uniform_buffer_object GLEW_ARB_uniform_buffer_object = _glewSearchExtension("GL_ARB_uniform_buffer_object", extStart, extEnd); if (glewExperimental || GLEW_ARB_uniform_buffer_object) GLEW_ARB_uniform_buffer_object = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_uniform_buffer_object */ #ifdef GL_ARB_vertex_array_bgra GLEW_ARB_vertex_array_bgra = _glewSearchExtension("GL_ARB_vertex_array_bgra", extStart, extEnd); #endif /* GL_ARB_vertex_array_bgra */ #ifdef GL_ARB_vertex_array_object GLEW_ARB_vertex_array_object = _glewSearchExtension("GL_ARB_vertex_array_object", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_array_object) GLEW_ARB_vertex_array_object = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_vertex_array_object */ #ifdef GL_ARB_vertex_attrib_64bit GLEW_ARB_vertex_attrib_64bit = _glewSearchExtension("GL_ARB_vertex_attrib_64bit", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) GLEW_ARB_vertex_attrib_64bit = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_vertex_attrib_64bit */ #ifdef GL_ARB_vertex_attrib_binding GLEW_ARB_vertex_attrib_binding = _glewSearchExtension("GL_ARB_vertex_attrib_binding", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_attrib_binding) GLEW_ARB_vertex_attrib_binding = !_glewInit_GL_ARB_vertex_attrib_binding(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_vertex_attrib_binding */ #ifdef GL_ARB_vertex_blend GLEW_ARB_vertex_blend = _glewSearchExtension("GL_ARB_vertex_blend", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_blend) GLEW_ARB_vertex_blend = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_vertex_blend */ #ifdef GL_ARB_vertex_buffer_object GLEW_ARB_vertex_buffer_object = _glewSearchExtension("GL_ARB_vertex_buffer_object", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_buffer_object) GLEW_ARB_vertex_buffer_object = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_vertex_buffer_object */ #ifdef GL_ARB_vertex_program GLEW_ARB_vertex_program = _glewSearchExtension("GL_ARB_vertex_program", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_program) GLEW_ARB_vertex_program = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_vertex_program */ #ifdef GL_ARB_vertex_shader GLEW_ARB_vertex_shader = _glewSearchExtension("GL_ARB_vertex_shader", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_shader) { GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); } #endif /* GL_ARB_vertex_shader */ #ifdef GL_ARB_vertex_type_10f_11f_11f_rev GLEW_ARB_vertex_type_10f_11f_11f_rev = _glewSearchExtension("GL_ARB_vertex_type_10f_11f_11f_rev", extStart, extEnd); #endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ #ifdef GL_ARB_vertex_type_2_10_10_10_rev GLEW_ARB_vertex_type_2_10_10_10_rev = _glewSearchExtension("GL_ARB_vertex_type_2_10_10_10_rev", extStart, extEnd); if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) GLEW_ARB_vertex_type_2_10_10_10_rev = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_vertex_type_2_10_10_10_rev */ #ifdef GL_ARB_viewport_array GLEW_ARB_viewport_array = _glewSearchExtension("GL_ARB_viewport_array", extStart, extEnd); if (glewExperimental || GLEW_ARB_viewport_array) GLEW_ARB_viewport_array = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_viewport_array */ #ifdef GL_ARB_window_pos GLEW_ARB_window_pos = _glewSearchExtension("GL_ARB_window_pos", extStart, extEnd); if (glewExperimental || GLEW_ARB_window_pos) GLEW_ARB_window_pos = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ARB_window_pos */ #ifdef GL_ATIX_point_sprites GLEW_ATIX_point_sprites = _glewSearchExtension("GL_ATIX_point_sprites", extStart, extEnd); #endif /* GL_ATIX_point_sprites */ #ifdef GL_ATIX_texture_env_combine3 GLEW_ATIX_texture_env_combine3 = _glewSearchExtension("GL_ATIX_texture_env_combine3", extStart, extEnd); #endif /* GL_ATIX_texture_env_combine3 */ #ifdef GL_ATIX_texture_env_route GLEW_ATIX_texture_env_route = _glewSearchExtension("GL_ATIX_texture_env_route", extStart, extEnd); #endif /* GL_ATIX_texture_env_route */ #ifdef GL_ATIX_vertex_shader_output_point_size GLEW_ATIX_vertex_shader_output_point_size = _glewSearchExtension("GL_ATIX_vertex_shader_output_point_size", extStart, extEnd); #endif /* GL_ATIX_vertex_shader_output_point_size */ #ifdef GL_ATI_draw_buffers GLEW_ATI_draw_buffers = _glewSearchExtension("GL_ATI_draw_buffers", extStart, extEnd); if (glewExperimental || GLEW_ATI_draw_buffers) GLEW_ATI_draw_buffers = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_draw_buffers */ #ifdef GL_ATI_element_array GLEW_ATI_element_array = _glewSearchExtension("GL_ATI_element_array", extStart, extEnd); if (glewExperimental || GLEW_ATI_element_array) GLEW_ATI_element_array = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_element_array */ #ifdef GL_ATI_envmap_bumpmap GLEW_ATI_envmap_bumpmap = _glewSearchExtension("GL_ATI_envmap_bumpmap", extStart, extEnd); if (glewExperimental || GLEW_ATI_envmap_bumpmap) GLEW_ATI_envmap_bumpmap = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_envmap_bumpmap */ #ifdef GL_ATI_fragment_shader GLEW_ATI_fragment_shader = _glewSearchExtension("GL_ATI_fragment_shader", extStart, extEnd); if (glewExperimental || GLEW_ATI_fragment_shader) GLEW_ATI_fragment_shader = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_fragment_shader */ #ifdef GL_ATI_map_object_buffer GLEW_ATI_map_object_buffer = _glewSearchExtension("GL_ATI_map_object_buffer", extStart, extEnd); if (glewExperimental || GLEW_ATI_map_object_buffer) GLEW_ATI_map_object_buffer = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_map_object_buffer */ #ifdef GL_ATI_meminfo GLEW_ATI_meminfo = _glewSearchExtension("GL_ATI_meminfo", extStart, extEnd); #endif /* GL_ATI_meminfo */ #ifdef GL_ATI_pn_triangles GLEW_ATI_pn_triangles = _glewSearchExtension("GL_ATI_pn_triangles", extStart, extEnd); if (glewExperimental || GLEW_ATI_pn_triangles) GLEW_ATI_pn_triangles = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_pn_triangles */ #ifdef GL_ATI_separate_stencil GLEW_ATI_separate_stencil = _glewSearchExtension("GL_ATI_separate_stencil", extStart, extEnd); if (glewExperimental || GLEW_ATI_separate_stencil) GLEW_ATI_separate_stencil = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_separate_stencil */ #ifdef GL_ATI_shader_texture_lod GLEW_ATI_shader_texture_lod = _glewSearchExtension("GL_ATI_shader_texture_lod", extStart, extEnd); #endif /* GL_ATI_shader_texture_lod */ #ifdef GL_ATI_text_fragment_shader GLEW_ATI_text_fragment_shader = _glewSearchExtension("GL_ATI_text_fragment_shader", extStart, extEnd); #endif /* GL_ATI_text_fragment_shader */ #ifdef GL_ATI_texture_compression_3dc GLEW_ATI_texture_compression_3dc = _glewSearchExtension("GL_ATI_texture_compression_3dc", extStart, extEnd); #endif /* GL_ATI_texture_compression_3dc */ #ifdef GL_ATI_texture_env_combine3 GLEW_ATI_texture_env_combine3 = _glewSearchExtension("GL_ATI_texture_env_combine3", extStart, extEnd); #endif /* GL_ATI_texture_env_combine3 */ #ifdef GL_ATI_texture_float GLEW_ATI_texture_float = _glewSearchExtension("GL_ATI_texture_float", extStart, extEnd); #endif /* GL_ATI_texture_float */ #ifdef GL_ATI_texture_mirror_once GLEW_ATI_texture_mirror_once = _glewSearchExtension("GL_ATI_texture_mirror_once", extStart, extEnd); #endif /* GL_ATI_texture_mirror_once */ #ifdef GL_ATI_vertex_array_object GLEW_ATI_vertex_array_object = _glewSearchExtension("GL_ATI_vertex_array_object", extStart, extEnd); if (glewExperimental || GLEW_ATI_vertex_array_object) GLEW_ATI_vertex_array_object = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_vertex_array_object */ #ifdef GL_ATI_vertex_attrib_array_object GLEW_ATI_vertex_attrib_array_object = _glewSearchExtension("GL_ATI_vertex_attrib_array_object", extStart, extEnd); if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) GLEW_ATI_vertex_attrib_array_object = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_vertex_attrib_array_object */ #ifdef GL_ATI_vertex_streams GLEW_ATI_vertex_streams = _glewSearchExtension("GL_ATI_vertex_streams", extStart, extEnd); if (glewExperimental || GLEW_ATI_vertex_streams) GLEW_ATI_vertex_streams = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_ATI_vertex_streams */ #ifdef GL_EXT_422_pixels GLEW_EXT_422_pixels = _glewSearchExtension("GL_EXT_422_pixels", extStart, extEnd); #endif /* GL_EXT_422_pixels */ #ifdef GL_EXT_Cg_shader GLEW_EXT_Cg_shader = _glewSearchExtension("GL_EXT_Cg_shader", extStart, extEnd); #endif /* GL_EXT_Cg_shader */ #ifdef GL_EXT_abgr GLEW_EXT_abgr = _glewSearchExtension("GL_EXT_abgr", extStart, extEnd); #endif /* GL_EXT_abgr */ #ifdef GL_EXT_bgra GLEW_EXT_bgra = _glewSearchExtension("GL_EXT_bgra", extStart, extEnd); #endif /* GL_EXT_bgra */ #ifdef GL_EXT_bindable_uniform GLEW_EXT_bindable_uniform = _glewSearchExtension("GL_EXT_bindable_uniform", extStart, extEnd); if (glewExperimental || GLEW_EXT_bindable_uniform) GLEW_EXT_bindable_uniform = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_bindable_uniform */ #ifdef GL_EXT_blend_color GLEW_EXT_blend_color = _glewSearchExtension("GL_EXT_blend_color", extStart, extEnd); if (glewExperimental || GLEW_EXT_blend_color) GLEW_EXT_blend_color = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_blend_color */ #ifdef GL_EXT_blend_equation_separate GLEW_EXT_blend_equation_separate = _glewSearchExtension("GL_EXT_blend_equation_separate", extStart, extEnd); if (glewExperimental || GLEW_EXT_blend_equation_separate) GLEW_EXT_blend_equation_separate = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_blend_equation_separate */ #ifdef GL_EXT_blend_func_separate GLEW_EXT_blend_func_separate = _glewSearchExtension("GL_EXT_blend_func_separate", extStart, extEnd); if (glewExperimental || GLEW_EXT_blend_func_separate) GLEW_EXT_blend_func_separate = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_blend_func_separate */ #ifdef GL_EXT_blend_logic_op GLEW_EXT_blend_logic_op = _glewSearchExtension("GL_EXT_blend_logic_op", extStart, extEnd); #endif /* GL_EXT_blend_logic_op */ #ifdef GL_EXT_blend_minmax GLEW_EXT_blend_minmax = _glewSearchExtension("GL_EXT_blend_minmax", extStart, extEnd); if (glewExperimental || GLEW_EXT_blend_minmax) GLEW_EXT_blend_minmax = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_blend_minmax */ #ifdef GL_EXT_blend_subtract GLEW_EXT_blend_subtract = _glewSearchExtension("GL_EXT_blend_subtract", extStart, extEnd); #endif /* GL_EXT_blend_subtract */ #ifdef GL_EXT_clip_volume_hint GLEW_EXT_clip_volume_hint = _glewSearchExtension("GL_EXT_clip_volume_hint", extStart, extEnd); #endif /* GL_EXT_clip_volume_hint */ #ifdef GL_EXT_cmyka GLEW_EXT_cmyka = _glewSearchExtension("GL_EXT_cmyka", extStart, extEnd); #endif /* GL_EXT_cmyka */ #ifdef GL_EXT_color_subtable GLEW_EXT_color_subtable = _glewSearchExtension("GL_EXT_color_subtable", extStart, extEnd); if (glewExperimental || GLEW_EXT_color_subtable) GLEW_EXT_color_subtable = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_color_subtable */ #ifdef GL_EXT_compiled_vertex_array GLEW_EXT_compiled_vertex_array = _glewSearchExtension("GL_EXT_compiled_vertex_array", extStart, extEnd); if (glewExperimental || GLEW_EXT_compiled_vertex_array) GLEW_EXT_compiled_vertex_array = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_compiled_vertex_array */ #ifdef GL_EXT_convolution GLEW_EXT_convolution = _glewSearchExtension("GL_EXT_convolution", extStart, extEnd); if (glewExperimental || GLEW_EXT_convolution) GLEW_EXT_convolution = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_convolution */ #ifdef GL_EXT_coordinate_frame GLEW_EXT_coordinate_frame = _glewSearchExtension("GL_EXT_coordinate_frame", extStart, extEnd); if (glewExperimental || GLEW_EXT_coordinate_frame) GLEW_EXT_coordinate_frame = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_coordinate_frame */ #ifdef GL_EXT_copy_texture GLEW_EXT_copy_texture = _glewSearchExtension("GL_EXT_copy_texture", extStart, extEnd); if (glewExperimental || GLEW_EXT_copy_texture) GLEW_EXT_copy_texture = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_copy_texture */ #ifdef GL_EXT_cull_vertex GLEW_EXT_cull_vertex = _glewSearchExtension("GL_EXT_cull_vertex", extStart, extEnd); if (glewExperimental || GLEW_EXT_cull_vertex) GLEW_EXT_cull_vertex = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_cull_vertex */ #ifdef GL_EXT_debug_label GLEW_EXT_debug_label = _glewSearchExtension("GL_EXT_debug_label", extStart, extEnd); if (glewExperimental || GLEW_EXT_debug_label) GLEW_EXT_debug_label = !_glewInit_GL_EXT_debug_label(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_debug_label */ #ifdef GL_EXT_debug_marker GLEW_EXT_debug_marker = _glewSearchExtension("GL_EXT_debug_marker", extStart, extEnd); if (glewExperimental || GLEW_EXT_debug_marker) GLEW_EXT_debug_marker = !_glewInit_GL_EXT_debug_marker(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_debug_marker */ #ifdef GL_EXT_depth_bounds_test GLEW_EXT_depth_bounds_test = _glewSearchExtension("GL_EXT_depth_bounds_test", extStart, extEnd); if (glewExperimental || GLEW_EXT_depth_bounds_test) GLEW_EXT_depth_bounds_test = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_depth_bounds_test */ #ifdef GL_EXT_direct_state_access GLEW_EXT_direct_state_access = _glewSearchExtension("GL_EXT_direct_state_access", extStart, extEnd); if (glewExperimental || GLEW_EXT_direct_state_access) GLEW_EXT_direct_state_access = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_direct_state_access */ #ifdef GL_EXT_draw_buffers2 GLEW_EXT_draw_buffers2 = _glewSearchExtension("GL_EXT_draw_buffers2", extStart, extEnd); if (glewExperimental || GLEW_EXT_draw_buffers2) GLEW_EXT_draw_buffers2 = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_draw_buffers2 */ #ifdef GL_EXT_draw_instanced GLEW_EXT_draw_instanced = _glewSearchExtension("GL_EXT_draw_instanced", extStart, extEnd); if (glewExperimental || GLEW_EXT_draw_instanced) GLEW_EXT_draw_instanced = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_draw_instanced */ #ifdef GL_EXT_draw_range_elements GLEW_EXT_draw_range_elements = _glewSearchExtension("GL_EXT_draw_range_elements", extStart, extEnd); if (glewExperimental || GLEW_EXT_draw_range_elements) GLEW_EXT_draw_range_elements = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_draw_range_elements */ #ifdef GL_EXT_fog_coord GLEW_EXT_fog_coord = _glewSearchExtension("GL_EXT_fog_coord", extStart, extEnd); if (glewExperimental || GLEW_EXT_fog_coord) GLEW_EXT_fog_coord = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_fog_coord */ #ifdef GL_EXT_fragment_lighting GLEW_EXT_fragment_lighting = _glewSearchExtension("GL_EXT_fragment_lighting", extStart, extEnd); if (glewExperimental || GLEW_EXT_fragment_lighting) GLEW_EXT_fragment_lighting = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_fragment_lighting */ #ifdef GL_EXT_framebuffer_blit GLEW_EXT_framebuffer_blit = _glewSearchExtension("GL_EXT_framebuffer_blit", extStart, extEnd); if (glewExperimental || GLEW_EXT_framebuffer_blit) GLEW_EXT_framebuffer_blit = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_framebuffer_blit */ #ifdef GL_EXT_framebuffer_multisample GLEW_EXT_framebuffer_multisample = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd); if (glewExperimental || GLEW_EXT_framebuffer_multisample) GLEW_EXT_framebuffer_multisample = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_framebuffer_multisample */ #ifdef GL_EXT_framebuffer_multisample_blit_scaled GLEW_EXT_framebuffer_multisample_blit_scaled = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd); #endif /* GL_EXT_framebuffer_multisample_blit_scaled */ #ifdef GL_EXT_framebuffer_object GLEW_EXT_framebuffer_object = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd); if (glewExperimental || GLEW_EXT_framebuffer_object) GLEW_EXT_framebuffer_object = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_framebuffer_object */ #ifdef GL_EXT_framebuffer_sRGB GLEW_EXT_framebuffer_sRGB = _glewSearchExtension("GL_EXT_framebuffer_sRGB", extStart, extEnd); #endif /* GL_EXT_framebuffer_sRGB */ #ifdef GL_EXT_geometry_shader4 GLEW_EXT_geometry_shader4 = _glewSearchExtension("GL_EXT_geometry_shader4", extStart, extEnd); if (glewExperimental || GLEW_EXT_geometry_shader4) GLEW_EXT_geometry_shader4 = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_geometry_shader4 */ #ifdef GL_EXT_gpu_program_parameters GLEW_EXT_gpu_program_parameters = _glewSearchExtension("GL_EXT_gpu_program_parameters", extStart, extEnd); if (glewExperimental || GLEW_EXT_gpu_program_parameters) GLEW_EXT_gpu_program_parameters = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_gpu_program_parameters */ #ifdef GL_EXT_gpu_shader4 GLEW_EXT_gpu_shader4 = _glewSearchExtension("GL_EXT_gpu_shader4", extStart, extEnd); if (glewExperimental || GLEW_EXT_gpu_shader4) GLEW_EXT_gpu_shader4 = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_gpu_shader4 */ #ifdef GL_EXT_histogram GLEW_EXT_histogram = _glewSearchExtension("GL_EXT_histogram", extStart, extEnd); if (glewExperimental || GLEW_EXT_histogram) GLEW_EXT_histogram = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_histogram */ #ifdef GL_EXT_index_array_formats GLEW_EXT_index_array_formats = _glewSearchExtension("GL_EXT_index_array_formats", extStart, extEnd); #endif /* GL_EXT_index_array_formats */ #ifdef GL_EXT_index_func GLEW_EXT_index_func = _glewSearchExtension("GL_EXT_index_func", extStart, extEnd); if (glewExperimental || GLEW_EXT_index_func) GLEW_EXT_index_func = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_index_func */ #ifdef GL_EXT_index_material GLEW_EXT_index_material = _glewSearchExtension("GL_EXT_index_material", extStart, extEnd); if (glewExperimental || GLEW_EXT_index_material) GLEW_EXT_index_material = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_index_material */ #ifdef GL_EXT_index_texture GLEW_EXT_index_texture = _glewSearchExtension("GL_EXT_index_texture", extStart, extEnd); #endif /* GL_EXT_index_texture */ #ifdef GL_EXT_light_texture GLEW_EXT_light_texture = _glewSearchExtension("GL_EXT_light_texture", extStart, extEnd); if (glewExperimental || GLEW_EXT_light_texture) GLEW_EXT_light_texture = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_light_texture */ #ifdef GL_EXT_misc_attribute GLEW_EXT_misc_attribute = _glewSearchExtension("GL_EXT_misc_attribute", extStart, extEnd); #endif /* GL_EXT_misc_attribute */ #ifdef GL_EXT_multi_draw_arrays GLEW_EXT_multi_draw_arrays = _glewSearchExtension("GL_EXT_multi_draw_arrays", extStart, extEnd); if (glewExperimental || GLEW_EXT_multi_draw_arrays) GLEW_EXT_multi_draw_arrays = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_multi_draw_arrays */ #ifdef GL_EXT_multisample GLEW_EXT_multisample = _glewSearchExtension("GL_EXT_multisample", extStart, extEnd); if (glewExperimental || GLEW_EXT_multisample) GLEW_EXT_multisample = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_multisample */ #ifdef GL_EXT_packed_depth_stencil GLEW_EXT_packed_depth_stencil = _glewSearchExtension("GL_EXT_packed_depth_stencil", extStart, extEnd); #endif /* GL_EXT_packed_depth_stencil */ #ifdef GL_EXT_packed_float GLEW_EXT_packed_float = _glewSearchExtension("GL_EXT_packed_float", extStart, extEnd); #endif /* GL_EXT_packed_float */ #ifdef GL_EXT_packed_pixels GLEW_EXT_packed_pixels = _glewSearchExtension("GL_EXT_packed_pixels", extStart, extEnd); #endif /* GL_EXT_packed_pixels */ #ifdef GL_EXT_paletted_texture GLEW_EXT_paletted_texture = _glewSearchExtension("GL_EXT_paletted_texture", extStart, extEnd); if (glewExperimental || GLEW_EXT_paletted_texture) GLEW_EXT_paletted_texture = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_paletted_texture */ #ifdef GL_EXT_pixel_buffer_object GLEW_EXT_pixel_buffer_object = _glewSearchExtension("GL_EXT_pixel_buffer_object", extStart, extEnd); #endif /* GL_EXT_pixel_buffer_object */ #ifdef GL_EXT_pixel_transform GLEW_EXT_pixel_transform = _glewSearchExtension("GL_EXT_pixel_transform", extStart, extEnd); if (glewExperimental || GLEW_EXT_pixel_transform) GLEW_EXT_pixel_transform = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_pixel_transform */ #ifdef GL_EXT_pixel_transform_color_table GLEW_EXT_pixel_transform_color_table = _glewSearchExtension("GL_EXT_pixel_transform_color_table", extStart, extEnd); #endif /* GL_EXT_pixel_transform_color_table */ #ifdef GL_EXT_point_parameters GLEW_EXT_point_parameters = _glewSearchExtension("GL_EXT_point_parameters", extStart, extEnd); if (glewExperimental || GLEW_EXT_point_parameters) GLEW_EXT_point_parameters = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_point_parameters */ #ifdef GL_EXT_polygon_offset GLEW_EXT_polygon_offset = _glewSearchExtension("GL_EXT_polygon_offset", extStart, extEnd); if (glewExperimental || GLEW_EXT_polygon_offset) GLEW_EXT_polygon_offset = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_polygon_offset */ #ifdef GL_EXT_polygon_offset_clamp GLEW_EXT_polygon_offset_clamp = _glewSearchExtension("GL_EXT_polygon_offset_clamp", extStart, extEnd); if (glewExperimental || GLEW_EXT_polygon_offset_clamp) GLEW_EXT_polygon_offset_clamp = !_glewInit_GL_EXT_polygon_offset_clamp(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_polygon_offset_clamp */ #ifdef GL_EXT_post_depth_coverage GLEW_EXT_post_depth_coverage = _glewSearchExtension("GL_EXT_post_depth_coverage", extStart, extEnd); #endif /* GL_EXT_post_depth_coverage */ #ifdef GL_EXT_provoking_vertex GLEW_EXT_provoking_vertex = _glewSearchExtension("GL_EXT_provoking_vertex", extStart, extEnd); if (glewExperimental || GLEW_EXT_provoking_vertex) GLEW_EXT_provoking_vertex = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_provoking_vertex */ #ifdef GL_EXT_raster_multisample GLEW_EXT_raster_multisample = _glewSearchExtension("GL_EXT_raster_multisample", extStart, extEnd); if (glewExperimental || GLEW_EXT_raster_multisample) GLEW_EXT_raster_multisample = !_glewInit_GL_EXT_raster_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_raster_multisample */ #ifdef GL_EXT_rescale_normal GLEW_EXT_rescale_normal = _glewSearchExtension("GL_EXT_rescale_normal", extStart, extEnd); #endif /* GL_EXT_rescale_normal */ #ifdef GL_EXT_scene_marker GLEW_EXT_scene_marker = _glewSearchExtension("GL_EXT_scene_marker", extStart, extEnd); if (glewExperimental || GLEW_EXT_scene_marker) GLEW_EXT_scene_marker = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_scene_marker */ #ifdef GL_EXT_secondary_color GLEW_EXT_secondary_color = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd); if (glewExperimental || GLEW_EXT_secondary_color) GLEW_EXT_secondary_color = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_secondary_color */ #ifdef GL_EXT_separate_shader_objects GLEW_EXT_separate_shader_objects = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd); if (glewExperimental || GLEW_EXT_separate_shader_objects) GLEW_EXT_separate_shader_objects = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_separate_shader_objects */ #ifdef GL_EXT_separate_specular_color GLEW_EXT_separate_specular_color = _glewSearchExtension("GL_EXT_separate_specular_color", extStart, extEnd); #endif /* GL_EXT_separate_specular_color */ #ifdef GL_EXT_shader_image_load_formatted GLEW_EXT_shader_image_load_formatted = _glewSearchExtension("GL_EXT_shader_image_load_formatted", extStart, extEnd); #endif /* GL_EXT_shader_image_load_formatted */ #ifdef GL_EXT_shader_image_load_store GLEW_EXT_shader_image_load_store = _glewSearchExtension("GL_EXT_shader_image_load_store", extStart, extEnd); if (glewExperimental || GLEW_EXT_shader_image_load_store) GLEW_EXT_shader_image_load_store = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_shader_image_load_store */ #ifdef GL_EXT_shader_integer_mix GLEW_EXT_shader_integer_mix = _glewSearchExtension("GL_EXT_shader_integer_mix", extStart, extEnd); #endif /* GL_EXT_shader_integer_mix */ #ifdef GL_EXT_shadow_funcs GLEW_EXT_shadow_funcs = _glewSearchExtension("GL_EXT_shadow_funcs", extStart, extEnd); #endif /* GL_EXT_shadow_funcs */ #ifdef GL_EXT_shared_texture_palette GLEW_EXT_shared_texture_palette = _glewSearchExtension("GL_EXT_shared_texture_palette", extStart, extEnd); #endif /* GL_EXT_shared_texture_palette */ #ifdef GL_EXT_sparse_texture2 GLEW_EXT_sparse_texture2 = _glewSearchExtension("GL_EXT_sparse_texture2", extStart, extEnd); #endif /* GL_EXT_sparse_texture2 */ #ifdef GL_EXT_stencil_clear_tag GLEW_EXT_stencil_clear_tag = _glewSearchExtension("GL_EXT_stencil_clear_tag", extStart, extEnd); #endif /* GL_EXT_stencil_clear_tag */ #ifdef GL_EXT_stencil_two_side GLEW_EXT_stencil_two_side = _glewSearchExtension("GL_EXT_stencil_two_side", extStart, extEnd); if (glewExperimental || GLEW_EXT_stencil_two_side) GLEW_EXT_stencil_two_side = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_stencil_two_side */ #ifdef GL_EXT_stencil_wrap GLEW_EXT_stencil_wrap = _glewSearchExtension("GL_EXT_stencil_wrap", extStart, extEnd); #endif /* GL_EXT_stencil_wrap */ #ifdef GL_EXT_subtexture GLEW_EXT_subtexture = _glewSearchExtension("GL_EXT_subtexture", extStart, extEnd); if (glewExperimental || GLEW_EXT_subtexture) GLEW_EXT_subtexture = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_subtexture */ #ifdef GL_EXT_texture GLEW_EXT_texture = _glewSearchExtension("GL_EXT_texture", extStart, extEnd); #endif /* GL_EXT_texture */ #ifdef GL_EXT_texture3D GLEW_EXT_texture3D = _glewSearchExtension("GL_EXT_texture3D", extStart, extEnd); if (glewExperimental || GLEW_EXT_texture3D) GLEW_EXT_texture3D = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_texture3D */ #ifdef GL_EXT_texture_array GLEW_EXT_texture_array = _glewSearchExtension("GL_EXT_texture_array", extStart, extEnd); if (glewExperimental || GLEW_EXT_texture_array) GLEW_EXT_texture_array = !_glewInit_GL_EXT_texture_array(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_texture_array */ #ifdef GL_EXT_texture_buffer_object GLEW_EXT_texture_buffer_object = _glewSearchExtension("GL_EXT_texture_buffer_object", extStart, extEnd); if (glewExperimental || GLEW_EXT_texture_buffer_object) GLEW_EXT_texture_buffer_object = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_texture_buffer_object */ #ifdef GL_EXT_texture_compression_dxt1 GLEW_EXT_texture_compression_dxt1 = _glewSearchExtension("GL_EXT_texture_compression_dxt1", extStart, extEnd); #endif /* GL_EXT_texture_compression_dxt1 */ #ifdef GL_EXT_texture_compression_latc GLEW_EXT_texture_compression_latc = _glewSearchExtension("GL_EXT_texture_compression_latc", extStart, extEnd); #endif /* GL_EXT_texture_compression_latc */ #ifdef GL_EXT_texture_compression_rgtc GLEW_EXT_texture_compression_rgtc = _glewSearchExtension("GL_EXT_texture_compression_rgtc", extStart, extEnd); #endif /* GL_EXT_texture_compression_rgtc */ #ifdef GL_EXT_texture_compression_s3tc GLEW_EXT_texture_compression_s3tc = _glewSearchExtension("GL_EXT_texture_compression_s3tc", extStart, extEnd); #endif /* GL_EXT_texture_compression_s3tc */ #ifdef GL_EXT_texture_cube_map GLEW_EXT_texture_cube_map = _glewSearchExtension("GL_EXT_texture_cube_map", extStart, extEnd); #endif /* GL_EXT_texture_cube_map */ #ifdef GL_EXT_texture_edge_clamp GLEW_EXT_texture_edge_clamp = _glewSearchExtension("GL_EXT_texture_edge_clamp", extStart, extEnd); #endif /* GL_EXT_texture_edge_clamp */ #ifdef GL_EXT_texture_env GLEW_EXT_texture_env = _glewSearchExtension("GL_EXT_texture_env", extStart, extEnd); #endif /* GL_EXT_texture_env */ #ifdef GL_EXT_texture_env_add GLEW_EXT_texture_env_add = _glewSearchExtension("GL_EXT_texture_env_add", extStart, extEnd); #endif /* GL_EXT_texture_env_add */ #ifdef GL_EXT_texture_env_combine GLEW_EXT_texture_env_combine = _glewSearchExtension("GL_EXT_texture_env_combine", extStart, extEnd); #endif /* GL_EXT_texture_env_combine */ #ifdef GL_EXT_texture_env_dot3 GLEW_EXT_texture_env_dot3 = _glewSearchExtension("GL_EXT_texture_env_dot3", extStart, extEnd); #endif /* GL_EXT_texture_env_dot3 */ #ifdef GL_EXT_texture_filter_anisotropic GLEW_EXT_texture_filter_anisotropic = _glewSearchExtension("GL_EXT_texture_filter_anisotropic", extStart, extEnd); #endif /* GL_EXT_texture_filter_anisotropic */ #ifdef GL_EXT_texture_filter_minmax GLEW_EXT_texture_filter_minmax = _glewSearchExtension("GL_EXT_texture_filter_minmax", extStart, extEnd); #endif /* GL_EXT_texture_filter_minmax */ #ifdef GL_EXT_texture_integer GLEW_EXT_texture_integer = _glewSearchExtension("GL_EXT_texture_integer", extStart, extEnd); if (glewExperimental || GLEW_EXT_texture_integer) GLEW_EXT_texture_integer = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_texture_integer */ #ifdef GL_EXT_texture_lod_bias GLEW_EXT_texture_lod_bias = _glewSearchExtension("GL_EXT_texture_lod_bias", extStart, extEnd); #endif /* GL_EXT_texture_lod_bias */ #ifdef GL_EXT_texture_mirror_clamp GLEW_EXT_texture_mirror_clamp = _glewSearchExtension("GL_EXT_texture_mirror_clamp", extStart, extEnd); #endif /* GL_EXT_texture_mirror_clamp */ #ifdef GL_EXT_texture_object GLEW_EXT_texture_object = _glewSearchExtension("GL_EXT_texture_object", extStart, extEnd); if (glewExperimental || GLEW_EXT_texture_object) GLEW_EXT_texture_object = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_texture_object */ #ifdef GL_EXT_texture_perturb_normal GLEW_EXT_texture_perturb_normal = _glewSearchExtension("GL_EXT_texture_perturb_normal", extStart, extEnd); if (glewExperimental || GLEW_EXT_texture_perturb_normal) GLEW_EXT_texture_perturb_normal = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_texture_perturb_normal */ #ifdef GL_EXT_texture_rectangle GLEW_EXT_texture_rectangle = _glewSearchExtension("GL_EXT_texture_rectangle", extStart, extEnd); #endif /* GL_EXT_texture_rectangle */ #ifdef GL_EXT_texture_sRGB GLEW_EXT_texture_sRGB = _glewSearchExtension("GL_EXT_texture_sRGB", extStart, extEnd); #endif /* GL_EXT_texture_sRGB */ #ifdef GL_EXT_texture_sRGB_decode GLEW_EXT_texture_sRGB_decode = _glewSearchExtension("GL_EXT_texture_sRGB_decode", extStart, extEnd); #endif /* GL_EXT_texture_sRGB_decode */ #ifdef GL_EXT_texture_shared_exponent GLEW_EXT_texture_shared_exponent = _glewSearchExtension("GL_EXT_texture_shared_exponent", extStart, extEnd); #endif /* GL_EXT_texture_shared_exponent */ #ifdef GL_EXT_texture_snorm GLEW_EXT_texture_snorm = _glewSearchExtension("GL_EXT_texture_snorm", extStart, extEnd); #endif /* GL_EXT_texture_snorm */ #ifdef GL_EXT_texture_swizzle GLEW_EXT_texture_swizzle = _glewSearchExtension("GL_EXT_texture_swizzle", extStart, extEnd); #endif /* GL_EXT_texture_swizzle */ #ifdef GL_EXT_timer_query GLEW_EXT_timer_query = _glewSearchExtension("GL_EXT_timer_query", extStart, extEnd); if (glewExperimental || GLEW_EXT_timer_query) GLEW_EXT_timer_query = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_timer_query */ #ifdef GL_EXT_transform_feedback GLEW_EXT_transform_feedback = _glewSearchExtension("GL_EXT_transform_feedback", extStart, extEnd); if (glewExperimental || GLEW_EXT_transform_feedback) GLEW_EXT_transform_feedback = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_transform_feedback */ #ifdef GL_EXT_vertex_array GLEW_EXT_vertex_array = _glewSearchExtension("GL_EXT_vertex_array", extStart, extEnd); if (glewExperimental || GLEW_EXT_vertex_array) GLEW_EXT_vertex_array = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_vertex_array */ #ifdef GL_EXT_vertex_array_bgra GLEW_EXT_vertex_array_bgra = _glewSearchExtension("GL_EXT_vertex_array_bgra", extStart, extEnd); #endif /* GL_EXT_vertex_array_bgra */ #ifdef GL_EXT_vertex_attrib_64bit GLEW_EXT_vertex_attrib_64bit = _glewSearchExtension("GL_EXT_vertex_attrib_64bit", extStart, extEnd); if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) GLEW_EXT_vertex_attrib_64bit = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_vertex_attrib_64bit */ #ifdef GL_EXT_vertex_shader GLEW_EXT_vertex_shader = _glewSearchExtension("GL_EXT_vertex_shader", extStart, extEnd); if (glewExperimental || GLEW_EXT_vertex_shader) GLEW_EXT_vertex_shader = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_vertex_shader */ #ifdef GL_EXT_vertex_weighting GLEW_EXT_vertex_weighting = _glewSearchExtension("GL_EXT_vertex_weighting", extStart, extEnd); if (glewExperimental || GLEW_EXT_vertex_weighting) GLEW_EXT_vertex_weighting = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_vertex_weighting */ #ifdef GL_EXT_x11_sync_object GLEW_EXT_x11_sync_object = _glewSearchExtension("GL_EXT_x11_sync_object", extStart, extEnd); if (glewExperimental || GLEW_EXT_x11_sync_object) GLEW_EXT_x11_sync_object = !_glewInit_GL_EXT_x11_sync_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_EXT_x11_sync_object */ #ifdef GL_GREMEDY_frame_terminator GLEW_GREMEDY_frame_terminator = _glewSearchExtension("GL_GREMEDY_frame_terminator", extStart, extEnd); if (glewExperimental || GLEW_GREMEDY_frame_terminator) GLEW_GREMEDY_frame_terminator = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_GREMEDY_frame_terminator */ #ifdef GL_GREMEDY_string_marker GLEW_GREMEDY_string_marker = _glewSearchExtension("GL_GREMEDY_string_marker", extStart, extEnd); if (glewExperimental || GLEW_GREMEDY_string_marker) GLEW_GREMEDY_string_marker = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_GREMEDY_string_marker */ #ifdef GL_HP_convolution_border_modes GLEW_HP_convolution_border_modes = _glewSearchExtension("GL_HP_convolution_border_modes", extStart, extEnd); #endif /* GL_HP_convolution_border_modes */ #ifdef GL_HP_image_transform GLEW_HP_image_transform = _glewSearchExtension("GL_HP_image_transform", extStart, extEnd); if (glewExperimental || GLEW_HP_image_transform) GLEW_HP_image_transform = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_HP_image_transform */ #ifdef GL_HP_occlusion_test GLEW_HP_occlusion_test = _glewSearchExtension("GL_HP_occlusion_test", extStart, extEnd); #endif /* GL_HP_occlusion_test */ #ifdef GL_HP_texture_lighting GLEW_HP_texture_lighting = _glewSearchExtension("GL_HP_texture_lighting", extStart, extEnd); #endif /* GL_HP_texture_lighting */ #ifdef GL_IBM_cull_vertex GLEW_IBM_cull_vertex = _glewSearchExtension("GL_IBM_cull_vertex", extStart, extEnd); #endif /* GL_IBM_cull_vertex */ #ifdef GL_IBM_multimode_draw_arrays GLEW_IBM_multimode_draw_arrays = _glewSearchExtension("GL_IBM_multimode_draw_arrays", extStart, extEnd); if (glewExperimental || GLEW_IBM_multimode_draw_arrays) GLEW_IBM_multimode_draw_arrays = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_IBM_multimode_draw_arrays */ #ifdef GL_IBM_rasterpos_clip GLEW_IBM_rasterpos_clip = _glewSearchExtension("GL_IBM_rasterpos_clip", extStart, extEnd); #endif /* GL_IBM_rasterpos_clip */ #ifdef GL_IBM_static_data GLEW_IBM_static_data = _glewSearchExtension("GL_IBM_static_data", extStart, extEnd); #endif /* GL_IBM_static_data */ #ifdef GL_IBM_texture_mirrored_repeat GLEW_IBM_texture_mirrored_repeat = _glewSearchExtension("GL_IBM_texture_mirrored_repeat", extStart, extEnd); #endif /* GL_IBM_texture_mirrored_repeat */ #ifdef GL_IBM_vertex_array_lists GLEW_IBM_vertex_array_lists = _glewSearchExtension("GL_IBM_vertex_array_lists", extStart, extEnd); if (glewExperimental || GLEW_IBM_vertex_array_lists) GLEW_IBM_vertex_array_lists = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_IBM_vertex_array_lists */ #ifdef GL_INGR_color_clamp GLEW_INGR_color_clamp = _glewSearchExtension("GL_INGR_color_clamp", extStart, extEnd); #endif /* GL_INGR_color_clamp */ #ifdef GL_INGR_interlace_read GLEW_INGR_interlace_read = _glewSearchExtension("GL_INGR_interlace_read", extStart, extEnd); #endif /* GL_INGR_interlace_read */ #ifdef GL_INTEL_fragment_shader_ordering GLEW_INTEL_fragment_shader_ordering = _glewSearchExtension("GL_INTEL_fragment_shader_ordering", extStart, extEnd); #endif /* GL_INTEL_fragment_shader_ordering */ #ifdef GL_INTEL_framebuffer_CMAA GLEW_INTEL_framebuffer_CMAA = _glewSearchExtension("GL_INTEL_framebuffer_CMAA", extStart, extEnd); #endif /* GL_INTEL_framebuffer_CMAA */ #ifdef GL_INTEL_map_texture GLEW_INTEL_map_texture = _glewSearchExtension("GL_INTEL_map_texture", extStart, extEnd); if (glewExperimental || GLEW_INTEL_map_texture) GLEW_INTEL_map_texture = !_glewInit_GL_INTEL_map_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_INTEL_map_texture */ #ifdef GL_INTEL_parallel_arrays GLEW_INTEL_parallel_arrays = _glewSearchExtension("GL_INTEL_parallel_arrays", extStart, extEnd); if (glewExperimental || GLEW_INTEL_parallel_arrays) GLEW_INTEL_parallel_arrays = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_INTEL_parallel_arrays */ #ifdef GL_INTEL_performance_query GLEW_INTEL_performance_query = _glewSearchExtension("GL_INTEL_performance_query", extStart, extEnd); if (glewExperimental || GLEW_INTEL_performance_query) GLEW_INTEL_performance_query = !_glewInit_GL_INTEL_performance_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_INTEL_performance_query */ #ifdef GL_INTEL_texture_scissor GLEW_INTEL_texture_scissor = _glewSearchExtension("GL_INTEL_texture_scissor", extStart, extEnd); if (glewExperimental || GLEW_INTEL_texture_scissor) GLEW_INTEL_texture_scissor = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_INTEL_texture_scissor */ #ifdef GL_KHR_blend_equation_advanced GLEW_KHR_blend_equation_advanced = _glewSearchExtension("GL_KHR_blend_equation_advanced", extStart, extEnd); if (glewExperimental || GLEW_KHR_blend_equation_advanced) GLEW_KHR_blend_equation_advanced = !_glewInit_GL_KHR_blend_equation_advanced(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_KHR_blend_equation_advanced */ #ifdef GL_KHR_blend_equation_advanced_coherent GLEW_KHR_blend_equation_advanced_coherent = _glewSearchExtension("GL_KHR_blend_equation_advanced_coherent", extStart, extEnd); #endif /* GL_KHR_blend_equation_advanced_coherent */ #ifdef GL_KHR_context_flush_control GLEW_KHR_context_flush_control = _glewSearchExtension("GL_KHR_context_flush_control", extStart, extEnd); #endif /* GL_KHR_context_flush_control */ #ifdef GL_KHR_debug GLEW_KHR_debug = _glewSearchExtension("GL_KHR_debug", extStart, extEnd); if (glewExperimental || GLEW_KHR_debug) GLEW_KHR_debug = !_glewInit_GL_KHR_debug(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_KHR_debug */ #ifdef GL_KHR_no_error GLEW_KHR_no_error = _glewSearchExtension("GL_KHR_no_error", extStart, extEnd); #endif /* GL_KHR_no_error */ #ifdef GL_KHR_robust_buffer_access_behavior GLEW_KHR_robust_buffer_access_behavior = _glewSearchExtension("GL_KHR_robust_buffer_access_behavior", extStart, extEnd); #endif /* GL_KHR_robust_buffer_access_behavior */ #ifdef GL_KHR_robustness GLEW_KHR_robustness = _glewSearchExtension("GL_KHR_robustness", extStart, extEnd); if (glewExperimental || GLEW_KHR_robustness) GLEW_KHR_robustness = !_glewInit_GL_KHR_robustness(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_KHR_robustness */ #ifdef GL_KHR_texture_compression_astc_hdr GLEW_KHR_texture_compression_astc_hdr = _glewSearchExtension("GL_KHR_texture_compression_astc_hdr", extStart, extEnd); #endif /* GL_KHR_texture_compression_astc_hdr */ #ifdef GL_KHR_texture_compression_astc_ldr GLEW_KHR_texture_compression_astc_ldr = _glewSearchExtension("GL_KHR_texture_compression_astc_ldr", extStart, extEnd); #endif /* GL_KHR_texture_compression_astc_ldr */ #ifdef GL_KTX_buffer_region GLEW_KTX_buffer_region = _glewSearchExtension("GL_KTX_buffer_region", extStart, extEnd); if (glewExperimental || GLEW_KTX_buffer_region) GLEW_KTX_buffer_region = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_KTX_buffer_region */ #ifdef GL_MESAX_texture_stack GLEW_MESAX_texture_stack = _glewSearchExtension("GL_MESAX_texture_stack", extStart, extEnd); #endif /* GL_MESAX_texture_stack */ #ifdef GL_MESA_pack_invert GLEW_MESA_pack_invert = _glewSearchExtension("GL_MESA_pack_invert", extStart, extEnd); #endif /* GL_MESA_pack_invert */ #ifdef GL_MESA_resize_buffers GLEW_MESA_resize_buffers = _glewSearchExtension("GL_MESA_resize_buffers", extStart, extEnd); if (glewExperimental || GLEW_MESA_resize_buffers) GLEW_MESA_resize_buffers = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_MESA_resize_buffers */ #ifdef GL_MESA_window_pos GLEW_MESA_window_pos = _glewSearchExtension("GL_MESA_window_pos", extStart, extEnd); if (glewExperimental || GLEW_MESA_window_pos) GLEW_MESA_window_pos = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_MESA_window_pos */ #ifdef GL_MESA_ycbcr_texture GLEW_MESA_ycbcr_texture = _glewSearchExtension("GL_MESA_ycbcr_texture", extStart, extEnd); #endif /* GL_MESA_ycbcr_texture */ #ifdef GL_NVX_conditional_render GLEW_NVX_conditional_render = _glewSearchExtension("GL_NVX_conditional_render", extStart, extEnd); if (glewExperimental || GLEW_NVX_conditional_render) GLEW_NVX_conditional_render = !_glewInit_GL_NVX_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NVX_conditional_render */ #ifdef GL_NVX_gpu_memory_info GLEW_NVX_gpu_memory_info = _glewSearchExtension("GL_NVX_gpu_memory_info", extStart, extEnd); #endif /* GL_NVX_gpu_memory_info */ #ifdef GL_NV_bindless_multi_draw_indirect GLEW_NV_bindless_multi_draw_indirect = _glewSearchExtension("GL_NV_bindless_multi_draw_indirect", extStart, extEnd); if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect) GLEW_NV_bindless_multi_draw_indirect = !_glewInit_GL_NV_bindless_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_bindless_multi_draw_indirect */ #ifdef GL_NV_bindless_multi_draw_indirect_count GLEW_NV_bindless_multi_draw_indirect_count = _glewSearchExtension("GL_NV_bindless_multi_draw_indirect_count", extStart, extEnd); if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect_count) GLEW_NV_bindless_multi_draw_indirect_count = !_glewInit_GL_NV_bindless_multi_draw_indirect_count(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_bindless_multi_draw_indirect_count */ #ifdef GL_NV_bindless_texture GLEW_NV_bindless_texture = _glewSearchExtension("GL_NV_bindless_texture", extStart, extEnd); if (glewExperimental || GLEW_NV_bindless_texture) GLEW_NV_bindless_texture = !_glewInit_GL_NV_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_bindless_texture */ #ifdef GL_NV_blend_equation_advanced GLEW_NV_blend_equation_advanced = _glewSearchExtension("GL_NV_blend_equation_advanced", extStart, extEnd); if (glewExperimental || GLEW_NV_blend_equation_advanced) GLEW_NV_blend_equation_advanced = !_glewInit_GL_NV_blend_equation_advanced(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_blend_equation_advanced */ #ifdef GL_NV_blend_equation_advanced_coherent GLEW_NV_blend_equation_advanced_coherent = _glewSearchExtension("GL_NV_blend_equation_advanced_coherent", extStart, extEnd); #endif /* GL_NV_blend_equation_advanced_coherent */ #ifdef GL_NV_blend_square GLEW_NV_blend_square = _glewSearchExtension("GL_NV_blend_square", extStart, extEnd); #endif /* GL_NV_blend_square */ #ifdef GL_NV_compute_program5 GLEW_NV_compute_program5 = _glewSearchExtension("GL_NV_compute_program5", extStart, extEnd); #endif /* GL_NV_compute_program5 */ #ifdef GL_NV_conditional_render GLEW_NV_conditional_render = _glewSearchExtension("GL_NV_conditional_render", extStart, extEnd); if (glewExperimental || GLEW_NV_conditional_render) GLEW_NV_conditional_render = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_conditional_render */ #ifdef GL_NV_conservative_raster GLEW_NV_conservative_raster = _glewSearchExtension("GL_NV_conservative_raster", extStart, extEnd); if (glewExperimental || GLEW_NV_conservative_raster) GLEW_NV_conservative_raster = !_glewInit_GL_NV_conservative_raster(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_conservative_raster */ #ifdef GL_NV_conservative_raster_dilate GLEW_NV_conservative_raster_dilate = _glewSearchExtension("GL_NV_conservative_raster_dilate", extStart, extEnd); if (glewExperimental || GLEW_NV_conservative_raster_dilate) GLEW_NV_conservative_raster_dilate = !_glewInit_GL_NV_conservative_raster_dilate(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_conservative_raster_dilate */ #ifdef GL_NV_copy_depth_to_color GLEW_NV_copy_depth_to_color = _glewSearchExtension("GL_NV_copy_depth_to_color", extStart, extEnd); #endif /* GL_NV_copy_depth_to_color */ #ifdef GL_NV_copy_image GLEW_NV_copy_image = _glewSearchExtension("GL_NV_copy_image", extStart, extEnd); if (glewExperimental || GLEW_NV_copy_image) GLEW_NV_copy_image = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_copy_image */ #ifdef GL_NV_deep_texture3D GLEW_NV_deep_texture3D = _glewSearchExtension("GL_NV_deep_texture3D", extStart, extEnd); #endif /* GL_NV_deep_texture3D */ #ifdef GL_NV_depth_buffer_float GLEW_NV_depth_buffer_float = _glewSearchExtension("GL_NV_depth_buffer_float", extStart, extEnd); if (glewExperimental || GLEW_NV_depth_buffer_float) GLEW_NV_depth_buffer_float = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_depth_buffer_float */ #ifdef GL_NV_depth_clamp GLEW_NV_depth_clamp = _glewSearchExtension("GL_NV_depth_clamp", extStart, extEnd); #endif /* GL_NV_depth_clamp */ #ifdef GL_NV_depth_range_unclamped GLEW_NV_depth_range_unclamped = _glewSearchExtension("GL_NV_depth_range_unclamped", extStart, extEnd); #endif /* GL_NV_depth_range_unclamped */ #ifdef GL_NV_draw_texture GLEW_NV_draw_texture = _glewSearchExtension("GL_NV_draw_texture", extStart, extEnd); if (glewExperimental || GLEW_NV_draw_texture) GLEW_NV_draw_texture = !_glewInit_GL_NV_draw_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_draw_texture */ #ifdef GL_NV_evaluators GLEW_NV_evaluators = _glewSearchExtension("GL_NV_evaluators", extStart, extEnd); if (glewExperimental || GLEW_NV_evaluators) GLEW_NV_evaluators = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_evaluators */ #ifdef GL_NV_explicit_multisample GLEW_NV_explicit_multisample = _glewSearchExtension("GL_NV_explicit_multisample", extStart, extEnd); if (glewExperimental || GLEW_NV_explicit_multisample) GLEW_NV_explicit_multisample = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_explicit_multisample */ #ifdef GL_NV_fence GLEW_NV_fence = _glewSearchExtension("GL_NV_fence", extStart, extEnd); if (glewExperimental || GLEW_NV_fence) GLEW_NV_fence = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_fence */ #ifdef GL_NV_fill_rectangle GLEW_NV_fill_rectangle = _glewSearchExtension("GL_NV_fill_rectangle", extStart, extEnd); #endif /* GL_NV_fill_rectangle */ #ifdef GL_NV_float_buffer GLEW_NV_float_buffer = _glewSearchExtension("GL_NV_float_buffer", extStart, extEnd); #endif /* GL_NV_float_buffer */ #ifdef GL_NV_fog_distance GLEW_NV_fog_distance = _glewSearchExtension("GL_NV_fog_distance", extStart, extEnd); #endif /* GL_NV_fog_distance */ #ifdef GL_NV_fragment_coverage_to_color GLEW_NV_fragment_coverage_to_color = _glewSearchExtension("GL_NV_fragment_coverage_to_color", extStart, extEnd); if (glewExperimental || GLEW_NV_fragment_coverage_to_color) GLEW_NV_fragment_coverage_to_color = !_glewInit_GL_NV_fragment_coverage_to_color(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_fragment_coverage_to_color */ #ifdef GL_NV_fragment_program GLEW_NV_fragment_program = _glewSearchExtension("GL_NV_fragment_program", extStart, extEnd); if (glewExperimental || GLEW_NV_fragment_program) GLEW_NV_fragment_program = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_fragment_program */ #ifdef GL_NV_fragment_program2 GLEW_NV_fragment_program2 = _glewSearchExtension("GL_NV_fragment_program2", extStart, extEnd); #endif /* GL_NV_fragment_program2 */ #ifdef GL_NV_fragment_program4 GLEW_NV_fragment_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); #endif /* GL_NV_fragment_program4 */ #ifdef GL_NV_fragment_program_option GLEW_NV_fragment_program_option = _glewSearchExtension("GL_NV_fragment_program_option", extStart, extEnd); #endif /* GL_NV_fragment_program_option */ #ifdef GL_NV_fragment_shader_interlock GLEW_NV_fragment_shader_interlock = _glewSearchExtension("GL_NV_fragment_shader_interlock", extStart, extEnd); #endif /* GL_NV_fragment_shader_interlock */ #ifdef GL_NV_framebuffer_mixed_samples GLEW_NV_framebuffer_mixed_samples = _glewSearchExtension("GL_NV_framebuffer_mixed_samples", extStart, extEnd); #endif /* GL_NV_framebuffer_mixed_samples */ #ifdef GL_NV_framebuffer_multisample_coverage GLEW_NV_framebuffer_multisample_coverage = _glewSearchExtension("GL_NV_framebuffer_multisample_coverage", extStart, extEnd); if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) GLEW_NV_framebuffer_multisample_coverage = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_framebuffer_multisample_coverage */ #ifdef GL_NV_geometry_program4 GLEW_NV_geometry_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); if (glewExperimental || GLEW_NV_geometry_program4) GLEW_NV_geometry_program4 = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_geometry_program4 */ #ifdef GL_NV_geometry_shader4 GLEW_NV_geometry_shader4 = _glewSearchExtension("GL_NV_geometry_shader4", extStart, extEnd); #endif /* GL_NV_geometry_shader4 */ #ifdef GL_NV_geometry_shader_passthrough GLEW_NV_geometry_shader_passthrough = _glewSearchExtension("GL_NV_geometry_shader_passthrough", extStart, extEnd); #endif /* GL_NV_geometry_shader_passthrough */ #ifdef GL_NV_gpu_program4 GLEW_NV_gpu_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); if (glewExperimental || GLEW_NV_gpu_program4) GLEW_NV_gpu_program4 = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_gpu_program4 */ #ifdef GL_NV_gpu_program5 GLEW_NV_gpu_program5 = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); #endif /* GL_NV_gpu_program5 */ #ifdef GL_NV_gpu_program5_mem_extended GLEW_NV_gpu_program5_mem_extended = _glewSearchExtension("GL_NV_gpu_program5_mem_extended", extStart, extEnd); #endif /* GL_NV_gpu_program5_mem_extended */ #ifdef GL_NV_gpu_program_fp64 GLEW_NV_gpu_program_fp64 = _glewSearchExtension("GL_NV_gpu_program_fp64", extStart, extEnd); #endif /* GL_NV_gpu_program_fp64 */ #ifdef GL_NV_gpu_shader5 GLEW_NV_gpu_shader5 = _glewSearchExtension("GL_NV_gpu_shader5", extStart, extEnd); if (glewExperimental || GLEW_NV_gpu_shader5) GLEW_NV_gpu_shader5 = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_gpu_shader5 */ #ifdef GL_NV_half_float GLEW_NV_half_float = _glewSearchExtension("GL_NV_half_float", extStart, extEnd); if (glewExperimental || GLEW_NV_half_float) GLEW_NV_half_float = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_half_float */ #ifdef GL_NV_internalformat_sample_query GLEW_NV_internalformat_sample_query = _glewSearchExtension("GL_NV_internalformat_sample_query", extStart, extEnd); if (glewExperimental || GLEW_NV_internalformat_sample_query) GLEW_NV_internalformat_sample_query = !_glewInit_GL_NV_internalformat_sample_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_internalformat_sample_query */ #ifdef GL_NV_light_max_exponent GLEW_NV_light_max_exponent = _glewSearchExtension("GL_NV_light_max_exponent", extStart, extEnd); #endif /* GL_NV_light_max_exponent */ #ifdef GL_NV_multisample_coverage GLEW_NV_multisample_coverage = _glewSearchExtension("GL_NV_multisample_coverage", extStart, extEnd); #endif /* GL_NV_multisample_coverage */ #ifdef GL_NV_multisample_filter_hint GLEW_NV_multisample_filter_hint = _glewSearchExtension("GL_NV_multisample_filter_hint", extStart, extEnd); #endif /* GL_NV_multisample_filter_hint */ #ifdef GL_NV_occlusion_query GLEW_NV_occlusion_query = _glewSearchExtension("GL_NV_occlusion_query", extStart, extEnd); if (glewExperimental || GLEW_NV_occlusion_query) GLEW_NV_occlusion_query = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_occlusion_query */ #ifdef GL_NV_packed_depth_stencil GLEW_NV_packed_depth_stencil = _glewSearchExtension("GL_NV_packed_depth_stencil", extStart, extEnd); #endif /* GL_NV_packed_depth_stencil */ #ifdef GL_NV_parameter_buffer_object GLEW_NV_parameter_buffer_object = _glewSearchExtension("GL_NV_parameter_buffer_object", extStart, extEnd); if (glewExperimental || GLEW_NV_parameter_buffer_object) GLEW_NV_parameter_buffer_object = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_parameter_buffer_object */ #ifdef GL_NV_parameter_buffer_object2 GLEW_NV_parameter_buffer_object2 = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd); #endif /* GL_NV_parameter_buffer_object2 */ #ifdef GL_NV_path_rendering GLEW_NV_path_rendering = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd); if (glewExperimental || GLEW_NV_path_rendering) GLEW_NV_path_rendering = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_path_rendering */ #ifdef GL_NV_path_rendering_shared_edge GLEW_NV_path_rendering_shared_edge = _glewSearchExtension("GL_NV_path_rendering_shared_edge", extStart, extEnd); #endif /* GL_NV_path_rendering_shared_edge */ #ifdef GL_NV_pixel_data_range GLEW_NV_pixel_data_range = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd); if (glewExperimental || GLEW_NV_pixel_data_range) GLEW_NV_pixel_data_range = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_pixel_data_range */ #ifdef GL_NV_point_sprite GLEW_NV_point_sprite = _glewSearchExtension("GL_NV_point_sprite", extStart, extEnd); if (glewExperimental || GLEW_NV_point_sprite) GLEW_NV_point_sprite = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_point_sprite */ #ifdef GL_NV_present_video GLEW_NV_present_video = _glewSearchExtension("GL_NV_present_video", extStart, extEnd); if (glewExperimental || GLEW_NV_present_video) GLEW_NV_present_video = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_present_video */ #ifdef GL_NV_primitive_restart GLEW_NV_primitive_restart = _glewSearchExtension("GL_NV_primitive_restart", extStart, extEnd); if (glewExperimental || GLEW_NV_primitive_restart) GLEW_NV_primitive_restart = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_primitive_restart */ #ifdef GL_NV_register_combiners GLEW_NV_register_combiners = _glewSearchExtension("GL_NV_register_combiners", extStart, extEnd); if (glewExperimental || GLEW_NV_register_combiners) GLEW_NV_register_combiners = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_register_combiners */ #ifdef GL_NV_register_combiners2 GLEW_NV_register_combiners2 = _glewSearchExtension("GL_NV_register_combiners2", extStart, extEnd); if (glewExperimental || GLEW_NV_register_combiners2) GLEW_NV_register_combiners2 = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_register_combiners2 */ #ifdef GL_NV_sample_locations GLEW_NV_sample_locations = _glewSearchExtension("GL_NV_sample_locations", extStart, extEnd); if (glewExperimental || GLEW_NV_sample_locations) GLEW_NV_sample_locations = !_glewInit_GL_NV_sample_locations(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_sample_locations */ #ifdef GL_NV_sample_mask_override_coverage GLEW_NV_sample_mask_override_coverage = _glewSearchExtension("GL_NV_sample_mask_override_coverage", extStart, extEnd); #endif /* GL_NV_sample_mask_override_coverage */ #ifdef GL_NV_shader_atomic_counters GLEW_NV_shader_atomic_counters = _glewSearchExtension("GL_NV_shader_atomic_counters", extStart, extEnd); #endif /* GL_NV_shader_atomic_counters */ #ifdef GL_NV_shader_atomic_float GLEW_NV_shader_atomic_float = _glewSearchExtension("GL_NV_shader_atomic_float", extStart, extEnd); #endif /* GL_NV_shader_atomic_float */ #ifdef GL_NV_shader_atomic_fp16_vector GLEW_NV_shader_atomic_fp16_vector = _glewSearchExtension("GL_NV_shader_atomic_fp16_vector", extStart, extEnd); #endif /* GL_NV_shader_atomic_fp16_vector */ #ifdef GL_NV_shader_atomic_int64 GLEW_NV_shader_atomic_int64 = _glewSearchExtension("GL_NV_shader_atomic_int64", extStart, extEnd); #endif /* GL_NV_shader_atomic_int64 */ #ifdef GL_NV_shader_buffer_load GLEW_NV_shader_buffer_load = _glewSearchExtension("GL_NV_shader_buffer_load", extStart, extEnd); if (glewExperimental || GLEW_NV_shader_buffer_load) GLEW_NV_shader_buffer_load = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_shader_buffer_load */ #ifdef GL_NV_shader_storage_buffer_object GLEW_NV_shader_storage_buffer_object = _glewSearchExtension("GL_NV_shader_storage_buffer_object", extStart, extEnd); #endif /* GL_NV_shader_storage_buffer_object */ #ifdef GL_NV_shader_thread_group GLEW_NV_shader_thread_group = _glewSearchExtension("GL_NV_shader_thread_group", extStart, extEnd); #endif /* GL_NV_shader_thread_group */ #ifdef GL_NV_shader_thread_shuffle GLEW_NV_shader_thread_shuffle = _glewSearchExtension("GL_NV_shader_thread_shuffle", extStart, extEnd); #endif /* GL_NV_shader_thread_shuffle */ #ifdef GL_NV_tessellation_program5 GLEW_NV_tessellation_program5 = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); #endif /* GL_NV_tessellation_program5 */ #ifdef GL_NV_texgen_emboss GLEW_NV_texgen_emboss = _glewSearchExtension("GL_NV_texgen_emboss", extStart, extEnd); #endif /* GL_NV_texgen_emboss */ #ifdef GL_NV_texgen_reflection GLEW_NV_texgen_reflection = _glewSearchExtension("GL_NV_texgen_reflection", extStart, extEnd); #endif /* GL_NV_texgen_reflection */ #ifdef GL_NV_texture_barrier GLEW_NV_texture_barrier = _glewSearchExtension("GL_NV_texture_barrier", extStart, extEnd); if (glewExperimental || GLEW_NV_texture_barrier) GLEW_NV_texture_barrier = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_texture_barrier */ #ifdef GL_NV_texture_compression_vtc GLEW_NV_texture_compression_vtc = _glewSearchExtension("GL_NV_texture_compression_vtc", extStart, extEnd); #endif /* GL_NV_texture_compression_vtc */ #ifdef GL_NV_texture_env_combine4 GLEW_NV_texture_env_combine4 = _glewSearchExtension("GL_NV_texture_env_combine4", extStart, extEnd); #endif /* GL_NV_texture_env_combine4 */ #ifdef GL_NV_texture_expand_normal GLEW_NV_texture_expand_normal = _glewSearchExtension("GL_NV_texture_expand_normal", extStart, extEnd); #endif /* GL_NV_texture_expand_normal */ #ifdef GL_NV_texture_multisample GLEW_NV_texture_multisample = _glewSearchExtension("GL_NV_texture_multisample", extStart, extEnd); if (glewExperimental || GLEW_NV_texture_multisample) GLEW_NV_texture_multisample = !_glewInit_GL_NV_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_texture_multisample */ #ifdef GL_NV_texture_rectangle GLEW_NV_texture_rectangle = _glewSearchExtension("GL_NV_texture_rectangle", extStart, extEnd); #endif /* GL_NV_texture_rectangle */ #ifdef GL_NV_texture_shader GLEW_NV_texture_shader = _glewSearchExtension("GL_NV_texture_shader", extStart, extEnd); #endif /* GL_NV_texture_shader */ #ifdef GL_NV_texture_shader2 GLEW_NV_texture_shader2 = _glewSearchExtension("GL_NV_texture_shader2", extStart, extEnd); #endif /* GL_NV_texture_shader2 */ #ifdef GL_NV_texture_shader3 GLEW_NV_texture_shader3 = _glewSearchExtension("GL_NV_texture_shader3", extStart, extEnd); #endif /* GL_NV_texture_shader3 */ #ifdef GL_NV_transform_feedback GLEW_NV_transform_feedback = _glewSearchExtension("GL_NV_transform_feedback", extStart, extEnd); if (glewExperimental || GLEW_NV_transform_feedback) GLEW_NV_transform_feedback = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_transform_feedback */ #ifdef GL_NV_transform_feedback2 GLEW_NV_transform_feedback2 = _glewSearchExtension("GL_NV_transform_feedback2", extStart, extEnd); if (glewExperimental || GLEW_NV_transform_feedback2) GLEW_NV_transform_feedback2 = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_transform_feedback2 */ #ifdef GL_NV_uniform_buffer_unified_memory GLEW_NV_uniform_buffer_unified_memory = _glewSearchExtension("GL_NV_uniform_buffer_unified_memory", extStart, extEnd); #endif /* GL_NV_uniform_buffer_unified_memory */ #ifdef GL_NV_vdpau_interop GLEW_NV_vdpau_interop = _glewSearchExtension("GL_NV_vdpau_interop", extStart, extEnd); if (glewExperimental || GLEW_NV_vdpau_interop) GLEW_NV_vdpau_interop = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_vdpau_interop */ #ifdef GL_NV_vertex_array_range GLEW_NV_vertex_array_range = _glewSearchExtension("GL_NV_vertex_array_range", extStart, extEnd); if (glewExperimental || GLEW_NV_vertex_array_range) GLEW_NV_vertex_array_range = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_vertex_array_range */ #ifdef GL_NV_vertex_array_range2 GLEW_NV_vertex_array_range2 = _glewSearchExtension("GL_NV_vertex_array_range2", extStart, extEnd); #endif /* GL_NV_vertex_array_range2 */ #ifdef GL_NV_vertex_attrib_integer_64bit GLEW_NV_vertex_attrib_integer_64bit = _glewSearchExtension("GL_NV_vertex_attrib_integer_64bit", extStart, extEnd); if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) GLEW_NV_vertex_attrib_integer_64bit = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_vertex_attrib_integer_64bit */ #ifdef GL_NV_vertex_buffer_unified_memory GLEW_NV_vertex_buffer_unified_memory = _glewSearchExtension("GL_NV_vertex_buffer_unified_memory", extStart, extEnd); if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) GLEW_NV_vertex_buffer_unified_memory = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_vertex_buffer_unified_memory */ #ifdef GL_NV_vertex_program GLEW_NV_vertex_program = _glewSearchExtension("GL_NV_vertex_program", extStart, extEnd); if (glewExperimental || GLEW_NV_vertex_program) GLEW_NV_vertex_program = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_vertex_program */ #ifdef GL_NV_vertex_program1_1 GLEW_NV_vertex_program1_1 = _glewSearchExtension("GL_NV_vertex_program1_1", extStart, extEnd); #endif /* GL_NV_vertex_program1_1 */ #ifdef GL_NV_vertex_program2 GLEW_NV_vertex_program2 = _glewSearchExtension("GL_NV_vertex_program2", extStart, extEnd); #endif /* GL_NV_vertex_program2 */ #ifdef GL_NV_vertex_program2_option GLEW_NV_vertex_program2_option = _glewSearchExtension("GL_NV_vertex_program2_option", extStart, extEnd); #endif /* GL_NV_vertex_program2_option */ #ifdef GL_NV_vertex_program3 GLEW_NV_vertex_program3 = _glewSearchExtension("GL_NV_vertex_program3", extStart, extEnd); #endif /* GL_NV_vertex_program3 */ #ifdef GL_NV_vertex_program4 GLEW_NV_vertex_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); #endif /* GL_NV_vertex_program4 */ #ifdef GL_NV_video_capture GLEW_NV_video_capture = _glewSearchExtension("GL_NV_video_capture", extStart, extEnd); if (glewExperimental || GLEW_NV_video_capture) GLEW_NV_video_capture = !_glewInit_GL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_NV_video_capture */ #ifdef GL_NV_viewport_array2 GLEW_NV_viewport_array2 = _glewSearchExtension("GL_NV_viewport_array2", extStart, extEnd); #endif /* GL_NV_viewport_array2 */ #ifdef GL_OES_byte_coordinates GLEW_OES_byte_coordinates = _glewSearchExtension("GL_OES_byte_coordinates", extStart, extEnd); #endif /* GL_OES_byte_coordinates */ #ifdef GL_OES_compressed_paletted_texture GLEW_OES_compressed_paletted_texture = _glewSearchExtension("GL_OES_compressed_paletted_texture", extStart, extEnd); #endif /* GL_OES_compressed_paletted_texture */ #ifdef GL_OES_read_format GLEW_OES_read_format = _glewSearchExtension("GL_OES_read_format", extStart, extEnd); #endif /* GL_OES_read_format */ #ifdef GL_OES_single_precision GLEW_OES_single_precision = _glewSearchExtension("GL_OES_single_precision", extStart, extEnd); if (glewExperimental || GLEW_OES_single_precision) GLEW_OES_single_precision = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_OES_single_precision */ #ifdef GL_OML_interlace GLEW_OML_interlace = _glewSearchExtension("GL_OML_interlace", extStart, extEnd); #endif /* GL_OML_interlace */ #ifdef GL_OML_resample GLEW_OML_resample = _glewSearchExtension("GL_OML_resample", extStart, extEnd); #endif /* GL_OML_resample */ #ifdef GL_OML_subsample GLEW_OML_subsample = _glewSearchExtension("GL_OML_subsample", extStart, extEnd); #endif /* GL_OML_subsample */ #ifdef GL_OVR_multiview GLEW_OVR_multiview = _glewSearchExtension("GL_OVR_multiview", extStart, extEnd); if (glewExperimental || GLEW_OVR_multiview) GLEW_OVR_multiview = !_glewInit_GL_OVR_multiview(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_OVR_multiview */ #ifdef GL_OVR_multiview2 GLEW_OVR_multiview2 = _glewSearchExtension("GL_OVR_multiview2", extStart, extEnd); #endif /* GL_OVR_multiview2 */ #ifdef GL_PGI_misc_hints GLEW_PGI_misc_hints = _glewSearchExtension("GL_PGI_misc_hints", extStart, extEnd); #endif /* GL_PGI_misc_hints */ #ifdef GL_PGI_vertex_hints GLEW_PGI_vertex_hints = _glewSearchExtension("GL_PGI_vertex_hints", extStart, extEnd); #endif /* GL_PGI_vertex_hints */ #ifdef GL_REGAL_ES1_0_compatibility GLEW_REGAL_ES1_0_compatibility = _glewSearchExtension("GL_REGAL_ES1_0_compatibility", extStart, extEnd); if (glewExperimental || GLEW_REGAL_ES1_0_compatibility) GLEW_REGAL_ES1_0_compatibility = !_glewInit_GL_REGAL_ES1_0_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_REGAL_ES1_0_compatibility */ #ifdef GL_REGAL_ES1_1_compatibility GLEW_REGAL_ES1_1_compatibility = _glewSearchExtension("GL_REGAL_ES1_1_compatibility", extStart, extEnd); if (glewExperimental || GLEW_REGAL_ES1_1_compatibility) GLEW_REGAL_ES1_1_compatibility = !_glewInit_GL_REGAL_ES1_1_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_REGAL_ES1_1_compatibility */ #ifdef GL_REGAL_enable GLEW_REGAL_enable = _glewSearchExtension("GL_REGAL_enable", extStart, extEnd); #endif /* GL_REGAL_enable */ #ifdef GL_REGAL_error_string GLEW_REGAL_error_string = _glewSearchExtension("GL_REGAL_error_string", extStart, extEnd); if (glewExperimental || GLEW_REGAL_error_string) GLEW_REGAL_error_string = !_glewInit_GL_REGAL_error_string(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_REGAL_error_string */ #ifdef GL_REGAL_extension_query GLEW_REGAL_extension_query = _glewSearchExtension("GL_REGAL_extension_query", extStart, extEnd); if (glewExperimental || GLEW_REGAL_extension_query) GLEW_REGAL_extension_query = !_glewInit_GL_REGAL_extension_query(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_REGAL_extension_query */ #ifdef GL_REGAL_log GLEW_REGAL_log = _glewSearchExtension("GL_REGAL_log", extStart, extEnd); if (glewExperimental || GLEW_REGAL_log) GLEW_REGAL_log = !_glewInit_GL_REGAL_log(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_REGAL_log */ #ifdef GL_REGAL_proc_address GLEW_REGAL_proc_address = _glewSearchExtension("GL_REGAL_proc_address", extStart, extEnd); if (glewExperimental || GLEW_REGAL_proc_address) GLEW_REGAL_proc_address = !_glewInit_GL_REGAL_proc_address(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_REGAL_proc_address */ #ifdef GL_REND_screen_coordinates GLEW_REND_screen_coordinates = _glewSearchExtension("GL_REND_screen_coordinates", extStart, extEnd); #endif /* GL_REND_screen_coordinates */ #ifdef GL_S3_s3tc GLEW_S3_s3tc = _glewSearchExtension("GL_S3_s3tc", extStart, extEnd); #endif /* GL_S3_s3tc */ #ifdef GL_SGIS_color_range GLEW_SGIS_color_range = _glewSearchExtension("GL_SGIS_color_range", extStart, extEnd); #endif /* GL_SGIS_color_range */ #ifdef GL_SGIS_detail_texture GLEW_SGIS_detail_texture = _glewSearchExtension("GL_SGIS_detail_texture", extStart, extEnd); if (glewExperimental || GLEW_SGIS_detail_texture) GLEW_SGIS_detail_texture = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIS_detail_texture */ #ifdef GL_SGIS_fog_function GLEW_SGIS_fog_function = _glewSearchExtension("GL_SGIS_fog_function", extStart, extEnd); if (glewExperimental || GLEW_SGIS_fog_function) GLEW_SGIS_fog_function = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIS_fog_function */ #ifdef GL_SGIS_generate_mipmap GLEW_SGIS_generate_mipmap = _glewSearchExtension("GL_SGIS_generate_mipmap", extStart, extEnd); #endif /* GL_SGIS_generate_mipmap */ #ifdef GL_SGIS_multisample GLEW_SGIS_multisample = _glewSearchExtension("GL_SGIS_multisample", extStart, extEnd); if (glewExperimental || GLEW_SGIS_multisample) GLEW_SGIS_multisample = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIS_multisample */ #ifdef GL_SGIS_pixel_texture GLEW_SGIS_pixel_texture = _glewSearchExtension("GL_SGIS_pixel_texture", extStart, extEnd); #endif /* GL_SGIS_pixel_texture */ #ifdef GL_SGIS_point_line_texgen GLEW_SGIS_point_line_texgen = _glewSearchExtension("GL_SGIS_point_line_texgen", extStart, extEnd); #endif /* GL_SGIS_point_line_texgen */ #ifdef GL_SGIS_sharpen_texture GLEW_SGIS_sharpen_texture = _glewSearchExtension("GL_SGIS_sharpen_texture", extStart, extEnd); if (glewExperimental || GLEW_SGIS_sharpen_texture) GLEW_SGIS_sharpen_texture = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIS_sharpen_texture */ #ifdef GL_SGIS_texture4D GLEW_SGIS_texture4D = _glewSearchExtension("GL_SGIS_texture4D", extStart, extEnd); if (glewExperimental || GLEW_SGIS_texture4D) GLEW_SGIS_texture4D = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIS_texture4D */ #ifdef GL_SGIS_texture_border_clamp GLEW_SGIS_texture_border_clamp = _glewSearchExtension("GL_SGIS_texture_border_clamp", extStart, extEnd); #endif /* GL_SGIS_texture_border_clamp */ #ifdef GL_SGIS_texture_edge_clamp GLEW_SGIS_texture_edge_clamp = _glewSearchExtension("GL_SGIS_texture_edge_clamp", extStart, extEnd); #endif /* GL_SGIS_texture_edge_clamp */ #ifdef GL_SGIS_texture_filter4 GLEW_SGIS_texture_filter4 = _glewSearchExtension("GL_SGIS_texture_filter4", extStart, extEnd); if (glewExperimental || GLEW_SGIS_texture_filter4) GLEW_SGIS_texture_filter4 = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIS_texture_filter4 */ #ifdef GL_SGIS_texture_lod GLEW_SGIS_texture_lod = _glewSearchExtension("GL_SGIS_texture_lod", extStart, extEnd); #endif /* GL_SGIS_texture_lod */ #ifdef GL_SGIS_texture_select GLEW_SGIS_texture_select = _glewSearchExtension("GL_SGIS_texture_select", extStart, extEnd); #endif /* GL_SGIS_texture_select */ #ifdef GL_SGIX_async GLEW_SGIX_async = _glewSearchExtension("GL_SGIX_async", extStart, extEnd); if (glewExperimental || GLEW_SGIX_async) GLEW_SGIX_async = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_async */ #ifdef GL_SGIX_async_histogram GLEW_SGIX_async_histogram = _glewSearchExtension("GL_SGIX_async_histogram", extStart, extEnd); #endif /* GL_SGIX_async_histogram */ #ifdef GL_SGIX_async_pixel GLEW_SGIX_async_pixel = _glewSearchExtension("GL_SGIX_async_pixel", extStart, extEnd); #endif /* GL_SGIX_async_pixel */ #ifdef GL_SGIX_blend_alpha_minmax GLEW_SGIX_blend_alpha_minmax = _glewSearchExtension("GL_SGIX_blend_alpha_minmax", extStart, extEnd); #endif /* GL_SGIX_blend_alpha_minmax */ #ifdef GL_SGIX_clipmap GLEW_SGIX_clipmap = _glewSearchExtension("GL_SGIX_clipmap", extStart, extEnd); #endif /* GL_SGIX_clipmap */ #ifdef GL_SGIX_convolution_accuracy GLEW_SGIX_convolution_accuracy = _glewSearchExtension("GL_SGIX_convolution_accuracy", extStart, extEnd); #endif /* GL_SGIX_convolution_accuracy */ #ifdef GL_SGIX_depth_texture GLEW_SGIX_depth_texture = _glewSearchExtension("GL_SGIX_depth_texture", extStart, extEnd); #endif /* GL_SGIX_depth_texture */ #ifdef GL_SGIX_flush_raster GLEW_SGIX_flush_raster = _glewSearchExtension("GL_SGIX_flush_raster", extStart, extEnd); if (glewExperimental || GLEW_SGIX_flush_raster) GLEW_SGIX_flush_raster = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_flush_raster */ #ifdef GL_SGIX_fog_offset GLEW_SGIX_fog_offset = _glewSearchExtension("GL_SGIX_fog_offset", extStart, extEnd); #endif /* GL_SGIX_fog_offset */ #ifdef GL_SGIX_fog_texture GLEW_SGIX_fog_texture = _glewSearchExtension("GL_SGIX_fog_texture", extStart, extEnd); if (glewExperimental || GLEW_SGIX_fog_texture) GLEW_SGIX_fog_texture = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_fog_texture */ #ifdef GL_SGIX_fragment_specular_lighting GLEW_SGIX_fragment_specular_lighting = _glewSearchExtension("GL_SGIX_fragment_specular_lighting", extStart, extEnd); if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) GLEW_SGIX_fragment_specular_lighting = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_fragment_specular_lighting */ #ifdef GL_SGIX_framezoom GLEW_SGIX_framezoom = _glewSearchExtension("GL_SGIX_framezoom", extStart, extEnd); if (glewExperimental || GLEW_SGIX_framezoom) GLEW_SGIX_framezoom = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_framezoom */ #ifdef GL_SGIX_interlace GLEW_SGIX_interlace = _glewSearchExtension("GL_SGIX_interlace", extStart, extEnd); #endif /* GL_SGIX_interlace */ #ifdef GL_SGIX_ir_instrument1 GLEW_SGIX_ir_instrument1 = _glewSearchExtension("GL_SGIX_ir_instrument1", extStart, extEnd); #endif /* GL_SGIX_ir_instrument1 */ #ifdef GL_SGIX_list_priority GLEW_SGIX_list_priority = _glewSearchExtension("GL_SGIX_list_priority", extStart, extEnd); #endif /* GL_SGIX_list_priority */ #ifdef GL_SGIX_pixel_texture GLEW_SGIX_pixel_texture = _glewSearchExtension("GL_SGIX_pixel_texture", extStart, extEnd); if (glewExperimental || GLEW_SGIX_pixel_texture) GLEW_SGIX_pixel_texture = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_pixel_texture */ #ifdef GL_SGIX_pixel_texture_bits GLEW_SGIX_pixel_texture_bits = _glewSearchExtension("GL_SGIX_pixel_texture_bits", extStart, extEnd); #endif /* GL_SGIX_pixel_texture_bits */ #ifdef GL_SGIX_reference_plane GLEW_SGIX_reference_plane = _glewSearchExtension("GL_SGIX_reference_plane", extStart, extEnd); if (glewExperimental || GLEW_SGIX_reference_plane) GLEW_SGIX_reference_plane = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_reference_plane */ #ifdef GL_SGIX_resample GLEW_SGIX_resample = _glewSearchExtension("GL_SGIX_resample", extStart, extEnd); #endif /* GL_SGIX_resample */ #ifdef GL_SGIX_shadow GLEW_SGIX_shadow = _glewSearchExtension("GL_SGIX_shadow", extStart, extEnd); #endif /* GL_SGIX_shadow */ #ifdef GL_SGIX_shadow_ambient GLEW_SGIX_shadow_ambient = _glewSearchExtension("GL_SGIX_shadow_ambient", extStart, extEnd); #endif /* GL_SGIX_shadow_ambient */ #ifdef GL_SGIX_sprite GLEW_SGIX_sprite = _glewSearchExtension("GL_SGIX_sprite", extStart, extEnd); if (glewExperimental || GLEW_SGIX_sprite) GLEW_SGIX_sprite = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_sprite */ #ifdef GL_SGIX_tag_sample_buffer GLEW_SGIX_tag_sample_buffer = _glewSearchExtension("GL_SGIX_tag_sample_buffer", extStart, extEnd); if (glewExperimental || GLEW_SGIX_tag_sample_buffer) GLEW_SGIX_tag_sample_buffer = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGIX_tag_sample_buffer */ #ifdef GL_SGIX_texture_add_env GLEW_SGIX_texture_add_env = _glewSearchExtension("GL_SGIX_texture_add_env", extStart, extEnd); #endif /* GL_SGIX_texture_add_env */ #ifdef GL_SGIX_texture_coordinate_clamp GLEW_SGIX_texture_coordinate_clamp = _glewSearchExtension("GL_SGIX_texture_coordinate_clamp", extStart, extEnd); #endif /* GL_SGIX_texture_coordinate_clamp */ #ifdef GL_SGIX_texture_lod_bias GLEW_SGIX_texture_lod_bias = _glewSearchExtension("GL_SGIX_texture_lod_bias", extStart, extEnd); #endif /* GL_SGIX_texture_lod_bias */ #ifdef GL_SGIX_texture_multi_buffer GLEW_SGIX_texture_multi_buffer = _glewSearchExtension("GL_SGIX_texture_multi_buffer", extStart, extEnd); #endif /* GL_SGIX_texture_multi_buffer */ #ifdef GL_SGIX_texture_range GLEW_SGIX_texture_range = _glewSearchExtension("GL_SGIX_texture_range", extStart, extEnd); #endif /* GL_SGIX_texture_range */ #ifdef GL_SGIX_texture_scale_bias GLEW_SGIX_texture_scale_bias = _glewSearchExtension("GL_SGIX_texture_scale_bias", extStart, extEnd); #endif /* GL_SGIX_texture_scale_bias */ #ifdef GL_SGIX_vertex_preclip GLEW_SGIX_vertex_preclip = _glewSearchExtension("GL_SGIX_vertex_preclip", extStart, extEnd); #endif /* GL_SGIX_vertex_preclip */ #ifdef GL_SGIX_vertex_preclip_hint GLEW_SGIX_vertex_preclip_hint = _glewSearchExtension("GL_SGIX_vertex_preclip_hint", extStart, extEnd); #endif /* GL_SGIX_vertex_preclip_hint */ #ifdef GL_SGIX_ycrcb GLEW_SGIX_ycrcb = _glewSearchExtension("GL_SGIX_ycrcb", extStart, extEnd); #endif /* GL_SGIX_ycrcb */ #ifdef GL_SGI_color_matrix GLEW_SGI_color_matrix = _glewSearchExtension("GL_SGI_color_matrix", extStart, extEnd); #endif /* GL_SGI_color_matrix */ #ifdef GL_SGI_color_table GLEW_SGI_color_table = _glewSearchExtension("GL_SGI_color_table", extStart, extEnd); if (glewExperimental || GLEW_SGI_color_table) GLEW_SGI_color_table = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SGI_color_table */ #ifdef GL_SGI_texture_color_table GLEW_SGI_texture_color_table = _glewSearchExtension("GL_SGI_texture_color_table", extStart, extEnd); #endif /* GL_SGI_texture_color_table */ #ifdef GL_SUNX_constant_data GLEW_SUNX_constant_data = _glewSearchExtension("GL_SUNX_constant_data", extStart, extEnd); if (glewExperimental || GLEW_SUNX_constant_data) GLEW_SUNX_constant_data = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SUNX_constant_data */ #ifdef GL_SUN_convolution_border_modes GLEW_SUN_convolution_border_modes = _glewSearchExtension("GL_SUN_convolution_border_modes", extStart, extEnd); #endif /* GL_SUN_convolution_border_modes */ #ifdef GL_SUN_global_alpha GLEW_SUN_global_alpha = _glewSearchExtension("GL_SUN_global_alpha", extStart, extEnd); if (glewExperimental || GLEW_SUN_global_alpha) GLEW_SUN_global_alpha = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SUN_global_alpha */ #ifdef GL_SUN_mesh_array GLEW_SUN_mesh_array = _glewSearchExtension("GL_SUN_mesh_array", extStart, extEnd); #endif /* GL_SUN_mesh_array */ #ifdef GL_SUN_read_video_pixels GLEW_SUN_read_video_pixels = _glewSearchExtension("GL_SUN_read_video_pixels", extStart, extEnd); if (glewExperimental || GLEW_SUN_read_video_pixels) GLEW_SUN_read_video_pixels = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SUN_read_video_pixels */ #ifdef GL_SUN_slice_accum GLEW_SUN_slice_accum = _glewSearchExtension("GL_SUN_slice_accum", extStart, extEnd); #endif /* GL_SUN_slice_accum */ #ifdef GL_SUN_triangle_list GLEW_SUN_triangle_list = _glewSearchExtension("GL_SUN_triangle_list", extStart, extEnd); if (glewExperimental || GLEW_SUN_triangle_list) GLEW_SUN_triangle_list = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SUN_triangle_list */ #ifdef GL_SUN_vertex GLEW_SUN_vertex = _glewSearchExtension("GL_SUN_vertex", extStart, extEnd); if (glewExperimental || GLEW_SUN_vertex) GLEW_SUN_vertex = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_SUN_vertex */ #ifdef GL_WIN_phong_shading GLEW_WIN_phong_shading = _glewSearchExtension("GL_WIN_phong_shading", extStart, extEnd); #endif /* GL_WIN_phong_shading */ #ifdef GL_WIN_specular_fog GLEW_WIN_specular_fog = _glewSearchExtension("GL_WIN_specular_fog", extStart, extEnd); #endif /* GL_WIN_specular_fog */ #ifdef GL_WIN_swap_hint GLEW_WIN_swap_hint = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd); if (glewExperimental || GLEW_WIN_swap_hint) GLEW_WIN_swap_hint = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GL_WIN_swap_hint */ return GLEW_OK; } #if defined(_WIN32) #if !defined(GLEW_MX) PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV = NULL; PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; GLboolean __WGLEW_3DFX_multisample = GL_FALSE; GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; GLboolean __WGLEW_ARB_context_flush_control = GL_FALSE; GLboolean __WGLEW_ARB_create_context = GL_FALSE; GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; GLboolean __WGLEW_ARB_multisample = GL_FALSE; GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; GLboolean __WGLEW_ARB_render_texture = GL_FALSE; GLboolean __WGLEW_ARB_robustness_application_isolation = GL_FALSE; GLboolean __WGLEW_ARB_robustness_share_group_isolation = GL_FALSE; GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; GLboolean __WGLEW_EXT_depth_float = GL_FALSE; GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; GLboolean __WGLEW_EXT_multisample = GL_FALSE; GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; GLboolean __WGLEW_EXT_swap_control = GL_FALSE; GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; GLboolean __WGLEW_I3D_gamma = GL_FALSE; GLboolean __WGLEW_I3D_genlock = GL_FALSE; GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; GLboolean __WGLEW_NV_DX_interop = GL_FALSE; GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; GLboolean __WGLEW_NV_copy_image = GL_FALSE; GLboolean __WGLEW_NV_delay_before_swap = GL_FALSE; GLboolean __WGLEW_NV_float_buffer = GL_FALSE; GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; GLboolean __WGLEW_NV_present_video = GL_FALSE; GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; GLboolean __WGLEW_NV_swap_group = GL_FALSE; GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; GLboolean __WGLEW_NV_video_capture = GL_FALSE; GLboolean __WGLEW_NV_video_output = GL_FALSE; GLboolean __WGLEW_OML_sync_control = GL_FALSE; #endif /* !GLEW_MX */ #ifdef WGL_3DL_stereo_control static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; return r; } #endif /* WGL_3DL_stereo_control */ #ifdef WGL_AMD_gpu_association static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; return r; } #endif /* WGL_AMD_gpu_association */ #ifdef WGL_ARB_buffer_region static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; return r; } #endif /* WGL_ARB_buffer_region */ #ifdef WGL_ARB_create_context static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; return r; } #endif /* WGL_ARB_create_context */ #ifdef WGL_ARB_extensions_string static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; return r; } #endif /* WGL_ARB_extensions_string */ #ifdef WGL_ARB_make_current_read static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; return r; } #endif /* WGL_ARB_make_current_read */ #ifdef WGL_ARB_pbuffer static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; return r; } #endif /* WGL_ARB_pbuffer */ #ifdef WGL_ARB_pixel_format static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; return r; } #endif /* WGL_ARB_pixel_format */ #ifdef WGL_ARB_render_texture static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; return r; } #endif /* WGL_ARB_render_texture */ #ifdef WGL_EXT_display_color_table static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; return r; } #endif /* WGL_EXT_display_color_table */ #ifdef WGL_EXT_extensions_string static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; return r; } #endif /* WGL_EXT_extensions_string */ #ifdef WGL_EXT_make_current_read static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; return r; } #endif /* WGL_EXT_make_current_read */ #ifdef WGL_EXT_pbuffer static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; return r; } #endif /* WGL_EXT_pbuffer */ #ifdef WGL_EXT_pixel_format static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; return r; } #endif /* WGL_EXT_pixel_format */ #ifdef WGL_EXT_swap_control static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; return r; } #endif /* WGL_EXT_swap_control */ #ifdef WGL_I3D_digital_video_control static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; return r; } #endif /* WGL_I3D_digital_video_control */ #ifdef WGL_I3D_gamma static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; return r; } #endif /* WGL_I3D_gamma */ #ifdef WGL_I3D_genlock static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; return r; } #endif /* WGL_I3D_genlock */ #ifdef WGL_I3D_image_buffer static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; return r; } #endif /* WGL_I3D_image_buffer */ #ifdef WGL_I3D_swap_frame_lock static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; return r; } #endif /* WGL_I3D_swap_frame_lock */ #ifdef WGL_I3D_swap_frame_usage static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; return r; } #endif /* WGL_I3D_swap_frame_usage */ #ifdef WGL_NV_DX_interop static GLboolean _glewInit_WGL_NV_DX_interop (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; return r; } #endif /* WGL_NV_DX_interop */ #ifdef WGL_NV_copy_image static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; return r; } #endif /* WGL_NV_copy_image */ #ifdef WGL_NV_delay_before_swap static GLboolean _glewInit_WGL_NV_delay_before_swap (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglDelayBeforeSwapNV = (PFNWGLDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"wglDelayBeforeSwapNV")) == NULL) || r; return r; } #endif /* WGL_NV_delay_before_swap */ #ifdef WGL_NV_gpu_affinity static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; return r; } #endif /* WGL_NV_gpu_affinity */ #ifdef WGL_NV_present_video static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; return r; } #endif /* WGL_NV_present_video */ #ifdef WGL_NV_swap_group static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; return r; } #endif /* WGL_NV_swap_group */ #ifdef WGL_NV_vertex_array_range static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; return r; } #endif /* WGL_NV_vertex_array_range */ #ifdef WGL_NV_video_capture static GLboolean _glewInit_WGL_NV_video_capture (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; return r; } #endif /* WGL_NV_video_capture */ #ifdef WGL_NV_video_output static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; return r; } #endif /* WGL_NV_video_output */ #ifdef WGL_OML_sync_control static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; return r; } #endif /* WGL_OML_sync_control */ /* ------------------------------------------------------------------------- */ static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) { const GLubyte* start; const GLubyte* end; if (_wglewGetExtensionsStringARB == NULL) if (_wglewGetExtensionsStringEXT == NULL) return GL_FALSE; else start = (const GLubyte*)_wglewGetExtensionsStringEXT(); else start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); if (start == 0) return GL_FALSE; end = start + _glewStrLen(start); return _glewSearchExtension(name, start, end); } #ifdef GLEW_MX GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) #else GLenum GLEWAPIENTRY wglewInit (WGLEW_CONTEXT_ARG_DEF_LIST) #endif { GLboolean crippled; const GLubyte* extStart; const GLubyte* extEnd; /* find wgl extension string query functions */ _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); /* query wgl extension string */ if (_wglewGetExtensionsStringARB == NULL) if (_wglewGetExtensionsStringEXT == NULL) extStart = (const GLubyte*)""; else extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); else extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); extEnd = extStart + _glewStrLen(extStart); /* initialize extensions */ crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; #ifdef WGL_3DFX_multisample WGLEW_3DFX_multisample = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); #endif /* WGL_3DFX_multisample */ #ifdef WGL_3DL_stereo_control WGLEW_3DL_stereo_control = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) WGLEW_3DL_stereo_control= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_3DL_stereo_control */ #ifdef WGL_AMD_gpu_association WGLEW_AMD_gpu_association = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) WGLEW_AMD_gpu_association= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_AMD_gpu_association */ #ifdef WGL_ARB_buffer_region WGLEW_ARB_buffer_region = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) WGLEW_ARB_buffer_region= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_ARB_buffer_region */ #ifdef WGL_ARB_context_flush_control WGLEW_ARB_context_flush_control = _glewSearchExtension("WGL_ARB_context_flush_control", extStart, extEnd); #endif /* WGL_ARB_context_flush_control */ #ifdef WGL_ARB_create_context WGLEW_ARB_create_context = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); if (glewExperimental || WGLEW_ARB_create_context|| crippled) WGLEW_ARB_create_context= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_ARB_create_context */ #ifdef WGL_ARB_create_context_profile WGLEW_ARB_create_context_profile = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); #endif /* WGL_ARB_create_context_profile */ #ifdef WGL_ARB_create_context_robustness WGLEW_ARB_create_context_robustness = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); #endif /* WGL_ARB_create_context_robustness */ #ifdef WGL_ARB_extensions_string WGLEW_ARB_extensions_string = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) WGLEW_ARB_extensions_string= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_ARB_extensions_string */ #ifdef WGL_ARB_framebuffer_sRGB WGLEW_ARB_framebuffer_sRGB = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); #endif /* WGL_ARB_framebuffer_sRGB */ #ifdef WGL_ARB_make_current_read WGLEW_ARB_make_current_read = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) WGLEW_ARB_make_current_read= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_ARB_make_current_read */ #ifdef WGL_ARB_multisample WGLEW_ARB_multisample = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); #endif /* WGL_ARB_multisample */ #ifdef WGL_ARB_pbuffer WGLEW_ARB_pbuffer = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) WGLEW_ARB_pbuffer= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_ARB_pbuffer */ #ifdef WGL_ARB_pixel_format WGLEW_ARB_pixel_format = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) WGLEW_ARB_pixel_format= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_ARB_pixel_format */ #ifdef WGL_ARB_pixel_format_float WGLEW_ARB_pixel_format_float = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); #endif /* WGL_ARB_pixel_format_float */ #ifdef WGL_ARB_render_texture WGLEW_ARB_render_texture = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); if (glewExperimental || WGLEW_ARB_render_texture|| crippled) WGLEW_ARB_render_texture= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_ARB_render_texture */ #ifdef WGL_ARB_robustness_application_isolation WGLEW_ARB_robustness_application_isolation = _glewSearchExtension("WGL_ARB_robustness_application_isolation", extStart, extEnd); #endif /* WGL_ARB_robustness_application_isolation */ #ifdef WGL_ARB_robustness_share_group_isolation WGLEW_ARB_robustness_share_group_isolation = _glewSearchExtension("WGL_ARB_robustness_share_group_isolation", extStart, extEnd); #endif /* WGL_ARB_robustness_share_group_isolation */ #ifdef WGL_ATI_pixel_format_float WGLEW_ATI_pixel_format_float = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); #endif /* WGL_ATI_pixel_format_float */ #ifdef WGL_ATI_render_texture_rectangle WGLEW_ATI_render_texture_rectangle = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); #endif /* WGL_ATI_render_texture_rectangle */ #ifdef WGL_EXT_create_context_es2_profile WGLEW_EXT_create_context_es2_profile = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); #endif /* WGL_EXT_create_context_es2_profile */ #ifdef WGL_EXT_create_context_es_profile WGLEW_EXT_create_context_es_profile = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); #endif /* WGL_EXT_create_context_es_profile */ #ifdef WGL_EXT_depth_float WGLEW_EXT_depth_float = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); #endif /* WGL_EXT_depth_float */ #ifdef WGL_EXT_display_color_table WGLEW_EXT_display_color_table = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) WGLEW_EXT_display_color_table= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_EXT_display_color_table */ #ifdef WGL_EXT_extensions_string WGLEW_EXT_extensions_string = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) WGLEW_EXT_extensions_string= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_EXT_extensions_string */ #ifdef WGL_EXT_framebuffer_sRGB WGLEW_EXT_framebuffer_sRGB = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); #endif /* WGL_EXT_framebuffer_sRGB */ #ifdef WGL_EXT_make_current_read WGLEW_EXT_make_current_read = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) WGLEW_EXT_make_current_read= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_EXT_make_current_read */ #ifdef WGL_EXT_multisample WGLEW_EXT_multisample = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); #endif /* WGL_EXT_multisample */ #ifdef WGL_EXT_pbuffer WGLEW_EXT_pbuffer = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) WGLEW_EXT_pbuffer= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_EXT_pbuffer */ #ifdef WGL_EXT_pixel_format WGLEW_EXT_pixel_format = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) WGLEW_EXT_pixel_format= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_EXT_pixel_format */ #ifdef WGL_EXT_pixel_format_packed_float WGLEW_EXT_pixel_format_packed_float = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); #endif /* WGL_EXT_pixel_format_packed_float */ #ifdef WGL_EXT_swap_control WGLEW_EXT_swap_control = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); if (glewExperimental || WGLEW_EXT_swap_control|| crippled) WGLEW_EXT_swap_control= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_EXT_swap_control */ #ifdef WGL_EXT_swap_control_tear WGLEW_EXT_swap_control_tear = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); #endif /* WGL_EXT_swap_control_tear */ #ifdef WGL_I3D_digital_video_control WGLEW_I3D_digital_video_control = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) WGLEW_I3D_digital_video_control= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_I3D_digital_video_control */ #ifdef WGL_I3D_gamma WGLEW_I3D_gamma = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); if (glewExperimental || WGLEW_I3D_gamma|| crippled) WGLEW_I3D_gamma= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_I3D_gamma */ #ifdef WGL_I3D_genlock WGLEW_I3D_genlock = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); if (glewExperimental || WGLEW_I3D_genlock|| crippled) WGLEW_I3D_genlock= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_I3D_genlock */ #ifdef WGL_I3D_image_buffer WGLEW_I3D_image_buffer = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) WGLEW_I3D_image_buffer= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_I3D_image_buffer */ #ifdef WGL_I3D_swap_frame_lock WGLEW_I3D_swap_frame_lock = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) WGLEW_I3D_swap_frame_lock= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_I3D_swap_frame_lock */ #ifdef WGL_I3D_swap_frame_usage WGLEW_I3D_swap_frame_usage = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) WGLEW_I3D_swap_frame_usage= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_I3D_swap_frame_usage */ #ifdef WGL_NV_DX_interop WGLEW_NV_DX_interop = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); if (glewExperimental || WGLEW_NV_DX_interop|| crippled) WGLEW_NV_DX_interop= !_glewInit_WGL_NV_DX_interop(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_DX_interop */ #ifdef WGL_NV_DX_interop2 WGLEW_NV_DX_interop2 = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); #endif /* WGL_NV_DX_interop2 */ #ifdef WGL_NV_copy_image WGLEW_NV_copy_image = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); if (glewExperimental || WGLEW_NV_copy_image|| crippled) WGLEW_NV_copy_image= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_copy_image */ #ifdef WGL_NV_delay_before_swap WGLEW_NV_delay_before_swap = _glewSearchExtension("WGL_NV_delay_before_swap", extStart, extEnd); if (glewExperimental || WGLEW_NV_delay_before_swap|| crippled) WGLEW_NV_delay_before_swap= !_glewInit_WGL_NV_delay_before_swap(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_delay_before_swap */ #ifdef WGL_NV_float_buffer WGLEW_NV_float_buffer = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); #endif /* WGL_NV_float_buffer */ #ifdef WGL_NV_gpu_affinity WGLEW_NV_gpu_affinity = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) WGLEW_NV_gpu_affinity= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_gpu_affinity */ #ifdef WGL_NV_multisample_coverage WGLEW_NV_multisample_coverage = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); #endif /* WGL_NV_multisample_coverage */ #ifdef WGL_NV_present_video WGLEW_NV_present_video = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); if (glewExperimental || WGLEW_NV_present_video|| crippled) WGLEW_NV_present_video= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_present_video */ #ifdef WGL_NV_render_depth_texture WGLEW_NV_render_depth_texture = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); #endif /* WGL_NV_render_depth_texture */ #ifdef WGL_NV_render_texture_rectangle WGLEW_NV_render_texture_rectangle = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); #endif /* WGL_NV_render_texture_rectangle */ #ifdef WGL_NV_swap_group WGLEW_NV_swap_group = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); if (glewExperimental || WGLEW_NV_swap_group|| crippled) WGLEW_NV_swap_group= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_swap_group */ #ifdef WGL_NV_vertex_array_range WGLEW_NV_vertex_array_range = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) WGLEW_NV_vertex_array_range= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_vertex_array_range */ #ifdef WGL_NV_video_capture WGLEW_NV_video_capture = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); if (glewExperimental || WGLEW_NV_video_capture|| crippled) WGLEW_NV_video_capture= !_glewInit_WGL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_video_capture */ #ifdef WGL_NV_video_output WGLEW_NV_video_output = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); if (glewExperimental || WGLEW_NV_video_output|| crippled) WGLEW_NV_video_output= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_NV_video_output */ #ifdef WGL_OML_sync_control WGLEW_OML_sync_control = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); if (glewExperimental || WGLEW_OML_sync_control|| crippled) WGLEW_OML_sync_control= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* WGL_OML_sync_control */ return GLEW_OK; } #elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD = NULL; PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD = NULL; PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD = NULL; PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD = NULL; PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD = NULL; PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD = NULL; PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD = NULL; PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD = NULL; PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD = NULL; PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA = NULL; PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA = NULL; PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA = NULL; PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA = NULL; PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV = NULL; PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV = NULL; PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV = NULL; PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; #if !defined(GLEW_MX) GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; GLboolean __GLXEW_3DFX_multisample = GL_FALSE; GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; GLboolean __GLXEW_ARB_context_flush_control = GL_FALSE; GLboolean __GLXEW_ARB_create_context = GL_FALSE; GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; GLboolean __GLXEW_ARB_multisample = GL_FALSE; GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; GLboolean __GLXEW_ATI_render_texture = GL_FALSE; GLboolean __GLXEW_EXT_buffer_age = GL_FALSE; GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; GLboolean __GLXEW_EXT_import_context = GL_FALSE; GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; GLboolean __GLXEW_EXT_stereo_tree = GL_FALSE; GLboolean __GLXEW_EXT_swap_control = GL_FALSE; GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; GLboolean __GLXEW_EXT_visual_info = GL_FALSE; GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; GLboolean __GLXEW_MESA_query_renderer = GL_FALSE; GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; GLboolean __GLXEW_MESA_swap_control = GL_FALSE; GLboolean __GLXEW_NV_copy_buffer = GL_FALSE; GLboolean __GLXEW_NV_copy_image = GL_FALSE; GLboolean __GLXEW_NV_delay_before_swap = GL_FALSE; GLboolean __GLXEW_NV_float_buffer = GL_FALSE; GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; GLboolean __GLXEW_NV_present_video = GL_FALSE; GLboolean __GLXEW_NV_swap_group = GL_FALSE; GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; GLboolean __GLXEW_NV_video_capture = GL_FALSE; GLboolean __GLXEW_NV_video_out = GL_FALSE; GLboolean __GLXEW_OML_swap_method = GL_FALSE; GLboolean __GLXEW_OML_sync_control = GL_FALSE; GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; GLboolean __GLXEW_SGIS_color_range = GL_FALSE; GLboolean __GLXEW_SGIS_multisample = GL_FALSE; GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; GLboolean __GLXEW_SGI_cushion = GL_FALSE; GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; GLboolean __GLXEW_SGI_swap_control = GL_FALSE; GLboolean __GLXEW_SGI_video_sync = GL_FALSE; GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; GLboolean __GLXEW_SUN_video_resize = GL_FALSE; #endif /* !GLEW_MX */ #ifdef GLX_VERSION_1_2 static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; return r; } #endif /* GLX_VERSION_1_2 */ #ifdef GLX_VERSION_1_3 static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; return r; } #endif /* GLX_VERSION_1_3 */ #ifdef GLX_AMD_gpu_association static GLboolean _glewInit_GLX_AMD_gpu_association (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"glXBlitContextFramebufferAMD")) == NULL) || r; r = ((glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAMD")) == NULL) || r; r = ((glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAttribsAMD")) == NULL) || r; r = ((glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXDeleteAssociatedContextAMD")) == NULL) || r; r = ((glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetContextGPUIDAMD")) == NULL) || r; r = ((glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentAssociatedContextAMD")) == NULL) || r; r = ((glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUIDsAMD")) == NULL) || r; r = ((glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUInfoAMD")) == NULL) || r; r = ((glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"glXMakeAssociatedContextCurrentAMD")) == NULL) || r; return r; } #endif /* GLX_AMD_gpu_association */ #ifdef GLX_ARB_create_context static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; return r; } #endif /* GLX_ARB_create_context */ #ifdef GLX_ATI_render_texture static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; return r; } #endif /* GLX_ATI_render_texture */ #ifdef GLX_EXT_import_context static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; return r; } #endif /* GLX_EXT_import_context */ #ifdef GLX_EXT_swap_control static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; return r; } #endif /* GLX_EXT_swap_control */ #ifdef GLX_EXT_texture_from_pixmap static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; return r; } #endif /* GLX_EXT_texture_from_pixmap */ #ifdef GLX_MESA_agp_offset static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; return r; } #endif /* GLX_MESA_agp_offset */ #ifdef GLX_MESA_copy_sub_buffer static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; return r; } #endif /* GLX_MESA_copy_sub_buffer */ #ifdef GLX_MESA_pixmap_colormap static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; return r; } #endif /* GLX_MESA_pixmap_colormap */ #ifdef GLX_MESA_query_renderer static GLboolean _glewInit_GLX_MESA_query_renderer (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererIntegerMESA")) == NULL) || r; r = ((glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererStringMESA")) == NULL) || r; r = ((glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererIntegerMESA")) == NULL) || r; r = ((glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererStringMESA")) == NULL) || r; return r; } #endif /* GLX_MESA_query_renderer */ #ifdef GLX_MESA_release_buffers static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; return r; } #endif /* GLX_MESA_release_buffers */ #ifdef GLX_MESA_set_3dfx_mode static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; return r; } #endif /* GLX_MESA_set_3dfx_mode */ #ifdef GLX_MESA_swap_control static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; return r; } #endif /* GLX_MESA_swap_control */ #ifdef GLX_NV_copy_buffer static GLboolean _glewInit_GLX_NV_copy_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXCopyBufferSubDataNV = (PFNGLXCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyBufferSubDataNV")) == NULL) || r; r = ((glXNamedCopyBufferSubDataNV = (PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXNamedCopyBufferSubDataNV")) == NULL) || r; return r; } #endif /* GLX_NV_copy_buffer */ #ifdef GLX_NV_copy_image static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; return r; } #endif /* GLX_NV_copy_image */ #ifdef GLX_NV_delay_before_swap static GLboolean _glewInit_GLX_NV_delay_before_swap (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXDelayBeforeSwapNV = (PFNGLXDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"glXDelayBeforeSwapNV")) == NULL) || r; return r; } #endif /* GLX_NV_delay_before_swap */ #ifdef GLX_NV_present_video static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; return r; } #endif /* GLX_NV_present_video */ #ifdef GLX_NV_swap_group static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; return r; } #endif /* GLX_NV_swap_group */ #ifdef GLX_NV_vertex_array_range static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; return r; } #endif /* GLX_NV_vertex_array_range */ #ifdef GLX_NV_video_capture static GLboolean _glewInit_GLX_NV_video_capture (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; return r; } #endif /* GLX_NV_video_capture */ #ifdef GLX_NV_video_out static GLboolean _glewInit_GLX_NV_video_out (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; return r; } #endif /* GLX_NV_video_out */ #ifdef GLX_OML_sync_control static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; return r; } #endif /* GLX_OML_sync_control */ #ifdef GLX_SGIX_fbconfig static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; return r; } #endif /* GLX_SGIX_fbconfig */ #ifdef GLX_SGIX_hyperpipe static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; return r; } #endif /* GLX_SGIX_hyperpipe */ #ifdef GLX_SGIX_pbuffer static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; return r; } #endif /* GLX_SGIX_pbuffer */ #ifdef GLX_SGIX_swap_barrier static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; return r; } #endif /* GLX_SGIX_swap_barrier */ #ifdef GLX_SGIX_swap_group static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; return r; } #endif /* GLX_SGIX_swap_group */ #ifdef GLX_SGIX_video_resize static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; return r; } #endif /* GLX_SGIX_video_resize */ #ifdef GLX_SGI_cushion static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; return r; } #endif /* GLX_SGI_cushion */ #ifdef GLX_SGI_make_current_read static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; return r; } #endif /* GLX_SGI_make_current_read */ #ifdef GLX_SGI_swap_control static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; return r; } #endif /* GLX_SGI_swap_control */ #ifdef GLX_SGI_video_sync static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; return r; } #endif /* GLX_SGI_video_sync */ #ifdef GLX_SUN_get_transparent_index static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; return r; } #endif /* GLX_SUN_get_transparent_index */ #ifdef GLX_SUN_video_resize static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) { GLboolean r = GL_FALSE; r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; return r; } #endif /* GLX_SUN_video_resize */ /* ------------------------------------------------------------------------ */ GLboolean glxewGetExtension (const char* name) { const GLubyte* start; const GLubyte* end; if (glXGetCurrentDisplay == NULL) return GL_FALSE; start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); if (0 == start) return GL_FALSE; end = start + _glewStrLen(start); return _glewSearchExtension(name, start, end); } #ifdef GLEW_MX GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) #else GLenum glxewInit (GLXEW_CONTEXT_ARG_DEF_LIST) #endif { int major, minor; const GLubyte* extStart; const GLubyte* extEnd; /* initialize core GLX 1.2 */ if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; /* initialize flags */ GLXEW_VERSION_1_0 = GL_TRUE; GLXEW_VERSION_1_1 = GL_TRUE; GLXEW_VERSION_1_2 = GL_TRUE; GLXEW_VERSION_1_3 = GL_TRUE; GLXEW_VERSION_1_4 = GL_TRUE; /* query GLX version */ glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); if (major == 1 && minor <= 3) { switch (minor) { case 3: GLXEW_VERSION_1_4 = GL_FALSE; break; case 2: GLXEW_VERSION_1_4 = GL_FALSE; GLXEW_VERSION_1_3 = GL_FALSE; break; default: return GLEW_ERROR_GLX_VERSION_11_ONLY; break; } } /* query GLX extension string */ extStart = 0; if (glXGetCurrentDisplay != NULL) extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); if (extStart == 0) extStart = (const GLubyte *)""; extEnd = extStart + _glewStrLen(extStart); /* initialize extensions */ #ifdef GLX_VERSION_1_3 if (glewExperimental || GLXEW_VERSION_1_3) GLXEW_VERSION_1_3 = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_VERSION_1_3 */ #ifdef GLX_3DFX_multisample GLXEW_3DFX_multisample = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); #endif /* GLX_3DFX_multisample */ #ifdef GLX_AMD_gpu_association GLXEW_AMD_gpu_association = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); if (glewExperimental || GLXEW_AMD_gpu_association) GLXEW_AMD_gpu_association = !_glewInit_GLX_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_AMD_gpu_association */ #ifdef GLX_ARB_context_flush_control GLXEW_ARB_context_flush_control = _glewSearchExtension("GLX_ARB_context_flush_control", extStart, extEnd); #endif /* GLX_ARB_context_flush_control */ #ifdef GLX_ARB_create_context GLXEW_ARB_create_context = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); if (glewExperimental || GLXEW_ARB_create_context) GLXEW_ARB_create_context = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_ARB_create_context */ #ifdef GLX_ARB_create_context_profile GLXEW_ARB_create_context_profile = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); #endif /* GLX_ARB_create_context_profile */ #ifdef GLX_ARB_create_context_robustness GLXEW_ARB_create_context_robustness = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); #endif /* GLX_ARB_create_context_robustness */ #ifdef GLX_ARB_fbconfig_float GLXEW_ARB_fbconfig_float = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); #endif /* GLX_ARB_fbconfig_float */ #ifdef GLX_ARB_framebuffer_sRGB GLXEW_ARB_framebuffer_sRGB = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); #endif /* GLX_ARB_framebuffer_sRGB */ #ifdef GLX_ARB_get_proc_address GLXEW_ARB_get_proc_address = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); #endif /* GLX_ARB_get_proc_address */ #ifdef GLX_ARB_multisample GLXEW_ARB_multisample = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); #endif /* GLX_ARB_multisample */ #ifdef GLX_ARB_robustness_application_isolation GLXEW_ARB_robustness_application_isolation = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); #endif /* GLX_ARB_robustness_application_isolation */ #ifdef GLX_ARB_robustness_share_group_isolation GLXEW_ARB_robustness_share_group_isolation = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); #endif /* GLX_ARB_robustness_share_group_isolation */ #ifdef GLX_ARB_vertex_buffer_object GLXEW_ARB_vertex_buffer_object = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); #endif /* GLX_ARB_vertex_buffer_object */ #ifdef GLX_ATI_pixel_format_float GLXEW_ATI_pixel_format_float = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); #endif /* GLX_ATI_pixel_format_float */ #ifdef GLX_ATI_render_texture GLXEW_ATI_render_texture = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); if (glewExperimental || GLXEW_ATI_render_texture) GLXEW_ATI_render_texture = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_ATI_render_texture */ #ifdef GLX_EXT_buffer_age GLXEW_EXT_buffer_age = _glewSearchExtension("GLX_EXT_buffer_age", extStart, extEnd); #endif /* GLX_EXT_buffer_age */ #ifdef GLX_EXT_create_context_es2_profile GLXEW_EXT_create_context_es2_profile = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); #endif /* GLX_EXT_create_context_es2_profile */ #ifdef GLX_EXT_create_context_es_profile GLXEW_EXT_create_context_es_profile = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); #endif /* GLX_EXT_create_context_es_profile */ #ifdef GLX_EXT_fbconfig_packed_float GLXEW_EXT_fbconfig_packed_float = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); #endif /* GLX_EXT_fbconfig_packed_float */ #ifdef GLX_EXT_framebuffer_sRGB GLXEW_EXT_framebuffer_sRGB = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); #endif /* GLX_EXT_framebuffer_sRGB */ #ifdef GLX_EXT_import_context GLXEW_EXT_import_context = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); if (glewExperimental || GLXEW_EXT_import_context) GLXEW_EXT_import_context = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_EXT_import_context */ #ifdef GLX_EXT_scene_marker GLXEW_EXT_scene_marker = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); #endif /* GLX_EXT_scene_marker */ #ifdef GLX_EXT_stereo_tree GLXEW_EXT_stereo_tree = _glewSearchExtension("GLX_EXT_stereo_tree", extStart, extEnd); #endif /* GLX_EXT_stereo_tree */ #ifdef GLX_EXT_swap_control GLXEW_EXT_swap_control = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); if (glewExperimental || GLXEW_EXT_swap_control) GLXEW_EXT_swap_control = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_EXT_swap_control */ #ifdef GLX_EXT_swap_control_tear GLXEW_EXT_swap_control_tear = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); #endif /* GLX_EXT_swap_control_tear */ #ifdef GLX_EXT_texture_from_pixmap GLXEW_EXT_texture_from_pixmap = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); if (glewExperimental || GLXEW_EXT_texture_from_pixmap) GLXEW_EXT_texture_from_pixmap = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_EXT_texture_from_pixmap */ #ifdef GLX_EXT_visual_info GLXEW_EXT_visual_info = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); #endif /* GLX_EXT_visual_info */ #ifdef GLX_EXT_visual_rating GLXEW_EXT_visual_rating = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); #endif /* GLX_EXT_visual_rating */ #ifdef GLX_INTEL_swap_event GLXEW_INTEL_swap_event = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); #endif /* GLX_INTEL_swap_event */ #ifdef GLX_MESA_agp_offset GLXEW_MESA_agp_offset = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); if (glewExperimental || GLXEW_MESA_agp_offset) GLXEW_MESA_agp_offset = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_agp_offset */ #ifdef GLX_MESA_copy_sub_buffer GLXEW_MESA_copy_sub_buffer = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); if (glewExperimental || GLXEW_MESA_copy_sub_buffer) GLXEW_MESA_copy_sub_buffer = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_copy_sub_buffer */ #ifdef GLX_MESA_pixmap_colormap GLXEW_MESA_pixmap_colormap = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); if (glewExperimental || GLXEW_MESA_pixmap_colormap) GLXEW_MESA_pixmap_colormap = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_pixmap_colormap */ #ifdef GLX_MESA_query_renderer GLXEW_MESA_query_renderer = _glewSearchExtension("GLX_MESA_query_renderer", extStart, extEnd); if (glewExperimental || GLXEW_MESA_query_renderer) GLXEW_MESA_query_renderer = !_glewInit_GLX_MESA_query_renderer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_query_renderer */ #ifdef GLX_MESA_release_buffers GLXEW_MESA_release_buffers = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); if (glewExperimental || GLXEW_MESA_release_buffers) GLXEW_MESA_release_buffers = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_release_buffers */ #ifdef GLX_MESA_set_3dfx_mode GLXEW_MESA_set_3dfx_mode = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); if (glewExperimental || GLXEW_MESA_set_3dfx_mode) GLXEW_MESA_set_3dfx_mode = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_set_3dfx_mode */ #ifdef GLX_MESA_swap_control GLXEW_MESA_swap_control = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); if (glewExperimental || GLXEW_MESA_swap_control) GLXEW_MESA_swap_control = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_MESA_swap_control */ #ifdef GLX_NV_copy_buffer GLXEW_NV_copy_buffer = _glewSearchExtension("GLX_NV_copy_buffer", extStart, extEnd); if (glewExperimental || GLXEW_NV_copy_buffer) GLXEW_NV_copy_buffer = !_glewInit_GLX_NV_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_copy_buffer */ #ifdef GLX_NV_copy_image GLXEW_NV_copy_image = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); if (glewExperimental || GLXEW_NV_copy_image) GLXEW_NV_copy_image = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_copy_image */ #ifdef GLX_NV_delay_before_swap GLXEW_NV_delay_before_swap = _glewSearchExtension("GLX_NV_delay_before_swap", extStart, extEnd); if (glewExperimental || GLXEW_NV_delay_before_swap) GLXEW_NV_delay_before_swap = !_glewInit_GLX_NV_delay_before_swap(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_delay_before_swap */ #ifdef GLX_NV_float_buffer GLXEW_NV_float_buffer = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); #endif /* GLX_NV_float_buffer */ #ifdef GLX_NV_multisample_coverage GLXEW_NV_multisample_coverage = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); #endif /* GLX_NV_multisample_coverage */ #ifdef GLX_NV_present_video GLXEW_NV_present_video = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); if (glewExperimental || GLXEW_NV_present_video) GLXEW_NV_present_video = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_present_video */ #ifdef GLX_NV_swap_group GLXEW_NV_swap_group = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); if (glewExperimental || GLXEW_NV_swap_group) GLXEW_NV_swap_group = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_swap_group */ #ifdef GLX_NV_vertex_array_range GLXEW_NV_vertex_array_range = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); if (glewExperimental || GLXEW_NV_vertex_array_range) GLXEW_NV_vertex_array_range = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_vertex_array_range */ #ifdef GLX_NV_video_capture GLXEW_NV_video_capture = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); if (glewExperimental || GLXEW_NV_video_capture) GLXEW_NV_video_capture = !_glewInit_GLX_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_video_capture */ #ifdef GLX_NV_video_out GLXEW_NV_video_out = _glewSearchExtension("GLX_NV_video_out", extStart, extEnd); if (glewExperimental || GLXEW_NV_video_out) GLXEW_NV_video_out = !_glewInit_GLX_NV_video_out(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_NV_video_out */ #ifdef GLX_OML_swap_method GLXEW_OML_swap_method = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); #endif /* GLX_OML_swap_method */ #ifdef GLX_OML_sync_control GLXEW_OML_sync_control = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); if (glewExperimental || GLXEW_OML_sync_control) GLXEW_OML_sync_control = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_OML_sync_control */ #ifdef GLX_SGIS_blended_overlay GLXEW_SGIS_blended_overlay = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); #endif /* GLX_SGIS_blended_overlay */ #ifdef GLX_SGIS_color_range GLXEW_SGIS_color_range = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); #endif /* GLX_SGIS_color_range */ #ifdef GLX_SGIS_multisample GLXEW_SGIS_multisample = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); #endif /* GLX_SGIS_multisample */ #ifdef GLX_SGIS_shared_multisample GLXEW_SGIS_shared_multisample = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); #endif /* GLX_SGIS_shared_multisample */ #ifdef GLX_SGIX_fbconfig GLXEW_SGIX_fbconfig = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); if (glewExperimental || GLXEW_SGIX_fbconfig) GLXEW_SGIX_fbconfig = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGIX_fbconfig */ #ifdef GLX_SGIX_hyperpipe GLXEW_SGIX_hyperpipe = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); if (glewExperimental || GLXEW_SGIX_hyperpipe) GLXEW_SGIX_hyperpipe = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGIX_hyperpipe */ #ifdef GLX_SGIX_pbuffer GLXEW_SGIX_pbuffer = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); if (glewExperimental || GLXEW_SGIX_pbuffer) GLXEW_SGIX_pbuffer = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGIX_pbuffer */ #ifdef GLX_SGIX_swap_barrier GLXEW_SGIX_swap_barrier = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); if (glewExperimental || GLXEW_SGIX_swap_barrier) GLXEW_SGIX_swap_barrier = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGIX_swap_barrier */ #ifdef GLX_SGIX_swap_group GLXEW_SGIX_swap_group = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); if (glewExperimental || GLXEW_SGIX_swap_group) GLXEW_SGIX_swap_group = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGIX_swap_group */ #ifdef GLX_SGIX_video_resize GLXEW_SGIX_video_resize = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); if (glewExperimental || GLXEW_SGIX_video_resize) GLXEW_SGIX_video_resize = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGIX_video_resize */ #ifdef GLX_SGIX_visual_select_group GLXEW_SGIX_visual_select_group = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); #endif /* GLX_SGIX_visual_select_group */ #ifdef GLX_SGI_cushion GLXEW_SGI_cushion = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); if (glewExperimental || GLXEW_SGI_cushion) GLXEW_SGI_cushion = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGI_cushion */ #ifdef GLX_SGI_make_current_read GLXEW_SGI_make_current_read = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); if (glewExperimental || GLXEW_SGI_make_current_read) GLXEW_SGI_make_current_read = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGI_make_current_read */ #ifdef GLX_SGI_swap_control GLXEW_SGI_swap_control = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); if (glewExperimental || GLXEW_SGI_swap_control) GLXEW_SGI_swap_control = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGI_swap_control */ #ifdef GLX_SGI_video_sync GLXEW_SGI_video_sync = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); if (glewExperimental || GLXEW_SGI_video_sync) GLXEW_SGI_video_sync = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SGI_video_sync */ #ifdef GLX_SUN_get_transparent_index GLXEW_SUN_get_transparent_index = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); if (glewExperimental || GLXEW_SUN_get_transparent_index) GLXEW_SUN_get_transparent_index = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SUN_get_transparent_index */ #ifdef GLX_SUN_video_resize GLXEW_SUN_video_resize = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); if (glewExperimental || GLXEW_SUN_video_resize) GLXEW_SUN_video_resize = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); #endif /* GLX_SUN_video_resize */ return GLEW_OK; } #endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ /* ------------------------------------------------------------------------ */ const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) { static const GLubyte* _glewErrorString[] = { (const GLubyte*)"No error", (const GLubyte*)"Missing GL version", (const GLubyte*)"GL 1.1 and up are not supported", (const GLubyte*)"GLX 1.2 and up are not supported", (const GLubyte*)"Unknown error" }; const size_t max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; return _glewErrorString[(size_t)error > max_error ? max_error : (size_t)error]; } const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) { static const GLubyte* _glewString[] = { (const GLubyte*)NULL, (const GLubyte*)"1.13.0", (const GLubyte*)"1", (const GLubyte*)"13", (const GLubyte*)"0" }; const size_t max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; return _glewString[(size_t)name > max_string ? 0 : (size_t)name]; } /* ------------------------------------------------------------------------ */ GLboolean glewExperimental = GL_FALSE; #if !defined(GLEW_MX) GLenum GLEWAPIENTRY glewInit (void) { GLenum r; r = glewContextInit(); if ( r != 0 ) return r; #if defined(_WIN32) return wglewInit(); #elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ return glxewInit(); #else return r; #endif /* _WIN32 */ } #endif /* !GLEW_MX */ #ifdef GLEW_MX GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name) #else GLboolean GLEWAPIENTRY glewIsSupported (const char* name) #endif { const GLubyte* pos = (const GLubyte*)name; GLuint len = _glewStrLen(pos); GLboolean ret = GL_TRUE; while (ret && len > 0) { if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) { if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) { #ifdef GL_VERSION_1_2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) { ret = GLEW_VERSION_1_2; continue; } #endif #ifdef GL_VERSION_1_2_1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) { ret = GLEW_VERSION_1_2_1; continue; } #endif #ifdef GL_VERSION_1_3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) { ret = GLEW_VERSION_1_3; continue; } #endif #ifdef GL_VERSION_1_4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) { ret = GLEW_VERSION_1_4; continue; } #endif #ifdef GL_VERSION_1_5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) { ret = GLEW_VERSION_1_5; continue; } #endif #ifdef GL_VERSION_2_0 if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) { ret = GLEW_VERSION_2_0; continue; } #endif #ifdef GL_VERSION_2_1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) { ret = GLEW_VERSION_2_1; continue; } #endif #ifdef GL_VERSION_3_0 if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) { ret = GLEW_VERSION_3_0; continue; } #endif #ifdef GL_VERSION_3_1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) { ret = GLEW_VERSION_3_1; continue; } #endif #ifdef GL_VERSION_3_2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) { ret = GLEW_VERSION_3_2; continue; } #endif #ifdef GL_VERSION_3_3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) { ret = GLEW_VERSION_3_3; continue; } #endif #ifdef GL_VERSION_4_0 if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) { ret = GLEW_VERSION_4_0; continue; } #endif #ifdef GL_VERSION_4_1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) { ret = GLEW_VERSION_4_1; continue; } #endif #ifdef GL_VERSION_4_2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) { ret = GLEW_VERSION_4_2; continue; } #endif #ifdef GL_VERSION_4_3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) { ret = GLEW_VERSION_4_3; continue; } #endif #ifdef GL_VERSION_4_4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_4", 3)) { ret = GLEW_VERSION_4_4; continue; } #endif #ifdef GL_VERSION_4_5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_5", 3)) { ret = GLEW_VERSION_4_5; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) { #ifdef GL_3DFX_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = GLEW_3DFX_multisample; continue; } #endif #ifdef GL_3DFX_tbuffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) { ret = GLEW_3DFX_tbuffer; continue; } #endif #ifdef GL_3DFX_texture_compression_FXT1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) { ret = GLEW_3DFX_texture_compression_FXT1; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) { #ifdef GL_AMD_blend_minmax_factor if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) { ret = GLEW_AMD_blend_minmax_factor; continue; } #endif #ifdef GL_AMD_conservative_depth if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) { ret = GLEW_AMD_conservative_depth; continue; } #endif #ifdef GL_AMD_debug_output if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) { ret = GLEW_AMD_debug_output; continue; } #endif #ifdef GL_AMD_depth_clamp_separate if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) { ret = GLEW_AMD_depth_clamp_separate; continue; } #endif #ifdef GL_AMD_draw_buffers_blend if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) { ret = GLEW_AMD_draw_buffers_blend; continue; } #endif #ifdef GL_AMD_gcn_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"gcn_shader", 10)) { ret = GLEW_AMD_gcn_shader; continue; } #endif #ifdef GL_AMD_gpu_shader_int64 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) { ret = GLEW_AMD_gpu_shader_int64; continue; } #endif #ifdef GL_AMD_interleaved_elements if (_glewStrSame3(&pos, &len, (const GLubyte*)"interleaved_elements", 20)) { ret = GLEW_AMD_interleaved_elements; continue; } #endif #ifdef GL_AMD_multi_draw_indirect if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) { ret = GLEW_AMD_multi_draw_indirect; continue; } #endif #ifdef GL_AMD_name_gen_delete if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) { ret = GLEW_AMD_name_gen_delete; continue; } #endif #ifdef GL_AMD_occlusion_query_event if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query_event", 21)) { ret = GLEW_AMD_occlusion_query_event; continue; } #endif #ifdef GL_AMD_performance_monitor if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) { ret = GLEW_AMD_performance_monitor; continue; } #endif #ifdef GL_AMD_pinned_memory if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) { ret = GLEW_AMD_pinned_memory; continue; } #endif #ifdef GL_AMD_query_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) { ret = GLEW_AMD_query_buffer_object; continue; } #endif #ifdef GL_AMD_sample_positions if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) { ret = GLEW_AMD_sample_positions; continue; } #endif #ifdef GL_AMD_seamless_cubemap_per_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) { ret = GLEW_AMD_seamless_cubemap_per_texture; continue; } #endif #ifdef GL_AMD_shader_atomic_counter_ops if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) { ret = GLEW_AMD_shader_atomic_counter_ops; continue; } #endif #ifdef GL_AMD_shader_stencil_export if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) { ret = GLEW_AMD_shader_stencil_export; continue; } #endif #ifdef GL_AMD_shader_stencil_value_export if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_value_export", 27)) { ret = GLEW_AMD_shader_stencil_value_export; continue; } #endif #ifdef GL_AMD_shader_trinary_minmax if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_trinary_minmax", 21)) { ret = GLEW_AMD_shader_trinary_minmax; continue; } #endif #ifdef GL_AMD_sparse_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) { ret = GLEW_AMD_sparse_texture; continue; } #endif #ifdef GL_AMD_stencil_operation_extended if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) { ret = GLEW_AMD_stencil_operation_extended; continue; } #endif #ifdef GL_AMD_texture_texture4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) { ret = GLEW_AMD_texture_texture4; continue; } #endif #ifdef GL_AMD_transform_feedback3_lines_triangles if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) { ret = GLEW_AMD_transform_feedback3_lines_triangles; continue; } #endif #ifdef GL_AMD_transform_feedback4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback4", 19)) { ret = GLEW_AMD_transform_feedback4; continue; } #endif #ifdef GL_AMD_vertex_shader_layer if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) { ret = GLEW_AMD_vertex_shader_layer; continue; } #endif #ifdef GL_AMD_vertex_shader_tessellator if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) { ret = GLEW_AMD_vertex_shader_tessellator; continue; } #endif #ifdef GL_AMD_vertex_shader_viewport_index if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) { ret = GLEW_AMD_vertex_shader_viewport_index; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6)) { #ifdef GL_ANGLE_depth_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) { ret = GLEW_ANGLE_depth_texture; continue; } #endif #ifdef GL_ANGLE_framebuffer_blit if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) { ret = GLEW_ANGLE_framebuffer_blit; continue; } #endif #ifdef GL_ANGLE_framebuffer_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) { ret = GLEW_ANGLE_framebuffer_multisample; continue; } #endif #ifdef GL_ANGLE_instanced_arrays if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) { ret = GLEW_ANGLE_instanced_arrays; continue; } #endif #ifdef GL_ANGLE_pack_reverse_row_order if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_reverse_row_order", 22)) { ret = GLEW_ANGLE_pack_reverse_row_order; continue; } #endif #ifdef GL_ANGLE_program_binary if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary", 14)) { ret = GLEW_ANGLE_program_binary; continue; } #endif #ifdef GL_ANGLE_texture_compression_dxt1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) { ret = GLEW_ANGLE_texture_compression_dxt1; continue; } #endif #ifdef GL_ANGLE_texture_compression_dxt3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt3", 24)) { ret = GLEW_ANGLE_texture_compression_dxt3; continue; } #endif #ifdef GL_ANGLE_texture_compression_dxt5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt5", 24)) { ret = GLEW_ANGLE_texture_compression_dxt5; continue; } #endif #ifdef GL_ANGLE_texture_usage if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_usage", 13)) { ret = GLEW_ANGLE_texture_usage; continue; } #endif #ifdef GL_ANGLE_timer_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) { ret = GLEW_ANGLE_timer_query; continue; } #endif #ifdef GL_ANGLE_translated_shader_source if (_glewStrSame3(&pos, &len, (const GLubyte*)"translated_shader_source", 24)) { ret = GLEW_ANGLE_translated_shader_source; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) { #ifdef GL_APPLE_aux_depth_stencil if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) { ret = GLEW_APPLE_aux_depth_stencil; continue; } #endif #ifdef GL_APPLE_client_storage if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) { ret = GLEW_APPLE_client_storage; continue; } #endif #ifdef GL_APPLE_element_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) { ret = GLEW_APPLE_element_array; continue; } #endif #ifdef GL_APPLE_fence if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) { ret = GLEW_APPLE_fence; continue; } #endif #ifdef GL_APPLE_float_pixels if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) { ret = GLEW_APPLE_float_pixels; continue; } #endif #ifdef GL_APPLE_flush_buffer_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) { ret = GLEW_APPLE_flush_buffer_range; continue; } #endif #ifdef GL_APPLE_object_purgeable if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) { ret = GLEW_APPLE_object_purgeable; continue; } #endif #ifdef GL_APPLE_pixel_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) { ret = GLEW_APPLE_pixel_buffer; continue; } #endif #ifdef GL_APPLE_rgb_422 if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) { ret = GLEW_APPLE_rgb_422; continue; } #endif #ifdef GL_APPLE_row_bytes if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) { ret = GLEW_APPLE_row_bytes; continue; } #endif #ifdef GL_APPLE_specular_vector if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) { ret = GLEW_APPLE_specular_vector; continue; } #endif #ifdef GL_APPLE_texture_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) { ret = GLEW_APPLE_texture_range; continue; } #endif #ifdef GL_APPLE_transform_hint if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) { ret = GLEW_APPLE_transform_hint; continue; } #endif #ifdef GL_APPLE_vertex_array_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) { ret = GLEW_APPLE_vertex_array_object; continue; } #endif #ifdef GL_APPLE_vertex_array_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) { ret = GLEW_APPLE_vertex_array_range; continue; } #endif #ifdef GL_APPLE_vertex_program_evaluators if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) { ret = GLEW_APPLE_vertex_program_evaluators; continue; } #endif #ifdef GL_APPLE_ycbcr_422 if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) { ret = GLEW_APPLE_ycbcr_422; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) { #ifdef GL_ARB_ES2_compatibility if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) { ret = GLEW_ARB_ES2_compatibility; continue; } #endif #ifdef GL_ARB_ES3_1_compatibility if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_1_compatibility", 19)) { ret = GLEW_ARB_ES3_1_compatibility; continue; } #endif #ifdef GL_ARB_ES3_2_compatibility if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_2_compatibility", 19)) { ret = GLEW_ARB_ES3_2_compatibility; continue; } #endif #ifdef GL_ARB_ES3_compatibility if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) { ret = GLEW_ARB_ES3_compatibility; continue; } #endif #ifdef GL_ARB_arrays_of_arrays if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) { ret = GLEW_ARB_arrays_of_arrays; continue; } #endif #ifdef GL_ARB_base_instance if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) { ret = GLEW_ARB_base_instance; continue; } #endif #ifdef GL_ARB_bindless_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) { ret = GLEW_ARB_bindless_texture; continue; } #endif #ifdef GL_ARB_blend_func_extended if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) { ret = GLEW_ARB_blend_func_extended; continue; } #endif #ifdef GL_ARB_buffer_storage if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14)) { ret = GLEW_ARB_buffer_storage; continue; } #endif #ifdef GL_ARB_cl_event if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) { ret = GLEW_ARB_cl_event; continue; } #endif #ifdef GL_ARB_clear_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) { ret = GLEW_ARB_clear_buffer_object; continue; } #endif #ifdef GL_ARB_clear_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13)) { ret = GLEW_ARB_clear_texture; continue; } #endif #ifdef GL_ARB_clip_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_control", 12)) { ret = GLEW_ARB_clip_control; continue; } #endif #ifdef GL_ARB_color_buffer_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) { ret = GLEW_ARB_color_buffer_float; continue; } #endif #ifdef GL_ARB_compatibility if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) { ret = GLEW_ARB_compatibility; continue; } #endif #ifdef GL_ARB_compressed_texture_pixel_storage if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) { ret = GLEW_ARB_compressed_texture_pixel_storage; continue; } #endif #ifdef GL_ARB_compute_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) { ret = GLEW_ARB_compute_shader; continue; } #endif #ifdef GL_ARB_compute_variable_group_size if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_variable_group_size", 27)) { ret = GLEW_ARB_compute_variable_group_size; continue; } #endif #ifdef GL_ARB_conditional_render_inverted if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render_inverted", 27)) { ret = GLEW_ARB_conditional_render_inverted; continue; } #endif #ifdef GL_ARB_conservative_depth if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) { ret = GLEW_ARB_conservative_depth; continue; } #endif #ifdef GL_ARB_copy_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) { ret = GLEW_ARB_copy_buffer; continue; } #endif #ifdef GL_ARB_copy_image if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) { ret = GLEW_ARB_copy_image; continue; } #endif #ifdef GL_ARB_cull_distance if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_distance", 13)) { ret = GLEW_ARB_cull_distance; continue; } #endif #ifdef GL_ARB_debug_output if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) { ret = GLEW_ARB_debug_output; continue; } #endif #ifdef GL_ARB_depth_buffer_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) { ret = GLEW_ARB_depth_buffer_float; continue; } #endif #ifdef GL_ARB_depth_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) { ret = GLEW_ARB_depth_clamp; continue; } #endif #ifdef GL_ARB_depth_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) { ret = GLEW_ARB_depth_texture; continue; } #endif #ifdef GL_ARB_derivative_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"derivative_control", 18)) { ret = GLEW_ARB_derivative_control; continue; } #endif #ifdef GL_ARB_direct_state_access if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) { ret = GLEW_ARB_direct_state_access; continue; } #endif #ifdef GL_ARB_draw_buffers if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) { ret = GLEW_ARB_draw_buffers; continue; } #endif #ifdef GL_ARB_draw_buffers_blend if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) { ret = GLEW_ARB_draw_buffers_blend; continue; } #endif #ifdef GL_ARB_draw_elements_base_vertex if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) { ret = GLEW_ARB_draw_elements_base_vertex; continue; } #endif #ifdef GL_ARB_draw_indirect if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) { ret = GLEW_ARB_draw_indirect; continue; } #endif #ifdef GL_ARB_draw_instanced if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) { ret = GLEW_ARB_draw_instanced; continue; } #endif #ifdef GL_ARB_enhanced_layouts if (_glewStrSame3(&pos, &len, (const GLubyte*)"enhanced_layouts", 16)) { ret = GLEW_ARB_enhanced_layouts; continue; } #endif #ifdef GL_ARB_explicit_attrib_location if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) { ret = GLEW_ARB_explicit_attrib_location; continue; } #endif #ifdef GL_ARB_explicit_uniform_location if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) { ret = GLEW_ARB_explicit_uniform_location; continue; } #endif #ifdef GL_ARB_fragment_coord_conventions if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) { ret = GLEW_ARB_fragment_coord_conventions; continue; } #endif #ifdef GL_ARB_fragment_layer_viewport if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) { ret = GLEW_ARB_fragment_layer_viewport; continue; } #endif #ifdef GL_ARB_fragment_program if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) { ret = GLEW_ARB_fragment_program; continue; } #endif #ifdef GL_ARB_fragment_program_shadow if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) { ret = GLEW_ARB_fragment_program_shadow; continue; } #endif #ifdef GL_ARB_fragment_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) { ret = GLEW_ARB_fragment_shader; continue; } #endif #ifdef GL_ARB_fragment_shader_interlock if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) { ret = GLEW_ARB_fragment_shader_interlock; continue; } #endif #ifdef GL_ARB_framebuffer_no_attachments if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) { ret = GLEW_ARB_framebuffer_no_attachments; continue; } #endif #ifdef GL_ARB_framebuffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) { ret = GLEW_ARB_framebuffer_object; continue; } #endif #ifdef GL_ARB_framebuffer_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) { ret = GLEW_ARB_framebuffer_sRGB; continue; } #endif #ifdef GL_ARB_geometry_shader4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) { ret = GLEW_ARB_geometry_shader4; continue; } #endif #ifdef GL_ARB_get_program_binary if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) { ret = GLEW_ARB_get_program_binary; continue; } #endif #ifdef GL_ARB_get_texture_sub_image if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_texture_sub_image", 21)) { ret = GLEW_ARB_get_texture_sub_image; continue; } #endif #ifdef GL_ARB_gpu_shader5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) { ret = GLEW_ARB_gpu_shader5; continue; } #endif #ifdef GL_ARB_gpu_shader_fp64 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) { ret = GLEW_ARB_gpu_shader_fp64; continue; } #endif #ifdef GL_ARB_gpu_shader_int64 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) { ret = GLEW_ARB_gpu_shader_int64; continue; } #endif #ifdef GL_ARB_half_float_pixel if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) { ret = GLEW_ARB_half_float_pixel; continue; } #endif #ifdef GL_ARB_half_float_vertex if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) { ret = GLEW_ARB_half_float_vertex; continue; } #endif #ifdef GL_ARB_imaging if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) { ret = GLEW_ARB_imaging; continue; } #endif #ifdef GL_ARB_indirect_parameters if (_glewStrSame3(&pos, &len, (const GLubyte*)"indirect_parameters", 19)) { ret = GLEW_ARB_indirect_parameters; continue; } #endif #ifdef GL_ARB_instanced_arrays if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) { ret = GLEW_ARB_instanced_arrays; continue; } #endif #ifdef GL_ARB_internalformat_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) { ret = GLEW_ARB_internalformat_query; continue; } #endif #ifdef GL_ARB_internalformat_query2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) { ret = GLEW_ARB_internalformat_query2; continue; } #endif #ifdef GL_ARB_invalidate_subdata if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) { ret = GLEW_ARB_invalidate_subdata; continue; } #endif #ifdef GL_ARB_map_buffer_alignment if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) { ret = GLEW_ARB_map_buffer_alignment; continue; } #endif #ifdef GL_ARB_map_buffer_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) { ret = GLEW_ARB_map_buffer_range; continue; } #endif #ifdef GL_ARB_matrix_palette if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) { ret = GLEW_ARB_matrix_palette; continue; } #endif #ifdef GL_ARB_multi_bind if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_bind", 10)) { ret = GLEW_ARB_multi_bind; continue; } #endif #ifdef GL_ARB_multi_draw_indirect if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) { ret = GLEW_ARB_multi_draw_indirect; continue; } #endif #ifdef GL_ARB_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = GLEW_ARB_multisample; continue; } #endif #ifdef GL_ARB_multitexture if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) { ret = GLEW_ARB_multitexture; continue; } #endif #ifdef GL_ARB_occlusion_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) { ret = GLEW_ARB_occlusion_query; continue; } #endif #ifdef GL_ARB_occlusion_query2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) { ret = GLEW_ARB_occlusion_query2; continue; } #endif #ifdef GL_ARB_parallel_shader_compile if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_shader_compile", 23)) { ret = GLEW_ARB_parallel_shader_compile; continue; } #endif #ifdef GL_ARB_pipeline_statistics_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"pipeline_statistics_query", 25)) { ret = GLEW_ARB_pipeline_statistics_query; continue; } #endif #ifdef GL_ARB_pixel_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) { ret = GLEW_ARB_pixel_buffer_object; continue; } #endif #ifdef GL_ARB_point_parameters if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) { ret = GLEW_ARB_point_parameters; continue; } #endif #ifdef GL_ARB_point_sprite if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) { ret = GLEW_ARB_point_sprite; continue; } #endif #ifdef GL_ARB_post_depth_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) { ret = GLEW_ARB_post_depth_coverage; continue; } #endif #ifdef GL_ARB_program_interface_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) { ret = GLEW_ARB_program_interface_query; continue; } #endif #ifdef GL_ARB_provoking_vertex if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) { ret = GLEW_ARB_provoking_vertex; continue; } #endif #ifdef GL_ARB_query_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) { ret = GLEW_ARB_query_buffer_object; continue; } #endif #ifdef GL_ARB_robust_buffer_access_behavior if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) { ret = GLEW_ARB_robust_buffer_access_behavior; continue; } #endif #ifdef GL_ARB_robustness if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) { ret = GLEW_ARB_robustness; continue; } #endif #ifdef GL_ARB_robustness_application_isolation if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) { ret = GLEW_ARB_robustness_application_isolation; continue; } #endif #ifdef GL_ARB_robustness_share_group_isolation if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) { ret = GLEW_ARB_robustness_share_group_isolation; continue; } #endif #ifdef GL_ARB_sample_locations if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) { ret = GLEW_ARB_sample_locations; continue; } #endif #ifdef GL_ARB_sample_shading if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) { ret = GLEW_ARB_sample_shading; continue; } #endif #ifdef GL_ARB_sampler_objects if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) { ret = GLEW_ARB_sampler_objects; continue; } #endif #ifdef GL_ARB_seamless_cube_map if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) { ret = GLEW_ARB_seamless_cube_map; continue; } #endif #ifdef GL_ARB_seamless_cubemap_per_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) { ret = GLEW_ARB_seamless_cubemap_per_texture; continue; } #endif #ifdef GL_ARB_separate_shader_objects if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) { ret = GLEW_ARB_separate_shader_objects; continue; } #endif #ifdef GL_ARB_shader_atomic_counter_ops if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) { ret = GLEW_ARB_shader_atomic_counter_ops; continue; } #endif #ifdef GL_ARB_shader_atomic_counters if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) { ret = GLEW_ARB_shader_atomic_counters; continue; } #endif #ifdef GL_ARB_shader_ballot if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_ballot", 13)) { ret = GLEW_ARB_shader_ballot; continue; } #endif #ifdef GL_ARB_shader_bit_encoding if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) { ret = GLEW_ARB_shader_bit_encoding; continue; } #endif #ifdef GL_ARB_shader_clock if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_clock", 12)) { ret = GLEW_ARB_shader_clock; continue; } #endif #ifdef GL_ARB_shader_draw_parameters if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_draw_parameters", 22)) { ret = GLEW_ARB_shader_draw_parameters; continue; } #endif #ifdef GL_ARB_shader_group_vote if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17)) { ret = GLEW_ARB_shader_group_vote; continue; } #endif #ifdef GL_ARB_shader_image_load_store if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) { ret = GLEW_ARB_shader_image_load_store; continue; } #endif #ifdef GL_ARB_shader_image_size if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) { ret = GLEW_ARB_shader_image_size; continue; } #endif #ifdef GL_ARB_shader_objects if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) { ret = GLEW_ARB_shader_objects; continue; } #endif #ifdef GL_ARB_shader_precision if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) { ret = GLEW_ARB_shader_precision; continue; } #endif #ifdef GL_ARB_shader_stencil_export if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) { ret = GLEW_ARB_shader_stencil_export; continue; } #endif #ifdef GL_ARB_shader_storage_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) { ret = GLEW_ARB_shader_storage_buffer_object; continue; } #endif #ifdef GL_ARB_shader_subroutine if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) { ret = GLEW_ARB_shader_subroutine; continue; } #endif #ifdef GL_ARB_shader_texture_image_samples if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_image_samples", 28)) { ret = GLEW_ARB_shader_texture_image_samples; continue; } #endif #ifdef GL_ARB_shader_texture_lod if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) { ret = GLEW_ARB_shader_texture_lod; continue; } #endif #ifdef GL_ARB_shader_viewport_layer_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_viewport_layer_array", 27)) { ret = GLEW_ARB_shader_viewport_layer_array; continue; } #endif #ifdef GL_ARB_shading_language_100 if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) { ret = GLEW_ARB_shading_language_100; continue; } #endif #ifdef GL_ARB_shading_language_420pack if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) { ret = GLEW_ARB_shading_language_420pack; continue; } #endif #ifdef GL_ARB_shading_language_include if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) { ret = GLEW_ARB_shading_language_include; continue; } #endif #ifdef GL_ARB_shading_language_packing if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) { ret = GLEW_ARB_shading_language_packing; continue; } #endif #ifdef GL_ARB_shadow if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) { ret = GLEW_ARB_shadow; continue; } #endif #ifdef GL_ARB_shadow_ambient if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) { ret = GLEW_ARB_shadow_ambient; continue; } #endif #ifdef GL_ARB_sparse_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_buffer", 13)) { ret = GLEW_ARB_sparse_buffer; continue; } #endif #ifdef GL_ARB_sparse_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) { ret = GLEW_ARB_sparse_texture; continue; } #endif #ifdef GL_ARB_sparse_texture2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) { ret = GLEW_ARB_sparse_texture2; continue; } #endif #ifdef GL_ARB_sparse_texture_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture_clamp", 20)) { ret = GLEW_ARB_sparse_texture_clamp; continue; } #endif #ifdef GL_ARB_stencil_texturing if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) { ret = GLEW_ARB_stencil_texturing; continue; } #endif #ifdef GL_ARB_sync if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) { ret = GLEW_ARB_sync; continue; } #endif #ifdef GL_ARB_tessellation_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) { ret = GLEW_ARB_tessellation_shader; continue; } #endif #ifdef GL_ARB_texture_barrier if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) { ret = GLEW_ARB_texture_barrier; continue; } #endif #ifdef GL_ARB_texture_border_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) { ret = GLEW_ARB_texture_border_clamp; continue; } #endif #ifdef GL_ARB_texture_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) { ret = GLEW_ARB_texture_buffer_object; continue; } #endif #ifdef GL_ARB_texture_buffer_object_rgb32 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) { ret = GLEW_ARB_texture_buffer_object_rgb32; continue; } #endif #ifdef GL_ARB_texture_buffer_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) { ret = GLEW_ARB_texture_buffer_range; continue; } #endif #ifdef GL_ARB_texture_compression if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) { ret = GLEW_ARB_texture_compression; continue; } #endif #ifdef GL_ARB_texture_compression_bptc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) { ret = GLEW_ARB_texture_compression_bptc; continue; } #endif #ifdef GL_ARB_texture_compression_rgtc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) { ret = GLEW_ARB_texture_compression_rgtc; continue; } #endif #ifdef GL_ARB_texture_cube_map if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) { ret = GLEW_ARB_texture_cube_map; continue; } #endif #ifdef GL_ARB_texture_cube_map_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) { ret = GLEW_ARB_texture_cube_map_array; continue; } #endif #ifdef GL_ARB_texture_env_add if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) { ret = GLEW_ARB_texture_env_add; continue; } #endif #ifdef GL_ARB_texture_env_combine if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) { ret = GLEW_ARB_texture_env_combine; continue; } #endif #ifdef GL_ARB_texture_env_crossbar if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) { ret = GLEW_ARB_texture_env_crossbar; continue; } #endif #ifdef GL_ARB_texture_env_dot3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) { ret = GLEW_ARB_texture_env_dot3; continue; } #endif #ifdef GL_ARB_texture_filter_minmax if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) { ret = GLEW_ARB_texture_filter_minmax; continue; } #endif #ifdef GL_ARB_texture_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) { ret = GLEW_ARB_texture_float; continue; } #endif #ifdef GL_ARB_texture_gather if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) { ret = GLEW_ARB_texture_gather; continue; } #endif #ifdef GL_ARB_texture_mirror_clamp_to_edge if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp_to_edge", 28)) { ret = GLEW_ARB_texture_mirror_clamp_to_edge; continue; } #endif #ifdef GL_ARB_texture_mirrored_repeat if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) { ret = GLEW_ARB_texture_mirrored_repeat; continue; } #endif #ifdef GL_ARB_texture_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) { ret = GLEW_ARB_texture_multisample; continue; } #endif #ifdef GL_ARB_texture_non_power_of_two if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) { ret = GLEW_ARB_texture_non_power_of_two; continue; } #endif #ifdef GL_ARB_texture_query_levels if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) { ret = GLEW_ARB_texture_query_levels; continue; } #endif #ifdef GL_ARB_texture_query_lod if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) { ret = GLEW_ARB_texture_query_lod; continue; } #endif #ifdef GL_ARB_texture_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) { ret = GLEW_ARB_texture_rectangle; continue; } #endif #ifdef GL_ARB_texture_rg if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) { ret = GLEW_ARB_texture_rg; continue; } #endif #ifdef GL_ARB_texture_rgb10_a2ui if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) { ret = GLEW_ARB_texture_rgb10_a2ui; continue; } #endif #ifdef GL_ARB_texture_stencil8 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stencil8", 16)) { ret = GLEW_ARB_texture_stencil8; continue; } #endif #ifdef GL_ARB_texture_storage if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) { ret = GLEW_ARB_texture_storage; continue; } #endif #ifdef GL_ARB_texture_storage_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) { ret = GLEW_ARB_texture_storage_multisample; continue; } #endif #ifdef GL_ARB_texture_swizzle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) { ret = GLEW_ARB_texture_swizzle; continue; } #endif #ifdef GL_ARB_texture_view if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) { ret = GLEW_ARB_texture_view; continue; } #endif #ifdef GL_ARB_timer_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) { ret = GLEW_ARB_timer_query; continue; } #endif #ifdef GL_ARB_transform_feedback2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) { ret = GLEW_ARB_transform_feedback2; continue; } #endif #ifdef GL_ARB_transform_feedback3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) { ret = GLEW_ARB_transform_feedback3; continue; } #endif #ifdef GL_ARB_transform_feedback_instanced if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) { ret = GLEW_ARB_transform_feedback_instanced; continue; } #endif #ifdef GL_ARB_transform_feedback_overflow_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_overflow_query", 33)) { ret = GLEW_ARB_transform_feedback_overflow_query; continue; } #endif #ifdef GL_ARB_transpose_matrix if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) { ret = GLEW_ARB_transpose_matrix; continue; } #endif #ifdef GL_ARB_uniform_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) { ret = GLEW_ARB_uniform_buffer_object; continue; } #endif #ifdef GL_ARB_vertex_array_bgra if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) { ret = GLEW_ARB_vertex_array_bgra; continue; } #endif #ifdef GL_ARB_vertex_array_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) { ret = GLEW_ARB_vertex_array_object; continue; } #endif #ifdef GL_ARB_vertex_attrib_64bit if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) { ret = GLEW_ARB_vertex_attrib_64bit; continue; } #endif #ifdef GL_ARB_vertex_attrib_binding if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) { ret = GLEW_ARB_vertex_attrib_binding; continue; } #endif #ifdef GL_ARB_vertex_blend if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) { ret = GLEW_ARB_vertex_blend; continue; } #endif #ifdef GL_ARB_vertex_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) { ret = GLEW_ARB_vertex_buffer_object; continue; } #endif #ifdef GL_ARB_vertex_program if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) { ret = GLEW_ARB_vertex_program; continue; } #endif #ifdef GL_ARB_vertex_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) { ret = GLEW_ARB_vertex_shader; continue; } #endif #ifdef GL_ARB_vertex_type_10f_11f_11f_rev if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_10f_11f_11f_rev", 27)) { ret = GLEW_ARB_vertex_type_10f_11f_11f_rev; continue; } #endif #ifdef GL_ARB_vertex_type_2_10_10_10_rev if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) { ret = GLEW_ARB_vertex_type_2_10_10_10_rev; continue; } #endif #ifdef GL_ARB_viewport_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) { ret = GLEW_ARB_viewport_array; continue; } #endif #ifdef GL_ARB_window_pos if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) { ret = GLEW_ARB_window_pos; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) { #ifdef GL_ATIX_point_sprites if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) { ret = GLEW_ATIX_point_sprites; continue; } #endif #ifdef GL_ATIX_texture_env_combine3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) { ret = GLEW_ATIX_texture_env_combine3; continue; } #endif #ifdef GL_ATIX_texture_env_route if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) { ret = GLEW_ATIX_texture_env_route; continue; } #endif #ifdef GL_ATIX_vertex_shader_output_point_size if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) { ret = GLEW_ATIX_vertex_shader_output_point_size; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) { #ifdef GL_ATI_draw_buffers if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) { ret = GLEW_ATI_draw_buffers; continue; } #endif #ifdef GL_ATI_element_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) { ret = GLEW_ATI_element_array; continue; } #endif #ifdef GL_ATI_envmap_bumpmap if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) { ret = GLEW_ATI_envmap_bumpmap; continue; } #endif #ifdef GL_ATI_fragment_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) { ret = GLEW_ATI_fragment_shader; continue; } #endif #ifdef GL_ATI_map_object_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) { ret = GLEW_ATI_map_object_buffer; continue; } #endif #ifdef GL_ATI_meminfo if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) { ret = GLEW_ATI_meminfo; continue; } #endif #ifdef GL_ATI_pn_triangles if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) { ret = GLEW_ATI_pn_triangles; continue; } #endif #ifdef GL_ATI_separate_stencil if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) { ret = GLEW_ATI_separate_stencil; continue; } #endif #ifdef GL_ATI_shader_texture_lod if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) { ret = GLEW_ATI_shader_texture_lod; continue; } #endif #ifdef GL_ATI_text_fragment_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) { ret = GLEW_ATI_text_fragment_shader; continue; } #endif #ifdef GL_ATI_texture_compression_3dc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) { ret = GLEW_ATI_texture_compression_3dc; continue; } #endif #ifdef GL_ATI_texture_env_combine3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) { ret = GLEW_ATI_texture_env_combine3; continue; } #endif #ifdef GL_ATI_texture_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) { ret = GLEW_ATI_texture_float; continue; } #endif #ifdef GL_ATI_texture_mirror_once if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) { ret = GLEW_ATI_texture_mirror_once; continue; } #endif #ifdef GL_ATI_vertex_array_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) { ret = GLEW_ATI_vertex_array_object; continue; } #endif #ifdef GL_ATI_vertex_attrib_array_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) { ret = GLEW_ATI_vertex_attrib_array_object; continue; } #endif #ifdef GL_ATI_vertex_streams if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) { ret = GLEW_ATI_vertex_streams; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) { #ifdef GL_EXT_422_pixels if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) { ret = GLEW_EXT_422_pixels; continue; } #endif #ifdef GL_EXT_Cg_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) { ret = GLEW_EXT_Cg_shader; continue; } #endif #ifdef GL_EXT_abgr if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) { ret = GLEW_EXT_abgr; continue; } #endif #ifdef GL_EXT_bgra if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) { ret = GLEW_EXT_bgra; continue; } #endif #ifdef GL_EXT_bindable_uniform if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) { ret = GLEW_EXT_bindable_uniform; continue; } #endif #ifdef GL_EXT_blend_color if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) { ret = GLEW_EXT_blend_color; continue; } #endif #ifdef GL_EXT_blend_equation_separate if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) { ret = GLEW_EXT_blend_equation_separate; continue; } #endif #ifdef GL_EXT_blend_func_separate if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) { ret = GLEW_EXT_blend_func_separate; continue; } #endif #ifdef GL_EXT_blend_logic_op if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) { ret = GLEW_EXT_blend_logic_op; continue; } #endif #ifdef GL_EXT_blend_minmax if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) { ret = GLEW_EXT_blend_minmax; continue; } #endif #ifdef GL_EXT_blend_subtract if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) { ret = GLEW_EXT_blend_subtract; continue; } #endif #ifdef GL_EXT_clip_volume_hint if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) { ret = GLEW_EXT_clip_volume_hint; continue; } #endif #ifdef GL_EXT_cmyka if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) { ret = GLEW_EXT_cmyka; continue; } #endif #ifdef GL_EXT_color_subtable if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) { ret = GLEW_EXT_color_subtable; continue; } #endif #ifdef GL_EXT_compiled_vertex_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) { ret = GLEW_EXT_compiled_vertex_array; continue; } #endif #ifdef GL_EXT_convolution if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) { ret = GLEW_EXT_convolution; continue; } #endif #ifdef GL_EXT_coordinate_frame if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) { ret = GLEW_EXT_coordinate_frame; continue; } #endif #ifdef GL_EXT_copy_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) { ret = GLEW_EXT_copy_texture; continue; } #endif #ifdef GL_EXT_cull_vertex if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) { ret = GLEW_EXT_cull_vertex; continue; } #endif #ifdef GL_EXT_debug_label if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_label", 11)) { ret = GLEW_EXT_debug_label; continue; } #endif #ifdef GL_EXT_debug_marker if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) { ret = GLEW_EXT_debug_marker; continue; } #endif #ifdef GL_EXT_depth_bounds_test if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) { ret = GLEW_EXT_depth_bounds_test; continue; } #endif #ifdef GL_EXT_direct_state_access if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) { ret = GLEW_EXT_direct_state_access; continue; } #endif #ifdef GL_EXT_draw_buffers2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) { ret = GLEW_EXT_draw_buffers2; continue; } #endif #ifdef GL_EXT_draw_instanced if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) { ret = GLEW_EXT_draw_instanced; continue; } #endif #ifdef GL_EXT_draw_range_elements if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) { ret = GLEW_EXT_draw_range_elements; continue; } #endif #ifdef GL_EXT_fog_coord if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) { ret = GLEW_EXT_fog_coord; continue; } #endif #ifdef GL_EXT_fragment_lighting if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) { ret = GLEW_EXT_fragment_lighting; continue; } #endif #ifdef GL_EXT_framebuffer_blit if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) { ret = GLEW_EXT_framebuffer_blit; continue; } #endif #ifdef GL_EXT_framebuffer_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) { ret = GLEW_EXT_framebuffer_multisample; continue; } #endif #ifdef GL_EXT_framebuffer_multisample_blit_scaled if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) { ret = GLEW_EXT_framebuffer_multisample_blit_scaled; continue; } #endif #ifdef GL_EXT_framebuffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) { ret = GLEW_EXT_framebuffer_object; continue; } #endif #ifdef GL_EXT_framebuffer_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) { ret = GLEW_EXT_framebuffer_sRGB; continue; } #endif #ifdef GL_EXT_geometry_shader4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) { ret = GLEW_EXT_geometry_shader4; continue; } #endif #ifdef GL_EXT_gpu_program_parameters if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) { ret = GLEW_EXT_gpu_program_parameters; continue; } #endif #ifdef GL_EXT_gpu_shader4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) { ret = GLEW_EXT_gpu_shader4; continue; } #endif #ifdef GL_EXT_histogram if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) { ret = GLEW_EXT_histogram; continue; } #endif #ifdef GL_EXT_index_array_formats if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) { ret = GLEW_EXT_index_array_formats; continue; } #endif #ifdef GL_EXT_index_func if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) { ret = GLEW_EXT_index_func; continue; } #endif #ifdef GL_EXT_index_material if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) { ret = GLEW_EXT_index_material; continue; } #endif #ifdef GL_EXT_index_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) { ret = GLEW_EXT_index_texture; continue; } #endif #ifdef GL_EXT_light_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) { ret = GLEW_EXT_light_texture; continue; } #endif #ifdef GL_EXT_misc_attribute if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) { ret = GLEW_EXT_misc_attribute; continue; } #endif #ifdef GL_EXT_multi_draw_arrays if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) { ret = GLEW_EXT_multi_draw_arrays; continue; } #endif #ifdef GL_EXT_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = GLEW_EXT_multisample; continue; } #endif #ifdef GL_EXT_packed_depth_stencil if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) { ret = GLEW_EXT_packed_depth_stencil; continue; } #endif #ifdef GL_EXT_packed_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) { ret = GLEW_EXT_packed_float; continue; } #endif #ifdef GL_EXT_packed_pixels if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) { ret = GLEW_EXT_packed_pixels; continue; } #endif #ifdef GL_EXT_paletted_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) { ret = GLEW_EXT_paletted_texture; continue; } #endif #ifdef GL_EXT_pixel_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) { ret = GLEW_EXT_pixel_buffer_object; continue; } #endif #ifdef GL_EXT_pixel_transform if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) { ret = GLEW_EXT_pixel_transform; continue; } #endif #ifdef GL_EXT_pixel_transform_color_table if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) { ret = GLEW_EXT_pixel_transform_color_table; continue; } #endif #ifdef GL_EXT_point_parameters if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) { ret = GLEW_EXT_point_parameters; continue; } #endif #ifdef GL_EXT_polygon_offset if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) { ret = GLEW_EXT_polygon_offset; continue; } #endif #ifdef GL_EXT_polygon_offset_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset_clamp", 20)) { ret = GLEW_EXT_polygon_offset_clamp; continue; } #endif #ifdef GL_EXT_post_depth_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) { ret = GLEW_EXT_post_depth_coverage; continue; } #endif #ifdef GL_EXT_provoking_vertex if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) { ret = GLEW_EXT_provoking_vertex; continue; } #endif #ifdef GL_EXT_raster_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"raster_multisample", 18)) { ret = GLEW_EXT_raster_multisample; continue; } #endif #ifdef GL_EXT_rescale_normal if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) { ret = GLEW_EXT_rescale_normal; continue; } #endif #ifdef GL_EXT_scene_marker if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) { ret = GLEW_EXT_scene_marker; continue; } #endif #ifdef GL_EXT_secondary_color if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) { ret = GLEW_EXT_secondary_color; continue; } #endif #ifdef GL_EXT_separate_shader_objects if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) { ret = GLEW_EXT_separate_shader_objects; continue; } #endif #ifdef GL_EXT_separate_specular_color if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) { ret = GLEW_EXT_separate_specular_color; continue; } #endif #ifdef GL_EXT_shader_image_load_formatted if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_formatted", 27)) { ret = GLEW_EXT_shader_image_load_formatted; continue; } #endif #ifdef GL_EXT_shader_image_load_store if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) { ret = GLEW_EXT_shader_image_load_store; continue; } #endif #ifdef GL_EXT_shader_integer_mix if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_integer_mix", 18)) { ret = GLEW_EXT_shader_integer_mix; continue; } #endif #ifdef GL_EXT_shadow_funcs if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) { ret = GLEW_EXT_shadow_funcs; continue; } #endif #ifdef GL_EXT_shared_texture_palette if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) { ret = GLEW_EXT_shared_texture_palette; continue; } #endif #ifdef GL_EXT_sparse_texture2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) { ret = GLEW_EXT_sparse_texture2; continue; } #endif #ifdef GL_EXT_stencil_clear_tag if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) { ret = GLEW_EXT_stencil_clear_tag; continue; } #endif #ifdef GL_EXT_stencil_two_side if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) { ret = GLEW_EXT_stencil_two_side; continue; } #endif #ifdef GL_EXT_stencil_wrap if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) { ret = GLEW_EXT_stencil_wrap; continue; } #endif #ifdef GL_EXT_subtexture if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) { ret = GLEW_EXT_subtexture; continue; } #endif #ifdef GL_EXT_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) { ret = GLEW_EXT_texture; continue; } #endif #ifdef GL_EXT_texture3D if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) { ret = GLEW_EXT_texture3D; continue; } #endif #ifdef GL_EXT_texture_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) { ret = GLEW_EXT_texture_array; continue; } #endif #ifdef GL_EXT_texture_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) { ret = GLEW_EXT_texture_buffer_object; continue; } #endif #ifdef GL_EXT_texture_compression_dxt1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) { ret = GLEW_EXT_texture_compression_dxt1; continue; } #endif #ifdef GL_EXT_texture_compression_latc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) { ret = GLEW_EXT_texture_compression_latc; continue; } #endif #ifdef GL_EXT_texture_compression_rgtc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) { ret = GLEW_EXT_texture_compression_rgtc; continue; } #endif #ifdef GL_EXT_texture_compression_s3tc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) { ret = GLEW_EXT_texture_compression_s3tc; continue; } #endif #ifdef GL_EXT_texture_cube_map if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) { ret = GLEW_EXT_texture_cube_map; continue; } #endif #ifdef GL_EXT_texture_edge_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) { ret = GLEW_EXT_texture_edge_clamp; continue; } #endif #ifdef GL_EXT_texture_env if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) { ret = GLEW_EXT_texture_env; continue; } #endif #ifdef GL_EXT_texture_env_add if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) { ret = GLEW_EXT_texture_env_add; continue; } #endif #ifdef GL_EXT_texture_env_combine if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) { ret = GLEW_EXT_texture_env_combine; continue; } #endif #ifdef GL_EXT_texture_env_dot3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) { ret = GLEW_EXT_texture_env_dot3; continue; } #endif #ifdef GL_EXT_texture_filter_anisotropic if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) { ret = GLEW_EXT_texture_filter_anisotropic; continue; } #endif #ifdef GL_EXT_texture_filter_minmax if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) { ret = GLEW_EXT_texture_filter_minmax; continue; } #endif #ifdef GL_EXT_texture_integer if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) { ret = GLEW_EXT_texture_integer; continue; } #endif #ifdef GL_EXT_texture_lod_bias if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) { ret = GLEW_EXT_texture_lod_bias; continue; } #endif #ifdef GL_EXT_texture_mirror_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) { ret = GLEW_EXT_texture_mirror_clamp; continue; } #endif #ifdef GL_EXT_texture_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) { ret = GLEW_EXT_texture_object; continue; } #endif #ifdef GL_EXT_texture_perturb_normal if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) { ret = GLEW_EXT_texture_perturb_normal; continue; } #endif #ifdef GL_EXT_texture_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) { ret = GLEW_EXT_texture_rectangle; continue; } #endif #ifdef GL_EXT_texture_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) { ret = GLEW_EXT_texture_sRGB; continue; } #endif #ifdef GL_EXT_texture_sRGB_decode if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) { ret = GLEW_EXT_texture_sRGB_decode; continue; } #endif #ifdef GL_EXT_texture_shared_exponent if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) { ret = GLEW_EXT_texture_shared_exponent; continue; } #endif #ifdef GL_EXT_texture_snorm if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) { ret = GLEW_EXT_texture_snorm; continue; } #endif #ifdef GL_EXT_texture_swizzle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) { ret = GLEW_EXT_texture_swizzle; continue; } #endif #ifdef GL_EXT_timer_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) { ret = GLEW_EXT_timer_query; continue; } #endif #ifdef GL_EXT_transform_feedback if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) { ret = GLEW_EXT_transform_feedback; continue; } #endif #ifdef GL_EXT_vertex_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) { ret = GLEW_EXT_vertex_array; continue; } #endif #ifdef GL_EXT_vertex_array_bgra if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) { ret = GLEW_EXT_vertex_array_bgra; continue; } #endif #ifdef GL_EXT_vertex_attrib_64bit if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) { ret = GLEW_EXT_vertex_attrib_64bit; continue; } #endif #ifdef GL_EXT_vertex_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) { ret = GLEW_EXT_vertex_shader; continue; } #endif #ifdef GL_EXT_vertex_weighting if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) { ret = GLEW_EXT_vertex_weighting; continue; } #endif #ifdef GL_EXT_x11_sync_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) { ret = GLEW_EXT_x11_sync_object; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) { #ifdef GL_GREMEDY_frame_terminator if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) { ret = GLEW_GREMEDY_frame_terminator; continue; } #endif #ifdef GL_GREMEDY_string_marker if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) { ret = GLEW_GREMEDY_string_marker; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) { #ifdef GL_HP_convolution_border_modes if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) { ret = GLEW_HP_convolution_border_modes; continue; } #endif #ifdef GL_HP_image_transform if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) { ret = GLEW_HP_image_transform; continue; } #endif #ifdef GL_HP_occlusion_test if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) { ret = GLEW_HP_occlusion_test; continue; } #endif #ifdef GL_HP_texture_lighting if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) { ret = GLEW_HP_texture_lighting; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) { #ifdef GL_IBM_cull_vertex if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) { ret = GLEW_IBM_cull_vertex; continue; } #endif #ifdef GL_IBM_multimode_draw_arrays if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) { ret = GLEW_IBM_multimode_draw_arrays; continue; } #endif #ifdef GL_IBM_rasterpos_clip if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) { ret = GLEW_IBM_rasterpos_clip; continue; } #endif #ifdef GL_IBM_static_data if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) { ret = GLEW_IBM_static_data; continue; } #endif #ifdef GL_IBM_texture_mirrored_repeat if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) { ret = GLEW_IBM_texture_mirrored_repeat; continue; } #endif #ifdef GL_IBM_vertex_array_lists if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) { ret = GLEW_IBM_vertex_array_lists; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) { #ifdef GL_INGR_color_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) { ret = GLEW_INGR_color_clamp; continue; } #endif #ifdef GL_INGR_interlace_read if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) { ret = GLEW_INGR_interlace_read; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) { #ifdef GL_INTEL_fragment_shader_ordering if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_ordering", 24)) { ret = GLEW_INTEL_fragment_shader_ordering; continue; } #endif #ifdef GL_INTEL_framebuffer_CMAA if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_CMAA", 16)) { ret = GLEW_INTEL_framebuffer_CMAA; continue; } #endif #ifdef GL_INTEL_map_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_texture", 11)) { ret = GLEW_INTEL_map_texture; continue; } #endif #ifdef GL_INTEL_parallel_arrays if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) { ret = GLEW_INTEL_parallel_arrays; continue; } #endif #ifdef GL_INTEL_performance_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_query", 17)) { ret = GLEW_INTEL_performance_query; continue; } #endif #ifdef GL_INTEL_texture_scissor if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) { ret = GLEW_INTEL_texture_scissor; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) { #ifdef GL_KHR_blend_equation_advanced if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) { ret = GLEW_KHR_blend_equation_advanced; continue; } #endif #ifdef GL_KHR_blend_equation_advanced_coherent if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) { ret = GLEW_KHR_blend_equation_advanced_coherent; continue; } #endif #ifdef GL_KHR_context_flush_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) { ret = GLEW_KHR_context_flush_control; continue; } #endif #ifdef GL_KHR_debug if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) { ret = GLEW_KHR_debug; continue; } #endif #ifdef GL_KHR_no_error if (_glewStrSame3(&pos, &len, (const GLubyte*)"no_error", 8)) { ret = GLEW_KHR_no_error; continue; } #endif #ifdef GL_KHR_robust_buffer_access_behavior if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) { ret = GLEW_KHR_robust_buffer_access_behavior; continue; } #endif #ifdef GL_KHR_robustness if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) { ret = GLEW_KHR_robustness; continue; } #endif #ifdef GL_KHR_texture_compression_astc_hdr if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_hdr", 28)) { ret = GLEW_KHR_texture_compression_astc_hdr; continue; } #endif #ifdef GL_KHR_texture_compression_astc_ldr if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) { ret = GLEW_KHR_texture_compression_astc_ldr; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) { #ifdef GL_KTX_buffer_region if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) { ret = GLEW_KTX_buffer_region; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) { #ifdef GL_MESAX_texture_stack if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) { ret = GLEW_MESAX_texture_stack; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) { #ifdef GL_MESA_pack_invert if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) { ret = GLEW_MESA_pack_invert; continue; } #endif #ifdef GL_MESA_resize_buffers if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) { ret = GLEW_MESA_resize_buffers; continue; } #endif #ifdef GL_MESA_window_pos if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) { ret = GLEW_MESA_window_pos; continue; } #endif #ifdef GL_MESA_ycbcr_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) { ret = GLEW_MESA_ycbcr_texture; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) { #ifdef GL_NVX_conditional_render if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) { ret = GLEW_NVX_conditional_render; continue; } #endif #ifdef GL_NVX_gpu_memory_info if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) { ret = GLEW_NVX_gpu_memory_info; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) { #ifdef GL_NV_bindless_multi_draw_indirect if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect", 28)) { ret = GLEW_NV_bindless_multi_draw_indirect; continue; } #endif #ifdef GL_NV_bindless_multi_draw_indirect_count if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect_count", 34)) { ret = GLEW_NV_bindless_multi_draw_indirect_count; continue; } #endif #ifdef GL_NV_bindless_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) { ret = GLEW_NV_bindless_texture; continue; } #endif #ifdef GL_NV_blend_equation_advanced if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) { ret = GLEW_NV_blend_equation_advanced; continue; } #endif #ifdef GL_NV_blend_equation_advanced_coherent if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) { ret = GLEW_NV_blend_equation_advanced_coherent; continue; } #endif #ifdef GL_NV_blend_square if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) { ret = GLEW_NV_blend_square; continue; } #endif #ifdef GL_NV_compute_program5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_program5", 16)) { ret = GLEW_NV_compute_program5; continue; } #endif #ifdef GL_NV_conditional_render if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) { ret = GLEW_NV_conditional_render; continue; } #endif #ifdef GL_NV_conservative_raster if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster", 19)) { ret = GLEW_NV_conservative_raster; continue; } #endif #ifdef GL_NV_conservative_raster_dilate if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster_dilate", 26)) { ret = GLEW_NV_conservative_raster_dilate; continue; } #endif #ifdef GL_NV_copy_depth_to_color if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) { ret = GLEW_NV_copy_depth_to_color; continue; } #endif #ifdef GL_NV_copy_image if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) { ret = GLEW_NV_copy_image; continue; } #endif #ifdef GL_NV_deep_texture3D if (_glewStrSame3(&pos, &len, (const GLubyte*)"deep_texture3D", 14)) { ret = GLEW_NV_deep_texture3D; continue; } #endif #ifdef GL_NV_depth_buffer_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) { ret = GLEW_NV_depth_buffer_float; continue; } #endif #ifdef GL_NV_depth_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) { ret = GLEW_NV_depth_clamp; continue; } #endif #ifdef GL_NV_depth_range_unclamped if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) { ret = GLEW_NV_depth_range_unclamped; continue; } #endif #ifdef GL_NV_draw_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_texture", 12)) { ret = GLEW_NV_draw_texture; continue; } #endif #ifdef GL_NV_evaluators if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) { ret = GLEW_NV_evaluators; continue; } #endif #ifdef GL_NV_explicit_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) { ret = GLEW_NV_explicit_multisample; continue; } #endif #ifdef GL_NV_fence if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) { ret = GLEW_NV_fence; continue; } #endif #ifdef GL_NV_fill_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"fill_rectangle", 14)) { ret = GLEW_NV_fill_rectangle; continue; } #endif #ifdef GL_NV_float_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) { ret = GLEW_NV_float_buffer; continue; } #endif #ifdef GL_NV_fog_distance if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) { ret = GLEW_NV_fog_distance; continue; } #endif #ifdef GL_NV_fragment_coverage_to_color if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coverage_to_color", 26)) { ret = GLEW_NV_fragment_coverage_to_color; continue; } #endif #ifdef GL_NV_fragment_program if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) { ret = GLEW_NV_fragment_program; continue; } #endif #ifdef GL_NV_fragment_program2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) { ret = GLEW_NV_fragment_program2; continue; } #endif #ifdef GL_NV_fragment_program4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) { ret = GLEW_NV_fragment_program4; continue; } #endif #ifdef GL_NV_fragment_program_option if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) { ret = GLEW_NV_fragment_program_option; continue; } #endif #ifdef GL_NV_fragment_shader_interlock if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) { ret = GLEW_NV_fragment_shader_interlock; continue; } #endif #ifdef GL_NV_framebuffer_mixed_samples if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_mixed_samples", 25)) { ret = GLEW_NV_framebuffer_mixed_samples; continue; } #endif #ifdef GL_NV_framebuffer_multisample_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) { ret = GLEW_NV_framebuffer_multisample_coverage; continue; } #endif #ifdef GL_NV_geometry_program4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) { ret = GLEW_NV_geometry_program4; continue; } #endif #ifdef GL_NV_geometry_shader4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) { ret = GLEW_NV_geometry_shader4; continue; } #endif #ifdef GL_NV_geometry_shader_passthrough if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader_passthrough", 27)) { ret = GLEW_NV_geometry_shader_passthrough; continue; } #endif #ifdef GL_NV_gpu_program4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) { ret = GLEW_NV_gpu_program4; continue; } #endif #ifdef GL_NV_gpu_program5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) { ret = GLEW_NV_gpu_program5; continue; } #endif #ifdef GL_NV_gpu_program5_mem_extended if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5_mem_extended", 25)) { ret = GLEW_NV_gpu_program5_mem_extended; continue; } #endif #ifdef GL_NV_gpu_program_fp64 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) { ret = GLEW_NV_gpu_program_fp64; continue; } #endif #ifdef GL_NV_gpu_shader5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) { ret = GLEW_NV_gpu_shader5; continue; } #endif #ifdef GL_NV_half_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) { ret = GLEW_NV_half_float; continue; } #endif #ifdef GL_NV_internalformat_sample_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_sample_query", 27)) { ret = GLEW_NV_internalformat_sample_query; continue; } #endif #ifdef GL_NV_light_max_exponent if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) { ret = GLEW_NV_light_max_exponent; continue; } #endif #ifdef GL_NV_multisample_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) { ret = GLEW_NV_multisample_coverage; continue; } #endif #ifdef GL_NV_multisample_filter_hint if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) { ret = GLEW_NV_multisample_filter_hint; continue; } #endif #ifdef GL_NV_occlusion_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) { ret = GLEW_NV_occlusion_query; continue; } #endif #ifdef GL_NV_packed_depth_stencil if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) { ret = GLEW_NV_packed_depth_stencil; continue; } #endif #ifdef GL_NV_parameter_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) { ret = GLEW_NV_parameter_buffer_object; continue; } #endif #ifdef GL_NV_parameter_buffer_object2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) { ret = GLEW_NV_parameter_buffer_object2; continue; } #endif #ifdef GL_NV_path_rendering if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) { ret = GLEW_NV_path_rendering; continue; } #endif #ifdef GL_NV_path_rendering_shared_edge if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering_shared_edge", 26)) { ret = GLEW_NV_path_rendering_shared_edge; continue; } #endif #ifdef GL_NV_pixel_data_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) { ret = GLEW_NV_pixel_data_range; continue; } #endif #ifdef GL_NV_point_sprite if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) { ret = GLEW_NV_point_sprite; continue; } #endif #ifdef GL_NV_present_video if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) { ret = GLEW_NV_present_video; continue; } #endif #ifdef GL_NV_primitive_restart if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) { ret = GLEW_NV_primitive_restart; continue; } #endif #ifdef GL_NV_register_combiners if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) { ret = GLEW_NV_register_combiners; continue; } #endif #ifdef GL_NV_register_combiners2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) { ret = GLEW_NV_register_combiners2; continue; } #endif #ifdef GL_NV_sample_locations if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) { ret = GLEW_NV_sample_locations; continue; } #endif #ifdef GL_NV_sample_mask_override_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_mask_override_coverage", 29)) { ret = GLEW_NV_sample_mask_override_coverage; continue; } #endif #ifdef GL_NV_shader_atomic_counters if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) { ret = GLEW_NV_shader_atomic_counters; continue; } #endif #ifdef GL_NV_shader_atomic_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) { ret = GLEW_NV_shader_atomic_float; continue; } #endif #ifdef GL_NV_shader_atomic_fp16_vector if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_fp16_vector", 25)) { ret = GLEW_NV_shader_atomic_fp16_vector; continue; } #endif #ifdef GL_NV_shader_atomic_int64 if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_int64", 19)) { ret = GLEW_NV_shader_atomic_int64; continue; } #endif #ifdef GL_NV_shader_buffer_load if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) { ret = GLEW_NV_shader_buffer_load; continue; } #endif #ifdef GL_NV_shader_storage_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) { ret = GLEW_NV_shader_storage_buffer_object; continue; } #endif #ifdef GL_NV_shader_thread_group if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_group", 19)) { ret = GLEW_NV_shader_thread_group; continue; } #endif #ifdef GL_NV_shader_thread_shuffle if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_shuffle", 21)) { ret = GLEW_NV_shader_thread_shuffle; continue; } #endif #ifdef GL_NV_tessellation_program5 if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) { ret = GLEW_NV_tessellation_program5; continue; } #endif #ifdef GL_NV_texgen_emboss if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) { ret = GLEW_NV_texgen_emboss; continue; } #endif #ifdef GL_NV_texgen_reflection if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) { ret = GLEW_NV_texgen_reflection; continue; } #endif #ifdef GL_NV_texture_barrier if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) { ret = GLEW_NV_texture_barrier; continue; } #endif #ifdef GL_NV_texture_compression_vtc if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) { ret = GLEW_NV_texture_compression_vtc; continue; } #endif #ifdef GL_NV_texture_env_combine4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) { ret = GLEW_NV_texture_env_combine4; continue; } #endif #ifdef GL_NV_texture_expand_normal if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) { ret = GLEW_NV_texture_expand_normal; continue; } #endif #ifdef GL_NV_texture_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) { ret = GLEW_NV_texture_multisample; continue; } #endif #ifdef GL_NV_texture_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) { ret = GLEW_NV_texture_rectangle; continue; } #endif #ifdef GL_NV_texture_shader if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) { ret = GLEW_NV_texture_shader; continue; } #endif #ifdef GL_NV_texture_shader2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) { ret = GLEW_NV_texture_shader2; continue; } #endif #ifdef GL_NV_texture_shader3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) { ret = GLEW_NV_texture_shader3; continue; } #endif #ifdef GL_NV_transform_feedback if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) { ret = GLEW_NV_transform_feedback; continue; } #endif #ifdef GL_NV_transform_feedback2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) { ret = GLEW_NV_transform_feedback2; continue; } #endif #ifdef GL_NV_uniform_buffer_unified_memory if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_unified_memory", 29)) { ret = GLEW_NV_uniform_buffer_unified_memory; continue; } #endif #ifdef GL_NV_vdpau_interop if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) { ret = GLEW_NV_vdpau_interop; continue; } #endif #ifdef GL_NV_vertex_array_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) { ret = GLEW_NV_vertex_array_range; continue; } #endif #ifdef GL_NV_vertex_array_range2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) { ret = GLEW_NV_vertex_array_range2; continue; } #endif #ifdef GL_NV_vertex_attrib_integer_64bit if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) { ret = GLEW_NV_vertex_attrib_integer_64bit; continue; } #endif #ifdef GL_NV_vertex_buffer_unified_memory if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) { ret = GLEW_NV_vertex_buffer_unified_memory; continue; } #endif #ifdef GL_NV_vertex_program if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) { ret = GLEW_NV_vertex_program; continue; } #endif #ifdef GL_NV_vertex_program1_1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) { ret = GLEW_NV_vertex_program1_1; continue; } #endif #ifdef GL_NV_vertex_program2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) { ret = GLEW_NV_vertex_program2; continue; } #endif #ifdef GL_NV_vertex_program2_option if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) { ret = GLEW_NV_vertex_program2_option; continue; } #endif #ifdef GL_NV_vertex_program3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) { ret = GLEW_NV_vertex_program3; continue; } #endif #ifdef GL_NV_vertex_program4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) { ret = GLEW_NV_vertex_program4; continue; } #endif #ifdef GL_NV_video_capture if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) { ret = GLEW_NV_video_capture; continue; } #endif #ifdef GL_NV_viewport_array2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array2", 15)) { ret = GLEW_NV_viewport_array2; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) { #ifdef GL_OES_byte_coordinates if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) { ret = GLEW_OES_byte_coordinates; continue; } #endif #ifdef GL_OES_compressed_paletted_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) { ret = GLEW_OES_compressed_paletted_texture; continue; } #endif #ifdef GL_OES_read_format if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) { ret = GLEW_OES_read_format; continue; } #endif #ifdef GL_OES_single_precision if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) { ret = GLEW_OES_single_precision; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) { #ifdef GL_OML_interlace if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) { ret = GLEW_OML_interlace; continue; } #endif #ifdef GL_OML_resample if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) { ret = GLEW_OML_resample; continue; } #endif #ifdef GL_OML_subsample if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) { ret = GLEW_OML_subsample; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OVR_", 4)) { #ifdef GL_OVR_multiview if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview", 9)) { ret = GLEW_OVR_multiview; continue; } #endif #ifdef GL_OVR_multiview2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview2", 10)) { ret = GLEW_OVR_multiview2; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) { #ifdef GL_PGI_misc_hints if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) { ret = GLEW_PGI_misc_hints; continue; } #endif #ifdef GL_PGI_vertex_hints if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) { ret = GLEW_PGI_vertex_hints; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) { #ifdef GL_REGAL_ES1_0_compatibility if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_0_compatibility", 19)) { ret = GLEW_REGAL_ES1_0_compatibility; continue; } #endif #ifdef GL_REGAL_ES1_1_compatibility if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_1_compatibility", 19)) { ret = GLEW_REGAL_ES1_1_compatibility; continue; } #endif #ifdef GL_REGAL_enable if (_glewStrSame3(&pos, &len, (const GLubyte*)"enable", 6)) { ret = GLEW_REGAL_enable; continue; } #endif #ifdef GL_REGAL_error_string if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) { ret = GLEW_REGAL_error_string; continue; } #endif #ifdef GL_REGAL_extension_query if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) { ret = GLEW_REGAL_extension_query; continue; } #endif #ifdef GL_REGAL_log if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) { ret = GLEW_REGAL_log; continue; } #endif #ifdef GL_REGAL_proc_address if (_glewStrSame3(&pos, &len, (const GLubyte*)"proc_address", 12)) { ret = GLEW_REGAL_proc_address; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) { #ifdef GL_REND_screen_coordinates if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) { ret = GLEW_REND_screen_coordinates; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) { #ifdef GL_S3_s3tc if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) { ret = GLEW_S3_s3tc; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) { #ifdef GL_SGIS_color_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) { ret = GLEW_SGIS_color_range; continue; } #endif #ifdef GL_SGIS_detail_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) { ret = GLEW_SGIS_detail_texture; continue; } #endif #ifdef GL_SGIS_fog_function if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) { ret = GLEW_SGIS_fog_function; continue; } #endif #ifdef GL_SGIS_generate_mipmap if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) { ret = GLEW_SGIS_generate_mipmap; continue; } #endif #ifdef GL_SGIS_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = GLEW_SGIS_multisample; continue; } #endif #ifdef GL_SGIS_pixel_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) { ret = GLEW_SGIS_pixel_texture; continue; } #endif #ifdef GL_SGIS_point_line_texgen if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) { ret = GLEW_SGIS_point_line_texgen; continue; } #endif #ifdef GL_SGIS_sharpen_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) { ret = GLEW_SGIS_sharpen_texture; continue; } #endif #ifdef GL_SGIS_texture4D if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) { ret = GLEW_SGIS_texture4D; continue; } #endif #ifdef GL_SGIS_texture_border_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) { ret = GLEW_SGIS_texture_border_clamp; continue; } #endif #ifdef GL_SGIS_texture_edge_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) { ret = GLEW_SGIS_texture_edge_clamp; continue; } #endif #ifdef GL_SGIS_texture_filter4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) { ret = GLEW_SGIS_texture_filter4; continue; } #endif #ifdef GL_SGIS_texture_lod if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) { ret = GLEW_SGIS_texture_lod; continue; } #endif #ifdef GL_SGIS_texture_select if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) { ret = GLEW_SGIS_texture_select; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) { #ifdef GL_SGIX_async if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) { ret = GLEW_SGIX_async; continue; } #endif #ifdef GL_SGIX_async_histogram if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) { ret = GLEW_SGIX_async_histogram; continue; } #endif #ifdef GL_SGIX_async_pixel if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) { ret = GLEW_SGIX_async_pixel; continue; } #endif #ifdef GL_SGIX_blend_alpha_minmax if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) { ret = GLEW_SGIX_blend_alpha_minmax; continue; } #endif #ifdef GL_SGIX_clipmap if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) { ret = GLEW_SGIX_clipmap; continue; } #endif #ifdef GL_SGIX_convolution_accuracy if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) { ret = GLEW_SGIX_convolution_accuracy; continue; } #endif #ifdef GL_SGIX_depth_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) { ret = GLEW_SGIX_depth_texture; continue; } #endif #ifdef GL_SGIX_flush_raster if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) { ret = GLEW_SGIX_flush_raster; continue; } #endif #ifdef GL_SGIX_fog_offset if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) { ret = GLEW_SGIX_fog_offset; continue; } #endif #ifdef GL_SGIX_fog_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) { ret = GLEW_SGIX_fog_texture; continue; } #endif #ifdef GL_SGIX_fragment_specular_lighting if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) { ret = GLEW_SGIX_fragment_specular_lighting; continue; } #endif #ifdef GL_SGIX_framezoom if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) { ret = GLEW_SGIX_framezoom; continue; } #endif #ifdef GL_SGIX_interlace if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) { ret = GLEW_SGIX_interlace; continue; } #endif #ifdef GL_SGIX_ir_instrument1 if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) { ret = GLEW_SGIX_ir_instrument1; continue; } #endif #ifdef GL_SGIX_list_priority if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) { ret = GLEW_SGIX_list_priority; continue; } #endif #ifdef GL_SGIX_pixel_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) { ret = GLEW_SGIX_pixel_texture; continue; } #endif #ifdef GL_SGIX_pixel_texture_bits if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) { ret = GLEW_SGIX_pixel_texture_bits; continue; } #endif #ifdef GL_SGIX_reference_plane if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) { ret = GLEW_SGIX_reference_plane; continue; } #endif #ifdef GL_SGIX_resample if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) { ret = GLEW_SGIX_resample; continue; } #endif #ifdef GL_SGIX_shadow if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) { ret = GLEW_SGIX_shadow; continue; } #endif #ifdef GL_SGIX_shadow_ambient if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) { ret = GLEW_SGIX_shadow_ambient; continue; } #endif #ifdef GL_SGIX_sprite if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) { ret = GLEW_SGIX_sprite; continue; } #endif #ifdef GL_SGIX_tag_sample_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) { ret = GLEW_SGIX_tag_sample_buffer; continue; } #endif #ifdef GL_SGIX_texture_add_env if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) { ret = GLEW_SGIX_texture_add_env; continue; } #endif #ifdef GL_SGIX_texture_coordinate_clamp if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) { ret = GLEW_SGIX_texture_coordinate_clamp; continue; } #endif #ifdef GL_SGIX_texture_lod_bias if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) { ret = GLEW_SGIX_texture_lod_bias; continue; } #endif #ifdef GL_SGIX_texture_multi_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) { ret = GLEW_SGIX_texture_multi_buffer; continue; } #endif #ifdef GL_SGIX_texture_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) { ret = GLEW_SGIX_texture_range; continue; } #endif #ifdef GL_SGIX_texture_scale_bias if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) { ret = GLEW_SGIX_texture_scale_bias; continue; } #endif #ifdef GL_SGIX_vertex_preclip if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) { ret = GLEW_SGIX_vertex_preclip; continue; } #endif #ifdef GL_SGIX_vertex_preclip_hint if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) { ret = GLEW_SGIX_vertex_preclip_hint; continue; } #endif #ifdef GL_SGIX_ycrcb if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) { ret = GLEW_SGIX_ycrcb; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) { #ifdef GL_SGI_color_matrix if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) { ret = GLEW_SGI_color_matrix; continue; } #endif #ifdef GL_SGI_color_table if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) { ret = GLEW_SGI_color_table; continue; } #endif #ifdef GL_SGI_texture_color_table if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) { ret = GLEW_SGI_texture_color_table; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) { #ifdef GL_SUNX_constant_data if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) { ret = GLEW_SUNX_constant_data; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) { #ifdef GL_SUN_convolution_border_modes if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) { ret = GLEW_SUN_convolution_border_modes; continue; } #endif #ifdef GL_SUN_global_alpha if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) { ret = GLEW_SUN_global_alpha; continue; } #endif #ifdef GL_SUN_mesh_array if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) { ret = GLEW_SUN_mesh_array; continue; } #endif #ifdef GL_SUN_read_video_pixels if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) { ret = GLEW_SUN_read_video_pixels; continue; } #endif #ifdef GL_SUN_slice_accum if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) { ret = GLEW_SUN_slice_accum; continue; } #endif #ifdef GL_SUN_triangle_list if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) { ret = GLEW_SUN_triangle_list; continue; } #endif #ifdef GL_SUN_vertex if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) { ret = GLEW_SUN_vertex; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) { #ifdef GL_WIN_phong_shading if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) { ret = GLEW_WIN_phong_shading; continue; } #endif #ifdef GL_WIN_specular_fog if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) { ret = GLEW_WIN_specular_fog; continue; } #endif #ifdef GL_WIN_swap_hint if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) { ret = GLEW_WIN_swap_hint; continue; } #endif } } ret = (len == 0); } return ret; } #if defined(_WIN32) #if defined(GLEW_MX) GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) #else GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) #endif { const GLubyte* pos = (const GLubyte*)name; GLuint len = _glewStrLen(pos); GLboolean ret = GL_TRUE; while (ret && len > 0) { if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) { if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) { #ifdef WGL_3DFX_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = WGLEW_3DFX_multisample; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) { #ifdef WGL_3DL_stereo_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) { ret = WGLEW_3DL_stereo_control; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) { #ifdef WGL_AMD_gpu_association if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) { ret = WGLEW_AMD_gpu_association; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) { #ifdef WGL_ARB_buffer_region if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) { ret = WGLEW_ARB_buffer_region; continue; } #endif #ifdef WGL_ARB_context_flush_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) { ret = WGLEW_ARB_context_flush_control; continue; } #endif #ifdef WGL_ARB_create_context if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) { ret = WGLEW_ARB_create_context; continue; } #endif #ifdef WGL_ARB_create_context_profile if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) { ret = WGLEW_ARB_create_context_profile; continue; } #endif #ifdef WGL_ARB_create_context_robustness if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) { ret = WGLEW_ARB_create_context_robustness; continue; } #endif #ifdef WGL_ARB_extensions_string if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) { ret = WGLEW_ARB_extensions_string; continue; } #endif #ifdef WGL_ARB_framebuffer_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) { ret = WGLEW_ARB_framebuffer_sRGB; continue; } #endif #ifdef WGL_ARB_make_current_read if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) { ret = WGLEW_ARB_make_current_read; continue; } #endif #ifdef WGL_ARB_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = WGLEW_ARB_multisample; continue; } #endif #ifdef WGL_ARB_pbuffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) { ret = WGLEW_ARB_pbuffer; continue; } #endif #ifdef WGL_ARB_pixel_format if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) { ret = WGLEW_ARB_pixel_format; continue; } #endif #ifdef WGL_ARB_pixel_format_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) { ret = WGLEW_ARB_pixel_format_float; continue; } #endif #ifdef WGL_ARB_render_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) { ret = WGLEW_ARB_render_texture; continue; } #endif #ifdef WGL_ARB_robustness_application_isolation if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) { ret = WGLEW_ARB_robustness_application_isolation; continue; } #endif #ifdef WGL_ARB_robustness_share_group_isolation if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) { ret = WGLEW_ARB_robustness_share_group_isolation; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) { #ifdef WGL_ATI_pixel_format_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) { ret = WGLEW_ATI_pixel_format_float; continue; } #endif #ifdef WGL_ATI_render_texture_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) { ret = WGLEW_ATI_render_texture_rectangle; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) { #ifdef WGL_EXT_create_context_es2_profile if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) { ret = WGLEW_EXT_create_context_es2_profile; continue; } #endif #ifdef WGL_EXT_create_context_es_profile if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) { ret = WGLEW_EXT_create_context_es_profile; continue; } #endif #ifdef WGL_EXT_depth_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) { ret = WGLEW_EXT_depth_float; continue; } #endif #ifdef WGL_EXT_display_color_table if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) { ret = WGLEW_EXT_display_color_table; continue; } #endif #ifdef WGL_EXT_extensions_string if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) { ret = WGLEW_EXT_extensions_string; continue; } #endif #ifdef WGL_EXT_framebuffer_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) { ret = WGLEW_EXT_framebuffer_sRGB; continue; } #endif #ifdef WGL_EXT_make_current_read if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) { ret = WGLEW_EXT_make_current_read; continue; } #endif #ifdef WGL_EXT_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = WGLEW_EXT_multisample; continue; } #endif #ifdef WGL_EXT_pbuffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) { ret = WGLEW_EXT_pbuffer; continue; } #endif #ifdef WGL_EXT_pixel_format if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) { ret = WGLEW_EXT_pixel_format; continue; } #endif #ifdef WGL_EXT_pixel_format_packed_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) { ret = WGLEW_EXT_pixel_format_packed_float; continue; } #endif #ifdef WGL_EXT_swap_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) { ret = WGLEW_EXT_swap_control; continue; } #endif #ifdef WGL_EXT_swap_control_tear if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) { ret = WGLEW_EXT_swap_control_tear; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) { #ifdef WGL_I3D_digital_video_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) { ret = WGLEW_I3D_digital_video_control; continue; } #endif #ifdef WGL_I3D_gamma if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) { ret = WGLEW_I3D_gamma; continue; } #endif #ifdef WGL_I3D_genlock if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) { ret = WGLEW_I3D_genlock; continue; } #endif #ifdef WGL_I3D_image_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) { ret = WGLEW_I3D_image_buffer; continue; } #endif #ifdef WGL_I3D_swap_frame_lock if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) { ret = WGLEW_I3D_swap_frame_lock; continue; } #endif #ifdef WGL_I3D_swap_frame_usage if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) { ret = WGLEW_I3D_swap_frame_usage; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) { #ifdef WGL_NV_DX_interop if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) { ret = WGLEW_NV_DX_interop; continue; } #endif #ifdef WGL_NV_DX_interop2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) { ret = WGLEW_NV_DX_interop2; continue; } #endif #ifdef WGL_NV_copy_image if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) { ret = WGLEW_NV_copy_image; continue; } #endif #ifdef WGL_NV_delay_before_swap if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) { ret = WGLEW_NV_delay_before_swap; continue; } #endif #ifdef WGL_NV_float_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) { ret = WGLEW_NV_float_buffer; continue; } #endif #ifdef WGL_NV_gpu_affinity if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) { ret = WGLEW_NV_gpu_affinity; continue; } #endif #ifdef WGL_NV_multisample_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) { ret = WGLEW_NV_multisample_coverage; continue; } #endif #ifdef WGL_NV_present_video if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) { ret = WGLEW_NV_present_video; continue; } #endif #ifdef WGL_NV_render_depth_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) { ret = WGLEW_NV_render_depth_texture; continue; } #endif #ifdef WGL_NV_render_texture_rectangle if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) { ret = WGLEW_NV_render_texture_rectangle; continue; } #endif #ifdef WGL_NV_swap_group if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) { ret = WGLEW_NV_swap_group; continue; } #endif #ifdef WGL_NV_vertex_array_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) { ret = WGLEW_NV_vertex_array_range; continue; } #endif #ifdef WGL_NV_video_capture if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) { ret = WGLEW_NV_video_capture; continue; } #endif #ifdef WGL_NV_video_output if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) { ret = WGLEW_NV_video_output; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) { #ifdef WGL_OML_sync_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) { ret = WGLEW_OML_sync_control; continue; } #endif } } ret = (len == 0); } return ret; } #elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) #if defined(GLEW_MX) GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) #else GLboolean glxewIsSupported (const char* name) #endif { const GLubyte* pos = (const GLubyte*)name; GLuint len = _glewStrLen(pos); GLboolean ret = GL_TRUE; while (ret && len > 0) { if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) { if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) { #ifdef GLX_VERSION_1_2 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) { ret = GLXEW_VERSION_1_2; continue; } #endif #ifdef GLX_VERSION_1_3 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) { ret = GLXEW_VERSION_1_3; continue; } #endif #ifdef GLX_VERSION_1_4 if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) { ret = GLXEW_VERSION_1_4; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) { #ifdef GLX_3DFX_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = GLXEW_3DFX_multisample; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) { #ifdef GLX_AMD_gpu_association if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) { ret = GLXEW_AMD_gpu_association; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) { #ifdef GLX_ARB_context_flush_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) { ret = GLXEW_ARB_context_flush_control; continue; } #endif #ifdef GLX_ARB_create_context if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) { ret = GLXEW_ARB_create_context; continue; } #endif #ifdef GLX_ARB_create_context_profile if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) { ret = GLXEW_ARB_create_context_profile; continue; } #endif #ifdef GLX_ARB_create_context_robustness if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) { ret = GLXEW_ARB_create_context_robustness; continue; } #endif #ifdef GLX_ARB_fbconfig_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) { ret = GLXEW_ARB_fbconfig_float; continue; } #endif #ifdef GLX_ARB_framebuffer_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) { ret = GLXEW_ARB_framebuffer_sRGB; continue; } #endif #ifdef GLX_ARB_get_proc_address if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) { ret = GLXEW_ARB_get_proc_address; continue; } #endif #ifdef GLX_ARB_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = GLXEW_ARB_multisample; continue; } #endif #ifdef GLX_ARB_robustness_application_isolation if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) { ret = GLXEW_ARB_robustness_application_isolation; continue; } #endif #ifdef GLX_ARB_robustness_share_group_isolation if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) { ret = GLXEW_ARB_robustness_share_group_isolation; continue; } #endif #ifdef GLX_ARB_vertex_buffer_object if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) { ret = GLXEW_ARB_vertex_buffer_object; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) { #ifdef GLX_ATI_pixel_format_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) { ret = GLXEW_ATI_pixel_format_float; continue; } #endif #ifdef GLX_ATI_render_texture if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) { ret = GLXEW_ATI_render_texture; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) { #ifdef GLX_EXT_buffer_age if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10)) { ret = GLXEW_EXT_buffer_age; continue; } #endif #ifdef GLX_EXT_create_context_es2_profile if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) { ret = GLXEW_EXT_create_context_es2_profile; continue; } #endif #ifdef GLX_EXT_create_context_es_profile if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) { ret = GLXEW_EXT_create_context_es_profile; continue; } #endif #ifdef GLX_EXT_fbconfig_packed_float if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) { ret = GLXEW_EXT_fbconfig_packed_float; continue; } #endif #ifdef GLX_EXT_framebuffer_sRGB if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) { ret = GLXEW_EXT_framebuffer_sRGB; continue; } #endif #ifdef GLX_EXT_import_context if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) { ret = GLXEW_EXT_import_context; continue; } #endif #ifdef GLX_EXT_scene_marker if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) { ret = GLXEW_EXT_scene_marker; continue; } #endif #ifdef GLX_EXT_stereo_tree if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_tree", 11)) { ret = GLXEW_EXT_stereo_tree; continue; } #endif #ifdef GLX_EXT_swap_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) { ret = GLXEW_EXT_swap_control; continue; } #endif #ifdef GLX_EXT_swap_control_tear if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) { ret = GLXEW_EXT_swap_control_tear; continue; } #endif #ifdef GLX_EXT_texture_from_pixmap if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) { ret = GLXEW_EXT_texture_from_pixmap; continue; } #endif #ifdef GLX_EXT_visual_info if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) { ret = GLXEW_EXT_visual_info; continue; } #endif #ifdef GLX_EXT_visual_rating if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) { ret = GLXEW_EXT_visual_rating; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) { #ifdef GLX_INTEL_swap_event if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) { ret = GLXEW_INTEL_swap_event; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) { #ifdef GLX_MESA_agp_offset if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) { ret = GLXEW_MESA_agp_offset; continue; } #endif #ifdef GLX_MESA_copy_sub_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) { ret = GLXEW_MESA_copy_sub_buffer; continue; } #endif #ifdef GLX_MESA_pixmap_colormap if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) { ret = GLXEW_MESA_pixmap_colormap; continue; } #endif #ifdef GLX_MESA_query_renderer if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_renderer", 14)) { ret = GLXEW_MESA_query_renderer; continue; } #endif #ifdef GLX_MESA_release_buffers if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) { ret = GLXEW_MESA_release_buffers; continue; } #endif #ifdef GLX_MESA_set_3dfx_mode if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) { ret = GLXEW_MESA_set_3dfx_mode; continue; } #endif #ifdef GLX_MESA_swap_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) { ret = GLXEW_MESA_swap_control; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) { #ifdef GLX_NV_copy_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) { ret = GLXEW_NV_copy_buffer; continue; } #endif #ifdef GLX_NV_copy_image if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) { ret = GLXEW_NV_copy_image; continue; } #endif #ifdef GLX_NV_delay_before_swap if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) { ret = GLXEW_NV_delay_before_swap; continue; } #endif #ifdef GLX_NV_float_buffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) { ret = GLXEW_NV_float_buffer; continue; } #endif #ifdef GLX_NV_multisample_coverage if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) { ret = GLXEW_NV_multisample_coverage; continue; } #endif #ifdef GLX_NV_present_video if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) { ret = GLXEW_NV_present_video; continue; } #endif #ifdef GLX_NV_swap_group if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) { ret = GLXEW_NV_swap_group; continue; } #endif #ifdef GLX_NV_vertex_array_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) { ret = GLXEW_NV_vertex_array_range; continue; } #endif #ifdef GLX_NV_video_capture if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) { ret = GLXEW_NV_video_capture; continue; } #endif #ifdef GLX_NV_video_out if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_out", 9)) { ret = GLXEW_NV_video_out; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) { #ifdef GLX_OML_swap_method if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) { ret = GLXEW_OML_swap_method; continue; } #endif #ifdef GLX_OML_sync_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) { ret = GLXEW_OML_sync_control; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) { #ifdef GLX_SGIS_blended_overlay if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) { ret = GLXEW_SGIS_blended_overlay; continue; } #endif #ifdef GLX_SGIS_color_range if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) { ret = GLXEW_SGIS_color_range; continue; } #endif #ifdef GLX_SGIS_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) { ret = GLXEW_SGIS_multisample; continue; } #endif #ifdef GLX_SGIS_shared_multisample if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) { ret = GLXEW_SGIS_shared_multisample; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) { #ifdef GLX_SGIX_fbconfig if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) { ret = GLXEW_SGIX_fbconfig; continue; } #endif #ifdef GLX_SGIX_hyperpipe if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) { ret = GLXEW_SGIX_hyperpipe; continue; } #endif #ifdef GLX_SGIX_pbuffer if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) { ret = GLXEW_SGIX_pbuffer; continue; } #endif #ifdef GLX_SGIX_swap_barrier if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) { ret = GLXEW_SGIX_swap_barrier; continue; } #endif #ifdef GLX_SGIX_swap_group if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) { ret = GLXEW_SGIX_swap_group; continue; } #endif #ifdef GLX_SGIX_video_resize if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) { ret = GLXEW_SGIX_video_resize; continue; } #endif #ifdef GLX_SGIX_visual_select_group if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) { ret = GLXEW_SGIX_visual_select_group; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) { #ifdef GLX_SGI_cushion if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) { ret = GLXEW_SGI_cushion; continue; } #endif #ifdef GLX_SGI_make_current_read if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) { ret = GLXEW_SGI_make_current_read; continue; } #endif #ifdef GLX_SGI_swap_control if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) { ret = GLXEW_SGI_swap_control; continue; } #endif #ifdef GLX_SGI_video_sync if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) { ret = GLXEW_SGI_video_sync; continue; } #endif } if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) { #ifdef GLX_SUN_get_transparent_index if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) { ret = GLXEW_SUN_get_transparent_index; continue; } #endif #ifdef GLX_SUN_video_resize if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) { ret = GLXEW_SUN_video_resize; continue; } #endif } } ret = (len == 0); } return ret; } #endif /* _WIN32 */ goxel-0.8.1/ext_src/imgui/000077500000000000000000000000001334742672700154365ustar00rootroot00000000000000goxel-0.8.1/ext_src/imgui/imconfig.h000066400000000000000000000077011334742672700174070ustar00rootroot00000000000000//----------------------------------------------------------------------------- // COMPILE-TIME OPTIONS FOR DEAR IMGUI // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. //----------------------------------------------------------------------------- // A) You may edit imconfig.h (and not overwrite it when updating imgui, or maintain a patch/branch with your modifications to imconfig.h) // B) or add configuration directives in your own file and compile with #define IMGUI_USER_CONFIG "myfilename.h" // C) Many compile-time options have an effect on data structures. They need defined consistently _everywhere_ imgui.h is included, // not only for the imgui*.cpp compilation units. Defining those options in imconfig.h will ensure they correctly get used everywhere. //----------------------------------------------------------------------------- #pragma once //---- Define assertion handler. Defaults to calling assert(). //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows. //#define IMGUI_API __declspec( dllexport ) //#define IMGUI_API __declspec( dllimport ) //---- Don't define obsolete functions/enums names. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS //---- Don't implement default handlers for Windows (so as not to link with certain functions) //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // Don't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // Don't use and link with ImmGetContext/ImmSetCompositionWindow. //---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty) //---- It is very strongly recommended to NOT disable the demo windows during development. Please read the comments in imgui_demo.cpp. //#define IMGUI_DISABLE_DEMO_WINDOWS //---- Don't implement ImFormatString(), ImFormatStringV() so you can reimplement them yourself. //#define IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS //---- Include imgui_user.h at the end of imgui.h as a convenience //#define IMGUI_INCLUDE_IMGUI_USER_H //---- Pack colors to BGRA8 instead of RGBA8 (if you needed to convert from one to another anyway) //#define IMGUI_USE_BGRA_PACKED_COLOR //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version // By default the embedded implementations are declared static and not available outside of imgui cpp files. //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION //---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4. // This will be inlined as part of ImVec2 and ImVec4 class declarations. /* #define IM_VEC2_CLASS_EXTRA \ ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ operator MyVec2() const { return MyVec2(x,y); } #define IM_VEC4_CLASS_EXTRA \ ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ operator MyVec4() const { return MyVec4(x,y,z,w); } */ //---- Use 32-bit vertex indices (default is 16-bit) to allow meshes with more than 64K vertices. Render function needs to support it. //#define ImDrawIdx unsigned int //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. /* namespace ImGui { void MyFunction(const char* name, const MyMatrix44& v); } */ goxel-0.8.1/ext_src/imgui/imgui.cpp000066400000000000000000023056671334742672700172770ustar00rootroot00000000000000// dear imgui, v1.61 WIP // (main code and documentation) // Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code. // Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase. // Get latest version at https://github.com/ocornut/imgui // Releases change-log at https://github.com/ocornut/imgui/releases // Gallery (please post your screenshots/video there!): https://github.com/ocornut/imgui/issues/1269 // Developed by Omar Cornut and every direct or indirect contributors to the GitHub. // This library is free but I need your support to sustain development and maintenance. // If you work for a company, please consider financial support, see README. For individuals: https://www.patreon.com/imgui // It is recommended that you don't modify imgui.cpp! It will become difficult for you to update the library. // Note that 'ImGui::' being a namespace, you can add functions into the namespace from your own source files, without // modifying imgui.h or imgui.cpp. You may include imgui_internal.h to access internal data structures, but it doesn't // come with any guarantee of forward compatibility. Discussing your changes on the GitHub Issue Tracker may lead you // to a better solution or official support for them. /* Index - MISSION STATEMENT - END-USER GUIDE - PROGRAMMER GUIDE (read me!) - Read first - How to update to a newer version of Dear ImGui - Getting started with integrating Dear ImGui in your code/engine - Using gamepad/keyboard navigation controls [BETA] - API BREAKING CHANGES (read me when you update!) - ISSUES & TODO LIST - FREQUENTLY ASKED QUESTIONS (FAQ), TIPS - How can I tell whether to dispatch mouse/keyboard to imgui or to my application? - How can I display an image? What is ImTextureID, how does it works? - How can I have multiple widgets with the same label or without a label? A primer on labels and the ID Stack. - How can I load a different font than the default? - How can I easily use icons in my application? - How can I load multiple fonts? - How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic? - How can I use the drawing facilities without an ImGui window? (using ImDrawList API) - I integrated Dear ImGui in my engine and the text or lines are blurry.. - I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around.. - How can I help? - ISSUES & TODO-LIST - CODE MISSION STATEMENT ================= - Easy to use to create code-driven and data-driven tools - Easy to use to create ad hoc short-lived tools and long-lived, more elaborate tools - Easy to hack and improve - Minimize screen real-estate usage - Minimize setup and maintenance - Minimize state storage on user side - Portable, minimize dependencies, run on target (consoles, phones, etc.) - Efficient runtime and memory consumption (NB- we do allocate when "growing" content e.g. creating a window, opening a tree node for the first time, etc. but a typical frame should not allocate anything) Designed for developers and content-creators, not the typical end-user! Some of the weaknesses includes: - Doesn't look fancy, doesn't animate - Limited layout features, intricate layouts are typically crafted in code END-USER GUIDE ============== - Double-click on title bar to collapse window. - Click upper right corner to close a window, available when 'bool* p_open' is passed to ImGui::Begin(). - Click and drag on lower right corner to resize window (double-click to auto fit window to its contents). - Click and drag on any empty space to move window. - TAB/SHIFT+TAB to cycle through keyboard editable fields. - CTRL+Click on a slider or drag box to input value as text. - Use mouse wheel to scroll. - Text editor: - Hold SHIFT or use mouse to select text. - CTRL+Left/Right to word jump. - CTRL+Shift+Left/Right to select words. - CTRL+A our Double-Click to select all. - CTRL+X,CTRL+C,CTRL+V to use OS clipboard/ - CTRL+Z,CTRL+Y to undo/redo. - ESCAPE to revert text to its original value. - You can apply arithmetic operators +,*,/ on numerical values. Use +- to subtract (because - would set a negative value!) - Controls are automatically adjusted for OSX to match standard OSX text editing operations. - General Keyboard controls: enable with ImGuiConfigFlags_NavEnableKeyboard. - General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. See suggested mappings in imgui.h ImGuiNavInput_ + download PNG/PSD at http://goo.gl/9LgVZW PROGRAMMER GUIDE ================ READ FIRST - Read the FAQ below this section! - Your code creates the UI, if your code doesn't run the UI is gone! The UI can be highly dynamic, there are no construction or destruction steps, less data retention on your side, less state duplication, less state synchronization, less bugs. - Call and read ImGui::ShowDemoWindow() for demo code demonstrating most features. - You can learn about immediate-mode gui principles at http://www.johno.se/book/imgui.html or watch http://mollyrocket.com/861 HOW TO UPDATE TO A NEWER VERSION OF DEAR IMGUI - Overwrite all the sources files except for imconfig.h (if you have made modification to your copy of imconfig.h) - Read the "API BREAKING CHANGES" section (below). This is where we list occasional API breaking changes. If a function/type has been renamed / or marked obsolete, try to fix the name in your code before it is permanently removed from the public API. If you have a problem with a missing function/symbols, search for its name in the code, there will likely be a comment about it. Please report any issue to the GitHub page! - Try to keep your copy of dear imgui reasonably up to date. GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE - Run and study the examples and demo to get acquainted with the library. - Add the Dear ImGui source files to your projects, using your preferred build system. It is recommended you build the .cpp files as part of your project and not as a library. - You can later customize the imconfig.h file to tweak some compilation time behavior, such as integrating imgui types with your own maths types. - You may be able to grab and copy a ready made imgui_impl_*** file from the examples/ folder. - When using Dear ImGui, your programming IDE is your friend: follow the declaration of variables, functions and types to find comments about them. - Init: retrieve the ImGuiIO structure with ImGui::GetIO() and fill the fields marked 'Settings': at minimum you need to set io.DisplaySize (application resolution). Later on you will fill your keyboard mapping, clipboard handlers, and other advanced features but for a basic integration you don't need to worry about it all. - Init: call io.Fonts->GetTexDataAsRGBA32(...), it will build the font atlas texture, then load the texture pixels into graphics memory. - Every frame: - In your main loop as early a possible, fill the IO fields marked 'Input' (e.g. mouse position, buttons, keyboard info, etc.) - Call ImGui::NewFrame() to begin the frame - You can use any ImGui function you want between NewFrame() and Render() - Call ImGui::Render() as late as you can to end the frame and finalize render data. it will call your io.RenderDrawListFn handler. (Even if you don't render, call Render() and ignore the callback, or call EndFrame() instead. Otherwhise some features will break) - All rendering information are stored into command-lists until ImGui::Render() is called. - Dear ImGui never touches or knows about your GPU state. the only function that knows about GPU is the RenderDrawListFn handler that you provide. - Effectively it means you can create widgets at any time in your code, regardless of considerations of being in "update" vs "render" phases of your own application. - Refer to the examples applications in the examples/ folder for instruction on how to setup your code. - A minimal application skeleton may be: // Application init ImGui::CreateContext(); ImGuiIO& io = ImGui::GetIO(); io.DisplaySize.x = 1920.0f; io.DisplaySize.y = 1280.0f; // TODO: Fill others settings of the io structure later. // Load texture atlas (there is a default font so you don't need to care about choosing a font yet) unsigned char* pixels; int width, height; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // TODO: At this points you've got the texture data and you need to upload that your your graphic system: MyTexture* texture = MyEngine::CreateTextureFromMemoryPixels(pixels, width, height, TEXTURE_TYPE_RGBA) // TODO: Store your texture pointer/identifier (whatever your engine uses) in 'io.Fonts->TexID'. This will be passed back to your via the renderer. io.Fonts->TexID = (void*)texture; // Application main loop while (true) { // Setup low-level inputs (e.g. on Win32, GetKeyboardState(), or write to those fields from your Windows message loop handlers, etc.) ImGuiIO& io = ImGui::GetIO(); io.DeltaTime = 1.0f/60.0f; io.MousePos = mouse_pos; io.MouseDown[0] = mouse_button_0; io.MouseDown[1] = mouse_button_1; // Call NewFrame(), after this point you can use ImGui::* functions anytime ImGui::NewFrame(); // Most of your application code here MyGameUpdate(); // may use any ImGui functions, e.g. ImGui::Begin("My window"); ImGui::Text("Hello, world!"); ImGui::End(); MyGameRender(); // may use any ImGui functions as well! // Render & swap video buffers ImGui::Render(); MyImGuiRenderFunction(ImGui::GetDrawData()); SwapBuffers(); } // Shutdown ImGui::DestroyContext(); - A minimal render function skeleton may be: void void MyRenderFunction(ImDrawData* draw_data) { // TODO: Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled // TODO: Setup viewport, orthographic projection matrix // TODO: Setup shader: vertex { float2 pos, float2 uv, u32 color }, fragment shader sample color from 1 texture, multiply by vertex color. for (int n = 0; n < draw_data->CmdListsCount; n++) { const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; // vertex buffer generated by ImGui const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; // index buffer generated by ImGui for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) { const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; if (pcmd->UserCallback) { pcmd->UserCallback(cmd_list, pcmd); } else { // The texture for the draw call is specified by pcmd->TextureId. // The vast majority of draw calls with use the imgui texture atlas, which value you have set yourself during initialization. MyEngineBindTexture(pcmd->TextureId); // We are using scissoring to clip some objects. All low-level graphics API supports it. // If your engine doesn't support scissoring yet, you may ignore this at first. You will get some small glitches // (some elements visible outside their bounds) but you can fix that once everywhere else works! MyEngineScissor((int)pcmd->ClipRect.x, (int)pcmd->ClipRect.y, (int)(pcmd->ClipRect.z - pcmd->ClipRect.x), (int)(pcmd->ClipRect.w - pcmd->ClipRect.y)); // Render 'pcmd->ElemCount/3' indexed triangles. // By default the indices ImDrawIdx are 16-bits, you can change them to 32-bits if your engine doesn't support 16-bits indices. MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer, vtx_buffer); } idx_buffer += pcmd->ElemCount; } } } - The examples/ folders contains many functional implementation of the pseudo-code above. - When calling NewFrame(), the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags are updated. They tell you if ImGui intends to use your inputs. When a flag is set you want to hide the corresponding inputs from the rest of your application. However, in both cases you need to pass on the inputs to imgui. Read the FAQ below for more information about those flags. - Please read the FAQ above. Amusingly, it is called a FAQ because people frequently have the same issues! USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS [BETA] - The gamepad/keyboard navigation is in Beta. Ask questions and report issues at https://github.com/ocornut/imgui/issues/787 - The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable. - Gamepad: - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame(). - See 'enum ImGuiNavInput_' in imgui.h for a description of inputs. For each entry of io.NavInputs[], set the following values: 0.0f= not held. 1.0f= fully held. Pass intermediate 0.0f..1.0f values for analog triggers/sticks. - We uses a simple >0.0f test for activation testing, and won't attempt to test for a dead-zone. Your code will probably need to transform your raw inputs (such as e.g. remapping your 0.2..0.9 raw input range to 0.0..1.0 imgui range, etc.). - You can download PNG/PSD files depicting the gamepad controls for common controllers at: goo.gl/9LgVZW. - If you need to share inputs between your game and the imgui parts, the easiest approach is to go all-or-nothing, with a buttons combo to toggle the target. Please reach out if you think the game vs navigation input sharing could be improved. - Keyboard: - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeyDown[] + io.KeyMap[] arrays. - When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), the io.WantCaptureKeyboard flag will be set. For more advanced uses, you may want to read from: - io.NavActive: true when a window is focused and it doesn't have the ImGuiWindowFlags_NoNavInputs flag set. - io.NavVisible: true when the navigation cursor is visible (and usually goes false when mouse is used). - or query focus information with e.g. IsWindowFocused(ImGuiFocusedFlags_AnyWindow), IsItemFocused() etc. functions. Please reach out if you think the game vs navigation input sharing could be improved. - Mouse: - PS4 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback. - Consoles/Tablet/Phone users: Consider using a Synergy 1.x server (on your PC) + uSynergy.c (on your console/tablet/phone app) to share your PC mouse/keyboard. - On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag. Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs dear imgui to move your mouse cursor along with navigation movements. When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved. When that happens your back-end NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the binding in examples/ do that. (If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, imgui will misbehave as it will see your mouse as moving back and forth!) (In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want to set a boolean to ignore your other external mouse positions until the external source is moved again.) API BREAKING CHANGES ==================== Occasionally introducing changes that are breaking the API. The breakage are generally minor and easy to fix. Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code. Also read releases logs https://github.com/ocornut/imgui/releases for more details. - 2018/04/09 (1.61) - IM_DELETE() helper function added in 1.60 doesn't clear the input _pointer_ reference, more consistent with expectation and allows passing r-value. - 2018/03/20 (1.60) - Renamed io.WantMoveMouse to io.WantSetMousePos for consistency and ease of understanding (was added in 1.52, _not_ used by core and only honored by some binding ahead of merging the Nav branch). - 2018/03/12 (1.60) - Removed ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered as the closing cross uses regular button colors now. - 2018/03/08 (1.60) - Changed ImFont::DisplayOffset.y to default to 0 instead of +1. Fixed rounding of Ascent/Descent to match TrueType renderer. If you were adding or subtracting to ImFont::DisplayOffset check if your fonts are correctly aligned vertically. - 2018/03/03 (1.60) - Renamed ImGuiStyleVar_Count_ to ImGuiStyleVar_COUNT and ImGuiMouseCursor_Count_ to ImGuiMouseCursor_COUNT for consistency with other public enums. - 2018/02/18 (1.60) - BeginDragDropSource(): temporarily removed the optional mouse_button=0 parameter because it is not really usable in many situations at the moment. - 2018/02/16 (1.60) - obsoleted the io.RenderDrawListsFn callback, you can call your graphics engine render function after ImGui::Render(). Use ImGui::GetDrawData() to retrieve the ImDrawData* to display. - 2018/02/07 (1.60) - reorganized context handling to be more explicit, - YOU NOW NEED TO CALL ImGui::CreateContext() AT THE BEGINNING OF YOUR APP, AND CALL ImGui::DestroyContext() AT THE END. - removed Shutdown() function, as DestroyContext() serve this purpose. - you may pass a ImFontAtlas* pointer to CreateContext() to share a font atlas between contexts. Otherwhise CreateContext() will create its own font atlas instance. - removed allocator parameters from CreateContext(), they are now setup with SetAllocatorFunctions(), and shared by all contexts. - removed the default global context and font atlas instance, which were confusing for users of DLL reloading and users of multiple contexts. - 2018/01/31 (1.60) - moved sample TTF files from extra_fonts/ to misc/fonts/. If you loaded files directly from the imgui repo you may need to update your paths. - 2018/01/11 (1.60) - obsoleted IsAnyWindowHovered() in favor of IsWindowHovered(ImGuiHoveredFlags_AnyWindow). Kept redirection function (will obsolete). - 2018/01/11 (1.60) - obsoleted IsAnyWindowFocused() in favor of IsWindowFocused(ImGuiFocusedFlags_AnyWindow). Kept redirection function (will obsolete). - 2018/01/03 (1.60) - renamed ImGuiSizeConstraintCallback to ImGuiSizeCallback, ImGuiSizeConstraintCallbackData to ImGuiSizeCallbackData. - 2017/12/29 (1.60) - removed CalcItemRectClosestPoint() which was weird and not really used by anyone except demo code. If you need it it's easy to replicate on your side. - 2017/12/24 (1.53) - renamed the emblematic ShowTestWindow() function to ShowDemoWindow(). Kept redirection function (will obsolete). - 2017/12/21 (1.53) - ImDrawList: renamed style.AntiAliasedShapes to style.AntiAliasedFill for consistency and as a way to explicitly break code that manipulate those flag at runtime. You can now manipulate ImDrawList::Flags - 2017/12/21 (1.53) - ImDrawList: removed 'bool anti_aliased = true' final parameter of ImDrawList::AddPolyline() and ImDrawList::AddConvexPolyFilled(). Prefer manipulating ImDrawList::Flags if you need to toggle them during the frame. - 2017/12/14 (1.53) - using the ImGuiWindowFlags_NoScrollWithMouse flag on a child window forwards the mouse wheel event to the parent window, unless either ImGuiWindowFlags_NoInputs or ImGuiWindowFlags_NoScrollbar are also set. - 2017/12/13 (1.53) - renamed GetItemsLineHeightWithSpacing() to GetFrameHeightWithSpacing(). Kept redirection function (will obsolete). - 2017/12/13 (1.53) - obsoleted IsRootWindowFocused() in favor of using IsWindowFocused(ImGuiFocusedFlags_RootWindow). Kept redirection function (will obsolete). - obsoleted IsRootWindowOrAnyChildFocused() in favor of using IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows). Kept redirection function (will obsolete). - 2017/12/12 (1.53) - renamed ImGuiTreeNodeFlags_AllowOverlapMode to ImGuiTreeNodeFlags_AllowItemOverlap. Kept redirection enum (will obsolete). - 2017/12/10 (1.53) - removed SetNextWindowContentWidth(), prefer using SetNextWindowContentSize(). Kept redirection function (will obsolete). - 2017/11/27 (1.53) - renamed ImGuiTextBuffer::append() helper to appendf(), appendv() to appendfv(). If you copied the 'Log' demo in your code, it uses appendv() so that needs to be renamed. - 2017/11/18 (1.53) - Style, Begin: removed ImGuiWindowFlags_ShowBorders window flag. Borders are now fully set up in the ImGuiStyle structure (see e.g. style.FrameBorderSize, style.WindowBorderSize). Use ImGui::ShowStyleEditor() to look them up. Please note that the style system will keep evolving (hopefully stabilizing in Q1 2018), and so custom styles will probably subtly break over time. It is recommended you use the StyleColorsClassic(), StyleColorsDark(), StyleColorsLight() functions. - 2017/11/18 (1.53) - Style: removed ImGuiCol_ComboBg in favor of combo boxes using ImGuiCol_PopupBg for consistency. - 2017/11/18 (1.53) - Style: renamed ImGuiCol_ChildWindowBg to ImGuiCol_ChildBg. - 2017/11/18 (1.53) - Style: renamed style.ChildWindowRounding to style.ChildRounding, ImGuiStyleVar_ChildWindowRounding to ImGuiStyleVar_ChildRounding. - 2017/11/02 (1.53) - obsoleted IsRootWindowOrAnyChildHovered() in favor of using IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows); - 2017/10/24 (1.52) - renamed IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS/IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS to IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS/IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS for consistency. - 2017/10/20 (1.52) - changed IsWindowHovered() default parameters behavior to return false if an item is active in another window (e.g. click-dragging item from another window to this window). You can use the newly introduced IsWindowHovered() flags to requests this specific behavior if you need it. - 2017/10/20 (1.52) - marked IsItemHoveredRect()/IsMouseHoveringWindow() as obsolete, in favor of using the newly introduced flags for IsItemHovered() and IsWindowHovered(). See https://github.com/ocornut/imgui/issues/1382 for details. removed the IsItemRectHovered()/IsWindowRectHovered() names introduced in 1.51 since they were merely more consistent names for the two functions we are now obsoleting. - 2017/10/17 (1.52) - marked the old 5-parameters version of Begin() as obsolete (still available). Use SetNextWindowSize()+Begin() instead! - 2017/10/11 (1.52) - renamed AlignFirstTextHeightToWidgets() to AlignTextToFramePadding(). Kept inline redirection function (will obsolete). - 2017/09/25 (1.52) - removed SetNextWindowPosCenter() because SetNextWindowPos() now has the optional pivot information to do the same and more. Kept redirection function (will obsolete). - 2017/08/25 (1.52) - io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unavailable/missing. Previously ImVec2(-1,-1) was enough but we now accept negative mouse coordinates. In your binding if you need to support unavailable mouse, make sure to replace "io.MousePos = ImVec2(-1,-1)" with "io.MousePos = ImVec2(-FLT_MAX,-FLT_MAX)". - 2017/08/22 (1.51) - renamed IsItemHoveredRect() to IsItemRectHovered(). Kept inline redirection function (will obsolete). -> (1.52) use IsItemHovered(ImGuiHoveredFlags_RectOnly)! - renamed IsMouseHoveringAnyWindow() to IsAnyWindowHovered() for consistency. Kept inline redirection function (will obsolete). - renamed IsMouseHoveringWindow() to IsWindowRectHovered() for consistency. Kept inline redirection function (will obsolete). - 2017/08/20 (1.51) - renamed GetStyleColName() to GetStyleColorName() for consistency. - 2017/08/20 (1.51) - added PushStyleColor(ImGuiCol idx, ImU32 col) overload, which _might_ cause an "ambiguous call" compilation error if you are using ImColor() with implicit cast. Cast to ImU32 or ImVec4 explicily to fix. - 2017/08/15 (1.51) - marked the weird IMGUI_ONCE_UPON_A_FRAME helper macro as obsolete. prefer using the more explicit ImGuiOnceUponAFrame. - 2017/08/15 (1.51) - changed parameter order for BeginPopupContextWindow() from (const char*,int buttons,bool also_over_items) to (const char*,int buttons,bool also_over_items). Note that most calls relied on default parameters completely. - 2017/08/13 (1.51) - renamed ImGuiCol_Columns*** to ImGuiCol_Separator***. Kept redirection enums (will obsolete). - 2017/08/11 (1.51) - renamed ImGuiSetCond_*** types and flags to ImGuiCond_***. Kept redirection enums (will obsolete). - 2017/08/09 (1.51) - removed ValueColor() helpers, they are equivalent to calling Text(label) + SameLine() + ColorButton(). - 2017/08/08 (1.51) - removed ColorEditMode() and ImGuiColorEditMode in favor of ImGuiColorEditFlags and parameters to the various Color*() functions. The SetColorEditOptions() allows to initialize default but the user can still change them with right-click context menu. - changed prototype of 'ColorEdit4(const char* label, float col[4], bool show_alpha = true)' to 'ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0)', where passing flags = 0x01 is a safe no-op (hello dodgy backward compatibility!). - check and run the demo window, under "Color/Picker Widgets", to understand the various new options. - changed prototype of rarely used 'ColorButton(ImVec4 col, bool small_height = false, bool outline_border = true)' to 'ColorButton(const char* desc_id, ImVec4 col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0,0))' - 2017/07/20 (1.51) - removed IsPosHoveringAnyWindow(ImVec2), which was partly broken and misleading. ASSERT + redirect user to io.WantCaptureMouse - 2017/05/26 (1.50) - removed ImFontConfig::MergeGlyphCenterV in favor of a more multipurpose ImFontConfig::GlyphOffset. - 2017/05/01 (1.50) - renamed ImDrawList::PathFill() (rarely used directly) to ImDrawList::PathFillConvex() for clarity. - 2016/11/06 (1.50) - BeginChild(const char*) now applies the stack id to the provided label, consistently with other functions as it should always have been. It shouldn't affect you unless (extremely unlikely) you were appending multiple times to a same child from different locations of the stack id. If that's the case, generate an id with GetId() and use it instead of passing string to BeginChild(). - 2016/10/15 (1.50) - avoid 'void* user_data' parameter to io.SetClipboardTextFn/io.GetClipboardTextFn pointers. We pass io.ClipboardUserData to it. - 2016/09/25 (1.50) - style.WindowTitleAlign is now a ImVec2 (ImGuiAlign enum was removed). set to (0.5f,0.5f) for horizontal+vertical centering, (0.0f,0.0f) for upper-left, etc. - 2016/07/30 (1.50) - SameLine(x) with x>0.0f is now relative to left of column/group if any, and not always to left of window. This was sort of always the intent and hopefully breakage should be minimal. - 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore. If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you. However if your TitleBg/TitleBgActive alpha was <1.0f you need to tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar. This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color. ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col) { float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a; return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a); } If this is confusing, pick the RGB value from title bar from an old screenshot and apply this as TitleBg/TitleBgActive. Or you may just create TitleBgActive from a tweaked TitleBg color. - 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInternalState() functions. Now using CreateContext(), DestroyContext(), GetCurrentContext(), SetCurrentContext(). - 2016/05/02 (1.49) - renamed SetNextTreeNodeOpened() to SetNextTreeNodeOpen(), no redirection. - 2016/05/01 (1.49) - obsoleted old signature of CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false) as extra parameters were badly designed and rarely used. You can replace the "default_open = true" flag in new API with CollapsingHeader(label, ImGuiTreeNodeFlags_DefaultOpen). - 2016/04/26 (1.49) - changed ImDrawList::PushClipRect(ImVec4 rect) to ImDraw::PushClipRect(Imvec2 min,ImVec2 max,bool intersect_with_current_clip_rect=false). Note that higher-level ImGui::PushClipRect() is preferable because it will clip at logic/widget level, whereas ImDrawList::PushClipRect() only affect your renderer. - 2016/04/03 (1.48) - removed style.WindowFillAlphaDefault setting which was redundant. Bake default BG alpha inside style.Colors[ImGuiCol_WindowBg] and all other Bg color values. (ref github issue #337). - 2016/04/03 (1.48) - renamed ImGuiCol_TooltipBg to ImGuiCol_PopupBg, used by popups/menus and tooltips. popups/menus were previously using ImGuiCol_WindowBg. (ref github issue #337) - 2016/03/21 (1.48) - renamed GetWindowFont() to GetFont(), GetWindowFontSize() to GetFontSize(). Kept inline redirection function (will obsolete). - 2016/03/02 (1.48) - InputText() completion/history/always callbacks: if you modify the text buffer manually (without using DeleteChars()/InsertChars() helper) you need to maintain the BufTextLen field. added an assert. - 2016/01/23 (1.48) - fixed not honoring exact width passed to PushItemWidth(), previously it would add extra FramePadding.x*2 over that width. if you had manual pixel-perfect alignment in place it might affect you. - 2015/12/27 (1.48) - fixed ImDrawList::AddRect() which used to render a rectangle 1 px too large on each axis. - 2015/12/04 (1.47) - renamed Color() helpers to ValueColor() - dangerously named, rarely used and probably to be made obsolete. - 2015/08/29 (1.45) - with the addition of horizontal scrollbar we made various fixes to inconsistencies with dealing with cursor position. GetCursorPos()/SetCursorPos() functions now include the scrolled amount. It shouldn't affect the majority of users, but take note that SetCursorPosX(100.0f) puts you at +100 from the starting x position which may include scrolling, not at +100 from the window left side. GetContentRegionMax()/GetWindowContentRegionMin()/GetWindowContentRegionMax() functions allow include the scrolled amount. Typically those were used in cases where no scrolling would happen so it may not be a problem, but watch out! - 2015/08/29 (1.45) - renamed style.ScrollbarWidth to style.ScrollbarSize - 2015/08/05 (1.44) - split imgui.cpp into extra files: imgui_demo.cpp imgui_draw.cpp imgui_internal.h that you need to add to your project. - 2015/07/18 (1.44) - fixed angles in ImDrawList::PathArcTo(), PathArcToFast() (introduced in 1.43) being off by an extra PI for no justifiable reason - 2015/07/14 (1.43) - add new ImFontAtlas::AddFont() API. For the old AddFont***, moved the 'font_no' parameter of ImFontAtlas::AddFont** functions to the ImFontConfig structure. you need to render your textured triangles with bilinear filtering to benefit from sub-pixel positioning of text. - 2015/07/08 (1.43) - switched rendering data to use indexed rendering. this is saving a fair amount of CPU/GPU and enables us to get anti-aliasing for a marginal cost. this necessary change will break your rendering function! the fix should be very easy. sorry for that :( - if you are using a vanilla copy of one of the imgui_impl_XXXX.cpp provided in the example, you just need to update your copy and you can ignore the rest. - the signature of the io.RenderDrawListsFn handler has changed! old: ImGui_XXXX_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count) new: ImGui_XXXX_RenderDrawLists(ImDrawData* draw_data). argument: 'cmd_lists' becomes 'draw_data->CmdLists', 'cmd_lists_count' becomes 'draw_data->CmdListsCount' ImDrawList: 'commands' becomes 'CmdBuffer', 'vtx_buffer' becomes 'VtxBuffer', 'IdxBuffer' is new. ImDrawCmd: 'vtx_count' becomes 'ElemCount', 'clip_rect' becomes 'ClipRect', 'user_callback' becomes 'UserCallback', 'texture_id' becomes 'TextureId'. - each ImDrawList now contains both a vertex buffer and an index buffer. For each command, render ElemCount/3 triangles using indices from the index buffer. - if you REALLY cannot render indexed primitives, you can call the draw_data->DeIndexAllBuffers() method to de-index the buffers. This is slow and a waste of CPU/GPU. Prefer using indexed rendering! - refer to code in the examples/ folder or ask on the GitHub if you are unsure of how to upgrade. please upgrade! - 2015/07/10 (1.43) - changed SameLine() parameters from int to float. - 2015/07/02 (1.42) - renamed SetScrollPosHere() to SetScrollFromCursorPos(). Kept inline redirection function (will obsolete). - 2015/07/02 (1.42) - renamed GetScrollPosY() to GetScrollY(). Necessary to reduce confusion along with other scrolling functions, because positions (e.g. cursor position) are not equivalent to scrolling amount. - 2015/06/14 (1.41) - changed ImageButton() default bg_col parameter from (0,0,0,1) (black) to (0,0,0,0) (transparent) - makes a difference when texture have transparence - 2015/06/14 (1.41) - changed Selectable() API from (label, selected, size) to (label, selected, flags, size). Size override should have been rarely be used. Sorry! - 2015/05/31 (1.40) - renamed GetWindowCollapsed() to IsWindowCollapsed() for consistency. Kept inline redirection function (will obsolete). - 2015/05/31 (1.40) - renamed IsRectClipped() to IsRectVisible() for consistency. Note that return value is opposite! Kept inline redirection function (will obsolete). - 2015/05/27 (1.40) - removed the third 'repeat_if_held' parameter from Button() - sorry! it was rarely used and inconsistent. Use PushButtonRepeat(true) / PopButtonRepeat() to enable repeat on desired buttons. - 2015/05/11 (1.40) - changed BeginPopup() API, takes a string identifier instead of a bool. ImGui needs to manage the open/closed state of popups. Call OpenPopup() to actually set the "open" state of a popup. BeginPopup() returns true if the popup is opened. - 2015/05/03 (1.40) - removed style.AutoFitPadding, using style.WindowPadding makes more sense (the default values were already the same). - 2015/04/13 (1.38) - renamed IsClipped() to IsRectClipped(). Kept inline redirection function until 1.50. - 2015/04/09 (1.38) - renamed ImDrawList::AddArc() to ImDrawList::AddArcFast() for compatibility with future API - 2015/04/03 (1.38) - removed ImGuiCol_CheckHovered, ImGuiCol_CheckActive, replaced with the more general ImGuiCol_FrameBgHovered, ImGuiCol_FrameBgActive. - 2014/04/03 (1.38) - removed support for passing -FLT_MAX..+FLT_MAX as the range for a SliderFloat(). Use DragFloat() or Inputfloat() instead. - 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function until 1.50. - 2015/03/15 (1.36) - renamed style.TreeNodeSpacing to style.IndentSpacing, ImGuiStyleVar_TreeNodeSpacing to ImGuiStyleVar_IndentSpacing - 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection function until 1.50. - 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth (casing) - 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kept inline redirection function until 1.50. - 2015/02/27 (1.34) - renamed ImGuiSetCondition_*** to ImGuiSetCond_***, and _FirstUseThisSession becomes _Once. - 2015/02/11 (1.32) - changed text input callback ImGuiTextEditCallback return type from void-->int. reserved for future use, return 0 for now. - 2015/02/10 (1.32) - renamed GetItemWidth() to CalcItemWidth() to clarify its evolving behavior - 2015/02/08 (1.31) - renamed GetTextLineSpacing() to GetTextLineHeightWithSpacing() - 2015/02/01 (1.31) - removed IO.MemReallocFn (unused) - 2015/01/19 (1.30) - renamed ImGuiStorage::GetIntPtr()/GetFloatPtr() to GetIntRef()/GetIntRef() because Ptr was conflicting with actual pointer storage functions. - 2015/01/11 (1.30) - big font/image API change! now loads TTF file. allow for multiple fonts. no need for a PNG loader. (1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompressed pixels. font init: const void* png_data; unsigned int png_size; ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size); <..Upload texture to GPU..> became: unsigned char* pixels; int width, height; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); <..Upload texture to GPU>; io.Fonts->TexId = YourTextureIdentifier; you now more flexibility to load multiple TTF fonts and manage the texture buffer for internal needs. it is now recommended that you sample the font texture with bilinear interpolation. (1.30) - added texture identifier in ImDrawCmd passed to your render function (we can now render images). make sure to set io.Fonts->TexID. (1.30) - removed IO.PixelCenterOffset (unnecessary, can be handled in user projection matrix) (1.30) - removed ImGui::IsItemFocused() in favor of ImGui::IsItemActive() which handles all widgets - 2014/12/10 (1.18) - removed SetNewWindowDefaultPos() in favor of new generic API SetNextWindowPos(pos, ImGuiSetCondition_FirstUseEver) - 2014/11/28 (1.17) - moved IO.Font*** options to inside the IO.Font-> structure (FontYOffset, FontTexUvForWhite, FontBaseScale, FontFallbackGlyph) - 2014/11/26 (1.17) - reworked syntax of IMGUI_ONCE_UPON_A_FRAME helper macro to increase compiler compatibility - 2014/11/07 (1.15) - renamed IsHovered() to IsItemHovered() - 2014/10/02 (1.14) - renamed IMGUI_INCLUDE_IMGUI_USER_CPP to IMGUI_INCLUDE_IMGUI_USER_INL and imgui_user.cpp to imgui_user.inl (more IDE friendly) - 2014/09/25 (1.13) - removed 'text_end' parameter from IO.SetClipboardTextFn (the string is now always zero-terminated for simplicity) - 2014/09/24 (1.12) - renamed SetFontScale() to SetWindowFontScale() - 2014/09/24 (1.12) - moved IM_MALLOC/IM_REALLOC/IM_FREE preprocessor defines to IO.MemAllocFn/IO.MemReallocFn/IO.MemFreeFn - 2014/08/30 (1.09) - removed IO.FontHeight (now computed automatically) - 2014/08/30 (1.09) - moved IMGUI_FONT_TEX_UV_FOR_WHITE preprocessor define to IO.FontTexUvForWhite - 2014/08/28 (1.09) - changed the behavior of IO.PixelCenterOffset following various rendering fixes ISSUES & TODO-LIST ================== See TODO.txt FREQUENTLY ASKED QUESTIONS (FAQ), TIPS ====================================== Q: How can I tell whether to dispatch mouse/keyboard to imgui or to my application? A: You can read the 'io.WantCaptureMouse', 'io.WantCaptureKeyboard' and 'io.WantTextInput' flags from the ImGuiIO structure. - When 'io.WantCaptureMouse' is set, imgui wants to use your mouse state, and you may want to discard/hide the inputs from the rest of your application. - When 'io.WantCaptureKeyboard' is set, imgui wants to use your keyboard state, and you may want to discard/hide the inputs from the rest of your application. - When 'io.WantTextInput' is set to may want to notify your OS to popup an on-screen keyboard, if available (e.g. on a mobile phone, or console OS). Note: you should always pass your mouse/keyboard inputs to imgui, even when the io.WantCaptureXXX flag are set false. This is because imgui needs to detect that you clicked in the void to unfocus its windows. Note: The 'io.WantCaptureMouse' is more accurate that any attempt to "check if the mouse is hovering a window" (don't do that!). It handle mouse dragging correctly (both dragging that started over your application or over an imgui window) and handle e.g. modal windows blocking inputs. Those flags are updated by ImGui::NewFrame(). Preferably read the flags after calling NewFrame() if you can afford it, but reading them before is also perfectly fine, as the bool toggle fairly rarely. If you have on a touch device, you might find use for an early call to NewFrameUpdateHoveredWindowAndCaptureFlags(). Note: Text input widget releases focus on "Return KeyDown", so the subsequent "Return KeyUp" event that your application receive will typically have 'io.WantCaptureKeyboard=false'. Depending on your application logic it may or not be inconvenient. You might want to track which key-downs were targetted for Dear ImGui, e.g. with an array of bool, and filter out the corresponding key-ups.) Q: How can I display an image? What is ImTextureID, how does it works? A: ImTextureID is a void* used to pass renderer-agnostic texture references around until it hits your render function. Dear ImGui knows nothing about what those bits represent, it just passes them around. It is up to you to decide what you want the void* to carry! It could be an identifier to your OpenGL texture (cast GLuint to void*), a pointer to your custom engine material (cast MyMaterial* to void*), etc. At the end of the chain, your renderer takes this void* to cast it back into whatever it needs to select a current texture to render. Refer to examples applications, where each renderer (in a imgui_impl_xxxx.cpp file) is treating ImTextureID as a different thing. (C++ tip: OpenGL uses integers to identify textures. You can safely store an integer into a void*, just cast it to void*, don't take it's address!) To display a custom image/texture within an ImGui window, you may use ImGui::Image(), ImGui::ImageButton(), ImDrawList::AddImage() functions. Dear ImGui will generate the geometry and draw calls using the ImTextureID that you passed and which your renderer can use. You may call ImGui::ShowMetricsWindow() to explore active draw lists and visualize/understand how the draw data is generated. It is your responsibility to get textures uploaded to your GPU. Q: How can I have multiple widgets with the same label or without a label? A: A primer on labels and the ID Stack... - Elements that are typically not clickable, such as Text() items don't need an ID. - Interactive widgets require state to be carried over multiple frames (most typically Dear ImGui often needs to remember what is the "active" widget). To do so they need a unique ID. Unique ID are typically derived from a string label, an integer index or a pointer. Button("OK"); // Label = "OK", ID = top of id stack + hash of "OK" Button("Cancel"); // Label = "Cancel", ID = top of id stack + hash of "Cancel" - ID are uniquely scoped within windows, tree nodes, etc. which all pushes to the ID stack. Having two buttons labeled "OK" in different windows or different tree locations is fine. - If you have a same ID twice in the same location, you'll have a conflict: Button("OK"); Button("OK"); // ID collision! Interacting with either button will trigger the first one. Fear not! this is easy to solve and there are many ways to solve it! - Solving ID conflict in a simple/local context: When passing a label you can optionally specify extra ID information within string itself. Use "##" to pass a complement to the ID that won't be visible to the end-user. This helps solving the simple collision cases when you know e.g. at compilation time which items are going to be created: Button("Play"); // Label = "Play", ID = top of id stack + hash of "Play" Button("Play##foo1"); // Label = "Play", ID = top of id stack + hash of "Play##foo1" (different from above) Button("Play##foo2"); // Label = "Play", ID = top of id stack + hash of "Play##foo2" (different from above) - If you want to completely hide the label, but still need an ID: Checkbox("##On", &b); // Label = "", ID = top of id stack + hash of "##On" (no label!) - Occasionally/rarely you might want change a label while preserving a constant ID. This allows you to animate labels. For example you may want to include varying information in a window title bar, but windows are uniquely identified by their ID. Use "###" to pass a label that isn't part of ID: Button("Hello###ID"; // Label = "Hello", ID = top of id stack + hash of "ID" Button("World###ID"; // Label = "World", ID = top of id stack + hash of "ID" (same as above) sprintf(buf, "My game (%f FPS)###MyGame", fps); Begin(buf); // Variable label, ID = hash of "MyGame" - Solving ID conflict in a more general manner: Use PushID() / PopID() to create scopes and manipulate the ID stack, as to avoid ID conflicts within the same window. This is the most convenient way of distinguishing ID when iterating and creating many UI elements programmatically. You can push a pointer, a string or an integer value into the ID stack. Remember that ID are formed from the concatenation of _everything_ in the ID stack! for (int i = 0; i < 100; i++) { PushID(i); Button("Click"); // Label = "Click", ID = top of id stack + hash of integer + hash of "Click" PopID(); } for (int i = 0; i < 100; i++) { MyObject* obj = Objects[i]; PushID(obj); Button("Click"); // Label = "Click", ID = top of id stack + hash of pointer + hash of "Click" PopID(); } for (int i = 0; i < 100; i++) { MyObject* obj = Objects[i]; PushID(obj->Name); Button("Click"); // Label = "Click", ID = top of id stack + hash of string + hash of "Click" PopID(); } - More example showing that you can stack multiple prefixes into the ID stack: Button("Click"); // Label = "Click", ID = top of id stack + hash of "Click" PushID("node"); Button("Click"); // Label = "Click", ID = top of id stack + hash of "node" + hash of "Click" PushID(my_ptr); Button("Click"); // Label = "Click", ID = top of id stack + hash of "node" + hash of ptr + hash of "Click" PopID(); PopID(); - Tree nodes implicitly creates a scope for you by calling PushID(). Button("Click"); // Label = "Click", ID = top of id stack + hash of "Click" if (TreeNode("node")) { Button("Click"); // Label = "Click", ID = top of id stack + hash of "node" + hash of "Click" TreePop(); } - When working with trees, ID are used to preserve the open/close state of each tree node. Depending on your use cases you may want to use strings, indices or pointers as ID. e.g. when following a single pointer that may change over time, using a static string as ID will preserve your node open/closed state when the targeted object change. e.g. when displaying a list of objects, using indices or pointers as ID will preserve the node open/closed state differently. See what makes more sense in your situation! Q: How can I load a different font than the default? A: Use the font atlas to load the TTF/OTF file you want: ImGuiIO& io = ImGui::GetIO(); io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels); io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8() (default is ProggyClean.ttf, rendered at size 13, embedded in dear imgui's source code) New programmers: remember that in C/C++ and most programming languages if you want to use a backslash \ within a string literal, you need to write it double backslash "\\": io.Fonts->AddFontFromFileTTF("MyDataFolder\MyFontFile.ttf", size_in_pixels); // WRONG (you are escape the M here!) io.Fonts->AddFontFromFileTTF("MyDataFolder\\MyFontFile.ttf", size_in_pixels); // CORRECT io.Fonts->AddFontFromFileTTF("MyDataFolder/MyFontFile.ttf", size_in_pixels); // ALSO CORRECT Q: How can I easily use icons in my application? A: The most convenient and practical way is to merge an icon font such as FontAwesome inside you main font. Then you can refer to icons within your strings. Read 'How can I load multiple fonts?' and the file 'misc/fonts/README.txt' for instructions and useful header files. Q: How can I load multiple fonts? A: Use the font atlas to pack them into a single texture: (Read misc/fonts/README.txt and the code in ImFontAtlas for more details.) ImGuiIO& io = ImGui::GetIO(); ImFont* font0 = io.Fonts->AddFontDefault(); ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels); ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels); io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8() // the first loaded font gets used by default // use ImGui::PushFont()/ImGui::PopFont() to change the font at runtime // Options ImFontConfig config; config.OversampleH = 3; config.OversampleV = 1; config.GlyphOffset.y -= 2.0f; // Move everything by 2 pixels up config.GlyphExtraSpacing.x = 1.0f; // Increase spacing between characters io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, &config); // Combine multiple fonts into one (e.g. for icon fonts) ImWchar ranges[] = { 0xf000, 0xf3ff, 0 }; ImFontConfig config; config.MergeMode = true; io.Fonts->AddFontDefault(); io.Fonts->LoadFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges); // Merge icon font io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese()); // Merge japanese glyphs Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic? A: When loading a font, pass custom Unicode ranges to specify the glyphs to load. // Add default Japanese ranges io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, io.Fonts->GetGlyphRangesJapanese()); // Or create your own custom ranges (e.g. for a game you can feed your entire game script and only build the characters the game need) ImVector ranges; ImFontAtlas::GlyphRangesBuilder builder; builder.AddText("Hello world"); // Add a string (here "Hello world" contains 7 unique characters) builder.AddChar(0x7262); // Add a specific character builder.AddRanges(io.Fonts->GetGlyphRangesJapanese()); // Add one of the default ranges builder.BuildRanges(&ranges); // Build the final result (ordered ranges with all the unique characters submitted) io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, ranges.Data); All your strings needs to use UTF-8 encoding. In C++11 you can encode a string literal in UTF-8 by using the u8"hello" syntax. Specifying literal in your source code using a local code page (such as CP-923 for Japanese or CP-1251 for Cyrillic) will NOT work! Otherwise you can convert yourself to UTF-8 or load text data from file already saved as UTF-8. Text input: it is up to your application to pass the right character code by calling io.AddInputCharacter(). The applications in examples/ are doing that. For languages relying on an Input Method Editor (IME), on Windows you can copy the Hwnd of your application in the io.ImeWindowHandle field. The default implementation of io.ImeSetInputScreenPosFn() will set your Microsoft IME position correctly. Q: How can I use the drawing facilities without an ImGui window? (using ImDrawList API) A: - You can create a dummy window. Call SetNextWindowBgAlpha(0.0f), call Begin() with NoTitleBar|NoResize|NoMove|NoScrollbar|NoSavedSettings|NoInputs flags. Then you can retrieve the ImDrawList* via GetWindowDrawList() and draw to it in any way you like. - You can call ImGui::GetOverlayDrawList() and use this draw list to display contents over every other imgui windows. - You can create your own ImDrawList instance. You'll need to initialize them ImGui::GetDrawListSharedData(), or create your own ImDrawListSharedData. Q: I integrated Dear ImGui in my engine and the text or lines are blurry.. A: In your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f). Also make sure your orthographic projection matrix and io.DisplaySize matches your actual framebuffer dimension. Q: I integrated Dear ImGui in my engine and some elements are clipping or disappearing when I move windows around.. A: You are probably mishandling the clipping rectangles in your render function. Rectangles provided by ImGui are defined as (x1=left,y1=top,x2=right,y2=bottom) and NOT as (x1,y1,width,height). Q: How can I help? A: - If you are experienced with Dear ImGui and C++, look at the github issues, or TODO.txt and see how you want/can help! - Convince your company to fund development time! Individual users: you can also become a Patron (patreon.com/imgui) or donate on PayPal! See README. - Disclose your usage of dear imgui via a dev blog post, a tweet, a screenshot, a mention somewhere etc. You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/1269). Visuals are ideal as they inspire other programmers. But even without visuals, disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions. - If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues (on github or privately). - tip: you can call Begin() multiple times with the same name during the same frame, it will keep appending to the same window. this is also useful to set yourself in the context of another window (to get/set other settings) - tip: you can create widgets without a Begin()/End() block, they will go in an implicit window called "Debug". - tip: the ImGuiOnceUponAFrame helper will allow run the block of code only once a frame. You can use it to quickly add custom UI in the middle of a deep nested inner loop in your code. - tip: you can call Render() multiple times (e.g for VR renders). - tip: call and read the ShowDemoWindow() code in imgui_demo.cpp for more example of how to use ImGui! */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #include "imgui.h" #define IMGUI_DEFINE_MATH_OPERATORS #include "imgui_internal.h" #include // toupper, isprint #include // NULL, malloc, free, qsort, atoi #include // vsnprintf, sscanf, printf #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier #include // intptr_t #else #include // intptr_t #endif #define IMGUI_DEBUG_NAV_SCORING 0 #define IMGUI_DEBUG_NAV_RECTS 0 // Visual Studio warnings #ifdef _MSC_VER #pragma warning (disable: 4127) // condition expression is constant #pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff) #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen #endif // Clang warnings with -Weverything #ifdef __clang__ #pragma clang diagnostic ignored "-Wunknown-pragmas" // warning : unknown warning group '-Wformat-pedantic *' // not all warnings are known by all clang versions.. so ignoring warnings triggers new warnings on some configuration. great! #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. #pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants (typically 0.0f) is ok. #pragma clang diagnostic ignored "-Wformat-nonliteral" // warning : format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code. #pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. #pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it. #pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness // #pragma clang diagnostic ignored "-Wformat-pedantic" // warning : format specifies type 'void *' but the argument has type 'xxxx *' // unreasonable, would lead to casting every %p arg to void*. probably enabled by -pedantic. #pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int' #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size #pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'void*', but argument 6 has type 'ImGuiWindow*' #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value #pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked #pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false #endif // Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall #ifdef _MSC_VER #define IMGUI_CDECL __cdecl #else #define IMGUI_CDECL #endif //------------------------------------------------------------------------- // Forward Declarations //------------------------------------------------------------------------- static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true); static ImFont* GetDefaultFont(); static void SetCurrentWindow(ImGuiWindow* window); static void SetWindowScrollX(ImGuiWindow* window, float new_scroll_x); static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y); static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond); static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond); static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond); static ImGuiWindow* FindHoveredWindow(); static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags); static void CheckStacksSize(ImGuiWindow* window, bool write); static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window); static void AddDrawListToDrawData(ImVector* out_list, ImDrawList* draw_list); static void AddWindowToDrawData(ImVector* out_list, ImGuiWindow* window); static void AddWindowToSortedBuffer(ImVector* out_sorted_windows, ImGuiWindow* window); static ImGuiWindowSettings* AddWindowSettings(const char* name); static void LoadIniSettingsFromDisk(const char* ini_filename); static void LoadIniSettingsFromMemory(const char* buf); static void SaveIniSettingsToDisk(const char* ini_filename); static void SaveIniSettingsToMemory(ImVector& out_buf); static void MarkIniSettingsDirty(ImGuiWindow* window); static ImRect GetViewportRect(); static void ClosePopupToLevel(int remaining); static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data); static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end); static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false); static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, const char* display_format, char* buf, int buf_size); static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, int decimal_precision, char* buf, int buf_size); static void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, void* arg_1, const void* arg_2); static bool DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* data_ptr, const char* scalar_format); namespace ImGui { static void NavUpdate(); static void NavUpdateWindowing(); static void NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, const ImGuiID id); static void NewFrameUpdateMovingWindow(); static void NewFrameUpdateMouseInputs(); static void UpdateManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4]); static void FocusFrontMostActiveWindow(ImGuiWindow* ignore_window); } //----------------------------------------------------------------------------- // Platform dependent default implementations //----------------------------------------------------------------------------- static const char* GetClipboardTextFn_DefaultImpl(void* user_data); static void SetClipboardTextFn_DefaultImpl(void* user_data, const char* text); static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y); //----------------------------------------------------------------------------- // Context //----------------------------------------------------------------------------- // Current context pointer. Implicitely used by all ImGui functions. Always assumed to be != NULL. // CreateContext() will automatically set this pointer if it is NULL. Change to a different context by calling ImGui::SetCurrentContext(). // If you use DLL hotreloading you might need to call SetCurrentContext() after reloading code from this file. // ImGui functions are not thread-safe because of this pointer. If you want thread-safety to allow N threads to access N different contexts, you can: // - Change this variable to use thread local storage. You may #define GImGui in imconfig.h for that purpose. Future development aim to make this context pointer explicit to all calls. Also read https://github.com/ocornut/imgui/issues/586 // - Having multiple instances of the ImGui code compiled inside different namespace (easiest/safest, if you have a finite number of contexts) #ifndef GImGui ImGuiContext* GImGui = NULL; #endif // Memory Allocator functions. Use SetAllocatorFunctions() to change them. // If you use DLL hotreloading you might need to call SetAllocatorFunctions() after reloading code from this file. // Otherwise, you probably don't want to modify them mid-program, and if you use global/static e.g. ImVector<> instances you may need to keep them accessible during program destruction. #ifndef IMGUI_DISABLE_DEFAULT_ALLOCATORS static void* MallocWrapper(size_t size, void* user_data) { (void)user_data; return malloc(size); } static void FreeWrapper(void* ptr, void* user_data) { (void)user_data; free(ptr); } #else static void* MallocWrapper(size_t size, void* user_data) { (void)user_data; (void)size; IM_ASSERT(0); return NULL; } static void FreeWrapper(void* ptr, void* user_data) { (void)user_data; (void)ptr; IM_ASSERT(0); } #endif static void* (*GImAllocatorAllocFunc)(size_t size, void* user_data) = MallocWrapper; static void (*GImAllocatorFreeFunc)(void* ptr, void* user_data) = FreeWrapper; static void* GImAllocatorUserData = NULL; static size_t GImAllocatorActiveAllocationsCount = 0; //----------------------------------------------------------------------------- // User facing structures //----------------------------------------------------------------------------- ImGuiStyle::ImGuiStyle() { Alpha = 1.0f; // Global alpha applies to everything in ImGui WindowPadding = ImVec2(8,8); // Padding within a window WindowRounding = 7.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows WindowBorderSize = 1.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested. WindowMinSize = ImVec2(32,32); // Minimum window size WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text ChildRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular child windows ChildBorderSize = 1.0f; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. Other values not well tested. PopupRounding = 0.0f; // Radius of popup window corners rounding. Set to 0.0f to have rectangular child windows PopupBorderSize = 1.0f; // Thickness of border around popup or tooltip windows. Generally set to 0.0f or 1.0f. Other values not well tested. FramePadding = ImVec2(4,3); // Padding within a framed rectangle (used by most widgets) FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets). FrameBorderSize = 0.0f; // Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested. ItemSpacing = ImVec2(8,4); // Horizontal and vertical spacing between widgets/lines ItemInnerSpacing = ImVec2(4,4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label) TouchExtraPadding = ImVec2(0,0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns ScrollbarSize = 16.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar GrabMinSize = 10.0f; // Minimum width/height of a grab box for slider/scrollbar GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text. DisplayWindowPadding = ImVec2(22,22); // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows. DisplaySafeAreaPadding = ImVec2(4,4); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. AntiAliasedLines = true; // Enable anti-aliasing on lines/borders. Disable if you are really short on CPU/GPU. AntiAliasedFill = true; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.) CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. // Default theme ImGui::StyleColorsDark(this); } // To scale your entire UI (e.g. if you want your app to use High DPI or generally be DPI aware) you may use this helper function. Scaling the fonts is done separately and is up to you. // Important: This operation is lossy because we round all sizes to integer. If you need to change your scale multiples, call this over a freshly initialized ImGuiStyle structure rather than scaling multiple times. void ImGuiStyle::ScaleAllSizes(float scale_factor) { WindowPadding = ImFloor(WindowPadding * scale_factor); WindowRounding = ImFloor(WindowRounding * scale_factor); WindowMinSize = ImFloor(WindowMinSize * scale_factor); ChildRounding = ImFloor(ChildRounding * scale_factor); PopupRounding = ImFloor(PopupRounding * scale_factor); FramePadding = ImFloor(FramePadding * scale_factor); FrameRounding = ImFloor(FrameRounding * scale_factor); ItemSpacing = ImFloor(ItemSpacing * scale_factor); ItemInnerSpacing = ImFloor(ItemInnerSpacing * scale_factor); TouchExtraPadding = ImFloor(TouchExtraPadding * scale_factor); IndentSpacing = ImFloor(IndentSpacing * scale_factor); ColumnsMinSpacing = ImFloor(ColumnsMinSpacing * scale_factor); ScrollbarSize = ImFloor(ScrollbarSize * scale_factor); ScrollbarRounding = ImFloor(ScrollbarRounding * scale_factor); GrabMinSize = ImFloor(GrabMinSize * scale_factor); GrabRounding = ImFloor(GrabRounding * scale_factor); DisplayWindowPadding = ImFloor(DisplayWindowPadding * scale_factor); DisplaySafeAreaPadding = ImFloor(DisplaySafeAreaPadding * scale_factor); MouseCursorScale = ImFloor(MouseCursorScale * scale_factor); } ImGuiIO::ImGuiIO() { // Most fields are initialized with zero memset(this, 0, sizeof(*this)); // Settings ConfigFlags = 0x00; BackendFlags = 0x00; DisplaySize = ImVec2(-1.0f, -1.0f); DeltaTime = 1.0f/60.0f; IniSavingRate = 5.0f; IniFilename = "imgui.ini"; LogFilename = "imgui_log.txt"; MouseDoubleClickTime = 0.30f; MouseDoubleClickMaxDist = 6.0f; for (int i = 0; i < ImGuiKey_COUNT; i++) KeyMap[i] = -1; KeyRepeatDelay = 0.250f; KeyRepeatRate = 0.050f; UserData = NULL; Fonts = NULL; FontGlobalScale = 1.0f; FontDefault = NULL; FontAllowUserScaling = false; DisplayFramebufferScale = ImVec2(1.0f, 1.0f); DisplayVisibleMin = DisplayVisibleMax = ImVec2(0.0f, 0.0f); // Advanced/subtle behaviors #ifdef __APPLE__ OptMacOSXBehaviors = true; // Set Mac OS X style defaults based on __APPLE__ compile time flag #else OptMacOSXBehaviors = false; #endif OptCursorBlink = true; // Settings (User Functions) GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations SetClipboardTextFn = SetClipboardTextFn_DefaultImpl; ClipboardUserData = NULL; ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl; ImeWindowHandle = NULL; #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS RenderDrawListsFn = NULL; #endif // Input (NB: we already have memset zero the entire structure) MousePos = ImVec2(-FLT_MAX, -FLT_MAX); MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX); MouseDragThreshold = 6.0f; for (int i = 0; i < IM_ARRAYSIZE(MouseDownDuration); i++) MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0f; for (int i = 0; i < IM_ARRAYSIZE(KeysDownDuration); i++) KeysDownDuration[i] = KeysDownDurationPrev[i] = -1.0f; for (int i = 0; i < IM_ARRAYSIZE(NavInputsDownDuration); i++) NavInputsDownDuration[i] = -1.0f; } // Pass in translated ASCII characters for text input. // - with glfw you can get those from the callback set in glfwSetCharCallback() // - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message void ImGuiIO::AddInputCharacter(ImWchar c) { const int n = ImStrlenW(InputCharacters); if (n + 1 < IM_ARRAYSIZE(InputCharacters)) { InputCharacters[n] = c; InputCharacters[n+1] = '\0'; } } void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars) { // We can't pass more wchars than ImGuiIO::InputCharacters[] can hold so don't convert more const int wchars_buf_len = sizeof(ImGuiIO::InputCharacters) / sizeof(ImWchar); ImWchar wchars[wchars_buf_len]; ImTextStrFromUtf8(wchars, wchars_buf_len, utf8_chars, NULL); for (int i = 0; i < wchars_buf_len && wchars[i] != 0; i++) AddInputCharacter(wchars[i]); } //----------------------------------------------------------------------------- // HELPERS //----------------------------------------------------------------------------- #define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255 ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p) { ImVec2 ap = p - a; ImVec2 ab_dir = b - a; float dot = ap.x * ab_dir.x + ap.y * ab_dir.y; if (dot < 0.0f) return a; float ab_len_sqr = ab_dir.x * ab_dir.x + ab_dir.y * ab_dir.y; if (dot > ab_len_sqr) return b; return a + ab_dir * dot / ab_len_sqr; } bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p) { bool b1 = ((p.x - b.x) * (a.y - b.y) - (p.y - b.y) * (a.x - b.x)) < 0.0f; bool b2 = ((p.x - c.x) * (b.y - c.y) - (p.y - c.y) * (b.x - c.x)) < 0.0f; bool b3 = ((p.x - a.x) * (c.y - a.y) - (p.y - a.y) * (c.x - a.x)) < 0.0f; return ((b1 == b2) && (b2 == b3)); } void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w) { ImVec2 v0 = b - a; ImVec2 v1 = c - a; ImVec2 v2 = p - a; const float denom = v0.x * v1.y - v1.x * v0.y; out_v = (v2.x * v1.y - v1.x * v2.y) / denom; out_w = (v0.x * v2.y - v2.x * v0.y) / denom; out_u = 1.0f - out_v - out_w; } ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p) { ImVec2 proj_ab = ImLineClosestPoint(a, b, p); ImVec2 proj_bc = ImLineClosestPoint(b, c, p); ImVec2 proj_ca = ImLineClosestPoint(c, a, p); float dist2_ab = ImLengthSqr(p - proj_ab); float dist2_bc = ImLengthSqr(p - proj_bc); float dist2_ca = ImLengthSqr(p - proj_ca); float m = ImMin(dist2_ab, ImMin(dist2_bc, dist2_ca)); if (m == dist2_ab) return proj_ab; if (m == dist2_bc) return proj_bc; return proj_ca; } int ImStricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int ImStrnicmp(const char* str1, const char* str2, size_t count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; } void ImStrncpy(char* dst, const char* src, size_t count) { if (count < 1) return; strncpy(dst, src, count); dst[count-1] = 0; } char* ImStrdup(const char *str) { size_t len = strlen(str) + 1; void* buf = ImGui::MemAlloc(len); return (char*)memcpy(buf, (const void*)str, len); } const char* ImStrchrRange(const char* str, const char* str_end, char c) { for ( ; str < str_end; str++) if (*str == c) return str; return NULL; } int ImStrlenW(const ImWchar* str) { int n = 0; while (*str++) n++; return n; } const ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin) // find beginning-of-line { while (buf_mid_line > buf_begin && buf_mid_line[-1] != '\n') buf_mid_line--; return buf_mid_line; } const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end) { if (!needle_end) needle_end = needle + strlen(needle); const char un0 = (char)toupper(*needle); while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end)) { if (toupper(*haystack) == un0) { const char* b = needle + 1; for (const char* a = haystack + 1; b < needle_end; a++, b++) if (toupper(*a) != toupper(*b)) break; if (b == needle_end) return haystack; } haystack++; } return NULL; } static const char* ImAtoi(const char* src, int* output) { int negative = 0; if (*src == '-') { negative = 1; src++; } if (*src == '+') { src++; } int v = 0; while (*src >= '0' && *src <= '9') v = (v * 10) + (*src++ - '0'); *output = negative ? -v : v; return src; } // A) MSVC version appears to return -1 on overflow, whereas glibc appears to return total count (which may be >= buf_size). // Ideally we would test for only one of those limits at runtime depending on the behavior the vsnprintf(), but trying to deduct it at compile time sounds like a pandora can of worm. // B) When buf==NULL vsnprintf() will return the output size. #ifndef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) { va_list args; va_start(args, fmt); int w = vsnprintf(buf, buf_size, fmt, args); va_end(args); if (buf == NULL) return w; if (w == -1 || w >= (int)buf_size) w = (int)buf_size - 1; buf[w] = 0; return w; } int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) { int w = vsnprintf(buf, buf_size, fmt, args); if (buf == NULL) return w; if (w == -1 || w >= (int)buf_size) w = (int)buf_size - 1; buf[w] = 0; return w; } #endif // #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Pass data_size==0 for zero-terminated strings // FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements. ImU32 ImHash(const void* data, int data_size, ImU32 seed) { static ImU32 crc32_lut[256] = { 0 }; if (!crc32_lut[1]) { const ImU32 polynomial = 0xEDB88320; for (ImU32 i = 0; i < 256; i++) { ImU32 crc = i; for (ImU32 j = 0; j < 8; j++) crc = (crc >> 1) ^ (ImU32(-int(crc & 1)) & polynomial); crc32_lut[i] = crc; } } seed = ~seed; ImU32 crc = seed; const unsigned char* current = (const unsigned char*)data; if (data_size > 0) { // Known size while (data_size--) crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++]; } else { // Zero-terminated string while (unsigned char c = *current++) { // We support a syntax of "label###id" where only "###id" is included in the hash, and only "label" gets displayed. // Because this syntax is rarely used we are optimizing for the common case. // - If we reach ### in the string we discard the hash so far and reset to the seed. // - We don't do 'current += 2; continue;' after handling ### to keep the code smaller. if (c == '#' && current[0] == '#' && current[1] == '#') crc = seed; crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c]; } } return ~crc; } //----------------------------------------------------------------------------- // ImText* helpers //----------------------------------------------------------------------------- // Convert UTF-8 to 32-bits character, process single character input. // Based on stb_from_utf8() from github.com/nothings/stb/ // We handle UTF-8 decoding error by skipping forward. int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end) { unsigned int c = (unsigned int)-1; const unsigned char* str = (const unsigned char*)in_text; if (!(*str & 0x80)) { c = (unsigned int)(*str++); *out_char = c; return 1; } if ((*str & 0xe0) == 0xc0) { *out_char = 0xFFFD; // will be invalid but not end of string if (in_text_end && in_text_end - (const char*)str < 2) return 1; if (*str < 0xc2) return 2; c = (unsigned int)((*str++ & 0x1f) << 6); if ((*str & 0xc0) != 0x80) return 2; c += (*str++ & 0x3f); *out_char = c; return 2; } if ((*str & 0xf0) == 0xe0) { *out_char = 0xFFFD; // will be invalid but not end of string if (in_text_end && in_text_end - (const char*)str < 3) return 1; if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return 3; if (*str == 0xed && str[1] > 0x9f) return 3; // str[1] < 0x80 is checked below c = (unsigned int)((*str++ & 0x0f) << 12); if ((*str & 0xc0) != 0x80) return 3; c += (unsigned int)((*str++ & 0x3f) << 6); if ((*str & 0xc0) != 0x80) return 3; c += (*str++ & 0x3f); *out_char = c; return 3; } if ((*str & 0xf8) == 0xf0) { *out_char = 0xFFFD; // will be invalid but not end of string if (in_text_end && in_text_end - (const char*)str < 4) return 1; if (*str > 0xf4) return 4; if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf)) return 4; if (*str == 0xf4 && str[1] > 0x8f) return 4; // str[1] < 0x80 is checked below c = (unsigned int)((*str++ & 0x07) << 18); if ((*str & 0xc0) != 0x80) return 4; c += (unsigned int)((*str++ & 0x3f) << 12); if ((*str & 0xc0) != 0x80) return 4; c += (unsigned int)((*str++ & 0x3f) << 6); if ((*str & 0xc0) != 0x80) return 4; c += (*str++ & 0x3f); // utf-8 encodings of values used in surrogate pairs are invalid if ((c & 0xFFFFF800) == 0xD800) return 4; *out_char = c; return 4; } *out_char = 0; return 0; } int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining) { ImWchar* buf_out = buf; ImWchar* buf_end = buf + buf_size; while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text) { unsigned int c; in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); if (c == 0) break; if (c < 0x10000) // FIXME: Losing characters that don't fit in 2 bytes *buf_out++ = (ImWchar)c; } *buf_out = 0; if (in_text_remaining) *in_text_remaining = in_text; return (int)(buf_out - buf); } int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) { int char_count = 0; while ((!in_text_end || in_text < in_text_end) && *in_text) { unsigned int c; in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); if (c == 0) break; if (c < 0x10000) char_count++; } return char_count; } // Based on stb_to_utf8() from github.com/nothings/stb/ static inline int ImTextCharToUtf8(char* buf, int buf_size, unsigned int c) { if (c < 0x80) { buf[0] = (char)c; return 1; } if (c < 0x800) { if (buf_size < 2) return 0; buf[0] = (char)(0xc0 + (c >> 6)); buf[1] = (char)(0x80 + (c & 0x3f)); return 2; } if (c >= 0xdc00 && c < 0xe000) { return 0; } if (c >= 0xd800 && c < 0xdc00) { if (buf_size < 4) return 0; buf[0] = (char)(0xf0 + (c >> 18)); buf[1] = (char)(0x80 + ((c >> 12) & 0x3f)); buf[2] = (char)(0x80 + ((c >> 6) & 0x3f)); buf[3] = (char)(0x80 + ((c ) & 0x3f)); return 4; } //else if (c < 0x10000) { if (buf_size < 3) return 0; buf[0] = (char)(0xe0 + (c >> 12)); buf[1] = (char)(0x80 + ((c>> 6) & 0x3f)); buf[2] = (char)(0x80 + ((c ) & 0x3f)); return 3; } } static inline int ImTextCountUtf8BytesFromChar(unsigned int c) { if (c < 0x80) return 1; if (c < 0x800) return 2; if (c >= 0xdc00 && c < 0xe000) return 0; if (c >= 0xd800 && c < 0xdc00) return 4; return 3; } int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end) { char* buf_out = buf; const char* buf_end = buf + buf_size; while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text) { unsigned int c = (unsigned int)(*in_text++); if (c < 0x80) *buf_out++ = (char)c; else buf_out += ImTextCharToUtf8(buf_out, (int)(buf_end-buf_out-1), c); } *buf_out = 0; return (int)(buf_out - buf); } int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end) { int bytes_count = 0; while ((!in_text_end || in_text < in_text_end) && *in_text) { unsigned int c = (unsigned int)(*in_text++); if (c < 0x80) bytes_count++; else bytes_count += ImTextCountUtf8BytesFromChar(c); } return bytes_count; } ImVec4 ImGui::ColorConvertU32ToFloat4(ImU32 in) { float s = 1.0f/255.0f; return ImVec4( ((in >> IM_COL32_R_SHIFT) & 0xFF) * s, ((in >> IM_COL32_G_SHIFT) & 0xFF) * s, ((in >> IM_COL32_B_SHIFT) & 0xFF) * s, ((in >> IM_COL32_A_SHIFT) & 0xFF) * s); } ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in) { ImU32 out; out = ((ImU32)IM_F32_TO_INT8_SAT(in.x)) << IM_COL32_R_SHIFT; out |= ((ImU32)IM_F32_TO_INT8_SAT(in.y)) << IM_COL32_G_SHIFT; out |= ((ImU32)IM_F32_TO_INT8_SAT(in.z)) << IM_COL32_B_SHIFT; out |= ((ImU32)IM_F32_TO_INT8_SAT(in.w)) << IM_COL32_A_SHIFT; return out; } ImU32 ImGui::GetColorU32(ImGuiCol idx, float alpha_mul) { ImGuiStyle& style = GImGui->Style; ImVec4 c = style.Colors[idx]; c.w *= style.Alpha * alpha_mul; return ColorConvertFloat4ToU32(c); } ImU32 ImGui::GetColorU32(const ImVec4& col) { ImGuiStyle& style = GImGui->Style; ImVec4 c = col; c.w *= style.Alpha; return ColorConvertFloat4ToU32(c); } const ImVec4& ImGui::GetStyleColorVec4(ImGuiCol idx) { ImGuiStyle& style = GImGui->Style; return style.Colors[idx]; } ImU32 ImGui::GetColorU32(ImU32 col) { float style_alpha = GImGui->Style.Alpha; if (style_alpha >= 1.0f) return col; ImU32 a = (col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT; a = (ImU32)(a * style_alpha); // We don't need to clamp 0..255 because Style.Alpha is in 0..1 range. return (col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT); } // Convert rgb floats ([0-1],[0-1],[0-1]) to hsv floats ([0-1],[0-1],[0-1]), from Foley & van Dam p592 // Optimized http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv void ImGui::ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v) { float K = 0.f; if (g < b) { ImSwap(g, b); K = -1.f; } if (r < g) { ImSwap(r, g); K = -2.f / 6.f - K; } const float chroma = r - (g < b ? g : b); out_h = fabsf(K + (g - b) / (6.f * chroma + 1e-20f)); out_s = chroma / (r + 1e-20f); out_v = r; } // Convert hsv floats ([0-1],[0-1],[0-1]) to rgb floats ([0-1],[0-1],[0-1]), from Foley & van Dam p593 // also http://en.wikipedia.org/wiki/HSL_and_HSV void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b) { if (s == 0.0f) { // gray out_r = out_g = out_b = v; return; } h = fmodf(h, 1.0f) / (60.0f/360.0f); int i = (int)h; float f = h - (float)i; float p = v * (1.0f - s); float q = v * (1.0f - s * f); float t = v * (1.0f - s * (1.0f - f)); switch (i) { case 0: out_r = v; out_g = t; out_b = p; break; case 1: out_r = q; out_g = v; out_b = p; break; case 2: out_r = p; out_g = v; out_b = t; break; case 3: out_r = p; out_g = q; out_b = v; break; case 4: out_r = t; out_g = p; out_b = v; break; case 5: default: out_r = v; out_g = p; out_b = q; break; } } FILE* ImFileOpen(const char* filename, const char* mode) { #if defined(_WIN32) && !defined(__CYGWIN__) // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. Converting both strings from UTF-8 to wchar format (using a single allocation, because we can) const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1; const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1; ImVector buf; buf.resize(filename_wsize + mode_wsize); ImTextStrFromUtf8(&buf[0], filename_wsize, filename, NULL); ImTextStrFromUtf8(&buf[filename_wsize], mode_wsize, mode, NULL); return _wfopen((wchar_t*)&buf[0], (wchar_t*)&buf[filename_wsize]); #else return fopen(filename, mode); #endif } // Load file content into memory // Memory allocated with ImGui::MemAlloc(), must be freed by user using ImGui::MemFree() void* ImFileLoadToMemory(const char* filename, const char* file_open_mode, int* out_file_size, int padding_bytes) { IM_ASSERT(filename && file_open_mode); if (out_file_size) *out_file_size = 0; FILE* f; if ((f = ImFileOpen(filename, file_open_mode)) == NULL) return NULL; long file_size_signed; if (fseek(f, 0, SEEK_END) || (file_size_signed = ftell(f)) == -1 || fseek(f, 0, SEEK_SET)) { fclose(f); return NULL; } int file_size = (int)file_size_signed; void* file_data = ImGui::MemAlloc((size_t)(file_size + padding_bytes)); if (file_data == NULL) { fclose(f); return NULL; } if (fread(file_data, 1, (size_t)file_size, f) != (size_t)file_size) { fclose(f); ImGui::MemFree(file_data); return NULL; } if (padding_bytes > 0) memset((void *)(((char*)file_data) + file_size), 0, (size_t)padding_bytes); fclose(f); if (out_file_size) *out_file_size = file_size; return file_data; } //----------------------------------------------------------------------------- // ImGuiStorage // Helper: Key->value storage //----------------------------------------------------------------------------- // std::lower_bound but without the bullshit static ImVector::iterator LowerBound(ImVector& data, ImGuiID key) { ImVector::iterator first = data.begin(); ImVector::iterator last = data.end(); size_t count = (size_t)(last - first); while (count > 0) { size_t count2 = count >> 1; ImVector::iterator mid = first + count2; if (mid->key < key) { first = ++mid; count -= count2 + 1; } else { count = count2; } } return first; } // For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once. void ImGuiStorage::BuildSortByKey() { struct StaticFunc { static int IMGUI_CDECL PairCompareByID(const void* lhs, const void* rhs) { // We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that. if (((const Pair*)lhs)->key > ((const Pair*)rhs)->key) return +1; if (((const Pair*)lhs)->key < ((const Pair*)rhs)->key) return -1; return 0; } }; if (Data.Size > 1) qsort(Data.Data, (size_t)Data.Size, sizeof(Pair), StaticFunc::PairCompareByID); } int ImGuiStorage::GetInt(ImGuiID key, int default_val) const { ImVector::iterator it = LowerBound(const_cast&>(Data), key); if (it == Data.end() || it->key != key) return default_val; return it->val_i; } bool ImGuiStorage::GetBool(ImGuiID key, bool default_val) const { return GetInt(key, default_val ? 1 : 0) != 0; } float ImGuiStorage::GetFloat(ImGuiID key, float default_val) const { ImVector::iterator it = LowerBound(const_cast&>(Data), key); if (it == Data.end() || it->key != key) return default_val; return it->val_f; } void* ImGuiStorage::GetVoidPtr(ImGuiID key) const { ImVector::iterator it = LowerBound(const_cast&>(Data), key); if (it == Data.end() || it->key != key) return NULL; return it->val_p; } // References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) { ImVector::iterator it = LowerBound(Data, key); if (it == Data.end() || it->key != key) it = Data.insert(it, Pair(key, default_val)); return &it->val_i; } bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val) { return (bool*)GetIntRef(key, default_val ? 1 : 0); } float* ImGuiStorage::GetFloatRef(ImGuiID key, float default_val) { ImVector::iterator it = LowerBound(Data, key); if (it == Data.end() || it->key != key) it = Data.insert(it, Pair(key, default_val)); return &it->val_f; } void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val) { ImVector::iterator it = LowerBound(Data, key); if (it == Data.end() || it->key != key) it = Data.insert(it, Pair(key, default_val)); return &it->val_p; } // FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame) void ImGuiStorage::SetInt(ImGuiID key, int val) { ImVector::iterator it = LowerBound(Data, key); if (it == Data.end() || it->key != key) { Data.insert(it, Pair(key, val)); return; } it->val_i = val; } void ImGuiStorage::SetBool(ImGuiID key, bool val) { SetInt(key, val ? 1 : 0); } void ImGuiStorage::SetFloat(ImGuiID key, float val) { ImVector::iterator it = LowerBound(Data, key); if (it == Data.end() || it->key != key) { Data.insert(it, Pair(key, val)); return; } it->val_f = val; } void ImGuiStorage::SetVoidPtr(ImGuiID key, void* val) { ImVector::iterator it = LowerBound(Data, key); if (it == Data.end() || it->key != key) { Data.insert(it, Pair(key, val)); return; } it->val_p = val; } void ImGuiStorage::SetAllInt(int v) { for (int i = 0; i < Data.Size; i++) Data[i].val_i = v; } //----------------------------------------------------------------------------- // ImGuiTextFilter //----------------------------------------------------------------------------- // Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]" ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) { if (default_filter) { ImStrncpy(InputBuf, default_filter, IM_ARRAYSIZE(InputBuf)); Build(); } else { InputBuf[0] = 0; CountGrep = 0; } } bool ImGuiTextFilter::Draw(const char* label, float width) { if (width != 0.0f) ImGui::PushItemWidth(width); bool value_changed = ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf)); if (width != 0.0f) ImGui::PopItemWidth(); if (value_changed) Build(); return value_changed; } void ImGuiTextFilter::TextRange::split(char separator, ImVector& out) { out.resize(0); const char* wb = b; const char* we = wb; while (we < e) { if (*we == separator) { out.push_back(TextRange(wb, we)); wb = we + 1; } we++; } if (wb != we) out.push_back(TextRange(wb, we)); } void ImGuiTextFilter::Build() { Filters.resize(0); TextRange input_range(InputBuf, InputBuf+strlen(InputBuf)); input_range.split(',', Filters); CountGrep = 0; for (int i = 0; i != Filters.Size; i++) { Filters[i].trim_blanks(); if (Filters[i].empty()) continue; if (Filters[i].front() != '-') CountGrep += 1; } } bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const { if (Filters.empty()) return true; if (text == NULL) text = ""; for (int i = 0; i != Filters.Size; i++) { const TextRange& f = Filters[i]; if (f.empty()) continue; if (f.front() == '-') { // Subtract if (ImStristr(text, text_end, f.begin()+1, f.end()) != NULL) return false; } else { // Grep if (ImStristr(text, text_end, f.begin(), f.end()) != NULL) return true; } } // Implicit * grep if (CountGrep == 0) return true; return false; } //----------------------------------------------------------------------------- // ImGuiTextBuffer //----------------------------------------------------------------------------- // On some platform vsnprintf() takes va_list by reference and modifies it. // va_copy is the 'correct' way to copy a va_list but Visual Studio prior to 2013 doesn't have it. #ifndef va_copy #define va_copy(dest, src) (dest = src) #endif // Helper: Text buffer for logging/accumulating text void ImGuiTextBuffer::appendfv(const char* fmt, va_list args) { va_list args_copy; va_copy(args_copy, args); int len = ImFormatStringV(NULL, 0, fmt, args); // FIXME-OPT: could do a first pass write attempt, likely successful on first pass. if (len <= 0) return; const int write_off = Buf.Size; const int needed_sz = write_off + len; if (write_off + len >= Buf.Capacity) { int double_capacity = Buf.Capacity * 2; Buf.reserve(needed_sz > double_capacity ? needed_sz : double_capacity); } Buf.resize(needed_sz); ImFormatStringV(&Buf[write_off - 1], (size_t)len + 1, fmt, args_copy); } void ImGuiTextBuffer::appendf(const char* fmt, ...) { va_list args; va_start(args, fmt); appendfv(fmt, args); va_end(args); } //----------------------------------------------------------------------------- // ImGuiSimpleColumns (internal use only) //----------------------------------------------------------------------------- ImGuiMenuColumns::ImGuiMenuColumns() { Count = 0; Spacing = Width = NextWidth = 0.0f; memset(Pos, 0, sizeof(Pos)); memset(NextWidths, 0, sizeof(NextWidths)); } void ImGuiMenuColumns::Update(int count, float spacing, bool clear) { IM_ASSERT(Count <= IM_ARRAYSIZE(Pos)); Count = count; Width = NextWidth = 0.0f; Spacing = spacing; if (clear) memset(NextWidths, 0, sizeof(NextWidths)); for (int i = 0; i < Count; i++) { if (i > 0 && NextWidths[i] > 0.0f) Width += Spacing; Pos[i] = (float)(int)Width; Width += NextWidths[i]; NextWidths[i] = 0.0f; } } float ImGuiMenuColumns::DeclColumns(float w0, float w1, float w2) // not using va_arg because they promote float to double { NextWidth = 0.0f; NextWidths[0] = ImMax(NextWidths[0], w0); NextWidths[1] = ImMax(NextWidths[1], w1); NextWidths[2] = ImMax(NextWidths[2], w2); for (int i = 0; i < 3; i++) NextWidth += NextWidths[i] + ((i > 0 && NextWidths[i] > 0.0f) ? Spacing : 0.0f); return ImMax(Width, NextWidth); } float ImGuiMenuColumns::CalcExtraSpace(float avail_w) { return ImMax(0.0f, avail_w - Width); } //----------------------------------------------------------------------------- // ImGuiListClipper //----------------------------------------------------------------------------- static void SetCursorPosYAndSetupDummyPrevLine(float pos_y, float line_height) { // Set cursor position and a few other things so that SetScrollHere() and Columns() can work when seeking cursor. // FIXME: It is problematic that we have to do that here, because custom/equivalent end-user code would stumble on the same issue. // The clipper should probably have a 4th step to display the last item in a regular manner. ImGui::SetCursorPosY(pos_y); ImGuiWindow* window = ImGui::GetCurrentWindow(); window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height; // Setting those fields so that SetScrollHere() can properly function after the end of our clipper usage. window->DC.PrevLineHeight = (line_height - GImGui->Style.ItemSpacing.y); // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list. if (window->DC.ColumnsSet) window->DC.ColumnsSet->LineMinY = window->DC.CursorPos.y; // Setting this so that cell Y position are set properly } // Use case A: Begin() called from constructor with items_height<0, then called again from Sync() in StepNo 1 // Use case B: Begin() called from constructor with items_height>0 // FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style. void ImGuiListClipper::Begin(int count, float items_height) { StartPosY = ImGui::GetCursorPosY(); ItemsHeight = items_height; ItemsCount = count; StepNo = 0; DisplayEnd = DisplayStart = -1; if (ItemsHeight > 0.0f) { ImGui::CalcListClipping(ItemsCount, ItemsHeight, &DisplayStart, &DisplayEnd); // calculate how many to clip/display if (DisplayStart > 0) SetCursorPosYAndSetupDummyPrevLine(StartPosY + DisplayStart * ItemsHeight, ItemsHeight); // advance cursor StepNo = 2; } } void ImGuiListClipper::End() { if (ItemsCount < 0) return; // In theory here we should assert that ImGui::GetCursorPosY() == StartPosY + DisplayEnd * ItemsHeight, but it feels saner to just seek at the end and not assert/crash the user. if (ItemsCount < INT_MAX) SetCursorPosYAndSetupDummyPrevLine(StartPosY + ItemsCount * ItemsHeight, ItemsHeight); // advance cursor ItemsCount = -1; StepNo = 3; } bool ImGuiListClipper::Step() { if (ItemsCount == 0 || ImGui::GetCurrentWindowRead()->SkipItems) { ItemsCount = -1; return false; } if (StepNo == 0) // Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height. { DisplayStart = 0; DisplayEnd = 1; StartPosY = ImGui::GetCursorPosY(); StepNo = 1; return true; } if (StepNo == 1) // Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element. { if (ItemsCount == 1) { ItemsCount = -1; return false; } float items_height = ImGui::GetCursorPosY() - StartPosY; IM_ASSERT(items_height > 0.0f); // If this triggers, it means Item 0 hasn't moved the cursor vertically Begin(ItemsCount-1, items_height); DisplayStart++; DisplayEnd++; StepNo = 3; return true; } if (StepNo == 2) // Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user still call Step(). Does nothing and switch to Step 3. { IM_ASSERT(DisplayStart >= 0 && DisplayEnd >= 0); StepNo = 3; return true; } if (StepNo == 3) // Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop. End(); return false; } //----------------------------------------------------------------------------- // ImGuiWindow //----------------------------------------------------------------------------- ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name) : DrawListInst(&context->DrawListSharedData) { Name = ImStrdup(name); ID = ImHash(name, 0); IDStack.push_back(ID); Flags = 0; PosFloat = Pos = ImVec2(0.0f, 0.0f); Size = SizeFull = ImVec2(0.0f, 0.0f); SizeContents = SizeContentsExplicit = ImVec2(0.0f, 0.0f); WindowPadding = ImVec2(0.0f, 0.0f); WindowRounding = 0.0f; WindowBorderSize = 0.0f; MoveId = GetID("#MOVE"); ChildId = 0; Scroll = ImVec2(0.0f, 0.0f); ScrollTarget = ImVec2(FLT_MAX, FLT_MAX); ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f); ScrollbarX = ScrollbarY = false; ScrollbarSizes = ImVec2(0.0f, 0.0f); Active = WasActive = false; WriteAccessed = false; Collapsed = false; CollapseToggleWanted = false; SkipItems = false; Appearing = false; CloseButton = false; BeginOrderWithinParent = -1; BeginOrderWithinContext = -1; BeginCount = 0; PopupId = 0; AutoFitFramesX = AutoFitFramesY = -1; AutoFitOnlyGrows = false; AutoFitChildAxises = 0x00; AutoPosLastDirection = ImGuiDir_None; HiddenFrames = 0; SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing; SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX); LastFrameActive = -1; ItemWidthDefault = 0.0f; FontWindowScale = 1.0f; DrawList = &DrawListInst; DrawList->_OwnerName = Name; ParentWindow = NULL; RootWindow = NULL; RootWindowForTitleBarHighlight = NULL; RootWindowForTabbing = NULL; RootWindowForNav = NULL; NavLastIds[0] = NavLastIds[1] = 0; NavRectRel[0] = NavRectRel[1] = ImRect(); NavLastChildNavWindow = NULL; FocusIdxAllCounter = FocusIdxTabCounter = -1; FocusIdxAllRequestCurrent = FocusIdxTabRequestCurrent = INT_MAX; FocusIdxAllRequestNext = FocusIdxTabRequestNext = INT_MAX; } ImGuiWindow::~ImGuiWindow() { IM_ASSERT(DrawList == &DrawListInst); IM_DELETE(Name); for (int i = 0; i != ColumnsStorage.Size; i++) ColumnsStorage[i].~ImGuiColumnsSet(); } ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHash(str, str_end ? (int)(str_end - str) : 0, seed); ImGui::KeepAliveID(id); return id; } ImGuiID ImGuiWindow::GetID(const void* ptr) { ImGuiID seed = IDStack.back(); ImGuiID id = ImHash(&ptr, sizeof(void*), seed); ImGui::KeepAliveID(id); return id; } ImGuiID ImGuiWindow::GetIDNoKeepAlive(const char* str, const char* str_end) { ImGuiID seed = IDStack.back(); return ImHash(str, str_end ? (int)(str_end - str) : 0, seed); } // This is only used in rare/specific situations to manufacture an ID out of nowhere. ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs) { ImGuiID seed = IDStack.back(); const int r_rel[4] = { (int)(r_abs.Min.x - Pos.x), (int)(r_abs.Min.y - Pos.y), (int)(r_abs.Max.x - Pos.x), (int)(r_abs.Max.y - Pos.y) }; ImGuiID id = ImHash(&r_rel, sizeof(r_rel), seed); ImGui::KeepAliveID(id); return id; } //----------------------------------------------------------------------------- // Internal API exposed in imgui_internal.h //----------------------------------------------------------------------------- static void SetCurrentWindow(ImGuiWindow* window) { ImGuiContext& g = *GImGui; g.CurrentWindow = window; if (window) g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); } static void SetNavID(ImGuiID id, int nav_layer) { ImGuiContext& g = *GImGui; IM_ASSERT(g.NavWindow); IM_ASSERT(nav_layer == 0 || nav_layer == 1); g.NavId = id; g.NavWindow->NavLastIds[nav_layer] = id; } static void SetNavIDWithRectRel(ImGuiID id, int nav_layer, const ImRect& rect_rel) { ImGuiContext& g = *GImGui; SetNavID(id, nav_layer); g.NavWindow->NavRectRel[nav_layer] = rect_rel; g.NavMousePosDirty = true; g.NavDisableHighlight = false; g.NavDisableMouseHover = true; } void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) { ImGuiContext& g = *GImGui; g.ActiveIdIsJustActivated = (g.ActiveId != id); if (g.ActiveIdIsJustActivated) g.ActiveIdTimer = 0.0f; g.ActiveId = id; g.ActiveIdAllowNavDirFlags = 0; g.ActiveIdAllowOverlap = false; g.ActiveIdWindow = window; if (id) { g.ActiveIdIsAlive = true; g.ActiveIdSource = (g.NavActivateId == id || g.NavInputId == id || g.NavJustTabbedId == id || g.NavJustMovedToId == id) ? ImGuiInputSource_Nav : ImGuiInputSource_Mouse; } } ImGuiID ImGui::GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; } void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) { ImGuiContext& g = *GImGui; IM_ASSERT(id != 0); // Assume that SetFocusID() is called in the context where its NavLayer is the current layer, which is the case everywhere we call it. const int nav_layer = window->DC.NavLayerCurrent; if (g.NavWindow != window) g.NavInitRequest = false; g.NavId = id; g.NavWindow = window; g.NavLayer = nav_layer; window->NavLastIds[nav_layer] = id; if (window->DC.LastItemId == id) window->NavRectRel[nav_layer] = ImRect(window->DC.LastItemRect.Min - window->Pos, window->DC.LastItemRect.Max - window->Pos); if (g.ActiveIdSource == ImGuiInputSource_Nav) g.NavDisableMouseHover = true; else g.NavDisableHighlight = true; } void ImGui::ClearActiveID() { SetActiveID(0, NULL); } void ImGui::SetHoveredID(ImGuiID id) { ImGuiContext& g = *GImGui; g.HoveredId = id; g.HoveredIdAllowOverlap = false; g.HoveredIdTimer = (id != 0 && g.HoveredIdPreviousFrame == id) ? (g.HoveredIdTimer + g.IO.DeltaTime) : 0.0f; } ImGuiID ImGui::GetHoveredID() { ImGuiContext& g = *GImGui; return g.HoveredId ? g.HoveredId : g.HoveredIdPreviousFrame; } void ImGui::KeepAliveID(ImGuiID id) { ImGuiContext& g = *GImGui; if (g.ActiveId == id) g.ActiveIdIsAlive = true; } static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags) { // An active popup disable hovering on other windows (apart from its own children) // FIXME-OPT: This could be cached/stored within the window. ImGuiContext& g = *GImGui; if (g.NavWindow) if (ImGuiWindow* focused_root_window = g.NavWindow->RootWindow) if (focused_root_window->WasActive && focused_root_window != window->RootWindow) { // For the purpose of those flags we differentiate "standard popup" from "modal popup" // NB: The order of those two tests is important because Modal windows are also Popups. if (focused_root_window->Flags & ImGuiWindowFlags_Modal) return false; if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup)) return false; } return true; } // Advance cursor given item size for layout. void ImGui::ItemSize(const ImVec2& size, float text_offset_y) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (window->SkipItems) return; // Always align ourselves on pixel boundaries const float line_height = ImMax(window->DC.CurrentLineHeight, size.y); const float text_base_offset = ImMax(window->DC.CurrentLineTextBaseOffset, text_offset_y); //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG] window->DC.CursorPosPrevLine = ImVec2(window->DC.CursorPos.x + size.x, window->DC.CursorPos.y); window->DC.CursorPos = ImVec2((float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX), (float)(int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y)); window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x); window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y); //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG] window->DC.PrevLineHeight = line_height; window->DC.PrevLineTextBaseOffset = text_base_offset; window->DC.CurrentLineHeight = window->DC.CurrentLineTextBaseOffset = 0.0f; // Horizontal layout mode if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) SameLine(); } void ImGui::ItemSize(const ImRect& bb, float text_offset_y) { ItemSize(bb.GetSize(), text_offset_y); } static ImGuiDir NavScoreItemGetQuadrant(float dx, float dy) { if (fabsf(dx) > fabsf(dy)) return (dx > 0.0f) ? ImGuiDir_Right : ImGuiDir_Left; return (dy > 0.0f) ? ImGuiDir_Down : ImGuiDir_Up; } static float NavScoreItemDistInterval(float a0, float a1, float b0, float b1) { if (a1 < b0) return a1 - b0; if (b1 < a0) return a0 - b1; return 0.0f; } // Scoring function for directional navigation. Based on https://gist.github.com/rygorous/6981057 static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (g.NavLayer != window->DC.NavLayerCurrent) return false; const ImRect& curr = g.NavScoringRectScreen; // Current modified source rect (NB: we've applied Max.x = Min.x in NavUpdate() to inhibit the effect of having varied item width) g.NavScoringCount++; // We perform scoring on items bounding box clipped by their parent window on the other axis (clipping on our movement axis would give us equal scores for all clipped items) if (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right) { cand.Min.y = ImClamp(cand.Min.y, window->ClipRect.Min.y, window->ClipRect.Max.y); cand.Max.y = ImClamp(cand.Max.y, window->ClipRect.Min.y, window->ClipRect.Max.y); } else { cand.Min.x = ImClamp(cand.Min.x, window->ClipRect.Min.x, window->ClipRect.Max.x); cand.Max.x = ImClamp(cand.Max.x, window->ClipRect.Min.x, window->ClipRect.Max.x); } // Compute distance between boxes // FIXME-NAV: Introducing biases for vertical navigation, needs to be removed. float dbx = NavScoreItemDistInterval(cand.Min.x, cand.Max.x, curr.Min.x, curr.Max.x); float dby = NavScoreItemDistInterval(ImLerp(cand.Min.y, cand.Max.y, 0.2f), ImLerp(cand.Min.y, cand.Max.y, 0.8f), ImLerp(curr.Min.y, curr.Max.y, 0.2f), ImLerp(curr.Min.y, curr.Max.y, 0.8f)); // Scale down on Y to keep using box-distance for vertically touching items if (dby != 0.0f && dbx != 0.0f) dbx = (dbx/1000.0f) + ((dbx > 0.0f) ? +1.0f : -1.0f); float dist_box = fabsf(dbx) + fabsf(dby); // Compute distance between centers (this is off by a factor of 2, but we only compare center distances with each other so it doesn't matter) float dcx = (cand.Min.x + cand.Max.x) - (curr.Min.x + curr.Max.x); float dcy = (cand.Min.y + cand.Max.y) - (curr.Min.y + curr.Max.y); float dist_center = fabsf(dcx) + fabsf(dcy); // L1 metric (need this for our connectedness guarantee) // Determine which quadrant of 'curr' our candidate item 'cand' lies in based on distance ImGuiDir quadrant; float dax = 0.0f, day = 0.0f, dist_axial = 0.0f; if (dbx != 0.0f || dby != 0.0f) { // For non-overlapping boxes, use distance between boxes dax = dbx; day = dby; dist_axial = dist_box; quadrant = NavScoreItemGetQuadrant(dbx, dby); } else if (dcx != 0.0f || dcy != 0.0f) { // For overlapping boxes with different centers, use distance between centers dax = dcx; day = dcy; dist_axial = dist_center; quadrant = NavScoreItemGetQuadrant(dcx, dcy); } else { // Degenerate case: two overlapping buttons with same center, break ties arbitrarily (note that LastItemId here is really the _previous_ item order, but it doesn't matter) quadrant = (window->DC.LastItemId < g.NavId) ? ImGuiDir_Left : ImGuiDir_Right; } #if IMGUI_DEBUG_NAV_SCORING char buf[128]; if (ImGui::IsMouseHoveringRect(cand.Min, cand.Max)) { ImFormatString(buf, IM_ARRAYSIZE(buf), "dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial, "WENS"[g.NavMoveDir], "WENS"[quadrant]); g.OverlayDrawList.AddRect(curr.Min, curr.Max, IM_COL32(255, 200, 0, 100)); g.OverlayDrawList.AddRect(cand.Min, cand.Max, IM_COL32(255,255,0,200)); g.OverlayDrawList.AddRectFilled(cand.Max-ImVec2(4,4), cand.Max+ImGui::CalcTextSize(buf)+ImVec2(4,4), IM_COL32(40,0,0,150)); g.OverlayDrawList.AddText(g.IO.FontDefault, 13.0f, cand.Max, ~0U, buf); } else if (g.IO.KeyCtrl) // Hold to preview score in matching quadrant. Press C to rotate. { if (IsKeyPressedMap(ImGuiKey_C)) { g.NavMoveDirLast = (ImGuiDir)((g.NavMoveDirLast + 1) & 3); g.IO.KeysDownDuration[g.IO.KeyMap[ImGuiKey_C]] = 0.01f; } if (quadrant == g.NavMoveDir) { ImFormatString(buf, IM_ARRAYSIZE(buf), "%.0f/%.0f", dist_box, dist_center); g.OverlayDrawList.AddRectFilled(cand.Min, cand.Max, IM_COL32(255, 0, 0, 200)); g.OverlayDrawList.AddText(g.IO.FontDefault, 13.0f, cand.Min, IM_COL32(255, 255, 255, 255), buf); } } #endif // Is it in the quadrant we're interesting in moving to? bool new_best = false; if (quadrant == g.NavMoveDir) { // Does it beat the current best candidate? if (dist_box < result->DistBox) { result->DistBox = dist_box; result->DistCenter = dist_center; return true; } if (dist_box == result->DistBox) { // Try using distance between center points to break ties if (dist_center < result->DistCenter) { result->DistCenter = dist_center; new_best = true; } else if (dist_center == result->DistCenter) { // Still tied! we need to be extra-careful to make sure everything gets linked properly. We consistently break ties by symbolically moving "later" items // (with higher index) to the right/downwards by an infinitesimal amount since we the current "best" button already (so it must have a lower index), // this is fairly easy. This rule ensures that all buttons with dx==dy==0 will end up being linked in order of appearance along the x axis. if (((g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) ? dby : dbx) < 0.0f) // moving bj to the right/down decreases distance new_best = true; } } } // Axial check: if 'curr' has no link at all in some direction and 'cand' lies roughly in that direction, add a tentative link. This will only be kept if no "real" matches // are found, so it only augments the graph produced by the above method using extra links. (important, since it doesn't guarantee strong connectedness) // This is just to avoid buttons having no links in a particular direction when there's a suitable neighbor. you get good graphs without this too. // 2017/09/29: FIXME: This now currently only enabled inside menu bars, ideally we'd disable it everywhere. Menus in particular need to catch failure. For general navigation it feels awkward. // Disabling it may however lead to disconnected graphs when nodes are very spaced out on different axis. Perhaps consider offering this as an option? if (result->DistBox == FLT_MAX && dist_axial < result->DistAxial) // Check axial match if (g.NavLayer == 1 && !(g.NavWindow->Flags & ImGuiWindowFlags_ChildMenu)) if ((g.NavMoveDir == ImGuiDir_Left && dax < 0.0f) || (g.NavMoveDir == ImGuiDir_Right && dax > 0.0f) || (g.NavMoveDir == ImGuiDir_Up && day < 0.0f) || (g.NavMoveDir == ImGuiDir_Down && day > 0.0f)) { result->DistAxial = dist_axial; new_best = true; } return new_best; } static void NavSaveLastChildNavWindow(ImGuiWindow* child_window) { ImGuiWindow* parent_window = child_window; while (parent_window && (parent_window->Flags & ImGuiWindowFlags_ChildWindow) != 0 && (parent_window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu)) == 0) parent_window = parent_window->ParentWindow; if (parent_window && parent_window != child_window) parent_window->NavLastChildNavWindow = child_window; } // Call when we are expected to land on Layer 0 after FocusWindow() static ImGuiWindow* NavRestoreLastChildNavWindow(ImGuiWindow* window) { return window->NavLastChildNavWindow ? window->NavLastChildNavWindow : window; } static void NavRestoreLayer(int layer) { ImGuiContext& g = *GImGui; g.NavLayer = layer; if (layer == 0) g.NavWindow = NavRestoreLastChildNavWindow(g.NavWindow); if (layer == 0 && g.NavWindow->NavLastIds[0] != 0) SetNavIDWithRectRel(g.NavWindow->NavLastIds[0], layer, g.NavWindow->NavRectRel[0]); else ImGui::NavInitWindow(g.NavWindow, true); } static inline void NavUpdateAnyRequestFlag() { ImGuiContext& g = *GImGui; g.NavAnyRequest = g.NavMoveRequest || g.NavInitRequest || (IMGUI_DEBUG_NAV_SCORING && g.NavWindow != NULL); if (g.NavAnyRequest) IM_ASSERT(g.NavWindow != NULL); } static bool NavMoveRequestButNoResultYet() { ImGuiContext& g = *GImGui; return g.NavMoveRequest && g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0; } void ImGui::NavMoveRequestCancel() { ImGuiContext& g = *GImGui; g.NavMoveRequest = false; NavUpdateAnyRequestFlag(); } // We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above) static void ImGui::NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, const ImGuiID id) { ImGuiContext& g = *GImGui; //if (!g.IO.NavActive) // [2017/10/06] Removed this possibly redundant test but I am not sure of all the side-effects yet. Some of the feature here will need to work regardless of using a _NoNavInputs flag. // return; const ImGuiItemFlags item_flags = window->DC.ItemFlags; const ImRect nav_bb_rel(nav_bb.Min - window->Pos, nav_bb.Max - window->Pos); if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent) { // Even if 'ImGuiItemFlags_NoNavDefaultFocus' is on (typically collapse/close button) we record the first ResultId so they can be used as a fallback if (!(item_flags & ImGuiItemFlags_NoNavDefaultFocus) || g.NavInitResultId == 0) { g.NavInitResultId = id; g.NavInitResultRectRel = nav_bb_rel; } if (!(item_flags & ImGuiItemFlags_NoNavDefaultFocus)) { g.NavInitRequest = false; // Found a match, clear request NavUpdateAnyRequestFlag(); } } // Scoring for navigation if (g.NavId != id && !(item_flags & ImGuiItemFlags_NoNav)) { ImGuiNavMoveResult* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; #if IMGUI_DEBUG_NAV_SCORING // [DEBUG] Score all items in NavWindow at all times if (!g.NavMoveRequest) g.NavMoveDir = g.NavMoveDirLast; bool new_best = NavScoreItem(result, nav_bb) && g.NavMoveRequest; #else bool new_best = g.NavMoveRequest && NavScoreItem(result, nav_bb); #endif if (new_best) { result->ID = id; result->ParentID = window->IDStack.back(); result->Window = window; result->RectRel = nav_bb_rel; } } // Update window-relative bounding box of navigated item if (g.NavId == id) { g.NavWindow = window; // Always refresh g.NavWindow, because some operations such as FocusItem() don't have a window. g.NavLayer = window->DC.NavLayerCurrent; g.NavIdIsAlive = true; g.NavIdTabCounter = window->FocusIdxTabCounter; window->NavRectRel[window->DC.NavLayerCurrent] = nav_bb_rel; // Store item bounding box (relative to window position) } } // Declare item bounding box for clipping and interaction. // Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface // declare their minimum size requirement to ItemSize() and then use a larger region for drawing/interaction, which is passed to ItemAdd(). bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (id != 0) { // Navigation processing runs prior to clipping early-out // (a) So that NavInitRequest can be honored, for newly opened windows to select a default widget // (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests unfortunately, but it is still limited to one window. // it may not scale very well for windows with ten of thousands of item, but at least NavMoveRequest is only set on user interaction, aka maximum once a frame. // We could early out with "if (is_clipped && !g.NavInitRequest) return false;" but when we wouldn't be able to reach unclipped widgets. This would work if user had explicit scrolling control (e.g. mapped on a stick) window->DC.NavLayerActiveMaskNext |= window->DC.NavLayerCurrentMask; if (g.NavId == id || g.NavAnyRequest) if (g.NavWindow->RootWindowForNav == window->RootWindowForNav) if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened)) NavProcessItem(window, nav_bb_arg ? *nav_bb_arg : bb, id); } window->DC.LastItemId = id; window->DC.LastItemRect = bb; window->DC.LastItemStatusFlags = 0; // Clipping test const bool is_clipped = IsClippedEx(bb, id, false); if (is_clipped) return false; //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG] // We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them) if (IsMouseHoveringRect(bb.Min, bb.Max)) window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HoveredRect; return true; } // This is roughly matching the behavior of internal-facing ItemHoverable() // - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered() // - this should work even for non-interactive items that have no ID, so we cannot use LastItemId bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (g.NavDisableMouseHover && !g.NavDisableHighlight) return IsItemFocused(); // Test for bounding box overlap, as updated as ItemAdd() if (!(window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect)) return false; IM_ASSERT((flags & (ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows)) == 0); // Flags not supported by this function // Test if we are hovering the right window (our window could be behind another window) // [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable to use IsItemHovered() after EndChild() itself. // Until a solution is found I believe reverting to the test from 2017/09/27 is safe since this was the test that has been running for a long while. //if (g.HoveredWindow != window) // return false; if (g.HoveredRootWindow != window->RootWindow && !(flags & ImGuiHoveredFlags_AllowWhenOverlapped)) return false; // Test if another item is active (e.g. being dragged) if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) if (g.ActiveId != 0 && g.ActiveId != window->DC.LastItemId && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId) return false; // Test if interactions on this window are blocked by an active popup or modal if (!IsWindowContentHoverable(window, flags)) return false; // Test if the item is disabled if (window->DC.ItemFlags & ImGuiItemFlags_Disabled) return false; // Special handling for the 1st item after Begin() which represent the title bar. When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect tht case. if (window->DC.LastItemId == window->MoveId && window->WriteAccessed) return false; return true; } // Internal facing ItemHoverable() used when submitting widgets. Differs slightly from IsItemHovered(). bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id) { ImGuiContext& g = *GImGui; if (g.HoveredId != 0 && g.HoveredId != id && !g.HoveredIdAllowOverlap) return false; ImGuiWindow* window = g.CurrentWindow; if (g.HoveredWindow != window) return false; if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap) return false; if (!IsMouseHoveringRect(bb.Min, bb.Max)) return false; if (g.NavDisableMouseHover || !IsWindowContentHoverable(window, ImGuiHoveredFlags_Default)) return false; if (window->DC.ItemFlags & ImGuiItemFlags_Disabled) return false; SetHoveredID(id); return true; } bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id, bool clip_even_when_logged) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (!bb.Overlaps(window->ClipRect)) if (id == 0 || id != g.ActiveId) if (clip_even_when_logged || !g.LogEnabled) return true; return false; } bool ImGui::FocusableItemRegister(ImGuiWindow* window, ImGuiID id, bool tab_stop) { ImGuiContext& g = *GImGui; const bool allow_keyboard_focus = (window->DC.ItemFlags & (ImGuiItemFlags_AllowKeyboardFocus | ImGuiItemFlags_Disabled)) == ImGuiItemFlags_AllowKeyboardFocus; window->FocusIdxAllCounter++; if (allow_keyboard_focus) window->FocusIdxTabCounter++; // Process keyboard input at this point: TAB/Shift-TAB to tab out of the currently focused item. // Note that we can always TAB out of a widget that doesn't allow tabbing in. if (tab_stop && (g.ActiveId == id) && window->FocusIdxAllRequestNext == INT_MAX && window->FocusIdxTabRequestNext == INT_MAX && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab)) window->FocusIdxTabRequestNext = window->FocusIdxTabCounter + (g.IO.KeyShift ? (allow_keyboard_focus ? -1 : 0) : +1); // Modulo on index will be applied at the end of frame once we've got the total counter of items. if (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent) return true; if (allow_keyboard_focus && window->FocusIdxTabCounter == window->FocusIdxTabRequestCurrent) { g.NavJustTabbedId = id; return true; } return false; } void ImGui::FocusableItemUnregister(ImGuiWindow* window) { window->FocusIdxAllCounter--; window->FocusIdxTabCounter--; } ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_x, float default_y) { ImGuiContext& g = *GImGui; ImVec2 content_max; if (size.x < 0.0f || size.y < 0.0f) content_max = g.CurrentWindow->Pos + GetContentRegionMax(); if (size.x <= 0.0f) size.x = (size.x == 0.0f) ? default_x : ImMax(content_max.x - g.CurrentWindow->DC.CursorPos.x, 4.0f) + size.x; if (size.y <= 0.0f) size.y = (size.y == 0.0f) ? default_y : ImMax(content_max.y - g.CurrentWindow->DC.CursorPos.y, 4.0f) + size.y; return size; } float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x) { if (wrap_pos_x < 0.0f) return 0.0f; ImGuiWindow* window = GetCurrentWindowRead(); if (wrap_pos_x == 0.0f) wrap_pos_x = GetContentRegionMax().x + window->Pos.x; else if (wrap_pos_x > 0.0f) wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space return ImMax(wrap_pos_x - pos.x, 1.0f); } //----------------------------------------------------------------------------- void* ImGui::MemAlloc(size_t sz) { GImAllocatorActiveAllocationsCount++; return GImAllocatorAllocFunc(sz, GImAllocatorUserData); } void ImGui::MemFree(void* ptr) { if (ptr) GImAllocatorActiveAllocationsCount--; return GImAllocatorFreeFunc(ptr, GImAllocatorUserData); } const char* ImGui::GetClipboardText() { return GImGui->IO.GetClipboardTextFn ? GImGui->IO.GetClipboardTextFn(GImGui->IO.ClipboardUserData) : ""; } void ImGui::SetClipboardText(const char* text) { if (GImGui->IO.SetClipboardTextFn) GImGui->IO.SetClipboardTextFn(GImGui->IO.ClipboardUserData, text); } const char* ImGui::GetVersion() { return IMGUI_VERSION; } // Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself // Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module ImGuiContext* ImGui::GetCurrentContext() { return GImGui; } void ImGui::SetCurrentContext(ImGuiContext* ctx) { #ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have control over this. #else GImGui = ctx; #endif } void ImGui::SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void(*free_func)(void* ptr, void* user_data), void* user_data) { GImAllocatorAllocFunc = alloc_func; GImAllocatorFreeFunc = free_func; GImAllocatorUserData = user_data; } ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas) { ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas); if (GImGui == NULL) SetCurrentContext(ctx); Initialize(ctx); return ctx; } void ImGui::DestroyContext(ImGuiContext* ctx) { if (ctx == NULL) ctx = GImGui; Shutdown(ctx); if (GImGui == ctx) SetCurrentContext(NULL); IM_DELETE(ctx); } ImGuiIO& ImGui::GetIO() { IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?"); return GImGui->IO; } ImGuiStyle& ImGui::GetStyle() { IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?"); return GImGui->Style; } // Same value as passed to the old io.RenderDrawListsFn function. Valid after Render() and until the next call to NewFrame() ImDrawData* ImGui::GetDrawData() { ImGuiContext& g = *GImGui; return g.DrawData.Valid ? &g.DrawData : NULL; } float ImGui::GetTime() { return GImGui->Time; } int ImGui::GetFrameCount() { return GImGui->FrameCount; } ImDrawList* ImGui::GetOverlayDrawList() { return &GImGui->OverlayDrawList; } ImDrawListSharedData* ImGui::GetDrawListSharedData() { return &GImGui->DrawListSharedData; } // This needs to be called before we submit any widget (aka in or before Begin) void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) { ImGuiContext& g = *GImGui; IM_ASSERT(window == g.NavWindow); bool init_for_nav = false; if (!(window->Flags & ImGuiWindowFlags_NoNavInputs)) if (!(window->Flags & ImGuiWindowFlags_ChildWindow) || (window->Flags & ImGuiWindowFlags_Popup) || (window->NavLastIds[0] == 0) || force_reinit) init_for_nav = true; if (init_for_nav) { SetNavID(0, g.NavLayer); g.NavInitRequest = true; g.NavInitRequestFromMove = false; g.NavInitResultId = 0; g.NavInitResultRectRel = ImRect(); NavUpdateAnyRequestFlag(); } else { g.NavId = window->NavLastIds[0]; } } static ImVec2 NavCalcPreferredMousePos() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.NavWindow; if (!window) return g.IO.MousePos; const ImRect& rect_rel = window->NavRectRel[g.NavLayer]; ImVec2 pos = g.NavWindow->Pos + ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x*4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight())); ImRect visible_rect = GetViewportRect(); return ImFloor(ImClamp(pos, visible_rect.Min, visible_rect.Max)); // ImFloor() is important because non-integer mouse position application in back-end might be lossy and result in undesirable non-zero delta. } static int FindWindowIndex(ImGuiWindow* window) // FIXME-OPT O(N) { ImGuiContext& g = *GImGui; for (int i = g.Windows.Size-1; i >= 0; i--) if (g.Windows[i] == window) return i; return -1; } static ImGuiWindow* FindWindowNavigable(int i_start, int i_stop, int dir) // FIXME-OPT O(N) { ImGuiContext& g = *GImGui; for (int i = i_start; i >= 0 && i < g.Windows.Size && i != i_stop; i += dir) if (ImGui::IsWindowNavFocusable(g.Windows[i])) return g.Windows[i]; return NULL; } float ImGui::GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode) { ImGuiContext& g = *GImGui; if (mode == ImGuiInputReadMode_Down) return g.IO.NavInputs[n]; // Instant, read analog input (0.0f..1.0f, as provided by user) const float t = g.IO.NavInputsDownDuration[n]; if (t < 0.0f && mode == ImGuiInputReadMode_Released) // Return 1.0f when just released, no repeat, ignore analog input. return (g.IO.NavInputsDownDurationPrev[n] >= 0.0f ? 1.0f : 0.0f); if (t < 0.0f) return 0.0f; if (mode == ImGuiInputReadMode_Pressed) // Return 1.0f when just pressed, no repeat, ignore analog input. return (t == 0.0f) ? 1.0f : 0.0f; if (mode == ImGuiInputReadMode_Repeat) return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f, g.IO.KeyRepeatRate * 0.80f); if (mode == ImGuiInputReadMode_RepeatSlow) return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 1.00f, g.IO.KeyRepeatRate * 2.00f); if (mode == ImGuiInputReadMode_RepeatFast) return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f, g.IO.KeyRepeatRate * 0.30f); return 0.0f; } // Equivalent of IsKeyDown() for NavInputs[] static bool IsNavInputDown(ImGuiNavInput n) { return GImGui->IO.NavInputs[n] > 0.0f; } // Equivalent of IsKeyPressed() for NavInputs[] static bool IsNavInputPressed(ImGuiNavInput n, ImGuiInputReadMode mode) { return ImGui::GetNavInputAmount(n, mode) > 0.0f; } static bool IsNavInputPressedAnyOfTwo(ImGuiNavInput n1, ImGuiNavInput n2, ImGuiInputReadMode mode) { return (ImGui::GetNavInputAmount(n1, mode) + ImGui::GetNavInputAmount(n2, mode)) > 0.0f; } ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor, float fast_factor) { ImVec2 delta(0.0f, 0.0f); if (dir_sources & ImGuiNavDirSourceFlags_Keyboard) delta += ImVec2(GetNavInputAmount(ImGuiNavInput_KeyRight_, mode) - GetNavInputAmount(ImGuiNavInput_KeyLeft_, mode), GetNavInputAmount(ImGuiNavInput_KeyDown_, mode) - GetNavInputAmount(ImGuiNavInput_KeyUp_, mode)); if (dir_sources & ImGuiNavDirSourceFlags_PadDPad) delta += ImVec2(GetNavInputAmount(ImGuiNavInput_DpadRight, mode) - GetNavInputAmount(ImGuiNavInput_DpadLeft, mode), GetNavInputAmount(ImGuiNavInput_DpadDown, mode) - GetNavInputAmount(ImGuiNavInput_DpadUp, mode)); if (dir_sources & ImGuiNavDirSourceFlags_PadLStick) delta += ImVec2(GetNavInputAmount(ImGuiNavInput_LStickRight, mode) - GetNavInputAmount(ImGuiNavInput_LStickLeft, mode), GetNavInputAmount(ImGuiNavInput_LStickDown, mode) - GetNavInputAmount(ImGuiNavInput_LStickUp, mode)); if (slow_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakSlow)) delta *= slow_factor; if (fast_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakFast)) delta *= fast_factor; return delta; } static void NavUpdateWindowingHighlightWindow(int focus_change_dir) { ImGuiContext& g = *GImGui; IM_ASSERT(g.NavWindowingTarget); if (g.NavWindowingTarget->Flags & ImGuiWindowFlags_Modal) return; const int i_current = FindWindowIndex(g.NavWindowingTarget); ImGuiWindow* window_target = FindWindowNavigable(i_current + focus_change_dir, -INT_MAX, focus_change_dir); if (!window_target) window_target = FindWindowNavigable((focus_change_dir < 0) ? (g.Windows.Size - 1) : 0, i_current, focus_change_dir); g.NavWindowingTarget = window_target; g.NavWindowingToggleLayer = false; } // Window management mode (hold to: change focus/move/resize, tap to: toggle menu layer) static void ImGui::NavUpdateWindowing() { ImGuiContext& g = *GImGui; ImGuiWindow* apply_focus_window = NULL; bool apply_toggle_layer = false; bool start_windowing_with_gamepad = !g.NavWindowingTarget && IsNavInputPressed(ImGuiNavInput_Menu, ImGuiInputReadMode_Pressed); bool start_windowing_with_keyboard = !g.NavWindowingTarget && g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab) && (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard); if (start_windowing_with_gamepad || start_windowing_with_keyboard) if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavigable(g.Windows.Size - 1, -INT_MAX, -1)) { g.NavWindowingTarget = window->RootWindowForTabbing; g.NavWindowingHighlightTimer = g.NavWindowingHighlightAlpha = 0.0f; g.NavWindowingToggleLayer = start_windowing_with_keyboard ? false : true; g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_NavKeyboard : ImGuiInputSource_NavGamepad; } // Gamepad update g.NavWindowingHighlightTimer += g.IO.DeltaTime; if (g.NavWindowingTarget && g.NavInputSource == ImGuiInputSource_NavGamepad) { // Highlight only appears after a brief time holding the button, so that a fast tap on PadMenu (to toggle NavLayer) doesn't add visual noise g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingHighlightTimer - 0.20f) / 0.05f)); // Select window to focus const int focus_change_dir = (int)IsNavInputPressed(ImGuiNavInput_FocusPrev, ImGuiInputReadMode_RepeatSlow) - (int)IsNavInputPressed(ImGuiNavInput_FocusNext, ImGuiInputReadMode_RepeatSlow); if (focus_change_dir != 0) { NavUpdateWindowingHighlightWindow(focus_change_dir); g.NavWindowingHighlightAlpha = 1.0f; } // Single press toggles NavLayer, long press with L/R apply actual focus on release (until then the window was merely rendered front-most) if (!IsNavInputDown(ImGuiNavInput_Menu)) { g.NavWindowingToggleLayer &= (g.NavWindowingHighlightAlpha < 1.0f); // Once button was held long enough we don't consider it a tap-to-toggle-layer press anymore. if (g.NavWindowingToggleLayer && g.NavWindow) apply_toggle_layer = true; else if (!g.NavWindowingToggleLayer) apply_focus_window = g.NavWindowingTarget; g.NavWindowingTarget = NULL; } } // Keyboard: Focus if (g.NavWindowingTarget && g.NavInputSource == ImGuiInputSource_NavKeyboard) { // Visuals only appears after a brief time after pressing TAB the first time, so that a fast CTRL+TAB doesn't add visual noise g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingHighlightTimer - 0.15f) / 0.04f)); // 1.0f if (IsKeyPressedMap(ImGuiKey_Tab, true)) NavUpdateWindowingHighlightWindow(g.IO.KeyShift ? +1 : -1); if (!g.IO.KeyCtrl) apply_focus_window = g.NavWindowingTarget; } // Keyboard: Press and Release ALT to toggle menu layer // FIXME: We lack an explicit IO variable for "is the imgui window focused", so compare mouse validity to detect the common case of back-end clearing releases all keys on ALT-TAB if ((g.ActiveId == 0 || g.ActiveIdAllowOverlap) && IsNavInputPressed(ImGuiNavInput_KeyMenu_, ImGuiInputReadMode_Released)) if (IsMousePosValid(&g.IO.MousePos) == IsMousePosValid(&g.IO.MousePosPrev)) apply_toggle_layer = true; // Move window if (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoMove)) { ImVec2 move_delta; if (g.NavInputSource == ImGuiInputSource_NavKeyboard && !g.IO.KeyShift) move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down); if (g.NavInputSource == ImGuiInputSource_NavGamepad) move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down); if (move_delta.x != 0.0f || move_delta.y != 0.0f) { const float NAV_MOVE_SPEED = 800.0f; const float move_speed = ImFloor(NAV_MOVE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y)); g.NavWindowingTarget->PosFloat += move_delta * move_speed; g.NavDisableMouseHover = true; MarkIniSettingsDirty(g.NavWindowingTarget); } } // Apply final focus if (apply_focus_window && (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindowForTabbing)) { g.NavDisableHighlight = false; g.NavDisableMouseHover = true; apply_focus_window = NavRestoreLastChildNavWindow(apply_focus_window); ClosePopupsOverWindow(apply_focus_window); FocusWindow(apply_focus_window); if (apply_focus_window->NavLastIds[0] == 0) NavInitWindow(apply_focus_window, false); // If the window only has a menu layer, select it directly if (apply_focus_window->DC.NavLayerActiveMask == (1 << 1)) g.NavLayer = 1; } if (apply_focus_window) g.NavWindowingTarget = NULL; // Apply menu/layer toggle if (apply_toggle_layer && g.NavWindow) { ImGuiWindow* new_nav_window = g.NavWindow; while ((new_nav_window->DC.NavLayerActiveMask & (1 << 1)) == 0 && (new_nav_window->Flags & ImGuiWindowFlags_ChildWindow) != 0 && (new_nav_window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu)) == 0) new_nav_window = new_nav_window->ParentWindow; if (new_nav_window != g.NavWindow) { ImGuiWindow* old_nav_window = g.NavWindow; FocusWindow(new_nav_window); new_nav_window->NavLastChildNavWindow = old_nav_window; } g.NavDisableHighlight = false; g.NavDisableMouseHover = true; NavRestoreLayer((g.NavWindow->DC.NavLayerActiveMask & (1 << 1)) ? (g.NavLayer ^ 1) : 0); } } // NB: We modify rect_rel by the amount we scrolled for, so it is immediately updated. static void NavScrollToBringItemIntoView(ImGuiWindow* window, ImRect& item_rect_rel) { // Scroll to keep newly navigated item fully into view ImRect window_rect_rel(window->InnerRect.Min - window->Pos - ImVec2(1, 1), window->InnerRect.Max - window->Pos + ImVec2(1, 1)); //g.OverlayDrawList.AddRect(window->Pos + window_rect_rel.Min, window->Pos + window_rect_rel.Max, IM_COL32_WHITE); // [DEBUG] if (window_rect_rel.Contains(item_rect_rel)) return; ImGuiContext& g = *GImGui; if (window->ScrollbarX && item_rect_rel.Min.x < window_rect_rel.Min.x) { window->ScrollTarget.x = item_rect_rel.Min.x + window->Scroll.x - g.Style.ItemSpacing.x; window->ScrollTargetCenterRatio.x = 0.0f; } else if (window->ScrollbarX && item_rect_rel.Max.x >= window_rect_rel.Max.x) { window->ScrollTarget.x = item_rect_rel.Max.x + window->Scroll.x + g.Style.ItemSpacing.x; window->ScrollTargetCenterRatio.x = 1.0f; } if (item_rect_rel.Min.y < window_rect_rel.Min.y) { window->ScrollTarget.y = item_rect_rel.Min.y + window->Scroll.y - g.Style.ItemSpacing.y; window->ScrollTargetCenterRatio.y = 0.0f; } else if (item_rect_rel.Max.y >= window_rect_rel.Max.y) { window->ScrollTarget.y = item_rect_rel.Max.y + window->Scroll.y + g.Style.ItemSpacing.y; window->ScrollTargetCenterRatio.y = 1.0f; } // Estimate upcoming scroll so we can offset our relative mouse position so mouse position can be applied immediately (under this block) ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window); item_rect_rel.Translate(window->Scroll - next_scroll); } static void ImGui::NavUpdate() { ImGuiContext& g = *GImGui; g.IO.WantSetMousePos = false; #if 0 if (g.NavScoringCount > 0) printf("[%05d] NavScoringCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.FrameCount, g.NavScoringCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest); #endif if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad)) if (g.IO.NavInputs[ImGuiNavInput_Activate] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Input] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Cancel] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Menu] > 0.0f) g.NavInputSource = ImGuiInputSource_NavGamepad; // Update Keyboard->Nav inputs mapping if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) { #define NAV_MAP_KEY(_KEY, _NAV_INPUT) if (IsKeyDown(g.IO.KeyMap[_KEY])) { g.IO.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_NavKeyboard; } NAV_MAP_KEY(ImGuiKey_Space, ImGuiNavInput_Activate ); NAV_MAP_KEY(ImGuiKey_Enter, ImGuiNavInput_Input ); NAV_MAP_KEY(ImGuiKey_Escape, ImGuiNavInput_Cancel ); NAV_MAP_KEY(ImGuiKey_LeftArrow, ImGuiNavInput_KeyLeft_ ); NAV_MAP_KEY(ImGuiKey_RightArrow,ImGuiNavInput_KeyRight_); NAV_MAP_KEY(ImGuiKey_UpArrow, ImGuiNavInput_KeyUp_ ); NAV_MAP_KEY(ImGuiKey_DownArrow, ImGuiNavInput_KeyDown_ ); if (g.IO.KeyCtrl) g.IO.NavInputs[ImGuiNavInput_TweakSlow] = 1.0f; if (g.IO.KeyShift) g.IO.NavInputs[ImGuiNavInput_TweakFast] = 1.0f; if (g.IO.KeyAlt) g.IO.NavInputs[ImGuiNavInput_KeyMenu_] = 1.0f; #undef NAV_MAP_KEY } memcpy(g.IO.NavInputsDownDurationPrev, g.IO.NavInputsDownDuration, sizeof(g.IO.NavInputsDownDuration)); for (int i = 0; i < IM_ARRAYSIZE(g.IO.NavInputs); i++) g.IO.NavInputsDownDuration[i] = (g.IO.NavInputs[i] > 0.0f) ? (g.IO.NavInputsDownDuration[i] < 0.0f ? 0.0f : g.IO.NavInputsDownDuration[i] + g.IO.DeltaTime) : -1.0f; // Process navigation init request (select first/default focus) if (g.NavInitResultId != 0 && (!g.NavDisableHighlight || g.NavInitRequestFromMove)) { // Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called) IM_ASSERT(g.NavWindow); if (g.NavInitRequestFromMove) SetNavIDWithRectRel(g.NavInitResultId, g.NavLayer, g.NavInitResultRectRel); else SetNavID(g.NavInitResultId, g.NavLayer); g.NavWindow->NavRectRel[g.NavLayer] = g.NavInitResultRectRel; } g.NavInitRequest = false; g.NavInitRequestFromMove = false; g.NavInitResultId = 0; g.NavJustMovedToId = 0; // Process navigation move request if (g.NavMoveRequest && (g.NavMoveResultLocal.ID != 0 || g.NavMoveResultOther.ID != 0)) { // Select which result to use ImGuiNavMoveResult* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : &g.NavMoveResultOther; if (g.NavMoveResultOther.ID != 0 && g.NavMoveResultOther.Window->ParentWindow == g.NavWindow) // Maybe entering a flattened child? In this case solve the tie using the regular scoring rules if ((g.NavMoveResultOther.DistBox < g.NavMoveResultLocal.DistBox) || (g.NavMoveResultOther.DistBox == g.NavMoveResultLocal.DistBox && g.NavMoveResultOther.DistCenter < g.NavMoveResultLocal.DistCenter)) result = &g.NavMoveResultOther; IM_ASSERT(g.NavWindow && result->Window); // Scroll to keep newly navigated item fully into view if (g.NavLayer == 0) NavScrollToBringItemIntoView(result->Window, result->RectRel); // Apply result from previous frame navigation directional move request ClearActiveID(); g.NavWindow = result->Window; SetNavIDWithRectRel(result->ID, g.NavLayer, result->RectRel); g.NavJustMovedToId = result->ID; g.NavMoveFromClampedRefRect = false; } // When a forwarded move request failed, we restore the highlight that we disabled during the forward frame if (g.NavMoveRequestForward == ImGuiNavForward_ForwardActive) { IM_ASSERT(g.NavMoveRequest); if (g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0) g.NavDisableHighlight = false; g.NavMoveRequestForward = ImGuiNavForward_None; } // Apply application mouse position movement, after we had a chance to process move request result. if (g.NavMousePosDirty && g.NavIdIsAlive) { // Set mouse position given our knowledge of the nav widget position from last frame if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (g.IO.BackendFlags & ImGuiBackendFlags_HasSetMousePos)) { g.IO.MousePos = g.IO.MousePosPrev = NavCalcPreferredMousePos(); g.IO.WantSetMousePos = true; } g.NavMousePosDirty = false; } g.NavIdIsAlive = false; g.NavJustTabbedId = 0; IM_ASSERT(g.NavLayer == 0 || g.NavLayer == 1); // Store our return window (for returning from Layer 1 to Layer 0) and clear it as soon as we step back in our own Layer 0 if (g.NavWindow) NavSaveLastChildNavWindow(g.NavWindow); if (g.NavWindow && g.NavWindow->NavLastChildNavWindow != NULL && g.NavLayer == 0) g.NavWindow->NavLastChildNavWindow = NULL; NavUpdateWindowing(); // Set output flags for user application bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0; bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0; g.IO.NavActive = (nav_keyboard_active || nav_gamepad_active) && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs); g.IO.NavVisible = (g.IO.NavActive && g.NavId != 0 && !g.NavDisableHighlight) || (g.NavWindowingTarget != NULL) || g.NavInitRequest; // Process NavCancel input (to close a popup, get back to parent, clear focus) if (IsNavInputPressed(ImGuiNavInput_Cancel, ImGuiInputReadMode_Pressed)) { if (g.ActiveId != 0) { ClearActiveID(); } else if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow) && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow) { // Exit child window ImGuiWindow* child_window = g.NavWindow; ImGuiWindow* parent_window = g.NavWindow->ParentWindow; IM_ASSERT(child_window->ChildId != 0); FocusWindow(parent_window); SetNavID(child_window->ChildId, 0); g.NavIdIsAlive = false; if (g.NavDisableMouseHover) g.NavMousePosDirty = true; } else if (g.OpenPopupStack.Size > 0) { // Close open popup/menu if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal)) ClosePopupToLevel(g.OpenPopupStack.Size - 1); } else if (g.NavLayer != 0) { // Leave the "menu" layer NavRestoreLayer(0); } else { // Clear NavLastId for popups but keep it for regular child window so we can leave one and come back where we were if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup) || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow))) g.NavWindow->NavLastIds[0] = 0; g.NavId = 0; } } // Process manual activation request g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavInputId = 0; if (g.NavId != 0 && !g.NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) { bool activate_down = IsNavInputDown(ImGuiNavInput_Activate); bool activate_pressed = activate_down && IsNavInputPressed(ImGuiNavInput_Activate, ImGuiInputReadMode_Pressed); if (g.ActiveId == 0 && activate_pressed) g.NavActivateId = g.NavId; if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_down) g.NavActivateDownId = g.NavId; if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && activate_pressed) g.NavActivatePressedId = g.NavId; if ((g.ActiveId == 0 || g.ActiveId == g.NavId) && IsNavInputPressed(ImGuiNavInput_Input, ImGuiInputReadMode_Pressed)) g.NavInputId = g.NavId; } if (g.NavWindow && (g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) g.NavDisableHighlight = true; if (g.NavActivateId != 0) IM_ASSERT(g.NavActivateDownId == g.NavActivateId); g.NavMoveRequest = false; // Process programmatic activation request if (g.NavNextActivateId != 0) g.NavActivateId = g.NavActivateDownId = g.NavActivatePressedId = g.NavInputId = g.NavNextActivateId; g.NavNextActivateId = 0; // Initiate directional inputs request const int allowed_dir_flags = (g.ActiveId == 0) ? ~0 : g.ActiveIdAllowNavDirFlags; if (g.NavMoveRequestForward == ImGuiNavForward_None) { g.NavMoveDir = ImGuiDir_None; if (g.NavWindow && !g.NavWindowingTarget && allowed_dir_flags && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs)) { if ((allowed_dir_flags & (1<Flags & ImGuiWindowFlags_NoNavInputs) && !g.NavWindowingTarget) { // *Fallback* manual-scroll with NavUp/NavDown when window has no navigable item ImGuiWindow* window = g.NavWindow; const float scroll_speed = ImFloor(window->CalcFontSize() * 100 * g.IO.DeltaTime + 0.5f); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported. if (window->DC.NavLayerActiveMask == 0x00 && window->DC.NavHasScroll && g.NavMoveRequest) { if (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right) SetWindowScrollX(window, ImFloor(window->Scroll.x + ((g.NavMoveDir == ImGuiDir_Left) ? -1.0f : +1.0f) * scroll_speed)); if (g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) SetWindowScrollY(window, ImFloor(window->Scroll.y + ((g.NavMoveDir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed)); } // *Normal* Manual scroll with NavScrollXXX keys // Next movement request will clamp the NavId reference rectangle to the visible area, so navigation will resume within those bounds. ImVec2 scroll_dir = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down, 1.0f/10.0f, 10.0f); if (scroll_dir.x != 0.0f && window->ScrollbarX) { SetWindowScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed)); g.NavMoveFromClampedRefRect = true; } if (scroll_dir.y != 0.0f) { SetWindowScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed)); g.NavMoveFromClampedRefRect = true; } } // Reset search results g.NavMoveResultLocal.Clear(); g.NavMoveResultOther.Clear(); // When we have manually scrolled (without using navigation) and NavId becomes out of bounds, we project its bounding box to the visible area to restart navigation within visible items if (g.NavMoveRequest && g.NavMoveFromClampedRefRect && g.NavLayer == 0) { ImGuiWindow* window = g.NavWindow; ImRect window_rect_rel(window->InnerRect.Min - window->Pos - ImVec2(1,1), window->InnerRect.Max - window->Pos + ImVec2(1,1)); if (!window_rect_rel.Contains(window->NavRectRel[g.NavLayer])) { float pad = window->CalcFontSize() * 0.5f; window_rect_rel.Expand(ImVec2(-ImMin(window_rect_rel.GetWidth(), pad), -ImMin(window_rect_rel.GetHeight(), pad))); // Terrible approximation for the intent of starting navigation from first fully visible item window->NavRectRel[g.NavLayer].ClipWith(window_rect_rel); g.NavId = 0; } g.NavMoveFromClampedRefRect = false; } // For scoring we use a single segment on the left side our current item bounding box (not touching the edge to avoid box overlap with zero-spaced items) ImRect nav_rect_rel = (g.NavWindow && !g.NavWindow->NavRectRel[g.NavLayer].IsInverted()) ? g.NavWindow->NavRectRel[g.NavLayer] : ImRect(0,0,0,0); g.NavScoringRectScreen = g.NavWindow ? ImRect(g.NavWindow->Pos + nav_rect_rel.Min, g.NavWindow->Pos + nav_rect_rel.Max) : GetViewportRect(); g.NavScoringRectScreen.Min.x = ImMin(g.NavScoringRectScreen.Min.x + 1.0f, g.NavScoringRectScreen.Max.x); g.NavScoringRectScreen.Max.x = g.NavScoringRectScreen.Min.x; IM_ASSERT(!g.NavScoringRectScreen.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous fabsf() calls in NavScoreItem(). //g.OverlayDrawList.AddRect(g.NavScoringRectScreen.Min, g.NavScoringRectScreen.Max, IM_COL32(255,200,0,255)); // [DEBUG] g.NavScoringCount = 0; #if IMGUI_DEBUG_NAV_RECTS if (g.NavWindow) { for (int layer = 0; layer < 2; layer++) g.OverlayDrawList.AddRect(g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Min, g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Max, IM_COL32(255,200,0,255)); } // [DEBUG] if (g.NavWindow) { ImU32 col = (g.NavWindow->HiddenFrames == 0) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredMousePos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); g.OverlayDrawList.AddCircleFilled(p, 3.0f, col); g.OverlayDrawList.AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); } #endif } static void ImGui::NewFrameUpdateMovingWindow() { ImGuiContext& g = *GImGui; if (g.MovingWindow && g.MovingWindow->MoveId == g.ActiveId && g.ActiveIdSource == ImGuiInputSource_Mouse) { // We actually want to move the root window. g.MovingWindow == window we clicked on (could be a child window). // We track it to preserve Focus and so that ActiveIdWindow == MovingWindow and ActiveId == MovingWindow->MoveId for consistency. KeepAliveID(g.ActiveId); IM_ASSERT(g.MovingWindow && g.MovingWindow->RootWindow); ImGuiWindow* moving_window = g.MovingWindow->RootWindow; if (g.IO.MouseDown[0]) { ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset; if (moving_window->PosFloat.x != pos.x || moving_window->PosFloat.y != pos.y) { MarkIniSettingsDirty(moving_window); moving_window->PosFloat = pos; } FocusWindow(g.MovingWindow); } else { ClearActiveID(); g.MovingWindow = NULL; } } else { // When clicking/dragging from a window that has the _NoMove flag, we still set the ActiveId in order to prevent hovering others. if (g.ActiveIdWindow && g.ActiveIdWindow->MoveId == g.ActiveId) { KeepAliveID(g.ActiveId); if (!g.IO.MouseDown[0]) ClearActiveID(); } g.MovingWindow = NULL; } } static void ImGui::NewFrameUpdateMouseInputs() { ImGuiContext& g = *GImGui; // If mouse just appeared or disappeared (usually denoted by -FLT_MAX component, but in reality we test for -256000.0f) we cancel out movement in MouseDelta if (ImGui::IsMousePosValid(&g.IO.MousePos) && ImGui::IsMousePosValid(&g.IO.MousePosPrev)) g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev; else g.IO.MouseDelta = ImVec2(0.0f, 0.0f); if (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f) g.NavDisableMouseHover = false; g.IO.MousePosPrev = g.IO.MousePos; for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++) { g.IO.MouseClicked[i] = g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] < 0.0f; g.IO.MouseReleased[i] = !g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] >= 0.0f; g.IO.MouseDownDurationPrev[i] = g.IO.MouseDownDuration[i]; g.IO.MouseDownDuration[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f; g.IO.MouseDoubleClicked[i] = false; if (g.IO.MouseClicked[i]) { if (g.Time - g.IO.MouseClickedTime[i] < g.IO.MouseDoubleClickTime) { if (ImLengthSqr(g.IO.MousePos - g.IO.MouseClickedPos[i]) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist) g.IO.MouseDoubleClicked[i] = true; g.IO.MouseClickedTime[i] = -FLT_MAX; // so the third click isn't turned into a double-click } else { g.IO.MouseClickedTime[i] = g.Time; } g.IO.MouseClickedPos[i] = g.IO.MousePos; g.IO.MouseDragMaxDistanceAbs[i] = ImVec2(0.0f, 0.0f); g.IO.MouseDragMaxDistanceSqr[i] = 0.0f; } else if (g.IO.MouseDown[i]) { ImVec2 mouse_delta = g.IO.MousePos - g.IO.MouseClickedPos[i]; g.IO.MouseDragMaxDistanceAbs[i].x = ImMax(g.IO.MouseDragMaxDistanceAbs[i].x, mouse_delta.x < 0.0f ? -mouse_delta.x : mouse_delta.x); g.IO.MouseDragMaxDistanceAbs[i].y = ImMax(g.IO.MouseDragMaxDistanceAbs[i].y, mouse_delta.y < 0.0f ? -mouse_delta.y : mouse_delta.y); g.IO.MouseDragMaxDistanceSqr[i] = ImMax(g.IO.MouseDragMaxDistanceSqr[i], ImLengthSqr(mouse_delta)); } if (g.IO.MouseClicked[i]) // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation g.NavDisableMouseHover = false; } } // The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app) void ImGui::NewFrameUpdateHoveredWindowAndCaptureFlags() { ImGuiContext& g = *GImGui; // Find the window hovered by mouse: // - Child windows can extend beyond the limit of their parent so we need to derive HoveredRootWindow from HoveredWindow. // - When moving a window we can skip the search, which also conveniently bypasses the fact that window->WindowRectClipped is lagging as this point of the frame. // - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms. g.HoveredWindow = (g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoInputs)) ? g.MovingWindow : FindHoveredWindow(); g.HoveredRootWindow = g.HoveredWindow ? g.HoveredWindow->RootWindow : NULL; // Modal windows prevents cursor from hovering behind them. ImGuiWindow* modal_window = GetFrontMostPopupModal(); if (modal_window) if (g.HoveredRootWindow && !IsWindowChildOf(g.HoveredRootWindow, modal_window)) g.HoveredRootWindow = g.HoveredWindow = NULL; // Disabled mouse? if (g.IO.ConfigFlags & ImGuiConfigFlags_NoMouse) g.HoveredWindow = g.HoveredRootWindow = NULL; // We track click ownership. When clicked outside of a window the click is owned by the application and won't report hovering nor request capture even while dragging over our windows afterward. int mouse_earliest_button_down = -1; bool mouse_any_down = false; for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++) { if (g.IO.MouseClicked[i]) g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL) || (!g.OpenPopupStack.empty()); mouse_any_down |= g.IO.MouseDown[i]; if (g.IO.MouseDown[i]) if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[i] < g.IO.MouseClickedTime[mouse_earliest_button_down]) mouse_earliest_button_down = i; } const bool mouse_avail_to_imgui = (mouse_earliest_button_down == -1) || g.IO.MouseDownOwned[mouse_earliest_button_down]; // If mouse was first clicked outside of ImGui bounds we also cancel out hovering. // FIXME: For patterns of drag and drop across OS windows, we may need to rework/remove this test (first committed 311c0ca9 on 2015/02) const bool mouse_dragging_extern_payload = g.DragDropActive && (g.DragDropSourceFlags & ImGuiDragDropFlags_SourceExtern) != 0; if (!mouse_avail_to_imgui && !mouse_dragging_extern_payload) g.HoveredWindow = g.HoveredRootWindow = NULL; // Update io.WantCaptureMouse for the user application (true = dispatch mouse info to imgui, false = dispatch mouse info to imgui + app) if (g.WantCaptureMouseNextFrame != -1) g.IO.WantCaptureMouse = (g.WantCaptureMouseNextFrame != 0); else g.IO.WantCaptureMouse = (mouse_avail_to_imgui && (g.HoveredWindow != NULL || mouse_any_down)) || (!g.OpenPopupStack.empty()); // Update io.WantCaptureKeyboard for the user application (true = dispatch keyboard info to imgui, false = dispatch keyboard info to imgui + app) if (g.WantCaptureKeyboardNextFrame != -1) g.IO.WantCaptureKeyboard = (g.WantCaptureKeyboardNextFrame != 0); else g.IO.WantCaptureKeyboard = (g.ActiveId != 0) || (modal_window != NULL); if (g.IO.NavActive && (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard)) g.IO.WantCaptureKeyboard = true; // Update io.WantTextInput flag, this is to allow systems without a keyboard (e.g. mobile, hand-held) to show a software keyboard if possible g.IO.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : 0; } void ImGui::NewFrame() { IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?"); ImGuiContext& g = *GImGui; // Check user data // (We pass an error message in the assert expression as a trick to get it visible to programmers who are not using a debugger, as most assert handlers display their argument) IM_ASSERT(g.Initialized); IM_ASSERT(g.IO.DeltaTime >= 0.0f && "Need a positive DeltaTime (zero is tolerated but will cause some timing issues)"); IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f && "Invalid DisplaySize value"); IM_ASSERT(g.IO.Fonts->Fonts.Size > 0 && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?"); IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded() && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?"); IM_ASSERT(g.Style.CurveTessellationTol > 0.0f && "Invalid style setting"); IM_ASSERT(g.Style.Alpha >= 0.0f && g.Style.Alpha <= 1.0f && "Invalid style setting. Alpha cannot be negative (allows us to avoid a few clamps in color computations)"); IM_ASSERT((g.FrameCount == 0 || g.FrameCountEnded == g.FrameCount) && "Forgot to call Render() or EndFrame() at the end of the previous frame?"); for (int n = 0; n < ImGuiKey_COUNT; n++) IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)"); // Do a simple check for required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was super recently added in 1.60 WIP) if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation."); // Load settings on first frame if (!g.SettingsLoaded) { IM_ASSERT(g.SettingsWindows.empty()); LoadIniSettingsFromDisk(g.IO.IniFilename); g.SettingsLoaded = true; } // Save settings (with a delay so we don't spam disk too much) if (g.SettingsDirtyTimer > 0.0f) { g.SettingsDirtyTimer -= g.IO.DeltaTime; if (g.SettingsDirtyTimer <= 0.0f) SaveIniSettingsToDisk(g.IO.IniFilename); } g.Time += g.IO.DeltaTime; g.FrameCount += 1; g.TooltipOverrideCount = 0; g.WindowsActiveCount = 0; SetCurrentFont(GetDefaultFont()); IM_ASSERT(g.Font->IsLoaded()); g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y); g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol; g.OverlayDrawList.Clear(); g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID); g.OverlayDrawList.PushClipRectFullScreen(); g.OverlayDrawList.Flags = (g.Style.AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0) | (g.Style.AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0); // Mark rendering data as invalid to prevent user who may have a handle on it to use it g.DrawData.Clear(); // Clear reference to active widget if the widget isn't alive anymore if (!g.HoveredIdPreviousFrame) g.HoveredIdTimer = 0.0f; g.HoveredIdPreviousFrame = g.HoveredId; g.HoveredId = 0; g.HoveredIdAllowOverlap = false; if (!g.ActiveIdIsAlive && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0) ClearActiveID(); if (g.ActiveId) g.ActiveIdTimer += g.IO.DeltaTime; g.ActiveIdPreviousFrame = g.ActiveId; g.ActiveIdIsAlive = false; g.ActiveIdIsJustActivated = false; if (g.ScalarAsInputTextId && g.ActiveId != g.ScalarAsInputTextId) g.ScalarAsInputTextId = 0; // Elapse drag & drop payload if (g.DragDropActive && g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) { ClearDragDrop(); g.DragDropPayloadBufHeap.clear(); memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal)); } g.DragDropAcceptIdPrev = g.DragDropAcceptIdCurr; g.DragDropAcceptIdCurr = 0; g.DragDropAcceptIdCurrRectSurface = FLT_MAX; // Update keyboard input state memcpy(g.IO.KeysDownDurationPrev, g.IO.KeysDownDuration, sizeof(g.IO.KeysDownDuration)); for (int i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++) g.IO.KeysDownDuration[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f; // Update gamepad/keyboard directional navigation NavUpdate(); // Update mouse input state NewFrameUpdateMouseInputs(); // Calculate frame-rate for the user, as a purely luxurious feature g.FramerateSecPerFrameAccum += g.IO.DeltaTime - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx]; g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx] = g.IO.DeltaTime; g.FramerateSecPerFrameIdx = (g.FramerateSecPerFrameIdx + 1) % IM_ARRAYSIZE(g.FramerateSecPerFrame); g.IO.Framerate = (g.FramerateSecPerFrameAccum > 0.0f) ? (1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame))) : FLT_MAX; // Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering) NewFrameUpdateMovingWindow(); NewFrameUpdateHoveredWindowAndCaptureFlags(); if (GetFrontMostPopupModal() != NULL) g.ModalWindowDarkeningRatio = ImMin(g.ModalWindowDarkeningRatio + g.IO.DeltaTime * 6.0f, 1.0f); else g.ModalWindowDarkeningRatio = 0.0f; g.MouseCursor = ImGuiMouseCursor_Arrow; g.WantCaptureMouseNextFrame = g.WantCaptureKeyboardNextFrame = g.WantTextInputNextFrame = -1; g.OsImePosRequest = ImVec2(1.0f, 1.0f); // OS Input Method Editor showing on top-left of our window by default // Mouse wheel scrolling, scale if (g.HoveredWindow && !g.HoveredWindow->Collapsed && (g.IO.MouseWheel != 0.0f || g.IO.MouseWheelH != 0.0f)) { // If a child window has the ImGuiWindowFlags_NoScrollWithMouse flag, we give a chance to scroll its parent (unless either ImGuiWindowFlags_NoInputs or ImGuiWindowFlags_NoScrollbar are also set). ImGuiWindow* window = g.HoveredWindow; ImGuiWindow* scroll_window = window; while ((scroll_window->Flags & ImGuiWindowFlags_ChildWindow) && (scroll_window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(scroll_window->Flags & ImGuiWindowFlags_NoScrollbar) && !(scroll_window->Flags & ImGuiWindowFlags_NoInputs) && scroll_window->ParentWindow) scroll_window = scroll_window->ParentWindow; const bool scroll_allowed = !(scroll_window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(scroll_window->Flags & ImGuiWindowFlags_NoInputs); if (g.IO.MouseWheel != 0.0f) { if (g.IO.KeyCtrl && g.IO.FontAllowUserScaling) { // Zoom / Scale window const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f); const float scale = new_font_scale / window->FontWindowScale; window->FontWindowScale = new_font_scale; const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size; window->Pos += offset; window->PosFloat += offset; window->Size *= scale; window->SizeFull *= scale; } else if (!g.IO.KeyCtrl && scroll_allowed) { // Mouse wheel vertical scrolling float scroll_amount = 5 * scroll_window->CalcFontSize(); scroll_amount = (float)(int)ImMin(scroll_amount, (scroll_window->ContentsRegionRect.GetHeight() + scroll_window->WindowPadding.y * 2.0f) * 0.67f); SetWindowScrollY(scroll_window, scroll_window->Scroll.y - g.IO.MouseWheel * scroll_amount); } } if (g.IO.MouseWheelH != 0.0f && scroll_allowed) { // Mouse wheel horizontal scrolling (for hardware that supports it) float scroll_amount = scroll_window->CalcFontSize(); if (!g.IO.KeyCtrl && !(window->Flags & ImGuiWindowFlags_NoScrollWithMouse)) SetWindowScrollX(window, window->Scroll.x - g.IO.MouseWheelH * scroll_amount); } } // Pressing TAB activate widget focus if (g.ActiveId == 0 && g.NavWindow != NULL && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab, false)) { if (g.NavId != 0 && g.NavIdTabCounter != INT_MAX) g.NavWindow->FocusIdxTabRequestNext = g.NavIdTabCounter + 1 + (g.IO.KeyShift ? -1 : 1); else g.NavWindow->FocusIdxTabRequestNext = g.IO.KeyShift ? -1 : 0; } g.NavIdTabCounter = INT_MAX; // Mark all windows as not visible for (int i = 0; i != g.Windows.Size; i++) { ImGuiWindow* window = g.Windows[i]; window->WasActive = window->Active; window->Active = false; window->WriteAccessed = false; } // Closing the focused window restore focus to the first active root window in descending z-order if (g.NavWindow && !g.NavWindow->WasActive) FocusFrontMostActiveWindow(NULL); // No window should be open at the beginning of the frame. // But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear. g.CurrentWindowStack.resize(0); g.CurrentPopupStack.resize(0); ClosePopupsOverWindow(g.NavWindow); // Create implicit window - we will only render it if the user has added something to it. // We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags. SetNextWindowSize(ImVec2(400,400), ImGuiCond_FirstUseEver); Begin("Debug##Default"); } static void* SettingsHandlerWindow_ReadOpen(ImGuiContext*, ImGuiSettingsHandler*, const char* name) { ImGuiWindowSettings* settings = ImGui::FindWindowSettings(ImHash(name, 0)); if (!settings) settings = AddWindowSettings(name); return (void*)settings; } static void SettingsHandlerWindow_ReadLine(ImGuiContext*, ImGuiSettingsHandler*, void* entry, const char* line) { ImGuiWindowSettings* settings = (ImGuiWindowSettings*)entry; float x, y; int i; if (sscanf(line, "Pos=%f,%f", &x, &y) == 2) settings->Pos = ImVec2(x, y); else if (sscanf(line, "Size=%f,%f", &x, &y) == 2) settings->Size = ImMax(ImVec2(x, y), GImGui->Style.WindowMinSize); else if (sscanf(line, "Collapsed=%d", &i) == 1) settings->Collapsed = (i != 0); } static void SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf) { // Gather data from windows that were active during this session ImGuiContext& g = *imgui_ctx; for (int i = 0; i != g.Windows.Size; i++) { ImGuiWindow* window = g.Windows[i]; if (window->Flags & ImGuiWindowFlags_NoSavedSettings) continue; ImGuiWindowSettings* settings = ImGui::FindWindowSettings(window->ID); if (!settings) settings = AddWindowSettings(window->Name); settings->Pos = window->Pos; settings->Size = window->SizeFull; settings->Collapsed = window->Collapsed; } // Write a buffer // If a window wasn't opened in this session we preserve its settings buf->reserve(buf->size() + g.SettingsWindows.Size * 96); // ballpark reserve for (int i = 0; i != g.SettingsWindows.Size; i++) { const ImGuiWindowSettings* settings = &g.SettingsWindows[i]; if (settings->Pos.x == FLT_MAX) continue; const char* name = settings->Name; if (const char* p = strstr(name, "###")) // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID() name = p; buf->appendf("[%s][%s]\n", handler->TypeName, name); buf->appendf("Pos=%d,%d\n", (int)settings->Pos.x, (int)settings->Pos.y); buf->appendf("Size=%d,%d\n", (int)settings->Size.x, (int)settings->Size.y); buf->appendf("Collapsed=%d\n", settings->Collapsed); buf->appendf("\n"); } } void ImGui::Initialize(ImGuiContext* context) { ImGuiContext& g = *context; IM_ASSERT(!g.Initialized && !g.SettingsLoaded); g.LogClipboard = IM_NEW(ImGuiTextBuffer)(); // Add .ini handle for ImGuiWindow type ImGuiSettingsHandler ini_handler; ini_handler.TypeName = "Window"; ini_handler.TypeHash = ImHash("Window", 0, 0); ini_handler.ReadOpenFn = SettingsHandlerWindow_ReadOpen; ini_handler.ReadLineFn = SettingsHandlerWindow_ReadLine; ini_handler.WriteAllFn = SettingsHandlerWindow_WriteAll; g.SettingsHandlers.push_front(ini_handler); g.Initialized = true; } // This function is merely here to free heap allocations. void ImGui::Shutdown(ImGuiContext* context) { ImGuiContext& g = *context; // The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame) if (g.IO.Fonts && g.FontAtlasOwnedByContext) IM_DELETE(g.IO.Fonts); g.IO.Fonts = NULL; // Cleanup of other data are conditional on actually having initialize ImGui. if (!g.Initialized) return; // Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file) if (g.SettingsLoaded) SaveIniSettingsToDisk(g.IO.IniFilename); // Clear everything else for (int i = 0; i < g.Windows.Size; i++) IM_DELETE(g.Windows[i]); g.Windows.clear(); g.WindowsSortBuffer.clear(); g.CurrentWindow = NULL; g.CurrentWindowStack.clear(); g.WindowsById.Clear(); g.NavWindow = NULL; g.HoveredWindow = NULL; g.HoveredRootWindow = NULL; g.ActiveIdWindow = NULL; g.MovingWindow = NULL; g.ColorModifiers.clear(); g.StyleModifiers.clear(); g.FontStack.clear(); g.OpenPopupStack.clear(); g.CurrentPopupStack.clear(); g.DrawDataBuilder.ClearFreeMemory(); g.OverlayDrawList.ClearFreeMemory(); g.PrivateClipboard.clear(); g.InputTextState.Text.clear(); g.InputTextState.InitialText.clear(); g.InputTextState.TempTextBuffer.clear(); for (int i = 0; i < g.SettingsWindows.Size; i++) IM_DELETE(g.SettingsWindows[i].Name); g.SettingsWindows.clear(); g.SettingsHandlers.clear(); if (g.LogFile && g.LogFile != stdout) { fclose(g.LogFile); g.LogFile = NULL; } if (g.LogClipboard) IM_DELETE(g.LogClipboard); g.LogClipboard = NULL; g.Initialized = false; } ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id) { ImGuiContext& g = *GImGui; for (int i = 0; i != g.SettingsWindows.Size; i++) if (g.SettingsWindows[i].Id == id) return &g.SettingsWindows[i]; return NULL; } static ImGuiWindowSettings* AddWindowSettings(const char* name) { ImGuiContext& g = *GImGui; g.SettingsWindows.push_back(ImGuiWindowSettings()); ImGuiWindowSettings* settings = &g.SettingsWindows.back(); settings->Name = ImStrdup(name); settings->Id = ImHash(name, 0); return settings; } static void LoadIniSettingsFromDisk(const char* ini_filename) { if (!ini_filename) return; char* file_data = (char*)ImFileLoadToMemory(ini_filename, "rb", NULL, +1); if (!file_data) return; LoadIniSettingsFromMemory(file_data); ImGui::MemFree(file_data); } ImGuiSettingsHandler* ImGui::FindSettingsHandler(const char* type_name) { ImGuiContext& g = *GImGui; const ImGuiID type_hash = ImHash(type_name, 0, 0); for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++) if (g.SettingsHandlers[handler_n].TypeHash == type_hash) return &g.SettingsHandlers[handler_n]; return NULL; } // Zero-tolerance, no error reporting, cheap .ini parsing static void LoadIniSettingsFromMemory(const char* buf_readonly) { // For convenience and to make the code simpler, we'll write zero terminators inside the buffer. So let's create a writable copy. char* buf = ImStrdup(buf_readonly); char* buf_end = buf + strlen(buf); ImGuiContext& g = *GImGui; void* entry_data = NULL; ImGuiSettingsHandler* entry_handler = NULL; char* line_end = NULL; for (char* line = buf; line < buf_end; line = line_end + 1) { // Skip new lines markers, then find end of the line while (*line == '\n' || *line == '\r') line++; line_end = line; while (line_end < buf_end && *line_end != '\n' && *line_end != '\r') line_end++; line_end[0] = 0; if (line[0] == '[' && line_end > line && line_end[-1] == ']') { // Parse "[Type][Name]". Note that 'Name' can itself contains [] characters, which is acceptable with the current format and parsing code. line_end[-1] = 0; const char* name_end = line_end - 1; const char* type_start = line + 1; char* type_end = (char*)(intptr_t)ImStrchrRange(type_start, name_end, ']'); const char* name_start = type_end ? ImStrchrRange(type_end + 1, name_end, '[') : NULL; if (!type_end || !name_start) { name_start = type_start; // Import legacy entries that have no type type_start = "Window"; } else { *type_end = 0; // Overwrite first ']' name_start++; // Skip second '[' } entry_handler = ImGui::FindSettingsHandler(type_start); entry_data = entry_handler ? entry_handler->ReadOpenFn(&g, entry_handler, name_start) : NULL; } else if (entry_handler != NULL && entry_data != NULL) { // Let type handler parse the line entry_handler->ReadLineFn(&g, entry_handler, entry_data, line); } } ImGui::MemFree(buf); g.SettingsLoaded = true; } static void SaveIniSettingsToDisk(const char* ini_filename) { ImGuiContext& g = *GImGui; g.SettingsDirtyTimer = 0.0f; if (!ini_filename) return; ImVector buf; SaveIniSettingsToMemory(buf); FILE* f = ImFileOpen(ini_filename, "wt"); if (!f) return; fwrite(buf.Data, sizeof(char), (size_t)buf.Size, f); fclose(f); } static void SaveIniSettingsToMemory(ImVector& out_buf) { ImGuiContext& g = *GImGui; g.SettingsDirtyTimer = 0.0f; ImGuiTextBuffer buf; for (int handler_n = 0; handler_n < g.SettingsHandlers.Size; handler_n++) { ImGuiSettingsHandler* handler = &g.SettingsHandlers[handler_n]; handler->WriteAllFn(&g, handler, &buf); } buf.Buf.pop_back(); // Remove extra zero-terminator used by ImGuiTextBuffer out_buf.swap(buf.Buf); } void ImGui::MarkIniSettingsDirty() { ImGuiContext& g = *GImGui; if (g.SettingsDirtyTimer <= 0.0f) g.SettingsDirtyTimer = g.IO.IniSavingRate; } static void MarkIniSettingsDirty(ImGuiWindow* window) { ImGuiContext& g = *GImGui; if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings)) if (g.SettingsDirtyTimer <= 0.0f) g.SettingsDirtyTimer = g.IO.IniSavingRate; } // FIXME: Add a more explicit sort order in the window structure. static int IMGUI_CDECL ChildWindowComparer(const void* lhs, const void* rhs) { const ImGuiWindow* const a = *(const ImGuiWindow* const *)lhs; const ImGuiWindow* const b = *(const ImGuiWindow* const *)rhs; if (int d = (a->Flags & ImGuiWindowFlags_Popup) - (b->Flags & ImGuiWindowFlags_Popup)) return d; if (int d = (a->Flags & ImGuiWindowFlags_Tooltip) - (b->Flags & ImGuiWindowFlags_Tooltip)) return d; return (a->BeginOrderWithinParent - b->BeginOrderWithinParent); } static void AddWindowToSortedBuffer(ImVector* out_sorted_windows, ImGuiWindow* window) { out_sorted_windows->push_back(window); if (window->Active) { int count = window->DC.ChildWindows.Size; if (count > 1) qsort(window->DC.ChildWindows.begin(), (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer); for (int i = 0; i < count; i++) { ImGuiWindow* child = window->DC.ChildWindows[i]; if (child->Active) AddWindowToSortedBuffer(out_sorted_windows, child); } } } static void AddDrawListToDrawData(ImVector* out_render_list, ImDrawList* draw_list) { if (draw_list->CmdBuffer.empty()) return; // Remove trailing command if unused ImDrawCmd& last_cmd = draw_list->CmdBuffer.back(); if (last_cmd.ElemCount == 0 && last_cmd.UserCallback == NULL) { draw_list->CmdBuffer.pop_back(); if (draw_list->CmdBuffer.empty()) return; } // Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc. May trigger for you if you are using PrimXXX functions incorrectly. IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size); IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size); IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); // Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window) // If this assert triggers because you are drawing lots of stuff manually: // A) Make sure you are coarse clipping, because ImDrawList let all your vertices pass. You can use the Metrics window to inspect draw list contents. // B) If you need/want meshes with more than 64K vertices, uncomment the '#define ImDrawIdx unsigned int' line in imconfig.h to set the index size to 4 bytes. // You'll need to handle the 4-bytes indices to your renderer. For example, the OpenGL example code detect index size at compile-time by doing: // glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset); // Your own engine or render API may use different parameters or function calls to specify index sizes. 2 and 4 bytes indices are generally supported by most API. // C) If for some reason you cannot use 4 bytes indices or don't want to, a workaround is to call BeginChild()/EndChild() before reaching the 64K limit to split your draw commands in multiple draw lists. if (sizeof(ImDrawIdx) == 2) IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above"); out_render_list->push_back(draw_list); } static void AddWindowToDrawData(ImVector* out_render_list, ImGuiWindow* window) { AddDrawListToDrawData(out_render_list, window->DrawList); for (int i = 0; i < window->DC.ChildWindows.Size; i++) { ImGuiWindow* child = window->DC.ChildWindows[i]; if (child->Active && child->HiddenFrames == 0) // clipped children may have been marked not active AddWindowToDrawData(out_render_list, child); } } static void AddWindowToDrawDataSelectLayer(ImGuiWindow* window) { ImGuiContext& g = *GImGui; g.IO.MetricsActiveWindows++; if (window->Flags & ImGuiWindowFlags_Tooltip) AddWindowToDrawData(&g.DrawDataBuilder.Layers[1], window); else AddWindowToDrawData(&g.DrawDataBuilder.Layers[0], window); } void ImDrawDataBuilder::FlattenIntoSingleLayer() { int n = Layers[0].Size; int size = n; for (int i = 1; i < IM_ARRAYSIZE(Layers); i++) size += Layers[i].Size; Layers[0].resize(size); for (int layer_n = 1; layer_n < IM_ARRAYSIZE(Layers); layer_n++) { ImVector& layer = Layers[layer_n]; if (layer.empty()) continue; memcpy(&Layers[0][n], &layer[0], layer.Size * sizeof(ImDrawList*)); n += layer.Size; layer.resize(0); } } static void SetupDrawData(ImVector* draw_lists, ImDrawData* out_draw_data) { out_draw_data->Valid = true; out_draw_data->CmdLists = (draw_lists->Size > 0) ? draw_lists->Data : NULL; out_draw_data->CmdListsCount = draw_lists->Size; out_draw_data->TotalVtxCount = out_draw_data->TotalIdxCount = 0; for (int n = 0; n < draw_lists->Size; n++) { out_draw_data->TotalVtxCount += draw_lists->Data[n]->VtxBuffer.Size; out_draw_data->TotalIdxCount += draw_lists->Data[n]->IdxBuffer.Size; } } // When using this function it is sane to ensure that float are perfectly rounded to integer values, to that e.g. (int)(max.x-min.x) in user's render produce correct result. void ImGui::PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect) { ImGuiWindow* window = GetCurrentWindow(); window->DrawList->PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect); window->ClipRect = window->DrawList->_ClipRectStack.back(); } void ImGui::PopClipRect() { ImGuiWindow* window = GetCurrentWindow(); window->DrawList->PopClipRect(); window->ClipRect = window->DrawList->_ClipRectStack.back(); } // This is normally called by Render(). You may want to call it directly if you want to avoid calling Render() but the gain will be very minimal. void ImGui::EndFrame() { ImGuiContext& g = *GImGui; IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame() if (g.FrameCountEnded == g.FrameCount) // Don't process EndFrame() multiple times. return; // Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME) if (g.IO.ImeSetInputScreenPosFn && ImLengthSqr(g.OsImePosRequest - g.OsImePosSet) > 0.0001f) { g.IO.ImeSetInputScreenPosFn((int)g.OsImePosRequest.x, (int)g.OsImePosRequest.y); g.OsImePosSet = g.OsImePosRequest; } // Hide implicit "Debug" window if it hasn't been used IM_ASSERT(g.CurrentWindowStack.Size == 1); // Mismatched Begin()/End() calls if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed) g.CurrentWindow->Active = false; End(); if (g.ActiveId == 0 && g.HoveredId == 0) { if (!g.NavWindow || !g.NavWindow->Appearing) // Unless we just made a window/popup appear { // Click to focus window and start moving (after we're done with all our widgets) if (g.IO.MouseClicked[0]) { if (g.HoveredRootWindow != NULL) { // Set ActiveId even if the _NoMove flag is set, without it dragging away from a window with _NoMove would activate hover on other windows. FocusWindow(g.HoveredWindow); SetActiveID(g.HoveredWindow->MoveId, g.HoveredWindow); g.NavDisableHighlight = true; g.ActiveIdClickOffset = g.IO.MousePos - g.HoveredRootWindow->Pos; if (!(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove) && !(g.HoveredRootWindow->Flags & ImGuiWindowFlags_NoMove)) g.MovingWindow = g.HoveredWindow; } else if (g.NavWindow != NULL && GetFrontMostPopupModal() == NULL) { // Clicking on void disable focus FocusWindow(NULL); } } // With right mouse button we close popups without changing focus // (The left mouse button path calls FocusWindow which will lead NewFrame->ClosePopupsOverWindow to trigger) if (g.IO.MouseClicked[1]) { // Find the top-most window between HoveredWindow and the front most Modal Window. // This is where we can trim the popup stack. ImGuiWindow* modal = GetFrontMostPopupModal(); bool hovered_window_above_modal = false; if (modal == NULL) hovered_window_above_modal = true; for (int i = g.Windows.Size - 1; i >= 0 && hovered_window_above_modal == false; i--) { ImGuiWindow* window = g.Windows[i]; if (window == modal) break; if (window == g.HoveredWindow) hovered_window_above_modal = true; } ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal); } } } // Sort the window list so that all child windows are after their parent // We cannot do that on FocusWindow() because childs may not exist yet g.WindowsSortBuffer.resize(0); g.WindowsSortBuffer.reserve(g.Windows.Size); for (int i = 0; i != g.Windows.Size; i++) { ImGuiWindow* window = g.Windows[i]; if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow)) // if a child is active its parent will add it continue; AddWindowToSortedBuffer(&g.WindowsSortBuffer, window); } IM_ASSERT(g.Windows.Size == g.WindowsSortBuffer.Size); // we done something wrong g.Windows.swap(g.WindowsSortBuffer); // Clear Input data for next frame g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f; memset(g.IO.InputCharacters, 0, sizeof(g.IO.InputCharacters)); memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs)); g.FrameCountEnded = g.FrameCount; } void ImGui::Render() { ImGuiContext& g = *GImGui; IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame() if (g.FrameCountEnded != g.FrameCount) ImGui::EndFrame(); g.FrameCountRendered = g.FrameCount; // Gather windows to render g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsActiveWindows = 0; g.DrawDataBuilder.Clear(); ImGuiWindow* window_to_render_front_most = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget : NULL; for (int n = 0; n != g.Windows.Size; n++) { ImGuiWindow* window = g.Windows[n]; if (window->Active && window->HiddenFrames == 0 && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && window != window_to_render_front_most) AddWindowToDrawDataSelectLayer(window); } if (window_to_render_front_most && window_to_render_front_most->Active && window_to_render_front_most->HiddenFrames == 0) // NavWindowingTarget is always temporarily displayed as the front-most window AddWindowToDrawDataSelectLayer(window_to_render_front_most); g.DrawDataBuilder.FlattenIntoSingleLayer(); // Draw software mouse cursor if requested ImVec2 offset, size, uv[4]; if (g.IO.MouseDrawCursor && g.IO.Fonts->GetMouseCursorTexData(g.MouseCursor, &offset, &size, &uv[0], &uv[2])) { const ImVec2 pos = g.IO.MousePos - offset; const ImTextureID tex_id = g.IO.Fonts->TexID; const float sc = g.Style.MouseCursorScale; g.OverlayDrawList.PushTextureID(tex_id); g.OverlayDrawList.AddImage(tex_id, pos + ImVec2(1,0)*sc, pos+ImVec2(1,0)*sc + size*sc, uv[2], uv[3], IM_COL32(0,0,0,48)); // Shadow g.OverlayDrawList.AddImage(tex_id, pos + ImVec2(2,0)*sc, pos+ImVec2(2,0)*sc + size*sc, uv[2], uv[3], IM_COL32(0,0,0,48)); // Shadow g.OverlayDrawList.AddImage(tex_id, pos, pos + size*sc, uv[2], uv[3], IM_COL32(0,0,0,255)); // Black border g.OverlayDrawList.AddImage(tex_id, pos, pos + size*sc, uv[0], uv[1], IM_COL32(255,255,255,255)); // White fill g.OverlayDrawList.PopTextureID(); } if (!g.OverlayDrawList.VtxBuffer.empty()) AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.OverlayDrawList); // Setup ImDrawData structure for end-user SetupDrawData(&g.DrawDataBuilder.Layers[0], &g.DrawData); g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount; g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount; // Render. If user hasn't set a callback then they may retrieve the draw data via GetDrawData() #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL) g.IO.RenderDrawListsFn(&g.DrawData); #endif } const char* ImGui::FindRenderedTextEnd(const char* text, const char* text_end) { const char* text_display_end = text; if (!text_end) text_end = (const char*)-1; while (text_display_end < text_end && *text_display_end != '\0' && (text_display_end[0] != '#' || text_display_end[1] != '#')) text_display_end++; return text_display_end; } // Pass text data straight to log (without being displayed) void ImGui::LogText(const char* fmt, ...) { ImGuiContext& g = *GImGui; if (!g.LogEnabled) return; va_list args; va_start(args, fmt); if (g.LogFile) { vfprintf(g.LogFile, fmt, args); } else { g.LogClipboard->appendfv(fmt, args); } va_end(args); } // Internal version that takes a position to decide on newline placement and pad items according to their depth. // We split text into individual lines to add current tree level padding static void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (!text_end) text_end = ImGui::FindRenderedTextEnd(text, text_end); const bool log_new_line = ref_pos && (ref_pos->y > window->DC.LogLinePosY + 1); if (ref_pos) window->DC.LogLinePosY = ref_pos->y; const char* text_remaining = text; if (g.LogStartDepth > window->DC.TreeDepth) // Re-adjust padding if we have popped out of our starting depth g.LogStartDepth = window->DC.TreeDepth; const int tree_depth = (window->DC.TreeDepth - g.LogStartDepth); for (;;) { // Split the string. Each new line (after a '\n') is followed by spacing corresponding to the current depth of our log entry. const char* line_end = text_remaining; while (line_end < text_end) if (*line_end == '\n') break; else line_end++; if (line_end >= text_end) line_end = NULL; const bool is_first_line = (text == text_remaining); bool is_last_line = false; if (line_end == NULL) { is_last_line = true; line_end = text_end; } if (line_end != NULL && !(is_last_line && (line_end - text_remaining)==0)) { const int char_count = (int)(line_end - text_remaining); if (log_new_line || !is_first_line) ImGui::LogText(IM_NEWLINE "%*s%.*s", tree_depth*4, "", char_count, text_remaining); else ImGui::LogText(" %.*s", char_count, text_remaining); } if (is_last_line) break; text_remaining = line_end + 1; } } // Internal ImGui functions to render text // RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText() void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; // Hide anything after a '##' string const char* text_display_end; if (hide_text_after_hash) { text_display_end = FindRenderedTextEnd(text, text_end); } else { if (!text_end) text_end = text + strlen(text); // FIXME-OPT text_display_end = text_end; } const int text_len = (int)(text_display_end - text); if (text_len > 0) { window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end); if (g.LogEnabled) LogRenderedText(&pos, text, text_display_end); } } void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (!text_end) text_end = text + strlen(text); // FIXME-OPT const int text_len = (int)(text_end - text); if (text_len > 0) { window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_end, wrap_width); if (g.LogEnabled) LogRenderedText(&pos, text, text_end); } } // Default clip_rect uses (pos_min,pos_max) // Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges) void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect) { // Hide anything after a '##' string const char* text_display_end = FindRenderedTextEnd(text, text_end); const int text_len = (int)(text_display_end - text); if (text_len == 0) return; ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; // Perform CPU side clipping for single clipped element to avoid using scissor state ImVec2 pos = pos_min; const ImVec2 text_size = text_size_if_known ? *text_size_if_known : CalcTextSize(text, text_display_end, false, 0.0f); const ImVec2* clip_min = clip_rect ? &clip_rect->Min : &pos_min; const ImVec2* clip_max = clip_rect ? &clip_rect->Max : &pos_max; bool need_clipping = (pos.x + text_size.x >= clip_max->x) || (pos.y + text_size.y >= clip_max->y); if (clip_rect) // If we had no explicit clipping rectangle then pos==clip_min need_clipping |= (pos.x < clip_min->x) || (pos.y < clip_min->y); // Align whole block. We should defer that to the better rendering function when we'll have support for individual line alignment. if (align.x > 0.0f) pos.x = ImMax(pos.x, pos.x + (pos_max.x - pos.x - text_size.x) * align.x); if (align.y > 0.0f) pos.y = ImMax(pos.y, pos.y + (pos_max.y - pos.y - text_size.y) * align.y); // Render if (need_clipping) { ImVec4 fine_clip_rect(clip_min->x, clip_min->y, clip_max->x, clip_max->y); window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, &fine_clip_rect); } else { window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, NULL); } if (g.LogEnabled) LogRenderedText(&pos, text, text_display_end); } // Render a rectangle shaped with optional rounding and borders void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding); const float border_size = g.Style.FrameBorderSize; if (border && border_size > 0.0f) { window->DrawList->AddRect(p_min+ImVec2(1,1), p_max+ImVec2(1,1), GetColorU32(ImGuiCol_BorderShadow), rounding, ImDrawCornerFlags_All, border_size); window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_All, border_size); } } void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; const float border_size = g.Style.FrameBorderSize; if (border_size > 0.0f) { window->DrawList->AddRect(p_min+ImVec2(1,1), p_max+ImVec2(1,1), GetColorU32(ImGuiCol_BorderShadow), rounding, ImDrawCornerFlags_All, border_size); window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_All, border_size); } } // Render a triangle to denote expanded/collapsed state void ImGui::RenderArrow(ImVec2 p_min, ImGuiDir dir, float scale) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; const float h = g.FontSize * 1.00f; float r = h * 0.40f * scale; ImVec2 center = p_min + ImVec2(h * 0.50f, h * 0.50f * scale); ImVec2 a, b, c; switch (dir) { case ImGuiDir_Up: case ImGuiDir_Down: if (dir == ImGuiDir_Up) r = -r; center.y -= r * 0.25f; a = ImVec2(0,1) * r; b = ImVec2(-0.866f,-0.5f) * r; c = ImVec2(+0.866f,-0.5f) * r; break; case ImGuiDir_Left: case ImGuiDir_Right: if (dir == ImGuiDir_Left) r = -r; center.x -= r * 0.25f; a = ImVec2(1,0) * r; b = ImVec2(-0.500f,+0.866f) * r; c = ImVec2(-0.500f,-0.866f) * r; break; case ImGuiDir_None: case ImGuiDir_COUNT: IM_ASSERT(0); break; } window->DrawList->AddTriangleFilled(center + a, center + b, center + c, GetColorU32(ImGuiCol_Text)); } void ImGui::RenderBullet(ImVec2 pos) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; window->DrawList->AddCircleFilled(pos, GImGui->FontSize*0.20f, GetColorU32(ImGuiCol_Text), 8); } void ImGui::RenderCheckMark(ImVec2 pos, ImU32 col, float sz) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; float thickness = ImMax(sz / 5.0f, 1.0f); sz -= thickness*0.5f; pos += ImVec2(thickness*0.25f, thickness*0.25f); float third = sz / 3.0f; float bx = pos.x + third; float by = pos.y + sz - third*0.5f; window->DrawList->PathLineTo(ImVec2(bx - third, by - third)); window->DrawList->PathLineTo(ImVec2(bx, by)); window->DrawList->PathLineTo(ImVec2(bx + third*2, by - third*2)); window->DrawList->PathStroke(col, false, thickness); } void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags) { ImGuiContext& g = *GImGui; if (id != g.NavId) return; if (g.NavDisableHighlight && !(flags & ImGuiNavHighlightFlags_AlwaysDraw)) return; ImGuiWindow* window = ImGui::GetCurrentWindow(); if (window->DC.NavHideHighlightOneFrame) return; float rounding = (flags & ImGuiNavHighlightFlags_NoRounding) ? 0.0f : g.Style.FrameRounding; ImRect display_rect = bb; display_rect.ClipWith(window->ClipRect); if (flags & ImGuiNavHighlightFlags_TypeDefault) { const float THICKNESS = 2.0f; const float DISTANCE = 3.0f + THICKNESS * 0.5f; display_rect.Expand(ImVec2(DISTANCE,DISTANCE)); bool fully_visible = window->ClipRect.Contains(display_rect); if (!fully_visible) window->DrawList->PushClipRect(display_rect.Min, display_rect.Max); window->DrawList->AddRect(display_rect.Min + ImVec2(THICKNESS*0.5f,THICKNESS*0.5f), display_rect.Max - ImVec2(THICKNESS*0.5f,THICKNESS*0.5f), GetColorU32(ImGuiCol_NavHighlight), rounding, ImDrawCornerFlags_All, THICKNESS); if (!fully_visible) window->DrawList->PopClipRect(); } if (flags & ImGuiNavHighlightFlags_TypeThin) { window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavHighlight), rounding, ~0, 1.0f); } } // Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker. // CalcTextSize("") should return ImVec2(0.0f, GImGui->FontSize) ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_text_after_double_hash, float wrap_width) { ImGuiContext& g = *GImGui; const char* text_display_end; if (hide_text_after_double_hash) text_display_end = FindRenderedTextEnd(text, text_end); // Hide anything after a '##' string else text_display_end = text_end; ImFont* font = g.Font; const float font_size = g.FontSize; if (text == text_display_end) return ImVec2(0.0f, font_size); ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL); // Cancel out character spacing for the last character of a line (it is baked into glyph->AdvanceX field) const float font_scale = font_size / font->FontSize; const float character_spacing_x = 1.0f * font_scale; if (text_size.x > 0.0f) text_size.x -= character_spacing_x; text_size.x = (float)(int)(text_size.x + 0.95f); return text_size; } // Helper to calculate coarse clipping of large list of evenly sized items. // NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instructions there on how those use this sort of pattern. // NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (g.LogEnabled) { // If logging is active, do not perform any clipping *out_items_display_start = 0; *out_items_display_end = items_count; return; } if (window->SkipItems) { *out_items_display_start = *out_items_display_end = 0; return; } const ImVec2 pos = window->DC.CursorPos; int start = (int)((window->ClipRect.Min.y - pos.y) / items_height); int end = (int)((window->ClipRect.Max.y - pos.y) / items_height); if (g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Up) // When performing a navigation request, ensure we have one item extra in the direction we are moving to start--; if (g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Down) end++; start = ImClamp(start, 0, items_count); end = ImClamp(end + 1, start, items_count); *out_items_display_start = start; *out_items_display_end = end; } // Find window given position, search front-to-back // FIXME: Note that we have a lag here because WindowRectClipped is updated in Begin() so windows moved by user via SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is called, aka before the next Begin(). Moving window thankfully isn't affected. static ImGuiWindow* FindHoveredWindow() { ImGuiContext& g = *GImGui; for (int i = g.Windows.Size - 1; i >= 0; i--) { ImGuiWindow* window = g.Windows[i]; if (!window->Active) continue; if (window->Flags & ImGuiWindowFlags_NoInputs) continue; // Using the clipped AABB, a child window will typically be clipped by its parent (not always) ImRect bb(window->WindowRectClipped.Min - g.Style.TouchExtraPadding, window->WindowRectClipped.Max + g.Style.TouchExtraPadding); if (bb.Contains(g.IO.MousePos)) return window; } return NULL; } // Test if mouse cursor is hovering given rectangle // NB- Rectangle is clipped by our current clip setting // NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding) bool ImGui::IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; // Clip ImRect rect_clipped(r_min, r_max); if (clip) rect_clipped.ClipWith(window->ClipRect); // Expand for touch input const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding); return rect_for_touch.Contains(g.IO.MousePos); } static bool IsKeyPressedMap(ImGuiKey key, bool repeat) { const int key_index = GImGui->IO.KeyMap[key]; return (key_index >= 0) ? ImGui::IsKeyPressed(key_index, repeat) : false; } int ImGui::GetKeyIndex(ImGuiKey imgui_key) { IM_ASSERT(imgui_key >= 0 && imgui_key < ImGuiKey_COUNT); return GImGui->IO.KeyMap[imgui_key]; } // Note that imgui doesn't know the semantic of each entry of io.KeyDown[]. Use your own indices/enums according to how your back-end/engine stored them into KeyDown[]! bool ImGui::IsKeyDown(int user_key_index) { if (user_key_index < 0) return false; IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(GImGui->IO.KeysDown)); return GImGui->IO.KeysDown[user_key_index]; } int ImGui::CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate) { if (t == 0.0f) return 1; if (t <= repeat_delay || repeat_rate <= 0.0f) return 0; const int count = (int)((t - repeat_delay) / repeat_rate) - (int)((t_prev - repeat_delay) / repeat_rate); return (count > 0) ? count : 0; } int ImGui::GetKeyPressedAmount(int key_index, float repeat_delay, float repeat_rate) { ImGuiContext& g = *GImGui; if (key_index < 0) return false; IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown)); const float t = g.IO.KeysDownDuration[key_index]; return CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, repeat_delay, repeat_rate); } bool ImGui::IsKeyPressed(int user_key_index, bool repeat) { ImGuiContext& g = *GImGui; if (user_key_index < 0) return false; IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); const float t = g.IO.KeysDownDuration[user_key_index]; if (t == 0.0f) return true; if (repeat && t > g.IO.KeyRepeatDelay) return GetKeyPressedAmount(user_key_index, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0; return false; } bool ImGui::IsKeyReleased(int user_key_index) { ImGuiContext& g = *GImGui; if (user_key_index < 0) return false; IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); return g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index]; } bool ImGui::IsMouseDown(int button) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); return g.IO.MouseDown[button]; } bool ImGui::IsAnyMouseDown() { ImGuiContext& g = *GImGui; for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++) if (g.IO.MouseDown[n]) return true; return false; } bool ImGui::IsMouseClicked(int button, bool repeat) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); const float t = g.IO.MouseDownDuration[button]; if (t == 0.0f) return true; if (repeat && t > g.IO.KeyRepeatDelay) { float delay = g.IO.KeyRepeatDelay, rate = g.IO.KeyRepeatRate; if ((fmodf(t - delay, rate) > rate*0.5f) != (fmodf(t - delay - g.IO.DeltaTime, rate) > rate*0.5f)) return true; } return false; } bool ImGui::IsMouseReleased(int button) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); return g.IO.MouseReleased[button]; } bool ImGui::IsMouseDoubleClicked(int button) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); return g.IO.MouseDoubleClicked[button]; } bool ImGui::IsMouseDragging(int button, float lock_threshold) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); if (!g.IO.MouseDown[button]) return false; if (lock_threshold < 0.0f) lock_threshold = g.IO.MouseDragThreshold; return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold; } ImVec2 ImGui::GetMousePos() { return GImGui->IO.MousePos; } // NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed! ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup() { ImGuiContext& g = *GImGui; if (g.CurrentPopupStack.Size > 0) return g.OpenPopupStack[g.CurrentPopupStack.Size-1].OpenMousePos; return g.IO.MousePos; } // We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position bool ImGui::IsMousePosValid(const ImVec2* mouse_pos) { if (mouse_pos == NULL) mouse_pos = &GImGui->IO.MousePos; const float MOUSE_INVALID = -256000.0f; return mouse_pos->x >= MOUSE_INVALID && mouse_pos->y >= MOUSE_INVALID; } // NB: This is only valid if IsMousePosValid(). Back-ends in theory should always keep mouse position valid when dragging even outside the client window. ImVec2 ImGui::GetMouseDragDelta(int button, float lock_threshold) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); if (lock_threshold < 0.0f) lock_threshold = g.IO.MouseDragThreshold; if (g.IO.MouseDown[button]) if (g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold) return g.IO.MousePos - g.IO.MouseClickedPos[button]; // Assume we can only get active with left-mouse button (at the moment). return ImVec2(0.0f, 0.0f); } void ImGui::ResetMouseDragDelta(int button) { ImGuiContext& g = *GImGui; IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown)); // NB: We don't need to reset g.IO.MouseDragMaxDistanceSqr g.IO.MouseClickedPos[button] = g.IO.MousePos; } ImGuiMouseCursor ImGui::GetMouseCursor() { return GImGui->MouseCursor; } void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type) { GImGui->MouseCursor = cursor_type; } void ImGui::CaptureKeyboardFromApp(bool capture) { GImGui->WantCaptureKeyboardNextFrame = capture ? 1 : 0; } void ImGui::CaptureMouseFromApp(bool capture) { GImGui->WantCaptureMouseNextFrame = capture ? 1 : 0; } bool ImGui::IsItemActive() { ImGuiContext& g = *GImGui; if (g.ActiveId) { ImGuiWindow* window = g.CurrentWindow; return g.ActiveId == window->DC.LastItemId; } return false; } bool ImGui::IsItemFocused() { ImGuiContext& g = *GImGui; return g.NavId && !g.NavDisableHighlight && g.NavId == g.CurrentWindow->DC.LastItemId; } bool ImGui::IsItemClicked(int mouse_button) { return IsMouseClicked(mouse_button) && IsItemHovered(ImGuiHoveredFlags_Default); } bool ImGui::IsAnyItemHovered() { ImGuiContext& g = *GImGui; return g.HoveredId != 0 || g.HoveredIdPreviousFrame != 0; } bool ImGui::IsAnyItemActive() { ImGuiContext& g = *GImGui; return g.ActiveId != 0; } bool ImGui::IsAnyItemFocused() { ImGuiContext& g = *GImGui; return g.NavId != 0 && !g.NavDisableHighlight; } bool ImGui::IsItemVisible() { ImGuiWindow* window = GetCurrentWindowRead(); return window->ClipRect.Overlaps(window->DC.LastItemRect); } // Allow last item to be overlapped by a subsequent item. Both may be activated during the same frame before the later one takes priority. void ImGui::SetItemAllowOverlap() { ImGuiContext& g = *GImGui; if (g.HoveredId == g.CurrentWindow->DC.LastItemId) g.HoveredIdAllowOverlap = true; if (g.ActiveId == g.CurrentWindow->DC.LastItemId) g.ActiveIdAllowOverlap = true; } ImVec2 ImGui::GetItemRectMin() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.LastItemRect.Min; } ImVec2 ImGui::GetItemRectMax() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.LastItemRect.Max; } ImVec2 ImGui::GetItemRectSize() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.LastItemRect.GetSize(); } static ImRect GetViewportRect() { ImGuiContext& g = *GImGui; if (g.IO.DisplayVisibleMin.x != g.IO.DisplayVisibleMax.x && g.IO.DisplayVisibleMin.y != g.IO.DisplayVisibleMax.y) return ImRect(g.IO.DisplayVisibleMin, g.IO.DisplayVisibleMax); return ImRect(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y); } // Not exposed publicly as BeginTooltip() because bool parameters are evil. Let's see if other needs arise first. void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip) { ImGuiContext& g = *GImGui; char window_name[16]; ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", g.TooltipOverrideCount); if (override_previous_tooltip) if (ImGuiWindow* window = FindWindowByName(window_name)) if (window->Active) { // Hide previous tooltip from being displayed. We can't easily "reset" the content of a window so we create a new one. window->HiddenFrames = 1; ImFormatString(window_name, IM_ARRAYSIZE(window_name), "##Tooltip_%02d", ++g.TooltipOverrideCount); } ImGuiWindowFlags flags = ImGuiWindowFlags_Tooltip|ImGuiWindowFlags_NoInputs|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoNav; Begin(window_name, NULL, flags | extra_flags); } void ImGui::SetTooltipV(const char* fmt, va_list args) { BeginTooltipEx(0, true); TextV(fmt, args); EndTooltip(); } void ImGui::SetTooltip(const char* fmt, ...) { va_list args; va_start(args, fmt); SetTooltipV(fmt, args); va_end(args); } void ImGui::BeginTooltip() { BeginTooltipEx(0, false); } void ImGui::EndTooltip() { IM_ASSERT(GetCurrentWindowRead()->Flags & ImGuiWindowFlags_Tooltip); // Mismatched BeginTooltip()/EndTooltip() calls End(); } // Mark popup as open (toggle toward open state). // Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. // Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). // One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL) void ImGui::OpenPopupEx(ImGuiID id) { ImGuiContext& g = *GImGui; ImGuiWindow* parent_window = g.CurrentWindow; int current_stack_size = g.CurrentPopupStack.Size; ImGuiPopupRef popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack. popup_ref.PopupId = id; popup_ref.Window = NULL; popup_ref.ParentWindow = parent_window; popup_ref.OpenFrameCount = g.FrameCount; popup_ref.OpenParentId = parent_window->IDStack.back(); popup_ref.OpenMousePos = g.IO.MousePos; popup_ref.OpenPopupPos = (!g.NavDisableHighlight && g.NavDisableMouseHover) ? NavCalcPreferredMousePos() : g.IO.MousePos; //printf("[%05d] OpenPopupEx(0x%08X)\n", g.FrameCount, id); if (g.OpenPopupStack.Size < current_stack_size + 1) { g.OpenPopupStack.push_back(popup_ref); } else { // Close child popups if any g.OpenPopupStack.resize(current_stack_size + 1); // Gently handle the user mistakenly calling OpenPopup() every frame. It is a programming mistake! However, if we were to run the regular code path, the ui // would become completely unusable because the popup will always be in hidden-while-calculating-size state _while_ claiming focus. Which would be a very confusing // situation for the programmer. Instead, we silently allow the popup to proceed, it will keep reappearing and the programming error will be more obvious to understand. if (g.OpenPopupStack[current_stack_size].PopupId == id && g.OpenPopupStack[current_stack_size].OpenFrameCount == g.FrameCount - 1) g.OpenPopupStack[current_stack_size].OpenFrameCount = popup_ref.OpenFrameCount; else g.OpenPopupStack[current_stack_size] = popup_ref; // When reopening a popup we first refocus its parent, otherwise if its parent is itself a popup it would get closed by ClosePopupsOverWindow(). // This is equivalent to what ClosePopupToLevel() does. //if (g.OpenPopupStack[current_stack_size].PopupId == id) // FocusWindow(parent_window); } } void ImGui::OpenPopup(const char* str_id) { ImGuiContext& g = *GImGui; OpenPopupEx(g.CurrentWindow->GetID(str_id)); } void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window) { ImGuiContext& g = *GImGui; if (g.OpenPopupStack.empty()) return; // When popups are stacked, clicking on a lower level popups puts focus back to it and close popups above it. // Don't close our own child popup windows. int n = 0; if (ref_window) { for (n = 0; n < g.OpenPopupStack.Size; n++) { ImGuiPopupRef& popup = g.OpenPopupStack[n]; if (!popup.Window) continue; IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0); if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow) continue; // Trim the stack if popups are not direct descendant of the reference window (which is often the NavWindow) bool has_focus = false; for (int m = n; m < g.OpenPopupStack.Size && !has_focus; m++) has_focus = (g.OpenPopupStack[m].Window && g.OpenPopupStack[m].Window->RootWindow == ref_window->RootWindow); if (!has_focus) break; } } if (n < g.OpenPopupStack.Size) // This test is not required but it allows to set a convenient breakpoint on the block below ClosePopupToLevel(n); } ImGuiWindow* ImGui::GetFrontMostPopupModal() { ImGuiContext& g = *GImGui; for (int n = g.OpenPopupStack.Size-1; n >= 0; n--) if (ImGuiWindow* popup = g.OpenPopupStack.Data[n].Window) if (popup->Flags & ImGuiWindowFlags_Modal) return popup; return NULL; } static void ClosePopupToLevel(int remaining) { IM_ASSERT(remaining >= 0); ImGuiContext& g = *GImGui; ImGuiWindow* focus_window = (remaining > 0) ? g.OpenPopupStack[remaining-1].Window : g.OpenPopupStack[0].ParentWindow; if (g.NavLayer == 0) focus_window = NavRestoreLastChildNavWindow(focus_window); ImGui::FocusWindow(focus_window); focus_window->DC.NavHideHighlightOneFrame = true; g.OpenPopupStack.resize(remaining); } void ImGui::ClosePopup(ImGuiID id) { if (!IsPopupOpen(id)) return; ImGuiContext& g = *GImGui; ClosePopupToLevel(g.OpenPopupStack.Size - 1); } // Close the popup we have begin-ed into. void ImGui::CloseCurrentPopup() { ImGuiContext& g = *GImGui; int popup_idx = g.CurrentPopupStack.Size - 1; if (popup_idx < 0 || popup_idx >= g.OpenPopupStack.Size || g.CurrentPopupStack[popup_idx].PopupId != g.OpenPopupStack[popup_idx].PopupId) return; while (popup_idx > 0 && g.OpenPopupStack[popup_idx].Window && (g.OpenPopupStack[popup_idx].Window->Flags & ImGuiWindowFlags_ChildMenu)) popup_idx--; ClosePopupToLevel(popup_idx); } bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags) { ImGuiContext& g = *GImGui; if (!IsPopupOpen(id)) { g.NextWindowData.Clear(); // We behave like Begin() and need to consume those values return false; } char name[20]; if (extra_flags & ImGuiWindowFlags_ChildMenu) ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.CurrentPopupStack.Size); // Recycle windows based on depth else ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame bool is_open = Begin(name, NULL, extra_flags | ImGuiWindowFlags_Popup); if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display) EndPopup(); return is_open; } bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags) { ImGuiContext& g = *GImGui; if (g.OpenPopupStack.Size <= g.CurrentPopupStack.Size) // Early out for performance { g.NextWindowData.Clear(); // We behave like Begin() and need to consume those values return false; } return BeginPopupEx(g.CurrentWindow->GetID(str_id), flags|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); } bool ImGui::IsPopupOpen(ImGuiID id) { ImGuiContext& g = *GImGui; return g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].PopupId == id; } bool ImGui::IsPopupOpen(const char* str_id) { ImGuiContext& g = *GImGui; return g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].PopupId == g.CurrentWindow->GetID(str_id); } bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; const ImGuiID id = window->GetID(name); if (!IsPopupOpen(id)) { g.NextWindowData.Clear(); // We behave like Begin() and need to consume those values return false; } // Center modal windows by default // FIXME: Should test for (PosCond & window->SetWindowPosAllowFlags) with the upcoming window. if (g.NextWindowData.PosCond == 0) SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f)); bool is_open = Begin(name, p_open, flags | ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings); if (!is_open || (p_open && !*p_open)) // NB: is_open can be 'false' when the popup is completely clipped (e.g. zero size display) { EndPopup(); if (is_open) ClosePopup(id); return false; } return is_open; } static void NavProcessMoveRequestWrapAround(ImGuiWindow* window) { ImGuiContext& g = *GImGui; if (g.NavWindow == window && NavMoveRequestButNoResultYet()) if ((g.NavMoveDir == ImGuiDir_Up || g.NavMoveDir == ImGuiDir_Down) && g.NavMoveRequestForward == ImGuiNavForward_None && g.NavLayer == 0) { g.NavMoveRequestForward = ImGuiNavForward_ForwardQueued; ImGui::NavMoveRequestCancel(); g.NavWindow->NavRectRel[0].Min.y = g.NavWindow->NavRectRel[0].Max.y = ((g.NavMoveDir == ImGuiDir_Up) ? ImMax(window->SizeFull.y, window->SizeContents.y) : 0.0f) - window->Scroll.y; } } void ImGui::EndPopup() { ImGuiContext& g = *GImGui; (void)g; IM_ASSERT(g.CurrentWindow->Flags & ImGuiWindowFlags_Popup); // Mismatched BeginPopup()/EndPopup() calls IM_ASSERT(g.CurrentPopupStack.Size > 0); // Make all menus and popups wrap around for now, may need to expose that policy. NavProcessMoveRequestWrapAround(g.CurrentWindow); End(); } bool ImGui::OpenPopupOnItemClick(const char* str_id, int mouse_button) { ImGuiWindow* window = GImGui->CurrentWindow; if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) { ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict! IM_ASSERT(id != 0); // However, you cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item) OpenPopupEx(id); return true; } return false; } // This is a helper to handle the simplest case of associating one named popup to one given widget. // You may want to handle this on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters). // You can pass a NULL str_id to use the identifier of the last item. bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button) { ImGuiWindow* window = GImGui->CurrentWindow; ImGuiID id = str_id ? window->GetID(str_id) : window->DC.LastItemId; // If user hasn't passed an ID, we can use the LastItemID. Using LastItemID as a Popup ID won't conflict! IM_ASSERT(id != 0); // However, you cannot pass a NULL str_id if the last item has no identifier (e.g. a Text() item) if (IsMouseReleased(mouse_button) && IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) OpenPopupEx(id); return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); } bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool also_over_items) { if (!str_id) str_id = "window_context"; ImGuiID id = GImGui->CurrentWindow->GetID(str_id); if (IsMouseReleased(mouse_button) && IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) if (also_over_items || !IsAnyItemHovered()) OpenPopupEx(id); return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); } bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button) { if (!str_id) str_id = "void_context"; ImGuiID id = GImGui->CurrentWindow->GetID(str_id); if (IsMouseReleased(mouse_button) && !IsWindowHovered(ImGuiHoveredFlags_AnyWindow)) OpenPopupEx(id); return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); } static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) { ImGuiContext& g = *GImGui; ImGuiWindow* parent_window = ImGui::GetCurrentWindow(); ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow; flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag const ImVec2 content_avail = ImGui::GetContentRegionAvail(); ImVec2 size = ImFloor(size_arg); const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00); if (size.x <= 0.0f) size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too much issues) if (size.y <= 0.0f) size.y = ImMax(content_avail.y + size.y, 4.0f); const float backup_border_size = g.Style.ChildBorderSize; if (!border) g.Style.ChildBorderSize = 0.0f; flags |= extra_flags; char title[256]; if (name) ImFormatString(title, IM_ARRAYSIZE(title), "%s/%s", parent_window->Name, name); else ImFormatString(title, IM_ARRAYSIZE(title), "%s/%08X", parent_window->Name, id); ImGui::SetNextWindowSize(size); bool ret = ImGui::Begin(title, NULL, flags); ImGuiWindow* child_window = ImGui::GetCurrentWindow(); child_window->ChildId = id; child_window->AutoFitChildAxises = auto_fit_axises; g.Style.ChildBorderSize = backup_border_size; // Process navigation-in immediately so NavInit can run on first frame if (!(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayerActiveMask != 0 || child_window->DC.NavHasScroll) && g.NavActivateId == id) { ImGui::FocusWindow(child_window); ImGui::NavInitWindow(child_window, false); ImGui::SetActiveID(id+1, child_window); // Steal ActiveId with a dummy id so that key-press won't activate child item g.ActiveIdSource = ImGuiInputSource_Nav; } return ret; } bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) { ImGuiWindow* window = GetCurrentWindow(); return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags); } bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) { IM_ASSERT(id != 0); return BeginChildEx(NULL, id, size_arg, border, extra_flags); } void ImGui::EndChild() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() callss if (window->BeginCount > 1) { End(); } else { // When using auto-filling child window, we don't provide full width/height to ItemSize so that it doesn't feed back into automatic size-fitting. ImVec2 sz = GetWindowSize(); if (window->AutoFitChildAxises & (1 << ImGuiAxis_X)) // Arbitrary minimum zero-ish child size of 4.0f causes less trouble than a 0.0f sz.x = ImMax(4.0f, sz.x); if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y)) sz.y = ImMax(4.0f, sz.y); End(); ImGuiWindow* parent_window = g.CurrentWindow; ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz); ItemSize(sz); if ((window->DC.NavLayerActiveMask != 0 || window->DC.NavHasScroll) && !(window->Flags & ImGuiWindowFlags_NavFlattened)) { ItemAdd(bb, window->ChildId); RenderNavHighlight(bb, window->ChildId); // When browsing a window that has no activable items (scroll only) we keep a highlight on the child if (window->DC.NavLayerActiveMask == 0 && window == g.NavWindow) RenderNavHighlight(ImRect(bb.Min - ImVec2(2,2), bb.Max + ImVec2(2,2)), g.NavId, ImGuiNavHighlightFlags_TypeThin); } else { // Not navigable into ItemAdd(bb, 0); } } } // Helper to create a child window / scrolling region that looks like a normal widget frame. bool ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags) { ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]); PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding); PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize); PushStyleVar(ImGuiStyleVar_WindowPadding, style.FramePadding); return BeginChild(id, size, true, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysUseWindowPadding | extra_flags); } void ImGui::EndChildFrame() { EndChild(); PopStyleVar(3); PopStyleColor(); } // Save and compare stack sizes on Begin()/End() to detect usage errors static void CheckStacksSize(ImGuiWindow* window, bool write) { // NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.ButtonRepeat, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin) ImGuiContext& g = *GImGui; int* p_backup = &window->DC.StackSizesBackup[0]; { int current = window->IDStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushID/PopID or TreeNode/TreePop Mismatch!"); p_backup++; } // Too few or too many PopID()/TreePop() { int current = window->DC.GroupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "BeginGroup/EndGroup Mismatch!"); p_backup++; } // Too few or too many EndGroup() { int current = g.CurrentPopupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch"); p_backup++;}// Too few or too many EndMenu()/EndPopup() { int current = g.ColorModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushStyleColor/PopStyleColor Mismatch!"); p_backup++; } // Too few or too many PopStyleColor() { int current = g.StyleModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushStyleVar/PopStyleVar Mismatch!"); p_backup++; } // Too few or too many PopStyleVar() { int current = g.FontStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current && "PushFont/PopFont Mismatch!"); p_backup++; } // Too few or too many PopFont() IM_ASSERT(p_backup == window->DC.StackSizesBackup + IM_ARRAYSIZE(window->DC.StackSizesBackup)); } enum ImGuiPopupPositionPolicy { ImGuiPopupPositionPolicy_Default, ImGuiPopupPositionPolicy_ComboBox }; static ImRect FindScreenRectForWindow(ImGuiWindow* window) { ImVec2 padding = GImGui->Style.DisplaySafeAreaPadding; ImRect r_screen = GetViewportRect(); r_screen.Expand(ImVec2((window->Size.x - r_screen.GetWidth() > padding.x * 2) ? -padding.x : 0.0f, (window->Size.y - r_screen.GetHeight() > padding.y * 2) ? -padding.y : 0.0f)); return r_screen; } // r_avoid = the rectangle to avoid (e.g. for tooltip it is a rectangle around the mouse cursor which we want to avoid. for popups it's a small point around the cursor.) // r_outer = the visible area rectangle, minus safe area padding. If our popup size won't fit because of safe area padding we ignore it. static ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy = ImGuiPopupPositionPolicy_Default) { ImVec2 base_pos_clamped = ImClamp(ref_pos, r_outer.Min, r_outer.Max - size); //GImGui->OverlayDrawList.AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255)); //GImGui->OverlayDrawList.AddRect(r_outer.Min, r_outer.Max, IM_COL32(0,255,0,255)); // Combo Box policy (we want a connecting edge) if (policy == ImGuiPopupPositionPolicy_ComboBox) { const ImGuiDir dir_prefered_order[ImGuiDir_COUNT] = { ImGuiDir_Down, ImGuiDir_Right, ImGuiDir_Left, ImGuiDir_Up }; for (int n = (*last_dir != ImGuiDir_None) ? -1 : 0; n < ImGuiDir_COUNT; n++) { const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n]; if (n != -1 && dir == *last_dir) // Already tried this direction? continue; ImVec2 pos; if (dir == ImGuiDir_Down) pos = ImVec2(r_avoid.Min.x, r_avoid.Max.y); // Below, Toward Right (default) if (dir == ImGuiDir_Right) pos = ImVec2(r_avoid.Min.x, r_avoid.Min.y - size.y); // Above, Toward Right if (dir == ImGuiDir_Left) pos = ImVec2(r_avoid.Max.x - size.x, r_avoid.Max.y); // Below, Toward Left if (dir == ImGuiDir_Up) pos = ImVec2(r_avoid.Max.x - size.x, r_avoid.Min.y - size.y); // Above, Toward Left if (!r_outer.Contains(ImRect(pos, pos + size))) continue; *last_dir = dir; return pos; } } // Default popup policy const ImGuiDir dir_prefered_order[ImGuiDir_COUNT] = { ImGuiDir_Right, ImGuiDir_Down, ImGuiDir_Up, ImGuiDir_Left }; for (int n = (*last_dir != ImGuiDir_None) ? -1 : 0; n < ImGuiDir_COUNT; n++) { const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n]; if (n != -1 && dir == *last_dir) // Already tried this direction? continue; float avail_w = (dir == ImGuiDir_Left ? r_avoid.Min.x : r_outer.Max.x) - (dir == ImGuiDir_Right ? r_avoid.Max.x : r_outer.Min.x); float avail_h = (dir == ImGuiDir_Up ? r_avoid.Min.y : r_outer.Max.y) - (dir == ImGuiDir_Down ? r_avoid.Max.y : r_outer.Min.y); if (avail_w < size.x || avail_h < size.y) continue; ImVec2 pos; pos.x = (dir == ImGuiDir_Left) ? r_avoid.Min.x - size.x : (dir == ImGuiDir_Right) ? r_avoid.Max.x : base_pos_clamped.x; pos.y = (dir == ImGuiDir_Up) ? r_avoid.Min.y - size.y : (dir == ImGuiDir_Down) ? r_avoid.Max.y : base_pos_clamped.y; *last_dir = dir; return pos; } // Fallback, try to keep within display *last_dir = ImGuiDir_None; ImVec2 pos = ref_pos; pos.x = ImMax(ImMin(pos.x + size.x, r_outer.Max.x) - size.x, r_outer.Min.x); pos.y = ImMax(ImMin(pos.y + size.y, r_outer.Max.y) - size.y, r_outer.Min.y); return pos; } static ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window) { ImGuiContext& g = *GImGui; ImRect r_screen = FindScreenRectForWindow(window); if (window->Flags & ImGuiWindowFlags_ChildMenu) { // Child menus typically request _any_ position within the parent menu item, and then our FindBestPopupWindowPos() function will move the new menu outside the parent bounds. // This is how we end up with child menus appearing (most-commonly) on the right of the parent menu. IM_ASSERT(g.CurrentWindow == window); ImGuiWindow* parent_menu = g.CurrentWindowStack[g.CurrentWindowStack.Size - 2]; float horizontal_overlap = g.Style.ItemSpacing.x; // We want some overlap to convey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSpacing.x). ImRect r_avoid; if (parent_menu->DC.MenuBarAppending) r_avoid = ImRect(-FLT_MAX, parent_menu->Pos.y + parent_menu->TitleBarHeight(), FLT_MAX, parent_menu->Pos.y + parent_menu->TitleBarHeight() + parent_menu->MenuBarHeight()); else r_avoid = ImRect(parent_menu->Pos.x + horizontal_overlap, -FLT_MAX, parent_menu->Pos.x + parent_menu->Size.x - horizontal_overlap - parent_menu->ScrollbarSizes.x, FLT_MAX); return FindBestWindowPosForPopupEx(window->PosFloat, window->Size, &window->AutoPosLastDirection, r_screen, r_avoid); } if (window->Flags & ImGuiWindowFlags_Popup) { ImRect r_avoid(window->PosFloat.x - 1, window->PosFloat.y - 1, window->PosFloat.x + 1, window->PosFloat.y + 1); return FindBestWindowPosForPopupEx(window->PosFloat, window->Size, &window->AutoPosLastDirection, r_screen, r_avoid); } if (window->Flags & ImGuiWindowFlags_Tooltip) { // Position tooltip (always follows mouse) float sc = g.Style.MouseCursorScale; ImVec2 ref_pos = (!g.NavDisableHighlight && g.NavDisableMouseHover) ? NavCalcPreferredMousePos() : g.IO.MousePos; ImRect r_avoid; if (!g.NavDisableHighlight && g.NavDisableMouseHover && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos)) r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 16, ref_pos.y + 8); else r_avoid = ImRect(ref_pos.x - 16, ref_pos.y - 8, ref_pos.x + 24 * sc, ref_pos.y + 24 * sc); // FIXME: Hard-coded based on mouse cursor shape expectation. Exact dimension not very important. ImVec2 pos = FindBestWindowPosForPopupEx(ref_pos, window->Size, &window->AutoPosLastDirection, r_screen, r_avoid); if (window->AutoPosLastDirection == ImGuiDir_None) pos = ref_pos + ImVec2(2, 2); // If there's not enough room, for tooltip we prefer avoiding the cursor at all cost even if it means that part of the tooltip won't be visible. return pos; } IM_ASSERT(0); return window->Pos; } static void SetWindowConditionAllowFlags(ImGuiWindow* window, ImGuiCond flags, bool enabled) { window->SetWindowPosAllowFlags = enabled ? (window->SetWindowPosAllowFlags | flags) : (window->SetWindowPosAllowFlags & ~flags); window->SetWindowSizeAllowFlags = enabled ? (window->SetWindowSizeAllowFlags | flags) : (window->SetWindowSizeAllowFlags & ~flags); window->SetWindowCollapsedAllowFlags = enabled ? (window->SetWindowCollapsedAllowFlags | flags) : (window->SetWindowCollapsedAllowFlags & ~flags); } ImGuiWindow* ImGui::FindWindowByName(const char* name) { ImGuiContext& g = *GImGui; ImGuiID id = ImHash(name, 0); return (ImGuiWindow*)g.WindowsById.GetVoidPtr(id); } static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags) { ImGuiContext& g = *GImGui; // Create window the first time ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name); window->Flags = flags; g.WindowsById.SetVoidPtr(window->ID, window); // User can disable loading and saving of settings. Tooltip and child windows also don't store settings. if (!(flags & ImGuiWindowFlags_NoSavedSettings)) { // Retrieve settings from .ini file // Use SetWindowPos() or SetNextWindowPos() with the appropriate condition flag to change the initial position of a window. window->Pos = window->PosFloat = ImVec2(60, 60); if (ImGuiWindowSettings* settings = ImGui::FindWindowSettings(window->ID)) { SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false); window->PosFloat = settings->Pos; window->Pos = ImFloor(window->PosFloat); window->Collapsed = settings->Collapsed; if (ImLengthSqr(settings->Size) > 0.00001f) size = settings->Size; } } window->Size = window->SizeFull = window->SizeFullAtLastBegin = size; if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0) { window->AutoFitFramesX = window->AutoFitFramesY = 2; window->AutoFitOnlyGrows = false; } else { if (window->Size.x <= 0.0f) window->AutoFitFramesX = 2; if (window->Size.y <= 0.0f) window->AutoFitFramesY = 2; window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0); } if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus) g.Windows.insert(g.Windows.begin(), window); // Quite slow but rare and only once else g.Windows.push_back(window); return window; } static ImVec2 CalcSizeAfterConstraint(ImGuiWindow* window, ImVec2 new_size) { ImGuiContext& g = *GImGui; if (g.NextWindowData.SizeConstraintCond != 0) { // Using -1,-1 on either X/Y axis to preserve the current size. ImRect cr = g.NextWindowData.SizeConstraintRect; new_size.x = (cr.Min.x >= 0 && cr.Max.x >= 0) ? ImClamp(new_size.x, cr.Min.x, cr.Max.x) : window->SizeFull.x; new_size.y = (cr.Min.y >= 0 && cr.Max.y >= 0) ? ImClamp(new_size.y, cr.Min.y, cr.Max.y) : window->SizeFull.y; if (g.NextWindowData.SizeCallback) { ImGuiSizeCallbackData data; data.UserData = g.NextWindowData.SizeCallbackUserData; data.Pos = window->Pos; data.CurrentSize = window->SizeFull; data.DesiredSize = new_size; g.NextWindowData.SizeCallback(&data); new_size = data.DesiredSize; } } // Minimum size if (!(window->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize))) { new_size = ImMax(new_size, g.Style.WindowMinSize); new_size.y = ImMax(new_size.y, window->TitleBarHeight() + window->MenuBarHeight() + ImMax(0.0f, g.Style.WindowRounding - 1.0f)); // Reduce artifacts with very small windows } return new_size; } static ImVec2 CalcSizeContents(ImGuiWindow* window) { ImVec2 sz; sz.x = (float)(int)((window->SizeContentsExplicit.x != 0.0f) ? window->SizeContentsExplicit.x : (window->DC.CursorMaxPos.x - window->Pos.x + window->Scroll.x)); sz.y = (float)(int)((window->SizeContentsExplicit.y != 0.0f) ? window->SizeContentsExplicit.y : (window->DC.CursorMaxPos.y - window->Pos.y + window->Scroll.y)); return sz + window->WindowPadding; } static ImVec2 CalcSizeAutoFit(ImGuiWindow* window, const ImVec2& size_contents) { ImGuiContext& g = *GImGui; ImGuiStyle& style = g.Style; ImGuiWindowFlags flags = window->Flags; ImVec2 size_auto_fit; if ((flags & ImGuiWindowFlags_Tooltip) != 0) { // Tooltip always resize. We keep the spacing symmetric on both axises for aesthetic purpose. size_auto_fit = size_contents; } else { // When the window cannot fit all contents (either because of constraints, either because screen is too small): we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than DisplaySize-WindowPadding. size_auto_fit = ImClamp(size_contents, style.WindowMinSize, ImMax(style.WindowMinSize, g.IO.DisplaySize - g.Style.DisplaySafeAreaPadding)); ImVec2 size_auto_fit_after_constraint = CalcSizeAfterConstraint(window, size_auto_fit); if (size_auto_fit_after_constraint.x < size_contents.x && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar)) size_auto_fit.y += style.ScrollbarSize; if (size_auto_fit_after_constraint.y < size_contents.y && !(flags & ImGuiWindowFlags_NoScrollbar)) size_auto_fit.x += style.ScrollbarSize; } return size_auto_fit; } static float GetScrollMaxX(ImGuiWindow* window) { return ImMax(0.0f, window->SizeContents.x - (window->SizeFull.x - window->ScrollbarSizes.x)); } static float GetScrollMaxY(ImGuiWindow* window) { return ImMax(0.0f, window->SizeContents.y - (window->SizeFull.y - window->ScrollbarSizes.y)); } static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window) { ImVec2 scroll = window->Scroll; float cr_x = window->ScrollTargetCenterRatio.x; float cr_y = window->ScrollTargetCenterRatio.y; if (window->ScrollTarget.x < FLT_MAX) scroll.x = window->ScrollTarget.x - cr_x * (window->SizeFull.x - window->ScrollbarSizes.x); if (window->ScrollTarget.y < FLT_MAX) scroll.y = window->ScrollTarget.y - (1.0f - cr_y) * (window->TitleBarHeight() + window->MenuBarHeight()) - cr_y * (window->SizeFull.y - window->ScrollbarSizes.y); scroll = ImMax(scroll, ImVec2(0.0f, 0.0f)); if (!window->Collapsed && !window->SkipItems) { scroll.x = ImMin(scroll.x, GetScrollMaxX(window)); scroll.y = ImMin(scroll.y, GetScrollMaxY(window)); } return scroll; } static ImGuiCol GetWindowBgColorIdxFromFlags(ImGuiWindowFlags flags) { if (flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup)) return ImGuiCol_PopupBg; if (flags & ImGuiWindowFlags_ChildWindow) return ImGuiCol_ChildBg; return ImGuiCol_WindowBg; } static void CalcResizePosSizeFromAnyCorner(ImGuiWindow* window, const ImVec2& corner_target, const ImVec2& corner_norm, ImVec2* out_pos, ImVec2* out_size) { ImVec2 pos_min = ImLerp(corner_target, window->Pos, corner_norm); // Expected window upper-left ImVec2 pos_max = ImLerp(window->Pos + window->Size, corner_target, corner_norm); // Expected window lower-right ImVec2 size_expected = pos_max - pos_min; ImVec2 size_constrained = CalcSizeAfterConstraint(window, size_expected); *out_pos = pos_min; if (corner_norm.x == 0.0f) out_pos->x -= (size_constrained.x - size_expected.x); if (corner_norm.y == 0.0f) out_pos->y -= (size_constrained.y - size_expected.y); *out_size = size_constrained; } struct ImGuiResizeGripDef { ImVec2 CornerPos; ImVec2 InnerDir; int AngleMin12, AngleMax12; }; const ImGuiResizeGripDef resize_grip_def[4] = { { ImVec2(1,1), ImVec2(-1,-1), 0, 3 }, // Lower right { ImVec2(0,1), ImVec2(+1,-1), 3, 6 }, // Lower left { ImVec2(0,0), ImVec2(+1,+1), 6, 9 }, // Upper left { ImVec2(1,0), ImVec2(-1,+1), 9,12 }, // Upper right }; static ImRect GetBorderRect(ImGuiWindow* window, int border_n, float perp_padding, float thickness) { ImRect rect = window->Rect(); if (thickness == 0.0f) rect.Max -= ImVec2(1,1); if (border_n == 0) return ImRect(rect.Min.x + perp_padding, rect.Min.y, rect.Max.x - perp_padding, rect.Min.y + thickness); if (border_n == 1) return ImRect(rect.Max.x - thickness, rect.Min.y + perp_padding, rect.Max.x, rect.Max.y - perp_padding); if (border_n == 2) return ImRect(rect.Min.x + perp_padding, rect.Max.y - thickness, rect.Max.x - perp_padding, rect.Max.y); if (border_n == 3) return ImRect(rect.Min.x, rect.Min.y + perp_padding, rect.Min.x + thickness, rect.Max.y - perp_padding); IM_ASSERT(0); return ImRect(); } // Handle resize for: Resize Grips, Borders, Gamepad static void ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4]) { ImGuiContext& g = *GImGui; ImGuiWindowFlags flags = window->Flags; if ((flags & ImGuiWindowFlags_NoResize) || (flags & ImGuiWindowFlags_AlwaysAutoResize) || window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) return; const int resize_border_count = (flags & ImGuiWindowFlags_ResizeFromAnySide) ? 4 : 0; const float grip_draw_size = (float)(int)ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f); const float grip_hover_size = (float)(int)(grip_draw_size * 0.75f); ImVec2 pos_target(FLT_MAX, FLT_MAX); ImVec2 size_target(FLT_MAX, FLT_MAX); // Manual resize grips PushID("#RESIZE"); for (int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++) { const ImGuiResizeGripDef& grip = resize_grip_def[resize_grip_n]; const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPos); // Using the FlattenChilds button flag we make the resize button accessible even if we are hovering over a child window ImRect resize_rect(corner, corner + grip.InnerDir * grip_hover_size); resize_rect.FixInverted(); bool hovered, held; ButtonBehavior(resize_rect, window->GetID((void*)(intptr_t)resize_grip_n), &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus); if (hovered || held) g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE; if (g.HoveredWindow == window && held && g.IO.MouseDoubleClicked[0] && resize_grip_n == 0) { // Manual auto-fit when double-clicking size_target = CalcSizeAfterConstraint(window, size_auto_fit); ClearActiveID(); } else if (held) { // Resize from any of the four corners // We don't use an incremental MouseDelta but rather compute an absolute target size based on mouse position ImVec2 corner_target = g.IO.MousePos - g.ActiveIdClickOffset + resize_rect.GetSize() * grip.CornerPos; // Corner of the window corresponding to our corner grip CalcResizePosSizeFromAnyCorner(window, corner_target, grip.CornerPos, &pos_target, &size_target); } if (resize_grip_n == 0 || held || hovered) resize_grip_col[resize_grip_n] = GetColorU32(held ? ImGuiCol_ResizeGripActive : hovered ? ImGuiCol_ResizeGripHovered : ImGuiCol_ResizeGrip); } for (int border_n = 0; border_n < resize_border_count; border_n++) { const float BORDER_SIZE = 5.0f; // FIXME: Only works _inside_ window because of HoveredWindow check. const float BORDER_APPEAR_TIMER = 0.05f; // Reduce visual noise bool hovered, held; ImRect border_rect = GetBorderRect(window, border_n, grip_hover_size, BORDER_SIZE); ButtonBehavior(border_rect, window->GetID((void*)(intptr_t)(border_n + 4)), &hovered, &held, ImGuiButtonFlags_FlattenChildren); if ((hovered && g.HoveredIdTimer > BORDER_APPEAR_TIMER) || held) { g.MouseCursor = (border_n & 1) ? ImGuiMouseCursor_ResizeEW : ImGuiMouseCursor_ResizeNS; if (held) *border_held = border_n; } if (held) { ImVec2 border_target = window->Pos; ImVec2 border_posn; if (border_n == 0) { border_posn = ImVec2(0, 0); border_target.y = (g.IO.MousePos.y - g.ActiveIdClickOffset.y); } if (border_n == 1) { border_posn = ImVec2(1, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + BORDER_SIZE); } if (border_n == 2) { border_posn = ImVec2(0, 1); border_target.y = (g.IO.MousePos.y - g.ActiveIdClickOffset.y + BORDER_SIZE); } if (border_n == 3) { border_posn = ImVec2(0, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdClickOffset.x); } CalcResizePosSizeFromAnyCorner(window, border_target, border_posn, &pos_target, &size_target); } } PopID(); // Navigation resize (keyboard/gamepad) if (g.NavWindowingTarget == window) { ImVec2 nav_resize_delta; if (g.NavInputSource == ImGuiInputSource_NavKeyboard && g.IO.KeyShift) nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down); if (g.NavInputSource == ImGuiInputSource_NavGamepad) nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_Down); if (nav_resize_delta.x != 0.0f || nav_resize_delta.y != 0.0f) { const float NAV_RESIZE_SPEED = 600.0f; nav_resize_delta *= ImFloor(NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y)); g.NavWindowingToggleLayer = false; g.NavDisableMouseHover = true; resize_grip_col[0] = GetColorU32(ImGuiCol_ResizeGripActive); // FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck. size_target = CalcSizeAfterConstraint(window, window->SizeFull + nav_resize_delta); } } // Apply back modified position/size to window if (size_target.x != FLT_MAX) { window->SizeFull = size_target; MarkIniSettingsDirty(window); } if (pos_target.x != FLT_MAX) { window->Pos = window->PosFloat = ImFloor(pos_target); MarkIniSettingsDirty(window); } window->Size = window->SizeFull; } // Push a new ImGui window to add widgets to. // - A default window called "Debug" is automatically stacked at the beginning of every frame so you can use widgets without explicitly calling a Begin/End pair. // - Begin/End can be called multiple times during the frame with the same window name to append content. // - The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file). // You can use the "##" or "###" markers to use the same label with different id, or same id with different label. See documentation at the top of this file. // - Return false when window is collapsed, so you can early out in your code. You always need to call ImGui::End() even if false is returned. // - Passing 'bool* p_open' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed. bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) { ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; IM_ASSERT(name != NULL); // Window name required IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame() IM_ASSERT(g.FrameCountEnded != g.FrameCount); // Called ImGui::Render() or ImGui::EndFrame() and haven't called ImGui::NewFrame() again yet // Find or create ImGuiWindow* window = FindWindowByName(name); const bool window_just_created = (window == NULL); if (window_just_created) { ImVec2 size_on_first_use = (g.NextWindowData.SizeCond != 0) ? g.NextWindowData.SizeVal : ImVec2(0.0f, 0.0f); // Any condition flag will do since we are creating a new window here. window = CreateNewWindow(name, size_on_first_use, flags); } // Automatically disable manual moving/resizing when NoInputs is set if (flags & ImGuiWindowFlags_NoInputs) flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize; if (flags & ImGuiWindowFlags_NavFlattened) IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow); const int current_frame = g.FrameCount; const bool first_begin_of_the_frame = (window->LastFrameActive != current_frame); if (first_begin_of_the_frame) window->Flags = (ImGuiWindowFlags)flags; else flags = window->Flags; // Update the Appearing flag bool window_just_activated_by_user = (window->LastFrameActive < current_frame - 1); // Not using !WasActive because the implicit "Debug" window would always toggle off->on const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFrames > 0); if (flags & ImGuiWindowFlags_Popup) { ImGuiPopupRef& popup_ref = g.OpenPopupStack[g.CurrentPopupStack.Size]; window_just_activated_by_user |= (window->PopupId != popup_ref.PopupId); // We recycle popups so treat window as activated if popup id changed window_just_activated_by_user |= (window != popup_ref.Window); } window->Appearing = (window_just_activated_by_user || window_just_appearing_after_hidden_for_resize); window->CloseButton = (p_open != NULL); if (window->Appearing) SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, true); // Parent window is latched only on the first call to Begin() of the frame, so further append-calls can be done from a different window stack ImGuiWindow* parent_window_in_stack = g.CurrentWindowStack.empty() ? NULL : g.CurrentWindowStack.back(); ImGuiWindow* parent_window = first_begin_of_the_frame ? ((flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup)) ? parent_window_in_stack : NULL) : window->ParentWindow; IM_ASSERT(parent_window != NULL || !(flags & ImGuiWindowFlags_ChildWindow)); // Add to stack g.CurrentWindowStack.push_back(window); SetCurrentWindow(window); CheckStacksSize(window, true); if (flags & ImGuiWindowFlags_Popup) { ImGuiPopupRef& popup_ref = g.OpenPopupStack[g.CurrentPopupStack.Size]; popup_ref.Window = window; g.CurrentPopupStack.push_back(popup_ref); window->PopupId = popup_ref.PopupId; } if (window_just_appearing_after_hidden_for_resize && !(flags & ImGuiWindowFlags_ChildWindow)) window->NavLastIds[0] = 0; // Process SetNextWindow***() calls bool window_pos_set_by_api = false; bool window_size_x_set_by_api = false, window_size_y_set_by_api = false; if (g.NextWindowData.PosCond) { window_pos_set_by_api = (window->SetWindowPosAllowFlags & g.NextWindowData.PosCond) != 0; if (window_pos_set_by_api && ImLengthSqr(g.NextWindowData.PosPivotVal) > 0.00001f) { // May be processed on the next frame if this is our first frame and we are measuring size // FIXME: Look into removing the branch so everything can go through this same code path for consistency. window->SetWindowPosVal = g.NextWindowData.PosVal; window->SetWindowPosPivot = g.NextWindowData.PosPivotVal; window->SetWindowPosAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); } else { SetWindowPos(window, g.NextWindowData.PosVal, g.NextWindowData.PosCond); } g.NextWindowData.PosCond = 0; } if (g.NextWindowData.SizeCond) { window_size_x_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.x > 0.0f); window_size_y_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.y > 0.0f); SetWindowSize(window, g.NextWindowData.SizeVal, g.NextWindowData.SizeCond); g.NextWindowData.SizeCond = 0; } if (g.NextWindowData.ContentSizeCond) { // Adjust passed "client size" to become a "window size" window->SizeContentsExplicit = g.NextWindowData.ContentSizeVal; if (window->SizeContentsExplicit.y != 0.0f) window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight(); g.NextWindowData.ContentSizeCond = 0; } else if (first_begin_of_the_frame) { window->SizeContentsExplicit = ImVec2(0.0f, 0.0f); } if (g.NextWindowData.CollapsedCond) { SetWindowCollapsed(window, g.NextWindowData.CollapsedVal, g.NextWindowData.CollapsedCond); g.NextWindowData.CollapsedCond = 0; } if (g.NextWindowData.FocusCond) { SetWindowFocus(); g.NextWindowData.FocusCond = 0; } if (window->Appearing) SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, false); // When reusing window again multiple times a frame, just append content (don't need to setup again) if (first_begin_of_the_frame) { const bool window_is_child_tooltip = (flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_Tooltip); // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345) // Initialize window->ParentWindow = parent_window; window->RootWindow = window->RootWindowForTitleBarHighlight = window->RootWindowForTabbing = window->RootWindowForNav = window; if (parent_window && (flags & ImGuiWindowFlags_ChildWindow) && !window_is_child_tooltip) window->RootWindow = parent_window->RootWindow; if (parent_window && !(flags & ImGuiWindowFlags_Modal) && (flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup))) window->RootWindowForTitleBarHighlight = window->RootWindowForTabbing = parent_window->RootWindowForTitleBarHighlight; // Same value in master branch, will differ for docking while (window->RootWindowForNav->Flags & ImGuiWindowFlags_NavFlattened) window->RootWindowForNav = window->RootWindowForNav->ParentWindow; window->Active = true; window->BeginOrderWithinParent = 0; window->BeginOrderWithinContext = g.WindowsActiveCount++; window->BeginCount = 0; window->ClipRect = ImVec4(-FLT_MAX,-FLT_MAX,+FLT_MAX,+FLT_MAX); window->LastFrameActive = current_frame; window->IDStack.resize(1); // Lock window rounding, border size and rounding so that altering the border sizes for children doesn't have side-effects. window->WindowRounding = (flags & ImGuiWindowFlags_ChildWindow) ? style.ChildRounding : ((flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiWindowFlags_Modal)) ? style.PopupRounding : style.WindowRounding; window->WindowBorderSize = (flags & ImGuiWindowFlags_ChildWindow) ? style.ChildBorderSize : ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) && !(flags & ImGuiWindowFlags_Modal)) ? style.PopupBorderSize : style.WindowBorderSize; window->WindowPadding = style.WindowPadding; if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_Popup)) && window->WindowBorderSize == 0.0f) window->WindowPadding = ImVec2(0.0f, (flags & ImGuiWindowFlags_MenuBar) ? style.WindowPadding.y : 0.0f); // Collapse window by double-clicking on title bar // At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse)) { ImRect title_bar_rect = window->TitleBarRect(); if (window->CollapseToggleWanted || (g.HoveredWindow == window && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseDoubleClicked[0])) { window->Collapsed = !window->Collapsed; MarkIniSettingsDirty(window); FocusWindow(window); } } else { window->Collapsed = false; } window->CollapseToggleWanted = false; // SIZE // Update contents size from last frame for auto-fitting (unless explicitly specified) window->SizeContents = CalcSizeContents(window); // Hide popup/tooltip window when re-opening while we measure size (because we recycle the windows) if (window->HiddenFrames > 0) window->HiddenFrames--; if (window_just_activated_by_user && (flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) != 0) { window->HiddenFrames = 1; if (flags & ImGuiWindowFlags_AlwaysAutoResize) { if (!window_size_x_set_by_api) window->Size.x = window->SizeFull.x = 0.f; if (!window_size_y_set_by_api) window->Size.y = window->SizeFull.y = 0.f; window->SizeContents = ImVec2(0.f, 0.f); } } // Hide new windows for one frame until they calculate their size if (window_just_created && (!window_size_x_set_by_api || !window_size_y_set_by_api)) window->HiddenFrames = 1; // Calculate auto-fit size, handle automatic resize const ImVec2 size_auto_fit = CalcSizeAutoFit(window, window->SizeContents); ImVec2 size_full_modified(FLT_MAX, FLT_MAX); if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window->Collapsed) { // Using SetNextWindowSize() overrides ImGuiWindowFlags_AlwaysAutoResize, so it can be used on tooltips/popups, etc. if (!window_size_x_set_by_api) window->SizeFull.x = size_full_modified.x = size_auto_fit.x; if (!window_size_y_set_by_api) window->SizeFull.y = size_full_modified.y = size_auto_fit.y; } else if (window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) { // Auto-fit may only grow window during the first few frames // We still process initial auto-fit on collapsed windows to get a window width, but otherwise don't honor ImGuiWindowFlags_AlwaysAutoResize when collapsed. if (!window_size_x_set_by_api && window->AutoFitFramesX > 0) window->SizeFull.x = size_full_modified.x = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.x, size_auto_fit.x) : size_auto_fit.x; if (!window_size_y_set_by_api && window->AutoFitFramesY > 0) window->SizeFull.y = size_full_modified.y = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.y, size_auto_fit.y) : size_auto_fit.y; if (!window->Collapsed) MarkIniSettingsDirty(window); } // Apply minimum/maximum window size constraints and final size window->SizeFull = CalcSizeAfterConstraint(window, window->SizeFull); window->Size = window->Collapsed && !(flags & ImGuiWindowFlags_ChildWindow) ? window->TitleBarRect().GetSize() : window->SizeFull; // SCROLLBAR STATUS // Update scrollbar status (based on the Size that was effective during last frame or the auto-resized Size). if (!window->Collapsed) { // When reading the current size we need to read it after size constraints have been applied float size_x_for_scrollbars = size_full_modified.x != FLT_MAX ? window->SizeFull.x : window->SizeFullAtLastBegin.x; float size_y_for_scrollbars = size_full_modified.y != FLT_MAX ? window->SizeFull.y : window->SizeFullAtLastBegin.y; window->ScrollbarY = (flags & ImGuiWindowFlags_AlwaysVerticalScrollbar) || ((window->SizeContents.y > size_y_for_scrollbars) && !(flags & ImGuiWindowFlags_NoScrollbar)); window->ScrollbarX = (flags & ImGuiWindowFlags_AlwaysHorizontalScrollbar) || ((window->SizeContents.x > size_x_for_scrollbars - (window->ScrollbarY ? style.ScrollbarSize : 0.0f)) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar)); if (window->ScrollbarX && !window->ScrollbarY) window->ScrollbarY = (window->SizeContents.y > size_y_for_scrollbars - style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar); window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f); } // POSITION // Popup latch its initial position, will position itself when it appears next frame if (window_just_activated_by_user) { window->AutoPosLastDirection = ImGuiDir_None; if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api) window->Pos = window->PosFloat = g.CurrentPopupStack.back().OpenPopupPos; } // Position child window if (flags & ImGuiWindowFlags_ChildWindow) { window->BeginOrderWithinParent = parent_window->DC.ChildWindows.Size; parent_window->DC.ChildWindows.push_back(window); if (!(flags & ImGuiWindowFlags_Popup) && !window_pos_set_by_api && !window_is_child_tooltip) window->Pos = window->PosFloat = parent_window->DC.CursorPos; } const bool window_pos_with_pivot = (window->SetWindowPosVal.x != FLT_MAX && window->HiddenFrames == 0); if (window_pos_with_pivot) SetWindowPos(window, ImMax(style.DisplaySafeAreaPadding, window->SetWindowPosVal - window->SizeFull * window->SetWindowPosPivot), 0); // Position given a pivot (e.g. for centering) else if ((flags & ImGuiWindowFlags_ChildMenu) != 0) window->PosFloat = FindBestWindowPosForPopup(window); else if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api && window_just_appearing_after_hidden_for_resize) window->PosFloat = FindBestWindowPosForPopup(window); else if ((flags & ImGuiWindowFlags_Tooltip) != 0 && !window_pos_set_by_api && !window_is_child_tooltip) window->PosFloat = FindBestWindowPosForPopup(window); // Clamp position so it stays visible if (!(flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Tooltip)) { if (!window_pos_set_by_api && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0 && g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing. { ImVec2 padding = ImMax(style.DisplayWindowPadding, style.DisplaySafeAreaPadding); window->PosFloat = ImMax(window->PosFloat + window->Size, padding) - window->Size; window->PosFloat = ImMin(window->PosFloat, g.IO.DisplaySize - padding); } } window->Pos = ImFloor(window->PosFloat); // Default item width. Make it proportional to window size if window manually resizes if (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize)) window->ItemWidthDefault = (float)(int)(window->Size.x * 0.65f); else window->ItemWidthDefault = (float)(int)(g.FontSize * 16.0f); // Prepare for focus requests window->FocusIdxAllRequestCurrent = (window->FocusIdxAllRequestNext == INT_MAX || window->FocusIdxAllCounter == -1) ? INT_MAX : (window->FocusIdxAllRequestNext + (window->FocusIdxAllCounter+1)) % (window->FocusIdxAllCounter+1); window->FocusIdxTabRequestCurrent = (window->FocusIdxTabRequestNext == INT_MAX || window->FocusIdxTabCounter == -1) ? INT_MAX : (window->FocusIdxTabRequestNext + (window->FocusIdxTabCounter+1)) % (window->FocusIdxTabCounter+1); window->FocusIdxAllCounter = window->FocusIdxTabCounter = -1; window->FocusIdxAllRequestNext = window->FocusIdxTabRequestNext = INT_MAX; // Apply scrolling window->Scroll = CalcNextScrollFromScrollTargetAndClamp(window); window->ScrollTarget = ImVec2(FLT_MAX, FLT_MAX); // Apply focus, new windows appears in front bool want_focus = false; if (window_just_activated_by_user && !(flags & ImGuiWindowFlags_NoFocusOnAppearing)) if (!(flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip)) || (flags & ImGuiWindowFlags_Popup)) want_focus = true; // Handle manual resize: Resize Grips, Borders, Gamepad int border_held = -1; ImU32 resize_grip_col[4] = { 0 }; const int resize_grip_count = (flags & ImGuiWindowFlags_ResizeFromAnySide) ? 2 : 1; // 4 const float grip_draw_size = (float)(int)ImMax(g.FontSize * 1.35f, window->WindowRounding + 1.0f + g.FontSize * 0.2f); if (!window->Collapsed) UpdateManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0]); // DRAWING // Setup draw list and outer clipping rectangle window->DrawList->Clear(); window->DrawList->Flags = (g.Style.AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0) | (g.Style.AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0); window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID); ImRect viewport_rect(GetViewportRect()); if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_is_child_tooltip) PushClipRect(parent_window->ClipRect.Min, parent_window->ClipRect.Max, true); else PushClipRect(viewport_rect.Min, viewport_rect.Max, true); // Draw modal window background (darkens what is behind them) if ((flags & ImGuiWindowFlags_Modal) != 0 && window == GetFrontMostPopupModal()) window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, GetColorU32(ImGuiCol_ModalWindowDarkening, g.ModalWindowDarkeningRatio)); // Draw navigation selection/windowing rectangle background if (g.NavWindowingTarget == window) { ImRect bb = window->Rect(); bb.Expand(g.FontSize); if (!bb.Contains(viewport_rect)) // Avoid drawing if the window covers all the viewport anyway window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha * 0.25f), g.Style.WindowRounding); } // Draw window + handle manual resize const float window_rounding = window->WindowRounding; const float window_border_size = window->WindowBorderSize; const bool title_bar_is_highlight = want_focus || (g.NavWindow && window->RootWindowForTitleBarHighlight == g.NavWindow->RootWindowForTitleBarHighlight); const ImRect title_bar_rect = window->TitleBarRect(); if (window->Collapsed) { // Title bar only float backup_border_size = style.FrameBorderSize; g.Style.FrameBorderSize = window->WindowBorderSize; ImU32 title_bar_col = GetColorU32((title_bar_is_highlight && !g.NavDisableHighlight) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed); RenderFrame(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, true, window_rounding); g.Style.FrameBorderSize = backup_border_size; } else { // Window background ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags)); if (g.NextWindowData.BgAlphaCond != 0) { bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(g.NextWindowData.BgAlphaVal) << IM_COL32_A_SHIFT); g.NextWindowData.BgAlphaCond = 0; } window->DrawList->AddRectFilled(window->Pos+ImVec2(0,window->TitleBarHeight()), window->Pos+window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Bot); // Title bar ImU32 title_bar_col = GetColorU32(window->Collapsed ? ImGuiCol_TitleBgCollapsed : title_bar_is_highlight ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg); if (!(flags & ImGuiWindowFlags_NoTitleBar)) window->DrawList->AddRectFilled(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, window_rounding, ImDrawCornerFlags_Top); // Menu bar if (flags & ImGuiWindowFlags_MenuBar) { ImRect menu_bar_rect = window->MenuBarRect(); menu_bar_rect.ClipWith(window->Rect()); // Soft clipping, in particular child window don't have minimum size covering the menu bar so this is useful for them. window->DrawList->AddRectFilled(menu_bar_rect.Min, menu_bar_rect.Max, GetColorU32(ImGuiCol_MenuBarBg), (flags & ImGuiWindowFlags_NoTitleBar) ? window_rounding : 0.0f, ImDrawCornerFlags_Top); if (style.FrameBorderSize > 0.0f && menu_bar_rect.Max.y < window->Pos.y + window->Size.y) window->DrawList->AddLine(menu_bar_rect.GetBL(), menu_bar_rect.GetBR(), GetColorU32(ImGuiCol_Border), style.FrameBorderSize); } // Scrollbars if (window->ScrollbarX) Scrollbar(ImGuiLayoutType_Horizontal); if (window->ScrollbarY) Scrollbar(ImGuiLayoutType_Vertical); // Render resize grips (after their input handling so we don't have a frame of latency) if (!(flags & ImGuiWindowFlags_NoResize)) { for (int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++) { const ImGuiResizeGripDef& grip = resize_grip_def[resize_grip_n]; const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPos); window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(window_border_size, grip_draw_size) : ImVec2(grip_draw_size, window_border_size))); window->DrawList->PathLineTo(corner + grip.InnerDir * ((resize_grip_n & 1) ? ImVec2(grip_draw_size, window_border_size) : ImVec2(window_border_size, grip_draw_size))); window->DrawList->PathArcToFast(ImVec2(corner.x + grip.InnerDir.x * (window_rounding + window_border_size), corner.y + grip.InnerDir.y * (window_rounding + window_border_size)), window_rounding, grip.AngleMin12, grip.AngleMax12); window->DrawList->PathFillConvex(resize_grip_col[resize_grip_n]); } } // Borders if (window_border_size > 0.0f) window->DrawList->AddRect(window->Pos, window->Pos+window->Size, GetColorU32(ImGuiCol_Border), window_rounding, ImDrawCornerFlags_All, window_border_size); if (border_held != -1) { ImRect border = GetBorderRect(window, border_held, grip_draw_size, 0.0f); window->DrawList->AddLine(border.Min, border.Max, GetColorU32(ImGuiCol_SeparatorActive), ImMax(1.0f, window_border_size)); } if (style.FrameBorderSize > 0 && !(flags & ImGuiWindowFlags_NoTitleBar)) window->DrawList->AddLine(title_bar_rect.GetBL() + ImVec2(style.WindowBorderSize, -1), title_bar_rect.GetBR() + ImVec2(-style.WindowBorderSize,-1), GetColorU32(ImGuiCol_Border), style.FrameBorderSize); } // Draw navigation selection/windowing rectangle border if (g.NavWindowingTarget == window) { float rounding = ImMax(window->WindowRounding, g.Style.WindowRounding); ImRect bb = window->Rect(); bb.Expand(g.FontSize); if (bb.Contains(viewport_rect)) // If a window fits the entire viewport, adjust its highlight inward { bb.Expand(-g.FontSize - 1.0f); rounding = window->WindowRounding; } window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), rounding, ~0, 3.0f); } // Store a backup of SizeFull which we will use next frame to decide if we need scrollbars. window->SizeFullAtLastBegin = window->SizeFull; // Update ContentsRegionMax. All the variable it depends on are set above in this function. window->ContentsRegionRect.Min.x = -window->Scroll.x + window->WindowPadding.x; window->ContentsRegionRect.Min.y = -window->Scroll.y + window->WindowPadding.y + window->TitleBarHeight() + window->MenuBarHeight(); window->ContentsRegionRect.Max.x = -window->Scroll.x - window->WindowPadding.x + (window->SizeContentsExplicit.x != 0.0f ? window->SizeContentsExplicit.x : (window->Size.x - window->ScrollbarSizes.x)); window->ContentsRegionRect.Max.y = -window->Scroll.y - window->WindowPadding.y + (window->SizeContentsExplicit.y != 0.0f ? window->SizeContentsExplicit.y : (window->Size.y - window->ScrollbarSizes.y)); // Setup drawing context // (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.) window->DC.IndentX = 0.0f + window->WindowPadding.x - window->Scroll.x; window->DC.GroupOffsetX = 0.0f; window->DC.ColumnsOffsetX = 0.0f; window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.IndentX + window->DC.ColumnsOffsetX, window->TitleBarHeight() + window->MenuBarHeight() + window->WindowPadding.y - window->Scroll.y); window->DC.CursorPos = window->DC.CursorStartPos; window->DC.CursorPosPrevLine = window->DC.CursorPos; window->DC.CursorMaxPos = window->DC.CursorStartPos; window->DC.CurrentLineHeight = window->DC.PrevLineHeight = 0.0f; window->DC.CurrentLineTextBaseOffset = window->DC.PrevLineTextBaseOffset = 0.0f; window->DC.NavHideHighlightOneFrame = false; window->DC.NavHasScroll = (GetScrollMaxY() > 0.0f); window->DC.NavLayerActiveMask = window->DC.NavLayerActiveMaskNext; window->DC.NavLayerActiveMaskNext = 0x00; window->DC.MenuBarAppending = false; window->DC.MenuBarOffsetX = ImMax(window->WindowPadding.x, style.ItemSpacing.x); window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f; window->DC.ChildWindows.resize(0); window->DC.LayoutType = ImGuiLayoutType_Vertical; window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Vertical; window->DC.ItemFlags = ImGuiItemFlags_Default_; window->DC.ItemWidth = window->ItemWidthDefault; window->DC.TextWrapPos = -1.0f; // disabled window->DC.ItemFlagsStack.resize(0); window->DC.ItemWidthStack.resize(0); window->DC.TextWrapPosStack.resize(0); window->DC.ColumnsSet = NULL; window->DC.TreeDepth = 0; window->DC.TreeDepthMayJumpToParentOnPop = 0x00; window->DC.StateStorage = &window->StateStorage; window->DC.GroupStack.resize(0); window->MenuColumns.Update(3, style.ItemSpacing.x, window_just_activated_by_user); if ((flags & ImGuiWindowFlags_ChildWindow) && (window->DC.ItemFlags != parent_window->DC.ItemFlags)) { window->DC.ItemFlags = parent_window->DC.ItemFlags; window->DC.ItemFlagsStack.push_back(window->DC.ItemFlags); } if (window->AutoFitFramesX > 0) window->AutoFitFramesX--; if (window->AutoFitFramesY > 0) window->AutoFitFramesY--; // Apply focus (we need to call FocusWindow() AFTER setting DC.CursorStartPos so our initial navigation reference rectangle can start around there) if (want_focus) { FocusWindow(window); NavInitWindow(window, false); } // Title bar if (!(flags & ImGuiWindowFlags_NoTitleBar)) { // Close & collapse button are on layer 1 (same as menus) and don't default focus const ImGuiItemFlags item_flags_backup = window->DC.ItemFlags; window->DC.ItemFlags |= ImGuiItemFlags_NoNavDefaultFocus; window->DC.NavLayerCurrent++; window->DC.NavLayerCurrentMask <<= 1; // Collapse button if (!(flags & ImGuiWindowFlags_NoCollapse)) { ImGuiID id = window->GetID("#COLLAPSE"); ImRect bb(window->Pos + style.FramePadding + ImVec2(1,1), window->Pos + style.FramePadding + ImVec2(g.FontSize,g.FontSize) - ImVec2(1,1)); ItemAdd(bb, id); // To allow navigation if (ButtonBehavior(bb, id, NULL, NULL)) window->CollapseToggleWanted = true; // Defer collapsing to next frame as we are too far in the Begin() function RenderNavHighlight(bb, id); RenderArrow(window->Pos + style.FramePadding, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f); } // Close button if (p_open != NULL) { const float pad = style.FramePadding.y; const float rad = g.FontSize * 0.5f; if (CloseButton(window->GetID("#CLOSE"), window->Rect().GetTR() + ImVec2(-pad - rad, pad + rad), rad + 1)) *p_open = false; } window->DC.NavLayerCurrent--; window->DC.NavLayerCurrentMask >>= 1; window->DC.ItemFlags = item_flags_backup; // Title text (FIXME: refactor text alignment facilities along with RenderText helpers) ImVec2 text_size = CalcTextSize(name, NULL, true); ImRect text_r = title_bar_rect; float pad_left = (flags & ImGuiWindowFlags_NoCollapse) == 0 ? (style.FramePadding.x + g.FontSize + style.ItemInnerSpacing.x) : style.FramePadding.x; float pad_right = (p_open != NULL) ? (style.FramePadding.x + g.FontSize + style.ItemInnerSpacing.x) : style.FramePadding.x; if (style.WindowTitleAlign.x > 0.0f) pad_right = ImLerp(pad_right, pad_left, style.WindowTitleAlign.x); text_r.Min.x += pad_left; text_r.Max.x -= pad_right; ImRect clip_rect = text_r; clip_rect.Max.x = window->Pos.x + window->Size.x - (p_open ? title_bar_rect.GetHeight() - 3 : style.FramePadding.x); // Match the size of CloseButton() RenderTextClipped(text_r.Min, text_r.Max, name, NULL, &text_size, style.WindowTitleAlign, &clip_rect); } // Save clipped aabb so we can access it in constant-time in FindHoveredWindow() window->WindowRectClipped = window->Rect(); window->WindowRectClipped.ClipWith(window->ClipRect); // Pressing CTRL+C while holding on a window copy its content to the clipboard // This works but 1. doesn't handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work that out and add better logging scope. // Maybe we can support CTRL+C on every element? /* if (g.ActiveId == move_id) if (g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_C)) ImGui::LogToClipboard(); */ // Inner rectangle // We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame // Note that if our window is collapsed we will end up with a null clipping rectangle which is the correct behavior. window->InnerRect.Min.x = title_bar_rect.Min.x + window->WindowBorderSize; window->InnerRect.Min.y = title_bar_rect.Max.y + window->MenuBarHeight() + (((flags & ImGuiWindowFlags_MenuBar) || !(flags & ImGuiWindowFlags_NoTitleBar)) ? style.FrameBorderSize : window->WindowBorderSize); window->InnerRect.Max.x = window->Pos.x + window->Size.x - window->ScrollbarSizes.x - window->WindowBorderSize; window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->ScrollbarSizes.y - window->WindowBorderSize; //window->DrawList->AddRect(window->InnerRect.Min, window->InnerRect.Max, IM_COL32_WHITE); // Inner clipping rectangle // Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result. window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + ImMax(0.0f, ImFloor(window->WindowPadding.x*0.5f - window->WindowBorderSize))); window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y); window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - ImMax(0.0f, ImFloor(window->WindowPadding.x*0.5f - window->WindowBorderSize))); window->InnerClipRect.Max.y = ImFloor(0.5f + window->InnerRect.Max.y); // After Begin() we fill the last item / hovered data using the title bar data. Make that a standard behavior (to allow usage of context menus on title bar only, etc.). window->DC.LastItemId = window->MoveId; window->DC.LastItemStatusFlags = IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0; window->DC.LastItemRect = title_bar_rect; } PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true); // Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused) if (first_begin_of_the_frame) window->WriteAccessed = false; window->BeginCount++; g.NextWindowData.SizeConstraintCond = 0; // Child window can be out of sight and have "negative" clip windows. // Mark them as collapsed so commands are skipped earlier (we can't manually collapse because they have no title bar). if (flags & ImGuiWindowFlags_ChildWindow) { IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0); window->Collapsed = parent_window && parent_window->Collapsed; if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) window->Collapsed |= (window->WindowRectClipped.Min.x >= window->WindowRectClipped.Max.x || window->WindowRectClipped.Min.y >= window->WindowRectClipped.Max.y); // We also hide the window from rendering because we've already added its border to the command list. // (we could perform the check earlier in the function but it is simpler at this point) if (window->Collapsed) window->Active = false; } if (style.Alpha <= 0.0f) window->Active = false; // Return false if we don't intend to display anything to allow user to perform an early out optimization window->SkipItems = (window->Collapsed || !window->Active) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0; return !window->SkipItems; } // Old Begin() API with 5 parameters, avoid calling this version directly! Use SetNextWindowSize()/SetNextWindowBgAlpha() + Begin() instead. #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_first_use, float bg_alpha_override, ImGuiWindowFlags flags) { // Old API feature: we could pass the initial window size as a parameter. This was misleading because it only had an effect if the window didn't have data in the .ini file. if (size_first_use.x != 0.0f || size_first_use.y != 0.0f) ImGui::SetNextWindowSize(size_first_use, ImGuiCond_FirstUseEver); // Old API feature: override the window background alpha with a parameter. if (bg_alpha_override >= 0.0f) ImGui::SetNextWindowBgAlpha(bg_alpha_override); return ImGui::Begin(name, p_open, flags); } #endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS void ImGui::End() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (window->DC.ColumnsSet != NULL) EndColumns(); PopClipRect(); // Inner window clip rectangle // Stop logging if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging LogFinish(); // Pop from window stack g.CurrentWindowStack.pop_back(); if (window->Flags & ImGuiWindowFlags_Popup) g.CurrentPopupStack.pop_back(); CheckStacksSize(window, false); SetCurrentWindow(g.CurrentWindowStack.empty() ? NULL : g.CurrentWindowStack.back()); } // Vertical scrollbar // The entire piece of code below is rather confusing because: // - We handle absolute seeking (when first clicking outside the grab) and relative manipulation (afterward or when clicking inside the grab) // - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar // - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal. void ImGui::Scrollbar(ImGuiLayoutType direction) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; const bool horizontal = (direction == ImGuiLayoutType_Horizontal); const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(horizontal ? "#SCROLLX" : "#SCROLLY"); // Render background bool other_scrollbar = (horizontal ? window->ScrollbarY : window->ScrollbarX); float other_scrollbar_size_w = other_scrollbar ? style.ScrollbarSize : 0.0f; const ImRect window_rect = window->Rect(); const float border_size = window->WindowBorderSize; ImRect bb = horizontal ? ImRect(window->Pos.x + border_size, window_rect.Max.y - style.ScrollbarSize, window_rect.Max.x - other_scrollbar_size_w - border_size, window_rect.Max.y - border_size) : ImRect(window_rect.Max.x - style.ScrollbarSize, window->Pos.y + border_size, window_rect.Max.x - border_size, window_rect.Max.y - other_scrollbar_size_w - border_size); if (!horizontal) bb.Min.y += window->TitleBarHeight() + ((window->Flags & ImGuiWindowFlags_MenuBar) ? window->MenuBarHeight() : 0.0f); if (bb.GetWidth() <= 0.0f || bb.GetHeight() <= 0.0f) return; int window_rounding_corners; if (horizontal) window_rounding_corners = ImDrawCornerFlags_BotLeft | (other_scrollbar ? 0 : ImDrawCornerFlags_BotRight); else window_rounding_corners = (((window->Flags & ImGuiWindowFlags_NoTitleBar) && !(window->Flags & ImGuiWindowFlags_MenuBar)) ? ImDrawCornerFlags_TopRight : 0) | (other_scrollbar ? 0 : ImDrawCornerFlags_BotRight); window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_ScrollbarBg), window->WindowRounding, window_rounding_corners); bb.Expand(ImVec2(-ImClamp((float)(int)((bb.Max.x - bb.Min.x - 2.0f) * 0.5f), 0.0f, 3.0f), -ImClamp((float)(int)((bb.Max.y - bb.Min.y - 2.0f) * 0.5f), 0.0f, 3.0f))); // V denote the main, longer axis of the scrollbar (= height for a vertical scrollbar) float scrollbar_size_v = horizontal ? bb.GetWidth() : bb.GetHeight(); float scroll_v = horizontal ? window->Scroll.x : window->Scroll.y; float win_size_avail_v = (horizontal ? window->SizeFull.x : window->SizeFull.y) - other_scrollbar_size_w; float win_size_contents_v = horizontal ? window->SizeContents.x : window->SizeContents.y; // Calculate the height of our grabbable box. It generally represent the amount visible (vs the total scrollable amount) // But we maintain a minimum size in pixel to allow for the user to still aim inside. IM_ASSERT(ImMax(win_size_contents_v, win_size_avail_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers. const float win_size_v = ImMax(ImMax(win_size_contents_v, win_size_avail_v), 1.0f); const float grab_h_pixels = ImClamp(scrollbar_size_v * (win_size_avail_v / win_size_v), style.GrabMinSize, scrollbar_size_v); const float grab_h_norm = grab_h_pixels / scrollbar_size_v; // Handle input right away. None of the code of Begin() is relying on scrolling position before calling Scrollbar(). bool held = false; bool hovered = false; const bool previously_held = (g.ActiveId == id); ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_NoNavFocus); float scroll_max = ImMax(1.0f, win_size_contents_v - win_size_avail_v); float scroll_ratio = ImSaturate(scroll_v / scroll_max); float grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; if (held && grab_h_norm < 1.0f) { float scrollbar_pos_v = horizontal ? bb.Min.x : bb.Min.y; float mouse_pos_v = horizontal ? g.IO.MousePos.x : g.IO.MousePos.y; float* click_delta_to_grab_center_v = horizontal ? &g.ScrollbarClickDeltaToGrabCenter.x : &g.ScrollbarClickDeltaToGrabCenter.y; // Click position in scrollbar normalized space (0.0f->1.0f) const float clicked_v_norm = ImSaturate((mouse_pos_v - scrollbar_pos_v) / scrollbar_size_v); SetHoveredID(id); bool seek_absolute = false; if (!previously_held) { // On initial click calculate the distance between mouse and the center of the grab if (clicked_v_norm >= grab_v_norm && clicked_v_norm <= grab_v_norm + grab_h_norm) { *click_delta_to_grab_center_v = clicked_v_norm - grab_v_norm - grab_h_norm*0.5f; } else { seek_absolute = true; *click_delta_to_grab_center_v = 0.0f; } } // Apply scroll // It is ok to modify Scroll here because we are being called in Begin() after the calculation of SizeContents and before setting up our starting position const float scroll_v_norm = ImSaturate((clicked_v_norm - *click_delta_to_grab_center_v - grab_h_norm*0.5f) / (1.0f - grab_h_norm)); scroll_v = (float)(int)(0.5f + scroll_v_norm * scroll_max);//(win_size_contents_v - win_size_v)); if (horizontal) window->Scroll.x = scroll_v; else window->Scroll.y = scroll_v; // Update values for rendering scroll_ratio = ImSaturate(scroll_v / scroll_max); grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; // Update distance to grab now that we have seeked and saturated if (seek_absolute) *click_delta_to_grab_center_v = clicked_v_norm - grab_v_norm - grab_h_norm*0.5f; } // Render const ImU32 grab_col = GetColorU32(held ? ImGuiCol_ScrollbarGrabActive : hovered ? ImGuiCol_ScrollbarGrabHovered : ImGuiCol_ScrollbarGrab); ImRect grab_rect; if (horizontal) grab_rect = ImRect(ImLerp(bb.Min.x, bb.Max.x, grab_v_norm), bb.Min.y, ImMin(ImLerp(bb.Min.x, bb.Max.x, grab_v_norm) + grab_h_pixels, window_rect.Max.x), bb.Max.y); else grab_rect = ImRect(bb.Min.x, ImLerp(bb.Min.y, bb.Max.y, grab_v_norm), bb.Max.x, ImMin(ImLerp(bb.Min.y, bb.Max.y, grab_v_norm) + grab_h_pixels, window_rect.Max.y)); window->DrawList->AddRectFilled(grab_rect.Min, grab_rect.Max, grab_col, style.ScrollbarRounding); } void ImGui::BringWindowToFront(ImGuiWindow* window) { ImGuiContext& g = *GImGui; ImGuiWindow* current_front_window = g.Windows.back(); if (current_front_window == window || current_front_window->RootWindow == window) return; for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the front most window if (g.Windows[i] == window) { g.Windows.erase(g.Windows.Data + i); g.Windows.push_back(window); break; } } void ImGui::BringWindowToBack(ImGuiWindow* window) { ImGuiContext& g = *GImGui; if (g.Windows[0] == window) return; for (int i = 0; i < g.Windows.Size; i++) if (g.Windows[i] == window) { memmove(&g.Windows[1], &g.Windows[0], (size_t)i * sizeof(ImGuiWindow*)); g.Windows[0] = window; break; } } // Moving window to front of display and set focus (which happens to be back of our sorted list) void ImGui::FocusWindow(ImGuiWindow* window) { ImGuiContext& g = *GImGui; if (g.NavWindow != window) { g.NavWindow = window; if (window && g.NavDisableMouseHover) g.NavMousePosDirty = true; g.NavInitRequest = false; g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId g.NavIdIsAlive = false; g.NavLayer = 0; //printf("[%05d] FocusWindow(\"%s\")\n", g.FrameCount, window ? window->Name : NULL); } // Passing NULL allow to disable keyboard focus if (!window) return; // Move the root window to the top of the pile if (window->RootWindow) window = window->RootWindow; // Steal focus on active widgets if (window->Flags & ImGuiWindowFlags_Popup) // FIXME: This statement should be unnecessary. Need further testing before removing it.. if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != window) ClearActiveID(); // Bring to front if (!(window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) BringWindowToFront(window); } void ImGui::FocusFrontMostActiveWindow(ImGuiWindow* ignore_window) { ImGuiContext& g = *GImGui; for (int i = g.Windows.Size - 1; i >= 0; i--) if (g.Windows[i] != ignore_window && g.Windows[i]->WasActive && !(g.Windows[i]->Flags & ImGuiWindowFlags_ChildWindow)) { ImGuiWindow* focus_window = NavRestoreLastChildNavWindow(g.Windows[i]); FocusWindow(focus_window); return; } } void ImGui::PushItemWidth(float item_width) { ImGuiWindow* window = GetCurrentWindow(); window->DC.ItemWidth = (item_width == 0.0f ? window->ItemWidthDefault : item_width); window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); } void ImGui::PushMultiItemsWidths(int components, float w_full) { ImGuiWindow* window = GetCurrentWindow(); const ImGuiStyle& style = GImGui->Style; if (w_full <= 0.0f) w_full = CalcItemWidth(); const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.ItemInnerSpacing.x) * (components-1)) / (float)components)); const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components-1))); window->DC.ItemWidthStack.push_back(w_item_last); for (int i = 0; i < components-1; i++) window->DC.ItemWidthStack.push_back(w_item_one); window->DC.ItemWidth = window->DC.ItemWidthStack.back(); } void ImGui::PopItemWidth() { ImGuiWindow* window = GetCurrentWindow(); window->DC.ItemWidthStack.pop_back(); window->DC.ItemWidth = window->DC.ItemWidthStack.empty() ? window->ItemWidthDefault : window->DC.ItemWidthStack.back(); } float ImGui::CalcItemWidth() { ImGuiWindow* window = GetCurrentWindowRead(); float w = window->DC.ItemWidth; if (w < 0.0f) { // Align to a right-side limit. We include 1 frame padding in the calculation because this is how the width is always used (we add 2 frame padding to it), but we could move that responsibility to the widget as well. float width_to_right_edge = GetContentRegionAvail().x; w = ImMax(1.0f, width_to_right_edge + w); } w = (float)(int)w; return w; } static ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; } void ImGui::SetCurrentFont(ImFont* font) { ImGuiContext& g = *GImGui; IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ? IM_ASSERT(font->Scale > 0.0f); g.Font = font; g.FontBaseSize = g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale; g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f; ImFontAtlas* atlas = g.Font->ContainerAtlas; g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel; g.DrawListSharedData.Font = g.Font; g.DrawListSharedData.FontSize = g.FontSize; } void ImGui::PushFont(ImFont* font) { ImGuiContext& g = *GImGui; if (!font) font = GetDefaultFont(); SetCurrentFont(font); g.FontStack.push_back(font); g.CurrentWindow->DrawList->PushTextureID(font->ContainerAtlas->TexID); } void ImGui::PopFont() { ImGuiContext& g = *GImGui; g.CurrentWindow->DrawList->PopTextureID(); g.FontStack.pop_back(); SetCurrentFont(g.FontStack.empty() ? GetDefaultFont() : g.FontStack.back()); } void ImGui::PushItemFlag(ImGuiItemFlags option, bool enabled) { ImGuiWindow* window = GetCurrentWindow(); if (enabled) window->DC.ItemFlags |= option; else window->DC.ItemFlags &= ~option; window->DC.ItemFlagsStack.push_back(window->DC.ItemFlags); } void ImGui::PopItemFlag() { ImGuiWindow* window = GetCurrentWindow(); window->DC.ItemFlagsStack.pop_back(); window->DC.ItemFlags = window->DC.ItemFlagsStack.empty() ? ImGuiItemFlags_Default_ : window->DC.ItemFlagsStack.back(); } void ImGui::PushAllowKeyboardFocus(bool allow_keyboard_focus) { PushItemFlag(ImGuiItemFlags_AllowKeyboardFocus, allow_keyboard_focus); } void ImGui::PopAllowKeyboardFocus() { PopItemFlag(); } void ImGui::PushButtonRepeat(bool repeat) { PushItemFlag(ImGuiItemFlags_ButtonRepeat, repeat); } void ImGui::PopButtonRepeat() { PopItemFlag(); } void ImGui::PushTextWrapPos(float wrap_pos_x) { ImGuiWindow* window = GetCurrentWindow(); window->DC.TextWrapPos = wrap_pos_x; window->DC.TextWrapPosStack.push_back(wrap_pos_x); } void ImGui::PopTextWrapPos() { ImGuiWindow* window = GetCurrentWindow(); window->DC.TextWrapPosStack.pop_back(); window->DC.TextWrapPos = window->DC.TextWrapPosStack.empty() ? -1.0f : window->DC.TextWrapPosStack.back(); } // FIXME: This may incur a round-trip (if the end user got their data from a float4) but eventually we aim to store the in-flight colors as ImU32 void ImGui::PushStyleColor(ImGuiCol idx, ImU32 col) { ImGuiContext& g = *GImGui; ImGuiColMod backup; backup.Col = idx; backup.BackupValue = g.Style.Colors[idx]; g.ColorModifiers.push_back(backup); g.Style.Colors[idx] = ColorConvertU32ToFloat4(col); } void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col) { ImGuiContext& g = *GImGui; ImGuiColMod backup; backup.Col = idx; backup.BackupValue = g.Style.Colors[idx]; g.ColorModifiers.push_back(backup); g.Style.Colors[idx] = col; } void ImGui::PopStyleColor(int count) { ImGuiContext& g = *GImGui; while (count > 0) { ImGuiColMod& backup = g.ColorModifiers.back(); g.Style.Colors[backup.Col] = backup.BackupValue; g.ColorModifiers.pop_back(); count--; } } struct ImGuiStyleVarInfo { ImGuiDataType Type; ImU32 Count; ImU32 Offset; void* GetVarPtr(ImGuiStyle* style) const { return (void*)((unsigned char*)style + Offset); } }; static const ImGuiStyleVarInfo GStyleVarInfo[] = { { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, Alpha) }, // ImGuiStyleVar_Alpha { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowPadding) }, // ImGuiStyleVar_WindowPadding { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowRounding) }, // ImGuiStyleVar_WindowRounding { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowBorderSize) }, // ImGuiStyleVar_WindowBorderSize { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowMinSize) }, // ImGuiStyleVar_WindowMinSize { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, WindowTitleAlign) }, // ImGuiStyleVar_WindowTitleAlign { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildRounding) }, // ImGuiStyleVar_ChildRounding { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ChildBorderSize) }, // ImGuiStyleVar_ChildBorderSize { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupRounding) }, // ImGuiStyleVar_PopupRounding { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, PopupBorderSize) }, // ImGuiStyleVar_PopupBorderSize { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, FramePadding) }, // ImGuiStyleVar_FramePadding { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameRounding) }, // ImGuiStyleVar_FrameRounding { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, FrameBorderSize) }, // ImGuiStyleVar_FrameBorderSize { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemSpacing) }, // ImGuiStyleVar_ItemSpacing { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ItemInnerSpacing) }, // ImGuiStyleVar_ItemInnerSpacing { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, IndentSpacing) }, // ImGuiStyleVar_IndentSpacing { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarSize) }, // ImGuiStyleVar_ScrollbarSize { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, ScrollbarRounding) }, // ImGuiStyleVar_ScrollbarRounding { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabMinSize) }, // ImGuiStyleVar_GrabMinSize { ImGuiDataType_Float, 1, (ImU32)IM_OFFSETOF(ImGuiStyle, GrabRounding) }, // ImGuiStyleVar_GrabRounding { ImGuiDataType_Float, 2, (ImU32)IM_OFFSETOF(ImGuiStyle, ButtonTextAlign) }, // ImGuiStyleVar_ButtonTextAlign }; static const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx) { IM_ASSERT(idx >= 0 && idx < ImGuiStyleVar_COUNT); IM_ASSERT(IM_ARRAYSIZE(GStyleVarInfo) == ImGuiStyleVar_COUNT); return &GStyleVarInfo[idx]; } void ImGui::PushStyleVar(ImGuiStyleVar idx, float val) { const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx); if (var_info->Type == ImGuiDataType_Float && var_info->Count == 1) { ImGuiContext& g = *GImGui; float* pvar = (float*)var_info->GetVarPtr(&g.Style); g.StyleModifiers.push_back(ImGuiStyleMod(idx, *pvar)); *pvar = val; return; } IM_ASSERT(0); // Called function with wrong-type? Variable is not a float. } void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val) { const ImGuiStyleVarInfo* var_info = GetStyleVarInfo(idx); if (var_info->Type == ImGuiDataType_Float && var_info->Count == 2) { ImGuiContext& g = *GImGui; ImVec2* pvar = (ImVec2*)var_info->GetVarPtr(&g.Style); g.StyleModifiers.push_back(ImGuiStyleMod(idx, *pvar)); *pvar = val; return; } IM_ASSERT(0); // Called function with wrong-type? Variable is not a ImVec2. } void ImGui::PopStyleVar(int count) { ImGuiContext& g = *GImGui; while (count > 0) { // We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the overhead in Debug is not worth it. ImGuiStyleMod& backup = g.StyleModifiers.back(); const ImGuiStyleVarInfo* info = GetStyleVarInfo(backup.VarIdx); void* data = info->GetVarPtr(&g.Style); if (info->Type == ImGuiDataType_Float && info->Count == 1) { ((float*)data)[0] = backup.BackupFloat[0]; } else if (info->Type == ImGuiDataType_Float && info->Count == 2) { ((float*)data)[0] = backup.BackupFloat[0]; ((float*)data)[1] = backup.BackupFloat[1]; } g.StyleModifiers.pop_back(); count--; } } const char* ImGui::GetStyleColorName(ImGuiCol idx) { // Create switch-case from enum with regexp: ImGuiCol_{.*}, --> case ImGuiCol_\1: return "\1"; switch (idx) { case ImGuiCol_Text: return "Text"; case ImGuiCol_TextDisabled: return "TextDisabled"; case ImGuiCol_WindowBg: return "WindowBg"; case ImGuiCol_ChildBg: return "ChildBg"; case ImGuiCol_PopupBg: return "PopupBg"; case ImGuiCol_Border: return "Border"; case ImGuiCol_BorderShadow: return "BorderShadow"; case ImGuiCol_FrameBg: return "FrameBg"; case ImGuiCol_FrameBgHovered: return "FrameBgHovered"; case ImGuiCol_FrameBgActive: return "FrameBgActive"; case ImGuiCol_TitleBg: return "TitleBg"; case ImGuiCol_TitleBgActive: return "TitleBgActive"; case ImGuiCol_TitleBgCollapsed: return "TitleBgCollapsed"; case ImGuiCol_MenuBarBg: return "MenuBarBg"; case ImGuiCol_ScrollbarBg: return "ScrollbarBg"; case ImGuiCol_ScrollbarGrab: return "ScrollbarGrab"; case ImGuiCol_ScrollbarGrabHovered: return "ScrollbarGrabHovered"; case ImGuiCol_ScrollbarGrabActive: return "ScrollbarGrabActive"; case ImGuiCol_CheckMark: return "CheckMark"; case ImGuiCol_SliderGrab: return "SliderGrab"; case ImGuiCol_SliderGrabActive: return "SliderGrabActive"; case ImGuiCol_Button: return "Button"; case ImGuiCol_ButtonHovered: return "ButtonHovered"; case ImGuiCol_ButtonActive: return "ButtonActive"; case ImGuiCol_Header: return "Header"; case ImGuiCol_HeaderHovered: return "HeaderHovered"; case ImGuiCol_HeaderActive: return "HeaderActive"; case ImGuiCol_Separator: return "Separator"; case ImGuiCol_SeparatorHovered: return "SeparatorHovered"; case ImGuiCol_SeparatorActive: return "SeparatorActive"; case ImGuiCol_ResizeGrip: return "ResizeGrip"; case ImGuiCol_ResizeGripHovered: return "ResizeGripHovered"; case ImGuiCol_ResizeGripActive: return "ResizeGripActive"; case ImGuiCol_PlotLines: return "PlotLines"; case ImGuiCol_PlotLinesHovered: return "PlotLinesHovered"; case ImGuiCol_PlotHistogram: return "PlotHistogram"; case ImGuiCol_PlotHistogramHovered: return "PlotHistogramHovered"; case ImGuiCol_TextSelectedBg: return "TextSelectedBg"; case ImGuiCol_ModalWindowDarkening: return "ModalWindowDarkening"; case ImGuiCol_DragDropTarget: return "DragDropTarget"; case ImGuiCol_NavHighlight: return "NavHighlight"; case ImGuiCol_NavWindowingHighlight: return "NavWindowingHighlight"; } IM_ASSERT(0); return "Unknown"; } bool ImGui::IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent) { if (window->RootWindow == potential_parent) return true; while (window != NULL) { if (window == potential_parent) return true; window = window->ParentWindow; } return false; } bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) { IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function ImGuiContext& g = *GImGui; if (flags & ImGuiHoveredFlags_AnyWindow) { if (g.HoveredWindow == NULL) return false; } else { switch (flags & (ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows)) { case ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows: if (g.HoveredRootWindow != g.CurrentWindow->RootWindow) return false; break; case ImGuiHoveredFlags_RootWindow: if (g.HoveredWindow != g.CurrentWindow->RootWindow) return false; break; case ImGuiHoveredFlags_ChildWindows: if (g.HoveredWindow == NULL || !IsWindowChildOf(g.HoveredWindow, g.CurrentWindow)) return false; break; default: if (g.HoveredWindow != g.CurrentWindow) return false; break; } } if (!IsWindowContentHoverable(g.HoveredRootWindow, flags)) return false; if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap && g.ActiveId != g.HoveredWindow->MoveId) return false; return true; } bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags) { ImGuiContext& g = *GImGui; IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End() if (flags & ImGuiFocusedFlags_AnyWindow) return g.NavWindow != NULL; switch (flags & (ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows)) { case ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows: return g.NavWindow && g.NavWindow->RootWindow == g.CurrentWindow->RootWindow; case ImGuiFocusedFlags_RootWindow: return g.NavWindow == g.CurrentWindow->RootWindow; case ImGuiFocusedFlags_ChildWindows: return g.NavWindow && IsWindowChildOf(g.NavWindow, g.CurrentWindow); default: return g.NavWindow == g.CurrentWindow; } } // Can we focus this window with CTRL+TAB (or PadMenu + PadFocusPrev/PadFocusNext) bool ImGui::IsWindowNavFocusable(ImGuiWindow* window) { ImGuiContext& g = *GImGui; return window->Active && window == window->RootWindowForTabbing && (!(window->Flags & ImGuiWindowFlags_NoNavFocus) || window == g.NavWindow); } float ImGui::GetWindowWidth() { ImGuiWindow* window = GImGui->CurrentWindow; return window->Size.x; } float ImGui::GetWindowHeight() { ImGuiWindow* window = GImGui->CurrentWindow; return window->Size.y; } ImVec2 ImGui::GetWindowPos() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; return window->Pos; } static void SetWindowScrollX(ImGuiWindow* window, float new_scroll_x) { window->DC.CursorMaxPos.x += window->Scroll.x; // SizeContents is generally computed based on CursorMaxPos which is affected by scroll position, so we need to apply our change to it. window->Scroll.x = new_scroll_x; window->DC.CursorMaxPos.x -= window->Scroll.x; } static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y) { window->DC.CursorMaxPos.y += window->Scroll.y; // SizeContents is generally computed based on CursorMaxPos which is affected by scroll position, so we need to apply our change to it. window->Scroll.y = new_scroll_y; window->DC.CursorMaxPos.y -= window->Scroll.y; } static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond) { // Test condition (NB: bit 0 is always true) and clear flags for next time if (cond && (window->SetWindowPosAllowFlags & cond) == 0) return; IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. window->SetWindowPosAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); window->SetWindowPosVal = ImVec2(FLT_MAX, FLT_MAX); // Set const ImVec2 old_pos = window->Pos; window->PosFloat = pos; window->Pos = ImFloor(pos); window->DC.CursorPos += (window->Pos - old_pos); // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor window->DC.CursorMaxPos += (window->Pos - old_pos); // And more importantly we need to adjust this so size calculation doesn't get affected. } void ImGui::SetWindowPos(const ImVec2& pos, ImGuiCond cond) { ImGuiWindow* window = GetCurrentWindowRead(); SetWindowPos(window, pos, cond); } void ImGui::SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond) { if (ImGuiWindow* window = FindWindowByName(name)) SetWindowPos(window, pos, cond); } ImVec2 ImGui::GetWindowSize() { ImGuiWindow* window = GetCurrentWindowRead(); return window->Size; } static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond) { // Test condition (NB: bit 0 is always true) and clear flags for next time if (cond && (window->SetWindowSizeAllowFlags & cond) == 0) return; IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); // Set if (size.x > 0.0f) { window->AutoFitFramesX = 0; window->SizeFull.x = size.x; } else { window->AutoFitFramesX = 2; window->AutoFitOnlyGrows = false; } if (size.y > 0.0f) { window->AutoFitFramesY = 0; window->SizeFull.y = size.y; } else { window->AutoFitFramesY = 2; window->AutoFitOnlyGrows = false; } } void ImGui::SetWindowSize(const ImVec2& size, ImGuiCond cond) { SetWindowSize(GImGui->CurrentWindow, size, cond); } void ImGui::SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond) { if (ImGuiWindow* window = FindWindowByName(name)) SetWindowSize(window, size, cond); } static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond) { // Test condition (NB: bit 0 is always true) and clear flags for next time if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0) return; window->SetWindowCollapsedAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing); // Set window->Collapsed = collapsed; } void ImGui::SetWindowCollapsed(bool collapsed, ImGuiCond cond) { SetWindowCollapsed(GImGui->CurrentWindow, collapsed, cond); } bool ImGui::IsWindowCollapsed() { ImGuiWindow* window = GetCurrentWindowRead(); return window->Collapsed; } bool ImGui::IsWindowAppearing() { ImGuiWindow* window = GetCurrentWindowRead(); return window->Appearing; } void ImGui::SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond) { if (ImGuiWindow* window = FindWindowByName(name)) SetWindowCollapsed(window, collapsed, cond); } void ImGui::SetWindowFocus() { FocusWindow(GImGui->CurrentWindow); } void ImGui::SetWindowFocus(const char* name) { if (name) { if (ImGuiWindow* window = FindWindowByName(name)) FocusWindow(window); } else { FocusWindow(NULL); } } void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiCond cond, const ImVec2& pivot) { ImGuiContext& g = *GImGui; IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. g.NextWindowData.PosVal = pos; g.NextWindowData.PosPivotVal = pivot; g.NextWindowData.PosCond = cond ? cond : ImGuiCond_Always; } void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiCond cond) { ImGuiContext& g = *GImGui; IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. g.NextWindowData.SizeVal = size; g.NextWindowData.SizeCond = cond ? cond : ImGuiCond_Always; } void ImGui::SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback, void* custom_callback_user_data) { ImGuiContext& g = *GImGui; g.NextWindowData.SizeConstraintCond = ImGuiCond_Always; g.NextWindowData.SizeConstraintRect = ImRect(size_min, size_max); g.NextWindowData.SizeCallback = custom_callback; g.NextWindowData.SizeCallbackUserData = custom_callback_user_data; } void ImGui::SetNextWindowContentSize(const ImVec2& size) { ImGuiContext& g = *GImGui; g.NextWindowData.ContentSizeVal = size; // In Begin() we will add the size of window decorations (title bar, menu etc.) to that to form a SizeContents value. g.NextWindowData.ContentSizeCond = ImGuiCond_Always; } void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiCond cond) { ImGuiContext& g = *GImGui; IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags. g.NextWindowData.CollapsedVal = collapsed; g.NextWindowData.CollapsedCond = cond ? cond : ImGuiCond_Always; } void ImGui::SetNextWindowFocus() { ImGuiContext& g = *GImGui; g.NextWindowData.FocusCond = ImGuiCond_Always; // Using a Cond member for consistency (may transition all of them to single flag set for fast Clear() op) } void ImGui::SetNextWindowBgAlpha(float alpha) { ImGuiContext& g = *GImGui; g.NextWindowData.BgAlphaVal = alpha; g.NextWindowData.BgAlphaCond = ImGuiCond_Always; // Using a Cond member for consistency (may transition all of them to single flag set for fast Clear() op) } // In window space (not screen space!) ImVec2 ImGui::GetContentRegionMax() { ImGuiWindow* window = GetCurrentWindowRead(); ImVec2 mx = window->ContentsRegionRect.Max; if (window->DC.ColumnsSet) mx.x = GetColumnOffset(window->DC.ColumnsSet->Current + 1) - window->WindowPadding.x; return mx; } ImVec2 ImGui::GetContentRegionAvail() { ImGuiWindow* window = GetCurrentWindowRead(); return GetContentRegionMax() - (window->DC.CursorPos - window->Pos); } float ImGui::GetContentRegionAvailWidth() { return GetContentRegionAvail().x; } // In window space (not screen space!) ImVec2 ImGui::GetWindowContentRegionMin() { ImGuiWindow* window = GetCurrentWindowRead(); return window->ContentsRegionRect.Min; } ImVec2 ImGui::GetWindowContentRegionMax() { ImGuiWindow* window = GetCurrentWindowRead(); return window->ContentsRegionRect.Max; } float ImGui::GetWindowContentRegionWidth() { ImGuiWindow* window = GetCurrentWindowRead(); return window->ContentsRegionRect.Max.x - window->ContentsRegionRect.Min.x; } float ImGui::GetTextLineHeight() { ImGuiContext& g = *GImGui; return g.FontSize; } float ImGui::GetTextLineHeightWithSpacing() { ImGuiContext& g = *GImGui; return g.FontSize + g.Style.ItemSpacing.y; } float ImGui::GetFrameHeight() { ImGuiContext& g = *GImGui; return g.FontSize + g.Style.FramePadding.y * 2.0f; } float ImGui::GetFrameHeightWithSpacing() { ImGuiContext& g = *GImGui; return g.FontSize + g.Style.FramePadding.y * 2.0f + g.Style.ItemSpacing.y; } ImDrawList* ImGui::GetWindowDrawList() { ImGuiWindow* window = GetCurrentWindow(); return window->DrawList; } ImFont* ImGui::GetFont() { return GImGui->Font; } float ImGui::GetFontSize() { return GImGui->FontSize; } ImVec2 ImGui::GetFontTexUvWhitePixel() { return GImGui->DrawListSharedData.TexUvWhitePixel; } void ImGui::SetWindowFontScale(float scale) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); window->FontWindowScale = scale; g.FontSize = g.DrawListSharedData.FontSize = window->CalcFontSize(); } // User generally sees positions in window coordinates. Internally we store CursorPos in absolute screen coordinates because it is more convenient. // Conversion happens as we pass the value to user, but it makes our naming convention confusing because GetCursorPos() == (DC.CursorPos - window.Pos). May want to rename 'DC.CursorPos'. ImVec2 ImGui::GetCursorPos() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.CursorPos - window->Pos + window->Scroll; } float ImGui::GetCursorPosX() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.CursorPos.x - window->Pos.x + window->Scroll.x; } float ImGui::GetCursorPosY() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.CursorPos.y - window->Pos.y + window->Scroll.y; } void ImGui::SetCursorPos(const ImVec2& local_pos) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos = window->Pos - window->Scroll + local_pos; window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); } void ImGui::SetCursorPosX(float x) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + x; window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x); } void ImGui::SetCursorPosY(float y) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos.y = window->Pos.y - window->Scroll.y + y; window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y); } ImVec2 ImGui::GetCursorStartPos() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.CursorStartPos - window->Pos; } ImVec2 ImGui::GetCursorScreenPos() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.CursorPos; } void ImGui::SetCursorScreenPos(const ImVec2& screen_pos) { ImGuiWindow* window = GetCurrentWindow(); window->DC.CursorPos = screen_pos; window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos); } float ImGui::GetScrollX() { return GImGui->CurrentWindow->Scroll.x; } float ImGui::GetScrollY() { return GImGui->CurrentWindow->Scroll.y; } float ImGui::GetScrollMaxX() { return GetScrollMaxX(GImGui->CurrentWindow); } float ImGui::GetScrollMaxY() { return GetScrollMaxY(GImGui->CurrentWindow); } void ImGui::SetScrollX(float scroll_x) { ImGuiWindow* window = GetCurrentWindow(); window->ScrollTarget.x = scroll_x; window->ScrollTargetCenterRatio.x = 0.0f; } void ImGui::SetScrollY(float scroll_y) { ImGuiWindow* window = GetCurrentWindow(); window->ScrollTarget.y = scroll_y + window->TitleBarHeight() + window->MenuBarHeight(); // title bar height canceled out when using ScrollTargetRelY window->ScrollTargetCenterRatio.y = 0.0f; } void ImGui::SetScrollFromPosY(float pos_y, float center_y_ratio) { // We store a target position so centering can occur on the next frame when we are guaranteed to have a known window size ImGuiWindow* window = GetCurrentWindow(); IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f); window->ScrollTarget.y = (float)(int)(pos_y + window->Scroll.y); window->ScrollTargetCenterRatio.y = center_y_ratio; // Minor hack to to make scrolling to top/bottom of window take account of WindowPadding, it looks more right to the user this way if (center_y_ratio <= 0.0f && window->ScrollTarget.y <= window->WindowPadding.y) window->ScrollTarget.y = 0.0f; else if (center_y_ratio >= 1.0f && window->ScrollTarget.y >= window->SizeContents.y - window->WindowPadding.y + GImGui->Style.ItemSpacing.y) window->ScrollTarget.y = window->SizeContents.y; } // center_y_ratio: 0.0f top of last item, 0.5f vertical center of last item, 1.0f bottom of last item. void ImGui::SetScrollHere(float center_y_ratio) { ImGuiWindow* window = GetCurrentWindow(); float target_y = window->DC.CursorPosPrevLine.y - window->Pos.y; // Top of last item, in window space target_y += (window->DC.PrevLineHeight * center_y_ratio) + (GImGui->Style.ItemSpacing.y * (center_y_ratio - 0.5f) * 2.0f); // Precisely aim above, in the middle or below the last line. SetScrollFromPosY(target_y, center_y_ratio); } void ImGui::ActivateItem(ImGuiID id) { ImGuiContext& g = *GImGui; g.NavNextActivateId = id; } void ImGui::SetKeyboardFocusHere(int offset) { IM_ASSERT(offset >= -1); // -1 is allowed but not below ImGuiWindow* window = GetCurrentWindow(); window->FocusIdxAllRequestNext = window->FocusIdxAllCounter + 1 + offset; window->FocusIdxTabRequestNext = INT_MAX; } void ImGui::SetItemDefaultFocus() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (!window->Appearing) return; if (g.NavWindow == window->RootWindowForNav && (g.NavInitRequest || g.NavInitResultId != 0) && g.NavLayer == g.NavWindow->DC.NavLayerCurrent) { g.NavInitRequest = false; g.NavInitResultId = g.NavWindow->DC.LastItemId; g.NavInitResultRectRel = ImRect(g.NavWindow->DC.LastItemRect.Min - g.NavWindow->Pos, g.NavWindow->DC.LastItemRect.Max - g.NavWindow->Pos); NavUpdateAnyRequestFlag(); if (!IsItemVisible()) SetScrollHere(); } } void ImGui::SetStateStorage(ImGuiStorage* tree) { ImGuiWindow* window = GetCurrentWindow(); window->DC.StateStorage = tree ? tree : &window->StateStorage; } ImGuiStorage* ImGui::GetStateStorage() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.StateStorage; } void ImGui::TextV(const char* fmt, va_list args) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; const char* text_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); TextUnformatted(g.TempBuffer, text_end); } void ImGui::Text(const char* fmt, ...) { va_list args; va_start(args, fmt); TextV(fmt, args); va_end(args); } void ImGui::TextColoredV(const ImVec4& col, const char* fmt, va_list args) { PushStyleColor(ImGuiCol_Text, col); TextV(fmt, args); PopStyleColor(); } void ImGui::TextColored(const ImVec4& col, const char* fmt, ...) { va_list args; va_start(args, fmt); TextColoredV(col, fmt, args); va_end(args); } void ImGui::TextDisabledV(const char* fmt, va_list args) { PushStyleColor(ImGuiCol_Text, GImGui->Style.Colors[ImGuiCol_TextDisabled]); TextV(fmt, args); PopStyleColor(); } void ImGui::TextDisabled(const char* fmt, ...) { va_list args; va_start(args, fmt); TextDisabledV(fmt, args); va_end(args); } void ImGui::TextWrappedV(const char* fmt, va_list args) { bool need_wrap = (GImGui->CurrentWindow->DC.TextWrapPos < 0.0f); // Keep existing wrap position is one ia already set if (need_wrap) PushTextWrapPos(0.0f); TextV(fmt, args); if (need_wrap) PopTextWrapPos(); } void ImGui::TextWrapped(const char* fmt, ...) { va_list args; va_start(args, fmt); TextWrappedV(fmt, args); va_end(args); } void ImGui::TextUnformatted(const char* text, const char* text_end) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; IM_ASSERT(text != NULL); const char* text_begin = text; if (text_end == NULL) text_end = text + strlen(text); // FIXME-OPT const ImVec2 text_pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrentLineTextBaseOffset); const float wrap_pos_x = window->DC.TextWrapPos; const bool wrap_enabled = wrap_pos_x >= 0.0f; if (text_end - text > 2000 && !wrap_enabled) { // Long text! // Perform manual coarse clipping to optimize for long multi-line text // From this point we will only compute the width of lines that are visible. Optimization only available when word-wrapping is disabled. // We also don't vertically center the text within the line full height, which is unlikely to matter because we are likely the biggest and only item on the line. const char* line = text; const float line_height = GetTextLineHeight(); const ImRect clip_rect = window->ClipRect; ImVec2 text_size(0,0); if (text_pos.y <= clip_rect.Max.y) { ImVec2 pos = text_pos; // Lines to skip (can't skip when logging text) if (!g.LogEnabled) { int lines_skippable = (int)((clip_rect.Min.y - text_pos.y) / line_height); if (lines_skippable > 0) { int lines_skipped = 0; while (line < text_end && lines_skipped < lines_skippable) { const char* line_end = strchr(line, '\n'); if (!line_end) line_end = text_end; line = line_end + 1; lines_skipped++; } pos.y += lines_skipped * line_height; } } // Lines to render if (line < text_end) { ImRect line_rect(pos, pos + ImVec2(FLT_MAX, line_height)); while (line < text_end) { const char* line_end = strchr(line, '\n'); if (IsClippedEx(line_rect, 0, false)) break; const ImVec2 line_size = CalcTextSize(line, line_end, false); text_size.x = ImMax(text_size.x, line_size.x); RenderText(pos, line, line_end, false); if (!line_end) line_end = text_end; line = line_end + 1; line_rect.Min.y += line_height; line_rect.Max.y += line_height; pos.y += line_height; } // Count remaining lines int lines_skipped = 0; while (line < text_end) { const char* line_end = strchr(line, '\n'); if (!line_end) line_end = text_end; line = line_end + 1; lines_skipped++; } pos.y += lines_skipped * line_height; } text_size.y += (pos - text_pos).y; } ImRect bb(text_pos, text_pos + text_size); ItemSize(bb); ItemAdd(bb, 0); } else { const float wrap_width = wrap_enabled ? CalcWrapWidthForPos(window->DC.CursorPos, wrap_pos_x) : 0.0f; const ImVec2 text_size = CalcTextSize(text_begin, text_end, false, wrap_width); // Account of baseline offset ImRect bb(text_pos, text_pos + text_size); ItemSize(text_size); if (!ItemAdd(bb, 0)) return; // Render (we don't hide text after ## in this end-user function) RenderTextWrapped(bb.Min, text_begin, text_end, wrap_width); } } void ImGui::AlignTextToFramePadding() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; window->DC.CurrentLineHeight = ImMax(window->DC.CurrentLineHeight, g.FontSize + g.Style.FramePadding.y * 2); window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.CurrentLineTextBaseOffset, g.Style.FramePadding.y); } // Add a label+text combo aligned to other label+value widgets void ImGui::LabelTextV(const char* label, const char* fmt, va_list args) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const float w = CalcItemWidth(); const ImVec2 label_size = CalcTextSize(label, NULL, true); const ImRect value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2)); const ImRect total_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + (label_size.x > 0.0f ? style.ItemInnerSpacing.x : 0.0f), style.FramePadding.y*2) + label_size); ItemSize(total_bb, style.FramePadding.y); if (!ItemAdd(total_bb, 0)) return; // Render const char* value_text_begin = &g.TempBuffer[0]; const char* value_text_end = value_text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); RenderTextClipped(value_bb.Min, value_bb.Max, value_text_begin, value_text_end, NULL, ImVec2(0.0f,0.5f)); if (label_size.x > 0.0f) RenderText(ImVec2(value_bb.Max.x + style.ItemInnerSpacing.x, value_bb.Min.y + style.FramePadding.y), label); } void ImGui::LabelText(const char* label, const char* fmt, ...) { va_list args; va_start(args, fmt); LabelTextV(label, fmt, args); va_end(args); } bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); if (flags & ImGuiButtonFlags_Disabled) { if (out_hovered) *out_hovered = false; if (out_held) *out_held = false; if (g.ActiveId == id) ClearActiveID(); return false; } // Default behavior requires click+release on same spot if ((flags & (ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick)) == 0) flags |= ImGuiButtonFlags_PressedOnClickRelease; ImGuiWindow* backup_hovered_window = g.HoveredWindow; if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window) g.HoveredWindow = window; bool pressed = false; bool hovered = ItemHoverable(bb, id); // Special mode for Drag and Drop where holding button pressed for a long time while dragging another item triggers the button if ((flags & ImGuiButtonFlags_PressedOnDragDropHold) && g.DragDropActive && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoHoldToOpenOthers)) if (IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) { hovered = true; SetHoveredID(id); if (CalcTypematicPressedRepeatAmount(g.HoveredIdTimer + 0.0001f, g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, 0.01f, 0.70f)) // FIXME: Our formula for CalcTypematicPressedRepeatAmount() is fishy { pressed = true; FocusWindow(window); } } if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window) g.HoveredWindow = backup_hovered_window; // AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match. This allows using patterns where a later submitted widget overlaps a previous one. if (hovered && (flags & ImGuiButtonFlags_AllowItemOverlap) && (g.HoveredIdPreviousFrame != id && g.HoveredIdPreviousFrame != 0)) hovered = false; // Mouse if (hovered) { if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt)) { // | CLICKING | HOLDING with ImGuiButtonFlags_Repeat // PressedOnClickRelease | * | .. (NOT on release) <-- MOST COMMON! (*) only if both click/release were over bounds // PressedOnClick | | .. // PressedOnRelease | | .. (NOT on release) // PressedOnDoubleClick | | .. // FIXME-NAV: We don't honor those different behaviors. if ((flags & ImGuiButtonFlags_PressedOnClickRelease) && g.IO.MouseClicked[0]) { SetActiveID(id, window); if (!(flags & ImGuiButtonFlags_NoNavFocus)) SetFocusID(id, window); FocusWindow(window); } if (((flags & ImGuiButtonFlags_PressedOnClick) && g.IO.MouseClicked[0]) || ((flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseDoubleClicked[0])) { pressed = true; if (flags & ImGuiButtonFlags_NoHoldingActiveID) ClearActiveID(); else SetActiveID(id, window); // Hold on ID FocusWindow(window); } if ((flags & ImGuiButtonFlags_PressedOnRelease) && g.IO.MouseReleased[0]) { if (!((flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[0] >= g.IO.KeyRepeatDelay)) // Repeat mode trumps pressed = true; ClearActiveID(); } // 'Repeat' mode acts when held regardless of _PressedOn flags (see table above). // Relies on repeat logic of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings. if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && g.IO.MouseDownDuration[0] > 0.0f && IsMouseClicked(0, true)) pressed = true; } if (pressed) g.NavDisableHighlight = true; } // Gamepad/Keyboard navigation // We report navigated item as hovered but we don't set g.HoveredId to not interfere with mouse. if (g.NavId == id && !g.NavDisableHighlight && g.NavDisableMouseHover && (g.ActiveId == 0 || g.ActiveId == id || g.ActiveId == window->MoveId)) hovered = true; if (g.NavActivateDownId == id) { bool nav_activated_by_code = (g.NavActivateId == id); bool nav_activated_by_inputs = IsNavInputPressed(ImGuiNavInput_Activate, (flags & ImGuiButtonFlags_Repeat) ? ImGuiInputReadMode_Repeat : ImGuiInputReadMode_Pressed); if (nav_activated_by_code || nav_activated_by_inputs) pressed = true; if (nav_activated_by_code || nav_activated_by_inputs || g.ActiveId == id) { // Set active id so it can be queried by user via IsItemActive(), equivalent of holding the mouse button. g.NavActivateId = id; // This is so SetActiveId assign a Nav source SetActiveID(id, window); if (!(flags & ImGuiButtonFlags_NoNavFocus)) SetFocusID(id, window); g.ActiveIdAllowNavDirFlags = (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right) | (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down); } } bool held = false; if (g.ActiveId == id) { if (g.ActiveIdSource == ImGuiInputSource_Mouse) { if (g.ActiveIdIsJustActivated) g.ActiveIdClickOffset = g.IO.MousePos - bb.Min; if (g.IO.MouseDown[0]) { held = true; } else { if (hovered && (flags & ImGuiButtonFlags_PressedOnClickRelease)) if (!((flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[0] >= g.IO.KeyRepeatDelay)) // Repeat mode trumps if (!g.DragDropActive) pressed = true; ClearActiveID(); } if (!(flags & ImGuiButtonFlags_NoNavFocus)) g.NavDisableHighlight = true; } else if (g.ActiveIdSource == ImGuiInputSource_Nav) { if (g.NavActivateDownId != id) ClearActiveID(); } } if (out_hovered) *out_hovered = hovered; if (out_held) *out_held = held; return pressed; } bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); ImVec2 pos = window->DC.CursorPos; if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrentLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag) pos.y += window->DC.CurrentLineTextBaseOffset - style.FramePadding.y; ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f); const ImRect bb(pos, pos + size); ItemSize(bb, style.FramePadding.y); if (!ItemAdd(bb, id)) return false; if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat) flags |= ImGuiButtonFlags_Repeat; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); // Render const ImU32 col = GetColorU32((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); RenderNavHighlight(bb, id); RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding); RenderTextClipped(bb.Min + style.FramePadding, bb.Max - style.FramePadding, label, NULL, &label_size, style.ButtonTextAlign, &bb); // Automatically close popups //if (pressed && !(flags & ImGuiButtonFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup)) // CloseCurrentPopup(); return pressed; } bool ImGui::Button(const char* label, const ImVec2& size_arg) { return ButtonEx(label, size_arg, 0); } // Small buttons fits within text without additional vertical spacing. bool ImGui::SmallButton(const char* label) { ImGuiContext& g = *GImGui; float backup_padding_y = g.Style.FramePadding.y; g.Style.FramePadding.y = 0.0f; bool pressed = ButtonEx(label, ImVec2(0,0), ImGuiButtonFlags_AlignTextBaseLine); g.Style.FramePadding.y = backup_padding_y; return pressed; } bool ImGui::ArrowButton(const char* str_id, ImGuiDir dir) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiID id = window->GetID(str_id); float sz = ImGui::GetFrameHeight(); const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(sz, sz)); ItemSize(bb); if (!ItemAdd(bb, id)) return false; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held); // Render const ImU32 col = GetColorU32((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); RenderNavHighlight(bb, id); RenderFrame(bb.Min, bb.Max, col, true, g.Style.FrameRounding); RenderArrow(bb.Min + g.Style.FramePadding, dir); return pressed; } // Tip: use ImGui::PushID()/PopID() to push indices or pointers in the ID stack. // Then you can keep 'str_id' empty or the same for all your buttons (instead of creating a string based on a non-string id) bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size_arg) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; const ImGuiID id = window->GetID(str_id); ImVec2 size = CalcItemSize(size_arg, 0.0f, 0.0f); const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); ItemSize(bb); if (!ItemAdd(bb, id)) return false; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held); return pressed; } // Button to close a window bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos, float radius) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; // We intentionally allow interaction when clipped so that a mechanical Alt,Right,Validate sequence close a window. // (this isn't the regular behavior of buttons, but it doesn't affect the user much because navigation tends to keep items visible). const ImRect bb(pos - ImVec2(radius,radius), pos + ImVec2(radius,radius)); bool is_clipped = !ItemAdd(bb, id); bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held); if (is_clipped) return pressed; // Render ImVec2 center = bb.GetCenter(); if (hovered) window->DrawList->AddCircleFilled(center, ImMax(2.0f, radius), GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered), 9); float cross_extent = (radius * 0.7071f) - 1.0f; ImU32 cross_col = GetColorU32(ImGuiCol_Text); center -= ImVec2(0.5f, 0.5f); window->DrawList->AddLine(center + ImVec2(+cross_extent,+cross_extent), center + ImVec2(-cross_extent,-cross_extent), cross_col, 1.0f); window->DrawList->AddLine(center + ImVec2(+cross_extent,-cross_extent), center + ImVec2(-cross_extent,+cross_extent), cross_col, 1.0f); return pressed; } void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); if (border_col.w > 0.0f) bb.Max += ImVec2(2,2); ItemSize(bb); if (!ItemAdd(bb, 0)) return; if (border_col.w > 0.0f) { window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f); window->DrawList->AddImage(user_texture_id, bb.Min+ImVec2(1,1), bb.Max-ImVec2(1,1), uv0, uv1, GetColorU32(tint_col)); } else { window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col)); } } // frame_padding < 0: uses FramePadding from style (default) // frame_padding = 0: no framing // frame_padding > 0: set framing size // The color used are the button colors. bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; // Default to using texture ID as ID. User can still push string/integer prefixes. // We could hash the size/uv to create a unique ID but that would prevent the user from animating UV. PushID((void *)user_texture_id); const ImGuiID id = window->GetID("#image"); PopID(); const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : style.FramePadding; const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding*2); const ImRect image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size); ItemSize(bb); if (!ItemAdd(bb, id)) return false; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held); // Render const ImU32 col = GetColorU32((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); RenderNavHighlight(bb, id); RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, style.FrameRounding)); if (bg_col.w > 0.0f) window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, GetColorU32(bg_col)); window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, GetColorU32(tint_col)); return pressed; } // Start logging ImGui output to TTY void ImGui::LogToTTY(int max_depth) { ImGuiContext& g = *GImGui; if (g.LogEnabled) return; ImGuiWindow* window = g.CurrentWindow; IM_ASSERT(g.LogFile == NULL); g.LogFile = stdout; g.LogEnabled = true; g.LogStartDepth = window->DC.TreeDepth; if (max_depth >= 0) g.LogAutoExpandMaxDepth = max_depth; } // Start logging ImGui output to given file void ImGui::LogToFile(int max_depth, const char* filename) { ImGuiContext& g = *GImGui; if (g.LogEnabled) return; ImGuiWindow* window = g.CurrentWindow; if (!filename) { filename = g.IO.LogFilename; if (!filename) return; } IM_ASSERT(g.LogFile == NULL); g.LogFile = ImFileOpen(filename, "ab"); if (!g.LogFile) { IM_ASSERT(g.LogFile != NULL); // Consider this an error return; } g.LogEnabled = true; g.LogStartDepth = window->DC.TreeDepth; if (max_depth >= 0) g.LogAutoExpandMaxDepth = max_depth; } // Start logging ImGui output to clipboard void ImGui::LogToClipboard(int max_depth) { ImGuiContext& g = *GImGui; if (g.LogEnabled) return; ImGuiWindow* window = g.CurrentWindow; IM_ASSERT(g.LogFile == NULL); g.LogFile = NULL; g.LogEnabled = true; g.LogStartDepth = window->DC.TreeDepth; if (max_depth >= 0) g.LogAutoExpandMaxDepth = max_depth; } void ImGui::LogFinish() { ImGuiContext& g = *GImGui; if (!g.LogEnabled) return; LogText(IM_NEWLINE); if (g.LogFile != NULL) { if (g.LogFile == stdout) fflush(g.LogFile); else fclose(g.LogFile); g.LogFile = NULL; } if (g.LogClipboard->size() > 1) { SetClipboardText(g.LogClipboard->begin()); g.LogClipboard->clear(); } g.LogEnabled = false; } // Helper to display logging buttons void ImGui::LogButtons() { ImGuiContext& g = *GImGui; PushID("LogButtons"); const bool log_to_tty = Button("Log To TTY"); SameLine(); const bool log_to_file = Button("Log To File"); SameLine(); const bool log_to_clipboard = Button("Log To Clipboard"); SameLine(); PushItemWidth(80.0f); PushAllowKeyboardFocus(false); SliderInt("Depth", &g.LogAutoExpandMaxDepth, 0, 9, NULL); PopAllowKeyboardFocus(); PopItemWidth(); PopID(); // Start logging at the end of the function so that the buttons don't appear in the log if (log_to_tty) LogToTTY(g.LogAutoExpandMaxDepth); if (log_to_file) LogToFile(g.LogAutoExpandMaxDepth, g.IO.LogFilename); if (log_to_clipboard) LogToClipboard(g.LogAutoExpandMaxDepth); } bool ImGui::TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags) { if (flags & ImGuiTreeNodeFlags_Leaf) return true; // We only write to the tree storage if the user clicks (or explicitely use SetNextTreeNode*** functions) ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; ImGuiStorage* storage = window->DC.StateStorage; bool is_open; if (g.NextTreeNodeOpenCond != 0) { if (g.NextTreeNodeOpenCond & ImGuiCond_Always) { is_open = g.NextTreeNodeOpenVal; storage->SetInt(id, is_open); } else { // We treat ImGuiCond_Once and ImGuiCond_FirstUseEver the same because tree node state are not saved persistently. const int stored_value = storage->GetInt(id, -1); if (stored_value == -1) { is_open = g.NextTreeNodeOpenVal; storage->SetInt(id, is_open); } else { is_open = stored_value != 0; } } g.NextTreeNodeOpenCond = 0; } else { is_open = storage->GetInt(id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0; } // When logging is enabled, we automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behavior). // NB- If we are above max depth we still allow manually opened nodes to be logged. if (g.LogEnabled && !(flags & ImGuiTreeNodeFlags_NoAutoOpenOnLog) && window->DC.TreeDepth < g.LogAutoExpandMaxDepth) is_open = true; return is_open; } bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const bool display_frame = (flags & ImGuiTreeNodeFlags_Framed) != 0; const ImVec2 padding = (display_frame || (flags & ImGuiTreeNodeFlags_FramePadding)) ? style.FramePadding : ImVec2(style.FramePadding.x, 0.0f); if (!label_end) label_end = FindRenderedTextEnd(label); const ImVec2 label_size = CalcTextSize(label, label_end, false); // We vertically grow up to current line height up the typical widget height. const float text_base_offset_y = ImMax(padding.y, window->DC.CurrentLineTextBaseOffset); // Latch before ItemSize changes it const float frame_height = ImMax(ImMin(window->DC.CurrentLineHeight, g.FontSize + style.FramePadding.y*2), label_size.y + padding.y*2); ImRect frame_bb = ImRect(window->DC.CursorPos, ImVec2(window->Pos.x + GetContentRegionMax().x, window->DC.CursorPos.y + frame_height)); if (display_frame) { // Framed header expand a little outside the default padding frame_bb.Min.x -= (float)(int)(window->WindowPadding.x*0.5f) - 1; frame_bb.Max.x += (float)(int)(window->WindowPadding.x*0.5f) - 1; } const float text_offset_x = (g.FontSize + (display_frame ? padding.x*3 : padding.x*2)); // Collapser arrow width + Spacing const float text_width = g.FontSize + (label_size.x > 0.0f ? label_size.x + padding.x*2 : 0.0f); // Include collapser ItemSize(ImVec2(text_width, frame_height), text_base_offset_y); // For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing // (Ideally we'd want to add a flag for the user to specify if we want the hit test to be done up to the right side of the content or not) const ImRect interact_bb = display_frame ? frame_bb : ImRect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + text_width + style.ItemSpacing.x*2, frame_bb.Max.y); bool is_open = TreeNodeBehaviorIsOpen(id, flags); // Store a flag for the current depth to tell if we will allow closing this node when navigating one of its child. // For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop(). // This is currently only support 32 level deep and we are fine with (1 << Depth) overflowing into a zero. if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) window->DC.TreeDepthMayJumpToParentOnPop |= (1 << window->DC.TreeDepth); bool item_add = ItemAdd(interact_bb, id); window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HasDisplayRect; window->DC.LastItemDisplayRect = frame_bb; if (!item_add) { if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) TreePushRawID(id); return is_open; } // Flags that affects opening behavior: // - 0(default) ..................... single-click anywhere to open // - OpenOnDoubleClick .............. double-click anywhere to open // - OpenOnArrow .................... single-click on arrow to open // - OpenOnDoubleClick|OpenOnArrow .. single-click on arrow or double-click anywhere to open ImGuiButtonFlags button_flags = ImGuiButtonFlags_NoKeyModifiers | ((flags & ImGuiTreeNodeFlags_AllowItemOverlap) ? ImGuiButtonFlags_AllowItemOverlap : 0); if (!(flags & ImGuiTreeNodeFlags_Leaf)) button_flags |= ImGuiButtonFlags_PressedOnDragDropHold; if (flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) button_flags |= ImGuiButtonFlags_PressedOnDoubleClick | ((flags & ImGuiTreeNodeFlags_OpenOnArrow) ? ImGuiButtonFlags_PressedOnClickRelease : 0); bool hovered, held, pressed = ButtonBehavior(interact_bb, id, &hovered, &held, button_flags); if (!(flags & ImGuiTreeNodeFlags_Leaf)) { bool toggled = false; if (pressed) { toggled = !(flags & (ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) || (g.NavActivateId == id); if (flags & ImGuiTreeNodeFlags_OpenOnArrow) toggled |= IsMouseHoveringRect(interact_bb.Min, ImVec2(interact_bb.Min.x + text_offset_x, interact_bb.Max.y)) && (!g.NavDisableMouseHover); if (flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) toggled |= g.IO.MouseDoubleClicked[0]; if (g.DragDropActive && is_open) // When using Drag and Drop "hold to open" we keep the node highlighted after opening, but never close it again. toggled = false; } if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Left && is_open) { toggled = true; NavMoveRequestCancel(); } if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Right && !is_open) // If there's something upcoming on the line we may want to give it the priority? { toggled = true; NavMoveRequestCancel(); } if (toggled) { is_open = !is_open; window->DC.StateStorage->SetInt(id, is_open); } } if (flags & ImGuiTreeNodeFlags_AllowItemOverlap) SetItemAllowOverlap(); // Render const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); const ImVec2 text_pos = frame_bb.Min + ImVec2(text_offset_x, text_base_offset_y); if (display_frame) { // Framed type RenderFrame(frame_bb.Min, frame_bb.Max, col, true, style.FrameRounding); RenderNavHighlight(frame_bb, id, ImGuiNavHighlightFlags_TypeThin); RenderArrow(frame_bb.Min + ImVec2(padding.x, text_base_offset_y), is_open ? ImGuiDir_Down : ImGuiDir_Right, 1.0f); if (g.LogEnabled) { // NB: '##' is normally used to hide text (as a library-wide feature), so we need to specify the text range to make sure the ## aren't stripped out here. const char log_prefix[] = "\n##"; const char log_suffix[] = "##"; LogRenderedText(&text_pos, log_prefix, log_prefix+3); RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size); LogRenderedText(&text_pos, log_suffix+1, log_suffix+3); } else { RenderTextClipped(text_pos, frame_bb.Max, label, label_end, &label_size); } } else { // Unframed typed for tree nodes if (hovered || (flags & ImGuiTreeNodeFlags_Selected)) { RenderFrame(frame_bb.Min, frame_bb.Max, col, false); RenderNavHighlight(frame_bb, id, ImGuiNavHighlightFlags_TypeThin); } if (flags & ImGuiTreeNodeFlags_Bullet) RenderBullet(frame_bb.Min + ImVec2(text_offset_x * 0.5f, g.FontSize*0.50f + text_base_offset_y)); else if (!(flags & ImGuiTreeNodeFlags_Leaf)) RenderArrow(frame_bb.Min + ImVec2(padding.x, g.FontSize*0.15f + text_base_offset_y), is_open ? ImGuiDir_Down : ImGuiDir_Right, 0.70f); if (g.LogEnabled) LogRenderedText(&text_pos, ">"); RenderText(text_pos, label, label_end, false); } if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) TreePushRawID(id); return is_open; } // CollapsingHeader returns true when opened but do not indent nor push into the ID stack (because of the ImGuiTreeNodeFlags_NoTreePushOnOpen flag). // This is basically the same as calling TreeNodeEx(label, ImGuiTreeNodeFlags_CollapsingHeader | ImGuiTreeNodeFlags_NoTreePushOnOpen). You can remove the _NoTreePushOnOpen flag if you want behavior closer to normal TreeNode(). bool ImGui::CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; return TreeNodeBehavior(window->GetID(label), flags | ImGuiTreeNodeFlags_CollapsingHeader | ImGuiTreeNodeFlags_NoTreePushOnOpen, label); } bool ImGui::CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; if (p_open && !*p_open) return false; ImGuiID id = window->GetID(label); bool is_open = TreeNodeBehavior(id, flags | ImGuiTreeNodeFlags_CollapsingHeader | ImGuiTreeNodeFlags_NoTreePushOnOpen | (p_open ? ImGuiTreeNodeFlags_AllowItemOverlap : 0), label); if (p_open) { // Create a small overlapping close button // FIXME: We can evolve this into user accessible helpers to add extra buttons on title bars, headers, etc. ImGuiContext& g = *GImGui; float button_sz = g.FontSize * 0.5f; ImGuiItemHoveredDataBackup last_item_backup; if (CloseButton(window->GetID((void*)(intptr_t)(id+1)), ImVec2(ImMin(window->DC.LastItemRect.Max.x, window->ClipRect.Max.x) - g.Style.FramePadding.x - button_sz, window->DC.LastItemRect.Min.y + g.Style.FramePadding.y + button_sz), button_sz)) *p_open = false; last_item_backup.Restore(); } return is_open; } bool ImGui::TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; return TreeNodeBehavior(window->GetID(label), flags, label, NULL); } bool ImGui::TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const char* label_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); return TreeNodeBehavior(window->GetID(str_id), flags, g.TempBuffer, label_end); } bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const char* label_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); return TreeNodeBehavior(window->GetID(ptr_id), flags, g.TempBuffer, label_end); } bool ImGui::TreeNodeV(const char* str_id, const char* fmt, va_list args) { return TreeNodeExV(str_id, 0, fmt, args); } bool ImGui::TreeNodeV(const void* ptr_id, const char* fmt, va_list args) { return TreeNodeExV(ptr_id, 0, fmt, args); } bool ImGui::TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) { va_list args; va_start(args, fmt); bool is_open = TreeNodeExV(str_id, flags, fmt, args); va_end(args); return is_open; } bool ImGui::TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) { va_list args; va_start(args, fmt); bool is_open = TreeNodeExV(ptr_id, flags, fmt, args); va_end(args); return is_open; } bool ImGui::TreeNode(const char* str_id, const char* fmt, ...) { va_list args; va_start(args, fmt); bool is_open = TreeNodeExV(str_id, 0, fmt, args); va_end(args); return is_open; } bool ImGui::TreeNode(const void* ptr_id, const char* fmt, ...) { va_list args; va_start(args, fmt); bool is_open = TreeNodeExV(ptr_id, 0, fmt, args); va_end(args); return is_open; } bool ImGui::TreeNode(const char* label) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; return TreeNodeBehavior(window->GetID(label), 0, label, NULL); } void ImGui::TreeAdvanceToLabelPos() { ImGuiContext& g = *GImGui; g.CurrentWindow->DC.CursorPos.x += GetTreeNodeToLabelSpacing(); } // Horizontal distance preceding label when using TreeNode() or Bullet() float ImGui::GetTreeNodeToLabelSpacing() { ImGuiContext& g = *GImGui; return g.FontSize + (g.Style.FramePadding.x * 2.0f); } void ImGui::SetNextTreeNodeOpen(bool is_open, ImGuiCond cond) { ImGuiContext& g = *GImGui; if (g.CurrentWindow->SkipItems) return; g.NextTreeNodeOpenVal = is_open; g.NextTreeNodeOpenCond = cond ? cond : ImGuiCond_Always; } void ImGui::PushID(const char* str_id) { ImGuiWindow* window = GetCurrentWindowRead(); window->IDStack.push_back(window->GetID(str_id)); } void ImGui::PushID(const char* str_id_begin, const char* str_id_end) { ImGuiWindow* window = GetCurrentWindowRead(); window->IDStack.push_back(window->GetID(str_id_begin, str_id_end)); } void ImGui::PushID(const void* ptr_id) { ImGuiWindow* window = GetCurrentWindowRead(); window->IDStack.push_back(window->GetID(ptr_id)); } void ImGui::PushID(int int_id) { const void* ptr_id = (void*)(intptr_t)int_id; ImGuiWindow* window = GetCurrentWindowRead(); window->IDStack.push_back(window->GetID(ptr_id)); } void ImGui::PopID() { ImGuiWindow* window = GetCurrentWindowRead(); window->IDStack.pop_back(); } ImGuiID ImGui::GetID(const char* str_id) { return GImGui->CurrentWindow->GetID(str_id); } ImGuiID ImGui::GetID(const char* str_id_begin, const char* str_id_end) { return GImGui->CurrentWindow->GetID(str_id_begin, str_id_end); } ImGuiID ImGui::GetID(const void* ptr_id) { return GImGui->CurrentWindow->GetID(ptr_id); } void ImGui::Bullet() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const float line_height = ImMax(ImMin(window->DC.CurrentLineHeight, g.FontSize + g.Style.FramePadding.y*2), g.FontSize); const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize, line_height)); ItemSize(bb); if (!ItemAdd(bb, 0)) { SameLine(0, style.FramePadding.x*2); return; } // Render and stay on same line RenderBullet(bb.Min + ImVec2(style.FramePadding.x + g.FontSize*0.5f, line_height*0.5f)); SameLine(0, style.FramePadding.x*2); } // Text with a little bullet aligned to the typical tree node. void ImGui::BulletTextV(const char* fmt, va_list args) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const char* text_begin = g.TempBuffer; const char* text_end = text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); const ImVec2 label_size = CalcTextSize(text_begin, text_end, false); const float text_base_offset_y = ImMax(0.0f, window->DC.CurrentLineTextBaseOffset); // Latch before ItemSize changes it const float line_height = ImMax(ImMin(window->DC.CurrentLineHeight, g.FontSize + g.Style.FramePadding.y*2), g.FontSize); const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x*2) : 0.0f), ImMax(line_height, label_size.y))); // Empty text doesn't add padding ItemSize(bb); if (!ItemAdd(bb, 0)) return; // Render RenderBullet(bb.Min + ImVec2(style.FramePadding.x + g.FontSize*0.5f, line_height*0.5f)); RenderText(bb.Min+ImVec2(g.FontSize + style.FramePadding.x*2, text_base_offset_y), text_begin, text_end, false); } void ImGui::BulletText(const char* fmt, ...) { va_list args; va_start(args, fmt); BulletTextV(fmt, args); va_end(args); } static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, const char* display_format, char* buf, int buf_size) { if (data_type == ImGuiDataType_Int) ImFormatString(buf, buf_size, display_format, *(int*)data_ptr); else if (data_type == ImGuiDataType_Float) ImFormatString(buf, buf_size, display_format, *(float*)data_ptr); else if (data_type == ImGuiDataType_Double) ImFormatString(buf, buf_size, display_format, *(double*)data_ptr); } static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, int decimal_precision, char* buf, int buf_size) { if (data_type == ImGuiDataType_Int) { if (decimal_precision < 0) ImFormatString(buf, buf_size, "%d", *(int*)data_ptr); else ImFormatString(buf, buf_size, "%.*d", decimal_precision, *(int*)data_ptr); } else if (data_type == ImGuiDataType_Float) { if (decimal_precision < 0) ImFormatString(buf, buf_size, "%f", *(float*)data_ptr); // Ideally we'd have a minimum decimal precision of 1 to visually denote that it is a float, while hiding non-significant digits? else ImFormatString(buf, buf_size, "%.*f", decimal_precision, *(float*)data_ptr); } else if (data_type == ImGuiDataType_Double) { if (decimal_precision < 0) ImFormatString(buf, buf_size, "%f", *(double*)data_ptr); else ImFormatString(buf, buf_size, "%.*f", decimal_precision, *(double*)data_ptr); } } static void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, void* arg1, const void* arg2) { IM_ASSERT(op == '+' || op == '-'); if (data_type == ImGuiDataType_Int) { if (op == '+') *(int*)output = *(int*)arg1 + *(const int*)arg2; else if (op == '-') *(int*)output = *(int*)arg1 - *(const int*)arg2; } else if (data_type == ImGuiDataType_Float) { if (op == '+') *(float*)output = *(float*)arg1 + *(const float*)arg2; else if (op == '-') *(float*)output = *(float*)arg1 - *(const float*)arg2; } else if (data_type == ImGuiDataType_Double) { if (op == '+') *(double*)output = *(double*)arg1 + *(const double*)arg2; else if (op == '-') *(double*)output = *(double*)arg1 - *(const double*)arg2; } } static size_t GDataTypeSize[ImGuiDataType_COUNT] = { sizeof(int), sizeof(float), sizeof(double) }; // User can input math operators (e.g. +100) to edit a numerical values. // NB: This is _not_ a full expression evaluator. We should probably add one though.. static bool DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* data_ptr, const char* scalar_format) { while (ImCharIsSpace((unsigned int)*buf)) buf++; // We don't support '-' op because it would conflict with inputing negative value. // Instead you can use +-100 to subtract from an existing value char op = buf[0]; if (op == '+' || op == '*' || op == '/') { buf++; while (ImCharIsSpace((unsigned int)*buf)) buf++; } else { op = 0; } if (!buf[0]) return false; IM_ASSERT(data_type < ImGuiDataType_COUNT); int data_backup[2]; IM_ASSERT(GDataTypeSize[data_type] <= sizeof(data_backup)); memcpy(data_backup, data_ptr, GDataTypeSize[data_type]); if (data_type == ImGuiDataType_Int) { if (!scalar_format) scalar_format = "%d"; int* v = (int*)data_ptr; int arg0i = *v; if (op && sscanf(initial_value_buf, scalar_format, &arg0i) < 1) return false; // Store operand in a float so we can use fractional value for multipliers (*1.1), but constant always parsed as integer so we can fit big integers (e.g. 2000000003) past float precision float arg1f = 0.0f; if (op == '+') { if (sscanf(buf, "%f", &arg1f) == 1) *v = (int)(arg0i + arg1f); } // Add (use "+-" to subtract) else if (op == '*') { if (sscanf(buf, "%f", &arg1f) == 1) *v = (int)(arg0i * arg1f); } // Multiply else if (op == '/') { if (sscanf(buf, "%f", &arg1f) == 1 && arg1f != 0.0f) *v = (int)(arg0i / arg1f); }// Divide else { if (sscanf(buf, scalar_format, &arg0i) == 1) *v = arg0i; } // Assign integer constant } else if (data_type == ImGuiDataType_Float) { // For floats we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in scalar_format = "%f"; float* v = (float*)data_ptr; float arg0f = *v, arg1f = 0.0f; if (op && sscanf(initial_value_buf, scalar_format, &arg0f) < 1) return false; if (sscanf(buf, scalar_format, &arg1f) < 1) return false; if (op == '+') { *v = arg0f + arg1f; } // Add (use "+-" to subtract) else if (op == '*') { *v = arg0f * arg1f; } // Multiply else if (op == '/') { if (arg1f != 0.0f) *v = arg0f / arg1f; } // Divide else { *v = arg1f; } // Assign constant } else if (data_type == ImGuiDataType_Double) { scalar_format = "%lf"; double* v = (double*)data_ptr; double arg0f = *v, arg1f = 0.0f; if (op && sscanf(initial_value_buf, scalar_format, &arg0f) < 1) return false; if (sscanf(buf, scalar_format, &arg1f) < 1) return false; if (op == '+') { *v = arg0f + arg1f; } // Add (use "+-" to subtract) else if (op == '*') { *v = arg0f * arg1f; } // Multiply else if (op == '/') { if (arg1f != 0.0f) *v = arg0f / arg1f; } // Divide else { *v = arg1f; } // Assign constant } return memcmp(data_backup, data_ptr, GDataTypeSize[data_type]) != 0; } // Create text input in place of a slider (when CTRL+Clicking on slider) // FIXME: Logic is messy and confusing. bool ImGui::InputScalarAsWidgetReplacement(const ImRect& aabb, const char* label, ImGuiDataType data_type, void* data_ptr, ImGuiID id, int decimal_precision) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); // Our replacement widget will override the focus ID (registered previously to allow for a TAB focus to happen) // On the first frame, g.ScalarAsInputTextId == 0, then on subsequent frames it becomes == id SetActiveID(g.ScalarAsInputTextId, window); g.ActiveIdAllowNavDirFlags = (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down); SetHoveredID(0); FocusableItemUnregister(window); char buf[32]; DataTypeFormatString(data_type, data_ptr, decimal_precision, buf, IM_ARRAYSIZE(buf)); bool text_value_changed = InputTextEx(label, buf, IM_ARRAYSIZE(buf), aabb.GetSize(), ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_AutoSelectAll); if (g.ScalarAsInputTextId == 0) // First frame we started displaying the InputText widget { IM_ASSERT(g.ActiveId == id); // InputText ID expected to match the Slider ID (else we'd need to store them both, which is also possible) g.ScalarAsInputTextId = g.ActiveId; SetHoveredID(id); } if (text_value_changed) return DataTypeApplyOpFromText(buf, GImGui->InputTextState.InitialText.begin(), data_type, data_ptr, NULL); return false; } // Parse display precision back from the display format string int ImGui::ParseFormatPrecision(const char* fmt, int default_precision) { int precision = default_precision; while ((fmt = strchr(fmt, '%')) != NULL) { fmt++; if (fmt[0] == '%') { fmt++; continue; } // Ignore "%%" while (*fmt >= '0' && *fmt <= '9') fmt++; if (*fmt == '.') { fmt = ImAtoi(fmt + 1, &precision); if (precision < 0 || precision > 10) precision = default_precision; } if (*fmt == 'e' || *fmt == 'E') // Maximum precision with scientific notation precision = -1; break; } return precision; } static float GetMinimumStepAtDecimalPrecision(int decimal_precision) { static const float min_steps[10] = { 1.0f, 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f, 0.00000001f, 0.000000001f }; return (decimal_precision >= 0 && decimal_precision < 10) ? min_steps[decimal_precision] : powf(10.0f, (float)-decimal_precision); } float ImGui::RoundScalar(float value, int decimal_precision) { // Round past decimal precision // So when our value is 1.99999 with a precision of 0.001 we'll end up rounding to 2.0 // FIXME: Investigate better rounding methods if (decimal_precision < 0) return value; const float min_step = GetMinimumStepAtDecimalPrecision(decimal_precision); bool negative = value < 0.0f; value = fabsf(value); float remainder = fmodf(value, min_step); if (remainder <= min_step*0.5f) value -= remainder; else value += (min_step - remainder); return negative ? -value : value; } static inline float SliderBehaviorCalcRatioFromValue(float v, float v_min, float v_max, float power, float linear_zero_pos) { if (v_min == v_max) return 0.0f; const bool is_non_linear = (power < 1.0f-0.00001f) || (power > 1.0f+0.00001f); const float v_clamped = (v_min < v_max) ? ImClamp(v, v_min, v_max) : ImClamp(v, v_max, v_min); if (is_non_linear) { if (v_clamped < 0.0f) { const float f = 1.0f - (v_clamped - v_min) / (ImMin(0.0f,v_max) - v_min); return (1.0f - powf(f, 1.0f/power)) * linear_zero_pos; } else { const float f = (v_clamped - ImMax(0.0f,v_min)) / (v_max - ImMax(0.0f,v_min)); return linear_zero_pos + powf(f, 1.0f/power) * (1.0f - linear_zero_pos); } } // Linear slider return (v_clamped - v_min) / (v_max - v_min); } bool ImGui::SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_min, float v_max, float power, int decimal_precision, ImGuiSliderFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); const ImGuiStyle& style = g.Style; // Draw frame const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); RenderNavHighlight(frame_bb, id); RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding); const bool is_non_linear = (power < 1.0f-0.00001f) || (power > 1.0f+0.00001f); const bool is_horizontal = (flags & ImGuiSliderFlags_Vertical) == 0; const float grab_padding = 2.0f; const float slider_sz = is_horizontal ? (frame_bb.GetWidth() - grab_padding * 2.0f) : (frame_bb.GetHeight() - grab_padding * 2.0f); float grab_sz; if (decimal_precision != 0) grab_sz = ImMin(style.GrabMinSize, slider_sz); else grab_sz = ImMin(ImMax(1.0f * (slider_sz / ((v_min < v_max ? v_max - v_min : v_min - v_max) + 1.0f)), style.GrabMinSize), slider_sz); // Integer sliders, if possible have the grab size represent 1 unit const float slider_usable_sz = slider_sz - grab_sz; const float slider_usable_pos_min = (is_horizontal ? frame_bb.Min.x : frame_bb.Min.y) + grab_padding + grab_sz*0.5f; const float slider_usable_pos_max = (is_horizontal ? frame_bb.Max.x : frame_bb.Max.y) - grab_padding - grab_sz*0.5f; // For logarithmic sliders that cross over sign boundary we want the exponential increase to be symmetric around 0.0f float linear_zero_pos = 0.0f; // 0.0->1.0f if (v_min * v_max < 0.0f) { // Different sign const float linear_dist_min_to_0 = powf(fabsf(0.0f - v_min), 1.0f/power); const float linear_dist_max_to_0 = powf(fabsf(v_max - 0.0f), 1.0f/power); linear_zero_pos = linear_dist_min_to_0 / (linear_dist_min_to_0+linear_dist_max_to_0); } else { // Same sign linear_zero_pos = v_min < 0.0f ? 1.0f : 0.0f; } // Process interacting with the slider bool value_changed = false; if (g.ActiveId == id) { bool set_new_value = false; float clicked_t = 0.0f; if (g.ActiveIdSource == ImGuiInputSource_Mouse) { if (!g.IO.MouseDown[0]) { ClearActiveID(); } else { const float mouse_abs_pos = is_horizontal ? g.IO.MousePos.x : g.IO.MousePos.y; clicked_t = (slider_usable_sz > 0.0f) ? ImClamp((mouse_abs_pos - slider_usable_pos_min) / slider_usable_sz, 0.0f, 1.0f) : 0.0f; if (!is_horizontal) clicked_t = 1.0f - clicked_t; set_new_value = true; } } else if (g.ActiveIdSource == ImGuiInputSource_Nav) { const ImVec2 delta2 = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard | ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_RepeatFast, 0.0f, 0.0f); float delta = is_horizontal ? delta2.x : -delta2.y; if (g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated) { ClearActiveID(); } else if (delta != 0.0f) { clicked_t = SliderBehaviorCalcRatioFromValue(*v, v_min, v_max, power, linear_zero_pos); if (decimal_precision == 0 && !is_non_linear) { if (fabsf(v_max - v_min) <= 100.0f || IsNavInputDown(ImGuiNavInput_TweakSlow)) delta = ((delta < 0.0f) ? -1.0f : +1.0f) / (v_max - v_min); // Gamepad/keyboard tweak speeds in integer steps else delta /= 100.0f; } else { delta /= 100.0f; // Gamepad/keyboard tweak speeds in % of slider bounds if (IsNavInputDown(ImGuiNavInput_TweakSlow)) delta /= 10.0f; } if (IsNavInputDown(ImGuiNavInput_TweakFast)) delta *= 10.0f; set_new_value = true; if ((clicked_t >= 1.0f && delta > 0.0f) || (clicked_t <= 0.0f && delta < 0.0f)) // This is to avoid applying the saturation when already past the limits set_new_value = false; else clicked_t = ImSaturate(clicked_t + delta); } } if (set_new_value) { float new_value; if (is_non_linear) { // Account for logarithmic scale on both sides of the zero if (clicked_t < linear_zero_pos) { // Negative: rescale to the negative range before powering float a = 1.0f - (clicked_t / linear_zero_pos); a = powf(a, power); new_value = ImLerp(ImMin(v_max,0.0f), v_min, a); } else { // Positive: rescale to the positive range before powering float a; if (fabsf(linear_zero_pos - 1.0f) > 1.e-6f) a = (clicked_t - linear_zero_pos) / (1.0f - linear_zero_pos); else a = clicked_t; a = powf(a, power); new_value = ImLerp(ImMax(v_min,0.0f), v_max, a); } } else { // Linear slider new_value = ImLerp(v_min, v_max, clicked_t); } // Round past decimal precision new_value = RoundScalar(new_value, decimal_precision); if (*v != new_value) { *v = new_value; value_changed = true; } } } // Draw float grab_t = SliderBehaviorCalcRatioFromValue(*v, v_min, v_max, power, linear_zero_pos); if (!is_horizontal) grab_t = 1.0f - grab_t; const float grab_pos = ImLerp(slider_usable_pos_min, slider_usable_pos_max, grab_t); ImRect grab_bb; if (is_horizontal) grab_bb = ImRect(ImVec2(grab_pos - grab_sz*0.5f, frame_bb.Min.y + grab_padding), ImVec2(grab_pos + grab_sz*0.5f, frame_bb.Max.y - grab_padding)); else grab_bb = ImRect(ImVec2(frame_bb.Min.x + grab_padding, grab_pos - grab_sz*0.5f), ImVec2(frame_bb.Max.x - grab_padding, grab_pos + grab_sz*0.5f)); window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, GetColorU32(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding); return value_changed; } // Use power!=1.0 for logarithmic sliders. // Adjust display_format to decorate the value with a prefix or a suffix. // "%.3f" 1.234 // "%5.2f secs" 01.23 secs // "Gold: %.0f" Gold: 1 bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format, float power) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const float w = CalcItemWidth(); const ImVec2 label_size = CalcTextSize(label, NULL, true); const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f)); const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); // NB- we don't call ItemSize() yet because we may turn into a text edit box below if (!ItemAdd(total_bb, id, &frame_bb)) { ItemSize(total_bb, style.FramePadding.y); return false; } const bool hovered = ItemHoverable(frame_bb, id); if (!display_format) display_format = "%.3f"; int decimal_precision = ParseFormatPrecision(display_format, 3); // Tabbing or CTRL-clicking on Slider turns it into an input box bool start_text_input = false; const bool tab_focus_requested = FocusableItemRegister(window, id); if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]) || g.NavActivateId == id || (g.NavInputId == id && g.ScalarAsInputTextId != id)) { SetActiveID(id, window); SetFocusID(id, window); FocusWindow(window); g.ActiveIdAllowNavDirFlags = (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down); if (tab_focus_requested || g.IO.KeyCtrl || g.NavInputId == id) { start_text_input = true; g.ScalarAsInputTextId = 0; } } if (start_text_input || (g.ActiveId == id && g.ScalarAsInputTextId == id)) return InputScalarAsWidgetReplacement(frame_bb, label, ImGuiDataType_Float, v, id, decimal_precision); // Actual slider behavior + render grab ItemSize(total_bb, style.FramePadding.y); const bool value_changed = SliderBehavior(frame_bb, id, v, v_min, v_max, power, decimal_precision); // Display value using user-provided display format so user can add prefix/suffix/decorations to the value. char value_buf[64]; const char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v); RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f,0.5f)); if (label_size.x > 0.0f) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); return value_changed; } bool ImGui::VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format, float power) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size); const ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); ItemSize(bb, style.FramePadding.y); if (!ItemAdd(frame_bb, id)) return false; const bool hovered = ItemHoverable(frame_bb, id); if (!display_format) display_format = "%.3f"; int decimal_precision = ParseFormatPrecision(display_format, 3); if ((hovered && g.IO.MouseClicked[0]) || g.NavActivateId == id || g.NavInputId == id) { SetActiveID(id, window); SetFocusID(id, window); FocusWindow(window); g.ActiveIdAllowNavDirFlags = (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right); } // Actual slider behavior + render grab bool value_changed = SliderBehavior(frame_bb, id, v, v_min, v_max, power, decimal_precision, ImGuiSliderFlags_Vertical); // Display value using user-provided display format so user can add prefix/suffix/decorations to the value. // For the vertical slider we allow centered text to overlap the frame padding char value_buf[64]; char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v); RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f,0.0f)); if (label_size.x > 0.0f) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); return value_changed; } bool ImGui::SliderAngle(const char* label, float* v_rad, float v_degrees_min, float v_degrees_max) { float v_deg = (*v_rad) * 360.0f / (2*IM_PI); bool value_changed = SliderFloat(label, &v_deg, v_degrees_min, v_degrees_max, "%.0f deg", 1.0f); *v_rad = v_deg * (2*IM_PI) / 360.0f; return value_changed; } bool ImGui::SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format) { if (!display_format) display_format = "%.0f"; float v_f = (float)*v; bool value_changed = SliderFloat(label, &v_f, (float)v_min, (float)v_max, display_format, 1.0f); *v = (int)v_f; return value_changed; } bool ImGui::VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format) { if (!display_format) display_format = "%.0f"; float v_f = (float)*v; bool value_changed = VSliderFloat(label, size, &v_f, (float)v_min, (float)v_max, display_format, 1.0f); *v = (int)v_f; return value_changed; } // Add multiple sliders on 1 line for compact edition of multiple components bool ImGui::SliderFloatN(const char* label, float* v, int components, float v_min, float v_max, const char* display_format, float power) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; bool value_changed = false; BeginGroup(); PushID(label); PushMultiItemsWidths(components); for (int i = 0; i < components; i++) { PushID(i); value_changed |= SliderFloat("##v", &v[i], v_min, v_max, display_format, power); SameLine(0, g.Style.ItemInnerSpacing.x); PopID(); PopItemWidth(); } PopID(); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); return value_changed; } bool ImGui::SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format, float power) { return SliderFloatN(label, v, 2, v_min, v_max, display_format, power); } bool ImGui::SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format, float power) { return SliderFloatN(label, v, 3, v_min, v_max, display_format, power); } bool ImGui::SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format, float power) { return SliderFloatN(label, v, 4, v_min, v_max, display_format, power); } bool ImGui::SliderIntN(const char* label, int* v, int components, int v_min, int v_max, const char* display_format) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; bool value_changed = false; BeginGroup(); PushID(label); PushMultiItemsWidths(components); for (int i = 0; i < components; i++) { PushID(i); value_changed |= SliderInt("##v", &v[i], v_min, v_max, display_format); SameLine(0, g.Style.ItemInnerSpacing.x); PopID(); PopItemWidth(); } PopID(); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); return value_changed; } bool ImGui::SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format) { return SliderIntN(label, v, 2, v_min, v_max, display_format); } bool ImGui::SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format) { return SliderIntN(label, v, 3, v_min, v_max, display_format); } bool ImGui::SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format) { return SliderIntN(label, v, 4, v_min, v_max, display_format); } bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_speed, float v_min, float v_max, int decimal_precision, float power) { ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; // Draw frame const ImU32 frame_col = GetColorU32(g.ActiveId == id ? ImGuiCol_FrameBgActive : g.HoveredId == id ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); RenderNavHighlight(frame_bb, id); RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding); bool value_changed = false; // Process interacting with the drag if (g.ActiveId == id) { if (g.ActiveIdSource == ImGuiInputSource_Mouse && !g.IO.MouseDown[0]) ClearActiveID(); else if (g.ActiveIdSource == ImGuiInputSource_Nav && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated) ClearActiveID(); } if (g.ActiveId == id) { if (g.ActiveIdIsJustActivated) { // Lock current value on click g.DragCurrentValue = *v; g.DragLastMouseDelta = ImVec2(0.f, 0.f); } if (v_speed == 0.0f && (v_max - v_min) != 0.0f && (v_max - v_min) < FLT_MAX) v_speed = (v_max - v_min) * g.DragSpeedDefaultRatio; float v_cur = g.DragCurrentValue; const ImVec2 mouse_drag_delta = GetMouseDragDelta(0, 1.0f); float adjust_delta = 0.0f; if (g.ActiveIdSource == ImGuiInputSource_Mouse && IsMousePosValid()) { adjust_delta = mouse_drag_delta.x - g.DragLastMouseDelta.x; if (g.IO.KeyShift && g.DragSpeedScaleFast >= 0.0f) adjust_delta *= g.DragSpeedScaleFast; if (g.IO.KeyAlt && g.DragSpeedScaleSlow >= 0.0f) adjust_delta *= g.DragSpeedScaleSlow; g.DragLastMouseDelta.x = mouse_drag_delta.x; } if (g.ActiveIdSource == ImGuiInputSource_Nav) { adjust_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard|ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_RepeatFast, 1.0f/10.0f, 10.0f).x; if (v_min < v_max && ((v_cur >= v_max && adjust_delta > 0.0f) || (v_cur <= v_min && adjust_delta < 0.0f))) // This is to avoid applying the saturation when already past the limits adjust_delta = 0.0f; v_speed = ImMax(v_speed, GetMinimumStepAtDecimalPrecision(decimal_precision)); } adjust_delta *= v_speed; if (fabsf(adjust_delta) > 0.0f) { if (fabsf(power - 1.0f) > 0.001f) { // Logarithmic curve on both side of 0.0 float v0_abs = v_cur >= 0.0f ? v_cur : -v_cur; float v0_sign = v_cur >= 0.0f ? 1.0f : -1.0f; float v1 = powf(v0_abs, 1.0f / power) + (adjust_delta * v0_sign); float v1_abs = v1 >= 0.0f ? v1 : -v1; float v1_sign = v1 >= 0.0f ? 1.0f : -1.0f; // Crossed sign line v_cur = powf(v1_abs, power) * v0_sign * v1_sign; // Reapply sign } else { v_cur += adjust_delta; } // Clamp if (v_min < v_max) v_cur = ImClamp(v_cur, v_min, v_max); g.DragCurrentValue = v_cur; } // Round to user desired precision, then apply v_cur = RoundScalar(v_cur, decimal_precision); if (*v != v_cur) { *v = v_cur; value_changed = true; } } return value_changed; } bool ImGui::DragFloat(const char* label, float* v, float v_speed, float v_min, float v_max, const char* display_format, float power) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const float w = CalcItemWidth(); const ImVec2 label_size = CalcTextSize(label, NULL, true); const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f)); const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding); const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); // NB- we don't call ItemSize() yet because we may turn into a text edit box below if (!ItemAdd(total_bb, id, &frame_bb)) { ItemSize(total_bb, style.FramePadding.y); return false; } const bool hovered = ItemHoverable(frame_bb, id); if (!display_format) display_format = "%.3f"; int decimal_precision = ParseFormatPrecision(display_format, 3); // Tabbing or CTRL-clicking on Drag turns it into an input box bool start_text_input = false; const bool tab_focus_requested = FocusableItemRegister(window, id); if (tab_focus_requested || (hovered && (g.IO.MouseClicked[0] || g.IO.MouseDoubleClicked[0])) || g.NavActivateId == id || (g.NavInputId == id && g.ScalarAsInputTextId != id)) { SetActiveID(id, window); SetFocusID(id, window); FocusWindow(window); g.ActiveIdAllowNavDirFlags = (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down); if (tab_focus_requested || g.IO.KeyCtrl || g.IO.MouseDoubleClicked[0] || g.NavInputId == id) { start_text_input = true; g.ScalarAsInputTextId = 0; } } if (start_text_input || (g.ActiveId == id && g.ScalarAsInputTextId == id)) return InputScalarAsWidgetReplacement(frame_bb, label, ImGuiDataType_Float, v, id, decimal_precision); // Actual drag behavior ItemSize(total_bb, style.FramePadding.y); const bool value_changed = DragBehavior(frame_bb, id, v, v_speed, v_min, v_max, decimal_precision, power); // Display value using user-provided display format so user can add prefix/suffix/decorations to the value. char value_buf[64]; const char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v); RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(0.5f,0.5f)); if (label_size.x > 0.0f) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label); return value_changed; } bool ImGui::DragFloatN(const char* label, float* v, int components, float v_speed, float v_min, float v_max, const char* display_format, float power) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; bool value_changed = false; BeginGroup(); PushID(label); PushMultiItemsWidths(components); for (int i = 0; i < components; i++) { PushID(i); value_changed |= DragFloat("##v", &v[i], v_speed, v_min, v_max, display_format, power); SameLine(0, g.Style.ItemInnerSpacing.x); PopID(); PopItemWidth(); } PopID(); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); return value_changed; } bool ImGui::DragFloat2(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* display_format, float power) { return DragFloatN(label, v, 2, v_speed, v_min, v_max, display_format, power); } bool ImGui::DragFloat3(const char* label, float v[3], float v_speed, float v_min, float v_max, const char* display_format, float power) { return DragFloatN(label, v, 3, v_speed, v_min, v_max, display_format, power); } bool ImGui::DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* display_format, float power) { return DragFloatN(label, v, 4, v_speed, v_min, v_max, display_format, power); } bool ImGui::DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed, float v_min, float v_max, const char* display_format, const char* display_format_max, float power) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; PushID(label); BeginGroup(); PushMultiItemsWidths(2); bool value_changed = DragFloat("##min", v_current_min, v_speed, (v_min >= v_max) ? -FLT_MAX : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), display_format, power); PopItemWidth(); SameLine(0, g.Style.ItemInnerSpacing.x); value_changed |= DragFloat("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? FLT_MAX : v_max, display_format_max ? display_format_max : display_format, power); PopItemWidth(); SameLine(0, g.Style.ItemInnerSpacing.x); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); PopID(); return value_changed; } // NB: v_speed is float to allow adjusting the drag speed with more precision bool ImGui::DragInt(const char* label, int* v, float v_speed, int v_min, int v_max, const char* display_format) { if (!display_format) display_format = "%.0f"; float v_f = (float)*v; bool value_changed = DragFloat(label, &v_f, v_speed, (float)v_min, (float)v_max, display_format); *v = (int)v_f; return value_changed; } bool ImGui::DragIntN(const char* label, int* v, int components, float v_speed, int v_min, int v_max, const char* display_format) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; bool value_changed = false; BeginGroup(); PushID(label); PushMultiItemsWidths(components); for (int i = 0; i < components; i++) { PushID(i); value_changed |= DragInt("##v", &v[i], v_speed, v_min, v_max, display_format); SameLine(0, g.Style.ItemInnerSpacing.x); PopID(); PopItemWidth(); } PopID(); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); return value_changed; } bool ImGui::DragInt2(const char* label, int v[2], float v_speed, int v_min, int v_max, const char* display_format) { return DragIntN(label, v, 2, v_speed, v_min, v_max, display_format); } bool ImGui::DragInt3(const char* label, int v[3], float v_speed, int v_min, int v_max, const char* display_format) { return DragIntN(label, v, 3, v_speed, v_min, v_max, display_format); } bool ImGui::DragInt4(const char* label, int v[4], float v_speed, int v_min, int v_max, const char* display_format) { return DragIntN(label, v, 4, v_speed, v_min, v_max, display_format); } bool ImGui::DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed, int v_min, int v_max, const char* display_format, const char* display_format_max) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; PushID(label); BeginGroup(); PushMultiItemsWidths(2); bool value_changed = DragInt("##min", v_current_min, v_speed, (v_min >= v_max) ? INT_MIN : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), display_format); PopItemWidth(); SameLine(0, g.Style.ItemInnerSpacing.x); value_changed |= DragInt("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? INT_MAX : v_max, display_format_max ? display_format_max : display_format); PopItemWidth(); SameLine(0, g.Style.ItemInnerSpacing.x); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); PopID(); return value_changed; } void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImVec2 label_size = CalcTextSize(label, NULL, true); if (graph_size.x == 0.0f) graph_size.x = CalcItemWidth(); if (graph_size.y == 0.0f) graph_size.y = label_size.y + (style.FramePadding.y * 2); const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(graph_size.x, graph_size.y)); const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding); const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0)); ItemSize(total_bb, style.FramePadding.y); if (!ItemAdd(total_bb, 0, &frame_bb)) return; const bool hovered = ItemHoverable(inner_bb, 0); // Determine scale from values if not specified if (scale_min == FLT_MAX || scale_max == FLT_MAX) { float v_min = FLT_MAX; float v_max = -FLT_MAX; for (int i = 0; i < values_count; i++) { const float v = values_getter(data, i); v_min = ImMin(v_min, v); v_max = ImMax(v_max, v); } if (scale_min == FLT_MAX) scale_min = v_min; if (scale_max == FLT_MAX) scale_max = v_max; } RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); if (values_count > 0) { int res_w = ImMin((int)graph_size.x, values_count) + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0); int item_count = values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0); // Tooltip on hover int v_hovered = -1; if (hovered) { const float t = ImClamp((g.IO.MousePos.x - inner_bb.Min.x) / (inner_bb.Max.x - inner_bb.Min.x), 0.0f, 0.9999f); const int v_idx = (int)(t * item_count); IM_ASSERT(v_idx >= 0 && v_idx < values_count); const float v0 = values_getter(data, (v_idx + values_offset) % values_count); const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count); if (plot_type == ImGuiPlotType_Lines) SetTooltip("%d: %8.4g\n%d: %8.4g", v_idx, v0, v_idx+1, v1); else if (plot_type == ImGuiPlotType_Histogram) SetTooltip("%d: %8.4g", v_idx, v0); v_hovered = v_idx; } const float t_step = 1.0f / (float)res_w; const float inv_scale = (scale_min == scale_max) ? 0.0f : (1.0f / (scale_max - scale_min)); float v0 = values_getter(data, (0 + values_offset) % values_count); float t0 = 0.0f; ImVec2 tp0 = ImVec2( t0, 1.0f - ImSaturate((v0 - scale_min) * inv_scale) ); // Point in the normalized space of our target rectangle float histogram_zero_line_t = (scale_min * scale_max < 0.0f) ? (-scale_min * inv_scale) : (scale_min < 0.0f ? 0.0f : 1.0f); // Where does the zero line stands const ImU32 col_base = GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram); const ImU32 col_hovered = GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered); for (int n = 0; n < res_w; n++) { const float t1 = t0 + t_step; const int v1_idx = (int)(t0 * item_count + 0.5f); IM_ASSERT(v1_idx >= 0 && v1_idx < values_count); const float v1 = values_getter(data, (v1_idx + values_offset + 1) % values_count); const ImVec2 tp1 = ImVec2( t1, 1.0f - ImSaturate((v1 - scale_min) * inv_scale) ); // NB: Draw calls are merged together by the DrawList system. Still, we should render our batch are lower level to save a bit of CPU. ImVec2 pos0 = ImLerp(inner_bb.Min, inner_bb.Max, tp0); ImVec2 pos1 = ImLerp(inner_bb.Min, inner_bb.Max, (plot_type == ImGuiPlotType_Lines) ? tp1 : ImVec2(tp1.x, histogram_zero_line_t)); if (plot_type == ImGuiPlotType_Lines) { window->DrawList->AddLine(pos0, pos1, v_hovered == v1_idx ? col_hovered : col_base); } else if (plot_type == ImGuiPlotType_Histogram) { if (pos1.x >= pos0.x + 2.0f) pos1.x -= 1.0f; window->DrawList->AddRectFilled(pos0, pos1, v_hovered == v1_idx ? col_hovered : col_base); } t0 = t1; tp0 = tp1; } } // Text overlay if (overlay_text) RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, overlay_text, NULL, NULL, ImVec2(0.5f,0.0f)); if (label_size.x > 0.0f) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label); } struct ImGuiPlotArrayGetterData { const float* Values; int Stride; ImGuiPlotArrayGetterData(const float* values, int stride) { Values = values; Stride = stride; } }; static float Plot_ArrayGetter(void* data, int idx) { ImGuiPlotArrayGetterData* plot_data = (ImGuiPlotArrayGetterData*)data; const float v = *(const float*)(const void*)((const unsigned char*)plot_data->Values + (size_t)idx * plot_data->Stride); return v; } void ImGui::PlotLines(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, int stride) { ImGuiPlotArrayGetterData data(values, stride); PlotEx(ImGuiPlotType_Lines, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); } void ImGui::PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size) { PlotEx(ImGuiPlotType_Lines, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); } void ImGui::PlotHistogram(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, int stride) { ImGuiPlotArrayGetterData data(values, stride); PlotEx(ImGuiPlotType_Histogram, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); } void ImGui::PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size) { PlotEx(ImGuiPlotType_Histogram, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); } // size_arg (for each axis) < 0.0f: align to end, 0.0f: auto, > 0.0f: specified size void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* overlay) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; ImVec2 pos = window->DC.CursorPos; ImRect bb(pos, pos + CalcItemSize(size_arg, CalcItemWidth(), g.FontSize + style.FramePadding.y*2.0f)); ItemSize(bb, style.FramePadding.y); if (!ItemAdd(bb, 0)) return; // Render fraction = ImSaturate(fraction); RenderFrame(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); bb.Expand(ImVec2(-style.FrameBorderSize, -style.FrameBorderSize)); const ImVec2 fill_br = ImVec2(ImLerp(bb.Min.x, bb.Max.x, fraction), bb.Max.y); RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0f, fraction, style.FrameRounding); // Default displaying the fraction as percentage string, but user can override it char overlay_buf[32]; if (!overlay) { ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction*100+0.01f); overlay = overlay_buf; } ImVec2 overlay_size = CalcTextSize(overlay, NULL); if (overlay_size.x > 0.0f) RenderTextClipped(ImVec2(ImClamp(fill_br.x + style.ItemSpacing.x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImVec2(0.0f,0.5f), &bb); } bool ImGui::Checkbox(const char* label, bool* v) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); const ImRect check_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(label_size.y + style.FramePadding.y*2, label_size.y + style.FramePadding.y*2)); // We want a square shape to we use Y twice ItemSize(check_bb, style.FramePadding.y); ImRect total_bb = check_bb; if (label_size.x > 0) SameLine(0, style.ItemInnerSpacing.x); const ImRect text_bb(window->DC.CursorPos + ImVec2(0,style.FramePadding.y), window->DC.CursorPos + ImVec2(0,style.FramePadding.y) + label_size); if (label_size.x > 0) { ItemSize(ImVec2(text_bb.GetWidth(), check_bb.GetHeight()), style.FramePadding.y); total_bb = ImRect(ImMin(check_bb.Min, text_bb.Min), ImMax(check_bb.Max, text_bb.Max)); } if (!ItemAdd(total_bb, id)) return false; bool hovered, held; bool pressed = ButtonBehavior(total_bb, id, &hovered, &held); if (pressed) *v = !(*v); RenderNavHighlight(total_bb, id); RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding); if (*v) { const float check_sz = ImMin(check_bb.GetWidth(), check_bb.GetHeight()); const float pad = ImMax(1.0f, (float)(int)(check_sz / 6.0f)); RenderCheckMark(check_bb.Min + ImVec2(pad,pad), GetColorU32(ImGuiCol_CheckMark), check_bb.GetWidth() - pad*2.0f); } if (g.LogEnabled) LogRenderedText(&text_bb.Min, *v ? "[x]" : "[ ]"); if (label_size.x > 0.0f) RenderText(text_bb.Min, label); return pressed; } bool ImGui::CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value) { bool v = ((*flags & flags_value) == flags_value); bool pressed = Checkbox(label, &v); if (pressed) { if (v) *flags |= flags_value; else *flags &= ~flags_value; } return pressed; } bool ImGui::RadioButton(const char* label, bool active) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); const ImRect check_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(label_size.y + style.FramePadding.y*2-1, label_size.y + style.FramePadding.y*2-1)); ItemSize(check_bb, style.FramePadding.y); ImRect total_bb = check_bb; if (label_size.x > 0) SameLine(0, style.ItemInnerSpacing.x); const ImRect text_bb(window->DC.CursorPos + ImVec2(0, style.FramePadding.y), window->DC.CursorPos + ImVec2(0, style.FramePadding.y) + label_size); if (label_size.x > 0) { ItemSize(ImVec2(text_bb.GetWidth(), check_bb.GetHeight()), style.FramePadding.y); total_bb.Add(text_bb); } if (!ItemAdd(total_bb, id)) return false; ImVec2 center = check_bb.GetCenter(); center.x = (float)(int)center.x + 0.5f; center.y = (float)(int)center.y + 0.5f; const float radius = check_bb.GetHeight() * 0.5f; bool hovered, held; bool pressed = ButtonBehavior(total_bb, id, &hovered, &held); RenderNavHighlight(total_bb, id); window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), 16); if (active) { const float check_sz = ImMin(check_bb.GetWidth(), check_bb.GetHeight()); const float pad = ImMax(1.0f, (float)(int)(check_sz / 6.0f)); window->DrawList->AddCircleFilled(center, radius-pad, GetColorU32(ImGuiCol_CheckMark), 16); } if (style.FrameBorderSize > 0.0f) { window->DrawList->AddCircle(center+ImVec2(1,1), radius, GetColorU32(ImGuiCol_BorderShadow), 16, style.FrameBorderSize); window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), 16, style.FrameBorderSize); } if (g.LogEnabled) LogRenderedText(&text_bb.Min, active ? "(x)" : "( )"); if (label_size.x > 0.0f) RenderText(text_bb.Min, label); return pressed; } bool ImGui::RadioButton(const char* label, int* v, int v_button) { const bool pressed = RadioButton(label, *v == v_button); if (pressed) { *v = v_button; } return pressed; } static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end) { int line_count = 0; const char* s = text_begin; while (char c = *s++) // We are only matching for \n so we can ignore UTF-8 decoding if (c == '\n') line_count++; s--; if (s[0] != '\n' && s[0] != '\r') line_count++; *out_text_end = s; return line_count; } static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line) { ImFont* font = GImGui->Font; const float line_height = GImGui->FontSize; const float scale = line_height / font->FontSize; ImVec2 text_size = ImVec2(0,0); float line_width = 0.0f; const ImWchar* s = text_begin; while (s < text_end) { unsigned int c = (unsigned int)(*s++); if (c == '\n') { text_size.x = ImMax(text_size.x, line_width); text_size.y += line_height; line_width = 0.0f; if (stop_on_new_line) break; continue; } if (c == '\r') continue; const float char_width = font->GetCharAdvance((unsigned short)c) * scale; line_width += char_width; } if (text_size.x < line_width) text_size.x = line_width; if (out_offset) *out_offset = ImVec2(line_width, text_size.y + line_height); // offset allow for the possibility of sitting after a trailing \n if (line_width > 0 || text_size.y == 0.0f) // whereas size.y will ignore the trailing \n text_size.y += line_height; if (remaining) *remaining = s; return text_size; } // Wrapper for stb_textedit.h to edit text (our wrapper is for: statically sized buffer, single-line, wchar characters. InputText converts between UTF-8 and wchar) namespace ImGuiStb { static int STB_TEXTEDIT_STRINGLEN(const STB_TEXTEDIT_STRING* obj) { return obj->CurLenW; } static ImWchar STB_TEXTEDIT_GETCHAR(const STB_TEXTEDIT_STRING* obj, int idx) { return obj->Text[idx]; } static float STB_TEXTEDIT_GETWIDTH(STB_TEXTEDIT_STRING* obj, int line_start_idx, int char_idx) { ImWchar c = obj->Text[line_start_idx+char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; return GImGui->Font->GetCharAdvance(c) * (GImGui->FontSize / GImGui->Font->FontSize); } static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x10000 ? 0 : key; } static ImWchar STB_TEXTEDIT_NEWLINE = '\n'; static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, STB_TEXTEDIT_STRING* obj, int line_start_idx) { const ImWchar* text = obj->Text.Data; const ImWchar* text_remaining = NULL; const ImVec2 size = InputTextCalcTextSizeW(text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true); r->x0 = 0.0f; r->x1 = size.x; r->baseline_y_delta = size.y; r->ymin = 0.0f; r->ymax = size.y; r->num_chars = (int)(text_remaining - (text + line_start_idx)); } static bool is_separator(unsigned int c) { return ImCharIsSpace(c) || c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|'; } static int is_word_boundary_from_right(STB_TEXTEDIT_STRING* obj, int idx) { return idx > 0 ? (is_separator( obj->Text[idx-1] ) && !is_separator( obj->Text[idx] ) ) : 1; } static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(STB_TEXTEDIT_STRING* obj, int idx) { idx--; while (idx >= 0 && !is_word_boundary_from_right(obj, idx)) idx--; return idx < 0 ? 0 : idx; } #ifdef __APPLE__ // FIXME: Move setting to IO structure static int is_word_boundary_from_left(STB_TEXTEDIT_STRING* obj, int idx) { return idx > 0 ? (!is_separator( obj->Text[idx-1] ) && is_separator( obj->Text[idx] ) ) : 1; } static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(STB_TEXTEDIT_STRING* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_left(obj, idx)) idx++; return idx > len ? len : idx; } #else static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(STB_TEXTEDIT_STRING* obj, int idx) { idx++; int len = obj->CurLenW; while (idx < len && !is_word_boundary_from_right(obj, idx)) idx++; return idx > len ? len : idx; } #endif #define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h #define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n) { ImWchar* dst = obj->Text.Data + pos; // We maintain our buffer length in both UTF-8 and wchar formats obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n); obj->CurLenW -= n; // Offset remaining text const ImWchar* src = obj->Text.Data + pos + n; while (ImWchar c = *src++) *dst++ = c; *dst = '\0'; } static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING* obj, int pos, const ImWchar* new_text, int new_text_len) { const int text_len = obj->CurLenW; IM_ASSERT(pos <= text_len); if (new_text_len + text_len + 1 > obj->Text.Size) return false; const int new_text_len_utf8 = ImTextCountUtf8BytesFromStr(new_text, new_text + new_text_len); if (new_text_len_utf8 + obj->CurLenA + 1 > obj->BufSizeA) return false; ImWchar* text = obj->Text.Data; if (pos != text_len) memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos) * sizeof(ImWchar)); memcpy(text + pos, new_text, (size_t)new_text_len * sizeof(ImWchar)); obj->CurLenW += new_text_len; obj->CurLenA += new_text_len_utf8; obj->Text[obj->CurLenW] = '\0'; return true; } // We don't use an enum so we can build even with conflicting symbols (if another user of stb_textedit.h leak their STB_TEXTEDIT_K_* symbols) #define STB_TEXTEDIT_K_LEFT 0x10000 // keyboard input to move cursor left #define STB_TEXTEDIT_K_RIGHT 0x10001 // keyboard input to move cursor right #define STB_TEXTEDIT_K_UP 0x10002 // keyboard input to move cursor up #define STB_TEXTEDIT_K_DOWN 0x10003 // keyboard input to move cursor down #define STB_TEXTEDIT_K_LINESTART 0x10004 // keyboard input to move cursor to start of line #define STB_TEXTEDIT_K_LINEEND 0x10005 // keyboard input to move cursor to end of line #define STB_TEXTEDIT_K_TEXTSTART 0x10006 // keyboard input to move cursor to start of text #define STB_TEXTEDIT_K_TEXTEND 0x10007 // keyboard input to move cursor to end of text #define STB_TEXTEDIT_K_DELETE 0x10008 // keyboard input to delete selection or character under cursor #define STB_TEXTEDIT_K_BACKSPACE 0x10009 // keyboard input to delete selection or character left of cursor #define STB_TEXTEDIT_K_UNDO 0x1000A // keyboard input to perform undo #define STB_TEXTEDIT_K_REDO 0x1000B // keyboard input to perform redo #define STB_TEXTEDIT_K_WORDLEFT 0x1000C // keyboard input to move cursor left one word #define STB_TEXTEDIT_K_WORDRIGHT 0x1000D // keyboard input to move cursor right one word #define STB_TEXTEDIT_K_SHIFT 0x20000 #define STB_TEXTEDIT_IMPLEMENTATION #include "stb_textedit.h" } void ImGuiTextEditState::OnKeyPressed(int key) { stb_textedit_key(this, &StbState, key); CursorFollow = true; CursorAnimReset(); } // Public API to manipulate UTF-8 text // We expose UTF-8 to the user (unlike the STB_TEXTEDIT_* functions which are manipulating wchar) // FIXME: The existence of this rarely exercised code path is a bit of a nuisance. void ImGuiTextEditCallbackData::DeleteChars(int pos, int bytes_count) { IM_ASSERT(pos + bytes_count <= BufTextLen); char* dst = Buf + pos; const char* src = Buf + pos + bytes_count; while (char c = *src++) *dst++ = c; *dst = '\0'; if (CursorPos + bytes_count >= pos) CursorPos -= bytes_count; else if (CursorPos >= pos) CursorPos = pos; SelectionStart = SelectionEnd = CursorPos; BufDirty = true; BufTextLen -= bytes_count; } void ImGuiTextEditCallbackData::InsertChars(int pos, const char* new_text, const char* new_text_end) { const int new_text_len = new_text_end ? (int)(new_text_end - new_text) : (int)strlen(new_text); if (new_text_len + BufTextLen + 1 >= BufSize) return; if (BufTextLen != pos) memmove(Buf + pos + new_text_len, Buf + pos, (size_t)(BufTextLen - pos)); memcpy(Buf + pos, new_text, (size_t)new_text_len * sizeof(char)); Buf[BufTextLen + new_text_len] = '\0'; if (CursorPos >= pos) CursorPos += new_text_len; SelectionStart = SelectionEnd = CursorPos; BufDirty = true; BufTextLen += new_text_len; } // Return false to discard a character. static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data) { unsigned int c = *p_char; if (c < 128 && c != ' ' && !isprint((int)(c & 0xFF))) { bool pass = false; pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline)); pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput)); if (!pass) return false; } if (c >= 0xE000 && c <= 0xF8FF) // Filter private Unicode range. I don't imagine anybody would want to input them. GLFW on OSX seems to send private characters for special keys like arrow keys. return false; if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific)) { if (flags & ImGuiInputTextFlags_CharsDecimal) if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/')) return false; if (flags & ImGuiInputTextFlags_CharsScientific) if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/') && (c != 'e') && (c != 'E')) return false; if (flags & ImGuiInputTextFlags_CharsHexadecimal) if (!(c >= '0' && c <= '9') && !(c >= 'a' && c <= 'f') && !(c >= 'A' && c <= 'F')) return false; if (flags & ImGuiInputTextFlags_CharsUppercase) if (c >= 'a' && c <= 'z') *p_char = (c += (unsigned int)('A'-'a')); if (flags & ImGuiInputTextFlags_CharsNoBlank) if (ImCharIsSpace(c)) return false; } if (flags & ImGuiInputTextFlags_CallbackCharFilter) { ImGuiTextEditCallbackData callback_data; memset(&callback_data, 0, sizeof(ImGuiTextEditCallbackData)); callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter; callback_data.EventChar = (ImWchar)c; callback_data.Flags = flags; callback_data.UserData = user_data; if (callback(&callback_data) != 0) return false; *p_char = callback_data.EventChar; if (!callback_data.EventChar) return false; } return true; } // Edit a string of text // NB: when active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while active has no effect. // FIXME: Rather messy function partly because we are doing UTF8 > u16 > UTF8 conversions on the go to more easily handle stb_textedit calls. Ideally we should stay in UTF-8 all the time. See https://github.com/nothings/stb/issues/188 bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackHistory) && (flags & ImGuiInputTextFlags_Multiline))); // Can't use both together (they both use up/down keys) IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackCompletion) && (flags & ImGuiInputTextFlags_AllowTabInput))); // Can't use both together (they both use tab key) ImGuiContext& g = *GImGui; const ImGuiIO& io = g.IO; const ImGuiStyle& style = g.Style; const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0; const bool is_editable = (flags & ImGuiInputTextFlags_ReadOnly) == 0; const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0; const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0; if (is_multiline) // Open group before calling GetID() because groups tracks id created during their spawn BeginGroup(); const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), (is_multiline ? GetTextLineHeight() * 8.0f : label_size.y) + style.FramePadding.y*2.0f); // Arbitrary default of 8 lines high for multi-line const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size); const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? (style.ItemInnerSpacing.x + label_size.x) : 0.0f, 0.0f)); ImGuiWindow* draw_window = window; if (is_multiline) { ItemAdd(total_bb, id, &frame_bb); if (!BeginChildFrame(id, frame_bb.GetSize())) { EndChildFrame(); EndGroup(); return false; } draw_window = GetCurrentWindow(); size.x -= draw_window->ScrollbarSizes.x; } else { ItemSize(total_bb, style.FramePadding.y); if (!ItemAdd(total_bb, id, &frame_bb)) return false; } const bool hovered = ItemHoverable(frame_bb, id); if (hovered) g.MouseCursor = ImGuiMouseCursor_TextInput; // Password pushes a temporary font with only a fallback glyph if (is_password) { const ImFontGlyph* glyph = g.Font->FindGlyph('*'); ImFont* password_font = &g.InputTextPasswordFont; password_font->FontSize = g.Font->FontSize; password_font->Scale = g.Font->Scale; password_font->DisplayOffset = g.Font->DisplayOffset; password_font->Ascent = g.Font->Ascent; password_font->Descent = g.Font->Descent; password_font->ContainerAtlas = g.Font->ContainerAtlas; password_font->FallbackGlyph = glyph; password_font->FallbackAdvanceX = glyph->AdvanceX; IM_ASSERT(password_font->Glyphs.empty() && password_font->IndexAdvanceX.empty() && password_font->IndexLookup.empty()); PushFont(password_font); } // NB: we are only allowed to access 'edit_state' if we are the active widget. ImGuiTextEditState& edit_state = g.InputTextState; const bool focus_requested = FocusableItemRegister(window, id, (flags & (ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_AllowTabInput)) == 0); // Using completion callback disable keyboard tabbing const bool focus_requested_by_code = focus_requested && (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent); const bool focus_requested_by_tab = focus_requested && !focus_requested_by_code; const bool user_clicked = hovered && io.MouseClicked[0]; const bool user_scrolled = is_multiline && g.ActiveId == 0 && edit_state.Id == id && g.ActiveIdPreviousFrame == draw_window->GetIDNoKeepAlive("#SCROLLY"); const bool user_nav_input_start = (g.ActiveId != id) && ((g.NavInputId == id) || (g.NavActivateId == id && g.NavInputSource == ImGuiInputSource_NavKeyboard)); bool clear_active_id = false; bool select_all = (g.ActiveId != id) && ((flags & ImGuiInputTextFlags_AutoSelectAll) != 0 || user_nav_input_start) && (!is_multiline); if (focus_requested || user_clicked || user_scrolled || user_nav_input_start) { if (g.ActiveId != id) { // Start edition // Take a copy of the initial buffer value (both in original UTF-8 format and converted to wchar) // From the moment we focused we are ignoring the content of 'buf' (unless we are in read-only mode) const int prev_len_w = edit_state.CurLenW; edit_state.Text.resize(buf_size+1); // wchar count <= UTF-8 count. we use +1 to make sure that .Data isn't NULL so it doesn't crash. edit_state.InitialText.resize(buf_size+1); // UTF-8. we use +1 to make sure that .Data isn't NULL so it doesn't crash. ImStrncpy(edit_state.InitialText.Data, buf, edit_state.InitialText.Size); const char* buf_end = NULL; edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text.Data, edit_state.Text.Size, buf, NULL, &buf_end); edit_state.CurLenA = (int)(buf_end - buf); // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8. edit_state.CursorAnimReset(); // Preserve cursor position and undo/redo stack if we come back to same widget // FIXME: We should probably compare the whole buffer to be on the safety side. Comparing buf (utf8) and edit_state.Text (wchar). const bool recycle_state = (edit_state.Id == id) && (prev_len_w == edit_state.CurLenW); if (recycle_state) { // Recycle existing cursor/selection/undo stack but clamp position // Note a single mouse click will override the cursor/position immediately by calling stb_textedit_click handler. edit_state.CursorClamp(); } else { edit_state.Id = id; edit_state.ScrollX = 0.0f; stb_textedit_initialize_state(&edit_state.StbState, !is_multiline); if (!is_multiline && focus_requested_by_code) select_all = true; } if (flags & ImGuiInputTextFlags_AlwaysInsertMode) edit_state.StbState.insert_mode = true; if (!is_multiline && (focus_requested_by_tab || (user_clicked && io.KeyCtrl))) select_all = true; } SetActiveID(id, window); SetFocusID(id, window); FocusWindow(window); if (!is_multiline && !(flags & ImGuiInputTextFlags_CallbackHistory)) g.ActiveIdAllowNavDirFlags |= ((1 << ImGuiDir_Up) | (1 << ImGuiDir_Down)); } else if (io.MouseClicked[0]) { // Release focus when we click outside clear_active_id = true; } bool value_changed = false; bool enter_pressed = false; if (g.ActiveId == id) { if (!is_editable && !g.ActiveIdIsJustActivated) { // When read-only we always use the live data passed to the function edit_state.Text.resize(buf_size+1); const char* buf_end = NULL; edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text.Data, edit_state.Text.Size, buf, NULL, &buf_end); edit_state.CurLenA = (int)(buf_end - buf); edit_state.CursorClamp(); } edit_state.BufSizeA = buf_size; // Although we are active we don't prevent mouse from hovering other elements unless we are interacting right now with the widget. // Down the line we should have a cleaner library-wide concept of Selected vs Active. g.ActiveIdAllowOverlap = !io.MouseDown[0]; g.WantTextInputNextFrame = 1; // Edit in progress const float mouse_x = (io.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + edit_state.ScrollX; const float mouse_y = (is_multiline ? (io.MousePos.y - draw_window->DC.CursorPos.y - style.FramePadding.y) : (g.FontSize*0.5f)); const bool osx_double_click_selects_words = io.OptMacOSXBehaviors; // OS X style: Double click selects by word instead of selecting whole text if (select_all || (hovered && !osx_double_click_selects_words && io.MouseDoubleClicked[0])) { edit_state.SelectAll(); edit_state.SelectedAllMouseLock = true; } else if (hovered && osx_double_click_selects_words && io.MouseDoubleClicked[0]) { // Select a word only, OS X style (by simulating keystrokes) edit_state.OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT); edit_state.OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT); } else if (io.MouseClicked[0] && !edit_state.SelectedAllMouseLock) { if (hovered) { stb_textedit_click(&edit_state, &edit_state.StbState, mouse_x, mouse_y); edit_state.CursorAnimReset(); } } else if (io.MouseDown[0] && !edit_state.SelectedAllMouseLock && (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f)) { stb_textedit_drag(&edit_state, &edit_state.StbState, mouse_x, mouse_y); edit_state.CursorAnimReset(); edit_state.CursorFollow = true; } if (edit_state.SelectedAllMouseLock && !io.MouseDown[0]) edit_state.SelectedAllMouseLock = false; if (io.InputCharacters[0]) { // Process text input (before we check for Return because using some IME will effectively send a Return?) // We ignore CTRL inputs, but need to allow ALT+CTRL as some keyboards (e.g. German) use AltGR (which _is_ Alt+Ctrl) to input certain characters. if (!(io.KeyCtrl && !io.KeyAlt) && is_editable && !user_nav_input_start) for (int n = 0; n < IM_ARRAYSIZE(io.InputCharacters) && io.InputCharacters[n]; n++) { // Insert character if they pass filtering unsigned int c = (unsigned int)io.InputCharacters[n]; if (InputTextFilterCharacter(&c, flags, callback, user_data)) edit_state.OnKeyPressed((int)c); } // Consume characters memset(g.IO.InputCharacters, 0, sizeof(g.IO.InputCharacters)); } } bool cancel_edit = false; if (g.ActiveId == id && !g.ActiveIdIsJustActivated && !clear_active_id) { // Handle key-presses const int k_mask = (io.KeyShift ? STB_TEXTEDIT_K_SHIFT : 0); const bool is_shortcut_key_only = (io.OptMacOSXBehaviors ? (io.KeySuper && !io.KeyCtrl) : (io.KeyCtrl && !io.KeySuper)) && !io.KeyAlt && !io.KeyShift; // OS X style: Shortcuts using Cmd/Super instead of Ctrl const bool is_wordmove_key_down = io.OptMacOSXBehaviors ? io.KeyAlt : io.KeyCtrl; // OS X style: Text editing cursor movement using Alt instead of Ctrl const bool is_startend_key_down = io.OptMacOSXBehaviors && io.KeySuper && !io.KeyCtrl && !io.KeyAlt; // OS X style: Line/Text Start and End using Cmd+Arrows instead of Home/End const bool is_ctrl_key_only = io.KeyCtrl && !io.KeyShift && !io.KeyAlt && !io.KeySuper; const bool is_shift_key_only = io.KeyShift && !io.KeyCtrl && !io.KeyAlt && !io.KeySuper; const bool is_cut = ((is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_X)) || (is_shift_key_only && IsKeyPressedMap(ImGuiKey_Delete))) && is_editable && !is_password && (!is_multiline || edit_state.HasSelection()); const bool is_copy = ((is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_C)) || (is_ctrl_key_only && IsKeyPressedMap(ImGuiKey_Insert))) && !is_password && (!is_multiline || edit_state.HasSelection()); const bool is_paste = ((is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_V)) || (is_shift_key_only && IsKeyPressedMap(ImGuiKey_Insert))) && is_editable; if (IsKeyPressedMap(ImGuiKey_LeftArrow)) { edit_state.OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINESTART : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDLEFT : STB_TEXTEDIT_K_LEFT) | k_mask); } else if (IsKeyPressedMap(ImGuiKey_RightArrow)) { edit_state.OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINEEND : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDRIGHT : STB_TEXTEDIT_K_RIGHT) | k_mask); } else if (IsKeyPressedMap(ImGuiKey_UpArrow) && is_multiline) { if (io.KeyCtrl) SetWindowScrollY(draw_window, ImMax(draw_window->Scroll.y - g.FontSize, 0.0f)); else edit_state.OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTSTART : STB_TEXTEDIT_K_UP) | k_mask); } else if (IsKeyPressedMap(ImGuiKey_DownArrow) && is_multiline) { if (io.KeyCtrl) SetWindowScrollY(draw_window, ImMin(draw_window->Scroll.y + g.FontSize, GetScrollMaxY())); else edit_state.OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTEND : STB_TEXTEDIT_K_DOWN) | k_mask); } else if (IsKeyPressedMap(ImGuiKey_Home)) { edit_state.OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); } else if (IsKeyPressedMap(ImGuiKey_End)) { edit_state.OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); } else if (IsKeyPressedMap(ImGuiKey_Delete) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); } else if (IsKeyPressedMap(ImGuiKey_Backspace) && is_editable) { if (!edit_state.HasSelection()) { if (is_wordmove_key_down) edit_state.OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT|STB_TEXTEDIT_K_SHIFT); else if (io.OptMacOSXBehaviors && io.KeySuper && !io.KeyAlt && !io.KeyCtrl) edit_state.OnKeyPressed(STB_TEXTEDIT_K_LINESTART|STB_TEXTEDIT_K_SHIFT); } edit_state.OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask); } else if (IsKeyPressedMap(ImGuiKey_Enter)) { bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0; if (!is_multiline || (ctrl_enter_for_new_line && !io.KeyCtrl) || (!ctrl_enter_for_new_line && io.KeyCtrl)) { enter_pressed = clear_active_id = true; } else if (is_editable) { unsigned int c = '\n'; // Insert new line if (InputTextFilterCharacter(&c, flags, callback, user_data)) edit_state.OnKeyPressed((int)c); } } else if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressedMap(ImGuiKey_Tab) && !io.KeyCtrl && !io.KeyShift && !io.KeyAlt && is_editable) { unsigned int c = '\t'; // Insert TAB if (InputTextFilterCharacter(&c, flags, callback, user_data)) edit_state.OnKeyPressed((int)c); } else if (IsKeyPressedMap(ImGuiKey_Escape)) { clear_active_id = cancel_edit = true; } else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_Z) && is_editable && is_undoable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_UNDO); edit_state.ClearSelection(); } else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_Y) && is_editable && is_undoable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_REDO); edit_state.ClearSelection(); } else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_A)) { edit_state.SelectAll(); edit_state.CursorFollow = true; } else if (is_cut || is_copy) { // Cut, Copy if (io.SetClipboardTextFn) { const int ib = edit_state.HasSelection() ? ImMin(edit_state.StbState.select_start, edit_state.StbState.select_end) : 0; const int ie = edit_state.HasSelection() ? ImMax(edit_state.StbState.select_start, edit_state.StbState.select_end) : edit_state.CurLenW; edit_state.TempTextBuffer.resize((ie-ib) * 4 + 1); ImTextStrToUtf8(edit_state.TempTextBuffer.Data, edit_state.TempTextBuffer.Size, edit_state.Text.Data+ib, edit_state.Text.Data+ie); SetClipboardText(edit_state.TempTextBuffer.Data); } if (is_cut) { if (!edit_state.HasSelection()) edit_state.SelectAll(); edit_state.CursorFollow = true; stb_textedit_cut(&edit_state, &edit_state.StbState); } } else if (is_paste) { // Paste if (const char* clipboard = GetClipboardText()) { // Filter pasted buffer const int clipboard_len = (int)strlen(clipboard); ImWchar* clipboard_filtered = (ImWchar*)ImGui::MemAlloc((clipboard_len+1) * sizeof(ImWchar)); int clipboard_filtered_len = 0; for (const char* s = clipboard; *s; ) { unsigned int c; s += ImTextCharFromUtf8(&c, s, NULL); if (c == 0) break; if (c >= 0x10000 || !InputTextFilterCharacter(&c, flags, callback, user_data)) continue; clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c; } clipboard_filtered[clipboard_filtered_len] = 0; if (clipboard_filtered_len > 0) // If everything was filtered, ignore the pasting operation { stb_textedit_paste(&edit_state, &edit_state.StbState, clipboard_filtered, clipboard_filtered_len); edit_state.CursorFollow = true; } ImGui::MemFree(clipboard_filtered); } } } if (g.ActiveId == id) { if (cancel_edit) { // Restore initial value if (is_editable) { ImStrncpy(buf, edit_state.InitialText.Data, buf_size); value_changed = true; } } // When using 'ImGuiInputTextFlags_EnterReturnsTrue' as a special case we reapply the live buffer back to the input buffer before clearing ActiveId, even though strictly speaking it wasn't modified on this frame. // If we didn't do that, code like InputInt() with ImGuiInputTextFlags_EnterReturnsTrue would fail. Also this allows the user to use InputText() with ImGuiInputTextFlags_EnterReturnsTrue without maintaining any user-side storage. bool apply_edit_back_to_user_buffer = !cancel_edit || (enter_pressed && (flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0); if (apply_edit_back_to_user_buffer) { // Apply new value immediately - copy modified buffer back // Note that as soon as the input box is active, the in-widget value gets priority over any underlying modification of the input buffer // FIXME: We actually always render 'buf' when calling DrawList->AddText, making the comment above incorrect. // FIXME-OPT: CPU waste to do this every time the widget is active, should mark dirty state from the stb_textedit callbacks. if (is_editable) { edit_state.TempTextBuffer.resize(edit_state.Text.Size * 4); ImTextStrToUtf8(edit_state.TempTextBuffer.Data, edit_state.TempTextBuffer.Size, edit_state.Text.Data, NULL); } // User callback if ((flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory | ImGuiInputTextFlags_CallbackAlways)) != 0) { IM_ASSERT(callback != NULL); // The reason we specify the usage semantic (Completion/History) is that Completion needs to disable keyboard TABBING at the moment. ImGuiInputTextFlags event_flag = 0; ImGuiKey event_key = ImGuiKey_COUNT; if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && IsKeyPressedMap(ImGuiKey_Tab)) { event_flag = ImGuiInputTextFlags_CallbackCompletion; event_key = ImGuiKey_Tab; } else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_UpArrow)) { event_flag = ImGuiInputTextFlags_CallbackHistory; event_key = ImGuiKey_UpArrow; } else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_DownArrow)) { event_flag = ImGuiInputTextFlags_CallbackHistory; event_key = ImGuiKey_DownArrow; } else if (flags & ImGuiInputTextFlags_CallbackAlways) event_flag = ImGuiInputTextFlags_CallbackAlways; if (event_flag) { ImGuiTextEditCallbackData callback_data; memset(&callback_data, 0, sizeof(ImGuiTextEditCallbackData)); callback_data.EventFlag = event_flag; callback_data.Flags = flags; callback_data.UserData = user_data; callback_data.ReadOnly = !is_editable; callback_data.EventKey = event_key; callback_data.Buf = edit_state.TempTextBuffer.Data; callback_data.BufTextLen = edit_state.CurLenA; callback_data.BufSize = edit_state.BufSizeA; callback_data.BufDirty = false; // We have to convert from wchar-positions to UTF-8-positions, which can be pretty slow (an incentive to ditch the ImWchar buffer, see https://github.com/nothings/stb/issues/188) ImWchar* text = edit_state.Text.Data; const int utf8_cursor_pos = callback_data.CursorPos = ImTextCountUtf8BytesFromStr(text, text + edit_state.StbState.cursor); const int utf8_selection_start = callback_data.SelectionStart = ImTextCountUtf8BytesFromStr(text, text + edit_state.StbState.select_start); const int utf8_selection_end = callback_data.SelectionEnd = ImTextCountUtf8BytesFromStr(text, text + edit_state.StbState.select_end); // Call user code callback(&callback_data); // Read back what user may have modified IM_ASSERT(callback_data.Buf == edit_state.TempTextBuffer.Data); // Invalid to modify those fields IM_ASSERT(callback_data.BufSize == edit_state.BufSizeA); IM_ASSERT(callback_data.Flags == flags); if (callback_data.CursorPos != utf8_cursor_pos) edit_state.StbState.cursor = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.CursorPos); if (callback_data.SelectionStart != utf8_selection_start) edit_state.StbState.select_start = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionStart); if (callback_data.SelectionEnd != utf8_selection_end) edit_state.StbState.select_end = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd); if (callback_data.BufDirty) { IM_ASSERT(callback_data.BufTextLen == (int)strlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text! edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text.Data, edit_state.Text.Size, callback_data.Buf, NULL); edit_state.CurLenA = callback_data.BufTextLen; // Assume correct length and valid UTF-8 from user, saves us an extra strlen() edit_state.CursorAnimReset(); } } } // Copy back to user buffer if (is_editable && strcmp(edit_state.TempTextBuffer.Data, buf) != 0) { ImStrncpy(buf, edit_state.TempTextBuffer.Data, buf_size); value_changed = true; } } } // Release active ID at the end of the function (so e.g. pressing Return still does a final application of the value) if (clear_active_id && g.ActiveId == id) ClearActiveID(); // Render // Select which buffer we are going to display. When ImGuiInputTextFlags_NoLiveEdit is set 'buf' might still be the old value. We set buf to NULL to prevent accidental usage from now on. const char* buf_display = (g.ActiveId == id && is_editable) ? edit_state.TempTextBuffer.Data : buf; buf = NULL; RenderNavHighlight(frame_bb, id); if (!is_multiline) RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding); const ImVec4 clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + size.x, frame_bb.Min.y + size.y); // Not using frame_bb.Max because we have adjusted size ImVec2 render_pos = is_multiline ? draw_window->DC.CursorPos : frame_bb.Min + style.FramePadding; ImVec2 text_size(0.f, 0.f); const bool is_currently_scrolling = (edit_state.Id == id && is_multiline && g.ActiveId == draw_window->GetIDNoKeepAlive("#SCROLLY")); if (g.ActiveId == id || is_currently_scrolling) { edit_state.CursorAnim += io.DeltaTime; // This is going to be messy. We need to: // - Display the text (this alone can be more easily clipped) // - Handle scrolling, highlight selection, display cursor (those all requires some form of 1d->2d cursor position calculation) // - Measure text height (for scrollbar) // We are attempting to do most of that in **one main pass** to minimize the computation cost (non-negligible for large amount of text) + 2nd pass for selection rendering (we could merge them by an extra refactoring effort) // FIXME: This should occur on buf_display but we'd need to maintain cursor/select_start/select_end for UTF-8. const ImWchar* text_begin = edit_state.Text.Data; ImVec2 cursor_offset, select_start_offset; { // Count lines + find lines numbers straddling 'cursor' and 'select_start' position. const ImWchar* searches_input_ptr[2]; searches_input_ptr[0] = text_begin + edit_state.StbState.cursor; searches_input_ptr[1] = NULL; int searches_remaining = 1; int searches_result_line_number[2] = { -1, -999 }; if (edit_state.StbState.select_start != edit_state.StbState.select_end) { searches_input_ptr[1] = text_begin + ImMin(edit_state.StbState.select_start, edit_state.StbState.select_end); searches_result_line_number[1] = -1; searches_remaining++; } // Iterate all lines to find our line numbers // In multi-line mode, we never exit the loop until all lines are counted, so add one extra to the searches_remaining counter. searches_remaining += is_multiline ? 1 : 0; int line_count = 0; for (const ImWchar* s = text_begin; *s != 0; s++) if (*s == '\n') { line_count++; if (searches_result_line_number[0] == -1 && s >= searches_input_ptr[0]) { searches_result_line_number[0] = line_count; if (--searches_remaining <= 0) break; } if (searches_result_line_number[1] == -1 && s >= searches_input_ptr[1]) { searches_result_line_number[1] = line_count; if (--searches_remaining <= 0) break; } } line_count++; if (searches_result_line_number[0] == -1) searches_result_line_number[0] = line_count; if (searches_result_line_number[1] == -1) searches_result_line_number[1] = line_count; // Calculate 2d position by finding the beginning of the line and measuring distance cursor_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[0], text_begin), searches_input_ptr[0]).x; cursor_offset.y = searches_result_line_number[0] * g.FontSize; if (searches_result_line_number[1] >= 0) { select_start_offset.x = InputTextCalcTextSizeW(ImStrbolW(searches_input_ptr[1], text_begin), searches_input_ptr[1]).x; select_start_offset.y = searches_result_line_number[1] * g.FontSize; } // Store text height (note that we haven't calculated text width at all, see GitHub issues #383, #1224) if (is_multiline) text_size = ImVec2(size.x, line_count * g.FontSize); } // Scroll if (edit_state.CursorFollow) { // Horizontal scroll in chunks of quarter width if (!(flags & ImGuiInputTextFlags_NoHorizontalScroll)) { const float scroll_increment_x = size.x * 0.25f; if (cursor_offset.x < edit_state.ScrollX) edit_state.ScrollX = (float)(int)ImMax(0.0f, cursor_offset.x - scroll_increment_x); else if (cursor_offset.x - size.x >= edit_state.ScrollX) edit_state.ScrollX = (float)(int)(cursor_offset.x - size.x + scroll_increment_x); } else { edit_state.ScrollX = 0.0f; } // Vertical scroll if (is_multiline) { float scroll_y = draw_window->Scroll.y; if (cursor_offset.y - g.FontSize < scroll_y) scroll_y = ImMax(0.0f, cursor_offset.y - g.FontSize); else if (cursor_offset.y - size.y >= scroll_y) scroll_y = cursor_offset.y - size.y; draw_window->DC.CursorPos.y += (draw_window->Scroll.y - scroll_y); // To avoid a frame of lag draw_window->Scroll.y = scroll_y; render_pos.y = draw_window->DC.CursorPos.y; } } edit_state.CursorFollow = false; const ImVec2 render_scroll = ImVec2(edit_state.ScrollX, 0.0f); // Draw selection if (edit_state.StbState.select_start != edit_state.StbState.select_end) { const ImWchar* text_selected_begin = text_begin + ImMin(edit_state.StbState.select_start, edit_state.StbState.select_end); const ImWchar* text_selected_end = text_begin + ImMax(edit_state.StbState.select_start, edit_state.StbState.select_end); float bg_offy_up = is_multiline ? 0.0f : -1.0f; // FIXME: those offsets should be part of the style? they don't play so well with multi-line selection. float bg_offy_dn = is_multiline ? 0.0f : 2.0f; ImU32 bg_color = GetColorU32(ImGuiCol_TextSelectedBg); ImVec2 rect_pos = render_pos + select_start_offset - render_scroll; for (const ImWchar* p = text_selected_begin; p < text_selected_end; ) { if (rect_pos.y > clip_rect.w + g.FontSize) break; if (rect_pos.y < clip_rect.y) { while (p < text_selected_end) if (*p++ == '\n') break; } else { ImVec2 rect_size = InputTextCalcTextSizeW(p, text_selected_end, &p, NULL, true); if (rect_size.x <= 0.0f) rect_size.x = (float)(int)(g.Font->GetCharAdvance((unsigned short)' ') * 0.50f); // So we can see selected empty lines ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos +ImVec2(rect_size.x, bg_offy_dn)); rect.ClipWith(clip_rect); if (rect.Overlaps(clip_rect)) draw_window->DrawList->AddRectFilled(rect.Min, rect.Max, bg_color); } rect_pos.x = render_pos.x - render_scroll.x; rect_pos.y += g.FontSize; } } draw_window->DrawList->AddText(g.Font, g.FontSize, render_pos - render_scroll, GetColorU32(ImGuiCol_Text), buf_display, buf_display + edit_state.CurLenA, 0.0f, is_multiline ? NULL : &clip_rect); // Draw blinking cursor bool cursor_is_visible = (!g.IO.OptCursorBlink) || (g.InputTextState.CursorAnim <= 0.0f) || fmodf(g.InputTextState.CursorAnim, 1.20f) <= 0.80f; ImVec2 cursor_screen_pos = render_pos + cursor_offset - render_scroll; ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y-g.FontSize+0.5f, cursor_screen_pos.x+1.0f, cursor_screen_pos.y-1.5f); if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect)) draw_window->DrawList->AddLine(cursor_screen_rect.Min, cursor_screen_rect.GetBL(), GetColorU32(ImGuiCol_Text)); // Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.) if (is_editable) g.OsImePosRequest = ImVec2(cursor_screen_pos.x - 1, cursor_screen_pos.y - g.FontSize); } else { // Render text only const char* buf_end = NULL; if (is_multiline) text_size = ImVec2(size.x, InputTextCalcTextLenAndLineCount(buf_display, &buf_end) * g.FontSize); // We don't need width draw_window->DrawList->AddText(g.Font, g.FontSize, render_pos, GetColorU32(ImGuiCol_Text), buf_display, buf_end, 0.0f, is_multiline ? NULL : &clip_rect); } if (is_multiline) { Dummy(text_size + ImVec2(0.0f, g.FontSize)); // Always add room to scroll an extra line EndChildFrame(); EndGroup(); } if (is_password) PopFont(); // Log as text if (g.LogEnabled && !is_password) LogRenderedText(&render_pos, buf_display, NULL); if (label_size.x > 0) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0) return enter_pressed; else return value_changed; } bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data) { IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline() return InputTextEx(label, buf, (int)buf_size, ImVec2(0,0), flags, callback, user_data); } bool ImGui::InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data) { return InputTextEx(label, buf, (int)buf_size, size, flags | ImGuiInputTextFlags_Multiline, callback, user_data); } // NB: scalar_format here must be a simple "%xx" format string with no prefix/suffix (unlike the Drag/Slider functions "display_format" argument) bool ImGui::InputScalarEx(const char* label, ImGuiDataType data_type, void* data_ptr, void* step_ptr, void* step_fast_ptr, const char* scalar_format, ImGuiInputTextFlags extra_flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImVec2 label_size = CalcTextSize(label, NULL, true); BeginGroup(); PushID(label); const ImVec2 button_sz = ImVec2(GetFrameHeight(), GetFrameHeight()); if (step_ptr) PushItemWidth(ImMax(1.0f, CalcItemWidth() - (button_sz.x + style.ItemInnerSpacing.x)*2)); char buf[64]; DataTypeFormatString(data_type, data_ptr, scalar_format, buf, IM_ARRAYSIZE(buf)); bool value_changed = false; if ((extra_flags & (ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0) extra_flags |= ImGuiInputTextFlags_CharsDecimal; extra_flags |= ImGuiInputTextFlags_AutoSelectAll; if (InputText("", buf, IM_ARRAYSIZE(buf), extra_flags)) // PushId(label) + "" gives us the expected ID from outside point of view value_changed = DataTypeApplyOpFromText(buf, GImGui->InputTextState.InitialText.begin(), data_type, data_ptr, scalar_format); // Step buttons if (step_ptr) { PopItemWidth(); SameLine(0, style.ItemInnerSpacing.x); if (ButtonEx("-", button_sz, ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups)) { DataTypeApplyOp(data_type, '-', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast_ptr ? step_fast_ptr : step_ptr); value_changed = true; } SameLine(0, style.ItemInnerSpacing.x); if (ButtonEx("+", button_sz, ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups)) { DataTypeApplyOp(data_type, '+', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast_ptr ? step_fast_ptr : step_ptr); value_changed = true; } } PopID(); if (label_size.x > 0) { SameLine(0, style.ItemInnerSpacing.x); RenderText(ImVec2(window->DC.CursorPos.x, window->DC.CursorPos.y + style.FramePadding.y), label); ItemSize(label_size, style.FramePadding.y); } EndGroup(); return value_changed; } bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags extra_flags) { extra_flags |= ImGuiInputTextFlags_CharsScientific; if (decimal_precision < 0) { // Ideally we'd have a minimum decimal precision of 1 to visually denote that this is a float, while hiding non-significant digits? %f doesn't have a minimum of 1 return InputScalarEx(label, ImGuiDataType_Float, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), "%f", extra_flags); } else { char display_format[16]; ImFormatString(display_format, IM_ARRAYSIZE(display_format), "%%.%df", decimal_precision); return InputScalarEx(label, ImGuiDataType_Float, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), display_format, extra_flags); } } bool ImGui::InputDouble(const char* label, double* v, double step, double step_fast, const char* display_format, ImGuiInputTextFlags extra_flags) { extra_flags |= ImGuiInputTextFlags_CharsScientific; return InputScalarEx(label, ImGuiDataType_Double, (void*)v, (void*)(step>0.0 ? &step : NULL), (void*)(step_fast>0.0 ? &step_fast : NULL), display_format, extra_flags); } bool ImGui::InputInt(const char* label, int* v, int step, int step_fast, ImGuiInputTextFlags extra_flags) { // Hexadecimal input provided as a convenience but the flag name is awkward. Typically you'd use InputText() to parse your own data, if you want to handle prefixes. const char* scalar_format = (extra_flags & ImGuiInputTextFlags_CharsHexadecimal) ? "%08X" : "%d"; return InputScalarEx(label, ImGuiDataType_Int, (void*)v, (void*)(step>0 ? &step : NULL), (void*)(step_fast>0 ? &step_fast : NULL), scalar_format, extra_flags); } bool ImGui::InputFloatN(const char* label, float* v, int components, int decimal_precision, ImGuiInputTextFlags extra_flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; bool value_changed = false; BeginGroup(); PushID(label); PushMultiItemsWidths(components); for (int i = 0; i < components; i++) { PushID(i); value_changed |= InputFloat("##v", &v[i], 0, 0, decimal_precision, extra_flags); SameLine(0, g.Style.ItemInnerSpacing.x); PopID(); PopItemWidth(); } PopID(); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); return value_changed; } bool ImGui::InputFloat2(const char* label, float v[2], int decimal_precision, ImGuiInputTextFlags extra_flags) { return InputFloatN(label, v, 2, decimal_precision, extra_flags); } bool ImGui::InputFloat3(const char* label, float v[3], int decimal_precision, ImGuiInputTextFlags extra_flags) { return InputFloatN(label, v, 3, decimal_precision, extra_flags); } bool ImGui::InputFloat4(const char* label, float v[4], int decimal_precision, ImGuiInputTextFlags extra_flags) { return InputFloatN(label, v, 4, decimal_precision, extra_flags); } bool ImGui::InputIntN(const char* label, int* v, int components, ImGuiInputTextFlags extra_flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; bool value_changed = false; BeginGroup(); PushID(label); PushMultiItemsWidths(components); for (int i = 0; i < components; i++) { PushID(i); value_changed |= InputInt("##v", &v[i], 0, 0, extra_flags); SameLine(0, g.Style.ItemInnerSpacing.x); PopID(); PopItemWidth(); } PopID(); TextUnformatted(label, FindRenderedTextEnd(label)); EndGroup(); return value_changed; } bool ImGui::InputInt2(const char* label, int v[2], ImGuiInputTextFlags extra_flags) { return InputIntN(label, v, 2, extra_flags); } bool ImGui::InputInt3(const char* label, int v[3], ImGuiInputTextFlags extra_flags) { return InputIntN(label, v, 3, extra_flags); } bool ImGui::InputInt4(const char* label, int v[4], ImGuiInputTextFlags extra_flags) { return InputIntN(label, v, 4, extra_flags); } static float CalcMaxPopupHeightFromItemCount(int items_count) { ImGuiContext& g = *GImGui; if (items_count <= 0) return FLT_MAX; return (g.FontSize + g.Style.ItemSpacing.y) * items_count - g.Style.ItemSpacing.y + (g.Style.WindowPadding.y * 2); } bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags) { // Always consume the SetNextWindowSizeConstraint() call in our early return paths ImGuiContext& g = *GImGui; ImGuiCond backup_next_window_size_constraint = g.NextWindowData.SizeConstraintCond; g.NextWindowData.SizeConstraintCond = 0; ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; IM_ASSERT((flags & (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)) != (ImGuiComboFlags_NoArrowButton | ImGuiComboFlags_NoPreview)); // Can't use both flags together const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const float arrow_size = (flags & ImGuiComboFlags_NoArrowButton) ? 0.0f : GetFrameHeight(); const ImVec2 label_size = CalcTextSize(label, NULL, true); const float w = (flags & ImGuiComboFlags_NoPreview) ? arrow_size : CalcItemWidth(); const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f)); const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); ItemSize(total_bb, style.FramePadding.y); if (!ItemAdd(total_bb, id, &frame_bb)) return false; bool hovered, held; bool pressed = ButtonBehavior(frame_bb, id, &hovered, &held); bool popup_open = IsPopupOpen(id); const ImRect value_bb(frame_bb.Min, frame_bb.Max - ImVec2(arrow_size, 0.0f)); const ImU32 frame_col = GetColorU32(hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg); RenderNavHighlight(frame_bb, id); if (!(flags & ImGuiComboFlags_NoPreview)) window->DrawList->AddRectFilled(frame_bb.Min, ImVec2(frame_bb.Max.x - arrow_size, frame_bb.Max.y), frame_col, style.FrameRounding, ImDrawCornerFlags_Left); if (!(flags & ImGuiComboFlags_NoArrowButton)) { window->DrawList->AddRectFilled(ImVec2(frame_bb.Max.x - arrow_size, frame_bb.Min.y), frame_bb.Max, GetColorU32((popup_open || hovered) ? ImGuiCol_ButtonHovered : ImGuiCol_Button), style.FrameRounding, (w <= arrow_size) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Right); RenderArrow(ImVec2(frame_bb.Max.x - arrow_size + style.FramePadding.y, frame_bb.Min.y + style.FramePadding.y), ImGuiDir_Down); } RenderFrameBorder(frame_bb.Min, frame_bb.Max, style.FrameRounding); if (preview_value != NULL && !(flags & ImGuiComboFlags_NoPreview)) RenderTextClipped(frame_bb.Min + style.FramePadding, value_bb.Max, preview_value, NULL, NULL, ImVec2(0.0f,0.0f)); if (label_size.x > 0) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); if ((pressed || g.NavActivateId == id) && !popup_open) { if (window->DC.NavLayerCurrent == 0) window->NavLastIds[0] = id; OpenPopupEx(id); popup_open = true; } if (!popup_open) return false; if (backup_next_window_size_constraint) { g.NextWindowData.SizeConstraintCond = backup_next_window_size_constraint; g.NextWindowData.SizeConstraintRect.Min.x = ImMax(g.NextWindowData.SizeConstraintRect.Min.x, w); } else { if ((flags & ImGuiComboFlags_HeightMask_) == 0) flags |= ImGuiComboFlags_HeightRegular; IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiComboFlags_HeightMask_)); // Only one int popup_max_height_in_items = -1; if (flags & ImGuiComboFlags_HeightRegular) popup_max_height_in_items = 8; else if (flags & ImGuiComboFlags_HeightSmall) popup_max_height_in_items = 4; else if (flags & ImGuiComboFlags_HeightLarge) popup_max_height_in_items = 20; SetNextWindowSizeConstraints(ImVec2(w, 0.0f), ImVec2(FLT_MAX, CalcMaxPopupHeightFromItemCount(popup_max_height_in_items))); } char name[16]; ImFormatString(name, IM_ARRAYSIZE(name), "##Combo_%02d", g.CurrentPopupStack.Size); // Recycle windows based on depth // Peak into expected window size so we can position it if (ImGuiWindow* popup_window = FindWindowByName(name)) if (popup_window->WasActive) { ImVec2 size_contents = CalcSizeContents(popup_window); ImVec2 size_expected = CalcSizeAfterConstraint(popup_window, CalcSizeAutoFit(popup_window, size_contents)); if (flags & ImGuiComboFlags_PopupAlignLeft) popup_window->AutoPosLastDirection = ImGuiDir_Left; ImRect r_outer = FindScreenRectForWindow(popup_window); ImVec2 pos = FindBestWindowPosForPopupEx(frame_bb.GetBL(), size_expected, &popup_window->AutoPosLastDirection, r_outer, frame_bb, ImGuiPopupPositionPolicy_ComboBox); SetNextWindowPos(pos); } ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings; if (!Begin(name, NULL, window_flags)) { EndPopup(); IM_ASSERT(0); // This should never happen as we tested for IsPopupOpen() above return false; } // Horizontally align ourselves with the framed text if (style.FramePadding.x != style.WindowPadding.x) Indent(style.FramePadding.x - style.WindowPadding.x); return true; } void ImGui::EndCombo() { const ImGuiStyle& style = GImGui->Style; if (style.FramePadding.x != style.WindowPadding.x) Unindent(style.FramePadding.x - style.WindowPadding.x); EndPopup(); } // Old API, prefer using BeginCombo() nowadays if you can. bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int popup_max_height_in_items) { ImGuiContext& g = *GImGui; const char* preview_text = NULL; if (*current_item >= 0 && *current_item < items_count) items_getter(data, *current_item, &preview_text); // The old Combo() API exposed "popup_max_height_in_items", however the new more general BeginCombo() API doesn't, so we emulate it here. if (popup_max_height_in_items != -1 && !g.NextWindowData.SizeConstraintCond) { float popup_max_height = CalcMaxPopupHeightFromItemCount(popup_max_height_in_items); SetNextWindowSizeConstraints(ImVec2(0,0), ImVec2(FLT_MAX, popup_max_height)); } if (!BeginCombo(label, preview_text, 0)) return false; // Display items // FIXME-OPT: Use clipper (but we need to disable it on the appearing frame to make sure our call to SetItemDefaultFocus() is processed) bool value_changed = false; for (int i = 0; i < items_count; i++) { PushID((void*)(intptr_t)i); const bool item_selected = (i == *current_item); const char* item_text; if (!items_getter(data, i, &item_text)) item_text = "*Unknown item*"; if (Selectable(item_text, item_selected)) { value_changed = true; *current_item = i; } if (item_selected) SetItemDefaultFocus(); PopID(); } EndCombo(); return value_changed; } static bool Items_ArrayGetter(void* data, int idx, const char** out_text) { const char* const* items = (const char* const*)data; if (out_text) *out_text = items[idx]; return true; } static bool Items_SingleStringGetter(void* data, int idx, const char** out_text) { // FIXME-OPT: we could pre-compute the indices to fasten this. But only 1 active combo means the waste is limited. const char* items_separated_by_zeros = (const char*)data; int items_count = 0; const char* p = items_separated_by_zeros; while (*p) { if (idx == items_count) break; p += strlen(p) + 1; items_count++; } if (!*p) return false; if (out_text) *out_text = p; return true; } // Combo box helper allowing to pass an array of strings. bool ImGui::Combo(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items) { const bool value_changed = Combo(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_in_items); return value_changed; } // Combo box helper allowing to pass all items in a single string. bool ImGui::Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items) { int items_count = 0; const char* p = items_separated_by_zeros; // FIXME-OPT: Avoid computing this, or at least only when combo is open while (*p) { p += strlen(p) + 1; items_count++; } bool value_changed = Combo(label, current_item, Items_SingleStringGetter, (void*)items_separated_by_zeros, items_count, height_in_items); return value_changed; } // Tip: pass an empty label (e.g. "##dummy") then you can use the space to draw other text or image. // But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID. bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet) // FIXME-OPT: Avoid if vertically clipped. PopClipRect(); ImGuiID id = window->GetID(label); ImVec2 label_size = CalcTextSize(label, NULL, true); ImVec2 size(size_arg.x != 0.0f ? size_arg.x : label_size.x, size_arg.y != 0.0f ? size_arg.y : label_size.y); ImVec2 pos = window->DC.CursorPos; pos.y += window->DC.CurrentLineTextBaseOffset; ImRect bb(pos, pos + size); ItemSize(bb); // Fill horizontal space. ImVec2 window_padding = window->WindowPadding; float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? GetWindowContentRegionMax().x : GetContentRegionMax().x; float w_draw = ImMax(label_size.x, window->Pos.x + max_x - window_padding.x - window->DC.CursorPos.x); ImVec2 size_draw((size_arg.x != 0 && !(flags & ImGuiSelectableFlags_DrawFillAvailWidth)) ? size_arg.x : w_draw, size_arg.y != 0.0f ? size_arg.y : size.y); ImRect bb_with_spacing(pos, pos + size_draw); if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_DrawFillAvailWidth)) bb_with_spacing.Max.x += window_padding.x; // Selectables are tightly packed together, we extend the box to cover spacing between selectable. float spacing_L = (float)(int)(style.ItemSpacing.x * 0.5f); float spacing_U = (float)(int)(style.ItemSpacing.y * 0.5f); float spacing_R = style.ItemSpacing.x - spacing_L; float spacing_D = style.ItemSpacing.y - spacing_U; bb_with_spacing.Min.x -= spacing_L; bb_with_spacing.Min.y -= spacing_U; bb_with_spacing.Max.x += spacing_R; bb_with_spacing.Max.y += spacing_D; if (!ItemAdd(bb_with_spacing, (flags & ImGuiSelectableFlags_Disabled) ? 0 : id)) { if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet) PushColumnClipRect(); return false; } ImGuiButtonFlags button_flags = 0; if (flags & ImGuiSelectableFlags_Menu) button_flags |= ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_NoHoldingActiveID; if (flags & ImGuiSelectableFlags_MenuItem) button_flags |= ImGuiButtonFlags_PressedOnRelease; if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled; if (flags & ImGuiSelectableFlags_AllowDoubleClick) button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick; bool hovered, held; bool pressed = ButtonBehavior(bb_with_spacing, id, &hovered, &held, button_flags); if (flags & ImGuiSelectableFlags_Disabled) selected = false; // Hovering selectable with mouse updates NavId accordingly so navigation can be resumed with gamepad/keyboard (this doesn't happen on most widgets) if (pressed || hovered)// && (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f)) if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerActiveMask) { g.NavDisableHighlight = true; SetNavID(id, window->DC.NavLayerCurrent); } // Render if (hovered || selected) { const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header); RenderFrame(bb_with_spacing.Min, bb_with_spacing.Max, col, false, 0.0f); RenderNavHighlight(bb_with_spacing, id, ImGuiNavHighlightFlags_TypeThin | ImGuiNavHighlightFlags_NoRounding); } if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet) { PushColumnClipRect(); bb_with_spacing.Max.x -= (GetContentRegionMax().x - max_x); } if (flags & ImGuiSelectableFlags_Disabled) PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]); RenderTextClipped(bb.Min, bb_with_spacing.Max, label, NULL, &label_size, ImVec2(0.0f,0.0f)); if (flags & ImGuiSelectableFlags_Disabled) PopStyleColor(); // Automatically close popups if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(window->DC.ItemFlags & ImGuiItemFlags_SelectableDontClosePopup)) CloseCurrentPopup(); return pressed; } bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags, const ImVec2& size_arg) { if (Selectable(label, *p_selected, flags, size_arg)) { *p_selected = !*p_selected; return true; } return false; } // Helper to calculate the size of a listbox and display a label on the right. // Tip: To have a list filling the entire window width, PushItemWidth(-1) and pass an empty label "##empty" bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; const ImGuiStyle& style = GetStyle(); const ImGuiID id = GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar. ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y); ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y)); ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size); ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); window->DC.LastItemRect = bb; // Forward storage for ListBoxFooter.. dodgy. BeginGroup(); if (label_size.x > 0) RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); BeginChildFrame(id, frame_bb.GetSize()); return true; } bool ImGui::ListBoxHeader(const char* label, int items_count, int height_in_items) { // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar. // However we don't add +0.40f if items_count <= height_in_items. It is slightly dodgy, because it means a dynamic list of items will make the widget resize occasionally when it crosses that size. // I am expecting that someone will come and complain about this behavior in a remote future, then we can advise on a better solution. if (height_in_items < 0) height_in_items = ImMin(items_count, 7); float height_in_items_f = height_in_items < items_count ? (height_in_items + 0.40f) : (height_in_items + 0.00f); // We include ItemSpacing.y so that a list sized for the exact number of items doesn't make a scrollbar appears. We could also enforce that by passing a flag to BeginChild(). ImVec2 size; size.x = 0.0f; size.y = GetTextLineHeightWithSpacing() * height_in_items_f + GetStyle().ItemSpacing.y; return ListBoxHeader(label, size); } void ImGui::ListBoxFooter() { ImGuiWindow* parent_window = GetCurrentWindow()->ParentWindow; const ImRect bb = parent_window->DC.LastItemRect; const ImGuiStyle& style = GetStyle(); EndChildFrame(); // Redeclare item size so that it includes the label (we have stored the full size in LastItemRect) // We call SameLine() to restore DC.CurrentLine* data SameLine(); parent_window->DC.CursorPos = bb.Min; ItemSize(bb, style.FramePadding.y); EndGroup(); } bool ImGui::ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_items) { const bool value_changed = ListBox(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_items); return value_changed; } bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items) { if (!ListBoxHeader(label, items_count, height_in_items)) return false; // Assume all items have even height (= 1 line of text). If you need items of different or variable sizes you can create a custom version of ListBox() in your code without using the clipper. bool value_changed = false; ImGuiListClipper clipper(items_count, GetTextLineHeightWithSpacing()); // We know exactly our line height here so we pass it as a minor optimization, but generally you don't need to. while (clipper.Step()) for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) { const bool item_selected = (i == *current_item); const char* item_text; if (!items_getter(data, i, &item_text)) item_text = "*Unknown item*"; PushID(i); if (Selectable(item_text, item_selected)) { *current_item = i; value_changed = true; } if (item_selected) SetItemDefaultFocus(); PopID(); } ListBoxFooter(); return value_changed; } bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, bool enabled) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; ImGuiStyle& style = g.Style; ImVec2 pos = window->DC.CursorPos; ImVec2 label_size = CalcTextSize(label, NULL, true); ImGuiSelectableFlags flags = ImGuiSelectableFlags_MenuItem | (enabled ? 0 : ImGuiSelectableFlags_Disabled); bool pressed; if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) { // Mimic the exact layout spacing of BeginMenu() to allow MenuItem() inside a menu bar, which is a little misleading but may be useful // Note that in this situation we render neither the shortcut neither the selected tick mark float w = label_size.x; window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f); PushStyleVar(ImGuiStyleVar_ItemSpacing, style.ItemSpacing * 2.0f); pressed = Selectable(label, false, flags, ImVec2(w, 0.0f)); PopStyleVar(); window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). } else { ImVec2 shortcut_size = shortcut ? CalcTextSize(shortcut, NULL) : ImVec2(0.0f, 0.0f); float w = window->MenuColumns.DeclColumns(label_size.x, shortcut_size.x, (float)(int)(g.FontSize * 1.20f)); // Feedback for next frame float extra_w = ImMax(0.0f, GetContentRegionAvail().x - w); pressed = Selectable(label, false, flags | ImGuiSelectableFlags_DrawFillAvailWidth, ImVec2(w, 0.0f)); if (shortcut_size.x > 0.0f) { PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]); RenderText(pos + ImVec2(window->MenuColumns.Pos[1] + extra_w, 0.0f), shortcut, NULL, false); PopStyleColor(); } if (selected) RenderCheckMark(pos + ImVec2(window->MenuColumns.Pos[2] + extra_w + g.FontSize * 0.40f, g.FontSize * 0.134f * 0.5f), GetColorU32(enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled), g.FontSize * 0.866f); } return pressed; } bool ImGui::MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled) { if (MenuItem(label, shortcut, p_selected ? *p_selected : false, enabled)) { if (p_selected) *p_selected = !*p_selected; return true; } return false; } bool ImGui::BeginMainMenuBar() { ImGuiContext& g = *GImGui; SetNextWindowPos(ImVec2(0.0f, 0.0f)); SetNextWindowSize(ImVec2(g.IO.DisplaySize.x, g.FontBaseSize + g.Style.FramePadding.y * 2.0f)); PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(0,0)); if (!Begin("##MainMenuBar", NULL, ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_MenuBar) || !BeginMenuBar()) { End(); PopStyleVar(2); return false; } g.CurrentWindow->DC.MenuBarOffsetX += g.Style.DisplaySafeAreaPadding.x; return true; } void ImGui::EndMainMenuBar() { EndMenuBar(); // When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window ImGuiContext& g = *GImGui; if (g.CurrentWindow == g.NavWindow && g.NavLayer == 0) FocusFrontMostActiveWindow(g.NavWindow); End(); PopStyleVar(2); } bool ImGui::BeginMenuBar() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; if (!(window->Flags & ImGuiWindowFlags_MenuBar)) return false; IM_ASSERT(!window->DC.MenuBarAppending); BeginGroup(); // Save position PushID("##menubar"); // We don't clip with regular window clipping rectangle as it is already set to the area below. However we clip with window full rect. // We remove 1 worth of rounding to Max.x to that text in long menus don't tend to display over the lower-right rounded area, which looks particularly glitchy. ImRect bar_rect = window->MenuBarRect(); ImRect clip_rect(ImFloor(bar_rect.Min.x + 0.5f), ImFloor(bar_rect.Min.y + window->WindowBorderSize + 0.5f), ImFloor(ImMax(bar_rect.Min.x, bar_rect.Max.x - window->WindowRounding) + 0.5f), ImFloor(bar_rect.Max.y + 0.5f)); clip_rect.ClipWith(window->WindowRectClipped); PushClipRect(clip_rect.Min, clip_rect.Max, false); window->DC.CursorPos = ImVec2(bar_rect.Min.x + window->DC.MenuBarOffsetX, bar_rect.Min.y);// + g.Style.FramePadding.y); window->DC.LayoutType = ImGuiLayoutType_Horizontal; window->DC.NavLayerCurrent++; window->DC.NavLayerCurrentMask <<= 1; window->DC.MenuBarAppending = true; AlignTextToFramePadding(); return true; } void ImGui::EndMenuBar() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; // Nav: When a move request within one of our child menu failed, capture the request to navigate among our siblings. if (NavMoveRequestButNoResultYet() && (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right) && (g.NavWindow->Flags & ImGuiWindowFlags_ChildMenu)) { ImGuiWindow* nav_earliest_child = g.NavWindow; while (nav_earliest_child->ParentWindow && (nav_earliest_child->ParentWindow->Flags & ImGuiWindowFlags_ChildMenu)) nav_earliest_child = nav_earliest_child->ParentWindow; if (nav_earliest_child->ParentWindow == window && nav_earliest_child->DC.ParentLayoutType == ImGuiLayoutType_Horizontal && g.NavMoveRequestForward == ImGuiNavForward_None) { // To do so we claim focus back, restore NavId and then process the movement request for yet another frame. // This involve a one-frame delay which isn't very problematic in this situation. We could remove it by scoring in advance for multiple window (probably not worth the hassle/cost) IM_ASSERT(window->DC.NavLayerActiveMaskNext & 0x02); // Sanity check FocusWindow(window); SetNavIDWithRectRel(window->NavLastIds[1], 1, window->NavRectRel[1]); g.NavLayer = 1; g.NavDisableHighlight = true; // Hide highlight for the current frame so we don't see the intermediary selection. g.NavMoveRequestForward = ImGuiNavForward_ForwardQueued; NavMoveRequestCancel(); } } IM_ASSERT(window->Flags & ImGuiWindowFlags_MenuBar); IM_ASSERT(window->DC.MenuBarAppending); PopClipRect(); PopID(); window->DC.MenuBarOffsetX = window->DC.CursorPos.x - window->MenuBarRect().Min.x; window->DC.GroupStack.back().AdvanceCursor = false; EndGroup(); window->DC.LayoutType = ImGuiLayoutType_Vertical; window->DC.NavLayerCurrent--; window->DC.NavLayerCurrentMask >>= 1; window->DC.MenuBarAppending = false; } bool ImGui::BeginMenu(const char* label, bool enabled) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); ImVec2 label_size = CalcTextSize(label, NULL, true); bool pressed; bool menu_is_open = IsPopupOpen(id); bool menuset_is_open = !(window->Flags & ImGuiWindowFlags_Popup) && (g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].OpenParentId == window->IDStack.back()); ImGuiWindow* backed_nav_window = g.NavWindow; if (menuset_is_open) g.NavWindow = window; // Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent) // The reference position stored in popup_pos will be used by Begin() to find a suitable position for the child menu (using FindBestPopupWindowPos). ImVec2 popup_pos, pos = window->DC.CursorPos; if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) { // Menu inside an horizontal menu bar // Selectable extend their highlight by half ItemSpacing in each direction. // For ChildMenu, the popup position will be overwritten by the call to FindBestPopupWindowPos() in Begin() popup_pos = ImVec2(pos.x - window->WindowPadding.x, pos.y - style.FramePadding.y + window->MenuBarHeight()); window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f); PushStyleVar(ImGuiStyleVar_ItemSpacing, style.ItemSpacing * 2.0f); float w = label_size.x; pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_Menu | ImGuiSelectableFlags_DontClosePopups | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f)); PopStyleVar(); window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar(). } else { // Menu inside a menu popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y); float w = window->MenuColumns.DeclColumns(label_size.x, 0.0f, (float)(int)(g.FontSize * 1.20f)); // Feedback to next frame float extra_w = ImMax(0.0f, GetContentRegionAvail().x - w); pressed = Selectable(label, menu_is_open, ImGuiSelectableFlags_Menu | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_DrawFillAvailWidth | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f)); if (!enabled) PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]); RenderArrow(pos + ImVec2(window->MenuColumns.Pos[2] + extra_w + g.FontSize * 0.30f, 0.0f), ImGuiDir_Right); if (!enabled) PopStyleColor(); } const bool hovered = enabled && ItemHoverable(window->DC.LastItemRect, id); if (menuset_is_open) g.NavWindow = backed_nav_window; bool want_open = false, want_close = false; if (window->DC.LayoutType == ImGuiLayoutType_Vertical) // (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) { // Implement http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown to avoid using timers, so menus feels more reactive. bool moving_within_opened_triangle = false; if (g.HoveredWindow == window && g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].ParentWindow == window && !(window->Flags & ImGuiWindowFlags_MenuBar)) { if (ImGuiWindow* next_window = g.OpenPopupStack[g.CurrentPopupStack.Size].Window) { ImRect next_window_rect = next_window->Rect(); ImVec2 ta = g.IO.MousePos - g.IO.MouseDelta; ImVec2 tb = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetTL() : next_window_rect.GetTR(); ImVec2 tc = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetBL() : next_window_rect.GetBR(); float extra = ImClamp(fabsf(ta.x - tb.x) * 0.30f, 5.0f, 30.0f); // add a bit of extra slack. ta.x += (window->Pos.x < next_window->Pos.x) ? -0.5f : +0.5f; // to avoid numerical issues tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -100.0f); // triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale? tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +100.0f); moving_within_opened_triangle = ImTriangleContainsPoint(ta, tb, tc, g.IO.MousePos); //window->DrawList->PushClipRectFullScreen(); window->DrawList->AddTriangleFilled(ta, tb, tc, moving_within_opened_triangle ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); window->DrawList->PopClipRect(); // Debug } } want_close = (menu_is_open && !hovered && g.HoveredWindow == window && g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrame != id && !moving_within_opened_triangle); want_open = (!menu_is_open && hovered && !moving_within_opened_triangle) || (!menu_is_open && hovered && pressed); if (g.NavActivateId == id) { want_close = menu_is_open; want_open = !menu_is_open; } if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Right) // Nav-Right to open { want_open = true; NavMoveRequestCancel(); } } else { // Menu bar if (menu_is_open && pressed && menuset_is_open) // Click an open menu again to close it { want_close = true; want_open = menu_is_open = false; } else if (pressed || (hovered && menuset_is_open && !menu_is_open)) // First click to open, then hover to open others { want_open = true; } else if (g.NavId == id && g.NavMoveRequest && g.NavMoveDir == ImGuiDir_Down) // Nav-Down to open { want_open = true; NavMoveRequestCancel(); } } if (!enabled) // explicitly close if an open menu becomes disabled, facilitate users code a lot in pattern such as 'if (BeginMenu("options", has_object)) { ..use object.. }' want_close = true; if (want_close && IsPopupOpen(id)) ClosePopupToLevel(g.CurrentPopupStack.Size); if (!menu_is_open && want_open && g.OpenPopupStack.Size > g.CurrentPopupStack.Size) { // Don't recycle same menu level in the same frame, first close the other menu and yield for a frame. OpenPopup(label); return false; } menu_is_open |= want_open; if (want_open) OpenPopup(label); if (menu_is_open) { SetNextWindowPos(popup_pos, ImGuiCond_Always); ImGuiWindowFlags flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ((window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) ? ImGuiWindowFlags_ChildMenu|ImGuiWindowFlags_ChildWindow : ImGuiWindowFlags_ChildMenu); menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display) } return menu_is_open; } void ImGui::EndMenu() { // Nav: When a left move request _within our child menu_ failed, close the menu. // A menu doesn't close itself because EndMenuBar() wants the catch the last Left<>Right inputs. // However it means that with the current code, a BeginMenu() from outside another menu or a menu-bar won't be closable with the Left direction. ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveDir == ImGuiDir_Left && NavMoveRequestButNoResultYet() && window->DC.LayoutType == ImGuiLayoutType_Vertical) { ClosePopupToLevel(g.OpenPopupStack.Size - 1); NavMoveRequestCancel(); } EndPopup(); } // Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags) { ImGuiContext& g = *GImGui; int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]); BeginTooltipEx(0, true); const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text; if (text_end > text) { TextUnformatted(text, text_end); Separator(); } ImVec2 sz(g.FontSize * 3 + g.Style.FramePadding.y * 2, g.FontSize * 3 + g.Style.FramePadding.y * 2); ColorButton("##preview", ImVec4(col[0], col[1], col[2], col[3]), (flags & (ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)) | ImGuiColorEditFlags_NoTooltip, sz); SameLine(); if (flags & ImGuiColorEditFlags_NoAlpha) Text("#%02X%02X%02X\nR: %d, G: %d, B: %d\n(%.3f, %.3f, %.3f)", cr, cg, cb, cr, cg, cb, col[0], col[1], col[2]); else Text("#%02X%02X%02X%02X\nR:%d, G:%d, B:%d, A:%d\n(%.3f, %.3f, %.3f, %.3f)", cr, cg, cb, ca, cr, cg, cb, ca, col[0], col[1], col[2], col[3]); EndTooltip(); } static inline ImU32 ImAlphaBlendColor(ImU32 col_a, ImU32 col_b) { float t = ((col_b >> IM_COL32_A_SHIFT) & 0xFF) / 255.f; int r = ImLerp((int)(col_a >> IM_COL32_R_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_R_SHIFT) & 0xFF, t); int g = ImLerp((int)(col_a >> IM_COL32_G_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_G_SHIFT) & 0xFF, t); int b = ImLerp((int)(col_a >> IM_COL32_B_SHIFT) & 0xFF, (int)(col_b >> IM_COL32_B_SHIFT) & 0xFF, t); return IM_COL32(r, g, b, 0xFF); } // NB: This is rather brittle and will show artifact when rounding this enabled if rounded corners overlap multiple cells. Caller currently responsible for avoiding that. // I spent a non reasonable amount of time trying to getting this right for ColorButton with rounding+anti-aliasing+ImGuiColorEditFlags_HalfAlphaPreview flag + various grid sizes and offsets, and eventually gave up... probably more reasonable to disable rounding alltogether. void ImGui::RenderColorRectWithAlphaCheckerboard(ImVec2 p_min, ImVec2 p_max, ImU32 col, float grid_step, ImVec2 grid_off, float rounding, int rounding_corners_flags) { ImGuiWindow* window = GetCurrentWindow(); if (((col & IM_COL32_A_MASK) >> IM_COL32_A_SHIFT) < 0xFF) { ImU32 col_bg1 = GetColorU32(ImAlphaBlendColor(IM_COL32(204,204,204,255), col)); ImU32 col_bg2 = GetColorU32(ImAlphaBlendColor(IM_COL32(128,128,128,255), col)); window->DrawList->AddRectFilled(p_min, p_max, col_bg1, rounding, rounding_corners_flags); int yi = 0; for (float y = p_min.y + grid_off.y; y < p_max.y; y += grid_step, yi++) { float y1 = ImClamp(y, p_min.y, p_max.y), y2 = ImMin(y + grid_step, p_max.y); if (y2 <= y1) continue; for (float x = p_min.x + grid_off.x + (yi & 1) * grid_step; x < p_max.x; x += grid_step * 2.0f) { float x1 = ImClamp(x, p_min.x, p_max.x), x2 = ImMin(x + grid_step, p_max.x); if (x2 <= x1) continue; int rounding_corners_flags_cell = 0; if (y1 <= p_min.y) { if (x1 <= p_min.x) rounding_corners_flags_cell |= ImDrawCornerFlags_TopLeft; if (x2 >= p_max.x) rounding_corners_flags_cell |= ImDrawCornerFlags_TopRight; } if (y2 >= p_max.y) { if (x1 <= p_min.x) rounding_corners_flags_cell |= ImDrawCornerFlags_BotLeft; if (x2 >= p_max.x) rounding_corners_flags_cell |= ImDrawCornerFlags_BotRight; } rounding_corners_flags_cell &= rounding_corners_flags; window->DrawList->AddRectFilled(ImVec2(x1,y1), ImVec2(x2,y2), col_bg2, rounding_corners_flags_cell ? rounding : 0.0f, rounding_corners_flags_cell); } } } else { window->DrawList->AddRectFilled(p_min, p_max, col, rounding, rounding_corners_flags); } } void ImGui::SetColorEditOptions(ImGuiColorEditFlags flags) { ImGuiContext& g = *GImGui; if ((flags & ImGuiColorEditFlags__InputsMask) == 0) flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__InputsMask; if ((flags & ImGuiColorEditFlags__DataTypeMask) == 0) flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__DataTypeMask; if ((flags & ImGuiColorEditFlags__PickerMask) == 0) flags |= ImGuiColorEditFlags__OptionsDefault & ImGuiColorEditFlags__PickerMask; IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__InputsMask))); // Check only 1 option is selected IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__DataTypeMask))); // Check only 1 option is selected IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__PickerMask))); // Check only 1 option is selected g.ColorEditOptions = flags; } // A little colored square. Return true when clicked. // FIXME: May want to display/ignore the alpha component in the color display? Yet show it in the tooltip. // 'desc_id' is not called 'label' because we don't display it next to the button, but only in the tooltip. bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags, ImVec2 size) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiID id = window->GetID(desc_id); float default_size = GetFrameHeight(); if (size.x == 0.0f) size.x = default_size; if (size.y == 0.0f) size.y = default_size; const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); ItemSize(bb, (size.y >= default_size) ? g.Style.FramePadding.y : 0.0f); if (!ItemAdd(bb, id)) return false; bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held); if (flags & ImGuiColorEditFlags_NoAlpha) flags &= ~(ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf); ImVec4 col_without_alpha(col.x, col.y, col.z, 1.0f); float grid_step = ImMin(size.x, size.y) / 2.99f; float rounding = ImMin(g.Style.FrameRounding, grid_step * 0.5f); ImRect bb_inner = bb; float off = -0.75f; // The border (using Col_FrameBg) tends to look off when color is near-opaque and rounding is enabled. This offset seemed like a good middle ground to reduce those artifacts. bb_inner.Expand(off); if ((flags & ImGuiColorEditFlags_AlphaPreviewHalf) && col.w < 1.0f) { float mid_x = (float)(int)((bb_inner.Min.x + bb_inner.Max.x) * 0.5f + 0.5f); RenderColorRectWithAlphaCheckerboard(ImVec2(bb_inner.Min.x + grid_step, bb_inner.Min.y), bb_inner.Max, GetColorU32(col), grid_step, ImVec2(-grid_step + off, off), rounding, ImDrawCornerFlags_TopRight| ImDrawCornerFlags_BotRight); window->DrawList->AddRectFilled(bb_inner.Min, ImVec2(mid_x, bb_inner.Max.y), GetColorU32(col_without_alpha), rounding, ImDrawCornerFlags_TopLeft|ImDrawCornerFlags_BotLeft); } else { // Because GetColorU32() multiplies by the global style Alpha and we don't want to display a checkerboard if the source code had no alpha ImVec4 col_source = (flags & ImGuiColorEditFlags_AlphaPreview) ? col : col_without_alpha; if (col_source.w < 1.0f) RenderColorRectWithAlphaCheckerboard(bb_inner.Min, bb_inner.Max, GetColorU32(col_source), grid_step, ImVec2(off, off), rounding); else window->DrawList->AddRectFilled(bb_inner.Min, bb_inner.Max, GetColorU32(col_source), rounding, ImDrawCornerFlags_All); } RenderNavHighlight(bb, id); if (g.Style.FrameBorderSize > 0.0f) RenderFrameBorder(bb.Min, bb.Max, rounding); else window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), rounding); // Color button are often in need of some sort of border // Drag and Drop Source if (g.ActiveId == id && BeginDragDropSource()) // NB: The ActiveId test is merely an optional micro-optimization { if (flags & ImGuiColorEditFlags_NoAlpha) SetDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F, &col, sizeof(float) * 3, ImGuiCond_Once); else SetDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F, &col, sizeof(float) * 4, ImGuiCond_Once); ColorButton(desc_id, col, flags); SameLine(); TextUnformatted("Color"); EndDragDropSource(); hovered = false; } // Tooltip if (!(flags & ImGuiColorEditFlags_NoTooltip) && hovered) ColorTooltip(desc_id, &col.x, flags & (ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf)); return pressed; } bool ImGui::ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flags) { return ColorEdit4(label, col, flags | ImGuiColorEditFlags_NoAlpha); } void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags) { bool allow_opt_inputs = !(flags & ImGuiColorEditFlags__InputsMask); bool allow_opt_datatype = !(flags & ImGuiColorEditFlags__DataTypeMask); if ((!allow_opt_inputs && !allow_opt_datatype) || !BeginPopup("context")) return; ImGuiContext& g = *GImGui; ImGuiColorEditFlags opts = g.ColorEditOptions; if (allow_opt_inputs) { if (RadioButton("RGB", (opts & ImGuiColorEditFlags_RGB) ? 1 : 0)) opts = (opts & ~ImGuiColorEditFlags__InputsMask) | ImGuiColorEditFlags_RGB; if (RadioButton("HSV", (opts & ImGuiColorEditFlags_HSV) ? 1 : 0)) opts = (opts & ~ImGuiColorEditFlags__InputsMask) | ImGuiColorEditFlags_HSV; if (RadioButton("HEX", (opts & ImGuiColorEditFlags_HEX) ? 1 : 0)) opts = (opts & ~ImGuiColorEditFlags__InputsMask) | ImGuiColorEditFlags_HEX; } if (allow_opt_datatype) { if (allow_opt_inputs) Separator(); if (RadioButton("0..255", (opts & ImGuiColorEditFlags_Uint8) ? 1 : 0)) opts = (opts & ~ImGuiColorEditFlags__DataTypeMask) | ImGuiColorEditFlags_Uint8; if (RadioButton("0.00..1.00", (opts & ImGuiColorEditFlags_Float) ? 1 : 0)) opts = (opts & ~ImGuiColorEditFlags__DataTypeMask) | ImGuiColorEditFlags_Float; } if (allow_opt_inputs || allow_opt_datatype) Separator(); if (Button("Copy as..", ImVec2(-1,0))) OpenPopup("Copy"); if (BeginPopup("Copy")) { int cr = IM_F32_TO_INT8_SAT(col[0]), cg = IM_F32_TO_INT8_SAT(col[1]), cb = IM_F32_TO_INT8_SAT(col[2]), ca = (flags & ImGuiColorEditFlags_NoAlpha) ? 255 : IM_F32_TO_INT8_SAT(col[3]); char buf[64]; ImFormatString(buf, IM_ARRAYSIZE(buf), "(%.3ff, %.3ff, %.3ff, %.3ff)", col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]); if (Selectable(buf)) SetClipboardText(buf); ImFormatString(buf, IM_ARRAYSIZE(buf), "(%d,%d,%d,%d)", cr, cg, cb, ca); if (Selectable(buf)) SetClipboardText(buf); if (flags & ImGuiColorEditFlags_NoAlpha) ImFormatString(buf, IM_ARRAYSIZE(buf), "0x%02X%02X%02X", cr, cg, cb); else ImFormatString(buf, IM_ARRAYSIZE(buf), "0x%02X%02X%02X%02X", cr, cg, cb, ca); if (Selectable(buf)) SetClipboardText(buf); EndPopup(); } g.ColorEditOptions = opts; EndPopup(); } static void ColorPickerOptionsPopup(ImGuiColorEditFlags flags, const float* ref_col) { bool allow_opt_picker = !(flags & ImGuiColorEditFlags__PickerMask); bool allow_opt_alpha_bar = !(flags & ImGuiColorEditFlags_NoAlpha) && !(flags & ImGuiColorEditFlags_AlphaBar); if ((!allow_opt_picker && !allow_opt_alpha_bar) || !ImGui::BeginPopup("context")) return; ImGuiContext& g = *GImGui; if (allow_opt_picker) { ImVec2 picker_size(g.FontSize * 8, ImMax(g.FontSize * 8 - (ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x), 1.0f)); // FIXME: Picker size copied from main picker function ImGui::PushItemWidth(picker_size.x); for (int picker_type = 0; picker_type < 2; picker_type++) { // Draw small/thumbnail version of each picker type (over an invisible button for selection) if (picker_type > 0) ImGui::Separator(); ImGui::PushID(picker_type); ImGuiColorEditFlags picker_flags = ImGuiColorEditFlags_NoInputs|ImGuiColorEditFlags_NoOptions|ImGuiColorEditFlags_NoLabel|ImGuiColorEditFlags_NoSidePreview|(flags & ImGuiColorEditFlags_NoAlpha); if (picker_type == 0) picker_flags |= ImGuiColorEditFlags_PickerHueBar; if (picker_type == 1) picker_flags |= ImGuiColorEditFlags_PickerHueWheel; ImVec2 backup_pos = ImGui::GetCursorScreenPos(); if (ImGui::Selectable("##selectable", false, 0, picker_size)) // By default, Selectable() is closing popup g.ColorEditOptions = (g.ColorEditOptions & ~ImGuiColorEditFlags__PickerMask) | (picker_flags & ImGuiColorEditFlags__PickerMask); ImGui::SetCursorScreenPos(backup_pos); ImVec4 dummy_ref_col; memcpy(&dummy_ref_col.x, ref_col, sizeof(float) * (picker_flags & ImGuiColorEditFlags_NoAlpha ? 3 : 4)); ImGui::ColorPicker4("##dummypicker", &dummy_ref_col.x, picker_flags); ImGui::PopID(); } ImGui::PopItemWidth(); } if (allow_opt_alpha_bar) { if (allow_opt_picker) ImGui::Separator(); ImGui::CheckboxFlags("Alpha Bar", (unsigned int*)&g.ColorEditOptions, ImGuiColorEditFlags_AlphaBar); } ImGui::EndPopup(); } // Edit colors components (each component in 0.0f..1.0f range). // See enum ImGuiColorEditFlags_ for available options. e.g. Only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. // With typical options: Left-click on colored square to open color picker. Right-click to open option menu. CTRL-Click over input fields to edit them and TAB to go to next item. bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const float square_sz = GetFrameHeight(); const float w_extra = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x); const float w_items_all = CalcItemWidth() - w_extra; const char* label_display_end = FindRenderedTextEnd(label); const bool alpha = (flags & ImGuiColorEditFlags_NoAlpha) == 0; const bool hdr = (flags & ImGuiColorEditFlags_HDR) != 0; const int components = alpha ? 4 : 3; const ImGuiColorEditFlags flags_untouched = flags; BeginGroup(); PushID(label); // If we're not showing any slider there's no point in doing any HSV conversions if (flags & ImGuiColorEditFlags_NoInputs) flags = (flags & (~ImGuiColorEditFlags__InputsMask)) | ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_NoOptions; // Context menu: display and modify options (before defaults are applied) if (!(flags & ImGuiColorEditFlags_NoOptions)) ColorEditOptionsPopup(col, flags); // Read stored options if (!(flags & ImGuiColorEditFlags__InputsMask)) flags |= (g.ColorEditOptions & ImGuiColorEditFlags__InputsMask); if (!(flags & ImGuiColorEditFlags__DataTypeMask)) flags |= (g.ColorEditOptions & ImGuiColorEditFlags__DataTypeMask); if (!(flags & ImGuiColorEditFlags__PickerMask)) flags |= (g.ColorEditOptions & ImGuiColorEditFlags__PickerMask); flags |= (g.ColorEditOptions & ~(ImGuiColorEditFlags__InputsMask | ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__PickerMask)); // Convert to the formats we need float f[4] = { col[0], col[1], col[2], alpha ? col[3] : 1.0f }; if (flags & ImGuiColorEditFlags_HSV) ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]); int i[4] = { IM_F32_TO_INT8_UNBOUND(f[0]), IM_F32_TO_INT8_UNBOUND(f[1]), IM_F32_TO_INT8_UNBOUND(f[2]), IM_F32_TO_INT8_UNBOUND(f[3]) }; bool value_changed = false; bool value_changed_as_float = false; if ((flags & (ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_HSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0) { // RGB/HSV 0..255 Sliders const float w_item_one = ImMax(1.0f, (float)(int)((w_items_all - (style.ItemInnerSpacing.x) * (components-1)) / (float)components)); const float w_item_last = ImMax(1.0f, (float)(int)(w_items_all - (w_item_one + style.ItemInnerSpacing.x) * (components-1))); const bool hide_prefix = (w_item_one <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x); const char* ids[4] = { "##X", "##Y", "##Z", "##W" }; const char* fmt_table_int[3][4] = { { "%3.0f", "%3.0f", "%3.0f", "%3.0f" }, // Short display { "R:%3.0f", "G:%3.0f", "B:%3.0f", "A:%3.0f" }, // Long display for RGBA { "H:%3.0f", "S:%3.0f", "V:%3.0f", "A:%3.0f" } // Long display for HSVA }; const char* fmt_table_float[3][4] = { { "%0.3f", "%0.3f", "%0.3f", "%0.3f" }, // Short display { "R:%0.3f", "G:%0.3f", "B:%0.3f", "A:%0.3f" }, // Long display for RGBA { "H:%0.3f", "S:%0.3f", "V:%0.3f", "A:%0.3f" } // Long display for HSVA }; const int fmt_idx = hide_prefix ? 0 : (flags & ImGuiColorEditFlags_HSV) ? 2 : 1; PushItemWidth(w_item_one); for (int n = 0; n < components; n++) { if (n > 0) SameLine(0, style.ItemInnerSpacing.x); if (n + 1 == components) PushItemWidth(w_item_last); if (flags & ImGuiColorEditFlags_Float) value_changed = value_changed_as_float = value_changed | DragFloat(ids[n], &f[n], 1.0f/255.0f, 0.0f, hdr ? 0.0f : 1.0f, fmt_table_float[fmt_idx][n]); else value_changed |= DragInt(ids[n], &i[n], 1.0f, 0, hdr ? 0 : 255, fmt_table_int[fmt_idx][n]); if (!(flags & ImGuiColorEditFlags_NoOptions)) OpenPopupOnItemClick("context"); } PopItemWidth(); PopItemWidth(); } else if ((flags & ImGuiColorEditFlags_HEX) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0) { // RGB Hexadecimal Input char buf[64]; if (alpha) ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X%02X", ImClamp(i[0],0,255), ImClamp(i[1],0,255), ImClamp(i[2],0,255), ImClamp(i[3],0,255)); else ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp(i[0],0,255), ImClamp(i[1],0,255), ImClamp(i[2],0,255)); PushItemWidth(w_items_all); if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase)) { value_changed = true; char* p = buf; while (*p == '#' || ImCharIsSpace((unsigned int)*p)) p++; i[0] = i[1] = i[2] = i[3] = 0; if (alpha) sscanf(p, "%02X%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2], (unsigned int*)&i[3]); // Treat at unsigned (%X is unsigned) else sscanf(p, "%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2]); } if (!(flags & ImGuiColorEditFlags_NoOptions)) OpenPopupOnItemClick("context"); PopItemWidth(); } ImGuiWindow* picker_active_window = NULL; if (!(flags & ImGuiColorEditFlags_NoSmallPreview)) { if (!(flags & ImGuiColorEditFlags_NoInputs)) SameLine(0, style.ItemInnerSpacing.x); const ImVec4 col_v4(col[0], col[1], col[2], alpha ? col[3] : 1.0f); if (ColorButton("##ColorButton", col_v4, flags)) { if (!(flags & ImGuiColorEditFlags_NoPicker)) { // Store current color and open a picker g.ColorPickerRef = col_v4; OpenPopup("picker"); SetNextWindowPos(window->DC.LastItemRect.GetBL() + ImVec2(-1,style.ItemSpacing.y)); } } if (!(flags & ImGuiColorEditFlags_NoOptions)) OpenPopupOnItemClick("context"); if (BeginPopup("picker")) { picker_active_window = g.CurrentWindow; if (label != label_display_end) { TextUnformatted(label, label_display_end); Separator(); } ImGuiColorEditFlags picker_flags_to_forward = ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__PickerMask | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaBar; ImGuiColorEditFlags picker_flags = (flags_untouched & picker_flags_to_forward) | ImGuiColorEditFlags__InputsMask | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_AlphaPreviewHalf; PushItemWidth(square_sz * 12.0f); // Use 256 + bar sizes? value_changed |= ColorPicker4("##picker", col, picker_flags, &g.ColorPickerRef.x); PopItemWidth(); EndPopup(); } } if (label != label_display_end && !(flags & ImGuiColorEditFlags_NoLabel)) { SameLine(0, style.ItemInnerSpacing.x); TextUnformatted(label, label_display_end); } // Convert back if (picker_active_window == NULL) { if (!value_changed_as_float) for (int n = 0; n < 4; n++) f[n] = i[n] / 255.0f; if (flags & ImGuiColorEditFlags_HSV) ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]); if (value_changed) { col[0] = f[0]; col[1] = f[1]; col[2] = f[2]; if (alpha) col[3] = f[3]; } } PopID(); EndGroup(); // Drag and Drop Target if ((window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) && BeginDragDropTarget()) // NB: The flag test is merely an optional micro-optimization, BeginDragDropTarget() does the same test. { if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F)) { memcpy((float*)col, payload->Data, sizeof(float) * 3); value_changed = true; } if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F)) { memcpy((float*)col, payload->Data, sizeof(float) * components); value_changed = true; } EndDragDropTarget(); } // When picker is being actively used, use its active id so IsItemActive() will function on ColorEdit4(). if (picker_active_window && g.ActiveId != 0 && g.ActiveIdWindow == picker_active_window) window->DC.LastItemId = g.ActiveId; return value_changed; } bool ImGui::ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags) { float col4[4] = { col[0], col[1], col[2], 1.0f }; if (!ColorPicker4(label, col4, flags | ImGuiColorEditFlags_NoAlpha)) return false; col[0] = col4[0]; col[1] = col4[1]; col[2] = col4[2]; return true; } // 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side. static void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col) { switch (direction) { case ImGuiDir_Left: draw_list->AddTriangleFilled(ImVec2(pos.x + half_sz.x, pos.y - half_sz.y), ImVec2(pos.x + half_sz.x, pos.y + half_sz.y), pos, col); return; case ImGuiDir_Right: draw_list->AddTriangleFilled(ImVec2(pos.x - half_sz.x, pos.y + half_sz.y), ImVec2(pos.x - half_sz.x, pos.y - half_sz.y), pos, col); return; case ImGuiDir_Up: draw_list->AddTriangleFilled(ImVec2(pos.x + half_sz.x, pos.y + half_sz.y), ImVec2(pos.x - half_sz.x, pos.y + half_sz.y), pos, col); return; case ImGuiDir_Down: draw_list->AddTriangleFilled(ImVec2(pos.x - half_sz.x, pos.y - half_sz.y), ImVec2(pos.x + half_sz.x, pos.y - half_sz.y), pos, col); return; case ImGuiDir_None: case ImGuiDir_COUNT: break; // Fix warnings } } static void RenderArrowsForVerticalBar(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, float bar_w) { RenderArrow(draw_list, ImVec2(pos.x + half_sz.x + 1, pos.y), ImVec2(half_sz.x + 2, half_sz.y + 1), ImGuiDir_Right, IM_COL32_BLACK); RenderArrow(draw_list, ImVec2(pos.x + half_sz.x, pos.y), half_sz, ImGuiDir_Right, IM_COL32_WHITE); RenderArrow(draw_list, ImVec2(pos.x + bar_w - half_sz.x - 1, pos.y), ImVec2(half_sz.x + 2, half_sz.y + 1), ImGuiDir_Left, IM_COL32_BLACK); RenderArrow(draw_list, ImVec2(pos.x + bar_w - half_sz.x, pos.y), half_sz, ImGuiDir_Left, IM_COL32_WHITE); } // ColorPicker // Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. // FIXME: we adjust the big color square height based on item width, which may cause a flickering feedback loop (if automatic height makes a vertical scrollbar appears, affecting automatic width..) bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags, const float* ref_col) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); ImDrawList* draw_list = window->DrawList; ImGuiStyle& style = g.Style; ImGuiIO& io = g.IO; PushID(label); BeginGroup(); if (!(flags & ImGuiColorEditFlags_NoSidePreview)) flags |= ImGuiColorEditFlags_NoSmallPreview; // Context menu: display and store options. if (!(flags & ImGuiColorEditFlags_NoOptions)) ColorPickerOptionsPopup(flags, col); // Read stored options if (!(flags & ImGuiColorEditFlags__PickerMask)) flags |= ((g.ColorEditOptions & ImGuiColorEditFlags__PickerMask) ? g.ColorEditOptions : ImGuiColorEditFlags__OptionsDefault) & ImGuiColorEditFlags__PickerMask; IM_ASSERT(ImIsPowerOfTwo((int)(flags & ImGuiColorEditFlags__PickerMask))); // Check that only 1 is selected if (!(flags & ImGuiColorEditFlags_NoOptions)) flags |= (g.ColorEditOptions & ImGuiColorEditFlags_AlphaBar); // Setup int components = (flags & ImGuiColorEditFlags_NoAlpha) ? 3 : 4; bool alpha_bar = (flags & ImGuiColorEditFlags_AlphaBar) && !(flags & ImGuiColorEditFlags_NoAlpha); ImVec2 picker_pos = window->DC.CursorPos; float square_sz = GetFrameHeight(); float bars_width = square_sz; // Arbitrary smallish width of Hue/Alpha picking bars float sv_picker_size = ImMax(bars_width * 1, CalcItemWidth() - (alpha_bar ? 2 : 1) * (bars_width + style.ItemInnerSpacing.x)); // Saturation/Value picking box float bar0_pos_x = picker_pos.x + sv_picker_size + style.ItemInnerSpacing.x; float bar1_pos_x = bar0_pos_x + bars_width + style.ItemInnerSpacing.x; float bars_triangles_half_sz = (float)(int)(bars_width * 0.20f); float backup_initial_col[4]; memcpy(backup_initial_col, col, components * sizeof(float)); float wheel_thickness = sv_picker_size * 0.08f; float wheel_r_outer = sv_picker_size * 0.50f; float wheel_r_inner = wheel_r_outer - wheel_thickness; ImVec2 wheel_center(picker_pos.x + (sv_picker_size + bars_width)*0.5f, picker_pos.y + sv_picker_size*0.5f); // Note: the triangle is displayed rotated with triangle_pa pointing to Hue, but most coordinates stays unrotated for logic. float triangle_r = wheel_r_inner - (int)(sv_picker_size * 0.027f); ImVec2 triangle_pa = ImVec2(triangle_r, 0.0f); // Hue point. ImVec2 triangle_pb = ImVec2(triangle_r * -0.5f, triangle_r * -0.866025f); // Black point. ImVec2 triangle_pc = ImVec2(triangle_r * -0.5f, triangle_r * +0.866025f); // White point. float H,S,V; ColorConvertRGBtoHSV(col[0], col[1], col[2], H, S, V); bool value_changed = false, value_changed_h = false, value_changed_sv = false; PushItemFlag(ImGuiItemFlags_NoNav, true); if (flags & ImGuiColorEditFlags_PickerHueWheel) { // Hue wheel + SV triangle logic InvisibleButton("hsv", ImVec2(sv_picker_size + style.ItemInnerSpacing.x + bars_width, sv_picker_size)); if (IsItemActive()) { ImVec2 initial_off = g.IO.MouseClickedPos[0] - wheel_center; ImVec2 current_off = g.IO.MousePos - wheel_center; float initial_dist2 = ImLengthSqr(initial_off); if (initial_dist2 >= (wheel_r_inner-1)*(wheel_r_inner-1) && initial_dist2 <= (wheel_r_outer+1)*(wheel_r_outer+1)) { // Interactive with Hue wheel H = atan2f(current_off.y, current_off.x) / IM_PI*0.5f; if (H < 0.0f) H += 1.0f; value_changed = value_changed_h = true; } float cos_hue_angle = cosf(-H * 2.0f * IM_PI); float sin_hue_angle = sinf(-H * 2.0f * IM_PI); if (ImTriangleContainsPoint(triangle_pa, triangle_pb, triangle_pc, ImRotate(initial_off, cos_hue_angle, sin_hue_angle))) { // Interacting with SV triangle ImVec2 current_off_unrotated = ImRotate(current_off, cos_hue_angle, sin_hue_angle); if (!ImTriangleContainsPoint(triangle_pa, triangle_pb, triangle_pc, current_off_unrotated)) current_off_unrotated = ImTriangleClosestPoint(triangle_pa, triangle_pb, triangle_pc, current_off_unrotated); float uu, vv, ww; ImTriangleBarycentricCoords(triangle_pa, triangle_pb, triangle_pc, current_off_unrotated, uu, vv, ww); V = ImClamp(1.0f - vv, 0.0001f, 1.0f); S = ImClamp(uu / V, 0.0001f, 1.0f); value_changed = value_changed_sv = true; } } if (!(flags & ImGuiColorEditFlags_NoOptions)) OpenPopupOnItemClick("context"); } else if (flags & ImGuiColorEditFlags_PickerHueBar) { // SV rectangle logic InvisibleButton("sv", ImVec2(sv_picker_size, sv_picker_size)); if (IsItemActive()) { S = ImSaturate((io.MousePos.x - picker_pos.x) / (sv_picker_size-1)); V = 1.0f - ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size-1)); value_changed = value_changed_sv = true; } if (!(flags & ImGuiColorEditFlags_NoOptions)) OpenPopupOnItemClick("context"); // Hue bar logic SetCursorScreenPos(ImVec2(bar0_pos_x, picker_pos.y)); InvisibleButton("hue", ImVec2(bars_width, sv_picker_size)); if (IsItemActive()) { H = ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size-1)); value_changed = value_changed_h = true; } } // Alpha bar logic if (alpha_bar) { SetCursorScreenPos(ImVec2(bar1_pos_x, picker_pos.y)); InvisibleButton("alpha", ImVec2(bars_width, sv_picker_size)); if (IsItemActive()) { col[3] = 1.0f - ImSaturate((io.MousePos.y - picker_pos.y) / (sv_picker_size-1)); value_changed = true; } } PopItemFlag(); // ImGuiItemFlags_NoNav if (!(flags & ImGuiColorEditFlags_NoSidePreview)) { SameLine(0, style.ItemInnerSpacing.x); BeginGroup(); } if (!(flags & ImGuiColorEditFlags_NoLabel)) { const char* label_display_end = FindRenderedTextEnd(label); if (label != label_display_end) { if ((flags & ImGuiColorEditFlags_NoSidePreview)) SameLine(0, style.ItemInnerSpacing.x); TextUnformatted(label, label_display_end); } } if (!(flags & ImGuiColorEditFlags_NoSidePreview)) { PushItemFlag(ImGuiItemFlags_NoNavDefaultFocus, true); ImVec4 col_v4(col[0], col[1], col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : col[3]); if ((flags & ImGuiColorEditFlags_NoLabel)) Text("Current"); ColorButton("##current", col_v4, (flags & (ImGuiColorEditFlags_HDR|ImGuiColorEditFlags_AlphaPreview|ImGuiColorEditFlags_AlphaPreviewHalf|ImGuiColorEditFlags_NoTooltip)), ImVec2(square_sz * 3, square_sz * 2)); if (ref_col != NULL) { Text("Original"); ImVec4 ref_col_v4(ref_col[0], ref_col[1], ref_col[2], (flags & ImGuiColorEditFlags_NoAlpha) ? 1.0f : ref_col[3]); if (ColorButton("##original", ref_col_v4, (flags & (ImGuiColorEditFlags_HDR|ImGuiColorEditFlags_AlphaPreview|ImGuiColorEditFlags_AlphaPreviewHalf|ImGuiColorEditFlags_NoTooltip)), ImVec2(square_sz * 3, square_sz * 2))) { memcpy(col, ref_col, components * sizeof(float)); value_changed = true; } } PopItemFlag(); EndGroup(); } // Convert back color to RGB if (value_changed_h || value_changed_sv) ColorConvertHSVtoRGB(H >= 1.0f ? H - 10 * 1e-6f : H, S > 0.0f ? S : 10*1e-6f, V > 0.0f ? V : 1e-6f, col[0], col[1], col[2]); // R,G,B and H,S,V slider color editor if ((flags & ImGuiColorEditFlags_NoInputs) == 0) { PushItemWidth((alpha_bar ? bar1_pos_x : bar0_pos_x) + bars_width - picker_pos.x); ImGuiColorEditFlags sub_flags_to_forward = ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoSmallPreview | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf; ImGuiColorEditFlags sub_flags = (flags & sub_flags_to_forward) | ImGuiColorEditFlags_NoPicker; if (flags & ImGuiColorEditFlags_RGB || (flags & ImGuiColorEditFlags__InputsMask) == 0) value_changed |= ColorEdit4("##rgb", col, sub_flags | ImGuiColorEditFlags_RGB); if (flags & ImGuiColorEditFlags_HSV || (flags & ImGuiColorEditFlags__InputsMask) == 0) value_changed |= ColorEdit4("##hsv", col, sub_flags | ImGuiColorEditFlags_HSV); if (flags & ImGuiColorEditFlags_HEX || (flags & ImGuiColorEditFlags__InputsMask) == 0) value_changed |= ColorEdit4("##hex", col, sub_flags | ImGuiColorEditFlags_HEX); PopItemWidth(); } // Try to cancel hue wrap (after ColorEdit), if any if (value_changed) { float new_H, new_S, new_V; ColorConvertRGBtoHSV(col[0], col[1], col[2], new_H, new_S, new_V); if (new_H <= 0 && H > 0) { if (new_V <= 0 && V != new_V) ColorConvertHSVtoRGB(H, S, new_V <= 0 ? V * 0.5f : new_V, col[0], col[1], col[2]); else if (new_S <= 0) ColorConvertHSVtoRGB(H, new_S <= 0 ? S * 0.5f : new_S, new_V, col[0], col[1], col[2]); } } ImVec4 hue_color_f(1, 1, 1, 1); ColorConvertHSVtoRGB(H, 1, 1, hue_color_f.x, hue_color_f.y, hue_color_f.z); ImU32 hue_color32 = ColorConvertFloat4ToU32(hue_color_f); ImU32 col32_no_alpha = ColorConvertFloat4ToU32(ImVec4(col[0], col[1], col[2], 1.0f)); const ImU32 hue_colors[6+1] = { IM_COL32(255,0,0,255), IM_COL32(255,255,0,255), IM_COL32(0,255,0,255), IM_COL32(0,255,255,255), IM_COL32(0,0,255,255), IM_COL32(255,0,255,255), IM_COL32(255,0,0,255) }; ImVec2 sv_cursor_pos; if (flags & ImGuiColorEditFlags_PickerHueWheel) { // Render Hue Wheel const float aeps = 1.5f / wheel_r_outer; // Half a pixel arc length in radians (2pi cancels out). const int segment_per_arc = ImMax(4, (int)wheel_r_outer / 12); for (int n = 0; n < 6; n++) { const float a0 = (n) /6.0f * 2.0f * IM_PI - aeps; const float a1 = (n+1.0f)/6.0f * 2.0f * IM_PI + aeps; const int vert_start_idx = draw_list->VtxBuffer.Size; draw_list->PathArcTo(wheel_center, (wheel_r_inner + wheel_r_outer)*0.5f, a0, a1, segment_per_arc); draw_list->PathStroke(IM_COL32_WHITE, false, wheel_thickness); const int vert_end_idx = draw_list->VtxBuffer.Size; // Paint colors over existing vertices ImVec2 gradient_p0(wheel_center.x + cosf(a0) * wheel_r_inner, wheel_center.y + sinf(a0) * wheel_r_inner); ImVec2 gradient_p1(wheel_center.x + cosf(a1) * wheel_r_inner, wheel_center.y + sinf(a1) * wheel_r_inner); ShadeVertsLinearColorGradientKeepAlpha(draw_list->VtxBuffer.Data + vert_start_idx, draw_list->VtxBuffer.Data + vert_end_idx, gradient_p0, gradient_p1, hue_colors[n], hue_colors[n+1]); } // Render Cursor + preview on Hue Wheel float cos_hue_angle = cosf(H * 2.0f * IM_PI); float sin_hue_angle = sinf(H * 2.0f * IM_PI); ImVec2 hue_cursor_pos(wheel_center.x + cos_hue_angle * (wheel_r_inner+wheel_r_outer)*0.5f, wheel_center.y + sin_hue_angle * (wheel_r_inner+wheel_r_outer)*0.5f); float hue_cursor_rad = value_changed_h ? wheel_thickness * 0.65f : wheel_thickness * 0.55f; int hue_cursor_segments = ImClamp((int)(hue_cursor_rad / 1.4f), 9, 32); draw_list->AddCircleFilled(hue_cursor_pos, hue_cursor_rad, hue_color32, hue_cursor_segments); draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad+1, IM_COL32(128,128,128,255), hue_cursor_segments); draw_list->AddCircle(hue_cursor_pos, hue_cursor_rad, IM_COL32_WHITE, hue_cursor_segments); // Render SV triangle (rotated according to hue) ImVec2 tra = wheel_center + ImRotate(triangle_pa, cos_hue_angle, sin_hue_angle); ImVec2 trb = wheel_center + ImRotate(triangle_pb, cos_hue_angle, sin_hue_angle); ImVec2 trc = wheel_center + ImRotate(triangle_pc, cos_hue_angle, sin_hue_angle); ImVec2 uv_white = GetFontTexUvWhitePixel(); draw_list->PrimReserve(6, 6); draw_list->PrimVtx(tra, uv_white, hue_color32); draw_list->PrimVtx(trb, uv_white, hue_color32); draw_list->PrimVtx(trc, uv_white, IM_COL32_WHITE); draw_list->PrimVtx(tra, uv_white, IM_COL32_BLACK_TRANS); draw_list->PrimVtx(trb, uv_white, IM_COL32_BLACK); draw_list->PrimVtx(trc, uv_white, IM_COL32_BLACK_TRANS); draw_list->AddTriangle(tra, trb, trc, IM_COL32(128,128,128,255), 1.5f); sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V)); } else if (flags & ImGuiColorEditFlags_PickerHueBar) { // Render SV Square draw_list->AddRectFilledMultiColor(picker_pos, picker_pos + ImVec2(sv_picker_size,sv_picker_size), IM_COL32_WHITE, hue_color32, hue_color32, IM_COL32_WHITE); draw_list->AddRectFilledMultiColor(picker_pos, picker_pos + ImVec2(sv_picker_size,sv_picker_size), IM_COL32_BLACK_TRANS, IM_COL32_BLACK_TRANS, IM_COL32_BLACK, IM_COL32_BLACK); RenderFrameBorder(picker_pos, picker_pos + ImVec2(sv_picker_size,sv_picker_size), 0.0f); sv_cursor_pos.x = ImClamp((float)(int)(picker_pos.x + ImSaturate(S) * sv_picker_size + 0.5f), picker_pos.x + 2, picker_pos.x + sv_picker_size - 2); // Sneakily prevent the circle to stick out too much sv_cursor_pos.y = ImClamp((float)(int)(picker_pos.y + ImSaturate(1 - V) * sv_picker_size + 0.5f), picker_pos.y + 2, picker_pos.y + sv_picker_size - 2); // Render Hue Bar for (int i = 0; i < 6; ++i) draw_list->AddRectFilledMultiColor(ImVec2(bar0_pos_x, picker_pos.y + i * (sv_picker_size / 6)), ImVec2(bar0_pos_x + bars_width, picker_pos.y + (i + 1) * (sv_picker_size / 6)), hue_colors[i], hue_colors[i], hue_colors[i + 1], hue_colors[i + 1]); float bar0_line_y = (float)(int)(picker_pos.y + H * sv_picker_size + 0.5f); RenderFrameBorder(ImVec2(bar0_pos_x, picker_pos.y), ImVec2(bar0_pos_x + bars_width, picker_pos.y + sv_picker_size), 0.0f); RenderArrowsForVerticalBar(draw_list, ImVec2(bar0_pos_x - 1, bar0_line_y), ImVec2(bars_triangles_half_sz + 1, bars_triangles_half_sz), bars_width + 2.0f); } // Render cursor/preview circle (clamp S/V within 0..1 range because floating points colors may lead HSV values to be out of range) float sv_cursor_rad = value_changed_sv ? 10.0f : 6.0f; draw_list->AddCircleFilled(sv_cursor_pos, sv_cursor_rad, col32_no_alpha, 12); draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad+1, IM_COL32(128,128,128,255), 12); draw_list->AddCircle(sv_cursor_pos, sv_cursor_rad, IM_COL32_WHITE, 12); // Render alpha bar if (alpha_bar) { float alpha = ImSaturate(col[3]); ImRect bar1_bb(bar1_pos_x, picker_pos.y, bar1_pos_x + bars_width, picker_pos.y + sv_picker_size); RenderColorRectWithAlphaCheckerboard(bar1_bb.Min, bar1_bb.Max, IM_COL32(0,0,0,0), bar1_bb.GetWidth() / 2.0f, ImVec2(0.0f, 0.0f)); draw_list->AddRectFilledMultiColor(bar1_bb.Min, bar1_bb.Max, col32_no_alpha, col32_no_alpha, col32_no_alpha & ~IM_COL32_A_MASK, col32_no_alpha & ~IM_COL32_A_MASK); float bar1_line_y = (float)(int)(picker_pos.y + (1.0f - alpha) * sv_picker_size + 0.5f); RenderFrameBorder(bar1_bb.Min, bar1_bb.Max, 0.0f); RenderArrowsForVerticalBar(draw_list, ImVec2(bar1_pos_x - 1, bar1_line_y), ImVec2(bars_triangles_half_sz + 1, bars_triangles_half_sz), bars_width + 2.0f); } EndGroup(); PopID(); return value_changed && memcmp(backup_initial_col, col, components * sizeof(float)); } // Horizontal separating line. void ImGui::Separator() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; ImGuiSeparatorFlags flags = 0; if ((flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical)) == 0) flags |= (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal; IM_ASSERT(ImIsPowerOfTwo((int)(flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical)))); // Check that only 1 option is selected if (flags & ImGuiSeparatorFlags_Vertical) { VerticalSeparator(); return; } // Horizontal Separator if (window->DC.ColumnsSet) PopClipRect(); float x1 = window->Pos.x; float x2 = window->Pos.x + window->Size.x; if (!window->DC.GroupStack.empty()) x1 += window->DC.IndentX; const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y+1.0f)); ItemSize(ImVec2(0.0f, 0.0f)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit, we don't provide height to not alter layout. if (!ItemAdd(bb, 0)) { if (window->DC.ColumnsSet) PushColumnClipRect(); return; } window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x,bb.Min.y), GetColorU32(ImGuiCol_Separator)); if (g.LogEnabled) LogRenderedText(NULL, IM_NEWLINE "--------------------------------"); if (window->DC.ColumnsSet) { PushColumnClipRect(); window->DC.ColumnsSet->LineMinY = window->DC.CursorPos.y; } } void ImGui::VerticalSeparator() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; float y1 = window->DC.CursorPos.y; float y2 = window->DC.CursorPos.y + window->DC.CurrentLineHeight; const ImRect bb(ImVec2(window->DC.CursorPos.x, y1), ImVec2(window->DC.CursorPos.x + 1.0f, y2)); ItemSize(ImVec2(bb.GetWidth(), 0.0f)); if (!ItemAdd(bb, 0)) return; window->DrawList->AddLine(ImVec2(bb.Min.x, bb.Min.y), ImVec2(bb.Min.x, bb.Max.y), GetColorU32(ImGuiCol_Separator)); if (g.LogEnabled) LogText(" |"); } bool ImGui::SplitterBehavior(ImGuiID id, const ImRect& bb, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; const ImGuiItemFlags item_flags_backup = window->DC.ItemFlags; window->DC.ItemFlags |= ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus; bool item_add = ItemAdd(bb, id); window->DC.ItemFlags = item_flags_backup; if (!item_add) return false; bool hovered, held; ImRect bb_interact = bb; bb_interact.Expand(axis == ImGuiAxis_Y ? ImVec2(0.0f, hover_extend) : ImVec2(hover_extend, 0.0f)); ButtonBehavior(bb_interact, id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap); if (g.ActiveId != id) SetItemAllowOverlap(); if (held || (g.HoveredId == id && g.HoveredIdPreviousFrame == id)) SetMouseCursor(axis == ImGuiAxis_Y ? ImGuiMouseCursor_ResizeNS : ImGuiMouseCursor_ResizeEW); ImRect bb_render = bb; if (held) { ImVec2 mouse_delta_2d = g.IO.MousePos - g.ActiveIdClickOffset - bb_interact.Min; float mouse_delta = (axis == ImGuiAxis_Y) ? mouse_delta_2d.y : mouse_delta_2d.x; // Minimum pane size if (mouse_delta < min_size1 - *size1) mouse_delta = min_size1 - *size1; if (mouse_delta > *size2 - min_size2) mouse_delta = *size2 - min_size2; // Apply resize *size1 += mouse_delta; *size2 -= mouse_delta; bb_render.Translate((axis == ImGuiAxis_X) ? ImVec2(mouse_delta, 0.0f) : ImVec2(0.0f, mouse_delta)); } // Render const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator); window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, g.Style.FrameRounding); return held; } void ImGui::Spacing() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ItemSize(ImVec2(0,0)); } void ImGui::Dummy(const ImVec2& size) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); ItemSize(bb); ItemAdd(bb, 0); } bool ImGui::IsRectVisible(const ImVec2& size) { ImGuiWindow* window = GetCurrentWindowRead(); return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size)); } bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) { ImGuiWindow* window = GetCurrentWindowRead(); return window->ClipRect.Overlaps(ImRect(rect_min, rect_max)); } // Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) void ImGui::BeginGroup() { ImGuiWindow* window = GetCurrentWindow(); window->DC.GroupStack.resize(window->DC.GroupStack.Size + 1); ImGuiGroupData& group_data = window->DC.GroupStack.back(); group_data.BackupCursorPos = window->DC.CursorPos; group_data.BackupCursorMaxPos = window->DC.CursorMaxPos; group_data.BackupIndentX = window->DC.IndentX; group_data.BackupGroupOffsetX = window->DC.GroupOffsetX; group_data.BackupCurrentLineHeight = window->DC.CurrentLineHeight; group_data.BackupCurrentLineTextBaseOffset = window->DC.CurrentLineTextBaseOffset; group_data.BackupLogLinePosY = window->DC.LogLinePosY; group_data.BackupActiveIdIsAlive = GImGui->ActiveIdIsAlive; group_data.AdvanceCursor = true; window->DC.GroupOffsetX = window->DC.CursorPos.x - window->Pos.x - window->DC.ColumnsOffsetX; window->DC.IndentX = window->DC.GroupOffsetX; window->DC.CursorMaxPos = window->DC.CursorPos; window->DC.CurrentLineHeight = 0.0f; window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f; } void ImGui::EndGroup() { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); IM_ASSERT(!window->DC.GroupStack.empty()); // Mismatched BeginGroup()/EndGroup() calls ImGuiGroupData& group_data = window->DC.GroupStack.back(); ImRect group_bb(group_data.BackupCursorPos, window->DC.CursorMaxPos); group_bb.Max = ImMax(group_bb.Min, group_bb.Max); window->DC.CursorPos = group_data.BackupCursorPos; window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos); window->DC.CurrentLineHeight = group_data.BackupCurrentLineHeight; window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset; window->DC.IndentX = group_data.BackupIndentX; window->DC.GroupOffsetX = group_data.BackupGroupOffsetX; window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f; if (group_data.AdvanceCursor) { window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrentLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now. ItemSize(group_bb.GetSize(), group_data.BackupCurrentLineTextBaseOffset); ItemAdd(group_bb, 0); } // If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive() will be functional on the entire group. // It would be be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but if you search for LastItemId you'll notice it is only used in that context. const bool active_id_within_group = (!group_data.BackupActiveIdIsAlive && g.ActiveIdIsAlive && g.ActiveId && g.ActiveIdWindow->RootWindow == window->RootWindow); if (active_id_within_group) window->DC.LastItemId = g.ActiveId; window->DC.LastItemRect = group_bb; window->DC.GroupStack.pop_back(); //window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255)); // [Debug] } // Gets back to previous line and continue with horizontal layout // pos_x == 0 : follow right after previous item // pos_x != 0 : align to specified x position (relative to window/group left) // spacing_w < 0 : use default spacing if pos_x == 0, no spacing if pos_x != 0 // spacing_w >= 0 : enforce spacing amount void ImGui::SameLine(float pos_x, float spacing_w) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; if (pos_x != 0.0f) { if (spacing_w < 0.0f) spacing_w = 0.0f; window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + pos_x + spacing_w + window->DC.GroupOffsetX + window->DC.ColumnsOffsetX; window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; } else { if (spacing_w < 0.0f) spacing_w = g.Style.ItemSpacing.x; window->DC.CursorPos.x = window->DC.CursorPosPrevLine.x + spacing_w; window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y; } window->DC.CurrentLineHeight = window->DC.PrevLineHeight; window->DC.CurrentLineTextBaseOffset = window->DC.PrevLineTextBaseOffset; } void ImGui::NewLine() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; ImGuiContext& g = *GImGui; const ImGuiLayoutType backup_layout_type = window->DC.LayoutType; window->DC.LayoutType = ImGuiLayoutType_Vertical; if (window->DC.CurrentLineHeight > 0.0f) // In the event that we are on a line with items that is smaller that FontSize high, we will preserve its height. ItemSize(ImVec2(0,0)); else ItemSize(ImVec2(0.0f, g.FontSize)); window->DC.LayoutType = backup_layout_type; } void ImGui::NextColumn() { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems || window->DC.ColumnsSet == NULL) return; ImGuiContext& g = *GImGui; PopItemWidth(); PopClipRect(); ImGuiColumnsSet* columns = window->DC.ColumnsSet; columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y); if (++columns->Current < columns->Count) { // Columns 1+ cancel out IndentX window->DC.ColumnsOffsetX = GetColumnOffset(columns->Current) - window->DC.IndentX + g.Style.ItemSpacing.x; window->DrawList->ChannelsSetCurrent(columns->Current); } else { window->DC.ColumnsOffsetX = 0.0f; window->DrawList->ChannelsSetCurrent(0); columns->Current = 0; columns->LineMinY = columns->LineMaxY; } window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX); window->DC.CursorPos.y = columns->LineMinY; window->DC.CurrentLineHeight = 0.0f; window->DC.CurrentLineTextBaseOffset = 0.0f; PushColumnClipRect(); PushItemWidth(GetColumnWidth() * 0.65f); // FIXME: Move on columns setup } int ImGui::GetColumnIndex() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.ColumnsSet ? window->DC.ColumnsSet->Current : 0; } int ImGui::GetColumnsCount() { ImGuiWindow* window = GetCurrentWindowRead(); return window->DC.ColumnsSet ? window->DC.ColumnsSet->Count : 1; } static float OffsetNormToPixels(const ImGuiColumnsSet* columns, float offset_norm) { return offset_norm * (columns->MaxX - columns->MinX); } static float PixelsToOffsetNorm(const ImGuiColumnsSet* columns, float offset) { return offset / (columns->MaxX - columns->MinX); } static inline float GetColumnsRectHalfWidth() { return 4.0f; } static float GetDraggedColumnOffset(ImGuiColumnsSet* columns, int column_index) { // Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing // window creates a feedback loop because we store normalized positions. So while dragging we enforce absolute positioning. ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; IM_ASSERT(column_index > 0); // We are not supposed to drag column 0. IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index)); float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + GetColumnsRectHalfWidth() - window->Pos.x; x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing); if ((columns->Flags & ImGuiColumnsFlags_NoPreserveWidths)) x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing); return x; } float ImGui::GetColumnOffset(int column_index) { ImGuiWindow* window = GetCurrentWindowRead(); ImGuiColumnsSet* columns = window->DC.ColumnsSet; IM_ASSERT(columns != NULL); if (column_index < 0) column_index = columns->Current; IM_ASSERT(column_index < columns->Columns.Size); const float t = columns->Columns[column_index].OffsetNorm; const float x_offset = ImLerp(columns->MinX, columns->MaxX, t); return x_offset; } static float GetColumnWidthEx(ImGuiColumnsSet* columns, int column_index, bool before_resize = false) { if (column_index < 0) column_index = columns->Current; float offset_norm; if (before_resize) offset_norm = columns->Columns[column_index + 1].OffsetNormBeforeResize - columns->Columns[column_index].OffsetNormBeforeResize; else offset_norm = columns->Columns[column_index + 1].OffsetNorm - columns->Columns[column_index].OffsetNorm; return OffsetNormToPixels(columns, offset_norm); } float ImGui::GetColumnWidth(int column_index) { ImGuiWindow* window = GetCurrentWindowRead(); ImGuiColumnsSet* columns = window->DC.ColumnsSet; IM_ASSERT(columns != NULL); if (column_index < 0) column_index = columns->Current; return OffsetNormToPixels(columns, columns->Columns[column_index + 1].OffsetNorm - columns->Columns[column_index].OffsetNorm); } void ImGui::SetColumnOffset(int column_index, float offset) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; ImGuiColumnsSet* columns = window->DC.ColumnsSet; IM_ASSERT(columns != NULL); if (column_index < 0) column_index = columns->Current; IM_ASSERT(column_index < columns->Columns.Size); const bool preserve_width = !(columns->Flags & ImGuiColumnsFlags_NoPreserveWidths) && (column_index < columns->Count-1); const float width = preserve_width ? GetColumnWidthEx(columns, column_index, columns->IsBeingResized) : 0.0f; if (!(columns->Flags & ImGuiColumnsFlags_NoForceWithinWindow)) offset = ImMin(offset, columns->MaxX - g.Style.ColumnsMinSpacing * (columns->Count - column_index)); columns->Columns[column_index].OffsetNorm = PixelsToOffsetNorm(columns, offset - columns->MinX); if (preserve_width) SetColumnOffset(column_index + 1, offset + ImMax(g.Style.ColumnsMinSpacing, width)); } void ImGui::SetColumnWidth(int column_index, float width) { ImGuiWindow* window = GetCurrentWindowRead(); ImGuiColumnsSet* columns = window->DC.ColumnsSet; IM_ASSERT(columns != NULL); if (column_index < 0) column_index = columns->Current; SetColumnOffset(column_index + 1, GetColumnOffset(column_index) + width); } void ImGui::PushColumnClipRect(int column_index) { ImGuiWindow* window = GetCurrentWindowRead(); ImGuiColumnsSet* columns = window->DC.ColumnsSet; if (column_index < 0) column_index = columns->Current; PushClipRect(columns->Columns[column_index].ClipRect.Min, columns->Columns[column_index].ClipRect.Max, false); } static ImGuiColumnsSet* FindOrAddColumnsSet(ImGuiWindow* window, ImGuiID id) { for (int n = 0; n < window->ColumnsStorage.Size; n++) if (window->ColumnsStorage[n].ID == id) return &window->ColumnsStorage[n]; window->ColumnsStorage.push_back(ImGuiColumnsSet()); ImGuiColumnsSet* columns = &window->ColumnsStorage.back(); columns->ID = id; return columns; } void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); IM_ASSERT(columns_count > 1); IM_ASSERT(window->DC.ColumnsSet == NULL); // Nested columns are currently not supported // Differentiate column ID with an arbitrary prefix for cases where users name their columns set the same as another widget. // In addition, when an identifier isn't explicitly provided we include the number of columns in the hash to make it uniquer. PushID(0x11223347 + (str_id ? 0 : columns_count)); ImGuiID id = window->GetID(str_id ? str_id : "columns"); PopID(); // Acquire storage for the columns set ImGuiColumnsSet* columns = FindOrAddColumnsSet(window, id); IM_ASSERT(columns->ID == id); columns->Current = 0; columns->Count = columns_count; columns->Flags = flags; window->DC.ColumnsSet = columns; // Set state for first column const float content_region_width = (window->SizeContentsExplicit.x != 0.0f) ? (window->SizeContentsExplicit.x) : (window->InnerClipRect.Max.x - window->Pos.x); columns->MinX = window->DC.IndentX - g.Style.ItemSpacing.x; // Lock our horizontal range columns->MaxX = ImMax(content_region_width - window->Scroll.x, columns->MinX + 1.0f); columns->StartPosY = window->DC.CursorPos.y; columns->StartMaxPosX = window->DC.CursorMaxPos.x; columns->LineMinY = columns->LineMaxY = window->DC.CursorPos.y; window->DC.ColumnsOffsetX = 0.0f; window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX); // Clear data if columns count changed if (columns->Columns.Size != 0 && columns->Columns.Size != columns_count + 1) columns->Columns.resize(0); // Initialize defaults columns->IsFirstFrame = (columns->Columns.Size == 0); if (columns->Columns.Size == 0) { columns->Columns.reserve(columns_count + 1); for (int n = 0; n < columns_count + 1; n++) { ImGuiColumnData column; column.OffsetNorm = n / (float)columns_count; columns->Columns.push_back(column); } } for (int n = 0; n < columns_count; n++) { // Compute clipping rectangle ImGuiColumnData* column = &columns->Columns[n]; float clip_x1 = ImFloor(0.5f + window->Pos.x + GetColumnOffset(n) - 1.0f); float clip_x2 = ImFloor(0.5f + window->Pos.x + GetColumnOffset(n + 1) - 1.0f); column->ClipRect = ImRect(clip_x1, -FLT_MAX, clip_x2, +FLT_MAX); column->ClipRect.ClipWith(window->ClipRect); } window->DrawList->ChannelsSplit(columns->Count); PushColumnClipRect(); PushItemWidth(GetColumnWidth() * 0.65f); } void ImGui::EndColumns() { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); ImGuiColumnsSet* columns = window->DC.ColumnsSet; IM_ASSERT(columns != NULL); PopItemWidth(); PopClipRect(); window->DrawList->ChannelsMerge(); columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y); window->DC.CursorPos.y = columns->LineMaxY; if (!(columns->Flags & ImGuiColumnsFlags_GrowParentContentsSize)) window->DC.CursorMaxPos.x = ImMax(columns->StartMaxPosX, columns->MaxX); // Restore cursor max pos, as columns don't grow parent // Draw columns borders and handle resize bool is_being_resized = false; if (!(columns->Flags & ImGuiColumnsFlags_NoBorder) && !window->SkipItems) { const float y1 = columns->StartPosY; const float y2 = window->DC.CursorPos.y; int dragging_column = -1; for (int n = 1; n < columns->Count; n++) { float x = window->Pos.x + GetColumnOffset(n); const ImGuiID column_id = columns->ID + ImGuiID(n); const float column_hw = GetColumnsRectHalfWidth(); // Half-width for interaction const ImRect column_rect(ImVec2(x - column_hw, y1), ImVec2(x + column_hw, y2)); KeepAliveID(column_id); if (IsClippedEx(column_rect, column_id, false)) continue; bool hovered = false, held = false; if (!(columns->Flags & ImGuiColumnsFlags_NoResize)) { ButtonBehavior(column_rect, column_id, &hovered, &held); if (hovered || held) g.MouseCursor = ImGuiMouseCursor_ResizeEW; if (held && !(columns->Columns[n].Flags & ImGuiColumnsFlags_NoResize)) dragging_column = n; } // Draw column (we clip the Y boundaries CPU side because very long triangles are mishandled by some GPU drivers.) const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator); const float xi = (float)(int)x; window->DrawList->AddLine(ImVec2(xi, ImMax(y1 + 1.0f, window->ClipRect.Min.y)), ImVec2(xi, ImMin(y2, window->ClipRect.Max.y)), col); } // Apply dragging after drawing the column lines, so our rendered lines are in sync with how items were displayed during the frame. if (dragging_column != -1) { if (!columns->IsBeingResized) for (int n = 0; n < columns->Count + 1; n++) columns->Columns[n].OffsetNormBeforeResize = columns->Columns[n].OffsetNorm; columns->IsBeingResized = is_being_resized = true; float x = GetDraggedColumnOffset(columns, dragging_column); SetColumnOffset(dragging_column, x); } } columns->IsBeingResized = is_being_resized; window->DC.ColumnsSet = NULL; window->DC.ColumnsOffsetX = 0.0f; window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX); } // [2018-03: This is currently the only public API, while we are working on making BeginColumns/EndColumns user-facing] void ImGui::Columns(int columns_count, const char* id, bool border) { ImGuiWindow* window = GetCurrentWindow(); IM_ASSERT(columns_count >= 1); ImGuiColumnsFlags flags = (border ? 0 : ImGuiColumnsFlags_NoBorder); //flags |= ImGuiColumnsFlags_NoPreserveWidths; // NB: Legacy behavior if (window->DC.ColumnsSet != NULL && window->DC.ColumnsSet->Count == columns_count && window->DC.ColumnsSet->Flags == flags) return; if (window->DC.ColumnsSet != NULL) EndColumns(); if (columns_count != 1) BeginColumns(id, columns_count, flags); } void ImGui::Indent(float indent_w) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); window->DC.IndentX += (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX; } void ImGui::Unindent(float indent_w) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); window->DC.IndentX -= (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX; } void ImGui::TreePush(const char* str_id) { ImGuiWindow* window = GetCurrentWindow(); Indent(); window->DC.TreeDepth++; PushID(str_id ? str_id : "#TreePush"); } void ImGui::TreePush(const void* ptr_id) { ImGuiWindow* window = GetCurrentWindow(); Indent(); window->DC.TreeDepth++; PushID(ptr_id ? ptr_id : (const void*)"#TreePush"); } void ImGui::TreePushRawID(ImGuiID id) { ImGuiWindow* window = GetCurrentWindow(); Indent(); window->DC.TreeDepth++; window->IDStack.push_back(id); } void ImGui::TreePop() { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; Unindent(); window->DC.TreeDepth--; if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) if (g.NavIdIsAlive && (window->DC.TreeDepthMayJumpToParentOnPop & (1 << window->DC.TreeDepth))) { SetNavID(window->IDStack.back(), g.NavLayer); NavMoveRequestCancel(); } window->DC.TreeDepthMayJumpToParentOnPop &= (1 << window->DC.TreeDepth) - 1; PopID(); } void ImGui::Value(const char* prefix, bool b) { Text("%s: %s", prefix, (b ? "true" : "false")); } void ImGui::Value(const char* prefix, int v) { Text("%s: %d", prefix, v); } void ImGui::Value(const char* prefix, unsigned int v) { Text("%s: %d", prefix, v); } void ImGui::Value(const char* prefix, float v, const char* float_format) { if (float_format) { char fmt[64]; ImFormatString(fmt, IM_ARRAYSIZE(fmt), "%%s: %s", float_format); Text(fmt, prefix, v); } else { Text("%s: %.3f", prefix, v); } } //----------------------------------------------------------------------------- // DRAG AND DROP //----------------------------------------------------------------------------- void ImGui::ClearDragDrop() { ImGuiContext& g = *GImGui; g.DragDropActive = false; g.DragDropPayload.Clear(); g.DragDropAcceptIdCurr = g.DragDropAcceptIdPrev = 0; g.DragDropAcceptIdCurrRectSurface = FLT_MAX; g.DragDropAcceptFrameCount = -1; } // Call when current ID is active. // When this returns true you need to: a) call SetDragDropPayload() exactly once, b) you may render the payload visual/description, c) call EndDragDropSource() bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; bool source_drag_active = false; ImGuiID source_id = 0; ImGuiID source_parent_id = 0; int mouse_button = 0; if (!(flags & ImGuiDragDropFlags_SourceExtern)) { source_id = window->DC.LastItemId; if (source_id != 0 && g.ActiveId != source_id) // Early out for most common case return false; if (g.IO.MouseDown[mouse_button] == false) return false; if (source_id == 0) { // If you want to use BeginDragDropSource() on an item with no unique identifier for interaction, such as Text() or Image(), you need to: // A) Read the explanation below, B) Use the ImGuiDragDropFlags_SourceAllowNullID flag, C) Swallow your programmer pride. if (!(flags & ImGuiDragDropFlags_SourceAllowNullID)) { IM_ASSERT(0); return false; } // Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image() // We build a throwaway ID based on current ID stack + relative AABB of items in window. // THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING OF THE WIDGET, so if your widget moves your dragging operation will be canceled. // We don't need to maintain/call ClearActiveID() as releasing the button will early out this function and trigger !ActiveIdIsAlive. bool is_hovered = (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) != 0; if (!is_hovered && (g.ActiveId == 0 || g.ActiveIdWindow != window)) return false; source_id = window->DC.LastItemId = window->GetIDFromRectangle(window->DC.LastItemRect); if (is_hovered) SetHoveredID(source_id); if (is_hovered && g.IO.MouseClicked[mouse_button]) { SetActiveID(source_id, window); FocusWindow(window); } if (g.ActiveId == source_id) // Allow the underlying widget to display/return hovered during the mouse release frame, else we would get a flicker. g.ActiveIdAllowOverlap = is_hovered; } if (g.ActiveId != source_id) return false; source_parent_id = window->IDStack.back(); source_drag_active = IsMouseDragging(mouse_button); } else { window = NULL; source_id = ImHash("#SourceExtern", 0); source_drag_active = true; } if (source_drag_active) { if (!g.DragDropActive) { IM_ASSERT(source_id != 0); ClearDragDrop(); ImGuiPayload& payload = g.DragDropPayload; payload.SourceId = source_id; payload.SourceParentId = source_parent_id; g.DragDropActive = true; g.DragDropSourceFlags = flags; g.DragDropMouseButton = mouse_button; } if (!(flags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) { // FIXME-DRAG //SetNextWindowPos(g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding); //PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This is better but e.g ColorButton with checkboard has issue with transparent colors :( SetNextWindowPos(g.IO.MousePos); PushStyleColor(ImGuiCol_PopupBg, GetStyleColorVec4(ImGuiCol_PopupBg) * ImVec4(1.0f, 1.0f, 1.0f, 0.6f)); BeginTooltip(); } if (!(flags & ImGuiDragDropFlags_SourceNoDisableHover) && !(flags & ImGuiDragDropFlags_SourceExtern)) window->DC.LastItemStatusFlags &= ~ImGuiItemStatusFlags_HoveredRect; return true; } return false; } void ImGui::EndDragDropSource() { ImGuiContext& g = *GImGui; IM_ASSERT(g.DragDropActive); if (!(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) { EndTooltip(); PopStyleColor(); //PopStyleVar(); } // Discard the drag if have not called SetDragDropPayload() if (g.DragDropPayload.DataFrameCount == -1) ClearDragDrop(); } // Use 'cond' to choose to submit payload on drag start or every frame bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_size, ImGuiCond cond) { ImGuiContext& g = *GImGui; ImGuiPayload& payload = g.DragDropPayload; if (cond == 0) cond = ImGuiCond_Always; IM_ASSERT(type != NULL); IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 12 characters long"); IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0)); IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once); IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource() if (cond == ImGuiCond_Always || payload.DataFrameCount == -1) { // Copy payload ImStrncpy(payload.DataType, type, IM_ARRAYSIZE(payload.DataType)); g.DragDropPayloadBufHeap.resize(0); if (data_size > sizeof(g.DragDropPayloadBufLocal)) { // Store in heap g.DragDropPayloadBufHeap.resize((int)data_size); payload.Data = g.DragDropPayloadBufHeap.Data; memcpy((void*)(intptr_t)payload.Data, data, data_size); } else if (data_size > 0) { // Store locally memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal)); payload.Data = g.DragDropPayloadBufLocal; memcpy((void*)(intptr_t)payload.Data, data, data_size); } else { payload.Data = NULL; } payload.DataSize = (int)data_size; } payload.DataFrameCount = g.FrameCount; return (g.DragDropAcceptFrameCount == g.FrameCount) || (g.DragDropAcceptFrameCount == g.FrameCount - 1); } bool ImGui::BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id) { ImGuiContext& g = *GImGui; if (!g.DragDropActive) return false; ImGuiWindow* window = g.CurrentWindow; if (g.HoveredWindow == NULL || window->RootWindow != g.HoveredWindow->RootWindow) return false; IM_ASSERT(id != 0); if (!IsMouseHoveringRect(bb.Min, bb.Max) || (id == g.DragDropPayload.SourceId)) return false; g.DragDropTargetRect = bb; g.DragDropTargetId = id; return true; } // We don't use BeginDragDropTargetCustom() and duplicate its code because: // 1) we use LastItemRectHoveredRect which handles items that pushes a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. // 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can. // Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case) bool ImGui::BeginDragDropTarget() { ImGuiContext& g = *GImGui; if (!g.DragDropActive) return false; ImGuiWindow* window = g.CurrentWindow; if (!(window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect)) return false; if (g.HoveredWindow == NULL || window->RootWindow != g.HoveredWindow->RootWindow) return false; const ImRect& display_rect = (window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect) ? window->DC.LastItemDisplayRect : window->DC.LastItemRect; ImGuiID id = window->DC.LastItemId; if (id == 0) id = window->GetIDFromRectangle(display_rect); if (g.DragDropPayload.SourceId == id) return false; g.DragDropTargetRect = display_rect; g.DragDropTargetId = id; return true; } bool ImGui::IsDragDropPayloadBeingAccepted() { ImGuiContext& g = *GImGui; return g.DragDropActive && g.DragDropAcceptIdPrev != 0; } const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; ImGuiPayload& payload = g.DragDropPayload; IM_ASSERT(g.DragDropActive); // Not called between BeginDragDropTarget() and EndDragDropTarget() ? IM_ASSERT(payload.DataFrameCount != -1); // Forgot to call EndDragDropTarget() ? if (type != NULL && !payload.IsDataType(type)) return NULL; // Accept smallest drag target bounding box, this allows us to nest drag targets conveniently without ordering constraints. // NB: We currently accept NULL id as target. However, overlapping targets requires a unique ID to function! const bool was_accepted_previously = (g.DragDropAcceptIdPrev == g.DragDropTargetId); ImRect r = g.DragDropTargetRect; float r_surface = r.GetWidth() * r.GetHeight(); if (r_surface < g.DragDropAcceptIdCurrRectSurface) { g.DragDropAcceptIdCurr = g.DragDropTargetId; g.DragDropAcceptIdCurrRectSurface = r_surface; } // Render default drop visuals payload.Preview = was_accepted_previously; flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that lives for 1 frame) if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview) { // FIXME-DRAG: Settle on a proper default visuals for drop target. r.Expand(3.5f); bool push_clip_rect = !window->ClipRect.Contains(r); if (push_clip_rect) window->DrawList->PushClipRectFullScreen(); window->DrawList->AddRect(r.Min, r.Max, GetColorU32(ImGuiCol_DragDropTarget), 0.0f, ~0, 2.0f); if (push_clip_rect) window->DrawList->PopClipRect(); } g.DragDropAcceptFrameCount = g.FrameCount; payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery)) return NULL; return &payload; } // We don't really use/need this now, but added it for the sake of consistency and because we might need it later. void ImGui::EndDragDropTarget() { ImGuiContext& g = *GImGui; (void)g; IM_ASSERT(g.DragDropActive); } //----------------------------------------------------------------------------- // PLATFORM DEPENDENT HELPERS //----------------------------------------------------------------------------- #if defined(_WIN32) && !defined(_WINDOWS_) && (!defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) || !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)) #undef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #ifndef __MINGW32__ #include #else #include #endif #endif // Win32 API clipboard implementation #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) #ifdef _MSC_VER #pragma comment(lib, "user32") #endif static const char* GetClipboardTextFn_DefaultImpl(void*) { static ImVector buf_local; buf_local.clear(); if (!OpenClipboard(NULL)) return NULL; HANDLE wbuf_handle = GetClipboardData(CF_UNICODETEXT); if (wbuf_handle == NULL) { CloseClipboard(); return NULL; } if (ImWchar* wbuf_global = (ImWchar*)GlobalLock(wbuf_handle)) { int buf_len = ImTextCountUtf8BytesFromStr(wbuf_global, NULL) + 1; buf_local.resize(buf_len); ImTextStrToUtf8(buf_local.Data, buf_len, wbuf_global, NULL); } GlobalUnlock(wbuf_handle); CloseClipboard(); return buf_local.Data; } static void SetClipboardTextFn_DefaultImpl(void*, const char* text) { if (!OpenClipboard(NULL)) return; const int wbuf_length = ImTextCountCharsFromUtf8(text, NULL) + 1; HGLOBAL wbuf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)wbuf_length * sizeof(ImWchar)); if (wbuf_handle == NULL) { CloseClipboard(); return; } ImWchar* wbuf_global = (ImWchar*)GlobalLock(wbuf_handle); ImTextStrFromUtf8(wbuf_global, wbuf_length, text, NULL); GlobalUnlock(wbuf_handle); EmptyClipboard(); SetClipboardData(CF_UNICODETEXT, wbuf_handle); CloseClipboard(); } #else // Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers static const char* GetClipboardTextFn_DefaultImpl(void*) { ImGuiContext& g = *GImGui; return g.PrivateClipboard.empty() ? NULL : g.PrivateClipboard.begin(); } // Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers static void SetClipboardTextFn_DefaultImpl(void*, const char* text) { ImGuiContext& g = *GImGui; g.PrivateClipboard.clear(); const char* text_end = text + strlen(text); g.PrivateClipboard.resize((int)(text_end - text) + 1); memcpy(&g.PrivateClipboard[0], text, (size_t)(text_end - text)); g.PrivateClipboard[(int)(text_end - text)] = 0; } #endif // Win32 API IME support (for Asian languages, etc.) #if defined(_WIN32) && !defined(__GNUC__) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) #include #ifdef _MSC_VER #pragma comment(lib, "imm32") #endif static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y) { // Notify OS Input Method Editor of text input position if (HWND hwnd = (HWND)GImGui->IO.ImeWindowHandle) if (HIMC himc = ImmGetContext(hwnd)) { COMPOSITIONFORM cf; cf.ptCurrentPos.x = x; cf.ptCurrentPos.y = y; cf.dwStyle = CFS_FORCE_POSITION; ImmSetCompositionWindow(himc, &cf); } } #else static void ImeSetInputScreenPosFn_DefaultImpl(int, int) {} #endif //----------------------------------------------------------------------------- // HELP //----------------------------------------------------------------------------- void ImGui::ShowMetricsWindow(bool* p_open) { if (ImGui::Begin("ImGui Metrics", p_open)) { ImGui::Text("Dear ImGui %s", ImGui::GetVersion()); ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate); ImGui::Text("%d vertices, %d indices (%d triangles)", ImGui::GetIO().MetricsRenderVertices, ImGui::GetIO().MetricsRenderIndices, ImGui::GetIO().MetricsRenderIndices / 3); ImGui::Text("%d allocations", (int)GImAllocatorActiveAllocationsCount); static bool show_clip_rects = true; ImGui::Checkbox("Show clipping rectangles when hovering draw commands", &show_clip_rects); ImGui::Separator(); struct Funcs { static void NodeDrawList(ImGuiWindow* window, ImDrawList* draw_list, const char* label) { bool node_open = ImGui::TreeNode(draw_list, "%s: '%s' %d vtx, %d indices, %d cmds", label, draw_list->_OwnerName ? draw_list->_OwnerName : "", draw_list->VtxBuffer.Size, draw_list->IdxBuffer.Size, draw_list->CmdBuffer.Size); if (draw_list == ImGui::GetWindowDrawList()) { ImGui::SameLine(); ImGui::TextColored(ImColor(255,100,100), "CURRENTLY APPENDING"); // Can't display stats for active draw list! (we don't have the data double-buffered) if (node_open) ImGui::TreePop(); return; } ImDrawList* overlay_draw_list = ImGui::GetOverlayDrawList(); // Render additional visuals into the top-most draw list if (window && ImGui::IsItemHovered()) overlay_draw_list->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255)); if (!node_open) return; int elem_offset = 0; for (const ImDrawCmd* pcmd = draw_list->CmdBuffer.begin(); pcmd < draw_list->CmdBuffer.end(); elem_offset += pcmd->ElemCount, pcmd++) { if (pcmd->UserCallback == NULL && pcmd->ElemCount == 0) continue; if (pcmd->UserCallback) { ImGui::BulletText("Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData); continue; } ImDrawIdx* idx_buffer = (draw_list->IdxBuffer.Size > 0) ? draw_list->IdxBuffer.Data : NULL; bool pcmd_node_open = ImGui::TreeNode((void*)(pcmd - draw_list->CmdBuffer.begin()), "Draw %4d %s vtx, tex 0x%p, clip_rect (%4.0f,%4.0f)-(%4.0f,%4.0f)", pcmd->ElemCount, draw_list->IdxBuffer.Size > 0 ? "indexed" : "non-indexed", pcmd->TextureId, pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w); if (show_clip_rects && ImGui::IsItemHovered()) { ImRect clip_rect = pcmd->ClipRect; ImRect vtxs_rect; for (int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++) vtxs_rect.Add(draw_list->VtxBuffer[idx_buffer ? idx_buffer[i] : i].pos); clip_rect.Floor(); overlay_draw_list->AddRect(clip_rect.Min, clip_rect.Max, IM_COL32(255,255,0,255)); vtxs_rect.Floor(); overlay_draw_list->AddRect(vtxs_rect.Min, vtxs_rect.Max, IM_COL32(255,0,255,255)); } if (!pcmd_node_open) continue; // Display individual triangles/vertices. Hover on to get the corresponding triangle highlighted. ImGuiListClipper clipper(pcmd->ElemCount/3); // Manually coarse clip our print out of individual vertices to save CPU, only items that may be visible. while (clipper.Step()) for (int prim = clipper.DisplayStart, vtx_i = elem_offset + clipper.DisplayStart*3; prim < clipper.DisplayEnd; prim++) { char buf[300]; char *buf_p = buf, *buf_end = buf + IM_ARRAYSIZE(buf); ImVec2 triangles_pos[3]; for (int n = 0; n < 3; n++, vtx_i++) { ImDrawVert& v = draw_list->VtxBuffer[idx_buffer ? idx_buffer[vtx_i] : vtx_i]; triangles_pos[n] = v.pos; buf_p += ImFormatString(buf_p, (int)(buf_end - buf_p), "%s %04d: pos (%8.2f,%8.2f), uv (%.6f,%.6f), col %08X\n", (n == 0) ? "vtx" : " ", vtx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col); } ImGui::Selectable(buf, false); if (ImGui::IsItemHovered()) { ImDrawListFlags backup_flags = overlay_draw_list->Flags; overlay_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines at is more readable for very large and thin triangles. overlay_draw_list->AddPolyline(triangles_pos, 3, IM_COL32(255,255,0,255), true, 1.0f); overlay_draw_list->Flags = backup_flags; } } ImGui::TreePop(); } ImGui::TreePop(); } static void NodeWindows(ImVector& windows, const char* label) { if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size)) return; for (int i = 0; i < windows.Size; i++) Funcs::NodeWindow(windows[i], "Window"); ImGui::TreePop(); } static void NodeWindow(ImGuiWindow* window, const char* label) { if (!ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, window->Active || window->WasActive, window)) return; ImGuiWindowFlags flags = window->Flags; NodeDrawList(window, window->DrawList, "DrawList"); ImGui::BulletText("Pos: (%.1f,%.1f), Size: (%.1f,%.1f), SizeContents (%.1f,%.1f)", window->Pos.x, window->Pos.y, window->Size.x, window->Size.y, window->SizeContents.x, window->SizeContents.y); ImGui::BulletText("Flags: 0x%08X (%s%s%s%s%s%s..)", flags, (flags & ImGuiWindowFlags_ChildWindow) ? "Child " : "", (flags & ImGuiWindowFlags_Tooltip) ? "Tooltip " : "", (flags & ImGuiWindowFlags_Popup) ? "Popup " : "", (flags & ImGuiWindowFlags_Modal) ? "Modal " : "", (flags & ImGuiWindowFlags_ChildMenu) ? "ChildMenu " : "", (flags & ImGuiWindowFlags_NoSavedSettings) ? "NoSavedSettings " : ""); ImGui::BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f)", window->Scroll.x, GetScrollMaxX(window), window->Scroll.y, GetScrollMaxY(window)); ImGui::BulletText("Active: %d, WriteAccessed: %d", window->Active, window->WriteAccessed); ImGui::BulletText("NavLastIds: 0x%08X,0x%08X, NavLayerActiveMask: %X", window->NavLastIds[0], window->NavLastIds[1], window->DC.NavLayerActiveMask); ImGui::BulletText("NavLastChildNavWindow: %s", window->NavLastChildNavWindow ? window->NavLastChildNavWindow->Name : "NULL"); if (window->NavRectRel[0].IsInverted()) ImGui::BulletText("NavRectRel[0]: (%.1f,%.1f)(%.1f,%.1f)", window->NavRectRel[0].Min.x, window->NavRectRel[0].Min.y, window->NavRectRel[0].Max.x, window->NavRectRel[0].Max.y); else ImGui::BulletText("NavRectRel[0]: "); if (window->RootWindow != window) NodeWindow(window->RootWindow, "RootWindow"); if (window->DC.ChildWindows.Size > 0) NodeWindows(window->DC.ChildWindows, "ChildWindows"); if (window->ColumnsStorage.Size > 0 && ImGui::TreeNode("Columns", "Columns sets (%d)", window->ColumnsStorage.Size)) { for (int n = 0; n < window->ColumnsStorage.Size; n++) { const ImGuiColumnsSet* columns = &window->ColumnsStorage[n]; if (ImGui::TreeNode((void*)(uintptr_t)columns->ID, "Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->ID, columns->Count, columns->Flags)) { ImGui::BulletText("Width: %.1f (MinX: %.1f, MaxX: %.1f)", columns->MaxX - columns->MinX, columns->MinX, columns->MaxX); for (int column_n = 0; column_n < columns->Columns.Size; column_n++) ImGui::BulletText("Column %02d: OffsetNorm %.3f (= %.1f px)", column_n, columns->Columns[column_n].OffsetNorm, OffsetNormToPixels(columns, columns->Columns[column_n].OffsetNorm)); ImGui::TreePop(); } } ImGui::TreePop(); } ImGui::BulletText("Storage: %d bytes", window->StateStorage.Data.Size * (int)sizeof(ImGuiStorage::Pair)); ImGui::TreePop(); } }; // Access private state, we are going to display the draw lists from last frame ImGuiContext& g = *GImGui; Funcs::NodeWindows(g.Windows, "Windows"); if (ImGui::TreeNode("DrawList", "Active DrawLists (%d)", g.DrawDataBuilder.Layers[0].Size)) { for (int i = 0; i < g.DrawDataBuilder.Layers[0].Size; i++) Funcs::NodeDrawList(NULL, g.DrawDataBuilder.Layers[0][i], "DrawList"); ImGui::TreePop(); } if (ImGui::TreeNode("Popups", "Open Popups Stack (%d)", g.OpenPopupStack.Size)) { for (int i = 0; i < g.OpenPopupStack.Size; i++) { ImGuiWindow* window = g.OpenPopupStack[i].Window; ImGui::BulletText("PopupID: %08x, Window: '%s'%s%s", g.OpenPopupStack[i].PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " ChildWindow" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? " ChildMenu" : ""); } ImGui::TreePop(); } if (ImGui::TreeNode("Internal state")) { const char* input_source_names[] = { "None", "Mouse", "Nav", "NavKeyboard", "NavGamepad" }; IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT); ImGui::Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL"); ImGui::Text("HoveredRootWindow: '%s'", g.HoveredRootWindow ? g.HoveredRootWindow->Name : "NULL"); ImGui::Text("HoveredId: 0x%08X/0x%08X (%.2f sec)", g.HoveredId, g.HoveredIdPreviousFrame, g.HoveredIdTimer); // Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not ImGui::Text("ActiveId: 0x%08X/0x%08X (%.2f sec), ActiveIdSource: %s", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer, input_source_names[g.ActiveIdSource]); ImGui::Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL"); ImGui::Text("MovingWindow: '%s'", g.MovingWindow ? g.MovingWindow->Name : "NULL"); ImGui::Text("NavWindow: '%s'", g.NavWindow ? g.NavWindow->Name : "NULL"); ImGui::Text("NavId: 0x%08X, NavLayer: %d", g.NavId, g.NavLayer); ImGui::Text("NavInputSource: %s", input_source_names[g.NavInputSource]); ImGui::Text("NavActive: %d, NavVisible: %d", g.IO.NavActive, g.IO.NavVisible); ImGui::Text("NavActivateId: 0x%08X, NavInputId: 0x%08X", g.NavActivateId, g.NavInputId); ImGui::Text("NavDisableHighlight: %d, NavDisableMouseHover: %d", g.NavDisableHighlight, g.NavDisableMouseHover); ImGui::Text("DragDrop: %d, SourceId = 0x%08X, Payload \"%s\" (%d bytes)", g.DragDropActive, g.DragDropPayload.SourceId, g.DragDropPayload.DataType, g.DragDropPayload.DataSize); ImGui::TreePop(); } } ImGui::End(); } //----------------------------------------------------------------------------- // Include imgui_user.inl at the end of imgui.cpp to access private data/functions that aren't exposed. // Prefer just including imgui_internal.h from your code rather than using this define. If a declaration is missing from imgui_internal.h add it or request it on the github. #ifdef IMGUI_INCLUDE_IMGUI_USER_INL #include "imgui_user.inl" #endif //----------------------------------------------------------------------------- goxel-0.8.1/ext_src/imgui/imgui.h000066400000000000000000005202501334742672700167250ustar00rootroot00000000000000// dear imgui, v1.61 WIP // (headers) // See imgui.cpp file for documentation. // Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code. // Read 'Programmer guide' in imgui.cpp for notes on how to setup ImGui in your codebase. // Get latest version at https://github.com/ocornut/imgui #pragma once // Configuration file (edit imconfig.h or define IMGUI_USER_CONFIG to set your own filename) #ifdef IMGUI_USER_CONFIG #include IMGUI_USER_CONFIG #endif #if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H) #include "imconfig.h" #endif #include // FLT_MAX #include // va_list #include // ptrdiff_t, NULL #include // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp #define IMGUI_VERSION "1.61 WIP" // Define attributes of all API symbols declarations, e.g. for DLL under Windows. #ifndef IMGUI_API #define IMGUI_API #endif // Define assertion handler. #ifndef IM_ASSERT #include #define IM_ASSERT(_EXPR) assert(_EXPR) #endif // Helpers #if defined(__clang__) || defined(__GNUC__) #define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) // Apply printf-style warnings to user functions. #define IM_FMTLIST(FMT) __attribute__((format(printf, FMT, 0))) #else #define IM_FMTARGS(FMT) #define IM_FMTLIST(FMT) #endif #define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR))) // Size of a static C-style array. Don't use on pointers! #define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in modern C++. #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wold-style-cast" #endif // Forward declarations struct ImDrawChannel; // Temporary storage for outputting drawing commands out of order, used by ImDrawList::ChannelsSplit() struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call) struct ImDrawData; // All draw command lists required to render the frame struct ImDrawList; // A single draw command list (generally one per window) struct ImDrawListSharedData; // Data shared among multiple draw lists (typically owned by parent ImGui context, but you may create one yourself) struct ImDrawVert; // A single vertex (20 bytes by default, override layout with IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT) struct ImFont; // Runtime data for a single font within a parent ImFontAtlas struct ImFontAtlas; // Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF/OTF font loader struct ImFontConfig; // Configuration data when adding a font or merging fonts struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4 struct ImGuiIO; // Main configuration and I/O between your application and ImGui struct ImGuiOnceUponAFrame; // Simple helper for running a block of code not more than once a frame, used by IMGUI_ONCE_UPON_A_FRAME macro struct ImGuiStorage; // Simple custom key value storage struct ImGuiStyle; // Runtime data for styling/colors struct ImGuiTextFilter; // Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]" struct ImGuiTextBuffer; // Text buffer for logging/accumulating text struct ImGuiTextEditCallbackData; // Shared state of ImGui::InputText() when using custom ImGuiTextEditCallback (rare/advanced use) struct ImGuiSizeCallbackData; // Structure used to constraint window size in custom ways when using custom ImGuiSizeCallback (rare/advanced use) struct ImGuiListClipper; // Helper to manually clip large list of items struct ImGuiPayload; // User data payload for drag and drop operations struct ImGuiContext; // ImGui context (opaque) #ifndef ImTextureID typedef void* ImTextureID; // User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp) #endif // Typedefs and Enumerations (declared as int for compatibility with old C++ and to not pollute the top of this file) typedef unsigned int ImU32; // 32-bit unsigned integer (typically used to store packed colors) typedef unsigned int ImGuiID; // Unique ID used by widgets (typically hashed from a stack of string) typedef unsigned short ImWchar; // Character for keyboard input/display typedef int ImGuiCol; // enum: a color identifier for styling // enum ImGuiCol_ typedef int ImGuiDir; // enum: a cardinal direction // enum ImGuiDir_ typedef int ImGuiCond; // enum: a condition for Set*() // enum ImGuiCond_ typedef int ImGuiKey; // enum: a key identifier (ImGui-side enum) // enum ImGuiKey_ typedef int ImGuiNavInput; // enum: an input identifier for navigation // enum ImGuiNavInput_ typedef int ImGuiMouseCursor; // enum: a mouse cursor identifier // enum ImGuiMouseCursor_ typedef int ImGuiStyleVar; // enum: a variable identifier for styling // enum ImGuiStyleVar_ typedef int ImDrawCornerFlags; // flags: for ImDrawList::AddRect*() etc. // enum ImDrawCornerFlags_ typedef int ImDrawListFlags; // flags: for ImDrawList // enum ImDrawListFlags_ typedef int ImFontAtlasFlags; // flags: for ImFontAtlas // enum ImFontAtlasFlags_ typedef int ImGuiBackendFlags; // flags: for io.BackendFlags // enum ImGuiBackendFlags_ typedef int ImGuiColorEditFlags; // flags: for ColorEdit*(), ColorPicker*() // enum ImGuiColorEditFlags_ typedef int ImGuiColumnsFlags; // flags: for *Columns*() // enum ImGuiColumnsFlags_ typedef int ImGuiConfigFlags; // flags: for io.ConfigFlags // enum ImGuiConfigFlags_ typedef int ImGuiDragDropFlags; // flags: for *DragDrop*() // enum ImGuiDragDropFlags_ typedef int ImGuiComboFlags; // flags: for BeginCombo() // enum ImGuiComboFlags_ typedef int ImGuiFocusedFlags; // flags: for IsWindowFocused() // enum ImGuiFocusedFlags_ typedef int ImGuiHoveredFlags; // flags: for IsItemHovered() etc. // enum ImGuiHoveredFlags_ typedef int ImGuiInputTextFlags; // flags: for InputText*() // enum ImGuiInputTextFlags_ typedef int ImGuiSelectableFlags; // flags: for Selectable() // enum ImGuiSelectableFlags_ typedef int ImGuiTreeNodeFlags; // flags: for TreeNode*(),CollapsingHeader()// enum ImGuiTreeNodeFlags_ typedef int ImGuiWindowFlags; // flags: for Begin*() // enum ImGuiWindowFlags_ typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data); typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); #if defined(_MSC_VER) && !defined(__clang__) typedef unsigned __int64 ImU64; // 64-bit unsigned integer #else typedef unsigned long long ImU64; // 64-bit unsigned integer #endif struct ImVec2 { float x, y; ImVec2() { x = y = 0.0f; } ImVec2(float _x, float _y) { x = _x; y = _y; } float operator[] (size_t idx) const { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine. #ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2. IM_VEC2_CLASS_EXTRA #endif }; struct ImVec4 { float x, y, z, w; ImVec4() { x = y = z = w = 0.0f; } ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; } #ifdef IM_VEC4_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec4. IM_VEC4_CLASS_EXTRA #endif }; // ImGui end-user API // In a namespace so that user can add extra functions in a separate file (e.g. Value() helpers for your vector or common types) namespace ImGui { // Context creation and access // All contexts share a same ImFontAtlas by default. If you want different font atlas, you can new() them and overwrite the GetIO().Fonts variable of an ImGui context. // All those functions are not reliant on the current context. IMGUI_API ImGuiContext* CreateContext(ImFontAtlas* shared_font_atlas = NULL); IMGUI_API void DestroyContext(ImGuiContext* ctx = NULL); // NULL = destroy current context IMGUI_API ImGuiContext* GetCurrentContext(); IMGUI_API void SetCurrentContext(ImGuiContext* ctx); // Main IMGUI_API ImGuiIO& GetIO(); IMGUI_API ImGuiStyle& GetStyle(); IMGUI_API void NewFrame(); // start a new ImGui frame, you can submit any command from this point until Render()/EndFrame(). IMGUI_API void Render(); // ends the ImGui frame, finalize the draw data. (Obsolete: optionally call io.RenderDrawListsFn if set. Nowadays, prefer calling your render function yourself.) IMGUI_API ImDrawData* GetDrawData(); // valid after Render() and until the next call to NewFrame(). this is what you have to render. (Obsolete: this used to be passed to your io.RenderDrawListsFn() function.) IMGUI_API void EndFrame(); // ends the ImGui frame. automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead! // Demo, Debug, Information IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create demo/test window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application! IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create metrics window. display ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc. IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style) IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles. IMGUI_API void ShowFontSelector(const char* label); // add font selector block (not a window), essentially a combo listing the loaded fonts. IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls). IMGUI_API const char* GetVersion(); // get a version string e.g. "1.23" // Styles IMGUI_API void StyleColorsDark(ImGuiStyle* dst = NULL); // new, recommended style (default) IMGUI_API void StyleColorsClassic(ImGuiStyle* dst = NULL); // classic imgui style IMGUI_API void StyleColorsLight(ImGuiStyle* dst = NULL); // best used with borders and a custom, thicker font // Windows // (Begin = push window to the stack and start appending to it. End = pop window from the stack. You may append multiple times to the same window during the same frame) // Begin()/BeginChild() return false to indicate the window being collapsed or fully clipped, so you may early out and omit submitting anything to the window. // However you need to always call a matching End()/EndChild() for a Begin()/BeginChild() call, regardless of its return value (this is due to legacy reason and is inconsistent with BeginMenu/EndMenu, BeginPopup/EndPopup and other functions where the End call should only be called if the corresponding Begin function returned true.) // Passing 'bool* p_open != NULL' shows a close widget in the upper-right corner of the window, which when clicking will set the boolean to false. // Use child windows to introduce independent scrolling/clipping regions within a host window. Child windows can embed their own child. IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); IMGUI_API void End(); IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); // Begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400). IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); IMGUI_API void EndChild(); // Windows Utilities IMGUI_API bool IsWindowAppearing(); IMGUI_API bool IsWindowCollapsed(); IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0); // is current window focused? or its root/child, depending on flags. see flags for options. IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0); // is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ! IMGUI_API ImDrawList* GetWindowDrawList(); // get draw list associated to the window, to append your own drawing primitives IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList API) IMGUI_API ImVec2 GetWindowSize(); // get current window size IMGUI_API float GetWindowWidth(); // get current window width (shortcut for GetWindowSize().x) IMGUI_API float GetWindowHeight(); // get current window height (shortcut for GetWindowSize().y) IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos() IMGUI_API float GetContentRegionAvailWidth(); // IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min (roughly (0,0)-Scroll), in window coordinates IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates IMGUI_API float GetWindowContentRegionWidth(); // IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0,0)); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc. IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin() IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints. IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ enforce the range of scrollbars). not including window decorations (title bar, menu bar, etc.). set an axis to 0.0f to leave it automatic. call before Begin() IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin() IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin() IMGUI_API void SetNextWindowBgAlpha(float alpha); // set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg. IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects. IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects. IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed(). IMGUI_API void SetWindowFocus(); // (not recommended) set current window to be focused / front-most. prefer using SetNextWindowFocus(). IMGUI_API void SetWindowFontScale(float scale); // set font scale. Adjust IO.FontGlobalScale if you want to scale all windows IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond = 0); // set named window position. IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis. IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0); // set named window collapsed state IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus. // Windows Scrolling IMGUI_API float GetScrollX(); // get scrolling amount [0..GetScrollMaxX()] IMGUI_API float GetScrollY(); // get scrolling amount [0..GetScrollMaxY()] IMGUI_API float GetScrollMaxX(); // get maximum scrolling amount ~~ ContentSize.X - WindowSize.X IMGUI_API float GetScrollMaxY(); // get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0..GetScrollMaxX()] IMGUI_API void SetScrollY(float scroll_y); // set scrolling amount [0..GetScrollMaxY()] IMGUI_API void SetScrollHere(float center_y_ratio = 0.5f); // adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead. IMGUI_API void SetScrollFromPosY(float pos_y, float center_y_ratio = 0.5f); // adjust scrolling amount to make given position valid. use GetCursorPos() or GetCursorStartPos()+offset to get valid positions. // Parameters stacks (shared) IMGUI_API void PushFont(ImFont* font); // use NULL as a shortcut to push default font IMGUI_API void PopFont(); IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col); IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4& col); IMGUI_API void PopStyleColor(int count = 1); IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); IMGUI_API void PopStyleVar(int count = 1); IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx); // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwhise use GetColorU32() to get style color with style alpha baked in. IMGUI_API ImFont* GetFont(); // get current font IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied // Parameters stacks (current window) IMGUI_API void PushItemWidth(float item_width); // width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side) IMGUI_API void PopItemWidth(); IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position IMGUI_API void PushTextWrapPos(float wrap_pos_x = 0.0f); // word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space IMGUI_API void PopTextWrapPos(); IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus); // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets IMGUI_API void PopAllowKeyboardFocus(); IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame. IMGUI_API void PopButtonRepeat(); // Cursor / Layout IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator. IMGUI_API void SameLine(float pos_x = 0.0f, float spacing_w = -1.0f); // call between widgets or groups to layout them horizontally IMGUI_API void NewLine(); // undo a SameLine() IMGUI_API void Spacing(); // add vertical spacing IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size IMGUI_API void Indent(float indent_w = 0.0f); // move content position toward the right, by style.IndentSpacing or indent_w if != 0 IMGUI_API void Unindent(float indent_w = 0.0f); // move content position back to the left, by style.IndentSpacing or indent_w if != 0 IMGUI_API void BeginGroup(); // lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) IMGUI_API void EndGroup(); IMGUI_API ImVec2 GetCursorPos(); // cursor position is relative to window position IMGUI_API float GetCursorPosX(); // " IMGUI_API float GetCursorPosY(); // " IMGUI_API void SetCursorPos(const ImVec2& local_pos); // " IMGUI_API void SetCursorPosX(float x); // " IMGUI_API void SetCursorPosY(float y); // " IMGUI_API ImVec2 GetCursorStartPos(); // initial cursor position IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API) IMGUI_API void SetCursorScreenPos(const ImVec2& screen_pos); // cursor position in absolute screen coordinates [0..io.DisplaySize] IMGUI_API void AlignTextToFramePadding(); // vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item) IMGUI_API float GetTextLineHeight(); // ~ FontSize IMGUI_API float GetTextLineHeightWithSpacing(); // ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text) IMGUI_API float GetFrameHeight(); // ~ FontSize + style.FramePadding.y * 2 IMGUI_API float GetFrameHeightWithSpacing(); // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets) // ID stack/scopes // Read the FAQ for more details about how ID are handled in dear imgui. If you are creating widgets in a loop you most // likely want to push a unique identifier (e.g. object pointer, loop index) to uniquely differentiate them. // You can also use the "##foobar" syntax within widget label to distinguish them from each others. // In this header file we use the "label"/"name" terminology to denote a string that will be displayed and used as an ID, // whereas "str_id" denote a string that is only used as an ID and not aimed to be displayed. IMGUI_API void PushID(const char* str_id); // push identifier into the ID stack. IDs are hash of the entire stack! IMGUI_API void PushID(const char* str_id_begin, const char* str_id_end); IMGUI_API void PushID(const void* ptr_id); IMGUI_API void PushID(int int_id); IMGUI_API void PopID(); IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end); IMGUI_API ImGuiID GetID(const void* ptr_id); // Widgets: Text IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text. IMGUI_API void Text(const char* fmt, ...) IM_FMTARGS(1); // simple formatted text IMGUI_API void TextV(const char* fmt, va_list args) IM_FMTLIST(1); IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) IM_FMTARGS(2); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor(); IMGUI_API void TextColoredV(const ImVec4& col, const char* fmt, va_list args) IM_FMTLIST(2); IMGUI_API void TextDisabled(const char* fmt, ...) IM_FMTARGS(1); // shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor(); IMGUI_API void TextDisabledV(const char* fmt, va_list args) IM_FMTLIST(1); IMGUI_API void TextWrapped(const char* fmt, ...) IM_FMTARGS(1); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize(). IMGUI_API void TextWrappedV(const char* fmt, va_list args) IM_FMTLIST(1); IMGUI_API void LabelText(const char* label, const char* fmt, ...) IM_FMTARGS(2); // display text+label aligned the same way as value+label widgets IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args) IM_FMTLIST(2); IMGUI_API void BulletText(const char* fmt, ...) IM_FMTARGS(1); // shortcut for Bullet()+Text() IMGUI_API void BulletTextV(const char* fmt, va_list args) IM_FMTLIST(1); // Widgets: Main IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0,0)); // button IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir); IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size); // button behavior without the visuals, useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0)); IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,0), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no padding IMGUI_API bool Checkbox(const char* label, bool* v); IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value); IMGUI_API bool RadioButton(const char* label, bool active); IMGUI_API bool RadioButton(const char* label, int* v, int v_button); IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), int stride = sizeof(float)); IMGUI_API void PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0)); IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), int stride = sizeof(float)); IMGUI_API void PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0)); IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-1,0), const char* overlay = NULL); IMGUI_API void Bullet(); // draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses // Widgets: Combo Box // The new BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it. // The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose. IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0); IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true! IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1); IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0" IMGUI_API bool Combo(const char* label, int* current_item, bool(*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_max_height_in_items = -1); // Widgets: Drags (tip: ctrl+click on a drag box to input with keyboard. manually input values aren't clamped, can go off-bounds) // For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x // Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision). IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); // If v_min >= v_max we have no bound IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); IMGUI_API bool DragFloat3(const char* label, float v[3], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); IMGUI_API bool DragFloat4(const char* label, float v[4], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); IMGUI_API bool DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", const char* display_format_max = NULL, float power = 1.0f); IMGUI_API bool DragInt(const char* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); // If v_min >= v_max we have no bound IMGUI_API bool DragInt2(const char* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); IMGUI_API bool DragInt3(const char* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); IMGUI_API bool DragInt4(const char* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); IMGUI_API bool DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f", const char* display_format_max = NULL); // Widgets: Input with Keyboard IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL); IMGUI_API bool InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(0,0), ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL); IMGUI_API bool InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputFloat2(const char* label, float v[2], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputFloat3(const char* label, float v[3], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputFloat4(const char* label, float v[4], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputInt2(const char* label, int v[2], ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputInt3(const char* label, int v[3], ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputInt4(const char* label, int v[4], ImGuiInputTextFlags extra_flags = 0); IMGUI_API bool InputDouble(const char* label, double* v, double step = 0.0f, double step_fast = 0.0f, const char* display_format = "%.6f", ImGuiInputTextFlags extra_flags = 0); // Widgets: Sliders (tip: ctrl+click on a slider to input with keyboard. manually input values aren't clamped, can go off-bounds) IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); // adjust display_format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for logarithmic sliders IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); IMGUI_API bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); IMGUI_API bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); IMGUI_API bool SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f); IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f"); IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f"); IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f"); IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f"); IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f"); // Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.) // Note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can the pass the address of a first float element out of a contiguous structure, e.g. &myvector.x IMGUI_API bool ColorEdit3(const char* label, float col[3], ImGuiColorEditFlags flags = 0); IMGUI_API bool ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0); IMGUI_API bool ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags = 0); IMGUI_API bool ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags = 0, const float* ref_col = NULL); IMGUI_API bool ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0,0)); // display a colored square/button, hover for details, return true when pressed. IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags); // initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls. // Widgets: Trees IMGUI_API bool TreeNode(const char* label); // if returning 'true' the node is open and the tree id is pushed into the id stack. user is responsible for calling TreePop(). IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...) IM_FMTARGS(2); // read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet(). IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...) IM_FMTARGS(2); // " IMGUI_API bool TreeNodeV(const char* str_id, const char* fmt, va_list args) IM_FMTLIST(2); IMGUI_API bool TreeNodeV(const void* ptr_id, const char* fmt, va_list args) IM_FMTLIST(2); IMGUI_API bool TreeNodeEx(const char* label, ImGuiTreeNodeFlags flags = 0); IMGUI_API bool TreeNodeEx(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3); IMGUI_API bool TreeNodeEx(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, ...) IM_FMTARGS(3); IMGUI_API bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); IMGUI_API bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3); IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call Push/Pop yourself for layout purpose IMGUI_API void TreePush(const void* ptr_id = NULL); // " IMGUI_API void TreePop(); // ~ Unindent()+PopId() IMGUI_API void TreeAdvanceToLabelPos(); // advance cursor x position by GetTreeNodeToLabelSpacing() IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode IMGUI_API void SetNextTreeNodeOpen(bool is_open, ImGuiCond cond = 0); // set next TreeNode/CollapsingHeader open state. IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop(). IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header // Widgets: Selectable / Lists IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // "bool* p_selected" point to the selection state (read-write), as a convenient helper. IMGUI_API bool ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items = -1); IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1); IMGUI_API bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. make sure to call ListBoxFooter() afterwards. IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // " IMGUI_API void ListBoxFooter(); // terminate the scrolling region // Widgets: Value() Helpers. Output single value in "name: value" format (tip: freely declare more in your code to handle your types. you can add functions to the ImGui namespace) IMGUI_API void Value(const char* prefix, bool b); IMGUI_API void Value(const char* prefix, int v); IMGUI_API void Value(const char* prefix, unsigned int v); IMGUI_API void Value(const char* prefix, float v, const char* float_format = NULL); // Tooltips IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set text tooltip under mouse-cursor, typically use with ImGui::IsItemHovered(). overidde any previous call to SetTooltip(). IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1); IMGUI_API void BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of contents). IMGUI_API void EndTooltip(); // Menus IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar. IMGUI_API void EndMainMenuBar(); // only call EndMainMenuBar() if BeginMainMenuBar() returns true! IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window). IMGUI_API void EndMenuBar(); // only call EndMenuBar() if BeginMenuBar() returns true! IMGUI_API bool BeginMenu(const char* label, bool enabled = true); // create a sub-menu entry. only call EndMenu() if this returns true! IMGUI_API void EndMenu(); // only call EndMenu() if BeginMenu() returns true! IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true); // return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL // Popups IMGUI_API void OpenPopup(const char* str_id); // call to mark popup as open (don't call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returns true! IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp! IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, int mouse_button = 1, bool also_over_items = true); // helper to open and begin popup when clicked on current window. IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked in void (where there are no imgui windows). IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // modal dialog (regular window with title bar, block interactions behind the modal window, can't close the modal window by clicking outside) IMGUI_API void EndPopup(); // only call EndPopup() if BeginPopupXXX() returns true! IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, int mouse_button = 1); // helper to open popup when clicked on last item. return true when just opened. IMGUI_API bool IsPopupOpen(const char* str_id); // return true if the popup is open IMGUI_API void CloseCurrentPopup(); // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup. // Columns // You can also use SameLine(pos_x) for simplified columns. The columns API is still work-in-progress and rather lacking. IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true); IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished IMGUI_API int GetColumnIndex(); // get current column index IMGUI_API float GetColumnWidth(int column_index = -1); // get column width (in pixels). pass -1 to use current column IMGUI_API void SetColumnWidth(int column_index, float width); // set column width (in pixels). pass -1 to use current column IMGUI_API float GetColumnOffset(int column_index = -1); // get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f IMGUI_API void SetColumnOffset(int column_index, float offset_x); // set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column IMGUI_API int GetColumnsCount(); // Logging/Capture: all text output from interface is captured to tty/file/clipboard. By default, tree nodes are automatically opened during logging. IMGUI_API void LogToTTY(int max_depth = -1); // start logging to tty IMGUI_API void LogToFile(int max_depth = -1, const char* filename = NULL); // start logging to file IMGUI_API void LogToClipboard(int max_depth = -1); // start logging to OS clipboard IMGUI_API void LogFinish(); // stop logging (close file, etc.) IMGUI_API void LogButtons(); // helper to display buttons for logging to tty/file/clipboard IMGUI_API void LogText(const char* fmt, ...) IM_FMTARGS(1); // pass text data straight to log (without being displayed) // Drag and Drop // [BETA API] Missing Demo code. API may evolve. IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0); // call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource() IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t size, ImGuiCond cond = 0);// type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. IMGUI_API void EndDragDropSource(); // only call EndDragDropSource() if BeginDragDropSource() returns true! IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget() IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released. IMGUI_API void EndDragDropTarget(); // only call EndDragDropTarget() if BeginDragDropTarget() returns true! // Clipping IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect); IMGUI_API void PopClipRect(); // Focus, Activation // (Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHere()" when applicable, to make your code more forward compatible when navigation branch is merged) IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window. Please use instead of "if (IsWindowAppearing()) SetScrollHere()" to signify "default item". IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget. // Utilities IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0); // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options. IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false) IMGUI_API bool IsItemFocused(); // is the last item focused for keyboard/gamepad navigation? IMGUI_API bool IsItemClicked(int mouse_button = 0); // is the last item clicked? (e.g. button/node just clicked on) IMGUI_API bool IsItemVisible(); // is the last item visible? (aka not out of sight due to clipping/scrolling.) IMGUI_API bool IsAnyItemHovered(); IMGUI_API bool IsAnyItemActive(); IMGUI_API bool IsAnyItemFocused(); IMGUI_API ImVec2 GetItemRectMin(); // get bounding rectangle of last item, in screen space IMGUI_API ImVec2 GetItemRectMax(); // " IMGUI_API ImVec2 GetItemRectSize(); // get size of last item, in screen space IMGUI_API void SetItemAllowOverlap(); // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area. IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped. IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side. IMGUI_API float GetTime(); IMGUI_API int GetFrameCount(); IMGUI_API ImDrawList* GetOverlayDrawList(); // this draw list will be the last rendered one, useful to quickly draw overlays shapes/text IMGUI_API ImDrawListSharedData* GetDrawListSharedData(); // you may use this when creating your own ImDrawList instances IMGUI_API const char* GetStyleColorName(ImGuiCol idx); IMGUI_API void SetStateStorage(ImGuiStorage* storage); // replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it) IMGUI_API ImGuiStorage* GetStateStorage(); IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f); IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can. IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame IMGUI_API void EndChildFrame(); // always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window) IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in); IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in); IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v); IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b); // Inputs IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key] IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index]. note that imgui doesn't know the semantic of each entry of io.KeyDown[]. Use your own indices/enums according to how your backend/engine stored them into KeyDown[]! IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down). if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down).. IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate IMGUI_API bool IsMouseDown(int button); // is mouse button held IMGUI_API bool IsAnyMouseDown(); // is any mouse button held IMGUI_API bool IsMouseClicked(int button, bool repeat = false); // did mouse button clicked (went from !Down to Down) IMGUI_API bool IsMouseDoubleClicked(int button); // did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime. IMGUI_API bool IsMouseReleased(int button); // did mouse button released (went from Down to !Down) IMGUI_API bool IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true); // is mouse hovering given bounding rect (in screen space). clipped by current clipping settings. disregarding of consideration of focus/window ordering/blocked by a popup. IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve backup of mouse position at the time of opening popup we have BeginPopup() into IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking. if lock_threshold < -1.0f uses io.MouseDraggingThreshold IMGUI_API void ResetMouseDragDelta(int button = 0); // IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type IMGUI_API void CaptureKeyboardFromApp(bool capture = true); // manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. IMGUI_API void CaptureMouseFromApp(bool capture = true); // manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). // Clipboard Utilities (also see the LogToClipboard() function to capture or output text data to the clipboard) IMGUI_API const char* GetClipboardText(); IMGUI_API void SetClipboardText(const char* text); // Memory Utilities // All those functions are not reliant on the current context. // If you reload the contents of imgui.cpp at runtime, you may need to call SetCurrentContext() + SetAllocatorFunctions() again. IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void(*free_func)(void* ptr, void* user_data), void* user_data = NULL); IMGUI_API void* MemAlloc(size_t size); IMGUI_API void MemFree(void* ptr); } // namespace ImGui // Flags for ImGui::Begin() enum ImGuiWindowFlags_ { ImGuiWindowFlags_NoTitleBar = 1 << 0, // Disable title-bar ImGuiWindowFlags_NoResize = 1 << 1, // Disable user resizing with the lower-right grip ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window ImGuiWindowFlags_NoScrollbar = 1 << 3, // Disable scrollbars (window can still scroll with mouse or programatically) ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, // Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set. ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, // Resize every window to its content every frame //ImGuiWindowFlags_ShowBorders = 1 << 7, // Show borders around windows and items (OBSOLETE! Use e.g. style.FrameBorderSize=1.0f to enable borders). ImGuiWindowFlags_NoSavedSettings = 1 << 8, // Never load/save settings in .ini file ImGuiWindowFlags_NoInputs = 1 << 9, // Disable catching mouse or keyboard inputs, hovering test with pass through. ImGuiWindowFlags_MenuBar = 1 << 10, // Has a menu-bar ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, // Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section. ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, // Disable taking focus when transitioning from hidden to visible state ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, // Disable bringing window to front when taking focus (e.g. clicking on it or programatically giving it focus) ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 14, // Always show vertical scrollbar (even if ContentSize.y < Size.y) ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, // Always show horizontal scrollbar (even if ContentSize.x < Size.x) ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient) ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // [BETA] Enable resize from any corners and borders. Your back-end needs to honor the different values of io.MouseCursor set by imgui. ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window ImGuiWindowFlags_NoNavFocus = 1 << 19, // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB) ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, // [Internal] ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!) ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild() ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip() ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup() ImGuiWindowFlags_Modal = 1 << 27, // Don't use! For internal use by BeginPopupModal() ImGuiWindowFlags_ChildMenu = 1 << 28 // Don't use! For internal use by BeginMenu() }; // Flags for ImGui::InputText() enum ImGuiInputTextFlags_ { ImGuiInputTextFlags_CharsDecimal = 1 << 0, // Allow 0123456789.+-*/ ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, // Allow 0123456789ABCDEFabcdef ImGuiInputTextFlags_CharsUppercase = 1 << 2, // Turn a..z into A..Z ImGuiInputTextFlags_CharsNoBlank = 1 << 3, // Filter out spaces, tabs ImGuiInputTextFlags_AutoSelectAll = 1 << 4, // Select entire text when first taking mouse focus ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, // Return 'true' when Enter is pressed (as opposed to when the value was modified) ImGuiInputTextFlags_CallbackCompletion = 1 << 6, // Call user function on pressing TAB (for completion handling) ImGuiInputTextFlags_CallbackHistory = 1 << 7, // Call user function on pressing Up/Down arrows (for history handling) ImGuiInputTextFlags_CallbackAlways = 1 << 8, // Call user function every time. User code may query cursor position, modify text buffer. ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, // Call user function to filter character. Modify data->EventChar to replace/filter input, or return 1 to discard character. ImGuiInputTextFlags_AllowTabInput = 1 << 10, // Pressing TAB input a '\t' character into the text field ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, // In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter). ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, // Disable following the cursor horizontally ImGuiInputTextFlags_AlwaysInsertMode = 1 << 13, // Insert mode ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode ImGuiInputTextFlags_Password = 1 << 15, // Password mode, display all characters as '*' ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input) // [Internal] ImGuiInputTextFlags_Multiline = 1 << 20 // For internal use by InputTextMultiline() }; // Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*() enum ImGuiTreeNodeFlags_ { ImGuiTreeNodeFlags_Selected = 1 << 0, // Draw as selected ImGuiTreeNodeFlags_Framed = 1 << 1, // Full colored frame (e.g. for CollapsingHeader) ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2, // Hit testing to allow subsequent widgets to overlap this one ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, // Default node to be open ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, // Need double-click to open node ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, // Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open. ImGuiTreeNodeFlags_Leaf = 1 << 8, // No collapsing, no arrow (use as a convenience for leaf nodes). ImGuiTreeNodeFlags_Bullet = 1 << 9, // Display a bullet instead of arrow ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding(). //ImGuITreeNodeFlags_SpanAllAvailWidth = 1 << 11, // FIXME: TODO: Extend hit box horizontally even if not framed //ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 12, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop) ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoAutoOpenOnLog // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS , ImGuiTreeNodeFlags_AllowOverlapMode = ImGuiTreeNodeFlags_AllowItemOverlap #endif }; // Flags for ImGui::Selectable() enum ImGuiSelectableFlags_ { ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this don't close parent popup window ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column) ImGuiSelectableFlags_AllowDoubleClick = 1 << 2 // Generate press events on double clicks too }; // Flags for ImGui::BeginCombo() enum ImGuiComboFlags_ { ImGuiComboFlags_PopupAlignLeft = 1 << 0, // Align the popup toward the left by default ImGuiComboFlags_HeightSmall = 1 << 1, // Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo() ImGuiComboFlags_HeightRegular = 1 << 2, // Max ~8 items visible (default) ImGuiComboFlags_HeightLarge = 1 << 3, // Max ~20 items visible ImGuiComboFlags_HeightLargest = 1 << 4, // As many fitting items as possible ImGuiComboFlags_NoArrowButton = 1 << 5, // Display on the preview box without the square arrow button ImGuiComboFlags_NoPreview = 1 << 6, // Display only a square arrow button ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest }; // Flags for ImGui::IsWindowFocused() enum ImGuiFocusedFlags_ { ImGuiFocusedFlags_ChildWindows = 1 << 0, // IsWindowFocused(): Return true if any children of the window is focused ImGuiFocusedFlags_RootWindow = 1 << 1, // IsWindowFocused(): Test from root window (top most parent of the current hierarchy) ImGuiFocusedFlags_AnyWindow = 1 << 2, // IsWindowFocused(): Return true if any window is focused ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows }; // Flags for ImGui::IsItemHovered(), ImGui::IsWindowHovered() // Note: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that. Please read the FAQ! enum ImGuiHoveredFlags_ { ImGuiHoveredFlags_Default = 0, // Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them. ImGuiHoveredFlags_ChildWindows = 1 << 0, // IsWindowHovered() only: Return true if any children of the window is hovered ImGuiHoveredFlags_RootWindow = 1 << 1, // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy) ImGuiHoveredFlags_AnyWindow = 1 << 2, // IsWindowHovered() only: Return true if any window is hovered ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 3, // Return true even if a popup window is normally blocking access to this item/window //ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 4, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet. ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 5, // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns. ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 6, // Return true even if the position is overlapped by another window ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped, ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows }; // Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload() enum ImGuiDragDropFlags_ { // BeginDragDropSource() flags ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior. ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return true, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item. ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. // AcceptDragDropPayload() flags ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target. ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect // For peeking ahead and inspecting the payload before delivery. }; // Standard Drag and Drop payload types. You can define you own payload types using 12-characters long strings. Types starting with '_' are defined by Dear ImGui. #define IMGUI_PAYLOAD_TYPE_COLOR_3F "_COL3F" // float[3]: Standard type for colors, without alpha. User code may use this type. #define IMGUI_PAYLOAD_TYPE_COLOR_4F "_COL4F" // float[4]: Standard type for colors. User code may use this type. // A cardinal direction enum ImGuiDir_ { ImGuiDir_None = -1, ImGuiDir_Left = 0, ImGuiDir_Right = 1, ImGuiDir_Up = 2, ImGuiDir_Down = 3, ImGuiDir_COUNT }; // User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array enum ImGuiKey_ { ImGuiKey_Tab, ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow, ImGuiKey_PageUp, ImGuiKey_PageDown, ImGuiKey_Home, ImGuiKey_End, ImGuiKey_Insert, ImGuiKey_Delete, ImGuiKey_Backspace, ImGuiKey_Space, ImGuiKey_Enter, ImGuiKey_Escape, ImGuiKey_A, // for text edit CTRL+A: select all ImGuiKey_C, // for text edit CTRL+C: copy ImGuiKey_V, // for text edit CTRL+V: paste ImGuiKey_X, // for text edit CTRL+X: cut ImGuiKey_Y, // for text edit CTRL+Y: redo ImGuiKey_Z, // for text edit CTRL+Z: undo ImGuiKey_COUNT }; // [BETA] Gamepad/Keyboard directional navigation // Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeyDown[] + io.KeyMap[] arrays. // Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Back-end: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame(). // Read instructions in imgui.cpp for more details. Download PNG/PSD at goo.gl/9LgVZW. enum ImGuiNavInput_ { // Gamepad Mapping ImGuiNavInput_Activate, // activate / open / toggle / tweak value // e.g. Cross (PS4), A (Xbox), A (Switch), Space (Keyboard) ImGuiNavInput_Cancel, // cancel / close / exit // e.g. Circle (PS4), B (Xbox), B (Switch), Escape (Keyboard) ImGuiNavInput_Input, // text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard) ImGuiNavInput_Menu, // tap: toggle menu / hold: focus, move, resize // e.g. Square (PS4), X (Xbox), Y (Switch), Alt (Keyboard) ImGuiNavInput_DpadLeft, // move / tweak / resize window (w/ PadMenu) // e.g. D-pad Left/Right/Up/Down (Gamepads), Arrow keys (Keyboard) ImGuiNavInput_DpadRight, // ImGuiNavInput_DpadUp, // ImGuiNavInput_DpadDown, // ImGuiNavInput_LStickLeft, // scroll / move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down ImGuiNavInput_LStickRight, // ImGuiNavInput_LStickUp, // ImGuiNavInput_LStickDown, // ImGuiNavInput_FocusPrev, // next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) ImGuiNavInput_FocusNext, // prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) ImGuiNavInput_TweakSlow, // slower tweaks // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) ImGuiNavInput_TweakFast, // faster tweaks // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) // [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them. // Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) will be directly reading from io.KeyDown[] instead of io.NavInputs[]. ImGuiNavInput_KeyMenu_, // toggle menu // = io.KeyAlt ImGuiNavInput_KeyLeft_, // move left // = Arrow keys ImGuiNavInput_KeyRight_, // move right ImGuiNavInput_KeyUp_, // move up ImGuiNavInput_KeyDown_, // move down ImGuiNavInput_COUNT, ImGuiNavInput_InternalStart_ = ImGuiNavInput_KeyMenu_ }; // Configuration flags stored in io.ConfigFlags. Set by user/application. enum ImGuiConfigFlags_ { ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeyDown[]. ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[]. Back-end also needs to set ImGuiBackendFlags_HasGamepad. ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth. ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag with io.NavActive is set. ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information back-end ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, // Instruct back-end to not alter mouse cursor shape and visibility. // User storage (to allow your back-end/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core ImGui) ImGuiConfigFlags_IsSRGB = 1 << 20, // Application is SRGB-aware. ImGuiConfigFlags_IsTouchScreen = 1 << 21 // Application is using a touch screen instead of a mouse. }; // Back-end capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom back-end. enum ImGuiBackendFlags_ { ImGuiBackendFlags_HasGamepad = 1 << 0, // Back-end has a connected gamepad. ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Back-end can honor GetMouseCursor() values and change the OS cursor shape. ImGuiBackendFlags_HasSetMousePos = 1 << 2 // Back-end can honor io.WantSetMousePos and reposition the mouse (only used if ImGuiConfigFlags_NavEnableSetMousePos is set). }; // Enumeration for PushStyleColor() / PopStyleColor() enum ImGuiCol_ { ImGuiCol_Text, ImGuiCol_TextDisabled, ImGuiCol_WindowBg, // Background of normal windows ImGuiCol_ChildBg, // Background of child windows ImGuiCol_PopupBg, // Background of popups, menus, tooltips windows ImGuiCol_Border, ImGuiCol_BorderShadow, ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input ImGuiCol_FrameBgHovered, ImGuiCol_FrameBgActive, ImGuiCol_TitleBg, ImGuiCol_TitleBgActive, ImGuiCol_TitleBgCollapsed, ImGuiCol_MenuBarBg, ImGuiCol_ScrollbarBg, ImGuiCol_ScrollbarGrab, ImGuiCol_ScrollbarGrabHovered, ImGuiCol_ScrollbarGrabActive, ImGuiCol_CheckMark, ImGuiCol_SliderGrab, ImGuiCol_SliderGrabActive, ImGuiCol_Button, ImGuiCol_ButtonHovered, ImGuiCol_ButtonActive, ImGuiCol_Header, ImGuiCol_HeaderHovered, ImGuiCol_HeaderActive, ImGuiCol_Separator, ImGuiCol_SeparatorHovered, ImGuiCol_SeparatorActive, ImGuiCol_ResizeGrip, ImGuiCol_ResizeGripHovered, ImGuiCol_ResizeGripActive, ImGuiCol_PlotLines, ImGuiCol_PlotLinesHovered, ImGuiCol_PlotHistogram, ImGuiCol_PlotHistogramHovered, ImGuiCol_TextSelectedBg, ImGuiCol_ModalWindowDarkening, // darken/colorize entire screen behind a modal window, when one is active ImGuiCol_DragDropTarget, ImGuiCol_NavHighlight, // gamepad/keyboard: current highlighted item ImGuiCol_NavWindowingHighlight, // gamepad/keyboard: when holding NavMenu to focus/move/resize windows ImGuiCol_COUNT // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS , ImGuiCol_ChildWindowBg = ImGuiCol_ChildBg, ImGuiCol_Column = ImGuiCol_Separator, ImGuiCol_ColumnHovered = ImGuiCol_SeparatorHovered, ImGuiCol_ColumnActive = ImGuiCol_SeparatorActive //ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered, // [unused since 1.60+] the close button now uses regular button colors. //ImGuiCol_ComboBg, // [unused since 1.53+] ComboBg has been merged with PopupBg, so a redirect isn't accurate. #endif }; // Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure. // NB: the enum only refers to fields of ImGuiStyle which makes sense to be pushed/popped inside UI code. During initialization, feel free to just poke into ImGuiStyle directly. // NB: if changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link enum values to members offset/type. enum ImGuiStyleVar_ { // Enum name ......................// Member in ImGuiStyle structure (see ImGuiStyle for descriptions) ImGuiStyleVar_Alpha, // float Alpha ImGuiStyleVar_WindowPadding, // ImVec2 WindowPadding ImGuiStyleVar_WindowRounding, // float WindowRounding ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize ImGuiStyleVar_WindowTitleAlign, // ImVec2 WindowTitleAlign ImGuiStyleVar_ChildRounding, // float ChildRounding ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize ImGuiStyleVar_PopupRounding, // float PopupRounding ImGuiStyleVar_PopupBorderSize, // float PopupBorderSize ImGuiStyleVar_FramePadding, // ImVec2 FramePadding ImGuiStyleVar_FrameRounding, // float FrameRounding ImGuiStyleVar_FrameBorderSize, // float FrameBorderSize ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing ImGuiStyleVar_IndentSpacing, // float IndentSpacing ImGuiStyleVar_ScrollbarSize, // float ScrollbarSize ImGuiStyleVar_ScrollbarRounding, // float ScrollbarRounding ImGuiStyleVar_GrabMinSize, // float GrabMinSize ImGuiStyleVar_GrabRounding, // float GrabRounding ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign ImGuiStyleVar_COUNT // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS , ImGuiStyleVar_Count_ = ImGuiStyleVar_COUNT, ImGuiStyleVar_ChildWindowRounding = ImGuiStyleVar_ChildRounding #endif }; // Enumeration for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton() enum ImGuiColorEditFlags_ { ImGuiColorEditFlags_NoAlpha = 1 << 1, // // ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer). ImGuiColorEditFlags_NoPicker = 1 << 2, // // ColorEdit: disable picker when clicking on colored square. ImGuiColorEditFlags_NoOptions = 1 << 3, // // ColorEdit: disable toggling options menu when right-clicking on inputs/small preview. ImGuiColorEditFlags_NoSmallPreview = 1 << 4, // // ColorEdit, ColorPicker: disable colored square preview next to the inputs. (e.g. to show only the inputs) ImGuiColorEditFlags_NoInputs = 1 << 5, // // ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview colored square). ImGuiColorEditFlags_NoTooltip = 1 << 6, // // ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview. ImGuiColorEditFlags_NoLabel = 1 << 7, // // ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker). ImGuiColorEditFlags_NoSidePreview = 1 << 8, // // ColorPicker: disable bigger color preview on right side of the picker, use small colored square preview instead. // User Options (right-click on widget to change some of them). You can set application defaults using SetColorEditOptions(). The idea is that you probably don't want to override them in most of your calls, let the user choose and/or call SetColorEditOptions() during startup. ImGuiColorEditFlags_AlphaBar = 1 << 9, // // ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker. ImGuiColorEditFlags_AlphaPreview = 1 << 10, // // ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque. ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 11, // // ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque. ImGuiColorEditFlags_HDR = 1 << 12, // // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well). ImGuiColorEditFlags_RGB = 1 << 13, // [Inputs] // ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX. ImGuiColorEditFlags_HSV = 1 << 14, // [Inputs] // " ImGuiColorEditFlags_HEX = 1 << 15, // [Inputs] // " ImGuiColorEditFlags_Uint8 = 1 << 16, // [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0..255. ImGuiColorEditFlags_Float = 1 << 17, // [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers. ImGuiColorEditFlags_PickerHueBar = 1 << 18, // [PickerMode] // ColorPicker: bar for Hue, rectangle for Sat/Value. ImGuiColorEditFlags_PickerHueWheel = 1 << 19, // [PickerMode] // ColorPicker: wheel for Hue, triangle for Sat/Value. // [Internal] Masks ImGuiColorEditFlags__InputsMask = ImGuiColorEditFlags_RGB|ImGuiColorEditFlags_HSV|ImGuiColorEditFlags_HEX, ImGuiColorEditFlags__DataTypeMask = ImGuiColorEditFlags_Uint8|ImGuiColorEditFlags_Float, ImGuiColorEditFlags__PickerMask = ImGuiColorEditFlags_PickerHueWheel|ImGuiColorEditFlags_PickerHueBar, ImGuiColorEditFlags__OptionsDefault = ImGuiColorEditFlags_Uint8|ImGuiColorEditFlags_RGB|ImGuiColorEditFlags_PickerHueBar // Change application default using SetColorEditOptions() }; // Enumeration for GetMouseCursor() // User code may request binding to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here enum ImGuiMouseCursor_ { ImGuiMouseCursor_None = -1, ImGuiMouseCursor_Arrow = 0, ImGuiMouseCursor_TextInput, // When hovering over InputText, etc. ImGuiMouseCursor_ResizeAll, // Unused by imgui functions ImGuiMouseCursor_ResizeNS, // When hovering over an horizontal border ImGuiMouseCursor_ResizeEW, // When hovering over a vertical border or a column ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window ImGuiMouseCursor_COUNT // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS , ImGuiMouseCursor_Count_ = ImGuiMouseCursor_COUNT #endif }; // Condition for ImGui::SetWindow***(), SetNextWindow***(), SetNextTreeNode***() functions // Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always. enum ImGuiCond_ { ImGuiCond_Always = 1 << 0, // Set the variable ImGuiCond_Once = 1 << 1, // Set the variable once per runtime session (only the first call with succeed) ImGuiCond_FirstUseEver = 1 << 2, // Set the variable if the object/window has no persistently saved data (no entry in .ini file) ImGuiCond_Appearing = 1 << 3 // Set the variable if the object/window is appearing after being hidden/inactive (or the first time) // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS , ImGuiSetCond_Always = ImGuiCond_Always, ImGuiSetCond_Once = ImGuiCond_Once, ImGuiSetCond_FirstUseEver = ImGuiCond_FirstUseEver, ImGuiSetCond_Appearing = ImGuiCond_Appearing #endif }; // You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame(). // During the frame, use ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values, and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors. struct ImGuiStyle { float Alpha; // Global alpha applies to everything in ImGui. ImVec2 WindowPadding; // Padding within a window. float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints(). ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered. float ChildRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows. float ChildBorderSize; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). float PopupRounding; // Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding) float PopupBorderSize; // Thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). ImVec2 FramePadding; // Padding within a framed rectangle (used by most widgets). float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets). float FrameBorderSize; // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly). ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines. ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label). ImVec2 TouchExtraPadding; // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! float IndentSpacing; // Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). float ColumnsMinSpacing; // Minimum horizontal spacing between two columns. float ScrollbarSize; // Width of the vertical scrollbar, Height of the horizontal scrollbar. float ScrollbarRounding; // Radius of grab corners for scrollbar. float GrabMinSize; // Minimum width/height of a grab box for slider/scrollbar. float GrabRounding; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f,0.5f) for horizontally+vertically centered. ImVec2 DisplayWindowPadding; // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows. ImVec2 DisplaySafeAreaPadding; // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later. bool AntiAliasedLines; // Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU. bool AntiAliasedFill; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.) float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. ImVec4 Colors[ImGuiCol_COUNT]; IMGUI_API ImGuiStyle(); IMGUI_API void ScaleAllSizes(float scale_factor); }; // This is where your app communicate with ImGui. Access via ImGui::GetIO(). // Read 'Programmer guide' section in .cpp file for general usage. struct ImGuiIO { //------------------------------------------------------------------ // Settings (fill once) // Default value: //------------------------------------------------------------------ ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc. ImGuiBackendFlags BackendFlags; // = 0 // Set ImGuiBackendFlags_ enum. Set by imgui_impl_xxx files or custom back-end. ImVec2 DisplaySize; // // Display size, in pixels. For clamping windows positions. float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds. float IniSavingRate; // = 5.0f // Maximum time between saving positions/sizes to .ini file, in seconds. const char* IniFilename; // = "imgui.ini" // Path to .ini file. NULL to disable .ini saving. const char* LogFilename; // = "imgui_log.txt" // Path to .log file (default parameter to ImGui::LogToFile when no file is specified). float MouseDoubleClickTime; // = 0.30f // Time for a double-click, in seconds. float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels. float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging. int KeyMap[ImGuiKey_COUNT]; // // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.). float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds. void* UserData; // = NULL // Store your own data for retrieval by callbacks. ImFontAtlas* Fonts; // // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array. float FontGlobalScale; // = 1.0f // Global scale all fonts bool FontAllowUserScaling; // = false // Allow user scaling text of individual window with CTRL+Wheel. ImFont* FontDefault; // = NULL // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0]. ImVec2 DisplayFramebufferScale; // = (1.0f,1.0f) // For retina display or other situations where window coordinates are different from framebuffer coordinates. User storage only, presently not used by ImGui. ImVec2 DisplayVisibleMin; // (0.0f,0.0f) // If you use DisplaySize as a virtual space larger than your screen, set DisplayVisibleMin/Max to the visible area. ImVec2 DisplayVisibleMax; // (0.0f,0.0f) // If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize // Advanced/subtle behaviors bool OptMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl bool OptCursorBlink; // = true // Enable blinking cursor, for users who consider it annoying. //------------------------------------------------------------------ // Settings (User Functions) //------------------------------------------------------------------ // Optional: access OS clipboard // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures) const char* (*GetClipboardTextFn)(void* user_data); void (*SetClipboardTextFn)(void* user_data, const char* text); void* ClipboardUserData; // Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME in Windows) // (default to use native imm32 api on Windows) void (*ImeSetInputScreenPosFn)(int x, int y); void* ImeWindowHandle; // (Windows) Set this to your HWND to get automatic IME cursor positioning. #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS // [OBSOLETE] Rendering function, will be automatically called in Render(). Please call your rendering function yourself now! You can obtain the ImDrawData* by calling ImGui::GetDrawData() after Render(). // See example applications if you are unsure of how to implement this. void (*RenderDrawListsFn)(ImDrawData* data); #endif //------------------------------------------------------------------ // Input - Fill before calling NewFrame() //------------------------------------------------------------------ ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.) bool MouseDown[5]; // Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API. float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text. float MouseWheelH; // Mouse wheel (Horizontal). Most users don't have a mouse with an horizontal wheel, may not be filled by all back-ends. bool MouseDrawCursor; // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). bool KeyCtrl; // Keyboard modifier pressed: Control bool KeyShift; // Keyboard modifier pressed: Shift bool KeyAlt; // Keyboard modifier pressed: Alt bool KeySuper; // Keyboard modifier pressed: Cmd/Super/Windows bool KeysDown[512]; // Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). ImWchar InputCharacters[16+1]; // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper. float NavInputs[ImGuiNavInput_COUNT]; // Gamepad inputs (keyboard keys will be auto-mapped and be written here by ImGui::NewFrame, all values will be cleared back to zero in ImGui::EndFrame) // Functions IMGUI_API void AddInputCharacter(ImWchar c); // Add new character into InputCharacters[] IMGUI_API void AddInputCharactersUTF8(const char* utf8_chars); // Add new characters into InputCharacters[] from an UTF-8 string inline void ClearInputCharacters() { InputCharacters[0] = 0; } // Clear the text input buffer manually //------------------------------------------------------------------ // Output - Retrieve after calling NewFrame() //------------------------------------------------------------------ bool WantCaptureMouse; // When io.WantCaptureMouse is true, imgui will use the mouse inputs, do not dispatch them to your main game/application (in both cases, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.). bool WantCaptureKeyboard; // When io.WantCaptureKeyboard is true, imgui will use the keyboard inputs, do not dispatch them to your main game/application (in both cases, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.). bool WantTextInput; // Mobile/console: when io.WantTextInput is true, you may display an on-screen keyboard. This is set by ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active). bool WantSetMousePos; // MousePos has been altered, back-end should reposition mouse on next frame. Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled. bool NavActive; // Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag. bool NavVisible; // Directional navigation is visible and allowed (will handle ImGuiKey_NavXXX events). float Framerate; // Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames int MetricsRenderVertices; // Vertices output during last call to Render() int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3 int MetricsActiveWindows; // Number of visible root windows (exclude child windows) ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta. //------------------------------------------------------------------ // [Internal] ImGui will maintain those fields. Forward compatibility not guaranteed! //------------------------------------------------------------------ ImVec2 MousePosPrev; // Previous mouse position temporary storage (nb: not for public use, set to MousePos in NewFrame()) ImVec2 MouseClickedPos[5]; // Position at time of clicking float MouseClickedTime[5]; // Time of last click (used to figure out double-click) bool MouseClicked[5]; // Mouse button went from !Down to Down bool MouseDoubleClicked[5]; // Has mouse button been double-clicked? bool MouseReleased[5]; // Mouse button went from Down to !Down bool MouseDownOwned[5]; // Track if button was clicked inside a window. We don't request mouse capture from the application if click started outside ImGui bounds. float MouseDownDuration[5]; // Duration the mouse button has been down (0.0f == just clicked) float MouseDownDurationPrev[5]; // Previous time the mouse button has been down ImVec2 MouseDragMaxDistanceAbs[5]; // Maximum distance, absolute, on each axis, of how much mouse has traveled from the clicking point float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point float KeysDownDuration[512]; // Duration the keyboard key has been down (0.0f == just pressed) float KeysDownDurationPrev[512]; // Previous duration the key has been down float NavInputsDownDuration[ImGuiNavInput_COUNT]; float NavInputsDownDurationPrev[ImGuiNavInput_COUNT]; IMGUI_API ImGuiIO(); }; //----------------------------------------------------------------------------- // Obsolete functions (Will be removed! Read 'API BREAKING CHANGES' section in imgui.cpp for details) //----------------------------------------------------------------------------- #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS namespace ImGui { // OBSOLETED in 1.60 (from Dec 2017) static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); } static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); } static inline ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = 0.f) { (void)on_edge; (void)outward; IM_ASSERT(0); return pos; } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017) static inline void ShowTestWindow() { return ShowDemoWindow(); } static inline bool IsRootWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootWindow); } static inline bool IsRootWindowOrAnyChildFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); } static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); } static inline float GetItemsLineHeightWithSpacing() { return GetFrameHeightWithSpacing(); } // OBSOLETED in 1.52 (between Aug 2017 and Oct 2017) bool Begin(const char* name, bool* p_open, const ImVec2& size_on_first_use, float bg_alpha_override = -1.0f, ImGuiWindowFlags flags = 0); // Use SetNextWindowSize(size, ImGuiCond_FirstUseEver) + SetNextWindowBgAlpha() instead. static inline bool IsRootWindowOrAnyChildHovered() { return IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows); } static inline void AlignFirstTextHeightToWidgets() { AlignTextToFramePadding(); } static inline void SetNextWindowPosCenter(ImGuiCond c=0) { ImGuiIO& io = GetIO(); SetNextWindowPos(ImVec2(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f), c, ImVec2(0.5f, 0.5f)); } // OBSOLETED in 1.51 (between Jun 2017 and Aug 2017) static inline bool IsItemHoveredRect() { return IsItemHovered(ImGuiHoveredFlags_RectOnly); } static inline bool IsPosHoveringAnyWindow(const ImVec2&) { IM_ASSERT(0); return false; } // This was misleading and partly broken. You probably want to use the ImGui::GetIO().WantCaptureMouse flag instead. static inline bool IsMouseHoveringAnyWindow() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); } static inline bool IsMouseHoveringWindow() { return IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem); } // OBSOLETED IN 1.49 (between Apr 2016 and May 2016) static inline bool CollapsingHeader(const char* label, const char* str_id, bool framed = true, bool default_open = false) { (void)str_id; (void)framed; ImGuiTreeNodeFlags default_open_flags = 1 << 5; return CollapsingHeader(label, (default_open ? default_open_flags : 0)); } } #endif //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- // Helper: Lightweight std::vector<> like class to avoid dragging dependencies (also: Windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug). // *Important* Our implementation does NOT call C++ constructors/destructors. This is intentional, we do not require it but you have to be mindful of that. Do not use this class as a straight std::vector replacement in your code! template class ImVector { public: int Size; int Capacity; T* Data; typedef T value_type; typedef value_type* iterator; typedef const value_type* const_iterator; inline ImVector() { Size = Capacity = 0; Data = NULL; } inline ~ImVector() { if (Data) ImGui::MemFree(Data); } inline ImVector(const ImVector& src) { Size = Capacity = 0; Data = NULL; operator=(src); } inline ImVector& operator=(const ImVector& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(value_type)); return *this; } inline bool empty() const { return Size == 0; } inline int size() const { return Size; } inline int capacity() const { return Capacity; } inline value_type& operator[](int i) { IM_ASSERT(i < Size); return Data[i]; } inline const value_type& operator[](int i) const { IM_ASSERT(i < Size); return Data[i]; } inline void clear() { if (Data) { Size = Capacity = 0; ImGui::MemFree(Data); Data = NULL; } } inline iterator begin() { return Data; } inline const_iterator begin() const { return Data; } inline iterator end() { return Data + Size; } inline const_iterator end() const { return Data + Size; } inline value_type& front() { IM_ASSERT(Size > 0); return Data[0]; } inline const value_type& front() const { IM_ASSERT(Size > 0); return Data[0]; } inline value_type& back() { IM_ASSERT(Size > 0); return Data[Size - 1]; } inline const value_type& back() const { IM_ASSERT(Size > 0); return Data[Size - 1]; } inline void swap(ImVector& rhs) { int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; } inline int _grow_capacity(int sz) const { int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > sz ? new_capacity : sz; } inline void resize(int new_size) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; } inline void resize(int new_size,const value_type& v){ if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; } inline void reserve(int new_capacity) { if (new_capacity <= Capacity) return; value_type* new_data = (value_type*)ImGui::MemAlloc((size_t)new_capacity * sizeof(value_type)); if (Data) memcpy(new_data, Data, (size_t)Size * sizeof(value_type)); ImGui::MemFree(Data); Data = new_data; Capacity = new_capacity; } // NB: &v cannot be pointing inside the ImVector Data itself! e.g. v.push_back(v[10]) is forbidden. inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); memcpy(&Data[Size], &v, sizeof(v)); Size++; } inline void pop_back() { IM_ASSERT(Size > 0); Size--; } inline void push_front(const value_type& v) { if (Size == 0) push_back(v); else insert(Data, v); } inline iterator erase(const_iterator it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(value_type)); Size--; return Data + off; } inline iterator insert(const_iterator it, const value_type& v) { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(value_type)); memcpy(&Data[off], &v, sizeof(v)); Size++; return Data + off; } inline bool contains(const value_type& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; } }; // Helper: IM_NEW(), IM_PLACEMENT_NEW(), IM_DELETE() macros to call MemAlloc + Placement New, Placement Delete + MemFree // We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax. // Defining a custom placement new() with a dummy parameter allows us to bypass including which on some platforms complains when user has disabled exceptions. struct ImNewDummy {}; inline void* operator new(size_t, ImNewDummy, void* ptr) { return ptr; } inline void operator delete(void*, ImNewDummy, void*) {} // This is only required so we can use the symetrical new() #define IM_PLACEMENT_NEW(_PTR) new(ImNewDummy(), _PTR) #define IM_NEW(_TYPE) new(ImNewDummy(), ImGui::MemAlloc(sizeof(_TYPE))) _TYPE template void IM_DELETE(T* p) { if (p) { p->~T(); ImGui::MemFree(p); } } // Helper: Execute a block of code at maximum once a frame. Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame. // Usage: static ImGuiOnceUponAFrame oaf; if (oaf) ImGui::Text("This will be called only once per frame"); struct ImGuiOnceUponAFrame { ImGuiOnceUponAFrame() { RefFrame = -1; } mutable int RefFrame; operator bool() const { int current_frame = ImGui::GetFrameCount(); if (RefFrame == current_frame) return false; RefFrame = current_frame; return true; } }; // Helper: Macro for ImGuiOnceUponAFrame. Attention: The macro expands into 2 statement so make sure you don't use it within e.g. an if() statement without curly braces. #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS // Will obsolete #define IMGUI_ONCE_UPON_A_FRAME static ImGuiOnceUponAFrame imgui_oaf; if (imgui_oaf) #endif // Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]" struct ImGuiTextFilter { struct TextRange { const char* b; const char* e; TextRange() { b = e = NULL; } TextRange(const char* _b, const char* _e) { b = _b; e = _e; } const char* begin() const { return b; } const char* end() const { return e; } bool empty() const { return b == e; } char front() const { return *b; } static bool is_blank(char c) { return c == ' ' || c == '\t'; } void trim_blanks() { while (b < e && is_blank(*b)) b++; while (e > b && is_blank(*(e-1))) e--; } IMGUI_API void split(char separator, ImVector& out); }; char InputBuf[256]; ImVector Filters; int CountGrep; IMGUI_API ImGuiTextFilter(const char* default_filter = ""); IMGUI_API bool Draw(const char* label = "Filter (inc,-exc)", float width = 0.0f); // Helper calling InputText+Build IMGUI_API bool PassFilter(const char* text, const char* text_end = NULL) const; IMGUI_API void Build(); void Clear() { InputBuf[0] = 0; Build(); } bool IsActive() const { return !Filters.empty(); } }; // Helper: Text buffer for logging/accumulating text struct ImGuiTextBuffer { ImVector Buf; ImGuiTextBuffer() { Buf.push_back(0); } inline char operator[](int i) { return Buf.Data[i]; } const char* begin() const { return &Buf.front(); } const char* end() const { return &Buf.back(); } // Buf is zero-terminated, so end() will point on the zero-terminator int size() const { return Buf.Size - 1; } bool empty() { return Buf.Size <= 1; } void clear() { Buf.clear(); Buf.push_back(0); } void reserve(int capacity) { Buf.reserve(capacity); } const char* c_str() const { return Buf.Data; } IMGUI_API void appendf(const char* fmt, ...) IM_FMTARGS(2); IMGUI_API void appendfv(const char* fmt, va_list args) IM_FMTLIST(2); }; // Helper: Simple Key->value storage // Typically you don't have to worry about this since a storage is held within each Window. // We use it to e.g. store collapse state for a tree (Int 0/1) // This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame) // You can use it as custom user storage for temporary values. Declare your own storage if, for example: // - You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state). // - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient) // Types are NOT stored, so it is up to you to make sure your Key don't collide with different types. struct ImGuiStorage { struct Pair { ImGuiID key; union { int val_i; float val_f; void* val_p; }; Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; } Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; } Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; } }; ImVector Data; // - Get***() functions find pair, never add/allocate. Pairs are sorted so a query is O(log N) // - Set***() functions find pair, insertion on demand if missing. // - Sorted insertion is costly, paid once. A typical frame shouldn't need to insert any new pair. void Clear() { Data.clear(); } IMGUI_API int GetInt(ImGuiID key, int default_val = 0) const; IMGUI_API void SetInt(ImGuiID key, int val); IMGUI_API bool GetBool(ImGuiID key, bool default_val = false) const; IMGUI_API void SetBool(ImGuiID key, bool val); IMGUI_API float GetFloat(ImGuiID key, float default_val = 0.0f) const; IMGUI_API void SetFloat(ImGuiID key, float val); IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL IMGUI_API void SetVoidPtr(ImGuiID key, void* val); // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set. // - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. // - A typical use case where this is convenient for quick hacking (e.g. add storage during a live Edit&Continue session if you can't modify existing struct) // float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar; IMGUI_API int* GetIntRef(ImGuiID key, int default_val = 0); IMGUI_API bool* GetBoolRef(ImGuiID key, bool default_val = false); IMGUI_API float* GetFloatRef(ImGuiID key, float default_val = 0.0f); IMGUI_API void** GetVoidPtrRef(ImGuiID key, void* default_val = NULL); // Use on your own storage if you know only integer are being stored (open/close all tree nodes) IMGUI_API void SetAllInt(int val); // For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once. IMGUI_API void BuildSortByKey(); }; // Shared state of InputText(), passed to callback when a ImGuiInputTextFlags_Callback* flag is used and the corresponding callback is triggered. struct ImGuiTextEditCallbackData { ImGuiInputTextFlags EventFlag; // One of ImGuiInputTextFlags_Callback* // Read-only ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only void* UserData; // What user passed to InputText() // Read-only bool ReadOnly; // Read-only mode // Read-only // CharFilter event: ImWchar EventChar; // Character input // Read-write (replace character or set to zero) // Completion,History,Always events: // If you modify the buffer contents make sure you update 'BufTextLen' and set 'BufDirty' to true. ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only char* Buf; // Current text buffer // Read-write (pointed data only, can't replace the actual pointer) int BufTextLen; // Current text length in bytes // Read-write int BufSize; // Maximum text length in bytes // Read-only bool BufDirty; // Set if you modify Buf/BufTextLen!! // Write int CursorPos; // // Read-write int SelectionStart; // // Read-write (== to SelectionEnd when no selection) int SelectionEnd; // // Read-write // NB: Helper functions for text manipulation. Calling those function loses selection. IMGUI_API void DeleteChars(int pos, int bytes_count); IMGUI_API void InsertChars(int pos, const char* text, const char* text_end = NULL); bool HasSelection() const { return SelectionStart != SelectionEnd; } }; // Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin(). // NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough. struct ImGuiSizeCallbackData { void* UserData; // Read-only. What user passed to SetNextWindowSizeConstraints() ImVec2 Pos; // Read-only. Window position, for reference. ImVec2 CurrentSize; // Read-only. Current window size. ImVec2 DesiredSize; // Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing. }; // Data payload for Drag and Drop operations struct ImGuiPayload { // Members const void* Data; // Data (copied and owned by dear imgui) int DataSize; // Data size // [Internal] ImGuiID SourceId; // Source item id ImGuiID SourceParentId; // Source parent id (if available) int DataFrameCount; // Data timestamp char DataType[32+1]; // Data type tag (short user-supplied string, 32 characters max) bool Preview; // Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets) bool Delivery; // Set when AcceptDragDropPayload() was called and mouse button is released over the target item. ImGuiPayload() { Clear(); } void Clear() { SourceId = SourceParentId = 0; Data = NULL; DataSize = 0; memset(DataType, 0, sizeof(DataType)); DataFrameCount = -1; Preview = Delivery = false; } bool IsDataType(const char* type) const { return DataFrameCount != -1 && strcmp(type, DataType) == 0; } bool IsPreview() const { return Preview; } bool IsDelivery() const { return Delivery; } }; // Helpers macros to generate 32-bits encoded colors #ifdef IMGUI_USE_BGRA_PACKED_COLOR #define IM_COL32_R_SHIFT 16 #define IM_COL32_G_SHIFT 8 #define IM_COL32_B_SHIFT 0 #define IM_COL32_A_SHIFT 24 #define IM_COL32_A_MASK 0xFF000000 #else #define IM_COL32_R_SHIFT 0 #define IM_COL32_G_SHIFT 8 #define IM_COL32_B_SHIFT 16 #define IM_COL32_A_SHIFT 24 #define IM_COL32_A_MASK 0xFF000000 #endif #define IM_COL32(R,G,B,A) (((ImU32)(A)<>IM_COL32_R_SHIFT)&0xFF) * sc; Value.y = (float)((rgba>>IM_COL32_G_SHIFT)&0xFF) * sc; Value.z = (float)((rgba>>IM_COL32_B_SHIFT)&0xFF) * sc; Value.w = (float)((rgba>>IM_COL32_A_SHIFT)&0xFF) * sc; } ImColor(float r, float g, float b, float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; } ImColor(const ImVec4& col) { Value = col; } inline operator ImU32() const { return ImGui::ColorConvertFloat4ToU32(Value); } inline operator ImVec4() const { return Value; } // FIXME-OBSOLETE: May need to obsolete/cleanup those helpers. inline void SetHSV(float h, float s, float v, float a = 1.0f){ ImGui::ColorConvertHSVtoRGB(h, s, v, Value.x, Value.y, Value.z); Value.w = a; } static ImColor HSV(float h, float s, float v, float a = 1.0f) { float r,g,b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r,g,b,a); } }; // Helper: Manually clip large list of items. // If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all. // The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped. // ImGui already clip items based on their bounds but it needs to measure text size to do so. Coarse clipping before submission makes this cost and your own data fetching/submission cost null. // Usage: // ImGuiListClipper clipper(1000); // we have 1000 elements, evenly spaced. // while (clipper.Step()) // for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) // ImGui::Text("line number %d", i); // - Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height (step skipped if we passed a known height as second arg to constructor). // - Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element. // - (Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user call Step(). Does nothing and switch to Step 3.) // - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop. struct ImGuiListClipper { float StartPosY; float ItemsHeight; int ItemsCount, StepNo, DisplayStart, DisplayEnd; // items_count: Use -1 to ignore (you can call Begin later). Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step). // items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing(). // If you don't specify an items_height, you NEED to call Step(). If you specify items_height you may call the old Begin()/End() api directly, but prefer calling Step(). ImGuiListClipper(int items_count = -1, float items_height = -1.0f) { Begin(items_count, items_height); } // NB: Begin() initialize every fields (as we allow user to call Begin/End multiple times on a same instance if they want). ~ImGuiListClipper() { IM_ASSERT(ItemsCount == -1); } // Assert if user forgot to call End() or Step() until false. IMGUI_API bool Step(); // Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items. IMGUI_API void Begin(int items_count, float items_height = -1.0f); // Automatically called by constructor if you passed 'items_count' or by Step() in Step 1. IMGUI_API void End(); // Automatically called on the last call of Step() that returns false. }; //----------------------------------------------------------------------------- // Draw List // Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList. //----------------------------------------------------------------------------- // Draw callbacks for advanced uses. // NB- You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering (you can poke into the draw list for that) // Draw callback may be useful for example, A) Change your GPU render state, B) render a complex 3D scene inside a UI element (without an intermediate texture/render target), etc. // The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) cmd.UserCallback(parent_list, cmd); else RenderTriangles()' typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd); // Typically, 1 command = 1 GPU draw call (unless command is a callback) struct ImDrawCmd { unsigned int ElemCount; // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[]. ImVec4 ClipRect; // Clipping rectangle (x1, y1, x2, y2) ImTextureID TextureId; // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas. ImDrawCallback UserCallback; // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally. void* UserCallbackData; // The draw callback code can access this. ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = ClipRect.z = ClipRect.w = 0.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; } }; // Vertex index (override with '#define ImDrawIdx unsigned int' inside in imconfig.h) #ifndef ImDrawIdx typedef unsigned short ImDrawIdx; #endif // Vertex layout #ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT struct ImDrawVert { ImVec2 pos; ImVec2 uv; ImU32 col; }; #else // You can override the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT in imconfig.h // The code expect ImVec2 pos (8 bytes), ImVec2 uv (8 bytes), ImU32 col (4 bytes), but you can re-order them or add other fields as needed to simplify integration in your engine. // The type has to be described within the macro (you can either declare the struct or use a typedef) // NOTE: IMGUI DOESN'T CLEAR THE STRUCTURE AND DOESN'T CALL A CONSTRUCTOR SO ANY CUSTOM FIELD WILL BE UNINITIALIZED. IF YOU ADD EXTRA FIELDS (SUCH AS A 'Z' COORDINATES) YOU WILL NEED TO CLEAR THEM DURING RENDER OR TO IGNORE THEM. IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT; #endif // Draw channels are used by the Columns API to "split" the render list into different channels while building, so items of each column can be batched together. // You can also use them to simulate drawing layers and submit primitives in a different order than how they will be rendered. struct ImDrawChannel { ImVector CmdBuffer; ImVector IdxBuffer; }; enum ImDrawCornerFlags_ { ImDrawCornerFlags_TopLeft = 1 << 0, // 0x1 ImDrawCornerFlags_TopRight = 1 << 1, // 0x2 ImDrawCornerFlags_BotLeft = 1 << 2, // 0x4 ImDrawCornerFlags_BotRight = 1 << 3, // 0x8 ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight, // 0x3 ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight, // 0xC ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft, // 0x5 ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight, // 0xA ImDrawCornerFlags_All = 0xF // In your function calls you may use ~0 (= all bits sets) instead of ImDrawCornerFlags_All, as a convenience }; enum ImDrawListFlags_ { ImDrawListFlags_AntiAliasedLines = 1 << 0, ImDrawListFlags_AntiAliasedFill = 1 << 1 }; // Draw command list // This is the low-level list of polygons that ImGui functions are filling. At the end of the frame, all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering. // Each ImGui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to access the current window draw list and draw custom primitives. // You can interleave normal ImGui:: calls and adding primitives to the current draw list. // All positions are generally in pixel coordinates (top-left at (0,0), bottom-right at io.DisplaySize), however you are totally free to apply whatever transformation matrix to want to the data (if you apply such transformation you'll want to apply it to ClipRect as well) // Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects. struct ImDrawList { // This is what you have to render ImVector CmdBuffer; // Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback. ImVector IdxBuffer; // Index buffer. Each command consume ImDrawCmd::ElemCount of those ImVector VtxBuffer; // Vertex buffer. ImDrawListFlags Flags; // Flags, you may poke into these to adjust anti-aliasing settings per-primitive. // [Internal, used while building lists] const ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context) const char* _OwnerName; // Pointer to owner window's name for debugging unsigned int _VtxCurrentIdx; // [Internal] == VtxBuffer.Size ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much) ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much) ImVector _ClipRectStack; // [Internal] ImVector _TextureIdStack; // [Internal] ImVector _Path; // [Internal] current path building int _ChannelsCurrent; // [Internal] current channel number (0) int _ChannelsCount; // [Internal] number of active channels (1+) ImVector _Channels; // [Internal] draw channels for columns API (not resized down so _ChannelsCount may be smaller than _Channels.Size) // If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui) ImDrawList(const ImDrawListSharedData* shared_data) { _Data = shared_data; _OwnerName = NULL; Clear(); } ~ImDrawList() { ClearFreeMemory(); } IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling) IMGUI_API void PushClipRectFullScreen(); IMGUI_API void PopClipRect(); IMGUI_API void PushTextureID(ImTextureID texture_id); IMGUI_API void PopTextureID(); inline ImVec2 GetClipRectMin() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.x, cr.y); } inline ImVec2 GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); } // Primitives IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f); IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners_flags = ImDrawCornerFlags_All, float thickness = 1.0f); // a: upper-left, b: lower-right, rounding_corners_flags: 4-bits corresponding to which corner to round IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners_flags = ImDrawCornerFlags_All); // a: upper-left, b: lower-right IMGUI_API void AddRectFilledMultiColor(const ImVec2& a, const ImVec2& b, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left); IMGUI_API void AddQuad(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col, float thickness = 1.0f); IMGUI_API void AddQuadFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col); IMGUI_API void AddTriangle(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col, float thickness = 1.0f); IMGUI_API void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col); IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12, float thickness = 1.0f); IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12); IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL); IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL); IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a = ImVec2(0,0), const ImVec2& uv_b = ImVec2(1,1), ImU32 col = 0xFFFFFFFF); IMGUI_API void AddImageQuad(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a = ImVec2(0,0), const ImVec2& uv_b = ImVec2(1,0), const ImVec2& uv_c = ImVec2(1,1), const ImVec2& uv_d = ImVec2(0,1), ImU32 col = 0xFFFFFFFF); IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col, float rounding, int rounding_corners = ImDrawCornerFlags_All); IMGUI_API void AddPolyline(const ImVec2* points, const int num_points, ImU32 col, bool closed, float thickness); IMGUI_API void AddConvexPolyFilled(const ImVec2* points, const int num_points, ImU32 col); IMGUI_API void AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments = 0); // Stateful path API, add points then finish with PathFill() or PathStroke() inline void PathClear() { _Path.resize(0); } inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); } inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path[_Path.Size-1], &pos, 8) != 0) _Path.push_back(pos); } inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); PathClear(); } inline void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness); PathClear(); } IMGUI_API void PathArcTo(const ImVec2& centre, float radius, float a_min, float a_max, int num_segments = 10); IMGUI_API void PathArcToFast(const ImVec2& centre, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle IMGUI_API void PathBezierCurveTo(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, int num_segments = 0); IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, int rounding_corners_flags = ImDrawCornerFlags_All); // Channels // - Use to simulate layers. By switching channels to can render out-of-order (e.g. submit foreground primitives before background primitives) // - Use to minimize draw calls (e.g. if going back-and-forth between multiple non-overlapping clipping rectangles, prefer to append into separate channels then merge at the end) IMGUI_API void ChannelsSplit(int channels_count); IMGUI_API void ChannelsMerge(); IMGUI_API void ChannelsSetCurrent(int channel_index); // Advanced IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible IMGUI_API ImDrawList* CloneOutput() const; // Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer. // Internal helpers // NB: all primitives needs to be reserved via PrimReserve() beforehand! IMGUI_API void Clear(); IMGUI_API void ClearFreeMemory(); IMGUI_API void PrimReserve(int idx_count, int vtx_count); IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); // Axis aligned rectangle (composed of two triangles) IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col); IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col); inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; } inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; } inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } IMGUI_API void UpdateClipRect(); IMGUI_API void UpdateTextureID(); }; // All draw data to render an ImGui frame // (NB: the style and the naming convention here is a little inconsistent but we preserve them for backward compatibility purpose) struct ImDrawData { bool Valid; // Only valid after Render() is called and before the next NewFrame() is called. ImDrawList** CmdLists; // Array of ImDrawList* to render. The ImDrawList are owned by ImGuiContext and only pointed to from here. int CmdListsCount; // Number of ImDrawList* to render int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size // Functions ImDrawData() { Valid = false; Clear(); } ~ImDrawData() { Clear(); } void Clear() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; } // The ImDrawList are owned by ImGuiContext! IMGUI_API void DeIndexAllBuffers(); // Helper to convert all buffers from indexed to non-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering! IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution. }; struct ImFontConfig { void* FontData; // // TTF/OTF data int FontDataSize; // // TTF/OTF data size bool FontDataOwnedByAtlas; // true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself). int FontNo; // 0 // Index of font within TTF/OTF file float SizePixels; // // Size in pixels for rasterizer. int OversampleH; // 3 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis. int OversampleV; // 1 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis. bool PixelSnapH; // false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1. ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now. ImVec2 GlyphOffset; // 0, 0 // Offset all glyphs from this font input. const ImWchar* GlyphRanges; // NULL // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights. unsigned int RasterizerFlags; // 0x00 // Settings for custom font rasterizer (e.g. ImGuiFreeType). Leave as zero if you aren't using one. float RasterizerMultiply; // 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable. // [Internal] char Name[40]; // Name (strictly to ease debugging) ImFont* DstFont; IMGUI_API ImFontConfig(); }; struct ImFontGlyph { ImWchar Codepoint; // 0x0000..0xFFFF float AdvanceX; // Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in) float X0, Y0, X1, Y1; // Glyph corners float U0, V0, U1, V1; // Texture coordinates }; enum ImFontAtlasFlags_ { ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 0, // Don't round the height to next power of two ImFontAtlasFlags_NoMouseCursors = 1 << 1 // Don't build software mouse cursors into the atlas }; // Load and rasterize multiple TTF/OTF fonts into a same texture. // Sharing a texture for multiple fonts allows us to reduce the number of draw calls during rendering. // We also add custom graphic data into the texture that serves for ImGui. // 1. (Optional) Call AddFont*** functions. If you don't call any, the default font will be loaded for you. // 2. Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data. // 3. Upload the pixels data into a texture within your graphics system. // 4. Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture. This value will be passed back to you during rendering to identify the texture. // IMPORTANT: If you pass a 'glyph_ranges' array to AddFont*** functions, you need to make sure that your array persist up until the ImFont is build (when calling GetTextData*** or Build()). We only copy the pointer, not the data. struct ImFontAtlas { IMGUI_API ImFontAtlas(); IMGUI_API ~ImFontAtlas(); IMGUI_API ImFont* AddFont(const ImFontConfig* font_cfg); IMGUI_API ImFont* AddFontDefault(const ImFontConfig* font_cfg = NULL); IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); IMGUI_API ImFont* AddFontFromMemoryTTF(void* font_data, int font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after Build(). Set font_cfg->FontDataOwnedByAtlas to false to keep ownership. IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp. IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_font_data_base85, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter. IMGUI_API void ClearInputData(); // Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts. IMGUI_API void ClearTexData(); // Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory. IMGUI_API void ClearFonts(); // Clear output font data (glyphs storage, UV coordinates). IMGUI_API void Clear(); // Clear all input and output. // Build atlas, retrieve pixel data. // User is in charge of copying the pixels into graphics memory (e.g. create a texture with your engine). Then store your texture handle with SetTexID(). // RGBA32 format is provided for convenience and compatibility, but note that unless you use CustomRect to draw color data, the RGB pixels emitted from Fonts will all be white (~75% of waste). // Pitch = Width * BytesPerPixels IMGUI_API bool Build(); // Build pixels data. This is called automatically for you by the GetTexData*** functions. IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel void SetTexID(ImTextureID id) { TexID = id; } //------------------------------------------- // Glyph Ranges //------------------------------------------- // Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list) // NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details. IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs IMGUI_API const ImWchar* GetGlyphRangesChinese(); // Default + Japanese + full set of about 21000 CJK Unified Ideographs IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters IMGUI_API const ImWchar* GetGlyphRangesThai(); // Default + Thai characters // Helpers to build glyph ranges from text data. Feed your application strings/characters to it then call BuildRanges(). struct GlyphRangesBuilder { ImVector UsedChars; // Store 1-bit per Unicode code point (0=unused, 1=used) GlyphRangesBuilder() { UsedChars.resize(0x10000 / 8); memset(UsedChars.Data, 0, 0x10000 / 8); } bool GetBit(int n) { return (UsedChars[n >> 3] & (1 << (n & 7))) != 0; } void SetBit(int n) { UsedChars[n >> 3] |= 1 << (n & 7); } // Set bit 'c' in the array void AddChar(ImWchar c) { SetBit(c); } // Add character IMGUI_API void AddText(const char* text, const char* text_end = NULL); // Add string (each character of the UTF-8 string are added) IMGUI_API void AddRanges(const ImWchar* ranges); // Add ranges, e.g. builder.AddRanges(ImFontAtlas::GetGlyphRangesDefault) to force add all of ASCII/Latin+Ext IMGUI_API void BuildRanges(ImVector* out_ranges); // Output new ranges }; //------------------------------------------- // Custom Rectangles/Glyphs API //------------------------------------------- // You can request arbitrary rectangles to be packed into the atlas, for your own purposes. After calling Build(), you can query the rectangle position and render your pixels. // You can also request your rectangles to be mapped as font glyph (given a font + Unicode point), so you can render e.g. custom colorful icons and use them as regular glyphs. struct CustomRect { unsigned int ID; // Input // User ID. Use <0x10000 to map into a font glyph, >=0x10000 for other/internal/custom texture data. unsigned short Width, Height; // Input // Desired rectangle dimension unsigned short X, Y; // Output // Packed position in Atlas float GlyphAdvanceX; // Input // For custom font glyphs only (ID<0x10000): glyph xadvance ImVec2 GlyphOffset; // Input // For custom font glyphs only (ID<0x10000): glyph display offset ImFont* Font; // Input // For custom font glyphs only (ID<0x10000): target font CustomRect() { ID = 0xFFFFFFFF; Width = Height = 0; X = Y = 0xFFFF; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0,0); Font = NULL; } bool IsPacked() const { return X != 0xFFFF; } }; IMGUI_API int AddCustomRectRegular(unsigned int id, int width, int height); // Id needs to be >= 0x10000. Id >= 0x80000000 are reserved for ImGui and ImDrawList IMGUI_API int AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset = ImVec2(0,0)); // Id needs to be < 0x10000 to register a rectangle to map into a specific font. const CustomRect* GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; } // [Internal] IMGUI_API void CalcCustomRectUV(const CustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max); IMGUI_API bool GetMouseCursorTexData(ImGuiMouseCursor cursor, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]); //------------------------------------------- // Members //------------------------------------------- ImFontAtlasFlags Flags; // Build flags (see ImFontAtlasFlags_) ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure. int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height. int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1. // [Internal] // NB: Access texture data via GetTexData*() calls! Which will setup a default font for you. unsigned char* TexPixelsAlpha8; // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight unsigned int* TexPixelsRGBA32; // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4 int TexWidth; // Texture width calculated during Build(). int TexHeight; // Texture height calculated during Build(). ImVec2 TexUvScale; // = (1.0f/TexWidth, 1.0f/TexHeight) ImVec2 TexUvWhitePixel; // Texture coordinates to a white pixel ImVector Fonts; // Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font. ImVector CustomRects; // Rectangles for packing custom texture data into the atlas. ImVector ConfigData; // Internal data int CustomRectIds[1]; // Identifiers of custom texture rectangle used by ImFontAtlas/ImDrawList }; // Font runtime data and rendering // ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32(). struct ImFont { // Members: Hot ~62/78 bytes float FontSize; // // Height of characters, set during loading (don't change after loading) float Scale; // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale() ImVec2 DisplayOffset; // = (0.f,0.f) // Offset font rendering by xx pixels ImVector Glyphs; // // All glyphs. ImVector IndexAdvanceX; // // Sparse. Glyphs->AdvanceX in a directly indexable way (more cache-friendly, for CalcTextSize functions which are often bottleneck in large UI). ImVector IndexLookup; // // Sparse. Index glyphs by Unicode code-point. const ImFontGlyph* FallbackGlyph; // == FindGlyph(FontFallbackChar) float FallbackAdvanceX; // == FallbackGlyph->AdvanceX ImWchar FallbackChar; // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar() // Members: Cold ~18/26 bytes short ConfigDataCount; // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont. ImFontConfig* ConfigData; // // Pointer within ContainerAtlas->ConfigData ImFontAtlas* ContainerAtlas; // // What we has been loaded into float Ascent, Descent; // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] bool DirtyLookupTables; int MetricsTotalSurface;// // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs) // Methods IMGUI_API ImFont(); IMGUI_API ~ImFont(); IMGUI_API void ClearOutputData(); IMGUI_API void BuildLookupTable(); IMGUI_API const ImFontGlyph*FindGlyph(ImWchar c) const; IMGUI_API const ImFontGlyph*FindGlyphNoFallback(ImWchar c) const; IMGUI_API void SetFallbackChar(ImWchar c); float GetCharAdvance(ImWchar c) const { return ((int)c < IndexAdvanceX.Size) ? IndexAdvanceX[(int)c] : FallbackAdvanceX; } bool IsLoaded() const { return ContainerAtlas != NULL; } const char* GetDebugName() const { return ConfigData ? ConfigData->Name : ""; } // 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. // 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL) const; // utf8 IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const; IMGUI_API void RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, unsigned short c) const; IMGUI_API void RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false) const; // [Internal] IMGUI_API void GrowIndex(int new_size); IMGUI_API void AddGlyph(ImWchar c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x); IMGUI_API void AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built. #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS typedef ImFontGlyph Glyph; // OBSOLETE 1.52+ #endif }; #if defined(__clang__) #pragma clang diagnostic pop #endif // Include imgui_user.h at the end of imgui.h (convenient for user to only explicitly include vanilla imgui.h) #ifdef IMGUI_INCLUDE_IMGUI_USER_H #include "imgui_user.h" #endif goxel-0.8.1/ext_src/imgui/imgui_draw.cpp000066400000000000000000004167321334742672700203060ustar00rootroot00000000000000// dear imgui, v1.61 WIP // (drawing and font code) // Contains implementation for // - Default styles // - ImDrawList // - ImDrawData // - ImFontAtlas // - ImFont // - Default font data #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #include "imgui.h" #define IMGUI_DEFINE_MATH_OPERATORS #include "imgui_internal.h" #include // vsnprintf, sscanf, printf #if !defined(alloca) #ifdef _WIN32 #include // alloca #if !defined(alloca) #define alloca _alloca // for clang with MS Codegen #endif #elif defined(__GLIBC__) || defined(__sun) #include // alloca #else #include // alloca #endif #endif #ifdef _MSC_VER #pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff) #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen #endif #ifdef __clang__ #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. #pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants ok. #pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it. #pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness // #if __has_warning("-Wcomma") #pragma clang diagnostic ignored "-Wcomma" // warning : possible misuse of comma operator here // #endif #if __has_warning("-Wreserved-id-macro") #pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier // #endif #if __has_warning("-Wdouble-promotion") #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function #endif #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value #endif //------------------------------------------------------------------------- // STB libraries implementation //------------------------------------------------------------------------- // Compile time options: //#define IMGUI_STB_NAMESPACE ImGuiStb //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION #ifdef IMGUI_STB_NAMESPACE namespace IMGUI_STB_NAMESPACE { #endif #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable: 4456) // declaration of 'xx' hides previous local declaration #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #pragma clang diagnostic ignored "-Wmissing-prototypes" #pragma clang diagnostic ignored "-Wimplicit-fallthrough" #pragma clang diagnostic ignored "-Wcast-qual" // warning : cast from 'const xxxx *' to 'xxx *' drops const qualifier // #endif #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtype-limits" // warning: comparison is always true due to limited range of data type [-Wtype-limits] #pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers #endif #ifndef IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION #define STBRP_STATIC #define STBRP_ASSERT(x) IM_ASSERT(x) #define STB_RECT_PACK_IMPLEMENTATION #endif #ifdef IMGUI_STB_RECT_PACK_FILENAME #include IMGUI_STB_RECT_PACK_FILENAME #else #include "stb_rect_pack.h" #endif #ifndef IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION #define STBTT_malloc(x,u) ((void)(u), ImGui::MemAlloc(x)) #define STBTT_free(x,u) ((void)(u), ImGui::MemFree(x)) #define STBTT_assert(x) IM_ASSERT(x) #define STBTT_STATIC #define STB_TRUETYPE_IMPLEMENTATION #else #define STBTT_DEF extern #endif #ifdef IMGUI_STB_TRUETYPE_FILENAME #include IMGUI_STB_TRUETYPE_FILENAME #else #include "stb_truetype.h" #endif #ifdef __GNUC__ #pragma GCC diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef _MSC_VER #pragma warning (pop) #endif #ifdef IMGUI_STB_NAMESPACE } // namespace ImGuiStb using namespace IMGUI_STB_NAMESPACE; #endif //----------------------------------------------------------------------------- // Style functions //----------------------------------------------------------------------------- void ImGui::StyleColorsDark(ImGuiStyle* dst) { ImGuiStyle* style = dst ? dst : &ImGui::GetStyle(); ImVec4* colors = style->Colors; colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.94f); colors[ImGuiCol_ChildBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.00f); colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f); colors[ImGuiCol_Border] = ImVec4(0.43f, 0.43f, 0.50f, 0.50f); colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_FrameBg] = ImVec4(0.16f, 0.29f, 0.48f, 0.54f); colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); colors[ImGuiCol_TitleBg] = ImVec4(0.04f, 0.04f, 0.04f, 1.00f); colors[ImGuiCol_TitleBgActive] = ImVec4(0.16f, 0.29f, 0.48f, 1.00f); colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f); colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f); colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f); colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f); colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f); colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f); colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_SliderGrab] = ImVec4(0.24f, 0.52f, 0.88f, 1.00f); colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f); colors[ImGuiCol_Header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f); colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f); colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_Separator] = colors[ImGuiCol_Border]; colors[ImGuiCol_SeparatorHovered] = ImVec4(0.10f, 0.40f, 0.75f, 0.78f); colors[ImGuiCol_SeparatorActive] = ImVec4(0.10f, 0.40f, 0.75f, 1.00f); colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.59f, 0.98f, 0.25f); colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f); colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f); colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); } void ImGui::StyleColorsClassic(ImGuiStyle* dst) { ImGuiStyle* style = dst ? dst : &ImGui::GetStyle(); ImVec4* colors = style->Colors; colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f); colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.70f); colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_PopupBg] = ImVec4(0.11f, 0.11f, 0.14f, 0.92f); colors[ImGuiCol_Border] = ImVec4(0.50f, 0.50f, 0.50f, 0.50f); colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_FrameBg] = ImVec4(0.43f, 0.43f, 0.43f, 0.39f); colors[ImGuiCol_FrameBgHovered] = ImVec4(0.47f, 0.47f, 0.69f, 0.40f); colors[ImGuiCol_FrameBgActive] = ImVec4(0.42f, 0.41f, 0.64f, 0.69f); colors[ImGuiCol_TitleBg] = ImVec4(0.27f, 0.27f, 0.54f, 0.83f); colors[ImGuiCol_TitleBgActive] = ImVec4(0.32f, 0.32f, 0.63f, 0.87f); colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.40f, 0.40f, 0.80f, 0.20f); colors[ImGuiCol_MenuBarBg] = ImVec4(0.40f, 0.40f, 0.55f, 0.80f); colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.60f); colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.80f, 0.30f); colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.80f, 0.40f); colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.41f, 0.39f, 0.80f, 0.60f); colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.50f); colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f); colors[ImGuiCol_SliderGrabActive] = ImVec4(0.41f, 0.39f, 0.80f, 0.60f); colors[ImGuiCol_Button] = ImVec4(0.35f, 0.40f, 0.61f, 0.62f); colors[ImGuiCol_ButtonHovered] = ImVec4(0.40f, 0.48f, 0.71f, 0.79f); colors[ImGuiCol_ButtonActive] = ImVec4(0.46f, 0.54f, 0.80f, 1.00f); colors[ImGuiCol_Header] = ImVec4(0.40f, 0.40f, 0.90f, 0.45f); colors[ImGuiCol_HeaderHovered] = ImVec4(0.45f, 0.45f, 0.90f, 0.80f); colors[ImGuiCol_HeaderActive] = ImVec4(0.53f, 0.53f, 0.87f, 0.80f); colors[ImGuiCol_Separator] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); colors[ImGuiCol_SeparatorHovered] = ImVec4(0.60f, 0.60f, 0.70f, 1.00f); colors[ImGuiCol_SeparatorActive] = ImVec4(0.70f, 0.70f, 0.90f, 1.00f); colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.16f); colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f); colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f); colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f); colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); } // Those light colors are better suited with a thicker font than the default one + FrameBorder void ImGui::StyleColorsLight(ImGuiStyle* dst) { ImGuiStyle* style = dst ? dst : &ImGui::GetStyle(); ImVec4* colors = style->Colors; colors[ImGuiCol_Text] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f); colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); //colors[ImGuiCol_TextHovered] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); //colors[ImGuiCol_TextActive] = ImVec4(1.00f, 1.00f, 0.00f, 1.00f); colors[ImGuiCol_WindowBg] = ImVec4(0.94f, 0.94f, 0.94f, 1.00f); colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_PopupBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.98f); colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.30f); colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); colors[ImGuiCol_FrameBg] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); colors[ImGuiCol_TitleBg] = ImVec4(0.96f, 0.96f, 0.96f, 1.00f); colors[ImGuiCol_TitleBgActive] = ImVec4(0.82f, 0.82f, 0.82f, 1.00f); colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 1.00f, 1.00f, 0.51f); colors[ImGuiCol_MenuBarBg] = ImVec4(0.86f, 0.86f, 0.86f, 1.00f); colors[ImGuiCol_ScrollbarBg] = ImVec4(0.98f, 0.98f, 0.98f, 0.53f); colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.69f, 0.69f, 0.69f, 0.80f); colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.49f, 0.49f, 0.49f, 0.80f); colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.49f, 0.49f, 0.49f, 1.00f); colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_SliderGrab] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f); colors[ImGuiCol_SliderGrabActive] = ImVec4(0.46f, 0.54f, 0.80f, 0.60f); colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f); colors[ImGuiCol_Header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f); colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f); colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); colors[ImGuiCol_Separator] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f); colors[ImGuiCol_SeparatorHovered] = ImVec4(0.14f, 0.44f, 0.80f, 0.78f); colors[ImGuiCol_SeparatorActive] = ImVec4(0.14f, 0.44f, 0.80f, 1.00f); colors[ImGuiCol_ResizeGrip] = ImVec4(0.80f, 0.80f, 0.80f, 0.56f); colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f); colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.45f, 0.00f, 1.00f); colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); colors[ImGuiCol_DragDropTarget] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.70f, 0.70f, 0.70f, 0.70f); } //----------------------------------------------------------------------------- // ImDrawListData //----------------------------------------------------------------------------- ImDrawListSharedData::ImDrawListSharedData() { Font = NULL; FontSize = 0.0f; CurveTessellationTol = 0.0f; ClipRectFullscreen = ImVec4(-8192.0f, -8192.0f, +8192.0f, +8192.0f); // Const data for (int i = 0; i < IM_ARRAYSIZE(CircleVtx12); i++) { const float a = ((float)i * 2 * IM_PI) / (float)IM_ARRAYSIZE(CircleVtx12); CircleVtx12[i] = ImVec2(cosf(a), sinf(a)); } } //----------------------------------------------------------------------------- // ImDrawList //----------------------------------------------------------------------------- void ImDrawList::Clear() { CmdBuffer.resize(0); IdxBuffer.resize(0); VtxBuffer.resize(0); Flags = ImDrawListFlags_AntiAliasedLines | ImDrawListFlags_AntiAliasedFill; _VtxCurrentIdx = 0; _VtxWritePtr = NULL; _IdxWritePtr = NULL; _ClipRectStack.resize(0); _TextureIdStack.resize(0); _Path.resize(0); _ChannelsCurrent = 0; _ChannelsCount = 1; // NB: Do not clear channels so our allocations are re-used after the first frame. } void ImDrawList::ClearFreeMemory() { CmdBuffer.clear(); IdxBuffer.clear(); VtxBuffer.clear(); _VtxCurrentIdx = 0; _VtxWritePtr = NULL; _IdxWritePtr = NULL; _ClipRectStack.clear(); _TextureIdStack.clear(); _Path.clear(); _ChannelsCurrent = 0; _ChannelsCount = 1; for (int i = 0; i < _Channels.Size; i++) { if (i == 0) memset(&_Channels[0], 0, sizeof(_Channels[0])); // channel 0 is a copy of CmdBuffer/IdxBuffer, don't destruct again _Channels[i].CmdBuffer.clear(); _Channels[i].IdxBuffer.clear(); } _Channels.clear(); } ImDrawList* ImDrawList::CloneOutput() const { ImDrawList* dst = IM_NEW(ImDrawList(NULL)); dst->CmdBuffer = CmdBuffer; dst->IdxBuffer = IdxBuffer; dst->VtxBuffer = VtxBuffer; dst->Flags = Flags; return dst; } // Using macros because C++ is a terrible language, we want guaranteed inline, no code in header, and no overhead in Debug builds #define GetCurrentClipRect() (_ClipRectStack.Size ? _ClipRectStack.Data[_ClipRectStack.Size-1] : _Data->ClipRectFullscreen) #define GetCurrentTextureId() (_TextureIdStack.Size ? _TextureIdStack.Data[_TextureIdStack.Size-1] : NULL) void ImDrawList::AddDrawCmd() { ImDrawCmd draw_cmd; draw_cmd.ClipRect = GetCurrentClipRect(); draw_cmd.TextureId = GetCurrentTextureId(); IM_ASSERT(draw_cmd.ClipRect.x <= draw_cmd.ClipRect.z && draw_cmd.ClipRect.y <= draw_cmd.ClipRect.w); CmdBuffer.push_back(draw_cmd); } void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data) { ImDrawCmd* current_cmd = CmdBuffer.Size ? &CmdBuffer.back() : NULL; if (!current_cmd || current_cmd->ElemCount != 0 || current_cmd->UserCallback != NULL) { AddDrawCmd(); current_cmd = &CmdBuffer.back(); } current_cmd->UserCallback = callback; current_cmd->UserCallbackData = callback_data; AddDrawCmd(); // Force a new command after us (see comment below) } // Our scheme may appears a bit unusual, basically we want the most-common calls AddLine AddRect etc. to not have to perform any check so we always have a command ready in the stack. // The cost of figuring out if a new command has to be added or if we can merge is paid in those Update** functions only. void ImDrawList::UpdateClipRect() { // If current command is used with different settings we need to add a new command const ImVec4 curr_clip_rect = GetCurrentClipRect(); ImDrawCmd* curr_cmd = CmdBuffer.Size > 0 ? &CmdBuffer.Data[CmdBuffer.Size-1] : NULL; if (!curr_cmd || (curr_cmd->ElemCount != 0 && memcmp(&curr_cmd->ClipRect, &curr_clip_rect, sizeof(ImVec4)) != 0) || curr_cmd->UserCallback != NULL) { AddDrawCmd(); return; } // Try to merge with previous command if it matches, else use current command ImDrawCmd* prev_cmd = CmdBuffer.Size > 1 ? curr_cmd - 1 : NULL; if (curr_cmd->ElemCount == 0 && prev_cmd && memcmp(&prev_cmd->ClipRect, &curr_clip_rect, sizeof(ImVec4)) == 0 && prev_cmd->TextureId == GetCurrentTextureId() && prev_cmd->UserCallback == NULL) CmdBuffer.pop_back(); else curr_cmd->ClipRect = curr_clip_rect; } void ImDrawList::UpdateTextureID() { // If current command is used with different settings we need to add a new command const ImTextureID curr_texture_id = GetCurrentTextureId(); ImDrawCmd* curr_cmd = CmdBuffer.Size ? &CmdBuffer.back() : NULL; if (!curr_cmd || (curr_cmd->ElemCount != 0 && curr_cmd->TextureId != curr_texture_id) || curr_cmd->UserCallback != NULL) { AddDrawCmd(); return; } // Try to merge with previous command if it matches, else use current command ImDrawCmd* prev_cmd = CmdBuffer.Size > 1 ? curr_cmd - 1 : NULL; if (curr_cmd->ElemCount == 0 && prev_cmd && prev_cmd->TextureId == curr_texture_id && memcmp(&prev_cmd->ClipRect, &GetCurrentClipRect(), sizeof(ImVec4)) == 0 && prev_cmd->UserCallback == NULL) CmdBuffer.pop_back(); else curr_cmd->TextureId = curr_texture_id; } #undef GetCurrentClipRect #undef GetCurrentTextureId // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling) void ImDrawList::PushClipRect(ImVec2 cr_min, ImVec2 cr_max, bool intersect_with_current_clip_rect) { ImVec4 cr(cr_min.x, cr_min.y, cr_max.x, cr_max.y); if (intersect_with_current_clip_rect && _ClipRectStack.Size) { ImVec4 current = _ClipRectStack.Data[_ClipRectStack.Size-1]; if (cr.x < current.x) cr.x = current.x; if (cr.y < current.y) cr.y = current.y; if (cr.z > current.z) cr.z = current.z; if (cr.w > current.w) cr.w = current.w; } cr.z = ImMax(cr.x, cr.z); cr.w = ImMax(cr.y, cr.w); _ClipRectStack.push_back(cr); UpdateClipRect(); } void ImDrawList::PushClipRectFullScreen() { PushClipRect(ImVec2(_Data->ClipRectFullscreen.x, _Data->ClipRectFullscreen.y), ImVec2(_Data->ClipRectFullscreen.z, _Data->ClipRectFullscreen.w)); } void ImDrawList::PopClipRect() { IM_ASSERT(_ClipRectStack.Size > 0); _ClipRectStack.pop_back(); UpdateClipRect(); } void ImDrawList::PushTextureID(ImTextureID texture_id) { _TextureIdStack.push_back(texture_id); UpdateTextureID(); } void ImDrawList::PopTextureID() { IM_ASSERT(_TextureIdStack.Size > 0); _TextureIdStack.pop_back(); UpdateTextureID(); } void ImDrawList::ChannelsSplit(int channels_count) { IM_ASSERT(_ChannelsCurrent == 0 && _ChannelsCount == 1); int old_channels_count = _Channels.Size; if (old_channels_count < channels_count) _Channels.resize(channels_count); _ChannelsCount = channels_count; // _Channels[] (24/32 bytes each) hold storage that we'll swap with this->_CmdBuffer/_IdxBuffer // The content of _Channels[0] at this point doesn't matter. We clear it to make state tidy in a debugger but we don't strictly need to. // When we switch to the next channel, we'll copy _CmdBuffer/_IdxBuffer into _Channels[0] and then _Channels[1] into _CmdBuffer/_IdxBuffer memset(&_Channels[0], 0, sizeof(ImDrawChannel)); for (int i = 1; i < channels_count; i++) { if (i >= old_channels_count) { IM_PLACEMENT_NEW(&_Channels[i]) ImDrawChannel(); } else { _Channels[i].CmdBuffer.resize(0); _Channels[i].IdxBuffer.resize(0); } if (_Channels[i].CmdBuffer.Size == 0) { ImDrawCmd draw_cmd; draw_cmd.ClipRect = _ClipRectStack.back(); draw_cmd.TextureId = _TextureIdStack.back(); _Channels[i].CmdBuffer.push_back(draw_cmd); } } } void ImDrawList::ChannelsMerge() { // Note that we never use or rely on channels.Size because it is merely a buffer that we never shrink back to 0 to keep all sub-buffers ready for use. if (_ChannelsCount <= 1) return; ChannelsSetCurrent(0); if (CmdBuffer.Size && CmdBuffer.back().ElemCount == 0) CmdBuffer.pop_back(); int new_cmd_buffer_count = 0, new_idx_buffer_count = 0; for (int i = 1; i < _ChannelsCount; i++) { ImDrawChannel& ch = _Channels[i]; if (ch.CmdBuffer.Size && ch.CmdBuffer.back().ElemCount == 0) ch.CmdBuffer.pop_back(); new_cmd_buffer_count += ch.CmdBuffer.Size; new_idx_buffer_count += ch.IdxBuffer.Size; } CmdBuffer.resize(CmdBuffer.Size + new_cmd_buffer_count); IdxBuffer.resize(IdxBuffer.Size + new_idx_buffer_count); ImDrawCmd* cmd_write = CmdBuffer.Data + CmdBuffer.Size - new_cmd_buffer_count; _IdxWritePtr = IdxBuffer.Data + IdxBuffer.Size - new_idx_buffer_count; for (int i = 1; i < _ChannelsCount; i++) { ImDrawChannel& ch = _Channels[i]; if (int sz = ch.CmdBuffer.Size) { memcpy(cmd_write, ch.CmdBuffer.Data, sz * sizeof(ImDrawCmd)); cmd_write += sz; } if (int sz = ch.IdxBuffer.Size) { memcpy(_IdxWritePtr, ch.IdxBuffer.Data, sz * sizeof(ImDrawIdx)); _IdxWritePtr += sz; } } UpdateClipRect(); // We call this instead of AddDrawCmd(), so that empty channels won't produce an extra draw call. _ChannelsCount = 1; } void ImDrawList::ChannelsSetCurrent(int idx) { IM_ASSERT(idx < _ChannelsCount); if (_ChannelsCurrent == idx) return; memcpy(&_Channels.Data[_ChannelsCurrent].CmdBuffer, &CmdBuffer, sizeof(CmdBuffer)); // copy 12 bytes, four times memcpy(&_Channels.Data[_ChannelsCurrent].IdxBuffer, &IdxBuffer, sizeof(IdxBuffer)); _ChannelsCurrent = idx; memcpy(&CmdBuffer, &_Channels.Data[_ChannelsCurrent].CmdBuffer, sizeof(CmdBuffer)); memcpy(&IdxBuffer, &_Channels.Data[_ChannelsCurrent].IdxBuffer, sizeof(IdxBuffer)); _IdxWritePtr = IdxBuffer.Data + IdxBuffer.Size; } // NB: this can be called with negative count for removing primitives (as long as the result does not underflow) void ImDrawList::PrimReserve(int idx_count, int vtx_count) { ImDrawCmd& draw_cmd = CmdBuffer.Data[CmdBuffer.Size-1]; draw_cmd.ElemCount += idx_count; int vtx_buffer_old_size = VtxBuffer.Size; VtxBuffer.resize(vtx_buffer_old_size + vtx_count); _VtxWritePtr = VtxBuffer.Data + vtx_buffer_old_size; int idx_buffer_old_size = IdxBuffer.Size; IdxBuffer.resize(idx_buffer_old_size + idx_count); _IdxWritePtr = IdxBuffer.Data + idx_buffer_old_size; } // Fully unrolled with inline call to keep our debug builds decently fast. void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col) { ImVec2 b(c.x, a.y), d(a.x, c.y), uv(_Data->TexUvWhitePixel); ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col; _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col; _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col; _VtxWritePtr += 4; _VtxCurrentIdx += 4; _IdxWritePtr += 6; } void ImDrawList::PrimRectUV(const ImVec2& a, const ImVec2& c, const ImVec2& uv_a, const ImVec2& uv_c, ImU32 col) { ImVec2 b(c.x, a.y), d(a.x, c.y), uv_b(uv_c.x, uv_a.y), uv_d(uv_a.x, uv_c.y); ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col; _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col; _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col; _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv_d; _VtxWritePtr[3].col = col; _VtxWritePtr += 4; _VtxCurrentIdx += 4; _IdxWritePtr += 6; } void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col) { ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; _IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); _IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col; _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col; _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col; _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv_d; _VtxWritePtr[3].col = col; _VtxWritePtr += 4; _VtxCurrentIdx += 4; _IdxWritePtr += 6; } // TODO: Thickness anti-aliased lines cap are missing their AA fringe. void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, bool closed, float thickness) { if (points_count < 2) return; const ImVec2 uv = _Data->TexUvWhitePixel; int count = points_count; if (!closed) count = points_count-1; const bool thick_line = thickness > 1.0f; if (Flags & ImDrawListFlags_AntiAliasedLines) { // Anti-aliased stroke const float AA_SIZE = 1.0f; const ImU32 col_trans = col & ~IM_COL32_A_MASK; const int idx_count = thick_line ? count*18 : count*12; const int vtx_count = thick_line ? points_count*4 : points_count*3; PrimReserve(idx_count, vtx_count); // Temporary buffer ImVec2* temp_normals = (ImVec2*)alloca(points_count * (thick_line ? 5 : 3) * sizeof(ImVec2)); ImVec2* temp_points = temp_normals + points_count; for (int i1 = 0; i1 < count; i1++) { const int i2 = (i1+1) == points_count ? 0 : i1+1; ImVec2 diff = points[i2] - points[i1]; diff *= ImInvLength(diff, 1.0f); temp_normals[i1].x = diff.y; temp_normals[i1].y = -diff.x; } if (!closed) temp_normals[points_count-1] = temp_normals[points_count-2]; if (!thick_line) { if (!closed) { temp_points[0] = points[0] + temp_normals[0] * AA_SIZE; temp_points[1] = points[0] - temp_normals[0] * AA_SIZE; temp_points[(points_count-1)*2+0] = points[points_count-1] + temp_normals[points_count-1] * AA_SIZE; temp_points[(points_count-1)*2+1] = points[points_count-1] - temp_normals[points_count-1] * AA_SIZE; } // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer. unsigned int idx1 = _VtxCurrentIdx; for (int i1 = 0; i1 < count; i1++) { const int i2 = (i1+1) == points_count ? 0 : i1+1; unsigned int idx2 = (i1+1) == points_count ? _VtxCurrentIdx : idx1+3; // Average normals ImVec2 dm = (temp_normals[i1] + temp_normals[i2]) * 0.5f; float dmr2 = dm.x*dm.x + dm.y*dm.y; if (dmr2 > 0.000001f) { float scale = 1.0f / dmr2; if (scale > 100.0f) scale = 100.0f; dm *= scale; } dm *= AA_SIZE; temp_points[i2*2+0] = points[i2] + dm; temp_points[i2*2+1] = points[i2] - dm; // Add indexes _IdxWritePtr[0] = (ImDrawIdx)(idx2+0); _IdxWritePtr[1] = (ImDrawIdx)(idx1+0); _IdxWritePtr[2] = (ImDrawIdx)(idx1+2); _IdxWritePtr[3] = (ImDrawIdx)(idx1+2); _IdxWritePtr[4] = (ImDrawIdx)(idx2+2); _IdxWritePtr[5] = (ImDrawIdx)(idx2+0); _IdxWritePtr[6] = (ImDrawIdx)(idx2+1); _IdxWritePtr[7] = (ImDrawIdx)(idx1+1); _IdxWritePtr[8] = (ImDrawIdx)(idx1+0); _IdxWritePtr[9] = (ImDrawIdx)(idx1+0); _IdxWritePtr[10]= (ImDrawIdx)(idx2+0); _IdxWritePtr[11]= (ImDrawIdx)(idx2+1); _IdxWritePtr += 12; idx1 = idx2; } // Add vertexes for (int i = 0; i < points_count; i++) { _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; _VtxWritePtr[1].pos = temp_points[i*2+0]; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans; _VtxWritePtr[2].pos = temp_points[i*2+1]; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col_trans; _VtxWritePtr += 3; } } else { const float half_inner_thickness = (thickness - AA_SIZE) * 0.5f; if (!closed) { temp_points[0] = points[0] + temp_normals[0] * (half_inner_thickness + AA_SIZE); temp_points[1] = points[0] + temp_normals[0] * (half_inner_thickness); temp_points[2] = points[0] - temp_normals[0] * (half_inner_thickness); temp_points[3] = points[0] - temp_normals[0] * (half_inner_thickness + AA_SIZE); temp_points[(points_count-1)*4+0] = points[points_count-1] + temp_normals[points_count-1] * (half_inner_thickness + AA_SIZE); temp_points[(points_count-1)*4+1] = points[points_count-1] + temp_normals[points_count-1] * (half_inner_thickness); temp_points[(points_count-1)*4+2] = points[points_count-1] - temp_normals[points_count-1] * (half_inner_thickness); temp_points[(points_count-1)*4+3] = points[points_count-1] - temp_normals[points_count-1] * (half_inner_thickness + AA_SIZE); } // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer. unsigned int idx1 = _VtxCurrentIdx; for (int i1 = 0; i1 < count; i1++) { const int i2 = (i1+1) == points_count ? 0 : i1+1; unsigned int idx2 = (i1+1) == points_count ? _VtxCurrentIdx : idx1+4; // Average normals ImVec2 dm = (temp_normals[i1] + temp_normals[i2]) * 0.5f; float dmr2 = dm.x*dm.x + dm.y*dm.y; if (dmr2 > 0.000001f) { float scale = 1.0f / dmr2; if (scale > 100.0f) scale = 100.0f; dm *= scale; } ImVec2 dm_out = dm * (half_inner_thickness + AA_SIZE); ImVec2 dm_in = dm * half_inner_thickness; temp_points[i2*4+0] = points[i2] + dm_out; temp_points[i2*4+1] = points[i2] + dm_in; temp_points[i2*4+2] = points[i2] - dm_in; temp_points[i2*4+3] = points[i2] - dm_out; // Add indexes _IdxWritePtr[0] = (ImDrawIdx)(idx2+1); _IdxWritePtr[1] = (ImDrawIdx)(idx1+1); _IdxWritePtr[2] = (ImDrawIdx)(idx1+2); _IdxWritePtr[3] = (ImDrawIdx)(idx1+2); _IdxWritePtr[4] = (ImDrawIdx)(idx2+2); _IdxWritePtr[5] = (ImDrawIdx)(idx2+1); _IdxWritePtr[6] = (ImDrawIdx)(idx2+1); _IdxWritePtr[7] = (ImDrawIdx)(idx1+1); _IdxWritePtr[8] = (ImDrawIdx)(idx1+0); _IdxWritePtr[9] = (ImDrawIdx)(idx1+0); _IdxWritePtr[10] = (ImDrawIdx)(idx2+0); _IdxWritePtr[11] = (ImDrawIdx)(idx2+1); _IdxWritePtr[12] = (ImDrawIdx)(idx2+2); _IdxWritePtr[13] = (ImDrawIdx)(idx1+2); _IdxWritePtr[14] = (ImDrawIdx)(idx1+3); _IdxWritePtr[15] = (ImDrawIdx)(idx1+3); _IdxWritePtr[16] = (ImDrawIdx)(idx2+3); _IdxWritePtr[17] = (ImDrawIdx)(idx2+2); _IdxWritePtr += 18; idx1 = idx2; } // Add vertexes for (int i = 0; i < points_count; i++) { _VtxWritePtr[0].pos = temp_points[i*4+0]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col_trans; _VtxWritePtr[1].pos = temp_points[i*4+1]; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col; _VtxWritePtr[2].pos = temp_points[i*4+2]; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col; _VtxWritePtr[3].pos = temp_points[i*4+3]; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col_trans; _VtxWritePtr += 4; } } _VtxCurrentIdx += (ImDrawIdx)vtx_count; } else { // Non Anti-aliased Stroke const int idx_count = count*6; const int vtx_count = count*4; // FIXME-OPT: Not sharing edges PrimReserve(idx_count, vtx_count); for (int i1 = 0; i1 < count; i1++) { const int i2 = (i1+1) == points_count ? 0 : i1+1; const ImVec2& p1 = points[i1]; const ImVec2& p2 = points[i2]; ImVec2 diff = p2 - p1; diff *= ImInvLength(diff, 1.0f); const float dx = diff.x * (thickness * 0.5f); const float dy = diff.y * (thickness * 0.5f); _VtxWritePtr[0].pos.x = p1.x + dy; _VtxWritePtr[0].pos.y = p1.y - dx; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; _VtxWritePtr[1].pos.x = p2.x + dy; _VtxWritePtr[1].pos.y = p2.y - dx; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col; _VtxWritePtr[2].pos.x = p2.x - dy; _VtxWritePtr[2].pos.y = p2.y + dx; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col; _VtxWritePtr[3].pos.x = p1.x - dy; _VtxWritePtr[3].pos.y = p1.y + dx; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col; _VtxWritePtr += 4; _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3); _IdxWritePtr += 6; _VtxCurrentIdx += 4; } } } void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col) { const ImVec2 uv = _Data->TexUvWhitePixel; if (Flags & ImDrawListFlags_AntiAliasedFill) { // Anti-aliased Fill const float AA_SIZE = 1.0f; const ImU32 col_trans = col & ~IM_COL32_A_MASK; const int idx_count = (points_count-2)*3 + points_count*6; const int vtx_count = (points_count*2); PrimReserve(idx_count, vtx_count); // Add indexes for fill unsigned int vtx_inner_idx = _VtxCurrentIdx; unsigned int vtx_outer_idx = _VtxCurrentIdx+1; for (int i = 2; i < points_count; i++) { _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx+((i-1)<<1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_inner_idx+(i<<1)); _IdxWritePtr += 3; } // Compute normals ImVec2* temp_normals = (ImVec2*)alloca(points_count * sizeof(ImVec2)); for (int i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) { const ImVec2& p0 = points[i0]; const ImVec2& p1 = points[i1]; ImVec2 diff = p1 - p0; diff *= ImInvLength(diff, 1.0f); temp_normals[i0].x = diff.y; temp_normals[i0].y = -diff.x; } for (int i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) { // Average normals const ImVec2& n0 = temp_normals[i0]; const ImVec2& n1 = temp_normals[i1]; ImVec2 dm = (n0 + n1) * 0.5f; float dmr2 = dm.x*dm.x + dm.y*dm.y; if (dmr2 > 0.000001f) { float scale = 1.0f / dmr2; if (scale > 100.0f) scale = 100.0f; dm *= scale; } dm *= AA_SIZE * 0.5f; // Add vertices _VtxWritePtr[0].pos = (points[i1] - dm); _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; // Inner _VtxWritePtr[1].pos = (points[i1] + dm); _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans; // Outer _VtxWritePtr += 2; // Add indexes for fringes _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx+(i1<<1)); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx+(i0<<1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_outer_idx+(i0<<1)); _IdxWritePtr[3] = (ImDrawIdx)(vtx_outer_idx+(i0<<1)); _IdxWritePtr[4] = (ImDrawIdx)(vtx_outer_idx+(i1<<1)); _IdxWritePtr[5] = (ImDrawIdx)(vtx_inner_idx+(i1<<1)); _IdxWritePtr += 6; } _VtxCurrentIdx += (ImDrawIdx)vtx_count; } else { // Non Anti-aliased Fill const int idx_count = (points_count-2)*3; const int vtx_count = points_count; PrimReserve(idx_count, vtx_count); for (int i = 0; i < vtx_count; i++) { _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; _VtxWritePtr++; } for (int i = 2; i < points_count; i++) { _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+i-1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+i); _IdxWritePtr += 3; } _VtxCurrentIdx += (ImDrawIdx)vtx_count; } } void ImDrawList::PathArcToFast(const ImVec2& centre, float radius, int a_min_of_12, int a_max_of_12) { if (radius == 0.0f || a_min_of_12 > a_max_of_12) { _Path.push_back(centre); return; } _Path.reserve(_Path.Size + (a_max_of_12 - a_min_of_12 + 1)); for (int a = a_min_of_12; a <= a_max_of_12; a++) { const ImVec2& c = _Data->CircleVtx12[a % IM_ARRAYSIZE(_Data->CircleVtx12)]; _Path.push_back(ImVec2(centre.x + c.x * radius, centre.y + c.y * radius)); } } void ImDrawList::PathArcTo(const ImVec2& centre, float radius, float a_min, float a_max, int num_segments) { if (radius == 0.0f) { _Path.push_back(centre); return; } _Path.reserve(_Path.Size + (num_segments + 1)); for (int i = 0; i <= num_segments; i++) { const float a = a_min + ((float)i / (float)num_segments) * (a_max - a_min); _Path.push_back(ImVec2(centre.x + cosf(a) * radius, centre.y + sinf(a) * radius)); } } static void PathBezierToCasteljau(ImVector* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level) { float dx = x4 - x1; float dy = y4 - y1; float d2 = ((x2 - x4) * dy - (y2 - y4) * dx); float d3 = ((x3 - x4) * dy - (y3 - y4) * dx); d2 = (d2 >= 0) ? d2 : -d2; d3 = (d3 >= 0) ? d3 : -d3; if ((d2+d3) * (d2+d3) < tess_tol * (dx*dx + dy*dy)) { path->push_back(ImVec2(x4, y4)); } else if (level < 10) { float x12 = (x1+x2)*0.5f, y12 = (y1+y2)*0.5f; float x23 = (x2+x3)*0.5f, y23 = (y2+y3)*0.5f; float x34 = (x3+x4)*0.5f, y34 = (y3+y4)*0.5f; float x123 = (x12+x23)*0.5f, y123 = (y12+y23)*0.5f; float x234 = (x23+x34)*0.5f, y234 = (y23+y34)*0.5f; float x1234 = (x123+x234)*0.5f, y1234 = (y123+y234)*0.5f; PathBezierToCasteljau(path, x1,y1, x12,y12, x123,y123, x1234,y1234, tess_tol, level+1); PathBezierToCasteljau(path, x1234,y1234, x234,y234, x34,y34, x4,y4, tess_tol, level+1); } } void ImDrawList::PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments) { ImVec2 p1 = _Path.back(); if (num_segments == 0) { // Auto-tessellated PathBezierToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); } else { float t_step = 1.0f / (float)num_segments; for (int i_step = 1; i_step <= num_segments; i_step++) { float t = t_step * i_step; float u = 1.0f - t; float w1 = u*u*u; float w2 = 3*u*u*t; float w3 = 3*u*t*t; float w4 = t*t*t; _Path.push_back(ImVec2(w1*p1.x + w2*p2.x + w3*p3.x + w4*p4.x, w1*p1.y + w2*p2.y + w3*p3.y + w4*p4.y)); } } } void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, int rounding_corners) { rounding = ImMin(rounding, fabsf(b.x - a.x) * ( ((rounding_corners & ImDrawCornerFlags_Top) == ImDrawCornerFlags_Top) || ((rounding_corners & ImDrawCornerFlags_Bot) == ImDrawCornerFlags_Bot) ? 0.5f : 1.0f ) - 1.0f); rounding = ImMin(rounding, fabsf(b.y - a.y) * ( ((rounding_corners & ImDrawCornerFlags_Left) == ImDrawCornerFlags_Left) || ((rounding_corners & ImDrawCornerFlags_Right) == ImDrawCornerFlags_Right) ? 0.5f : 1.0f ) - 1.0f); if (rounding <= 0.0f || rounding_corners == 0) { PathLineTo(a); PathLineTo(ImVec2(b.x, a.y)); PathLineTo(b); PathLineTo(ImVec2(a.x, b.y)); } else { const float rounding_tl = (rounding_corners & ImDrawCornerFlags_TopLeft) ? rounding : 0.0f; const float rounding_tr = (rounding_corners & ImDrawCornerFlags_TopRight) ? rounding : 0.0f; const float rounding_br = (rounding_corners & ImDrawCornerFlags_BotRight) ? rounding : 0.0f; const float rounding_bl = (rounding_corners & ImDrawCornerFlags_BotLeft) ? rounding : 0.0f; PathArcToFast(ImVec2(a.x + rounding_tl, a.y + rounding_tl), rounding_tl, 6, 9); PathArcToFast(ImVec2(b.x - rounding_tr, a.y + rounding_tr), rounding_tr, 9, 12); PathArcToFast(ImVec2(b.x - rounding_br, b.y - rounding_br), rounding_br, 0, 3); PathArcToFast(ImVec2(a.x + rounding_bl, b.y - rounding_bl), rounding_bl, 3, 6); } } void ImDrawList::AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness) { if ((col & IM_COL32_A_MASK) == 0) return; PathLineTo(a + ImVec2(0.5f,0.5f)); PathLineTo(b + ImVec2(0.5f,0.5f)); PathStroke(col, false, thickness); } // a: upper-left, b: lower-right. we don't render 1 px sized rectangles properly. void ImDrawList::AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners_flags, float thickness) { if ((col & IM_COL32_A_MASK) == 0) return; if (Flags & ImDrawListFlags_AntiAliasedLines) PathRect(a + ImVec2(0.5f,0.5f), b - ImVec2(0.50f,0.50f), rounding, rounding_corners_flags); else PathRect(a + ImVec2(0.5f,0.5f), b - ImVec2(0.49f,0.49f), rounding, rounding_corners_flags); // Better looking lower-right corner and rounded non-AA shapes. PathStroke(col, true, thickness); } void ImDrawList::AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners_flags) { if ((col & IM_COL32_A_MASK) == 0) return; if (rounding > 0.0f) { PathRect(a, b, rounding, rounding_corners_flags); PathFillConvex(col); } else { PrimReserve(6, 4); PrimRect(a, b, col); } } void ImDrawList::AddRectFilledMultiColor(const ImVec2& a, const ImVec2& c, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left) { if (((col_upr_left | col_upr_right | col_bot_right | col_bot_left) & IM_COL32_A_MASK) == 0) return; const ImVec2 uv = _Data->TexUvWhitePixel; PrimReserve(6, 4); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+1)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+2)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+2)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+3)); PrimWriteVtx(a, uv, col_upr_left); PrimWriteVtx(ImVec2(c.x, a.y), uv, col_upr_right); PrimWriteVtx(c, uv, col_bot_right); PrimWriteVtx(ImVec2(a.x, c.y), uv, col_bot_left); } void ImDrawList::AddQuad(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col, float thickness) { if ((col & IM_COL32_A_MASK) == 0) return; PathLineTo(a); PathLineTo(b); PathLineTo(c); PathLineTo(d); PathStroke(col, true, thickness); } void ImDrawList::AddQuadFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col) { if ((col & IM_COL32_A_MASK) == 0) return; PathLineTo(a); PathLineTo(b); PathLineTo(c); PathLineTo(d); PathFillConvex(col); } void ImDrawList::AddTriangle(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col, float thickness) { if ((col & IM_COL32_A_MASK) == 0) return; PathLineTo(a); PathLineTo(b); PathLineTo(c); PathStroke(col, true, thickness); } void ImDrawList::AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col) { if ((col & IM_COL32_A_MASK) == 0) return; PathLineTo(a); PathLineTo(b); PathLineTo(c); PathFillConvex(col); } void ImDrawList::AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments, float thickness) { if ((col & IM_COL32_A_MASK) == 0) return; const float a_max = IM_PI*2.0f * ((float)num_segments - 1.0f) / (float)num_segments; PathArcTo(centre, radius-0.5f, 0.0f, a_max, num_segments); PathStroke(col, true, thickness); } void ImDrawList::AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments) { if ((col & IM_COL32_A_MASK) == 0) return; const float a_max = IM_PI*2.0f * ((float)num_segments - 1.0f) / (float)num_segments; PathArcTo(centre, radius, 0.0f, a_max, num_segments); PathFillConvex(col); } void ImDrawList::AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments) { if ((col & IM_COL32_A_MASK) == 0) return; PathLineTo(pos0); PathBezierCurveTo(cp0, cp1, pos1, num_segments); PathStroke(col, false, thickness); } void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect) { if ((col & IM_COL32_A_MASK) == 0) return; if (text_end == NULL) text_end = text_begin + strlen(text_begin); if (text_begin == text_end) return; // Pull default font/size from the shared ImDrawListSharedData instance if (font == NULL) font = _Data->Font; if (font_size == 0.0f) font_size = _Data->FontSize; IM_ASSERT(font->ContainerAtlas->TexID == _TextureIdStack.back()); // Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font. ImVec4 clip_rect = _ClipRectStack.back(); if (cpu_fine_clip_rect) { clip_rect.x = ImMax(clip_rect.x, cpu_fine_clip_rect->x); clip_rect.y = ImMax(clip_rect.y, cpu_fine_clip_rect->y); clip_rect.z = ImMin(clip_rect.z, cpu_fine_clip_rect->z); clip_rect.w = ImMin(clip_rect.w, cpu_fine_clip_rect->w); } font->RenderText(this, font_size, pos, col, clip_rect, text_begin, text_end, wrap_width, cpu_fine_clip_rect != NULL); } void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end) { AddText(NULL, 0.0f, pos, col, text_begin, text_end); } void ImDrawList::AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col) { if ((col & IM_COL32_A_MASK) == 0) return; const bool push_texture_id = _TextureIdStack.empty() || user_texture_id != _TextureIdStack.back(); if (push_texture_id) PushTextureID(user_texture_id); PrimReserve(6, 4); PrimRectUV(a, b, uv_a, uv_b, col); if (push_texture_id) PopTextureID(); } void ImDrawList::AddImageQuad(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col) { if ((col & IM_COL32_A_MASK) == 0) return; const bool push_texture_id = _TextureIdStack.empty() || user_texture_id != _TextureIdStack.back(); if (push_texture_id) PushTextureID(user_texture_id); PrimReserve(6, 4); PrimQuadUV(a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); if (push_texture_id) PopTextureID(); } void ImDrawList::AddImageRounded(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col, float rounding, int rounding_corners) { if ((col & IM_COL32_A_MASK) == 0) return; if (rounding <= 0.0f || (rounding_corners & ImDrawCornerFlags_All) == 0) { AddImage(user_texture_id, a, b, uv_a, uv_b, col); return; } const bool push_texture_id = _TextureIdStack.empty() || user_texture_id != _TextureIdStack.back(); if (push_texture_id) PushTextureID(user_texture_id); int vert_start_idx = VtxBuffer.Size; PathRect(a, b, rounding, rounding_corners); PathFillConvex(col); int vert_end_idx = VtxBuffer.Size; ImGui::ShadeVertsLinearUV(VtxBuffer.Data + vert_start_idx, VtxBuffer.Data + vert_end_idx, a, b, uv_a, uv_b, true); if (push_texture_id) PopTextureID(); } //----------------------------------------------------------------------------- // ImDrawData //----------------------------------------------------------------------------- // For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering! void ImDrawData::DeIndexAllBuffers() { ImVector new_vtx_buffer; TotalVtxCount = TotalIdxCount = 0; for (int i = 0; i < CmdListsCount; i++) { ImDrawList* cmd_list = CmdLists[i]; if (cmd_list->IdxBuffer.empty()) continue; new_vtx_buffer.resize(cmd_list->IdxBuffer.Size); for (int j = 0; j < cmd_list->IdxBuffer.Size; j++) new_vtx_buffer[j] = cmd_list->VtxBuffer[cmd_list->IdxBuffer[j]]; cmd_list->VtxBuffer.swap(new_vtx_buffer); cmd_list->IdxBuffer.resize(0); TotalVtxCount += cmd_list->VtxBuffer.Size; } } // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution. void ImDrawData::ScaleClipRects(const ImVec2& scale) { for (int i = 0; i < CmdListsCount; i++) { ImDrawList* cmd_list = CmdLists[i]; for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) { ImDrawCmd* cmd = &cmd_list->CmdBuffer[cmd_i]; cmd->ClipRect = ImVec4(cmd->ClipRect.x * scale.x, cmd->ClipRect.y * scale.y, cmd->ClipRect.z * scale.x, cmd->ClipRect.w * scale.y); } } } //----------------------------------------------------------------------------- // Shade functions //----------------------------------------------------------------------------- // Generic linear color gradient, write to RGB fields, leave A untouched. void ImGui::ShadeVertsLinearColorGradientKeepAlpha(ImDrawVert* vert_start, ImDrawVert* vert_end, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1) { ImVec2 gradient_extent = gradient_p1 - gradient_p0; float gradient_inv_length2 = 1.0f / ImLengthSqr(gradient_extent); for (ImDrawVert* vert = vert_start; vert < vert_end; vert++) { float d = ImDot(vert->pos - gradient_p0, gradient_extent); float t = ImClamp(d * gradient_inv_length2, 0.0f, 1.0f); int r = ImLerp((int)(col0 >> IM_COL32_R_SHIFT) & 0xFF, (int)(col1 >> IM_COL32_R_SHIFT) & 0xFF, t); int g = ImLerp((int)(col0 >> IM_COL32_G_SHIFT) & 0xFF, (int)(col1 >> IM_COL32_G_SHIFT) & 0xFF, t); int b = ImLerp((int)(col0 >> IM_COL32_B_SHIFT) & 0xFF, (int)(col1 >> IM_COL32_B_SHIFT) & 0xFF, t); vert->col = (r << IM_COL32_R_SHIFT) | (g << IM_COL32_G_SHIFT) | (b << IM_COL32_B_SHIFT) | (vert->col & IM_COL32_A_MASK); } } // Scan and shade backward from the end of given vertices. Assume vertices are text only (= vert_start..vert_end going left to right) so we can break as soon as we are out the gradient bounds. void ImGui::ShadeVertsLinearAlphaGradientForLeftToRightText(ImDrawVert* vert_start, ImDrawVert* vert_end, float gradient_p0_x, float gradient_p1_x) { float gradient_extent_x = gradient_p1_x - gradient_p0_x; float gradient_inv_length2 = 1.0f / (gradient_extent_x * gradient_extent_x); int full_alpha_count = 0; for (ImDrawVert* vert = vert_end - 1; vert >= vert_start; vert--) { float d = (vert->pos.x - gradient_p0_x) * (gradient_extent_x); float alpha_mul = 1.0f - ImClamp(d * gradient_inv_length2, 0.0f, 1.0f); if (alpha_mul >= 1.0f && ++full_alpha_count > 2) return; // Early out int a = (int)(((vert->col >> IM_COL32_A_SHIFT) & 0xFF) * alpha_mul); vert->col = (vert->col & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT); } } // Distribute UV over (a, b) rectangle void ImGui::ShadeVertsLinearUV(ImDrawVert* vert_start, ImDrawVert* vert_end, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp) { const ImVec2 size = b - a; const ImVec2 uv_size = uv_b - uv_a; const ImVec2 scale = ImVec2( size.x != 0.0f ? (uv_size.x / size.x) : 0.0f, size.y != 0.0f ? (uv_size.y / size.y) : 0.0f); if (clamp) { const ImVec2 min = ImMin(uv_a, uv_b); const ImVec2 max = ImMax(uv_a, uv_b); for (ImDrawVert* vertex = vert_start; vertex < vert_end; ++vertex) vertex->uv = ImClamp(uv_a + ImMul(ImVec2(vertex->pos.x, vertex->pos.y) - a, scale), min, max); } else { for (ImDrawVert* vertex = vert_start; vertex < vert_end; ++vertex) vertex->uv = uv_a + ImMul(ImVec2(vertex->pos.x, vertex->pos.y) - a, scale); } } //----------------------------------------------------------------------------- // ImFontConfig //----------------------------------------------------------------------------- ImFontConfig::ImFontConfig() { FontData = NULL; FontDataSize = 0; FontDataOwnedByAtlas = true; FontNo = 0; SizePixels = 0.0f; OversampleH = 3; OversampleV = 1; PixelSnapH = false; GlyphExtraSpacing = ImVec2(0.0f, 0.0f); GlyphOffset = ImVec2(0.0f, 0.0f); GlyphRanges = NULL; MergeMode = false; RasterizerFlags = 0x00; RasterizerMultiply = 1.0f; memset(Name, 0, sizeof(Name)); DstFont = NULL; } //----------------------------------------------------------------------------- // ImFontAtlas //----------------------------------------------------------------------------- // A work of art lies ahead! (. = white layer, X = black layer, others are blank) // The white texels on the top left are the ones we'll use everywhere in ImGui to render filled shapes. const int FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF = 90; const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27; const unsigned int FONT_ATLAS_DEFAULT_TEX_DATA_ID = 0x80000000; static const char FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF * FONT_ATLAS_DEFAULT_TEX_DATA_H + 1] = { "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX" "..- -X.....X- X.X - X.X -X.....X - X.....X" "--- -XXX.XXX- X...X - X...X -X....X - X....X" "X - X.X - X.....X - X.....X -X...X - X...X" "XX - X.X -X.......X- X.......X -X..X.X - X.X..X" "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X" "X..X - X.X - X.X - X.X -XX X.X - X.X XX" "X...X - X.X - X.X - XX X.X XX - X.X - X.X " "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X " "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X " "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X " "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X " "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X " "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X " "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X " "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X " "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX " "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------" "X.X X..X - -X.......X- X.......X - XX XX - " "XX X..X - - X.....X - X.....X - X.X X.X - " " X..X - X...X - X...X - X..X X..X - " " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - " "------------ - X - X -X.....................X- " " ----------------------------------- X...XXXXXXXXXXXXX...X - " " - X..X X..X - " " - X.X X.X - " " - XX XX - " }; static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3] = { // Pos ........ Size ......... Offset ...... { ImVec2(0,3), ImVec2(12,19), ImVec2( 0, 0) }, // ImGuiMouseCursor_Arrow { ImVec2(13,0), ImVec2(7,16), ImVec2( 4, 8) }, // ImGuiMouseCursor_TextInput { ImVec2(31,0), ImVec2(23,23), ImVec2(11,11) }, // ImGuiMouseCursor_ResizeAll { ImVec2(21,0), ImVec2( 9,23), ImVec2( 5,11) }, // ImGuiMouseCursor_ResizeNS { ImVec2(55,18),ImVec2(23, 9), ImVec2(11, 5) }, // ImGuiMouseCursor_ResizeEW { ImVec2(73,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNESW { ImVec2(55,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNWSE }; ImFontAtlas::ImFontAtlas() { Flags = 0x00; TexID = NULL; TexDesiredWidth = 0; TexGlyphPadding = 1; TexPixelsAlpha8 = NULL; TexPixelsRGBA32 = NULL; TexWidth = TexHeight = 0; TexUvScale = ImVec2(0.0f, 0.0f); TexUvWhitePixel = ImVec2(0.0f, 0.0f); for (int n = 0; n < IM_ARRAYSIZE(CustomRectIds); n++) CustomRectIds[n] = -1; } ImFontAtlas::~ImFontAtlas() { Clear(); } void ImFontAtlas::ClearInputData() { for (int i = 0; i < ConfigData.Size; i++) if (ConfigData[i].FontData && ConfigData[i].FontDataOwnedByAtlas) { ImGui::MemFree(ConfigData[i].FontData); ConfigData[i].FontData = NULL; } // When clearing this we lose access to the font name and other information used to build the font. for (int i = 0; i < Fonts.Size; i++) if (Fonts[i]->ConfigData >= ConfigData.Data && Fonts[i]->ConfigData < ConfigData.Data + ConfigData.Size) { Fonts[i]->ConfigData = NULL; Fonts[i]->ConfigDataCount = 0; } ConfigData.clear(); CustomRects.clear(); for (int n = 0; n < IM_ARRAYSIZE(CustomRectIds); n++) CustomRectIds[n] = -1; } void ImFontAtlas::ClearTexData() { if (TexPixelsAlpha8) ImGui::MemFree(TexPixelsAlpha8); if (TexPixelsRGBA32) ImGui::MemFree(TexPixelsRGBA32); TexPixelsAlpha8 = NULL; TexPixelsRGBA32 = NULL; } void ImFontAtlas::ClearFonts() { for (int i = 0; i < Fonts.Size; i++) IM_DELETE(Fonts[i]); Fonts.clear(); } void ImFontAtlas::Clear() { ClearInputData(); ClearTexData(); ClearFonts(); } void ImFontAtlas::GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel) { // Build atlas on demand if (TexPixelsAlpha8 == NULL) { if (ConfigData.empty()) AddFontDefault(); Build(); } *out_pixels = TexPixelsAlpha8; if (out_width) *out_width = TexWidth; if (out_height) *out_height = TexHeight; if (out_bytes_per_pixel) *out_bytes_per_pixel = 1; } void ImFontAtlas::GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel) { // Convert to RGBA32 format on demand // Although it is likely to be the most commonly used format, our font rendering is 1 channel / 8 bpp if (!TexPixelsRGBA32) { unsigned char* pixels = NULL; GetTexDataAsAlpha8(&pixels, NULL, NULL); if (pixels) { TexPixelsRGBA32 = (unsigned int*)ImGui::MemAlloc((size_t)(TexWidth * TexHeight * 4)); const unsigned char* src = pixels; unsigned int* dst = TexPixelsRGBA32; for (int n = TexWidth * TexHeight; n > 0; n--) *dst++ = IM_COL32(255, 255, 255, (unsigned int)(*src++)); } } *out_pixels = (unsigned char*)TexPixelsRGBA32; if (out_width) *out_width = TexWidth; if (out_height) *out_height = TexHeight; if (out_bytes_per_pixel) *out_bytes_per_pixel = 4; } ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg) { IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0); IM_ASSERT(font_cfg->SizePixels > 0.0f); // Create new font if (!font_cfg->MergeMode) Fonts.push_back(IM_NEW(ImFont)); else IM_ASSERT(!Fonts.empty()); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font. ConfigData.push_back(*font_cfg); ImFontConfig& new_font_cfg = ConfigData.back(); if (!new_font_cfg.DstFont) new_font_cfg.DstFont = Fonts.back(); if (!new_font_cfg.FontDataOwnedByAtlas) { new_font_cfg.FontData = ImGui::MemAlloc(new_font_cfg.FontDataSize); new_font_cfg.FontDataOwnedByAtlas = true; memcpy(new_font_cfg.FontData, font_cfg->FontData, (size_t)new_font_cfg.FontDataSize); } // Invalidate texture ClearTexData(); return new_font_cfg.DstFont; } // Default font TTF is compressed with stb_compress then base85 encoded (see misc/fonts/binary_to_compressed_c.cpp for encoder) static unsigned int stb_decompress_length(const unsigned char *input); static unsigned int stb_decompress(unsigned char *output, const unsigned char *input, unsigned int length); static const char* GetDefaultCompressedFontDataTTFBase85(); static unsigned int Decode85Byte(char c) { return c >= '\\' ? c-36 : c-35; } static void Decode85(const unsigned char* src, unsigned char* dst) { while (*src) { unsigned int tmp = Decode85Byte(src[0]) + 85*(Decode85Byte(src[1]) + 85*(Decode85Byte(src[2]) + 85*(Decode85Byte(src[3]) + 85*Decode85Byte(src[4])))); dst[0] = ((tmp >> 0) & 0xFF); dst[1] = ((tmp >> 8) & 0xFF); dst[2] = ((tmp >> 16) & 0xFF); dst[3] = ((tmp >> 24) & 0xFF); // We can't assume little-endianness. src += 5; dst += 4; } } // Load embedded ProggyClean.ttf at size 13, disable oversampling ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template) { ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); if (!font_cfg_template) { font_cfg.OversampleH = font_cfg.OversampleV = 1; font_cfg.PixelSnapH = true; } if (font_cfg.Name[0] == '\0') strcpy(font_cfg.Name, "ProggyClean.ttf, 13px"); if (font_cfg.SizePixels <= 0.0f) font_cfg.SizePixels = 13.0f; const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85(); ImFont* font = AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_cfg.SizePixels, &font_cfg, GetGlyphRangesDefault()); font->DisplayOffset.y = 1.0f; return font; } ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) { int data_size = 0; void* data = ImFileLoadToMemory(filename, "rb", &data_size, 0); if (!data) { IM_ASSERT(0); // Could not load file. return NULL; } ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); if (font_cfg.Name[0] == '\0') { // Store a short copy of filename into into the font name for convenience const char* p; for (p = filename + strlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {} ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "%s, %.0fpx", p, size_pixels); } return AddFontFromMemoryTTF(data, data_size, size_pixels, &font_cfg, glyph_ranges); } // NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build(). ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) { ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); IM_ASSERT(font_cfg.FontData == NULL); font_cfg.FontData = ttf_data; font_cfg.FontDataSize = ttf_size; font_cfg.SizePixels = size_pixels; if (glyph_ranges) font_cfg.GlyphRanges = glyph_ranges; return AddFont(&font_cfg); } ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) { const unsigned int buf_decompressed_size = stb_decompress_length((const unsigned char*)compressed_ttf_data); unsigned char* buf_decompressed_data = (unsigned char *)ImGui::MemAlloc(buf_decompressed_size); stb_decompress(buf_decompressed_data, (const unsigned char*)compressed_ttf_data, (unsigned int)compressed_ttf_size); ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); IM_ASSERT(font_cfg.FontData == NULL); font_cfg.FontDataOwnedByAtlas = true; return AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, size_pixels, &font_cfg, glyph_ranges); } ImFont* ImFontAtlas::AddFontFromMemoryCompressedBase85TTF(const char* compressed_ttf_data_base85, float size_pixels, const ImFontConfig* font_cfg, const ImWchar* glyph_ranges) { int compressed_ttf_size = (((int)strlen(compressed_ttf_data_base85) + 4) / 5) * 4; void* compressed_ttf = ImGui::MemAlloc((size_t)compressed_ttf_size); Decode85((const unsigned char*)compressed_ttf_data_base85, (unsigned char*)compressed_ttf); ImFont* font = AddFontFromMemoryCompressedTTF(compressed_ttf, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges); ImGui::MemFree(compressed_ttf); return font; } int ImFontAtlas::AddCustomRectRegular(unsigned int id, int width, int height) { IM_ASSERT(id >= 0x10000); IM_ASSERT(width > 0 && width <= 0xFFFF); IM_ASSERT(height > 0 && height <= 0xFFFF); CustomRect r; r.ID = id; r.Width = (unsigned short)width; r.Height = (unsigned short)height; CustomRects.push_back(r); return CustomRects.Size - 1; // Return index } int ImFontAtlas::AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset) { IM_ASSERT(font != NULL); IM_ASSERT(width > 0 && width <= 0xFFFF); IM_ASSERT(height > 0 && height <= 0xFFFF); CustomRect r; r.ID = id; r.Width = (unsigned short)width; r.Height = (unsigned short)height; r.GlyphAdvanceX = advance_x; r.GlyphOffset = offset; r.Font = font; CustomRects.push_back(r); return CustomRects.Size - 1; // Return index } void ImFontAtlas::CalcCustomRectUV(const CustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) { IM_ASSERT(TexWidth > 0 && TexHeight > 0); // Font atlas needs to be built before we can calculate UV coordinates IM_ASSERT(rect->IsPacked()); // Make sure the rectangle has been packed *out_uv_min = ImVec2((float)rect->X * TexUvScale.x, (float)rect->Y * TexUvScale.y); *out_uv_max = ImVec2((float)(rect->X + rect->Width) * TexUvScale.x, (float)(rect->Y + rect->Height) * TexUvScale.y); } bool ImFontAtlas::GetMouseCursorTexData(ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]) { if (cursor_type <= ImGuiMouseCursor_None || cursor_type >= ImGuiMouseCursor_COUNT) return false; if (Flags & ImFontAtlasFlags_NoMouseCursors) return false; IM_ASSERT(CustomRectIds[0] != -1); ImFontAtlas::CustomRect& r = CustomRects[CustomRectIds[0]]; IM_ASSERT(r.ID == FONT_ATLAS_DEFAULT_TEX_DATA_ID); ImVec2 pos = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][0] + ImVec2((float)r.X, (float)r.Y); ImVec2 size = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][1]; *out_size = size; *out_offset = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][2]; out_uv_border[0] = (pos) * TexUvScale; out_uv_border[1] = (pos + size) * TexUvScale; pos.x += FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF + 1; out_uv_fill[0] = (pos) * TexUvScale; out_uv_fill[1] = (pos + size) * TexUvScale; return true; } bool ImFontAtlas::Build() { return ImFontAtlasBuildWithStbTruetype(this); } void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_brighten_factor) { for (unsigned int i = 0; i < 256; i++) { unsigned int value = (unsigned int)(i * in_brighten_factor); out_table[i] = value > 255 ? 255 : (value & 0xFF); } } void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride) { unsigned char* data = pixels + x + y * stride; for (int j = h; j > 0; j--, data += stride) for (int i = 0; i < w; i++) data[i] = table[data[i]]; } bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) { IM_ASSERT(atlas->ConfigData.Size > 0); ImFontAtlasBuildRegisterDefaultCustomRects(atlas); atlas->TexID = NULL; atlas->TexWidth = atlas->TexHeight = 0; atlas->TexUvScale = ImVec2(0.0f, 0.0f); atlas->TexUvWhitePixel = ImVec2(0.0f, 0.0f); atlas->ClearTexData(); // Count glyphs/ranges int total_glyphs_count = 0; int total_ranges_count = 0; for (int input_i = 0; input_i < atlas->ConfigData.Size; input_i++) { ImFontConfig& cfg = atlas->ConfigData[input_i]; if (!cfg.GlyphRanges) cfg.GlyphRanges = atlas->GetGlyphRangesDefault(); for (const ImWchar* in_range = cfg.GlyphRanges; in_range[0] && in_range[1]; in_range += 2, total_ranges_count++) total_glyphs_count += (in_range[1] - in_range[0]) + 1; } // We need a width for the skyline algorithm. Using a dumb heuristic here to decide of width. User can override TexDesiredWidth and TexGlyphPadding if they wish. // Width doesn't really matter much, but some API/GPU have texture size limitations and increasing width can decrease height. atlas->TexWidth = (atlas->TexDesiredWidth > 0) ? atlas->TexDesiredWidth : (total_glyphs_count > 4000) ? 4096 : (total_glyphs_count > 2000) ? 2048 : (total_glyphs_count > 1000) ? 1024 : 512; atlas->TexHeight = 0; // Start packing const int max_tex_height = 1024*32; stbtt_pack_context spc = {}; if (!stbtt_PackBegin(&spc, NULL, atlas->TexWidth, max_tex_height, 0, atlas->TexGlyphPadding, NULL)) return false; stbtt_PackSetOversampling(&spc, 1, 1); // Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values). ImFontAtlasBuildPackCustomRects(atlas, spc.pack_info); // Initialize font information (so we can error without any cleanup) struct ImFontTempBuildData { stbtt_fontinfo FontInfo; stbrp_rect* Rects; int RectsCount; stbtt_pack_range* Ranges; int RangesCount; }; ImFontTempBuildData* tmp_array = (ImFontTempBuildData*)ImGui::MemAlloc((size_t)atlas->ConfigData.Size * sizeof(ImFontTempBuildData)); for (int input_i = 0; input_i < atlas->ConfigData.Size; input_i++) { ImFontConfig& cfg = atlas->ConfigData[input_i]; ImFontTempBuildData& tmp = tmp_array[input_i]; IM_ASSERT(cfg.DstFont && (!cfg.DstFont->IsLoaded() || cfg.DstFont->ContainerAtlas == atlas)); const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)cfg.FontData, cfg.FontNo); IM_ASSERT(font_offset >= 0 && "FontData is incorrect, or FontNo cannot be found."); if (!stbtt_InitFont(&tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset)) { atlas->TexWidth = atlas->TexHeight = 0; // Reset output on failure ImGui::MemFree(tmp_array); return false; } } // Allocate packing character data and flag packed characters buffer as non-packed (x0=y0=x1=y1=0) int buf_packedchars_n = 0, buf_rects_n = 0, buf_ranges_n = 0; stbtt_packedchar* buf_packedchars = (stbtt_packedchar*)ImGui::MemAlloc(total_glyphs_count * sizeof(stbtt_packedchar)); stbrp_rect* buf_rects = (stbrp_rect*)ImGui::MemAlloc(total_glyphs_count * sizeof(stbrp_rect)); stbtt_pack_range* buf_ranges = (stbtt_pack_range*)ImGui::MemAlloc(total_ranges_count * sizeof(stbtt_pack_range)); memset(buf_packedchars, 0, total_glyphs_count * sizeof(stbtt_packedchar)); memset(buf_rects, 0, total_glyphs_count * sizeof(stbrp_rect)); // Unnecessary but let's clear this for the sake of sanity. memset(buf_ranges, 0, total_ranges_count * sizeof(stbtt_pack_range)); // First font pass: pack all glyphs (no rendering at this point, we are working with rectangles in an infinitely tall texture at this point) for (int input_i = 0; input_i < atlas->ConfigData.Size; input_i++) { ImFontConfig& cfg = atlas->ConfigData[input_i]; ImFontTempBuildData& tmp = tmp_array[input_i]; // Setup ranges int font_glyphs_count = 0; int font_ranges_count = 0; for (const ImWchar* in_range = cfg.GlyphRanges; in_range[0] && in_range[1]; in_range += 2, font_ranges_count++) font_glyphs_count += (in_range[1] - in_range[0]) + 1; tmp.Ranges = buf_ranges + buf_ranges_n; tmp.RangesCount = font_ranges_count; buf_ranges_n += font_ranges_count; for (int i = 0; i < font_ranges_count; i++) { const ImWchar* in_range = &cfg.GlyphRanges[i * 2]; stbtt_pack_range& range = tmp.Ranges[i]; range.font_size = cfg.SizePixels; range.first_unicode_codepoint_in_range = in_range[0]; range.num_chars = (in_range[1] - in_range[0]) + 1; range.chardata_for_range = buf_packedchars + buf_packedchars_n; buf_packedchars_n += range.num_chars; } // Pack tmp.Rects = buf_rects + buf_rects_n; tmp.RectsCount = font_glyphs_count; buf_rects_n += font_glyphs_count; stbtt_PackSetOversampling(&spc, cfg.OversampleH, cfg.OversampleV); int n = stbtt_PackFontRangesGatherRects(&spc, &tmp.FontInfo, tmp.Ranges, tmp.RangesCount, tmp.Rects); IM_ASSERT(n == font_glyphs_count); stbrp_pack_rects((stbrp_context*)spc.pack_info, tmp.Rects, n); // Extend texture height for (int i = 0; i < n; i++) if (tmp.Rects[i].was_packed) atlas->TexHeight = ImMax(atlas->TexHeight, tmp.Rects[i].y + tmp.Rects[i].h); } IM_ASSERT(buf_rects_n == total_glyphs_count); IM_ASSERT(buf_packedchars_n == total_glyphs_count); IM_ASSERT(buf_ranges_n == total_ranges_count); // Create texture atlas->TexHeight = (atlas->Flags & ImFontAtlasFlags_NoPowerOfTwoHeight) ? (atlas->TexHeight + 1) : ImUpperPowerOfTwo(atlas->TexHeight); atlas->TexUvScale = ImVec2(1.0f / atlas->TexWidth, 1.0f / atlas->TexHeight); atlas->TexPixelsAlpha8 = (unsigned char*)ImGui::MemAlloc(atlas->TexWidth * atlas->TexHeight); memset(atlas->TexPixelsAlpha8, 0, atlas->TexWidth * atlas->TexHeight); spc.pixels = atlas->TexPixelsAlpha8; spc.height = atlas->TexHeight; // Second pass: render font characters for (int input_i = 0; input_i < atlas->ConfigData.Size; input_i++) { ImFontConfig& cfg = atlas->ConfigData[input_i]; ImFontTempBuildData& tmp = tmp_array[input_i]; stbtt_PackSetOversampling(&spc, cfg.OversampleH, cfg.OversampleV); stbtt_PackFontRangesRenderIntoRects(&spc, &tmp.FontInfo, tmp.Ranges, tmp.RangesCount, tmp.Rects); if (cfg.RasterizerMultiply != 1.0f) { unsigned char multiply_table[256]; ImFontAtlasBuildMultiplyCalcLookupTable(multiply_table, cfg.RasterizerMultiply); for (const stbrp_rect* r = tmp.Rects; r != tmp.Rects + tmp.RectsCount; r++) if (r->was_packed) ImFontAtlasBuildMultiplyRectAlpha8(multiply_table, spc.pixels, r->x, r->y, r->w, r->h, spc.stride_in_bytes); } tmp.Rects = NULL; } // End packing stbtt_PackEnd(&spc); ImGui::MemFree(buf_rects); buf_rects = NULL; // Third pass: setup ImFont and glyphs for runtime for (int input_i = 0; input_i < atlas->ConfigData.Size; input_i++) { ImFontConfig& cfg = atlas->ConfigData[input_i]; ImFontTempBuildData& tmp = tmp_array[input_i]; ImFont* dst_font = cfg.DstFont; // We can have multiple input fonts writing into a same destination font (when using MergeMode=true) if (cfg.MergeMode) dst_font->BuildLookupTable(); const float font_scale = stbtt_ScaleForPixelHeight(&tmp.FontInfo, cfg.SizePixels); int unscaled_ascent, unscaled_descent, unscaled_line_gap; stbtt_GetFontVMetrics(&tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap); const float ascent = ImFloor(unscaled_ascent * font_scale + ((unscaled_ascent > 0.0f) ? +1 : -1)); const float descent = ImFloor(unscaled_descent * font_scale + ((unscaled_descent > 0.0f) ? +1 : -1)); ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent); const float off_x = cfg.GlyphOffset.x; const float off_y = cfg.GlyphOffset.y + (float)(int)(dst_font->Ascent + 0.5f); for (int i = 0; i < tmp.RangesCount; i++) { stbtt_pack_range& range = tmp.Ranges[i]; for (int char_idx = 0; char_idx < range.num_chars; char_idx += 1) { const stbtt_packedchar& pc = range.chardata_for_range[char_idx]; if (!pc.x0 && !pc.x1 && !pc.y0 && !pc.y1) continue; const int codepoint = range.first_unicode_codepoint_in_range + char_idx; if (cfg.MergeMode && dst_font->FindGlyphNoFallback((unsigned short)codepoint)) continue; stbtt_aligned_quad q; float dummy_x = 0.0f, dummy_y = 0.0f; stbtt_GetPackedQuad(range.chardata_for_range, atlas->TexWidth, atlas->TexHeight, char_idx, &dummy_x, &dummy_y, &q, 0); dst_font->AddGlyph((ImWchar)codepoint, q.x0 + off_x, q.y0 + off_y, q.x1 + off_x, q.y1 + off_y, q.s0, q.t0, q.s1, q.t1, pc.xadvance); } } } // Cleanup temporaries ImGui::MemFree(buf_packedchars); ImGui::MemFree(buf_ranges); ImGui::MemFree(tmp_array); ImFontAtlasBuildFinish(atlas); return true; } void ImFontAtlasBuildRegisterDefaultCustomRects(ImFontAtlas* atlas) { if (atlas->CustomRectIds[0] >= 0) return; if (!(atlas->Flags & ImFontAtlasFlags_NoMouseCursors)) atlas->CustomRectIds[0] = atlas->AddCustomRectRegular(FONT_ATLAS_DEFAULT_TEX_DATA_ID, FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF*2+1, FONT_ATLAS_DEFAULT_TEX_DATA_H); else atlas->CustomRectIds[0] = atlas->AddCustomRectRegular(FONT_ATLAS_DEFAULT_TEX_DATA_ID, 2, 2); } void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent) { if (!font_config->MergeMode) { font->ClearOutputData(); font->FontSize = font_config->SizePixels; font->ConfigData = font_config; font->ContainerAtlas = atlas; font->Ascent = ascent; font->Descent = descent; } font->ConfigDataCount++; } void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* pack_context_opaque) { stbrp_context* pack_context = (stbrp_context*)pack_context_opaque; ImVector& user_rects = atlas->CustomRects; IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong. ImVector pack_rects; pack_rects.resize(user_rects.Size); memset(pack_rects.Data, 0, sizeof(stbrp_rect) * user_rects.Size); for (int i = 0; i < user_rects.Size; i++) { pack_rects[i].w = user_rects[i].Width; pack_rects[i].h = user_rects[i].Height; } stbrp_pack_rects(pack_context, &pack_rects[0], pack_rects.Size); for (int i = 0; i < pack_rects.Size; i++) if (pack_rects[i].was_packed) { user_rects[i].X = pack_rects[i].x; user_rects[i].Y = pack_rects[i].y; IM_ASSERT(pack_rects[i].w == user_rects[i].Width && pack_rects[i].h == user_rects[i].Height); atlas->TexHeight = ImMax(atlas->TexHeight, pack_rects[i].y + pack_rects[i].h); } } static void ImFontAtlasBuildRenderDefaultTexData(ImFontAtlas* atlas) { IM_ASSERT(atlas->CustomRectIds[0] >= 0); IM_ASSERT(atlas->TexPixelsAlpha8 != NULL); ImFontAtlas::CustomRect& r = atlas->CustomRects[atlas->CustomRectIds[0]]; IM_ASSERT(r.ID == FONT_ATLAS_DEFAULT_TEX_DATA_ID); IM_ASSERT(r.IsPacked()); const int w = atlas->TexWidth; if (!(atlas->Flags & ImFontAtlasFlags_NoMouseCursors)) { // Render/copy pixels IM_ASSERT(r.Width == FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF * 2 + 1 && r.Height == FONT_ATLAS_DEFAULT_TEX_DATA_H); for (int y = 0, n = 0; y < FONT_ATLAS_DEFAULT_TEX_DATA_H; y++) for (int x = 0; x < FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF; x++, n++) { const int offset0 = (int)(r.X + x) + (int)(r.Y + y) * w; const int offset1 = offset0 + FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF + 1; atlas->TexPixelsAlpha8[offset0] = FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[n] == '.' ? 0xFF : 0x00; atlas->TexPixelsAlpha8[offset1] = FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[n] == 'X' ? 0xFF : 0x00; } } else { IM_ASSERT(r.Width == 2 && r.Height == 2); const int offset = (int)(r.X) + (int)(r.Y) * w; atlas->TexPixelsAlpha8[offset] = atlas->TexPixelsAlpha8[offset + 1] = atlas->TexPixelsAlpha8[offset + w] = atlas->TexPixelsAlpha8[offset + w + 1] = 0xFF; } atlas->TexUvWhitePixel = ImVec2((r.X + 0.5f) * atlas->TexUvScale.x, (r.Y + 0.5f) * atlas->TexUvScale.y); } void ImFontAtlasBuildFinish(ImFontAtlas* atlas) { // Render into our custom data block ImFontAtlasBuildRenderDefaultTexData(atlas); // Register custom rectangle glyphs for (int i = 0; i < atlas->CustomRects.Size; i++) { const ImFontAtlas::CustomRect& r = atlas->CustomRects[i]; if (r.Font == NULL || r.ID > 0x10000) continue; IM_ASSERT(r.Font->ContainerAtlas == atlas); ImVec2 uv0, uv1; atlas->CalcCustomRectUV(&r, &uv0, &uv1); r.Font->AddGlyph((ImWchar)r.ID, r.GlyphOffset.x, r.GlyphOffset.y, r.GlyphOffset.x + r.Width, r.GlyphOffset.y + r.Height, uv0.x, uv0.y, uv1.x, uv1.y, r.GlyphAdvanceX); } // Build all fonts lookup tables for (int i = 0; i < atlas->Fonts.Size; i++) if (atlas->Fonts[i]->DirtyLookupTables) atlas->Fonts[i]->BuildLookupTable(); } // Retrieve list of range (2 int per range, values are inclusive) const ImWchar* ImFontAtlas::GetGlyphRangesDefault() { static const ImWchar ranges[] = { 0x0020, 0x00FF, // Basic Latin + Latin Supplement 0, }; return &ranges[0]; } const ImWchar* ImFontAtlas::GetGlyphRangesKorean() { static const ImWchar ranges[] = { 0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x3131, 0x3163, // Korean alphabets 0xAC00, 0xD79D, // Korean characters 0, }; return &ranges[0]; } const ImWchar* ImFontAtlas::GetGlyphRangesChinese() { static const ImWchar ranges[] = { 0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana 0x31F0, 0x31FF, // Katakana Phonetic Extensions 0xFF00, 0xFFEF, // Half-width characters 0x4e00, 0x9FAF, // CJK Ideograms 0, }; return &ranges[0]; } const ImWchar* ImFontAtlas::GetGlyphRangesJapanese() { // Store the 1946 ideograms code points as successive offsets from the initial unicode codepoint 0x4E00. Each offset has an implicit +1. // This encoding is designed to helps us reduce the source code size. // FIXME: Source a list of the revised 2136 joyo kanji list from 2010 and rebuild this. // The current list was sourced from http://theinstructionlimit.com/author/renaudbedardrenaudbedard/page/3 // Note that you may use ImFontAtlas::GlyphRangesBuilder to create your own ranges, by merging existing ranges or adding new characters. static const short offsets_from_0x4E00[] = { -1,0,1,3,0,0,0,0,1,0,5,1,1,0,7,4,6,10,0,1,9,9,7,1,3,19,1,10,7,1,0,1,0,5,1,0,6,4,2,6,0,0,12,6,8,0,3,5,0,1,0,9,0,0,8,1,1,3,4,5,13,0,0,8,2,17, 4,3,1,1,9,6,0,0,0,2,1,3,2,22,1,9,11,1,13,1,3,12,0,5,9,2,0,6,12,5,3,12,4,1,2,16,1,1,4,6,5,3,0,6,13,15,5,12,8,14,0,0,6,15,3,6,0,18,8,1,6,14,1, 5,4,12,24,3,13,12,10,24,0,0,0,1,0,1,1,2,9,10,2,2,0,0,3,3,1,0,3,8,0,3,2,4,4,1,6,11,10,14,6,15,3,4,15,1,0,0,5,2,2,0,0,1,6,5,5,6,0,3,6,5,0,0,1,0, 11,2,2,8,4,7,0,10,0,1,2,17,19,3,0,2,5,0,6,2,4,4,6,1,1,11,2,0,3,1,2,1,2,10,7,6,3,16,0,8,24,0,0,3,1,1,3,0,1,6,0,0,0,2,0,1,5,15,0,1,0,0,2,11,19, 1,4,19,7,6,5,1,0,0,0,0,5,1,0,1,9,0,0,5,0,2,0,1,0,3,0,11,3,0,2,0,0,0,0,0,9,3,6,4,12,0,14,0,0,29,10,8,0,14,37,13,0,31,16,19,0,8,30,1,20,8,3,48, 21,1,0,12,0,10,44,34,42,54,11,18,82,0,2,1,2,12,1,0,6,2,17,2,12,7,0,7,17,4,2,6,24,23,8,23,39,2,16,23,1,0,5,1,2,15,14,5,6,2,11,0,8,6,2,2,2,14, 20,4,15,3,4,11,10,10,2,5,2,1,30,2,1,0,0,22,5,5,0,3,1,5,4,1,0,0,2,2,21,1,5,1,2,16,2,1,3,4,0,8,4,0,0,5,14,11,2,16,1,13,1,7,0,22,15,3,1,22,7,14, 22,19,11,24,18,46,10,20,64,45,3,2,0,4,5,0,1,4,25,1,0,0,2,10,0,0,0,1,0,1,2,0,0,9,1,2,0,0,0,2,5,2,1,1,5,5,8,1,1,1,5,1,4,9,1,3,0,1,0,1,1,2,0,0, 2,0,1,8,22,8,1,0,0,0,0,4,2,1,0,9,8,5,0,9,1,30,24,2,6,4,39,0,14,5,16,6,26,179,0,2,1,1,0,0,0,5,2,9,6,0,2,5,16,7,5,1,1,0,2,4,4,7,15,13,14,0,0, 3,0,1,0,0,0,2,1,6,4,5,1,4,9,0,3,1,8,0,0,10,5,0,43,0,2,6,8,4,0,2,0,0,9,6,0,9,3,1,6,20,14,6,1,4,0,7,2,3,0,2,0,5,0,3,1,0,3,9,7,0,3,4,0,4,9,1,6,0, 9,0,0,2,3,10,9,28,3,6,2,4,1,2,32,4,1,18,2,0,3,1,5,30,10,0,2,2,2,0,7,9,8,11,10,11,7,2,13,7,5,10,0,3,40,2,0,1,6,12,0,4,5,1,5,11,11,21,4,8,3,7, 8,8,33,5,23,0,0,19,8,8,2,3,0,6,1,1,1,5,1,27,4,2,5,0,3,5,6,3,1,0,3,1,12,5,3,3,2,0,7,7,2,1,0,4,0,1,1,2,0,10,10,6,2,5,9,7,5,15,15,21,6,11,5,20, 4,3,5,5,2,5,0,2,1,0,1,7,28,0,9,0,5,12,5,5,18,30,0,12,3,3,21,16,25,32,9,3,14,11,24,5,66,9,1,2,0,5,9,1,5,1,8,0,8,3,3,0,1,15,1,4,8,1,2,7,0,7,2, 8,3,7,5,3,7,10,2,1,0,0,2,25,0,6,4,0,10,0,4,2,4,1,12,5,38,4,0,4,1,10,5,9,4,0,14,4,2,5,18,20,21,1,3,0,5,0,7,0,3,7,1,3,1,1,8,1,0,0,0,3,2,5,2,11, 6,0,13,1,3,9,1,12,0,16,6,2,1,0,2,1,12,6,13,11,2,0,28,1,7,8,14,13,8,13,0,2,0,5,4,8,10,2,37,42,19,6,6,7,4,14,11,18,14,80,7,6,0,4,72,12,36,27, 7,7,0,14,17,19,164,27,0,5,10,7,3,13,6,14,0,2,2,5,3,0,6,13,0,0,10,29,0,4,0,3,13,0,3,1,6,51,1,5,28,2,0,8,0,20,2,4,0,25,2,10,13,10,0,16,4,0,1,0, 2,1,7,0,1,8,11,0,0,1,2,7,2,23,11,6,6,4,16,2,2,2,0,22,9,3,3,5,2,0,15,16,21,2,9,20,15,15,5,3,9,1,0,0,1,7,7,5,4,2,2,2,38,24,14,0,0,15,5,6,24,14, 5,5,11,0,21,12,0,3,8,4,11,1,8,0,11,27,7,2,4,9,21,59,0,1,39,3,60,62,3,0,12,11,0,3,30,11,0,13,88,4,15,5,28,13,1,4,48,17,17,4,28,32,46,0,16,0, 18,11,1,8,6,38,11,2,6,11,38,2,0,45,3,11,2,7,8,4,30,14,17,2,1,1,65,18,12,16,4,2,45,123,12,56,33,1,4,3,4,7,0,0,0,3,2,0,16,4,2,4,2,0,7,4,5,2,26, 2,25,6,11,6,1,16,2,6,17,77,15,3,35,0,1,0,5,1,0,38,16,6,3,12,3,3,3,0,9,3,1,3,5,2,9,0,18,0,25,1,3,32,1,72,46,6,2,7,1,3,14,17,0,28,1,40,13,0,20, 15,40,6,38,24,12,43,1,1,9,0,12,6,0,6,2,4,19,3,7,1,48,0,9,5,0,5,6,9,6,10,15,2,11,19,3,9,2,0,1,10,1,27,8,1,3,6,1,14,0,26,0,27,16,3,4,9,6,2,23, 9,10,5,25,2,1,6,1,1,48,15,9,15,14,3,4,26,60,29,13,37,21,1,6,4,0,2,11,22,23,16,16,2,2,1,3,0,5,1,6,4,0,0,4,0,0,8,3,0,2,5,0,7,1,7,3,13,2,4,10, 3,0,2,31,0,18,3,0,12,10,4,1,0,7,5,7,0,5,4,12,2,22,10,4,2,15,2,8,9,0,23,2,197,51,3,1,1,4,13,4,3,21,4,19,3,10,5,40,0,4,1,1,10,4,1,27,34,7,21, 2,17,2,9,6,4,2,3,0,4,2,7,8,2,5,1,15,21,3,4,4,2,2,17,22,1,5,22,4,26,7,0,32,1,11,42,15,4,1,2,5,0,19,3,1,8,6,0,10,1,9,2,13,30,8,2,24,17,19,1,4, 4,25,13,0,10,16,11,39,18,8,5,30,82,1,6,8,18,77,11,13,20,75,11,112,78,33,3,0,0,60,17,84,9,1,1,12,30,10,49,5,32,158,178,5,5,6,3,3,1,3,1,4,7,6, 19,31,21,0,2,9,5,6,27,4,9,8,1,76,18,12,1,4,0,3,3,6,3,12,2,8,30,16,2,25,1,5,5,4,3,0,6,10,2,3,1,0,5,1,19,3,0,8,1,5,2,6,0,0,0,19,1,2,0,5,1,2,5, 1,3,7,0,4,12,7,3,10,22,0,9,5,1,0,2,20,1,1,3,23,30,3,9,9,1,4,191,14,3,15,6,8,50,0,1,0,0,4,0,0,1,0,2,4,2,0,2,3,0,2,0,2,2,8,7,0,1,1,1,3,3,17,11, 91,1,9,3,2,13,4,24,15,41,3,13,3,1,20,4,125,29,30,1,0,4,12,2,21,4,5,5,19,11,0,13,11,86,2,18,0,7,1,8,8,2,2,22,1,2,6,5,2,0,1,2,8,0,2,0,5,2,1,0, 2,10,2,0,5,9,2,1,2,0,1,0,4,0,0,10,2,5,3,0,6,1,0,1,4,4,33,3,13,17,3,18,6,4,7,1,5,78,0,4,1,13,7,1,8,1,0,35,27,15,3,0,0,0,1,11,5,41,38,15,22,6, 14,14,2,1,11,6,20,63,5,8,27,7,11,2,2,40,58,23,50,54,56,293,8,8,1,5,1,14,0,1,12,37,89,8,8,8,2,10,6,0,0,0,4,5,2,1,0,1,1,2,7,0,3,3,0,4,6,0,3,2, 19,3,8,0,0,0,4,4,16,0,4,1,5,1,3,0,3,4,6,2,17,10,10,31,6,4,3,6,10,126,7,3,2,2,0,9,0,0,5,20,13,0,15,0,6,0,2,5,8,64,50,3,2,12,2,9,0,0,11,8,20, 109,2,18,23,0,0,9,61,3,0,28,41,77,27,19,17,81,5,2,14,5,83,57,252,14,154,263,14,20,8,13,6,57,39,38, }; static ImWchar base_ranges[] = { 0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana 0x31F0, 0x31FF, // Katakana Phonetic Extensions 0xFF00, 0xFFEF, // Half-width characters }; static bool full_ranges_unpacked = false; static ImWchar full_ranges[IM_ARRAYSIZE(base_ranges) + IM_ARRAYSIZE(offsets_from_0x4E00)*2 + 1]; if (!full_ranges_unpacked) { // Unpack int codepoint = 0x4e00; memcpy(full_ranges, base_ranges, sizeof(base_ranges)); ImWchar* dst = full_ranges + IM_ARRAYSIZE(base_ranges); for (int n = 0; n < IM_ARRAYSIZE(offsets_from_0x4E00); n++, dst += 2) dst[0] = dst[1] = (ImWchar)(codepoint += (offsets_from_0x4E00[n] + 1)); dst[0] = 0; full_ranges_unpacked = true; } return &full_ranges[0]; } const ImWchar* ImFontAtlas::GetGlyphRangesCyrillic() { static const ImWchar ranges[] = { 0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x0400, 0x052F, // Cyrillic + Cyrillic Supplement 0x2DE0, 0x2DFF, // Cyrillic Extended-A 0xA640, 0xA69F, // Cyrillic Extended-B 0, }; return &ranges[0]; } const ImWchar* ImFontAtlas::GetGlyphRangesThai() { static const ImWchar ranges[] = { 0x0020, 0x00FF, // Basic Latin 0x2010, 0x205E, // Punctuations 0x0E00, 0x0E7F, // Thai 0, }; return &ranges[0]; } //----------------------------------------------------------------------------- // ImFontAtlas::GlyphRangesBuilder //----------------------------------------------------------------------------- void ImFontAtlas::GlyphRangesBuilder::AddText(const char* text, const char* text_end) { while (text_end ? (text < text_end) : *text) { unsigned int c = 0; int c_len = ImTextCharFromUtf8(&c, text, text_end); text += c_len; if (c_len == 0) break; if (c < 0x10000) AddChar((ImWchar)c); } } void ImFontAtlas::GlyphRangesBuilder::AddRanges(const ImWchar* ranges) { for (; ranges[0]; ranges += 2) for (ImWchar c = ranges[0]; c <= ranges[1]; c++) AddChar(c); } void ImFontAtlas::GlyphRangesBuilder::BuildRanges(ImVector* out_ranges) { for (int n = 0; n < 0x10000; n++) if (GetBit(n)) { out_ranges->push_back((ImWchar)n); while (n < 0x10000 && GetBit(n + 1)) n++; out_ranges->push_back((ImWchar)n); } out_ranges->push_back(0); } //----------------------------------------------------------------------------- // ImFont //----------------------------------------------------------------------------- ImFont::ImFont() { Scale = 1.0f; FallbackChar = (ImWchar)'?'; DisplayOffset = ImVec2(0.0f, 0.0f); ClearOutputData(); } ImFont::~ImFont() { // Invalidate active font so that the user gets a clear crash instead of a dangling pointer. // If you want to delete fonts you need to do it between Render() and NewFrame(). // FIXME-CLEANUP /* ImGuiContext& g = *GImGui; if (g.Font == this) g.Font = NULL; */ ClearOutputData(); } void ImFont::ClearOutputData() { FontSize = 0.0f; Glyphs.clear(); IndexAdvanceX.clear(); IndexLookup.clear(); FallbackGlyph = NULL; FallbackAdvanceX = 0.0f; ConfigDataCount = 0; ConfigData = NULL; ContainerAtlas = NULL; Ascent = Descent = 0.0f; DirtyLookupTables = true; MetricsTotalSurface = 0; } void ImFont::BuildLookupTable() { int max_codepoint = 0; for (int i = 0; i != Glyphs.Size; i++) max_codepoint = ImMax(max_codepoint, (int)Glyphs[i].Codepoint); IM_ASSERT(Glyphs.Size < 0xFFFF); // -1 is reserved IndexAdvanceX.clear(); IndexLookup.clear(); DirtyLookupTables = false; GrowIndex(max_codepoint + 1); for (int i = 0; i < Glyphs.Size; i++) { int codepoint = (int)Glyphs[i].Codepoint; IndexAdvanceX[codepoint] = Glyphs[i].AdvanceX; IndexLookup[codepoint] = (unsigned short)i; } // Create a glyph to handle TAB // FIXME: Needs proper TAB handling but it needs to be contextualized (or we could arbitrary say that each string starts at "column 0" ?) if (FindGlyph((unsigned short)' ')) { if (Glyphs.back().Codepoint != '\t') // So we can call this function multiple times Glyphs.resize(Glyphs.Size + 1); ImFontGlyph& tab_glyph = Glyphs.back(); tab_glyph = *FindGlyph((unsigned short)' '); tab_glyph.Codepoint = '\t'; tab_glyph.AdvanceX *= 4; IndexAdvanceX[(int)tab_glyph.Codepoint] = (float)tab_glyph.AdvanceX; IndexLookup[(int)tab_glyph.Codepoint] = (unsigned short)(Glyphs.Size-1); } FallbackGlyph = FindGlyphNoFallback(FallbackChar); FallbackAdvanceX = FallbackGlyph ? FallbackGlyph->AdvanceX : 0.0f; for (int i = 0; i < max_codepoint + 1; i++) if (IndexAdvanceX[i] < 0.0f) IndexAdvanceX[i] = FallbackAdvanceX; } void ImFont::SetFallbackChar(ImWchar c) { FallbackChar = c; BuildLookupTable(); } void ImFont::GrowIndex(int new_size) { IM_ASSERT(IndexAdvanceX.Size == IndexLookup.Size); if (new_size <= IndexLookup.Size) return; IndexAdvanceX.resize(new_size, -1.0f); IndexLookup.resize(new_size, (unsigned short)-1); } void ImFont::AddGlyph(ImWchar codepoint, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x) { Glyphs.resize(Glyphs.Size + 1); ImFontGlyph& glyph = Glyphs.back(); glyph.Codepoint = (ImWchar)codepoint; glyph.X0 = x0; glyph.Y0 = y0; glyph.X1 = x1; glyph.Y1 = y1; glyph.U0 = u0; glyph.V0 = v0; glyph.U1 = u1; glyph.V1 = v1; glyph.AdvanceX = advance_x + ConfigData->GlyphExtraSpacing.x; // Bake spacing into AdvanceX if (ConfigData->PixelSnapH) glyph.AdvanceX = (float)(int)(glyph.AdvanceX + 0.5f); // Compute rough surface usage metrics (+1 to account for average padding, +0.99 to round) DirtyLookupTables = true; MetricsTotalSurface += (int)((glyph.U1 - glyph.U0) * ContainerAtlas->TexWidth + 1.99f) * (int)((glyph.V1 - glyph.V0) * ContainerAtlas->TexHeight + 1.99f); } void ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst) { IM_ASSERT(IndexLookup.Size > 0); // Currently this can only be called AFTER the font has been built, aka after calling ImFontAtlas::GetTexDataAs*() function. int index_size = IndexLookup.Size; if (dst < index_size && IndexLookup.Data[dst] == (unsigned short)-1 && !overwrite_dst) // 'dst' already exists return; if (src >= index_size && dst >= index_size) // both 'dst' and 'src' don't exist -> no-op return; GrowIndex(dst + 1); IndexLookup[dst] = (src < index_size) ? IndexLookup.Data[src] : (unsigned short)-1; IndexAdvanceX[dst] = (src < index_size) ? IndexAdvanceX.Data[src] : 1.0f; } const ImFontGlyph* ImFont::FindGlyph(ImWchar c) const { if (c >= IndexLookup.Size) return FallbackGlyph; const unsigned short i = IndexLookup[c]; if (i == (unsigned short)-1) return FallbackGlyph; return &Glyphs.Data[i]; } const ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c) const { if (c >= IndexLookup.Size) return NULL; const unsigned short i = IndexLookup[c]; if (i == (unsigned short)-1) return NULL; return &Glyphs.Data[i]; } const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const { // Simple word-wrapping for English, not full-featured. Please submit failing cases! // FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.) // For references, possible wrap point marked with ^ // "aaa bbb, ccc,ddd. eee fff. ggg!" // ^ ^ ^ ^ ^__ ^ ^ // List of hardcoded separators: .,;!?'" // Skip extra blanks after a line returns (that includes not counting them in width computation) // e.g. "Hello world" --> "Hello" "World" // Cut words that cannot possibly fit within one line. // e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish" float line_width = 0.0f; float word_width = 0.0f; float blank_width = 0.0f; wrap_width /= scale; // We work with unscaled widths to avoid scaling every characters const char* word_end = text; const char* prev_word_end = NULL; bool inside_word = true; const char* s = text; while (s < text_end) { unsigned int c = (unsigned int)*s; const char* next_s; if (c < 0x80) next_s = s + 1; else next_s = s + ImTextCharFromUtf8(&c, s, text_end); if (c == 0) break; if (c < 32) { if (c == '\n') { line_width = word_width = blank_width = 0.0f; inside_word = true; s = next_s; continue; } if (c == '\r') { s = next_s; continue; } } const float char_width = ((int)c < IndexAdvanceX.Size ? IndexAdvanceX[(int)c] : FallbackAdvanceX); if (ImCharIsSpace(c)) { if (inside_word) { line_width += blank_width; blank_width = 0.0f; word_end = s; } blank_width += char_width; inside_word = false; } else { word_width += char_width; if (inside_word) { word_end = next_s; } else { prev_word_end = word_end; line_width += word_width + blank_width; word_width = blank_width = 0.0f; } // Allow wrapping after punctuation. inside_word = !(c == '.' || c == ',' || c == ';' || c == '!' || c == '?' || c == '\"'); } // We ignore blank width at the end of the line (they can be skipped) if (line_width + word_width >= wrap_width) { // Words that cannot possibly fit within an entire line will be cut anywhere. if (word_width < wrap_width) s = prev_word_end ? prev_word_end : word_end; break; } s = next_s; } return s; } ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end, const char** remaining) const { if (!text_end) text_end = text_begin + strlen(text_begin); // FIXME-OPT: Need to avoid this. const float line_height = size; const float scale = size / FontSize; ImVec2 text_size = ImVec2(0,0); float line_width = 0.0f; const bool word_wrap_enabled = (wrap_width > 0.0f); const char* word_wrap_eol = NULL; const char* s = text_begin; while (s < text_end) { if (word_wrap_enabled) { // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature. if (!word_wrap_eol) { word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width); if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity. word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below } if (s >= word_wrap_eol) { if (text_size.x < line_width) text_size.x = line_width; text_size.y += line_height; line_width = 0.0f; word_wrap_eol = NULL; // Wrapping skips upcoming blanks while (s < text_end) { const char c = *s; if (ImCharIsSpace((unsigned int)c)) { s++; } else if (c == '\n') { s++; break; } else { break; } } continue; } } // Decode and advance source const char* prev_s = s; unsigned int c = (unsigned int)*s; if (c < 0x80) { s += 1; } else { s += ImTextCharFromUtf8(&c, s, text_end); if (c == 0) // Malformed UTF-8? break; } if (c < 32) { if (c == '\n') { text_size.x = ImMax(text_size.x, line_width); text_size.y += line_height; line_width = 0.0f; continue; } if (c == '\r') continue; } const float char_width = ((int)c < IndexAdvanceX.Size ? IndexAdvanceX[(int)c] : FallbackAdvanceX) * scale; if (line_width + char_width >= max_width) { s = prev_s; break; } line_width += char_width; } if (text_size.x < line_width) text_size.x = line_width; if (line_width > 0 || text_size.y == 0.0f) text_size.y += line_height; if (remaining) *remaining = s; return text_size; } void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, unsigned short c) const { if (c == ' ' || c == '\t' || c == '\n' || c == '\r') // Match behavior of RenderText(), those 4 codepoints are hard-coded. return; if (const ImFontGlyph* glyph = FindGlyph(c)) { float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f; pos.x = (float)(int)pos.x + DisplayOffset.x; pos.y = (float)(int)pos.y + DisplayOffset.y; draw_list->PrimReserve(6, 4); draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col); } } void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const { if (!text_end) text_end = text_begin + strlen(text_begin); // ImGui functions generally already provides a valid text_end, so this is merely to handle direct calls. // Align to be pixel perfect pos.x = (float)(int)pos.x + DisplayOffset.x; pos.y = (float)(int)pos.y + DisplayOffset.y; float x = pos.x; float y = pos.y; if (y > clip_rect.w) return; const float scale = size / FontSize; const float line_height = FontSize * scale; const bool word_wrap_enabled = (wrap_width > 0.0f); const char* word_wrap_eol = NULL; // Skip non-visible lines const char* s = text_begin; if (!word_wrap_enabled && y + line_height < clip_rect.y) while (s < text_end && *s != '\n') // Fast-forward to next line s++; // Reserve vertices for remaining worse case (over-reserving is useful and easily amortized) const int vtx_count_max = (int)(text_end - s) * 4; const int idx_count_max = (int)(text_end - s) * 6; const int idx_expected_size = draw_list->IdxBuffer.Size + idx_count_max; draw_list->PrimReserve(idx_count_max, vtx_count_max); ImDrawVert* vtx_write = draw_list->_VtxWritePtr; ImDrawIdx* idx_write = draw_list->_IdxWritePtr; unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx; while (s < text_end) { if (word_wrap_enabled) { // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature. if (!word_wrap_eol) { word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - pos.x)); if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity. word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below } if (s >= word_wrap_eol) { x = pos.x; y += line_height; word_wrap_eol = NULL; // Wrapping skips upcoming blanks while (s < text_end) { const char c = *s; if (ImCharIsSpace((unsigned int)c)) { s++; } else if (c == '\n') { s++; break; } else { break; } } continue; } } // Decode and advance source unsigned int c = (unsigned int)*s; if (c < 0x80) { s += 1; } else { s += ImTextCharFromUtf8(&c, s, text_end); if (c == 0) // Malformed UTF-8? break; } if (c < 32) { if (c == '\n') { x = pos.x; y += line_height; if (y > clip_rect.w) break; if (!word_wrap_enabled && y + line_height < clip_rect.y) while (s < text_end && *s != '\n') // Fast-forward to next line s++; continue; } if (c == '\r') continue; } float char_width = 0.0f; if (const ImFontGlyph* glyph = FindGlyph((unsigned short)c)) { char_width = glyph->AdvanceX * scale; // Arbitrarily assume that both space and tabs are empty glyphs as an optimization if (c != ' ' && c != '\t') { // We don't do a second finer clipping test on the Y axis as we've already skipped anything before clip_rect.y and exit once we pass clip_rect.w float x1 = x + glyph->X0 * scale; float x2 = x + glyph->X1 * scale; float y1 = y + glyph->Y0 * scale; float y2 = y + glyph->Y1 * scale; if (x1 <= clip_rect.z && x2 >= clip_rect.x) { // Render a character float u1 = glyph->U0; float v1 = glyph->V0; float u2 = glyph->U1; float v2 = glyph->V1; // CPU side clipping used to fit text in their frame when the frame is too small. Only does clipping for axis aligned quads. if (cpu_fine_clip) { if (x1 < clip_rect.x) { u1 = u1 + (1.0f - (x2 - clip_rect.x) / (x2 - x1)) * (u2 - u1); x1 = clip_rect.x; } if (y1 < clip_rect.y) { v1 = v1 + (1.0f - (y2 - clip_rect.y) / (y2 - y1)) * (v2 - v1); y1 = clip_rect.y; } if (x2 > clip_rect.z) { u2 = u1 + ((clip_rect.z - x1) / (x2 - x1)) * (u2 - u1); x2 = clip_rect.z; } if (y2 > clip_rect.w) { v2 = v1 + ((clip_rect.w - y1) / (y2 - y1)) * (v2 - v1); y2 = clip_rect.w; } if (y1 >= y2) { x += char_width; continue; } } // We are NOT calling PrimRectUV() here because non-inlined causes too much overhead in a debug builds. Inlined here: { idx_write[0] = (ImDrawIdx)(vtx_current_idx); idx_write[1] = (ImDrawIdx)(vtx_current_idx+1); idx_write[2] = (ImDrawIdx)(vtx_current_idx+2); idx_write[3] = (ImDrawIdx)(vtx_current_idx); idx_write[4] = (ImDrawIdx)(vtx_current_idx+2); idx_write[5] = (ImDrawIdx)(vtx_current_idx+3); vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1; vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1; vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2; vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2; vtx_write += 4; vtx_current_idx += 4; idx_write += 6; } } } } x += char_width; } // Give back unused vertices draw_list->VtxBuffer.resize((int)(vtx_write - draw_list->VtxBuffer.Data)); draw_list->IdxBuffer.resize((int)(idx_write - draw_list->IdxBuffer.Data)); draw_list->CmdBuffer[draw_list->CmdBuffer.Size-1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size); draw_list->_VtxWritePtr = vtx_write; draw_list->_IdxWritePtr = idx_write; draw_list->_VtxCurrentIdx = (unsigned int)draw_list->VtxBuffer.Size; } //----------------------------------------------------------------------------- // Internals Drawing Helpers //----------------------------------------------------------------------------- static inline float ImAcos01(float x) { if (x <= 0.0f) return IM_PI * 0.5f; if (x >= 1.0f) return 0.0f; return acosf(x); //return (-0.69813170079773212f * x * x - 0.87266462599716477f) * x + 1.5707963267948966f; // Cheap approximation, may be enough for what we do. } // FIXME: Cleanup and move code to ImDrawList. void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding) { if (x_end_norm == x_start_norm) return; if (x_start_norm > x_end_norm) ImSwap(x_start_norm, x_end_norm); ImVec2 p0 = ImVec2(ImLerp(rect.Min.x, rect.Max.x, x_start_norm), rect.Min.y); ImVec2 p1 = ImVec2(ImLerp(rect.Min.x, rect.Max.x, x_end_norm), rect.Max.y); if (rounding == 0.0f) { draw_list->AddRectFilled(p0, p1, col, 0.0f); return; } rounding = ImClamp(ImMin((rect.Max.x - rect.Min.x) * 0.5f, (rect.Max.y - rect.Min.y) * 0.5f) - 1.0f, 0.0f, rounding); const float inv_rounding = 1.0f / rounding; const float arc0_b = ImAcos01(1.0f - (p0.x - rect.Min.x) * inv_rounding); const float arc0_e = ImAcos01(1.0f - (p1.x - rect.Min.x) * inv_rounding); const float x0 = ImMax(p0.x, rect.Min.x + rounding); if (arc0_b == arc0_e) { draw_list->PathLineTo(ImVec2(x0, p1.y)); draw_list->PathLineTo(ImVec2(x0, p0.y)); } else if (arc0_b == 0.0f && arc0_e == IM_PI*0.5f) { draw_list->PathArcToFast(ImVec2(x0, p1.y - rounding), rounding, 3, 6); // BL draw_list->PathArcToFast(ImVec2(x0, p0.y + rounding), rounding, 6, 9); // TR } else { draw_list->PathArcTo(ImVec2(x0, p1.y - rounding), rounding, IM_PI - arc0_e, IM_PI - arc0_b, 3); // BL draw_list->PathArcTo(ImVec2(x0, p0.y + rounding), rounding, IM_PI + arc0_b, IM_PI + arc0_e, 3); // TR } if (p1.x > rect.Min.x + rounding) { const float arc1_b = ImAcos01(1.0f - (rect.Max.x - p1.x) * inv_rounding); const float arc1_e = ImAcos01(1.0f - (rect.Max.x - p0.x) * inv_rounding); const float x1 = ImMin(p1.x, rect.Max.x - rounding); if (arc1_b == arc1_e) { draw_list->PathLineTo(ImVec2(x1, p0.y)); draw_list->PathLineTo(ImVec2(x1, p1.y)); } else if (arc1_b == 0.0f && arc1_e == IM_PI*0.5f) { draw_list->PathArcToFast(ImVec2(x1, p0.y + rounding), rounding, 9, 12); // TR draw_list->PathArcToFast(ImVec2(x1, p1.y - rounding), rounding, 0, 3); // BR } else { draw_list->PathArcTo(ImVec2(x1, p0.y + rounding), rounding, -arc1_e, -arc1_b, 3); // TR draw_list->PathArcTo(ImVec2(x1, p1.y - rounding), rounding, +arc1_b, +arc1_e, 3); // BR } } draw_list->PathFillConvex(col); } //----------------------------------------------------------------------------- // DEFAULT FONT DATA //----------------------------------------------------------------------------- // Compressed with stb_compress() then converted to a C array. // Use the program in misc/fonts/binary_to_compressed_c.cpp to create the array from a TTF file. // Decompression from stb.h (public domain) by Sean Barrett https://github.com/nothings/stb/blob/master/stb.h //----------------------------------------------------------------------------- static unsigned int stb_decompress_length(const unsigned char *input) { return (input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11]; } static unsigned char *stb__barrier_out_e, *stb__barrier_out_b; static const unsigned char *stb__barrier_in_b; static unsigned char *stb__dout; static void stb__match(const unsigned char *data, unsigned int length) { // INVERSE of memmove... write each byte before copying the next... IM_ASSERT(stb__dout + length <= stb__barrier_out_e); if (stb__dout + length > stb__barrier_out_e) { stb__dout += length; return; } if (data < stb__barrier_out_b) { stb__dout = stb__barrier_out_e+1; return; } while (length--) *stb__dout++ = *data++; } static void stb__lit(const unsigned char *data, unsigned int length) { IM_ASSERT(stb__dout + length <= stb__barrier_out_e); if (stb__dout + length > stb__barrier_out_e) { stb__dout += length; return; } if (data < stb__barrier_in_b) { stb__dout = stb__barrier_out_e+1; return; } memcpy(stb__dout, data, length); stb__dout += length; } #define stb__in2(x) ((i[x] << 8) + i[(x)+1]) #define stb__in3(x) ((i[x] << 16) + stb__in2((x)+1)) #define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1)) static const unsigned char *stb_decompress_token(const unsigned char *i) { if (*i >= 0x20) { // use fewer if's for cases that expand small if (*i >= 0x80) stb__match(stb__dout-i[1]-1, i[0] - 0x80 + 1), i += 2; else if (*i >= 0x40) stb__match(stb__dout-(stb__in2(0) - 0x4000 + 1), i[2]+1), i += 3; else /* *i >= 0x20 */ stb__lit(i+1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1); } else { // more ifs for cases that expand large, since overhead is amortized if (*i >= 0x18) stb__match(stb__dout-(stb__in3(0) - 0x180000 + 1), i[3]+1), i += 4; else if (*i >= 0x10) stb__match(stb__dout-(stb__in3(0) - 0x100000 + 1), stb__in2(3)+1), i += 5; else if (*i >= 0x08) stb__lit(i+2, stb__in2(0) - 0x0800 + 1), i += 2 + (stb__in2(0) - 0x0800 + 1); else if (*i == 0x07) stb__lit(i+3, stb__in2(1) + 1), i += 3 + (stb__in2(1) + 1); else if (*i == 0x06) stb__match(stb__dout-(stb__in3(1)+1), i[4]+1), i += 5; else if (*i == 0x04) stb__match(stb__dout-(stb__in3(1)+1), stb__in2(4)+1), i += 6; } return i; } static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen) { const unsigned long ADLER_MOD = 65521; unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16; unsigned long blocklen, i; blocklen = buflen % 5552; while (buflen) { for (i=0; i + 7 < blocklen; i += 8) { s1 += buffer[0], s2 += s1; s1 += buffer[1], s2 += s1; s1 += buffer[2], s2 += s1; s1 += buffer[3], s2 += s1; s1 += buffer[4], s2 += s1; s1 += buffer[5], s2 += s1; s1 += buffer[6], s2 += s1; s1 += buffer[7], s2 += s1; buffer += 8; } for (; i < blocklen; ++i) s1 += *buffer++, s2 += s1; s1 %= ADLER_MOD, s2 %= ADLER_MOD; buflen -= blocklen; blocklen = 5552; } return (unsigned int)(s2 << 16) + (unsigned int)s1; } static unsigned int stb_decompress(unsigned char *output, const unsigned char *i, unsigned int /*length*/) { unsigned int olen; if (stb__in4(0) != 0x57bC0000) return 0; if (stb__in4(4) != 0) return 0; // error! stream is > 4GB olen = stb_decompress_length(i); stb__barrier_in_b = i; stb__barrier_out_e = output + olen; stb__barrier_out_b = output; i += 16; stb__dout = output; for (;;) { const unsigned char *old_i = i; i = stb_decompress_token(i); if (i == old_i) { if (*i == 0x05 && i[1] == 0xfa) { IM_ASSERT(stb__dout == output + olen); if (stb__dout != output + olen) return 0; if (stb_adler32(1, output, olen) != (unsigned int) stb__in4(2)) return 0; return olen; } else { IM_ASSERT(0); /* NOTREACHED */ return 0; } } IM_ASSERT(stb__dout <= output + olen); if (stb__dout > output + olen) return 0; } } //----------------------------------------------------------------------------- // ProggyClean.ttf // Copyright (c) 2004, 2005 Tristan Grimmer // MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip) // Download and more information at http://upperbounds.net //----------------------------------------------------------------------------- // File: 'ProggyClean.ttf' (41208 bytes) // Exported using binary_to_compressed_c.cpp //----------------------------------------------------------------------------- static const char proggy_clean_ttf_compressed_data_base85[11980+1] = "7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/" "2*>]b(MC;$jPfY.;h^`IWM9Qo#t'X#(v#Y9w0#1D$CIf;W'#pWUPXOuxXuU(H9M(1=Ke$$'5F%)]0^#0X@U.a$FBjVQTSDgEKnIS7EM9>ZY9w0#L;>>#Mx&4Mvt//L[MkA#W@lK.N'[0#7RL_&#w+F%HtG9M#XL`N&.,GM4Pg;--VsM.M0rJfLH2eTM`*oJMHRC`N" "kfimM2J,W-jXS:)r0wK#@Fge$U>`w'N7G#$#fB#$E^$#:9:hk+eOe--6x)F7*E%?76%^GMHePW-Z5l'&GiF#$956:rS?dA#fiK:)Yr+`�j@'DbG&#^$PG.Ll+DNa&VZ>1i%h1S9u5o@YaaW$e+bROPOpxTO7Stwi1::iB1q)C_=dV26J;2,]7op$]uQr@_V7$q^%lQwtuHY]=DX,n3L#0PHDO4f9>dC@O>HBuKPpP*E,N+b3L#lpR/MrTEH.IAQk.a>D[.e;mc." "x]Ip.PH^'/aqUO/$1WxLoW0[iLAw=4h(9.`G" "CRUxHPeR`5Mjol(dUWxZa(>STrPkrJiWx`5U7F#.g*jrohGg`cg:lSTvEY/EV_7H4Q9[Z%cnv;JQYZ5q.l7Zeas:HOIZOB?Ggv:[7MI2k).'2($5FNP&EQ(,)" "U]W]+fh18.vsai00);D3@4ku5P?DP8aJt+;qUM]=+b'8@;mViBKx0DE[-auGl8:PJ&Dj+M6OC]O^((##]`0i)drT;-7X`=-H3[igUnPG-NZlo.#k@h#=Ork$m>a>$-?Tm$UV(?#P6YY#" "'/###xe7q.73rI3*pP/$1>s9)W,JrM7SN]'/4C#v$U`0#V.[0>xQsH$fEmPMgY2u7Kh(G%siIfLSoS+MK2eTM$=5,M8p`A.;_R%#u[K#$x4AG8.kK/HSB==-'Ie/QTtG?-.*^N-4B/ZM" "_3YlQC7(p7q)&](`6_c)$/*JL(L-^(]$wIM`dPtOdGA,U3:w2M-0+WomX2u7lqM2iEumMTcsF?-aT=Z-97UEnXglEn1K-bnEO`gu" "Ft(c%=;Am_Qs@jLooI&NX;]0#j4#F14;gl8-GQpgwhrq8'=l_f-b49'UOqkLu7-##oDY2L(te+Mch&gLYtJ,MEtJfLh'x'M=$CS-ZZ%P]8bZ>#S?YY#%Q&q'3^Fw&?D)UDNrocM3A76/" "/oL?#h7gl85[qW/NDOk%16ij;+:1a'iNIdb-ou8.P*w,v5#EI$TWS>Pot-R*H'-SEpA:g)f+O$%%`kA#G=8RMmG1&O`>to8bC]T&$,n.LoO>29sp3dt-52U%VM#q7'DHpg+#Z9%H[Ket`e;)f#Km8&+DC$I46>#Kr]]u-[=99tts1.qb#q72g1WJO81q+eN'03'eM>&1XxY-caEnO" "j%2n8)),?ILR5^.Ibn<-X-Mq7[a82Lq:F&#ce+S9wsCK*x`569E8ew'He]h:sI[2LM$[guka3ZRd6:t%IG:;$%YiJ:Nq=?eAw;/:nnDq0(CYcMpG)qLN4$##&J-XTt,%OVU4)S1+R-#dg0/Nn?Ku1^0f$B*P:Rowwm-`0PKjYDDM'3]d39VZHEl4,.j']Pk-M.h^&:0FACm$maq-&sgw0t7/6(^xtk%" "LuH88Fj-ekm>GA#_>568x6(OFRl-IZp`&b,_P'$MhLbxfc$mj`,O;&%W2m`Zh:/)Uetw:aJ%]K9h:TcF]u_-Sj9,VK3M.*'&0D[Ca]J9gp8,kAW]" "%(?A%R$f<->Zts'^kn=-^@c4%-pY6qI%J%1IGxfLU9CP8cbPlXv);C=b),<2mOvP8up,UVf3839acAWAW-W?#ao/^#%KYo8fRULNd2.>%m]UK:n%r$'sw]J;5pAoO_#2mO3n,'=H5(et" "Hg*`+RLgv>=4U8guD$I%D:W>-r5V*%j*W:Kvej.Lp$'?;++O'>()jLR-^u68PHm8ZFWe+ej8h:9r6L*0//c&iH&R8pRbA#Kjm%upV1g:" "a_#Ur7FuA#(tRh#.Y5K+@?3<-8m0$PEn;J:rh6?I6uG<-`wMU'ircp0LaE_OtlMb&1#6T.#FDKu#1Lw%u%+GM+X'e?YLfjM[VO0MbuFp7;>Q&#WIo)0@F%q7c#4XAXN-U&VBpqB>0ie&jhZ[?iLR@@_AvA-iQC(=ksRZRVp7`.=+NpBC%rh&3]R:8XDmE5^V8O(x<-+k?'(^](H.aREZSi,#1:[IXaZFOm<-ui#qUq2$##Ri;u75OK#(RtaW-K-F`S+cF]uN`-KMQ%rP/Xri.LRcB##=YL3BgM/3M" "D?@f&1'BW-)Ju#bmmWCMkk&#TR`C,5d>g)F;t,4:@_l8G/5h4vUd%&%950:VXD'QdWoY-F$BtUwmfe$YqL'8(PWX(" "P?^@Po3$##`MSs?DWBZ/S>+4%>fX,VWv/w'KD`LP5IbH;rTV>n3cEK8U#bX]l-/V+^lj3;vlMb&[5YQ8#pekX9JP3XUC72L,,?+Ni&co7ApnO*5NK,((W-i:$,kp'UDAO(G0Sq7MVjJs" "bIu)'Z,*[>br5fX^:FPAWr-m2KgLQ_nN6'8uTGT5g)uLv:873UpTLgH+#FgpH'_o1780Ph8KmxQJ8#H72L4@768@Tm&Q" "h4CB/5OvmA&,Q&QbUoi$a_%3M01H)4x7I^&KQVgtFnV+;[Pc>[m4k//,]1?#`VY[Jr*3&&slRfLiVZJ:]?=K3Sw=[$=uRB?3xk48@aege0jT6'N#(q%.O=?2S]u*(m<-" "V8J'(1)G][68hW$5'q[GC&5j`TE?m'esFGNRM)j,ffZ?-qx8;->g4t*:CIP/[Qap7/9'#(1sao7w-.qNUdkJ)tCF&#B^;xGvn2r9FEPFFFcL@.iFNkTve$m%#QvQS8U@)2Z+3K:AKM5i" "sZ88+dKQ)W6>J%CL`.d*(B`-n8D9oK-XV1q['-5k'cAZ69e;D_?$ZPP&s^+7])$*$#@QYi9,5P r+$%CE=68>K8r0=dSC%%(@p7" ".m7jilQ02'0-VWAgTlGW'b)Tq7VT9q^*^$$.:&N@@" "$&)WHtPm*5_rO0&e%K&#-30j(E4#'Zb.o/(Tpm$>K'f@[PvFl,hfINTNU6u'0pao7%XUp9]5.>%h`8_=VYbxuel.NTSsJfLacFu3B'lQSu/m6-Oqem8T+oE--$0a/k]uj9EwsG>%veR*" "hv^BFpQj:K'#SJ,sB-'#](j.Lg92rTw-*n%@/;39rrJF,l#qV%OrtBeC6/,;qB3ebNW[?,Hqj2L.1NP&GjUR=1D8QaS3Up&@*9wP?+lo7b?@%'k4`p0Z$22%K3+iCZj?XJN4Nm&+YF]u" "@-W$U%VEQ/,,>>#)D#%8cY#YZ?=,`Wdxu/ae&#" "w6)R89tI#6@s'(6Bf7a&?S=^ZI_kS&ai`&=tE72L_D,;^R)7[$so8lKN%5/$(vdfq7+ebA#" "u1p]ovUKW&Y%q]'>$1@-[xfn$7ZTp7mM,G,Ko7a&Gu%G[RMxJs[0MM%wci.LFDK)(%:_i2B5CsR8&9Z&#=mPEnm0f`<&c)QL5uJ#%u%lJj+D-r;BoFDoS97h5g)E#o:&S4weDF,9^Hoe`h*L+_a*NrLW-1pG_&2UdB8" "6e%B/:=>)N4xeW.*wft-;$'58-ESqr#U`'6AQ]m&6/`Z>#S?YY#Vc;r7U2&326d=w&H####?TZ`*4?&.MK?LP8Vxg>$[QXc%QJv92.(Db*B)gb*BM9dM*hJMAo*c&#" "b0v=Pjer]$gG&JXDf->'StvU7505l9$AFvgYRI^&<^b68?j#q9QX4SM'RO#&sL1IM.rJfLUAj221]d##DW=m83u5;'bYx,*Sl0hL(W;;$doB&O/TQ:(Z^xBdLjLV#*8U_72Lh+2Q8Cj0i:6hp&$C/:p(HK>T8Y[gHQ4`4)'$Ab(Nof%V'8hL&#SfD07&6D@M.*J:;$-rv29'M]8qMv-tLp,'886iaC=Hb*YJoKJ,(j%K=H`K.v9HggqBIiZu'QvBT.#=)0ukruV&.)3=(^1`o*Pj4<-#MJ+gLq9-##@HuZPN0]u:h7.T..G:;$/Usj(T7`Q8tT72LnYl<-qx8;-HV7Q-&Xdx%1a,hC=0u+HlsV>nuIQL-5" "_>@kXQtMacfD.m-VAb8;IReM3$wf0''hra*so568'Ip&vRs849'MRYSp%:t:h5qSgwpEr$B>Q,;s(C#$)`svQuF$##-D,##,g68@2[T;.XSdN9Qe)rpt._K-#5wF)sP'##p#C0c%-Gb%" "hd+<-j'Ai*x&&HMkT]C'OSl##5RG[JXaHN;d'uA#x._U;.`PU@(Z3dt4r152@:v,'R.Sj'w#0<-;kPI)FfJ&#AYJ&#//)>-k=m=*XnK$>=)72L]0I%>.G690a:$##<,);?;72#?x9+d;" "^V'9;jY@;)br#q^YQpx:X#Te$Z^'=-=bGhLf:D6&bNwZ9-ZD#n^9HhLMr5G;']d&6'wYmTFmLq9wI>P(9mI[>kC-ekLC/R&CH+s'B;K-M6$EB%is00:" "+A4[7xks.LrNk0&E)wILYF@2L'0Nb$+pv<(2.768/FrY&h$^3i&@+G%JT'<-,v`3;_)I9M^AE]CN?Cl2AZg+%4iTpT3$U4O]GKx'm9)b@p7YsvK3w^YR-" "CdQ*:Ir<($u&)#(&?L9Rg3H)4fiEp^iI9O8KnTj,]H?D*r7'M;PwZ9K0E^k&-cpI;.p/6_vwoFMV<->#%Xi.LxVnrU(4&8/P+:hLSKj$#U%]49t'I:rgMi'FL@a:0Y-uA[39',(vbma*" "hU%<-SRF`Tt:542R_VV$p@[p8DV[A,?1839FWdFTi1O*H&#(AL8[_P%.M>v^-))qOT*F5Cq0`Ye%+$B6i:7@0IXSsDiWP,##P`%/L-" "S(qw%sf/@%#B6;/U7K]uZbi^Oc^2n%t<)'mEVE''n`WnJra$^TKvX5B>;_aSEK',(hwa0:i4G?.Bci.(X[?b*($,=-n<.Q%`(X=?+@Am*Js0&=3bh8K]mL69=Lb,OcZV/);TTm8VI;?%OtJ<(b4mq7M6:u?KRdFl*:xP?Yb.5)%w_I?7uk5JC+FS(m#i'k.'a0i)9<7b'fs'59hq$*5Uhv##pi^8+hIEBF`nvo`;'l0.^S1<-wUK2/Coh58KKhLj" "M=SO*rfO`+qC`W-On.=AJ56>>i2@2LH6A:&5q`?9I3@@'04&p2/LVa*T-4<-i3;M9UvZd+N7>b*eIwg:CC)c<>nO&#$(>.Z-I&J(Q0Hd5Q%7Co-b`-cP)hI;*_F]u`Rb[.j8_Q/<&>uu+VsH$sM9TA%?)(vmJ80),P7E>)tjD%2L=-t#fK[%`v=Q8WlA2);Sa" ">gXm8YB`1d@K#n]76-a$U,mF%Ul:#/'xoFM9QX-$.QN'>" "[%$Z$uF6pA6Ki2O5:8w*vP1<-1`[G,)-m#>0`P&#eb#.3i)rtB61(o'$?X3B2Qft^ae_5tKL9MUe9b*sLEQ95C&`=G?@Mj=wh*'3E>=-<)Gt*Iw)'QG:`@I" "wOf7&]1i'S01B+Ev/Nac#9S;=;YQpg_6U`*kVY39xK,[/6Aj7:'1Bm-_1EYfa1+o&o4hp7KN_Q(OlIo@S%;jVdn0'1h19w,WQhLI)3S#f$2(eb,jr*b;3Vw]*7NH%$c4Vs,eD9>XW8?N]o+(*pgC%/72LV-uW%iewS8W6m2rtCpo'RS1R84=@paTKt)>=%&1[)*vp'u+x,VrwN;&]kuO9JDbg=pO$J*.jVe;u'm0dr9l,<*wMK*Oe=g8lV_KEBFkO'oU]^=[-792#ok,)" "i]lR8qQ2oA8wcRCZ^7w/Njh;?.stX?Q1>S1q4Bn$)K1<-rGdO'$Wr.Lc.CG)$/*JL4tNR/,SVO3,aUw'DJN:)Ss;wGn9A32ijw%FL+Z0Fn.U9;reSq)bmI32U==5ALuG&#Vf1398/pVo" "1*c-(aY168o<`JsSbk-,1N;$>0:OUas(3:8Z972LSfF8eb=c-;>SPw7.6hn3m`9^Xkn(r.qS[0;T%&Qc=+STRxX'q1BNk3&*eu2;&8q$&x>Q#Q7^Tf+6<(d%ZVmj2bDi%.3L2n+4W'$P" "iDDG)g,r%+?,$@?uou5tSe2aN_AQU*'IAO" "URQ##V^Fv-XFbGM7Fl(N<3DhLGF%q.1rC$#:T__&Pi68%0xi_&[qFJ(77j_&JWoF.V735&T,[R*:xFR*K5>>#`bW-?4Ne_&6Ne_&6Ne_&n`kr-#GJcM6X;uM6X;uM(.a..^2TkL%oR(#" ";u.T%fAr%4tJ8&><1=GHZ_+m9/#H1F^R#SC#*N=BA9(D?v[UiFY>>^8p,KKF.W]L29uLkLlu/+4T" "w$)F./^n3+rlo+DB;5sIYGNk+i1t-69Jg--0pao7Sm#K)pdHW&;LuDNH@H>#/X-TI(;P>#,Gc>#0Su>#4`1?#8lC?#xL$#B.`$#F:r$#JF.%#NR@%#R_R%#Vke%#Zww%#_-4^Rh%Sflr-k'MS.o?.5/sWel/wpEM0%3'/1)K^f1-d>G21&v(35>V`39V7A4=onx4" "A1OY5EI0;6Ibgr6M$HS7Q<)58C5w,;WoA*#[%T*#`1g*#d=#+#hI5+#lUG+#pbY+#tnl+#x$),#&1;,#*=M,#.I`,#2Ur,#6b.-#;w[H#iQtA#m^0B#qjBB#uvTB##-hB#'9$C#+E6C#" "/QHC#3^ZC#7jmC#;v)D#?,)4kMYD4lVu`4m`:&5niUA5@(A5BA1]PBB:xlBCC=2CDLXMCEUtiCf&0g2'tN?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP" "GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp" "O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#"; static const char* GetDefaultCompressedFontDataTTFBase85() { return proggy_clean_ttf_compressed_data_base85; } goxel-0.8.1/ext_src/imgui/imgui_internal.h000066400000000000000000002204731334742672700206250ustar00rootroot00000000000000// dear imgui, v1.61 WIP // (internals) // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! // Set: // #define IMGUI_DEFINE_MATH_OPERATORS // To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators) #pragma once #ifndef IMGUI_VERSION #error Must include imgui.h before imgui_internal.h #endif #include // FILE* #include // sqrtf, fabsf, fmodf, powf, floorf, ceilf, cosf, sinf #include // INT_MIN, INT_MAX #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h #pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h #pragma clang diagnostic ignored "-Wold-style-cast" #endif //----------------------------------------------------------------------------- // Forward Declarations //----------------------------------------------------------------------------- struct ImRect; struct ImGuiColMod; struct ImGuiStyleMod; struct ImGuiGroupData; struct ImGuiMenuColumns; struct ImGuiDrawContext; struct ImGuiTextEditState; struct ImGuiPopupRef; struct ImGuiWindow; struct ImGuiWindowSettings; typedef int ImGuiLayoutType; // enum: horizontal or vertical // enum ImGuiLayoutType_ typedef int ImGuiButtonFlags; // flags: for ButtonEx(), ButtonBehavior() // enum ImGuiButtonFlags_ typedef int ImGuiItemFlags; // flags: for PushItemFlag() // enum ImGuiItemFlags_ typedef int ImGuiItemStatusFlags; // flags: storage for DC.LastItemXXX // enum ImGuiItemStatusFlags_ typedef int ImGuiNavHighlightFlags; // flags: for RenderNavHighlight() // enum ImGuiNavHighlightFlags_ typedef int ImGuiNavDirSourceFlags; // flags: for GetNavInputAmount2d() // enum ImGuiNavDirSourceFlags_ typedef int ImGuiSeparatorFlags; // flags: for Separator() - internal // enum ImGuiSeparatorFlags_ typedef int ImGuiSliderFlags; // flags: for SliderBehavior() // enum ImGuiSliderFlags_ //------------------------------------------------------------------------- // STB libraries //------------------------------------------------------------------------- namespace ImGuiStb { #undef STB_TEXTEDIT_STRING #undef STB_TEXTEDIT_CHARTYPE #define STB_TEXTEDIT_STRING ImGuiTextEditState #define STB_TEXTEDIT_CHARTYPE ImWchar #define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f #include "stb_textedit.h" } // namespace ImGuiStb //----------------------------------------------------------------------------- // Context //----------------------------------------------------------------------------- #ifndef GImGui extern IMGUI_API ImGuiContext* GImGui; // Current implicit ImGui context pointer #endif //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- #define IM_PI 3.14159265358979323846f #ifdef _WIN32 #define IM_NEWLINE "\r\n" // Play it nice with Windows users (2018: Notepad _still_ doesn't display files properly when they use Unix-style carriage returns) #else #define IM_NEWLINE "\n" #endif // Helpers: UTF-8 <> wchar IMGUI_API int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count IMGUI_API int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // return input UTF-8 bytes count IMGUI_API int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_remaining = NULL); // return input UTF-8 bytes count IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count) IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string as UTF-8 code-points // Helpers: Misc IMGUI_API ImU32 ImHash(const void* data, int data_size, ImU32 seed = 0); // Pass data_size==0 for zero-terminated strings IMGUI_API void* ImFileLoadToMemory(const char* filename, const char* file_open_mode, int* out_file_size = NULL, int padding_bytes = 0); IMGUI_API FILE* ImFileOpen(const char* filename, const char* file_open_mode); static inline bool ImCharIsSpace(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; } static inline bool ImIsPowerOfTwo(int v) { return v != 0 && (v & (v - 1)) == 0; } static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; } // Helpers: Geometry IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p); IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w); // Helpers: String IMGUI_API int ImStricmp(const char* str1, const char* str2); IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count); IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count); IMGUI_API char* ImStrdup(const char* str); IMGUI_API const char* ImStrchrRange(const char* str_begin, const char* str_end, char c); IMGUI_API int ImStrlenW(const ImWchar* str); IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end); IMGUI_API int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) IM_FMTARGS(3); IMGUI_API int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) IM_FMTLIST(3); // Helpers: Math // We are keeping those not leaking to the user by default, in the case the user has implicit cast operators between ImVec2 and its own types (when IM_VEC2_CLASS_EXTRA is defined) #ifdef IMGUI_DEFINE_MATH_OPERATORS static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x*rhs, lhs.y*rhs); } static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x/rhs, lhs.y/rhs); } static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); } static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); } static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x*rhs.x, lhs.y*rhs.y); } static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x/rhs.x, lhs.y/rhs.y); } static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; } static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; } static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; } static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; } static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z, lhs.w+rhs.w); } static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x-rhs.x, lhs.y-rhs.y, lhs.z-rhs.z, lhs.w-rhs.w); } static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z, lhs.w*rhs.w); } #endif static inline int ImMin(int lhs, int rhs) { return lhs < rhs ? lhs : rhs; } static inline int ImMax(int lhs, int rhs) { return lhs >= rhs ? lhs : rhs; } static inline float ImMin(float lhs, float rhs) { return lhs < rhs ? lhs : rhs; } static inline float ImMax(float lhs, float rhs) { return lhs >= rhs ? lhs : rhs; } static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); } static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x >= rhs.x ? lhs.x : rhs.x, lhs.y >= rhs.y ? lhs.y : rhs.y); } static inline int ImClamp(int v, int mn, int mx) { return (v < mn) ? mn : (v > mx) ? mx : v; } static inline float ImClamp(float v, float mn, float mx) { return (v < mn) ? mn : (v > mx) ? mx : v; } static inline ImVec2 ImClamp(const ImVec2& f, const ImVec2& mn, ImVec2 mx) { return ImVec2(ImClamp(f.x,mn.x,mx.x), ImClamp(f.y,mn.y,mx.y)); } static inline float ImSaturate(float f) { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; } static inline void ImSwap(int& a, int& b) { int tmp = a; a = b; b = tmp; } static inline void ImSwap(float& a, float& b) { float tmp = a; a = b; b = tmp; } static inline int ImLerp(int a, int b, float t) { return (int)(a + (b - a) * t); } static inline float ImLerp(float a, float b, float t) { return a + (b - a) * t; } static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) { return ImVec2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t); } static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); } static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) { return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, a.w + (b.w - a.w) * t); } static inline float ImLengthSqr(const ImVec2& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y; } static inline float ImLengthSqr(const ImVec4& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y + lhs.z*lhs.z + lhs.w*lhs.w; } static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = lhs.x*lhs.x + lhs.y*lhs.y; if (d > 0.0f) return 1.0f / sqrtf(d); return fail_value; } static inline float ImFloor(float f) { return (float)(int)f; } static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)v.x, (float)(int)v.y); } static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; } static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_a); } static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; } static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); } //----------------------------------------------------------------------------- // Types //----------------------------------------------------------------------------- enum ImGuiButtonFlags_ { ImGuiButtonFlags_Repeat = 1 << 0, // hold to repeat ImGuiButtonFlags_PressedOnClickRelease = 1 << 1, // return true on click + release on same item [DEFAULT if no PressedOn* flag is set] ImGuiButtonFlags_PressedOnClick = 1 << 2, // return true on click (default requires click+release) ImGuiButtonFlags_PressedOnRelease = 1 << 3, // return true on release (default requires click+release) ImGuiButtonFlags_PressedOnDoubleClick = 1 << 4, // return true on double-click (default requires click+release) ImGuiButtonFlags_FlattenChildren = 1 << 5, // allow interactions even if a child window is overlapping ImGuiButtonFlags_AllowItemOverlap = 1 << 6, // require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap() ImGuiButtonFlags_DontClosePopups = 1 << 7, // disable automatically closing parent popup on press // [UNUSED] ImGuiButtonFlags_Disabled = 1 << 8, // disable interactions ImGuiButtonFlags_AlignTextBaseLine = 1 << 9, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine ImGuiButtonFlags_NoKeyModifiers = 1 << 10, // disable interaction if a key modifier is held ImGuiButtonFlags_NoHoldingActiveID = 1 << 11, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only) ImGuiButtonFlags_PressedOnDragDropHold = 1 << 12, // press when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers) ImGuiButtonFlags_NoNavFocus = 1 << 13 // don't override navigation focus when activated }; enum ImGuiSliderFlags_ { ImGuiSliderFlags_Vertical = 1 << 0 }; enum ImGuiColumnsFlags_ { // Default: 0 ImGuiColumnsFlags_NoBorder = 1 << 0, // Disable column dividers ImGuiColumnsFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers ImGuiColumnsFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns ImGuiColumnsFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window ImGuiColumnsFlags_GrowParentContentsSize= 1 << 4 // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove. }; enum ImGuiSelectableFlagsPrivate_ { // NB: need to be in sync with last value of ImGuiSelectableFlags_ ImGuiSelectableFlags_Menu = 1 << 3, // -> PressedOnClick ImGuiSelectableFlags_MenuItem = 1 << 4, // -> PressedOnRelease ImGuiSelectableFlags_Disabled = 1 << 5, ImGuiSelectableFlags_DrawFillAvailWidth = 1 << 6 }; enum ImGuiSeparatorFlags_ { ImGuiSeparatorFlags_Horizontal = 1 << 0, // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar ImGuiSeparatorFlags_Vertical = 1 << 1 }; // Storage for LastItem data enum ImGuiItemStatusFlags_ { ImGuiItemStatusFlags_HoveredRect = 1 << 0, ImGuiItemStatusFlags_HasDisplayRect = 1 << 1 }; // FIXME: this is in development, not exposed/functional as a generic feature yet. enum ImGuiLayoutType_ { ImGuiLayoutType_Vertical, ImGuiLayoutType_Horizontal }; enum ImGuiAxis { ImGuiAxis_None = -1, ImGuiAxis_X = 0, ImGuiAxis_Y = 1 }; enum ImGuiPlotType { ImGuiPlotType_Lines, ImGuiPlotType_Histogram }; enum ImGuiDataType { ImGuiDataType_Int, ImGuiDataType_Float, ImGuiDataType_Double, ImGuiDataType_COUNT }; enum ImGuiInputSource { ImGuiInputSource_None = 0, ImGuiInputSource_Mouse, ImGuiInputSource_Nav, ImGuiInputSource_NavKeyboard, // Only used occasionally for storage, not tested/handled by most code ImGuiInputSource_NavGamepad, // " ImGuiInputSource_COUNT }; // FIXME-NAV: Clarify/expose various repeat delay/rate enum ImGuiInputReadMode { ImGuiInputReadMode_Down, ImGuiInputReadMode_Pressed, ImGuiInputReadMode_Released, ImGuiInputReadMode_Repeat, ImGuiInputReadMode_RepeatSlow, ImGuiInputReadMode_RepeatFast }; enum ImGuiNavHighlightFlags_ { ImGuiNavHighlightFlags_TypeDefault = 1 << 0, ImGuiNavHighlightFlags_TypeThin = 1 << 1, ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, ImGuiNavHighlightFlags_NoRounding = 1 << 3 }; enum ImGuiNavDirSourceFlags_ { ImGuiNavDirSourceFlags_Keyboard = 1 << 0, ImGuiNavDirSourceFlags_PadDPad = 1 << 1, ImGuiNavDirSourceFlags_PadLStick = 1 << 2 }; enum ImGuiNavForward { ImGuiNavForward_None, ImGuiNavForward_ForwardQueued, ImGuiNavForward_ForwardActive }; // 2D axis aligned bounding-box // NB: we can't rely on ImVec2 math operators being available here struct IMGUI_API ImRect { ImVec2 Min; // Upper-left ImVec2 Max; // Lower-right ImRect() : Min(FLT_MAX,FLT_MAX), Max(-FLT_MAX,-FLT_MAX) {} ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {} ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {} ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {} ImVec2 GetCenter() const { return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); } ImVec2 GetSize() const { return ImVec2(Max.x - Min.x, Max.y - Min.y); } float GetWidth() const { return Max.x - Min.x; } float GetHeight() const { return Max.y - Min.y; } ImVec2 GetTL() const { return Min; } // Top-left ImVec2 GetTR() const { return ImVec2(Max.x, Min.y); } // Top-right ImVec2 GetBL() const { return ImVec2(Min.x, Max.y); } // Bottom-left ImVec2 GetBR() const { return Max; } // Bottom-right bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; } bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x <= Max.x && r.Max.y <= Max.y; } bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; } void Add(const ImVec2& p) { if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; } void Add(const ImRect& r) { if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; } void Expand(const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; } void Expand(const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; } void Translate(const ImVec2& v) { Min.x += v.x; Min.y += v.y; Max.x += v.x; Max.y += v.y; } void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display. void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped. void Floor() { Min.x = (float)(int)Min.x; Min.y = (float)(int)Min.y; Max.x = (float)(int)Max.x; Max.y = (float)(int)Max.y; } void FixInverted() { if (Min.x > Max.x) ImSwap(Min.x, Max.x); if (Min.y > Max.y) ImSwap(Min.y, Max.y); } bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; } }; // Stacked color modifier, backup of modified data so we can restore it struct ImGuiColMod { ImGuiCol Col; ImVec4 BackupValue; }; // Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable. struct ImGuiStyleMod { ImGuiStyleVar VarIdx; union { int BackupInt[2]; float BackupFloat[2]; }; ImGuiStyleMod(ImGuiStyleVar idx, int v) { VarIdx = idx; BackupInt[0] = v; } ImGuiStyleMod(ImGuiStyleVar idx, float v) { VarIdx = idx; BackupFloat[0] = v; } ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v) { VarIdx = idx; BackupFloat[0] = v.x; BackupFloat[1] = v.y; } }; // Stacked data for BeginGroup()/EndGroup() struct ImGuiGroupData { ImVec2 BackupCursorPos; ImVec2 BackupCursorMaxPos; float BackupIndentX; float BackupGroupOffsetX; float BackupCurrentLineHeight; float BackupCurrentLineTextBaseOffset; float BackupLogLinePosY; bool BackupActiveIdIsAlive; bool AdvanceCursor; }; // Simple column measurement currently used for MenuItem() only. This is very short-sighted/throw-away code and NOT a generic helper. struct IMGUI_API ImGuiMenuColumns { int Count; float Spacing; float Width, NextWidth; float Pos[4], NextWidths[4]; ImGuiMenuColumns(); void Update(int count, float spacing, bool clear); float DeclColumns(float w0, float w1, float w2); float CalcExtraSpace(float avail_w); }; // Internal state of the currently focused/edited text input box struct IMGUI_API ImGuiTextEditState { ImGuiID Id; // widget id owning the text state ImVector Text; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer. ImVector InitialText; // backup of end-user buffer at the time of focus (in UTF-8, unaltered) ImVector TempTextBuffer; int CurLenA, CurLenW; // we need to maintain our buffer length in both UTF-8 and wchar format. int BufSizeA; // end-user buffer size float ScrollX; ImGuiStb::STB_TexteditState StbState; float CursorAnim; bool CursorFollow; bool SelectedAllMouseLock; ImGuiTextEditState() { memset(this, 0, sizeof(*this)); } void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking void CursorClamp() { StbState.cursor = ImMin(StbState.cursor, CurLenW); StbState.select_start = ImMin(StbState.select_start, CurLenW); StbState.select_end = ImMin(StbState.select_end, CurLenW); } bool HasSelection() const { return StbState.select_start != StbState.select_end; } void ClearSelection() { StbState.select_start = StbState.select_end = StbState.cursor; } void SelectAll() { StbState.select_start = 0; StbState.cursor = StbState.select_end = CurLenW; StbState.has_preferred_x = false; } void OnKeyPressed(int key); }; // Data saved in imgui.ini file struct ImGuiWindowSettings { char* Name; ImGuiID Id; ImVec2 Pos; ImVec2 Size; bool Collapsed; ImGuiWindowSettings() { Name = NULL; Id = 0; Pos = Size = ImVec2(0,0); Collapsed = false; } }; struct ImGuiSettingsHandler { const char* TypeName; // Short description stored in .ini file. Disallowed characters: '[' ']' ImGuiID TypeHash; // == ImHash(TypeName, 0, 0) void* (*ReadOpenFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, const char* name); void (*ReadLineFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, void* entry, const char* line); void (*WriteAllFn)(ImGuiContext* ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf); void* UserData; ImGuiSettingsHandler() { memset(this, 0, sizeof(*this)); } }; // Storage for current popup stack struct ImGuiPopupRef { ImGuiID PopupId; // Set on OpenPopup() ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup() ImGuiWindow* ParentWindow; // Set on OpenPopup() int OpenFrameCount; // Set on OpenPopup() ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differenciate multiple menu sets from each others (e.g. inside menu bar vs loose menu items) ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse) ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup }; struct ImGuiColumnData { float OffsetNorm; // Column start offset, normalized 0.0 (far left) -> 1.0 (far right) float OffsetNormBeforeResize; ImGuiColumnsFlags Flags; // Not exposed ImRect ClipRect; ImGuiColumnData() { OffsetNorm = OffsetNormBeforeResize = 0.0f; Flags = 0; } }; struct ImGuiColumnsSet { ImGuiID ID; ImGuiColumnsFlags Flags; bool IsFirstFrame; bool IsBeingResized; int Current; int Count; float MinX, MaxX; float LineMinY, LineMaxY; float StartPosY; // Copy of CursorPos float StartMaxPosX; // Copy of CursorMaxPos ImVector Columns; ImGuiColumnsSet() { Clear(); } void Clear() { ID = 0; Flags = 0; IsFirstFrame = false; IsBeingResized = false; Current = 0; Count = 1; MinX = MaxX = 0.0f; LineMinY = LineMaxY = 0.0f; StartPosY = 0.0f; StartMaxPosX = 0.0f; Columns.clear(); } }; struct IMGUI_API ImDrawListSharedData { ImVec2 TexUvWhitePixel; // UV of white pixel in the atlas ImFont* Font; // Current/default font (optional, for simplified AddText overload) float FontSize; // Current/default font size (optional, for simplified AddText overload) float CurveTessellationTol; ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen() // Const data // FIXME: Bake rounded corners fill/borders in atlas ImVec2 CircleVtx12[12]; ImDrawListSharedData(); }; struct ImDrawDataBuilder { ImVector Layers[2]; // Global layers for: regular, tooltip void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].resize(0); } void ClearFreeMemory() { for (int n = 0; n < IM_ARRAYSIZE(Layers); n++) Layers[n].clear(); } IMGUI_API void FlattenIntoSingleLayer(); }; struct ImGuiNavMoveResult { ImGuiID ID; // Best candidate ImGuiID ParentID; // Best candidate window->IDStack.back() - to compare context ImGuiWindow* Window; // Best candidate window float DistBox; // Best candidate box distance to current NavId float DistCenter; // Best candidate center distance to current NavId float DistAxial; ImRect RectRel; // Best candidate bounding box in window relative space ImGuiNavMoveResult() { Clear(); } void Clear() { ID = ParentID = 0; Window = NULL; DistBox = DistCenter = DistAxial = FLT_MAX; RectRel = ImRect(); } }; // Storage for SetNexWindow** functions struct ImGuiNextWindowData { ImGuiCond PosCond; ImGuiCond SizeCond; ImGuiCond ContentSizeCond; ImGuiCond CollapsedCond; ImGuiCond SizeConstraintCond; ImGuiCond FocusCond; ImGuiCond BgAlphaCond; ImVec2 PosVal; ImVec2 PosPivotVal; ImVec2 SizeVal; ImVec2 ContentSizeVal; bool CollapsedVal; ImRect SizeConstraintRect; // Valid if 'SetNextWindowSizeConstraint' is true ImGuiSizeCallback SizeCallback; void* SizeCallbackUserData; float BgAlphaVal; ImGuiNextWindowData() { PosCond = SizeCond = ContentSizeCond = CollapsedCond = SizeConstraintCond = FocusCond = BgAlphaCond = 0; PosVal = PosPivotVal = SizeVal = ImVec2(0.0f, 0.0f); ContentSizeVal = ImVec2(0.0f, 0.0f); CollapsedVal = false; SizeConstraintRect = ImRect(); SizeCallback = NULL; SizeCallbackUserData = NULL; BgAlphaVal = FLT_MAX; } void Clear() { PosCond = SizeCond = ContentSizeCond = CollapsedCond = SizeConstraintCond = FocusCond = BgAlphaCond = 0; } }; // Main state for ImGui struct ImGuiContext { bool Initialized; bool FontAtlasOwnedByContext; // Io.Fonts-> is owned by the ImGuiContext and will be destructed along with it. ImGuiIO IO; ImGuiStyle Style; ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back() float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window. float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height. ImDrawListSharedData DrawListSharedData; float Time; int FrameCount; int FrameCountEnded; int FrameCountRendered; ImVector Windows; ImVector WindowsSortBuffer; ImVector CurrentWindowStack; ImGuiStorage WindowsById; int WindowsActiveCount; ImGuiWindow* CurrentWindow; // Being drawn into ImGuiWindow* HoveredWindow; // Will catch mouse inputs ImGuiWindow* HoveredRootWindow; // Will catch mouse inputs (for focus/move only) ImGuiID HoveredId; // Hovered widget bool HoveredIdAllowOverlap; ImGuiID HoveredIdPreviousFrame; float HoveredIdTimer; ImGuiID ActiveId; // Active widget ImGuiID ActiveIdPreviousFrame; float ActiveIdTimer; bool ActiveIdIsAlive; // Active widget has been seen this frame bool ActiveIdIsJustActivated; // Set at the time of activation for one frame bool ActiveIdAllowOverlap; // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always) int ActiveIdAllowNavDirFlags; // Active widget allows using directional navigation (e.g. can activate a button and move away from it) ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior) ImGuiWindow* ActiveIdWindow; ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard) ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow. ImVector ColorModifiers; // Stack for PushStyleColor()/PopStyleColor() ImVector StyleModifiers; // Stack for PushStyleVar()/PopStyleVar() ImVector FontStack; // Stack for PushFont()/PopFont() ImVector OpenPopupStack; // Which popups are open (persistent) ImVector CurrentPopupStack; // Which level of BeginPopup() we are in (reset every frame) ImGuiNextWindowData NextWindowData; // Storage for SetNextWindow** functions bool NextTreeNodeOpenVal; // Storage for SetNextTreeNode** functions ImGuiCond NextTreeNodeOpenCond; // Navigation data (for gamepad/keyboard) ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusWindow' ImGuiID NavId; // Focused item for navigation ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0, also set when calling ActivateItem() ImGuiID NavActivateDownId; // ~~ IsNavInputDown(ImGuiNavInput_Activate) ? NavId : 0 ImGuiID NavActivatePressedId; // ~~ IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0 ImGuiID NavInputId; // ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0 ImGuiID NavJustTabbedId; // Just tabbed to this id. ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest) ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? ImRect NavScoringRectScreen; // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring. int NavScoringCount; // Metrics for debugging ImGuiWindow* NavWindowingTarget; // When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed front-most. float NavWindowingHighlightTimer; float NavWindowingHighlightAlpha; bool NavWindowingToggleLayer; int NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later. int NavIdTabCounter; // == NavWindow->DC.FocusIdxTabCounter at time of NavId processing bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRefRectRel is valid bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default) bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover) bool NavDisableMouseHover; // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again. bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest bool NavInitRequest; // Init request for appearing window to select first item bool NavInitRequestFromMove; ImGuiID NavInitResultId; ImRect NavInitResultRectRel; bool NavMoveFromClampedRefRect; // Set by manual scrolling, if we scroll to a point where NavId isn't visible we reset navigation from visible items bool NavMoveRequest; // Move request for this frame ImGuiNavForward NavMoveRequestForward; // None / ForwardQueued / ForwardActive (this is used to navigate sibling parent menus from a child menu) ImGuiDir NavMoveDir, NavMoveDirLast; // Direction of the move request (left/right/up/down), direction of the previous move request ImGuiNavMoveResult NavMoveResultLocal; // Best move request candidate within NavWindow ImGuiNavMoveResult NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using the NavFlattened flag) // Render ImDrawData DrawData; // Main ImDrawData instance to pass render information to the user ImDrawDataBuilder DrawDataBuilder; float ModalWindowDarkeningRatio; ImDrawList OverlayDrawList; // Optional software render of mouse cursors, if io.MouseDrawCursor is set + a few debug overlays ImGuiMouseCursor MouseCursor; // Drag and Drop bool DragDropActive; ImGuiDragDropFlags DragDropSourceFlags; int DragDropMouseButton; ImGuiPayload DragDropPayload; ImRect DragDropTargetRect; ImGuiID DragDropTargetId; float DragDropAcceptIdCurrRectSurface; ImGuiID DragDropAcceptIdCurr; // Target item id (set at the time of accepting the payload) ImGuiID DragDropAcceptIdPrev; // Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets) int DragDropAcceptFrameCount; // Last time a target expressed a desire to accept the source ImVector DragDropPayloadBufHeap; // We don't expose the ImVector<> directly unsigned char DragDropPayloadBufLocal[8]; // Local buffer for small payloads // Widget state ImGuiTextEditState InputTextState; ImFont InputTextPasswordFont; ImGuiID ScalarAsInputTextId; // Temporary text input when CTRL+clicking on a slider, etc. ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets ImVec4 ColorPickerRef; float DragCurrentValue; // Currently dragged value, always float, not rounded by end-user precision settings ImVec2 DragLastMouseDelta; float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio float DragSpeedScaleSlow; float DragSpeedScaleFast; ImVec2 ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage? int TooltipOverrideCount; ImVector PrivateClipboard; // If no custom clipboard handler is defined ImVec2 OsImePosRequest, OsImePosSet; // Cursor position request & last passed to the OS Input Method Editor // Settings bool SettingsLoaded; float SettingsDirtyTimer; // Save .ini Settings on disk when time reaches zero ImVector SettingsWindows; // .ini settings for ImGuiWindow ImVector SettingsHandlers; // List of .ini settings handlers // Logging bool LogEnabled; FILE* LogFile; // If != NULL log to stdout/ file ImGuiTextBuffer* LogClipboard; // Else log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators. int LogStartDepth; int LogAutoExpandMaxDepth; // Misc float FramerateSecPerFrame[120]; // calculate estimate of framerate for user int FramerateSecPerFrameIdx; float FramerateSecPerFrameAccum; int WantCaptureMouseNextFrame; // explicit capture via CaptureInputs() sets those flags int WantCaptureKeyboardNextFrame; int WantTextInputNextFrame; char TempBuffer[1024*3+1]; // temporary text buffer ImGuiContext(ImFontAtlas* shared_font_atlas) : OverlayDrawList(NULL) { Initialized = false; Font = NULL; FontSize = FontBaseSize = 0.0f; FontAtlasOwnedByContext = shared_font_atlas ? false : true; IO.Fonts = shared_font_atlas ? shared_font_atlas : IM_NEW(ImFontAtlas)(); Time = 0.0f; FrameCount = 0; FrameCountEnded = FrameCountRendered = -1; WindowsActiveCount = 0; CurrentWindow = NULL; HoveredWindow = NULL; HoveredRootWindow = NULL; HoveredId = 0; HoveredIdAllowOverlap = false; HoveredIdPreviousFrame = 0; HoveredIdTimer = 0.0f; ActiveId = 0; ActiveIdPreviousFrame = 0; ActiveIdTimer = 0.0f; ActiveIdIsAlive = false; ActiveIdIsJustActivated = false; ActiveIdAllowOverlap = false; ActiveIdAllowNavDirFlags = 0; ActiveIdClickOffset = ImVec2(-1,-1); ActiveIdWindow = NULL; ActiveIdSource = ImGuiInputSource_None; MovingWindow = NULL; NextTreeNodeOpenVal = false; NextTreeNodeOpenCond = 0; NavWindow = NULL; NavId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavInputId = 0; NavJustTabbedId = NavJustMovedToId = NavNextActivateId = 0; NavInputSource = ImGuiInputSource_None; NavScoringRectScreen = ImRect(); NavScoringCount = 0; NavWindowingTarget = NULL; NavWindowingHighlightTimer = NavWindowingHighlightAlpha = 0.0f; NavWindowingToggleLayer = false; NavLayer = 0; NavIdTabCounter = INT_MAX; NavIdIsAlive = false; NavMousePosDirty = false; NavDisableHighlight = true; NavDisableMouseHover = false; NavAnyRequest = false; NavInitRequest = false; NavInitRequestFromMove = false; NavInitResultId = 0; NavMoveFromClampedRefRect = false; NavMoveRequest = false; NavMoveRequestForward = ImGuiNavForward_None; NavMoveDir = NavMoveDirLast = ImGuiDir_None; ModalWindowDarkeningRatio = 0.0f; OverlayDrawList._Data = &DrawListSharedData; OverlayDrawList._OwnerName = "##Overlay"; // Give it a name for debugging MouseCursor = ImGuiMouseCursor_Arrow; DragDropActive = false; DragDropSourceFlags = 0; DragDropMouseButton = -1; DragDropTargetId = 0; DragDropAcceptIdCurrRectSurface = 0.0f; DragDropAcceptIdPrev = DragDropAcceptIdCurr = 0; DragDropAcceptFrameCount = -1; memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal)); ScalarAsInputTextId = 0; ColorEditOptions = ImGuiColorEditFlags__OptionsDefault; DragCurrentValue = 0.0f; DragLastMouseDelta = ImVec2(0.0f, 0.0f); DragSpeedDefaultRatio = 1.0f / 100.0f; DragSpeedScaleSlow = 1.0f / 100.0f; DragSpeedScaleFast = 10.0f; ScrollbarClickDeltaToGrabCenter = ImVec2(0.0f, 0.0f); TooltipOverrideCount = 0; OsImePosRequest = OsImePosSet = ImVec2(-1.0f, -1.0f); SettingsLoaded = false; SettingsDirtyTimer = 0.0f; LogEnabled = false; LogFile = NULL; LogClipboard = NULL; LogStartDepth = 0; LogAutoExpandMaxDepth = 2; memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame)); FramerateSecPerFrameIdx = 0; FramerateSecPerFrameAccum = 0.0f; WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1; memset(TempBuffer, 0, sizeof(TempBuffer)); } }; // Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin(). // This is going to be exposed in imgui.h when stabilized enough. enum ImGuiItemFlags_ { ImGuiItemFlags_AllowKeyboardFocus = 1 << 0, // true ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings. ImGuiItemFlags_Disabled = 1 << 2, // false // FIXME-WIP: Disable interactions but doesn't affect visuals. Should be: grey out and disable interactions with widgets that affect data + view widgets (WIP) ImGuiItemFlags_NoNav = 1 << 3, // false ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // MenuItem/Selectable() automatically closes current Popup window ImGuiItemFlags_Default_ = ImGuiItemFlags_AllowKeyboardFocus }; // Transient per-window data, reset at the beginning of the frame // FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiDrawContext is quite tenuous and could be reconsidered. struct IMGUI_API ImGuiDrawContext { ImVec2 CursorPos; ImVec2 CursorPosPrevLine; ImVec2 CursorStartPos; ImVec2 CursorMaxPos; // Used to implicitly calculate the size of our contents, always growing during the frame. Turned into window->SizeContents at the beginning of next frame float CurrentLineHeight; float CurrentLineTextBaseOffset; float PrevLineHeight; float PrevLineTextBaseOffset; float LogLinePosY; int TreeDepth; ImU32 TreeDepthMayJumpToParentOnPop; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31 ImGuiID LastItemId; ImGuiItemStatusFlags LastItemStatusFlags; ImRect LastItemRect; // Interaction rect ImRect LastItemDisplayRect; // End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect) bool NavHideHighlightOneFrame; bool NavHasScroll; // Set when scrolling can be used (ScrollMax > 0.0f) int NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1) int NavLayerCurrentMask; // = (1 << NavLayerCurrent) used by ItemAdd prior to clipping. int NavLayerActiveMask; // Which layer have been written to (result from previous frame) int NavLayerActiveMaskNext; // Which layer have been written to (buffer for current frame) bool MenuBarAppending; // FIXME: Remove this float MenuBarOffsetX; ImVector ChildWindows; ImGuiStorage* StateStorage; ImGuiLayoutType LayoutType; ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin() // We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings. ImGuiItemFlags ItemFlags; // == ItemFlagsStack.back() [empty == ImGuiItemFlags_Default] float ItemWidth; // == ItemWidthStack.back(). 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window float TextWrapPos; // == TextWrapPosStack.back() [empty == -1.0f] ImVectorItemFlagsStack; ImVector ItemWidthStack; ImVector TextWrapPosStack; ImVectorGroupStack; int StackSizesBackup[6]; // Store size of various stacks for asserting float IndentX; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.) float GroupOffsetX; float ColumnsOffsetX; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API. ImGuiColumnsSet* ColumnsSet; // Current columns set ImGuiDrawContext() { CursorPos = CursorPosPrevLine = CursorStartPos = CursorMaxPos = ImVec2(0.0f, 0.0f); CurrentLineHeight = PrevLineHeight = 0.0f; CurrentLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f; LogLinePosY = -1.0f; TreeDepth = 0; TreeDepthMayJumpToParentOnPop = 0x00; LastItemId = 0; LastItemStatusFlags = 0; LastItemRect = LastItemDisplayRect = ImRect(); NavHideHighlightOneFrame = false; NavHasScroll = false; NavLayerActiveMask = NavLayerActiveMaskNext = 0x00; NavLayerCurrent = 0; NavLayerCurrentMask = 1 << 0; MenuBarAppending = false; MenuBarOffsetX = 0.0f; StateStorage = NULL; LayoutType = ParentLayoutType = ImGuiLayoutType_Vertical; ItemWidth = 0.0f; ItemFlags = ImGuiItemFlags_Default_; TextWrapPos = -1.0f; memset(StackSizesBackup, 0, sizeof(StackSizesBackup)); IndentX = 0.0f; GroupOffsetX = 0.0f; ColumnsOffsetX = 0.0f; ColumnsSet = NULL; } }; // Windows data struct IMGUI_API ImGuiWindow { char* Name; ImGuiID ID; // == ImHash(Name) ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_ ImVec2 PosFloat; ImVec2 Pos; // Position rounded-up to nearest pixel ImVec2 Size; // Current size (==SizeFull or collapsed title bar size) ImVec2 SizeFull; // Size when non collapsed ImVec2 SizeFullAtLastBegin; // Copy of SizeFull at the end of Begin. This is the reference value we'll use on the next frame to decide if we need scrollbars. ImVec2 SizeContents; // Size of contents (== extents reach of the drawing cursor) from previous frame. Include decoration, window title, border, menu, etc. ImVec2 SizeContentsExplicit; // Size of contents explicitly set by the user via SetNextWindowContentSize() ImRect ContentsRegionRect; // Maximum visible content position in window coordinates. ~~ (SizeContentsExplicit ? SizeContentsExplicit : Size - ScrollbarSizes) - CursorStartPos, per axis ImVec2 WindowPadding; // Window padding at the time of begin. float WindowRounding; // Window rounding at the time of begin. float WindowBorderSize; // Window border size at the time of begin. ImGuiID MoveId; // == window->GetID("#MOVE") ImGuiID ChildId; // Id of corresponding item in parent window (for child windows) ImVec2 Scroll; ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change) ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered bool ScrollbarX, ScrollbarY; ImVec2 ScrollbarSizes; bool Active; // Set to true on Begin(), unless Collapsed bool WasActive; bool WriteAccessed; // Set to true when any widget access the current window bool Collapsed; // Set when collapsing window to become only title-bar bool CollapseToggleWanted; bool SkipItems; // Set when items can safely be all clipped (e.g. window not visible or collapsed) bool Appearing; // Set during the frame where the window is appearing (or re-appearing) bool CloseButton; // Set when the window has a close button (p_open != NULL) int BeginOrderWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0. int BeginOrderWithinContext; // Order within entire imgui context. This is mostly used for debugging submission order related issues. int BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs) ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) int AutoFitFramesX, AutoFitFramesY; bool AutoFitOnlyGrows; int AutoFitChildAxises; ImGuiDir AutoPosLastDirection; int HiddenFrames; ImGuiCond SetWindowPosAllowFlags; // store condition flags for next SetWindowPos() call. ImGuiCond SetWindowSizeAllowFlags; // store condition flags for next SetWindowSize() call. ImGuiCond SetWindowCollapsedAllowFlags; // store condition flags for next SetWindowCollapsed() call. ImVec2 SetWindowPosVal; // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size) ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right. ImGuiDrawContext DC; // Temporary per-window data, reset at the beginning of the frame ImVector IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack ImRect ClipRect; // = DrawList->clip_rect_stack.back(). Scissoring / clipping rectangle. x1, y1, x2, y2. ImRect WindowRectClipped; // = WindowRect just after setup in Begin(). == window->Rect() for root window. ImRect InnerRect, InnerClipRect; int LastFrameActive; float ItemWidthDefault; ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items ImGuiStorage StateStorage; ImVector ColumnsStorage; float FontWindowScale; // Scale multiplier per-window ImDrawList* DrawList; // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer) ImDrawList DrawListInst; ImGuiWindow* ParentWindow; // If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL. ImGuiWindow* RootWindow; // Point to ourself or first ancestor that is not a child window. ImGuiWindow* RootWindowForTitleBarHighlight; // Point to ourself or first ancestor which will display TitleBgActive color when this window is active. ImGuiWindow* RootWindowForTabbing; // Point to ourself or first ancestor which can be CTRL-Tabbed into. ImGuiWindow* RootWindowForNav; // Point to ourself or first ancestor which doesn't have the NavFlattened flag. ImGuiWindow* NavLastChildNavWindow; // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.) ImGuiID NavLastIds[2]; // Last known NavId for this window, per layer (0/1) ImRect NavRectRel[2]; // Reference rectangle, in window relative space // Navigation / Focus // FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext int FocusIdxAllCounter; // Start at -1 and increase as assigned via FocusItemRegister() int FocusIdxTabCounter; // (same, but only count widgets which you can Tab through) int FocusIdxAllRequestCurrent; // Item being requested for focus int FocusIdxTabRequestCurrent; // Tab-able item being requested for focus int FocusIdxAllRequestNext; // Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame) int FocusIdxTabRequestNext; // " public: ImGuiWindow(ImGuiContext* context, const char* name); ~ImGuiWindow(); ImGuiID GetID(const char* str, const char* str_end = NULL); ImGuiID GetID(const void* ptr); ImGuiID GetIDNoKeepAlive(const char* str, const char* str_end = NULL); ImGuiID GetIDFromRectangle(const ImRect& r_abs); // We don't use g.FontSize because the window may be != g.CurrentWidow. ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x+Size.x, Pos.y+Size.y); } float CalcFontSize() const { return GImGui->FontBaseSize * FontWindowScale; } float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f; } ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); } float MenuBarHeight() const { return (Flags & ImGuiWindowFlags_MenuBar) ? CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f : 0.0f; } ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); } }; // Backup and restore just enough data to be able to use IsItemHovered() on item A after another B in the same window has overwritten the data. struct ImGuiItemHoveredDataBackup { ImGuiID LastItemId; ImGuiItemStatusFlags LastItemStatusFlags; ImRect LastItemRect; ImRect LastItemDisplayRect; ImGuiItemHoveredDataBackup() { Backup(); } void Backup() { ImGuiWindow* window = GImGui->CurrentWindow; LastItemId = window->DC.LastItemId; LastItemStatusFlags = window->DC.LastItemStatusFlags; LastItemRect = window->DC.LastItemRect; LastItemDisplayRect = window->DC.LastItemDisplayRect; } void Restore() const { ImGuiWindow* window = GImGui->CurrentWindow; window->DC.LastItemId = LastItemId; window->DC.LastItemStatusFlags = LastItemStatusFlags; window->DC.LastItemRect = LastItemRect; window->DC.LastItemDisplayRect = LastItemDisplayRect; } }; //----------------------------------------------------------------------------- // Internal API // No guarantee of forward compatibility here. //----------------------------------------------------------------------------- namespace ImGui { // We should always have a CurrentWindow in the stack (there is an implicit "Debug" window) // If this ever crash because g.CurrentWindow is NULL it means that either // - ImGui::NewFrame() has never been called, which is illegal. // - You are calling ImGui functions after ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal. inline ImGuiWindow* GetCurrentWindowRead() { ImGuiContext& g = *GImGui; return g.CurrentWindow; } inline ImGuiWindow* GetCurrentWindow() { ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed = true; return g.CurrentWindow; } IMGUI_API ImGuiWindow* FindWindowByName(const char* name); IMGUI_API void FocusWindow(ImGuiWindow* window); IMGUI_API void BringWindowToFront(ImGuiWindow* window); IMGUI_API void BringWindowToBack(ImGuiWindow* window); IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent); IMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window); IMGUI_API void Initialize(ImGuiContext* context); IMGUI_API void Shutdown(ImGuiContext* context); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext(). IMGUI_API void NewFrameUpdateHoveredWindowAndCaptureFlags(); IMGUI_API void MarkIniSettingsDirty(); IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name); IMGUI_API ImGuiWindowSettings* FindWindowSettings(ImGuiID id); IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window); IMGUI_API ImGuiID GetActiveID(); IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window); IMGUI_API void ClearActiveID(); IMGUI_API void SetHoveredID(ImGuiID id); IMGUI_API ImGuiID GetHoveredID(); IMGUI_API void KeepAliveID(ImGuiID id); IMGUI_API void ItemSize(const ImVec2& size, float text_offset_y = 0.0f); IMGUI_API void ItemSize(const ImRect& bb, float text_offset_y = 0.0f); IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL); IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id); IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id, bool clip_even_when_logged); IMGUI_API bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id, bool tab_stop = true); // Return true if focus is requested IMGUI_API void FocusableItemUnregister(ImGuiWindow* window); IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y); IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x); IMGUI_API void PushMultiItemsWidths(int components, float width_full = 0.0f); IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); IMGUI_API void PopItemFlag(); IMGUI_API void SetCurrentFont(ImFont* font); IMGUI_API void OpenPopupEx(ImGuiID id); IMGUI_API void ClosePopup(ImGuiID id); IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window); IMGUI_API bool IsPopupOpen(ImGuiID id); IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags); IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip = true); IMGUI_API ImGuiWindow* GetFrontMostPopupModal(); IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit); IMGUI_API void NavMoveRequestCancel(); IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again. IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode); IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor = 0.0f, float fast_factor = 0.0f); IMGUI_API int CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate); IMGUI_API void Scrollbar(ImGuiLayoutType direction); IMGUI_API void VerticalSeparator(); // Vertical separator, for menu bars (use current line height). not exposed because it is misleading what it doesn't have an effect on regular layout. IMGUI_API bool SplitterBehavior(ImGuiID id, const ImRect& bb, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f); IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id); IMGUI_API void ClearDragDrop(); IMGUI_API bool IsDragDropPayloadBeingAccepted(); // FIXME-WIP: New Columns API IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiColumnsFlags flags = 0); // setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns(). IMGUI_API void EndColumns(); // close columns IMGUI_API void PushColumnClipRect(int column_index = -1); // NB: All position are in absolute pixels coordinates (never using window coordinates internally) // AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT. IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true); IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width); IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0,0), const ImRect* clip_rect = NULL); IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f); IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f); IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, int rounding_corners_flags = ~0); IMGUI_API void RenderArrow(ImVec2 pos, ImGuiDir dir, float scale = 1.0f); IMGUI_API void RenderBullet(ImVec2 pos); IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col, float sz); IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault); // Navigation highlight IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding); IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text. IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0); IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0,0), ImGuiButtonFlags flags = 0); IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos, float radius); IMGUI_API bool SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_min, float v_max, float power, int decimal_precision, ImGuiSliderFlags flags = 0); IMGUI_API bool SliderFloatN(const char* label, float* v, int components, float v_min, float v_max, const char* display_format, float power); IMGUI_API bool SliderIntN(const char* label, int* v, int components, int v_min, int v_max, const char* display_format); IMGUI_API bool DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_speed, float v_min, float v_max, int decimal_precision, float power); IMGUI_API bool DragFloatN(const char* label, float* v, int components, float v_speed, float v_min, float v_max, const char* display_format, float power); IMGUI_API bool DragIntN(const char* label, int* v, int components, float v_speed, int v_min, int v_max, const char* display_format); IMGUI_API bool InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback = NULL, void* user_data = NULL); IMGUI_API bool InputFloatN(const char* label, float* v, int components, int decimal_precision, ImGuiInputTextFlags extra_flags); IMGUI_API bool InputIntN(const char* label, int* v, int components, ImGuiInputTextFlags extra_flags); IMGUI_API bool InputScalarEx(const char* label, ImGuiDataType data_type, void* data_ptr, void* step_ptr, void* step_fast_ptr, const char* scalar_format, ImGuiInputTextFlags extra_flags); IMGUI_API bool InputScalarAsWidgetReplacement(const ImRect& aabb, const char* label, ImGuiDataType data_type, void* data_ptr, ImGuiID id, int decimal_precision); IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags); IMGUI_API void ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags); IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL); IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging IMGUI_API void TreePushRawID(ImGuiID id); IMGUI_API void PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size); IMGUI_API int ParseFormatPrecision(const char* fmt, int default_value); IMGUI_API float RoundScalar(float value, int decimal_precision); // Shade functions (write over already created vertices) IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawVert* vert_start, ImDrawVert* vert_end, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1); IMGUI_API void ShadeVertsLinearAlphaGradientForLeftToRightText(ImDrawVert* vert_start, ImDrawVert* vert_end, float gradient_p0_x, float gradient_p1_x); IMGUI_API void ShadeVertsLinearUV(ImDrawVert* vert_start, ImDrawVert* vert_end, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp); } // namespace ImGui // ImFontAtlas internals IMGUI_API bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas); IMGUI_API void ImFontAtlasBuildRegisterDefaultCustomRects(ImFontAtlas* atlas); IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent); IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* spc); IMGUI_API void ImFontAtlasBuildFinish(ImFontAtlas* atlas); IMGUI_API void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], float in_multiply_factor); IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride); #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef _MSC_VER #pragma warning (pop) #endif goxel-0.8.1/ext_src/inih/000077500000000000000000000000001334742672700152535ustar00rootroot00000000000000goxel-0.8.1/ext_src/inih/ini.c000066400000000000000000000146021334742672700162010ustar00rootroot00000000000000/* inih -- simple .INI file parser inih is released under the New BSD license (see LICENSE.txt). Go to the project home page for more info: https://github.com/benhoyt/inih */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #include #include #include #include "ini.h" #if !INI_USE_STACK #include #endif #define MAX_SECTION 50 #define MAX_NAME 50 /* Used by ini_parse_string() to keep track of string parsing state. */ typedef struct { const char* ptr; size_t num_left; } ini_parse_string_ctx; /* Strip whitespace chars off end of given string, in place. Return s. */ static char* rstrip(char* s) { char* p = s + strlen(s); while (p > s && isspace((unsigned char)(*--p))) *p = '\0'; return s; } /* Return pointer to first non-whitespace char in given string. */ static char* lskip(const char* s) { while (*s && isspace((unsigned char)(*s))) s++; return (char*)s; } /* Return pointer to first char (of chars) or inline comment in given string, or pointer to null at end of string if neither found. Inline comment must be prefixed by a whitespace character to register as a comment. */ static char* find_chars_or_comment(const char* s, const char* chars) { #if INI_ALLOW_INLINE_COMMENTS int was_space = 0; while (*s && (!chars || !strchr(chars, *s)) && !(was_space && strchr(INI_INLINE_COMMENT_PREFIXES, *s))) { was_space = isspace((unsigned char)(*s)); s++; } #else while (*s && (!chars || !strchr(chars, *s))) { s++; } #endif return (char*)s; } /* Version of strncpy that ensures dest (size bytes) is null-terminated. */ static char* strncpy0(char* dest, const char* src, size_t size) { strncpy(dest, src, size); dest[size - 1] = '\0'; return dest; } /* See documentation in header file. */ int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, void* user) { /* Uses a fair bit of stack (use heap instead if you need to) */ #if INI_USE_STACK char line[INI_MAX_LINE]; #else char* line; #endif char section[MAX_SECTION] = ""; char prev_name[MAX_NAME] = ""; char* start; char* end; char* name; char* value; int lineno = 0; int error = 0; #if !INI_USE_STACK line = (char*)malloc(INI_MAX_LINE); if (!line) { return -2; } #endif #if INI_HANDLER_LINENO #define HANDLER(u, s, n, v) handler(u, s, n, v, lineno) #else #define HANDLER(u, s, n, v) handler(u, s, n, v) #endif /* Scan through stream line by line */ while (reader(line, INI_MAX_LINE, stream) != NULL) { lineno++; start = line; #if INI_ALLOW_BOM if (lineno == 1 && (unsigned char)start[0] == 0xEF && (unsigned char)start[1] == 0xBB && (unsigned char)start[2] == 0xBF) { start += 3; } #endif start = lskip(rstrip(start)); if (*start == ';' || *start == '#') { /* Per Python configparser, allow both ; and # comments at the start of a line */ } #if INI_ALLOW_MULTILINE else if (*prev_name && *start && start > line) { /* Non-blank line with leading whitespace, treat as continuation of previous name's value (as per Python configparser). */ if (!HANDLER(user, section, prev_name, start) && !error) error = lineno; } #endif else if (*start == '[') { /* A "[section]" line */ end = find_chars_or_comment(start + 1, "]"); if (*end == ']') { *end = '\0'; strncpy0(section, start + 1, sizeof(section)); *prev_name = '\0'; } else if (!error) { /* No ']' found on section line */ error = lineno; } } else if (*start) { /* Not a comment, must be a name[=:]value pair */ end = find_chars_or_comment(start, "=:"); if (*end == '=' || *end == ':') { *end = '\0'; name = rstrip(start); value = end + 1; #if INI_ALLOW_INLINE_COMMENTS end = find_chars_or_comment(value, NULL); if (*end) *end = '\0'; #endif value = lskip(value); rstrip(value); /* Valid name[=:]value pair found, call handler */ strncpy0(prev_name, name, sizeof(prev_name)); if (!HANDLER(user, section, name, value) && !error) error = lineno; } else if (!error) { /* No '=' or ':' found on name[=:]value line */ error = lineno; } } #if INI_STOP_ON_FIRST_ERROR if (error) break; #endif } #if !INI_USE_STACK free(line); #endif return error; } /* See documentation in header file. */ int ini_parse_file(FILE* file, ini_handler handler, void* user) { return ini_parse_stream((ini_reader)fgets, file, handler, user); } /* See documentation in header file. */ int ini_parse(const char* filename, ini_handler handler, void* user) { FILE* file; int error; file = fopen(filename, "r"); if (!file) return -1; error = ini_parse_file(file, handler, user); fclose(file); return error; } /* An ini_reader function to read the next line from a string buffer. This is the fgets() equivalent used by ini_parse_string(). */ static char* ini_reader_string(char* str, int num, void* stream) { ini_parse_string_ctx* ctx = (ini_parse_string_ctx*)stream; const char* ctx_ptr = ctx->ptr; size_t ctx_num_left = ctx->num_left; char* strp = str; char c; if (ctx_num_left == 0 || num < 2) return NULL; while (num > 1 && ctx_num_left != 0) { c = *ctx_ptr++; ctx_num_left--; *strp++ = c; if (c == '\n') break; num--; } *strp = '\0'; ctx->ptr = ctx_ptr; ctx->num_left = ctx_num_left; return str; } /* See documentation in header file. */ int ini_parse_string(const char* string, ini_handler handler, void* user) { ini_parse_string_ctx ctx; ctx.ptr = string; ctx.num_left = strlen(string); return ini_parse_stream((ini_reader)ini_reader_string, &ctx, handler, user); } goxel-0.8.1/ext_src/inih/ini.h000066400000000000000000000072061334742672700162100ustar00rootroot00000000000000/* inih -- simple .INI file parser inih is released under the New BSD license (see LICENSE.txt). Go to the project home page for more info: https://github.com/benhoyt/inih */ #ifndef __INI_H__ #define __INI_H__ /* Make this header file easier to include in C++ code */ #ifdef __cplusplus extern "C" { #endif #include /* Nonzero if ini_handler callback should accept lineno parameter. */ #ifndef INI_HANDLER_LINENO #define INI_HANDLER_LINENO 0 #endif /* Typedef for prototype of handler function. */ #if INI_HANDLER_LINENO typedef int (*ini_handler)(void* user, const char* section, const char* name, const char* value, int lineno); #else typedef int (*ini_handler)(void* user, const char* section, const char* name, const char* value); #endif /* Typedef for prototype of fgets-style reader function. */ typedef char* (*ini_reader)(char* str, int num, void* stream); /* Parse given INI-style file. May have [section]s, name=value pairs (whitespace stripped), and comments starting with ';' (semicolon). Section is "" if name=value pair parsed before any section heading. name:value pairs are also supported as a concession to Python's configparser. For each name=value pair parsed, call handler function with given user pointer as well as section, name, and value (data only valid for duration of handler call). Handler should return nonzero on success, zero on error. Returns 0 on success, line number of first error on parse error (doesn't stop on first error), -1 on file open error, or -2 on memory allocation error (only when INI_USE_STACK is zero). */ int ini_parse(const char* filename, ini_handler handler, void* user); /* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't close the file when it's finished -- the caller must do that. */ int ini_parse_file(FILE* file, ini_handler handler, void* user); /* Same as ini_parse(), but takes an ini_reader function pointer instead of filename. Used for implementing custom or string-based I/O (see also ini_parse_string). */ int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, void* user); /* Same as ini_parse(), but takes a zero-terminated string with the INI data instead of a file. Useful for parsing INI data from a network socket or already in memory. */ int ini_parse_string(const char* string, ini_handler handler, void* user); /* Nonzero to allow multi-line value parsing, in the style of Python's configparser. If allowed, ini_parse() will call the handler with the same name for each subsequent line parsed. */ #ifndef INI_ALLOW_MULTILINE #define INI_ALLOW_MULTILINE 1 #endif /* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of the file. See http://code.google.com/p/inih/issues/detail?id=21 */ #ifndef INI_ALLOW_BOM #define INI_ALLOW_BOM 1 #endif /* Nonzero to allow inline comments (with valid inline comment characters specified by INI_INLINE_COMMENT_PREFIXES). Set to 0 to turn off and match Python 3.2+ configparser behaviour. */ #ifndef INI_ALLOW_INLINE_COMMENTS #define INI_ALLOW_INLINE_COMMENTS 1 #endif #ifndef INI_INLINE_COMMENT_PREFIXES #define INI_INLINE_COMMENT_PREFIXES ";" #endif /* Nonzero to use stack, zero to use heap (malloc/free). */ #ifndef INI_USE_STACK #define INI_USE_STACK 1 #endif /* Stop parsing on first error (default is to keep parsing). */ #ifndef INI_STOP_ON_FIRST_ERROR #define INI_STOP_ON_FIRST_ERROR 0 #endif /* Maximum line length for any line in INI file. */ #ifndef INI_MAX_LINE #define INI_MAX_LINE 200 #endif #ifdef __cplusplus } #endif #endif /* __INI_H__ */ goxel-0.8.1/ext_src/noc/000077500000000000000000000000001334742672700151035ustar00rootroot00000000000000goxel-0.8.1/ext_src/noc/noc_file_dialog.h000066400000000000000000000226541334742672700203620ustar00rootroot00000000000000/* noc_file_dialog library * * Copyright (c) 2015 Guillaume Chereau * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /* A portable library to create open and save dialogs on linux, osx and * windows. * * The library define a single function : noc_file_dialog_open. * With three different implementations. * * Usage: * * The library does not automatically select the implementation, you need to * define one of those macros before including this file: * * NOC_FILE_DIALOG_GTK * NOC_FILE_DIALOG_WIN32 * NOC_FILE_DIALOG_OSX */ #ifndef NOC_INCLUDE_NOC_FILE_DIALOG_H #define NOC_INCLUDE_NOC_FILE_DIALOG_H enum { NOC_FILE_DIALOG_OPEN = 1 << 0, // Create an open file dialog. NOC_FILE_DIALOG_SAVE = 1 << 1, // Create a save file dialog. NOC_FILE_DIALOG_DIR = 1 << 2, // Open a directory. NOC_FILE_DIALOG_NO_OVERWRITE_CONFIRMATION = 1 << 3, }; // There is a single function defined. /* flags : union of the NOC_FILE_DIALOG_XXX masks. * filters : a list of strings separated by '\0' of the form: * "name1 reg1 name2 reg2 ..." * The last value is followed by two '\0'. For example, * to filter png and jpeg files, you can use: * "png\0*.png\0jpeg\0*.jpeg\0" * You can also separate patterns with ';': * "jpeg\0*.jpg;*.jpeg\0" * Set to NULL for no filter. * default_path : the default file to use or NULL. * default_name : the default file name to use or NULL. * * The function return a C string. There is no need to free it, as it is * managed by the library. The string is valid until the next call to * no_dialog_open. If the user canceled, the return value is NULL. */ const char *noc_file_dialog_open(int flags, const char *filters, const char *default_path, const char *default_name); // End of header file #endif // NOC_INCLUDE_NOC_FILE_DIALOG_H #ifdef NOC_FILE_DIALOG_IMPLEMENTATION #include #include static char *g_noc_file_dialog_ret = NULL; #ifdef NOC_FILE_DIALOG_GTK #include const char *noc_file_dialog_open(int flags, const char *filters, const char *default_path, const char *default_name) { GtkWidget *dialog; GtkFileFilter *filter; GtkFileChooser *chooser; GtkFileChooserAction action; gint res; char buf[128], *patterns; action = flags & NOC_FILE_DIALOG_SAVE ? GTK_FILE_CHOOSER_ACTION_SAVE : GTK_FILE_CHOOSER_ACTION_OPEN; if (flags & NOC_FILE_DIALOG_DIR) action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER; gtk_init_check(NULL, NULL); dialog = gtk_file_chooser_dialog_new( flags & NOC_FILE_DIALOG_SAVE ? "Save File" : "Open File", NULL, action, "_Cancel", GTK_RESPONSE_CANCEL, flags & NOC_FILE_DIALOG_SAVE ? "_Save" : "_Open", GTK_RESPONSE_ACCEPT, NULL ); chooser = GTK_FILE_CHOOSER(dialog); if (!(flags & NOC_FILE_DIALOG_NO_OVERWRITE_CONFIRMATION)) gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE); if (default_path) gtk_file_chooser_set_filename(chooser, default_path); if (default_name) gtk_file_chooser_set_current_name(chooser, default_name); while (filters && *filters) { filter = gtk_file_filter_new(); gtk_file_filter_set_name(filter, filters); filters += strlen(filters) + 1; // Split the filter pattern with ';'. strcpy(buf, filters); buf[strlen(buf)] = '\0'; for (patterns = buf; *patterns; patterns++) if (*patterns == ';') *patterns = '\0'; patterns = buf; while (*patterns) { gtk_file_filter_add_pattern(filter, patterns); patterns += strlen(patterns); if (*patterns) patterns++; } gtk_file_chooser_add_filter(chooser, filter); filters += strlen(filters) + 1; } res = gtk_dialog_run(GTK_DIALOG(dialog)); free(g_noc_file_dialog_ret); g_noc_file_dialog_ret = NULL; if (res == GTK_RESPONSE_ACCEPT) g_noc_file_dialog_ret = gtk_file_chooser_get_filename(chooser); gtk_widget_destroy(dialog); while (gtk_events_pending()) gtk_main_iteration(); return g_noc_file_dialog_ret; } #endif #ifdef NOC_FILE_DIALOG_WIN32 #include #include #include const char *noc_file_dialog_open(int flags, const char *filters, const char *default_path, const char *default_name) { OPENFILENAME ofn; // common dialog box structure BROWSEINFO bif; // only used to open directory LPITEMIDLIST lpItem; // only for open directory char szFile[260]; // buffer for file name int ret; if (!(flags & NOC_FILE_DIALOG_DIR)) { ZeroMemory(&ofn, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.lpstrFile = szFile; ofn.lpstrFile[0] = '\0'; ofn.nMaxFile = sizeof(szFile); ofn.lpstrFilter = filters; ofn.nFilterIndex = 1; ofn.lpstrFileTitle = NULL; ofn.nMaxFileTitle = 0; ofn.lpstrInitialDir = NULL; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; if (default_name) strcpy(ofn.lpstrFile, default_name); if (flags & NOC_FILE_DIALOG_OPEN) ret = GetOpenFileName(&ofn); else ret = GetSaveFileName(&ofn); } else { ZeroMemory(&bif, sizeof(bif)); bif.pszDisplayName = szFile; lpItem = SHBrowseForFolder(&bif); if (lpItem) { SHGetPathFromIDList(lpItem, szFile); ret = 1; } else { ret = 0; } } free(g_noc_file_dialog_ret); g_noc_file_dialog_ret = ret ? strdup(szFile) : NULL; return g_noc_file_dialog_ret; } #endif #ifdef NOC_FILE_DIALOG_OSX #include const char *noc_file_dialog_open(int flags, const char *filters, const char *default_path, const char *default_name) { NSURL *url; const char *utf8_path; NSSavePanel *panel; NSOpenPanel *open_panel; NSMutableArray *types_array; NSURL *default_url; char buf[128], *patterns; // XXX: I don't know about memory management with cococa, need to check // if I leak memory here. // NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if (flags & NOC_FILE_DIALOG_OPEN) { panel = open_panel = [NSOpenPanel openPanel]; } else { panel = [NSSavePanel savePanel]; } if (flags & NOC_FILE_DIALOG_DIR) { [open_panel setCanChooseDirectories:YES]; [open_panel setCanChooseFiles:NO]; } if (default_path) { default_url = [NSURL fileURLWithPath: [NSString stringWithUTF8String:default_path]]; [panel setDirectoryURL:default_url]; [panel setNameFieldStringValue:default_url.lastPathComponent]; } if (filters) { types_array = [NSMutableArray array]; while (*filters) { filters += strlen(filters) + 1; // skip the name // Split the filter pattern with ';'. strcpy(buf, filters); buf[strlen(buf) + 1] = '\0'; for (patterns = buf; *patterns; patterns++) if (*patterns == ';') *patterns = '\0'; patterns = buf; while (*patterns) { assert(strncmp(patterns, "*.", 2) == 0); patterns += 2; // Skip the "*." [types_array addObject:[NSString stringWithUTF8String: patterns]]; patterns += strlen(patterns); if (*patterns) patterns++; } filters += strlen(filters) + 1; } [panel setAllowedFileTypes:types_array]; } free(g_noc_file_dialog_ret); g_noc_file_dialog_ret = NULL; if ( [panel runModal] == NSModalResponseOK ) { url = [panel URL]; utf8_path = [[url path] UTF8String]; g_noc_file_dialog_ret = strdup(utf8_path); } // [pool release]; return g_noc_file_dialog_ret; } #endif #endif goxel-0.8.1/ext_src/stb/000077500000000000000000000000001334742672700151145ustar00rootroot00000000000000goxel-0.8.1/ext_src/stb/stb_image.h000066400000000000000000007066721334742672700172410ustar00rootroot00000000000000/* stb_image - v2.12 - public domain image loader - http://nothings.org/stb_image.h no warranty implied; use at your own risk Do this: #define STB_IMAGE_IMPLEMENTATION before you include this file in *one* C or C++ file to create the implementation. // i.e. it should look like this: #include ... #include ... #include ... #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" You can #define STBI_ASSERT(x) before the #include to avoid using assert.h. And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free QUICK NOTES: Primarily of interest to game developers and other people who can avoid problematic images and only need the trivial interface JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib) PNG 1/2/4/8-bit-per-channel (16 bpc not supported) TGA (not sure what subset, if a subset) BMP non-1bpp, non-RLE PSD (composited view only, no extra channels, 8/16 bit-per-channel) GIF (*comp always reports as 4-channel) HDR (radiance rgbE format) PIC (Softimage PIC) PNM (PPM and PGM binary only) Animated GIF still needs a proper API, but here's one way to do it: http://gist.github.com/urraka/685d9a6340b26b830d49 - decode from memory or through FILE (define STBI_NO_STDIO to remove code) - decode from arbitrary I/O callbacks - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON) Full documentation under "DOCUMENTATION" below. Revision 2.00 release notes: - Progressive JPEG is now supported. - PPM and PGM binary formats are now supported, thanks to Ken Miller. - x86 platforms now make use of SSE2 SIMD instructions for JPEG decoding, and ARM platforms can use NEON SIMD if requested. This work was done by Fabian "ryg" Giesen. SSE2 is used by default, but NEON must be enabled explicitly; see docs. With other JPEG optimizations included in this version, we see 2x speedup on a JPEG on an x86 machine, and a 1.5x speedup on a JPEG on an ARM machine, relative to previous versions of this library. The same results will not obtain for all JPGs and for all x86/ARM machines. (Note that progressive JPEGs are significantly slower to decode than regular JPEGs.) This doesn't mean that this is the fastest JPEG decoder in the land; rather, it brings it closer to parity with standard libraries. If you want the fastest decode, look elsewhere. (See "Philosophy" section of docs below.) See final bullet items below for more info on SIMD. - Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing the memory allocator. Unlike other STBI libraries, these macros don't support a context parameter, so if you need to pass a context in to the allocator, you'll have to store it in a global or a thread-local variable. - Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and STBI_NO_LINEAR. STBI_NO_HDR: suppress implementation of .hdr reader format STBI_NO_LINEAR: suppress high-dynamic-range light-linear float API - You can suppress implementation of any of the decoders to reduce your code footprint by #defining one or more of the following symbols before creating the implementation. STBI_NO_JPEG STBI_NO_PNG STBI_NO_BMP STBI_NO_PSD STBI_NO_TGA STBI_NO_GIF STBI_NO_HDR STBI_NO_PIC STBI_NO_PNM (.ppm and .pgm) - You can request *only* certain decoders and suppress all other ones (this will be more forward-compatible, as addition of new decoders doesn't require you to disable them explicitly): STBI_ONLY_JPEG STBI_ONLY_PNG STBI_ONLY_BMP STBI_ONLY_PSD STBI_ONLY_TGA STBI_ONLY_GIF STBI_ONLY_HDR STBI_ONLY_PIC STBI_ONLY_PNM (.ppm and .pgm) Note that you can define multiples of these, and you will get all of them ("only x" and "only y" is interpreted to mean "only x&y"). - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB - Compilation of all SIMD code can be suppressed with #define STBI_NO_SIMD It should not be necessary to disable SIMD unless you have issues compiling (e.g. using an x86 compiler which doesn't support SSE intrinsics or that doesn't support the method used to detect SSE2 support at run-time), and even those can be reported as bugs so I can refine the built-in compile-time checking to be smarter. - The old STBI_SIMD system which allowed installing a user-defined IDCT etc. has been removed. If you need this, don't upgrade. My assumption is that almost nobody was doing this, and those who were will find the built-in SIMD more satisfactory anyway. - RGB values computed for JPEG images are slightly different from previous versions of stb_image. (This is due to using less integer precision in SIMD.) The C code has been adjusted so that the same RGB values will be computed regardless of whether SIMD support is available, so your app should always produce consistent results. But these results are slightly different from previous versions. (Specifically, about 3% of available YCbCr values will compute different RGB results from pre-1.49 versions by +-1; most of the deviating values are one smaller in the G channel.) - If you must produce consistent results with previous versions of stb_image, #define STBI_JPEG_OLD and you will get the same results you used to; however, you will not get the SIMD speedups for the YCbCr-to-RGB conversion step (although you should still see significant JPEG speedup from the other changes). Please note that STBI_JPEG_OLD is a temporary feature; it will be removed in future versions of the library. It is only intended for near-term back-compatibility use. Latest revision history: 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64 RGB-format JPEG; remove white matting in PSD; allocate large structures on the stack; correct channel count for PNG & BMP 2.10 (2016-01-22) avoid warning introduced in 2.09 2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA 2.07 (2015-09-13) partial animated GIF support limited 16-bit PSD support minor bugs, code cleanup, and compiler warnings 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit 2.03 (2015-04-12) additional corruption checking stbi_set_flip_vertically_on_load fix NEON support; fix mingw support 2.02 (2015-01-19) fix incorrect assert, fix warning 2.01 (2015-01-17) fix various warnings 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG 2.00 (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD progressive JPEG PGM/PPM support STBI_MALLOC,STBI_REALLOC,STBI_FREE STBI_NO_*, STBI_ONLY_* GIF bugfix See end of file for full revision history. ============================ Contributors ========================= Image formats Extensions, features Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info) Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info) Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG) Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks) Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG) Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip) Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD) urraka@github (animated gif) Junggon Kim (PNM comments) Daniel Gibson (16-bit TGA) Optimizations & bugfixes Fabian "ryg" Giesen Arseny Kapoulkine Bug & warning fixes Marc LeBlanc David Woo Guillaume George Martins Mozeiko Christpher Lloyd Martin Golini Jerry Jansson Joseph Thomson Dave Moore Roy Eltham Hayaki Saito Phil Jordan Won Chun Luke Graham Johan Duparc Nathan Reed the Horde3D community Thomas Ruf Ronny Chevalier Nick Verigakis Janez Zemva John Bartholomew Michal Cichon svdijk@github Jonathan Blow Ken Hamada Tero Hanninen Baldur Karlsson Laurent Gomila Cort Stratton Sergio Gonzalez romigrou@github Aruelien Pocheville Thibault Reuille Cass Everitt Matthew Gregan Ryamond Barbiero Paul Du Bois Engin Manap snagar@github Michaelangel007@github Oriol Ferrer Mesia socks-the-fox Blazej Dariusz Roszkowski LICENSE This software is dual-licensed to the public domain and under the following license: you are granted a perpetual, irrevocable license to copy, modify, publish, and distribute this file as you see fit. */ #ifndef STBI_INCLUDE_STB_IMAGE_H #define STBI_INCLUDE_STB_IMAGE_H // DOCUMENTATION // // Limitations: // - no 16-bit-per-channel PNG // - no 12-bit-per-channel JPEG // - no JPEGs with arithmetic coding // - no 1-bit BMP // - GIF always returns *comp=4 // // Basic usage (see HDR discussion below for HDR usage): // int x,y,n; // unsigned char *data = stbi_load(filename, &x, &y, &n, 0); // // ... process data if not NULL ... // // ... x = width, y = height, n = # 8-bit components per pixel ... // // ... replace '0' with '1'..'4' to force that many components per pixel // // ... but 'n' will always be the number that it would have been if you said 0 // stbi_image_free(data) // // Standard parameters: // int *x -- outputs image width in pixels // int *y -- outputs image height in pixels // int *comp -- outputs # of image components in image file // int req_comp -- if non-zero, # of image components requested in result // // The return value from an image loader is an 'unsigned char *' which points // to the pixel data, or NULL on an allocation failure or if the image is // corrupt or invalid. The pixel data consists of *y scanlines of *x pixels, // with each pixel consisting of N interleaved 8-bit components; the first // pixel pointed to is top-left-most in the image. There is no padding between // image scanlines or between pixels, regardless of format. The number of // components N is 'req_comp' if req_comp is non-zero, or *comp otherwise. // If req_comp is non-zero, *comp has the number of components that _would_ // have been output otherwise. E.g. if you set req_comp to 4, you will always // get RGBA output, but you can check *comp to see if it's trivially opaque // because e.g. there were only 3 channels in the source image. // // An output image with N components has the following components interleaved // in this order in each pixel: // // N=#comp components // 1 grey // 2 grey, alpha // 3 red, green, blue // 4 red, green, blue, alpha // // If image loading fails for any reason, the return value will be NULL, // and *x, *y, *comp will be unchanged. The function stbi_failure_reason() // can be queried for an extremely brief, end-user unfriendly explanation // of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid // compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly // more user-friendly ones. // // Paletted PNG, BMP, GIF, and PIC images are automatically depalettized. // // =========================================================================== // // Philosophy // // stb libraries are designed with the following priorities: // // 1. easy to use // 2. easy to maintain // 3. good performance // // Sometimes I let "good performance" creep up in priority over "easy to maintain", // and for best performance I may provide less-easy-to-use APIs that give higher // performance, in addition to the easy to use ones. Nevertheless, it's important // to keep in mind that from the standpoint of you, a client of this library, // all you care about is #1 and #3, and stb libraries do not emphasize #3 above all. // // Some secondary priorities arise directly from the first two, some of which // make more explicit reasons why performance can't be emphasized. // // - Portable ("ease of use") // - Small footprint ("easy to maintain") // - No dependencies ("ease of use") // // =========================================================================== // // I/O callbacks // // I/O callbacks allow you to read from arbitrary sources, like packaged // files or some other source. Data read from callbacks are processed // through a small internal buffer (currently 128 bytes) to try to reduce // overhead. // // The three functions you must define are "read" (reads some bytes of data), // "skip" (skips some bytes of data), "eof" (reports if the stream is at the end). // // =========================================================================== // // SIMD support // // The JPEG decoder will try to automatically use SIMD kernels on x86 when // supported by the compiler. For ARM Neon support, you must explicitly // request it. // // (The old do-it-yourself SIMD API is no longer supported in the current // code.) // // On x86, SSE2 will automatically be used when available based on a run-time // test; if not, the generic C versions are used as a fall-back. On ARM targets, // the typical path is to have separate builds for NEON and non-NEON devices // (at least this is true for iOS and Android). Therefore, the NEON support is // toggled by a build flag: define STBI_NEON to get NEON loops. // // The output of the JPEG decoder is slightly different from versions where // SIMD support was introduced (that is, for versions before 1.49). The // difference is only +-1 in the 8-bit RGB channels, and only on a small // fraction of pixels. You can force the pre-1.49 behavior by defining // STBI_JPEG_OLD, but this will disable some of the SIMD decoding path // and hence cost some performance. // // If for some reason you do not want to use any of SIMD code, or if // you have issues compiling it, you can disable it entirely by // defining STBI_NO_SIMD. // // =========================================================================== // // HDR image support (disable by defining STBI_NO_HDR) // // stb_image now supports loading HDR images in general, and currently // the Radiance .HDR file format, although the support is provided // generically. You can still load any file through the existing interface; // if you attempt to load an HDR file, it will be automatically remapped to // LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; // both of these constants can be reconfigured through this interface: // // stbi_hdr_to_ldr_gamma(2.2f); // stbi_hdr_to_ldr_scale(1.0f); // // (note, do not use _inverse_ constants; stbi_image will invert them // appropriately). // // Additionally, there is a new, parallel interface for loading files as // (linear) floats to preserve the full dynamic range: // // float *data = stbi_loadf(filename, &x, &y, &n, 0); // // If you load LDR images through this interface, those images will // be promoted to floating point values, run through the inverse of // constants corresponding to the above: // // stbi_ldr_to_hdr_scale(1.0f); // stbi_ldr_to_hdr_gamma(2.2f); // // Finally, given a filename (or an open file or memory block--see header // file for details) containing image data, you can query for the "most // appropriate" interface to use (that is, whether the image is HDR or // not), using: // // stbi_is_hdr(char *filename); // // =========================================================================== // // iPhone PNG support: // // By default we convert iphone-formatted PNGs back to RGB, even though // they are internally encoded differently. You can disable this conversion // by by calling stbi_convert_iphone_png_to_rgb(0), in which case // you will always just get the native iphone "format" through (which // is BGR stored in RGB). // // Call stbi_set_unpremultiply_on_load(1) as well to force a divide per // pixel to remove any premultiplied alpha *only* if the image file explicitly // says there's premultiplied data (currently only happens in iPhone images, // and only if iPhone convert-to-rgb processing is on). // #ifndef STBI_NO_STDIO #include #endif // STBI_NO_STDIO #define STBI_VERSION 1 enum { STBI_default = 0, // only used for req_comp STBI_grey = 1, STBI_grey_alpha = 2, STBI_rgb = 3, STBI_rgb_alpha = 4 }; typedef unsigned char stbi_uc; #ifdef __cplusplus extern "C" { #endif #ifdef STB_IMAGE_STATIC #define STBIDEF static #else #define STBIDEF extern #endif ////////////////////////////////////////////////////////////////////////////// // // PRIMARY API - works on images of any type // // // load image by filename, open file, or memory buffer // typedef struct { int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative int (*eof) (void *user); // returns nonzero if we are at end of file/data } stbi_io_callbacks; STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp); STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp); STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp); #ifndef STBI_NO_STDIO STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); // for stbi_load_from_file, file pointer is left pointing immediately after image #endif #ifndef STBI_NO_LINEAR STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp); STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp); #ifndef STBI_NO_STDIO STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); #endif #endif #ifndef STBI_NO_HDR STBIDEF void stbi_hdr_to_ldr_gamma(float gamma); STBIDEF void stbi_hdr_to_ldr_scale(float scale); #endif // STBI_NO_HDR #ifndef STBI_NO_LINEAR STBIDEF void stbi_ldr_to_hdr_gamma(float gamma); STBIDEF void stbi_ldr_to_hdr_scale(float scale); #endif // STBI_NO_LINEAR // stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user); STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len); #ifndef STBI_NO_STDIO STBIDEF int stbi_is_hdr (char const *filename); STBIDEF int stbi_is_hdr_from_file(FILE *f); #endif // STBI_NO_STDIO // get a VERY brief reason for failure // NOT THREADSAFE STBIDEF const char *stbi_failure_reason (void); // free the loaded image -- this is just free() STBIDEF void stbi_image_free (void *retval_from_stbi_load); // get image dimensions & components without fully decoding STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); #ifndef STBI_NO_STDIO STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); #endif // for image formats that explicitly notate that they have premultiplied alpha, // we just return the colors as stored in the file. set this flag to force // unpremultiplication. results are undefined if the unpremultiply overflow. STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply); // indicate whether we should process iphone images back to canonical format, // or just pass them through "as-is" STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); // flip the image vertically, so the first pixel in the output array is the bottom left STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip); // ZLIB client - used by PNG, available for other purposes STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header); STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen); STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen); STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); #ifdef __cplusplus } #endif // // //// end header file ///////////////////////////////////////////////////// #endif // STBI_INCLUDE_STB_IMAGE_H #ifdef STB_IMAGE_IMPLEMENTATION #if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \ || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \ || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \ || defined(STBI_ONLY_ZLIB) #ifndef STBI_ONLY_JPEG #define STBI_NO_JPEG #endif #ifndef STBI_ONLY_PNG #define STBI_NO_PNG #endif #ifndef STBI_ONLY_BMP #define STBI_NO_BMP #endif #ifndef STBI_ONLY_PSD #define STBI_NO_PSD #endif #ifndef STBI_ONLY_TGA #define STBI_NO_TGA #endif #ifndef STBI_ONLY_GIF #define STBI_NO_GIF #endif #ifndef STBI_ONLY_HDR #define STBI_NO_HDR #endif #ifndef STBI_ONLY_PIC #define STBI_NO_PIC #endif #ifndef STBI_ONLY_PNM #define STBI_NO_PNM #endif #endif #if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB) #define STBI_NO_ZLIB #endif #include #include // ptrdiff_t on osx #include #include #if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) #include // ldexp #endif #ifndef STBI_NO_STDIO #include #endif #ifndef STBI_ASSERT #include #define STBI_ASSERT(x) assert(x) #endif #ifndef _MSC_VER #ifdef __cplusplus #define stbi_inline inline #else #define stbi_inline #endif #else #define stbi_inline __forceinline #endif #ifdef _MSC_VER typedef unsigned short stbi__uint16; typedef signed short stbi__int16; typedef unsigned int stbi__uint32; typedef signed int stbi__int32; #else #include typedef uint16_t stbi__uint16; typedef int16_t stbi__int16; typedef uint32_t stbi__uint32; typedef int32_t stbi__int32; #endif // should produce compiler error if size is wrong typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1]; #ifdef _MSC_VER #define STBI_NOTUSED(v) (void)(v) #else #define STBI_NOTUSED(v) (void)sizeof(v) #endif #ifdef _MSC_VER #define STBI_HAS_LROTL #endif #ifdef STBI_HAS_LROTL #define stbi_lrot(x,y) _lrotl(x,y) #else #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y)))) #endif #if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED)) // ok #elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED) // ok #else #error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED)." #endif #ifndef STBI_MALLOC #define STBI_MALLOC(sz) malloc(sz) #define STBI_REALLOC(p,newsz) realloc(p,newsz) #define STBI_FREE(p) free(p) #endif #ifndef STBI_REALLOC_SIZED #define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz) #endif // x86/x64 detection #if defined(__x86_64__) || defined(_M_X64) #define STBI__X64_TARGET #elif defined(__i386) || defined(_M_IX86) #define STBI__X86_TARGET #endif #if defined(__GNUC__) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) && !defined(__SSE2__) && !defined(STBI_NO_SIMD) // NOTE: not clear do we actually need this for the 64-bit path? // gcc doesn't support sse2 intrinsics unless you compile with -msse2, // (but compiling with -msse2 allows the compiler to use SSE2 everywhere; // this is just broken and gcc are jerks for not fixing it properly // http://www.virtualdub.org/blog/pivot/entry.php?id=363 ) #define STBI_NO_SIMD #endif #if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD) // Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET // // 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the // Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant. // As a result, enabling SSE2 on 32-bit MinGW is dangerous when not // simultaneously enabling "-mstackrealign". // // See https://github.com/nothings/stb/issues/81 for more information. // // So default to no SSE2 on 32-bit MinGW. If you've read this far and added // -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2. #define STBI_NO_SIMD #endif #if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) #define STBI_SSE2 #include #ifdef _MSC_VER #if _MSC_VER >= 1400 // not VC6 #include // __cpuid static int stbi__cpuid3(void) { int info[4]; __cpuid(info,1); return info[3]; } #else static int stbi__cpuid3(void) { int res; __asm { mov eax,1 cpuid mov res,edx } return res; } #endif #define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name static int stbi__sse2_available() { int info3 = stbi__cpuid3(); return ((info3 >> 26) & 1) != 0; } #else // assume GCC-style if not VC++ #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) static int stbi__sse2_available() { #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later // GCC 4.8+ has a nice way to do this return __builtin_cpu_supports("sse2"); #else // portable way to do this, preferably without using GCC inline ASM? // just bail for now. return 0; #endif } #endif #endif // ARM NEON #if defined(STBI_NO_SIMD) && defined(STBI_NEON) #undef STBI_NEON #endif #ifdef STBI_NEON #include // assume GCC or Clang on ARM targets #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) #endif #ifndef STBI_SIMD_ALIGN #define STBI_SIMD_ALIGN(type, name) type name #endif /////////////////////////////////////////////// // // stbi__context struct and start_xxx functions // stbi__context structure is our basic context used by all images, so it // contains all the IO context, plus some basic image information typedef struct { stbi__uint32 img_x, img_y; int img_n, img_out_n; stbi_io_callbacks io; void *io_user_data; int read_from_callbacks; int buflen; stbi_uc buffer_start[128]; stbi_uc *img_buffer, *img_buffer_end; stbi_uc *img_buffer_original, *img_buffer_original_end; } stbi__context; static void stbi__refill_buffer(stbi__context *s); // initialize a memory-decode context static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len) { s->io.read = NULL; s->read_from_callbacks = 0; s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer; s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len; } // initialize a callback-based context static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user) { s->io = *c; s->io_user_data = user; s->buflen = sizeof(s->buffer_start); s->read_from_callbacks = 1; s->img_buffer_original = s->buffer_start; stbi__refill_buffer(s); s->img_buffer_original_end = s->img_buffer_end; } #ifndef STBI_NO_STDIO static int stbi__stdio_read(void *user, char *data, int size) { return (int) fread(data,1,size,(FILE*) user); } static void stbi__stdio_skip(void *user, int n) { fseek((FILE*) user, n, SEEK_CUR); } static int stbi__stdio_eof(void *user) { return feof((FILE*) user); } static stbi_io_callbacks stbi__stdio_callbacks = { stbi__stdio_read, stbi__stdio_skip, stbi__stdio_eof, }; static void stbi__start_file(stbi__context *s, FILE *f) { stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f); } //static void stop_file(stbi__context *s) { } #endif // !STBI_NO_STDIO static void stbi__rewind(stbi__context *s) { // conceptually rewind SHOULD rewind to the beginning of the stream, // but we just rewind to the beginning of the initial buffer, because // we only use it after doing 'test', which only ever looks at at most 92 bytes s->img_buffer = s->img_buffer_original; s->img_buffer_end = s->img_buffer_original_end; } #ifndef STBI_NO_JPEG static int stbi__jpeg_test(stbi__context *s); static stbi_uc *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PNG static int stbi__png_test(stbi__context *s); static stbi_uc *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_BMP static int stbi__bmp_test(stbi__context *s); static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_TGA static int stbi__tga_test(stbi__context *s); static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PSD static int stbi__psd_test(stbi__context *s); static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_HDR static int stbi__hdr_test(stbi__context *s); static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PIC static int stbi__pic_test(stbi__context *s); static stbi_uc *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_GIF static int stbi__gif_test(stbi__context *s); static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PNM static int stbi__pnm_test(stbi__context *s); static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp); #endif // this is not threadsafe static const char *stbi__g_failure_reason; STBIDEF const char *stbi_failure_reason(void) { return stbi__g_failure_reason; } static int stbi__err(const char *str) { stbi__g_failure_reason = str; return 0; } static void *stbi__malloc(size_t size) { return STBI_MALLOC(size); } // stbi__err - error // stbi__errpf - error returning pointer to float // stbi__errpuc - error returning pointer to unsigned char #ifdef STBI_NO_FAILURE_STRINGS #define stbi__err(x,y) 0 #elif defined(STBI_FAILURE_USERMSG) #define stbi__err(x,y) stbi__err(y) #else #define stbi__err(x,y) stbi__err(x) #endif #define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL)) #define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL)) STBIDEF void stbi_image_free(void *retval_from_stbi_load) { STBI_FREE(retval_from_stbi_load); } #ifndef STBI_NO_LINEAR static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp); #endif #ifndef STBI_NO_HDR static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp); #endif static int stbi__vertically_flip_on_load = 0; STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip) { stbi__vertically_flip_on_load = flag_true_if_should_flip; } static unsigned char *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) { #ifndef STBI_NO_JPEG if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp); #endif #ifndef STBI_NO_PNG if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp); #endif #ifndef STBI_NO_BMP if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp); #endif #ifndef STBI_NO_GIF if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp); #endif #ifndef STBI_NO_PSD if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp); #endif #ifndef STBI_NO_PIC if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp); #endif #ifndef STBI_NO_PNM if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp); #endif #ifndef STBI_NO_HDR if (stbi__hdr_test(s)) { float *hdr = stbi__hdr_load(s, x,y,comp,req_comp); return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); } #endif #ifndef STBI_NO_TGA // test tga last because it's a crappy test! if (stbi__tga_test(s)) return stbi__tga_load(s,x,y,comp,req_comp); #endif return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt"); } static unsigned char *stbi__load_flip(stbi__context *s, int *x, int *y, int *comp, int req_comp) { unsigned char *result = stbi__load_main(s, x, y, comp, req_comp); if (stbi__vertically_flip_on_load && result != NULL) { int w = *x, h = *y; int depth = req_comp ? req_comp : *comp; int row,col,z; stbi_uc temp; // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once for (row = 0; row < (h>>1); row++) { for (col = 0; col < w; col++) { for (z = 0; z < depth; z++) { temp = result[(row * w + col) * depth + z]; result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z]; result[((h - row - 1) * w + col) * depth + z] = temp; } } } } return result; } #ifndef STBI_NO_HDR static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp) { if (stbi__vertically_flip_on_load && result != NULL) { int w = *x, h = *y; int depth = req_comp ? req_comp : *comp; int row,col,z; float temp; // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once for (row = 0; row < (h>>1); row++) { for (col = 0; col < w; col++) { for (z = 0; z < depth; z++) { temp = result[(row * w + col) * depth + z]; result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z]; result[((h - row - 1) * w + col) * depth + z] = temp; } } } } } #endif #ifndef STBI_NO_STDIO static FILE *stbi__fopen(char const *filename, char const *mode) { FILE *f; #if defined(_MSC_VER) && _MSC_VER >= 1400 if (0 != fopen_s(&f, filename, mode)) f=0; #else f = fopen(filename, mode); #endif return f; } STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp) { FILE *f = stbi__fopen(filename, "rb"); unsigned char *result; if (!f) return stbi__errpuc("can't fopen", "Unable to open file"); result = stbi_load_from_file(f,x,y,comp,req_comp); fclose(f); return result; } STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) { unsigned char *result; stbi__context s; stbi__start_file(&s,f); result = stbi__load_flip(&s,x,y,comp,req_comp); if (result) { // need to 'unget' all the characters in the IO buffer fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR); } return result; } #endif //!STBI_NO_STDIO STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_mem(&s,buffer,len); return stbi__load_flip(&s,x,y,comp,req_comp); } STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); return stbi__load_flip(&s,x,y,comp,req_comp); } #ifndef STBI_NO_LINEAR static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) { unsigned char *data; #ifndef STBI_NO_HDR if (stbi__hdr_test(s)) { float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp); if (hdr_data) stbi__float_postprocess(hdr_data,x,y,comp,req_comp); return hdr_data; } #endif data = stbi__load_flip(s, x, y, comp, req_comp); if (data) return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); } STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_mem(&s,buffer,len); return stbi__loadf_main(&s,x,y,comp,req_comp); } STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); return stbi__loadf_main(&s,x,y,comp,req_comp); } #ifndef STBI_NO_STDIO STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp) { float *result; FILE *f = stbi__fopen(filename, "rb"); if (!f) return stbi__errpf("can't fopen", "Unable to open file"); result = stbi_loadf_from_file(f,x,y,comp,req_comp); fclose(f); return result; } STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_file(&s,f); return stbi__loadf_main(&s,x,y,comp,req_comp); } #endif // !STBI_NO_STDIO #endif // !STBI_NO_LINEAR // these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is // defined, for API simplicity; if STBI_NO_LINEAR is defined, it always // reports false! STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len) { #ifndef STBI_NO_HDR stbi__context s; stbi__start_mem(&s,buffer,len); return stbi__hdr_test(&s); #else STBI_NOTUSED(buffer); STBI_NOTUSED(len); return 0; #endif } #ifndef STBI_NO_STDIO STBIDEF int stbi_is_hdr (char const *filename) { FILE *f = stbi__fopen(filename, "rb"); int result=0; if (f) { result = stbi_is_hdr_from_file(f); fclose(f); } return result; } STBIDEF int stbi_is_hdr_from_file(FILE *f) { #ifndef STBI_NO_HDR stbi__context s; stbi__start_file(&s,f); return stbi__hdr_test(&s); #else STBI_NOTUSED(f); return 0; #endif } #endif // !STBI_NO_STDIO STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user) { #ifndef STBI_NO_HDR stbi__context s; stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); return stbi__hdr_test(&s); #else STBI_NOTUSED(clbk); STBI_NOTUSED(user); return 0; #endif } #ifndef STBI_NO_LINEAR static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f; STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; } STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; } #endif static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f; STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; } STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; } ////////////////////////////////////////////////////////////////////////////// // // Common code used by all image loaders // enum { STBI__SCAN_load=0, STBI__SCAN_type, STBI__SCAN_header }; static void stbi__refill_buffer(stbi__context *s) { int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen); if (n == 0) { // at end of file, treat same as if from memory, but need to handle case // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file s->read_from_callbacks = 0; s->img_buffer = s->buffer_start; s->img_buffer_end = s->buffer_start+1; *s->img_buffer = 0; } else { s->img_buffer = s->buffer_start; s->img_buffer_end = s->buffer_start + n; } } stbi_inline static stbi_uc stbi__get8(stbi__context *s) { if (s->img_buffer < s->img_buffer_end) return *s->img_buffer++; if (s->read_from_callbacks) { stbi__refill_buffer(s); return *s->img_buffer++; } return 0; } stbi_inline static int stbi__at_eof(stbi__context *s) { if (s->io.read) { if (!(s->io.eof)(s->io_user_data)) return 0; // if feof() is true, check if buffer = end // special case: we've only got the special 0 character at the end if (s->read_from_callbacks == 0) return 1; } return s->img_buffer >= s->img_buffer_end; } static void stbi__skip(stbi__context *s, int n) { if (n < 0) { s->img_buffer = s->img_buffer_end; return; } if (s->io.read) { int blen = (int) (s->img_buffer_end - s->img_buffer); if (blen < n) { s->img_buffer = s->img_buffer_end; (s->io.skip)(s->io_user_data, n - blen); return; } } s->img_buffer += n; } static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n) { if (s->io.read) { int blen = (int) (s->img_buffer_end - s->img_buffer); if (blen < n) { int res, count; memcpy(buffer, s->img_buffer, blen); count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen); res = (count == (n-blen)); s->img_buffer = s->img_buffer_end; return res; } } if (s->img_buffer+n <= s->img_buffer_end) { memcpy(buffer, s->img_buffer, n); s->img_buffer += n; return 1; } else return 0; } static int stbi__get16be(stbi__context *s) { int z = stbi__get8(s); return (z << 8) + stbi__get8(s); } static stbi__uint32 stbi__get32be(stbi__context *s) { stbi__uint32 z = stbi__get16be(s); return (z << 16) + stbi__get16be(s); } #if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) // nothing #else static int stbi__get16le(stbi__context *s) { int z = stbi__get8(s); return z + (stbi__get8(s) << 8); } #endif #ifndef STBI_NO_BMP static stbi__uint32 stbi__get32le(stbi__context *s) { stbi__uint32 z = stbi__get16le(s); return z + (stbi__get16le(s) << 16); } #endif #define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings ////////////////////////////////////////////////////////////////////////////// // // generic converter from built-in img_n to req_comp // individual types do this automatically as much as possible (e.g. jpeg // does all cases internally since it needs to colorspace convert anyway, // and it never has alpha, so very few cases ). png can automatically // interleave an alpha=255 channel, but falls back to this for other cases // // assume data buffer is malloced, so malloc a new one and free that one // only failure mode is malloc failing static stbi_uc stbi__compute_y(int r, int g, int b) { return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8); } static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) { int i,j; unsigned char *good; if (req_comp == img_n) return data; STBI_ASSERT(req_comp >= 1 && req_comp <= 4); good = (unsigned char *) stbi__malloc(req_comp * x * y); if (good == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); } for (j=0; j < (int) y; ++j) { unsigned char *src = data + j * x * img_n ; unsigned char *dest = good + j * x * req_comp; #define COMBO(a,b) ((a)*8+(b)) #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) // convert source image with img_n components to one with req_comp components; // avoid switch per pixel, so use switch per scanline and massive macros switch (COMBO(img_n, req_comp)) { CASE(1,2) { dest[0]=src[0], dest[1]=255; } break; CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; } break; CASE(2,1) { dest[0]=src[0]; } break; CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break; CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; } break; CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; } break; CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; } break; CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break; default: STBI_ASSERT(0); } #undef CASE } STBI_FREE(data); return good; } #ifndef STBI_NO_LINEAR static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) { int i,k,n; float *output = (float *) stbi__malloc(x * y * comp * sizeof(float)); if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); } // compute number of non-alpha components if (comp & 1) n = comp; else n = comp-1; for (i=0; i < x*y; ++i) { for (k=0; k < n; ++k) { output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale); } if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f; } STBI_FREE(data); return output; } #endif #ifndef STBI_NO_HDR #define stbi__float2int(x) ((int) (x)) static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) { int i,k,n; stbi_uc *output = (stbi_uc *) stbi__malloc(x * y * comp); if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); } // compute number of non-alpha components if (comp & 1) n = comp; else n = comp-1; for (i=0; i < x*y; ++i) { for (k=0; k < n; ++k) { float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f; if (z < 0) z = 0; if (z > 255) z = 255; output[i*comp + k] = (stbi_uc) stbi__float2int(z); } if (k < comp) { float z = data[i*comp+k] * 255 + 0.5f; if (z < 0) z = 0; if (z > 255) z = 255; output[i*comp + k] = (stbi_uc) stbi__float2int(z); } } STBI_FREE(data); return output; } #endif ////////////////////////////////////////////////////////////////////////////// // // "baseline" JPEG/JFIF decoder // // simple implementation // - doesn't support delayed output of y-dimension // - simple interface (only one output format: 8-bit interleaved RGB) // - doesn't try to recover corrupt jpegs // - doesn't allow partial loading, loading multiple at once // - still fast on x86 (copying globals into locals doesn't help x86) // - allocates lots of intermediate memory (full size of all components) // - non-interleaved case requires this anyway // - allows good upsampling (see next) // high-quality // - upsampled channels are bilinearly interpolated, even across blocks // - quality integer IDCT derived from IJG's 'slow' // performance // - fast huffman; reasonable integer IDCT // - some SIMD kernels for common paths on targets with SSE2/NEON // - uses a lot of intermediate memory, could cache poorly #ifndef STBI_NO_JPEG // huffman decoding acceleration #define FAST_BITS 9 // larger handles more cases; smaller stomps less cache typedef struct { stbi_uc fast[1 << FAST_BITS]; // weirdly, repacking this into AoS is a 10% speed loss, instead of a win stbi__uint16 code[256]; stbi_uc values[256]; stbi_uc size[257]; unsigned int maxcode[18]; int delta[17]; // old 'firstsymbol' - old 'firstcode' } stbi__huffman; typedef struct { stbi__context *s; stbi__huffman huff_dc[4]; stbi__huffman huff_ac[4]; stbi_uc dequant[4][64]; stbi__int16 fast_ac[4][1 << FAST_BITS]; // sizes for components, interleaved MCUs int img_h_max, img_v_max; int img_mcu_x, img_mcu_y; int img_mcu_w, img_mcu_h; // definition of jpeg image component struct { int id; int h,v; int tq; int hd,ha; int dc_pred; int x,y,w2,h2; stbi_uc *data; void *raw_data, *raw_coeff; stbi_uc *linebuf; short *coeff; // progressive only int coeff_w, coeff_h; // number of 8x8 coefficient blocks } img_comp[4]; stbi__uint32 code_buffer; // jpeg entropy-coded buffer int code_bits; // number of valid bits unsigned char marker; // marker seen while filling entropy buffer int nomore; // flag if we saw a marker so must stop int progressive; int spec_start; int spec_end; int succ_high; int succ_low; int eob_run; int rgb; int scan_n, order[4]; int restart_interval, todo; // kernels void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]); void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step); stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs); } stbi__jpeg; static int stbi__build_huffman(stbi__huffman *h, int *count) { int i,j,k=0,code; // build size list for each symbol (from JPEG spec) for (i=0; i < 16; ++i) for (j=0; j < count[i]; ++j) h->size[k++] = (stbi_uc) (i+1); h->size[k] = 0; // compute actual symbols (from jpeg spec) code = 0; k = 0; for(j=1; j <= 16; ++j) { // compute delta to add to code to compute symbol id h->delta[j] = k - code; if (h->size[k] == j) { while (h->size[k] == j) h->code[k++] = (stbi__uint16) (code++); if (code-1 >= (1 << j)) return stbi__err("bad code lengths","Corrupt JPEG"); } // compute largest code + 1 for this size, preshifted as needed later h->maxcode[j] = code << (16-j); code <<= 1; } h->maxcode[j] = 0xffffffff; // build non-spec acceleration table; 255 is flag for not-accelerated memset(h->fast, 255, 1 << FAST_BITS); for (i=0; i < k; ++i) { int s = h->size[i]; if (s <= FAST_BITS) { int c = h->code[i] << (FAST_BITS-s); int m = 1 << (FAST_BITS-s); for (j=0; j < m; ++j) { h->fast[c+j] = (stbi_uc) i; } } } return 1; } // build a table that decodes both magnitude and value of small ACs in // one go. static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h) { int i; for (i=0; i < (1 << FAST_BITS); ++i) { stbi_uc fast = h->fast[i]; fast_ac[i] = 0; if (fast < 255) { int rs = h->values[fast]; int run = (rs >> 4) & 15; int magbits = rs & 15; int len = h->size[fast]; if (magbits && len + magbits <= FAST_BITS) { // magnitude code followed by receive_extend code int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits); int m = 1 << (magbits - 1); if (k < m) k += (-1 << magbits) + 1; // if the result is small enough, we can fit it in fast_ac table if (k >= -128 && k <= 127) fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits)); } } } } static void stbi__grow_buffer_unsafe(stbi__jpeg *j) { do { int b = j->nomore ? 0 : stbi__get8(j->s); if (b == 0xff) { int c = stbi__get8(j->s); if (c != 0) { j->marker = (unsigned char) c; j->nomore = 1; return; } } j->code_buffer |= b << (24 - j->code_bits); j->code_bits += 8; } while (j->code_bits <= 24); } // (1 << n) - 1 static stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}; // decode a jpeg huffman value from the bitstream stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) { unsigned int temp; int c,k; if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); // look at the top FAST_BITS and determine what symbol ID it is, // if the code is <= FAST_BITS c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); k = h->fast[c]; if (k < 255) { int s = h->size[k]; if (s > j->code_bits) return -1; j->code_buffer <<= s; j->code_bits -= s; return h->values[k]; } // naive test is to shift the code_buffer down so k bits are // valid, then test against maxcode. To speed this up, we've // preshifted maxcode left so that it has (16-k) 0s at the // end; in other words, regardless of the number of bits, it // wants to be compared against something shifted to have 16; // that way we don't need to shift inside the loop. temp = j->code_buffer >> 16; for (k=FAST_BITS+1 ; ; ++k) if (temp < h->maxcode[k]) break; if (k == 17) { // error! code not found j->code_bits -= 16; return -1; } if (k > j->code_bits) return -1; // convert the huffman code to the symbol id c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k]; STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]); // convert the id to a symbol j->code_bits -= k; j->code_buffer <<= k; return h->values[c]; } // bias[n] = (-1<code_bits < n) stbi__grow_buffer_unsafe(j); sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB k = stbi_lrot(j->code_buffer, n); STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask))); j->code_buffer = k & ~stbi__bmask[n]; k &= stbi__bmask[n]; j->code_bits -= n; return k + (stbi__jbias[n] & ~sgn); } // get some unsigned bits stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n) { unsigned int k; if (j->code_bits < n) stbi__grow_buffer_unsafe(j); k = stbi_lrot(j->code_buffer, n); j->code_buffer = k & ~stbi__bmask[n]; k &= stbi__bmask[n]; j->code_bits -= n; return k; } stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j) { unsigned int k; if (j->code_bits < 1) stbi__grow_buffer_unsafe(j); k = j->code_buffer; j->code_buffer <<= 1; --j->code_bits; return k & 0x80000000; } // given a value that's at position X in the zigzag stream, // where does it appear in the 8x8 matrix coded as row-major? static stbi_uc stbi__jpeg_dezigzag[64+15] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, // let corrupt input sample past end 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }; // decode one 64-entry block-- static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant) { int diff,dc,k; int t; if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); t = stbi__jpeg_huff_decode(j, hdc); if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG"); // 0 all the ac values now so we can do it 32-bits at a time memset(data,0,64*sizeof(data[0])); diff = t ? stbi__extend_receive(j, t) : 0; dc = j->img_comp[b].dc_pred + diff; j->img_comp[b].dc_pred = dc; data[0] = (short) (dc * dequant[0]); // decode AC components, see JPEG spec k = 1; do { unsigned int zig; int c,r,s; if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); r = fac[c]; if (r) { // fast-AC path k += (r >> 4) & 15; // run s = r & 15; // combined length j->code_buffer <<= s; j->code_bits -= s; // decode into unzigzag'd location zig = stbi__jpeg_dezigzag[k++]; data[zig] = (short) ((r >> 8) * dequant[zig]); } else { int rs = stbi__jpeg_huff_decode(j, hac); if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); s = rs & 15; r = rs >> 4; if (s == 0) { if (rs != 0xf0) break; // end block k += 16; } else { k += r; // decode into unzigzag'd location zig = stbi__jpeg_dezigzag[k++]; data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]); } } } while (k < 64); return 1; } static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b) { int diff,dc; int t; if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); if (j->succ_high == 0) { // first scan for DC coefficient, must be first memset(data,0,64*sizeof(data[0])); // 0 all the ac values now t = stbi__jpeg_huff_decode(j, hdc); diff = t ? stbi__extend_receive(j, t) : 0; dc = j->img_comp[b].dc_pred + diff; j->img_comp[b].dc_pred = dc; data[0] = (short) (dc << j->succ_low); } else { // refinement scan for DC coefficient if (stbi__jpeg_get_bit(j)) data[0] += (short) (1 << j->succ_low); } return 1; } // @OPTIMIZE: store non-zigzagged during the decode passes, // and only de-zigzag when dequantizing static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac) { int k; if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); if (j->succ_high == 0) { int shift = j->succ_low; if (j->eob_run) { --j->eob_run; return 1; } k = j->spec_start; do { unsigned int zig; int c,r,s; if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); r = fac[c]; if (r) { // fast-AC path k += (r >> 4) & 15; // run s = r & 15; // combined length j->code_buffer <<= s; j->code_bits -= s; zig = stbi__jpeg_dezigzag[k++]; data[zig] = (short) ((r >> 8) << shift); } else { int rs = stbi__jpeg_huff_decode(j, hac); if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); s = rs & 15; r = rs >> 4; if (s == 0) { if (r < 15) { j->eob_run = (1 << r); if (r) j->eob_run += stbi__jpeg_get_bits(j, r); --j->eob_run; break; } k += 16; } else { k += r; zig = stbi__jpeg_dezigzag[k++]; data[zig] = (short) (stbi__extend_receive(j,s) << shift); } } } while (k <= j->spec_end); } else { // refinement scan for these AC coefficients short bit = (short) (1 << j->succ_low); if (j->eob_run) { --j->eob_run; for (k = j->spec_start; k <= j->spec_end; ++k) { short *p = &data[stbi__jpeg_dezigzag[k]]; if (*p != 0) if (stbi__jpeg_get_bit(j)) if ((*p & bit)==0) { if (*p > 0) *p += bit; else *p -= bit; } } } else { k = j->spec_start; do { int r,s; int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); s = rs & 15; r = rs >> 4; if (s == 0) { if (r < 15) { j->eob_run = (1 << r) - 1; if (r) j->eob_run += stbi__jpeg_get_bits(j, r); r = 64; // force end of block } else { // r=15 s=0 should write 16 0s, so we just do // a run of 15 0s and then write s (which is 0), // so we don't have to do anything special here } } else { if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG"); // sign bit if (stbi__jpeg_get_bit(j)) s = bit; else s = -bit; } // advance by r while (k <= j->spec_end) { short *p = &data[stbi__jpeg_dezigzag[k++]]; if (*p != 0) { if (stbi__jpeg_get_bit(j)) if ((*p & bit)==0) { if (*p > 0) *p += bit; else *p -= bit; } } else { if (r == 0) { *p = (short) s; break; } --r; } } } while (k <= j->spec_end); } } return 1; } // take a -128..127 value and stbi__clamp it and convert to 0..255 stbi_inline static stbi_uc stbi__clamp(int x) { // trick to use a single test to catch both cases if ((unsigned int) x > 255) { if (x < 0) return 0; if (x > 255) return 255; } return (stbi_uc) x; } #define stbi__f2f(x) ((int) (((x) * 4096 + 0.5))) #define stbi__fsh(x) ((x) << 12) // derived from jidctint -- DCT_ISLOW #define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \ int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \ p2 = s2; \ p3 = s6; \ p1 = (p2+p3) * stbi__f2f(0.5411961f); \ t2 = p1 + p3*stbi__f2f(-1.847759065f); \ t3 = p1 + p2*stbi__f2f( 0.765366865f); \ p2 = s0; \ p3 = s4; \ t0 = stbi__fsh(p2+p3); \ t1 = stbi__fsh(p2-p3); \ x0 = t0+t3; \ x3 = t0-t3; \ x1 = t1+t2; \ x2 = t1-t2; \ t0 = s7; \ t1 = s5; \ t2 = s3; \ t3 = s1; \ p3 = t0+t2; \ p4 = t1+t3; \ p1 = t0+t3; \ p2 = t1+t2; \ p5 = (p3+p4)*stbi__f2f( 1.175875602f); \ t0 = t0*stbi__f2f( 0.298631336f); \ t1 = t1*stbi__f2f( 2.053119869f); \ t2 = t2*stbi__f2f( 3.072711026f); \ t3 = t3*stbi__f2f( 1.501321110f); \ p1 = p5 + p1*stbi__f2f(-0.899976223f); \ p2 = p5 + p2*stbi__f2f(-2.562915447f); \ p3 = p3*stbi__f2f(-1.961570560f); \ p4 = p4*stbi__f2f(-0.390180644f); \ t3 += p1+p4; \ t2 += p2+p3; \ t1 += p2+p4; \ t0 += p1+p3; static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64]) { int i,val[64],*v=val; stbi_uc *o; short *d = data; // columns for (i=0; i < 8; ++i,++d, ++v) { // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0 && d[40]==0 && d[48]==0 && d[56]==0) { // no shortcut 0 seconds // (1|2|3|4|5|6|7)==0 0 seconds // all separate -0.047 seconds // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds int dcterm = d[0] << 2; v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm; } else { STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56]) // constants scaled things up by 1<<12; let's bring them back // down, but keep 2 extra bits of precision x0 += 512; x1 += 512; x2 += 512; x3 += 512; v[ 0] = (x0+t3) >> 10; v[56] = (x0-t3) >> 10; v[ 8] = (x1+t2) >> 10; v[48] = (x1-t2) >> 10; v[16] = (x2+t1) >> 10; v[40] = (x2-t1) >> 10; v[24] = (x3+t0) >> 10; v[32] = (x3-t0) >> 10; } } for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) { // no fast case since the first 1D IDCT spread components out STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]) // constants scaled things up by 1<<12, plus we had 1<<2 from first // loop, plus horizontal and vertical each scale by sqrt(8) so together // we've got an extra 1<<3, so 1<<17 total we need to remove. // so we want to round that, which means adding 0.5 * 1<<17, // aka 65536. Also, we'll end up with -128 to 127 that we want // to encode as 0..255 by adding 128, so we'll add that before the shift x0 += 65536 + (128<<17); x1 += 65536 + (128<<17); x2 += 65536 + (128<<17); x3 += 65536 + (128<<17); // tried computing the shifts into temps, or'ing the temps to see // if any were out of range, but that was slower o[0] = stbi__clamp((x0+t3) >> 17); o[7] = stbi__clamp((x0-t3) >> 17); o[1] = stbi__clamp((x1+t2) >> 17); o[6] = stbi__clamp((x1-t2) >> 17); o[2] = stbi__clamp((x2+t1) >> 17); o[5] = stbi__clamp((x2-t1) >> 17); o[3] = stbi__clamp((x3+t0) >> 17); o[4] = stbi__clamp((x3-t0) >> 17); } } #ifdef STBI_SSE2 // sse2 integer IDCT. not the fastest possible implementation but it // produces bit-identical results to the generic C version so it's // fully "transparent". static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { // This is constructed to match our regular (generic) integer IDCT exactly. __m128i row0, row1, row2, row3, row4, row5, row6, row7; __m128i tmp; // dot product constant: even elems=x, odd elems=y #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y)) // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit) // out(1) = c1[even]*x + c1[odd]*y #define dct_rot(out0,out1, x,y,c0,c1) \ __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \ __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \ __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ __m128i out1##_h = _mm_madd_epi16(c0##hi, c1) // out = in << 12 (in 16-bit, out 32-bit) #define dct_widen(out, in) \ __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4) // wide add #define dct_wadd(out, a, b) \ __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ __m128i out##_h = _mm_add_epi32(a##_h, b##_h) // wide sub #define dct_wsub(out, a, b) \ __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ __m128i out##_h = _mm_sub_epi32(a##_h, b##_h) // butterfly a/b, add bias, then shift by "s" and pack #define dct_bfly32o(out0, out1, a,b,bias,s) \ { \ __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ dct_wadd(sum, abiased, b); \ dct_wsub(dif, abiased, b); \ out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ } // 8-bit interleave step (for transposes) #define dct_interleave8(a, b) \ tmp = a; \ a = _mm_unpacklo_epi8(a, b); \ b = _mm_unpackhi_epi8(tmp, b) // 16-bit interleave step (for transposes) #define dct_interleave16(a, b) \ tmp = a; \ a = _mm_unpacklo_epi16(a, b); \ b = _mm_unpackhi_epi16(tmp, b) #define dct_pass(bias,shift) \ { \ /* even part */ \ dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \ __m128i sum04 = _mm_add_epi16(row0, row4); \ __m128i dif04 = _mm_sub_epi16(row0, row4); \ dct_widen(t0e, sum04); \ dct_widen(t1e, dif04); \ dct_wadd(x0, t0e, t3e); \ dct_wsub(x3, t0e, t3e); \ dct_wadd(x1, t1e, t2e); \ dct_wsub(x2, t1e, t2e); \ /* odd part */ \ dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \ dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \ __m128i sum17 = _mm_add_epi16(row1, row7); \ __m128i sum35 = _mm_add_epi16(row3, row5); \ dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \ dct_wadd(x4, y0o, y4o); \ dct_wadd(x5, y1o, y5o); \ dct_wadd(x6, y2o, y5o); \ dct_wadd(x7, y3o, y4o); \ dct_bfly32o(row0,row7, x0,x7,bias,shift); \ dct_bfly32o(row1,row6, x1,x6,bias,shift); \ dct_bfly32o(row2,row5, x2,x5,bias,shift); \ dct_bfly32o(row3,row4, x3,x4,bias,shift); \ } __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f)); __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f)); __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f)); __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f)); __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f)); __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f)); __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f)); __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f)); // rounding biases in column/row passes, see stbi__idct_block for explanation. __m128i bias_0 = _mm_set1_epi32(512); __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17)); // load row0 = _mm_load_si128((const __m128i *) (data + 0*8)); row1 = _mm_load_si128((const __m128i *) (data + 1*8)); row2 = _mm_load_si128((const __m128i *) (data + 2*8)); row3 = _mm_load_si128((const __m128i *) (data + 3*8)); row4 = _mm_load_si128((const __m128i *) (data + 4*8)); row5 = _mm_load_si128((const __m128i *) (data + 5*8)); row6 = _mm_load_si128((const __m128i *) (data + 6*8)); row7 = _mm_load_si128((const __m128i *) (data + 7*8)); // column pass dct_pass(bias_0, 10); { // 16bit 8x8 transpose pass 1 dct_interleave16(row0, row4); dct_interleave16(row1, row5); dct_interleave16(row2, row6); dct_interleave16(row3, row7); // transpose pass 2 dct_interleave16(row0, row2); dct_interleave16(row1, row3); dct_interleave16(row4, row6); dct_interleave16(row5, row7); // transpose pass 3 dct_interleave16(row0, row1); dct_interleave16(row2, row3); dct_interleave16(row4, row5); dct_interleave16(row6, row7); } // row pass dct_pass(bias_1, 17); { // pack __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7 __m128i p1 = _mm_packus_epi16(row2, row3); __m128i p2 = _mm_packus_epi16(row4, row5); __m128i p3 = _mm_packus_epi16(row6, row7); // 8bit 8x8 transpose pass 1 dct_interleave8(p0, p2); // a0e0a1e1... dct_interleave8(p1, p3); // c0g0c1g1... // transpose pass 2 dct_interleave8(p0, p1); // a0c0e0g0... dct_interleave8(p2, p3); // b0d0f0h0... // transpose pass 3 dct_interleave8(p0, p2); // a0b0c0d0... dct_interleave8(p1, p3); // a4b4c4d4... // store _mm_storel_epi64((__m128i *) out, p0); out += out_stride; _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride; _mm_storel_epi64((__m128i *) out, p2); out += out_stride; _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride; _mm_storel_epi64((__m128i *) out, p1); out += out_stride; _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride; _mm_storel_epi64((__m128i *) out, p3); out += out_stride; _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e)); } #undef dct_const #undef dct_rot #undef dct_widen #undef dct_wadd #undef dct_wsub #undef dct_bfly32o #undef dct_interleave8 #undef dct_interleave16 #undef dct_pass } #endif // STBI_SSE2 #ifdef STBI_NEON // NEON integer IDCT. should produce bit-identical // results to the generic C version. static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) { int16x8_t row0, row1, row2, row3, row4, row5, row6, row7; int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f)); int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f)); int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f)); int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f)); int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f)); int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f)); int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f)); int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f)); int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f)); int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f)); int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f)); int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f)); #define dct_long_mul(out, inq, coeff) \ int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff) #define dct_long_mac(out, acc, inq, coeff) \ int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff) #define dct_widen(out, inq) \ int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12) // wide add #define dct_wadd(out, a, b) \ int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ int32x4_t out##_h = vaddq_s32(a##_h, b##_h) // wide sub #define dct_wsub(out, a, b) \ int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ int32x4_t out##_h = vsubq_s32(a##_h, b##_h) // butterfly a/b, then shift using "shiftop" by "s" and pack #define dct_bfly32o(out0,out1, a,b,shiftop,s) \ { \ dct_wadd(sum, a, b); \ dct_wsub(dif, a, b); \ out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ } #define dct_pass(shiftop, shift) \ { \ /* even part */ \ int16x8_t sum26 = vaddq_s16(row2, row6); \ dct_long_mul(p1e, sum26, rot0_0); \ dct_long_mac(t2e, p1e, row6, rot0_1); \ dct_long_mac(t3e, p1e, row2, rot0_2); \ int16x8_t sum04 = vaddq_s16(row0, row4); \ int16x8_t dif04 = vsubq_s16(row0, row4); \ dct_widen(t0e, sum04); \ dct_widen(t1e, dif04); \ dct_wadd(x0, t0e, t3e); \ dct_wsub(x3, t0e, t3e); \ dct_wadd(x1, t1e, t2e); \ dct_wsub(x2, t1e, t2e); \ /* odd part */ \ int16x8_t sum15 = vaddq_s16(row1, row5); \ int16x8_t sum17 = vaddq_s16(row1, row7); \ int16x8_t sum35 = vaddq_s16(row3, row5); \ int16x8_t sum37 = vaddq_s16(row3, row7); \ int16x8_t sumodd = vaddq_s16(sum17, sum35); \ dct_long_mul(p5o, sumodd, rot1_0); \ dct_long_mac(p1o, p5o, sum17, rot1_1); \ dct_long_mac(p2o, p5o, sum35, rot1_2); \ dct_long_mul(p3o, sum37, rot2_0); \ dct_long_mul(p4o, sum15, rot2_1); \ dct_wadd(sump13o, p1o, p3o); \ dct_wadd(sump24o, p2o, p4o); \ dct_wadd(sump23o, p2o, p3o); \ dct_wadd(sump14o, p1o, p4o); \ dct_long_mac(x4, sump13o, row7, rot3_0); \ dct_long_mac(x5, sump24o, row5, rot3_1); \ dct_long_mac(x6, sump23o, row3, rot3_2); \ dct_long_mac(x7, sump14o, row1, rot3_3); \ dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \ dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \ dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \ dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \ } // load row0 = vld1q_s16(data + 0*8); row1 = vld1q_s16(data + 1*8); row2 = vld1q_s16(data + 2*8); row3 = vld1q_s16(data + 3*8); row4 = vld1q_s16(data + 4*8); row5 = vld1q_s16(data + 5*8); row6 = vld1q_s16(data + 6*8); row7 = vld1q_s16(data + 7*8); // add DC bias row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0)); // column pass dct_pass(vrshrn_n_s32, 10); // 16bit 8x8 transpose { // these three map to a single VTRN.16, VTRN.32, and VSWP, respectively. // whether compilers actually get this is another story, sadly. #define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; } #define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); } #define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); } // pass 1 dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6 dct_trn16(row2, row3); dct_trn16(row4, row5); dct_trn16(row6, row7); // pass 2 dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4 dct_trn32(row1, row3); dct_trn32(row4, row6); dct_trn32(row5, row7); // pass 3 dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0 dct_trn64(row1, row5); dct_trn64(row2, row6); dct_trn64(row3, row7); #undef dct_trn16 #undef dct_trn32 #undef dct_trn64 } // row pass // vrshrn_n_s32 only supports shifts up to 16, we need // 17. so do a non-rounding shift of 16 first then follow // up with a rounding shift by 1. dct_pass(vshrn_n_s32, 16); { // pack and round uint8x8_t p0 = vqrshrun_n_s16(row0, 1); uint8x8_t p1 = vqrshrun_n_s16(row1, 1); uint8x8_t p2 = vqrshrun_n_s16(row2, 1); uint8x8_t p3 = vqrshrun_n_s16(row3, 1); uint8x8_t p4 = vqrshrun_n_s16(row4, 1); uint8x8_t p5 = vqrshrun_n_s16(row5, 1); uint8x8_t p6 = vqrshrun_n_s16(row6, 1); uint8x8_t p7 = vqrshrun_n_s16(row7, 1); // again, these can translate into one instruction, but often don't. #define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; } #define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); } #define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); } // sadly can't use interleaved stores here since we only write // 8 bytes to each scan line! // 8x8 8-bit transpose pass 1 dct_trn8_8(p0, p1); dct_trn8_8(p2, p3); dct_trn8_8(p4, p5); dct_trn8_8(p6, p7); // pass 2 dct_trn8_16(p0, p2); dct_trn8_16(p1, p3); dct_trn8_16(p4, p6); dct_trn8_16(p5, p7); // pass 3 dct_trn8_32(p0, p4); dct_trn8_32(p1, p5); dct_trn8_32(p2, p6); dct_trn8_32(p3, p7); // store vst1_u8(out, p0); out += out_stride; vst1_u8(out, p1); out += out_stride; vst1_u8(out, p2); out += out_stride; vst1_u8(out, p3); out += out_stride; vst1_u8(out, p4); out += out_stride; vst1_u8(out, p5); out += out_stride; vst1_u8(out, p6); out += out_stride; vst1_u8(out, p7); #undef dct_trn8_8 #undef dct_trn8_16 #undef dct_trn8_32 } #undef dct_long_mul #undef dct_long_mac #undef dct_widen #undef dct_wadd #undef dct_wsub #undef dct_bfly32o #undef dct_pass } #endif // STBI_NEON #define STBI__MARKER_none 0xff // if there's a pending marker from the entropy stream, return that // otherwise, fetch from the stream and get a marker. if there's no // marker, return 0xff, which is never a valid marker value static stbi_uc stbi__get_marker(stbi__jpeg *j) { stbi_uc x; if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; } x = stbi__get8(j->s); if (x != 0xff) return STBI__MARKER_none; while (x == 0xff) x = stbi__get8(j->s); return x; } // in each scan, we'll have scan_n components, and the order // of the components is specified by order[] #define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7) // after a restart interval, stbi__jpeg_reset the entropy decoder and // the dc prediction static void stbi__jpeg_reset(stbi__jpeg *j) { j->code_bits = 0; j->code_buffer = 0; j->nomore = 0; j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0; j->marker = STBI__MARKER_none; j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff; j->eob_run = 0; // no more than 1<<31 MCUs if no restart_interal? that's plenty safe, // since we don't even allow 1<<30 pixels } static int stbi__parse_entropy_coded_data(stbi__jpeg *z) { stbi__jpeg_reset(z); if (!z->progressive) { if (z->scan_n == 1) { int i,j; STBI_SIMD_ALIGN(short, data[64]); int n = z->order[0]; // non-interleaved data, we just need to process one block at a time, // in trivial scanline order // number of blocks to do just depends on how many actual "pixels" this // component has, independent of interleaved MCU blocking and such int w = (z->img_comp[n].x+7) >> 3; int h = (z->img_comp[n].y+7) >> 3; for (j=0; j < h; ++j) { for (i=0; i < w; ++i) { int ha = z->img_comp[n].ha; if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); // every data block is an MCU, so countdown the restart interval if (--z->todo <= 0) { if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); // if it's NOT a restart, then just bail, so we get corrupt data // rather than no data if (!STBI__RESTART(z->marker)) return 1; stbi__jpeg_reset(z); } } } return 1; } else { // interleaved int i,j,k,x,y; STBI_SIMD_ALIGN(short, data[64]); for (j=0; j < z->img_mcu_y; ++j) { for (i=0; i < z->img_mcu_x; ++i) { // scan an interleaved mcu... process scan_n components in order for (k=0; k < z->scan_n; ++k) { int n = z->order[k]; // scan out an mcu's worth of this component; that's just determined // by the basic H and V specified for the component for (y=0; y < z->img_comp[n].v; ++y) { for (x=0; x < z->img_comp[n].h; ++x) { int x2 = (i*z->img_comp[n].h + x)*8; int y2 = (j*z->img_comp[n].v + y)*8; int ha = z->img_comp[n].ha; if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data); } } } // after all interleaved components, that's an interleaved MCU, // so now count down the restart interval if (--z->todo <= 0) { if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); if (!STBI__RESTART(z->marker)) return 1; stbi__jpeg_reset(z); } } } return 1; } } else { if (z->scan_n == 1) { int i,j; int n = z->order[0]; // non-interleaved data, we just need to process one block at a time, // in trivial scanline order // number of blocks to do just depends on how many actual "pixels" this // component has, independent of interleaved MCU blocking and such int w = (z->img_comp[n].x+7) >> 3; int h = (z->img_comp[n].y+7) >> 3; for (j=0; j < h; ++j) { for (i=0; i < w; ++i) { short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); if (z->spec_start == 0) { if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) return 0; } else { int ha = z->img_comp[n].ha; if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) return 0; } // every data block is an MCU, so countdown the restart interval if (--z->todo <= 0) { if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); if (!STBI__RESTART(z->marker)) return 1; stbi__jpeg_reset(z); } } } return 1; } else { // interleaved int i,j,k,x,y; for (j=0; j < z->img_mcu_y; ++j) { for (i=0; i < z->img_mcu_x; ++i) { // scan an interleaved mcu... process scan_n components in order for (k=0; k < z->scan_n; ++k) { int n = z->order[k]; // scan out an mcu's worth of this component; that's just determined // by the basic H and V specified for the component for (y=0; y < z->img_comp[n].v; ++y) { for (x=0; x < z->img_comp[n].h; ++x) { int x2 = (i*z->img_comp[n].h + x); int y2 = (j*z->img_comp[n].v + y); short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w); if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) return 0; } } } // after all interleaved components, that's an interleaved MCU, // so now count down the restart interval if (--z->todo <= 0) { if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); if (!STBI__RESTART(z->marker)) return 1; stbi__jpeg_reset(z); } } } return 1; } } } static void stbi__jpeg_dequantize(short *data, stbi_uc *dequant) { int i; for (i=0; i < 64; ++i) data[i] *= dequant[i]; } static void stbi__jpeg_finish(stbi__jpeg *z) { if (z->progressive) { // dequantize and idct the data int i,j,n; for (n=0; n < z->s->img_n; ++n) { int w = (z->img_comp[n].x+7) >> 3; int h = (z->img_comp[n].y+7) >> 3; for (j=0; j < h; ++j) { for (i=0; i < w; ++i) { short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]); z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); } } } } } static int stbi__process_marker(stbi__jpeg *z, int m) { int L; switch (m) { case STBI__MARKER_none: // no marker found return stbi__err("expected marker","Corrupt JPEG"); case 0xDD: // DRI - specify restart interval if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG"); z->restart_interval = stbi__get16be(z->s); return 1; case 0xDB: // DQT - define quantization table L = stbi__get16be(z->s)-2; while (L > 0) { int q = stbi__get8(z->s); int p = q >> 4; int t = q & 15,i; if (p != 0) return stbi__err("bad DQT type","Corrupt JPEG"); if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG"); for (i=0; i < 64; ++i) z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s); L -= 65; } return L==0; case 0xC4: // DHT - define huffman table L = stbi__get16be(z->s)-2; while (L > 0) { stbi_uc *v; int sizes[16],i,n=0; int q = stbi__get8(z->s); int tc = q >> 4; int th = q & 15; if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG"); for (i=0; i < 16; ++i) { sizes[i] = stbi__get8(z->s); n += sizes[i]; } L -= 17; if (tc == 0) { if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0; v = z->huff_dc[th].values; } else { if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0; v = z->huff_ac[th].values; } for (i=0; i < n; ++i) v[i] = stbi__get8(z->s); if (tc != 0) stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); L -= n; } return L==0; } // check for comment block or APP blocks if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) { stbi__skip(z->s, stbi__get16be(z->s)-2); return 1; } return 0; } // after we see SOS static int stbi__process_scan_header(stbi__jpeg *z) { int i; int Ls = stbi__get16be(z->s); z->scan_n = stbi__get8(z->s); if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG"); if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG"); for (i=0; i < z->scan_n; ++i) { int id = stbi__get8(z->s), which; int q = stbi__get8(z->s); for (which = 0; which < z->s->img_n; ++which) if (z->img_comp[which].id == id) break; if (which == z->s->img_n) return 0; // no match z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG"); z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG"); z->order[i] = which; } { int aa; z->spec_start = stbi__get8(z->s); z->spec_end = stbi__get8(z->s); // should be 63, but might be 0 aa = stbi__get8(z->s); z->succ_high = (aa >> 4); z->succ_low = (aa & 15); if (z->progressive) { if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13) return stbi__err("bad SOS", "Corrupt JPEG"); } else { if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG"); if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG"); z->spec_end = 63; } } return 1; } static int stbi__process_frame_header(stbi__jpeg *z, int scan) { stbi__context *s = z->s; int Lf,p,i,q, h_max=1,v_max=1,c; Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires c = stbi__get8(s); if (c != 3 && c != 1) return stbi__err("bad component count","Corrupt JPEG"); // JFIF requires s->img_n = c; for (i=0; i < c; ++i) { z->img_comp[i].data = NULL; z->img_comp[i].linebuf = NULL; } if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG"); z->rgb = 0; for (i=0; i < s->img_n; ++i) { static unsigned char rgb[3] = { 'R', 'G', 'B' }; z->img_comp[i].id = stbi__get8(s); if (z->img_comp[i].id != i+1) // JFIF requires if (z->img_comp[i].id != i) { // some version of jpegtran outputs non-JFIF-compliant files! // somethings output this (see http://fileformats.archiveteam.org/wiki/JPEG#Color_format) if (z->img_comp[i].id != rgb[i]) return stbi__err("bad component ID","Corrupt JPEG"); ++z->rgb; } q = stbi__get8(s); z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG"); z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG"); z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG"); } if (scan != STBI__SCAN_load) return 1; if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); for (i=0; i < s->img_n; ++i) { if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h; if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v; } // compute interleaved mcu info z->img_h_max = h_max; z->img_v_max = v_max; z->img_mcu_w = h_max * 8; z->img_mcu_h = v_max * 8; z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w; z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h; for (i=0; i < s->img_n; ++i) { // number of effective pixels (e.g. for non-interleaved MCU) z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max; z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max; // to simplify generation, we'll allocate enough memory to decode // the bogus oversized data from using interleaved MCUs and their // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't // discard the extra data until colorspace conversion z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8; z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15); if (z->img_comp[i].raw_data == NULL) { for(--i; i >= 0; --i) { STBI_FREE(z->img_comp[i].raw_data); z->img_comp[i].raw_data = NULL; } return stbi__err("outofmem", "Out of memory"); } // align blocks for idct using mmx/sse z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15); z->img_comp[i].linebuf = NULL; if (z->progressive) { z->img_comp[i].coeff_w = (z->img_comp[i].w2 + 7) >> 3; z->img_comp[i].coeff_h = (z->img_comp[i].h2 + 7) >> 3; z->img_comp[i].raw_coeff = STBI_MALLOC(z->img_comp[i].coeff_w * z->img_comp[i].coeff_h * 64 * sizeof(short) + 15); z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15); } else { z->img_comp[i].coeff = 0; z->img_comp[i].raw_coeff = 0; } } return 1; } // use comparisons since in some cases we handle more than one case (e.g. SOF) #define stbi__DNL(x) ((x) == 0xdc) #define stbi__SOI(x) ((x) == 0xd8) #define stbi__EOI(x) ((x) == 0xd9) #define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2) #define stbi__SOS(x) ((x) == 0xda) #define stbi__SOF_progressive(x) ((x) == 0xc2) static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan) { int m; z->marker = STBI__MARKER_none; // initialize cached marker to empty m = stbi__get_marker(z); if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG"); if (scan == STBI__SCAN_type) return 1; m = stbi__get_marker(z); while (!stbi__SOF(m)) { if (!stbi__process_marker(z,m)) return 0; m = stbi__get_marker(z); while (m == STBI__MARKER_none) { // some files have extra padding after their blocks, so ok, we'll scan if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG"); m = stbi__get_marker(z); } } z->progressive = stbi__SOF_progressive(m); if (!stbi__process_frame_header(z, scan)) return 0; return 1; } // decode image to YCbCr format static int stbi__decode_jpeg_image(stbi__jpeg *j) { int m; for (m = 0; m < 4; m++) { j->img_comp[m].raw_data = NULL; j->img_comp[m].raw_coeff = NULL; } j->restart_interval = 0; if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0; m = stbi__get_marker(j); while (!stbi__EOI(m)) { if (stbi__SOS(m)) { if (!stbi__process_scan_header(j)) return 0; if (!stbi__parse_entropy_coded_data(j)) return 0; if (j->marker == STBI__MARKER_none ) { // handle 0s at the end of image data from IP Kamera 9060 while (!stbi__at_eof(j->s)) { int x = stbi__get8(j->s); if (x == 255) { j->marker = stbi__get8(j->s); break; } else if (x != 0) { return stbi__err("junk before marker", "Corrupt JPEG"); } } // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0 } } else { if (!stbi__process_marker(j, m)) return 0; } m = stbi__get_marker(j); } if (j->progressive) stbi__jpeg_finish(j); return 1; } // static jfif-centered resampling (across block boundaries) typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, int w, int hs); #define stbi__div4(x) ((stbi_uc) ((x) >> 2)) static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) { STBI_NOTUSED(out); STBI_NOTUSED(in_far); STBI_NOTUSED(w); STBI_NOTUSED(hs); return in_near; } static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) { // need to generate two samples vertically for every one in input int i; STBI_NOTUSED(hs); for (i=0; i < w; ++i) out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2); return out; } static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) { // need to generate two samples horizontally for every one in input int i; stbi_uc *input = in_near; if (w == 1) { // if only one sample, can't do any interpolation out[0] = out[1] = input[0]; return out; } out[0] = input[0]; out[1] = stbi__div4(input[0]*3 + input[1] + 2); for (i=1; i < w-1; ++i) { int n = 3*input[i]+2; out[i*2+0] = stbi__div4(n+input[i-1]); out[i*2+1] = stbi__div4(n+input[i+1]); } out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2); out[i*2+1] = input[w-1]; STBI_NOTUSED(in_far); STBI_NOTUSED(hs); return out; } #define stbi__div16(x) ((stbi_uc) ((x) >> 4)) static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) { // need to generate 2x2 samples for every one in input int i,t0,t1; if (w == 1) { out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); return out; } t1 = 3*in_near[0] + in_far[0]; out[0] = stbi__div4(t1+2); for (i=1; i < w; ++i) { t0 = t1; t1 = 3*in_near[i]+in_far[i]; out[i*2-1] = stbi__div16(3*t0 + t1 + 8); out[i*2 ] = stbi__div16(3*t1 + t0 + 8); } out[w*2-1] = stbi__div4(t1+2); STBI_NOTUSED(hs); return out; } #if defined(STBI_SSE2) || defined(STBI_NEON) static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) { // need to generate 2x2 samples for every one in input int i=0,t0,t1; if (w == 1) { out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); return out; } t1 = 3*in_near[0] + in_far[0]; // process groups of 8 pixels for as long as we can. // note we can't handle the last pixel in a row in this loop // because we need to handle the filter boundary conditions. for (; i < ((w-1) & ~7); i += 8) { #if defined(STBI_SSE2) // load and perform the vertical filtering pass // this uses 3*x + y = 4*x + (y - x) __m128i zero = _mm_setzero_si128(); __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i)); __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i)); __m128i farw = _mm_unpacklo_epi8(farb, zero); __m128i nearw = _mm_unpacklo_epi8(nearb, zero); __m128i diff = _mm_sub_epi16(farw, nearw); __m128i nears = _mm_slli_epi16(nearw, 2); __m128i curr = _mm_add_epi16(nears, diff); // current row // horizontal filter works the same based on shifted vers of current // row. "prev" is current row shifted right by 1 pixel; we need to // insert the previous pixel value (from t1). // "next" is current row shifted left by 1 pixel, with first pixel // of next block of 8 pixels added in. __m128i prv0 = _mm_slli_si128(curr, 2); __m128i nxt0 = _mm_srli_si128(curr, 2); __m128i prev = _mm_insert_epi16(prv0, t1, 0); __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7); // horizontal filter, polyphase implementation since it's convenient: // even pixels = 3*cur + prev = cur*4 + (prev - cur) // odd pixels = 3*cur + next = cur*4 + (next - cur) // note the shared term. __m128i bias = _mm_set1_epi16(8); __m128i curs = _mm_slli_epi16(curr, 2); __m128i prvd = _mm_sub_epi16(prev, curr); __m128i nxtd = _mm_sub_epi16(next, curr); __m128i curb = _mm_add_epi16(curs, bias); __m128i even = _mm_add_epi16(prvd, curb); __m128i odd = _mm_add_epi16(nxtd, curb); // interleave even and odd pixels, then undo scaling. __m128i int0 = _mm_unpacklo_epi16(even, odd); __m128i int1 = _mm_unpackhi_epi16(even, odd); __m128i de0 = _mm_srli_epi16(int0, 4); __m128i de1 = _mm_srli_epi16(int1, 4); // pack and write output __m128i outv = _mm_packus_epi16(de0, de1); _mm_storeu_si128((__m128i *) (out + i*2), outv); #elif defined(STBI_NEON) // load and perform the vertical filtering pass // this uses 3*x + y = 4*x + (y - x) uint8x8_t farb = vld1_u8(in_far + i); uint8x8_t nearb = vld1_u8(in_near + i); int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb)); int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2)); int16x8_t curr = vaddq_s16(nears, diff); // current row // horizontal filter works the same based on shifted vers of current // row. "prev" is current row shifted right by 1 pixel; we need to // insert the previous pixel value (from t1). // "next" is current row shifted left by 1 pixel, with first pixel // of next block of 8 pixels added in. int16x8_t prv0 = vextq_s16(curr, curr, 7); int16x8_t nxt0 = vextq_s16(curr, curr, 1); int16x8_t prev = vsetq_lane_s16(t1, prv0, 0); int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7); // horizontal filter, polyphase implementation since it's convenient: // even pixels = 3*cur + prev = cur*4 + (prev - cur) // odd pixels = 3*cur + next = cur*4 + (next - cur) // note the shared term. int16x8_t curs = vshlq_n_s16(curr, 2); int16x8_t prvd = vsubq_s16(prev, curr); int16x8_t nxtd = vsubq_s16(next, curr); int16x8_t even = vaddq_s16(curs, prvd); int16x8_t odd = vaddq_s16(curs, nxtd); // undo scaling and round, then store with even/odd phases interleaved uint8x8x2_t o; o.val[0] = vqrshrun_n_s16(even, 4); o.val[1] = vqrshrun_n_s16(odd, 4); vst2_u8(out + i*2, o); #endif // "previous" value for next iter t1 = 3*in_near[i+7] + in_far[i+7]; } t0 = t1; t1 = 3*in_near[i] + in_far[i]; out[i*2] = stbi__div16(3*t1 + t0 + 8); for (++i; i < w; ++i) { t0 = t1; t1 = 3*in_near[i]+in_far[i]; out[i*2-1] = stbi__div16(3*t0 + t1 + 8); out[i*2 ] = stbi__div16(3*t1 + t0 + 8); } out[w*2-1] = stbi__div4(t1+2); STBI_NOTUSED(hs); return out; } #endif static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) { // resample with nearest-neighbor int i,j; STBI_NOTUSED(in_far); for (i=0; i < w; ++i) for (j=0; j < hs; ++j) out[i*hs+j] = in_near[i]; return out; } #ifdef STBI_JPEG_OLD // this is the same YCbCr-to-RGB calculation that stb_image has used // historically before the algorithm changes in 1.49 #define float2fixed(x) ((int) ((x) * 65536 + 0.5)) static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) { int i; for (i=0; i < count; ++i) { int y_fixed = (y[i] << 16) + 32768; // rounding int r,g,b; int cr = pcr[i] - 128; int cb = pcb[i] - 128; r = y_fixed + cr*float2fixed(1.40200f); g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f); b = y_fixed + cb*float2fixed(1.77200f); r >>= 16; g >>= 16; b >>= 16; if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } out[0] = (stbi_uc)r; out[1] = (stbi_uc)g; out[2] = (stbi_uc)b; out[3] = 255; out += step; } } #else // this is a reduced-precision calculation of YCbCr-to-RGB introduced // to make sure the code produces the same results in both SIMD and scalar #define float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8) static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) { int i; for (i=0; i < count; ++i) { int y_fixed = (y[i] << 20) + (1<<19); // rounding int r,g,b; int cr = pcr[i] - 128; int cb = pcb[i] - 128; r = y_fixed + cr* float2fixed(1.40200f); g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000); b = y_fixed + cb* float2fixed(1.77200f); r >>= 20; g >>= 20; b >>= 20; if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } out[0] = (stbi_uc)r; out[1] = (stbi_uc)g; out[2] = (stbi_uc)b; out[3] = 255; out += step; } } #endif #if defined(STBI_SSE2) || defined(STBI_NEON) static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step) { int i = 0; #ifdef STBI_SSE2 // step == 3 is pretty ugly on the final interleave, and i'm not convinced // it's useful in practice (you wouldn't use it for textures, for example). // so just accelerate step == 4 case. if (step == 4) { // this is a fairly straightforward implementation and not super-optimized. __m128i signflip = _mm_set1_epi8(-0x80); __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f)); __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f)); __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f)); __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f)); __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128); __m128i xw = _mm_set1_epi16(255); // alpha channel for (; i+7 < count; i += 8) { // load __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i)); __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i)); __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i)); __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128 __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128 // unpack to short (and left-shift cr, cb by 8) __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes); __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased); __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased); // color transform __m128i yws = _mm_srli_epi16(yw, 4); __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw); __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw); __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1); __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1); __m128i rws = _mm_add_epi16(cr0, yws); __m128i gwt = _mm_add_epi16(cb0, yws); __m128i bws = _mm_add_epi16(yws, cb1); __m128i gws = _mm_add_epi16(gwt, cr1); // descale __m128i rw = _mm_srai_epi16(rws, 4); __m128i bw = _mm_srai_epi16(bws, 4); __m128i gw = _mm_srai_epi16(gws, 4); // back to byte, set up for transpose __m128i brb = _mm_packus_epi16(rw, bw); __m128i gxb = _mm_packus_epi16(gw, xw); // transpose to interleave channels __m128i t0 = _mm_unpacklo_epi8(brb, gxb); __m128i t1 = _mm_unpackhi_epi8(brb, gxb); __m128i o0 = _mm_unpacklo_epi16(t0, t1); __m128i o1 = _mm_unpackhi_epi16(t0, t1); // store _mm_storeu_si128((__m128i *) (out + 0), o0); _mm_storeu_si128((__m128i *) (out + 16), o1); out += 32; } } #endif #ifdef STBI_NEON // in this version, step=3 support would be easy to add. but is there demand? if (step == 4) { // this is a fairly straightforward implementation and not super-optimized. uint8x8_t signflip = vdup_n_u8(0x80); int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f)); int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f)); int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f)); int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f)); for (; i+7 < count; i += 8) { // load uint8x8_t y_bytes = vld1_u8(y + i); uint8x8_t cr_bytes = vld1_u8(pcr + i); uint8x8_t cb_bytes = vld1_u8(pcb + i); int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip)); int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip)); // expand to s16 int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4)); int16x8_t crw = vshll_n_s8(cr_biased, 7); int16x8_t cbw = vshll_n_s8(cb_biased, 7); // color transform int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0); int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0); int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1); int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1); int16x8_t rws = vaddq_s16(yws, cr0); int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1); int16x8_t bws = vaddq_s16(yws, cb1); // undo scaling, round, convert to byte uint8x8x4_t o; o.val[0] = vqrshrun_n_s16(rws, 4); o.val[1] = vqrshrun_n_s16(gws, 4); o.val[2] = vqrshrun_n_s16(bws, 4); o.val[3] = vdup_n_u8(255); // store, interleaving r/g/b/a vst4_u8(out, o); out += 8*4; } } #endif for (; i < count; ++i) { int y_fixed = (y[i] << 20) + (1<<19); // rounding int r,g,b; int cr = pcr[i] - 128; int cb = pcb[i] - 128; r = y_fixed + cr* float2fixed(1.40200f); g = y_fixed + cr*-float2fixed(0.71414f) + ((cb*-float2fixed(0.34414f)) & 0xffff0000); b = y_fixed + cb* float2fixed(1.77200f); r >>= 20; g >>= 20; b >>= 20; if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } out[0] = (stbi_uc)r; out[1] = (stbi_uc)g; out[2] = (stbi_uc)b; out[3] = 255; out += step; } } #endif // set up the kernels static void stbi__setup_jpeg(stbi__jpeg *j) { j->idct_block_kernel = stbi__idct_block; j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row; j->resample_row_hv_2_kernel = stbi__resample_row_hv_2; #ifdef STBI_SSE2 if (stbi__sse2_available()) { j->idct_block_kernel = stbi__idct_simd; #ifndef STBI_JPEG_OLD j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; #endif j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; } #endif #ifdef STBI_NEON j->idct_block_kernel = stbi__idct_simd; #ifndef STBI_JPEG_OLD j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; #endif j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; #endif } // clean up the temporary component buffers static void stbi__cleanup_jpeg(stbi__jpeg *j) { int i; for (i=0; i < j->s->img_n; ++i) { if (j->img_comp[i].raw_data) { STBI_FREE(j->img_comp[i].raw_data); j->img_comp[i].raw_data = NULL; j->img_comp[i].data = NULL; } if (j->img_comp[i].raw_coeff) { STBI_FREE(j->img_comp[i].raw_coeff); j->img_comp[i].raw_coeff = 0; j->img_comp[i].coeff = 0; } if (j->img_comp[i].linebuf) { STBI_FREE(j->img_comp[i].linebuf); j->img_comp[i].linebuf = NULL; } } } typedef struct { resample_row_func resample; stbi_uc *line0,*line1; int hs,vs; // expansion factor in each axis int w_lores; // horizontal pixels pre-expansion int ystep; // how far through vertical expansion we are int ypos; // which pre-expansion row we're on } stbi__resample; static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp) { int n, decode_n; z->s->img_n = 0; // make stbi__cleanup_jpeg safe // validate req_comp if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); // load a jpeg image from whichever source, but leave in YCbCr format if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; } // determine actual number of components to generate n = req_comp ? req_comp : z->s->img_n; if (z->s->img_n == 3 && n < 3) decode_n = 1; else decode_n = z->s->img_n; // resample and color-convert { int k; unsigned int i,j; stbi_uc *output; stbi_uc *coutput[4]; stbi__resample res_comp[4]; for (k=0; k < decode_n; ++k) { stbi__resample *r = &res_comp[k]; // allocate line buffer big enough for upsampling off the edges // with upsample factor of 4 z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3); if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } r->hs = z->img_h_max / z->img_comp[k].h; r->vs = z->img_v_max / z->img_comp[k].v; r->ystep = r->vs >> 1; r->w_lores = (z->s->img_x + r->hs-1) / r->hs; r->ypos = 0; r->line0 = r->line1 = z->img_comp[k].data; if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2; else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2; else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel; else r->resample = stbi__resample_row_generic; } // can't error after this so, this is safe output = (stbi_uc *) stbi__malloc(n * z->s->img_x * z->s->img_y + 1); if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } // now go ahead and resample for (j=0; j < z->s->img_y; ++j) { stbi_uc *out = output + n * z->s->img_x * j; for (k=0; k < decode_n; ++k) { stbi__resample *r = &res_comp[k]; int y_bot = r->ystep >= (r->vs >> 1); coutput[k] = r->resample(z->img_comp[k].linebuf, y_bot ? r->line1 : r->line0, y_bot ? r->line0 : r->line1, r->w_lores, r->hs); if (++r->ystep >= r->vs) { r->ystep = 0; r->line0 = r->line1; if (++r->ypos < z->img_comp[k].y) r->line1 += z->img_comp[k].w2; } } if (n >= 3) { stbi_uc *y = coutput[0]; if (z->s->img_n == 3) { if (z->rgb == 3) { for (i=0; i < z->s->img_x; ++i) { out[0] = y[i]; out[1] = coutput[1][i]; out[2] = coutput[2][i]; out[3] = 255; out += n; } } else { z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); } } else for (i=0; i < z->s->img_x; ++i) { out[0] = out[1] = out[2] = y[i]; out[3] = 255; // not used if n==3 out += n; } } else { stbi_uc *y = coutput[0]; if (n == 1) for (i=0; i < z->s->img_x; ++i) out[i] = y[i]; else for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255; } } stbi__cleanup_jpeg(z); *out_x = z->s->img_x; *out_y = z->s->img_y; if (comp) *comp = z->s->img_n; // report original components, not output return output; } } static unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { unsigned char* result; stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); j->s = s; stbi__setup_jpeg(j); result = load_jpeg_image(j, x,y,comp,req_comp); STBI_FREE(j); return result; } static int stbi__jpeg_test(stbi__context *s) { int r; stbi__jpeg j; j.s = s; stbi__setup_jpeg(&j); r = stbi__decode_jpeg_header(&j, STBI__SCAN_type); stbi__rewind(s); return r; } static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp) { if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) { stbi__rewind( j->s ); return 0; } if (x) *x = j->s->img_x; if (y) *y = j->s->img_y; if (comp) *comp = j->s->img_n; return 1; } static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) { int result; stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg))); j->s = s; result = stbi__jpeg_info_raw(j, x, y, comp); STBI_FREE(j); return result; } #endif // public domain zlib decode v0.2 Sean Barrett 2006-11-18 // simple implementation // - all input must be provided in an upfront buffer // - all output is written to a single output buffer (can malloc/realloc) // performance // - fast huffman #ifndef STBI_NO_ZLIB // fast-way is faster to check than jpeg huffman, but slow way is slower #define STBI__ZFAST_BITS 9 // accelerate all cases in default tables #define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1) // zlib-style huffman encoding // (jpegs packs from left, zlib from right, so can't share code) typedef struct { stbi__uint16 fast[1 << STBI__ZFAST_BITS]; stbi__uint16 firstcode[16]; int maxcode[17]; stbi__uint16 firstsymbol[16]; stbi_uc size[288]; stbi__uint16 value[288]; } stbi__zhuffman; stbi_inline static int stbi__bitreverse16(int n) { n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4); n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8); return n; } stbi_inline static int stbi__bit_reverse(int v, int bits) { STBI_ASSERT(bits <= 16); // to bit reverse n bits, reverse 16 and shift // e.g. 11 bits, bit reverse and shift away 5 return stbi__bitreverse16(v) >> (16-bits); } static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num) { int i,k=0; int code, next_code[16], sizes[17]; // DEFLATE spec for generating codes memset(sizes, 0, sizeof(sizes)); memset(z->fast, 0, sizeof(z->fast)); for (i=0; i < num; ++i) ++sizes[sizelist[i]]; sizes[0] = 0; for (i=1; i < 16; ++i) if (sizes[i] > (1 << i)) return stbi__err("bad sizes", "Corrupt PNG"); code = 0; for (i=1; i < 16; ++i) { next_code[i] = code; z->firstcode[i] = (stbi__uint16) code; z->firstsymbol[i] = (stbi__uint16) k; code = (code + sizes[i]); if (sizes[i]) if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG"); z->maxcode[i] = code << (16-i); // preshift for inner loop code <<= 1; k += sizes[i]; } z->maxcode[16] = 0x10000; // sentinel for (i=0; i < num; ++i) { int s = sizelist[i]; if (s) { int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s]; stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i); z->size [c] = (stbi_uc ) s; z->value[c] = (stbi__uint16) i; if (s <= STBI__ZFAST_BITS) { int j = stbi__bit_reverse(next_code[s],s); while (j < (1 << STBI__ZFAST_BITS)) { z->fast[j] = fastv; j += (1 << s); } } ++next_code[s]; } } return 1; } // zlib-from-memory implementation for PNG reading // because PNG allows splitting the zlib stream arbitrarily, // and it's annoying structurally to have PNG call ZLIB call PNG, // we require PNG read all the IDATs and combine them into a single // memory buffer typedef struct { stbi_uc *zbuffer, *zbuffer_end; int num_bits; stbi__uint32 code_buffer; char *zout; char *zout_start; char *zout_end; int z_expandable; stbi__zhuffman z_length, z_distance; } stbi__zbuf; stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z) { if (z->zbuffer >= z->zbuffer_end) return 0; return *z->zbuffer++; } static void stbi__fill_bits(stbi__zbuf *z) { do { STBI_ASSERT(z->code_buffer < (1U << z->num_bits)); z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits; z->num_bits += 8; } while (z->num_bits <= 24); } stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n) { unsigned int k; if (z->num_bits < n) stbi__fill_bits(z); k = z->code_buffer & ((1 << n) - 1); z->code_buffer >>= n; z->num_bits -= n; return k; } static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) { int b,s,k; // not resolved by fast table, so compute it the slow way // use jpeg approach, which requires MSbits at top k = stbi__bit_reverse(a->code_buffer, 16); for (s=STBI__ZFAST_BITS+1; ; ++s) if (k < z->maxcode[s]) break; if (s == 16) return -1; // invalid code! // code size is s, so: b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; STBI_ASSERT(z->size[b] == s); a->code_buffer >>= s; a->num_bits -= s; return z->value[b]; } stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) { int b,s; if (a->num_bits < 16) stbi__fill_bits(a); b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; if (b) { s = b >> 9; a->code_buffer >>= s; a->num_bits -= s; return b & 511; } return stbi__zhuffman_decode_slowpath(a, z); } static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes { char *q; int cur, limit, old_limit; z->zout = zout; if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG"); cur = (int) (z->zout - z->zout_start); limit = old_limit = (int) (z->zout_end - z->zout_start); while (cur + n > limit) limit *= 2; q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit); STBI_NOTUSED(old_limit); if (q == NULL) return stbi__err("outofmem", "Out of memory"); z->zout_start = q; z->zout = q + cur; z->zout_end = q + limit; return 1; } static int stbi__zlength_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 }; static int stbi__zlength_extra[31]= { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; static int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; static int stbi__zdist_extra[32] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; static int stbi__parse_huffman_block(stbi__zbuf *a) { char *zout = a->zout; for(;;) { int z = stbi__zhuffman_decode(a, &a->z_length); if (z < 256) { if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes if (zout >= a->zout_end) { if (!stbi__zexpand(a, zout, 1)) return 0; zout = a->zout; } *zout++ = (char) z; } else { stbi_uc *p; int len,dist; if (z == 256) { a->zout = zout; return 1; } z -= 257; len = stbi__zlength_base[z]; if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]); z = stbi__zhuffman_decode(a, &a->z_distance); if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); dist = stbi__zdist_base[z]; if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); if (zout + len > a->zout_end) { if (!stbi__zexpand(a, zout, len)) return 0; zout = a->zout; } p = (stbi_uc *) (zout - dist); if (dist == 1) { // run of one byte; common in images. stbi_uc v = *p; if (len) { do *zout++ = v; while (--len); } } else { if (len) { do *zout++ = *p++; while (--len); } } } } } static int stbi__compute_huffman_codes(stbi__zbuf *a) { static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; stbi__zhuffman z_codelength; stbi_uc lencodes[286+32+137];//padding for maximum single op stbi_uc codelength_sizes[19]; int i,n; int hlit = stbi__zreceive(a,5) + 257; int hdist = stbi__zreceive(a,5) + 1; int hclen = stbi__zreceive(a,4) + 4; memset(codelength_sizes, 0, sizeof(codelength_sizes)); for (i=0; i < hclen; ++i) { int s = stbi__zreceive(a,3); codelength_sizes[length_dezigzag[i]] = (stbi_uc) s; } if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; n = 0; while (n < hlit + hdist) { int c = stbi__zhuffman_decode(a, &z_codelength); if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); if (c < 16) lencodes[n++] = (stbi_uc) c; else if (c == 16) { c = stbi__zreceive(a,2)+3; memset(lencodes+n, lencodes[n-1], c); n += c; } else if (c == 17) { c = stbi__zreceive(a,3)+3; memset(lencodes+n, 0, c); n += c; } else { STBI_ASSERT(c == 18); c = stbi__zreceive(a,7)+11; memset(lencodes+n, 0, c); n += c; } } if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG"); if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; return 1; } static int stbi__parse_uncompressed_block(stbi__zbuf *a) { stbi_uc header[4]; int len,nlen,k; if (a->num_bits & 7) stbi__zreceive(a, a->num_bits & 7); // discard // drain the bit-packed data into header k = 0; while (a->num_bits > 0) { header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check a->code_buffer >>= 8; a->num_bits -= 8; } STBI_ASSERT(a->num_bits == 0); // now fill header the normal way while (k < 4) header[k++] = stbi__zget8(a); len = header[1] * 256 + header[0]; nlen = header[3] * 256 + header[2]; if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG"); if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG"); if (a->zout + len > a->zout_end) if (!stbi__zexpand(a, a->zout, len)) return 0; memcpy(a->zout, a->zbuffer, len); a->zbuffer += len; a->zout += len; return 1; } static int stbi__parse_zlib_header(stbi__zbuf *a) { int cmf = stbi__zget8(a); int cm = cmf & 15; /* int cinfo = cmf >> 4; */ int flg = stbi__zget8(a); if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png // window = 1 << (8 + cinfo)... but who cares, we fully buffer output return 1; } // @TODO: should statically initialize these for optimal thread safety static stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32]; static void stbi__init_zdefaults(void) { int i; // use <= to match clearly with spec for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8; for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9; for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7; for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8; for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5; } static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) { int final, type; if (parse_header) if (!stbi__parse_zlib_header(a)) return 0; a->num_bits = 0; a->code_buffer = 0; do { final = stbi__zreceive(a,1); type = stbi__zreceive(a,2); if (type == 0) { if (!stbi__parse_uncompressed_block(a)) return 0; } else if (type == 3) { return 0; } else { if (type == 1) { // use fixed code lengths if (!stbi__zdefault_distance[31]) stbi__init_zdefaults(); if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0; if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0; } else { if (!stbi__compute_huffman_codes(a)) return 0; } if (!stbi__parse_huffman_block(a)) return 0; } } while (!final); return 1; } static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header) { a->zout_start = obuf; a->zout = obuf; a->zout_end = obuf + olen; a->z_expandable = exp; return stbi__parse_zlib(a, parse_header); } STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen) { stbi__zbuf a; char *p = (char *) stbi__malloc(initial_size); if (p == NULL) return NULL; a.zbuffer = (stbi_uc *) buffer; a.zbuffer_end = (stbi_uc *) buffer + len; if (stbi__do_zlib(&a, p, initial_size, 1, 1)) { if (outlen) *outlen = (int) (a.zout - a.zout_start); return a.zout_start; } else { STBI_FREE(a.zout_start); return NULL; } } STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) { return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen); } STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header) { stbi__zbuf a; char *p = (char *) stbi__malloc(initial_size); if (p == NULL) return NULL; a.zbuffer = (stbi_uc *) buffer; a.zbuffer_end = (stbi_uc *) buffer + len; if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) { if (outlen) *outlen = (int) (a.zout - a.zout_start); return a.zout_start; } else { STBI_FREE(a.zout_start); return NULL; } } STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen) { stbi__zbuf a; a.zbuffer = (stbi_uc *) ibuffer; a.zbuffer_end = (stbi_uc *) ibuffer + ilen; if (stbi__do_zlib(&a, obuffer, olen, 0, 1)) return (int) (a.zout - a.zout_start); else return -1; } STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen) { stbi__zbuf a; char *p = (char *) stbi__malloc(16384); if (p == NULL) return NULL; a.zbuffer = (stbi_uc *) buffer; a.zbuffer_end = (stbi_uc *) buffer+len; if (stbi__do_zlib(&a, p, 16384, 1, 0)) { if (outlen) *outlen = (int) (a.zout - a.zout_start); return a.zout_start; } else { STBI_FREE(a.zout_start); return NULL; } } STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen) { stbi__zbuf a; a.zbuffer = (stbi_uc *) ibuffer; a.zbuffer_end = (stbi_uc *) ibuffer + ilen; if (stbi__do_zlib(&a, obuffer, olen, 0, 0)) return (int) (a.zout - a.zout_start); else return -1; } #endif // public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18 // simple implementation // - only 8-bit samples // - no CRC checking // - allocates lots of intermediate memory // - avoids problem of streaming data between subsystems // - avoids explicit window management // performance // - uses stb_zlib, a PD zlib implementation with fast huffman decoding #ifndef STBI_NO_PNG typedef struct { stbi__uint32 length; stbi__uint32 type; } stbi__pngchunk; static stbi__pngchunk stbi__get_chunk_header(stbi__context *s) { stbi__pngchunk c; c.length = stbi__get32be(s); c.type = stbi__get32be(s); return c; } static int stbi__check_png_header(stbi__context *s) { static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 }; int i; for (i=0; i < 8; ++i) if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG"); return 1; } typedef struct { stbi__context *s; stbi_uc *idata, *expanded, *out; int depth; } stbi__png; enum { STBI__F_none=0, STBI__F_sub=1, STBI__F_up=2, STBI__F_avg=3, STBI__F_paeth=4, // synthetic filters used for first scanline to avoid needing a dummy row of 0s STBI__F_avg_first, STBI__F_paeth_first }; static stbi_uc first_row_filter[5] = { STBI__F_none, STBI__F_sub, STBI__F_none, STBI__F_avg_first, STBI__F_paeth_first }; static int stbi__paeth(int a, int b, int c) { int p = a + b - c; int pa = abs(p-a); int pb = abs(p-b); int pc = abs(p-c); if (pa <= pb && pa <= pc) return a; if (pb <= pc) return b; return c; } static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; // create the png data from post-deflated data static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) { int bytes = (depth == 16? 2 : 1); stbi__context *s = a->s; stbi__uint32 i,j,stride = x*out_n*bytes; stbi__uint32 img_len, img_width_bytes; int k; int img_n = s->img_n; // copy it into a local for later int output_bytes = out_n*bytes; int filter_bytes = img_n*bytes; int width = x; STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1); a->out = (stbi_uc *) stbi__malloc(x * y * output_bytes); // extra bytes to write off the end into if (!a->out) return stbi__err("outofmem", "Out of memory"); img_width_bytes = (((img_n * x * depth) + 7) >> 3); img_len = (img_width_bytes + 1) * y; if (s->img_x == x && s->img_y == y) { if (raw_len != img_len) return stbi__err("not enough pixels","Corrupt PNG"); } else { // interlaced: if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); } for (j=0; j < y; ++j) { stbi_uc *cur = a->out + stride*j; stbi_uc *prior = cur - stride; int filter = *raw++; if (filter > 4) return stbi__err("invalid filter","Corrupt PNG"); if (depth < 8) { STBI_ASSERT(img_width_bytes <= x); cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place filter_bytes = 1; width = img_width_bytes; } // if first row, use special filter that doesn't sample previous row if (j == 0) filter = first_row_filter[filter]; // handle first byte explicitly for (k=0; k < filter_bytes; ++k) { switch (filter) { case STBI__F_none : cur[k] = raw[k]; break; case STBI__F_sub : cur[k] = raw[k]; break; case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; case STBI__F_avg_first : cur[k] = raw[k]; break; case STBI__F_paeth_first: cur[k] = raw[k]; break; } } if (depth == 8) { if (img_n != out_n) cur[img_n] = 255; // first pixel raw += img_n; cur += out_n; prior += out_n; } else if (depth == 16) { if (img_n != out_n) { cur[filter_bytes] = 255; // first pixel top byte cur[filter_bytes+1] = 255; // first pixel bottom byte } raw += filter_bytes; cur += output_bytes; prior += output_bytes; } else { raw += 1; cur += 1; prior += 1; } // this is a little gross, so that we don't switch per-pixel or per-component if (depth < 8 || img_n == out_n) { int nk = (width - 1)*filter_bytes; #define CASE(f) \ case f: \ for (k=0; k < nk; ++k) switch (filter) { // "none" filter turns into a memcpy here; make that explicit. case STBI__F_none: memcpy(cur, raw, nk); break; CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break; CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break; CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break; CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break; CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break; } #undef CASE raw += nk; } else { STBI_ASSERT(img_n+1 == out_n); #define CASE(f) \ case f: \ for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ for (k=0; k < filter_bytes; ++k) switch (filter) { CASE(STBI__F_none) { cur[k] = raw[k]; } break; CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break; CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break; CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break; CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break; CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break; } #undef CASE // the loop above sets the high byte of the pixels' alpha, but for // 16 bit png files we also need the low byte set. we'll do that here. if (depth == 16) { cur = a->out + stride*j; // start at the beginning of the row again for (i=0; i < x; ++i,cur+=output_bytes) { cur[filter_bytes+1] = 255; } } } } // we make a separate pass to expand bits to pixels; for performance, // this could run two scanlines behind the above code, so it won't // intefere with filtering but will still be in the cache. if (depth < 8) { for (j=0; j < y; ++j) { stbi_uc *cur = a->out + stride*j; stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes; // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range // note that the final byte might overshoot and write more data than desired. // we can allocate enough data that this never writes out of memory, but it // could also overwrite the next scanline. can it overwrite non-empty data // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel. // so we need to explicitly clamp the final ones if (depth == 4) { for (k=x*img_n; k >= 2; k-=2, ++in) { *cur++ = scale * ((*in >> 4) ); *cur++ = scale * ((*in ) & 0x0f); } if (k > 0) *cur++ = scale * ((*in >> 4) ); } else if (depth == 2) { for (k=x*img_n; k >= 4; k-=4, ++in) { *cur++ = scale * ((*in >> 6) ); *cur++ = scale * ((*in >> 4) & 0x03); *cur++ = scale * ((*in >> 2) & 0x03); *cur++ = scale * ((*in ) & 0x03); } if (k > 0) *cur++ = scale * ((*in >> 6) ); if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03); if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03); } else if (depth == 1) { for (k=x*img_n; k >= 8; k-=8, ++in) { *cur++ = scale * ((*in >> 7) ); *cur++ = scale * ((*in >> 6) & 0x01); *cur++ = scale * ((*in >> 5) & 0x01); *cur++ = scale * ((*in >> 4) & 0x01); *cur++ = scale * ((*in >> 3) & 0x01); *cur++ = scale * ((*in >> 2) & 0x01); *cur++ = scale * ((*in >> 1) & 0x01); *cur++ = scale * ((*in ) & 0x01); } if (k > 0) *cur++ = scale * ((*in >> 7) ); if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01); if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01); if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01); if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01); if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01); if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01); } if (img_n != out_n) { int q; // insert alpha = 255 cur = a->out + stride*j; if (img_n == 1) { for (q=x-1; q >= 0; --q) { cur[q*2+1] = 255; cur[q*2+0] = cur[q]; } } else { STBI_ASSERT(img_n == 3); for (q=x-1; q >= 0; --q) { cur[q*4+3] = 255; cur[q*4+2] = cur[q*3+2]; cur[q*4+1] = cur[q*3+1]; cur[q*4+0] = cur[q*3+0]; } } } } } else if (depth == 16) { // force the image data from big-endian to platform-native. // this is done in a separate pass due to the decoding relying // on the data being untouched, but could probably be done // per-line during decode if care is taken. stbi_uc *cur = a->out; stbi__uint16 *cur16 = (stbi__uint16*)cur; for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { *cur16 = (cur[0] << 8) | cur[1]; } } return 1; } static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced) { stbi_uc *final; int p; if (!interlaced) return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); // de-interlacing final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n); for (p=0; p < 7; ++p) { int xorig[] = { 0,4,0,2,0,1,0 }; int yorig[] = { 0,0,4,0,2,0,1 }; int xspc[] = { 8,8,4,4,2,2,1 }; int yspc[] = { 8,8,8,4,4,2,2 }; int i,j,x,y; // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1 x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p]; y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p]; if (x && y) { stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y; if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) { STBI_FREE(final); return 0; } for (j=0; j < y; ++j) { for (i=0; i < x; ++i) { int out_y = j*yspc[p]+yorig[p]; int out_x = i*xspc[p]+xorig[p]; memcpy(final + out_y*a->s->img_x*out_n + out_x*out_n, a->out + (j*x+i)*out_n, out_n); } } STBI_FREE(a->out); image_data += img_len; image_data_len -= img_len; } } a->out = final; return 1; } static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) { stbi__context *s = z->s; stbi__uint32 i, pixel_count = s->img_x * s->img_y; stbi_uc *p = z->out; // compute color-based transparency, assuming we've // already got 255 as the alpha value in the output STBI_ASSERT(out_n == 2 || out_n == 4); if (out_n == 2) { for (i=0; i < pixel_count; ++i) { p[1] = (p[0] == tc[0] ? 0 : 255); p += 2; } } else { for (i=0; i < pixel_count; ++i) { if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) p[3] = 0; p += 4; } } return 1; } static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n) { stbi__context *s = z->s; stbi__uint32 i, pixel_count = s->img_x * s->img_y; stbi__uint16 *p = (stbi__uint16*) z->out; // compute color-based transparency, assuming we've // already got 65535 as the alpha value in the output STBI_ASSERT(out_n == 2 || out_n == 4); if (out_n == 2) { for (i = 0; i < pixel_count; ++i) { p[1] = (p[0] == tc[0] ? 0 : 65535); p += 2; } } else { for (i = 0; i < pixel_count; ++i) { if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) p[3] = 0; p += 4; } } return 1; } static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n) { stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y; stbi_uc *p, *temp_out, *orig = a->out; p = (stbi_uc *) stbi__malloc(pixel_count * pal_img_n); if (p == NULL) return stbi__err("outofmem", "Out of memory"); // between here and free(out) below, exitting would leak temp_out = p; if (pal_img_n == 3) { for (i=0; i < pixel_count; ++i) { int n = orig[i]*4; p[0] = palette[n ]; p[1] = palette[n+1]; p[2] = palette[n+2]; p += 3; } } else { for (i=0; i < pixel_count; ++i) { int n = orig[i]*4; p[0] = palette[n ]; p[1] = palette[n+1]; p[2] = palette[n+2]; p[3] = palette[n+3]; p += 4; } } STBI_FREE(a->out); a->out = temp_out; STBI_NOTUSED(len); return 1; } static int stbi__reduce_png(stbi__png *p) { int i; int img_len = p->s->img_x * p->s->img_y * p->s->img_out_n; stbi_uc *reduced; stbi__uint16 *orig = (stbi__uint16*)p->out; if (p->depth != 16) return 1; // don't need to do anything if not 16-bit data reduced = (stbi_uc *)stbi__malloc(img_len); if (p == NULL) return stbi__err("outofmem", "Out of memory"); for (i = 0; i < img_len; ++i) reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is a decent approx of 16->8 bit scaling p->out = reduced; STBI_FREE(orig); return 1; } static int stbi__unpremultiply_on_load = 0; static int stbi__de_iphone_flag = 0; STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply) { stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply; } STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert) { stbi__de_iphone_flag = flag_true_if_should_convert; } static void stbi__de_iphone(stbi__png *z) { stbi__context *s = z->s; stbi__uint32 i, pixel_count = s->img_x * s->img_y; stbi_uc *p = z->out; if (s->img_out_n == 3) { // convert bgr to rgb for (i=0; i < pixel_count; ++i) { stbi_uc t = p[0]; p[0] = p[2]; p[2] = t; p += 3; } } else { STBI_ASSERT(s->img_out_n == 4); if (stbi__unpremultiply_on_load) { // convert bgr to rgb and unpremultiply for (i=0; i < pixel_count; ++i) { stbi_uc a = p[3]; stbi_uc t = p[0]; if (a) { p[0] = p[2] * 255 / a; p[1] = p[1] * 255 / a; p[2] = t * 255 / a; } else { p[0] = p[2]; p[2] = t; } p += 4; } } else { // convert bgr to rgb for (i=0; i < pixel_count; ++i) { stbi_uc t = p[0]; p[0] = p[2]; p[2] = t; p += 4; } } } } #define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { stbi_uc palette[1024], pal_img_n=0; stbi_uc has_trans=0, tc[3]; stbi__uint16 tc16[3]; stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; int first=1,k,interlace=0, color=0, is_iphone=0; stbi__context *s = z->s; z->expanded = NULL; z->idata = NULL; z->out = NULL; if (!stbi__check_png_header(s)) return 0; if (scan == STBI__SCAN_type) return 1; for (;;) { stbi__pngchunk c = stbi__get_chunk_header(s); switch (c.type) { case STBI__PNG_TYPE('C','g','B','I'): is_iphone = 1; stbi__skip(s, c.length); break; case STBI__PNG_TYPE('I','H','D','R'): { int comp,filter; if (!first) return stbi__err("multiple IHDR","Corrupt PNG"); first = 0; if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG"); s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only"); color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG"); if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG"); if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG"); comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG"); filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG"); interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG"); if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG"); if (!pal_img_n) { s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0); if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); if (scan == STBI__SCAN_header) return 1; } else { // if paletted, then pal_n is our final components, and // img_n is # components to decompress/filter. s->img_n = 1; if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG"); // if SCAN_header, have to scan to see if we have a tRNS } break; } case STBI__PNG_TYPE('P','L','T','E'): { if (first) return stbi__err("first not IHDR", "Corrupt PNG"); if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG"); pal_len = c.length / 3; if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG"); for (i=0; i < pal_len; ++i) { palette[i*4+0] = stbi__get8(s); palette[i*4+1] = stbi__get8(s); palette[i*4+2] = stbi__get8(s); palette[i*4+3] = 255; } break; } case STBI__PNG_TYPE('t','R','N','S'): { if (first) return stbi__err("first not IHDR", "Corrupt PNG"); if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG"); if (pal_img_n) { if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; } if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG"); if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG"); pal_img_n = 4; for (i=0; i < c.length; ++i) palette[i*4+3] = stbi__get8(s); } else { if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); has_trans = 1; if (z->depth == 16) { for (k = 0; k < s->img_n; ++k) tc16[k] = stbi__get16be(s); // copy the values as-is } else { for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger } } break; } case STBI__PNG_TYPE('I','D','A','T'): { if (first) return stbi__err("first not IHDR", "Corrupt PNG"); if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; } if ((int)(ioff + c.length) < (int)ioff) return 0; if (ioff + c.length > idata_limit) { stbi__uint32 idata_limit_old = idata_limit; stbi_uc *p; if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; while (ioff + c.length > idata_limit) idata_limit *= 2; STBI_NOTUSED(idata_limit_old); p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); z->idata = p; } if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG"); ioff += c.length; break; } case STBI__PNG_TYPE('I','E','N','D'): { stbi__uint32 raw_len, bpl; if (first) return stbi__err("first not IHDR", "Corrupt PNG"); if (scan != STBI__SCAN_load) return 1; if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG"); // initial guess for decoded data size to avoid unnecessary reallocs bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); if (z->expanded == NULL) return 0; // zlib should set error STBI_FREE(z->idata); z->idata = NULL; if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans) s->img_out_n = s->img_n+1; else s->img_out_n = s->img_n; if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0; if (has_trans) { if (z->depth == 16) { if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0; } else { if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; } } if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) stbi__de_iphone(z); if (pal_img_n) { // pal_img_n == 3 or 4 s->img_n = pal_img_n; // record the actual colors we had s->img_out_n = pal_img_n; if (req_comp >= 3) s->img_out_n = req_comp; if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) return 0; } STBI_FREE(z->expanded); z->expanded = NULL; return 1; } default: // if critical, fail if (first) return stbi__err("first not IHDR", "Corrupt PNG"); if ((c.type & (1 << 29)) == 0) { #ifndef STBI_NO_FAILURE_STRINGS // not threadsafe static char invalid_chunk[] = "XXXX PNG chunk not known"; invalid_chunk[0] = STBI__BYTECAST(c.type >> 24); invalid_chunk[1] = STBI__BYTECAST(c.type >> 16); invalid_chunk[2] = STBI__BYTECAST(c.type >> 8); invalid_chunk[3] = STBI__BYTECAST(c.type >> 0); #endif return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type"); } stbi__skip(s, c.length); break; } // end of PNG chunk, read and skip CRC stbi__get32be(s); } } static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp) { unsigned char *result=NULL; if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { if (p->depth == 16) { if (!stbi__reduce_png(p)) { return result; } } result = p->out; p->out = NULL; if (req_comp && req_comp != p->s->img_out_n) { result = stbi__convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); p->s->img_out_n = req_comp; if (result == NULL) return result; } *x = p->s->img_x; *y = p->s->img_y; if (n) *n = p->s->img_n; } STBI_FREE(p->out); p->out = NULL; STBI_FREE(p->expanded); p->expanded = NULL; STBI_FREE(p->idata); p->idata = NULL; return result; } static unsigned char *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { stbi__png p; p.s = s; return stbi__do_png(&p, x,y,comp,req_comp); } static int stbi__png_test(stbi__context *s) { int r; r = stbi__check_png_header(s); stbi__rewind(s); return r; } static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp) { if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { stbi__rewind( p->s ); return 0; } if (x) *x = p->s->img_x; if (y) *y = p->s->img_y; if (comp) *comp = p->s->img_n; return 1; } static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) { stbi__png p; p.s = s; return stbi__png_info_raw(&p, x, y, comp); } #endif // Microsoft/Windows BMP image #ifndef STBI_NO_BMP static int stbi__bmp_test_raw(stbi__context *s) { int r; int sz; if (stbi__get8(s) != 'B') return 0; if (stbi__get8(s) != 'M') return 0; stbi__get32le(s); // discard filesize stbi__get16le(s); // discard reserved stbi__get16le(s); // discard reserved stbi__get32le(s); // discard data offset sz = stbi__get32le(s); r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124); return r; } static int stbi__bmp_test(stbi__context *s) { int r = stbi__bmp_test_raw(s); stbi__rewind(s); return r; } // returns 0..31 for the highest set bit static int stbi__high_bit(unsigned int z) { int n=0; if (z == 0) return -1; if (z >= 0x10000) n += 16, z >>= 16; if (z >= 0x00100) n += 8, z >>= 8; if (z >= 0x00010) n += 4, z >>= 4; if (z >= 0x00004) n += 2, z >>= 2; if (z >= 0x00002) n += 1, z >>= 1; return n; } static int stbi__bitcount(unsigned int a) { a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2 a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4 a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits a = (a + (a >> 8)); // max 16 per 8 bits a = (a + (a >> 16)); // max 32 per 8 bits return a & 0xff; } static int stbi__shiftsigned(int v, int shift, int bits) { int result; int z=0; if (shift < 0) v <<= -shift; else v >>= shift; result = v; z = bits; while (z < 8) { result += v >> z; z += bits; } return result; } typedef struct { int bpp, offset, hsz; unsigned int mr,mg,mb,ma, all_a; } stbi__bmp_data; static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) { int hsz; if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP"); stbi__get32le(s); // discard filesize stbi__get16le(s); // discard reserved stbi__get16le(s); // discard reserved info->offset = stbi__get32le(s); info->hsz = hsz = stbi__get32le(s); info->mr = info->mg = info->mb = info->ma = 0; if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown"); if (hsz == 12) { s->img_x = stbi__get16le(s); s->img_y = stbi__get16le(s); } else { s->img_x = stbi__get32le(s); s->img_y = stbi__get32le(s); } if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP"); info->bpp = stbi__get16le(s); if (info->bpp == 1) return stbi__errpuc("monochrome", "BMP type not supported: 1-bit"); if (hsz != 12) { int compress = stbi__get32le(s); if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE"); stbi__get32le(s); // discard sizeof stbi__get32le(s); // discard hres stbi__get32le(s); // discard vres stbi__get32le(s); // discard colorsused stbi__get32le(s); // discard max important if (hsz == 40 || hsz == 56) { if (hsz == 56) { stbi__get32le(s); stbi__get32le(s); stbi__get32le(s); stbi__get32le(s); } if (info->bpp == 16 || info->bpp == 32) { if (compress == 0) { if (info->bpp == 32) { info->mr = 0xffu << 16; info->mg = 0xffu << 8; info->mb = 0xffu << 0; info->ma = 0xffu << 24; info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0 } else { info->mr = 31u << 10; info->mg = 31u << 5; info->mb = 31u << 0; } } else if (compress == 3) { info->mr = stbi__get32le(s); info->mg = stbi__get32le(s); info->mb = stbi__get32le(s); // not documented, but generated by photoshop and handled by mspaint if (info->mr == info->mg && info->mg == info->mb) { // ?!?!? return stbi__errpuc("bad BMP", "bad BMP"); } } else return stbi__errpuc("bad BMP", "bad BMP"); } } else { int i; if (hsz != 108 && hsz != 124) return stbi__errpuc("bad BMP", "bad BMP"); info->mr = stbi__get32le(s); info->mg = stbi__get32le(s); info->mb = stbi__get32le(s); info->ma = stbi__get32le(s); stbi__get32le(s); // discard color space for (i=0; i < 12; ++i) stbi__get32le(s); // discard color space parameters if (hsz == 124) { stbi__get32le(s); // discard rendering intent stbi__get32le(s); // discard offset of profile data stbi__get32le(s); // discard size of profile data stbi__get32le(s); // discard reserved } } } return (void *) 1; } static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { stbi_uc *out; unsigned int mr=0,mg=0,mb=0,ma=0, all_a; stbi_uc pal[256][4]; int psize=0,i,j,width; int flip_vertically, pad, target; stbi__bmp_data info; info.all_a = 255; if (stbi__bmp_parse_header(s, &info) == NULL) return NULL; // error code already set flip_vertically = ((int) s->img_y) > 0; s->img_y = abs((int) s->img_y); mr = info.mr; mg = info.mg; mb = info.mb; ma = info.ma; all_a = info.all_a; if (info.hsz == 12) { if (info.bpp < 24) psize = (info.offset - 14 - 24) / 3; } else { if (info.bpp < 16) psize = (info.offset - 14 - info.hsz) >> 2; } s->img_n = ma ? 4 : 3; if (req_comp && req_comp >= 3) // we can directly decode 3 or 4 target = req_comp; else target = s->img_n; // if they want monochrome, we'll post-convert out = (stbi_uc *) stbi__malloc(target * s->img_x * s->img_y); if (!out) return stbi__errpuc("outofmem", "Out of memory"); if (info.bpp < 16) { int z=0; if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); } for (i=0; i < psize; ++i) { pal[i][2] = stbi__get8(s); pal[i][1] = stbi__get8(s); pal[i][0] = stbi__get8(s); if (info.hsz != 12) stbi__get8(s); pal[i][3] = 255; } stbi__skip(s, info.offset - 14 - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); if (info.bpp == 4) width = (s->img_x + 1) >> 1; else if (info.bpp == 8) width = s->img_x; else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); } pad = (-width)&3; for (j=0; j < (int) s->img_y; ++j) { for (i=0; i < (int) s->img_x; i += 2) { int v=stbi__get8(s),v2=0; if (info.bpp == 4) { v2 = v & 15; v >>= 4; } out[z++] = pal[v][0]; out[z++] = pal[v][1]; out[z++] = pal[v][2]; if (target == 4) out[z++] = 255; if (i+1 == (int) s->img_x) break; v = (info.bpp == 8) ? stbi__get8(s) : v2; out[z++] = pal[v][0]; out[z++] = pal[v][1]; out[z++] = pal[v][2]; if (target == 4) out[z++] = 255; } stbi__skip(s, pad); } } else { int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0; int z = 0; int easy=0; stbi__skip(s, info.offset - 14 - info.hsz); if (info.bpp == 24) width = 3 * s->img_x; else if (info.bpp == 16) width = 2*s->img_x; else /* bpp = 32 and pad = 0 */ width=0; pad = (-width) & 3; if (info.bpp == 24) { easy = 1; } else if (info.bpp == 32) { if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) easy = 2; } if (!easy) { if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); } // right shift amt to put high bit in position #7 rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr); gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg); bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb); ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma); } for (j=0; j < (int) s->img_y; ++j) { if (easy) { for (i=0; i < (int) s->img_x; ++i) { unsigned char a; out[z+2] = stbi__get8(s); out[z+1] = stbi__get8(s); out[z+0] = stbi__get8(s); z += 3; a = (easy == 2 ? stbi__get8(s) : 255); all_a |= a; if (target == 4) out[z++] = a; } } else { int bpp = info.bpp; for (i=0; i < (int) s->img_x; ++i) { stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s)); int a; out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount)); out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount)); out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount)); a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255); all_a |= a; if (target == 4) out[z++] = STBI__BYTECAST(a); } } stbi__skip(s, pad); } } // if alpha channel is all 0s, replace with all 255s if (target == 4 && all_a == 0) for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4) out[i] = 255; if (flip_vertically) { stbi_uc t; for (j=0; j < (int) s->img_y>>1; ++j) { stbi_uc *p1 = out + j *s->img_x*target; stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target; for (i=0; i < (int) s->img_x*target; ++i) { t = p1[i], p1[i] = p2[i], p2[i] = t; } } } if (req_comp && req_comp != target) { out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y); if (out == NULL) return out; // stbi__convert_format frees input on failure } *x = s->img_x; *y = s->img_y; if (comp) *comp = s->img_n; return out; } #endif // Targa Truevision - TGA // by Jonathan Dummer #ifndef STBI_NO_TGA // returns STBI_rgb or whatever, 0 on error static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16) { // only RGB or RGBA (incl. 16bit) or grey allowed if(is_rgb16) *is_rgb16 = 0; switch(bits_per_pixel) { case 8: return STBI_grey; case 16: if(is_grey) return STBI_grey_alpha; // else: fall-through case 15: if(is_rgb16) *is_rgb16 = 1; return STBI_rgb; case 24: // fall-through case 32: return bits_per_pixel/8; default: return 0; } } static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp) { int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel, tga_colormap_bpp; int sz, tga_colormap_type; stbi__get8(s); // discard Offset tga_colormap_type = stbi__get8(s); // colormap type if( tga_colormap_type > 1 ) { stbi__rewind(s); return 0; // only RGB or indexed allowed } tga_image_type = stbi__get8(s); // image type if ( tga_colormap_type == 1 ) { // colormapped (paletted) image if (tga_image_type != 1 && tga_image_type != 9) { stbi__rewind(s); return 0; } stbi__skip(s,4); // skip index of first colormap entry and number of entries sz = stbi__get8(s); // check bits per palette color entry if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) { stbi__rewind(s); return 0; } stbi__skip(s,4); // skip image x and y origin tga_colormap_bpp = sz; } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE if ( (tga_image_type != 2) && (tga_image_type != 3) && (tga_image_type != 10) && (tga_image_type != 11) ) { stbi__rewind(s); return 0; // only RGB or grey allowed, +/- RLE } stbi__skip(s,9); // skip colormap specification and image x/y origin tga_colormap_bpp = 0; } tga_w = stbi__get16le(s); if( tga_w < 1 ) { stbi__rewind(s); return 0; // test width } tga_h = stbi__get16le(s); if( tga_h < 1 ) { stbi__rewind(s); return 0; // test height } tga_bits_per_pixel = stbi__get8(s); // bits per pixel stbi__get8(s); // ignore alpha bits if (tga_colormap_bpp != 0) { if((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) { // when using a colormap, tga_bits_per_pixel is the size of the indexes // I don't think anything but 8 or 16bit indexes makes sense stbi__rewind(s); return 0; } tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL); } else { tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11), NULL); } if(!tga_comp) { stbi__rewind(s); return 0; } if (x) *x = tga_w; if (y) *y = tga_h; if (comp) *comp = tga_comp; return 1; // seems to have passed everything } static int stbi__tga_test(stbi__context *s) { int res = 0; int sz, tga_color_type; stbi__get8(s); // discard Offset tga_color_type = stbi__get8(s); // color type if ( tga_color_type > 1 ) goto errorEnd; // only RGB or indexed allowed sz = stbi__get8(s); // image type if ( tga_color_type == 1 ) { // colormapped (paletted) image if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9 stbi__skip(s,4); // skip index of first colormap entry and number of entries sz = stbi__get8(s); // check bits per palette color entry if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; stbi__skip(s,4); // skip image x and y origin } else { // "normal" image w/o colormap if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE stbi__skip(s,9); // skip colormap specification and image x/y origin } if ( stbi__get16le(s) < 1 ) goto errorEnd; // test width if ( stbi__get16le(s) < 1 ) goto errorEnd; // test height sz = stbi__get8(s); // bits per pixel if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; res = 1; // if we got this far, everything's good and we can return 1 instead of 0 errorEnd: stbi__rewind(s); return res; } // read 16bit value and convert to 24bit RGB void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out) { stbi__uint16 px = stbi__get16le(s); stbi__uint16 fiveBitMask = 31; // we have 3 channels with 5bits each int r = (px >> 10) & fiveBitMask; int g = (px >> 5) & fiveBitMask; int b = px & fiveBitMask; // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later out[0] = (r * 255)/31; out[1] = (g * 255)/31; out[2] = (b * 255)/31; // some people claim that the most significant bit might be used for alpha // (possibly if an alpha-bit is set in the "image descriptor byte") // but that only made 16bit test images completely translucent.. // so let's treat all 15 and 16bit TGAs as RGB with no alpha. } static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { // read in the TGA header stuff int tga_offset = stbi__get8(s); int tga_indexed = stbi__get8(s); int tga_image_type = stbi__get8(s); int tga_is_RLE = 0; int tga_palette_start = stbi__get16le(s); int tga_palette_len = stbi__get16le(s); int tga_palette_bits = stbi__get8(s); int tga_x_origin = stbi__get16le(s); int tga_y_origin = stbi__get16le(s); int tga_width = stbi__get16le(s); int tga_height = stbi__get16le(s); int tga_bits_per_pixel = stbi__get8(s); int tga_comp, tga_rgb16=0; int tga_inverted = stbi__get8(s); // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?) // image data unsigned char *tga_data; unsigned char *tga_palette = NULL; int i, j; unsigned char raw_data[4]; int RLE_count = 0; int RLE_repeating = 0; int read_next_pixel = 1; // do a tiny bit of precessing if ( tga_image_type >= 8 ) { tga_image_type -= 8; tga_is_RLE = 1; } tga_inverted = 1 - ((tga_inverted >> 5) & 1); // If I'm paletted, then I'll use the number of bits from the palette if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16); if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency return stbi__errpuc("bad format", "Can't find out TGA pixelformat"); // tga info *x = tga_width; *y = tga_height; if (comp) *comp = tga_comp; tga_data = (unsigned char*)stbi__malloc( (size_t)tga_width * tga_height * tga_comp ); if (!tga_data) return stbi__errpuc("outofmem", "Out of memory"); // skip to the data's starting position (offset usually = 0) stbi__skip(s, tga_offset ); if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) { for (i=0; i < tga_height; ++i) { int row = tga_inverted ? tga_height -i - 1 : i; stbi_uc *tga_row = tga_data + row*tga_width*tga_comp; stbi__getn(s, tga_row, tga_width * tga_comp); } } else { // do I need to load a palette? if ( tga_indexed) { // any data to skip? (offset usually = 0) stbi__skip(s, tga_palette_start ); // load the palette tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_comp ); if (!tga_palette) { STBI_FREE(tga_data); return stbi__errpuc("outofmem", "Out of memory"); } if (tga_rgb16) { stbi_uc *pal_entry = tga_palette; STBI_ASSERT(tga_comp == STBI_rgb); for (i=0; i < tga_palette_len; ++i) { stbi__tga_read_rgb16(s, pal_entry); pal_entry += tga_comp; } } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) { STBI_FREE(tga_data); STBI_FREE(tga_palette); return stbi__errpuc("bad palette", "Corrupt TGA"); } } // load the data for (i=0; i < tga_width * tga_height; ++i) { // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk? if ( tga_is_RLE ) { if ( RLE_count == 0 ) { // yep, get the next byte as a RLE command int RLE_cmd = stbi__get8(s); RLE_count = 1 + (RLE_cmd & 127); RLE_repeating = RLE_cmd >> 7; read_next_pixel = 1; } else if ( !RLE_repeating ) { read_next_pixel = 1; } } else { read_next_pixel = 1; } // OK, if I need to read a pixel, do it now if ( read_next_pixel ) { // load however much data we did have if ( tga_indexed ) { // read in index, then perform the lookup int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s); if ( pal_idx >= tga_palette_len ) { // invalid index pal_idx = 0; } pal_idx *= tga_comp; for (j = 0; j < tga_comp; ++j) { raw_data[j] = tga_palette[pal_idx+j]; } } else if(tga_rgb16) { STBI_ASSERT(tga_comp == STBI_rgb); stbi__tga_read_rgb16(s, raw_data); } else { // read in the data raw for (j = 0; j < tga_comp; ++j) { raw_data[j] = stbi__get8(s); } } // clear the reading flag for the next pixel read_next_pixel = 0; } // end of reading a pixel // copy data for (j = 0; j < tga_comp; ++j) tga_data[i*tga_comp+j] = raw_data[j]; // in case we're in RLE mode, keep counting down --RLE_count; } // do I need to invert the image? if ( tga_inverted ) { for (j = 0; j*2 < tga_height; ++j) { int index1 = j * tga_width * tga_comp; int index2 = (tga_height - 1 - j) * tga_width * tga_comp; for (i = tga_width * tga_comp; i > 0; --i) { unsigned char temp = tga_data[index1]; tga_data[index1] = tga_data[index2]; tga_data[index2] = temp; ++index1; ++index2; } } } // clear my palette, if I had one if ( tga_palette != NULL ) { STBI_FREE( tga_palette ); } } // swap RGB - if the source data was RGB16, it already is in the right order if (tga_comp >= 3 && !tga_rgb16) { unsigned char* tga_pixel = tga_data; for (i=0; i < tga_width * tga_height; ++i) { unsigned char temp = tga_pixel[0]; tga_pixel[0] = tga_pixel[2]; tga_pixel[2] = temp; tga_pixel += tga_comp; } } // convert to target component count if (req_comp && req_comp != tga_comp) tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); // the things I do to get rid of an error message, and yet keep // Microsoft's C compilers happy... [8^( tga_palette_start = tga_palette_len = tga_palette_bits = tga_x_origin = tga_y_origin = 0; // OK, done return tga_data; } #endif // ************************************************************************************************* // Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB #ifndef STBI_NO_PSD static int stbi__psd_test(stbi__context *s) { int r = (stbi__get32be(s) == 0x38425053); stbi__rewind(s); return r; } static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { int pixelCount; int channelCount, compression; int channel, i, count, len; int bitdepth; int w,h; stbi_uc *out; // Check identifier if (stbi__get32be(s) != 0x38425053) // "8BPS" return stbi__errpuc("not PSD", "Corrupt PSD image"); // Check file type version. if (stbi__get16be(s) != 1) return stbi__errpuc("wrong version", "Unsupported version of PSD image"); // Skip 6 reserved bytes. stbi__skip(s, 6 ); // Read the number of channels (R, G, B, A, etc). channelCount = stbi__get16be(s); if (channelCount < 0 || channelCount > 16) return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); // Read the rows and columns of the image. h = stbi__get32be(s); w = stbi__get32be(s); // Make sure the depth is 8 bits. bitdepth = stbi__get16be(s); if (bitdepth != 8 && bitdepth != 16) return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); // Make sure the color mode is RGB. // Valid options are: // 0: Bitmap // 1: Grayscale // 2: Indexed color // 3: RGB color // 4: CMYK color // 7: Multichannel // 8: Duotone // 9: Lab color if (stbi__get16be(s) != 3) return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) stbi__skip(s,stbi__get32be(s) ); // Skip the image resources. (resolution, pen tool paths, etc) stbi__skip(s, stbi__get32be(s) ); // Skip the reserved data. stbi__skip(s, stbi__get32be(s) ); // Find out if the data is compressed. // Known values: // 0: no compression // 1: RLE compressed compression = stbi__get16be(s); if (compression > 1) return stbi__errpuc("bad compression", "PSD has an unknown compression format"); // Create the destination image. out = (stbi_uc *) stbi__malloc(4 * w*h); if (!out) return stbi__errpuc("outofmem", "Out of memory"); pixelCount = w*h; // Initialize the data to zero. //memset( out, 0, pixelCount * 4 ); // Finally, the image data. if (compression) { // RLE as used by .PSD and .TIFF // Loop until you get the number of unpacked bytes you are expecting: // Read the next source byte into n. // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally. // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times. // Else if n is 128, noop. // Endloop // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data, // which we're going to just skip. stbi__skip(s, h * channelCount * 2 ); // Read the RLE data by channel. for (channel = 0; channel < 4; channel++) { stbi_uc *p; p = out+channel; if (channel >= channelCount) { // Fill this channel with default data. for (i = 0; i < pixelCount; i++, p += 4) *p = (channel == 3 ? 255 : 0); } else { // Read the RLE data. count = 0; while (count < pixelCount) { len = stbi__get8(s); if (len == 128) { // No-op. } else if (len < 128) { // Copy next len+1 bytes literally. len++; count += len; while (len) { *p = stbi__get8(s); p += 4; len--; } } else if (len > 128) { stbi_uc val; // Next -len+1 bytes in the dest are replicated from next source byte. // (Interpret len as a negative 8-bit int.) len ^= 0x0FF; len += 2; val = stbi__get8(s); count += len; while (len) { *p = val; p += 4; len--; } } } } } } else { // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...) // where each channel consists of an 8-bit value for each pixel in the image. // Read the data by channel. for (channel = 0; channel < 4; channel++) { stbi_uc *p; p = out + channel; if (channel >= channelCount) { // Fill this channel with default data. stbi_uc val = channel == 3 ? 255 : 0; for (i = 0; i < pixelCount; i++, p += 4) *p = val; } else { // Read the data. if (bitdepth == 16) { for (i = 0; i < pixelCount; i++, p += 4) *p = (stbi_uc) (stbi__get16be(s) >> 8); } else { for (i = 0; i < pixelCount; i++, p += 4) *p = stbi__get8(s); } } } } if (channelCount >= 4) { for (i=0; i < w*h; ++i) { unsigned char *pixel = out + 4*i; if (pixel[3] != 0 && pixel[3] != 255) { // remove weird white matte from PSD float a = pixel[3] / 255.0f; float ra = 1.0f / a; float inv_a = 255.0f * (1 - ra); pixel[0] = (unsigned char) (pixel[0]*ra + inv_a); pixel[1] = (unsigned char) (pixel[1]*ra + inv_a); pixel[2] = (unsigned char) (pixel[2]*ra + inv_a); } } } if (req_comp && req_comp != 4) { out = stbi__convert_format(out, 4, req_comp, w, h); if (out == NULL) return out; // stbi__convert_format frees input on failure } if (comp) *comp = 4; *y = h; *x = w; return out; } #endif // ************************************************************************************************* // Softimage PIC loader // by Tom Seddon // // See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format // See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/ #ifndef STBI_NO_PIC static int stbi__pic_is4(stbi__context *s,const char *str) { int i; for (i=0; i<4; ++i) if (stbi__get8(s) != (stbi_uc)str[i]) return 0; return 1; } static int stbi__pic_test_core(stbi__context *s) { int i; if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) return 0; for(i=0;i<84;++i) stbi__get8(s); if (!stbi__pic_is4(s,"PICT")) return 0; return 1; } typedef struct { stbi_uc size,type,channel; } stbi__pic_packet; static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest) { int mask=0x80, i; for (i=0; i<4; ++i, mask>>=1) { if (channel & mask) { if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short"); dest[i]=stbi__get8(s); } } return dest; } static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src) { int mask=0x80,i; for (i=0;i<4; ++i, mask>>=1) if (channel&mask) dest[i]=src[i]; } static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result) { int act_comp=0,num_packets=0,y,chained; stbi__pic_packet packets[10]; // this will (should...) cater for even some bizarre stuff like having data // for the same channel in multiple packets. do { stbi__pic_packet *packet; if (num_packets==sizeof(packets)/sizeof(packets[0])) return stbi__errpuc("bad format","too many packets"); packet = &packets[num_packets++]; chained = stbi__get8(s); packet->size = stbi__get8(s); packet->type = stbi__get8(s); packet->channel = stbi__get8(s); act_comp |= packet->channel; if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)"); if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp"); } while (chained); *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel? for(y=0; ytype) { default: return stbi__errpuc("bad format","packet has bad compression type"); case 0: {//uncompressed int x; for(x=0;xchannel,dest)) return 0; break; } case 1://Pure RLE { int left=width, i; while (left>0) { stbi_uc count,value[4]; count=stbi__get8(s); if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)"); if (count > left) count = (stbi_uc) left; if (!stbi__readval(s,packet->channel,value)) return 0; for(i=0; ichannel,dest,value); left -= count; } } break; case 2: {//Mixed RLE int left=width; while (left>0) { int count = stbi__get8(s), i; if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)"); if (count >= 128) { // Repeated stbi_uc value[4]; if (count==128) count = stbi__get16be(s); else count -= 127; if (count > left) return stbi__errpuc("bad file","scanline overrun"); if (!stbi__readval(s,packet->channel,value)) return 0; for(i=0;ichannel,dest,value); } else { // Raw ++count; if (count>left) return stbi__errpuc("bad file","scanline overrun"); for(i=0;ichannel,dest)) return 0; } left-=count; } break; } } } } return result; } static stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp) { stbi_uc *result; int i, x,y; for (i=0; i<92; ++i) stbi__get8(s); x = stbi__get16be(s); y = stbi__get16be(s); if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)"); if ((1 << 28) / x < y) return stbi__errpuc("too large", "Image too large to decode"); stbi__get32be(s); //skip `ratio' stbi__get16be(s); //skip `fields' stbi__get16be(s); //skip `pad' // intermediate buffer is RGBA result = (stbi_uc *) stbi__malloc(x*y*4); memset(result, 0xff, x*y*4); if (!stbi__pic_load_core(s,x,y,comp, result)) { STBI_FREE(result); result=0; } *px = x; *py = y; if (req_comp == 0) req_comp = *comp; result=stbi__convert_format(result,4,req_comp,x,y); return result; } static int stbi__pic_test(stbi__context *s) { int r = stbi__pic_test_core(s); stbi__rewind(s); return r; } #endif // ************************************************************************************************* // GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb #ifndef STBI_NO_GIF typedef struct { stbi__int16 prefix; stbi_uc first; stbi_uc suffix; } stbi__gif_lzw; typedef struct { int w,h; stbi_uc *out, *old_out; // output buffer (always 4 components) int flags, bgindex, ratio, transparent, eflags, delay; stbi_uc pal[256][4]; stbi_uc lpal[256][4]; stbi__gif_lzw codes[4096]; stbi_uc *color_table; int parse, step; int lflags; int start_x, start_y; int max_x, max_y; int cur_x, cur_y; int line_size; } stbi__gif; static int stbi__gif_test_raw(stbi__context *s) { int sz; if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0; sz = stbi__get8(s); if (sz != '9' && sz != '7') return 0; if (stbi__get8(s) != 'a') return 0; return 1; } static int stbi__gif_test(stbi__context *s) { int r = stbi__gif_test_raw(s); stbi__rewind(s); return r; } static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp) { int i; for (i=0; i < num_entries; ++i) { pal[i][2] = stbi__get8(s); pal[i][1] = stbi__get8(s); pal[i][0] = stbi__get8(s); pal[i][3] = transp == i ? 0 : 255; } } static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info) { stbi_uc version; if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return stbi__err("not GIF", "Corrupt GIF"); version = stbi__get8(s); if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF"); if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF"); stbi__g_failure_reason = ""; g->w = stbi__get16le(s); g->h = stbi__get16le(s); g->flags = stbi__get8(s); g->bgindex = stbi__get8(s); g->ratio = stbi__get8(s); g->transparent = -1; if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments if (is_info) return 1; if (g->flags & 0x80) stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1); return 1; } static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp) { stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); if (!stbi__gif_header(s, g, comp, 1)) { STBI_FREE(g); stbi__rewind( s ); return 0; } if (x) *x = g->w; if (y) *y = g->h; STBI_FREE(g); return 1; } static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) { stbi_uc *p, *c; // recurse to decode the prefixes, since the linked-list is backwards, // and working backwards through an interleaved image would be nasty if (g->codes[code].prefix >= 0) stbi__out_gif_code(g, g->codes[code].prefix); if (g->cur_y >= g->max_y) return; p = &g->out[g->cur_x + g->cur_y]; c = &g->color_table[g->codes[code].suffix * 4]; if (c[3] >= 128) { p[0] = c[2]; p[1] = c[1]; p[2] = c[0]; p[3] = c[3]; } g->cur_x += 4; if (g->cur_x >= g->max_x) { g->cur_x = g->start_x; g->cur_y += g->step; while (g->cur_y >= g->max_y && g->parse > 0) { g->step = (1 << g->parse) * g->line_size; g->cur_y = g->start_y + (g->step >> 1); --g->parse; } } } static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) { stbi_uc lzw_cs; stbi__int32 len, init_code; stbi__uint32 first; stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear; stbi__gif_lzw *p; lzw_cs = stbi__get8(s); if (lzw_cs > 12) return NULL; clear = 1 << lzw_cs; first = 1; codesize = lzw_cs + 1; codemask = (1 << codesize) - 1; bits = 0; valid_bits = 0; for (init_code = 0; init_code < clear; init_code++) { g->codes[init_code].prefix = -1; g->codes[init_code].first = (stbi_uc) init_code; g->codes[init_code].suffix = (stbi_uc) init_code; } // support no starting clear code avail = clear+2; oldcode = -1; len = 0; for(;;) { if (valid_bits < codesize) { if (len == 0) { len = stbi__get8(s); // start new block if (len == 0) return g->out; } --len; bits |= (stbi__int32) stbi__get8(s) << valid_bits; valid_bits += 8; } else { stbi__int32 code = bits & codemask; bits >>= codesize; valid_bits -= codesize; // @OPTIMIZE: is there some way we can accelerate the non-clear path? if (code == clear) { // clear code codesize = lzw_cs + 1; codemask = (1 << codesize) - 1; avail = clear + 2; oldcode = -1; first = 0; } else if (code == clear + 1) { // end of stream code stbi__skip(s, len); while ((len = stbi__get8(s)) > 0) stbi__skip(s,len); return g->out; } else if (code <= avail) { if (first) return stbi__errpuc("no clear code", "Corrupt GIF"); if (oldcode >= 0) { p = &g->codes[avail++]; if (avail > 4096) return stbi__errpuc("too many codes", "Corrupt GIF"); p->prefix = (stbi__int16) oldcode; p->first = g->codes[oldcode].first; p->suffix = (code == avail) ? p->first : g->codes[code].first; } else if (code == avail) return stbi__errpuc("illegal code in raster", "Corrupt GIF"); stbi__out_gif_code(g, (stbi__uint16) code); if ((avail & codemask) == 0 && avail <= 0x0FFF) { codesize++; codemask = (1 << codesize) - 1; } oldcode = code; } else { return stbi__errpuc("illegal code in raster", "Corrupt GIF"); } } } } static void stbi__fill_gif_background(stbi__gif *g, int x0, int y0, int x1, int y1) { int x, y; stbi_uc *c = g->pal[g->bgindex]; for (y = y0; y < y1; y += 4 * g->w) { for (x = x0; x < x1; x += 4) { stbi_uc *p = &g->out[y + x]; p[0] = c[2]; p[1] = c[1]; p[2] = c[0]; p[3] = 0; } } } // this function is designed to support animated gifs, although stb_image doesn't support it static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp) { int i; stbi_uc *prev_out = 0; if (g->out == 0 && !stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header prev_out = g->out; g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h); if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory"); switch ((g->eflags & 0x1C) >> 2) { case 0: // unspecified (also always used on 1st frame) stbi__fill_gif_background(g, 0, 0, 4 * g->w, 4 * g->w * g->h); break; case 1: // do not dispose if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h); g->old_out = prev_out; break; case 2: // dispose to background if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h); stbi__fill_gif_background(g, g->start_x, g->start_y, g->max_x, g->max_y); break; case 3: // dispose to previous if (g->old_out) { for (i = g->start_y; i < g->max_y; i += 4 * g->w) memcpy(&g->out[i + g->start_x], &g->old_out[i + g->start_x], g->max_x - g->start_x); } break; } for (;;) { switch (stbi__get8(s)) { case 0x2C: /* Image Descriptor */ { int prev_trans = -1; stbi__int32 x, y, w, h; stbi_uc *o; x = stbi__get16le(s); y = stbi__get16le(s); w = stbi__get16le(s); h = stbi__get16le(s); if (((x + w) > (g->w)) || ((y + h) > (g->h))) return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); g->line_size = g->w * 4; g->start_x = x * 4; g->start_y = y * g->line_size; g->max_x = g->start_x + w * 4; g->max_y = g->start_y + h * g->line_size; g->cur_x = g->start_x; g->cur_y = g->start_y; g->lflags = stbi__get8(s); if (g->lflags & 0x40) { g->step = 8 * g->line_size; // first interlaced spacing g->parse = 3; } else { g->step = g->line_size; g->parse = 0; } if (g->lflags & 0x80) { stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1); g->color_table = (stbi_uc *) g->lpal; } else if (g->flags & 0x80) { if (g->transparent >= 0 && (g->eflags & 0x01)) { prev_trans = g->pal[g->transparent][3]; g->pal[g->transparent][3] = 0; } g->color_table = (stbi_uc *) g->pal; } else return stbi__errpuc("missing color table", "Corrupt GIF"); o = stbi__process_gif_raster(s, g); if (o == NULL) return NULL; if (prev_trans != -1) g->pal[g->transparent][3] = (stbi_uc) prev_trans; return o; } case 0x21: // Comment Extension. { int len; if (stbi__get8(s) == 0xF9) { // Graphic Control Extension. len = stbi__get8(s); if (len == 4) { g->eflags = stbi__get8(s); g->delay = stbi__get16le(s); g->transparent = stbi__get8(s); } else { stbi__skip(s, len); break; } } while ((len = stbi__get8(s)) != 0) stbi__skip(s, len); break; } case 0x3B: // gif stream termination code return (stbi_uc *) s; // using '1' causes warning on some compilers default: return stbi__errpuc("unknown code", "Corrupt GIF"); } } STBI_NOTUSED(req_comp); } static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { stbi_uc *u = 0; stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); memset(g, 0, sizeof(*g)); u = stbi__gif_load_next(s, g, comp, req_comp); if (u == (stbi_uc *) s) u = 0; // end of animated gif marker if (u) { *x = g->w; *y = g->h; if (req_comp && req_comp != 4) u = stbi__convert_format(u, 4, req_comp, g->w, g->h); } else if (g->out) STBI_FREE(g->out); STBI_FREE(g); return u; } static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp) { return stbi__gif_info_raw(s,x,y,comp); } #endif // ************************************************************************************************* // Radiance RGBE HDR loader // originally by Nicolas Schulz #ifndef STBI_NO_HDR static int stbi__hdr_test_core(stbi__context *s) { const char *signature = "#?RADIANCE\n"; int i; for (i=0; signature[i]; ++i) if (stbi__get8(s) != signature[i]) return 0; return 1; } static int stbi__hdr_test(stbi__context* s) { int r = stbi__hdr_test_core(s); stbi__rewind(s); return r; } #define STBI__HDR_BUFLEN 1024 static char *stbi__hdr_gettoken(stbi__context *z, char *buffer) { int len=0; char c = '\0'; c = (char) stbi__get8(z); while (!stbi__at_eof(z) && c != '\n') { buffer[len++] = c; if (len == STBI__HDR_BUFLEN-1) { // flush to end of line while (!stbi__at_eof(z) && stbi__get8(z) != '\n') ; break; } c = (char) stbi__get8(z); } buffer[len] = 0; return buffer; } static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp) { if ( input[3] != 0 ) { float f1; // Exponent f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8)); if (req_comp <= 2) output[0] = (input[0] + input[1] + input[2]) * f1 / 3; else { output[0] = input[0] * f1; output[1] = input[1] * f1; output[2] = input[2] * f1; } if (req_comp == 2) output[1] = 1; if (req_comp == 4) output[3] = 1; } else { switch (req_comp) { case 4: output[3] = 1; /* fallthrough */ case 3: output[0] = output[1] = output[2] = 0; break; case 2: output[1] = 1; /* fallthrough */ case 1: output[0] = 0; break; } } } static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { char buffer[STBI__HDR_BUFLEN]; char *token; int valid = 0; int width, height; stbi_uc *scanline; float *hdr_data; int len; unsigned char count, value; int i, j, k, c1,c2, z; // Check identifier if (strcmp(stbi__hdr_gettoken(s,buffer), "#?RADIANCE") != 0) return stbi__errpf("not HDR", "Corrupt HDR image"); // Parse header for(;;) { token = stbi__hdr_gettoken(s,buffer); if (token[0] == 0) break; if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; } if (!valid) return stbi__errpf("unsupported format", "Unsupported HDR format"); // Parse width and height // can't use sscanf() if we're not using stdio! token = stbi__hdr_gettoken(s,buffer); if (strncmp(token, "-Y ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); token += 3; height = (int) strtol(token, &token, 10); while (*token == ' ') ++token; if (strncmp(token, "+X ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); token += 3; width = (int) strtol(token, NULL, 10); *x = width; *y = height; if (comp) *comp = 3; if (req_comp == 0) req_comp = 3; // Read data hdr_data = (float *) stbi__malloc(height * width * req_comp * sizeof(float)); // Load image data // image data is stored as some number of sca if ( width < 8 || width >= 32768) { // Read flat data for (j=0; j < height; ++j) { for (i=0; i < width; ++i) { stbi_uc rgbe[4]; main_decode_loop: stbi__getn(s, rgbe, 4); stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp); } } } else { // Read RLE-encoded data scanline = NULL; for (j = 0; j < height; ++j) { c1 = stbi__get8(s); c2 = stbi__get8(s); len = stbi__get8(s); if (c1 != 2 || c2 != 2 || (len & 0x80)) { // not run-length encoded, so we have to actually use THIS data as a decoded // pixel (note this can't be a valid pixel--one of RGB must be >= 128) stbi_uc rgbe[4]; rgbe[0] = (stbi_uc) c1; rgbe[1] = (stbi_uc) c2; rgbe[2] = (stbi_uc) len; rgbe[3] = (stbi_uc) stbi__get8(s); stbi__hdr_convert(hdr_data, rgbe, req_comp); i = 1; j = 0; STBI_FREE(scanline); goto main_decode_loop; // yes, this makes no sense } len <<= 8; len |= stbi__get8(s); if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); } if (scanline == NULL) scanline = (stbi_uc *) stbi__malloc(width * 4); for (k = 0; k < 4; ++k) { i = 0; while (i < width) { count = stbi__get8(s); if (count > 128) { // Run value = stbi__get8(s); count -= 128; for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = value; } else { // Dump for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = stbi__get8(s); } } } for (i=0; i < width; ++i) stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp); } STBI_FREE(scanline); } return hdr_data; } static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp) { char buffer[STBI__HDR_BUFLEN]; char *token; int valid = 0; if (stbi__hdr_test(s) == 0) { stbi__rewind( s ); return 0; } for(;;) { token = stbi__hdr_gettoken(s,buffer); if (token[0] == 0) break; if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; } if (!valid) { stbi__rewind( s ); return 0; } token = stbi__hdr_gettoken(s,buffer); if (strncmp(token, "-Y ", 3)) { stbi__rewind( s ); return 0; } token += 3; *y = (int) strtol(token, &token, 10); while (*token == ' ') ++token; if (strncmp(token, "+X ", 3)) { stbi__rewind( s ); return 0; } token += 3; *x = (int) strtol(token, NULL, 10); *comp = 3; return 1; } #endif // STBI_NO_HDR #ifndef STBI_NO_BMP static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp) { void *p; stbi__bmp_data info; info.all_a = 255; p = stbi__bmp_parse_header(s, &info); stbi__rewind( s ); if (p == NULL) return 0; *x = s->img_x; *y = s->img_y; *comp = info.ma ? 4 : 3; return 1; } #endif #ifndef STBI_NO_PSD static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp) { int channelCount; if (stbi__get32be(s) != 0x38425053) { stbi__rewind( s ); return 0; } if (stbi__get16be(s) != 1) { stbi__rewind( s ); return 0; } stbi__skip(s, 6); channelCount = stbi__get16be(s); if (channelCount < 0 || channelCount > 16) { stbi__rewind( s ); return 0; } *y = stbi__get32be(s); *x = stbi__get32be(s); if (stbi__get16be(s) != 8) { stbi__rewind( s ); return 0; } if (stbi__get16be(s) != 3) { stbi__rewind( s ); return 0; } *comp = 4; return 1; } #endif #ifndef STBI_NO_PIC static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp) { int act_comp=0,num_packets=0,chained; stbi__pic_packet packets[10]; if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) { stbi__rewind(s); return 0; } stbi__skip(s, 88); *x = stbi__get16be(s); *y = stbi__get16be(s); if (stbi__at_eof(s)) { stbi__rewind( s); return 0; } if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) { stbi__rewind( s ); return 0; } stbi__skip(s, 8); do { stbi__pic_packet *packet; if (num_packets==sizeof(packets)/sizeof(packets[0])) return 0; packet = &packets[num_packets++]; chained = stbi__get8(s); packet->size = stbi__get8(s); packet->type = stbi__get8(s); packet->channel = stbi__get8(s); act_comp |= packet->channel; if (stbi__at_eof(s)) { stbi__rewind( s ); return 0; } if (packet->size != 8) { stbi__rewind( s ); return 0; } } while (chained); *comp = (act_comp & 0x10 ? 4 : 3); return 1; } #endif // ************************************************************************************************* // Portable Gray Map and Portable Pixel Map loader // by Ken Miller // // PGM: http://netpbm.sourceforge.net/doc/pgm.html // PPM: http://netpbm.sourceforge.net/doc/ppm.html // // Known limitations: // Does not support comments in the header section // Does not support ASCII image data (formats P2 and P3) // Does not support 16-bit-per-channel #ifndef STBI_NO_PNM static int stbi__pnm_test(stbi__context *s) { char p, t; p = (char) stbi__get8(s); t = (char) stbi__get8(s); if (p != 'P' || (t != '5' && t != '6')) { stbi__rewind( s ); return 0; } return 1; } static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { stbi_uc *out; if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n)) return 0; *x = s->img_x; *y = s->img_y; *comp = s->img_n; out = (stbi_uc *) stbi__malloc(s->img_n * s->img_x * s->img_y); if (!out) return stbi__errpuc("outofmem", "Out of memory"); stbi__getn(s, out, s->img_n * s->img_x * s->img_y); if (req_comp && req_comp != s->img_n) { out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y); if (out == NULL) return out; // stbi__convert_format frees input on failure } return out; } static int stbi__pnm_isspace(char c) { return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r'; } static void stbi__pnm_skip_whitespace(stbi__context *s, char *c) { for (;;) { while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) *c = (char) stbi__get8(s); if (stbi__at_eof(s) || *c != '#') break; while (!stbi__at_eof(s) && *c != '\n' && *c != '\r' ) *c = (char) stbi__get8(s); } } static int stbi__pnm_isdigit(char c) { return c >= '0' && c <= '9'; } static int stbi__pnm_getinteger(stbi__context *s, char *c) { int value = 0; while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) { value = value*10 + (*c - '0'); *c = (char) stbi__get8(s); } return value; } static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) { int maxv; char c, p, t; stbi__rewind( s ); // Get identifier p = (char) stbi__get8(s); t = (char) stbi__get8(s); if (p != 'P' || (t != '5' && t != '6')) { stbi__rewind( s ); return 0; } *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm c = (char) stbi__get8(s); stbi__pnm_skip_whitespace(s, &c); *x = stbi__pnm_getinteger(s, &c); // read width stbi__pnm_skip_whitespace(s, &c); *y = stbi__pnm_getinteger(s, &c); // read height stbi__pnm_skip_whitespace(s, &c); maxv = stbi__pnm_getinteger(s, &c); // read max value if (maxv > 255) return stbi__err("max value > 255", "PPM image not 8-bit"); else return 1; } #endif static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) { #ifndef STBI_NO_JPEG if (stbi__jpeg_info(s, x, y, comp)) return 1; #endif #ifndef STBI_NO_PNG if (stbi__png_info(s, x, y, comp)) return 1; #endif #ifndef STBI_NO_GIF if (stbi__gif_info(s, x, y, comp)) return 1; #endif #ifndef STBI_NO_BMP if (stbi__bmp_info(s, x, y, comp)) return 1; #endif #ifndef STBI_NO_PSD if (stbi__psd_info(s, x, y, comp)) return 1; #endif #ifndef STBI_NO_PIC if (stbi__pic_info(s, x, y, comp)) return 1; #endif #ifndef STBI_NO_PNM if (stbi__pnm_info(s, x, y, comp)) return 1; #endif #ifndef STBI_NO_HDR if (stbi__hdr_info(s, x, y, comp)) return 1; #endif // test tga last because it's a crappy test! #ifndef STBI_NO_TGA if (stbi__tga_info(s, x, y, comp)) return 1; #endif return stbi__err("unknown image type", "Image not of any known type, or corrupt"); } #ifndef STBI_NO_STDIO STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp) { FILE *f = stbi__fopen(filename, "rb"); int result; if (!f) return stbi__err("can't fopen", "Unable to open file"); result = stbi_info_from_file(f, x, y, comp); fclose(f); return result; } STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) { int r; stbi__context s; long pos = ftell(f); stbi__start_file(&s, f); r = stbi__info_main(&s,x,y,comp); fseek(f,pos,SEEK_SET); return r; } #endif // !STBI_NO_STDIO STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) { stbi__context s; stbi__start_mem(&s,buffer,len); return stbi__info_main(&s,x,y,comp); } STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) { stbi__context s; stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); return stbi__info_main(&s,x,y,comp); } #endif // STB_IMAGE_IMPLEMENTATION /* revision history: 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes 2.11 (2016-04-02) allocate large structures on the stack remove white matting for transparent PSD fix reported channel count for PNG & BMP re-enable SSE2 in non-gcc 64-bit support RGB-formatted JPEG read 16-bit PNGs (only as 8-bit) 2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED 2.09 (2016-01-16) allow comments in PNM files 16-bit-per-pixel TGA (not bit-per-component) info() for TGA could break due to .hdr handling info() for BMP to shares code instead of sloppy parse can use STBI_REALLOC_SIZED if allocator doesn't support realloc code cleanup 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA 2.07 (2015-09-13) fix compiler warnings partial animated GIF support limited 16-bpc PSD support #ifdef unused functions bug with < 92 byte PIC,PNM,HDR,TGA 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit 2.03 (2015-04-12) extra corruption checking (mmozeiko) stbi_set_flip_vertically_on_load (nguillemot) fix NEON support; fix mingw support 2.02 (2015-01-19) fix incorrect assert, fix warning 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg) progressive JPEG (stb) PGM/PPM support (Ken Miller) STBI_MALLOC,STBI_REALLOC,STBI_FREE GIF bugfix -- seemingly never worked STBI_NO_*, STBI_ONLY_* 1.48 (2014-12-14) fix incorrectly-named assert() 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb) optimize PNG (ryg) fix bug in interlaced PNG with user-specified channel count (stb) 1.46 (2014-08-26) fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG 1.45 (2014-08-16) fix MSVC-ARM internal compiler error by wrapping malloc 1.44 (2014-08-07) various warning fixes from Ronny Chevalier 1.43 (2014-07-15) fix MSVC-only compiler problem in code changed in 1.42 1.42 (2014-07-09) don't define _CRT_SECURE_NO_WARNINGS (affects user code) fixes to stbi__cleanup_jpeg path added STBI_ASSERT to avoid requiring assert.h 1.41 (2014-06-25) fix search&replace from 1.36 that messed up comments/error messages 1.40 (2014-06-22) fix gcc struct-initialization warning 1.39 (2014-06-15) fix to TGA optimization when req_comp != number of components in TGA; fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite) add support for BMP version 5 (more ignored fields) 1.38 (2014-06-06) suppress MSVC warnings on integer casts truncating values fix accidental rename of 'skip' field of I/O 1.37 (2014-06-04) remove duplicate typedef 1.36 (2014-06-03) convert to header file single-file library if de-iphone isn't set, load iphone images color-swapped instead of returning NULL 1.35 (2014-05-27) various warnings fix broken STBI_SIMD path fix bug where stbi_load_from_file no longer left file pointer in correct place fix broken non-easy path for 32-bit BMP (possibly never used) TGA optimization by Arseny Kapoulkine 1.34 (unknown) use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case 1.33 (2011-07-14) make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements 1.32 (2011-07-13) support for "info" function for all supported filetypes (SpartanJ) 1.31 (2011-06-20) a few more leak fixes, bug in PNG handling (SpartanJ) 1.30 (2011-06-11) added ability to load files via callbacks to accomidate custom input streams (Ben Wenger) removed deprecated format-specific test/load functions removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha) fix inefficiency in decoding 32-bit BMP (David Woo) 1.29 (2010-08-16) various warning fixes from Aurelien Pocheville 1.28 (2010-08-01) fix bug in GIF palette transparency (SpartanJ) 1.27 (2010-08-01) cast-to-stbi_uc to fix warnings 1.26 (2010-07-24) fix bug in file buffering for PNG reported by SpartanJ 1.25 (2010-07-17) refix trans_data warning (Won Chun) 1.24 (2010-07-12) perf improvements reading from files on platforms with lock-heavy fgetc() minor perf improvements for jpeg deprecated type-specific functions so we'll get feedback if they're needed attempt to fix trans_data warning (Won Chun) 1.23 fixed bug in iPhone support 1.22 (2010-07-10) removed image *writing* support stbi_info support from Jetro Lauha GIF support from Jean-Marc Lienher iPhone PNG-extensions from James Brown warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva) 1.21 fix use of 'stbi_uc' in header (reported by jon blow) 1.20 added support for Softimage PIC, by Tom Seddon 1.19 bug in interlaced PNG corruption check (found by ryg) 1.18 (2008-08-02) fix a threading bug (local mutable static) 1.17 support interlaced PNG 1.16 major bugfix - stbi__convert_format converted one too many pixels 1.15 initialize some fields for thread safety 1.14 fix threadsafe conversion bug header-file-only version (#define STBI_HEADER_FILE_ONLY before including) 1.13 threadsafe 1.12 const qualifiers in the API 1.11 Support installable IDCT, colorspace conversion routines 1.10 Fixes for 64-bit (don't use "unsigned long") optimized upsampling by Fabian "ryg" Giesen 1.09 Fix format-conversion for PSD code (bad global variables!) 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz 1.07 attempt to fix C++ warning/errors again 1.06 attempt to fix C++ warning/errors again 1.05 fix TGA loading to return correct *comp and use good luminance calc 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR 1.02 support for (subset of) HDR files, float interface for preferred access to them 1.01 fix bug: possible bug in handling right-side up bmps... not sure fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all 1.00 interface to zlib that skips zlib header 0.99 correct handling of alpha in palette 0.98 TGA loader by lonesock; dynamically add loaders (untested) 0.97 jpeg errors on too large a file; also catch another malloc failure 0.96 fix detection of invalid v value - particleman@mollyrocket forum 0.95 during header scan, seek to markers in case of padding 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same 0.93 handle jpegtran output; verbose errors 0.92 read 4,8,16,24,32-bit BMP files of several formats 0.91 output 24-bit Windows 3.0 BMP files 0.90 fix a few more warnings; bump version number to approach 1.0 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd 0.60 fix compiling as c++ 0.59 fix warnings: merge Dave Moore's -Wall fixes 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available 0.56 fix bug: zlib uncompressed mode len vs. nlen 0.55 fix bug: restart_interval not initialized to 0 0.54 allow NULL for 'int *comp' 0.53 fix bug in png 3->4; speedup png decoding 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments 0.51 obey req_comp requests, 1-component jpegs return as 1-component, on 'test' only check type, not whether we support this variant 0.50 (2006-11-19) first released version */ goxel-0.8.1/ext_src/stb/stb_image_write.h000066400000000000000000001114651334742672700204410ustar00rootroot00000000000000/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015 no warranty implied; use at your own risk Before #including, #define STB_IMAGE_WRITE_IMPLEMENTATION in the file that you want to have the implementation. Will probably not work correctly with strict-aliasing optimizations. ABOUT: This header file is a library for writing images to C stdio. It could be adapted to write to memory or a general streaming interface; let me know. The PNG output is not optimal; it is 20-50% larger than the file written by a decent optimizing implementation. This library is designed for source code compactness and simplicity, not optimal image file size or run-time performance. BUILDING: You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h. You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace malloc,realloc,free. You can define STBIW_MEMMOVE() to replace memmove() USAGE: There are four functions, one for each image file format: int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); There are also four equivalent functions that use an arbitrary write function. You are expected to open/close your file-equivalent before and after calling these: int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); where the callback is: void stbi_write_func(void *context, void *data, int size); You can define STBI_WRITE_NO_STDIO to disable the file variant of these functions, so the library will not use stdio.h at all. However, this will also disable HDR writing, because it requires stdio for formatted output. Each function returns 0 on failure and non-0 on success. The functions create an image file defined by the parameters. The image is a rectangle of pixels stored from left-to-right, top-to-bottom. Each pixel contains 'comp' channels of data stored interleaved with 8-bits per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall. The *data pointer points to the first byte of the top-left-most pixel. For PNG, "stride_in_bytes" is the distance in bytes from the first byte of a row of pixels to the first byte of the next row of pixels. PNG creates output files with the same number of components as the input. The BMP format expands Y to RGB in the file format and does not output alpha. PNG supports writing rectangles of data even when the bytes storing rows of data are not consecutive in memory (e.g. sub-rectangles of a larger image), by supplying the stride between the beginning of adjacent rows. The other formats do not. (Thus you cannot write a native-format BMP through the BMP writer, both because it is in BGR order and because it may have padding at the end of the line.) HDR expects linear float data. Since the format is always 32-bit rgb(e) data, alpha (if provided) is discarded, and for monochrome data it is replicated across all three channels. TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed data, set the global variable 'stbi_write_tga_with_rle' to 0. CREDITS: PNG/BMP/TGA Sean Barrett HDR Baldur Karlsson TGA monochrome: Jean-Sebastien Guay misc enhancements: Tim Kelsey TGA RLE Alan Hickman initial file IO callback implementation Emmanuel Julien bugfixes: github:Chribba Guillaume Chereau github:jry2 github:romigrou Sergio Gonzalez Jonas Karlsson Filip Wasil Thatcher Ulrich LICENSE This software is dual-licensed to the public domain and under the following license: you are granted a perpetual, irrevocable license to copy, modify, publish, and distribute this file as you see fit. */ #ifndef INCLUDE_STB_IMAGE_WRITE_H #define INCLUDE_STB_IMAGE_WRITE_H #ifdef __cplusplus extern "C" { #endif #ifdef STB_IMAGE_WRITE_STATIC #define STBIWDEF static #else #define STBIWDEF extern extern int stbi_write_tga_with_rle; #endif #ifndef STBI_WRITE_NO_STDIO STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); #endif typedef void stbi_write_func(void *context, void *data, int size); STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); #ifdef __cplusplus } #endif #endif//INCLUDE_STB_IMAGE_WRITE_H #ifdef STB_IMAGE_WRITE_IMPLEMENTATION #ifdef _WIN32 #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #ifndef _CRT_NONSTDC_NO_DEPRECATE #define _CRT_NONSTDC_NO_DEPRECATE #endif #endif #ifndef STBI_WRITE_NO_STDIO #include #endif // STBI_WRITE_NO_STDIO #include #include #include #include #if defined(STBIW_MALLOC) && defined(STBIW_FREE) && (defined(STBIW_REALLOC) || defined(STBIW_REALLOC_SIZED)) // ok #elif !defined(STBIW_MALLOC) && !defined(STBIW_FREE) && !defined(STBIW_REALLOC) && !defined(STBIW_REALLOC_SIZED) // ok #else #error "Must define all or none of STBIW_MALLOC, STBIW_FREE, and STBIW_REALLOC (or STBIW_REALLOC_SIZED)." #endif #ifndef STBIW_MALLOC #define STBIW_MALLOC(sz) malloc(sz) #define STBIW_REALLOC(p,newsz) realloc(p,newsz) #define STBIW_FREE(p) free(p) #endif #ifndef STBIW_REALLOC_SIZED #define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz) #endif #ifndef STBIW_MEMMOVE #define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz) #endif #ifndef STBIW_ASSERT #include #define STBIW_ASSERT(x) assert(x) #endif #define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) typedef struct { stbi_write_func *func; void *context; } stbi__write_context; // initialize a callback-based context static void stbi__start_write_callbacks(stbi__write_context *s, stbi_write_func *c, void *context) { s->func = c; s->context = context; } #ifndef STBI_WRITE_NO_STDIO static void stbi__stdio_write(void *context, void *data, int size) { fwrite(data,1,size,(FILE*) context); } static int stbi__start_write_file(stbi__write_context *s, const char *filename) { FILE *f = fopen(filename, "wb"); stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f); return f != NULL; } static void stbi__end_write_file(stbi__write_context *s) { fclose((FILE *)s->context); } #endif // !STBI_WRITE_NO_STDIO typedef unsigned int stbiw_uint32; typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1]; #ifdef STB_IMAGE_WRITE_STATIC static int stbi_write_tga_with_rle = 1; #else int stbi_write_tga_with_rle = 1; #endif static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v) { while (*fmt) { switch (*fmt++) { case ' ': break; case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int)); s->func(s->context,&x,1); break; } case '2': { int x = va_arg(v,int); unsigned char b[2]; b[0] = STBIW_UCHAR(x); b[1] = STBIW_UCHAR(x>>8); s->func(s->context,b,2); break; } case '4': { stbiw_uint32 x = va_arg(v,int); unsigned char b[4]; b[0]=STBIW_UCHAR(x); b[1]=STBIW_UCHAR(x>>8); b[2]=STBIW_UCHAR(x>>16); b[3]=STBIW_UCHAR(x>>24); s->func(s->context,b,4); break; } default: STBIW_ASSERT(0); return; } } } static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) { va_list v; va_start(v, fmt); stbiw__writefv(s, fmt, v); va_end(v); } static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c) { unsigned char arr[3]; arr[0] = a, arr[1] = b, arr[2] = c; s->func(s->context, arr, 3); } static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d) { unsigned char bg[3] = { 255, 0, 255}, px[3]; int k; if (write_alpha < 0) s->func(s->context, &d[comp - 1], 1); switch (comp) { case 1: s->func(s->context,d,1); break; case 2: if (expand_mono) stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp else s->func(s->context, d, 1); // monochrome TGA break; case 4: if (!write_alpha) { // composite against pink background for (k = 0; k < 3; ++k) px[k] = bg[k] + ((d[k] - bg[k]) * d[3]) / 255; stbiw__write3(s, px[1 - rgb_dir], px[1], px[1 + rgb_dir]); break; } /* FALLTHROUGH */ case 3: stbiw__write3(s, d[1 - rgb_dir], d[1], d[1 + rgb_dir]); break; } if (write_alpha > 0) s->func(s->context, &d[comp - 1], 1); } static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono) { stbiw_uint32 zero = 0; int i,j, j_end; if (y <= 0) return; if (vdir < 0) j_end = -1, j = y-1; else j_end = y, j = 0; for (; j != j_end; j += vdir) { for (i=0; i < x; ++i) { unsigned char *d = (unsigned char *) data + (j*x+i)*comp; stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d); } s->func(s->context, &zero, scanline_pad); } } static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...) { if (y < 0 || x < 0) { return 0; } else { va_list v; va_start(v, fmt); stbiw__writefv(s, fmt, v); va_end(v); stbiw__write_pixels(s,rgb_dir,vdir,x,y,comp,data,alpha,pad, expand_mono); return 1; } } static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data) { int pad = (-x*3) & 3; return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, "11 4 22 4" "4 44 22 444444", 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header } STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) { stbi__write_context s; stbi__start_write_callbacks(&s, func, context); return stbi_write_bmp_core(&s, x, y, comp, data); } #ifndef STBI_WRITE_NO_STDIO STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data) { stbi__write_context s; if (stbi__start_write_file(&s,filename)) { int r = stbi_write_bmp_core(&s, x, y, comp, data); stbi__end_write_file(&s); return r; } else return 0; } #endif //!STBI_WRITE_NO_STDIO static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, void *data) { int has_alpha = (comp == 2 || comp == 4); int colorbytes = has_alpha ? comp-1 : comp; int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3 if (y < 0 || x < 0) return 0; if (!stbi_write_tga_with_rle) { return stbiw__outfile(s, -1, -1, x, y, comp, 0, (void *) data, has_alpha, 0, "111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8); } else { int i,j,k; stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8); for (j = y - 1; j >= 0; --j) { unsigned char *row = (unsigned char *) data + j * x * comp; int len; for (i = 0; i < x; i += len) { unsigned char *begin = row + i * comp; int diff = 1; len = 1; if (i < x - 1) { ++len; diff = memcmp(begin, row + (i + 1) * comp, comp); if (diff) { const unsigned char *prev = begin; for (k = i + 2; k < x && len < 128; ++k) { if (memcmp(prev, row + k * comp, comp)) { prev += comp; ++len; } else { --len; break; } } } else { for (k = i + 2; k < x && len < 128; ++k) { if (!memcmp(begin, row + k * comp, comp)) { ++len; } else { break; } } } } if (diff) { unsigned char header = STBIW_UCHAR(len - 1); s->func(s->context, &header, 1); for (k = 0; k < len; ++k) { stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp); } } else { unsigned char header = STBIW_UCHAR(len - 129); s->func(s->context, &header, 1); stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin); } } } } return 1; } int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) { stbi__write_context s; stbi__start_write_callbacks(&s, func, context); return stbi_write_tga_core(&s, x, y, comp, (void *) data); } #ifndef STBI_WRITE_NO_STDIO int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data) { stbi__write_context s; if (stbi__start_write_file(&s,filename)) { int r = stbi_write_tga_core(&s, x, y, comp, (void *) data); stbi__end_write_file(&s); return r; } else return 0; } #endif // ************************************************************************************************* // Radiance RGBE HDR writer // by Baldur Karlsson #ifndef STBI_WRITE_NO_STDIO #define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) { int exponent; float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); if (maxcomp < 1e-32f) { rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; } else { float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp; rgbe[0] = (unsigned char)(linear[0] * normalize); rgbe[1] = (unsigned char)(linear[1] * normalize); rgbe[2] = (unsigned char)(linear[2] * normalize); rgbe[3] = (unsigned char)(exponent + 128); } } void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) { unsigned char lengthbyte = STBIW_UCHAR(length+128); STBIW_ASSERT(length+128 <= 255); s->func(s->context, &lengthbyte, 1); s->func(s->context, &databyte, 1); } void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) { unsigned char lengthbyte = STBIW_UCHAR(length); STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code s->func(s->context, &lengthbyte, 1); s->func(s->context, data, length); } void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) { unsigned char scanlineheader[4] = { 2, 2, 0, 0 }; unsigned char rgbe[4]; float linear[3]; int x; scanlineheader[2] = (width&0xff00)>>8; scanlineheader[3] = (width&0x00ff); /* skip RLE for images too small or large */ if (width < 8 || width >= 32768) { for (x=0; x < width; x++) { switch (ncomp) { case 4: /* fallthrough */ case 3: linear[2] = scanline[x*ncomp + 2]; linear[1] = scanline[x*ncomp + 1]; linear[0] = scanline[x*ncomp + 0]; break; default: linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; break; } stbiw__linear_to_rgbe(rgbe, linear); s->func(s->context, rgbe, 4); } } else { int c,r; /* encode into scratch buffer */ for (x=0; x < width; x++) { switch(ncomp) { case 4: /* fallthrough */ case 3: linear[2] = scanline[x*ncomp + 2]; linear[1] = scanline[x*ncomp + 1]; linear[0] = scanline[x*ncomp + 0]; break; default: linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; break; } stbiw__linear_to_rgbe(rgbe, linear); scratch[x + width*0] = rgbe[0]; scratch[x + width*1] = rgbe[1]; scratch[x + width*2] = rgbe[2]; scratch[x + width*3] = rgbe[3]; } s->func(s->context, scanlineheader, 4); /* RLE each component separately */ for (c=0; c < 4; c++) { unsigned char *comp = &scratch[width*c]; x = 0; while (x < width) { // find first run r = x; while (r+2 < width) { if (comp[r] == comp[r+1] && comp[r] == comp[r+2]) break; ++r; } if (r+2 >= width) r = width; // dump up to first run while (x < r) { int len = r-x; if (len > 128) len = 128; stbiw__write_dump_data(s, len, &comp[x]); x += len; } // if there's a run, output it if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd // find next byte after run while (r < width && comp[r] == comp[x]) ++r; // output run up to r while (x < r) { int len = r-x; if (len > 127) len = 127; stbiw__write_run_data(s, len, comp[x]); x += len; } } } } } } static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data) { if (y <= 0 || x <= 0 || data == NULL) return 0; else { // Each component is stored separately. Allocate scratch space for full output scanline. unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4); int i, len; char buffer[128]; char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"; s->func(s->context, header, sizeof(header)-1); len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); s->func(s->context, buffer, len); for(i=0; i < y; i++) stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*i*x); STBIW_FREE(scratch); return 1; } } int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data) { stbi__write_context s; stbi__start_write_callbacks(&s, func, context); return stbi_write_hdr_core(&s, x, y, comp, (float *) data); } int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) { stbi__write_context s; if (stbi__start_write_file(&s,filename)) { int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data); stbi__end_write_file(&s); return r; } else return 0; } #endif // STBI_WRITE_NO_STDIO ////////////////////////////////////////////////////////////////////////////// // // PNG writer // // stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size() #define stbiw__sbraw(a) ((int *) (a) - 2) #define stbiw__sbm(a) stbiw__sbraw(a)[0] #define stbiw__sbn(a) stbiw__sbraw(a)[1] #define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a)) #define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0) #define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a))) #define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v)) #define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0) #define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0) static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) { int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); STBIW_ASSERT(p); if (p) { if (!*arr) ((int *) p)[1] = 0; *arr = (void *) ((int *) p + 2); stbiw__sbm(*arr) = m; } return *arr; } static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount) { while (*bitcount >= 8) { stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer)); *bitbuffer >>= 8; *bitcount -= 8; } return data; } static int stbiw__zlib_bitrev(int code, int codebits) { int res=0; while (codebits--) { res = (res << 1) | (code & 1); code >>= 1; } return res; } static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit) { int i; for (i=0; i < limit && i < 258; ++i) if (a[i] != b[i]) break; return i; } static unsigned int stbiw__zhash(unsigned char *data) { stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16); hash ^= hash << 3; hash += hash >> 5; hash ^= hash << 4; hash += hash >> 17; hash ^= hash << 25; hash += hash >> 6; return hash; } #define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount)) #define stbiw__zlib_add(code,codebits) \ (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush()) #define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c) // default huffman tables #define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8) #define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9) #define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7) #define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8) #define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n)) #define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n)) #define stbiw__ZHASH 16384 unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) { static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 }; static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 }; static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 }; unsigned int bitbuf=0; int i,j, bitcount=0; unsigned char *out = NULL; unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); if (quality < 5) quality = 5; stbiw__sbpush(out, 0x78); // DEFLATE 32K window stbiw__sbpush(out, 0x5e); // FLEVEL = 1 stbiw__zlib_add(1,1); // BFINAL = 1 stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman for (i=0; i < stbiw__ZHASH; ++i) hash_table[i] = NULL; i=0; while (i < data_len-3) { // hash next 3 bytes of data to be compressed int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3; unsigned char *bestloc = 0; unsigned char **hlist = hash_table[h]; int n = stbiw__sbcount(hlist); for (j=0; j < n; ++j) { if (hlist[j]-data > i-32768) { // if entry lies within window int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); if (d >= best) best=d,bestloc=hlist[j]; } } // when hash table entry is too long, delete half the entries if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) { STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality); stbiw__sbn(hash_table[h]) = quality; } stbiw__sbpush(hash_table[h],data+i); if (bestloc) { // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1); hlist = hash_table[h]; n = stbiw__sbcount(hlist); for (j=0; j < n; ++j) { if (hlist[j]-data > i-32767) { int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1); if (e > best) { // if next match is better, bail on current match bestloc = NULL; break; } } } } if (bestloc) { int d = (int) (data+i - bestloc); // distance back STBIW_ASSERT(d <= 32767 && best <= 258); for (j=0; best > lengthc[j+1]-1; ++j); stbiw__zlib_huff(j+257); if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]); for (j=0; d > distc[j+1]-1; ++j); stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5); if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]); i += best; } else { stbiw__zlib_huffb(data[i]); ++i; } } // write out final bytes for (;i < data_len; ++i) stbiw__zlib_huffb(data[i]); stbiw__zlib_huff(256); // end of block // pad with 0 bits to byte boundary while (bitcount) stbiw__zlib_add(0,1); for (i=0; i < stbiw__ZHASH; ++i) (void) stbiw__sbfree(hash_table[i]); STBIW_FREE(hash_table); { // compute adler32 on input unsigned int s1=1, s2=0; int blocklen = (int) (data_len % 5552); j=0; while (j < data_len) { for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1; s1 %= 65521, s2 %= 65521; j += blocklen; blocklen = 5552; } stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8)); stbiw__sbpush(out, STBIW_UCHAR(s2)); stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8)); stbiw__sbpush(out, STBIW_UCHAR(s1)); } *out_len = stbiw__sbn(out); // make returned pointer freeable STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len); return (unsigned char *) stbiw__sbraw(out); } static unsigned int stbiw__crc32(unsigned char *buffer, int len) { static unsigned int crc_table[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; unsigned int crc = ~0u; int i; for (i=0; i < len; ++i) crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; return ~crc; } #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4) #define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v)); #define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3]) static void stbiw__wpcrc(unsigned char **data, int len) { unsigned int crc = stbiw__crc32(*data - len - 4, len+4); stbiw__wp32(*data, crc); } static unsigned char stbiw__paeth(int a, int b, int c) { int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c); if (pa <= pb && pa <= pc) return STBIW_UCHAR(a); if (pb <= pc) return STBIW_UCHAR(b); return STBIW_UCHAR(c); } unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) { int ctype[5] = { -1, 0, 4, 2, 6 }; unsigned char sig[8] = { 137,80,78,71,13,10,26,10 }; unsigned char *out,*o, *filt, *zlib; signed char *line_buffer; int i,j,k,p,zlen; if (stride_bytes == 0) stride_bytes = x * n; filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0; line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; } for (j=0; j < y; ++j) { static int mapping[] = { 0,1,2,3,4 }; static int firstmap[] = { 0,1,0,5,6 }; int *mymap = j ? mapping : firstmap; int best = 0, bestval = 0x7fffffff; for (p=0; p < 2; ++p) { for (k= p?best:0; k < 5; ++k) { int type = mymap[k],est=0; unsigned char *z = pixels + stride_bytes*j; for (i=0; i < n; ++i) switch (type) { case 0: line_buffer[i] = z[i]; break; case 1: line_buffer[i] = z[i]; break; case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break; case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break; case 5: line_buffer[i] = z[i]; break; case 6: line_buffer[i] = z[i]; break; } for (i=n; i < x*n; ++i) { switch (type) { case 0: line_buffer[i] = z[i]; break; case 1: line_buffer[i] = z[i] - z[i-n]; break; case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break; case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break; case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break; case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; } } if (p) break; for (i=0; i < x*n; ++i) est += abs((signed char) line_buffer[i]); if (est < bestval) { bestval = est; best = k; } } } // when we get here, best contains the filter type, and line_buffer contains the data filt[j*(x*n+1)] = (unsigned char) best; STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n); } STBIW_FREE(line_buffer); zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory STBIW_FREE(filt); if (!zlib) return 0; // each tag requires 12 bytes of overhead out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12); if (!out) return 0; *out_len = 8 + 12+13 + 12+zlen + 12; o=out; STBIW_MEMMOVE(o,sig,8); o+= 8; stbiw__wp32(o, 13); // header length stbiw__wptag(o, "IHDR"); stbiw__wp32(o, x); stbiw__wp32(o, y); *o++ = 8; *o++ = STBIW_UCHAR(ctype[n]); *o++ = 0; *o++ = 0; *o++ = 0; stbiw__wpcrc(&o,13); stbiw__wp32(o, zlen); stbiw__wptag(o, "IDAT"); STBIW_MEMMOVE(o, zlib, zlen); o += zlen; STBIW_FREE(zlib); stbiw__wpcrc(&o, zlen); stbiw__wp32(o,0); stbiw__wptag(o, "IEND"); stbiw__wpcrc(&o,0); STBIW_ASSERT(o == out + *out_len); return out; } #ifndef STBI_WRITE_NO_STDIO STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes) { FILE *f; int len; unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); if (png == NULL) return 0; f = fopen(filename, "wb"); if (!f) { STBIW_FREE(png); return 0; } fwrite(png, 1, len, f); fclose(f); STBIW_FREE(png); return 1; } #endif STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes) { int len; unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); if (png == NULL) return 0; func(context, png, len); STBIW_FREE(png); return 1; } #endif // STB_IMAGE_WRITE_IMPLEMENTATION /* Revision history 1.02 (2016-04-02) avoid allocating large structures on the stack 1.01 (2016-01-16) STBIW_REALLOC_SIZED: support allocators with no realloc support avoid race-condition in crc initialization minor compile issues 1.00 (2015-09-14) installable file IO function 0.99 (2015-09-13) warning fixes; TGA rle support 0.98 (2015-04-08) added STBIW_MALLOC, STBIW_ASSERT etc 0.97 (2015-01-18) fixed HDR asserts, rewrote HDR rle logic 0.96 (2015-01-17) add HDR output fix monochrome BMP 0.95 (2014-08-17) add monochrome TGA output 0.94 (2014-05-31) rename private functions to avoid conflicts with stb_image.h 0.93 (2014-05-27) warning fixes 0.92 (2010-08-01) casts to unsigned char to fix warnings 0.91 (2010-07-17) first public release 0.90 first internal release */ goxel-0.8.1/ext_src/stb/stb_rect_pack.h000066400000000000000000000470561334742672700201040ustar00rootroot00000000000000// stb_rect_pack.h - v0.11 - public domain - rectangle packing // Sean Barrett 2014 // // Useful for e.g. packing rectangular textures into an atlas. // Does not do rotation. // // Not necessarily the awesomest packing method, but better than // the totally naive one in stb_truetype (which is primarily what // this is meant to replace). // // Has only had a few tests run, may have issues. // // More docs to come. // // No memory allocations; uses qsort() and assert() from stdlib. // Can override those by defining STBRP_SORT and STBRP_ASSERT. // // This library currently uses the Skyline Bottom-Left algorithm. // // Please note: better rectangle packers are welcome! Please // implement them to the same API, but with a different init // function. // // Credits // // Library // Sean Barrett // Minor features // Martins Mozeiko // github:IntellectualKitty // // Bugfixes / warning fixes // Jeremy Jaussaud // // Version history: // // 0.11 (2017-03-03) return packing success/fail result // 0.10 (2016-10-25) remove cast-away-const to avoid warnings // 0.09 (2016-08-27) fix compiler warnings // 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) // 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) // 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort // 0.05: added STBRP_ASSERT to allow replacing assert // 0.04: fixed minor bug in STBRP_LARGE_RECTS support // 0.01: initial release // // LICENSE // // See end of file for license information. ////////////////////////////////////////////////////////////////////////////// // // INCLUDE SECTION // #ifndef STB_INCLUDE_STB_RECT_PACK_H #define STB_INCLUDE_STB_RECT_PACK_H #define STB_RECT_PACK_VERSION 1 #ifdef STBRP_STATIC #define STBRP_DEF static #else #define STBRP_DEF extern #endif #ifdef __cplusplus extern "C" { #endif typedef struct stbrp_context stbrp_context; typedef struct stbrp_node stbrp_node; typedef struct stbrp_rect stbrp_rect; #ifdef STBRP_LARGE_RECTS typedef int stbrp_coord; #else typedef unsigned short stbrp_coord; #endif STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects); // Assign packed locations to rectangles. The rectangles are of type // 'stbrp_rect' defined below, stored in the array 'rects', and there // are 'num_rects' many of them. // // Rectangles which are successfully packed have the 'was_packed' flag // set to a non-zero value and 'x' and 'y' store the minimum location // on each axis (i.e. bottom-left in cartesian coordinates, top-left // if you imagine y increasing downwards). Rectangles which do not fit // have the 'was_packed' flag set to 0. // // You should not try to access the 'rects' array from another thread // while this function is running, as the function temporarily reorders // the array while it executes. // // To pack into another rectangle, you need to call stbrp_init_target // again. To continue packing into the same rectangle, you can call // this function again. Calling this multiple times with multiple rect // arrays will probably produce worse packing results than calling it // a single time with the full rectangle array, but the option is // available. // // The function returns 1 if all of the rectangles were successfully // packed and 0 otherwise. struct stbrp_rect { // reserved for your use: int id; // input: stbrp_coord w, h; // output: stbrp_coord x, y; int was_packed; // non-zero if valid packing }; // 16 bytes, nominally STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes); // Initialize a rectangle packer to: // pack a rectangle that is 'width' by 'height' in dimensions // using temporary storage provided by the array 'nodes', which is 'num_nodes' long // // You must call this function every time you start packing into a new target. // // There is no "shutdown" function. The 'nodes' memory must stay valid for // the following stbrp_pack_rects() call (or calls), but can be freed after // the call (or calls) finish. // // Note: to guarantee best results, either: // 1. make sure 'num_nodes' >= 'width' // or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' // // If you don't do either of the above things, widths will be quantized to multiples // of small integers to guarantee the algorithm doesn't run out of temporary storage. // // If you do #2, then the non-quantized algorithm will be used, but the algorithm // may run out of temporary storage and be unable to pack some rectangles. STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem); // Optionally call this function after init but before doing any packing to // change the handling of the out-of-temp-memory scenario, described above. // If you call init again, this will be reset to the default (false). STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic); // Optionally select which packing heuristic the library should use. Different // heuristics will produce better/worse results for different data sets. // If you call init again, this will be reset to the default. enum { STBRP_HEURISTIC_Skyline_default=0, STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, STBRP_HEURISTIC_Skyline_BF_sortHeight }; ////////////////////////////////////////////////////////////////////////////// // // the details of the following structures don't matter to you, but they must // be visible so you can handle the memory allocations for them struct stbrp_node { stbrp_coord x,y; stbrp_node *next; }; struct stbrp_context { int width; int height; int align; int init_mode; int heuristic; int num_nodes; stbrp_node *active_head; stbrp_node *free_head; stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' }; #ifdef __cplusplus } #endif #endif ////////////////////////////////////////////////////////////////////////////// // // IMPLEMENTATION SECTION // #ifdef STB_RECT_PACK_IMPLEMENTATION #ifndef STBRP_SORT #include #define STBRP_SORT qsort #endif #ifndef STBRP_ASSERT #include #define STBRP_ASSERT assert #endif #ifdef _MSC_VER #define STBRP__NOTUSED(v) (void)(v) #define STBRP__CDECL __cdecl #else #define STBRP__NOTUSED(v) (void)sizeof(v) #define STBRP__CDECL #endif enum { STBRP__INIT_skyline = 1 }; STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic) { switch (context->init_mode) { case STBRP__INIT_skyline: STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight); context->heuristic = heuristic; break; default: STBRP_ASSERT(0); } } STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem) { if (allow_out_of_mem) // if it's ok to run out of memory, then don't bother aligning them; // this gives better packing, but may fail due to OOM (even though // the rectangles easily fit). @TODO a smarter approach would be to only // quantize once we've hit OOM, then we could get rid of this parameter. context->align = 1; else { // if it's not ok to run out of memory, then quantize the widths // so that num_nodes is always enough nodes. // // I.e. num_nodes * align >= width // align >= width / num_nodes // align = ceil(width/num_nodes) context->align = (context->width + context->num_nodes-1) / context->num_nodes; } } STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes) { int i; #ifndef STBRP_LARGE_RECTS STBRP_ASSERT(width <= 0xffff && height <= 0xffff); #endif for (i=0; i < num_nodes-1; ++i) nodes[i].next = &nodes[i+1]; nodes[i].next = NULL; context->init_mode = STBRP__INIT_skyline; context->heuristic = STBRP_HEURISTIC_Skyline_default; context->free_head = &nodes[0]; context->active_head = &context->extra[0]; context->width = width; context->height = height; context->num_nodes = num_nodes; stbrp_setup_allow_out_of_mem(context, 0); // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) context->extra[0].x = 0; context->extra[0].y = 0; context->extra[0].next = &context->extra[1]; context->extra[1].x = (stbrp_coord) width; #ifdef STBRP_LARGE_RECTS context->extra[1].y = (1<<30); #else context->extra[1].y = 65535; #endif context->extra[1].next = NULL; } // find minimum y position if it starts at x1 static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste) { stbrp_node *node = first; int x1 = x0 + width; int min_y, visited_width, waste_area; STBRP__NOTUSED(c); STBRP_ASSERT(first->x <= x0); #if 0 // skip in case we're past the node while (node->next->x <= x0) ++node; #else STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency #endif STBRP_ASSERT(node->x <= x0); min_y = 0; waste_area = 0; visited_width = 0; while (node->x < x1) { if (node->y > min_y) { // raise min_y higher. // we've accounted for all waste up to min_y, // but we'll now add more waste for everything we've visted waste_area += visited_width * (node->y - min_y); min_y = node->y; // the first time through, visited_width might be reduced if (node->x < x0) visited_width += node->next->x - x0; else visited_width += node->next->x - node->x; } else { // add waste area int under_width = node->next->x - node->x; if (under_width + visited_width > width) under_width = width - visited_width; waste_area += under_width * (min_y - node->y); visited_width += under_width; } node = node->next; } *pwaste = waste_area; return min_y; } typedef struct { int x,y; stbrp_node **prev_link; } stbrp__findresult; static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height) { int best_waste = (1<<30), best_x, best_y = (1 << 30); stbrp__findresult fr; stbrp_node **prev, *node, *tail, **best = NULL; // align to multiple of c->align width = (width + c->align - 1); width -= width % c->align; STBRP_ASSERT(width % c->align == 0); node = c->active_head; prev = &c->active_head; while (node->x + width <= c->width) { int y,waste; y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste); if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL // bottom left if (y < best_y) { best_y = y; best = prev; } } else { // best-fit if (y + height <= c->height) { // can only use it if it first vertically if (y < best_y || (y == best_y && waste < best_waste)) { best_y = y; best_waste = waste; best = prev; } } } prev = &node->next; node = node->next; } best_x = (best == NULL) ? 0 : (*best)->x; // if doing best-fit (BF), we also have to try aligning right edge to each node position // // e.g, if fitting // // ____________________ // |____________________| // // into // // | | // | ____________| // |____________| // // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned // // This makes BF take about 2x the time if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) { tail = c->active_head; node = c->active_head; prev = &c->active_head; // find first node that's admissible while (tail->x < width) tail = tail->next; while (tail) { int xpos = tail->x - width; int y,waste; STBRP_ASSERT(xpos >= 0); // find the left position that matches this while (node->next->x <= xpos) { prev = &node->next; node = node->next; } STBRP_ASSERT(node->next->x > xpos && node->x <= xpos); y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste); if (y + height < c->height) { if (y <= best_y) { if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) { best_x = xpos; STBRP_ASSERT(y <= best_y); best_y = y; best_waste = waste; best = prev; } } } tail = tail->next; } } fr.prev_link = best; fr.x = best_x; fr.y = best_y; return fr; } static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height) { // find best position according to heuristic stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height); stbrp_node *node, *cur; // bail if: // 1. it failed // 2. the best node doesn't fit (we don't always check this) // 3. we're out of memory if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) { res.prev_link = NULL; return res; } // on success, create new node node = context->free_head; node->x = (stbrp_coord) res.x; node->y = (stbrp_coord) (res.y + height); context->free_head = node->next; // insert the new node into the right starting point, and // let 'cur' point to the remaining nodes needing to be // stiched back in cur = *res.prev_link; if (cur->x < res.x) { // preserve the existing one, so start testing with the next one stbrp_node *next = cur->next; cur->next = node; cur = next; } else { *res.prev_link = node; } // from here, traverse cur and free the nodes, until we get to one // that shouldn't be freed while (cur->next && cur->next->x <= res.x + width) { stbrp_node *next = cur->next; // move the current node to the free list cur->next = context->free_head; context->free_head = cur; cur = next; } // stitch the list back in node->next = cur; if (cur->x < res.x + width) cur->x = (stbrp_coord) (res.x + width); #ifdef _DEBUG cur = context->active_head; while (cur->x < context->width) { STBRP_ASSERT(cur->x < cur->next->x); cur = cur->next; } STBRP_ASSERT(cur->next == NULL); { int count=0; cur = context->active_head; while (cur) { cur = cur->next; ++count; } cur = context->free_head; while (cur) { cur = cur->next; ++count; } STBRP_ASSERT(count == context->num_nodes+2); } #endif return res; } static int STBRP__CDECL rect_height_compare(const void *a, const void *b) { const stbrp_rect *p = (const stbrp_rect *) a; const stbrp_rect *q = (const stbrp_rect *) b; if (p->h > q->h) return -1; if (p->h < q->h) return 1; return (p->w > q->w) ? -1 : (p->w < q->w); } static int STBRP__CDECL rect_original_order(const void *a, const void *b) { const stbrp_rect *p = (const stbrp_rect *) a; const stbrp_rect *q = (const stbrp_rect *) b; return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); } #ifdef STBRP_LARGE_RECTS #define STBRP__MAXVAL 0xffffffff #else #define STBRP__MAXVAL 0xffff #endif STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects) { int i, all_rects_packed = 1; // we use the 'was_packed' field internally to allow sorting/unsorting for (i=0; i < num_rects; ++i) { rects[i].was_packed = i; #ifndef STBRP_LARGE_RECTS STBRP_ASSERT(rects[i].w <= 0xffff && rects[i].h <= 0xffff); #endif } // sort according to heuristic STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare); for (i=0; i < num_rects; ++i) { if (rects[i].w == 0 || rects[i].h == 0) { rects[i].x = rects[i].y = 0; // empty rect needs no space } else { stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); if (fr.prev_link) { rects[i].x = (stbrp_coord) fr.x; rects[i].y = (stbrp_coord) fr.y; } else { rects[i].x = rects[i].y = STBRP__MAXVAL; } } } // unsort STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order); // set was_packed flags and all_rects_packed status for (i=0; i < num_rects; ++i) { rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL); if (!rects[i].was_packed) all_rects_packed = 0; } // return the all_rects_packed status return all_rects_packed; } #endif /* ------------------------------------------------------------------------------ This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------ ALTERNATIVE A - MIT License Copyright (c) 2017 Sean Barrett 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ ALTERNATIVE B - Public Domain (www.unlicense.org) This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ goxel-0.8.1/ext_src/stb/stb_textedit.h000066400000000000000000001377061334742672700200050ustar00rootroot00000000000000// [ImGui] this is a slightly modified version of stb_truetype.h 1.9. Those changes would need to be pushed into nothings/sb // [ImGui] - fixed linestart handler when over last character of multi-line buffer + simplified existing code (#588, #815) // [ImGui] - fixed a state corruption/crash bug in stb_text_redo and stb_textedit_discard_redo (#715) // [ImGui] - fixed a crash bug in stb_textedit_discard_redo (#681) // [ImGui] - fixed some minor warnings // stb_textedit.h - v1.9 - public domain - Sean Barrett // Development of this library was sponsored by RAD Game Tools // // This C header file implements the guts of a multi-line text-editing // widget; you implement display, word-wrapping, and low-level string // insertion/deletion, and stb_textedit will map user inputs into // insertions & deletions, plus updates to the cursor position, // selection state, and undo state. // // It is intended for use in games and other systems that need to build // their own custom widgets and which do not have heavy text-editing // requirements (this library is not recommended for use for editing large // texts, as its performance does not scale and it has limited undo). // // Non-trivial behaviors are modelled after Windows text controls. // // // LICENSE // // This software is dual-licensed to the public domain and under the following // license: you are granted a perpetual, irrevocable license to copy, modify, // publish, and distribute this file as you see fit. // // // DEPENDENCIES // // Uses the C runtime function 'memmove', which you can override // by defining STB_TEXTEDIT_memmove before the implementation. // Uses no other functions. Performs no runtime allocations. // // // VERSION HISTORY // // 1.9 (2016-08-27) customizable move-by-word // 1.8 (2016-04-02) better keyboard handling when mouse button is down // 1.7 (2015-09-13) change y range handling in case baseline is non-0 // 1.6 (2015-04-15) allow STB_TEXTEDIT_memmove // 1.5 (2014-09-10) add support for secondary keys for OS X // 1.4 (2014-08-17) fix signed/unsigned warnings // 1.3 (2014-06-19) fix mouse clicking to round to nearest char boundary // 1.2 (2014-05-27) fix some RAD types that had crept into the new code // 1.1 (2013-12-15) move-by-word (requires STB_TEXTEDIT_IS_SPACE ) // 1.0 (2012-07-26) improve documentation, initial public release // 0.3 (2012-02-24) bugfixes, single-line mode; insert mode // 0.2 (2011-11-28) fixes to undo/redo // 0.1 (2010-07-08) initial version // // ADDITIONAL CONTRIBUTORS // // Ulf Winklemann: move-by-word in 1.1 // Fabian Giesen: secondary key inputs in 1.5 // Martins Mozeiko: STB_TEXTEDIT_memmove // // Bugfixes: // Scott Graham // Daniel Keller // Omar Cornut // // USAGE // // This file behaves differently depending on what symbols you define // before including it. // // // Header-file mode: // // If you do not define STB_TEXTEDIT_IMPLEMENTATION before including this, // it will operate in "header file" mode. In this mode, it declares a // single public symbol, STB_TexteditState, which encapsulates the current // state of a text widget (except for the string, which you will store // separately). // // To compile in this mode, you must define STB_TEXTEDIT_CHARTYPE to a // primitive type that defines a single character (e.g. char, wchar_t, etc). // // To save space or increase undo-ability, you can optionally define the // following things that are used by the undo system: // // STB_TEXTEDIT_POSITIONTYPE small int type encoding a valid cursor position // STB_TEXTEDIT_UNDOSTATECOUNT the number of undo states to allow // STB_TEXTEDIT_UNDOCHARCOUNT the number of characters to store in the undo buffer // // If you don't define these, they are set to permissive types and // moderate sizes. The undo system does no memory allocations, so // it grows STB_TexteditState by the worst-case storage which is (in bytes): // // [4 + sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATE_COUNT // + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHAR_COUNT // // // Implementation mode: // // If you define STB_TEXTEDIT_IMPLEMENTATION before including this, it // will compile the implementation of the text edit widget, depending // on a large number of symbols which must be defined before the include. // // The implementation is defined only as static functions. You will then // need to provide your own APIs in the same file which will access the // static functions. // // The basic concept is that you provide a "string" object which // behaves like an array of characters. stb_textedit uses indices to // refer to positions in the string, implicitly representing positions // in the displayed textedit. This is true for both plain text and // rich text; even with rich text stb_truetype interacts with your // code as if there was an array of all the displayed characters. // // Symbols that must be the same in header-file and implementation mode: // // STB_TEXTEDIT_CHARTYPE the character type // STB_TEXTEDIT_POSITIONTYPE small type that a valid cursor position // STB_TEXTEDIT_UNDOSTATECOUNT the number of undo states to allow // STB_TEXTEDIT_UNDOCHARCOUNT the number of characters to store in the undo buffer // // Symbols you must define for implementation mode: // // STB_TEXTEDIT_STRING the type of object representing a string being edited, // typically this is a wrapper object with other data you need // // STB_TEXTEDIT_STRINGLEN(obj) the length of the string (ideally O(1)) // STB_TEXTEDIT_LAYOUTROW(&r,obj,n) returns the results of laying out a line of characters // starting from character #n (see discussion below) // STB_TEXTEDIT_GETWIDTH(obj,n,i) returns the pixel delta from the xpos of the i'th character // to the xpos of the i+1'th char for a line of characters // starting at character #n (i.e. accounts for kerning // with previous char) // STB_TEXTEDIT_KEYTOTEXT(k) maps a keyboard input to an insertable character // (return type is int, -1 means not valid to insert) // STB_TEXTEDIT_GETCHAR(obj,i) returns the i'th character of obj, 0-based // STB_TEXTEDIT_NEWLINE the character returned by _GETCHAR() we recognize // as manually wordwrapping for end-of-line positioning // // STB_TEXTEDIT_DELETECHARS(obj,i,n) delete n characters starting at i // STB_TEXTEDIT_INSERTCHARS(obj,i,c*,n) insert n characters at i (pointed to by STB_TEXTEDIT_CHARTYPE*) // // STB_TEXTEDIT_K_SHIFT a power of two that is or'd in to a keyboard input to represent the shift key // // STB_TEXTEDIT_K_LEFT keyboard input to move cursor left // STB_TEXTEDIT_K_RIGHT keyboard input to move cursor right // STB_TEXTEDIT_K_UP keyboard input to move cursor up // STB_TEXTEDIT_K_DOWN keyboard input to move cursor down // STB_TEXTEDIT_K_LINESTART keyboard input to move cursor to start of line // e.g. HOME // STB_TEXTEDIT_K_LINEEND keyboard input to move cursor to end of line // e.g. END // STB_TEXTEDIT_K_TEXTSTART keyboard input to move cursor to start of text // e.g. ctrl-HOME // STB_TEXTEDIT_K_TEXTEND keyboard input to move cursor to end of text // e.g. ctrl-END // STB_TEXTEDIT_K_DELETE keyboard input to delete selection or character under cursor // STB_TEXTEDIT_K_BACKSPACE keyboard input to delete selection or character left of cursor // STB_TEXTEDIT_K_UNDO keyboard input to perform undo // STB_TEXTEDIT_K_REDO keyboard input to perform redo // // Optional: // STB_TEXTEDIT_K_INSERT keyboard input to toggle insert mode // STB_TEXTEDIT_IS_SPACE(ch) true if character is whitespace (e.g. 'isspace'), // required for default WORDLEFT/WORDRIGHT handlers // STB_TEXTEDIT_MOVEWORDLEFT(obj,i) custom handler for WORDLEFT, returns index to move cursor to // STB_TEXTEDIT_MOVEWORDRIGHT(obj,i) custom handler for WORDRIGHT, returns index to move cursor to // STB_TEXTEDIT_K_WORDLEFT keyboard input to move cursor left one word // e.g. ctrl-LEFT // STB_TEXTEDIT_K_WORDRIGHT keyboard input to move cursor right one word // e.g. ctrl-RIGHT // STB_TEXTEDIT_K_LINESTART2 secondary keyboard input to move cursor to start of line // STB_TEXTEDIT_K_LINEEND2 secondary keyboard input to move cursor to end of line // STB_TEXTEDIT_K_TEXTSTART2 secondary keyboard input to move cursor to start of text // STB_TEXTEDIT_K_TEXTEND2 secondary keyboard input to move cursor to end of text // // Todo: // STB_TEXTEDIT_K_PGUP keyboard input to move cursor up a page // STB_TEXTEDIT_K_PGDOWN keyboard input to move cursor down a page // // Keyboard input must be encoded as a single integer value; e.g. a character code // and some bitflags that represent shift states. to simplify the interface, SHIFT must // be a bitflag, so we can test the shifted state of cursor movements to allow selection, // i.e. (STB_TEXTED_K_RIGHT|STB_TEXTEDIT_K_SHIFT) should be shifted right-arrow. // // You can encode other things, such as CONTROL or ALT, in additional bits, and // then test for their presence in e.g. STB_TEXTEDIT_K_WORDLEFT. For example, // my Windows implementations add an additional CONTROL bit, and an additional KEYDOWN // bit. Then all of the STB_TEXTEDIT_K_ values bitwise-or in the KEYDOWN bit, // and I pass both WM_KEYDOWN and WM_CHAR events to the "key" function in the // API below. The control keys will only match WM_KEYDOWN events because of the // keydown bit I add, and STB_TEXTEDIT_KEYTOTEXT only tests for the KEYDOWN // bit so it only decodes WM_CHAR events. // // STB_TEXTEDIT_LAYOUTROW returns information about the shape of one displayed // row of characters assuming they start on the i'th character--the width and // the height and the number of characters consumed. This allows this library // to traverse the entire layout incrementally. You need to compute word-wrapping // here. // // Each textfield keeps its own insert mode state, which is not how normal // applications work. To keep an app-wide insert mode, update/copy the // "insert_mode" field of STB_TexteditState before/after calling API functions. // // API // // void stb_textedit_initialize_state(STB_TexteditState *state, int is_single_line) // // void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) // void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) // int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) // int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len) // void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int key) // // Each of these functions potentially updates the string and updates the // state. // // initialize_state: // set the textedit state to a known good default state when initially // constructing the textedit. // // click: // call this with the mouse x,y on a mouse down; it will update the cursor // and reset the selection start/end to the cursor point. the x,y must // be relative to the text widget, with (0,0) being the top left. // // drag: // call this with the mouse x,y on a mouse drag/up; it will update the // cursor and the selection end point // // cut: // call this to delete the current selection; returns true if there was // one. you should FIRST copy the current selection to the system paste buffer. // (To copy, just copy the current selection out of the string yourself.) // // paste: // call this to paste text at the current cursor point or over the current // selection if there is one. // // key: // call this for keyboard inputs sent to the textfield. you can use it // for "key down" events or for "translated" key events. if you need to // do both (as in Win32), or distinguish Unicode characters from control // inputs, set a high bit to distinguish the two; then you can define the // various definitions like STB_TEXTEDIT_K_LEFT have the is-key-event bit // set, and make STB_TEXTEDIT_KEYTOCHAR check that the is-key-event bit is // clear. // // When rendering, you can read the cursor position and selection state from // the STB_TexteditState. // // // Notes: // // This is designed to be usable in IMGUI, so it allows for the possibility of // running in an IMGUI that has NOT cached the multi-line layout. For this // reason, it provides an interface that is compatible with computing the // layout incrementally--we try to make sure we make as few passes through // as possible. (For example, to locate the mouse pointer in the text, we // could define functions that return the X and Y positions of characters // and binary search Y and then X, but if we're doing dynamic layout this // will run the layout algorithm many times, so instead we manually search // forward in one pass. Similar logic applies to e.g. up-arrow and // down-arrow movement.) // // If it's run in a widget that *has* cached the layout, then this is less // efficient, but it's not horrible on modern computers. But you wouldn't // want to edit million-line files with it. //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //// //// Header-file mode //// //// #ifndef INCLUDE_STB_TEXTEDIT_H #define INCLUDE_STB_TEXTEDIT_H //////////////////////////////////////////////////////////////////////// // // STB_TexteditState // // Definition of STB_TexteditState which you should store // per-textfield; it includes cursor position, selection state, // and undo state. // #ifndef STB_TEXTEDIT_UNDOSTATECOUNT #define STB_TEXTEDIT_UNDOSTATECOUNT 99 #endif #ifndef STB_TEXTEDIT_UNDOCHARCOUNT #define STB_TEXTEDIT_UNDOCHARCOUNT 999 #endif #ifndef STB_TEXTEDIT_CHARTYPE #define STB_TEXTEDIT_CHARTYPE int #endif #ifndef STB_TEXTEDIT_POSITIONTYPE #define STB_TEXTEDIT_POSITIONTYPE int #endif typedef struct { // private data STB_TEXTEDIT_POSITIONTYPE where; short insert_length; short delete_length; short char_storage; } StbUndoRecord; typedef struct { // private data StbUndoRecord undo_rec [STB_TEXTEDIT_UNDOSTATECOUNT]; STB_TEXTEDIT_CHARTYPE undo_char[STB_TEXTEDIT_UNDOCHARCOUNT]; short undo_point, redo_point; short undo_char_point, redo_char_point; } StbUndoState; typedef struct { ///////////////////// // // public data // int cursor; // position of the text cursor within the string int select_start; // selection start point int select_end; // selection start and end point in characters; if equal, no selection. // note that start may be less than or greater than end (e.g. when // dragging the mouse, start is where the initial click was, and you // can drag in either direction) unsigned char insert_mode; // each textfield keeps its own insert mode state. to keep an app-wide // insert mode, copy this value in/out of the app state ///////////////////// // // private data // unsigned char cursor_at_end_of_line; // not implemented yet unsigned char initialized; unsigned char has_preferred_x; unsigned char single_line; unsigned char padding1, padding2, padding3; float preferred_x; // this determines where the cursor up/down tries to seek to along x StbUndoState undostate; } STB_TexteditState; //////////////////////////////////////////////////////////////////////// // // StbTexteditRow // // Result of layout query, used by stb_textedit to determine where // the text in each row is. // result of layout query typedef struct { float x0,x1; // starting x location, end x location (allows for align=right, etc) float baseline_y_delta; // position of baseline relative to previous row's baseline float ymin,ymax; // height of row above and below baseline int num_chars; } StbTexteditRow; #endif //INCLUDE_STB_TEXTEDIT_H //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //// //// Implementation mode //// //// // implementation isn't include-guarded, since it might have indirectly // included just the "header" portion #ifdef STB_TEXTEDIT_IMPLEMENTATION #ifndef STB_TEXTEDIT_memmove #include #define STB_TEXTEDIT_memmove memmove #endif ///////////////////////////////////////////////////////////////////////////// // // Mouse input handling // // traverse the layout to locate the nearest character to a display position static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, float y) { StbTexteditRow r; int n = STB_TEXTEDIT_STRINGLEN(str); float base_y = 0, prev_x; int i=0, k; r.x0 = r.x1 = 0; r.ymin = r.ymax = 0; r.num_chars = 0; // search rows to find one that straddles 'y' while (i < n) { STB_TEXTEDIT_LAYOUTROW(&r, str, i); if (r.num_chars <= 0) return n; if (i==0 && y < base_y + r.ymin) return 0; if (y < base_y + r.ymax) break; i += r.num_chars; base_y += r.baseline_y_delta; } // below all text, return 'after' last character if (i >= n) return n; // check if it's before the beginning of the line if (x < r.x0) return i; // check if it's before the end of the line if (x < r.x1) { // search characters in row for one that straddles 'x' prev_x = r.x0; for (k=0; k < r.num_chars; ++k) { float w = STB_TEXTEDIT_GETWIDTH(str, i, k); if (x < prev_x+w) { if (x < prev_x+w/2) return k+i; else return k+i+1; } prev_x += w; } // shouldn't happen, but if it does, fall through to end-of-line case } // if the last character is a newline, return that. otherwise return 'after' the last character if (STB_TEXTEDIT_GETCHAR(str, i+r.num_chars-1) == STB_TEXTEDIT_NEWLINE) return i+r.num_chars-1; else return i+r.num_chars; } // API click: on mouse down, move the cursor to the clicked location, and reset the selection static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) { state->cursor = stb_text_locate_coord(str, x, y); state->select_start = state->cursor; state->select_end = state->cursor; state->has_preferred_x = 0; } // API drag: on mouse drag, move the cursor and selection endpoint to the clicked location static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, float x, float y) { int p = stb_text_locate_coord(str, x, y); if (state->select_start == state->select_end) state->select_start = state->cursor; state->cursor = state->select_end = p; } ///////////////////////////////////////////////////////////////////////////// // // Keyboard input handling // // forward declarations static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state); static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state); static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length); static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int length); static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length); typedef struct { float x,y; // position of n'th character float height; // height of line int first_char, length; // first char of row, and length int prev_first; // first char of previous row } StbFindState; // find the x/y location of a character, and remember info about the previous row in // case we get a move-up event (for page up, we'll have to rescan) static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *str, int n, int single_line) { StbTexteditRow r; int prev_start = 0; int z = STB_TEXTEDIT_STRINGLEN(str); int i=0, first; if (n == z) { // if it's at the end, then find the last line -- simpler than trying to // explicitly handle this case in the regular code if (single_line) { STB_TEXTEDIT_LAYOUTROW(&r, str, 0); find->y = 0; find->first_char = 0; find->length = z; find->height = r.ymax - r.ymin; find->x = r.x1; } else { find->y = 0; find->x = 0; find->height = 1; while (i < z) { STB_TEXTEDIT_LAYOUTROW(&r, str, i); prev_start = i; i += r.num_chars; } find->first_char = i; find->length = 0; find->prev_first = prev_start; } return; } // search rows to find the one that straddles character n find->y = 0; for(;;) { STB_TEXTEDIT_LAYOUTROW(&r, str, i); if (n < i + r.num_chars) break; prev_start = i; i += r.num_chars; find->y += r.baseline_y_delta; } find->first_char = first = i; find->length = r.num_chars; find->height = r.ymax - r.ymin; find->prev_first = prev_start; // now scan to find xpos find->x = r.x0; i = 0; for (i=0; first+i < n; ++i) find->x += STB_TEXTEDIT_GETWIDTH(str, first, i); } #define STB_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end) // make the selection/cursor state valid if client altered the string static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) { int n = STB_TEXTEDIT_STRINGLEN(str); if (STB_TEXT_HAS_SELECTION(state)) { if (state->select_start > n) state->select_start = n; if (state->select_end > n) state->select_end = n; // if clamping forced them to be equal, move the cursor to match if (state->select_start == state->select_end) state->cursor = state->select_start; } if (state->cursor > n) state->cursor = n; } // delete characters while updating undo static void stb_textedit_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int len) { stb_text_makeundo_delete(str, state, where, len); STB_TEXTEDIT_DELETECHARS(str, where, len); state->has_preferred_x = 0; } // delete the section static void stb_textedit_delete_selection(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) { stb_textedit_clamp(str, state); if (STB_TEXT_HAS_SELECTION(state)) { if (state->select_start < state->select_end) { stb_textedit_delete(str, state, state->select_start, state->select_end - state->select_start); state->select_end = state->cursor = state->select_start; } else { stb_textedit_delete(str, state, state->select_end, state->select_start - state->select_end); state->select_start = state->cursor = state->select_end; } state->has_preferred_x = 0; } } // canoncialize the selection so start <= end static void stb_textedit_sortselection(STB_TexteditState *state) { if (state->select_end < state->select_start) { int temp = state->select_end; state->select_end = state->select_start; state->select_start = temp; } } // move cursor to first character of selection static void stb_textedit_move_to_first(STB_TexteditState *state) { if (STB_TEXT_HAS_SELECTION(state)) { stb_textedit_sortselection(state); state->cursor = state->select_start; state->select_end = state->select_start; state->has_preferred_x = 0; } } // move cursor to last character of selection static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) { if (STB_TEXT_HAS_SELECTION(state)) { stb_textedit_sortselection(state); stb_textedit_clamp(str, state); state->cursor = state->select_end; state->select_start = state->select_end; state->has_preferred_x = 0; } } #ifdef STB_TEXTEDIT_IS_SPACE static int is_word_boundary( STB_TEXTEDIT_STRING *str, int idx ) { return idx > 0 ? (STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str,idx-1) ) && !STB_TEXTEDIT_IS_SPACE( STB_TEXTEDIT_GETCHAR(str, idx) ) ) : 1; } #ifndef STB_TEXTEDIT_MOVEWORDLEFT static int stb_textedit_move_to_word_previous( STB_TEXTEDIT_STRING *str, int c ) { --c; // always move at least one character while( c >= 0 && !is_word_boundary( str, c ) ) --c; if( c < 0 ) c = 0; return c; } #define STB_TEXTEDIT_MOVEWORDLEFT stb_textedit_move_to_word_previous #endif #ifndef STB_TEXTEDIT_MOVEWORDRIGHT static int stb_textedit_move_to_word_next( STB_TEXTEDIT_STRING *str, int c ) { const int len = STB_TEXTEDIT_STRINGLEN(str); ++c; // always move at least one character while( c < len && !is_word_boundary( str, c ) ) ++c; if( c > len ) c = len; return c; } #define STB_TEXTEDIT_MOVEWORDRIGHT stb_textedit_move_to_word_next #endif #endif // update selection and cursor to match each other static void stb_textedit_prep_selection_at_cursor(STB_TexteditState *state) { if (!STB_TEXT_HAS_SELECTION(state)) state->select_start = state->select_end = state->cursor; else state->cursor = state->select_end; } // API cut: delete selection static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) { if (STB_TEXT_HAS_SELECTION(state)) { stb_textedit_delete_selection(str,state); // implicity clamps state->has_preferred_x = 0; return 1; } return 0; } // API paste: replace existing selection with passed-in text static int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE const *text, int len) { // if there's a selection, the paste should delete it stb_textedit_clamp(str, state); stb_textedit_delete_selection(str,state); // try to insert the characters if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, len)) { stb_text_makeundo_insert(state, state->cursor, len); state->cursor += len; state->has_preferred_x = 0; return 1; } // remove the undo since we didn't actually insert the characters if (state->undostate.undo_point) --state->undostate.undo_point; return 0; } // API key: process a keyboard input static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int key) { retry: switch (key) { default: { int c = STB_TEXTEDIT_KEYTOTEXT(key); if (c > 0) { STB_TEXTEDIT_CHARTYPE ch = (STB_TEXTEDIT_CHARTYPE) c; // can't add newline in single-line mode if (c == '\n' && state->single_line) break; if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) { stb_text_makeundo_replace(str, state, state->cursor, 1, 1); STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1); if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) { ++state->cursor; state->has_preferred_x = 0; } } else { stb_textedit_delete_selection(str,state); // implicity clamps if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) { stb_text_makeundo_insert(state, state->cursor, 1); ++state->cursor; state->has_preferred_x = 0; } } } break; } #ifdef STB_TEXTEDIT_K_INSERT case STB_TEXTEDIT_K_INSERT: state->insert_mode = !state->insert_mode; break; #endif case STB_TEXTEDIT_K_UNDO: stb_text_undo(str, state); state->has_preferred_x = 0; break; case STB_TEXTEDIT_K_REDO: stb_text_redo(str, state); state->has_preferred_x = 0; break; case STB_TEXTEDIT_K_LEFT: // if currently there's a selection, move cursor to start of selection if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_first(state); else if (state->cursor > 0) --state->cursor; state->has_preferred_x = 0; break; case STB_TEXTEDIT_K_RIGHT: // if currently there's a selection, move cursor to end of selection if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_last(str, state); else ++state->cursor; stb_textedit_clamp(str, state); state->has_preferred_x = 0; break; case STB_TEXTEDIT_K_LEFT | STB_TEXTEDIT_K_SHIFT: stb_textedit_clamp(str, state); stb_textedit_prep_selection_at_cursor(state); // move selection left if (state->select_end > 0) --state->select_end; state->cursor = state->select_end; state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_MOVEWORDLEFT case STB_TEXTEDIT_K_WORDLEFT: if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_first(state); else { state->cursor = STB_TEXTEDIT_MOVEWORDLEFT(str, state->cursor); stb_textedit_clamp( str, state ); } break; case STB_TEXTEDIT_K_WORDLEFT | STB_TEXTEDIT_K_SHIFT: if( !STB_TEXT_HAS_SELECTION( state ) ) stb_textedit_prep_selection_at_cursor(state); state->cursor = STB_TEXTEDIT_MOVEWORDLEFT(str, state->cursor); state->select_end = state->cursor; stb_textedit_clamp( str, state ); break; #endif #ifdef STB_TEXTEDIT_MOVEWORDRIGHT case STB_TEXTEDIT_K_WORDRIGHT: if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_last(str, state); else { state->cursor = STB_TEXTEDIT_MOVEWORDRIGHT(str, state->cursor); stb_textedit_clamp( str, state ); } break; case STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT: if( !STB_TEXT_HAS_SELECTION( state ) ) stb_textedit_prep_selection_at_cursor(state); state->cursor = STB_TEXTEDIT_MOVEWORDRIGHT(str, state->cursor); state->select_end = state->cursor; stb_textedit_clamp( str, state ); break; #endif case STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT: stb_textedit_prep_selection_at_cursor(state); // move selection right ++state->select_end; stb_textedit_clamp(str, state); state->cursor = state->select_end; state->has_preferred_x = 0; break; case STB_TEXTEDIT_K_DOWN: case STB_TEXTEDIT_K_DOWN | STB_TEXTEDIT_K_SHIFT: { StbFindState find; StbTexteditRow row; int i, sel = (key & STB_TEXTEDIT_K_SHIFT) != 0; if (state->single_line) { // on windows, up&down in single-line behave like left&right key = STB_TEXTEDIT_K_RIGHT | (key & STB_TEXTEDIT_K_SHIFT); goto retry; } if (sel) stb_textedit_prep_selection_at_cursor(state); else if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_last(str,state); // compute current position of cursor point stb_textedit_clamp(str, state); stb_textedit_find_charpos(&find, str, state->cursor, state->single_line); // now find character position down a row if (find.length) { float goal_x = state->has_preferred_x ? state->preferred_x : find.x; float x; int start = find.first_char + find.length; state->cursor = start; STB_TEXTEDIT_LAYOUTROW(&row, str, state->cursor); x = row.x0; for (i=0; i < row.num_chars; ++i) { float dx = STB_TEXTEDIT_GETWIDTH(str, start, i); #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE) break; #endif x += dx; if (x > goal_x) break; ++state->cursor; } stb_textedit_clamp(str, state); state->has_preferred_x = 1; state->preferred_x = goal_x; if (sel) state->select_end = state->cursor; } break; } case STB_TEXTEDIT_K_UP: case STB_TEXTEDIT_K_UP | STB_TEXTEDIT_K_SHIFT: { StbFindState find; StbTexteditRow row; int i, sel = (key & STB_TEXTEDIT_K_SHIFT) != 0; if (state->single_line) { // on windows, up&down become left&right key = STB_TEXTEDIT_K_LEFT | (key & STB_TEXTEDIT_K_SHIFT); goto retry; } if (sel) stb_textedit_prep_selection_at_cursor(state); else if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_move_to_first(state); // compute current position of cursor point stb_textedit_clamp(str, state); stb_textedit_find_charpos(&find, str, state->cursor, state->single_line); // can only go up if there's a previous row if (find.prev_first != find.first_char) { // now find character position up a row float goal_x = state->has_preferred_x ? state->preferred_x : find.x; float x; state->cursor = find.prev_first; STB_TEXTEDIT_LAYOUTROW(&row, str, state->cursor); x = row.x0; for (i=0; i < row.num_chars; ++i) { float dx = STB_TEXTEDIT_GETWIDTH(str, find.prev_first, i); #ifdef STB_TEXTEDIT_GETWIDTH_NEWLINE if (dx == STB_TEXTEDIT_GETWIDTH_NEWLINE) break; #endif x += dx; if (x > goal_x) break; ++state->cursor; } stb_textedit_clamp(str, state); state->has_preferred_x = 1; state->preferred_x = goal_x; if (sel) state->select_end = state->cursor; } break; } case STB_TEXTEDIT_K_DELETE: case STB_TEXTEDIT_K_DELETE | STB_TEXTEDIT_K_SHIFT: if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_delete_selection(str, state); else { int n = STB_TEXTEDIT_STRINGLEN(str); if (state->cursor < n) stb_textedit_delete(str, state, state->cursor, 1); } state->has_preferred_x = 0; break; case STB_TEXTEDIT_K_BACKSPACE: case STB_TEXTEDIT_K_BACKSPACE | STB_TEXTEDIT_K_SHIFT: if (STB_TEXT_HAS_SELECTION(state)) stb_textedit_delete_selection(str, state); else { stb_textedit_clamp(str, state); if (state->cursor > 0) { stb_textedit_delete(str, state, state->cursor-1, 1); --state->cursor; } } state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_K_TEXTSTART2 case STB_TEXTEDIT_K_TEXTSTART2: #endif case STB_TEXTEDIT_K_TEXTSTART: state->cursor = state->select_start = state->select_end = 0; state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_K_TEXTEND2 case STB_TEXTEDIT_K_TEXTEND2: #endif case STB_TEXTEDIT_K_TEXTEND: state->cursor = STB_TEXTEDIT_STRINGLEN(str); state->select_start = state->select_end = 0; state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_K_TEXTSTART2 case STB_TEXTEDIT_K_TEXTSTART2 | STB_TEXTEDIT_K_SHIFT: #endif case STB_TEXTEDIT_K_TEXTSTART | STB_TEXTEDIT_K_SHIFT: stb_textedit_prep_selection_at_cursor(state); state->cursor = state->select_end = 0; state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_K_TEXTEND2 case STB_TEXTEDIT_K_TEXTEND2 | STB_TEXTEDIT_K_SHIFT: #endif case STB_TEXTEDIT_K_TEXTEND | STB_TEXTEDIT_K_SHIFT: stb_textedit_prep_selection_at_cursor(state); state->cursor = state->select_end = STB_TEXTEDIT_STRINGLEN(str); state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_K_LINESTART2 case STB_TEXTEDIT_K_LINESTART2: #endif case STB_TEXTEDIT_K_LINESTART: stb_textedit_clamp(str, state); stb_textedit_move_to_first(state); if (state->single_line) state->cursor = 0; else while (state->cursor > 0 && STB_TEXTEDIT_GETCHAR(str, state->cursor-1) != STB_TEXTEDIT_NEWLINE) --state->cursor; state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_K_LINEEND2 case STB_TEXTEDIT_K_LINEEND2: #endif case STB_TEXTEDIT_K_LINEEND: { int n = STB_TEXTEDIT_STRINGLEN(str); stb_textedit_clamp(str, state); stb_textedit_move_to_first(state); if (state->single_line) state->cursor = n; else while (state->cursor < n && STB_TEXTEDIT_GETCHAR(str, state->cursor) != STB_TEXTEDIT_NEWLINE) ++state->cursor; state->has_preferred_x = 0; break; } #ifdef STB_TEXTEDIT_K_LINESTART2 case STB_TEXTEDIT_K_LINESTART2 | STB_TEXTEDIT_K_SHIFT: #endif case STB_TEXTEDIT_K_LINESTART | STB_TEXTEDIT_K_SHIFT: stb_textedit_clamp(str, state); stb_textedit_prep_selection_at_cursor(state); if (state->single_line) state->cursor = 0; else while (state->cursor > 0 && STB_TEXTEDIT_GETCHAR(str, state->cursor-1) != STB_TEXTEDIT_NEWLINE) --state->cursor; state->select_end = state->cursor; state->has_preferred_x = 0; break; #ifdef STB_TEXTEDIT_K_LINEEND2 case STB_TEXTEDIT_K_LINEEND2 | STB_TEXTEDIT_K_SHIFT: #endif case STB_TEXTEDIT_K_LINEEND | STB_TEXTEDIT_K_SHIFT: { int n = STB_TEXTEDIT_STRINGLEN(str); stb_textedit_clamp(str, state); stb_textedit_prep_selection_at_cursor(state); if (state->single_line) state->cursor = n; else while (state->cursor < n && STB_TEXTEDIT_GETCHAR(str, state->cursor) != STB_TEXTEDIT_NEWLINE) ++state->cursor; state->select_end = state->cursor; state->has_preferred_x = 0; break; } // @TODO: // STB_TEXTEDIT_K_PGUP - move cursor up a page // STB_TEXTEDIT_K_PGDOWN - move cursor down a page } } ///////////////////////////////////////////////////////////////////////////// // // Undo processing // // @OPTIMIZE: the undo/redo buffer should be circular static void stb_textedit_flush_redo(StbUndoState *state) { state->redo_point = STB_TEXTEDIT_UNDOSTATECOUNT; state->redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT; } // discard the oldest entry in the undo list static void stb_textedit_discard_undo(StbUndoState *state) { if (state->undo_point > 0) { // if the 0th undo state has characters, clean those up if (state->undo_rec[0].char_storage >= 0) { int n = state->undo_rec[0].insert_length, i; // delete n characters from all other records state->undo_char_point = state->undo_char_point - (short) n; // vsnet05 STB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) ((size_t)state->undo_char_point*sizeof(STB_TEXTEDIT_CHARTYPE))); for (i=0; i < state->undo_point; ++i) if (state->undo_rec[i].char_storage >= 0) state->undo_rec[i].char_storage = state->undo_rec[i].char_storage - (short) n; // vsnet05 // @OPTIMIZE: get rid of char_storage and infer it } --state->undo_point; STB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) ((size_t)state->undo_point*sizeof(state->undo_rec[0]))); } } // discard the oldest entry in the redo list--it's bad if this // ever happens, but because undo & redo have to store the actual // characters in different cases, the redo character buffer can // fill up even though the undo buffer didn't static void stb_textedit_discard_redo(StbUndoState *state) { int k = STB_TEXTEDIT_UNDOSTATECOUNT-1; if (state->redo_point <= k) { // if the k'th undo state has characters, clean those up if (state->undo_rec[k].char_storage >= 0) { int n = state->undo_rec[k].insert_length, i; // delete n characters from all other records state->redo_char_point = state->redo_char_point + (short) n; // vsnet05 STB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((size_t)(STB_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point)*sizeof(STB_TEXTEDIT_CHARTYPE))); for (i=state->redo_point; i < k; ++i) if (state->undo_rec[i].char_storage >= 0) state->undo_rec[i].char_storage = state->undo_rec[i].char_storage + (short) n; // vsnet05 } STB_TEXTEDIT_memmove(state->undo_rec + state->redo_point, state->undo_rec + state->redo_point-1, (size_t) ((size_t)(STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point)*sizeof(state->undo_rec[0]))); ++state->redo_point; } } static StbUndoRecord *stb_text_create_undo_record(StbUndoState *state, int numchars) { // any time we create a new undo record, we discard redo stb_textedit_flush_redo(state); // if we have no free records, we have to make room, by sliding the // existing records down if (state->undo_point == STB_TEXTEDIT_UNDOSTATECOUNT) stb_textedit_discard_undo(state); // if the characters to store won't possibly fit in the buffer, we can't undo if (numchars > STB_TEXTEDIT_UNDOCHARCOUNT) { state->undo_point = 0; state->undo_char_point = 0; return NULL; } // if we don't have enough free characters in the buffer, we have to make room while (state->undo_char_point + numchars > STB_TEXTEDIT_UNDOCHARCOUNT) stb_textedit_discard_undo(state); return &state->undo_rec[state->undo_point++]; } static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len) { StbUndoRecord *r = stb_text_create_undo_record(state, insert_len); if (r == NULL) return NULL; r->where = pos; r->insert_length = (short) insert_len; r->delete_length = (short) delete_len; if (insert_len == 0) { r->char_storage = -1; return NULL; } else { r->char_storage = state->undo_char_point; state->undo_char_point = state->undo_char_point + (short) insert_len; return &state->undo_char[r->char_storage]; } } static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) { StbUndoState *s = &state->undostate; StbUndoRecord u, *r; if (s->undo_point == 0) return; // we need to do two things: apply the undo record, and create a redo record u = s->undo_rec[s->undo_point-1]; r = &s->undo_rec[s->redo_point-1]; r->char_storage = -1; r->insert_length = u.delete_length; r->delete_length = u.insert_length; r->where = u.where; if (u.delete_length) { // if the undo record says to delete characters, then the redo record will // need to re-insert the characters that get deleted, so we need to store // them. // there are three cases: // there's enough room to store the characters // characters stored for *redoing* don't leave room for redo // characters stored for *undoing* don't leave room for redo // if the last is true, we have to bail if (s->undo_char_point + u.delete_length >= STB_TEXTEDIT_UNDOCHARCOUNT) { // the undo records take up too much character space; there's no space to store the redo characters r->insert_length = 0; } else { int i; // there's definitely room to store the characters eventually while (s->undo_char_point + u.delete_length > s->redo_char_point) { // there's currently not enough room, so discard a redo record stb_textedit_discard_redo(s); // should never happen: if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT) return; } r = &s->undo_rec[s->redo_point-1]; r->char_storage = s->redo_char_point - u.delete_length; s->redo_char_point = s->redo_char_point - (short) u.delete_length; // now save the characters for (i=0; i < u.delete_length; ++i) s->undo_char[r->char_storage + i] = STB_TEXTEDIT_GETCHAR(str, u.where + i); } // now we can carry out the deletion STB_TEXTEDIT_DELETECHARS(str, u.where, u.delete_length); } // check type of recorded action: if (u.insert_length) { // easy case: was a deletion, so we need to insert n characters STB_TEXTEDIT_INSERTCHARS(str, u.where, &s->undo_char[u.char_storage], u.insert_length); s->undo_char_point -= u.insert_length; } state->cursor = u.where + u.insert_length; s->undo_point--; s->redo_point--; } static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *state) { StbUndoState *s = &state->undostate; StbUndoRecord *u, r; if (s->redo_point == STB_TEXTEDIT_UNDOSTATECOUNT) return; // we need to do two things: apply the redo record, and create an undo record u = &s->undo_rec[s->undo_point]; r = s->undo_rec[s->redo_point]; // we KNOW there must be room for the undo record, because the redo record // was derived from an undo record u->delete_length = r.insert_length; u->insert_length = r.delete_length; u->where = r.where; u->char_storage = -1; if (r.delete_length) { // the redo record requires us to delete characters, so the undo record // needs to store the characters if (s->undo_char_point + u->insert_length > s->redo_char_point) { u->insert_length = 0; u->delete_length = 0; } else { int i; u->char_storage = s->undo_char_point; s->undo_char_point = s->undo_char_point + u->insert_length; // now save the characters for (i=0; i < u->insert_length; ++i) s->undo_char[u->char_storage + i] = STB_TEXTEDIT_GETCHAR(str, u->where + i); } STB_TEXTEDIT_DELETECHARS(str, r.where, r.delete_length); } if (r.insert_length) { // easy case: need to insert n characters STB_TEXTEDIT_INSERTCHARS(str, r.where, &s->undo_char[r.char_storage], r.insert_length); s->redo_char_point += r.insert_length; } state->cursor = r.where + r.insert_length; s->undo_point++; s->redo_point++; } static void stb_text_makeundo_insert(STB_TexteditState *state, int where, int length) { stb_text_createundo(&state->undostate, where, 0, length); } static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int length) { int i; STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, length, 0); if (p) { for (i=0; i < length; ++i) p[i] = STB_TEXTEDIT_GETCHAR(str, where+i); } } static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length) { int i; STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length); if (p) { for (i=0; i < old_length; ++i) p[i] = STB_TEXTEDIT_GETCHAR(str, where+i); } } // reset the state to default static void stb_textedit_clear_state(STB_TexteditState *state, int is_single_line) { state->undostate.undo_point = 0; state->undostate.undo_char_point = 0; state->undostate.redo_point = STB_TEXTEDIT_UNDOSTATECOUNT; state->undostate.redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT; state->select_end = state->select_start = 0; state->cursor = 0; state->has_preferred_x = 0; state->preferred_x = 0; state->cursor_at_end_of_line = 0; state->initialized = 1; state->single_line = (unsigned char) is_single_line; state->insert_mode = 0; } // API initialize static void stb_textedit_initialize_state(STB_TexteditState *state, int is_single_line) { stb_textedit_clear_state(state, is_single_line); } #endif//STB_TEXTEDIT_IMPLEMENTATION goxel-0.8.1/ext_src/stb/stb_truetype.h000066400000000000000000005627301334742672700200330ustar00rootroot00000000000000// stb_truetype.h - v1.19 - public domain // authored from 2009-2016 by Sean Barrett / RAD Game Tools // // This library processes TrueType files: // parse files // extract glyph metrics // extract glyph shapes // render glyphs to one-channel bitmaps with antialiasing (box filter) // render glyphs to one-channel SDF bitmaps (signed-distance field/function) // // Todo: // non-MS cmaps // crashproof on bad data // hinting? (no longer patented) // cleartype-style AA? // optimize: use simple memory allocator for intermediates // optimize: build edge-list directly from curves // optimize: rasterize directly from curves? // // ADDITIONAL CONTRIBUTORS // // Mikko Mononen: compound shape support, more cmap formats // Tor Andersson: kerning, subpixel rendering // Dougall Johnson: OpenType / Type 2 font handling // Daniel Ribeiro Maciel: basic GPOS-based kerning // // Misc other: // Ryan Gordon // Simon Glass // github:IntellectualKitty // Imanol Celaya // Daniel Ribeiro Maciel // // Bug/warning reports/fixes: // "Zer" on mollyrocket Fabian "ryg" Giesen // Cass Everitt Martins Mozeiko // stoiko (Haemimont Games) Cap Petschulat // Brian Hook Omar Cornut // Walter van Niftrik github:aloucks // David Gow Peter LaValle // David Given Sergey Popov // Ivan-Assen Ivanov Giumo X. Clanjor // Anthony Pesch Higor Euripedes // Johan Duparc Thomas Fields // Hou Qiming Derek Vinyard // Rob Loach Cort Stratton // Kenney Phillis Jr. github:oyvindjam // Brian Costabile github:vassvik // // VERSION HISTORY // // 1.19 (2018-02-11) GPOS kerning, STBTT_fmod // 1.18 (2018-01-29) add missing function // 1.17 (2017-07-23) make more arguments const; doc fix // 1.16 (2017-07-12) SDF support // 1.15 (2017-03-03) make more arguments const // 1.14 (2017-01-16) num-fonts-in-TTC function // 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts // 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual // 1.11 (2016-04-02) fix unused-variable warning // 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef // 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; // variant PackFontRanges to pack and render in separate phases; // fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); // fixed an assert() bug in the new rasterizer // replace assert() with STBTT_assert() in new rasterizer // // Full history can be found at the end of this file. // // LICENSE // // See end of file for license information. // // USAGE // // Include this file in whatever places neeed to refer to it. In ONE C/C++ // file, write: // #define STB_TRUETYPE_IMPLEMENTATION // before the #include of this file. This expands out the actual // implementation into that C/C++ file. // // To make the implementation private to the file that generates the implementation, // #define STBTT_STATIC // // Simple 3D API (don't ship this, but it's fine for tools and quick start) // stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture // stbtt_GetBakedQuad() -- compute quad to draw for a given char // // Improved 3D API (more shippable): // #include "stb_rect_pack.h" -- optional, but you really want it // stbtt_PackBegin() // stbtt_PackSetOversampling() -- for improved quality on small fonts // stbtt_PackFontRanges() -- pack and renders // stbtt_PackEnd() // stbtt_GetPackedQuad() // // "Load" a font file from a memory buffer (you have to keep the buffer loaded) // stbtt_InitFont() // stbtt_GetFontOffsetForIndex() -- indexing for TTC font collections // stbtt_GetNumberOfFonts() -- number of fonts for TTC font collections // // Render a unicode codepoint to a bitmap // stbtt_GetCodepointBitmap() -- allocates and returns a bitmap // stbtt_MakeCodepointBitmap() -- renders into bitmap you provide // stbtt_GetCodepointBitmapBox() -- how big the bitmap must be // // Character advance/positioning // stbtt_GetCodepointHMetrics() // stbtt_GetFontVMetrics() // stbtt_GetFontVMetricsOS2() // stbtt_GetCodepointKernAdvance() // // Starting with version 1.06, the rasterizer was replaced with a new, // faster and generally-more-precise rasterizer. The new rasterizer more // accurately measures pixel coverage for anti-aliasing, except in the case // where multiple shapes overlap, in which case it overestimates the AA pixel // coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If // this turns out to be a problem, you can re-enable the old rasterizer with // #define STBTT_RASTERIZER_VERSION 1 // which will incur about a 15% speed hit. // // ADDITIONAL DOCUMENTATION // // Immediately after this block comment are a series of sample programs. // // After the sample programs is the "header file" section. This section // includes documentation for each API function. // // Some important concepts to understand to use this library: // // Codepoint // Characters are defined by unicode codepoints, e.g. 65 is // uppercase A, 231 is lowercase c with a cedilla, 0x7e30 is // the hiragana for "ma". // // Glyph // A visual character shape (every codepoint is rendered as // some glyph) // // Glyph index // A font-specific integer ID representing a glyph // // Baseline // Glyph shapes are defined relative to a baseline, which is the // bottom of uppercase characters. Characters extend both above // and below the baseline. // // Current Point // As you draw text to the screen, you keep track of a "current point" // which is the origin of each character. The current point's vertical // position is the baseline. Even "baked fonts" use this model. // // Vertical Font Metrics // The vertical qualities of the font, used to vertically position // and space the characters. See docs for stbtt_GetFontVMetrics. // // Font Size in Pixels or Points // The preferred interface for specifying font sizes in stb_truetype // is to specify how tall the font's vertical extent should be in pixels. // If that sounds good enough, skip the next paragraph. // // Most font APIs instead use "points", which are a common typographic // measurement for describing font size, defined as 72 points per inch. // stb_truetype provides a point API for compatibility. However, true // "per inch" conventions don't make much sense on computer displays // since different monitors have different number of pixels per // inch. For example, Windows traditionally uses a convention that // there are 96 pixels per inch, thus making 'inch' measurements have // nothing to do with inches, and thus effectively defining a point to // be 1.333 pixels. Additionally, the TrueType font data provides // an explicit scale factor to scale a given font's glyphs to points, // but the author has observed that this scale factor is often wrong // for non-commercial fonts, thus making fonts scaled in points // according to the TrueType spec incoherently sized in practice. // // DETAILED USAGE: // // Scale: // Select how high you want the font to be, in points or pixels. // Call ScaleForPixelHeight or ScaleForMappingEmToPixels to compute // a scale factor SF that will be used by all other functions. // // Baseline: // You need to select a y-coordinate that is the baseline of where // your text will appear. Call GetFontBoundingBox to get the baseline-relative // bounding box for all characters. SF*-y0 will be the distance in pixels // that the worst-case character could extend above the baseline, so if // you want the top edge of characters to appear at the top of the // screen where y=0, then you would set the baseline to SF*-y0. // // Current point: // Set the current point where the first character will appear. The // first character could extend left of the current point; this is font // dependent. You can either choose a current point that is the leftmost // point and hope, or add some padding, or check the bounding box or // left-side-bearing of the first character to be displayed and set // the current point based on that. // // Displaying a character: // Compute the bounding box of the character. It will contain signed values // relative to . I.e. if it returns x0,y0,x1,y1, // then the character should be displayed in the rectangle from // to = 32 && *text < 128) { stbtt_aligned_quad q; stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9 glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0); glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0); glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1); glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1); } ++text; } glEnd(); } #endif // // ////////////////////////////////////////////////////////////////////////////// // // Complete program (this compiles): get a single bitmap, print as ASCII art // #if 0 #include #define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation #include "stb_truetype.h" char ttf_buffer[1<<25]; int main(int argc, char **argv) { stbtt_fontinfo font; unsigned char *bitmap; int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20); fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb")); stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0)); bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0); for (j=0; j < h; ++j) { for (i=0; i < w; ++i) putchar(" .:ioVM@"[bitmap[j*w+i]>>5]); putchar('\n'); } return 0; } #endif // // Output: // // .ii. // @@@@@@. // V@Mio@@o // :i. V@V // :oM@@M // :@@@MM@M // @@o o@M // :@@. M@M // @@@o@@@@ // :M@@V:@@. // ////////////////////////////////////////////////////////////////////////////// // // Complete program: print "Hello World!" banner, with bugs // #if 0 char buffer[24<<20]; unsigned char screen[20][79]; int main(int arg, char **argv) { stbtt_fontinfo font; int i,j,ascent,baseline,ch=0; float scale, xpos=2; // leave a little padding in case the character extends left char *text = "Heljo World!"; // intentionally misspelled to show 'lj' brokenness fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb")); stbtt_InitFont(&font, buffer, 0); scale = stbtt_ScaleForPixelHeight(&font, 15); stbtt_GetFontVMetrics(&font, &ascent,0,0); baseline = (int) (ascent*scale); while (text[ch]) { int advance,lsb,x0,y0,x1,y1; float x_shift = xpos - (float) floor(xpos); stbtt_GetCodepointHMetrics(&font, text[ch], &advance, &lsb); stbtt_GetCodepointBitmapBoxSubpixel(&font, text[ch], scale,scale,x_shift,0, &x0,&y0,&x1,&y1); stbtt_MakeCodepointBitmapSubpixel(&font, &screen[baseline + y0][(int) xpos + x0], x1-x0,y1-y0, 79, scale,scale,x_shift,0, text[ch]); // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong // because this API is really for baking character bitmaps into textures. if you want to render // a sequence of characters, you really need to render each bitmap to a temp buffer, then // "alpha blend" that into the working buffer xpos += (advance * scale); if (text[ch+1]) xpos += scale*stbtt_GetCodepointKernAdvance(&font, text[ch],text[ch+1]); ++ch; } for (j=0; j < 20; ++j) { for (i=0; i < 78; ++i) putchar(" .:ioVM@"[screen[j][i]>>5]); putchar('\n'); } return 0; } #endif ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //// //// INTEGRATION WITH YOUR CODEBASE //// //// The following sections allow you to supply alternate definitions //// of C library functions used by stb_truetype, e.g. if you don't //// link with the C runtime library. #ifdef STB_TRUETYPE_IMPLEMENTATION // #define your own (u)stbtt_int8/16/32 before including to override this #ifndef stbtt_uint8 typedef unsigned char stbtt_uint8; typedef signed char stbtt_int8; typedef unsigned short stbtt_uint16; typedef signed short stbtt_int16; typedef unsigned int stbtt_uint32; typedef signed int stbtt_int32; #endif typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1]; typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1]; // e.g. #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h #ifndef STBTT_ifloor #include #define STBTT_ifloor(x) ((int) floor(x)) #define STBTT_iceil(x) ((int) ceil(x)) #endif #ifndef STBTT_sqrt #include #define STBTT_sqrt(x) sqrt(x) #define STBTT_pow(x,y) pow(x,y) #endif #ifndef STBTT_fmod #include #define STBTT_fmod(x,y) fmod(x,y) #endif #ifndef STBTT_cos #include #define STBTT_cos(x) cos(x) #define STBTT_acos(x) acos(x) #endif #ifndef STBTT_fabs #include #define STBTT_fabs(x) fabs(x) #endif // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h #ifndef STBTT_malloc #include #define STBTT_malloc(x,u) ((void)(u),malloc(x)) #define STBTT_free(x,u) ((void)(u),free(x)) #endif #ifndef STBTT_assert #include #define STBTT_assert(x) assert(x) #endif #ifndef STBTT_strlen #include #define STBTT_strlen(x) strlen(x) #endif #ifndef STBTT_memcpy #include #define STBTT_memcpy memcpy #define STBTT_memset memset #endif #endif /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// //// //// INTERFACE //// //// #ifndef __STB_INCLUDE_STB_TRUETYPE_H__ #define __STB_INCLUDE_STB_TRUETYPE_H__ #ifdef STBTT_STATIC #define STBTT_DEF static #else #define STBTT_DEF extern #endif #ifdef __cplusplus extern "C" { #endif // private structure typedef struct { unsigned char *data; int cursor; int size; } stbtt__buf; ////////////////////////////////////////////////////////////////////////////// // // TEXTURE BAKING API // // If you use this API, you only have to call two functions ever. // typedef struct { unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap float xoff,yoff,xadvance; } stbtt_bakedchar; STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) float pixel_height, // height of font in pixels unsigned char *pixels, int pw, int ph, // bitmap to be filled in int first_char, int num_chars, // characters to bake stbtt_bakedchar *chardata); // you allocate this, it's num_chars long // if return is positive, the first unused row of the bitmap // if return is negative, returns the negative of the number of characters that fit // if return is 0, no characters fit and no rows were used // This uses a very crappy packing. typedef struct { float x0,y0,s0,t0; // top-left float x1,y1,s1,t1; // bottom-right } stbtt_aligned_quad; STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, // same data as above int char_index, // character to display float *xpos, float *ypos, // pointers to current position in screen pixel space stbtt_aligned_quad *q, // output: quad to draw int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier // Call GetBakedQuad with char_index = 'character - first_char', and it // creates the quad you need to draw and advances the current position. // // The coordinate system used assumes y increases downwards. // // Characters will extend both above and below the current position; // see discussion of "BASELINE" above. // // It's inefficient; you might want to c&p it and optimize it. ////////////////////////////////////////////////////////////////////////////// // // NEW TEXTURE BAKING API // // This provides options for packing multiple fonts into one atlas, not // perfectly but better than nothing. typedef struct { unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap float xoff,yoff,xadvance; float xoff2,yoff2; } stbtt_packedchar; typedef struct stbtt_pack_context stbtt_pack_context; typedef struct stbtt_fontinfo stbtt_fontinfo; #ifndef STB_RECT_PACK_VERSION typedef struct stbrp_rect stbrp_rect; #endif STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); // Initializes a packing context stored in the passed-in stbtt_pack_context. // Future calls using this context will pack characters into the bitmap passed // in here: a 1-channel bitmap that is width * height. stride_in_bytes is // the distance from one row to the next (or 0 to mean they are packed tightly // together). "padding" is the amount of padding to leave between each // character (normally you want '1' for bitmaps you'll use as textures with // bilinear filtering). // // Returns 0 on failure, 1 on success. STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc); // Cleans up the packing context and frees all memory. #define STBTT_POINT_SIZE(x) (-(x)) STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range); // Creates character bitmaps from the font_index'th font found in fontdata (use // font_index=0 if you don't know what that is). It creates num_chars_in_range // bitmaps for characters with unicode values starting at first_unicode_char_in_range // and increasing. Data for how to render them is stored in chardata_for_range; // pass these to stbtt_GetPackedQuad to get back renderable quads. // // font_size is the full height of the character from ascender to descender, // as computed by stbtt_ScaleForPixelHeight. To use a point size as computed // by stbtt_ScaleForMappingEmToPixels, wrap the point size in STBTT_POINT_SIZE() // and pass that result as 'font_size': // ..., 20 , ... // font max minus min y is 20 pixels tall // ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall typedef struct { float font_size; int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints int num_chars; stbtt_packedchar *chardata_for_range; // output unsigned char h_oversample, v_oversample; // don't set these, they're used internally } stbtt_pack_range; STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges); // Creates character bitmaps from multiple ranges of characters stored in // ranges. This will usually create a better-packed bitmap than multiple // calls to stbtt_PackFontRange. Note that you can call this multiple // times within a single PackBegin/PackEnd. STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample); // Oversampling a font increases the quality by allowing higher-quality subpixel // positioning, and is especially valuable at smaller text sizes. // // This function sets the amount of oversampling for all following calls to // stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given // pack context. The default (no oversampling) is achieved by h_oversample=1 // and v_oversample=1. The total number of pixels required is // h_oversample*v_oversample larger than the default; for example, 2x2 // oversampling requires 4x the storage of 1x1. For best results, render // oversampled textures with bilinear filtering. Look at the readme in // stb/tests/oversample for information about oversampled fonts // // To use with PackFontRangesGather etc., you must set it before calls // call to PackFontRangesGatherRects. STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above int char_index, // character to display float *xpos, float *ypos, // pointers to current position in screen pixel space stbtt_aligned_quad *q, // output: quad to draw int align_to_integer); STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects); STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); // Calling these functions in sequence is roughly equivalent to calling // stbtt_PackFontRanges(). If you more control over the packing of multiple // fonts, or if you want to pack custom data into a font texture, take a look // at the source to of stbtt_PackFontRanges() and create a custom version // using these functions, e.g. call GatherRects multiple times, // building up a single array of rects, then call PackRects once, // then call RenderIntoRects repeatedly. This may result in a // better packing than calling PackFontRanges multiple times // (or it may not). // this is an opaque structure that you shouldn't mess with which holds // all the context needed from PackBegin to PackEnd. struct stbtt_pack_context { void *user_allocator_context; void *pack_info; int width; int height; int stride_in_bytes; int padding; unsigned int h_oversample, v_oversample; unsigned char *pixels; void *nodes; }; ////////////////////////////////////////////////////////////////////////////// // // FONT LOADING // // STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data); // This function will determine the number of fonts in a font file. TrueType // collection (.ttc) files may contain multiple fonts, while TrueType font // (.ttf) files only contain one font. The number of fonts can be used for // indexing with the previous function where the index is between zero and one // less than the total fonts. If an error occurs, -1 is returned. STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); // Each .ttf/.ttc file may have more than one font. Each font has a sequential // index number starting from 0. Call this function to get the font offset for // a given index; it returns -1 if the index is out of range. A regular .ttf // file will only define one font and it always be at offset 0, so it will // return '0' for index 0, and -1 for all other indices. // The following structure is defined publically so you can declare one on // the stack or as a global or etc, but you should treat it as opaque. struct stbtt_fontinfo { void * userdata; unsigned char * data; // pointer to .ttf file int fontstart; // offset of start of font int numGlyphs; // number of glyphs, needed for range checking int loca,head,glyf,hhea,hmtx,kern,gpos; // table locations as offset from start of .ttf int index_map; // a cmap mapping for our chosen character encoding int indexToLocFormat; // format needed to map from glyph index to glyph stbtt__buf cff; // cff font data stbtt__buf charstrings; // the charstring index stbtt__buf gsubrs; // global charstring subroutines index stbtt__buf subrs; // private charstring subroutines index stbtt__buf fontdicts; // array of font dicts stbtt__buf fdselect; // map from glyph to fontdict }; STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); // Given an offset into the file that defines a font, this function builds // the necessary cached info for the rest of the system. You must allocate // the stbtt_fontinfo yourself, and stbtt_InitFont will fill it out. You don't // need to do anything special to free it, because the contents are pure // value data with no additional data structures. Returns 0 on failure. ////////////////////////////////////////////////////////////////////////////// // // CHARACTER TO GLYPH-INDEX CONVERSIOn STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint); // If you're going to perform multiple operations on the same character // and you want a speed-up, call this function with the character you're // going to process, then use glyph-based functions instead of the // codepoint-based functions. ////////////////////////////////////////////////////////////////////////////// // // CHARACTER PROPERTIES // STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels); // computes a scale factor to produce a font whose "height" is 'pixels' tall. // Height is measured as the distance from the highest ascender to the lowest // descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics // and computing: // scale = pixels / (ascent - descent) // so if you prefer to measure height by the ascent only, use a similar calculation. STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels); // computes a scale factor to produce a font whose EM size is mapped to // 'pixels' tall. This is probably what traditional APIs compute, but // I'm not positive. STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap); // ascent is the coordinate above the baseline the font extends; descent // is the coordinate below the baseline the font extends (i.e. it is typically negative) // lineGap is the spacing between one row's descent and the next row's ascent... // so you should advance the vertical position by "*ascent - *descent + *lineGap" // these are expressed in unscaled coordinates, so you must multiply by // the scale factor for a given size STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap); // analogous to GetFontVMetrics, but returns the "typographic" values from the OS/2 // table (specific to MS/Windows TTF files). // // Returns 1 on success (table present), 0 on failure. STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1); // the bounding box around all possible characters STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing); // leftSideBearing is the offset from the current horizontal position to the left edge of the character // advanceWidth is the offset from the current horizontal position to the next horizontal position // these are expressed in unscaled coordinates STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2); // an additional amount to add to the 'advance' value between ch1 and ch2 STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1); // Gets the bounding box of the visible part of the glyph, in unscaled coordinates STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing); STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2); STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); // as above, but takes one or more glyph indices for greater efficiency ////////////////////////////////////////////////////////////////////////////// // // GLYPH SHAPES (you probably don't need these, but they have to go before // the bitmaps for C declaration-order reasons) // #ifndef STBTT_vmove // you can predefine these to use different values (but why?) enum { STBTT_vmove=1, STBTT_vline, STBTT_vcurve, STBTT_vcubic }; #endif #ifndef stbtt_vertex // you can predefine this to use different values // (we share this with other code at RAD) #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file typedef struct { stbtt_vertex_type x,y,cx,cy,cx1,cy1; unsigned char type,padding; } stbtt_vertex; #endif STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index); // returns non-zero if nothing is drawn for this glyph STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices); STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices); // returns # of vertices and fills *vertices with the pointer to them // these are expressed in "unscaled" coordinates // // The shape is a series of countours. Each one starts with // a STBTT_moveto, then consists of a series of mixed // STBTT_lineto and STBTT_curveto segments. A lineto // draws a line from previous endpoint to its x,y; a curveto // draws a quadratic bezier from previous endpoint to // its x,y, using cx,cy as the bezier control point. STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); // frees the data allocated above ////////////////////////////////////////////////////////////////////////////// // // BITMAP RENDERING // STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata); // frees the bitmap allocated below STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff); // allocates a large-enough single-channel 8bpp bitmap and renders the // specified character/glyph at the specified scale into it, with // antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). // *width & *height are filled out with the width & height of the bitmap, // which is stored left-to-right, top-to-bottom. // // xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff); // the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel // shift for the character STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); // the same as stbtt_GetCodepointBitmap, but you pass in storage for the bitmap // in the form of 'output', with row spacing of 'out_stride' bytes. the bitmap // is clipped to out_w/out_h bytes. Call stbtt_GetCodepointBitmapBox to get the // width and height and positioning info for it first. STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint); // same as stbtt_MakeCodepointBitmap, but you can specify a subpixel // shift for the character STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint); // same as stbtt_MakeCodepointBitmapSubpixel, but prefiltering // is performed (see stbtt_PackSetOversampling) STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); // get the bbox of the bitmap centered around the glyph origin; so the // bitmap width is ix1-ix0, height is iy1-iy0, and location to place // the bitmap top left is (leftSideBearing*scale,iy0). // (Note that the bitmap uses y-increases-down, but the shape uses // y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.) STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); // same as stbtt_GetCodepointBitmapBox, but you can specify a subpixel // shift for the character // the following functions are equivalent to the above functions, but operate // on glyph indices instead of Unicode codepoints (for efficiency) STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff); STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff); STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph); STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int glyph); STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); // @TODO: don't expose this structure typedef struct { int w,h,stride; unsigned char *pixels; } stbtt__bitmap; // rasterize a shape with quadratic beziers into a bitmap STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, // 1-channel bitmap to draw into float flatness_in_pixels, // allowable error of curve in pixels stbtt_vertex *vertices, // array of vertices defining shape int num_verts, // number of vertices in above array float scale_x, float scale_y, // scale applied to input vertices float shift_x, float shift_y, // translation applied to input vertices int x_off, int y_off, // another translation applied to input int invert, // if non-zero, vertically flip shape void *userdata); // context for to STBTT_MALLOC ////////////////////////////////////////////////////////////////////////////// // // Signed Distance Function (or Field) rendering STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata); // frees the SDF bitmap allocated below STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); // These functions compute a discretized SDF field for a single character, suitable for storing // in a single-channel texture, sampling with bilinear filtering, and testing against // larger than some threshhold to produce scalable fonts. // info -- the font // scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap // glyph/codepoint -- the character to generate the SDF for // padding -- extra "pixels" around the character which are filled with the distance to the character (not 0), // which allows effects like bit outlines // onedge_value -- value 0-255 to test the SDF against to reconstruct the character (i.e. the isocontour of the character) // pixel_dist_scale -- what value the SDF should increase by when moving one SDF "pixel" away from the edge (on the 0..255 scale) // if positive, > onedge_value is inside; if negative, < onedge_value is inside // width,height -- output height & width of the SDF bitmap (including padding) // xoff,yoff -- output origin of the character // return value -- a 2D array of bytes 0..255, width*height in size // // pixel_dist_scale & onedge_value are a scale & bias that allows you to make // optimal use of the limited 0..255 for your application, trading off precision // and special effects. SDF values outside the range 0..255 are clamped to 0..255. // // Example: // scale = stbtt_ScaleForPixelHeight(22) // padding = 5 // onedge_value = 180 // pixel_dist_scale = 180/5.0 = 36.0 // // This will create an SDF bitmap in which the character is about 22 pixels // high but the whole bitmap is about 22+5+5=32 pixels high. To produce a filled // shape, sample the SDF at each pixel and fill the pixel if the SDF value // is greater than or equal to 180/255. (You'll actually want to antialias, // which is beyond the scope of this example.) Additionally, you can compute // offset outlines (e.g. to stroke the character border inside & outside, // or only outside). For example, to fill outside the character up to 3 SDF // pixels, you would compare against (180-36.0*3)/255 = 72/255. The above // choice of variables maps a range from 5 pixels outside the shape to // 2 pixels inside the shape to 0..255; this is intended primarily for apply // outside effects only (the interior range is needed to allow proper // antialiasing of the font at *smaller* sizes) // // The function computes the SDF analytically at each SDF pixel, not by e.g. // building a higher-res bitmap and approximating it. In theory the quality // should be as high as possible for an SDF of this size & representation, but // unclear if this is true in practice (perhaps building a higher-res bitmap // and computing from that can allow drop-out prevention). // // The algorithm has not been optimized at all, so expect it to be slow // if computing lots of characters or very large sizes. ////////////////////////////////////////////////////////////////////////////// // // Finding the right font... // // You should really just solve this offline, keep your own tables // of what font is what, and don't try to get it out of the .ttf file. // That's because getting it out of the .ttf file is really hard, because // the names in the file can appear in many possible encodings, in many // possible languages, and e.g. if you need a case-insensitive comparison, // the details of that depend on the encoding & language in a complex way // (actually underspecified in truetype, but also gigantic). // // But you can use the provided functions in two possible ways: // stbtt_FindMatchingFont() will use *case-sensitive* comparisons on // unicode-encoded names to try to find the font you want; // you can run this before calling stbtt_InitFont() // // stbtt_GetFontNameString() lets you get any of the various strings // from the file yourself and do your own comparisons on them. // You have to have called stbtt_InitFont() first. STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags); // returns the offset (not index) of the font that matches, or -1 if none // if you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". // if you use any other flag, use a font name like "Arial"; this checks // the 'macStyle' header field; i don't know if fonts set this consistently #define STBTT_MACSTYLE_DONTCARE 0 #define STBTT_MACSTYLE_BOLD 1 #define STBTT_MACSTYLE_ITALIC 2 #define STBTT_MACSTYLE_UNDERSCORE 4 #define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0 STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2); // returns 1/0 whether the first string interpreted as utf8 is identical to // the second string interpreted as big-endian utf16... useful for strings from next func STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID); // returns the string (which may be big-endian double byte, e.g. for unicode) // and puts the length in bytes in *length. // // some of the values for the IDs are below; for more see the truetype spec: // http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html // http://www.microsoft.com/typography/otspec/name.htm enum { // platformID STBTT_PLATFORM_ID_UNICODE =0, STBTT_PLATFORM_ID_MAC =1, STBTT_PLATFORM_ID_ISO =2, STBTT_PLATFORM_ID_MICROSOFT =3 }; enum { // encodingID for STBTT_PLATFORM_ID_UNICODE STBTT_UNICODE_EID_UNICODE_1_0 =0, STBTT_UNICODE_EID_UNICODE_1_1 =1, STBTT_UNICODE_EID_ISO_10646 =2, STBTT_UNICODE_EID_UNICODE_2_0_BMP=3, STBTT_UNICODE_EID_UNICODE_2_0_FULL=4 }; enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT STBTT_MS_EID_SYMBOL =0, STBTT_MS_EID_UNICODE_BMP =1, STBTT_MS_EID_SHIFTJIS =2, STBTT_MS_EID_UNICODE_FULL =10 }; enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4, STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5, STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6, STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7 }; enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID... // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410, STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411, STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412, STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419, STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409, STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D }; enum { // languageID for STBTT_PLATFORM_ID_MAC STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11, STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23, STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32, STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 , STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 , STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33, STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19 }; #ifdef __cplusplus } #endif #endif // __STB_INCLUDE_STB_TRUETYPE_H__ /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// //// //// IMPLEMENTATION //// //// #ifdef STB_TRUETYPE_IMPLEMENTATION #ifndef STBTT_MAX_OVERSAMPLE #define STBTT_MAX_OVERSAMPLE 8 #endif #if STBTT_MAX_OVERSAMPLE > 255 #error "STBTT_MAX_OVERSAMPLE cannot be > 255" #endif typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1]; #ifndef STBTT_RASTERIZER_VERSION #define STBTT_RASTERIZER_VERSION 2 #endif #ifdef _MSC_VER #define STBTT__NOTUSED(v) (void)(v) #else #define STBTT__NOTUSED(v) (void)sizeof(v) #endif ////////////////////////////////////////////////////////////////////////// // // stbtt__buf helpers to parse data from file // static stbtt_uint8 stbtt__buf_get8(stbtt__buf *b) { if (b->cursor >= b->size) return 0; return b->data[b->cursor++]; } static stbtt_uint8 stbtt__buf_peek8(stbtt__buf *b) { if (b->cursor >= b->size) return 0; return b->data[b->cursor]; } static void stbtt__buf_seek(stbtt__buf *b, int o) { STBTT_assert(!(o > b->size || o < 0)); b->cursor = (o > b->size || o < 0) ? b->size : o; } static void stbtt__buf_skip(stbtt__buf *b, int o) { stbtt__buf_seek(b, b->cursor + o); } static stbtt_uint32 stbtt__buf_get(stbtt__buf *b, int n) { stbtt_uint32 v = 0; int i; STBTT_assert(n >= 1 && n <= 4); for (i = 0; i < n; i++) v = (v << 8) | stbtt__buf_get8(b); return v; } static stbtt__buf stbtt__new_buf(const void *p, size_t size) { stbtt__buf r; STBTT_assert(size < 0x40000000); r.data = (stbtt_uint8*) p; r.size = (int) size; r.cursor = 0; return r; } #define stbtt__buf_get16(b) stbtt__buf_get((b), 2) #define stbtt__buf_get32(b) stbtt__buf_get((b), 4) static stbtt__buf stbtt__buf_range(const stbtt__buf *b, int o, int s) { stbtt__buf r = stbtt__new_buf(NULL, 0); if (o < 0 || s < 0 || o > b->size || s > b->size - o) return r; r.data = b->data + o; r.size = s; return r; } static stbtt__buf stbtt__cff_get_index(stbtt__buf *b) { int count, start, offsize; start = b->cursor; count = stbtt__buf_get16(b); if (count) { offsize = stbtt__buf_get8(b); STBTT_assert(offsize >= 1 && offsize <= 4); stbtt__buf_skip(b, offsize * count); stbtt__buf_skip(b, stbtt__buf_get(b, offsize) - 1); } return stbtt__buf_range(b, start, b->cursor - start); } static stbtt_uint32 stbtt__cff_int(stbtt__buf *b) { int b0 = stbtt__buf_get8(b); if (b0 >= 32 && b0 <= 246) return b0 - 139; else if (b0 >= 247 && b0 <= 250) return (b0 - 247)*256 + stbtt__buf_get8(b) + 108; else if (b0 >= 251 && b0 <= 254) return -(b0 - 251)*256 - stbtt__buf_get8(b) - 108; else if (b0 == 28) return stbtt__buf_get16(b); else if (b0 == 29) return stbtt__buf_get32(b); STBTT_assert(0); return 0; } static void stbtt__cff_skip_operand(stbtt__buf *b) { int v, b0 = stbtt__buf_peek8(b); STBTT_assert(b0 >= 28); if (b0 == 30) { stbtt__buf_skip(b, 1); while (b->cursor < b->size) { v = stbtt__buf_get8(b); if ((v & 0xF) == 0xF || (v >> 4) == 0xF) break; } } else { stbtt__cff_int(b); } } static stbtt__buf stbtt__dict_get(stbtt__buf *b, int key) { stbtt__buf_seek(b, 0); while (b->cursor < b->size) { int start = b->cursor, end, op; while (stbtt__buf_peek8(b) >= 28) stbtt__cff_skip_operand(b); end = b->cursor; op = stbtt__buf_get8(b); if (op == 12) op = stbtt__buf_get8(b) | 0x100; if (op == key) return stbtt__buf_range(b, start, end-start); } return stbtt__buf_range(b, 0, 0); } static void stbtt__dict_get_ints(stbtt__buf *b, int key, int outcount, stbtt_uint32 *out) { int i; stbtt__buf operands = stbtt__dict_get(b, key); for (i = 0; i < outcount && operands.cursor < operands.size; i++) out[i] = stbtt__cff_int(&operands); } static int stbtt__cff_index_count(stbtt__buf *b) { stbtt__buf_seek(b, 0); return stbtt__buf_get16(b); } static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i) { int count, offsize, start, end; stbtt__buf_seek(&b, 0); count = stbtt__buf_get16(&b); offsize = stbtt__buf_get8(&b); STBTT_assert(i >= 0 && i < count); STBTT_assert(offsize >= 1 && offsize <= 4); stbtt__buf_skip(&b, i*offsize); start = stbtt__buf_get(&b, offsize); end = stbtt__buf_get(&b, offsize); return stbtt__buf_range(&b, 2+(count+1)*offsize+start, end - start); } ////////////////////////////////////////////////////////////////////////// // // accessors to parse data from file // // on platforms that don't allow misaligned reads, if we want to allow // truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE #define ttBYTE(p) (* (stbtt_uint8 *) (p)) #define ttCHAR(p) (* (stbtt_int8 *) (p)) #define ttFixed(p) ttLONG(p) static stbtt_uint16 ttUSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } static stbtt_int16 ttSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } static stbtt_uint32 ttULONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } static stbtt_int32 ttLONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } #define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) #define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) static int stbtt__isfont(stbtt_uint8 *font) { // check the version number if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1 if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 if (stbtt_tag(font, "true")) return 1; // Apple specification for TrueType fonts return 0; } // @OPTIMIZE: binary search static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag) { stbtt_int32 num_tables = ttUSHORT(data+fontstart+4); stbtt_uint32 tabledir = fontstart + 12; stbtt_int32 i; for (i=0; i < num_tables; ++i) { stbtt_uint32 loc = tabledir + 16*i; if (stbtt_tag(data+loc+0, tag)) return ttULONG(data+loc+8); } return 0; } static int stbtt_GetFontOffsetForIndex_internal(unsigned char *font_collection, int index) { // if it's just a font, there's only one valid index if (stbtt__isfont(font_collection)) return index == 0 ? 0 : -1; // check if it's a TTC if (stbtt_tag(font_collection, "ttcf")) { // version 1? if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { stbtt_int32 n = ttLONG(font_collection+8); if (index >= n) return -1; return ttULONG(font_collection+12+index*4); } } return -1; } static int stbtt_GetNumberOfFonts_internal(unsigned char *font_collection) { // if it's just a font, there's only one valid font if (stbtt__isfont(font_collection)) return 1; // check if it's a TTC if (stbtt_tag(font_collection, "ttcf")) { // version 1? if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { return ttLONG(font_collection+8); } } return 0; } static stbtt__buf stbtt__get_subrs(stbtt__buf cff, stbtt__buf fontdict) { stbtt_uint32 subrsoff = 0, private_loc[2] = { 0, 0 }; stbtt__buf pdict; stbtt__dict_get_ints(&fontdict, 18, 2, private_loc); if (!private_loc[1] || !private_loc[0]) return stbtt__new_buf(NULL, 0); pdict = stbtt__buf_range(&cff, private_loc[1], private_loc[0]); stbtt__dict_get_ints(&pdict, 19, 1, &subrsoff); if (!subrsoff) return stbtt__new_buf(NULL, 0); stbtt__buf_seek(&cff, private_loc[1]+subrsoff); return stbtt__cff_get_index(&cff); } static int stbtt_InitFont_internal(stbtt_fontinfo *info, unsigned char *data, int fontstart) { stbtt_uint32 cmap, t; stbtt_int32 i,numTables; info->data = data; info->fontstart = fontstart; info->cff = stbtt__new_buf(NULL, 0); cmap = stbtt__find_table(data, fontstart, "cmap"); // required info->loca = stbtt__find_table(data, fontstart, "loca"); // required info->head = stbtt__find_table(data, fontstart, "head"); // required info->glyf = stbtt__find_table(data, fontstart, "glyf"); // required info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required info->kern = stbtt__find_table(data, fontstart, "kern"); // not required info->gpos = stbtt__find_table(data, fontstart, "GPOS"); // not required if (!cmap || !info->head || !info->hhea || !info->hmtx) return 0; if (info->glyf) { // required for truetype if (!info->loca) return 0; } else { // initialization for CFF / Type2 fonts (OTF) stbtt__buf b, topdict, topdictidx; stbtt_uint32 cstype = 2, charstrings = 0, fdarrayoff = 0, fdselectoff = 0; stbtt_uint32 cff; cff = stbtt__find_table(data, fontstart, "CFF "); if (!cff) return 0; info->fontdicts = stbtt__new_buf(NULL, 0); info->fdselect = stbtt__new_buf(NULL, 0); // @TODO this should use size from table (not 512MB) info->cff = stbtt__new_buf(data+cff, 512*1024*1024); b = info->cff; // read the header stbtt__buf_skip(&b, 2); stbtt__buf_seek(&b, stbtt__buf_get8(&b)); // hdrsize // @TODO the name INDEX could list multiple fonts, // but we just use the first one. stbtt__cff_get_index(&b); // name INDEX topdictidx = stbtt__cff_get_index(&b); topdict = stbtt__cff_index_get(topdictidx, 0); stbtt__cff_get_index(&b); // string INDEX info->gsubrs = stbtt__cff_get_index(&b); stbtt__dict_get_ints(&topdict, 17, 1, &charstrings); stbtt__dict_get_ints(&topdict, 0x100 | 6, 1, &cstype); stbtt__dict_get_ints(&topdict, 0x100 | 36, 1, &fdarrayoff); stbtt__dict_get_ints(&topdict, 0x100 | 37, 1, &fdselectoff); info->subrs = stbtt__get_subrs(b, topdict); // we only support Type 2 charstrings if (cstype != 2) return 0; if (charstrings == 0) return 0; if (fdarrayoff) { // looks like a CID font if (!fdselectoff) return 0; stbtt__buf_seek(&b, fdarrayoff); info->fontdicts = stbtt__cff_get_index(&b); info->fdselect = stbtt__buf_range(&b, fdselectoff, b.size-fdselectoff); } stbtt__buf_seek(&b, charstrings); info->charstrings = stbtt__cff_get_index(&b); } t = stbtt__find_table(data, fontstart, "maxp"); if (t) info->numGlyphs = ttUSHORT(data+t+4); else info->numGlyphs = 0xffff; // find a cmap encoding table we understand *now* to avoid searching // later. (todo: could make this installable) // the same regardless of glyph. numTables = ttUSHORT(data + cmap + 2); info->index_map = 0; for (i=0; i < numTables; ++i) { stbtt_uint32 encoding_record = cmap + 4 + 8 * i; // find an encoding we understand: switch(ttUSHORT(data+encoding_record)) { case STBTT_PLATFORM_ID_MICROSOFT: switch (ttUSHORT(data+encoding_record+2)) { case STBTT_MS_EID_UNICODE_BMP: case STBTT_MS_EID_UNICODE_FULL: // MS/Unicode info->index_map = cmap + ttULONG(data+encoding_record+4); break; } break; case STBTT_PLATFORM_ID_UNICODE: // Mac/iOS has these // all the encodingIDs are unicode, so we don't bother to check it info->index_map = cmap + ttULONG(data+encoding_record+4); break; } } if (info->index_map == 0) return 0; info->indexToLocFormat = ttUSHORT(data+info->head + 50); return 1; } STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint) { stbtt_uint8 *data = info->data; stbtt_uint32 index_map = info->index_map; stbtt_uint16 format = ttUSHORT(data + index_map + 0); if (format == 0) { // apple byte encoding stbtt_int32 bytes = ttUSHORT(data + index_map + 2); if (unicode_codepoint < bytes-6) return ttBYTE(data + index_map + 6 + unicode_codepoint); return 0; } else if (format == 6) { stbtt_uint32 first = ttUSHORT(data + index_map + 6); stbtt_uint32 count = ttUSHORT(data + index_map + 8); if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count) return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2); return 0; } else if (format == 2) { STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean return 0; } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10); stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1; // do a binary search of the segments stbtt_uint32 endCount = index_map + 14; stbtt_uint32 search = endCount; if (unicode_codepoint > 0xffff) return 0; // they lie from endCount .. endCount + segCount // but searchRange is the nearest power of two, so... if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2)) search += rangeShift*2; // now decrement to bias correctly to find smallest search -= 2; while (entrySelector) { stbtt_uint16 end; searchRange >>= 1; end = ttUSHORT(data + search + searchRange*2); if (unicode_codepoint > end) search += searchRange*2; --entrySelector; } search += 2; { stbtt_uint16 offset, start; stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1); STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item)); start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); if (unicode_codepoint < start) return 0; offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); if (offset == 0) return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item)); return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); } } else if (format == 12 || format == 13) { stbtt_uint32 ngroups = ttULONG(data+index_map+12); stbtt_int32 low,high; low = 0; high = (stbtt_int32)ngroups; // Binary search the right group. while (low < high) { stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12); stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4); if ((stbtt_uint32) unicode_codepoint < start_char) high = mid; else if ((stbtt_uint32) unicode_codepoint > end_char) low = mid+1; else { stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8); if (format == 12) return start_glyph + unicode_codepoint-start_char; else // format == 13 return start_glyph; } } return 0; // not found } // @TODO STBTT_assert(0); return 0; } STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices) { return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices); } static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy) { v->type = type; v->x = (stbtt_int16) x; v->y = (stbtt_int16) y; v->cx = (stbtt_int16) cx; v->cy = (stbtt_int16) cy; } static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) { int g1,g2; STBTT_assert(!info->cff.size); if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format if (info->indexToLocFormat == 0) { g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; } else { g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4); g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4); } return g1==g2 ? -1 : g1; // if length is 0, return -1 } static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) { if (info->cff.size) { stbtt__GetGlyphInfoT2(info, glyph_index, x0, y0, x1, y1); } else { int g = stbtt__GetGlyfOffset(info, glyph_index); if (g < 0) return 0; if (x0) *x0 = ttSHORT(info->data + g + 2); if (y0) *y0 = ttSHORT(info->data + g + 4); if (x1) *x1 = ttSHORT(info->data + g + 6); if (y1) *y1 = ttSHORT(info->data + g + 8); } return 1; } STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1) { return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1); } STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index) { stbtt_int16 numberOfContours; int g; if (info->cff.size) return stbtt__GetGlyphInfoT2(info, glyph_index, NULL, NULL, NULL, NULL) == 0; g = stbtt__GetGlyfOffset(info, glyph_index); if (g < 0) return 1; numberOfContours = ttSHORT(info->data + g); return numberOfContours == 0; } static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_off, int start_off, stbtt_int32 sx, stbtt_int32 sy, stbtt_int32 scx, stbtt_int32 scy, stbtt_int32 cx, stbtt_int32 cy) { if (start_off) { if (was_off) stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy); stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, sx,sy,scx,scy); } else { if (was_off) stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); else stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); } return num_vertices; } static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) { stbtt_int16 numberOfContours; stbtt_uint8 *endPtsOfContours; stbtt_uint8 *data = info->data; stbtt_vertex *vertices=0; int num_vertices=0; int g = stbtt__GetGlyfOffset(info, glyph_index); *pvertices = NULL; if (g < 0) return 0; numberOfContours = ttSHORT(data + g); if (numberOfContours > 0) { stbtt_uint8 flags=0,flagcount; stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0; stbtt_int32 x,y,cx,cy,sx,sy, scx,scy; stbtt_uint8 *points; endPtsOfContours = (data + g + 10); ins = ttUSHORT(data + g + 10 + numberOfContours * 2); points = data + g + 10 + numberOfContours * 2 + 2 + ins; n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2); m = n + 2*numberOfContours; // a loose bound on how many vertices we might need vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata); if (vertices == 0) return 0; next_move = 0; flagcount=0; // in first pass, we load uninterpreted data into the allocated array // above, shifted to the end of the array so we won't overwrite it when // we create our final data starting from the front off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated // first load flags for (i=0; i < n; ++i) { if (flagcount == 0) { flags = *points++; if (flags & 8) flagcount = *points++; } else --flagcount; vertices[off+i].type = flags; } // now load x coordinates x=0; for (i=0; i < n; ++i) { flags = vertices[off+i].type; if (flags & 2) { stbtt_int16 dx = *points++; x += (flags & 16) ? dx : -dx; // ??? } else { if (!(flags & 16)) { x = x + (stbtt_int16) (points[0]*256 + points[1]); points += 2; } } vertices[off+i].x = (stbtt_int16) x; } // now load y coordinates y=0; for (i=0; i < n; ++i) { flags = vertices[off+i].type; if (flags & 4) { stbtt_int16 dy = *points++; y += (flags & 32) ? dy : -dy; // ??? } else { if (!(flags & 32)) { y = y + (stbtt_int16) (points[0]*256 + points[1]); points += 2; } } vertices[off+i].y = (stbtt_int16) y; } // now convert them to our format num_vertices=0; sx = sy = cx = cy = scx = scy = 0; for (i=0; i < n; ++i) { flags = vertices[off+i].type; x = (stbtt_int16) vertices[off+i].x; y = (stbtt_int16) vertices[off+i].y; if (next_move == i) { if (i != 0) num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); // now start the new one start_off = !(flags & 1); if (start_off) { // if we start off with an off-curve point, then when we need to find a point on the curve // where we can start, and we need to save some state for when we wraparound. scx = x; scy = y; if (!(vertices[off+i+1].type & 1)) { // next point is also a curve point, so interpolate an on-point curve sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1; sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1; } else { // otherwise just use the next point as our start point sx = (stbtt_int32) vertices[off+i+1].x; sy = (stbtt_int32) vertices[off+i+1].y; ++i; // we're using point i+1 as the starting point, so skip it } } else { sx = x; sy = y; } stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0); was_off = 0; next_move = 1 + ttUSHORT(endPtsOfContours+j*2); ++j; } else { if (!(flags & 1)) { // if it's a curve if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); cx = x; cy = y; was_off = 1; } else { if (was_off) stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy); else stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0); was_off = 0; } } } num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); } else if (numberOfContours == -1) { // Compound shapes. int more = 1; stbtt_uint8 *comp = data + g + 10; num_vertices = 0; vertices = 0; while (more) { stbtt_uint16 flags, gidx; int comp_num_verts = 0, i; stbtt_vertex *comp_verts = 0, *tmp = 0; float mtx[6] = {1,0,0,1,0,0}, m, n; flags = ttSHORT(comp); comp+=2; gidx = ttSHORT(comp); comp+=2; if (flags & 2) { // XY values if (flags & 1) { // shorts mtx[4] = ttSHORT(comp); comp+=2; mtx[5] = ttSHORT(comp); comp+=2; } else { mtx[4] = ttCHAR(comp); comp+=1; mtx[5] = ttCHAR(comp); comp+=1; } } else { // @TODO handle matching point STBTT_assert(0); } if (flags & (1<<3)) { // WE_HAVE_A_SCALE mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; mtx[1] = mtx[2] = 0; } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; mtx[1] = mtx[2] = 0; mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; mtx[1] = ttSHORT(comp)/16384.0f; comp+=2; mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; } // Find transformation scales. m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); // Get indexed glyph. comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts); if (comp_num_verts > 0) { // Transform vertices. for (i = 0; i < comp_num_verts; ++i) { stbtt_vertex* v = &comp_verts[i]; stbtt_vertex_type x,y; x=v->x; y=v->y; v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); x=v->cx; y=v->cy; v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); } // Append vertices. tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata); if (!tmp) { if (vertices) STBTT_free(vertices, info->userdata); if (comp_verts) STBTT_free(comp_verts, info->userdata); return 0; } if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); if (vertices) STBTT_free(vertices, info->userdata); vertices = tmp; STBTT_free(comp_verts, info->userdata); num_vertices += comp_num_verts; } // More components ? more = flags & (1<<5); } } else if (numberOfContours < 0) { // @TODO other compound variations? STBTT_assert(0); } else { // numberOfCounters == 0, do nothing } *pvertices = vertices; return num_vertices; } typedef struct { int bounds; int started; float first_x, first_y; float x, y; stbtt_int32 min_x, max_x, min_y, max_y; stbtt_vertex *pvertices; int num_vertices; } stbtt__csctx; #define STBTT__CSCTX_INIT(bounds) {bounds,0, 0,0, 0,0, 0,0,0,0, NULL, 0} static void stbtt__track_vertex(stbtt__csctx *c, stbtt_int32 x, stbtt_int32 y) { if (x > c->max_x || !c->started) c->max_x = x; if (y > c->max_y || !c->started) c->max_y = y; if (x < c->min_x || !c->started) c->min_x = x; if (y < c->min_y || !c->started) c->min_y = y; c->started = 1; } static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1) { if (c->bounds) { stbtt__track_vertex(c, x, y); if (type == STBTT_vcubic) { stbtt__track_vertex(c, cx, cy); stbtt__track_vertex(c, cx1, cy1); } } else { stbtt_setvertex(&c->pvertices[c->num_vertices], type, x, y, cx, cy); c->pvertices[c->num_vertices].cx1 = (stbtt_int16) cx1; c->pvertices[c->num_vertices].cy1 = (stbtt_int16) cy1; } c->num_vertices++; } static void stbtt__csctx_close_shape(stbtt__csctx *ctx) { if (ctx->first_x != ctx->x || ctx->first_y != ctx->y) stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0); } static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy) { stbtt__csctx_close_shape(ctx); ctx->first_x = ctx->x = ctx->x + dx; ctx->first_y = ctx->y = ctx->y + dy; stbtt__csctx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); } static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy) { ctx->x += dx; ctx->y += dy; stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); } static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) { float cx1 = ctx->x + dx1; float cy1 = ctx->y + dy1; float cx2 = cx1 + dx2; float cy2 = cy1 + dy2; ctx->x = cx2 + dx3; ctx->y = cy2 + dy3; stbtt__csctx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2); } static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n) { int count = stbtt__cff_index_count(&idx); int bias = 107; if (count >= 33900) bias = 32768; else if (count >= 1240) bias = 1131; n += bias; if (n < 0 || n >= count) return stbtt__new_buf(NULL, 0); return stbtt__cff_index_get(idx, n); } static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int glyph_index) { stbtt__buf fdselect = info->fdselect; int nranges, start, end, v, fmt, fdselector = -1, i; stbtt__buf_seek(&fdselect, 0); fmt = stbtt__buf_get8(&fdselect); if (fmt == 0) { // untested stbtt__buf_skip(&fdselect, glyph_index); fdselector = stbtt__buf_get8(&fdselect); } else if (fmt == 3) { nranges = stbtt__buf_get16(&fdselect); start = stbtt__buf_get16(&fdselect); for (i = 0; i < nranges; i++) { v = stbtt__buf_get8(&fdselect); end = stbtt__buf_get16(&fdselect); if (glyph_index >= start && glyph_index < end) { fdselector = v; break; } start = end; } } if (fdselector == -1) stbtt__new_buf(NULL, 0); return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector)); } static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, stbtt__csctx *c) { int in_header = 1, maskbits = 0, subr_stack_height = 0, sp = 0, v, i, b0; int has_subrs = 0, clear_stack; float s[48]; stbtt__buf subr_stack[10], subrs = info->subrs, b; float f; #define STBTT__CSERR(s) (0) // this currently ignores the initial width value, which isn't needed if we have hmtx b = stbtt__cff_index_get(info->charstrings, glyph_index); while (b.cursor < b.size) { i = 0; clear_stack = 1; b0 = stbtt__buf_get8(&b); switch (b0) { // @TODO implement hinting case 0x13: // hintmask case 0x14: // cntrmask if (in_header) maskbits += (sp / 2); // implicit "vstem" in_header = 0; stbtt__buf_skip(&b, (maskbits + 7) / 8); break; case 0x01: // hstem case 0x03: // vstem case 0x12: // hstemhm case 0x17: // vstemhm maskbits += (sp / 2); break; case 0x15: // rmoveto in_header = 0; if (sp < 2) return STBTT__CSERR("rmoveto stack"); stbtt__csctx_rmove_to(c, s[sp-2], s[sp-1]); break; case 0x04: // vmoveto in_header = 0; if (sp < 1) return STBTT__CSERR("vmoveto stack"); stbtt__csctx_rmove_to(c, 0, s[sp-1]); break; case 0x16: // hmoveto in_header = 0; if (sp < 1) return STBTT__CSERR("hmoveto stack"); stbtt__csctx_rmove_to(c, s[sp-1], 0); break; case 0x05: // rlineto if (sp < 2) return STBTT__CSERR("rlineto stack"); for (; i + 1 < sp; i += 2) stbtt__csctx_rline_to(c, s[i], s[i+1]); break; // hlineto/vlineto and vhcurveto/hvcurveto alternate horizontal and vertical // starting from a different place. case 0x07: // vlineto if (sp < 1) return STBTT__CSERR("vlineto stack"); goto vlineto; case 0x06: // hlineto if (sp < 1) return STBTT__CSERR("hlineto stack"); for (;;) { if (i >= sp) break; stbtt__csctx_rline_to(c, s[i], 0); i++; vlineto: if (i >= sp) break; stbtt__csctx_rline_to(c, 0, s[i]); i++; } break; case 0x1F: // hvcurveto if (sp < 4) return STBTT__CSERR("hvcurveto stack"); goto hvcurveto; case 0x1E: // vhcurveto if (sp < 4) return STBTT__CSERR("vhcurveto stack"); for (;;) { if (i + 3 >= sp) break; stbtt__csctx_rccurve_to(c, 0, s[i], s[i+1], s[i+2], s[i+3], (sp - i == 5) ? s[i + 4] : 0.0f); i += 4; hvcurveto: if (i + 3 >= sp) break; stbtt__csctx_rccurve_to(c, s[i], 0, s[i+1], s[i+2], (sp - i == 5) ? s[i+4] : 0.0f, s[i+3]); i += 4; } break; case 0x08: // rrcurveto if (sp < 6) return STBTT__CSERR("rcurveline stack"); for (; i + 5 < sp; i += 6) stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); break; case 0x18: // rcurveline if (sp < 8) return STBTT__CSERR("rcurveline stack"); for (; i + 5 < sp - 2; i += 6) stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); if (i + 1 >= sp) return STBTT__CSERR("rcurveline stack"); stbtt__csctx_rline_to(c, s[i], s[i+1]); break; case 0x19: // rlinecurve if (sp < 8) return STBTT__CSERR("rlinecurve stack"); for (; i + 1 < sp - 6; i += 2) stbtt__csctx_rline_to(c, s[i], s[i+1]); if (i + 5 >= sp) return STBTT__CSERR("rlinecurve stack"); stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); break; case 0x1A: // vvcurveto case 0x1B: // hhcurveto if (sp < 4) return STBTT__CSERR("(vv|hh)curveto stack"); f = 0.0; if (sp & 1) { f = s[i]; i++; } for (; i + 3 < sp; i += 4) { if (b0 == 0x1B) stbtt__csctx_rccurve_to(c, s[i], f, s[i+1], s[i+2], s[i+3], 0.0); else stbtt__csctx_rccurve_to(c, f, s[i], s[i+1], s[i+2], 0.0, s[i+3]); f = 0.0; } break; case 0x0A: // callsubr if (!has_subrs) { if (info->fdselect.size) subrs = stbtt__cid_get_glyph_subrs(info, glyph_index); has_subrs = 1; } // fallthrough case 0x1D: // callgsubr if (sp < 1) return STBTT__CSERR("call(g|)subr stack"); v = (int) s[--sp]; if (subr_stack_height >= 10) return STBTT__CSERR("recursion limit"); subr_stack[subr_stack_height++] = b; b = stbtt__get_subr(b0 == 0x0A ? subrs : info->gsubrs, v); if (b.size == 0) return STBTT__CSERR("subr not found"); b.cursor = 0; clear_stack = 0; break; case 0x0B: // return if (subr_stack_height <= 0) return STBTT__CSERR("return outside subr"); b = subr_stack[--subr_stack_height]; clear_stack = 0; break; case 0x0E: // endchar stbtt__csctx_close_shape(c); return 1; case 0x0C: { // two-byte escape float dx1, dx2, dx3, dx4, dx5, dx6, dy1, dy2, dy3, dy4, dy5, dy6; float dx, dy; int b1 = stbtt__buf_get8(&b); switch (b1) { // @TODO These "flex" implementations ignore the flex-depth and resolution, // and always draw beziers. case 0x22: // hflex if (sp < 7) return STBTT__CSERR("hflex stack"); dx1 = s[0]; dx2 = s[1]; dy2 = s[2]; dx3 = s[3]; dx4 = s[4]; dx5 = s[5]; dx6 = s[6]; stbtt__csctx_rccurve_to(c, dx1, 0, dx2, dy2, dx3, 0); stbtt__csctx_rccurve_to(c, dx4, 0, dx5, -dy2, dx6, 0); break; case 0x23: // flex if (sp < 13) return STBTT__CSERR("flex stack"); dx1 = s[0]; dy1 = s[1]; dx2 = s[2]; dy2 = s[3]; dx3 = s[4]; dy3 = s[5]; dx4 = s[6]; dy4 = s[7]; dx5 = s[8]; dy5 = s[9]; dx6 = s[10]; dy6 = s[11]; //fd is s[12] stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); break; case 0x24: // hflex1 if (sp < 9) return STBTT__CSERR("hflex1 stack"); dx1 = s[0]; dy1 = s[1]; dx2 = s[2]; dy2 = s[3]; dx3 = s[4]; dx4 = s[5]; dx5 = s[6]; dy5 = s[7]; dx6 = s[8]; stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, 0); stbtt__csctx_rccurve_to(c, dx4, 0, dx5, dy5, dx6, -(dy1+dy2+dy5)); break; case 0x25: // flex1 if (sp < 11) return STBTT__CSERR("flex1 stack"); dx1 = s[0]; dy1 = s[1]; dx2 = s[2]; dy2 = s[3]; dx3 = s[4]; dy3 = s[5]; dx4 = s[6]; dy4 = s[7]; dx5 = s[8]; dy5 = s[9]; dx6 = dy6 = s[10]; dx = dx1+dx2+dx3+dx4+dx5; dy = dy1+dy2+dy3+dy4+dy5; if (STBTT_fabs(dx) > STBTT_fabs(dy)) dy6 = -dy; else dx6 = -dx; stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); break; default: return STBTT__CSERR("unimplemented"); } } break; default: if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254)) return STBTT__CSERR("reserved operator"); // push immediate if (b0 == 255) { f = (float)(stbtt_int32)stbtt__buf_get32(&b) / 0x10000; } else { stbtt__buf_skip(&b, -1); f = (float)(stbtt_int16)stbtt__cff_int(&b); } if (sp >= 48) return STBTT__CSERR("push stack overflow"); s[sp++] = f; clear_stack = 0; break; } if (clear_stack) sp = 0; } return STBTT__CSERR("no endchar"); #undef STBTT__CSERR } static int stbtt__GetGlyphShapeT2(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) { // runs the charstring twice, once to count and once to output (to avoid realloc) stbtt__csctx count_ctx = STBTT__CSCTX_INIT(1); stbtt__csctx output_ctx = STBTT__CSCTX_INIT(0); if (stbtt__run_charstring(info, glyph_index, &count_ctx)) { *pvertices = (stbtt_vertex*)STBTT_malloc(count_ctx.num_vertices*sizeof(stbtt_vertex), info->userdata); output_ctx.pvertices = *pvertices; if (stbtt__run_charstring(info, glyph_index, &output_ctx)) { STBTT_assert(output_ctx.num_vertices == count_ctx.num_vertices); return output_ctx.num_vertices; } } *pvertices = NULL; return 0; } static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) { stbtt__csctx c = STBTT__CSCTX_INIT(1); int r = stbtt__run_charstring(info, glyph_index, &c); if (x0) *x0 = r ? c.min_x : 0; if (y0) *y0 = r ? c.min_y : 0; if (x1) *x1 = r ? c.max_x : 0; if (y1) *y1 = r ? c.max_y : 0; return r ? c.num_vertices : 0; } STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) { if (!info->cff.size) return stbtt__GetGlyphShapeTT(info, glyph_index, pvertices); else return stbtt__GetGlyphShapeT2(info, glyph_index, pvertices); } STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) { stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); if (glyph_index < numOfLongHorMetrics) { if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index); if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); } else { if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); } } static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) { stbtt_uint8 *data = info->data + info->kern; stbtt_uint32 needle, straw; int l, r, m; // we only look at the first table. it must be 'horizontal' and format 0. if (!info->kern) return 0; if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 return 0; if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format return 0; l = 0; r = ttUSHORT(data+10) - 1; needle = glyph1 << 16 | glyph2; while (l <= r) { m = (l + r) >> 1; straw = ttULONG(data+18+(m*6)); // note: unaligned read if (needle < straw) r = m - 1; else if (needle > straw) l = m + 1; else return ttSHORT(data+22+(m*6)); } return 0; } static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph) { stbtt_uint16 coverageFormat = ttUSHORT(coverageTable); switch(coverageFormat) { case 1: { stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2); // Binary search. stbtt_int32 l=0, r=glyphCount-1, m; int straw, needle=glyph; while (l <= r) { stbtt_uint8 *glyphArray = coverageTable + 4; stbtt_uint16 glyphID; m = (l + r) >> 1; glyphID = ttUSHORT(glyphArray + 2 * m); straw = glyphID; if (needle < straw) r = m - 1; else if (needle > straw) l = m + 1; else { return m; } } } break; case 2: { stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2); stbtt_uint8 *rangeArray = coverageTable + 4; // Binary search. stbtt_int32 l=0, r=rangeCount-1, m; int strawStart, strawEnd, needle=glyph; while (l <= r) { stbtt_uint8 *rangeRecord; m = (l + r) >> 1; rangeRecord = rangeArray + 6 * m; strawStart = ttUSHORT(rangeRecord); strawEnd = ttUSHORT(rangeRecord + 2); if (needle < strawStart) r = m - 1; else if (needle > strawEnd) l = m + 1; else { stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4); return startCoverageIndex + glyph - strawStart; } } } break; default: { // There are no other cases. STBTT_assert(0); } break; } return -1; } static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph) { stbtt_uint16 classDefFormat = ttUSHORT(classDefTable); switch(classDefFormat) { case 1: { stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2); stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4); stbtt_uint8 *classDef1ValueArray = classDefTable + 6; if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount) return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID)); classDefTable = classDef1ValueArray + 2 * glyphCount; } break; case 2: { stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2); stbtt_uint8 *classRangeRecords = classDefTable + 4; // Binary search. stbtt_int32 l=0, r=classRangeCount-1, m; int strawStart, strawEnd, needle=glyph; while (l <= r) { stbtt_uint8 *classRangeRecord; m = (l + r) >> 1; classRangeRecord = classRangeRecords + 6 * m; strawStart = ttUSHORT(classRangeRecord); strawEnd = ttUSHORT(classRangeRecord + 2); if (needle < strawStart) r = m - 1; else if (needle > strawEnd) l = m + 1; else return (stbtt_int32)ttUSHORT(classRangeRecord + 4); } classDefTable = classRangeRecords + 6 * classRangeCount; } break; default: { // There are no other cases. STBTT_assert(0); } break; } return -1; } // Define to STBTT_assert(x) if you want to break on unimplemented formats. #define STBTT_GPOS_TODO_assert(x) static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) { stbtt_uint16 lookupListOffset; stbtt_uint8 *lookupList; stbtt_uint16 lookupCount; stbtt_uint8 *data; stbtt_int32 i; if (!info->gpos) return 0; data = info->data + info->gpos; if (ttUSHORT(data+0) != 1) return 0; // Major version 1 if (ttUSHORT(data+2) != 0) return 0; // Minor version 0 lookupListOffset = ttUSHORT(data+8); lookupList = data + lookupListOffset; lookupCount = ttUSHORT(lookupList); for (i=0; i> 1; pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m; secondGlyph = ttUSHORT(pairValue); straw = secondGlyph; if (needle < straw) r = m - 1; else if (needle > straw) l = m + 1; else { stbtt_int16 xAdvance = ttSHORT(pairValue + 2); return xAdvance; } } } break; case 2: { stbtt_uint16 valueFormat1 = ttUSHORT(table + 4); stbtt_uint16 valueFormat2 = ttUSHORT(table + 6); stbtt_uint16 classDef1Offset = ttUSHORT(table + 8); stbtt_uint16 classDef2Offset = ttUSHORT(table + 10); int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1); int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2); stbtt_uint16 class1Count = ttUSHORT(table + 12); stbtt_uint16 class2Count = ttUSHORT(table + 14); STBTT_assert(glyph1class < class1Count); STBTT_assert(glyph2class < class2Count); // TODO: Support more formats. STBTT_GPOS_TODO_assert(valueFormat1 == 4); if (valueFormat1 != 4) return 0; STBTT_GPOS_TODO_assert(valueFormat2 == 0); if (valueFormat2 != 0) return 0; if (glyph1class >= 0 && glyph1class < class1Count && glyph2class >= 0 && glyph2class < class2Count) { stbtt_uint8 *class1Records = table + 16; stbtt_uint8 *class2Records = class1Records + 2 * (glyph1class * class2Count); stbtt_int16 xAdvance = ttSHORT(class2Records + 2 * glyph2class); return xAdvance; } } break; default: { // There are no other cases. STBTT_assert(0); break; }; } } break; }; default: // TODO: Implement other stuff. break; } } return 0; } STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int g1, int g2) { int xAdvance = 0; if (info->gpos) xAdvance += stbtt__GetGlyphGPOSInfoAdvance(info, g1, g2); if (info->kern) xAdvance += stbtt__GetGlyphKernInfoAdvance(info, g1, g2); return xAdvance; } STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2) { if (!info->kern && !info->gpos) // if no kerning table, don't waste time looking up both codepoint->glyphs return 0; return stbtt_GetGlyphKernAdvance(info, stbtt_FindGlyphIndex(info,ch1), stbtt_FindGlyphIndex(info,ch2)); } STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing) { stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing); } STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap) { if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4); if (descent) *descent = ttSHORT(info->data+info->hhea + 6); if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8); } STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap) { int tab = stbtt__find_table(info->data, info->fontstart, "OS/2"); if (!tab) return 0; if (typoAscent ) *typoAscent = ttSHORT(info->data+tab + 68); if (typoDescent) *typoDescent = ttSHORT(info->data+tab + 70); if (typoLineGap) *typoLineGap = ttSHORT(info->data+tab + 72); return 1; } STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1) { *x0 = ttSHORT(info->data + info->head + 36); *y0 = ttSHORT(info->data + info->head + 38); *x1 = ttSHORT(info->data + info->head + 40); *y1 = ttSHORT(info->data + info->head + 42); } STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height) { int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6); return (float) height / fheight; } STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels) { int unitsPerEm = ttUSHORT(info->data + info->head + 18); return pixels / unitsPerEm; } STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v) { STBTT_free(v, info->userdata); } ////////////////////////////////////////////////////////////////////////////// // // antialiasing software rasterizer // STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) { int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) { // e.g. space character if (ix0) *ix0 = 0; if (iy0) *iy0 = 0; if (ix1) *ix1 = 0; if (iy1) *iy1 = 0; } else { // move to integral bboxes (treating pixels as little squares, what pixels get touched)? if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x); if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y); if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x); if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y); } } STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) { stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1); } STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) { stbtt_GetGlyphBitmapBoxSubpixel(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y,shift_x,shift_y, ix0,iy0,ix1,iy1); } STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) { stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1); } ////////////////////////////////////////////////////////////////////////////// // // Rasterizer typedef struct stbtt__hheap_chunk { struct stbtt__hheap_chunk *next; } stbtt__hheap_chunk; typedef struct stbtt__hheap { struct stbtt__hheap_chunk *head; void *first_free; int num_remaining_in_head_chunk; } stbtt__hheap; static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata) { if (hh->first_free) { void *p = hh->first_free; hh->first_free = * (void **) p; return p; } else { if (hh->num_remaining_in_head_chunk == 0) { int count = (size < 32 ? 2000 : size < 128 ? 800 : 100); stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata); if (c == NULL) return NULL; c->next = hh->head; hh->head = c; hh->num_remaining_in_head_chunk = count; } --hh->num_remaining_in_head_chunk; return (char *) (hh->head) + sizeof(stbtt__hheap_chunk) + size * hh->num_remaining_in_head_chunk; } } static void stbtt__hheap_free(stbtt__hheap *hh, void *p) { *(void **) p = hh->first_free; hh->first_free = p; } static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata) { stbtt__hheap_chunk *c = hh->head; while (c) { stbtt__hheap_chunk *n = c->next; STBTT_free(c, userdata); c = n; } } typedef struct stbtt__edge { float x0,y0, x1,y1; int invert; } stbtt__edge; typedef struct stbtt__active_edge { struct stbtt__active_edge *next; #if STBTT_RASTERIZER_VERSION==1 int x,dx; float ey; int direction; #elif STBTT_RASTERIZER_VERSION==2 float fx,fdx,fdy; float direction; float sy; float ey; #else #error "Unrecognized value of STBTT_RASTERIZER_VERSION" #endif } stbtt__active_edge; #if STBTT_RASTERIZER_VERSION == 1 #define STBTT_FIXSHIFT 10 #define STBTT_FIX (1 << STBTT_FIXSHIFT) #define STBTT_FIXMASK (STBTT_FIX-1) static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) { stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); STBTT_assert(z != NULL); if (!z) return z; // round dx down to avoid overshooting if (dxdy < 0) z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); else z->dx = STBTT_ifloor(STBTT_FIX * dxdy); z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount z->x -= off_x * STBTT_FIX; z->ey = e->y1; z->next = 0; z->direction = e->invert ? 1 : -1; return z; } #elif STBTT_RASTERIZER_VERSION == 2 static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) { stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); STBTT_assert(z != NULL); //STBTT_assert(e->y0 <= start_point); if (!z) return z; z->fdx = dxdy; z->fdy = dxdy != 0.0f ? (1.0f/dxdy) : 0.0f; z->fx = e->x0 + dxdy * (start_point - e->y0); z->fx -= off_x; z->direction = e->invert ? 1.0f : -1.0f; z->sy = e->y0; z->ey = e->y1; z->next = 0; return z; } #else #error "Unrecognized value of STBTT_RASTERIZER_VERSION" #endif #if STBTT_RASTERIZER_VERSION == 1 // note: this routine clips fills that extend off the edges... ideally this // wouldn't happen, but it could happen if the truetype glyph bounding boxes // are wrong, or if the user supplies a too-small bitmap static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight) { // non-zero winding fill int x0=0, w=0; while (e) { if (w == 0) { // if we're currently at zero, we need to record the edge start point x0 = e->x; w += e->direction; } else { int x1 = e->x; w += e->direction; // if we went to zero, we need to draw if (w == 0) { int i = x0 >> STBTT_FIXSHIFT; int j = x1 >> STBTT_FIXSHIFT; if (i < len && j >= 0) { if (i == j) { // x0,x1 are the same pixel, so compute combined coverage scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT); } else { if (i >= 0) // add antialiasing for x0 scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT); else i = -1; // clip if (j < len) // add antialiasing for x1 scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT); else j = len; // clip for (++i; i < j; ++i) // fill pixels between x0 and x1 scanline[i] = scanline[i] + (stbtt_uint8) max_weight; } } } } e = e->next; } } static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) { stbtt__hheap hh = { 0, 0, 0 }; stbtt__active_edge *active = NULL; int y,j=0; int max_weight = (255 / vsubsample); // weight per vertical scanline int s; // vertical subsample index unsigned char scanline_data[512], *scanline; if (result->w > 512) scanline = (unsigned char *) STBTT_malloc(result->w, userdata); else scanline = scanline_data; y = off_y * vsubsample; e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; while (j < result->h) { STBTT_memset(scanline, 0, result->w); for (s=0; s < vsubsample; ++s) { // find center of pixel for this scanline float scan_y = y + 0.5f; stbtt__active_edge **step = &active; // update all active edges; // remove all active edges that terminate before the center of this scanline while (*step) { stbtt__active_edge * z = *step; if (z->ey <= scan_y) { *step = z->next; // delete from list STBTT_assert(z->direction); z->direction = 0; stbtt__hheap_free(&hh, z); } else { z->x += z->dx; // advance to position for current scanline step = &((*step)->next); // advance through list } } // resort the list if needed for(;;) { int changed=0; step = &active; while (*step && (*step)->next) { if ((*step)->x > (*step)->next->x) { stbtt__active_edge *t = *step; stbtt__active_edge *q = t->next; t->next = q->next; q->next = t; *step = q; changed = 1; } step = &(*step)->next; } if (!changed) break; } // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline while (e->y0 <= scan_y) { if (e->y1 > scan_y) { stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata); if (z != NULL) { // find insertion point if (active == NULL) active = z; else if (z->x < active->x) { // insert at front z->next = active; active = z; } else { // find thing to insert AFTER stbtt__active_edge *p = active; while (p->next && p->next->x < z->x) p = p->next; // at this point, p->next->x is NOT < z->x z->next = p->next; p->next = z; } } } ++e; } // now process all active edges in XOR fashion if (active) stbtt__fill_active_edges(scanline, result->w, active, max_weight); ++y; } STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w); ++j; } stbtt__hheap_cleanup(&hh, userdata); if (scanline != scanline_data) STBTT_free(scanline, userdata); } #elif STBTT_RASTERIZER_VERSION == 2 // the edge passed in here does not cross the vertical line at x or the vertical line at x+1 // (i.e. it has already been clipped to those) static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1) { if (y0 == y1) return; STBTT_assert(y0 < y1); STBTT_assert(e->sy <= e->ey); if (y0 > e->ey) return; if (y1 < e->sy) return; if (y0 < e->sy) { x0 += (x1-x0) * (e->sy - y0) / (y1-y0); y0 = e->sy; } if (y1 > e->ey) { x1 += (x1-x0) * (e->ey - y1) / (y1-y0); y1 = e->ey; } if (x0 == x) STBTT_assert(x1 <= x+1); else if (x0 == x+1) STBTT_assert(x1 >= x); else if (x0 <= x) STBTT_assert(x1 <= x); else if (x0 >= x+1) STBTT_assert(x1 >= x+1); else STBTT_assert(x1 >= x && x1 <= x+1); if (x0 <= x && x1 <= x) scanline[x] += e->direction * (y1-y0); else if (x0 >= x+1 && x1 >= x+1) ; else { STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1); scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position } } static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top) { float y_bottom = y_top+1; while (e) { // brute force every pixel // compute intersection points with top & bottom STBTT_assert(e->ey >= y_top); if (e->fdx == 0) { float x0 = e->fx; if (x0 < len) { if (x0 >= 0) { stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom); stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom); } else { stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom); } } } else { float x0 = e->fx; float dx = e->fdx; float xb = x0 + dx; float x_top, x_bottom; float sy0,sy1; float dy = e->fdy; STBTT_assert(e->sy <= y_bottom && e->ey >= y_top); // compute endpoints of line segment clipped to this scanline (if the // line segment starts on this scanline. x0 is the intersection of the // line with y_top, but that may be off the line segment. if (e->sy > y_top) { x_top = x0 + dx * (e->sy - y_top); sy0 = e->sy; } else { x_top = x0; sy0 = y_top; } if (e->ey < y_bottom) { x_bottom = x0 + dx * (e->ey - y_top); sy1 = e->ey; } else { x_bottom = xb; sy1 = y_bottom; } if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) { // from here on, we don't have to range check x values if ((int) x_top == (int) x_bottom) { float height; // simple case, only spans one pixel int x = (int) x_top; height = sy1 - sy0; STBTT_assert(x >= 0 && x < len); scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height; scanline_fill[x] += e->direction * height; // everything right of this pixel is filled } else { int x,x1,x2; float y_crossing, step, sign, area; // covers 2+ pixels if (x_top > x_bottom) { // flip scanline vertically; signed area is the same float t; sy0 = y_bottom - (sy0 - y_top); sy1 = y_bottom - (sy1 - y_top); t = sy0, sy0 = sy1, sy1 = t; t = x_bottom, x_bottom = x_top, x_top = t; dx = -dx; dy = -dy; t = x0, x0 = xb, xb = t; } x1 = (int) x_top; x2 = (int) x_bottom; // compute intersection with y axis at x1+1 y_crossing = (x1+1 - x0) * dy + y_top; sign = e->direction; // area of the rectangle covered from y0..y_crossing area = sign * (y_crossing-sy0); // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2); step = sign * dy; for (x = x1+1; x < x2; ++x) { scanline[x] += area + step/2; area += step; } y_crossing += dy * (x2 - (x1+1)); STBTT_assert(STBTT_fabs(area) <= 1.01f); scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing); scanline_fill[x2] += sign * (sy1-sy0); } } else { // if edge goes outside of box we're drawing, we require // clipping logic. since this does not match the intended use // of this library, we use a different, very slow brute // force implementation int x; for (x=0; x < len; ++x) { // cases: // // there can be up to two intersections with the pixel. any intersection // with left or right edges can be handled by splitting into two (or three) // regions. intersections with top & bottom do not necessitate case-wise logic. // // the old way of doing this found the intersections with the left & right edges, // then used some simple logic to produce up to three segments in sorted order // from top-to-bottom. however, this had a problem: if an x edge was epsilon // across the x border, then the corresponding y position might not be distinct // from the other y segment, and it might ignored as an empty segment. to avoid // that, we need to explicitly produce segments based on x positions. // rename variables to clearly-defined pairs float y0 = y_top; float x1 = (float) (x); float x2 = (float) (x+1); float x3 = xb; float y3 = y_bottom; // x = e->x + e->dx * (y-y_top) // (y-y_top) = (x - e->x) / e->dx // y = (x - e->x) / e->dx + y_top float y1 = (x - x0) / dx + y_top; float y2 = (x+1 - x0) / dx + y_top; if (x0 < x1 && x3 > x2) { // three segments descending down-right stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2); stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); } else if (x3 < x1 && x0 > x2) { // three segments descending down-left stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1); stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); } else { // one segment stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3); } } } } e = e->next; } } // directly AA rasterize edges w/o supersampling static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) { stbtt__hheap hh = { 0, 0, 0 }; stbtt__active_edge *active = NULL; int y,j=0, i; float scanline_data[129], *scanline, *scanline2; STBTT__NOTUSED(vsubsample); if (result->w > 64) scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); else scanline = scanline_data; scanline2 = scanline + result->w; y = off_y; e[n].y0 = (float) (off_y + result->h) + 1; while (j < result->h) { // find center of pixel for this scanline float scan_y_top = y + 0.0f; float scan_y_bottom = y + 1.0f; stbtt__active_edge **step = &active; STBTT_memset(scanline , 0, result->w*sizeof(scanline[0])); STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0])); // update all active edges; // remove all active edges that terminate before the top of this scanline while (*step) { stbtt__active_edge * z = *step; if (z->ey <= scan_y_top) { *step = z->next; // delete from list STBTT_assert(z->direction); z->direction = 0; stbtt__hheap_free(&hh, z); } else { step = &((*step)->next); // advance through list } } // insert all edges that start before the bottom of this scanline while (e->y0 <= scan_y_bottom) { if (e->y0 != e->y1) { stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); if (z != NULL) { STBTT_assert(z->ey >= scan_y_top); // insert at front z->next = active; active = z; } } ++e; } // now process all active edges if (active) stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); { float sum = 0; for (i=0; i < result->w; ++i) { float k; int m; sum += scanline2[i]; k = scanline[i] + sum; k = (float) STBTT_fabs(k)*255 + 0.5f; m = (int) k; if (m > 255) m = 255; result->pixels[j*result->stride + i] = (unsigned char) m; } } // advance all the edges step = &active; while (*step) { stbtt__active_edge *z = *step; z->fx += z->fdx; // advance to position for current scanline step = &((*step)->next); // advance through list } ++y; ++j; } stbtt__hheap_cleanup(&hh, userdata); if (scanline != scanline_data) STBTT_free(scanline, userdata); } #else #error "Unrecognized value of STBTT_RASTERIZER_VERSION" #endif #define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0) static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n) { int i,j; for (i=1; i < n; ++i) { stbtt__edge t = p[i], *a = &t; j = i; while (j > 0) { stbtt__edge *b = &p[j-1]; int c = STBTT__COMPARE(a,b); if (!c) break; p[j] = p[j-1]; --j; } if (i != j) p[j] = t; } } static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n) { /* threshhold for transitioning to insertion sort */ while (n > 12) { stbtt__edge t; int c01,c12,c,m,i,j; /* compute median of three */ m = n >> 1; c01 = STBTT__COMPARE(&p[0],&p[m]); c12 = STBTT__COMPARE(&p[m],&p[n-1]); /* if 0 >= mid >= end, or 0 < mid < end, then use mid */ if (c01 != c12) { /* otherwise, we'll need to swap something else to middle */ int z; c = STBTT__COMPARE(&p[0],&p[n-1]); /* 0>mid && midn => n; 0 0 */ /* 0n: 0>n => 0; 0 n */ z = (c == c12) ? 0 : n-1; t = p[z]; p[z] = p[m]; p[m] = t; } /* now p[m] is the median-of-three */ /* swap it to the beginning so it won't move around */ t = p[0]; p[0] = p[m]; p[m] = t; /* partition loop */ i=1; j=n-1; for(;;) { /* handling of equality is crucial here */ /* for sentinels & efficiency with duplicates */ for (;;++i) { if (!STBTT__COMPARE(&p[i], &p[0])) break; } for (;;--j) { if (!STBTT__COMPARE(&p[0], &p[j])) break; } /* make sure we haven't crossed */ if (i >= j) break; t = p[i]; p[i] = p[j]; p[j] = t; ++i; --j; } /* recurse on smaller side, iterate on larger */ if (j < (n-i)) { stbtt__sort_edges_quicksort(p,j); p = p+i; n = n-i; } else { stbtt__sort_edges_quicksort(p+i, n-i); n = j; } } } static void stbtt__sort_edges(stbtt__edge *p, int n) { stbtt__sort_edges_quicksort(p, n); stbtt__sort_edges_ins_sort(p, n); } typedef struct { float x,y; } stbtt__point; static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata) { float y_scale_inv = invert ? -scale_y : scale_y; stbtt__edge *e; int n,i,j,k,m; #if STBTT_RASTERIZER_VERSION == 1 int vsubsample = result->h < 8 ? 15 : 5; #elif STBTT_RASTERIZER_VERSION == 2 int vsubsample = 1; #else #error "Unrecognized value of STBTT_RASTERIZER_VERSION" #endif // vsubsample should divide 255 evenly; otherwise we won't reach full opacity // now we have to blow out the windings into explicit edge lists n = 0; for (i=0; i < windings; ++i) n += wcount[i]; e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel if (e == 0) return; n = 0; m=0; for (i=0; i < windings; ++i) { stbtt__point *p = pts + m; m += wcount[i]; j = wcount[i]-1; for (k=0; k < wcount[i]; j=k++) { int a=k,b=j; // skip the edge if horizontal if (p[j].y == p[k].y) continue; // add edge from j to k to the list e[n].invert = 0; if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { e[n].invert = 1; a=j,b=k; } e[n].x0 = p[a].x * scale_x + shift_x; e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample; e[n].x1 = p[b].x * scale_x + shift_x; e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample; ++n; } } // now sort the edges by their highest point (should snap to integer, and then by x) //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); stbtt__sort_edges(e, n); // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata); STBTT_free(e, userdata); } static void stbtt__add_point(stbtt__point *points, int n, float x, float y) { if (!points) return; // during first pass, it's unallocated points[n].x = x; points[n].y = y; } // tesselate until threshhold p is happy... @TODO warped to compensate for non-linear stretching static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) { // midpoint float mx = (x0 + 2*x1 + x2)/4; float my = (y0 + 2*y1 + y2)/4; // versus directly drawn line float dx = (x0+x2)/2 - mx; float dy = (y0+y2)/2 - my; if (n > 16) // 65536 segments on one curve better be enough! return 1; if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); } else { stbtt__add_point(points, *num_points,x2,y2); *num_points = *num_points+1; } return 1; } static void stbtt__tesselate_cubic(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float objspace_flatness_squared, int n) { // @TODO this "flatness" calculation is just made-up nonsense that seems to work well enough float dx0 = x1-x0; float dy0 = y1-y0; float dx1 = x2-x1; float dy1 = y2-y1; float dx2 = x3-x2; float dy2 = y3-y2; float dx = x3-x0; float dy = y3-y0; float longlen = (float) (STBTT_sqrt(dx0*dx0+dy0*dy0)+STBTT_sqrt(dx1*dx1+dy1*dy1)+STBTT_sqrt(dx2*dx2+dy2*dy2)); float shortlen = (float) STBTT_sqrt(dx*dx+dy*dy); float flatness_squared = longlen*longlen-shortlen*shortlen; if (n > 16) // 65536 segments on one curve better be enough! return; if (flatness_squared > objspace_flatness_squared) { float x01 = (x0+x1)/2; float y01 = (y0+y1)/2; float x12 = (x1+x2)/2; float y12 = (y1+y2)/2; float x23 = (x2+x3)/2; float y23 = (y2+y3)/2; float xa = (x01+x12)/2; float ya = (y01+y12)/2; float xb = (x12+x23)/2; float yb = (y12+y23)/2; float mx = (xa+xb)/2; float my = (ya+yb)/2; stbtt__tesselate_cubic(points, num_points, x0,y0, x01,y01, xa,ya, mx,my, objspace_flatness_squared,n+1); stbtt__tesselate_cubic(points, num_points, mx,my, xb,yb, x23,y23, x3,y3, objspace_flatness_squared,n+1); } else { stbtt__add_point(points, *num_points,x3,y3); *num_points = *num_points+1; } } // returns number of contours static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) { stbtt__point *points=0; int num_points=0; float objspace_flatness_squared = objspace_flatness * objspace_flatness; int i,n=0,start=0, pass; // count how many "moves" there are to get the contour count for (i=0; i < num_verts; ++i) if (vertices[i].type == STBTT_vmove) ++n; *num_contours = n; if (n == 0) return 0; *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata); if (*contour_lengths == 0) { *num_contours = 0; return 0; } // make two passes through the points so we don't need to realloc for (pass=0; pass < 2; ++pass) { float x=0,y=0; if (pass == 1) { points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata); if (points == NULL) goto error; } num_points = 0; n= -1; for (i=0; i < num_verts; ++i) { switch (vertices[i].type) { case STBTT_vmove: // start the next contour if (n >= 0) (*contour_lengths)[n] = num_points - start; ++n; start = num_points; x = vertices[i].x, y = vertices[i].y; stbtt__add_point(points, num_points++, x,y); break; case STBTT_vline: x = vertices[i].x, y = vertices[i].y; stbtt__add_point(points, num_points++, x, y); break; case STBTT_vcurve: stbtt__tesselate_curve(points, &num_points, x,y, vertices[i].cx, vertices[i].cy, vertices[i].x, vertices[i].y, objspace_flatness_squared, 0); x = vertices[i].x, y = vertices[i].y; break; case STBTT_vcubic: stbtt__tesselate_cubic(points, &num_points, x,y, vertices[i].cx, vertices[i].cy, vertices[i].cx1, vertices[i].cy1, vertices[i].x, vertices[i].y, objspace_flatness_squared, 0); x = vertices[i].x, y = vertices[i].y; break; } } (*contour_lengths)[n] = num_points - start; } return points; error: STBTT_free(points, userdata); STBTT_free(*contour_lengths, userdata); *contour_lengths = 0; *num_contours = 0; return NULL; } STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void *userdata) { float scale = scale_x > scale_y ? scale_y : scale_x; int winding_count = 0; int *winding_lengths = NULL; stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata); if (windings) { stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, userdata); STBTT_free(winding_lengths, userdata); STBTT_free(windings, userdata); } } STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) { STBTT_free(bitmap, userdata); } STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff) { int ix0,iy0,ix1,iy1; stbtt__bitmap gbm; stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); if (scale_x == 0) scale_x = scale_y; if (scale_y == 0) { if (scale_x == 0) { STBTT_free(vertices, info->userdata); return NULL; } scale_y = scale_x; } stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,&ix1,&iy1); // now we get the size gbm.w = (ix1 - ix0); gbm.h = (iy1 - iy0); gbm.pixels = NULL; // in case we error if (width ) *width = gbm.w; if (height) *height = gbm.h; if (xoff ) *xoff = ix0; if (yoff ) *yoff = iy0; if (gbm.w && gbm.h) { gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); if (gbm.pixels) { gbm.stride = gbm.w; stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0, iy0, 1, info->userdata); } } STBTT_free(vertices, info->userdata); return gbm.pixels; } STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, 0.0f, 0.0f, glyph, width, height, xoff, yoff); } STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph) { int ix0,iy0; stbtt_vertex *vertices; int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); stbtt__bitmap gbm; stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); gbm.pixels = output; gbm.w = out_w; gbm.h = out_h; gbm.stride = out_stride; if (gbm.w && gbm.h) stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata); STBTT_free(vertices, info->userdata); } STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) { stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, glyph); } STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); } STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint) { stbtt_MakeGlyphBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, stbtt_FindGlyphIndex(info,codepoint)); } STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) { stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, stbtt_FindGlyphIndex(info,codepoint)); } STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); } STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) { stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, codepoint); } ////////////////////////////////////////////////////////////////////////////// // // bitmap baking // // This is SUPER-CRAPPY packing to keep source code small static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) float pixel_height, // height of font in pixels unsigned char *pixels, int pw, int ph, // bitmap to be filled in int first_char, int num_chars, // characters to bake stbtt_bakedchar *chardata) { float scale; int x,y,bottom_y, i; stbtt_fontinfo f; f.userdata = NULL; if (!stbtt_InitFont(&f, data, offset)) return -1; STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels x=y=1; bottom_y = 1; scale = stbtt_ScaleForPixelHeight(&f, pixel_height); for (i=0; i < num_chars; ++i) { int advance, lsb, x0,y0,x1,y1,gw,gh; int g = stbtt_FindGlyphIndex(&f, first_char + i); stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb); stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1); gw = x1-x0; gh = y1-y0; if (x + gw + 1 >= pw) y = bottom_y, x = 1; // advance to next row if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row return -i; STBTT_assert(x+gw < pw); STBTT_assert(y+gh < ph); stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g); chardata[i].x0 = (stbtt_int16) x; chardata[i].y0 = (stbtt_int16) y; chardata[i].x1 = (stbtt_int16) (x + gw); chardata[i].y1 = (stbtt_int16) (y + gh); chardata[i].xadvance = scale * advance; chardata[i].xoff = (float) x0; chardata[i].yoff = (float) y0; x = x + gw + 1; if (y+gh+1 > bottom_y) bottom_y = y+gh+1; } return bottom_y; } STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule) { float d3d_bias = opengl_fillrule ? 0 : -0.5f; float ipw = 1.0f / pw, iph = 1.0f / ph; const stbtt_bakedchar *b = chardata + char_index; int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f); int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f); q->x0 = round_x + d3d_bias; q->y0 = round_y + d3d_bias; q->x1 = round_x + b->x1 - b->x0 + d3d_bias; q->y1 = round_y + b->y1 - b->y0 + d3d_bias; q->s0 = b->x0 * ipw; q->t0 = b->y0 * iph; q->s1 = b->x1 * ipw; q->t1 = b->y1 * iph; *xpos += b->xadvance; } ////////////////////////////////////////////////////////////////////////////// // // rectangle packing replacement routines if you don't have stb_rect_pack.h // #ifndef STB_RECT_PACK_VERSION typedef int stbrp_coord; //////////////////////////////////////////////////////////////////////////////////// // // // // // COMPILER WARNING ?!?!? // // // // // // if you get a compile warning due to these symbols being defined more than // // once, move #include "stb_rect_pack.h" before #include "stb_truetype.h" // // // //////////////////////////////////////////////////////////////////////////////////// typedef struct { int width,height; int x,y,bottom_y; } stbrp_context; typedef struct { unsigned char x; } stbrp_node; struct stbrp_rect { stbrp_coord x,y; int id,w,h,was_packed; }; static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes) { con->width = pw; con->height = ph; con->x = 0; con->y = 0; con->bottom_y = 0; STBTT__NOTUSED(nodes); STBTT__NOTUSED(num_nodes); } static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) { int i; for (i=0; i < num_rects; ++i) { if (con->x + rects[i].w > con->width) { con->x = 0; con->y = con->bottom_y; } if (con->y + rects[i].h > con->height) break; rects[i].x = con->x; rects[i].y = con->y; rects[i].was_packed = 1; con->x += rects[i].w; if (con->y + rects[i].h > con->bottom_y) con->bottom_y = con->y + rects[i].h; } for ( ; i < num_rects; ++i) rects[i].was_packed = 0; } #endif ////////////////////////////////////////////////////////////////////////////// // // bitmap baking // // This is SUPER-AWESOME (tm Ryan Gordon) packing using stb_rect_pack.h. If // stb_rect_pack.h isn't available, it uses the BakeFontBitmap strategy. STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context) { stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context); int num_nodes = pw - padding; stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context); if (context == NULL || nodes == NULL) { if (context != NULL) STBTT_free(context, alloc_context); if (nodes != NULL) STBTT_free(nodes , alloc_context); return 0; } spc->user_allocator_context = alloc_context; spc->width = pw; spc->height = ph; spc->pixels = pixels; spc->pack_info = context; spc->nodes = nodes; spc->padding = padding; spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw; spc->h_oversample = 1; spc->v_oversample = 1; stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); if (pixels) STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels return 1; } STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc) { STBTT_free(spc->nodes , spc->user_allocator_context); STBTT_free(spc->pack_info, spc->user_allocator_context); } STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample) { STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE); STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE); if (h_oversample <= STBTT_MAX_OVERSAMPLE) spc->h_oversample = h_oversample; if (v_oversample <= STBTT_MAX_OVERSAMPLE) spc->v_oversample = v_oversample; } #define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1) static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) { unsigned char buffer[STBTT_MAX_OVERSAMPLE]; int safe_w = w - kernel_width; int j; STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze for (j=0; j < h; ++j) { int i; unsigned int total; STBTT_memset(buffer, 0, kernel_width); total = 0; // make kernel_width a constant in common cases so compiler can optimize out the divide switch (kernel_width) { case 2: for (i=0; i <= safe_w; ++i) { total += pixels[i] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; pixels[i] = (unsigned char) (total / 2); } break; case 3: for (i=0; i <= safe_w; ++i) { total += pixels[i] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; pixels[i] = (unsigned char) (total / 3); } break; case 4: for (i=0; i <= safe_w; ++i) { total += pixels[i] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; pixels[i] = (unsigned char) (total / 4); } break; case 5: for (i=0; i <= safe_w; ++i) { total += pixels[i] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; pixels[i] = (unsigned char) (total / 5); } break; default: for (i=0; i <= safe_w; ++i) { total += pixels[i] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; pixels[i] = (unsigned char) (total / kernel_width); } break; } for (; i < w; ++i) { STBTT_assert(pixels[i] == 0); total -= buffer[i & STBTT__OVER_MASK]; pixels[i] = (unsigned char) (total / kernel_width); } pixels += stride_in_bytes; } } static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) { unsigned char buffer[STBTT_MAX_OVERSAMPLE]; int safe_h = h - kernel_width; int j; STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze for (j=0; j < w; ++j) { int i; unsigned int total; STBTT_memset(buffer, 0, kernel_width); total = 0; // make kernel_width a constant in common cases so compiler can optimize out the divide switch (kernel_width) { case 2: for (i=0; i <= safe_h; ++i) { total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 2); } break; case 3: for (i=0; i <= safe_h; ++i) { total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 3); } break; case 4: for (i=0; i <= safe_h; ++i) { total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 4); } break; case 5: for (i=0; i <= safe_h; ++i) { total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / 5); } break; default: for (i=0; i <= safe_h; ++i) { total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); } break; } for (; i < h; ++i) { STBTT_assert(pixels[i*stride_in_bytes] == 0); total -= buffer[i & STBTT__OVER_MASK]; pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); } pixels += 1; } } static float stbtt__oversample_shift(int oversample) { if (!oversample) return 0.0f; // The prefilter is a box filter of width "oversample", // which shifts phase by (oversample - 1)/2 pixels in // oversampled space. We want to shift in the opposite // direction to counter this. return (float)-(oversample - 1) / (2.0f * (float)oversample); } // rects array must be big enough to accommodate all characters in the given ranges STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) { int i,j,k; k=0; for (i=0; i < num_ranges; ++i) { float fh = ranges[i].font_size; float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); ranges[i].h_oversample = (unsigned char) spc->h_oversample; ranges[i].v_oversample = (unsigned char) spc->v_oversample; for (j=0; j < ranges[i].num_chars; ++j) { int x0,y0,x1,y1; int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; int glyph = stbtt_FindGlyphIndex(info, codepoint); stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, scale * spc->h_oversample, scale * spc->v_oversample, 0,0, &x0,&y0,&x1,&y1); rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); ++k; } } return k; } STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int prefilter_x, int prefilter_y, float *sub_x, float *sub_y, int glyph) { stbtt_MakeGlyphBitmapSubpixel(info, output, out_w - (prefilter_x - 1), out_h - (prefilter_y - 1), out_stride, scale_x, scale_y, shift_x, shift_y, glyph); if (prefilter_x > 1) stbtt__h_prefilter(output, out_w, out_h, out_stride, prefilter_x); if (prefilter_y > 1) stbtt__v_prefilter(output, out_w, out_h, out_stride, prefilter_y); *sub_x = stbtt__oversample_shift(prefilter_x); *sub_y = stbtt__oversample_shift(prefilter_y); } // rects array must be big enough to accommodate all characters in the given ranges STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) { int i,j,k, return_value = 1; // save current values int old_h_over = spc->h_oversample; int old_v_over = spc->v_oversample; k = 0; for (i=0; i < num_ranges; ++i) { float fh = ranges[i].font_size; float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); float recip_h,recip_v,sub_x,sub_y; spc->h_oversample = ranges[i].h_oversample; spc->v_oversample = ranges[i].v_oversample; recip_h = 1.0f / spc->h_oversample; recip_v = 1.0f / spc->v_oversample; sub_x = stbtt__oversample_shift(spc->h_oversample); sub_y = stbtt__oversample_shift(spc->v_oversample); for (j=0; j < ranges[i].num_chars; ++j) { stbrp_rect *r = &rects[k]; if (r->was_packed) { stbtt_packedchar *bc = &ranges[i].chardata_for_range[j]; int advance, lsb, x0,y0,x1,y1; int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; int glyph = stbtt_FindGlyphIndex(info, codepoint); stbrp_coord pad = (stbrp_coord) spc->padding; // pad on left and top r->x += pad; r->y += pad; r->w -= pad; r->h -= pad; stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb); stbtt_GetGlyphBitmapBox(info, glyph, scale * spc->h_oversample, scale * spc->v_oversample, &x0,&y0,&x1,&y1); stbtt_MakeGlyphBitmapSubpixel(info, spc->pixels + r->x + r->y*spc->stride_in_bytes, r->w - spc->h_oversample+1, r->h - spc->v_oversample+1, spc->stride_in_bytes, scale * spc->h_oversample, scale * spc->v_oversample, 0,0, glyph); if (spc->h_oversample > 1) stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, r->w, r->h, spc->stride_in_bytes, spc->h_oversample); if (spc->v_oversample > 1) stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, r->w, r->h, spc->stride_in_bytes, spc->v_oversample); bc->x0 = (stbtt_int16) r->x; bc->y0 = (stbtt_int16) r->y; bc->x1 = (stbtt_int16) (r->x + r->w); bc->y1 = (stbtt_int16) (r->y + r->h); bc->xadvance = scale * advance; bc->xoff = (float) x0 * recip_h + sub_x; bc->yoff = (float) y0 * recip_v + sub_y; bc->xoff2 = (x0 + r->w) * recip_h + sub_x; bc->yoff2 = (y0 + r->h) * recip_v + sub_y; } else { return_value = 0; // if any fail, report failure } ++k; } } // restore original values spc->h_oversample = old_h_over; spc->v_oversample = old_v_over; return return_value; } STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects) { stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects); } STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges) { stbtt_fontinfo info; int i,j,n, return_value = 1; //stbrp_context *context = (stbrp_context *) spc->pack_info; stbrp_rect *rects; // flag all characters as NOT packed for (i=0; i < num_ranges; ++i) for (j=0; j < ranges[i].num_chars; ++j) ranges[i].chardata_for_range[j].x0 = ranges[i].chardata_for_range[j].y0 = ranges[i].chardata_for_range[j].x1 = ranges[i].chardata_for_range[j].y1 = 0; n = 0; for (i=0; i < num_ranges; ++i) n += ranges[i].num_chars; rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); if (rects == NULL) return 0; info.userdata = spc->user_allocator_context; stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index)); n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); stbtt_PackFontRangesPackRects(spc, rects, n); return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); STBTT_free(rects, spc->user_allocator_context); return return_value; } STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range) { stbtt_pack_range range; range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range; range.array_of_unicode_codepoints = NULL; range.num_chars = num_chars_in_range; range.chardata_for_range = chardata_for_range; range.font_size = font_size; return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); } STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer) { float ipw = 1.0f / pw, iph = 1.0f / ph; const stbtt_packedchar *b = chardata + char_index; if (align_to_integer) { float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f); float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f); q->x0 = x; q->y0 = y; q->x1 = x + b->xoff2 - b->xoff; q->y1 = y + b->yoff2 - b->yoff; } else { q->x0 = *xpos + b->xoff; q->y0 = *ypos + b->yoff; q->x1 = *xpos + b->xoff2; q->y1 = *ypos + b->yoff2; } q->s0 = b->x0 * ipw; q->t0 = b->y0 * iph; q->s1 = b->x1 * ipw; q->t1 = b->y1 * iph; *xpos += b->xadvance; } ////////////////////////////////////////////////////////////////////////////// // // sdf computation // #define STBTT_min(a,b) ((a) < (b) ? (a) : (b)) #define STBTT_max(a,b) ((a) < (b) ? (b) : (a)) static int stbtt__ray_intersect_bezier(float orig[2], float ray[2], float q0[2], float q1[2], float q2[2], float hits[2][2]) { float q0perp = q0[1]*ray[0] - q0[0]*ray[1]; float q1perp = q1[1]*ray[0] - q1[0]*ray[1]; float q2perp = q2[1]*ray[0] - q2[0]*ray[1]; float roperp = orig[1]*ray[0] - orig[0]*ray[1]; float a = q0perp - 2*q1perp + q2perp; float b = q1perp - q0perp; float c = q0perp - roperp; float s0 = 0., s1 = 0.; int num_s = 0; if (a != 0.0) { float discr = b*b - a*c; if (discr > 0.0) { float rcpna = -1 / a; float d = (float) STBTT_sqrt(discr); s0 = (b+d) * rcpna; s1 = (b-d) * rcpna; if (s0 >= 0.0 && s0 <= 1.0) num_s = 1; if (d > 0.0 && s1 >= 0.0 && s1 <= 1.0) { if (num_s == 0) s0 = s1; ++num_s; } } } else { // 2*b*s + c = 0 // s = -c / (2*b) s0 = c / (-2 * b); if (s0 >= 0.0 && s0 <= 1.0) num_s = 1; } if (num_s == 0) return 0; else { float rcp_len2 = 1 / (ray[0]*ray[0] + ray[1]*ray[1]); float rayn_x = ray[0] * rcp_len2, rayn_y = ray[1] * rcp_len2; float q0d = q0[0]*rayn_x + q0[1]*rayn_y; float q1d = q1[0]*rayn_x + q1[1]*rayn_y; float q2d = q2[0]*rayn_x + q2[1]*rayn_y; float rod = orig[0]*rayn_x + orig[1]*rayn_y; float q10d = q1d - q0d; float q20d = q2d - q0d; float q0rd = q0d - rod; hits[0][0] = q0rd + s0*(2.0f - 2.0f*s0)*q10d + s0*s0*q20d; hits[0][1] = a*s0+b; if (num_s > 1) { hits[1][0] = q0rd + s1*(2.0f - 2.0f*s1)*q10d + s1*s1*q20d; hits[1][1] = a*s1+b; return 2; } else { return 1; } } } static int equal(float *a, float *b) { return (a[0] == b[0] && a[1] == b[1]); } static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex *verts) { int i; float orig[2], ray[2] = { 1, 0 }; float y_frac; int winding = 0; orig[0] = x; orig[1] = y; // make sure y never passes through a vertex of the shape y_frac = (float) STBTT_fmod(y, 1.0f); if (y_frac < 0.01f) y += 0.01f; else if (y_frac > 0.99f) y -= 0.01f; orig[1] = y; // test a ray from (-infinity,y) to (x,y) for (i=0; i < nverts; ++i) { if (verts[i].type == STBTT_vline) { int x0 = (int) verts[i-1].x, y0 = (int) verts[i-1].y; int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y; if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; if (x_inter < x) winding += (y0 < y1) ? 1 : -1; } } if (verts[i].type == STBTT_vcurve) { int x0 = (int) verts[i-1].x , y0 = (int) verts[i-1].y ; int x1 = (int) verts[i ].cx, y1 = (int) verts[i ].cy; int x2 = (int) verts[i ].x , y2 = (int) verts[i ].y ; int ax = STBTT_min(x0,STBTT_min(x1,x2)), ay = STBTT_min(y0,STBTT_min(y1,y2)); int by = STBTT_max(y0,STBTT_max(y1,y2)); if (y > ay && y < by && x > ax) { float q0[2],q1[2],q2[2]; float hits[2][2]; q0[0] = (float)x0; q0[1] = (float)y0; q1[0] = (float)x1; q1[1] = (float)y1; q2[0] = (float)x2; q2[1] = (float)y2; if (equal(q0,q1) || equal(q1,q2)) { x0 = (int)verts[i-1].x; y0 = (int)verts[i-1].y; x1 = (int)verts[i ].x; y1 = (int)verts[i ].y; if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; if (x_inter < x) winding += (y0 < y1) ? 1 : -1; } } else { int num_hits = stbtt__ray_intersect_bezier(orig, ray, q0, q1, q2, hits); if (num_hits >= 1) if (hits[0][0] < 0) winding += (hits[0][1] < 0 ? -1 : 1); if (num_hits >= 2) if (hits[1][0] < 0) winding += (hits[1][1] < 0 ? -1 : 1); } } } } return winding; } static float stbtt__cuberoot( float x ) { if (x<0) return -(float) STBTT_pow(-x,1.0f/3.0f); else return (float) STBTT_pow( x,1.0f/3.0f); } // x^3 + c*x^2 + b*x + a = 0 static int stbtt__solve_cubic(float a, float b, float c, float* r) { float s = -a / 3; float p = b - a*a / 3; float q = a * (2*a*a - 9*b) / 27 + c; float p3 = p*p*p; float d = q*q + 4*p3 / 27; if (d >= 0) { float z = (float) STBTT_sqrt(d); float u = (-q + z) / 2; float v = (-q - z) / 2; u = stbtt__cuberoot(u); v = stbtt__cuberoot(v); r[0] = s + u + v; return 1; } else { float u = (float) STBTT_sqrt(-p/3); float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative float m = (float) STBTT_cos(v); float n = (float) STBTT_cos(v-3.141592/2)*1.732050808f; r[0] = s + u * 2 * m; r[1] = s - u * (m + n); r[2] = s - u * (m - n); //STBTT_assert( STBTT_fabs(((r[0]+a)*r[0]+b)*r[0]+c) < 0.05f); // these asserts may not be safe at all scales, though they're in bezier t parameter units so maybe? //STBTT_assert( STBTT_fabs(((r[1]+a)*r[1]+b)*r[1]+c) < 0.05f); //STBTT_assert( STBTT_fabs(((r[2]+a)*r[2]+b)*r[2]+c) < 0.05f); return 3; } } STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) { float scale_x = scale, scale_y = scale; int ix0,iy0,ix1,iy1; int w,h; unsigned char *data; // if one scale is 0, use same scale for both if (scale_x == 0) scale_x = scale_y; if (scale_y == 0) { if (scale_x == 0) return NULL; // if both scales are 0, return NULL scale_y = scale_x; } stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale, scale, 0.0f,0.0f, &ix0,&iy0,&ix1,&iy1); // if empty, return NULL if (ix0 == ix1 || iy0 == iy1) return NULL; ix0 -= padding; iy0 -= padding; ix1 += padding; iy1 += padding; w = (ix1 - ix0); h = (iy1 - iy0); if (width ) *width = w; if (height) *height = h; if (xoff ) *xoff = ix0; if (yoff ) *yoff = iy0; // invert for y-downwards bitmaps scale_y = -scale_y; { int x,y,i,j; float *precompute; stbtt_vertex *verts; int num_verts = stbtt_GetGlyphShape(info, glyph, &verts); data = (unsigned char *) STBTT_malloc(w * h, info->userdata); precompute = (float *) STBTT_malloc(num_verts * sizeof(float), info->userdata); for (i=0,j=num_verts-1; i < num_verts; j=i++) { if (verts[i].type == STBTT_vline) { float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; float x1 = verts[j].x*scale_x, y1 = verts[j].y*scale_y; float dist = (float) STBTT_sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0)); precompute[i] = (dist == 0) ? 0.0f : 1.0f / dist; } else if (verts[i].type == STBTT_vcurve) { float x2 = verts[j].x *scale_x, y2 = verts[j].y *scale_y; float x1 = verts[i].cx*scale_x, y1 = verts[i].cy*scale_y; float x0 = verts[i].x *scale_x, y0 = verts[i].y *scale_y; float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; float len2 = bx*bx + by*by; if (len2 != 0.0f) precompute[i] = 1.0f / (bx*bx + by*by); else precompute[i] = 0.0f; } else precompute[i] = 0.0f; } for (y=iy0; y < iy1; ++y) { for (x=ix0; x < ix1; ++x) { float val; float min_dist = 999999.0f; float sx = (float) x + 0.5f; float sy = (float) y + 0.5f; float x_gspace = (sx / scale_x); float y_gspace = (sy / scale_y); int winding = stbtt__compute_crossings_x(x_gspace, y_gspace, num_verts, verts); // @OPTIMIZE: this could just be a rasterization, but needs to be line vs. non-tesselated curves so a new path for (i=0; i < num_verts; ++i) { float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; // check against every point here rather than inside line/curve primitives -- @TODO: wrong if multiple 'moves' in a row produce a garbage point, and given culling, probably more efficient to do within line/curve float dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); if (dist2 < min_dist*min_dist) min_dist = (float) STBTT_sqrt(dist2); if (verts[i].type == STBTT_vline) { float x1 = verts[i-1].x*scale_x, y1 = verts[i-1].y*scale_y; // coarse culling against bbox //if (sx > STBTT_min(x0,x1)-min_dist && sx < STBTT_max(x0,x1)+min_dist && // sy > STBTT_min(y0,y1)-min_dist && sy < STBTT_max(y0,y1)+min_dist) float dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i]; STBTT_assert(i != 0); if (dist < min_dist) { // check position along line // x' = x0 + t*(x1-x0), y' = y0 + t*(y1-y0) // minimize (x'-sx)*(x'-sx)+(y'-sy)*(y'-sy) float dx = x1-x0, dy = y1-y0; float px = x0-sx, py = y0-sy; // minimize (px+t*dx)^2 + (py+t*dy)^2 = px*px + 2*px*dx*t + t^2*dx*dx + py*py + 2*py*dy*t + t^2*dy*dy // derivative: 2*px*dx + 2*py*dy + (2*dx*dx+2*dy*dy)*t, set to 0 and solve float t = -(px*dx + py*dy) / (dx*dx + dy*dy); if (t >= 0.0f && t <= 1.0f) min_dist = dist; } } else if (verts[i].type == STBTT_vcurve) { float x2 = verts[i-1].x *scale_x, y2 = verts[i-1].y *scale_y; float x1 = verts[i ].cx*scale_x, y1 = verts[i ].cy*scale_y; float box_x0 = STBTT_min(STBTT_min(x0,x1),x2); float box_y0 = STBTT_min(STBTT_min(y0,y1),y2); float box_x1 = STBTT_max(STBTT_max(x0,x1),x2); float box_y1 = STBTT_max(STBTT_max(y0,y1),y2); // coarse culling against bbox to avoid computing cubic unnecessarily if (sx > box_x0-min_dist && sx < box_x1+min_dist && sy > box_y0-min_dist && sy < box_y1+min_dist) { int num=0; float ax = x1-x0, ay = y1-y0; float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; float mx = x0 - sx, my = y0 - sy; float res[3],px,py,t,it; float a_inv = precompute[i]; if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula float a = 3*(ax*bx + ay*by); float b = 2*(ax*ax + ay*ay) + (mx*bx+my*by); float c = mx*ax+my*ay; if (a == 0.0) { // if a is 0, it's linear if (b != 0.0) { res[num++] = -c/b; } } else { float discriminant = b*b - 4*a*c; if (discriminant < 0) num = 0; else { float root = (float) STBTT_sqrt(discriminant); res[0] = (-b - root)/(2*a); res[1] = (-b + root)/(2*a); num = 2; // don't bother distinguishing 1-solution case, as code below will still work } } } else { float b = 3*(ax*bx + ay*by) * a_inv; // could precompute this as it doesn't depend on sample point float c = (2*(ax*ax + ay*ay) + (mx*bx+my*by)) * a_inv; float d = (mx*ax+my*ay) * a_inv; num = stbtt__solve_cubic(b, c, d, res); } if (num >= 1 && res[0] >= 0.0f && res[0] <= 1.0f) { t = res[0], it = 1.0f - t; px = it*it*x0 + 2*t*it*x1 + t*t*x2; py = it*it*y0 + 2*t*it*y1 + t*t*y2; dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); if (dist2 < min_dist * min_dist) min_dist = (float) STBTT_sqrt(dist2); } if (num >= 2 && res[1] >= 0.0f && res[1] <= 1.0f) { t = res[1], it = 1.0f - t; px = it*it*x0 + 2*t*it*x1 + t*t*x2; py = it*it*y0 + 2*t*it*y1 + t*t*y2; dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); if (dist2 < min_dist * min_dist) min_dist = (float) STBTT_sqrt(dist2); } if (num >= 3 && res[2] >= 0.0f && res[2] <= 1.0f) { t = res[2], it = 1.0f - t; px = it*it*x0 + 2*t*it*x1 + t*t*x2; py = it*it*y0 + 2*t*it*y1 + t*t*y2; dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); if (dist2 < min_dist * min_dist) min_dist = (float) STBTT_sqrt(dist2); } } } } if (winding == 0) min_dist = -min_dist; // if outside the shape, value is negative val = onedge_value + pixel_dist_scale * min_dist; if (val < 0) val = 0; else if (val > 255) val = 255; data[(y-iy0)*w+(x-ix0)] = (unsigned char) val; } } STBTT_free(precompute, info->userdata); STBTT_free(verts, info->userdata); } return data; } STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) { return stbtt_GetGlyphSDF(info, scale, stbtt_FindGlyphIndex(info, codepoint), padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff); } STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata) { STBTT_free(bitmap, userdata); } ////////////////////////////////////////////////////////////////////////////// // // font name matching -- recommended not to use this // // check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) { stbtt_int32 i=0; // convert utf16 to utf8 and compare the results while converting while (len2) { stbtt_uint16 ch = s2[0]*256 + s2[1]; if (ch < 0x80) { if (i >= len1) return -1; if (s1[i++] != ch) return -1; } else if (ch < 0x800) { if (i+1 >= len1) return -1; if (s1[i++] != 0xc0 + (ch >> 6)) return -1; if (s1[i++] != 0x80 + (ch & 0x3f)) return -1; } else if (ch >= 0xd800 && ch < 0xdc00) { stbtt_uint32 c; stbtt_uint16 ch2 = s2[2]*256 + s2[3]; if (i+3 >= len1) return -1; c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000; if (s1[i++] != 0xf0 + (c >> 18)) return -1; if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1; if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1; if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1; s2 += 2; // plus another 2 below len2 -= 2; } else if (ch >= 0xdc00 && ch < 0xe000) { return -1; } else { if (i+2 >= len1) return -1; if (s1[i++] != 0xe0 + (ch >> 12)) return -1; if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1; if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1; } s2 += 2; len2 -= 2; } return i; } static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) { return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); } // returns results in whatever encoding you request... but note that 2-byte encodings // will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID) { stbtt_int32 i,count,stringOffset; stbtt_uint8 *fc = font->data; stbtt_uint32 offset = font->fontstart; stbtt_uint32 nm = stbtt__find_table(fc, offset, "name"); if (!nm) return NULL; count = ttUSHORT(fc+nm+2); stringOffset = nm + ttUSHORT(fc+nm+4); for (i=0; i < count; ++i) { stbtt_uint32 loc = nm + 6 + 12 * i; if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2) && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) { *length = ttUSHORT(fc+loc+8); return (const char *) (fc+stringOffset+ttUSHORT(fc+loc+10)); } } return NULL; } static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id) { stbtt_int32 i; stbtt_int32 count = ttUSHORT(fc+nm+2); stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4); for (i=0; i < count; ++i) { stbtt_uint32 loc = nm + 6 + 12 * i; stbtt_int32 id = ttUSHORT(fc+loc+6); if (id == target_id) { // find the encoding stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4); // is this a Unicode encoding? if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) { stbtt_int32 slen = ttUSHORT(fc+loc+8); stbtt_int32 off = ttUSHORT(fc+loc+10); // check if there's a prefix match stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen); if (matchlen >= 0) { // check for target_id+1 immediately following, with same encoding & language if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) { slen = ttUSHORT(fc+loc+12+8); off = ttUSHORT(fc+loc+12+10); if (slen == 0) { if (matchlen == nlen) return 1; } else if (matchlen < nlen && name[matchlen] == ' ') { ++matchlen; if (stbtt_CompareUTF8toUTF16_bigendian_internal((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) return 1; } } else { // if nothing immediately following if (matchlen == nlen) return 1; } } } // @TODO handle other encodings } } return 0; } static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags) { stbtt_int32 nlen = (stbtt_int32) STBTT_strlen((char *) name); stbtt_uint32 nm,hd; if (!stbtt__isfont(fc+offset)) return 0; // check italics/bold/underline flags in macStyle... if (flags) { hd = stbtt__find_table(fc, offset, "head"); if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0; } nm = stbtt__find_table(fc, offset, "name"); if (!nm) return 0; if (flags) { // if we checked the macStyle flags, then just check the family and ignore the subfamily if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1; if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1; if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; } else { if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1; if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1; if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; } return 0; } static int stbtt_FindMatchingFont_internal(unsigned char *font_collection, char *name_utf8, stbtt_int32 flags) { stbtt_int32 i; for (i=0;;++i) { stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i); if (off < 0) return off; if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags)) return off; } } #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" #endif STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, float pixel_height, unsigned char *pixels, int pw, int ph, int first_char, int num_chars, stbtt_bakedchar *chardata) { return stbtt_BakeFontBitmap_internal((unsigned char *) data, offset, pixel_height, pixels, pw, ph, first_char, num_chars, chardata); } STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index) { return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); } STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data) { return stbtt_GetNumberOfFonts_internal((unsigned char *) data); } STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset) { return stbtt_InitFont_internal(info, (unsigned char *) data, offset); } STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags) { return stbtt_FindMatchingFont_internal((unsigned char *) fontdata, (char *) name, flags); } STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) { return stbtt_CompareUTF8toUTF16_bigendian_internal((char *) s1, len1, (char *) s2, len2); } #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif #endif // STB_TRUETYPE_IMPLEMENTATION // FULL VERSION HISTORY // // 1.19 (2018-02-11) OpenType GPOS kerning (horizontal only), STBTT_fmod // 1.18 (2018-01-29) add missing function // 1.17 (2017-07-23) make more arguments const; doc fix // 1.16 (2017-07-12) SDF support // 1.15 (2017-03-03) make more arguments const // 1.14 (2017-01-16) num-fonts-in-TTC function // 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts // 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual // 1.11 (2016-04-02) fix unused-variable warning // 1.10 (2016-04-02) allow user-defined fabs() replacement // fix memory leak if fontsize=0.0 // fix warning from duplicate typedef // 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; // allow PackFontRanges to pack and render in separate phases; // fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); // fixed an assert() bug in the new rasterizer // replace assert() with STBTT_assert() in new rasterizer // 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) // also more precise AA rasterizer, except if shapes overlap // remove need for STBTT_sort // 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC // 1.04 (2015-04-15) typo in example // 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes // 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++ // 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match // non-oversampled; STBTT_POINT_SIZE for packed case only // 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling // 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg) // 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID // 0.8b (2014-07-07) fix a warning // 0.8 (2014-05-25) fix a few more warnings // 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back // 0.6c (2012-07-24) improve documentation // 0.6b (2012-07-20) fix a few more warnings // 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels, // stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty // 0.5 (2011-12-09) bugfixes: // subpixel glyph renderer computed wrong bounding box // first vertex of shape can be off-curve (FreeSans) // 0.4b (2011-12-03) fixed an error in the font baking example // 0.4 (2011-12-01) kerning, subpixel rendering (tor) // bugfixes for: // codepoint-to-glyph conversion using table fmt=12 // codepoint-to-glyph conversion using table fmt=4 // stbtt_GetBakedQuad with non-square texture (Zer) // updated Hello World! sample to use kerning and subpixel // fixed some warnings // 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM) // userdata, malloc-from-userdata, non-zero fill (stb) // 0.2 (2009-03-11) Fix unsigned/signed char warnings // 0.1 (2009-03-09) First public release // /* ------------------------------------------------------------------------------ This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------ ALTERNATIVE A - MIT License Copyright (c) 2017 Sean Barrett 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ ALTERNATIVE B - Public Domain (www.unlicense.org) This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ goxel-0.8.1/ext_src/uthash/000077500000000000000000000000001334742672700156205ustar00rootroot00000000000000goxel-0.8.1/ext_src/uthash/utarray.h000066400000000000000000000303701334742672700174630ustar00rootroot00000000000000/* Copyright (c) 2008-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ 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. 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. */ /* a dynamic array implementation using macros */ #ifndef UTARRAY_H #define UTARRAY_H #define UTARRAY_VERSION 1.9.9 #ifdef __GNUC__ #define _UNUSED_ __attribute__ ((__unused__)) #else #define _UNUSED_ #endif #include /* size_t */ #include /* memset, etc */ #include /* exit */ #define oom() exit(-1) typedef void (ctor_f)(void *dst, const void *src); typedef void (dtor_f)(void *elt); typedef void (init_f)(void *elt); typedef struct { size_t sz; init_f *init; ctor_f *copy; dtor_f *dtor; } UT_icd; typedef struct { unsigned i,n;/* i: index of next available slot, n: num slots */ UT_icd icd; /* initializer, copy and destructor functions */ char *d; /* n slots of size icd->sz*/ } UT_array; #define utarray_init(a,_icd) do { \ memset(a,0,sizeof(UT_array)); \ (a)->icd=*_icd; \ } while(0) #define utarray_done(a) do { \ if ((a)->n) { \ if ((a)->icd.dtor) { \ size_t _ut_i; \ for(_ut_i=0; _ut_i < (a)->i; _ut_i++) { \ (a)->icd.dtor(utarray_eltptr(a,_ut_i)); \ } \ } \ free((a)->d); \ } \ (a)->n=0; \ } while(0) #define utarray_new(a,_icd) do { \ a=(UT_array*)malloc(sizeof(UT_array)); \ utarray_init(a,_icd); \ } while(0) #define utarray_free(a) do { \ utarray_done(a); \ free(a); \ } while(0) #define utarray_reserve(a,by) do { \ if (((a)->i+(by)) > ((a)->n)) { \ while(((a)->i+(by)) > ((a)->n)) { (a)->n = ((a)->n ? (2*(a)->n) : 8); } \ if ( ((a)->d=(char*)realloc((a)->d, (a)->n*(a)->icd.sz)) == NULL) oom(); \ } \ } while(0) #define utarray_push_back(a,p) do { \ utarray_reserve(a,1); \ if ((a)->icd.copy) { (a)->icd.copy( _utarray_eltptr(a,(a)->i++), p); } \ else { memcpy(_utarray_eltptr(a,(a)->i++), p, (a)->icd.sz); }; \ } while(0) #define utarray_pop_back(a) do { \ if ((a)->icd.dtor) { (a)->icd.dtor( _utarray_eltptr(a,--((a)->i))); } \ else { (a)->i--; } \ } while(0) #define utarray_extend_back(a) do { \ utarray_reserve(a,1); \ if ((a)->icd.init) { (a)->icd.init(_utarray_eltptr(a,(a)->i)); } \ else { memset(_utarray_eltptr(a,(a)->i),0,(a)->icd.sz); } \ (a)->i++; \ } while(0) #define utarray_len(a) ((a)->i) #define utarray_eltptr(a,j) (((j) < (a)->i) ? _utarray_eltptr(a,j) : NULL) #define _utarray_eltptr(a,j) ((char*)((a)->d + ((a)->icd.sz*(j) ))) #define utarray_insert(a,p,j) do { \ if (j > (a)->i) utarray_resize(a,j); \ utarray_reserve(a,1); \ if ((j) < (a)->i) { \ memmove( _utarray_eltptr(a,(j)+1), _utarray_eltptr(a,j), \ ((a)->i - (j))*((a)->icd.sz)); \ } \ if ((a)->icd.copy) { (a)->icd.copy( _utarray_eltptr(a,j), p); } \ else { memcpy(_utarray_eltptr(a,j), p, (a)->icd.sz); }; \ (a)->i++; \ } while(0) #define utarray_inserta(a,w,j) do { \ if (utarray_len(w) == 0) break; \ if (j > (a)->i) utarray_resize(a,j); \ utarray_reserve(a,utarray_len(w)); \ if ((j) < (a)->i) { \ memmove(_utarray_eltptr(a,(j)+utarray_len(w)), \ _utarray_eltptr(a,j), \ ((a)->i - (j))*((a)->icd.sz)); \ } \ if ((a)->icd.copy) { \ size_t _ut_i; \ for(_ut_i=0;_ut_i<(w)->i;_ut_i++) { \ (a)->icd.copy(_utarray_eltptr(a,j+_ut_i), _utarray_eltptr(w,_ut_i)); \ } \ } else { \ memcpy(_utarray_eltptr(a,j), _utarray_eltptr(w,0), \ utarray_len(w)*((a)->icd.sz)); \ } \ (a)->i += utarray_len(w); \ } while(0) #define utarray_resize(dst,num) do { \ size_t _ut_i; \ if (dst->i > (size_t)(num)) { \ if ((dst)->icd.dtor) { \ for(_ut_i=num; _ut_i < dst->i; _ut_i++) { \ (dst)->icd.dtor(utarray_eltptr(dst,_ut_i)); \ } \ } \ } else if (dst->i < (size_t)(num)) { \ utarray_reserve(dst,num-dst->i); \ if ((dst)->icd.init) { \ for(_ut_i=dst->i; _ut_i < num; _ut_i++) { \ (dst)->icd.init(utarray_eltptr(dst,_ut_i)); \ } \ } else { \ memset(_utarray_eltptr(dst,dst->i),0,(dst)->icd.sz*(num-dst->i)); \ } \ } \ dst->i = num; \ } while(0) #define utarray_concat(dst,src) do { \ utarray_inserta((dst),(src),utarray_len(dst)); \ } while(0) #define utarray_erase(a,pos,len) do { \ if ((a)->icd.dtor) { \ size_t _ut_i; \ for(_ut_i=0; _ut_i < len; _ut_i++) { \ (a)->icd.dtor(utarray_eltptr((a),pos+_ut_i)); \ } \ } \ if ((a)->i > (pos+len)) { \ memmove( _utarray_eltptr((a),pos), _utarray_eltptr((a),pos+len), \ (((a)->i)-(pos+len))*((a)->icd.sz)); \ } \ (a)->i -= (len); \ } while(0) #define utarray_renew(a,u) do { \ if (a) utarray_clear(a); \ else utarray_new((a),(u)); \ } while(0) #define utarray_clear(a) do { \ if ((a)->i > 0) { \ if ((a)->icd.dtor) { \ size_t _ut_i; \ for(_ut_i=0; _ut_i < (a)->i; _ut_i++) { \ (a)->icd.dtor(utarray_eltptr(a,_ut_i)); \ } \ } \ (a)->i = 0; \ } \ } while(0) #define utarray_sort(a,cmp) do { \ qsort((a)->d, (a)->i, (a)->icd.sz, cmp); \ } while(0) #define utarray_find(a,v,cmp) bsearch((v),(a)->d,(a)->i,(a)->icd.sz,cmp) #define utarray_front(a) (((a)->i) ? (_utarray_eltptr(a,0)) : NULL) #define utarray_next(a,e) (((e)==NULL) ? utarray_front(a) : ((((a)->i) > (utarray_eltidx(a,e)+1)) ? _utarray_eltptr(a,utarray_eltidx(a,e)+1) : NULL)) #define utarray_prev(a,e) (((e)==NULL) ? utarray_back(a) : ((utarray_eltidx(a,e) > 0) ? _utarray_eltptr(a,utarray_eltidx(a,e)-1) : NULL)) #define utarray_back(a) (((a)->i) ? (_utarray_eltptr(a,(a)->i-1)) : NULL) #define utarray_eltidx(a,e) (((char*)(e) >= (char*)((a)->d)) ? (((char*)(e) - (char*)((a)->d))/(size_t)(a)->icd.sz) : -1) /* last we pre-define a few icd for common utarrays of ints and strings */ static void utarray_str_cpy(void *dst, const void *src) { char **_src = (char**)src, **_dst = (char**)dst; *_dst = (*_src == NULL) ? NULL : strdup(*_src); } static void utarray_str_dtor(void *elt) { char **eltc = (char**)elt; if (*eltc) free(*eltc); } static const UT_icd ut_str_icd _UNUSED_ = {sizeof(char*),NULL,utarray_str_cpy,utarray_str_dtor}; static const UT_icd ut_int_icd _UNUSED_ = {sizeof(int),NULL,NULL,NULL}; static const UT_icd ut_ptr_icd _UNUSED_ = {sizeof(void*),NULL,NULL,NULL}; #endif /* UTARRAY_H */ goxel-0.8.1/ext_src/uthash/uthash.h000066400000000000000000001711631334742672700172760ustar00rootroot00000000000000/* Copyright (c) 2003-2014, Troy D. Hanson http://troydhanson.github.com/uthash/ 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. 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 UTHASH_H #define UTHASH_H #include /* memcmp,strlen */ #include /* ptrdiff_t */ #include /* exit() */ /* These macros use decltype or the earlier __typeof GNU extension. As decltype is only available in newer compilers (VS2010 or gcc 4.3+ when compiling c++ source) this code uses whatever method is needed or, for VS2008 where neither is available, uses casting workarounds. */ #if defined(_MSC_VER) /* MS compiler */ #if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ #define DECLTYPE(x) (decltype(x)) #else /* VS2008 or older (or VS2010 in C mode) */ #define NO_DECLTYPE #define DECLTYPE(x) #endif #elif defined(__BORLANDC__) || defined(__LCC__) || defined(__WATCOMC__) #define NO_DECLTYPE #define DECLTYPE(x) #else /* GNU, Sun and other compilers */ #define DECLTYPE(x) (__typeof(x)) #endif #ifdef NO_DECLTYPE #define DECLTYPE_ASSIGN(dst,src) \ do { \ char **_da_dst = (char**)(&(dst)); \ *_da_dst = (char*)(src); \ } while(0) #else #define DECLTYPE_ASSIGN(dst,src) \ do { \ (dst) = DECLTYPE(dst)(src); \ } while(0) #endif /* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */ #if defined (_WIN32) #if defined(_MSC_VER) && _MSC_VER >= 1600 #include #elif defined(__WATCOMC__) #include #else typedef unsigned int uint32_t; typedef unsigned char uint8_t; #endif #else #include #endif #define UTHASH_VERSION 1.9.9 #ifndef uthash_fatal #define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ #endif #ifndef uthash_malloc #define uthash_malloc(sz) malloc(sz) /* malloc fcn */ #endif #ifndef uthash_free #define uthash_free(ptr,sz) free(ptr) /* free fcn */ #endif #ifndef uthash_noexpand_fyi #define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ #endif #ifndef uthash_expand_fyi #define uthash_expand_fyi(tbl) /* can be defined to log expands */ #endif /* initial number of buckets */ #define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */ #define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */ #define HASH_BKT_CAPACITY_THRESH 10U /* expand when bucket count reaches */ /* calculate the element whose hash handle address is hhe */ #define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) #define HASH_FIND(hh,head,keyptr,keylen,out) \ do { \ out=NULL; \ if (head != NULL) { \ unsigned _hf_bkt,_hf_hashv; \ HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv) != 0) { \ HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ keyptr,keylen,out); \ } \ } \ } while (0) #ifdef HASH_BLOOM #define HASH_BLOOM_BITLEN (1UL << HASH_BLOOM) #define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8UL) + (((HASH_BLOOM_BITLEN%8UL)!=0UL) ? 1UL : 0UL) #define HASH_BLOOM_MAKE(tbl) \ do { \ (tbl)->bloom_nbits = HASH_BLOOM; \ (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ } while (0) #define HASH_BLOOM_FREE(tbl) \ do { \ uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ } while (0) #define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8U] |= (1U << ((idx)%8U))) #define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8U] & (1U << ((idx)%8U))) #define HASH_BLOOM_ADD(tbl,hashv) \ HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1U))) #define HASH_BLOOM_TEST(tbl,hashv) \ HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1U))) #else #define HASH_BLOOM_MAKE(tbl) #define HASH_BLOOM_FREE(tbl) #define HASH_BLOOM_ADD(tbl,hashv) #define HASH_BLOOM_TEST(tbl,hashv) (1) #define HASH_BLOOM_BYTELEN 0U #endif #define HASH_MAKE_TABLE(hh,head) \ do { \ (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ sizeof(UT_hash_table)); \ if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ (head)->hh.tbl->tail = &((head)->hh); \ (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ memset((head)->hh.tbl->buckets, 0, \ HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ HASH_BLOOM_MAKE((head)->hh.tbl); \ (head)->hh.tbl->signature = HASH_SIGNATURE; \ } while(0) #define HASH_ADD(hh,head,fieldname,keylen_in,add) \ HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add) #define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ do { \ replaced=NULL; \ HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced); \ if (replaced!=NULL) { \ HASH_DELETE(hh,head,replaced); \ } \ HASH_ADD(hh,head,fieldname,keylen_in,add); \ } while(0) #define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ do { \ unsigned _ha_bkt; \ (add)->hh.next = NULL; \ (add)->hh.key = (char*)(keyptr); \ (add)->hh.keylen = (unsigned)(keylen_in); \ if (!(head)) { \ head = (add); \ (head)->hh.prev = NULL; \ HASH_MAKE_TABLE(hh,head); \ } else { \ (head)->hh.tbl->tail->next = (add); \ (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ (head)->hh.tbl->tail = &((add)->hh); \ } \ (head)->hh.tbl->num_items++; \ (add)->hh.tbl = (head)->hh.tbl; \ HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ (add)->hh.hashv, _ha_bkt); \ HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ HASH_FSCK(hh,head); \ } while(0) #define HASH_TO_BKT( hashv, num_bkts, bkt ) \ do { \ bkt = ((hashv) & ((num_bkts) - 1U)); \ } while(0) /* delete "delptr" from the hash table. * "the usual" patch-up process for the app-order doubly-linked-list. * The use of _hd_hh_del below deserves special explanation. * These used to be expressed using (delptr) but that led to a bug * if someone used the same symbol for the head and deletee, like * HASH_DELETE(hh,users,users); * We want that to work, but by changing the head (users) below * we were forfeiting our ability to further refer to the deletee (users) * in the patch-up process. Solution: use scratch space to * copy the deletee pointer, then the latter references are via that * scratch pointer rather than through the repointed (users) symbol. */ #define HASH_DELETE(hh,head,delptr) \ do { \ struct UT_hash_handle *_hd_hh_del; \ if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ uthash_free((head)->hh.tbl->buckets, \ (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ HASH_BLOOM_FREE((head)->hh.tbl); \ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ head = NULL; \ } else { \ unsigned _hd_bkt; \ _hd_hh_del = &((delptr)->hh); \ if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ (head)->hh.tbl->tail = \ (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ (head)->hh.tbl->hho); \ } \ if ((delptr)->hh.prev != NULL) { \ ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ } else { \ DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ } \ if (_hd_hh_del->next != NULL) { \ ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ (head)->hh.tbl->hho))->prev = \ _hd_hh_del->prev; \ } \ HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ (head)->hh.tbl->num_items--; \ } \ HASH_FSCK(hh,head); \ } while (0) /* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ #define HASH_FIND_STR(head,findstr,out) \ HASH_FIND(hh,head,findstr,(unsigned)strlen(findstr),out) #define HASH_ADD_STR(head,strfield,add) \ HASH_ADD(hh,head,strfield[0],(unsigned int)strlen(add->strfield),add) #define HASH_REPLACE_STR(head,strfield,add,replaced) \ HASH_REPLACE(hh,head,strfield[0],(unsigned)strlen(add->strfield),add,replaced) #define HASH_FIND_INT(head,findint,out) \ HASH_FIND(hh,head,findint,sizeof(int),out) #define HASH_ADD_INT(head,intfield,add) \ HASH_ADD(hh,head,intfield,sizeof(int),add) #define HASH_REPLACE_INT(head,intfield,add,replaced) \ HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) #define HASH_FIND_PTR(head,findptr,out) \ HASH_FIND(hh,head,findptr,sizeof(void *),out) #define HASH_ADD_PTR(head,ptrfield,add) \ HASH_ADD(hh,head,ptrfield,sizeof(void *),add) #define HASH_REPLACE_PTR(head,ptrfield,add,replaced) \ HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) #define HASH_DEL(head,delptr) \ HASH_DELETE(hh,head,delptr) /* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. */ #ifdef HASH_DEBUG #define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) #define HASH_FSCK(hh,head) \ do { \ struct UT_hash_handle *_thh; \ if (head) { \ unsigned _bkt_i; \ unsigned _count; \ char *_prev; \ _count = 0; \ for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ unsigned _bkt_count = 0; \ _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ _prev = NULL; \ while (_thh) { \ if (_prev != (char*)(_thh->hh_prev)) { \ HASH_OOPS("invalid hh_prev %p, actual %p\n", \ _thh->hh_prev, _prev ); \ } \ _bkt_count++; \ _prev = (char*)(_thh); \ _thh = _thh->hh_next; \ } \ _count += _bkt_count; \ if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ HASH_OOPS("invalid bucket count %u, actual %u\n", \ (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ } \ } \ if (_count != (head)->hh.tbl->num_items) { \ HASH_OOPS("invalid hh item count %u, actual %u\n", \ (head)->hh.tbl->num_items, _count ); \ } \ /* traverse hh in app order; check next/prev integrity, count */ \ _count = 0; \ _prev = NULL; \ _thh = &(head)->hh; \ while (_thh) { \ _count++; \ if (_prev !=(char*)(_thh->prev)) { \ HASH_OOPS("invalid prev %p, actual %p\n", \ _thh->prev, _prev ); \ } \ _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ (head)->hh.tbl->hho) : NULL ); \ } \ if (_count != (head)->hh.tbl->num_items) { \ HASH_OOPS("invalid app item count %u, actual %u\n", \ (head)->hh.tbl->num_items, _count ); \ } \ } \ } while (0) #else #define HASH_FSCK(hh,head) #endif /* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to * the descriptor to which this macro is defined for tuning the hash function. * The app can #include to get the prototype for write(2). */ #ifdef HASH_EMIT_KEYS #define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ do { \ unsigned _klen = fieldlen; \ write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ write(HASH_EMIT_KEYS, keyptr, (unsigned long)fieldlen); \ } while (0) #else #define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) #endif /* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ #ifdef HASH_FUNCTION #define HASH_FCN HASH_FUNCTION #else #define HASH_FCN HASH_JEN #endif /* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */ #define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned _hb_keylen=(unsigned)keylen; \ const unsigned char *_hb_key=(const unsigned char*)(key); \ (hashv) = 0; \ while (_hb_keylen-- != 0U) { \ (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; \ } \ bkt = (hashv) & (num_bkts-1U); \ } while (0) /* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ #define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned _sx_i; \ const unsigned char *_hs_key=(const unsigned char*)(key); \ hashv = 0; \ for(_sx_i=0; _sx_i < keylen; _sx_i++) { \ hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ } \ bkt = hashv & (num_bkts-1U); \ } while (0) /* FNV-1a variation */ #define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned _fn_i; \ const unsigned char *_hf_key=(const unsigned char*)(key); \ hashv = 2166136261U; \ for(_fn_i=0; _fn_i < keylen; _fn_i++) { \ hashv = hashv ^ _hf_key[_fn_i]; \ hashv = hashv * 16777619U; \ } \ bkt = hashv & (num_bkts-1U); \ } while(0) #define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned _ho_i; \ const unsigned char *_ho_key=(const unsigned char*)(key); \ hashv = 0; \ for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ hashv += _ho_key[_ho_i]; \ hashv += (hashv << 10); \ hashv ^= (hashv >> 6); \ } \ hashv += (hashv << 3); \ hashv ^= (hashv >> 11); \ hashv += (hashv << 15); \ bkt = hashv & (num_bkts-1U); \ } while(0) #define HASH_JEN_MIX(a,b,c) \ do { \ a -= b; a -= c; a ^= ( c >> 13 ); \ b -= c; b -= a; b ^= ( a << 8 ); \ c -= a; c -= b; c ^= ( b >> 13 ); \ a -= b; a -= c; a ^= ( c >> 12 ); \ b -= c; b -= a; b ^= ( a << 16 ); \ c -= a; c -= b; c ^= ( b >> 5 ); \ a -= b; a -= c; a ^= ( c >> 3 ); \ b -= c; b -= a; b ^= ( a << 10 ); \ c -= a; c -= b; c ^= ( b >> 15 ); \ } while (0) #define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned _hj_i,_hj_j,_hj_k; \ unsigned const char *_hj_key=(unsigned const char*)(key); \ hashv = 0xfeedbeefu; \ _hj_i = _hj_j = 0x9e3779b9u; \ _hj_k = (unsigned)(keylen); \ while (_hj_k >= 12U) { \ _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ + ( (unsigned)_hj_key[2] << 16 ) \ + ( (unsigned)_hj_key[3] << 24 ) ); \ _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ + ( (unsigned)_hj_key[6] << 16 ) \ + ( (unsigned)_hj_key[7] << 24 ) ); \ hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ + ( (unsigned)_hj_key[10] << 16 ) \ + ( (unsigned)_hj_key[11] << 24 ) ); \ \ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ \ _hj_key += 12; \ _hj_k -= 12U; \ } \ hashv += (unsigned)(keylen); \ switch ( _hj_k ) { \ case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */ \ case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */ \ case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); /* FALLTHROUGH */ \ case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */ \ case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */ \ case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); /* FALLTHROUGH */ \ case 5: _hj_j += _hj_key[4]; /* FALLTHROUGH */ \ case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */ \ case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */ \ case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); /* FALLTHROUGH */ \ case 1: _hj_i += _hj_key[0]; \ } \ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ bkt = hashv & (num_bkts-1U); \ } while(0) /* The Paul Hsieh hash function */ #undef get16bits #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) #define get16bits(d) (*((const uint16_t *) (d))) #endif #if !defined (get16bits) #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif #define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned const char *_sfh_key=(unsigned const char*)(key); \ uint32_t _sfh_tmp, _sfh_len = (uint32_t)keylen; \ \ unsigned _sfh_rem = _sfh_len & 3U; \ _sfh_len >>= 2; \ hashv = 0xcafebabeu; \ \ /* Main loop */ \ for (;_sfh_len > 0U; _sfh_len--) { \ hashv += get16bits (_sfh_key); \ _sfh_tmp = ((uint32_t)(get16bits (_sfh_key+2)) << 11) ^ hashv; \ hashv = (hashv << 16) ^ _sfh_tmp; \ _sfh_key += 2U*sizeof (uint16_t); \ hashv += hashv >> 11; \ } \ \ /* Handle end cases */ \ switch (_sfh_rem) { \ case 3: hashv += get16bits (_sfh_key); \ hashv ^= hashv << 16; \ hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)]) << 18; \ hashv += hashv >> 11; \ break; \ case 2: hashv += get16bits (_sfh_key); \ hashv ^= hashv << 11; \ hashv += hashv >> 17; \ break; \ case 1: hashv += *_sfh_key; \ hashv ^= hashv << 10; \ hashv += hashv >> 1; \ } \ \ /* Force "avalanching" of final 127 bits */ \ hashv ^= hashv << 3; \ hashv += hashv >> 5; \ hashv ^= hashv << 4; \ hashv += hashv >> 17; \ hashv ^= hashv << 25; \ hashv += hashv >> 6; \ bkt = hashv & (num_bkts-1U); \ } while(0) #ifdef HASH_USING_NO_STRICT_ALIASING /* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. * MurmurHash uses the faster approach only on CPU's where we know it's safe. * * Note the preprocessor built-in defines can be emitted using: * * gcc -m64 -dM -E - < /dev/null (on gcc) * cc -## a.c (where a.c is a simple test file) (Sun Studio) */ #if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) #define MUR_GETBLOCK(p,i) p[i] #else /* non intel */ #define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 3UL) == 0UL) #define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 3UL) == 1UL) #define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 3UL) == 2UL) #define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 3UL) == 3UL) #define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) #if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) #define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) #define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) #define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) #else /* assume little endian non-intel */ #define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) #define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) #define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) #endif #define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ MUR_ONE_THREE(p)))) #endif #define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) #define MUR_FMIX(_h) \ do { \ _h ^= _h >> 16; \ _h *= 0x85ebca6bu; \ _h ^= _h >> 13; \ _h *= 0xc2b2ae35u; \ _h ^= _h >> 16; \ } while(0) #define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ do { \ const uint8_t *_mur_data = (const uint8_t*)(key); \ const int _mur_nblocks = (int)(keylen) / 4; \ uint32_t _mur_h1 = 0xf88D5353u; \ uint32_t _mur_c1 = 0xcc9e2d51u; \ uint32_t _mur_c2 = 0x1b873593u; \ uint32_t _mur_k1 = 0; \ const uint8_t *_mur_tail; \ const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+(_mur_nblocks*4)); \ int _mur_i; \ for(_mur_i = -_mur_nblocks; _mur_i!=0; _mur_i++) { \ _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ _mur_k1 *= _mur_c1; \ _mur_k1 = MUR_ROTL32(_mur_k1,15); \ _mur_k1 *= _mur_c2; \ \ _mur_h1 ^= _mur_k1; \ _mur_h1 = MUR_ROTL32(_mur_h1,13); \ _mur_h1 = (_mur_h1*5U) + 0xe6546b64u; \ } \ _mur_tail = (const uint8_t*)(_mur_data + (_mur_nblocks*4)); \ _mur_k1=0; \ switch((keylen) & 3U) { \ case 3: _mur_k1 ^= (uint32_t)_mur_tail[2] << 16; /* FALLTHROUGH */ \ case 2: _mur_k1 ^= (uint32_t)_mur_tail[1] << 8; /* FALLTHROUGH */ \ case 1: _mur_k1 ^= (uint32_t)_mur_tail[0]; \ _mur_k1 *= _mur_c1; \ _mur_k1 = MUR_ROTL32(_mur_k1,15); \ _mur_k1 *= _mur_c2; \ _mur_h1 ^= _mur_k1; \ } \ _mur_h1 ^= (uint32_t)(keylen); \ MUR_FMIX(_mur_h1); \ hashv = _mur_h1; \ bkt = hashv & (num_bkts-1U); \ } while(0) #endif /* HASH_USING_NO_STRICT_ALIASING */ /* key comparison function; return 0 if keys equal */ #define HASH_KEYCMP(a,b,len) memcmp(a,b,(unsigned long)(len)) /* iterate over items in a known bucket to find desired item */ #define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ do { \ if (head.hh_head != NULL) { DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); } \ else { out=NULL; } \ while (out != NULL) { \ if ((out)->hh.keylen == (keylen_in)) { \ if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) { break; } \ } \ if ((out)->hh.hh_next != NULL) { DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); } \ else { out = NULL; } \ } \ } while(0) /* add an item to a bucket */ #define HASH_ADD_TO_BKT(head,addhh) \ do { \ head.count++; \ (addhh)->hh_next = head.hh_head; \ (addhh)->hh_prev = NULL; \ if (head.hh_head != NULL) { (head).hh_head->hh_prev = (addhh); } \ (head).hh_head=addhh; \ if ((head.count >= ((head.expand_mult+1U) * HASH_BKT_CAPACITY_THRESH)) \ && ((addhh)->tbl->noexpand != 1U)) { \ HASH_EXPAND_BUCKETS((addhh)->tbl); \ } \ } while(0) /* remove an item from a given bucket */ #define HASH_DEL_IN_BKT(hh,head,hh_del) \ (head).count--; \ if ((head).hh_head == hh_del) { \ (head).hh_head = hh_del->hh_next; \ } \ if (hh_del->hh_prev) { \ hh_del->hh_prev->hh_next = hh_del->hh_next; \ } \ if (hh_del->hh_next) { \ hh_del->hh_next->hh_prev = hh_del->hh_prev; \ } /* Bucket expansion has the effect of doubling the number of buckets * and redistributing the items into the new buckets. Ideally the * items will distribute more or less evenly into the new buckets * (the extent to which this is true is a measure of the quality of * the hash function as it applies to the key domain). * * With the items distributed into more buckets, the chain length * (item count) in each bucket is reduced. Thus by expanding buckets * the hash keeps a bound on the chain length. This bounded chain * length is the essence of how a hash provides constant time lookup. * * The calculation of tbl->ideal_chain_maxlen below deserves some * explanation. First, keep in mind that we're calculating the ideal * maximum chain length based on the *new* (doubled) bucket count. * In fractions this is just n/b (n=number of items,b=new num buckets). * Since the ideal chain length is an integer, we want to calculate * ceil(n/b). We don't depend on floating point arithmetic in this * hash, so to calculate ceil(n/b) with integers we could write * * ceil(n/b) = (n/b) + ((n%b)?1:0) * * and in fact a previous version of this hash did just that. * But now we have improved things a bit by recognizing that b is * always a power of two. We keep its base 2 log handy (call it lb), * so now we can write this with a bit shift and logical AND: * * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) * */ #define HASH_EXPAND_BUCKETS(tbl) \ do { \ unsigned _he_bkt; \ unsigned _he_bkt_i; \ struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ 2UL * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \ memset(_he_new_buckets, 0, \ 2UL * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ tbl->ideal_chain_maxlen = \ (tbl->num_items >> (tbl->log2_num_buckets+1U)) + \ (((tbl->num_items & ((tbl->num_buckets*2U)-1U)) != 0U) ? 1U : 0U); \ tbl->nonideal_items = 0; \ for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \ { \ _he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \ while (_he_thh != NULL) { \ _he_hh_nxt = _he_thh->hh_next; \ HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2U, _he_bkt); \ _he_newbkt = &(_he_new_buckets[ _he_bkt ]); \ if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \ tbl->nonideal_items++; \ _he_newbkt->expand_mult = _he_newbkt->count / \ tbl->ideal_chain_maxlen; \ } \ _he_thh->hh_prev = NULL; \ _he_thh->hh_next = _he_newbkt->hh_head; \ if (_he_newbkt->hh_head != NULL) { _he_newbkt->hh_head->hh_prev = \ _he_thh; } \ _he_newbkt->hh_head = _he_thh; \ _he_thh = _he_hh_nxt; \ } \ } \ uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ tbl->num_buckets *= 2U; \ tbl->log2_num_buckets++; \ tbl->buckets = _he_new_buckets; \ tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \ (tbl->ineff_expands+1U) : 0U; \ if (tbl->ineff_expands > 1U) { \ tbl->noexpand=1; \ uthash_noexpand_fyi(tbl); \ } \ uthash_expand_fyi(tbl); \ } while(0) /* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ /* Note that HASH_SORT assumes the hash handle name to be hh. * HASH_SRT was added to allow the hash handle name to be passed in. */ #define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) #define HASH_SRT(hh,head,cmpfcn) \ do { \ unsigned _hs_i; \ unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ if (head != NULL) { \ _hs_insize = 1; \ _hs_looping = 1; \ _hs_list = &((head)->hh); \ while (_hs_looping != 0U) { \ _hs_p = _hs_list; \ _hs_list = NULL; \ _hs_tail = NULL; \ _hs_nmerges = 0; \ while (_hs_p != NULL) { \ _hs_nmerges++; \ _hs_q = _hs_p; \ _hs_psize = 0; \ for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \ _hs_psize++; \ _hs_q = (UT_hash_handle*)((_hs_q->next != NULL) ? \ ((void*)((char*)(_hs_q->next) + \ (head)->hh.tbl->hho)) : NULL); \ if (! (_hs_q) ) { break; } \ } \ _hs_qsize = _hs_insize; \ while ((_hs_psize > 0U) || ((_hs_qsize > 0U) && (_hs_q != NULL))) {\ if (_hs_psize == 0U) { \ _hs_e = _hs_q; \ _hs_q = (UT_hash_handle*)((_hs_q->next != NULL) ? \ ((void*)((char*)(_hs_q->next) + \ (head)->hh.tbl->hho)) : NULL); \ _hs_qsize--; \ } else if ( (_hs_qsize == 0U) || (_hs_q == NULL) ) { \ _hs_e = _hs_p; \ if (_hs_p != NULL){ \ _hs_p = (UT_hash_handle*)((_hs_p->next != NULL) ? \ ((void*)((char*)(_hs_p->next) + \ (head)->hh.tbl->hho)) : NULL); \ } \ _hs_psize--; \ } else if (( \ cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \ DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \ ) <= 0) { \ _hs_e = _hs_p; \ if (_hs_p != NULL){ \ _hs_p = (UT_hash_handle*)((_hs_p->next != NULL) ? \ ((void*)((char*)(_hs_p->next) + \ (head)->hh.tbl->hho)) : NULL); \ } \ _hs_psize--; \ } else { \ _hs_e = _hs_q; \ _hs_q = (UT_hash_handle*)((_hs_q->next != NULL) ? \ ((void*)((char*)(_hs_q->next) + \ (head)->hh.tbl->hho)) : NULL); \ _hs_qsize--; \ } \ if ( _hs_tail != NULL ) { \ _hs_tail->next = ((_hs_e != NULL) ? \ ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \ } else { \ _hs_list = _hs_e; \ } \ if (_hs_e != NULL) { \ _hs_e->prev = ((_hs_tail != NULL) ? \ ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \ } \ _hs_tail = _hs_e; \ } \ _hs_p = _hs_q; \ } \ if (_hs_tail != NULL){ \ _hs_tail->next = NULL; \ } \ if ( _hs_nmerges <= 1U ) { \ _hs_looping=0; \ (head)->hh.tbl->tail = _hs_tail; \ DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ } \ _hs_insize *= 2U; \ } \ HASH_FSCK(hh,head); \ } \ } while (0) /* This function selects items from one hash into another hash. * The end result is that the selected items have dual presence * in both hashes. There is no copy of the items made; rather * they are added into the new hash through a secondary hash * hash handle that must be present in the structure. */ #define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ do { \ unsigned _src_bkt, _dst_bkt; \ void *_last_elt=NULL, *_elt; \ UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ if (src != NULL) { \ for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ _src_hh != NULL; \ _src_hh = _src_hh->hh_next) { \ _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ if (cond(_elt)) { \ _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \ _dst_hh->key = _src_hh->key; \ _dst_hh->keylen = _src_hh->keylen; \ _dst_hh->hashv = _src_hh->hashv; \ _dst_hh->prev = _last_elt; \ _dst_hh->next = NULL; \ if (_last_elt_hh != NULL) { _last_elt_hh->next = _elt; } \ if (dst == NULL) { \ DECLTYPE_ASSIGN(dst,_elt); \ HASH_MAKE_TABLE(hh_dst,dst); \ } else { \ _dst_hh->tbl = (dst)->hh_dst.tbl; \ } \ HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \ (dst)->hh_dst.tbl->num_items++; \ _last_elt = _elt; \ _last_elt_hh = _dst_hh; \ } \ } \ } \ } \ HASH_FSCK(hh_dst,dst); \ } while (0) #define HASH_CLEAR(hh,head) \ do { \ if (head != NULL) { \ uthash_free((head)->hh.tbl->buckets, \ (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ HASH_BLOOM_FREE((head)->hh.tbl); \ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ (head)=NULL; \ } \ } while(0) #define HASH_OVERHEAD(hh,head) \ ((head != NULL) ? ( \ (size_t)(((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \ ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \ sizeof(UT_hash_table) + \ (HASH_BLOOM_BYTELEN))) : 0U) #ifdef NO_DECLTYPE #define HASH_ITER(hh,head,el,tmp) \ for(((el)=(head)), ((*(char**)(&(tmp)))=(char*)((head!=NULL)?(head)->hh.next:NULL)); \ (el) != NULL; ((el)=(tmp)), ((*(char**)(&(tmp)))=(char*)((tmp!=NULL)?(tmp)->hh.next:NULL))) #else #define HASH_ITER(hh,head,el,tmp) \ for(((el)=(head)), ((tmp)=DECLTYPE(el)((head!=NULL)?(head)->hh.next:NULL)); \ (el) != NULL; ((el)=(tmp)), ((tmp)=DECLTYPE(el)((tmp!=NULL)?(tmp)->hh.next:NULL))) #endif /* obtain a count of items in the hash */ #define HASH_COUNT(head) HASH_CNT(hh,head) #define HASH_CNT(hh,head) ((head != NULL)?((head)->hh.tbl->num_items):0U) typedef struct UT_hash_bucket { struct UT_hash_handle *hh_head; unsigned count; /* expand_mult is normally set to 0. In this situation, the max chain length * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If * the bucket's chain exceeds this length, bucket expansion is triggered). * However, setting expand_mult to a non-zero value delays bucket expansion * (that would be triggered by additions to this particular bucket) * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. * (The multiplier is simply expand_mult+1). The whole idea of this * multiplier is to reduce bucket expansions, since they are expensive, in * situations where we know that a particular bucket tends to be overused. * It is better to let its chain length grow to a longer yet-still-bounded * value, than to do an O(n) bucket expansion too often. */ unsigned expand_mult; } UT_hash_bucket; /* random signature used only to find hash tables in external analysis */ #define HASH_SIGNATURE 0xa0111fe1u #define HASH_BLOOM_SIGNATURE 0xb12220f2u typedef struct UT_hash_table { UT_hash_bucket *buckets; unsigned num_buckets, log2_num_buckets; unsigned num_items; struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ /* in an ideal situation (all buckets used equally), no bucket would have * more than ceil(#items/#buckets) items. that's the ideal chain length. */ unsigned ideal_chain_maxlen; /* nonideal_items is the number of items in the hash whose chain position * exceeds the ideal chain maxlen. these items pay the penalty for an uneven * hash distribution; reaching them in a chain traversal takes >ideal steps */ unsigned nonideal_items; /* ineffective expands occur when a bucket doubling was performed, but * afterward, more than half the items in the hash had nonideal chain * positions. If this happens on two consecutive expansions we inhibit any * further expansion, as it's not helping; this happens when the hash * function isn't a good fit for the key domain. When expansion is inhibited * the hash will still work, albeit no longer in constant time. */ unsigned ineff_expands, noexpand; uint32_t signature; /* used only to find hash tables in external analysis */ #ifdef HASH_BLOOM uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ uint8_t *bloom_bv; uint8_t bloom_nbits; #endif } UT_hash_table; typedef struct UT_hash_handle { struct UT_hash_table *tbl; void *prev; /* prev element in app order */ void *next; /* next element in app order */ struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ struct UT_hash_handle *hh_next; /* next hh in bucket order */ void *key; /* ptr to enclosing struct's key */ unsigned keylen; /* enclosing struct's key len */ unsigned hashv; /* result of hash-fcn(key) */ } UT_hash_handle; #endif /* UTHASH_H */ goxel-0.8.1/ext_src/uthash/utlist.h000066400000000000000000002371261334742672700173300ustar00rootroot00000000000000/* Copyright (c) 2007-2017, Troy D. Hanson http://troydhanson.github.com/uthash/ 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. 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 UTLIST_H #define UTLIST_H #define UTLIST_VERSION 2.0.2 #include /* * This file contains macros to manipulate singly and doubly-linked lists. * * 1. LL_ macros: singly-linked lists. * 2. DL_ macros: doubly-linked lists. * 3. CDL_ macros: circular doubly-linked lists. * * To use singly-linked lists, your structure must have a "next" pointer. * To use doubly-linked lists, your structure must "prev" and "next" pointers. * Either way, the pointer to the head of the list must be initialized to NULL. * * ----------------.EXAMPLE ------------------------- * struct item { * int id; * struct item *prev, *next; * } * * struct item *list = NULL: * * int main() { * struct item *item; * ... allocate and populate item ... * DL_APPEND(list, item); * } * -------------------------------------------------- * * For doubly-linked lists, the append and delete macros are O(1) * For singly-linked lists, append and delete are O(n) but prepend is O(1) * The sort macro is O(n log(n)) for all types of single/double/circular lists. */ /* These macros use decltype or the earlier __typeof GNU extension. As decltype is only available in newer compilers (VS2010 or gcc 4.3+ when compiling c++ source) this code uses whatever method is needed or, for VS2008 where neither is available, uses casting workarounds. */ #if !defined(LDECLTYPE) && !defined(NO_DECLTYPE) #if defined(_MSC_VER) /* MS compiler */ #if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ #define LDECLTYPE(x) decltype(x) #else /* VS2008 or older (or VS2010 in C mode) */ #define NO_DECLTYPE #endif #elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__) #define NO_DECLTYPE #else /* GNU, Sun and other compilers */ #define LDECLTYPE(x) __typeof(x) #endif #endif /* for VS2008 we use some workarounds to get around the lack of decltype, * namely, we always reassign our tmp variable to the list head if we need * to dereference its prev/next pointers, and save/restore the real head.*/ #ifdef NO_DECLTYPE #define IF_NO_DECLTYPE(x) x #define LDECLTYPE(x) char* #define UTLIST_SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); } #define UTLIST_NEXT(elt,list,next) ((char*)((list)->next)) #define UTLIST_NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); } /* #define UTLIST_PREV(elt,list,prev) ((char*)((list)->prev)) */ #define UTLIST_PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); } #define UTLIST_RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; } #define UTLIST_CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); } #else #define IF_NO_DECLTYPE(x) #define UTLIST_SV(elt,list) #define UTLIST_NEXT(elt,list,next) ((elt)->next) #define UTLIST_NEXTASGN(elt,list,to,next) ((elt)->next)=(to) /* #define UTLIST_PREV(elt,list,prev) ((elt)->prev) */ #define UTLIST_PREVASGN(elt,list,to,prev) ((elt)->prev)=(to) #define UTLIST_RS(list) #define UTLIST_CASTASGN(a,b) (a)=(b) #endif /****************************************************************************** * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort * * Unwieldy variable names used here to avoid shadowing passed-in variables. * *****************************************************************************/ #define LL_SORT(list, cmp) \ LL_SORT2(list, cmp, next) #define LL_SORT2(list, cmp, next) \ do { \ LDECLTYPE(list) _ls_p; \ LDECLTYPE(list) _ls_q; \ LDECLTYPE(list) _ls_e; \ LDECLTYPE(list) _ls_tail; \ IF_NO_DECLTYPE(LDECLTYPE(list) _tmp;) \ int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ if (list) { \ _ls_insize = 1; \ _ls_looping = 1; \ while (_ls_looping) { \ UTLIST_CASTASGN(_ls_p,list); \ (list) = NULL; \ _ls_tail = NULL; \ _ls_nmerges = 0; \ while (_ls_p) { \ _ls_nmerges++; \ _ls_q = _ls_p; \ _ls_psize = 0; \ for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ _ls_psize++; \ UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); \ if (!_ls_q) break; \ } \ _ls_qsize = _ls_insize; \ while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ if (_ls_psize == 0) { \ _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ } else if (_ls_qsize == 0 || !_ls_q) { \ _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ } else if (cmp(_ls_p,_ls_q) <= 0) { \ _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ } else { \ _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ } \ if (_ls_tail) { \ UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \ } else { \ UTLIST_CASTASGN(list,_ls_e); \ } \ _ls_tail = _ls_e; \ } \ _ls_p = _ls_q; \ } \ if (_ls_tail) { \ UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list); \ } \ if (_ls_nmerges <= 1) { \ _ls_looping=0; \ } \ _ls_insize *= 2; \ } \ } \ } while (0) #define DL_SORT(list, cmp) \ DL_SORT2(list, cmp, prev, next) #define DL_SORT2(list, cmp, prev, next) \ do { \ LDECLTYPE(list) _ls_p; \ LDECLTYPE(list) _ls_q; \ LDECLTYPE(list) _ls_e; \ LDECLTYPE(list) _ls_tail; \ IF_NO_DECLTYPE(LDECLTYPE(list) _tmp;) \ int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ if (list) { \ _ls_insize = 1; \ _ls_looping = 1; \ while (_ls_looping) { \ UTLIST_CASTASGN(_ls_p,list); \ (list) = NULL; \ _ls_tail = NULL; \ _ls_nmerges = 0; \ while (_ls_p) { \ _ls_nmerges++; \ _ls_q = _ls_p; \ _ls_psize = 0; \ for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ _ls_psize++; \ UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); \ if (!_ls_q) break; \ } \ _ls_qsize = _ls_insize; \ while ((_ls_psize > 0) || ((_ls_qsize > 0) && _ls_q)) { \ if (_ls_psize == 0) { \ _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ } else if ((_ls_qsize == 0) || (!_ls_q)) { \ _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ } else if (cmp(_ls_p,_ls_q) <= 0) { \ _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ } else { \ _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ } \ if (_ls_tail) { \ UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \ } else { \ UTLIST_CASTASGN(list,_ls_e); \ } \ UTLIST_SV(_ls_e,list); UTLIST_PREVASGN(_ls_e,list,_ls_tail,prev); UTLIST_RS(list); \ _ls_tail = _ls_e; \ } \ _ls_p = _ls_q; \ } \ UTLIST_CASTASGN((list)->prev, _ls_tail); \ UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list); \ if (_ls_nmerges <= 1) { \ _ls_looping=0; \ } \ _ls_insize *= 2; \ } \ } \ } while (0) #define CDL_SORT(list, cmp) \ CDL_SORT2(list, cmp, prev, next) #define CDL_SORT2(list, cmp, prev, next) \ do { \ LDECLTYPE(list) _ls_p; \ LDECLTYPE(list) _ls_q; \ LDECLTYPE(list) _ls_e; \ LDECLTYPE(list) _ls_tail; \ LDECLTYPE(list) _ls_oldhead; \ LDECLTYPE(list) _tmp; \ int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ if (list) { \ _ls_insize = 1; \ _ls_looping = 1; \ while (_ls_looping) { \ UTLIST_CASTASGN(_ls_p,list); \ UTLIST_CASTASGN(_ls_oldhead,list); \ (list) = NULL; \ _ls_tail = NULL; \ _ls_nmerges = 0; \ while (_ls_p) { \ _ls_nmerges++; \ _ls_q = _ls_p; \ _ls_psize = 0; \ for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ _ls_psize++; \ UTLIST_SV(_ls_q,list); \ if (UTLIST_NEXT(_ls_q,list,next) == _ls_oldhead) { \ _ls_q = NULL; \ } else { \ _ls_q = UTLIST_NEXT(_ls_q,list,next); \ } \ UTLIST_RS(list); \ if (!_ls_q) break; \ } \ _ls_qsize = _ls_insize; \ while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ if (_ls_psize == 0) { \ _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ } else if (_ls_qsize == 0 || !_ls_q) { \ _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ } else if (cmp(_ls_p,_ls_q) <= 0) { \ _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p = \ UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--; \ if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ } else { \ _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q = \ UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--; \ if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ } \ if (_ls_tail) { \ UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \ } else { \ UTLIST_CASTASGN(list,_ls_e); \ } \ UTLIST_SV(_ls_e,list); UTLIST_PREVASGN(_ls_e,list,_ls_tail,prev); UTLIST_RS(list); \ _ls_tail = _ls_e; \ } \ _ls_p = _ls_q; \ } \ UTLIST_CASTASGN((list)->prev,_ls_tail); \ UTLIST_CASTASGN(_tmp,list); \ UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_tmp,next); UTLIST_RS(list); \ if (_ls_nmerges <= 1) { \ _ls_looping=0; \ } \ _ls_insize *= 2; \ } \ } \ } while (0) /****************************************************************************** * singly linked list macros (non-circular) * *****************************************************************************/ #define LL_PREPEND(head,add) \ LL_PREPEND2(head,add,next) #define LL_PREPEND2(head,add,next) \ do { \ (add)->next = (head); \ (head) = (add); \ } while (0) #define LL_CONCAT(head1,head2) \ LL_CONCAT2(head1,head2,next) #define LL_CONCAT2(head1,head2,next) \ do { \ LDECLTYPE(head1) _tmp; \ if (head1) { \ _tmp = (head1); \ while (_tmp->next) { _tmp = _tmp->next; } \ _tmp->next=(head2); \ } else { \ (head1)=(head2); \ } \ } while (0) #define LL_APPEND(head,add) \ LL_APPEND2(head,add,next) #define LL_APPEND2(head,add,next) \ do { \ LDECLTYPE(head) _tmp; \ (add)->next=NULL; \ if (head) { \ _tmp = (head); \ while (_tmp->next) { _tmp = _tmp->next; } \ _tmp->next=(add); \ } else { \ (head)=(add); \ } \ } while (0) #define LL_INSERT_INORDER(head,add,cmp) \ LL_INSERT_INORDER2(head,add,cmp,next) #define LL_INSERT_INORDER2(head,add,cmp,next) \ do { \ LDECLTYPE(head) _tmp; \ if (head) { \ LL_LOWER_BOUND(head, _tmp, add, cmp); \ LL_APPEND_ELEM(head, _tmp, add); \ } else { \ (head) = (add); \ (head)->next = NULL; \ } \ } while (0) #define LL_LOWER_BOUND(head,elt,like,cmp) \ LL_LOWER_BOUND2(head,elt,like,cmp,next) #define LL_LOWER_BOUND2(head,elt,like,cmp,next) \ do { \ if ((head) == NULL || (cmp(head, like)) >= 0) { \ (elt) = NULL; \ } else { \ for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) { \ if (cmp((elt)->next, like) >= 0) { \ break; \ } \ } \ } \ } while (0) #define LL_DELETE(head,del) \ LL_DELETE2(head,del,next) #define LL_DELETE2(head,del,next) \ do { \ LDECLTYPE(head) _tmp; \ if ((head) == (del)) { \ (head)=(head)->next; \ } else { \ _tmp = (head); \ while (_tmp->next && (_tmp->next != (del))) { \ _tmp = _tmp->next; \ } \ if (_tmp->next) { \ _tmp->next = (del)->next; \ } \ } \ } while (0) #define LL_COUNT(head,el,counter) \ LL_COUNT2(head,el,counter,next) \ #define LL_COUNT2(head,el,counter,next) \ do { \ (counter) = 0; \ LL_FOREACH2(head,el,next) { ++(counter); } \ } while (0) #define LL_FOREACH(head,el) \ LL_FOREACH2(head,el,next) #define LL_FOREACH2(head,el,next) \ for ((el) = (head); el; (el) = (el)->next) #define LL_FOREACH_SAFE(head,el,tmp) \ LL_FOREACH_SAFE2(head,el,tmp,next) #define LL_FOREACH_SAFE2(head,el,tmp,next) \ for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp)) #define LL_SEARCH_SCALAR(head,out,field,val) \ LL_SEARCH_SCALAR2(head,out,field,val,next) #define LL_SEARCH_SCALAR2(head,out,field,val,next) \ do { \ LL_FOREACH2(head,out,next) { \ if ((out)->field == (val)) break; \ } \ } while (0) #define LL_SEARCH(head,out,elt,cmp) \ LL_SEARCH2(head,out,elt,cmp,next) #define LL_SEARCH2(head,out,elt,cmp,next) \ do { \ LL_FOREACH2(head,out,next) { \ if ((cmp(out,elt))==0) break; \ } \ } while (0) #define LL_REPLACE_ELEM2(head, el, add, next) \ do { \ LDECLTYPE(head) _tmp; \ assert((head) != NULL); \ assert((el) != NULL); \ assert((add) != NULL); \ (add)->next = (el)->next; \ if ((head) == (el)) { \ (head) = (add); \ } else { \ _tmp = (head); \ while (_tmp->next && (_tmp->next != (el))) { \ _tmp = _tmp->next; \ } \ if (_tmp->next) { \ _tmp->next = (add); \ } \ } \ } while (0) #define LL_REPLACE_ELEM(head, el, add) \ LL_REPLACE_ELEM2(head, el, add, next) #define LL_PREPEND_ELEM2(head, el, add, next) \ do { \ if (el) { \ LDECLTYPE(head) _tmp; \ assert((head) != NULL); \ assert((add) != NULL); \ (add)->next = (el); \ if ((head) == (el)) { \ (head) = (add); \ } else { \ _tmp = (head); \ while (_tmp->next && (_tmp->next != (el))) { \ _tmp = _tmp->next; \ } \ if (_tmp->next) { \ _tmp->next = (add); \ } \ } \ } else { \ LL_APPEND2(head, add, next); \ } \ } while (0) \ #define LL_PREPEND_ELEM(head, el, add) \ LL_PREPEND_ELEM2(head, el, add, next) #define LL_APPEND_ELEM2(head, el, add, next) \ do { \ if (el) { \ assert((head) != NULL); \ assert((add) != NULL); \ (add)->next = (el)->next; \ (el)->next = (add); \ } else { \ LL_PREPEND2(head, add, next); \ } \ } while (0) \ #define LL_APPEND_ELEM(head, el, add) \ LL_APPEND_ELEM2(head, el, add, next) #ifdef NO_DECLTYPE /* Here are VS2008 / NO_DECLTYPE replacements for a few functions */ #undef LL_CONCAT2 #define LL_CONCAT2(head1,head2,next) \ do { \ char *_tmp; \ if (head1) { \ _tmp = (char*)(head1); \ while ((head1)->next) { (head1) = (head1)->next; } \ (head1)->next = (head2); \ UTLIST_RS(head1); \ } else { \ (head1)=(head2); \ } \ } while (0) #undef LL_APPEND2 #define LL_APPEND2(head,add,next) \ do { \ if (head) { \ (add)->next = head; /* use add->next as a temp variable */ \ while ((add)->next->next) { (add)->next = (add)->next->next; } \ (add)->next->next=(add); \ } else { \ (head)=(add); \ } \ (add)->next=NULL; \ } while (0) #undef LL_INSERT_INORDER2 #define LL_INSERT_INORDER2(head,add,cmp,next) \ do { \ if ((head) == NULL || (cmp(head, add)) >= 0) { \ (add)->next = (head); \ (head) = (add); \ } else { \ char *_tmp = (char*)(head); \ while ((head)->next != NULL && (cmp((head)->next, add)) < 0) { \ (head) = (head)->next; \ } \ (add)->next = (head)->next; \ (head)->next = (add); \ UTLIST_RS(head); \ } \ } while (0) #undef LL_DELETE2 #define LL_DELETE2(head,del,next) \ do { \ if ((head) == (del)) { \ (head)=(head)->next; \ } else { \ char *_tmp = (char*)(head); \ while ((head)->next && ((head)->next != (del))) { \ (head) = (head)->next; \ } \ if ((head)->next) { \ (head)->next = ((del)->next); \ } \ UTLIST_RS(head); \ } \ } while (0) #undef LL_REPLACE_ELEM2 #define LL_REPLACE_ELEM2(head, el, add, next) \ do { \ assert((head) != NULL); \ assert((el) != NULL); \ assert((add) != NULL); \ if ((head) == (el)) { \ (head) = (add); \ } else { \ (add)->next = head; \ while ((add)->next->next && ((add)->next->next != (el))) { \ (add)->next = (add)->next->next; \ } \ if ((add)->next->next) { \ (add)->next->next = (add); \ } \ } \ (add)->next = (el)->next; \ } while (0) #undef LL_PREPEND_ELEM2 #define LL_PREPEND_ELEM2(head, el, add, next) \ do { \ if (el) { \ assert((head) != NULL); \ assert((add) != NULL); \ if ((head) == (el)) { \ (head) = (add); \ } else { \ (add)->next = (head); \ while ((add)->next->next && ((add)->next->next != (el))) { \ (add)->next = (add)->next->next; \ } \ if ((add)->next->next) { \ (add)->next->next = (add); \ } \ } \ (add)->next = (el); \ } else { \ LL_APPEND2(head, add, next); \ } \ } while (0) \ #endif /* NO_DECLTYPE */ /****************************************************************************** * doubly linked list macros (non-circular) * *****************************************************************************/ #define DL_PREPEND(head,add) \ DL_PREPEND2(head,add,prev,next) #define DL_PREPEND2(head,add,prev,next) \ do { \ (add)->next = (head); \ if (head) { \ (add)->prev = (head)->prev; \ (head)->prev = (add); \ } else { \ (add)->prev = (add); \ } \ (head) = (add); \ } while (0) #define DL_APPEND(head,add) \ DL_APPEND2(head,add,prev,next) #define DL_APPEND2(head,add,prev,next) \ do { \ if (head) { \ (add)->prev = (head)->prev; \ (head)->prev->next = (add); \ (head)->prev = (add); \ (add)->next = NULL; \ } else { \ (head)=(add); \ (head)->prev = (head); \ (head)->next = NULL; \ } \ } while (0) #define DL_INSERT_INORDER(head,add,cmp) \ DL_INSERT_INORDER2(head,add,cmp,next) #define DL_INSERT_INORDER2(head,add,cmp,next) \ do { \ LDECLTYPE(head) _tmp; \ if (head) { \ DL_LOWER_BOUND(head, _tmp, add, cmp); \ DL_APPEND_ELEM(head, _tmp, add); \ } else { \ (head) = (add); \ (head)->prev = (head); \ (head)->next = NULL; \ } \ } while (0) #define DL_LOWER_BOUND(head,elt,like,cmp) \ DL_LOWER_BOUND2(head,elt,like,cmp,next) #define DL_LOWER_BOUND2(head,elt,like,cmp,next) \ do { \ if ((head) == NULL || (cmp(head, like)) >= 0) { \ (elt) = NULL; \ } else { \ for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) { \ if ((cmp((elt)->next, like)) >= 0) { \ break; \ } \ } \ } \ } while (0) #define DL_CONCAT(head1,head2) \ DL_CONCAT2(head1,head2,prev,next) #define DL_CONCAT2(head1,head2,prev,next) \ do { \ LDECLTYPE(head1) _tmp; \ if (head2) { \ if (head1) { \ UTLIST_CASTASGN(_tmp, (head2)->prev); \ (head2)->prev = (head1)->prev; \ (head1)->prev->next = (head2); \ UTLIST_CASTASGN((head1)->prev, _tmp); \ } else { \ (head1)=(head2); \ } \ } \ } while (0) #define DL_DELETE(head,del) \ DL_DELETE2(head,del,prev,next) #define DL_DELETE2(head,del,prev,next) \ do { \ assert((head) != NULL); \ assert((del)->prev != NULL); \ if ((del)->prev == (del)) { \ (head)=NULL; \ } else if ((del)==(head)) { \ (del)->next->prev = (del)->prev; \ (head) = (del)->next; \ } else { \ (del)->prev->next = (del)->next; \ if ((del)->next) { \ (del)->next->prev = (del)->prev; \ } else { \ (head)->prev = (del)->prev; \ } \ } \ } while (0) #define DL_COUNT(head,el,counter) \ DL_COUNT2(head,el,counter,next) \ #define DL_COUNT2(head,el,counter,next) \ do { \ (counter) = 0; \ DL_FOREACH2(head,el,next) { ++(counter); } \ } while (0) #define DL_FOREACH(head,el) \ DL_FOREACH2(head,el,next) #define DL_FOREACH2(head,el,next) \ for ((el) = (head); el; (el) = (el)->next) /* this version is safe for deleting the elements during iteration */ #define DL_FOREACH_SAFE(head,el,tmp) \ DL_FOREACH_SAFE2(head,el,tmp,next) #define DL_FOREACH_SAFE2(head,el,tmp,next) \ for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp)) /* these are identical to their singly-linked list counterparts */ #define DL_SEARCH_SCALAR LL_SEARCH_SCALAR #define DL_SEARCH LL_SEARCH #define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2 #define DL_SEARCH2 LL_SEARCH2 #define DL_REPLACE_ELEM2(head, el, add, prev, next) \ do { \ assert((head) != NULL); \ assert((el) != NULL); \ assert((add) != NULL); \ if ((head) == (el)) { \ (head) = (add); \ (add)->next = (el)->next; \ if ((el)->next == NULL) { \ (add)->prev = (add); \ } else { \ (add)->prev = (el)->prev; \ (add)->next->prev = (add); \ } \ } else { \ (add)->next = (el)->next; \ (add)->prev = (el)->prev; \ (add)->prev->next = (add); \ if ((el)->next == NULL) { \ (head)->prev = (add); \ } else { \ (add)->next->prev = (add); \ } \ } \ } while (0) #define DL_REPLACE_ELEM(head, el, add) \ DL_REPLACE_ELEM2(head, el, add, prev, next) #define DL_PREPEND_ELEM2(head, el, add, prev, next) \ do { \ if (el) { \ assert((head) != NULL); \ assert((add) != NULL); \ (add)->next = (el); \ (add)->prev = (el)->prev; \ (el)->prev = (add); \ if ((head) == (el)) { \ (head) = (add); \ } else { \ (add)->prev->next = (add); \ } \ } else { \ DL_APPEND2(head, add, prev, next); \ } \ } while (0) \ #define DL_PREPEND_ELEM(head, el, add) \ DL_PREPEND_ELEM2(head, el, add, prev, next) #define DL_APPEND_ELEM2(head, el, add, prev, next) \ do { \ if (el) { \ assert((head) != NULL); \ assert((add) != NULL); \ (add)->next = (el)->next; \ (add)->prev = (el); \ (el)->next = (add); \ if ((add)->next) { \ (add)->next->prev = (add); \ } else { \ (head)->prev = (add); \ } \ } else { \ DL_PREPEND2(head, add, prev, next); \ } \ } while (0) \ #define DL_APPEND_ELEM(head, el, add) \ DL_APPEND_ELEM2(head, el, add, prev, next) #ifdef NO_DECLTYPE /* Here are VS2008 / NO_DECLTYPE replacements for a few functions */ #undef DL_INSERT_INORDER2 #define DL_INSERT_INORDER2(head,add,cmp,next) \ do { \ if ((head) == NULL) { \ (add)->prev = (add); \ (add)->next = NULL; \ (head) = (add); \ } else if ((cmp(head, add)) >= 0) { \ (add)->prev = (head)->prev; \ (add)->next = (head); \ (head)->prev = (add); \ (head) = (add); \ } else { \ char *_tmp = (char*)(head); \ while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) { \ (head) = (head)->next; \ } \ (add)->prev = (head); \ (add)->next = (head)->next; \ (head)->next = (add); \ UTLIST_RS(head); \ if ((add)->next) { \ (add)->next->prev = (add); \ } else { \ (head)->prev = (add); \ } \ } \ } while (0) #endif /* NO_DECLTYPE */ /****************************************************************************** * circular doubly linked list macros * *****************************************************************************/ #define CDL_APPEND(head,add) \ CDL_APPEND2(head,add,prev,next) #define CDL_APPEND2(head,add,prev,next) \ do { \ if (head) { \ (add)->prev = (head)->prev; \ (add)->next = (head); \ (head)->prev = (add); \ (add)->prev->next = (add); \ } else { \ (add)->prev = (add); \ (add)->next = (add); \ (head) = (add); \ } \ } while (0) #define CDL_PREPEND(head,add) \ CDL_PREPEND2(head,add,prev,next) #define CDL_PREPEND2(head,add,prev,next) \ do { \ if (head) { \ (add)->prev = (head)->prev; \ (add)->next = (head); \ (head)->prev = (add); \ (add)->prev->next = (add); \ } else { \ (add)->prev = (add); \ (add)->next = (add); \ } \ (head) = (add); \ } while (0) #define CDL_INSERT_INORDER(head,add,cmp) \ CDL_INSERT_INORDER2(head,add,cmp,next) #define CDL_INSERT_INORDER2(head,add,cmp,next) \ do { \ LDECLTYPE(head) _tmp; \ if (head) { \ CDL_LOWER_BOUND(head, _tmp, add, cmp); \ CDL_APPEND_ELEM(head, _tmp, add); \ } else { \ (head) = (add); \ (head)->next = (head); \ (head)->prev = (head); \ } \ } while (0) #define CDL_LOWER_BOUND(head,elt,like,cmp) \ CDL_LOWER_BOUND2(head,elt,like,cmp,next) #define CDL_LOWER_BOUND2(head,elt,like,cmp,next) \ do { \ if ((head) == NULL || (cmp(head, like)) >= 0) { \ (elt) = NULL; \ } else { \ for ((elt) = (head); (elt)->next != (head); (elt) = (elt)->next) { \ if ((cmp((elt)->next, like)) >= 0) { \ break; \ } \ } \ } \ } while (0) #define CDL_DELETE(head,del) \ CDL_DELETE2(head,del,prev,next) #define CDL_DELETE2(head,del,prev,next) \ do { \ if (((head)==(del)) && ((head)->next == (head))) { \ (head) = NULL; \ } else { \ (del)->next->prev = (del)->prev; \ (del)->prev->next = (del)->next; \ if ((del) == (head)) (head)=(del)->next; \ } \ } while (0) #define CDL_COUNT(head,el,counter) \ CDL_COUNT2(head,el,counter,next) \ #define CDL_COUNT2(head, el, counter,next) \ do { \ (counter) = 0; \ CDL_FOREACH2(head,el,next) { ++(counter); } \ } while (0) #define CDL_FOREACH(head,el) \ CDL_FOREACH2(head,el,next) #define CDL_FOREACH2(head,el,next) \ for ((el)=(head);el;(el)=(((el)->next==(head)) ? NULL : (el)->next)) #define CDL_FOREACH_SAFE(head,el,tmp1,tmp2) \ CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) #define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ for ((el) = (head), (tmp1) = (head) ? (head)->prev : NULL; \ (el) && ((tmp2) = (el)->next, 1); \ (el) = ((el) == (tmp1) ? NULL : (tmp2))) #define CDL_SEARCH_SCALAR(head,out,field,val) \ CDL_SEARCH_SCALAR2(head,out,field,val,next) #define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ do { \ CDL_FOREACH2(head,out,next) { \ if ((out)->field == (val)) break; \ } \ } while (0) #define CDL_SEARCH(head,out,elt,cmp) \ CDL_SEARCH2(head,out,elt,cmp,next) #define CDL_SEARCH2(head,out,elt,cmp,next) \ do { \ CDL_FOREACH2(head,out,next) { \ if ((cmp(out,elt))==0) break; \ } \ } while (0) #define CDL_REPLACE_ELEM2(head, el, add, prev, next) \ do { \ assert((head) != NULL); \ assert((el) != NULL); \ assert((add) != NULL); \ if ((el)->next == (el)) { \ (add)->next = (add); \ (add)->prev = (add); \ (head) = (add); \ } else { \ (add)->next = (el)->next; \ (add)->prev = (el)->prev; \ (add)->next->prev = (add); \ (add)->prev->next = (add); \ if ((head) == (el)) { \ (head) = (add); \ } \ } \ } while (0) #define CDL_REPLACE_ELEM(head, el, add) \ CDL_REPLACE_ELEM2(head, el, add, prev, next) #define CDL_PREPEND_ELEM2(head, el, add, prev, next) \ do { \ if (el) { \ assert((head) != NULL); \ assert((add) != NULL); \ (add)->next = (el); \ (add)->prev = (el)->prev; \ (el)->prev = (add); \ (add)->prev->next = (add); \ if ((head) == (el)) { \ (head) = (add); \ } \ } else { \ CDL_APPEND2(head, add, prev, next); \ } \ } while (0) #define CDL_PREPEND_ELEM(head, el, add) \ CDL_PREPEND_ELEM2(head, el, add, prev, next) #define CDL_APPEND_ELEM2(head, el, add, prev, next) \ do { \ if (el) { \ assert((head) != NULL); \ assert((add) != NULL); \ (add)->next = (el)->next; \ (add)->prev = (el); \ (el)->next = (add); \ (add)->next->prev = (add); \ } else { \ CDL_PREPEND2(head, add, prev, next); \ } \ } while (0) #define CDL_APPEND_ELEM(head, el, add) \ CDL_APPEND_ELEM2(head, el, add, prev, next) #ifdef NO_DECLTYPE /* Here are VS2008 / NO_DECLTYPE replacements for a few functions */ #undef CDL_INSERT_INORDER2 #define CDL_INSERT_INORDER2(head,add,cmp,next) \ do { \ if ((head) == NULL) { \ (add)->prev = (add); \ (add)->next = (add); \ (head) = (add); \ } else if ((cmp(head, add)) >= 0) { \ (add)->prev = (head)->prev; \ (add)->next = (head); \ (add)->prev->next = (add); \ (head)->prev = (add); \ (head) = (add); \ } else { \ char *_tmp = (char*)(head); \ while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) { \ (head) = (head)->next; \ } \ (add)->prev = (head); \ (add)->next = (head)->next; \ (add)->next->prev = (add); \ (head)->next = (add); \ UTLIST_RS(head); \ } \ } while (0) #endif /* NO_DECLTYPE */ #endif /* UTLIST_H */ goxel-0.8.1/icon.png000066400000000000000000003503271334742672700143250ustar00rootroot00000000000000PNG  IHDR+bKGD pHYs  tIME 5'HP IDATx铝}9繷ll,$H M & A)۩G&š5'Amfj*f&؞D^&N21ږDZ]DJNI$Ab!5n3/y{oOYFl4`1yjf[`8?y rߙ9~gM9+ؽ7'?{g^TlM:Mwsw>|{opk@ G~♗f>3Dki,6iK%Mڒ-n5sD`Нg/?_5Q]DH6y`cI,6mKw$MZm񽹻׾MW$ *WJRJ9qΊˎشt TEտ&BZҢD޷x8t@ s|6+`0='?[o\]/z#Iܔ^tr_HVTW+?[. *H‹_9tTH>ے-I㦼WgCkDdUmbz.H6͓_|kƄAo|4-IQ}sw A+5QosL]lԱӧ,/U}].q#6KqSf~I A +5{+\zmVnYoֻ)]zWIbi'\mIظ-w=[4{R}`~WuTW(eBޮ `ySNgtT9S[-sYgC7@;XҤ#t< [[0{[OL>vZ_=@W$'/ŗ_h^!qq H˳B"g~ׯT}螮8V+0򦎝>sCYWʪyyv,Jڒ&E Cف/G6A?jޚ *>C!Uߍ.qhˉNqDptl!Tq?0 cg}Pg{&oKr14jW@C"!CO]V]V H:!AEW$`H\x+N<3coKrCvi`K y?$~ve]K hg?Lvλ+ \(\+7hC5t$mNW$`}q3&o߹*V5E2_"}@WoJ&Hz˗O_zmքFDq Xnh`ޛzvC8ocH@UWg]0 >g|t?lC]KZi^{{7hGV V+>0ZjWރ Ibŝޜs}_ *yWS߬PZp򓟽ħ~)<F&}G8h=Ԓ 2SNg?C;R`+?"$MU[34?DD&?"6^z|Zq&zޚ AW.kNl_]R=>CV7mh UhLUʣ9g a4uKȯSZ2KgRΆ`:4Ц< [WUM}'Z㓮 >C'v_TO?(҄k@5p ,a@ԭV_IW cg}9Dz C]`˅U?/)+ < zƯw;O8y5tؤ- [‹_9t}&;m7Le`+IZ*bhC~b򜩍|A+@vԱ~͙0oVo^ , t66ao%%y36!> |"VD7$`}q3foL2 Yi%MZiޗGZ-=Ӳȓ>">P6 4HX+Ⴎ ؘ'/|7SMW>^ݫ2/ ]}4I7%n/JmlD='e|{yGIL6?ZW@[lҢ+@VUg3TG+K@qO~iGҸ%I{IK%1I1Ѹ QJ&˞c>0sE(a7;|sݯ,]lG?rXoĉkߕv? $4$nK4>Q-l~|Dc{JYw ) X;dںҸ%?O7KW]kӗ^=|jR?UzZ߼/7+6MĥiGNSt2DcbjEĘ(mIm|LxDu!M380{& eU?O!y_i^F]j?Ns^lA64nKiHu_Z ˾C|6.6.:ȰR7J%c{D@@Rcz2 7tu)VԲU'qA0 ma rS'}? k̔BfJI4W&="Q}X?誃mx]f' ]x+N<3h]mLh6y7/kԷ/> яӼ/..DҸ)I{IΒnU#Y@o"@5aw8 $nA$SN?7|Vܵ MޔV/­gm0 Hi0>$THJ3="Qm*g C7ϠDZr烷 0\.comB4#nԿ/".[Jܼ68'i=MDJ,{4H:)Q29*+9@Wd]Fęt<_W 񞡁 XQ$ M?_=ąmŐx9^$wVo'qkpv%z^w`1t7P$$KtwsL}Bڄ'>\ I+-?OKWWr﬿&In|V'%Y~[Ϋ&}ZFwH (nH}bJJY;8вJ U& 0|6/ʫYM&p/__{UR1?^p$/EEIiNRbqM n$ 3/w:g+Z,+`Pߧ?Б0.k r J,3/{[fh`v<`7D]v?Zu/x*"qVKx_H|E<$ %P\8@b~ё_m).;'`w  1}+W!&ʃɂ%Y{5_dCKw$,=%|֟h/J{x&.P1 PǸRJt4&:Kml8#;ȠJ+=sӗ^QWּ,q<`'^w_1/-u'?PJx5(V 0ֳJ#t$Rd]@6ɥ_ʕç1[Ap)眤qSڍ?_l5@_N]765Qi`up`uuPDj]IC" oYdYאwt8Z*Nĉ@M۔ϓ= PJah&\*.-m%@W5~ufQX)bxfE[9/Iw1/; h@oEߖY!XMM ZחAN @;xS#Y=a Y=I 6}gBP(ΆX~S+PSuB@wL5+B0 (~qogm%\"^ {5oz2 `[UbU6HVSKUuD@e~VDGuJ~m__"lL "3Må];x<`ժ{Q\Wտg߯.匈"w8]$)qJD9{qZ+ڥbTt$ͻ\xlr-k~RF6\$ԋףڸ$[]?̡4| ~@<d {+-Il&;$ąz߹tb v$4,UdY} F:3;})%vz>OI8(J\v柚'2oʯԾ@ks@q%+MdjlUbbG"@T C˷[i"I_^Я8\-6?s~⿲3"wȀ-yJ shh. t{-$6vUג]Z=\ɇ(ߑ.Z&XiCiVZ4qi~)*=?S &vPKffK4' V IDAT=ϻ'ʧG'ZV<* XgE0T:{;R_{.YVt̡/s:|>Du1QVOfU%Svks6پ5IE9 P&ĕ#J+qNI)68gDg& eVVL]0/vڥ_ʕç!)8>>-Umlv:-җ>ޜSH@qpK^ :*[JvXe=${Uy ŗ˻l10eh vCM_z|ghb˿M$[=^/٠miť~RZM}v%@DD+1bi-FLX!GΠYBW U픭;ą}6&?Us<`4+q/|K+t>[6PSVvH}홪*f _K\>V?xN :Qu/]~/S k+Шl{@tWmKvۄAQ+ER~XQ[])$_Z9%#qslwG@yp ]a[p+ps~WL4&3yEhSSYt|q}Q6޳dHƒv2a^I0ݧ@&wtU緪=*MH흳EFc#5k T>40lZtXA}e¬y"ѣӸ'ۻ5S5J8&Q]LT>)>=`vrљNxVt#_ _QhsSi]Ɩ,6.Z$Ci_cJ6W`Anz?'J+:uJ+ ]s@[#Y?/bM*@V n4nIqod[\W@4.&]#`<~n/꟭3Q^UD*#tꫢ8럝[sYvdZ{;uPyU|;f*]NՕHd\uhVE@k+ |y׋kjWW+r}_9Dگ&JW#xڧ sWsYkuJȻR ufR]]"Zubu$ڥbSX%@FyߦVj!BW@k^n`H<~n~{)S gJE^#խVP1/i-5kn{m}Hi߀+TW"kXyBM1|'@RG@q~;'[^E\? 0 Х/|'.,֚i-Je蚫i'ylwMosc眸*[t/*A>T\-1O]1] 9tS~eEl';z_TƷatڜ~ɓ\]%. 0 irit^tC/SΘȟT)__8آs4E4t;@)QZU.9gD;tх)^ޟ`G 3_}N2ј?B!LVTG-\@&DD.wߚ>`F2c+;2]Zu P]rĻbݯdz 0(禟̯ g3-E,U\S?͇:MnǻX=?3XE+t5u7ttl} \#OW@#pj;'{dϽ! H4}H`^ 0xHQvX|]@h\&_H&#=1'jZey -"NF9ӽE`:{ EWF0 w)_UӬFpKC0߮2ou :z[P' *ON699qJXȶ(XTe˝s,Zbi@4oHY%u(^U1gծ33> vԱϾ[s:.M*-Q]U/baWI8:THH8" _[#Y?/9<' <ÿ5HA:ts_9̚h\LT?YA'5OQz-9ի|ؖtc*;P(yW?+;c{!8[t_Cz[(%* , x9=i/%uDpzѧl U7ptE@pX/V|zdDlsh[|y-04)%"+l`w"~X+`w%M:r䉋3 7~߿BW o^9t|M&*L6)Dk GUTxdJ?K`c(#c]|a 4>@d-:@CiMJL$:rE" t$K' 4;У$Ա~9czVy-6_I eZ6sث-.K&rd@1dUi34) 8p}vKLߝtWGMHD 61qI008{c?E*l*i)6Yx`Z+Wmi?U!GC>4ЪRG@Z$Bw@>sΈ' nRW@ӸGn|%T-ZSt$n/ʻ_}H;ɋ/_>}Y_ 7a_^bN@^eˇV3v40 tJDṜΞX%Ƞ6RsY?g%ٜZ" ؾk>-Sj6nW՟;XL8 \fh2J3m#q&bpL"GI+8MŦI:M Zd$:vvWg8?M UiKsHlM9UG<0WmbO,!P #:ڵ[%H?#[Ifi`l,iґӐbSEH^r_+UVגHEYlW;年du3(ks.P"JW#qU{$4wIF(>9ΊMIFϱ4nKiHqOqC lcg}tTmj`TWS@"`cAڪid"-*ZDU5[%tD'gr -__Ji?MJbMafHcW??+*+?xDx/ؖۮ~TFS@%Ju%Vv:蜕_Qe?F[KŦw4:vvϿ1k~ʷRY_9k ] Z 7uf| &>PzZ/{8bs@{GWhA6/%,K{H>4V[y̅ʡg5Ʒ2C|1Μe.׆ꏁzNb&`@uďТ#;\Mؐ ~/Yf_7%[#Cx˗O_zmdC U_ s|֪~.\; ;R+ Ԣ)/)Z5qP('V^%! C"9i/]57&M|'+!S "@4SN~OJGa_  :'@/JVS搞&*CciH0V^ck^k8m`_TY#X^%|7YaşM;zcq'}ޜgH(G✿6G쮙?F+6qyNkR\~_~\e였*w +Ҥ#IkߦCk &:vvWg8?Et4;0s_ mO KMpWmN&440{R:$$:MTh@dCw6_y_ 6ic?yXԓ_|ӯf6!VjFgNƫ I4kuW~_ SEl +f;JsCߦmI I|l,M3ASN?oiS~P@"@i3TUW#T8znh-;bl5\%NR'XtCm)$ wVIG|6nF_wmnr$ׯ CvU %DdHTw]UTOem\ I"ܗfdANy6lm,9Qʈ651ڈa548D&/n/J^=5Hv{_@X_cNG?5Skb`fTRTTweo_@S߱T ]G\ p\*i8+.Ι04'c]Ibn]*ݼߥiu~zn]x7:q~&k&kmÆΦ5'Boc;o_? | !Iu444ZL4o.Vr<`#ϓVIK:tj]OŬH:vvϿ1gL]֦T7咪V9+VfmVKaZ\ /:p7,uyQ ΕWli8':Sg(%986eຟ[n=qCUߣ}wH졓g5Ʒ2%.' szᢺRO{Go1I8(tV<1eED!ԕU~`Z Hڒ&-1ѸOFcai$@W:S'ۋw$[E7Y$ `YO^|K͚l  5 PP+WYG[㝵~*-%*GU~@IK9?1Ձ] ,u\K&-%[Eտo#OR%f8[ ""Ҙ>ǽ Egfui.W;؊93_cO8ʓ twVl>JPg8KjcI:MjbtTP$lط_qKZJ+idjw{љќg<W.^ ͙u5Uݘ8n FT@[̳R^\1tM$>)iEUU4Ӝ/UӞ1}Wm98^=||| , 9+bZ_`udn]>z]?q+o (٬PV"~{@s^9CY#8]k-|$i,%K\Z@څϽ~?kץ)\%piNʉ5T]ڻ?F%e )|N@ U]k^;E$4$i/25SZ%р,!`+ Qʊ)7!M*:)vvcg}|MtOHϜX6ȜlqqVl^CUeSvݸ[M]j{EY[. vȇ/4|_K<' n/H.sׯ:q~F? :X+V6M:ɍH$l ȎJb8*qkAjDG5J0hK[Ju1CNsC/_.߇.2uc.k: (%bӎXuUgťi?[dd្C>){~4qCa-Zjnl`+ }q͘&Y5;'fzp-I!]I:RſtDӓ%.W.]mi-DOu,gp%`WYtҸw-AHzge?T7aH`wx˗O_zmdCL|JbWӬPqWU8McΫY'?o}_n_֊s[r7cdrߣ2!x\t?g6uFsb+>I㒸9/qhLU@T_wx_*+Zt3R+<Ż $%FԱӧ^ZD_Uz.WgU A~/2 YRո%w?wn_{SndrQ9u$xIƢm{sy´:+@LSJҸ%ژh\r0+`W qI:K-V du< sb6O"$03^+R?3oc6kcqi;l*9mv3+4Tه> 7LT&=*=c[hkK<@Hsb]0R@*/ $4tGL1*ʪÞ)k:>wD$023~m??U$I8cDGh-ݒl~?n]ܺ ySg1nt L _ڭ9+Tۡ:>ޖp]dr1y G IDATg)*Ukzqj-ݖ-2D qږfD]xG+ڋ\HHʓ-o-jb!H;^rd_+U~TG:Xq¿4nvUg2aͥGYנL4˭V<~ADF)hߚK wE·}W帵( "g}}[tIV1#kMwEe&ƍ0kry slN N#|LL~Ysm6'ߢ]U<ԕHkci.|$HT#Q}2_%l*Et-?4p XBSI8[M~ ߼YۋҸw}*^+O>3Oς~#\iRk0ɝ-ŏ{kܿ&~竲gc` P3x LP۞jXw[@8`%`G"I4GIH@?Օ Xm?'[KoT<]Zy1O N_4g1Xa W#V%4뢲#d~2׸o+%r|g[ӧdŜ(qkA7drѐTTV>m![G+W<.>, `C_5>.X$0$N?v&Բ&Jk*E6ޮ#_/V֒X8/L?ҮO7Vk>>o&t<`uHn~]o"}dnA콅-0`O#[\>+ {Nւ7sV&:&{sa` K-n|Ow~v;T+Z@&o_SJDEȿ2W6OL=.bED9q4+~u.6y_'[Wi ?Pr'F(z  IJZ`%8'(68Yy6Λfc^Ҥӳ˹GC?ȅ.0h.ޔEe剀տGN\''P^P SQڈRZ:!HyOKw&5?sզ<W0H`xSY`Uki5KcIҎhSh]QFP pl?\ E~0R uFT%$OAIHycOW1@{_ 鲣ry%6d@1g흈2bh] t9`-,-ZӥQ>Goɝ`"`U_#'>jnx;\'-g<1qsPjD/h#Jb~P4&&v$M:bD=2-ےMqi9ϋ @C{g(d|-`wG@.SI: QڈlNKCdU'ے ? mr[\ɍ nR8.GO}FN Bi~3[o}c6.{zL6(]e|]?Dv8W tLLMcI[I[ւ$$Ub{_m34fpm@C,fD2o֥d$R". $%"?,PgLe@sXuU i_JH)Qv[r[;YSsdq.{: @kxn>u|#RߛWDiWGap$ڤl'BW@v&۾1/I{qOjl@Ûpkdt,ҧ#@a(✘ڸxB0_herH4Kܺ??A\_y_GO}Fzhy?6~`b#E˿D( 3 a7Ws.ЦtLl-bmI{|b$Ikѯ(WV]BX$0l|?uifo@y`ZlH$D 1b`I)H͵7_7Ӻ_TC߽9Wb6zI6_} 7 7_ȍw"tS'Q faV6(PGuTLTgS}_i;8]Q8"P&~V@T#I˭iZ߹\Z;}:o[>[?8N@'Kj7}">N4TԱ9TNsO_= ]4opC @"@/dI9zٷD3o}~KUjkda#NDT0+ id؞tVyGƣ iw˼3yK7_N@iHY>mpI>,pnXߜW9:WN͹H uMx}yMDDzA}g 8$a=?0(?ﯴ-=/$t$. C qA vCҤm&_ $0i|z"&'$np~v"⬴ӸV+[>l1iӸ%6Slߺܾ no5?+:)NqW hP2ԅ6uO( }PC4jq6nKY&}G!_F~7e"Rۧ# @M;nEz^YpNҦ+Z#N]ߐv㞤fu_א?DŽ]x]n]{S Tɍ|MndIy%0ی/[뿷Š?S}ӡ_mI_P"ʈ1'LMNcXdo!i[$qKbXMx a}A й|(`~> tJ|CXjs&}as@BG@ p9`ժ4O` WG"޼\Pbޓ~'`[mYSMv{zVmdyh`$ڥyWN%:)6]Oi~&mI6w$0+E C0_s4i~Km|X! InMיYU] 4n" R)ċD;#fF }X]ۧ5_E#1ۡDQiPȑ( }-g=#2"ou>C"2"#<9߇?P7X7<Ґj|u>.Hl7/~ _S<MiP6O-CXMY 2jX/;"`F ;d4|1 &sWY}N%.HDxi $%` }S_jl%Ǹޟq~{X=;U7Ըv*4RN>b4Oo:kh HT)L@V&h mt: wu8 `1 vrGb?BT0&#ԋ:h,$>vc:›m"6'BA{1nVݧb4qb,hpMN\+2Fd}Q!Tc -wOu]RBR 4I-Pq&Mu]'="BAu,2`0`5@v3˝ *hK;{݀h,B cHmGho?.&_}./5?1[xtǜ{xDMl<9|_s_bnh6Zk=d,wV b0:Rvd#ɾ 0vV8M#> ELRW20BHdV:uI[<]f9gտGH;y?UU)a;L(Loc'p/%>,S-HP T-wϕV𥊝h`2Jati@҆Nyua@c/h#P~R.=nY"`$TwЙp`aLG0._ b/+'>s?Qnã{? 5d.fQxHͅ\>~ӻErn&jAN5V`}tvZw thU֏`1 @vx$0btZdQ9]x QBig!h JS"zWi{;hw 'dS agsg^ÞSJt [Ǡ⥙ !! N4P&w+hNz=贓;0 yÓ;w_:`c:"[ Z[<<ѝ]u%t \@I:by[ʿ'O8$bz1ݭ{| ]X:}uxm_/~++`u!j?S# s,De,c pwUºRMqyZ5JoCTmkQB\/ uyg.>;h4hWu-:w3}tQ_Y_1WNC)NT1C. ̢ Zgvի͕W6- o\={ W3ߞ C dsBʐD.dɾ[O' 1,n_QH헽 Zk7srFCU0][GÍm8tu4Gw3Ɩ8V/<0lI5ŭj?J"@P4*v:)n Thʯޛ:mݟ^~sϹ+`0W` Mc pD@ *V6[+XZ"u5 l7"*WUM<>2n!azIw~]fL]jﯿ t$zmi{e+KojWu)h`at Rݴ6q&싿v7d7?y'N <8\ =Aႊbp4!@;R6 #*XP߼sl;UkC H{ix.<0#m;ei7 =k; Jw.6饧2^?uIgHE`6&B!nX !UkޟaE!ݚ)D 5p׮^~\;Gx(;tx1dC `l5=wB&@| a@Rl {M%M<=Xycp^ {xcJd+zg.vfl#; V6,F8r]) tf%h;AW~K_{z6vO] #KCooQX2vs"'ªz_P'|g}]vL_XGw?EA0*!'0|X9y)HԃĿDlzF*);2 7R@vdv#t4{::;a_꘭RO]U&grTkD`{2HwAhf"ߜzS -xkU{=0uB=:);UWY+Q/~5t N`tatچXv`02qط}?.-BR,vX9uDrB0ZVxn`cgul_L 38líD'`pjg.>ʱO%  !KV^~~$0iR @A@@$GluTLBTW00UlotnۗXxK u\33!moOǙ驄Tv\/j1D, ]׆TֱCN &# lz)Q=3AxLjP7 )te0`0J2+˞g4+vJ5X:u$7߷BR7>;OmOm3rJFCj'Tt@r՟~OA2v/(>C 3/|jVU9}V"jXu ,Eʿ  ))Km\XJňˈ[Hp0AalK1)t4K䅔ϾO ߣ+s=RԬ]mDz'v(ls@t *SU]<}|[wh\OQSM'ﻃ_/e԰O'G3W}O4,' :@'l?[|`w09Vk%q ,|R5/!nvW&3[tYBN'u`t*@gk:tݿ]U;{@ ?>'%B xIYYDgk<BHDeG>d,rqtd׏ -dRԷBFD c\'`2\! d< 'X*[,gO`!( FP5 #;`x z M}C ]B0dUO5~Fd?,j BXrDWE&ƅC*ov.w;\?Ryݼ?ҿ#B|֟s# ^ &L ORňZ+NTɶ lW:&j@- h!n!mo ПPm2+Cwu ND 18 0{ z7[q~O Nґ܏\/<`18c.ʠw`0` x фy*S{4VX:^*e Ai"o!hbHD (݄;bK$[o"^͂Ҭ?#4L~5_ K]LUU:b:#v#I:#  (ezUI.`2BVV'B`[p<%0Q *mC-KkH;Hݞa/ }2iFw AN;t&gN_%1buV0qIOlj{ @!3219:'LuXo\ñ/_fQ#qFtO![י5jv&˒>I}>:@5`0`Jdpء3Q@t/n}"T@jL0Q6!Tvmm$0&D&E+#EHd ?&zmЀ E'Blo/~؉z\xk/%{S_jfm<XP7:Nf;yg1g0`0F ׈ִL? |U#WTտ?-xT P HDB&mco!tn- .Op"xl`'02~{X=;pkX=|}JE!- _y<`yul΄6}+5U?c`0`Q3 dƒ[+sG"-MlB @0r G~r N_cE ɟ8ټw~TJs1Ϟ4605B`d$@7nopװz|-$K<0ɿj:ؼ=`]g0`09jNԈd!%UJU?C8.n" T`R%B5Zhž#dJńvt@ x~[ǖЋm@ZQc@;T}Ò񭿮~ Y~!02!XqI羙a7-"3+;?NAD*nܻ1P|~/g^U1_ZRf׵JKC8v @F^LDEFW"3c/]iKƣw mcK,ldqn8J کn75"Nj?זKY}CkmL &1,ꏫdt6@^P O([.h:B0mԥ_g~ctƫB쉀'gյqmma2 %0E28}Jn%\xX;D-I5rMW{؟NaLJzaKÏxqP>t;&%Yq`BdڄSx:l?pDû?D{ mdz.c:._&WN=Pqb ʿvֿos*qiBɺ   0} Q#2*TV2A#Nvcd wT ۼ9k὿훠WMj^'.8(!_r+)wfZ9` 2.CVÆB?:y1Yd0`0Ɇ7n!"We?*YqX*jB ۺcl?9$nN?n ,屁4Lҁi6yO?pN1.:yͰoB@H1{.'/cΈ1|UUfW;"kQ#"nGxB8?Ӻ  ƁC"rm !KUU\qBhZ@F ݀J[q %;}ۏobw.{O[ǜOK {-¤I>Kxb<+ Jń4 /} YMg?==rD< @ @^4 &q[_w*DJ\_4"B(K]$VO_GC#B@KPO1:B%k!_D.! Fݖ"V. ڵsy?v{4G3[d0`0l&׶Tr!* ANtN=8~X7nإwYM(; vVЄ;KW^BZMXb6&b+ n` & &!Tbilw*{{2' O,M)` 0QqNw#<6v71ͱWeɇcD >E&o @Ephk+WpYd7"wS%"/Ny8oϹ[6tFo7c0\T?@us՟Q'BA H)# MFu&L܁N۸U{xpyv[s|^d.r2@nCJ Gtc wٓ-%?6O!מ^(AAh1O7c0`0ƕ7P ! 3Fg| G!3A.ctFPFMϽ 褍7Е^om~վfN\&@ĞՌ 8J Z;D"0jK]I%Օ勃Ld  )܍W}@V!> C. *sEHaLb&@m`ӏuoB6]W:xx (/>H:CSϠf]s|I;e"0zjI弿 г xf 319KUY!`XU"`TƎNat&j@E-贍v%l=1#as] t9oAc@tk LB gN~Us>%o&OixMk?K;?c'}qgr1F BFA*=GG“A}6[)" LڪxFQJ'i'^N0eZ X.@:!C|jпhLM` '-x@F"˓;$DUe7rd;o`0`ɯBFPQR5!#'(&s՟QPola@H`TSZ괅/_~Gw9"G@yP`fXUAAh X w_`E!5KUu C" UעoI`0`g'7W!j26kFqatM.8 I2S©PQ:j¤-<7p᝿=rI!YG0?FN O+(F0VBau NbQ埙$F1tg%#u!PW`; {]V &1ﮩi}3d-ݍYA,-Cx)݄;7pͿ $d;4N(s ` l-V\ m~ '?Gt<As? ZM2(n8!r {l`0`*n"n![QIHHW70ڶam#Lx A2 BՀ(IϽ_Aml=8 KJ_4.Y Pj^~]n!шOKXjcF9HGqN׼? P`H?P7@]@aw5>3 &1$&%anC0ZG Ƥu׵3Ӯ s AL4mn@OoZ⇟&NU8l& ʂyOFv5D$ ;A48wWXq$ȀxW#o_kbA>jmnJe$Nl-> &d@`ilX@j7& ì% rBPy $ 8["` lo£?*.(~ߦ S/H)U#`Z"@nWݸ)+ }:z32>  Ƹb~mF>@ icǯ DV:4x瀨h!huDAGp/,w[2EB`D9+ AN-=Jfɱm*i_Uvz2@ @\UE* clhCHSe  "@k@j c";o k^1 {ćŽx A FLԁt:n㹗 _[?BY/`ꈾ~Vcw!JsDV109IhNl(6=NuI_'AL=8qe5d @`Xp18җrEJf) =+{)l/-Svc:{ϠΜNJ"s5tN~XN\ƙO*@ 3}( ,$AnTU%'mm[hVQ˹,T| v_͒CQ K(=*JVT|+?ʊDocWԚrO~ֺ{?'##}t?_StAD@,j  =2@3]y  Ƭq^IF;/DT AD.8"@*AZ;"?lTJ,cĢ ?7uK|4:eէMm N``[RO4`Z"h穫Q MD2^+M}9 s^AFn.݁\7ȇ\DES{ԫ_hu NZvyϡME rĥb8ağЗ #' KAq5H;"3l??䋃Xpc2@`|G B#@ݧh-׀%\L\5.JX)#C*;-u# iϽ 褍p䗣LOն/ԩ )d` ihc D'`^pm˿?sߕIF 官OO /#6LKv9"h`0`0pj |k$t>D$2A%JhOhiWvYZ2Se]@O?[?| GYi>?\I-([1O)W-~+/x6:c('ʆqDqK"& &Gڹ XF GFT"2rDf&EY& ݀Q *Dک||㯰qNA{`L ˕u1z@R5pPcYH{ ovN`Lp)`oO_OX=AI H>dG7y c72*8G̈nӛ@I,P{2 *^#@LHMԐ:v (݂N8yX; t%|}>#SK?1x` ]Dxju#hUgյbii?U?j^ϐE@92 P޾rH P.o`0`9 (N 1* 0: F*' J<Zj p-RY7>_?K'8| uIƸ» _5$-x,Z% ݱ#U%P2 ]Oj@(@D`, x138җyJ6)@.CyG[?À( PyK)D& &Zl+dT"r^3 WO] Yрdܘ>.%yQd_Ү& g|Ÿ\gP~~.K/gj&a(F ,?'"'G szOiRC֯ik:m#acgXp13xxk}W)ƉuuO `ʮR  `,4R f 0s A:0Qq>p:Aim1dbT eU6:W?8q8}/,܈@$Yf2̊s?7i oG?j̿P5-臮M{YfL>1B`/牀J"kpBM߬e A݀Ȏ}޷DS&FZ[| :,׏ tu,(.^ ,/_di3_Wqӎ$`f,"wT~s޿ gje3~1rIm}O( cwA%'0A? fD)hO(;,BsYo!&TqZ"yt3x``/1@@m<'_ʊM ]7%K]Ph:m3ż,XfS1j^wʉ?me ܅݃ :KUg"06=`PZΊ:bj/oJD"ȑk@HHc)Xo0#ZvR;pgqx}l?u'b'# TT"+߫h๋_ʿ'<u1୹ : 2y leT^9pcyz "@ExszU T&-V/}w՟FM$*aއ8r2`dߤgfCП %"h% d,"rU)]2j (݂۸\o^rA8?` ץ3W٠DHKA 1(DzN\.f=)D\pЖ6Љ I `V{c0lȘ<÷>O7ʎtGhh*t uTNP@zUj x| ڻlбsr@g!(z _|zkQV/@ѝWv}[_Mr=Q%;ly~Bֶd#!7K62r_~!U5 rj\ _V/KUҺ:=_F9;{YV[۔AQ|?yz-w0f ]J7CE)?O4P 90c]e.RUGv4 1qbaGϽ l>؞;Yl;J0,kx@zt9ؚ@tlf `YOk4Hw=oIo$.]_)B'@y%P`T dM!I(QkX@5@[ѰC$X菉d% A(m3 cÿ-> bH@KYЛXD x!bIufwJ5tiFiyOgBw'TMTƨU-(}~O< c2.UyS gP{T@'C'!c;@2 rmM(݁۸k?.X PاJ'|@ob:M&JLouBvn&埌AUB}#{^H":O8%"#H'{  Bf>vC&ɾP9kh}`$c[ A:5av>)J@5Tƕ7pp]&F_`0C #%" !7]#ƒ_k&n7-"L2GX0i26a_'A\D9>w$+Z2' P~^brX`, 1s7 լ{@@f#j AJ6{c151%^NRzVq/'if{:$al/Eգ蒷; }ױrӪфv@QkdiXM Pq3#Z#]5bI+L 0GpğF눀8@ݺU u3Nm->w0f0cc>"p (H-X1V\}WMlKKP 0 A4s ut]贍?c m^\O-P C  8+ IDATb"[B)_ѠL\Ҁe"4(`8`_EЩM{vBK,JcXBXysʿ=?c+Hpqkxz:nzQ''#"#0`,ZM0lC/JIJQ=i/ꔿa~)* @ |#n&  DN,_I`" p0N,PjP#@\0Dh,AD$!i*qg.Y"`Ͼ#ALf+!-BR&oZD:}{9C;P, MR;W$'ɿ5+叔@%Z}ޑ_40|n2L0ME H vI9a)ۓV dvF7 Uu N\ t OHU lR&Dik&U< x5?ix?Y俔_.ԕOc@]D@u_&x @vd0`0&]#gD@UW@ aE) ,D@J@6H <cEa% %0*qHmq;י8"C:98Q1~Dsk~QK;>YvۑA>_7*0z_D64Q>j`0`0&7޾Fe65྆D<g{H:mȨzoa aZ3k7!m70Jatl}ՀQZ~wqܾ]`F^d HS:׮IT\z`eBXMGR'߼ }ҟyIXvBz/UA@P3~]#/  b.|)j,C-AHqdа/U= vֆ0YL,o$dԖBN켴i56LچNxz:wR,zSb΁lEYR{Pލ|:f_|͂`hBstIk!v _L_߶ʔszmjvM(VjVrJb'΄j-~ y%sMXmE:{yNco=WrA7ЀH{6d1.R+t0HտoB0s hT. 2e&p].+Xp8ܯ ICPb$@_d-CQ9!E{Tceel?0Z ` `Yuwp REJ鄿 }UŎʻG7шSOѱL@X N^ ;G9`rD`Et{B|_Gosw@elߤPe?L_0*VPРG?YGd@/!0G0 &dTu#gdDv35:n pU\OG9f@D@ AZy_ƃwq ,7nZ8kO;Ȓa75"s*u}Ta.7y !WL>z_~Ǣ+y(Mjw͓0dX4`Riב1,FkWqu'`pfqhKd,0? Po!-N_诰k[|U1`b*ߌgF1b  ! \H$X@Zp(Z bE1Wr9&FiH'DV'.tqce.aǎ?W>l7Ø WIIv*{4}T=(Jٺ?6_@  ƔF7Gd@BBvIUWD@gDIa}!@̘iSD Tm)V (9s8q5lܿ;?slMKWoC `ޟ\}?u+l߭YTLw_ȣKد{8@ >0$/ySh &3nx꩗oN[63-WN}b>5fu i&テ~dݭk|0L0SHQd`<@vBJ>D<H. E5,JPD@Աu pqkIwwO|Ҕr2^}'s7'Gt##m&TM쯻Bn3f\O`Ǒe"Hu;`t?z{ c @dA䉀9Hd6ldHHd0)Hh4وx /wTQFр`J6;o6~ot[ ?ﯻ٤j:ʹR_z#MDɁq/C5Wftn'Zk`8<|.]{=O@Y,wU!@fYyOMZjZjrGx N/ӆ':4yat~FZf[?&usI)#Uā}Gw " ^ (k `͌VI &1t2hi,>p\D1l#\}<1|B@ ox{D jB@=ygf#Ia*%lE|^f\"gm–"PӴ41=xr?5/0  *-*Yn4DV9?!\ VP|/@Ulm@'l4" *%Ra1EH:݀򛿂^}~?ýO?׸ڷ%Ox]Q:6"lSWoZ쯕BcN2<UZOq~O~xJB|υn} U"9!@@#9fӀ_qST%|>k~q. K{@ @D _` S8353JyUTIE}Qʌ.5>B0E@ h3 w~?5v[?HglarG?OTRJ|X/Ǟ*p^*k`ZŭG+ՎRb~2@W}hAA  y;@ƾ@p6!Epq'Kl @*3HPP%k*4 t^S -b uJa>لIx{ o'aٗ+=׿#)A~kH0!Oǰv\w ~pIfE. ̍gɺ]/9"rueO8.] @ X2ȭ:d*fMB !@Y kRJ% mq!hhEZB%}X 7?KG'gKv[oD :N~4/OGGfӔnfM6W,]+ 0n<贋i\KpD.- +&67LW2tI Jl6=7 #B'xB;x{SCğ*윓4xz.#t2f] !oT lL?:;ǟu08|0*@`?ؠXń+ dB!`y%s_|5ZZA[^x ^< ߶JD &gFc3MǮ?-1fM68vHVKWԾ% '͖d@` r%eX[!--p\(-VYzDk,B&`e9>нQ{|?mӴp??3seU}afHߑcD @ X9̢!z ʗ.;?B Z)+P2 , oAX00_q9B0 do|^""/|/>tϷԨ{Iɿ;Fٟq\b!f+I0Xω\郿aM>uBеZFPi*ŵ[߂5#G|tRgg>6SЅ{1/t_X<׮ $"@eWw!E 4Um6nfҿg؁~"+Arq:wO Pڴ#VU )?O@wq W+"25@iGC>L:ě x;ظpKZ y?a v?UHi϶04cٟFψ_Ͽ/wj+c0dC_BSfYN Ihս_!KwK^]%Wp|y9,,f?yB3^ǟ';Q; E6 # C ^A^`azf@plMФZ|E A]H@i4çHcX3RR~+ ƛūпxհF kXk܌oFv'u?ُN8fhnhA w~>L3l: R9rO JEM`vϳMu))0Hɿ`*F!as@P`/}]t3:5]ϗ̌oyѿp h/XXt63J~kǍ3wff 3俥55[3?C ͙7'R=3 B!րar_{vJ)0Qa+G\йWYT?+.b.r6<| &¦#1i]K`k!6.]՛2 Ͱyٷ`}1;Ùx&s/$4_l7?D?WW^(;{Cw  y$pz|Ofa5) E#5yU{bs`ʙQ{H L-|/`vA>ؓZ3x2/ce\~/J+րd߈*0 _:.EqaQ;9_r}}s0 w IDATc\K=uN-D^Ews+Dp! 3 l(' u@B "-%xv+ni3jŲQ3v+@OqM\~ Z5& P)M|>oaփt̿srgF}E":4.Rĵ4?GY`b(+@9_ml$G ,ri?,B҉ #%s{ѻpoۀJPR'. E j-u) q.5ֵO!`5fv M m(/Hs#gv!Φ_2)-v-g?vfX>>%_w|,L ^K{#d gR Xm|pK`!UTl(P*Dy4Y f`LNHFot,t0<|V&vmz=NN K1k ({c Jk@g8EE\z: ' Lr*E_:al5 m!D_#޵ph6H`rF+6g=*"9y.A\ 3 l@ &0,MakظxX'TAw=pk vߤA~"q|VXHuP\ i mnKoM'@yA t^"EC?[1YO/fƁ8sfUUT4#ǥYYvǺV[@`X )*2PV;nBoâᖵ>JM*]qOd?;G,mL"׽YfPf ֶ P`/>tBkH66a5Ԯ"S/~IX2gۈ_&EiL~ڥ҅eU"/G\8`78x_xf⿰{ 9\!k%8"dA_)b(zKWUOZ<& Hչ&-wq{D3}|xbBӏ{kJĕBpD Wի5eXauH∿u84*仺zG"K<[?夿lW{_"DKY6ۖL @ X6K+]1DN kB$=@)'("O6qV`Lfpy֟b%&z^jf_Hwk ċ(yr իؼr^٘w1!8UoSi9AVFNL#mm䟹C ! *&bGHie$ }vx׷)vGP;!:MiE0==$%w< !+_` y1@yb$B"-{zv0럗iNlam ȰbPU\`^PٸǺ13"Tip"_9h_((aGy?z__3o$|BK"T|&ʜ ;5r=DV;o-T!jV *aRRB*@Ee{! e!CgDxђnI2dBQbeʛfBcp2t+ѰVU,ٟ5FV#kmMf5FQV/\kU\S vTs_p"+EOpt`nB`RB*G=WʽD)?*U!@ip?J/`e).N &yK@Z RH6zظ| Iր 25' \LKYx_Vo+C&isM "A;ǟ˜87>/d:徟1N @ X5&U4W MPMBֹqkNV?<`'\?B * ؋&q"}k[i :Vq.~O{rQ^E;L2 Łz,`(dB1=/:#tE+ǟ@ @tJL &EYZW&tW xtx4lS["%p,vO'*a03$[To M5HQtwIKHz<9@0&c^ ?MJxXYfUtz+s^}1?(hh;.iA@`?  XҘdGzRo=B)`x]Q@>S])ܼDeOE37d2wK~6̽ pQT*YRHGcq a&7a3˴QoȒ) ]r$?S_&p3ɫNG+Ѝ.N:\q/~㣧ž,@}P  / ؛[Td!"(.Rl)5 B"8?'~< bVgOZNR|Okbx $A  F_@Fc]rkI`u ʪaUr@{?{4BT'f?J"f1?_?L)43l:C$3@peV{>bIi\>M"p# 1G(݃ҽPeX@GA)"<ܨW RŎ J!}3>.;ۂÑ0}Kǰf WnA?7fEO*X ,|MQD3R"z:n+rD[U_'77џ{(MG9󰘒Oc2HE@`GO`!X\To(XT‚re)ft 0c|3|@p!q7/ VoնJ{@(hGS|VA",=T=  5 5>wq{6K[#;ЩPGfm?WPElc Ɇ 3!(c3oȶs^`W}P9AcSu*Q{MXm?8UDaxlYev( $P'H LXPfa~1D#2?/1;<138)C'Xkt59 1`SxhH* WqrTE4KbLٴ qp: @俛TNMxt?`x<&L;}6E5H<I<.|s0/q zE@gMWR-9 HCeR 0 #  #hnFh>a\ĴI1!\:…d Hɒ_!_1+ Ųy6hR@:J\b8Ú\; Yz=i@Qdߟ(^c؆v.[D~?>Vq~(oDc@Wh$皝qc %D(PK T^CZ@0-%Wr}lݝ˯ُ"@*YM>Tlh)ٚM 69`w?:omo3IApD L X%35}kJ`u.xCt0#d`u0Xkr&B#+WŤkqW D}P"ٟb8ó' JWjن nlq&ks u>Sk@ @ȫq竢mFg.BP0-o=p7wP)I1s ٻeC "T;:k.-Cg)xSWq$%kD?Zzw俩x+G Aג <1Is?|\UNv!@p- 2_.{ /a<vDžI a */`U3O#9 ( Osh\K+0$TmLPڼ<< ? JãHG~ݷ߬w-(x(ſ[cA]N P0cEǨJk@ZPQ( 6X߭?R0o?_B'HGGflUeD7E3bF5 `*T,:eR{N kV cJEv03&Oh54FjxEƀ;_Q6,6jGR`j`R@s?ٵ+1@\Bb+{?IeV*pr| {)p<.j%n$`@y|;T~|vG{|4'jgR10ϭ <*C y|]:G0X~JlbjZ50X.?԰̤̰ ~N"rTp"#f> 'f_usØho.oրDbXy}әaNǛ~T>iF!u@@+[N ~E4"=#7),Y~>`'D9M X o(0 5@CV@Ad?o#ʐ {AJÃQ[9qZVRJ6qiJCqV+l T0 ,B0bԗND!VZ:Q;GKc-FzIW@H5:o1}wPSd7u#W2_ Pj 0wO"ߘ%-+ XÂ]sfHj@"]T?>>hoƮ4ܜW"8;/Znz߰bzɥnfQ i@8^_&XC#\ piZviϦ`y^?]M'L,(*&8w6ci,?8dcj)5 *d?/]ۂaeߕ+@ @ A!>*jJ BVi#4k3uoKe@@,ϐK){Dsr::ihv8B,Hk=ƿr1:PyE1 ȗ~T[_6YJ};#eH庙M`}S_r{(-(ZZ\H֌1/)+Dև>DaA6޺;!>0H>>M7[j-,u'P_B@=yiM̡}kXCRB''ǀ/86OHNPߍyk]GYam D0T+yHUB8@_.K޳f%aN]bU5qJ˽EU\` ^IJ֛FRzf:kƮy"+Mp~㻄UB@[|`P,R2'պlfL:p7g7k{ދlfc,O PEJG; ?.*f&O#NAf˿[`WCN60Cns4ߙ-@$(OڽЪ &~/\%Dfѓ;_-ri3!ՙK 1많B@C{@MY`&1jgEW!9(t쀨q#! ZǚK0Tfh5Dh-W"h b6۟m)_ "Bu,pG5):X2wRDStqwb$<:d7t`L|J v.֪ݘ\.|"V/N@Ҋt#ԗqcIa\Ϟ0 Wo{y{R Zʇpfh`fJ%0:^ǐJ'HGii>dnn7Yhym8>W=^_v j4GXA"ѫ>ڏ^0T`Vx!zzo[J9q IDATR|ya1`KIj2}R1 KυYujN ,?hЎ36=EC,>Ѳ8ҊcB5 }WP'CǕNZX3I`f7/c<H}O߲  ]#(R 7lc#_A  $Ya/  djB@X J[3JVOP*LKGRmvmJa+e4^ ?"o|o VF:t&i%&äòе߿.jL8Qj}Y&j,f'wn"*I?\@=`@j GQx@ @ X0 fB+:#U!X h97 K}_󄧸Lxi> S%]ۊ*H%57&с#vLMrdWGiů仉w5 ?SaP4f%~y.B`[6*Oұ3'D;ʴV:2`*WXU ݘjBĒ3F::kF֌)"nyF3HOAk97qF27=Uߝs2o+_~o1X|L,[ X'PIl#qES "+ymkE,မ;!>0*RktRل5#ʤ?ht "==i}]4Vv#kO0{(Fǩ?&`B\.gqol /lsKwr-;%&79e̡k # to 8w)D.'v;%B@X`|Jj@n}Tk5Sy_ߺ^tcҺ!m_P%EtN ysW`ka0ckvUM$O?;,3)o_MyHwo5O6LƳmם+,F qX ^Bz|3u?f~7Ugs_ӓnuʝoA @PP_;;Ow-B@ @>7"CeA&B/0@luW!#ѱsf)"LVÊ D #l 3¤zɿI3G] :=FAğ]% RBNQy<#+CXv7儤#|uK§X.3<) :ᮂSƙ&g@Nr%[*bN/>*cF6OO$!T^WŃ9 8R N)(&q3"@ @ XM*݄ES`ZpSr!x0"P h]Npu_vmjQuT!@.8cH9@yqԜ0I(\4XE :S[A4q"ѩ2:]`h WU-3enҡ?Nf2' B1_cEރj{.#-4̳M8Oī`7u__eF/+ "b. T4v<GD* o%I)',>aZZ{ÿc7%M fOlf^A6ѿx ʓ:jn%1e%d!lZS2!UX9n.b&f0C7AB; 4[n_16S_~ 2ߏ7A{e@* K^|]~i E@F1 9s&[ u%>0 6Ma!ކ7`lG6h4mn'BZвh'DK'1mĿw^ Z. ( Kv _<9+i^zۿfמ&Z`'z~<^B.N1xǭ-ikA>yfŖZEZm(GO2z-DU?M @].F1WSyQ5a`Oxmqf=F8w#8>,k"E;L#Y<"@.9 l@`&nr+ZJDȄ^2z˲QFX-)Ƶ#pȿ7[T$k=L@I$#T#OOV_[ CEFhhwٽͳz?<_~<[oc7'VUU>OfzOb*{ze͇ShcYt`uq+s`EV X7Us? {_bK\^}|-(>MMSάm4Kݢ!;_J@tzQA9?7/?cƶu>7:Iqă6p>*h_칦cvf]^sRq_Y?MXAgHXR{h5 ;o_}[{Ov\|io>Dv'S ޯj:1_ݾʅ ?Z f32nǔ8~znGӿ^c6_O 䟂KO//"DLe\4˹J a`tnҭ';/l[w"  _)r%JCG}<6Ȍ~% jԇK?3Zg8?[_'6ʟ{8@[T $[o1ؿ{a@pJP w#,Bgl `%PʲIaNi)ԁϺwF-8?DuKȿ % &4GWtoooKӿrȕA X $@f \z-6JՂ ;@&cSg(Ts&53>G)Y^E5#\r J@*Q\yq'Eh @`V=*Β0uR)܌a"mm?֜+fI~ىf96߽߭dL8K_7Oӓ1Y@@Zcͭ7k7K3lȵu?&Hl *B(4:/|Cq_?LgA|A`V D5V06PGխ9}3}'@ @ED  X^7]n,9" w'غ3*χߑcjszvN d՝i;F ԕ_fP(Iz}/^s> \֍o~|'@ 8!@VxͭK"r2iX$5 3*Ӷ&1w!2N6] @ kW\ONZ^,OZʥӵD 6P": -x @|]*hƥ6cdZG G!$7i[ 22 wg0L^vh?ch1D "E Ծ K켣17.B͗^ݺ{Y=@ V6`-͓pӁq. lHT!:Z{Du?!ZPgkľzw*Ef@I NMOւvmʂ|{ m6;{_}=|'rDQ/%")EI[T3Ji߉*zEœb^l-G 4?쯅Ot).>-D͛)lW ւBںp㵝gwp{'B@ Lݝ["dVөhy{+^m+ƀGg>_@}6_OHFv)_!! XU` 21 [omm{_~'A#PV<!'YNxRd/~fD6}Vƈwˈ|܀Q]\9vw?*yEt"穥ߟ?yu'R*J뛏 A%=l@{@ۄ_0}1 D{_.MR B@pvzržN*OڇZJ;G#z@08wwN;xq&N]^3'4gt?B&5I 1/Ā&oɯ|x W2AZ7&ҼjB1˕iMEE8ugaōTAXo> KkRC}f9{G^Nmw 99f'3wW(boHg\|H|"&`Y;'py"m-g:3Γ$`_|p?n7 / & < DNgS#_e '31nu;ǻvv^OBZk|,Bp`6+#ٸ$igЩEfjsbqUKx{?Gj|N{񓛶JSyBcJ!ȿҽ!"P' h H\kou# xO|Z6`p_o8H^BZuN|3 [R;0l-L:5ccS5B*`/y* |H\,y:3X7vwq.-K#.sY>|E9IdtA޶ߖdkamc:rcwP#Miڎ0a8z?ozi?"f7Ec+O7_dᗮ%ʟUGc[yo;pܱ DV\z-v'pjR",Y` "x l;cWT!*@7 m~1@Nn*ccX31#-7ryd3Uj*apOT_#6* KsfOh~?_9Bq\Ss;,?W+[_}6}iG",@`@<&?ͩ6sL}]xJ)Ot 1(Ry~Nu5Ň>Ni7,= f<8>zq&o@( `@'r!?3; o誫 Hk1t'Wa@`n)".!@ 8h*)q3y5xsLף-(=9`ƃǃYUQ(:+ tӌOW"qV`|ri7ڼv{ Pw`21 \)#X dV3/an&&vF٥?\ "FZR{K|8>z|d y=(2#]O6H72E?a~1%@i9H!ٸ2>d 7YmB7q30Pp& f( R ݤi6u84y1sP2X߰"37sǖAd.(/ 0W?-CTyMA@fS5k?ZC689_BL'U(0Y vBu2)`Wm_H{@yw!yum{I  IDATvzI46s\xpPU / ?mI(zք4%]|f$'5,N?&OB@i'K\օ?{D'wwnI Ս3Oo>-9( '57 l6['x/z@bktխǷ("㿝@kI Ƃ\Z"Ą_Ecы+nwN*:/(Vp-/>Bp47?fc0} U !/W5@ EGs҂)9-ۗ`sK'/Y92Z8+8AIX]RIG#Hή%N`z2$G@(BO=|J7 d[2 t뭭 7^9}3}#>UM X{m{ow +dDNm{&F>tEۄo/~|E,r {w@?B'8O^`8ؿU7=Ε )7S^w\šl?G8< nO2ϓL<^Ўr?wߥ$|??9% [q]*p5f ٚG?*\`ޗJ{c06jBƹlCjj@ɕbtI*4-o#?5DJ -@m243__mRjх6_ze;mo\}y+=>R "-xͭK, ?!@&PxZ=£4t&=ޗ=cJ@b U@bU fgeR`F`6v%7_n\-uCYcHf) Yr@’㖖%)KUI P1#8?+G'p! *at*+^~yV:<!@p `o)/hAp[xY N{޳OƛC쇸p z+uX9ˤp?,fmT:xK ٣:,3lH 0ʕNԂ3 CSb&I9 _mD ") ' Ox뭭͗_ana`Q Z7.Aɫ6̳"V,Wu /ݥ3if܌S:>g8:xWZ*T?k`ƾ4| W #Z_7wOE#HG'֦TQZTyz# ǍY@E$Tu2ȗSې9\2Y*E Dڥ  /u`'@*Fp:B _[xԗWRs<@ok (|Ui }^ MG0l~^_/Jh>/~607m\M/r6;L< G`M'O qրt4@ҿ q\XD< FGp/[Wt xĝL';Nk( mXGgfx%v =ybT)A"k ʭ7KF) S:ecz-H9um)}TDCК, d}%g x !sץ B}7py|NqqX~m?}?%: |܏Wid&>.;bO73/IBZZٵX :"mFҭ.x}x`юfA~z'v^&ȶ̎i[}x8(.N*&T{)cX<`%!Jn E?7O&Rн%^Nk>Y O•w/\}X|"nkۅ D8}=oǃ' IT UA6xtxr/.]ys@HG@kưLM9y=a!B:>.P(ǽ!F(-i`CBb #BÉɿwSKy96PEv>/u3O X_$ 51H]F-GOpO*W (ofwJ]sA+@ v*.̆1g!n68|d+q7{ ٸj 4u'v=<\E+fO QUZ0.m[fyu1KJ;щ"}_)BRki8bmT"Tطy[=1o?!P6_M R+^~y޻5KrWbۙUn$H\83=ء%γ#dxa9=8uF YFlQGD\F&tWUyۙZ<8뒕Ν{}zc:y0XZqvliaqO _/}W'%u?4?sQwKƌʷ/;TyQƏ.ORN@Xt9 r p5O?G! <" UEz@޸okwY0bx;xqa1∀/>gnڗN|UfVO -\ǁˋك=.~sP_J?Qp[^@X/t0&wbxoqy}c =\={bmC' . `TEq%$ {%6}ĭC(,89}O.=R^,0))hV_b`L9@k_7_Λg/~KP ya_+o *ټN@ ;ɧxpv3+/2?>~GyIE~^ ] ]+GmGfˋOp\-<Ӗ$>}[1&Vp`rɿH6N@"Z%Q^F{/)P Y_{  $(RXz?O4Eo#,6t ۠-'b@cq[Xk8WC} jx{VevShR$hrMA@JĄ8BU L@/=zׯͯ᭟{b^  ;tbV O{r~=zOn$@AIKrE%O|/n@82/Ϧ$W#L9)2_/o&?5!u&8D?n~޸/ UP@ BD% WO~k\]vԞI !!^ Egwp=nA:$L"(b F l(_ڻN?x`nʁסؠ@`@ wڳ*I2@fܸq=#WW("%SeEڑҿ ą  ?$xv􀅁6|,Ա!;6^:oQ9)e;᤾{_~[5nj?PSI;9S:eD GaIVl07HW 9 5jL4 N̟+L/QBPҿa }:ߪ'tc7t4mb=X mv×ҚALlʆ (L<_ 8:'1j߉Opoo7+c{; Zv=O~܎O8@k wـWDW $ 0P:ͮ]H#X(65XDGo+NRw~>`I?>dg2=w⋏ cr {Wq?';isSQMߨ8ߪakJtКϋ~¿C.6$Dqi}+gPk`1ErÑ.J䛿O_\=2tpo5ܸh~WsHo7G(ˋ?qjぬZNB/_uܸJs)GnC\گ0ף??nM;RsAHaCQQ' S\024ȥ ;M#>&n')=@ ׿7K.'r흟PqWpWW~}d)#r G/ڽU&yMˈ@Ҁ hp`jÆX蝚FrQPbtvA l: 1uA?e=_S}-wi>Z,N!#<>CʯWw皺ͤ;%Gh>wWONb7^zJ9ei0fHr%b"d"B/PF$)9-w)bY">Cy:+]qrĀ䟠0S}CL%{?{_5|0DĴ=^,)# ;\^|v#Tǽv:REX<5@4 HE8U@!!P^+ 3䟨R4ɿ;` @;o )p/9'O8d8E]i>W_|ʹ` YC|L~jЇOCT4 EB' xQEAMѸ3N}0*_I; Pl6,`@h!7Os //|:QB|ч~HTtC~xv=ԋB5Hm5l>:0}zr\Mc2sC7no SV8FN>./q ǀ;n>8x>W#Ae`?DNbd\T Ժ5fZHdwɤhdD 1&K!+TF$E3H]mȿ cs/}/.˄ Cǀo}{HE`m66`܁+]^|>ۋQDO5.[]_$!N1ǜj{㸯s`˥[5}2wJ7>OQj@B6"v5>!"s`5G'|rc"qzBt[p3dR|vyba%)2D*힎(}8;%S*gAoCQ@mٝ߱ݗ Fo7TeF(NѤ"W_!?o?(\R,22"U$ 8 N  d(LT# L\\ɱA fH un=L.0}\^<쟴e=m÷?7^UĴO=?:'?G:= _4v#@~,ð,  i&n~mO DkcHkUsm<6~pه{m EٞP?~ l`RBZBpulGg@\p f% t^^|?a%Ѣy?_7pn78~Ymg;$ Y AD# " ZqP%OMH b&B@Q/ڹcÃo;LG\OHB[:Qb@[Vq4@6J v3Almx1[!G|qy`aH ;SFvLds.L[F,L}wLo/& #NVqd!7Oή?qyr~scR;$~ MwmD?Mw!1x0><㭢xB!Ͱ?NiM 7F Z2-A[5"cWtB23R>uaINx^~i NRBBٷT Os!6vAH3%Pt& _|oypD7Ϛ0͑c=0n,֮ڹҾ J:E(.L B?¶uC @ 1K ]P c;6^BCky4.ۿze2:B0)h!ל cKO ?bnw-6AO%`:r"sZl㛨#![ -G"a g 'EK?{scSs;_-$F* jch*;!]5&0\:%4'Un:?HAnF /\^~}5ER(vI ؑ/˹,B B0N(Ls9aF{or%B fx#"9  7_#`ˆYdVu5֭`kռB 8OB"?.7xb?ԟ !|]6,o/ZE3G= Q2bj XɈ,PB5A0 ٝ@r淩̲E„)̷ f.Q^,];^AC=b_ݖA ߦ)A MCr"CJ&1ƚ?u"c snڏ2 PB -ӨY#Abw47bs\-P Y3 4 KG20_ek bJCUFB P1 &$&tHPPE5'"";&}MO f}oQtAbV%'cSg$y-S PΔvK-QBЦ@b!(GMS!j=" X X* >M[:kӜ*,%,IJ-v('iȿs~j@Xؐmshw=piJK{UtޑiL뜸7VcbbR@BC8MJc Y2?DF"&IqP:!9`HS8Q -8t-KȿjL'IL&@e3A' rT&oDmzK+%MO %H Y AvbUGTȿPK aKM N!?#+ϡR|0DGl)9Χp0 DDRMvέ `lwmDfH$ ƃ|߇a<&z  MGj$ɿRhxz`rh"?A.=rD|8>XJOhoj!(qt@BPm`!Xیş vk\@ `w@|hf768\wPVbڕ6yzPh>2dcIxLCTHbɉjH"gDos`Q eUiH&'8 oL3(48&Psf2 4k^B@ k)Xb!cBT z!jIx9)ZA3~8BNSumH t,6Q1f\vqj)Xl!(LwXㄠmBP -1;RDm,(S)˪ "l_4"@z8fL0>Y&* w;[MR40ciAOݿU*AqBJzv8nG5Z`'atFVkCF$!`(@Pk!9Й`oqP _Hqd{_UGh*smhx^ocߑHiF@>@"A .h⢁s@&`U! sĻs! @ 1AĢ;Ӈi}uE}v,yKF}Cy FCDC0CM{Q`"x0 pB Q =s:H$5K @|svě򇭈k\? _x>D}cTcFÊ EcGgZw,^3,mb|ymbsyB<v;suv|A @ WA̛_e|Hs>Jc?;v㯠cM$NŹ7bdn1M81Ua(wkhbRI$RNs=$X)_B"! 0QjQ Dց $đ,)4=320A,i{K}!'OK=r/!#Ė}Q"#6}Rm`k!fc}uS`cv ,{10Əw#i&}KM3 kσ1`,4V&Es@,tVA,QvT, #,6 mYH#.B֟WcwO/POx  Ʈ5P,0GNsǟ+%-+^ sZR`^A,UH@U&ULZ+Zi/TEڴ)h@3_nfz+X/`#E$"`!91l$)8祱 e lb A߁)M@|p[1EE9"jN ZW66l`VkvD`Ftc* EܛT o '&ãMNnA,7DLBFӇkҮc nj'R$E?ɿOՑ1T-gW]cB݄m.6H|ι zbX b+fG,@lOj0_E`;W^pW\{gQ#1(}9 jC!n`uhsh:} /$j%-V}y.6rOEos W3oA 0n uq"ҟ<]%-̀kM,\:sB81`!cf!wqx_bvhG1B@Bg-&XΧfψ`#}o gWΞuÈC<EMQa=l) u8b *0hPO,bї|'= 7؟[@9?*`wkW5OQO/< n@  ɿzPPsqGJȳ.QB0%BXWo+ `ClX=BqIoXLh(ު j~L~wV[}79_93gxO v` v~PBb jĬkؤ;o F ],kfD|VA%b~oQ3)Z H7W>TJ~ߒ U^,Rж# ~9@]g ._/ic@h( _jA@ĴQB`B *AP fN[ 1w>|JYݒOijzQlz@'!8*dk3Q"q@b{o|o_B1Fd)]ՇՍ6A~o+k^(pƈ:}/-cXVX߸HTX"ПַŀPv[ZCb}(=@L$Hl:5 KEo.>@,j?6_$P A#NX^71-@1gj/e7 0Xi1"󽵺)促e~u!Վ-ĭ~%6 PM]nn Vk ^ %aQ `l=m٥=b)$zkЊ*cz0 2#))ҁX4XJ; $ 0QD@,KS0=`Ym+d?-j5CX'tĝoE3/A8B^׸t |Q 'SC2̹5kPTE+^D/mلk?3t U 1a@[a4H "](fULo@* v|M*AX>^D $bl®"!-I )]ѿ"0ުpT($$Z`7 :1E0|_5j" `w&XCou <D-DDt ;}k*uiaE8 f88 AOabؠSDb\s&gun4LkBo܄WjqSP I 0xH/QJ1#1~5U(FS"& G[Pӟ/T 8 2>n#Q`< biwumMJ[whrR'.m#ڑK}/iHX"j}Zì ƃm۫ .맰gH.*Db/~u Ό'?Tal/oo 8 !`/ %*{`%('n` 10A3$ho-" bL\q?- ڈ+5͔Ɨ̮~?ۆ&|jc!VBM(l.k@=` /sѱWUZ[=h:~LOoΈkؾSڴ{7 "-ºEօҜE.G!λ5},KK3acJ@`k It@@'x>gWVg=$W[Nc(O {ҹc} b|*z>'D}ֽi[֖gre)l"QLA&\WaؿY¯dw=_< q9SN"@ @qZ{sI]A*$c?5 QGMF ` vNSX#iu%- in\,S  O~((>"a_D3@@VhzOu_l'|VBuɿ"Q"L H {!q ]5]Jd4E0.wϟ9܌Ą  $"/䧣)xGX`մDvB@D-xFu}]_俢_ 'T "By0BN?l\o) PY1 Ngj>4_E/o$j_tcf׿/:a8;BB@fx?_%@P Nn}=_L! NyfW':%*Mc ![CH/cJЃN-/Y%NIT a|Tv9%` rbx_.:tBBB95 cD݇>p/?^DGm_pI7_T(Ԇr'.G'cs57BzӬN"--U;+QF Ћ,:f@8iK?\ [,pWsD[ZN1xƒtVX߸};C?GKBh}m/%L /Rz_o [rY p[Yq3?XVsOmsp)J͐YM\?^"@!.$'u!kwlPiA1ȿFQZ X;YRr2aTOT1ILMx_,WWơǜ_x>5H uW} ׯҥIk*!:4/#w+s`vff9r@0< qE~psg$=!@W-wS]Uҽ+tUG[_? ?%҂=^-:^j\Rtq 0"\$(-f @SYRiᯟ_A! E!}SB͟$'iMea_NإKw_|=wPh:=I$('O.stBA_EAbC!ZH]:6?Zন-W T:@.pl,W7n$hMOх;E.^KQw,% @S BO@ɯDAΛY뻮(Mۺp-z$/jpS ?#ҞKM/CioRB(euc?U-41(]͏g2,bjT_[%932inrjf~2'E/Z_rlW$&G?dזq; :wnC.`u ?T6mv.Qn  @ynNDI߻\ ݄xGoiW/|'Eħ;צ_N1/oFDZ?`P_18F'&E]SXV;1&REN$@֒dǥ ]? _:w wb ҴxrIo^9Ǖi7"4@S@=*ڭYJEYSHK z<VX߸};*__A5'R?D䍟PAN/Yh^1?UA8մrM! ̕SyC^v(/"c_B?CTJq?.E R1pÓ̀9L&G[lB q>Y:Hf bGJ17[xQç ~1ɿ6w#ӍO`s?idåAkQmorp0 yA 6 7d{A9Rwi: 6 &6yȿ!5d]sM ^zO h<ԞH_#` -5?85EÓ_]1 ̟_>R"NۙPG= 9/>i o"Q?9wZU 8uhDCrBFAM\&:w=Uwׂ9ۨ5NlȆl("GulJ?Z_1R!ŒHx ⼮EVkht q Nز .wxV,&qB:`z_B3дUȀ]g S!>'҅ˤf/Bftd9_/#v%n f{uuQb:`@,\'x00$ք;,sU~i@*Gq´w' lSHB7nbίIbOgM~:!a?~ ͞]pbs4R)8'|`ۼ["ܹ@@z=B^D+E볻w8tх^Q (.?ɰ-Z7|?X( ^L=oLIJ G+ "=#W . J?%#CO#B/[(qp ? LΟ (pE#1@!h1yq*h[W5w9UG ɿ~_PS_AluOfN e,>ɿ{pmE\ ZK+S;!_]1,YN׶쳀|3@j%R/y/&Tu, Im`sHz8?Bm@ @'Nn?" H۞౦1r&Sjw}_ߍvRPgɱ/~9TBI%OrC9a?P_KpMRC-"dPI}ɵkRt8iThq74!=~+=!EEUoA*Mgϙ:q |9Zbu ,Hne&5Π/Z,GlVE599ѱh#HRBI Kc8B@:Uu/g6hH'G7.Ԉ#LL,H#0QfZNK?P?jϤCt2tALa5wd&^-&_Ie$_.I9wIhU,Ps)# Q\]h):8kY]}"ڹ `T(sI^D)89l[0-:% m:biEE @B@,\%<9U-41@"Ri/$&݆o}&/x\|n埠Qj辷@f_s|fqH/Qx@z:5ϴȘj_BT\h ,/pYGN @AMo1U"Lr: ZĿk҃a@XK(i:R9.k@N*B5)W#bL+#p9rċ]gAP @,Z Pe:L#jZy ^HRWQ Qj@w{t)Fo$?U^̼$(Dl.;Ud-ĘE @̋ ĘhTÃNRl1;O@kn__To IDAT}:YEc"&OqJA  +w뤠YYQ}*lBF#5Of)$ð SwҢiM|u P%&h=犘:Slki}_d *ND,:?p\/oGS1 CADN: y0@)D pK|?\/b8!d BS%G"xͷ64l_cNLA਍R4$ @!k@H " {*6mRU //5Z" @L^  z끪U׽;fOiFUJ\ 0$li80\1$8?OM8+4Ddx[aAs7I/@] Pnu! w?8MGB+_٤n˚;Kϊ4]5B1/!噶, #L%_[]AW|G]A G={N.,T;Jy\s *aiǜ.5 L5 P$u]ptNMrGiz\IC X8*x KϳAj!_l b$+N|wF3`߂wW-%h?"УP|>mBPbOPI%:uۆ#C+Sl/oC`q2 ^_~? FBoP т}x^hC[M!~2np_,Vkh54|=hhoFS@mD+8wрb~Ou?wA JVս|/X'/ɖ E0ˇzMbh_!5IyųsrhBQHPրF@nI 0CMz.\Nk?@gMw%tc5]lN^HJ! mwdr6S!ݛk'=zD!OEk~)6r\#HtEHh&MEq!CD6]>+RUl *hCF;kd)NCfu mȔC?.$`qb_M},Ha},4^kЉPaQJ47$ WnCo2wh}Ub>0 $1Wkɤ@%| lð?$ƝssuyNYM] (đX `"g%*qr ^^IG"1@fĀ}}|O5Ev1J ӭ] Gȿ 3h4K<Qntd,Xƽ&G[h=;l?5l94-n`*qR_ٛ_7+6&Q>z>YT8eX#Poq<-^ɭZP~ckuRQj[M< _%5 Nj@& "Qj@|ڀkWT1.qѠSq- Qtֶ'X`}Bqxt Q^D^Ixp oKU+X;[]_*QME\RsCDHĀ'-:X毀G(Pr |Z|SR}KS}>DP1pj OvXR/( \{K 0TQ 4vmnMX"v ou;S 8:0Ig)^WIw?c} b@ KhofJ@|&1eGKxJO)qEX@b"nVĸ8D2]&(Ds[xta@v7Dj) LU1bäw=t=ʭ]B;}?~cI=56rP(Ҽx fu}` &MuGb$J-p!}E\ĐSB?K @庁@m'!X^PyD;X:,SCfDmt&uŁjq~g,UOKQJGDVgVglFD # ?[2 d{]Wkhwd"E#:?BT[x>Y xbrOS\Rd"ڕjzJr}25OUAš H-1VL&Eb67n?{nX4%x5(׏3~45B d?V&` y:~WJRPRx6!f"Shﻮܝҩ!ݏ!/Lk$%X "s1q̋:/}ItShAiay:^b}(^"!x>݆y~ssσ l~<αgrjڂFfT5;x}j & *P0D__ ]Eqn;y?1n$(Dt7V= x1Bt?%'Zc3A!@ꜳ ZO*Pk1l%ng:cM*.,EXF@(&3 v%4!]اPHR.qq"IοL=G#PI7W=M-iHP #} }@ bb:&lZ"S-,-3m> 3(֎!=W K :F`w^"=(j c@1qa` <#IW|/Dq_'ҍ5b < [aEjcF1:ʀWv?-=uv$}~tn%U jD_c}n|fuY"a-N>8e#Qɺ䂘WByO!z#$V^|y:~ Kv|sKi)2-K c\cwwt9t+4\ӓS nD2*QD _F`wu`, 3,02 쬤1}d ?NQ;ֲ@߽svBuKx:&V=ұ3m2ԬGlb@g9LHC_L,chdžu*g/~g/ou-vȀt(sU1 Rџhw?дT>- D<֒^duĎok;%!{iXz3Du[}8h&= Vk| g 1 GToLX ǪPV ly8GaRp_Ph&)(d$ Sٵu8)Ԫ Fgv뫸vkע(0yc3RfGY@M XKt Hk Um=gD8M>Pj :VӵC5(>s_Bygmq4G]C'Pob]m DER;/_oW@c#ڮ Qv-Dv~d-֒Ivn0XĂy@mSs9>ǯՖa;QJ쭯ṯuE-YPs9 1 ߢ%MMY_nOzjij;fPb_eڭK Ʀt|S Eub84V$#zSE7xtO^-;CX0O:K}c Ld穪D4-ydlz!nZ$@f}iXg߽wo/o DVpBtDZ=?y߅x~򛁦+ \qkRrm}$cs/" 6@ۧO`=UӋZn(wd7< $86ݻɴ&e"T+h$ ݯA$O)Qe EH찻x>i2ΆϔvOP ׎ݓVxƊiϬ2i3mmt/EnpucrUw~Aja7PO3BA 3/rc(4 }=e!@[aJ |_/t=NRZ"T7'X zcSD` DNda7:ti#bKZ:tȿ?n#qL|ntno. ߙmwX'Ǿg6GB5:ws qǰA$%`%/X~ R8) _(PLC7|atAfl'Ҭȿ1|zQΑB@wDM#mZ ߽s[Ow^^ iwcXcxތBk#Fц $K@D6u*,y]2(ԑI 7ir#K9H`2:+$Lv뚮HimWIfҊmDgm+-2Iw!5rNL 8ňهspxF 9߷kiWG-Spۨ`wis-AB"`-?gvl,dϲ|EL-TbglvoJ5744F`wԓ )Pel,rwm5ԢPjJiFv@+>a+_Vb=({y61(D k/"[mzqV0l $ )B1UUSr%iۮvEpnzbfcda  lc;"3bB~/?<',i'D@,nJlA9&#BSY qRB~-=4i" @ ` )P @#RY()iYS#:dDƖ|T/ԍt{D?<)8=Zy/Fcb,EQR#E7 |) %^.o)qsYg,-kƝ(F1 zYxG @0#0$|k>1  nib,HdցLͥ<)| ]wͰ#,zn/$ŢGfxھ3}}w/aHHQڬ*6Ȓr KSMz6힑0STGBS~ޯSBz~ rbt ⓫EO/B,Hl΅]ȫ,2[eHۋdY> P) il|ei1Rs% Rlw=kva%4S-DXj]3/ב@ @@Be(8UA}HE@Ya/Ɛ)ꗞF~~}En$g_,sCKn|" {4ih] g$$lVry+GGb,Quyb#%ôԧqw 9@jO &Hw^_}d"`:>D'`?:Vݗu$T"O3EHnKz&tX4ˁHW~ [ZcYft$+˯`Qw1 TĭX?]ɷa&:WeelCdrn+$y_,9  H$@}HqPsRsyb246 =E˝m GHt ?[آs NŞ!fq^ne`c'ZlPpV!EEӊ8Zdtkt#%22&ݙ3E-lA ow (}eNOw#a?5s}9_"& 6lQN0FDj0 V$k¿=+bDmm.BVa< &Y8'MbhlY"gF@5IS"l% ; @$1sMi0 [lƯJS-f^gS?άb$zɖ18w_ gwȌF-`$LS Vr@#u:0# 3-A « RnUP ,G/-;Qt@8$@vɾ.(528'戩ĄjWT"E!F f\b-Xߊi\`j=R %R .uS+w (H( [:&)tK9K9:D7epu9"2\!EB)zG\?G{ (2Z,+O_[BI!G ch_DܓYbNj s|QeYQ0)'tFЉ]#@ZfDC, `Z?*Oο) -``X"+ۗ擫Ej~yߧ_.K3vɏJ`^۹S8+zhyF\j0v*Q)'\3x#ED*f(:)D,jFtM6q8 ]$=#!\ ۵0`ECbKVDFEŲf!tfaúfnߕDthHtMj#pMUeI㊀I li<_ﶰ|?C>Kl"*i_,l-B b9%:1+Kbѥ"z#HHDJBQ1a d 1HvsF0G IDATÿ<3A4L]nd)$ItKqXoXD?A_\_ ̬]I%GLX3HQ]%)&n`y|E qb @V 00 P|0&dCݧQ(0Q ܧsf\<[skǼQ_EF\ dZXU0Pp0Infslþ4oX`hqL`9m}"d L`K%|,s[w/xkqfYw vbhhh N[VL~k]J`yZOs9F=Ci_p՚u 1%GfKJ@1;^, t+˺k=}4 C'9.!\-}z6**6FJ$~/.Rj6v[q"ֺJk̭Bޒ R*B˂ BhnnV眊*!zuR h~]4 #bMyڨuu\.4KoL vcRڭ=#X/ҭk21ƨvbNow'BoV* Q$g㥩}XHF(}!1ezo釆˞8u ,z[J"@~3 EF%Un­:t `F!;臆q3d?3N 9ׂ}^` i5lIoԸ8SCW>2 "J^H>飫X+BD)tKi\fR)q0M 9QNu"EolpoNk 򻼢*0L2LATtQH3|dEk΂`x^9kt$i7([CB4m9`o燯qZ\T;qT2;XvDn܏noBAu?_,cN1ҵ yXRID)l -q'=ΉyU/(nws c;Fi&?Ngҿ* LD02y g |!F0I~M~b `<h`o^,Zթ&_.XY'W fA y+z!OJ*i=# 4`,d*2L7TՁ}}_n=/WJY!' b0y f,"FD .@qz{KROMom! j6?y{U~;wEֲL0@,yF0G f'RNqgom aYSCku' l/B%̩ m!?;Cw]-Bۓ{ )$ZNȘ0 irK7tzFBXU`]>3ZAO(&9K`@5<4n@νqNLhǬn~4l mvI׵?4_r9*;T#cPq7N]7Lg|a:{? How}筍jJjM !]c,Xe& sb%fc/9 b  }pH<"c#OM)_pC [㜳`끺&@Ȟ"˟m ! >4{ Gt!HԳkdtOmjKR\YŤi-|;" ܛ_TPZk޴J\.:paP06i<ۗՁ;3/=FMif_\9Е#;#y-=N7csǜyT Q8Hu0 n5ۨߺ}[xƽ$Qg0Ʋu"(0- 6&^ѥJ}SP'va ["*Xc?#F+iAGT6 u馽Ԏ3 G|Ic;!#q ާMzy-87H: "7_nUk(M_" l|RX\.7R0&z[T)tb`{3!B{‡-[/tcMVư70*a?Nl.*4$2`#[Bdk3.j -YzT+@>ZA, (0oBQjn2NP<]*\`u ,4Of5qxl0G6<;UkK)'H7k_!VC8^H]=ieH Xme>,iuE@EPTJ-8pr+޵)@X~<B'` '%!|t96!|snY(" vHgFoZ"wN߿ U5_pϩ  PF` ZB:чk kK(~u)O& af`+@{FCa" k6C01#!gtJy%(wJI n4q@9z2|$ew HY3e]3:2 g4M^;QY6&iAk,B_GP-%Um)L#3+F7/5>wzZe 'p@}rgU/y-F8S Y,"=exboaC#]5-]?/?(3.j bn}>!R/]0 ^=?`Eo^nʼn "ފ ihPA4P08 `r[6op Cy)1_5{?MtfP` X3"5 lXh"_#L`8BWAD#KS`ZRʅ{E 2/dbQW n7`Ti#[= <tw?d s]4K9S_TS Ū!W##/i:Y/Pp'vbZUBΔypXBY ŵ2sq@,Z8\eP`3lxSa)n/HgtgC 1 dXxKt]#]tgJPUpƂX0.Nz| aH2:S`U~;wU93"FL%,V>@ŢB^/joUrX`@A8u)O*t[Dy  <}pk$q|ЭuuAjXX K?[`jF` UP}_7 Z_cv&?-nxmJb 'UdE\,*;I'!V\)Ky\D@%`f!N{|sERԱWl ulK' x?=9?ynPtoU{F+ A %""s!v,Hžcu)l 7F 6ow}筍j%mr"J>b@XBY3/R(" ;juӘ`!7 SsE `dg\@}a3o릶٠(U/-{9X7p 7=~@GRT-W֪N@>@|",T"`]|zDY/$=`^OY W](T0cg7|:-B+QjVEx_Wa5Ð351عΩBH'?vxFܕ gJ@0TM\XgS(]KE 8myi/O%prnoi 3 A`0'WVW&%@c,tjSB/"%7#UyQ70N=>k |V}m4u?> :%TTo(\  1_O)?tz"`HDN{Ɩ&Waw9% 0_0xLoS liܤ…Sǹ,0EiLk?{9^@H;vRZTm i@WeP ORqIA憷^x 89\JY:pNK  q˰ᄊo)wߦPǞ0Y៖>h/[TX\sI@+I"\V mSlAS~!CEQI\,B|.E OL-;Ky~})O9pZr>^7L9!`pH0<ev)ng1?[. *\Xq?. pEʹMJ ARAODg6t6mk ȊHXT7JR1bUCKp\:\)kp[Jpo ;s!k9*lT֏6"tgm,,SO+"|-nh(Qk$ < `'ŷAf@Ã{|Y [ (^(p@XT. r^_B !ߚ0*4\(0d#7x] F G,:Y㢷v:QX1Ƽn %yB-:޸6 {VȽ0ȦpH{}E ix~@b߅bq@DOH'?W*9Y$bNV nJuc~o6_kFJZ]96<~nsՖlk;9DY nBZ"@j}Q/JeZ _(p`}p0?s#~<^J%Gm)\/4%p!#Z g9M[!"@Q5U(l>@}abk[ @fD\@n, `! /dLoL.TtjN:FP`Hi8 @fBSTf-A4?"3imk:q^eZe $ &A#^ N}j]2 (J4 \}P|00^/Еrzn8@KnmrZ&4)κYgizt?4 ?uH4OjY Ȓsg k(ܻ| XmJՒ7]1?AOE[|v}? Sg#BW*tu )7DXE"CE3Bذ/`PbD'Mu c%5W% @2 f)"R u]l; G0F$Y.@0/pН)0R8?WyRQOҵ¾#=pBqkȿF6ioCR  򓋀~NW|ʘUT!myxpmyKyjxT6ra"`!.f..B@H;qrAحOf #3)"SjNy IDATlYVCDS 6^GO8?cUEW;[]ow]4F!ܛ"Txʕɉsn_ k/d0*r^T!}qQ Bc?F%Gw6K`D)-h>bQD C>P/n~QO0?y? "- Uwޭ-n4F2@G{zTʕ*7Mmu" a^g).)_D ;O\,mmg07/(1~?n/:^gCB \u1 |sDH!fU(N_s yf(e\p vuk__ZzxƜ?SB< ,*3k+9߽Y"d\z038t Ż;jZRr.<`2&XND- HZ|vD<xn@_ 1u<])+t}MyAaiW<,^ 0v@ aǷSCO(Ԅ;Ξ' Ҙ_?0Hp$M{@῍ @ۇ{bTu  ,pH> >˛唆1 R` p_~%/|| K9"4t2&a¿a==#"B@ޏj7P䊕1@.(/XB EV-Y@AjqZ ny›Rj`@Pki/ HbB_]9@ vQ T g YD !q 2 Z0x pȣ$@GJCXgĨ5a@wLwI|4Y6 n!>F@H޽>y[Ƶ5:r{rX%0M}iJuL2mS `  AiaY)CSX|*=`THt\(jTŝ ";?X<ON v^ェKj\ . ^RUD F8?"COG}X,a>` `R02cJA $0%EK64aJ rV]sN4Ϗi82E,&D8s w_ rH ? 鴭er}. l (Ty 0\A~jПb`!!qfq2Qw)4olD ~4pCkDVS*$:dOLű;pӚ0@\66j> 'C)-7 }L *_(R0KN7 #$골Y" x?tQ@@bkk,"iEU)vfdSǷ-'?#H>59q6KY`P [0_W |?]Sf[.hj6QG?`xTLFD'MF~9N)͓:q^UŪ5 `^, m(ܻ|f;{RZTܞ ;Ҁe 0Զ('#KnU0T 9Xw%?K>*GLVHZ_sk 8?cUEW:vC]o>nT*WK4@Z@Q = &q7[obn?g _!4>&|"|,0bu!t׿` Y56 5gl@U%W:e< m"@0 VGQm>;JgxoR)REf @_ABLppWþ< {-8(ϵ]D蟽FjXsZ"G~#9v @n @"p\ټZsZ{B BP.ËP"bt"?ܪPqs_8O)IG,@h;пHd!d&-Qߙ53(#:;9n6w:|">;R-~F -" mvWZ@X0 WJY I 3`Y1sU/?TL>sg A-ؐ;a1J?X ֳς6`r7!E@PcM) "n7D޽>yW;e0šZ0ؿ0XkY%C5,~rH%8]ߡ?ZZrJ1!BZn{Q5<dN}R R^`]0q@0^X^`F|Z0JXY I_ i 4M!EW[1U2E8f(p3 8v뿭~tKm$ ,= VY"`@ W=?\!i>\t/4`vϏi82EZ&"OdZ-iCyڭVw_oN׮׼Ҳ,`S0K #/_ [0 P'C70 `,"xk'?,!ny<|8$U2س1PS}oI[@}}ۯJs{Z,Q( 1"BDT'@:qE@hĒ)nCs+mKE@fZɈy綟>/8K-,9/ZR\Y 18 ]9ȏ!> #@DO({9@ )i ,(,qǎ^ u]_?;9qS'`Jx ӈ7Bp_@V>qZM`C|@@L`kg+:ws6xmu $Ɔgn X LJ !A:EcU%ZM;n;0`M{iϏ`yp_{E)\Э3 b"`ԴA0rqw nT*WKm$@@H>փ8V@u✓(҅%`x蟅P$]& k< $@0ijA?b@`3LC !֣\Rc_cRgw66?0hϟ<ڎjh݈`ҀIqXm020t z.Z\Njc),;,HY0sx@oͫ5m4>E}EQ "HZ9X$Cuu;ao]X+U_ !|?e,Dp `X)Z< ?XGZNWsr)%9qS#ݤG@t|dpUX,UK6^ (G@,H1+V(5tt]^K߼xs"wO|P,V·v](c q- $@ xSЙWs뢰X 5|isZ|$Cm`q@$!%_2 t]']שno/~zGBZ,,E@@ `rgIe@|Bpn#1FIx9vWhiVS5GuXkU"Ӥ?sMo!ɋfK7ttpA\տح0|6 IaXwg5oA.ȩYA^ f Op |Za|xV N?)?ww\iwG$r`(7[ZTBHBr<)*\&V6NQߣ~G~~m bc R5Ϲ_4^~8)4 utM3zZ5޴[}/ S)Mk8 ͹iSץ~׋:vM??=!  >@T o_ L,.k5?˧O.^T+KUau ,PvBad q`iépAr@9a `@uҵ>5vsVo߿jXw ?p@_] 0Z k]pp~Ix}RNl[Ƶ½W)   szӃZyȚ~x}}U(X h5mH L1DjhD ûFit }}zOjh t#!HQURU5v@Q̭pە{5藇?&Dm0z A$=%@ ×% 9 s\ P'4c N@@[Oo֋R\YmHa bV^C_gx/LàK/ל6x^@wI,PzBjh7 clFq+~π"Mv:Dv}CilbJhF/:냽GNv?yuzX,U$M =clk0)  4&\Nbs8v@R΃2t>VvTݍO }_YjdrX"X: v B eǩPT ]Wglm @g8O^8>z^("[K!p"gZ080Mz65@2i^*W1m&>rAVy F9{sXSznW~f/c`~dK8'Cw@Xo<'= `i7~u^Ys> بq 8;;9Oh<{wz|v+5N^K! gIKX"sӚoX5hI 47_ohV7;?|-]ڍ_{ ?9 stvvB_;~6γ-U&!3 -qp^'g ӡֹNwp+)vvRb 䜸|U+@Z}_ke.n/RKg /{"`z0TL+șgcf ̞vxw>9 _ _Ev$@2sV5N3o_ BX*{E,I[fM(|g @@AaP@h6?|-Ci͚S@̞z3@"M)yvF}nc0tZ|pƥ\%@QoЏ; xҭ%5kY^Yk"/wj7w撄;O=2 /oԸSwi2߬Iy3k@ g޶mWP`:r;wm:ۭZXyr~痟ں~V,r` 7 %4ǂatz|D#0>[mIq1G] 14[m4vt[Wi|jl/RʥN} A|~q Ч^@"@pi(lw\*Tk8+<0IDAT V}؅%PpDw;atycf t0/K80.7r0t:;>&@]6dob " IHU 鮭5{^y+WHZN^:4Y9n}:;9wGGƯS /SN͑ˑ(W"  KiQk%>?U3 cӖat͚V@_] ; =3←60Fc8 Ū1@nH F;[@0տ^W`oga/ Df$'q ?w{Ǡ4/߽>jT:8J~96v0H,Nۯ0n5[mKrv tÖ+<뺵ߧz"mð J)t`BNi+ H4nNW* . ӿ5:?=}-Pp riھP. Ȁ5-Ns@FE@x'>͚SͻjǨ! "4bu:Vx{vۆӕ+5MߒB0LW4Mut~vJD@qNn+ȥBlVZl!6zߚYBWk}3y`cA`YEUT8y5hAF 4'/Gd¿SӦWѻ;~~yV*'3V$ [An;Lι[4 7w;j"̴[Vݗ|rKKes0[`=6PH>@2@5:;E_V޿}(1R[@Bv?#xsWڼvVU[*pe `xw>zR^^UtMnM!FW/RZ^`gO>6|^o?z z+ ˧O^?gw՚ @Di}W;~vS]7TM.x:i>u:-{ߢJw-!Qm^!Xy6I?b-\.Gj.GTld k߳4}?pi}:7^D6|xo/ S`o`Q/^@!b,  C*wmE~NV챵,T.W+>ց"`<uM#MS^lE]@7tzFm  ;[mNGxOWxsW2 ޸Y J b cοn>_6<>@\-W֪g40JtfxHڭf#>@eP_%@04z};X @D@xm]5!Dc(0t:tvr 8t]k7~ dD;S{]:?=F `(+reJHQRś9NZGNv?i`6Er׿ /QF|9u;mjӇ?[ `r0Bi7ik($ ]'w)  ȇ}7- 'NPIENDB`goxel-0.8.1/osx/000077500000000000000000000000001334742672700134665ustar00rootroot00000000000000goxel-0.8.1/osx/goxel/000077500000000000000000000000001334742672700146045ustar00rootroot00000000000000goxel-0.8.1/osx/goxel/goxel.xcodeproj/000077500000000000000000000000001334742672700177165ustar00rootroot00000000000000goxel-0.8.1/osx/goxel/goxel.xcodeproj/project.pbxproj000066400000000000000000003322071334742672700230010ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ F01452C52070FC51007F0106 /* utils_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = F01452C42070FC51007F0106 /* utils_gl.c */; }; F0158ECC1F17289B008893E6 /* sound_openal.inl in Resources */ = {isa = PBXBuildFile; fileRef = F0158ECA1F17289B008893E6 /* sound_openal.inl */; }; F0158ECD1F17289B008893E6 /* sound.c in Sources */ = {isa = PBXBuildFile; fileRef = F0158ECB1F17289B008893E6 /* sound.c */; }; F025C7DB1F33239000C52709 /* png_slices.c in Sources */ = {isa = PBXBuildFile; fileRef = F025C7DA1F33239000C52709 /* png_slices.c */; }; F037D5C31EA6061F00C96D10 /* gox.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5C21EA6061F00C96D10 /* gox.c */; }; F037D5C51EA6066300C96D10 /* vec.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5C41EA6066300C96D10 /* vec.c */; }; F037D5CF1EA6069A00C96D10 /* brush.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5C71EA6069A00C96D10 /* brush.c */; }; F037D5D01EA6069A00C96D10 /* color_picker.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5C81EA6069A00C96D10 /* color_picker.c */; }; F037D5D11EA6069A00C96D10 /* laser.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5C91EA6069A00C96D10 /* laser.c */; }; F037D5D21EA6069A00C96D10 /* move.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5CA1EA6069A00C96D10 /* move.c */; }; F037D5D31EA6069A00C96D10 /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5CB1EA6069A00C96D10 /* plane.c */; }; F037D5D41EA6069A00C96D10 /* procedural.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5CC1EA6069A00C96D10 /* procedural.c */; }; F037D5D51EA6069A00C96D10 /* selection.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5CD1EA6069A00C96D10 /* selection.c */; }; F037D5D61EA6069A00C96D10 /* shape.c in Sources */ = {isa = PBXBuildFile; fileRef = F037D5CE1EA6069A00C96D10 /* shape.c */; }; F057B374204EEDD000E2A63F /* bvh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0E6204EEDCF00E2A63F /* bvh.cpp */; }; F057B375204EEDD000E2A63F /* bvh2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0E8204EEDCF00E2A63F /* bvh2.cpp */; }; F057B376204EEDD000E2A63F /* bvh4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0EA204EEDCF00E2A63F /* bvh4.cpp */; }; F057B377204EEDD000E2A63F /* bvh_binning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0EC204EEDCF00E2A63F /* bvh_binning.cpp */; }; F057B378204EEDD000E2A63F /* bvh_build.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0EE204EEDCF00E2A63F /* bvh_build.cpp */; }; F057B379204EEDD000E2A63F /* bvh_node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0F0204EEDCF00E2A63F /* bvh_node.cpp */; }; F057B37A204EEDD000E2A63F /* bvh_sort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0F3204EEDCF00E2A63F /* bvh_sort.cpp */; }; F057B37B204EEDD000E2A63F /* bvh_split.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0F5204EEDCF00E2A63F /* bvh_split.cpp */; }; F057B37C204EEDD000E2A63F /* bvh_unaligned.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B0F7204EEDCF00E2A63F /* bvh_unaligned.cpp */; }; F057B38C204EEDD000E2A63F /* device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B10B204EEDCF00E2A63F /* device.cpp */; }; F057B38D204EEDD000E2A63F /* device_cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B10D204EEDCF00E2A63F /* device_cpu.cpp */; }; F057B38F204EEDD000E2A63F /* device_denoising.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B10F204EEDCF00E2A63F /* device_denoising.cpp */; }; F057B390204EEDD000E2A63F /* device_memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B112204EEDCF00E2A63F /* device_memory.cpp */; }; F057B394204EEDD000E2A63F /* device_split_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B118204EEDCF00E2A63F /* device_split_kernel.cpp */; }; F057B395204EEDD000E2A63F /* device_task.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B11A204EEDCF00E2A63F /* device_task.cpp */; }; F057B3A5204EEDD000E2A63F /* node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B131204EEDCF00E2A63F /* node.cpp */; }; F057B3A6204EEDD000E2A63F /* node_type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B134204EEDCF00E2A63F /* node_type.cpp */; }; F057B3A9204EEDD000E2A63F /* filter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A0204EEDCF00E2A63F /* filter.cpp */; }; F057B3AA204EEDD000E2A63F /* filter_avx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A1204EEDCF00E2A63F /* filter_avx.cpp */; }; F057B3AB204EEDD000E2A63F /* filter_avx2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A2204EEDCF00E2A63F /* filter_avx2.cpp */; }; F057B3AC204EEDD000E2A63F /* filter_sse2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A5204EEDCF00E2A63F /* filter_sse2.cpp */; }; F057B3AD204EEDD000E2A63F /* filter_sse3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A6204EEDCF00E2A63F /* filter_sse3.cpp */; }; F057B3AE204EEDD000E2A63F /* filter_sse41.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A7204EEDCF00E2A63F /* filter_sse41.cpp */; }; F057B3AF204EEDD000E2A63F /* kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A8204EEDCF00E2A63F /* kernel.cpp */; }; F057B3B0204EEDD000E2A63F /* kernel_avx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1A9204EEDCF00E2A63F /* kernel_avx.cpp */; }; F057B3B1204EEDD000E2A63F /* kernel_avx2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1AA204EEDCF00E2A63F /* kernel_avx2.cpp */; }; F057B3B2204EEDD000E2A63F /* kernel_split.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1AE204EEDCF00E2A63F /* kernel_split.cpp */; }; F057B3B3204EEDD000E2A63F /* kernel_split_avx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1AF204EEDCF00E2A63F /* kernel_split_avx.cpp */; }; F057B3B4204EEDD000E2A63F /* kernel_split_avx2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1B0204EEDCF00E2A63F /* kernel_split_avx2.cpp */; }; F057B3B5204EEDD000E2A63F /* kernel_split_sse2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1B1204EEDCF00E2A63F /* kernel_split_sse2.cpp */; }; F057B3B6204EEDD000E2A63F /* kernel_split_sse3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1B2204EEDCF00E2A63F /* kernel_split_sse3.cpp */; }; F057B3B7204EEDD000E2A63F /* kernel_split_sse41.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1B3204EEDCF00E2A63F /* kernel_split_sse41.cpp */; }; F057B3B8204EEDD000E2A63F /* kernel_sse2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1B4204EEDCF00E2A63F /* kernel_sse2.cpp */; }; F057B3B9204EEDD000E2A63F /* kernel_sse3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1B5204EEDCF00E2A63F /* kernel_sse3.cpp */; }; F057B3BA204EEDD000E2A63F /* kernel_sse41.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B1B6204EEDCF00E2A63F /* kernel_sse41.cpp */; }; F057B435204EEDD000E2A63F /* attribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B28A204EEDCF00E2A63F /* attribute.cpp */; }; F057B436204EEDD000E2A63F /* background.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B28C204EEDCF00E2A63F /* background.cpp */; }; F057B437204EEDD000E2A63F /* bake.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B28E204EEDCF00E2A63F /* bake.cpp */; }; F057B438204EEDD000E2A63F /* buffers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B290204EEDCF00E2A63F /* buffers.cpp */; }; F057B439204EEDD000E2A63F /* camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B292204EEDCF00E2A63F /* camera.cpp */; }; F057B43B204EEDD000E2A63F /* constant_fold.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B295204EEDCF00E2A63F /* constant_fold.cpp */; }; F057B43C204EEDD000E2A63F /* curves.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B297204EEDCF00E2A63F /* curves.cpp */; }; F057B43D204EEDD000E2A63F /* film.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B299204EEDCF00E2A63F /* film.cpp */; }; F057B43E204EEDD000E2A63F /* graph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B29B204EEDCF00E2A63F /* graph.cpp */; }; F057B43F204EEDD000E2A63F /* image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B29D204EEDCF00E2A63F /* image.cpp */; }; F057B440204EEDD000E2A63F /* integrator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B29F204EEDCF00E2A63F /* integrator.cpp */; }; F057B441204EEDD000E2A63F /* light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2A1204EEDCF00E2A63F /* light.cpp */; }; F057B442204EEDD000E2A63F /* mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2A3204EEDCF00E2A63F /* mesh.cpp */; }; F057B443204EEDD000E2A63F /* mesh_displace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2A5204EEDCF00E2A63F /* mesh_displace.cpp */; }; F057B444204EEDD000E2A63F /* mesh_subdivision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2A6204EEDCF00E2A63F /* mesh_subdivision.cpp */; }; F057B445204EEDD000E2A63F /* nodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2A7204EEDCF00E2A63F /* nodes.cpp */; }; F057B446204EEDD000E2A63F /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2A9204EEDCF00E2A63F /* object.cpp */; }; F057B447204EEDD000E2A63F /* osl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2AB204EEDCF00E2A63F /* osl.cpp */; }; F057B448204EEDD000E2A63F /* particles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2AD204EEDCF00E2A63F /* particles.cpp */; }; F057B449204EEDD000E2A63F /* scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2AF204EEDCF00E2A63F /* scene.cpp */; }; F057B44A204EEDD000E2A63F /* session.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2B1204EEDCF00E2A63F /* session.cpp */; }; F057B44B204EEDD000E2A63F /* shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2B3204EEDCF00E2A63F /* shader.cpp */; }; F057B44C204EEDD000E2A63F /* sobol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2B5204EEDCF00E2A63F /* sobol.cpp */; }; F057B44D204EEDD000E2A63F /* svm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2B7204EEDCF00E2A63F /* svm.cpp */; }; F057B44E204EEDD000E2A63F /* tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2B9204EEDCF00E2A63F /* tables.cpp */; }; F057B44F204EEDD000E2A63F /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2BB204EEDCF00E2A63F /* tile.cpp */; }; F057B451204EEDD000E2A63F /* subd_dice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2BF204EEDCF00E2A63F /* subd_dice.cpp */; }; F057B452204EEDD000E2A63F /* subd_patch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2C1204EEDCF00E2A63F /* subd_patch.cpp */; }; F057B453204EEDD000E2A63F /* subd_patch_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2C3204EEDCF00E2A63F /* subd_patch_table.cpp */; }; F057B454204EEDD000E2A63F /* subd_split.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2C5204EEDCF00E2A63F /* subd_split.cpp */; }; F057B45C204EEDD000E2A63F /* util_aligned_malloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2D1204EEDCF00E2A63F /* util_aligned_malloc.cpp */; }; F057B45D204EEDD000E2A63F /* util_debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2D8204EEDCF00E2A63F /* util_debug.cpp */; }; F057B45E204EEDD000E2A63F /* util_guarded_allocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2DD204EEDCF00E2A63F /* util_guarded_allocator.cpp */; }; F057B45F204EEDD000E2A63F /* util_logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2E4204EEDCF00E2A63F /* util_logging.cpp */; }; F057B460204EEDD000E2A63F /* util_math_cdf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2E8204EEDCF00E2A63F /* util_math_cdf.cpp */; }; F057B461204EEDD000E2A63F /* util_md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2F3204EEDCF00E2A63F /* util_md5.cpp */; }; F057B462204EEDD000E2A63F /* util_param.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2F7204EEDCF00E2A63F /* util_param.cpp */; }; F057B463204EEDD000E2A63F /* util_path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2F9204EEDCF00E2A63F /* util_path.cpp */; }; F057B464204EEDD000E2A63F /* util_simd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B2FF204EEDCF00E2A63F /* util_simd.cpp */; }; F057B465204EEDD000E2A63F /* util_sky_model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B301204EEDCF00E2A63F /* util_sky_model.cpp */; }; F057B466204EEDD000E2A63F /* util_string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B30A204EEDCF00E2A63F /* util_string.cpp */; }; F057B467204EEDD000E2A63F /* util_system.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B30C204EEDCF00E2A63F /* util_system.cpp */; }; F057B468204EEDD000E2A63F /* util_task.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B30E204EEDCF00E2A63F /* util_task.cpp */; }; F057B469204EEDD000E2A63F /* util_thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B311204EEDCF00E2A63F /* util_thread.cpp */; }; F057B46A204EEDD000E2A63F /* util_time.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B313204EEDCF00E2A63F /* util_time.cpp */; }; F057B46B204EEDD000E2A63F /* util_transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B315204EEDCF00E2A63F /* util_transform.cpp */; }; F057B46D204EEDD000E2A63F /* util_windows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B337204EEDCF00E2A63F /* util_windows.cpp */; }; F057B4A8204EF13900E2A63F /* cycles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F057B4A7204EF13900E2A63F /* cycles.cpp */; }; F06C683C1D2EAECC00887FCE /* camera.c in Sources */ = {isa = PBXBuildFile; fileRef = F06C68391D2EAECC00887FCE /* camera.c */; }; F06C683D1D2EAECC00887FCE /* quantization.c in Sources */ = {isa = PBXBuildFile; fileRef = F06C683A1D2EAECC00887FCE /* quantization.c */; }; F07DE9D31BD0F03900BAA1AD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9D21BD0F03900BAA1AD /* AppDelegate.swift */; }; F07DE9D51BD0F03900BAA1AD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F07DE9D41BD0F03900BAA1AD /* Assets.xcassets */; }; F07DE9D81BD0F03900BAA1AD /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F07DE9D61BD0F03900BAA1AD /* MainMenu.xib */; }; F07DE9E01BD0F16300BAA1AD /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F07DE9DF1BD0F16300BAA1AD /* OpenGL.framework */; }; F07DEA001BD0F31500BAA1AD /* color.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9E61BD0F31500BAA1AD /* color.c */; }; F07DEA041BD0F31500BAA1AD /* goxel.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9EA1BD0F31500BAA1AD /* goxel.c */; }; F07DEA051BD0F31500BAA1AD /* gui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9EC1BD0F31500BAA1AD /* gui.cpp */; }; F07DEA061BD0F31500BAA1AD /* image.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9ED1BD0F31500BAA1AD /* image.c */; }; F07DEA071BD0F31500BAA1AD /* imgui_user.inl in Resources */ = {isa = PBXBuildFile; fileRef = F07DE9EE1BD0F31500BAA1AD /* imgui_user.inl */; }; F07DEA091BD0F31500BAA1AD /* mesh.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9F11BD0F31500BAA1AD /* mesh.c */; }; F07DEA0A1BD0F31500BAA1AD /* model3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9F21BD0F31500BAA1AD /* model3d.c */; }; F07DEA0B1BD0F31500BAA1AD /* palette.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9F31BD0F31500BAA1AD /* palette.c */; }; F07DEA0D1BD0F31500BAA1AD /* render.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9F61BD0F31500BAA1AD /* render.c */; }; F07DEA0F1BD0F31500BAA1AD /* shape.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9F81BD0F31500BAA1AD /* shape.c */; }; F07DEA101BD0F31500BAA1AD /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9F91BD0F31500BAA1AD /* system.c */; }; F07DEA111BD0F31500BAA1AD /* texture.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9FA1BD0F31500BAA1AD /* texture.c */; }; F07DEA121BD0F31500BAA1AD /* tools.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9FB1BD0F31500BAA1AD /* tools.c */; }; F07DEA131BD0F31500BAA1AD /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = F07DE9FC1BD0F31500BAA1AD /* utils.c */; }; F07DEA331BD1014800BAA1AD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F07DEA321BD1014800BAA1AD /* CoreFoundation.framework */; }; F097B3F31F0C97DB00A3622B /* gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = F097B3F11F0C97DB00A3622B /* gesture.c */; }; F097B3F41F0C97DB00A3622B /* gesture3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F097B3F21F0C97DB00A3622B /* gesture3d.c */; }; F0A15FFC1E962F1300C6EF33 /* dicom.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FF21E962F1300C6EF33 /* dicom.c */; }; F0A15FFD1E962F1300C6EF33 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FF31E962F1300C6EF33 /* png.c */; }; F0A15FFE1E962F1300C6EF33 /* povray.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FF41E962F1300C6EF33 /* povray.c */; }; F0A15FFF1E962F1300C6EF33 /* qubicle.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FF51E962F1300C6EF33 /* qubicle.c */; }; F0A160011E962F1300C6EF33 /* txt.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FF71E962F1300C6EF33 /* txt.c */; }; F0A160021E962F1300C6EF33 /* vox.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FF81E962F1300C6EF33 /* vox.c */; }; F0A160031E962F1300C6EF33 /* voxlap.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FF91E962F1300C6EF33 /* voxlap.c */; }; F0A160041E962F1300C6EF33 /* vxl.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FFA1E962F1300C6EF33 /* vxl.c */; }; F0A160051E962F1300C6EF33 /* wavefront.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A15FFB1E962F1300C6EF33 /* wavefront.c */; }; F0A160081E962F4600C6EF33 /* marchingcube.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A160061E962F4600C6EF33 /* marchingcube.c */; }; F0A160091E962F4600C6EF33 /* mustache.c in Sources */ = {isa = PBXBuildFile; fileRef = F0A160071E962F4600C6EF33 /* mustache.c */; }; F0AE90F71C8EE01300C29080 /* assets.c in Sources */ = {isa = PBXBuildFile; fileRef = F0AE90F51C8EE01200C29080 /* assets.c */; }; F0C4F1421F308976002E73C5 /* gui_settings.c in Sources */ = {isa = PBXBuildFile; fileRef = F0C4F1411F308976002E73C5 /* gui_settings.c */; }; F0C5368B1F42EE43003A0DCA /* extrude.c in Sources */ = {isa = PBXBuildFile; fileRef = F0C5368A1F42EE43003A0DCA /* extrude.c */; }; F0D463BD1E48759A004F1A37 /* cache.c in Sources */ = {isa = PBXBuildFile; fileRef = F0D463BC1E48759A004F1A37 /* cache.c */; }; F0D463BF1E4875CA004F1A37 /* stack.c in Sources */ = {isa = PBXBuildFile; fileRef = F0D463BE1E4875CA004F1A37 /* stack.c */; }; F0DE97101E6FEA1F000354AF /* dialogs_osx.m in Sources */ = {isa = PBXBuildFile; fileRef = F0DE970F1E6FEA1F000354AF /* dialogs_osx.m */; }; F0E71BAC1F1DA30D00D20C7C /* theme.c in Sources */ = {isa = PBXBuildFile; fileRef = F0E71BAB1F1DA30D00D20C7C /* theme.c */; }; F0E71BB01F1DA7A100D20C7C /* ini.c in Sources */ = {isa = PBXBuildFile; fileRef = F0E71BAE1F1DA7A100D20C7C /* ini.c */; }; F0ED3C641F98B03300FB50DE /* mesh_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = F0ED3C611F98B03200FB50DE /* mesh_utils.c */; }; F0ED3C651F98B03300FB50DE /* mesh_to_vertices.c in Sources */ = {isa = PBXBuildFile; fileRef = F0ED3C621F98B03200FB50DE /* mesh_to_vertices.c */; }; F0EEB7DE1C8EC25D004AB676 /* procedural.c in Sources */ = {isa = PBXBuildFile; fileRef = F0EEB7D91C8EC25D004AB676 /* procedural.c */; }; F0EEB7E01C8EC25D004AB676 /* procedural.leg in Resources */ = {isa = PBXBuildFile; fileRef = F0EEB7DB1C8EC25D004AB676 /* procedural.leg */; }; F0EEB7E41C8EC27C004AB676 /* action.c in Sources */ = {isa = PBXBuildFile; fileRef = F0EEB7E31C8EC27C004AB676 /* action.c */; }; F0EEB7E61C8EC472004AB676 /* procedural.inl in Resources */ = {isa = PBXBuildFile; fileRef = F0EEB7E51C8EC472004AB676 /* procedural.inl */; }; F0EEB7E81C8EC4D1004AB676 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F0EEB7E71C8EC4D1004AB676 /* libz.tbd */; }; F0F14C6720AF282E0006E575 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F0F14C6620AF282E0006E575 /* imgui.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ F01452C42070FC51007F0106 /* utils_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utils_gl.c; sourceTree = ""; }; F0158ECA1F17289B008893E6 /* sound_openal.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sound_openal.inl; sourceTree = ""; }; F0158ECB1F17289B008893E6 /* sound.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sound.c; sourceTree = ""; }; F025C7DA1F33239000C52709 /* png_slices.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = png_slices.c; sourceTree = ""; }; F037D5C21EA6061F00C96D10 /* gox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gox.c; sourceTree = ""; }; F037D5C41EA6066300C96D10 /* vec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vec.c; sourceTree = ""; }; F037D5C71EA6069A00C96D10 /* brush.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = brush.c; sourceTree = ""; }; F037D5C81EA6069A00C96D10 /* color_picker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = color_picker.c; sourceTree = ""; }; F037D5C91EA6069A00C96D10 /* laser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = laser.c; sourceTree = ""; }; F037D5CA1EA6069A00C96D10 /* move.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = move.c; sourceTree = ""; }; F037D5CB1EA6069A00C96D10 /* plane.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = plane.c; sourceTree = ""; }; F037D5CC1EA6069A00C96D10 /* procedural.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = procedural.c; sourceTree = ""; }; F037D5CD1EA6069A00C96D10 /* selection.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = selection.c; sourceTree = ""; }; F037D5CE1EA6069A00C96D10 /* shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shape.c; sourceTree = ""; }; F057B0E6204EEDCF00E2A63F /* bvh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh.cpp; sourceTree = ""; }; F057B0E7204EEDCF00E2A63F /* bvh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh.h; sourceTree = ""; }; F057B0E8204EEDCF00E2A63F /* bvh2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh2.cpp; sourceTree = ""; }; F057B0E9204EEDCF00E2A63F /* bvh2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh2.h; sourceTree = ""; }; F057B0EA204EEDCF00E2A63F /* bvh4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh4.cpp; sourceTree = ""; }; F057B0EB204EEDCF00E2A63F /* bvh4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh4.h; sourceTree = ""; }; F057B0EC204EEDCF00E2A63F /* bvh_binning.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh_binning.cpp; sourceTree = ""; }; F057B0ED204EEDCF00E2A63F /* bvh_binning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh_binning.h; sourceTree = ""; }; F057B0EE204EEDCF00E2A63F /* bvh_build.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh_build.cpp; sourceTree = ""; }; F057B0EF204EEDCF00E2A63F /* bvh_build.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh_build.h; sourceTree = ""; }; F057B0F0204EEDCF00E2A63F /* bvh_node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh_node.cpp; sourceTree = ""; }; F057B0F1204EEDCF00E2A63F /* bvh_node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh_node.h; sourceTree = ""; }; F057B0F2204EEDCF00E2A63F /* bvh_params.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh_params.h; sourceTree = ""; }; F057B0F3204EEDCF00E2A63F /* bvh_sort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh_sort.cpp; sourceTree = ""; }; F057B0F4204EEDCF00E2A63F /* bvh_sort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh_sort.h; sourceTree = ""; }; F057B0F5204EEDCF00E2A63F /* bvh_split.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh_split.cpp; sourceTree = ""; }; F057B0F6204EEDCF00E2A63F /* bvh_split.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh_split.h; sourceTree = ""; }; F057B0F7204EEDCF00E2A63F /* bvh_unaligned.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bvh_unaligned.cpp; sourceTree = ""; }; F057B0F8204EEDCF00E2A63F /* bvh_unaligned.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bvh_unaligned.h; sourceTree = ""; }; F057B10B204EEDCF00E2A63F /* device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device.cpp; sourceTree = ""; }; F057B10C204EEDCF00E2A63F /* device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device.h; sourceTree = ""; }; F057B10D204EEDCF00E2A63F /* device_cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device_cpu.cpp; sourceTree = ""; }; F057B10F204EEDCF00E2A63F /* device_denoising.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device_denoising.cpp; sourceTree = ""; }; F057B110204EEDCF00E2A63F /* device_denoising.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_denoising.h; sourceTree = ""; }; F057B111204EEDCF00E2A63F /* device_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_intern.h; sourceTree = ""; }; F057B112204EEDCF00E2A63F /* device_memory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device_memory.cpp; sourceTree = ""; }; F057B113204EEDCF00E2A63F /* device_memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_memory.h; sourceTree = ""; }; F057B118204EEDCF00E2A63F /* device_split_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device_split_kernel.cpp; sourceTree = ""; }; F057B119204EEDCF00E2A63F /* device_split_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_split_kernel.h; sourceTree = ""; }; F057B11A204EEDCF00E2A63F /* device_task.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device_task.cpp; sourceTree = ""; }; F057B11B204EEDCF00E2A63F /* device_task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_task.h; sourceTree = ""; }; F057B131204EEDCF00E2A63F /* node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node.cpp; sourceTree = ""; }; F057B132204EEDCF00E2A63F /* node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node.h; sourceTree = ""; }; F057B133204EEDCF00E2A63F /* node_enum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_enum.h; sourceTree = ""; }; F057B134204EEDCF00E2A63F /* node_type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_type.cpp; sourceTree = ""; }; F057B135204EEDCF00E2A63F /* node_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_type.h; sourceTree = ""; }; F057B1A0204EEDCF00E2A63F /* filter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter.cpp; sourceTree = ""; }; F057B1A1204EEDCF00E2A63F /* filter_avx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter_avx.cpp; sourceTree = ""; }; F057B1A2204EEDCF00E2A63F /* filter_avx2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter_avx2.cpp; sourceTree = ""; }; F057B1A3204EEDCF00E2A63F /* filter_cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filter_cpu.h; sourceTree = ""; }; F057B1A4204EEDCF00E2A63F /* filter_cpu_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filter_cpu_impl.h; sourceTree = ""; }; F057B1A5204EEDCF00E2A63F /* filter_sse2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter_sse2.cpp; sourceTree = ""; }; F057B1A6204EEDCF00E2A63F /* filter_sse3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter_sse3.cpp; sourceTree = ""; }; F057B1A7204EEDCF00E2A63F /* filter_sse41.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filter_sse41.cpp; sourceTree = ""; }; F057B1A8204EEDCF00E2A63F /* kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel.cpp; sourceTree = ""; }; F057B1A9204EEDCF00E2A63F /* kernel_avx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_avx.cpp; sourceTree = ""; }; F057B1AA204EEDCF00E2A63F /* kernel_avx2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_avx2.cpp; sourceTree = ""; }; F057B1AB204EEDCF00E2A63F /* kernel_cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel_cpu.h; sourceTree = ""; }; F057B1AC204EEDCF00E2A63F /* kernel_cpu_image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel_cpu_image.h; sourceTree = ""; }; F057B1AD204EEDCF00E2A63F /* kernel_cpu_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel_cpu_impl.h; sourceTree = ""; }; F057B1AE204EEDCF00E2A63F /* kernel_split.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_split.cpp; sourceTree = ""; }; F057B1AF204EEDCF00E2A63F /* kernel_split_avx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_split_avx.cpp; sourceTree = ""; }; F057B1B0204EEDCF00E2A63F /* kernel_split_avx2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_split_avx2.cpp; sourceTree = ""; }; F057B1B1204EEDCF00E2A63F /* kernel_split_sse2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_split_sse2.cpp; sourceTree = ""; }; F057B1B2204EEDCF00E2A63F /* kernel_split_sse3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_split_sse3.cpp; sourceTree = ""; }; F057B1B3204EEDCF00E2A63F /* kernel_split_sse41.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_split_sse41.cpp; sourceTree = ""; }; F057B1B4204EEDCF00E2A63F /* kernel_sse2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_sse2.cpp; sourceTree = ""; }; F057B1B5204EEDCF00E2A63F /* kernel_sse3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_sse3.cpp; sourceTree = ""; }; F057B1B6204EEDCF00E2A63F /* kernel_sse41.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kernel_sse41.cpp; sourceTree = ""; }; F057B28A204EEDCF00E2A63F /* attribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = attribute.cpp; sourceTree = ""; }; F057B28B204EEDCF00E2A63F /* attribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = attribute.h; sourceTree = ""; }; F057B28C204EEDCF00E2A63F /* background.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = background.cpp; sourceTree = ""; }; F057B28D204EEDCF00E2A63F /* background.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = background.h; sourceTree = ""; }; F057B28E204EEDCF00E2A63F /* bake.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bake.cpp; sourceTree = ""; }; F057B28F204EEDCF00E2A63F /* bake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bake.h; sourceTree = ""; }; F057B290204EEDCF00E2A63F /* buffers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = buffers.cpp; sourceTree = ""; }; F057B291204EEDCF00E2A63F /* buffers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = buffers.h; sourceTree = ""; }; F057B292204EEDCF00E2A63F /* camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = camera.cpp; sourceTree = ""; }; F057B293204EEDCF00E2A63F /* camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = camera.h; sourceTree = ""; }; F057B295204EEDCF00E2A63F /* constant_fold.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = constant_fold.cpp; sourceTree = ""; }; F057B296204EEDCF00E2A63F /* constant_fold.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = constant_fold.h; sourceTree = ""; }; F057B297204EEDCF00E2A63F /* curves.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = curves.cpp; sourceTree = ""; }; F057B298204EEDCF00E2A63F /* curves.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = curves.h; sourceTree = ""; }; F057B299204EEDCF00E2A63F /* film.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = film.cpp; sourceTree = ""; }; F057B29A204EEDCF00E2A63F /* film.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = film.h; sourceTree = ""; }; F057B29B204EEDCF00E2A63F /* graph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = graph.cpp; sourceTree = ""; }; F057B29C204EEDCF00E2A63F /* graph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graph.h; sourceTree = ""; }; F057B29D204EEDCF00E2A63F /* image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = image.cpp; sourceTree = ""; }; F057B29E204EEDCF00E2A63F /* image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = image.h; sourceTree = ""; }; F057B29F204EEDCF00E2A63F /* integrator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = integrator.cpp; sourceTree = ""; }; F057B2A0204EEDCF00E2A63F /* integrator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = integrator.h; sourceTree = ""; }; F057B2A1204EEDCF00E2A63F /* light.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = light.cpp; sourceTree = ""; }; F057B2A2204EEDCF00E2A63F /* light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = light.h; sourceTree = ""; }; F057B2A3204EEDCF00E2A63F /* mesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mesh.cpp; sourceTree = ""; }; F057B2A4204EEDCF00E2A63F /* mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mesh.h; sourceTree = ""; }; F057B2A5204EEDCF00E2A63F /* mesh_displace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mesh_displace.cpp; sourceTree = ""; }; F057B2A6204EEDCF00E2A63F /* mesh_subdivision.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mesh_subdivision.cpp; sourceTree = ""; }; F057B2A7204EEDCF00E2A63F /* nodes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nodes.cpp; sourceTree = ""; }; F057B2A8204EEDCF00E2A63F /* nodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nodes.h; sourceTree = ""; }; F057B2A9204EEDCF00E2A63F /* object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object.cpp; sourceTree = ""; }; F057B2AA204EEDCF00E2A63F /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = ""; }; F057B2AB204EEDCF00E2A63F /* osl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = osl.cpp; sourceTree = ""; }; F057B2AC204EEDCF00E2A63F /* osl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = osl.h; sourceTree = ""; }; F057B2AD204EEDCF00E2A63F /* particles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = particles.cpp; sourceTree = ""; }; F057B2AE204EEDCF00E2A63F /* particles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = particles.h; sourceTree = ""; }; F057B2AF204EEDCF00E2A63F /* scene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scene.cpp; sourceTree = ""; }; F057B2B0204EEDCF00E2A63F /* scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scene.h; sourceTree = ""; }; F057B2B1204EEDCF00E2A63F /* session.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = session.cpp; sourceTree = ""; }; F057B2B2204EEDCF00E2A63F /* session.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = session.h; sourceTree = ""; }; F057B2B3204EEDCF00E2A63F /* shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shader.cpp; sourceTree = ""; }; F057B2B4204EEDCF00E2A63F /* shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shader.h; sourceTree = ""; }; F057B2B5204EEDCF00E2A63F /* sobol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sobol.cpp; sourceTree = ""; }; F057B2B6204EEDCF00E2A63F /* sobol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sobol.h; sourceTree = ""; }; F057B2B7204EEDCF00E2A63F /* svm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = svm.cpp; sourceTree = ""; }; F057B2B8204EEDCF00E2A63F /* svm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svm.h; sourceTree = ""; }; F057B2B9204EEDCF00E2A63F /* tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tables.cpp; sourceTree = ""; }; F057B2BA204EEDCF00E2A63F /* tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tables.h; sourceTree = ""; }; F057B2BB204EEDCF00E2A63F /* tile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tile.cpp; sourceTree = ""; }; F057B2BC204EEDCF00E2A63F /* tile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tile.h; sourceTree = ""; }; F057B2BF204EEDCF00E2A63F /* subd_dice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = subd_dice.cpp; sourceTree = ""; }; F057B2C0204EEDCF00E2A63F /* subd_dice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = subd_dice.h; sourceTree = ""; }; F057B2C1204EEDCF00E2A63F /* subd_patch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = subd_patch.cpp; sourceTree = ""; }; F057B2C2204EEDCF00E2A63F /* subd_patch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = subd_patch.h; sourceTree = ""; }; F057B2C3204EEDCF00E2A63F /* subd_patch_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = subd_patch_table.cpp; sourceTree = ""; }; F057B2C4204EEDCF00E2A63F /* subd_patch_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = subd_patch_table.h; sourceTree = ""; }; F057B2C5204EEDCF00E2A63F /* subd_split.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = subd_split.cpp; sourceTree = ""; }; F057B2C6204EEDCF00E2A63F /* subd_split.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = subd_split.h; sourceTree = ""; }; F057B2D0204EEDCF00E2A63F /* util_algorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_algorithm.h; sourceTree = ""; }; F057B2D1204EEDCF00E2A63F /* util_aligned_malloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_aligned_malloc.cpp; sourceTree = ""; }; F057B2D2204EEDCF00E2A63F /* util_aligned_malloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_aligned_malloc.h; sourceTree = ""; }; F057B2D3204EEDCF00E2A63F /* util_args.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_args.h; sourceTree = ""; }; F057B2D4204EEDCF00E2A63F /* util_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_atomic.h; sourceTree = ""; }; F057B2D5204EEDCF00E2A63F /* util_avxf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_avxf.h; sourceTree = ""; }; F057B2D6204EEDCF00E2A63F /* util_boundbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_boundbox.h; sourceTree = ""; }; F057B2D7204EEDCF00E2A63F /* util_color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_color.h; sourceTree = ""; }; F057B2D8204EEDCF00E2A63F /* util_debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_debug.cpp; sourceTree = ""; }; F057B2D9204EEDCF00E2A63F /* util_debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_debug.h; sourceTree = ""; }; F057B2DA204EEDCF00E2A63F /* util_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_defines.h; sourceTree = ""; }; F057B2DB204EEDCF00E2A63F /* util_foreach.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_foreach.h; sourceTree = ""; }; F057B2DC204EEDCF00E2A63F /* util_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_function.h; sourceTree = ""; }; F057B2DD204EEDCF00E2A63F /* util_guarded_allocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_guarded_allocator.cpp; sourceTree = ""; }; F057B2DE204EEDCF00E2A63F /* util_guarded_allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_guarded_allocator.h; sourceTree = ""; }; F057B2DF204EEDCF00E2A63F /* util_half.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_half.h; sourceTree = ""; }; F057B2E0204EEDCF00E2A63F /* util_hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_hash.h; sourceTree = ""; }; F057B2E1204EEDCF00E2A63F /* util_image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_image.h; sourceTree = ""; }; F057B2E2204EEDCF00E2A63F /* util_image_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_image_impl.h; sourceTree = ""; }; F057B2E3204EEDCF00E2A63F /* util_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_list.h; sourceTree = ""; }; F057B2E4204EEDCF00E2A63F /* util_logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_logging.cpp; sourceTree = ""; }; F057B2E5204EEDCF00E2A63F /* util_logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_logging.h; sourceTree = ""; }; F057B2E6204EEDCF00E2A63F /* util_map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_map.h; sourceTree = ""; }; F057B2E7204EEDCF00E2A63F /* util_math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math.h; sourceTree = ""; }; F057B2E8204EEDCF00E2A63F /* util_math_cdf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_math_cdf.cpp; sourceTree = ""; }; F057B2E9204EEDCF00E2A63F /* util_math_cdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_cdf.h; sourceTree = ""; }; F057B2EA204EEDCF00E2A63F /* util_math_fast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_fast.h; sourceTree = ""; }; F057B2EB204EEDCF00E2A63F /* util_math_float2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_float2.h; sourceTree = ""; }; F057B2EC204EEDCF00E2A63F /* util_math_float3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_float3.h; sourceTree = ""; }; F057B2ED204EEDCF00E2A63F /* util_math_float4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_float4.h; sourceTree = ""; }; F057B2EE204EEDCF00E2A63F /* util_math_int2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_int2.h; sourceTree = ""; }; F057B2EF204EEDCF00E2A63F /* util_math_int3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_int3.h; sourceTree = ""; }; F057B2F0204EEDCF00E2A63F /* util_math_int4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_int4.h; sourceTree = ""; }; F057B2F1204EEDCF00E2A63F /* util_math_intersect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_intersect.h; sourceTree = ""; }; F057B2F2204EEDCF00E2A63F /* util_math_matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_math_matrix.h; sourceTree = ""; }; F057B2F3204EEDCF00E2A63F /* util_md5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_md5.cpp; sourceTree = ""; }; F057B2F4204EEDCF00E2A63F /* util_md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_md5.h; sourceTree = ""; }; F057B2F5204EEDCF00E2A63F /* util_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_opengl.h; sourceTree = ""; }; F057B2F6204EEDCF00E2A63F /* util_optimization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_optimization.h; sourceTree = ""; }; F057B2F7204EEDCF00E2A63F /* util_param.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_param.cpp; sourceTree = ""; }; F057B2F8204EEDCF00E2A63F /* util_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_param.h; sourceTree = ""; }; F057B2F9204EEDCF00E2A63F /* util_path.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_path.cpp; sourceTree = ""; }; F057B2FA204EEDCF00E2A63F /* util_path.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_path.h; sourceTree = ""; }; F057B2FB204EEDCF00E2A63F /* util_progress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_progress.h; sourceTree = ""; }; F057B2FC204EEDCF00E2A63F /* util_queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_queue.h; sourceTree = ""; }; F057B2FD204EEDCF00E2A63F /* util_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_rect.h; sourceTree = ""; }; F057B2FE204EEDCF00E2A63F /* util_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_set.h; sourceTree = ""; }; F057B2FF204EEDCF00E2A63F /* util_simd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_simd.cpp; sourceTree = ""; }; F057B300204EEDCF00E2A63F /* util_simd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_simd.h; sourceTree = ""; }; F057B301204EEDCF00E2A63F /* util_sky_model.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_sky_model.cpp; sourceTree = ""; }; F057B302204EEDCF00E2A63F /* util_sky_model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_sky_model.h; sourceTree = ""; }; F057B303204EEDCF00E2A63F /* util_sky_model_data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_sky_model_data.h; sourceTree = ""; }; F057B304204EEDCF00E2A63F /* util_sseb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_sseb.h; sourceTree = ""; }; F057B305204EEDCF00E2A63F /* util_ssef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_ssef.h; sourceTree = ""; }; F057B306204EEDCF00E2A63F /* util_ssei.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_ssei.h; sourceTree = ""; }; F057B307204EEDCF00E2A63F /* util_stack_allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_stack_allocator.h; sourceTree = ""; }; F057B308204EEDCF00E2A63F /* util_static_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_static_assert.h; sourceTree = ""; }; F057B309204EEDCF00E2A63F /* util_stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_stats.h; sourceTree = ""; }; F057B30A204EEDCF00E2A63F /* util_string.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_string.cpp; sourceTree = ""; }; F057B30B204EEDCF00E2A63F /* util_string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_string.h; sourceTree = ""; }; F057B30C204EEDCF00E2A63F /* util_system.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_system.cpp; sourceTree = ""; }; F057B30D204EEDCF00E2A63F /* util_system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_system.h; sourceTree = ""; }; F057B30E204EEDCF00E2A63F /* util_task.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_task.cpp; sourceTree = ""; }; F057B30F204EEDCF00E2A63F /* util_task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_task.h; sourceTree = ""; }; F057B310204EEDCF00E2A63F /* util_texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_texture.h; sourceTree = ""; }; F057B311204EEDCF00E2A63F /* util_thread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_thread.cpp; sourceTree = ""; }; F057B312204EEDCF00E2A63F /* util_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_thread.h; sourceTree = ""; }; F057B313204EEDCF00E2A63F /* util_time.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_time.cpp; sourceTree = ""; }; F057B314204EEDCF00E2A63F /* util_time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_time.h; sourceTree = ""; }; F057B315204EEDCF00E2A63F /* util_transform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_transform.cpp; sourceTree = ""; }; F057B316204EEDCF00E2A63F /* util_transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_transform.h; sourceTree = ""; }; F057B317204EEDCF00E2A63F /* util_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types.h; sourceTree = ""; }; F057B318204EEDCF00E2A63F /* util_types_float2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_float2.h; sourceTree = ""; }; F057B319204EEDCF00E2A63F /* util_types_float2_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_float2_impl.h; sourceTree = ""; }; F057B31A204EEDCF00E2A63F /* util_types_float3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_float3.h; sourceTree = ""; }; F057B31B204EEDCF00E2A63F /* util_types_float3_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_float3_impl.h; sourceTree = ""; }; F057B31C204EEDCF00E2A63F /* util_types_float4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_float4.h; sourceTree = ""; }; F057B31D204EEDCF00E2A63F /* util_types_float4_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_float4_impl.h; sourceTree = ""; }; F057B31E204EEDCF00E2A63F /* util_types_int2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_int2.h; sourceTree = ""; }; F057B31F204EEDCF00E2A63F /* util_types_int2_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_int2_impl.h; sourceTree = ""; }; F057B320204EEDCF00E2A63F /* util_types_int3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_int3.h; sourceTree = ""; }; F057B321204EEDCF00E2A63F /* util_types_int3_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_int3_impl.h; sourceTree = ""; }; F057B322204EEDCF00E2A63F /* util_types_int4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_int4.h; sourceTree = ""; }; F057B323204EEDCF00E2A63F /* util_types_int4_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_int4_impl.h; sourceTree = ""; }; F057B324204EEDCF00E2A63F /* util_types_uchar2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uchar2.h; sourceTree = ""; }; F057B325204EEDCF00E2A63F /* util_types_uchar2_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uchar2_impl.h; sourceTree = ""; }; F057B326204EEDCF00E2A63F /* util_types_uchar3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uchar3.h; sourceTree = ""; }; F057B327204EEDCF00E2A63F /* util_types_uchar3_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uchar3_impl.h; sourceTree = ""; }; F057B328204EEDCF00E2A63F /* util_types_uchar4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uchar4.h; sourceTree = ""; }; F057B329204EEDCF00E2A63F /* util_types_uchar4_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uchar4_impl.h; sourceTree = ""; }; F057B32A204EEDCF00E2A63F /* util_types_uint2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uint2.h; sourceTree = ""; }; F057B32B204EEDCF00E2A63F /* util_types_uint2_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uint2_impl.h; sourceTree = ""; }; F057B32C204EEDCF00E2A63F /* util_types_uint3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uint3.h; sourceTree = ""; }; F057B32D204EEDCF00E2A63F /* util_types_uint3_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uint3_impl.h; sourceTree = ""; }; F057B32E204EEDCF00E2A63F /* util_types_uint4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uint4.h; sourceTree = ""; }; F057B32F204EEDCF00E2A63F /* util_types_uint4_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_uint4_impl.h; sourceTree = ""; }; F057B330204EEDCF00E2A63F /* util_types_vector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_vector3.h; sourceTree = ""; }; F057B331204EEDCF00E2A63F /* util_types_vector3_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_types_vector3_impl.h; sourceTree = ""; }; F057B332204EEDCF00E2A63F /* util_ustring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_ustring.h; sourceTree = ""; }; F057B333204EEDCF00E2A63F /* util_vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_vector.h; sourceTree = ""; }; F057B334204EEDCF00E2A63F /* util_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_version.h; sourceTree = ""; }; F057B337204EEDCF00E2A63F /* util_windows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_windows.cpp; sourceTree = ""; }; F057B338204EEDCF00E2A63F /* util_windows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_windows.h; sourceTree = ""; }; F057B339204EEDCF00E2A63F /* util_xml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util_xml.h; sourceTree = ""; }; F057B47D204EEFDE00E2A63F /* atomic_ops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomic_ops.h; sourceTree = ""; }; F057B4A7204EF13900E2A63F /* cycles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cycles.cpp; sourceTree = ""; }; F06C68391D2EAECC00887FCE /* camera.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = camera.c; sourceTree = ""; }; F06C683A1D2EAECC00887FCE /* quantization.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quantization.c; sourceTree = ""; }; F07DE9CF1BD0F03900BAA1AD /* goxel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = goxel.app; sourceTree = BUILT_PRODUCTS_DIR; }; F07DE9D21BD0F03900BAA1AD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; F07DE9D41BD0F03900BAA1AD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; F07DE9D71BD0F03900BAA1AD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; F07DE9D91BD0F03900BAA1AD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F07DE9DF1BD0F16300BAA1AD /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; F07DE9E51BD0F31500BAA1AD /* box.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = box.h; sourceTree = ""; }; F07DE9E61BD0F31500BAA1AD /* color.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = color.c; sourceTree = ""; }; F07DE9EA1BD0F31500BAA1AD /* goxel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = goxel.c; sourceTree = ""; }; F07DE9EB1BD0F31500BAA1AD /* goxel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = goxel.h; sourceTree = ""; }; F07DE9EC1BD0F31500BAA1AD /* gui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gui.cpp; sourceTree = ""; }; F07DE9ED1BD0F31500BAA1AD /* image.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = image.c; sourceTree = ""; }; F07DE9EE1BD0F31500BAA1AD /* imgui_user.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = imgui_user.inl; sourceTree = ""; }; F07DE9F11BD0F31500BAA1AD /* mesh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mesh.c; sourceTree = ""; }; F07DE9F21BD0F31500BAA1AD /* model3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = model3d.c; sourceTree = ""; }; F07DE9F31BD0F31500BAA1AD /* palette.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = palette.c; sourceTree = ""; }; F07DE9F41BD0F31500BAA1AD /* plane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = plane.h; sourceTree = ""; }; F07DE9F61BD0F31500BAA1AD /* render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = render.c; sourceTree = ""; }; F07DE9F81BD0F31500BAA1AD /* shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shape.c; sourceTree = ""; }; F07DE9F91BD0F31500BAA1AD /* system.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = system.c; sourceTree = ""; }; F07DE9FA1BD0F31500BAA1AD /* texture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = texture.c; sourceTree = ""; }; F07DE9FB1BD0F31500BAA1AD /* tools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tools.c; sourceTree = ""; }; F07DE9FC1BD0F31500BAA1AD /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utils.c; sourceTree = ""; }; F07DE9FD1BD0F31500BAA1AD /* vec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vec.h; sourceTree = ""; }; F07DEA221BD0F33A00BAA1AD /* stb_image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stb_image.h; sourceTree = ""; }; F07DEA231BD0F33A00BAA1AD /* stb_image_write.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stb_image_write.h; sourceTree = ""; }; F07DEA241BD0F33A00BAA1AD /* stb_rect_pack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stb_rect_pack.h; sourceTree = ""; }; F07DEA251BD0F33A00BAA1AD /* stb_textedit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stb_textedit.h; sourceTree = ""; }; F07DEA261BD0F33A00BAA1AD /* stb_truetype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stb_truetype.h; sourceTree = ""; }; F07DEA281BD0F33A00BAA1AD /* utarray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utarray.h; sourceTree = ""; }; F07DEA291BD0F33A00BAA1AD /* uthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uthash.h; sourceTree = ""; }; F07DEA2A1BD0F33A00BAA1AD /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utlist.h; sourceTree = ""; }; F07DEA2E1BD0F3D000BAA1AD /* goxel.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = goxel.pch; sourceTree = ""; }; F07DEA2F1BD0FB5F00BAA1AD /* goxel-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "goxel-Bridging-Header.h"; sourceTree = ""; }; F07DEA321BD1014800BAA1AD /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; F097B3F11F0C97DB00A3622B /* gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gesture.c; sourceTree = ""; }; F097B3F21F0C97DB00A3622B /* gesture3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gesture3d.c; sourceTree = ""; }; F0A15FF21E962F1300C6EF33 /* dicom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dicom.c; sourceTree = ""; }; F0A15FF31E962F1300C6EF33 /* png.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = png.c; sourceTree = ""; }; F0A15FF41E962F1300C6EF33 /* povray.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = povray.c; sourceTree = ""; }; F0A15FF51E962F1300C6EF33 /* qubicle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qubicle.c; sourceTree = ""; }; F0A15FF71E962F1300C6EF33 /* txt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = txt.c; sourceTree = ""; }; F0A15FF81E962F1300C6EF33 /* vox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vox.c; sourceTree = ""; }; F0A15FF91E962F1300C6EF33 /* voxlap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = voxlap.c; sourceTree = ""; }; F0A15FFA1E962F1300C6EF33 /* vxl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vxl.c; sourceTree = ""; }; F0A15FFB1E962F1300C6EF33 /* wavefront.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wavefront.c; sourceTree = ""; }; F0A160061E962F4600C6EF33 /* marchingcube.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = marchingcube.c; sourceTree = ""; }; F0A160071E962F4600C6EF33 /* mustache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mustache.c; sourceTree = ""; }; F0AE90F51C8EE01200C29080 /* assets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = assets.c; sourceTree = ""; }; F0C4F1411F308976002E73C5 /* gui_settings.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gui_settings.c; sourceTree = ""; }; F0C5368A1F42EE43003A0DCA /* extrude.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = extrude.c; sourceTree = ""; }; F0D463BC1E48759A004F1A37 /* cache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cache.c; sourceTree = ""; }; F0D463BE1E4875CA004F1A37 /* stack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stack.c; sourceTree = ""; }; F0DE970E1E6FE8BF000354AF /* noc_file_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = noc_file_dialog.h; sourceTree = ""; }; F0DE970F1E6FEA1F000354AF /* dialogs_osx.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = dialogs_osx.m; sourceTree = ""; }; F0E71BAB1F1DA30D00D20C7C /* theme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = theme.c; sourceTree = ""; }; F0E71BAE1F1DA7A100D20C7C /* ini.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ini.c; sourceTree = ""; }; F0E71BAF1F1DA7A100D20C7C /* ini.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ini.h; sourceTree = ""; }; F0ED3C611F98B03200FB50DE /* mesh_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mesh_utils.c; sourceTree = ""; }; F0ED3C621F98B03200FB50DE /* mesh_to_vertices.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mesh_to_vertices.c; sourceTree = ""; }; F0ED3C631F98B03300FB50DE /* mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mesh.h; sourceTree = ""; }; F0EEB7D91C8EC25D004AB676 /* procedural.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = procedural.c; sourceTree = ""; }; F0EEB7DB1C8EC25D004AB676 /* procedural.leg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = procedural.leg; sourceTree = ""; }; F0EEB7E31C8EC27C004AB676 /* action.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = action.c; sourceTree = ""; }; F0EEB7E51C8EC472004AB676 /* procedural.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = procedural.inl; sourceTree = ""; }; F0EEB7E71C8EC4D1004AB676 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; F0F14C6620AF282E0006E575 /* imgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = imgui.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ F07DE9CC1BD0F03900BAA1AD /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( F0EEB7E81C8EC4D1004AB676 /* libz.tbd in Frameworks */, F07DEA331BD1014800BAA1AD /* CoreFoundation.framework in Frameworks */, F07DE9E01BD0F16300BAA1AD /* OpenGL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ F037D5C61EA6069A00C96D10 /* tools */ = { isa = PBXGroup; children = ( F0C5368A1F42EE43003A0DCA /* extrude.c */, F037D5C71EA6069A00C96D10 /* brush.c */, F037D5C81EA6069A00C96D10 /* color_picker.c */, F037D5C91EA6069A00C96D10 /* laser.c */, F037D5CA1EA6069A00C96D10 /* move.c */, F037D5CB1EA6069A00C96D10 /* plane.c */, F037D5CC1EA6069A00C96D10 /* procedural.c */, F037D5CD1EA6069A00C96D10 /* selection.c */, F037D5CE1EA6069A00C96D10 /* shape.c */, ); path = tools; sourceTree = ""; }; F057B0BF204EEDCF00E2A63F /* cycles */ = { isa = PBXGroup; children = ( F057B47B204EEFDE00E2A63F /* third_party */, F057B0C0204EEDCF00E2A63F /* src */, ); path = cycles; sourceTree = ""; }; F057B0C0204EEDCF00E2A63F /* src */ = { isa = PBXGroup; children = ( F057B0E5204EEDCF00E2A63F /* bvh */, F057B109204EEDCF00E2A63F /* device */, F057B12F204EEDCF00E2A63F /* graph */, F057B138204EEDCF00E2A63F /* kernel */, F057B289204EEDCF00E2A63F /* render */, F057B2BD204EEDCF00E2A63F /* subd */, F057B2CE204EEDCF00E2A63F /* util */, ); path = src; sourceTree = ""; }; F057B0E5204EEDCF00E2A63F /* bvh */ = { isa = PBXGroup; children = ( F057B0E6204EEDCF00E2A63F /* bvh.cpp */, F057B0E7204EEDCF00E2A63F /* bvh.h */, F057B0E8204EEDCF00E2A63F /* bvh2.cpp */, F057B0E9204EEDCF00E2A63F /* bvh2.h */, F057B0EA204EEDCF00E2A63F /* bvh4.cpp */, F057B0EB204EEDCF00E2A63F /* bvh4.h */, F057B0EC204EEDCF00E2A63F /* bvh_binning.cpp */, F057B0ED204EEDCF00E2A63F /* bvh_binning.h */, F057B0EE204EEDCF00E2A63F /* bvh_build.cpp */, F057B0EF204EEDCF00E2A63F /* bvh_build.h */, F057B0F0204EEDCF00E2A63F /* bvh_node.cpp */, F057B0F1204EEDCF00E2A63F /* bvh_node.h */, F057B0F2204EEDCF00E2A63F /* bvh_params.h */, F057B0F3204EEDCF00E2A63F /* bvh_sort.cpp */, F057B0F4204EEDCF00E2A63F /* bvh_sort.h */, F057B0F5204EEDCF00E2A63F /* bvh_split.cpp */, F057B0F6204EEDCF00E2A63F /* bvh_split.h */, F057B0F7204EEDCF00E2A63F /* bvh_unaligned.cpp */, F057B0F8204EEDCF00E2A63F /* bvh_unaligned.h */, ); path = bvh; sourceTree = ""; }; F057B109204EEDCF00E2A63F /* device */ = { isa = PBXGroup; children = ( F057B10B204EEDCF00E2A63F /* device.cpp */, F057B10C204EEDCF00E2A63F /* device.h */, F057B10D204EEDCF00E2A63F /* device_cpu.cpp */, F057B10F204EEDCF00E2A63F /* device_denoising.cpp */, F057B110204EEDCF00E2A63F /* device_denoising.h */, F057B111204EEDCF00E2A63F /* device_intern.h */, F057B112204EEDCF00E2A63F /* device_memory.cpp */, F057B113204EEDCF00E2A63F /* device_memory.h */, F057B118204EEDCF00E2A63F /* device_split_kernel.cpp */, F057B119204EEDCF00E2A63F /* device_split_kernel.h */, F057B11A204EEDCF00E2A63F /* device_task.cpp */, F057B11B204EEDCF00E2A63F /* device_task.h */, ); path = device; sourceTree = ""; }; F057B12F204EEDCF00E2A63F /* graph */ = { isa = PBXGroup; children = ( F057B131204EEDCF00E2A63F /* node.cpp */, F057B132204EEDCF00E2A63F /* node.h */, F057B133204EEDCF00E2A63F /* node_enum.h */, F057B134204EEDCF00E2A63F /* node_type.cpp */, F057B135204EEDCF00E2A63F /* node_type.h */, ); path = graph; sourceTree = ""; }; F057B138204EEDCF00E2A63F /* kernel */ = { isa = PBXGroup; children = ( F057B19E204EEDCF00E2A63F /* kernels */, ); path = kernel; sourceTree = ""; }; F057B19E204EEDCF00E2A63F /* kernels */ = { isa = PBXGroup; children = ( F057B19F204EEDCF00E2A63F /* cpu */, ); path = kernels; sourceTree = ""; }; F057B19F204EEDCF00E2A63F /* cpu */ = { isa = PBXGroup; children = ( F057B1A0204EEDCF00E2A63F /* filter.cpp */, F057B1A1204EEDCF00E2A63F /* filter_avx.cpp */, F057B1A2204EEDCF00E2A63F /* filter_avx2.cpp */, F057B1A3204EEDCF00E2A63F /* filter_cpu.h */, F057B1A4204EEDCF00E2A63F /* filter_cpu_impl.h */, F057B1A5204EEDCF00E2A63F /* filter_sse2.cpp */, F057B1A6204EEDCF00E2A63F /* filter_sse3.cpp */, F057B1A7204EEDCF00E2A63F /* filter_sse41.cpp */, F057B1A8204EEDCF00E2A63F /* kernel.cpp */, F057B1A9204EEDCF00E2A63F /* kernel_avx.cpp */, F057B1AA204EEDCF00E2A63F /* kernel_avx2.cpp */, F057B1AB204EEDCF00E2A63F /* kernel_cpu.h */, F057B1AC204EEDCF00E2A63F /* kernel_cpu_image.h */, F057B1AD204EEDCF00E2A63F /* kernel_cpu_impl.h */, F057B1AE204EEDCF00E2A63F /* kernel_split.cpp */, F057B1AF204EEDCF00E2A63F /* kernel_split_avx.cpp */, F057B1B0204EEDCF00E2A63F /* kernel_split_avx2.cpp */, F057B1B1204EEDCF00E2A63F /* kernel_split_sse2.cpp */, F057B1B2204EEDCF00E2A63F /* kernel_split_sse3.cpp */, F057B1B3204EEDCF00E2A63F /* kernel_split_sse41.cpp */, F057B1B4204EEDCF00E2A63F /* kernel_sse2.cpp */, F057B1B5204EEDCF00E2A63F /* kernel_sse3.cpp */, F057B1B6204EEDCF00E2A63F /* kernel_sse41.cpp */, ); path = cpu; sourceTree = ""; }; F057B289204EEDCF00E2A63F /* render */ = { isa = PBXGroup; children = ( F057B28A204EEDCF00E2A63F /* attribute.cpp */, F057B28B204EEDCF00E2A63F /* attribute.h */, F057B28C204EEDCF00E2A63F /* background.cpp */, F057B28D204EEDCF00E2A63F /* background.h */, F057B28E204EEDCF00E2A63F /* bake.cpp */, F057B28F204EEDCF00E2A63F /* bake.h */, F057B290204EEDCF00E2A63F /* buffers.cpp */, F057B291204EEDCF00E2A63F /* buffers.h */, F057B292204EEDCF00E2A63F /* camera.cpp */, F057B293204EEDCF00E2A63F /* camera.h */, F057B295204EEDCF00E2A63F /* constant_fold.cpp */, F057B296204EEDCF00E2A63F /* constant_fold.h */, F057B297204EEDCF00E2A63F /* curves.cpp */, F057B298204EEDCF00E2A63F /* curves.h */, F057B299204EEDCF00E2A63F /* film.cpp */, F057B29A204EEDCF00E2A63F /* film.h */, F057B29B204EEDCF00E2A63F /* graph.cpp */, F057B29C204EEDCF00E2A63F /* graph.h */, F057B29D204EEDCF00E2A63F /* image.cpp */, F057B29E204EEDCF00E2A63F /* image.h */, F057B29F204EEDCF00E2A63F /* integrator.cpp */, F057B2A0204EEDCF00E2A63F /* integrator.h */, F057B2A1204EEDCF00E2A63F /* light.cpp */, F057B2A2204EEDCF00E2A63F /* light.h */, F057B2A3204EEDCF00E2A63F /* mesh.cpp */, F057B2A4204EEDCF00E2A63F /* mesh.h */, F057B2A5204EEDCF00E2A63F /* mesh_displace.cpp */, F057B2A6204EEDCF00E2A63F /* mesh_subdivision.cpp */, F057B2A7204EEDCF00E2A63F /* nodes.cpp */, F057B2A8204EEDCF00E2A63F /* nodes.h */, F057B2A9204EEDCF00E2A63F /* object.cpp */, F057B2AA204EEDCF00E2A63F /* object.h */, F057B2AB204EEDCF00E2A63F /* osl.cpp */, F057B2AC204EEDCF00E2A63F /* osl.h */, F057B2AD204EEDCF00E2A63F /* particles.cpp */, F057B2AE204EEDCF00E2A63F /* particles.h */, F057B2AF204EEDCF00E2A63F /* scene.cpp */, F057B2B0204EEDCF00E2A63F /* scene.h */, F057B2B1204EEDCF00E2A63F /* session.cpp */, F057B2B2204EEDCF00E2A63F /* session.h */, F057B2B3204EEDCF00E2A63F /* shader.cpp */, F057B2B4204EEDCF00E2A63F /* shader.h */, F057B2B5204EEDCF00E2A63F /* sobol.cpp */, F057B2B6204EEDCF00E2A63F /* sobol.h */, F057B2B7204EEDCF00E2A63F /* svm.cpp */, F057B2B8204EEDCF00E2A63F /* svm.h */, F057B2B9204EEDCF00E2A63F /* tables.cpp */, F057B2BA204EEDCF00E2A63F /* tables.h */, F057B2BB204EEDCF00E2A63F /* tile.cpp */, F057B2BC204EEDCF00E2A63F /* tile.h */, ); path = render; sourceTree = ""; }; F057B2BD204EEDCF00E2A63F /* subd */ = { isa = PBXGroup; children = ( F057B2BF204EEDCF00E2A63F /* subd_dice.cpp */, F057B2C0204EEDCF00E2A63F /* subd_dice.h */, F057B2C1204EEDCF00E2A63F /* subd_patch.cpp */, F057B2C2204EEDCF00E2A63F /* subd_patch.h */, F057B2C3204EEDCF00E2A63F /* subd_patch_table.cpp */, F057B2C4204EEDCF00E2A63F /* subd_patch_table.h */, F057B2C5204EEDCF00E2A63F /* subd_split.cpp */, F057B2C6204EEDCF00E2A63F /* subd_split.h */, ); path = subd; sourceTree = ""; }; F057B2CE204EEDCF00E2A63F /* util */ = { isa = PBXGroup; children = ( F057B2D0204EEDCF00E2A63F /* util_algorithm.h */, F057B2D1204EEDCF00E2A63F /* util_aligned_malloc.cpp */, F057B2D2204EEDCF00E2A63F /* util_aligned_malloc.h */, F057B2D3204EEDCF00E2A63F /* util_args.h */, F057B2D4204EEDCF00E2A63F /* util_atomic.h */, F057B2D5204EEDCF00E2A63F /* util_avxf.h */, F057B2D6204EEDCF00E2A63F /* util_boundbox.h */, F057B2D7204EEDCF00E2A63F /* util_color.h */, F057B2D8204EEDCF00E2A63F /* util_debug.cpp */, F057B2D9204EEDCF00E2A63F /* util_debug.h */, F057B2DA204EEDCF00E2A63F /* util_defines.h */, F057B2DB204EEDCF00E2A63F /* util_foreach.h */, F057B2DC204EEDCF00E2A63F /* util_function.h */, F057B2DD204EEDCF00E2A63F /* util_guarded_allocator.cpp */, F057B2DE204EEDCF00E2A63F /* util_guarded_allocator.h */, F057B2DF204EEDCF00E2A63F /* util_half.h */, F057B2E0204EEDCF00E2A63F /* util_hash.h */, F057B2E1204EEDCF00E2A63F /* util_image.h */, F057B2E2204EEDCF00E2A63F /* util_image_impl.h */, F057B2E3204EEDCF00E2A63F /* util_list.h */, F057B2E4204EEDCF00E2A63F /* util_logging.cpp */, F057B2E5204EEDCF00E2A63F /* util_logging.h */, F057B2E6204EEDCF00E2A63F /* util_map.h */, F057B2E7204EEDCF00E2A63F /* util_math.h */, F057B2E8204EEDCF00E2A63F /* util_math_cdf.cpp */, F057B2E9204EEDCF00E2A63F /* util_math_cdf.h */, F057B2EA204EEDCF00E2A63F /* util_math_fast.h */, F057B2EB204EEDCF00E2A63F /* util_math_float2.h */, F057B2EC204EEDCF00E2A63F /* util_math_float3.h */, F057B2ED204EEDCF00E2A63F /* util_math_float4.h */, F057B2EE204EEDCF00E2A63F /* util_math_int2.h */, F057B2EF204EEDCF00E2A63F /* util_math_int3.h */, F057B2F0204EEDCF00E2A63F /* util_math_int4.h */, F057B2F1204EEDCF00E2A63F /* util_math_intersect.h */, F057B2F2204EEDCF00E2A63F /* util_math_matrix.h */, F057B2F3204EEDCF00E2A63F /* util_md5.cpp */, F057B2F4204EEDCF00E2A63F /* util_md5.h */, F057B2F5204EEDCF00E2A63F /* util_opengl.h */, F057B2F6204EEDCF00E2A63F /* util_optimization.h */, F057B2F7204EEDCF00E2A63F /* util_param.cpp */, F057B2F8204EEDCF00E2A63F /* util_param.h */, F057B2F9204EEDCF00E2A63F /* util_path.cpp */, F057B2FA204EEDCF00E2A63F /* util_path.h */, F057B2FB204EEDCF00E2A63F /* util_progress.h */, F057B2FC204EEDCF00E2A63F /* util_queue.h */, F057B2FD204EEDCF00E2A63F /* util_rect.h */, F057B2FE204EEDCF00E2A63F /* util_set.h */, F057B2FF204EEDCF00E2A63F /* util_simd.cpp */, F057B300204EEDCF00E2A63F /* util_simd.h */, F057B301204EEDCF00E2A63F /* util_sky_model.cpp */, F057B302204EEDCF00E2A63F /* util_sky_model.h */, F057B303204EEDCF00E2A63F /* util_sky_model_data.h */, F057B304204EEDCF00E2A63F /* util_sseb.h */, F057B305204EEDCF00E2A63F /* util_ssef.h */, F057B306204EEDCF00E2A63F /* util_ssei.h */, F057B307204EEDCF00E2A63F /* util_stack_allocator.h */, F057B308204EEDCF00E2A63F /* util_static_assert.h */, F057B309204EEDCF00E2A63F /* util_stats.h */, F057B30A204EEDCF00E2A63F /* util_string.cpp */, F057B30B204EEDCF00E2A63F /* util_string.h */, F057B30C204EEDCF00E2A63F /* util_system.cpp */, F057B30D204EEDCF00E2A63F /* util_system.h */, F057B30E204EEDCF00E2A63F /* util_task.cpp */, F057B30F204EEDCF00E2A63F /* util_task.h */, F057B310204EEDCF00E2A63F /* util_texture.h */, F057B311204EEDCF00E2A63F /* util_thread.cpp */, F057B312204EEDCF00E2A63F /* util_thread.h */, F057B313204EEDCF00E2A63F /* util_time.cpp */, F057B314204EEDCF00E2A63F /* util_time.h */, F057B315204EEDCF00E2A63F /* util_transform.cpp */, F057B316204EEDCF00E2A63F /* util_transform.h */, F057B317204EEDCF00E2A63F /* util_types.h */, F057B318204EEDCF00E2A63F /* util_types_float2.h */, F057B319204EEDCF00E2A63F /* util_types_float2_impl.h */, F057B31A204EEDCF00E2A63F /* util_types_float3.h */, F057B31B204EEDCF00E2A63F /* util_types_float3_impl.h */, F057B31C204EEDCF00E2A63F /* util_types_float4.h */, F057B31D204EEDCF00E2A63F /* util_types_float4_impl.h */, F057B31E204EEDCF00E2A63F /* util_types_int2.h */, F057B31F204EEDCF00E2A63F /* util_types_int2_impl.h */, F057B320204EEDCF00E2A63F /* util_types_int3.h */, F057B321204EEDCF00E2A63F /* util_types_int3_impl.h */, F057B322204EEDCF00E2A63F /* util_types_int4.h */, F057B323204EEDCF00E2A63F /* util_types_int4_impl.h */, F057B324204EEDCF00E2A63F /* util_types_uchar2.h */, F057B325204EEDCF00E2A63F /* util_types_uchar2_impl.h */, F057B326204EEDCF00E2A63F /* util_types_uchar3.h */, F057B327204EEDCF00E2A63F /* util_types_uchar3_impl.h */, F057B328204EEDCF00E2A63F /* util_types_uchar4.h */, F057B329204EEDCF00E2A63F /* util_types_uchar4_impl.h */, F057B32A204EEDCF00E2A63F /* util_types_uint2.h */, F057B32B204EEDCF00E2A63F /* util_types_uint2_impl.h */, F057B32C204EEDCF00E2A63F /* util_types_uint3.h */, F057B32D204EEDCF00E2A63F /* util_types_uint3_impl.h */, F057B32E204EEDCF00E2A63F /* util_types_uint4.h */, F057B32F204EEDCF00E2A63F /* util_types_uint4_impl.h */, F057B330204EEDCF00E2A63F /* util_types_vector3.h */, F057B331204EEDCF00E2A63F /* util_types_vector3_impl.h */, F057B332204EEDCF00E2A63F /* util_ustring.h */, F057B333204EEDCF00E2A63F /* util_vector.h */, F057B334204EEDCF00E2A63F /* util_version.h */, F057B337204EEDCF00E2A63F /* util_windows.cpp */, F057B338204EEDCF00E2A63F /* util_windows.h */, F057B339204EEDCF00E2A63F /* util_xml.h */, ); path = util; sourceTree = ""; }; F057B47B204EEFDE00E2A63F /* third_party */ = { isa = PBXGroup; children = ( F057B47C204EEFDE00E2A63F /* atomic */, ); path = third_party; sourceTree = ""; }; F057B47C204EEFDE00E2A63F /* atomic */ = { isa = PBXGroup; children = ( F057B47D204EEFDE00E2A63F /* atomic_ops.h */, ); path = atomic; sourceTree = ""; }; F07DE9C61BD0F03900BAA1AD = { isa = PBXGroup; children = ( F0EEB7E71C8EC4D1004AB676 /* libz.tbd */, F07DEA321BD1014800BAA1AD /* CoreFoundation.framework */, F07DE9DF1BD0F16300BAA1AD /* OpenGL.framework */, F07DE9D11BD0F03900BAA1AD /* goxel */, F07DE9D01BD0F03900BAA1AD /* Products */, ); sourceTree = ""; }; F07DE9D01BD0F03900BAA1AD /* Products */ = { isa = PBXGroup; children = ( F07DE9CF1BD0F03900BAA1AD /* goxel.app */, ); name = Products; sourceTree = ""; }; F07DE9D11BD0F03900BAA1AD /* goxel */ = { isa = PBXGroup; children = ( F07DEA151BD0F33A00BAA1AD /* ext_src */, F07DE9E31BD0F31500BAA1AD /* src */, F07DE9D21BD0F03900BAA1AD /* AppDelegate.swift */, F07DE9D41BD0F03900BAA1AD /* Assets.xcassets */, F07DE9D61BD0F03900BAA1AD /* MainMenu.xib */, F07DE9D91BD0F03900BAA1AD /* Info.plist */, F07DEA2E1BD0F3D000BAA1AD /* goxel.pch */, F07DEA2F1BD0FB5F00BAA1AD /* goxel-Bridging-Header.h */, ); path = goxel; sourceTree = ""; }; F07DE9E31BD0F31500BAA1AD /* src */ = { isa = PBXGroup; children = ( F0F14C6620AF282E0006E575 /* imgui.cpp */, F01452C42070FC51007F0106 /* utils_gl.c */, F057B4A7204EF13900E2A63F /* cycles.cpp */, F0ED3C621F98B03200FB50DE /* mesh_to_vertices.c */, F0ED3C611F98B03200FB50DE /* mesh_utils.c */, F0ED3C631F98B03300FB50DE /* mesh.h */, F0C4F1411F308976002E73C5 /* gui_settings.c */, F0E71BAB1F1DA30D00D20C7C /* theme.c */, F0158ECA1F17289B008893E6 /* sound_openal.inl */, F0158ECB1F17289B008893E6 /* sound.c */, F097B3F11F0C97DB00A3622B /* gesture.c */, F097B3F21F0C97DB00A3622B /* gesture3d.c */, F037D5C61EA6069A00C96D10 /* tools */, F037D5C41EA6066300C96D10 /* vec.c */, F0A160061E962F4600C6EF33 /* marchingcube.c */, F0A160071E962F4600C6EF33 /* mustache.c */, F0A15FF11E962F1300C6EF33 /* formats */, F0DE970F1E6FEA1F000354AF /* dialogs_osx.m */, F0D463BE1E4875CA004F1A37 /* stack.c */, F0D463BC1E48759A004F1A37 /* cache.c */, F06C68391D2EAECC00887FCE /* camera.c */, F06C683A1D2EAECC00887FCE /* quantization.c */, F0AE90F51C8EE01200C29080 /* assets.c */, F0EEB7E51C8EC472004AB676 /* procedural.inl */, F0EEB7E31C8EC27C004AB676 /* action.c */, F0EEB7D91C8EC25D004AB676 /* procedural.c */, F0EEB7DB1C8EC25D004AB676 /* procedural.leg */, F07DE9E51BD0F31500BAA1AD /* box.h */, F07DE9E61BD0F31500BAA1AD /* color.c */, F07DE9EA1BD0F31500BAA1AD /* goxel.c */, F07DE9EB1BD0F31500BAA1AD /* goxel.h */, F07DE9EC1BD0F31500BAA1AD /* gui.cpp */, F07DE9ED1BD0F31500BAA1AD /* image.c */, F07DE9EE1BD0F31500BAA1AD /* imgui_user.inl */, F07DE9F11BD0F31500BAA1AD /* mesh.c */, F07DE9F21BD0F31500BAA1AD /* model3d.c */, F07DE9F31BD0F31500BAA1AD /* palette.c */, F07DE9F41BD0F31500BAA1AD /* plane.h */, F07DE9F61BD0F31500BAA1AD /* render.c */, F07DE9F81BD0F31500BAA1AD /* shape.c */, F07DE9F91BD0F31500BAA1AD /* system.c */, F07DE9FA1BD0F31500BAA1AD /* texture.c */, F07DE9FB1BD0F31500BAA1AD /* tools.c */, F07DE9FC1BD0F31500BAA1AD /* utils.c */, F07DE9FD1BD0F31500BAA1AD /* vec.h */, ); name = src; path = ../../../src; sourceTree = ""; }; F07DEA151BD0F33A00BAA1AD /* ext_src */ = { isa = PBXGroup; children = ( F057B0BF204EEDCF00E2A63F /* cycles */, F0E71BAD1F1DA7A100D20C7C /* inih */, F0DE970D1E6FE8BF000354AF /* noc */, F07DEA211BD0F33A00BAA1AD /* stb */, F07DEA271BD0F33A00BAA1AD /* uthash */, ); name = ext_src; path = ../../../ext_src; sourceTree = ""; }; F07DEA211BD0F33A00BAA1AD /* stb */ = { isa = PBXGroup; children = ( F07DEA221BD0F33A00BAA1AD /* stb_image.h */, F07DEA231BD0F33A00BAA1AD /* stb_image_write.h */, F07DEA241BD0F33A00BAA1AD /* stb_rect_pack.h */, F07DEA251BD0F33A00BAA1AD /* stb_textedit.h */, F07DEA261BD0F33A00BAA1AD /* stb_truetype.h */, ); path = stb; sourceTree = ""; }; F07DEA271BD0F33A00BAA1AD /* uthash */ = { isa = PBXGroup; children = ( F07DEA281BD0F33A00BAA1AD /* utarray.h */, F07DEA291BD0F33A00BAA1AD /* uthash.h */, F07DEA2A1BD0F33A00BAA1AD /* utlist.h */, ); path = uthash; sourceTree = ""; }; F0A15FF11E962F1300C6EF33 /* formats */ = { isa = PBXGroup; children = ( F025C7DA1F33239000C52709 /* png_slices.c */, F037D5C21EA6061F00C96D10 /* gox.c */, F0A15FF21E962F1300C6EF33 /* dicom.c */, F0A15FF31E962F1300C6EF33 /* png.c */, F0A15FF41E962F1300C6EF33 /* povray.c */, F0A15FF51E962F1300C6EF33 /* qubicle.c */, F0A15FF71E962F1300C6EF33 /* txt.c */, F0A15FF81E962F1300C6EF33 /* vox.c */, F0A15FF91E962F1300C6EF33 /* voxlap.c */, F0A15FFA1E962F1300C6EF33 /* vxl.c */, F0A15FFB1E962F1300C6EF33 /* wavefront.c */, ); path = formats; sourceTree = ""; }; F0DE970D1E6FE8BF000354AF /* noc */ = { isa = PBXGroup; children = ( F0DE970E1E6FE8BF000354AF /* noc_file_dialog.h */, ); path = noc; sourceTree = ""; }; F0E71BAD1F1DA7A100D20C7C /* inih */ = { isa = PBXGroup; children = ( F0E71BAE1F1DA7A100D20C7C /* ini.c */, F0E71BAF1F1DA7A100D20C7C /* ini.h */, ); path = inih; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ F07DE9CE1BD0F03900BAA1AD /* goxel */ = { isa = PBXNativeTarget; buildConfigurationList = F07DE9DC1BD0F03900BAA1AD /* Build configuration list for PBXNativeTarget "goxel" */; buildPhases = ( F07DE9CB1BD0F03900BAA1AD /* Sources */, F07DE9CC1BD0F03900BAA1AD /* Frameworks */, F07DE9CD1BD0F03900BAA1AD /* Resources */, ); buildRules = ( ); dependencies = ( ); name = goxel; productName = goxel; productReference = F07DE9CF1BD0F03900BAA1AD /* goxel.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ F07DE9C71BD0F03900BAA1AD /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0900; ORGANIZATIONNAME = "Noctua Software Limited"; TargetAttributes = { F07DE9CE1BD0F03900BAA1AD = { CreatedOnToolsVersion = 7.0.1; DevelopmentTeam = VH4XTANA7R; LastSwiftMigration = 0900; }; }; }; buildConfigurationList = F07DE9CA1BD0F03900BAA1AD /* Build configuration list for PBXProject "goxel" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = F07DE9C61BD0F03900BAA1AD; productRefGroup = F07DE9D01BD0F03900BAA1AD /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( F07DE9CE1BD0F03900BAA1AD /* goxel */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ F07DE9CD1BD0F03900BAA1AD /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( F0EEB7E61C8EC472004AB676 /* procedural.inl in Resources */, F07DEA071BD0F31500BAA1AD /* imgui_user.inl in Resources */, F0158ECC1F17289B008893E6 /* sound_openal.inl in Resources */, F07DE9D51BD0F03900BAA1AD /* Assets.xcassets in Resources */, F0EEB7E01C8EC25D004AB676 /* procedural.leg in Resources */, F07DE9D81BD0F03900BAA1AD /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ F07DE9CB1BD0F03900BAA1AD /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( F057B38F204EEDD000E2A63F /* device_denoising.cpp in Sources */, F057B3AC204EEDD000E2A63F /* filter_sse2.cpp in Sources */, F057B3B0204EEDD000E2A63F /* kernel_avx.cpp in Sources */, F025C7DB1F33239000C52709 /* png_slices.c in Sources */, F037D5D31EA6069A00C96D10 /* plane.c in Sources */, F057B437204EEDD000E2A63F /* bake.cpp in Sources */, F0C5368B1F42EE43003A0DCA /* extrude.c in Sources */, F057B3AB204EEDD000E2A63F /* filter_avx2.cpp in Sources */, F037D5CF1EA6069A00C96D10 /* brush.c in Sources */, F0A160041E962F1300C6EF33 /* vxl.c in Sources */, F057B44E204EEDD000E2A63F /* tables.cpp in Sources */, F0A15FFC1E962F1300C6EF33 /* dicom.c in Sources */, F057B453204EEDD000E2A63F /* subd_patch_table.cpp in Sources */, F0A160031E962F1300C6EF33 /* voxlap.c in Sources */, F07DEA101BD0F31500BAA1AD /* system.c in Sources */, F057B43D204EEDD000E2A63F /* film.cpp in Sources */, F057B441204EEDD000E2A63F /* light.cpp in Sources */, F057B45D204EEDD000E2A63F /* util_debug.cpp in Sources */, F057B38C204EEDD000E2A63F /* device.cpp in Sources */, F057B3B2204EEDD000E2A63F /* kernel_split.cpp in Sources */, F0C4F1421F308976002E73C5 /* gui_settings.c in Sources */, F057B462204EEDD000E2A63F /* util_param.cpp in Sources */, F057B3A6204EEDD000E2A63F /* node_type.cpp in Sources */, F037D5D41EA6069A00C96D10 /* procedural.c in Sources */, F07DEA061BD0F31500BAA1AD /* image.c in Sources */, F057B444204EEDD000E2A63F /* mesh_subdivision.cpp in Sources */, F057B3B9204EEDD000E2A63F /* kernel_sse3.cpp in Sources */, F06C683C1D2EAECC00887FCE /* camera.c in Sources */, F057B38D204EEDD000E2A63F /* device_cpu.cpp in Sources */, F057B448204EEDD000E2A63F /* particles.cpp in Sources */, F057B3AA204EEDD000E2A63F /* filter_avx.cpp in Sources */, F037D5D11EA6069A00C96D10 /* laser.c in Sources */, F057B44B204EEDD000E2A63F /* shader.cpp in Sources */, F057B445204EEDD000E2A63F /* nodes.cpp in Sources */, F057B37A204EEDD000E2A63F /* bvh_sort.cpp in Sources */, F0A160081E962F4600C6EF33 /* marchingcube.c in Sources */, F057B44A204EEDD000E2A63F /* session.cpp in Sources */, F057B45F204EEDD000E2A63F /* util_logging.cpp in Sources */, F057B45E204EEDD000E2A63F /* util_guarded_allocator.cpp in Sources */, F057B465204EEDD000E2A63F /* util_sky_model.cpp in Sources */, F07DEA111BD0F31500BAA1AD /* texture.c in Sources */, F057B3B6204EEDD000E2A63F /* kernel_split_sse3.cpp in Sources */, F057B375204EEDD000E2A63F /* bvh2.cpp in Sources */, F0EEB7E41C8EC27C004AB676 /* action.c in Sources */, F037D5D61EA6069A00C96D10 /* shape.c in Sources */, F057B435204EEDD000E2A63F /* attribute.cpp in Sources */, F07DEA0A1BD0F31500BAA1AD /* model3d.c in Sources */, F057B3A5204EEDD000E2A63F /* node.cpp in Sources */, F0A160051E962F1300C6EF33 /* wavefront.c in Sources */, F057B3B4204EEDD000E2A63F /* kernel_split_avx2.cpp in Sources */, F057B440204EEDD000E2A63F /* integrator.cpp in Sources */, F057B378204EEDD000E2A63F /* bvh_build.cpp in Sources */, F057B43C204EEDD000E2A63F /* curves.cpp in Sources */, F057B3A9204EEDD000E2A63F /* filter.cpp in Sources */, F057B454204EEDD000E2A63F /* subd_split.cpp in Sources */, F07DEA0F1BD0F31500BAA1AD /* shape.c in Sources */, F0A160011E962F1300C6EF33 /* txt.c in Sources */, F01452C52070FC51007F0106 /* utils_gl.c in Sources */, F07DEA091BD0F31500BAA1AD /* mesh.c in Sources */, F0AE90F71C8EE01300C29080 /* assets.c in Sources */, F0D463BF1E4875CA004F1A37 /* stack.c in Sources */, F057B390204EEDD000E2A63F /* device_memory.cpp in Sources */, F057B43E204EEDD000E2A63F /* graph.cpp in Sources */, F0A15FFD1E962F1300C6EF33 /* png.c in Sources */, F057B44C204EEDD000E2A63F /* sobol.cpp in Sources */, F057B44D204EEDD000E2A63F /* svm.cpp in Sources */, F037D5D01EA6069A00C96D10 /* color_picker.c in Sources */, F057B46B204EEDD000E2A63F /* util_transform.cpp in Sources */, F057B461204EEDD000E2A63F /* util_md5.cpp in Sources */, F057B460204EEDD000E2A63F /* util_math_cdf.cpp in Sources */, F07DEA001BD0F31500BAA1AD /* color.c in Sources */, F0E71BAC1F1DA30D00D20C7C /* theme.c in Sources */, F057B45C204EEDD000E2A63F /* util_aligned_malloc.cpp in Sources */, F057B3B1204EEDD000E2A63F /* kernel_avx2.cpp in Sources */, F0A160091E962F4600C6EF33 /* mustache.c in Sources */, F057B442204EEDD000E2A63F /* mesh.cpp in Sources */, F057B4A8204EF13900E2A63F /* cycles.cpp in Sources */, F07DE9D31BD0F03900BAA1AD /* AppDelegate.swift in Sources */, F057B3AD204EEDD000E2A63F /* filter_sse3.cpp in Sources */, F057B451204EEDD000E2A63F /* subd_dice.cpp in Sources */, F0EEB7DE1C8EC25D004AB676 /* procedural.c in Sources */, F057B466204EEDD000E2A63F /* util_string.cpp in Sources */, F057B436204EEDD000E2A63F /* background.cpp in Sources */, F0DE97101E6FEA1F000354AF /* dialogs_osx.m in Sources */, F0A160021E962F1300C6EF33 /* vox.c in Sources */, F07DEA121BD0F31500BAA1AD /* tools.c in Sources */, F057B46D204EEDD000E2A63F /* util_windows.cpp in Sources */, F0ED3C641F98B03300FB50DE /* mesh_utils.c in Sources */, F057B463204EEDD000E2A63F /* util_path.cpp in Sources */, F057B43F204EEDD000E2A63F /* image.cpp in Sources */, F0ED3C651F98B03300FB50DE /* mesh_to_vertices.c in Sources */, F057B468204EEDD000E2A63F /* util_task.cpp in Sources */, F057B3BA204EEDD000E2A63F /* kernel_sse41.cpp in Sources */, F057B44F204EEDD000E2A63F /* tile.cpp in Sources */, F0158ECD1F17289B008893E6 /* sound.c in Sources */, F057B464204EEDD000E2A63F /* util_simd.cpp in Sources */, F057B376204EEDD000E2A63F /* bvh4.cpp in Sources */, F057B394204EEDD000E2A63F /* device_split_kernel.cpp in Sources */, F037D5C51EA6066300C96D10 /* vec.c in Sources */, F057B439204EEDD000E2A63F /* camera.cpp in Sources */, F057B438204EEDD000E2A63F /* buffers.cpp in Sources */, F037D5D51EA6069A00C96D10 /* selection.c in Sources */, F057B374204EEDD000E2A63F /* bvh.cpp in Sources */, F057B395204EEDD000E2A63F /* device_task.cpp in Sources */, F057B379204EEDD000E2A63F /* bvh_node.cpp in Sources */, F097B3F41F0C97DB00A3622B /* gesture3d.c in Sources */, F097B3F31F0C97DB00A3622B /* gesture.c in Sources */, F057B452204EEDD000E2A63F /* subd_patch.cpp in Sources */, F07DEA0B1BD0F31500BAA1AD /* palette.c in Sources */, F057B449204EEDD000E2A63F /* scene.cpp in Sources */, F057B467204EEDD000E2A63F /* util_system.cpp in Sources */, F057B3B3204EEDD000E2A63F /* kernel_split_avx.cpp in Sources */, F07DEA131BD0F31500BAA1AD /* utils.c in Sources */, F07DEA041BD0F31500BAA1AD /* goxel.c in Sources */, F057B3AE204EEDD000E2A63F /* filter_sse41.cpp in Sources */, F057B446204EEDD000E2A63F /* object.cpp in Sources */, F0A15FFF1E962F1300C6EF33 /* qubicle.c in Sources */, F057B3B5204EEDD000E2A63F /* kernel_split_sse2.cpp in Sources */, F057B3B7204EEDD000E2A63F /* kernel_split_sse41.cpp in Sources */, F057B43B204EEDD000E2A63F /* constant_fold.cpp in Sources */, F037D5D21EA6069A00C96D10 /* move.c in Sources */, F06C683D1D2EAECC00887FCE /* quantization.c in Sources */, F07DEA051BD0F31500BAA1AD /* gui.cpp in Sources */, F0E71BB01F1DA7A100D20C7C /* ini.c in Sources */, F057B46A204EEDD000E2A63F /* util_time.cpp in Sources */, F057B377204EEDD000E2A63F /* bvh_binning.cpp in Sources */, F057B469204EEDD000E2A63F /* util_thread.cpp in Sources */, F057B3B8204EEDD000E2A63F /* kernel_sse2.cpp in Sources */, F0F14C6720AF282E0006E575 /* imgui.cpp in Sources */, F0D463BD1E48759A004F1A37 /* cache.c in Sources */, F057B37B204EEDD000E2A63F /* bvh_split.cpp in Sources */, F07DEA0D1BD0F31500BAA1AD /* render.c in Sources */, F057B447204EEDD000E2A63F /* osl.cpp in Sources */, F057B37C204EEDD000E2A63F /* bvh_unaligned.cpp in Sources */, F057B3AF204EEDD000E2A63F /* kernel.cpp in Sources */, F037D5C31EA6061F00C96D10 /* gox.c in Sources */, F0A15FFE1E962F1300C6EF33 /* povray.c in Sources */, F057B443204EEDD000E2A63F /* mesh_displace.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ F07DE9D61BD0F03900BAA1AD /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( F07DE9D71BD0F03900BAA1AD /* Base */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ F07DE9DA1BD0F03900BAA1AD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; F07DE9DB1BD0F03900BAA1AD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; F07DE9DD1BD0F03900BAA1AD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/goxel/goxel.pch"; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../../src", "$(SRCROOT)/../../ext_src/cycles/src", ); INFOPLIST_FILE = goxel/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = com.noctuasoftware.goxel; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/goxel/goxel-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 3.0; }; name = Debug; }; F07DE9DE1BD0F03900BAA1AD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/goxel/goxel.pch"; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../../src", "$(SRCROOT)/../../ext_src/cycles/src", ); INFOPLIST_FILE = goxel/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = com.noctuasoftware.goxel; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/goxel/goxel-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 3.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ F07DE9CA1BD0F03900BAA1AD /* Build configuration list for PBXProject "goxel" */ = { isa = XCConfigurationList; buildConfigurations = ( F07DE9DA1BD0F03900BAA1AD /* Debug */, F07DE9DB1BD0F03900BAA1AD /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; F07DE9DC1BD0F03900BAA1AD /* Build configuration list for PBXNativeTarget "goxel" */ = { isa = XCConfigurationList; buildConfigurations = ( F07DE9DD1BD0F03900BAA1AD /* Debug */, F07DE9DE1BD0F03900BAA1AD /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = F07DE9C71BD0F03900BAA1AD /* Project object */; } goxel-0.8.1/osx/goxel/goxel.xcodeproj/project.xcworkspace/000077500000000000000000000000001334742672700237145ustar00rootroot00000000000000goxel-0.8.1/osx/goxel/goxel.xcodeproj/project.xcworkspace/contents.xcworkspacedata000066400000000000000000000002261334742672700306560ustar00rootroot00000000000000 goxel-0.8.1/osx/goxel/goxel/000077500000000000000000000000001334742672700157225ustar00rootroot00000000000000goxel-0.8.1/osx/goxel/goxel/AppDelegate.swift000066400000000000000000000160531334742672700211600ustar00rootroot00000000000000// // AppDelegate.swift // goxel // // Created by Guillaume Chereau on 10/16/15. // Copyright © 2015 Noctua Software Limited. All rights reserved. // import Cocoa import OpenGL import GLKit import AppKit import Foundation class GoxNSOpenGLView: NSOpenGLView { override func awakeFromNib() { let attr = [ NSOpenGLPixelFormatAttribute(NSOpenGLPFAOpenGLProfile), NSOpenGLPixelFormatAttribute(NSOpenGLProfileVersionLegacy), NSOpenGLPixelFormatAttribute(NSOpenGLPFAColorSize), 24, NSOpenGLPixelFormatAttribute(NSOpenGLPFAAlphaSize), 8, NSOpenGLPixelFormatAttribute(NSOpenGLPFADoubleBuffer), NSOpenGLPixelFormatAttribute(NSOpenGLPFADepthSize), 32, NSOpenGLPixelFormatAttribute(NSOpenGLPFAStencilSize), 8, 0 ] let format = NSOpenGLPixelFormat(attributes: attr) let context = NSOpenGLContext(format: format!, share: nil) self.openGLContext = context self.openGLContext?.makeCurrentContext() self.window?.acceptsMouseMovedEvents = true } func appDelegate () -> AppDelegate { return NSApplication.shared().delegate as! AppDelegate } override var acceptsFirstResponder: Bool { return true } func mouseEvent(_ id: Int, _ state: Int, _ event: NSEvent) { appDelegate().inputs.touches.0.pos.0 = Float(event.locationInWindow.x); appDelegate().inputs.touches.0.pos.1 = Float(self.frame.height - event.locationInWindow.y); // XXX: find a way to make it work with unsage memory. switch (id) { case 0: appDelegate().inputs.touches.0.down.0 = (state != 0); case 1: appDelegate().inputs.touches.0.down.1 = (state != 0); case 2: appDelegate().inputs.touches.0.down.2 = (state != 0); default: break; } // Force an update after a mousedown event to make sure that it will // be recognised even if we release the mouse immediately. if state == 1 { goxel_iter(&appDelegate().inputs) } } override func mouseDown(with event: NSEvent) { mouseEvent(0, 1, event) } override func mouseUp(with event: NSEvent) { mouseEvent(0, 0, event) } override func mouseDragged(with event: NSEvent) { mouseEvent(0, 2, event) } override func mouseMoved(with event: NSEvent) { mouseEvent(0, 0, event) } override func rightMouseDown(with event: NSEvent) { mouseEvent(2, 1, event) } override func rightMouseUp(with event: NSEvent) { mouseEvent(2, 0, event) } override func rightMouseDragged(with event: NSEvent) { mouseEvent(2, 1, event) } override func otherMouseDown(with event: NSEvent) { mouseEvent(1, 1, event) } override func otherMouseUp(with event: NSEvent) { mouseEvent(1, 0, event) } override func otherMouseDragged(with event: NSEvent) { mouseEvent(1, 1, event) } override func scrollWheel(with event: NSEvent) { appDelegate().inputs.mouse_wheel = Float(event.scrollingDeltaY) } override func keyDown(with event: NSEvent) { switch (event.keyCode) { case 36: appDelegate().inputs.keys.257 = true case 49: appDelegate().inputs.keys.32 = true case 51: appDelegate().inputs.keys.259 = true case 123: appDelegate().inputs.keys.263 = true case 124: appDelegate().inputs.keys.262 = true case 125: appDelegate().inputs.keys.264 = true case 126: appDelegate().inputs.keys.265 = true default: break } let scalars = event.characters!.unicodeScalars let c = scalars[scalars.startIndex].value if (c < 256) { appDelegate().inputs.chars.0 = c } } override func keyUp(with event: NSEvent) { switch (event.keyCode) { case 36: appDelegate().inputs.keys.257 = false case 49: appDelegate().inputs.keys.32 = false case 51: appDelegate().inputs.keys.259 = false case 123: appDelegate().inputs.keys.263 = false case 124: appDelegate().inputs.keys.262 = false case 125: appDelegate().inputs.keys.264 = false case 126: appDelegate().inputs.keys.265 = false default: break } } override func flagsChanged(with event: NSEvent) { appDelegate().inputs.keys.340 = event.modifierFlags.contains(.shift) appDelegate().inputs.keys.341 = event.modifierFlags.contains(.control) } } @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow! @IBOutlet weak var view: GoxNSOpenGLView! fileprivate var timer: Timer! open var inputs = inputs_t() var userDirectory: [CChar]? = nil; func applicationDidFinishLaunching(_ aNotification: Notification) { // Set fullscreen. if let screen = NSScreen.main() { window.setFrame(screen.visibleFrame, display: true, animate: true) } timer = Timer(timeInterval: 1.0 / 60.0, target: self, selector: #selector(AppDelegate.onTimer(_:)), userInfo: nil, repeats: true) RunLoop.current.add(timer, forMode: RunLoopMode.defaultRunLoopMode) sys_callbacks.user = Unmanaged.passUnretained(self).toOpaque() sys_callbacks.set_window_title = { (user, title) in let mySelf = Unmanaged.fromOpaque(user!).takeUnretainedValue() let title = String(cString: title!) mySelf.window.title = title } sys_callbacks.get_user_dir = { (user) in let mySelf = Unmanaged.fromOpaque(user!).takeUnretainedValue() if mySelf.userDirectory == nil { let paths = NSSearchPathForDirectoriesInDomains( .applicationSupportDirectory, .userDomainMask, true) if paths.count > 0 { mySelf.userDirectory = paths[0].cString(using: .utf8) } } return UnsafePointer(mySelf.userDirectory) } goxel_init() } func applicationWillTerminate(_ aNotification: Notification) { // Insert code here to tear down your application } func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } @objc func onTimer(_ sender: Timer!) { var r : Int32 if (!window.isVisible) { return } glClear(GLbitfield(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)) self.inputs.window_size = (Int32(self.view.frame.size.width), Int32(self.view.frame.size.height)) self.inputs.scale = 1.0 // XXX: add support for retina screen! r = goxel_iter(&self.inputs) goxel_render() self.inputs.mouse_wheel = 0 self.inputs.chars.0 = 0 glFlush() view.openGLContext?.flushBuffer() if r == 1 { NSApplication.shared().terminate(nil) } } } goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/000077500000000000000000000000001334742672700210205ustar00rootroot00000000000000goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/000077500000000000000000000000001334742672700245155ustar00rootroot00000000000000goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/1024.png000066400000000000000000003560271334742672700256260ustar00rootroot00000000000000PNG  IHDR+IDATxdu'}97M92$P$ ()2S^]RrqRh.J{mpQ" X&jBM 6pGq뻛7X@DD4' ""b>מ_]SAR2* m aF7tԀؼ?bU`h eRBBX k l@G0Z ""# M4_T5 ZXa@ DDDS_o_?*)*h.1@DD4~߅i}Ь/ "" U ߼.d{aUc~W~og?m1]seuA(a R7zUDDDS"Z=>u<(;kWG\tͰl_ XO׷QE1@DTA/}˯8E>+l" .}|gC1 DDrϿ_ZS7zS @<]hf_47n~EK5YǜUDDDSgDDz ~NE/3Ylա[0Q 4=\W׮"Uª""R "9s/ܫ_Z~[x7!%}5D~_p5Lă?\?Z{x'̾V 2A&Y !fUTZ=g_ɳ/^A/?Kߪ55 r:Z0:lvk; /CwUqrρf{aUQuMߙ 8^{_ZӬ/o˾I0@g{@Vyx.!`?۪¤ZUDDD1gDDe{k'2p g}y{x54M]?֓q LaֿVUeUK'2Mڳ.Yk]@ -٪[o*}>{%3UDDD5gDDz /+>[Ozux?i55} 5|pMSY:W}̗UQX@DD4JwAD4F/}˯8*6}ڳ~iM R'S@ߩwm&= OgYQaULh\k'Ͻx17ڭY^⦁&?= 4 (A^k¯%|G cUѾlhοמ藺,f‚K'#iW׮.Y;#0 ""Jz Ͼŵg_L溗/fm6%D0"5`&_\4 dֿX@DD4 (&o2P&o4 ,t}Z6p{_QIO'V3">y˟ʺ j=F[ky-]l?XۼL4 ,f Vuij">/~/ʠ)k*)k7j*Ui n[4^xßqsYcUQVX=?uP2e{pui`W@y?Xۼ5ϽמdcU>ۯ8E^7nI0UMM~{O*b6 Rhf̅+WT 2f|㬿| %Yl6 LTi}\G%=Tm 6ηkh}[ T g/DD/<__;yn{cJZBJ~4Q͒bU¡B U:?KT g1DDd3sݙq53= jMTpC|_U``IaвԒUDD4x&CDsm}k'ϾxQxWϛo6 l_l%[t<,y |ﶮ@U[U\h*WsR2=nt|OE/T[4-?Xۼ6 _[WR5s?FUDD4 xCD3k^|Υ|+.i@ktazQ5w>J"00vFlY^X@DDUų^"9gG~}Ĺ/ 8|0/nM訁C4n}~Yy jD.5u_20 2K窀̄ V었fW>ڳ~5xSnҿo [o!lnpA}A}Ox$3~P'D#7~Z婢&L`U(L'~ofg8=>k?-谁k5 j +Pe`U'z-l2s{tt8 RpοZcU τh =/ R*YR~oaay 4waQka!T`eU}C#X>vJfqV Di*k%*@ yUDD_<&z Ͼŵg_(?/SϬ{͛oVGк&V#XX-#-BTBS Dacc~{ 1FĪ""TJɟM|j]ͿEkoF &.ZhlOm,@57ҏX:zoXI-Q{*`b)  ̘/KO~!'8oVt[ؼxoto)wp{ԗ]?c{dBfB X8Ï!/mqn`ULsֿVA2M>OE e R)_ƭ2ǹNY?Ek!_[$:CAAsn.PqU$skX<|7 4AhTxLDz /+nVsܥɬ ݟ&{ϊ&_ jAv{TfqsIU@} AP[,%5dѩxq*WǪ""jóe"W3?5m /Иw=L&g&>]5 : ,:F FcKŪ""Ϛo [L~kֿ{& }?.~c`aJwp{ [\5@8C'|ŶX0Yj7J "A̙*/\x/G~Tɟ_xY^(~ul߻f8 ۾`@@ (Vd>L@SRQ`ֿW4η%DTI?.;:jD 1 [?j`L/dLZn3pjzW0B0J/|40K+,`8 "N sYq ɶ{a_MUW d; lK\3~?n"`@" 39@Jd,t*4 ,6tAy6ύFUDDMsrMn/,/XPM{۝;d-^i@:Da @~@.h' [n/Empm{<'VM'_37/-c'oCc^?WT%>.nSi}{@:F- hKX o(0MY?Uk_*hF0@Dc_ד&*HK,>p{dusQktp _;x]=> d?U ! Ƞ 򊀴 bd ^[ۼ&D46'|«-B-q{u>@s~xџ+v6w<oHG 06JX`WD4~w_?e{-=4w j&\Ϛ,6V `T5 +2Ȍ7OfwU@ X@D4} u.s{㬿>j&-@sg#KӅAJ9> M# H[P%4V+o:*h0@D'k'~Ru~9~m4!nؿ^Y&ni_%Ƞw ]D #G:9 [jKR,Lz'T M'V͎ɟyyc{>kJ~wOK5hm;?@P \c⯋  [ 0UU[0J0*1JY"V3p"Jq_(UgG֣nk?j {W?ٿn_k $Htdb\+6 (A6= "N? '~~7\¿Yn'\Ya6{, reIz`_hI@*Ꙧdr@x|Ry'?_ ";'J9 S/]t?no"llA{~;'(7ݎ%ؾc>EȠV@TqMN(6 Ou \e@~r@ćdt {m 訉W~'__۾.h6ʉh">ki--ϚyЖ ln#llegJ3lҡ3IUM B7 M*HؾQ]E0a"13s":pǟ|G?]7Yne{@Z[aK()9g`@r_00: )o>I`@QL v7^- "?C'z~O?Y|sbVgQsas; <:J), ^&-G@*ߖTqL0H@f)K = 5]UDDf҉h('|«uҬ "Clfe{@׬n!jq ,.qVO , ~^@||Tdnd[@16=(ko&tzX@DtxND=}S/_TIn?Yny{@׬kQs'+dhl" NIBɱG ,T^hm*hxND=x=5m"ݲnCY&Yg@c {@I0L? mf\0@=Q4 ש "QOp=O\y4e?E!k\B!P[p]e% 2~e r#ʀqwL?Bpùm ̯~JŪ"ów"IAvᯐcߪ=kQc.]3Y\ *c2xRivȦ4-F/Q5Y/JUT+7?)d} d7a Y~2{W 0VUX+aC'1j!K%H7~ ='~h?o*LQhoޏkq![1+Vg2`@ (+nxrIe; lmaM-iȪr%`Uh ?[wB֟ qPAo70:BJ;g%MUֺ@XVUdˀ aLV7FF5@fםG R+KZ Y@D4>!n>kzOn{r{@Ϭk2MtZotX]OKKCV3#d'RЩWf"Wcr X@D?V͙Opz\Acֿ2TP +ý>LX w=Ɨ^=נ!JDaB X+F҉*ȸ"@E0: $o`U@M "ȫO>6ew1x{@i&o†e|38Kz4$WUHjȼ(d ure¡X\9 *XWhfGK"r<'ahOtQ{O][0&t\U?=M_ӥ@~+Y.m|} }fP_>EĀҪ? Bi/}r@5L4UDD Y}7^{sM)?/ϬLfk[w&r0o:W٘^]/ 0&72R I X+Z 0Ŋl@VôUDD 9q^ſ[,')" 5a¦ψäÿk3W4X G[PT@*Dr iⶀUWFf XQeJŪ"7 !}7^{sM_?G͢b`ꐲ!lnrL 0#ٲk}?{_R"bM+qBBHh*UH`qQq G hnl?VPUVьi 8 S/%LK]VK~r{ؾg6D@saWkIϦˤm\گ[rb-ч5䓪+ vA* ;B4FVh +N(rQh >+] ) /\Ԓf>ϗl/tVw3 x_nzm =ZhnP*d{UGf\_}m@"-L>e4UD4+X@4^}/]tA#%EguZC_0">]4J9 )6 V@YYaKi`%ӹ* dUMMOp޺ \[2ZfgOY8+%{hwWw@hn \f@*2t@}yuDe'M-~1X"F ~w_?Uم ͌?,;f3-E_^?v}#!*E@@H X>Y "`_` _oVDto5i?7S,Iݲ6]$Nod]`9 Lb٨(!Df+*TۜJ]h.2U , j`QE /dI/=e%Y9.u.ҭI #~@ a d$ P*X)!M4 | |fX?9UUDT)\9U j~ 7EsW` LJ*v\ɧ~W,dzg+d!_^ Vҳ¿KU(Sǖ h#8UWJX@T!iR|?Hb`2P?H_ n5-/i9I)a` |)NƪQՔW.hxAT_k}KkC`YGf0Yu}2iՊUX k;Tԗ)okDea*FP_B$OdI40~ %uOQ,>U4hX@4agg~g]w)$͖O9WqE Mu~rIpfJ X+)! l:U%,^ I"zS_~Ĺ/JUTe/>åf{;eMfig?Wq򩗠K#H8T$$ ϓ_sg0-C*_`a%6XocX?{6o/Y@DcWePK$*HO\ nD-Ƞ@7I{gBbH﷾Wq~)H=ƯIdl^jQ ?MZU:1405r\ 4P.P cǴ%%U %aU4tm:l@՗K|4~A"1Y=?uI4}nS*Ƞ@@T_*, 0T$V6 H )\N_%gd-"o"x0MY?ߞ@*BȨ,@`YBDa耭y³^T"K hTRq{@%OlrT!ihD"@A_P4-¬UƶDqt@kw%skT &j!ln+f/ |g_ҚRnH~;N2PP 8YFO$0YڿQ;@'AiMcMF٪]R` `* #5l2'}LӒlQcIGژ,)7ӡoW3?e$z JjiQ*e %Fs*;y$+`-vFG0oOxh0@4b_kϽ5?KMֿ 46+]lߌ+? ւZG3Qڨi`,C@URBVi8PMq`@KW15X@ [Z{[hlߛ1ahDV<WvMƐ&'0L?Y; jt?j(irc@7J0җkd*2%p/06ZZ{x F3XDDch^ԗ_?qE__dXā O 5KN'H].I@. !sMQ>@quD݉>^|FGn۶16vƍ="6 /YAR e5d00~?]yYtW]^CJ@ " Rd=QT-J:4u'&j1&D?ҧLOB"wU)?O.Du_G0ҦB] H+/Tm1n{'̢ncB [ϑUY| y˟z\/e W !*}1Dֿg e; {O@yC4v6 8 |tr@>F RՈ70:Dځ:4uJ*^o~܋Ar Bw`ZO'tgɩk"Aԥi`&0Plj} HW`@{@`T6 Y?O{FHvD+hp +W&qw> Yd_fn;~d}Ue]郛;ݛJҦ~At[zzs}Lac {` bȯ< ~qy 'j>۳YڟɾH/㬮5>({&YdfG Rtgt ac=쿆/KXv{76GBDPOK3r&O6f{PITKVh5{6?wi?e 5GɸbB&5 ih2$˪}ğZ6Ѱ:?=~5ܿ0h1@sO}_\/Zϩ-o Y43VMekqI]4V~87lLk-P% mԀL@F׈SR=]>ߤ|-ܽx8D4_Y+Oy/0PHUݲȔQ>K!/Q;]žI5 [l rVCGko6B@1׈j3nD4h.~/Rn_%|4$T>m'jmY3??#s[?]"?h2:ZRB $`u2F08}ğh>|#F=hx \Y=?u)U&|%a}fa}&Ύ|g椙OU`h@|?6⊣2fGιl j @8i`m'9k_@s>m t FU ?`4V<ُډs/^T!kʕCÓ4>Y?dUct =˛M/>~M^Q:j@.,&Q#Uܾ(ldYk +h?wϿ_ZSh?; 3l7 Wt$oMYu\U Pyv8=O}~J DnK@l>Q4 &6!T} Vi@bi?a<O+.i=GӴŷ5J' {+ j"j@j 2L. 0KM{ V3{v=_vLDcM3_x3kq?3#hOngƣ*y:o|8 {hv `u UQ[<aLi(A_>=FE]=LD[`@"4^_?qŋRϬOs O4u{w8zn҇BT~~o @5 #wj!%4 LIvzݼ m~FP@o"4V<~e=.2pd݂1i]*[˲: 0? l[> NV)\Te\8nM6hTxBԖq5(`n\׽?jQk7l!IJ8&"4u^o~܋YƁde qF*srfuHGn_5wƓq9eعE;'N>< [wMfk _gwӪ&[ ZԖt*8-q`=FE]n\}쿵xѰqϿ_ZSq?$ >!T:g3[fZ~H܍9Ǖb'4rw½?z77ç|1p->ʨrnZv{Apodұ\@l{uؾνtcE闥?A "a1@z ~Ns{P.+43$g?5~6?ؽDcn׹w'çp}G{^8x6 {H3S:l`/ U[ Q_>*̹k (|I5oUDXc~mxGuzhp MDDJ;_{/pA&gou cBX !IQfhfAƝ7q獡M\yO|43谑'~_ewi5|ԺՀns +PE`m30"j9p_o`$1Z+wNuMnu?.緆7"s P%y³~q/FtYW/3\ϜYϗBMfgwN6oau8mn ܽ78yE_?'gfLBYf@c.n}=^^,>G)N \َߴ]Z  damwr NJ40`Ɓq@8}2vfa2{mD Pey˟uH*i~3sW֯FLeBr3x/ع3ݺo!<#g/~$eߟf곣k =4"/aI%Xi2=SB~#ۺ d+ Xq|]nbd"_ P%/~\\_d~ϲ tW#r{2C1۹EO@v`^FM,9}!}q{}a!~;]l3w$nؤa!z#_|vMՖj!% @75c’ԞaL0\ƃ>\kܹ׾"0 O}?U81i)v7oCX>zCAM-ϙݍݼQgKWGM&0WW iDDA}CP%쿏nUSY}Las+5j`;m>W \k=G~ p>;Fv[CzË7:{HؤW@|=ͽ`~`R jII7n8ݶX@D#UR& k2p|nv{g `o{@ELۓ>yx _{#xܫCR' U~x%[-l=i'@Mn\΃+-- 9Z->ۿWT`O"o e$.PV*ƋA+KTuIUD˹?Lno-ooѳʱ'p _S |RYqfnSd/ Q[< t:Bkoo 5at$ Aa;YIV~7X?aDM1hව m/rcUG5s0M# }ESL{@n_pX9$;*{r҇DUq௃I4 >ݞ}cn p?mbUGm#X& 'zsvP"aWs݅ngLL+4 U=4Q.sj<7^jVdtko{:{ͫ%V>CGc>:#kmye~u.(v% [O節F`-VV!U&o XWPjE눒o}a҃3o#!!2,a-u!HJ kc[8?'gw:jrΖAT{۷pJwy;Wq7Wqy|̆I>Fs݊-|gc4 ;2cq5p<[KWсNr60M;hƿ|7Bhk&@&!%#M?@{ ǥ[_GM6\7+ \'ͪko[m_ֿg[*8tl}h* o- 3@X!Q_:ұ$j ʉX<Z{h܇Z}y?hF\_DDbem Јw쟙@Vt R 5@(XY peΆL(ۅ`w΄%M`wo4l^Ͼѳ8$N*ib/J}ᅝs&%GQ[8yFPCG 4w0^"cw/}gmND6k !4`@ڬE- TP|@[>5F{ֿ΃̬*^N'R\τ{77?ØJ;W n]Oxp:mZwץ?≆E-T5 Bt5nPat :jDM,n}QÒ{Q/" hIp_d,`" !T#eM 0qE?D=oܹ;bߞlݺ{7+?.Gܺp8/jq{_Q@{_gjK"V=*5DX@Z haF0tDP_;QU}I,Fl5gZ A!E pe-@&;-Q XMڽýV3.lo^б.>SEw>.x1%Y)|!Tot 5uUZ` MWŶ`2_C~Ε]hD{SкiT,4kjPd`22DCYi=DxضO;c?M?7؝F޼?8/S!сԾvz?wґҒ@7,.yT55@GzBE!L PvsQcۍ(ޗm}W3^ҾŘ5nQ j6vԖKQfעYp4i ֚$3(*vnOl҇1n_s8zn҇D2~+n(: jrY˿/DR)`e 2cEDW@P_^: Unox}^ݼ> +w;<[8aLC_fj@@}L?89 ;뿉fɢ?=*smߜa̽%ġs8q@gI_ߎ`ay2g-\a hHU5+ j`J`Z :ߋi _a¶ܗ}w/~WdN.jPRQ,p^'m"j%Pߛ4vnr_1w_SO}kFxA.xVgwRIŕJIX^i`e`.,OK7.mM n4Z~ 컂0SѸ{;kh^0@c7o㿹pU˻9Q5S{[h=D}jKG`Cx;͝~o6PEx}nĕIv㝿wmxԨEэ+6~o||$#!4n>B: B(4 tI&LԀZc2FC 6$Qb&"'لsy!J"&  !ߑZM6P[:QHa`e?t^"jsQs7gI#nrTs1ǐ4c#?pS8ONf=.q-gU_B}GKR %( i" "Z & -Tꨙoߎ Bb" h2؇Y:9L5rko `c!7l(TTIc. ?tO35?vnp?izlo\%ll-da}\xG2yf߸G *H[U}E@Ssa 06jZ{iyݚC$M-Y'<k` kE2^G nހ-bay*XHGtP]4v"j%,?IgP8hwwGŭʡ3x'&}Pi _nŲ~Pj1X!F|"6;*< D4" Dظ NdtH#6s< i<awcVVEXOI6dA=3N Acwd /$28juܽnT;׈5oc1gEm^~BXX>:Rl(?7uPT&;u RJ ]oMaєc&́s#}_qL@Wu(9E]"#M?ɎYmmAΔ&9'b̹z7p?a)xM!Ư8~6 --Uj8cj4DP&Wr:jbo6סV:h돞ўl R>jx+.tkX/zZrxk?ƁImGxd2BJS`'t[k}q?L! McWޭ'㺻_9G-o@ZF0z*atS[UX<({7~~̭D4h"M躢܏0X k#+Ɓ̹Kc[xQe+ ғ1? ,-O2ľףmr\6^cvLStdǙi oN棝 ~"ؚR\`}<5= `c՗_CU&/8YoY k /*o ܽ-Fs[OޟOX>?Ҧ R|R/B(nz/~MGMxaMdlq?AmFm 0QIo-Z-WЖq߁?cL5 C>d֟JkvOp{@%6b Bmay.FKvѐ  0:t?A+_{O=Q4!6`G0.NX5bi,;+ TAvk!6o7Šss>@2ZCQQ;[wB ;װ}-@s2X-݈q)6 V']e@ #O|XplHDY|k6/C\g`):~?2?|\۸@rq}&c\o'>n>Yg @|?ox# *73ITdOĿ: ߗ,G2q\|L%]?9Fty]zݺΆAHuH^kil-''{}[\{k㱙[9 Pdq\ s0C!&2_>Oo#$wyv rⱖO8܇:V7Z;?C{0sP̲~g 2%e#r+4*>!#j7A@Gͤ2m 6 ${ ,ی:퟽N_x3Q8֦-';be>OZ92h kCkw7~qv?~E,l]p҇1-nԤ+/A)XQ*4#*rο56XV##uWA!r+l=pf=3VUwlbgCrUe,˞eƈ#8t,j}TFBlx͝~Gn_>3,߹/K*ʮSw`$\Vx?V@`@wßf \>dzo^;ח-|@|_W+PPEߟ#*#=?wEnQ4h]&2-[gG@@@ܝd`-jK| T}Gy-Dank@6k}|b>].@jg:^vn=Pz Cժ([xb wC mtZ'U *Xh'$ 8 P1\}u-n u@'n^V& '2[p{HY|EMn͝ e,b;۰05&mp|N'gZUP;,?h.f%pp:} Br40["E iz<Ozck|Ł/b_'\Hk>2cOΤ_q *V OF7U(V*H(OTm& -/n?vo5 hb_?zq31D w1{p#l.k 'ԖXԗ -aa8]I@R_6*ph'\wOH|duOLEU@qQGx[R#*@A)c4&M?f@M_W/w~W(|}S wla^A-‘OgWWpY,~ Xg.ܻ_ǭ2Z0rRq:7[7 Tlac҇0jP?n'S+޲!n{P \a{<?^ڥ͛o*h1@m7~ҞnMeGΣ|̕ZAw[`G;8t\f? [O^F7Ge Ѿ~{^zDndmJ[A#f`!@J hX]wJ`jMh_ k@a& G L_˒;%7pW^+ȣhd˴0*u78-hMD0bl~4oft0Ӹ= oQR8oM65H:^  u ք8ԇ/Uh0@Q$VFЉQ_>-q1E匮 Pt؄-baZy@Ԯק{:ج?ѤkwTBR\ֿ눿43 aav[t57:X:MuOO:,\~x{>aGUh <+/V_%%Umڍ1t DP_q4wNMfw=8ޏ&i1d:Ą irTs%sFi!$4 AՖj [>R"4A.kO)JW̓a_-: 3Lg[ MTO>U7YpM|jM(?5@M=?M[*lt:پk g]#HID@5)e)6wݘAѰH8x?u!T} A}H椫XjٻB2Q5XDuU BhBP[S>po#a$0? foC'!Ncw=Xk4C,~̮Ƅ0t(l=@Db&Eb2!v/][:ŕ]w{,ԑST!Tch56ܾ3(pDЭ%0Zwq0@H[aA6ɿоL!Xl?Уٟ UXkkq}}MMGUӾvWR /CmPx=Azt@s >AFClEP y;d֟Fm~l; V?1~ e~77J3ɂ?^GV yGCg"h?_{'oaLmP[0sg RCc-ӭ_%?(L>@F'f7 h$5&oMnæL^ADӈx|_SH2(_JUGmj YdN&m T!^ZI*:|peJ렪h=fB"/3Bi 8ͼf+.&Qrt%`aD4mrf2!,,K,iֿPbY7RRi:d08p! Gr.YO@nRA+l`]?l$d;U x}yTbR%~ w]wn#h{sl1UT6m}-Gxw U aV|SR)avֿ!-B՚PE jnFHOFB\ֿ߿?5_d4}.;iR%4Ph`?U%u0 ݌n{,, ` e ;σ|?y_I5w/}kmlF({B7ռD|?OP_A}hDRųGJ#M RE0AJ/@Zj.6j<($nrR' ߫Z4_VJ=>e@_T_CjYUj ?F'\{nܧR>Ϻ*)f&w=\ɿN$p`-֘ 4q FGv`쇅 .2@}0_\_(@Noֿ+?BPH 4u &Tm#Э]DnǛYe5_0: w-踰Q|#QhꗎeM\}ߤmR& PʋZT3@7u'8~Ho.?W F0H7V̈߸r]fdM'Dݿ `ě~b>/x8ɲbֿA݂[\ u7B0r:lBGM6vK0ZD?@N]yTu(|Ŧ~~U0J[m 9ܐI0&tv_óAhop㝯;8tN?}W 63guTptğI%t@|FDӈW؁W 2]Rֿ:?B0aZ *l2&† %e"S&B˜ČF6(KW% 3{wqww.$ Jh4޸|C9z7fYkB[)ӵ_?\[rIDT=<㤉&i=Kr?;!k/Ygw!HC !&jbot F{/'#;/U%663J*C>!U9`K޸N=qN]X $gd_e;)s5Q?ny6[x@ *`R/a% &;BM!Ï{[|U@jL4Ђx'vns>P6pnS[>¶2Ft+8t,N= >v/爿\)[jȚ艳Q 퉦4qI}FUH뒲N-~)<>BPeF!UG.BךX<>ؾ tO=[@ܽM77/%eE<)װ}60@%ē1}A޸_}߿爿1 ?ާ\_}l+g3DS P[AHAnz 0"x谉tm^ -h*ӸoР@c.n^凐dQدJ $4hMg`xϥ70o5~o"/TI Zn\_!!Mk6tVo%ʪ,L?^Ÿp/ʏt  at*XpkM?<>wOuK q m}w6ﶁ?1G:{qTX9$]Pz#ƅƠg?žnԟX`}>"h?_p!,@eVVkVt!( F#WxGN@ݟ@J7.ӲlMXr]!UtL8?Ƒό|8d00B]|]u jnQ0@#{*jB.돸2cQ>BOZ>~`'\Eퟠ}v![Wl ؤ2ےɉ߁< 4C` r+GsǑO舿q=`?:BƄIuV CDӉt?}@ʏcֿG~k15ؠ-Tg>5uw~6@kfNx-m*ⶁ ?m ~w{TҟŷҕO~> Jc߸$NRO2F.FG[/e%/ 1IM/2 A=i'ſ6cRUc$##W "ւjKX>r {oaO{8}7?y7tߦr%\GоT/cg_ũ?1 ~kLٿo a@)M^:ϝ?:]EgϮ0_Ym##L'@I@U[ґSۺ=l߿4}ӏ 6aL \f!η 2S| _=t? t6/&*޿yk#"h_z.Y.~X2Y4¬GBB ?BW U- y<_7+?V :mc7L*|F(eCu*sO?j7.PP+|5f=&rdTSuh1@wGGJ(3?m#M 6èV:B0ZǖpYl߿\xxm<|Ӄ=1W t#P_3[_>44l=f!t5{}Ͼ7s=c?O ]} ʪ28tU7!BB_\1?F ##+@AFסE"֖pSؾw ܻDY%ܗ`0K>55C ]M|[  `ȉg Х_ޚ⿕4Ԕ/‰S~@†Ɗ `J)}%fgGF`-„Mރ'ݟ`omUȫr() 2qmsݦBV30o\b{@f?_we⑃6$v PEC]ܿcI%AS5wꐾOǟG nt'2{Fh@ 0@W`w3VQ\ V>g?73=k?ض&L~/-[wY1@`s!zT<ޯE 6B2!Xu е[+ 'i|- >t`-,|fB3_oָ$ B`xɼ<f~8qe3xFFrD4 P5Xw줫CRU<3#@j7B0j mepulo\kߚCmF#=a^B3xbA|;3/Y2O3?ӱM_?z߭.H Ӊ;UTnLc VGV҆p>> =ܾƸm 7s |0C'D_zLM0X:t1X#'^0U߿l<}ʞ M=_ϼzZRk"D]jF?!dkM<~";*n_\_&}CnpeQ9ݾOmԻ@uX({Wx!Pq5:Xã'?cV][~0DdAx[uw/}zUT 6PT[?YEoPBRAOZPL5qE6]F@jN~_G6s~FDӋ/L?{RŬ?uw& `u0A*X8V{[ߩ(Nf0GG c5~Fk#X){ ;|?|NIld*>'Vnğ1>z"kQ\?MNz;TqTw ȔQʕqSU!Y L+k0* P:Z8p3Q/s& m@ !q۷$DDzdEb=k_ ʃc5{[k8<"ƿ|7ׄ :Z |%!SlQQ0*#!E>n]^@@&KQ`2>N;]X 5JNHAMa#Эٟ+ok۾u @BAknݲacc"*c*Sp| ÐHhz{Fnߠ%B* AnծO L;QܾWS;Bp?rud@2P-KPmUȷj,b~#@~(SoBXs ?yE4F<]LT E $O ʰ.@߈GZ Pu݂ Bt]訉}H3]:{k4t_ -o|˿Mz~Krߜ=~t-7&J2@}UtW2n\_ࠉJ ’Dλp֑ DtחlwֿARi]s%B' 0p;=#G}>~HN]7ɼktSՀprZã'~Lj?.A~{ڗGZose,_l4e{H1鰁_ Yi\Ƹ Ԁљ@tQyct\͜If dr@vGրc5غ7.oOT%Wr2RkYxR.q.LfgY08$@k3qoW4⿼`^3mKm:g@G%iU,hl i_FZAD ̘q4tr@!hBWѳo'|lr@}S⪀k}fGQG{d8v%T@9>*EY\E&SoB UBajcEVHH@>p aL%5b8!ܶx NZν[jF/4@_l|Ɲ Qo|ݫ10OTptJ&>RB7`u ]uY Lʖ ?B@RE0V!5+0B0y-k-DP@h Pyx@ ppZU?g]a[?n!&jvqX񆩴 kAq KՐFCGd$| &`@ن T^H#Pzg (;Ö kۯmW ]OF& kGQgwf;~C訕vΑr"m:,Xѭ ,٢iu4MT Iy|H8⯓F*7 ߟ@@%Bֿ2#CLcu]ܹ͡sOXO> 0,j?*o[~ocӉӍnthpw/.mKBDGODӃ w҅;6> .+] @@TFj᥃0YB;y I]ܾM>axT}WE} g˂,6 MGQWŒ7V&%. :]#2)`eAVNU\hV0@m0O&(`@6`})3 tK}xL`vka*5ִF0qu}ߘ0?Y~a_k :g׹ yƲ a!p@@@v{J̟I `@$`Z+L@Fܕ ;BFAR`T\cg_ߘ4pj2-^h5 ?{B%eu/J褏P@@i~Oa7&'UƯԗjifF~& {=|l06;>0: >4F-i䟏FGI)t&t؄}鯰ya`؍oӖ}v^Dktʔ͚eo; HA}Ê"?Y' 2_t /W ܖIA>Eɗ˳c.fC%3܈ Y#߿ąf_/NKm/|+ @eE撀 fF6} ~o~/ \WmQ,]'?5Zf~@~1?xrOA*7wZz5@GMwmoS49j8z*m7:ϳӿ wm /eSa;@DHضM+:]A:X@@Iր{#[-e:`D6;]G!E7Kl\#Nq_xc`L5+ 40M)oy]fq?.UX˜-NYSdt LУGE5IuKZф0@o|3ko! %U@ u  րG`CRԀ:^X=8rY訉?:nW~SG>:p ۧ &c#~ ȏkf˚E*׼li@Je[__ /_ HBzn>nm@\ƨlh`"w@!aU*7=@μ?~On|:w/]g{dE~|㯯^tDZrʗgGm%ѪVܖBlz(&,mqC+9:(f2n돿^L~0G@^K& qU@:p9]9dFZa #uhO?pg_íw:ܞfSo5<:^7ŅxO$]}KT~x{|?j^]/+?,(,]gf Twq4I|0fF>0 S\ @Gg o qèLBZ O؊l^CJ$P/*`ڧ 䮯N;ϡcG߃'~/k~@ `1I~d2?;O~;m(AǒZ~% _f1f T]-4`3rSo`ֿGj?9U ր?#نpw֤ |O"Odf_vyd&7O:w_[_M1_`>FJ=nMq.}:d"R)}@1A mLaj Ƥf-FSA aT sM䀊>_!JӶ'.3cU '~ſP_wK*2U[&~37⯰~?eɝeJ-{ pk80+S@Tc STAa|E!؂րGywwpS d)na`ONĝM0%OӟTudҀG6I@ r{ hLG{F٬ Ra_RL6{΂JvY"EH݂De/&{NFDxױ9{ I @i`@v| @r^51 (4~{!hT[0dN?T1x0=AY0Pv!h3[<payX򯺖KPA=i$3?Qv_3fݳg1}.K|yn]&[%`Lj@0@aJ|L?ٹO}0ZAk c`S>B015?5ա"t'pًӯ;q҇?׆"a`1x`m 0OD GK7aE0I?/Jqq?䢿kK5Vd=0ٸ>'=͝_+6/C O5?} B i740"Whm`}*o~X$*QĹ0ˎ갉?]ǭezWm' sYղ]BI"7/ ZV})?)K"J,^O=m,{L Riz|w|G03=܇:u+'%e~1?X 5,V~+J#'3QZb@ d]:,l 0偀"@J:nj LfTi.8Bm `t fي}߉f T)6Ь?:M- 75@a |G*k6nٸ<0| @ )l2sd>y?r=aw'bښY_}7*wc9Mwe&/h>ʢb%'On@<ƌv MT-ɇ۳WVh G fR4dxN6΄]9C&#y;~l^7 [w6G07S}|\/ei@e +`ZM@JȠ6@(FCOۗO-/n֥늤D?{:XD" blm.qc@P~kn 8P 79@jH\@ X{Z,y6q?ŵݤJ>'똸a`ADP jy}G)U,7q }Ƥ~H?4klb%{fՑ@@y*AΧұ7qDT1 P$exSZn:l %%ϓPH@ #@L /m#XAՖ :lt S$|/ʏI?wGrn)`jQx7> Na}Ұ_@>{ӌӮ| a;ҭC\EۼW#UM>M@0n"|p sW> }wv% #!A ~r@ܪVס:t5} ?7ZOf!dfASr3@}(w/vA=`g& a[l_ O'w@Ko(-,(Xp-D]X+L瀊S+ `tb+ `֟tR OR/@Zx .غ ?)Uh׵:"&j!jL|lB>q#_l3QǬ1f]6r[fI4W*ߕ^2cܳ T1~/EU"tr@I aq~Ht43! k%^ Znt/|:jbƟa7; ^P e "P>CJ˛?߬/ӕ~.3GE{gJ}^.iBjKM;ZJ>/Z@Gnm|`[ m} @I_ hr J a \@G0O8䇰zxp \b.+7 }_' m[5a@kX>/m_zz?J"oϊ7:n(MK̦[^Z UL*I*^ı?6qko?`tMEUvz 6 \Z~lF52i/ Yd\C龿MF,ܭ]}_ t},&o*f\[ * p1H״WmH5w7NF1K~ŋ;%Ak]0@J B_rL?)_1@=F@(/zgzU&j+w[iץ%;m~_"l)UD2a>b69<T)wznݜm fRO CjBdo<}M &&T}U  !§\:'j>]Vk Og3~b&F\ ?ONj(J3\/\n}$Ы `X;DT9;WlP_-ӧg@26\,q Tn?%pt9Q&jBM<OqeRN歎\_pƛ˳~f_hߘ.J,^OJQzюWr?? X8r";Bbx_:ϕOq1ڽ{Og]}.\0s@{_|Om4& )yO^6{9Dk_D3T9qg~o@h@}T>@n*LvcJAX19]G&S0z7 џdsNmS:_ϸ%}N~+)_![^ffi*gS䯢>V\$󓶷'kj<zD4-EՁϹ?A,2Mp722*_`ӪORc_g0G!"VO1drpɚnBt_m{9;w#!002t[xڤ/o"č*/m}_s@az@mŸo @z66MD4{ J?dUq @=)|fUk> j%!(#Nuo`Ɵoq"cYZZR3x t|U[”6 L>ʛegf,/n}E=Ma r0 h:0@ln`!`7eߋkvl0@lD#k-xC8v8s˜0V@I38s䈿6 >}43?}.e%^eK^ UpK@ κ V,Ⓔ?&]@HJJ ݖ8`AcY43P߯A6t&j>?q_3Яë忰&l~ߧpS7AS'"cխƟ/ ڪ n7+ d~o-mv@wCD `1ѿݵ|ie!r'N&`1xaH) jPAAP ꮼ4X A5Ru׼fB\? :KUs2jC-Bm0jKGQ_>?Y| >|1@ ~k"DmY߿BJo1Ooo˷$1Lvҏ:"jb' OH{5BBXIzHf'+0Q= :?*mJ6BJU2at<9;~lzWgk `=vcx7%&'/u??3jN=2q~D skNU_qd=ٸ2٥L]εooA/ZNh0@~p X k@G q WXWi U3+%F)j ht.okמ^f:2Yz<]db h>^vCmh;hok*UT=ɇwFVƁdr@>aeV4L& L+44MVo^GJau(4>'˸@@ѳx_爿F'}?vwB?ߛ(MEt?{,)/_w_Uu*o6E.ݺ.a*;Xw . P.3RCX6  D5 4:an/dq oJKE&r_ `ua"'|Oo'qv?9i+爿Y0T /o߿?R^wߧl[e~<7ݭ=f T9wk_rVᇫpz af* ?M (L7o%}Pq'D0i.  >e\ݟb;~crI~~@ xāo_iTˮuߡZKc}Qɯ_υW}xc URv 4 df{3Kw`י@@:>PwH{ H鞯nr@-?BP?5qM\{ga GgN|`e|?|j8SlY(.BOu&h];.;Gzvnu-LD(?a7ym ~[@y . L h4X?dr@ta?BqM\}sP?SGG>~^[Z:.[պ.3ˌ_qXAem|tgϞfINqZFsjbih  lH4IąnHf8۹ɤ[R&Q9# A2 s=3_]{GddfdfDNfFxxxfFDܿΒ1 3PFsN r HARHr&PR 2R|`Ά%ż%vWKNd{G|՟dz_yO}?Mo3ޚ ^ _?p?fZ$ESdSdgſ=Iʹʌh[`v@)yٍ9A>:Û?Oշ!=G|v?q{  =1#GN̿_?"jiCE+3O튈!ŏmÈgzO;Gǫd:6䦇5(N|Z'壝1 ")rC\cy/9?f9^Mr321y6t´<;?޸V= ]^5A፟[> Vo3<2cfM b?IeAμY߁% #"| _#lM߂ n9 LgF913DP 'Q` $H߬ $@k/j@t_5A*-d>%3]BȳZG'xK13q @αP$3aW^?wֿʳ.ώˉ]fo-o)C[0-O5%0 CPh $BYY-IH7dl,ۛlk/!t `?+_~ O}?~G/k dXw)73sϋY)ȸJeN-og;g^g@ۉoJ!JoOFu!]=-;P^&wazB m3Q/!@e$H x }C@gBx ԗy [B0W~WSG@`xg1 $#ddBjddOran;:Cﶙ죕 ..[&+9pnFӛ ?;oU,f7qp8bf-쐻}"=2?HR<!5$EH@Y- 4(3{YC)!(l +?+/$T>.n}o^9$d:.tƬZ3VJf?FSphŒfmfYx}'ץ7Z#Wew6;辖r ì60zq-ti`!@H!SJ RYPF( o#{ y)Fe $uhLW2#O`]4P @N@Jyb *I;l}sfKgs(5Ŀʧ&1F2&m 7,,͍~'Gw#uuR'a׸vXχL T=I@J "a`Z^ )r, 3me. vv * "Ý%*gG| /a|T 1L U}3C$_x4scHs-gx t϶ fk!* &L~>|vrx7>>&lߔu%Y!0Y-pyI& * BJi1!@ ȋ0̨LFHv;`ß7 'L1άb!| w.}DЀԄdP=s6 ȱ8l2H/z(bX'7_P1 |Yi@AEKdwWtwP Ô-V ?dL"U Zt PR>3P'L&N;3 t|f_r Ύ099{//' S+@adr@ߙx_{F1Asſ/]%+8(5&ު /z_nۜb7av 60ʼnU73j 6a`!@(ҽ.L[fO-@6`"mR \&  .NQ @Y2SL_w_P:dtN*?L=7=#4?.!h}/HP%Xn 2IiMu gǏ_y_69!#?KϿd!2I#겙I )H@$9A_群揠a-l<1Ԕy1_3T!pZORLVh%[ fΒU=a0W rӗo4*ۉ '޶¼| d1̖L),Ώ541sPza5+BB% 2!y^(h"Ԍ\xt==􅿚jw|m#> S2R9:Di`RIHHp!=\|9{M`Z^ A>71ٟ'g2ld8m]Y]obS0{a^S$)3Y"!5€T*uޅHr yƆ&j_G3''ݻ]  Yѯ00L`zr'gg; >H A=\7d*HlEfʋ@E0Ii-+L=NWSw}HT<9Ml]Ey0~c,eq PB*@IўhOU9L)5 %2_@MsYڬ%G6 LAdDDFx )޹ W ;27%9TW"*D Ig Ҧ_Kev޲ElvmeָK@wLQTfû;XTOW)Wee7D$qRBPRk.>#8$IRHծ2ѣ8zt@?~a2HA)@Xq 4脙ӳ3!p+83:4@PyN.!fj_ۘ'2M]U׊y&A_^D7ܡ TGAY~@PpՕaxaV BRQC#@Jme=u vVyB5Sߟ'Rxrǘ?5*\J~5djI AgwHJRcPBJ**<}Ӄ|T2`y]F0\2[7W(7 $U O0)ӫk_I$,I3)a{y@ ؏g?6`1 3h+ol3<ɦ1 @\gO/J O, 4^y.1@aĆ]aVS{̸Aav60ƺ+ C:tJC@ dB~)&RY%' 3-D1On.T܆y$Nh!HFػthJI@ T`,@4'ye˿-iug5v]vRG7mӮx0|k}ݬ8r61̮yfXC! L'v{NJ@!@HƆ"!N6I}XH[c HAI)+Lv6E6yxKW24*A0eV&E鿨 6v1q3ZYA,9̥kSg 1~z s /pr|?=X ]A1  'a6ΰ2|cezC@-`'&yZbZl.}Z׵؍})ʢE'RG7i`!$Cx琎FE)9rOgdy]ddGx/ΧgA`/\(5+dsa2#PKCN?$l`zM9S DZ eD2_yە^TO d^fVl3?9OnZk޻WFrPNG )`Jl2E>!wAI\D&d=1JWa1)TAXo29CK뿻Exv ?mWrӚ&Qo]œ܏(J{ pz| {2l`z?~W_~įmz8 S3"nKЀj5zQ8 evvkv7#*?0x+jl! :G6@ i*hw11%Uo J)lg8ſxHԏ4<=;f~̠G h#6ΚeE?7mdB@pzOӓX5`۞+l`zpÝ^گⵯ1 p YFѪF%q΍GڬY.pnZmkjӰ.z]u"g:a@gQj&e AdI`t~t@%G rWEy̿wJߝ/k328F`[xKCvӣ}oiԯm3ab>n}7q )5|V74jr Х C3+BHB 8zx[v,.{ hl z$; 9 Yu!\$ML MaH'̋ 6}$HWlT-u-1I 6b;60C*"yP 2RpeC@_Oȧ8;~l([Na&!iC@_BxhcD\IF@:rc\On#sC@4Oq_EĿ~w@C" Dc6F'"j[#As9&gOpxx=.,0 =W56.@_עh0] C!@8XfGYxr_B05eGo!`VӃ&ǵ(_ zX=u9 TH!I' 3$-=hrKgPI^xbZ$ZDcO#d?B9~Em,sguG@(Z5Cz_t2[9xTW $ @4*z^`fĖL9+̊31.3EXuޟwb&ᬺ*]I[o'}ߺ$`$޿}u&_(u݀5?GvNg)'GBt'@Dzjg 0('̓!D&ЊN:CU\n?==i5?jCde@gUsRtIr)@&QH|lDo\%1@de{hﯲx¿x /ܮ~8Iԛ~C_k yT oG!msǘ@:<U &K!^<Ong;e`m! Z ̆! .ҙ4묣$Mz)Ύ"DĿqjTbV%ńvF3$s-n&,@3@_tGN2lyBE As7a -hV#=!x8v}L~ѶYjzy`2?l_0d%F NX6W( 2|ZEKU<Y/l`f^CW t "A7@iIgK6~y e{s_f Cӓğоxk+(B"aܮu6#DRV i xr'W 1Tl~2:[Y:ڈʡYOa|u+\%kxԈJ6b^z5ܥMz@R I4#ʡLH dvTy?XbWhdbfa3 ܛ<  M A j1l&~Hٰ<;Q<ߺgz,f_Kc#ֳy (7%ID&y1J*e+E~%`ĚhCF\mT$Ŀ;&*>UMM? &#L&e5m$~Ko$c&Y )FC,Plc~]Yl`^Di!oo̳_ %r>j*`Đ5Y7C)mM I5&j1/O7x\yM5Hr\HGeh94"s Be߾&&_9s_7$Z8m ߶_ޖ ,_N3_yY(Ȅ%I'O a)*8X pqx^Eifz~cfeo_zͷvcK\&^}l`zK+C1ŐP` *joƲğvϧۿWݪPy[.ǸJt24#Hd LM@20S]cmœ?т,LRd£+&_9Ȳp=lj[w.яk5T!@% (܄@y)l "%Lώgl{̓CUSAxr m`,;geŸW@`gC5:MdQ>T J~xy)dKy l`C&+#lzL'AXpfD*M* r\!`VlrȋzEz[Vz=+E A P (P&Q`5%h)l<; m,ꨧ@plm1G>k 5VfV?<ۉo*վ%M(6 0!Xⳤ_؟IaV?]}50;œuyHh], *7DQ=R9ȦUx.es2a+ IQLCs),i_ wpMضV<un_a"R|G[pԔp]oMKW+Vpv) @<((I6Չ) 060 l`"@ PG@hHj8٭!`>E69F>=$ST'e[קb "&uSBP)}]A% 7$Ȅ 'd7?wU[jy}?\DĿ!׀3.@ ߍw8y& $cе[rPB#|* 95=>د,dfa3|af,l~QC@jrIZ] *`zzljJe+5MߴbkUEDMUo]Q4Wy>̑׋$`r.YP6Ofmu+g"t:q5,SI *4xDۆlVHfJ"G9d"iCt|zZ^; av 60?7% ̐P@{Fa!AՀ"Y S(@IS5`C@Q/tv<Ϫ TM*.'\T,Y/;?{6Ke''cjPEemƁ0~?: 1.o{<\VM[#ۧ״S >NLHt~AVpT9"cg 0nf0(Da#zT ` F Ii B$V nacg LyU3+K"ʑ JBpt^}];ߴY^1*8o߮1 [GfQIGY⟈2%q٦&3]'eO *$:Qa݃ p&)]Oklku֋6H0(mi;tmI|þa!pwk4 AÀ+ue퍨wƸl3ەy Yԥ !*`|oMa ̀,[!AŻRF7 dPxhC o"ܰW]l|zئer6}\{FYҖw2K^t?E~K$k+Ofd-$;DB Mh@00HS|>ʆ 3l`V e*Xx#x (r +K#,w'VF쮿[V=uŗܟfw70>fX&_t?0 2=GV3jQNm1X) %I Ds/} J8۟~70gaCtd_O;S&lcV5dM>2^1*T{ssQh0pĺ[* °~l"30.ſ}8Ak>¶<؋E5$ 2L11$=wW^뿢g0 `FoUx0̪ hC@62kp|@"{YRdJeH M9Ib%BC-gT+Ev]+o,V:bnPBy'[wTVORW o P׷-ey(c|vA_UA _,5 )$ Fchx/ɿņ/K؛~#,>q־\B$n$F*ːggHG{&6[&/{q6 e^r,A.u ׁk< /( |xYהr?۞ \DWH$ОeAmt%</SG'a {0Âj_  kpl' 0󗁋WH!GߊOᵩU/w2mtnUH в("+1F GW?yEſ;On ,Le&/vuߙGL(+=m݉yOHL&4 ա`Bφ\z'S3az Q/aC3>aZY`<ӕ/ #Ϧ]Ć8lyX ^\u(~]S P$T8;{G+]ku[<wAC$_@lN6aLp]z' 38 cfH`{a$HP7,L;PY<9*cb}vow ߪ&p 0ÃIl6+2?X6 Q,#lh 7R_>zf 60!ab! 7Z5r4PL]%6tk2y/ӝ.{[ ״"kW@7ia @pF֟׋XDQ0/죶m6Qnh@Y&Rc!P B& '>O=}xw0&f0߿M84`|!l # Rx/9uUw_ f v/O]UDκ_a٦XZ0ƘᶱR*g3w3U\S "+iY{pZR;Ex@Z H2G@jrt7< ca6pա! 0ST?'L>&[/W#W|\g.zQoI\kG5/Ezk; zy a2߽G*w6KBΚWJD9ӱ23tMD#LBedtN߸t!az0 F'gx5|_˯mzH S Q(0h=\ ^ëw;B U*|]r-01 Dgl?>ƃr_~?HarIG[9_,ų cU%#fkm(@I)!TPpo\}浟z8Ol60S:>aC3'}YbAm^>#"][Y/ÙHMm_jwGCh08KW }8T<~>Lxl?nLU5mgdq/E@ j#DWu9o{  n ڻ%l`,ڝeC>Ziw΅{;{H{kXz?2T&s. fed6l?\e]XÍ:a* t˝[;_yW~aaV _l&C:kY6xX%o `F?a|Cg?źk`a1/ Ž/XxG8LKNGwZ?=DB*"4 UJrHc|/GO߭ 0afDgD`,67a_l[51@׺w= w׻IP b:;̟}3b Y|kՈg|=2Gt,eOſh+Y4c|Jp~߼/S[ߩ0`fxX+ (>=g%͂O5_nT}]#ዕ<R;G*دC v %#㪌~.{vA pP" HBr (*"IOg?뫧=}n fPy4{ÆflѰ0yi^'~?ZR>)fg9mu&"J~߹DV:3ڶ~"۬[7 q6ku'"@ @#T&<@}W)q߻z>%l`Eql 6l!0 \W\g$D趻eiz_\2E׬L嵳k\QrĿ+ 33JDtxn/7%#}m@ChB&@ "H% ʍ! 9.i~t fl`/I.K\{:lOD_񳶬B7xb@O%/@]z(8N`8`|r.X :Ejl4ۨbC=#?gs! @؄$m‹}K/Sg?2L-'n.-?Ff) `DއGVg@8?1߁q?p7(C]ߍ(Cd{(͓?NQᮊ %1eĿCѶCņ W!4e)!{Hl 9$xH4 av60CAb6mf}Wy_"}mZ7Ow@Gu(c>~u}ު1 6_z }ر)lpxpo 2٦|OA=z$=ށ!5!@B&Nk Kc7+N__~gzG p3L50ЀçSist *ۄ7)gC7}Ȍ?:kHw]+ _7gy{NOe) ]q\#f37zCGM_cHzq(¾w@@jc 0P THR\xA 8yx{ɵ8O !03kNk0, 3㍢y (6 h:2<1gp y3eG:Aپdn{?{?ӺkSſםD!DNƀ"Ay/~ϿɣO9Op3 9l`Hą=f&'T/kVt|_E3vwsنv>g3f'!~,? RJxvpL{i2BVM1{98ݾt|p()t]k(&&ONX7~3_J0= fl!`+#: Y߆ny}o3PX;e{}LQe]p*b>_m0=ܿIV}@$t4hLOpWc{q-#={ϢnѪ|YWR& I ߞc __焁.9.2s0LH(׸q4s9z?&V WXO~l}kW]Sp;ւ>N#;o4+l1J?>/QEY㌌ڒ,<DVdD6O@s\|"O  )53Ø^ÆYʦ5ŗr?f^BnT7w;01s@_>NOy-x(t\ufnco'kT~6-]c$a*`*$Dž^{/S}5Nl xKfph@Sl4ܰ雴 w3DqR̦ ƃ,vny=o/~!8Іc+ H Tx-/__Ķq[i>h?n=s_>BH{z#] H!00:~& w6=~`LyœM;{0Cf5vxhW1.3yWGڻd4.sQ4Jﮫ݀pz|>H($<#[_a }^|7}BG?F ?K}K1IDATG_Fރ]xz,&W! 0^-$H*C %)DṯoՓGw|ճ 60#,l%l]r\F(luU!+ b?UfqNu]|~jQ߮'n]țȈb@Q`?&jg["}\aֿQ aShC)@1$^JR\xᵷ?;qfxGo!;0kHgwA ̗T [پ[*<Ahd@"=9۞mc=_za3π;(,*T >ڈxu]Y¦+ G ' I  D6OQ@*ŅMg?   7՝c!YѮ# ܦf=@4=zqu^>M̶P;`eiW o}ܾVu/zR "Ix"yW~n)!)!!Q$m+ݮ7JӺ`S_TT _u/]9V2I<:Wm3, ">av60C{[&_b.?]{u]xo$#p1ZRqy8=2Y2_9߾F;V#ZMdIGGl MF_[*$A~5HI X' t }篾+NW^wy[~ CMd6YF[T,[fuP/n7az*%~Oѽ!B6)š !!29#Bk7O}$D7w_w,ՋnW1*%I@@p!uo^<ɣۜ0l` 3ku\ڦ,&9"c]˟Yvb.6q<Ȉ[~:#d:+dUBāN0@oh6f_۪2.?Oǣ$ $% koGO<LffU|Me;٦SmƋq}c1a*}`_'uyԎaMmN`k!N^ZB= a:g^_/# /G!j6->wU ms<^xs'l`J0!ru'mS}f1(+k)w84u T_ʈ~藳Zv 6Po HD`ED{@Wy?k?ҿ?M Uhx/BH{v^XCe9:7nlznfW 0lX;}r(9;}wO}[~[ۥٸ,\^jz ?F[- s\ cth]J0UdHSgvtwGU{VWoSUPHRԩP$ ڏ=ᄁja3X?7 S:d#,0`'G;89/_Ҭ5>KP;c).6[prtNb0_V?Y68.&,@?7p<('@o.j/쯦{' $Ic JL%Bs_zi ?UNȬ `K14[=9k}8>5u5j8bѵ+ؒ7uMsX]rr|y}Y a"W@1o\%B")mſ2,,p N_Iya3p"& Oi0o8=yP>6}ѿQ jADBTc?9n6dՉߌ7<e00V (p o QC̼XCX"!y! 7yf{0Lh@69A:> ǣ>n_Zז۸ѿÅK"G@{M7%/R\Xm5Hw_Z+ \ ^|oWkۮk]э;<Y};-w?e"@ɢ[R0R80pH%_'# ;]L7mY?Oǣ$ $' Ay/_?}t{},B/nfߒLG,$L'5FS:<ߤă0aJt!gΎMOgMU<*qٱ65Q6VmqeӖTM)l$ctv¸7E p\ A9*S,̲(۹jgub6|c }3I@H+6̜3L''!C9.P9V*aoccf}qrx TƠR^\|}.s>w>}H}c8.|?aA8˜}'EeUE/(u( LG,7=Ԇ(e<_Tx__}r L{,JLGG3=n]=oecsnOx񕿍_;Kge=#! cMꊛ}?nw:nE^D(5˗<$A 0?E)A+ % Ȋsk|[ՇVXg!ɜ⟓kEdB#rPC)D㹟+o'wϞ>xw7l`wV{0rK &\<9[ޭN|onGܻ'xm<v&UP̘էJ v fϲ\}nb}o=!P88Ac[2;E' saT:/JLIA#@ }W)p `a3`fa[tCzurt`- ܻ _~o˯NldHh yÌ=յ Kƽ b/Ƨ߯g5׻tČG@ @N"DĬ+B7Y $ tByC[DG",J&@ d :i$1‹}O|GWϞ!a3\jof5l*~ӣ+Ӽܽqċ]|+CJE:qckUcBY|Z0.|Pm^WIC'9d;=W9 D@O8_jc6H%&L P!ܗ^ڧ<Ó~t ' d r`af3XC{/ 2[ wou⫥[:]@Ǩ-A>||4{?41voMGW?gnsR:Nţ/$RIYK!]gPQ/LI 1t$݃s_ҕ׿Mѿ rW?΍?P@S̶OW<7 c'߯)1ӦhP*]0B_& DNנ:(8KsαB#td4qixW~3/|k  7/sֺ#3._ym<6=$f.㶻n^_xp4Qtݛwo_y˯BMъUto*c|\h }a:!zA e^hZIrq/mM[K0:O/B&ty4 :Oۜ0pa3hOv0d l|k὿ƣ{e^-jXo7!˯x5\aRC||,y; \Z$<>ΌvLl! ]bA'B÷.a #( M"?.Y3 Bd$9(Op>n<l`MƩw ӆڂ\cϼ tk |.X/^iipDDuc?90^a-@Љ琺[=lA?a`)+^0{s Ak6DTXޱK$l@ «o{}o^儁3;fG9C2`KC +t@*eֵ!Ȉn!y [>0)C%Ŀp}v,fKǫL,@PMY! [yh lGNʵ9wb;.{Iڬ!3~]2+~mayCNQ=s,7&Ĉ}ruynX Ÿ_{QPPjMFYw{z`3l(l`2'Gwpw7y-hC*^ߛQ5F`n콊B)P5tXǼVԎ'" 2 /vل~<WpMD8 jy*`Me,J/SȦ'8sdZY3^}xooz8˱#w׼=>!|y/uej|{#*˸}[89D?.JM.Ḱѩ M[A̖TzY * @ Yl`2L n|n|v`\y`E*&U\_uܹx髿Kfq>Lu]"3&N/>nƕMZ,^Cv_ a­Ea(=P Uzekkgnu Ry9?=C>9|ea↋a Xݵ__ν}qxy)CT?+Ͳ -|o.v' ӽu=.[(\trA34PQl΀\~m?Ӏ3[SASo Yl`^ł ;oo`ϱ^a1_!|x髿^{so*2*6:h{͊)dZ,`= 6B_B(e;^韙M/Wn9HeP RR4& 3hgYrwoqw6=lx|x?Q CAH5/nu17p|x _|mR'Ueyj!H[,H9^@,^r]LgN `-E*af';؄Ecӿ n९^~W/>vvD[Ek;,E-v364aX N@)hl dfj lmĿ6HiC噙/N̺`3|KϾW^9CRΗQ7Ϥ^o1hcQe]¶Ͻt#v>.h$ &eH H#wf.ZEZ5|T q2C@8>/>~7OG%V\|OpxomB)fuUk:k`6iWfc ޲HEuV|B13::@B@2))LE9f4"!7MD9(ϡT{_v^m 1ck7l !޿]eQ+3-kfu|}^y[퉬?wOp͜kAC dV}"/ B@yF pJjcq/O.!frfTdF .kxo7o[/~ammJ49d:'\Cz)udirHT^\9`S^0 l&[FYmo忓۵Fxn}.n]^yxk!Optpc!.̚n};:#y wt4zؒDݔ$&&"?wrp3 vPLЦfX!`.C7>w0:{+?sq}ƷЀǟ'kxSsKWvqy™:HhТR %"?3Ivw60[Bx#VUz=>k{mK7 }5~hp\{; }O8;ךF]VGoIa~ A,+)!nq=Y|_&RI˜̶fP>0lVp|x >ڔml"5*J7?/؇ЇD%,.5h R&$KvǼ?s/l`{Y/}GÛKu]j2cbn Sޯy{*-!X& /!TK .!5+K]7fMa?lX? þg5.fGK^d yd>EْH8/*g͟]V3R&II:LFf^'dDbӒb 7{0[AQyn_t0|tx > o@V.\#TV'n<<՟#EU ARZBHq XQ]Unf^׬ l3կ,7>OW6yk+M\7Veunv̮&iWmkS]l2v}EG>gKo&VUBH%i#WO,;lM[f< +oهv]k5FOƶ0 n WE{r % &)0(Gknſݫl C0d?wTX鋒8=Rf7@a A%d^]W"].v60U0 #44?W;¡7-|\]WySvzUm㣫,G+H8!R?ߩtzצ) 760[[.f,k8>k  W"ʧjiibD f6mg vX"(!yq_/Og\UkG2Vp^4 kxj~?H'׊.:tԬnHj2juAlERXǚZ _e A%[ſ#+520}=-PK< {|_gķq7>y8. s ku4ʍ=죹!Gݕ4^y7 b,!(KFq=Ŀ&[&^3! f(uScf0< ?;yMqʛzkqxp}Ap7-+gڈeo!rV7x"}:<u%!zXq|o}ru ;dz큂e/qx5|oCM_:'YE>Ad M A! coh.!b x6&[5cXf;pcY3y3&? _<9x0 vp@azyK M|gKӸ[5c KY6X/,nIR' A AR !rN;ŸTkog8ae10bQ| ږkl}֬@+m D9 AacaMٹC{Kpcم#˒A6^, l`{Yչw\lݬcx zߟca(ct| SN87n AB/]BT@6Gſ|V- l+ yvսY=G/@+j/3-($l鐀2VU~of;t3t Am4 DR )Q)P+ C!pfk8ypӔ1a# :gհr*苨8wH9G)GSIZ]Xɦ#:0,Pڤ/ rPD0 M.Y `gaUq;s0̰4cu3A/3/+ ARj$@H`20~KŎcZw'px% C@ s_BHٙ#3@ 侳(h Nf +0 3} =f' br|A$ t31>TK*l` F+nV2gs]8{N:ޱo'AeZtJRH@$)@ $ElJ㱶CbV߻L8Jq pK "I:E)%F{1;'tn/0?HK*l`]a@!]B+`@$yigQBg Ϡdd4 b$A@B@ XE.;L)!h%lK29=612[6qg ̖3 l v <@ݸ2䟖ddf rJ|!;!22kJ?B:ji>-8L (ėR&5v r þ1 7=*_f;إS֗h zHF2)QŃ 3SlMAe,2IN~KacʵWy<ː)GXg\pGaf0$`f[ %|q[}֨K-()SO8?kxpͶ2gDұ@exds8%>D|{LG~B*%1rRu%h% f먔d#0& \8\/ Gcg5y܇YmC*G>9THL"G% c.!^͒t SN t2Lx)X0; ~3 ,wϹ΋۬} B;ϐe@dBzFs&<ͅp#0=9+pQ P0&Dl,0Gr<#HyN)AHLiB@9||իIE {+Ӱ (&7=fs*N|W?a^αA-9ЙذzL-> 7D&)w k'@3(@&#$PRC,Z1ymmZc (Nw7=fs:_ af@Tk!$"ha]vޫt?nd_?y:{> T>ՆtdR{3l:0>a!w}Lw>y [/7p'25ә̳pT:Xw c4Ն$ 6Wďn` B0 BHTYUuܧHL9 fz0A_*h"g#Pb9ұc0 ePlH`<ۏL9 ƨ|7"E20q^0[1BHBt^ ;-wEs ±}?<_t/1c)g'NMNO':T gşRyQopU%`V8 ì֗m!HG# _/1r#"IMH1 * <nm?AiCA ӱ.s(@&YHt!!OFc'ɝk@p%60[R3 x,~=9D3 5Bhsx_G,c@y=&/!TrJ,Fz T<۲D8w7=fs`R! DYP! ]Љ\$ $ BU NXALs ˆA5b0fK}fC0á[ # U X<+d22 "gg髆wu}P/8{JhN/&65@JRN LG23%WrR{?Kڈ1y% &k&1q( M h%ќnsԯ)ւ?D`j-t]9>!h!|r JRhOұ6$| TIf_B.<Ϝ  awo3:?@YRY\bV\W)H]5`#uw8VB զAjNllu\F.arC|񟞿X@@JHMN 8ڃC2Ch#d HW@m`6tz+ =0f+9w}?wml`OP0 C"ʰu a2ƒ>_ʖ4&?>OmEq?x2 @ H&U F{HFcL!R(N,e`6J[sA_$*6='J_߿^t=?c},n0RA=uR@&ss2Ph Q#œ3+"a| l!LJ`"I e~ m E6H=*4BCL Lh0˄P9W.k i_Y lc!ſ7n7+sO~!:bUT~cbEaC Yk-OWYأG~Cd2>.h\nw^NWҵ,"#CQzpc[!`'c}b)ș{]Zs)b:` 6.Bdef0&:1<[ `:-'OEY^3.Y_lZ} g-_keVbWq/*zwl#l7TtOyw̉fw!`KW}Ӻ5ü.Or/Ѹfe=dQh'Pw"a| !Zg5i?"#]Zv\#{#8H8yp l?$6!aEo>Wwky׹;nP& Pj_ yԨg;GgQ0﫢[ZFSG[0RTuh5LKmJO=e?vg`bfW#)ª0e2mEvId|Eu!d:Zr،fP61`FhUuw=%]1wfvl*t6 ga͆/0 V ? a*lt߮k5Ȋ!тub~fMF!`^g©?CSTw&|]Ոm)Ջ?XTcC *YCkѝq @60[n:j)!a*>;r ٳq4E:>d:r5Bmbn=Y̿I咰Ϩ7:w|U{iՅ?v6ſ?8 -E>?L_%Zl5W [o`ft爺*35pN!}YoUԤp8{as1K'y]@eѥ+3ſ~wVU dpw2PWG!jnſ°rj_?DR.0 zyV+G/nbv^^5/5Xtաq`zu}ЂW"2~sR;3bM<64S])$y!L-\nbn;W `>ug;]DP|좻{|N|3_a+GW|fflV0EG|sl}mb+߄kZN*mſNp=^1_ ?{0;_- 7. 3yv>@13oiݢ'ݙW9B!}|_nw-#cڇ/c׾~ iwF) dsf  lbP5p5&hmXhKRk݇kbٸ!0loﱦ' 3l=oz Cݺ[C' d%0Zn^m ʙ CW^h~Q ۚ^/4B(/EBW(븆!?Q!ׅ~??ô s|ƻM{0@g.^|[#껚ڟE<ܨp[w}O")Sfe؊R+> >2p%󚟹QLlv1yVT_W(W.=[n}_M_E;/q #ѝwy`b-b֟0< r.ȴ 2I!黴.c+o]=ynƻkLsJC ӳ3l/^4ȭOC8="6I갆<S*\k>/2L3+W[Ebeo%"lDdulATg?v }I:ܲ+zO)Vtn4<,s{aB?7O^f<d4s_Q *6QZIF/9c;ї3mھ:`A/֛'3Cgq{o!.z0u7Ps\+ncluڈ9}9_G7& T,g ,78Qy^X#dI{t[i2:`aj!s~fh, Y$#jBJaM)6Ҿҟol*]H<":cODžX*Y`IG)0Cﮙݠpk@yҁnSwRB,"o>-~PLʇmRV(Oa G4vN?јi j|?]0@GDUyi\[9@7+`1Oƕ~8 g PG7zXC@M8?3|YVm ^U1|ᕿlvJ O 0L?Š}K#Y73)sy rl!F6%K" 3 ՟.o~H$)' dJ?Z[Z3C%zUPVFeac [X)0R ~ o+]o <Z`Deu3Cɨ4|+BT6) hX^zД!K2fG?6\1afWvc\P_ꢚ+ncSH/BMRPdk&wf% l"`v5 œkGeS|zggǠ|a&tAeMl`v{?l! 'ìOSA4kN3v;cAMNj\<')Z`=PͅV[ kQr2fl<@&#$@ώAfK@ͫ 3NH9Nt&/BjY񿤋{uɖCM1Q6[g0f+UE5H;"0o_Njdžp :sVT?jʐؙf'8$F)oDfpf}fM|P3^ v[Y.uK[ $nId11(I@@;_@ dƯ+)WS]QOkC|*o2I,Q?96l#l`nr׻K<Hԋ`qS;M8`]!eF &`t,d& tr8 rodd#ڰN.r uݜOj:\-oEndBɉ`tR͚XZ(.R 4jXk[p27о<@U !uAۗpSu;!^>8ưʛ >[wLRgJ!|<<[v P5Yݠz9X5yN?ڦeb}n5sh7}QBREhX (wt2oAcmq#( @=9vf/;.bgD@%"A3m2\*v'Nގj؀Z:>.HP2^ jR&V '4\1"I@y;C,)LGP8ڇ;+XNZioyfյ}WU$"R ajOD V N8Sas*??m! `Ư -]o3/5M[*on<C V 9\ã<֧' 3H 7]n[/] Fx1M78Bpf%ҽ;m" dd߼56RMjΥ'=V]~!$D[}!S/5:( c kHV9xζگMTGVWv4;R*R(dBHDn!@H@(eܼMę?l#&KX:o*Bp@fv.O"' dqJD0h~ ؚt};@mf!Og]ì|i%TR $T@'W#Ɠ % ,C WF@,`ڨ|T&daf ototDL=tR0 fM)-6RºE*1Ξv5e ]-kl>J:(X<h1m?)̄   b ϼ8V[ ` Ngvp@ ! tr+)6~yjfEV+Hŀ(Y$ElojfZ h=;FX`qI|o!҈#h%&6ڬFkaſgXF=9$\Or*S~pճq|hcHF{&!!%.(,AsߦIDKѷתLJ&4M&x29 & $0vvv-Ŀ3W6py{K2fSXC`fF$IÊu fQj\3?u*mNhX1RBmkFx @t|sC@a e<#D⟬7-mY`84^lz$̐fǠo8? !9?g◛>*MzkB(Zm:pxi,8` H'ݔ*BeL[I&(OFjϧB?*Kr(l`v =Ea_ks~;\os YStpb؝q~B 6[dLTzQ PC*@M'pg B 2Gvq 1fx79`TM&l`v=k~o<N4HeAdIfO'b<;[x\36 t83 όڵϖּ_zm^Hi!K* G{=B@HaB |s9`#x.!C] 60;*-:?x"qcPAqŀBp {-"ݢeںf TX([ `z7߿<k܄8OϐON+ 0@Jmſy. wLq9TNن^bE ޒ)M^uٺ6D"-PB@&ԭgbrM:Yp!|ȋAtje1ҨY+d/&&jMg,H$ T1a|Y{J:q17ϲ1pc0|g"]ͫ 3\]`z"7_!Y  DȤS߰Úij=+7cug)l BC땴د)Xd'cd:.rPTIQZGϛ>zLWK@+#Pmz fTy+ୗ.KA0ѧ`BII@raDQ%ks>iYrK2fX,\C|dsaz5Jx-=yB:1 bz藴m_Z`rEBhf߸_m2M͉C+G-d:ޥg cDPL+@Hs0y.l7nǰ•&'.,`vr6 ƜśI:F666p-Gݕ覈_2 |ƺ,.96oڢE=W<&GI(1Ɨޥ!G{ژ%  Jc5*_'T ] &˄mKK#|px)=(.+aSo]hFտ7ffqGB|_+ׂ)r=y0G> ;9@>=3n榄 О@Hg7WZܙ87}_Iz"ׯKy)\1`/ӿKff6ʙ"7M{Y\P36\;VԉйJ7GQΟt {| {ϼdt,hf]πr pQߣj ?џK2fy}zdeCQw!`=ĔZ7ЬmFX^}0!( 'ҼfфkeXy:ޝ=Kr_?Tf;z_4@RzTТ%ya?8/3a{"x²--[ $ zkU:ge[fhܪUYu̺,7^F~zY>fOЛ`Fy`F:vSIE:ԏS @%5gT=t4I@Hu2c)JX+2s;)'Uqf+=^h<Ƣg':z(+aU0e8-k8V3u3 ` FCzl+ܼyY5|/o]=ɰ=n3P0"Eu.g KQ*N.5KeZ dJ>f=_PFQJ" >uY9~FV:+n&J-|}3 ,!?:ZE iNS1UUB|d /TAV*+F| '},!H4 ?< ¾Qs?7/aVo9lDO bג/7yd+L8`.EOT%OS2tanLHKit|Go*L %g[⻮)*HV% 9mlNw y~)n [1nreƀM/}?N z On{KYw m)̤L@$_Ꮐ^N,:;cj"@PrqhhF\Î.#u§LgyKɏ{k XRP4b'1{ VUufu? IpYlVƿ CRߡ{ KxpH"B=o3` @L ,P{ЙKRꍱ(0gL g? M\+e#"~/f44ږ<Ȕcf X<8PE4XLI[BS07A-tXys-t" Z_{g}$ߚbQ<q hZ0Nyr{K/H&,߃qzAO$ܷt| /9o8K ̺)1I$Fq|Uu>h{w0!! ob3(N̍~d4&y/ȳ륐ߓ^8.S^^zy_D0UGG! 0:̴ hzYO%%V2f9ȷ[(w*?Zd"U8(E-!z*OcH`i]8E(p]%j _d'w’a~vzfia*)W3c3[D@:؏=M,nR%g7w6gX M /yHL'L,Y#4MvjHb"Ya)WؿICֺ'`Cnrlvx` yN3eX$3ROZ?[_Xrkޘ1x-fe<:? _ōE&IM3!<md~0ړˆKl]K|#*rP;_*kLaf\?Sb@y**f}J6锈.gvӉkg~鷣%牢h(/?UMDUEU|C9N7f:ʛijfE3x-f$@(zo Qgw7`ZVtE.'by:ض&hpU$L(Ep^7.ڱ:鳷Țj" '/ewQC~7nd@#Fղ說~[ALMuqi<=/xԢ]q0oj7}pEmlK<ϵ70e{ - 3> XrA@$ӗv S?a[_/8RfFG_ ˌb1fJM ^*9*bj"uݗmˑ]EtQUODU TT[E@7;ZQ . iT$=8 煽0eEK-/ ew SZPrE$ J+TƝuFL߻-laS#ȶȎ튯(ӴpX/A谉A ́F${qy$<;F-}]{xOfI*Ccf鳛x88{O(AJHOQ)r h&`xXTD*͝++͹ ,9?QMD>h{wP`$"LW>#v/!^,i̿~x%NRp{p)r4Nx.T|xh8 CpM 9 Op+ I*""p;qW ibP~Wu(*t~u-r:sJMGuL$e%L(r!׶r^8zRSLvs]_l ,9f{]U`VR"D*FC&lsV+vVF3:ԣ"'VU9W2?fg4GWDQD1f[+jY`fh*& uH'PΤ3YXj?|KeDhXfýŖ Ѳ2vSo‡{f+UVkJ8$PJaF=>ݳŊv Pf LJ6RR<_s* SbvH`y+y"EB.z;D>F+E;?9ɊQ +G`>WR 郊_ڶ"@|K)j뺨&j1OrI2*r]vڞ\߶e=/ YKeY)rH\"J{E}n`zɱMnr⹢j(^8}SA@EQ26c,c'+X@ݸn2,nmYP ?a2,3u]4;<|jE:U/Ti~3Z6WS$&Xs_3OM=ɑ+/a#^,?0!S+j*S O?k_nf]LӔUDuQt@/cKlFU+=,EQDQ/XxX6,~x,t#Y:q V)0s/ rq#gyrI㸕۶|egϥ),ym /*pmk;7u=E [|t Hz[n[]n/*)G@ "xsO<,=+3Oxz/Nޮ4wwG~Ѳт[-Ol@$@7UQr['.. D[\ʽˍf!vݷ~ hK f EHɌq_:D@!`8`r9}߃KS .1{ȅ#s>VQ՚"@rAyna|=LVUqkQDZޣ՝[|q滞ѝaP7􌙋TF,D-{P 0n\?{;۹i1m N0I`, -91Na^_ S S+]n~%J P .$gVT&ؙ=Zc'/U=ω/3 f0n|ʿO{lD6jv[lF F(~qS0YU _^1&YGSJD;;o%PC~C%?<,EAٿ%].H `?BiA"J~z6 >PT5~Ot Wd࿸`NL-vr޼ucӵ$Q`րQ`8B:\+QtN3*+ `ſ[筟oa 0b̘mt*P O+z]+ei E44k+7|ŭVrضcqxPU~TAz , }v+'{0m~4m`)V-&*ƠDg{W0EMM0 X46UhUyl*Pe3?#Y85j{,Jr1x&W'AtT! voJ Ɓv;ԁfX,Q_6= 0+$9_rhKjmYni(*Tr<|֓H,kQJK:ϣ+\=*OT8еJ* ;XSc"J.Εw=ߘx{?SUi7yYg jM> p؂}`IȋgZ_\_sz̖c Ƿz`^/?wᴁ;ۓVs_vKlˢ?@E :#J0,`1s&9th(.h&Z> 0{WˢL%yڕ>|siL}DH%xڗfLhzP5mް 绖|;ݙ (u`m>pҔC*o@K$7x%ܱd 4o6r PUD @Uj;UK#0{~xױrr!GJskWyq{ 4a&JMD%PASO%O.ŷu$rʒQNӑo[r}VL2P\;8c/c&w6Y%3?yڒ!Ҩ=jЀ( V(aE+"2;_b}z^!sl.7 N=oiփ$ .:3 M* 8d(zG?@abWJt$fiޭ0s>d Pr!L$(rkg^IbE|@_oN_|f:vSJВa$f.=0`u@LHm|ڗY0$7@dUIq濴 \?@tN+HlxYG8@Q/><NJ&d }'q9vsz| \VWyQ?-O5=# ߩK`Vz&y#n{?Ny#T׾/_ty=0V3D>$7@dV!pTgJtI5K HJdJ:!:m}49`()OY±}jݾ_?n_׾bNLx $@24@R$f%??=/ii[{JHu칵'}qҽiu]UD͗+}\M3YeO;},60)WVf|ە0_~>{d=/Z2` c%RAcw-޲)},@[<ۖxڰ!`MIn0\\=Z鍏c$NU5O 4VZWph@"w]\G5zzz 53`>w6?z,>H L uQ@`8LT?@Y2尩 t?V0H!D@z;]o@&&OwoYmk 9!N;m}49ث?0 d՜Ut{扐Oo|<(񐬷ڡsW6@Cjf =W|E$@"`ji^NO9Vltȩ3֮>{qF4c@jX8H g HU(%c4'p h;}IL-K4]ImL;//;@15^(бn ߱uE> +:ldO?Cl`Cjacc)L8 G,? a찀?:' +Z2%<|.~q:D lПv )'l+6l?_Z IOȧ?3n{,[?+G~{A)БDDϣ/L&Ck繎-H{Kn<6V6BÙw RD@YLU>]OMV$'.XY]V"/ID4]yV;VױJ\K'u&Բ^=:{6VihhF=jɬԁB"`|E IM87T Dx6z+ 4A"`$S@E\d@i%,"wuV8xrC7W&CH'&>3V[\-;)>%xqx@ffDt4= ?H l rw#)%R KT%`~@&O_./-K޹%Q%ܸ-:]_֔.YOd/vaΧDݖ誤/OOXM'H +HzZyLH*X2Ξ[{ws0j5jA"[)c %yμw#c GNP]K?T",dY'يqx$1Þ㈄Q\`FVp?z.vw\z=L ZxGZQM{U'iaQ)s RJ<|:/D@EC.O2|=P6nG=-g!z&g/%:&/ّ6xerA+Vkda5j"Q2D /IXK׾^OX3ji<^eQ" ʐGSu9\Wʔ"+0@%( "r{?hx;:p繩ACcm@jg?x"[Y -{;B?q"u< PH ]ǚ\eM:>at0LCj5CZTЂY'8HO#Ht$2Ay$US+JؖxN;HD|?1H D)@lN)lq׾u+}wQ"~亖z8m 7qgESzyL?,bΞ[oQK(V^3CU@y%f8lr!M5@٠VӕwnvO H4Dg *L9كjvO/\6 `*]@4D]g5LM} h @׉ƕm7MK$T291J&k:"w=}lezSHۂ۔ZJ&/1}ځSw7GNkF=H5 pw=ڏg G-' ~|=ͺ)6D׃iT@dV8lz@g@G@O /wKtI{vK {ulrėC>t%^/^'ϭߛR#{{mO?"DSZ-P$L+ t%7?̲}ҩAw_Zji uM4MO%,J 2D4LU=-*%JA4 \5@/o[v\q ;Ɠ>߈g 0LՂDi-b 2D4ˑsIO+(Nx{h EQ־+%71W.-qt@x!ޥ" ^m*̕Qa^eJ=JW6POUDsqqR8=,E0ex=֍ԴA""LrXQ/" PßJA4""=KlۖUŖv)VK\w@3 !PAR#y2>#љH%4-TS,'fь,0+'Ϝ]{nᰀ!Z!D"@FO+/WΎJsOڭXX%7y(z8X~3s1IwS\x\lHؾ/ar edsiV\K-L.*% >WZ>(wak߃)- (v]G|ϝ|Y|U4It (=`{ꙍ>0F5HhX Q[pc_|gZ?X@q@TIg@|־O@̿?#ߣ l+wa&|ntH?f^\-+.oZ⥾qp-AA%@oMj>oYm _6X뫩jt`X@+Rx96 ⹓˂ _/6vw'X`.Y Ƀc+Wά"p]ά8ʡ6ó}|[ЉwYq u8nJ =ˬv; i7_{~im'TNXGRII 2)n4 {Ve?fR37u??@뿡Oݖ EGrƁw74sE4L &}<3s8y{[G~|ˊ s_ًO`+{ߗv%Ƕ;,wTNZ3MAG=Pw =B Ytƿ~Ino+J/})aVeIE+Iy 넉Н~IeUSj3g׾1m`-i(9*=_>i˧w#j<_T*r.Qn TxR3 TgŇU^=r+5LWCunIVV%.뵼cQ׵:(fs=D"0l@0Lhij(MXZT(?nHsoWZ}i7j۲uXtS+ލbƉms NM.G%[ >z87J~J?)%Bfө ?eJ:T"`V+lp*lTN=Z׃i CZ5P0lyؖRVtT\eU*ݓH9 Z/X$*Rg2gs3RɄ,-^=`ێϾ{6 L'%?sq[@7$Tgx7Q?@)۶u>!sOuŮ1tD@(_ Ly%O%K|?N3K![4?ksi0bF@EX}x[={ѸlE$Z3FU)VqR)Z\奯Z;pFuf&4MpXFUt8!F '?|?\ɴXؖ4 t6Rns~0]HunPԢjKH/q(G9͝W~ѰvؖxN0k:aU+ߣ"I3[3g׮>\=F5CZMt]MSgV' a,K@v`abWVP:܏\S+v<qlij%=ϓD~JaR;Ǒmi5`UrƁw74sE]TM%lZX49E}=}O@Ց4~W_VǴv۶9 ǵ|ek:N5a-m 9@nO9ﱟtu@&'\&-3{sqaJ4VDxq`{m+ ^ֵtw]ql[lEQeeuUZMt]-?i(Z`8^2녫 @ɍ6=TE a۲jJj׳WO;CQ/ ~ gg.7tsE&hp-| giK{"`=ӅFUS@bE s]#X3D'MEU5QդyV<\4L61@rQxjIJک&8舌=DZe-,|;T"]<OF StÔZMOD 0j&'z'< ˲dg?^f6.`0 kٞ%:*&Jĝ]WvRt/}zSsz ~ˏ5nF{s`H@֍zZԐxX aL+P/O3%?}}?W6}Ff+c.1 t, ː0PЀhz"@TML߹t2g\Zx;b ^#Z"}޺#"B90Ϯ=gi͎Al,R ߋ-ےl?{n SZMt#;c@(P%DL]7s)Jxr]7<L+= 2H;Q?`V c\z4mQ"Y.Kx5哏?|o,t偍+=҈ tᐕT"@dA[pVX;)wߗm&'޸̵QiR_= ?@TzT*|+{ ~:k_~I Q`4J$1Id+50p) 7R@3 IfP|  8(g]Z-,ւ3H_O4@p ڽ<8y&H,z-DU;pq `%<PF|)8yS^h\Jn@CtM3,  ?knۖVzͷ~}G:vGD@͔QK*vId˝p=W\'hj†~';[["B(y>w~K׾ҸQiQ3DD4Ī} 'oewg[ͷ(Ov7,}wmciHiU O%_(~pT<\Ogz^~ GZ8ѫ[ߺ}땉?#Xگ0W}~~aԓik5#Ѿt³˶mnmyG?\ުT _}ԙs1%xXV"2b sQJ@QD|&!;)Qߗm@9-Lgϯ=uˍ ]7MSjӾtӮ| <8u\(j&ZQ$=J'eI+lhMb]@>w~;Y4%]D5T=Sʼf&<ύږlݑ*;~bm:{>f HMQ5@p LDC&}_\ǑfP~J36WYÌau҈mQU'~.o֖[Y?x5 zW4]MMSaOd^-i7!58@,I_ԃ$@T:G޾4v2O7|F0MjJP/O=,0n8 -k@߹8-"[oPIQh@LʯDb(=\7o[ۓ}O^qjOKsm̴jzlQGyJd8p͟hc'N=cίa" P0lEe xX&&| Tr4ma쪦ت^@ݶ-.{𑍇{XDȈ tOVXvhm}Oۑ; UoTN;s_n}u3-`Q/y^*oKs_n|L_Cnwa;iӥ0fL$v[nߒ[7?'_yί-5c@*Q5h2 6(T aERo> _mf] = TMT*Ixnguo@w8#RSj5Cp`@ЀdQT8έ}@ʪ7C@Sgϯ= V?dp q$sK~wɵ{q܅ttJT 2LhjǓ;@ :nGٿp}q}a]Ϝb; v[ܖ'Ïnc?`i%tl0mKfj!zdͶ?@e#y^[4l#+/3/gf3ZJj@_S n{e;%Bs׾񛿳Mh̶?tέrKz<`fQ`smFj~vMfW0QmEpYY= ia'VKvO~e"׿_ 4`~}/ɇウ{4Sמxƥ_J0D Zu{R#sמzˍ/߷n0n =w6}ɜ>wa?4+AʟٍF0.}~g4A7h~v=Id@:mߕ{=_(wׯ?`oB8m`?jhZa'<qıN{{nEH&kO]r Ӕ9,{Qo[XV[vȧ?_%`xaԴF<,? O} y?o|/_/ P$Sw jghQߖ;n}L Ԝ>{~k/4ti֓j&M[M,Kl-v[nݔ~[!ί}WFICt]PhޮXV& 0u1 Cj)zVDU5LlnoK/[o`>3/J0iM.FL8-fS{-7?LnB~ F@0^tꪬ4EtEui6ewGܖ&`N;na)KIDATx}ydWyZz].d&,!o`C Nr/矜c$qv,ab0aI6, kUo˗?{U]3]3#\95]}~.0c1c1c1c1c1c1cp]4 9;u_dRѥK[^{¥Я[={0A\elV 櫧5۾l"p]g2|e& 8ws"; TItLƍvsY{TxIG>`Or BZm)O8lrGz Y{wSn1.]&'eC*\ bwbE.A-$j>r}o?(N| RAa8sqT}?tR%?Xg8npovq]%oa!~q}\xs>xoxp bU)OYU/?NHˎOn[nam jj 97@0F0ExA L82:_ɸ9fg~`F/S\Vx˧8-_~qv-l &KGX>08}$/"i "3.\\_O+dNZ[GԑOeAS :O /)Ν 10ZmB"V$v2l np< @D0*R0M;ސwNZIUJX=<{HKN~+; axW0? H+@j!#/@%mCFMp ;> 7%D"--AT[kIm7>KIqvKKF>mwq'Wob\l>&d <bh!^\`w<8n\i\ *d2 zJNI_a%V*\ {? ZoF%h!j,AF+@+ "Ȩ.܍ \p (DP-c$ɆSI %Áe+uJJ 7w]O9^uqgeUFX1H>$) )は" .u10VPIZ {I w/Q?|9xϫb?q&~1>MFa~+FCF $a F%Ct]2 J/W@* U !ƺĠks<^`m1o-j-C57kk* @MQ &[ #hT^Da kۂ%B>R( [H*ljR0Fތ![IsK8"l+D3Xjwэ,!$"/@`|KB^hVN5t4*ѪFNLӻoA~rpW"3$t…_E0 #n-]_DZ7[xȑa[ k)"r0c \xµ!D2@dg0Q[V~qX.'6Q^xarNpuiսu/AqnPQRmV/ k,NB0!켼Nױx TXy5,?fx>L܈b 8N}YQwgxAy$ 3^sۃxX%soey { s`O֡uFvgQ>0n*BvI9LN_5h#1'a>rroԅ̗鳟y7^P"PkD`#("?^PB~jsh,UF/hJmTAeYhaks0cH[ XYJWcjUd pjpV8q1",w 3$[0Gaf?r]Zejk]Sch7ϡQ=c0.ax,Ft#@ X(-\ƟF~rD9DdcRbGN"]E֠eI^H/& xs#w<'w#(ar tIgaӶ8Xqf-QuI[ܮW#?Y9 8Yкb c dLBj%q m+j\pCTVe\6ORahmP"D΁˽C8 v]㘹V‹O,L:祢4S C{}fe.2m?`j嘚6.uA H5f%Q pIm%M8Z5j}9q$!# 4&ɜ1/(aǕczͨ/ѯaa$6zVd"#Yb A0WPػ(čeDw1y@}ƶ?,T%.8%B)$LDH%ᚼu};pX0mȀDЖe8Nӳ7cnve 8w:B-E@2Q! 0d[|mögi2+DdXdA|YI ppa7󥝘u#0qٯt]^Faz?v&goXk2T! kK6ch-jisb1 @l;Ȩ 1heD\xPIhWdP`wLM.gĵ}X<8#-<A7 P܇+{ &mH#aTw!UF*C뤓DFg#P q4Sqe{,=l 1"YFS'\/%Cxs"0xy`1./ƁW {O}{OC&]Op͸֟Cˮ!.\֐qa}IXIw]h,YD}(|VW*C_x1 nʜwFCmAJk:mXx3Mۚ{o;z*gշ¾ٙqhJ5+=^wľIؘ8`Tҳ* }Z7(m;Kytj;gܻ&`~fKǿ%w;t ؑ$w=Fw0%CAv `\@X-6XooM8"(6Bw& &dhWd+Q /h4$YϞҎVijf@A& TA^1 D] m'@+ö͌ ϹiJ>4Jn^/=V4!n&6J!(N#(rPJ1VklщlԛVI*FZDedҴfg 8ۆm' GMsmκ^l@g4d c ZiDm G4WNr*iF0݀V ^nAa+BZ$ uS@3Fub_)ĢcLJNz4nEabvy@"ί@H"@ru %5ⶄ'NhGX_퇷 cmhm"CUlУWJԫЬJ{foDLlq9ra}eW܍U/@DRēU;Zth(QJxnp 1?aR$zXL_7νҕ߰5~GN%!ݹv1=D3Jݔ?]eFIҼŴӳџ':>tբs+#%p 1t!|0d;_1y;I;4<x<[Kp_xw:Ak]ȴv(H狑1¦^%W8T =_1i\I`a*פzJZX.SA lRNt~/ 2)Bf)`3z3qߡupW?}ם'd$F@bt:b L(/>zkPZ(td:dH*|+qƻeehJXI!\oLco2#\&'? 6<) X@1 kl~zJGXgU!Fq*ɯVy_ə ,V- [ X<-zbNSWpaG\8+,ܯ^#s7Wꅇ47#!C~۹ jգh6Ncb*ZLL]ݿ$k]3F8BV;~2 9D'VPYy_&W5F7'xHJA%J_`Nkɹw-.B\%\Hon! h C-ZǨRr*iKWPY;^ 7YjDu9,= )AݶV{Jd`t%4R`iR6; @N`$V*GP'BG /U&M,j壝!Fͳ h 奧1՘u TwP^*^t:f9t| N@x} Vݫ1Pq&LR6 Ŵی j @ۋX8wh7Vb+'FGakg?PY6}(l&$`B 6BZ70D cMW'3yINH"9eDhTarzj/"* l/A>Ҧ6fLMER 1p.9v}\^S &:׃RVFuKH!ŚP NX]lϪi658^vG`@Zu%:)x>#l2$ZET [բ{ 2n[q3b *I`w}u.qnv>U +ysai *_`VzE}l3WoO{L=FC:]ą |{2'7y 1bR#b[I%zkl6\zF 0aHI$[(j(;斍6 t ^7i8`.8Hf%W>ΊYfNBCyMI"ؚRo-f"Y1.T `CHݰqZ`pnH =7K0%S (ݮApKױVMsB.CI g[L`Q= :}t;:BV0Q+Z:h I>oDbY:J:<. M SOM>\X2$$" 8-Dq )7m I%1NhQ;7`U.{Xp#S@`ƀcn:\i绩tQ! Amw*Qm_0&! F,.3\gy%QuLO.ak/x=@G[7 nh`=޻ͬ}La hSGw7'(e'0|[ Kneׯt$@oj|1FHULy@qCXȐtʓut>Ҵp Y Ȍ~W0i._K0Sm{Y\udjWTgνh1/ILbt;֓Lu^"0љHz7l.YpVhaAC"MXFDB:W'r׳;1։fɞR$IlwI%}.` C/ n`d?s+MJ m7wXM˖2r 2 -+ܾ·1[tY0h3 "Cd1lΡtr8^PԖ:cBpO UZuC %dmyUb֝uM/Mֱ>CevƧ%8YNnd^"5Lo:π.zpSVm \aZ1^n{ݪEJBSb L↝yp|9™ZD0guݭCӚ:p ]YL:D0s8~Vg{a$D*lU"]ߖgG'S%@{*nWJ3\A1x}oxtĪz7 :I51S R-IdAU-WjdVY\Tb=t`t$|V\}>kPi^K`%|6fHZX+(-85@ˠ;a٢3' ZْZk}:6<:9 ZMz6suP\Qv WB2i!͈k:DޖmFJ$JT0+}S53uHe:D s7 CX4bk* ALtm1p q0c M+WK-Iޞ=3"T/5D&P-p5[) mҥfu, 8n`o[x%J[C t ݽAz­ F-$J#FpsDW'`ؽKccq "unZ{&&Fߵͯ+5sW pnS9-Sy(`&@!U=&uv9frsxDŽ0&rA."@ [L,6X׿?ѝ/'zWM)¹ɚD+N~ @T[ [%[m9f4`. s9AX  &:]:\0$h͍ZRJ?"[{ w8:7+}RC0շ.9-]d=ـ~wyij8Z-}?z$ۙGng]rz0qGw(n oB`0vg2Ɩ?=6UOZ&d=1)7KGnޖőpUsrt]7s]0TGC>Eqp`13[O& u8.#!P mN"HT[K ȊD؟Z uS,hߒ>|XM7j3]7/csl7:E:I߮;(w[73bc90S2#@' .XiɎK\Qr0Z+(%Ds98q B!Ŗ|Sh eBzc䃏(r Hxqg6Sjf*2F$O7ʖ p]}=RݾW5A@z^7g1-E tWN ]c(K\B?1t}4cH0FZ^>wnmRqm{pq?K4DQN2H?[\j:$&\BarϹ?#@P(8YԖqE^"Z)UHyKׅp8w/JI,; )nLֱBee{gYbMnY ?x3NdU>euo__|72}nc|cA>X+,/0F3DUN) 829l/bG/TWc?W[m;'}tw<`BT[*jttO=eE yǦۋ=~.w ΢Y \A.S:}:Kf Ig[Ƈ翆 \~dPq/QrO'GeI콿v{|?8J*h ql7\;119A.7# }$Hˋ 鮡QEO7{K=[l Josn+~O/p8t=Raɩ@FZJ$n5_l7+ g0QP(AQ8+KYn>aZk_v~/mdq áCtXD˽u݁UH Ibj6V_>ڙORavb _x^r(//Cq>٨V>_S]_tdL1?GΪtH8n7P?/2[v sBp[-,-RQ7ᇨ ,=qUqf}b:r{ $qYo|&,ǿm=N^UįVAO,k_.6^8xMMd\6&`YT+F;gydzt]-RCRʹS^_F/idϻ3PX޸8p̿ ,|e|mz1CA ᄍl4jÏrQ41./3c1c1c1c1c1c1c18&\IENDB`goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/16.png000066400000000000000000000012561334742672700254550ustar00rootroot00000000000000PNG  IHDRauIDATxkSaƟ|Ӝ1)mvAtt JqpSDDpPq pq$(TtQZRJmM/19\rs؂> }x9tU[Ì3݉䯀;U]09E2Sԫޑ!@[oeP{( _B?ל\_x<I$^ۮ UEm#DERJJA{Gύ/l3 B:?3$QD3Z~?W PSyEVe'1?i-O<IfO@Sp+_`K΢X] \n~iAJVZ2BφBNgSTR%1;e`Y;Q5wxu0F` I7 e~+'쪐KmMVJEBA@(bAoGpZVWC170ĝDA@y A!E~2ϮP}&OeVdJM}a2i X172<,nj7;jYsj|xrtLR)9'srԡ_ /m_IENDB`goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/256.png000066400000000000000000000607231334742672700255470ustar00rootroot00000000000000PNG  IHDR\rfaIDATxydW}&XsM,h ؍lWŲoݶnhgzO=c{zfi/2㥍X$*T[n2^ȌǪ̏z*#cyラo2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C @zaq?k-.JkF念*z W ]jӧA3!#}S]-u3S~䣿cM5οQMC%gCAVp #)˹V<׮|*t6<ǚ齿sڅ2ң'T>)xkTNA ?]j> ad0%|w7sGʕު%ГoUNIGngwjO]zϟ 7V_NM]'dZ& Of8z}B00ϡ_Ӡ^晿|:z]'h^A+ 5d0A͂S__ɴAF>F:џ73GlaR@0_^wj_;}/ZӏWbGt3w#զf0")BU /zOڧO~, 12^,!)n4cNP-A5^ Zx\[S<@0s'qnm<u62##1p)mKGr~@3!R/x9X{>(,fn"T o+hәfZR/ _ 柇ы/fZAF#B)w]E5#;hWΣ"N[`a8eX9h r.!@>ڇ" A5_Onς'?SOʰ=2'O>j,rKۨn-^vV~ (,C-hpЌ HBʽkT3`:efu2FZ V5tk_'XVpp`<ǜ/a&H)j]CЮTBĴ8P B#_-t :D؍p7 ,h#p|&4̴ $SNi/i~X3TzJBSU>S?=!"@`Xyon0 u0ylL+;x8g{]݀"M2y$LD+UU إ}]!ň%]M{b~Ŵt!K|N k&BFtw{)%$!84q T% *G_Й? (T_w2pmsqHq g?gX꦳L*/J0=D0 KhwGY# ~9Ǩe\pjf0s0LU xGd 对CkT_?yY\/T]vʶՌHUޝd}ןРS hR@xr@֔y5=^V0{hfnݻb'x~h<訒`] #JR2mBBjLGu.̋2 JЃ߮"*R:/0e`f uRr _n9G ."?A3@M-^ ط]GzݍɫRЈ$IpvRBL&xMUW᷒"iY80SݩR@2IXð+$*7돡)IRoj__6töiRu 9{PU{gHnoU} hV_D\(Kw0 LuLP{$z#% 9dd͜t̃"knW^W?1bkơ%SNiG&;WW6/~@U]ܨ#_ygxXeUXkϠtJw-xB? tO!zx j@7hM7Э2X]äy "lէta3CKX|,?w)S %BJvfG^o 4k"ڤT_ s`ː/Nz)$dԿCU)!%R&UKU[4Ԕ' Yؘ0- [.Ter)O!ۚ*pE*~i!RrPYy ~gska:TM4/ WGCqVV1}L%.1s=ɔV02x&*=2I۽ORʶMs¡%<蒐6XHTb_=-Asm{#y~ ;\}o1o'GsKK[~/Dj7iJ[ؠ@` {5Y"kUJ¡%g>#r7?T5" !y$(ͰU"ICSoovUT~K)VP5tZ+#(kmkoʋwbˑ//|z[^=n.,/(! va B ~E<ݑRBB6B5CKk7+"]Uas`~KW寠, s`(.`iK;µPu3 .%"ŀi#pkZ:S>)% _AP8->};}]F 4H !$ #vCFVN걷 wT yj[|| SƕY r@G )Amw85CMVaaRrCv;v2bTsToU99 tЮ^Azߊ[;ƿ\޻ V!*!Xh6q<J[a%Aix5IXT|= am`]W87o'rɏ?v] < lI/_TE I!8-x 9Hx!lIdꀤ/Eҿ,젺M֞ߩoXP!6iZ6joY{NFt3tH!Tf:|oo@G[鼢]]WY?uCMM- oma VtSV_It>.!7w^sex A;' `Xzޫ\*{~sتqx eX- fE}0D}XAЩ#p,\2|.n5B`Xn$:L..#hWiD-\h' \=@-ɥ <*BcR%^!3ۑ^a7Qm-Ѝ\@SU'']9"f~ ArB 9Xj_Rhl{~tVAۣI*,"pkphmZG赒ɸy!jJQ}Z9^q Qx&/4:wrysy򽰜9FZ4<^[MQcW o"i':WwÇCM7;[FQͰa8%Vq];s4Â3wK>vr@b(ոF#P ?MHAJ}G 4mb瘉 UЅS8܍ {Ñ h$M!n ? uU8*y!󮫖a>~ J9vi׻v':"-h.zhfoY;S?#Vp*T苜%I@ H _7(/ pv6}bJnSI[;XH;wk{?PӧȄRniƞwrMhEN[W8ͫOM~oxO8S(;HDA}QBcdZtvx1(հp8~/T1N1`![ ݞ4B)%8sW/Yo| yݴL _,T3 A7/8pJG0~מ3hTΪtWFT\[<+{@) $T粭0(o=nooa :UtF"GHGB"+8M0B?$T:|!C>|b$!xڂЭGE'`0hl_F}95vGv=],^D6iØqkJw8w #wp3 <TXlzo52$ӱaJ5_:*:Ԥ &aD &4RJ}8j?=*TG?+7<_Au;n`K 2 ])@P TTot<XCp";8Bn-Iqq:#9vDі[ ƙ׺z0 A &ӊ#Cp>yB0g{&yB,.݁#Q5T.͋. H *5ɖ Ph$v9 y_+@TN8HY"1L=LF fthIG@p 4 S 4xG|熠C!%8*XX7K_'Ѯ]LS]DjPS% 4DjC3ǁ٘Qb:eĉ0oW0ᖼ".$i "]Ɂ@{\p\HK6 49|#C6HB78y#?oy-6/?OAH- *% *\,i&D0fKKFiv_2շ߭to)Ꮬ}RHdoC #mOH!:&իz4"$ b"D/鰘;ga۟(*>*@_ ,|/|T|4d;b"R9!@4MU/j\S<M3'F5PBgh规L$LruϯCCONh ȬIA໑F`E/j5x!8c[v*)EѷiRfpѬ'P֥ZK)A)^2aB3C HƔЗgAr,. 3 @J `*TU_SݞU)oRV5WCgjAU0й&0{# t0- _`4."s戛Э2GC}[X9Y]x^smjLtIBA$\ x΢Q-5$ zˢ.; ju`aT8IJqTTzQf_*2B{]__$:rnev `0㽝>mG`)"p,G4[`~琴"tU݂ㆵ N2D P2a( h jOȱעPnW7u5a~yG~{aЎ ej-1HR&2s~* Ɨ0+"T~T5@}7$<CQ>vnx` Cr[F)%,XDi.)tG~M@ЮL'H%ѭHAXRp:#CR"B@ 0"t <3q;j:toJ"K=o GcG"0zANy:c? {C|)K}Ղ/M{MxnVzp `36iB<` 5afAc@52UȢFN Ga&!t/|o !B; nVtE' F*&rr)_v-2U\?Ǜg^1=>rcM#j8A5ns0L, i9[NȡT r8zۃ\:V^Wo'Tܑ{qP%һY}~0mP{tw`^+vIyeЯj~p[>⺜~ "lJ!jwRLVG#`76ՔnJ[9a`擨<>ʥ=D{t3wNţ`G'ЌhoU>^RvP!.J]<͕)xpv%Ah76)KaB娡wC/)vZZ8"N܏Xyظxn{]>)؅e[M=> $Ia~~vvCCKzQ@3 Ǭ8fL+Wn>a4 "ӁnX)"/I5^Tazn2^*߃s_ƅ'i\#w~7rKaUEr +)ONξt0eK! nEXBe)4k QeuF). !`,M6x# :!W *??0{nؾ B\P\'nx5)oET7B@$c.vT؁v~?=B$4"*05t+ѩ'j]0fu#_v!{թQȪKaA3,pG)"hAUET3a-E\N tMe ?(  oE]yx_1Wխ:Rw罂ξ㡭96g )!Wq1P[x-8:" RU ˦`!TOqDn}ϥL59gະr%X"B,d?)8:D]=1/y["@}y4k硦8 OV yp]&3BA]G.dR驓R%`` aT &DB!xE [}] B+Wa `!G{FMDx\զ;$e[39-A @V#һ% ,L%igY,y,0I ۓLSu)="OPKp+fla)8{-0}XN(Dƫ#D `~G :)!}"z)TsNgG>I/Âu ,L|ʚ|#?}'0/.Ec`!Xڛ*`5קԿxC~0_H[bQ?BIUuЃJI   zG;YGun=*+kBk3AϬ{JKUastZ+Xމ`RA1<pOD~v튲y/raׯ|g! a`!|G'h!*uQӕH׾+m'2 ^g_g,Dv"SbR`4z H!갍j h3A8}zUR!^} }aNrLDD $B)$ imE,sƋBp YD ӄQB[ACh#>~&&@"cڍzl?@7&G =H@VȂ[n\+sp2`i"\&} L#}$/|ĦA;ѿ Ic $[ $U B`CungUJ#2 Э c]|rڞ ;YnB\nwq&'ws\m&C*1~ɇi6G:FT2+9WWӎ߮_ z"{.Z |w3bҦ@Ꮖ 4 Sj7II-^KN_mrg 3C=䜉 tګ(nl]L#rʋwoK4gK6{&&wnNgu=M4]ӿž !lyh sQ'ox\=s54h7Rؚ\z5h7/m"?W L"vCb'gr@$ V![EywFاUBS3,oo Kl3g~13 q)զ)DV":'=Y h^\XS׶Go/ ![˹V%k`>#)Սt;  q ]z≙$ȳ&ic@`j&nN0kNq޿L0Gv2${[g_B "߱(tK4üMr?wsnxя[~_< lʇ3Cg]c82vMRG9=N=H(aAz$>tw- p~w СiwK &$R5)yHcv~To߇tӂU<嵥Ļ3vwӯ8@lA +_Gaha " t`O}o~sp)!nM3r--#ě?TN,@MӉSD//mbZ@=RsT}=9>]d)๛ظU$ʡB jx* @WiB> 8z~,7L$FFhfٯa} `Ϟ=CX4Ku$#CtW/ވWL& *6ןFs(-J# -N @lj TJMtĦAo0_/-Jޛ}ʭa<{f[|rӇjLlIUp ڋh7/R+W<AVC0)0B AAJ˯ļy/t}bwkEz,jςmĂ ^UQ<{1tL{8d ̧ByƳS \_pڧw˜J' 'DmcD  PhIn,J~' 57SȽZ%}L&LcDpg|$JP^ =፴;  :~緔0`bn?RJP)![%&Bn07jVuF}|Btr幃H,-]8QXBVLR:Fy_Bq1ɱG=T$Ԕ029¸_o"&M7uӾ_rqa׀3sN9YWUfpkQ*ߪ<ڣ`Zel|[n;WJ߭bm>{12=Rʮ%^'ibP2٣>o$Q' I4M7!u3^F0DӠSG!7]<5h'KE~"&Vwa(oҐB07͵jRGI){U]~Սg1t'hlʪRBUO"js)JS @_~AzC8 @3@c@pzA7<Za62fZ+[h2`SWϢ<hD0B7u-ImcʗQ6‘+I>@ zX93'n^+HI׏|bXtCU9=Z"Rfœ m:Av'{U_2ڍKѸaP4Hä*X%*Byn,{5]"v`=l>/e*O| R@3,Pӂ@pلHwc_EPcmL@QgP%R ߿+_۩lL~D}IE54gQ^^BF赵K_THOm$[;%ɀR("`4 A %8]0M ~@vll3Egݧ}42kؑz̀Sclg_ODFDU6(ݎ>混N Jֶ-Q BMD"Q`0PUARx%ݝ\TO3f-7Ic+DtSO)j Q({ v:lMt Ma" *#RJ0)%y<́491cBӵAb"8ٿB+G^<6מӃ-i'msmw$wM>g8 ` ,aat 0 ,E ?@Hx\y$gK 5N``aWϠVyKȱWX FywgN]%! >_tXrsm~NmMF)%$S4Р4݄4|!Ĥc?A1D~Vթ&7L3G`^ `ֲcCL߻s%̠Bp#U6OzC8 R!Du.)8x Nۙ RP?<ܖ#nvPvW9|կ4$ns t:}w2ӿ-lШBtA OHY-!!8? }-( @Aоb2n4a)8Bn:P &;ك)8 |_En0@K).~#JBzRt@ݹ~cF?;=RpA:DCvaԧX4ƤL@rL]F*`q`E 3tj]0HDU{FS 450ߍrFmRJ"#!) N.Lmq#`4 >(z}DJc6ePd}ίiQv^+5'&,fݾ}ײMGKA٠LcMbp|{àdHȢ:y+I4=*!M'sTn9} >"aN}%Aځ(xwЌh'42#tP$j\@~mRvd@wIAJ1 EvLruڵ-jD̞@n䖖P!&(˜80%TSe"J#`a|. 1@x΀ڞȪ,5S}٬Qx`Gb:oy%G˴" e+o?J^z*p̘~om%6F?0pYW&el7a"ѧ{=G{ n)p_$syb?@Rj?2z;_GL&0D4c)Dr¯)8sfQ i#!N!lr:?O!y#)_/ R0 0/6qáP-gX YJ j(]l@=ockXGS>繮D%DǠ~Ÿ>נ{BB?wBrryaf43A@MQC B!$~IgQJ^, VDP'?9%Ѩl>-8T$Q? DE2/XQy3 ؁Lcv %dtHA@(!>ɓ/a$;逬wNq pO*ŷ7s :gjtPB,h;mki(sGE1F|Fcf  ̻'A vx"@(MDF?Gw/SdͤXRrU +-9|dP!QJx}j3K<*.bG"~ *p, ݱ]Z2% #\pJ(B\DUM <G4_SVEIŵէh%帎wr8^pa MDl:1P- e 5S"gۖώv'?]:u䳤@Ӣ:!X-@ dh~" ܱ j"0`6\]0m5pÜC;L;LL-vGn7֋l5nE{rIv `!Tt+ʁ&@=?"lC㖗K)"[qf5@`1oXo8f&!@F$2aGߠ$/bAS>ΖO>~3 %͟܆^lM(Rw jj~a&9 UN"+246fթ(Se yW>W<4-|] TZ`~wU_\ 8--Lbh "t ?VafM3>V)n]t[Kh9S;B@4 fcLFF8oIC][:(J@AI }Z_ˉJ(2enG੆1 xg`^낒كښ9kD9S=Grxݭ%ܲh]>Qա%xtzHcBر>!2 JK0rm}{2A2S\ؘY8}4,geG' 8yK t@,m;yϲ0dgO;-rPFA"c@ Oe;G8 K&=`f}$6"QJ\00X}}RhqCP=8!=GBsI|\0bھӲz҈e@2tkk"U<=@ !$pBlZV80vA0ga1oJ(l*ҁF;,$4svxo ]$m6oRRM_5D>i4 ōHumKMr# FFÉ =R{tt;awI9ݿa FZـsLa9 ?H.N6E4@%`i{Ѣ!V[ !"ؒ@( IdFNu3۶q =N}'}hk駉 B?#em3($Ä?:gK~L@Zi8 cG5/2\t8+vĠKw4,P%M.$Ht==tmyi @6|نbتatH9&BPÄkC:{K[?1p__ڬBP|r:*njhAǼa9 }>DH`$7u)Y4˝9GhK(rFLo<7G!|01СRf)x'd07!֧=b =W?)?+1MKۏfFpӜKun8]G(Gs: ˶ @×` n^ߩkpޔaCjM#"Н%ؐk_4FڨOqQL"?zBW/^|Vծa(ْBAq碉ntp; DbqCلe- /ZsBN2sK-KJwI&&xLrǹdJhD@vc H.4-XvhTiTD XiqxLBƅG45AYoU}7Y8^ 0HTX<F<'iǾ7VԴ?;5"G753@ UwN@ar~Jkk xԩSYX'77ӅRr#a\PҦ:xKA%n(w"&9 ӄm; h$Dp-C!PՔIY<-!"f 3`엾tlo?Sډ7$܏v=I4pZ=7$ᷪ;F ;BW}PL ?xJP*ϽqrS^ew@ )\Õ`T2P DVDZBTT(hktBj3z#i\\( @"?'?Un" !/Gg?Tcae8^u¡HEq˜[' CsA5'1"`^A10k\x衇^vm'|N>ƞ9*BU7]dļ9D s<Pݰ !\&CkX0*~ &!j pBgIyo>ZnO3s TDammYL2;Ί$8ucޔ+~X*cujy 7=\z®&"9:n*iBd%` A   R!8G!8&)?~2̛vC{XyJuMR"4vӜKw^G/>>udЇw#w͕~:W(ʶm}\`7CH ↋ ! N Nth]O@P0 e;0-  * s]TVa$ ?ս$bXpHtZŸW2yͺUI=YN9I&R  s?k42 Gry'r͆iQz/ f+*(h7pDhASOR$]wP`c})\0ɐ{>*'ˆm=9Ci(ŒRpɼ~ #mCGo;Jw8>B1!9TXh7j0u މ$ cv`&P6*kmOtS.V6> \5meȰsj#ڰZUΔU}˘A2 裹0R,~6_,vrviœ$@9MT77 f*m&EF.t-lnsiOG0z;/@/{BΰZGuݴx!h X ~Gk?\y}tih*KJY=Pi-*`Lr)ELy=;Bff_[ Ǩ}@she. 5!Qo?ݍ;/ ?zת c;痲z] xno=/jVi!~:suWfw8Grw3ׂk|Q䋥-ߟq44Zfeʀi1֦b|m;NL?(z٨V݌&d|׫Uk7C:woLݺ+W~8 >w,obyƒ4MSQ xno֪FjcBreMS @QQFC}$BxL׍a\`a([ӵz|};փ>>/r0Ds1ll͋RZ[7f[7K凝|m`_6/4k_?$ٱz9kvα4MB4L@J67jRs;zu_j0-o/?S(_cٻkK6Ag?}bZ򦷽X8|B˶5-hS)%j ڭ|K)vF~sxC3CL=RybCdð# YVzm}wu}_P*DT\!i٤17 DNQno 2':uJ/+)H._Xu}$NnlTfu_}sS'O7|SbN!hfp!P؀iCJvڨ>67Lg3zFJss?[*r w]׭תV6N9K|S.WhTzK._(%.FZjV~̙3nnG/|gҫ-6T[9<Ӫ6]3;OCxb~BᣅR,]8GeuFn "#GϿT{T4 @pӪת߸ܨgNmJwXBb|/4҅s^Z˄6!jKˋҏE%K VkVxUY>F3/'ŋO߳? !#CSN9.?[*}sM\_GYYW+>~P>jthqޯTy<FF_+-<7RUe \p\e}vOm8} # G~湅//?j4j%T BF>ayEקqdȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2dȐ!C 2v;l_IENDB`goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/32.png000066400000000000000000000032601334742672700254500ustar00rootroot00000000000000PNG  IHDR szzwIDATxMl\W7_c;qj'!!BբڢTbXDvQ@dQP`b@B(HHT"- RBTB붉73xƞ7ͼqXӦ'R սϹ8nwSAJ57w=%Vؤ\Mܑ#xع1.xZu:'0)Ȁe04ǴO6F yJ0#~Z qTRz1rb.7pC8yCVlvT G~pf2m(Y@np]=)T"4U2Y궟y#T]ՙWk' B%!n ֤PYEq0. 8`دqpV FO9 Y-`U$1.Aҋ,FܩȀ44)q+- t%5C%mxzu P+])܃Odp|wj6/m{ҏ.Ch-ΟX~*n A=[ռص~8^?@kTޛD;R ۫  h(}ĽX֯G`B1) Os `ii1;~ą %`\@>v&DP;'^[06Ep.aAm!/! א +;0Hi{@c+@%w hAHd-tE,!*h7QOto ^' 2 s>|:Ю-¨Y :2*Z}Cw=rԿvI N.z YrcPI[. Ktu^!kdž/[a0mQQ< ˽~p.[G_Eyu!s>dg2p~Kw#&m=Y>V]qő [C*Yi Kex@}`,BAF'cY@uC,L.]n2] bw .0KE-$#(]YX@Ƭq@p0cpHzt|ZkaT QJV` S,mm\>a= uQd5|?6Y@:bX-k#, KajA܀v֭{3T/bwaεùQ_rR(\Jp ,|I kҤ5PIήnεjj = |LI9 8Xwzw9 "9(i"&Q՛[z6qog{>ѬU~2w򷦧}Cͨ>?[<̌'8W_iq|<IENDB`goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/512.png000066400000000000000000001606251334742672700255440ustar00rootroot00000000000000PNG  IHDRx\IDATxY$y 9rnTfY(!`KQC YARI@cqf43P1^f2%5=$IPM^ *T{qc,p{Gx7"nĽTw,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,bX,e!g}e!O~_U^+g}P ry~֯]P[ @qZ,bB>|ϕ7)՞R!bA3urF'_~+`\ `C^x{??K_tj2P(((!xTi4Ns։ X,X,O}W6k~)]) JA))b(@48lXrA 3!:+& /:%1Я8~u3Aԕ7TwXV KK7~ܫmHy Gއ:g}"Yq}Vh+ډZ/o xuXV8/翄׮>9^QRĝN>~/ N(48ګ/:Ή%۵[ZEW  ZŲX<_m?/V7~ѫlVڒq8h8jFGQw~{+mɦV[}qKY+WbYa`Y9^xg+ByuK+!O[16u꯶{G߈?oWƒ}-鏹ֿM\PNmz,U,+ŧSZQ׫x: `<ၠAc'h67;iS_JzRwfo+5v X,U,+sϽ}>ni+_=ի2Mz9y- spGo.S`}Y?>@` XX/t?Wx,zǰGԹ bugT8XX.O/ׯO֮k? eeX $5e i~ٗ/ֻVpXퟫ X,jQ,爗|Gj++ȼC3ݤ1u`hF'{'C~y4xsP[V @eẕՇ X,sU,3bW6%R4YKT)%:Făݰ;}O'OW pK%"idN7WGŲJﻋey>wT^_BS2HcK a>zEtU?J0Vep*W^$Nxhˌw/Y^Bu_*۟un賄V(t)!L; 6:af4?j8>,?pq.崲A[L@RQhF X,3i,K /:>VzWr~e[ڶV2mu-ݰuqHsƵ>>=VBx B:\jz:"@?;ǿo^X,{)O/W\^(sοOR q=Dct{J(][9>(x\qMAh|uhTsK-+Дq؍GE'z,~rF?kW}D[gV?#= 𨃨}qPZǫ90`_[ZS)HCBPJ+H̬Q"uo[[_z3?6_tKk? }fJσCwty5Kp(sAP2W?f.ǯ1rB(jE@$cx峩^e$lY/Dze9^!(`eiZ:/lq2qWs@((e T jB0`N JB BpeS&͘bqpb U,♟'+c/:^٣MH)L {yԬ&)aKGob@( 9&4h`n +1 *řR-hKX~[oZ˷L\ɡ Y~>B G9FG4!/x*'Wh9e3Qt RGO$[[s=mz,UZn?U[/Rlϖ񸃰u} V䀒ZȜJ ڒ*@ A)+D!8s.c\PL^*y6o׿M⸠Ӕ)R^?GDho(%(MÌP6qqC aA;xL@3ULy-\4VWkY_}3?W~泎[b0)|SaqpRl+5v U~q*uŁ^OL@"@17 N4RŁ}W\`sϽo|v/kW՚nKg'WKܲVqBԩI?4V%yP(+BBO!T:O@-B@v?hk/WX2ˇ~KƯny?BwqbR/'VJkf> L0=톡`xx`&}Wqv ǻqql XV XxC?]U-PBv~nbJ}F/d;IҠUL$t#(?@ _}7#$(j܊+lGA88$8^J`K^q?_]E+?,"Y_qDvKDjw?q|5"`=~ "R HG\)y؍W"\_O7X[Q!<% :/@&W  *¯^sK= d i2k? )%ӦByfpQ{V)o 4G+`YJn9LߍRuu+4Qx gKD3UelZMLBl0W71`֤.39+ ݶ^rwx˼?kǫxt̆>4b'V䡎G̸WP0?tR|a新n,$%:Yn8zzcRL/W]236kWW7㢸 1fxq xMSj  #@HFpֶcWq fqp8hsYeIq, |+ި^-Ow!QP~C86YfrJڬ3%,:`Rt P 讃 D(g4`"`s@]_yݏ.}%?c>C+`Y(+~ǷKʣRZ;E" (%qd;fz_O-ExLO}X]UH1S=@JAǺ&<_JԤ.:O=pIV_|y%:6e `v]X[QX?${DdQOq=(>$/iE WaS2ׁ3t X%Xf͓?o<_Gkm|l]w:qG L@4P(ߓ( !L>"3?0{D"!K![yz,z'_y֮>r4YYada J:? '9 [:i$T˔R8.b@TB!μP) Ź!pW2οxxK/U6؏W_ʵ`ne9̉"_q3VV~@o2@xZrJWV BϡdZJGE/?[Q t- 8/>|5xW<ւ6Rg`4{\*7lL8$I28I-R°;x! "uN?+`#$<R~/n\ȋ~u볺7~]Z9{A^zO |#H&vs^L!z4K zCpdϹba=+ /:>Vݸ*W\BHw_ WoNR6Ξ spPF)Sj<I`RM :D0äA)bmGf XfUVO}[/ǘ3B) @jYW'O*Ӯ6֤/0gY^7X$I2J=(ѥnN1@L4|B(>(xexo}:[_ڇS&՗Ye s/xko<[ZW6ůcJ)(Cn8OI0P")w}_?H$e0s(ce`W<`Ln:?.qx[[QQټΫ[_>LraՁ| /]=U7ylƗܶ0Zu4f%֢!d?ӯc,v>6:/$ R *X:?iI"0 % &DC%p&v}I)~3>8b^?ϖ7oX]e'o]*~_'=$,RHBh\wL+s 򴟃MT tDkap&΍$}hyxdK *de?0;.ẉxF(Qs",c`%Bm/V_a \)3<F HS*2irr$ B2^Н `xP.:aPI_-?<NlGflYDt^aJPP2+ M|)|_-c_zw&$X ITz<xIQXob0,/`69 u9%U5tt,HߌrV$ƥ Q1x\(Y2 b3SbI%~<MZ J%Pq߲BX`$ }RWo*( e7Ogh?_,`*`Q. "1`VU0L{1JҦZR:D@P怹:W@TDPb1I%~<}#O糹݄A*L'Pk{F*X>4Z;'AWya](%=RUfK/鵫O|r:{I,@)׏AɃ<0W&NEۺ[p|MN j[7PY׫d7kem*G51^-ߎ#uu1H1AKঔ0>U)a$xDG4LRb J*1׿Zeb0#/ԶbugQ.wiߌ"%SV6oY4h{["̾ pr'wP^Amqm> ׯqj\*%Z_7^ Meqn q+P&J77+%b#}p埄^ ҹ6/sx/caS4n\^e%w̓կ2ȝ Zyw8zZ/o~ʛx@X"_GXR89z L_PJ"8=uԶGmM']f#*V@ے.%Z1[[ZV@]_'1źeGh4alXe Έ."nw{e V''k[[Zc:ݘ ?-Vxm|ydt'OTp>M PceV2 qZq\}k[7~#+s!EAJ1N,v\ (= 1^qp<R WRnAwi܇pHNj#^o`mKI).Je 0qǡWf^B2"ϒDq&N߅;e:~'6.?JSm2)W T,u!y88cEnA=ENT (ծZ2LGzdnY(׃sh`rVlxԆZI|s@Iy(%n4v!<ۨDkWq)Զ_z`i7RWK8~īRm!jAa߆u|Y:cGSFܤqpxuOr@>@}Tϡ0\o ic+]*fS8Fa*_feQnël: V'u`8h"QSF5ZXLI9WR ])=zTX+4010c. MM^dǝ:xN!?8GEԵgZ+8jxm4\ϡ}~e ^)5‹6ʼn`O\ m_ӊ?s=` e~ ^e|8h M~M82d8 Dz)Pm` Έ;J6cJ 3v "縦y xj4 9ʁlw2#Dd%MM&W9u'Bp[ eUN{ۨ]6/?r[!Dfjd`F5 ep5-0o+(!z΀:\ 4'dtޟROKOd~w$@@0%JJ)f&tu"7uZ"NPk!#ao!jmqݔV#}ERr4q:Jl CJNk>vcؼ=UW{d7 \uxu0Gu :LH*++ c}%QRU9I/##05RBBx$U"AHjY9I:Ǧ-i6_vM?j$h;ؘ>}mHf==TGP[[`)3؆l̼D ǫ-?GWI(c+W!Q^[Hӻtr. [^y鶐t+Bg:G o6Wrt"asA@MP:|4yk/Q?|;!dYüwD9AdQ$7^a _O;=Y؎uM.hӾQx ORzfq}8WZ(Jk:l/O,ВbS o>TH b<Qǯ/o05ҕ M:֯?v7%h?އy}'b[߶RQt~||ՙ$HMC^Ww{gFVonŐx [!^yWv8lBiϟ;'?}?>j׶ZNU'p\-G]>GH=u0 ׯ9HuhE9gE{iXHtn&̕8jxu~QpѸr27@mQxu]W@EQ4 y#[UZm_{ >ݷmz-V8o/ ax6$,V$ 7(8^n_"/B-| 2M!Z;w?'P._=eATw6ExN>_xRB2(pK_RA`~|pGl=V8*N_}JK2~ej5W_De2sS;K! 8s41)%i)9>Fuall>CpOưޛTUB0[EAc(Mkt*?#6;_nqZfUNPrDKy8^e.u'QB.=mׯ!h#l iUG)vvvO; w2U⨉78yUo>cp1JKY(` `nYe>XTjnڀʽPgh}2ukk:VId;%CS-D l"h!SNmٛYyptwN^ڋ'j7 *WfPF8 :駱%~s#sP7QA}|;,s*`g 4.nr3ޟ6̌nïnYHz&!-*(.#l"l"Մ)ZO E`V`z}~ېbϣ=cXx|"s- ?ы!Voy49ىU?# @t#+xA}Wep*Bo;c \ RxaH<0MAio J@=b 5)Ep*1V*Qy2fiebv.#>(;7cq 4a%~@7 )!E w 6"jU)V8ȃ;_Q ߿uF2NI[R帩G-TS l:RR !&F:JnFdn0INJvq>1}H`C% R0査Y:F"Gm8GmbS<_53gg P`rl"N눃8~uҸL %B) Juj Q0e:G2@((tZ8::?>Oیu\zܣw;h fO`}#+[wQ/( %ohQ_rcwޠ qhӓb )lo_oc7 B Z+g_BXъ@yq0yGG0f RPPRHӕӤ@@Jf6Nna}(Fl!dy0;h8MԶn`s(W1 shS^7T7ȒxΉW mR@'JLuv7,UNbP%&>kpjV B$ U669Ac(?PRPc*JRϑP⸅4w M8!]ܰQ%E]+,Q sldZ8=T7ՏamQ81Q:rPQ'W?< R\GxX0B,- *DaܲfoJL|)8I[$Bta`D1 %k]чHBj %#]na'HobY"M]h:6`ah174dYe (8ڃ1~aE8U$mǯZ9*Rt E qr:uղAa43VUW3mm?Ns{[q0qa u X}}a(Iޗ] 4$[/R>,3br%R ?ظ I jomz"]9x߸ `#_B虄5x-T֯s}ap4a^aa) uA*؉V܄̇ɸz3Hnf1g|%RƵ:d%~ L}tߘ*PN%%Dx ,Pf PƲd ヺ%P+J&WPZۯ&NRD8a^jETN$)03 IFAHr Aw‡2h%RW?ͧW.MT 6xkB$O) ֭7_e )bRݪzƽLVߨJЃp|R𫗰UNoP2^ Rj "JRy 190Nt 6jZa8^uE0@Oa?~)%:̋F]0V8%7?S[OeqߵSAtA!7BA WsJX|[| D}-tsIӓX%Rp M0U9/IC]c(J.A-g*sv mbT*u[Y-z$ M?W\Y/0Ϳs1V8%VR)toI m !pL5l_8Nh?"H-Ľߓ >T rЏHOr@IJ&jTՈ.*kX~isn%~`&ၢx?7.t_'0:9; %2ԬUN[)7fZ()t2,\@2sRl\y'6#[I&D!H3{Oֻ ?AsBRl=Kzy2c}q-oL  EIAKW$4v&h*r3q@p507CmV5;$IIt  jd ai 6xpG]\gnBD3l_+ Aճjc$*kpKXlz~_*'TJ^6aFBJtwpα )y?}+pK%PF$ b=3F)iJ pBO+ۨ]zp67v"r+?  HAj A(jnR1Z _S(/ w St@Ԇc2IkHY3a)rexss1)b(o|G`j?~wOW906_ 0RlAҖ ծ]EH c GQ[_E MJ)DIZ{x2W) H^~v\@x<Gx, y |%xԁ~BVzλSas }rwH@wl|!(ߍRZЃjPPv f-<%~[\+W7JJ8hOK=P#(X[;wo&@ƻ߉x.@*(I\q PO?w< Sku3}  )!d>TYM8@`?cB(R.PQeT8̾r6At_ZYRd?'ax29))a&&Kzssٲ\X`tuc@8yE@$@#,()Ja#fC W7v.={w_5ÇB,bcB]D3OFÎϫasYll<ǚx$41^6x;)=J5\?fe{E!$%h۲\X`}VuZ Yo LJ"Dxx>D)t ae:$Nn<wpsh^f,{]N P4af2JwT&`&yCEtۗ>JMS[IP҄;i i>xW P;cd3IV̽%pKe`D$Rjt5n[ʼG%@z($<*WB)RɜB@M2 Sӗw}dNuY,33m'KOfI>v*Jh[%y›Jl`"& x}W| a r*̓[qX* 5JvKA!RA^'QT%@Zv7[g\j*4 K e(c:.b w͉|ߌN\QRD dnPvu˟ JCO&1hX`l?qPjTQDK( ım3<#E`&}Wb*(e`nRBXEz +O.ニ#hrׂ$PLWPE3 Jqn,t\V{$S7NBp(bRr"8ô5;"r {o0WzZέ7_%$(I8%A\h@L( _!L20Džt+pJz է>^,, E PŠL4H%t#ZKGroFI&sD x=V!}$DCJAjɧEJz()9_.K!VJΥtdA(tgM T> dgLq2r ͇Ч>_!%K'#d1nR T,pE(H `u! (vã7c>ן3K?}.Ob To+L \d?' DQfqz2@J@I9`=̀Ae~cv}r@O@VE./>C-m=ˏ>ۯ`:qL}StYKƽԃS]90%PRPu˖}[1-}g/0 ܧ?ٯk<]}P/ަPPT+,2'0or&p"E(GB7BE yh!J-L{Cn>7{XE IOHh: * I($ RݡO)@J3ͭЌ yVL$} ~C|f@`()xu`Y!PA$ <( pG G%c/20 xȪs8I@8:>S_0MBR)-hհ8#0P''p8enJ(steł t< l! 7\wK}3!=w3In1%ł?V JAܳ *3@Ąz]=B 9ή1DzߴHżJrE}@v}wzb[,*3;W~y,ݐYELa3x@gUPBPPՊ$VB),&1LJk𫗰yY4D;Z(S~n;0}rgB@Hi%0P栲vW j7t[F8<>AOs1^EUb Z&o/k9@x 9 %s]P Txq!"KRJ}.q+WÇظ$>#/pth)I9$!ߍ+@)]\}QYS͝'4Q}>2]%70s,i?2~JJ(IpA Q),P^ LfN(.#EdM!` +!qt WUP:OWp?E~bB踺<@ׯҵOʃ?5 H$ ΪPqsL$~I?~?|w4T 7=כZ?cɢbO eLj3Z%~3wag3Ы¯l04 ۻ HM\غ 6;Ddy=}ȹus]m }E~IYqcoYe"e7w> *3"R\Z"(R΢^&<r︥3uKC5jW8ⷱ6PTS_µ?Kƙ-nD}}LLo{m@*hTDb ϼ4S;G8-4!e @) ޑax~;" EEeqLՀ ={Zb˿l\A_ [k*6xͣ[ؿ8*ցA cm?Gϱyp%+[D@AvT@k'ya89ϵm/Vz v*ꡥQ@fF0P=SE@'x%ni19&SBGK:*ʣ?7prxL~L qk+[7[HFQ Gߩ1 HJBơ9AtgI׆$%ɼ_(ݿIf2Fq7uguaDZٽSab:x"M|J+9޵M.V!T3hQhE@BlwDpQn/9BJg\(hAd aR9Pch l_8.=x~k?d,m;ɯ詀A_ HC3?P89zG 7 -@)C ˲bk9- $~:м"GGS"^鹛3\O; m< #Ck%(0DZ(L"Г'$2|:WA<4ޟ{mTeF1m"$Q=;"/BI+m Ufʴ4'Ŋ*ҩFw'V?{o\r}|QPtwAT6U8^"c=r8HO_ þI~[JKȭ}S Opt 4uMglvhX`a !-Bt)L"¸G #Jp>]AH&] C=Dca^yRpaBiï -\y~{[8'3COH"pU$ ;z(DS]ˊbRZC 7 +caRTH"i|;X P ~r͒d=DcL:m8U RArӁW Tk(bqzMqWXcѧ JӯB"{ν"? .w(xvHkZr8\[V̐f^\^即>BHT8& 2S  <91C91J84>D>Hئ"U _QJlJ+Bt(Tpuu O*'ޟ&_Ɓ|@'`ِp~XL>QqЬ߂1$w >GNtܲ *3֫}_U޼),e3{x ]0?8.㲌" "qv@ y}w?-7݃7M{!mpK%0߇Sv@zX r ҉";F>Y}?? =Ы OX:@PO>Yf_yf\00CZ}V$yx>F1฀x:ZE{Z9$DȹDi}|aQxi?^]//\^W s{d,pt Q|~cwTK, ̐dNßàv PN"2RC9-WXH]@ u.u xw{˿z $Z`R@ 9\\> L/d?ÜO*R?+ wK/U82 &|ѬѻV|ٜ?H!"M."V)&D{;x[W>KW?jPLU@J]MA@}xbQ<(xDc8nu@8DGZڕ+$1ݓA %9A s8 u L/n;ͱ0/ a$0î@*U ?1(,'|(*%!GqE<'_bؖ^@0cNVQxB+K," DYE|"u{J;=#m'CjSx̶L-{)9B+K88p}6cC"a><0)0|JR뿫 $~L xAh߂TbJ{aXQXboKTU((<{K2Jf%( #"=(Y/񓈃}DjI}TOfi$k!cz 7&8AJ+09 G\ o#y k://vgsJK $⨉wt@D$eT]IK6p a8w|H# ~EyQX{bPbQij$k#j!h--]{URj(J/@ġp=P9Kw{fLXB8}~fQ H^C(쇮UciB+QxVbu}S (!i\@dȼ| <tSܐрdlh%pB ">N̝qZ#Gs=0q)$`c>$XWW~2q wS7 cy[//!ͻt?򄀂BQЃf6WYh$cP eln/VZ6407B@0~EqzC""_ ΄  UfG1P3ϟ=֥gq\QJ Axr O -ϡT<E`BJDb#Xq.46S"λ%D n_tm7U'HM gF.AFRMTD|'饯{r2ٯ7ӿ1o} 4\]9P c7p(΍eilB*͉H˹*6ҩ93 }p( ]jLҼf"N@!ļQ;Oa q+Hl]Mʈ}((@ppθH #|%x6x2}F'}е3{_tnxWH ?}Pxx ODA(Ψr> a-_$R)J+_rRCdPw EwC&iA㟆jfPiEH)\(<B ¿O~Jkׅxh_y[_)"t{h`T_N' Y +@PcH'ơ H6mtA 9+wc*# @X&ⰥcQ`ƽFTxG ! \4+L Ss!Y7ׯ{WcdOr߈EƇ}z_9O7 s{<q(P)+d(HIr X`HEݛ/L_GNGALV:'N7L϶g_ RDR>rĹ%Efy $ |am}MFuax'=1$?.z@Q(Hf8fuΑ|޽Wړ~c*sa1chU! 8F)<@QrciQ ~p_?Gt߄9u xnƼA^˛vֱ rFX`Ø@4''@Ib%^(T2aB )DIut3w<󺀇2zP_.G7<۵B]c+ m}9-7JOׯ } 2]9x_~/7]`HsJc9q**-r640?z Hutۈæqj dLei$5LFF>*Oѹh#/}WM&oGuB3\glny,HxT ~yߕq7ev퓟סhtΰ 8CPEs[%NI$Y0փ 6nk/y],.'>/W"x_KQhgZ= A?0ٯ/?D}=Lo1)Etc!0*]Sz$gQn>?Ж 0u@\l](V>CeX`BfXz5cmշ"r!/|:$ zRde|޽/{BEw1(x-+sʾ>@m0f]P׫(#4.=*lSy0X`mFZ9EX|O/m.mh mע=Q֓}V ]x<1^_eUL8 [`<eEJAҹ/ISq2m}dg*?/T2f$1uP*m8,u{&s'eY<`9_eg~_}ek~m}[ͻFWO.[(t7WzP P$ R)2:~+]؄*s %Ѳ*J 1ҕc} ngL?T'GgLDjʼn0Qg#7Q0rL#4EEoWW:W(KW "*>7m8OnxZ0NYM敟>cVpLJoasX|(g#YZS-4=Qz|_/Mæ?(-]Zw!e eP.\AG@ ¼:<|+,;j́F#KRDy3lyռN>wy07 x<}EkBgdn0@F1@7rۻeM|c ~?Vu@]@ O8z֍ȣ\/4޴yˈUm8\P!S."/h{twD`S2;XEe,7digOr!jE9Iq/v1#MqA(R\G㗾Z ?9%7lc%*sh w{U 72i ^/X^Mj'ϳU~=C@+=~?WAA@S7M( ~2-BC8(ssE(Pǥ-]~N9" _{}_N{6O <FXݯhq?ܰmbRr5@ΥIEeyl>Ȇ# l~8nudB?[;9G0&J?ĥ:Vw?̍QSV #5]75͞U?nz@V®?ߓ+tOVKL3,)y@# !q@eUW4ϱW?S&jz֟4n*s",tV(=$Ǵ*I se]Zv ^Bz?|#GL"eIʗE|A|Vv6ap>X`N(Bd -s<]!cLTR 77=;hX`Nׯ"ϳs/@_üaHXL̀M0 dԚ)WL)H%nkAIBGPɵ z@: BP|៓Cz4-# A1<>.y`  Eb|,DEҫl_sM>䙑wsZSܽècR- Sϥh[FNafJJ$TiE)H 7_Z`P& ae }7 ̉eE 6ZWMtiG6GMe`:I{Uprނ=}yK_jED` `D1fQ2i zF #2d?Ko 5~A/wX`N@E D;h6`mQΔqenE=;;؈ƥA0nɉNqg8h )*Et(6DZ' w_*1^(p5w!%x NG@(u@$4vw^OX/?xyX+Xh<0g'慗)+֖aQoq|Ro(A~*o?BяG>2 i@a/`_%>w_Cʇ|']ŅPjJ)d;z5@O5bIcs_4RyX`NloQwꟃ$Y,me47N{Cx>|a(DZq~2돿5#2r½o.˻ R]|aP97(!U4 eBVHC(F ~Y7y_BvYOo,+W@#w_?^b9/wjǫ-\*fDE+Q~k7yi(W8deOnZ_+?$WЉ'puaܦ{el^oI)h/RZ8n (@uCJ(dA]Fأyh"X)U~RD 7~?P)37q-~E`sr> ׫"=!}hh{hBm.?R0.J<% ֟YLU09z>TH2yPFfyޝMY , 9^G_y^Fo u aΘr7*ԏ| p3, ￁F6jNw"Q׊E` 9`دt'%G/8} w {O?BPJB@Q v0ʀ?EX7Q??﷿DR e$ˋ.:Sǫ7n<;E`nLzQ:m5t8l{]s qh|DZ$*koh?㬜ȗsKwvT?y JL$6BuC!BЕ9o̔ Qlc/2U/|Q ]+J{L8FXM)fCnO C_|иY" aEҖYE "D 8R9XXyw06<#`|BID`x,~@'5On`UQ_܉)o3eIx+L@)z#/BK$/*=[rjWnš>c9?"p^8jh 4ϓVwlغj nx uɀE@p;.i@7f %az2y"ȵFO؉Iӕ!"O/0jKB*sDyՈ"?yE`}q<(]՜^dٻFyԋOʸMN`mll?pr|ÓGM/dLE-ޟo -L{>E&Z$P'ЀI[ wC<s ~V~$ Sa5GOo5ݺ0V#J)"l<ъhgp'Q=8{E`\n_Rjd]{j7ѨBzWpu |?gu쾊$]FPaMQmK{ Du?)!9e@%+g~ }dmH$' 9n-/=qrQ Qx oWNǭe@P"B!:8| O-%i"_!b_/$лd-RJ(Jf: +̒PPXc#8CEL4b 4kk@9֯EfNsW;p{ؾqln=iqgBеRižRh5`_! H˼g^7/}N( E_AJeTVsu!ώIZJvj:\0VXwfdQ:GڍxR0|NkG{cPۼG1n7I<7@IwmD=|N+7O2CvK8bp\RJHɍpw)Cm)bXfC2HYvC}Qp8إ=)s`SE叢TUO2Pnoc[qnN9L|̺1RQnRPBBQ#`Q %H!\G   %&֚6][ e6؁@KĒzx`ʜ]oCpobGu"{sm|!2Ȃq[n \)y721p9$G4|=bB)B$$,58@t=2  yt:C=#0o@bV N;8%lX 4/i!}7yغʕn`a+hoAN߷ d8p`X=trDJ$2=2((s7@@Z9pzGC_"v[;hI9SB`hܞmv4RJt=obGq)Tku:-nb?C{XF<V2$(ZLY J` QH@IY*{7W|>zw0wr,i gq*V.}AE6g HqpUl^z}kPq_i!Ql⟄'[=FR: PRdZ9(PyJ"0HG<.JAjʬ*s&7F{od>8eb D v^A~8ؽgS B|DJ-Lτ{L*?2BBzY90++0w@cRE`LN6~{s3b[a>ڢ:M9{ J,"BۜO Nɂ"@(%` H@1*@V'}E?Adӎ; 9%*s;v *Q\~Ө!=F(Qpoq.\qIo҅ZJaЧg#Nܛui)u2^~E@' ǁ:V3 E˗` U#B Rdp'}9*ǫ>;6fId`{C6~NS25R4Zw W2uJl * I"dA %߄/Xǧ$dBcB%VX EhVqCn"$G'fqf=WE@K!|P D& +@hq LgTB8 r/Bs+UL%Tw8c%:9HKW>%^{oOvVRjA40}ӤD&By|I0pSg]BH"@YZBHM!e R: XX@M?I͛yb9s|qg}(U>"tsOT'u3a\)JxuviqZ}2FaD!\Ȗ&_B4yBHQ0iV$@z$U B2 opVX <(w>8k@l@)_z_/9t#YE@S`́ 9Ǡw.d ``Y\m{x ef*2$%JEK )8#P̄0 d$3 PJQ}Knҩm/ꨌ+o"@Y1i2ȈmBA-gi8CJhK4ZA"@DeϢ`Q]QD#6WYٝ Aq>Ԯz`'7` i+!sD)[&aJLr)"0uH1=s VƒV%~ĐA3@)H)q~a,R16TDMvvsl$L`* P7H .4GIPlcBiecN, e% ,|픪r~q ܟJ)iN[)~7e 2#?yo'@'(4; q 9 8K}H@M/X z 2CTX9Evb%ǁ7I~ *m=|ځX9 YGE$MR0gɂEBi=Af?:–VX2  s[|.7Ӕ2nシҵ?uUL׺l`W̪c%.[ϽQHwNu'a9&SvX`Avo]yI>yƩmV)׾(U('=PSg&$0 ޭJ^9er@5ȽH BGn]UFn 2]2"H*S''@#4 KS y(" \/y%(3~^J=YJ<VX{#3h !H'-Ij_)T[z.Hy?UZzxY0qW2@X#?BH8b:@%E;j5.t `k;9!z$geə%92d=JA@Rk6mf:|OkI!2]7Ll)Y.y c ᔪ`^)SB(q\ !Q PRǡw淓* t IaU,G)M^֮rم zԮ ^OshA)cOG&#+og% P:X!x\SZy0G&PV `J⍚wRE˗m'+UΈn. bY0&edž)2 oRWB?Do2?$ ~z]%|sVT >̼?HG#>$x pRP^ Fќ;3 X`af u]cyoU, [P B è=$O%Cs|_lF?M BWa.PR-==xdI+Jr?&@JJEpn;YIsևmt6jL,oҮkzf`$}aVԘk_Y_\= Ny _s<0+z%ZGG;'Z1HG•P憂9<ٜVXRb{]2=%:i!$:1̿Wcee:IZgk_s|H RJPB@I ǡ `n4rug sGh>B ;‹BaQѸvwX1j OwcDMoهOX$TF}@gLJAI>JԕQ_2W e3Pq zeT(p'+0E܈yq)!qtJw&gH,g 4^2P6vr *U{0S$jg+-r/aC<:~A;LjG A "a&2_$0{\ H{͘s{H$(JۊT*M-#VJB KW%QC9 ;UzyOr_ H~Ÿ27'pCpϠ!Bs@С!P|H jBq'lDo p*^+ZR:NV,ŅPLN&3؊o$TF> (3MP.L?I5 `2OfU* ulxVZWހ,$ )ԲDgRx/C=8'MUbd `@($^ o˧DE)tA $'t$CΘ1)"qn[ J BݽMҶbP=#*&,0R\Ihk$l?[7@u#X@o(}? $ GBstItVJ'rc  Ez& * UvICIʁE—SԀǩ@ŶP@@@A7XJt"d]A{ ,)zc?¿/Be"o.0]z}w-#f,iHr,zR"Nq ,t PzEI 6fR9K)8ͯG IN H7Q=g4Lt' k !M< $N"@U S*;nۼ9NV8s_bo썤|`H(c_*IQTF9ur,D_1IPTT(uC+2}j0NԚj',@ ,l+#~îq9^DPTIHȳBWgIZ}>,C'ݗzͭs! Er){eJJH'[`-@a;lR #RH6z{ĵ+̡$禭10Rv%I'PdPimH1Zp.sn'5Pzz`9haCgޜogyEK0ҿX 3`~((TLc"z=:O,Z(9( (H!O ,t `K1KU‡Y9wFIHgcy%dB|# $#?=1(r,hsoIGN">Mn 6@ҁ@KrN Qtٚ,F*yӬd{*gOIֳJ1Ռ^'IRu0Q%%$ wΟo BI )m `X,z P\KHҰEB a~KXDu-}w~stۃ>AR_Xлe}Wt9bxzF0#AD.# kw*kv `,|xQ `ՖPJ,   Ңg%`ƺ^MCnv+3ggNI}$jvO&@CV]HHcj3X`u %qA(JRfB3g蜹ig\㝫G🤻H J8-'M鸭c_ )Jķd`sLp 8ƁP渠=`K=)%>~A:tkF9݄ZoK(vJBX:9vT()-t3Ûv p8 V*란RE(2eC#09}n6cH/)B }~@c`RO403`dz,@&#|;j~D)WA +AN`auz(bHQbҜDO{u-,L]rQ?գ$(@I [Bj;Y_xD4iRG-7p\@FQLS›3C]Ju-;dbh;еI d 4K{3lEހިud2LjOx0nD bB" *!oF~2@͛on;IG(Uuq?1Eͤth{ F H7e3$[Qg0{=0qV`%d:Ҿx'i<1R7TU} "X†@5:d-˔.և`;{!:bL@_J R` "64C&37cOu|p! ܢMU|B(1 t^<ŎlYnk>ݷm{ Q9c$E:#bC&&F*F3ij>8Y(c LOefQ+yǣ1 }Cv' |xF-% ڥ/c\v)eQ9 3t3n4qa!EeUQ;mܒ%D<S"0,Gp@0c0 pS+&4q"}˒:J>\FR?0|_AA90updQ# 8HPMQ $H2R < mb~eH ܷTaёi8]wX6⌁8uipdLa2#7q 0;Kߵc!e?7Ϻ+wlր`*EbXB(8X+  ;U6\H¹@`-o~u5,::n\D9X]d `UIy)2gKb Ը͘+ڃ9f!0Fxз)!fB⽍" Z B@ iƀ,0V pQU ]L] wZ)Z=ٓ6vd%=Ƶt*{dvv_mu6]9#.ih:lf J&!)t˅s&5w*(q`R jE@)C iXD k؆+~­V8E #fC8fKw~fm%TQb{v{*:蘿G%D6Is)$`L%cBIod~cDNL,@,Ș/ DԪAARi8U}fumu^R!Xsž UUGǭPkM(xcNtli Yٞa> zA{*4XizXk}b;J8SX,[.4Bj@h_ft\8'&lH@%LX&J|6WIiw&88#R Փ_2zl1#RB0oђϋ=`f#  SH,5ĵ9|+ (: /8髥_dw{ $Uk+/ՀOZ6_8i`Y’" 2K-k7`)4>.X@`AQ$a cw<!}ҌIM6dmMuymi`6>7"<5l#0d/(ϰ?#(lGf]9ґhk}q8wF>AZ=ڞa) v Ɣ8{qk:Zz&0' ǒ@,ZZXډ˧08_ףݻ0 ;aFHOӎ۰`QapM0%Qd0%)vk>v5OGsLA9Ț<ΗRt31wv뎤Q"s7aܓ*6<?iN5BxFt+c%y tȓbZk5k+lq"g4lσxzYxri 0p\zU{$F@`A vWCщk+ة#qp0L@#0-qWeN%+~3|67A&nd&u>!#:{Ni .yxU-NR{Mq$;NoVTM&oqP70qsN}c #yphTxnG`. @X;d~?+}J"js f@t*t@98`Aɸi Y c@Y ݖn-|*<ÃLm$Dh8,.<81` U-6&DBk;i7fMYp{MDDvMk`O )?!9ʾvL @ol6o-<uҦ0ʑ(4fմ̉EA*úϩIh!L8ND"O* $82B ! l] yt#4-, b 뎆7ZG/ yV3fK搆ʰn3:CJ1D&\[oɨ,D"P"uҀ r,ߓ`T`LH,2E)/ H 9.-|'Fۡle.VXZϔZ?Cej &fjd aO|Ͱc-&pl k9x'vKIp`r@8qh ` rb֘ KŹ6KQ4g`H-E-(pXdEⷤL (37stwj pQQnC[HhcKsʣ؆iSG uozp8+ Vo4a%o;( t{0gU}~7`_9m0ld?c{ +@TpGZ,> cQ 8b^-jv|Np4%_wgھ}KyR Z&x, irr Ma87qJ9aasŀ+c9ufi&G?6Rn1ȸKϺ?T8xp-'QBhQܯCd72*L`zwAݙRxT ($M^77~޺/vwU+>_4n;a@W6\EGt~ӞS]?u\0Ba`Qact.enz1@a  ~>ȣ/Up6v |=-ٟBKKoŋ᷾O;[Y6Ӵthr:t\ ml]X548J-0)YX.SƟᄥ@U$ $X3=k<?@[Dc#Qz(^t(VZ;b"]hF]PU;~P.$o}[>vg6s^q\1lAԹ4D{Al۵CTq༈g N*Vd3 *XB 'a ky#F.7{TPn5ĻMk"PPQ5K)Ob LZipαӷaʨpSe8a1_%~bje':0z$^ vbk6*, U77T`{IC2${ ) ь(pBH>䷿qV* n~e;nŒ|.I`sDqg;MT[0Β@W6 k am3KWuWbNϽoCZo\r*Ҿ4.w x'k\ӧϿZ/f,TTX**]$ɞsHAx2gP-%6YN?o}+i]P &S4#I
9ڞ8aNp@J$$T\mn5D/!,B5P`@8V1Pj Dm<(ڳ\1`8xѮwgk߾AZKRLolaV+G|+tyQ5 a (QSbQD:5 o5!}Bh<|yoe\βU0*+ !8 %*~n#k|,k*8ip  !֞}#@${M*!jO&6A`R56]Mɠ=.)kր7 Ԫ嶃`׫7oa6'ݶ_Lj䊊n0E 9}2BGf-bs- ?#?Ha28\[Y6t}h|̲0ofq}w} J0Hs*_ёX@aPR?T(}"2K9nMS(@تͶAf\aceǞ'^^4Ww#3{㪝M3Gݴ{CT+N)D#l y1R/B*V~Gd!4G gxP8Zxq\#pT@@͏p^ f: E[iSEK(F~h{ 4B;wYPK@ 3?SCטu 2>O߹zz2k@ 1oE)~nF/2!jPTp~aɣ5a^v v,!O=~]oe?d;&R(5#l[`f+XwTluhJۘ@Hm0g 0 f(pv5Bȓ8RĮ(Hֆ$9 G:ޑh]?7'=2}^VШ:ƿl?"f^TCK@1_Dk2cI?=Q.\tVV ϻY˶8>@)![ [Hh?@W6\--G6=t9JbK>`!+zZ2Vd-pU~?m[JjVC`(ŏ~riaOhe(jZ^-`,Y@ק+"?_SC[[[>Љ?i9b';'TM6 nV|\Bi ]u; KQ  5KIAS2Brr@dْkR\څj70 (A ϩxNϩ9tjFn9@[D:4cϟ%³Ϯsk'6^1um03`yPT@x%U?8SiN{N8*$(59nVCkpp CU GqW y<Τx6Ji(/74[o&D̛-p8Xޯ95gu )AsAJ7 O, /ʯsW,Dβ ]7<@qE4qO(8KXɩmj@OA֭PwjnVBB ! (h~ fb.nv8"{ߎy.@0i~hվo6,-qV1W~]35>{8xq ˃qq0_Ϗf'{NĹ|B~e%vٶzt뛧HBbMA5ܷ#SLb%|r0\n]F%B͏ 5l/suzW:B ~ 8ǽak(Շ}Y5g439EQDtP։% 8cBFQ{32crESv߶]iIA;#V,Z5`01K%:nq@TA#]!&lQCxgwK3.8vs\kfj3>}nYC|AB@s= 9"h!l 1 eZ;_͛>&H쳫{jx5[yv07)޴B1`,'(X_a%9eSF@6?HxhQZ{@:6я$wQ3YR!Y455gRu1Z[ HP.^i b7];k;p E"Q~Z04ܗס?q1 ]7`+q鳌8Th 9G^C\F{x2Ld=鵀!|v%Gg9}ݲc{E˹43W<!~a>A-c?[,^.ێiY`Q EH qm 1uG}+I`hςg!/N?PbK-2~2 8: kNon?"oP.k H.O(cѨqmn܉ z}Q9t**G$`6d b"_dG7zE3g1Mhq0rPN4x`ȿnlC8+s@6&`,?Yr3X>E g?i_Ww+rvAt8иQ\Djb a#$0s99`i03)@zj(=3 ;?#kU*U+2 j(3dnjX/j9+g`? 1SO`V^nm 2ayIC֖qDX|u˶Y6 2e1qCZ+@ހ jhb 87Zd`EWVQ6'F?=!*U*dv"b 852 _Y>,7)q9ix+;j93Xfq&f "HXoRyN?y:8a6H@J'pPV^l9p_t .Px=V|̷c _6de&%I|Eoe睵lW >)$aF>I 7ہ}ٸ@RLHuDmzO)YoR裏zigҲ  S-4Hf]q@32@2T 3lϖ@ƫ523fZ};5 "IIYoRh>S6\vˎ=d;1n| @p4a9(Р@f.$>j ZJ0bS8P-xVR5MD vy"q7}D7MJ Jy˟lgd|  B߇iq- ܛ?H)>2DW^н++Jk+ZpdfęaV.+_yO^,!MJ#BqڮŜe3Mv1~P+8j6eZ*?YSrLMJ7`X~ JF=yȘn;+(P)Fv^=2C\,:o޹Ҩ!Đ ΅g]u미庶ٯaIz(g[9GJZeNkK1.8l3My -jZ)lQ2TF@KZ #^Lm+k|E-#ӷ/1$e˧\gqOXkى %(BQJ΃8ǝ}SZ'.۶el4 3)ʤBQFdR\jfir데] 2[;HualG_jHKs=nZ犫/W /َ{e[8@RG!:U*Wvvv_δ_i_7,=kYD@g @3.EnC ۣ0@R&OSBXJ.^h*vs,ۂ-%p73DQzr{?olmmr6_Xyrfβ8P0^)zտgPhVb==aBGTj4j21%$evxx5[y$Zs7>`q~,"_6o?{v-# f#7? vZM215 JP.^iZ 'Nzv#.^O JQ.[+}ݷ+/\XIq7~u'- L+v fjǾ߽WkJƟ gߜ16[[[ƙ?xDanZ >Br^S޹E|{J㟽O}+' yɶ-1 ӄ{ l@1+8h5'23;J_Ugc@ġҥKSiaMMə\UwTgxʧ C:ٜeHO$ h6먖`صJyN\*oվo6f8q,!@VO|g,/y[ki@6Hp.~ֵnޜ2^ae/e;V;PPk/ L!ѨV.# áו@Ɵ f Ⱓ|un_̯_|@\ڷ.ݫr=y?>O(l\v=%v'Yfѻ c<Y(h6\Wj>z}@E_S/ڮ㞵x*@EhԪU[H)leyw'Aa$#̗|g />WZ2aG$|:vٽ֖~6reoeyq7s5dZ9azZ ;FJ{W\ <$#֖V?8z6e< QׂJi?o?釬ʫ9ێ8,g/vl jZ-e?A$cãw' KjIuv} +jQڹGj.\XUr\oIq=3kGAzz !תV.'q`O=zG.{+]7:aj. r p @V+νv_yCY֖}ӟ^?qz/98f\I4Jz < QVe\jUB8k'OR(de+iɄ^h!viJ{O۵?8?+O?};_tp]帝j2J jJYVʻW[:8`Hǚ/vB-}b.0~@ Q[?[Ã%owݝ|Ģ $|S֚YͿO؎qu,v߹wzQj<^pb[>{Wߖ: 2${N\j%q s4 Y.^-|}?_zut{'g+;??A,1/FqWVVw\,,Ҿ{W+;\;n_͛'wo}o?A,1)Ox7^s+X QY{W:sXHx(/y +oY˵5jjw]ٹ(Ѝ AL֖q=QX{yX|M۲h6(Ν;FRB ҥKVŧ򫫫alέ7mw2A,!$bzO|x=S<_}k__O雇AG_eyQ;goAqŋE_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiZ{IENDB`goxel-0.8.1/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/64.png000066400000000000000000000104551334742672700254610ustar00rootroot00000000000000PNG  IHDR@@iqIDATxkWy23ދk'qB Iq(m(h?$JT *cUQ4mJJ!T`BԸiC`'^_2;;w۹;;{qvױAf=;{3ys9˸˸˸8qǿ:Fhu~ݚX7k<!{is~\t9wI}Zuz;!{냏һePjs6u&?+:JO.·G+I%{TΚԚG&;sr{C;g-0o#ZOu9]Z(uC B|!BU#Ա2VFgP~<55XǏk?$ZGR=k4i/Eu*{ +(? jY댞;OōGSO\ujpRAZCϒt6:PKPށTPaReX1yzey<:{+y=N]_mn?7xz৽rT*\;9K3$yL'CujPA@P"1cBJ@F :H:&OY2bngճ&~ݜWC| 䓻O{ABNb"NI5<2Z52Vg*BHۓƭwn퉻V8jT!ۄ>sgrddq'8зxk2YTX ++sZ1:9 88G7ae ?$+4Hek_xY7%# sB*C) S?Mܜ&O:d8T0@Xynkk f\ڸbd,.@up/^=0*%7dZd R/UBea]U;AcfO}V㥞s8~#G4ig~F&P8@g\qhH |e-`@u8 BTe}w T'5贃3yBCˑ *S:`n4\R{my=C9y謋>ؕigē̟/YhbQBe'R?K4Fm:(%%3T(O>:ӌ<1yjgνobdMO0}^.IgstaM`F o`-(bMfY&nMm3aYd\pH%^kM΁1-t;{ako5wǾɧHy.01VF'ވY19h5Q]Cgq/.pgIڱ}kb.oeW~P`:btNy*/ Vexj3L$3'3#"MN}F8c4"ug4O{ ͌<38U:B,"F #RTaϙ@O9&l0#,rrΑ LM~s>3t̜~3WtZgHy38t /&jO^.8A S+eu4x>E@ǖs;Ϲ'Y=GU= yW3Sݹޚ]_@֖!QACt^fΡ.&Kr}ֹ@h,|j8gs,ԞWYaY!_s(t)8IyA@R\Pi#APVg9"6ϖ^m􈰅9Ak\^i[&={D4Ηl_n+NyÓ g4is9Vp}i i[!u!dQnKI R"='ĉ%O_;K*.WyJ.uL 5,9;u6m=K̵L?}MHT>Rga* zZAD)o9v1ϰFѣX+ a(4hfDݱhF!/%s=3cu35wr/]mxb gݪG{J^ oz5Mp>r,w1x Sbu3 @^e™͖-nڌOSkyUN8YY\q˧F#LV~3v1yu1i|[hY3=?R20\V  ]ͩŜz7a1T\_/ d2'-x',sxJJ W)*Oٓ ˤY?yΚ5<齷] ?܊LΉ箮|~JK9d=fr!! :Эyv8a:80, Z3d(,qKoӿ=fR+ 8vũ56wӦ髺&w~~Qߣ^"@yA;ռ435ȰYdgHg-աJe0Dy>QfiMgsDQg>jhql=r0q+^uv>$%ie&K:-%n>X6;Ka< C學 ),%M1fǎaA8MO9ΘZw?U;}Gntɀѷ54w*!Isi;4q6E+X WT?J7^zdY,%F'$_To/U?2?;Ci|];Ç7udϰ[\=7u?'藥<(ڻ:80~S*G!z}>j7ھ3*GJι63u&Do>_-.}W^r9[Sg&DG{KG ʽR_͜ /G]0\\OIWΞ Default Left to Right Right to Left Default Left to Right Right to Left goxel-0.8.1/osx/goxel/goxel/Info.plist000066400000000000000000000021111334742672700176650ustar00rootroot00000000000000 CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIconFile CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 0.8.0 CFBundleSignature ???? CFBundleVersion 3 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright © 2015 Noctua Software Limited. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication goxel-0.8.1/osx/goxel/goxel/goxel-Bridging-Header.h000066400000000000000000000004341334742672700221230ustar00rootroot00000000000000// // goxel-Bridging-Header.h // goxel // // Created by Guillaume Chereau on 10/16/15. // Copyright © 2015 Noctua Software Limited. All rights reserved. // #ifndef goxel_Bridging_Header_h #define goxel_Bridging_Header_h #include "goxel.h" #endif /* goxel_Bridging_Header_h */ goxel-0.8.1/osx/goxel/goxel/goxel.pch000066400000000000000000000014521334742672700175360ustar00rootroot00000000000000// // goxel.pch // goxel // // Created by Guillaume Chereau on 10/16/15. // Copyright © 2015 Noctua Software Limited. All rights reserved. // #ifndef goxel_pch #define goxel_pch // Include any system framework and library headers here that should be included in all compilation units. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. #define IMGUI_INCLUDE_IMGUI_USER_INL #define INI_HANDLER_LINENO 1 #ifndef DEBUG # define DEBUG 0 #endif #pragma clang diagnostic ignored "-Wconversion" // Config for cycles #define WITH_CYCLES #define CYCLES_STD_UNORDERED_MAP #define CCL_NAMESPACE_BEGIN namespace ccl { #define CCL_NAMESPACE_END } #define WITH_CUDA_DYNLOAD #define WITHOUT_OPENIMAGEIO #define WITH_GLEW_MX #endif /* goxel_pch */ goxel-0.8.1/screenshots/000077500000000000000000000000001334742672700152155ustar00rootroot00000000000000goxel-0.8.1/screenshots/screenshot-castle.png000066400000000000000000002460201334742672700213550ustar00rootroot00000000000000PNG  IHDRd?gAMA asRGBtEXtSoftwaregnome-screenshot>PLTErrr:::N-<<>>ff:kxXzwռz2a5fO3H/yK0@@@MMMvtM2C+eed9jF-{w7h~=&tuӥk(N~A*S ʄ?(p` rvxթmb?{P i] :%V N2jE gAG)[ xN BBB4f]<dcX hnG ehrJ uL fgmKhkyNlo/ZE^zƑ1pQQQô>`9Ɓ7fhHdQpTuDDD'AaYZ8rg_ ,U \}`cWx3S!@hqBzGooo^)))zyy[TSsUUU1^s$:U7jjjNӌ;Tr@qaaatЗɖaUN}:^*QÈ(\\[FGG#XXX*̘6NH_3"""^^^E6(%Ht///lB07DIJJ3J|п\*u444U1܉+2>˻<Ҫ69TNt6>NJpj6F_'`77o@Nɑ,WC1zMaw(XkpGGHR=)zo%xwPvj"NNb`^~W!RA5,,XlL*ddXX^D)nn''b''Ce**}L9)''))++++-  IDATxOk-gslhpٴN <*JQN™\"pA s 5gפNiqі ~όO{%C;,ѢG ~Mš >v(VP#c_ 9@8;/ G=z#h>k{ ޤ;* C) )> hē^uTwv~ns~~//oFqT׊I虿ߞtmT*^"5BAsňu&#PΤ݇ b_+.Ot_:np{>hBNzE1x!rM# .-%nƵ?Fo `0Q=녽 &E1+sPk=?z)QnqjvnG@ )~/LL/3^7hkxiN)vе E:F/Z(PbߜoVi}x Wuռfb)FvJvW -؟ߺxI< # dr1=QxrxsgR%WxbeۨJTj`% UOݖ!VvԬYXԖ!6#05+a53Qwe!--=W0#R<i DQ,/Y 6*qshf<'5tp 0 ~Hiېfb9 ?ͩCՑq~go[ _ `:KY/ aG!b!Y&Bvy39/Bp1f˵l&O 6s \Y=q@'!Wƃij]XK׎% 1k4-pp&`^4)< 4ǒ`O'*0uxO;$AM vPG18hC\&[ l_O}G'E=㿅`JJqϟqNS{Yp'Sl2VܽcB- <NN 92݂4qqb@n7 lJ Q$v`H:{os $ ( -"}= P֋oZ+ D)Ў?z %%r/{/If_%.aP8!n H^ՇcWs/A|j8.R \!8 @J؊Ik'|:zbgW @+_zv-e! ZՇ# ./bbqνr؜%2;zh`m, s9Q9'*, àb %SzThy!= (8f>Gz5 u -cCP7VAc$`r"A X[^%iO2* V `z1Oxq)τ*!gCYGɳE1ps_W p#(<}PZ45J8/q?Gh+ GKΫz1p~%-/8( Ô  J{&j3G1h"pPi-@ȟŀ7@.@=`nZ@3n֙Y{'`;vc j>|z?= * b%hpˀW*#v]~b9Axf!h0JuyM~d͉հxw@<CE|.E֦ZD#&[/kD(zeŕ7 ]@p1*xg0D~H%"yNzq0<P @J>'u18pN%q.P 4x$IMW'}',Z d20BF/ @Fk @7* qTXF:~6IE!o8: r=F7ַ4<8CT&ց-ntF7X^}= -u #*UH:39ha.k\Hv.;|>'ȉ,λ^wm:3H(#QwVꂀ ǢŰeh[gXuD"8lV ~V8L8z$Cb;@Qmx )V^ǴO [R;JmDR@}$QrYcG * ıNiK>lYm{$Lp%azݷKNA(iFBB<Dl5вD_1<@Y m[Vb(Cq`g@<8īVj@@APJqpiЩQB9+4Eiԥ X;p9wz=, @/IYz2+S}VvrվxN@Dހ7G7 ɲ?ӺBzwJ\.Q_ %$8k:50$xȮ7WܞG;)%MGJhAJqNeJx8uNMOL"E g ~ &f^3]@' =֦o?}ƾ 9 PG[~%*q_?^@j`)TMH?5J}e5+p {<75Us#V`wvv`:/IwY|yjFƋdIGg5? 䊀`>Hl.m h/Muܬ 9@5k: #M NHpIBEh4-R}k`6@-eySU&XN1ȸDzP*ؒ⟺.4a`;iN|{; @ґ.dә D}܇J]^)hb@EؒP (E 3K1$n@'9y{7AmUo}sb=*fؑv|P'N@QQV4{wY[WhW{^P$WMĢܗޜ BI+t? [:w pV^eTk@Wzm$`0{i~>ϼz@3Q4КG=,_ߒ* @'2`/_z `xpΫzl5@a=Hyћ pY=*ٍsbU྿t++ٟSO(Y:+v @z#˂#v Lݭ£ GBȡ+^^Vsbbr%uҿ—TU>ho@ա%  \"hT *  @|g !nܒuĦ0lЊ G*a7>}|"Չۀw wC1v05xMÙ2ֲG! $ N/(tN6' @ dçp P4;Nկ+xJ3dڡ/"sHP Хc֨pőBdJ[ Ԑ)  N4 G'a{ZDє&(vr# !b!rVߋx~Gk މ#;Gg} } `-4BD^@]7JȃktN@QGDȠ. 8 _|Av3fr)P`ՌSC Cx H$&&!v'9t`7~u:0L.1E@]@`?~ ItҘq#I+26Zy(0ݴ8!,܆A+5TBZY ZL8EìW_}rj]L5<g@B8eap?H*/=bog9{K`N@q8݇I{{BXrXd&;X=?1)l$ȝÀ͈Df"p~bZbՙX$ǭw@ZG;!)tek)c!;Fml@;_[ %pk-V"Q$:zHA#Rmܬ`; g34{~ ?-З1CF2W 3@n&G@m_| {1ZH镟[Rz?(b醤# v (H$L%5jNU2;@Z^`F$ (jtN<xd1z>I=@8 8Og &VX 2l{bUnaH$FO x{h@[ (9_ȯm~J}` GQ"Ӈ}?b#x,l|K3x] ="Mu& 0 0kbͿQ{fO6 WR |uE8^QN (-ugx]o@Dyޕ<w{~޹<~ӻ3b\@a3:: @m(2_W?~\~탓VW_S7^r5I& Y~ /MxA[LÜ6 @1*ч3s 9(5@g񥀱pf(JƦͿyx`;^Jˀen `s`@Q8ln$" H5?#Wz hf0L?l_ @1%A@!WU/LX,_̟͛)`#< @;sr w?%ْ2NXWPչftgW)>eĭ z,p ;j@jZ.tz52W>@e~q#Wi񧜓>=n?v0<8m@A(q~o٘pyXz@$]f6߃x@3<<;\qYok?Yv4w1BI %̾gp;ΞGS47 GNj!{sO@.#ȷ+K40Dp|\^HD3?ҳ)19|hpmG_=:SRAa.c%$in@y+\hPk=x |C^_\uBX9~{=C{qBi36ʉlՃ_(N8J&)88Ḅg`@RمB'wp ߴٷMro'X<1 ^{c\KZl1*âfOn p6fbm/E{f'Kv`CxE &>dx"p yYL}ŨE`Bd/Lh3 szχBcJOF_|gDE<9~P  %?OKc@xQXDXWZ(#{%~@G` ?2X3Єhڬh83>o&FDbU9b_VeL *$>_ϯ h_}{G[@a@K+,!"^3)f\6l']Alش@^3㧛qߚ C 1 >DZubfd|z߾}#? 0j]a{L; 1z8o 0|H 2 A`4[ɤ ?Ve߀U_no|^u29Gǧ)Ʃn꺀'@(fNk[=fn|Dn _e9'@"9{I'y>㸃W* 6Vk @,/p8 }׀]dP>FO#w  ^ K_(!3K5` ya?}LT*X7Du]`T@)(v 4xx;!`Isp #0a}_FhgC8_Xxu"IJ~P^r0޻wD + DXN!K`><bEQx,fz]Zm@Ԗ)*#Hon`/þFWdA,~ A `}`T>Y#.dO0 l{D6s RYO+/YV ?@4Al)ag h򿺺-~bᵍp"aju( }FؚRZ0@:״< @1Ly92| ϊ~`^QPNZ) 5@|9dڈ9P$̔Go@Cݏ@,R9\Z8x;h\PTT_K2l4~Bw^\D"ؗ!# tp70u݆  Sc*8 #w᠖`4#i޾@eI?@i#=p@&v:I_* l+5?xr 0ڲi9%V9Pd2Oʉ޷_b@,BR6ú_nIRL@: d{B|J@T *yȖ53/U`D`~ɇ2 bsVTm[gXY,Lg!'zHFp?pp_I51O(&ɀr={h^mlg(@Y]侒U N[ѭv^輻opfo--b ' b''~Uvyy`  ~*\(Q$"3&yN?:{qR@e~d qK@7꿁1fx7&;@R#/q{]N uG|x(p(o,y3](`wjFDYm(||v> /7'  ĺbeD 7vQ!vP,/(S8d72#*yHߕP,*^Γ4,Ȼ埊3#9rR#.К,B0 J ;u[n[G|Nz0\=vyz4?ZPS"©-60\'ytd'j`Q-D%}FR<hppYdThC˹Gh hgwXHCz$arL"JF'K[ErYRrMo:)4$߆S`k@^5 Z_H*kg^~ZsvB"RK&WCD 'K'M0% $_$bb$0:59{Ҏ:;QԮ֊J^k} 1 )4q-4We Iwpa_;Q`&v-+ϧ>|ϬW*Zml(h q!he7?aYz ?E >3?`~]47n Fyׯ1O9g(/~F ׻g%å@C,t~(69&fo6@{x^>gTX7`_$-w"+KrԪvZU55+?&'@\6F]_j@ ?K-A8 GvT!?? &'~9RCE.$SI@;^d %@`0 ৪J1ZgaOxI;d ήW}'x"U՚h !.F տy 7;)=Ŀ/p'Y偠b_ `63b[?X!(74 19xDTGrXs?M{ r b i^ oF$`=qB/Jt/M|w0D0E2PР~afh@p_W`btlʓEF@.HF@ds8Sس(@IR㝿Fx%P镻1>0(@G6Nƀh0ѻWmvj `N O~6טhJ~q!s=Άrb:4@2N֠+d}нw Σ `ǥ1@ϷdWk~4\.c|  K>l8C?e@#=).{A-fo ̈́F<> n27ĈPvG™l&cfwx -UӘۭt2%@lZZK h0(TW!kLޕWy}sq @<ZCw\s=7;ާ#/mZ~06`>WM =ngm9 ;^y ]NbG/{(ϛq`Ci<PM %}PkϝFDU+}k 3z0t*oA2ur*zc@%%TD_@ ?nvqq0 o~(џThxRI@ L~n`u- =(*頝^@}G|<حl09m:z}@L<TDaa^?|G =@IhPy7.1i,M[BqફV]8I WMA]@;9!@X+q6FǁDp@c<9/hO0  ~0 R v @= R RiTQ>?$s+o(`F8 `:A< _O [XV%"8` @<v 8 y~/ V)пW>;xLL|)@̨pvC#0ߓ b㯯{=e <PGfXo 4}QѦX8y\WX*A`D%Ȍ}`SE@d [#cU8{ CUY(3og5&*88_ \C`̫%? Ev6p 1'!L ]+2ma.+B׿p,C{|?=U%N b}A)6coܪPū]_on!妸tX@H-xo峛ē(m 47)w,̿RBzO.}`EmAGGlWbhO{ /~“ ݺ kQ@sw:| M`-{1#?`?G p0"u .7Rд'R֬qϒv yˀg2gxilIh@a2˥.5e21Rִ76K:}EAL*1jzYS >vPyEl?}L@-D8 ×}g@})X mPV@86>؊b|l$D,0T .c/_Fs:~{ \~j]-uq_$5,@ ]Uq̳~h @_o CP$(pLj`P` R XiXS|dpy:Q.x 4H0ZlO#-zy틧D(4b6;HPS_yakLzh E[d7ιKLA:ꛕ`#ç\$)lq熍Zw؟n)'i&=?i8t7 @$`6O7Yt`ZpkZn'?~ܣQ "\@d eQ$`ϭ1BHdOT.r9>HWOtOLVyRM{AMvx<Dt.h2fS̄v pC +Бpx%@*Uumі^ }u3X*1B*8K@__ "o ARb(#@uǣ Vf#qxFF3>cW|0#@hյK%"$Zx!gEwh !T[=]*H "` @CT]"TW c rc|8.x@gn T`CzuXOXatROO8,@p-w<2 t\h=ȗvF_ ntw~XX~1p/ lZ @@V3HH a@P(ݛɤRB(bRb@u<5(RO souBP(:@`2qS^%=5m42Q P}8KC|-o` tBR h,BpJGp*O&-dPg2f>_zv6TIQ 86<ƀNWccz|,$Kta>O [E* о<Gk@1xГ zͿZ*Mwe8  (aϟo3a_s+l ߿{\wchP^TV Xze&MVj]U!o?y^&V4@TPQ -`舟e` Mu1|e?Ns [kG› }s?~" S+5WmU%kت}? 0HV3>j);cpDL`@j: &|@ˀ. ިnvR Ħax|=H;R@nk^{de8S.R?hkHh>"@Rx6 Km|o˶zk0;~TP FZٳA@ᠹ,%M2,/nH`nRd0JR)|ٿxÂV6+{frk$ @r" 8MA84%@iE RB'9A S_?1B;{p8)irn 1ԷE$ X$h Ii!)>P0b97N6_JIDu?ez?pIfj%LWK;D!iQ@TDxg,a?b.>_sէ6[,1b?7=>uW*9jdR%a? s_9UC@9wףr&4͝NWwY]f moFhWr?]"1 پtjiw0 +;{P2U5^1Ӻ,/<dfZ #3󷍀&;:p#g?N yB3 x\""^*` ,S斗BQ!OZδxK[;-t޻ $-PN53qr& Iܸ bɦ/Y E׍,Zp)] JpᢋB];̜sf$^,J1Q9>?"Ѹ#r(g<@O8G !? ng?u ,@^﮲W,4n(ἀ 'Egw=NGVIn+~d]iI2D;1@azXJ(R6pPZz?L@ɭgv ^Z{jBm sYSnOe2I??̝D}#ZgqL[nu6X~(3q@o-zv͢_#e fX^mbN%I&?j,/4!FaL2\I ɮVuw8@}D 5z[ c!*(!iϲ`Rk֬9owclX:9¢ 2ncA<?-VO‰!A6[ˁ: #= -@0rm5 TR]JRXF/yUM7  B@fz@֐n $}c6z7@ Upo;OϷ?,4yO?Ö[\2Zz&wvxJĊ鲾rܲlmOۿKGL кJIEB ̃֟m{: [5@Cv?zU8S/>x]z#!Pn!SjȿROn z %.Yt L·4`xb&g@\ z [S=PxSwcF5]o8.O|x*?>fW{(|kV@@tu;E@' ? ϰg' $ Umo_-0x8_#C}A~& pW hTxZVcy3X\N¦[7 ӀWIՃco@@tVM9MԬY*`R"ˬ"`^_1@+ t 4W#|`u 0*\q\]F6ɀhE$Nh xGf ۗ&0<P4bF4#Ǿq?SH;a_ pm ~ɮc q LF-WrW 蕂?Rv7{en25F>JҗbО#4Z |-PLOhaf'ѻCD6BBi u_T} Sv{%`i ܥ @ g Y烙f*g }~Ɵѵ['00AnzV\Gq3FoCOF3l%,Y,"&'58-p@>L tv5ƒ"zA$y5GdgXgy ׃xw׃q?c xyLO~ dD@PIj&M Bp^p^ɂ+Sc‚gRsTw)k9U)'-0 *x$o_' >@np;j|XD_ȕrB/4qY*dR/8l&"a0 #2@ uSsrwu>TRG>#z @݃uW2!~,΢q%JA4`lLg@8TГEy$+T@R :H&g<s>/uWp񼪔' ΰ04 "Ox@1ϖ$i "Ǧx% FMa#K !K`3ETD˒N &FRlvxRX)2/bn U[(rV'86KUt7 W$0B|efF@_k. |En JWfoMw"puT~$HĺP d; d`?nt̒zO,PxUrz? zOQmlITia4& "rK:03!+T0JTG*ӀعHÆ$0ꨤeig 1:/&CjLб8F\"sd_UJ9D=iӳC HWiv.AU`"4JhT̩BWz8Ztc֣G(&1r?t9"G[:e=~hiDཛྷ (F@8'0_ 3ZO(* \*s4RA,n8;`bik<5>F/`ո Ɔl}?~4#;P_C Bj` ]XKJXrweb @oLtsq;sG-v /q[?Bj>xt痍ý!r3 O&5 y=+'[A˿j>Ctd7+ @@MbOscC=Ž@_?/N5߹5 @@ΕJj!p~ kt1(`$a@,^3.ZMU"΀~JxT\  C&A5_+V M Y CFGfXu*<3`K$VtNf6-/$`y?H]Tr<ѳ&e?<?{!hm@K( C~ (}3 ~#,p_u{'}7woZ_ݽ~{FZC$<= 9@oNZY.;(4s(/o_U͠? .\Mjf];$5C]>+b/٪kdp1@ϟ C20:dsB /6Ik-AA5ꓳqN65V{I,&/& К/>'O^tW~]@w},M~+2l.@^}4?`d86*uQ,TY+w| ?AH`ϒ1 `寪.t;1_@L( Ͽ~] "{SxgA~$֚'oTAIhC֯sAޯ>Kb? Ij:{CmjtK1>.::>\`  \#Msqd-؞B {;~'O ^;%."Fs ܷ&߫MG?/K~Gi QC,e$4:Z.OQ§KC?Ts rWA|M@mM;O@%xEp_uڌpc4]ߡbwџ &o]|7(@k7ou3jX8#=Er~`wm-[۞Ox?t{yBh_Re;_.}Ẁ<3nM~KS,@fr3i@;Ȉ&nH}\So7nN_]DFEtns/ q4+DFٻn/lydHN<߃n~?7tGD'N W?4v範>(~!>({P&v}h>pc{1ֹ!%J5O$q IDAT: `b{0f h[pg6Lh!MŠ )پs* kt.c~@Mөr+#@lx4>W֟x@p5~3-l!.cmh0ouS7f(X>(, ,Jk|Ϋ8=C?p@,ا'Fh O"F#=s`17ܕ\d5 #w:at^G T[f%&iaA{om ;w} | @,iOOi`0'R:7;1A c```cp@ b ;kls`.B_W=ij?~+m}%TnMw}{SON˟m[끾k'Wt~R xm}:یMVH֩V¸ArV,V &$wS -Jt.zBJ" .#ܝ}Y{'l8NlboΜ&`9ag'p@] 0R+ @\f4)AQ ZS(X㳝yC6}[,moѧX.^_` ߞc9sخA0ǟB=P< 0tv @ɭ5c0 'P]KF $)`hPY 9~@;܊$Ó~;Q&ns0@/tTFm'^_ P h1GSP5*jQm vps؆FϳVHOu<7,)v> (d5@g:J~Ч)b̘#Kw1@~[`0>lBk#p(Qh&;k͎g>u {$P}T{] UQFU~@OPPGUsD!욠9 pFQPM8n $^Eog$3Zxx~wGT h0F|SJDy,_<_r'dl+`w SvWȞjVEydvP:)@2q?F!&@$AMw)La0%) GE9b{~A *~pJ@  V> ?pH0jG xRԮX(9?d$ޛƒdFM@P + ;R=b^H1`W>0;|$aUˢF\Ο=Kܼ5lB' ڏ\ja`4/A80d_zſ?ǭ\@U`#N kR,Ohߔ,tN"pwB[ }?,Yا>3@. ;:\O {l='+.b (K*/`dc=y vdIjؙ̨ e~M))EE_THb+U&nFdT+0Bͅw3pBDk! m]@.s0GT *NL #*'=Y'yO5~xEQ)S()N@'S)_^aXVQ/tB.k0@x 0#?fT%{gc.YE=yK[#5>|5}ݴ Y'USP`4Ƿ_:37Bcyjvc>w pDo<07>?+HESMZqS^`|u>E0Ou!UR䙵A wRzUP?(Xz`=>6 k^\<s7{f`b+H/xAXsp.$ [{ߟ{.T zH\^N"%oKj*)Q?:AA/T "ˍ;#¿RoW}/ƍZqC͓$pf\#wU%hu@ s9N@m]zQ.nT^oV.z_Ekd? Hz ;KAcѫG`M/{Db)|'G9j`&&_@ N(RpZL&A@? Z,Cv1%s ;8\ݣkAn'ErA=ݨbr`ٓ)v}: 4R$&UPMRĺG8Y/JaƵ~Q|  sg@r&$@:LP6e'$vo(zHԽ? u֟ՑFm#=%!4T g)XAܝر@R@Cocͺ>?ҬN"@T4mai` ҹ=?8V%s R '/6>}ojVuAA qBQSx론?w zQkO |0J%j־.,O.P#ea5? ݡ m9ο8Hph6]NwEQ6ٌ4"-}pb8h 5wc@.A`/IuH5W?wlvXD0I`KB\$!C3EPyA:^$s?^3y_5Z%:i`FԂ^'e>zfh|G`YwƓYtVb`8(v_ʀC  rANnhV M (qXCɽs K #E3EJX! RQQv P/'بjϟ{jZsJ@+X>j"WQy`@@ @4H(;?w 1]q+8oq@f K_oó]HzT5h yw Ҟ-6SvH?+dBedsYs@RW3P߂: pMovPeSphz(T-l )^6JCZ(?ϓzoܩ`W}I'UL@"X<{zi㈅3&<1kz1tԜtL OS_1t#LH./' ;:0~ۆǏu %DQl=d8^CCXwp/K4w˦Q4J=Gqba2W*?=$ xH޿}T9(N'YO Q7.(VsI{fl43KC{wZ4!mEAWipgJ}M/`#M Mh ~|44gUN4|6^/5~֗ jN5 @ 4̏8"(bF J D! kVcVH=.VĠ4)HWvbnCBW駧 z|jG,S$q0~>t>gHqA_ﵘCLqSՇIvh %×K]ן q]Z¿炀ݪ%R!`n$,~įO2x@YCu3"7̓ z*X>$azWx~y\l@ӂ1kg?\[8Y w)( rt/|AePp Y? &gy}J /6_V{U@+?hT`&JP.H9@[t%S]_{sc??__,yYM{$/ו *^ޤ^KJo&aXWkVL,¹N*q_D.@Τ;7lxUb~lsʆ<d@] NK:܁}x0Ο Prc/~ Aog}.dq hӇlQbNҳiu6bOTmӉ[ j2|xz/|qҟQj24v%ڼXٲ r\3&%ng N~ۂL{B4 xbe{\X}x׍Z`"hH@|zqЧM /x6]v+G탽 bP*` zg\o1@eb<a`f4\zHTiV_ t%hk3Z66?-?;/R(&6PPi/ J]!{_ErX8?\6r!#濘3BS:6:PTЀ3^tԩZpF'@@GϓnP r覝_L&|?H$Rwdv42,5A?OLس/.tT^!0DH=-'"L/34usj.=?P>W'6Znjwy [.`_ R>nҨdHt|-CO%|c,>ec-ҟPT7 s4_\ 萹 b.V-ɒ` L@ͻ0|:7מa0W= `~%34GDgf:ql S 7L.[>%op7 W4ńip7ߢMK%MR|&A /9aB~D7rIExǎVs~ *HdmᶞcR@X 1AХB-Щn#spUW6DS&@4M?޽b> D1lnl RN 3o3`皟 z3F m-h`m&4 TCw~$iq!]UP wCeEg}Z.LF]fĔr*LI| PcbJB@145{|y)sTB1@5?} ըZ~G|À`sCa.`Oux []yɬߞA[ {&@u^=M$°蒠TY1ؖ< #@:#_֩CKuZp`HGp#[U;#af_Ey`x@uкtQ_vÌgr}-B/$sPhcp n\WЫ{Qlܡ^΃[4 nxVvܟ soZpcX`w\Lwy|`e6^G鿸 j + -kW[+ g+5-SOOC$ȅׁxTʲvTJ(`մHi IDATYo60nx,&;ڮ?v/#<3\|#wQdo4@%hK~|aQ~01pLZhO!δg+ _Uz'YSS`gP&|U`.@ֿ"7[ $HePB/2D"C䪓]O-J@<)@fi@4@q ioʼ?P( 劺}w "gͻ߇0-oҬ]Y5О`BY,h9+*joz?o_nPMPpÎme6-@:6.pZoد[G;k⮟4r=t0, V} ҧw}&=YB{Z ?+i 2ZhR~A 煖6>dZE.4P<$o9c@1']7ǿGX$,Doі$ϥZjma}XD;l0ל?$w(T#$ϘfHd_U }+ _JáL_ ,[&G0/ Wz0bҚ;{ Ĝ`Y*!p-zv O΀SXWu7"qK *Ѐˏj'(.K;>KVsAhݖuJ aJC k8.`. _ ᷛuCxFE rdԮGd YhV~^ ˊQZ[!&Uk5 >v31Q$~ꮿx'vp艾 w"@az\4J $xJ|xXZǠOЕp aP"@p  dȋv`rE e٘wHU9&뀁nFz)TAf9XY+ dw:\+}lA Rp͎ܲ~] z!!< 3Bc>[0.BtFOG.,#'eYCGv%!pCp L6vOT7i2ڗϛ{*!Ig`Ğ$@Ɖ_;ugS;t:E1#@u4s_5`8fePд>|!Sh1OC(]S` Jh79ugqjY.̒0jWh@r$%E')YHzKgxpy*@gl3 2zoj[ \\_GoE\j`p =0i8K "uWo0Xj]WPkm??=b3iWů=<K{,,Y/^(~ ?J+X8%}gM_de &Er) Er^of{yU `6% OX(/e$t!D=0r < ;h*PG=&%K;ƯwFG0}@RtsuAeZ!1ŜS|ٶ.>`I*!tOgZQPho;@з'y bDZsӸ#:;hX_ o v{DkAU1 S 0s`zX-Ki=upKo2ƿ ".gN1srUBH@%sfGYp ڏEwQ"wAA`hXAٺK岕zj2?^rP@u{Z ==oEa8b qT}+d|-Hw";@\~!  )}5nPhmvg`+0sxXh=Kf{D`e&), T @X' 8m 䀬Cs ?r~ ~O`3/eb+δ9f/N/\kE5Dy{8wf-$ѱZ-]0٫SC_Ol߻Ơ|/,8QHAL>({1:?+(=g.(Z!zx;ʀ \A؟7 J}-1bAe'p~xw\N U_ƻ  "6]Ix-T?h^d-֖;}|Q?wVrI&UdrhL썣?%+rTB/-^A҂A,YB1EX k*?.>y/~K<(蝙c̙{O}3]zz2ozxp}qv@"?43 S@:!  v~r{/'߫* pG፺/V¿TVak\t0 e+y[U. G~:z,W"r ^,XW0 _9a^oZ٣&#Hbbdm񜟨,HM{\u_@k֜x,D`{=+P{5ZϪfm^qL=aĶ0%zۀ.gr E3(=K򓷯O5D?cu*%(dci6˅\~ @֩BZsQn$ֿW7ml+F2_ Cp^L(ϻ:\6Oe6~fHj]b bK5h'8gڑa)85+/&RJsqj9([! #'Yca+$@IV7hq}T'WO+*vմrT:9P`d߱( plT.(5n)yl ѷ|@(wMiS|1GHhi[hWE!o!oF_/k A->{J d qEZJy@]%?j YW^5UM_]zڱ@&!/&^L}KQ銠!]aq.h^ . (jj٧A~eOݧ#Ѳޕn~0e {Qw{JVc|zIdTMZ@,x,ֺ/ i^0Q,#KĿƶ [eS89OھH kdspnzn.% V#7% GukO׌[{S@{oޫ4a,St TK0 \w[@0e-8a^7 M$L="MuT ߓ 1EX`~A |]JhgS4T<XI9;G`rP"lmy e@ 'yPp2g^j?@?"h7,GZ@} ihA{tP3n1ִL"ӛɝdv)<0A5ohPPR*t] `2Ba.w٨RCDO+|p^>1r™\&nc/-Ey ] znˑgѵ?fP% b ږc78`aM˜EfM  !q BV0RqkIpTxߖ'Wpϳ^A @3 %0(Ay& i{=%CBZMchK.V0!,~Z`n)_ x)03t._G ̓7 gZML_:`2f=D PNT8!ٯ ?m c$g=׸ya_[ҏ帎qlYP"5+Jhn$(p? (]kUv Z C*Jd`ca %R]*p%@Kj.nd?'k}ঀ? BBV>p}+D)o+up?Pt%:ɭ]AM<6ӂKyaodb ao^U`˧I7$FI2O I 0Њa b.;(H}o8R8쫳$C۷-SI}`\P q {.Xn!P躷}vi>(KsկŻ=/~ t` nW@XyaoQ Whb`{0W@U @62QC) LM7ڴY,9mK\>15U0ʙ挱_R6$z*@)@ϵD|-J(Dе'\,1-%k$56ϿcVR* A>/.~$_ojKomRI6CX*_Ȓ87&@jQ.~: rk.=7nJ'9$+f6G] GbYSCty}xUmm}8w᝿HBCX,htw>ѯ^0HK| ձZO_ͯ>t b-v<9oJrO9@,m,-X<s{Rͥ  bA,g]BbJXEv|tu$U/Z }俨7}m^ E @`yӎZ:p)Q 0ȒyzB&F?~ͱGZfF@=Z1R<6'Kta)ڄc$5V  ,u58b:2 L!k@e.p)DjZB,% P~W2Wb?aKǀCx씄ؑPޘ] zu<߹?FǸ7f6֣<ܽ||fN5D XXw?VA? gGуhXji4﮾3,?ޚ[˂n Jbξ)EB";W d!X1?AE&pa{ H0TGi4a֝+Yp Ta=UeMzs;kJI}>nrxiP??C_.,pN˳G%ʠM:g@5Zߛ3bo0я7,{7sY?4 PcܷCߙ7z䙷X_L~@,ya&KAh<2t}uͲ'r:4>μQoWsR>H'$RC se'5ЉwS~V ml_|oZYٚ- 9ȕ ^!>e4 T}T}WN0[LkR\ϧ(,rFRO3jPyƂI<^"uE oD@TI_N?˲?Lg wa?jDBD@sM# ?BʂaAWv;5Rn?GMKQX;73pĿ~ k.8@煋V ,_|^~V\su3.X]|3XTP>~,cLm"=`$p0kd`$,i P𑷞oK4 G/nи -y`I{8#P^m /7s}[Xw&tljG<-qԴӮfH'<{lؙs+ ?4 Ff!"b^ن 4?~ֿBM_@ \ɜ%ܠK]=ILއ >>@OP0"MpEǾf< DžHU'L3i"x@Rh}NU-@n۷S+{{pߛ )`pp0Y`@?ߪ1 49Vmad_uEۃgahoWBU*[Gˌd(;ޛK$$zʹ}cc]nYbKP4w𿻫 xWHDJ _Y0&?E{v5AOEH,_xMB` ҤiN;1 U8f%LDYXUaV uamKfA-< е^r^$WO䡡_߷>D*!WT`._0`}XdAqd%&g6iQb9e %X>u]5p=$ ^,);pNN+}'_5I.:ߥƸ:1 @/v2bFkkoWBϱ\^ = _@@ };}-A6o.v/1%ǿeYɂgt-:z&>#mXV J 0BN0z, [vty ,#GSUKSpx2=t7>Qr6&n?~ l~“q ?3* -Հ X,TбiA{gʾ1WN_G:gЩ]uY@/gGuX;W. jN/NN}?~b1TZ! EshʿypsGΜ-x{ڻ,6Ie=eXv4ԵH,DMwoWbLw"i \2_ˇ>ٗ,@MQtWb^gaN گ.)nX|]a+Q-xd*Dp 3?g{zEU, L.bķ/ v#7K5A??a~%29CQLA8#(a@5 v$zQL9E ,~}e@]X}{MjiZ *B  ^4|/D ]PD]ٺ`lwXQ ZTXٯ8?}A|) }cnY%#J 4 w/& #0{úYoSt#C|"yDmbp/:#ďV﮾s \ES$腨 Q8JeAh["5%kпT lw _sݵDt"Pňxr(:US%%)Y F4 aB A&VbD'CabLLN{eS8/H) Y|Z_6Qm+H?@>BUU>'ZX$p: S :|JӍ@24qФebݑ vq@LR]k6F^*옙Wۂ*L6`n f\pVTh=z?J]g@?6am}S[%H.~M|Ϟ:b$>9wj hbAt?r޿t/@.U~n=AS>,6:gu_wL둈>g>;jPHeAeh@K. u{=ƀc%g_0 wVw!T&D .yAGdQ?Bt%:9j mlnѾ !%"_oho%,Ŗ+_~[c{׹.q@%{+Y?%E+h[`u 1EiBn D}~ǹs4[@>.(0h'P#;gwo-$29v T] @_}Av&j`6c~_/ac?E``ϗ>g_A!]}Pn[j7 'AhȬz+PtVuN`]n`ld B!1:JH~JM'qjFX=5!y">j?נ}}W@-h].́\z_~_-h@UOG`*( =~k$mC??VEOʍmNs]4s52y@ 6u5Z[[V0 >, bpAEꝬÈ@4LR8yvؼ) ܺE["k_> V 8E`š_'< ,b@{# ېY[?F-TW~ZTKy*c(y0R 𿶦 'p!pSC?T*؞Fٿ|/d 2ϗ_dTTpc=[l R?n Rkz7ْ ZM"*_y' 5 HC,l ͐.295A?޼~ 1'_3#p&`u8s#;K5a:E Ca`Giq@[h&F0 3?" W`/Jq||݋ LO3/nJJr f},]OЎxWu? \Re5??I֎Pg@@kBA~ݸ@h_ 3\b}xnnm ;w\NOJY1H,*iGЋ^? & ?YR9\+B{حmA c@3S-q6e3.VB*_ !aX$ b?B kԾG@Pdy$7#9n!(*f WI6x<0ZZ>k(aR3x%rfK~bƟv^"C??[O]Z@)ǧf澠jT?rã \EPC U@ \tٲ> l,,{&};3YHߘH@u y>ٴŠ؟&&A$94)mNzT$_~<Dj4nm @m}y.,"*γ" o/ b \jz_r|`a?c9H2UB?}WP ܞc O3I˿D7,T~u_?WɌ/].NPh s> kȤD zPHDOsB9O`qA#J`/P@AXѮ^2.ŲZ+؝(oi g=M|=@׿\'öߊ `*aV!Ƈ5 .]G~{:2Bk&ѡo D-34? _ "GPh}8h|̀;Jmmm3դUdr\` P^NeJ! ?)[ / 2 ]% r۴%hːaK_Ȱ J[?.PBl4y0̽?*=njW /)o*<꟞kT ԗ?-Mk[j=$gco]CJ!gAL|u=K/ML?eWs? 3 HzG Ind)k<ѩa Q O e?iN '  >;zN3%CN(%mFB qw/QkGT2cĶlq~44nc/tqq Ȥl_HAąB7XDr*[v,%]PV9`==AM޿Y`)k O?.Dh7+1$}8T:PFRo.G}uE\\H>t6?U,?5~>0$ېb/ {|r< o5g.7  H\.1eHZҒSCCO @(,m?QE{<{PvD0h釹X_8-(Ňw//xAyxyP`39p4BKJVҀ挸 厣˘LP?__PiQHrT+7П_xv{5CM?g'ЊN/˛ >N??~8?Dz|MQ,xo6PD/:jl9_ (kt8c? `*йůlLA=Ph{_<;Obz5 d~)O@ 3k@򦯑>bbF?<Z?Mk3uWĵ#w}&nP:`Y]zû8q!,u QoT?zL ΍4Ne @bۧ |@5`cH<^z̵̀WdG0?3TuN z ܝ`U~Mdo.N~JS?[&|ij@/ ebn\p@@]2X@n(u| ˠO:ΤhG`:\}cj?㷁Zj*\j ;n}(ʗz}J?E3{u`)@Vo0x:] RڬRzZ= Mhˮ-/@K@)ABٕ~:o%o0\7"Y?^1}u-y /{{h_\[ Џ]rOP^l1?&/k`A!AgIƹ|_#E`/m)a[/nzR!uuŒ@P_x8rEBO$7=1?5h[jYj1薼 *m"/ۀeP0ۂ~@?̀E گLB%b~Qgklc^Ay9q7g Gٚ@cЬE,,hG 4/a*H?^T:Gk?t* V۟-ðxWo*Q^'YOdz{_WzaةOIG|W+P6d F .: #DCVLW?~XI@aj"+GLvZs`+3=m_ڂΩI@_; ȜcڤVbŀ?( < z ΋L~`[@l9"vhZd302`~pʜO@$QOt59U`Ǐy/( UKHZ[CmAX.] (0@; A6xLMr+_8rXg+Sv* xLPh[Pg2,TtF·/LA}ȴa?0D#%wuoW; ?mSϷ{ĕp^`90`lrTg᳀-ti6jލå'yX_moQ€'W^CN@ ]!pYer`@yzf  |"̶%ntd IDAT[=Z2c7neSNf0`#[a$׵Xd}<;la 0^ 컂L0_N: ŭ|(QbD 7[qhX'O0ڱ@+8)F.<Щ8}V7? e`>6}btOEZ4?b7OrşT|Ac:{]nAp;f޽MOP4\P9c@-l6d@,{Ct:R|`@=C#([ kH[F?#:SD$ f& P_8"J@|#E6zǚnw7? ѿk-0X{qVV^8W_j *VU`A=A߫,i>#n5[[<t֟B({8j:Y6m?֥{&ճiǩq(ٛc jP5D?~O? fFnܼ~bypibpE|cX{1wM@kh/_(|JC_ }25\%?Z.Ze~)C)@ wi%m; /s|D6NĈxbX{{Cxv|0X z4yF~olXz0hzCq͋*o:)Y-+| ƃpOn[=!c}?|o0@[2gRƕKh%a@i0`=y3[0 X'=w uxB#+L@VD@CPB8 Й1ϒ2;Ӄ?ʇ-8??M4?Ҽn5k(``}qwMeiǖؐj_,TYtGZu}a6Z-i-Z@S:ov-BA* /;[.vR#%PX'9s9smv~I/(y|Sہ'l0YMݻa+Лثj Pna( {+; ?ߛ=%<;9B< fv &ۿ }аɝ^]A=]LJsK_<6 =Wǿcc`)_C*vo|=x_|Xc|@ /d@@}_NR/J̀!'K $rZd/fPͬe6 *ǿC|,Nnjp;pE-ڌ䭖hOվ&q|Y.|fuꔍI~ ¶k΍K c+a U_ `/R=ѣGWz `H ;߲JD8vzQb m7etD.ڴ"SX%{,v:n:@s,|> #خ6u,wUT}_b7Wc /Y?Hla +7ʂ3 DtCk~_{`ޮf:ܚi P'~L\)@t^+]ghׇyKT؟ˀúgh[UKĿOEЏw_+Š 'D1j(L?UREgxgcx zL x0: wGo>( F5 F~z KeQSaF3z 'L =?e@=L0_,Y& +俬TMT7\ bkr0QPEݙ~ֿ dla`0 x&NyD./J€y:b.<ff_oErt!Z!X(@3`-WAP]wn?8[, /Pe*)+LNJb1Zh_a4ߦoR ?ЇԦ0)\żl&Kjħ?0~M PLov0H( 4y@\ ^-BuD$.W:jQ%EQBѶ[<!YobbJ*OkO? y DR;`$P0uaWD$m@Ycl@9d@\94>0D@M oPw09Lj%fQ}Ec~C>$ Q_'.pPW^ޖ|0/Ȝ?J@O9/߼9D/?Lέ_9X0.0+Py)ZpPؑru=N^/tw`@P1$ i-a~I;JbK []Nf!( M j>>_[@Vh2eZ8tNsb(\J/*?be 7 WƁ=q@ף %Akg&@9ao84<(8A( >L3?EE/ڷaGLGLK@Uv.Y?22z6?[`O*3h@+ovenJ??'fI^۹6l€d@5XUTpc5!px73qAЏ~; x/.B،39L hǿ  LZfkH V2pC5P.%Mlyj >0 1 ++a7KPh[KZ &K0i P?{72g ^1O:1 8Gi9ALcD"4#"@̘P@}eS Qc\ ~\Yt7^#_nyz+|#5ч6ޟYHqg@N|a`)a^ P!,y@m-֔5ćvpHdr)Hv-&&q[p쮁H%k;[ [!*k^7Ѐgi,6vR` 1XJ N#:[T$ԏw 6;^/+kCcP<}SD"p ޱ^l e@Wr)_a/AC( BhHu`@c7<ȸ jtKEx LzY 1lNvb1ƀgϾpO d݋Y'PDsQ|8їy(L͊5aW1u. +׿̀+pIZm4'ux?2 Qz8RX`U,硍z[J-o666bK0 b) "T)4fj&2 `tz{Efja{AJW6 IO]?_?[Mnm0ta@~Ǭ! D ]1[ۛe0€wG@|dG T"! B?gvlc-'wpl!ܨLp P˫_ tFgpP,_H_Te6^O;#@F`R1z~97AҟMVWZ`.:=At{@*A@JPH\z S^oih+)*+ZCؗ1 |p1`^< DoBuI@ra_' |v5?[~[wKಡy1A1Lbo:~5(.]/ {xpABDl vQ  G\ B`J>Cl<@i Rޒ9[a!. M"hڧ)_Uc' ‚*i@ 3_L?_ swFYjDo= @]  xz/}J[V]΀c>H+\C @snD@*LV@)R߳xVh/4L0!:-] 9_ 7&/_g ou Ǥm@"?$1H7] gf?`!΀3X0@->WHap0P;*f>sͭH(nſ?)JK` : M9cVfVbcF>`& *laMsu*_v0GMaccxO5 $Vv\.u4@\Ysf0-ynp¡an`W2TTpLL MX#'ܳVl~ɥKB n>*xNcNxmQ}W@_IܿO߹xN?gƀ i⟱bU!#p2 MW%Styj3-y۹ABD.J€` q24 ٵ@,*ubW^ 9ohw,e 8+Uη:0|81YPڈ؟&6F@@w{ F?:s ^@(7Q@?[=ij`MCX\1 4w`@)i,Fŀ; @qvGMJY`6_@P8y@i)J+;E߿SwW*)DŤry IDAT@ TL\G?  5s<^8p1`gЪs] 16u1 9#ʏHXYV `@H&$NC9I@-%HaD%JVBcI 7쾿=7's7 Ez99- d!SVAOnlH !%WĀT!NQ J._V1O$]?|'PxV `<;+<'oī}w&%OI'lsYn ZZmLk[GFlm>IC3xo9M>:m&oJ6AO  !L-m'bs!҅<u ]Q7)hThM.Kl[) :iϾ}J|Wy>xuW6G3@]8A |?j9-ipWc]?8^~?!LX*H]2@E .5 B-c⻀8i 2pQymC0_L6 v0`s[jpNv?ys\5o&OL`@Ju<`}*q{U,ט?N2\ߢM6@k?O Rf |h/aB,MHig 00x+3 /0 a ÀMs ϻJ8|㇉?"]_C ӤoPWjM|bQ^il:,,̇(9 u jN@A/yz Z荡 FP'00w X.1Hzx^pUzC2> ЇqnS5$/ ~H: V_to(_VK2`"-%$nK os  SA]A JezMUd ud2`LLg)c|ݏƶ왘Xv߮2)OwWr_ >'9#%.g-,/dӀL`hUSeu `dFhi@]0 TaUt?!h7":b9ǒ@j)2 6>N{u{_\{w%Br0`HӷM؈h;<6-dO6Fl=ޜ\|nB P %^SPoW2h/VsFThs8:0$@ra sqlR/ q KdY4V.]xRcyh%jKML 1mTg-@?^ߏ43AxSc%%CŽ jh \` \EZ~Oq #y@m}קh+N:q<?\f6521u + lݿ:::;Os7wu.1_V>?>6-YB,R~}S-{Aa (x. ZAh_l :.g. c@.S~!1TQ|g듍v0Νq%xUJD0QF7` /H;;fOߺzT/ fKǼ%  4p@%LuX !`/H0Cu@mSZĀl!; ^@ IpOŶs~]O`6x|\nO珱::ކQ{Gl7pf8w"WC)C[5Ѕ6UzКD{<9h^  d$X6b!`K 6|vdlN(V->%s7=j}w]ogШ ''_o_:@I< *:;04tN? J?v]_N_eҠwԬZW|*W&0R8 X}oXv; z!C+bwX€ܬ `]1`:CkƭೱZ;\r.t? |'(D9Mjh\5-S%{ިݿg\Y?ŪeVAdG6g!CtC#,<&$B^tc!pݐe(/f 40T`%@(cϙ;5/"w\KcVs/?+"n ΀R+>3!?u E3 #aǀHc UW^\ hZt" y{Yɼls~qV8Kecs/']zկ0 я˙<~@- R&Ce'5]%;0`n.yP6{ `<.d=ਸ਼@"?ܵrp\`soNpG Q ۨ (.^Tbx x?$ݮO ?-]@Bƀ0ks`Boo}w*1@ލ&gRPe 8:-b Z`I 2 U(0`@ 9yZ5 X~c(:'yOkO5{|W= c=Zl-weZU- Z[.5R5Nhzi4=y9dje s_\ۘ$#@V `8JX+5G]!{zZ`Qw Z`m:>"-2`^ 3$c )(2ɉo2AHĕGĥ[+J}P2 ۟R笡g<H7} u_geȔnV Dǿ>Iw@x(7?L WBu`\S~xvip\X"m:0@2Ǖjqy^ep\ . .½[xw#0:ifS+W&S-Z.eXcʀY\*_hrF\lŷ7K5@rjd@W2b:=(>:,Jb l Y蟱߉*RᙯEq** 6AӱӜy3drA P h;;j իa w2Uvpr!(P(ggg;qt4-ܿ*K7մMh~pڿD[Z O }Ǻ\׃cVUe\`ƅڪz/+A3(4Q],\ZMq ~YH|ߗX_ ˯BW.#^n_GrSU 760p$ޯ?'>U|+oc/URUr+?ƀUe9 p {%R_X?ɾEKݿ`\hY3\̀4a+?8dt}1!e:8-]@]*p^@VĿ1@1:pXr@Gp 8o\>+E>}sp䐴 dx\ i[S 7'J#ya_? b>O~2;ȘO^5\+?b~~%>, }#muC",uVdAK)͖"?_q0Խ8-o#ͭ\CR\ )?p}і~b$ ! 3Z׼'t!Q1 #%- ~ iE>9</pUAi+>Q0 `Z(c ؍|Yp0mHo_Ζ[Y9m8D %2A&ܰm4G,ߦXLb ML)%(|BZ '-@n `Udk)( u 2-K1]@c`"C30 bB &03fM~rɰaoI`K'0ݘ}l6{xOj @iQUh]H˓q`ǣ@"+T_D&B`^!=|3(:X1<'H1`|Ъ<303^X^6,),QjF^3ڤa`7- a9hHC # ,( L{He~˼u㮝g6NC8V{ϫrI~6,&hxx5̈Ep@xk#F;cpi@Z^CAin;.y $g4 ڟSm@8=WR.@_^0ʅ$\XLz2yw-C(L[0r`IM|4_iSŏ]~ԭ1A81I`kqI#$3j+Ap# in!-4bO3aK!oP|m>;Qa12 IDATKo^0}Y;̘"],./F[l1rKLJOH[|LmQHY],F,K- /x tOz=7:cq~#wf u ,O6o  `r r?Oq#e K5Wp\-B#s.N>vrOJy?R7'iOvC@9ף>իѸ.5yqN8 GZf473I3lg22".PfJG S/",Jqu!B=;p ySD=J5䀱 M~ɚ%ٝHq&8z釉&P1xhqc onl|-ﯪ /?`c!kE=}L Vnw.H ûppV/i6 iRPln?3oTO}h0!6 *Zn``I3|_._A9&u= GՎ M'XgG0" Zu}⍂X@g=ࢃl&G+dN#AϮ r0mggY P(t.ZyS%'ƕCzgcUY%=h3(Q `^:;d <~%,W%r{ j dDd@G5WcN Ka頥xʳ?'j%j FOH#dá×SW^7?nOep (Q\A@68U4ddsǦD͚U0[ ~L5if uj/z٩Z 8jwM'&<|2 & No|,QhnAX/d@[t @*iO!9I_ #)`@Dže *8WvpPF\1c}F1 /+}$ 8zk?}pOz$cw8&1}P!9!#o_U8( q@H)4l1Ti1rjo C_:|."7l^_NPs']\О;@M8ɇN?vs U~.k2A0pG2 p] \&wBeʴ|O?y_)p X75QZ5(XEٗZ/P\33jw2d6F8ɧF"K\PC^}gm+ۢK^(n/P*ʄ^< L&N ln."Eƕ Cf4'x>j*{'9{T?bWM FX7*`2`W>j.tfF8i2 X6@19 ooHjpf`ISR$O/64o|6⿒j?l`X-7o$ a\e}(ĖپX'{L{8@0ГĮ+쑲 +[sWa3Q>r9GgjTQ߶W 'X攏̉ۇPT_<[ͥ$}nXG\@^$ Hc1!M*;H~dkSeXz*/>K뉟}ZwMH)D$^?4GŖGkC^-$MPjvZ/cn@><ݮmA`pkC u3򯟏v̡|zfE;3rojڇ3sn߀ l#j]^ր/Z@Nס|߰ 0H@oz1Ibh0hu6XWxŸ{ePGF*@ޫV)МWIW[%/lk9ջp5 ANJ(J#iŰhp^#4&Ku zdP%pw;?YPnt6KyJXsQ{UK\SMA/ۍDY1~w|[ǀ<ҿ0i֫0̟jMcP[66S}M3^yFs@6y?DĿ#9`"Fgn(DAsY$t>L ߷ ?!  /#m023 =>4 :/B_W5\nOkh9`F:ռf`_"E?; y1( (+!?5?6o =KG5v2U@DDmG<p3A1 Z5\݌%()IbQ;5̀ i~Ng32O^NnH.*@W@eץЦwZ>}kT;|;?I ʹ|3_"ق\PRag:3%Fq!/9@)|oq@!٦pw ?}: D' 7Icf(d BYlx^ӟoV\OP]w|zaG3>nC\o1^ e0 N}  7>|ӟXz&1x;:7S/9 p嗥o+ĆkAd6X74O‎l. qT8nFƑwSAbRGh2r-4ji??vz KV6׫,c%0S9h CX( ڲ#(-V-m $\ɳ㟞 r>a2ՠ{}; V_sR2#_/ݱ/?[pZ8?GO&6Ux,'f 'm4(`Lj,Ј yGed] ] !=Co>2`s9.όs o / fq/B;)*1/n">+a! p .?Fe8,jpb/ 7{8{f~%%ϵ-#?J+lДS2.@״k(Ʊh'h)jtd 8GQ( ̀^Н&0k#De߽e"MpS'wO^R|E(HebP2;)_ռg{KZk:dO(v2\P CXVKiE(腟|xɠkȥ•rMyzZ238R m7ߛ{vqpe&{h+  ?`Am RC>E?IꏔD+ fp}kv;5]mP WQOv |ZjEù%Nk|P]^0iJ- &b@mѳOg?3<׫⿌0?>iN¼Y?SYfj k?Gv!H8-_H@v15 j@(F]GU*3Lң+Ilj, ;?Kw\=!dq+RV P'y?$)@kP܂xoD4H9`hsep O̐>}?_wO[ҿߕO5^b7X~MAkMkspi0~A0k֫L/ȦN!AIQ6 M%C.3Jg8;KQۿwQ*׀I} U~E p^ C*?qӓxB.RQR+Hg?J_rN]a.@ +( "\峽[ׄZ4.ӺX/D\KZYx!nw.]:M r=pNyHr9{6oq?(HFOe0.l@Vӯ*u=Xf OOӒ Sk+  sw,n%Y!cY AՌW gZW{8_V!"%9rKÈgǿ4]Q(> 8s\M S%>7=AbY IiTȞjp IDAT55hb~="PĀ_~~kY`/` D_ get #QleYi󎏲LH Jm+BTư P>X,&?ߪ/xCK9zv! ߵo3Eq.nal8秒2KncĿTe6%>p,Ek2%{x +3CrIw/MơI H"wrH De)iq: /]©0 BmO`KKƵS{ `= 5R \z ~,'0`{a6|J|d 4#VT8XvSh{UOq_m?5$uBbaSzWLTMzw04Xbھ)j8?߭[8C=6 H_=M6sɗgFҩ($,ל/|'f?\cNV{Z@X f&5\/.bH دG=NK !mT:ʆaz| -EO%H c2bGʸu%fmEc 5AQ?j<}- ƀ'*cOdaE>,{.E҆ NaN/|nԪ/L-@ ?s A N=F 0C RWc~- ?r}&?ٽ9[ -@j_=C - ~w&Vg%F7!JU NfLjPMh2^03/mM, 0#Yn0 b3l{YlĐ57Uh , e_JX d' p/j/Ca@*鬈H @~͹Hq` 'g-?8- HĠ-w`[ HS/[Sbh\20P4Ffp[_ſZcg@䋴$Yk6;@HO,fr7$$Xj ߖaJ ?`ACNjFw0@ۇloMG$Y1hX8[`E-8[GظŸ2 \!N"f0 dSl"À,!i1@ɆXzyHL$ Rkp(ĉY]>hp`! <">4v3^?<؍3\Q3 ({ @o77_Ь+%JCu--V\N@@b)O@&!%XxWcS~mM*<б@dA RS5?1]t =^Zp')Ro V^u! v {"` *P#318}R@o. Pa@ѵ\lTBL &O`@u'YbY5_ќMeUCCa0` SWvU 5\__Og+.!ߜͲr@,??Wo :%_l w'tØJ|y j̠3Lv ,` ߯67E%~q7(8o2kc9[-.,_U: ȏE>u 5q]Odze>Cb0 ZR'>̠LA6@P iPM [Tpowj\Z64Ff}sϏ4 鯊_c?i 1TǠć0 b+a`SYY0' Z*G%̴ BC|7㟅[DAE>Ύ|5YP.]6НC+U4R~i(mB(Jj''E١W~j,@6 cqpO9x]@$"b=G|zV-;e6bWh%~ᄌ1{]yА/ ;@k=#C* ׻AC &!%k0-ƷA;5x[ K-h"|6X:q_fbpؕgi^^>cpl.'"bݎC:0`qgudz=|è?u{]?ח$8SASLD%qD^`Mdbb0Ʈ@lο,I[V-ԿAN)tlT*kvzUzrW kϤ>nK5#й;'Y`z7^- 3(˂ lF!5=n2A 0>r:yc(VO!SV lea"9{&/X6* `"ϲGAzn1lsZL#um:G + B1MOSw;w17beJ(=!@øv'otfA}K#V`` ,[e`dDX`C.jPLP>?2 F[PAe AAʔDâm 4BT.D{u|73=gn`.>L X= `}vo(7C}@LOc5Ǜ4,Kub0qa0V#ZoY*5X͞1O7- hPn}DX5Y 3 +x,Ӏ `i)Pƿ4Vn_4|'D;ROjp*0u+?Jogp0 \:b~.1Z| 1(ׅT̠YoׇK:i`I k#9($2Ӂ^`tׇ=hXY]vWԷ2#^P>r8U2"ދt p>yE @K5S ]@ o&_bbc[. *93A E.j%m0r @ [A NZAUwrR8-?_Eb&1?,RP+V~Տ ?@z ,ϭoJuj >Ls7%9 @/Po* HL/ߛLe:vBHP(6?TAgZ}~n{9) oRa[אIMXO] l(S&`Czٺ<. #Ѷ{Xxxn?Wgߥ=KC0g8| cf%zMȓ]h:Q "d8n[PɴW:m70G6V=Ԡn@/χ_/ZVq]bUX1@$5܅u{ gӧO(?8l !6X7@[窓Tqc;AK6%zlm|7xͅH}C^]څT 2MqO?xu`1IzŴa >w;}"oOkw*p`xحHp(EO-`@5>8Xߜ^s$X>lP) @?tlxBr΁uJv7"E@ )RG' `AvK/{g>b2_ |n  YϜӍWF)I_͝p/ +#'׿aNg3^ڥreal Vv*A%DsP=<5ؐܰr֍`ĿZfT% p8^|•uOswAaxn &<1̠(Ў)xgnȹ^RYur?"uzlggQ? FG%!@)}+G;q` 0Tn8}Lj@i6x+?qP7D?z ͅM;%<9x2 ?G|7>aܦ5 6Ҁ`d Tv( ?C FuNiWJ#=(y`6r|0`4߿_q'F73^,bım0:rs3M*-/+?Dl 1 [ ;ߣndűb%¡r8?l7ᰵ8rq6jyGÿޞԋ bk#Gg_м0):<@q|U)SuHN"FNܴpDp.0qGSҕG%ת4o J;%u"ÍuӁ ;_憋낒ukM>[L% 4j P`(%k(ڠG}@~ԍl hzPx:b^_|M! Qflhf#աu7F d7f9%wȱ@^#XtHX3h]m&ܤ@ 7xQu IӋ7X?*߫unz#]u}"7 $ J 0?aCt0R``(.FR=S#{8Rѐtj fW4ExfA[7 L8ze $ns^c)7VpF-'Jk gW0iF7 CNp_RT½:c*T 3>+H qn›!_;ߏC*[#p0->70O|u r9=)Y}(홟 $|h'|X8o /!aVYp=a0a7 H5~؇SL} g+ )X{V#W0 `D>lݢQp #lEg`),|?wߊ^|l6Iu :&`吔+TC|[WiQMD7` xJf@-—{E,Q+MVC0ͼ􅤙̥/U`EǍMH2o c c3Ee?.83L514|F`cG;݈e(kf%K~]L(1b>^yJ x~TT" _l]:-ʄ;ث+> hO>%!ohUMhЗJ6Fcxzv_{*`G)/& Aέ)@t&%oΆd =ec;o.0{DK+s[ۅMO/\?yՙ[nR7/0}mxhU{pdy*s9l2b:/ٹ緥v3K X?71yGg,33G~,tu>ٿ[/ CA٥saN?OLR֮BuT;gHeήL"'}<pxIU\j1IDAT';k8^4೫жnGi 7[& di ؾxn(LP7$s##'PБ0kpAooS92ؿsf7, Wy$ N㹟LY,s~aoK=̀/w;T8ܻ/tufAv>o3g"We\a3`{.U-]~29K'0?=78H f $H A $ H Zn\~Qqnk%Mx!Gc4j&b*JLQr6y+D!B PL@Ri:NgzjqRZx'AЂ$LLju27l7WL(D4,H _8R…ՠM(jg~/@O)9tZNXmRG:W*bObkT/`ގtÆTE`Jh|iRe@K*Co Uf z.t+wPI$ e@RWx AMah} J|JTrk0+O8g ^Ɋl_R dl4L ]@%uIyGvfpʄepҶ@\), S:sR:zj_Ҥ?rx󞔩.=9.G(ꆻ 9(@C'؀ F5h W&B>@I.3GD[ 4CQ/(i'=@V|#6(VCx' hv/e$-]PW6P>ة5B4 kdcOn@{:=pmDl@8 ҖPzDB{ xSBܔ@@1>Kiv9pd@H0!aTkk-ꁱA9VbHWb >9,@H q> ȱFZR6"ҕ Z LʈR <ȨXϤ:$ * >kxV77`6;hAj]jBQl@caMJbv&X}2/|ogk }{kߒu{V"/oru_Qʯ>Q~+?ty xI}c,9 ?TsOI1Rs胿_*H A $H A $H>E|4IENDB`goxel-0.8.1/screenshots/screenshot-dicom.png000066400000000000000000002342721334742672700212030ustar00rootroot00000000000000PNG  IHDR  ]gAMA asRGBtEXtSoftwaregnome-screenshot>PLTE999MMMGGGhhLT\TY~rrrff222AAA<<>>ZZZ```QQQCCCmmmttt,,,kkkOOOuuu~~~cccgggȋEEEǑͿ000qqq###///VVV\\\***888___bbbNNN666zzzeeeSSSŞ))) }}}oooyyyоpppfff՟@@@LLL|||WWW]]]444%%%III{{{س;;;ܒۭFFFߗ^^^佽֯ބ 凇ݪ:::⚚ᩩ555777..."""vvnn ''BBee__''}}33f++WXXК#ӌOO9Կ''99sQWskkqqzǭ##F.MTaOViڥ葓 IDATxkLkfz^(FCےmŵ.`]IE`(BvY?pIĨADC4 ѐ /GorUH{Bf|73 8ؖt $A aП _:.="|fvl%p3<<}5l/mgf^K'A4>o!;6Ip_doKhz WA<Ҭ fjPeثՂ*C/p?e` `&Yl8*-D235ƣ%Z\{M8Sb3O/V"K,f˷|N N~%X Aw,@9PJ0\?ˏdm/?׳ oمP` PggXA. Ċ 27 Ƨ7X/ì /؅ 뉕ϧ_nA oXAƘR-d~-} (lYr2<<8I֊H.+ N0A0)W־?Y85.ӛ_枎 OphD O ? CYAEް*0A&" 1͂_ M^y 2|hhFl$%+9Rt45h遈SA=PtHm33$ @ĵ $A @ H @Ŀ Iq# դƫ|ک'sOeePOiKdNj@-#wΠUU*CA($ۭH\nonk? x:3S߅ttt|>uXuwaK(%>e(M29J! c/…݀˥ihӟxcw F[#hN<6@n2DbJ*fAkUj~mI@D 38#@R45왎]+^b coHϔUjkS ['JH./kD==ok ŢRd9K5(Xx7H9A.HI2=gW(@Sv0'ORi"h"6Ď { t:j>.+rOOQ$rX+!mm$2RT+b|>, 0net~) AX=lD"I*wm #HnniPXY4xD]@H7JB=Q^ŰEMk(Ț C 8V17LE,aق>+Bas 1@&}kaM@+sGgyH5pXd7 OzgLNNO؛#CɴJ}K;80leN 舛%7ZB"i(s`2a,Ͱ)m7 w&VJ,V$Q!ɲXfNEd"P.m-d۫XW0܅&hlJpxtx |\rr+\]BB@`OD%Ә,Q=>5t9E- Щu`SшǍFkSdpT{ n bFg6 &SA} {_}R=Ѭh‹ TE=*[Wt^o]jge 4 tMR M݈VШjv҂n cD(\"YY4p nwoZxR;@h{B& @NӴ u tYVz@7=N8vhׇFܻ808<R)Z_o/`4pxa!h ^!( ,utR*Td!2z=8v>_g?n_i6 Ry4\cB  . G@^ϕϱ ?}7LV罪Phkf=% ka@8`hhcek;JYs ̶a*P&6C!@...\0Dz-NK{sK/{<< (B>%[م"gD+>iȵ`AKE??e" ?lX GHk4n ;95SqnT֒;e֕vT>Uu=NL{I+y]A[W>ьjUM]VFǍֺkKĘ= %v2IjiU}L[9|U6̂Y $HP_( } dg5nΣd ?@Rl'p d9@cWЌW8WT+ss ~qSV܍ XYA$%2.Am-@JKCx;;u-BS6n\ 1&̡VƀΥ{W@vvNvSF x$~/qv2 ơt9>a ??h˗?ï<@EBUEHXZN"K ;ɾ.}k'kǏq)Ҟ%k x@~Vbr9Q:!v{q{] 55&Y ) %Au djd ]}S7uqrփpIb 3|Cߡд?f /O ?}>J] #'f ӧv<{N*i8RE;4 Ck@Q h4@j ;rqၫ}6 1VY(3՚o8+˹݆KXk:91pS$7@~ TUxzSh)Ձ JpU*"臷@<' v\X3.?j0-=ab0PVP[( FCQƋ'nȅ1l#ù} 0fXtJ` +SяBHwۣ/_}+Ӫ@Pi5[ iȑ4P푕% Y2@6#ÁJL昢i:‹ 8W:!:3dKY)WC\{ ͗,0@8A &"4*1, A&<]99(y2D~=cܾ=44UNBE'Tg-,mm] AB|Y=`PkO_^;5UZU諔_YʇVt)sYUAn7(9_2a 1xp֛nǛ[@x#1u5̺<$[RCu$Z[KSZ: TJѵ1Rv)hd!\sEELowex8 HAdz##J҈oyzzP o0C$RVIMWIQK`o7i'9C ?7ߤ F#,MLBm|]%+뛝=IĶʬ+066WW"6O,BkDaK'bjD]yb}uSm ׻Bш/ipI}K@ (p$>hZ4# (b}2FkLXު_hHOrbigPUv|Qi}::cH4&ź"|篣Ǜ7o^@@ܽ[' N.m{c||d|WPG'_"*gq>e.5#rhltqE߂Y !tTX{:,\ʞO3J+}H FAq4V!h ƨi\81&16*FÔe:3.Ky.=SJo9߳]G^*4WAן!t5D l61+%NHiHrr+<}-e=n4b) _¯쓏/۷V_B@ %-TϾ5HׅF:0z0 biUDoju^ ^Tϛ ?Ѥ,6S5.rL8 #(<^^H@ж8MkAz^ХX *dT7 g)u|ޓ dΕXa9b<0iv;zRK$|FJ_bd V V] Ш$Bp1Dj0hI"#$t-4pu8  syW<ߗ IDATsBO_M! o57 sx@K ##pT"IkB{=0P2tP(Ɔ`P8H[M^.jCCF5 @쀒D/HIJ ;4AbVI$#'8ӏ1-JS''^" OK$9ifw<+//w:! +#|ϳWMWո ;;[Zkχ_PQ[(ܡ[ɔ|N FG-)@A/fTu5}Vq_)Z5^ 9C5bm|8I@Doy<JV&"x 7Q+GO%0A]#ZdGonc8 &c7 [(L,myŮ׽v.P{R~x:;ӳ7_5X[]EH$o"<D O~>7`7l1~Z^QXշʪR>QaIK,/##B"ܖNfj〼}fG2>>m!yPbWN"&V&.(9Fȹs!gٞXy}i/7N޸aו#Ip8Cdpp=}CvOM;(Ѳi|گ]Stư }}ުxPn%Uw0C7ƀhr\&ׇBdG,yI@'9 n=!g/mخQ27xiCmcϳ&o5]y>dxpkx֥KndH-@j@dm$O|Ks&9χdUZj8 6Xt2ɌFL*` ^iߵV')e⎫G Bv壤eB@274F_E:Tϰ+_, 뫦NgNZN$@H FGɄa/~sG@0ZPy,oߜ?szЇ$LKkjq'JHȿ;=amynB@Q$EBLd)Pd2JSQ@EFA)ѣ\M7k p}$]!xY. FّRd0ȍ) YB\Rbټ~CTjc#W`cs@xאg6hi[.^" # 7L̶5ԗ7K˴ kl/x9eKAkhl&Tu%<쬮^W8: eeev{ vãw]Rl}bv6NMKKkՀDzaT(%R>FE(K5lX`cC@0"Eb)o] d(bbx;sHFÊ+Xȁ\b>ǢSf>siCč;'qOC" X?wLLyө]/Wڪ׻57ʇz6V{Nt&SSTE-qln6pÇ_gJ\"5XZF$mQ w`,Efb= m3Yd6O u$*KR${X} U[jIUP,v tyH:riC$(=H <uA&e~9 :;OLW(.7d! u:EWz}\MMvpsp{o)E>7! :)d>(9HL7 vZg8iQ>8 #J`0H <Cȩi# \]"y2%Z>̄GJZc?f /dzzzzQ^?zBe /[6/)A& + ::vw0l I8@r1vDo,n 9 )&qK:+Kshy  jYʁOxr30Z[4{{/āCEtBe| XW'r9bri.μ`lQC,d}# ǥ/3m󺆆tHS[պ>@RUvQ{sUUci##G#,C9BeA(y "UV # JvŰ )UPj5DL&Uj-2"_WB Hc0b8 h(_ $wƸ tL"#IW\CV3˹@~|,_`Bytbe/*/?*|F9@BBE,[+<))X\\L}dƎDxD&M|ei܄-@l, [0F @x ^a`hj5@٧5Rh?z(UA?R,jpU(M?bL~|69W}:S/(hkj .THֹ͌SI@Tnۗ .t((S"?0z^9yg\M; R! /bT DSSr[mgD*oharrֵcGjlt#f/VFb KGO3bpoR.~EiFnl7YtX$$X|&*e8d4GRm/e 1"67#3E\PyL)KN9뫴ڣ,+ D^x׮O/er HSE WO10|9<|spaԘuz Z[B ]d?Y7PсD҄~ҐnwGNrIfZ$ E<6H}!" 4 Ԡ%" cuw!\=? % 9^eXe_<#Zowf^MOw+td,Qc̟ʲ8n(@DAD$F1vW$a1F(5HKĖ6vMJR5oͽ!!Lj)NY^=_{ϹmM7nTWw~ A~t0nĆ[t@Wsq94aM'AȔr9H֓ ]RI[9u8@;vˀE@n)^JR`׮`/̦4GK#I@Z)W`Vz-hl=CAZnn܅73 /p-UR t: ΅VU} &fffB3΅aLYt%Ok LX|@7ZJ Ci_!!Bnf lJ8՟Wj*LL!`d2YnWdivDf/}磻83 8^N N`}訍\ m+yPl! SeS(ŒӣԺNȜw6*&d;w@3ږ>07G4M!C=׮%'+֮N2pCB⊦[F__!Ga+,t0H{.օ[u, څJ}d%~]FALdD63nDc_"% AȈYšQZ q\xtXf^OXD 1ْlI|ylp4 G ˗G;:TDܲh"M?iXj"xrioi\m?rԦk9Ga\=ӒCxJ` +Wpq˃z;]?ߋʠZjIÀO.WDF՗.EGI%My++]‚pАq/d[BZVͣXRB:׷'SlF>F)r:)@@"͎m#@@} ]R h9L\8ZT֡ >'%W=}IdɱccQ0 }s_뵒`'@7q=fxj#YAzHS>}suW)3HCܭ9Ƶ rIV2`At`"ag*񱴬 ꮀZk܄NzxT/wDc{ҏOpV햭 qy4kܛP6!hGO= iL9(dx4*kH@Fcb$(Q$`"@>ݻЪ{[Ʉox 9xpo "@( %.ؿ99kk>) E⁞-BLF]_~ҍ^P{mЯ(!8: ۃ%"FI@LO15 O0 Q8ryjjI3tцNjO'<ܺBP 2cc/C@XC$ \u~d99a&-!_r PS*jq$:82Ŧ:<{ {oPcm BЋXo*@~+:JmТ<@r*22 !#p/NI)H7K^hF|S)@; DH(9{K_h#GԘ+-Сgme$ cJdC 4 ^i@i@O(XJDh w9U?*DXAh i+咺€w=cϐHr:4gNԞ,]g< m fe^+ɤe5$ {qnq/` R9_"I€XG*z ǀ$DS/*# % w}˗Ş Ekj}HLb(`^1a{ƈk;ЧPe-0虙^5@0Bء<TWm+ lF #r.Ǐ u5?pK]=b I,w$ h/@q26^Ȓzil젼*]mx2%G/_\-@*ih7{֕܄DDW5`hU/>Mj|E J!Y42Im3:D3Ӯߚsj&f-|Qqg}aB e4_F O~/1{c#\6G`,Yf^/Ok# TèJ\!7 F'@- ([Vaazc@X σ϶xb3 Ess6#@C@֯o^@ wɪ# t!;$=77. ơ!:]ݻzsUI멩-SIL&C:/>J(,! 0_ W _F $aQA;Q2|YRC8#@UV@% 78Iޜ1{DDfIUpD} DZ}z ;ML D>Wށ+ HQ N0\oyxJ==5vQ^y梉w2X)t?gg=ݾ.) &|ERZ:9ǁjK5? m8 П_98X^6yvVgބLX+үe$j@rQbX\7gqu덍55µ^,='ݺR)o]> EGԸ f (ŋN-GJ9áI9Q/ׄwI[VG5t7zyQx:O@RNnjІ_qZ+`t4482rsug vXW׵wuL \eEpĸ40R9ݮW0gPhl!99^LP WjpUS0lxc;6_ŭ^M+5_RPH_EfgGG*)Kzs%q,DIYE᢬@x~ 72O lɹX! 4ozZ y]ⰽXY^2iޔޕg8 >c/(Bsܩ@bŋNuHcc4lB7 $.qw*#@!*Qor!cb?d/J 5 ϟOXHwa_\ 9s8'ټHZLTt\h|@v%G zda0 !q.7RV&K~@wAm< )` %%k H[TJdpvqƍAֱ%l )46W蓶=h4Zdf3K$&MWQ yyֆcU27\2X5y/07fF~I7V"FѹY|U($vBtPl8A@~Ήlpw:1FD;+IB- f Ey ІXփwK^dB@Zރ%d4Yf` ڌM] @Fx%VB_杙mX C@d9 D@ Uc dj$ @ee~ ԢoyN JBFeV<IS "%Ї׆gB-Jhh6&<y0?F@LggZxIojibFdЗx,.FA{3Ɓ{GNMͷ3$RY0Wu+77E Q|+Rݢ|.KNIapoa*rp/qR 8<V Ƭrv8W3dX%5\+Kjh*2Bai喣 dʜ1b̌kfe滝9%oϫ{?wy3&9{ ȁW?6+XÛnqZ%%*SWL%%U@JV ڦVϿzaLҵ w@L3m傟#u )C3,qRQF !T5S )`jf2LA&&qov5CP `Vk),;@vW|0/P;q dbA72;frxhC7:^+F}#7 }+Ώ#nm}a8tv껝/~.lbc]UU-@bS xDp<> `1  p+;'b  ]rojNt1?LFfR(_q)p*{.x;x5O@m C_r_{gӊ~{vwYy^ߋ٦wi;@J򎎾JC0I:fjh2[F@ל1F Gxd|"J*)rHc,4@@Jk bP1q!^ ,߲_ >6(GPh 5Ƙ`S&ұ70!f-_9"C or?~B ʎG$2os ZÖ!(eLuX?k.T@ L_ yppfO Ê|i [rW"EBZr0*GPʟN¡%_ (s@B k ̀#('Eݝ:?h}9Q$:B$C0ץ(uc ɢStL7@"> )7?8©t{ B*VV{Fԛ[efz EGaqq> vȖ4D2"9/ @1@"(  5S,/'z |t:4?αXU 6`X=)b {u(ǰ,B*@=56H~$S8Y B ?8H㗛I_ p *\Uc0TU}$46aL( OJjD=o ꁹ'2)A-uoRxPh/]6>@(: ^aw4+o@ sW>6;ۥV0qz *IZjKW$]nrN 4&& JOбhA}Q# 2~LA Er ݗ GXA4!(  B!`H]G_-DtNau>@ kkdO҇5) +5+ [NJrr7u=@z{nW8{߷XHIXTSozf<@ 1+,`fFQX;a˗̆ЇQ.W9/ba4j(K` f@fۄl:!\N*B}W6  mH$yry~y䇭#;W߹m*0@^ǁXkS!LKK.UlHoRVL[~}Qm4> dA  @HgT,@UPEϵ[@vZؕnu7xx8wxv8J0 5*+À KE"_ jM0&q"ڵ_^܈0hEX߿WF{APi 7$jsMڭĎ/\c~->o@ޖFG8䡛PcjD,--9󊊊ƮAɨ끥F/@~\W9pw-|9,{MQow"" GEɃY1bb-9лt$) T1'MNϐ L1 u9R'o5l?}hvN0 թ<^17Ly\nؖɴ15@Lk@.H#qq@iZ^:GFP ˱!ԭEW=MQT"9aqa 9`l:m Ek~HEk2 !r`hYɑ9SÃ)jVU@ K Ŭ'*W_o0ؼ@yF/-`}󲬥Q|Aqe;n`@FeY0`U0Iv1f H;!0?]nsb"q8 SS.XQI$b^jڊ?V+E*[@,NhUVH%{cb|Q@~ǧN f45qXT\()j$,&(Tؤ` E5b\F!Ew/ßqt;Nמ53 &Y2q1U=sK^ "I^ /x )ݱ ]]V@NH l.t-&^_v; c1UQ$0ܧ~^CfsXr{:t}  8&6Y~bg WZ:ueІ@TU+b(3)c"Ai%NWFcͽ4`0xfkDVd:Z(\F@6F!>3BC !ѽ@vN qF1(H%wm\c}Ѭg7 _~t gr'P/r W{3̬$$!!'MItfkFl^Tv; Z.K AQaϷZ)i Ԉ(qtaAHĒ*YhsLMΨgrZM|Zqa%^jA@9 da@>5)H?@ ۪U3p! rnjD2K*M&e[Z6_ RZ:"oH:9!}T_LfKB6IZ-@ w#*.7tM etB.]ص,3hyg> a$y|>PQv>8copl@AɓҬ3QJ $1>ʊt!HZppvV^% S4nRFm * et'% !@[B5~`Vyb |_,Կߡ H~ x|߉YK@t'=+$)J<^1\eLNZ*djŗ;dD5  y$$'elͿٻ?~>*I$CJmY&iTf,`䞱Ya7vfg>ebxn__OKffсN׳_&rLɨ= O,8/Px˗:$w%3tg,P.93cuuG` O~<:;= m>R t%No0sрw$|%c9VFxF.hQ|P>㞚5eV.MC 554xci[Tffdрaii2/~MPn; -m3qqb1k/ҚO0f8۷cL#EHTN:g9yIg1J(zF WFHHڼb^!o 2aةGH UtA %cf]bܷƢwhj+rRAVLZs&^UQXa @y8Nе@V@.A + . D <:jE_B+ @\:/|>aS}h0`b|܁'RcnM S;;w )d. 4nj2[<޶饥ab $613-ZW]]4Ҽ 7< c7 I1h b03SYTT11-$㏒nEN$Ȭ_cʠ?-yt%%%9nA_ t/q Ew1a/KaCzua\/r5~ 9Od>w$w67߸ݥj,mɄȃx3Vqv{BHjvvf&f:k jxh o5"Ċv$v~sk$0)!\"DYiS/N]F|`?lhv{#  _ } UA [o޴A l2B ӖF/C7ej`y#, ,7"Uu-LNVmaxqRH'ڞ5>yt99D*@Ȼ@J:'ā- ]g]$%o:z(t9g !1= E Db<$o\9@ܫ>\@6eA/C2!Y*YtwC MۚbcE)@$OrOpVWʴqG )s`)},.9 ch\6Oc,%F:+ĨT $f[CPS!{@PO[?:)Hԝ"?r`\q#}y s'NgUg&X,ZjjR"їb(cmMC&M. D/XDF9],ҏ= Rbw8t~ IDATE$wm>æJOc1g}V1F"/o Ӂ@ҿyդh>w@'/aG[mڪA@J\6uRPd{5kB J%@ DG*K\08I߳ܛ̟]uIItŒ ,mjζB mm^t!.%&4B! K U͆`hp9p Ma N饬 "HLx4yPP0XJ) Y=sѹ1=2 ]| ԇ1@Wq<[ tw? AV#kk5U*. o<\}z&SZ[/3 FTr29`T5kH~aZN@d1@x85@@Eq]]M."2| 5ٻ?];Oݛ=Xl@l%2!b<|NU{mH ͊ g [[Kq&l^~Ռ8 B HI156,\@g|`S'[Z3@X`0a7kM`q-ިc[ċ,$`|-ANHPgf0NȻ@ѥG?}pH$^{|L?9lCc ~rf@ ia/#@xx v\aeie7\/VHVęvm9@ L7,Mhlp!DxMJ,DoGq! R)x%QΫźʉ f{ەطL|켲V Adb"2 H6e|79 STr~bqu|d4yC QUz:gX\i;f]XR(jjm:Fpjk^\(,ӗֺbX!"<: O_Gcgf(':Lǽ\1$74%t+F#r?U$L藚" ]hVҽ@c#\Ջ>PG@O d(GO@oD|'.|p8 J!'U 7etW4QA. \.8AĘL& /vs`0olh gald\7gg^6xACXAk@ @Y 5 /Q<̃V5-5/`ŵ]T C~h=$$6!jտ?{d_#uooyِ  0H 6k/pI)1DRq9{Jc..1# 伢q}x}ADF0-E =FIABVv^Ƽ/?9 Z=@`@I=0DrQ9Sv@ Yvo _"?{}/r2\S_#){/B rAfh}f0ئKK'ha I |@x&wrX /?Ϝ&F,Kt 7 ^ lY\.<.\Qw7`\Cy} ÜEAQft2; @{~90 π .'sC5WH@Jt n1*8w`P@lAA 2Fu>FwjB2bbP댰Ũ23aKFFB Qu+n g **R L,-hEZ[d+7zQmOX) -\$͆]9te~LE, q0B~r4$c[)yޮv40,#҄Ųa<%R1( a7%Ŕv/ ,fb6BSghv<,nW'z!v;=s7ï-bGih7oH 4 !ِ_><@nQGL5 ;ʦaXwjRx$VF?x5 {(S/oKo:֡Uadl-hn;*ɭR 4aڜVW\Ed:]%#PTpv1>r2@ TA|[;*;:?? GrqfR a ~QYJ_E3vl=dTN45!RapA-:o vgP)q3@FjsOb]^:cчc638hV7**zdvg╃eS>Y7f&kA@|Xkޮi(1* JVVb-DVĒ=((B@19%逝N֥nUGf#C^De%gEQ22O< ?}ʜ<<Fp ˰S0Ip"F;K+^Js ;ٿ}MÇo?4#wOIi3?rRT|KExT݂CIr q (!$QoRDM2]K3v|#У;s8'~s]suA :Kx*Z qxA7Ӡtt*U  |PlhM&gD^@Lw 03c4K qp0t>9̸_1NERD/Na E ܾrסkKLj8exL!Տ_Ź=!Swek'#cS1R{C;@ޜr ߃Bz_2Kp #f[B(bVkPMS2팻N" ` .T2y'?fiҵ/@9.gNOWH_JS902@_yK郅MZX.熁\{?ȉ 㷪8kDqJ޿Y܋.z |LX$ǞIh/7Yfg>Ǵ 5*@>`1!\.d"L ~lݮV)7ddgۅ4Zn"iJugIZJ/T|%g$?E:$xy ٳxC`~:}*9;Zy̛uj-e9 s\wTqb" :WOHr ?_r{$c^v`k{{kcc3,^]\d8i:tbdL2!`a ow! E F6.7= HR[V3 ՀLh:;A:zzӮ@f{BτGj{Hb3 <>9H~@P ]ˏC]\OɣJhXA ̀OX_\X:D 3Mb:[ :[HD"NG3a ?[nmuuj#H4Vib=PփH@@V!S4PFyBf4N U衦q!| B? km,{3=KFwe0!5l(!\1T^fPL!Ÿv;K5{23DUF! \0uj¥K37IC=]]k~j KRzNN﹌Č ɥK^VU`]|Hs"~+-Aqs1 % $H}Oi}f~} ӏV_@ ]y޾>c@R(\!ab EEdn Z#h4 VutZm0P(!n ̌Z-6#- S@[JHdAh h M%a 8aJ _i_7 0W~E˄8YkZ=LD.1@z(1eF&nwQȈZ[Y%l6qs<_$! C@h4"Hm]>Gll862: MO&@jd."ם@ךgL@ `xʿY>6֑NO,@!I^OgX CJE# 9 t Dғ VWH#\ ydK/[444CbdT$C`}; r0?z}6oqXw/OMei8G$CMa 6hGb$h(k@V0LK *ѲVGʅuƪY{D]HB}<> Y-)@$CCZBAVF@4'Hꑑ:3b@i nqj0Ozodk}6s}0u6a )~<%#1Q *Jqk9,!@dqBɥC*U# 2+` Q ˡD$㮈n4XA@ur9 555X`n: $zM=DE`py%DeF! h8 D(TͶi~i`,x28lҶXt\ԥCCo\n6j{z>)-Hdr2ln&&uqu^og]bX?"?s^nfov e 'pJ)(P9@&'a`]y O͕8r:1m+/Rj2t6Vڍ]tZ-lɭhx4v` r 4n>hiIJږ}e$554$G\f8WTdFLê@kl5V^n9ȋw߾} ucƁ̌/.?+)io6P@Kd2w.We&k/75X4g\-i4ZCtA@vTD64Z-BEkGt  $&d"aU߁7@e6ݺX݀ 2\q~0 j)r7Ե:|@ i'wמ|^kn1jb2>㹾!(vuMzҽm" z@@?zer4[J6ZU*L>1hGi( 0ho5Zl )|j;9[Yy} $+%w 㦠#"HC\;># @H-~Z @V^t Ey¾7|L[ihii(]6u5 礀Tyy=y4"T/58cD0@6\Y'hָ.]HG fYb::wVRVe71&#`(Gp Jy5TP!dd KwO?\ pEü#xIFY:p~r؇]dő!' VRЯGEqqИbX@f/<))3zjтRFTS@ܦt I) "Dn!T2jVN=z///H=ˊ (zE80@b&N}vD"aȖ@pDv +IH&?߷@^xb>)ҩ\ Da4W 9awgy0d0=":%+E8bGDdO9{#V =WT_Zxd,24.Ffў39!S¬3g<`̴NR3k ^}|td0!FNQlz [%I ZyrB Paj4oq|}Cr||gr quH' Q8w-|>{T@pz ,3$ Kd0W>%]O<#`O@_ +P6QAzrS+yV.j7=O6ՠtkk0~X OPhh 99YY*2G" Z DV @J;(Q\[0nj;"1!#`d^$4USA./tkȪ@^~_|(܃ R__䘸GGe_H@VtVQ7Π!i *EXY̲⚜v įPA 1hL DDAW<@ї `ש|4>~䶁fVvup:jP|~ʵltTȺu4 Tp9>?Ig@s#]-|Z>b߁ۗ:;=VuW8$ Uj ATd:"L*<ˤiH DFUYlRDfS$k " Q@ ;O % i:8+/#ѻlO`ϵ00 CY Lur0Up8MƯ2@(*J?g Phf4p y gA 3e^9GyJ8 @i a tzo7>m߾+xi -ܗ"Q 暑?DMJevE-ЀD4x BS ,p=圦 Rk9T3@QXHIHOja@mމHȋ7ÊY Hdomj 3W &Ce @Dt ! ,( j$2~hqr #(- :+~:clHFFtrS\Jiv'~  ^H-_R?3sѣ@> yV*8;$jKنPY>՞cϞ IoЙ1bK("lGe +vҴDbqd'v.'758@E <&4r LOî* [p_(_Xyg 'vu$APՍ#vRNEv ' d3Bq\yp5@^@O I`0O.oS$ aH8a'tzF28\B :5IB45;TZTb9*~ 2ݟQn^6\rAP G@W H6+AJ)x dOj k/ Ϟxǭ&?gVOG~$",zeuY+p9 }l aVJR@ZA8zr ȩ[hN,P@W$ft,|j56TmkƳplrZ}SCrPj}}Gk%]uS (>w·#uJ&$(fXvBB @]:  u5EPSS[nUBbH"lj ymY(jx8LtvdChB<Σ7ą,"/^?RUu G 7zXׯc 5 U/RG}\lAX^[Aj'`jhJ&s2EXSY&UK #0O}bU"IMql<-&&Pl3{ws4w vL+>?35îׁy^^t$;8ɇ:5*EuͶR@UW;|5S2@ ZNҊ@# ِFFsHTgš3w v@`u"gPZ Ait+(éCۀ{ ~<mo} ^ ^$iQN$hV%%6|}!@$Ad ]p]5tZSŜ Ju0kf@ # Qb A |z$n9 HOLP=G}mm{ϟY@z%)_%ucJ djh4SS(+rN T愇%> D,nh4 qu (`wsh4V5AJ_`Bg SP;yorFAz:TAAD%߳CoTra|c;Pށd2@^զZvǰ _g$˖)_&-c:B yBP@4YZ`jhUgSeZ,F#MoHn΃5 t $4pYhZc7JV%wG@N]-@ \s 8ń*~z' 7ә4Z壉?_p@uWhOx"Irc0+1k6>n,@@FJ{ga!@jlHHhhH#^"%s\hB dMLO˂5(F@MVٓUaɫ@""=P@nޤvPLBU @>%֛WoߣyŇXx_"~"{<2,3;~ktqQch0FKE)9e<"Na-FcWX\WblD@䁀иPp*6rUp.Yhn:>~3=8SEQU$nSu-D^|l"B~d }egl岒VIJr2*F t+U@ $WK!NMPT Hq1׷Bl6MmmG[V $" ~~pUWBu7Z% d׶qdcsG?\n< H)> @@O|rH/2$LJI}Q z $C(AQ? %$H1I :V*., lu  o |w3.-iHXL,FG>??tvDHIA$4>>8~?,o=Y}ö J;gwϞ igt}U!DȔEuêel7ID.D 3"\i2AA#}H"xjɤo<#a z H I& m@hBS 4x:.]vɬ}+p 仙L})-9l@VK,ӳϊ,Azsl ۇ) J9_BDH!W! I&FNAF(AܵXG@$ vá a!є_Tpg'}Fw GBOOO|U槲H|%V('?%{# > Lv %o/%JAA %3QE/=_/W; T `XGjV-1=]%B%e 4)$IxHuedx\84! ddAgg' 'cc1}Q_+%@ȝwGYLxt?Kk#C]; Dq/^{A," S..Ij\.!Ao"!37@AVn7FGYijzK hnxsr!w ^;P?f4q.)HqZTǻH;;AR(tU,!@?G@*kǡ߁~>ddB2a'\PTO /r  @w - ۷ ;Ն_ӟ =ϿN X`j^gڼgd ; cczN ͪ:n::.!R+:\#%FffcQBzznJh xHJ.j ;1DL4!<_nyZ r m&`].0l$"n;DZ$YPQqM [[A $]ŵ%捱> Y)@(= e01B.il6lj2_Ji:2C@ƹ9` O7M^x8F>= H2 7 @Y)ro]ֵ #_nxa6 }}lkld(!=Jj RxXNg4" jT*LHA1HMK099Yƒ s-*8{69s!">XsYU !{~Bty.{/UҒo]#npDRwHχPqz[/ ǻ-byA G߿ЯyV*UjV dDa Ehޮ 4&ԤB@YH&H :) Wg~@̊#/{$ /LR5YA" VW /*R#N'Mn#w1L20H-? o^64fŎ:O$ eew$s'|x8r\6Ko'-L |{gA>HԵ?4Dᛵkލzg6f! ȬЎݲN! "SPK.#)(b  q56u">fJԏ ̖(@yh1bb(l57;w Vb1C܍8rqr3F dsg{۷_# ##lS")*uk5%x5:Pua b 1j P*a]YBԞP*fUŪwOIn{M_,L2o)N%H n@LLAdAG FOvesv3A_3k}巔enN/{$8Vj!U>{<|8a+QO# aؔ 4B~p0@ױJֿs h?YoV5Iu^ )gYbv66r1 ##<^=drb=c)jWx<"!#n@OhiQik/ m@w7y$< @b3@NpLh(; @|P7 "xsu UF:( #PlZ{wuP ʝYYNOc6B Y2$+-H`6955&jckw45};x~|\U!rbZMg.TElTttf6US'Hñ@o $]ړ/d5ĤSt K;:aiGyVdIUQ E= LO(.aD6nJ&hT\ó;Tqݎ&OCg ;ׅ [T/q&Ɔx^ZV@iV1I J@O&#$ 6(0 jbd$0LX*Ā45.U|MCG^m_6E=&7S ] D .N~!H#B ’4$+ Q؍WGQ-E4Uxfz7w x!qW^&74uV:2a"Y `yV!R4s:G'u#$hᤊ4cRR8fF"%waTjXPѴ!]ꙙ-$@r[,dpr t700/GPF^4pPo"1* òp ehBϏpw?r^~&}}sMx0'sy/ dTY{ȣnaZD:k Pڼ;@TsCvԀrrxNH^4&~ɥ&Z-'l4Fg4̓r]k͌F T> <ث*Rq$'iH@h4SeB Q@` gǛ6=6W C d52vvG@P(Z^~~@*HXA PA:*(P~?GPPPYk_}Ht;FxGߋ ^iec9ޏ^t!i"PY_,*гXN}b{J2[^aR (I* 8Hx$A T2ak]j:ٌq֬cӿuިeC']5?|(zy>٤-Q:"Ɔ&)I Y4@@u [0e !0UYB dQ~1@?68"Ձ[PR7#c `ȗ|FiXi%0t)%&74!!6eh~l`T}N}ӯ_^\nyRUUZ5b& $/O*eÜ qw0֑˸W\LJH}sC…\IujaP K S@p~-MB̔\@+rC tWRtA&*t L)cc9SMrkYڄ%t*ȸ ww~X&Kcd ;Xk1+.3+&l\H^4E3liYLgat:KzSByh}B4~.{B&ldEǻ2mR`eu[ApvmFS! YAe@l*<C@f\a%JVZ@KJRcl i6;l^hH|>{C=33T>&H$Yn !:0 %y XD5\SDn׊ qUȩ#ؚ?>|}۳UwkqzzWoE@{AQ-U\SSÖ0h:) Q$5 k@00誨 =@ ]P1=  Du= ɢB wTSOR7o @Gv>Ms|0w Fm J^s ugjzk? ^>߭*+էO(K ~3с(P!KRrdlvL+@$| 4In $z5uH1[AtLםx0_. 1Z"˩C7"0K(PN|Y-t4r|.jpVLszgTF_<ֿ7۟aqz>LO+>dLhB@I$` 9AWBʣjWLk%?5fpŷ d!z&g] /_u:gݛY#zD(8{JK)oHFx#?lkn5&S41# fHƌ h֜a%+V58q> aJnPKtXd}$<at" Ndt&]! MMV`&y[ I 4˴T ~5fJ5hC} 0bsd` Xu㝄@nL@N@  5_>@U@2$jB Z{'vߋ".".Jo`@ݝNYw>)句|`7=S֤c 5|\(>ss/<;B׽sh]MN=_z, $Aaj WSӛĒzġ "(Eh#n"1A%&b @ɬ ے@Q/ 88 ;Y:;@TNڄ8L&is-%@TJV)Q}’}x^@q޽%1$./ ÈοFosR@ lP㲼B(@Э@KNI:|@Q ^EG³ As(w61KpbY_*&8/1sDgPx` :D7VY@xVZZRMM9O}ԡDϰ 1A.u} $%5/N-OUÇӫ s8ULm,{RHY`.Gd" #mm XLbնSUq/UgH΋U24xyĉ8w&1GdJ9ގj $Q*X'@L r)b(9:͛:2G-VL6aBnί> m1fޏ Ĵ/6A[%a/ox #uB A 0\,|C&Bш!))sۏZ&*?8@n_&q`_`  WJ$*"X}EX ?7WWE< @CKS--FSJDoGQsK! HyHR+qь[ 57᭬,ԕ܅k˗Ogc.#qh֐JӵtDKZ pA~~t"jvY[m]M OP\!PsfSϬU3̬s55`p-N@"@*WӞ㷈H~NC~2R@ϣvVĬ?\0/Ur!Q& ,T j5Y땠5iRXD, @Tj` Fc BVD3/ |@Pc$\< (!p IDATzf#ހIV9׵{VU#Ǣr}%ɹ.]&(ʶ;?VUPuoa)Ej&EA%_8@bfY֪1Y`W$ԗ6%@ft:b ,n9 9 @$,J ha#ڔJ}k 9DS3s7R͛Xg?B ^ a-BtHU%X Bl\祰@jN+ȭ [:n`VѺ\rKt]*+;Cm\(T쬩1݄u L &u6"Bן hz"t$9@pѱٖZs2  m[Dq"炠H&g55Hr'j]@. 3/_NN&@2F޵V ő^F '-_{tAQrNпjF^i RD^*5H.TJDt)]҈C : aMNAroz c)0$O@Z2ӒiHӮ <^EE&n@vwi/6$}ț6> 1ODO^[WtF6$s'/c/ZĴ{oF4bB q{q!JN^(PyZ_qϵUƚ  ]jP\~PMOqd܌B}q[mrwOifW1|8^D *|G #V/q CqV͌kX|Idfv2ۙ[=n퇝*|P{/ 2ab q:BQkC/˨Io.X ۷rϿ˻O f fs+)#@Ԋ brtwT'O QWV\[F *oW;H*Ց`Р@HO$*+/ b.HVHD kWo)B\B81@4Y7V+,-3Y:UXEȶ^DP5w_ŸK|| o!+> (2FCvV8Nbq(ZbT[bc z=1@X"@i $@v6sbyolH3" Hf91yL{;n 6v47;|s~JI;Hh r1@.PjWA)Y#~i2w޺S]S}ר4OyAƍ:2=mĹ*J_򔼎k!(݌v͐ɤB؈hh#H/lpO̟x&TmZdv7t&oMS {eA4|}g*}!%l~cH ̘3  @*U1 @b8'*EmX{JV 7qכL̚:H~~N)]+. 0d2DŽ@@ Dm$3E]Gi ͓?WY $݄(D h@z5])&m4wT-"@?KvG|/.*V,Z-nY7#}FbJCP@dUڧXf2`fFGfVPIrʆvXy` qq n\/+sA<{ŠT@\mƞe2E ]lLܗs"5z w&_*Nr:W\~q8ƒ]h4 U yZݿN dL@)r}lB%KtP>'MrҜB1exMWi !&OƺCy%0奓#Yy azat:Y_@xpX81C $mceQ XQ/A XpK6!^Uś9<nՀ{Y7LmYd+\-Hq|6]X@sw{أ}~yrijðb%ZeTwWvţѬ VMF޾_av8< 1tE ȸ6!آGXD JB:$P c( &dKYJucKoCA> {{q$< :ynE"4B=pa0"Vܧ.׀vEW xĔV ˣ^o_?11 c`@yj4@rD u:#;D@`Hvjh M\YЭ#Wo$fU]] )H8\{mi++OݹĹ6\ޣ)?uW[:SR@f&m.ѻ05'~n'0}]劅B/`DrSI4'zcjƿT <Ӡ_qYnjT y@ 6J_~P{DN7Iadn4Ʋ@q_;y D1 Ajm*}6ϮdR,@*!? l.5l<;ll=? 遬@?fݐ1}w Y|ף=zPxz[ Vנ3E' m[59el,$)ɤݻ:BԤSv-2"+V HkP~0BT]I 0%d Iݓ3l9YN"r͜ P֩Zr4ƨb6HW[D@FϰEbI0yx.Q{$6 }<#w6V}#=핳z0 9dF HѢ/r@,l%$8~P'o˛$C ?0 7>Oݏ#K[[>S^:u~z_DKNѶiO@x n 0#Dt17bWlNg ) b1 n8DKP,9B&J,CPIx~ ܅:2jr :_V^)_޹szd. ʌdQ \x`9;-"!.9[pXK)>Ɓ! "zAOͧ~Q{zz vL&VDӕ*\ >GbW! kU%F2EX54$WBnIBX8s%Nxh™*˗F,ಟ)]U@a*Ox88_}8 I"!߀$7+=N GNzq\kI;k NO}yu?Τ ?|@J/mzC_֕j:*"v=RQY& %yxJT}vNQ$M,V0TDR@H#DUvi -@2"< *&4l)!Pw;hJ3HC~;6.铓#@ T \>}b,Z^'wox֤?W @ XiN5R@"z w(Det7] a|7E z,ExUH 0+ z>d+xZNS2i@ /:?|<ey,P@rkN,:;;q,n *|JZub@|l@hw'4ݵz]C8Wjw(  @) ʊHy2b 7$'@Z]@?/_'5ˆR&iB&'gAi@H,VRRdaԵ~E~uxx9l7; 2r,+Qww?ieyk A^W/x/Dc4RT߁JڙSѩi|Tf:nMڱmv2䃘x>| ꒸Xc7\s98@;/]u98zj=&"3JR,$9@v*H J9|=XCh {)ϗj6tF~"r1<;-._>mr7&:XE3ri ^v\;@QY;16\[["5ܸQbv-gBNl@@r25e4®; G hbhh{T fn?5[[VMǁPK~H+[$ƚLϩm>q?Z1Zu ^SJ6W]C){rk993EԅrVN^qm6)ˮ4y9{@iϐ[ji<}}9@TiٚEBaQ H*ROrsP@=}=ӫ˻o*/,,siUwsn7E%c<1r^@%]]W'yC$#GR~/s$tn/PYawbutft tyyMڜ '$|Cƨ)"g= fz8|AL(V5IJ \E/?%pxWA%KHAkXaX]WvfR)来]ujέq:?3 ~<9K$WH#n$d:1?4d..3s֪ !s85"[3HU^^V46>|H~>Sܪ\@τڸr>26$( )AFe?Eta>}|6@m͢-1i4hJE< Iģ4Wz+HP%G!; da5 '^==b*H܊)AjVx7Iț%'H.W4WCiı'ON2 Kѳ\r @4}3X?A¶5O:u oI}nx=8@z&GG+DhdSR٢"|YPZb>6d CijB&lD(k(4qcү` IO%79rb2^T dA/;#O% t+/V R}_-$HWIR~ @)@v]-r7}l_ BDv'PARYʠ皚.smm $al @- :'`bY[ O,Y &ڙ D)9 RShL}aJfHUv|l%4>Cj _|lXpk,D,N([Q{zˣ}(Y} Vr cX@1k# `2HJDTO #P'tHWZaBߙ @ͮ0yb8 @ThT T^J& $"Ƈ۽'U1Hoƒ>sBlen`"dpI%[A@C#$ -6@Ϟ%i O<3n+\M˻t-|DɕcF-rcyy0\5ׁힷ#&P HS oqP0Ay2#qZR@pܽrTH()l,$iM/ё+7B>< j nɂ:066Dk {~>@^}ҜڲR isXkG{^_rZ~ z`lnoCVcKF;0DQS :h2t`d6:GAK?Nj/]r8BґWF1n,g Q_\ @tg1 &>xC@[3HID͸\(.iվd8(J=Zo}Y$6͏Go=~+?[{qS9y2kd7&oy r//NH>$ǻi@E:?+=& @<eԬ SSIB+`:Ub  Dk2kH2*[sY !Q <{H,3A%0趱2'R7\V-Y?NF* /^|7={rڹƎ[1*w@@\w&Eh 覹Z uJ 'srNG :3~%LCDn]Pk| $AOM[D&6MM4GL7:`W[a<8ߩA.L?b#%el;Q=ݪzKǿFFV&'WparYGΙ'.b ͼ{r[sgbkYj5WEYGmN' !6s!rY -ox!g :4HZ3 |>buSAE ۑ\.$!ʗ 617h2! GE)pޱ؊TPWG(!ɹ0/9@PWǗ?ܹ3Gk@ݞ_n>gͼK95 "3|>TҲZ!XzZ/R?SRp^Θ&'@j)]֔RW]/( 7WSSȶttFٙͶv~pqP>' @c]U*efld#$BٗTq egGn;e(K rŠ@,fi;$Qp&E_5pno/q$cxQāj {ʐdM'0W_C_ 7o/Hz[J?qd1ؿl߭O/ |#T@F 6  JJ*N#V?WF Y]G2>gk| çѳ~r,kiHcuZ P@?b^ /@[߾} @BFOхѴhP{\xt>SZmJeƸL@R#6D5Vsrf/~}i|0uM&:YsZ㯜Z@*޸~[*z | jEzC7NHXs'P*dQxD2#ǂնD$KLb P_R2qHnF`Q! D,,D£2H.,> c ]6+'4wgOMfY%EJ @Y2V,P@lL "i  ,.QMQi_x~s?By3UTyι9$G  'yR@R@Xteȷ۶izN{˗]޺Αr4gqe=_O= "Ԣȼ!2Щ kMHdJ>-L:` PC "x ~Ey H 8aadAx݂|}qdL{&1 y ͳgR)]%FQQH7/é47LNRUQԲۨT?9-=_kr=ˍsnC)IJBúb[2㮽N'·RtXθZ-"vSƍ,A!*| P߽ڊ yVk qB"e1ÄB>@ $cq>|JDdSZv6 Ek =] y@3Ъۍ+4тTםu ?d63!k?_..-q4~ֻqXtrsM=ؘs?.[ms9ڜ7Ԛq,mOKݮETEǗ ;cv3Q+$_h |"hUt B@<<i |E @ q(AA'k(AŔm 'kjX4|T;HOKM=@1>;YkP6>{!A6l>@~ȇnD?&[76VjAU>_3nii~Zo&â{ 3+&KȀ\ ExϪ<pNkS"R3 UD0 1_0D.3 x $?!a [AT|p6O6V|#ǫ|I^?Cm)Jj^0_q" X_-t=urVסW4Um˰SSn#έ2p@w/|Td4wbHDf@p@ѧfCj>$7'P"{AOisL2|>~~x ;nℤ*J ` #\.dc{t'd>swĔxL7mAT*J8|xPїoOƦ֌hwa3٦ j% L송ſPvfq$* di $Ya' $]@ <FQ$/ _xFɪz L3qޅ~߿8&DzTLʉ xVBmx\n) щ0b񢾾A @w}c}e\q/JFM&[ kXzSYYy ekG0S^;x#c݂%D  Uy07, eJ4td q0S` W\TqiUx~ xH#&)t [ۢL6~V:Dۖ#m|S=Crٌ윲2i;WvcY .{KvnĢ0Ctqqzעܸ[|D c WHU}m(Zjd0$@Ӎ!H$J¾HA Uz.ӧ \␌u.cIBRwBK|dDvO &C=Sqg'<ϬxS+FlyaRv֞A˲պ{ݢ6c28w⨭4' $)SaATVBa@H+T329R(J Ig Ȳ| %<{tB!@r(3\&Adܛ^E%L#ȷ2^b{[OdN-FD 1C(LN^|[[[+@]\sSVhh5Z .CGzpa--l$.w8Y6 rHUrLW>|g*N 0 HJ>v @²D>ƣD4DNv 3DwAff"S$p.pzpdfѩY~aal6,2r~˜<~|-@v įiS4epn(mPZYKKFcir\rP/8=V|5{{F0h!>VJ B'&)G4" |>ZZ7/j/P?bI@rB~ ~~(1 3SSOB.UVp xz|@#lC#};J3xaQ̞/uW[UI>NA˯h#"ouUCCDVo[KW?k`H29::,wwΐ^gб/B_{/ ;y9dd=`QA "@0E"-SB-H/g IXNXT #l,Ia IDAT BA~.CP] s׬vm4Qӟr!@uM@?}뭵=v@ $tj?_ ׈,d~'z&tT~@@T*/@|D`ybEI#1t&3::!dE, 2J`,GeF-@`9t5`:Jj@ V"JzCxWp>>稙JL/F!")B +4g |F2ڷpp񏤝:q#6/wټdxېH½ ?XQS],F]nA1 5CH~qF" wiX)mH`)4J5gBl.$r9;Y9UPhE"Z č1wzÃy[0}yR]ټ;O.| $sYrk^I1aBuoÃU5a8"ƕc.j' 7dG/ti{Hv|'_4) Yc׀<1Uf| 0VVсXȃ]AE@hf]I:ȍY)bH8łnI|d ||d[N sߚx튰fŲHQ˯2r}Kn mۀkf0z1Suñt؜Ng ki@ /.Lk`pݥJ΢l@A׉g| Jj0CLkxF#޼M s0>ΐ,)^Kx$Sݧ:2*%UX't0bK~%LYDB.R>h)OhȒ[ j0w T!&`SpWF@_M u}Kn 7\.H=%MP0`2Hl/H6 @@Ŀ \aE 豙 :qY!I8N1"6@~S}y}ϙWJ:t yqR@ άgt+B*@"LV=%Ѽv|@"KnS`ܯ5<5Vz]S%bZ1i HU٣K[r{X~Gme018{ta.3O\k!g9|4H(VQ{ βm?s@сQqӕHUؘTFq\r{~rR_am$ ȵ(@{4̗IJ 8#5A.h75=moVnQ:5پ7\$anĄ=o2DFژ( gL0r_w @^׷jt-BoE|H Q ݝϷG ~^F*T-W󪕅%Kz >kVKhQ=^5)W D}+=|k5/z*U<{սj(Ce" /lg Z_\_0,-' im#GmJUH5Lp zlw '?V?RY (7W&^%ۣ1~$@B`po8 w93^wىsݽ6l DzxCE.WՐrۨ12Z4gL#Xg4]Fhl8FG{1)._KȡBbD>>x Zpng'D/=@3W\Eoll8Apq;9S@yk..@DHED 9 B~.&-m@ܛLD"noOLf$xyҸ>ﳿbUs Ωw F1~MMiTO#"P^m'Q=`S,ʈ- : pP!6bGp[@pIH ߺ_ a* =(L~}ܮ8 `peySw {*rOM2 k/wG /p.I#Q@x jzh@V݃ݱb+z0yOJ=t+aj!X]*]Ԗŗ^5y4&@XR DjiU+ؓjUsŕ1jo k9$d7\d;5]'| @X$3M9AK{jQ@a 4ǖ0E @f~^s/,0;kdk}q,2^v 1 f*sHE7.LFمCs]f$eZ-uJYYPr|\C J@LڳRKTP o)ki[r֝S&z H Dw}Ǫ@46@CM#kPqo85U=^zN9zH?fMV;d @6$**1먯ggC9})".2 R~llu^t!/0XR[h$wm Y&AHm՜>7b@6N}D_𦧮nrf5'Tݖ2tadii}z_ϵ4\)20N6l|^]E*q9RPx544h4'k\HdzݝW]i^JZbu%Rk@JPԞ=(Mxפek[r& ċ;uݛ9ғry F{SX.c}xR0AʥGsЮ9Y[p]PI\Zzuke2\ @d`0 D*%0 SD@lWR1 bKbC@o|Y?q~WvCu55 ;ǖܾ^~hF+fg( Z"G: }߷,zDY r$+Gk YdJh:zL>:J`S@( h4Bd&HT$efz\K4.U@2m4ܺظ8yOfH(H,V4o}%,oӊ IoʷA "n^>2: C0t]  @Ra#lo2L E KQb!wu#`:2/~)a /WpYo_y>W*/([75 V {by-k,gx-xkfȪSkSCW-͆@.j DK2QP^0$F _N@ST3B'0xQd4BAN'<˶xdWd݅M! geǧO).]ño_"I"SRh5&eqcΜJ "h̯ =;OT$*C#hUP7%XDY>ph4eZ,ûo[ի_ 3?+u :ő'72r82O/ۇ{oO䣻wyrK&ܠR& `W&.-\X@2=M$dT\sAB[sIɸX^aij =yrsYxdnHБP^$%g-v=o㇃v7qZO>! @$O+&̦0I \h>m FØ{Brs$ r uR-NsX̳V<I^O&пn"UN>G޽>5umOo>!IPl(BD4"$ԑԄi)(VQ NpޙIIFq`{}O$3}]q4qhС!-U& ?6l(_Ae >܄ЃlQ'/G,Lk^x2i(*_}yjќ,{׮9KOOκ6./n0nyt1)  `M#*5Z:UQ̱b LS#fvÊbqb3 syi\iZ j A%f[y/ˤwYU_][#)CRjF6찵X /Sc h f7 y"M*r#fUo-r,HTɭcpdoq[l$HU=^!R33^R{VV@( ` ѝ#0V*@j dl"f`!$,єJ#*#De@oD$EDb$]u pc|vTLB H. ݩb]`d$ 644u}`kϣ^Y{ffrjb {/]@X,é0cD@r]A՝ tX HdP X#|>loNCi)9#@ 2\z܅y*@cR(X HF'&5 BBvBJeZ!Sr8\!7%ˤi~_{L?Ǟږ A IDATϢp)R.baC& :#k@ *DeI0JV[Mc#)Ic A%;X݋(^=*(X;ncRax qJnQx9Yr XTA$zx&g6r;sM\wǪ|׳jwh֥Weus,$R*aJnYTE(a l-k"mYTY<&Ċ[r3@C5S)9Bg]}kŻ\DC2>vqWx(HBŝ/4C09ɞ@㝯*-><{AWO&1ڴ3?S0k/仳16nOԉ dFv LH  ٷ2 EbpX!@ !+*_D5lS1Amd/ܞRKja| XwrC9'>yyUb l.~1eUtZd,|h< UDƉq ~3RRVȋ |vZm xĩKQYjaepvhy_HQQjR啮D*!Fra'DW0ͩ yg la7Rw1:6̠ ݎR+rC {#y6>:@Tb|2}PQNQNu5?J6@q^X>$(x1  xz3p97{eX 2_@Rs&NbY0J8)*w=]vTM_7JW"q- o ę⓻DOTam۔y䀼} S]t$-A Mk Y D5W&ktwXQD!HQ~A"Q@FHG8Mmp,x[xx"v,9瀬9ыJS GPZzs0i65ʺA ;P6{ B]@+*햀hwj; *˪]b.~o:wٳ ÇrH8,_FGaFS4SQbk4XMd<sbdGR'I%HKO7y\ba>01oLJ-Qy]踪.uQ ~JORmrwMD ? "=[AP^t+|WA D@ @(Xkp&IZg * ahiF eFj/F|M9 ?]s8O"^5j3D3>o [7ǹdl;t>K=--8tn@V\4ҕQ4>Hb|2@k$"ĄE2@4.!t+@dw*>7!s]xU^ӈZK!sVSEj+ ig>AgA .rGy1xSE2"mb)ʼn^Xֆ@pDBtגX$qH&pESM?ѥuѢǛe>aPXp-0M G=㨟wl29Xoi:Rr/;x#mT׌QOԲl%Y !)`GD!eHR2)R 6 C "`No;47ӓyHz3n@ 9bwqW2tSMd{>yT@8yI/w4nL$d͢.:WQc6¥R%!"%zW:Ĉ@VcEAAK#T¿4b oL51|,v?ۂc_| 䣋'Np @,FW@G ),L,$xH @NuX0:Xpee1Dnjfr*hUOjL:m/\ↁLN={k(8ϑ~^Q=(sjHVڤM%-4n !11֌b R@0 cA:CōRC=Oxמ@ʐɀ=a^Cj.Ī%[G#W,)p/@X"o-jcw2  D{3NOuy7 ){Q& 5⟡KH(4ܜkL>fo)=-hlZ$brƙ hUfߏSApIH A`3h* @^;KT#[7vSqVehi٩7F`|I}:{bC4$0 >}޿ߏm[J={WDPdMoVH]vV&B{PLTEumibEk[Uhhrrr999n}kc|ogol_goyf_ʲ{r񛯳o_Xwtqi}uitkêLtژфR~؏}vToZ[fx|IprlLtleHfPK5ltj(Frp̃Gݝt^_Ԇpq`[?{k@a!|Mv1F"c:afgfaDYT;5piKQ{auVggXSC#zddG,/_!?XIG3d#mQwnff̔wag ^3{Vu`POnTc>9(FB. ^$hpI(|uSQ';MMMjj@bY_tc\S.U3dxz#g(¯r{Ȩ41"tnN[2wab6 Z@#,b.utJmpb]xqP7Rd^BnpEh+W;Zǎk~Ff#%%#[7Rcb<[\ӔcUYVą̀ll~Ĝ*O^^_fff댆`z{ϼxww~,,,쓔DEEmmmΏYxv_lO>>|Vo233ʭKY:~LrptЏ3D.zOOycwv==oqOtM5R6/f IDATxk- g@[^7Mp1BjBNi) )7)<\tS s(.3 P v!uyD$&6Nx_mͣ-Xswc$Vx @ @9@ }-v~ ^z?\ br)V)!qf-E?SF7~/=N<c+Ů/{oe~R2D\@c>@7grp?TG ᨃ'ODs}=Jf%~S)C%#z4E+=Q&{ʁ `*p [!@ H@@ @ @  '2 [( Pz5=S3ѿ:k4Niaaiii_u{G@/BY௦[>`_K3,bP>xWp^xC5}68XXp 1nt~b@53D p~Q!2A;0Bh2a ,&G0%]#M>`@)8mYX@_^!@ 0 !,=ac A~8N C_ o& i8nNM}Lv*tAw@&>in> 8WR`vƺ%&!z%΍kZD+1m30 j@>Y'(fjzj7}J6=" -]/LB"<] @oߎ%YEؙ?(t#ػ1?Q 1vߘұ T@݈b 1<l- TU@5oE5P \;TQX(ܐ;[:/]%%*Y&?!nvPh$t`Zxx DYD[ L@q/!% ,p ĪXo f:j?Z@KKZ98,ٍ?@ժ5[nj;/IvdK X@ʴ*j)NeAp[ `*97F<' HgA0NQ=d_]ܮ k $*z\jkok{{;uu<_ qy`02X4POoMӀqoy{{[vr G+u>N x3Q:M?8,( 3B V$eөl6K\fYB ;8{^c vЖ@+@:YR\6yli|ˡm6FO*pY*b{Vx  =w@bHkH bΠ9*$J!fydsCC4٧SRCGsdH*!8L,%SBq %ߔed\m0N W-0;r%6`ko_iޡc_1OhVǘ Y^#'Syu !hX# Q&|zK6~ 6js`+Q޴2h/s}$\\Z[IҼC_Ѡ`y>mFAؘ"MQsp  _`OU]_CF pնםDU)_$%>*Z,ήPv\=BAJ.7:(rt5C=j Z50WcQ9 TP@4cxQ@(VPT y h +\-S]N |$~kˇ߱wsXp@I~t7S韞*P*+|z߿o/"+@#=g>W zM)_yq*PO6 {:& `+*[4Ϳ vtoVb!к |$oUWPK|~6<!@}k~K'ԛ6.{ 0NX[hՍ3χ,{>gϚy}Kڝ, h8)#|{ ϳnl< VI(=& vaW%n07vt@k@2{'4R5@UA+OcytO?: hsB4d 6}qC& Kj_V J(3Zgƒ$[@6JͿX @t:=m---/-cn@ttdAeyxo>`d,`o ;L  hRYel{&V"(R!KCm M'x?P*6B$ X .?ZZ hx ?."l Z;K n"Bm x/G@wƱ5S# A: {(໓Vujx/ؚ|4 O&~ =@CԿ٬s\C@i"Ћh?6I>.}x+CA/PyPP3Qe#U7/p`~okF**`~E6x !xgo8e08= ?b#l PcKS:EVD|x',$q}p' >`[`-$@O7>?-C4,DJ  ?)AJ pgo Ir- WN _:B\NJzq[N9QD?-(2 l|AÊ3@EOu`@f2!`%(wp(p uc{n_fx~~;׶,+m 0$',l Ϣ *tEQ^B3 y(dJ9 !I; ]NF`p7^/?=LǎȪ<9괂xB 9Nlc+7cp*#YZPnc5n&2! Eٰ1q)5(0R8@#@ LxLlWWy a[4@Ee1,ҭy'| )@g]G@'ڀtRq/g"͂I@%H!R\q{Tc nE~uazV+bV+=a0x'eWWVV67}_7rw;@a +-- B O=O@'eU@~z?I$>r||7NqA!ɕ @.Ҩ M$vWǤ'p@ tlx1pkuїLBߩ ۀ7xz|'$(&>b==R= 7E]ZK@<@(N08JD:9BV8 AYW[pLi j6P5M iA'އC0\";sܺU7ĵtSCa`هyw H@9!dUId٣oԷ,$0 كp`)!@ŗ:/9@ z"&:q#~׍ ]7nv8l<04~ʵx^@p`jlde/e?;]8^Q'( :`Q E*^Jl;4#;WW9#!y3@ !|E >Gt=$ug0@\.җy[ P².n LTqbxB⿖@p`x5e | Ƕkhi~%7obQCt0 I^=<;Rȓh h@DX0ʸCppϣۆ$YKeMP=zq#U T@-g`!C d$ |p0HQ~2eeQqF18B!@i'HB)C*2W?V,r_yy E@ ; IDAT.{i}Ŝw"[Grfn OuZ($cp @4z)@dvHB{Yd.rQ 0 PsV>ЗXJY ?.?e(? `y >_,D_ LhsXPC#x"F6v u sˉbC:}1m W/⛀s%xb?'n2^__k#hrbՂ@ec+%wzJ,%L[ 02|x F?>CT5HPD wYϯ GԱlC_gWf`F2Pʰx+T9kMSG\~`p8=]%@2`[rhkh>BL)[hJ\6 nR:"KKPs3!%`KSٖr%]p>]ݻd/^=t|:`T5RKS6 o9Y@BrO~ٟ/>U`p*,@r!y3x8^}I A q:fQUw>tХ*^UWqT4{Zg)r2;5ځ_YU.lU~ Ԃ-+vٌ~/S[8Pۅ r|:; \9GӹtլvOtu 9pmKݞ9k2%czž! ( @o}/ yޫq{-ZpF?V`K ONVz_A$;^O97ͮp1&7BnEWA(QJO%$8T&ee2p{{p׬6y4^Y%= Op1^&w<_&+wKǂ%.2| FJe#W=KְZZop9&@QY= Xe@&2-А ڈޯuu8Pc::oQrCĝq{ʛy@J+PhG)~R%݁հҩ3 %I(?_%w>/mtkO"*`jVPpSJnZ"ݔP,ey.SDH-DBA Z(sΜ3s&5.J>9(x>c,t)kbH_PSyP3P|xtTI Wu@0&3씰'!@Ϛ?Inƞ7姈b; e3# O&*8(Jn .40ȯDt&N'>d2L 6kfS P,AIiQNBP(KL0'~ G `4Pn4 U@?8 @N / %HLW kI8 ;(ffn 3>=u7RQeDŽjUy%I i[Q_`Bf1& 3+>N|aԧC[়/HAm;p)lE Ji eLU\rC>p' V|8']V$Nbu*ҿuɏ̑Հ7D()ڶsRTjךC98mdCyISeZ_z= |/2ފi'])QOPKl$~a vH x: -1JۑZD0 F[+RhtmbyJ]eSX_z,}(XgaFk PphGJ|k?WԤ B ɽ q@+e` PoK` F[L H:"|@e>Su>RSP`4] p1 Qzxu&"s> k | #UP .a:@vxٗA@[vaΓ`'onh#磕Jk$&vG y&zYн`uILr/01`I{ {`G)4p]FehuHl>`uʬ h7D$_=1)-8s0?? O$ڽ -Ca8U55сG/zTK6m=7,%Tg܇'- =kO]%~`S Ł `=TgŐk#v@+7A `37?7LpƦ> xwéA @ӻJ|< NŁR ^ҚۆV yH}@w0+>I| C7*.A'〼8ՀeURsާ`ڀot,r?Wa#D=Cdӭptx#b )6`sw9(p[Q_*`!x) 2w I1Zim00R`@?Ut@kv[cO TceBu\D$@KDW@E 6ɑ`uخu r) ๹9[=M@L<'8@lq? YZA,\0 Pם]mh 3 @ZM잮-p1 !rds^> л2쏺 l _C!@Y@s,H**8\VzOx#?z׭{֛,Ab۝ع`/@oUPl; (XpӁN.`@Fd. >tV.@Kz'3q&Aɩf$9wYVd*E/|@mv 7+0%sm[^,OM\sysieWp;NWvNL{|)&C~G3'.Ss$@P̯\8Cbv7psy}=.T i`Y}Hi$jELb $Ё '{sp; @{&qDPu@Ԁ7m+Jd `R (Sey̸J8>v|I =X@hxEgo  f鲏d&`r>A}m O#@RbQp~8!a=/"G6& ob.Ȼ_ V+w$]=pI)@V3jQ~ 83&f8}; 8yVW@0*Q4h F  @V0.]c*sO(B鯮@o> |G0"|1H,X5@\/5}oZ׃f6`n~p<~K/89x^PZU`); A,->@@2 *e/@VwAl,a.,VRy pv *F\ ,_Epm m`xO :9Oǹs9h8Vp @]G]py@8b ^G^#MJ6@&+A"<MF H+<;r3Hn~GlK0 Ž@`ķ(W K ` &eZymHM@Nxd-; ?J <oƋn~oU>KxA |/|{4S4NCy@ R }8 J8V `ߓ62 q޳g X_^B=WWQ 2P$;6$e"G f1-B|:ę>>d_x浍$ {p!2;LÀKd_L/D94& X !`|iuQ H̠%ڈ( 1C^ [՟jN"1~eRK}}3ϣ؁3t~`APQ9z{F/X ;UWx6W;.ǺqxxOHP8o97i(N.mcβ}3:m fl<0N ! H8 wh3,~#x *D05sD" "| q|-/PK^XzwX:  i |@XKC9`s'z}@_{ t?c$|} /_&)Ӝsrq| {"l`tn5o8娯5 u<8H2Gl!P39pw @L"(IL2DOGE ~8 ^ rp.Cahe6(0Xf^ ?9lD%w\.|CPHwy v>JhN Z;B֘],X/`^ˀ@M=G R ?M0,-AG"Ǔ|q4j E40'1uC/tiǭ q43r,ښy|7` My ׾1phT`[i\U\ѻտdgK +|, 7><(O쁞("2v4"!J$F(? _5K)`uWz[@0C .zN:kcS3HNA~³#=𰛁`6x9L"SɿW2 /1e?_rDrT2/Q?nv9e .}GI[`TI)dm$b 0\#V(48!hV&zS7F KX:V+S:QWR`՘BmN8kmnzz=NHZ)vM=aOIf~dɏL{/x2Q:7(V͓'O6)i*_0Z`!HLm*r=6c`Nnz|ҭ1rWQWn qa+@q6F5O0n  h> X?ܘzzf_>zZRi+H¿^ ԻUXxDpL1 oss)ɓ7{>g`j;P[Pǂqm6T3 pe C@ >_ۋ( {Z@&)𳿲)a$DdY/^  0f ^8tpyFû6nc-Ed"F`NB @$|[AP`7p8RzZ*x/9pc Ե+ )pr_v S+i1Á [[[8v3pkwww@,?CgHQ8Bn #8D?;0-s/4 b;PprZuu HE,=KpaP[dAT)@kNuz*Z2fjze5(v50vQx`(n`())K9_ n>`IÚ:]5x}P Փ@\/>њ*_J_,.) RLS_׍@~@f?یXf@/(&AxM;@0t)Dyٯ?@X[spT`09h56 ,78J-S IDAT)6ZΗ5 cU=nq` N (&,yh[uĦ5|xH/ %cfܑ #3}m)#|7J i)óg>|b8Zs@7~7/0.H]V- 7m^A t_Ȭ)7,6_c>nL z$g|Rh}`nd0 W 10< C<w;9[3 :Tso@(,~!h^0d*[J@Kp ^S-)O)6{djpjo;Z9V&?~>ӧ-:?./Fΐi>_YkuqKKg(nvIkTJWߕ<|7~W jY= u??ۙ}w~߷ <n+k\*divU{9a%R٩V\ߙf[tP(l8?zN @7] w@Z4`}#r~6d\ Yn bJ3_m6h ym[H^ fx5<)d j'Yj6^ D& D,f,bZFPfH &6nMw1sL;Ȗd||yRoݾ_\%?yr4/?im؎@ c_PTp D&-$p*]*qD$) z&Η0T{==@l)!Z l>k(wMi}s#I Rƚ=!`2J7P$xgo~oB UX_.(~DZ ?Q>*"Ap:vc`;—S(1pfy8,70#V#3 KMi "Cu60VZn9  |c¶;?ͦ >/ +.pc Y K  ~̧7<.Ν@C@0E"Rǧ?v>5< hXW@WzBm#8 anedSGpǞۓ>&,2F$ w0@x Xe"}xrM$ %6"Ό8:?!CvxIR^H l(JQp`@ b "'-F|29+0B, 0ұ[@ dSE?55uLDgĻ`H t~CSj' gdss ($Q?z[Ch/r4aWN p^M^G mxZ VxXpa D|~a@I'$P0RkP. <RQ\`iS>0CWEܡ(]]b0c*=pJ>M|` `Zq&1c#B3/0=E%r&)S?I$*$/]WQ k @QxAnD|&@l=w'6 Z^ ŝ?IO@@ iA ZN߬R26d)weKC<;U?D(H\;p+iy %F.\=͛_Eg`T]Eߕv318#(Jqt;8:|ZRpjuK/l I8} yDpуXvp<|X pA=Q(5b`'Or%~lVW*ZnPg> ~6^SG ` _(677mST?c*H`#P~aTyχ9?,d~R C@8Ub :v8;fڄh{4s x.<ھ[ H?7 pK1%n,EQv_@>tbqTY8'*bG@8 D)}(EBrytRn^C3h4'sOQ}gեxKPb `cT.l1yэ ppMcT(n&I~|v(Cƒ#|!h4ދ||O[XN}=QqQ~%8P1@m>~YلakA-6Ȕ&4Бl_֗-< s 8[ʱ`*m^;#0rP 8cTƊ>U?7 {'٠N~sHhyЎiଟ*f&mvT[& :wh*)+#H_.[g20ʰٸѣH0"+PqP`k) Vm L@`μe3o`2r z8@c %:n`MRKM@3ˊ>s?[]ТpȆҌh O<7, DŽaKU}CwP[e8`@0C2@K)Hf_mѕTM$ p9`@`Q\̟3`S…V-@7s՛. /}jLQ),mY \BGopgb"mIR@PL$5$ATtc L K,&e8fȠOӕGe_gZ 0N`[̵Lp=(f`% -A.\̿Od?pInll +Plmm5\_Gi0O0)C/Fo+M!*  l=8`iTo1, nk/@ ٵ{ ba0``eK [p-Vs?<&`(; ruJgf>phޑAx1~ 7@'g%6΄(4aJ|?t]Wjf3kDl7ohX$41@!c #GHC}e@㇇;;;V۵$X?DHjL@Z "H { @6PGhPNb"~2" :+ Z@:Z%m@pٙy`ёT 3s <86wCq`0[;rVXV`_V@N(J. @)ybPŰxI;-dliits˽F(`!U(3I@{@U,i<R~Li\pu8x# 569y[\cLx1g]lMF MmL p|!(.w )sguX8;Is ,*Aw/xT06Tffk@'.B e nKij ( .j] ERUZH&+ |`[8N;h$5CzU@rf0rw )Ue. HR{c*> 1t!ZQUR۾hJ-[e ' @hb\9^ {)(P b.z۟ D `F@\@j"?=&R(ӯO <0;$dssq03 `! 1&'71 F +n8i ]Ͱ7OG_T ^6߯` FLVNOnB 1o`p`)``T>$䖬U\ "gm`9`8AXzK{Ph//ա$` RVXA]``?8 %<6Ib@̯sx 쳿 `F`V0 W[0@0QpT)؀_)m:PAF@ ;++WvZmb0~n|sӆp=>4T᝼jB_E>tS/ٿ  !,+hܜq쓀C⼀GL3իЀ{*( 8B`A@TNQA2 8 m 0p$`TVpK.@M~F FjJ/$?&&)`h'μq.`I 9|݇w;,R[>ۀ*@?2wUO_e *$3 )c/`^P|?.@o9Pwj8**@`uzIP0pS zۀV 7 &d0s8=]лq}knp gPl]\"q>O tH-D‚P{X(| gg 0@vټF7rd1u`N˯|I<_220@o " AoXp+, PnùێCAZ dl+涞i(J,U Eœv H$r rr,uxdMBhDF$[صC Rj-,l+EBTCzIFK]{-KT Qy :+n@G#DY $}-t  rp3@vPށ7As` c@9m!V)?n?^hTRj2`W"&*v /zRю@ `A~TQ\@ZR j4UiiR@ly<5B ly:R5D\"NvU<yI/,xW>Qj! ǯė$T\EYdׄh*3%xƫhWi@ie< vo [x 8u)sT"P/%..?f~ojsH%~%p)(#= Ҁ$zV O@ @+j 9}!@Su(PX@vzzSOc2߉Z` z~=yߡ" @ 3VPp J _4WaVj@@"NJX @:]Y]? 02)0e0c/xJgQ.@/˂ @T8Ȥׇ6I Hw1vmED2]zU]?U-)ڕ׶{Է^W Q.zՁsR ]bȸfz꽨߼<C4"ִdU ,1_-%!2@,`9 _G/ỗh( $`@'L-Rc!xm_ 5/Xg{8^ߞΟLp#pI 3{[@Do>i_;,udc`pp} Z/8&@*Y Q1{[ IDAT`kkkΎ%H "u%@=~&0 hREzj%.)ɱ4!Q.-/&Mjn!w,g`36 ~al8ƓL`@L(nB".N{7 L=}xq]H pHX *dA2!v Rܞ%!'prҷ`UIeC nAh7)ww?FG4kR,]>P\:=?0e Ph9Q@oW_/nC_{SSތ_캟Y3_\%i *zӺg{/5_ 9lO?>T?m+|/"7=zt *vC :V':$p Za}WD^@$Q-Z Nʀ+JhvVU&H-A^Pl@[eiZ`;'e9vH `K%QJeyWRM c[U,\-Ox q1}ƞ.0f`:O ts ڿĕqZm|U z d_(jfcHrlz D2n04DfpAa [)sy[8p?mr w ^ rXtK?$Hb`=g},k{tFOcȪR `t@Ze:sRI Kd g SO(Q K \B*УB(tX+tw:|Gͼˡ5@ ?O"v1n`3&f=6y=xX = NF43qTD% BJ sX D,V/4 łzV"ii`D ɚzK &Elr}|v+oK7^MK\nq! "^`IX N3逌}?^h6] o5N$I?T&u8 LTDժ-V}t iZYB".a=X [ҨNh8yrUϞ>Y ,,/" g=K׌8 : V?$p@PT ;& DOke($d]!+#]$D\3\HN h;Cs^ʻqo%3}~ـ2O⛱ZLO@p5$ S !%E(owe-#SJG9EN5܃Gw r@"@Yf88 @/3p}1@^!L 0JD3br~u= ̻[ucz Qq]|׆A>@'H?EG] :p \pf>McIL$@S. Ph,Հ,.\x=xEJ!@^R3=\;='ĠO(l87٢i.Bwn g psD+c{ gl@߉g|>dP^\ߴ?vX a@b6_` ˯;8d`J Z K`&_Ϲq9%!{1|^'!u1hͯVsՅ d C'M66 X uX_ٞ f%sߡ܃ |\+g$ ``dW4ڲ҇ɦ3o[Y(rS }?Yһ&ݷ(bl4M}@P͑Dp&&"m9}O!A^`}]X7݉#~铰%opTti ʆnu%){NfP Z&̦ݓThŢ͆֔1#5dY[R#A`;Xs0Q@LL@ ppK5h >A؆%1>Q!>@O>) <+0wGd@3-Z"TaʤmӮ6=A8[1bvˤHPYP9ƇZj@} ĂE4@:d1` >6ږ@@6uG&eLz7(_z%Hh F +63;/=Hk-\jceiۿl̐[m P!޾@8(plS,u><{(MEz8Ȋh;f_DηdD`8HjQ0 úCr nOXpa$_-\(h.M6R r"BC Ż貋 wY8P`LtYжd$a$F`s}y$GØZ)}>>眧\XNHP*XlssC#z|Cx@FX sOGǤli&@L NO[@\)At{0 F(qhITJ(dNSpWc㄁RB?MT*KJӷT>CT fOTOĀ?j @K8 =!@:Q`D -'})^;[.3AwzY  n.z;]es^h}c`{:O%I ;0J׍Y@ `dnE06On4 Xd4i0ቁW݃0#"p DG LAF"Dg@ް$@h eew3,\?2Q )a fxe^7|7B(UlON'3LS,n:=O;ߠ6t>[rpb `XK@ c$(yQ@+[ PDQo ڀG{PYV-_H䇇Zkz<xb@Z/R`1&35t z{SS ibĜ  d< Lݩ/hr_*Y;I}MɃ@V;6AaSQ\osoFiNfࣦ@6u@j P)p:u_@XHm`X,\=i p%G ?N\kip_,S~ Ua+`+d"EtiN;0 sR¯?Y x1 K1\x 2J/" C(F]%z-Xz @r͜>@K+@N5 m8*]#TerX'2ͧ/&5n>I8p~h=8 7888 ϟg\Eb^ݻz`p{{ 9Nģ&0 0+P ÊRwUSў.?մxUd=>]x}UDLP)quZO5ؒ &(]=>B}u> `gϞyPN*)#N@( RHG JJ"\M}z^3+=@j(:E8B)|}-Xހ@mr,^ hOeBI|2@VfqPB3Û=pN qPJm%$|R.rm9WZ`HK8u0 P _!SCPDcB[p]$@VJ-, zn~pZ*:3:L&TAd뽚 R]J$Q} 'H  t@H0L`3B|Q[ ]1A"+:{iNO +'[, x;juPs/ƺ]LLpM.|%@+~o<%܏ (>+S p =Y?bپP ڭp)B@ HYbPhO"O H3PM2b`Ҫ6!ƶt;S_S^GCXSPO qD h$_ط:J{ZLRL"Q4 CWRHdO1 UL$`@+hC/`X ֫ ޽( Bc @KC}7@|ykPYzwc|  l|bU8b }B Sco.=1Qmx{I@V_ ,i?\D SlwK1  )@] `_ڡ i@@@o;$CO&6G\2=m`gk6l[|L(0O&  < 9Õ'*P~h)F=:)=F3V hj0t HK7w?hw$5 ę)V(Oe@dz3t 0D 9`7@rFǀ?{ՕqC^T8e0 d'hE$?2MXE!q_/:% v@M|D־pD5Cv--,`5C Z[7?`q=s=ݛL2E}sd@]r)Odlp6 2?4d_;Yk׮e*Z %B`@|G6G`Kw ~ T . =d(%@C.o^P P^_!~_|A}׺3RW~#9I@ Tc l{RwrRH< PxʳJ]2~=ǎݫjJf!w!c]V `'Ά@+VX(<9RQ'!hu7Z 3w+sAj Sx502J BI47CM:MP_,@gct& ]fX/@ΊmM) [Gf͒O? a,&qE`+\C"\P[ mЪ t<Uc@ !Ae 5clæS ~? l2.{T@TmVuw9%Tg֥!0!0DXkŅ6l(`/vQqcg=?Ќ]Fb"@=ٛ;U zx_`ɻ+b ?/@7dWV+(R Iɑ`g> nH$_+(P\}"b!RA6 3u贈X@L@@RM},fB.\~I 0Ic |(q#cr5 @ Fb HP[x\ $Ȓ'uEj(3ΘL ѱ~7H3x&S-]Ga!TQإ~3f4;$s{*U&i-A0T _@0x#`:!0P#PWㅭ)+:[:;@r_WמǀҩZx|[lB'WX/` A@ʚ_Z F]S܇|$sWKx u #Yܓ&0L|Jܦ@ZI7xHĮTPP.n ϿojX$Gt5g`s 3H= 7r#@, ൊSuXv @=nz,p3T@)4GOޮy)pP qh'0X@@'>L(@RwHd IDAT r.SYR *G,@ R"èIWv\as@`^jH};T" `X1Kf# ]?~|O pDe 1rS $0ps ] 4v^fa`F X,cY8@.?m ЦSJ~no>l`Т^>Lw'Ran @ X n[r_~J$@ )9)3Р8 _oг ,IatކحD OH܀j_8L  tʻ@3`=0 x z/)OxRsݗ!6c(Vȥ=?yO^y7Ct%U?@0ؗH]h@t3\6` 57P8cTr.C (QD?`nV%u2e_S` ? .׭(\ܧVp<#@0B|t`z_ @OEV4\֨|T|ԇptD 1]@̏陀D?|-_@N:dtNU>^Q<Т{~lOXb[!|00*p sQQ?I~O0jD/R[e2VM[&Z F= 쩠%V (~+X;JU PsNvJ*/RZP7 (Y^@]8=z`o Pr@$? @Xxn>]y \SP)%$a ~6 pZ p 2_`Q@zGqK@*sf.hF0;|K'TpOPح@VhY'Ő 1_`?  *" O?d @t*z- jO'?xS Q m{dY<JY (qg:k()ShGox ԩ?>g!{`NJ?V w0RvO7zss.81B2ٵ_X`Rp<~+Llnz;EA;p>z|Ft Wx@CPv)v@ g֭OuJ*v_xjsm7 NܷbjJRSx*} )[Fhji H<Pqf;p@X@Ӕ!*W^={I@C<3)+AԡR~O>!4~tU^Ï In `+2GwU0tГ'O=<(&2k oM10(0@3D-&θrĩ)di jmTe  ?.կad?9Tpm@G h?&}ܟ:eE#R*< (!t @ h(p$TAw|,wEyp)Hj `}}'~s ~pC9#2:t]TpHܓL:`V\[ӃfC )yF!(9@fitL@F=07f]:,]b $0?zį~q0!|6~b qt Z$ 1~W TN2LCF&ӕѴ2Q: e`"7AgނgFcW `p*@3P!Q !P PR?U@ @"g+)VHHYOt ^xnS98 djԄtͺ [ ӅBU\o52pj4mv/0;S-g/{y:s;瀋6@nd kj_Pi@)JD\ abc F'@Y h}S .M@8kq/]Z몜yk|j;򷟞^}J d0`۾#PB}$hƿ٨ + (?Oz@R% Yʦ@K4Y2 ijDla0{ c̹`F,>䟭 v*+HXbmp,@ ߵ `2ZP MHhr(rW{+߀rMCW |-mPV^p)/B= J_hIP)sTt}B"=8M߰Y.g`lxhi@n ݬ8,6vTB=1/U*~pf=\(S _5oN<`?<SQY?A@C/~1m 0&CfV<U\ p`tTӄA@iէ3 ,=-EGP4q/UvR09}_XYY< 뿶'LO\ ~د2uO6tfn vc\ ~u` 8EH .D ?9-ooO=pMg_@; Ec|~$s(Aǰs ') rXcmX0wrq{%0 :(S#Ó{?8 MЂ>zm%".yFVr1r=w}jUǶFO,fyZy ϣFгi  UopO(lبVCW 1s{۳%?\sct0`~AŔxp'vF\ qL [8@>=@(c"ko p{Řyzp l-PeA3-6WIvKgdWoHxVpLWxR>vov }T)/Ir퇿6BdG; I] zPx]{w}@T!HwP%FEl ~I 3`aJt}{a_ Jө%h|%(dV`Rs`y|šh ;c'ZCA @JH<ְ4MUjv7c)ZZU7G 3 ] r,_1|ϕ\  `.@89)GJ7Q䳠)X 4`G@ 39n7*+fG$( 7.9 Xp A?$ s>aPCĘ8: `*t! B ^q-`, Ӏ+>6O /:!D?G GI ޏ R4 fbtPL p< CR߂0`ǟ,ܡ* *Co0XXb(CبR A`1Gn@S7Dջ4 '6`@ֺ++Y3#xVTel +D *Qy)YBoqDx A^lvlPmUU|ȊvF<r0XI{ѹ\1Rxr՗Jӿ*{D^W99%@ zl @vJ:2NRn5Ao?8c!i@6aH \bf@e6nnmmӛ P.B1_fG#OT7P[}k:I)P懤bJCSA.@>h/}UKllO€G{߶pرX 1ߐ<wR ObGa5ᘯ_^+.Q@ 7{R}ټxU^\tRt?, aa394}t<>=y);!.ƠK7`pξA٠)?W?^}P aY{y<.X^߇ ئ4{x9mTga B0?=lt50+ 4j.Z(i9j21еhhXGSRȀKM'q`e{cX͛7 ݻ۔{?,\߁vp cD$>Bc~X`7 :ƸfWZ36ꉚ]O;ʦoPьxQ Kz(yֽO=sw cv{v p!TR  =NX`χ\ۡfȮZB wWu`l;0r f540ypnq1 ݃Q L;tP=^I`?XSQA 8YJypmMsT٧)狀9LV@eRiSABbCȓ?_w(P/fj +s%3?˭rX6H=X *Й߬lv(MPݿo7+z=}UR"*i[wMW "L.)v`(rUdY*j[W8Q8ND!Ph `Hn?i_4YÜ Ƕ `w"B~7n#ۻnCy3_/Xl]XK.EhfEgr (53`:}N YlX!3 h*;꿣n1d}@]Uof0 ݘlrU^k(Ӛb3'1T{e+J,JQREl~yA^ԫUn!&Bp( /ޏB'Ug=%b``y :uݧ\)FPdHC܅ ,H3z)pcY F;;N vmiH ._>"y^ug&Oa}:A I@: POԭ JYD+^-K} Y|@a  k!Wq RkkkY'99[^WQ qϾNЕ#CF`#DP@!@D#G>,/N ŀ9_#qB6B9}|_&|}*C2ڵ`n~&A@ Cfr`鍜gg?~86 >Ĵ@@;\ȿpQ`0`^F]@[G Z4WCHl˗!ckx %Tk{H<ښ&M=hSʀUbB xFۄ!i@01=$Qiyr٨@bPs>l]6`[U`Rebj@˝(2ӲT4!ҚMU%D,5RUHC^pY2m>B)C|k=q! >09iL?S*@pF}L,-y #@_:?ūU L; TF+C2ULV-ɬ13]1kMzhK[nߤ݃4!LK@ڑk'5[*1@`Nc#BO ?77w9ML0lW<8(@M d~d3!@be p 3Z_`hjz@Ck: J>, YISXQVם?%nIiBB7{`St&$ê]L i{b  cp-sNNNf]HJ`mu'T/ 6tL?Y^^?0P $ IDAT&VVz!Hez@ Já_esT0z47f ӄpT6ͪfUgETWm$FX_`6ɆCdLYm~0J4~xX+ `=Ǐ/^sܸ#GUo HD\U{¶J"Ns4eۦ.a,|#* $ >Vi !YMeUa DVL 60 a{p0c=>;ub, cDp9({4MPz{sc W/>}/=r(0m)R  n&ePLwsHR_&DJBBX KiN#vU2 ~K\Enve?ykLU0ǟ=uSxF`*fЇϳ{;msh &qϧ">' n[ `=`(@^'@sߑ  iB=l'qE¿ZT"X/bDe@Į%# f^ym+^H6bڞjA2]$e@8.C!U& N4 g9a o#7r "1AB&fUq T y8a%g0_zAv0!i/@X8ܨ\N$jP' U_;#03:!Эꑑx @Tu5Gfx_0T*vd//-" 8EQgBP'vwH^ H pFLH9\,S/L.5 @2-h$*>Sv$p8N[A pi+P _8)07L 49 s_e_~~\9ق20W-n3J0nnA-’ŶR(!8 RK 0- 6| gϤ\ABXcc c~s' >0Wv @tϞŦ!#ŶRB?)DW L |ȤcH"\_ϫ`b0µv7D?38?yE=t^| iN<[6 ܏zH~(ݻF  @4q!;&9 ^!ʗ ?PK<嵞jRR ㄲ jdtz/YƼ$I).s@FƎqa(g>_etȌ[GNl5  (8yQD ߸$7r p50L`L$]^'Uƭg5^7N} 0-qɏ-.7xr d'8"#.90 U AqHIǺHtꀲZɹsԟs0QQ @ 7- /G7P%f2`ݽ]CMDPR~G GP&>.HQ7ūM;(U}- `lllaaxyz0g8|7~[G/q/k[^p?E,)Qe@4_ ((jy]: P MH(PPZT']]x@*k*$aW@N~ `XTOC/ݼyA :F\t ;,7 i4 {n[4NMM/{gu=R7Ub(.\k3%RRDDD X^) &0eZX"1yԕ-.6%&tdc3/d-` y^$U58~vA^90l}>)`lm`|p)Waw{ :蟊 @`_G"0pv qm<p{W pF9€ITxjvA ~

xt֠4]`:}<:mJ?W~c @c&UDDay^>$~4)aQS"fyPҊ:&y `%  A$( _~?y(\4f%,ghz&8@1X,XG=4!!dLagL F?J$Ͼ PQ "q,"$ @Nv+~Oe HB!Pׯ?`A `'M`(PpRЎC .LG=Bz9mi[|p':eшSaLhهA b]B}O%uST-7b5 9L`*eA 0@Pp@?REOwB0%X|gL9DR Rf0Lx@oi?fF̀(dE@L/ ?da_%wlSJEDM+SB @Kk,Zl6 *I&A+ /Y(d#69TKؽ!@0NHg@[T~~:|?4b1 SYNaT'a*x1LSئp[Ipb@d4P\\ XzlBI8y (d.AUU]d?[Y` C`@͛)KXQ[/nا"  8 D;SS)ypx!ԏOXv@|a(.iQ y4$P)l `s{7wN2?A'YF }'~BHV=t&ď{k}⏑W|! Q )xrjTreBB~wrcC#@`گ.uS+S_lc^Q@d\K@@3ޢZ3^:c~RGUUA40?Үc[̊8DmV>Tm?4B~'|#OHY?'DH\! zAOH<)GQٓxXa.3.P_@R@c+J_ k A0  d/,Ė2sjJ At.|$\648pRI>R?0n";Dy?ɟ =љRyW;۷ *8֣h|b'= uۂ2dl oB,W9PaaZЅ[^@L}_"y'?gq\6X^٦m7}"[(c b# @9F pS B:=;++_ VJр8Las?WH|A (@N1`B˴ O%`q.ǃ"@Qh&\"׎DM["{,Ȭ?Fh-CT/|ON:-=R#%wZ)s9@t?> $+wuu1H< T \^$_<)weX`Au;;dA/0`/ğho۳I[SS1|fP޵kW1 RXZ y*[c苢?=N՟f?1z0^P0|< F>Vj`R(yO&4 HѲЬN ˙@sN.^ЯADG{7{::^o͹|W v3篛L#1LAgC@`?q&>:@h @W`^a T.D, $@]CV N U.cX\T@Tgw>};u|0p[Wu -B/LǴ/?@,FnPu5DQݸ=.1p@l |R:t3 XZF8t(gRD[ P :zl?9?By\FHudyNP 03&B~- X7'}I (ic wjTCB8oĸeg87ȡ3A^l*A@OF4@`pppt@ |1` "8?ZLBȯ)9~29>0*{gue|h#ūکZ 5/ 5K$! d%nJy3ıY*KTmHE4jͤYRHQQ!P> M%T@(wι/Ͻϛ_H?c;|s A.f IDAT@V;OvmӀkB  4#\z+АT8(+HEZw 6@4GOVojP$RCD |A_5xxA 9^omGƴD)|ߧ4*/1\Z:pႝ5o ^T ,/}URl~}w.K2NLJdێ͹;5=mُ/0JAP(BW[X1oF SÞ_J<{ zKQ@?1p@9wJ*V<Ex~D<r l@_'m._ds5FeJ8/Ko`C5@4З90W:`0;wszh/Nc!oY4׊0-w'TtgUo  K6>oW]nt)h`@rc~{$2Wv l ]}s{ԔR|tB0;%4F - `r`P>Sϟu߾h|Br@kavcP^u_( G(uZ6.HW0;J\Wݵ`A\$3ARf]V tb(@Ȋ=v}>..~?5W_V`YP$!GPfl5U!{ pNU](@/[eV ׿V`>]F#2DN,3nAǸ@oUle "i*jh Ub%xW $jξA] h*F)/0W>t =;;;f*ɀaZ;x5 xP)OS ja&,5#xD$F(n8~-D `O]=!` #~sL:?0X2akT*1r AH(P Ii9\ `Ɋ\a}. g!'vhj R^rr@TdT!?s2_ & K'#|>z㢐?sDNaF5V9oG7$ cKfQPfBr @UY7v2PW1s 8%o|?9 WrtTqUVe.{P@F b&XĿжq߷`#|>uA+od@4 @UAc3GFF d s0L!6{ mlkVK 2 R\xv2Hʴ) \p@vr̡o./ GT\Q@_D^ZFnD-] @L~֑ďŸ `OO\`@@fȎ#@`P4ʶ⨴t@eA) %~FNUVy() >@O44@t'{2Yb"I2KWF~1ǍwVFj(ooo'=kE b3ٻX[OmF|kC5}yN! :o&^+&@XDhrkEPOKW@9y0n@ 4,~d*ԿEqv⺥sv70% 'e:x47o|Nnˁ(Ӏkm O.xbR @@z PQ6+GيжGo/rMIɗ^/mXpiA0 r\ϊ)0 `@2 aj0MF$9p2 (>d:b'N I(7EOm 9 b}f_Nq0gG>higKK}~ +DnLOGA*j(v Pc0  .@O @,\B劀vM~Sz2YJhXdl@ܒ.c14ﴌ*f8 x499~}=~Eμp S]E@{e7N),/ "Ϡ|!"q {{zzQQ н?3E ?\{>6In OEi Onns vOF B5222 ⧼g PHG@ۀp3 @@(pPP `=z>7֏Hi0V \2%OLb .-@\M-̉tz2=ӀtdU#0;ǐײߥpԩS_h[weXH@ˁ SD#-~Qs[" ೣWXgs(*-]EW"`#\ @`'}x+-) 48@`|C0$F %&b1)r7@k[~p8ІG7ڮ_LTC.ę]q|_ 2a"f<}bRuM,&+юEp0$ln)d1 ˄ح0ӾXf{{kl[ӞyѼssϵo?J#7bOUY`P`fJCP#6oukAb&Ԅ@겏s_7 `6)L@+X[S2O٤o1Sܸ15E@= lw)H{6 J ,?N ÏR =Mx;^ξ84;-['sP'k>mv>( "f| ](|M a>Q{8xl@gp־WPN5 M_BcL߼]٦PD@eT,0ğB5 _L=HN( Q##7VxdREIEV%hD~m@U?jQ(#->AhbOSB):M`Ei?Pǥnxks'@oIR@Mm'Y LTU>{f\PЯm_Mp$?u='I_;d[@{|Rn)br8{'&@j@k.7}8?7DIk!D> Ȗ!B?X[XK95.~JtiB~W +>/}zL YB;| ί}4v.+R\qSg)˯/>8D#|lUG0:;&'ܠp.RY`xJ&GeM h p,@ĺmt/#> cG_Y8XpB-ľ?E( ?B3ܼ#3@]# &k*fܣf(",ۯsdOT~vm@ ? Cq,ɿR8lHXj0x#!Oq"T)i` $uSIZHC*0>hw "^t%G{v hp@BX  #a`@%>`mJjx:GozD~:& 5--5׎jQ> nk1+'!hD032#Z0遃F[-Q_|[(o=ߗ ]Dk A PȒjHH `0sk\ px~Hq,}g`KL͆:-~=/F-B7pH^}gt9l@'\D(~W0,a5p (G8Aڇ @k ǿcѧQ(r$A!Z(4{$h8ݙW !Ȁ_:2^@k/m\@#xvDt=@W@Ļp;4- 3f8oy-J0/ڕ#`ph ?;a#Q@8huwW | s=c.}>1?Ƅ8&8K@ŋ=]o JEadl0pPwoݲ1`Ze1G\ ֠߯L^?//$j$!dt:Ʉ̚)h1h 11*e2쮓 [ʔּFfPhb4Ȣ I#>{;f5ɮd9_!rX%O]?HS)+(bd }Ht݄8XWH E`^B:9γgA xh[|(?Zmqd10?oI kn$-RKI Nz<J qsloA$VK*[P~vGra ]vPjlyv6Օ+E`޻5|]]„[U@~v L-4 hRW)e?gᶶ8l L(k׬Z υԿ p P|? t9^JKK~/ ?ick~D}_r) $%E@0oeWE.Q@e3Ptw9pĢ >9hپgGn`H@ JXe(S Ŵq1rN] Z Bho?)p|pW8] LńۀCO`=C={~R_m zO@b/E||0K HNn{IN\R IDAT)@C::&?t& b"`96 )Yh0t8.sTRs9RWdoÌؘCbY<x(j}8G;}خvϣC> 7uY(-F'S)=8 P]8%PB"E{vDvceR@vxgٱ>rلdbGrm[ঘUd3ȑ#NykZ$ٯ2~xu#o6 nr fB`@6jLʃ (1ƿ_{`۹Jc8UxѤ D)4l EH`@:`,|`Q~!(D6[&`-(#W$j"j"H ়@i8Y^7ƿ?~nlpUUG3!ߣ:+ }[94uRqZ^4?~lr}`\|2B,075 9?=e0b- 3Ž@4 Cn;flSPޟ%WWm^* >?OsE6r^VI?g~b ?>m XR, I&e@-W5*Fr_4~x @=L@x4 =Cmf`M*VU/VL;XWqU@Y!и" z5^53ol|q7?jF 8w_$u};~b<HRE)*~_:1biۑ@91}<0i<nܹssiOac\Ɵ G8 p`Q{ 2Jn2(^s?ӧ~:wlS7ڈohݠ00$m <2} Mumݹ*`GF\0_MFy2s譱y#ÿ$C~\&kMWŀѠ~o ½X PP8lfpk!MCЫ^ tV @'<ӧ/^`p~#1KNJ8)_`_S(R $[=.#T_9GK2 !0#f%bz #)ͣtnܸ ҥg] ߿8~)[!` D|@ ~FhRtR7/!Ȁ9 ] $!@{tE7~^s P : @p9_#)x@{2P)>PEֿ\a|tɣ?\&-Ch@!%x(F`CcH_VC嵲-id1>"Ш: w`t6UnoYb)U#`ʶ(@J*_J@@0 ;U; C'N\Q?c9p\F N4+=@@QTCw󏦅Ajib u W*^ dT ~vy~+P%zYЯ1L*( pJS&w Wv JtVT6?)W#=C Ff=i28̿Is !I@@(1сiF;*@E >/}:@d?*yjp-D?\U }Q0CUM|?ZUE +S\0;%,8}ϯ15t& C3> Sp_ӛ~`' ?4@EAP.~p/V$fbڼ8j.$N<)P&R4ޚ&m.ҩDs$`ERQ%E^E )M)!-4d)lR46U*Xr~ @kz~<ӂ|h9ٲpWk@?6t΀>X[Kva pC8 @a!_=I.?_k.{af(~cEDFGi[ŋb DЃc<1kn`2 J]"@ ()D++uO ܙAWU\HdKm 9 Vc5diPtS{$7X\X?!3i}ƆF^y76|#?"]ŋ\V b@EDʴ_Ƽ !t? ?I$U!N{@( `Eɝ'=/7 }YX[SU_)NXp04 JT~X_Q $=( 8ߡ҂ǂ^ f4obXa ^ p W!Vf ?r]]r4I$xy+v PIMlmďx `^ \D"$O aļXf hAFYhÞ \TTCzW~2ٯ(!7;`,piDdڿΜvM3r){^Axr` Ah:Tlj;M7[00 RsojҽA5KR[۩SIrj)E` + 05=0k >:i! D.cN@\I(𭀑l rUȢ_`FV:t&(hR3s_Vή#3w:\8H lE?\o~p T@ pBW} oހ`%@lLKB !JH H#l O.6\ɀWFบ5eK_zΣS`nr_ <H$!RR y\XXY`?rԪr7^*(mr[@--_A _.@WE3FP!-a%E 4"ZA@Ş*󀴴q9\]- PFՔjA@2KMx@et0nNL+8^y )c >+/Jmp@x}VH'䯖Y.@Ȟ LEve&Qß+>k?Q=}0`i r t<p[ޮNe_*lu؃G3PsvrzA4 Mn5v3ȯNM ¿ʀ c3@sT =OIx6:jy}q;£ͤ}hup*:.L ţ]ۯT=@@Cx.@J(KR( x4!g_&)@PQh Iz @@* F޵؀eU R~=Akm^h 4qE fJZ O8!X> sf-P]oYu J\N&$ ,7|j!cn[wn@Ɵ@x C@+C@`pЖ0( ,W10Џ$)-*0+#SSS3W^?MsP)Ka#KhZ@h 80g>X HTr0T '^8^JRFCe۽a!۹ FdFd#HJbgȰ^,NkHT;muI&t[mEp?`ϯ99I [ד߼I[o>?+ ީh*@u$>@0ɳgO@C! U0])v<0;eYg oCWC F +TPUB(`ԩ)OPQ@K˯(N[6xm_HP JB 7Ҁmڔ J>陁P9P& `!|\'y)s6 C`[|y `:o:/Ϗ Sh0"x]H;pt܂Nʀ,p^)93O{)'`) - lRy*Һű,/gJ-gɪ:$_'Q8GnS*Toi7p>x>=dq8v!rp<=)N6/ ;e~P໻2Hǂ2nhx 0Qs/Q`, @hVaΧ!Ay5SZ1o>(t$TCЋ\OpXaEu+X)hwt`E(nM(G$5W)@@) 0R  H5~ %^(?LJ~u0:[P5te@-oM8@b`,;NQ j?1WxٳX9i2l}1P[xCT!VVF/;w@"Rw4'w,1ljpY2p k#xܩ&XBb&A@~"S >| OЈM e)0YM ,s J$i}M:cyФBCX9a,6J n@EEAcò8hlUU8 AdI6›1nMߦvMCEp2` <~R47-@ 2.Hyg|lf$%lLb@0WZ?V!ڂvaImD)0?h婁VAVP'I)v^BC(ƣGXUPpa`+@l>;<ə<)!/oa&^d.Wg2lxWWX+(Tx`!/,H+,x.1d|]"' dX= o)wǀyÀx?kd  ~<_>6@}#J /\%euP'XЯ3I\`3y\ti8Eʊ\HTdu*3蟨 pˎ=v6MDth>1 ?d=# 4Q `W%K8]" v8 3tPUjJ#^B$J:R 9x7ɤp t}U,B<P뀶_TH Zנ4n%o_.kpRF!Mx\X$> nzi*  ggkW0 G,0J  v .VKI^4c1`ac90>}yyv,_yR0uj.DR[A f75<!vK\T  $J?'݃S` 3a ^C.(0w߾sCoB}HV"3n_\|^ dH:Bl2=nj#kd(S ƣ , / .ZC H@R&p[)0=z IDAT_ 4Z ~n\]@q`Q@k.p qD#Iy /F!r'tO5@ߴǧ PU(@PBsB g$`* =2O@\/m= 3Flj>_f@<u 2.v { XF2a; )vL0 P} ]h~鿝_nlnnrLu~~uR3믯-[N65g}T/r#K2礌:|7 <&(3Ai0 0?L0V&"./wkvr\Q 8*]v51<@;rĿ7xW1*f_4PZS\t~ft?k] tAx KY`ֿ]l[;v4Ÿ\\J<e-h њciJ-1 K`,BTؤ|'G;2*(T+mߐ!]ׅc8V$k_0V>}C~u_)/<__}R>k'ݨx/0:,|Edڕ-+Z;:LϞ=}`J]sۣAξ+ X( #PMRT 0<C䇇az~ c/G"/hd0^X\\ :k! }VV{41p.8_~e?\x?T pgu]h6$=ŸX}:3?זmO= p1( ,(Rl0R"Xh2" =SMM䞩/ 3{p]'mA`R@[(`Y4h&Co@._ODF XgNp{Hᯬm~ldmy:FFFO@#]0˺UJ:&(,>-C0Qn(7?YX@rIAcLLn[t\,I\$LELD-xd!90bl1<O*E!Y] `$V@*@0 FA} |G$*0yIsd󿩅lݸc3'!>>S]=:Jfq!.3> +?|@AK: j} _F؆jN}8eaoI@A hU7R & IuD]l , n?ܟB/_ #6*LI>E)t}R'9^kδ\W uTP{ 09YSBE9TgB@$)ekϰOVPFx @QJYWZ~x<",@+mPk~ /E/@Lɿ3g1:!jAʪ̭R/~0Eyopk`CCv?p!Z MHr#0EնNbO>{eF0e@< ?`8C9?驴#3{Z#z GA1T &e417W qr+>dIŋJL#*5lWy*}ާ"T]y_>0[qbU X4ƺah.ofggkܑA+vy`끝(~(3Ȫ`@/Ea` V>dmR}RD޿џi12UPtld>yvK_ lR|@L`ə< m(Rr^N Fț?HhÆ\LY~( S<3O_M۔vc9vm0P{6э rl`VT@`L>-eq )*7Bt ) "@%0,# ʃ)?>Mpok- #N `Wz?7dp 1mrtZ5,^Y:p/(;L+CQgT _9;.r % K~j@klUĐh9N, qy2L--mH}}UG<)[_X3JSyTsL57 p+jr#Y]rZ4搹Njf QeS&P`\ " ¼s9B|@La .K9-ۣ `mvI><fa81-|[NA7PdkWxAd+b# R}D`҃[{ðmRAXTH|zk`OBr ((wcp=p~nŪvO 0vF}Kzd2VtP'|X_MƘycQ H?^{Bv_ČftOk $#c^p'I@T|M U8A_.@P1[G@O&L,khCPk>1`AbI?ѣGUaD J7DMÆdBJK_ k_-^뮻yO 9#W~<+~B9 `d`x߬c^ @/@]bp8@>yP(‚yc]g? )(' .<+(O+#Bb߾iu\ٓ_[G^-J25oxJw-'MJJUvz@j ,mW@/̀_GkяlR3/G"p06w-Ok+55ZʂM H%. %lP~k+yG<+Elh ~^ yY4FK-m ?`0,] ,S`\+@~u5 @ccԢ 3DGѨ_`οXZZ!Q-@$ 0@o_-b \}Gc@~ < ^ Wzϵ'%rC gAx*k@*5MPs4@^ eQR߯"3(nH6EG7-_պ@(DϓG{my^l\:7v~y}BieeQl;Ouv XЅ506ZS3*2Z~;;p` 1"_mX$kwp`\ `j*Q8OL ƾ2^@X#O.HA'#@o_~# IU}_E?pw N4NI Vkx$.ʥ~R@Ӏ7g g73.\y$3- 6zg]K`2h!qS}<p] j_ DwE{cG1%~g[Ix ?@'-?xۣ$N2*zu7X\7){u+X4F\G~'@'Svt~ ؽxA Ve[0`FLsSB0wky [6wKɧ1D ~Lô?Fx7={Zs irԎ#_DϞ]GhJI]@~b2 -} ٛe3Mצerc}`ah[J4e4B KD$VS|Yŕ-7,aIxT:KE!6G"Ƶ5Eĉ[-0d#a{='ɎCs'ɖp?{ot~Ŋ 3bY>pD:\:`̯R1Dw#J-E8 joYU9\윃V~l:G:P7,[5MxJs Y]U~ S_'C1r%TmzFYQT8C0:־]iدtO`9.(oÀ<)Ic|NуŁs(`(p ?S`D fh"j҉B0fK$sY#7ÇEAdoG4:Ý!ٜ(Rh2&1mF}AۻYI Hܑ` 7lP,l߷Ù 8oj}1N8P&kw%>ƒަI@gW?; D"À _tAxy4 6|8csh|wT~ll蟅#Ԙp / p۝Uk9'_LFуtHX#9@ R~3kB,Xk 7/tTN)!@ ] X4 q_*cS `ƃϷ{z<iYMHpͲBp 9}ʱ0 l jsO }d!Ip#teg?k%OwKSG.@az%%( \Mp@=(y~]梆 \;[Ӳ ?g\!hw: rc bm P,F3q@T &t"dŇ~je%0P%P#/@A-$|@l)}|m [ӿ@3x'lЋE,,~@Rp8 g c}v@7W%UlvWͬJo˿.ܨ>4>E hzC[ W!r Dʟ(D E}@,r X4m(3U,d$@?hJ2bU;CuR ~W ]Xw?c6NLj!zQ֫@,S8 g*4rHDo V878hvf?tp( 7Ww[?Ypwݹ +!YpFGɏW!zKrf/UKJҟ6M-)?e cuj),X |;qP3F֒e < ͉`4૪,鲁M$`mb;(K>x:=F>!ewn9O^id5SvNGepA8;cWɟg1&B@[oluNp񪾙R}*s88^e0vdmLRd }Kʥ@4v`Ci @L":Ck׺G$E J eڷ8D`vw Pu = B@臣_S3?SR lyw3ˁJ,c'dgU4ɀ#vkMy"MI3n EerldZavv## BОZuޑd20bI ;# mmoΡrHt J' `n{wr2}; 8]rX9@ϾճF}S$6;<*?= 3R^._S?<\^A"*A}"re; 9H=Z@v(YGn 0D 4Cj_T]]YZ'BpJ& '^Jf(C!_Ų)z4.[Z<5PԩjZdTud迪Kk>tjھ+'e} ܿ hmo٢j@yi0f2P3VcUبi`EJ__+hRm8#k $?u`_@k_q?n),ޣ5SO睻Y|5 +pm p#.Ǐv3 x$Ņ uic(6 IDAT*TVF \*XT)6'sm _ <m'7 Z.@^br@QxH|a{k/.uzIk 1Ie93^!?Up N]ȺoIS?6$+A,Bknw4dv3u釀o8D# :,%2ld IvDnf*~KX6a%Y as=sw[9ڙqƾPrSE@@ߥOXACf?X |݊-0yA "1X@ Np@:'o^^@@+eR0u~uR`@/WcXqnnbkO_7[f'u2y#DDdrkxnn$'jDکqI_y\P W(u$SWT[yuv.oYeX_/Q,8-@ ?S?ğ:\#DbJAnq1b[2g{x;`Hd0[ɺrT̘ZDp10ri@;ߺ0}6W>}ږJ#>Zٕ'ɚα 蛣.9D\tP k T9>m]9Rtvo/>ި `8`NS=GLv,.D0;+c[P'Џ4b@Z`58J?jP@N;3ip)pIߪi0'Zz{-ȀC$@:P0!|b÷Dp &;sdmo--m/-BB`>-9lU{(| Xx8"_ ck8i&u&jZ]GLQ2 i4`)161{A~]46A t T ?ɷP; +I@>  [ӁòmƟg]]]++kjN\Wrd,0m"   R`? <pYB+Cdu&_9^S3#0r`NNͯgufggG2QBP@$&dWI@֨ _YF!0 J8h4*",>ty4p4DHQ7~? sj€3ud ыA77y7N?@1(#S &Z p2 @3:& P)xb7Q.lԚ0hV91Eǁ݁u~AZT wMa/a'h?,PTK+ d.Zu8hz&+WX#˾#0;pL={xH$L`ʟF54ğ6 cR%U%`C@pIl:tԏk.U `> vema'c@eP^"zb@C/v3fmW7xPVoςF$`scG "4h3'+ 36@@b' ٿYL鬗;r 8;zV0sLB ְ8Yɫ|w od-M+ ,m٬ 晑toZ7 ;/8u U tN3a ~[a@sWB?McohH~, mUJE@b9?Ȉڧȟ0 YNJ/2?x'>p( ؔoUz;# lcazx⼏NUt,[0~kw|PL񞩽 h։@(D%Z3> "] $M@ 7E)  ZzYpO >q,G@c;cc)LJ 8:c ARYl:mtm2  +M5 7I= BZ tht㾯kquC?8PD%@t`xaC'^{/w~0  qہ= ?LϔL];F _#w$P2wci%Ⱦ9 3P4'_ L^Q/#Z[ ܶb9 ?'k\ ,Pt=c]öu\midQP.mqkM?ϝ;X5P@ߴ5P C!k Tp[WPדZ 7nxtB%@7_|ٖ--E8 7; 5C&Nt ;0|?M~_z50 n{\(CsdԀb$ʿd:@N7x30{w@%BolKAoh8֊Q@/hʀr#`TmB˷dP%nG, TȌe ?k$VuoBn2uqu -K/,t47_ ?A_9g\xORNje$С_6Cx P@8`mjb7I [`0X^R?> O +;Ц3ڤH/ ۋ ZQ+ebTUk;+vp]ul.iJD6D*n̦*hmš$]P[C(}qrs99/5ӽԘ?` #歃HIpɲm0:\!u n[mЦCGwuutux!u,Z[ijKw3`&?pPď{@`O%A* uo'?^ Y>96s0}Ƣߏ7%ee7\!,/|@I|>P@@ Ȇ\E>mlF5h;mB>Gה Tm@2/IiC~|'ammTl))~~\0mF4 _3s[jz[ @|x83/( fJKK%3O[.e~e [X@_E `SD5!l;V{OAp3<2+@|#~"lƒ}cvXD@vtCl@^:T?܈08Ze  Nx: +510WȯQbvsHB> Z (0*_WVfܭDB!V 饔/1:3>@77G.ۈdb Gp4]ʑDz T{٧f9YGZ@"; UKٵPi@xA $3.LyzB%xմ~  d/+={Ϟ='];a`ս{ƕ 2Ǐ?#-=7Jl@­~yR`$S89K ;`oLT6d?@szeOxʂ &d м$M|XϖfpNl10>_lsKW ΧR=L/<秣%_gE>G0M\Jl=50_j>8U@shSUG3-".C?Ia =Ǒ]Bl{ t/7쇴CȀu#_*m졕/5~gI_V|:TqoMd8R@жa6oMӞ?C:[=@ y_0F=~n|6 6H! ջJw;N \B&]4 =,?@sjO8X [t GBfBCE3@C㮞2T@oȑN VpEѽDۯ׍4,n8$9KSÆ)4 i@%/*ލ hF eS =ˑ>}}=Lt壵6i@%G̟ QxD.`קc("O2r`dիW@̠OSB68?a UvC7> g7nT] V R/T0.%W!/9 .L@v?m ]<50U~W8 B^: IO'`VmaP shO꯮>j&رVuߩZ t+,tY(+ⱼHo1շDK%]Ak\VU䤲1^E P!yng3fbFZaFE`҅7ovc<+3Btf,,r =M13 Bz9wߛw'9msH#ye"}w='d]@SQg1ۖ 'l|40ؓ=obpvlc `loo,[{ ,vMD?#nG 4bU^ƻ-?yg 77 p8>Wω;}xcR+Pԅ. ~y@#x'r"=x_} п_?{KGH_/m qġA iBQ_I"/t~S-7>- hB[08T~?]20{6TA] Æ }/1%/C?'N t4e݁ L N+x~ 31yݠAQÉpa_\޹s #?`<=}QZCQKFIq|<i_S~ B k:=@لaN>\ϻP(~r:>S N`5HiY&C?+"N34_^_cS>^O~xGP՟ҥ?|B1G4@$ΘS{w"w'~Nnd踿 >k8h$B ^-;7=߅п9; H؊ +J!_i=B]3痑τ} «nԡXRO~_Aw!Aڏs94JҁoO].>mo!q#ׇc T y01u$LP@jX +ʞ$pn} WGqO5N  A+ͪ'=o T*9n"@ٲ|9}aAgD?'7\hVLR(3"|bv : Wԋ@! 0,P ;Hߟƭf!;rXVPA/;x< 2 }~M_*2^f$ /X+{!Ls"(i7 xᡉ &ݻ) iEMp@'`XA@Ǟʴw.YL 8` Om>5@X*ľ73C/PrmQayǶ['qڎS :ܛNI1եi*GnO))?XJOMx9@:(c,UШR@ .> 5n! hŏ,*93q2 3 --YKt !3ES ; x<g[ -8/ `JCABbQĩ,f!$_~pa2hŲerF:^KdHdOGGd-:svo~  {"[L: hS4촦z N&P xB>O臿Ҧf(0feƤiZY_/ !>M>~@_<"P.Q^Hh0c6iO_mFYk!~''ET[@>DyA? e@ q.o7=dwn H3io2'EuD(dKqҝ#8H@_jOaD )j &|(5w@5[^m! :|~ 1b)-Af%Y$x$KKw0 Gĭ# ;+-b8PgˑHGq + jFD b_0)q~`!p+e[`@eD' R~T`}:3"$ٗ}[~LD\,tB};bf8AXY(D#0((U s++h쀭PԷmMRpHF51 rK D$_A5m TV ,Z Uj)? xPPB?a CmY` mC@WRzo$ rK &@A8BlKяݶÎEδDr fkbC';q#0v_d}A_)b?H\Ds p\o~B3#B(@(fag?]AR98Qe8O*.IFTo }xN[̥^~V1=pֺA4Z!MqM|Í b@E?: -@NA&4zdHO\³~9,mq~.hMȚE Є_lpҨP#(lWBW.UUL#TB4EL%Hj1IX4) >{k_;Aklb0`0})Q1QKN%XC@a^Yvźl'<8ـLxj|7 =I,*3" D$ GGGv,f@)ul]1yFɐo6\H*HQ!:ռLմrd` 5 !PY HPxD5*_R)hZKiQIIx,*]ze8`g_"`kPL.@QNV@Ia `Xˌa:\@{hqQCߙ_+i8Z&̧3IdKI$44 \7PD`K8WiuǴ `(`DEɒ{87W:31 NL$q*XF)+&TE-$-@T%U-lа7D" Ӷ4t}Vi6DI`˦xn [@ p@I =w'oLJ'aQ?Or?[;+\3OAeϏۿnyY=#$x례sՂ@)')` w: zi`QֻAbҦ`%7I& 4\t|ǭ!ɁGhW ILZ75 K;H8~,=8fA5Z9רu3HA z`Kpp@sZ$=}v7<0q`5 a*m7Zv;ZPP>ZH+"~p ?PlQLOp7&&`@ R8O@CPRpO7G;Kz=<3@? o=3&MOp.U% :` ̡L@Y4XT+zMuRM6F#?AT 2߾?|W.p4&œ 1Aa)੤!߯vR+% .h"R5\-֋ ~T/^'y䙭7goooo)+j!@*Nmx-0BN, P#TT3G- ,, r$ В9LF:qzc6T8zRW9"!žHH&;'>uyɭ¿J7x  f@Ņ>1!SX @[x<'V~)駟,?)hZKCłLPPA u@ĞP-4Έ4 ; Iͻ#":B~ @ٯyQ>oի`PbP@Tb@o$D~y6?mkG,/DBF] `@~_ŏ_*O/_3.=]؅1gI;+)@E] _|ILIх~>zM`=h(8L|xPQ8 F m pz_*'2rW=#00_b1|1@xÅ!X/WU#&F甇!x< (Ms|FQ9?2M/+=%n?˿8̪>6@F$ Qb]ѯe8k nϕ(N~$Ow0*{FT}(SA@9 pom/u0j4Wtذ 7pτ5trfHgGirpX -@u Z:t+#t1!߯Q@q6+UOMF-dVD r9yлs!} ?cǂ$)M&W!/T@n֬:O?EN|>b_()H U}$\(:mպ@(@IRrx. t0 "@~;~߳ÃL? IG]2j+ Z lJp#H 2HK3FclVȲ8 xeB/)ѦJ5 D@C,H;!m"^i!7#<-`sǽܪ[VfrD=:8d#ԪsN?q5Gc-"ٙ7 Ȱ.V0HOjTdfJ}h9sAԙV>x>gB/b?Eҷ{VVɛ=&^NPKJM.0TVkJ #kqhg~YL`E>z<οӭ@44(N^}/ݷ <D*6!sPD9Z?f) Gp9Y#^ uNYia. `V$ ?i#&P$lno?~ !!"ϊmj`+Z? f3n >LV깃/+Q=[}]b5ž[1p.q{Te9l8VK )Xen%U&{x"7T` aE_| ԅ@c8H㙝6n!+?S_VU}/<h>&K`Dp(S=@]aH@ʡ0mi=\ @lۈx'8)E6)@iCo@_0o+w6pucONH [e97z-.#/Noъi65*cOW T<T' "J fjͿ`t`xeM{-<\ʵ,؛1b}g[|KIm\ `8(mo[l7ŶV:r`iz0u?d`?;d< Z t(h]c ܆5Ȥ_V/ XX0`'cqҊc1!SHԹ_8 7<j~D(`9 ʝ/T\Kofe cF/$IWFK\ p-oJDi[qZQapG_0D(DB@`,1w}#o WDw~{^# *6z-'sy߫"ۿ]+7RW 8M'75h=d<4 9qEq@Zmow| kU^~-QtG0G eG&FN'g\<Ve(\xԷjU=v{8Lc#ԯ@ (NBOR,BMZSn b \0`jꀟczQzTQnδ$`~]f|[+ݮb5Dh 0v0O\GֳQ l c([4FtU IDATVe3 , /w*כ$IR5@SrzJhw6~} jG] uvY( z: $:<:.  |vu"i(- dPXC|1VpbmPֶ*lЌ=1CUèOC)WFJ\d'ȯ'~izUǭV:8ᑠ4vXj4J*.\X> )"u}-Vy Mו}*aǖe 50gIHw yGU|c{rdr~;ǭ P(9AԣDi{V)vgŊ#`t) |A(+l0{FrQ' %* ܸ%;$AQ|*$,~ y<͆_I9tj8v|:~ɼ92a{z c 0fnݵ4M5~zICjdt g(hy $:h9>"ps~\?nX3 eC1I=^߯'&$~6SLKrْZ \7+4^\\NLZOV8^mz 0:T ]l 9IX5w"p=`XWlS@hYeiXeTg8Vt喠$N }Pf8BS]9J|g,} `!@z (*Ւ_;N|bH` d3v^TPOy!0Usm:`cy7W+z\p[t2 CC>Y,1 +g30^8cX3ԿKؒ=@Z0l(9H&~c9#j|:'7]Yxa" m `^d[X@K8?(%q@ Sd32!/:xɯ-Ňz-?)x5@>OhﴞY6*@M49?%R'KU\'ޡCP\ [{ʴk3nEYeYоׂRSgo@&%)UK_̗ "G*SV-o ^_ڑ`#^I@z dF<ؿuA贵H PcYI(VOp$DA'/v FhGRjh`y"!A>6`7+M4(N'z]uVխևa.3Ӷv:s4;? ~@&0Ur€J 4@W15un5@=xzyK;Ia$ȱ 9byK?`.=TS7 c-:,t,8T!g !_SfҺ[8ݏ (P9ȩ,! 9x€M3R$w`Hȑ\uK4H`> 4?"#՗~ŀ6,t;FSP1 NT8}>Hs,lџ$ O. A R J1uftya Ki&_^d`|0|'WEZ 0_ h/(oTȫ{bނɪxܾכ.['!0Fgc4ٺ8(hx.,T} WJSF2,z4c )1† %090EKNBaW O*lH ~b@ʠ5ϏS&ѼijbNF $P@5x`@`b}1y@ϑ 4pF4FسZL0)4t#cu۳jOt.W0[5|/J;V1g h1ĸYQ@Ie,5LEt vN WL?0ʣZ)@uݓ2!kٌcLYBN!s9XD] aWeݏADTs~:zQn]FcXe3GU/( 'n@b(NGUA<1w>U `#8It4w@N8;C)@N2iV,=K /D)_")> {{f> p^,@jc,#@d遥L50a2(?/3 |%oTv (Jnː&i8`З'0 U? dKIFy` ;gp@x<)() $軅UIz ZA@YU@ fbٜA+pw@ǝ,7D/QRy-?UGD&*}@3!{Rcn zulmg`P, _ zb,;bC(<_^ @O%@t9s_"@?zBm=9$MZvC # 4- j@B5@UWA4@c1Upm57@  c{`8_pxsh=, H\)@tq"(̷ /Y\D `j,|oxzzJ 7~4e[ @1kkt H4 ֕'ND@D"Hs"0v.o寊쥉<`f8FVu9 5h+{0,e{\_w(Бi C{n4  p_Q9ЀMV:Wh +U`k&}Կ6*Z|iϼ@Wrw;&?U~AF cA܌ɾr(]^4Ԩf O(ow*o HbhԀ} qruZm4S7` ewq> /f MO !7 6"scP$ 0ߝ ~n@*p5<8 ͩZroxA1J zʹ\)@.Kf."@sQ3@1 }7$|x ʂ|P 4`A A@lX#Rj3pQ zg4dDu 0XI{QRmk)l@23wAgJ }M}*@dn9X>?I9U'T ba u, eF?4K/#pw\tDCUpYoa(h@B@EJHyjb  HN:@!5`' _?@wA-2, W7W 3-`k M ~^o4/Do:ڠȫ`'AXD5sihзj4uhL"m +vO_1X5K D0 ѐgB)`](r26^4w  9 7 _1;wM M_DF Z[LbaH>o]h>}Ԓ#F(&VW.X~@]C ! JF7 TV>b%lÐ-)0 `x~ˀ@pcRϠ G 'T DOKRJ#,E0W02̋83o Z?1@mG''O3K `Ok|}_|+ $Ru }ɧx߼Eg]I8!(+Q# 6S$d!ZNJ΃A2R$ԉ$H,-6;0LИñWՏ.S{<z}?HX?g@zD Ȁw g6`7F߼ j_Tθ8C`3ryvcfhwv(+y1P83a{@_E"` W6С!@ԙGQA d 54l 􀟒T )QF: "}<R\Kza_)GKai!!Kg19Д+1`DAidEbm| YeWՊ. =X G6x.䌠i+3y.[N7h ȅ۲zlʀo RGF=|{U f(: \(I(;!? WFtnK %FV8ˀ(5x$, ? ou@?'DM']DZW+(p"HA Than* : 'RD<>EBQC%ՂA;"&V BYP^Cim)'ksrn7_}"%[{wo1-}HKrZ2O( hƑ ݻC'gnp]|nIe#)&OR?I8&h.pe@%. HmO|,bZz߸ȦRv'Ooj!/V= pt8ʝ^ -8|m 2f`a%3n^ϫ!|?=X Q N`"d5D =̌$kRMBVز|{C_Q)}ǴS̒tm);#l,(hؔdƛݞ](Ps4C`(DWAF(!? 0 +DO444!()@?9gud4HFMڠ79RH$J@̄@@$p+<*f9yWk Nz U.bNzlz^Y'!%P2Q p|u`hArx`H*JŞ.^1`90ޞ{yqTI^34; o;1s ޘJx[P )%8F#4M/77+'qD4 hIe57`Vhl mC7mR iwd>LO9G Z8 D\hEBp.+Π~8$O^8an#G53(0[g@G' ZWa*FIDATh2xM eIR߼39%<'0] @%~YPM @g/o,%1&bX0Gtjȕ8U降R\ J"@~^Uٴle@zs|>ؗ^ !/SC^ck# w9-@FX{+9E`)ǴCҪtVW "C1 YrATJhclD,XR =RaMK(揧/\E KKw|R [ Czjvx2VtPO)H.80Ldx M6To7h 4&ILV 㣼X @tJI>z2 d0 |^ٽ:ygsaiǏײC Oi忔uqj B *`D_Ob `6ht9qͪO=bIT@#/0'one6ㄟ#ɿu~K*ṋ)#?=\k$`.@d#*vAP?~r0p++ǻ߿7O 0E^S $r /Һr ?}KjNE.0n5V[dA@/##h(b*]lnM-?$wDr&?{`6`%K :C:iAݞR>h1 1#d,% Hʀr2Rmzůda0h"Q (Ǖ\;kv>w0QPtqr;l(L֟@(2V9@b0>$)>JO{RN/܈Rryk'z^B/+xS ,9? ףsH z{V/}*@~St)Ư>@\/,0Me?^E^/e%@_KU?" "0~016[}ȗn,sP&[~7N,JƤ$/_Xчp+(0[8"ड़jjÜ;í)@hwm$Ie%  IC1P\h0"RX6`KpL9p@r .3uU{{zzl0]X;)0.$m*B@3A@k#7"u|a* ww= ~nD/ `k2PwJ>;_j mn'sCZ~ǃT( xysb"6Emߨ0V}"!(&ȷF آ\ݚ"@Ǝ &{e~0 PP%Z;KlкN믟>&o96]DkDk0 ~P.Y?; xxSLUM)%w?>k27U0ONֿbڠ?PP P4\"lp^s_C{@8 $7v*TG*D߿ tqj(Kw?ͽ>=!BTWWur3(S>t<'xC2f'OqGP, ^?~0K8@ _n8vl <\ F1p|=?0 ?["D32@lJsc %(9D`6gLXTX,OId[9D&Kcb/ tJqIzUJ#Jnu| o_{j KZ  ?q:?hBL|, np~s5ac0@I\y7..hߴx"gd k3">2gk"ې߭k!_ZƬ]4w1{2lk{(O-?F=,Y3wqB@%Wp\tJWĶk5 0@گ=@e ]zˆ}ARn[o~-0~aȷn! 6^(j x(K0/-?$~g t8X8ScNC7?18nr( lZ\3~KWF'`Oi 'p1\ˁ 5  P2`b:~XBHb{qmB`;~Z*:[~+ח &pxcX>`3F@(ׁ%ñD-%O?yP!fݦ":\:-Xj/ -Nr ʔovZ\X!(,0_/2V~Yh+|Ub)HOl@{֯-!X$_UKJΓSY mo TM1˅APE6?#pӇ'~)d;7"\5~ Yxw3EDR6k`832kc⦑_m|D~BˏEꟃaQ,2?+|U( k:U껬!4T ԭp?OdgS!ocLK8X}ـxQRޗwE8ڝZڠOC͵A| Za"`κ,q( M` c#"Yp`CpcvH0QΟDD^ _)nwXqPw|%)|724='!uO6/ هmEGUQ,>J0Ɛ2n10U1$C, _exnQv[I(/ pRP " 9)6B0QO O^++R$]\_;j*- 6mƭ' ɀ_eKi+[PlQQNk #ϑ40F/(K Bo)p X <D _l%g CUnQqB/)*6S  }*|2BKjK)*~PjR]/R( 0gۢ N<0P{>\?pޣa#гQ@`W@՜WkX 5Q@\ŁC Ҙf*4B.׆(tSWB{>F=&z` rP/s$u{a|`$ s"jܰ Vpn4.QTlp(sk[Эb$f8"ݪK!/s\!J ,;h1@֙Z L+/%X NO (Ė"oWv֖c=v?`` ?tԍ]@ߥ[ (+:pWQ@`_@HWuׂĭk_Y.8|x: Fh`KOt0qUY)s~`5EdIѦ (Kuk kV )> K&L QOԖW]zJ ip@&Z @Uέ jǾX\ 0օ|YmOεF(edH=077vivZɀ]G۩B?O޿IW`C4R*󫠀 P T)`eVMAu}?[/c,=jgIލ? ~=/ #xX%!%^sy,wt`"8x,rQʊ* :GdKlc"paa]_"ǖjA`Yθ'}},=n8TEX FFEWn{`BX;jr–*|sIIP$Jp=~I z?z@cfl@Sְ 竵$d٫X:vl6 ;F?=:!@F .EXI,? oew{l.t L+ iם*`}钿 vs"FX0'l^%Cgrq2M"oc& r7Gs+pW7_daFTt\f >[ <,uT0( hbK|fJt{Gޢ |#BI< ி4&ex)4 `Iуx@ 1t/G؂˝ҺUzTTD䐍Qrj~JP@gqX޶gllN@-yZ*SRue P2`hpeHta- ]C V_e%q#WbFIz<ſk҄ۄVГ.V9\OE`UͧUܔO3s;f TXAvszغ j.دt W(J0- sM?}Ctٳܣ'"\ymYwZO'LnN@Bc}k@@@@7|fIENDB`goxel-0.8.1/snap/000077500000000000000000000000001334742672700136165ustar00rootroot00000000000000goxel-0.8.1/snap/gui/000077500000000000000000000000001334742672700144025ustar00rootroot00000000000000goxel-0.8.1/snap/gui/goxel.desktop000066400000000000000000000002251334742672700171120ustar00rootroot00000000000000[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=goxel Comment=3D Voxel Editor Exec=goxel Icon=${SNAP}/icon.png Type=Application Categories=Graphics; goxel-0.8.1/snap/gui/io.github.guillaumechereau.Goxel.appdata.xml000066400000000000000000000054771334742672700250370ustar00rootroot00000000000000 io.github.guillaumechereau.Goxel.desktop Goxel GPL-3.0-only GPL-3.0-only

Open Source 3D voxel editor Guillaume Chereau

Goxel is a 3D program that lets you create voxel volumes, a bit similar to minecraft. The code is Open Source and fully available on Github.

Features:

  • Unlimited scene size: You can create voxel images as big as you want.
  • Layers support: Decompose your image into several layers for easy editing.
  • Many export formats: Goxel can export to obj, pyl, magica voxel, png, qubicle, povray, and more.
https://guillaumechereau.github.io/goxel/images/screenshots/marching-cube.png https://guillaumechereau.github.io/goxel/images/screenshots/procedural.png https://guillaumechereau.github.io/goxel/images/screenshots/laser.png https://guillaumechereau.github.io/goxel/images/screenshots/layers.png https://guillaumechereau.github.io/goxel/images/screenshots/image-plane.png https://guillaumechereau.github.io/goxel/images/screenshots/palettes.png https://guillaumechereau.github.io/goxel/images/screenshots/selection.png https://guillaumechereau.github.io/goxel/ https://github.com/guillaumechereau/goxel/issues goxel-0.8.1/snap/snapcraft.yaml000066400000000000000000000012231334742672700164610ustar00rootroot00000000000000name: goxel version: git summary: Goxel. Free and Open Source 3D Voxel Editor description: | You can use goxel to create voxel graphics (3D images formed of cubes). It works on Linux, BSD, Windows and macOS. confinement: strict apps: goxel: command: desktop-launch $SNAP/goxel plugs: - x11 - opengl - home parts: goxel: after: [desktop-gtk3] source: . plugin: make build: | make release install: | cp goxel $SNAPCRAFT_PART_INSTALL cp icon.png $SNAPCRAFT_PART_INSTALL build-packages: - scons - pkg-config - libglfw3-dev - libgtk-3-dev - libpng12-dev goxel-0.8.1/src/000077500000000000000000000000001334742672700134445ustar00rootroot00000000000000goxel-0.8.1/src/action.c000066400000000000000000000115611334742672700150710ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { UT_hash_handle hh; action_t action; } action_hash_item_t; // Global hash of all the actions. static action_hash_item_t *g_actions = NULL; void action_register(const action_t *action) { action_hash_item_t *item; item = calloc(1, sizeof(*item)); item->action = *action; assert(!*item->action.shortcut); if (item->action.default_shortcut) { assert(strlen(action->default_shortcut) < sizeof(action->shortcut)); strcpy(item->action.shortcut, item->action.default_shortcut); } HASH_ADD_KEYPTR(hh, g_actions, action->id, strlen(action->id), item); } action_t *action_get(const char *id) { action_hash_item_t *item; HASH_FIND_STR(g_actions, id, item); if (!item) LOG_W("Cannot find action %s", id); return item ? &item->action : NULL; } void actions_iter(int (*f)(action_t *action, void *user), void *user) { action_hash_item_t *item, *tmp; HASH_ITER(hh, g_actions, item, tmp) { if (f(&item->action, user)) return; } } // The default action function will try to call the action cfunc. static int default_function(const action_t *a, astack_t *s) { int i; void (*func)() = a->cfunc; assert(a->cfunc); assert(a->csig); // Fill any missing arguments with 0 values. for (i = stack_size(s); i < strlen(a->csig + 1); i++) { switch (a->csig[i + 1]) { case 'i': stack_push_i(s, 0); break; case 'p': stack_push_p(s, NULL); break; default: assert(false); } } if (strcmp(a->csig, "v") == 0) { func(); } else if (strcmp(a->csig, "vp") == 0) { func(stack_get_p(s, 0)); } else if (strcmp(a->csig, "vpp") == 0) { func(stack_get_p(s, 0), stack_get_p(s, 1)); } else if (strcmp(a->csig, "vpi") == 0) { func(stack_get_p(s, 0), stack_get_i(s, 1)); } else if (strcmp(a->csig, "vppp") == 0) { func(stack_get_p(s, 0), stack_get_p(s, 1), stack_get_p(s, 2)); } else if (strcmp(a->csig, "vppi") == 0) { func(stack_get_p(s, 0), stack_get_p(s, 1), stack_get_i(s, 2)); } else if (strcmp(a->csig, "vpii") == 0) { func(stack_get_p(s, 0), stack_get_i(s, 1), stack_get_i(s, 2)); } else { LOG_E("Cannot handle sig '%s'", a->csig); assert(false); } return 0; } int action_execv(const action_t *action, const char *sig, va_list ap) { assert(action); // So that we do not add undo snapshot when an action calls an other one. static int reentry = 0; char c; bool b; int i, nb; int (*func)(const action_t *a, astack_t *s); astack_t *s = stack_create(); func = action->func ?: default_function; if (reentry == 0 && (action->flags & ACTION_TOUCH_IMAGE)) { image_history_push(goxel.image); } reentry++; while ((c = *sig++)) { if (c == '>') break; switch (c) { case 'i': stack_push_i(s, va_arg(ap, int)); break; case 'b': stack_push_b(s, va_arg(ap, int)); break; case 'p': stack_push_p(s, va_arg(ap, void*)); break; default: assert(false); } } if ((action->flags & ACTION_TOGGLE) && (stack_size(s) == 0) && (!c)) { func(action, s); b = stack_get_b(s, 0); stack_clear(s); stack_push_b(s, !b); } func(action, s); // Get the return arguments. nb = c ? (int)strlen(sig) : 0; for (i = 0; i < nb; i++) { c = sig[i]; switch (c) { case 'i': *va_arg(ap, int*) = stack_get_i(s, -nb + i); break; case 'b': *va_arg(ap, bool*) = stack_get_b(s, -nb + i); break; case 'p': *va_arg(ap, void**) = stack_get_p(s, -nb + i); break; default: assert(false); } } reentry--; if (reentry == 0 && (action->flags & ACTION_TOUCH_IMAGE)) { goxel_update_meshes(-1); } stack_delete(s); return 0; } int action_exec(const action_t *action, const char *sig, ...) { va_list ap; int ret; va_start(ap, sig); ret = action_execv(action, sig, ap); va_end(ap); return ret; } goxel-0.8.1/src/assets.c000066400000000000000000000037331334742672700151200ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { const char *path; int size; const void *data __attribute__((aligned(4))); } asset_t; static asset_t ASSETS[]; // Defined in assets.inl const void *assets_get(const char *url, int *size) { int i; if (str_startswith(url, "asset://")) url += 8; // Skip asset:// for (i = 0; ASSETS[i].path; i++) { if (str_equ(ASSETS[i].path, url)) { if (size) *size = ASSETS[i].size; return ASSETS[i].data; } } return NULL; } int assets_list(const char *url, void *user, int (*f)(int i, const char *path, void *user)) { int i, j = 0; for (i = 0; ASSETS[i].path; i++) { if (str_startswith(ASSETS[i].path, url)) { if (!f || f(j, ASSETS[i].path, user) == 0) j++; } } return j; } static asset_t ASSETS[] = { #include "assets/fonts.inl" #include "assets/icons.inl" #include "assets/images.inl" #include "assets/other.inl" #include "assets/palettes.inl" #include "assets/progs.inl" #include "assets/shaders.inl" #include "assets/sounds.inl" #include "assets/themes.inl" #ifdef ASSETS_EXTRA # include ASSETS_EXTRA // Allow to add custom assets at build time. #endif {}, // NULL asset at the end of the list. }; goxel-0.8.1/src/assets/000077500000000000000000000000001334742672700147465ustar00rootroot00000000000000goxel-0.8.1/src/assets/fonts.inl000066400000000000000000004351531334742672700166160ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/fonts/DejaVuSans-light.ttf", .size = 48104, .data = (const uint8_t[]){ 0,1,0,0,0,19,1,0,0,4,0,48,70,70,84,77,111,57,158,184,0,0,185,60,0,0,0, 28,71,68,69,70,0,151,0,38,0,0,142,160,0,0,0,40,71,80,79,83,145,118,235, 121,0,0,148,108,0,0,36,208,71,83,85,66,151,144,198,116,0,0,142,200,0,0, 5,164,77,65,84,72,166,169,146,240,0,0,185,88,0,0,2,144,79,83,47,50,89, 44,155,253,0,0,1,184,0,0,0,86,99,109,97,112,12,114,85,31,0,0,3,176,0,0, 1,170,99,118,116,32,5,122,29,125,0,0,11,112,0,0,2,2,102,112,103,109,113, 52,118,106,0,0,5,92,0,0,0,171,103,97,115,112,0,7,0,7,0,0,142,148,0,0,0, 12,103,108,121,102,63,60,141,82,0,0,14,72,0,0,66,24,104,101,97,100,17, 72,124,3,0,0,1,60,0,0,0,54,104,104,101,97,14,172,6,91,0,0,1,116,0,0,0, 36,104,109,116,120,246,246,53,200,0,0,2,16,0,0,1,160,108,111,99,97,90, 113,71,168,0,0,13,116,0,0,0,210,109,97,120,112,4,155,2,211,0,0,1,152,0, 0,0,32,110,97,109,101,31,109,77,161,0,0,80,96,0,0,61,8,112,111,115,116, 243,247,1,96,0,0,141,104,0,0,1,41,112,114,101,112,59,7,241,0,0,0,6,8,0, 0,5,104,0,1,0,0,0,2,89,153,91,114,106,154,95,15,60,245,0,31,8,0,0,0,0, 0,213,107,236,158,0,0,0,0,213,107,236,158,255,150,254,29,7,166,6,20,0, 0,0,8,0,2,0,0,0,0,0,0,0,1,0,0,7,109,254,29,0,0,8,0,255,150,255,213,7,166, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,0,1,0,0,0,104,0,77,0,5,0,0,0,0,0, 2,0,16,0,153,0,8,0,0,4,21,1,235,0,0,0,0,0,1,4,14,1,144,0,5,0,0,5,51,5, 153,0,0,1,30,5,51,5,153,0,0,3,215,0,102,2,18,0,0,2,11,6,3,3,8,4,2,2,4, 231,0,110,255,210,0,253,255,10,36,96,41,4,0,32,12,80,102,69,100,0,64,0, 32,37,207,6,20,254,20,1,154,7,109,1,227,96,0,1,255,223,255,0,0,0,0,2,236, 0,68,0,0,0,0,2,170,0,0,2,139,0,0,3,53,1,53,3,174,0,197,6,180,0,158,5,23, 0,170,7,154,0,113,6,61,0,129,2,51,0,197,3,31,0,176,3,31,0,164,4,0,0,61, 6,180,0,217,2,139,0,158,2,227,0,100,2,139,0,219,2,178,0,0,5,23,0,135,5, 23,0,225,5,23,0,150,5,23,0,156,5,23,0,100,5,23,0,158,5,23,0,143,5,23,0, 168,5,23,0,139,5,23,0,129,2,178,0,240,6,180,0,217,6,180,0,217,6,180,0, 217,4,63,0,147,8,0,0,135,5,121,0,16,5,125,0,201,5,150,0,115,6,41,0,201, 5,14,0,201,4,154,0,201,6,51,0,115,6,4,0,201,2,92,0,201,2,92,255,150,5, 63,0,201,4,117,0,201,6,231,0,201,5,252,0,201,6,76,0,115,4,211,0,201,6, 76,0,115,5,143,0,201,5,20,0,135,4,227,255,250,5,219,0,178,5,121,0,16,7, 233,0,68,5,123,0,61,4,227,255,252,5,123,0,92,3,31,0,176,3,31,0,199,6,180, 0,217,4,0,255,236,4,231,0,123,5,20,0,186,4,102,0,113,5,20,0,113,4,236, 0,113,2,209,0,47,5,20,0,113,5,18,0,186,2,57,0,193,2,57,255,219,4,162,0, 186,2,57,0,193,7,203,0,186,5,18,0,186,4,229,0,113,5,20,0,186,5,20,0,113, 3,74,0,186,4,43,0,111,3,35,0,55,5,18,0,174,4,188,0,61,6,139,0,86,4,188, 0,59,4,188,0,61,4,51,0,88,5,23,1,0,5,23,1,0,8,0,1,27,4,0,0,213,4,0,0,195, 6,180,0,217,6,39,0,6,4,4,0,6,6,39,0,6,6,39,0,6,4,4,0,6,6,39,0,6,6,251, 0,112,0,0,0,3,0,0,0,3,0,0,0,28,0,1,0,0,0,0,0,164,0,3,0,1,0,0,0,28,0,4, 0,136,0,0,0,30,0,16,0,3,0,14,0,58,0,91,0,95,0,123,0,125,0,169,0,177,37, 178,37,180,37,182,37,188,37,190,37,192,37,207,255,255,0,0,0,32,0,60,0, 93,0,97,0,125,0,169,0,175,37,178,37,180,37,182,37,188,37,190,37,192,37, 207,255,255,255,227,255,226,255,225,255,224,255,223,255,180,255,175,218, 175,218,174,218,173,218,168,218,167,218,166,218,152,0,1,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,6,0,0,1,0,0,0,0,0, 0,0,1,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,4,5,6,7,8,9,10,11, 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,30,31,32,33,34, 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58, 59,60,61,0,62,63,64,0,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80, 81,82,83,84,85,86,87,88,89,90,91,0,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0,0,0,0,0,0,93,0,0,0,0,0,0, 0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,94,0,0,0,0,0,0,0,0,0,183,7,6,5,4,3,2,1,0,44,32,16,176,2,37,73,100, 176,64,81,88,32,200,89,33,45,44,176,2,37,73,100,176,64,81,88,32,200,89, 33,45,44,32,16,7,32,176,0,80,176,13,121,32,184,255,255,80,88,4,27,5,89, 176,5,28,176,3,37,8,176,4,37,35,225,32,176,0,80,176,13,121,32,184,255, 255,80,88,4,27,5,89,176,5,28,176,3,37,8,225,45,44,75,80,88,32,176,253, 69,68,89,33,45,44,176,2,37,69,96,68,45,44,75,83,88,176,2,37,176,2,37,69, 68,89,33,33,45,44,69,68,45,44,176,2,37,176,2,37,73,176,5,37,176,5,37,73, 96,176,32,99,104,32,138,16,138,35,58,138,16,101,58,45,0,184,2,128,64,255, 251,254,3,250,20,3,249,37,3,248,50,3,247,150,3,246,14,3,245,254,3,244, 254,3,243,37,3,242,14,3,241,150,3,240,37,3,239,138,65,5,239,254,3,238, 150,3,237,150,3,236,250,3,235,250,3,234,254,3,233,58,3,232,66,3,231,254, 3,230,50,3,229,228,83,5,229,150,3,228,138,65,5,228,83,3,227,226,47,5,227, 250,3,226,47,3,225,254,3,224,254,3,223,50,3,222,20,3,221,150,3,220,254, 3,219,18,3,218,125,3,217,187,3,216,254,3,214,138,65,5,214,125,3,213,212, 71,5,213,125,3,212,71,3,211,210,27,5,211,254,3,210,27,3,209,254,3,208, 254,3,207,254,3,206,254,3,205,150,3,204,203,30,5,204,254,3,203,30,3,202, 50,3,201,254,3,198,133,17,5,198,28,3,197,22,3,196,254,3,195,254,3,194, 254,3,193,254,3,192,254,3,191,254,3,190,254,3,189,254,3,188,254,3,187, 254,3,186,17,3,185,134,37,5,185,254,3,184,183,187,5,184,254,3,183,182, 93,5,183,187,3,183,128,4,182,181,37,5,182,93,64,255,3,182,64,4,181,37, 3,180,254,3,179,150,3,178,254,3,177,254,3,176,254,3,175,254,3,174,100, 3,173,14,3,172,171,37,5,172,100,3,171,170,18,5,171,37,3,170,18,3,169,138, 65,5,169,250,3,168,254,3,167,254,3,166,254,3,165,18,3,164,254,3,163,162, 14,5,163,50,3,162,14,3,161,100,3,160,138,65,5,160,150,3,159,254,3,158, 157,12,5,158,254,3,157,12,3,156,155,25,5,156,100,3,155,154,16,5,155,25, 3,154,16,3,153,10,3,152,254,3,151,150,13,5,151,254,3,150,13,3,149,138, 65,5,149,150,3,148,147,14,5,148,40,3,147,14,3,146,250,3,145,144,187,5, 145,254,3,144,143,93,5,144,187,3,144,128,4,143,142,37,5,143,93,3,143,64, 4,142,37,3,141,254,3,140,139,46,5,140,254,3,139,46,3,138,134,37,5,138, 65,3,137,136,11,5,137,20,3,136,11,3,135,134,37,5,135,100,3,134,133,17, 5,134,37,3,133,17,3,132,254,3,131,130,17,5,131,254,3,130,17,3,129,254, 3,128,254,3,127,254,3,64,255,126,125,125,5,126,254,3,125,125,3,124,100, 3,123,84,21,5,123,37,3,122,254,3,121,254,3,120,14,3,119,12,3,118,10,3, 117,254,3,116,250,3,115,250,3,114,250,3,113,250,3,112,254,3,111,254,3, 110,254,3,108,33,3,107,254,3,106,17,66,5,106,83,3,105,254,3,104,125,3, 103,17,66,5,102,254,3,101,254,3,100,254,3,99,254,3,98,254,3,97,58,3,96, 250,3,94,12,3,93,254,3,91,254,3,90,254,3,89,88,10,5,89,250,3,88,10,3,87, 22,25,5,87,50,3,86,254,3,85,84,21,5,85,66,3,84,21,3,83,1,16,5,83,24,3, 82,20,3,81,74,19,5,81,254,3,80,11,3,79,254,3,78,77,16,5,78,254,3,77,16, 3,76,254,3,75,74,19,5,75,254,3,74,73,16,5,74,19,3,73,29,13,5,73,16,3,72, 13,3,71,254,3,70,150,3,69,150,3,68,254,3,67,2,45,5,67,250,3,66,187,3,65, 75,3,64,254,3,63,254,3,62,61,18,5,62,20,3,61,60,15,5,61,18,3,60,59,13, 5,60,64,255,15,3,59,13,3,58,254,3,57,254,3,56,55,20,5,56,250,3,55,54,16, 5,55,20,3,54,53,11,5,54,16,3,53,11,3,52,30,3,51,13,3,50,49,11,5,50,254, 3,49,11,3,48,47,11,5,48,13,3,47,11,3,46,45,9,5,46,16,3,45,9,3,44,50,3, 43,42,37,5,43,100,3,42,41,18,5,42,37,3,41,18,3,40,39,37,5,40,65,3,39,37, 3,38,37,11,5,38,15,3,37,11,3,36,254,3,35,254,3,34,15,3,33,1,16,5,33,18, 3,32,100,3,31,250,3,30,29,13,5,30,100,3,29,13,3,28,17,66,5,28,254,3,27, 250,3,26,66,3,25,17,66,5,25,254,3,24,100,3,23,22,25,5,23,254,3,22,1,16, 5,22,25,3,21,254,3,20,254,3,19,254,3,18,17,66,5,18,254,3,17,2,45,5,17, 66,3,16,125,3,15,100,3,14,254,3,13,12,22,5,13,254,3,12,1,16,5,12,22,3, 11,254,3,10,16,3,9,254,3,8,2,45,5,8,254,3,7,20,3,6,100,3,4,1,16,5,4,254, 3,64,21,3,2,45,5,3,254,3,2,1,16,5,2,45,3,1,16,3,0,254,3,1,184,1,100,133, 141,1,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,0, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 43,43,43,43,43,43,43,43,43,43,43,43,43,29,1,53,0,184,0,203,0,203,0,193, 0,170,0,156,1,166,0,184,0,102,0,0,0,113,0,203,0,160,2,178,0,133,0,117, 0,184,0,195,1,203,1,137,2,45,0,203,0,166,0,240,0,211,0,170,0,135,0,203, 3,170,4,0,1,74,0,51,0,203,0,0,0,217,5,2,0,244,1,84,0,180,0,156,1,57,1, 20,1,57,7,6,4,0,4,78,4,180,4,82,4,184,4,231,4,205,0,55,4,115,4,205,4,96, 4,115,1,51,3,162,5,86,5,166,5,86,5,57,3,197,2,18,0,201,0,31,0,184,1,223, 0,115,0,186,3,233,3,51,3,188,4,68,4,14,0,223,3,205,3,170,0,229,3,170,4, 4,0,0,0,203,0,143,0,164,0,123,0,184,0,20,1,111,0,127,2,123,2,82,0,143, 0,199,5,205,0,154,0,154,0,111,0,203,0,205,1,158,1,211,0,240,0,186,1,131, 0,213,0,152,3,4,2,72,0,158,1,213,0,193,0,203,0,246,0,131,3,84,2,127,0, 0,3,51,2,102,0,211,0,199,0,164,0,205,0,143,0,154,0,115,4,0,5,213,1,10, 0,254,2,43,0,164,0,180,0,156,0,0,0,98,0,156,0,0,0,29,3,45,5,213,5,213, 5,213,5,240,0,127,0,123,0,84,0,164,6,184,6,20,7,35,1,211,0,184,0,203,0, 166,1,195,1,236,6,147,0,160,0,211,3,92,3,113,3,219,1,133,4,35,4,168,4, 72,0,143,1,57,1,20,1,57,3,96,0,143,5,213,1,154,6,20,7,35,6,102,1,121,4, 96,4,96,4,96,4,123,0,156,0,0,2,119,4,96,1,170,0,233,4,96,7,98,0,123,0, 197,0,127,2,123,0,0,0,180,2,82,5,205,0,102,0,188,0,102,0,119,6,16,0,205, 1,59,1,133,3,137,0,143,0,123,0,0,0,29,0,205,7,74,4,47,0,156,0,156,0,0, 7,125,0,111,0,0,0,111,3,53,0,106,0,111,0,123,0,174,0,178,0,45,3,150,0, 143,2,123,0,246,0,131,3,84,6,55,5,246,0,143,0,156,4,225,2,102,0,143,1, 141,2,246,0,205,3,68,0,41,0,102,4,238,0,115,0,0,20,0,0,150,0,68,5,17,0, 0,0,0,0,44,0,44,0,44,0,44,0,94,0,148,1,0,1,172,2,64,3,116,3,158,3,214, 4,2,4,80,4,122,4,150,4,172,4,192,4,230,5,40,5,96,5,224,6,84,6,178,7,18, 7,126,7,196,8,46,8,152,8,184,8,244,9,22,9,82,9,190,10,126,10,252,11,84, 11,160,11,224,12,16,12,58,12,142,12,188,12,224,13,24,13,172,13,206,14, 76,14,160,14,230,15,38,15,140,16,22,16,146,16,202,17,12,17,124,18,90,18, 172,19,14,19,110,19,158,19,200,19,234,20,0,20,150,20,226,21,46,21,122, 21,228,22,48,22,148,22,208,22,248,23,54,23,174,23,204,24,46,24,106,24, 188,25,12,25,92,25,148,26,68,26,130,26,196,27,86,28,104,29,42,30,16,30, 118,30,228,31,90,31,236,32,18,32,78,32,134,32,148,32,162,32,176,32,190, 32,204,32,218,33,12,0,0,0,2,0,68,0,0,2,100,5,85,0,3,0,7,0,46,177,1,0,47, 60,178,7,4,255,237,50,177,6,5,220,60,178,3,2,255,237,50,0,177,3,0,47,60, 178,5,4,255,237,50,178,7,6,0,252,60,178,1,2,255,237,50,51,17,33,17,37, 33,17,33,68,2,32,254,36,1,152,254,104,5,85,250,171,68,4,205,0,0,0,2,1, 53,0,0,2,0,5,213,0,3,0,9,0,53,64,15,7,0,131,4,129,2,8,7,5,1,3,4,0,0,10, 16,252,75,176,11,84,88,185,0,0,255,192,56,89,60,236,50,57,57,49,0,47,228, 252,204,48,1,182,0,11,32,11,80,11,3,93,37,51,21,35,17,51,17,3,35,3,1,53, 203,203,203,20,162,21,254,254,5,213,253,113,254,155,1,101,0,0,0,0,2,0, 197,3,170,2,233,5,213,0,3,0,7,0,66,64,15,5,1,132,4,0,129,8,4,5,6,0,5,2, 4,8,16,252,75,176,18,84,75,176,19,84,91,88,185,0,2,255,192,56,89,252,220, 236,49,0,16,244,60,236,50,48,1,64,15,48,9,64,9,80,9,96,9,112,9,160,9,191, 9,7,93,1,17,35,17,33,17,35,17,1,111,170,2,36,170,5,213,253,213,2,43,253, 213,2,43,0,0,0,2,0,158,0,0,6,23,5,190,0,3,0,31,0,96,64,49,27,11,0,135, 7,4,29,9,5,25,13,2,135,23,19,15,21,17,31,30,28,27,26,23,22,21,20,19,18, 17,16,14,13,12,9,8,7,6,5,4,3,2,1,0,26,10,24,6,32,16,252,204,23,57,49,0, 47,60,212,60,60,252,60,60,212,60,60,196,50,236,50,50,48,64,17,11,1,11, 2,11,12,11,13,20,4,26,17,26,18,20,31,8,1,93,1,33,3,33,11,1,33,19,51,3, 33,21,33,3,33,21,33,3,35,19,33,3,35,19,33,53,33,19,33,53,33,19,4,23,254, 221,84,1,37,68,104,1,36,105,160,103,1,56,254,161,82,1,62,254,155,104,160, 103,254,219,103,161,104,254,197,1,96,84,254,190,1,105,102,3,133,254,178, 3,135,254,97,1,159,254,97,154,254,178,153,254,98,1,158,254,98,1,158,153, 1,78,154,1,159,0,0,3,0,170,254,211,4,109,6,20,0,33,0,40,0,47,0,189,64, 85,34,2,10,11,10,39,1,38,40,2,11,11,10,29,1,30,28,2,47,41,47,27,2,41,41, 47,66,19,17,16,34,10,27,41,4,23,6,9,42,33,5,2,23,134,22,6,134,5,17,35, 26,138,22,137,16,0,42,138,5,137,2,45,8,22,10,30,7,41,26,18,3,0,9,34,16, 9,3,1,7,38,8,13,5,6,48,16,252,75,176,9,84,88,185,0,5,255,192,56,89,75, 176,12,84,75,176,16,84,91,75,176,15,84,91,88,185,0,5,0,64,56,89,60,236, 244,23,60,252,23,60,244,228,236,49,0,47,228,236,196,212,228,236,50,196, 16,238,16,238,17,18,57,17,57,17,18,23,57,17,18,57,48,75,83,88,7,16,4,237, 7,16,14,237,17,23,57,7,16,14,237,17,23,57,7,16,4,237,89,34,1,35,3,46,1, 39,53,30,1,23,17,46,1,53,52,54,55,53,51,21,30,1,23,21,46,1,39,17,30,1, 21,20,6,7,3,17,14,1,21,20,22,23,17,62,1,53,52,38,2,180,100,1,105,210,106, 102,209,111,221,201,218,204,100,93,174,83,83,175,92,227,214,227,214,100, 116,122,113,225,127,129,123,254,211,1,45,2,45,45,180,64,65,1,1,200,36, 172,150,163,188,14,235,232,4,31,27,175,42,46,4,254,85,35,180,156,169,195, 15,3,0,1,154,13,106,88,86,96,213,254,79,17,110,90,88,104,0,0,0,0,5,0,113, 255,227,7,41,5,240,0,11,0,23,0,35,0,39,0,51,0,137,64,54,36,15,37,38,37, 38,15,39,36,39,66,0,146,12,30,146,46,141,24,146,36,6,146,12,141,38,18, 140,40,36,145,52,39,33,27,37,9,3,13,21,14,9,13,15,33,13,43,14,27,13,15, 49,11,52,16,252,75,176,9,84,75,176,11,84,91,75,176,12,84,91,75,176,20, 84,91,75,176,14,84,91,75,176,13,84,91,88,185,0,49,255,192,56,89,196,236, 244,236,16,238,246,238,17,57,17,18,57,49,0,16,228,50,244,60,228,236,16, 238,246,238,16,238,48,75,83,88,7,16,5,237,7,16,5,237,89,34,1,34,6,21,20, 22,51,50,54,53,52,38,39,50,22,21,20,6,35,34,38,53,52,54,1,34,6,21,20,22, 51,50,54,53,52,38,37,51,1,35,19,50,22,21,20,6,35,34,38,53,52,54,5,209, 87,99,99,87,85,99,99,85,158,186,187,157,160,186,187,252,151,86,99,98,87, 87,99,100,3,49,160,252,90,160,31,158,188,187,159,159,185,186,2,145,148, 132,130,149,149,130,131,149,127,220,187,187,219,219,187,188,219,2,97,149, 130,132,148,148,132,129,150,127,249,243,6,13,219,187,189,218,219,188,186, 220,0,0,0,0,2,0,129,255,227,5,254,5,240,0,9,0,48,1,205,64,150,13,1,14, 12,134,17,18,17,11,134,10,11,18,18,17,9,134,0,9,21,22,21,7,1,6,8,134,22, 22,21,2,1,3,1,134,29,30,29,0,134,9,0,30,30,29,32,31,2,33,30,17,10,19,10, 23,22,21,3,24,20,17,19,10,7,8,2,6,9,17,19,19,10,2,1,2,3,0,17,10,19,10, 23,22,2,24,21,17,19,10,20,17,19,19,10,66,18,11,9,3,6,0,10,30,3,40,21,14, 6,40,39,6,149,24,43,149,39,148,36,145,24,140,14,19,10,46,11,14,9,0,46, 18,21,39,14,30,3,46,18,39,33,14,17,15,19,33,3,18,27,16,49,16,252,236,196, 212,212,236,16,198,238,17,57,17,18,57,57,17,57,57,17,57,17,57,49,0,47, 198,228,246,230,238,16,238,16,198,17,18,57,17,23,57,17,23,57,48,75,83, 88,7,16,5,237,7,5,237,17,23,57,7,16,5,237,17,23,57,7,16,5,237,17,23,57, 7,5,237,17,23,57,7,16,5,237,17,23,57,7,16,8,237,7,16,14,237,17,23,57,7, 16,14,237,17,23,57,7,16,8,237,7,16,8,237,7,16,14,237,17,23,57,89,34,178, 15,50,1,1,93,64,178,7,11,5,34,9,41,28,0,28,1,31,2,23,11,42,0,42,1,38,18, 58,0,52,18,68,11,94,0,89,1,90,10,85,18,90,26,90,31,89,48,103,30,123,0, 155,0,154,1,153,2,151,8,149,11,147,21,149,22,149,34,153,45,31,9,11,9,12, 8,17,12,39,12,40,24,2,27,9,25,11,25,12,25,17,28,20,28,21,22,29,31,50,39, 0,39,1,41,9,35,18,42,19,42,20,40,21,47,50,59,9,52,18,57,19,63,50,74,9, 76,20,75,21,70,25,79,50,86,1,90,9,89,12,85,18,89,19,92,31,95,50,106,12, 105,17,96,50,117,1,121,12,122,17,147,0,147,1,151,2,149,5,156,7,156,8,159, 8,154,9,155,11,154,12,144,50,160,50,176,50,57,93,0,93,1,14,1,21,20,22, 51,50,54,55,9,1,62,1,55,51,6,2,7,1,35,39,14,1,35,34,0,53,52,54,55,46,1, 53,52,54,51,50,22,23,21,46,1,35,34,6,21,20,22,1,242,91,85,212,160,95,166, 73,254,123,1,252,59,66,6,186,12,104,93,1,23,252,143,104,228,131,241,254, 206,134,134,48,50,222,184,83,165,85,87,158,68,105,131,59,3,35,81,161,88, 146,194,63,64,2,143,253,248,89,203,114,132,254,254,126,254,227,147,89, 87,1,19,215,128,225,99,63,125,60,162,197,36,36,182,47,49,111,88,51,103, 0,1,0,197,3,170,1,111,5,213,0,3,0,55,64,10,1,132,0,129,4,0,5,2,4,4,16, 252,75,176,18,84,75,176,19,84,91,88,185,0,2,255,192,56,89,236,49,0,16, 244,236,48,1,64,13,64,5,80,5,96,5,112,5,144,5,160,5,6,93,1,17,35,17,1, 111,170,5,213,253,213,2,43,0,0,0,1,0,176,254,242,2,123,6,18,0,13,0,55, 64,15,6,152,0,151,14,13,7,0,3,18,6,0,19,10,14,16,220,75,176,19,84,88,185, 0,10,255,192,56,89,75,176,15,84,88,185,0,10,0,64,56,89,228,50,236,17,57, 57,49,0,16,252,236,48,1,6,2,21,20,18,23,35,38,2,53,52,18,55,2,123,134, 130,131,133,160,150,149,148,151,6,18,230,254,62,231,231,254,59,229,235, 1,198,224,223,1,196,236,0,1,0,164,254,242,2,111,6,18,0,13,0,31,64,15,7, 152,0,151,14,7,1,0,11,18,4,19,8,0,14,16,220,60,244,236,17,57,57,49,0,16, 252,236,48,19,51,22,18,21,20,2,7,35,54,18,53,52,2,164,160,150,149,149, 150,160,133,131,131,6,18,236,254,60,223,224,254,58,235,229,1,197,231,231, 1,194,0,0,0,1,0,61,2,74,3,195,5,240,0,17,0,78,64,44,16,13,11,0,4,12,9, 7,4,2,4,8,3,153,5,17,12,153,10,1,14,145,18,8,12,10,3,9,6,17,3,1,3,2,0, 20,15,4,11,9,20,13,6,18,16,212,60,228,50,220,60,228,50,23,57,17,18,23, 57,49,0,16,244,212,60,236,50,196,236,50,23,57,18,23,57,48,1,13,1,7,37, 17,35,17,5,39,45,1,55,5,17,51,17,37,3,195,254,153,1,103,58,254,176,114, 254,176,58,1,103,254,153,58,1,80,114,1,80,4,223,194,195,98,203,254,135, 1,121,203,98,195,194,99,203,1,121,254,135,203,0,0,0,1,0,217,0,0,5,219, 5,4,0,11,0,35,64,17,0,9,1,156,7,3,5,2,21,4,0,23,10,6,21,8,12,16,220,252, 60,252,60,236,49,0,47,212,60,252,60,196,48,1,17,33,21,33,17,35,17,33,53, 33,17,3,174,2,45,253,211,168,253,211,2,45,5,4,253,211,170,253,211,2,45, 170,2,45,0,1,0,158,255,18,1,195,0,254,0,5,0,25,64,12,3,158,0,131,6,3,4, 1,25,0,24,6,16,252,236,212,204,49,0,16,252,236,48,55,51,21,3,35,19,240, 211,164,129,82,254,172,254,192,1,64,0,1,0,100,1,223,2,127,2,131,0,3,0, 17,182,0,156,2,4,1,0,4,16,220,204,49,0,16,212,236,48,19,33,21,33,100,2, 27,253,229,2,131,164,0,0,1,0,219,0,0,1,174,0,254,0,3,0,17,183,0,131,2, 1,25,0,24,4,16,252,236,49,0,47,236,48,55,51,21,35,219,211,211,254,254, 0,1,0,0,255,66,2,178,5,213,0,3,0,45,64,20,0,26,1,2,1,2,26,3,0,3,66,2,159, 0,129,4,2,0,1,3,47,196,57,57,49,0,16,244,236,48,75,83,88,7,16,5,237,7, 16,5,237,89,34,1,51,1,35,2,8,170,253,248,170,5,213,249,109,0,0,0,0,2,0, 135,255,227,4,143,5,240,0,11,0,23,0,35,64,19,6,160,18,0,160,12,145,18, 140,24,9,28,15,30,3,28,21,27,24,16,252,236,244,236,49,0,16,228,244,236, 16,238,48,1,34,2,17,16,18,51,50,18,17,16,2,39,50,0,17,16,0,35,34,0,17, 16,0,2,139,156,157,157,156,157,157,157,157,251,1,9,254,247,251,251,254, 247,1,9,5,80,254,205,254,204,254,205,254,205,1,51,1,51,1,52,1,51,160,254, 115,254,134,254,135,254,115,1,141,1,121,1,122,1,141,0,0,1,0,225,0,0,4, 90,5,213,0,10,0,64,64,21,66,3,160,4,2,160,5,129,7,0,160,9,8,31,6,28,3, 0,31,1,11,16,212,75,176,15,84,88,185,0,1,0,64,56,89,236,196,252,236,49, 0,47,236,50,244,236,212,236,48,75,83,88,89,34,1,180,15,3,15,4,2,93,55, 33,17,5,53,37,51,17,33,21,33,254,1,74,254,153,1,101,202,1,74,252,164,170, 4,115,72,184,72,250,213,170,0,0,0,1,0,150,0,0,4,74,5,240,0,28,0,158,64, 39,25,26,27,3,24,28,17,5,4,0,17,5,5,4,66,16,161,17,148,13,160,20,145,4, 0,160,2,0,16,10,2,1,10,28,23,16,3,6,29,16,252,75,176,21,84,75,176,22,84, 91,75,176,20,84,91,88,185,0,3,255,192,56,89,196,212,236,192,192,17,18, 57,49,0,47,236,50,244,236,244,236,48,75,83,88,7,16,5,237,7,5,237,1,176, 28,16,17,23,57,89,34,1,64,50,85,4,86,5,86,7,122,4,122,5,118,27,135,25, 7,4,0,4,25,4,26,4,27,5,28,116,0,118,6,117,26,115,27,116,28,130,0,134,25, 130,26,130,27,130,28,168,0,168,27,17,93,0,93,37,33,21,33,53,54,0,55,62, 1,53,52,38,35,34,6,7,53,62,1,51,50,4,21,20,6,7,6,0,1,137,2,193,252,76, 115,1,141,51,97,77,167,134,95,211,120,122,212,88,232,1,20,69,91,25,254, 244,170,170,170,119,1,145,58,109,151,73,119,150,66,67,204,49,50,232,194, 92,165,112,29,254,235,0,0,0,1,0,156,255,227,4,115,5,240,0,40,0,112,64, 46,0,21,19,10,134,9,31,134,32,19,160,21,13,160,9,147,6,28,160,32,147,35, 145,6,140,21,163,41,22,28,19,0,3,20,25,28,38,32,16,28,3,20,31,9,6,41,16, 252,75,176,22,84,75,176,20,84,91,88,185,0,9,255,192,56,89,196,196,212, 236,244,236,17,23,57,57,49,0,16,236,228,244,228,236,16,230,238,16,238, 16,238,16,238,17,18,57,48,1,64,9,100,30,97,31,97,32,100,33,4,0,93,1,30, 1,21,20,4,33,34,38,39,53,30,1,51,50,54,53,52,38,43,1,53,51,50,54,53,52, 38,35,34,6,7,53,62,1,51,50,4,21,20,6,3,63,145,163,254,208,254,232,94,199, 106,84,200,109,190,199,185,165,174,182,149,158,163,152,83,190,114,115, 201,89,230,1,12,142,3,37,31,196,144,221,242,37,37,195,49,50,150,143,132, 149,166,119,112,115,123,36,38,180,32,32,209,178,124,171,0,0,2,0,100,0, 0,4,164,5,213,0,2,0,13,0,129,64,29,1,13,3,13,0,3,3,13,66,0,3,11,7,160, 5,1,3,129,9,1,12,10,0,28,6,8,4,12,14,16,220,75,176,11,84,75,176,13,84, 91,88,185,0,12,255,192,56,89,212,60,196,236,50,17,57,49,0,47,228,212,60, 236,50,18,57,48,75,83,88,7,16,4,201,7,16,5,201,89,34,1,64,42,11,0,42,0, 72,0,89,0,105,0,119,0,138,0,7,22,1,43,0,38,1,43,3,54,1,78,1,79,12,79,13, 86,1,102,1,117,1,122,3,133,1,13,93,0,93,9,1,33,3,51,17,51,21,35,17,35, 17,33,53,3,6,254,2,1,254,53,254,213,213,201,253,94,5,37,252,227,3,205, 252,51,168,254,160,1,96,195,0,0,0,1,0,158,255,227,4,100,5,213,0,29,0,94, 64,35,4,26,7,17,134,16,29,26,160,7,20,160,16,137,13,2,160,0,129,13,140, 7,164,30,23,28,1,10,3,28,0,10,16,6,30,16,252,1,75,176,22,84,75,176,20, 84,91,88,185,0,16,255,192,56,89,75,176,15,84,88,185,0,16,0,64,56,89,196, 212,236,16,196,238,49,0,16,228,228,244,236,16,230,238,16,254,196,16,238, 17,18,57,48,19,33,21,33,17,62,1,51,50,0,21,20,0,33,34,38,39,53,30,1,51, 50,54,53,52,38,35,34,6,7,221,3,25,253,160,44,88,44,250,1,36,254,212,254, 239,94,195,104,90,192,107,173,202,202,173,81,161,84,5,213,170,254,146, 15,15,254,238,234,241,254,245,32,32,203,49,48,182,156,156,182,36,38,0, 0,0,2,0,143,255,227,4,150,5,240,0,11,0,36,0,88,64,36,19,6,0,13,134,12, 0,160,22,6,160,28,22,165,16,160,12,137,34,145,28,140,37,12,34,9,28,25, 30,19,28,3,33,31,27,37,16,252,236,236,244,236,228,49,0,16,228,244,228, 252,228,16,238,16,238,16,238,17,18,57,48,64,20,203,0,203,1,205,2,205,3, 205,4,203,5,203,6,7,164,30,178,30,2,93,1,93,1,34,6,21,20,22,51,50,54,53, 52,38,1,21,46,1,35,34,2,3,62,1,51,50,0,21,20,0,35,32,0,17,16,0,33,50,22, 2,164,136,159,159,136,136,159,159,1,9,76,155,76,200,211,15,59,178,107, 225,1,5,254,240,226,254,253,254,238,1,80,1,27,76,155,3,59,186,162,161, 187,187,161,162,186,2,121,184,36,38,254,242,254,239,87,93,254,239,235, 230,254,234,1,141,1,121,1,98,1,165,30,0,0,0,0,1,0,168,0,0,4,104,5,213, 0,6,0,99,64,24,5,17,2,3,2,3,17,4,5,4,66,5,160,0,129,3,5,3,1,4,1,0,6,7, 16,252,204,196,17,57,57,49,0,47,244,236,48,75,83,88,7,16,5,237,7,16,5, 237,89,34,1,75,176,22,84,88,189,0,7,0,64,0,1,0,7,0,7,255,192,56,17,55, 56,89,64,18,88,2,1,6,3,26,5,57,5,72,5,103,3,176,0,176,6,7,93,0,93,19,33, 21,1,35,1,33,168,3,192,253,226,211,1,254,253,51,5,213,86,250,129,5,43, 0,0,0,0,3,0,139,255,227,4,139,5,240,0,11,0,35,0,47,0,67,64,37,24,12,0, 160,39,6,160,30,45,160,18,145,30,140,39,163,48,24,12,36,42,28,21,36,28, 15,9,28,21,27,30,3,28,15,33,27,48,16,252,196,236,244,196,236,16,238,16, 238,17,57,57,49,0,16,236,228,244,236,16,238,16,238,57,57,48,1,34,6,21, 20,22,51,50,54,53,52,38,37,46,1,53,52,36,51,50,22,21,20,6,7,30,1,21,20, 4,35,34,36,53,52,54,19,20,22,51,50,54,53,52,38,35,34,6,2,139,144,165,165, 144,144,166,165,254,165,130,145,0,255,222,223,254,145,129,146,163,254, 247,247,247,254,247,164,72,145,131,130,147,147,130,131,145,2,197,154,135, 135,154,155,134,135,154,86,32,178,128,179,208,208,179,128,178,32,34,198, 143,217,232,232,217,143,198,1,97,116,130,130,116,116,130,130,0,0,0,2,0, 129,255,227,4,135,5,240,0,24,0,36,0,88,64,35,7,31,25,1,134,0,25,160,10, 165,4,160,0,137,22,31,160,16,145,22,140,37,7,28,28,33,19,30,0,34,34,28, 13,27,37,16,252,236,228,244,236,236,49,0,16,228,244,236,16,230,254,245, 238,16,238,17,18,57,48,64,22,196,25,194,26,192,27,192,28,192,29,194,30, 196,31,7,170,18,188,18,233,18,3,93,1,93,55,53,30,1,51,50,18,19,14,1,35, 34,0,53,52,0,51,32,0,17,16,0,33,34,38,1,50,54,53,52,38,35,34,6,21,20,22, 225,76,156,75,200,211,15,58,178,108,224,254,251,1,16,226,1,3,1,17,254, 177,254,229,76,156,1,62,136,159,159,136,136,159,159,31,184,36,38,1,13, 1,18,86,92,1,15,235,230,1,22,254,115,254,134,254,159,254,91,30,2,151,186, 162,161,187,187,161,162,186,0,0,2,0,240,0,0,1,195,4,35,0,3,0,7,0,28,64, 14,6,131,4,166,0,131,2,5,1,3,4,0,24,8,16,252,60,236,50,49,0,47,236,244, 236,48,55,51,21,35,17,51,21,35,240,211,211,211,211,254,254,4,35,254,0, 0,0,1,0,217,0,94,5,219,4,166,0,6,0,77,64,42,2,156,3,4,3,1,156,0,1,4,4, 3,1,156,2,1,5,6,5,0,156,6,5,66,5,4,2,1,0,5,3,168,6,167,7,1,2,0,36,4,35, 7,16,252,236,50,57,49,0,16,244,236,23,57,48,75,83,88,7,4,237,7,16,8,237, 7,16,8,237,7,16,4,237,89,34,9,2,21,1,53,1,5,219,251,248,4,8,250,254,5, 2,3,240,254,145,254,147,182,1,209,166,1,209,0,0,2,0,217,1,96,5,219,3,162, 0,3,0,7,0,28,64,13,0,156,2,6,156,4,8,5,1,4,0,35,8,16,252,60,196,50,49, 0,16,212,236,212,236,48,19,33,21,33,21,33,21,33,217,5,2,250,254,5,2,250, 254,3,162,168,240,170,0,0,0,1,0,217,0,94,5,219,4,166,0,6,0,79,64,43,6, 156,0,6,3,4,3,5,156,4,4,3,0,156,1,2,1,6,156,5,6,2,2,1,66,6,5,3,2,0,5,4, 168,1,167,7,6,2,36,4,0,35,7,16,252,60,236,57,49,0,16,244,236,23,57,48, 75,83,88,7,16,8,237,7,16,4,237,7,16,4,237,7,16,8,237,89,34,19,53,1,21, 1,53,1,217,5,2,250,254,4,6,3,240,182,254,47,166,254,47,182,1,109,0,0,0, 2,0,147,0,0,3,176,5,240,0,3,0,36,0,101,64,43,36,30,9,6,4,10,29,19,4,0, 20,134,19,136,16,149,23,145,0,131,2,29,26,13,9,5,4,10,30,1,13,28,26,4, 28,5,1,3,0,38,26,19,37,16,220,75,176,12,84,88,185,0,19,255,192,56,89,196, 252,236,212,236,16,238,17,57,57,17,18,57,17,18,57,49,0,47,238,246,254, 244,238,16,205,17,57,57,23,57,48,1,182,121,9,122,10,122,32,3,93,37,51, 21,35,19,35,53,52,54,63,1,62,1,53,52,38,35,34,6,7,53,62,1,51,50,22,21, 20,6,15,1,14,1,7,14,1,21,1,135,203,203,197,191,56,90,90,57,51,131,108, 79,179,97,94,193,103,184,223,72,90,88,47,39,8,6,6,254,254,1,145,154,101, 130,86,89,53,94,49,89,110,70,67,188,57,56,194,159,76,137,86,86,47,53,25, 21,60,52,0,0,0,2,0,135,254,156,7,113,5,162,0,11,0,76,0,149,64,50,24,12, 3,9,169,25,21,27,3,169,76,15,52,51,15,172,48,169,55,21,172,36,169,55,67, 77,51,52,30,26,0,40,18,6,24,12,40,26,43,30,40,73,18,43,42,40,73,44,61, 77,16,220,236,252,236,16,254,253,254,60,198,16,238,17,18,57,57,49,0,16, 212,196,252,236,16,254,237,212,198,16,197,238,50,16,196,238,17,57,57,48, 0,75,176,9,84,75,176,12,84,91,75,176,16,84,91,75,176,19,84,91,75,176,20, 84,91,88,189,0,77,255,192,0,1,0,77,0,77,0,64,56,17,55,56,89,64,9,15,78, 31,78,47,78,63,78,4,1,93,1,20,22,51,50,54,53,52,38,35,34,6,1,14,1,35,34, 38,53,52,54,51,50,22,23,53,51,17,62,1,53,52,38,39,38,36,35,34,6,7,6,2, 21,20,18,23,22,4,51,50,54,55,23,6,4,35,34,36,39,38,2,53,52,18,55,54,36, 51,50,4,23,30,1,21,16,0,5,2,250,142,124,123,141,144,122,121,143,2,33,60, 155,103,172,215,216,171,103,156,59,143,146,165,63,64,104,254,213,176,123, 226,96,157,177,115,109,105,1,20,157,129,249,104,90,125,254,217,152,185, 254,184,128,128,134,136,126,129,1,82,189,212,1,107,123,75,79,254,194,254, 232,2,25,143,163,164,142,140,165,164,254,72,77,73,249,200,200,250,75,76, 131,253,32,22,223,177,107,188,80,131,139,65,64,102,254,181,193,159,254, 234,106,104,109,87,81,111,97,103,131,125,125,1,73,189,182,1,74,125,127, 135,174,160,98,230,123,254,249,254,208,6,0,0,2,0,16,0,0,5,104,5,213,0, 2,0,10,0,194,64,65,0,17,1,0,4,5,4,2,17,5,5,4,1,17,10,3,10,0,17,2,0,3,3, 10,7,17,5,4,6,17,5,5,4,9,17,3,10,8,17,10,3,10,66,0,3,7,149,1,3,129,9,5, 9,8,7,6,4,3,2,1,0,9,5,10,11,16,212,196,23,57,49,0,47,60,228,212,236,18, 57,48,75,83,88,7,16,5,237,7,5,237,7,16,5,237,7,5,237,7,16,8,237,7,16,5, 237,7,16,5,237,7,16,8,237,89,34,178,32,12,1,1,93,64,66,15,1,15,2,15,7, 15,8,15,0,88,0,118,0,112,0,140,0,9,7,1,8,2,6,3,9,4,22,1,25,2,86,1,88,2, 80,12,103,1,104,2,120,1,118,2,124,3,114,4,119,7,120,8,135,1,136,2,128, 12,152,2,153,3,150,4,23,93,0,93,9,1,33,1,51,1,35,3,33,3,35,2,188,254,238, 2,37,254,123,229,2,57,210,136,253,95,136,213,5,14,253,25,3,174,250,43, 1,127,254,129,0,0,0,3,0,201,0,0,4,236,5,213,0,8,0,17,0,32,0,67,64,35,25, 0,149,10,9,149,18,129,1,149,10,173,31,17,11,8,2,19,25,31,5,0,14,28,22, 5,25,28,46,9,0,28,18,4,33,16,252,236,50,252,236,212,236,17,23,57,57,57, 49,0,47,236,236,244,236,16,238,57,48,178,15,34,1,1,93,1,17,33,50,54,53, 52,38,35,1,17,33,50,54,53,52,38,35,37,33,50,22,21,20,6,7,30,1,21,20,4, 35,33,1,147,1,68,163,157,157,163,254,188,1,43,148,145,145,148,254,11,2, 4,231,250,128,124,149,165,254,240,251,253,232,2,201,253,221,135,139,140, 133,2,102,254,62,111,114,113,112,166,192,177,137,162,20,32,203,152,200, 218,0,1,0,115,255,227,5,39,5,240,0,25,0,54,64,26,13,161,14,174,10,149, 17,1,161,0,174,4,149,23,145,17,140,26,7,25,13,0,48,20,16,26,16,252,236, 50,236,49,0,16,228,244,236,244,236,16,238,246,238,48,180,15,27,31,27,2, 1,93,1,21,46,1,35,32,0,17,16,0,33,50,54,55,21,14,1,35,32,0,17,16,0,33, 50,22,5,39,102,231,130,255,0,254,240,1,16,1,0,130,231,102,106,237,132, 254,173,254,122,1,134,1,83,134,237,5,98,213,95,94,254,199,254,216,254, 217,254,199,94,95,211,72,72,1,159,1,103,1,104,1,159,71,0,0,0,2,0,201,0, 0,5,176,5,213,0,8,0,17,0,46,64,21,0,149,9,129,1,149,16,8,2,16,10,0,5,25, 13,50,0,28,9,4,18,16,252,236,244,236,17,57,57,57,57,49,0,47,236,244,236, 48,178,96,19,1,1,93,1,17,51,32,0,17,16,0,33,37,33,32,0,17,16,0,41,1,1, 147,244,1,53,1,31,254,225,254,203,254,66,1,159,1,178,1,150,254,104,254, 80,254,97,5,47,251,119,1,24,1,46,1,44,1,23,166,254,151,254,128,254,126, 254,150,0,0,0,1,0,201,0,0,4,139,5,213,0,11,0,46,64,21,6,149,4,2,149,0, 129,8,149,4,173,10,5,1,9,7,3,28,0,4,12,16,252,236,50,212,196,196,49,0, 47,236,236,244,236,16,238,48,178,31,13,1,1,93,19,33,21,33,17,33,21,33, 17,33,21,33,201,3,176,253,26,2,199,253,57,2,248,252,62,5,213,170,254,70, 170,253,227,170,0,0,0,1,0,201,0,0,4,35,5,213,0,9,0,41,64,18,6,149,4,2, 149,0,129,4,173,8,5,1,7,3,28,0,4,10,16,252,236,50,212,196,49,0,47,236, 244,236,16,238,48,178,15,11,1,1,93,19,33,21,33,17,33,21,33,17,35,201,3, 90,253,112,2,80,253,176,202,5,213,170,254,72,170,253,55,0,0,1,0,115,255, 227,5,139,5,240,0,29,0,57,64,32,0,5,27,1,149,3,27,149,8,18,161,17,174, 21,149,14,145,8,140,30,2,0,28,17,52,4,51,24,25,11,16,30,16,252,236,252, 228,252,196,49,0,16,228,244,236,244,236,16,254,212,238,17,57,57,48,37, 17,33,53,33,17,6,4,35,32,0,17,16,0,33,50,4,23,21,46,1,35,32,0,17,16,0, 33,50,54,4,195,254,182,2,18,117,254,230,160,254,162,254,117,1,139,1,94, 146,1,7,111,112,252,139,254,238,254,237,1,19,1,18,107,168,213,1,145,166, 253,127,83,85,1,153,1,109,1,110,1,153,72,70,215,95,96,254,206,254,209, 254,210,254,206,37,0,0,0,1,0,201,0,0,5,59,5,213,0,11,0,44,64,20,8,149, 2,173,4,0,129,10,6,7,3,28,5,56,9,1,28,0,4,12,16,252,236,50,252,236,50, 49,0,47,60,228,50,252,236,48,178,80,13,1,1,93,19,51,17,33,17,51,17,35, 17,33,17,35,201,202,2,222,202,202,253,34,202,5,213,253,156,2,100,250,43, 2,199,253,57,0,0,1,0,201,0,0,1,147,5,213,0,3,0,46,183,0,175,2,1,28,0,4, 4,16,252,75,176,16,84,88,185,0,0,0,64,56,89,236,49,0,47,236,48,1,64,13, 48,5,64,5,80,5,96,5,143,5,159,5,6,93,19,51,17,35,201,202,202,5,213,250, 43,0,0,1,255,150,254,102,1,147,5,213,0,11,0,66,64,19,11,2,0,7,149,5,176, 0,129,12,5,8,6,57,1,28,0,4,12,16,252,75,176,16,84,88,185,0,0,0,64,56,89, 236,228,57,57,49,0,16,228,252,236,17,57,57,48,1,64,13,48,13,64,13,80,13, 96,13,143,13,159,13,6,93,19,51,17,16,6,43,1,53,51,50,54,53,201,202,205, 227,77,63,134,110,5,213,250,147,254,242,244,170,150,194,0,0,0,1,0,201, 0,0,5,106,5,213,0,10,0,239,64,40,8,17,5,6,5,7,17,6,6,5,3,17,4,5,4,2,17, 5,5,4,66,8,5,2,3,3,0,175,9,6,5,1,4,6,8,1,28,0,4,11,16,252,236,50,212,196, 17,57,49,0,47,60,236,50,23,57,48,75,83,88,7,16,4,237,7,16,5,237,7,16,5, 237,7,16,4,237,89,34,178,8,3,1,1,93,64,146,20,2,1,4,2,9,8,22,2,40,5,40, 8,55,2,54,5,52,8,71,2,70,5,67,8,85,2,103,2,118,2,119,5,131,2,136,5,143, 8,148,2,155,8,231,2,21,6,3,9,5,9,6,27,3,25,7,5,10,3,10,7,24,3,40,5,43, 6,42,7,54,4,54,5,54,6,53,7,48,12,65,3,64,4,69,5,64,6,64,7,64,12,98,3,96, 4,104,5,103,7,119,5,112,12,139,3,139,5,142,6,143,7,143,12,154,3,157,6, 157,7,182,3,181,7,197,3,197,7,215,3,214,7,232,3,233,4,232,5,234,6,247, 3,248,5,249,6,44,93,113,0,93,113,19,51,17,1,33,9,1,33,1,17,35,201,202, 2,158,1,4,253,27,3,26,254,246,253,51,202,5,213,253,137,2,119,253,72,252, 227,2,207,253,49,0,0,0,0,1,0,201,0,0,4,106,5,213,0,5,0,37,64,12,2,149, 0,129,4,1,28,3,58,0,4,6,16,252,236,236,49,0,47,228,236,48,64,9,48,7,80, 7,128,3,128,4,4,1,93,19,51,17,33,21,33,201,202,2,215,252,95,5,213,250, 213,170,0,1,0,201,0,0,6,31,5,213,0,12,0,191,64,52,3,17,7,8,7,2,17,1,2, 8,8,7,2,17,3,2,9,10,9,1,17,10,10,9,66,10,7,2,3,8,3,0,175,8,11,5,9,8,3, 2,1,5,10,6,28,4,62,10,28,0,4,13,16,252,236,252,236,17,23,57,49,0,47,60, 196,236,50,17,23,57,48,75,83,88,7,16,5,237,7,16,8,237,7,16,8,237,7,16, 5,237,89,34,178,112,14,1,1,93,64,86,3,7,15,8,15,9,2,10,21,2,20,7,19,10, 38,2,38,7,32,7,38,10,32,10,52,7,53,10,105,2,124,2,123,7,121,10,128,2,130, 7,130,10,144,2,22,4,1,11,3,19,1,27,3,35,1,44,3,39,8,40,9,52,1,60,3,86, 8,89,9,101,8,106,9,118,8,121,9,129,1,141,3,149,1,155,3,20,93,0,93,19,33, 9,1,33,17,35,17,1,35,1,17,35,201,1,45,1,125,1,127,1,45,197,254,127,203, 254,127,196,5,213,252,8,3,248,250,43,5,31,252,0,4,0,250,225,0,0,0,1,0, 201,0,0,5,51,5,213,0,9,0,121,64,30,7,17,1,2,1,2,17,6,7,6,66,7,2,3,0,175, 8,5,6,1,7,2,28,4,54,7,28,0,4,10,16,252,236,252,236,17,57,57,49,0,47,60, 236,50,57,57,48,75,83,88,7,16,4,237,7,16,4,237,89,34,178,31,11,1,1,93, 64,48,54,2,56,7,72,2,71,7,105,2,102,7,128,2,7,6,1,9,6,21,1,26,6,70,1,73, 6,87,1,88,6,101,1,105,6,121,6,133,1,138,6,149,1,154,6,159,11,16,93,0,93, 19,33,1,17,51,17,33,1,17,35,201,1,16,2,150,196,254,240,253,106,196,5,213, 251,31,4,225,250,43,4,225,251,31,0,2,0,115,255,227,5,217,5,240,0,11,0, 23,0,35,64,19,6,149,18,0,149,12,145,18,140,24,9,25,15,51,3,25,21,16,24, 16,252,236,252,236,49,0,16,228,244,236,16,238,48,1,34,0,17,16,0,51,50, 0,17,16,0,39,32,0,17,16,0,33,32,0,17,16,0,3,39,220,254,253,1,3,220,220, 1,1,254,255,220,1,58,1,120,254,136,254,198,254,197,254,135,1,121,5,76, 254,184,254,229,254,230,254,184,1,72,1,26,1,27,1,72,164,254,91,254,158, 254,159,254,91,1,164,1,98,1,98,1,165,0,0,0,2,0,201,0,0,4,141,5,213,0,8, 0,19,0,58,64,24,1,149,16,0,149,9,129,18,16,10,8,2,4,0,5,25,13,63,17,0, 28,9,4,20,16,252,236,50,252,236,17,23,57,49,0,47,244,236,212,236,48,64, 11,15,21,31,21,63,21,95,21,175,21,5,1,93,1,17,51,50,54,53,52,38,35,37, 33,50,4,21,20,4,43,1,17,35,1,147,254,141,154,154,141,254,56,1,200,251, 1,1,254,255,251,254,202,5,47,253,207,146,135,134,146,166,227,219,221,226, 253,168,0,2,0,115,254,248,5,217,5,240,0,11,0,29,0,82,64,42,17,16,2,15, 1,12,13,12,14,1,13,13,12,66,15,30,12,6,149,18,0,149,24,145,18,140,13,30, 13,27,15,12,3,9,25,27,51,3,25,21,16,30,16,252,236,252,236,17,57,57,17, 57,49,0,16,196,228,244,236,16,238,57,18,57,48,75,83,88,7,16,5,237,7,16, 5,237,23,57,89,34,1,34,0,17,16,0,51,50,0,17,16,0,19,1,35,39,14,1,35,32, 0,17,16,0,33,32,0,17,16,2,3,39,220,254,253,1,3,220,220,1,1,254,255,63, 1,10,244,221,33,35,16,254,197,254,135,1,121,1,59,1,58,1,120,209,5,76,254, 184,254,229,254,230,254,184,1,72,1,26,1,27,1,72,250,207,254,221,239,2, 2,1,165,1,97,1,98,1,165,254,91,254,158,254,252,254,142,0,0,2,0,201,0,0, 5,84,5,213,0,19,0,28,0,177,64,53,9,8,7,3,10,6,17,3,4,3,5,17,4,4,3,66,6, 4,0,21,3,4,21,149,9,20,149,13,129,11,4,5,6,3,17,9,0,28,22,14,5,10,25,25, 4,17,63,20,10,28,12,4,29,16,252,236,50,252,196,236,17,23,57,17,57,57,57, 49,0,47,60,244,236,212,236,18,57,18,57,18,57,48,75,83,88,7,16,5,237,7, 16,5,237,17,23,57,89,34,178,64,30,1,1,93,64,66,122,19,1,5,0,5,1,5,2,6, 3,7,4,21,0,21,1,20,2,22,3,23,4,37,0,37,1,37,2,38,3,39,6,38,7,38,8,38,9, 32,30,54,1,54,2,70,1,70,2,104,5,117,4,117,5,119,19,136,6,136,7,152,6,152, 7,31,93,0,93,1,30,1,23,19,35,3,46,1,43,1,17,35,17,33,32,22,21,20,6,1,17, 51,50,54,53,52,38,35,3,141,65,123,62,205,217,191,74,139,120,220,202,1, 200,1,0,252,131,253,137,254,146,149,149,146,2,188,22,144,126,254,104,1, 127,150,98,253,137,5,213,214,216,141,186,2,79,253,238,135,131,131,133, 0,0,1,0,135,255,227,4,162,5,240,0,39,0,126,64,60,13,12,2,14,11,2,30,31, 30,8,9,2,7,10,2,31,31,30,66,10,11,30,31,4,21,1,0,21,161,20,148,24,149, 17,4,149,0,148,37,145,17,140,40,30,10,11,31,27,7,0,34,27,25,14,45,7,25, 20,34,40,16,220,196,236,252,236,228,17,18,57,57,57,57,49,0,16,228,244, 228,236,16,238,246,238,16,198,17,23,57,48,75,83,88,7,16,14,237,17,23,57, 7,16,14,237,17,23,57,89,34,178,15,41,1,1,93,182,31,41,47,41,79,41,3,93, 1,21,46,1,35,34,6,21,20,22,31,1,30,1,21,20,4,33,34,38,39,53,30,1,51,50, 54,53,52,38,47,1,46,1,53,52,36,51,50,22,4,72,115,204,95,165,179,119,166, 122,226,215,254,221,254,231,106,239,128,123,236,114,173,188,135,154,123, 226,202,1,23,245,105,218,5,164,197,55,54,128,118,99,101,31,25,43,217,182, 217,224,48,47,208,69,70,136,126,110,124,31,24,45,192,171,198,228,38,0, 0,1,255,250,0,0,4,233,5,213,0,7,0,74,64,14,6,2,149,0,129,4,1,64,3,28,0, 64,5,8,16,212,228,252,228,49,0,47,244,236,50,48,1,75,176,10,84,88,189, 0,8,0,64,0,1,0,8,0,8,255,192,56,17,55,56,89,64,19,0,9,31,0,16,1,16,2,31, 7,16,9,64,9,112,9,159,9,9,93,3,33,21,33,17,35,17,33,6,4,239,253,238,203, 253,238,5,213,170,250,213,5,43,0,0,1,0,178,255,227,5,41,5,213,0,17,0,64, 64,22,8,2,17,11,0,5,149,14,140,9,0,129,18,8,28,10,56,1,28,0,65,18,16,252, 75,176,16,84,88,185,0,0,255,192,56,89,236,252,236,49,0,16,228,50,244,236, 17,57,57,57,57,48,1,182,31,19,143,19,159,19,3,93,19,51,17,20,22,51,50, 54,53,17,51,17,16,0,33,32,0,17,178,203,174,195,194,174,203,254,223,254, 230,254,229,254,223,5,213,252,117,240,211,211,240,3,139,252,92,254,220, 254,214,1,42,1,36,0,0,1,0,16,0,0,5,104,5,213,0,6,0,183,64,39,4,17,5,6, 5,3,17,2,3,6,6,5,3,17,4,3,0,1,0,2,17,1,1,0,66,3,4,1,175,0,6,4,3,2,0,5, 5,1,7,16,212,196,23,57,49,0,47,236,50,57,48,75,83,88,7,16,5,237,7,16,8, 237,7,16,8,237,7,16,5,237,89,34,178,80,8,1,1,93,64,98,0,3,42,3,71,4,71, 5,90,3,125,3,131,3,7,6,0,7,2,8,4,9,6,21,1,20,2,26,4,26,5,42,0,38,1,38, 2,41,4,41,5,37,6,32,8,56,0,51,1,51,2,60,4,60,5,55,6,72,0,69,1,69,2,73, 4,73,5,71,6,89,0,86,6,102,2,105,4,105,5,122,0,118,1,118,2,121,4,121,5, 117,6,128,8,152,0,151,6,41,93,0,93,33,1,51,9,1,51,1,2,74,253,198,211,1, 217,1,218,210,253,199,5,213,251,23,4,233,250,43,0,1,0,68,0,0,7,166,5,213, 0,12,1,123,64,73,5,26,6,5,9,10,9,4,26,10,9,3,26,10,11,10,2,26,1,2,11,11, 10,6,17,7,8,7,5,17,4,5,8,8,7,2,17,3,2,12,0,12,1,17,0,0,12,66,10,5,2,3, 6,3,0,175,11,8,12,11,10,9,8,6,5,4,3,2,1,11,7,0,13,16,212,204,23,57,49, 0,47,60,236,50,50,23,57,48,75,83,88,7,16,5,237,7,16,8,237,7,16,8,237,7, 16,5,237,7,16,8,237,7,16,5,237,7,5,237,7,16,8,237,89,34,178,0,14,1,1,93, 64,242,6,2,6,5,2,10,0,10,0,10,18,10,40,5,36,10,32,10,62,2,62,5,52,10,48, 10,76,2,77,5,66,10,64,10,89,2,106,2,107,5,103,10,96,10,123,2,127,2,124, 5,127,5,128,10,150,2,149,5,29,7,0,9,2,8,3,0,4,6,5,0,5,0,6,1,7,4,8,0,8, 7,9,0,9,4,10,10,12,0,14,26,3,21,4,21,8,25,12,16,14,32,4,33,5,32,6,32,7, 32,8,35,9,36,10,37,11,32,14,32,14,60,2,58,3,53,4,51,5,48,8,54,9,57,11, 63,12,48,14,70,0,70,1,74,2,64,4,69,5,64,5,66,6,66,7,66,8,64,8,64,9,68, 10,77,12,64,14,64,14,88,2,86,8,89,12,80,14,102,2,103,3,97,4,98,5,96,6, 96,7,96,8,100,9,100,10,100,11,119,0,118,1,123,2,120,3,119,4,116,5,121, 6,121,7,119,8,112,8,120,12,127,12,127,14,134,2,135,3,136,4,137,5,133,9, 138,11,143,14,151,4,159,14,175,14,91,93,0,93,19,51,9,1,51,9,1,51,1,35, 9,1,35,68,204,1,58,1,57,227,1,58,1,57,205,254,137,254,254,197,254,194, 254,5,213,251,18,4,238,251,18,4,238,250,43,5,16,250,240,0,0,0,1,0,61,0, 0,5,59,5,213,0,11,0,102,64,6,13,4,6,0,10,12,16,212,196,220,196,196,49, 180,128,0,127,10,2,93,0,64,5,3,0,175,9,6,47,60,236,50,48,75,176,66,80, 88,64,20,7,17,6,6,5,9,17,10,11,10,3,17,4,5,4,1,17,0,11,0,5,7,16,236,7, 16,236,7,16,236,7,16,236,64,20,11,10,3,7,0,8,9,4,7,0,5,9,4,6,1,2,10,3, 6,1,15,15,15,15,89,19,51,9,1,51,9,1,35,9,1,35,1,129,217,1,115,1,117,217, 254,32,2,0,217,254,92,254,89,218,2,21,5,213,253,213,2,43,253,51,252,248, 2,123,253,133,3,29,0,0,1,255,252,0,0,4,231,5,213,0,8,0,148,64,40,3,17, 4,5,4,2,17,1,2,5,5,4,2,17,3,2,8,0,8,1,17,0,0,8,66,2,3,0,175,6,2,7,4,64, 5,28,0,64,7,9,16,212,228,252,228,18,57,49,0,47,236,50,57,48,75,83,88,7, 16,5,237,7,16,8,237,7,16,8,237,7,16,5,237,89,34,178,0,10,1,1,93,64,60, 5,2,20,2,53,2,48,2,48,5,48,8,70,2,64,2,64,5,64,8,81,2,81,5,81,8,101,2, 132,2,147,2,16,22,1,26,3,31,10,38,1,41,3,55,1,56,3,64,10,103,1,104,3,120, 3,112,10,159,10,13,93,0,93,3,51,9,1,51,1,17,35,17,4,217,1,158,1,155,217, 253,240,203,5,213,253,154,2,102,252,242,253,57,2,199,0,0,0,0,1,0,92,0, 0,5,31,5,213,0,9,0,144,64,27,3,17,7,8,7,8,17,2,3,2,66,8,149,0,129,3,149, 5,8,3,0,1,66,4,0,6,10,16,220,75,176,9,84,75,176,10,84,91,88,185,0,6,255, 192,56,89,196,212,228,17,57,57,49,0,47,236,244,236,48,75,83,88,7,16,5, 237,7,16,5,237,89,34,1,64,64,5,2,10,7,24,7,41,2,38,7,56,7,72,2,71,7,72, 8,9,5,3,11,8,0,11,22,3,26,8,16,11,47,11,53,3,57,8,63,11,71,3,74,8,79,11, 85,3,89,8,102,3,105,8,111,11,119,3,120,8,127,11,159,11,22,93,0,93,19,33, 21,1,33,21,33,53,1,33,115,4,149,252,80,3,199,251,61,3,176,252,103,5,213, 154,251,111,170,154,4,145,0,0,0,1,0,176,254,242,2,88,6,20,0,7,0,59,64, 15,4,169,6,178,2,169,0,177,8,5,1,3,67,0,8,16,220,75,176,12,84,88,185,0, 0,0,64,56,89,75,176,18,84,75,176,19,84,91,88,185,0,0,255,192,56,89,252, 204,50,49,0,16,252,236,244,236,48,19,33,21,35,17,51,21,33,176,1,168,240, 240,254,88,6,20,143,249,252,143,0,0,0,1,0,199,254,242,2,111,6,20,0,7,0, 48,64,16,3,169,1,178,5,169,0,177,8,0,67,4,6,2,4,8,16,252,75,176,15,84, 75,176,16,84,91,88,185,0,2,0,64,56,89,60,220,236,49,0,16,252,236,244,236, 48,1,17,33,53,51,17,35,53,2,111,254,88,239,239,6,20,248,222,143,6,4,143, 0,1,0,217,3,168,5,219,5,213,0,6,0,24,64,10,3,4,1,0,129,7,3,1,5,7,16,220, 204,57,49,0,16,244,204,50,57,48,9,1,35,9,1,35,1,3,188,2,31,201,254,72, 254,72,201,2,31,5,213,253,211,1,139,254,117,2,45,0,0,1,255,236,254,29, 4,20,254,172,0,3,0,15,181,0,169,1,0,2,4,16,196,196,49,0,212,236,48,1,21, 33,53,4,20,251,216,254,172,143,143,0,0,0,0,2,0,123,255,227,4,45,4,123, 0,10,0,37,0,188,64,39,25,31,11,23,9,14,0,169,23,6,185,14,17,32,134,31, 186,28,185,35,184,17,140,23,12,0,23,3,24,13,9,8,11,31,3,8,20,69,38,16, 252,236,204,212,236,50,50,17,57,57,49,0,47,196,228,244,252,244,236,16, 198,238,16,238,17,57,17,57,18,57,48,64,110,48,29,48,30,48,31,48,32,48, 33,48,34,63,39,64,29,64,30,64,31,64,32,64,33,64,34,80,29,80,30,80,31,80, 32,80,33,80,34,80,39,112,39,133,29,135,30,135,31,135,32,135,33,133,34, 144,39,160,39,240,39,30,48,30,48,31,48,32,48,33,64,30,64,31,64,32,64,33, 80,30,80,31,80,32,80,33,96,30,96,31,96,32,96,33,112,30,112,31,112,32,112, 33,128,30,128,31,128,32,128,33,24,93,1,93,1,34,6,21,20,22,51,50,54,61, 1,55,17,35,53,14,1,35,34,38,53,52,54,51,33,53,52,38,35,34,6,7,53,62,1, 51,50,22,2,190,223,172,129,111,153,185,184,184,63,188,136,172,203,253, 251,1,2,167,151,96,182,84,101,190,90,243,240,2,51,102,123,98,115,217,180, 41,76,253,129,170,102,97,193,162,189,192,18,127,139,46,46,170,39,39,252, 0,0,2,0,186,255,227,4,164,6,20,0,11,0,28,0,56,64,25,3,185,12,15,9,185, 24,21,140,15,184,27,151,25,0,18,18,71,24,12,6,8,26,70,29,16,252,236,50, 50,244,236,49,0,47,236,228,244,196,236,16,198,238,48,182,96,30,128,30, 160,30,3,1,93,1,52,38,35,34,6,21,20,22,51,50,54,1,62,1,51,50,0,17,16,2, 35,34,38,39,21,35,17,51,3,229,167,146,146,167,167,146,146,167,253,142, 58,177,123,204,0,255,255,204,123,177,58,185,185,2,47,203,231,231,203,203, 231,231,2,82,100,97,254,188,254,248,254,248,254,188,97,100,168,6,20,0, 1,0,113,255,227,3,231,4,123,0,25,0,63,64,27,0,134,1,136,4,14,134,13,136, 10,185,17,4,185,23,184,17,140,26,7,18,13,0,72,20,69,26,16,252,228,50,236, 49,0,16,228,244,236,16,254,244,238,16,245,238,48,64,11,15,27,16,27,128, 27,144,27,160,27,5,1,93,1,21,46,1,35,34,6,21,20,22,51,50,54,55,21,14,1, 35,34,0,17,16,0,33,50,22,3,231,78,157,80,179,198,198,179,80,157,78,77, 165,93,253,254,214,1,45,1,6,85,162,4,53,172,43,43,227,205,205,227,43,43, 170,36,36,1,62,1,14,1,18,1,58,35,0,0,0,2,0,113,255,227,4,90,6,20,0,16, 0,28,0,56,64,25,26,185,0,14,20,185,5,8,140,14,184,1,151,3,23,4,0,8,2,71, 17,18,11,69,29,16,252,236,244,236,50,50,49,0,47,236,228,244,196,236,16, 196,238,48,182,96,30,128,30,160,30,3,1,93,1,17,51,17,35,53,14,1,35,34, 2,17,16,0,51,50,22,1,20,22,51,50,54,53,52,38,35,34,6,3,162,184,184,58, 177,124,203,255,0,255,203,124,177,253,199,167,146,146,168,168,146,146, 167,3,182,2,94,249,236,168,100,97,1,68,1,8,1,8,1,68,97,254,21,203,231, 231,203,203,231,231,0,2,0,113,255,227,4,127,4,123,0,20,0,27,0,112,64,36, 0,21,1,9,134,8,136,5,21,169,1,5,185,12,1,187,24,185,18,184,12,140,28,27, 21,2,8,21,8,0,75,2,18,15,69,28,16,252,236,244,236,196,17,18,57,49,0,16, 228,244,236,228,16,238,16,238,16,244,238,17,18,57,48,64,41,63,29,112,29, 160,29,208,29,240,29,5,63,0,63,1,63,2,63,21,63,27,5,44,7,47,8,47,9,44, 10,111,0,111,1,111,2,111,21,111,27,9,93,113,1,93,1,21,33,30,1,51,50,54, 55,21,14,1,35,32,0,17,16,0,51,50,0,7,46,1,35,34,6,7,4,127,252,178,12,205, 183,106,199,98,99,208,107,254,244,254,199,1,41,252,226,1,7,184,2,165,136, 154,185,14,2,94,90,190,199,52,52,174,42,44,1,56,1,10,1,19,1,67,254,221, 196,151,180,174,158,0,0,1,0,47,0,0,2,248,6,20,0,19,0,89,64,28,5,16,1,12, 8,169,6,1,135,0,151,14,6,188,10,2,19,7,0,7,9,5,8,13,15,11,76,20,16,252, 75,176,10,84,88,185,0,11,0,64,56,89,75,176,14,84,88,185,0,11,255,192,56, 89,60,196,252,60,196,196,18,57,57,49,0,47,228,50,252,236,16,238,50,18, 57,57,48,1,182,64,21,80,21,160,21,3,93,1,21,35,34,6,29,1,33,21,33,17,35, 17,35,53,51,53,52,54,51,2,248,176,99,77,1,47,254,209,185,176,176,174,189, 6,20,153,80,104,99,143,252,47,3,209,143,78,187,171,0,2,0,113,254,86,4, 90,4,123,0,11,0,40,0,74,64,35,25,12,29,9,18,134,19,22,185,15,3,185,38, 35,184,39,188,9,185,15,189,26,29,38,25,0,8,12,71,6,18,18,32,69,41,16,252, 196,236,244,236,50,50,49,0,47,196,228,236,228,244,196,236,16,254,213,238, 17,18,57,57,48,182,96,42,128,42,160,42,3,1,93,1,52,38,35,34,6,21,20,22, 51,50,54,23,16,2,33,34,38,39,53,30,1,51,50,54,61,1,14,1,35,34,2,17,16, 18,51,50,22,23,53,51,3,162,165,149,148,165,165,148,149,165,184,254,254, 250,97,172,81,81,158,82,181,180,57,178,124,206,252,252,206,124,178,57, 184,2,61,200,220,220,200,199,220,220,235,254,226,254,233,29,30,179,44, 42,189,191,91,99,98,1,58,1,3,1,4,1,58,98,99,170,0,0,1,0,186,0,0,4,100, 6,20,0,19,0,52,64,25,3,9,0,3,14,1,6,135,14,17,184,12,151,10,1,2,8,0,78, 13,9,8,11,70,20,16,252,236,50,244,236,49,0,47,60,236,244,196,236,17,18, 23,57,48,178,96,21,1,1,93,1,17,35,17,52,38,35,34,6,21,17,35,17,51,17,62, 1,51,50,22,4,100,184,124,124,149,172,185,185,66,179,117,193,198,2,164, 253,92,2,158,159,158,190,164,253,135,6,20,253,158,101,100,239,0,0,2,0, 193,0,0,1,121,6,20,0,3,0,7,0,43,64,14,6,190,4,177,0,188,2,5,1,8,4,0,70, 8,16,252,60,236,50,49,0,47,228,252,236,48,64,11,16,9,64,9,80,9,96,9,112, 9,5,1,93,19,51,17,35,17,51,21,35,193,184,184,184,184,4,96,251,160,6,20, 233,0,0,2,255,219,254,86,1,121,6,20,0,11,0,15,0,68,64,28,11,2,7,0,14,190, 12,7,135,5,189,0,188,12,177,16,8,16,5,6,79,13,1,8,12,0,70,16,16,252,60, 236,50,228,57,18,57,49,0,16,236,228,244,236,16,238,17,18,57,57,48,64,11, 16,17,64,17,80,17,96,17,112,17,5,1,93,19,51,17,20,6,43,1,53,51,50,54,53, 17,51,21,35,193,184,163,181,70,49,105,76,184,184,4,96,251,140,214,192, 156,97,153,6,40,233,0,0,0,1,0,186,0,0,4,156,6,20,0,10,0,188,64,41,8,17, 5,6,5,7,17,6,6,5,3,17,4,5,4,2,17,5,5,4,66,8,5,2,3,3,188,0,151,9,6,5,1, 4,6,8,1,8,0,70,11,16,252,236,50,212,196,17,57,49,0,47,60,236,228,23,57, 48,75,83,88,7,16,4,237,7,16,5,237,7,16,5,237,7,16,4,237,89,34,178,16,12, 1,1,93,64,95,4,2,10,8,22,2,39,2,41,5,43,8,86,2,102,2,103,8,115,2,119,5, 130,2,137,5,142,8,147,2,150,5,151,8,163,2,18,9,5,9,6,2,11,3,10,7,40,3, 39,4,40,5,43,6,43,7,64,12,104,3,96,12,137,3,133,4,137,5,141,6,143,7,154, 3,151,7,170,3,167,5,182,7,197,7,214,7,247,3,240,3,247,4,240,4,26,93,113, 0,93,19,51,17,1,51,9,1,35,1,17,35,186,185,2,37,235,253,174,2,107,240,253, 199,185,6,20,252,105,1,227,253,244,253,172,2,35,253,221,0,1,0,193,0,0, 1,121,6,20,0,3,0,34,183,0,151,2,1,8,0,70,4,16,252,236,49,0,47,236,48,64, 13,16,5,64,5,80,5,96,5,112,5,240,5,6,1,93,19,51,17,35,193,184,184,6,20, 249,236,0,0,1,0,186,0,0,7,29,4,123,0,34,0,90,64,38,6,18,9,24,15,0,6,29, 7,21,12,135,29,32,3,184,27,188,25,16,7,0,17,15,8,8,6,80,17,8,15,80,28, 24,8,26,70,35,16,252,236,50,252,252,252,236,17,18,57,49,0,47,60,60,228, 244,60,196,236,50,17,18,23,57,48,64,19,48,36,80,36,112,36,144,36,160,36, 160,36,191,36,223,36,255,36,9,1,93,1,62,1,51,50,22,21,17,35,17,52,38,35, 34,6,21,17,35,17,52,38,35,34,6,21,17,35,17,51,21,62,1,51,50,22,4,41,69, 192,130,175,190,185,114,117,143,166,185,114,119,141,166,185,185,63,176, 121,122,171,3,137,124,118,245,226,253,92,2,158,161,156,190,164,253,135, 2,158,162,155,191,163,253,135,4,96,174,103,98,124,0,0,0,0,1,0,186,0,0, 4,100,4,123,0,19,0,54,64,25,3,9,0,3,14,1,6,135,14,17,184,12,188,10,1,2, 8,0,78,13,9,8,11,70,20,16,252,236,50,244,236,49,0,47,60,228,244,196,236, 17,18,23,57,48,180,96,21,207,21,2,1,93,1,17,35,17,52,38,35,34,6,21,17, 35,17,51,21,62,1,51,50,22,4,100,184,124,124,149,172,185,185,66,179,117, 193,198,2,164,253,92,2,158,159,158,190,164,253,135,4,96,174,101,100,239, 0,2,0,113,255,227,4,117,4,123,0,11,0,23,0,74,64,19,6,185,18,0,185,12,184, 18,140,24,9,18,15,81,3,18,21,69,24,16,252,236,244,236,49,0,16,228,244, 236,16,238,48,64,35,63,25,123,0,123,6,127,7,127,8,127,9,127,10,127,11, 123,12,127,13,127,14,127,15,127,16,127,17,123,18,160,25,240,25,17,1,93, 1,34,6,21,20,22,51,50,54,53,52,38,39,50,0,17,16,0,35,34,0,17,16,0,2,115, 148,172,171,149,147,172,172,147,240,1,18,254,238,240,241,254,239,1,17, 3,223,231,201,201,231,232,200,199,233,156,254,200,254,236,254,237,254, 199,1,57,1,19,1,20,1,56,0,0,0,2,0,186,254,86,4,164,4,123,0,16,0,28,0,62, 64,27,26,185,0,14,20,185,5,8,184,14,140,1,189,3,188,29,17,18,11,71,23, 4,0,8,2,70,29,16,252,236,50,50,244,236,49,0,16,228,228,228,244,196,236, 16,196,238,48,64,9,96,30,128,30,160,30,224,30,4,1,93,37,17,35,17,51,21, 62,1,51,50,0,17,16,2,35,34,38,1,52,38,35,34,6,21,20,22,51,50,54,1,115, 185,185,58,177,123,204,0,255,255,204,123,177,2,56,167,146,146,167,167, 146,146,167,168,253,174,6,10,170,100,97,254,188,254,248,254,248,254,188, 97,1,235,203,231,231,203,203,231,231,0,0,0,0,2,0,113,254,86,4,90,4,123, 0,11,0,28,0,62,64,27,3,185,12,15,9,185,24,21,184,15,140,27,189,25,188, 29,24,12,6,8,26,71,0,18,18,69,29,16,252,236,244,236,50,50,49,0,16,228, 228,228,244,196,236,16,198,238,48,64,9,96,30,128,30,160,30,224,30,4,1, 93,1,20,22,51,50,54,53,52,38,35,34,6,1,14,1,35,34,2,17,16,0,51,50,22,23, 53,51,17,35,1,47,167,146,146,168,168,146,146,167,2,115,58,177,124,203, 255,0,255,203,124,177,58,184,184,2,47,203,231,231,203,203,231,231,253, 174,100,97,1,68,1,8,1,8,1,68,97,100,170,249,246,0,0,0,1,0,186,0,0,3,74, 4,123,0,17,0,48,64,20,6,11,7,0,17,11,3,135,14,184,9,188,7,10,6,8,0,8,70, 18,16,252,196,236,50,49,0,47,228,244,236,196,212,204,17,18,57,48,180,80, 19,159,19,2,1,93,1,46,1,35,34,6,21,17,35,17,51,21,62,1,51,50,22,23,3,74, 31,73,44,156,167,185,185,58,186,133,19,46,28,3,180,18,17,203,190,253,178, 4,96,174,102,99,5,5,0,0,0,1,0,111,255,227,3,199,4,123,0,39,0,231,64,60, 13,12,2,14,11,83,31,30,8,9,2,7,10,83,31,31,30,66,10,11,30,31,4,21,0,134, 1,137,4,20,134,21,137,24,185,17,4,185,37,184,17,140,40,30,10,11,31,27, 7,0,82,27,8,14,7,8,20,34,69,40,16,252,196,236,212,236,228,17,18,57,57, 57,57,49,0,16,228,244,236,16,254,245,238,16,245,238,18,23,57,48,75,83, 88,7,16,14,237,17,23,57,7,14,237,17,23,57,89,34,178,0,39,1,1,93,64,109, 28,10,28,11,28,12,46,9,44,10,44,11,44,12,59,9,59,10,59,11,59,12,11,32, 0,32,1,36,2,40,10,40,11,42,19,47,20,47,21,42,22,40,30,40,31,41,32,41,33, 36,39,134,10,134,11,134,12,134,13,18,0,0,0,1,2,2,6,10,6,11,3,12,3,13,3, 14,3,15,3,16,3,25,3,26,3,27,3,28,4,29,9,39,47,41,63,41,95,41,127,41,128, 41,144,41,160,41,240,41,24,93,0,93,113,1,21,46,1,35,34,6,21,20,22,31,1, 30,1,21,20,6,35,34,38,39,53,30,1,51,50,54,53,52,38,47,1,46,1,53,52,54, 51,50,22,3,139,78,168,90,137,137,98,148,63,196,165,247,216,90,195,108, 102,198,97,130,140,101,171,64,171,152,224,206,102,180,4,63,174,40,40,84, 84,64,73,33,14,42,153,137,156,182,35,35,190,53,53,89,81,75,80,37,15,36, 149,130,158,172,30,0,0,0,0,1,0,55,0,0,2,242,5,158,0,19,0,56,64,25,14,5, 8,15,3,169,0,17,1,188,8,135,10,11,8,9,2,4,0,8,16,18,14,70,20,16,252,60, 196,252,60,196,50,57,57,49,0,47,236,244,60,196,236,50,17,57,57,48,178, 175,21,1,1,93,1,17,33,21,33,17,20,22,59,1,21,35,34,38,53,17,35,53,51,17, 1,119,1,123,254,133,75,115,189,189,213,162,135,135,5,158,254,194,143,253, 160,137,78,154,159,210,2,96,143,1,62,0,0,0,0,2,0,174,255,227,4,88,4,123, 0,19,0,20,0,59,64,28,3,9,0,3,14,1,6,135,14,17,140,10,1,188,20,184,12,13, 9,8,20,11,78,2,8,0,70,21,16,252,236,244,57,236,50,49,0,47,228,228,50,244, 196,236,17,18,23,57,48,180,111,21,192,21,2,1,93,19,17,51,17,20,22,51,50, 54,53,17,51,17,35,53,14,1,35,34,38,1,174,184,124,124,149,173,184,184,67, 177,117,193,200,1,207,1,186,2,166,253,97,159,159,190,164,2,123,251,160, 172,102,99,240,3,168,0,0,1,0,61,0,0,4,127,4,96,0,6,0,251,64,39,3,17,4, 5,4,2,17,1,2,5,5,4,2,17,3,2,6,0,6,1,17,0,0,6,66,2,3,0,191,5,6,5,3,2,1, 5,4,0,7,16,212,75,176,10,84,88,185,0,0,0,64,56,89,75,176,20,84,75,176, 21,84,91,88,185,0,0,255,192,56,89,196,23,57,49,0,47,236,50,57,48,75,83, 88,7,16,5,237,7,16,8,237,7,16,8,237,7,16,5,237,89,34,1,64,142,72,2,106, 2,123,2,127,2,134,2,128,2,145,2,164,2,8,6,0,6,1,9,3,9,4,21,0,21,1,26,3, 26,4,38,0,38,1,41,3,41,4,32,8,53,0,53,1,58,3,58,4,48,8,70,0,70,1,73,3, 73,4,70,5,72,6,64,8,86,0,86,1,89,3,89,4,80,8,102,0,102,1,105,3,105,4,103, 5,104,6,96,8,117,0,116,1,123,3,123,4,117,5,122,6,133,0,133,1,137,3,137, 4,137,5,134,6,150,0,150,1,151,2,154,3,152,4,152,5,151,6,168,5,167,6,176, 8,192,8,223,8,255,8,62,93,0,93,19,51,9,1,51,1,35,61,195,1,94,1,94,195, 254,92,250,4,96,252,84,3,172,251,160,0,0,0,1,0,86,0,0,6,53,4,96,0,12,1, 235,64,73,5,85,6,5,9,10,9,4,85,10,9,3,85,10,11,10,2,85,1,2,11,11,10,6, 17,7,8,7,5,17,4,5,8,8,7,2,17,3,2,12,0,12,1,17,0,0,12,66,10,5,2,3,6,3,0, 191,11,8,12,11,10,9,8,6,5,4,3,2,1,11,7,0,13,16,212,75,176,10,84,75,176, 17,84,91,75,176,18,84,91,75,176,19,84,91,75,176,11,84,91,88,185,0,0,0, 64,56,89,1,75,176,12,84,75,176,13,84,91,75,176,16,84,91,88,185,0,0,255, 192,56,89,204,23,57,49,0,47,60,236,50,50,23,57,48,75,83,88,7,16,5,237, 7,16,8,237,7,16,8,237,7,16,5,237,7,16,8,237,7,16,5,237,7,5,237,7,16,8, 237,89,34,1,64,255,5,2,22,2,22,5,34,10,53,10,73,2,73,5,70,10,64,10,91, 2,91,5,85,10,80,10,110,2,110,5,102,10,121,2,127,2,121,5,127,5,135,2,153, 2,152,5,148,10,188,2,188,5,206,2,199,3,207,5,29,5,2,9,3,6,4,11,5,10,8, 11,9,4,11,5,12,21,2,25,3,22,4,26,5,27,8,27,9,20,11,21,12,37,0,37,1,35, 2,39,3,33,4,37,5,34,6,34,7,37,8,39,9,36,10,33,11,35,12,57,3,54,4,54,8, 57,12,48,14,70,2,72,3,70,4,64,4,66,5,64,6,64,7,64,8,68,9,68,10,68,11,64, 14,64,14,86,0,86,1,86,2,80,4,81,5,82,6,82,7,80,8,83,9,84,10,85,11,99,0, 100,1,101,2,106,3,101,4,106,5,106,6,106,7,110,9,97,11,103,12,111,14,117, 0,117,1,121,2,125,3,120,4,125,5,122,6,127,6,122,7,127,7,120,8,121,9,127, 9,123,10,118,11,125,12,135,2,136,5,143,14,151,0,151,1,148,2,147,3,156, 4,155,5,152,6,152,7,153,8,64,47,150,12,159,14,166,0,166,1,164,2,164,3, 171,4,171,5,169,6,169,7,171,8,164,12,175,14,181,2,177,3,189,4,187,5,184, 9,191,14,196,2,195,3,204,4,202,5,121,93,0,93,19,51,27,1,51,27,1,51,1,35, 11,1,35,86,184,230,229,217,230,229,184,254,219,217,241,242,217,4,96,252, 150,3,106,252,150,3,106,251,160,3,150,252,106,0,1,0,59,0,0,4,121,4,96, 0,11,1,67,64,70,5,17,6,7,6,4,17,3,4,7,7,6,4,17,5,4,1,2,1,3,17,2,2,1,11, 17,0,1,0,10,17,9,10,1,1,0,10,17,11,10,7,8,7,9,17,8,8,7,66,10,7,4,1,4,8, 0,191,5,2,10,7,4,1,4,8,0,2,8,6,12,16,212,75,176,10,84,75,176,15,84,91, 75,176,16,84,91,75,176,17,84,91,88,185,0,6,0,64,56,89,75,176,20,84,88, 185,0,6,255,192,56,89,196,212,196,17,23,57,49,0,47,60,236,50,23,57,48, 75,83,88,7,16,5,237,7,16,8,237,7,16,8,237,7,16,5,237,7,16,5,237,7,16,8, 237,7,16,8,237,7,16,5,237,89,34,1,64,152,10,4,4,10,26,4,21,10,38,10,61, 4,49,10,85,4,87,7,88,10,102,10,118,1,122,4,118,7,116,10,141,4,130,10,153, 4,159,4,151,7,146,10,144,10,166,1,169,4,175,4,165,7,163,10,160,10,28,10, 3,4,5,5,9,10,11,26,3,21,5,21,9,26,11,41,3,38,5,37,9,42,11,32,13,58,1,57, 3,55,5,52,7,54,9,57,11,48,13,73,3,70,5,69,9,74,11,64,13,89,0,86,1,89,2, 89,3,87,5,86,6,89,7,86,8,86,9,89,11,80,13,111,13,120,1,127,13,155,1,148, 7,171,1,164,7,176,13,207,13,223,13,255,13,47,93,0,93,9,2,35,9,1,35,9,1, 51,9,1,4,100,254,107,1,170,217,254,186,254,186,217,1,179,254,114,217,1, 41,1,41,4,96,253,223,253,193,1,184,254,72,2,74,2,22,254,113,1,143,0,0, 1,0,61,254,86,4,127,4,96,0,15,1,139,64,67,7,8,2,9,17,0,15,10,17,11,10, 0,0,15,14,17,15,0,15,13,17,12,13,0,0,15,13,17,14,13,10,11,10,12,17,11, 11,10,66,13,11,9,16,0,11,5,135,3,189,14,11,188,16,14,13,12,10,9,6,3,0, 8,15,4,15,11,16,16,212,75,176,10,84,75,176,8,84,91,88,185,0,11,0,64,56, 89,75,176,20,84,88,185,0,11,255,192,56,89,196,196,17,23,57,49,0,16,228, 50,244,236,17,57,17,57,18,57,48,75,83,88,7,16,5,237,7,16,8,237,7,16,8, 237,7,16,5,237,7,16,8,237,7,5,237,23,50,89,34,1,64,240,6,0,5,8,6,9,3,13, 22,10,23,13,16,13,35,13,53,13,73,10,79,10,78,13,90,9,90,10,106,10,135, 13,128,13,147,13,18,10,0,10,9,6,11,5,12,11,14,11,15,23,1,21,2,16,4,16, 5,23,10,20,11,20,12,26,14,26,15,39,0,36,1,36,2,32,4,32,5,41,8,40,9,37, 10,36,11,36,12,39,13,42,14,42,15,32,17,55,0,53,1,53,2,48,4,48,5,56,10, 54,11,54,12,56,13,57,14,57,15,48,17,65,0,64,1,64,2,64,3,64,4,64,5,64,6, 64,7,64,8,66,9,69,10,71,13,73,14,73,15,64,17,84,0,81,1,81,2,85,3,80,4, 80,5,86,6,85,7,86,8,87,9,87,10,85,11,85,12,89,14,89,15,80,17,102,1,102, 2,104,10,105,14,105,15,96,17,123,8,120,14,120,15,137,0,138,9,133,11,133, 12,137,13,137,14,137,15,153,9,149,11,149,12,154,14,154,15,164,11,164,12, 171,14,171,15,176,17,207,17,223,17,255,17,101,93,0,93,5,14,1,43,1,53,51, 50,54,63,1,1,51,9,1,51,2,147,78,148,124,147,108,76,84,51,33,254,59,195, 1,94,1,94,195,104,200,122,154,72,134,84,4,78,252,148,3,108,0,0,0,0,1,0, 88,0,0,3,219,4,96,0,9,0,157,64,26,8,17,2,3,2,3,17,7,8,7,66,8,169,0,188, 3,169,5,8,3,1,0,4,1,6,10,16,220,75,176,11,84,75,176,12,84,91,88,185,0, 6,255,192,56,89,75,176,19,84,88,185,0,6,0,64,56,89,196,50,196,17,57,57, 49,0,47,236,244,236,48,75,83,88,7,16,5,237,7,16,5,237,89,34,1,64,66,5, 2,22,2,38,2,71,2,73,7,5,11,8,15,11,24,3,27,8,43,8,32,11,54,3,57,8,48,11, 64,1,64,2,69,3,64,4,64,5,67,8,87,3,89,8,95,11,96,1,96,2,102,3,96,4,96, 5,98,8,127,11,128,11,175,11,27,93,0,93,19,33,21,1,33,21,33,53,1,33,113, 3,106,253,76,2,180,252,125,2,180,253,101,4,96,168,252,219,147,168,3,37, 0,0,1,1,0,254,178,4,23,6,20,0,36,0,119,64,52,25,15,21,11,6,37,9,26,16, 21,29,11,5,32,33,3,0,11,169,9,0,169,1,192,9,21,169,19,177,37,12,9,10,5, 36,22,25,0,29,10,5,19,2,20,0,32,25,67,10,15,5,37,16,212,75,176,12,84,88, 185,0,5,0,64,56,89,60,196,252,60,196,50,57,57,17,18,57,17,18,57,57,17, 18,57,57,49,0,16,252,236,196,244,236,16,238,18,23,57,18,57,17,57,57,17, 18,57,17,18,57,57,48,1,178,0,38,1,93,5,21,35,34,38,61,1,52,38,43,1,53, 51,50,54,61,1,52,54,59,1,21,35,34,6,29,1,20,6,7,30,1,29,1,20,22,51,4,23, 62,249,169,108,142,61,61,143,107,169,249,62,68,141,86,91,110,111,90,86, 141,190,144,148,221,239,151,116,143,115,149,240,221,147,143,88,141,248, 157,142,25,27,142,156,248,141,88,0,0,1,1,0,254,178,4,23,6,20,0,36,0,135, 64,54,31,37,27,22,12,15,8,27,11,21,25,15,4,5,32,3,0,25,169,27,0,169,35, 192,27,15,169,17,177,37,28,25,26,21,15,1,4,0,8,26,21,35,18,4,0,26,31,21, 67,16,0,11,4,37,16,212,75,176,10,84,88,185,0,4,255,192,56,89,75,176,14, 84,88,185,0,4,0,64,56,89,60,196,50,252,60,196,17,18,57,57,17,18,57,17, 18,57,57,17,18,57,57,49,0,16,252,236,196,244,236,16,238,18,23,57,17,18, 57,57,17,57,17,57,57,17,18,57,48,1,178,0,38,1,93,5,51,50,54,61,1,52,54, 55,46,1,61,1,52,38,43,1,53,51,50,22,29,1,20,22,59,1,21,35,34,6,29,1,20, 6,43,1,1,0,70,140,85,90,111,111,90,85,140,70,63,249,167,108,142,62,62, 142,108,167,249,63,190,86,143,248,156,142,27,25,142,157,248,142,87,143, 147,221,240,149,115,143,116,151,239,221,148,0,0,3,1,27,0,0,6,229,5,205, 0,23,0,47,0,73,0,67,64,38,61,203,62,58,204,65,202,36,49,203,48,52,204, 71,202,24,201,0,200,36,201,12,55,97,68,61,48,94,42,9,6,68,94,30,9,6,18, 74,16,220,204,252,236,16,254,237,50,16,238,49,0,47,238,246,254,253,238, 214,238,16,253,238,214,238,48,1,50,4,23,22,18,21,20,2,7,6,4,35,34,36,39, 38,2,53,52,18,55,54,36,23,34,6,7,14,1,21,20,22,23,30,1,51,50,54,55,62, 1,53,52,38,39,46,1,23,21,46,1,35,34,6,21,20,22,51,50,54,55,21,14,1,35, 34,38,53,52,54,51,50,22,4,0,152,1,7,109,109,108,108,109,109,254,249,152, 152,254,249,109,109,108,108,109,109,1,7,152,131,226,94,94,96,96,94,94, 226,131,132,227,94,93,93,94,92,94,227,167,66,130,66,149,167,171,155,64, 122,66,67,137,70,216,251,251,216,73,136,5,205,110,109,109,254,250,154, 152,254,251,109,109,110,110,109,109,1,5,152,154,1,6,109,109,110,103,94, 94,94,229,130,129,227,94,94,95,95,94,93,226,131,133,227,93,94,94,245,129, 33,32,175,157,159,174,31,34,127,29,28,244,208,209,242,28,0,0,0,0,1,0,213, 5,98,3,43,5,246,0,3,0,47,183,2,239,0,238,4,1,0,4,16,212,204,49,0,16,252, 236,48,0,75,176,9,84,75,176,14,84,91,88,189,0,4,255,192,0,1,0,4,0,4,0, 64,56,17,55,56,89,19,33,21,33,213,2,86,253,170,5,246,148,0,0,0,0,2,0,195, 3,117,3,61,5,240,0,11,0,26,0,32,64,17,6,195,21,196,0,195,12,145,27,9,90, 18,91,3,90,24,27,16,220,236,252,236,49,0,16,244,236,252,236,48,1,34,6, 21,20,22,51,50,54,53,52,38,39,50,22,23,30,1,21,20,6,35,34,38,53,52,54, 2,0,80,110,110,80,80,110,111,79,64,118,43,46,46,185,134,135,180,184,5, 111,111,80,79,109,109,79,79,112,129,49,46,45,114,66,132,183,180,135,134, 186,0,0,0,0,2,0,217,0,0,5,219,5,4,0,11,0,15,0,46,64,24,5,208,7,3,156,0, 208,9,1,12,156,14,13,2,21,4,0,23,12,8,21,10,6,16,16,212,60,236,50,252, 60,236,50,49,0,47,236,212,60,236,252,60,236,48,1,17,33,21,33,17,35,17, 33,53,33,17,1,33,21,33,3,174,2,45,253,211,168,253,211,2,45,253,211,5,2, 250,254,5,4,254,125,170,254,125,1,131,170,1,131,251,166,170,0,0,0,1,0, 6,255,4,6,33,5,36,0,2,0,0,23,9,1,6,3,13,3,14,252,6,32,249,224,0,0,1,0, 6,0,22,3,254,4,18,0,2,0,0,55,9,1,6,1,252,1,252,22,3,252,252,4,0,0,1,0, 6,255,4,6,33,5,36,0,2,0,0,23,17,1,6,6,27,252,6,32,252,240,0,0,0,0,1,0, 6,255,4,6,33,5,36,0,2,0,0,19,33,1,6,6,27,252,242,5,36,249,224,0,0,0,1, 0,6,0,22,3,254,4,18,0,2,0,0,19,33,1,6,3,248,254,4,4,18,252,4,0,0,0,1,0, 6,255,4,6,33,5,36,0,2,0,0,19,1,17,6,6,27,2,20,3,16,249,224,0,0,0,1,0,112, 255,4,6,139,5,32,0,23,0,19,64,7,6,18,24,25,12,0,24,16,220,212,204,49,0, 16,212,196,48,19,52,55,54,55,54,51,50,23,22,23,22,21,20,7,6,7,6,35,34, 39,38,39,38,112,105,104,182,181,210,209,181,182,104,105,105,104,182,181, 209,210,181,182,104,105,2,18,209,182,181,105,105,105,105,181,182,209,209, 182,181,105,105,105,105,181,182,0,0,0,0,26,1,62,0,1,0,0,0,0,0,0,0,152, 1,50,0,1,0,0,0,0,0,1,0,11,1,227,0,1,0,0,0,0,0,2,0,4,1,249,0,1,0,0,0,0, 0,3,0,11,2,22,0,1,0,0,0,0,0,4,0,11,2,58,0,1,0,0,0,0,0,5,0,12,2,96,0,1, 0,0,0,0,0,6,0,10,2,131,0,1,0,0,0,0,0,8,0,17,2,178,0,1,0,0,0,0,0,11,0,29, 3,0,0,1,0,0,0,0,0,13,18,157,40,90,0,1,0,0,0,0,0,14,0,52,59,98,0,1,0,0, 0,0,0,16,0,11,59,175,0,1,0,0,0,0,0,17,0,4,59,197,0,3,0,1,4,9,0,0,1,48, 0,0,0,3,0,1,4,9,0,1,0,22,1,203,0,3,0,1,4,9,0,2,0,8,1,239,0,3,0,1,4,9,0, 3,0,22,1,254,0,3,0,1,4,9,0,4,0,22,2,34,0,3,0,1,4,9,0,5,0,24,2,70,0,3,0, 1,4,9,0,6,0,20,2,109,0,3,0,1,4,9,0,8,0,34,2,142,0,3,0,1,4,9,0,11,0,58, 2,196,0,3,0,1,4,9,0,13,37,58,3,30,0,3,0,1,4,9,0,14,0,104,58,248,0,3,0, 1,4,9,0,16,0,22,59,151,0,3,0,1,4,9,0,17,0,8,59,187,0,67,0,111,0,112,0, 121,0,114,0,105,0,103,0,104,0,116,0,32,0,40,0,99,0,41,0,32,0,50,0,48,0, 48,0,51,0,32,0,98,0,121,0,32,0,66,0,105,0,116,0,115,0,116,0,114,0,101, 0,97,0,109,0,44,0,32,0,73,0,110,0,99,0,46,0,32,0,65,0,108,0,108,0,32,0, 82,0,105,0,103,0,104,0,116,0,115,0,32,0,82,0,101,0,115,0,101,0,114,0,118, 0,101,0,100,0,46,0,10,0,67,0,111,0,112,0,121,0,114,0,105,0,103,0,104,0, 116,0,32,0,40,0,99,0,41,0,32,0,50,0,48,0,48,0,54,0,32,0,98,0,121,0,32, 0,84,0,97,0,118,0,109,0,106,0,111,0,110,0,103,0,32,0,66,0,97,0,104,0,46, 0,32,0,65,0,108,0,108,0,32,0,82,0,105,0,103,0,104,0,116,0,115,0,32,0,82, 0,101,0,115,0,101,0,114,0,118,0,101,0,100,0,46,0,10,0,68,0,101,0,106,0, 97,0,86,0,117,0,32,0,99,0,104,0,97,0,110,0,103,0,101,0,115,0,32,0,97,0, 114,0,101,0,32,0,105,0,110,0,32,0,112,0,117,0,98,0,108,0,105,0,99,0,32, 0,100,0,111,0,109,0,97,0,105,0,110,0,10,0,0,67,111,112,121,114,105,103, 104,116,32,40,99,41,32,50,48,48,51,32,98,121,32,66,105,116,115,116,114, 101,97,109,44,32,73,110,99,46,32,65,108,108,32,82,105,103,104,116,115, 32,82,101,115,101,114,118,101,100,46,10,67,111,112,121,114,105,103,104, 116,32,40,99,41,32,50,48,48,54,32,98,121,32,84,97,118,109,106,111,110, 103,32,66,97,104,46,32,65,108,108,32,82,105,103,104,116,115,32,82,101, 115,101,114,118,101,100,46,10,68,101,106,97,86,117,32,99,104,97,110,103, 101,115,32,97,114,101,32,105,110,32,112,117,98,108,105,99,32,100,111,109, 97,105,110,10,0,0,68,0,101,0,106,0,97,0,86,0,117,0,32,0,83,0,97,0,110, 0,115,0,0,68,101,106,97,86,117,32,83,97,110,115,0,0,66,0,111,0,111,0,107, 0,0,66,111,111,107,0,0,68,0,101,0,106,0,97,0,86,0,117,0,32,0,83,0,97,0, 110,0,115,0,0,68,101,106,97,86,117,32,83,97,110,115,0,0,68,0,101,0,106, 0,97,0,86,0,117,0,32,0,83,0,97,0,110,0,115,0,0,68,101,106,97,86,117,32, 83,97,110,115,0,0,86,0,101,0,114,0,115,0,105,0,111,0,110,0,32,0,50,0,46, 0,51,0,53,0,0,86,101,114,115,105,111,110,32,50,46,51,53,0,0,68,0,101,0, 106,0,97,0,86,0,117,0,83,0,97,0,110,0,115,0,0,68,101,106,97,86,117,83, 97,110,115,0,0,68,0,101,0,106,0,97,0,86,0,117,0,32,0,102,0,111,0,110,0, 116,0,115,0,32,0,116,0,101,0,97,0,109,0,0,68,101,106,97,86,117,32,102, 111,110,116,115,32,116,101,97,109,0,0,104,0,116,0,116,0,112,0,58,0,47, 0,47,0,100,0,101,0,106,0,97,0,118,0,117,0,46,0,115,0,111,0,117,0,114,0, 99,0,101,0,102,0,111,0,114,0,103,0,101,0,46,0,110,0,101,0,116,0,0,104, 116,116,112,58,47,47,100,101,106,97,118,117,46,115,111,117,114,99,101, 102,111,114,103,101,46,110,101,116,0,0,70,0,111,0,110,0,116,0,115,0,32, 0,97,0,114,0,101,0,32,0,40,0,99,0,41,0,32,0,66,0,105,0,116,0,115,0,116, 0,114,0,101,0,97,0,109,0,32,0,40,0,115,0,101,0,101,0,32,0,98,0,101,0,108, 0,111,0,119,0,41,0,46,0,32,0,68,0,101,0,106,0,97,0,86,0,117,0,32,0,99, 0,104,0,97,0,110,0,103,0,101,0,115,0,32,0,97,0,114,0,101,0,32,0,105,0, 110,0,32,0,112,0,117,0,98,0,108,0,105,0,99,0,32,0,100,0,111,0,109,0,97, 0,105,0,110,0,46,0,32,0,71,0,108,0,121,0,112,0,104,0,115,0,32,0,105,0, 109,0,112,0,111,0,114,0,116,0,101,0,100,0,32,0,102,0,114,0,111,0,109,0, 32,0,65,0,114,0,101,0,118,0,32,0,102,0,111,0,110,0,116,0,115,0,32,0,97, 0,114,0,101,0,32,0,40,0,99,0,41,0,32,0,84,0,97,0,118,0,109,0,106,0,117, 0,110,0,103,0,32,0,66,0,97,0,104,0,32,0,40,0,115,0,101,0,101,0,32,0,98, 0,101,0,108,0,111,0,119,0,41,0,10,0,10,0,66,0,105,0,116,0,115,0,116,0, 114,0,101,0,97,0,109,0,32,0,86,0,101,0,114,0,97,0,32,0,70,0,111,0,110, 0,116,0,115,0,32,0,67,0,111,0,112,0,121,0,114,0,105,0,103,0,104,0,116, 0,10,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45, 0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45, 0,45,0,45,0,45,0,10,0,10,0,67,0,111,0,112,0,121,0,114,0,105,0,103,0,104, 0,116,0,32,0,40,0,99,0,41,0,32,0,50,0,48,0,48,0,51,0,32,0,98,0,121,0,32, 0,66,0,105,0,116,0,115,0,116,0,114,0,101,0,97,0,109,0,44,0,32,0,73,0,110, 0,99,0,46,0,32,0,65,0,108,0,108,0,32,0,82,0,105,0,103,0,104,0,116,0,115, 0,32,0,82,0,101,0,115,0,101,0,114,0,118,0,101,0,100,0,46,0,32,0,66,0,105, 0,116,0,115,0,116,0,114,0,101,0,97,0,109,0,32,0,86,0,101,0,114,0,97,0, 32,0,105,0,115,0,10,0,97,0,32,0,116,0,114,0,97,0,100,0,101,0,109,0,97, 0,114,0,107,0,32,0,111,0,102,0,32,0,66,0,105,0,116,0,115,0,116,0,114,0, 101,0,97,0,109,0,44,0,32,0,73,0,110,0,99,0,46,0,10,0,10,0,80,0,101,0,114, 0,109,0,105,0,115,0,115,0,105,0,111,0,110,0,32,0,105,0,115,0,32,0,104, 0,101,0,114,0,101,0,98,0,121,0,32,0,103,0,114,0,97,0,110,0,116,0,101,0, 100,0,44,0,32,0,102,0,114,0,101,0,101,0,32,0,111,0,102,0,32,0,99,0,104, 0,97,0,114,0,103,0,101,0,44,0,32,0,116,0,111,0,32,0,97,0,110,0,121,0,32, 0,112,0,101,0,114,0,115,0,111,0,110,0,32,0,111,0,98,0,116,0,97,0,105,0, 110,0,105,0,110,0,103,0,32,0,97,0,32,0,99,0,111,0,112,0,121,0,10,0,111, 0,102,0,32,0,116,0,104,0,101,0,32,0,102,0,111,0,110,0,116,0,115,0,32,0, 97,0,99,0,99,0,111,0,109,0,112,0,97,0,110,0,121,0,105,0,110,0,103,0,32, 0,116,0,104,0,105,0,115,0,32,0,108,0,105,0,99,0,101,0,110,0,115,0,101, 0,32,0,40,0,34,0,70,0,111,0,110,0,116,0,115,0,34,0,41,0,32,0,97,0,110, 0,100,0,32,0,97,0,115,0,115,0,111,0,99,0,105,0,97,0,116,0,101,0,100,0, 10,0,100,0,111,0,99,0,117,0,109,0,101,0,110,0,116,0,97,0,116,0,105,0,111, 0,110,0,32,0,102,0,105,0,108,0,101,0,115,0,32,0,40,0,116,0,104,0,101,0, 32,0,34,0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97, 0,114,0,101,0,34,0,41,0,44,0,32,0,116,0,111,0,32,0,114,0,101,0,112,0,114, 0,111,0,100,0,117,0,99,0,101,0,32,0,97,0,110,0,100,0,32,0,100,0,105,0, 115,0,116,0,114,0,105,0,98,0,117,0,116,0,101,0,32,0,116,0,104,0,101,0, 10,0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114, 0,101,0,44,0,32,0,105,0,110,0,99,0,108,0,117,0,100,0,105,0,110,0,103,0, 32,0,119,0,105,0,116,0,104,0,111,0,117,0,116,0,32,0,108,0,105,0,109,0, 105,0,116,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,104,0,101,0,32,0,114, 0,105,0,103,0,104,0,116,0,115,0,32,0,116,0,111,0,32,0,117,0,115,0,101, 0,44,0,32,0,99,0,111,0,112,0,121,0,44,0,32,0,109,0,101,0,114,0,103,0,101, 0,44,0,10,0,112,0,117,0,98,0,108,0,105,0,115,0,104,0,44,0,32,0,100,0,105, 0,115,0,116,0,114,0,105,0,98,0,117,0,116,0,101,0,44,0,32,0,97,0,110,0, 100,0,47,0,111,0,114,0,32,0,115,0,101,0,108,0,108,0,32,0,99,0,111,0,112, 0,105,0,101,0,115,0,32,0,111,0,102,0,32,0,116,0,104,0,101,0,32,0,70,0, 111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,44, 0,32,0,97,0,110,0,100,0,32,0,116,0,111,0,32,0,112,0,101,0,114,0,109,0, 105,0,116,0,10,0,112,0,101,0,114,0,115,0,111,0,110,0,115,0,32,0,116,0, 111,0,32,0,119,0,104,0,111,0,109,0,32,0,116,0,104,0,101,0,32,0,70,0,111, 0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,32,0, 105,0,115,0,32,0,102,0,117,0,114,0,110,0,105,0,115,0,104,0,101,0,100,0, 32,0,116,0,111,0,32,0,100,0,111,0,32,0,115,0,111,0,44,0,32,0,115,0,117, 0,98,0,106,0,101,0,99,0,116,0,32,0,116,0,111,0,32,0,116,0,104,0,101,0, 10,0,102,0,111,0,108,0,108,0,111,0,119,0,105,0,110,0,103,0,32,0,99,0,111, 0,110,0,100,0,105,0,116,0,105,0,111,0,110,0,115,0,58,0,10,0,10,0,84,0, 104,0,101,0,32,0,97,0,98,0,111,0,118,0,101,0,32,0,99,0,111,0,112,0,121, 0,114,0,105,0,103,0,104,0,116,0,32,0,97,0,110,0,100,0,32,0,116,0,114,0, 97,0,100,0,101,0,109,0,97,0,114,0,107,0,32,0,110,0,111,0,116,0,105,0,99, 0,101,0,115,0,32,0,97,0,110,0,100,0,32,0,116,0,104,0,105,0,115,0,32,0, 112,0,101,0,114,0,109,0,105,0,115,0,115,0,105,0,111,0,110,0,32,0,110,0, 111,0,116,0,105,0,99,0,101,0,32,0,115,0,104,0,97,0,108,0,108,0,10,0,98, 0,101,0,32,0,105,0,110,0,99,0,108,0,117,0,100,0,101,0,100,0,32,0,105,0, 110,0,32,0,97,0,108,0,108,0,32,0,99,0,111,0,112,0,105,0,101,0,115,0,32, 0,111,0,102,0,32,0,111,0,110,0,101,0,32,0,111,0,114,0,32,0,109,0,111,0, 114,0,101,0,32,0,111,0,102,0,32,0,116,0,104,0,101,0,32,0,70,0,111,0,110, 0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,32,0,116,0, 121,0,112,0,101,0,102,0,97,0,99,0,101,0,115,0,46,0,10,0,10,0,84,0,104, 0,101,0,32,0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0, 97,0,114,0,101,0,32,0,109,0,97,0,121,0,32,0,98,0,101,0,32,0,109,0,111, 0,100,0,105,0,102,0,105,0,101,0,100,0,44,0,32,0,97,0,108,0,116,0,101,0, 114,0,101,0,100,0,44,0,32,0,111,0,114,0,32,0,97,0,100,0,100,0,101,0,100, 0,32,0,116,0,111,0,44,0,32,0,97,0,110,0,100,0,32,0,105,0,110,0,32,0,112, 0,97,0,114,0,116,0,105,0,99,0,117,0,108,0,97,0,114,0,10,0,116,0,104,0, 101,0,32,0,100,0,101,0,115,0,105,0,103,0,110,0,115,0,32,0,111,0,102,0, 32,0,103,0,108,0,121,0,112,0,104,0,115,0,32,0,111,0,114,0,32,0,99,0,104, 0,97,0,114,0,97,0,99,0,116,0,101,0,114,0,115,0,32,0,105,0,110,0,32,0,116, 0,104,0,101,0,32,0,70,0,111,0,110,0,116,0,115,0,32,0,109,0,97,0,121,0, 32,0,98,0,101,0,32,0,109,0,111,0,100,0,105,0,102,0,105,0,101,0,100,0,32, 0,97,0,110,0,100,0,10,0,97,0,100,0,100,0,105,0,116,0,105,0,111,0,110,0, 97,0,108,0,32,0,103,0,108,0,121,0,112,0,104,0,115,0,32,0,111,0,114,0,32, 0,99,0,104,0,97,0,114,0,97,0,99,0,116,0,101,0,114,0,115,0,32,0,109,0,97, 0,121,0,32,0,98,0,101,0,32,0,97,0,100,0,100,0,101,0,100,0,32,0,116,0,111, 0,32,0,116,0,104,0,101,0,32,0,70,0,111,0,110,0,116,0,115,0,44,0,32,0,111, 0,110,0,108,0,121,0,32,0,105,0,102,0,32,0,116,0,104,0,101,0,32,0,102,0, 111,0,110,0,116,0,115,0,10,0,97,0,114,0,101,0,32,0,114,0,101,0,110,0,97, 0,109,0,101,0,100,0,32,0,116,0,111,0,32,0,110,0,97,0,109,0,101,0,115,0, 32,0,110,0,111,0,116,0,32,0,99,0,111,0,110,0,116,0,97,0,105,0,110,0,105, 0,110,0,103,0,32,0,101,0,105,0,116,0,104,0,101,0,114,0,32,0,116,0,104, 0,101,0,32,0,119,0,111,0,114,0,100,0,115,0,32,0,34,0,66,0,105,0,116,0, 115,0,116,0,114,0,101,0,97,0,109,0,34,0,32,0,111,0,114,0,32,0,116,0,104, 0,101,0,32,0,119,0,111,0,114,0,100,0,10,0,34,0,86,0,101,0,114,0,97,0,34, 0,46,0,10,0,10,0,84,0,104,0,105,0,115,0,32,0,76,0,105,0,99,0,101,0,110, 0,115,0,101,0,32,0,98,0,101,0,99,0,111,0,109,0,101,0,115,0,32,0,110,0, 117,0,108,0,108,0,32,0,97,0,110,0,100,0,32,0,118,0,111,0,105,0,100,0,32, 0,116,0,111,0,32,0,116,0,104,0,101,0,32,0,101,0,120,0,116,0,101,0,110, 0,116,0,32,0,97,0,112,0,112,0,108,0,105,0,99,0,97,0,98,0,108,0,101,0,32, 0,116,0,111,0,32,0,70,0,111,0,110,0,116,0,115,0,32,0,111,0,114,0,32,0, 70,0,111,0,110,0,116,0,10,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101, 0,32,0,116,0,104,0,97,0,116,0,32,0,104,0,97,0,115,0,32,0,98,0,101,0,101, 0,110,0,32,0,109,0,111,0,100,0,105,0,102,0,105,0,101,0,100,0,32,0,97,0, 110,0,100,0,32,0,105,0,115,0,32,0,100,0,105,0,115,0,116,0,114,0,105,0, 98,0,117,0,116,0,101,0,100,0,32,0,117,0,110,0,100,0,101,0,114,0,32,0,116, 0,104,0,101,0,32,0,34,0,66,0,105,0,116,0,115,0,116,0,114,0,101,0,97,0, 109,0,10,0,86,0,101,0,114,0,97,0,34,0,32,0,110,0,97,0,109,0,101,0,115, 0,46,0,10,0,10,0,84,0,104,0,101,0,32,0,70,0,111,0,110,0,116,0,32,0,83, 0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,32,0,109,0,97,0,121,0,32,0, 98,0,101,0,32,0,115,0,111,0,108,0,100,0,32,0,97,0,115,0,32,0,112,0,97, 0,114,0,116,0,32,0,111,0,102,0,32,0,97,0,32,0,108,0,97,0,114,0,103,0,101, 0,114,0,32,0,115,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,32,0,112,0, 97,0,99,0,107,0,97,0,103,0,101,0,32,0,98,0,117,0,116,0,32,0,110,0,111, 0,10,0,99,0,111,0,112,0,121,0,32,0,111,0,102,0,32,0,111,0,110,0,101,0, 32,0,111,0,114,0,32,0,109,0,111,0,114,0,101,0,32,0,111,0,102,0,32,0,116, 0,104,0,101,0,32,0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0, 119,0,97,0,114,0,101,0,32,0,116,0,121,0,112,0,101,0,102,0,97,0,99,0,101, 0,115,0,32,0,109,0,97,0,121,0,32,0,98,0,101,0,32,0,115,0,111,0,108,0,100, 0,32,0,98,0,121,0,32,0,105,0,116,0,115,0,101,0,108,0,102,0,46,0,10,0,10, 0,84,0,72,0,69,0,32,0,70,0,79,0,78,0,84,0,32,0,83,0,79,0,70,0,84,0,87, 0,65,0,82,0,69,0,32,0,73,0,83,0,32,0,80,0,82,0,79,0,86,0,73,0,68,0,69, 0,68,0,32,0,34,0,65,0,83,0,32,0,73,0,83,0,34,0,44,0,32,0,87,0,73,0,84, 0,72,0,79,0,85,0,84,0,32,0,87,0,65,0,82,0,82,0,65,0,78,0,84,0,89,0,32, 0,79,0,70,0,32,0,65,0,78,0,89,0,32,0,75,0,73,0,78,0,68,0,44,0,32,0,69, 0,88,0,80,0,82,0,69,0,83,0,83,0,10,0,79,0,82,0,32,0,73,0,77,0,80,0,76, 0,73,0,69,0,68,0,44,0,32,0,73,0,78,0,67,0,76,0,85,0,68,0,73,0,78,0,71, 0,32,0,66,0,85,0,84,0,32,0,78,0,79,0,84,0,32,0,76,0,73,0,77,0,73,0,84, 0,69,0,68,0,32,0,84,0,79,0,32,0,65,0,78,0,89,0,32,0,87,0,65,0,82,0,82, 0,65,0,78,0,84,0,73,0,69,0,83,0,32,0,79,0,70,0,32,0,77,0,69,0,82,0,67, 0,72,0,65,0,78,0,84,0,65,0,66,0,73,0,76,0,73,0,84,0,89,0,44,0,10,0,70, 0,73,0,84,0,78,0,69,0,83,0,83,0,32,0,70,0,79,0,82,0,32,0,65,0,32,0,80, 0,65,0,82,0,84,0,73,0,67,0,85,0,76,0,65,0,82,0,32,0,80,0,85,0,82,0,80, 0,79,0,83,0,69,0,32,0,65,0,78,0,68,0,32,0,78,0,79,0,78,0,73,0,78,0,70, 0,82,0,73,0,78,0,71,0,69,0,77,0,69,0,78,0,84,0,32,0,79,0,70,0,32,0,67, 0,79,0,80,0,89,0,82,0,73,0,71,0,72,0,84,0,44,0,32,0,80,0,65,0,84,0,69, 0,78,0,84,0,44,0,10,0,84,0,82,0,65,0,68,0,69,0,77,0,65,0,82,0,75,0,44, 0,32,0,79,0,82,0,32,0,79,0,84,0,72,0,69,0,82,0,32,0,82,0,73,0,71,0,72, 0,84,0,46,0,32,0,73,0,78,0,32,0,78,0,79,0,32,0,69,0,86,0,69,0,78,0,84, 0,32,0,83,0,72,0,65,0,76,0,76,0,32,0,66,0,73,0,84,0,83,0,84,0,82,0,69, 0,65,0,77,0,32,0,79,0,82,0,32,0,84,0,72,0,69,0,32,0,71,0,78,0,79,0,77, 0,69,0,10,0,70,0,79,0,85,0,78,0,68,0,65,0,84,0,73,0,79,0,78,0,32,0,66, 0,69,0,32,0,76,0,73,0,65,0,66,0,76,0,69,0,32,0,70,0,79,0,82,0,32,0,65, 0,78,0,89,0,32,0,67,0,76,0,65,0,73,0,77,0,44,0,32,0,68,0,65,0,77,0,65, 0,71,0,69,0,83,0,32,0,79,0,82,0,32,0,79,0,84,0,72,0,69,0,82,0,32,0,76, 0,73,0,65,0,66,0,73,0,76,0,73,0,84,0,89,0,44,0,32,0,73,0,78,0,67,0,76, 0,85,0,68,0,73,0,78,0,71,0,10,0,65,0,78,0,89,0,32,0,71,0,69,0,78,0,69, 0,82,0,65,0,76,0,44,0,32,0,83,0,80,0,69,0,67,0,73,0,65,0,76,0,44,0,32, 0,73,0,78,0,68,0,73,0,82,0,69,0,67,0,84,0,44,0,32,0,73,0,78,0,67,0,73, 0,68,0,69,0,78,0,84,0,65,0,76,0,44,0,32,0,79,0,82,0,32,0,67,0,79,0,78, 0,83,0,69,0,81,0,85,0,69,0,78,0,84,0,73,0,65,0,76,0,32,0,68,0,65,0,77, 0,65,0,71,0,69,0,83,0,44,0,10,0,87,0,72,0,69,0,84,0,72,0,69,0,82,0,32, 0,73,0,78,0,32,0,65,0,78,0,32,0,65,0,67,0,84,0,73,0,79,0,78,0,32,0,79, 0,70,0,32,0,67,0,79,0,78,0,84,0,82,0,65,0,67,0,84,0,44,0,32,0,84,0,79, 0,82,0,84,0,32,0,79,0,82,0,32,0,79,0,84,0,72,0,69,0,82,0,87,0,73,0,83, 0,69,0,44,0,32,0,65,0,82,0,73,0,83,0,73,0,78,0,71,0,32,0,70,0,82,0,79, 0,77,0,44,0,32,0,79,0,85,0,84,0,32,0,79,0,70,0,10,0,84,0,72,0,69,0,32, 0,85,0,83,0,69,0,32,0,79,0,82,0,32,0,73,0,78,0,65,0,66,0,73,0,76,0,73, 0,84,0,89,0,32,0,84,0,79,0,32,0,85,0,83,0,69,0,32,0,84,0,72,0,69,0,32, 0,70,0,79,0,78,0,84,0,32,0,83,0,79,0,70,0,84,0,87,0,65,0,82,0,69,0,32, 0,79,0,82,0,32,0,70,0,82,0,79,0,77,0,32,0,79,0,84,0,72,0,69,0,82,0,32, 0,68,0,69,0,65,0,76,0,73,0,78,0,71,0,83,0,32,0,73,0,78,0,32,0,84,0,72, 0,69,0,10,0,70,0,79,0,78,0,84,0,32,0,83,0,79,0,70,0,84,0,87,0,65,0,82, 0,69,0,46,0,10,0,10,0,69,0,120,0,99,0,101,0,112,0,116,0,32,0,97,0,115, 0,32,0,99,0,111,0,110,0,116,0,97,0,105,0,110,0,101,0,100,0,32,0,105,0, 110,0,32,0,116,0,104,0,105,0,115,0,32,0,110,0,111,0,116,0,105,0,99,0,101, 0,44,0,32,0,116,0,104,0,101,0,32,0,110,0,97,0,109,0,101,0,115,0,32,0,111, 0,102,0,32,0,71,0,110,0,111,0,109,0,101,0,44,0,32,0,116,0,104,0,101,0, 32,0,71,0,110,0,111,0,109,0,101,0,10,0,70,0,111,0,117,0,110,0,100,0,97, 0,116,0,105,0,111,0,110,0,44,0,32,0,97,0,110,0,100,0,32,0,66,0,105,0,116, 0,115,0,116,0,114,0,101,0,97,0,109,0,32,0,73,0,110,0,99,0,46,0,44,0,32, 0,115,0,104,0,97,0,108,0,108,0,32,0,110,0,111,0,116,0,32,0,98,0,101,0, 32,0,117,0,115,0,101,0,100,0,32,0,105,0,110,0,32,0,97,0,100,0,118,0,101, 0,114,0,116,0,105,0,115,0,105,0,110,0,103,0,32,0,111,0,114,0,10,0,111, 0,116,0,104,0,101,0,114,0,119,0,105,0,115,0,101,0,32,0,116,0,111,0,32, 0,112,0,114,0,111,0,109,0,111,0,116,0,101,0,32,0,116,0,104,0,101,0,32, 0,115,0,97,0,108,0,101,0,44,0,32,0,117,0,115,0,101,0,32,0,111,0,114,0, 32,0,111,0,116,0,104,0,101,0,114,0,32,0,100,0,101,0,97,0,108,0,105,0,110, 0,103,0,115,0,32,0,105,0,110,0,32,0,116,0,104,0,105,0,115,0,32,0,70,0, 111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,10, 0,119,0,105,0,116,0,104,0,111,0,117,0,116,0,32,0,112,0,114,0,105,0,111, 0,114,0,32,0,119,0,114,0,105,0,116,0,116,0,101,0,110,0,32,0,97,0,117,0, 116,0,104,0,111,0,114,0,105,0,122,0,97,0,116,0,105,0,111,0,110,0,32,0, 102,0,114,0,111,0,109,0,32,0,116,0,104,0,101,0,32,0,71,0,110,0,111,0,109, 0,101,0,32,0,70,0,111,0,117,0,110,0,100,0,97,0,116,0,105,0,111,0,110,0, 32,0,111,0,114,0,32,0,66,0,105,0,116,0,115,0,116,0,114,0,101,0,97,0,109, 0,10,0,73,0,110,0,99,0,46,0,44,0,32,0,114,0,101,0,115,0,112,0,101,0,99, 0,116,0,105,0,118,0,101,0,108,0,121,0,46,0,32,0,70,0,111,0,114,0,32,0, 102,0,117,0,114,0,116,0,104,0,101,0,114,0,32,0,105,0,110,0,102,0,111,0, 114,0,109,0,97,0,116,0,105,0,111,0,110,0,44,0,32,0,99,0,111,0,110,0,116, 0,97,0,99,0,116,0,58,0,32,0,102,0,111,0,110,0,116,0,115,0,32,0,97,0,116, 0,32,0,103,0,110,0,111,0,109,0,101,0,32,0,100,0,111,0,116,0,10,0,111,0, 114,0,103,0,46,0,32,0,10,0,10,0,65,0,114,0,101,0,118,0,32,0,70,0,111,0, 110,0,116,0,115,0,32,0,67,0,111,0,112,0,121,0,114,0,105,0,103,0,104,0, 116,0,10,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0, 45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0,45,0, 45,0,45,0,45,0,45,0,10,0,10,0,67,0,111,0,112,0,121,0,114,0,105,0,103,0, 104,0,116,0,32,0,40,0,99,0,41,0,32,0,50,0,48,0,48,0,54,0,32,0,98,0,121, 0,32,0,84,0,97,0,118,0,109,0,106,0,111,0,110,0,103,0,32,0,66,0,97,0,104, 0,46,0,32,0,65,0,108,0,108,0,32,0,82,0,105,0,103,0,104,0,116,0,115,0,32, 0,82,0,101,0,115,0,101,0,114,0,118,0,101,0,100,0,46,0,10,0,10,0,80,0,101, 0,114,0,109,0,105,0,115,0,115,0,105,0,111,0,110,0,32,0,105,0,115,0,32, 0,104,0,101,0,114,0,101,0,98,0,121,0,32,0,103,0,114,0,97,0,110,0,116,0, 101,0,100,0,44,0,32,0,102,0,114,0,101,0,101,0,32,0,111,0,102,0,32,0,99, 0,104,0,97,0,114,0,103,0,101,0,44,0,32,0,116,0,111,0,32,0,97,0,110,0,121, 0,32,0,112,0,101,0,114,0,115,0,111,0,110,0,32,0,111,0,98,0,116,0,97,0, 105,0,110,0,105,0,110,0,103,0,10,0,97,0,32,0,99,0,111,0,112,0,121,0,32, 0,111,0,102,0,32,0,116,0,104,0,101,0,32,0,102,0,111,0,110,0,116,0,115, 0,32,0,97,0,99,0,99,0,111,0,109,0,112,0,97,0,110,0,121,0,105,0,110,0,103, 0,32,0,116,0,104,0,105,0,115,0,32,0,108,0,105,0,99,0,101,0,110,0,115,0, 101,0,32,0,40,0,34,0,70,0,111,0,110,0,116,0,115,0,34,0,41,0,32,0,97,0, 110,0,100,0,10,0,97,0,115,0,115,0,111,0,99,0,105,0,97,0,116,0,101,0,100, 0,32,0,100,0,111,0,99,0,117,0,109,0,101,0,110,0,116,0,97,0,116,0,105,0, 111,0,110,0,32,0,102,0,105,0,108,0,101,0,115,0,32,0,40,0,116,0,104,0,101, 0,32,0,34,0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97, 0,114,0,101,0,34,0,41,0,44,0,32,0,116,0,111,0,32,0,114,0,101,0,112,0,114, 0,111,0,100,0,117,0,99,0,101,0,10,0,97,0,110,0,100,0,32,0,100,0,105,0, 115,0,116,0,114,0,105,0,98,0,117,0,116,0,101,0,32,0,116,0,104,0,101,0, 32,0,109,0,111,0,100,0,105,0,102,0,105,0,99,0,97,0,116,0,105,0,111,0,110, 0,115,0,32,0,116,0,111,0,32,0,116,0,104,0,101,0,32,0,66,0,105,0,116,0, 115,0,116,0,114,0,101,0,97,0,109,0,32,0,86,0,101,0,114,0,97,0,32,0,70, 0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0, 44,0,10,0,105,0,110,0,99,0,108,0,117,0,100,0,105,0,110,0,103,0,32,0,119, 0,105,0,116,0,104,0,111,0,117,0,116,0,32,0,108,0,105,0,109,0,105,0,116, 0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,104,0,101,0,32,0,114,0,105,0, 103,0,104,0,116,0,115,0,32,0,116,0,111,0,32,0,117,0,115,0,101,0,44,0,32, 0,99,0,111,0,112,0,121,0,44,0,32,0,109,0,101,0,114,0,103,0,101,0,44,0, 32,0,112,0,117,0,98,0,108,0,105,0,115,0,104,0,44,0,10,0,100,0,105,0,115, 0,116,0,114,0,105,0,98,0,117,0,116,0,101,0,44,0,32,0,97,0,110,0,100,0, 47,0,111,0,114,0,32,0,115,0,101,0,108,0,108,0,32,0,99,0,111,0,112,0,105, 0,101,0,115,0,32,0,111,0,102,0,32,0,116,0,104,0,101,0,32,0,70,0,111,0, 110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,44,0,32, 0,97,0,110,0,100,0,32,0,116,0,111,0,32,0,112,0,101,0,114,0,109,0,105,0, 116,0,10,0,112,0,101,0,114,0,115,0,111,0,110,0,115,0,32,0,116,0,111,0, 32,0,119,0,104,0,111,0,109,0,32,0,116,0,104,0,101,0,32,0,70,0,111,0,110, 0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,32,0,105,0, 115,0,32,0,102,0,117,0,114,0,110,0,105,0,115,0,104,0,101,0,100,0,32,0, 116,0,111,0,32,0,100,0,111,0,32,0,115,0,111,0,44,0,32,0,115,0,117,0,98, 0,106,0,101,0,99,0,116,0,32,0,116,0,111,0,10,0,116,0,104,0,101,0,32,0, 102,0,111,0,108,0,108,0,111,0,119,0,105,0,110,0,103,0,32,0,99,0,111,0, 110,0,100,0,105,0,116,0,105,0,111,0,110,0,115,0,58,0,10,0,10,0,84,0,104, 0,101,0,32,0,97,0,98,0,111,0,118,0,101,0,32,0,99,0,111,0,112,0,121,0,114, 0,105,0,103,0,104,0,116,0,32,0,97,0,110,0,100,0,32,0,116,0,114,0,97,0, 100,0,101,0,109,0,97,0,114,0,107,0,32,0,110,0,111,0,116,0,105,0,99,0,101, 0,115,0,32,0,97,0,110,0,100,0,32,0,116,0,104,0,105,0,115,0,32,0,112,0, 101,0,114,0,109,0,105,0,115,0,115,0,105,0,111,0,110,0,32,0,110,0,111,0, 116,0,105,0,99,0,101,0,10,0,115,0,104,0,97,0,108,0,108,0,32,0,98,0,101, 0,32,0,105,0,110,0,99,0,108,0,117,0,100,0,101,0,100,0,32,0,105,0,110,0, 32,0,97,0,108,0,108,0,32,0,99,0,111,0,112,0,105,0,101,0,115,0,32,0,111, 0,102,0,32,0,111,0,110,0,101,0,32,0,111,0,114,0,32,0,109,0,111,0,114,0, 101,0,32,0,111,0,102,0,32,0,116,0,104,0,101,0,32,0,70,0,111,0,110,0,116, 0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,10,0,116,0,121,0, 112,0,101,0,102,0,97,0,99,0,101,0,115,0,46,0,10,0,10,0,84,0,104,0,101, 0,32,0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114, 0,101,0,32,0,109,0,97,0,121,0,32,0,98,0,101,0,32,0,109,0,111,0,100,0,105, 0,102,0,105,0,101,0,100,0,44,0,32,0,97,0,108,0,116,0,101,0,114,0,101,0, 100,0,44,0,32,0,111,0,114,0,32,0,97,0,100,0,100,0,101,0,100,0,32,0,116, 0,111,0,44,0,32,0,97,0,110,0,100,0,32,0,105,0,110,0,10,0,112,0,97,0,114, 0,116,0,105,0,99,0,117,0,108,0,97,0,114,0,32,0,116,0,104,0,101,0,32,0, 100,0,101,0,115,0,105,0,103,0,110,0,115,0,32,0,111,0,102,0,32,0,103,0, 108,0,121,0,112,0,104,0,115,0,32,0,111,0,114,0,32,0,99,0,104,0,97,0,114, 0,97,0,99,0,116,0,101,0,114,0,115,0,32,0,105,0,110,0,32,0,116,0,104,0, 101,0,32,0,70,0,111,0,110,0,116,0,115,0,32,0,109,0,97,0,121,0,32,0,98, 0,101,0,10,0,109,0,111,0,100,0,105,0,102,0,105,0,101,0,100,0,32,0,97,0, 110,0,100,0,32,0,97,0,100,0,100,0,105,0,116,0,105,0,111,0,110,0,97,0,108, 0,32,0,103,0,108,0,121,0,112,0,104,0,115,0,32,0,111,0,114,0,32,0,99,0, 104,0,97,0,114,0,97,0,99,0,116,0,101,0,114,0,115,0,32,0,109,0,97,0,121, 0,32,0,98,0,101,0,32,0,97,0,100,0,100,0,101,0,100,0,32,0,116,0,111,0,32, 0,116,0,104,0,101,0,10,0,70,0,111,0,110,0,116,0,115,0,44,0,32,0,111,0, 110,0,108,0,121,0,32,0,105,0,102,0,32,0,116,0,104,0,101,0,32,0,102,0,111, 0,110,0,116,0,115,0,32,0,97,0,114,0,101,0,32,0,114,0,101,0,110,0,97,0, 109,0,101,0,100,0,32,0,116,0,111,0,32,0,110,0,97,0,109,0,101,0,115,0,32, 0,110,0,111,0,116,0,32,0,99,0,111,0,110,0,116,0,97,0,105,0,110,0,105,0, 110,0,103,0,32,0,101,0,105,0,116,0,104,0,101,0,114,0,10,0,116,0,104,0, 101,0,32,0,119,0,111,0,114,0,100,0,115,0,32,0,34,0,84,0,97,0,118,0,109, 0,106,0,111,0,110,0,103,0,32,0,66,0,97,0,104,0,34,0,32,0,111,0,114,0,32, 0,116,0,104,0,101,0,32,0,119,0,111,0,114,0,100,0,32,0,34,0,65,0,114,0, 101,0,118,0,34,0,46,0,10,0,10,0,84,0,104,0,105,0,115,0,32,0,76,0,105,0, 99,0,101,0,110,0,115,0,101,0,32,0,98,0,101,0,99,0,111,0,109,0,101,0,115, 0,32,0,110,0,117,0,108,0,108,0,32,0,97,0,110,0,100,0,32,0,118,0,111,0, 105,0,100,0,32,0,116,0,111,0,32,0,116,0,104,0,101,0,32,0,101,0,120,0,116, 0,101,0,110,0,116,0,32,0,97,0,112,0,112,0,108,0,105,0,99,0,97,0,98,0,108, 0,101,0,32,0,116,0,111,0,32,0,70,0,111,0,110,0,116,0,115,0,10,0,111,0, 114,0,32,0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97, 0,114,0,101,0,32,0,116,0,104,0,97,0,116,0,32,0,104,0,97,0,115,0,32,0,98, 0,101,0,101,0,110,0,32,0,109,0,111,0,100,0,105,0,102,0,105,0,101,0,100, 0,32,0,97,0,110,0,100,0,32,0,105,0,115,0,32,0,100,0,105,0,115,0,116,0, 114,0,105,0,98,0,117,0,116,0,101,0,100,0,32,0,117,0,110,0,100,0,101,0, 114,0,32,0,116,0,104,0,101,0,32,0,10,0,34,0,84,0,97,0,118,0,109,0,106, 0,111,0,110,0,103,0,32,0,66,0,97,0,104,0,32,0,65,0,114,0,101,0,118,0,34, 0,32,0,110,0,97,0,109,0,101,0,115,0,46,0,10,0,10,0,84,0,104,0,101,0,32, 0,70,0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0, 101,0,32,0,109,0,97,0,121,0,32,0,98,0,101,0,32,0,115,0,111,0,108,0,100, 0,32,0,97,0,115,0,32,0,112,0,97,0,114,0,116,0,32,0,111,0,102,0,32,0,97, 0,32,0,108,0,97,0,114,0,103,0,101,0,114,0,32,0,115,0,111,0,102,0,116,0, 119,0,97,0,114,0,101,0,32,0,112,0,97,0,99,0,107,0,97,0,103,0,101,0,32, 0,98,0,117,0,116,0,10,0,110,0,111,0,32,0,99,0,111,0,112,0,121,0,32,0,111, 0,102,0,32,0,111,0,110,0,101,0,32,0,111,0,114,0,32,0,109,0,111,0,114,0, 101,0,32,0,111,0,102,0,32,0,116,0,104,0,101,0,32,0,70,0,111,0,110,0,116, 0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0,32,0,116,0,121,0, 112,0,101,0,102,0,97,0,99,0,101,0,115,0,32,0,109,0,97,0,121,0,32,0,98, 0,101,0,32,0,115,0,111,0,108,0,100,0,32,0,98,0,121,0,10,0,105,0,116,0, 115,0,101,0,108,0,102,0,46,0,10,0,10,0,84,0,72,0,69,0,32,0,70,0,79,0,78, 0,84,0,32,0,83,0,79,0,70,0,84,0,87,0,65,0,82,0,69,0,32,0,73,0,83,0,32, 0,80,0,82,0,79,0,86,0,73,0,68,0,69,0,68,0,32,0,34,0,65,0,83,0,32,0,73, 0,83,0,34,0,44,0,32,0,87,0,73,0,84,0,72,0,79,0,85,0,84,0,32,0,87,0,65, 0,82,0,82,0,65,0,78,0,84,0,89,0,32,0,79,0,70,0,32,0,65,0,78,0,89,0,32, 0,75,0,73,0,78,0,68,0,44,0,10,0,69,0,88,0,80,0,82,0,69,0,83,0,83,0,32, 0,79,0,82,0,32,0,73,0,77,0,80,0,76,0,73,0,69,0,68,0,44,0,32,0,73,0,78, 0,67,0,76,0,85,0,68,0,73,0,78,0,71,0,32,0,66,0,85,0,84,0,32,0,78,0,79, 0,84,0,32,0,76,0,73,0,77,0,73,0,84,0,69,0,68,0,32,0,84,0,79,0,32,0,65, 0,78,0,89,0,32,0,87,0,65,0,82,0,82,0,65,0,78,0,84,0,73,0,69,0,83,0,32, 0,79,0,70,0,10,0,77,0,69,0,82,0,67,0,72,0,65,0,78,0,84,0,65,0,66,0,73, 0,76,0,73,0,84,0,89,0,44,0,32,0,70,0,73,0,84,0,78,0,69,0,83,0,83,0,32, 0,70,0,79,0,82,0,32,0,65,0,32,0,80,0,65,0,82,0,84,0,73,0,67,0,85,0,76, 0,65,0,82,0,32,0,80,0,85,0,82,0,80,0,79,0,83,0,69,0,32,0,65,0,78,0,68, 0,32,0,78,0,79,0,78,0,73,0,78,0,70,0,82,0,73,0,78,0,71,0,69,0,77,0,69, 0,78,0,84,0,10,0,79,0,70,0,32,0,67,0,79,0,80,0,89,0,82,0,73,0,71,0,72, 0,84,0,44,0,32,0,80,0,65,0,84,0,69,0,78,0,84,0,44,0,32,0,84,0,82,0,65, 0,68,0,69,0,77,0,65,0,82,0,75,0,44,0,32,0,79,0,82,0,32,0,79,0,84,0,72, 0,69,0,82,0,32,0,82,0,73,0,71,0,72,0,84,0,46,0,32,0,73,0,78,0,32,0,78, 0,79,0,32,0,69,0,86,0,69,0,78,0,84,0,32,0,83,0,72,0,65,0,76,0,76,0,10, 0,84,0,65,0,86,0,77,0,74,0,79,0,78,0,71,0,32,0,66,0,65,0,72,0,32,0,66, 0,69,0,32,0,76,0,73,0,65,0,66,0,76,0,69,0,32,0,70,0,79,0,82,0,32,0,65, 0,78,0,89,0,32,0,67,0,76,0,65,0,73,0,77,0,44,0,32,0,68,0,65,0,77,0,65, 0,71,0,69,0,83,0,32,0,79,0,82,0,32,0,79,0,84,0,72,0,69,0,82,0,32,0,76, 0,73,0,65,0,66,0,73,0,76,0,73,0,84,0,89,0,44,0,10,0,73,0,78,0,67,0,76, 0,85,0,68,0,73,0,78,0,71,0,32,0,65,0,78,0,89,0,32,0,71,0,69,0,78,0,69, 0,82,0,65,0,76,0,44,0,32,0,83,0,80,0,69,0,67,0,73,0,65,0,76,0,44,0,32, 0,73,0,78,0,68,0,73,0,82,0,69,0,67,0,84,0,44,0,32,0,73,0,78,0,67,0,73, 0,68,0,69,0,78,0,84,0,65,0,76,0,44,0,32,0,79,0,82,0,32,0,67,0,79,0,78, 0,83,0,69,0,81,0,85,0,69,0,78,0,84,0,73,0,65,0,76,0,10,0,68,0,65,0,77, 0,65,0,71,0,69,0,83,0,44,0,32,0,87,0,72,0,69,0,84,0,72,0,69,0,82,0,32, 0,73,0,78,0,32,0,65,0,78,0,32,0,65,0,67,0,84,0,73,0,79,0,78,0,32,0,79, 0,70,0,32,0,67,0,79,0,78,0,84,0,82,0,65,0,67,0,84,0,44,0,32,0,84,0,79, 0,82,0,84,0,32,0,79,0,82,0,32,0,79,0,84,0,72,0,69,0,82,0,87,0,73,0,83, 0,69,0,44,0,32,0,65,0,82,0,73,0,83,0,73,0,78,0,71,0,10,0,70,0,82,0,79, 0,77,0,44,0,32,0,79,0,85,0,84,0,32,0,79,0,70,0,32,0,84,0,72,0,69,0,32, 0,85,0,83,0,69,0,32,0,79,0,82,0,32,0,73,0,78,0,65,0,66,0,73,0,76,0,73, 0,84,0,89,0,32,0,84,0,79,0,32,0,85,0,83,0,69,0,32,0,84,0,72,0,69,0,32, 0,70,0,79,0,78,0,84,0,32,0,83,0,79,0,70,0,84,0,87,0,65,0,82,0,69,0,32, 0,79,0,82,0,32,0,70,0,82,0,79,0,77,0,10,0,79,0,84,0,72,0,69,0,82,0,32, 0,68,0,69,0,65,0,76,0,73,0,78,0,71,0,83,0,32,0,73,0,78,0,32,0,84,0,72, 0,69,0,32,0,70,0,79,0,78,0,84,0,32,0,83,0,79,0,70,0,84,0,87,0,65,0,82, 0,69,0,46,0,10,0,10,0,69,0,120,0,99,0,101,0,112,0,116,0,32,0,97,0,115, 0,32,0,99,0,111,0,110,0,116,0,97,0,105,0,110,0,101,0,100,0,32,0,105,0, 110,0,32,0,116,0,104,0,105,0,115,0,32,0,110,0,111,0,116,0,105,0,99,0,101, 0,44,0,32,0,116,0,104,0,101,0,32,0,110,0,97,0,109,0,101,0,32,0,111,0,102, 0,32,0,84,0,97,0,118,0,109,0,106,0,111,0,110,0,103,0,32,0,66,0,97,0,104, 0,32,0,115,0,104,0,97,0,108,0,108,0,32,0,110,0,111,0,116,0,10,0,98,0,101, 0,32,0,117,0,115,0,101,0,100,0,32,0,105,0,110,0,32,0,97,0,100,0,118,0, 101,0,114,0,116,0,105,0,115,0,105,0,110,0,103,0,32,0,111,0,114,0,32,0, 111,0,116,0,104,0,101,0,114,0,119,0,105,0,115,0,101,0,32,0,116,0,111,0, 32,0,112,0,114,0,111,0,109,0,111,0,116,0,101,0,32,0,116,0,104,0,101,0, 32,0,115,0,97,0,108,0,101,0,44,0,32,0,117,0,115,0,101,0,32,0,111,0,114, 0,32,0,111,0,116,0,104,0,101,0,114,0,10,0,100,0,101,0,97,0,108,0,105,0, 110,0,103,0,115,0,32,0,105,0,110,0,32,0,116,0,104,0,105,0,115,0,32,0,70, 0,111,0,110,0,116,0,32,0,83,0,111,0,102,0,116,0,119,0,97,0,114,0,101,0, 32,0,119,0,105,0,116,0,104,0,111,0,117,0,116,0,32,0,112,0,114,0,105,0, 111,0,114,0,32,0,119,0,114,0,105,0,116,0,116,0,101,0,110,0,32,0,97,0,117, 0,116,0,104,0,111,0,114,0,105,0,122,0,97,0,116,0,105,0,111,0,110,0,10, 0,102,0,114,0,111,0,109,0,32,0,84,0,97,0,118,0,109,0,106,0,111,0,110,0, 103,0,32,0,66,0,97,0,104,0,46,0,32,0,70,0,111,0,114,0,32,0,102,0,117,0, 114,0,116,0,104,0,101,0,114,0,32,0,105,0,110,0,102,0,111,0,114,0,109,0, 97,0,116,0,105,0,111,0,110,0,44,0,32,0,99,0,111,0,110,0,116,0,97,0,99, 0,116,0,58,0,32,0,116,0,97,0,118,0,109,0,106,0,111,0,110,0,103,0,32,0, 64,0,32,0,102,0,114,0,101,0,101,0,10,0,46,0,32,0,102,0,114,0,46,0,0,70, 111,110,116,115,32,97,114,101,32,40,99,41,32,66,105,116,115,116,114,101, 97,109,32,40,115,101,101,32,98,101,108,111,119,41,46,32,68,101,106,97, 86,117,32,99,104,97,110,103,101,115,32,97,114,101,32,105,110,32,112,117, 98,108,105,99,32,100,111,109,97,105,110,46,32,71,108,121,112,104,115,32, 105,109,112,111,114,116,101,100,32,102,114,111,109,32,65,114,101,118,32, 102,111,110,116,115,32,97,114,101,32,40,99,41,32,84,97,118,109,106,117, 110,103,32,66,97,104,32,40,115,101,101,32,98,101,108,111,119,41,10,10, 66,105,116,115,116,114,101,97,109,32,86,101,114,97,32,70,111,110,116,115, 32,67,111,112,121,114,105,103,104,116,10,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,10,10,67,111, 112,121,114,105,103,104,116,32,40,99,41,32,50,48,48,51,32,98,121,32,66, 105,116,115,116,114,101,97,109,44,32,73,110,99,46,32,65,108,108,32,82, 105,103,104,116,115,32,82,101,115,101,114,118,101,100,46,32,66,105,116, 115,116,114,101,97,109,32,86,101,114,97,32,105,115,10,97,32,116,114,97, 100,101,109,97,114,107,32,111,102,32,66,105,116,115,116,114,101,97,109, 44,32,73,110,99,46,10,10,80,101,114,109,105,115,115,105,111,110,32,105, 115,32,104,101,114,101,98,121,32,103,114,97,110,116,101,100,44,32,102, 114,101,101,32,111,102,32,99,104,97,114,103,101,44,32,116,111,32,97,110, 121,32,112,101,114,115,111,110,32,111,98,116,97,105,110,105,110,103,32, 97,32,99,111,112,121,10,111,102,32,116,104,101,32,102,111,110,116,115, 32,97,99,99,111,109,112,97,110,121,105,110,103,32,116,104,105,115,32,108, 105,99,101,110,115,101,32,40,34,70,111,110,116,115,34,41,32,97,110,100, 32,97,115,115,111,99,105,97,116,101,100,10,100,111,99,117,109,101,110, 116,97,116,105,111,110,32,102,105,108,101,115,32,40,116,104,101,32,34, 70,111,110,116,32,83,111,102,116,119,97,114,101,34,41,44,32,116,111,32, 114,101,112,114,111,100,117,99,101,32,97,110,100,32,100,105,115,116,114, 105,98,117,116,101,32,116,104,101,10,70,111,110,116,32,83,111,102,116, 119,97,114,101,44,32,105,110,99,108,117,100,105,110,103,32,119,105,116, 104,111,117,116,32,108,105,109,105,116,97,116,105,111,110,32,116,104,101, 32,114,105,103,104,116,115,32,116,111,32,117,115,101,44,32,99,111,112, 121,44,32,109,101,114,103,101,44,10,112,117,98,108,105,115,104,44,32,100, 105,115,116,114,105,98,117,116,101,44,32,97,110,100,47,111,114,32,115, 101,108,108,32,99,111,112,105,101,115,32,111,102,32,116,104,101,32,70, 111,110,116,32,83,111,102,116,119,97,114,101,44,32,97,110,100,32,116,111, 32,112,101,114,109,105,116,10,112,101,114,115,111,110,115,32,116,111,32, 119,104,111,109,32,116,104,101,32,70,111,110,116,32,83,111,102,116,119, 97,114,101,32,105,115,32,102,117,114,110,105,115,104,101,100,32,116,111, 32,100,111,32,115,111,44,32,115,117,98,106,101,99,116,32,116,111,32,116, 104,101,10,102,111,108,108,111,119,105,110,103,32,99,111,110,100,105,116, 105,111,110,115,58,10,10,84,104,101,32,97,98,111,118,101,32,99,111,112, 121,114,105,103,104,116,32,97,110,100,32,116,114,97,100,101,109,97,114, 107,32,110,111,116,105,99,101,115,32,97,110,100,32,116,104,105,115,32, 112,101,114,109,105,115,115,105,111,110,32,110,111,116,105,99,101,32,115, 104,97,108,108,10,98,101,32,105,110,99,108,117,100,101,100,32,105,110, 32,97,108,108,32,99,111,112,105,101,115,32,111,102,32,111,110,101,32,111, 114,32,109,111,114,101,32,111,102,32,116,104,101,32,70,111,110,116,32, 83,111,102,116,119,97,114,101,32,116,121,112,101,102,97,99,101,115,46, 10,10,84,104,101,32,70,111,110,116,32,83,111,102,116,119,97,114,101,32, 109,97,121,32,98,101,32,109,111,100,105,102,105,101,100,44,32,97,108,116, 101,114,101,100,44,32,111,114,32,97,100,100,101,100,32,116,111,44,32,97, 110,100,32,105,110,32,112,97,114,116,105,99,117,108,97,114,10,116,104, 101,32,100,101,115,105,103,110,115,32,111,102,32,103,108,121,112,104,115, 32,111,114,32,99,104,97,114,97,99,116,101,114,115,32,105,110,32,116,104, 101,32,70,111,110,116,115,32,109,97,121,32,98,101,32,109,111,100,105,102, 105,101,100,32,97,110,100,10,97,100,100,105,116,105,111,110,97,108,32, 103,108,121,112,104,115,32,111,114,32,99,104,97,114,97,99,116,101,114, 115,32,109,97,121,32,98,101,32,97,100,100,101,100,32,116,111,32,116,104, 101,32,70,111,110,116,115,44,32,111,110,108,121,32,105,102,32,116,104, 101,32,102,111,110,116,115,10,97,114,101,32,114,101,110,97,109,101,100, 32,116,111,32,110,97,109,101,115,32,110,111,116,32,99,111,110,116,97,105, 110,105,110,103,32,101,105,116,104,101,114,32,116,104,101,32,119,111,114, 100,115,32,34,66,105,116,115,116,114,101,97,109,34,32,111,114,32,116,104, 101,32,119,111,114,100,10,34,86,101,114,97,34,46,10,10,84,104,105,115, 32,76,105,99,101,110,115,101,32,98,101,99,111,109,101,115,32,110,117,108, 108,32,97,110,100,32,118,111,105,100,32,116,111,32,116,104,101,32,101, 120,116,101,110,116,32,97,112,112,108,105,99,97,98,108,101,32,116,111, 32,70,111,110,116,115,32,111,114,32,70,111,110,116,10,83,111,102,116,119, 97,114,101,32,116,104,97,116,32,104,97,115,32,98,101,101,110,32,109,111, 100,105,102,105,101,100,32,97,110,100,32,105,115,32,100,105,115,116,114, 105,98,117,116,101,100,32,117,110,100,101,114,32,116,104,101,32,34,66, 105,116,115,116,114,101,97,109,10,86,101,114,97,34,32,110,97,109,101,115, 46,10,10,84,104,101,32,70,111,110,116,32,83,111,102,116,119,97,114,101, 32,109,97,121,32,98,101,32,115,111,108,100,32,97,115,32,112,97,114,116, 32,111,102,32,97,32,108,97,114,103,101,114,32,115,111,102,116,119,97,114, 101,32,112,97,99,107,97,103,101,32,98,117,116,32,110,111,10,99,111,112, 121,32,111,102,32,111,110,101,32,111,114,32,109,111,114,101,32,111,102, 32,116,104,101,32,70,111,110,116,32,83,111,102,116,119,97,114,101,32,116, 121,112,101,102,97,99,101,115,32,109,97,121,32,98,101,32,115,111,108,100, 32,98,121,32,105,116,115,101,108,102,46,10,10,84,72,69,32,70,79,78,84, 32,83,79,70,84,87,65,82,69,32,73,83,32,80,82,79,86,73,68,69,68,32,34,65, 83,32,73,83,34,44,32,87,73,84,72,79,85,84,32,87,65,82,82,65,78,84,89,32, 79,70,32,65,78,89,32,75,73,78,68,44,32,69,88,80,82,69,83,83,10,79,82,32, 73,77,80,76,73,69,68,44,32,73,78,67,76,85,68,73,78,71,32,66,85,84,32,78, 79,84,32,76,73,77,73,84,69,68,32,84,79,32,65,78,89,32,87,65,82,82,65,78, 84,73,69,83,32,79,70,32,77,69,82,67,72,65,78,84,65,66,73,76,73,84,89,44, 10,70,73,84,78,69,83,83,32,70,79,82,32,65,32,80,65,82,84,73,67,85,76,65, 82,32,80,85,82,80,79,83,69,32,65,78,68,32,78,79,78,73,78,70,82,73,78,71, 69,77,69,78,84,32,79,70,32,67,79,80,89,82,73,71,72,84,44,32,80,65,84,69, 78,84,44,10,84,82,65,68,69,77,65,82,75,44,32,79,82,32,79,84,72,69,82,32, 82,73,71,72,84,46,32,73,78,32,78,79,32,69,86,69,78,84,32,83,72,65,76,76, 32,66,73,84,83,84,82,69,65,77,32,79,82,32,84,72,69,32,71,78,79,77,69,10, 70,79,85,78,68,65,84,73,79,78,32,66,69,32,76,73,65,66,76,69,32,70,79,82, 32,65,78,89,32,67,76,65,73,77,44,32,68,65,77,65,71,69,83,32,79,82,32,79, 84,72,69,82,32,76,73,65,66,73,76,73,84,89,44,32,73,78,67,76,85,68,73,78, 71,10,65,78,89,32,71,69,78,69,82,65,76,44,32,83,80,69,67,73,65,76,44,32, 73,78,68,73,82,69,67,84,44,32,73,78,67,73,68,69,78,84,65,76,44,32,79,82, 32,67,79,78,83,69,81,85,69,78,84,73,65,76,32,68,65,77,65,71,69,83,44,10, 87,72,69,84,72,69,82,32,73,78,32,65,78,32,65,67,84,73,79,78,32,79,70,32, 67,79,78,84,82,65,67,84,44,32,84,79,82,84,32,79,82,32,79,84,72,69,82,87, 73,83,69,44,32,65,82,73,83,73,78,71,32,70,82,79,77,44,32,79,85,84,32,79, 70,10,84,72,69,32,85,83,69,32,79,82,32,73,78,65,66,73,76,73,84,89,32,84, 79,32,85,83,69,32,84,72,69,32,70,79,78,84,32,83,79,70,84,87,65,82,69,32, 79,82,32,70,82,79,77,32,79,84,72,69,82,32,68,69,65,76,73,78,71,83,32,73, 78,32,84,72,69,10,70,79,78,84,32,83,79,70,84,87,65,82,69,46,10,10,69,120, 99,101,112,116,32,97,115,32,99,111,110,116,97,105,110,101,100,32,105,110, 32,116,104,105,115,32,110,111,116,105,99,101,44,32,116,104,101,32,110, 97,109,101,115,32,111,102,32,71,110,111,109,101,44,32,116,104,101,32,71, 110,111,109,101,10,70,111,117,110,100,97,116,105,111,110,44,32,97,110, 100,32,66,105,116,115,116,114,101,97,109,32,73,110,99,46,44,32,115,104, 97,108,108,32,110,111,116,32,98,101,32,117,115,101,100,32,105,110,32,97, 100,118,101,114,116,105,115,105,110,103,32,111,114,10,111,116,104,101, 114,119,105,115,101,32,116,111,32,112,114,111,109,111,116,101,32,116,104, 101,32,115,97,108,101,44,32,117,115,101,32,111,114,32,111,116,104,101, 114,32,100,101,97,108,105,110,103,115,32,105,110,32,116,104,105,115,32, 70,111,110,116,32,83,111,102,116,119,97,114,101,10,119,105,116,104,111, 117,116,32,112,114,105,111,114,32,119,114,105,116,116,101,110,32,97,117, 116,104,111,114,105,122,97,116,105,111,110,32,102,114,111,109,32,116,104, 101,32,71,110,111,109,101,32,70,111,117,110,100,97,116,105,111,110,32, 111,114,32,66,105,116,115,116,114,101,97,109,10,73,110,99,46,44,32,114, 101,115,112,101,99,116,105,118,101,108,121,46,32,70,111,114,32,102,117, 114,116,104,101,114,32,105,110,102,111,114,109,97,116,105,111,110,44,32, 99,111,110,116,97,99,116,58,32,102,111,110,116,115,32,97,116,32,103,110, 111,109,101,32,100,111,116,10,111,114,103,46,32,10,10,65,114,101,118,32, 70,111,110,116,115,32,67,111,112,121,114,105,103,104,116,10,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,10,10,67,111,112,121,114,105,103,104,116,32,40,99,41,32,50,48,48, 54,32,98,121,32,84,97,118,109,106,111,110,103,32,66,97,104,46,32,65,108, 108,32,82,105,103,104,116,115,32,82,101,115,101,114,118,101,100,46,10, 10,80,101,114,109,105,115,115,105,111,110,32,105,115,32,104,101,114,101, 98,121,32,103,114,97,110,116,101,100,44,32,102,114,101,101,32,111,102, 32,99,104,97,114,103,101,44,32,116,111,32,97,110,121,32,112,101,114,115, 111,110,32,111,98,116,97,105,110,105,110,103,10,97,32,99,111,112,121,32, 111,102,32,116,104,101,32,102,111,110,116,115,32,97,99,99,111,109,112, 97,110,121,105,110,103,32,116,104,105,115,32,108,105,99,101,110,115,101, 32,40,34,70,111,110,116,115,34,41,32,97,110,100,10,97,115,115,111,99,105, 97,116,101,100,32,100,111,99,117,109,101,110,116,97,116,105,111,110,32, 102,105,108,101,115,32,40,116,104,101,32,34,70,111,110,116,32,83,111,102, 116,119,97,114,101,34,41,44,32,116,111,32,114,101,112,114,111,100,117, 99,101,10,97,110,100,32,100,105,115,116,114,105,98,117,116,101,32,116, 104,101,32,109,111,100,105,102,105,99,97,116,105,111,110,115,32,116,111, 32,116,104,101,32,66,105,116,115,116,114,101,97,109,32,86,101,114,97,32, 70,111,110,116,32,83,111,102,116,119,97,114,101,44,10,105,110,99,108,117, 100,105,110,103,32,119,105,116,104,111,117,116,32,108,105,109,105,116, 97,116,105,111,110,32,116,104,101,32,114,105,103,104,116,115,32,116,111, 32,117,115,101,44,32,99,111,112,121,44,32,109,101,114,103,101,44,32,112, 117,98,108,105,115,104,44,10,100,105,115,116,114,105,98,117,116,101,44, 32,97,110,100,47,111,114,32,115,101,108,108,32,99,111,112,105,101,115, 32,111,102,32,116,104,101,32,70,111,110,116,32,83,111,102,116,119,97,114, 101,44,32,97,110,100,32,116,111,32,112,101,114,109,105,116,10,112,101, 114,115,111,110,115,32,116,111,32,119,104,111,109,32,116,104,101,32,70, 111,110,116,32,83,111,102,116,119,97,114,101,32,105,115,32,102,117,114, 110,105,115,104,101,100,32,116,111,32,100,111,32,115,111,44,32,115,117, 98,106,101,99,116,32,116,111,10,116,104,101,32,102,111,108,108,111,119, 105,110,103,32,99,111,110,100,105,116,105,111,110,115,58,10,10,84,104, 101,32,97,98,111,118,101,32,99,111,112,121,114,105,103,104,116,32,97,110, 100,32,116,114,97,100,101,109,97,114,107,32,110,111,116,105,99,101,115, 32,97,110,100,32,116,104,105,115,32,112,101,114,109,105,115,115,105,111, 110,32,110,111,116,105,99,101,10,115,104,97,108,108,32,98,101,32,105,110, 99,108,117,100,101,100,32,105,110,32,97,108,108,32,99,111,112,105,101, 115,32,111,102,32,111,110,101,32,111,114,32,109,111,114,101,32,111,102, 32,116,104,101,32,70,111,110,116,32,83,111,102,116,119,97,114,101,10,116, 121,112,101,102,97,99,101,115,46,10,10,84,104,101,32,70,111,110,116,32, 83,111,102,116,119,97,114,101,32,109,97,121,32,98,101,32,109,111,100,105, 102,105,101,100,44,32,97,108,116,101,114,101,100,44,32,111,114,32,97,100, 100,101,100,32,116,111,44,32,97,110,100,32,105,110,10,112,97,114,116,105, 99,117,108,97,114,32,116,104,101,32,100,101,115,105,103,110,115,32,111, 102,32,103,108,121,112,104,115,32,111,114,32,99,104,97,114,97,99,116,101, 114,115,32,105,110,32,116,104,101,32,70,111,110,116,115,32,109,97,121, 32,98,101,10,109,111,100,105,102,105,101,100,32,97,110,100,32,97,100,100, 105,116,105,111,110,97,108,32,103,108,121,112,104,115,32,111,114,32,99, 104,97,114,97,99,116,101,114,115,32,109,97,121,32,98,101,32,97,100,100, 101,100,32,116,111,32,116,104,101,10,70,111,110,116,115,44,32,111,110, 108,121,32,105,102,32,116,104,101,32,102,111,110,116,115,32,97,114,101, 32,114,101,110,97,109,101,100,32,116,111,32,110,97,109,101,115,32,110, 111,116,32,99,111,110,116,97,105,110,105,110,103,32,101,105,116,104,101, 114,10,116,104,101,32,119,111,114,100,115,32,34,84,97,118,109,106,111, 110,103,32,66,97,104,34,32,111,114,32,116,104,101,32,119,111,114,100,32, 34,65,114,101,118,34,46,10,10,84,104,105,115,32,76,105,99,101,110,115, 101,32,98,101,99,111,109,101,115,32,110,117,108,108,32,97,110,100,32,118, 111,105,100,32,116,111,32,116,104,101,32,101,120,116,101,110,116,32,97, 112,112,108,105,99,97,98,108,101,32,116,111,32,70,111,110,116,115,10,111, 114,32,70,111,110,116,32,83,111,102,116,119,97,114,101,32,116,104,97,116, 32,104,97,115,32,98,101,101,110,32,109,111,100,105,102,105,101,100,32, 97,110,100,32,105,115,32,100,105,115,116,114,105,98,117,116,101,100,32, 117,110,100,101,114,32,116,104,101,32,10,34,84,97,118,109,106,111,110, 103,32,66,97,104,32,65,114,101,118,34,32,110,97,109,101,115,46,10,10,84, 104,101,32,70,111,110,116,32,83,111,102,116,119,97,114,101,32,109,97,121, 32,98,101,32,115,111,108,100,32,97,115,32,112,97,114,116,32,111,102,32, 97,32,108,97,114,103,101,114,32,115,111,102,116,119,97,114,101,32,112, 97,99,107,97,103,101,32,98,117,116,10,110,111,32,99,111,112,121,32,111, 102,32,111,110,101,32,111,114,32,109,111,114,101,32,111,102,32,116,104, 101,32,70,111,110,116,32,83,111,102,116,119,97,114,101,32,116,121,112, 101,102,97,99,101,115,32,109,97,121,32,98,101,32,115,111,108,100,32,98, 121,10,105,116,115,101,108,102,46,10,10,84,72,69,32,70,79,78,84,32,83, 79,70,84,87,65,82,69,32,73,83,32,80,82,79,86,73,68,69,68,32,34,65,83,32, 73,83,34,44,32,87,73,84,72,79,85,84,32,87,65,82,82,65,78,84,89,32,79,70, 32,65,78,89,32,75,73,78,68,44,10,69,88,80,82,69,83,83,32,79,82,32,73,77, 80,76,73,69,68,44,32,73,78,67,76,85,68,73,78,71,32,66,85,84,32,78,79,84, 32,76,73,77,73,84,69,68,32,84,79,32,65,78,89,32,87,65,82,82,65,78,84,73, 69,83,32,79,70,10,77,69,82,67,72,65,78,84,65,66,73,76,73,84,89,44,32,70, 73,84,78,69,83,83,32,70,79,82,32,65,32,80,65,82,84,73,67,85,76,65,82,32, 80,85,82,80,79,83,69,32,65,78,68,32,78,79,78,73,78,70,82,73,78,71,69,77, 69,78,84,10,79,70,32,67,79,80,89,82,73,71,72,84,44,32,80,65,84,69,78,84, 44,32,84,82,65,68,69,77,65,82,75,44,32,79,82,32,79,84,72,69,82,32,82,73, 71,72,84,46,32,73,78,32,78,79,32,69,86,69,78,84,32,83,72,65,76,76,10,84, 65,86,77,74,79,78,71,32,66,65,72,32,66,69,32,76,73,65,66,76,69,32,70,79, 82,32,65,78,89,32,67,76,65,73,77,44,32,68,65,77,65,71,69,83,32,79,82,32, 79,84,72,69,82,32,76,73,65,66,73,76,73,84,89,44,10,73,78,67,76,85,68,73, 78,71,32,65,78,89,32,71,69,78,69,82,65,76,44,32,83,80,69,67,73,65,76,44, 32,73,78,68,73,82,69,67,84,44,32,73,78,67,73,68,69,78,84,65,76,44,32,79, 82,32,67,79,78,83,69,81,85,69,78,84,73,65,76,10,68,65,77,65,71,69,83,44, 32,87,72,69,84,72,69,82,32,73,78,32,65,78,32,65,67,84,73,79,78,32,79,70, 32,67,79,78,84,82,65,67,84,44,32,84,79,82,84,32,79,82,32,79,84,72,69,82, 87,73,83,69,44,32,65,82,73,83,73,78,71,10,70,82,79,77,44,32,79,85,84,32, 79,70,32,84,72,69,32,85,83,69,32,79,82,32,73,78,65,66,73,76,73,84,89,32, 84,79,32,85,83,69,32,84,72,69,32,70,79,78,84,32,83,79,70,84,87,65,82,69, 32,79,82,32,70,82,79,77,10,79,84,72,69,82,32,68,69,65,76,73,78,71,83,32, 73,78,32,84,72,69,32,70,79,78,84,32,83,79,70,84,87,65,82,69,46,10,10,69, 120,99,101,112,116,32,97,115,32,99,111,110,116,97,105,110,101,100,32,105, 110,32,116,104,105,115,32,110,111,116,105,99,101,44,32,116,104,101,32, 110,97,109,101,32,111,102,32,84,97,118,109,106,111,110,103,32,66,97,104, 32,115,104,97,108,108,32,110,111,116,10,98,101,32,117,115,101,100,32,105, 110,32,97,100,118,101,114,116,105,115,105,110,103,32,111,114,32,111,116, 104,101,114,119,105,115,101,32,116,111,32,112,114,111,109,111,116,101, 32,116,104,101,32,115,97,108,101,44,32,117,115,101,32,111,114,32,111,116, 104,101,114,10,100,101,97,108,105,110,103,115,32,105,110,32,116,104,105, 115,32,70,111,110,116,32,83,111,102,116,119,97,114,101,32,119,105,116, 104,111,117,116,32,112,114,105,111,114,32,119,114,105,116,116,101,110, 32,97,117,116,104,111,114,105,122,97,116,105,111,110,10,102,114,111,109, 32,84,97,118,109,106,111,110,103,32,66,97,104,46,32,70,111,114,32,102, 117,114,116,104,101,114,32,105,110,102,111,114,109,97,116,105,111,110, 44,32,99,111,110,116,97,99,116,58,32,116,97,118,109,106,111,110,103,32, 64,32,102,114,101,101,10,46,32,102,114,46,0,0,104,0,116,0,116,0,112,0, 58,0,47,0,47,0,100,0,101,0,106,0,97,0,118,0,117,0,46,0,115,0,111,0,117, 0,114,0,99,0,101,0,102,0,111,0,114,0,103,0,101,0,46,0,110,0,101,0,116, 0,47,0,119,0,105,0,107,0,105,0,47,0,105,0,110,0,100,0,101,0,120,0,46,0, 112,0,104,0,112,0,47,0,76,0,105,0,99,0,101,0,110,0,115,0,101,0,0,104,116, 116,112,58,47,47,100,101,106,97,118,117,46,115,111,117,114,99,101,102, 111,114,103,101,46,110,101,116,47,119,105,107,105,47,105,110,100,101,120, 46,112,104,112,47,76,105,99,101,110,115,101,0,0,68,0,101,0,106,0,97,0, 86,0,117,0,32,0,83,0,97,0,110,0,115,0,0,68,101,106,97,86,117,32,83,97, 110,115,0,0,66,0,111,0,111,0,107,0,0,66,111,111,107,0,0,2,0,0,0,0,0,0, 255,126,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,0,0,0,1,0,2, 0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0,17,0, 18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,0,27,0,28,0,29,0,31,0,32,0, 33,0,34,0,35,0,36,0,37,0,38,0,39,0,40,0,41,0,42,0,43,0,44,0,45,0,46,0, 47,0,48,0,49,0,50,0,51,0,52,0,53,0,54,0,55,0,56,0,57,0,58,0,59,0,60,0, 61,0,62,0,64,0,65,0,66,0,68,0,69,0,70,0,71,0,72,0,73,0,74,0,75,0,76,0, 77,0,78,0,79,0,80,0,81,0,82,0,83,0,84,0,85,0,86,0,87,0,88,0,89,0,90,0, 91,0,92,0,93,0,94,0,96,0,139,0,218,0,131,0,147,1,2,1,3,1,4,1,5,1,6,1,7, 1,8,7,116,114,105,97,103,117,112,7,117,110,105,50,53,66,52,7,117,110,105, 50,53,66,54,7,116,114,105,97,103,100,110,7,117,110,105,50,53,66,69,7,117, 110,105,50,53,67,48,6,72,49,56,53,51,51,0,0,0,0,0,0,2,0,8,0,2,255,255, 0,3,0,1,0,0,0,14,0,0,0,24,0,32,0,0,0,2,0,1,0,3,0,103,0,1,0,4,0,0,0,2,0, 0,0,1,0,0,0,1,0,0,0,1,0,0,0,10,1,194,1,248,0,20,68,70,76,84,0,122,97,114, 97,98,0,134,97,114,109,110,0,164,98,114,97,105,0,176,99,97,110,115,0,188, 99,104,101,114,0,200,99,121,114,108,0,212,103,101,111,114,0,236,103,114, 101,107,0,248,104,97,110,105,1,4,104,101,98,114,1,16,107,97,110,97,1,28, 108,97,111,32,1,40,108,97,116,110,1,52,109,97,116,104,1,112,110,107,111, 32,1,124,111,103,97,109,1,136,114,117,110,114,1,148,116,102,110,103,1, 160,116,104,97,105,1,172,0,4,0,0,0,0,0,0,0,1,0,1,0,22,0,3,75,85,82,32, 0,22,83,78,68,32,0,22,85,82,68,32,0,22,0,0,255,255,0,1,0,2,0,4,0,0,0,0, 255,255,0,1,0,1,0,4,0,0,0,0,255,255,0,1,0,1,0,4,0,0,0,0,255,255,0,1,0, 1,0,4,0,0,0,0,255,255,0,1,0,1,0,16,0,2,77,75,68,32,0,16,83,82,66,32,0, 16,0,0,255,255,0,1,0,3,0,4,0,0,0,0,255,255,0,1,0,1,0,4,0,0,0,0,255,255, 0,1,0,3,0,4,0,0,0,0,255,255,0,1,0,1,0,4,0,0,0,0,255,255,0,1,0,2,0,4,0, 0,0,0,255,255,0,1,0,1,0,4,0,0,0,0,255,255,0,1,0,1,0,52,0,8,73,83,77,32, 0,52,75,83,77,32,0,52,76,83,77,32,0,52,77,79,76,32,0,52,78,83,77,32,0, 52,82,79,77,32,0,52,83,75,83,32,0,52,83,83,77,32,0,52,0,0,255,255,0,1, 0,3,0,4,0,0,0,0,255,255,0,1,0,1,0,4,0,0,0,0,0,0,0,1,0,2,0,4,0,0,0,0,255, 255,0,1,0,1,0,4,0,0,0,0,255,255,0,1,0,1,0,4,0,0,0,0,255,255,0,1,0,1,0, 4,0,0,0,0,255,255,0,1,0,1,0,4,32,82,81,68,0,26,99,99,109,112,0,32,99,99, 109,112,0,38,99,99,109,112,0,46,0,0,0,1,0,0,0,0,0,1,0,3,0,0,0,2,0,1,0, 3,0,0,0,2,0,2,0,3,0,4,0,10,0,18,0,26,0,34,0,6,0,9,0,1,0,50,0,6,0,1,0,1, 0,110,0,6,0,0,0,1,0,154,0,6,0,0,0,10,1,60,1,126,1,192,2,2,2,68,2,134,2, 186,2,238,3,34,3,86,0,2,0,16,0,20,0,20,0,20,0,2,0,0,0,28,0,1,0,0,0,1,0, 0,0,1,0,0,0,3,0,8,0,20,0,30,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0, 0,0,0,0,1,0,1,0,1,0,0,0,2,0,18,0,22,0,30,0,30,0,3,0,0,0,38,0,0,0,1,0,0, 0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,2,0,0,0,2,0,22,0, 30,0,30,0,30,0,5,0,0,0,82,0,126,0,0,0,0,0,1,0,2,0,73,0,74,0,2,0,8,0,35, 0,60,0,3,0,66,0,66,0,3,0,68,0,68,0,3,0,70,0,70,0,3,0,72,0,72,0,3,0,73, 0,74,0,1,0,75,0,76,0,3,0,84,0,84,0,3,0,3,0,8,0,18,0,30,0,0,0,1,0,1,0,2, 0,0,0,0,0,1,0,2,0,4,0,2,0,0,0,0,0,1,0,3,0,4,0,4,0,2,0,0,0,3,0,8,0,18,0, 30,0,1,0,3,0,1,0,0,0,0,0,2,0,4,0,3,0,1,0,0,0,0,0,3,0,4,0,4,0,3,0,1,0,0, 0,0,0,2,0,18,0,22,0,30,0,30,0,3,0,0,0,38,0,52,0,1,0,0,0,1,0,0,0,1,0,0, 0,1,0,0,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0, 0,0,2,0,18,0,22,0,30,0,30,0,3,0,0,0,38,0,52,0,1,0,0,0,1,0,0,0,1,0,0,0, 1,0,0,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0, 0,2,0,18,0,22,0,30,0,30,0,3,0,0,0,38,0,52,0,1,0,0,0,1,0,0,0,1,0,0,0,1, 0,0,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0, 2,0,18,0,22,0,30,0,30,0,3,0,0,0,38,0,52,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0, 0,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0,2, 0,18,0,22,0,30,0,30,0,3,0,0,0,38,0,52,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0, 0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0,1,0,4,0,0,0,1,0,1,0,1,0,0,0,2,0, 18,0,22,0,22,0,30,0,3,0,0,0,38,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1, 0,0,0,1,0,4,0,1,0,2,0,1,0,0,0,0,0,2,0,18,0,22,0,22,0,30,0,3,0,0,0,38,0, 0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,4,0,1,0,2,0,1,0,0,0,0, 0,2,0,18,0,22,0,22,0,30,0,3,0,0,0,38,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0, 0,0,1,0,0,0,1,0,4,0,1,0,2,0,1,0,0,0,0,0,2,0,18,0,22,0,22,0,30,0,3,0,0, 0,38,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,4,0,1,0,2,0,1,0, 0,0,0,0,2,0,18,0,22,0,22,0,30,0,3,0,0,0,38,0,0,0,1,0,0,0,1,0,0,0,1,0,0, 0,1,0,0,0,1,0,0,0,1,0,4,0,1,0,2,0,1,0,0,0,0,0,1,0,0,0,10,1,194,1,222,0, 20,68,70,76,84,0,122,97,114,97,98,0,134,97,114,109,110,0,164,98,114,97, 105,0,176,99,97,110,115,0,188,99,104,101,114,0,200,99,121,114,108,0,212, 103,101,111,114,0,236,103,114,101,107,0,248,104,97,110,105,1,4,104,101, 98,114,1,16,107,97,110,97,1,28,108,97,111,32,1,40,108,97,116,110,1,52, 109,97,116,104,1,112,110,107,111,32,1,124,111,103,97,109,1,136,114,117, 110,114,1,148,116,102,110,103,1,160,116,104,97,105,1,172,0,4,0,0,0,0,255, 255,0,1,0,0,0,22,0,3,75,85,82,32,0,22,83,78,68,32,0,22,85,82,68,32,0,22, 0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0, 1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,16,0,2, 77,75,68,32,0,16,83,82,66,32,0,16,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255, 255,0,1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0, 4,0,0,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255, 255,0,1,0,0,0,52,0,8,73,83,77,32,0,52,75,83,77,32,0,52,76,83,77,32,0,52, 77,79,76,32,0,52,78,83,77,32,0,52,82,79,77,32,0,52,83,75,83,32,0,52,83, 83,77,32,0,52,0,0,255,255,0,1,0,1,0,4,0,0,0,0,255,255,0,1,0,0,0,4,0,0, 0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0, 1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,4,0,0,0,0,255,255,0,1,0,0,0,2,107, 101,114,110,0,14,107,101,114,110,0,20,0,0,0,1,0,1,0,0,0,2,0,0,0,1,0,2, 0,6,0,14,0,2,0,0,0,1,0,16,0,2,0,0,0,1,34,172,0,2,34,100,0,4,0,0,33,48, 33,202,0,53,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,255,211,255,183,0,0,0,0,0,0,0,75,0,114,0,57,0,75,0,0,255,68,0,0,255, 136,255,173,255,154,255,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38, 0,0,0,0,0,0,0,0,255,201,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 38,0,0,255,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,255,211,255,220,255,220,0,57,0,0,255,220,0,0,0,0,255,220,0,0,255,220, 255,220,0,0,255,97,0,0,255,125,255,144,0,0,255,97,0,0,0,0,255,220,255, 220,255,220,255,183,0,0,0,0,0,0,0,0,255,220,0,0,0,0,255,220,0,0,255,136, 255,173,0,0,255,117,255,183,0,0,0,0,255,220,0,0,255,220,0,0,255,220,0, 0,0,57,0,0,255,220,255,220,255,220,255,220,255,220,255,220,255,220,255, 220,0,0,0,0,255,220,255,220,255,97,0,0,0,0,255,144,255,173,255,97,255, 117,255,220,255,220,255,97,0,0,255,97,255,117,255,173,255,144,254,248, 255,3,0,47,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,255,220,0,0,255,220, 0,0,255,220,0,0,0,0,255,193,255,183,0,0,255,144,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,193,255,220, 0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0, 0,255,220,255,220,0,0,0,0,255,220,0,0,0,0,0,0,255,183,0,0,255,144,0,0, 255,220,0,0,0,0,0,0,0,0,0,0,0,0,255,183,255,144,255,144,255,173,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220, 0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,255, 220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,255,144, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,144,0, 0,0,0,0,0,0,0,0,0,255,144,0,0,0,0,0,0,255,211,255,201,255,68,0,0,0,0,254, 183,255,97,255,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,255,220,0,0, 0,0,0,0,0,0,0,0,0,0,255,68,0,0,0,0,255,144,0,0,0,0,255,107,0,0,0,0,255, 183,255,107,0,0,0,0,255,144,0,0,0,0,0,0,255,68,0,0,0,0,0,0,0,0,255,68, 255,144,0,0,255,183,255,144,255,68,255,68,0,0,0,0,0,0,0,0,0,0,0,0,255, 144,0,0,0,0,255,107,255,183,0,0,255,220,255,220,255,144,0,0,0,0,0,0,255, 68,0,0,255,183,255,220,255,183,0,0,255,68,0,0,0,0,255,211,0,0,254,136, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,183,0,0,0, 0,0,0,0,0,255,154,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,211,255,211,255,201,0, 0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,183,255,193,255,183,0,0,255,183,0,0, 0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,183,255,193,255,144,0,0,255,41,0,0,0,0, 255,220,0,0,255,144,0,0,0,0,0,0,0,0,255,144,0,0,0,0,255,97,255,201,0,0, 255,183,0,0,255,183,0,0,255,220,0,0,0,0,255,154,0,0,0,0,0,0,0,0,0,0,255, 154,0,0,0,0,0,0,255,154,0,0,0,0,0,0,255,107,255,125,0,0,0,0,255,144,255, 220,255,154,0,0,255,154,255,154,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,255,193,255,193,0,0,0,0,255,220,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0, 0,0,0,255,183,0,0,0,0,254,230,255,154,255,31,255,68,0,0,254,240,0,0,0, 0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,255,220,0,0, 0,0,0,0,255,68,0,0,0,0,0,0,0,0,0,0,255,220,0,0,255,220,255,220,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,97,253,230,0,0,0,0,0,57,255, 173,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220, 0,0,255,125,255,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,211,255,220,255,68,0,0,255, 211,254,193,0,0,255,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,255,211,0,0,255,164,0,0,0,0,255,183,0,0,0,0,255,211,0,0,255, 220,255,183,255,220,255,220,0,0,255,220,0,0,0,0,0,0,0,0,255,220,0,0,0, 0,0,0,255,164,255,183,0,0,255,183,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,38,0,38,254,183,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,211, 255,220,255,125,0,0,255,173,255,183,255,193,255,173,0,0,255,154,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,255,107,0,0,255,144,255,173,0,0,255,125,0,0,255, 211,0,0,0,0,255,164,0,0,0,0,0,0,0,0,0,0,255,164,0,0,0,0,0,0,255,164,0, 0,0,0,0,0,255,144,255,144,255,220,0,0,255,154,255,211,255,164,0,0,255, 164,255,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,107,255, 125,255,220,0,0,0,0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,68,255,13, 255,31,255,97,0,0,255,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0, 0,0,0,0,0,0,0,0,254,173,254,164,0,0,254,164,0,0,0,0,255,193,0,0,0,0,254, 164,254,211,254,173,0,0,254,201,0,0,254,173,0,0,254,193,255,68,255,144, 0,0,255,136,255,17,254,224,0,0,254,244,254,231,0,0,0,0,254,164,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,211,254,248,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,255,136,254,248,255,89,255,125,0,0,0,0,0,0,0,0, 0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,97,0,0,0,0,255, 97,0,0,0,0,255,211,0,0,0,0,255,97,0,0,0,0,0,0,255,117,0,0,0,0,0,0,255, 201,255,78,255,144,0,0,0,0,255,97,255,97,0,0,255,97,255,117,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,230,0,0,255,173,255,21, 255,136,255,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,255,125,0,0,0,0,255,136,0,0,0,0,255,211,0,0,0,0,255,136,255, 164,0,0,0,0,255,183,0,0,0,0,0,0,255,220,255,144,255,220,0,0,0,0,255,125, 255,136,0,0,255,136,255,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,255,220,0,0,254,248,0,0,255,154,0,0,0,0,0,0,0,0,255,107,0,0,0,0,0, 0,0,0,255,125,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, 164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,144,0, 0,0,0,255,107,0,0,255,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,255,97,255,173,255,211,0,0,255,13,254,97,254,240,255,97, 0,0,255,144,0,0,0,0,0,0,0,0,255,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,254,230,0,0,0,0,254,240,0,0,0,0,255,183,0,0,0,0,254,240,0,0,0,0,0,0, 255,21,0,0,0,0,0,0,0,0,255,31,255,107,0,0,255,144,254,230,254,240,0,0, 254,240,255,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,144,255, 220,254,248,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,255,220,255,220,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,144,255,107,255,183, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,255,220, 0,0,255,220,255,183,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,0,0,255,21,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220, 0,0,0,0,255,183,0,0,0,0,0,0,0,0,0,0,255,183,0,0,0,0,0,0,255,193,0,0,0, 0,0,0,255,183,0,0,0,0,0,0,0,0,255,220,255,183,0,0,255,183,255,193,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,255,107,255,144,255,164,0,0,0,38,255,220,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,193,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,255,107,255,183,255,125,0,0,255,125,255,68,255,220,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,211,255,220, 255,211,0,0,255,220,0,0,0,0,255,220,255,211,255,220,0,0,0,0,0,0,0,0,0, 0,255,201,0,0,255,183,0,0,0,0,0,0,0,0,255,211,0,0,255,211,0,0,0,0,0,0, 255,211,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,254,201,0,0,255,201, 255,97,255,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,254,240,0,0,0,0,255,68,255, 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,255, 193,0,0,0,0,0,0,0,0,0,0,255,193,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,255,193,0,0,255,193,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,254,220,255,107,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,255, 220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,254,211,0,0,0,0,0,0,0,0,0,0,255,220,255,220,255,220,0, 0,255,220,255,220,0,0,0,0,0,0,255,144,0,0,255,144,255,220,0,0,255,107, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,255, 220,0,0,255,220,0,0,0,0,0,151,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, 183,255,183,255,220,255,220,0,0,0,0,255,220,255,220,0,0,0,0,255,68,0,0, 255,78,255,144,255,144,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,255,220,255,220,0,0,255,220,0,0,0,0,0,0,255,220,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,255,211,255,220,255,220,0,57,0,0,255,220,0,0,0,0,255,220,0,0, 255,220,255,220,0,0,255,97,0,0,255,125,255,144,0,0,255,97,0,0,0,0,255, 220,255,220,255,220,255,183,0,0,0,0,0,0,0,0,255,220,0,0,0,0,255,220,0, 0,255,136,255,173,0,0,255,117,255,183,0,0,0,0,255,220,0,0,255,220,0,0, 255,220,0,0,0,57,0,0,255,220,255,220,0,0,255,220,255,220,0,0,255,220,255, 220,0,0,0,0,255,220,255,220,255,97,0,0,0,0,255,144,255,173,255,97,255, 117,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,254,248,255,3,0,47,0,0,255,211, 255,220,255,220,0,57,0,0,255,220,0,0,0,0,255,220,0,0,255,220,255,220,0, 0,255,97,0,0,255,125,255,144,0,0,255,97,0,0,0,0,255,220,255,220,255,220, 255,183,0,0,0,0,0,0,0,0,255,220,0,0,0,0,255,220,0,0,255,136,255,173,0, 0,255,117,255,183,0,0,0,0,255,220,0,0,255,220,0,0,255,220,0,0,0,57,0,0, 255,220,255,220,0,0,255,220,255,220,0,0,255,220,255,220,0,0,0,0,255,220, 255,220,255,97,0,0,0,0,255,144,255,173,255,97,255,117,0,0,0,0,0,0,255, 220,0,0,0,0,0,0,255,144,254,248,255,3,0,47,0,0,255,211,255,220,255,220, 0,57,0,0,255,220,0,0,0,0,255,220,0,0,255,220,255,220,0,0,255,97,0,0,255, 125,255,144,0,0,255,97,0,0,0,0,255,220,255,220,255,220,255,183,0,0,0,0, 0,0,0,0,255,220,0,0,0,0,255,220,0,0,255,136,255,173,0,0,255,117,255,183, 0,0,0,0,255,220,0,0,255,220,0,0,255,220,0,0,0,57,0,0,255,220,255,220,0, 0,255,220,255,220,0,0,255,220,255,220,0,0,0,0,255,220,255,220,255,97,0, 0,0,0,255,144,255,173,255,97,255,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,144, 254,248,255,3,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,173,255,164,255,144, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,255,220,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,0,0,0,255,107,255, 183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,255,220,0,0,255,68,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,144, 255,144,255,173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,164,255,144,255,183,0, 0,255,211,255,220,255,220,0,57,0,0,255,220,0,0,0,0,255,220,0,0,255,220, 255,220,0,0,255,97,0,0,255,125,255,144,0,0,255,97,0,0,0,0,255,220,255, 220,255,220,255,183,0,0,0,0,0,0,0,0,255,220,0,0,0,0,255,220,0,0,255,136, 255,173,0,0,255,117,255,183,0,0,0,0,0,0,0,0,255,220,0,0,255,220,0,0,0, 57,0,0,0,0,255,220,0,0,255,220,255,220,255,220,255,220,0,0,0,0,0,0,255, 220,255,220,255,97,0,0,0,0,255,144,255,173,255,97,255,117,0,0,0,0,0,0, 255,220,0,0,0,0,0,0,255,144,254,248,255,2,0,47,0,0,255,211,255,220,255, 220,0,57,0,0,255,220,0,0,0,0,255,220,0,0,255,220,255,220,0,0,255,97,0, 0,255,125,255,144,0,0,255,97,0,0,0,0,255,220,255,220,255,220,255,183,0, 0,0,0,0,0,0,0,255,220,0,0,0,0,255,220,0,0,255,136,255,173,0,0,0,0,255, 183,0,0,0,0,0,0,0,0,255,220,0,0,255,220,0,0,0,57,0,0,0,0,255,220,0,0,255, 220,255,220,255,220,255,220,0,0,0,0,0,0,255,220,0,0,255,97,0,0,0,0,255, 144,255,173,255,97,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,255,144,254,248, 255,2,0,47,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,255,220,0,0,0,0,255,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,220,255,220,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,211,255, 201,255,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,63,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,125,255,68, 255,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,255,211,255,220,255,211,0,0,255,220,0,0,0,0,255,220,255,211, 255,220,0,0,0,0,0,0,0,0,0,0,255,201,0,0,255,183,0,0,0,0,0,0,0,0,255,211, 0,0,255,211,0,0,0,0,0,0,255,211,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,86,254,201,0,0,255,68,255,13,255,31,255,97,0,0,255,136,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,0,0,0,0,0,0,254,173,254,164,0,0, 254,164,0,0,0,0,255,193,0,0,0,0,254,164,254,211,254,173,0,0,254,201,0, 0,254,173,0,0,254,193,255,68,255,144,0,0,255,136,254,173,254,164,0,0,254, 164,254,201,0,0,0,0,254,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, 211,254,248,0,0,0,0,0,0,0,0,255,211,255,183,0,0,0,0,0,0,0,75,0,114,0,57, 0,75,0,0,255,68,0,0,255,136,255,173,255,154,255,13,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,255,201,0,0,0,0,255,220,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,248,255,193,255,183,255,193,255, 193,255,183,255,193,255,183,255,183,0,0,0,0,0,0,0,0,0,0,255,136,0,0,255, 220,0,0,0,0,0,0,0,0,255,183,0,0,0,0,0,0,255,144,255,107,255,144,0,0,0, 0,0,0,255,183,255,183,0,0,255,183,0,0,0,0,254,125,255,183,0,0,0,0,255, 183,255,107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,183,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,38,255,183,255,144,255,183,255,183,255,183,0, 47,255,144,255,144,0,0,254,230,0,0,254,136,255,3,255,183,254,136,0,0,0, 0,0,0,0,0,0,0,255,220,0,0,0,0,0,0,255,183,255,183,255,183,0,0,0,0,0,0, 255,21,255,60,0,0,255,144,0,0,0,0,0,38,255,144,0,0,0,0,255,183,255,183, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,183,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 0,16,0,74,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,2,0,3,0,4,0,5,0,0,0,6,0,7,0,8,0,0,0,9,0,10,0,11,0,0, 0,0,0,12,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,25,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,27, 0,28,0,0,0,0,0,29,0,0,0,0,0,0,0,30,0,31,0,32,0,33,0,1,0,16,0,74,0,1,0, 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0, 0,4,0,5,0,6,0,7,0,0,0,8,0,9,0,8,0,0,0,10,0,8,0,8,0,0,0,0,0,11,0,8,0,12, 0,8,0,13,0,14,0,15,0,16,0,17,0,18,0,19,0,20,0,0,0,0,0,0,0,0,0,21,0,0,0, 22,0,23,0,24,0,25,0,26,0,26,0,27,0,0,0,0,0,28,0,26,0,29,0,30,0,0,0,23, 0,31,0,32,0,33,0,34,0,35,0,36,0,37,0,38,0,2,0,10,0,16,0,16,0,0,0,35,0, 38,0,1,0,40,0,42,0,5,0,44,0,46,0,8,0,49,0,60,0,11,0,69,0,70,0,23,0,75, 0,75,0,25,0,78,0,79,0,26,0,82,0,82,0,28,0,86,0,89,0,29,0,2,0,52,0,4,0, 0,0,36,0,44,0,5,0,2,0,0,0,0,0,0,255,216,0,0,255,177,0,0,255,163,0,0,255, 156,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,204,61,162, 207,0,0,0,0,209,125,253,244,0,0,0,0,209,125,253,244,0,1,0,0,0,10,0,224, 0,232,0,80,0,60,12,0,7,221,0,0,0,0,2,130,0,0,4,96,0,0,5,213,0,0,0,0,0, 0,4,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,96,0,0,0,0,0,0,1,104,0,0,4,96,0,0, 0,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,14,0,0,2,118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,90,0,0,1,14,0,0,0,90,0,0,0,90,0,0,1,14,0,0,0,0,0,0,0,0, 0,0,1,14,0,0,0,90,0,0,0,90,0,0,1,14,0,0,0,90,0,0,0,90,0,0,0,90,0,0,1,114, 0,0,0,90,0,0,0,90,0,0,2,56,0,0,251,143,0,0,0,60,0,0,0,0,0,0,0,0,0,40,1, 142,1,158,0,6,0,3,0,28,0,32,0,36,0,40,0,44,0,48,0,52,0,56,0,60,0,36,0, 0,0,68,0,0,0,100,0,0,0,132,0,0,0,164,0,0,0,216,0,0,1,12,0,0,1,34,0,0,1, 56,0,0,0,0,0,0,0,3,0,0,0,0,0,40,9,117,0,0,0,0,0,40,0,40,9,141,0,1,0,0, 0,40,0,0,9,150,0,0,0,0,0,0,0,3,0,0,0,0,0,40,9,117,0,0,0,0,0,40,0,40,9, 141,0,1,0,0,0,40,0,0,9,150,0,0,0,0,0,0,0,3,0,0,0,0,0,40,9,117,0,0,0,0, 0,40,0,40,9,141,0,1,0,0,0,40,0,0,9,113,0,0,0,0,0,0,0,3,0,0,0,0,0,40,9, 102,0,0,0,0,0,40,0,40,9,126,0,1,0,0,0,40,0,0,9,113,0,0,0,0,0,0,0,5,0,0, 0,0,0,40,9,114,0,0,0,0,0,40,0,40,9,152,0,1,0,0,0,40,0,40,9,138,0,0,0,0, 0,40,0,40,9,152,0,1,0,0,0,40,0,0,9,131,0,0,0,0,0,0,0,5,0,0,0,0,0,40,9, 114,0,0,0,0,0,40,0,40,9,152,0,1,0,0,0,40,0,40,9,138,0,0,0,0,0,40,0,40, 9,152,0,1,0,0,0,40,0,0,9,131,0,0,0,0,0,0,0,2,0,31,0,0,0,40,5,2,0,0,0,31, 0,40,0,0,5,2,0,1,0,0,0,0,0,2,0,64,0,0,0,40,4,40,0,0,0,64,0,40,0,0,4,40, 0,1,0,0,0,0,0,2,0,94,0,0,0,40,2,86,0,0,0,94,0,40,0,0,2,86,0,1,0,1,0,6, 0,11,0,12,0,61,0,62,0,91,0,92,0,1,0,3,0,31,0,64,0,94, } }, goxel-0.8.1/src/assets/icons.inl000066400000000000000000005326061334742672700166010ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/icons/icon128.png", .size = 10628, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,128,0,0,0,128,8,6, 0,0,0,195,62,97,203,0,0,41,75,73,68,65,84,120,156,237,125,121,148,100, 87,121,223,239,222,251,182,90,186,122,157,93,163,209,46,144,4,8,132,192, 6,155,193,145,100,203,38,44,33,30,111,96,67,192,1,12,18,139,188,0,78,114, 20,229,47,231,159,156,99,147,19,231,36,113,156,248,196,118,44,97,98,48, 16,97,73,54,2,44,27,193,32,130,228,145,4,154,209,236,211,107,237,85,111, 185,203,151,63,238,123,85,213,93,213,221,213,51,93,51,35,92,191,57,221, 53,93,245,222,125,239,213,253,221,239,126,219,253,46,48,198,24,99,140, 49,198,24,99,140,49,198,24,99,140,49,198,24,99,140,49,198,24,99,140,49, 198,24,99,140,49,198,24,99,252,112,130,93,234,27,184,52,32,246,250,247, 252,231,3,30,57,59,117,181,252,236,19,95,248,100,227,82,223,209,165,194, 75,142,0,135,238,127,208,91,94,226,123,194,165,19,139,127,255,208,175, 135,91,61,255,224,123,254,48,16,65,225,167,29,191,240,175,0,92,165,226, 246,183,101,220,250,108,18,86,30,13,230,171,167,31,127,252,1,53,130,219, 190,108,241,18,34,0,177,159,248,240,151,174,204,23,138,247,112,225,190, 93,198,237,167,226,168,241,103,50,170,124,253,27,127,248,190,101,128,209, 38,13,176,131,31,252,211,3,158,155,255,56,119,115,191,34,132,59,157,182, 11,163,165,84,73,116,76,198,141,135,147,118,243,115,172,89,123,234,31, 139,84,120,73,16,224,71,62,241,96,174,132,233,159,241,131,137,79,114,199, 127,13,231,66,128,8,90,197,109,41,219,79,171,176,246,185,56,108,255,229, 114,253,185,163,71,30,122,32,89,123,254,221,119,255,174,31,239,223,243, 83,110,190,240,175,133,19,188,134,49,46,6,93,135,140,38,173,146,170,146, 173,39,101,248,143,67,42,92,222,4,32,98,119,220,243,229,235,131,98,233, 19,142,155,255,69,46,220,201,65,135,25,45,181,150,225,233,36,106,62,162, 162,250,131,181,114,229,201,195,15,125,176,14,0,111,252,229,255,185,63, 40,78,124,212,13,10,239,229,194,157,29,238,145,187,82,65,203,248,97,56, 252,115,113,84,125,234,137,255,254,171,63,116,82,225,178,37,192,193,15, 63,88,204,231,103,223,233,56,133,223,20,110,112,19,227,156,111,118,14, 145,129,150,113,93,37,205,111,197,97,245,33,29,183,202,126,113,199,125, 92,120,183,115,62,120,212,111,4,225,120,112,130,9,98,224,85,41,219,79, 170,176,254,89,85,47,63,150,252,224,31,78,253,176,72,133,203,142,0,247, 223,79,252,155,149,199,110,225,129,255,91,174,151,127,7,23,110,97,171, 109,24,149,160,182,240,188,12,155,203,106,106,215,13,57,55,152,0,64,48, 70,3,180,153,170,0,48,198,224,248,69,120,65,9,76,56,233,187,4,173,164, 212,50,58,166,162,198,95,201,184,249,57,102,150,191,243,240,103,126,185, 1,96,243,70,47,83,92,86,4,120,203,167,190,56,45,216,206,95,18,126,240, 113,6,118,45,1,108,152,14,235,130,32,163,38,26,75,71,209,88,62,14,48,160, 56,125,5,220,220,36,188,252,20,28,47,15,34,2,105,9,34,51,176,5,46,92,184, 185,18,92,175,0,176,193,95,79,170,43,212,100,220,252,182,78,90,159,141, 91,229,71,212,145,167,79,190,20,165,194,101,65,128,131,247,255,141,83, 10,157,215,58,185,201,79,9,47,248,41,206,157,0,32,144,49,48,90,129,140, 2,109,66,4,34,141,168,177,140,86,249,36,226,118,25,50,108,128,9,7,133, 169,189,16,110,0,225,6,112,188,60,28,191,8,199,13,64,68,48,42,177,82,1, 4,48,6,199,205,193,203,77,130,59,222,144,119,78,208,90,73,157,132,199, 85,220,252,74,88,61,247,231,141,230,217,239,60,249,199,31,123,201,72,133, 75,78,128,187,126,253,43,59,11,249,217,247,9,183,240,97,238,120,87,48, 214,63,236,136,12,72,43,24,163,64,166,127,228,106,21,33,172,205,35,172, 47,64,37,109,24,21,67,70,77,112,225,32,159,18,128,59,62,132,227,129,11, 55,37,68,30,194,245,1,34,24,45,45,65,252,2,24,219,84,213,24,0,130,140, 91,20,214,231,107,73,171,246,109,25,55,62,75,73,245,17,113,166,118,217, 75,133,75,70,128,219,62,240,109,119,239,180,250,113,39,87,248,180,227, 6,111,98,92,108,62,236,200,206,227,38,19,225,100,32,163,6,194,218,60,146, 168,14,163,98,104,149,172,33,192,190,148,0,94,135,0,92,184,96,220,1,119, 60,56,110,128,92,105,23,188,92,9,42,137,160,100,4,50,195,247,25,165,247, 32,163,122,74,78,130,73,165,130,140,27,95,145,97,227,207,37,146,203,86, 42,92,10,2,176,183,252,246,19,123,5,247,63,236,250,133,247,11,225,238, 90,111,174,221,8,70,37,104,215,206,33,106,44,65,203,16,70,43,24,157,64, 43,9,163,34,200,168,1,46,220,141,9,32,92,112,238,32,40,237,68,80,152,5, 23,14,192,0,45,99,168,36,132,209,201,134,83,143,209,18,73,187,10,37,195, 129,202,101,166,43,168,184,117,217,74,133,139,74,128,131,239,249,195,32, 55,119,245,93,185,137,153,79,57,94,254,117,140,113,103,243,179,250,161, 101,132,184,85,70,216,88,128,150,49,72,203,62,2,36,41,1,10,41,1,132,227, 129,175,34,128,11,46,156,14,1,188,156,117,49,48,198,193,133,3,198,5,140, 86,80,73,27,90,197,32,163,123,238,128,160,146,16,73,187,10,163,229,16, 119,220,47,21,168,81,63,124,57,120,27,207,171,3,182,14,98,63,113,239,255, 185,38,31,236,248,168,227,231,126,153,49,62,77,70,3,156,97,192,148,191, 126,43,70,67,70,13,36,97,13,70,37,67,153,116,93,176,193,127,50,172,154, 247,137,12,180,74,0,198,192,185,3,47,87,2,200,64,201,8,42,9,161,85,12, 25,214,33,163,198,186,150,196,160,107,115,225,186,60,231,94,239,4,197, 235,220,96,242,221,109,49,255,111,0,252,199,45,60,192,72,48,114,2,220, 245,238,63,42,120,187,190,250,86,238,237,253,164,112,131,87,48,198,5,25, 3,109,98,48,38,237,104,19,206,166,202,151,150,17,146,118,5,42,105,247, 136,229,243,17,96,108,184,51,83,229,208,104,9,198,69,199,146,104,87,207, 89,130,156,39,72,43,150,132,213,201,118,245,140,123,222,141,108,35,70, 71,128,251,239,231,119,151,95,255,50,145,47,253,134,227,230,126,150,11, 119,98,237,33,157,209,166,37,56,119,58,162,119,213,49,198,64,70,117,59, 234,135,18,183,91,5,91,215,222,239,222,131,134,54,218,190,202,200,154, 145,174,15,163,18,104,149,164,211,195,102,210,136,172,194,218,88,130,138, 219,218,168,120,105,219,30,225,2,48,18,2,220,125,239,151,75,172,229,255, 188,59,81,188,143,11,255,134,77,221,184,217,104,51,202,142,54,225,128, 49,1,173,146,158,81,191,70,220,14,236,179,158,55,201,164,132,161,1,159, 159,159,234,99,9,27,195,168,4,4,2,99,28,194,241,145,198,14,64,70,15,156, 22,200,104,68,141,37,68,205,101,128,8,100,180,34,69,203,231,117,19,219, 140,109,37,192,161,67,15,138,218,158,201,91,157,160,240,73,199,203,191, 133,9,39,191,165,6,136,64,90,65,170,24,90,198,169,118,191,245,81,175,84, 132,234,210,243,136,195,50,226,184,130,201,29,55,32,63,177,107,221,227, 135,214,67,58,83,15,129,140,134,209,49,136,52,236,28,239,128,113,23,140, 217,14,207,148,70,149,132,104,87,78,35,9,107,96,156,131,11,23,0,69,100, 226,234,150,31,108,4,216,86,2,180,14,236,190,171,56,49,243,251,32,28,32, 50,91,30,102,4,130,138,91,72,218,101,144,49,16,110,48,228,153,246,82,68, 132,176,181,128,149,179,255,15,237,218,25,128,8,43,103,191,139,122,229, 40,38,102,174,198,244,206,155,80,156,218,159,118,66,255,249,195,220,95, 47,9,0,2,145,245,86,202,184,5,192,128,49,39,53,59,93,196,205,21,52,150, 142,65,171,200,90,30,224,217,125,134,6,166,54,228,195,141,20,219,74,0, 238,122,7,28,47,127,37,231,14,211,90,194,168,24,70,15,51,63,90,187,62, 106,45,67,134,53,16,25,8,55,183,165,107,107,29,163,186,244,28,42,11,207, 64,198,77,219,81,12,176,38,91,11,213,197,35,104,84,94,68,97,242,10,204, 236,186,5,165,185,107,225,5,147,0,219,130,37,66,4,251,207,62,82,246,154, 145,193,40,9,163,91,72,194,42,252,194,108,106,82,186,48,70,194,222,140, 253,33,163,91,224,73,115,75,15,56,34,108,43,1,140,150,21,149,68,154,51, 198,193,88,106,119,147,181,209,141,26,236,44,33,131,36,172,34,170,47,64, 203,8,96,28,124,75,238,1,66,212,94,193,242,217,195,104,86,78,193,232,245, 53,116,163,18,52,42,199,209,170,159,70,238,236,78,76,239,186,25,211,187, 111,65,126,114,247,112,87,34,51,216,244,36,116,222,231,194,133,95,152, 69,48,177,3,140,9,20,166,247,35,110,45,163,93,95,128,140,26,150,68,164, 234,90,55,219,91,120,200,145,97,91,9,192,192,107,0,41,34,114,141,150,48, 177,6,99,12,92,120,16,194,181,145,184,158,192,142,146,33,194,234,25,68, 173,50,64,100,231,209,204,28,220,212,198,103,48,164,81,91,254,1,86,206, 126,7,113,88,29,218,46,39,163,17,54,23,16,181,151,81,94,120,26,97,114, 7,230,246,188,6,185,194,78,112,190,190,117,214,105,127,213,189,117,255, 47,220,0,65,113,22,110,80,234,60,135,227,229,224,120,251,145,43,237,134, 140,26,104,215,231,161,86,98,153,43,92,227,195,138,132,75,234,30,222,86, 2,40,35,235,62,81,2,206,82,249,109,160,165,132,140,27,0,1,220,241,225, 248,86,47,12,107,231,208,44,159,132,78,66,48,33,236,188,188,5,199,78,18, 215,177,120,242,9,84,22,142,88,167,208,121,128,136,144,196,53,172,44,63, 141,102,120,6,133,194,62,76,205,220,136,98,233,10,56,78,14,125,186,1,89, 81,223,251,119,246,151,227,23,224,231,103,224,120,65,255,121,200,36,195, 12,188,252,20,138,51,7,94,165,146,246,159,204,221,115,219,131,166,213, 120,88,29,251,254,37,115,15,111,175,14,160,101,19,160,24,224,232,204,121, 12,176,249,123,9,146,168,14,17,249,8,138,115,136,219,21,168,184,5,0,96, 232,79,214,161,117,6,6,145,70,179,118,26,203,103,15,163,81,62,190,137, 149,48,204,220,110,143,209,42,66,189,118,20,205,198,73,4,185,57,76,78, 95,143,210,228,53,240,252,238,104,166,1,35,159,49,6,39,152,176,97,228, 62,229,114,192,213,24,135,235,23,2,215,207,31,244,114,147,111,212,133, 246,139,201,228,204,151,238,184,233,179,159,121,236,247,127,246,216,16, 55,188,173,216,94,2,80,208,34,80,180,250,107,183,68,96,140,35,40,206,34, 63,181,15,94,80,66,126,106,15,218,213,115,104,44,191,136,184,85,70,214, 229,150,47,26,164,21,200,104,251,229,167,74,154,146,109,84,22,159,65,101, 233,89,104,21,97,107,210,115,48,25,24,99,171,188,144,198,72,180,91,243, 8,219,11,88,89,250,30,74,147,87,99,106,230,6,4,185,29,0,233,85,151,100, 140,195,241,11,112,253,2,24,219,106,198,25,131,112,60,71,56,222,245,196, 240,17,217,174,61,1,224,165,77,0,133,102,232,81,169,181,246,125,238,120, 200,149,118,33,40,206,129,59,118,148,56,94,30,165,157,215,160,48,125,5, 162,198,34,154,229,83,136,91,101,40,25,66,69,77,48,225,164,230,147,15, 46,28,196,113,21,43,243,223,69,216,60,183,105,114,200,133,131,64,4,36, 113,13,203,139,223,69,181,252,60,10,19,251,144,115,231,32,88,0,33,60,48, 238,192,205,21,32,134,136,98,111,112,21,168,168,137,168,177,148,132,181, 249,242,54,62,192,208,216,86,2,56,113,49,34,162,150,29,241,44,19,119,240, 11,51,235,36,91,48,8,215,71,97,102,63,114,165,93,136,90,101,212,22,190, 143,106,107,5,170,93,181,83,4,99,104,55,207,161,81,61,6,173,99,48,206, 193,184,176,46,227,97,120,176,217,44,176,70,2,116,145,201,35,64,169,16, 181,202,11,88,40,255,45,92,228,177,255,198,159,70,126,114,31,68,154,57, 68,100,0,99,82,98,14,71,78,34,131,164,93,69,18,214,160,101,20,73,165,94, 250,4,72,242,47,38,142,185,165,1,0,140,9,120,249,194,208,115,35,119,60, 228,39,119,35,40,206,97,114,215,13,168,205,127,31,181,133,231,177,116, 250,73,180,26,103,97,211,182,56,24,227,29,18,24,153,88,247,113,102,199, 15,45,24,134,245,81,117,73,0,0,174,91,196,220,174,87,35,63,185,183,211, 249,246,89,57,32,56,24,89,199,208,186,230,98,10,99,20,226,214,10,100,212, 76,205,66,106,130,228,37,113,12,109,43,1,166,138,129,148,134,106,92,184, 112,253,60,132,151,219,114,138,21,23,78,74,132,89,20,231,174,132,155,47, 98,225,248,19,104,86,78,216,184,60,96,71,45,152,13,196,104,157,254,141, 142,174,64,105,71,12,51,47,51,182,89,48,136,0,112,228,114,115,152,221, 251,79,144,47,238,238,11,88,245,52,6,198,4,24,56,200,80,39,107,169,23, 74,70,136,155,203,54,137,36,131,81,245,132,162,75,226,24,218,230,96,208, 77,200,79,78,145,95,40,193,104,182,133,120,249,106,216,68,140,16,174,63, 129,189,55,222,137,185,253,175,69,229,220,51,88,56,254,4,234,203,47,64, 201,182,245,200,105,13,163,21,176,202,69,155,106,235,198,128,57,14,140, 86,224,140,175,31,59,218,196,11,200,152,131,210,196,1,204,204,222,2,207, 43,109,122,124,214,48,227,204,18,161,51,61,24,200,184,129,168,177,12,173, 226,180,109,75,62,67,84,86,101,92,18,199,208,54,19,224,8,220,252,79,82, 97,178,104,109,236,80,34,137,229,192,68,206,129,176,203,189,160,146,176, 67,30,198,56,252,194,12,118,93,251,227,152,185,226,86,212,22,158,195,194, 139,79,160,186,248,44,140,76,58,231,165,162,52,253,194,83,9,0,130,142, 67,123,125,215,102,4,101,254,248,46,50,23,109,63,28,17,96,106,250,229, 152,154,186,30,194,25,54,46,177,166,117,198,65,12,72,218,21,132,141,197, 53,102,171,37,166,81,201,10,150,112,254,73,6,23,128,109,37,192,77,56,164, 142,170,90,53,106,3,142,203,225,231,125,248,57,23,113,36,33,35,9,179,1, 17,200,232,52,227,38,193,160,201,156,49,6,47,40,97,199,149,183,99,122, 207,205,168,47,29,197,252,209,175,97,233,228,97,36,237,149,1,54,122,154, 86,174,100,22,130,5,215,26,34,35,130,16,89,195,3,98,1,12,65,48,131,217, 217,87,162,80,216,187,190,200,31,2,198,40,196,141,101,68,173,21,24,21, 119,238,147,49,150,121,18,64,164,23,142,28,130,194,3,231,125,153,243,198, 182,18,224,129,7,24,189,235,63,44,84,136,0,37,1,173,0,46,56,252,156,37, 66,18,41,36,145,76,3,68,25,172,147,72,37,225,154,188,187,117,192,24,28, 175,128,153,125,175,192,228,206,27,176,247,134,59,177,112,244,235,88,60, 241,77,132,141,69,144,206,72,198,178,24,161,13,207,42,59,45,144,81,224, 90,217,28,65,215,235,83,214,24,227,152,152,56,128,157,187,95,135,32,55, 99,163,125,74,118,215,15,108,1,90,198,136,154,139,72,194,122,119,13,66, 39,72,197,83,63,48,131,49,242,28,30,120,224,252,230,203,11,196,118,39, 132,16,12,171,100,218,51,145,37,129,214,128,16,28,94,224,193,15,28,196, 41,17,180,146,157,60,187,173,229,247,1,214,132,12,48,181,251,101,40,237, 188,14,87,190,226,173,88,56,246,4,206,126,255,175,209,92,57,62,48,109, 139,200,128,148,180,68,208,150,8,220,241,160,101,4,193,2,56,78,14,211, 179,55,99,110,231,173,118,101,144,189,10,56,119,58,233,232,235,5,181,214, 66,197,45,132,141,69,168,164,5,210,218,198,64,50,18,81,234,33,229,12,48, 100,140,150,243,91,124,248,109,195,182,103,4,105,50,43,68,100,88,239,100, 155,17,65,1,194,225,240,124,15,142,231,160,89,73,191,148,11,112,236,112, 97,19,55,243,165,157,152,220,117,35,174,184,233,167,48,255,194,215,113, 250,217,175,160,177,116,20,134,250,93,236,25,17,200,24,168,176,137,164, 94,70,97,122,63,118,239,127,3,38,103,111,132,88,107,182,50,155,240,193, 133,0,25,3,173,165,245,84,14,202,254,33,130,12,107,136,154,75,54,99,217, 104,24,147,45,106,209,105,115,188,199,98,49,146,136,22,207,251,11,184, 64,108,59,1,200,168,10,145,49,128,24,104,255,101,68,0,8,92,120,8,138,179, 80,73,104,87,244,100,26,253,80,96,16,174,7,199,203,119,76,77,46,28,20, 103,174,196,181,175,253,5,236,125,217,29,88,60,246,247,56,243,252,35,168, 45,60,7,165,162,65,55,11,16,161,80,220,135,43,175,123,11,38,166,14,128, 109,152,189,198,192,184,128,195,5,72,24,24,35,97,84,119,157,33,25,141, 184,85,70,220,42,67,235,164,147,25,68,70,217,103,35,3,128,217,80,9,113, 128,52,26,213,83,113,101,254,123,151,44,61,108,219,9,192,24,175,49,34, 181,89,219,70,83,39,254,239,184,1,92,47,7,37,67,200,120,115,34,48,198, 225,120,121,235,140,25,96,150,49,46,144,47,237,198,129,87,189,13,123,174, 127,19,150,79,125,7,167,159,123,4,149,179,79,67,38,93,79,181,112,3,236, 185,238,205,184,230,214,159,67,144,159,29,210,196,203,174,193,33,184,15, 46,92,144,214,144,113,19,97,125,1,73,88,181,235,25,73,119,8,208,93,223, 104,44,89,137,129,140,68,125,249,40,150,207,124,167,29,86,87,42,67,95, 120,155,49,2,9,144,212,9,148,0,216,216,110,202,156,119,70,67,25,109,147, 65,157,0,142,151,131,74,162,148,8,107,147,58,109,88,213,241,242,155,120, 23,51,77,219,154,144,123,111,188,3,59,174,122,29,42,103,159,193,153,231, 31,197,202,233,167,192,184,192,213,183,30,194,190,151,221,217,153,239, 207,7,140,113,104,74,16,53,22,17,183,43,61,163,94,119,196,190,73,23,174, 216,152,56,96,84,132,234,210,179,168,173,252,0,42,9,27,0,234,231,125,3, 23,136,237,151,0,90,55,137,40,222,244,184,142,253,109,59,171,75,4,14,238, 248,200,121,1,148,140,161,226,22,116,106,59,103,4,217,220,187,184,38,30, 201,24,188,96,18,187,174,126,3,102,175,184,21,75,199,191,5,37,219,216, 119,227,155,193,184,59,116,218,218,32,216,145,191,136,36,170,119,20,61, 179,70,244,119,214,23,48,6,37,67,148,23,159,65,171,118,10,96,0,145,169, 233,92,216,23,64,187,88,24,129,4,208,45,16,54,175,222,197,88,111,255,247, 156,111,160,77,4,195,56,184,227,34,40,206,194,232,24,54,66,119,254,246, 184,189,38,32,163,38,100,104,87,100,181,43,167,81,152,222,13,215,47,194, 104,3,173,135,211,240,129,52,153,36,172,89,207,158,140,210,142,86,105, 106,184,238,172,102,238,18,64,65,38,13,84,22,159,65,216,94,182,49,13,198, 1,208,202,68,165,16,93,170,12,209,109,39,64,168,26,161,43,195,182,205, 140,217,12,235,207,185,105,185,23,24,198,225,229,2,20,74,62,148,52,136, 219,18,74,110,94,47,160,191,61,141,86,249,52,170,243,207,33,110,149,225, 229,38,17,54,171,208,74,33,40,78,35,40,206,192,15,114,80,74,165,138,221, 250,237,147,49,86,217,107,151,237,26,1,163,108,209,137,108,212,155,140, 0,86,73,212,42,70,216,90,68,101,233,8,100,210,180,138,102,103,10,164,165, 211,215,250,18,167,183,244,56,219,134,109,39,192,11,71,190,16,77,237,184, 162,181,115,223,109,152,154,185,1,206,186,21,94,108,64,103,211,245,52, 100,32,99,137,176,237,195,245,4,10,147,2,90,105,68,109,9,149,12,71,4,163, 19,52,87,78,160,185,114,2,42,105,195,70,22,1,48,192,24,141,184,221,128, 86,10,94,110,2,65,97,18,204,43,66,201,4,90,174,173,36,194,160,117,130, 184,185,2,25,213,83,191,64,215,204,51,70,117,235,24,164,98,95,201,8,173, 218,41,155,196,162,99,27,202,238,16,159,192,24,205,227,241,199,135,240, 128,141,6,219,78,0,167,122,52,174,243,176,222,110,157,69,97,98,31,118, 236,121,205,64,34,176,206,175,225,64,6,72,34,64,114,192,117,5,10,37,1, 173,53,226,182,132,140,215,39,130,78,218,104,172,28,71,88,95,237,135,183, 238,223,238,13,24,99,144,196,109,104,109,224,5,5,248,249,34,60,63,128, 76,18,40,25,131,12,65,201,208,70,242,146,112,205,60,111,59,187,179,74, 57,29,249,74,134,104,53,78,163,213,58,3,238,121,128,98,171,188,157,100, 12,105,169,231,113,9,19,67,183,157,0,106,42,150,12,168,25,163,208,168, 157,64,171,113,6,133,137,125,216,185,247,118,76,206,92,159,38,91,158,63, 200,0,73,12,72,105,137,144,159,16,48,121,141,168,173,32,147,213,21,68, 100,84,71,179,124,18,73,187,182,122,36,19,144,185,98,1,172,38,34,25,200, 36,130,49,6,174,159,131,23,4,112,125,15,141,149,121,132,245,165,206,106, 160,76,217,51,186,59,218,123,127,100,210,66,163,118,2,81,180,4,112,6,39, 200,3,140,217,8,166,74,108,13,130,184,173,129,75,231,5,4,70,64,128,35, 128,190,153,168,163,211,116,137,112,22,197,210,126,236,216,115,27,38,103, 174,131,227,12,206,158,29,12,90,155,155,97,137,144,88,34,56,25,17,140, 139,184,45,145,68,9,162,230,10,218,213,115,214,21,75,182,114,71,150,177, 211,159,112,218,191,102,144,200,64,37,118,228,115,71,32,14,107,118,205, 1,217,32,83,54,250,59,18,64,73,91,157,68,75,200,184,142,122,237,69,36, 73,45,93,2,47,108,18,11,227,128,227,66,248,57,56,90,67,184,1,180,150,215, 236,250,209,187,118,46,252,221,35,75,184,4,146,96,251,23,135,62,244,144, 161,67,247,85,108,208,163,87,196,74,212,171,199,208,172,159,74,137,240, 26,228,243,123,6,102,4,111,5,68,128,76,108,240,201,113,57,114,5,15,97, 125,5,237,218,252,224,101,220,233,87,220,141,0,178,85,47,171,193,64,68, 208,82,217,196,147,85,157,175,59,249,8,90,203,116,209,104,140,40,172,160, 81,127,17,74,181,0,222,237,120,171,248,241,110,18,170,112,32,252,192,129, 49,191,173,181,250,167,251,223,248,142,63,97,82,127,225,228,129,224,36, 30,122,232,162,233,4,163,88,29,76,0,95,55,191,173,151,8,249,226,30,204, 206,189,2,197,210,149,16,194,223,176,197,53,2,160,243,126,71,155,78,137, 160,37,33,137,218,221,185,118,189,49,149,233,0,61,141,174,166,68,247,51, 74,215,0,2,221,148,175,142,143,63,93,2,167,101,132,176,189,136,70,253, 4,140,73,210,188,197,180,211,179,209,159,18,160,251,202,192,28,39,224, 174,255,58,242,131,215,24,165,62,116,213,162,252,28,222,248,115,15,230, 43,244,236,145,35,15,141,60,71,96,36,203,195,141,81,101,34,162,65,21,191, 186,199,72,52,235,39,209,110,158,67,161,184,23,51,115,175,64,177,180,127, 99,34,12,129,161,242,50,41,101,206,170,187,219,96,58,90,147,112,178,202, 199,111,84,170,236,157,65,179,121,10,4,221,237,252,108,244,247,118,58, 95,243,119,150,64,203,93,135,59,254,203,56,231,159,2,240,158,100,34,254, 191,87,237,252,197,255,21,150,151,191,189,240,189,71,70,230,40,26,81,129, 8,42,19,72,179,33,218,55,70,162,81,63,129,86,243,236,186,68,32,100,189, 58,160,147,214,121,187,247,227,62,244,37,129,176,30,133,112,13,49,24,235, 164,116,33,235,124,210,48,100,59,95,203,16,245,234,49,180,163,121,59,223, 195,73,59,52,27,241,60,213,3,120,247,186,189,18,0,233,223,60,91,75,233, 112,0,251,184,235,189,95,120,185,119,58,65,254,107,133,93,239,250,163, 200,180,190,118,246,177,191,40,175,247,72,231,139,145,16,128,17,175,49, 194,166,1,161,94,172,37,194,236,142,87,162,56,177,31,195,84,143,27,10, 61,95,155,49,105,92,191,15,221,73,96,149,97,176,42,219,215,164,122,128, 129,74,90,88,153,255,46,154,181,83,16,65,14,194,11,108,166,15,145,213, 82,179,78,238,116,126,47,9,50,18,218,41,66,244,102,41,1,96,140,51,225, 122,51,194,113,223,161,117,112,23,87,249,195,215,222,241,238,63,142,20, 125,249,204,227,215,157,5,182,39,129,100,36,4,208,70,215,29,64,98,179, 128,208,0,116,136,208,58,135,98,241,10,204,236,184,5,19,165,3,27,159,180, 137,20,232,133,76,154,40,47,62,131,122,253,24,230,204,107,80,154,185,182, 155,239,183,90,40,116,222,232,204,251,100,58,100,72,162,42,22,207,124, 43,245,233,179,206,212,192,28,23,194,113,1,198,187,239,101,101,104,214, 74,0,88,73,33,92,111,195,76,99,225,184,5,225,184,111,50,174,255,35,92, 38,31,185,246,39,143,63,168,162,159,255,220,9,54,255,3,60,254,248,5,173, 41,28,9,1,136,88,147,64,49,3,250,234,2,13,11,163,19,212,107,199,208,108, 158,198,196,196,126,236,220,247,122,148,166,175,30,74,71,88,103,85,33, 162,246,18,150,206,29,70,187,113,22,142,42,226,220,201,175,163,86,121, 1,179,187,95,137,201,153,235,224,13,44,17,203,86,45,252,32,210,8,91,11, 88,60,157,166,160,145,45,21,195,122,200,98,140,6,23,188,19,174,182,149, 78,83,165,180,87,2,112,97,71,254,230,133,208,1,0,92,56,30,23,206,43,141, 235,223,44,188,220,175,94,35,115,127,169,15,238,250,19,55,87,127,234,133, 135,31,222,52,0,55,8,35,33,128,163,162,22,67,126,203,219,185,12,130,209, 9,106,213,163,104,54,78,99,98,234,42,236,220,243,90,76,76,93,221,191,36, 107,93,51,193,142,216,70,245,56,150,231,159,66,18,86,59,126,0,50,10,237, 230,57,68,39,86,80,89,121,14,179,187,95,133,169,217,27,225,231,38,87,53, 70,166,171,249,55,170,39,177,120,230,155,72,194,74,167,253,65,186,174, 37,130,74,139,95,185,96,174,159,78,29,214,107,201,185,0,119,189,45,175, 155,0,0,46,132,224,66,92,37,92,239,30,237,250,239,72,154,252,16,128,111, 110,185,33,140,136,0,10,104,11,67,237,45,175,151,220,0,90,199,168,174, 60,143,70,237,4,74,83,215,88,34,76,94,185,169,142,96,116,130,242,210,51, 168,44,62,147,198,1,82,172,114,42,105,75,132,23,87,80,89,250,7,204,238, 190,21,211,59,94,142,32,55,221,89,172,106,180,68,117,249,57,44,157,61, 12,213,41,238,65,221,182,86,185,21,123,29,74,4,100,169,96,194,233,116, 186,173,37,52,252,82,178,129,96,140,105,25,7,82,54,6,164,59,13,135,145, 16,64,184,78,4,96,36,166,139,86,17,42,203,71,80,175,30,235,39,66,71,10, 216,47,85,38,77,44,157,253,22,106,229,163,157,202,33,246,16,182,70,205, 179,32,210,104,183,22,16,29,127,12,229,165,167,49,183,251,213,152,217, 117,11,84,210,194,210,252,119,80,158,255,94,186,42,25,232,94,5,232,116, 58,235,102,57,116,124,9,221,198,211,26,196,2,78,16,64,184,190,141,27,200, 120,232,125,12,86,221,171,49,80,113,27,38,142,202,76,135,231,157,82,54, 18,2,240,10,197,180,219,140,180,12,106,31,17,246,190,22,19,147,7,32,184, 0,64,8,219,139,88,56,245,119,104,55,206,193,86,242,234,98,176,43,184,39, 70,71,6,97,107,17,103,142,63,134,149,197,239,1,154,80,89,248,7,24,147, 244,54,210,125,221,40,149,108,173,175,129,144,38,160,36,96,66,192,9,242, 54,7,66,90,55,242,48,68,32,99,160,162,150,77,87,39,51,31,215,245,121,167, 19,140,132,0,73,78,72,239,34,165,57,101,68,104,84,143,97,114,230,122,236, 216,253,106,212,202,47,224,236,241,175,34,142,42,235,22,154,232,179,247, 7,128,200,32,108,47,65,133,205,62,18,217,3,210,166,214,54,196,6,188,219, 235,102,76,77,69,82,10,134,49,112,46,224,248,57,144,241,210,226,147,235, 19,129,140,134,138,218,118,193,139,125,227,212,210,14,92,94,83,192,11, 19,243,234,38,186,186,58,138,182,215,131,82,17,86,22,159,70,117,229,7, 136,235,75,72,226,33,7,197,154,80,192,32,78,88,187,190,239,93,172,213, 1,108,191,175,207,170,190,105,193,54,158,134,144,53,56,231,16,94,0,238, 250,118,229,179,234,205,71,96,214,235,24,182,64,90,117,207,37,58,134,175, 157,191,41,120,62,187,35,108,142,135,30,50,128,186,36,153,174,90,69,208, 27,84,10,91,141,213,162,191,191,251,123,2,13,189,50,127,237,232,164,110, 91,157,243,214,113,51,175,189,98,183,13,130,209,26,42,73,96,180,1,119, 125,184,185,162,117,46,113,110,23,204,246,118,62,0,178,218,233,5,85,21, 25,13,1,178,128,208,200,43,121,172,115,233,97,176,105,10,248,42,95,96, 247,133,86,189,147,22,122,168,217,69,168,125,229,108,51,87,111,79,123, 195,76,61,70,67,203,4,58,93,185,196,133,11,21,173,238,124,123,15,20,26, 50,39,55,121,144,13,49,186,98,209,82,149,201,35,98,91,73,182,31,37,122, 107,251,108,234,54,92,253,249,122,217,70,140,11,48,97,160,195,6,72,73, 232,36,130,91,40,217,106,40,3,157,59,172,27,133,28,230,150,141,129,54, 9,116,18,13,94,55,105,168,174,181,186,160,132,146,145,17,128,56,171,128, 96,46,56,224,191,221,72,243,20,248,102,37,234,87,7,3,250,62,206,138,89, 102,133,172,8,128,78,66,24,25,67,121,77,184,197,73,184,185,34,216,154, 5,82,155,147,111,192,45,235,193,102,34,145,89,49,136,46,168,180,204,200, 8,192,225,84,25,227,10,96,67,22,243,185,136,72,221,176,204,113,186,225, 90,96,112,110,72,22,10,238,61,55,219,75,48,37,83,167,202,8,217,12,40,221, 174,65,182,235,112,242,19,240,75,179,150,8,142,215,177,0,182,138,245,86, 77,19,153,115,66,213,46,200,220,30,149,14,0,67,73,29,12,146,103,201,16, 23,19,91,224,27,227,28,76,184,96,142,155,222,231,0,7,81,143,182,207,210, 61,13,58,177,125,116,59,159,58,145,66,157,86,48,81,136,235,43,8,203,243, 144,173,90,186,58,104,171,4,160,193,4,32,130,73,226,19,231,14,31,62,111, 19,16,24,165,14,192,68,3,196,98,128,21,89,58,74,58,21,60,46,9,214,77,13, 178,191,211,194,83,131,79,77,3,62,92,88,50,24,3,234,36,149,246,36,139, 24,3,34,13,206,29,56,185,162,45,68,145,234,2,113,179,10,25,181,144,159, 221,219,41,149,55,220,109,15,32,0,17,180,140,73,37,225,49,0,23,244,133, 142,78,7,208,104,17,81,15,59,179,248,55,3,96,214,85,172,46,6,250,242,1, 123,192,185,0,88,186,112,35,251,242,83,157,129,64,96,198,128,24,7,99,189, 157,110,58,175,92,184,105,231,187,169,164,200,242,1,237,181,116,28,130, 187,254,192,221,81,6,33,11,65,247,188,1,109,119,42,81,134,204,5,23,150, 28,25,1,20,147,109,23,166,175,240,145,253,242,173,187,246,210,18,161,95, 29,235,141,231,48,38,192,4,3,25,187,139,152,33,9,70,0,165,254,254,44,233, 195,46,7,51,233,254,6,30,156,92,177,103,154,232,205,7,180,121,0,224,28, 164,37,180,81,233,214,117,27,19,129,76,79,165,177,180,243,201,46,97,107, 27,163,47,120,61,209,232,148,64,25,71,0,91,55,32,148,17,129,177,110,194, 197,104,176,150,96,61,222,187,206,205,172,125,163,231,131,76,127,97,12, 157,104,83,71,228,119,55,177,20,158,15,39,40,130,139,180,136,101,39,31, 48,235,124,150,18,171,91,13,189,75,4,145,110,101,215,175,131,116,36,64, 111,231,219,15,106,144,241,194,5,124,49,0,70,72,0,198,85,76,180,121,64, 136,113,14,14,1,67,221,88,249,200,144,185,116,7,213,20,232,249,189,202, 147,151,21,117,2,3,245,116,62,210,180,112,210,26,194,203,193,9,242,224, 220,89,147,12,218,211,249,200,140,128,126,87,48,105,5,157,46,145,95,75, 4,210,26,48,166,83,109,164,123,154,89,242,201,92,176,183,117,100,4,136, 106,251,165,87,84,155,7,132,8,0,103,224,204,206,189,198,104,24,186,176, 178,49,131,47,178,17,216,6,127,245,188,73,182,173,76,98,25,163,225,4,133, 116,219,59,214,147,245,219,223,249,221,76,228,117,172,128,94,34,48,209, 153,26,72,171,158,157,201,122,14,55,250,108,46,89,190,224,144,251,200, 8,112,21,160,86,104,139,97,202,204,65,67,34,77,185,182,185,248,163,193, 144,230,88,70,68,66,58,250,87,39,134,114,215,179,59,135,49,214,137,24, 102,201,158,189,82,36,171,14,178,169,73,108,119,20,73,37,2,135,138,219, 125,46,96,0,32,67,47,190,240,194,11,23,188,110,96,100,6,250,227,143,63, 160,115,14,43,243,77,191,231,254,14,182,187,140,216,228,74,171,32,109, 163,55,185,119,30,222,244,88,214,77,31,203,150,150,17,217,50,176,153,114, 150,230,9,50,198,32,188,156,45,143,43,220,190,206,135,49,91,116,4,89,137, 48,104,51,12,34,67,100,212,49,108,195,232,24,229,206,161,116,251,129,137, 114,203,248,56,94,142,80,143,212,150,165,58,99,28,66,112,16,79,181,237, 11,85,20,211,90,190,221,117,6,67,128,186,29,143,14,9,250,37,147,237,100, 109,171,137,121,129,85,16,211,98,214,157,117,5,27,77,1,3,47,77,3,171,172, 146,161,4,134,142,15,221,208,6,24,233,214,177,62,67,101,118,198,167,157, 37,143,157,170,196,56,89,142,208,78,182,190,236,205,110,208,232,194,100, 94,182,173,18,129,0,187,248,34,53,171,76,111,58,207,128,240,46,122,7,112, 127,231,83,182,86,109,192,25,171,136,32,92,187,255,97,28,90,49,190,94, 205,226,245,110,123,221,170,227,166,69,74,157,217,66,83,235,98,164,4,32, 134,10,136,76,222,19,226,134,157,121,236,153,244,112,124,57,194,153,90, 140,68,165,165,213,48,172,128,103,169,183,142,117,221,173,67,138,20,198, 211,154,188,58,237,112,214,239,3,32,16,6,150,171,232,93,89,76,166,191, 227,215,196,17,58,68,48,6,140,115,56,126,14,194,245,161,162,86,103,123, 250,161,97,250,253,36,68,6,42,108,85,34,93,223,150,173,103,71,235,164, 39,83,37,64,1,246,123,42,5,14,110,217,87,192,237,7,74,216,51,233,195,217, 92,65,24,0,214,49,151,120,170,125,111,120,116,182,185,196,170,22,122,255, 55,136,10,221,224,15,173,154,2,58,135,172,73,53,235,49,243,214,222,0,17, 152,16,240,138,83,224,206,214,10,82,173,45,162,73,100,19,65,85,18,45,178, 152,87,135,106,100,19,140,86,2,24,170,17,145,4,208,89,205,193,25,195,92, 209,197,84,222,193,98,61,193,177,149,8,181,200,116,165,242,176,96,214, 116,36,198,237,124,187,86,92,166,243,125,166,164,173,62,183,243,107,80, 195,29,141,31,105,217,249,94,75,96,173,254,144,37,124,244,181,182,54,238, 159,102,5,171,72,90,242,186,30,184,216,88,193,165,30,43,40,235,252,180, 248,245,233,202,244,246,148,151,31,45,1,56,53,64,131,203,160,59,156,97, 239,148,143,217,162,139,51,149,24,39,170,9,90,177,217,146,90,107,125,58, 54,60,203,58,158,57,221,9,247,90,77,122,144,206,193,54,252,115,117,191, 165,157,208,231,80,92,235,81,236,118,248,170,9,166,87,66,165,196,50,105, 33,137,205,136,144,217,254,107,58,31,68,230,24,14,31,222,150,109,230,70, 74,128,36,74,154,84,48,27,134,43,125,135,227,192,140,135,29,5,129,83,53, 137,51,117,133,72,14,175,228,101,58,68,135,8,60,245,221,115,62,32,138, 214,115,194,26,172,55,14,187,9,161,67,88,14,235,52,98,189,136,107,42,147, 12,65,132,76,225,237,116,190,189,31,3,162,109,49,1,129,17,19,192,112,17, 18,134,168,25,8,32,239,113,220,48,231,99,247,132,139,19,149,4,11,77,5, 169,135,156,43,211,87,75,132,141,156,45,182,19,24,227,27,73,222,158,25, 61,51,249,250,193,25,224,34,129,84,26,224,133,30,47,242,22,245,154,53, 68,16,174,7,38,28,80,154,45,220,219,249,246,112,138,53,153,19,91,187,200, 250,24,41,1,32,27,109,210,165,234,102,135,117,194,44,12,152,12,56,110, 222,29,96,111,91,227,120,37,193,74,91,67,15,169,32,116,7,247,32,145,221, 189,22,31,176,65,196,122,140,232,213,194,173,32,32,8,6,204,20,4,156,132, 16,70,45,36,74,35,70,1,112,115,0,68,87,39,96,171,26,218,216,189,221,75, 4,199,5,99,162,179,248,99,205,113,13,34,117,110,253,134,182,134,145,90, 1,123,38,38,170,141,70,253,223,181,154,205,175,43,53,252,254,174,130,1, 115,5,129,87,237,13,112,203,110,31,83,57,177,45,169,165,140,1,83,121,23, 215,236,40,96,38,239,64,240,213,33,160,85,61,182,38,24,148,117,157,195, 25,118,21,57,102,114,2,156,115,120,14,199,132,163,48,131,38,114,170,14, 166,162,129,230,233,208,65,46,34,24,153,64,134,13,91,76,187,15,166,44, 24,182,173,186,248,54,250,88,215,191,198,251,63,250,209,157,185,220,204, 47,229,39,138,31,244,130,224,122,193,87,167,204,26,189,177,77,31,41,194, 185,186,196,201,154,68,43,214,27,78,126,12,64,84,91,134,12,91,176,37,91, 109,57,23,102,52,166,3,96,46,32,228,115,57,184,65,128,182,18,88,12,9,141, 4,32,38,58,165,93,58,225,92,48,196,245,21,232,36,178,129,31,104,236,202, 19,138,142,29,205,141,90,21,82,74,240,212,63,193,24,135,34,190,178,172, 253,175,147,91,188,141,123,254,21,156,11,150,229,245,119,246,56,26,2,58, 137,16,55,43,125,82,67,203,232,171,48,213,183,46,29,57,178,45,187,140, 93,140,100,61,250,131,223,251,189,133,217,128,126,119,121,105,225,237, 205,106,229,247,226,56,90,160,45,196,125,3,135,225,234,185,0,63,122,245, 36,174,219,153,71,224,110,237,182,5,103,216,93,114,177,183,148,142,122, 6,8,198,48,157,23,184,113,71,128,235,119,4,40,5,2,253,110,9,234,252,243, 5,176,111,66,96,210,231,224,220,254,48,198,210,206,231,118,103,50,198, 150,29,166,63,61,221,54,239,138,195,230,219,85,216,250,79,90,38,243,100, 247,144,219,210,61,147,233,247,2,146,209,49,41,245,55,75,71,110,222,150, 165,247,192,197,145,0,171,112,232,208,253,222,236,85,201,235,115,133,137, 143,231,114,249,159,116,93,175,184,153,4,0,172,55,207,115,93,24,48,84, 219,18,71,151,67,204,215,227,62,69,113,173,4,112,96,176,167,200,49,237, 51,91,195,79,38,240,131,28,130,32,7,199,117,225,56,46,132,35,160,33,80, 14,9,231,154,26,109,133,78,34,72,84,91,134,75,9,246,22,128,188,200,138, 68,216,159,90,165,12,173,117,166,83,44,104,152,223,146,245,234,159,30, 62,124,88,2,192,77,55,29,242,106,51,241,171,93,55,255,47,193,248,219,24, 99,115,27,21,206,234,133,108,55,58,69,173,1,128,140,145,58,73,254,171, 142,227,223,174,28,59,188,181,40,235,6,184,232,4,200,240,174,119,221,91, 154,218,55,243,51,185,98,225,99,158,231,221,198,57,223,48,83,50,35,64, 39,183,206,16,22,155,9,142,46,133,88,105,201,142,162,216,75,0,143,27,92, 81,114,48,233,1,90,43,40,37,161,164,68,16,4,240,115,57,56,142,7,199,113, 32,28,7,66,8,8,33,144,24,134,197,150,193,124,83,163,157,104,176,246,10, 246,230,20,2,145,229,255,101,142,25,66,181,188,146,122,246,216,25,192, 252,150,99,228,131,143,15,40,217,114,224,224,193,32,9,131,219,29,225,127, 72,120,193,221,220,113,103,54,83,106,146,102,21,42,182,190,30,50,70,154, 36,254,31,17,169,79,55,158,251,214,202,150,191,236,13,112,201,8,144,93, 255,125,31,249,205,61,249,82,254,221,190,159,251,128,31,4,87,243,53,250, 65,231,64,198,224,122,94,159,235,55,209,6,103,171,49,142,45,135,168,69, 10,160,116,212,234,16,87,78,10,20,93,171,99,40,213,75,128,28,252,92,14, 174,227,66,184,14,132,232,18,128,167,63,145,2,22,234,49,116,125,17,30, 201,52,99,169,235,72,48,70,163,90,94,129,214,234,20,136,62,190,119,110, 250,243,15,109,82,224,113,207,109,183,229,25,155,123,131,112,253,15,113, 63,184,75,8,183,52,136,8,68,132,164,81,78,179,128,140,210,50,250,211,72, 201,251,154,223,63,188,237,91,203,92,106,2,0,0,14,29,58,36,38,246,92,249, 242,66,97,226,215,114,133,252,207,185,174,63,183,182,163,215,35,64,134, 80,26,156,40,135,56,89,142,144,212,150,113,69,94,34,239,0,90,41,232,85, 4,72,16,4,121,75,0,215,133,112,28,56,194,1,119,4,4,183,157,47,132,0,231, 2,74,73,44,158,59,11,41,147,110,76,0,214,177,163,181,66,101,101,233,152, 214,250,227,123,103,167,190,188,89,231,247,98,199,77,7,139,110,224,191, 89,4,185,15,10,63,120,51,231,78,177,151,8,100,140,85,62,101,172,117,18, 255,111,30,153,95,95,124,241,155,23,156,255,55,8,151,5,1,50,220,125,239, 189,254,149,110,240,99,185,124,233,99,65,62,127,135,235,184,249,236,179, 205,8,0,88,157,169,25,43,44,47,156,131,14,155,48,70,247,16,192,238,51, 160,148,68,144,203,195,15,130,85,4,16,78,218,249,41,9,56,23,144,50,193, 210,252,57,168,108,255,128,30,47,98,28,71,47,84,87,150,239,253,198,99, 63,250,87,231,91,178,109,250,182,59,39,125,198,239,116,188,252,135,28, 207,127,3,119,156,60,192,96,180,66,84,91,210,42,106,127,158,116,116,239, 202,243,79,157,61,159,246,135,193,101,69,128,12,239,121,207,199,166,252, 185,220,219,139,133,210,61,126,46,119,171,16,194,25,134,0,128,21,159,11, 231,206,162,89,175,15,32,128,132,148,18,185,92,30,65,46,83,2,187,58,0, 23,14,4,231,125,4,208,58,75,102,177,18,32,73,226,103,91,141,198,135,31, 251,210,231,191,134,11,92,152,1,0,165,155,126,100,166,80,152,190,219,245, 252,15,113,47,184,157,180,242,218,229,249,191,212,81,114,79,249,133,39, 71,186,149,196,101,73,128,20,236,189,191,118,223,21,249,201,226,123,243, 249,194,251,124,63,56,224,7,193,166,74,244,42,2,104,13,173,187,4,144,113, 108,218,237,214,55,92,215,59,49,49,57,245,211,65,46,55,231,186,30,132, 35,32,210,125,1,173,248,183,36,72,162,8,203,139,11,233,174,161,0,17,81, 28,69,79,55,155,141,123,254,250,75,159,255,6,182,201,31,159,61,239,238, 91,127,108,206,9,74,111,3,115,110,151,43,243,255,126,225,251,79,190,184, 141,237,15,190,232,168,47,112,161,56,116,232,144,200,239,61,240,138,82, 97,226,158,201,169,153,127,230,249,222,204,198,211,64,70,128,90,74,0,251, 147,36,177,110,53,155,95,108,55,43,247,9,165,206,230,103,246,188,161,48, 81,188,183,80,40,222,233,7,65,81,56,253,4,136,195,16,43,75,139,89,110, 62,197,97,248,221,90,163,254,107,95,253,242,23,158,196,246,118,126,47, 216,109,183,221,230,100,166,228,168,113,217,19,32,195,161,67,159,200,237, 184,182,116,176,88,156,248,68,144,203,189,201,117,221,129,85,72,7,17,32, 73,98,217,106,54,255,172,86,95,249,228,19,143,62,218,153,79,239,190,251, 238,82,97,118,207,221,249,98,241,158,32,95,120,189,231,251,94,166,0,114, 193,17,181,219,40,47,47,193,24,67,113,24,62,217,168,86,62,252,215,95,249, 226,83,24,93,231,95,116,188,100,8,144,225,253,159,248,196,76,49,63,243, 207,243,133,226,71,252,156,127,139,16,206,170,116,159,181,4,72,146,56, 110,55,155,127,80,15,235,247,63,254,197,47,14,50,163,216,91,127,225,23, 118,230,11,147,135,138,197,210,7,115,185,252,203,29,215,19,66,112,180, 91,45,172,44,45,82,20,182,255,182,81,169,220,243,55,127,245,165,239,225, 135,168,243,129,151,32,1,44,136,253,234,61,191,113,85,113,102,246,125, 133,98,241,189,158,231,237,227,220,58,114,123,9,144,36,113,171,89,111, 124,38,44,199,191,243,232,163,15,109,226,61,187,159,191,243,151,78,94, 85,152,156,248,23,197,226,196,175,4,185,252,254,86,179,65,243,167,79,127, 173,218,44,127,248,107,95,254,242,179,23,227,201,46,54,94,162,4,176,56, 120,255,253,206,77,77,243,234,194,100,225,222,92,190,240,54,215,245,38, 1,96,225,220,89,84,203,43,181,70,163,246,59,225,242,252,103,30,121,100, 248,122,251,7,15,30,116,246,93,127,243,45,197,82,233,67,82,202,185,83, 199,94,252,244,163,95,250,220,15,70,247,20,151,22,47,105,2,100,248,192, 7,238,207,187,51,184,179,80,156,248,88,16,228,222,184,56,127,166,177,112, 250,204,191,13,171,11,255,237,225,243,44,162,124,239,189,247,250,101,192, 255,227,207,124,230,146,109,235,122,49,240,67,65,128,12,31,184,239,190, 185,137,137,29,239,108,52,106,149,195,143,151,255,226,240,225,255,114, 81,52,233,49,46,47,172,159,222,51,198,24,99,140,49,198,24,99,140,49,198, 24,99,140,49,198,24,99,140,49,198,24,99,140,49,198,24,99,140,49,198,24, 99,140,49,198,24,255,56,240,255,1,180,29,225,136,38,255,92,154,0,0,0,0, 73,69,78,68,174,66,96,130, } }, {.path = "data/icons/icon16.png", .size = 686, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0, 0,0,31,243,255,97,0,0,2,117,73,68,65,84,120,156,173,146,187,107,83,97, 24,198,159,239,124,231,154,211,156,164,49,41,218,14,109,189,118,20,65, 116,116,233,32,21,21,74,6,113,112,83,68,68,112,80,113,9,245,127,112,113, 237,36,186,40,29,138,139,84,116,81,90,132,82,74,165,109,154,166,77,47, 49,57,151,228,92,114,190,115,206,231,212,218,216,130,131,62,211,203,11, 207,239,125,30,120,129,127,20,57,188,226,164,248,116,214,216,85,91,29, 195,140,51,177,28,144,139,250,183,221,137,137,137,228,175,128,59,165,178, 234,8,254,85,30,179,135,158,93,179,8,48,160,232,57,69,210,50,83,29,183, 241,14,205,198,194,212,171,235,222,145,128,27,165,197,33,1,236,137,64, 197,91,161,111,101,27,213,239,80,123,242,40,12,95,66,204,2,238,153,155, 63,3,215,156,92,95,219,120,190,60,253,168,179,231,19,247,73,36,186,205, 227,248,94,219,174,9,174,85,69,109,229,35,68,69,131,144,82,160,235,253, 132,74,74,65,213,123,71,207,141,24,47,151,167,177,186,231,19,246,134,158, 108,31,51,10,131,66,58,63,140,132,51,36,81,8,215,222,68,179,190,128,132, 51,200,90,22,156,243,147,126,199,30,60,88,97,63,1,168,104,9,162,146,40, 122,78,24,62,63,142,254,211,87,176,189,242,25,249,193,11,80,83,121,152, 181,69,236,86,191,6,129,189,101,29,4,236,39,248,49,63,105,174,45,189,79, 60,183,6,73,237,129,102,20,160,165,79,64,20,83,112,173,26,182,43,95,96, 153,75,26,147,195,241,145,155,15,206,162,88,164,93,9,92,183,110,251,126, 131,217,246,170,152,105,158,65,74,237,195,86,229,19,90,237,50,66,207,134, 227,172,66,78,103,83,84,82,158,37,49,27,59,101,27,197,21,96,89,252,29, 133,59,4,156,197,81,160,53,235,243,168,119,2,120,173,117,48,222,70,232, 218,96,158,13,73,55,32,136,18,101,126,43,205,19,39,236,170,144,75,235, 109,77,86,2,74,69,16,66,192,147,24,128,0,65,148,64,40,5,161,18,98,214, 65,20,250,136,2,111,71,112,90,86,87,133,203,67,186,227,49,212,55,172,176, 175,230,48,196,157,0,146,68,65,8,64,121,12,65,145,3,206,33,69,126,155, 50,207,174,150,227,186,223,5,80,125,179,38,167,142,221,79,229,229,199, 253,25,101,180,178,195,244,152,170,190,146,86,100,151,74,155,77,203,125, 97,50,105,32,138,217,88,28,134,175,49,55,203,14,189,50,0,60,44,149,140, 156,145,191,214,110,187,197,106,165,252,182,55,219,59,212,106,89,115,204, 106,124,120,3,224,248,22,114,219,116,215,196,204,76,244,167,247,160,200, 221,82,41,197,57,39,156,115,114,212,161,255,166,95,198,13,47,109,193,128, 95,158,0,0,0,0,73,69,78,68,174,66,96,130, } }, {.path = "data/icons/icon24.png", .size = 1156, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,24,0,0,0,24,8,6,0, 0,0,224,119,61,248,0,0,4,75,73,68,65,84,120,156,229,148,91,136,85,85,24, 199,255,107,173,125,246,62,251,92,183,141,51,227,56,86,106,99,163,86,134, 18,20,100,8,133,72,6,5,129,212,147,224,67,18,148,208,91,69,15,167,121, 42,232,33,144,222,130,40,232,169,99,47,221,156,64,2,195,16,82,81,52,50, 115,46,122,230,118,206,156,251,62,251,178,246,222,235,210,195,96,56,205, 56,22,61,69,255,183,197,226,251,126,124,127,254,223,7,252,215,69,214,250, 44,149,74,244,172,123,192,105,250,102,239,194,208,215,242,153,238,222, 205,134,246,20,191,116,105,246,244,233,49,241,175,0,135,222,60,95,76,76, 246,146,6,142,200,36,188,194,221,234,84,202,46,30,38,132,48,195,204,124, 79,173,194,151,92,185,23,199,199,158,112,255,17,224,208,161,47,152,218, 185,125,55,49,237,183,136,214,7,69,28,218,110,125,2,220,107,170,66,255, 3,52,227,12,193,48,109,45,69,220,229,94,243,156,224,189,19,66,69,227,167, 142,63,63,3,64,255,181,31,93,214,252,253,201,98,60,58,242,134,4,78,104, 153,188,40,146,208,230,126,3,220,171,35,14,219,84,201,24,41,43,135,148, 149,39,74,196,142,18,209,126,173,213,71,137,215,126,103,223,190,18,91, 109,2,227,246,135,12,253,39,9,99,99,90,198,217,94,123,6,132,80,196,81, 15,141,249,139,232,53,167,224,251,243,160,118,26,197,190,17,72,17,65,43, 9,102,152,41,102,102,7,201,195,123,139,56,141,230,154,0,77,145,48,106, 209,84,198,129,86,2,157,234,111,88,184,241,35,186,139,191,67,75,129,110, 227,26,42,83,39,81,236,142,192,41,140,194,46,108,0,33,4,134,85,56,16,123, 245,103,1,124,190,38,160,176,110,56,160,166,45,180,146,96,169,52,88,42, 13,5,1,201,67,184,141,9,200,36,2,163,6,114,249,77,200,228,6,64,8,67,28, 118,16,116,230,152,20,60,184,171,69,52,149,243,40,51,34,80,153,79,8,135, 149,235,195,125,59,15,98,120,116,63,26,149,11,168,77,159,193,166,251,247, 195,25,216,14,173,36,252,246,60,220,250,4,188,214,205,200,15,171,141,187, 2,230,110,142,251,233,204,70,94,112,182,130,80,6,51,157,71,42,109,67,9, 129,245,247,238,6,99,38,178,133,141,160,148,193,119,23,225,214,39,208, 170,94,70,123,241,215,88,137,48,194,82,42,245,29,1,245,27,103,2,101,218, 129,157,25,128,115,207,14,172,235,219,14,51,157,7,161,26,65,123,14,49, 119,33,98,14,195,140,16,116,230,208,170,93,70,207,171,192,200,23,10,204, 28,252,224,193,23,94,255,140,104,125,242,218,87,235,171,192,152,90,1,136, 100,134,27,74,122,129,95,67,24,212,209,105,93,69,255,208,99,40,56,91,17, 120,85,84,103,126,66,36,58,232,219,176,11,181,153,179,112,187,83,48,236, 28,152,149,54,152,97,62,165,181,126,92,43,121,113,219,193,217,35,215,191, 195,213,21,0,0,49,0,15,0,180,86,8,252,26,42,147,227,176,172,34,220,133, 235,8,188,26,100,45,65,183,125,29,126,163,2,173,36,8,33,96,169,52,168, 97,66,203,196,140,67,127,179,226,254,159,251,181,108,209,226,94,43,33, 32,238,237,11,174,181,68,232,47,34,137,61,16,74,65,25,131,84,17,64,41, 98,191,139,168,215,130,146,75,103,73,41,5,25,135,45,161,100,115,85,192, 68,190,42,24,99,29,74,25,40,53,64,200,242,75,66,64,64,152,1,202,82,32, 132,130,153,54,64,8,100,204,161,146,8,42,230,144,9,95,224,237,78,111,85, 0,202,101,245,232,112,182,61,236,88,48,13,3,148,153,32,148,1,132,44,5, 132,210,91,99,65,43,9,195,206,194,176,50,0,52,148,76,32,162,0,50,137,42, 181,81,135,175,154,34,0,122,184,104,77,15,57,52,106,120,137,53,221,138, 208,10,1,161,53,40,51,96,232,4,148,44,89,97,81,5,173,148,84,44,171,84, 18,167,160,20,4,247,32,184,63,137,242,55,242,78,0,8,229,127,74,169,29, 246,103,232,107,142,109,239,168,135,154,77,47,122,176,179,6,250,45,27, 52,107,163,229,113,152,202,224,158,215,253,184,33,114,191,40,173,142,40, 145,236,73,184,63,171,132,58,181,220,214,85,164,181,38,111,191,251,225, 22,106,147,87,44,43,125,216,143,146,161,217,233,73,63,230,254,185,190, 254,129,135,162,40,202,181,235,245,227,11,157,197,247,126,30,31,239,109, 121,250,229,1,37,228,115,73,16,84,230,207,127,251,3,0,181,38,224,150,142, 30,61,154,26,220,182,107,143,82,226,213,133,217,202,149,166,219,252,100, 104,96,227,35,81,20,143,120,11,149,114,185,92,246,214,170,255,219,58,118, 236,152,85,42,149,86,216,249,255,208,31,211,152,67,184,18,172,9,128,0, 0,0,0,73,69,78,68,174,66,96,130, } }, {.path = "data/icons/icon256.png", .size = 25043, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,1,0,0,0,1,0,8,6,0,0, 0,92,114,168,102,0,0,97,154,73,68,65,84,120,156,237,189,121,148,100,87, 125,38,248,221,251,246,88,115,173,77,251,142,4,2,172,2,44,104,176,12,216, 141,198,216,6,108,87,131,7,27,153,197,178,1,111,221,182,199,237,110,247, 225,104,206,216,211,103,122,254,24,79,219,61,99,187,123,122,102,142,105, 47,50,227,165,141,141,187,237,134,2,140,133,160,88,36,144,16,42,169,170, 84,91,110,145,177,199,219,238,50,127,220,247,94,188,136,140,200,140,200, 140,200,204,168,122,159,142,42,35,99,121,239,190,151,241,251,238,111,255, 1,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50, 100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200, 144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67, 134,12,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25, 50,100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200, 144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67, 134,12,25,198,5,1,64,15,122,17,25,14,30,228,160,23,144,97,127,113,231, 195,63,107,45,46,220,245,22,74,232,107,130,70,229,191,181,42,23,158,122, 238,11,255,87,11,128,60,232,181,101,216,127,100,4,112,29,225,193,83,255, 199,13,102,49,255,51,166,83,254,32,161,250,34,243,219,21,191,83,253,98, 216,217,252,4,243,54,62,93,106,127,249,242,233,211,167,217,65,175,51,195, 254,33,35,128,125,192,169,83,127,172,93,45,248,247,128,185,204,117,228, 185,51,191,251,83,225,126,158,255,228,163,191,99,228,2,231,77,166,157, 255,53,221,206,191,81,211,77,67,253,233,37,4,103,8,253,182,31,186,141, 231,67,183,246,215,65,187,246,231,153,86,112,253,32,35,128,41,227,141, 239,255,15,203,185,252,145,247,233,86,225,195,60,244,136,215,174,124,42, 116,235,127,194,54,215,206,60,249,169,199,154,152,178,144,189,233,189, 191,115,156,218,133,159,50,157,210,163,186,233,28,39,84,27,248,62,41,5, 120,232,139,208,107,84,130,78,253,139,65,167,254,9,230,213,63,93,106,127, 62,211,10,174,97,100,4,48,37,156,124,244,119,140,18,242,175,55,115,71, 127,197,202,149,222,170,233,150,37,1,240,208,147,204,111,85,253,78,237, 73,175,181,249,71,110,103,245,211,119,106,79,93,122,252,241,199,249,164, 207,159,11,140,55,25,86,233,95,26,78,225,77,221,93,127,39,100,90,193,245, 132,140,0,38,15,242,134,15,252,251,227,197,252,13,143,234,185,194,79,26, 102,254,56,161,122,239,125,150,18,66,48,48,191,229,251,157,218,243,129, 219,248,207,161,95,249,211,160,94,253,230,153,191,124,172,179,215,5,188, 246,145,223,58,150,211,231,127,122,167,93,127,39,244,104,5,94,253,139, 65,43,211,10,174,53,100,4,48,65,60,252,240,111,90,254,45,71,223,106,231, 151,126,197,176,75,175,215,12,107,199,93,87,10,14,22,122,34,116,235,107, 190,91,253,44,115,27,127,194,91,141,211,255,240,167,173,13,224,49,49,206, 249,79,158,124,212,176,239,59,249,157,102,110,254,215,76,167,248,22,77, 179,12,144,73,252,137,51,173,224,90,69,70,0,19,129,36,111,250,208,227, 183,230,242,133,143,26,86,233,125,186,149,95,30,123,215,149,18,156,7,8, 253,102,39,236,52,190,17,184,213,79,116,106,27,127,85,115,95,122,254,236, 167,254,173,191,211,199,95,125,234,215,151,139,133,19,31,180,114,11,31, 49,172,220,141,91,180,142,9,33,211,10,174,45,100,4,176,71,188,242,199, 254,77,254,72,254,214,183,155,197,165,95,210,173,194,3,154,110,106,123, 187,173,82,105,5,129,203,2,183,126,217,111,87,255,54,232,212,31,111,53, 94,122,242,233,79,254,235,26,250,118,91,181,235,191,242,59,13,103,249, 87,77,167,244,86,93,183,172,201,236,250,59,175,51,214,10,120,232,62,15, 232,127,205,130,250,159,139,234,230,83,95,248,139,95,201,180,130,25,65, 70,0,187,197,199,62,70,31,58,127,235,221,214,220,209,159,55,157,185,247, 232,166,51,71,200,238,108,237,97,144,82,64,48,95,134,94,179,225,119,106, 95,14,59,213,199,125,215,253,47,206,90,229,226,233,211,143,177,87,159, 250,245,229,98,238,196,7,173,194,194,71,116,51,119,35,213,166,179,235, 15,7,129,102,216,48,236,34,0,41,66,183,85,9,220,205,47,122,237,205,79, 4,157,218,167,205,203,235,151,79,159,126,44,211,10,14,49,50,2,216,5,94, 247,222,223,44,149,231,239,248,33,195,41,254,162,110,229,239,213,52,99, 143,187,254,78,80,187,45,243,219,65,224,53,94,12,90,27,127,229,182,214, 255,161,184,120,251,251,204,92,233,31,19,170,91,83,60,249,64,16,170,193, 176,139,48,172,2,18,115,39,113,110,182,253,192,109,60,31,180,171,127,237, 117,54,50,173,224,16,35,35,128,49,112,234,212,41,109,181,248,253,175,180, 75,71,127,217,114,230,126,64,51,236,2,33,251,155,82,47,120,128,230,250, 57,209,88,123,62,40,44,221,102,21,22,110,34,84,183,32,5,131,224,1,164, 24,203,111,184,43,104,186,5,211,153,131,102,90,24,246,21,82,190,2,47,210, 10,170,95,12,221,230,159,135,157,218,223,209,139,151,47,102,90,193,225, 65,70,0,35,226,193,15,254,222,66,41,119,252,189,134,93,252,25,221,202, 223,69,53,131,236,235,237,35,0,243,59,104,87,206,163,177,254,34,252,78, 21,133,197,91,96,229,230,97,56,101,88,185,57,104,134,29,155,13,16,130, 3,114,178,27,46,33,20,186,149,135,225,148,64,169,62,218,135,34,173,32, 244,219,65,232,53,95,244,219,245,79,249,110,245,207,130,160,246,213,39, 63,254,243,83,79,132,202,176,61,50,2,216,1,39,79,62,106,44,188,254,237, 175,179,114,75,191,172,25,214,219,168,110,216,251,45,248,16,2,94,187,130, 118,229,2,188,86,5,126,167,10,30,184,40,44,221,2,221,202,67,211,45,104, 134,3,195,204,195,112,138,208,140,28,0,9,206,2,72,30,66,202,189,107,5, 84,51,96,58,101,232,102,14,187,117,50,70,90,129,12,189,86,53,116,107,95, 242,221,250,39,88,187,254,183,153,86,112,112,200,8,96,27,60,244,145,191, 60,150,115,156,247,91,249,133,15,235,102,254,70,66,53,34,37,135,228,108, 42,59,108,63,8,1,88,232,195,173,95,133,91,191,138,192,107,130,135,30,152, 223,6,15,93,20,150,110,133,110,230,64,53,3,132,234,208,52,19,212,136,200, 192,202,67,51,28,16,66,33,120,0,193,2,181,230,113,55,92,66,160,27,57,152, 185,50,168,102,76,230,194,50,173,224,208,32,35,128,1,184,243,225,223,180, 238,188,239,222,55,154,246,220,191,208,157,226,27,117,205,52,251,119,61, 41,56,132,96,144,156,79,100,135,77,131,16,64,74,137,192,109,192,173,95, 129,223,222,4,11,92,8,30,66,240,112,40,1,80,170,129,80,29,68,211,161,233, 38,52,221,134,102,58,208,13,7,132,106,16,60,4,103,126,164,21,236,44,99, 132,234,48,237,34,116,187,128,105,249,58,122,181,130,250,151,124,183,150, 105,5,251,136,140,0,122,32,201,63,254,240,31,222,168,229,142,126,196,206, 47,190,95,183,114,71,119,74,232,145,82,40,50,224,12,82,236,61,157,159, 16,64,176,16,94,123,3,110,99,29,161,223,128,96,1,36,87,132,211,75,0,183, 65,55,157,173,4,64,181,228,127,170,25,145,137,96,67,51,108,80,170,67,8, 6,30,250,145,211,112,208,154,9,52,35,114,244,25,251,20,96,216,162,21,84, 63,213,94,127,225,207,54,154,231,191,122,246,83,255,54,211,10,166,132, 140,0,34,60,244,200,167,109,103,129,255,119,102,174,244,203,134,85,122, 141,166,27,227,165,209,74,9,17,19,129,28,223,60,136,119,125,22,180,225, 53,55,16,180,55,17,134,46,164,80,196,178,149,0,188,72,3,216,134,0,8,237, 18,1,213,65,117,51,33,3,66,117,64,237,190,224,204,135,16,12,144,18,132, 80,21,222,179,139,216,109,13,193,94,33,120,8,183,177,38,59,245,149,106, 224,214,190,20,184,213,79,248,94,253,111,231,27,122,166,21,76,24,25,1, 224,99,244,173,31,122,217,157,206,194,205,63,99,228,74,239,213,13,103, 129,208,189,169,187,105,141,96,20,243,128,16,2,33,24,130,78,13,126,171, 130,208,107,130,71,187,179,148,124,34,4,64,8,85,255,107,26,40,85,90,1, 53,108,80,77,87,105,200,204,135,20,2,186,153,131,102,152,56,168,175,6, 103,1,130,78,13,60,244,0,41,162,188,130,78,16,120,141,23,67,183,241,169, 208,173,255,89,205,91,201,180,130,9,225,186,38,128,135,62,242,199,5,199, 156,127,135,153,47,255,146,97,151,238,215,244,201,38,244,72,41,18,193, 29,164,106,171,93,31,224,204,67,208,174,194,239,84,193,66,23,146,179,196, 180,152,56,1,80,10,66,162,223,35,95,1,213,45,232,166,3,167,116,4,144,0, 11,58,202,68,216,141,211,112,247,55,11,44,104,35,112,235,16,124,235,38, 223,245,21,52,171,129,215,204,180,130,9,225,186,36,128,83,167,78,105,181, 227,239,187,215,202,47,254,162,105,149,126,88,51,237,226,84,19,122,6,152, 7,74,248,5,66,175,141,160,83,85,187,62,243,83,130,63,1,2,136,133,61,33, 131,136,4,34,2,64,252,28,213,96,88,121,20,22,111,129,110,216,0,0,206,3, 48,223,5,11,189,137,133,18,135,222,30,193,17,184,117,48,191,189,243,121, 146,108,195,76,43,152,4,174,59,2,120,232,145,255,56,103,207,31,123,143, 93,60,242,243,186,85,184,91,211,116,186,159,183,65,105,5,12,44,232,32, 112,235,8,58,117,176,176,19,217,250,98,68,2,104,69,4,112,91,20,5,208,35, 2,232,117,0,246,104,1,253,187,63,161,64,66,8,20,154,97,35,55,119,2,84, 51,34,199,161,1,66,104,92,174,12,22,184,137,153,48,73,25,227,161,143,192, 141,84,254,93,220,203,68,43,232,52,191,20,248,153,86,48,46,174,27,2,56, 117,234,143,181,250,141,165,147,150,61,247,63,24,118,241,97,205,176,242, 251,157,198,75,8,129,148,18,60,244,224,214,87,224,119,170,202,195,47,69, 36,232,162,247,241,126,19,64,249,120,226,248,35,132,130,106,122,68,8,58, 0,9,30,6,8,3,23,60,116,19,167,225,110,33,165,0,243,219,8,221,134,58,214, 94,144,105,5,187,198,117,65,0,111,124,255,31,47,151,151,142,188,207,112, 230,63,170,155,246,173,42,141,119,63,65,84,120,143,115,176,64,125,233, 253,246,38,56,243,182,10,253,33,33,128,238,210,9,40,209,64,117,165,25, 196,14,75,22,120,81,110,194,176,80,226,112,8,193,16,38,42,255,100,101, 51,211,10,198,195,53,77,0,39,31,253,29,99,142,44,252,35,171,120,228,151, 237,194,226,91,117,211,217,167,90,249,46,146,93,159,249,8,189,38,152,223, 78,236,248,184,120,71,9,125,74,245,223,129,0,66,175,5,30,186,40,46,223, 190,149,0,52,173,107,247,143,65,0,186,233,192,41,31,223,54,225,135,80, 26,69,16,12,16,170,37,215,165,156,134,222,72,217,145,60,244,148,151,159, 237,216,227,100,111,200,180,130,145,112,173,18,0,121,195,7,254,253,241, 124,254,248,163,86,110,238,81,221,116,142,81,205,36,84,51,34,1,217,15, 213,191,111,215,143,210,120,99,39,215,161,35,0,43,143,92,233,216,72,121, 254,132,16,117,62,221,128,166,233,0,136,34,181,192,77,50,22,251,157,121, 177,202,31,184,245,137,36,76,141,131,68,43,240,155,85,191,85,253,12,235, 172,252,252,147,127,250,216,165,125,93,196,33,197,136,37,93,179,131,135, 30,249,152,77,245,123,223,98,149,151,126,197,180,139,175,215,116,219,0, 33,234,75,192,124,16,78,147,12,185,189,198,251,135,161,107,235,7,8,189, 38,66,191,21,133,182,70,221,116,246,135,151,119,123,22,41,37,36,15,33, 56,3,167,52,113,26,154,185,18,12,187,160,156,134,190,155,84,37,10,30,42, 71,95,208,153,184,202,63,10,162,40,7,161,84,95,224,129,119,50,112,109, 115,223,23,113,72,113,13,17,128,234,203,103,23,138,63,103,88,165,247,234, 166,179,76,6,148,172,42,47,188,74,48,161,61,68,48,9,161,75,239,250,157, 104,215,119,71,15,161,169,89,29,35,32,126,19,233,251,57,248,144,3,127, 155,8,199,168,246,101,92,112,8,22,128,106,26,168,102,194,48,115,48,76, 7,156,5,240,218,85,248,237,10,120,224,30,140,240,71,100,28,6,29,4,157, 26,154,149,11,205,202,229,175,185,251,190,144,67,138,107,130,0,84,95,190, 63,121,187,89,92,30,189,47,159,84,93,118,4,231,202,182,213,140,72,85,222, 157,100,236,125,215,159,0,14,208,160,83,26,150,0,231,12,132,104,137,159, 0,82,64,183,242,160,154,14,22,120,187,114,26,238,22,132,208,200,225,216, 64,224,214,148,121,18,186,53,29,205,61,183,94,191,86,48,219,4,240,177, 143,209,239,185,244,178,123,104,190,252,243,102,110,238,221,187,235,203, 215,221,197,98,39,215,120,126,130,104,215,23,28,60,232,168,146,221,96, 140,93,127,234,32,35,241,2,165,19,74,130,148,18,82,50,176,128,169,157, 215,109,66,66,130,106,22,76,71,117,46,226,204,139,50,13,247,22,74,220, 14,132,16,240,208,131,223,174,34,240,234,42,187,18,18,82,202,58,47,220, 48,101,15,228,236,96,102,9,224,117,239,253,205,82,185,114,199,15,153,11, 197,95,210,204,252,189,154,110,236,57,161,71,10,1,46,34,63,65,148,51,191, 157,159,128,128,64,77,251,241,17,250,45,132,94,11,130,135,216,183,93,191, 71,163,223,122,237,227,221,141,201,171,15,82,240,164,208,136,128,36,142, 73,205,112,160,233,118,82,158,28,231,66,76,2,177,38,22,120,77,85,87,225, 183,146,34,167,168,248,105,237,194,233,243,89,56,48,194,204,17,192,169, 83,127,172,173,22,221,169,246,229,147,82,64,50,1,73,88,159,195,176,43, 36,42,30,206,193,3,55,181,235,143,161,218,238,41,28,73,14,172,82,111,60, 68,68,40,5,68,228,56,36,0,64,40,168,166,129,16,29,186,153,135,52,28,213, 176,132,249,16,187,168,164,140,17,255,77,252,246,38,252,86,69,101,23,18, 128,16,165,221,72,33,32,137,220,0,78,31,22,245,236,192,49,83,4,240,224, 7,127,111,161,154,119,126,188,96,30,253,25,195,206,223,49,237,190,124, 202,219,29,251,9,52,80,93,143,122,225,17,101,235,251,77,149,148,195,195, 169,119,7,234,93,152,234,251,55,212,150,222,231,92,135,97,80,33,205,248, 190,200,200,60,16,144,50,132,96,82,213,34,16,77,101,28,82,3,212,54,35, 19,97,252,86,102,177,202,239,54,214,16,116,170,224,177,214,145,50,9,165, 16,66,114,182,14,32,35,128,8,51,65,0,39,79,62,106,20,95,243,150,215,217, 249,165,95,54,172,194,219,116,195,182,177,175,105,188,82,117,221,13,57, 4,60,85,183,239,183,85,229,222,20,28,90,219,5,3,4,15,208,168,158,67,171, 122,30,174,87,193,220,145,123,144,43,157,0,53,183,255,83,238,228,9,80, 90,212,164,137,67,98,216,149,72,41,33,69,8,200,0,60,68,146,175,16,247, 44,32,134,13,206,3,8,22,70,247,120,240,113,8,33,144,144,8,220,58,58,245, 171,8,189,38,164,16,74,67,234,35,66,33,184,16,158,187,49,225,139,156,105, 28,122,2,120,232,35,255,241,152,169,45,189,223,116,202,31,214,205,124, 52,252,98,223,51,121,147,50,217,208,111,171,62,157,123,80,85,7,29,123, 103,72,248,110,21,213,213,111,160,85,125,9,130,5,104,86,95,68,167,189, 130,92,225,40,202,75,119,161,48,127,11,76,187,180,203,117,76,158,80,165, 16,221,123,36,147,127,122,223,35,37,32,57,132,20,234,229,160,211,237,100, 100,216,208,205,156,234,116,204,131,173,173,204,34,149,223,107,174,193, 173,175,128,5,110,87,229,143,94,87,63,147,5,49,98,217,107,19,191,208,25, 198,161,37,128,83,167,78,105,155,71,222,247,38,59,87,252,87,154,153,127, 163,54,160,47,223,126,64,197,245,85,246,93,220,168,35,238,177,183,95,16, 156,161,185,121,14,181,245,103,17,120,141,30,213,88,240,0,237,198,101, 184,237,85,88,107,207,160,180,116,7,74,139,119,193,206,45,2,195,214,120, 160,22,66,63,9,116,127,79,178,33,153,122,142,120,13,16,106,64,55,29,104, 166,3,77,55,163,208,173,50,185,88,232,162,93,189,4,175,185,14,193,195, 164,212,121,216,245,9,30,250,34,108,213,167,116,97,51,137,67,75,0,23,235, 247,149,151,238,88,124,44,63,127,195,119,1,0,15,188,129,41,166,83,3,1, 32,37,66,191,173,74,118,131,142,242,102,71,94,230,253,146,161,208,111, 162,186,242,13,52,107,23,162,8,3,34,153,217,218,164,212,235,84,224,95, 170,162,182,254,28,10,115,183,96,238,200,203,144,47,157,128,78,157,3,17, 122,41,5,36,100,143,204,203,212,191,67,85,31,41,33,37,135,16,2,82,186, 8,189,38,8,85,5,75,134,85,128,166,91,240,218,21,52,215,206,194,239,212, 148,151,191,39,140,169,12,158,248,255,248,145,148,220,11,89,216,152,248, 133,206,48,14,45,1,180,13,91,46,19,170,171,178,84,101,23,114,22,168,162, 147,41,79,192,33,164,219,154,42,244,26,170,112,69,42,167,213,126,105,33, 82,114,180,235,151,80,89,121,10,126,103,115,107,132,97,216,58,164,84,164, 177,246,77,52,171,47,32,87,186,1,243,71,238,67,113,225,86,24,86,49,125, 0,76,157,21,182,37,235,46,49,200,244,115,61,175,201,148,86,16,213,18,180, 171,48,156,50,120,232,38,181,21,42,178,208,61,50,73,253,219,189,79,18, 82,202,182,77,115,153,6,144,194,161,37,128,133,215,60,232,146,144,54,88, 208,1,165,1,72,84,240,98,216,5,21,95,14,61,229,45,158,164,19,142,0,144, 2,65,167,169,218,115,249,109,8,25,123,147,35,27,121,202,206,126,2,32,12, 59,216,92,125,6,141,141,111,131,49,111,215,39,229,204,71,115,243,28,218, 245,75,176,243,75,152,91,126,25,202,203,247,192,206,47,164,188,227,68, 149,252,106,147,55,105,198,74,253,149,91,216,160,247,170,165,0,64,96,230, 230,224,148,142,130,16,10,187,176,4,183,185,6,175,185,14,22,180,123,53, 179,1,89,207,34,244,107,85,247,74,150,5,152,194,161,37,128,245,103,62, 35,114,55,63,84,53,236,34,132,12,33,121,144,36,147,40,7,145,3,205,176, 85,34,73,232,67,236,177,83,141,26,194,225,193,111,111,118,203,85,165,84, 241,127,162,18,126,166,189,247,75,41,224,182,86,80,185,242,53,116,90,43, 35,145,219,40,107,18,130,193,109,173,194,107,111,160,178,242,20,202,139, 119,98,254,232,203,145,47,157,0,213,237,189,47,124,8,122,156,128,91,94, 220,241,211,61,143,169,110,193,46,44,195,202,47,168,40,1,33,208,13,7,118, 97,9,225,66,11,126,171,2,183,181,30,69,1,226,60,159,238,221,145,82,66, 66,54,66,215,28,191,245,208,53,140,67,75,0,203,107,159,17,242,134,215, 55,16,139,158,148,16,146,43,34,8,93,85,142,170,233,202,60,112,76,8,198, 122,218,91,143,12,229,229,131,215,174,193,111,173,35,244,219,145,186,157, 218,245,251,49,1,63,68,127,205,1,103,62,234,27,207,97,115,245,27,96,126, 75,217,206,19,134,148,2,129,87,199,198,229,175,160,182,254,44,10,115,183, 96,225,216,253,40,46,220,6,96,105,226,231,75,206,59,194,181,244,155,1, 202,2,80,143,117,51,15,187,184,12,195,46,37,229,199,0,34,205,197,128,149, 155,135,105,151,224,148,143,35,112,107,240,90,27,8,221,58,4,83,62,19,41, 37,4,11,192,153,95,155,231,65,80,153,228,197,205,56,14,45,1,156,62,125, 154,191,253,59,127,125,93,70,13,52,19,72,9,33,5,36,11,35,237,149,118,67, 70,86,78,165,243,134,158,234,177,183,3,17,16,2,176,160,13,183,177,22,181, 231,138,119,253,84,12,121,106,91,127,124,124,9,191,83,193,198,149,175, 160,89,127,9,114,64,71,220,9,157,41,5,229,65,175,109,60,135,102,245,28, 156,226,49,156,184,251,45,88,186,241,36,76,179,52,161,126,9,114,12,243, 108,176,107,144,16,10,195,42,192,42,44,66,55,243,170,94,97,8,226,198,166, 186,153,83,90,129,167,204,184,160,189,9,191,83,69,232,183,192,189,214, 218,217,179,238,254,54,35,56,228,56,180,4,0,64,178,208,109,152,40,11,64, 75,125,35,83,78,29,33,32,68,16,205,203,107,117,67,70,134,3,0,42,189,148, 7,91,137,64,141,223,65,167,185,1,183,190,10,22,180,32,5,79,154,99,72,236, 143,151,95,8,134,70,229,44,54,174,124,13,129,91,131,220,175,4,181,212, 197,9,30,162,211,184,140,149,75,159,71,203,187,132,82,249,118,148,231, 239,132,237,44,129,210,189,206,2,148,3,31,247,254,57,122,255,54,113,186, 0,161,26,12,187,8,203,81,83,143,71,37,37,66,136,26,126,82,48,97,230,230, 192,75,71,225,181,55,209,169,93,1,168,166,189,250,225,91,231,191,246,169, 211,27,91,78,124,157,226,48,19,0,194,118,181,138,242,81,1,160,251,215, 39,0,137,194,96,201,142,33,226,68,18,95,17,129,166,67,55,115,48,172,34, 116,189,16,13,199,140,66,136,4,96,126,11,157,234,101,120,237,13,112,22, 0,82,78,174,26,110,212,107,243,27,88,125,233,9,212,43,207,67,176,0,251, 251,125,28,112,161,148,192,247,170,88,247,190,130,106,229,91,200,23,111, 192,252,194,61,200,23,110,128,182,75,63,193,200,33,91,217,251,128,234, 6,76,187,4,195,46,129,234,198,136,245,140,253,32,106,26,146,93,130,110, 21,224,148,142,162,228,53,223,19,180,107,247,188,233,253,255,207,39,188, 206,250,95,137,179,223,62,119,230,204,239,134,187,56,248,53,131,67,77, 0,86,97,97,3,82,114,16,162,67,118,131,59,233,118,24,50,242,98,171,84,115, 161,84,127,166,136,192,111,85,160,155,57,152,185,57,232,166,13,22,116, 208,174,94,65,187,122,17,161,223,138,14,221,91,250,59,138,198,191,151, 92,4,21,222,187,136,213,11,255,128,86,237,226,33,42,27,142,33,193,88,7, 245,234,243,104,54,206,195,113,142,160,60,127,23,74,229,91,97,152,165, 209,251,37,200,65,247,105,120,18,144,250,53,158,73,88,142,84,254,201,124, 61,9,161,208,13,7,186,97,231,173,220,252,27,109,191,253,96,206,93,250, 168,87,56,254,55,111,184,231,228,39,24,185,114,230,201,143,63,118,93,246, 9,60,212,4,32,132,108,73,17,25,146,209,206,47,147,95,160,84,69,12,248, 171,73,1,33,56,164,240,16,250,45,120,173,13,152,185,57,72,206,208,220, 120,17,129,219,0,33,136,108,253,174,253,73,100,234,128,164,47,30,69,210, 191,236,14,44,236,160,186,254,77,212,214,158,133,223,169,238,111,1,209, 88,80,235,18,60,68,187,117,25,157,246,85,84,214,159,66,121,238,14,148, 231,239,132,101,47,140,40,156,3,174,79,198,245,1,91,205,50,221,204,193, 112,138,42,211,114,42,181,30,177,211,112,78,55,237,226,157,118,97,249, 142,192,111,254,104,216,89,126,242,77,143,252,251,63,106,53,175,126,250, 78,237,169,75,143,63,254,248,117,227,39,56,212,4,208,217,188,220,176,10, 115,46,128,92,178,219,247,96,208,110,148,14,253,168,127,140,92,41,106, 121,77,65,117,3,205,202,121,248,205,202,150,126,244,83,243,247,73,137, 78,123,21,27,87,190,130,78,243,242,4,119,253,73,174,118,208,177,212,29, 145,82,192,247,54,177,182,82,69,181,242,12,242,165,155,48,55,127,15,242, 133,227,208,180,193,211,131,149,54,54,194,117,202,120,135,182,161,71,89, 126,187,237,202,52,14,8,213,160,91,121,162,153,185,5,43,55,255,176,237, 47,191,217,42,44,63,191,30,222,253,123,15,125,236,35,255,238,244,99,111, 190,46,122,6,28,106,2,160,58,237,0,36,216,246,77,61,154,65,47,116,195, 134,93,58,2,167,116,20,186,225,0,132,192,180,75,200,207,223,8,183,190, 170,242,200,91,235,170,156,119,44,140,190,115,11,30,160,86,249,54,54,87, 158,66,24,52,199,60,207,62,33,26,15,54,24,105,90,148,8,195,54,106,149, 111,161,89,123,17,78,254,24,230,230,239,70,177,116,51,116,163,176,179, 224,14,72,242,33,84,131,102,58,208,205,124,111,136,111,159,64,8,137,71, 167,91,154,233,188,162,93,187,252,93,87,158,89,255,63,247,117,17,7,136, 67,77,0,246,242,77,45,10,244,181,111,138,213,255,109,26,97,18,13,86,174, 4,167,116,20,134,83,86,95,172,232,203,73,116,19,150,62,15,195,46,33,55, 119,2,94,115,29,237,218,101,120,173,13,21,6,236,65,175,23,59,201,197,39, 20,132,26,32,148,128,96,88,122,176,170,222,171,92,253,42,154,181,243,123, 159,126,115,160,216,170,27,113,30,160,213,120,9,237,230,101,88,246,60, 202,243,119,162,60,119,7,44,123,30,132,168,153,1,74,211,233,13,241,165, 65,168,30,77,35,118,182,13,241,77,21,209,223,142,51,31,126,187,138,198, 218,217,181,103,30,127,34,51,1,14,3,106,23,174,186,198,173,102,67,151, 5,245,196,208,210,89,162,218,115,17,2,170,155,176,114,243,42,118,108,56, 67,90,122,17,80,77,135,153,43,67,183,243,176,75,71,225,183,43,232,212, 175,194,111,109,128,135,105,34,80,133,41,220,15,84,91,113,170,69,57,6, 34,234,191,31,213,177,71,189,248,227,22,228,173,218,121,108,92,253,10, 124,183,54,108,209,7,130,221,239,175,131,13,36,41,57,60,119,3,190,87,193, 230,198,55,81,44,221,140,185,249,187,97,219,75,189,62,142,244,45,32,4, 154,102,69,173,193,204,125,154,211,48,0,68,125,161,88,208,65,208,169,35, 112,171,16,44,92,5,50,31,192,161,0,217,124,46,148,183,220,28,229,110,15, 248,234,166,53,1,66,96,152,5,88,249,133,110,198,216,8,182,36,165,58,76, 167,8,195,202,193,46,46,35,104,87,209,105,172,68,45,165,92,136,104,144, 39,11,218,16,92,181,8,227,134,5,61,244,213,64,14,45,30,201,165,131,16, 10,198,60,212,42,223,66,99,243,5,213,240,162,191,82,37,94,250,33,233,218, 51,30,250,219,145,167,94,145,18,97,208,196,230,198,55,81,175,158,133,109, 45,194,144,14,242,197,19,208,141,92,247,141,132,64,215,237,168,83,176, 1,85,249,39,39,146,93,57,22,34,162,102,126,11,65,167,174,6,159,114,198, 66,175,185,178,191,11,57,88,28,106,2,192,203,95,238,82,205,104,108,221, 123,250,126,211,116,152,86,65,133,251,134,238,250,219,163,155,73,230,192, 42,44,34,112,107,112,235,171,104,109,190,4,214,90,71,232,181,146,247,201, 184,121,5,33,106,74,14,81,237,196,125,175,134,90,229,57,248,94,5,113,145, 13,81,225,134,212,207,120,253,147,38,128,221,31,47,158,26,52,58,182,119, 151,114,238,163,190,121,22,237,149,115,176,172,121,148,151,239,193,220, 242,189,176,156,57,24,70,14,90,52,210,60,94,182,170,188,22,128,136,91, 136,77,81,99,138,136,87,181,11,111,34,244,234,137,105,39,4,231,58,213, 87,167,119,242,195,135,67,77,0,55,149,192,59,29,191,6,91,70,127,184,173, 81,0,205,176,97,56,37,24,86,113,228,93,127,59,196,115,242,52,195,130,149, 155,135,51,119,28,157,205,75,168,175,62,135,118,237,114,164,21,132,64, 98,2,40,147,160,213,184,136,70,245,28,4,247,35,193,143,132,138,80,16,26, 11,63,77,72,65,141,253,74,125,217,71,238,12,52,5,144,109,234,30,134,98, 231,152,137,16,12,157,230,85,176,208,133,83,56,138,252,220,141,208,13, 123,160,195,145,16,10,104,20,36,233,27,184,77,33,209,110,17,11,63,11,16, 184,117,85,56,148,42,179,22,156,121,33,243,174,171,150,97,135,154,0,214, 62,243,219,194,126,245,191,168,13,250,178,17,74,161,27,57,24,118,105,215, 187,254,118,136,39,230,58,186,34,130,194,226,45,104,215,46,161,177,122, 22,157,250,149,104,16,102,136,192,111,160,89,59,7,175,83,137,63,24,249, 35,4,192,145,210,2,186,164,160,6,86,112,213,226,42,190,178,84,221,250, 232,139,156,232,37,239,2,195,73,64,10,14,72,32,95,190,1,55,220,249,189, 40,47,223,13,205,112,118,54,125,98,141,74,210,110,83,209,73,152,7,145, 189,207,3,15,190,91,3,247,59,189,225,88,2,72,201,59,1,119,107,123,63,217, 236,224,80,19,192,233,211,167,249,247,127,231,255,212,203,200,132,128, 82,3,186,153,131,110,229,161,105,198,158,119,253,237,160,114,203,77,104, 133,69,152,78,25,133,133,91,224,214,87,208,220,56,135,205,171,79,163,186, 254,77,132,126,111,120,79,166,213,255,56,83,145,144,40,143,161,59,72,68, 132,65,234,125,81,66,99,100,90,116,15,118,120,28,136,131,49,152,4,40,213, 176,112,244,229,56,126,251,155,145,47,159,136,84,254,49,254,78,49,17,96, 2,230,1,33,128,20,170,187,147,91,7,11,221,158,60,47,117,25,18,82,240,54, 149,206,117,213,49,232,80,19,0,0,41,37,111,75,193,37,209,40,137,189,199, 186,149,31,170,74,78,13,132,128,234,6,44,125,14,134,93,132,51,119,28,206, 220,81,24,118,30,149,43,95,71,167,121,181,27,38,76,90,96,39,191,37,154, 1,8,133,36,68,77,170,137,166,213,168,215,186,231,233,54,180,234,53,15, 134,7,212,208,125,223,214,135,163,92,220,88,239,222,138,94,18,208,168, 137,185,229,59,81,158,187,27,166,51,183,231,16,223,174,205,3,2,117,191, 57,67,232,53,213,128,82,22,36,43,238,190,141,64,74,128,179,160,42,234, 87,218,123,90,236,140,225,176,19,0,188,214,198,134,153,95,224,132,80,93, 51,44,21,55,158,242,174,191,61,212,142,77,169,134,252,220,77,184,233,229, 75,88,186,233,181,168,94,125,26,27,151,191,138,118,253,162,106,38,210, 15,213,144,34,81,103,69,52,238,187,39,195,145,116,191,215,105,66,72,29, 4,50,157,99,191,39,237,160,123,92,74,181,9,152,80,138,4,12,163,128,249, 242,61,40,148,110,153,124,74,239,56,230,65,98,239,251,202,222,119,27,209, 172,198,173,239,81,253,10,4,0,84,91,218,210,117,213,49,232,208,19,128, 97,21,125,205,112,164,233,148,64,53,115,106,35,189,71,131,4,103,1,88,160, 230,1,168,146,213,2,116,243,54,228,230,142,99,241,198,7,80,91,125,22,235, 151,190,140,214,230,57,176,112,187,118,94,234,203,43,165,250,2,202,158, 77,52,149,206,188,165,113,158,4,132,170,106,148,156,67,18,10,162,109,67, 134,100,200,227,9,131,128,192,182,151,177,48,127,31,156,252,81,104,154, 57,61,146,222,201,60,136,147,123,66,23,126,167,134,208,107,69,206,62,25, 173,52,66,215,1,3,41,37,56,115,87,47,133,237,89,206,216,26,27,135,158, 0,230,111,124,197,13,249,185,121,221,180,76,4,190,0,11,2,8,190,183,246, 95,187,129,20,2,44,84,51,239,251,251,11,16,170,65,55,243,200,47,56,112, 74,71,48,127,226,126,212,215,158,195,198,197,51,104,84,206,170,249,116, 163,172,87,70,166,3,84,92,189,91,152,20,127,60,142,153,43,123,64,240,168, 41,10,36,84,231,178,173,195,48,246,3,148,232,40,228,111,198,220,252,61, 176,236,185,110,136,111,31,208,111,30,0,170,97,12,243,218,8,58,85,176, 160,131,116,70,34,146,71,4,132,72,149,71,66,34,167,165,16,43,56,243,187, 215,77,18,16,48,3,4,192,66,63,36,84,147,150,163,17,203,209,16,6,58,124, 151,33,244,67,8,62,124,98,204,36,33,120,168,218,130,239,208,173,71,69, 14,28,228,202,39,96,231,151,48,127,236,229,104,108,188,128,141,139,95, 70,125,253,57,53,165,118,71,143,118,202,246,143,4,61,17,250,152,0,162, 93,44,94,15,145,18,160,2,68,170,54,105,216,195,152,243,113,161,107,14, 230,74,119,161,56,119,7,12,35,119,112,51,11,137,170,255,23,60,26,7,222, 222,84,26,88,108,122,197,111,139,25,53,50,183,226,219,36,174,211,177,97, 135,158,0,220,218,74,53,95,58,42,58,212,164,134,9,24,38,129,97,26,189, 68,32,38,52,165,167,15,82,74,213,125,56,106,63,61,42,84,129,137,5,71,63, 2,43,55,143,242,145,187,209,218,60,143,141,139,95,65,117,245,155,240,59, 149,110,132,96,28,2,75,136,32,50,13,4,135,140,213,93,41,64,165,80,249, 9,84,135,208,84,142,2,25,161,219,111,220,248,116,60,16,88,230,28,22,230, 239,67,174,112,34,170,226,59,56,243,140,16,2,206,66,4,110,45,73,231,150, 113,217,113,58,35,57,118,183,68,209,150,184,242,91,10,198,153,215,186, 238,166,6,29,122,2,48,243,11,27,18,224,156,65,23,28,8,3,32,38,2,211,138, 137,128,35,244,67,112,62,185,121,243,66,48,240,192,5,103,123,24,247,29, 213,38,216,121,21,66,44,46,221,129,35,213,7,81,185,252,53,84,46,127,21, 237,205,139,169,200,193,46,32,165,242,3,72,9,42,53,229,201,150,18,132, 10,80,169,131,104,2,36,234,118,180,173,144,143,57,239,128,16,13,121,231, 24,230,231,95,14,43,183,160,156,178,7,149,148,64,8,136,84,29,157,131,78, 21,129,171,230,56,72,136,20,89,34,49,165,226,240,159,76,61,142,76,0,70, 12,235,186,202,2,4,102,128,0,116,195,104,73,165,235,71,161,26,64,112,32, 136,136,192,52,9,12,83,7,11,52,120,30,71,232,133,16,124,231,134,160,67, 33,37,56,243,163,193,159,19,210,6,147,238,181,42,132,88,88,184,21,203, 55,191,22,149,75,95,195,250,133,39,209,174,93,76,194,83,187,93,179,20, 28,18,18,68,106,80,141,83,37,136,224,32,154,0,52,29,68,106,234,255,1,67, 51,199,129,166,217,152,159,187,7,229,242,157,81,98,207,1,58,101,163,196, 137,48,232,192,111,87,193,252,22,132,8,147,48,225,150,188,1,169,34,46, 36,14,171,198,105,200,32,16,34,236,248,237,198,230,1,93,201,129,225,208, 19,64,123,237,92,195,112,230,92,72,153,75,194,54,18,144,12,240,251,52, 130,130,169,131,57,26,124,151,35,240,67,8,54,30,17,72,193,193,66,55,233, 19,56,121,144,168,248,168,4,195,202,35,63,127,19,150,111,121,45,54,47, 63,141,181,243,79,168,200,65,224,238,254,240,209,72,45,9,9,42,37,32,169, 42,203,21,92,21,44,105,26,164,166,131,38,68,48,158,240,154,102,25,75,75, 175,70,105,238,118,213,95,1,50,153,213,183,223,173,205,226,116,234,208, 111,41,225,143,156,125,82,8,72,17,133,245,100,111,67,242,184,12,35,109, 251,199,79,72,33,58,38,213,171,251,122,17,135,0,135,158,0,52,187,208,34, 132,250,3,243,205,36,32,98,34,240,187,68,144,47,233,176,152,6,223,21,8, 189,16,156,133,59,16,129,4,103,97,20,222,219,159,40,144,42,62,42,64,95, 188,29,185,242,9,44,221,124,18,181,171,223,196,234,185,47,160,190,254, 124,84,124,52,100,205,59,185,14,98,34,144,82,57,8,165,6,33,4,136,208,64, 132,0,52,77,85,47,106,218,240,1,162,233,211,17,138,92,238,24,150,151,31, 128,83,60,14,77,51,19,39,163,70,53,80,221,232,18,193,30,7,180,140,2,66, 8,4,103,8,220,6,2,183,26,249,104,162,156,128,232,167,132,76,145,184,250, 246,36,26,127,76,2,169,190,114,146,5,117,207,175,183,166,186,240,67,136, 67,79,0,78,233,104,135,128,12,200,172,73,65,249,195,224,187,145,70,96, 0,134,69,144,47,106,224,142,6,223,53,16,120,33,56,99,91,118,42,41,69,202, 209,183,255,105,183,132,82,232,102,14,249,249,27,225,20,151,177,112,227, 171,209,172,156,195,218,249,39,80,185,248,21,4,157,234,30,214,165,90,167, 75,41,65,41,141,28,94,50,202,97,224,160,66,149,51,67,10,72,198,148,169, 208,151,103,65,169,129,114,249,14,44,46,189,10,150,51,175,162,12,253,215, 64,168,74,151,214,12,8,161,136,96,42,142,217,84,243,14,85,191,95,83,221, 158,209,85,249,21,241,41,18,234,189,111,82,145,86,154,5,16,53,128,87,67, 103,106,65,7,215,85,18,16,48,3,4,208,185,250,130,171,221,252,242,38,48, 218,220,123,193,35,141,32,4,116,3,48,45,32,95,210,96,229,52,4,46,135,239, 133,224,161,34,2,21,222,115,247,230,136,155,16,8,161,208,173,2,236,194, 50,202,71,238,196,242,173,175,67,125,229,91,88,57,251,89,172,93,120,18, 94,115,109,15,106,182,76,198,116,73,66,65,36,5,149,18,92,10,144,120,206, 162,223,81,45,184,53,3,36,138,32,232,122,30,139,139,175,192,220,194,203, 162,46,189,59,152,12,145,175,131,106,186,170,117,96,97,84,245,56,153,73, 74,113,84,198,239,84,17,122,81,102,95,42,195,50,238,66,148,196,253,123, 188,127,93,213,95,170,228,95,36,58,165,114,166,110,208,101,235,186,27, 27,118,232,9,96,253,234,185,48,127,227,189,157,62,195,109,71,8,14,4,28, 96,41,34,112,138,26,44,71,131,215,225,232,52,91,96,126,231,144,180,234, 34,208,116,85,224,20,199,209,29,221,130,157,155,199,252,137,151,227,134, 181,239,197,202,11,159,199,234,139,127,143,78,237,50,68,255,164,224,145, 17,9,138,80,201,50,202,97,40,192,3,31,161,215,6,213,13,104,154,9,106,152, 200,21,79,224,200,177,215,162,80,190,25,154,110,143,153,87,16,245,228, 55,117,53,179,97,175,126,130,164,121,71,7,126,123,19,97,208,142,170,13, 101,106,183,23,177,45,31,153,0,232,49,1,72,154,4,82,38,129,50,7,4,24,115, 215,206,126,234,169,235,42,9,8,152,1,2,184,233,198,151,187,212,48,27,187, 181,43,19,34,8,0,221,84,126,2,221,84,53,255,144,64,24,196,217,125,7,147, 255,17,151,29,171,233,55,36,245,60,1,137,67,136,183,148,81,62,118,15,110, 120,217,247,96,245,133,191,199,202,11,159,67,179,114,30,91,70,134,143, 1,41,37,192,213,238,44,88,8,17,6,144,156,3,186,68,105,254,46,28,187,241, 31,193,41,28,5,213,245,116,242,236,248,215,71,181,1,126,130,209,215,77, 8,129,16,28,161,215,64,208,174,169,232,76,148,239,16,39,72,37,194,15,209, 173,17,72,251,0,8,65,156,88,153,132,0,82,255,171,17,227,218,26,112,58, 35,128,67,135,82,137,243,192,173,201,220,252,158,34,205,66,0,129,167,136, 64,141,26,32,48,157,34,116,203,1,11,60,176,160,51,249,113,227,59,128,106, 58,116,211,1,213,204,225,111,74,135,16,173,34,138,75,183,227,248,61,111, 193,250,185,127,192,202,11,159,71,99,227,133,193,197,71,163,34,18,22,17, 6,48,236,18,142,222,248,122,28,185,233,65,152,78,121,162,141,58,99,63, 1,213,12,200,17,253,4,221,228,158,216,222,247,123,67,124,41,181,191,75, 4,125,213,130,177,159,47,189,251,247,77,123,246,221,77,222,216,120,110, 5,251,145,86,122,200,112,232,9,96,237,51,143,139,165,183,190,167,54,169, 105,185,66,0,60,228,96,129,27,13,21,53,97,218,5,232,102,154,8,252,233, 18,65,212,99,64,53,50,25,85,200,162,70,166,78,9,186,149,71,97,254,38,28, 187,243,33,172,191,116,6,171,47,124,22,181,213,111,129,133,187,11,33,18, 66,225,20,142,224,134,59,190,7,11,199,239,135,110,228,166,86,116,69,8, 1,217,226,39,232,11,215,70,229,209,42,185,167,166,38,253,114,150,114,246, 245,239,254,41,251,95,240,174,118,160,14,214,45,169,216,50,240,85,162, 211,92,193,213,23,63,199,155,235,103,175,171,94,128,49,14,61,1,156,62, 253,24,127,207,219,127,114,99,210,77,35,165,20,106,156,56,15,65,53,29, 154,110,193,180,115,48,76,27,44,244,192,252,14,216,20,136,32,105,57,166, 91,187,78,200,161,84,3,181,11,208,205,28,114,229,227,56,122,219,131,168, 92,254,58,86,94,248,28,170,87,191,129,192,111,142,236,129,39,84,195,220, 145,123,113,219,253,167,80,152,191,37,234,210,187,31,89,125,253,126,130, 48,170,109,80,187,123,24,116,224,119,170,96,94,43,25,249,158,118,246,245, 254,236,18,128,136,8,1,73,121,101,228,248,4,208,175,246,183,106,151,176, 126,229,203,112,91,171,62,151,226,186,156,26,126,232,9,0,128,148,34,108, 74,33,6,166,2,236,6,106,119,139,190,28,82,128,179,0,130,179,136,8,76,24, 86,174,71,35,96,161,55,145,248,54,213,148,163,143,110,25,128,177,187,227, 18,74,161,91,57,228,205,27,97,151,142,96,249,230,147,168,174,60,139,149, 23,62,135,202,165,175,170,137,195,61,68,208,123,251,116,51,135,227,119, 191,25,183,222,255,78,216,197,163,209,96,142,253,71,236,39,208,140,104, 215,111,85,148,240,251,237,62,245,94,14,208,2,82,118,191,224,137,19,80, 33,46,156,74,229,3,16,149,230,93,223,60,139,205,149,167,192,152,7,41,120, 135,112,118,221,37,1,1,179,65,0,104,55,214,54,236,226,17,142,41,174,183, 75,4,97,66,4,186,229,168,161,162,161,15,230,119,192,67,47,242,31,140,41, 176,209,200,234,225,170,245,118,188,182,243,185,226,209,90,90,249,56,172, 252,34,22,78,220,143,198,218,243,88,121,241,243,216,184,120,6,110,123, 93,217,62,41,216,133,101,220,246,202,31,194,241,187,190,91,77,225,61,208, 62,11,36,73,238,97,126,27,126,171,2,22,118,250,118,250,148,208,67,244, 16,67,226,249,151,2,144,188,75,122,81,157,64,226,4,0,192,152,143,234,250, 51,168,175,127,171,27,1,146,178,13,199,172,29,192,133,31,56,102,130,0, 76,43,87,157,168,155,158,144,110,255,189,62,168,198,16,97,52,3,32,34,2, 211,129,110,88,41,34,240,163,47,207,8,194,73,53,232,198,94,84,254,97,159, 217,122,238,110,21,226,50,172,220,28,202,199,94,134,27,42,223,131,149, 115,95,192,198,133,39,209,105,92,133,148,2,165,35,119,227,142,7,126,20, 139,55,188,114,75,244,97,223,17,85,69,114,22,32,232,212,224,181,43,41, 79,255,78,206,190,116,139,48,101,255,75,33,226,244,30,32,110,193,22,69, 4,88,216,66,101,229,41,52,107,23,148,150,16,167,150,11,81,101,181,230, 117,151,4,4,204,8,1,24,70,190,41,177,135,152,215,46,32,165,132,228,33, 132,96,160,44,77,4,54,120,232,35,12,58,224,129,7,33,135,87,32,42,149,63, 63,48,123,110,239,216,190,11,144,170,66,92,128,233,148,80,92,190,3,39, 238,250,110,172,158,251,7,120,205,53,220,246,192,41,20,23,111,69,84,6, 55,133,181,141,8,66,64,36,1,99,46,252,118,21,161,215,84,14,216,129,118, 126,63,17,244,61,22,2,66,136,36,52,170,254,34,20,42,3,48,30,211,246,53, 116,218,43,209,169,227,251,39,1,200,106,145,148,219,215,93,30,48,102,132, 0,154,149,243,117,35,95,118,33,225,236,123,213,169,148,81,200,170,75,4, 154,97,65,51,44,112,203,71,152,152,6,41,34,136,166,223,104,230,65,85,203, 197,69,239,4,84,51,97,231,45,69,92,129,139,78,237,10,116,77,135,101,233, 32,186,3,22,134,224,225,254,134,63,213,218,40,32,5,194,160,173,132,223, 111,69,93,121,120,95,156,127,128,173,159,60,238,85,255,165,228,221,10, 78,18,219,254,2,157,230,26,42,43,95,71,224,86,17,119,104,142,33,165,132, 16,98,253,234,188,203,112,117,127,111,193,97,192,76,16,128,70,116,23,64, 40,227,140,174,61,34,30,208,49,170,167,28,64,47,17,80,77,17,129,174,136, 64,132,1,194,160,3,22,120,128,20,208,76,53,243,238,192,106,228,83,32,132, 128,249,109,212,86,190,133,250,234,243,144,130,161,93,91,129,20,12,185, 210,34,236,226,34,12,51,15,22,176,200,180,217,143,98,30,53,23,129,197, 149,124,97,39,170,89,80,187,56,132,216,222,217,23,87,253,165,237,126,17, 153,0,82,229,120,16,80,72,112,180,234,151,177,185,250,13,176,176,51,212, 212,33,82,174,225,153,103,14,67,74,232,190,99,38,8,32,183,120,83,3,68, 219,67,157,236,4,33,227,18,88,14,74,3,80,195,132,166,155,176,13,19,36, 175,122,244,177,16,123,235,73,48,1,196,95,118,191,189,137,218,202,115, 232,212,175,34,244,91,208,12,27,130,5,240,58,13,112,198,224,119,218,112, 138,101,88,249,57,24,102,1,140,177,168,239,226,104,62,142,49,87,213,173, 228,243,26,8,58,181,164,219,82,119,215,231,189,130,142,193,206,190,180, 6,16,199,255,227,161,173,0,129,148,28,205,234,57,212,54,158,131,224,193, 224,210,103,2,128,11,41,33,87,113,157,181,2,139,49,19,4,80,91,253,150, 191,120,211,3,45,56,147,58,34,233,9,14,237,14,82,85,190,249,28,156,6,208, 12,3,133,178,5,203,166,96,33,84,79,130,164,2,113,127,137,128,68,185,243, 110,125,5,141,245,23,187,163,207,165,140,76,18,18,53,57,245,19,167,103, 224,186,176,114,37,88,249,34,140,66,30,44,100,8,3,63,41,184,153,192,162, 144,56,251,220,58,2,183,14,193,130,68,240,147,93,61,49,1,134,216,250,253, 130,47,121,215,249,23,141,91,19,34,64,125,227,121,52,107,231,161,166,56, 247,10,127,79,0,86,10,206,121,112,93,38,1,1,51,66,0,155,149,179,65,233, 200,93,29,71,46,2,100,82,233,169,147,82,207,37,164,96,96,1,135,219,210, 32,97,246,84,32,38,68,16,238,15,17,16,66,33,120,128,246,230,69,180,170, 23,17,184,13,213,227,32,169,140,235,91,125,20,254,244,93,9,198,66,132, 190,7,43,87,128,225,228,97,20,10,96,33,71,232,123,145,70,179,187,77,146, 68,158,120,30,184,8,92,213,166,59,137,162,36,101,188,91,51,249,134,57, 251,18,45,65,164,9,64,21,29,177,176,131,218,250,179,232,180,86,226,147, 35,153,179,210,187,170,232,250,37,163,218,245,215,10,44,198,76,16,192, 37,231,105,23,103,89,253,136,247,26,44,28,121,5,44,187,140,189,8,48,73, 254,153,32,164,132,224,162,219,147,192,4,76,83,17,129,29,117,41,242,61, 150,148,34,79,3,132,80,240,160,141,230,230,75,112,235,43,8,131,206,224, 182,102,3,108,97,41,5,56,15,225,123,45,48,22,194,240,125,88,78,30,134, 237,192,40,22,16,198,68,192,198,171,234,35,68,13,241,96,126,71,205,228, 11,58,41,33,223,238,255,237,156,125,34,17,122,41,4,132,84,115,22,189,78, 5,181,245,103,225,71,206,62,229,235,73,47,166,255,1,129,148,162,195,130, 246,117,215,10,44,198,76,16,192,124,181,202,154,226,124,35,8,170,168,172, 63,133,165,163,175,198,252,210,125,187,39,130,169,48,0,162,47,237,214, 46,69,189,26,129,142,192,99,96,33,155,88,207,193,216,222,15,220,26,218, 155,23,225,181,42,96,161,191,53,196,215,167,129,144,212,191,233,218,120, 193,67,4,126,27,156,133,48,2,95,165,72,91,14,140,98,81,153,6,190,63,66, 225,20,73,85,242,181,16,184,117,240,208,131,74,226,73,237,248,177,9,16, 11,184,232,243,1,136,180,127,32,245,122,188,235,71,59,191,215,89,71,117, 253,25,4,110,61,42,255,31,241,239,43,165,107,66,175,141,246,230,107,15, 51,65,0,207,172,173,137,123,74,75,85,97,115,116,90,43,184,216,254,175, 216,88,253,218,222,137,96,154,232,239,82,20,19,65,49,210,8,60,3,190,203, 192,194,112,79,68,16,219,251,126,171,130,118,237,138,178,173,121,128,174, 186,47,163,127,227,114,170,97,157,129,251,215,175,124,28,129,215,1,103, 33,194,32,136,136,192,134,97,26,96,140,33,244,124,229,71,232,39,130,104, 190,33,231,161,42,227,117,27,81,211,149,72,240,209,215,190,43,109,215, 39,233,188,50,165,13,240,94,103,95,226,245,103,16,44,68,167,179,138,118, 235,34,160,83,24,185,98,82,96,52,240,194,122,6,175,10,72,33,234,176,141, 235,106,32,104,26,51,65,0,56,125,154,211,31,122,85,82,172,33,229,94,137, 128,168,148,220,125,10,125,247,19,129,97,2,78,129,194,114,76,165,17,68, 68,32,198,36,2,66,41,36,11,208,105,174,193,109,172,69,177,244,225,209, 44,2,178,115,137,239,128,198,139,66,112,132,190,11,206,89,68,4,14,12,211, 132,81,210,193,66,91,17,65,224,67,8,158,104,35,60,140,102,242,249,205, 110,217,111,210,183,47,157,197,215,39,232,219,58,251,162,159,92,121,252, 57,11,208,110,93,70,167,179,2,9,1,77,55,0,195,84,199,228,138,28,4,15,83, 154,79,58,254,31,145,9,231,53,230,177,195,17,97,58,0,204,6,1,168,13,172, 1,33,36,40,77,254,138,131,136,96,225,200,253,48,205,2,14,157,70,128,136, 8,60,69,4,73,151,162,136,8,2,79,13,58,97,1,139,234,13,134,131,68,201,44, 60,112,225,54,86,35,149,223,29,160,242,247,253,140,115,226,147,9,196,227, 64,245,18,84,45,212,24,88,96,193,176,109,24,166,14,163,148,7,15,109,120, 174,15,22,184,42,159,191,83,75,141,229,138,62,143,62,129,23,3,126,38,38, 64,218,201,215,235,237,23,34,4,99,30,218,141,151,224,122,21,168,108,63, 26,217,253,4,132,18,64,55,160,153,182,26,194,202,2,8,22,38,247,71,10,174, 230,61,72,1,64,86,231,200,130,91,31,243,110,92,43,152,21,2,0,115,155,27, 154,229,112,50,96,205,105,34,216,92,255,38,150,142,125,7,230,23,239,129, 177,13,17,76,35,255,125,36,47,191,140,154,147,248,189,237,202,236,124, 164,17,196,166,65,60,241,104,200,186,67,183,9,183,185,166,98,233,81,136, 111,219,147,2,189,49,128,30,207,248,118,247,98,144,195,144,35,12,61,112, 206,193,2,19,134,101,194,180,117,216,196,64,195,109,192,107,111,70,132, 36,227,15,244,105,0,3,76,0,193,149,51,47,118,238,13,176,249,133,224,106, 212,119,208,66,179,121,1,65,160,196,54,174,238,36,148,0,160,9,65,130,18, 232,154,1,105,90,144,17,17,240,208,87,93,162,163,14,198,156,135,43,23, 46,156,190,46,147,128,128,25,34,0,98,152,53,144,237,147,53,164,228,104, 53,46,162,211,186,138,141,149,175,238,64,4,211,208,16,70,12,243,69,133, 205,61,68,160,3,134,5,56,57,2,203,54,16,248,58,252,14,67,24,132,201,48, 84,18,165,207,250,110,29,94,115,29,161,215,28,179,161,105,191,23,160,247, 30,116,157,130,59,223,27,130,168,79,95,24,68,142,56,11,154,14,132,94,51, 154,109,144,18,126,164,67,125,91,85,255,94,7,31,223,34,248,137,179,79, 48,4,94,29,205,230,121,48,214,6,72,44,236,93,161,87,189,255,122,31,19, 66,85,15,5,195,132,102,57,16,97,0,230,181,193,252,14,36,65,5,215,105,18, 16,48,67,4,96,24,118,93,165,133,237,12,33,216,24,68,112,240,16,66,77,58, 98,12,8,35,34,176,157,136,8,188,104,244,89,160,114,246,253,78,21,126,43, 106,140,57,86,56,81,14,215,18,70,186,37,195,223,36,165,140,18,135,84,135, 159,45,68,152,244,232,19,91,132,191,199,203,159,18,246,56,189,87,36,49, 254,16,158,187,129,86,243,37,112,17,116,211,185,135,9,127,60,123,49,121, 30,145,121,16,165,113,91,57,24,204,7,15,252,239,63,254,154,239,185,34, 2,255,47,86,159,162,23,129,235,75,27,152,25,2,240,188,122,211,214,77,23, 128,61,234,103,182,35,130,3,29,105,53,4,49,17,164,91,154,91,57,2,221,208, 209,216,100,232,180,55,225,181,43,224,225,78,42,255,112,196,153,128,67, 94,77,253,232,247,158,15,253,37,65,34,204,201,19,233,221,63,14,237,165, 29,129,253,49,125,150,8,124,58,193,135,243,0,157,214,10,218,237,203,144, 146,111,217,245,211,2,159,60,135,126,34,64,151,32,64,64,117,10,77,215, 161,91,185,251,56,11,254,13,15,252,159,58,241,90,255,207,16,60,244,199, 185,246,229,103,207,158,61,187,135,70,139,179,131,153,33,0,26,6,29,41, 229,174,26,248,15,34,130,82,233,182,232,213,3,210,8,182,233,111,36,165, 114,20,178,80,69,12,108,91,66,112,23,126,148,62,59,154,169,209,191,11, 3,73,244,99,26,32,234,36,91,252,32,253,36,0,177,85,245,239,9,1,242,30, 66,96,204,67,187,117,25,110,103,85,213,249,239,74,248,35,151,231,0,50, 32,4,208,173,156,161,27,246,189,130,135,247,240,32,255,99,158,93,248,235, 163,229,219,255,16,161,124,114,245,169,255,218,158,206,13,59,28,152,25, 2,128,89,110,16,66,92,200,110,119,151,113,145,38,2,39,119,4,115,139,247, 162,92,190,3,186,145,155,200,18,187,109,195,38,67,42,49,17,8,14,132,126, 8,201,135,105,167,178,231,199,54,71,28,176,182,29,214,58,70,210,84,50, 158,43,57,87,87,240,211,142,192,222,212,223,174,183,95,8,166,10,122,34, 123,159,5,46,90,205,11,240,124,149,168,151,246,244,119,51,253,98,129,142, 178,254,210,166,192,64,225,143,134,131,162,143,12,52,13,154,166,83,106, 216,55,73,158,251,73,45,244,127,152,135,254,233,27,94,243,182,143,75,194, 78,95,249,210,223,109,142,114,135,103,13,51,67,0,212,247,61,228,156,137, 176,177,16,12,237,214,21,116,218,171,168,21,158,195,226,210,253,40,150, 110,129,166,143,108,93,76,6,35,114,133,202,139,217,253,119,111,75,52,176, 103,254,192,152,7,75,127,54,249,167,123,38,153,38,163,196,246,143,119, 255,110,78,127,156,229,135,200,233,23,103,244,117,61,253,77,52,26,23,16, 134,141,222,93,190,223,211,191,197,241,135,193,194,158,242,5,32,33,8,108, 121,142,18,2,104,22,209,12,115,81,136,220,15,241,192,127,155,8,131,39, 111,120,195,15,254,129,240,197,223,92,61,115,242,18,240,216,53,227,52, 156,25,2,104,214,55,253,82,169,216,154,92,167,122,21,53,104,55,47,193, 109,175,34,151,63,134,133,165,87,28,12,17,76,24,131,169,34,118,2,198,18, 219,31,1,24,196,4,227,177,67,98,227,39,103,236,238,246,177,19,16,114,64, 36,32,86,249,163,193,33,190,91,69,171,121,1,140,119,70,246,244,15,22,254, 216,167,177,85,248,187,239,29,242,28,165,160,148,66,83,51,209,222,44,5, 127,3,247,189,111,221,252,166,111,254,9,9,190,239,19,75,108,245,236,153, 51,103,14,126,166,220,30,49,51,4,32,143,30,113,41,213,166,146,178,41,68, 136,86,243,34,58,237,149,253,39,130,61,89,12,219,104,5,195,94,26,245,92, 187,88,83,215,182,71,111,236,191,47,12,136,196,33,216,91,210,203,185,15, 183,179,134,86,243,37,8,17,238,202,211,223,107,2,96,7,225,239,62,223,35, 252,41,159,2,213,141,184,165,155,165,155,246,171,116,59,255,10,30,186, 31,216,8,10,127,113,226,13,199,255,136,138,141,175,93,122,226,137,153, 205,36,156,25,2,200,179,151,184,144,247,182,38,105,99,247,227,64,137,96, 106,232,38,1,145,216,110,78,48,182,254,191,253,107,241,78,31,153,2,113, 222,191,76,147,193,160,48,160,16,224,220,71,167,189,130,118,231,50,36, 248,22,123,127,91,103,95,66,10,24,34,252,233,223,177,141,240,247,30,131, 26,6,40,237,138,8,161,26,116,75,211,52,195,188,77,183,114,63,167,155,249, 119,115,191,240,223,110,120,195,209,143,91,126,251,239,95,60,243,183,13, 108,203,202,135,15,51,67,0,103,93,151,223,99,250,27,210,206,237,214,7, 56,50,118,77,4,82,238,206,71,57,61,78,235,61,7,72,242,223,40,97,189,29, 65,122,31,36,161,62,116,119,254,30,45,32,149,10,156,142,0,112,230,170, 26,126,119,13,212,208,161,105,142,186,151,130,119,75,152,198,12,243,13, 38,3,140,36,252,132,82,53,41,121,72,221,4,161,20,26,181,8,213,205,99,194, 118,126,84,15,252,183,243,160,240,196,205,111,252,225,223,135,219,250, 187,151,206,252,205,204,116,24,154,25,2,192,233,211,130,188,235,85,213, 253,60,229,181,165,17,196,187,51,118,144,247,254,23,119,216,245,211,175, 247,169,253,137,189,159,56,255,186,218,64,108,2,132,65,11,155,43,95,71, 171,254,18,168,97,129,104,221,209,97,32,166,34,9,174,136,162,235,116,28, 164,5,96,7,225,79,155,1,125,175,111,17,126,115,164,112,41,33,4,154,110, 18,77,51,202,194,114,222,198,45,255,187,184,157,251,198,45,223,245,35, 127,196,155,141,63,191,84,242,207,227,244,225,78,44,154,29,2,0,4,64,155, 187,77,128,217,211,137,83,68,144,47,156,192,226,242,171,144,47,222,8,109, 187,161,158,227,98,162,90,64,255,61,82,191,115,22,128,139,0,216,241,84, 164,247,17,233,125,174,255,61,241,57,18,181,62,93,246,155,210,2,100,202, 31,0,41,224,185,155,216,184,250,85,184,173,213,36,202,161,66,169,12,2, 106,120,42,213,12,64,87,105,199,224,28,66,8,196,3,62,135,10,127,252,56, 122,126,44,225,55,76,140,157,36,70,212,220,70,234,104,142,102,217,175, 229,97,238,213,220,202,125,232,150,192,253,11,188,225,29,127,96,172,249, 207,158,61,251,169,67,153,88,52,75,4,0,230,181,214,117,219,230,4,218,36, 131,1,35,67,136,16,205,198,5,116,218,87,145,47,222,136,133,197,87,76,158, 8,38,13,169,254,241,189,42,54,215,159,70,171,115,17,139,236,149,40,45, 220,1,195,74,253,249,35,7,218,32,144,45,15,6,127,172,27,239,143,78,156, 10,5,246,146,129,64,167,185,130,141,149,175,192,239,108,14,206,106,20, 2,2,12,84,74,16,77,7,213,116,165,25,196,166,65,212,255,111,220,48,95,143, 179,47,45,252,154,74,17,222,155,125,169,202,173,169,229,24,186,97,189, 140,179,220,221,60,240,254,123,102,186,255,229,230,227,239,250,184,91, 217,124,114,253,153,211,135,106,252,192,76,17,0,136,108,73,85,15,112,32, 4,16,131,243,0,141,218,139,104,55,47,245,16,129,82,27,247,176,149,15,250, 232,158,20,30,181,43,183,155,87,177,185,242,20,60,183,2,65,24,86,175,60, 137,70,253,60,230,151,95,134,226,220,109,48,237,242,128,207,110,87,48, 220,239,67,136,206,22,77,229,217,170,254,119,181,0,33,24,154,181,115,216, 88,253,58,152,223,236,61,234,0,225,83,59,127,212,152,84,211,65,52,13,84, 215,213,177,121,138,8,162,101,245,8,255,118,97,190,20,65,80,77,7,213,141, 61,10,127,47,8,165,208,77,155,106,134,121,163,176,114,239,103,129,255, 14,170,91,159,179,231,223,249,7,97,219,251,244,202,215,62,181,129,67,224, 48,156,41,2,48,204,66,133,168,9,65,198,65,175,5,216,74,4,139,203,175,196, 188,121,47,116,125,98,237,139,119,135,232,107,197,69,136,122,245,44,106, 27,207,130,5,109,196,130,32,5,135,219,94,131,239,85,81,171,60,135,185, 165,123,49,183,116,23,76,123,174,247,56,100,224,195,1,32,145,204,167,226, 252,241,66,146,200,0,192,121,136,218,198,179,168,174,127,83,13,92,237, 95,112,218,167,208,119,194,152,8,164,20,74,27,136,39,11,39,68,208,109, 186,218,99,18,68,143,135,10,191,30,9,255,148,188,176,132,80,104,134,73, 168,110,44,74,203,126,39,11,253,239,53,28,247,171,55,189,241,135,254,83, 200,189,191,90,249,135,252,37,224,241,125,158,202,210,197,76,17,0,247, 220,38,181,76,31,99,20,4,237,7,186,68,112,25,213,205,103,177,124,252,36, 74,229,219,212,60,192,113,177,87,95,64,36,75,140,117,176,185,250,52,26, 181,115,81,139,176,1,111,149,28,158,91,193,234,229,39,80,175,62,143,249, 229,251,80,94,184,11,166,61,143,225,141,180,183,59,183,232,170,243,169, 144,32,164,4,11,58,168,172,126,29,245,205,231,183,148,48,171,0,197,96, 173,98,203,26,162,110,63,82,74,80,169,41,243,192,212,33,165,169,158,143, 91,138,37,31,217,38,198,31,239,252,251,0,66,8,136,110,192,212,244,188, 48,237,55,106,86,254,117,70,224,125,248,230,239,234,124,66,116,222,254, 137,163,114,229,185,131,72,44,154,45,2,8,218,29,93,150,6,127,155,15,1, 56,247,81,171,60,135,102,253,60,138,229,219,176,124,252,129,221,19,193, 216,232,38,252,250,94,21,27,43,95,133,219,186,154,244,235,219,78,215,148, 82,192,235,84,176,122,241,11,168,110,60,139,249,165,151,97,126,249,62, 88,206,66,143,86,76,82,255,14,58,127,236,0,236,70,1,212,121,3,191,129, 181,203,95,66,187,113,49,26,161,182,245,211,201,177,71,61,159,84,173,202, 8,36,136,212,148,48,27,150,50,57,162,172,194,184,183,224,150,208,95,111, 130,207,254,34,38,30,77,55,117,211,190,95,183,114,247,113,171,243,19,155, 97,254,215,128,51,31,223,239,229,204,20,1,16,115,161,78,8,57,244,89,87, 156,249,168,85,190,133,102,253,28,138,229,219,112,228,196,107,81,42,223, 170,60,218,163,96,151,90,128,148,2,173,230,101,108,172,124,5,129,91,235, 214,15,164,5,110,27,59,87,74,1,223,173,98,237,242,147,168,109,62,143,249, 165,123,49,191,244,50,216,249,229,29,61,227,82,202,174,192,37,6,128,128, 215,94,195,218,229,39,209,105,173,98,80,203,50,217,163,254,239,128,62, 111,36,81,39,142,186,9,73,16,170,52,2,77,55,33,117,51,149,94,172,70,186, 199,222,127,205,48,135,198,248,247,19,68,211,160,83,71,3,33,55,241,208, 93,60,136,53,204,22,1,104,129,39,133,213,217,75,69,224,126,34,38,130,86, 227,2,202,243,119,97,249,248,3,40,20,111,26,157,8,210,144,219,239,226, 66,48,212,55,191,141,205,181,167,17,6,195,106,166,82,71,216,230,246,73, 41,224,123,85,172,93,126,2,213,141,103,49,183,116,15,22,143,222,15,39, 127,4,132,104,219,108,202,170,26,82,2,16,66,160,85,191,136,181,203,79, 34,240,106,221,115,15,186,8,41,1,74,83,10,64,95,126,65,122,189,67,21,16, 153,56,4,17,17,1,213,12,64,51,64,99,141,64,202,200,127,112,8,122,65,16, 229,55,225,60,4,243,90,97,224,54,206,31,196,50,102,138,0,90,43,151,253, 185,91,238,104,29,50,23,192,142,96,161,139,202,218,83,168,87,207,162,60, 127,231,104,68,48,134,22,192,66,55,178,175,191,29,117,228,25,134,193,14, 182,45,167,73,204,109,137,192,175,99,253,202,151,81,223,252,54,230,150, 238,197,194,145,251,145,43,28,1,73,133,62,227,214,228,234,127,64,10,134, 122,229,219,216,88,57,51,132,140,182,212,39,110,187,190,94,178,31,226, 43,72,158,147,170,182,128,73,21,215,143,236,124,98,88,208,116,67,85,29, 178,184,21,251,1,57,225,19,225,15,192,61,23,220,247,90,34,240,174,28,196, 82,102,138,0,196,194,156,11,109,58,5,65,251,1,22,118,198,39,130,29,224, 123,85,172,95,253,50,218,141,75,209,184,173,97,80,205,52,72,207,238,186, 3,195,164,132,42,240,27,88,187,242,37,212,42,223,66,121,225,110,44,29, 123,53,242,197,227,93,34,136,118,96,206,61,108,174,62,133,202,234,211, 16,188,47,247,101,224,238,31,157,42,246,212,79,204,27,175,124,18,130,135, 32,82,64,51,44,80,211,130,6,64,112,14,30,6,169,217,132,251,72,4,177,240, 179,0,220,119,99,95,69,149,80,99,109,255,22,209,197,76,17,64,81,155,103, 16,242,80,37,82,236,6,147,32,2,21,223,191,140,245,43,95,130,219,169,108, 181,175,187,239,76,126,68,229,0,125,216,73,29,232,69,24,180,176,177,242, 53,52,170,103,81,94,188,7,139,199,94,133,66,233,70,144,232,181,181,75, 95,84,154,72,79,243,146,109,36,127,91,244,239,246,59,199,37,201,128,199, 82,40,34,96,190,7,170,233,208,52,13,212,206,65,10,171,219,37,56,158,93, 48,77,12,16,126,64,2,130,173,118,216,250,129,108,108,51,69,0,103,221,167, 248,221,198,125,27,186,157,27,152,52,50,107,216,145,8,122,204,128,238, 151,83,217,251,207,99,253,234,25,176,176,5,108,103,95,79,3,68,70,68,240, 85,212,54,159,195,220,194,157,40,206,221,142,171,231,62,131,250,230,183, 183,78,10,74,214,182,205,2,147,220,254,45,190,190,81,23,133,237,9,66,77, 68,230,34,128,224,81,151,96,213,19,16,154,161,230,4,240,48,80,131,85,166, 65,4,132,0,82,130,135,1,120,224,37,221,157,164,148,224,92,188,84,15,195, 206,228,79,186,51,102,138,0,240,221,223,45,200,215,55,235,7,189,140,73, 99,43,17,156,68,161,116,83,79,41,106,12,206,60,108,172,126,29,213,245, 103,212,60,128,161,216,90,15,176,43,202,220,246,67,50,90,251,211,168,172, 62,13,175,81,193,40,157,138,123,185,32,177,1,118,179,58,108,77,30,26,166, 26,116,29,127,138,8,4,4,231,32,26,133,166,25,208,77,27,154,97,130,179, 0,34,12,163,177,232,19,42,232,35,4,82,74,136,48,218,249,211,4,41,37,8, 228,121,60,243,204,129,52,23,57,4,238,208,49,240,216,99,66,211,181,250, 65,20,4,237,7,98,34,56,251,204,31,227,194,217,191,66,43,142,155,71,8,188, 26,174,94,252,60,54,215,158,30,154,220,211,131,45,183,105,39,207,226,246, 175,109,247,170,24,180,115,14,243,245,109,119,244,36,157,183,119,77,3, 207,62,196,103,56,170,234,32,165,128,96,12,44,240,162,97,170,18,186,97, 195,116,10,48,236,220,238,10,131,182,44,69,9,63,15,253,173,194,15,64,72, 193,120,24,92,192,1,121,36,103,75,3,0,16,186,237,10,53,28,78,14,184,30, 96,154,96,97,27,235,87,207,160,86,121,14,243,75,247,224,200,177,87,163, 213,88,193,149,11,159,70,187,121,181,119,103,26,242,181,25,252,244,168, 78,191,93,37,33,12,62,235,182,95,235,116,88,114,180,115,146,109,126,27, 250,78,130,109,77,70,41,37,36,83,249,2,202,52,208,160,25,22,52,221,132, 224,202,52,16,124,220,33,174,138,196,164,148,224,129,15,30,184,170,185, 99,63,184,240,65,228,249,49,14,60,81,204,28,1,8,193,26,145,158,121,205, 18,128,130,68,24,52,177,118,229,12,170,27,207,34,108,183,208,105,175,98, 76,137,239,69,74,8,198,159,13,184,61,100,82,241,183,245,149,161,191,15, 92,115,111,132,98,248,42,199,89,63,25,141,96,164,76,26,147,18,202,160, 69,33,68,170,27,16,156,69,145,131,81,66,136,145,240,11,9,30,122,224,129, 55,88,248,1,8,41,154,60,240,175,142,113,49,19,197,204,17,128,233,20,55, 160,230,250,30,138,130,160,233,67,34,12,218,8,195,189,53,68,78,180,243, 65,110,242,157,48,146,240,96,7,95,228,246,196,181,107,167,238,8,245,3, 81,246,255,232,199,140,10,140,152,16,32,140,64,139,210,134,169,166,119, 67,136,60,72,101,62,246,157,147,68,126,134,208,223,86,248,213,169,248, 38,215,205,202,208,55,76,25,51,71,0,96,94,11,134,29,96,214,178,129,14, 28,99,164,220,238,234,240,67,76,128,29,223,187,115,37,224,128,204,160, 225,199,222,66,112,35,238,254,131,16,85,54,178,192,79,146,138,122,67,136, 1,56,11,82,33,68,117,46,41,56,120,224,169,9,78,219,153,13,82,2,156,175, 80,63,60,176,220,150,153,35,128,160,213,110,217,118,233,80,118,87,57,124, 24,213,175,52,36,187,110,220,115,13,116,58,14,125,119,239,239,50,234,244, 211,191,174,45,152,108,186,208,168,24,28,66,116,162,200,65,168,136,32, 234,79,192,131,72,237,223,193,89,45,33,33,56,63,191,254,12,188,125,186, 140,45,152,173,40,0,0,228,203,13,204,64,65,208,190,98,170,254,227,17,50, 110,128,145,52,128,97,30,2,41,56,66,183,165,226,227,209,110,58,80,9,24, 38,245,59,177,1,217,131,22,208,7,41,4,56,11,193,124,95,69,14,8,129,110, 218,48,172,28,64,200,200,194,31,29,75,18,41,46,0,167,179,126,0,35,131, 74,31,66,122,179,82,16,116,152,64,8,221,185,236,126,220,99,70,63,7,59, 0,251,177,245,61,148,82,112,65,193,220,58,68,232,67,179,28,232,118,30, 154,97,131,234,145,212,167,163,19,187,88,252,52,146,198,164,20,144,76, 64,114,174,76,3,93,7,4,7,15,70,31,220,42,165,96,140,251,231,113,96,69, 9,51,168,1,116,106,23,93,193,249,204,214,3,28,28,246,193,7,48,14,7,72, 68,85,123,70,210,196,83,10,14,230,181,17,52,171,8,218,53,48,223,141,18, 114,70,147,143,225,254,205,233,109,20,82,74,8,30,34,244,35,155,127,140, 228,33,41,132,11,78,46,76,109,113,35,96,230,52,128,32,164,62,40,153,249, 122,128,125,135,68,74,99,218,205,54,186,195,225,101,127,24,80,166,100, 125,192,206,175,105,81,118,94,212,198,43,53,249,39,38,2,17,6,208,44,27, 186,149,135,102,218,221,190,125,3,215,178,77,26,240,148,71,193,75,0,136, 26,149,142,247,65,217,160,156,175,76,99,77,163,98,230,8,160,112,215,124, 136,14,174,233,145,205,123,195,160,100,156,72,200,162,58,121,244,215,195, 15,43,184,153,210,206,73,52,61,42,33,238,77,4,234,159,249,39,5,3,115,219, 224,129,7,205,84,166,129,110,57,125,13,60,211,102,194,193,152,132,4,4, 34,110,136,50,6,132,96,27,156,120,213,41,45,107,36,204,156,9,112,225,27, 223,224,210,247,215,247,50,45,247,250,68,188,211,170,112,22,209,245,129, 105,174,227,235,8,4,61,195,64,82,231,26,244,94,162,233,160,84,83,143,83, 163,202,182,140,0,75,21,65,73,22,34,236,52,224,215,215,225,213,55,16,186, 45,213,247,96,224,119,128,108,249,117,63,10,199,146,185,136,163,127,0, 224,252,10,53,130,3,213,102,103,78,3,192,237,183,11,201,104,235,90,168, 6,220,119,164,181,100,66,85,103,28,178,247,226,55,9,12,110,63,214,115, 110,146,8,126,119,106,86,215,133,24,199,208,183,252,93,83,3,69,84,98,141, 15,230,54,161,219,5,24,249,18,116,43,15,106,24,170,83,81,247,100,189,143, 167,254,93,145,42,222,47,70,191,145,202,119,192,46,92,61,115,187,15,156, 153,226,218,182,199,204,105,0,120,252,113,174,155,118,133,16,21,143,189, 190,137,96,12,201,149,24,176,227,19,16,162,98,218,106,20,215,104,95,135, 129,22,67,122,32,72,255,251,99,173,35,34,156,100,247,71,223,8,239,190, 191,101,122,180,120,119,182,128,0,15,60,248,141,13,184,149,43,240,170, 171,8,219,13,136,208,239,219,129,119,153,5,184,75,196,237,208,198,120, 191,16,144,231,15,178,37,56,48,139,26,0,0,230,119,170,154,110,9,66,53, 170,152,95,142,253,7,184,110,208,179,49,111,85,143,227,7,132,18,80,66, 83,66,55,2,122,14,55,164,252,40,210,52,20,55,168,248,190,36,232,41,76, 84,19,126,182,10,63,250,132,63,221,189,71,51,149,47,128,121,109,176,192, 133,110,231,96,228,74,208,237,28,168,110,69,125,255,246,97,247,143,175, 65,136,209,239,27,0,193,57,19,190,119,126,58,139,26,29,51,73,0,156,133, 13,169,226,45,20,64,100,75,106,232,153,78,155,97,48,118,144,7,66,41,40, 33,145,89,47,123,179,243,210,241,248,116,102,78,63,105,200,238,177,98, 130,38,241,176,16,2,16,217,117,218,13,18,154,244,36,161,184,205,120,87, 248,137,106,226,97,217,74,163,49,212,238,203,125,15,60,240,161,91,14,140, 92,17,186,157,143,134,124,78,191,102,76,70,237,208,198,248,0,88,208,105, 133,237,246,75,211,91,213,104,152,73,2,208,173,194,58,81,5,65,61,235,143, 19,93,174,79,34,216,233,90,199,72,11,70,52,40,147,244,170,225,221,215, 119,62,62,161,26,8,213,34,97,78,125,180,167,37,65,218,129,136,40,155,120, 7,225,119,242,208,140,104,135,39,52,50,35,116,80,221,236,22,224,212,60, 104,86,11,70,174,8,51,63,7,205,156,254,164,166,145,123,11,70,189,1,100, 24,54,52,240,245,169,47,108,7,204,36,1,72,230,183,164,116,2,0,3,39,110, 40,34,136,70,84,77,170,171,203,53,131,113,84,98,146,210,8,98,65,28,244, 190,148,16,131,168,24,63,165,93,149,63,58,45,145,128,220,146,139,16,11, 252,0,225,23,41,225,167,20,134,157,87,35,196,41,77,69,11,104,18,62,36, 154,14,106,24,144,92,64,176,16,126,109,3,82,8,232,118,14,100,64,119,165, 73,65,74,49,154,6,32,69,210,118,76,114,182,230,117,218,181,169,45,106, 68,204,158,19,16,64,216,110,180,228,150,150,179,253,80,33,38,229,40,156, 201,203,156,56,246,226,48,37,84,83,101,177,250,128,60,130,88,65,32,80, 225,197,254,225,205,169,170,188,248,191,238,103,251,38,10,197,26,135,136, 194,106,82,128,80,10,195,41,244,9,127,164,1,164,66,135,177,41,72,13,3, 186,157,131,102,57,42,169,200,109,119,59,0,79,24,36,214,98,118,200,1,144, 137,240,171,217,5,66,178,203,71,115,236,192,19,218,102,82,3,48,11,165, 6,161,163,22,4,117,191,28,93,211,224,58,5,73,139,222,110,200,128,68,118, 61,212,142,45,226,65,32,50,202,236,141,18,116,6,238,252,82,121,255,8,162, 15,171,159,106,247,20,41,225,239,14,24,133,20,32,154,1,221,201,131,106, 70,116,110,181,235,119,163,6,36,33,129,222,199,0,49,52,101,26,64,66,176, 0,132,51,149,132,164,13,206,129,216,45,118,114,0,74,41,32,34,225,143,158, 0,24,63,127,246,236,217,3,233,3,152,198,76,18,64,96,132,158,46,225,247, 25,148,59,128,224,186,138,24,140,125,121,3,238,35,25,246,154,138,26,40, 7,155,18,86,170,235,201,244,157,158,207,71,41,200,177,252,247,216,201, 201,56,49,245,191,76,107,0,82,130,232,134,218,249,163,16,229,182,194,159, 206,36,4,186,36,144,10,47,170,2,158,0,224,161,10,75,106,198,4,136,64,38, 154,202,192,87,251,133,31,128,20,156,11,193,207,161,155,16,113,96,152, 73,221,184,115,181,234,10,22,236,170,32,136,68,9,41,138,12,174,135,28, 130,52,19,144,30,231,253,72,216,142,23,0,53,166,91,211,183,190,177,159, 60,210,230,135,202,28,138,8,128,119,53,51,217,21,38,106,24,48,156,98,164, 85,208,68,229,239,218,254,195,132,191,47,244,71,232,214,181,73,9,193,66, 240,192,133,96,254,216,41,188,61,135,66,172,1,12,120,109,128,240,3,128, 16,50,144,66,190,184,235,147,78,16,51,169,1,20,10,166,79,40,109,141,165, 0,244,161,27,58,148,0,174,109,211,96,72,126,206,246,24,231,190,166,238, 93,162,250,71,150,190,236,110,253,201,106,186,222,253,136,0,68,87,248, 165,4,52,211,86,241,124,170,167,236,253,33,2,191,69,248,123,47,98,219, 29,62,34,2,16,6,74,35,211,96,156,176,97,124,46,193,209,127,131,135,9,127, 244,254,22,194,224,192,250,0,166,49,147,26,64,120,244,206,128,16,218,158, 132,200,170,44,53,83,125,1,174,217,172,194,81,194,120,219,96,216,71,98, 213,58,245,111,250,121,37,143,177,240,71,255,203,180,176,139,148,6,160, 34,12,186,101,43,111,255,184,194,63,164,74,144,208,17,146,129,162,146, 94,30,122,42,163,112,204,152,126,127,111,192,109,133,31,128,144,162,198, 37,54,70,63,201,244,48,147,4,112,193,186,202,89,224,87,38,101,199,19,18, 207,108,55,163,97,28,215,34,17,144,209,167,226,142,123,249,61,29,71,123, 12,132,110,41,112,164,246,171,221,95,36,158,115,201,121,98,63,199,205, 64,8,213,82,106,255,136,194,63,236,50,122,28,159,59,95,71,76,4,60,244, 70,12,237,245,134,154,165,224,16,193,118,36,34,1,193,175,18,170,213,70, 93,214,52,49,147,38,0,170,85,33,97,77,188,41,8,137,98,201,132,82,245,135, 60,200,9,178,105,36,58,252,120,107,145,67,127,35,3,31,14,198,208,237,191, 247,216,41,14,72,226,253,105,193,232,11,243,201,148,9,0,64,213,252,199, 217,125,125,225,189,174,192,71,181,4,35,8,63,162,142,81,100,55,123,156, 148,144,156,129,11,14,66,181,36,2,49,232,94,164,175,65,10,174,118,254, 109,194,141,82,153,29,151,54,203,252,80,180,181,155,73,13,0,143,63,206, 117,221,172,140,148,121,181,35,36,250,143,163,204,2,3,154,222,95,101,118, 109,130,108,249,101,116,21,96,107,170,240,32,47,227,214,68,31,164,202, 103,141,92,9,154,229,116,179,251,40,1,104,55,209,39,173,13,140,44,252, 73,62,242,8,38,192,48,196,68,16,168,52,99,41,24,210,68,170,114,0,162,8, 198,8,194,175,14,41,1,136,243,56,115,102,187,81,206,251,134,217,212,0, 0,240,32,168,105,166,35,8,180,169,145,24,33,20,154,78,33,5,133,136,108, 213,217,192,128,252,250,189,30,114,152,172,245,228,243,247,58,251,18,181, 63,237,245,79,253,15,33,160,217,121,213,224,35,206,7,0,182,170,250,41, 7,95,247,241,246,194,47,165,28,205,254,31,9,18,82,48,240,32,210,8,244, 174,179,48,30,47,54,138,240,3,128,228,130,113,30,158,195,161,80,45,103, 152,0,88,232,213,12,89,74,10,130,246,130,157,130,9,132,106,208,40,133, 16,93,167,213,108,64,246,61,158,148,111,99,107,88,173,71,240,83,137,62, 241,235,178,231,185,174,3,144,68,37,221,68,139,178,186,19,199,160,236, 19,126,18,201,242,14,194,159,62,215,160,254,2,123,66,154,8,168,154,24, 196,66,149,219,63,234,119,66,114,159,114,121,97,130,139,218,19,102,150, 0,52,51,183,65,64,182,20,4,77,15,81,67,11,66,33,36,239,126,73,103,1,81, 74,94,143,44,12,148,139,221,8,203,86,223,68,28,21,80,242,222,245,254,39, 225,63,17,57,0,1,37,240,209,168,108,162,25,160,154,169,62,45,56,164,84, 247,152,36,225,189,81,133,63,10,68,238,69,253,223,22,50,234,255,47,192, 252,206,88,81,3,193,121,51,12,216,129,246,1,76,99,118,9,0,164,37,164,100, 116,72,65,208,212,64,8,40,209,33,137,166,236,62,201,147,47,220,97,192, 176,149,36,59,233,128,172,190,225,24,150,220,211,119,78,153,222,253,129, 184,184,7,113,9,112,252,79,42,197,183,55,115,32,58,6,103,106,227,214,116, 80,195,66,44,104,59,146,109,191,240,199,254,134,137,107,0,105,40,115,71, 69,49,70,255,148,148,124,147,26,226,192,70,129,245,99,102,9,32,207,27, 13,205,204,187,1,144,31,163,19,211,16,140,175,30,39,17,3,169,65,10,118, 120,34,6,3,64,40,77,133,0,135,68,3,70,63,218,214,71,137,192,119,15,47, 83,100,144,168,228,233,210,223,248,205,164,247,88,82,114,85,232,13,169, 178,12,13,43,210,26,212,244,222,45,131,57,183,8,127,247,124,100,80,22, 224,4,33,227,28,128,81,255,238,74,251,185,172,215,120,125,106,139,26,19, 51,75,0,247,221,60,215,42,46,20,253,138,175,225,98,213,71,219,231,7,34, 126,138,8,12,16,42,148,163,112,220,214,208,211,6,161,145,167,158,164,165, 44,10,147,245,221,177,93,90,0,50,37,249,178,135,5,186,172,32,35,199,92, 127,139,112,146,214,74,146,40,66,156,92,163,188,238,68,211,85,151,31,77, 153,11,130,179,238,60,190,129,194,31,71,0,232,52,229,95,173,83,142,254, 247,86,69,73,225,197,181,213,167,14,205,104,187,153,37,128,188,229,184, 142,161,249,119,150,114,56,94,182,112,97,211,195,229,170,15,143,29,140, 131,142,16,10,77,163,144,68,131,16,108,58,142,194,49,25,142,80,45,9,101, 13,53,83,34,103,219,150,207,142,118,134,228,24,177,248,39,63,228,214,93, 58,249,117,228,179,164,136,64,211,162,142,194,58,136,198,33,88,208,45, 241,29,64,4,32,100,104,236,126,34,32,0,184,220,177,12,184,231,106,132, 144,144,252,2,34,29,231,48,96,54,243,0,0,92,93,189,224,178,48,168,19,2, 20,109,29,247,29,207,227,53,183,150,112,195,156,5,67,59,184,76,190,216, 59,76,181,131,76,45,142,203,118,71,251,243,110,55,214,139,108,243,155, 250,53,22,110,185,69,240,123,4,114,235,73,135,30,118,224,10,5,135,96,33, 164,84,163,184,116,43,7,221,202,129,234,38,64,186,61,7,19,63,3,34,237, 108,167,67,239,1,227,150,151,75,41,24,23,236,5,28,34,91,113,102,53,128, 64,136,16,232,246,4,160,132,96,49,111,160,236,232,88,111,6,56,183,225, 162,210,102,16,163,252,129,38,25,33,139,64,162,70,36,50,29,214,218,7,16, 144,168,97,71,223,160,138,36,47,127,24,98,65,29,156,83,159,62,206,150, 79,198,62,128,126,51,32,37,140,137,205,159,220,134,94,31,192,224,147,108, 77,40,82,149,119,12,148,106,106,126,160,97,38,3,57,5,11,85,178,78,218, 4,152,34,182,43,3,30,4,17,50,151,132,252,226,20,151,52,54,102,150,0,150, 238,186,203,213,169,214,232,239,40,171,83,130,227,101,11,11,121,3,87,235, 62,206,87,60,52,60,118,48,142,250,168,226,144,16,10,41,196,244,35,6,177, 218,219,35,120,177,204,245,135,196,134,61,238,170,208,35,33,181,195,167, 101,91,14,122,62,253,153,45,231,222,249,124,93,2,139,162,3,144,32,84,139, 134,137,90,96,126,7,220,119,85,133,95,92,9,56,45,45,76,98,104,25,240,32, 8,30,34,116,27,13,63,244,86,167,179,160,221,97,102,77,128,206,51,207,8, 223,31,62,86,201,210,41,110,93,116,240,186,91,75,184,251,104,30,57,83, 59,184,18,31,66,64,52,13,154,102,164,134,99,76,24,148,70,243,246,70,56, 246,8,111,73,183,229,222,238,67,93,167,91,58,4,40,183,74,253,64,65,233, 173,73,32,125,191,15,140,90,166,95,143,203,137,185,74,40,50,243,101,152, 165,197,110,71,224,169,134,0,49,176,12,120,16,4,103,96,94,7,130,133,235, 130,146,161,223,217,131,192,204,18,192,218,218,154,8,57,107,236,68,193, 57,83,195,61,71,114,120,221,173,37,220,178,104,195,210,7,93,242,62,169, 231,81,213,161,166,235,19,37,2,21,230,219,233,120,187,187,198,116,26,239, 176,195,246,132,252,122,72,99,66,216,177,62,33,50,13,132,128,166,27,176, 74,75,48,114,197,109,125,27,123,199,214,50,224,65,16,156,129,249,29,229, 24,134,184,50,31,228,154,83,92,212,216,152,89,2,56,125,250,52,183,44,103, 164,25,129,132,0,101,71,199,253,39,10,56,121,75,9,199,202,22,116,186,255, 250,64,44,26,241,164,28,109,2,189,233,226,246,219,59,158,121,207,178,48, 100,103,79,59,250,6,254,45,134,169,2,114,80,70,65,234,215,29,211,22,183, 190,34,99,31,1,7,64,32,2,79,101,234,241,201,59,221,71,233,56,29,11,127, 18,178,20,242,165,75,151,158,8,38,190,152,61,96,102,125,0,0,36,243,189, 134,200,231,133,54,34,145,81,74,176,92,48,48,231,232,88,139,28,133,213, 14,131,192,148,195,197,125,136,125,142,132,82,104,169,210,227,113,67,135, 132,234,80,61,56,211,33,183,190,159,61,143,71,185,202,17,66,115,232,170, 235,73,124,127,92,223,198,48,203,98,152,218,190,211,178,122,220,24,18, 136,210,136,101,24,64,50,6,162,235,208,116,107,107,199,226,221,34,85,6, 60,8,61,194,15,64,10,33,36,151,231,112,136,66,128,192,108,19,0,90,157, 86,181,56,191,48,118,65,144,161,17,220,48,103,97,49,111,224,74,228,40, 236,108,19,42,159,6,210,129,135,173,197,70,59,44,36,29,227,30,145,52,210, 115,249,118,8,238,141,134,120,199,23,178,111,13,93,6,218,222,249,7,36, 109,188,182,197,54,175,111,243,82,250,236,82,138,201,18,1,1,176,77,4,160, 95,248,163,53,132,68,30,142,62,128,105,204,52,1,20,10,197,141,72,223,219, 213,117,216,6,197,109,75,14,142,20,77,188,180,233,225,114,35,132,23,238, 31,11,244,70,31,211,197,70,195,137,32,61,82,123,172,24,116,116,142,238, 191,59,97,180,119,73,57,130,165,221,191,206,97,235,30,145,11,70,90,217, 128,115,76,146,8,148,207,97,235,57,6,9,63,0,72,46,218,16,236,242,174,78, 54,69,204,52,1,64,162,37,199,201,197,28,0,2,160,96,105,184,123,217,198, 209,162,142,151,170,33,86,91,12,33,223,31,34,216,146,130,64,8,40,209,32, 73,100,26,164,70,78,117,51,219,182,113,202,13,61,209,78,239,31,125,39, 238,125,231,104,107,233,167,137,196,12,66,207,63,35,174,101,167,147,109, 239,243,216,51,17,200,40,7,160,239,36,195,132,63,58,103,141,75,172,141, 126,146,253,193,76,19,64,165,90,105,56,249,130,11,32,183,215,99,17,2,204, 217,26,138,71,53,28,47,50,92,168,133,168,116,56,248,222,43,141,118,196, 160,60,164,110,177,145,132,36,81,221,188,166,71,19,115,182,95,211,176, 87,7,58,211,119,43,107,233,186,130,1,194,61,20,61,47,14,207,1,136,117, 149,169,103,242,237,146,8,250,135,129,108,39,252,138,144,196,154,20,188, 54,161,165,79,12,51,77,0,182,105,181,40,33,19,41,172,136,246,85,104,20, 88,46,232,152,115,52,172,182,24,94,170,133,104,120,28,227,240,0,1,25,100, 1,111,139,65,36,0,68,17,3,93,139,122,239,239,22,187,32,177,81,204,115, 196,249,2,219,156,101,64,212,160,63,61,40,173,91,236,120,202,158,178,230, 193,139,236,206,42,26,13,227,17,65,92,172,212,21,244,109,133,31,241,61, 18,87,142,216,65,123,226,141,44,247,136,153,38,128,82,174,208,1,129,63, 104,190,252,94,97,104,4,55,150,13,44,229,117,92,169,135,184,88,15,209, 9,196,110,68,105,100,12,35,129,254,247,140,119,196,20,118,115,139,70,200, 211,31,122,190,161,171,149,160,82,66,112,15,130,216,160,241,184,177,221, 32,173,214,116,19,5,119,229,209,77,19,1,213,13,80,99,200,120,241,216,4, 144,114,71,225,87,239,23,144,66,30,138,81,96,253,152,217,60,0,0,88,221, 168,186,97,24,78,53,177,194,214,9,110,91,52,113,242,70,7,183,46,152,176, 244,233,6,12,167,144,70,3,72,108,173,140,27,43,223,127,248,155,7,39,254, 12,80,9,82,9,67,58,5,22,29,130,57,226,194,8,154,144,190,27,117,5,74,127, 96,80,164,98,84,199,228,222,42,49,213,32,79,31,204,109,131,251,238,86, 135,30,68,210,168,100,148,142,64,82,8,46,184,120,1,135,96,20,88,63,102, 154,0,54,27,87,67,193,69,103,218,231,33,0,10,38,197,61,203,22,30,184,193, 193,137,146,14,99,202,137,68,147,36,1,57,233,3,2,72,132,113,148,40,64, 10,58,5,150,115,26,74,54,133,165,1,101,131,161,76,58,48,194,38,68,224, 66,240,97,233,181,59,145,87,234,201,9,197,115,135,18,129,84,19,133,70, 109,7,38,165,12,136,174,93,152,200,162,38,140,153,54,1,202,55,222,232, 74,130,138,224,28,154,62,253,75,161,4,152,119,52,148,44,27,27,29,142,243, 213,80,37,18,77,201,46,24,197,36,24,245,72,116,160,142,61,224,185,17,223, 214,61,116,28,5,232,15,245,109,121,0,131,18,28,201,105,200,27,0,11,185, 234,161,64,0,157,0,54,24,124,217,134,27,134,8,133,3,98,216,170,182,97, 172,160,229,116,72,57,38,2,193,66,80,195,132,20,2,204,107,67,240,209,58, 123,75,193,91,194,63,28,163,192,250,49,211,4,112,95,169,228,95,218,172, 254,22,243,253,66,190,80,124,208,114,28,139,142,58,253,166,31,42,165,110, 164,183,106,148,224,104,65,199,188,163,97,181,25,57,10,125,62,149,68,162, 241,72,96,192,2,36,144,55,117,28,41,89,8,52,19,245,128,128,203,157,142, 57,206,25,71,187,104,75,3,142,228,40,114,70,188,76,130,184,211,111,60, 193,55,71,0,7,33,124,201,209,14,2,48,205,1,49,172,161,14,208,161,171,156, 82,215,102,41,5,120,224,39,100,48,198,7,55,169,33,214,167,178,168,61,98, 166,9,224,177,199,30,19,0,254,230,61,239,249,224,87,221,229,242,63,41, 20,203,63,157,43,22,239,49,77,75,219,143,102,28,166,70,112,211,156,129, 165,188,134,75,117,134,203,245,16,110,56,93,71,225,184,40,218,20,71,115, 58,242,142,9,203,182,225,9,130,245,142,64,195,151,96,177,32,110,139,29, 94,223,169,217,7,148,240,31,203,107,112,244,222,148,97,210,67,0,106,26, 16,77,17,129,199,35,34,208,157,168,37,216,144,175,107,223,18,167,95,4, 52,70,218,168,148,144,146,175,18,146,175,79,113,81,187,198,76,251,0,34, 200,63,252,195,255,176,122,211,66,241,183,87,47,94,124,215,198,202,202, 255,86,175,213,174,134,97,40,199,217,146,247,66,23,142,65,113,231,162, 137,7,110,116,112,243,188,1,243,0,59,18,197,32,68,98,206,209,113,67,217, 132,101,196,194,5,20,45,13,183,47,90,184,115,201,194,66,78,235,27,171, 50,180,60,103,240,13,218,182,6,64,61,239,24,4,39,138,20,121,67,13,251, 80,227,217,169,10,224,37,130,79,19,45,32,30,8,170,81,130,130,1,44,155, 33,202,178,5,120,141,14,243,93,63,177,185,119,50,75,166,9,33,70,38,153, 168,107,208,161,25,5,214,143,131,255,166,78,24,15,63,252,176,53,127,243, 237,175,45,21,203,63,87,40,149,223,230,228,242,37,109,132,228,14,41,68, 212,217,119,111,16,18,168,251,2,231,107,33,214,154,1,216,158,51,10,213, 174,232,183,235,8,218,245,168,4,85,116,133,47,106,75,21,119,167,145,66, 130,64,96,193,161,56,154,163,32,16,224,156,195,52,76,88,142,13,77,211, 65,53,10,74,53,72,16,212,3,96,181,197,208,244,37,36,104,52,146,171,59, 155,175,103,78,95,162,182,171,231,1,32,104,215,192,188,78,178,142,36,81, 73,10,56,58,112,162,64,96,210,120,173,50,49,105,58,157,54,58,173,86,34, 248,189,4,128,164,141,57,33,4,82,202,115,13,63,120,108,221,51,108,195, 202,189,95,179,156,7,52,211,54,84,234,116,239,218,32,37,120,224,237,57, 18,48,28,18,97,187,137,208,107,141,246,110,206,192,58,173,95,175,156,253, 202,191,194,20,92,177,123,197,76,155,0,131,240,169,79,125,202,7,240,249, 135,223,251,222,167,150,59,75,111,43,149,74,63,151,47,149,95,103,89,182, 185,107,255,192,24,160,4,88,204,27,88,44,58,88,107,250,120,97,195,197, 230,168,173,201,70,194,246,199,209,40,176,156,51,176,156,167,32,82,32, 169,132,237,205,55,142,222,75,176,148,215,48,239,24,216,244,4,86,90,12, 237,190,90,136,97,59,68,92,133,152,238,252,147,70,209,36,56,154,39,176, 52,164,180,4,146,132,237,187,26,64,191,240,119,39,0,197,194,207,88,248, 11,79,159,88,254,36,30,127,92,44,220,255,208,39,237,48,248,39,186,29,190, 79,51,237,251,52,195,50,38,86,225,55,2,212,53,143,51,8,132,121,156,177, 231,112,8,133,31,184,6,53,128,62,144,247,188,231,3,199,115,75,243,239, 45,148,75,31,202,21,74,119,154,166,73,7,249,7,38,165,1,0,0,165,20,134, 169,38,220,120,76,224,114,213,199,185,138,139,166,191,187,214,100,74,3, 104,68,26,64,170,29,118,159,6,160,19,137,99,5,13,139,142,6,72,14,46,4, 4,231,224,156,193,52,45,88,118,172,1,104,160,84,105,1,84,163,160,68,205, 13,8,5,176,209,230,88,105,113,120,76,66,198,133,71,3,52,0,53,65,89,194, 111,85,193,125,55,89,15,145,2,5,19,56,94,32,48,72,186,84,88,166,60,154, 4,173,70,29,158,235,14,20,254,248,60,177,240,127,241,232,210,39,241,248, 227,105,169,163,199,190,227,205,55,233,86,238,221,212,180,63,160,155,249, 59,53,211,212,8,213,34,71,157,55,53,51,64,10,142,160,85,3,15,119,78,64, 21,97,24,114,191,243,251,126,147,255,74,107,229,107,135,210,9,120,173, 19,0,0,224,212,169,83,154,89,88,184,39,55,55,255,211,133,82,233,159,228, 114,249,35,186,97,244,92,251,180,8,0,80,223,251,182,207,241,210,166,135, 151,170,30,58,193,120,245,75,163,16,128,65,37,110,40,234,152,119,162,254, 131,34,38,0,6,206,57,12,211,132,109,59,9,1,104,148,130,36,68,160,236,112, 26,169,255,30,3,214,218,28,171,45,134,128,67,141,250,238,33,0,154,140, 80,247,155,213,148,192,73,204,89,192,177,60,129,158,18,254,30,45,33,34, 223,102,189,6,223,243,134,9,191,148,130,127,51,96,236,151,190,116,108, 249,111,251,132,63,133,83,218,137,251,55,238,36,185,220,143,234,118,225, 61,186,229,220,73,52,170,137,112,90,61,55,8,36,15,225,183,170,59,70,1, 4,11,25,247,59,31,215,66,255,87,214,206,125,227,80,245,1,76,227,186,32, 128,24,15,63,252,176,181,120,203,29,175,207,23,74,191,80,42,207,189,213, 113,114,5,170,197,83,94,101,148,132,178,119,244,19,64,12,41,129,154,27, 226,92,197,195,149,186,143,96,196,25,6,219,17,128,148,2,182,14,220,84, 50,80,180,8,32,5,4,31,68,0,86,68,0,90,66,0,84,211,84,27,243,132,0,40,104, 220,107,128,16,116,66,224,106,51,196,122,155,35,16,105,187,92,141,240, 150,92,40,13,32,240,64,34,225,63,158,39,208,250,133,63,190,248,148,230, 85,175,110,34,12,130,33,194,47,190,17,250,254,71,159,252,194,103,63,143, 145,84,231,135,244,99,223,97,220,101,56,185,15,16,205,60,69,8,185,137, 26,6,221,107,183,165,173,32,16,161,15,191,85,221,190,25,8,11,57,243,59, 159,148,220,251,153,234,11,223,60,84,93,128,251,113,93,17,64,140,119,188, 227,145,185,210,241,210,15,148,202,243,31,41,148,74,39,45,203,54,64,200, 212,9,32,6,23,18,27,237,16,47,172,119,176,222,10,119,172,56,220,142,0, 242,6,112,211,156,129,130,65,146,174,66,131,8,192,178,108,152,150,61,148, 0,98,51,32,214,2,8,37,160,132,66,130,160,25,8,92,110,48,84,58,28,76,196, 38,128,186,95,126,179,10,48,31,75,14,193,145,28,1,69,175,218,223,219,22, 188,251,117,171,109,86,16,134,97,215,7,0,236,82,248,83,56,121,210,88,246, 74,247,233,134,246,8,181,237,119,235,150,115,92,211,205,190,169,168,123, 3,15,60,4,237,90,111,203,245,20,98,225,231,94,248,11,245,151,158,58,55, 177,19,79,9,215,37,1,68,32,239,122,239,135,110,152,159,47,255,68,97,110, 238,253,185,124,225,86,141,210,129,254,129,177,15,76,41,12,195,216,177, 64,41,228,18,87,235,62,94,172,184,168,117,194,161,25,133,131,8,128,72, 137,130,69,113,203,156,14,91,39,137,9,211,67,0,60,69,0,246,238,8,32,182, 247,133,4,106,158,34,130,170,43,32,64,84,171,235,86,21,139,6,83,194,79, 122,85,254,88,248,123,68,159,168,181,214,54,43,96,140,165,157,126,82,10, 241,68,192,197,47,126,233,179,127,247,4,246,226,52,187,239,62,115,65,20, 30,176,236,194,251,53,39,255,3,186,229,28,163,154,49,17,34,96,94,27,65, 167,49,208,199,48,107,194,15,92,223,4,0,0,120,232,161,135,244,155,94,118, 255,203,109,39,255,225,124,190,240,195,78,62,183,164,235,198,158,142,57, 42,1,196,240,66,129,139,85,15,231,55,93,180,6,100,20,246,19,0,129,196, 188,173,225,166,57,29,22,5,68,212,12,115,60,2,80,14,192,225,4,16,155,3, 221,176,32,33,20,92,2,149,14,199,229,38,67,163,237,163,204,107,88,48,153, 42,128,238,17,126,32,157,146,147,38,0,33,4,106,149,13,112,206,19,225,23, 66,252,189,207,253,143,156,249,236,103,191,129,73,121,204,111,185,197, 62,226,220,240,29,90,206,249,176,110,231,190,79,51,115,11,84,211,247,68, 4,97,167,137,208,109,109,89,162,228,76,50,223,253,59,230,250,143,206,138, 240,3,25,1,36,56,117,234,148,99,22,151,222,148,43,149,126,190,88,42,189, 217,206,229,28,186,99,183,221,193,24,151,0,0,245,117,106,121,12,231,55, 61,92,172,122,240,194,174,138,153,38,0,34,57,150,242,58,110,42,233,208, 105,228,188,220,66,0,170,201,232,100,8,160,155,164,147,16,1,37,96,130, 160,218,234,32,168,175,131,135,65,210,23,32,25,0,26,23,9,165,24,32,82, 243,33,56,71,181,178,1,33,56,166,38,252,41,28,63,126,50,23,204,155,15, 26,118,225,67,186,157,123,88,183,236,121,74,117,140,77,4,82,34,232,52, 192,188,118,239,211,156,75,230,119,254,94,132,222,71,170,47,62,253,244, 4,151,62,117,100,4,208,135,119,190,243,199,23,157,35,165,119,205,149,231, 126,58,87,40,189,202,182,109,125,92,179,96,55,4,16,67,72,160,214,9,241, 226,134,139,171,13,31,33,151,9,1,240,78,29,199,10,26,78,148,116,104,144, 93,193,79,19,64,20,1,80,4,192,163,48,32,135,101,59,48,45,11,154,30,11, 127,42,2,176,11,2,160,148,194,115,93,84,214,86,17,134,97,36,240,189,9, 63,253,213,189,36,98,1,198,88,172,1,112,72,249,25,143,251,255,116,90,194, 159,198,209,87,190,50,207,121,254,205,186,85,248,73,195,206,61,164,89, 78,57,73,38,26,1,82,10,21,2,12,188,238,115,189,194,63,245,107,152,52,50, 2,24,12,250,142,71,30,185,185,148,155,251,137,114,121,238,39,114,249,194, 205,134,105,146,81,5,122,47,4,16,131,9,137,245,102,128,23,43,42,145,40, 104,55,112,68,239,224,104,65,83,142,182,180,224,79,130,0,82,145,128,36, 93,119,16,1,80,146,16,131,215,233,96,99,125,21,156,177,148,250,31,41,254, 3,182,255,132,0,194,16,155,27,235,92,48,254,201,144,123,191,240,228,231, 62,183,175,42,243,252,237,39,203,134,109,61,164,57,133,159,214,237,220, 67,186,105,231,200,8,149,135,146,243,40,4,168,194,140,82,112,201,188,217, 21,126,32,35,128,109,241,208,67,15,233,71,111,187,251,59,138,165,185,143, 20,74,165,119,56,185,252,188,62,66,217,49,33,4,134,57,153,209,84,1,151, 88,169,251,104,55,106,48,195,6,16,117,11,222,137,0,226,36,32,193,213,99, 219,118,96,154,38,232,164,8,128,80,184,157,54,42,235,107,224,156,109,17, 254,216,250,79,202,116,83,4,224,185,46,175,86,54,62,25,134,238,190,11, 127,26,165,251,30,92,176,53,235,109,154,101,127,200,176,115,15,106,134, 157,35,218,176,145,226,4,130,5,8,90,85,8,206,148,240,251,238,211,240,131, 15,85,206,125,237,203,152,65,225,7,50,2,24,9,223,255,232,163,185,146,48, 222,82,44,149,126,54,95,44,190,201,118,114,206,118,105,197,147,36,0,64, 57,156,235,213,77,84,55,55,32,248,246,4,16,207,22,232,102,1,42,109,192, 182,29,152,150,169,38,18,69,17,128,241,8,128,70,14,193,46,1,116,218,45, 108,110,172,131,115,158,152,0,105,225,79,238,71,215,1,128,48,240,195,122, 173,250,159,59,237,250,47,29,164,240,167,64,138,47,123,237,66,206,176, 127,128,90,249,71,117,219,249,14,221,180,237,173,173,192,8,120,232,33, 104,213,32,88,32,153,239,126,131,251,238,71,107,231,158,30,63,92,121,136, 144,17,192,24,248,254,31,125,116,105,174,104,157,42,150,75,31,206,23,74, 247,89,182,61,176,236,248,80,18,128,19,105,0,154,14,45,42,6,234,18,128, 6,26,135,253,232,214,16,96,76,0,148,166,114,247,41,69,187,217,76,156,121, 61,26,192,214,59,2,66,128,192,247,195,102,163,246,251,245,102,237,95,158, 249,220,231,14,91,131,12,178,244,178,147,199,168,145,255,1,221,206,125, 64,183,115,15,104,134,101,164,137,128,249,46,130,230,166,12,189,246,53, 33,252,192,181,81,14,188,111,248,203,63,248,221,141,59,142,47,252,206, 198,213,11,63,180,190,122,245,127,169,215,170,151,194,32,144,99,143,197, 218,21,182,59,199,246,231,151,178,219,194,122,0,93,13,255,224,142,173, 0,182,120,249,162,164,158,110,233,111,28,231,247,61,47,172,215,106,191, 191,86,105,255,234,33,20,126,0,144,27,223,58,115,117,237,233,207,254,158, 87,221,252,17,175,190,249,207,253,102,237,235,204,119,195,56,233,71,114, 134,208,119,159,231,158,251,51,215,130,240,3,153,6,176,107,156,124,244, 81,227,174,16,15,228,139,165,159,45,148,202,223,159,203,23,202,113,217, 241,52,52,128,90,181,130,218,102,101,136,6,160,202,128,7,105,0,140,49, 184,157,214,166,166,25,245,98,185,124,179,109,59,154,154,78,76,147,130, 160,216,251,63,40,18,144,182,255,187,26,128,122,190,217,168,161,86,221, 140,38,228,200,100,173,253,8,124,215,171,85,107,31,175,212,214,255,229, 55,190,248,197,67,155,23,223,7,58,119,239,235,111,178,76,235,221,186,157, 255,128,145,43,220,17,180,26,23,253,234,202,207,87,206,126,245,147,56, 132,13,62,119,131,140,0,246,136,31,252,193,31,44,22,150,111,248,222,98, 121,254,231,242,197,194,131,182,147,179,52,77,83,81,128,9,149,31,239,150, 0,120,24,162,221,110,157,111,214,170,191,70,168,252,106,161,180,240,99, 249,66,241,199,114,249,194,141,166,101,17,77,211,18,83,32,14,237,165,139, 130,210,4,64,251,157,129,132,160,81,175,162,81,171,70,17,128,158,21,67, 125,181,36,60,207,115,27,213,205,223,246,234,149,255,249,137,39,158,216, 156,200,13,217,95,104,139,247,191,225,78,187,176,248,78,30,122,79,173, 124,249,191,254,23,28,178,1,159,123,65,70,0,147,1,249,129,247,124,240, 72,121,174,240,238,98,177,248,225,66,169,116,87,190,80,212,70,105,68,50, 10,198,35,0,101,243,179,48,148,237,86,243,133,122,173,250,207,190,252, 247,159,253,43,0,252,228,201,147,70,126,110,249,213,78,177,248,83,133, 66,241,157,185,124,126,81,55,77,104,41,45,32,237,8,220,142,0,64,128,70, 173,138,102,189,222,211,26,60,174,249,145,82,194,117,93,183,89,175,254, 86,115,221,255,245,51,103,254,246,80,182,196,26,3,20,152,78,215,246,131, 68,70,0,19,196,169,83,167,52,174,231,238,42,45,44,62,186,176,180,252,158, 66,169,120,76,215,141,145,243,7,134,97,92,2,96,97,40,91,141,198,211,181, 122,237,231,190,252,249,207,124,30,125,59,214,131,15,62,232,20,151,142, 189,201,206,229,62,154,47,148,222,226,228,114,5,221,48,182,68,2,182,115, 0,2,202,49,217,108,108,205,139,151,82,194,235,180,219,245,90,245,183,91, 149,224,55,174,1,225,191,102,145,17,192,20,240,240,195,15,91,203,55,223, 253,218,226,220,220,207,21,75,229,135,157,124,174,184,23,109,96,28,2,8, 3,95,54,27,141,47,52,107,213,95,252,226,231,63,243,36,182,217,177,30,122, 232,161,57,107,238,200,247,229,243,185,143,22,138,229,147,118,206,177, 52,77,223,66,0,52,21,2,76,8,64,74,212,54,55,209,106,246,14,187,146,82, 194,115,59,245,122,117,243,95,175,180,106,191,253,220,23,190,48,213,193, 45,25,246,134,140,0,166,136,135,223,251,222,210,241,249,163,111,47,150, 202,63,83,40,149,95,99,217,187,107,75,54,26,1,8,4,65,192,155,245,218,103, 154,245,202,63,125,98,244,212,90,242,166,183,189,237,88,169,56,255,238, 124,161,244,147,249,66,241,30,203,182,53,45,170,20,28,104,255,83,2,41, 37,106,149,10,218,173,174,124,75,41,225,118,218,245,70,181,250,235,126, 115,243,183,158,120,226,137,67,217,8,51,67,23,25,1,76,31,228,61,31,248, 192,241,82,121,249,189,249,98,233,67,249,226,240,182,100,195,176,35,1, 8,129,32,240,89,163,86,251,171,122,109,125,119,217,117,31,251,24,125,235, 147,95,191,179,80,42,254,68,161,84,254,177,92,33,127,163,105,217,164,219, 49,168,55,26,32,132,68,181,178,129,78,187,21,173,81,162,211,110,213,234, 181,218,111,132,153,240,207,12,50,2,216,39,156,58,117,74,211,202,203,47, 43,149,202,31,41,205,205,253,72,46,95,88,214,117,125,36,255,192,78,4,224, 185,110,216,108,84,255,211,102,117,227,95,125,249,115,159,219,83,7,154, 147,39,79,26,203,55,223,241,234,124,161,240,83,197,98,249,157,78,33,191, 104,24,102,138,4,20,1,112,33,80,221,216,128,219,105,67,74,137,118,171, 181,218,168,215,62,22,54,55,255,223,76,248,103,7,25,1,236,51,30,122,228, 17,251,70,171,252,143,74,115,115,63,91,42,151,223,234,228,114,133,157, 252,3,131,8,32,206,251,119,93,215,173,215,170,255,177,185,86,251,31,191, 248,197,255,54,177,24,251,131,167,78,57,75,212,124,83,46,87,248,104,177, 84,122,75,46,95,40,232,186,222,37,0,46,176,185,177,6,183,211,70,187,213, 90,173,215,106,191,234,86,215,126,255,204,153,51,135,110,2,110,134,225, 200,8,224,128,240,142,71,30,153,155,203,47,253,192,220,124,249,103,243, 165,210,171,45,203,54,134,249,7,18,2,168,84,146,180,91,193,57,60,183,211, 170,214,54,255,93,181,211,252,141,51,127,59,29,79,251,67,239,120,199,220, 98,126,254,251,156,66,225,163,133,82,233,164,227,228,44,93,215,193,56, 71,101,117,5,149,141,181,213,70,189,250,171,110,181,146,9,255,12,34,35, 128,131,5,249,241,71,31,189,201,202,207,191,175,84,156,123,127,174,84, 184,213,52,182,250,7,250,9,64,112,1,183,211,170,215,170,213,223,184,220, 168,252,187,103,78,159,30,109,74,197,30,214,249,182,119,189,235,88,177, 176,248,238,66,169,248,193,98,169,124,47,213,52,237,210,133,115,231,175, 94,185,244,207,253,90,229,255,203,132,127,54,145,17,192,33,128,106,75, 246,192,203,139,165,252,135,243,197,210,143,228,243,249,69,221,232,182, 37,75,19,0,231,12,237,86,107,181,86,217,120,172,85,89,249,191,247,211, 222,254,216,199,62,70,191,242,204,51,183,47,28,185,225,17,39,151,127,235, 234,197,139,255,250,79,185,219,223,179,63,195,12,33,35,128,67,132,83,167, 78,57,206,226,137,239,46,148,203,63,91,42,205,125,183,157,115,28,77,211, 18,2,216,92,95,71,171,89,191,180,89,221,248,87,245,43,151,62,126,80,187, 238,163,143,62,106,116,104,113,222,175,188,84,121,60,19,254,153,70,70, 0,135,16,239,252,241,31,95,156,43,45,191,171,60,55,255,211,249,82,233, 85,150,101,235,181,205,13,92,190,112,254,92,101,125,253,159,178,118,245, 147,167,79,159,30,109,56,125,134,12,219,32,35,128,195,11,250,238,71,126, 234,230,185,133,133,15,204,47,47,63,210,106,52,106,231,159,127,246,159, 253,37,21,159,201,84,238,12,147,66,70,0,135,28,143,62,250,168,97,205,31, 121,69,199,245,248,127,248,223,255,215,167,113,141,21,163,100,200,144, 33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67,134, 12,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50, 100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200, 144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67, 134,12,25,50,100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25, 50,100,200,144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,100,200, 144,33,67,134,12,25,50,100,200,144,33,67,134,12,25,50,28,118,252,255,59, 169,108,135,95,233,25,250,0,0,0,0,73,69,78,68,174,66,96,130, } }, {.path = "data/icons/icon32.png", .size = 1712, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0, 0,0,115,122,122,244,0,0,6,119,73,68,65,84,120,156,237,150,77,108,92,87, 21,199,255,247,227,189,55,243,198,95,99,59,113,106,39,33,184,8,33,153, 66,213,162,8,218,162,84,98,7,173,88,160,68,130,118,81,64,138,100,81,171, 236,80,96,225,5,18,98,129,132,186,64,136,170,66,40,72,72,212,18,84,34, 45,10,82,155,66,18,146,84,148,66,235,182,137,227,16,55,51,246,120,198, 158,143,55,239,205,188,143,251,113,88,140,211,166,182,19,39,82,11,155, 158,229,213,189,239,252,206,255,127,207,185,15,248,56,254,207,193,110, 119,227,161,217,83,178,152,234,65,231,74,179,53,55,119,196,28,154,61,37, 221,86,231,179,204,216,164,92,77,254,243,246,220,145,236,35,3,120,244, 216,185,49,46,156,163,128,120,212,90,117,58,141,27,39,184,229,15,48,41, 166,137,200,128,232,101,175,48,52,199,180,189,240,252,79,15,54,0,70,31, 10,192,225,217,121,215,74,254,48,35,126,204,90,243,32,145,113,84,18,82, 176,122,49,114,253,98,46,215,55,226,112,233,194,201,245,67,56,185,136, 172,121,67,165,225,31,195,86,249,197,213,213,108,241,118,84,185,9,0,177, 71,126,112,102,159,231,23,159,228,50,247,109,198,249,40,89,131,180,211, 64,187,182,136,110,176,2,127,112,28,254,224,93,232,27,61,0,199,235,131, 209,41,84,18,34,233,52,140,85,233,50,89,245,178,234,182,159,121,233,153, 35,231,1,220,84,17,185,93,213,153,249,215,87,193,250,143,25,107,239,39, 157,9,192,66,37,33,178,110,11,214,164,80,89,4,149,69,0,8,140,113,48,46, 32,164,135,56,171,130,140,22,96,216,175,178,238,19,113,183,222,2,112,254, 86,10,240,205,11,70,176,79,8,199,249,57,231,252,32,89,45,226,96,5,209, 250,85,168,36,132,49,25,130,250,21,172,46,157,65,233,210,139,168,44,157, 70,220,169,129,200,128,172,129,213,25,140,234,246,52,52,26,156,139,228, 208,236,41,113,43,128,45,10,192,116,140,37,151,147,53,224,156,67,37,109, 24,149,130,120,132,122,229,117,172,151,254,9,149,134,176,164,80,43,93, 128,150,41,134,247,220,131,254,129,79,2,100,145,235,27,133,112,124,228, 251,119,195,106,245,184,234,54,47,3,248,245,109,3,144,211,23,123,210,143, 29,175,0,46,29,248,67,227,104,175,45,162,244,206,159,209,88,126,3,42,110, 195,26,13,65,61,91,181,234,162,213,188,4,149,134,216,181,235,126,56,94, 63,64,4,107,20,84,210,222,155,68,173,137,59,82,32,151,219,171,10,131,185, 4,32,104,149,193,40,192,31,156,192,228,125,223,196,200,196,189,88,190, 248,18,214,175,189,6,21,71,96,66,130,49,129,225,145,41,12,15,79,129,115, 15,0,193,154,12,221,96,5,105,167,105,173,49,149,59,2,200,15,165,169,181, 126,196,133,128,144,12,138,37,96,92,64,186,62,118,31,248,18,198,38,31, 68,80,189,132,210,59,39,209,94,91,192,158,241,7,48,54,241,69,112,46,97, 141,65,214,109,33,172,47,33,9,215,144,198,13,221,13,43,181,59,2,48,165, 72,233,162,105,123,254,8,64,0,99,2,210,43,64,8,14,206,37,140,181,24,217, 119,31,10,197,253,104,148,255,141,145,137,207,65,72,15,100,45,116,214, 69,212,44,33,14,42,104,55,174,162,81,155,79,116,18,212,111,5,176,165,11, 150,94,249,141,190,248,230,241,224,221,203,39,16,181,203,32,50,0,17,184, 240,32,115,62,188,124,14,58,139,208,174,45,194,168,20,89,28,130,172,129, 209,9,58,205,50,226,246,42,90,245,5,4,173,5,16,183,144,125,67,19,119,61, 114,212,191,25,192,118,131,136,221,243,216,15,127,193,184,152,150,142, 143,129,193,73,12,143,78,161,127,232,0,28,175,0,128,16,172,46,160,181, 122,9,89,210,198,240,248,20,114,3,99,80,73,136,230,202,91,168,149,46,32, 10,175,1,156,131,75,135,184,116,27,194,117,94,33,107,143,199,134,157,190, 246,194,47,91,184,97,48,109,81,0,0,17,81,3,232,221,240,198,250,60,150, 174,252,9,165,165,191,32,10,203,189,126,183,6,157,112,25,171,165,179,168, 46,191,138,180,91,71,22,7,168,149,95,69,187,121,5,220,117,33,115,62,100, 206,103,50,231,143,112,225,126,131,75,247,119,190,35,230,38,191,246,157, 169,27,147,109,157,3,61,89,62,224,155,86,93,172,175,190,142,160,113,25, 197,145,207,32,11,91,168,150,207,67,165,17,214,42,175,161,211,89,6,105, 141,160,190,240,222,23,152,144,144,185,2,24,23,32,163,1,75,5,157,101,7, 145,169,161,29,1,192,120,131,64,134,129,125,96,138,169,44,66,173,242,15, 164,65,29,70,39,0,99,0,8,89,26,64,117,67,16,44,76,150,130,187,30,132,151, 239,149,2,6,46,93,168,110,2,147,197,1,50,93,221,17,128,24,11,4,227,134, 8,98,219,119,132,8,0,129,11,1,46,29,48,206,1,214,75,148,69,45,36,173,222, 35,40,93,191,167,0,89,88,173,64,198,172,165,113,220,216,17,64,112,22,48, 198,21,99,112,1,192,146,221,72,122,3,3,0,6,6,198,4,152,116,192,165,124, 175,90,233,230,1,107,97,84,12,128,192,184,128,81,25,172,74,86,28,191,217, 217,17,96,188,223,11,83,139,44,136,109,129,24,7,3,109,92,62,139,247,21, 97,61,11,216,117,81,8,100,53,156,124,63,132,227,129,54,246,89,163,64,58, 133,201,98,88,171,223,45,157,249,107,186,35,192,189,227,3,145,149,44,169, 134,10,75,141,20,97,106,65,140,3,220,128,140,233,201,205,197,251,118,16, 245,214,173,5,227,27,182,8,209,123,51,24,239,193,171,140,84,26,47,98,147, 167,219,119,1,233,192,97,206,181,253,195,185,177,81,95,242,114,144,161, 220,82,232,40,2,147,28,92,74,112,206,224,138,13,21,0,128,44,124,73,32, 155,145,134,175,192,152,107,210,164,231,189,53,80,73,164,172,206,174,110, 206,181,221,28,128,163,130,106,150,168,239,106,165,127,229,9,170,223,61, 236,226,11,251,124,76,142,230,225,73,14,193,57,246,12,56,248,244,88,30, 119,143,122,232,119,57,134,243,12,19,3,146,138,34,57,231,216,228,40,105, 253,7,34,211,38,163,161,147,14,172,81,243,164,213,155,91,138,221,14,224, 122,204,60,253,180,151,107,37,15,73,215,249,190,20,206,87,164,231,230, 27,29,133,229,114,25,20,174,89,33,184,26,26,30,245,32,93,212,171,21,202, 226,232,111,141,160,254,189,179,39,79,190,189,235,208,225,66,30,252,97, 46,216,180,78,227,221,105,171,241,212,218,91,167,207,109,182,224,182,254, 138,159,154,157,29,202,123,131,95,207,229,243,51,156,177,207,175,174,44, 179,181,234,202,11,4,246,92,177,56,242,184,155,243,190,188,94,171,253, 61,237,116,158,124,254,247,191,93,184,241,236,167,14,62,54,208,113,130, 161,202,217,19,165,205,201,111,27,224,250,222,31,253,248,103,123,153,231, 62,209,172,175,239,169,85,150,126,50,119,252,248,242,183,166,167,139,125, 222,192,67,205,168,62,63,247,236,179,91,60,254,208,227,240,225,231,196, 204,204,140,247,145,39,250,56,254,87,241,95,105,140,140,8,113,124,24,60, 0,0,0,0,73,69,78,68,174,66,96,130, } }, {.path = "data/icons/icon48.png", .size = 3004, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,48,0,0,0,48,8,6,0, 0,0,87,2,249,135,0,0,11,131,73,68,65,84,120,156,237,153,123,108,100,215, 93,199,63,231,156,123,239,220,25,207,172,237,125,122,55,235,58,97,243, 88,218,180,75,66,11,229,209,164,136,134,63,40,45,136,200,149,136,68,2, 68,9,16,37,72,64,17,132,86,50,81,255,160,21,8,9,36,10,138,84,129,80,20, 164,24,21,136,82,66,5,37,164,74,66,186,209,86,129,77,54,9,251,142,119, 253,24,219,243,158,185,207,115,126,252,113,199,222,93,225,245,62,1,33, 237,79,178,228,153,251,187,191,243,253,158,223,243,156,129,27,114,67,110, 200,255,107,81,215,106,224,190,223,252,230,72,48,200,130,111,252,217,167, 91,160,100,237,251,79,61,250,220,168,248,225,167,148,228,75,25,249,155, 47,127,245,115,189,107,93,107,35,185,106,2,211,211,207,153,232,182,189, 7,140,10,126,75,96,210,101,209,223,165,121,255,5,157,185,147,78,236,126, 237,135,191,171,180,249,41,196,197,206,102,7,197,229,179,158,85,223,26, 89,30,156,153,157,253,156,253,63,37,48,61,243,214,214,52,139,31,84,158, 249,53,133,190,25,165,148,136,88,155,39,115,189,250,177,67,193,200,216, 1,227,151,247,173,219,87,10,227,135,89,16,214,142,139,184,23,109,156,252, 173,228,241,155,207,255,193,143,118,255,87,9,220,59,243,146,55,206,248, 199,61,63,124,18,212,143,139,115,37,113,57,34,130,205,19,122,171,167,233, 46,159,160,50,190,135,114,109,23,94,80,70,105,131,87,26,193,11,42,40,165, 65,68,156,179,45,155,199,7,163,246,194,108,52,104,124,107,103,195,204, 93,173,87,46,155,192,79,126,254,59,19,229,45,181,71,180,9,126,69,105,181, 103,237,85,113,150,116,208,162,187,122,138,168,83,39,139,218,84,198,111, 34,28,217,134,95,174,81,222,178,155,176,186,21,155,167,184,60,69,196,225, 108,74,58,104,147,37,253,76,92,126,194,218,244,69,155,70,95,175,184,210, 161,23,158,254,236,224,74,8,120,151,82,152,158,121,46,136,146,15,124,210, 243,253,39,69,248,17,16,31,244,16,124,78,58,104,19,247,86,176,89,4,8,32, 231,118,69,214,254,87,120,126,25,252,144,52,234,144,244,155,216,44,65, 41,229,43,227,223,161,181,119,59,194,131,173,246,210,227,192,95,95,55, 2,63,253,133,151,39,211,188,242,132,231,251,191,168,180,222,46,46,39,207, 44,74,233,2,124,212,193,102,49,226,134,222,23,71,60,88,197,11,171,4,149, 113,64,129,26,122,74,28,0,206,102,5,49,165,16,41,222,73,163,150,26,116, 150,70,179,164,123,197,57,121,81,2,51,51,51,250,176,217,254,27,160,158, 192,57,179,6,192,102,49,73,127,21,113,22,109,252,66,89,65,158,69,52,22, 15,211,88,124,139,230,202,17,198,118,125,47,219,111,186,155,176,182,227, 2,187,226,44,206,166,100,233,0,151,167,24,63,36,238,55,176,121,154,98, 221,234,149,18,216,140,177,250,217,153,127,255,99,65,61,225,242,4,148, 38,139,59,244,155,115,136,8,65,121,12,47,40,35,226,232,183,231,152,63, 250,47,244,91,115,228,73,132,9,203,24,191,132,95,170,177,243,214,31,98, 226,150,79,80,173,77,226,249,101,162,78,157,168,91,199,102,49,126,169, 74,80,30,69,108,78,50,104,166,206,229,95,177,186,244,23,255,244,135,247, 156,66,157,235,41,155,201,102,33,36,2,13,196,33,206,18,84,170,120,165, 50,121,58,32,233,55,201,147,30,226,114,58,205,227,172,204,127,151,168, 187,88,132,137,90,219,23,133,181,9,221,246,41,178,211,49,97,184,141,177, 241,219,240,168,160,181,71,80,219,129,241,194,98,167,188,128,242,150,93, 129,88,251,100,50,104,222,245,195,15,127,237,129,215,224,178,74,236,230, 73,172,212,170,231,151,165,60,58,161,188,32,4,20,149,45,19,196,189,21, 26,103,14,51,127,252,37,218,171,255,137,184,188,168,48,206,22,180,47,180, 129,184,156,104,176,68,18,53,168,149,39,217,177,231,99,24,19,32,226,10, 210,34,136,179,36,81,211,139,123,43,129,235,182,243,203,1,127,73,2,181, 109,19,145,23,84,196,229,162,156,43,114,64,105,67,105,100,43,219,167,190, 159,112,203,14,234,167,254,141,165,147,175,145,116,26,184,60,67,16,148, 241,206,229,199,48,74,61,175,204,248,248,135,24,27,187,109,253,153,82, 6,133,198,102,49,131,206,34,89,220,197,185,116,121,146,201,244,245,235, 65,64,235,106,87,123,37,231,7,104,107,51,242,36,37,77,34,108,26,33,226, 24,25,219,203,205,7,238,103,98,223,61,212,79,190,206,194,209,127,165,83, 63,74,30,247,17,103,17,169,130,179,132,225,54,118,237,254,56,149,202,196, 240,123,183,190,70,158,70,12,90,243,36,131,38,74,41,156,203,23,103,103, 127,238,178,155,218,166,4,68,92,91,44,185,21,237,41,93,194,248,160,210, 184,40,163,67,16,74,105,70,198,246,114,219,15,254,60,83,31,249,12,75,199, 95,101,238,157,111,210,89,62,134,75,98,42,225,110,38,167,238,35,172,108, 95,179,137,179,69,200,37,131,38,131,246,2,89,212,193,230,9,34,86,162,110, 125,225,114,193,95,146,0,46,233,162,202,41,16,138,3,103,65,107,15,29,214, 112,46,195,102,9,90,123,152,160,140,82,154,176,186,147,169,3,63,195,238, 219,127,140,250,169,239,208,111,206,49,245,145,207,226,151,106,235,38, 149,210,104,227,145,246,155,244,155,103,200,147,30,121,210,39,137,219, 52,235,111,187,126,235,204,226,117,35,208,91,61,213,45,141,237,73,202, 213,29,40,101,64,129,20,221,7,173,61,252,106,25,191,20,144,167,57,54,95, 243,186,194,120,33,97,101,59,90,121,136,205,208,90,1,26,231,44,206,229, 196,221,21,6,173,5,178,184,75,158,244,232,119,230,105,44,30,38,73,219, 169,35,95,190,110,4,222,125,247,235,253,176,58,26,111,221,241,65,118,76, 220,77,80,26,95,127,38,34,20,81,20,16,148,125,196,229,100,73,70,50,232, 210,169,31,163,223,58,139,241,2,210,184,135,50,1,97,101,12,227,121,244, 87,230,73,250,13,178,164,75,22,119,232,181,231,232,180,79,224,116,142, 54,94,70,238,82,138,204,191,230,62,64,174,210,40,73,90,131,165,179,7,105, 174,188,195,216,214,219,25,29,187,131,176,188,173,152,44,41,170,166,205, 21,74,251,120,190,208,106,207,147,197,157,225,28,52,236,147,226,176,121, 134,136,35,79,122,216,52,34,141,218,116,26,199,233,245,230,16,13,126,165, 134,175,198,70,148,226,43,251,238,123,232,175,172,111,94,56,245,177,201, 57,158,122,202,109,2,113,115,2,129,54,17,162,122,40,33,77,58,212,23,14, 209,92,125,143,209,177,91,217,186,253,67,84,170,19,235,186,34,224,172, 224,108,62,252,44,56,151,179,214,212,138,126,224,112,121,70,150,116,105, 173,188,67,111,112,22,140,70,27,131,214,30,202,24,163,141,255,3,218,15, 238,242,225,177,59,190,187,244,55,217,167,127,105,118,124,209,123,239, 208,161,167,179,141,48,234,205,8,40,157,165,32,231,29,5,133,44,237,178, 82,127,147,147,199,254,158,249,185,111,51,232,47,13,155,209,57,45,103, 51,58,205,99,44,188,255,109,26,245,195,100,105,15,40,154,85,154,180,169, 159,125,131,118,227,40,74,107,76,169,140,23,148,209,158,143,246,2,76,80, 66,27,207,215,198,251,160,246,75,95,12,130,145,127,232,238,241,254,228, 246,159,120,104,255,21,123,32,79,170,153,246,179,246,127,31,152,10,34, 245,133,55,104,53,222,99,219,206,59,217,190,235,46,252,160,70,150,245, 89,94,60,68,99,249,45,148,82,44,206,189,74,183,115,138,29,55,125,148,32, 24,101,225,244,43,116,154,199,214,199,14,5,69,227,27,130,95,235,202,0, 74,41,173,148,153,20,229,30,201,144,131,192,187,87,68,224,8,71,236,157, 220,218,186,184,134,144,38,109,22,230,94,163,177,252,54,91,70,191,135, 213,247,223,164,221,56,138,56,139,242,124,68,28,209,96,153,179,167,94, 66,156,99,208,153,47,42,153,58,23,90,5,90,80,218,67,105,13,82,132,154, 56,139,203,51,242,184,159,74,156,158,217,8,193,166,33,196,236,172,5,105, 110,170,51,36,146,196,45,234,243,7,233,117,230,134,243,144,172,3,43,52, 28,54,27,192,112,246,113,89,138,203,207,133,181,26,22,30,113,14,17,133, 246,74,160,52,121,220,199,89,219,85,202,109,216,224,54,39,0,32,250,138, 103,116,89,131,100,188,245,106,5,172,239,188,246,124,92,158,16,183,150, 136,91,203,216,44,89,167,177,102,65,196,13,7,68,135,194,173,230,46,219, 16,199,37,143,148,74,169,134,82,90,0,117,254,12,115,57,162,148,30,38,167, 191,78,68,27,191,56,116,10,184,60,195,166,49,105,183,152,131,116,16,94, 72,216,218,53,111,45,37,237,94,103,163,53,46,237,1,84,19,180,85,74,163, 181,25,46,112,153,39,191,225,217,64,105,83,16,49,62,202,24,4,65,68,240, 202,85,188,112,4,237,121,56,107,177,105,180,126,240,135,162,36,15,47,3, 222,95,250,143,177,120,163,37,46,233,1,99,104,129,88,80,30,40,180,241, 214,141,95,218,35,231,17,85,195,146,35,130,216,28,191,82,43,60,163,205, 240,177,42,118,59,79,193,102,40,101,138,169,215,230,56,103,143,195,236, 134,19,234,37,61,240,225,61,213,206,45,219,194,52,244,207,169,42,165,49, 94,128,49,254,5,46,191,0,186,82,23,250,73,0,87,156,238,196,89,148,241, 48,65,136,246,75,231,8,174,235,10,46,79,138,74,36,206,138,184,19,23,195, 119,73,15,236,170,233,222,84,169,146,76,38,182,118,98,37,166,222,203,201, 135,27,175,180,65,235,162,195,138,179,69,242,42,133,214,6,167,245,16,148, 172,255,21,122,110,120,43,81,216,208,158,143,241,75,195,91,10,119,110, 68,113,14,156,195,101,105,100,211,232,253,171,38,224,105,211,83,138,120, 188,226,243,125,123,61,150,187,41,39,27,9,141,129,197,21,136,81,107,185, 33,130,54,6,119,129,87,214,234,168,156,23,114,114,222,217,25,148,214,184, 60,197,69,57,218,15,208,158,143,56,71,158,197,228,201,160,147,217,100, 233,170,9,164,137,180,180,201,143,160,252,9,163,149,183,179,230,51,22, 106,22,187,57,167,91,41,157,196,22,101,95,21,68,24,130,47,121,154,32,48, 216,243,128,138,56,60,45,140,149,132,44,27,144,138,231,68,124,0,141,128, 136,197,38,81,209,35,178,20,155,12,16,113,43,126,164,27,23,195,119,201, 28,248,163,167,62,191,218,29,196,15,167,113,252,148,181,246,148,136,136, 111,20,147,99,62,31,221,91,97,255,174,10,35,129,185,224,157,145,64,51, 181,53,100,255,206,50,83,227,37,42,190,6,4,95,193,238,170,97,91,213,103, 139,103,179,49,233,62,43,54,251,162,184,252,109,183,126,59,86,220,29,229, 201,0,113,206,137,147,55,170,44,110,88,66,207,109,205,101,200,244,244, 180,217,251,225,187,239,44,153,224,113,109,244,253,90,155,113,165,20,158, 31,208,75,45,39,86,34,206,172,246,145,206,18,19,165,20,101,19,70,70,170, 84,170,53,156,41,177,60,176,164,173,58,33,9,241,32,74,187,157,246,95,250, 46,249,194,203,47,127,178,241,129,79,28,153,82,138,7,148,241,30,84,218, 236,83,10,147,116,155,46,139,122,47,102,121,254,88,243,200,171,23,205, 129,43,190,202,123,104,102,38,220,166,203,247,250,158,249,117,227,5,247, 134,165,82,168,180,198,137,208,232,198,172,204,159,38,143,250,68,209,192, 86,171,53,70,106,53,83,10,203,40,165,168,47,206,147,37,105,146,164,241, 211,237,133,206,204,43,175,124,227,188,49,101,70,223,116,207,225,125,30, 230,65,101,244,3,105,191,125,52,143,122,143,213,15,191,114,209,10,116, 85,4,214,228,87,127,231,247,199,203,21,125,127,181,50,242,184,231,123, 119,42,165,77,150,101,156,57,125,146,94,167,211,237,247,123,127,90,173, 142,68,213,218,232,67,229,74,245,102,165,149,94,94,92,136,226,100,240, 213,94,26,125,233,159,103,103,219,27,26,158,158,54,123,22,178,125,42,141, 7,103,15,254,227,134,3,220,117,33,0,128,136,250,237,223,251,242,148,25, 169,60,28,120,254,47,88,231,110,58,115,250,100,171,211,108,125,73,39,157, 63,7,210,242,232,142,253,149,209,177,95,214,198,124,166,190,52,255,108, 218,92,254,242,243,207,63,127,205,63,108,172,201,53,255,70,6,48,51,51, 227,37,97,237,0,194,35,245,249,197,215,187,75,167,159,157,157,157,77,215, 158,79,79,207,4,181,61,131,91,210,213,133,51,207,60,243,76,255,122,172, 249,63,34,143,62,250,168,63,51,51,115,25,243,213,13,185,33,55,228,134, 12,229,191,0,28,195,92,201,114,89,143,242,0,0,0,0,73,69,78,68,174,66,96, 130, } }, {.path = "data/icons/icon64.png", .size = 4397, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,64,0,0,0,64,8,6,0, 0,0,170,105,113,222,0,0,16,244,73,68,65,84,120,156,237,155,107,140,156, 87,121,199,127,231,156,247,50,179,51,187,222,139,189,107,39,113,66,10, 9,73,192,113,131,40,132,168,109,26,165,208,40,4,104,63,36,173,132,74,27, 84,12,162,16,26,160,42,208,22,203,226,99,219,15,85,81,171,182,162,21,52, 109,74,162,74,33,180,8,84,154,96,66,128,212,184,105,67,227,224,96,39,94, 95,246,50,187,59,59,183,119,222,219,185,244,195,59,187,59,123,113,118, 215,177,65,170,252,151,102,61,59,123,222,51,231,249,159,231,121,206,115, 57,134,203,184,140,203,184,140,203,184,140,159,22,196,255,211,5,56,113, 251,199,191,58,22,136,70,252,239,127,246,190,104,163,191,255,242,7,255, 229,117,206,15,126,221,154,244,88,55,107,60,253,204,23,206,206,193,33, 123,105,214,115,126,92,116,2,238,57,248,248,0,233,174,119,73,229,125,204, 90,189,160,211,248,159,117,218,122,242,155,59,159,157,225,208,33,123,235, 131,143,148,135,242,210,187,101,80,254,180,16,106,159,115,54,117,38,63, 166,243,228,43,58,139,190,74,158,255,232,240,23,239,79,46,246,186,206, 135,139,71,192,193,131,242,238,248,142,215,43,191,242,73,37,189,123,133, 84,131,0,206,154,212,154,252,71,38,143,31,139,59,115,135,253,176,114,175, 148,193,123,133,148,67,253,143,59,103,45,48,235,5,149,111,163,228,35,180, 90,79,127,117,228,169,57,14,93,90,173,184,40,4,220,117,240,251,67,161, 9,238,19,66,124,2,33,175,23,66,200,85,3,156,35,238,204,217,198,212,177, 168,50,178,183,18,86,70,164,144,2,103,29,224,0,80,126,137,160,60,140,242, 3,156,53,177,53,230,88,158,199,143,107,147,63,30,157,235,254,232,240,23, 239,184,36,90,241,170,8,184,247,222,71,148,190,233,245,251,133,23,252, 129,82,254,61,192,128,179,6,107,52,206,26,0,172,213,196,205,105,218,243, 47,147,69,117,42,163,123,9,43,163,248,165,29,40,63,4,10,225,253,176,138, 144,106,213,252,206,89,235,140,158,141,59,243,79,197,141,217,71,209,233, 83,79,92,117,252,162,106,197,5,19,112,239,193,255,29,213,82,190,207,243, 252,7,132,144,175,65,136,149,185,156,195,90,67,158,180,136,22,207,146, 116,230,200,227,54,58,237,80,25,221,75,80,222,129,23,84,80,97,153,82,101, 140,242,142,221,88,163,49,121,138,179,122,101,154,222,28,121,210,193,216, 60,182,58,123,193,234,236,43,121,154,61,78,30,93,20,95,177,109,2,110,63, 248,164,55,152,120,183,122,225,224,167,189,160,114,167,84,42,92,59,198, 57,75,158,180,137,155,51,36,157,121,76,30,147,39,29,242,180,67,117,244, 106,130,242,80,65,64,80,34,172,140,49,176,99,15,66,74,64,224,172,70,231, 9,58,141,72,163,58,38,79,89,50,147,98,110,103,157,213,179,38,235,126,171, 221,156,251,236,247,31,250,192,137,87,67,128,220,124,200,10,238,254,228, 147,187,135,242,129,79,123,65,245,203,66,136,187,173,78,194,98,215,204, 242,34,173,78,73,218,53,210,206,60,214,228,188,50,199,2,129,0,28,206,90, 156,53,8,161,240,252,50,86,103,224,220,42,197,2,16,66,72,156,219,147,198, 173,119,153,110,227,138,237,137,187,30,222,86,6,29,56,240,3,127,106,84, 223,33,149,247,25,169,252,219,132,16,62,128,115,14,103,114,172,209,8,1, 214,100,100,113,171,39,56,208,183,120,107,50,162,230,89,84,88,194,11,43, 43,188,136,229,31,20,115,90,172,201,49,58,197,57,11,8,132,144,56,28,56, 71,22,55,137,155,211,232,60,73,116,158,53,126,34,4,212,38,196,205,165, 96,248,11,206,217,171,172,89,217,237,222,146,209,89,161,174,66,8,132,92, 59,165,35,141,23,153,59,119,132,246,194,41,90,141,151,24,28,187,150,177, 43,246,179,99,231,117,108,168,33,206,81,56,211,28,147,39,24,157,2,32,165, 71,103,225,52,214,100,8,161,34,67,183,125,65,82,247,97,75,4,232,220,72, 229,217,138,195,246,54,85,224,28,88,147,18,183,107,100,157,58,8,65,80, 222,65,255,1,232,172,166,181,240,99,230,206,254,128,52,170,227,156,197, 232,132,214,194,9,186,237,115,44,204,92,201,158,215,221,206,68,120,27, 126,48,180,172,238,110,13,193,32,8,202,67,132,3,35,132,213,49,146,246, 28,221,214,108,58,228,57,1,61,27,186,148,4,120,158,233,88,103,82,103,114, 116,222,197,25,141,23,84,232,44,76,18,183,107,40,47,64,249,229,85,207, 100,105,139,185,51,207,176,112,238,127,208,121,188,110,78,107,114,162, 230,89,166,78,61,73,87,215,24,26,126,45,195,35,215,81,42,237,44,52,192, 21,49,130,84,62,97,101,12,63,168,20,36,43,159,160,52,72,101,228,170,107, 172,209,95,120,231,239,127,235,225,180,89,251,242,55,255,230,190,230,37, 35,32,115,182,27,66,140,16,8,161,8,42,67,148,6,199,41,13,238,162,83,63, 77,220,156,38,79,58,100,56,84,48,64,28,213,88,152,121,150,110,107,26,107, 243,13,102,92,218,184,98,183,211,100,145,185,153,163,44,46,188,64,117, 112,47,213,202,94,208,22,229,149,240,130,1,164,242,215,61,175,188,48,148, 42,248,37,171,211,55,100,90,31,1,158,189,100,4,132,9,177,240,137,164,23, 82,170,238,196,47,85,17,66,226,5,101,194,129,97,242,93,175,165,85,59,65, 99,250,5,102,79,125,151,86,227,165,158,3,115,56,163,161,247,126,35,172, 4,141,14,157,71,52,234,199,105,206,29,103,231,232,126,70,38,222,80,56, 64,103,139,249,92,255,113,104,72,187,13,210,246,124,154,101,209,5,251, 130,45,17,96,171,3,217,64,117,56,246,130,10,66,172,142,214,16,2,191,84, 101,244,170,125,148,135,119,227,13,84,177,39,53,173,249,19,232,180,131, 206,51,232,121,240,66,181,237,186,231,251,17,4,67,140,141,221,204,224, 224,213,203,145,161,16,10,129,42,158,181,22,163,83,226,206,28,58,237,96, 156,110,153,52,237,92,82,2,170,163,123,109,121,160,170,61,223,67,231,57, 121,150,247,226,248,2,214,228,232,172,139,148,62,19,215,222,198,216,149, 251,105,204,30,103,250,196,147,204,159,254,47,178,184,89,104,2,14,98,81, 156,239,225,0,66,169,101,199,39,132,164,82,185,130,177,157,63,75,169,52, 194,70,167,131,16,18,109,18,162,198,20,58,237,20,228,25,179,40,130,185, 238,37,37,192,171,183,51,19,14,182,132,84,40,79,225,5,62,58,203,201,211, 140,60,141,49,121,178,106,103,189,160,194,206,189,111,98,100,247,77,180, 230,79,48,125,226,219,212,94,250,46,73,103,14,171,115,116,18,97,77,142, 23,14,96,181,70,10,143,145,157,111,96,215,248,45,40,21,98,77,142,181,102, 149,202,227,28,89,210,38,110,77,147,199,109,156,51,8,233,97,173,89,232, 100,92,112,72,188,37,2,94,195,107,244,164,77,154,206,129,49,128,45,136, 176,22,116,150,20,59,177,129,137,123,97,133,241,107,223,198,248,181,111, 163,53,119,130,179,199,190,193,204,201,167,72,162,121,156,206,209,46,130, 220,48,49,241,86,70,39,222,136,148,133,179,147,202,195,89,131,49,57,206, 104,172,53,164,81,157,164,93,67,103,113,47,46,112,8,103,73,162,133,218, 177,155,208,235,191,125,107,216,98,46,224,196,111,253,101,252,87,126,80, 254,96,255,167,58,235,98,116,142,0,140,78,209,121,178,156,5,42,47,192, 11,6,86,101,120,214,106,162,197,51,76,189,248,36,51,39,14,227,151,6,185, 254,214,247,51,60,113,3,107,51,232,37,24,157,210,89,56,77,210,174,97,242, 20,163,211,66,227,176,180,234,39,89,156,125,225,115,231,142,126,237,179, 23,38,254,22,53,0,132,115,174,189,184,193,231,56,107,112,128,244,66,66, 47,196,154,12,4,72,25,174,115,112,82,250,12,142,253,12,215,189,101,47, 163,123,246,33,176,140,238,190,1,164,71,81,15,89,13,163,83,186,205,25, 146,206,28,58,143,177,121,134,206,99,242,180,69,99,225,69,58,205,211,78, 235,100,250,2,228,94,89,211,86,7,214,107,207,47,196,209,236,26,47,222, 23,195,91,131,181,6,21,148,168,142,140,82,170,150,80,106,253,244,206,106, 58,245,211,68,139,231,200,146,136,168,49,141,51,41,158,239,35,213,138, 182,232,172,75,183,49,69,22,213,49,89,130,201,18,116,22,17,119,106,212, 206,254,39,173,250,73,156,53,26,228,236,133,137,94,96,139,26,0,167,142, 63,94,47,85,198,236,216,196,27,229,206,221,183,80,42,143,173,203,212,0, 156,113,228,153,68,121,138,82,213,195,104,77,158,106,140,54,88,157,209, 89,152,164,83,159,44,178,61,4,70,231,36,81,139,192,66,56,48,136,231,7, 68,205,57,226,86,13,157,70,69,106,156,119,123,194,207,210,108,156,68,187, 20,229,135,88,157,167,206,102,11,63,17,2,156,211,141,52,89,52,211,103, 158,150,245,185,231,25,27,223,199,240,232,13,40,89,94,93,11,89,74,139, 13,88,43,145,42,160,84,241,73,163,54,245,218,105,226,206,252,178,186,247, 211,103,173,38,79,19,148,23,144,117,27,43,246,158,21,181,132,168,117,150, 118,251,20,214,25,252,82,5,33,37,214,152,32,192,253,198,213,191,112,95, 59,168,180,158,63,241,245,175,167,151,140,0,139,107,74,92,14,206,79,147, 69,166,206,60,197,252,236,115,12,143,94,207,200,232,141,4,225,112,31,17, 69,2,131,235,17,97,4,58,203,208,105,196,170,227,66,136,34,131,4,150,126, 218,158,41,57,155,99,117,74,158,182,105,55,94,166,211,57,131,19,14,233, 121,8,233,33,164,194,243,195,64,72,249,65,224,61,168,29,223,184,254,174, 247,63,228,197,237,103,142,29,126,116,203,129,209,150,9,16,86,180,129, 12,24,40,100,116,100,105,131,218,244,17,26,245,227,12,143,190,158,145, 209,27,41,149,199,54,124,222,185,181,191,23,130,46,17,209,63,208,25,141, 53,57,121,26,177,56,119,140,40,158,66,120,10,33,36,66,74,132,84,189,151, 68,72,37,148,23,236,145,202,251,109,231,236,175,154,160,244,157,235,239, 254,157,127,64,70,79,188,248,175,15,47,176,73,166,184,101,2,192,116,192, 223,64,197,28,89,218,164,54,125,132,102,253,69,70,118,222,196,174,43,222, 188,226,35,122,202,208,143,60,143,168,215,126,136,108,4,140,243,22,134, 119,221,136,23,12,20,74,227,44,214,234,34,155,156,58,66,171,126,18,21, 150,81,65,25,169,60,150,179,95,33,145,82,33,253,160,247,57,8,161,134,149, 84,247,56,165,238,116,38,124,246,250,123,14,252,147,235,38,143,253,248, 137,47,157,123,213,4,24,169,187,10,183,62,175,237,35,34,77,27,204,78,125, 143,70,253,56,99,19,251,25,27,191,153,176,52,130,16,130,34,185,117,164, 241,2,181,169,103,232,52,79,227,133,3,156,123,249,9,154,141,147,236,186, 242,205,140,236,186,17,169,2,146,238,60,51,167,159,166,221,56,85,156,58, 66,44,171,144,244,252,34,132,70,32,148,183,161,35,22,82,149,133,84,183, 97,213,207,153,64,79,0,7,57,143,38,108,153,128,48,243,186,214,35,218,44, 114,114,206,145,196,11,76,77,126,139,133,218,115,236,28,223,207,216,196, 62,156,51,116,154,147,204,156,126,154,164,51,87,228,251,2,172,211,116, 90,103,72,146,121,234,243,207,51,56,116,13,211,47,31,38,106,79,245,132, 94,170,27,46,127,1,56,144,65,136,23,148,10,83,210,43,101,248,254,117,152, 52,246,178,180,187,120,62,225,183,69,64,199,243,210,1,199,150,157,139, 115,150,164,59,207,185,201,39,89,168,61,71,224,85,153,61,243,12,121,218, 234,27,213,87,51,180,5,17,237,197,83,164,221,185,222,154,93,95,233,64, 176,214,150,172,181,8,33,81,65,169,136,67,116,94,4,102,206,161,147,46, 38,75,114,172,125,249,149,214,185,229,64,104,156,44,19,208,218,124,228, 106,56,103,137,187,115,44,212,158,199,232,87,206,89,4,162,200,253,97,89, 254,194,33,154,21,249,151,95,189,130,138,115,197,223,17,40,191,132,244, 3,116,210,197,230,41,56,23,73,199,121,237,31,182,65,64,254,82,164,29,92, 80,217,105,35,8,65,175,23,176,6,189,186,1,128,80,30,86,103,164,205,57, 178,246,34,54,207,150,158,94,109,22,244,136,176,133,57,20,65,22,128,107, 184,92,215,94,105,29,91,38,224,232,61,123,140,68,52,206,151,180,108,31, 133,19,147,202,95,110,138,0,43,206,78,121,133,195,147,10,103,52,105,115, 158,238,252,57,210,86,189,143,136,245,112,125,105,180,179,182,230,186, 11,175,184,105,91,151,230,208,33,139,16,117,33,100,81,161,217,192,251, 110,21,75,30,73,32,16,82,34,61,191,39,172,196,137,37,79,95,4,59,75,42, 46,148,87,132,191,121,74,218,46,242,131,117,193,5,224,76,225,12,157,53, 232,44,57,59,233,117,54,184,159,176,130,109,196,1,224,156,173,3,61,225, 21,75,134,186,174,204,181,249,76,197,63,125,206,77,72,137,84,62,82,103, 189,20,218,97,141,197,233,28,233,7,248,229,42,210,11,122,90,163,138,158, 65,22,23,68,41,111,57,157,118,214,20,14,49,207,176,70,191,204,209,163, 175,88,43,216,22,1,32,234,206,97,133,40,52,167,104,132,168,229,102,232, 230,68,172,221,177,243,104,145,16,189,174,147,70,250,33,202,15,16,202, 47,2,158,37,115,17,61,135,169,51,132,209,203,26,99,117,134,205,51,156, 53,214,25,119,114,131,47,93,133,109,17,16,120,98,209,10,103,221,170,246, 71,177,123,74,202,94,12,111,122,53,253,77,112,62,19,114,44,119,134,156, 49,120,165,10,210,15,138,19,2,7,189,83,98,117,51,186,32,2,64,167,221,94, 21,217,101,194,153,201,205,150,177,45,2,110,189,166,218,140,172,151,79, 214,83,175,25,107,236,242,121,85,168,177,148,30,78,168,149,56,255,60,68, 20,126,100,173,251,89,58,214,108,175,81,90,148,194,151,252,141,244,66, 16,244,108,127,101,124,63,150,212,191,247,91,27,105,166,54,147,105,91, 4,84,66,218,163,165,48,155,24,42,149,207,54,18,38,23,18,186,249,106,33, 133,16,32,20,74,44,105,196,234,158,64,145,208,40,16,75,166,233,250,94, 128,93,223,3,88,26,39,165,135,28,24,92,55,231,242,8,107,193,22,199,168, 73,227,197,184,217,154,223,76,166,237,249,0,27,180,29,164,37,95,242,218, 93,3,236,30,10,153,172,39,156,107,230,164,122,205,130,132,232,217,172, 197,218,34,158,47,252,5,96,244,242,152,222,155,66,0,103,113,206,244,197, 2,174,55,102,101,156,16,18,4,232,164,219,59,61,130,229,120,98,169,129, 162,179,24,157,37,51,202,15,55,141,91,182,69,128,17,166,43,240,227,165, 37,87,67,197,13,227,101,118,87,61,78,45,230,212,58,26,109,215,18,33,81, 74,98,213,210,153,110,214,204,186,62,160,89,89,92,143,144,165,113,203, 167,70,225,35,76,86,132,191,210,243,145,126,128,51,26,157,118,49,121,138, 117,238,204,220,49,177,105,185,124,91,4,104,221,89,204,51,245,61,63,16, 227,82,202,50,128,20,48,92,86,236,11,21,11,93,205,169,197,156,122,55,199, 244,151,244,97,149,211,19,194,49,84,242,16,190,92,95,207,238,237,252,128, 47,24,10,32,137,219,100,22,50,39,45,120,2,129,232,39,169,159,136,60,238, 244,110,148,0,216,151,224,59,155,150,203,183,21,214,253,249,161,67,141, 102,171,246,225,164,27,125,36,203,178,255,118,118,37,5,83,18,198,171,30, 183,92,81,98,223,158,10,195,101,111,141,163,239,69,120,2,38,170,62,215, 238,44,115,195,120,153,171,134,3,74,222,74,127,16,231,24,12,4,87,14,41, 42,129,79,217,147,12,203,164,89,209,237,63,181,121,254,143,206,154,250, 134,1,144,53,216,60,233,189,183,93,12,63,220,138,76,23,26,206,137,15,255, 225,231,174,174,150,203,239,247,124,239,126,129,184,74,244,157,75,158, 231,145,57,201,100,61,102,114,33,33,202,12,58,137,208,173,121,118,15,56, 134,188,162,97,58,56,180,131,48,44,147,9,143,90,23,230,187,6,17,205,51, 30,100,40,44,113,183,75,20,181,23,5,242,160,111,211,191,61,153,142,139, 160,172,222,102,156,251,144,16,234,29,82,201,29,43,12,56,210,118,29,157, 197,169,53,250,243,54,179,135,22,142,127,119,211,166,233,171,186,38,119, 251,193,131,222,126,171,246,7,126,248,81,223,15,223,163,148,28,94,34,64, 121,30,206,65,59,213,188,52,31,51,53,183,200,176,89,100,135,103,72,211, 4,103,45,213,161,29,148,74,101,130,48,68,121,62,81,102,105,204,77,21,103, 186,115,68,81,103,62,106,183,254,104,113,108,248,239,143,61,250,232,114, 2,48,113,243,219,43,94,117,224,118,207,15,62,36,149,127,135,144,178,234, 172,37,105,206,101,38,75,254,58,143,186,127,188,248,210,209,45,37,110, 23,229,162,228,131,15,62,88,54,149,145,59,75,97,249,247,60,223,251,249, 32,8,67,229,173,184,23,235,28,11,245,6,139,181,41,242,44,37,77,18,140, 49,102,199,142,97,21,150,203,4,65,136,31,4,56,231,168,77,79,145,231,57, 206,152,90,28,119,63,85,59,125,242,161,163,71,143,110,116,201,128,209, 183,220,53,52,224,7,119,42,175,244,33,224,173,73,115,238,225,196,228,159, 105,254,240,59,27,52,113,54,198,69,189,43,252,187,159,250,212,88,24,12, 222,87,174,84,63,28,150,74,55,138,190,94,122,187,213,100,230,220,89,178, 44,37,238,70,39,211,36,253,252,142,145,209,95,172,84,171,111,47,149,202, 85,63,8,176,214,50,63,59,67,150,165,211,105,146,124,178,93,59,247,200, 225,195,135,55,117,100,215,236,127,207,176,174,184,91,92,30,61,55,117, 228,63,182,213,39,184,232,151,165,15,30,60,40,235,218,187,182,58,56,248, 129,48,8,126,83,42,181,71,8,33,122,4,184,184,219,125,62,106,55,31,248, 218,190,27,15,191,251,217,51,149,234,238,129,187,42,149,234,71,74,229, 242,173,206,185,160,54,51,117,38,233,68,31,111,214,206,62,182,21,225,95, 45,46,217,125,253,3,7,14,248,131,87,94,247,166,114,57,248,152,239,135, 239,236,180,91,131,83,103,38,143,68,157,246,71,31,123,248,75,71,232,11, 229,238,191,255,163,187,188,225,202,189,82,202,95,171,205,156,253,11,47, 139,255,237,209,71,31,93,27,48,92,18,92,242,255,176,240,137,79,252,73, 197,27,145,239,200,243,244,87,206,158,60,241,249,71,30,250,187,231,217, 48,142,117,226,189,15,60,48,248,186,209,209,206,161,75,124,67,252,167, 130,3,7,14,172,189,233,116,25,151,113,25,151,113,25,151,113,25,63,93,252, 31,113,255,168,42,55,107,155,132,0,0,0,0,73,69,78,68,174,66,96,130, } }, goxel-0.8.1/src/assets/images.inl000066400000000000000000004127121334742672700167260ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/images/icons.png", .size = 35634, .data = (const uint8_t[]){ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,2,0,0,0,2,0,8,6,0,0, 0,244,120,212,250,0,0,138,249,73,68,65,84,120,156,237,221,119,124,84,85, 218,192,241,223,157,153,180,73,165,247,46,29,148,34,162,20,41,98,193,142, 107,95,212,215,186,186,174,238,218,221,93,11,216,123,111,171,171,174,5, 11,246,130,32,42,130,162,210,155,32,189,67,32,132,244,100,38,83,238,61, 239,31,119,38,76,66,202,76,50,45,201,243,253,56,102,50,115,203,57,147, 144,231,185,167,93,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,136,166,238,56,223,67,8,17,132,17,192, 37,64,171,88,23,68,8,33,234,205,106,189,48,41,37,181,44,217,158,230,176, 90,173,23,198,186,56,162,121,210,98,93,128,16,140,79,76,74,254,186,71, 191,163,188,219,214,175,74,180,88,172,111,187,202,29,255,2,242,99,93,48, 81,173,145,192,248,80,118,104,223,190,125,39,195,48,188,7,14,28,200,9, 241,92,31,2,59,66,220,167,190,78,1,110,137,210,185,130,245,36,48,39,214, 133,16,193,177,217,146,110,78,203,204,124,224,209,55,103,165,88,52,11, 183,95,113,186,163,164,40,239,105,175,219,125,87,172,203,22,132,86,64, 27,96,131,239,251,1,64,10,144,3,236,1,108,192,81,190,247,182,0,69,64,11, 160,167,239,181,149,128,1,116,245,29,167,44,140,199,218,1,228,133,169, 158,205,66,99,73,0,198,39,38,37,127,253,151,127,62,107,235,222,111,152, 81,80,144,175,205,126,255,69,99,205,226,239,74,61,46,231,105,192,178,88, 23,80,84,50,62,35,35,99,238,21,87,92,145,96,179,217,130,218,161,180,180, 148,109,219,182,209,171,87,47,82,83,83,131,62,209,220,185,115,89,179,102, 205,116,96,90,253,138,26,178,31,51,51,179,198,13,25,58,204,0,5,152,255, 47,46,45,215,20,144,158,154,12,202,255,14,108,220,113,64,3,69,159,238, 109,13,0,165,148,166,128,253,185,37,26,64,187,214,233,202,124,221,220, 126,203,174,92,13,160,103,151,214,254,151,0,56,112,208,220,190,117,171, 244,138,151,149,82,108,94,183,70,43,43,41,90,0,76,136,88,141,227,151,6, 252,217,247,124,6,135,62,246,120,165,37,164,164,62,221,161,83,215,107, 30,125,237,179,148,82,111,2,0,105,9,58,255,186,246,92,199,158,29,91,222, 245,148,59,174,195,12,106,241,168,37,176,21,216,12,28,227,123,109,45,48, 16,120,28,184,29,51,16,31,240,189,119,58,48,11,56,15,152,233,123,45,13, 51,232,191,0,92,15,44,13,227,177,10,129,94,200,69,97,208,130,251,235,28, 91,149,130,191,219,107,96,75,78,231,164,169,183,89,59,247,29,209,98,214, 91,15,252,232,117,187,78,6,126,141,117,65,195,108,32,112,25,230,85,116, 55,223,107,59,129,31,129,183,128,63,98,83,172,58,141,205,200,200,152,59, 115,230,204,132,241,227,199,7,181,67,118,118,54,179,103,207,230,182,219, 110,163,83,167,78,65,159,104,229,202,149,44,91,22,253,220,111,208,145, 71,26,115,190,251,78,119,235,202,99,40,165,25,10,94,254,224,151,4,101, 40,237,154,11,70,121,12,5,10,133,221,102,181,93,118,215,251,86,5,188,118, 223,133,222,146,114,175,161,20,24,74,241,214,39,139,18,20,48,117,202,177, 230,246,202,208,210,147,109,214,235,239,155,105,85,10,158,252,231,185, 222,130,114,143,111,123,248,248,235,37,9,74,41,206,58,117,132,215,124, 205,160,101,74,162,229,138,115,78,177,254,190,172,169,253,234,7,197,2, 188,102,185,238,158,43,40,46,192,152,241,188,6,188,19,235,66,213,34,41, 49,197,254,225,192,163,142,57,241,158,167,222,76,217,83,232,102,123,78, 49,0,157,91,217,121,250,205,47,237,15,222,113,237,37,171,151,252,220,205, 93,94,54,5,112,198,182,184,213,234,10,100,97,118,197,14,1,86,197,176,44, 213,217,10,180,70,18,128,160,197,123,2,112,88,240,119,121,116,205,229, 209,53,183,71,167,219,192,81,234,164,203,166,37,207,253,223,180,217,94, 143,107,8,176,61,214,5,14,131,36,224,17,187,221,126,197,57,231,156,147, 56,124,248,112,107,114,114,178,86,88,88,168,109,219,182,173,229,242,229, 203,143,90,189,122,245,95,117,93,127,13,184,19,112,199,184,188,129,198, 102,100,100,252,80,159,224,127,202,41,167,132,28,252,191,253,246,219,122, 22,179,161,20,110,93,121,138,156,30,151,174,20,134,130,50,151,215,162, 128,220,82,79,185,161,20,186,161,180,54,105,137,0,86,20,148,148,123,141, 236,98,151,91,55,204,237,139,202,189,22,3,197,142,2,167,71,55,12,77,87, 208,45,43,25,20,86,128,130,114,143,177,45,207,233,213,149,66,215,149,150, 95,230,177,26,192,198,92,135,87,55,12,205,48,160,111,27,80,152,219,55, 51,102,240,191,227,233,43,44,151,254,3,227,133,123,99,93,158,186,100,37, 166,164,126,55,241,180,243,6,253,245,182,251,147,255,216,91,194,129,34, 87,197,155,123,242,28,56,221,58,119,63,241,223,148,215,159,123,96,252, 236,79,222,89,228,118,150,77,36,254,154,179,243,128,87,3,158,3,156,207, 161,102,123,128,2,224,104,223,243,45,190,175,223,7,188,230,79,108,30,3, 222,196,188,130,247,107,232,177,150,135,90,161,230,46,158,19,128,90,131, 191,199,163,107,46,175,161,181,235,57,76,29,53,233,178,148,53,243,222, 253,210,227,114,12,1,244,88,23,188,1,146,128,79,143,61,246,216,9,143,60, 242,72,162,213,106,37,47,47,143,131,7,15,90,173,86,43,29,58,116,224,248, 227,143,167,107,215,174,9,11,23,46,252,199,193,131,7,143,1,38,18,7,73, 192,145,71,30,121,233,246,237,219,223,120,224,129,7,172,233,233,233,44, 95,94,247,191,197,162,162,34,214,175,95,79,255,254,253,217,191,127,63, 251,247,239,175,115,159,253,251,247,83,82,82,194,142,29,59,194,80,234, 122,50,175,226,53,127,240,215,13,67,83,152,205,248,254,224,111,248,222, 243,109,142,82,224,15,254,186,161,52,3,229,123,205,12,254,134,17,184,189, 239,61,95,240,55,148,194,168,56,134,25,252,253,175,197,127,171,119,216, 153,193,255,230,71,204,224,255,246,51,24,47,223,247,6,102,23,64,60,234, 152,148,146,254,211,212,235,110,239,122,198,5,151,39,172,216,94,72,177, 211,115,216,70,121,37,46,150,109,45,224,255,110,184,43,169,107,247,222, 3,94,125,242,158,21,46,103,217,88,96,87,244,139,92,163,221,192,95,170, 188,86,181,37,210,203,225,129,184,160,154,215,118,113,120,221,194,121, 44,17,132,120,77,0,130,10,254,110,143,129,203,227,213,122,12,63,77,219, 190,122,65,247,194,253,219,174,53,12,207,139,177,46,124,3,60,122,236,177, 199,78,120,229,149,87,146,74,74,74,148,63,248,31,60,120,144,252,252,124, 242,242,242,252,15,173,109,219,182,148,151,151,143,42,45,45,125,152,216, 15,74,27,187,99,199,142,215,167,79,159,110,29,60,120,48,110,119,221,249, 72,113,113,49,155,55,111,166,119,239,222,164,164,164,4,181,15,192,210, 165,75,89,191,126,61,67,135,14,109,104,153,27,196,240,53,205,251,3,184, 82,102,159,188,63,248,87,188,86,177,253,161,224,175,43,229,79,22,42,5, 127,255,248,0,252,199,214,171,30,75,225,15,254,94,223,177,154,89,248,215, 128,23,45,55,63,114,133,229,202,59,204,224,255,232,77,111,2,87,19,159, 253,230,3,83,82,211,231,223,246,192,243,45,70,141,59,217,186,243,96,25, 173,50,18,105,149,145,8,64,97,169,153,8,100,165,37,84,236,112,160,168, 156,211,206,185,216,214,182,99,231,206,15,221,118,213,74,103,89,201,9, 196,79,83,187,21,200,240,61,47,166,225,23,91,215,99,254,19,121,169,129, 199,233,3,188,231,123,126,49,176,169,129,199,107,54,226,49,1,24,155,152, 148,242,245,53,119,60,21,84,240,119,187,117,205,237,85,244,57,225,74,251, 210,15,238,185,23,195,243,10,141,179,21,96,160,221,110,191,252,145,71, 30,73,172,35,248,147,159,159,79,126,126,62,118,187,157,210,210,210,107, 128,255,2,235,99,84,110,127,179,191,45,212,102,255,41,83,166,52,138,62, 255,170,178,115,139,45,47,127,240,75,130,191,217,95,41,248,125,227,94, 155,2,140,207,23,39,251,175,214,211,147,172,54,255,96,191,183,62,89,148, 224,111,246,87,10,54,111,221,103,83,10,102,205,94,150,164,48,3,126,11, 123,130,53,55,175,84,83,74,241,241,215,75,18,252,205,254,74,193,174,157, 251,173,10,48,140,53,24,128,97,24,218,214,180,68,45,191,160,172,177,12, 228,109,40,13,120,201,114,243,35,215,86,9,254,87,17,159,193,255,24,171, 45,113,254,209,163,39,166,148,148,148,241,237,215,159,86,122,115,192,144, 17,180,76,111,1,64,162,167,128,63,86,45,173,120,207,55,36,222,114,244, 232,137,45,127,251,113,206,111,94,143,107,28,176,36,90,5,175,197,96,204, 145,247,0,67,105,88,98,50,9,120,198,247,124,19,102,211,126,125,217,129, 225,1,207,69,144,226,45,1,240,93,249,63,19,66,240,55,112,121,189,90,114, 139,238,90,82,102,187,20,199,193,157,103,0,159,199,186,34,245,112,217, 57,231,156,83,169,217,191,166,224,239,127,222,173,91,55,14,28,56,96,3, 46,5,254,25,131,50,55,147,62,255,202,20,160,124,87,223,254,43,255,138, 43,119,252,93,1,134,166,148,245,208,246,128,63,248,27,74,105,254,33,254, 254,224,175,2,142,13,230,49,253,199,82,84,62,190,225,239,114,136,70,101, 227,67,99,11,254,0,46,221,235,126,238,231,185,95,240,243,220,47,170,190, 55,230,250,127,63,57,122,192,152,51,1,88,181,248,103,94,124,240,150,95, 128,133,53,29,43,130,229,140,133,62,152,35,249,253,241,103,38,112,44,245, 191,114,63,0,60,26,240,92,4,41,158,18,128,144,154,253,3,131,191,203,109, 104,185,59,215,80,94,184,95,195,156,63,218,24,156,14,252,199,247,252,70, 96,194,240,225,195,173,193,6,127,143,199,131,199,227,209,48,251,68,39, 198,160,252,205,50,248,3,116,104,157,174,174,185,96,148,39,112,192,159, 255,202,255,252,51,142,41,247,119,11,116,76,79,74,90,181,97,143,69,161, 152,58,229,88,79,224,128,63,255,149,255,164,73,195,220,254,238,129,158, 173,82,18,254,216,156,93,49,218,63,112,192,159,255,202,255,232,81,3,189, 254,110,131,1,237,82,109,11,103,164,90,246,197,248,243,136,176,198,24, 252,1,86,251,30,213,153,6,140,174,242,218,247,68,111,42,107,125,237,192, 28,168,231,127,94,31,45,128,175,124,95,171,190,118,44,102,31,127,168,178, 49,7,68,139,16,197,75,2,80,143,102,255,67,193,255,224,238,181,172,159, 245,184,195,240,186,206,164,241,172,9,240,10,208,209,247,252,3,160,204, 110,183,107,193,6,127,128,131,7,15,250,143,213,53,202,101,111,182,193, 31,14,93,181,87,26,240,7,149,6,245,233,134,58,116,133,94,101,188,128,225, 123,207,127,12,195,55,224,79,249,46,235,85,192,177,2,7,252,25,1,251,155, 231,141,77,253,163,168,177,6,255,166,170,16,248,168,1,251,219,48,175,246, 251,84,243,158,191,85,96,50,230,224,191,80,132,123,108,66,179,97,137,117, 1,48,131,255,236,107,238,120,202,214,99,192,209,245,10,254,127,124,245, 168,63,248,207,139,117,101,234,201,6,100,230,229,229,217,130,13,254,128, 127,224,156,78,116,91,131,71,102,100,100,252,240,241,199,31,7,29,252,247, 239,223,207,156,57,115,152,60,121,114,163,15,254,128,47,72,31,62,224,207, 80,135,130,191,161,14,45,238,99,6,244,202,163,253,253,205,254,254,224, 175,235,102,183,192,161,65,128,70,165,1,127,254,102,127,127,240,215,85, 229,174,131,38,168,177,5,255,17,28,90,181,46,146,142,242,157,43,22,210, 49,251,238,39,249,158,135,234,89,223,190,53,9,28,23,16,138,193,152,115, 255,243,125,207,69,144,98,221,2,208,156,131,255,223,49,175,252,43,126, 6,91,182,108,161,117,235,214,65,5,255,196,196,68,229,118,187,203,49,19, 128,221,81,44,247,228,73,147,38,37,20,23,23,243,245,215,95,7,181,195,218, 181,107,1,88,177,98,5,43,86,172,8,250,68,254,253,226,145,221,102,181,181, 73,75,172,8,244,233,73,86,155,82,86,58,166,39,37,249,175,224,51,83,172, 86,127,128,78,79,182,89,187,101,37,87,140,246,111,97,79,176,130,217,236, 175,124,199,104,105,183,89,193,12,234,45,83,18,45,125,219,152,145,78,55, 148,182,53,45,81,83,192,128,118,169,54,127,2,209,46,61,177,169,14,0,108, 108,193,127,176,53,33,113,129,238,113,63,70,205,205,254,225,50,197,106, 75,188,93,247,186,71,2,191,71,248,92,85,245,2,190,243,61,175,207,32,192, 235,125,15,63,255,63,143,166,250,123,28,247,98,153,0,52,231,224,15,240, 9,112,17,102,18,96,5,243,138,119,216,176,97,161,6,127,128,31,162,89,240, 96,151,247,245,83,170,105,93,167,110,222,117,80,187,236,174,247,173,248, 126,110,138,67,75,251,174,218,176,167,162,85,77,1,91,119,229,90,0,174, 191,111,102,197,34,63,10,200,205,43,213,20,240,199,230,236,132,192,165, 131,119,238,57,104,1,248,215,227,159,162,192,170,12,52,5,20,20,148,2,176, 101,235,62,75,96,203,66,246,190,252,166,246,199,179,177,5,255,46,41,169, 233,63,14,25,49,58,229,183,249,209,185,29,195,49,99,38,166,172,94,246, 235,124,71,105,241,16,162,155,252,199,171,173,192,137,1,207,69,144,98, 213,5,208,220,131,191,95,142,205,102,243,90,44,230,143,97,205,154,53,236, 217,179,39,212,224,175,3,111,71,189,228,113,162,164,164,4,160,109,52,207, 169,0,221,64,121,13,148,215,80,74,215,149,50,251,242,21,94,67,41,175,174, 148,71,87,202,171,27,160,52,133,210,148,110,40,116,243,125,95,23,129,242, 173,27,96,224,53,140,138,175,21,51,6,148,194,168,88,48,72,5,188,126,232, 17,184,206,64,19,209,216,130,127,70,82,74,218,143,255,122,236,181,172, 97,163,79,172,123,235,48,25,54,250,68,238,124,228,63,89,73,41,169,63,83, 121,48,93,164,253,142,121,63,128,150,68,191,245,161,54,37,152,131,40,191, 247,61,23,65,138,69,11,128,4,127,211,216,196,196,196,217,151,95,126,121, 146,174,235,188,249,230,155,232,186,206,111,191,253,70,231,206,157,43, 18,128,58,130,63,152,75,115,110,168,122,240,230,96,215,174,93,172,95,191, 30,162,252,123,220,179,75,43,227,217,187,206,115,57,60,30,101,174,216, 7,51,62,95,146,168,20,92,112,230,8,183,127,192,94,162,205,106,249,247, 99,159,38,2,60,116,219,57,158,98,151,215,48,148,57,29,240,243,175,151, 37,40,224,180,83,134,121,253,3,254,210,147,18,181,7,159,249,220,134,6, 247,220,116,182,126,160,204,165,148,239,150,67,223,126,191,210,170,20, 76,156,56,68,55,124,3,0,219,164,37,106,55,47,250,143,181,56,59,154,181, 39,21,104,79,248,175,180,26,91,240,79,76,76,73,251,246,146,191,222,222, 117,196,168,113,214,175,62,126,175,238,61,194,232,152,209,227,45,151,223, 112,87,167,55,158,127,224,59,183,179,108,12,80,30,133,211,234,212,111, 148,126,164,101,113,168,5,224,59,204,193,138,34,8,209,78,0,36,248,155, 252,193,63,245,200,35,143,36,53,53,149,140,140,12,158,125,246,217,138, 21,242,148,82,120,189,135,6,195,214,16,252,127,4,254,29,237,194,199,131, 221,187,119,243,197,23,95,208,183,111,95,86,174,92,25,221,16,8,56,60,30, 85,224,212,189,254,1,127,78,183,110,51,80,228,150,121,116,255,104,255, 86,118,223,37,186,6,197,46,175,177,167,200,165,251,7,252,21,149,123,149, 1,236,40,112,233,254,209,254,93,179,176,250,6,1,106,7,202,92,106,67,142, 67,247,15,248,59,80,226,182,40,96,77,118,137,210,21,202,80,138,129,237, 211,99,209,130,55,181,77,155,54,211,114,115,115,207,6,22,135,233,152,141, 45,248,107,137,41,105,239,79,58,227,130,33,167,157,119,121,194,158,60, 71,212,11,176,251,160,131,147,207,185,196,182,47,123,215,160,217,159,188, 253,177,219,89,118,38,145,255,172,58,98,78,89,6,120,14,115,250,93,60,232, 206,161,59,4,54,116,129,162,102,37,154,127,64,36,248,155,14,11,254,118, 187,157,19,78,56,129,123,238,185,7,171,213,138,199,227,169,20,252,109, 54,91,117,205,254,47,3,127,2,14,95,88,188,137,43,42,42,226,243,207,63, 231,204,51,207,36,51,51,51,250,5,80,193,173,237,239,111,162,247,223,209, 175,174,181,253,245,192,89,3,6,1,163,253,85,197,226,67,254,239,245,128, 153,1,81,230,61,250,232,163,219,119,232,208,225,99,96,100,24,142,215,216, 130,63,9,73,41,207,15,26,58,242,148,191,220,58,45,121,213,142,66,92,158, 232,23,211,237,53,88,185,189,128,43,110,252,87,210,81,35,142,159,144,144, 108,127,181,238,189,26,172,45,112,135,239,17,213,110,55,17,25,209,106, 1,144,224,111,170,54,248,167,166,166,146,154,154,202,228,201,147,201,200, 200,224,214,91,111,69,215,15,93,232,123,189,94,13,243,134,63,27,49,7,252, 189,77,51,109,246,47,42,42,98,221,186,117,92,112,193,5,116,235,214,141, 237,219,183,71,189,12,10,179,217,191,174,181,253,189,134,170,24,160,103, 160,234,92,219,63,112,197,191,67,231,240,109,239,107,246,175,8,254,186, 17,171,117,0,244,94,189,122,49,101,202,148,206,247,222,123,239,199,251, 246,237,59,31,248,173,158,199,106,116,193,223,102,75,186,173,67,215,30, 255,119,247,147,175,219,215,239,41,161,196,233,165,237,161,28,116,52,102, 112,172,75,213,69,128,234,181,111,105,185,151,117,187,75,248,247,163,175, 216,111,186,252,244,139,118,111,219,184,201,235,118,63,22,196,49,234,203, 193,161,27,241,68,191,217,163,102,254,177,9,96,174,3,32,130,20,141,4,64, 130,191,169,214,224,239,127,126,246,217,103,147,154,154,202,117,215,93, 87,41,9,192,236,123,125,4,248,44,54,197,143,189,221,187,119,179,110,221, 58,6,12,24,64,183,110,221,98,86,142,3,121,37,150,25,159,47,73,244,55,251, 215,180,182,127,106,162,213,114,48,191,84,3,248,252,235,101,9,254,102, 255,154,214,246,223,96,79,208,10,124,107,251,127,251,253,74,171,191,217, 95,25,74,203,217,123,208,2,10,99,137,178,41,101,70,199,130,244,68,173, 168,168,172,166,98,70,138,183,69,139,22,76,154,52,137,78,157,58,117,190, 234,170,171,102,214,51,9,104,116,193,31,171,245,162,180,172,172,105,143, 190,250,169,125,103,158,171,210,45,125,143,28,49,134,171,111,123,200,63, 71,190,78,71,142,24,83,177,218,77,67,246,61,88,236,98,71,146,149,135,94, 254,200,254,215,243,198,223,91,92,144,187,91,215,245,247,67,168,85,40, 54,113,232,86,188,241,36,94,199,38,196,189,72,39,0,18,252,77,65,5,127, 255,215,238,221,187,99,179,217,92,186,174,219,56,116,191,119,27,240,60, 205,52,1,216,189,123,55,159,127,254,57,3,6,12,32,43,43,43,214,197,49,175, 248,235,88,219,63,240,2,93,65,221,107,251,251,251,12,180,67,35,252,85, 197,138,127,234,80,119,2,254,69,134,20,168,168,207,161,214,75,75,75,201, 203,203,163,127,255,254,252,247,191,255,173,79,18,208,248,130,63,140,74, 74,74,249,239,163,111,204,178,151,122,19,216,149,123,232,66,179,176,204, 77,171,244,86,12,159,116,126,45,187,87,166,128,194,18,51,129,104,200,190, 0,187,114,29,164,38,101,240,232,27,179,236,55,94,56,238,117,221,81,186, 19,248,53,232,3,54,126,93,128,187,124,207,31,64,166,70,6,45,146,9,128, 4,127,83,72,193,127,213,170,85,76,153,50,165,204,229,114,157,9,180,1,222, 37,246,11,54,197,148,63,248,159,121,230,153,236,222,29,251,127,219,109, 90,166,27,23,156,57,194,29,56,224,175,186,181,253,91,167,37,88,55,110, 201,182,104,154,57,218,63,112,192,95,117,107,251,247,104,153,108,221,182, 45,199,162,105,230,104,127,223,128,63,115,74,160,239,202,191,231,176,126, 186,127,60,193,144,14,105,214,37,31,166,170,40,223,253,196,107,177,88, 200,206,206,70,215,245,138,36,224,234,171,175,158,153,157,157,125,254, 180,111,183,108,245,186,221,71,3,189,53,77,181,4,80,74,203,183,40,235, 38,139,183,124,249,180,115,142,202,165,241,5,255,90,25,6,120,244,208,139, 110,248,118,105,200,190,85,69,120,102,104,188,222,118,183,21,112,141,239, 249,203,72,2,16,180,72,5,22,9,254,166,122,5,255,178,178,178,192,122,187, 129,23,124,207,175,141,77,53,98,39,48,248,119,235,214,45,46,18,0,255,213, 124,157,107,251,235,230,24,0,255,74,127,193,174,237,175,204,215,52,255, 104,255,138,165,134,3,207,225,219,62,6,195,0,116,171,213,108,148,202,201, 201,1,160,127,255,254,188,246,218,107,157,175,251,219,13,95,174,249,238, 179,185,3,142,63,53,79,179,104,86,148,57,200,88,211,104,109,40,111,47, 18,18,38,140,56,227,226,65,43,250,28,57,89,187,162,209,5,255,95,93,46, 231,85,119,92,126,218,107,47,127,188,32,181,107,27,59,187,114,205,110, 240,150,233,137,135,221,210,183,46,181,221,14,56,216,125,11,202,220,0, 116,109,99,39,205,230,225,175,87,156,230,240,186,156,87,17,185,171,255, 120,189,237,110,188,142,77,136,123,145,72,0,36,248,155,194,17,252,193, 108,242,111,214,205,254,254,224,31,79,2,131,119,77,107,251,27,190,102, 123,141,202,193,191,174,181,253,53,2,110,54,228,31,240,135,127,54,129, 47,89,240,157,55,6,42,22,174,130,202,73,192,203,47,60,223,250,111,255, 184,229,44,91,114,242,130,190,35,39,22,130,102,110,168,148,97,177,104, 158,173,203,23,78,106,125,234,197,253,135,14,29,197,202,119,158,109,76, 193,223,164,235,239,151,22,21,118,190,227,154,115,238,125,246,237,111, 82,203,221,122,197,56,128,32,110,233,27,40,212,219,1,215,184,111,235,140, 36,186,183,74,230,166,203,79,119,148,20,230,79,143,96,255,63,64,30,230, 186,35,254,231,241,34,94,199,38,196,189,112,39,0,18,252,77,225,10,254, 113,199,110,183,183,61,112,224,0,235,214,173,11,122,31,127,144,8,12,28, 117,201,206,206,230,179,207,62,227,236,179,207,166,107,215,104,223,236, 176,110,137,54,171,165,149,221,28,3,224,53,148,150,154,104,181,40,204, 102,127,229,11,254,246,68,155,217,2,0,164,39,37,106,93,179,176,234,190, 49,0,27,236,9,154,82,102,179,191,63,129,200,178,39,104,40,5,154,70,155, 180,68,109,96,251,116,139,97,152,163,253,11,210,19,53,80,28,213,33,173, 98,251,246,25,9,21,99,15,162,168,162,5,192,47,48,9,120,225,153,39,83,111, 184,233,214,9,22,171,109,101,239,225,199,155,29,229,154,166,239,221,184, 102,64,121,231,238,61,146,122,13,164,237,154,37,12,91,187,244,135,165, 141,41,248,251,120,189,174,199,247,237,218,222,237,254,91,174,188,252, 222,103,254,103,119,186,43,13,212,13,246,150,190,211,168,255,237,128,43, 246,77,75,182,49,176,75,58,15,220,122,181,99,207,142,173,239,123,189,17, 157,1,0,102,211,250,95,34,124,14,17,69,225,76,0,36,248,155,154,108,240, 247,51,12,163,210,10,133,117,241,207,102,8,101,31,128,51,206,56,35,46, 131,255,142,61,121,230,10,127,1,77,240,254,209,254,27,183,100,91,224,208, 235,123,178,243,45,0,15,62,243,185,205,255,154,2,10,10,202,52,20,108,219, 150,115,104,123,165,216,159,83,160,1,60,246,252,87,86,255,61,20,20,80, 236,27,237,191,115,199,1,45,240,248,185,7,10,162,61,8,208,91,93,34,23, 152,4,60,247,212,227,41,127,191,229,246,225,246,204,172,141,29,123,31, 233,200,223,179,173,187,167,109,135,246,137,157,122,224,217,177,145,212, 156,61,155,135,93,243,175,63,78,188,250,206,54,15,157,53,56,39,202,229, 111,48,143,203,121,195,218,149,139,219,255,231,137,123,79,187,250,230, 233,201,121,165,238,168,151,33,209,102,97,104,143,22,188,241,220,131,229, 171,151,254,60,207,83,238,184,166,238,189,26,44,94,111,187,27,175,99,19, 226,94,184,18,128,81,137,73,201,179,255,242,207,103,108,221,251,13,11, 57,248,231,238,92,195,250,89,143,59,12,175,235,116,96,126,152,202,20,11, 77,62,248,59,28,142,3,237,219,183,103,200,144,33,65,239,243,251,239,230, 178,225,131,7,135,118,167,206,120,190,27,160,127,125,126,243,155,202,183, 254,61,108,36,150,2,175,170,60,199,223,240,237,160,27,254,227,248,215, 251,55,191,115,123,141,74,199,208,13,243,61,183,110,84,58,78,60,180,0, 248,229,228,228,144,148,148,68,255,254,253,233,211,187,183,213,237,116, 100,150,230,31,232,170,103,181,202,74,108,213,22,45,123,23,246,252,220, 221,29,142,26,185,82,211,84,138,134,229,88,224,139,232,22,63,44,148,219, 89,122,241,247,95,205,156,223,177,75,247,163,207,157,122,117,194,202,40, 23,160,75,107,59,159,191,255,63,239,236,79,222,94,231,118,150,157,71,116, 90,82,6,3,254,170,198,211,138,123,241,58,54,33,238,133,37,1,176,167,102, 188,248,246,253,195,83,90,182,252,154,237,110,221,187,91,31,98,72,240, 111,122,193,63,30,85,89,43,33,42,186,118,106,105,220,115,243,20,79,153, 219,171,252,125,254,95,207,94,158,160,20,156,114,210,48,143,249,154,161, 165,38,88,181,39,94,248,42,193,0,174,255,203,100,111,177,203,80,74,87, 24,40,109,193,252,53,86,133,226,184,177,71,234,254,129,131,105,137,86, 237,205,55,190,181,41,5,231,79,157,164,23,187,116,229,239,243,95,189,104, 157,69,1,253,142,238,175,252,171,16,102,36,219,216,191,232,63,150,210, 253,81,173,126,181,45,0,96,118,241,216,237,118,54,111,222,172,242,60,86, 215,224,94,3,219,120,18,18,236,73,169,233,184,11,14,146,84,86,156,219, 242,136,129,155,208,180,4,133,150,96,213,212,0,26,103,2,0,224,118,59,75, 79,121,231,165,199,150,119,235,209,187,7,135,166,235,70,197,146,133,63, 26,111,62,255,192,94,183,179,236,68,162,115,31,128,170,46,39,124,75,1, 7,179,0,82,109,50,128,5,192,54,32,202,147,98,26,183,112,36,0,67,186,180, 75,232,219,43,115,183,69,211,13,90,234,235,18,219,171,97,198,47,222,203, 61,30,79,114,157,205,254,190,224,127,38,141,59,248,31,151,144,144,48,231, 138,43,174,176,15,30,60,184,206,224,191,124,249,114,254,244,167,63,149, 57,28,142,198,158,244,196,212,142,29,59,88,180,104,81,25,48,59,154,231, 53,148,210,202,220,94,117,160,212,83,177,182,127,169,75,87,6,144,93,226, 54,124,3,254,84,187,180,4,139,129,175,9,223,101,168,125,69,46,195,55,224, 79,21,151,123,45,10,216,93,80,94,49,213,175,99,102,18,84,108,175,171,221, 133,229,202,55,224,79,21,150,123,81,74,177,203,124,13,67,65,167,140,68, 75,12,198,1,122,107,106,1,104,219,182,45,22,139,133,151,255,251,150,126, 228,228,11,173,150,20,123,114,146,45,1,183,163,12,171,219,85,156,218,177, 219,110,80,86,192,170,41,101,197,98,105,21,221,162,135,93,177,203,89,58, 241,161,59,174,89,57,100,196,232,168,213,101,197,47,223,177,122,233,175, 5,46,103,217,88,162,187,0,206,14,224,163,227,38,158,62,106,226,228,179, 71,107,22,107,131,178,111,71,105,201,22,0,123,90,250,57,13,45,216,130, 111,191,76,255,121,238,103,243,137,159,251,19,52,10,13,78,0,146,83,210, 238,184,113,234,145,9,26,59,43,94,235,164,173,176,156,156,144,157,248, 165,243,70,189,196,211,66,53,241,62,127,146,147,147,111,56,233,164,147, 36,248,71,209,206,157,59,121,239,189,247,202,60,30,207,153,132,239,166, 52,193,81,161,173,237,143,2,165,171,32,214,246,87,21,107,251,7,142,246, 55,167,1,42,223,109,136,253,247,31,48,52,21,155,225,115,122,117,45,0,137, 137,137,180,106,213,138,197,75,150,168,146,164,22,222,94,93,142,72,198, 150,0,94,15,54,143,219,185,111,207,182,226,226,220,236,148,142,189,7,29, 90,65,39,70,21,8,179,221,206,178,146,9,75,22,206,139,218,239,224,146,133, 243,156,186,215,61,129,232,207,119,47,4,254,56,233,204,243,59,29,117,220, 132,246,249,37,46,87,93,59,212,193,63,40,40,189,33,7,105,153,158,148,100, 181,90,247,255,60,183,89,78,150,106,144,134,38,0,173,147,172,222,179,70, 118,59,112,216,37,65,166,101,191,118,122,250,179,214,25,7,110,210,221, 238,228,38,27,252,1,52,77,59,182,95,191,126,65,53,251,159,123,238,185, 101,14,135,163,177,183,120,196,84,97,97,33,63,253,244,83,153,219,237,142, 201,239,143,162,114,240,175,105,109,127,3,51,160,155,235,6,84,153,215, 95,211,218,254,190,12,192,127,229,175,43,240,42,223,148,65,127,226,225, 75,50,252,231,141,178,106,187,0,58,118,236,136,219,237,230,141,25,51,245, 174,103,95,151,236,77,77,67,149,149,82,186,107,139,115,205,183,51,245, 44,139,171,253,230,45,91,218,30,55,245,166,210,158,67,71,23,40,77,211, 53,84,60,77,37,107,136,223,117,175,123,28,230,154,29,145,246,153,238,117, 207,194,92,255,62,102,242,75,92,174,117,187,75,226,98,221,253,129,93,42, 6,38,138,16,53,40,1,176,217,18,175,187,234,194,33,22,27,7,170,29,137,220, 194,154,163,157,156,249,174,245,157,210,43,140,166,26,252,129,100,183, 219,221,185,119,239,222,149,2,190,244,249,71,70,97,97,33,43,87,174,116, 235,186,30,179,207,209,89,238,230,235,217,203,19,252,205,254,53,173,237, 159,150,108,211,138,10,202,52,5,44,152,191,198,234,111,246,175,105,109, 255,236,100,171,86,82,108,174,99,178,122,209,58,139,191,217,95,1,197,57, 249,154,185,64,208,38,171,255,238,130,206,100,27,206,82,167,102,73,76, 205,50,220,81,187,39,192,97,131,0,51,50,50,72,79,79,231,203,175,103,41, 173,207,8,155,173,219,17,20,239,218,202,238,5,95,150,167,148,29,72,184, 247,198,43,146,251,246,237,171,109,216,176,129,191,221,116,203,96,175, 199,83,212,231,152,113,121,186,50,254,136,86,161,163,32,248,149,124,26, 102,117,148,206,35,154,129,134,36,0,54,205,98,253,251,105,71,147,88,219, 70,189,237,107,181,238,201,107,45,107,242,251,208,4,131,63,192,81,173, 91,183,118,102,102,102,38,200,128,191,200,218,185,115,39,171,87,175,118, 234,186,126,3,177,252,28,3,86,230,171,109,109,255,192,203,115,255,54,181, 173,237,127,104,38,129,255,189,67,43,12,86,188,23,176,96,80,108,214,1, 170,220,2,96,177,88,232,208,161,3,133,133,133,124,50,255,55,173,221,229, 255,102,231,247,159,96,172,95,228,249,191,11,206,73,58,118,228,72,205, 48,12,138,139,139,205,117,2,158,126,50,249,250,127,220,124,156,215,237, 46,24,60,241,140,250,222,69,80,8,17,6,13,73,0,166,76,26,213,53,185,101, 66,245,87,255,129,198,100,253,164,205,91,237,86,77,48,248,3,28,219,167, 79,31,91,77,87,254,210,231,31,30,59,119,238,100,198,140,25,254,62,255, 152,254,254,36,39,39,114,202,73,195,60,1,3,254,170,93,219,191,67,122,162, 117,251,246,28,139,82,112,220,216,35,245,192,1,127,85,215,246,55,148,162, 115,102,146,37,123,79,174,85,41,69,191,163,251,171,192,1,127,254,43,255, 86,253,123,25,254,219,16,119,205,74,97,253,23,41,20,186,203,10,163,88, 253,74,45,0,173,90,181,34,49,49,145,247,62,250,216,85,146,144,158,100, 188,249,16,83,70,31,109,76,190,236,254,132,228,228,100,242,242,242,200, 201,201,193,48,12,218,181,107,231,79,2,82,175,187,254,134,9,159,60,122, 83,15,154,238,168,237,163,128,83,106,120,47,212,219,1,207,65,174,252,69, 4,212,59,1,72,178,167,253,235,210,211,59,166,16,48,248,175,58,6,26,133, 69,37,254,43,255,166,22,4,199,39,37,37,61,116,246,217,103,219,3,251,254, 173,86,43,27,55,110,100,245,234,213,76,159,62,93,130,127,3,249,130,191, 35,86,125,254,85,249,175,202,235,92,219,191,210,246,190,190,254,26,214, 246,55,239,5,160,42,205,239,175,52,224,79,5,142,1,80,21,231,141,229,24, 0,155,205,70,219,182,109,201,206,206,102,217,242,213,123,206,28,118,84, 231,179,78,155,156,212,162,69,11,75,73,73,9,155,54,109,194,237,62,212, 45,158,147,147,131,213,106,101,192,128,1,188,252,226,243,173,175,186,234, 170,153,251,247,239,63,159,104,15,226,140,142,36,171,45,241,222,163,70, 140,78,25,62,230,196,195,222,12,230,118,192,43,22,126,199,170,101,191, 56,117,143,251,199,40,148,87,52,67,245,77,0,134,180,111,153,216,167,111, 139,61,53,174,237,234,210,147,248,105,115,134,241,218,39,155,221,219,246, 238,223,96,120,93,215,211,180,110,81,57,58,41,41,105,214,244,233,211,237, 195,134,13,99,251,246,237,124,254,249,231,142,53,107,214,120,247,236,217, 99,79,75,75,219,165,148,90,236,112,56,158,3,22,197,186,176,141,149,111, 180,191,211,237,118,159,65,28,4,127,63,93,153,83,253,106,95,219,255,208, 34,63,53,173,237,175,251,111,236,227,11,246,202,151,1,4,6,127,51,216,227, 159,5,160,25,134,185,176,144,239,94,0,81,191,29,112,96,11,128,97,24,180, 109,219,150,127,221,250,247,94,254,129,128,59,119,238,164,184,184,250, 241,97,217,217,230,44,173,1,3,6,240,223,255,254,183,235,213,87,95,253, 241,190,125,251,206,165,233,37,1,75,116,175,123,196,250,53,203,126,60, 253,252,203,90,142,26,127,178,53,59,223,137,219,107,166,133,138,234,111, 7,156,104,179,208,177,101,10,75,127,251,201,120,247,165,135,11,117,143, 251,4,226,103,193,29,209,196,212,43,1,72,78,73,189,227,250,63,31,149,100, 169,230,234,255,128,179,5,95,45,193,253,230,39,235,12,167,71,251,94,119, 59,31,164,105,6,192,19,207,62,251,108,251,177,199,30,203,250,245,235,185, 249,230,155,203,156,78,231,93,152,73,206,154,194,194,194,88,44,206,209, 164,236,220,185,147,247,223,127,191,220,229,114,157,78,28,5,127,133,34, 53,193,170,181,75,75,176,232,190,209,254,105,201,54,13,101,54,251,155, 87,246,138,180,196,4,205,127,69,159,150,104,213,58,102,38,85,220,197,47, 59,217,170,41,5,93,50,147,44,254,133,128,210,147,14,221,59,32,35,217,102, 206,243,247,141,246,119,38,219,80,64,215,172,148,138,59,14,102,36,91,181, 232,55,0,28,106,1,240,122,189,108,219,182,141,158,61,123,210,190,125,123, 246,239,223,79,94,94,30,70,77,247,170,245,169,146,4,116,190,234,170,171, 62,222,183,111,223,249,64,83,27,19,176,206,89,86,50,228,209,127,253,109, 254,212,235,110,239,118,198,5,87,36,174,218,94,72,177,179,242,146,216, 121,37,102,43,73,90,178,141,161,61,91,48,235,147,247,60,175,62,113,247, 94,87,185,99,28,176,43,6,229,22,205,68,125,18,128,214,22,188,103,141,237, 157,87,113,245,175,208,88,119,176,163,122,123,214,126,231,188,69,107,61, 134,87,127,193,48,188,207,0,7,195,86,210,56,180,101,203,22,102,204,152, 193,187,239,190,91,230,116,58,155,77,51,255,134,13,27,248,252,243,207, 131,222,126,255,126,115,169,186,173,91,183,6,189,143,219,237,230,203,47, 191,116,151,151,151,79,38,206,62,215,157,155,214,107,183,95,54,37,33,96, 154,63,133,5,230,189,0,150,124,148,170,249,7,4,42,208,114,246,23,104,10, 197,99,75,95,183,42,168,72,8,74,124,107,251,175,254,44,213,90,49,160,79, 65,126,174,185,182,127,206,210,215,205,123,4,248,78,226,40,41,211,0,54, 124,101,247,159,83,83,10,10,118,110,140,70,149,3,85,106,1,112,185,92,108, 222,188,25,48,19,130,96,249,147,128,254,253,251,251,147,128,153,77,52, 9,200,118,57,75,143,121,231,229,71,191,219,187,115,235,160,191,222,254, 64,242,31,123,75,42,238,34,232,215,42,61,137,193,93,51,248,239,51,247, 187,230,124,246,238,70,119,185,99,34,241,117,199,61,209,4,133,156,0,216, 108,182,235,46,61,119,168,37,69,59,160,57,244,52,126,218,210,74,127,229, 253,85,174,189,7,178,119,123,92,206,135,128,247,57,180,192,67,83,246,217, 242,229,203,147,151,47,95,14,240,57,77,179,149,163,58,255,91,179,102,77, 242,154,53,107,130,222,193,110,183,183,1,112,56,28,185,33,158,235,51,226, 175,105,248,81,71,73,145,119,221,210,202,119,110,181,38,166,182,0,216, 183,165,172,160,186,157,138,247,86,127,176,154,62,144,146,208,214,51,123, 50,164,173,27,230,176,117,0,66,9,252,129,2,147,128,251,238,187,175,243, 61,247,220,211,84,147,128,66,183,179,108,244,188,111,62,250,48,103,239, 174,147,238,121,234,77,123,106,178,141,237,57,102,18,216,185,149,157,158, 109,146,184,255,214,43,29,171,151,44,252,201,93,94,118,14,224,140,109, 145,69,115,16,106,2,96,195,146,240,247,65,189,210,19,95,252,30,215,187, 159,175,84,30,195,242,189,215,213,100,155,249,107,179,154,230,57,50,119, 7,112,103,40,59,56,28,142,200,148,36,54,230,248,30,149,232,209,155,135, 31,107,94,183,219,93,209,212,239,127,232,186,94,227,247,254,231,53,109, 147,154,154,74,81,81,17,71,31,125,116,231,69,139,22,125,154,155,155,59, 22,216,18,235,138,134,153,219,237,116,156,179,118,229,162,39,255,126,233, 228,107,30,125,237,179,212,228,206,230,250,53,105,9,58,255,248,191,51, 202,246,238,216,250,174,199,229,248,43,141,236,22,201,162,241,10,117,0, 209,25,192,151,182,132,228,60,67,121,159,49,188,222,87,104,226,205,252, 66,136,74,108,64,75,32,1,243,6,56,182,128,71,93,223,7,179,141,21,120,3, 104,178,25,149,205,150,116,115,90,102,230,3,143,190,57,43,197,162,89,184, 253,138,211,28,37,5,249,79,123,189,238,187,98,93,182,32,28,245,218,231, 191,222,172,165,181,29,17,63,43,1,166,103,168,210,3,75,175,62,123,212, 83,52,207,139,178,168,73,193,76,2,194,117,27,97,33,132,104,118,172,86, 235,133,73,246,180,178,36,123,90,153,213,106,189,48,214,229,17,66,8,33, 68,244,28,231,123,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,136,144, 104,177,46,128,16,77,212,72,96,124,148,206,245,33,176,35,74,231,18,161, 179,1,237,128,78,64,91,32,211,247,90,26,230,223,224,18,64,7,138,128,3, 64,54,176,31,240,196,162,176,117,248,25,24,83,229,181,50,204,186,4,106, 11,228,212,112,140,135,128,127,87,121,237,65,224,95,53,108,223,14,243, 115,9,84,10,164,86,121,109,33,48,182,134,99,136,106,216,98,93,0,33,154, 160,241,246,164,148,185,147,134,157,144,96,181,88,34,122,162,149,155,215, 176,227,192,142,20,96,90,68,79,36,66,209,7,152,152,150,146,54,70,67,27, 238,246,186,59,165,219,211,189,157,219,116,86,29,178,218,39,164,167,164, 89,45,86,155,213,158,104,183,40,5,206,114,135,242,26,30,79,177,163,68, 229,20,28,240,236,205,223,163,21,59,138,109,86,75,66,54,24,43,157,110, 231,66,224,71,96,93,140,235,5,135,7,255,120,18,207,101,139,75,146,0,8, 17,94,99,237,73,246,185,183,95,112,75,194,224,30,3,35,122,162,173,187, 246,176,117,251,94,26,217,197,191,21,232,10,116,6,178,0,11,230,149,111, 54,102,69,220,177,42,88,3,117,78,78,76,254,75,130,53,97,106,106,82,106, 230,196,161,227,237,125,59,247,73,106,155,213,150,12,123,6,22,139,217, 216,170,20,128,170,238,107,162,249,190,2,192,227,245,82,80,82,216,103, 95,94,78,159,173,217,91,166,252,178,254,23,71,73,121,73,137,161,140,15, 220,94,247,203,192,246,24,212,49,80,93,173,199,7,130,216,38,208,191,57, 188,85,160,54,85,91,28,84,8,251,10,31,233,2,16,34,124,198,218,147,236, 63,68,43,248,175,89,187,137,53,123,151,179,38,123,249,116,226,187,5,160, 149,197,98,57,55,35,37,227,34,143,238,25,156,153,154,169,183,201,104,163, 217,19,237,54,52,52,103,185,211,123,176,244,160,81,80,90,96,179,89,108, 91,202,221,229,31,185,188,174,247,129,61,177,46,120,16,90,164,38,167,62, 105,181,90,167,76,25,117,150,125,204,192,81,137,153,105,153,160,148,25, 145,124,95,253,129,189,150,4,192,247,190,58,236,171,2,12,195,224,64,254, 65,150,172,95,234,153,187,250,219,50,93,233,115,202,61,229,55,2,185,209, 171,170,89,36,223,215,120,139,29,241,90,174,184,38,31,150,16,225,17,245, 224,15,196,123,2,208,53,45,57,237,110,139,197,50,101,68,239,163,147,135, 244,28,154,218,181,77,23,172,22,155,25,216,170,60,116,67,103,111,94,54, 107,119,174,45,95,186,117,105,153,87,247,252,92,234,44,189,27,88,27,235, 138,212,160,127,106,114,234,119,231,140,62,171,245,233,35,39,39,89,172, 182,195,2,127,184,18,128,67,199,131,50,167,147,111,22,207,245,204,251, 125,110,158,75,119,157,10,172,140,74,109,125,69,244,125,213,0,214,174, 95,185,40,138,231,62,204,160,254,67,143,245,61,149,4,160,30,164,11,64, 136,134,139,73,240,143,99,214,148,196,148,219,18,19,18,111,57,117,196, 169,89,199,246,29,105,75,176,38,248,2,61,213,6,127,51,224,105,116,108, 217,137,14,45,58,38,79,24,60,49,249,247,157,107,206,154,179,114,206,241, 46,79,249,12,135,203,113,7,224,140,117,197,2,100,166,167,164,207,254,231, 133,183,119,236,211,249,8,13,162,215,6,109,79,73,230,79,227,206,72,232, 213,190,71,251,215,190,127,245,107,151,183,124,40,135,15,146,19,162,78, 209,76,0,194,49,42,90,70,59,139,120,35,193,191,178,214,105,41,105,159, 244,239,210,127,200,133,199,95,144,97,79,178,7,4,249,154,131,191,81,229, 125,139,102,225,200,110,71,105,253,58,246,111,249,221,234,185,87,173,220, 190,226,132,50,87,217,25,192,182,88,87,208,231,180,9,71,29,223,186,111, 151,222,154,255,10,61,154,52,52,142,234,59,136,137,251,39,182,158,189, 234,155,115,129,151,162,116,234,191,68,233,60,161,138,215,114,197,181, 104,37,0,227,237,54,219,172,171,6,14,180,219,234,57,42,186,116,231,78, 94,205,207,151,209,206,34,158,72,240,175,172,115,90,114,218,15,103,28, 115,122,143,113,131,199,37,84,14,242,193,7,255,192,135,205,106,227,148, 161,147,83,186,181,233,222,255,139,165,159,45,44,45,47,157,12,172,142, 117,69,129,54,3,186,15,72,142,101,1,52,160,127,247,126,137,223,173,153, 219,206,107,120,163,117,218,87,163,117,162,16,197,107,185,226,90,52,18, 128,177,169,9,9,95,207,156,60,217,62,174,83,167,122,29,96,213,234,213, 172,116,185,194,92,44,33,26,68,130,127,101,173,211,146,211,126,184,112, 220,133,189,142,238,61,220,26,142,224,31,184,127,223,142,253,180,11,70, 93,212,225,131,95,223,155,93,86,94,54,14,216,28,235,10,187,189,177,159, 176,224,116,58,98,93,4,209,136,69,118,146,178,25,252,103,207,156,60,57, 181,65,193,127,117,60,36,252,66,84,144,224,95,153,53,45,37,237,147,51, 70,158,222,35,18,193,223,255,188,75,171,174,156,117,244,57,237,83,146, 82,103,1,233,177,174,244,190,188,125,49,157,122,86,238,114,177,118,219, 134,88,22,65,52,114,145,76,0,36,248,139,166,104,164,61,41,229,135,59,47, 188,85,130,191,79,74,98,202,109,253,187,244,31,26,174,102,255,154,246, 55,148,162,87,251,35,180,17,61,71,116,73,73,76,121,49,214,245,54,148,129, 210,20,74,25,81,63,119,81,73,41,171,215,109,198,41,45,163,162,1,34,213, 5,32,193,95,52,85,147,143,236,54,44,161,164,72,103,209,234,223,35,122, 162,125,123,163,61,197,187,94,186,37,38,36,222,114,193,241,231,167,71, 58,248,43,204,231,163,250,142,73,254,99,239,218,211,156,110,231,113,192, 111,49,173,189,194,44,155,97,96,209,52,52,45,178,179,208,202,156,78,246, 238,203,97,127,110,30,186,30,253,196,3,152,233,251,122,126,44,78,94,139, 120,45,87,92,139,68,2,48,210,110,179,205,249,248,212,83,237,99,59,118, 172,215,1,36,248,139,120,102,137,240,242,190,141,73,90,114,218,93,167, 30,61,57,43,53,41,53,42,193,223,156,33,96,101,210,160,83,90,126,185,226, 243,199,29,229,165,113,177,252,171,82,10,183,174,87,204,96,176,88,52,44, 90,195,127,79,20,80,94,238,162,160,168,152,188,130,34,74,74,202,240,26, 122,44,215,189,59,47,102,103,174,93,188,150,43,174,69,34,1,152,252,193, 128,1,246,99,55,109,194,179,169,126,205,151,43,119,237,10,115,145,132, 16,17,208,202,106,181,78,57,174,223,113,182,104,5,127,255,251,221,219, 244,32,45,49,181,159,163,188,116,8,176,42,198,159,67,5,165,20,110,175, 7,195,48,48,12,5,154,194,170,89,64,3,77,211,208,176,112,40,127,212,124, 171,252,233,24,134,249,213,237,241,226,118,123,112,185,220,56,202,157, 148,148,58,240,120,189,24,134,129,174,27,40,89,241,86,132,81,68,186,0, 172,17,110,6,19,66,196,158,197,98,57,119,248,17,195,147,109,86,91,84,131, 191,255,49,180,251,240,22,63,173,255,241,74,167,199,121,67,12,170,95,231, 31,57,133,66,247,234,184,13,15,186,97,96,232,134,249,213,23,204,13,163, 134,239,3,182,51,140,152,52,243,139,102,66,218,50,133,16,245,146,145,146, 113,209,208,158,67,83,99,17,252,149,82,244,106,215,219,162,89,180,51,99, 253,57,8,209,88,53,182,165,128,71,3,119,212,242,254,28,226,99,145,16,136, 238,253,224,253,226,169,254,87,0,231,70,249,156,111,2,31,69,249,156,205, 149,213,163,123,6,119,109,211,37,38,193,95,41,133,61,209,78,146,45,217, 238,112,57,186,0,187,99,253,129,8,209,216,52,170,4,96,232,176,33,147,134, 14,27,58,169,186,247,54,172,223,192,175,191,252,150,66,124,4,192,241,41, 41,41,179,206,191,240,92,187,213,26,157,143,56,206,234,255,143,204,164, 164,167,159,158,58,149,196,196,196,136,159,236,155,197,139,249,125,229, 74,126,87,42,27,73,0,162,165,107,102,106,166,94,211,141,125,34,29,252, 253,143,182,25,237,44,5,101,249,253,144,4,32,90,10,98,93,128,26,196,107, 185,226,90,36,162,83,215,8,28,19,128,99,143,27,201,95,255,118,237,97,175, 239,216,177,147,143,62,244,240,235,47,177,157,17,228,51,54,37,37,229,235, 231,95,122,198,62,242,216,99,162,114,194,56,171,255,245,89,73,73,79,175, 120,246,89,58,166,167,99,108,139,208,210,237,86,43,9,39,157,68,246,242, 229,188,252,238,187,156,222,167,55,191,111,220,212,24,110,31,219,84,116, 109,157,209,218,18,203,224,175,20,180,72,109,149,74,4,255,230,136,195, 180,140,117,1,106,16,175,229,138,107,225,78,0,198,218,108,182,169,97,62, 38,0,243,53,141,115,142,31,125,216,235,59,118,236,100,199,246,29,145,56, 101,125,140,77,73,73,153,253,252,75,207,164,6,6,255,79,63,253,156,205, 27,55,211,166,77,235,122,31,120,244,152,209,244,237,215,231,176,215,227, 172,254,215,103,38,38,190,176,226,153,103,232,152,156,140,243,145,71,192, 27,129,53,202,173,86,82,254,241,15,246,173,90,197,197,183,222,202,213, 19,199,145,157,189,47,252,231,17,181,73,79,77,76,181,198,50,248,43,165, 72,180,37,38,90,44,150,12,25,44,39,68,232,194,153,0,140,77,73,73,153,125, 226,73,39,36,176,35,188,173,113,243,53,141,201,207,63,201,145,71,14,174, 244,122,156,5,191,106,131,255,59,111,207,224,169,39,158,161,99,199,142, 244,232,209,61,228,131,238,218,181,139,236,189,251,56,122,196,209,135, 189,23,103,245,191,62,51,49,241,133,149,207,62,75,199,148,20,156,79,62, 25,209,224,127,0,184,232,166,155,184,122,226,56,58,117,238,36,9,64,244, 153,183,192,141,97,240,55,148,66,67,211,104,100,93,153,66,196,139,112, 253,195,169,8,126,203,151,173,32,156,9,128,63,248,87,109,78,143,179,224, 87,109,240,127,239,221,247,121,254,153,23,25,49,226,104,82,83,237,76,58, 241,132,144,14,186,125,251,14,86,173,92,205,139,175,60,199,145,71,197, 117,242,19,211,224,47,98,162,172,220,93,174,199,50,248,43,165,112,121, 202,61,134,97,20,197,250,195,16,162,49,10,199,52,192,106,131,95,56,52, 230,224,255,254,123,31,240,236,211,47,240,252,75,207,48,100,232,81,33, 31,116,251,246,29,124,240,222,76,158,124,230,177,120,175,191,4,255,230, 105,111,110,73,174,17,203,224,175,148,162,208,81,88,10,200,216,143,232, 233,233,123,196,155,120,45,87,92,107,104,2,32,193,191,134,224,255,204, 147,207,243,220,139,79,31,86,254,96,72,240,175,66,130,127,60,218,94,88, 90,104,211,13,61,102,193,95,41,197,193,146,3,94,32,254,239,152,212,116, 108,245,61,226,77,188,150,43,174,53,164,11,160,198,224,63,167,176,16,91, 203,250,13,202,244,26,6,243,53,141,211,94,124,154,17,199,84,238,247,142, 179,224,87,253,128,191,143,63,227,177,135,159,100,244,152,81,172,91,187, 142,117,107,215,177,114,197,42,14,30,60,200,130,249,63,213,121,80,143, 199,203,146,37,75,121,230,185,39,227,189,254,18,252,155,55,183,213,98, 221,146,157,159,61,162,67,139,78,49,9,254,229,30,39,165,238,82,29,249, 195,47,68,189,212,55,1,168,49,248,159,61,229,76,62,116,185,249,176,1,133, 58,231,95,183,52,202,1,127,0,169,105,105,12,24,216,159,130,130,2,126,248, 254,199,138,215,7,13,30,68,203,32,147,162,75,46,251,51,195,134,15,173, 244,90,156,213,255,250,172,164,164,23,86,60,251,44,93,134,12,193,253,213, 87,36,158,122,106,68,78,100,29,56,144,28,167,179,98,180,191,4,255,248, 81,238,46,255,232,247,157,107,143,108,159,213,49,41,218,193,95,41,197, 206,131,59,148,166,248,142,88,222,26,71,136,70,172,62,9,192,177,41,41, 41,115,94,124,229,57,123,213,43,84,128,142,157,58,114,211,45,55,54,188, 100,1,130,9,126,81,156,6,84,107,253,79,62,229,68,78,62,229,196,176,158, 48,206,234,127,85,130,166,189,48,245,152,99,88,191,99,7,235,119,236,48, 95,141,208,253,31,28,75,151,242,204,255,222,228,154,19,38,208,177,83,205, 119,151,108,174,211,192,140,24,220,139,222,207,229,117,189,191,116,203, 210,59,38,12,154,152,100,209,44,81,13,254,74,41,214,237,93,147,239,244, 56,255,27,179,15,64,136,70,174,62,9,192,41,55,252,253,122,123,102,102, 38,155,54,110,14,123,129,170,147,157,157,93,251,251,123,179,89,240,227, 130,114,204,165,112,35,173,185,215,127,248,99,3,7,208,49,37,137,210,21, 203,162,112,58,248,203,137,39,208,161,67,251,26,223,207,222,155,205,167, 107,215,69,171,254,113,35,167,36,155,13,57,191,151,1,179,99,84,132,61, 94,221,243,243,239,59,215,156,117,100,183,163,180,104,6,255,156,162,28, 242,29,249,251,129,159,99,84,119,33,26,189,122,117,1,196,211,253,208,247, 237,219,199,187,111,191,87,190,123,247,222,211,128,69,209,56,103,51,175, 127,78,151,46,157,15,27,159,16,73,155,14,30,172,241,189,125,251,246,241, 236,236,185,229,43,92,238,168,253,252,227,193,129,146,253,252,184,105, 78,153,215,240,158,9,44,142,85,57,74,157,165,119,125,187,114,206,216,126, 157,250,183,178,89,170,191,43,96,184,131,191,82,240,235,150,249,5,229, 110,199,157,72,243,191,16,245,22,63,145,172,30,246,237,219,199,59,255, 155,81,190,123,247,158,211,128,121,177,46,79,180,73,253,247,241,204,172, 111,203,87,184,92,205,170,254,7,74,246,51,111,211,55,254,224,31,235,122, 175,115,121,92,51,190,91,53,215,25,173,224,255,71,246,239,222,2,103,225, 82,224,235,24,215,189,57,122,212,247,136,55,241,90,174,184,214,104,87, 208,146,224,39,245,151,224,31,31,245,46,115,149,221,185,114,251,138,73, 221,218,116,239,223,183,99,63,45,146,193,63,183,36,135,37,219,127,201, 41,119,59,47,139,117,189,155,169,59,99,93,128,26,196,107,185,226,90,163, 108,1,144,224,39,245,151,224,31,87,245,118,150,185,202,206,248,124,201, 167,217,59,115,119,68,44,248,23,57,10,153,179,246,171,60,167,219,121,30, 176,63,214,149,22,162,177,107,116,9,128,4,63,169,191,4,255,184,172,247, 182,50,87,217,169,31,252,250,94,246,166,125,155,84,216,175,252,139,115, 248,114,229,199,121,206,114,199,37,64,92,220,246,82,136,198,174,81,37, 0,18,252,164,254,205,55,248,207,118,196,113,240,247,91,83,86,94,54,254, 179,165,159,110,89,176,238,199,114,175,238,13,91,159,255,172,223,63,219, 91,234,46,57,67,71,143,213,140,135,170,138,11,75,139,220,177,46,68,185, 183,220,99,24,70,97,172,203,33,26,167,70,147,0,72,240,147,250,55,215,224, 255,227,230,217,78,175,225,57,131,198,81,239,205,78,87,217,240,101,91, 151,204,252,239,188,87,243,183,229,108,169,119,240,207,41,202,225,243, 21,31,22,44,222,254,235,60,167,219,121,52,241,117,229,63,231,215,63,22, 149,109,219,183,61,102,5,40,116,22,176,229,192,134,98,3,227,203,40,158, 246,17,223,35,222,196,107,185,226,90,163,24,4,40,193,79,234,223,124,131, 255,156,114,143,238,57,157,198,85,239,18,135,219,113,153,195,237,56,238, 203,229,95,60,158,150,148,218,111,104,247,225,45,122,181,235,109,177,39, 218,43,130,127,117,129,191,220,227,100,231,193,29,106,221,222,53,249,249, 142,252,253,190,169,126,241,56,218,63,187,196,81,114,193,3,239,61,242, 209,212,73,23,183,24,51,96,84,84,47,166,182,231,109,81,75,118,252,82,88, 238,117,254,31,209,93,10,249,14,223,215,120,27,116,23,175,229,138,107, 245,74,0,246,239,219,207,202,21,171,194,92,148,234,233,186,206,187,239, 204,40,223,189,123,207,100,96,126,84,78,90,7,169,127,116,235,255,204,15, 243,202,87,184,220,113,83,255,189,121,123,88,188,57,178,23,163,186,238, 101,233,150,69,110,143,30,63,245,174,135,223,28,174,210,49,14,87,233,144, 159,214,255,120,229,79,27,230,159,149,156,152,156,210,54,189,157,165,101, 106,203,212,68,91,114,146,66,225,246,184,60,133,142,194,210,131,37,7,188, 165,238,82,93,83,124,231,91,225,239,103,226,123,158,255,143,197,101,197, 163,222,153,59,227,127,179,22,125,211,239,148,163,79,206,26,209,251,104, 205,106,137,204,117,149,110,232,108,203,221,204,154,61,43,10,74,202,139, 119,184,188,174,203,128,223,35,114,178,32,13,234,63,244,216,88,158,95, 52,76,125,214,111,61,10,184,40,220,5,169,195,215,192,194,40,159,179,38, 82,255,230,93,255,238,192,181,81,58,215,103,196,112,145,159,8,233,2,244, 3,186,1,105,128,21,40,1,246,2,27,104,188,55,246,25,155,158,146,126,171, 97,24,227,122,116,232,97,12,233,121,84,86,151,54,93,181,118,153,237,72, 176,218,208,13,3,67,55,204,175,134,129,174,251,190,86,247,189,111,59,183, 199,205,129,226,28,114,138,246,171,109,7,182,20,237,43,202,182,88,44,218, 175,229,238,242,39,48,91,132,98,145,28,249,207,25,153,181,191,235,47,94, 203,21,215,228,195,18,66,136,240,73,3,198,219,147,236,147,109,86,219,40, 183,199,221,51,195,158,225,205,74,203,82,45,82,91,36,182,72,107,97,79, 180,37,89,173,154,21,171,197,138,161,20,30,175,7,183,199,141,219,235,210, 243,74,11,156,69,142,66,87,177,163,72,43,115,149,38,216,44,9,219,117,165, 47,118,121,202,103,97,182,4,21,197,182,122,213,38,29,101,152,245,14,212, 22,200,169,225,24,15,1,255,174,242,218,131,192,191,106,216,190,29,112, 160,202,107,165,64,106,53,219,74,76,11,65,163,24,3,32,132,16,141,68,41, 240,181,195,229,240,143,91,176,149,23,149,247,56,80,116,160,19,208,1,232, 100,179,216,210,173,86,107,186,213,98,77,3,208,13,189,76,215,245,18,175, 225,45,6,246,249,30,123,129,109,110,220,158,88,84,162,22,11,129,49,177, 46,68,13,226,165,149,80,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8, 33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,17, 167,5,187,161,82,42,146,229,8,59,77,11,186,106,65,145,250,75,253,27,19, 169,191,212,63,156,164,254,77,179,254,150,8,151,67,8,33,132,16,113,72, 18,0,33,132,16,162,25,146,4,64,8,33,132,136,189,118,192,61,192,239,64, 46,80,2,124,3,92,7,216,34,113,66,25,3,16,36,169,191,212,191,49,145,250, 75,253,195,73,234,31,241,250,159,9,188,7,164,214,240,254,114,224,255,128, 181,193,28,76,198,0,8,33,132,16,241,239,2,224,83,106,14,254,0,195,129, 31,129,30,225,60,177,36,0,34,150,166,1,143,196,186,16,49,52,141,230,93, 127,209,124,76,3,84,144,143,230,244,111,162,61,240,18,96,173,242,186,225, 123,4,106,13,124,65,237,137,66,72,36,1,16,177,50,13,184,23,184,3,120,52, 182,69,137,137,105,28,170,127,115,250,131,39,154,159,105,152,191,235,193, 106,78,255,38,238,2,90,6,124,95,6,92,6,36,1,109,128,103,170,108,63,24, 179,197,32,44,98,57,6,160,234,1,195,218,105,211,8,251,128,194,42,206,235, 63,141,195,255,32,220,13,60,16,174,19,196,121,253,239,4,30,174,242,218, 116,204,207,37,44,226,188,254,17,39,245,143,122,253,163,253,1,213,90,193, 70,242,243,215,128,93,64,231,128,215,166,2,51,170,108,247,12,240,247,128, 239,255,132,217,101,80,243,129,131,172,127,68,70,22,10,81,139,105,28,30, 252,139,128,239,163,95,148,152,249,22,184,141,202,153,255,189,64,50,102, 114,32,132,104,250,6,81,57,248,239,195,28,8,88,213,173,190,175,39,2,95, 3,159,135,171,0,146,0,136,104,154,70,245,193,255,20,96,81,212,75,19,59, 43,129,73,152,73,79,96,18,112,135,239,171,36,1,241,47,222,154,4,194,123, 201,43,162,97,72,149,239,231,83,253,239,149,23,248,71,36,10,32,99,0,68, 180,76,67,130,127,32,127,18,144,95,229,245,230,212,255,41,68,115,54,168, 202,247,65,77,241,11,39,73,0,68,52,76,67,130,127,117,154,74,18,144,136, 57,48,233,61,96,3,80,74,221,35,189,171,170,107,251,82,223,177,223,3,206, 247,157,83,196,15,45,202,143,166,96,96,149,239,215,69,187,0,50,8,48,72, 50,8,168,222,245,159,70,12,130,127,28,213,63,24,195,128,239,168,220,29, 0,230,236,136,122,117,7,68,177,254,127,2,30,3,122,134,120,200,170,5,12, 245,3,222,138,57,142,226,179,106,15,30,249,250,199,219,31,132,74,21,110, 100,191,255,97,215,72,234,191,3,232,22,240,253,17,152,191,215,13,22,108, 253,37,1,8,146,252,3,168,87,253,167,17,163,43,255,56,169,127,40,194,154, 4,68,161,254,86,204,178,221,82,207,67,54,52,1,240,123,28,243,243,169,52, 103,186,17,254,252,195,42,134,245,143,244,7,21,84,197,26,193,207,63,13, 40,230,80,125,28,64,58,135,207,253,175,23,153,5,32,98,109,26,210,236,31, 138,21,152,163,124,171,38,1,241,58,48,176,166,224,239,2,182,99,206,103, 14,197,242,58,222,79,195,92,5,173,106,211,255,109,152,65,231,142,195,246, 16,34,126,13,162,114,50,243,7,97,10,254,161,144,4,64,68,194,52,36,248, 215,71,99,73,2,254,196,225,193,127,11,230,207,252,115,204,171,153,80,29, 29,196,54,118,96,10,230,154,9,189,2,94,191,29,248,141,48,78,143,18,34, 194,170,14,0,140,122,255,63,72,23,64,208,164,9,48,232,250,79,35,14,130, 127,35,255,249,55,184,59,32,130,245,79,4,214,83,185,207,127,46,112,46, 230,221,203,162,33,3,248,4,115,0,165,223,22,204,65,85,110,104,244,63,255, 6,147,46,128,152,255,252,251,1,99,168,121,160,253,249,192,9,1,223,127, 130,249,239,168,170,124,96,14,230,32,216,160,201,24,128,216,255,2,196, 84,140,234,63,141,56,8,254,208,36,126,254,195,48,215,9,104,81,229,245, 160,146,128,8,214,255,2,224,131,128,183,182,96,150,53,90,193,223,47,3, 179,197,36,176,37,224,124,224,35,104,18,63,255,6,145,4,32,166,63,255,30, 152,77,250,201,97,58,253,183,152,127,67,131,38,119,3,20,209,54,141,56, 9,254,77,132,191,59,160,160,202,235,177,158,34,120,86,149,239,239,37,250, 193,31,204,1,84,211,170,188,86,181,108,66,196,66,55,194,23,252,1,250,134, 241,88,149,132,179,5,160,185,175,5,221,156,235,63,141,208,110,246,17,78, 213,86,52,138,245,143,213,165,97,173,45,1,17,172,255,70,160,143,239,121, 57,208,138,218,251,252,27,250,249,212,86,145,84,32,15,243,198,41,254,178, 245,3,153,6,24,167,45,0,138,186,99,78,93,219,52,134,22,0,11,230,189,62, 78,168,225,125,43,149,87,1,212,129,85,53,108,235,4,238,167,250,238,129, 26,197,162,11,160,57,7,64,104,190,245,159,70,236,130,63,52,223,4,0,106, 73,2,34,88,255,18,204,17,249,16,16,112,107,219,181,129,167,174,171,34, 155,128,222,190,231,165,152,83,169,36,1,136,191,4,160,12,179,133,230,42, 224,194,26,182,249,24,120,17,248,18,223,207,177,26,141,33,1,168,203,241, 192,130,128,239,127,3,70,133,243,4,50,13,80,68,139,51,214,5,104,198,98, 253,217,199,195,138,108,129,101,136,250,52,42,17,148,50,224,52,204,160, 55,31,51,73,184,168,202,54,31,251,94,243,2,167,2,223,80,115,18,208,216, 197,124,9,96,63,25,3,32,26,170,222,171,213,137,6,153,134,57,29,46,218, 178,3,158,119,197,156,154,23,43,169,64,151,128,239,247,197,170,32,162, 70,6,135,130,63,152,205,221,151,97,6,124,191,153,28,10,254,0,11,49,167, 123,198,91,43,75,184,196,124,9,96,191,112,38,0,13,93,203,185,177,175,5, 29,106,249,27,250,136,39,53,37,1,197,192,113,52,237,207,33,146,117,59, 154,195,7,1,66,236,130,63,192,178,128,231,201,152,127,168,107,19,201,159, 239,57,28,234,255,7,88,26,84,13,194,35,218,255,222,227,253,223,65,77,44, 192,95,169,220,218,236,193,236,6,152,129,153,8,252,153,67,193,31,204,62, 242,43,136,239,122,53,68,220,36,0,65,127,192,50,13,176,113,37,163,49,170, 127,117,35,212,139,129,147,145,105,128,161,26,142,185,22,64,139,42,175, 79,35,136,224,31,193,250,159,15,124,24,240,214,54,96,40,230,207,57,154, 50,49,111,166,212,35,224,181,243,240,93,89,54,129,159,127,131,196,225, 24,128,15,128,75,168,28,232,253,73,65,213,215,102,96,254,158,85,39,168, 138,197,249,207,63,23,104,29,240,125,7,96,127,56,79,32,211,0,69,44,84, 215,18,144,129,185,144,197,177,209,47,78,163,213,160,224,31,97,159,83, 249,134,37,61,49,23,49,201,136,98,25,50,125,231,12,12,254,155,129,47,162, 88,6,17,154,11,129,247,169,220,18,224,229,240,43,255,183,168,57,248,55, 5,237,169,28,252,243,8,115,240,15,133,36,0,34,220,170,75,2,50,49,147,128, 145,209,47,78,163,19,207,193,31,204,149,246,110,171,242,218,36,204,117, 11,166,98,246,203,71,74,42,230,85,228,74,42,79,177,82,192,173,152,77,203, 34,126,157,139,153,4,36,84,243,158,21,120,27,184,56,170,37,138,190,184, 25,0,8,50,11,64,68,198,163,190,175,129,221,1,153,152,43,90,157,12,44,142, 122,137,26,135,120,15,254,126,159,97,222,133,47,48,17,232,5,188,131,153, 32,236,160,238,197,129,170,174,253,191,172,218,173,14,73,7,186,115,248, 205,128,192,252,125,251,178,142,253,69,252,168,169,61,189,113,245,179, 212,79,92,220,3,192,79,18,0,17,41,146,4,132,166,177,4,127,191,59,49,255, 96,223,94,229,245,68,14,45,20,20,138,225,245,216,71,1,143,1,255,174,199, 190,34,250,2,167,250,85,229,159,29,0,230,160,192,166,42,152,1,128,9,152, 99,29,220,213,188,151,74,232,119,218,172,145,116,1,136,72,170,169,59,224, 91,164,59,32,80,99,11,254,96,78,239,186,3,115,22,192,150,24,156,127,179, 239,220,119,18,155,249,255,42,206,30,241,174,234,84,63,48,47,64,3,47,66, 117,224,255,124,219,54,85,85,19,128,170,93,0,201,192,6,96,47,135,39,210, 151,97,46,175,254,90,184,10,35,179,0,130,36,163,128,27,84,255,234,102, 7,20,17,193,150,128,56,171,127,109,34,18,252,163,92,255,4,224,108,204, 149,222,134,3,157,57,180,90,96,77,170,22,176,174,15,184,20,216,13,44,199, 28,236,247,5,181,244,249,203,74,128,113,53,11,160,186,43,127,127,159,127, 34,102,191,191,167,202,123,111,81,125,75,64,99,158,5,160,97,78,235,205, 12,120,173,13,112,48,224,251,116,204,224,159,14,172,193,28,60,237,4,142, 196,156,73,149,2,204,198,92,44,169,230,19,201,221,0,227,242,23,32,106, 226,176,254,81,77,2,226,176,254,213,137,216,149,127,35,169,127,196,72, 2,16,55,9,128,194,188,169,213,15,1,175,85,157,234,55,147,195,215,2,56, 1,243,223,70,213,138,52,230,4,160,43,176,51,224,251,125,64,199,106,182, 187,8,120,207,247,252,117,224,31,152,107,92,244,195,28,91,51,2,115,25, 238,26,201,52,64,17,111,164,59,160,178,198,216,236,47,68,168,52,204,1, 154,19,125,223,87,55,213,239,124,42,207,14,24,131,57,221,180,169,45,4, 20,236,0,192,247,129,255,250,158,95,137,121,35,160,126,152,201,212,229, 212,17,252,67,33,9,128,136,166,218,146,128,99,162,95,156,152,145,224,223, 248,197,122,229,191,198,178,18,32,152,203,69,127,133,217,18,80,211,84, 191,115,49,175,122,39,96,54,113,215,213,133,20,143,44,212,30,83,199,86, 249,126,77,45,219,222,128,57,221,21,204,213,84,1,158,193,92,255,34,108, 36,1,16,209,246,40,135,7,185,76,14,93,33,52,7,147,57,60,248,79,71,130, 191,104,186,236,152,137,126,109,243,252,207,197,236,42,104,140,193,255, 60,32,223,247,168,110,33,35,13,56,179,202,107,223,213,114,188,114,224, 129,42,223,63,212,144,2,86,39,150,99,0,34,42,78,251,128,162,166,17,212, 63,112,76,192,52,194,28,252,26,65,253,167,113,232,54,202,211,104,126,245, 143,40,169,127,220,140,1,8,183,120,29,3,176,7,232,228,123,238,2,198,83, 121,249,243,203,128,255,5,124,239,0,90,97,6,246,234,100,97,46,174,21,184, 218,229,135,212,124,43,229,74,228,118,192,34,222,61,138,57,162,21,154, 231,149,239,180,128,231,205,177,254,66,52,37,129,115,243,147,48,251,237, 239,5,126,198,108,250,127,184,202,246,111,83,115,240,215,128,55,48,131, 191,194,188,53,242,105,192,5,152,183,83,126,37,92,133,150,22,128,32,73, 253,165,254,141,137,212,95,234,31,78,33,212,191,136,200,221,23,162,8,243, 202,184,78,49,168,255,36,204,177,11,193,92,84,23,0,125,49,111,10,84,157, 219,48,23,184,2,179,217,127,58,102,34,113,12,102,210,48,26,179,117,160, 70,50,11,64,8,33,68,180,125,31,193,99,215,214,103,30,107,223,3,55,7,177, 157,11,243,86,199,53,5,255,22,28,234,251,95,0,220,131,185,34,224,5,152, 227,11,146,129,167,26,84,210,0,146,0,8,33,132,8,151,127,98,222,225,46, 220,242,125,199,142,103,207,99,14,244,59,80,195,251,7,129,51,48,167,56, 214,164,4,115,93,148,117,152,235,1,232,190,215,119,96,174,149,112,0,248, 169,225,69,53,73,23,64,144,164,254,82,255,198,68,234,47,245,15,167,16, 235,223,9,243,42,245,20,26,222,29,80,140,217,159,254,79,66,88,114,58,198, 245,111,129,185,50,230,41,190,231,5,152,45,4,239,98,174,234,23,113,141, 97,37,192,136,146,63,0,82,255,112,146,250,75,253,27,19,169,191,212,63, 24,210,5,32,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,162,201,208,130,221,80,41,21,201,114, 132,157,166,5,93,181,160,72,253,165,254,141,137,212,95,234,31,78,82,255, 166,89,127,75,132,203,33,132,16,66,136,56,100,139,117,1,132,16,162,145, 58,6,120,8,24,1,100,68,232,28,71,3,203,35,116,108,17,29,86,204,223,149, 9,192,112,160,31,208,1,72,243,189,95,10,100,3,27,129,101,192,143,192,18, 192,136,116,193,164,11,32,72,82,127,169,127,99,34,245,143,120,253,143, 3,126,34,242,23,81,245,74,0,228,231,31,23,245,239,2,92,15,76,5,58,133, 184,239,30,224,93,224,69,223,243,144,72,23,64,100,181,199,204,210,250, 199,186,32,66,52,3,221,129,133,64,9,240,44,230,21,85,172,61,130,180,160, 138,234,181,6,94,1,182,0,119,16,122,240,7,232,12,220,9,108,5,94,2,90,133, 173,116,1,164,5,32,72,1,245,111,15,204,195,12,254,251,129,137,192,250, 176,158,44,12,226,36,3,142,25,169,127,147,169,127,87,204,100,187,103,192, 107,51,129,63,3,222,154,118,138,66,253,75,129,84,223,243,3,192,130,176, 158,240,144,59,129,109,161,238,212,132,126,254,245,18,195,250,95,12,60, 15,180,12,107,1,32,15,179,53,225,195,96,54,14,182,254,146,0,4,41,160,254, 63,2,227,3,222,218,139,217,183,179,57,172,39,108,32,249,3,32,245,15,167, 24,213,191,186,224,239,87,107,18,16,133,250,7,190,48,15,56,33,172,39,108, 160,8,214,63,212,95,4,127,65,162,186,95,12,126,255,19,128,23,128,107,194, 122,226,195,189,12,220,72,45,201,47,196,95,2,144,9,140,6,198,0,195,128, 118,152,77,26,254,102,141,60,223,35,7,179,191,235,23,223,163,168,190,39, 140,224,47,64,111,204,63,74,129,205,58,117,37,1,109,48,147,134,227,128, 129,152,127,208,90,1,233,128,155,67,245,223,79,229,250,23,215,183,188, 77,36,0,212,155,212,191,209,215,191,182,224,239,87,99,18,32,9,128,36,0, 225,84,199,239,191,29,248,8,56,53,172,39,173,217,215,192,249,128,179,166, 13,226,33,1,72,6,206,197,204,136,70,19,250,120,3,3,179,223,239,63,192, 39,128,43,148,157,35,252,11,16,74,18,240,52,112,3,161,247,91,234,192,207, 152,245,255,140,248,170,127,220,147,250,55,250,250,95,143,121,69,85,151, 247,128,75,49,255,189,84,144,4,64,18,128,112,170,229,247,63,1,248,156, 232,5,127,191,89,192,217,52,176,5,44,18,9,64,58,240,79,204,192,31,174, 129,11,7,49,3,225,35,152,125,111,117,138,194,47,64,176,73,64,75,224,123, 96,104,3,78,159,139,57,168,228,81,160,44,152,29,154,64,0,104,16,169,127, 147,168,255,191,128,7,131,216,238,57,224,239,129,47,196,73,2,48,1,243, 34,232,8,194,59,224,90,97,14,14,251,20,248,174,186,13,36,1,136,218,239, 255,127,136,124,179,127,77,94,194,76,148,15,19,238,250,163,148,10,230, 113,134,82,106,167,138,156,108,165,212,165,74,41,173,174,178,132,91,13, 231,233,173,148,218,83,165,140,251,148,82,253,171,108,151,165,148,90,18, 134,250,239,141,179,250,199,237,67,234,223,40,235,223,93,41,53,177,202, 107,255,82,117,43,142,65,253,3,253,80,205,251,119,43,165,140,32,202,222, 80,15,84,115,238,72,214,63,84,49,217,47,130,245,15,124,92,92,143,242,133, 219,249,170,1,63,255,112,181,0,180,198,108,138,59,49,232,51,55,204,119, 192,69,152,253,230,213,138,98,6,24,205,150,0,191,217,152,125,159,5,53, 109,208,68,174,0,235,77,234,223,232,234,223,29,243,223,81,123,224,44,96, 110,192,123,117,181,4,252,12,28,31,248,66,140,91,0,6,3,171,136,206,52, 107,5,140,2,22,5,190,40,45,0,17,255,249,183,2,54,96,198,190,88,202,195, 92,88,232,96,224,139,209,92,7,224,40,204,85,139,130,9,254,110,204,105, 12,23,99,22,58,205,247,232,231,123,109,166,111,155,186,156,232,59,231, 145,245,40,111,184,37,113,248,47,105,39,204,63,102,189,3,94,203,7,38,97, 54,25,93,6,244,165,254,245,159,140,89,255,129,13,41,184,16,113,162,59, 230,191,151,238,152,99,135,190,0,78,10,120,255,33,224,223,53,236,187,3, 184,36,114,69,171,151,9,84,254,219,90,130,153,172,135,235,17,56,56,88, 195,252,123,32,162,235,65,26,22,252,181,42,143,250,106,5,220,219,128,253, 131,83,93,51,131,82,234,100,165,84,105,144,77,21,31,43,165,122,214,112, 156,192,71,47,165,212,167,65,30,179,68,41,117,98,67,154,64,26,88,255,9, 74,169,130,90,202,183,71,153,221,4,161,52,131,134,82,255,98,95,25,154, 74,19,112,216,30,82,255,70,83,255,174,74,169,173,234,112,229,74,169,211, 171,108,123,107,149,109,118,170,26,254,166,68,161,254,129,170,118,1,220, 95,229,253,81,97,254,204,134,84,57,254,147,81,172,127,168,98,178,95,4, 235,143,82,170,179,82,202,85,143,178,85,87,191,250,214,51,80,185,82,170, 147,170,199,207,191,33,45,0,199,97,142,206,79,173,99,59,29,184,21,115, 48,76,48,11,90,108,5,206,1,110,167,238,181,144,211,48,7,194,140,12,226, 184,225,54,22,179,41,62,171,150,109,170,107,9,168,75,40,245,79,199,188, 90,58,58,132,227,71,75,98,156,30,43,158,88,137,143,85,237,98,165,182,169, 126,73,192,199,192,233,1,175,61,1,220,230,123,190,11,243,74,59,228,69, 114,132,104,160,191,17,95,127,147,146,168,97,48,96,93,234,155,0,12,196, 156,139,88,87,240,7,115,41,196,39,235,113,142,199,49,103,19,212,37,13, 115,74,196,128,122,156,163,190,122,99,78,205,75,10,98,219,250,36,1,16, 124,253,211,129,111,48,187,20,226,69,38,230,202,104,247,132,225,88,183, 3,191,2,45,194,112,172,120,98,5,254,135,57,118,166,57,46,41,219,29,243, 119,164,182,121,254,73,152,243,171,3,187,3,158,192,252,3,60,14,9,254,34, 250,44,152,227,175,226,205,165,212,227,98,162,62,9,128,29,243,202,63,152, 165,14,63,225,240,224,159,140,57,101,103,49,230,148,190,82,204,1,44,55, 114,120,64,125,12,115,142,101,93,90,249,206,149,18,196,182,13,149,142, 153,112,132,50,197,177,166,36,32,3,115,176,211,47,84,159,85,6,91,255,54, 152,245,15,38,33,137,180,76,96,14,112,44,48,157,134,37,1,183,99,78,125, 28,142,57,240,179,169,36,1,254,224,63,21,115,65,143,25,52,175,36,160,43, 240,3,102,18,80,151,100,224,75,42,183,4,188,136,217,247,47,68,180,141, 196,92,167,191,161,84,149,71,67,117,194,252,59,25,25,1,253,11,207,6,217, 47,225,82,135,247,207,117,86,74,173,174,101,159,85,190,109,2,247,57,66, 5,223,223,242,84,168,125,32,245,168,255,11,65,150,197,171,204,105,139, 129,170,27,19,144,165,148,90,234,123,127,101,3,235,255,104,20,234,95,215, 227,219,106,202,117,87,8,251,251,31,119,85,115,156,111,131,221,63,134, 245,175,235,97,85,74,189,83,77,221,62,84,74,217,194,117,158,56,174,127, 119,165,212,246,106,234,95,23,167,82,234,132,56,170,127,32,25,3,80,179, 152,236,23,193,250,7,51,45,53,86,238,84,33,214,63,212,22,128,9,152,87, 170,193,248,140,202,77,116,201,152,87,206,181,141,220,63,10,179,107,33, 240,74,118,11,102,63,119,48,254,78,149,233,64,97,54,22,184,46,200,109, 127,192,108,166,220,27,240,90,117,45,1,133,152,179,26,150,1,67,48,235, 159,28,240,126,40,245,191,5,115,74,80,44,253,139,195,167,39,222,79,104, 45,1,183,251,246,9,84,68,52,70,187,70,86,224,149,127,85,205,161,37,32, 148,43,255,170,14,0,219,195,90,26,33,66,23,143,227,173,252,66,110,1,8, 53,1,120,44,132,125,170,6,173,191,16,220,180,189,163,56,124,101,165,96, 3,160,5,179,239,60,18,52,204,187,60,5,91,255,119,49,215,1,152,64,104,73, 192,81,192,181,85,142,21,108,253,173,152,63,163,88,90,142,89,151,170,73, 192,116,130,11,224,119,96,54,251,7,42,2,78,161,202,92,231,70,166,182,224, 239,215,148,147,128,96,214,246,175,137,12,248,19,241,162,79,172,11,80, 139,144,199,129,133,146,0,156,76,104,217,207,242,42,223,95,28,194,190, 85,183,93,22,194,190,199,80,121,208,80,184,76,198,12,206,193,90,237,251, 234,79,2,2,231,238,214,149,4,84,29,100,18,74,253,71,251,206,23,75,53,37, 1,211,168,61,9,184,3,115,185,231,64,77,37,248,191,205,225,193,127,7,135, 247,101,159,15,188,69,211,154,29,32,193,95,52,21,29,194,116,156,112,173, 3,16,40,228,178,133,146,0,212,180,16,71,77,178,171,124,31,202,40,253,65, 85,190,223,91,237,86,53,11,181,172,193,8,102,68,126,160,157,1,207,55,83, 253,98,65,63,1,253,3,94,43,196,92,44,168,234,122,255,241,80,255,80,133, 154,4,52,229,224,255,63,14,79,106,119,97,174,30,87,221,104,246,139,105, 58,179,3,36,248,139,166,36,45,214,5,168,69,122,168,59,68,99,169,202,250, 168,58,255,61,30,202,25,234,200,146,170,117,168,238,138,174,61,230,232, 246,192,150,128,34,204,187,60,5,10,53,67,140,135,207,11,130,79,2,154,122, 240,175,122,229,191,11,243,246,208,219,168,57,200,53,133,238,0,9,254,77, 79,213,43,215,186,30,177,218,79,4,33,148,64,17,204,93,185,2,117,172,242, 253,31,33,236,91,117,219,80,155,54,30,8,113,251,96,132,90,255,170,101, 174,169,254,53,117,7,4,170,250,89,214,165,106,31,122,44,45,199,236,62, 41,170,242,250,52,204,36,224,94,170,15,254,39,211,180,131,255,246,42,175, 77,192,92,4,42,80,99,78,2,36,248,139,166,40,168,187,209,198,72,73,168, 59,132,146,0,124,11,44,13,97,251,170,227,5,102,132,176,111,213,109,71, 132,176,239,98,106,184,69,102,3,69,178,254,117,45,22,116,108,8,231,93, 134,89,214,120,178,24,179,185,187,186,150,128,105,85,94,243,95,249,47, 142,120,169,34,39,148,224,31,248,94,83,73,2,36,248,55,93,85,231,175,215, 245,136,213,126,145,178,47,10,231,168,175,144,203,22,106,83,113,48,203, 211,250,157,85,229,251,255,112,104,96,92,109,86,1,175,214,113,172,154, 24,28,90,42,52,18,34,89,255,218,146,128,227,130,60,167,65,240,211,52,163, 173,166,238,128,64,77,185,217,127,39,53,7,127,191,221,52,254,36,64,130, 191,104,202,54,198,186,0,181,216,16,234,14,161,38,0,243,49,167,194,5,227, 108,160,87,192,247,46,204,213,188,106,11,130,171,124,219,4,222,17,175, 55,193,39,0,207,96,222,26,52,82,230,19,217,250,215,148,4,252,11,88,25, 196,57,95,36,190,175,156,107,75,2,154,66,240,7,120,147,195,131,255,54, 204,245,41,130,153,199,190,27,152,72,245,99,2,222,104,112,233,34,75,130, 191,104,234,170,206,110,139,39,33,151,173,62,131,197,254,73,112,89,80, 34,135,207,201,223,131,185,148,226,141,152,127,232,253,75,1,255,6,220, 224,123,47,112,196,187,134,185,246,119,66,16,231,219,0,220,21,196,118, 13,21,238,250,23,82,185,239,166,182,91,9,215,150,4,172,197,76,20,226,93, 117,73,64,83,9,254,96,46,228,228,13,248,126,39,230,207,110,87,8,199,240, 119,21,4,182,4,232,152,203,70,199,43,9,254,162,57,152,23,235,2,212,34, 114,101,83,149,151,154,28,168,148,58,24,228,242,132,183,169,250,45,119, 137,111,105,195,96,28,84,74,245,87,209,89,10,51,18,245,239,173,204,101, 130,3,85,183,108,112,75,165,212,138,106,206,145,171,170,44,187,28,225, 250,135,227,49,92,41,149,175,148,42,84,74,29,27,238,227,199,184,254,231, 43,165,60,74,169,29,74,169,30,13,168,71,23,165,212,22,101,46,43,61,53, 142,235,95,211,45,125,131,81,227,45,125,227,252,231,31,72,150,2,174,89, 76,246,139,96,253,45,74,169,93,245,40,87,77,245,171,111,61,171,218,169, 204,178,133,84,255,250,78,23,91,135,217,156,93,117,190,122,117,30,193, 236,59,15,133,134,57,53,44,152,145,247,165,192,169,192,250,16,207,209, 16,225,174,127,176,43,6,86,215,18,80,6,252,137,198,119,245,228,159,29, 208,216,71,251,87,103,38,112,1,230,210,209,13,89,190,214,63,38,224,124, 204,149,37,227,145,92,249,139,230,196,32,180,1,237,209,242,46,193,143, 79,171,208,144,249,226,139,48,239,91,95,87,16,180,96,78,75,251,12,56,34, 136,227,250,111,181,251,72,16,229,43,5,166,0,75,130,56,110,184,133,187, 254,254,36,32,112,36,103,93,73,128,127,186,220,79,161,20,60,142,44,38, 190,199,44,52,196,167,152,1,188,161,118,251,142,21,143,36,248,139,230, 232,69,42,143,83,139,53,23,240,82,125,118,108,232,130,49,115,49,111,62, 19,204,85,206,217,152,115,225,103,98,46,117,219,15,115,85,165,52,204,213, 240,166,98,222,251,123,29,193,13,250,219,230,59,247,247,161,22,58,140, 194,81,255,44,204,37,134,47,195,252,197,106,91,101,191,218,146,128,113, 152,183,18,22,34,218,154,123,240,111,25,240,56,59,182,69,17,81,182,7,120, 61,214,133,8,240,42,161,175,22,11,132,176,114,82,29,253,10,173,128,247, 49,7,119,69,195,92,204,229,82,243,106,218,64,211,194,187,40,84,28,212, 127,47,230,31,205,205,193,108,28,229,250,199,29,169,127,196,235,191,157, 250,221,213,111,7,230,239,241,142,6,21,168,14,49,254,249,223,79,229,1, 201,163,129,95,195,88,156,33,84,238,6,124,10,243,78,160,21,34,88,255,80, 255,33,248,11,18,213,253,162,240,243,111,137,57,240,188,77,88,79,20,186, 60,204,155,0,85,138,133,193,214,63,92,75,198,230,97,222,128,231,76,66, 27,237,28,170,108,204,43,229,83,168,37,248,199,64,52,234,95,221,189,3, 132,136,149,238,245,216,199,127,255,131,29,97,45,137,16,209,151,143,57, 115,45,214,174,165,1,177,48,220,107,198,127,5,12,196,92,138,55,55,140, 199,61,0,220,135,121,43,198,183,137,206,138,79,245,17,169,250,251,85,119, 239,0,33,26,131,166,208,236,47,68,160,15,129,151,99,120,254,231,129,143, 27,114,128,72,220,52,166,20,184,27,232,130,217,76,191,0,115,14,115,168, 116,204,133,119,46,242,29,235,94,130,27,117,31,107,225,170,191,225,219, 247,22,234,30,24,40,68,60,147,224,47,154,170,27,48,7,120,71,219,215,192, 205,13,61,72,36,151,22,117,97,246,139,191,15,100,96,14,150,27,13,12,199, 188,146,109,141,217,119,14,102,19,70,46,144,131,57,61,236,23,204,62,179, 226,8,150,47,210,130,173,191,13,51,177,57,128,249,7,114,61,102,221,127, 226,80,43,194,55,152,139,60,248,111,48,228,79,2,130,30,19,32,68,140,72, 240,23,77,153,142,57,168,123,38,230,212,240,104,248,10,115,154,177,183, 174,13,235,18,173,181,197,139,129,57,190,71,115,212,208,250,111,192,92, 25,110,30,102,240,135,67,99,2,38,18,221,53,16,132,8,150,4,127,209,28,56, 49,167,163,63,11,252,53,194,231,122,30,243,202,191,193,193,31,26,199,205, 69,132,105,19,230,31,211,31,57,148,4,180,199,76,10,36,9,16,241,166,57, 7,255,170,127,156,239,39,188,131,150,179,170,124,239,9,227,177,69,253, 120,129,235,49,187,109,95,32,252,179,3,14,248,142,223,160,62,255,170,194, 53,13,48,238,52,225,105,96,125,48,147,128,142,1,175,205,199,252,99,91, 161,9,215,63,40,82,255,136,215,191,182,15,36,230,193,63,198,63,255,51, 128,47,195,90,128,218,157,143,185,134,74,5,153,6,24,211,159,127,75,96, 58,112,53,144,212,192,83,151,3,175,97,142,129,171,237,78,170,149,4,91, 127,73,0,130,20,103,245,239,205,161,150,128,234,150,17,110,234,245,175, 147,212,95,234,31,78,33,214,95,3,102,97,46,117,29,105,243,48,215,31,169, 180,12,172,252,252,227,162,254,29,49,175,218,47,193,28,20,30,138,93,192, 59,152,43,252,101,135,122,98,73,0,226,227,23,32,146,122,99,174,0,53,149, 106,86,129,106,6,245,175,149,212,95,234,31,78,245,168,127,50,230,108,160, 203,57,52,120,55,156,246,99,78,137,158,14,56,170,190,25,7,245,143,169, 56,171,191,5,56,26,179,171,118,56,230,194,61,157,48,87,130,5,115,230,216, 30,204,110,222,101,152,73,221,114,234,177,182,191,159,36,0,241,245,11, 16,117,82,127,169,127,56,73,253,165,254,141,137,212,63,186,43,1,10,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,49,167,5,187,161,82,42,146,229,8,59,77,11,186,106, 65,145,250,75,253,27,19,169,191,212,63,156,164,254,77,179,254,150,8,151, 67,8,33,132,16,113,40,218,9,192,183,128,170,227,241,93,148,203,36,132, 16,66,52,59,209,236,2,104,1,228,7,185,109,107,32,175,33,39,147,38,32,169, 127,56,73,253,165,254,141,137,212,95,234,31,140,104,182,0,244,9,97,219, 222,17,43,133,16,66,8,33,162,154,0,132,18,212,37,1,16,66,8,33,34,200,22, 197,115,29,17,194,182,77,53,1,56,22,56,203,247,181,55,208,18,48,128,3, 192,78,96,62,230,56,137,69,49,42,159,16,66,136,102,34,94,19,128,80,182, 141,119,26,112,30,48,13,232,95,195,54,61,124,143,241,190,237,86,0,143, 0,31,99,14,140,20,66,8,33,194,42,28,93,0,227,129,189,192,7,192,68,14,31, 88,152,1,252,27,56,35,132,99,158,14,220,13,100,86,121,93,3,38,0,239,3, 187,125,207,227,89,103,224,7,224,67,106,14,254,213,25,6,204,4,190,1,58, 68,160,92,66,8,33,154,185,134,206,2,72,4,214,0,125,3,94,219,12,188,14, 188,1,140,0,94,3,58,214,179,124,185,192,117,152,65,244,124,224,6,96,80, 192,251,91,129,129,128,171,234,142,113,48,10,244,104,96,54,230,140,134, 134,200,5,78,2,86,133,178,83,28,212,63,166,164,254,82,255,112,146,250, 75,253,27,147,96,235,223,208,4,224,22,224,137,26,118,241,0,9,193,30,191, 14,181,29,235,118,224,241,170,47,198,248,23,96,24,240,35,102,235,71,56, 228,3,39,16,66,18,32,255,0,164,254,225,36,245,151,250,55,38,82,255,200, 39,0,109,129,77,28,222,76,31,109,37,152,45,16,251,2,95,140,225,47,64,91, 96,25,208,37,172,5,128,237,192,80,160,40,152,141,229,31,128,212,63,156, 164,254,82,255,198,68,234,31,249,117,0,30,36,246,193,31,32,29,184,63,214, 133,8,240,20,225,15,254,96,14,18,124,33,2,199,21,66,8,209,12,213,183,5, 96,40,176,20,176,134,187,64,245,100,96,78,173,91,234,127,33,202,25,96, 59,224,120,96,20,240,119,66,248,92,67,45,6,102,247,194,170,186,54,148, 12,88,234,31,78,82,127,169,127,99,34,245,143,108,11,192,51,196,79,240, 7,179,30,207,18,185,192,91,147,35,49,71,235,239,246,125,253,71,132,203, 160,1,255,138,224,241,133,16,66,52,19,245,73,0,78,193,188,218,173,175, 92,204,41,126,195,128,52,223,99,152,239,181,220,6,28,247,56,95,217,162, 193,2,220,135,217,215,127,30,225,27,236,24,140,51,49,63,51,33,132,16,162, 222,234,147,0,20,80,205,180,187,32,125,130,185,200,207,3,192,74,160,204, 247,88,233,123,237,8,223,54,245,225,246,149,45,210,18,128,119,49,19,150, 104,6,126,191,36,204,25,1,66,8,33,68,189,213,39,1,88,12,140,195,108,246, 14,197,39,152,115,249,139,107,217,166,24,243,138,58,212,36,96,143,175, 76,209,88,66,247,41,224,162,40,156,167,54,111,1,11,48,87,11,28,16,227, 178,8,33,132,104,132,26,50,13,176,13,135,86,255,171,75,46,230,213,125, 109,193,63,80,6,176,197,119,142,186,252,8,92,136,185,158,126,133,8,13, 2,57,19,248,34,172,7,110,56,5,204,192,92,147,161,226,51,144,65,48,82,255, 112,146,250,75,253,27,19,169,127,228,167,1,250,87,168,123,148,186,215, 171,127,158,224,131,63,190,109,159,175,99,27,133,185,0,208,73,84,9,254, 17,98,1,30,138,194,121,66,165,1,83,129,37,132,182,220,176,16,66,136,102, 172,161,43,1,250,237,198,92,247,190,38,67,9,113,41,91,96,8,230,216,128, 154,100,3,157,106,122,51,2,25,224,169,192,172,176,30,52,252,118,3,195, 129,92,201,128,165,254,225,36,245,151,250,55,38,82,255,200,183,0,4,106, 85,199,251,91,234,113,204,186,246,169,235,156,225,118,122,148,207,87,31, 93,128,87,98,93,8,33,132,16,241,47,92,9,64,93,233,81,125,206,83,87,10, 19,237,148,108,76,148,207,87,95,83,48,91,1,132,16,66,136,26,133,43,1,200, 175,227,253,94,245,56,230,17,13,60,103,184,213,216,221,16,103,52,224,207, 177,46,132,16,66,136,248,214,208,4,192,138,57,21,173,174,224,120,70,61, 142,93,215,62,29,128,199,0,91,61,142,93,31,169,81,58,79,56,200,58,1,66, 8,33,106,21,205,105,128,189,9,242,78,118,152,55,25,218,2,180,14,98,219, 104,77,3,220,69,100,110,242,19,9,5,154,166,181,12,231,1,155,234,32,152, 96,73,253,165,254,141,137,212,95,234,31,140,250,182,0,140,4,150,19,92, 240,7,51,89,120,35,200,243,89,128,55,9,46,248,3,76,240,149,229,216,32, 183,175,175,157,17,62,126,56,37,199,186,0,66,8,33,226,91,125,18,128,145, 152,171,208,133,122,53,124,14,240,49,181,223,66,56,211,183,205,148,16, 143,221,217,87,166,72,38,1,223,70,240,216,225,182,55,214,5,16,66,8,17, 223,234,147,0,100,97,174,71,95,31,83,48,155,246,239,193,188,1,80,58,135, 110,6,116,143,239,189,80,131,191,95,34,208,162,158,251,6,227,19,162,63, 243,160,190,150,197,186,0,66,8,33,226,91,125,199,0,204,199,92,123,63,158, 252,138,57,85,79,65,196,250,128,62,0,46,8,235,129,35,227,2,77,211,102, 134,243,128,77,181,15,44,88,82,127,169,127,99,34,245,151,250,7,181,93, 176,7,172,242,1,12,193,188,202,180,134,82,168,8,50,48,155,255,151,250, 95,136,208,47,64,15,204,21,13,51,194,122,240,240,90,15,28,169,105,154, 55,156,7,109,170,255,0,130,37,245,151,250,55,38,82,127,169,127,48,234, 59,8,112,21,230,160,190,120,241,6,1,193,63,130,182,99,222,9,80,143,194, 185,234,195,11,92,239,251,42,132,16,66,212,168,33,211,0,219,2,27,49,199, 4,196,82,9,208,23,216,23,248,98,132,51,192,243,49,103,42,216,195,122,146, 134,81,152,193,255,101,144,12,88,234,47,245,15,39,169,191,212,191,49,137, 198,189,0,14,0,15,212,242,190,167,1,199,14,229,88,247,83,37,248,71,193, 76,96,44,241,51,216,174,0,248,19,190,224,47,132,16,66,212,165,161,43,1, 62,135,217,10,16,104,51,112,39,230,234,128,167,97,222,181,175,190,114, 48,3,91,91,224,47,192,218,42,239,111,245,149,33,22,86,0,199,96,14,10,156, 5,148,199,160,12,187,48,111,199,124,4,240,89,12,206,47,132,16,162,145, 10,199,237,128,199,1,111,3,191,1,175,98,174,204,23,184,113,6,112,3,112, 59,193,15,158,43,198,92,230,247,57,204,38,254,192,242,142,7,174,1,142, 7,166,250,206,119,152,24,52,1,165,97,14,18,236,236,123,30,73,249,152,183, 254,221,84,211,6,210,4,38,245,15,39,169,191,212,191,49,145,250,71,118, 22,64,125,188,75,240,55,169,121,31,184,184,33,39,147,95,0,169,127,56,73, 253,165,254,141,137,212,95,234,31,140,112,221,13,48,24,91,34,180,173,16, 66,8,33,66,20,175,9,192,230,136,149,66,8,33,132,16,81,77,0,66,9,234,146, 0,8,33,132,16,17,20,205,4,160,198,1,107,213,144,4,64,8,33,132,136,160, 104,38,0,5,192,220,32,182,251,14,200,139,112,89,132,16,66,136,102,45,154, 179,0,162,74,70,129,74,253,195,73,234,47,245,111,76,164,254,82,255,96, 68,179,5,64,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,8,47,45,214,5,8,82,42, 112,2,208,27,80,192,22,224,123,192,17,229,114,140,247,61,226,217,124,223, 67,8,33,132,168,145,45,214,5,168,131,37,209,102,185,45,209,102,189,235, 146,243,79,214,70,141,24,148,108,177,216,248,236,203,217,206,175,126,88, 129,66,221,239,246,242,56,102,82,16,13,227,179,186,13,59,187,85,239,209, 133,161,236,52,220,49,175,124,184,117,93,114,40,251,20,38,38,150,39,183, 72,12,105,159,185,107,92,89,191,108,242,128,36,0,77,89,59,224,44,155,205, 246,127,186,174,31,161,148,234,10,148,199,186,80,66,136,74,126,6,82,128, 83,129,3,245,60,70,91,224,27,192,9,140,13,83,185,42,137,231,4,192,98,79, 210,62,186,228,252,211,78,125,250,249,87,147,221,133,59,40,217,189,20, 165,116,250,98,79,155,114,68,6,247,125,90,122,207,238,124,227,88,135,75, 253,137,40,37,1,173,122,143,46,236,126,212,132,113,89,153,169,65,109,95, 88,84,198,164,220,197,11,142,79,96,92,74,82,112,231,112,186,32,47,51,113, 65,98,199,206,227,236,153,237,131,218,199,81,180,31,216,179,192,151,0, 136,166,165,59,112,142,197,98,155,10,70,255,244,140,76,79,86,171,86,233, 57,217,251,74,202,157,101,39,2,95,197,184,124,66,136,202,146,128,225,192, 15,152,173,215,249,192,120,123,146,245,60,155,205,50,218,229,214,187,122, 116,149,2,96,179,106,206,164,4,203,78,143,199,248,165,220,99,124,12,252, 8,180,242,237,59,8,88,26,169,66,198,109,2,144,104,227,214,139,254,116, 202,169,207,190,240,106,242,250,15,47,163,120,119,229,207,160,115,75,11, 47,94,158,145,250,215,55,138,79,218,121,80,191,213,101,182,4,68,69,86, 102,42,221,186,180,13,114,235,3,144,11,41,73,208,58,51,184,61,14,22,153, 95,237,153,237,105,221,245,200,224,246,217,5,176,39,200,50,137,70,160, 167,197,98,57,203,98,177,92,222,186,117,235,222,3,6,13,210,182,237,216, 149,148,158,153,137,166,105,201,0,30,143,39,45,103,111,249,84,93,215,37, 1,136,63,87,97,254,241,222,23,129,99,255,2,44,140,192,113,195,45,13,248, 15,176,38,66,199,127,52,66,199,13,198,207,190,175,53,93,153,159,206,161, 0,190,200,158,108,75,237,209,185,85,242,69,147,135,167,29,217,191,155, 165,99,187,86,36,38,88,49,12,40,41,41,78,223,157,157,59,104,205,134,29, 3,62,253,110,237,197,187,114,138,28,229,30,85,6,244,4,214,250,142,85,223, 114,212,42,94,19,0,187,205,106,187,251,153,103,95,74,222,248,233,181,135, 5,127,191,4,43,220,115,78,106,234,149,175,150,220,3,234,69,162,63,38,64, 136,112,26,104,177,88,46,66,211,46,213,52,173,229,95,174,189,54,233,178, 75,47,181,29,61,124,56,154,166,241,201,231,95,240,212,179,207,81,86,86, 6,64,102,86,11,109,223,158,221,167,98,254,59,246,198,180,228,13,211,1, 24,1,244,0,44,64,54,102,55,86,78,12,203,212,16,255,72,72,72,120,122,200, 144,33,140,26,117,92,88,15,188,104,209,98,22,47,94,60,157,248,79,0,210, 210,210,210,118,148,150,150,182,250,251,223,111,188,56,220,7,127,246,217, 231,32,182,9,192,152,58,222,63,0,156,98,209,180,117,153,25,169,93,63,124, 234,74,107,255,254,253,112,21,231,224,40,218,143,179,96,3,69,46,7,30,87, 57,10,43,237,82,146,57,117,76,111,203,57,147,199,164,111,220,178,61,253, 31,143,207,214,243,11,139,11,149,226,20,106,239,66,168,171,28,181,138, 199,4,96,36,112,217,5,103,79,208,148,171,128,194,109,63,213,186,113,151, 86,86,142,104,111,209,215,237,209,39,2,95,71,165,132,66,132,135,21,56, 206,98,177,157,11,234,2,139,197,146,150,217,178,69,82,86,203,86,9,169, 105,233,172,223,180,133,226,146,82,44,22,11,0,231,78,57,155,241,99,199, 112,223,67,143,176,224,231,159,73,72,76,36,49,49,209,112,149,151,31,15, 204,139,105,77,234,231,168,100,123,242,99,125,251,244,29,63,126,194,241, 122,235,214,173,18,202,203,93,218,186,117,127,148,207,158,61,199,170,161, 45,43,119,150,223,8,172,140,117,65,67,112,163,221,110,127,250,152,99,142, 97,228,200,99,184,227,142,219,195,122,240,71,31,125,140,197,139,23,135, 245,152,17,144,154,150,150,182,253,152,99,142,105,53,111,222,60,238,189, 247,158,176,159,192,151,0,196,181,140,212,196,199,79,157,48,44,241,201, 187,174,180,122,74,246,82,184,237,39,220,206,18,60,30,55,30,143,7,143, 199,141,215,237,14,248,126,61,186,174,211,178,93,63,62,125,246,10,235, 19,111,124,151,252,253,175,235,30,113,186,185,36,82,101,140,183,4,96,124, 102,106,210,172,103,31,184,193,62,126,252,248,26,175,252,171,234,223,209, 102,95,183,71,239,139,36,0,34,254,37,3,147,172,86,235,69,10,206,24,61, 106,20,103,77,57,39,109,254,79,63,107,187,246,84,238,194,201,203,207,231, 150,59,238,228,164,73,39,240,239,59,110,39,43,43,139,214,173,91,243,220, 83,79,48,247,251,31,184,255,225,135,201,106,217,42,237,96,206,254,139, 116,93,143,167,4,160,61,48,14,232,72,229,43,250,138,230,240,132,132,132, 191,141,61,126,244,19,255,186,235,206,164,212,180,84,242,243,242,241,184, 61,216,18,108,156,122,250,41,169,255,252,215,237,204,249,102,206,232,135, 31,122,124,161,174,235,119,121,60,158,167,99,82,147,208,92,159,154,154, 250,236,140,25,239,242,219,111,191,197,186,44,177,98,79,75,75,219,49,108, 216,176,214,51,102,188,75,135,14,29,99,93,158,88,25,216,169,99,199,179, 158,190,247,47,41,229,251,87,226,44,206,193,240,214,61,62,75,25,58,121, 187,86,81,176,127,51,127,191,228,164,228,245,59,138,254,180,101,199,158, 135,128,245,145,40,100,60,37,0,67,146,19,180,89,203,231,207,180,183,106, 153,69,201,222,149,228,111,175,253,234,223,79,211,80,52,158,41,141,141, 221,81,192,41,81,62,231,2,96,81,148,207,25,78,233,192,100,171,213,122, 169,161,212,196,148,148,20,207,208,225,71,167,207,120,231,109,173,91,215, 174,0,220,248,183,235,121,245,245,55,120,253,127,111,161,235,122,165,157, 231,126,255,3,203,87,172,228,174,127,222,193,196,241,227,201,57,112,128, 236,236,189,232,110,87,217,129,125,217,86,77,179,230,197,160,78,213,25, 158,146,146,252,92,102,102,230,240,83,79,159,108,244,232,209,35,209,98, 209,216,186,117,155,251,155,175,103,91,138,138,138,150,56,157,229,55,89, 173,214,97,55,254,227,111,79,158,119,254,57,137,127,172,219,192,129,3, 135,183,112,182,200,202,98,210,201,147,180,163,134,14,177,95,117,197,53, 247,23,21,22,19,207,73,64,74,155,35,30,182,56,115,238,156,241,238,219, 28,127,252,88,126,251,237,55,86,109,218,207,255,190,94,221,224,99,15,233, 221,142,33,125,131,27,12,28,99,246,204,214,157,14,28,53,224,136,212,15, 63,124,159,164,164,68,128,176,124,6,0,255,119,250,81,97,57,78,152,101, 2,69,213,188,62,178,117,102,82,226,127,223,250,128,226,130,92,116,221, 139,174,27,24,134,142,225,123,174,27,94,12,175,142,97,232,232,186,249, 240,63,55,244,34,210,126,255,18,123,130,43,1,56,150,234,19,128,32,135, 149,215,44,158,18,0,0,182,173,154,77,246,222,207,80,186,59,232,125,254, 216,235,117,18,161,12,73,28,38,217,102,181,220,127,214,137,35,19,38,141, 27,1,40,148,242,77,192,80,10,48,64,225,123,77,153,83,51,124,207,205,255, 20,40,21,240,190,249,186,127,27,243,80,70,197,235,110,183,155,7,95,252, 194,81,236,112,159,70,227,154,222,216,18,56,221,102,179,93,172,235,250, 184,164,20,187,187,101,171,86,233,153,45,91,105,9,9,9,41,37,14,39,255, 184,245,118,238,191,247,110,6,13,28,72,66,66,2,215,95,251,23,78,60,225, 4,238,185,239,62,214,111,216,88,233,96,251,246,237,99,234,165,151,25,109, 91,181,114,252,254,251,26,77,131,31,117,93,255,8,248,84,41,111,105,76, 106,24,192,102,179,221,218,166,109,155,251,30,126,236,129,148,193,71,14, 162,32,175,128,210,82,179,88,35,143,29,153,114,253,141,215,241,251,154, 181,99,239,188,237,223,63,79,60,97,130,245,236,115,206,76,252,245,215, 69,184,93,213,255,59,47,40,44,228,215,133,191,49,226,152,163,121,241,229, 231,83,47,155,122,197,253,30,143,231,71,96,85,244,106,21,180,235,3,131, 191,223,150,125,14,212,202,131,13,58,112,94,94,1,46,183,222,24,18,0,123, 90,90,218,206,35,7,246,73,253,240,131,25,21,193,31,96,78,3,63,3,128,77, 27,183,197,91,2,176,14,24,8,124,4,156,6,84,189,188,223,246,243,178,141, 79,254,188,108,227,97,59,6,175,98,72,219,246,26,54,184,195,247,117,67, 125,207,16,79,9,192,170,114,143,58,237,204,191,254,231,155,71,47,74,75, 25,210,45,184,162,237,201,55,216,146,99,88,48,167,78,136,200,91,236,213, 141,137,223,45,92,57,251,238,91,175,72,235,221,167,63,174,220,63,80,134, 23,165,20,74,25,190,0,111,84,121,174,64,25,40,195,23,220,125,95,85,192, 87,48,183,51,159,155,95,19,51,59,113,252,177,131,237,39,95,242,192,172, 98,135,251,12,226,187,175,187,13,48,217,106,179,93,97,79,73,57,246,79, 231,158,171,206,158,50,37,217,110,79,229,145,39,158,76,62,120,176,242, 31,194,109,219,183,115,233,149,87,115,217,37,83,185,246,234,171,72,74, 76,164,79,239,35,120,231,141,215,121,245,141,55,121,225,197,151,200,63, 152,235,45,42,200,119,120,220,110,11,154,54,123,223,238,93,239,0,223,2, 193,103,200,17,102,179,217,110,29,58,124,232,125,47,188,244,116,202,254, 125,57,252,248,253,2,188,85,154,59,109,182,4,142,232,221,139,47,190,254, 36,197,106,181,240,219,47,139,107,12,254,126,186,174,179,124,217,74,142, 159,48,150,203,175,188,44,229,127,111,188,245,156,211,89,126,124,36,235, 82,15,215,167,166,166,190,80,53,248,3,180,109,215,138,65,71,246,105,208, 193,215,175,219,210,160,253,163,196,158,150,150,182,115,216,176,97,173, 171,6,127,160,193,159,1,152,9,64,156,57,13,88,12,156,8,188,12,92,101,181, 90,207,183,90,120,83,11,104,141,86,1,255,39,224,69,175,161,18,13,67,89, 131,60,151,63,208,147,146,200,135,78,55,23,98,46,138,247,79,223,193,175, 175,111,37,226,41,1,0,64,89,18,45,119,124,80,202,163,23,166,81,87,18,224, 246,42,166,127,82,90,134,82,211,144,25,0,209,180,176,184,180,124,242,216, 51,255,54,251,167,47,158,79,235,209,33,147,146,173,223,162,116,47,74,233, 102,80,175,248,106,160,12,253,208,215,42,175,25,129,239,249,19,132,128, 215,0,58,13,185,152,185,239,222,99,63,105,234,125,95,197,97,18,208,195, 98,177,156,109,177,88,46,55,12,163,119,70,86,11,163,69,171,86,246,105, 247,222,203,37,23,95,132,166,153,127,11,70,142,24,193,163,79,62,201,215, 223,204,174,180,179,174,235,188,241,191,183,152,191,224,39,166,223,125, 23,94,175,135,175,103,205,210,223,123,119,134,107,243,230,205,14,80,31, 27,134,49,3,248,21,48,162,95,189,58,13,111,219,174,237,244,23,94,122,58, 101,227,250,77,100,103,87,63,235,205,235,245,176,97,253,6,138,10,11,177, 88,172,21,51,25,252,156,206,114,204,4,73,209,186,117,27,82,82,204,53,176, 60,30,55,219,183,110,227,244,51,78,181,252,247,213,55,70,96,46,142,82, 223,133,85,194,205,12,254,51,222,61,44,248,55,35,135,130,255,135,31,28, 22,252,27,98,64,151,12,206,59,174,11,0,206,236,154,46,130,99,102,39,112, 38,102,171,228,149,64,113,199,246,109,254,242,205,59,15,218,203,183,207, 174,104,210,55,155,253,189,190,102,125,243,161,235,58,86,139,194,102,81, 21,239,85,116,1,232,222,106,159,235,186,78,191,9,215,114,249,237,47,159, 177,105,103,238,181,134,193,159,48,199,19,189,65,3,254,30,198,83,2,48, 54,43,43,235,235,79,62,251,56,233,143,245,235,184,243,150,91,120,232,188, 148,26,147,128,61,249,6,211,63,41,45,219,147,111,204,118,121,121,38,186, 69,21,192,194,18,135,107,242,241,103,221,48,251,167,207,158,75,235,209, 235,36,138,55,127,11,74,175,123,207,16,40,101,112,96,197,12,58,12,189, 136,185,239,220,109,63,233,146,251,227,33,9,24,136,197,114,145,197,98, 57,191,83,135,142,93,82,211,210,180,114,143,215,63,71,31,128,39,159,121, 150,121,243,231,115,223,61,119,211,181,75,23,50,50,210,121,112,250,52, 38,159,124,18,247,61,248,48,57,190,126,111,165,20,142,178,82,22,46,152, 95,62,236,211,143,149,130,131,134,174,127,8,124,65,252,79,245,34,37,37, 249,185,135,31,125,192,190,111,95,78,141,193,63,208,190,125,251,15,123, 205,225,116,178,97,253,134,138,174,164,220,220,131,12,232,223,143,228, 148,20,223,62,57,140,26,125,28,61,122,118,119,111,218,184,121,28,102,179, 107,172,93,147,144,144,240,194,152,49,163,89,185,114,37,43,87,86,158,168, 176,104,209,98,200,234,87,231,65,186,181,78,162,91,43,179,43,119,103,158, 139,157,7,93,17,41,108,164,164,167,167,239,52,12,163,245,232,209,163,120, 229,149,87,234,125,156,227,251,102,84,60,255,105,99,49,0,231,30,215,133, 211,78,158,72,121,121,57,95,124,249,21,137,137,137,184,221,113,211,240, 5,176,4,184,4,152,169,193,223,255,247,244,109,90,11,45,135,178,212,196, 42,65,93,67,215,45,232,186,197,247,92,171,120,47,20,5,187,86,242,228,63, 255,108,63,251,175,207,62,99,24,42,9,200,5,26,52,205,196,210,144,157,195, 104,108,102,102,230,236,85,171,87,166,14,31,54,156,244,244,84,254,121, 247,93,252,251,227,114,86,237,172,60,189,121,203,126,157,191,190,89,92, 116,197,127,138,75,119,30,212,167,59,220,234,2,226,243,202,168,57,48,147, 128,41,55,150,110,219,91,72,250,17,39,129,22,108,171,86,240,148,210,57, 176,226,93,58,100,105,124,251,206,93,246,12,123,194,87,192,196,176,159, 40,56,231,36,37,37,173,152,62,125,250,157,203,151,45,235,189,99,199,246, 228,37,139,23,37,93,114,201,212,138,224,239,183,114,213,106,46,152,122, 9,51,63,254,164,34,184,141,25,53,138,119,255,247,6,45,179,50,217,181,109, 75,217,186,149,203,203,119,110,217,188,46,255,96,238,189,186,174,15,54, 116,189,43,112,27,141,32,248,3,237,51,50,51,134,15,58,114,32,91,54,87, 110,170,118,58,203,217,189,123,15,187,119,239,198,233,172,125,165,226, 188,131,7,81,74,209,162,101,11,90,182,108,129,82,138,220,131,135,198,53, 58,29,14,18,19,19,232,212,169,125,50,208,37,18,21,169,135,161,67,134,12, 161,95,191,126,20,22,22,50,127,201,70,222,153,189,134,111,150,238,230, 155,165,187,113,164,246,164,83,159,161,117,30,164,91,171,36,70,246,76, 102,100,207,228,138,68,160,49,41,41,41,105,125,249,229,255,135,195,225, 160,176,176,144,103,222,93,80,241,25,124,179,116,55,35,78,189,60,168,227, 28,223,47,147,33,157,205,175,126,153,246,4,22,46,92,200,178,101,203,56, 249,164,19,41,43,115,146,152,24,119,159,209,39,22,139,229,213,115,207, 60,193,123,84,223,14,154,243,96,67,250,252,107,183,127,243,111,180,204, 76,225,188,83,142,182,97,142,57,184,30,104,208,0,224,120,104,1,24,159, 153,153,57,107,205,239,171,237,45,90,180,96,215,222,237,12,29,54,20,165, 224,246,127,255,139,59,166,221,199,163,23,29,234,14,248,113,189,155,117, 123,244,79,128,27,136,81,179,127,97,81,25,193,182,66,154,219,154,203,251, 30,172,110,172,104,53,156,46,32,217,92,222,215,92,225,175,110,230,82,192, 49,177,176,196,225,154,60,110,202,223,103,47,248,244,153,180,30,71,156, 66,209,166,111,34,208,18,160,147,179,252,29,58,12,155,202,183,111,223, 101,63,249,210,7,190,42,118,120,98,209,18,240,157,219,227,81,155,182,110, 179,182,104,209,2,139,197,66,122,122,58,247,221,115,55,167,156,120,34, 211,31,124,136,253,57,135,214,175,113,56,156,60,248,232,99,124,251,221, 247,156,114,226,36,102,205,154,85,254,201,199,31,105,229,229,229,155,188, 94,239,27,192,71,134,97,236,141,114,29,194,101,220,105,103,156,102,20, 228,21,224,245,28,74,212,235,186,162,175,137,134,111,44,104,53,204,215, 53,141,248,153,237,147,51,113,226,132,138,121,254,255,249,116,5,63,109, 40,162,255,192,35,14,109,161,20,174,237,59,0,72,234,222,205,87,252,166, 231,190,251,166,87,60,255,98,243,107,140,61,175,242,36,33,195,225,196, 181,101,11,73,71,28,129,197,94,251,239,64,77,214,174,93,203,184,113,227, 152,55,111,30,25,25,105,13,42,111,152,37,216,147,173,231,78,191,229,210, 68,199,190,85,53,255,2,135,129,82,6,59,87,207,230,218,63,159,110,253,228, 219,101,110,151,71,53,248,34,33,214,9,192,97,193,95,249,70,136,27,134, 129,61,197,142,178,36,150,223,254,126,169,122,236,162,180,20,128,143,23, 187,202,128,87,137,81,240,79,74,91,80,110,105,189,124,65,113,144,219,91, 90,67,89,171,236,130,124,43,11,66,57,79,201,18,103,65,217,236,173,11,96, 107,208,251,28,112,170,88,221,20,198,76,2,206,249,199,236,5,159,62,157, 214,189,247,100,138,55,125,141,10,115,195,140,153,4,188,69,135,97,151, 48,231,237,127,219,79,185,244,193,88,36,1,37,22,139,101,201,207,63,253, 52,246,188,139,205,193,123,255,119,201,84,44,22,11,163,142,59,150,79,63, 124,159,167,158,125,142,79,62,255,2,143,199,67,73,81,33,5,121,7,75,126, 95,190,52,241,237,55,254,187,196,235,245,190,11,124,78,252,244,99,55,68, 231,30,221,187,39,250,71,251,251,5,94,209,107,64,126,126,1,185,7,243,232, 210,165,115,181,7,105,221,186,13,185,185,7,201,207,47,0,192,98,177,208, 186,77,235,138,247,83,236,41,120,60,30,246,238,221,231,164,49,172,119, 173,20,174,29,59,41,95,186,132,52,155,153,179,20,45,93,76,242,136,145, 135,37,2,59,243,92,213,62,111,10,12,135,19,231,202,229,184,55,109,162, 83,167,246,236,93,190,148,196,62,125,73,25,58,236,176,68,224,167,13,254, 171,163,234,175,146,142,232,125,4,27,54,108,224,164,147,78,226,135,31, 126,96,234,212,169,188,251,238,187,17,174,65,221,172,86,166,158,125,242, 241,246,246,45,18,41,60,152,27,241,243,21,231,110,167,147,81,206,159,38, 13,182,204,252,118,205,21,94,131,7,27,114,188,88,38,0,99,51,51,51,191, 94,189,102,85,165,224,239,245,122,88,186,120,25,5,5,133,76,191,247,129, 82,151,203,117,34,144,124,199,251,165,179,0,202,61,234,116,204,209,151, 49,97,111,251,71,114,203,30,137,227,82,50,130,251,232,156,197,94,210,202, 156,11,82,50,25,151,146,81,247,246,230,62,176,255,99,125,1,235,245,113, 193,221,114,8,202,0,11,161,37,25,245,84,227,58,0,37,14,215,187,199,159, 115,211,21,11,62,121,42,177,71,159,83,41,218,240,181,57,19,32,140,148, 210,217,191,236,45,58,28,125,41,115,222,250,151,253,148,203,30,138,122, 18,160,123,189,111,21,230,231,15,201,106,217,42,253,217,23,94,228,231, 95,126,97,250,221,119,211,181,75,103,10,10,11,105,215,166,53,101,69,5, 197,91,55,111,78,178,88,44,191,234,186,254,63,224,51,175,215,91,18,173, 50,70,137,77,3,173,166,43,219,218,174,232,3,165,164,36,51,160,127,191, 138,102,255,214,109,90,147,146,124,232,70,152,29,58,180,231,64,78,14,219, 183,239,72,36,206,167,130,122,114,114,112,44,88,64,138,166,24,61,164,47, 157,186,152,211,247,246,103,231,178,124,249,146,195,18,129,157,7,27,95, 191,127,48,202,126,89,136,107,195,70,122,247,233,206,224,179,38,145,156, 146,132,203,229,102,221,250,173,108,252,224,125,18,251,86,78,4,252,253, 254,53,121,227,127,175,114,229,229,127,169,104,9,248,238,187,239,120,231, 157,119,166,106,154,22,211,44,32,195,158,124,233,149,23,159,98,119,229, 109,142,218,57,115,182,44,230,212,19,70,38,125,49,111,205,185,94,87,227, 76,0,198,102,102,102,206,94,189,102,85,106,203,150,45,43,130,191,219,229, 98,241,162,165,20,21,21,169,251,239,123,168,208,225,112,140,199,119,35, 137,114,143,242,47,170,29,169,27,75,4,45,37,195,70,171,206,193,221,169, 55,111,79,57,148,65,74,6,180,9,114,81,44,127,30,153,10,180,174,109,195, 216,168,117,29,128,173,59,247,114,242,197,119,240,237,123,143,210,189, 239,233,184,139,118,163,148,126,104,58,160,97,174,21,16,56,253,239,176, 41,131,1,211,0,21,85,246,241,109,231,42,220,67,207,94,19,152,253,198,237, 246,201,87,60,22,237,36,224,139,210,226,162,23,149,97,160,89,44,44,90, 180,152,9,147,38,25,109,91,182,116,46,89,178,24,77,211,102,235,186,254, 54,48,87,215,245,166,247,215,253,144,221,219,118,108,119,29,59,122,100, 165,203,185,186,174,232,171,147,156,146,82,109,11,65,66,66,34,61,122,245, 228,141,87,223,80,54,171,117,145,7,79,92,223,31,192,189,107,23,157,51, 82,57,118,204,48,172,214,67,67,172,58,116,108,203,105,29,219,144,189,39, 135,21,75,23,215,216,34,208,84,148,173,254,157,41,83,78,34,61,43,141,54, 221,218,208,127,220,64,146,82,147,106,189,171,77,109,90,180,108,193,235, 111,254,135,43,47,255,11,27,54,108,224,196,19,79,100,222,188,121,111,42, 165,60,154,166,125,24,214,194,7,207,230,242,170,145,3,250,247,197,181, 125,78,208,59,109,217,91,202,111,127,228,85,252,221,51,12,131,97,189,210, 232,218,38,184,25,20,5,251,54,48,248,228,211,208,149,173,63,120,19,105, 192,148,224,104,36,0,35,129,241,1,223,39,103,102,102,222,94,181,217,223, 233,44,103,241,162,37,228,230,30,80,79,60,250,116,174,195,225,24,69,229, 246,239,152,7,126,1,212,185,14,64,63,198,14,233,194,169,83,255,201,131, 183,95,74,74,74,178,111,13,0,85,177,8,80,224,162,64,170,226,251,67,239, 155,249,196,161,109,43,22,13,242,95,77,42,0,29,181,233,59,80,112,250,248, 1,246,153,223,174,158,227,213,25,75,116,90,135,14,90,44,150,117,187,182, 111,61,202,81,90,86,174,235,94,39,240,209,54,195,248,0,243,78,109,225, 29,0,17,191,126,254,230,171,217,218,245,55,92,71,66,66,2,30,143,57,247, 191,174,43,122,155,45,129,225,35,134,177,114,197,42,220,174,154,243,35, 171,213,202,240,163,135,178,109,203,86,222,120,253,45,167,203,229,186, 41,178,213,9,15,155,205,74,89,126,41,137,41,137,36,165,38,85,12,14,213, 208,232,212,185,61,29,59,181,99,239,158,253,44,95,178,136,162,165,139, 177,143,27,79,66,187,118,49,46,117,248,25,110,157,178,130,50,198,94,50, 142,73,167,76,98,225,194,134,117,89,183,104,217,130,255,190,241,74,69, 18,112,210,73,39,217,126,248,225,135,119,149,82,196,40,9,56,122,228,176, 129,222,36,229,160,60,132,133,235,126,250,253,32,111,206,217,17,120,71, 199,49,229,19,218,143,238,218,166,77,80,251,123,221,78,220,101,185,28, 217,175,187,123,201,154,45,67,105,192,223,188,72,39,0,227,179,178,178, 102,189,248,210,11,246,192,209,155,163,71,143,34,53,45,181,34,248,59,202, 28,44,94,188,132,221,187,118,235,47,62,255,202,94,135,195,49,154,198,208, 215,215,124,213,186,14,192,144,54,6,47,223,60,130,185,191,124,119,40,168, 7,174,0,232,95,48,200,23,220,253,175,85,4,123,101,4,36,11,144,210,118, 0,165,229,138,15,191,254,197,227,246,232,159,96,206,193,173,78,212,198, 64,120,189,222,187,75,138,138,142,55,12,227,35,96,121,180,206,27,103,118, 23,21,21,175,252,125,205,218,227,142,232,125,4,235,255,56,180,24,103,77, 87,244,0,189,251,30,129,205,106,99,204,152,81,172,93,187,142,3,57,213, 44,5,220,34,139,65,131,7,147,155,123,128,235,254,114,67,153,174,235,247, 16,159,171,0,86,75,41,133,203,225,194,237,116,147,100,79,34,209,158,120, 40,17,208,52,58,119,233,64,199,78,237,88,180,112,5,251,118,237,106,146, 9,0,128,215,227,37,57,45,185,65,193,127,216,240,67,179,41,90,182,106,89, 209,18,176,118,237,90,78,56,225,132,88,38,1,221,142,236,215,221,162,187, 235,213,179,247,61,48,205,247,124,26,48,58,148,157,157,197,7,232,213,181, 149,101,201,154,45,221,136,211,4,96,108,86,86,214,215,171,86,175,180,183, 110,221,26,135,243,208,152,61,195,208,217,189,119,7,74,41,74,74,74,88, 186,104,41,91,182,110,243,190,241,250,255,182,58,28,142,177,28,106,5,23, 241,171,214,117,0,134,246,110,197,144,94,45,26,188,16,144,217,228,159, 71,155,161,23,113,253,212,19,19,78,186,228,254,51,227,96,29,0,128,238, 134,97,28,9,28,25,227,114,4,122,147,40,207,145,119,58,157,127,187,243, 214,127,45,252,252,235,79,83,138,138,138,200,222,155,93,235,246,157,58, 119,162,67,135,14,44,252,105,33,25,153,25,244,239,223,159,129,3,7,144, 151,151,135,219,237,198,102,75,160,101,203,44,172,86,27,179,190,153,173, 30,125,240,49,167,97,168,127,123,189,222,103,163,84,165,176,82,74,81,94, 86,142,203,225,170,212,34,160,123,117,156,197,78,172,214,240,79,155,141, 103,191,175,111,248,141,29,91,182,106,89,117,76,128,109,222,188,121,209, 74,2,126,230,208,45,120,189,9,201,41,40,143,51,194,167,60,156,203,81,68, 74,106,11,27,48,3,240,215,121,33,16,210,138,84,145,74,0,42,230,245,183, 108,217,146,29,187,183,30,234,39,14,80,88,88,196,178,37,203,88,179,250, 119,247,135,31,124,180,201,225,112,140,3,242,35,84,38,17,126,254,117,0, 102,47,248,236,217,180,30,71,156,68,241,230,217,132,123,89,134,138,117, 0,134,254,153,111,223,185,203,126,242,37,247,199,106,10,96,160,243,7,13, 26,52,238,252,11,47,172,120,97,230,71,31,147,147,83,185,139,250,252,243, 206,163,93,187,182,0,236,220,185,139,47,191,250,234,240,3,133,97,27,71, 105,9,101,165,165,118,162,191,72,206,138,131,7,243,238,189,254,218,27, 166,191,248,202,243,41,153,153,153,108,222,188,185,210,180,64,48,251,242, 143,232,211,139,14,29,58,176,100,241,18,220,110,55,7,115,15,242,115,238, 207,100,100,166,147,149,213,130,132,132,4,178,247,238,227,149,151,254, 83,246,253,119,243,172,104,252,230,114,185,255,65,19,232,254,11,108,17, 176,37,217,240,148,215,125,103,56,81,179,170,99,2,38,78,156,24,205,36, 192,79,179,39,217,44,170,234,82,191,81,161,176,89,148,149,6,78,139,141, 68,2,80,237,212,190,234,44,94,180,152,197,139,150,186,102,207,154,179, 212,225,112,156,140,44,231,219,24,53,183,117,0,42,28,44,40,228,184,227, 70,49,105,226,4,0,206,58,243,44,174,188,246,186,74,171,149,21,149,150, 242,212,19,143,147,152,152,136,82,138,204,22,45,248,126,94,229,219,86, 132,99,155,156,236,189,148,85,153,142,23,45,94,175,247,241,213,171,214, 168,179,207,248,211,125,143,60,246,96,202,196,19,38,144,159,159,79,105, 73,25,154,166,145,154,102,167,85,171,150,100,239,221,199,207,11,22,226, 241,84,238,47,45,46,42,161,184,200,108,70,253,254,187,31,248,254,187,121, 159,98,174,112,86,219,226,22,129,99,139,230,0,225,185,229,92,132,41,165, 36,248,135,73,117,99,2,126,255,253,247,119,57,116,69,28,9,129,87,216,127, 77,78,176,62,165,89,172,81,95,157,200,98,77,192,98,113,120,49,215,195, 249,111,189,143,19,190,34,1,33,4,127,48,251,135,62,250,240,227,164,210, 210,210,19,144,224,223,152,249,215,1,40,221,158,93,72,70,239,201,104,17, 90,17,48,103,249,91,116,200,132,57,111,255,59,214,43,2,162,148,226,158, 233,247,177,109,187,185,78,249,145,131,7,113,247,63,239,172,180,205,154, 223,215,114,255,195,143,0,102,223,239,125,247,222,67,175,158,61,35,178, 77,44,121,189,222,39,246,239,219,63,230,154,43,175,93,247,250,107,111, 144,159,151,143,199,237,198,229,42,103,239,238,189,204,251,126,62,191, 175,89,123,88,240,175,193,54,106,15,254,227,219,119,104,63,127,226,9,227, 31,233,214,189,219,35,192,148,176,84,162,129,90,186,214,145,84,176,28, 77,41,52,67,15,238,161,20,73,5,203,201,220,250,159,106,31,45,93,235,98, 93,173,144,101,110,253,15,64,69,29,155,176,61,91,118,238,245,88,18,163, 191,48,81,74,122,107,118,236,41,240,16,202,66,49,213,8,103,2,80,237,188, 254,32,197,213,2,207,162,86,71,97,222,157,170,234,99,180,111,29,0,247, 246,236,66,50,250,156,26,177,36,96,255,50,95,18,240,214,191,98,158,4,148, 57,28,252,227,214,219,43,110,125,123,230,233,167,113,238,148,179,43,109, 243,229,215,179,248,248,179,207,1,72,181,219,121,250,241,71,73,75,75,139, 200,54,49,182,194,237,246,124,220,163,71,15,108,54,27,91,183,110,99,219, 214,237,236,219,183,191,98,134,64,144,70,83,253,239,216,29,192,189,29, 59,117,156,115,252,184,49,201,163,199,140,162,119,239,94,97,175,68,125, 181,112,255,65,70,201,74,92,229,229,128,7,13,111,157,15,48,104,237,92, 69,223,130,183,14,123,116,202,126,131,22,238,63,98,93,173,144,101,108, 125,21,0,183,203,233,171,99,100,20,228,23,112,213,21,215,178,101,243,22, 250,245,235,199,119,223,125,231,5,166,70,236,132,135,219,181,226,247,205, 202,154,220,34,138,167,52,165,182,232,200,186,205,187,172,52,48,1,8,87, 23,64,181,243,250,69,147,36,235,0,84,177,115,215,46,254,117,207,52,158, 121,226,49,44,22,11,255,188,253,54,182,237,216,193,138,149,171,42,182, 121,248,177,199,233,217,189,59,195,134,14,161,91,215,174,60,116,223,52, 254,113,235,237,24,134,17,150,109,226,81,90,90,26,105,105,193,45,101,85, 84,92,140,211,225,164,111,223,222,36,38,38,78,2,38,213,180,109,122,70, 58,71,28,113,4,169,169,193,46,147,21,61,157,91,237,99,253,222,109,44,248, 245,32,253,122,245,161,125,187,150,104,181,116,211,106,64,90,138,141,14, 45,15,95,87,100,95,126,57,17,140,159,17,53,168,251,54,126,248,217,160, 107,231,14,156,19,129,227,23,228,23,112,229,229,127,97,243,166,205,244, 235,215,143,31,127,252,209,219,190,125,251,169,81,158,9,176,110,253,230, 157,150,210,178,114,172,201,89,232,101,13,90,150,63,104,169,45,58,82,234, 212,201,57,144,231,161,129,179,229,194,145,0,132,212,236,239,151,159,151, 143,205,214,188,70,192,54,17,178,14,128,79,89,105,9,185,251,205,59,224, 125,252,209,76,48,188,244,237,211,23,128,46,29,59,240,237,236,202,183, 254,189,242,170,171,184,234,202,43,43,190,207,74,75,101,227,166,77,97, 217,102,75,105,252,45,50,152,158,145,134,69,179,84,186,55,66,117,218,183, 107,71,86,86,38,78,135,147,214,109,90,163,89,106,255,187,144,149,149,21, 116,98,17,109,89,105,7,153,114,220,44,118,29,232,200,242,173,197,108,216, 154,81,99,34,160,80,148,151,187,73,137,187,251,219,52,220,113,253,150, 51,164,199,58,86,109,31,88,233,245,193,253,235,190,65,82,85,195,134,15, 229,173,119,223,168,248,62,63,47,159,43,47,255,11,91,54,111,97,208,160, 65,252,240,195,15,222,182,109,219,70,59,248,3,120,146,19,109,223,254,178, 120,217,148,241,195,186,105,238,40,37,0,173,187,30,197,194,69,43,13,139, 166,62,162,129,35,174,27,154,0,212,43,248,23,23,23,179,98,249,10,150,46, 93,238,78,75,75,251,177,234,90,226,241,206,89,236,53,87,248,11,114,91, 243,107,240,115,27,157,190,85,49,203,106,223,172,146,80,182,13,131,102, 191,14,0,176,126,240,192,1,227,38,157,116,82,165,23,115,14,28,234,186, 190,234,202,195,239,132,22,248,254,216,177,163,25,59,246,240,233,191,245, 217,198,229,44,227,183,223,22,173,63,108,195,24,219,179,119,47,43,150, 215,62,245,107,216,240,161,116,236,216,129,140,204,116,122,29,81,119,147, 126,94,94,30,133,5,133,97,42,97,248,105,64,183,182,217,116,109,155,93, 109,34,0,176,63,39,159,13,91,55,99,161,152,35,251,199,236,70,94,17,149, 146,84,206,113,253,150,83,94,180,159,49,99,198,212,123,45,128,192,223, 159,56,10,254,0,20,149,186,102,60,247,250,231,39,157,52,241,169,52,75, 206,58,116,61,178,67,217,108,137,41,180,237,62,140,25,143,63,86,86,238, 161,193,203,32,55,36,1,168,87,159,127,73,73,9,75,22,45,97,205,234,223, 221,179,190,154,189,188,180,180,244,236,6,148,33,234,178,74,6,150,119, 201,30,184,128,218,167,59,87,82,96,243,20,44,43,181,45,32,132,123,190, 229,118,41,42,200,47,112,135,180,182,255,182,252,29,229,228,111,169,123, 195,240,104,238,235,0,228,0,108,223,181,155,53,191,199,118,160,214,145, 131,43,174,178,226,122,153,220,186,180,111,223,158,140,140,12,214,175, 175,57,143,177,104,86,142,25,57,130,85,43,87,147,151,23,157,43,174,250, 170,62,17,48,111,119,107,161,136,17,189,86,210,181,109,118,220,220,222, 48,82,182,124,125,19,63,124,243,17,137,233,237,67,222,55,240,22,219,213, 245,249,199,50,248,251,124,185,242,143,157,69,107,86,175,74,235,211,117, 32,158,221,75,35,122,178,206,3,79,96,245,154,85,236,222,95,80,140,185, 38,65,131,212,55,1,168,87,159,127,89,153,131,37,139,150,178,126,195,38, 207,204,15,63,89,95,86,86,118,18,209,189,106,107,176,182,214,1,201,221, 83,70,142,75,79,75,15,106,251,146,210,18,74,138,75,23,36,118,236,48,174, 99,135,78,65,237,147,189,111,47,123,212,154,5,229,237,61,227,18,147,18, 130,218,199,237,242,80,12,11,162,152,0,64,243,94,7,64,68,192,170,149,171, 185,245,230,59,2,151,73,173,202,54,122,204,168,235,159,126,246,137,228, 21,43,26,190,168,76,52,84,77,4,128,102,17,248,253,242,55,126,203,162,199, 7,84,124,239,116,37,179,117,127,23,122,181,223,77,74,82,205,127,254,143, 191,239,208,146,48,85,251,252,191,255,254,123,218,183,111,255,127,49,14, 254,0,222,50,167,251,198,191,222,245,226,91,63,125,254,82,90,66,218,78, 92,197,33,92,29,134,32,189,77,15,178,58,14,224,218,251,30,46,245,120,185, 141,48,252,161,173,79,2,48,36,37,37,101,206,234,53,171,236,45,90,6,127, 229,239,44,119,178,120,209,18,182,111,223,225,157,241,206,123,27,203,202, 202,198,2,141,171,237,223,39,61,45,157,14,29,131,204,102,179,161,164,184, 148,142,29,58,49,124,216,240,224,246,89,1,176,134,196,164,4,210,211,131, 235,235,44,137,118,39,192,33,205,118,29,0,17,49,129,203,164,30,230,151, 133,191,126,253,215,191,220,240,205,128,65,3,82,118,236,168,169,55,40, 254,248,19,129,230,46,37,169,156,65,221,66,187,123,222,21,255,119,77,96, 179,63,55,223,124,51,51,102,204,152,17,161,34,134,234,231,205,59,115,139, 94,123,253,221,148,171,174,152,106,245,108,252,6,93,15,239,152,156,196, 148,76,122,29,115,46,175,190,249,158,190,251,64,89,158,110,254,27,105, 176,122,181,0,40,165,212,238,221,187,40,117,22,5,21,252,93,46,23,139,127, 91,202,158,221,187,245,215,95,123,125,71,89,169,227,120,32,254,70,45,137, 250,242,175,3,48,123,193,167,79,167,117,239,61,153,226,77,95,163,34,208, 18,144,179,252,45,58,12,187,132,57,111,255,219,126,202,165,15,74,18,16, 231,218,183,111,199,81,71,213,190,90,114,251,246,33,175,131,63,127,217, 178,229,19,150,45,91,238,159,255,255,89,125,202,38,26,143,128,102,127, 82,83,83,136,159,216,79,91,224,7,151,91,239,244,239,103,63,119,13,29,212, 221,58,100,216,68,242,55,205,69,215,195,115,125,155,144,156,206,17,199, 253,153,69,191,204,231,191,95,172,245,232,134,234,134,249,55,239,4,224, 240,27,105,132,160,62,235,0,172,42,47,47,63,229,196,19,79,46,93,244,91, 221,3,174,221,110,55,139,127,91,66,238,129,92,227,197,231,95,217,95,90, 234,24,11,20,212,227,188,34,190,249,146,128,155,74,155,211,58,0,162,102, 133,133,69,88,173,54,186,118,235,90,235,195,106,181,81,88,88,20,234,225, 23,3,119,250,30,141,98,21,64,81,127,131,6,13,98,193,130,5,164,167,167, 85,90,105,51,198,218,2,63,0,131,128,181,94,221,184,224,236,191,62,231, 88,187,102,21,45,122,159,136,45,57,163,193,39,72,74,107,69,223,177,151, 177,102,245,10,110,126,106,174,67,55,212,249,192,90,223,57,127,240,149, 161,222,234,59,6,96,97,185,179,124,242,223,254,250,247,217,47,188,244, 108,218,200,99,143,169,118,35,175,199,203,146,69,75,56,120,48,87,61,241, 216,83,57,14,135,227,24,106,95,225,75,52,110,11,75,28,174,201,19,206,187, 101,246,143,31,61,153,214,92,214,1,240,123,226,209,105,33,109,127,235, 29,161,109,223,152,180,104,217,2,93,15,190,5,40,37,37,133,22,45,91,192, 214,237,17,44,85,228,149,58,117,115,254,126,152,142,69,112,67,128,226, 78,56,62,3,103,97,54,99,198,140,161,188,188,156,47,190,252,138,212,212, 20,220,238,154,111,31,29,101,109,48,155,225,7,1,27,128,19,129,253,142, 114,239,217,167,93,253,212,39,47,79,191,52,117,242,228,83,44,133,59,23, 83,118,96,83,173,7,170,73,139,206,131,233,208,127,34,95,125,61,203,152, 254,202,60,135,219,171,254,4,204,5,22,97,6,255,193,192,2,204,11,160,125, 245,57,71,67,102,1,212,154,4,232,186,206,146,37,203,40,44,40,86,143,60, 252,68,158,211,225,28,13,161,140,157,23,141,212,194,226,210,242,51,38, 156,123,243,215,79,221,115,117,106,83,94,7,64,84,111,206,156,185,36,37, 39,134,188,223,254,253,251,152,51,103,110,4,74,20,29,59,156,93,176,164, 78,9,223,24,216,36,216,81,214,153,224,134,14,199,143,237,89,231,177,61, 12,159,65,209,251,239,242,245,215,95,2,240,207,23,231,243,224,117,199, 55,252,160,225,51,15,223,149,63,149,155,226,191,115,186,188,199,252,117, 218,219,63,156,243,203,239,45,238,190,245,234,148,214,45,123,82,184,107, 25,142,194,224,194,95,106,139,206,180,57,98,52,229,94,27,255,126,232,165, 242,239,22,109,61,224,246,170,147,128,141,190,77,114,49,23,202,242,183, 62,204,197,76,6,66,214,208,117,0,170,77,2,12,221,96,233,146,101,20,21, 21,112,255,125,15,22,57,29,206,177,64,227,78,237,69,40,230,23,151,185, 38,93,117,199,11,103,71,249,188,49,157,81,210,148,175,232,67,240,217,247, 115,127,72,254,126,238,15,13,58,70,184,10,19,45,19,142,238,134,203,125, 66,216,143,219,210,119,236,198,226,166,139,143,165,160,248,168,176,28, 107,31,240,204,123,139,0,232,215,45,250,203,237,214,97,144,239,107,117, 253,240,27,28,229,222,62,159,204,93,57,237,179,239,175,191,254,206,191, 156,153,56,229,140,147,172,29,123,36,224,44,220,77,86,171,82,96,71,165, 29,90,180,106,79,135,1,19,177,103,117,162,216,225,229,131,175,230,122, 95,152,49,223,109,232,250,75,46,47,211,57,124,192,252,1,223,185,115,2, 202,18,178,112,172,4,88,41,9,56,102,228,8,150,47,91,65,97,65,33,211,238, 121,160,200,225,112,140,193,108,34,17,205,203,34,223,67,52,47,171,105, 134,125,242,125,186,182,162,79,215,86,177,46,70,204,93,114,106,189,46, 68,27,179,154,6,225,149,57,93,222,219,128,151,31,122,249,243,91,30,120, 233,243,169,35,135,244,209,78,26,53,192,190,115,127,217,97,131,163,118, 229,58,249,98,254,70,99,222,226,47,202,150,173,217,166,44,154,246,94,185, 199,120,24,216,85,143,115,7,45,92,247,2,168,72,2,158,120,234,209,52,183, 203,205,244,123,31,40,117,148,57,78,0,26,223,237,172,132,8,82,187,54,109, 57,50,198,127,243,218,181,105,203,214,13,113,183,8,160,16,2,182,57,93, 250,245,192,77,63,45,89,63,241,215,101,235,71,217,147,19,38,2,129,255, 96,255,152,191,100,235,194,89,63,111,252,209,48,248,21,248,1,84,84,238, 25,29,174,4,0,204,36,224,140,219,110,190,115,22,160,156,78,231,137,192, 242,48,30,95,136,184,178,123,247,30,126,253,57,164,197,26,35,98,235,134, 245,236,222,221,160,123,130,136,122,88,180,104,49,207,62,251,92,212,207, 25,111,162,253,25,52,82,110,96,142,215,96,78,177,195,115,79,149,247,102, 150,56,189,51,99,81,168,112,38,0,0,243,157,78,231,113,152,195,180,126, 15,243,177,133,136,39,159,237,217,179,39,121,207,158,184,10,188,141,174, 239,188,17,91,184,96,193,130,71,23,44,136,73,2,88,191,69,245,35,227,209, 233,211,239,139,117,25,98,33,94,126,6,13,42,71,184,19,0,128,53,17,56,102, 92,41,41,45,9,122,62,67,137,239,46,109,217,251,246,250,86,248,171,91,246, 62,243,166,1,110,151,39,232,21,254,220,174,168,180,24,137,67,154,101,95, 183,168,240,61,97,90,141,173,145,187,51,214,5,136,145,177,177,46,128,79, 131,202,17,137,4,160,73,91,181,114,101,22,230,220,203,160,149,187,156, 229,201,73,41,33,237,147,179,55,191,220,157,175,135,180,207,246,131,91, 178,66,217,94,8,33,68,243,213,92,238,71,17,46,227,125,143,120,54,223,247, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,136,198,65,139,117,1,154,176,145,192,248,90,222, 183,0,70,16,199,9,102,187,15,129,29,65,149,74,8,33,132,0,108,177,46,64, 19,53,62,195,158,48,247,207,147,7,39,216,172,135,231,88,94,221,96,231, 190,98,122,116,202,196,162,213,156,131,5,179,221,130,101,155,89,179,173, 56,5,152,22,166,178,11,33,132,104,6,36,1,8,191,177,25,169,9,115,223,188, 231,140,132,49,67,58,31,246,166,203,173,51,119,241,118,238,184,236,56, 82,146,106,254,248,131,217,110,251,198,21,108,250,163,132,53,97,43,186, 16,66,136,230,66,18,128,240,26,155,150,98,155,247,240,245,19,108,157,218, 166,177,61,187,176,210,155,110,143,193,194,85,123,24,117,84,39,246,231, 149,214,120,144,96,182,115,229,111,97,197,178,69,225,44,187,16,66,136, 102,36,90,9,64,34,48,20,56,198,247,181,157,213,106,109,103,177,88,218, 40,165,28,134,97,56,13,195,200,5,182,0,191,251,30,139,1,111,148,202,23, 14,99,51,82,19,126,120,248,250,9,182,225,253,219,31,246,102,96,80,79,78, 180,214,120,144,96,182,91,185,106,37,123,182,174,163,117,122,216,202,46, 132,16,162,153,137,100,2,144,12,76,6,46,178,88,44,103,26,134,145,4,144, 149,149,165,119,232,208,65,203,204,204,176,216,237,169,120,189,94,92,46, 23,14,71,153,218,182,109,251,9,101,101,101,86,0,171,213,90,164,235,250, 151,192,167,192,87,128,30,193,178,54,212,216,140,212,132,31,234,106,246, 191,248,148,1,65,53,251,215,182,221,246,141,43,216,179,117,93,216,10,46, 132,16,162,121,138,68,2,144,14,252,205,106,181,222,174,235,122,86,86,86, 150,62,102,204,104,107,159,62,125,232,218,181,11,127,252,177,222,186,120, 201,50,214,111,216,68,105,73,9,154,6,169,105,233,244,236,217,83,155,58, 245,207,214,190,125,251,178,111,223,126,214,174,253,61,243,151,95,126, 189,184,184,184,248,18,171,213,186,83,215,245,199,129,55,1,71,4,202,220, 16,65,5,255,73,199,116,15,42,248,215,182,221,246,141,43,248,237,183,95, 195,86,112,33,132,16,205,87,56,167,1,90,129,27,172,86,235,189,134,97,100, 141,24,113,180,58,241,196,73,218,128,1,3,177,88,44,252,244,211,79,188, 255,193,71,116,59,162,63,67,71,157,72,255,163,142,166,85,155,182,216,44, 26,133,249,185,108,88,189,132,37,63,205,101,251,150,245,92,120,193,249, 28,127,252,241,24,134,193,218,181,107,153,53,235,27,99,205,154,53,22,171, 213,154,171,235,250,13,152,211,222,226,193,216,180,20,219,188,71,111,152, 24,241,102,255,192,62,255,131,37,230,107,173,211,97,206,239,138,111,215, 170,233,200,44,0,33,132,16,33,8,87,2,208,207,106,181,254,79,215,245,145, 195,135,15,87,231,156,115,142,214,179,103,15,18,19,19,104,221,186,53,207, 61,255,18,43,86,175,227,210,91,30,165,71,223,65,216,44,26,54,171,134,205, 98,193,106,213,42,125,191,109,211,239,60,126,247,141,12,234,223,151,203, 46,187,132,242,114,23,0,219,182,109,229,221,119,223,51,214,175,95,111, 209,52,109,142,82,234,90,96,103,152,202,95,31,254,62,255,132,104,247,249, 7,38,0,179,215,40,230,174,147,4,64,8,33,68,104,194,145,0,76,181,88,44, 175,167,166,166,218,46,191,252,255,44,199,29,119,28,201,201,201,244,236, 217,131,78,157,58,113,195,141,55,241,199,182,108,46,191,227,89,82,82,237, 216,44,22,51,216,91,53,172,254,231,150,202,223,123,202,29,60,112,219,213, 244,234,214,145,123,238,185,139,29,59,118,112,240,96,30,74,25,204,159, 191,128,119,223,157,161,187,92,174,18,93,215,167,0,243,195,80,135,80,69, 181,217,255,171,185,102,179,127,213,4,32,211,14,239,45,82,172,218,165, 238,7,238,105,80,141,132,16,66,52,43,150,6,236,171,97,6,157,183,7,14,28, 144,240,248,227,143,91,70,143,30,205,17,71,28,193,216,177,99,232,210,165, 11,239,189,247,62,191,44,89,201,197,183,60,141,53,49,25,221,80,135,30, 186,66,55,12,223,215,202,143,196,100,59,119,63,241,26,139,150,46,103,238, 220,239,24,62,124,56,195,135,15,39,35,35,147,9,19,38,240,240,195,15,91, 187,116,233,146,161,105,218,247,192,181,225,249,40,130,54,50,195,158,240, 195,91,211,106,14,254,223,47,221,193,137,65,4,255,186,182,171,173,207, 223,107,192,31,217,138,214,105,64,112,43,10,10,33,132,16,21,26,210,2,240, 18,112,221,132,9,227,185,242,202,43,104,217,178,37,131,7,15,38,53,53,21, 0,135,195,193,144,97,35,184,232,246,23,233,118,196,32,179,169,223,215, 204,111,94,237,87,247,253,161,22,1,171,85,99,199,166,63,184,235,134,169, 44,91,186,8,187,221,142,82,138,109,219,182,177,117,235,54,156,78,7,175, 188,242,31,181,120,241,18,13,184,3,120,172,193,159,70,112,166,77,29,147, 124,239,213,19,82,170,125,115,111,190,25,139,59,181,172,61,183,10,102, 187,21,91,138,128,202,77,254,0,251,139,96,243,1,197,200,158,26,243,254, 144,49,0,66,8,33,66,87,223,22,128,233,192,117,103,159,125,22,215,92,115, 13,93,187,118,227,152,99,142,169,8,254,0,159,126,250,41,157,142,56,146, 246,221,251,227,173,114,213,239,53,20,251,247,236,100,214,7,175,241,245, 7,175,177,111,207,78,223,213,127,229,22,129,30,125,6,210,103,224,81,124, 246,217,231,0,104,154,70,175,94,189,56,230,152,17,100,101,181,224,239, 127,191,81,27,55,110,28,192,35,192,95,26,246,81,4,207,214,144,118,147, 6,242,234,102,240,63,162,173,70,45,67,11,132,16,66,136,90,213,39,148,93, 11,220,51,113,226,68,46,184,224,2,122,247,238,205,160,65,230,72,255,64, 159,125,49,139,222,35,78,62,172,121,95,55,20,115,63,122,157,239,223,125, 132,147,70,244,98,214,140,231,153,118,253,185,124,249,254,107,21,239,123, 3,146,133,227,79,60,139,89,179,102,87,58,118,86,86,22,199,30,123,44,153, 153,89,92,125,245,85,140,24,49,2,77,211,94,6,206,171,247,39,209,8,120, 117,88,151,109,6,255,132,24,38,33,66,8,33,26,191,80,195,200,80,77,211, 158,31,54,108,168,186,242,202,43,232,221,187,55,61,123,246,168,118,195, 53,107,214,208,177,247,80,188,85,250,248,115,178,119,82,180,115,37,115, 103,207,98,240,224,193,0,20,28,204,97,214,7,175,178,111,207,206,67,173, 5,190,199,128,33,35,89,181,122,245,97,199,79,74,74,228,152,99,70,208,190, 125,59,110,184,225,111,90,223,190,125,177,88,44,255,3,122,135,88,167,70, 193,107,152,193,191,127,71,9,254,66,8,33,26,46,148,80,146,100,179,217, 222,203,204,204,180,92,119,221,117,90,159,62,53,7,127,93,215,41,42,204, 39,37,189,229,97,77,251,107,126,251,158,169,23,157,207,138,21,43,56,246, 216,99,41,42,50,251,185,11,14,230,176,120,254,28,115,219,128,4,32,179, 85,27,242,243,14,162,235,135,47,4,104,181,90,25,50,100,8,29,58,180,231, 198,27,255,166,217,237,246,100,155,205,246,49,144,84,143,207,34,110,121, 13,179,217,191,127,71,105,246,23,66,8,17,30,161,36,0,255,214,117,189,223, 245,215,95,103,233,217,179,39,189,122,245,170,113,67,77,211,208,208,240, 232,149,131,185,215,80,24,6,220,116,211,77,156,120,226,137,24,70,229,193, 235,6,90,192,88,1,133,87,87,120,245,218,7,184,91,44,22,134,12,25,66,143, 30,61,184,238,186,235,44,186,174,31,9,252,51,132,122,197,53,233,243,23, 66,8,17,9,161,36,0,46,165,20,101,101,101,12,30,60,168,246,131,90,44,100, 182,104,73,105,225,193,202,253,250,134,162,223,136,137,40,107,82,197,149, 191,95,86,235,118,12,29,125,226,97,227,5,242,114,115,104,217,170,53,86, 107,205,209,207,106,181,50,108,216,48,178,178,50,43,94,10,161,94,113,75, 250,252,133,16,66,68,74,40,247,2,120,68,211,180,227,158,127,254,197,83, 39,78,60,65,27,51,102,116,173,27,31,121,212,81,236,221,180,146,180,145, 39,251,230,26,26,104,154,133,204,54,157,25,115,198,255,177,240,171,183, 40,206,207,1,32,171,85,59,78,60,247,106,90,180,237,140,110,40,52,84,197, 4,197,53,203,127,99,200,208,161,117,22,206,225,112,240,194,11,47,234,86, 171,117,171,215,235,125,40,132,122,133,172,216,169,216,157,87,253,189, 137,114,138,20,0,134,82,181,30,35,152,237,254,200,86,12,232,168,81,84, 203,221,15,234,56,141,16,66,8,81,173,80,18,0,93,41,245,103,77,211,150, 94,114,201,165,61,63,253,244,19,235,208,161,67,106,220,120,202,153,167, 242,242,59,95,210,119,228,201,120,13,51,160,107,40,52,96,228,169,151,50, 96,228,36,54,44,253,1,13,24,50,230,36,218,117,232,234,11,254,96,174,107, 99,65,3,22,205,251,154,169,231,157,81,107,193,60,30,15,87,95,125,141,218, 191,127,191,82,74,93,8,56,67,168,87,220,26,208,81,195,86,75,91,134,71, 135,3,230,26,1,210,62,32,132,16,34,36,161,222,13,176,200,235,245,158,84, 90,90,250,227,153,103,158,213,101,230,204,15,173,199,29,119,108,181,27, 254,233,79,127,226,254,7,31,37,103,199,122,218,117,239,127,216,149,125, 70,235,142,140,58,237,50,115,17,32,171,217,247,175,105,190,183,125,201, 194,246,141,171,217,190,241,119,166,76,121,189,198,2,41,165,184,225,134, 27,249,254,251,31,192,156,162,184,50,196,58,133,44,35,69,163,75,171,234, 35,179,69,11,110,33,160,96,182,203,45,168,121,127,89,9,80,8,33,68,67,212, 231,202,113,135,174,235,163,93,46,215,214,115,206,249,147,241,249,231, 159,87,187,81,114,114,50,247,220,245,79,230,191,61,29,143,203,129,82,84, 187,38,64,224,156,255,192,177,2,142,178,50,222,120,252,14,166,221,123, 55,41,41,213,175,186,231,245,122,185,233,166,155,153,57,243,35,48,7,254, 213,156,41,52,33,129,179,2,172,114,237,47,132,16,162,30,234,27,62,178, 189,94,239,24,175,215,187,248,138,43,174,226,150,91,110,197,229,114,29, 182,209,197,23,95,196,241,163,70,48,231,63,119,224,113,57,48,148,170,180, 210,95,213,57,255,254,53,3,28,165,101,188,250,192,223,24,59,122,36,23, 92,112,126,181,5,40,40,40,224,156,115,206,53,222,126,251,29,128,251,128, 71,235,89,151,70,69,102,5,8,33,132,8,135,134,92,63,230,234,186,126,60, 240,232,155,111,254,79,141,31,63,65,255,249,231,133,135,109,244,204,83, 143,51,98,64,15,62,125,244,10,114,118,172,55,147,0,67,85,123,19,32,221, 80,108,223,184,134,167,111,59,159,65,125,186,242,196,99,143,84,123,226, 5,11,22,48,126,252,68,253,215,95,127,245,2,83,129,123,27,80,143,70,67, 102,5,8,33,132,8,151,80,199,0,84,229,5,238,4,126,220,188,121,203,127,206, 58,235,236,110,167,159,126,154,186,247,222,123,52,255,58,1,9,9,9,188,240, 252,211,188,255,254,7,76,187,239,22,90,119,237,79,143,225,39,210,181,239, 48,50,91,182,65,233,22,138,75,14,178,123,227,10,54,45,153,203,190,237, 235,152,126,239,221,213,94,249,239,223,191,159,105,211,166,51,115,230, 71,88,173,214,237,134,97,252,25,88,210,192,58,52,10,129,43,1,22,215,50, 43,64,8,33,132,8,70,67,19,0,191,111,13,195,232,7,220,244,205,55,179,239, 154,53,235,155,148,73,147,38,113,237,181,215,104,227,199,143,71,211,52, 46,186,232,66,206,62,251,44,62,253,244,51,62,255,242,27,62,254,244,89, 10,11,242,0,104,209,162,21,67,134,14,229,234,63,159,197,148,41,111,30, 214,231,191,113,227,70,94,120,225,37,102,206,156,105,232,230,146,128,15, 233,186,254,48,112,120,191,67,19,228,239,243,31,217,83,154,253,133,16, 66,132,71,184,18,0,128,114,224,97,195,48,94,7,174,157,55,111,222,245,223, 125,247,93,219,54,109,218,232,147,39,159,98,61,233,164,147,24,57,242,24, 254,252,231,139,249,243,159,47,6,168,88,9,176,234,141,132,220,110,55,235, 214,173,99,238,220,239,152,53,235,27,125,237,218,181,86,139,197,226,52, 12,227,191,192,211,192,246,48,150,59,174,213,213,231,175,203,58,0,66,8, 33,234,33,156,9,128,223,1,224,62,93,215,31,1,206,206,205,205,61,103,198, 140,247,78,125,251,237,119,210,1,90,181,106,165,15,30,60,200,210,190,125, 123,45,35,35,131,148,148,20,12,195,160,184,184,152,252,252,124,54,110, 220,164,111,219,182,213,226,245,234,154,166,105,134,197,194,111,192,167, 134,97,188,5,228,71,160,188,113,171,174,62,255,45,7,20,63,109,84,101,192, 236,195,223,21,66,8,33,106,22,137,4,192,207,13,204,4,102,234,186,110,3, 70,1,195,242,242,242,6,255,252,243,194,193,22,139,165,157,97,24,89,134, 97,164,105,154,86,110,177,104,165,160,21,122,189,222,141,192,26,96,181, 82,234,71,93,231,96,4,203,88,47,241,176,18,224,238,124,248,96,137,42,115, 123,57,19,88,28,92,201,133,16,66,8,83,36,19,128,64,94,224,39,223,3,93, 215,43,221,221,79,41,243,38,65,162,178,154,86,2,220,157,15,239,47,54,156, 30,157,51,129,121,81,47,152,16,66,136,70,47,90,9,64,147,18,203,149,0,183, 229,194,7,75,140,50,9,254,66,8,33,26,66,102,147,55,34,219,114,225,63,243, 13,127,179,191,4,127,33,132,16,245,38,45,0,141,132,217,231,47,193,95,8, 33,68,120,72,2,208,8,236,206,135,15,22,27,78,183,52,251,11,33,132,8,19, 233,2,136,115,219,114,225,195,165,134,211,173,115,58,18,252,133,16,66, 132,137,36,0,113,108,91,46,188,182,192,40,119,121,36,248,11,33,132,8,47, 233,2,168,135,223,119,235,188,247,107,121,181,239,21,57,205,121,253,153, 41,90,173,199,168,107,59,183,23,62,248,205,112,151,123,152,12,204,175, 119,97,133,16,66,136,106,212,30,165,68,117,186,3,215,70,233,92,159,33, 139,252,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8, 33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66, 8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16, 66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132, 16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33,132,16,66,8,33, 132,16,66,52,27,255,15,227,69,96,217,86,160,18,177,0,0,0,0,73,69,78,68, 174,66,96,130, } }, goxel-0.8.1/src/assets/other.inl000066400000000000000000000036161334742672700166010ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/other/povray_template.pov", .size = 748, .data = "// Generated from goxel {{version}}\n" "// https://github.com/guillaumechereau/goxel\n" "\n" "{{#camera}}\n" "camera {\n" " perspective\n" " right x*{{width}}/{{height}}\n" " direction <0, 0, -1>\n" " angle {{angle}}\n" " transform {\n" " matrix {{modelview}}\n" " inverse\n" " }\n" "}\n" "{{/camera}}\n" "\n" "#declare Voxel = box {<-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>}\n" "#macro Vox(Pos, Color)\n" " object {\n" " Voxel\n" " translate Pos\n" " translate <0.5, 0.5, 0.5>\n" " texture { pigment {color rgb Color / 255} }\n" " }\n" "#end\n" "\n" "{{#light}}\n" "global_settings { ambient_light rgb<1, 1, 1> * {{ambient}} }\n" "light_source {\n" " <0, 0, 1024> color rgb <2, 2, 2>\n" " parallel\n" " point_at {{point_at}}\n" "}\n" "{{/light}}\n" "\n" "union {\n" "{{#voxels}}\n" " Vox({{pos}}, {{color}})\n" "{{/voxels}}\n" "}\n" "" }, goxel-0.8.1/src/assets/palettes.inl000066400000000000000000002622661334742672700173110ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/palettes/Blues.gpl", .size = 5204, .data = "GIMP Palette\n" "Name: Blues\n" "#\n" "# For them rainy days ... by Daniel Egnor\n" "#\n" " 0 0 0 #000000\n" "128 128 128 #808080\n" "255 255 255 #FFFFFF\n" " 0 0 4 #000004\n" " 0 0 12 #00000C\n" " 0 0 16 #000010\n" " 0 0 24 #000018\n" " 0 0 32 #000020\n" " 0 0 36 #000024\n" " 0 0 44 #00002C\n" " 0 0 48 #000030\n" " 0 0 56 #000038\n" " 0 0 64 #000040\n" " 0 0 68 #000044\n" " 0 0 76 #00004C\n" " 0 0 80 #000050\n" " 0 0 88 #000058\n" " 0 0 96 #000060\n" " 0 0 100 #000064\n" " 0 0 108 #00006C\n" " 0 0 116 #000074\n" " 0 0 120 #000078\n" " 0 0 128 #000080\n" " 0 0 132 #000084\n" " 0 0 140 #00008C\n" " 0 0 148 #000094\n" " 0 0 152 #000098\n" " 0 0 160 #0000A0\n" " 0 0 164 #0000A4\n" " 0 0 172 #0000AC\n" " 0 0 180 #0000B4\n" " 0 0 184 #0000B8\n" " 0 0 192 #0000C0\n" " 0 0 200 #0000C8\n" " 0 4 200 #0004C8\n" " 0 12 200 #000CC8\n" " 0 16 204 #0010CC\n" " 0 24 204 #0018CC\n" " 0 28 208 #001CD0\n" " 0 36 208 #0024D0\n" " 0 40 208 #0028D0\n" " 0 48 212 #0030D4\n" " 0 56 212 #0038D4\n" " 0 60 216 #003CD8\n" " 0 68 216 #0044D8\n" " 0 72 216 #0048D8\n" " 0 80 220 #0050DC\n" " 0 84 220 #0054DC\n" " 0 92 224 #005CE0\n" " 0 100 224 #0064E0\n" " 0 104 224 #0068E0\n" " 0 112 228 #0070E4\n" " 0 116 228 #0074E4\n" " 0 124 232 #007CE8\n" " 0 128 232 #0080E8\n" " 0 136 232 #0088E8\n" " 0 140 236 #008CEC\n" " 0 148 236 #0094EC\n" " 0 156 240 #009CF0\n" " 0 160 240 #00A0F0\n" " 0 168 240 #00A8F0\n" " 0 172 244 #00ACF4\n" " 0 180 244 #00B4F4\n" " 0 184 248 #00B8F8\n" " 0 192 248 #00C0F8\n" " 0 200 252 #00C8FC\n" " 4 200 252 #04C8FC\n" " 12 200 252 #0CC8FC\n" " 20 204 252 #14CCFC\n" " 28 204 252 #1CCCFC\n" " 36 208 252 #24D0FC\n" " 44 208 252 #2CD0FC\n" " 52 208 252 #34D0FC\n" " 60 212 252 #3CD4FC\n" " 68 212 252 #44D4FC\n" " 76 216 252 #4CD8FC\n" " 84 216 252 #54D8FC\n" " 92 216 252 #5CD8FC\n" "100 220 252 #64DCFC\n" "108 220 252 #6CDCFC\n" "116 224 252 #74E0FC\n" "124 224 252 #7CE0FC\n" "132 224 252 #84E0FC\n" "140 228 252 #8CE4FC\n" "148 228 252 #94E4FC\n" "156 232 252 #9CE8FC\n" "164 232 252 #A4E8FC\n" "172 232 252 #ACE8FC\n" "180 236 252 #B4ECFC\n" "188 236 252 #BCECFC\n" "196 240 252 #C4F0FC\n" "204 240 252 #CCF0FC\n" "212 240 252 #D4F0FC\n" "220 244 252 #DCF4FC\n" "228 244 252 #E4F4FC\n" "236 248 252 #ECF8FC\n" "244 248 252 #F4F8FC\n" "252 252 252 #FCFCFC\n" "248 252 252 #F8FCFC\n" "244 252 252 #F4FCFC\n" "240 252 252 #F0FCFC\n" "232 252 252 #E8FCFC\n" "228 252 252 #E4FCFC\n" "224 252 252 #E0FCFC\n" "216 252 252 #D8FCFC\n" "212 252 252 #D4FCFC\n" "208 252 252 #D0FCFC\n" "200 252 252 #C8FCFC\n" "196 252 252 #C4FCFC\n" "192 252 252 #C0FCFC\n" "184 252 252 #B8FCFC\n" "180 252 252 #B4FCFC\n" "176 252 252 #B0FCFC\n" "168 252 252 #A8FCFC\n" "164 252 252 #A4FCFC\n" "160 252 252 #A0FCFC\n" "156 252 252 #9CFCFC\n" "148 252 252 #94FCFC\n" "144 252 252 #90FCFC\n" "140 252 252 #8CFCFC\n" "132 252 252 #84FCFC\n" "128 252 252 #80FCFC\n" "124 252 252 #7CFCFC\n" "116 252 252 #74FCFC\n" "112 252 252 #70FCFC\n" "108 252 252 #6CFCFC\n" "100 252 252 #64FCFC\n" " 96 252 252 #60FCFC\n" " 92 252 252 #5CFCFC\n" " 84 252 252 #54FCFC\n" " 80 252 252 #50FCFC\n" " 76 252 252 #4CFCFC\n" " 72 252 252 #48FCFC\n" " 64 252 252 #40FCFC\n" " 60 252 252 #3CFCFC\n" " 56 252 252 #38FCFC\n" " 48 252 252 #30FCFC\n" " 44 252 252 #2CFCFC\n" " 40 252 252 #28FCFC\n" " 32 252 252 #20FCFC\n" " 28 252 252 #1CFCFC\n" " 24 252 252 #18FCFC\n" " 16 252 252 #10FCFC\n" " 12 252 252 #0CFCFC\n" " 8 252 252 #08FCFC\n" " 0 252 252 #00FCFC\n" " 0 248 252 #00F8FC\n" " 0 244 252 #00F4FC\n" " 0 240 252 #00F0FC\n" " 0 232 252 #00E8FC\n" " 0 228 252 #00E4FC\n" " 0 224 252 #00E0FC\n" " 0 216 252 #00D8FC\n" " 0 212 252 #00D4FC\n" " 0 208 252 #00D0FC\n" " 0 200 252 #00C8FC\n" " 0 196 252 #00C4FC\n" " 0 192 252 #00C0FC\n" " 0 184 252 #00B8FC\n" " 0 180 252 #00B4FC\n" " 0 176 252 #00B0FC\n" " 0 168 252 #00A8FC\n" " 0 164 252 #00A4FC\n" " 0 160 252 #00A0FC\n" " 0 156 252 #009CFC\n" " 0 148 252 #0094FC\n" " 0 144 252 #0090FC\n" " 0 140 252 #008CFC\n" " 0 132 252 #0084FC\n" " 0 128 252 #0080FC\n" " 0 124 252 #007CFC\n" " 0 116 252 #0074FC\n" " 0 112 252 #0070FC\n" " 0 108 252 #006CFC\n" " 0 100 252 #0064FC\n" " 0 96 252 #0060FC\n" " 0 92 252 #005CFC\n" " 0 84 252 #0054FC\n" " 0 80 252 #0050FC\n" " 0 76 252 #004CFC\n" " 0 72 252 #0048FC\n" " 0 64 252 #0040FC\n" " 0 60 252 #003CFC\n" " 0 56 252 #0038FC\n" " 0 48 252 #0030FC\n" " 0 44 252 #002CFC\n" " 0 40 252 #0028FC\n" " 0 32 252 #0020FC\n" " 0 28 252 #001CFC\n" " 0 24 252 #0018FC\n" " 0 16 252 #0010FC\n" " 0 12 252 #000CFC\n" " 0 8 252 #0008FC\n" " 0 0 252 #0000FC\n" " 0 0 248 #0000F8\n" " 0 0 244 #0000F4\n" " 0 0 240 #0000F0\n" " 0 0 236 #0000EC\n" " 0 0 232 #0000E8\n" " 0 0 228 #0000E4\n" " 0 0 224 #0000E0\n" " 0 0 220 #0000DC\n" " 0 0 216 #0000D8\n" " 0 0 212 #0000D4\n" " 0 0 208 #0000D0\n" " 0 0 204 #0000CC\n" " 0 0 200 #0000C8\n" " 0 0 196 #0000C4\n" " 0 0 192 #0000C0\n" " 0 0 188 #0000BC\n" " 0 0 184 #0000B8\n" " 0 0 180 #0000B4\n" " 0 0 176 #0000B0\n" " 0 0 172 #0000AC\n" " 0 0 168 #0000A8\n" " 0 0 164 #0000A4\n" " 0 0 160 #0000A0\n" " 0 0 156 #00009C\n" " 0 0 152 #000098\n" " 0 0 148 #000094\n" " 0 0 144 #000090\n" " 0 0 140 #00008C\n" " 0 0 136 #000088\n" " 0 0 132 #000084\n" " 0 0 128 #000080\n" " 0 0 124 #00007C\n" " 0 0 120 #000078\n" " 0 0 116 #000074\n" " 0 0 112 #000070\n" " 0 0 108 #00006C\n" " 0 0 104 #000068\n" " 0 0 100 #000064\n" " 0 0 96 #000060\n" " 0 0 92 #00005C\n" " 0 0 88 #000058\n" " 0 0 84 #000054\n" " 0 0 80 #000050\n" " 0 0 76 #00004C\n" " 0 0 72 #000048\n" " 0 0 68 #000044\n" " 0 0 64 #000040\n" " 0 0 60 #00003C\n" " 0 0 56 #000038\n" " 0 0 52 #000034\n" " 0 0 48 #000030\n" " 0 0 44 #00002C\n" " 0 0 40 #000028\n" " 0 0 36 #000024\n" " 0 0 32 #000020\n" " 0 0 28 #00001C\n" " 0 0 24 #000018\n" " 0 0 20 #000014\n" " 0 0 16 #000010\n" " 0 0 12 #00000C\n" " 0 0 8 #000008\n" " 0 0 0 #000000\n" "" }, {.path = "data/palettes/Caramel.gpl", .size = 3112, .data = "GIMP Palette\n" "Name: Caramel\n" "#\n" " 48 48 48 grey19\n" "164 136 192\n" "172 140 192\n" "180 144 192\n" "188 148 192\n" "196 152 192\n" "204 152 192\n" "212 156 192\n" "220 160 192\n" "228 164 192\n" "236 168 192\n" "228 160 188\n" "216 148 184\n" "204 136 180\n" "192 124 176\n" "180 112 168\n" "168 104 164\n" "156 92 160\n" "144 80 156\n" "132 68 152\n" "120 56 144\n" "140 84 140\n" "160 116 132\n" "180 144 128\n" "200 176 120\n" "224 208 112\n" "212 200 120\n" "196 188 132\n" "184 176 144\n" "168 168 156\n" "156 156 164\n" "140 144 176\n" "128 136 188\n" "112 124 200\n" " 96 112 212\n" "108 112 192\n" "124 116 172\n" "136 116 148\n" "152 120 128\n" "168 120 108\n" "180 124 84\n" "196 124 64\n" "212 128 40\n" "212 128 44\n" "212 132 48\n" "212 136 52\n" "212 140 56\n" "216 144 60\n" "216 148 64\n" "216 148 68\n" "216 152 72\n" "220 156 76\n" "220 160 80\n" "220 164 84\n" "220 168 88\n" "224 168 92\n" "224 172 96\n" "224 176 100\n" "224 180 104\n" "228 184 108\n" "228 188 112\n" "228 188 116\n" "228 192 120\n" "232 196 124\n" "232 200 128\n" "232 204 132\n" "232 208 136\n" "236 212 140\n" "232 208 140\n" "224 204 140\n" "216 196 140\n" "208 192 136\n" "200 188 136\n" "192 180 136\n" "188 176 132\n" "180 172 132\n" "172 164 132\n" "164 160 128\n" "156 156 128\n" "148 148 128\n" "144 144 124\n" "136 136 124\n" "128 132 124\n" "120 128 120\n" "112 120 120\n" "104 116 120\n" "100 112 116\n" " 92 104 116\n" " 84 100 116\n" " 76 96 112\n" " 68 88 112\n" " 60 84 112\n" " 52 76 108\n" " 56 80 108\n" " 60 88 108\n" " 64 96 108\n" " 72 100 108\n" " 76 108 108\n" " 80 116 108\n" " 88 120 108\n" " 92 128 108\n" " 96 136 108\n" "104 144 104\n" "108 148 104\n" "112 156 104\n" "116 164 104\n" "124 168 104\n" "128 176 104\n" "132 184 104\n" "140 188 104\n" "144 196 104\n" "148 204 104\n" "156 212 100\n" "156 208 100\n" "156 204 100\n" "156 200 96\n" "156 196 96\n" "156 192 92\n" "156 188 92\n" "156 184 88\n" "156 180 88\n" "156 176 84\n" "156 172 84\n" "156 168 80\n" "156 164 80\n" "156 160 76\n" "156 156 76\n" "156 152 72\n" "156 148 72\n" "156 144 68\n" "156 140 68\n" "156 136 64\n" "156 132 64\n" "156 124 60\n" "160 124 72\n" "164 128 84\n" "168 132 96\n" "176 136 112\n" "180 136 124\n" "184 140 136\n" "188 144 148\n" "196 148 164\n" "196 148 164\n" "196 148 160\n" "196 144 156\n" "196 144 152\n" "192 140 148\n" "192 140 144\n" "192 140 140\n" "192 136 136\n" "192 136 132\n" "188 132 128\n" "188 132 124\n" "188 132 120\n" "188 128 116\n" "184 128 112\n" "184 124 108\n" "184 124 104\n" "184 124 104\n" "184 120 100\n" "180 120 96\n" "180 116 92\n" "180 116 88\n" "180 116 84\n" "176 112 80\n" "176 112 76\n" "176 108 72\n" "176 108 68\n" "176 108 64\n" "172 104 60\n" "172 104 56\n" "172 100 52\n" "172 100 48\n" "168 96 44\n" "160 96 44\n" "152 96 48\n" "140 100 52\n" "132 100 56\n" "120 100 60\n" "112 104 60\n" "100 104 64\n" " 92 104 68\n" " 80 108 72\n" " 72 108 76\n" " 60 108 80\n" " 52 112 80\n" " 40 112 84\n" " 32 112 88\n" " 20 116 92\n" " 12 116 96\n" " 0 120 100\n" " 0 120 100\n" " 0 116 100\n" " 0 112 104\n" " 0 112 104\n" " 0 108 104\n" " 0 104 108\n" " 0 104 108\n" " 0 100 112\n" " 0 96 112\n" " 0 96 112\n" " 0 92 116\n" " 4 88 116\n" " 4 84 120\n" " 4 84 120\n" " 4 80 120\n" " 4 76 124\n" " 4 76 124\n" " 4 72 128\n" " 4 68 128\n" " 4 68 128\n" " 4 64 132\n" " 4 60 132\n" " 8 56 136\n" " 28 60 136\n" " 48 68 140\n" " 72 76 144\n" " 92 80 148\n" "116 88 152\n" "136 96 156\n" "160 100 160\n" "180 108 164\n" "204 116 168\n" "204 116 168\n" "204 120 168\n" "200 124 168\n" "200 128 168\n" "200 128 168\n" "196 132 168\n" "196 136 168\n" "192 140 168\n" "192 140 168\n" "192 144 168\n" "188 148 168\n" "188 152 168\n" "184 156 168\n" "184 156 168\n" "184 160 168\n" "180 164 168\n" "180 168 168\n" "180 168 168\n" "176 172 168\n" "176 176 168\n" "172 180 168\n" "172 184 168\n" "172 184 168\n" "168 188 168\n" "168 192 168\n" "164 196 168\n" "164 196 168\n" "164 200 168\n" "160 204 168\n" "160 208 168\n" "156 212 164\n" "148 212 168\n" "136 216 176\n" "" }, {.path = "data/palettes/db16.gpl", .size = 382, .data = "GIMP Palette\n" "Name: DB16\n" "Columns: 8\n" "#\n" " 20 12 28 Dark1\n" " 68 36 52 Dark2\n" " 48 52 109 Dark3\n" " 78 74 78 Dark4\n" "133 76 48 Dark5\n" " 52 101 36 Dark6\n" "208 70 72 Dark7\n" "117 113 97 Dark8\n" " 89 125 206 Light1\n" "210 125 44 Light2\n" "133 149 161 Light3\n" "109 170 44 Light4\n" "210 170 153 Light5\n" "109 194 202 Light6\n" "218 212 94 Light7\n" "222 238 214 Light8\n" "" }, {.path = "data/palettes/db32.gpl", .size = 659, .data = "GIMP Palette\n" "Name: DB32\n" "Columns: 8\n" "#\n" "0 0 0 Black\n" "34 32 52 Valhalla\n" "69 40 60 Loulou\n" "102 57 49 Oiled cedar\n" "143 86 59 Rope\n" "223 113 38 Tahiti gold\n" "217 160 102 Twine\n" "238 195 154 Pancho\n" "251 242 54 Golden fizz\n" "153 229 80 Atlantis\n" "106 190 48 Christi\n" "55 148 110 Elf green\n" "75 105 47 Dell\n" "82 75 36 Verdigris\n" "50 60 57 Opal\n" "63 63 116 Deep koamaru\n" "48 96 130 Venice blue\n" "91 110 225 Royal blue\n" "99 155 255 Cornflower\n" "95 205 228 Viking\n" "203 219 252 Light steel blue\n" "255 255 255 White\n" "155 173 183 Heather\n" "132 126 135 Topaz\n" "105 106 106 Dim gray\n" "89 86 82 Smokey ash\n" "118 66 138 Clairvoyant\n" "172 50 50 Brown\n" "217 87 99 Mandy\n" "215 123 186 Plum\n" "143 151 74 Rain forest\n" "138 111 48 Stinger\n" "" }, {.path = "data/palettes/echo-palette.gpl", .size = 681, .data = "GIMP Palette\n" "Name: Echo Icon Theme Palette\n" "Columns: 3\n" "#\n" " 25 174 255 Blue1 \n" " 0 132 200 Blue2\n" " 0 92 148 Blue3\n" "255 65 65 Red1\n" "220 0 0 Red2\n" "181 0 0 Red3\n" "255 255 62 Orange1\n" "255 153 0 Orange2\n" "255 102 0 Orange3\n" "255 192 34 Brown1\n" "184 129 0 Brown2\n" "128 77 0 Brown3\n" "204 255 66 Green1\n" "154 222 0 Green2\n" " 0 145 0 Green3\n" "241 202 255 Purple1\n" "215 108 255 Purple2\n" "186 0 255 Purple3\n" "189 205 212 Metalic1\n" "158 171 176 Metalic2\n" " 54 78 89 Metalic3\n" " 14 35 46 Metalic4\n" "255 255 255 Grey1\n" "204 204 204 Grey2\n" "153 153 153 Grey3\n" "102 102 102 Grey4\n" " 45 45 45 Grey5\n" "" }, {.path = "data/palettes/Gold.gpl", .size = 2079, .data = "GIMP Palette\n" "Name: Gold\n" "#\n" " 0 0 0 #000000\n" "128 128 128 #808080\n" "255 255 255 #FFFFFF\n" "252 252 128 #FCFC80\n" "252 248 124 #FCF87C\n" "252 244 120 #FCF478\n" "248 244 120 #F8F478\n" "248 240 116 #F8F074\n" "248 240 112 #F8F070\n" "248 236 112 #F8EC70\n" "244 236 108 #F4EC6C\n" "244 232 108 #F4E86C\n" "244 232 104 #F4E868\n" "244 228 104 #F4E468\n" "240 228 100 #F0E464\n" "240 224 96 #F0E060\n" "240 220 92 #F0DC5C\n" "236 220 92 #ECDC5C\n" "236 216 88 #ECD858\n" "236 216 84 #ECD854\n" "236 212 84 #ECD454\n" "236 212 80 #ECD450\n" "232 208 80 #E8D050\n" "232 208 76 #E8D04C\n" "232 204 76 #E8CC4C\n" "232 204 72 #E8CC48\n" "228 200 68 #E4C844\n" "228 196 64 #E4C440\n" "224 192 60 #E0C03C\n" "224 192 56 #E0C038\n" "224 188 56 #E0BC38\n" "224 188 52 #E0BC34\n" "220 184 52 #DCB834\n" "220 184 48 #DCB830\n" "220 180 48 #DCB430\n" "220 180 44 #DCB42C\n" "220 176 40 #DCB028\n" "216 176 40 #D8B028\n" "216 172 36 #D8AC24\n" "216 168 32 #D8A820\n" "212 168 28 #D4A81C\n" "212 164 28 #D4A41C\n" "212 164 24 #D4A418\n" "212 160 24 #D4A018\n" "208 160 20 #D0A014\n" "208 156 20 #D09C14\n" "208 156 16 #D09C10\n" "208 152 12 #D0980C\n" "204 152 12 #CC980C\n" "204 148 8 #CC9408\n" "204 144 4 #CC9004\n" "200 140 0 #C88C00\n" "196 136 0 #C48800\n" "192 132 0 #C08400\n" "188 128 0 #BC8000\n" "184 124 0 #B87C00\n" "180 120 0 #B47800\n" "176 116 0 #B07400\n" "172 112 0 #AC7000\n" "168 108 0 #A86C00\n" "164 104 0 #A46800\n" "160 100 0 #A06400\n" "156 96 0 #9C6000\n" "152 92 0 #985C00\n" "148 88 0 #945800\n" "144 84 0 #905400\n" "140 80 0 #8C5000\n" "136 76 0 #884C00\n" "132 72 0 #844800\n" "128 68 0 #804400\n" "124 64 0 #7C4000\n" "120 60 0 #783C00\n" "116 56 0 #743800\n" "112 52 0 #703400\n" "108 48 0 #6C3000\n" "104 44 0 #682C00\n" "100 40 0 #642800\n" " 96 36 0 #602400\n" " 92 32 0 #5C2000\n" " 88 28 0 #581C00\n" " 84 24 0 #541800\n" " 80 20 0 #501400\n" " 76 16 0 #4C1000\n" " 72 12 0 #480C00\n" " 68 8 0 #440800\n" " 64 4 0 #400400\n" " 60 0 0 #3C0000\n" " 56 0 0 #380000\n" " 52 0 0 #340000\n" " 48 0 0 #300000\n" " 44 0 0 #2C0000\n" " 40 0 0 #280000\n" " 36 0 0 #240000\n" " 32 0 0 #200000\n" " 28 0 0 #1C0000\n" " 24 0 0 #180000\n" " 20 0 0 #140000\n" " 16 0 0 #100000\n" " 12 0 0 #0C0000\n" " 8 0 0 #080000\n" " 4 0 0 #040000\n" " 0 0 0 #000000\n" "" }, {.path = "data/palettes/Gray.gpl", .size = 6585, .data = "GIMP Palette\n" "Name: Gray\n" "Columns: 3\n" "# \n" " 0 0 0 00 hex (0)\n" " 1 1 1 01 hex (1)\n" " 2 2 2 02 hex (2)\n" " 3 3 3 03 hex (3)\n" " 4 4 4 04 hex (4)\n" " 5 5 5 05 hex (5)\n" " 6 6 6 06 hex (6)\n" " 7 7 7 07 hex (7)\n" " 8 8 8 08 hex (8)\n" " 9 9 9 09 hex (9)\n" " 10 10 10 0A hex (10)\n" " 11 11 11 0B hex (11)\n" " 12 12 12 0C hex (12)\n" " 13 13 13 0D hex (13)\n" " 14 14 14 0E hex (14)\n" " 15 15 15 0F hex (15)\n" " 16 16 16 10 hex (16)\n" " 17 17 17 11 hex (17)\n" " 18 18 18 12 hex (18)\n" " 19 19 19 13 hex (19)\n" " 20 20 20 14 hex (20)\n" " 21 21 21 15 hex (21)\n" " 22 22 22 16 hex (22)\n" " 23 23 23 17 hex (23)\n" " 24 24 24 18 hex (24)\n" " 25 25 25 19 hex (25)\n" " 26 26 26 1A hex (26)\n" " 27 27 27 1B hex (27)\n" " 28 28 28 1C hex (28)\n" " 29 29 29 1D hex (29)\n" " 30 30 30 1E hex (30)\n" " 31 31 31 1F hex (31)\n" " 32 32 32 20 hex (32)\n" " 33 33 33 21 hex (33)\n" " 34 34 34 22 hex (34)\n" " 35 35 35 23 hex (35)\n" " 36 36 36 24 hex (36)\n" " 37 37 37 25 hex (37)\n" " 38 38 38 26 hex (38)\n" " 39 39 39 27 hex (39)\n" " 40 40 40 28 hex (40)\n" " 41 41 41 29 hex (41)\n" " 42 42 42 2A hex (42)\n" " 43 43 43 2B hex (43)\n" " 44 44 44 2C hex (44)\n" " 45 45 45 2D hex (45)\n" " 46 46 46 2E hex (46)\n" " 47 47 47 2F hex (47)\n" " 48 48 48 30 hex (48)\n" " 49 49 49 31 hex (49)\n" " 50 50 50 32 hex (50)\n" " 51 51 51 33 hex (51)\n" " 52 52 52 34 hex (52)\n" " 53 53 53 35 hex (53)\n" " 54 54 54 36 hex (54)\n" " 55 55 55 37 hex (55)\n" " 56 56 56 38 hex (56)\n" " 57 57 57 39 hex (57)\n" " 58 58 58 3A hex (58)\n" " 59 59 59 3B hex (59)\n" " 60 60 60 3C hex (60)\n" " 61 61 61 3D hex (61)\n" " 62 62 62 3E hex (62)\n" " 63 63 63 3F hex (63)\n" " 64 64 64 40 hex (64)\n" " 65 65 65 41 hex (65)\n" " 66 66 66 42 hex (66)\n" " 67 67 67 43 hex (67)\n" " 68 68 68 44 hex (68)\n" " 69 69 69 45 hex (69)\n" " 70 70 70 46 hex (70)\n" " 71 71 71 47 hex (71)\n" " 72 72 72 48 hex (72)\n" " 73 73 73 49 hex (73)\n" " 74 74 74 4A hex (74)\n" " 75 75 75 4B hex (75)\n" " 76 76 76 4C hex (76)\n" " 77 77 77 4D hex (77)\n" " 78 78 78 4E hex (78)\n" " 79 79 79 4F hex (79)\n" " 80 80 80 50 hex (80)\n" " 81 81 81 51 hex (81)\n" " 82 82 82 52 hex (82)\n" " 83 83 83 53 hex (83)\n" " 84 84 84 54 hex (84)\n" " 85 85 85 55 hex (85)\n" " 86 86 86 56 hex (86)\n" " 87 87 87 57 hex (87)\n" " 88 88 88 58 hex (88)\n" " 89 89 89 59 hex (89)\n" " 90 90 90 5A hex (90)\n" " 91 91 91 5B hex (91)\n" " 92 92 92 5C hex (92)\n" " 93 93 93 5D hex (93)\n" " 94 94 94 5E hex (94)\n" " 95 95 95 5F hex (95)\n" " 96 96 96 60 hex (96)\n" " 97 97 97 61 hex (97)\n" " 98 98 98 62 hex (98)\n" " 99 99 99 63 hex (99)\n" "100 100 100 64 hex (100)\n" "101 101 101 65 hex (101)\n" "102 102 102 66 hex (102)\n" "103 103 103 67 hex (103)\n" "104 104 104 68 hex (104)\n" "105 105 105 69 hex (105)\n" "106 106 106 6A hex (106)\n" "107 107 107 6B hex (107)\n" "108 108 108 6C hex (108)\n" "109 109 109 6D hex (109)\n" "110 110 110 6E hex (110)\n" "111 111 111 6F hex (111)\n" "112 112 112 70 hex (112)\n" "113 113 113 71 hex (113)\n" "114 114 114 72 hex (114)\n" "115 115 115 73 hex (115)\n" "116 116 116 74 hex (116)\n" "117 117 117 75 hex (117)\n" "118 118 118 76 hex (118)\n" "119 119 119 77 hex (119)\n" "120 120 120 78 hex (120)\n" "121 121 121 79 hex (121)\n" "122 122 122 7A hex (122)\n" "123 123 123 7B hex (123)\n" "124 124 124 7C hex (124)\n" "125 125 125 7D hex (125)\n" "126 126 126 7E hex (126)\n" "127 127 127 7F hex (127)\n" "128 128 128 80 hex (128)\n" "129 129 129 81 hex (129)\n" "130 130 130 82 hex (130)\n" "131 131 131 83 hex (131)\n" "132 132 132 84 hex (132)\n" "133 133 133 85 hex (133)\n" "134 134 134 86 hex (134)\n" "135 135 135 87 hex (135)\n" "136 136 136 88 hex (136)\n" "137 137 137 89 hex (137)\n" "138 138 138 8A hex (138)\n" "139 139 139 8B hex (139)\n" "140 140 140 8C hex (140)\n" "141 141 141 8D hex (141)\n" "142 142 142 8E hex (142)\n" "143 143 143 8F hex (143)\n" "144 144 144 90 hex (144)\n" "145 145 145 91 hex (145)\n" "146 146 146 92 hex (146)\n" "147 147 147 93 hex (147)\n" "148 148 148 94 hex (148)\n" "149 149 149 95 hex (149)\n" "150 150 150 96 hex (150)\n" "151 151 151 97 hex (151)\n" "152 152 152 98 hex (152)\n" "153 153 153 99 hex (153)\n" "154 154 154 9A hex (154)\n" "155 155 155 9B hex (155)\n" "156 156 156 9C hex (156)\n" "157 157 157 9D hex (157)\n" "158 158 158 9E hex (158)\n" "159 159 159 9F hex (159)\n" "160 160 160 A0 hex (160)\n" "161 161 161 A1 hex (161)\n" "162 162 162 A2 hex (162)\n" "163 163 163 A3 hex (163)\n" "164 164 164 A4 hex (164)\n" "165 165 165 A5 hex (165)\n" "166 166 166 A6 hex (166)\n" "167 167 167 A7 hex (167)\n" "168 168 168 A8 hex (168)\n" "169 169 169 A9 hex (169)\n" "170 170 170 AA hex (170)\n" "171 171 171 AB hex (171)\n" "172 172 172 AC hex (172)\n" "173 173 173 AD hex (173)\n" "174 174 174 AE hex (174)\n" "175 175 175 AF hex (175)\n" "176 176 176 B0 hex (176)\n" "177 177 177 B1 hex (177)\n" "178 178 178 B2 hex (178)\n" "179 179 179 B3 hex (179)\n" "180 180 180 B4 hex (180)\n" "181 181 181 B5 hex (181)\n" "182 182 182 B6 hex (182)\n" "183 183 183 B7 hex (183)\n" "184 184 184 B8 hex (184)\n" "185 185 185 B9 hex (185)\n" "186 186 186 BA hex (186)\n" "187 187 187 BB hex (187)\n" "188 188 188 BC hex (188)\n" "189 189 189 BD hex (189)\n" "190 190 190 BE hex (190)\n" "191 191 191 BF hex (191)\n" "192 192 192 C0 hex (192)\n" "193 193 193 C1 hex (193)\n" "194 194 194 C2 hex (194)\n" "195 195 195 C3 hex (195)\n" "196 196 196 C4 hex (196)\n" "197 197 197 C5 hex (197)\n" "198 198 198 C6 hex (198)\n" "199 199 199 C7 hex (199)\n" "200 200 200 C8 hex (200)\n" "201 201 201 C9 hex (201)\n" "202 202 202 CA hex (202)\n" "203 203 203 CB hex (203)\n" "204 204 204 CC hex (204)\n" "205 205 205 CD hex (205)\n" "206 206 206 CE hex (206)\n" "207 207 207 CF hex (207)\n" "208 208 208 D0 hex (208)\n" "209 209 209 D1 hex (209)\n" "210 210 210 D2 hex (210)\n" "211 211 211 D3 hex (211)\n" "212 212 212 D4 hex (212)\n" "213 213 213 D5 hex (213)\n" "214 214 214 D6 hex (214)\n" "215 215 215 D7 hex (215)\n" "216 216 216 D8 hex (216)\n" "217 217 217 D9 hex (217)\n" "218 218 218 DA hex (218)\n" "219 219 219 DB hex (219)\n" "220 220 220 DC hex (220)\n" "221 221 221 DD hex (221)\n" "222 222 222 DE hex (222)\n" "223 223 223 DF hex (223)\n" "224 224 224 E0 hex (224)\n" "225 225 225 E1 hex (225)\n" "226 226 226 E2 hex (226)\n" "227 227 227 E3 hex (227)\n" "228 228 228 E4 hex (228)\n" "229 229 229 E5 hex (229)\n" "230 230 230 E6 hex (230)\n" "231 231 231 E7 hex (231)\n" "232 232 232 E8 hex (232)\n" "233 233 233 E9 hex (233)\n" "234 234 234 EA hex (234)\n" "235 235 235 EB hex (235)\n" "236 236 236 EC hex (236)\n" "237 237 237 ED hex (237)\n" "238 238 238 EE hex (238)\n" "239 239 239 EF hex (239)\n" "240 240 240 F0 hex (240)\n" "241 241 241 F1 hex (241)\n" "242 242 242 F2 hex (242)\n" "243 243 243 F3 hex (243)\n" "244 244 244 F4 hex (244)\n" "245 245 245 F5 hex (245)\n" "246 246 246 F6 hex (246)\n" "247 247 247 F7 hex (247)\n" "248 248 248 F8 hex (248)\n" "249 249 249 F9 hex (249)\n" "250 250 250 FA hex (250)\n" "251 251 251 FB hex (251)\n" "252 252 252 FC hex (252)\n" "253 253 253 FD hex (253)\n" "254 254 254 FE hex (254)\n" "255 255 255 FF hex (255)\n" "" }, {.path = "data/palettes/Grays.gpl", .size = 587, .data = "GIMP Palette\n" "Name: Grays\n" "#\n" "0 0 0 gray0\n" "7 7 7 gray3\n" "15 15 15 gray6\n" "23 23 23 gray9\n" "31 31 31 gray12\n" "39 39 39 gray15\n" "47 47 47 gray18\n" "55 55 55 gray21\n" "63 63 63 gray25\n" "71 71 71 gray28\n" "79 79 79 gray31\n" "87 87 87 gray34\n" "95 95 95 gray37\n" "103 103 103 gray40\n" "111 111 111 gray43\n" "119 119 119 gray46\n" "127 127 127 gray50\n" "135 135 135 gray53\n" "143 143 143 gray56\n" "151 151 151 gray59\n" "159 159 159 gray62\n" "167 167 167 gray65\n" "175 175 175 gray68\n" "183 183 183 gray71\n" "191 191 191 gray75\n" "199 199 199 gray78\n" "207 207 207 gray81\n" "215 215 215 gray84\n" "223 223 223 gray87\n" "231 231 231 gray90\n" "239 239 239 gray93\n" "247 247 247 gray96\n" "" }, {.path = "data/palettes/Greens.gpl", .size = 5161, .data = "GIMP Palette\n" "Name: Greens\n" "#\n" " 0 0 0 #000000\n" "128 128 128 #808080\n" "255 255 255 #FFFFFF\n" " 0 4 0 #000400\n" " 0 12 0 #000C00\n" " 0 16 0 #001000\n" " 0 24 0 #001800\n" " 0 32 0 #002000\n" " 0 36 0 #002400\n" " 0 44 0 #002C00\n" " 0 48 0 #003000\n" " 0 56 0 #003800\n" " 0 64 0 #004000\n" " 0 68 0 #004400\n" " 0 76 0 #004C00\n" " 0 80 0 #005000\n" " 0 88 0 #005800\n" " 0 96 0 #006000\n" " 0 100 0 #006400\n" " 0 108 0 #006C00\n" " 0 116 0 #007400\n" " 0 120 0 #007800\n" " 0 128 0 #008000\n" " 0 132 0 #008400\n" " 0 140 0 #008C00\n" " 0 148 0 #009400\n" " 0 152 0 #009800\n" " 0 160 0 #00A000\n" " 0 164 0 #00A400\n" " 0 172 0 #00AC00\n" " 0 180 0 #00B400\n" " 0 184 0 #00B800\n" " 0 192 0 #00C000\n" " 0 200 0 #00C800\n" " 4 200 0 #04C800\n" " 12 200 0 #0CC800\n" " 16 204 0 #10CC00\n" " 24 204 0 #18CC00\n" " 28 208 0 #1CD000\n" " 36 208 0 #24D000\n" " 40 208 0 #28D000\n" " 48 212 0 #30D400\n" " 56 212 0 #38D400\n" " 60 216 0 #3CD800\n" " 68 216 0 #44D800\n" " 72 216 0 #48D800\n" " 80 220 0 #50DC00\n" " 84 220 0 #54DC00\n" " 92 224 0 #5CE000\n" "100 224 0 #64E000\n" "104 224 0 #68E000\n" "112 228 0 #70E400\n" "116 228 0 #74E400\n" "124 232 0 #7CE800\n" "128 232 0 #80E800\n" "136 232 0 #88E800\n" "140 236 0 #8CEC00\n" "148 236 0 #94EC00\n" "156 240 0 #9CF000\n" "160 240 0 #A0F000\n" "168 240 0 #A8F000\n" "172 244 0 #ACF400\n" "180 244 0 #B4F400\n" "184 248 0 #B8F800\n" "192 248 0 #C0F800\n" "200 252 0 #C8FC00\n" "200 252 4 #C8FC04\n" "200 252 12 #C8FC0C\n" "204 252 20 #CCFC14\n" "204 252 28 #CCFC1C\n" "208 252 36 #D0FC24\n" "208 252 44 #D0FC2C\n" "208 252 52 #D0FC34\n" "212 252 60 #D4FC3C\n" "212 252 68 #D4FC44\n" "216 252 76 #D8FC4C\n" "216 252 84 #D8FC54\n" "216 252 92 #D8FC5C\n" "220 252 100 #DCFC64\n" "220 252 108 #DCFC6C\n" "224 252 116 #E0FC74\n" "224 252 124 #E0FC7C\n" "224 252 132 #E0FC84\n" "228 252 140 #E4FC8C\n" "228 252 148 #E4FC94\n" "232 252 156 #E8FC9C\n" "232 252 164 #E8FCA4\n" "232 252 172 #E8FCAC\n" "236 252 180 #ECFCB4\n" "236 252 188 #ECFCBC\n" "240 252 196 #F0FCC4\n" "240 252 204 #F0FCCC\n" "240 252 212 #F0FCD4\n" "244 252 220 #F4FCDC\n" "244 252 228 #F4FCE4\n" "248 252 236 #F8FCEC\n" "248 252 244 #F8FCF4\n" "252 252 252 #FCFCFC\n" "252 252 248 #FCFCF8\n" "252 252 244 #FCFCF4\n" "252 252 240 #FCFCF0\n" "252 252 232 #FCFCE8\n" "252 252 228 #FCFCE4\n" "252 252 224 #FCFCE0\n" "252 252 216 #FCFCD8\n" "252 252 212 #FCFCD4\n" "252 252 208 #FCFCD0\n" "252 252 200 #FCFCC8\n" "252 252 196 #FCFCC4\n" "252 252 192 #FCFCC0\n" "252 252 184 #FCFCB8\n" "252 252 180 #FCFCB4\n" "252 252 176 #FCFCB0\n" "252 252 168 #FCFCA8\n" "252 252 164 #FCFCA4\n" "252 252 160 #FCFCA0\n" "252 252 156 #FCFC9C\n" "252 252 148 #FCFC94\n" "252 252 144 #FCFC90\n" "252 252 140 #FCFC8C\n" "252 252 132 #FCFC84\n" "252 252 128 #FCFC80\n" "252 252 124 #FCFC7C\n" "252 252 116 #FCFC74\n" "252 252 112 #FCFC70\n" "252 252 108 #FCFC6C\n" "252 252 100 #FCFC64\n" "252 252 96 #FCFC60\n" "252 252 92 #FCFC5C\n" "252 252 84 #FCFC54\n" "252 252 80 #FCFC50\n" "252 252 76 #FCFC4C\n" "252 252 72 #FCFC48\n" "252 252 64 #FCFC40\n" "252 252 60 #FCFC3C\n" "252 252 56 #FCFC38\n" "252 252 48 #FCFC30\n" "252 252 44 #FCFC2C\n" "252 252 40 #FCFC28\n" "252 252 32 #FCFC20\n" "252 252 28 #FCFC1C\n" "252 252 24 #FCFC18\n" "252 252 16 #FCFC10\n" "252 252 12 #FCFC0C\n" "252 252 8 #FCFC08\n" "252 252 0 #FCFC00\n" "248 252 0 #F8FC00\n" "244 252 0 #F4FC00\n" "240 252 0 #F0FC00\n" "232 252 0 #E8FC00\n" "228 252 0 #E4FC00\n" "224 252 0 #E0FC00\n" "216 252 0 #D8FC00\n" "212 252 0 #D4FC00\n" "208 252 0 #D0FC00\n" "200 252 0 #C8FC00\n" "196 252 0 #C4FC00\n" "192 252 0 #C0FC00\n" "184 252 0 #B8FC00\n" "180 252 0 #B4FC00\n" "176 252 0 #B0FC00\n" "168 252 0 #A8FC00\n" "164 252 0 #A4FC00\n" "160 252 0 #A0FC00\n" "156 252 0 #9CFC00\n" "148 252 0 #94FC00\n" "144 252 0 #90FC00\n" "140 252 0 #8CFC00\n" "132 252 0 #84FC00\n" "128 252 0 #80FC00\n" "124 252 0 #7CFC00\n" "116 252 0 #74FC00\n" "112 252 0 #70FC00\n" "108 252 0 #6CFC00\n" "100 252 0 #64FC00\n" " 96 252 0 #60FC00\n" " 92 252 0 #5CFC00\n" " 84 252 0 #54FC00\n" " 80 252 0 #50FC00\n" " 76 252 0 #4CFC00\n" " 72 252 0 #48FC00\n" " 64 252 0 #40FC00\n" " 60 252 0 #3CFC00\n" " 56 252 0 #38FC00\n" " 48 252 0 #30FC00\n" " 44 252 0 #2CFC00\n" " 40 252 0 #28FC00\n" " 32 252 0 #20FC00\n" " 28 252 0 #1CFC00\n" " 24 252 0 #18FC00\n" " 16 252 0 #10FC00\n" " 12 252 0 #0CFC00\n" " 8 252 0 #08FC00\n" " 0 252 0 #00FC00\n" " 0 248 0 #00F800\n" " 0 244 0 #00F400\n" " 0 240 0 #00F000\n" " 0 236 0 #00EC00\n" " 0 232 0 #00E800\n" " 0 228 0 #00E400\n" " 0 224 0 #00E000\n" " 0 220 0 #00DC00\n" " 0 216 0 #00D800\n" " 0 212 0 #00D400\n" " 0 208 0 #00D000\n" " 0 204 0 #00CC00\n" " 0 200 0 #00C800\n" " 0 196 0 #00C400\n" " 0 192 0 #00C000\n" " 0 188 0 #00BC00\n" " 0 184 0 #00B800\n" " 0 180 0 #00B400\n" " 0 176 0 #00B000\n" " 0 172 0 #00AC00\n" " 0 168 0 #00A800\n" " 0 164 0 #00A400\n" " 0 160 0 #00A000\n" " 0 156 0 #009C00\n" " 0 152 0 #009800\n" " 0 148 0 #009400\n" " 0 144 0 #009000\n" " 0 140 0 #008C00\n" " 0 136 0 #008800\n" " 0 132 0 #008400\n" " 0 128 0 #008000\n" " 0 124 0 #007C00\n" " 0 120 0 #007800\n" " 0 116 0 #007400\n" " 0 112 0 #007000\n" " 0 108 0 #006C00\n" " 0 104 0 #006800\n" " 0 100 0 #006400\n" " 0 96 0 #006000\n" " 0 92 0 #005C00\n" " 0 88 0 #005800\n" " 0 84 0 #005400\n" " 0 80 0 #005000\n" " 0 76 0 #004C00\n" " 0 72 0 #004800\n" " 0 68 0 #004400\n" " 0 64 0 #004000\n" " 0 60 0 #003C00\n" " 0 56 0 #003800\n" " 0 52 0 #003400\n" " 0 48 0 #003000\n" " 0 44 0 #002C00\n" " 0 40 0 #002800\n" " 0 36 0 #002400\n" " 0 32 0 #002000\n" " 0 28 0 #001C00\n" " 0 24 0 #001800\n" " 0 20 0 #001400\n" " 0 16 0 #001000\n" " 0 12 0 #000C00\n" " 0 8 0 #000800\n" " 0 0 0 #000000\n" "" }, {.path = "data/palettes/Hilite.gpl", .size = 3441, .data = "GIMP Palette\n" "Name: Hilite\n" "#\n" " 0 0 0 #000000\n" "128 128 128 #808080\n" "255 255 255 #FFFFFF\n" "164 144 180 #A490B4\n" "160 144 180 #A090B4\n" "160 144 176 #A090B0\n" "160 140 172 #A08CAC\n" "160 140 168 #A08CA8\n" "160 140 164 #A08CA4\n" "160 136 164 #A088A4\n" "156 136 160 #9C88A0\n" "156 136 156 #9C889C\n" "156 132 152 #9C8498\n" "156 132 148 #9C8494\n" "156 132 144 #9C8490\n" "152 128 144 #988090\n" "152 128 140 #98808C\n" "152 128 136 #988088\n" "152 128 132 #988084\n" "152 124 132 #987C84\n" "152 124 128 #987C80\n" "152 124 124 #987C7C\n" "148 124 124 #947C7C\n" "148 124 120 #947C78\n" "148 120 120 #947878\n" "148 120 116 #947874\n" "148 120 112 #947870\n" "148 116 108 #94746C\n" "144 116 108 #90746C\n" "144 116 104 #907468\n" "144 116 100 #907464\n" "144 112 100 #907064\n" "144 112 96 #907060\n" "144 112 92 #90705C\n" "144 112 88 #907058\n" "140 108 88 #8C6C58\n" "140 108 84 #8C6C54\n" "140 108 80 #8C6C50\n" "140 104 76 #8C684C\n" "140 104 72 #8C6848\n" "136 104 68 #886844\n" "136 100 68 #886444\n" "136 100 64 #886440\n" "136 100 60 #88643C\n" "136 96 56 #886038\n" "136 96 52 #886034\n" "132 96 48 #846030\n" "132 92 44 #845C2C\n" "132 92 40 #845C28\n" "132 92 36 #845C24\n" "132 88 36 #845824\n" "132 88 32 #845820\n" "128 88 32 #805820\n" "128 88 28 #80581C\n" "128 88 24 #805818\n" "128 84 24 #805418\n" "128 84 20 #805414\n" "128 84 16 #805410\n" "124 80 12 #7C500C\n" "124 84 16 #7C5410\n" "128 84 16 #805410\n" "128 88 20 #805814\n" "128 92 24 #805C18\n" "132 92 24 #845C18\n" "132 92 28 #845C1C\n" "132 96 28 #84601C\n" "136 96 32 #886020\n" "136 100 32 #886420\n" "136 104 36 #886824\n" "140 104 36 #8C6824\n" "140 108 40 #8C6C28\n" "144 108 44 #906C2C\n" "144 112 44 #90702C\n" "144 112 48 #907030\n" "144 116 48 #907430\n" "148 116 52 #947434\n" "148 120 52 #947834\n" "148 120 56 #947838\n" "152 120 56 #987838\n" "152 124 56 #987C38\n" "152 124 60 #987C3C\n" "152 128 60 #98803C\n" "156 128 64 #9C8040\n" "156 132 64 #9C8440\n" "156 132 68 #9C8444\n" "160 136 68 #A08844\n" "160 136 72 #A08848\n" "160 140 76 #A08C4C\n" "164 140 76 #A48C4C\n" "164 144 76 #A4904C\n" "164 144 80 #A49050\n" "164 148 80 #A49450\n" "168 148 84 #A89454\n" "168 152 88 #A89858\n" "172 152 88 #AC9858\n" "172 156 92 #AC9C5C\n" "172 160 96 #ACA060\n" "176 160 96 #B0A060\n" "176 164 100 #B0A464\n" "180 164 100 #B4A464\n" "180 168 104 #B4A868\n" "180 172 108 #B4AC6C\n" "184 172 108 #B8AC6C\n" "184 176 112 #B8B070\n" "188 176 116 #BCB074\n" "188 180 116 #BCB474\n" "188 180 120 #BCB478\n" "188 184 120 #BCB878\n" "192 184 120 #C0B878\n" "192 188 124 #C0BC7C\n" "196 192 128 #C4C080\n" "196 192 132 #C4C084\n" "196 196 132 #C4C484\n" "200 196 136 #C8C488\n" "200 200 136 #C8C888\n" "200 200 140 #C8C88C\n" "200 204 140 #C8CC8C\n" "204 204 144 #CCCC90\n" "204 208 144 #CCD090\n" "208 208 148 #D0D094\n" "208 212 148 #D0D494\n" "208 212 152 #D0D498\n" "208 216 152 #D0D898\n" "212 216 156 #D4D89C\n" "212 220 156 #D4DC9C\n" "212 220 160 #D4DCA0\n" "216 220 160 #D8DCA0\n" "216 224 164 #D8E0A4\n" "216 228 164 #D8E4A4\n" "220 228 168 #DCE4A8\n" "220 232 168 #DCE8A8\n" "220 232 172 #DCE8AC\n" "224 232 172 #E0E8AC\n" "224 236 176 #E0ECB0\n" "224 240 180 #E0F0B4\n" "228 240 180 #E4F0B4\n" "228 244 184 #E4F4B8\n" "232 248 188 #E8F8BC\n" "228 244 188 #E4F4BC\n" "224 244 188 #E0F4BC\n" "224 240 188 #E0F0BC\n" "220 240 188 #DCF0BC\n" "220 236 188 #DCECBC\n" "216 236 188 #D8ECBC\n" "216 232 188 #D8E8BC\n" "212 232 188 #D4E8BC\n" "212 232 184 #D4E8B8\n" "212 228 184 #D4E4B8\n" "208 228 184 #D0E4B8\n" "204 224 184 #CCE0B8\n" "204 220 184 #CCDCB8\n" "200 220 184 #C8DCB8\n" "196 216 184 #C4D8B8\n" "192 212 184 #C0D4B8\n" "192 212 180 #C0D4B4\n" "188 212 180 #BCD4B4\n" "188 208 180 #BCD0B4\n" "184 208 180 #B8D0B4\n" "184 204 180 #B8CCB4\n" "180 204 180 #B4CCB4\n" "180 200 180 #B4C8B4\n" "176 200 180 #B0C8B4\n" "176 196 180 #B0C4B4\n" "172 196 180 #ACC4B4\n" "172 192 180 #ACC0B4\n" "168 192 176 #A8C0B0\n" "168 188 176 #A8BCB0\n" "164 188 176 #A4BCB0\n" "160 184 176 #A0B8B0\n" "156 180 176 #9CB4B0\n" "" }, {.path = "data/palettes/inkscape.gpl", .size = 9231, .data = "GIMP Palette\n" "Name: Inkscape default\n" "Columns: 3\n" "# generated by PaletteGen.py\n" " 0 0 0 Black\n" " 26 26 26 90% Gray\n" " 51 51 51 80% Gray\n" " 77 77 77 70% Gray\n" "102 102 102 60% Gray\n" "128 128 128 50% Gray\n" "153 153 153 40% Gray\n" "179 179 179 30% Gray\n" "204 204 204 20% Gray\n" "230 230 230 10% Gray\n" "236 236 236 7.5% Gray\n" "242 242 242 5% Gray\n" "249 249 249 2.5% Gray\n" "255 255 255 White\n" "128 0 0 Maroon (#800000)\n" "255 0 0 Red (#FF0000)\n" "128 128 0 Olive (#808000)\n" "255 255 0 Yellow (#FFFF00)\n" " 0 128 0 Green (#008000)\n" " 0 255 0 Lime (#00FF00)\n" " 0 128 128 Teal (#008080)\n" " 0 255 255 Aqua (#00FFFF)\n" " 0 0 128 Navy (#000080)\n" " 0 0 255 Blue (#0000FF)\n" "128 0 128 Purple (#800080)\n" "255 0 255 Fuchsia (#FF00FF)\n" " 43 0 0 #2B0000\n" " 85 0 0 #550000\n" "128 0 0 #800000\n" "170 0 0 #AA0000\n" "212 0 0 #D40000\n" "255 0 0 #FF0000\n" "255 42 42 #FF2A2A\n" "255 85 85 #FF5555\n" "255 128 128 #FF8080\n" "255 170 170 #FFAAAA\n" "255 213 213 #FFD5D5\n" " 40 11 11 #280B0B\n" " 80 22 22 #501616\n" "120 33 33 #782121\n" "160 44 44 #A02C2C\n" "200 55 55 #C83737\n" "211 95 95 #D35F5F\n" "222 135 135 #DE8787\n" "233 175 175 #E9AFAF\n" "244 215 215 #F4D7D7\n" " 36 28 28 #241C1C\n" " 72 55 55 #483737\n" "108 83 83 #6C5353\n" "145 111 111 #916F6F\n" "172 147 147 #AC9393\n" "200 183 183 #C8B7B7\n" "227 219 219 #E3DBDB\n" " 43 17 0 #2B1100\n" " 85 34 0 #552200\n" "128 51 0 #803300\n" "170 68 0 #AA4400\n" "212 85 0 #D45500\n" "255 102 0 #FF6600\n" "255 127 42 #FF7F2A\n" "255 153 85 #FF9955\n" "255 179 128 #FFB380\n" "255 204 170 #FFCCAA\n" "255 230 213 #FFE6D5\n" " 40 23 11 #28170B\n" " 80 45 22 #502D16\n" "120 68 33 #784421\n" "160 90 44 #A05A2C\n" "200 113 55 #C87137\n" "211 141 95 #D38D5F\n" "222 170 135 #DEAA87\n" "233 198 175 #E9C6AF\n" "244 227 215 #F4E3D7\n" " 36 31 28 #241F1C\n" " 72 62 55 #483E37\n" "108 93 83 #6C5D53\n" "145 124 111 #917C6F\n" "172 157 147 #AC9D93\n" "200 190 183 #C8BEB7\n" "227 222 219 #E3DEDB\n" " 43 34 0 #2B2200\n" " 85 68 0 #554400\n" "128 102 0 #806600\n" "170 136 0 #AA8800\n" "212 170 0 #D4AA00\n" "255 204 0 #FFCC00\n" "255 212 42 #FFD42A\n" "255 221 85 #FFDD55\n" "255 230 128 #FFE680\n" "255 238 170 #FFEEAA\n" "255 246 213 #FFF6D5\n" " 40 34 11 #28220B\n" " 80 68 22 #504416\n" "120 103 33 #786721\n" "160 137 44 #A0892C\n" "200 171 55 #C8AB37\n" "211 188 95 #D3BC5F\n" "222 205 135 #DECD87\n" "233 221 175 #E9DDAF\n" "244 238 215 #F4EED7\n" " 36 34 28 #24221C\n" " 72 69 55 #484537\n" "108 103 83 #6C6753\n" "145 138 111 #918A6F\n" "172 167 147 #ACA793\n" "200 196 183 #C8C4B7\n" "227 226 219 #E3E2DB\n" " 34 43 0 #222B00\n" " 68 85 0 #445500\n" "102 128 0 #668000\n" "136 170 0 #88AA00\n" "170 212 0 #AAD400\n" "204 255 0 #CCFF00\n" "212 255 42 #D4FF2A\n" "221 255 85 #DDFF55\n" "229 255 128 #E5FF80\n" "238 255 170 #EEFFAA\n" "246 255 213 #F6FFD5\n" " 34 40 11 #22280B\n" " 68 80 22 #445016\n" "103 120 33 #677821\n" "137 160 44 #89A02C\n" "171 200 55 #ABC837\n" "188 211 95 #BCD35F\n" "205 222 135 #CDDE87\n" "221 233 175 #DDE9AF\n" "238 244 215 #EEF4D7\n" " 34 36 28 #22241C\n" " 69 72 55 #454837\n" "103 108 83 #676C53\n" "138 145 111 #8A916F\n" "167 172 147 #A7AC93\n" "196 200 183 #C4C8B7\n" "226 227 219 #E2E3DB\n" " 17 43 0 #112B00\n" " 34 85 0 #225500\n" " 51 128 0 #338000\n" " 68 170 0 #44AA00\n" " 85 212 0 #55D400\n" "102 255 0 #66FF00\n" "127 255 42 #7FFF2A\n" "153 255 85 #99FF55\n" "179 255 128 #B3FF80\n" "204 255 170 #CCFFAA\n" "229 255 213 #E5FFD5\n" " 23 40 11 #17280B\n" " 45 80 22 #2D5016\n" " 68 120 33 #447821\n" " 90 160 44 #5AA02C\n" "113 200 55 #71C837\n" "141 211 95 #8DD35F\n" "170 222 135 #AADE87\n" "198 233 175 #C6E9AF\n" "227 244 215 #E3F4D7\n" " 31 36 28 #1F241C\n" " 62 72 55 #3E4837\n" " 93 108 83 #5D6C53\n" "124 145 111 #7C916F\n" "157 172 147 #9DAC93\n" "190 200 183 #BEC8B7\n" "222 227 219 #DEE3DB\n" " 0 43 0 #002B00\n" " 0 85 0 #005500\n" " 0 128 0 #008000\n" " 0 170 0 #00AA00\n" " 0 212 0 #00D400\n" " 0 255 0 #00FF00\n" " 42 255 42 #2AFF2A\n" " 85 255 85 #55FF55\n" "128 255 128 #80FF80\n" "170 255 170 #AAFFAA\n" "213 255 213 #D5FFD5\n" " 11 40 11 #0B280B\n" " 22 80 22 #165016\n" " 33 120 33 #217821\n" " 44 160 44 #2CA02C\n" " 55 200 55 #37C837\n" " 95 211 95 #5FD35F\n" "135 222 135 #87DE87\n" "175 233 175 #AFE9AF\n" "215 244 215 #D7F4D7\n" " 28 36 28 #1C241C\n" " 55 72 55 #374837\n" " 83 108 83 #536C53\n" "111 145 111 #6F916F\n" "147 172 147 #93AC93\n" "183 200 183 #B7C8B7\n" "219 227 219 #DBE3DB\n" " 0 43 17 #002B11\n" " 0 85 34 #005522\n" " 0 128 51 #008033\n" " 0 170 68 #00AA44\n" " 0 212 85 #00D455\n" " 0 255 102 #00FF66\n" " 42 255 128 #2AFF80\n" " 85 255 153 #55FF99\n" "128 255 179 #80FFB3\n" "170 255 204 #AAFFCC\n" "213 255 230 #D5FFE6\n" " 11 40 23 #0B2817\n" " 22 80 45 #16502D\n" " 33 120 68 #217844\n" " 44 160 90 #2CA05A\n" " 55 200 113 #37C871\n" " 95 211 141 #5FD38D\n" "135 222 170 #87DEAA\n" "175 233 198 #AFE9C6\n" "215 244 227 #D7F4E3\n" " 28 36 31 #1C241F\n" " 55 72 62 #37483E\n" " 83 108 93 #536C5D\n" "111 145 124 #6F917C\n" "147 172 157 #93AC9D\n" "183 200 190 #B7C8BE\n" "219 227 222 #DBE3DE\n" " 0 43 34 #002B22\n" " 0 85 68 #005544\n" " 0 128 102 #008066\n" " 0 170 136 #00AA88\n" " 0 212 170 #00D4AA\n" " 0 255 204 #00FFCC\n" " 42 255 213 #2AFFD5\n" " 85 255 221 #55FFDD\n" "128 255 230 #80FFE6\n" "170 255 238 #AAFFEE\n" "213 255 246 #D5FFF6\n" " 11 40 34 #0B2822\n" " 22 80 68 #165044\n" " 33 120 103 #217867\n" " 44 160 137 #2CA089\n" " 55 200 171 #37C8AB\n" " 95 211 188 #5FD3BC\n" "135 222 205 #87DECD\n" "175 233 221 #AFE9DD\n" "215 244 238 #D7F4EE\n" " 28 36 34 #1C2422\n" " 55 72 69 #374845\n" " 83 108 103 #536C67\n" "111 145 138 #6F918A\n" "147 172 167 #93ACA7\n" "183 200 196 #B7C8C4\n" "219 227 226 #DBE3E2\n" " 0 34 43 #00222B\n" " 0 68 85 #004455\n" " 0 102 128 #006680\n" " 0 136 170 #0088AA\n" " 0 170 212 #00AAD4\n" " 0 204 255 #00CCFF\n" " 42 212 255 #2AD4FF\n" " 85 221 255 #55DDFF\n" "128 229 255 #80E5FF\n" "170 238 255 #AAEEFF\n" "213 246 255 #D5F6FF\n" " 11 34 40 #0B2228\n" " 22 68 80 #164450\n" " 33 103 120 #216778\n" " 44 137 160 #2C89A0\n" " 55 171 200 #37ABC8\n" " 95 188 211 #5FBCD3\n" "135 205 222 #87CDDE\n" "175 221 233 #AFDDE9\n" "215 238 244 #D7EEF4\n" " 28 34 36 #1C2224\n" " 55 69 72 #374548\n" " 83 103 108 #53676C\n" "111 138 145 #6F8A91\n" "147 167 172 #93A7AC\n" "183 196 200 #B7C4C8\n" "219 226 227 #DBE2E3\n" " 0 17 43 #00112B\n" " 0 34 85 #002255\n" " 0 51 128 #003380\n" " 0 68 170 #0044AA\n" " 0 85 212 #0055D4\n" " 0 102 255 #0066FF\n" " 42 127 255 #2A7FFF\n" " 85 153 255 #5599FF\n" "128 179 255 #80B3FF\n" "170 204 255 #AACCFF\n" "213 229 255 #D5E5FF\n" " 11 23 40 #0B1728\n" " 22 45 80 #162D50\n" " 33 68 120 #214478\n" " 44 90 160 #2C5AA0\n" " 55 113 200 #3771C8\n" " 95 141 211 #5F8DD3\n" "135 170 222 #87AADE\n" "175 198 233 #AFC6E9\n" "215 227 244 #D7E3F4\n" " 28 31 36 #1C1F24\n" " 55 62 72 #373E48\n" " 83 93 108 #535D6C\n" "111 124 145 #6F7C91\n" "147 157 172 #939DAC\n" "183 190 200 #B7BEC8\n" "219 222 227 #DBDEE3\n" " 0 0 43 #00002B\n" " 0 0 85 #000055\n" " 0 0 128 #000080\n" " 0 0 170 #0000AA\n" " 0 0 212 #0000D4\n" " 0 0 255 #0000FF\n" " 42 42 255 #2A2AFF\n" " 85 85 255 #5555FF\n" "128 128 255 #8080FF\n" "170 170 255 #AAAAFF\n" "213 213 255 #D5D5FF\n" " 11 11 40 #0B0B28\n" " 22 22 80 #161650\n" " 33 33 120 #212178\n" " 44 44 160 #2C2CA0\n" " 55 55 200 #3737C8\n" " 95 95 211 #5F5FD3\n" "135 135 222 #8787DE\n" "175 175 233 #AFAFE9\n" "215 215 244 #D7D7F4\n" " 28 28 36 #1C1C24\n" " 55 55 72 #373748\n" " 83 83 108 #53536C\n" "111 111 145 #6F6F91\n" "147 147 172 #9393AC\n" "183 183 200 #B7B7C8\n" "219 219 227 #DBDBE3\n" " 17 0 43 #11002B\n" " 34 0 85 #220055\n" " 51 0 128 #330080\n" " 68 0 170 #4400AA\n" " 85 0 212 #5500D4\n" "102 0 255 #6600FF\n" "127 42 255 #7F2AFF\n" "153 85 255 #9955FF\n" "179 128 255 #B380FF\n" "204 170 255 #CCAAFF\n" "229 213 255 #E5D5FF\n" " 23 11 40 #170B28\n" " 45 22 80 #2D1650\n" " 68 33 120 #442178\n" " 90 44 160 #5A2CA0\n" "113 55 200 #7137C8\n" "141 95 211 #8D5FD3\n" "170 135 222 #AA87DE\n" "198 175 233 #C6AFE9\n" "227 215 244 #E3D7F4\n" " 31 28 36 #1F1C24\n" " 62 55 72 #3E3748\n" " 93 83 108 #5D536C\n" "124 111 145 #7C6F91\n" "157 147 172 #9D93AC\n" "190 183 200 #BEB7C8\n" "222 219 227 #DEDBE3\n" " 34 0 43 #22002B\n" " 68 0 85 #440055\n" "102 0 128 #660080\n" "136 0 170 #8800AA\n" "170 0 212 #AA00D4\n" "204 0 255 #CC00FF\n" "212 42 255 #D42AFF\n" "221 85 255 #DD55FF\n" "229 128 255 #E580FF\n" "238 170 255 #EEAAFF\n" "246 213 255 #F6D5FF\n" " 34 11 40 #220B28\n" " 68 22 80 #441650\n" "103 33 120 #672178\n" "137 44 160 #892CA0\n" "171 55 200 #AB37C8\n" "188 95 211 #BC5FD3\n" "205 135 222 #CD87DE\n" "221 175 233 #DDAFE9\n" "238 215 244 #EED7F4\n" " 34 28 36 #221C24\n" " 69 55 72 #453748\n" "103 83 108 #67536C\n" "138 111 145 #8A6F91\n" "167 147 172 #A793AC\n" "196 183 200 #C4B7C8\n" "226 219 227 #E2DBE3\n" " 43 0 34 #2B0022\n" " 85 0 68 #550044\n" "128 0 102 #800066\n" "170 0 136 #AA0088\n" "212 0 170 #D400AA\n" "255 0 204 #FF00CC\n" "255 42 212 #FF2AD4\n" "255 85 221 #FF55DD\n" "255 128 229 #FF80E5\n" "255 170 238 #FFAAEE\n" "255 213 246 #FFD5F6\n" " 40 11 34 #280B22\n" " 80 22 68 #501644\n" "120 33 103 #782167\n" "160 44 137 #A02C89\n" "200 55 171 #C837AB\n" "211 95 188 #D35FBC\n" "222 135 205 #DE87CD\n" "233 175 221 #E9AFDD\n" "244 215 238 #F4D7EE\n" " 36 28 34 #241C22\n" " 72 55 69 #483745\n" "108 83 103 #6C5367\n" "145 111 138 #916F8A\n" "172 147 167 #AC93A7\n" "200 183 196 #C8B7C4\n" "227 219 226 #E3DBE2\n" " 43 0 17 #2B0011\n" " 85 0 34 #550022\n" "128 0 51 #800033\n" "170 0 68 #AA0044\n" "212 0 85 #D40055\n" "255 0 102 #FF0066\n" "255 42 127 #FF2A7F\n" "255 85 153 #FF5599\n" "255 128 178 #FF80B2\n" "255 170 204 #FFAACC\n" "255 213 229 #FFD5E5\n" " 40 11 23 #280B17\n" " 80 22 45 #50162D\n" "120 33 68 #782144\n" "160 44 90 #A02C5A\n" "200 55 113 #C83771\n" "211 95 141 #D35F8D\n" "222 135 170 #DE87AA\n" "233 175 198 #E9AFC6\n" "244 215 227 #F4D7E3\n" " 36 28 31 #241C1F\n" " 72 55 62 #48373E\n" "108 83 93 #6C535D\n" "145 111 124 #916F7C\n" "172 147 157 #AC939D\n" "200 183 190 #C8B7BE\n" "227 219 222 #E3DBDE\n" "" }, {.path = "data/palettes/Khaki.gpl", .size = 3160, .data = "GIMP Palette\n" "Name: Khaki\n" "#\n" " 0 0 0 #000000\n" "128 128 128 #808080\n" "255 255 255 #FFFFFF\n" "144 132 108 #90846C\n" "144 132 112 #908470\n" "144 132 116 #908474\n" "144 136 116 #908874\n" "144 136 120 #908878\n" "144 140 120 #908C78\n" "144 140 124 #908C7C\n" "144 140 128 #908C80\n" "144 144 128 #909080\n" "144 144 132 #909084\n" "144 144 136 #909088\n" "144 148 136 #909488\n" "144 148 140 #90948C\n" "144 152 140 #90988C\n" "144 152 144 #909890\n" "144 152 148 #909894\n" "144 156 148 #909C94\n" "144 156 152 #909C98\n" "144 160 152 #90A098\n" "144 160 156 #90A09C\n" "144 160 160 #90A0A0\n" "144 164 160 #90A4A0\n" "144 164 164 #90A4A4\n" "144 164 168 #90A4A8\n" "144 168 168 #90A8A8\n" "144 168 172 #90A8AC\n" "144 172 172 #90ACAC\n" "144 172 176 #90ACB0\n" "144 172 180 #90ACB4\n" "144 176 180 #90B0B4\n" "144 176 184 #90B0B8\n" "144 180 184 #90B4B8\n" "144 180 188 #90B4BC\n" "144 180 192 #90B4C0\n" "144 184 192 #90B8C0\n" "144 184 196 #90B8C4\n" "148 188 192 #94BCC0\n" "152 188 192 #98BCC0\n" "152 188 188 #98BCBC\n" "156 188 188 #9CBCBC\n" "160 188 184 #A0BCB8\n" "164 188 184 #A4BCB8\n" "164 188 180 #A4BCB4\n" "164 192 180 #A4C0B4\n" "168 192 180 #A8C0B4\n" "172 192 176 #ACC0B0\n" "176 192 176 #B0C0B0\n" "176 192 172 #B0C0AC\n" "180 192 172 #B4C0AC\n" "180 192 168 #B4C0A8\n" "184 192 168 #B8C0A8\n" "184 196 168 #B8C4A8\n" "188 196 164 #BCC4A4\n" "192 196 164 #C0C4A4\n" "192 196 160 #C0C4A0\n" "196 196 160 #C4C4A0\n" "200 196 156 #C8C49C\n" "200 200 156 #C8C89C\n" "204 200 156 #CCC89C\n" "204 200 152 #CCC898\n" "208 200 152 #D0C898\n" "208 200 148 #D0C894\n" "212 200 148 #D4C894\n" "216 200 148 #D8C894\n" "216 200 144 #D8C890\n" "220 200 144 #DCC890\n" "220 204 144 #DCCC90\n" "220 204 140 #DCCC8C\n" "224 204 140 #E0CC8C\n" "228 204 136 #E4CC88\n" "232 204 136 #E8CC88\n" "232 204 132 #E8CC84\n" "236 204 132 #ECCC84\n" "232 200 128 #E8C880\n" "228 200 128 #E4C880\n" "228 196 128 #E4C480\n" "228 196 124 #E4C47C\n" "224 196 124 #E0C47C\n" "220 192 124 #DCC07C\n" "220 192 120 #DCC078\n" "216 192 120 #D8C078\n" "216 188 120 #D8BC78\n" "212 188 120 #D4BC78\n" "212 188 116 #D4BC74\n" "208 188 116 #D0BC74\n" "208 184 116 #D0B874\n" "204 184 116 #CCB874\n" "204 184 112 #CCB870\n" "204 180 112 #CCB470\n" "200 180 112 #C8B470\n" "196 180 108 #C4B46C\n" "196 176 108 #C4B06C\n" "192 176 108 #C0B06C\n" "188 172 104 #BCAC68\n" "184 172 104 #B8AC68\n" "184 168 104 #B8A868\n" "180 168 100 #B4A864\n" "176 168 100 #B0A864\n" "176 164 100 #B0A464\n" "176 164 96 #B0A460\n" "172 164 96 #ACA460\n" "172 160 96 #ACA060\n" "168 160 96 #A8A060\n" "168 160 92 #A8A05C\n" "164 160 92 #A4A05C\n" "164 156 92 #A49C5C\n" "160 156 92 #A09C5C\n" "160 156 88 #A09C58\n" "156 152 88 #9C9858\n" "152 152 88 #989858\n" "152 152 84 #989854\n" "152 148 84 #989454\n" "148 148 84 #949454\n" "144 144 80 #909050\n" "140 144 80 #8C9050\n" "140 140 80 #8C8C50\n" "140 140 76 #8C8C4C\n" "136 140 76 #888C4C\n" "132 136 76 #84884C\n" "132 136 72 #848848\n" "128 136 72 #808848\n" "128 132 72 #808448\n" "124 132 72 #7C8448\n" "124 132 68 #7C8444\n" "120 132 68 #788444\n" "120 128 68 #788044\n" "116 128 68 #748044\n" "116 128 64 #748040\n" "116 124 64 #747C40\n" "112 124 64 #707C40\n" "108 124 60 #6C7C3C\n" "108 120 60 #6C783C\n" "104 120 60 #68783C\n" "100 116 56 #647438\n" " 96 116 56 #607438\n" " 96 112 56 #607038\n" " 92 112 52 #5C7034\n" " 88 112 52 #587034\n" " 88 108 52 #586C34\n" " 88 108 48 #586C30\n" " 84 108 48 #546C30\n" " 84 104 48 #546830\n" " 80 104 48 #506830\n" " 80 104 44 #50682C\n" " 76 104 44 #4C682C\n" " 76 100 44 #4C642C\n" " 72 100 44 #48642C\n" " 72 100 40 #486428\n" " 68 96 40 #446028\n" " 64 96 40 #406028\n" " 64 96 36 #406024\n" " 64 92 36 #405C24\n" " 60 92 36 #3C5C24\n" "" }, {.path = "data/palettes/MagicaVoxel.gpl", .size = 5154, .data = "GIMP Palette\n" "Name: MagicaVoxel\n" "#\n" "255 255 255 #FFFFFF\n" "255 255 204 #FFFFCC\n" "255 255 153 #FFFF99\n" "255 255 102 #FFFF66\n" "255 255 51 #FFFF33\n" "255 255 0 #FFFF00\n" "255 204 255 #FFCCFF\n" "255 204 204 #FFCCCC\n" "255 204 153 #FFCC99\n" "255 204 102 #FFCC66\n" "255 204 51 #FFCC33\n" "255 204 0 #FFCC00\n" "255 153 255 #FF99FF\n" "255 153 204 #FF99CC\n" "255 153 153 #FF9999\n" "255 153 102 #FF9966\n" "255 153 51 #FF9933\n" "255 153 0 #FF9900\n" "255 102 255 #FF66FF\n" "255 102 204 #FF66CC\n" "255 102 153 #FF6699\n" "255 102 102 #FF6666\n" "255 102 51 #FF6633\n" "255 102 0 #FF6600\n" "255 51 255 #FF33FF\n" "255 51 204 #FF33CC\n" "255 51 153 #FF3399\n" "255 51 102 #FF3366\n" "255 51 51 #FF3333\n" "255 51 0 #FF3300\n" "255 0 255 #FF00FF\n" "255 0 204 #FF00CC\n" "255 0 153 #FF0099\n" "255 0 102 #FF0066\n" "255 0 51 #FF0033\n" "255 0 0 #FF0000\n" "204 255 255 #CCFFFF\n" "204 255 204 #CCFFCC\n" "204 255 153 #CCFF99\n" "204 255 102 #CCFF66\n" "204 255 51 #CCFF33\n" "204 255 0 #CCFF00\n" "204 204 255 #CCCCFF\n" "204 204 204 #CCCCCC\n" "204 204 153 #CCCC99\n" "204 204 102 #CCCC66\n" "204 204 51 #CCCC33\n" "204 204 0 #CCCC00\n" "204 153 255 #CC99FF\n" "204 153 204 #CC99CC\n" "204 153 153 #CC9999\n" "204 153 102 #CC9966\n" "204 153 51 #CC9933\n" "204 153 0 #CC9900\n" "204 102 255 #CC66FF\n" "204 102 204 #CC66CC\n" "204 102 153 #CC6699\n" "204 102 102 #CC6666\n" "204 102 51 #CC6633\n" "204 102 0 #CC6600\n" "204 51 255 #CC33FF\n" "204 51 204 #CC33CC\n" "204 51 153 #CC3399\n" "204 51 102 #CC3366\n" "204 51 51 #CC3333\n" "204 51 0 #CC3300\n" "204 0 255 #CC00FF\n" "204 0 204 #CC00CC\n" "204 0 153 #CC0099\n" "204 0 102 #CC0066\n" "204 0 51 #CC0033\n" "204 0 0 #CC0000\n" "153 255 255 #99FFFF\n" "153 255 204 #99FFCC\n" "153 255 153 #99FF99\n" "153 255 102 #99FF66\n" "153 255 51 #99FF33\n" "153 255 0 #99FF00\n" "153 204 255 #99CCFF\n" "153 204 204 #99CCCC\n" "153 204 153 #99CC99\n" "153 204 102 #99CC66\n" "153 204 51 #99CC33\n" "153 204 0 #99CC00\n" "153 153 255 #9999FF\n" "153 153 204 #9999CC\n" "153 153 153 #999999\n" "153 153 102 #999966\n" "153 153 51 #999933\n" "153 153 0 #999900\n" "153 102 255 #9966FF\n" "153 102 204 #9966CC\n" "153 102 153 #996699\n" "153 102 102 #996666\n" "153 102 51 #996633\n" "153 102 0 #996600\n" "153 51 255 #9933FF\n" "153 51 204 #9933CC\n" "153 51 153 #993399\n" "153 51 102 #993366\n" "153 51 51 #993333\n" "153 51 0 #993300\n" "153 0 255 #9900FF\n" "153 0 204 #9900CC\n" "153 0 153 #990099\n" "153 0 102 #990066\n" "153 0 51 #990033\n" "153 0 0 #990000\n" "102 255 255 #66FFFF\n" "102 255 204 #66FFCC\n" "102 255 153 #66FF99\n" "102 255 102 #66FF66\n" "102 255 51 #66FF33\n" "102 255 0 #66FF00\n" "102 204 255 #66CCFF\n" "102 204 204 #66CCCC\n" "102 204 153 #66CC99\n" "102 204 102 #66CC66\n" "102 204 51 #66CC33\n" "102 204 0 #66CC00\n" "102 153 255 #6699FF\n" "102 153 204 #6699CC\n" "102 153 153 #669999\n" "102 153 102 #669966\n" "102 153 51 #669933\n" "102 153 0 #669900\n" "102 102 255 #6666FF\n" "102 102 204 #6666CC\n" "102 102 153 #666699\n" "102 102 102 #666666\n" "102 102 51 #666633\n" "102 102 0 #666600\n" "102 51 255 #6633FF\n" "102 51 204 #6633CC\n" "102 51 153 #663399\n" "102 51 102 #663366\n" "102 51 51 #663333\n" "102 51 0 #663300\n" "102 0 255 #6600FF\n" "102 0 204 #6600CC\n" "102 0 153 #660099\n" "102 0 102 #660066\n" "102 0 51 #660033\n" "102 0 0 #660000\n" "51 255 255 #33FFFF\n" "51 255 204 #33FFCC\n" "51 255 153 #33FF99\n" "51 255 102 #33FF66\n" "51 255 51 #33FF33\n" "51 255 0 #33FF00\n" "51 204 255 #33CCFF\n" "51 204 204 #33CCCC\n" "51 204 153 #33CC99\n" "51 204 102 #33CC66\n" "51 204 51 #33CC33\n" "51 204 0 #33CC00\n" "51 153 255 #3399FF\n" "51 153 204 #3399CC\n" "51 153 153 #339999\n" "51 153 102 #339966\n" "51 153 51 #339933\n" "51 153 0 #339900\n" "51 102 255 #3366FF\n" "51 102 204 #3366CC\n" "51 102 153 #336699\n" "51 102 102 #336666\n" "51 102 51 #336633\n" "51 102 0 #336600\n" "51 51 255 #3333FF\n" "51 51 204 #3333CC\n" "51 51 153 #333399\n" "51 51 102 #333366\n" "51 51 51 #333333\n" "51 51 0 #333300\n" "51 0 255 #3300FF\n" "51 0 204 #3300CC\n" "51 0 153 #330099\n" "51 0 102 #330066\n" "51 0 51 #330033\n" "51 0 0 #330000\n" "0 255 255 #00FFFF\n" "0 255 204 #00FFCC\n" "0 255 153 #00FF99\n" "0 255 102 #00FF66\n" "0 255 51 #00FF33\n" "0 255 0 #00FF00\n" "0 204 255 #00CCFF\n" "0 204 204 #00CCCC\n" "0 204 153 #00CC99\n" "0 204 102 #00CC66\n" "0 204 51 #00CC33\n" "0 204 0 #00CC00\n" "0 153 255 #0099FF\n" "0 153 204 #0099CC\n" "0 153 153 #009999\n" "0 153 102 #009966\n" "0 153 51 #009933\n" "0 153 0 #009900\n" "0 102 255 #0066FF\n" "0 102 204 #0066CC\n" "0 102 153 #006699\n" "0 102 102 #006666\n" "0 102 51 #006633\n" "0 102 0 #006600\n" "0 51 255 #0033FF\n" "0 51 204 #0033CC\n" "0 51 153 #003399\n" "0 51 102 #003366\n" "0 51 51 #003333\n" "0 51 0 #003300\n" "0 0 255 #0000FF\n" "0 0 204 #0000CC\n" "0 0 153 #000099\n" "0 0 102 #000066\n" "0 0 51 #000033\n" "238 0 0 #EE0000\n" "221 0 0 #DD0000\n" "187 0 0 #BB0000\n" "170 0 0 #AA0000\n" "136 0 0 #880000\n" "119 0 0 #770000\n" "85 0 0 #550000\n" "68 0 0 #440000\n" "34 0 0 #220000\n" "17 0 0 #110000\n" "0 238 0 #00EE00\n" "0 221 0 #00DD00\n" "0 187 0 #00BB00\n" "0 170 0 #00AA00\n" "0 136 0 #008800\n" "0 119 0 #007700\n" "0 85 0 #005500\n" "0 68 0 #004400\n" "0 34 0 #002200\n" "0 17 0 #001100\n" "0 0 238 #0000EE\n" "0 0 221 #0000DD\n" "0 0 187 #0000BB\n" "0 0 170 #0000AA\n" "0 0 136 #000088\n" "0 0 119 #000077\n" "0 0 85 #000055\n" "0 0 68 #000044\n" "0 0 34 #000022\n" "0 0 17 #000011\n" "238 238 238 #EEEEEE\n" "221 221 221 #DDDDDD\n" "187 187 187 #BBBBBB\n" "170 170 170 #AAAAAA\n" "136 136 136 #888888\n" "119 119 119 #777777\n" "85 85 85 #555555\n" "68 68 68 #444444\n" "34 34 34 #222222\n" "17 17 17 #111111\n" "0 0 0 #000000\n" "" }, {.path = "data/palettes/Pastels.gpl", .size = 435, .data = "GIMP Palette\n" "Name: Pastels\n" "# Pastels -- GIMP Palette file\n" "226 145 145 Untitled\n" "153 221 146 Untitled\n" "147 216 185 Untitled\n" "148 196 211 Untitled\n" "148 154 206 Untitled\n" "179 148 204 Untitled\n" "204 150 177 Untitled\n" "204 164 153 Untitled\n" "223 229 146 Untitled\n" "255 165 96 Untitled\n" "107 255 99 Untitled\n" "101 255 204 Untitled\n" "101 196 255 Untitled\n" "101 107 255 Untitled\n" "173 101 255 Untitled\n" "255 101 244 Untitled\n" "255 101 132 Untitled\n" "255 101 101 Untitled\n" "" }, {.path = "data/palettes/Plasma.gpl", .size = 3111, .data = "GIMP Palette\n" "Name: Plasma\n" "#\n" "240 240 0\n" "240 224 0\n" "240 208 0\n" "240 192 0\n" "240 176 0\n" "240 160 0\n" "240 144 0\n" "240 128 0\n" "240 112 0\n" "240 96 0\n" "240 80 0\n" "240 64 0\n" "240 48 0\n" "240 32 0\n" "240 16 0\n" "240 0 0\n" "224 224 16\n" "224 212 16\n" "224 200 16\n" "224 184 16\n" "224 172 12\n" "224 156 12\n" "224 144 12\n" "224 128 12\n" "224 116 8\n" "224 100 8\n" "224 88 8\n" "224 72 8\n" "224 60 4\n" "224 44 4\n" "224 32 4\n" "224 16 0\n" "208 208 32\n" "208 200 32\n" "208 188 28\n" "208 176 28\n" "208 164 24\n" "208 152 24\n" "208 140 20\n" "208 128 20\n" "208 116 16\n" "208 104 16\n" "208 92 12\n" "208 80 12\n" "208 68 8\n" "208 56 8\n" "208 44 4\n" "208 32 0\n" "192 192 48\n" "192 184 48\n" "192 176 44\n" "192 164 40\n" "192 156 36\n" "192 144 32\n" "192 136 32\n" "192 128 28\n" "192 116 24\n" "192 108 20\n" "192 96 16\n" "192 88 16\n" "192 80 12\n" "192 68 8\n" "192 60 4\n" "192 48 0\n" "176 176 64\n" "176 172 60\n" "176 164 56\n" "176 156 52\n" "176 148 48\n" "176 140 44\n" "176 132 40\n" "176 124 36\n" "176 120 32\n" "176 112 28\n" "176 104 24\n" "176 96 20\n" "176 88 16\n" "176 80 12\n" "176 72 8\n" "176 64 0\n" "160 160 80\n" "160 156 76\n" "160 152 72\n" "160 144 64\n" "160 140 60\n" "160 136 56\n" "160 128 48\n" "160 124 44\n" "160 120 40\n" "160 112 32\n" "160 108 28\n" "160 104 24\n" "160 96 16\n" "160 92 12\n" "160 88 8\n" "160 80 0\n" "144 144 96\n" "144 144 92\n" "144 140 84\n" "144 136 80\n" "144 132 72\n" "144 128 64\n" "144 128 60\n" "144 124 52\n" "144 120 48\n" "144 116 40\n" "144 112 32\n" "144 112 28\n" "144 108 20\n" "144 104 16\n" "144 100 8\n" "144 96 0\n" "128 128 112\n" "128 128 108\n" "128 128 100\n" "128 128 92\n" "128 124 84\n" "128 124 76\n" "128 124 68\n" "128 124 60\n" "128 120 56\n" "128 120 48\n" "128 120 40\n" "128 120 32\n" "128 116 24\n" "128 116 16\n" "128 116 8\n" "128 112 0\n" "112 112 128\n" "112 112 120\n" "112 112 112 grey44\n" "112 112 104\n" "112 116 96\n" "112 116 88\n" "112 116 80\n" "112 116 72\n" "112 120 60\n" "112 120 52\n" "112 120 44\n" "112 120 36\n" "112 124 28\n" "112 124 20\n" "112 124 12\n" "112 128 0\n" " 96 96 144\n" " 96 96 136\n" " 96 100 128\n" " 96 104 116\n" " 96 108 108\n" " 96 112 96\n" " 96 112 88\n" " 96 116 80\n" " 96 120 68\n" " 96 124 60\n" " 96 128 48\n" " 96 128 40\n" " 96 132 32\n" " 96 136 20\n" " 96 140 12\n" " 96 144 0\n" " 80 80 160\n" " 80 84 152\n" " 80 88 140\n" " 80 96 128\n" " 80 100 120\n" " 80 104 108\n" " 80 112 96\n" " 80 116 88\n" " 80 120 76\n" " 80 128 64\n" " 80 132 56\n" " 80 136 44\n" " 80 144 32\n" " 80 148 24\n" " 80 152 12\n" " 80 160 0\n" " 64 64 176\n" " 64 68 168\n" " 64 76 156\n" " 64 84 144\n" " 64 92 132\n" " 64 100 120\n" " 64 108 108\n" " 64 116 96\n" " 64 120 84\n" " 64 128 72\n" " 64 136 60\n" " 64 144 48\n" " 64 152 36\n" " 64 160 24\n" " 64 168 12\n" " 64 176 0\n" " 48 48 192\n" " 48 56 180\n" " 48 64 168\n" " 48 76 156\n" " 48 84 144\n" " 48 96 128\n" " 48 104 116\n" " 48 112 104\n" " 48 124 92\n" " 48 132 80\n" " 48 144 64\n" " 48 152 52\n" " 48 160 40\n" " 48 172 28\n" " 48 180 16\n" " 48 192 0\n" " 32 32 208\n" " 32 40 196\n" " 32 52 184\n" " 32 64 168\n" " 32 76 156\n" " 32 88 140\n" " 32 100 128\n" " 32 112 112\n" " 32 124 100\n" " 32 136 84\n" " 32 148 72\n" " 32 160 56\n" " 32 172 44\n" " 32 184 28\n" " 32 196 16\n" " 32 208 0\n" " 16 16 224\n" " 16 28 212\n" " 16 40 196\n" " 16 56 180\n" " 16 68 168\n" " 16 84 152\n" " 16 96 136\n" " 16 112 120\n" " 16 124 108\n" " 16 140 92\n" " 16 152 76\n" " 16 168 60\n" " 16 180 48\n" " 16 196 32\n" " 16 208 16\n" " 16 224 0\n" " 0 0 240\n" " 0 16 224\n" " 0 32 208\n" " 0 48 192\n" " 0 64 176\n" " 0 80 160\n" " 0 96 144\n" " 0 112 128\n" " 0 128 112\n" " 0 144 96\n" " 0 160 80\n" " 0 176 64\n" " 0 192 48\n" " 0 208 32\n" " 0 224 16\n" " 0 240 0\n" "" }, {.path = "data/palettes/Reds.gpl", .size = 3579, .data = "GIMP Palette\n" "Name: Reds\n" "#\n" " 0 0 0 #000000\n" "128 128 128 #808080\n" "255 255 255 #FFFFFF\n" " 76 0 0 #4C0000\n" " 72 0 0 #480000\n" " 68 0 0 #440000\n" " 64 0 0 #400000\n" " 60 0 0 #3C0000\n" " 56 0 0 #380000\n" " 52 0 0 #340000\n" " 48 0 0 #300000\n" " 44 0 0 #2C0000\n" " 40 0 0 #280000\n" " 36 0 0 #240000\n" " 32 0 0 #200000\n" " 28 0 0 #1C0000\n" " 24 0 0 #180000\n" " 20 0 0 #140000\n" " 16 0 0 #100000\n" " 12 0 0 #0C0000\n" " 8 0 0 #080000\n" " 4 0 0 #040000\n" " 0 0 0 #000000\n" " 4 0 0 #040000\n" " 4 4 4 #040404\n" " 8 4 4 #080404\n" " 12 8 8 #0C0808\n" " 16 8 8 #100808\n" " 16 12 12 #100C0C\n" " 20 12 12 #140C0C\n" " 24 16 16 #181010\n" " 28 16 16 #1C1010\n" " 28 20 20 #1C1414\n" " 32 20 20 #201414\n" " 36 24 24 #241818\n" " 40 24 24 #281818\n" " 40 28 28 #281C1C\n" " 44 28 28 #2C1C1C\n" " 48 32 32 #302020\n" " 52 32 32 #342020\n" " 52 36 36 #342424\n" " 56 36 36 #382424\n" " 60 40 40 #3C2828\n" " 64 40 40 #402828\n" " 64 44 44 #402C2C\n" " 68 44 44 #442C2C\n" " 72 48 48 #483030\n" " 76 48 48 #4C3030\n" " 76 52 52 #4C3434\n" " 80 52 52 #503434\n" " 84 56 56 #543838\n" " 88 56 56 #583838\n" " 88 60 60 #583C3C\n" " 92 60 60 #5C3C3C\n" " 92 64 64 #5C4040\n" " 96 64 64 #604040\n" "100 64 64 #644040\n" "100 68 68 #644444\n" "104 68 68 #684444\n" "104 72 72 #684848\n" "108 72 72 #6C4848\n" "112 72 72 #704848\n" "112 76 76 #704C4C\n" "116 76 76 #744C4C\n" "116 80 80 #745050\n" "120 80 80 #785050\n" "124 84 84 #7C5454\n" "128 84 84 #805454\n" "128 88 88 #805858\n" "132 88 88 #845858\n" "252 252 252 #FCFCFC\n" "252 248 248 #FCF8F8\n" "252 244 244 #FCF4F4\n" "252 240 240 #FCF0F0\n" "252 236 236 #FCECEC\n" "252 232 232 #FCE8E8\n" "252 228 228 #FCE4E4\n" "252 224 224 #FCE0E0\n" "252 220 220 #FCDCDC\n" "252 216 216 #FCD8D8\n" "252 212 212 #FCD4D4\n" "252 208 208 #FCD0D0\n" "252 204 204 #FCCCCC\n" "252 200 200 #FCC8C8\n" "252 196 196 #FCC4C4\n" "252 192 192 #FCC0C0\n" "252 188 188 #FCBCBC\n" "252 184 184 #FCB8B8\n" "252 180 180 #FCB4B4\n" "252 176 176 #FCB0B0\n" "252 172 172 #FCACAC\n" "252 168 168 #FCA8A8\n" "252 164 164 #FCA4A4\n" "252 160 160 #FCA0A0\n" "252 156 156 #FC9C9C\n" "252 152 152 #FC9898\n" "252 148 148 #FC9494\n" "252 144 144 #FC9090\n" "252 140 140 #FC8C8C\n" "252 136 136 #FC8888\n" "252 132 132 #FC8484\n" "252 128 128 #FC8080\n" "252 124 124 #FC7C7C\n" "252 120 120 #FC7878\n" "252 116 116 #FC7474\n" "252 112 112 #FC7070\n" "252 108 108 #FC6C6C\n" "252 104 104 #FC6868\n" "252 100 100 #FC6464\n" "252 96 96 #FC6060\n" "252 92 92 #FC5C5C\n" "252 88 88 #FC5858\n" "252 84 84 #FC5454\n" "252 80 80 #FC5050\n" "252 76 76 #FC4C4C\n" "252 72 72 #FC4848\n" "252 68 68 #FC4444\n" "252 64 64 #FC4040\n" "252 60 60 #FC3C3C\n" "252 56 56 #FC3838\n" "252 52 52 #FC3434\n" "252 48 48 #FC3030\n" "252 44 44 #FC2C2C\n" "252 40 40 #FC2828\n" "252 36 36 #FC2424\n" "252 32 32 #FC2020\n" "252 28 28 #FC1C1C\n" "252 24 24 #FC1818\n" "252 20 20 #FC1414\n" "252 16 16 #FC1010\n" "252 12 12 #FC0C0C\n" "252 8 8 #FC0808\n" "252 4 4 #FC0404\n" "252 0 0 #FC0000\n" "248 0 0 #F80000\n" "244 0 0 #F40000\n" "240 0 0 #F00000\n" "236 0 0 #EC0000\n" "232 0 0 #E80000\n" "228 0 0 #E40000\n" "224 0 0 #E00000\n" "220 0 0 #DC0000\n" "216 0 0 #D80000\n" "212 0 0 #D40000\n" "208 0 0 #D00000\n" "204 0 0 #CC0000\n" "200 0 0 #C80000\n" "196 0 0 #C40000\n" "192 0 0 #C00000\n" "188 0 0 #BC0000\n" "184 0 0 #B80000\n" "180 0 0 #B40000\n" "176 0 0 #B00000\n" "172 0 0 #AC0000\n" "168 0 0 #A80000\n" "164 0 0 #A40000\n" "160 0 0 #A00000\n" "156 0 0 #9C0000\n" "152 0 0 #980000\n" "148 0 0 #940000\n" "144 0 0 #900000\n" "140 0 0 #8C0000\n" "136 0 0 #880000\n" "132 0 0 #840000\n" "128 0 0 #800000\n" "124 0 0 #7C0000\n" "120 0 0 #780000\n" "116 0 0 #740000\n" "112 0 0 #700000\n" "108 0 0 #6C0000\n" "104 0 0 #680000\n" "100 0 0 #640000\n" " 96 0 0 #600000\n" " 92 0 0 #5C0000\n" " 88 0 0 #580000\n" " 84 0 0 #540000\n" " 80 0 0 #500000\n" "" }, {.path = "data/palettes/Royal.gpl", .size = 4480, .data = "GIMP Palette\n" "Name: Royal\n" "#\n" " 0 0 0 #000000\n" "128 128 128 #808080\n" "255 255 255 #FFFFFF\n" " 60 0 80 #3C0050\n" " 60 0 84 #3C0054\n" " 64 0 84 #400054\n" " 64 0 88 #400058\n" " 68 0 88 #440058\n" " 68 0 92 #44005C\n" " 72 0 96 #480060\n" " 72 0 100 #480064\n" " 76 0 100 #4C0064\n" " 76 0 104 #4C0068\n" " 80 0 104 #500068\n" " 80 0 108 #50006C\n" " 84 0 112 #540070\n" " 84 0 116 #540074\n" " 88 0 116 #580074\n" " 88 0 120 #580078\n" " 92 0 120 #5C0078\n" " 92 0 124 #5C007C\n" " 96 0 128 #600080\n" " 96 0 132 #600084\n" "100 0 132 #640084\n" "100 0 136 #640088\n" "104 0 136 #680088\n" "104 0 140 #68008C\n" "108 0 144 #6C0090\n" "108 0 148 #6C0094\n" "112 0 148 #700094\n" "112 0 152 #700098\n" "116 0 152 #740098\n" "116 0 156 #74009C\n" "120 0 160 #7800A0\n" "124 4 160 #7C04A0\n" "124 8 164 #7C08A4\n" "128 12 164 #800CA4\n" "128 16 164 #8010A4\n" "132 20 168 #8414A8\n" "132 24 168 #8418A8\n" "136 28 168 #881CA8\n" "136 32 172 #8820AC\n" "140 36 172 #8C24AC\n" "140 40 172 #8C28AC\n" "144 44 176 #902CB0\n" "144 48 176 #9030B0\n" "148 52 180 #9434B4\n" "148 56 180 #9438B4\n" "152 60 180 #983CB4\n" "152 64 184 #9840B8\n" "156 68 184 #9C44B8\n" "156 72 184 #9C48B8\n" "160 76 188 #A04CBC\n" "160 80 188 #A050BC\n" "164 84 188 #A454BC\n" "164 88 192 #A458C0\n" "168 92 192 #A85CC0\n" "168 96 192 #A860C0\n" "172 100 196 #AC64C4\n" "172 104 196 #AC68C4\n" "176 108 200 #B06CC8\n" "176 112 200 #B070C8\n" "180 116 200 #B474C8\n" "180 120 204 #B478CC\n" "184 124 204 #B87CCC\n" "188 128 204 #BC80CC\n" "188 132 208 #BC84D0\n" "192 136 208 #C088D0\n" "192 140 208 #C08CD0\n" "196 144 212 #C490D4\n" "196 148 212 #C494D4\n" "200 152 216 #C898D8\n" "200 156 216 #C89CD8\n" "204 160 216 #CCA0D8\n" "204 164 220 #CCA4DC\n" "208 168 220 #D0A8DC\n" "208 172 220 #D0ACDC\n" "212 176 224 #D4B0E0\n" "212 180 224 #D4B4E0\n" "216 184 224 #D8B8E0\n" "216 188 228 #D8BCE4\n" "220 192 228 #DCC0E4\n" "220 196 228 #DCC4E4\n" "224 200 232 #E0C8E8\n" "224 204 232 #E0CCE8\n" "228 208 236 #E4D0EC\n" "228 212 236 #E4D4EC\n" "232 216 236 #E8D8EC\n" "232 220 240 #E8DCF0\n" "236 224 240 #ECE0F0\n" "236 228 240 #ECE4F0\n" "240 232 244 #F0E8F4\n" "240 236 244 #F0ECF4\n" "244 240 244 #F4F0F4\n" "244 244 248 #F4F4F8\n" "248 248 248 #F8F8F8\n" "252 252 252 #FCFCFC\n" "252 252 248 #FCFCF8\n" "252 252 244 #FCFCF4\n" "252 252 240 #FCFCF0\n" "252 252 236 #FCFCEC\n" "252 252 232 #FCFCE8\n" "252 252 228 #FCFCE4\n" "252 252 224 #FCFCE0\n" "252 252 220 #FCFCDC\n" "252 252 216 #FCFCD8\n" "252 252 212 #FCFCD4\n" "252 252 208 #FCFCD0\n" "252 252 204 #FCFCCC\n" "252 252 200 #FCFCC8\n" "252 252 196 #FCFCC4\n" "252 252 192 #FCFCC0\n" "252 252 188 #FCFCBC\n" "252 252 184 #FCFCB8\n" "252 252 180 #FCFCB4\n" "252 252 176 #FCFCB0\n" "252 252 172 #FCFCAC\n" "252 252 168 #FCFCA8\n" "252 252 164 #FCFCA4\n" "252 252 160 #FCFCA0\n" "252 252 156 #FCFC9C\n" "252 252 152 #FCFC98\n" "252 252 148 #FCFC94\n" "252 252 144 #FCFC90\n" "252 252 140 #FCFC8C\n" "252 252 136 #FCFC88\n" "252 252 132 #FCFC84\n" "252 252 128 #FCFC80\n" "252 252 124 #FCFC7C\n" "252 252 120 #FCFC78\n" "252 252 116 #FCFC74\n" "252 252 112 #FCFC70\n" "252 252 108 #FCFC6C\n" "252 252 104 #FCFC68\n" "252 252 100 #FCFC64\n" "252 252 96 #FCFC60\n" "252 252 92 #FCFC5C\n" "252 252 88 #FCFC58\n" "252 252 84 #FCFC54\n" "252 252 80 #FCFC50\n" "252 252 76 #FCFC4C\n" "252 252 72 #FCFC48\n" "252 252 68 #FCFC44\n" "252 252 64 #FCFC40\n" "252 252 60 #FCFC3C\n" "252 252 56 #FCFC38\n" "252 252 52 #FCFC34\n" "252 252 48 #FCFC30\n" "252 252 44 #FCFC2C\n" "252 252 40 #FCFC28\n" "252 252 36 #FCFC24\n" "252 252 32 #FCFC20\n" "252 252 28 #FCFC1C\n" "252 252 24 #FCFC18\n" "252 252 20 #FCFC14\n" "252 252 16 #FCFC10\n" "252 252 12 #FCFC0C\n" "252 252 8 #FCFC08\n" "252 252 4 #FCFC04\n" "252 252 0 #FCFC00\n" "252 248 0 #FCF800\n" "248 244 0 #F8F400\n" "244 240 0 #F4F000\n" "240 236 4 #F0EC04\n" "240 232 4 #F0E804\n" "236 228 4 #ECE404\n" "232 224 8 #E8E008\n" "228 220 8 #E4DC08\n" "228 216 8 #E4D808\n" "224 212 12 #E0D40C\n" "220 208 12 #DCD00C\n" "216 204 12 #D8CC0C\n" "212 200 16 #D4C810\n" "212 196 16 #D4C410\n" "208 192 16 #D0C010\n" "204 188 20 #CCBC14\n" "200 184 20 #C8B814\n" "200 180 20 #C8B414\n" "196 176 24 #C4B018\n" "192 172 24 #C0AC18\n" "188 168 24 #BCA818\n" "184 164 28 #B8A41C\n" "184 160 28 #B8A01C\n" "180 156 28 #B49C1C\n" "176 152 32 #B09820\n" "172 148 32 #AC9420\n" "172 144 32 #AC9020\n" "168 140 36 #A88C24\n" "164 136 36 #A48824\n" "160 132 36 #A08424\n" "160 128 36 #A08024\n" "156 124 40 #9C7C28\n" "152 120 40 #987828\n" "148 116 40 #947428\n" "144 112 44 #90702C\n" "144 108 44 #906C2C\n" "140 104 44 #8C682C\n" "136 100 48 #886430\n" "132 96 48 #846030\n" "132 92 48 #845C30\n" "128 88 52 #805834\n" "124 84 52 #7C5434\n" "120 80 52 #785034\n" "116 76 56 #744C38\n" "116 72 56 #744838\n" "112 68 56 #704438\n" "108 64 60 #6C403C\n" "104 60 60 #683C3C\n" "104 56 60 #68383C\n" "100 52 64 #643440\n" " 96 48 64 #603040\n" " 92 44 64 #5C2C40\n" " 88 40 68 #582844\n" " 88 36 68 #582444\n" " 84 32 68 #542044\n" " 80 28 72 #501C48\n" " 76 24 72 #4C1848\n" " 76 20 72 #4C1448\n" " 72 16 76 #48104C\n" " 68 12 76 #440C4C\n" " 64 8 76 #40084C\n" " 60 0 80 #3C0050\n" "" }, {.path = "data/palettes/Tango-Palette.gpl", .size = 709, .data = "GIMP Palette\n" "Name: Tango icons\n" "Columns: 3\n" "#\n" "252 233 79 Butter 1\n" "237 212 0 Butter 2\n" "196 160 0 Butter 3\n" "138 226 52 Chameleon 1\n" "115 210 22 Chameleon 2\n" " 78 154 6 Chameleon 3\n" "252 175 62 Orange 1\n" "245 121 0 Orange 2\n" "206 92 0 Orange 3\n" "114 159 207 Sky Blue 1\n" " 52 101 164 Sky Blue 2\n" " 32 74 135 Sky Blue 3\n" "173 127 168 Plum 1\n" "117 80 123 Plum 2\n" " 92 53 102 Plum 3\n" "233 185 110 Chocolate 1\n" "193 125 17 Chocolate 2\n" "143 89 2 Chocolate 3\n" "239 41 41 Scarlet Red 1\n" "204 0 0 Scarlet Red 2\n" "164 0 0 Scarlet Red 3\n" "255 255 255 Snowy White\n" "238 238 236 Aluminium 1\n" "211 215 207 Aluminium 2\n" "186 189 182 Aluminium 3\n" "136 138 133 Aluminium 4\n" " 85 87 83 Aluminium 5\n" " 46 52 54 Aluminium 6\n" " 0 0 0 Jet Black\n" "" }, {.path = "data/palettes/Ubuntu.gpl", .size = 1104, .data = "GIMP Palette\n" "Name: Ubuntu\n" "Columns: 0\n" "#\n" "238 199 62 Orange Hilight\n" "240 165 19 Orange\n" "251 139 0 Orange Base\n" "244 72 0 Orange Shadow\n" "255 255 153 Accent Yellow Highlight\n" "255 255 0 Yellow\n" "253 202 1 Accent Yellow Base\n" "152 102 1 Accent Yellow Shadow\n" "244 72 0 Accent Orange\n" "253 51 1 Accent Red\n" "212 0 0 Accent Red Base\n" "152 1 1 Accent Deep Red\n" "253 217 155 Human Highlight\n" "217 187 122 Human\n" "129 102 71 Human Base\n" " 86 82 72 Environmental Shadow\n" "170 204 238 Environmental Blue Highlight\n" "102 153 204 Environmental Blue Medium\n" " 51 102 153 Environmental Blue Base\n" " 0 51 102 Environmental Blue Shadow\n" "179 222 253 Accent Blue Shadow\n" " 1 151 253 Accent Blue\n" " 1 105 201 Accent Blue Base\n" " 1 51 151 Accent Blue Shadow\n" "204 255 153 Accent Green Highlight\n" "152 252 102 Accent Green\n" " 51 153 0 Accent Green Base\n" " 1 90 1 Accent Green Shadow\n" " 0 43 61 Ubuntu Toner\n" "255 155 255 Accent Magenta Highlight\n" "255 0 255 Accent Magenta\n" "102 0 204 Accent Dark Violet\n" "238 238 238 Grey 1\n" "204 204 207 Grey 2\n" "170 170 170 Grey 3\n" "136 136 136 Grey 4\n" "102 102 102 Grey 5\n" " 51 51 51 Grey 6\n" " 0 0 0 Black\n" "" }, {.path = "data/palettes/webhex.gpl", .size = 4133, .data = "GIMP Palette\n" "Name: WebHex\n" "#\n" "255 255 255 FFFFFF\n" "255 255 204 FFFFCC\n" "255 255 153 FFFF99\n" "255 255 102 FFFF66\n" "255 255 51 FFFF33\n" "255 255 0 FFFF00\n" "255 204 255 FFCCFF\n" "255 204 204 FFCCCC\n" "255 204 153 FFCC99\n" "255 204 102 FFCC66\n" "255 204 51 FFCC33\n" "255 204 0 FFCC00\n" "255 153 255 FF99FF\n" "255 153 204 FF99CC\n" "255 153 153 FF9999\n" "255 153 102 FF9966\n" "255 153 51 FF9933\n" "255 153 0 FF9900\n" "255 102 255 FF66FF\n" "255 102 204 FF66CC\n" "255 102 153 FF6699\n" "255 102 102 FF6666\n" "255 102 51 FF6633\n" "255 102 0 FF6600\n" "255 51 255 FF33FF\n" "255 51 204 FF33CC\n" "255 51 153 FF3399\n" "255 51 102 FF3366\n" "255 51 51 FF3333\n" "255 51 0 FF3300\n" "255 0 255 FF00FF\n" "255 0 204 FF00CC\n" "255 0 153 FF0099\n" "255 0 102 FF0066\n" "255 0 51 FF0033\n" "255 0 0 FF0000\n" "204 255 255 CCFFFF\n" "204 255 204 CCFFCC\n" "204 255 153 CCFF99\n" "204 255 102 CCFF66\n" "204 255 51 CCFF33\n" "204 255 0 CCFF00\n" "204 204 255 CCCCFF\n" "204 204 204 CCCCCC\n" "204 204 153 CCCC99\n" "204 204 102 CCCC66\n" "204 204 51 CCCC33\n" "204 204 0 CCCC00\n" "204 153 255 CC99FF\n" "204 153 204 CC99CC\n" "204 153 153 CC9999\n" "204 153 102 CC9966\n" "204 153 51 CC9933\n" "204 153 0 CC9900\n" "204 102 255 CC66FF\n" "204 102 204 CC66CC\n" "204 102 153 CC6699\n" "204 102 102 CC6666\n" "204 102 51 CC6633\n" "204 102 0 CC6600\n" "204 51 255 CC33FF\n" "204 51 204 CC33CC\n" "204 51 153 CC3399\n" "204 51 102 CC3366\n" "204 51 51 CC3333\n" "204 51 0 CC3300\n" "204 0 255 CC00FF\n" "204 0 204 CC00CC\n" "204 0 153 CC0099\n" "204 0 102 CC0066\n" "204 0 51 CC0033\n" "204 0 0 CC0000\n" "153 255 255 99FFFF\n" "153 255 204 99FFCC\n" "153 255 153 99FF99\n" "153 255 102 99FF66\n" "153 255 51 99FF33\n" "153 255 0 99FF00\n" "153 204 255 99CCFF\n" "153 204 204 99CCCC\n" "153 204 153 99CC99\n" "153 204 102 99CC66\n" "153 204 51 99CC33\n" "153 204 0 99CC00\n" "153 153 255 9999FF\n" "153 153 204 9999CC\n" "153 153 153 999999\n" "153 153 102 999966\n" "153 153 51 999933\n" "153 153 0 999900\n" "153 102 255 9966FF\n" "153 102 204 9966CC\n" "153 102 153 996699\n" "153 102 102 996666\n" "153 102 51 996633\n" "153 102 0 996600\n" "153 51 255 9933FF\n" "153 51 204 9933CC\n" "153 51 153 993399\n" "153 51 102 993366\n" "153 51 51 993333\n" "153 51 0 993300\n" "153 0 255 9900FF\n" "153 0 204 9900CC\n" "153 0 153 990099\n" "153 0 102 990066\n" "153 0 51 990033\n" "153 0 0 990000\n" "102 255 255 66FFFF\n" "102 255 204 66FFCC\n" "102 255 153 66FF99\n" "102 255 102 66FF66\n" "102 255 51 66FF33\n" "102 255 0 66FF00\n" "102 204 255 66CCFF\n" "102 204 204 66CCCC\n" "102 204 153 66CC99\n" "102 204 102 66CC66\n" "102 204 51 66CC33\n" "102 204 0 66CC00\n" "102 153 255 6699FF\n" "102 153 204 6699CC\n" "102 153 153 669999\n" "102 153 102 669966\n" "102 153 51 669933\n" "102 153 0 669900\n" "102 102 255 6666FF\n" "102 102 204 6666CC\n" "102 102 153 666699\n" "102 102 102 666666\n" "102 102 51 666633\n" "102 102 0 666600\n" "102 51 255 6633FF\n" "102 51 204 6633CC\n" "102 51 153 663399\n" "102 51 102 663366\n" "102 51 51 663333\n" "102 51 0 663300\n" "102 0 255 6600FF\n" "102 0 204 6600CC\n" "102 0 153 660099\n" "102 0 102 660066\n" "102 0 51 660033\n" "102 0 0 660000\n" " 51 255 255 33FFFF\n" " 51 255 204 33FFCC\n" " 51 255 153 33FF99\n" " 51 255 102 33FF66\n" " 51 255 51 33FF33\n" " 51 255 0 33FF00\n" " 51 204 255 33CCFF\n" " 51 204 204 33CCCC\n" " 51 204 153 33CC99\n" " 51 204 102 33CC66\n" " 51 204 51 33CC33\n" " 51 204 0 33CC00\n" " 51 153 255 3399FF\n" " 51 153 204 3399CC\n" " 51 153 153 339999\n" " 51 153 102 339966\n" " 51 153 51 339933\n" " 51 153 0 339900\n" " 51 102 255 3366FF\n" " 51 102 204 3366CC\n" " 51 102 153 336699\n" " 51 102 102 336666\n" " 51 102 51 336633\n" " 51 102 0 336600\n" " 51 51 255 3333FF\n" " 51 51 204 3333CC\n" " 51 51 153 333399\n" " 51 51 102 333366\n" " 51 51 51 333333\n" " 51 51 0 333300\n" " 51 0 255 3300FF\n" " 51 0 204 3300CC\n" " 51 0 153 330099\n" " 51 0 102 330066\n" " 51 0 51 330033\n" " 51 0 0 330000\n" " 0 255 255 00FFFF\n" " 0 255 204 00FFCC\n" " 0 255 153 00FF99\n" " 0 255 102 00FF66\n" " 0 255 51 00FF33\n" " 0 255 0 00FF00\n" " 0 204 255 00CCFF\n" " 0 204 204 00CCCC\n" " 0 204 153 00CC99\n" " 0 204 102 00CC66\n" " 0 204 51 00CC33\n" " 0 204 0 00CC00\n" " 0 153 255 0099FF\n" " 0 153 204 0099CC\n" " 0 153 153 009999\n" " 0 153 102 009966\n" " 0 153 51 009933\n" " 0 153 0 009900\n" " 0 102 255 0066FF\n" " 0 102 204 0066CC\n" " 0 102 153 006699\n" " 0 102 102 006666\n" " 0 102 51 006633\n" " 0 102 0 006600\n" " 0 51 255 0033FF\n" " 0 51 204 0033CC\n" " 0 51 153 003399\n" " 0 51 102 003366\n" " 0 51 51 003333\n" " 0 51 0 003300\n" " 0 0 255 0000FF\n" " 0 0 204 0000CC\n" " 0 0 153 000099\n" " 0 0 102 000066\n" " 0 0 51 000033\n" " 0 0 0 000000\n" "" }, goxel-0.8.1/src/assets/progs.inl000066400000000000000000000251001334742672700166020ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/progs/cherry.goxcf", .size = 469, .data = "shape main {\n" " [seed 7]\n" " tree(0, 40, 10)[s 10 light -0.9]\n" "}\n" "\n" "shape tree($n, $e, $f)\n" "rule {\n" " cylinder[]\n" " if ($n < $e) {\n" " tree($n + 1)[rz 0+-10 z 0.5 s 0.95 z 0.5 rx 4]\n" " }\n" " if (($n >= $e) || ($n > $f && 0+-1 > 0.5)) {\n" " flower[]\n" " }\n" "}\n" "rule 0.1 {\n" " tree[rz 180]\n" "}\n" "rule 0.08 {\n" " tree[]\n" " tree($n + 1)[rz 0+-180 rx -45]\n" "}\n" "\n" "shape flower {\n" " [light 0.5 sat 0.7 sn 1 s 6 z -0.5 x -1 hue -10]\n" " sphere[x 0+-0.5 0+-0.5 light 0+-0.2]\n" "}" }, {.path = "data/progs/city.goxcf", .size = 1199, .data = "shape main {\n" " [seed 4]\n" " city[]\n" "}\n" "\n" "shape ground {\n" " [s 128 128 1\n" " light -0.6 sat 0.2 hue 50]\n" " cube[]\n" " loop 16 [] {\n" " cube[x 0+-0.4 0+-0.4 \n" " s 0.2+-0.1 0.2+-0.1 3+-1\n" " light -0.3+-0.2]\n" " }\n" "}\n" "\n" "shape city {\n" " ground[]\n" " loop 128 [wait 1] {\n" " building[x 0+-58 0+-58 s 2+-0.5\n" " sat 0.2+-0.1 hue 0+-180]\n" " }\n" "}\n" "\n" "shape building\n" "// Tall building\n" "rule 1 {\n" " [s 3]\n" " $n = int(10+-5)\n" " loop $n [z 1 wait 1] {\n" " $s = 2+-0.2\n" " floor[s $s $s 1 z 0.5]\n" " }\n" " [z $n - 0.5]\n" " loop 1+-2 [] {\n" " antenna[]\n" " }\n" "}\n" "// Low building\n" "rule 1 {\n" " [s 8+-4 8+-4 4+-2 z 0.5]\n" " cube[light -0.3]\n" " windows(8)[]\n" " loop 2+-1 [] {antenna[]}\n" "}\n" "// Tree\n" "rule 10 {\n" " [z 0.5 sn 1 z 0.5]\n" " [sat 1 0.5 light 1 0.2 hue 1 20]\n" " cube[z 0.5 sz 5]\n" " loop 2 [] {\n" " sphere[z 4 s 4+-1\n" " x 0+-0.1 0+-0.1\n" " hue 100+-40]\n" " }\n" "}\n" "\n" "shape windows($n) {\n" " loop $n [rz 90] {\n" " cube[x 0.5 0+-0.4 sn s 1/3 x -0.5\n" " light 1 1 light 0+-0.2]\n" " }\n" "}\n" "\n" "shape floor {\n" " cube[light -0.5+-0.1]\n" " windows(8)[]\n" "}\n" "\n" "shape antenna {\n" " [z 0.5 x 0+-0.4 0+-0.4\n" " sn 1 sz 2+-1 z 0.5\n" " light -0.5]\n" " cube[]\n" "}" }, {.path = "data/progs/intro.goxcf", .size = 2552, .data = "// The 'main' shape is always the entry point of the program.\n" "shape main {\n" " // Initial random seed of 2.\n" " // Remove this line to use different seed each time.\n" " [seed 2]\n" " // Improves marching cube rendering.\n" " [antialiased 1]\n" "\n" " // Render a single white voxel.\n" " cube []\n" "\n" " // Put an other cube next to it.\n" " // 'x' applies a translation of 1 along x.\n" " // Those transformation are only applied\n" " // to this cube.\n" " cube [x 1]\n" "\n" " // Now render a bigger grey sphere.\n" " // light -0.5 move the light value to half\n" " // the current value of 1 and the target\n" " sphere [s 10 x 1 light -0.5]\n" "\n" " // We can also render cylinders:\n" " cylinder [s 10 x -1 light -0.9]\n" "\n" " // This time we use a user defined shape.\n" " // And we increase the saturation to give it a color.\n" " my_shape [z 20 light -0.5 sat 0.5]\n" "}\n" "\n" "// A user defined shape\n" "shape my_shape {\n" " // s 8 8 1 scales with different values\n" " // for each axis.\n" " // rx A applies a rotation along z of\n" " // 45 deg.\n" "\n" " // Note that the color is red, because we set the\n" " // Saturation when we called my_shape.\n" " cube [s 8 8 1 z 1 rz 45]\n" "\n" " // Loop 16 time, each time increasing the x\n" " // translation and the hue.\n" " loop 16 [x 2 hue 10] {\n" " cube []\n" " }\n" " // The loop transformations only affect\n" " // the loop block, after it we return to\n" " // the previous context.\n" " sphere [s 6 z 1]\n" "\n" " // Let's try a recursive shape:\n" " tree [x -10 s 4]\n" "\n" " // And an other one with a bit or randomness:\n" " tree2 [x 10 s 4 rz 180 hue 180]\n" "\n" " // A shape with several rules:\n" " my_other_shape [y 10 rz 90 hue -60 s 3]\n" "}\n" "\n" "// Tree render a cylinder and then call itself.\n" "// Since we scale down the shape at each iteration\n" "// at some point it becomes too small, and is\n" "// then automatically stopped.\n" "shape tree {\n" " cylinder []\n" " tree [z 1 s 0.99 ry -6]\n" "}\n" "\n" "shape tree2 {\n" " cylinder []\n" " // 'A +- B' means that we use a random value in the range\n" " // A - B, A + B. this make the second spiral a bit\n" " // messy.\n" " tree2 [z 1 s 0.99 ry -6+-6]\n" "}\n" "\n" "// Here 'my_other_shape' defines several rules. The rule\n" "// used is picked randomly using the weight.\n" "shape my_other_shape\n" "\n" "// Most of the time, just keep growing in z.\n" "rule 15 {\n" " cube []\n" " my_other_shape [z 1]\n" "}\n" "\n" "// Sometime split into two\n" "rule 1 {\n" " my_other_shape [rx 45 s 0.9]\n" " my_other_shape [rx -45 s 0.9]\n" "}\n" "\n" "// Some other times render a shpere and stop\n" "rule 0.5 {\n" " // 'hue 1 70' means that we immediately set the hue\n" " // to 70 (yellow).\n" " sphere [s 3 hue 1 70]\n" "}\n" "" }, {.path = "data/progs/planet.goxcf", .size = 523, .data = "// Simple planet\n" "shape main {\n" " [s 50]\n" " sphere [sat 0.5 light -0.75 hue 200]\n" " loop 3 [] {\n" " continent[rz 0+-180 ry 0+-180\n" " hue 1 40+-10 sat 1 0.5\n" " light -0.5+-0.1]\n" " }\n" " loop 16 [wait 1] {\n" " cloud [rz 0+-180 ry 0+-180\n" " hue 200 light -0.1 sat 0.5]\n" " }\n" "}\n" "\n" "shape continent {\n" " loop 30 [rz 10 rx 0+-80 wait 1] {\n" " sphere[x 0.3 s 0.4+-0.05]\n" " }\n" "}\n" "\n" "shape cloud {\n" " loop 5 [rz 2 rx 0+-180 wait 1] {\n" " sphere[x 0.5 s 0.04 +- 0.01]\n" " }\n" "}\n" "" }, {.path = "data/progs/test.goxcf", .size = 323, .data = "// Simple Test\n" "\n" "shape branch\n" "rule {\n" " cylinder [sz 0.7]\n" " branch [rz 0 z 0.25 s 0.9 rx 30 z 0.25\n" " light -0.1 hue 10 sat 0.1]\n" "}\n" "rule 0.2 {\n" "branch [rz 180]\n" "}\n" "rule 0.2 {\n" " branch [rz 90]\n" "}\n" "rule 0.1 {\n" " branch [rx -90 s 0.8 z 1]\n" " branch []\n" "}\n" "\n" "shape main {\n" " [light 1 antialiased 1]\n" " branch [s 32]\n" "}\n" "" }, {.path = "data/progs/test2.goxcf", .size = 419, .data = "shape main {\n" " [antialiased 1]\n" " [light 0.5 sat 0.5 s 100]\n" " loop 5 [s -0.95 light 0.1 sat 0.01 hue 5] {\n" " sphere [light -0.6 hue 30]\n" " }\n" " loop 30 [wait 1] {\n" " sphere [sub rz 0+-180 ry 0+-180\n" " z 0.5 s 0.3]\n" " }\n" " loop 2 [rz 90] {\n" " loop 120 [ry 10 wait 1] {\n" " sphere [hue 30+-30 light -0.5+-0.4\n" " z 0.5 s 0.05+-0.01 z 4+-0.5]\n" " }\n" " }\n" "}\n" "" }, {.path = "data/progs/test3.goxcf", .size = 302, .data = "shape main {\n" " [antialiased 1]\n" " loop 8 [rz 45] {\n" " test [s 20 x 2]\n" " }\n" "}\n" "\n" "shape test {\n" " [sat 0.4 light -0.2 hue 240]\n" " sphere[]\n" " cube [z 0.5 sub]\n" " tige (15) [s 0.5 light -0.5]\n" "}\n" "\n" "shape tige ($n) {\n" " cylinder[]\n" " if $n {\n" " tige($n - 1)[z 0.5 ry $n z 0.5 sat -0.1]\n" " }\n" "}\n" "" }, {.path = "data/progs/tree-big.goxcf", .size = 541, .data = "\n" "shape leaf {\n" " cube[]\n" " leaf[x 0.5 s 0.9 0.9 0.8 ry 25 x 0.4]\n" "}\n" "\n" "shape top {\n" " loop 8 [rz 360 / 8] {\n" " [life 8 sy 2 z 0+-5]\n" " leaf[s 5 light -0.4 sat 0.5 hue 60+-20 ry -45]\n" " }\n" "}\n" "\n" "shape part($n) {\n" " loop $i = $n [z 1 rz 30+-10 rx 0+-10 wait 1] {\n" " cylinder[s 4 x 0.1 light 0+-0.1]\n" " if ($i == int($n - 2)) {\n" " top[]\n" " }\n" " }\n" "}\n" "\n" "shape main {\n" " [antialiased 1 hue 40 light -0.5 sat 0.5]\n" " $n = 40+-10\n" " loop 3 [rz 120+-45] {\n" " [y 0.5]\n" " part($n)[light -0.3+-0.05]\n" " }\n" "}\n" "" }, {.path = "data/progs/tree-small.goxcf", .size = 372, .data = "shape branch2 {\n" " cube[]\n" " branch2 [z 0.5 s 0.8 rx 20+-4 z 0.5]\n" "}\n" "\n" "shape branch {\n" " [rx 90]\n" " branch2[s 2]\n" "}\n" "\n" "shape tree($s) {\n" " loop $s [z 1] {\n" " cube[s 1 light -0.8+-0.1 sat 0.5]\n" " }\n" " [z $s]\n" " [sat 1 light -0.5 hue 50+-30]\n" " loop 6 [rz 360 / 6 rz 0+-10] {\n" " branch[light 0+-0.3]\n" " }\n" "}\n" "\n" "shape main {\n" " [antialiased 0]\n" " tree(8+-2)[]\n" "}\n" "" }, goxel-0.8.1/src/assets/shaders.inl000066400000000000000000000304561334742672700171130ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/shaders/background.glsl", .size = 570, .data = "varying lowp vec4 v_color;\n" "\n" "#ifdef VERTEX_SHADER\n" "\n" "/************************************************************************/\n" "attribute highp vec3 a_pos;\n" "attribute lowp vec4 a_color;\n" "\n" "void main()\n" "{\n" " gl_Position = vec4(a_pos, 1.0);\n" " v_color = a_color;\n" "}\n" "/************************************************************************/\n" "\n" "#endif\n" "\n" "#ifdef FRAGMENT_SHADER\n" "\n" "/************************************************************************/\n" "void main()\n" "{\n" " gl_FragColor = v_color;\n" "}\n" "/************************************************************************/\n" "\n" "#endif\n" "" }, {.path = "data/shaders/mesh.glsl", .size = 4226, .data = "/*\n" " * I followed those name conventions. All the vectors are expressed in eye\n" " * coordinates.\n" " *\n" " * reflection light source\n" " *\n" " * r s\n" " * ^ ^\n" " * \\ n /\n" " * eye \\ ^ /\n" " * v <.... \\ | /\n" " * -----__\\|/\n" " * ----+----\n" " *\n" " *\n" " */\n" "\n" "uniform highp mat4 u_model;\n" "uniform highp mat4 u_view;\n" "uniform highp mat4 u_proj;\n" "uniform highp mat4 u_shadow_mvp;\n" "uniform lowp float u_pos_scale;\n" "\n" "// Light parameters\n" "uniform lowp vec3 u_l_dir;\n" "uniform lowp float u_l_int;\n" "\n" "// Material parameters\n" "uniform lowp float u_m_amb; // Ambient light coef.\n" "uniform lowp float u_m_dif; // Diffuse light coef.\n" "uniform lowp float u_m_spe; // Specular light coef.\n" "uniform lowp float u_m_shi; // Specular light shininess.\n" "uniform lowp float u_m_smo; // Smoothness.\n" "\n" "uniform mediump sampler2D u_bshadow_tex;\n" "uniform mediump sampler2D u_bump_tex;\n" "uniform mediump float u_bshadow;\n" "uniform mediump sampler2D u_shadow_tex;\n" "uniform mediump float u_shadow_k;\n" "\n" "varying highp vec3 v_pos;\n" "varying lowp vec4 v_color;\n" "varying mediump vec2 v_bshadow_uv;\n" "varying mediump vec2 v_uv;\n" "varying mediump vec2 v_bump_uv;\n" "varying mediump vec3 v_normal;\n" "varying mediump vec4 v_shadow_coord;\n" "\n" "#ifdef VERTEX_SHADER\n" "\n" "/************************************************************************/\n" "attribute highp vec3 a_pos;\n" "attribute mediump vec3 a_normal;\n" "attribute lowp vec4 a_color;\n" "attribute mediump vec2 a_bshadow_uv;\n" "attribute mediump vec2 a_bump_uv; // bump tex base coordinates [0,255]\n" "attribute mediump vec2 a_uv; // uv coordinates [0,1]\n" "\n" "void main()\n" "{\n" " v_normal = a_normal;\n" " v_color = a_color;\n" " v_bshadow_uv = (a_bshadow_uv + 0.5) / (16.0 * VOXEL_TEXTURE_SIZE);\n" " v_pos = a_pos * u_pos_scale;\n" " v_uv = a_uv;\n" " v_bump_uv = a_bump_uv;\n" " gl_Position = u_proj * u_view * u_model * vec4(v_pos, 1.0);\n" " v_shadow_coord = (u_shadow_mvp * u_model * vec4(v_pos, 1.0));\n" "}\n" "/************************************************************************/\n" "\n" "#endif\n" "\n" "#ifdef FRAGMENT_SHADER\n" "\n" "/************************************************************************/\n" "mediump vec2 uv, bump_uv;\n" "mediump vec3 n, s, r, v, bump;\n" "mediump float s_dot_n;\n" "lowp float l_amb, l_dif, l_spe;\n" "lowp float bshadow;\n" "lowp float visibility;\n" "lowp vec2 PS[4]; // Poisson offsets used for the shadow map.\n" "int i;\n" "\n" "void main()\n" "{\n" " // clamp uv so to prevent overflow with multismapling.\n" " uv = clamp(v_uv, 0.0, 1.0);\n" " s = u_l_dir;\n" " n = normalize((u_view * u_model * vec4(v_normal, 0.0)).xyz);\n" " bump_uv = (v_bump_uv + 0.5 + uv * 15.0) / 256.0;\n" " bump = texture2D(u_bump_tex, bump_uv).xyz - 0.5;\n" " bump = normalize((u_view * u_model * vec4(bump, 0.0)).xyz);\n" " n = mix(bump, n, u_m_smo);\n" " s_dot_n = dot(s, n);\n" " l_dif = u_m_dif * max(0.0, s_dot_n);\n" " l_amb = u_m_amb;\n" "\n" " // Specular light.\n" " v = normalize(-(u_view * u_model * vec4(v_pos, 1.0)).xyz);\n" " r = reflect(-s, n);\n" " l_spe = u_m_spe * pow(max(dot(r, v), 0.0), u_m_shi);\n" " l_spe = s_dot_n > 0.0 ? l_spe : 0.0;\n" "\n" " bshadow = texture2D(u_bshadow_tex, v_bshadow_uv).r;\n" " bshadow = sqrt(bshadow);\n" " bshadow = mix(1.0, bshadow, u_bshadow);\n" " gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n" " gl_FragColor.rgb += (l_dif + l_amb) * u_l_int * v_color.rgb;\n" " gl_FragColor.rgb += l_spe * u_l_int * vec3(1.0);\n" " gl_FragColor.rgb *= bshadow;\n" "\n" " // Shadow map.\n" " #ifdef SHADOW\n" " visibility = 1.0;\n" " mediump vec4 shadow_coord = v_shadow_coord / v_shadow_coord.w;\n" " lowp float bias = 0.005 * tan(acos(clamp(s_dot_n, 0.0, 1.0)));\n" " bias = clamp(bias, 0.0, 0.015);\n" " shadow_coord.z -= bias;\n" " PS[0] = vec2(-0.94201624, -0.39906216) / 1024.0;\n" " PS[1] = vec2(+0.94558609, -0.76890725) / 1024.0;\n" " PS[2] = vec2(-0.09418410, -0.92938870) / 1024.0;\n" " PS[3] = vec2(+0.34495938, +0.29387760) / 1024.0;\n" " for (i = 0; i < 4; i++)\n" " if (texture2D(u_shadow_tex, v_shadow_coord.xy +\n" " PS[i]).z < shadow_coord.z) visibility -= 0.2;\n" " if (s_dot_n <= 0.0) visibility = 0.5;\n" " gl_FragColor.rgb *= mix(1.0, visibility, u_shadow_k);\n" " #endif\n" "\n" "}\n" "\n" "/************************************************************************/\n" "\n" "#endif\n" "" }, {.path = "data/shaders/model3d.glsl", .size = 2766, .data = "#if defined(GL_ES) && defined(FRAGMENT_SHADER)\n" "#extension GL_OES_standard_derivatives : enable\n" "#endif\n" "\n" "uniform highp mat4 u_model;\n" "uniform highp mat4 u_view;\n" "uniform highp mat4 u_proj;\n" "uniform highp mat4 u_clip;\n" "uniform lowp vec4 u_color;\n" "uniform mediump vec2 u_uv_scale;\n" "uniform lowp float u_grid_alpha;\n" "uniform mediump vec3 u_l_dir;\n" "uniform mediump float u_l_diff;\n" "uniform mediump float u_l_emit;\n" "\n" "uniform mediump sampler2D u_tex;\n" "uniform mediump float u_strip;\n" "uniform mediump float u_time;\n" "\n" "varying mediump vec3 v_normal;\n" "varying highp vec3 v_pos;\n" "varying lowp vec4 v_color;\n" "varying mediump vec2 v_uv;\n" "varying mediump vec4 v_clip_pos;\n" "\n" "#ifdef VERTEX_SHADER\n" "\n" "/************************************************************************/\n" "attribute highp vec3 a_pos;\n" "attribute lowp vec4 a_color;\n" "attribute mediump vec3 a_normal;\n" "attribute mediump vec2 a_uv;\n" "\n" "void main()\n" "{\n" " lowp vec4 col = u_color * a_color;\n" " highp vec3 pos = (u_view * u_model * vec4(a_pos, 1.0)).xyz;\n" " if (u_clip[3][3] > 0.0)\n" " v_clip_pos = u_clip * u_model * vec4(a_pos, 1.0);\n" " gl_Position = u_proj * vec4(pos, 1.0);\n" " mediump float diff = max(0.0, dot(u_l_dir, a_normal));\n" " col.rgb *= (u_l_emit + u_l_diff * diff);\n" " v_color = col;\n" " v_uv = a_uv * u_uv_scale;\n" " v_pos = (u_model * vec4(a_pos, 1.0)).xyz;\n" " v_normal = a_normal;\n" "}\n" "/************************************************************************/\n" "\n" "#endif\n" "\n" "#ifdef FRAGMENT_SHADER\n" "\n" "/************************************************************************/\n" "void main()\n" "{\n" " gl_FragColor = v_color * texture2D(u_tex, v_uv);\n" " if (u_strip > 0.0) {\n" " mediump float p = gl_FragCoord.x + gl_FragCoord.y + u_time * 4.0;\n" " if (mod(p, 8.0) < 4.0) gl_FragColor.rgb *= 0.5;\n" " }\n" " if (u_clip[3][3] > 0.0) {\n" " if ( v_clip_pos[0] < -v_clip_pos[3] ||\n" " v_clip_pos[1] < -v_clip_pos[3] ||\n" " v_clip_pos[2] < -v_clip_pos[3] ||\n" " v_clip_pos[0] > +v_clip_pos[3] ||\n" " v_clip_pos[1] > +v_clip_pos[3] ||\n" " v_clip_pos[2] > +v_clip_pos[3]) discard;\n" " }\n" "\n" " // Grid effect.\n" "#if !defined(GL_ES) || defined(GL_OES_standard_derivatives)\n" " if (u_grid_alpha > 0.0) {\n" " mediump vec2 c;\n" " if (abs((u_model * vec4(v_normal, 0.0)).x) > 0.5) c = v_pos.yz;\n" " if (abs((u_model * vec4(v_normal, 0.0)).y) > 0.5) c = v_pos.zx;\n" " if (abs((u_model * vec4(v_normal, 0.0)).z) > 0.5) c = v_pos.xy;\n" " mediump vec2 grid = abs(fract(c - 0.5) - 0.5) / fwidth(c);\n" " mediump float line = min(grid.x, grid.y);\n" " gl_FragColor.rgb *= mix(1.0 - u_grid_alpha, 1.0, min(line, 1.0));\n" " }\n" "#endif\n" "\n" "}\n" "/************************************************************************/\n" "\n" "#endif\n" "" }, {.path = "data/shaders/pos_data.glsl", .size = 790, .data = "varying lowp vec2 v_pos_data;\n" "uniform highp mat4 u_model;\n" "uniform highp mat4 u_view;\n" "uniform highp mat4 u_proj;\n" "uniform lowp vec2 u_block_id;\n" "\n" "#ifdef VERTEX_SHADER\n" "\n" "/************************************************************************/\n" "attribute highp vec3 a_pos;\n" "attribute lowp vec2 a_pos_data;\n" "\n" "void main()\n" "{\n" " highp vec3 pos = a_pos;\n" " gl_Position = u_proj * u_view * u_model * vec4(pos, 1.0);\n" " v_pos_data = a_pos_data;\n" "}\n" "/************************************************************************/\n" "\n" "#endif\n" "\n" "#ifdef FRAGMENT_SHADER\n" "\n" "/************************************************************************/\n" "void main()\n" "{\n" " gl_FragColor.rg = u_block_id;\n" " gl_FragColor.ba = v_pos_data;\n" "}\n" "/************************************************************************/\n" "\n" "#endif\n" "" }, {.path = "data/shaders/shadow_map.glsl", .size = 639, .data = "#ifdef VERTEX_SHADER\n" "\n" "/************************************************************************/\n" "attribute highp vec3 a_pos;\n" "uniform highp mat4 u_model;\n" "uniform highp mat4 u_view;\n" "uniform highp mat4 u_proj;\n" "uniform mediump float u_pos_scale;\n" "void main()\n" "{\n" " gl_Position = u_proj * u_view * u_model * vec4(a_pos * u_pos_scale, 1.0);\n" "}\n" "\n" "/************************************************************************/\n" "\n" "#endif\n" "\n" "#ifdef FRAGMENT_SHADER\n" "\n" "/************************************************************************/\n" "void main() {}\n" "/************************************************************************/\n" "\n" "#endif\n" "" }, goxel-0.8.1/src/assets/sounds.inl000066400000000000000000000053721334742672700167740ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/sounds/click.wav", .size = 524, .data = (const uint8_t[]){ 82,73,70,70,4,2,0,0,87,65,86,69,102,109,116,32,16,0,0,0,1,0,2,0,68,172, 0,0,16,177,2,0,4,0,16,0,100,97,116,97,224,1,0,0,168,201,64,55,0,163,250, 85,78,141,216,83,156,149,46,39,1,200,226,224,202,28,39,168,12,104,166, 154,176,124,102,188,87,79,102,242,254,0,181,21,14,210,232,23,106,225,187, 247,223,17,183,187,202,66,73,143,175,95,200,156,154,78,240,214,86,25,177, 26,114,242,42,78,193,240,64,82,43,2,194,28,15,21,224,212,239,29,236,170, 37,17,161,175,69,240,202,217,203,206,83,14,92,201,29,43,22,239,212,31, 52,43,176,247,251,83,40,207,122,75,233,187,179,20,242,192,117,217,194, 218,60,198,213,252,102,222,163,12,117,10,89,2,58,52,164,241,12,74,53,235, 166,66,40,243,72,31,19,5,178,234,162,19,157,189,39,21,22,178,66,12,158, 204,254,0,145,247,169,249,111,18,123,249,63,11,36,2,172,236,142,17,55, 206,195,30,253,192,47,33,126,199,40,23,114,213,124,2,93,224,187,234,16, 235,52,223,195,246,47,234,56,253,5,8,152,250,239,41,58,241,209,59,4,235, 132,49,195,240,140,16,157,251,170,234,51,254,155,211,238,246,174,216,96, 238,120,247,48,239,82,30,229,251,67,55,135,8,247,51,210,9,119,22,26,2, 175,238,201,246,41,207,146,233,212,198,42,221,49,218,244,214,155,253,57, 223,129,28,54,246,207,36,24,15,219,18,147,26,119,246,215,16,204,227,190, 248,245,228,18,227,243,246,40,218,0,11,141,222,83,19,234,236,184,12,159, 254,98,253,120,13,40,242,30,20,239,245,69,12,128,7,111,246,51,25,223,223, 58,28,185,215,36,11,222,224,217,238,121,242,61,219,240,0,224,222,194,6, 64,247,172,5,79,21,118,254,21,38,89,241,117,31,129,228,129,9,156,225,237, 243,225,237,46,233,254,1,100,235,89,13,172,246,236,6,153,5,217,245,68, 19,88,233,95,26,150,234,52,23,37,247,89,11,129,4,196,252,45,8,90,241,182, 0,162,238,105,245,193,245,46,237,218,1,217,235,119,12,44,242,29,16,25, 254,12,11,201,9,234,1,214,12,122,250,28,4,158,248,175,246,153,252,65,240, 18,2,243,245,254,3, } }, goxel-0.8.1/src/assets/themes.inl000066400000000000000000000032361334742672700167430ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ {.path = "data/themes/dark.ini", .size = 206, .data = "[theme]\n" "name=dark\n" "\n" "[base]\n" "background=#2D2D2DFF\n" "outline=#FF\n" "inner=#2B3944FF\n" "inner_selected=#516882FF\n" "text=#C8C8C8FF\n" "text_selected=#FF\n" "\n" "[widget]\n" "\n" "[tab]\n" "background=#FF\n" "inner=#2D2D2DFF\n" "\n" "[menu]\n" "inner=#5A6E6EFF\n" "" }, {.path = "data/themes/original.ini", .size = 253, .data = "[theme]\n" "name=original\n" "\n" "[base]\n" "background=#607272FF\n" "outline=#4D4D4DFF\n" "inner=#A1A1A1FF\n" "inner_selected=#6666CCFF\n" "text=#111111FF\n" "text_selected=#111111FF\n" "\n" "[widget]\n" "\n" "[tab]\n" "background=#304242FF\n" "inner=#455656FF\n" "inner_selected=#607272FF\n" "\n" "[menu]\n" "inner=#5A6E6EFF\n" "" }, goxel-0.8.1/src/block_def.h000066400000000000000000000067101334742672700155310ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* * Here is the convention I used for the cube vertices, edges and faces: * * v4 +----------e4---------+ v5 * /. /| * / . / | * e7 . e5 | +-----------+ * / . / | / /| * / . / | / f1 / | | |f4| * | e8 | | | | | * | . | | | f3 | + * | . | | | | / * | v0 . . . .e0 . . . | . . + v1 | |/ * e11 . | / +-----------+ * | . e10 / ^ * | e3 | e1 f0 * | . | / * |. |/ * v3 +---------e2----------+ v2 * */ #include "vec.h" // face index -> [vertex0, vertex1, vertex2, vertex3] static const int FACES_VERTICES[6][4] = { {0, 1, 2, 3}, {5, 4, 7, 6}, {0, 4, 5, 1}, {2, 6, 7, 3}, {1, 5, 6, 2}, {0, 3, 7, 4} }; static const int FACES_OPPOSITES[6] = { 1, 0, 3, 2, 5, 4 }; // face index + edge -> neighbor face index. static const int FACES_NEIGHBORS[6][4] = { {2, 4, 3, 5}, {2, 5, 3, 4}, {5, 1, 4, 0}, {4, 1, 5, 0}, {2, 1, 3, 0}, {0, 3, 1, 2}, }; // vertex index -> vertex position static const int VERTICES_POSITIONS[8][3] = { {0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}, {0, 1, 0}, {1, 1, 0}, {1, 1, 1}, {0, 1, 1} }; static const int VERTICE_UV[4][2] = { {0, 0}, {1, 0}, {1, 1}, {0, 1}, }; static const int FACES_NORMALS[6][3] = { { 0, -1, 0}, { 0, +1, 0}, { 0, 0, -1}, { 0, 0, +1}, { 1, 0, 0}, {-1, 0, 0}, }; // Matrices of transformation: unity plane => cube face plane. static const float FACES_MATS[6][4][4] = { {{ 1, 0, 0, 0}, { 0, 0, 1, 0}, { 0, -1, 0, 0}, { 0, -1, 0, 1}}, {{-1, 0, 0, 0}, { 0, 0, 1, 0}, { 0, 1, 0, 0}, { 0, 1, 0, 1}}, {{ 0, 1, 0, 0}, { 1, 0, 0, 0}, { 0, 0, -1, 0}, { 0, 0, -1, 1}}, {{ 0, 1, 0, 0}, {-1, 0, 0, 0}, { 0, 0, 1, 0}, { 0, 0, 1, 1}}, {{ 0, 1, 0, 0}, { 0, 0, 1, 0}, { 1, 0, 0, 0}, { 1, 0, 0, 1}}, {{ 0, 0, 1, 0}, { 0, 1, 0, 0}, {-1, 0, 0, 0}, {-1, 0, 0, 1}}, }; static const int EDGES_VERTICES[12][2] = { {0, 1}, {1, 2}, {2, 3}, {3, 0}, {4, 5}, {5, 6}, {6, 7}, {7, 4}, {0, 4}, {1, 5}, {2, 6}, {3, 7}, }; goxel-0.8.1/src/box.h000066400000000000000000000200141334742672700144020ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #ifndef BOX_H #define BOX_H #include "vec.h" // A Box is represented as the 4x4 matrix that transforms the unit cube into // the box. static inline bool box_is_bbox(const float b[4][4]) { int i, j; for (i = 0; i < 3; i++) for (j = 0; j < 4; j++) { if (mat4_identity[i][j] == 0 && b[i][j] != 0) return false; } return true; } static inline void bbox_from_extents(float box[4][4], const float pos[3], float hw, float hh, float hd) { mat4_set_identity(box); vec3_copy(pos, box[3]); box[0][0] = hw; box[1][1] = hh; box[2][2] = hd; } static inline bool box_is_null(const float b[4][4]) { return b[3][3] == 0; } static inline void bbox_from_aabb(float box[4][4], const int aabb[2][3]) { const float pos[3] = {(aabb[1][0] + aabb[0][0]) / 2.f, (aabb[1][1] + aabb[0][1]) / 2.f, (aabb[1][2] + aabb[0][2]) / 2.f}; const float size[3] = {(float)(aabb[1][0] - aabb[0][0]), (float)(aabb[1][1] - aabb[0][1]), (float)(aabb[1][2] - aabb[0][2])}; bbox_from_extents(box, pos, size[0] / 2, size[1] / 2, size[2] / 2); } static inline void bbox_to_aabb(const float b[4][4], int aabb[2][3]) { aabb[0][0] = round(b[3][0] - b[0][0]); aabb[0][1] = round(b[3][1] - b[1][1]); aabb[0][2] = round(b[3][2] - b[2][2]); aabb[1][0] = round(b[3][0] + b[0][0]); aabb[1][1] = round(b[3][1] + b[1][1]); aabb[1][2] = round(b[3][2] + b[2][2]); } // XXX: remove? static inline void bbox_from_points( float box[4][4], const float a[3], const float b[3]) { float v0[3], v1[3], mid[3]; v0[0] = min(a[0], b[0]); v0[1] = min(a[1], b[1]); v0[2] = min(a[2], b[2]); v1[0] = max(a[0], b[0]); v1[1] = max(a[1], b[1]); v1[2] = max(a[2], b[2]); vec3_mix(v0, v1, 0.5, mid); bbox_from_extents(box, mid, (v1[0] - v0[0]) / 2, (v1[1] - v0[1]) / 2, (v1[2] - v0[2]) / 2); } static inline void bbox_from_npoints( float box[4][4], int n, const float (*points)[3]) { assert(n >= 1); int i; float v0[3], v1[3], mid[3]; vec3_copy(points[0], v0); vec3_copy(points[0], v1); for (i = 1; i < n; i++) { v0[0] = min(v0[0], points[i][0]); v0[1] = min(v0[1], points[i][1]); v0[2] = min(v0[2], points[i][2]); v1[0] = max(v1[0], points[i][0]); v1[1] = max(v1[1], points[i][1]); v1[2] = max(v1[2], points[i][2]); } vec3_mix(v0, v1, 0.5, mid); bbox_from_extents(box, mid, (v1[0] - v0[0]) / 2, (v1[1] - v0[1]) / 2, (v1[2] - v0[2]) / 2); } static inline bool bbox_contains(const float a[4][4], const float b[4][4]) { assert(box_is_bbox(a)); assert(box_is_bbox(b)); float a0[3], a1[3], b0[3], b1[3]; vec3_set(a0, a[3][0] - a[0][0], a[3][1] - a[1][1], a[3][2] - a[2][2]); vec3_set(a1, a[3][0] + a[0][0], a[3][1] + a[1][1], a[3][2] + a[2][2]); vec3_set(b0, b[3][0] - b[0][0], b[3][1] - b[1][1], b[3][2] - b[2][2]); vec3_set(b1, b[3][0] + b[0][0], b[3][1] + b[1][1], b[3][2] + b[2][2]); return (a0[0] <= b0[0] && a1[0] >= b1[0] && a0[1] <= b0[1] && a1[1] >= b1[1] && a0[2] <= b0[2] && a1[2] >= b1[2]); } static inline bool box_contains(const float a[4][4], const float b[4][4]) { const float PS[8][3] = { {-1, -1, +1}, {+1, -1, +1}, {+1, +1, +1}, {-1, +1, +1}, {-1, -1, -1}, {+1, -1, -1}, {+1, +1, -1}, {-1, +1, -1}, }; float p[3]; int i; float imat[4][4]; mat4_invert(a, imat); for (i = 0; i < 8; i++) { mat4_mul_vec3(b, PS[i], p); mat4_mul_vec3(imat, p, p); if ( p[0] < -1 || p[0] > 1 || p[1] < -1 || p[1] > 1 || p[2] < -1 || p[2] > 1) return false; } return true; } static inline bool bbox_contains_vec(const float b[4][4], const float v[3]) { assert(box_is_bbox(b)); float b0[3], b1[3]; vec3_set(b0, b[3][0] - b[0][0], b[3][1] - b[1][1], b[3][2] - b[2][2]); vec3_set(b1, b[3][0] + b[0][0], b[3][1] + b[1][1], b[3][2] + b[2][2]); return (b0[0] <= v[0] && b1[0] > v[0] && b0[1] <= v[1] && b1[1] > v[1] && b0[2] <= v[2] && b1[2] > v[2]); } static inline void box_get_bbox(const float b[4][4], float out[4][4]) { float p[8][3] = { {-1, -1, +1}, {+1, -1, +1}, {+1, +1, +1}, {-1, +1, +1}, {-1, -1, -1}, {+1, -1, -1}, {+1, +1, -1}, {-1, +1, -1}, }; int i; for (i = 0; i < 8; i++) { mat4_mul_vec3(b, p[i], p[i]); } bbox_from_npoints(out, 8, p); } static inline void bbox_grow(const float b[4][4], float x, float y, float z, float out[4][4]) { mat4_copy(b, out); out[0][0] += x; out[1][1] += y; out[2][2] += z; } static inline void box_get_size(const float b[4][4], float out[3]) { float v[3][4] = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}}; int i; for (i = 0; i < 3; i++) { mat4_mul_vec4(b, v[i], v[i]); out[i] = vec3_norm(v[i]); } } static inline void box_swap_axis(const float b[4][4], int x, int y, int z, float out[4][4]) { float m[4][4]; assert(x >= 0 && x <= 2); assert(y >= 0 && y <= 2); assert(z >= 0 && z <= 2); mat4_copy(b, m); mat4_copy(m, out); vec4_copy(m[x], out[0]); vec4_copy(m[y], out[1]); vec4_copy(m[z], out[2]); } // Create a new box with the 4 points opposit to the face f and the // new point. static inline void box_move_face( const float b[4][4], int f, const float p[3], float out[4][4]) { const float PS[8][3] = { {-1, -1, -1}, {+1, -1, -1}, {+1, -1, +1}, {-1, -1, +1}, {-1, +1, -1}, {+1, +1, -1}, {+1, +1, +1}, {-1, +1, +1}, }; const int FS[6][4] = { {0, 1, 2, 3}, {5, 4, 7, 6}, {0, 4, 5, 1}, {2, 6, 7, 3}, {1, 5, 6, 2}, {0, 3, 7, 4} }; const int FO[6] = {1, 0, 3, 2, 5, 4}; float ps[5][3]; int i; // XXX: for the moment we only support bbox, but we could make the // function generic. assert(box_is_bbox(b)); f = FO[f]; for (i = 0; i < 4; i++) mat4_mul_vec3(b, PS[FS[f][i]], ps[i]); vec3_copy(p, ps[4]); bbox_from_npoints(out, 5, ps); } static inline float box_get_volume(const float box[4][4]) { // The volume is the determinant of the 3x3 matrix of the box // time 8 (because the unit cube has a volume of 8). const float *v = &box[0][0]; float a, b, c, d, e, f, g, h, i; a = v[0]; b = v[1]; c = v[2]; d = v[4]; e = v[5]; f = v[6]; g = v[8]; h = v[9]; i = v[10]; return 8 * fabs(a*e*i + b*f*g + c*d*h - c*e*g - b*d*i - a*f*h); } static inline void box_get_vertices(const float box[4][4], float vertices[8][3]) { int i; const float P[8][3] = { {-1, -1, +1}, {+1, -1, +1}, {+1, +1, +1}, {-1, +1, +1}, {-1, -1, -1}, {+1, -1, -1}, {+1, +1, -1}, {-1, +1, -1}, }; for (i = 0; i < 8; i++) { mat4_mul_vec3(box, P[i], vertices[i]); } } #endif // BOX_H goxel-0.8.1/src/cache.c000066400000000000000000000044321334742672700146560ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct item item_t; struct item { UT_hash_handle hh; char key[256]; void *data; int cost; uint64_t last_used; int (*delfunc)(void *data); }; struct cache { item_t *items; uint64_t clock; int size; int max_size; }; cache_t *cache_create(int size) { cache_t *cache = calloc(1, sizeof(*cache)); cache->max_size = size; return cache; } static void cleanup(cache_t *cache) { item_t *item; while (cache->size >= cache->max_size) { item = cache->items; HASH_DEL(cache->items, item); item->delfunc(item->data); cache->size -= item->cost; free(item); } } void cache_add(cache_t *cache, const void *key, int len, void *data, int cost, int (*delfunc)(void *data)) { item_t *item = calloc(1, sizeof(*item)); assert(len <= sizeof(item->key)); memcpy(item->key, key, len); item->data = data; item->cost = cost; item->last_used = cache->clock++; item->delfunc = delfunc; HASH_ADD(hh, cache->items, key, len, item); cache->size += cost; if (cache->size >= cache->max_size) cleanup(cache); } void *cache_get(cache_t *cache, const void *key, int keylen) { item_t *item; HASH_FIND(hh, cache->items, key, keylen, item); if (!item) return NULL; item->last_used = cache->clock++; // Reinsert item on top of the hash list so that it stays sorted. HASH_DEL(cache->items, item); HASH_ADD(hh, cache->items, key, keylen, item); return item->data; } goxel-0.8.1/src/camera.c000066400000000000000000000116571334742672700150520ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" camera_t *camera_new(const char *name) { camera_t *cam = calloc(1, sizeof(*cam)); strncpy(cam->name, name, sizeof(cam->name)); return cam; } void camera_delete(camera_t *cam) { free(cam); } void camera_set(camera_t *cam, const camera_t *other) { cam->ortho = other->ortho; cam->dist = other->dist; quat_copy(other->rot, cam->rot); vec3_copy(other->ofs, cam->ofs); } static void compute_clip(const float view_mat[4][4], float *near_, float *far_) { int bpos[3]; float p[3]; float n = FLT_MAX, f = 256; int i; const int margin = 8 * BLOCK_SIZE; float vertices[8][3]; const mesh_t *mesh = goxel.layers_mesh; mesh_iterator_t iter; if (!box_is_null(goxel.image->box)) { box_get_vertices(goxel.image->box, vertices); for (i = 0; i < 8; i++) { mat4_mul_vec3(view_mat, vertices[i], p); if (p[2] < 0) { n = min(n, -p[2] - margin); f = max(f, -p[2] + margin); } } } iter = mesh_get_iterator(mesh, MESH_ITER_BLOCKS); while (mesh_iter(&iter, bpos)) { vec3_set(p, bpos[0], bpos[1], bpos[2]); mat4_mul_vec3(view_mat, p, p); if (p[2] < 0) { n = min(n, -p[2] - margin); f = max(f, -p[2] + margin); } } if (n >= f) n = 1; n = max(n, 1); *near_ = n; *far_ = f; } void camera_update(camera_t *camera) { float size; float clip_near, clip_far; camera->fovy = 20.; // Update the camera mats mat4_set_identity(camera->view_mat); mat4_itranslate(camera->view_mat, 0, 0, -camera->dist); mat4_imul_quat(camera->view_mat, camera->rot); mat4_itranslate(camera->view_mat, camera->ofs[0], camera->ofs[1], camera->ofs[2]); compute_clip(camera->view_mat, &clip_near, &clip_far); if (camera->ortho) { size = camera->dist; mat4_ortho(camera->proj_mat, -size, +size, -size / camera->aspect, +size / camera->aspect, clip_near, clip_far); } else { mat4_perspective(camera->proj_mat, camera->fovy, camera->aspect, clip_near, clip_far); } } // Get the raytracing ray of the camera at a given screen position. void camera_get_ray(const camera_t *camera, const float win[2], const float viewport[4], float o[3], float d[3]) { float o1[3], o2[3], p[3]; vec3_set(p, win[0], win[1], 0); unproject(p, camera->view_mat, camera->proj_mat, viewport, o1); vec3_set(p, win[0], win[1], 1); unproject(p, camera->view_mat, camera->proj_mat, viewport, o2); vec3_copy(o1, o); vec3_sub(o2, o1, d); vec3_normalize(d, d); } // Adjust the camera settings so that the rotation works for a given // position. void camera_set_target(camera_t *cam, const float pos[3]) { // Adjust the offset z coordinate (in the rotated referential) to put // it in the xy plan intersecting the target point. Then adjust the // distance so that the final view matrix stays the same. float u[4], v[4]; float d; float roti[4] = {cam->rot[0], -cam->rot[1], -cam->rot[2], -cam->rot[3]}; quat_mul_vec4(roti, VEC(0, 0, 1, 0), u); vec3_add(pos, cam->ofs, v); d = vec3_dot(v, u); vec3_iaddk(cam->ofs, u, -d); cam->dist -= d; } /* * Function: camera_fit_box * Move a camera so that a given box is entirely visible. */ void camera_fit_box(camera_t *cam, const float box[4][4]) { float size[3]; if (box_is_null(box)) { cam->dist = 128; cam->aspect = 1; return; } box_get_size(box, size); mat4_mul_vec3(box, VEC(0, 0, 0), cam->ofs); vec3_imul(cam->ofs, -1); // XXX: not the proper way to compute the distance. cam->dist = max3(size[0], size[1], size[2]) * 8; } /* * Function: camera_get_key * Return a value that is guarantied to change when the camera change. */ uint64_t camera_get_key(const camera_t *cam) { uint64_t key = 0; key = crc64(key, &cam->name, sizeof(cam->name)); key = crc64(key, &cam->ortho, sizeof(cam->ortho)); key = crc64(key, &cam->dist, sizeof(cam->dist)); key = crc64(key, &cam->rot, sizeof(cam->rot)); key = crc64(key, &cam->ofs, sizeof(cam->ofs)); return key; } goxel-0.8.1/src/color.c000066400000000000000000000050671334742672700147360ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" static void hsl_to_rgb_f(const float hsl[3], float rgb[3]) { float r = 0, g = 0, b = 0, c, x, m; const float h = hsl[0] / 60, s = hsl[1], l = hsl[2]; c = (1 - fabs(2 * l - 1)) * s; x = c * (1 - fabs(fmod(h, 2) - 1)); if (h < 1) {r = c; g = x; b = 0;} else if (h < 2) {r = x; g = c; b = 0;} else if (h < 3) {r = 0; g = c; b = x;} else if (h < 4) {r = 0; g = x; b = c;} else if (h < 5) {r = x; g = 0; b = c;} else if (h < 6) {r = c; g = 0; b = x;} m = l - 0.5 * c; rgb[0] = r + m; rgb[1] = g + m; rgb[2] = b + m; } static void rgb_to_hsl_f(const float rgb[3], float hsl[3]) { float h = 0, s, v, m, c, l; const float r = rgb[0], g = rgb[1], b = rgb[2]; v = max(max(r, g), b); m = min(min(r, g), b); l = (v + m) / 2; c = v - m; if (c == 0) { memset(hsl, 0, 3 * sizeof(float)); return; } if (v == r) {h = (g - b) / c + (g < b ? 6 : 0);} else if (v == g) {h = (b - r) / c + 2;} else if (v == b) {h = (r - g) / c + 4;} h *= 60; s = (l > 0.5) ? c / (2 - v - m) : c / (v + m); hsl[0] = h; hsl[1] = s; hsl[2] = l; } void hsl_to_rgb(const uint8_t hsl[3], uint8_t rgb[3]) { // XXX: use an optimized function that use int operations. float hsl_f[3] = {hsl[0] / 255. * 360, hsl[1] / 255., hsl[2] / 255.}; float rgb_f[3]; hsl_to_rgb_f(hsl_f, rgb_f); rgb[0] = round(rgb_f[0] * 255); rgb[1] = round(rgb_f[1] * 255); rgb[2] = round(rgb_f[2] * 255); } void rgb_to_hsl(const uint8_t rgb[3], uint8_t hsl[3]) { // XXX: use an optimized function that use int operations. float rgb_f[3] = {rgb[0] / 255., rgb[1] / 255., rgb[2] / 255.}; float hsl_f[3]; rgb_to_hsl_f(rgb_f, hsl_f); hsl[0] = round(hsl_f[0] * 255 / 360); hsl[1] = round(hsl_f[1] * 255); hsl[2] = round(hsl_f[2] * 255); } goxel-0.8.1/src/cycles.cpp000066400000000000000000000351621334742672700154410ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #ifdef WITH_CYCLES #include "device/device.h" #include "render/background.h" #include "render/camera.h" #include "render/film.h" #include "render/graph.h" #include "render/light.h" #include "render/mesh.h" #include "render/nodes.h" #include "render/object.h" #include "render/session.h" #include "render/shader.h" #include "util/util_transform.h" #include "util/util_foreach.h" #include "device/device_memory.h" #include // for make_unique extern "C" { #include "goxel.h" } // Convenience macro for cycles string creation. #define S(v) ccl::ustring(v) static ccl::Session *g_session = NULL; static ccl::BufferParams g_buffer_params; static ccl::SessionParams g_session_params; static ccl::Shader *create_cube_shader(void) { ccl::Shader *shader = new ccl::Shader(); shader->name = "cubeShader"; ccl::ShaderGraph *shaderGraph = new ccl::ShaderGraph(); const ccl::NodeType *colorNodeType = ccl::NodeType::find(S("attribute")); ccl::ShaderNode *colorShaderNode = static_cast( colorNodeType->create(colorNodeType)); colorShaderNode->name = "colorNode"; colorShaderNode->set(*colorShaderNode->type->find_input(S("attribute")), S("Col")); shaderGraph->add(colorShaderNode); const ccl::NodeType *diffuseBSDFNodeType = ccl::NodeType::find(S("diffuse_bsdf")); ccl::ShaderNode *diffuseBSDFShaderNode = static_cast( diffuseBSDFNodeType->create(diffuseBSDFNodeType)); diffuseBSDFShaderNode->name = "diffuseBSDFNode"; shaderGraph->add(diffuseBSDFShaderNode); shaderGraph->connect( colorShaderNode->output("Color"), diffuseBSDFShaderNode->input("Color") ); shaderGraph->connect( diffuseBSDFShaderNode->output("BSDF"), shaderGraph->output()->input("Surface") ); shader->set_graph(shaderGraph); return shader; } static ccl::Shader *create_light_shader(void) { ccl::Shader *shader = new ccl::Shader(); shader->name = "lightShader"; ccl::ShaderGraph *shaderGraph = new ccl::ShaderGraph(); const ccl::NodeType *emissionNodeType = ccl::NodeType::find(S("emission")); ccl::ShaderNode *emissionShaderNode = static_cast( emissionNodeType->create(emissionNodeType)); emissionShaderNode->name = "emissionNode"; emissionShaderNode->set( *emissionShaderNode->type->find_input(S("strength")), 1.0f ); emissionShaderNode->set( *emissionShaderNode->type->find_input(S("color")), ccl::make_float3(1.0, 1.0, 1.0) ); shaderGraph->add(emissionShaderNode); shaderGraph->connect( emissionShaderNode->output("Emission"), shaderGraph->output()->input("Surface") ); shader->set_graph(shaderGraph); return shader; } static ccl::Shader *create_background_shader(void) { ccl::Shader *shader = new ccl::Shader(); shader->name = "backgroundShader"; ccl::ShaderGraph *shaderGraph = new ccl::ShaderGraph(); const ccl::NodeType *backgroundNodeType = ccl::NodeType::find(S("background_shader")); ccl::ShaderNode *backgroundShaderNode = static_cast( backgroundNodeType->create(backgroundNodeType)); backgroundShaderNode->name = "backgroundNode"; backgroundShaderNode->set( *backgroundShaderNode->type->find_input(S("color")), ccl::make_float3(goxel.back_color[0] / 255.0f, goxel.back_color[1] / 255.0f, goxel.back_color[2] / 255.0f) ); backgroundShaderNode->set( *backgroundShaderNode->type->find_input(S("strength")), 0.5f ); shaderGraph->add(backgroundShaderNode); shaderGraph->connect( backgroundShaderNode->output("Background"), shaderGraph->output()->input("Surface") ); shader->set_graph(shaderGraph); return shader; } static ccl::Mesh *create_mesh_for_block( const mesh_t *mesh, const int block_pos[3]) { ccl::Mesh *ret = NULL; int nb = 0, i, j, size, subdivide; voxel_vertex_t* vertices; ccl::Attribute *attr; ret = new ccl::Mesh(); ret->subdivision_type = ccl::Mesh::SUBDIVISION_NONE; vertices = (voxel_vertex_t*)calloc( BLOCK_SIZE * BLOCK_SIZE * BLOCK_SIZE * 6 * 4, sizeof(*vertices)); nb = mesh_generate_vertices(mesh, block_pos, goxel.rend.settings.effects, vertices, &size, &subdivide); if (!nb) goto end; if (size == 4) { // Quads ret->reserve_mesh(nb * 4, nb * 2); for (i = 0; i < nb; i++) { // Once per quad. for (j = 0; j < 4; j++) { ret->add_vertex(ccl::make_float3( vertices[i * 4 + j].pos[0] / (float)subdivide, vertices[i * 4 + j].pos[1] / (float)subdivide, vertices[i * 4 + j].pos[2] / (float)subdivide)); } ret->add_triangle(i * 4 + 0, i * 4 + 1, i * 4 + 2, 0, false); ret->add_triangle(i * 4 + 2, i * 4 + 3, i * 4 + 0, 0, false); } // Set color attribute. attr = ret->attributes.add(S("Col"), ccl::TypeDesc::TypeColor, ccl::ATTR_ELEMENT_CORNER_BYTE); for (i = 0; i < nb * 6; i++) { attr->data_uchar4()[i] = ccl::make_uchar4( vertices[i / 6 * 4].color[0], vertices[i / 6 * 4].color[1], vertices[i / 6 * 4].color[2], vertices[i / 6 * 4].color[3] ); } } else { // Triangles ret->reserve_mesh(nb * 3, nb); for (i = 0; i < nb; i++) { // Once per triangle. for (j = 0; j < 3; j++) { ret->add_vertex(ccl::make_float3( vertices[i * 3 + j].pos[0] / (float)subdivide, vertices[i * 3 + j].pos[1] / (float)subdivide, vertices[i * 3 + j].pos[2] / (float)subdivide)); } ret->add_triangle(i * 3 + 0, i * 3 + 1, i * 3 + 2, 0, false); } // Set color attribute. attr = ret->attributes.add(S("Col"), ccl::TypeDesc::TypeColor, ccl::ATTR_ELEMENT_CORNER_BYTE); for (i = 0; i < nb * 3; i++) { attr->data_uchar4()[i] = ccl::make_uchar4( vertices[i].color[0], vertices[i].color[1], vertices[i].color[2], vertices[i].color[3] ); } } end: free(vertices); return ret; } static void sync_scene(ccl::Scene *scene, int w, int h) { mesh_t *gmesh = goxel.render_mesh; int block_pos[3]; mesh_iterator_t iter; scene->camera->width = w; scene->camera->height = h; scene->camera->fov = 20.0 * DD2R; scene->camera->type = ccl::CameraType::CAMERA_PERSPECTIVE; scene->camera->full_width = scene->camera->width; scene->camera->full_height = scene->camera->height; scene->film->exposure = 1.0f; ccl::Shader *object_shader = create_cube_shader(); object_shader->tag_update(scene); scene->shaders.push_back(object_shader); iter = mesh_get_iterator(gmesh, MESH_ITER_BLOCKS | MESH_ITER_INCLUDES_NEIGHBORS); while (mesh_iter(&iter, block_pos)) { ccl::Mesh *mesh = create_mesh_for_block(gmesh, block_pos); mesh->used_shaders.push_back(object_shader); scene->meshes.push_back(mesh); ccl::Object *object = new ccl::Object(); object->name = "mesh"; object->mesh = mesh; object->tfm = ccl::transform_identity() * ccl::transform_translate(ccl::make_float3( block_pos[0], block_pos[1], block_pos[2])); scene->objects.push_back(object); } ccl::Light *light; light = new ccl::Light(); ccl::Shader *light_shader = create_light_shader(); light_shader->tag_update(scene); scene->shaders.push_back(light_shader); light->shader = light_shader; scene->lights.push_back(light); ccl::Shader *back_shader = create_background_shader(); back_shader->tag_update(scene); scene->shaders.push_back(back_shader); scene->background->shader = back_shader; scene->camera->compute_auto_viewplane(); scene->camera->need_update = true; scene->camera->need_device_update = true; } void cycles_init(void) { ccl::DeviceType device_type; ccl::DeviceInfo device_info; ccl::vector& devices = ccl::Device::available_devices(); device_type = ccl::Device::type_from_string("CPU"); for (const ccl::DeviceInfo& device : devices) { if (device_type == device.type) { device_info = device; break; } } g_session_params.progressive = true; g_session_params.start_resolution = 64; g_session_params.device = device_info; g_session_params.samples = 20; // g_session_params.threads = 1; } static bool sync_mesh(int w, int h, bool force) { static uint64_t last_key = 0; uint64_t key; ccl::SceneParams scene_params; key = mesh_get_key(goxel.render_mesh); key = crc64(key, goxel.back_color, sizeof(goxel.back_color)); key = crc64(key, (const uint8_t*)&w, sizeof(w)); key = crc64(key, (const uint8_t*)&h, sizeof(h)); key = crc64(key, (const uint8_t*)&goxel.rend.settings.effects, sizeof(goxel.rend.settings.effects)); key = crc64(key, (const uint8_t*)&force, sizeof(force)); if (key == last_key) return false; last_key = key; // For the moment I don't see how to update the mesh without crashing // the application, except by creating a new session! if (g_session) { delete g_session; g_session = NULL; } if (!g_session) { // scene_params.shadingsystem = ccl::SHADINGSYSTEM_OSL; scene_params.shadingsystem = ccl::SHADINGSYSTEM_SVM; // scene_params.persistent_data = true; g_session = new ccl::Session(g_session_params); g_session->scene = new ccl::Scene(scene_params, g_session->device); } if (!g_session->ready_to_reset()) return false; g_session->scene->mutex.lock(); sync_scene(g_session->scene, w, h); g_session->scene->mutex.unlock(); g_session->reset(g_buffer_params, g_session_params.samples); g_session->start(); return true; } static bool sync_lights(int w, int h, bool force) { static uint64_t last_key = 0; uint64_t key; float light_dir[3]; ccl::Light *light; ccl::Scene *scene = g_session->scene; render_get_light_dir(&goxel.rend, light_dir); key = mesh_get_key(goxel.render_mesh); key = crc64(key, (uint8_t*)&goxel.rend.light, sizeof(goxel.rend.light)); key = crc64(key, (uint8_t*)light_dir, sizeof(light_dir)); if (!force && key == last_key) return false; light = scene->lights[0]; light->type = ccl::LIGHT_DISTANT; light->size = 0.01f; light->dir = ccl::make_float3(-light_dir[0], -light_dir[1], -light_dir[2]); light->tag_update(scene); g_session->reset(g_buffer_params, g_session_params.samples); last_key = key; return true; } static bool sync_camera(int w, int h, const camera_t *camera, bool force) { static uint64_t last_key = 0; uint64_t key; ccl::Scene *scene; float mat[4][4]; float rot[4]; key = crc64(0, (uint8_t*)camera->view_mat, sizeof(camera->view_mat)); key = crc64(key, (uint8_t*)camera->proj_mat, sizeof(camera->proj_mat)); key = crc64(key, (uint8_t*)&w, sizeof(w)); key = crc64(key, (uint8_t*)&h, sizeof(h)); if (!force && key == last_key) return false; scene = g_session->scene; scene->camera->width = w; scene->camera->height = h; scene->camera->fov = 20.0 * DD2R; scene->camera->type = ccl::CameraType::CAMERA_PERSPECTIVE; scene->camera->full_width = scene->camera->width; scene->camera->full_height = scene->camera->height; assert(sizeof(scene->camera->matrix) == sizeof(mat)); mat4_set_identity(mat); mat4_itranslate(mat, -camera->ofs[0], -camera->ofs[1], -camera->ofs[2]); quat_copy(camera->rot, rot); rot[0] *= -1; mat4_imul_quat(mat, rot); mat4_itranslate(mat, 0, 0, camera->dist); mat4_iscale(mat, 1, 1, -1); mat4_transpose(mat, mat); memcpy(&scene->camera->matrix, mat, sizeof(mat)); scene->camera->compute_auto_viewplane(); scene->camera->need_update = true; scene->camera->need_device_update = true; g_session->reset(g_buffer_params, g_session_params.samples); last_key = key; return true; } static bool sync(int w, int h, const camera_t *cam, bool force) { bool mesh_changed; mesh_changed = sync_mesh(w, h, force); sync_lights(w, h, mesh_changed); sync_camera(w, h, cam, mesh_changed); return true; } void cycles_render(uint8_t *buffer, int *w, int *h, const camera_t *cam, float *progress, bool force_restart) { static ccl::DeviceDrawParams draw_params = ccl::DeviceDrawParams(); g_buffer_params.width = *w; g_buffer_params.height = *h; g_buffer_params.full_width = *w; g_buffer_params.full_height = *h; sync(*w, *h, cam, force_restart); if (!g_session) return; std::unique_lock lock(g_session->display_mutex); if (!g_session->display->draw_ready()) return; *w = g_session->display->draw_width; *h = g_session->display->draw_height; uint8_t *rgba = (uint8_t*)g_session->display->rgba_byte.host_pointer; memcpy(buffer, rgba, (*w) * (*h) * 4); std::string status; std::string substatus; g_session->progress.get_status(status, substatus); if (progress) *progress = g_session->progress.get_progress(); } void cycles_release(void) { if (!g_session) return; delete g_session; g_session = NULL; } #else // Dummy implementations. extern "C" { #include "goxel.h" } void cycles_init(void) {} void cycles_release(void) {} void cycles_render(uint8_t *buffer, int *w, int *h, const camera_t *cam, float *progress, bool force_restart) {} #endif goxel-0.8.1/src/dialogs_osx.m000066400000000000000000000016401334742672700161360ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ // XXX: if noc_file_dialog didn't use obj c on ios, I could directly include // this file in system.c #define NOC_FILE_DIALOG_OSX #define NOC_FILE_DIALOG_IMPLEMENTATION #include "noc_file_dialog.h" goxel-0.8.1/src/formats/000077500000000000000000000000001334742672700151175ustar00rootroot00000000000000goxel-0.8.1/src/formats/dicom.c000066400000000000000000000267001334742672700163630ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include // Very basic implementation of DICOM files reader. typedef struct { int instance_number; float slice_location; int samples_per_pixel; int rows; int columns; int bits_allocated; int bits_stored; int high_bit; int data_size; char *path; // If you set it, you have to remember to free it. } dicom_t; // Convenience macro. #define READ(type, in) ({ \ type v; \ CHECK(fread(&v, sizeof(type), 1, in) == 1); \ v;}) typedef union { struct { uint16_t group; uint16_t element; }; uint32_t v; } tag_t; typedef struct { tag_t tag; int length; char vr[2]; // Maybe I should use the same field for US and IS? union { uint16_t us; int is; float ds; char ui[256]; } value; // If set they we put the pixel data there. char *buffer; int buffer_size; } element_t; // Start of sequence item. static const tag_t TAG_ITEM = {{0xFFFE, 0xE000}}; // End of sequence item. static const tag_t TAG_ITEM_DEL = {{0xFFFE, 0xE00D}}; // End of Sequence of undefined length. static const tag_t TAG_SEQ_DEL = {{0xFFFE, 0xE0DD}}; static const tag_t TAG_INSTANCE_NUMBER = {{0x0020, 0x0013}}; static const tag_t TAG_SLICE_LOCATION = {{0x0020, 0x1041}}; static const tag_t TAG_SAMPLES_PER_PIXEL = {{0x0028, 0x0002}}; static const tag_t TAG_ROWS = {{0x0028, 0x0010}}; static const tag_t TAG_COLUMNS = {{0x0028, 0x0011}}; static const tag_t TAG_BITS_ALLOCATED = {{0x0028, 0x0100}}; static const tag_t TAG_BITS_STORED = {{0x0028, 0x0101}}; static const tag_t TAG_HIGH_BIT = {{0x0028, 0x0102}}; static const tag_t TAG_PIXEL_DATA = {{0x7FE0, 0x0010}}; static const tag_t TAG_TRANSFER_SYNTAX_UID = {{0x0002, 0x0010}}; typedef struct { const char *uid; const char *name; } dicom_uid_t; // Define at the bottom of this file. static const dicom_uid_t UIDS[]; static const char EXTRA_LEN_VRS[][2] = {"OB", "OW", "OF", "SQ", "UN", "UT"}; static inline bool streq(const char *a, const char *b) { return strncmp(a, b, strlen(b)) == 0; } static const char *get_uid_name(const char *uid) { const dicom_uid_t *pos; for (pos = UIDS; pos->uid; pos++) { if (strcmp(pos->uid, uid) == 0) return pos->name; } return false; } static bool parse_preamble(FILE *in) { char magic[4]; // Skip the first 128 bytes. fseek(in, 128, SEEK_CUR); CHECK(fread(magic, 4, 1, in) == 1); if (!streq(magic, "DICM")) { fseek(in, 0, SEEK_SET); return false; } return true; } static int remain_size(FILE *in) { long cur, end; cur = ftell(in); fseek(in, 0, SEEK_END); end = ftell(in); fseek(in, cur, SEEK_SET); return (int)(end - cur); } enum { STATE_SEQUENCE_ITEM = 1 << 0, STATE_IMPLICIT_VR = 1 << 1, }; static bool parse_element(FILE *in, int state, element_t *out) { tag_t tag; element_t item; int length; char vr[3] = " "; char tmp_buff[128]; bool extra_len = false; int i; if (remain_size(in) == 0) return false; tag.group = READ(uint16_t, in); tag.element = READ(uint16_t, in); // The meta data is always in explicit form. if (tag.group == 0x0002) state &= ~STATE_IMPLICIT_VR; if (state & STATE_IMPLICIT_VR) { length = READ(uint32_t, in); // XXX: Handle this with a static table. if (tag.v == TAG_INSTANCE_NUMBER.v) sprintf(vr, "IS"); if (tag.v == TAG_SLICE_LOCATION.v) sprintf(vr, "DS"); if (tag.v == TAG_SAMPLES_PER_PIXEL.v) sprintf(vr, "US"); if (tag.v == TAG_ROWS.v) sprintf(vr, "US"); if (tag.v == TAG_COLUMNS.v) sprintf(vr, "US"); if (tag.v == TAG_BITS_ALLOCATED.v) sprintf(vr, "US"); if (tag.v == TAG_BITS_STORED.v) sprintf(vr, "US"); if (tag.v == TAG_HIGH_BIT.v) sprintf(vr, "US"); if (tag.v == TAG_PIXEL_DATA.v) sprintf(vr, "OB"); } else { CHECK(fread(vr, 2, 1, in) == 1); for (i = 0; i < ARRAY_SIZE(EXTRA_LEN_VRS); i++) { if (strncmp(vr, EXTRA_LEN_VRS[i], 2) == 0) { extra_len = true; break; } } if (extra_len) { READ(uint16_t, in); // Reserved 2 bytes length = READ(uint32_t, in); } else { length = READ(uint16_t, in); } } LOG_V("(%.4x, %.4x) %s, length:%d", tag.group, tag.element, vr, length); // Read a sequence of undefined length. if (length == 0xffffffff && (streq(vr, "SQ") || streq(vr, "OW"))) { while (true) { parse_element(in, STATE_SEQUENCE_ITEM | STATE_IMPLICIT_VR, &item); if (item.tag.v == TAG_SEQ_DEL.v) { break; } if (item.tag.v != TAG_ITEM.v) LOG_E("Expected item tag"); } } if (state & STATE_SEQUENCE_ITEM && length == 0xffffffff) { while (true) { parse_element(in, 0, &item); if (item.tag.v == TAG_ITEM_DEL.v) { break; } } } if (out) { out->tag = tag; out->length = length; memcpy(out->vr, vr, 2); } // For the moment we just skip the data. if (length != 0xffffffff) { CHECK(length >= 0); if (length > remain_size(in)) { CHECK(false); } if (out && length == 2 && strncmp(vr, "US", 2) == 0) { out->value.us = READ(uint16_t, in); } else if (out && strncmp(vr, "IS", 2) == 0) { CHECK(length < sizeof(tmp_buff) - 1); CHECK(fread(tmp_buff, length, 1, in) == 1); tmp_buff[length] = '\0'; sscanf(tmp_buff, "%d", &out->value.is); } else if (out && strncmp(vr, "DS", 2) == 0) { CHECK(length < sizeof(tmp_buff) - 1); CHECK(fread(tmp_buff, length, 1, in) == 1); tmp_buff[length] = '\0'; sscanf(tmp_buff, "%f", &out->value.ds); } else if (out && strncmp(vr, "UI", 2) == 0) { CHECK(length < sizeof(out->value.ui) - 1); CHECK(fread(out->value.ui, length, 1, in) == 1); out->value.ui[length] = '\0'; } else if (out && tag.v == TAG_PIXEL_DATA.v && out->buffer) { CHECK(out->buffer_size >= length); CHECK(fread(out->buffer, length, 1, in) == 1); } else { // Skip the data. fseek(in, length, SEEK_CUR); } } if (tag.group == 0) return false; return true; } static void dicom_load(const char *path, dicom_t *dicom, char *out_buffer, int buffer_size) { FILE *in = fopen(path, "rb"); int state = 0; const char *uid_name; element_t element = { .buffer = out_buffer, .buffer_size = buffer_size, }; if (!parse_preamble(in)) { state |= STATE_IMPLICIT_VR; } while (true) { if (!parse_element(in, state, &element)) break; #define S(attr, tag_, v_) \ if (element.tag.v == tag_.v) \ dicom->attr = element.value.v_; S(instance_number, TAG_INSTANCE_NUMBER, is); S(slice_location, TAG_SLICE_LOCATION, ds); S(samples_per_pixel, TAG_SAMPLES_PER_PIXEL, us); S(rows, TAG_ROWS, us); S(columns, TAG_COLUMNS, us); S(bits_allocated, TAG_BITS_ALLOCATED, us); S(bits_stored, TAG_BITS_STORED, us); S(high_bit, TAG_HIGH_BIT, us); #undef S if (element.tag.v == TAG_PIXEL_DATA.v) dicom->data_size = element.length; if (element.tag.v == TAG_TRANSFER_SYNTAX_UID.v) { uid_name = get_uid_name(element.value.ui); if (uid_name && strstr(uid_name, "Implicit")) { state |= STATE_IMPLICIT_VR; } if (!streq(element.value.ui, "1.2.840.10008.1.2.1")) { LOG_E("format not supported: %s", uid_name); CHECK(false); } } } fclose(in); } static int dicom_sort(const void *a, const void *b) { return cmp(((dicom_t*)a)->slice_location, ((dicom_t*)b)->slice_location); } static void dicom_import(const char *dirpath) { DIR *dir; struct dirent *dirent; dicom_t dicom, *dptr; static UT_icd dicom_icd = {sizeof(dicom_t), NULL, NULL, NULL}; UT_array *all_files; int w, h, d; // Dimensions of the full data cube. int i; uint16_t *data; uint8_t (*cube)[4]; dirpath = dirpath ?: noc_file_dialog_open( NOC_FILE_DIALOG_OPEN | NOC_FILE_DIALOG_DIR, NULL, NULL, NULL); if (!dirpath) return; // First we parse all the dicom images into a sorted array. // XXX: how to propery iter a directory? utarray_new(all_files, &dicom_icd); dir = opendir(dirpath); while ((dirent = readdir(dir))) { if (dirent->d_name[0] == '.') continue; asprintf(&dicom.path, "%s/%s", dirpath, dirent->d_name); dicom_load(dicom.path, &dicom, NULL, 0); CHECK(dicom.rows && dicom.columns); utarray_push_back(all_files, &dicom); } closedir(dir); utarray_sort(all_files, dicom_sort); // Read all the file data one by one into the data cube. w = dicom.columns; h = dicom.rows; d = utarray_len(all_files); data = calloc(w * h * d, 2); dptr = NULL; while( (dptr = (dicom_t*)utarray_next(all_files, dptr))) { i = utarray_eltidx(all_files, dptr); dicom_load(dptr->path, &dicom, (char*)&data[w * h * i], w * h * 2); free(dptr->path); } utarray_free(all_files); // Generate 4 * 8bit RGBA values. // XXX: we should maybe support voxel data in 2 bytes monochrome. cube = malloc(w * h * d * sizeof(*cube)); for (i = 0; i < w * h * d; i++) { vec4_set(cube[i], 255, 255, 255, clamp(data[i], 0, 255)); } free(data); // This could belong to the caller function. mesh_blit(goxel.image->active_layer->mesh, (uint8_t*)cube, -w / 2, -h / 2, -d / 2, w, h, d, NULL); free(cube); } static const dicom_uid_t UIDS[] = { {"1.2.840.10008.1.2", "Implicit VR Little Endian"}, {"1.2.840.10008.1.2.1", "Explicit VR Little Endian"}, {"1.2.840.10008.1.2.4.91", "JPEG 2000 Image Compression"}, {NULL, NULL}, }; ACTION_REGISTER(import_dicom, .help = "Import a dicom image", .cfunc = dicom_import, .csig = "vp", .file_format = { .name = "dicom", }, ) goxel-0.8.1/src/formats/gox.c000066400000000000000000000443071334742672700160700ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include #define VERSION 2 // Current version of the file format. /* * File format, version 2: * * This is inspired by the png format, where the file consists of a list of * chunks with different types. * * 4 bytes magic string : "GOX " * 4 bytes version : 2 * List of chunks: * 4 bytes: type * 4 bytes: data length * n bytes: data * 4 bytes: CRC * * The layer can end with a DICT: * for each entry: * 4 byte : key size (0 = end of dict) * n bytes: key * 4 bytes: value size * n bytes: value * * chunks types: * * IMG : a dict of info: * - box: the image gox. * * PREV: a png image for preview. * * BL16: a 16^3 block saved as a 64x64 png image. * * LAYR: a layer: * 4 bytes: number of blocks. * for each block: * 4 bytes: block index * 4 bytes: x * 4 bytes: y * 4 bytes: z * 4 bytes: 0 * [DICT] * * CAMR: a camera: * [DICT] containing the following entries: * name: string * dist: float * rot: quaternion * ofs: offset * ortho: bool * */ // We create a hash table of all the blocks, so that blocks with the same // ids get written only once. typedef struct { UT_hash_handle hh; void *v; uint64_t uid; int index; } block_hash_t; #define CHUNK_BUFF_SIZE (1 << 20) // 1 MiB max buffer size! typedef struct { char type[4]; int length; uint32_t crc; char *buffer; // Used when writing. int pos; } chunk_t; static void write_int32(FILE *out, int32_t v) { fwrite((char*)&v, 4, 1, out); } static int32_t read_int32(FILE *in) { int32_t v; if (fread(&v, 4, 1, in) != 1) { // XXX: use a better error mechanism! LOG_E("Error reading file"); } return v; } static bool chunk_read_start(chunk_t *c, FILE *in) { size_t r; memset(c, 0, sizeof(*c)); r = fread(c->type, 4, 1, in); if (r == 0) return false; // eof. if (r != 1) LOG_E("Error reading file"); c->length = read_int32(in); return true; } static void chunk_read(chunk_t *c, FILE *in, char *buff, int size) { c->pos += size; assert(c->pos <= c->length); if (buff) { // XXX: use a better error mechanism! if (fread(buff, size, 1, in) != 1) LOG_E("Error reading file"); } else { fseek(in, size, SEEK_CUR); } } static int32_t chunk_read_int32(chunk_t *c, FILE *in) { int32_t v; chunk_read(c, in, (char*)&v, 4); return v; } static void chunk_read_finish(chunk_t *c, FILE *in) { assert(c->pos == c->length); read_int32(in); // TODO: check crc. } static bool chunk_read_dict_value(chunk_t *c, FILE *in, char *key, char *value, int *value_size) { int size; assert(c->pos <= c->length); if (c->pos == c->length) return 0; size = chunk_read_int32(c, in); if (size == 0) return false; assert(size < 256); chunk_read(c, in, key, size); key[size] = '\0'; size = chunk_read_int32(c, in); chunk_read(c, in, value, size); value[size] = '\0'; *value_size = size; return true; } static void chunk_write_start(chunk_t *c, FILE *out, const char *type) { memset(c, 0, sizeof(*c)); assert(strlen(type) == 4); memcpy(c->type, type, 4); c->buffer = calloc(1, CHUNK_BUFF_SIZE); } static void chunk_write(chunk_t *c, FILE *out, const char *data, int size) { if (size == 0) return; assert(c->length + size < CHUNK_BUFF_SIZE); memcpy(c->buffer + c->length, data, size); c->length += size; } static void chunk_write_int32(chunk_t *c, FILE *out, int32_t v) { chunk_write(c, out, (char*)&v, 4); } static void chunk_write_dict_value(chunk_t *c, FILE *out, const char *name, const void *data, int size) { chunk_write_int32(c, out, (int)strlen(name)); chunk_write(c, out, name, (int)strlen(name)); chunk_write_int32(c, out, size); chunk_write(c, out, data, size); } static void chunk_write_finish(chunk_t *c, FILE *out) { fwrite(c->type, 4, 1, out); write_int32(out, c->length); fwrite(c->buffer, c->length, 1, out); write_int32(out, 0); // CRC XXX: todo. free(c->buffer); c->buffer = NULL; } static void chunk_write_all(FILE *out, const char *type, const char *data, int size) { fwrite(type, 4, 1, out); write_int32(out, size); fwrite(data, size, 1, out); write_int32(out, 0); // CRC XXX: todo. } void save_to_file(const char *path, bool with_preview) { // XXX: remove all empty blocks before saving. LOG_I("Save to %s", path); block_hash_t *blocks_table = NULL, *data, *data_tmp; layer_t *layer; chunk_t c; int nb_blocks, index, size, bpos[3]; uint64_t uid; FILE *out; uint8_t *png, *preview; camera_t *camera; mesh_iterator_t iter; out = fopen(path, "wb"); if (!out) { LOG_E("Cannot save to %s: %s", path, strerror(errno)); return; } fwrite("GOX ", 4, 1, out); write_int32(out, VERSION); // Write image info. chunk_write_start(&c, out, "IMG "); if (!box_is_null(goxel.image->box)) chunk_write_dict_value(&c, out, "box", &goxel.image->box, sizeof(goxel.image->box)); chunk_write_finish(&c, out); if (with_preview) { preview = calloc(128 * 128, 4); goxel_render_to_buf(preview, 128, 128, 4); png = img_write_to_mem(preview, 128, 128, 4, &size); chunk_write_all(out, "PREV", (char*)png, size); free(preview); free(png); } // Add all the blocks data into the hash table. index = 0; DL_FOREACH(goxel.image->layers, layer) { iter = mesh_get_iterator(layer->mesh, MESH_ITER_BLOCKS); while (mesh_iter(&iter, bpos)) { mesh_get_block_data(layer->mesh, &iter, bpos, &uid); HASH_FIND(hh, blocks_table, &uid, sizeof(uid), data); if (data) continue; data = calloc(1, sizeof(*data)); data->v = mesh_get_block_data(layer->mesh, &iter, bpos, NULL); assert(data->v); data->uid = uid; data->index = index++; HASH_ADD(hh, blocks_table, uid, sizeof(data->uid), data); } } // Write all the blocks chunks. HASH_ITER(hh, blocks_table, data, data_tmp) { png = img_write_to_mem((uint8_t*)data->v, 64, 64, 4, &size); chunk_write_all(out, "BL16", (char*)png, size); free(png); } // Write all the layers. DL_FOREACH(goxel.image->layers, layer) { chunk_write_start(&c, out, "LAYR"); nb_blocks = 0; if (!layer->base_id) { iter = mesh_get_iterator(layer->mesh, MESH_ITER_BLOCKS); while (mesh_iter(&iter, bpos)) { nb_blocks++; } } chunk_write_int32(&c, out, nb_blocks); if (!layer->base_id) { iter = mesh_get_iterator(layer->mesh, MESH_ITER_BLOCKS); while (mesh_iter(&iter, bpos)) { mesh_get_block_data(layer->mesh, &iter, bpos, &uid); HASH_FIND(hh, blocks_table, &uid, sizeof(uid), data); assert(data); chunk_write_int32(&c, out, data->index); chunk_write_int32(&c, out, bpos[0]); chunk_write_int32(&c, out, bpos[1]); chunk_write_int32(&c, out, bpos[2]); chunk_write_int32(&c, out, 0); } } chunk_write_dict_value(&c, out, "name", layer->name, strlen(layer->name)); chunk_write_dict_value(&c, out, "mat", &layer->mat, sizeof(layer->mat)); chunk_write_dict_value(&c, out, "id", &layer->id, sizeof(layer->id)); chunk_write_dict_value(&c, out, "base_id", &layer->base_id, sizeof(layer->base_id)); if (layer->image) { chunk_write_dict_value(&c, out, "img-path", layer->image->path, strlen(layer->image->path)); } if (!box_is_null(layer->box)) chunk_write_dict_value(&c, out, "box", &layer->box, sizeof(layer->box)); chunk_write_finish(&c, out); } // Write all the cameras. DL_FOREACH(goxel.image->cameras, camera) { chunk_write_start(&c, out, "CAMR"); chunk_write_dict_value(&c, out, "name", camera->name, strlen(camera->name)); chunk_write_dict_value(&c, out, "dist", &camera->dist, sizeof(camera->dist)); chunk_write_dict_value(&c, out, "rot", &camera->rot, sizeof(camera->rot)); chunk_write_dict_value(&c, out, "ofs", &camera->ofs, sizeof(camera->ofs)); chunk_write_dict_value(&c, out, "ortho", &camera->ortho, sizeof(camera->ortho)); if (camera == goxel.image->active_camera) chunk_write_dict_value(&c, out, "active", NULL, 0); chunk_write_finish(&c, out); } HASH_ITER(hh, blocks_table, data, data_tmp) { HASH_DEL(blocks_table, data); free(data); } fclose(out); } // Iter info of a gox file, without actually reading it. // For the moment only returns the image preview if available. int gox_iter_infos(const char *path, int (*callback)(const char *attr, int size, void *value, void *user), void *user) { FILE *in; chunk_t c; uint8_t *png; char magic[4]; in = fopen(path, "rb"); if (fread(magic, 4, 1, in) != 1) return -1; if (strncmp(magic, "GOX ", 4) != 0) return -1; read_int32(in); while (chunk_read_start(&c, in)) { if (strncmp(c.type, "BL16", 4) == 0) break; if (strncmp(c.type, "LAYR", 4) == 0) break; if (strncmp(c.type, "PREV", 4) == 0) { png = calloc(1, c.length); chunk_read(&c, in, (char*)png, c.length); callback(c.type, c.length, png, user); free(png); } else { // Ignore other blocks. chunk_read(&c, in, NULL, c.length); } chunk_read_finish(&c, in); } fclose(in); return 0; } static block_hash_t *hash_find_at(block_hash_t *hash, int index) { int i; for (i = 0; i < index; i++) { hash = hash->hh.next; } return hash; } int load_from_file(const char *path) { layer_t *layer, *layer_tmp; block_hash_t *blocks_table = NULL, *data, *data_tmp; FILE *in; char magic[4] = {}; uint8_t *voxel_data; int nb_blocks; int w, h, bpp; uint8_t *png; chunk_t c; int i, index, version, x, y, z; int dict_value_size; char dict_key[256]; char dict_value[256]; uint64_t uid = 1; camera_t *camera; in = fopen(path, "rb"); if (!in) return -1; if (fread(magic, 4, 1, in) != 1) goto error; if (strncmp(magic, "GOX ", 4) != 0) goto error; version = read_int32(in); if (version > VERSION) { LOG_W("Cannot open gox file version %d", version); goto error; } // Remove all layers. // XXX: we should load the image fully before deleting the current one. DL_FOREACH_SAFE(goxel.image->layers, layer, layer_tmp) { mesh_delete(layer->mesh); free(layer); } goxel.image->layers = NULL; memset(&goxel.image->box, 0, sizeof(goxel.image->box)); while (chunk_read_start(&c, in)) { if (strncmp(c.type, "BL16", 4) == 0) { png = calloc(1, c.length); chunk_read(&c, in, (char*)png, c.length); bpp = 4; voxel_data = img_read_from_mem((void*)png, c.length, &w, &h, &bpp); assert(w == 64 && h == 64 && bpp == 4); data = calloc(1, sizeof(*data)); data->v = calloc(1, 64 * 64 * 4); memcpy(data->v, voxel_data, 64 * 64 * 4); data->uid = ++uid; HASH_ADD(hh, blocks_table, uid, sizeof(data->uid), data); free(voxel_data); free(png); } else if (strncmp(c.type, "LAYR", 4) == 0) { layer = image_add_layer(goxel.image); nb_blocks = chunk_read_int32(&c, in); assert(nb_blocks >= 0); for (i = 0; i < nb_blocks; i++) { index = chunk_read_int32(&c, in); assert(index >= 0); x = chunk_read_int32(&c, in); y = chunk_read_int32(&c, in); z = chunk_read_int32(&c, in); if (version == 1) { // Previous version blocks pos. x -= 8; y -= 8; z -= 8; } chunk_read_int32(&c, in); data = hash_find_at(blocks_table, index); assert(data); mesh_blit(layer->mesh, data->v, x, y, z, 16, 16, 16, NULL); } while ((chunk_read_dict_value(&c, in, dict_key, dict_value, &dict_value_size))) { if (strcmp(dict_key, "name") == 0) sprintf(layer->name, "%s", dict_value); if (strcmp(dict_key, "mat") == 0) { assert(dict_value_size == sizeof(layer->mat)); memcpy(&layer->mat, dict_value, dict_value_size); } if (strcmp(dict_key, "img-path") == 0) { layer->image = texture_new_image(dict_value, TF_NEAREST); } if (strcmp(dict_key, "id") == 0) { typeof(layer->id) id; memcpy(&id, dict_value, dict_value_size); if (id) layer->id = id; } if (strcmp(dict_key, "base_id") == 0) memcpy(&layer->base_id, dict_value, dict_value_size); if (strcmp(dict_key, "box") == 0) memcpy(&layer->box, dict_value, dict_value_size); } } else if (strncmp(c.type, "CAMR", 4) == 0) { camera = camera_new("unnamed"); DL_APPEND(goxel.image->cameras, camera); while ((chunk_read_dict_value(&c, in, dict_key, dict_value, &dict_value_size))) { if (strcmp(dict_key, "name") == 0) strncpy(camera->name, dict_value, sizeof(camera->name)); if (strcmp(dict_key, "dist") == 0) memcpy(&camera->dist, dict_value, dict_value_size); if (strcmp(dict_key, "rot") == 0) memcpy(&camera->rot, dict_value, dict_value_size); if (strcmp(dict_key, "ofs") == 0) memcpy(&camera->ofs, dict_value, dict_value_size); if (strcmp(dict_key, "ortho") == 0) memcpy(&camera->ortho, dict_value, dict_value_size); if (strcmp(dict_key, "active") == 0) { goxel.image->active_camera = camera; camera_set(&goxel.camera, camera); } } } else if (strncmp(c.type, "IMG ", 4) == 0) { while ((chunk_read_dict_value(&c, in, dict_key, dict_value, &dict_value_size))) { if (strcmp(dict_key, "box") == 0) memcpy(&goxel.image->box, dict_value, dict_value_size); } } else { // Ignore other blocks. chunk_read(&c, in, NULL, c.length); } chunk_read_finish(&c, in); } // Free the block hash table. We do not delete the block data because // they have been used by the meshes. HASH_ITER(hh, blocks_table, data, data_tmp) { HASH_DEL(blocks_table, data); free(data->v); free(data); } goxel.image->path = strdup(path); goxel.image->saved_key = image_get_key(goxel.image); goxel_update_meshes(-1); fclose(in); // Update plane, snap mask and camera pos not to confuse people. plane_from_vectors(goxel.plane, goxel.image->box[3], VEC(1, 0, 0), VEC(0, 1, 0)); if (box_is_null(goxel.image->box)) goxel.snap_mask |= SNAP_PLANE; camera_fit_box(&goxel.camera, goxel.image->box); return 0; error: fclose(in); return -1; } static void action_open(const char *path) { if (!path) path = noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, "gox\0*.gox\0", NULL, NULL); if (!path) return; image_delete(goxel.image); goxel.image = image_new(); load_from_file(path); } ACTION_REGISTER(open, .help = "Open an image", .cfunc = action_open, .csig = "vp", .default_shortcut = "Ctrl O", ) static void save_as(const char *path, bool with_preview) { if (!path) { path = noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "gox\0*.gox\0", NULL, "untitled.gox"); if (!path) return; } if (path != goxel.image->path) { free(goxel.image->path); goxel.image->path = strdup(path); goxel.image->saved_key = image_get_key(goxel.image); } save_to_file(goxel.image->path, with_preview); } ACTION_REGISTER(save_as, .help = "Save the image as", .cfunc = save_as, .csig = "vpi", ) static void save(const char *path, bool with_preview) { save_as(path ?: goxel.image->path, with_preview); } ACTION_REGISTER(save, .help = "Save the image", .cfunc = save, .csig = "vpi", .default_shortcut = "Ctrl S" ) goxel-0.8.1/src/formats/png.c000066400000000000000000000026641334742672700160570ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" // XXX: this function has to be rewritten. static void export_as_png(const char *path, int w, int h) { uint8_t *buf; w = w ?: goxel.image->export_width; h = h ?: goxel.image->export_height; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "png\0*.png\0", NULL, "untitled.png"); if (!path) return; LOG_I("Exporting to file %s", path); buf = calloc(w * h, 4); goxel_render_to_buf(buf, w, h, 4); img_write(buf, w, h, 4, path); free(buf); } ACTION_REGISTER(export_as_png, .help = "Export the image as a png file", .cfunc = export_as_png, .csig = "vpii", .file_format = { .name = "png", .ext = "*.png\0", }, ) goxel-0.8.1/src/formats/png_slices.c000066400000000000000000000042211334742672700174100ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" static void export_as_png_slices(const char *path) { float box[4][4]; mesh_t *mesh; int x, y, z, w, h, d, pos[3], start_pos[3]; uint8_t c[4]; uint8_t *img; mesh_iterator_t iter = {0}; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "png\0*.png\0", NULL, "untitled.png"); if (!path) return; mesh = goxel.layers_mesh; mat4_copy(goxel.image->box, box); if (box_is_null(box)) mesh_get_box(mesh, true, box); w = box[0][0] * 2; h = box[1][1] * 2; d = box[2][2] * 2; start_pos[0] = box[3][0] - box[0][0]; start_pos[1] = box[3][1] - box[1][1]; start_pos[2] = box[3][2] - box[2][2]; img = calloc(w * h * d, 4); for (z = 0; z < d; z++) for (y = 0; y < h; y++) for (x = 0; x < w; x++) { pos[0] = x + start_pos[0]; pos[1] = y + start_pos[1]; pos[2] = z + start_pos[2]; mesh_get_at(mesh, &iter, pos, c); img[(y * w * d + z * w + x) * 4 + 0] = c[0]; img[(y * w * d + z * w + x) * 4 + 1] = c[1]; img[(y * w * d + z * w + x) * 4 + 2] = c[2]; img[(y * w * d + z * w + x) * 4 + 3] = c[3]; } img_write(img, w * d, h, 4, path); free(img); } ACTION_REGISTER(export_as_png_slices, .help = "Export the image as a png slices file", .cfunc = export_as_png_slices, .csig = "vp", .file_format = { .name = "png slices", .ext = "*.png\0", }, ) goxel-0.8.1/src/formats/povray.c000066400000000000000000000072251334742672700166110ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ // Povray export support. #include "goxel.h" static void export_as_pov(const char *path, int w, int h) { FILE *file; layer_t *layer; int size, p[3]; char *buf; const char *template; uint8_t v[4]; float modelview[4][4], light_dir[3]; mustache_t *m, *m_cam, *m_light, *m_voxels, *m_voxel; camera_t camera = goxel.camera; mesh_iterator_t iter; w = w ?: goxel.image->export_width; h = h ?: goxel.image->export_height; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "povray\0*.pov\0", NULL, "untitled.pov"); if (!path) return; template = assets_get("asset://data/other/povray_template.pov", NULL); assert(template); camera.aspect = (float)w / h; camera_update(&camera); mat4_copy(camera.view_mat, modelview); // cam_to_view = mat4_inverted(camera.view_mat); // cam_look_at = mat4_mul_vec(cam_to_view, vec4(0, 0, -1, 1)).xyz; render_get_light_dir(&goxel.rend, light_dir); m = mustache_root(); mustache_add_str(m, "version", GOXEL_VERSION_STR); m_cam = mustache_add_dict(m, "camera"); mustache_add_str(m_cam, "width", "%d", w); mustache_add_str(m_cam, "height", "%d", h); mustache_add_str(m_cam, "angle", "%.1f", camera.fovy * camera.aspect); mustache_add_str(m_cam, "modelview", "<%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f>", modelview[0][0], modelview[0][1], modelview[0][2], modelview[1][0], modelview[1][1], modelview[1][2], modelview[2][0], modelview[2][1], modelview[2][2], modelview[3][0], modelview[3][1], modelview[3][2]); m_light = mustache_add_dict(m, "light"); mustache_add_str(m_light, "ambient", "%.2f", goxel.rend.settings.ambient); mustache_add_str(m_light, "point_at", "<%.1f, %.1f, %.1f + 1024>", -light_dir[0], -light_dir[1], -light_dir[2]); m_voxels = mustache_add_list(m, "voxels"); DL_FOREACH(goxel.image->layers, layer) { iter = mesh_get_iterator(layer->mesh, MESH_ITER_VOXELS); while (mesh_iter(&iter, p)) { mesh_get_at(layer->mesh, &iter, p, v); if (v[3] < 127) continue; m_voxel = mustache_add_dict(m_voxels, NULL); mustache_add_str(m_voxel, "pos", "<%d, %d, %d>", p[0], p[1], p[2]); mustache_add_str(m_voxel, "color", "<%d, %d, %d>", v[0], v[1], v[2]); } } size = mustache_render(m, template, NULL); buf = calloc(size + 1, 1); mustache_render(m, template, buf); mustache_free(m); file = fopen(path, "wb"); fwrite(buf, 1, size, file); fclose(file); free(buf); } ACTION_REGISTER(export_as_pov, .help = "Save the image as a povray 3d file", .cfunc = export_as_pov, .csig = "vpii", .file_format = { .name = "povray", .ext = "*.povray\0", }, ) goxel-0.8.1/src/formats/qubicle.c000066400000000000000000000152071334742672700167140ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" // Load qubicle files. #define READ(type, file) \ ({ type v; size_t r = fread(&v, sizeof(v), 1, file); (void)r; v;}) #define WRITE(type, v, file) \ ({ type v_ = v; fwrite(&v_, sizeof(v_), 1, file);}) static void apply_orientation(int orientation, int pos[3]) { if (orientation == 1) {// Right SWAP(pos[1], pos[2]); } else { // Left SWAP(pos[1], pos[2]); pos[1] = -pos[1]; } } static void qubicle_import(const char *path) { FILE *file; int version, color_format, orientation, compression, vmask, mat_count; int i, j, r, index, len, w, h, d, pos[3], vpos[3], x, y, z, bbox[2][3]; union { uint8_t v[4]; uint32_t uint32; struct { uint8_t r, g, b, a; }; } v; const uint32_t CODEFLAG = 2; const uint32_t NEXTSLICEFLAG = 6; layer_t *layer; mesh_iterator_t iter = {0}; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, NULL, NULL, NULL); if (!path) return; file = fopen(path, "rb"); version = READ(uint32_t, file); (void)version; color_format = READ(uint32_t, file); (void)color_format; orientation = READ(uint32_t, file); compression = READ(uint32_t, file); vmask = READ(uint32_t, file); (void)vmask; mat_count = READ(uint32_t, file); for (i = 0; i < mat_count; i++) { layer = image_add_layer(goxel.image); iter = mesh_get_accessor(layer->mesh); memset(layer->name, 0, sizeof(layer->name)); len = READ(uint8_t, file); r = (int)fread(layer->name, len, 1, file); (void)r; w = READ(uint32_t, file); h = READ(uint32_t, file); d = READ(uint32_t, file); pos[0] = READ(int32_t, file); pos[1] = READ(int32_t, file); pos[2] = READ(int32_t, file); // Set the layer bounding box. vec3_set(bbox[0], pos[0], pos[1], pos[2]); vec3_set(bbox[1], pos[0] + w, pos[1] + h, pos[2] + d); apply_orientation(orientation, bbox[0]); apply_orientation(orientation, bbox[1]); bbox_from_aabb(layer->box, bbox); if (compression == 0) { for (index = 0; index < w * h * d; index++) { v.uint32 = READ(uint32_t, file); if (!v.a) continue; v.a = v.a ? 255 : 0; vpos[0] = pos[0] + index % w; vpos[1] = pos[1] + (index % (w * h)) / w; vpos[2] = pos[2] + index / (w * h); apply_orientation(orientation, vpos); mesh_set_at(layer->mesh, &iter, vpos, v.v); } } else { for (z = 0; z < d; z++) { index = 0; while (true) { v.uint32 = READ(uint32_t, file); if (v.uint32 == NEXTSLICEFLAG) { break; // Next z. } len = 1; if (v.uint32 == CODEFLAG) { len = READ(uint32_t, file); v.uint32 = READ(uint32_t, file); v.a = v.a ? 255 : 0; } for (j = 0; j < len; j++) { x = index % w; y = index / w; v.a = v.a ? 255 : 0; vpos[0] = pos[0] + x; vpos[1] = pos[1] + y; vpos[2] = pos[2] + z; apply_orientation(orientation, vpos); mesh_set_at(layer->mesh, &iter, vpos, v.v); index++; } } } } } goxel_update_meshes(-1); } static void qubicle_export(const image_t *img, const char *path) { FILE *file; int i, count, x, y, z, pos[3], bbox[2][3]; uint8_t v[4]; layer_t *layer; mesh_iterator_t iter; mesh_t *mesh; count = 0; DL_COUNT(img->layers, layer, count); file = fopen(path, "wb"); WRITE(uint32_t, 257, file); // version WRITE(uint32_t, 0, file); // color format RGBA WRITE(uint32_t, 1, file); // orientation right handed WRITE(uint32_t, 0, file); // no compression WRITE(uint32_t, 0, file); // vmask WRITE(uint32_t, count, file); i = 0; DL_FOREACH(img->layers, layer) { mesh = layer->mesh; if (!box_is_null(layer->box)) bbox_to_aabb(layer->box, bbox); else if (!mesh_get_bbox(mesh, bbox, true)) continue; WRITE(uint8_t, strlen(layer->name), file); fwrite(layer->name, strlen(layer->name), 1, file); WRITE(uint32_t, bbox[1][0] - bbox[0][0], file); WRITE(uint32_t, bbox[1][2] - bbox[0][2], file); WRITE(uint32_t, bbox[1][1] - bbox[0][1], file); WRITE(int32_t, bbox[0][0], file); WRITE(int32_t, bbox[0][2], file); WRITE(int32_t, bbox[0][1], file); iter = mesh_get_accessor(mesh); for (y = bbox[0][1]; y < bbox[1][1]; y++) for (z = bbox[0][2]; z < bbox[1][2]; z++) for (x = bbox[0][0]; x < bbox[1][0]; x++) { pos[0] = x; pos[1] = y; pos[2] = z; mesh_get_at(mesh, &iter, pos, v); fwrite(v, 4, 1, file); } i++; } fclose(file); } static void export_as_qubicle(const char *path) { path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "qubicle\0*.qb\0", NULL, "untitled.qb"); if (!path) return; qubicle_export(goxel.image, path); } ACTION_REGISTER(import_qubicle, .help = "Import a qubicle file", .cfunc = qubicle_import, .csig = "vp", .file_format = { .name = "qubicle", .ext = "*.qb\0", }, ) ACTION_REGISTER(export_as_qubicle, .help = "Save the image as a qubicle 3d file", .cfunc = export_as_qubicle, .csig = "vp", .file_format = { .name = "qubicle", .ext = "*.qb\0", }, ) goxel-0.8.1/src/formats/txt.c000066400000000000000000000032571334742672700161110ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" static void export_as_txt(const char *path) { FILE *out; mesh_t *mesh = goxel.layers_mesh; int p[3]; uint8_t v[4]; mesh_iterator_t iter; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "text\0*.txt\0", NULL, "untitled.txt"); if (!path) return; out = fopen(path, "w"); fprintf(out, "# Goxel " GOXEL_VERSION_STR "\n"); fprintf(out, "# One line per voxel\n"); fprintf(out, "# X Y Z RRGGBB\n"); iter = mesh_get_iterator(mesh, MESH_ITER_VOXELS); while (mesh_iter(&iter, p)) { mesh_get_at(mesh, &iter, p, v); if (v[3] < 127) continue; fprintf(out, "%d %d %d %02x%02x%02x\n", p[0], p[1], p[2], v[0], v[1], v[2]); } fclose(out); } ACTION_REGISTER(export_as_txt, .help = "Export the image as a txt file", .cfunc = export_as_txt, .csig = "vp", .file_format = { .name = "text", .ext = "*.txt\0", }, ) goxel-0.8.1/src/formats/vox.c000066400000000000000000000317701334742672700161070ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ // Magica voxel vox format support. #include "goxel.h" #include static const uint32_t VOX_DEFAULT_PALETTE[256]; static inline void hexcolor(uint32_t v, uint8_t out[4]) { out[0] = (v >> 24) & 0xff; out[1] = (v >> 16) & 0xff; out[2] = (v >> 8) & 0xff; out[3] = (v >> 0) & 0xff; } #define READ(type, file) \ ({ type v; size_t r = fread(&v, sizeof(v), 1, file); (void)r; v;}) #define WRITE(type, v, file) \ ({ type v_ = v; fwrite(&v_, sizeof(v_), 1, file);}) // Import the old magica voxel file format: // // d, h, w, , static void vox_import_old(const char *path) { FILE *file; int w, h, d, i; uint8_t *voxels; uint8_t (*palette)[4]; uint8_t (*cube)[4]; file = fopen(path, "rb"); d = READ(uint32_t, file); h = READ(uint32_t, file); w = READ(uint32_t, file); voxels = calloc(w * h * d, 1); palette = calloc(256, sizeof(*palette)); cube = calloc(w * h * d, sizeof(*cube)); for (i = 0; i < w * h * d; i++) { voxels[i] = READ(uint8_t, file); } for (i = 0; i < 256; i++) { palette[i][0] = READ(uint8_t, file); palette[i][1] = READ(uint8_t, file); palette[i][2] = READ(uint8_t, file); palette[i][3] = 255; } memset(palette[255], 0, 4); for (i = 0; i < w * h * d; i++) { if (voxels[i] == 255) continue; memcpy(cube[i], palette[voxels[i]], 4); } mesh_blit(goxel.image->active_layer->mesh, (uint8_t*)cube, -w / 2, -h / 2, -d / 2, w, h, d, NULL); free(palette); free(voxels); free(cube); fclose(file); goxel_update_meshes(-1); } typedef struct { int w, h, d; uint8_t (*palette)[4]; int nb; uint8_t *voxels; } context_t; static void read_chunk(FILE *file, context_t *ctx) { char id[4], r; int size, children_size, i; long fpos; r = fread(id, 1, 4, file); (void)r; size = READ(uint32_t, file); children_size = READ(uint32_t, file); if (strncmp(id, "SIZE", 4) == 0) { assert(size == 4 * 3); ctx->w = READ(uint32_t, file); ctx->h = READ(uint32_t, file); ctx->d = READ(uint32_t, file); } else if (strncmp(id, "RGBA", 4) == 0) { ctx->palette = malloc(4 * 256); for (i = 1; i < 256; i++) { ctx->palette[i][0] = READ(uint8_t, file); ctx->palette[i][1] = READ(uint8_t, file); ctx->palette[i][2] = READ(uint8_t, file); ctx->palette[i][3] = READ(uint8_t, file); } // Skip the last value! for (i = 0; i < 4; i++) READ(uint8_t, file); } else if (strncmp(id, "XYZI", 4) == 0) { ctx->nb = READ(uint32_t, file); ctx->voxels = calloc(ctx->nb, 4); for (i = 0; i < ctx->nb; i++) { ctx->voxels[i * 4 + 0] = READ(uint8_t, file); ctx->voxels[i * 4 + 1] = READ(uint8_t, file); ctx->voxels[i * 4 + 2] = READ(uint8_t, file); ctx->voxels[i * 4 + 3] = READ(uint8_t, file); } } else { fseek(file, size, SEEK_CUR); } fpos = ftell(file); while (ftell(file) < fpos + children_size) { read_chunk(file, ctx); } } static void vox_import(const char *path) { FILE *file; char magic[4]; int version, r, i, x, y, z, c, pos[3]; mesh_t *mesh; mesh_iterator_t iter = {0}; uint8_t color[4]; context_t ctx = {}; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, "vox\0*.vox\0", NULL, NULL); if (!path) return; mesh = goxel.image->active_layer->mesh; file = fopen(path, "rb"); r = fread(magic, 1, 4, file); (void)r; if (strncmp(magic, "VOX ", 4) != 0) { LOG_D("Old style magica voxel file"); fclose(file); vox_import_old(path); return; } assert(strncmp(magic, "VOX ", 4) == 0); version = READ(uint32_t, file); (void)version; read_chunk(file, &ctx); assert(ctx.voxels); for (i = 0; i < ctx.nb; i++) { x = ctx.voxels[i * 4 + 0]; y = ctx.voxels[i * 4 + 1]; z = ctx.voxels[i * 4 + 2]; c = ctx.voxels[i * 4 + 3]; pos[0] = x - ctx.w / 2; pos[1] = y - ctx.h / 2; pos[2] = z; if (!c) continue; // Not sure what c == 0 means. if (ctx.palette) memcpy(color, ctx.palette[c], 4); else hexcolor(VOX_DEFAULT_PALETTE[c], color); mesh_set_at(mesh, &iter, pos, color); } free(ctx.voxels); free(ctx.palette); mesh_remove_empty_blocks(mesh, false); goxel_update_meshes(-1); } static int get_color_index(uint8_t v[4], uint8_t (*palette)[4], bool exact) { const uint8_t *c; int i, dist, best = -1, best_dist = 1024; for (i = 1; i < 255; i++) { c = palette[i]; dist = abs((int)c[0] - (int)v[0]) + abs((int)c[1] - (int)v[1]) + abs((int)c[2] - (int)v[2]); if (dist == 0) return i; if (exact) continue; if (dist < best_dist) { best_dist = dist; best = i; } } return best; } static int voxel_cmp(const void *a_, const void *b_) { const uint8_t *a = a_; const uint8_t *b = b_; if (a[2] != b[2]) return cmp(a[2], b[2]); if (a[1] != b[1]) return cmp(a[1], b[1]); if (a[0] != b[0]) return cmp(a[0], b[0]); return 0; } static void vox_export(const mesh_t *mesh, const char *path) { FILE *file; int children_size, nb_vox = 0, i, pos[3]; int xmin = INT_MAX, ymin = INT_MAX, zmin = INT_MAX; int xmax = INT_MIN, ymax = INT_MIN, zmax = INT_MIN; uint8_t (*palette)[4]; bool use_default_palette = true; uint8_t *voxels; uint8_t v[4]; mesh_iterator_t iter; palette = calloc(256, sizeof(*palette)); for (i = 0; i < 256; i++) hexcolor(VOX_DEFAULT_PALETTE[i], palette[i]); // Iter all the voxels to get the count and the size. iter = mesh_get_iterator(mesh, MESH_ITER_VOXELS); while (mesh_iter(&iter, pos)) { mesh_get_at(mesh, &iter, pos, v); if (v[3] < 127) continue; v[3] = 255; use_default_palette = use_default_palette && get_color_index(v, palette, true) != -1; nb_vox++; xmin = min(xmin, pos[0]); ymin = min(ymin, pos[1]); zmin = min(zmin, pos[2]); xmax = max(xmax, pos[0] + 1); ymax = max(ymax, pos[1] + 1); zmax = max(zmax, pos[2] + 1); } if (!use_default_palette) quantization_gen_palette(mesh, 255, (void*)(palette + 1)); children_size = 12 + 4 * 3 + // SIZE chunk 12 + 4 + 4 * nb_vox + // XYZI chunk (use_default_palette ? 0 : (12 + 4 * 256)); // RGBA chunk. file = fopen(path, "wb"); fprintf(file, "VOX "); WRITE(uint32_t, 150, file); // Version fprintf(file, "MAIN"); WRITE(uint32_t, 0, file); // Main chunck size. WRITE(uint32_t, children_size, file); fprintf(file, "SIZE"); WRITE(uint32_t, 4 * 3, file); WRITE(uint32_t, 0, file); WRITE(uint32_t, xmax - xmin, file); WRITE(uint32_t, ymax - ymin, file); WRITE(uint32_t, zmax - zmin, file); fprintf(file, "XYZI"); WRITE(uint32_t, 4 * nb_vox + 4, file); WRITE(uint32_t, 0, file); WRITE(uint32_t, nb_vox, file); voxels = calloc(nb_vox, 4); i = 0; iter = mesh_get_iterator(mesh, MESH_ITER_VOXELS); while (mesh_iter(&iter, pos)) { mesh_get_at(mesh, &iter, pos, v); if (v[3] < 127) continue; pos[0] -= xmin; pos[1] -= ymin; pos[2] -= zmin; assert(pos[0] >= 0 && pos[0] < 255); assert(pos[1] >= 0 && pos[1] < 255); assert(pos[2] >= 0 && pos[2] < 255); voxels[i * 4 + 0] = pos[0]; voxels[i * 4 + 1] = pos[1]; voxels[i * 4 + 2] = pos[2]; voxels[i * 4 + 3] = get_color_index(v, palette, false); i++; } qsort(voxels, nb_vox, 4, voxel_cmp); for (i = 0; i < nb_vox; i++) fwrite(voxels + i * 4, 4, 1, file); free(voxels); if (!use_default_palette) { fprintf(file, "RGBA"); WRITE(uint32_t, 4 * 256, file); WRITE(uint32_t, 0, file); for (i = 1; i < 256; i++) { WRITE(uint8_t, palette[i][0], file); WRITE(uint8_t, palette[i][1], file); WRITE(uint8_t, palette[i][2], file); WRITE(uint8_t, palette[i][3], file); } WRITE(uint32_t, 0, file); } fclose(file); free(palette); } static void export_as_vox(const char *path) { path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "magica voxel\0*.vox\0", NULL, "untitled.vox"); if (!path) return; vox_export(goxel.layers_mesh, path); } ACTION_REGISTER(export_as_vox, .help = "Save the image as a vox 3d file", .cfunc = export_as_vox, .csig = "vp", .file_format = { .name = "magica voxel", .ext = "*.vox\0", }, ) ACTION_REGISTER(import_vox, .help = "Import a magica voxel vox image", .cfunc = vox_import, .csig = "vp", .file_format = { .name = "magica voxel", .ext = "*.vox\0", }, ) static const uint32_t VOX_DEFAULT_PALETTE[256] = { 0x00000000, 0xffffffff, 0xffffccff, 0xffff99ff, 0xffff66ff, 0xffff33ff, 0xffff00ff, 0xffccffff, 0xffccccff, 0xffcc99ff, 0xffcc66ff, 0xffcc33ff, 0xffcc00ff, 0xff99ffff, 0xff99ccff, 0xff9999ff, 0xff9966ff, 0xff9933ff, 0xff9900ff, 0xff66ffff, 0xff66ccff, 0xff6699ff, 0xff6666ff, 0xff6633ff, 0xff6600ff, 0xff33ffff, 0xff33ccff, 0xff3399ff, 0xff3366ff, 0xff3333ff, 0xff3300ff, 0xff00ffff, 0xff00ccff, 0xff0099ff, 0xff0066ff, 0xff0033ff, 0xff0000ff, 0xccffffff, 0xccffccff, 0xccff99ff, 0xccff66ff, 0xccff33ff, 0xccff00ff, 0xccccffff, 0xccccccff, 0xcccc99ff, 0xcccc66ff, 0xcccc33ff, 0xcccc00ff, 0xcc99ffff, 0xcc99ccff, 0xcc9999ff, 0xcc9966ff, 0xcc9933ff, 0xcc9900ff, 0xcc66ffff, 0xcc66ccff, 0xcc6699ff, 0xcc6666ff, 0xcc6633ff, 0xcc6600ff, 0xcc33ffff, 0xcc33ccff, 0xcc3399ff, 0xcc3366ff, 0xcc3333ff, 0xcc3300ff, 0xcc00ffff, 0xcc00ccff, 0xcc0099ff, 0xcc0066ff, 0xcc0033ff, 0xcc0000ff, 0x99ffffff, 0x99ffccff, 0x99ff99ff, 0x99ff66ff, 0x99ff33ff, 0x99ff00ff, 0x99ccffff, 0x99ccccff, 0x99cc99ff, 0x99cc66ff, 0x99cc33ff, 0x99cc00ff, 0x9999ffff, 0x9999ccff, 0x999999ff, 0x999966ff, 0x999933ff, 0x999900ff, 0x9966ffff, 0x9966ccff, 0x996699ff, 0x996666ff, 0x996633ff, 0x996600ff, 0x9933ffff, 0x9933ccff, 0x993399ff, 0x993366ff, 0x993333ff, 0x993300ff, 0x9900ffff, 0x9900ccff, 0x990099ff, 0x990066ff, 0x990033ff, 0x990000ff, 0x66ffffff, 0x66ffccff, 0x66ff99ff, 0x66ff66ff, 0x66ff33ff, 0x66ff00ff, 0x66ccffff, 0x66ccccff, 0x66cc99ff, 0x66cc66ff, 0x66cc33ff, 0x66cc00ff, 0x6699ffff, 0x6699ccff, 0x669999ff, 0x669966ff, 0x669933ff, 0x669900ff, 0x6666ffff, 0x6666ccff, 0x666699ff, 0x666666ff, 0x666633ff, 0x666600ff, 0x6633ffff, 0x6633ccff, 0x663399ff, 0x663366ff, 0x663333ff, 0x663300ff, 0x6600ffff, 0x6600ccff, 0x660099ff, 0x660066ff, 0x660033ff, 0x660000ff, 0x33ffffff, 0x33ffccff, 0x33ff99ff, 0x33ff66ff, 0x33ff33ff, 0x33ff00ff, 0x33ccffff, 0x33ccccff, 0x33cc99ff, 0x33cc66ff, 0x33cc33ff, 0x33cc00ff, 0x3399ffff, 0x3399ccff, 0x339999ff, 0x339966ff, 0x339933ff, 0x339900ff, 0x3366ffff, 0x3366ccff, 0x336699ff, 0x336666ff, 0x336633ff, 0x336600ff, 0x3333ffff, 0x3333ccff, 0x333399ff, 0x333366ff, 0x333333ff, 0x333300ff, 0x3300ffff, 0x3300ccff, 0x330099ff, 0x330066ff, 0x330033ff, 0x330000ff, 0x00ffffff, 0x00ffccff, 0x00ff99ff, 0x00ff66ff, 0x00ff33ff, 0x00ff00ff, 0x00ccffff, 0x00ccccff, 0x00cc99ff, 0x00cc66ff, 0x00cc33ff, 0x00cc00ff, 0x0099ffff, 0x0099ccff, 0x009999ff, 0x009966ff, 0x009933ff, 0x009900ff, 0x0066ffff, 0x0066ccff, 0x006699ff, 0x006666ff, 0x006633ff, 0x006600ff, 0x0033ffff, 0x0033ccff, 0x003399ff, 0x003366ff, 0x003333ff, 0x003300ff, 0x0000ffff, 0x0000ccff, 0x000099ff, 0x000066ff, 0x000033ff, 0xee0000ff, 0xdd0000ff, 0xbb0000ff, 0xaa0000ff, 0x880000ff, 0x770000ff, 0x550000ff, 0x440000ff, 0x220000ff, 0x110000ff, 0x00ee00ff, 0x00dd00ff, 0x00bb00ff, 0x00aa00ff, 0x008800ff, 0x007700ff, 0x005500ff, 0x004400ff, 0x002200ff, 0x001100ff, 0x0000eeff, 0x0000ddff, 0x0000bbff, 0x0000aaff, 0x000088ff, 0x000077ff, 0x000055ff, 0x000044ff, 0x000022ff, 0x000011ff, 0xeeeeeeff, 0xddddddff, 0xbbbbbbff, 0xaaaaaaff, 0x888888ff, 0x777777ff, 0x555555ff, 0x444444ff, 0x222222ff, 0x111111ff, }; goxel-0.8.1/src/formats/voxlap.c000066400000000000000000000153531334742672700166030ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #define READ(type, file) \ ({ type v; size_t r = fread(&v, sizeof(v), 1, file); (void)r; v;}) #define raise(msg) do { \ LOG_E(msg); \ ret = -1; \ goto end; \ } while (0) static inline int AT(int x, int y, int z, int w, int h, int d) { y = h - y - 1; z = d - z - 1; return x + y * w + z * w * h; } static void swap_color(uint32_t v, uint8_t ret[4]) { uint8_t o[4]; memcpy(o, &v, 4); ret[0] = o[2]; ret[1] = o[1]; ret[2] = o[0]; ret[3] = o[3]; } static int kv6_import(const char *path) { FILE *file; char magic[4]; int i, r, ret = 0, w, h, d, blklen, x, y, z = 0, nb, p = 0; uint32_t *xoffsets = NULL; uint16_t *xyoffsets = NULL; uint8_t (*cube)[4] = NULL; uint8_t color[4] = {0}; (void)r; struct { uint32_t color; uint8_t zpos; uint8_t visface; } *blocks = NULL; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, "kv6\0*.kv6\0", NULL, NULL); if (!path) return -1; file = fopen(path, "rb"); r = fread(magic, 1, 4, file); if (strncmp(magic, "Kvxl ", 4) != 0) raise("Invalid magic"); w = READ(uint32_t, file); h = READ(uint32_t, file); d = READ(uint32_t, file); cube = calloc(w * h * d, sizeof(*cube)); READ(float, file); READ(float, file); READ(float, file); blklen = READ(uint32_t, file); blocks = calloc(blklen, sizeof(*blocks)); for (i = 0; i < blklen; i++) { blocks[i].color = READ(uint32_t, file); blocks[i].zpos = READ(uint16_t, file); blocks[i].visface = READ(uint8_t, file); READ(uint8_t, file); // lighting } xoffsets = calloc(w, sizeof(*xoffsets)); xyoffsets = calloc(w * h, sizeof(*xyoffsets)); for (i = 0; i < w; i++) xoffsets[i] = READ(uint32_t, file); for (i = 0; i < w * h; i++) xyoffsets[i] = READ(uint16_t, file); for (x = 0; x < w; x++) for (y = 0; y < h; y++) { nb = xyoffsets[x * h + y]; for (i = 0; i < nb; i++, p++) { z = blocks[p].zpos; swap_color(blocks[p].color, cube[AT(x, y, z, w, h, d)]); } } // Fill p = 0; for (x = 0; x < w; x++) for (y = 0; y < h; y++) { nb = xyoffsets[x * h + y]; for (i = 0; i < nb; i++, p++) { if (blocks[p].visface & 0x10) { z = blocks[p].zpos; swap_color(blocks[p].color, color); color[3] = 255; } if (blocks[p].visface & 0x20) { for (; z < blocks[p].zpos; z++) if (cube[AT(x, y, z, w, h, d)][3] == 0) memcpy(cube[AT(x, y, z, w, h, d)], color, 4); } } } mesh_blit(goxel.image->active_layer->mesh, (const uint8_t*)cube, -w / 2, -h / 2, -d / 2, w, h, d, NULL); goxel_update_meshes(-1); end: free(cube); free(blocks); free(xoffsets); free(xyoffsets); fclose(file); return ret; } static int kvx_import(const char *path) { FILE *file; int i, r, ret = 0, nb, w, h, d, x, y, z, lastz = 0, len, visface; uint8_t color = 0; uint8_t (*palette)[4] = NULL; uint32_t *xoffsets = NULL; uint16_t *xyoffsets = NULL; uint8_t (*cube)[4] = NULL; long datpos; (void)r; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, "kvx\0*.kvx\0", NULL, NULL); if (!path) return -1; file = fopen(path, "rb"); nb = READ(uint32_t, file); (void)nb; w = READ(uint32_t, file); h = READ(uint32_t, file); d = READ(uint32_t, file); cube = calloc(w * h * d, sizeof(*cube)); READ(uint32_t, file); READ(uint32_t, file); READ(uint32_t, file); xoffsets = calloc(w + 1, sizeof(*xoffsets)); xyoffsets = calloc(w * (h + 1), sizeof(*xyoffsets)); for (i = 0; i < w + 1; i++) xoffsets[i] = READ(uint32_t, file); for (i = 0; i < w * (h + 1); i++) xyoffsets[i] = READ(uint16_t, file); datpos = ftell(file); // Read the palette at the end of the file first. fseek(file, -256 * 3, SEEK_END); palette = calloc(256, sizeof(*palette)); for (i = 0; i < 256; i++) { palette[i][0] = clamp(round(READ(uint8_t, file) * 255 / 63.f), 0, 255); palette[i][1] = clamp(round(READ(uint8_t, file) * 255 / 63.f), 0, 255); palette[i][2] = clamp(round(READ(uint8_t, file) * 255 / 63.f), 0, 255); palette[i][3] = 255; } fseek(file, datpos, SEEK_SET); for (x = 0; x < w; x++) for (y = 0; y < h; y++) { if (xyoffsets[x * (h + 1) + y + 1] < xyoffsets[x * (h + 1) + y]) raise("Invalid format"); nb = xyoffsets[x * (h + 1) + y + 1] - xyoffsets[x * (h + 1) + y]; while (nb > 0) { z = READ(uint8_t, file); len = READ(uint8_t, file); visface = READ(uint8_t, file); assert(z + len - 1 < d); for (i = 0; i < len; i++) { color = READ(uint8_t, file); memcpy(cube[AT(x, y, z + i, w, h, d)], palette[color], 4); } nb -= len + 3; // Fill if (visface & 0x10) lastz = z + len; if (visface & 0x20) { for (i = lastz; i < z; i++) if (cube[AT(x, y, i, w, h, d)][3] == 0) memcpy(cube[AT(x, y, i, w, h, d)], palette[color], 4); } } } mesh_blit(goxel.image->active_layer->mesh, (uint8_t*)cube, -w / 2, -h / 2, -d / 2, w, h, d, NULL); goxel_update_meshes(-1); end: free(palette); free(cube); free(xoffsets); free(xyoffsets); fclose(file); return ret; } ACTION_REGISTER(import_kv6, .help = "Import a slab kv6 image", .cfunc = kv6_import, .csig = "vp", .file_format = { .name = "kv6", .ext = "*.kv6\0" }, ) ACTION_REGISTER(import_kvx, .help = "Import a slab kvx image", .cfunc = kvx_import, .csig = "vp", .file_format = { .name = "kvx", .ext = "*.kvx\0" }, ) goxel-0.8.1/src/formats/vxl.c000066400000000000000000000207611334742672700161020ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ // Support for Ace of Spades map files (vxl) #include "goxel.h" #define READ(type, file) \ ({ type v; size_t r = fread(&v, sizeof(v), 1, file); (void)r; v;}) #define raise(msg) do { \ LOG_E(msg); \ ret = -1; \ goto end; \ } while (0) static inline int AT(int x, int y, int z) { x = 511 - x; z = 63 - z; return x + y * 512 + z * 512 * 512; } static void swap_color(uint32_t v, uint8_t ret[4]) { uint8_t o[4]; memcpy(o, &v, 4); ret[0] = o[2]; ret[1] = o[1]; ret[2] = o[0]; ret[3] = o[3]; } static int vxl_import(const char *path) { // The algo is based on // https://silverspaceship.com/aosmap/aos_file_format.html // From Sean Barrett (the same person that wrote the code used in // ext_src/stb!). int ret = 0, size; int w = 512, h = 512, d = 64, x, y, z; uint8_t (*cube)[4] = NULL; uint8_t *data, *v; uint32_t *color; int i; int number_4byte_chunks; int top_color_start; int top_color_end; int bottom_color_start; int bottom_color_end; // exclusive int len_top; int len_bottom; path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, "vxl\0*.vxl\0", NULL, NULL); if (!path) return -1; cube = calloc(w * h * d, sizeof(*cube)); data = (void*)read_file(path, &size); v = data; for (y = 0; y < h; y++) for (x = 0; x < w; x++) { for (z = 0; z < 64; z++) cube[AT(x, y, z)][3] = 255; z = 0; while (true) { number_4byte_chunks = v[0]; top_color_start = v[1]; top_color_end = v[2]; for (i = z; i < top_color_start; i++) cube[AT(x, y, i)][3] = 0; color = (uint32_t*)(v + 4); for (z = top_color_start; z <= top_color_end; z++) { CHECK(z >= 0 && z < d); swap_color(*color++, cube[AT(x, y, z)]); } len_bottom = top_color_end - top_color_start + 1; // check for end of data marker if (number_4byte_chunks == 0) { // infer ACTUAL number of 4-byte chunks from the length of the // color data v += 4 * (len_bottom + 1); break; } // infer the number of bottom colors in next span from chunk length len_top = (number_4byte_chunks-1) - len_bottom; // now skip the v pointer past the data to the beginning of the // next span v += v[0] * 4; bottom_color_end = v[3]; // aka air start bottom_color_start = bottom_color_end - len_top; for(z = bottom_color_start; z < bottom_color_end; z++) swap_color(*color++, cube[AT(x, y, z)]); } } mesh_blit(goxel.image->active_layer->mesh, (uint8_t*)cube, -w / 2, -h / 2, -d / 2, w, h, d, NULL); goxel_update_meshes(-1); if (box_is_null(goxel.image->box)) { bbox_from_extents(goxel.image->box, vec3_zero, w / 2, h / 2, d / 2); } free(cube); free(data); return ret; } static int is_surface(int x, int y, int z, uint8_t map[512][512][64]) { if (map[x][y][z]==0) return 0; if (x > 0 && map[x-1][y][z]==0) return 1; if (x+1 < 512 && map[x+1][y][z]==0) return 1; if (y > 0 && map[x][y-1][z]==0) return 1; if (y+1 < 512 && map[x][y+1][z]==0) return 1; if (z > 0 && map[x][y][z-1]==0) return 1; if (z+1 < 64 && map[x][y][z+1]==0) return 1; return 0; } static void write_color(FILE *f, uint32_t color) { uint8_t c[4]; memcpy(c, &color, 4); fputc(c[2], f); fputc(c[1], f); fputc(c[0], f); fputc(c[3], f); } #define MAP_Z 64 void write_map(const char *filename, uint8_t map[512][512][64], uint32_t color[512][512][64]) { int i,j,k; FILE *f = fopen(filename, "wb"); for (j = 0; j < 512; ++j) { for (i=0; i < 512; ++i) { k = 0; while (k < MAP_Z) { int z; int air_start; int top_colors_start; int top_colors_end; // exclusive int bottom_colors_start; int bottom_colors_end; // exclusive int top_colors_len; int bottom_colors_len; int colors; // find the air region air_start = k; while (k < MAP_Z && !map[i][j][k]) ++k; // find the top region top_colors_start = k; while (k < MAP_Z && is_surface(i,j,k,map)) ++k; top_colors_end = k; // now skip past the solid voxels while (k < MAP_Z && map[i][j][k] && !is_surface(i,j,k,map)) ++k; // at the end of the solid voxels, we have colored voxels. // in the "normal" case they're bottom colors; but it's // possible to have air-color-solid-color-solid-color-air, // which we encode as air-color-solid-0, 0-color-solid-air // so figure out if we have any bottom colors at this point bottom_colors_start = k; z = k; while (z < MAP_Z && is_surface(i,j,z,map)) ++z; if (z == MAP_Z || 0) ; // in this case, the bottom colors of this span are // empty, because we'l emit as top colors else { // otherwise, these are real bottom colors so we can write // them while (is_surface(i,j,k,map)) ++k; } bottom_colors_end = k; // now we're ready to write a span top_colors_len = top_colors_end - top_colors_start; bottom_colors_len = bottom_colors_end - bottom_colors_start; colors = top_colors_len + bottom_colors_len; if (k == MAP_Z) fputc(0,f); // last span else fputc(colors+1, f); fputc(top_colors_start, f); fputc(top_colors_end-1, f); fputc(air_start, f); for (z=0; z < top_colors_len; ++z) write_color(f, color[i][j][top_colors_start + z]); for (z=0; z < bottom_colors_len; ++z) write_color(f, color[i][j][bottom_colors_start + z]); } } } fclose(f); } static void export_as_vxl(const char *path) { uint8_t (*map)[512][512][64]; uint32_t (*color)[512][512][64]; const mesh_t *mesh = goxel.layers_mesh; mesh_iterator_t iter = {0}; uint8_t c[4]; int x, y, z, pos[3]; map = calloc(1, sizeof(*map)); color = calloc(1, sizeof(*color)); path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "vxl\0*.vxl\0", NULL, "untitled.vxl"); if (!path) return; for (z = 0; z < 64; z++) for (y = 0; y < 512; y++) for (x = 0; x < 512; x++) { pos[0] = 256 - x; pos[1] = y - 256; pos[2] = 31 - z; mesh_get_at(mesh, &iter, pos, c); if (c[3] <= 127) continue; (*map)[x][y][z] = 1; memcpy(&((*color)[x][y][z]), c, 4); } write_map(path, *map, *color); free(map); free(color); } ACTION_REGISTER(import_vxl, .help = "Import a Ace of Spades map file", .cfunc = vxl_import, .csig = "vp", .file_format = { .name = "vxl", .ext = "*.vxl\0" }, ) ACTION_REGISTER(export_as_vxl, .help = "Export the image as a Spades map file", .cfunc = export_as_vxl, .csig = "vp", .file_format = { .name = "vxl", .ext = "*.vxl\0", }, ) goxel-0.8.1/src/formats/wavefront.c000066400000000000000000000201731334742672700173010ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { union { struct { float v[3]; uint8_t c[3]; }; float vn[3]; struct { int vs[4]; int vns[4]; }; }; } line_t; static UT_icd line_icd = {sizeof(line_t), NULL, NULL, NULL}; static int lines_find(UT_array *lines, const line_t *line, int search_nb) { int i, len; line_t *l; len = utarray_len(lines); for (i = len - 1; (i >= 0) && (i > len - 1 - search_nb); i--) { l = (line_t*)utarray_eltptr(lines, i); if (memcmp(l, line, sizeof(*line)) == 0) return i + 1; } return 0; } /* * Function: lines_add * Add a line entry into a list and return its index. * * Parameters: * lines - The list. * line - The new line we want to add. * search_nb - How far into the list we search for a similar line. If * a similar line is found we just return its index insead * of adding a new one. */ static int lines_add(UT_array *lines, const line_t *line, int search_nb) { int idx; idx = lines_find(lines, line, search_nb); if (idx) return idx; utarray_push_back(lines, line); return utarray_len(lines); } static void export(const mesh_t *mesh, const char *path, bool ply) { // XXX: Merge faces that can be merged into bigger ones. // Allow to chose between quads or triangles. // Also export mlt file for the colors. voxel_vertex_t* verts; float v[3]; uint8_t c[3]; int nb_elems, i, j, bpos[3]; float mat[4][4]; FILE *out; const int N = BLOCK_SIZE; int size = 0, subdivide; UT_array *lines_f, *lines_v, *lines_vn; line_t line, face, *line_ptr = NULL; mesh_iterator_t iter; utarray_new(lines_f, &line_icd); utarray_new(lines_v, &line_icd); utarray_new(lines_vn, &line_icd); verts = calloc(N * N * N * 6 * 4, sizeof(*verts)); face = (line_t){}; iter = mesh_get_iterator(mesh, MESH_ITER_BLOCKS | MESH_ITER_INCLUDES_NEIGHBORS); while (mesh_iter(&iter, bpos)) { mat4_set_identity(mat); mat4_itranslate(mat, bpos[0], bpos[1], bpos[2]); nb_elems = mesh_generate_vertices(mesh, bpos, goxel.rend.settings.effects, verts, &size, &subdivide); for (i = 0; i < nb_elems; i++) { // Put the vertices. for (j = 0; j < size; j++) { v[0] = verts[i * size + j].pos[0] / (float)subdivide; v[1] = verts[i * size + j].pos[1] / (float)subdivide; v[2] = verts[i * size + j].pos[2] / (float)subdivide; mat4_mul_vec3(mat, v, v); memcpy(c, verts[i * size + j].color, 3); line = (line_t){ .v = {v[0], v[1], v[2]}, .c = {c[0], c[1], c[2]}}; // XXX: not sure about the search nb value to use here. face.vs[j] = lines_add(lines_v, &line, 1024); } // Put the normals for (j = 0; j < size; j++) { v[0] = verts[i * size + j].normal[0]; v[1] = verts[i * size + j].normal[1]; v[2] = verts[i * size + j].normal[2]; line = (line_t){.vn = {v[0], v[1], v[2]}}; face.vns[j] = lines_add(lines_vn, &line, 512); } lines_add(lines_f, &face, 0); } } out = fopen(path, "w"); if (ply) { fprintf(out, "ply\n"); fprintf(out, "format ascii 1.0\n"); fprintf(out, "comment Generated from Goxel " GOXEL_VERSION_STR "\n"); fprintf(out, "element vertex %d\n", utarray_len(lines_v)); fprintf(out, "property float x\n"); fprintf(out, "property float y\n"); fprintf(out, "property float z\n"); fprintf(out, "property uchar red\n"); fprintf(out, "property uchar green\n"); fprintf(out, "property uchar blue\n"); fprintf(out, "element face %d\n", utarray_len(lines_f)); fprintf(out, "property list uchar int vertex_index\n"); fprintf(out, "end_header\n"); while( (line_ptr = (line_t*)utarray_next(lines_v, line_ptr))) { fprintf(out, "%g %g %g %d %d %d\n", line_ptr->v[0], line_ptr->v[1], line_ptr->v[2], line_ptr->c[0], line_ptr->c[1], line_ptr->c[2]); } while( (line_ptr = (line_t*)utarray_next(lines_f, line_ptr))) { if (size == 4) { fprintf(out, "4 %d %d %d %d\n", line_ptr->vs[0] - 1, line_ptr->vs[1] - 1, line_ptr->vs[2] - 1, line_ptr->vs[3] - 1); } else { fprintf(out, "3 %d %d %d\n", line_ptr->vs[0] - 1, line_ptr->vs[1] - 1, line_ptr->vs[2] - 1); } } } else { fprintf(out, "# Goxel " GOXEL_VERSION_STR "\n"); while( (line_ptr = (line_t*)utarray_next(lines_v, line_ptr))) { fprintf(out, "v %g %g %g %f %f %f\n", line_ptr->v[0], line_ptr->v[1], line_ptr->v[2], line_ptr->c[0] / 255., line_ptr->c[1] / 255., line_ptr->c[2] / 255.); } while( (line_ptr = (line_t*)utarray_next(lines_vn, line_ptr))) { fprintf(out, "vn %g %g %g\n", line_ptr->vn[0], line_ptr->vn[1], line_ptr->vn[2]); } while( (line_ptr = (line_t*)utarray_next(lines_f, line_ptr))) { if (size == 4) { fprintf(out, "f %d//%d %d//%d %d//%d %d//%d\n", line_ptr->vs[0], line_ptr->vns[0], line_ptr->vs[1], line_ptr->vns[1], line_ptr->vs[2], line_ptr->vns[2], line_ptr->vs[3], line_ptr->vns[3]); } else { fprintf(out, "f %d//%d %d//%d %d//%d\n", line_ptr->vs[0], line_ptr->vns[0], line_ptr->vs[1], line_ptr->vns[1], line_ptr->vs[2], line_ptr->vns[2]); } } } fclose(out); utarray_free(lines_f); utarray_free(lines_v); utarray_free(lines_vn); free(verts); } void wavefront_export(const mesh_t *mesh, const char *path) { export(mesh, path, false); } void ply_export(const mesh_t *mesh, const char *path) { export(mesh, path, true); } static void export_as_obj(const char *path) { path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "obj\0*.obj\0", NULL, "untitled.obj"); if (!path) return; wavefront_export(goxel.layers_mesh, path); } ACTION_REGISTER(export_as_obj, .help = "Export the image as a wavefront obj file", .cfunc = export_as_obj, .csig = "vp", .file_format = { .name = "obj", .ext = "*.obj\0", }, ) static void export_as_ply(const char *path) { path = path ?: noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "ply\0*.ply\0", NULL, "untitled.ply"); if (!path) return; ply_export(goxel.layers_mesh, path); } ACTION_REGISTER(export_as_ply, .help = "Save the image as a ply file", .cfunc = export_as_ply, .csig = "vp", .file_format = { .name = "ply", .ext = "*.ply\0", }, ) goxel-0.8.1/src/gesture.c000066400000000000000000000154431334742672700152750ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" // Still experimental gestures manager. // XXX: this value should be set depending on the screen resolution. static float g_start_dist = 8; static bool rect_contains(const float rect[4], const float pos[2]) { return pos[0] >= rect[0] && pos[0] < rect[0] + rect[2] && pos[1] >= rect[1] && pos[1] < rect[1] + rect[3]; } static float get_angle(const float a0[2], const float a1[2], const float b0[2], const float b1[2]) { float u[2], v[2], dot, det; vec2_sub(a1, a0, u); vec2_normalize(u, u); vec2_sub(b1, b0, v); vec2_normalize(v, v); dot = vec2_dot(u, v); det = vec2_cross(u, v); return atan2(det, dot); } static int update(gesture_t *gest, const inputs_t *inputs, int mask) { const touch_t *ts = inputs->touches; int nb_ts = 0; int i, j; for (i = 0; i < ARRAY_SIZE(inputs->touches); i++) { for (j = 0; j < ARRAY_SIZE(inputs->touches[i].down); j++) { if (ts[i].down[j]) { nb_ts++; break; } } } if (gest->type == GESTURE_DRAG) { switch (gest->state) { case GESTURE_POSSIBLE: if (nb_ts == 1 && ts[0].down[gest->button]) { vec2_copy(ts[0].pos, gest->start_pos[0]); vec2_copy(gest->start_pos[0], gest->pos); if (!rect_contains(gest->viewport, gest->pos)) { gest->state = GESTURE_FAILED; break; } gest->state = (mask & (GESTURE_CLICK | GESTURE_PINCH)) ? GESTURE_RECOGNISED : GESTURE_BEGIN; } break; case GESTURE_RECOGNISED: if (vec2_dist(gest->start_pos[0], ts[0].pos) >= g_start_dist) gest->state = GESTURE_BEGIN; if (nb_ts == 0) { gest->state = (!(mask & GESTURE_CLICK)) ? GESTURE_BEGIN : GESTURE_FAILED; } if (nb_ts > 1) gest->state = GESTURE_FAILED; break; case GESTURE_BEGIN: case GESTURE_UPDATE: vec2_copy(ts[0].pos, gest->pos); gest->state = GESTURE_UPDATE; if (!ts[0].down[gest->button]) gest->state = GESTURE_END; break; } } if (gest->type == GESTURE_CLICK) { vec2_copy(ts[0].pos, gest->pos); switch (gest->state) { case GESTURE_POSSIBLE: if (ts[0].down[gest->button]) { vec2_copy(ts[0].pos, gest->start_pos[0]); gest->state = GESTURE_RECOGNISED; } break; case GESTURE_RECOGNISED: if (!ts[0].down[gest->button]) gest->state = GESTURE_TRIGGERED; break; } } if (gest->type == GESTURE_PINCH) { switch (gest->state) { case GESTURE_POSSIBLE: if (ts[0].down[0] && ts[1].down[0]) { gest->state = GESTURE_BEGIN; vec2_copy(ts[0].pos, gest->start_pos[0]); vec2_copy(ts[1].pos, gest->start_pos[1]); gest->pinch = 1; gest->rotation = 0; vec2_mix(ts[0].pos, ts[1].pos, 0.5, gest->pos); } break; case GESTURE_BEGIN: case GESTURE_UPDATE: gest->state = GESTURE_UPDATE; gest->pinch = vec2_dist(ts[0].pos, ts[1].pos) / vec2_dist(gest->start_pos[0], gest->start_pos[1]); gest->rotation = get_angle(gest->start_pos[0], gest->start_pos[1], ts[0].pos, ts[1].pos); vec2_mix(ts[0].pos, ts[1].pos, 0.5, gest->pos); if (!ts[0].down[0] || !ts[1].down[0]) gest->state = GESTURE_END; break; } } if (gest->type == GESTURE_HOVER) { switch (gest->state) { case GESTURE_POSSIBLE: if (DEFINED(GOXEL_MOBILE)) break; //Workaround. if (nb_ts == 0) { vec2_copy(ts[0].pos, gest->pos); if (rect_contains(gest->viewport, gest->pos)) { gest->state = GESTURE_BEGIN; } } break; case GESTURE_BEGIN: case GESTURE_UPDATE: vec2_copy(ts[0].pos, gest->pos); gest->state = rect_contains(gest->viewport, gest->pos) ? GESTURE_UPDATE : GESTURE_END; break; } } return 0; } int gesture_update(int nb, gesture_t *gestures[], const inputs_t *inputs, const float viewport[4], void *user) { int i, j, mask = 0; bool allup = true; // Set if all the mouse buttons are up. gesture_t *gest, *triggered = NULL; for (i = 0; allup && i < ARRAY_SIZE(inputs->touches); i++) { for (j = 0; allup && j < ARRAY_SIZE(inputs->touches[i].down); j++) { if (inputs->touches[i].down[j]) { allup = false; break; } } } for (i = 0; i < nb; i++) { gest = gestures[i]; if (gest->state == GESTURE_POSSIBLE) mask |= gest->type; } for (i = 0; i < nb; i++) { gest = gestures[i]; vec4_copy(viewport, gest->viewport); if ((gest->state == GESTURE_FAILED) && allup) { gest->state = GESTURE_POSSIBLE; } if (gest->state == GESTURE_END || gest->state == GESTURE_TRIGGERED) gest->state = GESTURE_POSSIBLE; update(gest, inputs, mask); if ( gest->state == GESTURE_BEGIN || gest->state == GESTURE_UPDATE || gest->state == GESTURE_END || gest->state == GESTURE_TRIGGERED) { gest->callback(gest, user); triggered = gest; break; } } // If one gesture started, fail all the other gestures. if (triggered && triggered->state == GESTURE_BEGIN) { for (i = 0; i < nb; i++) { gest = gestures[i]; if (gest != triggered) gest->state = GESTURE_FAILED; } } return triggered ? 1 : 0; } goxel-0.8.1/src/gesture3d.c000066400000000000000000000051261334742672700155210ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" int gesture3d(gesture3d_t *gest, cursor_t *curs, void *user) { bool pressed = curs->flags & CURSOR_PRESSED; int r, ret = 0; const int btns_mask = CURSOR_CTRL; gest->cursor = curs; if (gest->state == GESTURE_FAILED && !pressed) gest->state = GESTURE_POSSIBLE; if (gest->type == GESTURE_DRAG) { switch (gest->state) { case GESTURE_POSSIBLE: if ((gest->buttons & btns_mask) != (curs->flags & btns_mask)) break; if (curs->snaped && pressed) gest->state = GESTURE_BEGIN; break; case GESTURE_BEGIN: case GESTURE_UPDATE: gest->state = GESTURE_UPDATE; if (!pressed) gest->state = GESTURE_END; break; } } if (gest->type == GESTURE_HOVER) { switch (gest->state) { case GESTURE_POSSIBLE: if ((gest->buttons & btns_mask) != (curs->flags & btns_mask)) break; if (curs->snaped && !pressed && !(curs->flags & CURSOR_OUT)) gest->state = GESTURE_BEGIN; break; case GESTURE_BEGIN: case GESTURE_UPDATE: gest->state = GESTURE_UPDATE; if ((gest->buttons & btns_mask) != (curs->flags & btns_mask)) gest->state = GESTURE_END; if (pressed) gest->state = GESTURE_END; if (curs->flags & CURSOR_OUT) gest->state = GESTURE_END; break; } } if ( gest->state == GESTURE_BEGIN || gest->state == GESTURE_UPDATE || gest->state == GESTURE_END) { r = gest->callback(gest, user); if (r == GESTURE_FAILED) { gest->state = GESTURE_FAILED; ret = 0; } else { ret = gest->state; } } if (gest->state == GESTURE_END) gest->state = GESTURE_POSSIBLE; return ret; } goxel-0.8.1/src/glew-mx.h000066400000000000000000000024671334742672700152060ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is only here to be included by cycles ! */ #define GL_GLEXT_PROTOTYPES #ifdef WIN32 # include # include "GL/glew.h" #endif #ifdef __APPLE__ # include "TargetConditionals.h" # if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR # define GLES2 1 # include # include # else # include # endif #else # ifdef GLES2 # include # include # else # include # endif #endif #ifndef GLEW_VERSION_1_5 # define GLEW_VERSION_1_5 0 #endif goxel-0.8.1/src/goxel.c000066400000000000000000001061301334742672700147270ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include // The global goxel instance. goxel_t goxel = {}; static void unpack_pos_data(uint32_t v, int pos[3], int *face, int *cube_id) { assert(BLOCK_SIZE == 16); int x, y, z, f, i; x = v >> 28; y = (v >> 24) & 0x0f; z = (v >> 20) & 0x0f; f = (v >> 16) & 0x0f; i = v & 0xffff; assert(f < 6); pos[0] = x; pos[1] = y; pos[2] = z; *face = f; *cube_id = i; } // XXX: can we merge this with unproject? static bool unproject_delta(const float win[3], const float model[4][4], const float proj[4][4], const float viewport[4], float out[3]) { float inv[4][4], norm_pos[4]; mat4_mul(proj, model, inv); if (!mat4_invert(inv, inv)) { vec3_copy(vec3_zero, out); return false; } vec4_set(norm_pos, win[0] / viewport[2], win[1] / viewport[3], 0, 0); mat4_mul_vec4(inv, norm_pos, norm_pos); vec3_copy(norm_pos, out); return true; } // Conveniance function to add a char in the inputs. void inputs_insert_char(inputs_t *inputs, uint32_t c) { int i; if (c > 0 && c < 0x10000) { for (i = 0; i < ARRAY_SIZE(inputs->chars); i++) { if (!inputs->chars[i]) { inputs->chars[i] = c; break; } } } } // XXX: lot of cleanup to do here. static bool goxel_unproject_on_plane( const float viewport[4], const float pos[2], const float plane[4][4], float out[3], float normal[3]) { // If the angle between the screen and the plane is close to 90 deg, // the projection fails. This prevents projecting too far away. const float min_angle_cos = 0.1; // XXX: pos should already be in windows coordinates. float wpos[3] = {pos[0], pos[1], 0}; float opos[3], onorm[3]; camera_get_ray(&goxel.camera, wpos, viewport, opos, onorm); if (fabs(vec3_dot(onorm, plane[2])) <= min_angle_cos) return false; if (!plane_line_intersection(plane, opos, onorm, out)) return false; mat4_mul_vec3(plane, out, out); vec3_copy(plane[2], normal); return true; } static bool goxel_unproject_on_box( const float viewport[4], const float pos[2], const float box[4][4], bool inside, float out[3], float normal[3], int *face) { int f; float wpos[3] = {pos[0], pos[1], 0}; float opos[3], onorm[3]; float plane[4][4]; if (box_is_null(box)) return false; camera_get_ray(&goxel.camera, wpos, viewport, opos, onorm); for (f = 0; f < 6; f++) { mat4_copy(box, plane); mat4_imul(plane, FACES_MATS[f]); if (!inside && vec3_dot(plane[2], onorm) >= 0) continue; if (inside && vec3_dot(plane[2], onorm) <= 0) continue; if (!plane_line_intersection(plane, opos, onorm, out)) continue; if (!(out[0] >= -1 && out[0] < 1 && out[1] >= -1 && out[1] < 1)) continue; if (face) *face = f; mat4_mul_vec3(plane, out, out); vec3_normalize(plane[2], normal); if (inside) vec3_imul(normal, -1); return true; } return false; } static bool goxel_unproject_on_mesh( const float view[4], const float pos[2], mesh_t *mesh, float out[3], float normal[3]) { float view_size[2] = {view[2], view[3]}; // XXX: No need to render the fbo if it is not dirty. if (goxel.pick_fbo && !vec2_equal( VEC(goxel.pick_fbo->w, goxel.pick_fbo->h), view_size)) { texture_delete(goxel.pick_fbo); goxel.pick_fbo = NULL; } if (!goxel.pick_fbo) { goxel.pick_fbo = texture_new_buffer( view_size[0], view_size[1], TF_DEPTH); } renderer_t rend = {.settings = goxel.rend.settings}; mat4_copy(goxel.rend.view_mat, rend.view_mat); mat4_copy(goxel.rend.proj_mat, rend.proj_mat); uint32_t pixel; int voxel_pos[3]; int face, block_id, block_pos[3]; int x, y; int rect[4] = {0, 0, view_size[0], view_size[1]}; uint8_t clear_color[4] = {0, 0, 0, 0}; rend.settings.shadow = 0; rend.fbo = goxel.pick_fbo->framebuffer; rend.scale = 1; render_mesh(&rend, mesh, EFFECT_RENDER_POS); render_submit(&rend, rect, clear_color); x = round(pos[0] - view[0]); y = round(pos[1] - view[1]); GL(glViewport(0, 0, goxel.pick_fbo->w, goxel.pick_fbo->h)); if (x < 0 || x >= view_size[0] || y < 0 || y >= view_size[1]) return false; GL(glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel)); unpack_pos_data(pixel, voxel_pos, &face, &block_id); if (!block_id) return false; render_get_block_pos(&rend, mesh, block_id, block_pos); out[0] = block_pos[0] + voxel_pos[0] + 0.5; out[1] = block_pos[1] + voxel_pos[1] + 0.5; out[2] = block_pos[2] + voxel_pos[2] + 0.5; normal[0] = FACES_NORMALS[face][0]; normal[1] = FACES_NORMALS[face][1]; normal[2] = FACES_NORMALS[face][2]; vec3_iaddk(out, normal, 0.5); return true; } int goxel_unproject(const float viewport[4], const float pos[2], int snap_mask, float offset, float out[3], float normal[3]) { int i, ret = 0; bool r = false; float dist, best = INFINITY; float v[3], p[3] = {}, n[3] = {}, box[4][4]; // If tool_plane is set, we specifically use it. if (!plane_is_null(goxel.tool_plane)) { r = goxel_unproject_on_plane(viewport, pos, goxel.tool_plane, out, normal); ret = r ? SNAP_PLANE : 0; goto end; } for (i = 0; i < 7; i++) { if (!(snap_mask & (1 << i))) continue; if ((1 << i) == SNAP_MESH) { r = goxel_unproject_on_mesh(viewport, pos, goxel.layers_mesh, p, n); } if ((1 << i) == SNAP_PLANE) r = goxel_unproject_on_plane(viewport, pos, goxel.plane, p, n); if ((1 << i) == SNAP_SELECTION_IN) r = goxel_unproject_on_box(viewport, pos, goxel.selection, true, p, n, NULL); if ((1 << i) == SNAP_SELECTION_OUT) r = goxel_unproject_on_box(viewport, pos, goxel.selection, false, p, n, NULL); if ((1 << i) == SNAP_LAYER_OUT) { mesh_get_box(goxel.image->active_layer->mesh, true, box); r = goxel_unproject_on_box(viewport, pos, box, false, p, n, NULL); } if ((1 << i) == SNAP_IMAGE_BOX) r = goxel_unproject_on_box(viewport, pos, goxel.image->box, true, p, n, NULL); if ((1 << i) == SNAP_IMAGE_BOX) r = goxel_unproject_on_box(viewport, pos, goxel.image->box, true, p, n, NULL); if ((1 << i) == SNAP_CAMERA) { camera_get_ray(&goxel.camera, pos, viewport, p, n); r = true; } if (!r) continue; mat4_mul_vec3(goxel.camera.view_mat, p, v); dist = -v[2]; if (dist < 0 || dist > best) continue; vec3_copy(p, out); vec3_copy(n, normal); ret = 1 << i; if ((1 << i) == SNAP_IMAGE_BOX) { best = dist; continue; } break; } end: if (ret && offset) vec3_iaddk(out, normal, offset); if (ret && (snap_mask & SNAP_ROUNDED)) { out[0] = round(out[0] - 0.5) + 0.5; out[1] = round(out[1] - 0.5) + 0.5; out[2] = round(out[2] - 0.5) + 0.5; } return ret; } static int on_drag(const gesture_t *gest, void *user); static int on_pan(const gesture_t *gest, void *user); static int on_rotate(const gesture_t *gest, void *user); static int on_hover(const gesture_t *gest, void *user); static int on_pinch(const gesture_t *gest, void *user); KEEPALIVE void goxel_init(void) { render_init(); shapes_init(); sound_init(); cycles_init(); model3d_init(); goxel.layers_mesh = mesh_new(); goxel.render_mesh = mesh_new(); // Load and set default palette. palette_load_all(&goxel.palettes); DL_FOREACH(goxel.palettes, goxel.palette) { if (strcmp(goxel.palette->name, "DB32") == 0) break; } goxel.palette = goxel.palette ?: goxel.palettes; goxel.gestures.drag = (gesture_t) { .type = GESTURE_DRAG, .button = 0, .callback = on_drag, }; goxel.gestures.pan = (gesture_t) { .type = GESTURE_DRAG, .button = 2, .callback = on_pan, }; goxel.gestures.rotate = (gesture_t) { .type = GESTURE_DRAG, .button = 1, .callback = on_rotate, }; goxel.gestures.hover = (gesture_t) { .type = GESTURE_HOVER, .callback = on_hover, }; goxel.gestures.pinch = (gesture_t) { .type = GESTURE_PINCH, .callback = on_pinch, }; goxel_reset(); } void goxel_reset(void) { image_delete(goxel.image); goxel.image = image_new(); quat_set_identity(goxel.camera.rot); goxel.camera.dist = 128; goxel.camera.aspect = 1; quat_irotate(goxel.camera.rot, -M_PI / 4, 1, 0, 0); quat_irotate(goxel.camera.rot, -M_PI / 4, 0, 0, 1); action_exec2("settings_load", ""); camera_fit_box(&goxel.camera, goxel.image->box); // Put plane horizontal at the origin. plane_from_vectors(goxel.plane, VEC(0, 0, 0), VEC(1, 0, 0), VEC(0, 1, 0)); vec4_set(goxel.back_color, 70, 70, 70, 255); vec4_set(goxel.grid_color, 19, 19, 19, 255); vec4_set(goxel.image_box_color, 204, 204, 255, 255); goxel_update_meshes(-1); action_exec2("tool_set_brush", ""); goxel.tool_radius = 0.5; goxel.painter = (painter_t) { .shape = &shape_cube, .mode = MODE_OVER, .smoothness = 0, .color = {255, 255, 255, 255}, }; // Set symmetry origin to the center of the image. mat4_mul_vec3(goxel.image->box, VEC(0, 0, 0), goxel.painter.symmetry_origin); goxel.rend.light = (typeof(goxel.rend.light)) { .pitch = 10 * DD2R, .yaw = 120 * DD2R, .fixed = true, .intensity = 1. }; render_get_default_settings(0, NULL, &goxel.rend.settings); goxel.snap_mask = SNAP_MESH | SNAP_IMAGE_BOX; } void goxel_release(void) { cycles_release(); gui_release(); } static void update_window_title(void) { char buf[1024]; sprintf(buf, "Goxel %s%s %s", GOXEL_VERSION_STR, DEBUG ? " (debug)" : "", goxel.image->path ?: ""); sys_set_window_title(buf); } KEEPALIVE int goxel_iter(inputs_t *inputs) { double time = sys_get_time(); uint64_t mesh_key; float pitch; goxel.fps = mix(goxel.fps, 1.0 / (time - goxel.frame_time), 0.1); goxel.frame_time = time; goxel_set_help_text(NULL); goxel_set_hint_text(NULL); goxel.screen_size[0] = inputs->window_size[0]; goxel.screen_size[1] = inputs->window_size[1]; goxel.screen_scale = inputs->scale; goxel.rend.fbo = inputs->framebuffer; goxel.rend.scale = inputs->scale; camera_update(&goxel.camera); if (goxel.image->active_camera) camera_set(goxel.image->active_camera, &goxel.camera); mat4_copy(goxel.camera.view_mat, goxel.rend.view_mat); mat4_copy(goxel.camera.proj_mat, goxel.rend.proj_mat); gui_iter(inputs); if (DEFINED(SOUND) && time - goxel.last_click_time > 0.1) { mesh_key = mesh_get_key(goxel.render_mesh); if (goxel.last_mesh_key != mesh_key) { if (goxel.last_mesh_key) { pitch = goxel.painter.mode == MODE_OVER ? 1.0 : goxel.painter.mode == MODE_SUB ? 0.8 : 1.2; sound_play("build", 0.2, pitch); goxel.last_click_time = time; } goxel.last_mesh_key = mesh_key; } } sound_iter(); update_window_title(); goxel.frame_count++; return goxel.quit ? 1 : 0; } static void compute_view_rotation(const float rot[4], const float start_pos[2], const float end_pos[2], const float viewport[4], float out[4]) { float x1, y1, x2, y2, x_rot, z_rot, q1[4], q2[4], q[4], x_axis[4]; x1 = start_pos[0] / viewport[2]; y1 = start_pos[1] / viewport[3]; x2 = end_pos[0] / viewport[2]; y2 = end_pos[1] / viewport[3]; z_rot = (x2 - x1) * 2 * M_PI; x_rot = -(y2 - y1) * 2 * M_PI; quat_from_axis(q1, z_rot, 0, 0, 1); quat_mul(rot, q1, q); quat_conjugate(q, q); quat_mul_vec4(q, VEC(1, 0, 0, 0), x_axis); quat_from_axis(q2, x_rot, x_axis[0], x_axis[1], x_axis[2]); quat_mul(q1, q2, out); } static void set_cursor_hint(cursor_t *curs) { const char *snap_str = NULL; if (!curs->snaped) { goxel_set_hint_text(NULL); return; } if (curs->snaped == SNAP_MESH) snap_str = "mesh"; if (curs->snaped == SNAP_PLANE) snap_str = "plane"; if (curs->snaped == SNAP_IMAGE_BOX) snap_str = "bounding box"; if ( curs->snaped == SNAP_SELECTION_IN || curs->snaped == SNAP_SELECTION_OUT) snap_str = "selection"; goxel_set_hint_text("[%.0f %.0f %.0f] (%s)", curs->pos[0] - 0.5, curs->pos[1] - 0.5, curs->pos[2] - 0.5, snap_str); } static int on_drag(const gesture_t *gest, void *user) { cursor_t *c = &goxel.cursor; if (gest->state == GESTURE_BEGIN) c->flags |= CURSOR_PRESSED; if (gest->state == GESTURE_END) c->flags &= ~CURSOR_PRESSED; c->snaped = goxel_unproject( gest->viewport, gest->pos, c->snap_mask, c->snap_offset, c->pos, c->normal); // Set some default values. The tools can override them. // XXX: would be better to reset the cursor when we change tool! c->snap_mask = goxel.snap_mask; set_flag(&c->snap_mask, SNAP_ROUNDED, goxel.painter.smoothness == 0); c->snap_offset = 0; return 0; } static int on_pan(const gesture_t *gest, void *user) { if (gest->state == GESTURE_BEGIN) { vec3_copy(goxel.camera.ofs, goxel.move_origin.camera_ofs); vec2_copy(gest->pos, goxel.move_origin.pos); } float wpos[3] = {gest->pos[0], gest->pos[1], 0}; float worigin_pos[3], wdelta[3], odelta[3]; vec3_set(worigin_pos, goxel.move_origin.pos[0], goxel.move_origin.pos[1], 0); vec3_sub(wpos, worigin_pos, wdelta); unproject_delta(wdelta, goxel.camera.view_mat, goxel.camera.proj_mat, gest->viewport, odelta); vec3_imul(odelta, 2); // XXX: why do I need that? if (!goxel.camera.ortho) vec3_imul(odelta, goxel.camera.dist); vec3_add(goxel.move_origin.camera_ofs, odelta, goxel.camera.ofs); return 0; } static int on_rotate(const gesture_t *gest, void *user) { float view_rot[4]; if (gest->state == GESTURE_BEGIN) { quat_copy(goxel.camera.rot, goxel.move_origin.rotation); vec2_copy(gest->pos, goxel.move_origin.pos); } compute_view_rotation(goxel.move_origin.rotation, goxel.move_origin.pos, gest->pos, gest->viewport, view_rot); quat_mul(goxel.move_origin.rotation, view_rot, goxel.camera.rot); return 0; } static int on_hover(const gesture_t *gest, void *user) { cursor_t *c = &goxel.cursor; c->snaped = goxel_unproject(gest->viewport, gest->pos, c->snap_mask, c->snap_offset, c->pos, c->normal); set_cursor_hint(c); c->flags &= ~CURSOR_PRESSED; // Set some default values. The tools can override them. // XXX: would be better to reset the cursor when we change tool! c->snap_mask = goxel.snap_mask; set_flag(&c->snap_mask, SNAP_ROUNDED, goxel.painter.smoothness == 0); c->snap_offset = 0; set_flag(&c->flags, CURSOR_OUT, gest->state == GESTURE_END); return 0; } static int on_pinch(const gesture_t *gest, void *user) { static float start_zoom = 0; static float start_rot[4]; static float start_pos[2]; static float start_ofs[3]; float wpos[3], worigin_pos[3], wdelta[3], odelta[3]; float p[3], n[3]; if (gest->state == GESTURE_BEGIN) { start_zoom = goxel.camera.dist; quat_copy(goxel.camera.rot, start_rot); vec2_copy(gest->pos, start_pos); vec3_copy(goxel.camera.ofs, start_ofs); } goxel.camera.dist = start_zoom / gest->pinch; quat_rotate(start_rot, gest->rotation, 0, 0, 1, goxel.camera.rot); vec3_set(wpos, gest->pos[0], gest->pos[1], 0); vec3_set(worigin_pos, start_pos[0], start_pos[1], 0); vec3_sub(wpos, worigin_pos, wdelta); unproject_delta(wdelta, goxel.camera.view_mat, goxel.camera.proj_mat, gest->viewport, odelta); vec3_imul(odelta, 2); // XXX: why do I need that? if (!goxel.camera.ortho) vec3_imul(odelta, goxel.camera.dist); vec3_add(start_ofs, odelta, goxel.camera.ofs); // Auto adjust the camera rotation position. if (gest->state == GESTURE_END) { if (goxel_unproject_on_mesh(gest->viewport, gest->pos, goxel.layers_mesh, p, n)) { camera_set_target(&goxel.camera, p); } } return 0; } // XXX: Cleanup this. void goxel_mouse_in_view(const float viewport[4], const inputs_t *inputs, bool capture_keys) { float x_axis[4], q[4], p[3], n[3]; gesture_t *gests[] = {&goxel.gestures.drag, &goxel.gestures.pan, &goxel.gestures.rotate, &goxel.gestures.pinch, &goxel.gestures.hover}; gesture_update(ARRAY_SIZE(gests), gests, inputs, viewport, NULL); set_flag(&goxel.cursor.flags, CURSOR_SHIFT, inputs->keys[KEY_LEFT_SHIFT]); set_flag(&goxel.cursor.flags, CURSOR_CTRL, inputs->keys[KEY_CONTROL]); // Need to set the cursor snap mask to default because the tool might // change it. goxel.cursor.snap_mask = goxel.snap_mask; goxel.painter.box = !box_is_null(goxel.image->active_layer->box) ? &goxel.image->active_layer->box : !box_is_null(goxel.image->box) ? &goxel.image->box : NULL; if (!goxel.no_edit) tool_iter(goxel.tool, viewport); if (inputs->mouse_wheel) { goxel.camera.dist /= pow(1.1, inputs->mouse_wheel); // Auto adjust the camera rotation position. if (goxel_unproject_on_mesh(viewport, inputs->touches[0].pos, goxel.layers_mesh, p, n)) { camera_set_target(&goxel.camera, p); } return; } // handle keyboard rotations if (!capture_keys) return; if (inputs->keys[KEY_LEFT]) quat_irotate(goxel.camera.rot, 0.05, 0, 0, +1); if (inputs->keys[KEY_RIGHT]) quat_irotate(goxel.camera.rot, 0.05, 0, 0, -1); if (inputs->keys[KEY_UP]) { quat_conjugate(goxel.camera.rot, q); quat_mul_vec4(q, VEC(1, 0, 0, 0), x_axis); quat_irotate(goxel.camera.rot, -0.05, x_axis[0], x_axis[1], x_axis[2]); } if (inputs->keys[KEY_DOWN]) { quat_conjugate(goxel.camera.rot, q); quat_mul_vec4(q, VEC(1, 0, 0, 0), x_axis); quat_irotate(goxel.camera.rot, +0.05, x_axis[0], x_axis[1], x_axis[2]); } // C: recenter the view: // XXX: this should be an action! if (inputs->keys['C']) { if (goxel_unproject_on_mesh(viewport, inputs->touches[0].pos, goxel.layers_mesh, p, n)) { camera_set_target(&goxel.camera, p); } } } KEEPALIVE void goxel_render(void) { GL(glViewport(0, 0, goxel.screen_size[0] * goxel.screen_scale, goxel.screen_size[1] * goxel.screen_scale)); GL(glBindFramebuffer(GL_FRAMEBUFFER, goxel.rend.fbo)); GL(glClearColor(0, 0, 0, 1)); GL(glStencilMask(0xFF)); GL(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)); gui_render(); } static void render_export_viewport(const float viewport[4]) { // Render the export viewport. int w = goxel.image->export_width; int h = goxel.image->export_height; float aspect = (float)w/h; float plane[4][4]; mat4_set_identity(plane); if (aspect < goxel.camera.aspect) { mat4_iscale(plane, aspect / goxel.camera.aspect, 1, 1); } else { mat4_iscale(plane, 1, goxel.camera.aspect / aspect, 1); } render_rect(&goxel.rend, plane, EFFECT_STRIP); } static void render_view_cycles(const float viewport[4]) { int rect[4] = {(int)viewport[0], (int)(goxel.screen_size[1] - viewport[1] - viewport[3]), (int)viewport[2], (int)viewport[3]}; int w = viewport[2]; int h = viewport[3]; uint8_t *buf = calloc(4, w * h); cycles_render(buf, &w, &h, &goxel.camera, NULL, false); render_img2(&goxel.rend, buf, w, h, 4, NULL, EFFECT_NO_SHADING | EFFECT_PROJ_SCREEN); free(buf); render_submit(&goxel.rend, rect, goxel.back_color); } void goxel_render_export_view(const float viewport[4]) { typeof(goxel.render_task) *task = &goxel.render_task; int i, w, h, bpp = 4; uint8_t *tmp; float a, mat[4][4]; int rect[4] = {(int)viewport[0], (int)(goxel.screen_size[1] - viewport[1] - viewport[3]), (int)viewport[2], (int)viewport[3]}; camera_t camera = goxel.camera; // Recreate the buffer if needed. if ( !task->buf || task->w != goxel.image->export_width || task->h != goxel.image->export_height) { free(task->buf); task->w = goxel.image->export_width; task->h = goxel.image->export_height; task->buf = calloc(task->w * task->h, 4); } if (!task->status) task->status = 1; w = task->w; h = task->h; camera.aspect = (float)w / h; camera_update(&camera); cycles_render(task->buf, &w, &h, &camera, &task->progress, task->force_restart); task->force_restart = false; mat4_set_identity(mat); a = 1.0 * w / h / rect[2] * rect[3]; mat4_iscale(mat, min(a, 1.f), min(1.f / a, 1.f), 1); render_img2(&goxel.rend, task->buf, w, h, 4, mat, EFFECT_NO_SHADING | EFFECT_PROJ_SCREEN | EFFECT_ANTIALIASING); render_submit(&goxel.rend, rect, goxel.back_color); if (task->progress == 1) { // Finished. if (*task->output) { tmp = calloc(w * h, bpp); // Flip output y. for (i = 0; i < h; i++) { memcpy(&tmp[i * (size_t)w * bpp], &task->buf[((size_t)h - i - 1) * (size_t)w * bpp], bpp * (size_t)w); } img_write(tmp, w, h, bpp, task->output); free(tmp); } task->status = 2; } } void goxel_render_view(const float viewport[4]) { layer_t *layer; renderer_t *rend = &goxel.rend; const uint8_t layer_box_color[4] = {128, 128, 255, 255}; goxel.camera.aspect = viewport[2] / viewport[3]; camera_update(&goxel.camera); if (goxel.use_cycles) { render_view_cycles(viewport); return; } render_mesh(rend, goxel.render_mesh, goxel.show_wireframe ? EFFECT_WIREFRAME : 0); if (!box_is_null(goxel.image->active_layer->box)) render_box(rend, goxel.image->active_layer->box, layer_box_color, EFFECT_WIREFRAME); // Render all the image layers. DL_FOREACH(goxel.image->layers, layer) { if (layer->visible && layer->image) render_img(rend, layer->image, layer->mat, EFFECT_NO_SHADING); } if ((goxel.tool->id == TOOL_SELECTION) || (goxel.snap_mask & (SNAP_SELECTION_IN | SNAP_SELECTION_OUT))) { render_box(rend, goxel.selection, NULL, EFFECT_STRIP | EFFECT_WIREFRAME); } // XXX: make a toggle for debug informations. if ((0)) { float b[4][4]; uint8_t c[4]; vec4_set(c, 0, 255, 0, 80); mesh_get_box(goxel.layers_mesh, true, b); render_box(rend, b, c, EFFECT_WIREFRAME); vec4_set(c, 0, 255, 255, 80); mesh_get_box(goxel.layers_mesh, false, b); render_box(rend, b, c, EFFECT_WIREFRAME); } if (goxel.snap_mask & SNAP_PLANE) render_grid(rend, goxel.plane, goxel.grid_color, goxel.image->box); if (!box_is_null(goxel.image->box) && !goxel.hide_box) render_box(rend, goxel.image->box, goxel.image_box_color, EFFECT_SEE_BACK | EFFECT_GRID); if (goxel.show_export_viewport) render_export_viewport(viewport); // XXX: cleanup this! int rect[4] = {(int)viewport[0], (int)(goxel.screen_size[1] - viewport[1] - viewport[3]), (int)viewport[2], (int)viewport[3]}; render_submit(&goxel.rend, rect, goxel.back_color); } void image_update(image_t *img); void goxel_update_meshes(int mask) { layer_t *layer; mesh_t *mesh; image_update(goxel.image); if ( (mask & MESH_LAYERS) || (mask & MESH_PICK) || ((mask & MESH_RENDER) && !goxel.tool_mesh)) { mesh_clear(goxel.layers_mesh); DL_FOREACH(goxel.image->layers, layer) { if (!layer->visible) continue; mesh_merge(goxel.layers_mesh, layer->mesh, MODE_OVER, NULL); } } if ((mask & MESH_RENDER) && goxel.tool_mesh) { mesh_clear(goxel.render_mesh); DL_FOREACH(goxel.image->layers, layer) { if (!layer->visible) continue; mesh = layer->mesh; if (mesh == goxel.image->active_layer->mesh) mesh = goxel.tool_mesh; mesh_merge(goxel.render_mesh, mesh, MODE_OVER, NULL); } } if ((mask & MESH_RENDER) && !goxel.tool_mesh) mesh_set(goxel.render_mesh, goxel.layers_mesh); } // Render the view into an RGB[A] buffer. void goxel_render_to_buf(uint8_t *buf, int w, int h, int bpp) { camera_t camera = goxel.camera; mesh_t *mesh; texture_t *fbo; renderer_t rend = goxel.rend; int rect[4] = {0, 0, w * 2, h * 2}; uint8_t *tmp_buf; camera.aspect = (float)w / h; camera_update(&camera); mesh = goxel.layers_mesh; fbo = texture_new_buffer(w * 2, h * 2, TF_DEPTH); mat4_copy(camera.view_mat, rend.view_mat); mat4_copy(camera.proj_mat, rend.proj_mat); rend.fbo = fbo->framebuffer; rend.scale = 1.0; render_mesh(&rend, mesh, 0); render_submit(&rend, rect, (bpp == 3) ? goxel.back_color : NULL); tmp_buf = calloc(w * h * 4, bpp); texture_get_data(fbo, w * 2, h * 2, bpp, tmp_buf); img_downsample(tmp_buf, w * 2, h * 2, bpp, buf); free(tmp_buf); texture_delete(fbo); } static void export_as(const char *type, const char *path) { char id[128]; assert(path); // If not provided, try to guess the type from the path extension. if (!type) { type = strrchr(path, '.'); if (!type) { LOG_E("Cannot guess file extension"); return; } type++; } sprintf(id, "export_as_%s", type); action_exec2(id, "p", path); } ACTION_REGISTER(export_as, .help = "Export the image", .cfunc = export_as, .csig = "vpp", ) // XXX: we could merge all the set_xxx_text function into a single one. void goxel_set_help_text(const char *msg, ...) { va_list args; free(goxel.help_text); goxel.help_text = NULL; if (!msg) return; va_start(args, msg); vasprintf(&goxel.help_text, msg, args); va_end(args); } void goxel_set_hint_text(const char *msg, ...) { va_list args; free(goxel.hint_text); goxel.hint_text = NULL; if (!msg) return; va_start(args, msg); vasprintf(&goxel.hint_text, msg, args); va_end(args); } void goxel_import_image_plane(const char *path) { layer_t *layer; texture_t *tex; tex = texture_new_image(path, TF_NEAREST); if (!tex) return; image_history_push(goxel.image); layer = image_add_layer(goxel.image); sprintf(layer->name, "img"); layer->image = tex; mat4_iscale(layer->mat, layer->image->w, layer->image->h, 1); } static int search_action_for_format_cb(action_t *a, void *user) { const char *path = USER_GET(user, 0); const char *type = USER_GET(user, 1); const action_t **ret = USER_GET(user, 2); if (!a->file_format.ext) return 0; if (!str_startswith(a->id, type)) return 0; if (!str_endswith(path, a->file_format.ext + 1)) return 0; *ret = a; return 1; } static int goxel_import_file(const char *path) { const action_t *a = NULL; if (str_endswith(path, ".gox")) { load_from_file(path); return 0; } actions_iter(search_action_for_format_cb, USER_PASS(path, "import_", &a)); if (!a) return -1; action_exec(a, "p", path); return 0; } ACTION_REGISTER(import, .help = "Import a file", .cfunc = goxel_import_file, .csig = "vp", .flags = ACTION_TOUCH_IMAGE, ) static int goxel_export_to_file(const char *path) { const action_t *a = NULL; actions_iter(search_action_for_format_cb, USER_PASS(path, "export_", &a)); if (!a) return -1; return action_exec(a, "p", path); } ACTION_REGISTER(export, .help = "Export to a file", .cfunc = goxel_export_to_file, .csig = "vp", ) static layer_t *cut_as_new_layer(image_t *img, layer_t *layer, const float box[4][4]) { layer_t *new_layer; painter_t painter; img = img ?: goxel.image; layer = layer ?: img->active_layer; if (!box) box = (const void*)goxel.selection; new_layer = image_duplicate_layer(img, layer); painter = (painter_t) { .shape = &shape_cube, .mode = MODE_INTERSECT, .color = {255, 255, 255, 255}, }; mesh_op(new_layer->mesh, &painter, box); painter.mode = MODE_SUB; mesh_op(layer->mesh, &painter, box); return new_layer; } ACTION_REGISTER(cut_as_new_layer, .help = "Cut into a new layer", .cfunc = cut_as_new_layer, .csig = "vppp", .flags = ACTION_TOUCH_IMAGE, ) static void reset_selection(void) { mat4_copy(mat4_zero, goxel.selection); } ACTION_REGISTER(reset_selection, .help = "Reset the selection", .cfunc = reset_selection, .csig = "vp", ) static void fill_selection(layer_t *layer) { if (box_is_null(goxel.selection)) return; layer = layer ?: goxel.image->active_layer; mesh_op(layer->mesh, &goxel.painter, goxel.selection); goxel_update_meshes(-1); } ACTION_REGISTER(fill_selection, .help = "Fill the selection with the current paint settings", .cfunc = fill_selection, .csig = "vp", .flags = ACTION_TOUCH_IMAGE, ) static void copy_action(void) { painter_t painter; mesh_delete(goxel.clipboard.mesh); mat4_copy(goxel.selection, goxel.clipboard.box); goxel.clipboard.mesh = mesh_copy(goxel.image->active_layer->mesh); if (!box_is_null(goxel.selection)) { painter = (painter_t) { .shape = &shape_cube, .mode = MODE_INTERSECT, .color = {255, 255, 255, 255}, }; mesh_op(goxel.clipboard.mesh, &painter, goxel.selection); } } static void past_action(void) { mesh_t *mesh = goxel.image->active_layer->mesh; mesh_t *tmp; float p1[3], p2[3], mat[4][4]; mat4_set_identity(mat); if (!goxel.clipboard.mesh) return; tmp = mesh_copy(goxel.clipboard.mesh); if ( !box_is_null(goxel.selection) && !box_is_null(goxel.clipboard.box)) { vec3_copy(goxel.selection[3], p1); vec3_copy(goxel.clipboard.box[3], p2); mat4_itranslate(mat, +p1[0], +p1[1], +p1[2]); mat4_itranslate(mat, -p2[0], -p2[1], -p2[2]); mesh_move(tmp, mat); } mesh_merge(mesh, tmp, MODE_OVER, NULL); mesh_delete(tmp); } ACTION_REGISTER(copy, .help = "Copy", .cfunc = copy_action, .csig = "v", .default_shortcut = "Ctrl C", .flags = 0, ) ACTION_REGISTER(past, .help = "Past", .cfunc = past_action, .csig = "v", .default_shortcut = "Ctrl V", .flags = ACTION_TOUCH_IMAGE, ) #define HS2 (M_SQRT2 / 2.0) static int view_default(const action_t *a, astack_t *s) { quat_set_identity(goxel.camera.rot); quat_irotate(goxel.camera.rot, -M_PI / 4, 1, 0, 0); quat_irotate(goxel.camera.rot, -M_PI / 4, 0, 0, 1); goxel_update_meshes(-1); return 0; } static int view_set(const action_t *a, astack_t *s) { quat_copy(a->data, goxel.camera.rot); goxel_update_meshes(-1); return 0; } ACTION_REGISTER(view_left, .help = "Set camera view to left", .flags = ACTION_CAN_EDIT_SHORTCUT, .func = view_set, .data = &QUAT(0.5, -0.5, 0.5, 0.5), .default_shortcut = "Ctrl 3", ) ACTION_REGISTER(view_right, .help = "Set camera view to right", .flags = ACTION_CAN_EDIT_SHORTCUT, .func = view_set, .data = &QUAT(-0.5, 0.5, 0.5, 0.5), .default_shortcut = "3", ) ACTION_REGISTER(view_top, .help = "Set camera view to top", .flags = ACTION_CAN_EDIT_SHORTCUT, .func = view_set, .data = &QUAT(1, 0, 0, 0), .default_shortcut = "7", ) ACTION_REGISTER(view_default, .help = "Set camera view to default", .flags = ACTION_CAN_EDIT_SHORTCUT, .func = view_default, .default_shortcut = "5", ) ACTION_REGISTER(view_front, .help = "Set camera view to front", .flags = ACTION_CAN_EDIT_SHORTCUT, .func = view_set, .data = &QUAT(HS2, -HS2, 0, 0), .default_shortcut = "1", ) static void quit(void) { goxel.quit = true; } ACTION_REGISTER(quit, .help = "Quit the application", .flags = ACTION_CAN_EDIT_SHORTCUT, .cfunc = quit, .csig = "v", .default_shortcut = "Ctrl Q", ) static void undo(void) { image_undo(goxel.image); } static void redo(void) { image_redo(goxel.image); } ACTION_REGISTER(undo, .help = "Undo", .flags = ACTION_CAN_EDIT_SHORTCUT, .cfunc = undo, .csig = "v", .default_shortcut = "Ctrl Z", .icon = ICON_ARROW_BACK, ) ACTION_REGISTER(redo, .help = "Redo", .flags = ACTION_CAN_EDIT_SHORTCUT, .cfunc = redo, .csig = "v", .default_shortcut = "Ctrl Y", .icon = ICON_ARROW_FORWARD, ) static void toggle_mode(void) { int mode = goxel.painter.mode; switch (mode) { case MODE_OVER: mode = MODE_SUB; break; case MODE_SUB: mode = MODE_PAINT; break; case MODE_PAINT: mode = MODE_OVER; break; } goxel.painter.mode = mode; } ACTION_REGISTER(toggle_mode, .help = "Toggle the tool mode (add, sub, paint)", .flags = ACTION_CAN_EDIT_SHORTCUT, .cfunc = toggle_mode, .csig = "v", ) goxel-0.8.1/src/goxel.h000066400000000000000000001477541334742672700147550ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ // File: goxel.h #ifndef GOXEL_H #define GOXEL_H #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif #ifndef NOMINMAX # define NOMINMAX #endif #include "vec.h" #include "utlist.h" #include "uthash.h" #include "utarray.h" #include "noc_file_dialog.h" #include "block_def.h" #include "mesh.h" #include "theme.h" #include #include #include #include #include #include #define GOXEL_VERSION_STR "0.8.1" #ifndef GOXEL_DEFAULT_THEME # define GOXEL_DEFAULT_THEME "original" #endif // #### Set the DEBUG macro #### #ifndef DEBUG # if !defined(NDEBUG) # define DEBUG 1 # else # define DEBUG 0 # endif #endif #if !DEBUG && !defined(NDEBUG) # define NDEBUG #endif #include // ############################# // #### DEFINED macro ########## // DEFINE(NAME) returns 1 if NAME is defined to 1, 0 otherwise. #define DEFINED(macro) DEFINED_(macro) #define macrotest_1 , #define DEFINED_(value) DEFINED__(macrotest_##value) #define DEFINED__(comma) DEFINED___(comma 1, 0) #define DEFINED___(_, v, ...) v // ############################# // #### Logging macros ######### enum { GOX_LOG_VERBOSE = 2, GOX_LOG_DEBUG = 3, GOX_LOG_INFO = 4, GOX_LOG_WARN = 5, GOX_LOG_ERROR = 6, }; #ifndef LOG_LEVEL # if DEBUG # define LOG_LEVEL GOX_LOG_DEBUG # else # define LOG_LEVEL GOX_LOG_INFO # endif #endif #define LOG(level, msg, ...) do { \ if (level >= LOG_LEVEL) \ dolog(level, msg, __func__, __FILE__, __LINE__, ##__VA_ARGS__); \ } while(0) #define LOG_V(msg, ...) LOG(GOX_LOG_VERBOSE, msg, ##__VA_ARGS__) #define LOG_D(msg, ...) LOG(GOX_LOG_DEBUG, msg, ##__VA_ARGS__) #define LOG_I(msg, ...) LOG(GOX_LOG_INFO, msg, ##__VA_ARGS__) #define LOG_W(msg, ...) LOG(GOX_LOG_WARN, msg, ##__VA_ARGS__) #define LOG_E(msg, ...) LOG(GOX_LOG_ERROR, msg, ##__VA_ARGS__) // CHECK is similar to an assert, but the condition is tested even in release // mode. #if DEBUG #define CHECK(c) assert(c) #else #define CHECK(c) do { \ if (!(c)) { \ LOG_E("Error %s %s %d", __func__, __FILE__, __LINE__); \ exit(-1); \ } \ } while (0) #endif // I redefine asprintf so that if the function fails, we just crash the // application. I don't see how we can recover from an asprintf fails // anyway. #define asprintf(...) CHECK(asprintf(__VA_ARGS__) != -1) #define vasprintf(...) CHECK(vasprintf(__VA_ARGS__) != -1) // ############################# #ifdef __EMSCRIPTEN__ # include # define KEEPALIVE EMSCRIPTEN_KEEPALIVE #else # define KEEPALIVE #endif // #### Include OpenGL ######### #define GL_GLEXT_PROTOTYPES #ifdef WIN32 # include # include "GL/glew.h" #endif #ifdef __APPLE__ # include "TargetConditionals.h" # if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR # define GLES2 1 # include # include # else # include # endif #else # ifdef GLES2 # include # include # else # include # endif #endif // ############################# // #### GL macro ############### #if DEBUG # define GL(line) ({ \ line; \ if (gl_check_errors(__FILE__, __LINE__)) assert(false); \ }) #else # define GL(line) line #endif // ############################# // ####### Section: Utils ################################################ // Some useful inline functions / macros /* * Macro: ARRAY_SIZE * Return the number of elements in an array */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* * Macro: SWAP * Swap two variables */ #define SWAP(x0, x) do {typeof(x0) tmp = x0; x0 = x; x = tmp;} while (0) /* * Macro: USER_PASS * Used to pass values to callback 'void *user' arguments. * * For a function with the following declaration: f(void *user), we can pass * several arguments packed in an array like that: * * int x, y; * f(USER_PASS(&x, &y)); */ #define USER_PASS(...) ((const void*[]){__VA_ARGS__}) /* * Macro: USER_GET * Used to unpack values passed to a callback with USER_PASS: * * void f(void *user) * { * char *arg1 = USER_GET(user, 0); * int arg2 = *((int*)USER_GET(user, 1)); * } */ #define USER_GET(var, n) (((void**)var)[n]) /* * Macro: vec3_set * Set a 3 sized array values. */ #define vec3_set(v, x, y, z) do { \ (v)[0] = (x); (v)[1] = (y); (v)[2] = (z); } while(0) /* * Macro: vec4_set * Set a 4 sized array values. */ #define vec4_set(v, x, y, z, w) do { \ (v)[0] = (x); (v)[1] = (y); (v)[2] = (z); (v)[3] = (w); } while(0) /* * Macro: vec4_copy * Copy a 4 sized array into an other one. */ #define vec4_copy(a, b) do { \ (b)[0] = (a)[0]; (b)[1] = (a)[1]; (b)[2] = (a)[2]; (b)[3] = (a)[3]; \ } while (0) /* * Macro: vec4_equal * Test whether two 4 sized vectors are equal. */ #define vec4_equal(a, b) ({ \ (a)[0] == (b)[0] && \ (a)[1] == (b)[1] && \ (a)[2] == (b)[2] && \ (a)[3] == (b)[3]; }) /* Define: DR2D * Convertion ratio from radian to degree. */ #define DR2D (180 / M_PI) /* Define: DR2D * Convertion ratio from degree to radian. */ #define DD2R (M_PI / 180) /* Define: KB * 1024 */ #define KB 1024 /* Define: MB * 1024^2 */ #define MB (1024 * KB) /* Define: GB * 1024^3 */ #define GB (1024 * MB) /* * Macro: min * Safe min function. */ #define min(a, b) ({ \ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a < _b ? _a : _b; \ }) /* * Macro: max * Safe max function. */ #define max(a, b) ({ \ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a > _b ? _a : _b; \ }) /* * Macro: max3 * Safe max function, return the max of three values. */ #define max3(x, y, z) (max((x), max((y), (z)))) /* * Macro: min3 * Safe max function, return the max of three values. */ #define min3(x, y, z) (min((x), min((y), (z)))) /* * Macro: clamp * Clamp a value. */ #define clamp(x, a, b) (min(max(x, a), b)) /* * Macro: cmp * Compare two values. * * Return: * +1 if a > b, -1 if a < b, 0 if a == b. */ #define cmp(a, b) ({ \ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ (_a > _b) ? +1 : (_a < _b) ? -1 : 0; \ }) /* Function: smoothstep * Perform Hermite interpolation between two values. * * This is similar to the smoothstep function in OpenGL shader language. * * Parameters: * edge0 - Lower edge of the Hermite function. * edge1 - Upper edge of the Hermite function. * x - Source value for interpolation. */ static inline float smoothstep(float edge0, float edge1, float x) { x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); return x * x * (3.0f - 2.0f * x); } /* * Function: mix * Linear blend of x and y. * * Similar to GLES mix function. */ static inline float mix(float x, float y, float t) { return (1.0 - t) * x + t * y; } /* Function: set_flag * Set some int bits to 0 or 1. * * Parameters: * x - The int value to change. * flag - Bitmask of the bits we want to set. * v - Value to set. */ static inline void set_flag(int *x, int flag, bool v) { v ? (*x |= flag) : (*x &= ~flag); } /* * Function: read_file * Read a file from disk. * * Return: * A newly allocated buffer containing the file data. */ char *read_file(const char *path, int *size); // Used internally by the LOG macro void dolog(int level, const char *msg, const char *func, const char *file, int line, ...); /* * Function: img_read * Read an image from a file. */ uint8_t *img_read(const char *path, int *width, int *height, int *bpp); /* * Function: img_read_from_mem * Read an image from memory. */ uint8_t *img_read_from_mem(const char *data, int size, int *w, int *h, int *bpp); /* * Function: img_write * Write an image to a file. */ void img_write(const uint8_t *img, int w, int h, int bpp, const char *path); /* * Function: img_write_to_mem * Write an image to memory. */ uint8_t *img_write_to_mem(const uint8_t *img, int w, int h, int bpp, int *size); /* * Function: img_downsample * Downsample an image by half, using interpolation. */ void img_downsample(const uint8_t *img, int w, int h, int bpp, uint8_t *out); /* * Function: unix_to_dtf * Get gregorian date from unix time. * * Parameters: * t - Unix time. * iy - Output year. * im - Output month (1 - 12). * id - Output day (1 - 31). * h - Output hour. * m - Output minute. * s - Output seconds. */ int unix_to_dtf(double t, int *iy, int *im, int *id, int *h, int *m, int *s); /* * Function: utf_16_to_8 * Convert a string encoded in utf_16 to utf_8. * * Parameters: * in16 - Input string in utf 16 encoding. * out8 - Output buffer that receive the utf8 string. * size8 - Size of the output buffer. */ int utf_16_to_8(const wchar_t *in16, char *out8, size_t size8); /* * Function: str_equ * Return whether two strings are equal. */ static inline bool str_equ(const char *s1, const char *s2) { return strcmp(s1, s2) == 0; } /* * Function: str_endswith * Return whether a string ends with an other one. */ bool str_endswith(const char *str, const char *end); /* * Function: str_startswith * Return whether a string starts with an other one. */ bool str_startswith(const char *s1, const char *s2); /* * Function: unproject * Convert from screen coordinate to world coordinates. * * Similar to gluUnproject. * * Parameters: * win - Windows coordinates to be mapped. * model - Modelview matrix. * proj - Projection matrix. * viewport - Viewport rect (x, y, w, h). * out - Output of the computed object coordinates. */ void unproject(const float win[3], const float model[4][4], const float proj[4][4], const float viewport[4], float out[3]); /* * Function: b64_decode * Decode a base64 string * * Parameters: * src - A base 64 encoded string. * dest - Buffer that will receive the decoded value or NULL. If set to * NULL the function just returns the size of the decoded data. * * Return: * The size of the decoded data. */ int b64_decode(const char *src, void *dest); /* * Function: crc64 * Compute crc64 hash * * Parameters: * crc - Initial crc value. * s - Data pointer. * len - Data size. * * Return: * The new crc64 value. */ uint64_t crc64(uint64_t crc, const void *s, uint64_t len); // ############################# // XXX: I should clean up a but the code of vec.h so that I can put those on // top. #include "box.h" #include "plane.h" // ######### Section: GL utils ############################ int gl_check_errors(const char *file, int line); /* * Function: gl_has_extension * Check whether an OpenGL extension is available. */ bool gl_has_extension(const char *extension); /* * Function: gl_create_prog * Helper function to create an OpenGL program. */ int gl_create_prog(const char *vertex_shader, const char *fragment_shader, const char *include); /* * Function: gl_create_prog * Helper function to delete an OpenGL program. */ void gl_delete_prog(int prog); /* * Function: gl_gen_fbo * Helper function to generate an OpenGL framebuffer object with an * associated texture. * * Parameters: * w - Width of the fbo. * h - Height of the fbo. * format - GL_RGBA or GL_DEPTH_COMPONENT. * out_fbo - The created fbo. * out_tex - The created texture. */ int gl_gen_fbo(int w, int h, GLenum format, int msaa, GLuint *out_fbo, GLuint *out_tex); /* ######################################################################## * Section: System * Some system related functions. All the things that might depend on the * operating system, not relying on libc, should go there. */ /* * Global structure that hold pointers to system functions. Need to be * set at init time. */ typedef struct { void *user; void (*set_window_title)(void *user, const char *title); const char *(*get_user_dir)(void *user); const char *(*get_clipboard_text)(void* user); void (*set_clipboard_text)(void *user, const char *text); } sys_callbacks_t; extern sys_callbacks_t sys_callbacks; /* * Function: sys_log * Write a log message to output. * * Note: this should never be called directly, use the LOG_ macros instead. */ void sys_log(const char *msg); /* * Function: sys_list_dir * List all the files in a directory. * * Parameters: * dir - Path of the directory we want to list. * callback - Function called once per entry. * user - User data passed to the callback. * * Return: * The number of files found. */ int sys_list_dir(const char *dir, int (*callback)(const char *dir, const char *name, void *user), void *user); /* * Function: sys_delete_file * Delete a file from the system. */ int sys_delete_file(const char *path); /* * Function: sys_get_user_dir * Return the user config directory for goxel * * On linux, this should be $HOME/.config/goxel. */ const char *sys_get_user_dir(void); /* * Function: sys_make_dir * Create all the directories parent of a given file path if they do not * exist yet. * * For example, sys_make_dir("/a/b/c.txt") will create /a/ and /a/b/. */ int sys_make_dir(const char *path); const char *sys_get_clipboard_text(void* user); void sys_set_clipboard_text(void *user, const char *text); GLuint sys_get_screen_framebuffer(void); /* * Function: sys_get_time * Return the unix time (seconds since Jan 01 1970). */ double sys_get_time(void); // Unix time. /* * Function: sys_set_window_title * Set the window title. */ void sys_set_window_title(const char *title); // ############################# // #### Dialogs ################ enum { DIALOG_FLAG_SAVE = 1 << 0, DIALOG_FLAG_OPEN = 1 << 1, DIALOG_FLAG_DIR = 1 << 2, }; // #### Section: Texture ################ enum { TF_DEPTH = 1 << 0, TF_STENCIL = 1 << 1, TF_MIPMAP = 1 << 2, TF_KEEP = 1 << 3, TF_RGB = 1 << 4, TF_RGB_565 = 1 << 5, TF_HAS_TEX = 1 << 6, TF_HAS_FB = 1 << 7, TF_NEAREST = 1 << 8, }; // Type: texture_t // Reresent a 2d texture. typedef struct texture texture_t; struct texture { int ref; // For reference copy. char *path; // Only for image textures. int format; GLuint tex; int tex_w, tex_h; // The actual OpenGL texture size. int x, y, w, h; // Position of the sub texture. int flags; // This is only used for buffer textures. GLuint framebuffer, depth, stencil; }; texture_t *texture_new_image(const char *path, int flags); texture_t *texture_new_from_buf(const uint8_t *data, int w, int h, int bpp, int flags); texture_t *texture_new_surface(int w, int h, int flags); texture_t *texture_new_buffer(int w, int h, int flags); void texture_get_data(const texture_t *tex, int w, int h, int bpp, uint8_t *buf); void texture_save_to_file(const texture_t *tex, const char *path); texture_t *texture_copy(texture_t *tex); void texture_delete(texture_t *tex); // ############################# // #### Action ################# // We support some basic reflexion of functions. We do this by registering the // functions with the ACTION_REGISTER macro. Once a function has been // registered, it is possible to query it (action_get) and call it // (action_exec). // Check the end of image.c to see some examples. The idea is that this will // make it much easier to add meta information to functions, like // documentation, shortcuts. Also in theory this should allow to add a // scripting engine on top of goxel quite easily. // XXX: this is still pretty experimental. This might change in the future. typedef struct astack astack_t; astack_t *stack_create(void); void stack_delete(astack_t *s); void stack_clear(astack_t *s); int stack_size(const astack_t *s); char stack_type(const astack_t *s, int i); void stack_push_i(astack_t *s, int i); void stack_push_p(astack_t *s, void *p); void stack_push_b(astack_t *s, bool b); int stack_get_i(const astack_t *s, int i); void *stack_get_p(const astack_t *s, int i); bool stack_get_b(const astack_t *s, int i); void stack_pop(astack_t *s); enum { ACTION_TOUCH_IMAGE = 1 << 0, // Push the undo history. // Toggle actions accept and return a boolean value. ACTION_TOGGLE = 1 << 1, ACTION_CAN_EDIT_SHORTCUT = 1 << 2, }; // Represent an action. typedef struct action action_t; struct action { const char *id; // Globally unique id. const char *help; // Help text. int flags; const char *default_shortcut; char shortcut[8]; // Can be changed at runtime. int icon; // Optional icon id. int (*func)(const action_t *a, astack_t *s); void *data; // cfunc and csig can be used to directly call any function. void *cfunc; const char *csig; // Used for export / import actions. struct { const char *name; const char *ext; } file_format; }; void action_register(const action_t *action); action_t *action_get(const char *id); int action_exec(const action_t *action, const char *sig, ...); int action_execv(const action_t *action, const char *sig, va_list ap); void actions_iter(int (*f)(action_t *action, void *user), void *user); // Convenience macro to call action_exec directly from an action id. #define action_exec2(id, sig, ...) \ action_exec(action_get(id), sig, ##__VA_ARGS__) // Convenience macro to register an action from anywere in a c file. #define ACTION_REGISTER(id_, ...) \ static const action_t GOX_action_##id_ = {.id = #id_, __VA_ARGS__}; \ static void GOX_register_action_##id_(void) __attribute__((constructor)); \ static void GOX_register_action_##id_(void) { \ action_register(&GOX_action_##id_); \ } // ############################# // All the icons positions inside icon.png (as Y*8 + X + 1). enum { ICON_NULL = 0, ICON_TOOL_BRUSH = 1, ICON_TOOL_PICK = 2, ICON_TOOL_SHAPE = 3, ICON_TOOL_PLANE = 4, ICON_TOOL_LASER = 5, ICON_TOOL_MOVE = 6, ICON_TOOL_EXTRUDE = 7, ICON_MODE_ADD = 9, ICON_MODE_SUB = 10, ICON_MODE_PAINT = 11, ICON_SHAPE_CUBE = 12, ICON_SHAPE_SPHERE = 13, ICON_SHAPE_CYLINDER = 14, ICON_TOOL_SELECTION = 15, ICON_ADD = 17, ICON_REMOVE = 18, ICON_ARROW_BACK = 19, ICON_ARROW_FORWARD = 20, ICON_LINK = 21, ICON_MENU = 22, ICON_DELETE = 23, ICON_TOOL_PROCEDURAL = 24, ICON_VISIBILITY = 25, ICON_VISIBILITY_OFF = 26, ICON_ARROW_DOWNWARD = 27, ICON_ARROW_UPWARD = 28, ICON_EDIT = 29, ICON_COPY = 30, ICON_GALLERY = 31, ICON_INFO = 32, ICON_SETTINGS = 33, ICON_CLOUD = 34, ICON_TOOLS = 41, ICON_PALETTE = 42, ICON_LAYERS = 43, ICON_RENDER = 44, ICON_CAMERA = 45, ICON_IMAGE = 46, ICON_EXPORT = 47, ICON_DEBUG = 48, ICON_VIEW = 49, ICON_MATERIAL = 50, }; /* * Some icons have their color blended depending on the style. We define * them with a range in the icons atlas: */ #define ICON_COLORIZABLE_START 17 #define ICON_COLORIZABLE_END 41 // #### Tool/Operation/Painter # enum { TOOL_NONE = 0, TOOL_BRUSH, TOOL_SHAPE, TOOL_LASER, TOOL_SET_PLANE, TOOL_MOVE, TOOL_PICK_COLOR, TOOL_SELECTION, TOOL_PROCEDURAL, TOOL_EXTRUDE, TOOL_COUNT }; // Mesh mask for goxel_update_meshes function. enum { MESH_LAYERS = 1 << 0, MESH_PICK = 1 << 1, MESH_RENDER = 1 << 2, }; typedef struct shape { const char *id; float (*func)(const float p[3], const float s[3], float smoothness); } shape_t; void shapes_init(void); extern shape_t shape_sphere; extern shape_t shape_cube; extern shape_t shape_cylinder; // #### Block ################## // The block size can only be 16. #define BLOCK_SIZE 16 #define VOXEL_TEXTURE_SIZE 8 // Structure used for the OpenGL array data of blocks. // XXX: we can probably make it smaller. typedef struct voxel_vertex { uint8_t pos[3] __attribute__((aligned(4))); int8_t normal[3] __attribute__((aligned(4))); uint8_t color[4] __attribute__((aligned(4))); uint16_t pos_data __attribute__((aligned(4))); uint8_t uv[2] __attribute__((aligned(4))); uint8_t bshadow_uv[2] __attribute__((aligned(4))); uint8_t bump_uv[2] __attribute__((aligned(4))); } voxel_vertex_t; // ######## Section: Mesh util ############################################ /* * Enum: MODE * Define how layers/brush are merged. Each mode defines how to apply a * source voxel into a destination voxel. * * MODE_OVER - New values replace old one. * MODE_SUB - Substract source alpha from destination * MODE_SUB_CLAMP - Set alpha to the minimum between the destination value * and one minus the source value. * MODE_PAINT - Set the color of the destination using the source. * MODE_MAX - Set alpha to the max of the source and destination. * MODE_INTERSECT - Set alpha to the min of the source and destination. * MODE_MULT_ALPHA - Multiply the source and dest using source alpha. */ enum { MODE_NULL, MODE_OVER, MODE_SUB, MODE_SUB_CLAMP, MODE_PAINT, MODE_MAX, MODE_INTERSECT, MODE_MULT_ALPHA, }; // Type: painter_t // The painting context, including the tool, brush, mode, radius, // color, etc... // // Attributes: // mode - Define how colors are applied. One of the enum value. typedef struct painter { int mode; const shape_t *shape; uint8_t color[4]; float smoothness; int symmetry; // bitfield X Y Z float symmetry_origin[3]; float (*box)[4][4]; // Clipping box (can be null) } painter_t; /* Function: mesh_get_box * Compute the bounding box of a mesh. */ // XXX: remove this function! void mesh_get_box(const mesh_t *mesh, bool exact, float box[4][4]); /* Function: mesh_op * Apply a paint operation to a mesh. * This function render geometrical 3d shapes into a mesh. * The shape, mode and color are defined in the painter argument. * * Parameters: * mesh - The mesh we paint into. * painter - Defines the paint operation to apply. * box - Defines the position and size of the shape as the * transformation matrix from the zero centered unit box. * * See Also: * */ void mesh_op(mesh_t *mesh, const painter_t *painter, const float box[4][4]); // XXX: to cleanup. void mesh_extrude(mesh_t *mesh, const float plane[4][4], const float box[4][4]); /* Function: mesh_blit * * Blit voxel data into a mesh. * This is the fastest way to quickly put data into a mesh. * * Parameters: * mesh - The mesh we blit into. * data - Pointer to voxel data (RGBA values, in xyz order). * x - X pos. * y - Y pos. * z - Z pos. * w - Width of the data. * h - Height of the data. * d - Depth of the data. * iter - Optional iterator for optimized access. */ void mesh_blit(mesh_t *mesh, const uint8_t *data, int x, int y, int z, int w, int h, int d, mesh_iterator_t *iter); void mesh_move(mesh_t *mesh, const float mat[4][4]); void mesh_shift_alpha(mesh_t *mesh, int v); // Compute the selection mask for a given condition. int mesh_select(const mesh_t *mesh, const int start_pos[3], int (*cond)(const uint8_t value[4], const uint8_t neighboors[6][4], const uint8_t mask[6], void *user), void *user, mesh_t *selection); /* * Function: mesh_merge * Merge a mesh into an other using a given blending function. * * Parameters: * mesh - The destination mesh we merge into. * other - The source mesh we merge. Unchanged by this function. * mode - The blending function used. One of the enum values. * color - A color to apply to the source mesh before merging. Can be * set to NULL. */ void mesh_merge(mesh_t *mesh, const mesh_t *other, int mode, const uint8_t color[4]); /* * Function: mesh_generate_vertices * Generate a vertice array for rendering a mesh block. * * Parameters: * mesh - Input mesh. * block_pos - Position of the mesh block to render. * effects - Effect flags. * out - Output array. * size - Output the size of a single face. * 4 for quads and 3 for triangles. Normal mesh uses quad * but marching cube effect return triangle arrays. * subdivide - Ouput the number of subdivisions used for a voxel. Normal * render uses 1 unit per voxel, but marching cube rendering * can use more. */ int mesh_generate_vertices(const mesh_t *mesh, const int block_pos[3], int effects, voxel_vertex_t *out, int *size, int *subdivide); // XXX: use int[2][3] for the box? void mesh_crop(mesh_t *mesh, const float box[4][4]); /* Function: mesh_crc64 * Compute the crc64 of the mesh data as an array of xyz rgba values. * * This is only used in the tests, to make sure that we can still open * old file formats. */ uint64_t mesh_crc64(const mesh_t *mesh); // #### Renderer ############### enum { EFFECT_RENDER_POS = 1 << 1, EFFECT_SMOOTH = 1 << 2, EFFECT_BORDERS = 1 << 3, EFFECT_BORDERS_ALL = 1 << 4, EFFECT_SEMI_TRANSPARENT = 1 << 5, EFFECT_SEE_BACK = 1 << 6, EFFECT_MARCHING_CUBES = 1 << 7, EFFECT_SHADOW_MAP = 1 << 8, EFFECT_FLAT = 1 << 9, // For render box. EFFECT_NO_SHADING = 1 << 10, EFFECT_STRIP = 1 << 11, EFFECT_WIREFRAME = 1 << 12, EFFECT_GRID = 1 << 13, EFFECT_PROJ_SCREEN = 1 << 14, // Image project in screen. EFFECT_ANTIALIASING = 1 << 15, }; typedef struct { float ambient; float diffuse; float specular; float shininess; float smoothness; float shadow; int effects; float border_shadow; } render_settings_t; typedef struct renderer renderer_t; typedef struct render_item_t render_item_t; struct renderer { float view_mat[4][4]; float proj_mat[4][4]; int fbo; // The renderer target framebuffer. float scale; // For retina display. struct { float pitch; float yaw; bool fixed; // If set, then the light moves with the view. float intensity; } light; render_settings_t settings; render_item_t *items; }; void render_init(void); void render_deinit(void); void render_mesh(renderer_t *rend, const mesh_t *mesh, int effects); void render_grid(renderer_t *rend, const float plane[4][4], const uint8_t color[4], const float clip_box[4][4]); void render_line(renderer_t *rend, const float a[3], const float b[3], const uint8_t color[4]); void render_box(renderer_t *rend, const float box[4][4], const uint8_t color[4], int effects); void render_sphere(renderer_t *rend, const float mat[4][4]); void render_img(renderer_t *rend, texture_t *tex, const float mat[4][4], int efffects); /* * Function: render_img2 * Render an image directly from it's pixel data. * * XXX: this is experimental: eventually I think we should remove render_img * and only user render_img2 (renamed to render_img). */ void render_img2(renderer_t *rend, const uint8_t *data, int w, int h, int bpp, const float mat[4][4], int effects); void render_rect(renderer_t *rend, const float plane[4][4], int effects); // Flushes all the queued render items. Actually calls opengl. // rect: the viewport rect (passed to glViewport). // clear_color: clear the screen with this first. void render_submit(renderer_t *rend, const int rect[4], const uint8_t clear_color[4]); int render_get_default_settings(int i, char **name, render_settings_t *out); // Compute the light direction in the model coordinates (toward the light) void render_get_light_dir(const renderer_t *rend, float out[3]); // Ugly function that return the position of the block at a given id // when the mesh is rendered with render_mesh. void render_get_block_pos(renderer_t *rend, const mesh_t *mesh, int id, int pos[3]); /* ############################## * Section: Model3d * * Functions to render 3d vertex models, like cube, plane, etc. */ /* * Type: model_vertex_t * Container for a single vertex shader data. */ typedef struct { float pos[3] __attribute__((aligned(4))); float normal[3] __attribute__((aligned(4))); uint8_t color[4] __attribute__((aligned(4))); float uv[2] __attribute__((aligned(4))); } model_vertex_t; /* * Type: model3d_t * Define a 3d model. */ typedef struct { int nb_vertices; model_vertex_t *vertices; bool solid; bool cull; // Rendering buffers. // XXX: move this into the renderer, like for block_t GLuint vertex_buffer; int nb_lines; bool dirty; } model3d_t; /* * Function: model3d_init * Should be called once before any mode3d functions. */ void model3d_init(void); /* * Function: model3d_cube * Create a 3d cube from (0, 0, 0) to (1, 1, 1) */ model3d_t *model3d_cube(void); /* * Function: model3d_wire_cube * Create a 3d wire cube from (0, 0, 0) to (1, 1, 1) */ model3d_t *model3d_wire_cube(void); /* * Function: model3d_sphere * Create a sphere of radius 1, centered at (0, 0). */ model3d_t *model3d_sphere(int slices, int stacks); /* * Function: model3d_grid * Create a grid plane. */ model3d_t *model3d_grid(int nx, int ny); /* * Function: model3d_line * Create a line from (-0.5, 0, 0) to (+0.5, 0, 0). */ model3d_t *model3d_line(void); /* * Function: model3d_line * Create a 2d rect on xy plane, of size 1x1 centered on the origin. */ model3d_t *model3d_rect(void); /* * Function: model3d_line * Create a 2d rect on xy plane, of size 1x1 centered on the origin. */ model3d_t *model3d_wire_rect(void); /* * Function: model3d_render * Render a 3d model using OpenGL calls. */ void model3d_render(model3d_t *model3d, const float model[4][4], const float view[4][4], const float proj[4][4], const uint8_t color[4], const texture_t *tex, const float light[3], const float clip_box[4][4], int effects); // #### Palette ################ typedef struct { uint8_t color[4]; char name[32]; } palette_entry_t; typedef struct palette palette_t; struct palette { palette_t *next, *prev; // For the global list of palettes. char name[128]; int columns; int size; palette_entry_t *entries; }; // Load all the available palettes into a list. void palette_load_all(palette_t **list); // Generate an optimal palette whith a fixed number of colors from a mesh. void quantization_gen_palette(const mesh_t *mesh, int nb, uint8_t (*palette)[4]); // ############################# // #### Goxel : core object #### // Key id, same as GLFW for convenience. enum { KEY_ESCAPE = 256, KEY_ENTER = 257, KEY_TAB = 258, KEY_BACKSPACE = 259, KEY_DELETE = 261, KEY_RIGHT = 262, KEY_LEFT = 263, KEY_DOWN = 264, KEY_UP = 265, KEY_PAGE_UP = 266, KEY_PAGE_DOWN = 267, KEY_HOME = 268, KEY_END = 269, KEY_LEFT_SHIFT = 340, KEY_RIGHT_SHIFT = 344, KEY_CONTROL = 341, }; // Flags to set where the mouse snap. In order of priority. enum { SNAP_IMAGE_BOX = 1 << 0, SNAP_SELECTION_IN = 1 << 1, SNAP_SELECTION_OUT = 1 << 2, SNAP_MESH = 1 << 3, SNAP_PLANE = 1 << 4, SNAP_CAMERA = 1 << 5, // Used for laser tool. SNAP_LAYER_OUT = 1 << 6, // Snap the layer box. SNAP_ROUNDED = 1 << 8, // Round the result. }; // A finger touch or mouse click state. // `down` represent each button in the mouse. For touch events only the // first element is set. typedef struct { float pos[2]; bool down[3]; } touch_t; typedef struct inputs { int window_size[2]; float scale; bool keys[512]; // Table of all the pressed keys. uint32_t chars[16]; touch_t touches[4]; float mouse_wheel; int framebuffer; // Screen framebuffer } inputs_t; // Conveniance function to add a char in the inputs. void inputs_insert_char(inputs_t *inputs, uint32_t c); /* ######################################### * Section: Mouse gestures * Detect 2d mouse or touch gestures. * * The way it works is that we have to create one instance of * per gesture we can recognise, and then use the * function to update their states and call the callback * functions of active gestures. */ /* XXX: This part of the code is not very clear */ /* * Enum: GESTURE_TYPES * Define the different types of recognised gestures. * * GESTURE_DRAG - Click and drag the mouse. * GESTURE_CLICK - Single click. * GESTURE_PINCH - Two fingers pinch. * GESTURE_HOVER - Move the mouse without clicking. */ enum { GESTURE_DRAG = 1 << 0, GESTURE_CLICK = 1 << 1, GESTURE_PINCH = 1 << 2, GESTURE_HOVER = 1 << 3, }; /* * Enum: GESTURE_STATES * Define the states a gesture can be in. * * GESTURE_POSSIBLE - The gesture is not recognised yet (default state). * GESTURE_RECOGNISED - The gesture has been recognised. * GESTURE_BEGIN - The gesture has begun. * GESTURE_UPDATE - The gesture is in progress. * GESTURE_END - The testure has ended. * GESTURE_TRIGGERED - For click gestures: the gesture has occured. * GESTURE_FAILED - The gesture has failed. */ enum { GESTURE_POSSIBLE = 0, GESTURE_RECOGNISED, GESTURE_BEGIN, GESTURE_UPDATE, GESTURE_END, GESTURE_TRIGGERED, GESTURE_FAILED, }; /* * Type: gesture_t * Structure used to handle a given gesture. */ typedef struct gesture gesture_t; struct gesture { int type; int button; int state; float viewport[4]; float pos[2]; float start_pos[2][2]; float pinch; float rotation; int (*callback)(const gesture_t *gest, void *user); }; /* * Function: gesture_update * Update the state of a list of gestures, and call the gestures * callbacks as needed. * * Parameters: * nb - Number of gestures. * gestures - A pointer to an array of instances. * inputs - The inputs structure. * viewport - Current viewport rect. * user - User data pointer, passed to the callbacks. */ int gesture_update(int nb, gesture_t *gestures[], const inputs_t *inputs, const float viewport[4], void *user); /* ############################# * Section: Camera * Camera manipulation functions. */ /* Type: camera_t * Camera structure. * * The actual position of the camera is constructed from a distance, a * rotation and an offset: * * Pos = ofs * rot * dist * * Attributes: * next, prev - Used for linked list of cameras in an image. * name - Name to show in the GUI. * ortho - Set to true for orthographic projection. * dist - Distance used to compute the position. * rot - Camera rotation quaternion. * ofs - Lateral offset of the camera position. * fovy - Field of view in y direction. * aspect - Aspect ratio. * view_mat - Modelview transformation matrix (auto computed). * proj_mat - Projection matrix (auto computed). */ typedef struct camera camera_t; struct camera { camera_t *next, *prev; // List of camera in an image. char name[128]; // 127 chars max. bool ortho; // Set to true for orthographic projection. float dist; float rot[4]; // Quaternion. float ofs[3]; float fovy; float aspect; // Auto computed from other values: float view_mat[4][4]; // Model to view transformation. float proj_mat[4][4]; // Proj transform from camera coordinates. }; /* * Function: camera_new * Create a new camera. * * Parameters: * name - The name of the camera. * * Return: * A newly instanciated camera. */ camera_t *camera_new(const char *name); /* * Function: camera_delete * Delete a camera */ void camera_delete(camera_t *camera); /* * Function: camera_set * Set a camera position from an other camera. */ void camera_set(camera_t *camera, const camera_t *other); /* * Function: camera_update * Update camera matrices. */ void camera_update(camera_t *camera); /* * Function: camera_set_target * Adjust the camera settings so that the rotation works for a given * position. */ void camera_set_target(camera_t *camera, const float pos[3]); /* * Function: camera_get_ray * Get the raytracing ray of the camera at a given screen position. * * Parameters: * win - Pixel position in screen coordinates. * view - Viewport rect: [min_x, min_y, max_x, max_y]. * o - Output ray origin. * d - Output ray direction. */ void camera_get_ray(const camera_t *camera, const float win[2], const float viewport[4], float o[3], float d[3]); /* * Function: camera_fit_box * Move a camera so that a given box is entirely visible. */ void camera_fit_box(camera_t *camera, const float box[4][4]); /* * Function: camera_get_key * Return a value that is guarantied to change when the camera change. */ uint64_t camera_get_key(const camera_t *camera); typedef struct history history_t; typedef struct layer layer_t; struct layer { layer_t *next, *prev; mesh_t *mesh; int id; // Uniq id in the image (for clones). bool visible; char name[256]; // 256 chars max. float box[4][4]; // Bounding box. float mat[4][4]; // For 2d image layers. texture_t *image; // For clone layers: int base_id; uint64_t base_mesh_key; }; typedef struct image image_t; struct image { layer_t *layers; layer_t *active_layer; camera_t *cameras; camera_t *active_camera; float box[4][4]; // For saving. char *path; int export_width; int export_height; uint64_t saved_key; // image_get_key() value of saved file. image_t *history; image_t *history_next, *history_prev; }; image_t *image_new(void); void image_delete(image_t *img); layer_t *image_add_layer(image_t *img); void image_delete_layer(image_t *img, layer_t *layer); void image_move_layer(image_t *img, layer_t *layer, int d); layer_t *image_duplicate_layer(image_t *img, layer_t *layer); void image_merge_visible_layers(image_t *img); void image_history_push(image_t *img); void image_undo(image_t *img); void image_redo(image_t *img); bool image_layer_can_edit(const image_t *img, const layer_t *layer); /* * Function: image_get_key * Return a value that is guarantied to change when the image change. */ uint64_t image_get_key(const image_t *img); // ##### Procedural rendering ######################## // The possible states of the procedural program. enum { PROC_INIT, PROC_PARSE_ERROR, PROC_READY, PROC_RUNNING, PROC_DONE, }; typedef struct proc { struct proc_node *prog; // AST of the program. struct proc_ctx *ctxs; // Rendering stack during execution. int state; int frame; // Rendering frame. bool in_frame; // Set if the current frame is not finished. struct { char *str; // Set in case of parsing or execution error. int line; } error; } gox_proc_t; int proc_parse(const char *txt, gox_proc_t *proc); void proc_release(gox_proc_t *proc); int proc_start(gox_proc_t *proc, const float box[4][4]); int proc_stop(gox_proc_t *proc); int proc_iter(gox_proc_t *proc, mesh_t *mesh, const painter_t *painter); // Represent a 3d cursor. // The program keeps track of two cursors, that are then used by the tools. enum { // The state flags of the cursor. CURSOR_PRESSED = 1 << 0, CURSOR_SHIFT = 1 << 1, CURSOR_CTRL = 1 << 2, CURSOR_OUT = 1 << 3, // Outside of sensing area. }; typedef struct gesture3d gesture3d_t; typedef struct cursor { float pos[3]; float normal[3]; int snap_mask; int snaped; int flags; // Union of CURSOR_* values. float snap_offset; // XXX: fix this. } cursor_t; // #### 3d gestures struct gesture3d { int type; int state; int buttons; // CURSOR_SHIFT | CURSOR_CTRL cursor_t *cursor; int (*callback)(gesture3d_t *gest, void *user); }; int gesture3d(gesture3d_t *gest, cursor_t *curs, void *user); enum { // Tools flags. TOOL_REQUIRE_CAN_EDIT = 1 << 0, // Set to tools that can edit the layer. TOOL_REQUIRE_CAN_MOVE = 1 << 1, // Set to tools that can move the layer. TOOL_ALLOW_PICK_COLOR = 1 << 2, // Ctrl switches to pick color tool. }; // Tools typedef struct tool tool_t; struct tool { int id; const char *action_id; int (*iter_fn)(tool_t *tool, const float viewport[4]); int (*gui_fn)(tool_t *tool); const char *default_shortcut; int state; // XXX: to be removed I guess. int flags; }; #define TOOL_REGISTER(id_, name_, klass_, ...) \ static klass_ GOX_tool_##id_ = {\ .tool = { \ .id = id_, .action_id = "tool_set_" #name_, __VA_ARGS__ \ } \ }; \ static void GOX_register_tool_##tool_(void) __attribute__((constructor)); \ static void GOX_register_tool_##tool_(void) { \ tool_register_(&GOX_tool_##id_.tool); \ } void tool_register_(const tool_t *tool); int tool_iter(tool_t *tool, const float viewport[4]); int tool_gui(tool_t *tool); int tool_gui_snap(void); int tool_gui_shape(void); int tool_gui_radius(void); int tool_gui_smoothness(void); int tool_gui_color(void); int tool_gui_symmetry(void); typedef struct goxel { int screen_size[2]; float screen_scale; image_t *image; mesh_t *layers_mesh; // All the layers combined. // Tools can set this mesh and it will replace the current layer mesh // during render. mesh_t *tool_mesh; mesh_t *render_mesh; // All the layers + tool mesh. struct { mesh_t *mesh; float box[4][4]; } clipboard; history_t *history; // Undo/redo history. int snap_mask; // Global snap mask (can edit in the GUI). float snap_offset; // Only for brush tool, remove that? float plane[4][4]; // The snapping plane. bool show_export_viewport; camera_t camera; bool use_cycles; // Render with cycles. uint8_t back_color[4]; uint8_t grid_color[4]; uint8_t image_box_color[4]; bool hide_box; texture_t *pick_fbo; painter_t painter; renderer_t rend; cursor_t cursor; tool_t *tool; float tool_radius; bool no_edit; // Disable editing. // Some state for the tool iter functions. float tool_plane[4][4]; bool tool_shape_two_steps; // Param of the shape tool. float selection[4][4]; // The selection box. struct { float rotation[4]; float pos[2]; float camera_ofs[3]; } move_origin; palette_t *palettes; // The list of all the palettes palette_t *palette; // The current color palette char *help_text; // Seen in the bottom of the screen. char *hint_text; // Seen in the bottom of the screen. int frame_count; // Global frames counter. double frame_time; // Clock time at beginning of the frame (sec) double fps; // Average fps. bool quit; // Set to true to quit the application. bool show_wireframe; // Show debug wireframe on meshes. struct { gesture_t drag; gesture_t pan; gesture_t rotate; gesture_t hover; gesture_t pinch; } gestures; // Hold info about the cycles rendering task. struct { int status; // 0: stopped, 1: running, 2: finished. uint8_t *buf; // RGBA buffer. int w, h; // Size of the buffer. char output[1024]; // Output path. float progress; bool force_restart; } render_task; // Used to check if the active mesh changed to play tick sound. uint64_t last_mesh_key; double last_click_time; } goxel_t; // the global goxel instance. extern goxel_t goxel; // XXX: add some doc. void goxel_init(void); void goxel_release(void); void goxel_reset(void); int goxel_iter(inputs_t *inputs); void goxel_render(void); void goxel_render_view(const float viewport[4]); void goxel_render_export_view(const float viewport[4]); // Called by the gui when the mouse hover a 3D view. // XXX: change the name since we also call it when the mouse get out of // the view. void goxel_mouse_in_view(const float viewport[4], const inputs_t *inputs, bool capture_keys); // Recompute the meshes. mask from MESH_ enum. void goxel_update_meshes(int mask); void goxel_set_help_text(const char *msg, ...); void goxel_set_hint_text(const char *msg, ...); void goxel_import_image_plane(const char *path); // Render the view into an RGB[A] buffer. void goxel_render_to_buf(uint8_t *buf, int w, int h, int bpp); // ############################# void save_to_file(const char *path, bool with_preview); int load_from_file(const char *path); // Iter info of a gox file, without actually reading it. // For the moment only returns the image preview if available. int gox_iter_infos(const char *path, int (*callback)(const char *attr, int size, void *value, void *user), void *user); // #### Colors functions ####### void hsl_to_rgb(const uint8_t hsl[3], uint8_t rgb[3]); void rgb_to_hsl(const uint8_t rgb[3], uint8_t hsl[3]); /* ################################ * Section: Gui */ void gui_release(void); void gui_iter(const inputs_t *inputs); void gui_render(void); // Gui widgets: bool gui_collapsing_header(const char *label); void gui_text(const char *label, ...); bool gui_button(const char *label, float w, int icon); bool gui_button_right(const char *label, int icon); void gui_group_begin(const char *label); void gui_group_end(void); bool gui_checkbox(const char *label, bool *v, const char *hint); bool gui_input_int(const char *label, int *v, int minv, int maxv); bool gui_input_float(const char *label, float *v, float step, float minv, float maxv, const char *format); bool gui_angle(const char *id, float *v, int vmin, int vmax); bool gui_bbox(float box[4][4]); bool gui_quat(const char *label, float q[4]); bool gui_action_button(const char *id, const char *label, float size, const char *sig, ...); bool gui_action_checkbox(const char *id, const char *label); bool gui_selectable(const char *name, bool *v, const char *tooltip, float w); bool gui_selectable_icon(const char *name, bool *v, int icon); bool gui_color(const char *label, uint8_t color[4]); bool gui_input_text(const char *label, char *buf, int size); bool gui_input_text_multiline(const char *label, char *buf, int size, float width, float height); void gui_input_text_multiline_highlight(int line); bool gui_combo(const char *label, int *v, const char **names, int nb); float gui_get_avail_width(void); void gui_same_line(void); void gui_enabled_begin(bool enabled); void gui_enabled_end(void); // Add an icon in top left corner of last item. void gui_floating_icon(int icon); void gui_alert(const char *title, const char *msg); void gui_columns(int count); void gui_next_column(void); void gui_separator(void); void gui_push_id(const char *id); void gui_pop_id(void); enum { GUI_POPUP_FULL = 1 << 0, GUI_POPUP_RESIZE = 1 << 1, }; /* * Function: gui_open_popup * Open a modal popup. * * Parameters: * title - The title of the popup. * flags - Union of values. * data - Data passed to the popup. It will be automatically released * by the gui. * func - The popup function, that render the popup gui. Should return * true to close the popup. */ void gui_open_popup(const char *title, int flags, void *data, bool (*func)(void *data)); void gui_popup_body_begin(void); void gui_popup_body_end(void); // ############################# void wavefront_export(const mesh_t *mesh, const char *path); void ply_export(const mesh_t *mesh, const char *path); // ##### Assets manager ######################## // All the assets are saved in binary directly in the code, using // tool/create_assets.py. const void *assets_get(const char *url, int *size); // List all the assets in a given asset dir. // Return the number of assets. // If f returns not 0, the asset is skipped. int assets_list(const char *url, void *user, int (*f)(int i, const char *path, void *user)); // Basic mustache templates support // Check povray.c for an example of usage. typedef struct mustache mustache_t; mustache_t *mustache_root(void); mustache_t *mustache_add_dict(mustache_t *m, const char *key); mustache_t *mustache_add_list(mustache_t *m, const char *key); void mustache_add_str(mustache_t *m, const char *key, const char *fmt, ...); int mustache_render(const mustache_t *m, const char *templ, char *out); void mustache_free(mustache_t *m); // ####### Cache manager ######################### // Allow to cache blocks merge operations. typedef struct cache cache_t; // Create a new cache with a given max size (in byte). cache_t *cache_create(int size); // Add an item into the cache. // Inputs: // key, keylen Define the unique key for the cache item. // data Pointer to the item data. The cache takes ownership. // cost Cost of the data used to compute the cache usage. // It doesn't have to be the size. // delfunc Function that the cache can use to free the data. void cache_add(cache_t *cache, const void *key, int keylen, void *data, int cost, int (*delfunc)(void *data)); // Return an item from the cache. // Returns // The data owned by the cache, or NULL if no item with this key is in // the cache. void *cache_get(cache_t *cache, const void *key, int keylen); // ####### Sound ################################# void sound_init(void); void sound_play(const char *sound, float volume, float pitch); void sound_iter(void); bool sound_is_enabled(void); void sound_set_enabled(bool v); // Section: cycles void cycles_init(void); void cycles_release(void); void cycles_render(uint8_t *buffer, int *w, int *h, const camera_t *cam, float *progress, bool force_restart); // Section: tests /* Function: tests_run * Run all the unit tests */ void tests_run(void); #endif // GOXEL_H goxel-0.8.1/src/gui.cpp000066400000000000000000002006631334742672700147430ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ extern "C" { #include "goxel.h" } #define IM_VEC4_CLASS_EXTRA \ ImVec4(const uint8_t f[4]) { \ x = f[0] / 255.; \ y = f[1] / 255.; \ z = f[2] / 255.; \ w = f[3] / 255.; } \ #define IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS #define IMGUI_INCLUDE_IMGUI_USER_INL #include "../ext_src/imgui/imgui.h" #include "../ext_src/imgui/imgui_internal.h" #ifndef GUI_TOOLS_COLUMNS_NB # define GUI_TOOLS_COLUMNS_NB 4 #endif #ifndef GUI_PALETTE_COLUMNS_NB # define GUI_PALETTE_COLUMNS_NB 8 #endif extern "C" { bool gui_settings_popup(void *data); } static inline ImVec4 color_lighten(ImVec4 c, float k) { c.x *= k; c.y *= k; c.z *= k; return c; } namespace ImGui { bool GoxInputFloat(const char *label, float *v, float step = 0.1, float minv = -FLT_MAX, float maxv = FLT_MAX, const char *format = "%.1f"); void GoxBox(ImVec2 pos, ImVec2 size, bool selected, int rounding_corners_flags = ~0); void GoxBox2(ImVec2 pos, ImVec2 size, ImVec4 color, bool fill, float thickness = 1, int rounding_corners_flags = ~0); }; static texture_t *g_tex_icons = NULL; static const char *VSHADER = " \n" "attribute vec3 a_pos; \n" "attribute vec2 a_tex_pos; \n" "attribute vec4 a_color; \n" " \n" "uniform mat4 u_proj_mat; \n" " \n" "varying vec2 v_tex_pos; \n" "varying vec4 v_color; \n" " \n" "void main() \n" "{ \n" " gl_Position = u_proj_mat * vec4(a_pos, 1.0); \n" " v_tex_pos = a_tex_pos; \n" " v_color = a_color; \n" "} \n" ; static const char *FSHADER = " \n" "#ifdef GL_ES \n" "precision mediump float; \n" "#endif \n" " \n" "uniform sampler2D u_tex; \n" " \n" "varying vec2 v_tex_pos; \n" "varying vec4 v_color; \n" " \n" "void main() \n" "{ \n" " gl_FragColor = v_color * texture2D(u_tex, v_tex_pos); \n" "} \n" ; typedef struct { float rect[4]; } view_t; typedef struct { GLuint prog; GLuint a_pos_l; GLuint a_tex_pos_l; GLuint a_color_l; GLuint u_tex_l; GLuint u_proj_mat_l; } prog_t; typedef struct gui_t { prog_t prog; GLuint array_buffer; GLuint index_buffer; int current_panel; view_t view; int min_panel_size; struct { gesture_t drag; gesture_t hover; } gestures; bool mouse_in_view; bool capture_mouse; int group; struct { const char *title; bool (*func)(void *data); void (*on_closed)(void); int flags; void *data; // Automatically released when popup close. bool opened; } popup[8]; // Stack of modal popups int popup_count; } gui_t; static gui_t *gui = NULL; // Notify the gui that we want the panel size to be at least as large as // the last item. static void auto_adjust_panel_size(float w = 0) { if (w == 0) w = ImGui::GetItemRectMax().x; ImGuiStyle& style = ImGui::GetStyle(); if (ImGui::GetScrollMaxY() > 0) w += style.ScrollbarSize; gui->min_panel_size = max(gui->min_panel_size, w); } static void on_click(void) { if (DEFINED(GUI_SOUND)) sound_play("click", 1.0, 1.0); } static bool isCharPressed(int c) { ImGuiContext& g = *GImGui; return g.IO.InputCharacters[0] == c; } #define COLOR(g, c, s) ({ \ uint8_t c_[4]; \ theme_get_color(THEME_GROUP_##g, THEME_COLOR_##c, (s), c_); \ ImVec4 ret_ = c_; ret_; }) /* * Return the color that should be used to draw an icon depending on the * style and the icon. Some icons shouldn't have their color change with * the style and some other do. */ static uint32_t get_icon_color(int icon, bool selected) { return (icon >= ICON_COLORIZABLE_START && icon < ICON_COLORIZABLE_END) ? ImGui::GetColorU32(COLOR(WIDGET, TEXT, selected)) : 0xFFFFFFFF; } static void init_prog(prog_t *p) { p->prog = gl_create_prog(VSHADER, FSHADER, NULL); GL(glUseProgram(p->prog)); #define UNIFORM(x) p->x##_l = glGetUniformLocation(p->prog, #x); #define ATTRIB(x) p->x##_l = glGetAttribLocation(p->prog, #x) UNIFORM(u_proj_mat); UNIFORM(u_tex); ATTRIB(a_pos); ATTRIB(a_tex_pos); ATTRIB(a_color); #undef ATTRIB #undef UNIFORM GL(glUniform1i(p->u_tex_l, 0)); } static void render_prepare_context(void) { #define OFFSETOF(TYPE, ELEMENT) ((size_t)&(((TYPE *)0)->ELEMENT)) // Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled GL(glEnable(GL_BLEND)); GL(glBlendEquation(GL_FUNC_ADD)); GL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); GL(glDisable(GL_CULL_FACE)); GL(glDisable(GL_DEPTH_TEST)); GL(glEnable(GL_SCISSOR_TEST)); GL(glActiveTexture(GL_TEXTURE0)); // Setup orthographic projection matrix const float width = ImGui::GetIO().DisplaySize.x; const float height = ImGui::GetIO().DisplaySize.y; const float ortho_projection[4][4] = { { 2.0f/width, 0.0f, 0.0f, 0.0f }, { 0.0f, 2.0f/-height, 0.0f, 0.0f }, { 0.0f, 0.0f, -1.0f, 0.0f }, { -1.0f, 1.0f, 0.0f, 1.0f }, }; GL(glUseProgram(gui->prog.prog)); GL(glUniformMatrix4fv(gui->prog.u_proj_mat_l, 1, 0, &ortho_projection[0][0])); GL(glBindBuffer(GL_ARRAY_BUFFER, gui->array_buffer)); GL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gui->index_buffer)); // This could probably be done only at init time. GL(glEnableVertexAttribArray(gui->prog.a_pos_l)); GL(glEnableVertexAttribArray(gui->prog.a_tex_pos_l)); GL(glEnableVertexAttribArray(gui->prog.a_color_l)); GL(glVertexAttribPointer(gui->prog.a_pos_l, 2, GL_FLOAT, false, sizeof(ImDrawVert), (void*)OFFSETOF(ImDrawVert, pos))); GL(glVertexAttribPointer(gui->prog.a_tex_pos_l, 2, GL_FLOAT, false, sizeof(ImDrawVert), (void*)OFFSETOF(ImDrawVert, uv))); GL(glVertexAttribPointer(gui->prog.a_color_l, 4, GL_UNSIGNED_BYTE, true, sizeof(ImDrawVert), (void*)OFFSETOF(ImDrawVert, col))); #undef OFFSETOF } static void ImImpl_RenderDrawLists(ImDrawData* draw_data) { const float height = ImGui::GetIO().DisplaySize.y; const float scale = ImGui::GetIO().DisplayFramebufferScale.y; render_prepare_context(); for (int n = 0; n < draw_data->CmdListsCount; n++) { const ImDrawList* cmd_list = draw_data->CmdLists[n]; const ImDrawIdx* idx_buffer_offset = 0; if (cmd_list->VtxBuffer.size()) GL(glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)cmd_list->VtxBuffer.size() * sizeof(ImDrawVert), (GLvoid*)&cmd_list->VtxBuffer.front(), GL_DYNAMIC_DRAW)); if (cmd_list->IdxBuffer.size()) GL(glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)cmd_list->IdxBuffer.size() * sizeof(ImDrawIdx), (GLvoid*)&cmd_list->IdxBuffer.front(), GL_DYNAMIC_DRAW)); for (const ImDrawCmd* pcmd = cmd_list->CmdBuffer.begin(); pcmd != cmd_list->CmdBuffer.end(); pcmd++) { if (pcmd->UserCallback) { pcmd->UserCallback(cmd_list, pcmd); render_prepare_context(); // Restore context. } else { GL(glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->TextureId)); GL(glScissor((int)pcmd->ClipRect.x * scale, (int)(height - pcmd->ClipRect.w) * scale, (int)(pcmd->ClipRect.z - pcmd->ClipRect.x) * scale, (int)(pcmd->ClipRect.w - pcmd->ClipRect.y) * scale)); GL(glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, GL_UNSIGNED_SHORT, idx_buffer_offset)); } idx_buffer_offset += pcmd->ElemCount; } } GL(glDisable(GL_SCISSOR_TEST)); } static void load_fonts_texture() { ImGuiIO& io = ImGui::GetIO(); float scale = io.DisplayFramebufferScale.y; unsigned char* pixels; int width, height; const void *data; int data_size; ImFontConfig conf; const ImWchar ranges[] = { 0x0020, 0x00FF, // Basic Latin + Latin Supplement 0x25A0, 0x25FF, // Geometric shapes 0 }; conf.FontDataOwnedByAtlas = false; data = assets_get("asset://data/fonts/DejaVuSans-light.ttf", &data_size); assert(data); io.Fonts->AddFontFromMemoryTTF((void*)data, data_size, 14 * scale, &conf, ranges); io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); GLuint tex_id; glGenTextures(1, &tex_id); glBindTexture(GL_TEXTURE_2D, tex_id); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels); io.Fonts->TexID = (void *)(intptr_t)tex_id; } static void init_ImGui(const inputs_t *inputs) { ImGui::CreateContext(); ImGuiIO& io = ImGui::GetIO(); io.DeltaTime = 1.0f/60.0f; io.KeyMap[ImGuiKey_Tab] = KEY_TAB; io.KeyMap[ImGuiKey_LeftArrow] = KEY_LEFT; io.KeyMap[ImGuiKey_RightArrow] = KEY_RIGHT; io.KeyMap[ImGuiKey_UpArrow] = KEY_UP; io.KeyMap[ImGuiKey_DownArrow] = KEY_DOWN; io.KeyMap[ImGuiKey_PageUp] = KEY_PAGE_UP; io.KeyMap[ImGuiKey_PageDown] = KEY_PAGE_DOWN; io.KeyMap[ImGuiKey_Home] = KEY_HOME; io.KeyMap[ImGuiKey_End] = KEY_END; io.KeyMap[ImGuiKey_Delete] = KEY_DELETE; io.KeyMap[ImGuiKey_Backspace] = KEY_BACKSPACE; io.KeyMap[ImGuiKey_Enter] = KEY_ENTER; io.KeyMap[ImGuiKey_Escape] = KEY_ESCAPE; io.KeyMap[ImGuiKey_A] = 'A'; io.KeyMap[ImGuiKey_C] = 'C'; io.KeyMap[ImGuiKey_V] = 'V'; io.KeyMap[ImGuiKey_X] = 'X'; io.KeyMap[ImGuiKey_Y] = 'Y'; io.KeyMap[ImGuiKey_Z] = 'Z'; io.DisplayFramebufferScale = ImVec2(inputs->scale, inputs->scale); io.FontGlobalScale = 1 / inputs->scale; if (DEFINED(__linux__)) { io.SetClipboardTextFn = sys_set_clipboard_text; io.GetClipboardTextFn = sys_get_clipboard_text; } load_fonts_texture(); ImGuiStyle& style = ImGui::GetStyle(); style.WindowRounding = 0; style.WindowPadding = ImVec2(4, 4); } static bool color_edit(const char *name, uint8_t color[4], const uint8_t backup_color[4]) { bool ret = false; ImVec4 col = color; ImVec4 backup_col; if (backup_color) backup_col = backup_color; ImGui::Text("Pick Color"); ImGui::Separator(); ret |= ImGui::ColorPicker4("##picker", (float*)&col, ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview | ImGuiColorEditFlags_NoAlpha); ImGui::SameLine(); ImGui::BeginGroup(); ImGui::Text("Current"); ImGui::ColorButton("##current", col, ImGuiColorEditFlags_NoPicker, ImVec2(60, 40)); if (backup_color) { ImGui::Text("Previous"); if (ImGui::ColorButton("##previous", backup_col, ImGuiColorEditFlags_NoPicker, ImVec2(60, 40))) { col = backup_col; ret = true; } } ImGui::EndGroup(); if (ret) { color[0] = col.x * 255; color[1] = col.y * 255; color[2] = col.z * 255; color[3] = col.w * 255; } return ret; } static int on_gesture(const gesture_t *gest, void *user) { gui_t *gui = (gui_t*)user; ImGuiIO& io = ImGui::GetIO(); io.MousePos = ImVec2(gest->pos[0], gest->pos[1]); io.MouseDown[0] = (gest->type == GESTURE_DRAG) && (gest->state != GESTURE_END); if (gest->state == GESTURE_BEGIN && !gui->mouse_in_view) gui->capture_mouse = true; if (gest->state == GESTURE_END || gest->type == GESTURE_HOVER) gui->capture_mouse = false; return 0; } static void gui_init(const inputs_t *inputs) { gui = (gui_t*)calloc(1, sizeof(*gui)); init_prog(&gui->prog); GL(glGenBuffers(1, &gui->array_buffer)); GL(glGenBuffers(1, &gui->index_buffer)); init_ImGui(inputs); gui->gestures.drag.type = GESTURE_DRAG; gui->gestures.drag.callback = on_gesture; gui->gestures.hover.type = GESTURE_HOVER; gui->gestures.hover.callback = on_gesture; g_tex_icons = texture_new_image("asset://data/images/icons.png", 0); GL(glBindTexture(GL_TEXTURE_2D, g_tex_icons->tex)); } void gui_release(void) { ImGui::DestroyContext(); } // XXX: Move this somewhere else. void render_axis_arrows(const float view_size[2]) { const float AXIS[][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; int i; const int d = 40; // Distance to corner of the view. float spos[2] = {d, d}; float pos[3], normal[3], b[3]; uint8_t c[4]; float s = 1; float view[4] = {0, 0, view_size[0], view_size[1]}; camera_get_ray(&goxel.camera, spos, view, pos, normal); if (goxel.camera.ortho) s = goxel.camera.dist / 32; else vec3_iaddk(pos, normal, 100); for (i = 0; i < 3; i++) { vec3_addk(pos, AXIS[i], 2.0 * s, b); vec4_set(c, AXIS[i][0] * 255, AXIS[i][1] * 255, AXIS[i][2] * 255, 255); render_line(&goxel.rend, pos, b, c); } } void render_view(const ImDrawList* parent_list, const ImDrawCmd* cmd) { float scale = ImGui::GetIO().DisplayFramebufferScale.y; view_t *view = (view_t*)cmd->UserCallbackData; const float width = ImGui::GetIO().DisplaySize.x; const float height = ImGui::GetIO().DisplaySize.y; // XXX: 8 here means 'export' panel. Need to use an enum or find a // better way! if (gui->current_panel == 8 && goxel.render_task.status) { goxel_render_export_view(view->rect); } else { goxel_render_view(view->rect); } GL(glViewport(0, 0, width * scale, height * scale)); } // XXX: better replace this by something more automatic. static void auto_grid(int nb, int i, int col) { if ((i + 1) % col != 0) ImGui::SameLine(); } static void tools_panel(void) { const struct { int tool; const char *tool_id; const char *name; int icon; } values[] = { {TOOL_BRUSH, "brush", "Brush", ICON_TOOL_BRUSH}, {TOOL_SHAPE, "shape", "Shape", ICON_TOOL_SHAPE}, {TOOL_LASER, "laser", "Laser", ICON_TOOL_LASER}, {TOOL_SET_PLANE, "plane", "Plane", ICON_TOOL_PLANE}, {TOOL_MOVE, "move", "Move", ICON_TOOL_MOVE}, {TOOL_PICK_COLOR, "pick_color","Pick Color", ICON_TOOL_PICK}, {TOOL_SELECTION, "selection", "Selection", ICON_TOOL_SELECTION}, {TOOL_EXTRUDE, "extrude", "Extrude", ICON_TOOL_EXTRUDE}, {TOOL_PROCEDURAL, "procedural","Procedural", ICON_TOOL_PROCEDURAL}, }; const int nb = ARRAY_SIZE(values); int i; bool v; char action_id[64]; char label[64]; const action_t *action = NULL; gui_group_begin(NULL); for (i = 0; i < nb; i++) { v = goxel.tool->id == values[i].tool; sprintf(label, "%s", values[i].name); if (values[i].tool_id) { sprintf(action_id, "tool_set_%s", values[i].tool_id); action = action_get(action_id); assert(action); if (*action->shortcut) sprintf(label, "%s (%s)", values[i].name, action->shortcut); } if (gui_selectable_icon(label, &v, values[i].icon)) { action_exec(action, ""); } auto_grid(nb, i, GUI_TOOLS_COLUMNS_NB); } gui_group_end(); auto_adjust_panel_size(); ImGui::SetNextTreeNodeOpen(true, ImGuiCond_Once); if (gui_collapsing_header("Tool Options")) tool_gui(goxel.tool); } static void toggle_layer_only_visible(layer_t *layer) { layer_t *other; bool others_all_invisible = true; DL_FOREACH(goxel.image->layers, other) { if (other == layer) continue; if (other->visible) { others_all_invisible = false; break; } } DL_FOREACH(goxel.image->layers, other) other->visible = others_all_invisible; layer->visible = true; } static bool layer_item(int i, int icon, bool *visible, bool *edit, char *name, int len) { const theme_t *theme = theme_get(); bool ret = false; bool edit_ = *edit; static char *edit_name = NULL; static bool start_edit; float font_size = ImGui::GetFontSize(); ImVec2 center; ImVec2 uv0, uv1; ImDrawList* draw_list = ImGui::GetWindowDrawList(); ImGui::PushID(i); ImGui::PushStyleColor(ImGuiCol_Button, COLOR(WIDGET, INNER, *edit)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, color_lighten(COLOR(WIDGET, INNER, *edit), 1.2)); if (visible) { if (gui_selectable_icon("##visible", &edit_, *visible ? ICON_VISIBILITY : ICON_VISIBILITY_OFF)) { *visible = !*visible; ret = true; } ImGui::SameLine(); } if (edit_name != name) { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0.5)); if (icon != -1) { ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(theme->sizes.icons_height / 1.5, 0)); } if (ImGui::Button(name, ImVec2(-1, theme->sizes.icons_height))) { *edit = true; ret = true; } if (icon != -1) ImGui::PopStyleVar(); if (icon > 0) { center = ImGui::GetItemRectMin() + ImVec2(theme->sizes.icons_height / 2 / 1.5, theme->sizes.icons_height / 2); uv0 = ImVec2(((icon - 1) % 8) / 8.0, ((icon - 1) / 8) / 8.0); uv1 = ImVec2(uv0.x + 1. / 8, uv0.y + 1. / 8); draw_list->AddImage( (void*)(intptr_t)g_tex_icons->tex, center - ImVec2(12, 12), center + ImVec2(12, 12), uv0, uv1, get_icon_color(icon, 0)); } ImGui::PopStyleVar(); if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0)) { edit_name = name; start_edit = true; } } else { if (start_edit) ImGui::SetKeyboardFocusHere(); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(theme->sizes.item_padding_h, (theme->sizes.icons_height - font_size) / 2)); ImGui::InputText("##name_edit", name, len, ImGuiInputTextFlags_AutoSelectAll); if (!start_edit && !ImGui::IsItemActive()) edit_name = NULL; start_edit = false; ImGui::PopStyleVar(); } ImGui::PopStyleColor(2); ImGui::PopID(); return ret; } static void layers_panel(void) { layer_t *layer; int i = 0, icon, bbox[2][3]; bool current, visible, bounded; gui_group_begin(NULL); DL_FOREACH(goxel.image->layers, layer) { current = goxel.image->active_layer == layer; visible = layer->visible; icon = layer->base_id ? ICON_LINK : -1; layer_item(i, icon, &visible, ¤t, layer->name, sizeof(layer->name)); if (current && goxel.image->active_layer != layer) { goxel.image->active_layer = layer; goxel_update_meshes(-1); } if (visible != layer->visible) { layer->visible = visible; if (ImGui::IsKeyDown(KEY_LEFT_SHIFT)) toggle_layer_only_visible(layer); goxel_update_meshes(-1); } i++; auto_adjust_panel_size(); } gui_group_end(); gui_action_button("img_new_layer", NULL, 0, ""); ImGui::SameLine(); gui_action_button("img_del_layer", NULL, 0, ""); ImGui::SameLine(); gui_action_button("img_move_layer_up", NULL, 0, ""); ImGui::SameLine(); gui_action_button("img_move_layer_down", NULL, 0, ""); auto_adjust_panel_size(); gui_group_begin(NULL); gui_action_button("img_duplicate_layer", "Duplicate", 1, ""); gui_action_button("img_clone_layer", "Clone", 1, ""); gui_action_button("img_merge_visible_layers", "Merge visible", 1, ""); layer = goxel.image->active_layer; bounded = !box_is_null(layer->box); if (bounded && gui_button("Crop to box", 1, 0)) { mesh_crop(layer->mesh, layer->box); goxel_update_meshes(-1); } if (!box_is_null(goxel.image->box) && gui_button("Crop to image", 1, 0)) { mesh_crop(layer->mesh, goxel.image->box); goxel_update_meshes(-1); } gui_group_end(); auto_adjust_panel_size(); if (layer->base_id) { gui_group_begin(NULL); gui_action_button("img_unclone_layer", "Unclone", 1, ""); gui_action_button("img_select_parent_layer", "Select parent", 1, ""); gui_group_end(); } if (layer->image) { gui_action_button("img_image_layer_to_mesh", "To Mesh", 1, ""); } if (ImGui::Checkbox("Bounded", &bounded)) { if (bounded) { mesh_get_bbox(layer->mesh, bbox, true); if (bbox[0][0] > bbox[1][0]) memset(bbox, 0, sizeof(bbox)); bbox_from_aabb(layer->box, bbox); } else { mat4_copy(mat4_zero, layer->box); } } if (bounded) gui_bbox(layer->box); } static void view_panel(void) { // XXX: I don't like to use this array. const struct { uint8_t *color; const char *label; } COLORS[] = { {goxel.back_color, "Back color"}, {goxel.grid_color, "Grid color"}, {goxel.image_box_color, "Box color"}, }; int i; ImVec4 c; gui_group_begin("Light"); gui_angle("Pitch", &goxel.rend.light.pitch, -90, +90); gui_angle("Yaw", &goxel.rend.light.yaw, 0, 360); gui_checkbox("Fixed", &goxel.rend.light.fixed, NULL); gui_group_end(); for (i = 0; i < (int)ARRAY_SIZE(COLORS); i++) { ImGui::PushID(COLORS[i].label); c = COLORS[i].color; ImGui::ColorButton(COLORS[i].label, c); if (ImGui::BeginPopupContextItem("color context menu", 0)) { color_edit("##edit", COLORS[i].color, NULL); if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } ImGui::SameLine(); ImGui::Text("%s", COLORS[i].label); ImGui::PopID(); } gui_checkbox("Hide box", &goxel.hide_box, NULL); } static bool render_palette_entry(const uint8_t color[4], uint8_t target[4]) { bool ret; ImDrawList* draw_list = ImGui::GetWindowDrawList(); const theme_t *theme = theme_get(); ImGui::PushStyleColor(ImGuiCol_Button, color); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, color); ret = ImGui::Button("", ImVec2(theme->sizes.item_height, theme->sizes.item_height)); if (memcmp(color, target, 4) == 0) { draw_list->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), 0xFFFFFFFF, 0, 0, 1); } ImGui::PopStyleColor(2); if (ret) { on_click(); memcpy(target, color, 4); } return ret; } static void palette_panel(void) { palette_t *p; int i, current, nb = 0, nb_col = GUI_PALETTE_COLUMNS_NB; const char **names; DL_COUNT(goxel.palettes, p, nb); names = (const char**)calloc(nb, sizeof(*names)); i = 0; DL_FOREACH(goxel.palettes, p) { if (p == goxel.palette) current = i; names[i++] = p->name; } ImGui::PushItemWidth(-1); if (gui_combo("##palettes", ¤t, names, nb)) { goxel.palette = goxel.palettes; for (i = 0; i < current; i++) goxel.palette = goxel.palette->next; } ImGui::PopItemWidth(); free(names); p = goxel.palette; for (i = 0; i < p->size; i++) { ImGui::PushID(i); render_palette_entry(p->entries[i].color, goxel.painter.color); auto_adjust_panel_size(); if ((i + 1) % nb_col && i != p->size - 1) ImGui::SameLine(); ImGui::PopID(); } } static void material_advanced_panel(void) { float v; ImVec4 c; ImGui::PushID("render_advanced"); gui_group_begin(NULL); v = goxel.rend.settings.border_shadow; if (gui_input_float("bshadow", &v, 0.1, 0.0, 1.0, NULL)) { v = clamp(v, 0, 1); \ goxel.rend.settings.border_shadow = v; } #define MAT_FLOAT(name, min, max) \ v = goxel.rend.settings.name; \ if (gui_input_float(#name, &v, 0.1, min, max, NULL)) { \ v = clamp(v, min, max); \ goxel.rend.settings.name = v; \ } \ auto_adjust_panel_size(); MAT_FLOAT(ambient, 0, 1); MAT_FLOAT(diffuse, 0, 1); MAT_FLOAT(specular, 0, 1); MAT_FLOAT(shininess, 0.1, 10); MAT_FLOAT(smoothness, 0, 1); #undef MAT_FLOAT gui_group_end(); ImGui::CheckboxFlags("Borders", (unsigned int*)&goxel.rend.settings.effects, EFFECT_BORDERS); ImGui::CheckboxFlags("Borders all", (unsigned int*)&goxel.rend.settings.effects, EFFECT_BORDERS_ALL); ImGui::CheckboxFlags("See back", (unsigned int*)&goxel.rend.settings.effects, EFFECT_SEE_BACK); if (ImGui::CheckboxFlags("Marching Cubes", (unsigned int*)&goxel.rend.settings.effects, EFFECT_MARCHING_CUBES)) { goxel.rend.settings.smoothness = 1; } auto_adjust_panel_size(); if (goxel.rend.settings.effects & EFFECT_MARCHING_CUBES) ImGui::CheckboxFlags("Flat", (unsigned int*)&goxel.rend.settings.effects, EFFECT_FLAT); ImGui::PopID(); } static void material_panel(void) { int i, current = -1; int nb = render_get_default_settings(0, NULL, NULL); float v; char *name; const char **names; render_settings_t settings; names = (const char**)calloc(nb, sizeof(*names)); for (i = 0; i < nb; i++) { render_get_default_settings(i, &name, &settings); names[i] = name; if (memcmp(&goxel.rend.settings, &settings, sizeof(settings)) == 0) current = i; } gui_text("Presets:"); if (gui_combo("##Presets", ¤t, names, nb)) { render_get_default_settings(current, NULL, &settings); goxel.rend.settings = settings; } free(names); if (!DEFINED(GOXEL_NO_SHADOW)) { v = goxel.rend.settings.shadow; if (gui_input_float("shadow", &v, 0.1, 0, 0, NULL)) { goxel.rend.settings.shadow = clamp(v, 0, 1); } } ImGui::SetNextTreeNodeOpen(false, ImGuiCond_Once); if (gui_collapsing_header("Render Advanced")) material_advanced_panel(); } static void render_panel(void) { int i; int maxsize; const char *path; typeof(goxel.render_task) *task = &goxel.render_task; goxel.no_edit = task->status || gui->popup_count; GL(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize)); maxsize /= 2; // Because png export already double it. goxel.show_export_viewport = true; gui_group_begin(NULL); i = goxel.image->export_width; if (gui_input_int("w", &i, 1, maxsize)) goxel.image->export_width = clamp(i, 1, maxsize); i = goxel.image->export_height; if (gui_input_int("h", &i, 1, maxsize)) goxel.image->export_height = clamp(i, 1, maxsize); if (gui_button("Fit screen", 1, 0)) { goxel.image->export_width = gui->view.rect[2]; goxel.image->export_height = gui->view.rect[3]; } if (gui_button("Set output", 1, 0)) { path = noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "png\0*.png\0", NULL, "untitled.png"); if (path) strcpy(goxel.render_task.output, path); } gui_group_end(); if (*goxel.render_task.output) gui_text("%s", goxel.render_task.output); if (task->status == 0 && gui_button("Render", 0, 0)) task->status = 1; if (task->status == 1 && gui_button("Cancel", 0, 0)) task->status = 0; if (task->status == 2 && gui_button("Restart", 0, 0)) { task->status = 1; task->progress = 0; task->force_restart = true; } if (goxel.render_task.status) { gui_text("%d/100", (int)(goxel.render_task.progress * 100)); } } static void image_panel(void) { bool bounded; image_t *image = goxel.image; int bbox[2][3]; float (*box)[4][4] = &image->box; bounded = !box_is_null(*box); if (ImGui::Checkbox("Bounded", &bounded)) { if (bounded) { mesh_get_bbox(goxel.layers_mesh, bbox, true); if (bbox[0][0] > bbox[1][0]) memset(bbox, 0, sizeof(bbox)); bbox_from_aabb(*box, bbox); } else { mat4_copy(mat4_zero, *box); goxel.snap_mask |= SNAP_PLANE; } } if (bounded) gui_bbox(*box); auto_adjust_panel_size(); } static void cameras_panel(void) { camera_t *cam; int i = 0; bool current; gui_group_begin(NULL); DL_FOREACH(goxel.image->cameras, cam) { current = goxel.image->active_camera == cam; if (layer_item(i, -1, NULL, ¤t, cam->name, sizeof(cam->name))) { if (current) { camera_set(&goxel.camera, cam); goxel.image->active_camera = cam; } else { goxel.image->active_camera = NULL; } } i++; auto_adjust_panel_size(); } gui_group_end(); gui_action_button("img_new_camera", NULL, 0, ""); ImGui::SameLine(); gui_action_button("img_del_camera", NULL, 0, ""); ImGui::SameLine(); gui_action_button("img_move_camera_up", NULL, 0, ""); ImGui::SameLine(); gui_action_button("img_move_camera_down", NULL, 0, ""); auto_adjust_panel_size(); cam = &goxel.camera; gui_input_float("dist", &cam->dist, 10.0, 0, 0, NULL); gui_group_begin("Offset"); gui_input_float("x", &cam->ofs[0], 1.0, 0, 0, NULL); gui_input_float("y", &cam->ofs[1], 1.0, 0, 0, NULL); gui_input_float("z", &cam->ofs[2], 1.0, 0, 0, NULL); gui_group_end(); gui_quat("Rotation", cam->rot); ImGui::Checkbox("Ortho", &cam->ortho); gui_group_begin("Set"); gui_action_button("view_left", "left", 0.5, ""); ImGui::SameLine(); gui_action_button("view_right", "right", 1.0, ""); gui_action_button("view_front", "front", 0.5, ""); ImGui::SameLine(); gui_action_button("view_top", "top", 1.0, ""); gui_action_button("view_default", "default", 1.0, ""); gui_group_end(); } static void debug_panel(void) { ImGui::Text("FPS: %d", (int)round(goxel.fps)); if (!DEFINED(GLES2)) gui_checkbox("Show wireframe", &goxel.show_wireframe, NULL); } static void import_image_plane(void) { const char *path; path = noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, "png\0*.png\0jpg\0*.jpg;*.jpeg\0", NULL, NULL); if (!path) return; goxel_import_image_plane(path); } static bool shift_alpha_popup(void *data) { static int v = 0; static mesh_t *original_mesh = NULL; mesh_t *mesh; mesh = goxel.image->active_layer->mesh; if (!original_mesh) original_mesh = mesh_copy(mesh); if (ImGui::InputInt("shift", &v, 1)) { mesh_set(mesh, original_mesh); mesh_shift_alpha(mesh, v); goxel_update_meshes(-1); } if (ImGui::Button("OK")) { mesh_delete(original_mesh); original_mesh = NULL; return true; } return false; } static bool about_popup(void *data) { using namespace ImGui; Text("Goxel " GOXEL_VERSION_STR); Text("Copyright © 2015-2017 Guillaume Chereau"); Text(""); Text("GPL 3 License"); Text("http://guillaumechereau.github.io/goxel"); SetNextTreeNodeOpen(true, ImGuiCond_Once); if (gui_collapsing_header("Credits")) { Text("Code:"); BulletText("Guillaume Chereau "); BulletText("Dustin Willis Webber "); BulletText("Pablo Hugo Reda "); BulletText("Othelarian (https://github.com/othelarian)"); Text("Libraries:"); BulletText("dear imgui (https://github.com/ocornut/imgui)"); BulletText("stb (https://github.com/nothings/stb)"); BulletText("uthash (https://troydhanson.github.io/uthash/)"); BulletText("inih (https://github.com/benhoyt/inih)"); Text("Design:"); BulletText("Guillaume Chereau "); BulletText("Michal (https://github.com/YarlBoro)"); } return gui_button("OK", 0, 0); } static bool alert_popup(void *data) { if (data) gui_text((const char *)data); return gui_button("OK", 0, 0); } static int check_action_shortcut(action_t *action, void *user) { ImGuiIO& io = ImGui::GetIO(); const char *s = action->shortcut; bool check_key = true; bool check_char = true; if (!*s) return 0; if (io.KeyCtrl) { if (!str_startswith(s, "Ctrl")) return 0; s += strlen("Ctrl "); check_char = false; } if (io.KeyShift) { check_key = false; } if ( (check_char && isCharPressed(s[0])) || (check_key && ImGui::IsKeyPressed(s[0], false))) { action_exec(action, ""); return 1; } return 0; } static int import_menu_action_callback(action_t *a, void *user) { if (!a->file_format.name) return 0; if (!str_startswith(a->id, "import_")) return 0; if (ImGui::MenuItem(a->file_format.name)) action_exec(a, ""); return 0; } static int export_menu_action_callback(action_t *a, void *user) { if (!a->file_format.name) return 0; if (!str_startswith(a->id, "export_")) return 0; if (ImGui::MenuItem(a->file_format.name)) action_exec(a, ""); return 0; } static bool render_menu_item(const char *id, const char *label, bool enabled) { const action_t *action = action_get(id); assert(action); if (ImGui::MenuItem(label, action->shortcut, false, enabled)) { action_exec(action, ""); return true; } return false; } static void render_menu(void) { ImGui::PushStyleColor(ImGuiCol_PopupBg, COLOR(MENU, INNER, 0)); ImGui::PushStyleColor(ImGuiCol_Text, COLOR(MENU, TEXT, 0)); if (!ImGui::BeginMenuBar()) return; if (ImGui::BeginMenu("File")) { render_menu_item("save", "Save", image_get_key(goxel.image) != goxel.image->saved_key); render_menu_item("save_as", "Save as", true); render_menu_item("open", "Open", true); if (ImGui::BeginMenu("Import...")) { if (ImGui::MenuItem("image plane")) import_image_plane(); actions_iter(import_menu_action_callback, NULL); ImGui::EndMenu(); } if (ImGui::BeginMenu("Export As..")) { actions_iter(export_menu_action_callback, NULL); ImGui::EndMenu(); } render_menu_item("quit", "Quit", true); ImGui::EndMenu(); } if (ImGui::BeginMenu("Edit")) { if (ImGui::MenuItem("Clear", "Delete")) action_exec2("layer_clear", ""); render_menu_item("undo", "Undo", true); render_menu_item("redo", "Redo", true); render_menu_item("copy", "Copy", true); render_menu_item("past", "Past", true); if (ImGui::MenuItem("Shift Alpha")) gui_open_popup("Shift Alpha", 0, NULL, shift_alpha_popup); if (ImGui::MenuItem("Settings")) gui_open_popup("Settings", GUI_POPUP_FULL | GUI_POPUP_RESIZE, NULL, gui_settings_popup); ImGui::EndMenu(); } if (ImGui::BeginMenu("View")) { render_menu_item("view_left", "Left", true); render_menu_item("view_right", "Right", true); render_menu_item("view_front", "Front", true); render_menu_item("view_top", "Top", true); render_menu_item("view_default", "Default", true); ImGui::EndMenu(); } if (ImGui::BeginMenu("Help")) { if (ImGui::MenuItem("About")) gui_open_popup("About", 0, NULL, about_popup); ImGui::EndMenu(); } ImGui::EndMenuBar(); ImGui::PopStyleColor(2); } static bool render_tab(const char *label, int icon, bool *v) { bool ret; const theme_t *theme = theme_get(); ImVec2 center; ImVec2 uv0, uv1; // The position in the icon texture. ImGuiWindow* window = ImGui::GetCurrentWindow(); ImGui::PushStyleColor(ImGuiCol_Button, COLOR(TAB, INNER, *v)); ImGui::PushID(label); ret = ImGui::InvisibleButton("", ImVec2(theme->sizes.icons_height, theme->sizes.icons_height)); ImGui::GoxBox(ImGui::GetItemRectMin(), ImGui::GetItemRectSize(), false, 0x05); ImGui::PopStyleColor(); center = (ImGui::GetItemRectMin() + ImGui::GetItemRectMax()) / 2; center.y += 0.5; uv0 = ImVec2(((icon - 1) % 8) / 8.0, ((icon - 1) / 8) / 8.0); uv1 = uv0 + ImVec2(1. / 8, 1. / 8); window->DrawList->AddImage((void*)(intptr_t)g_tex_icons->tex, center - ImVec2(16, 16), center + ImVec2(16, 16), uv0, uv1, get_icon_color(icon, 0)); if (ImGui::IsItemHovered()) { ImGui::SetTooltip("%s", label); goxel_set_help_text(label); } ImGui::PopID(); return ret; } static int render_mode_select(void) { int i; bool v; struct { int mode; const char *name; int icon; } values[] = { {MODE_OVER, "Add", ICON_MODE_ADD}, {MODE_SUB, "Sub", ICON_MODE_SUB}, {MODE_PAINT, "Paint", ICON_MODE_PAINT}, }; gui_group_begin(NULL); for (i = 0; i < (int)ARRAY_SIZE(values); i++) { v = goxel.painter.mode == values[i].mode; if (gui_selectable_icon(values[i].name, &v, values[i].icon)) { goxel.painter.mode = values[i].mode; } auto_grid(ARRAY_SIZE(values), i, 4); } gui_group_end(); return 0; } static void render_top_bar(void) { gui_action_button("undo", NULL, 0, ""); gui_same_line(); gui_action_button("redo", NULL, 0, ""); gui_same_line(); gui_action_button("layer_clear", NULL, 0, ""); gui_same_line(); render_mode_select(); gui_same_line(); gui_color("##color", goxel.painter.color); } static void render_left_panel(void) { int i; const theme_t *theme = theme_get(); float left_pane_width; const struct { const char *name; int icon; void (*fn)(void); } PANELS[] = { {NULL}, {"Tools", ICON_TOOLS, tools_panel}, {"Palette", ICON_PALETTE, palette_panel}, {"Layers", ICON_LAYERS, layers_panel}, {"View", ICON_VIEW, view_panel}, {"Material", ICON_MATERIAL, material_panel}, {"Cameras", ICON_CAMERA, cameras_panel}, {"Image", ICON_IMAGE, image_panel}, {"Render", ICON_RENDER, render_panel}, {"Debug", ICON_DEBUG, debug_panel}, }; ImDrawList* draw_list; left_pane_width = gui->current_panel ? max(168, gui->min_panel_size) : theme->sizes.icons_height + 4; gui->min_panel_size = 0; ImGui::BeginChild("left pane", ImVec2(left_pane_width, 0), true); ImGui::BeginGroup(); draw_list = ImGui::GetWindowDrawList(); ImVec2 rmin = ImGui::GetCursorScreenPos() - ImVec2(4, 4); ImVec2 rmax = rmin + ImVec2(theme->sizes.icons_height + 4, ImGui::GetWindowHeight()); draw_list->AddRectFilled(rmin, rmax, ImGui::ColorConvertFloat4ToU32(COLOR(TAB, BACKGROUND, 0))); for (i = 1; i < (int)ARRAY_SIZE(PANELS); i++) { bool b = (gui->current_panel == (int)i); if (render_tab(PANELS[i].name, PANELS[i].icon, &b)) { on_click(); if (i != gui->current_panel) { gui->current_panel = i; } else { gui->current_panel = 0; } } } ImGui::EndGroup(); if (gui->current_panel) { ImGui::SameLine(); ImGui::BeginGroup(); goxel.show_export_viewport = false; ImGui::PushID("panel"); ImGui::PushID(PANELS[gui->current_panel].name); PANELS[gui->current_panel].fn(); ImGui::PopID(); ImGui::PopID(); ImGui::EndGroup(); } ImGui::EndChild(); } static void render_popups(int index) { typeof(gui->popup[0]) *popup; ImGuiIO& io = ImGui::GetIO(); popup = &gui->popup[index]; if (!popup->title) return; if (!popup->opened) { ImGui::OpenPopup(popup->title); popup->opened = true; } int flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove; if (popup->flags & GUI_POPUP_FULL) { ImGui::SetNextWindowSize(ImVec2(io.DisplaySize.x - 40, io.DisplaySize.y - 40), (popup->flags & GUI_POPUP_RESIZE) ? ImGuiCond_Once : 0); } if (popup->flags & GUI_POPUP_RESIZE) { flags &= ~(ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize); } if (ImGui::BeginPopupModal(popup->title, NULL, flags)) { typeof(popup->func) func = popup->func; if (func(popup->data)) { ImGui::CloseCurrentPopup(); gui->popup_count--; popup->title = NULL; popup->func = NULL; free(popup->data); popup->data = NULL; if (popup->on_closed) popup->on_closed(); popup->on_closed = NULL; popup->opened = false; } render_popups(index + 1); ImGui::EndPopup(); } } void gui_iter(const inputs_t *inputs) { if (!gui) gui_init(inputs); unsigned int i; ImGuiIO& io = ImGui::GetIO(); ImDrawList* draw_list; ImGuiStyle& style = ImGui::GetStyle(); const theme_t *theme = theme_get(); gesture_t *gestures[] = {&gui->gestures.drag, &gui->gestures.hover}; float display_rect[4] = { 0.f, 0.f, (float)goxel.screen_size[0], (float)goxel.screen_size[1]}; float font_size = ImGui::GetFontSize(); io.DisplaySize = ImVec2((float)goxel.screen_size[0], (float)goxel.screen_size[1]); io.DisplayFramebufferScale = ImVec2(goxel.screen_scale, goxel.screen_scale); io.DeltaTime = 1.0 / 60; if (inputs) { gesture_update(2, gestures, inputs, display_rect, gui); io.MouseWheel = inputs->mouse_wheel; for (i = 0; i < ARRAY_SIZE(inputs->keys); i++) io.KeysDown[i] = inputs->keys[i]; io.KeyShift = inputs->keys[KEY_LEFT_SHIFT] || inputs->keys[KEY_RIGHT_SHIFT]; io.KeyCtrl = inputs->keys[KEY_CONTROL]; for (i = 0; i < ARRAY_SIZE(inputs->chars); i++) { if (!inputs->chars[i]) break; io.AddInputCharacter(inputs->chars[i]); } memset((void*)inputs->chars, 0, sizeof(inputs->chars)); } // Setup theme. style.FramePadding = ImVec2(theme->sizes.item_padding_h, (theme->sizes.item_height - font_size) / 2); style.FrameRounding = theme->sizes.item_rounding; style.ItemSpacing = ImVec2(theme->sizes.item_spacing_h, theme->sizes.item_spacing_v); style.ItemInnerSpacing = ImVec2(theme->sizes.item_inner_spacing_h, 0); style.ScrollbarSize = theme->sizes.item_height; style.Colors[ImGuiCol_WindowBg] = COLOR(BASE, BACKGROUND, 0); style.Colors[ImGuiCol_PopupBg] = ImVec4(0.38, 0.38, 0.38, 1.0); style.Colors[ImGuiCol_Header] = style.Colors[ImGuiCol_WindowBg]; style.Colors[ImGuiCol_Text] = COLOR(BASE, TEXT, 0); style.Colors[ImGuiCol_Button] = COLOR(BASE, INNER, 0); style.Colors[ImGuiCol_FrameBg] = COLOR(BASE, INNER, 0); style.Colors[ImGuiCol_PopupBg] = COLOR(BASE, BACKGROUND, 0); style.Colors[ImGuiCol_ButtonActive] = COLOR(BASE, INNER, 1); style.Colors[ImGuiCol_ButtonHovered] = color_lighten(COLOR(BASE, INNER, 0), 1.2); style.Colors[ImGuiCol_CheckMark] = COLOR(WIDGET, INNER, 1); style.Colors[ImGuiCol_MenuBarBg] = COLOR(MENU, BACKGROUND, 0); style.Colors[ImGuiCol_Border] = COLOR(BASE, OUTLINE, 0); ImGui::NewFrame(); // Create the root fullscreen window. ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoCollapse; ImGui::SetNextWindowSize(ImVec2(io.DisplaySize.x, io.DisplaySize.y)); ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::Begin("Goxel", NULL, window_flags); render_menu(); render_top_bar(); goxel.no_edit = false; // Set depending on what panel is selected. goxel.use_cycles = false; // Also set depending on the panel. render_left_panel(); ImGui::SameLine(); render_popups(0); ImGui::BeginChild("3d view", ImVec2(0, 0), false, ImGuiWindowFlags_NoScrollWithMouse); // ImGui::Text("3d view"); ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); ImVec2 canvas_size = ImGui::GetContentRegionAvail(); canvas_size.y -= 20; // Leave space for the help label. vec4_set(gui->view.rect, canvas_pos.x, canvas_pos.y, canvas_size.x, canvas_size.y); draw_list = ImGui::GetWindowDrawList(); draw_list->AddCallback(render_view, &gui->view); // Invisible button so that we catch inputs. ImGui::InvisibleButton("canvas", canvas_size); gui->mouse_in_view = ImGui::IsItemHovered(); float view_size[2] = {gui->view.rect[2], gui->view.rect[3]}; float view_rect[4] = {canvas_pos.x, io.DisplaySize.y - (canvas_pos.y + canvas_size.y), canvas_size.x, canvas_size.y}; // Call mouse_in_view with inputs in the view referential. if ( inputs && !(!gui->mouse_in_view && inputs->mouse_wheel) && !gui->capture_mouse) { inputs_t inputs2 = *inputs; for (i = 0; i < ARRAY_SIZE(inputs->touches); i++) { inputs2.touches[i].pos[1] = io.DisplaySize.y - inputs2.touches[i].pos[1]; } goxel_mouse_in_view(view_rect, &inputs2, !io.WantCaptureKeyboard); } render_axis_arrows(view_size); ImGui::Text("%s", goxel.hint_text ?: ""); ImGui::SameLine(180); ImGui::Text("%s", goxel.help_text ?: ""); ImGui::EndChild(); ImGui::End(); // Handle the shortcuts. XXX: this should be done with actions. if (ImGui::IsKeyPressed(KEY_DELETE, false)) action_exec2("layer_clear", ""); if (!io.WantCaptureKeyboard) { // Handle space key toggle over/sub modes. if ( ImGui::IsKeyPressed(' ', false) && goxel.painter.mode == MODE_OVER) goxel.painter.mode = MODE_SUB; if (ImGui::IsKeyReleased(' ') && goxel.painter.mode == MODE_SUB) goxel.painter.mode = MODE_OVER; float last_tool_radius = goxel.tool_radius; if (isCharPressed('[')) goxel.tool_radius -= 0.5; if (isCharPressed(']')) goxel.tool_radius += 0.5; if (goxel.tool_radius != last_tool_radius) { goxel.tool_radius = clamp(goxel.tool_radius, 0.5, 64); } actions_iter(check_action_shortcut, NULL); } ImGui::EndFrame(); } void gui_render(void) { ImGui::Render(); ImImpl_RenderDrawLists(ImGui::GetDrawData()); } extern "C" { using namespace ImGui; static void stencil_callback( const ImDrawList* parent_list, const ImDrawCmd* cmd) { int op = ((intptr_t)cmd->UserCallbackData); switch (op) { case 0: // Reset GL(glDisable(GL_STENCIL_TEST)); GL(glStencilMask(0x00)); break; case 1: // Write GL(glEnable(GL_STENCIL_TEST)); GL(glStencilFunc(GL_ALWAYS, 1, 0xFF)); GL(glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE)); GL(glStencilMask(0xFF)); break; case 2: // Filter GL(glEnable(GL_STENCIL_TEST)); GL(glStencilFunc(GL_EQUAL, 1, 0xFF)); GL(glStencilMask(0x00)); break; default: assert(false); break; } } void gui_group_begin(const char *label) { ImDrawList* draw_list = ImGui::GetWindowDrawList(); if (label) ImGui::Text("%s", label); ImGui::PushID(label ? label : "group"); gui->group++; draw_list->ChannelsSplit(2); draw_list->ChannelsSetCurrent(1); ImGui::BeginGroup(); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(1, 1)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0); } void gui_group_end(void) { gui->group--; ImGui::PopID(); ImGui::PopStyleVar(2); ImGui::Dummy(ImVec2(0, 0)); ImGui::EndGroup(); ImDrawList* draw_list = ImGui::GetWindowDrawList(); draw_list->ChannelsSetCurrent(0); ImVec2 pos = ImGui::GetItemRectMin(); ImVec2 size = ImGui::GetItemRectMax() - pos; // Stencil write. draw_list->AddCallback(stencil_callback, (void*)(intptr_t)1); GoxBox2(pos + ImVec2(1, 1), size - ImVec2(2, 2), COLOR(WIDGET, OUTLINE, 0), true); // Stencil filter. draw_list->AddCallback(stencil_callback, (void*)(intptr_t)2); draw_list->ChannelsMerge(); // Stencil reset. draw_list->AddCallback(stencil_callback, (void*)(intptr_t)0); GoxBox2(pos, size, COLOR(WIDGET, OUTLINE, 0), false); } bool gui_input_int(const char *label, int *v, int minv, int maxv) { float minvf = minv; float maxvf = maxv; bool ret; float vf = *v; if (minv == 0 && maxv == 0) { minvf = -FLT_MAX; maxvf = +FLT_MAX; } ret = gui_input_float(label, &vf, 1, minvf, maxvf, "%.0f"); if (ret) *v = vf; return ret; } bool gui_input_float(const char *label, float *v, float step, float minv, float maxv, const char *format) { const theme_t *theme = theme_get(); bool self_group = false, ret; if (minv == 0.f && maxv == 0.f) { minv = -FLT_MAX; maxv = +FLT_MAX; } if (gui->group == 0) { gui_group_begin(NULL); self_group = true; } if (step == 0.f) step = 0.1f; if (!format) format = "%.1f"; ret = ImGui::GoxInputFloat(label, v, step, minv, maxv, format); if (ret) on_click(); if (self_group) gui_group_end(); // Empirical panel size required to render this element. auto_adjust_panel_size( ImGui::CalcTextSize(label).x + theme->sizes.item_height * 4); return ret; } bool gui_bbox(float box[4][4]) { int x, y, z, w, h, d; bool ret = false; float p[3]; w = box[0][0] * 2; h = box[1][1] * 2; d = box[2][2] * 2; x = round(box[3][0] - box[0][0]); y = round(box[3][1] - box[1][1]); z = round(box[3][2] - box[2][2]); gui_group_begin("Origin"); ret |= gui_input_int("x", &x, 0, 0); ret |= gui_input_int("y", &y, 0, 0); ret |= gui_input_int("z", &z, 0, 0); gui_group_end(); gui_group_begin("Size"); ret |= gui_input_int("w", &w, 1, 2048); ret |= gui_input_int("h", &h, 1, 2048); ret |= gui_input_int("d", &d, 1, 2048); gui_group_end(); if (ret) { vec3_set(p, x + w / 2., y + h / 2., z + d / 2.); bbox_from_extents(box, p, w / 2., h / 2., d / 2.); } return ret; } bool gui_angle(const char *id, float *v, int vmin, int vmax) { int a; bool ret; a = round(*v * DR2D); ret = gui_input_int(id, &a, vmin, vmax); if (ret) { if (vmin == 0 && vmax == 360) { while (a < 0) a += 360; a %= 360; } a = clamp(a, vmin, vmax); *v = (float)(a * DD2R); } return ret; } bool gui_action_button(const char *id, const char *label, float size, const char *sig, ...) { bool ret; const action_t *action; va_list ap; action = action_get(id); assert(action); PushID(action->id); ret = gui_button(label, size, action->icon); if (IsItemHovered()) goxel_set_help_text(action_get(id)->help); if (ret) { va_start(ap, sig); action_execv(action_get(id), sig, ap); va_end(ap); } PopID(); return ret; } bool gui_action_checkbox(const char *id, const char *label) { bool b; const action_t *action = action_get(id); action_exec(action, ">b", &b); if (ImGui::Checkbox(label, &b)) { action_exec(action, "b", b); return true; } if (ImGui::IsItemHovered()) { if (!*action->shortcut) goxel_set_help_text(action->help); else goxel_set_help_text("%s (%s)", action->help, action->shortcut); } return false; } static bool _selectable(const char *label, bool *v, const char *tooltip, float w, int icon) { const theme_t *theme = theme_get(); ImGuiWindow* window = GetCurrentWindow(); ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; ImVec2 size; ImVec2 center; bool ret = false; bool default_v = false; ImVec2 uv0, uv1; // The position in the icon texture. uint8_t color[4]; int group = THEME_GROUP_WIDGET; v = v ? v : &default_v; size = (icon != -1) ? ImVec2(theme->sizes.icons_height, theme->sizes.icons_height) : ImVec2(w, theme->sizes.item_height); if (!tooltip) { tooltip = label; while (*tooltip == '#') tooltip++; } ImGui::PushID(label); theme_get_color(group, THEME_COLOR_INNER, *v, color); PushStyleColor(ImGuiCol_Button, color); PushStyleColor(ImGuiCol_ButtonHovered, color_lighten( style.Colors[ImGuiCol_Button], 1.2)); theme_get_color(group, THEME_COLOR_TEXT, *v, color); PushStyleColor(ImGuiCol_Text, color); if (icon != -1) { ret = ImGui::Button("", size); if (icon) { center = (ImGui::GetItemRectMin() + ImGui::GetItemRectMax()) / 2; center.y += 0.5; uv0 = ImVec2(((icon - 1) % 8) / 8.0, ((icon - 1) / 8) / 8.0); uv1 = uv0 + ImVec2(1. / 8, 1. / 8); window->DrawList->AddImage((void*)(intptr_t)g_tex_icons->tex, center - ImVec2(16, 16), center + ImVec2(16, 16), uv0, uv1, get_icon_color(icon, *v)); } } else { ret = ImGui::Button(label, size); } ImGui::PopStyleColor(3); if (ret) *v = !*v; if (ImGui::IsItemHovered()) { ImGui::SetTooltip("%s", tooltip); goxel_set_help_text(tooltip); } ImGui::PopID(); if (ret) on_click(); return ret; } bool gui_selectable(const char *name, bool *v, const char *tooltip, float w) { return _selectable(name, v, tooltip, w, -1); } bool gui_selectable_icon(const char *name, bool *v, int icon) { return _selectable(name, v, NULL, 0, icon); } float gui_get_avail_width(void) { return GetContentRegionAvailWidth(); } void gui_text(const char *label, ...) { va_list args; va_start(args, label); TextV(label, args); va_end(args); } void gui_same_line(void) { SameLine(); } bool gui_color(const char *label, uint8_t color[4]) { static uint8_t backup_color[4]; ImVec2 size; const theme_t *theme = theme_get(); size.x = size.y = theme->sizes.icons_button_size; ImGui::PushID(label); if (ImGui::ColorButton(label, color, 0, size)) memcpy(backup_color, color, 4); if (ImGui::BeginPopupContextItem("color context menu", 0)) { color_edit("##edit", color, backup_color); if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } if (label && label[0] != '#') { ImGui::SameLine(); ImGui::Text("%s", label); } ImGui::PopID(); return false; } bool gui_checkbox(const char *label, bool *v, const char *hint) { bool ret; const theme_t *theme = theme_get(); ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; // Checkbox inside a group box have a plain background. if (gui->group) { GoxBox2(ImGui::GetCursorScreenPos(), ImVec2(0, theme->sizes.item_height), COLOR(WIDGET, INNER, 0), true, 0); ImGui::PushStyleColor(ImGuiCol_FrameBg, color_lighten(style.Colors[ImGuiCol_FrameBg], 1.2)); } ret = Checkbox(label, v); if (gui->group) ImGui::PopStyleColor(); if (hint && ImGui::IsItemHovered()) ImGui::SetTooltip("%s", hint); if (ret) on_click(); return ret; } bool gui_button(const char *label, float size, int icon) { bool ret; ImDrawList* draw_list = ImGui::GetWindowDrawList(); ImVec2 uv0, uv1; ImVec2 button_size; const theme_t *theme = theme_get(); ImVec2 center; int w, isize; button_size = ImVec2(size * GetContentRegionAvailWidth(), theme->sizes.item_height); if (size == -1) button_size.x = GetContentRegionAvailWidth(); if (size == 0 && (label == NULL || label[0] == '#')) { button_size.x = theme->sizes.icons_button_size; button_size.y = theme->sizes.icons_button_size; } if (size == 0 && label && label[0] != '#') { w = CalcTextSize(label, NULL, true).x + theme->sizes.item_padding_h * 2; if (w < theme->sizes.item_height) button_size.x = theme->sizes.item_height; } isize = (label && label[0] != '#' && label) ? 12 : 16; label = label ?: ""; ret = Button(label, button_size); if (icon) { center = GetItemRectMin() + ImVec2(GetItemRectSize().y / 2, GetItemRectSize().y / 2); uv0 = ImVec2(((icon - 1) % 8) / 8.0, ((icon - 1) / 8) / 8.0); uv1 = ImVec2(uv0.x + 1. / 8, uv0.y + 1. / 8); draw_list->AddImage((void*)(intptr_t)g_tex_icons->tex, center - ImVec2(isize, isize), center + ImVec2(isize, isize), uv0, uv1, get_icon_color(icon, 0)); } if (ret) on_click(); return ret; } bool gui_button_right(const char *label, int icon) { const theme_t *theme = theme_get(); float text_size = ImGui::CalcTextSize(label).x; float w = text_size + 2 * theme->sizes.item_padding_h; w = max(w, theme->sizes.item_height); w += theme->sizes.item_padding_h; gui_same_line(); ImGui::Dummy(ImVec2(ImGui::GetContentRegionAvailWidth() - w, 0)); gui_same_line(); return gui_button(label, 0, icon); } bool gui_input_text(const char *label, char *txt, int size) { return InputText(label, txt, size); } bool gui_input_text_multiline(const char *label, char *buf, int size, float width, float height) { // We set the frame color to a semi transparent value, because otherwise // we cannot render the error highlight. // XXX: fix that. bool ret; ImGuiStyle& style = ImGui::GetStyle(); ImVec4 col = style.Colors[ImGuiCol_FrameBg]; style.Colors[ImGuiCol_FrameBg].w = 0.5; ret = InputTextMultiline(label, buf, size, ImVec2(width, height)); style.Colors[ImGuiCol_FrameBg] = col; auto_adjust_panel_size(); return ret; } bool gui_combo(const char *label, int *v, const char **names, int nb) { const theme_t *theme = theme_get(); bool ret; float font_size = ImGui::GetFontSize(); PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, (theme->sizes.item_height - font_size) / 2)); ImGui::PushStyleColor(ImGuiCol_PopupBg, COLOR(WIDGET, INNER, 0)); ret = Combo(label, v, names, nb); PopStyleVar(); PopStyleColor(); return ret; } void gui_input_text_multiline_highlight(int line) { float h = ImGui::CalcTextSize("").y; ImVec2 rmin = ImGui::GetItemRectMin(); ImVec2 rmax = ImGui::GetItemRectMax(); rmin.y = rmin.y + line * h + 2; rmax.y = rmin.y + h; ImDrawList* draw_list = ImGui::GetWindowDrawList(); draw_list->AddRectFilled(rmin, rmax, 0xff0000ff); } void gui_enabled_begin(bool enabled) { ImGuiStyle& style = ImGui::GetStyle(); ImVec4 color = style.Colors[ImGuiCol_Text]; if (!enabled) color.w /= 2; ImGui::PushStyleColor(ImGuiCol_Text, color); } void gui_enabled_end(void) { ImGui::PopStyleColor(); } bool gui_quat(const char *label, float q[4]) { // Hack to prevent weird behavior when we change the euler angles. // We keep track of the last used euler angles value and reuse them if // the quaternion is the same. static struct { float quat[4]; float eul[3]; } last = {}; float eul[3]; bool ret = false; if (memcmp(q, &last.quat, sizeof(last.quat)) == 0) vec3_copy(last.eul, eul); else quat_to_eul(q, EULER_ORDER_DEFAULT, eul); gui_group_begin(label); if (gui_angle("x", &eul[0], -180, +180)) ret = true; if (gui_angle("y", &eul[1], -180, +180)) ret = true; if (gui_angle("z", &eul[2], -180, +180)) ret = true; gui_group_end(); if (ret) { eul_to_quat(eul, EULER_ORDER_DEFAULT, q); quat_copy(q, last.quat); vec3_copy(eul, last.eul); } return ret; } void gui_open_popup(const char *title, int flags, void *data, bool (*func)(void *data)) { typeof(gui->popup[0]) *popup; popup = &gui->popup[gui->popup_count++]; popup->title = title; popup->func = func; popup->flags = flags; assert(!popup->data); popup->data = data; } void gui_on_popup_closed(void (*func)(void)) { gui->popup[gui->popup_count - 1].on_closed = func; } void gui_popup_body_begin(void) { ImGui::BeginChild("body", ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); } void gui_popup_body_end(void) { ImGui::EndChild(); } void gui_alert(const char *title, const char *msg) { gui_open_popup(title, 0, msg ? strdup(msg) : NULL, alert_popup); } bool gui_collapsing_header(const char *label) { return ImGui::CollapsingHeader(label); } void gui_columns(int count) { ImGui::Columns(count); } void gui_next_column(void) { ImGui::NextColumn(); } void gui_separator(void) { ImGui::Separator(); } void gui_push_id(const char *id) { ImGui::PushID(id); } void gui_pop_id(void) { ImGui::PopID(); } void gui_floating_icon(int icon) { ImDrawList* draw_list = ImGui::GetWindowDrawList(); ImVec2 uv0, uv1, pos; uv0 = ImVec2(((icon - 1) % 8) / 8.0, ((icon - 1) / 8) / 8.0); uv1 = ImVec2(uv0.x + 1. / 8, uv0.y + 1. / 8); pos = GetItemRectMin(); draw_list->AddImage((void*)(intptr_t)g_tex_icons->tex, pos, pos + ImVec2(32, 32), uv0, uv1, get_icon_color(icon, 0)); } } goxel-0.8.1/src/gui_settings.c000066400000000000000000000106701334742672700163200ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include "ini.h" static int shortcut_callback(action_t *action, void *user) { if (!(action->flags & ACTION_CAN_EDIT_SHORTCUT)) return 0; gui_push_id(action->id); gui_text("%s: %s", action->id, action->help); gui_next_column(); // XXX: need to check if the inputs are valid! gui_input_text("", action->shortcut, sizeof(action->shortcut)); gui_next_column(); gui_pop_id(); return 0; } bool gui_settings_popup(void *data) { const char **names; theme_t *theme; int i, nb, current; theme_t *themes = theme_get_list(); gui_popup_body_begin(); DL_COUNT(themes, theme, nb); names = (const char**)calloc(nb, sizeof(*names)); i = 0; DL_FOREACH(themes, theme) { if (strcmp(theme->name, theme_get()->name) == 0) current = i; names[i++] = theme->name; } gui_text("theme"); if (gui_combo("##themes", ¤t, names, nb)) { theme_set(names[current]); } free(names); // For the moment I disable the theme editor! #if 0 int group; uint8_t *color; theme = theme_get(); gui_group_begin("Sizes"); #define X(a) gui_input_int(#a, &theme->sizes.a, 0, 1000); THEME_SIZES(X) #undef X gui_group_end(); for (group = 0; group < THEME_GROUP_COUNT; group++) { if (gui_collapsing_header(THEME_GROUP_INFOS[group].name)) { for (i = 0; i < THEME_COLOR_COUNT; i++) { if (!THEME_GROUP_INFOS[group].colors[i]) continue; color = theme->groups[group].colors[i]; gui_color(THEME_COLOR_INFOS[i].name, color); } } } if (gui_button("Revert", 0, 0)) theme_revert_default(); gui_same_line(); if (gui_button("Save", 0, 0)) theme_save(); #endif if (gui_collapsing_header("Shortcuts")) { gui_columns(2); gui_separator(); actions_iter(shortcut_callback, NULL); gui_separator(); gui_columns(1); } gui_popup_body_end(); gui_action_button("settings_save", "Save", 0, ""); gui_same_line(); return gui_button("OK", 0, 0); } static int settings_ini_handler(void *user, const char *section, const char *name, const char *value, int lineno) { action_t *a; if (strcmp(section, "ui") == 0) { if (strcmp(name, "theme") == 0) { theme_set(value); } } if (strcmp(section, "shortcuts") == 0) { if ((a = action_get(name))) { strncpy(a->shortcut, value, sizeof(a->shortcut)); } else { LOG_W("Cannot set shortcut for unknow action '%s'", name); } } return 0; } static void settings_load(const char *path) { char *path_ = NULL; if (!path) { asprintf(&path_, "%s/settings.ini", sys_get_user_dir()); path = path_; } ini_parse(path, settings_ini_handler, NULL); free(path_); } static int shortcut_save_callback(action_t *a, void *user) { FILE *file = user; if (strcmp(a->shortcut, a->default_shortcut ?: "") != 0) fprintf(file, "%s=%s\n", a->id, a->shortcut); return 0; } static void settings_save(void) { char *path; FILE *file; asprintf(&path, "%s/settings.ini", sys_get_user_dir()); sys_make_dir(path); file = fopen(path, "w"); fprintf(file, "[ui]\n"); fprintf(file, "theme=%s\n", theme_get()->name); fprintf(file, "[shortcuts]\n"); actions_iter(shortcut_save_callback, file); fclose(file); free(path); } ACTION_REGISTER(settings_load, .help = "Load the settings from disk", .cfunc = settings_load, .csig = "vp", ) ACTION_REGISTER(settings_save, .help = "Save the settings to disk", .cfunc = settings_save, .csig = "v", ) goxel-0.8.1/src/image.c000066400000000000000000000433011334742672700146730ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" /* History the images undo history is stored in a linked list. Every time we call image_history_push, we add the current image snapshot in the list. For example, if we did three operations, A, B, C, and now the image is in the D state, the history list looks like this: img->history img | | v v +--------+ +--------+ +--------+ +--------+ | | | | | | | | | A |------>| B |------>| C |----->| D | | | | | | | | | +--------+ +--------+ +--------+ +--------+ After an undo, we get: img->history img | | v v +--------+ +--------+ +--------+ +--------+ | | | | | | | | | A |------>| B |------>| C |---->| D | | | | | | | | | +--------+ +--------+ +--------+ +--------+ */ static layer_t *img_get_layer(const image_t *img, int id) { layer_t *layer; if (id == 0) return NULL; DL_FOREACH(img->layers, layer) if (layer->id == id) return layer; assert(false); return NULL; } static int img_get_new_id(const image_t *img) { int id; layer_t *layer; for (id = 1;; id++) { DL_FOREACH(img->layers, layer) if (layer->id == id) break; if (layer == NULL) break; } return id; } static layer_t *layer_new(const image_t *img, const char *name) { layer_t *layer; layer = calloc(1, sizeof(*layer)); // XXX: potential bug here. strncpy(layer->name, name, sizeof(layer->name)); layer->mesh = mesh_new(); mat4_set_identity(layer->mat); layer->id = img_get_new_id(img); return layer; } static layer_t *layer_copy(layer_t *other) { layer_t *layer; layer = calloc(1, sizeof(*layer)); memcpy(layer->name, other->name, sizeof(layer->name)); layer->visible = other->visible; layer->mesh = mesh_copy(other->mesh); layer->image = texture_copy(other->image); mat4_copy(other->box, layer->box); mat4_copy(other->mat, layer->mat); layer->id = other->id; layer->base_id = other->base_id; layer->base_mesh_key = other->base_mesh_key; return layer; } static layer_t *layer_clone(layer_t *other) { int len; layer_t *layer; layer = calloc(1, sizeof(*layer)); len = sizeof(layer->name) - 1 - strlen(" clone"); snprintf(layer->name, sizeof(layer->name), "%.*s clone", len, other->name); layer->visible = other->visible; layer->mesh = mesh_copy(other->mesh); mat4_set_identity(layer->mat); layer->base_id = other->id; layer->base_mesh_key = mesh_get_key(other->mesh); return layer; } // Make sure the layer mesh is up to date. void image_update(image_t *img) { layer_t *layer, *base; DL_FOREACH(img->layers, layer) { base = img_get_layer(img, layer->base_id); if (base && layer->base_mesh_key != mesh_get_key(base->mesh)) { mesh_set(layer->mesh, base->mesh); mesh_move(layer->mesh, layer->mat); layer->base_mesh_key = mesh_get_key(base->mesh); } } } static void layer_delete(layer_t *layer) { mesh_delete(layer->mesh); texture_delete(layer->image); free(layer); } static uint64_t layer_get_key(const layer_t *layer) { uint64_t key; key = mesh_get_key(layer->mesh); key = crc64(key, &layer->visible, sizeof(layer->visible)); key = crc64(key, &layer->name, sizeof(layer->name)); key = crc64(key, &layer->box, sizeof(layer->box)); key = crc64(key, &layer->mat, sizeof(layer->mat)); return key; } image_t *image_new(void) { layer_t *layer; image_t *img = calloc(1, sizeof(*img)); const int aabb[2][3] = {{-16, -16, 0}, {16, 16, 32}}; bbox_from_aabb(img->box, aabb); img->export_width = 1024; img->export_height = 1024; layer = layer_new(img, "background"); layer->visible = true; DL_APPEND(img->layers, layer); DL_APPEND2(img->history, img, history_prev, history_next); img->active_layer = layer; // Prevent saving an empty image. img->saved_key = image_get_key(img); return img; } static image_t *image_snap(image_t *other) { image_t *img; layer_t *layer, *other_layer; img = calloc(1, sizeof(*img)); *img = *other; img->layers = NULL; img->active_layer = NULL; DL_FOREACH(other->layers, other_layer) { layer = layer_copy(other_layer); DL_APPEND(img->layers, layer); if (other_layer == other->active_layer) img->active_layer = layer; } img->history_next = img->history_prev = NULL; assert(img->active_layer); return img; } static void image_delete_camera(image_t *img, camera_t *cam); void image_delete(image_t *img) { if (!img) return; image_t *hist, *snap, *snap_tmp; layer_t *layer, *layer_tmp; while (img->cameras) image_delete_camera(img, img->cameras); free(img->path); hist = img->history; DL_FOREACH_SAFE2(hist, snap, snap_tmp, history_next) { DL_FOREACH_SAFE(snap->layers, layer, layer_tmp) { DL_DELETE(snap->layers, layer); layer_delete(layer); } DL_DELETE2(hist, snap, history_prev, history_next); free(snap); } } layer_t *image_add_layer(image_t *img) { layer_t *layer; img = img ?: goxel.image; layer = layer_new(img, "unnamed"); layer->visible = true; DL_APPEND(img->layers, layer); img->active_layer = layer; return layer; } void image_delete_layer(image_t *img, layer_t *layer) { layer_t *other; img = img ?: goxel.image; layer = layer ?: img->active_layer; DL_DELETE(img->layers, layer); if (layer == img->active_layer) img->active_layer = NULL; // Unclone all layers cloned from this one. DL_FOREACH(goxel.image->layers, other) { if (other->base_id == layer->id) { other->base_id = 0; } } layer_delete(layer); if (img->layers == NULL) { layer = layer_new(img, "unnamed"); layer->visible = true; DL_APPEND(img->layers, layer); } if (!img->active_layer) img->active_layer = img->layers->prev; } void image_move_layer(image_t *img, layer_t *layer, int d) { assert(d == -1 || d == +1); layer_t *other = NULL; img = img ?: goxel.image; layer = layer ?: img->active_layer; if (d == -1) { other = layer->next; SWAP(other, layer); } else if (layer != img->layers) { other = layer->prev; } if (!other || !layer) return; DL_DELETE(img->layers, layer); DL_PREPEND_ELEM(img->layers, other, layer); } static void image_move_layer_up(image_t *img, layer_t *layer) { image_move_layer(img, layer, +1); } static void image_move_layer_down(image_t *img, layer_t *layer) { image_move_layer(img, layer, -1); } layer_t *image_duplicate_layer(image_t *img, layer_t *other) { layer_t *layer; img = img ?: goxel.image; other = other ?: img->active_layer; layer = layer_copy(other); layer->id = img_get_new_id(img); layer->visible = true; DL_APPEND(img->layers, layer); img->active_layer = layer; return layer; } layer_t *image_clone_layer(image_t *img, layer_t *other) { layer_t *layer; img = img ?: goxel.image; other = other ?: img->active_layer; layer = layer_clone(other); layer->id = img_get_new_id(img); layer->visible = true; DL_APPEND(img->layers, layer); img->active_layer = layer; return layer; } void image_unclone_layer(image_t *img, layer_t *layer) { img = img ?: goxel.image; layer = layer ?: img->active_layer; layer->base_id = 0; } void image_select_parent_layer(image_t *img, layer_t *layer) { img = img ?: goxel.image; layer = layer ?: img->active_layer; img->active_layer = img_get_layer(img, layer->base_id); } void image_merge_visible_layers(image_t *img) { layer_t *layer, *last = NULL; img = img ?: goxel.image; DL_FOREACH(img->layers, layer) { if (!layer->visible) continue; if (last) { mesh_merge(layer->mesh, last->mesh, MODE_OVER, NULL); DL_DELETE(img->layers, last); layer_delete(last); } last = layer; } if (last) img->active_layer = last; } camera_t *image_add_camera(image_t *img) { camera_t *cam; img = img ?: goxel.image; cam = camera_new("unnamed"); DL_APPEND(img->cameras, cam); img->active_camera = cam; return cam; } static void image_delete_camera(image_t *img, camera_t *cam) { img = img ?: goxel.image; cam = cam ?: img->active_camera; if (!cam) return; DL_DELETE(img->cameras, cam); if (cam == img->active_camera) img->active_camera = NULL; camera_delete(cam); } void image_move_camera(image_t *img, camera_t *cam, int d) { // XXX: make a generic algo to move objects in a list. assert(d == -1 || d == +1); camera_t *other = NULL; img = img ?: goxel.image; cam = cam ?: img->active_camera; if (!cam) return; if (d == -1) { other = cam->next; SWAP(other, cam); } else if (cam != img->cameras) { other = cam->prev; } if (!other || !cam) return; DL_DELETE(img->cameras, cam); DL_PREPEND_ELEM(img->cameras, other, cam); } static void image_move_camera_up(image_t *img, camera_t *cam) { image_move_camera(img, cam, +1); } static void image_move_camera_down(image_t *img, camera_t *cam) { image_move_camera(img, cam, -1); } void image_set(image_t *img, image_t *other) { layer_t *layer, *tmp, *other_layer; DL_FOREACH_SAFE(img->layers, layer, tmp) { DL_DELETE(img->layers, layer); layer_delete(layer); } DL_FOREACH(other->layers, other_layer) { layer = layer_copy(other_layer); DL_APPEND(img->layers, layer); if (other_layer == other->active_layer) img->active_layer = layer; } } #if 0 // For debugging purpose. static void debug_print_history(image_t *img) { int i = 0; image_t *hist; DL_FOREACH2(img->history, hist, history_next) { printf("%d%s ", i++, hist == img ? "*" : " "); } printf("\n"); } #else static void debug_print_history(image_t *img) {} #endif void image_history_push(image_t *img) { image_t *snap = image_snap(img); image_t *hist; layer_t *layer, *layer_tmp; // Discard previous undo. while ((hist = img->history_next)) { DL_FOREACH_SAFE(hist->layers, layer, layer_tmp) { DL_DELETE(hist->layers, layer); layer_delete(layer); } DL_DELETE2(img->history, hist, history_prev, history_next); free(hist); } DL_DELETE2(img->history, img, history_prev, history_next); DL_APPEND2(img->history, snap, history_prev, history_next); DL_APPEND2(img->history, img, history_prev, history_next); debug_print_history(img); } // XXX: not clear what this is doing. We should try to remove it. // It swap the content of two images without touching their pointer or // history. static void swap(image_t *a, image_t *b) { SWAP(*a, *b); SWAP(a->history, b->history); SWAP(a->history_next, b->history_next); SWAP(a->history_prev, b->history_prev); } void image_undo(image_t *img) { image_t *prev = img->history_prev; if (img->history == img) { LOG_D("No more undo"); return; } DL_DELETE2(img->history, img, history_prev, history_next); DL_PREPEND_ELEM2(img->history, prev, img, history_prev, history_next); swap(img, prev); goxel_update_meshes(-1); debug_print_history(img); } void image_redo(image_t *img) { image_t *next = img->history_next; if (!next) { LOG_D("No more redo"); return; } DL_DELETE2(img->history, next, history_prev, history_next); DL_PREPEND_ELEM2(img->history, img, next, history_prev, history_next); swap(img, next); goxel_update_meshes(-1); debug_print_history(img); } void image_clear_layer(layer_t *layer, const float box[4][4]) { painter_t painter; layer = layer ?: goxel.image->active_layer; if (!box || box_is_null(box)) { mesh_clear(layer->mesh); return; } painter = (painter_t) { .shape = &shape_cube, .mode = MODE_SUB, .color = {255, 255, 255, 255}, }; mesh_op(layer->mesh, &painter, box); } bool image_layer_can_edit(const image_t *img, const layer_t *layer) { return !layer->base_id && !layer->image; } /* * Function: image_get_key * Return a value that is garantied to change when the image change. */ uint64_t image_get_key(const image_t *img) { uint64_t key = 0, k; layer_t *layer; camera_t *camera; DL_FOREACH(img->layers, layer) { k = layer_get_key(layer); key = crc64(key, &k, sizeof(k)); } DL_FOREACH(img->cameras, camera) { k = camera_get_key(camera); key = crc64(key, &k, sizeof(k)); } return key; } /* * Turn an image layer into a mesh of 1 voxel depth. */ static void image_image_layer_to_mesh(image_t *img, layer_t *layer) { uint8_t *data; int i, j, w, h, bpp = 0, pos[3]; uint8_t c[4]; float p[3]; img = img ?: goxel.image; layer = layer ?: img->active_layer; mesh_accessor_t acc; image_history_push(img); data = img_read(layer->image->path, &w, &h, &bpp); acc = mesh_get_accessor(layer->mesh); for (j = 0; j < w; j++) for (i = 0; i < h; i++) { vec3_set(p, i / (float)h - 0.5, 0.5 - j / (float)w, 0); mat4_mul_vec3(layer->mat, p, p); pos[0] = round(p[0]); pos[1] = round(p[1]); pos[2] = round(p[2]); memset(c, 0, 4); c[3] = 255; memcpy(c, data + (j * w + i) * bpp, bpp); mesh_set_at(layer->mesh, &acc, pos, c); } texture_delete(layer->image); layer->image = NULL; free(data); } ACTION_REGISTER(layer_clear, .help = "Clear the current layer", .cfunc = image_clear_layer, .csig = "vpp", .icon = ICON_DELETE, .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_new_layer, .help = "Add a new layer to the image", .cfunc = image_add_layer, .csig = "vp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_ADD, ) ACTION_REGISTER(img_del_layer, .help = "Delete the active layer", .cfunc = image_delete_layer, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_REMOVE, ) ACTION_REGISTER(img_move_layer, .help = "Move the active layer", .cfunc = image_move_layer, .csig = "vppi", .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_move_layer_up, .help = "Move the active layer up", .cfunc = image_move_layer_up, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_ARROW_UPWARD, ) ACTION_REGISTER(img_move_layer_down, .help = "Move the active layer down", .cfunc = image_move_layer_down, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_ARROW_DOWNWARD, ) ACTION_REGISTER(img_duplicate_layer, .help = "Duplicate the active layer", .cfunc = image_duplicate_layer, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_clone_layer, .help = "Clone the active layer", .cfunc = image_clone_layer, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_unclone_layer, .help = "Unclone the active layer", .cfunc = image_unclone_layer, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_select_parent_layer, .help = "Select the parent of a layer", .cfunc = image_select_parent_layer, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_merge_visible_layers, .help = "Merge all the visible layers", .cfunc = image_merge_visible_layers, .csig = "vp", .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_new_camera, .help = "Add a new camera to the image", .cfunc = image_add_camera, .csig = "vp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_ADD, ) ACTION_REGISTER(img_del_camera, .help = "Delete the active camera", .cfunc = image_delete_camera, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_REMOVE, ) ACTION_REGISTER(img_move_camera, .help = "Move the active camera", .cfunc = image_move_camera, .csig = "vppi", .flags = ACTION_TOUCH_IMAGE, ) ACTION_REGISTER(img_move_camera_up, .help = "Move the active camera up", .cfunc = image_move_camera_up, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_ARROW_UPWARD, ) ACTION_REGISTER(img_move_camera_down, .help = "Move the active camera down", .cfunc = image_move_camera_down, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, .icon = ICON_ARROW_DOWNWARD, ) ACTION_REGISTER(img_image_layer_to_mesh, .help = "Turn an image layer into a mesh", .cfunc = image_image_layer_to_mesh, .csig = "vpp", .flags = ACTION_TOUCH_IMAGE, ) goxel-0.8.1/src/imgui.cpp000066400000000000000000000020061334742672700152600ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* * Just include the imgui cpp files, so that we don't have to handle them * in the Scons file. */ #define IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_INCLUDE_IMGUI_USER_INL #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS #include "../ext_src/imgui/imgui.cpp" #include "../ext_src/imgui/imgui_draw.cpp" goxel-0.8.1/src/imgui_user.inl000066400000000000000000000216731334742672700163310ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ extern "C" { #include "goxel.h" } static ImVec4 imvec4(const uint8_t v[4]) { return ImVec4(v[0] / 255., v[1] / 255., v[2] / 255., v[3] / 255.); } static inline ImVec4 color_lighten(ImVec4 c, float k) { c.x *= k; c.y *= k; c.z *= k; return c; } namespace ImGui { void GoxBox2(ImVec2 pos, ImVec2 size, ImVec4 color, bool fill, float thickness = 1, int rounding_corners_flags = ~0) { ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; ImGuiWindow* window = GetCurrentWindow(); float r = style.FrameRounding; size.x = size.x ?: ImGui::GetContentRegionAvailWidth(); if (fill) { window->DrawList->AddRectFilled( pos, pos + size, ImGui::ColorConvertFloat4ToU32(color), r, rounding_corners_flags); } else { window->DrawList->AddRect( pos, pos + size, ImGui::ColorConvertFloat4ToU32(color), r, rounding_corners_flags, thickness); } } void GoxBox(ImVec2 pos, ImVec2 size, bool selected, int rounding_corners_flags = ~0) { ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; ImVec4 color = style.Colors[selected ? ImGuiCol_ButtonActive : ImGuiCol_Button]; return GoxBox2(pos, size, color, true, 1, rounding_corners_flags); } // Copied from imgui, with some customization... bool GoxInputScalarAsWidgetReplacement(const ImRect& aabb, const char* label, ImGuiDataType data_type, void* data_ptr, ImGuiID id, int decimal_precision) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); // Our replacement widget will override the focus ID (registered previously to allow for a TAB focus to happen) SetActiveID(g.ScalarAsInputTextId, window); SetHoveredID(0); FocusableItemUnregister(window); char buf[32]; DataTypeFormatString(data_type, data_ptr, decimal_precision, buf, IM_ARRAYSIZE(buf)); bool text_value_changed = InputTextEx(label, buf, IM_ARRAYSIZE(buf), aabb.GetSize(), ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_EnterReturnsTrue); if (g.ScalarAsInputTextId == 0) { // First frame IM_ASSERT(g.ActiveId == id); // InputText ID expected to match the Slider ID (else we'd need to store them both, which is also possible) g.ScalarAsInputTextId = g.ActiveId; SetHoveredID(id); } else if (g.ActiveId != g.ScalarAsInputTextId) { // Release g.ScalarAsInputTextId = 0; } if (text_value_changed) return DataTypeApplyOpFromText(buf, GImGui->InputTextState.InitialText.begin(), data_type, data_ptr, NULL); return false; } // Copied from imgui, with some custom modifications. bool GoxDragFloat(const char* label, const char* name, float* v, float v_speed, float v_min, float v_max, const char* display_format, float power) { ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImGuiID id = window->GetID(label); const float w = CalcItemWidth(); const ImVec2 label_size = CalcTextSize(label, NULL, true); const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f)); const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding); const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); // NB- we don't call ItemSize() yet because we may turn into a text edit box below if (!ItemAdd(total_bb, id, &frame_bb)) { ItemSize(total_bb, style.FramePadding.y); return false; } const bool hovered = ItemHoverable(frame_bb, id); if (hovered) SetHoveredID(id); if (!display_format) display_format = "%.3f"; int decimal_precision = ParseFormatPrecision(display_format, 3); // Tabbing or CTRL-clicking on Drag turns it into an input box bool start_text_input = false; const bool tab_focus_requested = FocusableItemRegister(window, g.ActiveId == id); if (tab_focus_requested || (hovered && (g.IO.MouseClicked[0] | g.IO.MouseDoubleClicked[0]))) { SetActiveID(id, window); FocusWindow(window); if (tab_focus_requested || g.IO.KeyCtrl || g.IO.MouseDoubleClicked[0]) { start_text_input = true; g.ScalarAsInputTextId = 0; } } if (start_text_input || (g.ActiveId == id && g.ScalarAsInputTextId == id)) return GoxInputScalarAsWidgetReplacement(frame_bb, label, ImGuiDataType_Float, v, id, decimal_precision); // Actual drag behavior ItemSize(total_bb, style.FramePadding.y); const bool value_changed = DragBehavior(frame_bb, id, v, v_speed, v_min, v_max, decimal_precision, power); // Display value using user-provided display format so user can add prefix/suffix/decorations to the value. char value_buf[64]; const char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v); RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImVec2(1.0f,0.5f)); value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), "%s:", name); RenderTextClipped(frame_bb.Min, frame_bb.Max - ImVec2(30, 0), value_buf, value_buf_end, NULL, ImVec2(0.0f,0.5f)); return value_changed; } bool GoxInputFloat(const char *label, float *v, float step, float minv, float maxv, const char *format) { const theme_t *theme = theme_get(); bool ret = false; ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; const ImVec2 button_sz = ImVec2( max(g.FontSize * 2.0f, theme->sizes.item_height), g.FontSize + style.FramePadding.y * 2.0f); int button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups; float speed = step / 20; uint8_t color[4]; ImGui::PushID(label); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 1)); theme_get_color(THEME_GROUP_WIDGET, THEME_COLOR_TEXT, 0, color); ImGui::PushStyleColor(ImGuiCol_Text, imvec4(color)); theme_get_color(THEME_GROUP_WIDGET, THEME_COLOR_INNER, 0, color); ImGui::PushStyleColor(ImGuiCol_Button, imvec4(color)); ImGui::PushStyleColor(ImGuiCol_FrameBg, imvec4(color)); ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, color_lighten(imvec4(color), 1.2)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, color_lighten(imvec4(color), 1.2)); ImGui::SetWindowFontScale(0.75); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); if (ImGui::ButtonEx("◀", button_sz, button_flags)) { (*v) -= step; ret = true; } ImGui::PopStyleVar(); ImGui::SetWindowFontScale(1); ImGui::SameLine(); ImGui::PushItemWidth( ImGui::GetContentRegionAvailWidth() - button_sz.x - style.ItemSpacing.x); ret |= ImGui::GoxDragFloat("", label, v, speed, minv, maxv, format, 1.0); ImGui::PopItemWidth(); ImGui::SameLine(); ImGui::SetWindowFontScale(0.75); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); if (ImGui::ButtonEx("▶", button_sz, button_flags)) { (*v) += step; ret = true; } ImGui::PopStyleVar(); ImGui::SetWindowFontScale(1); ImGui::PopStyleColor(5); ImGui::PopStyleVar(); ImGui::PopID(); if (ret) *v = clamp(*v, minv, maxv); return ret; } }; goxel-0.8.1/src/main.c000066400000000000000000000146021334742672700145370ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #ifdef GLES2 # define GLFW_INCLUDE_ES2 #endif #include static inputs_t *g_inputs = NULL; static GLFWwindow *g_window = NULL; static float g_scale = 1; void on_scroll(GLFWwindow *win, double x, double y) { g_inputs->mouse_wheel = y; } void on_char(GLFWwindow *win, unsigned int c) { inputs_insert_char(g_inputs, c); } typedef struct { char *input; char *export; float scale; } args_t; #ifndef NO_ARGP #include const char *argp_program_version = "goxel " GOXEL_VERSION_STR; const char *argp_program_bug_address = ""; static char doc[] = "A 3D voxels editor"; static char args_doc[] = "[INPUT]"; static struct argp_option options[] = { {"export", 'e', "FILENAME", 0, "Export the model to a file" }, {"scale", 's', "FLOAT", 0, "Set UI scale (for retina display)"}, {}, }; /* Parse a single option. */ static error_t parse_opt(int key, char *arg, struct argp_state *state) { args_t *args = state->input; switch (key) { case 'e': args->export = arg; break; case 's': args->scale = atof(arg); break; case ARGP_KEY_ARG: if (state->arg_num >= 1) argp_usage(state); args->input = arg; break; case ARGP_KEY_END: break; default: return ARGP_ERR_UNKNOWN; } return 0; } /* Our argp parser. */ static struct argp argp = { options, parse_opt, args_doc, doc }; #endif static void loop_function(void) { int fb_size[2], win_size[2]; int i; double xpos, ypos; float scale = g_scale; if ( !glfwGetWindowAttrib(g_window, GLFW_VISIBLE) || glfwGetWindowAttrib(g_window, GLFW_ICONIFIED)) { glfwWaitEvents(); goto end; } // The input struct gets all the values in framebuffer coordinates, // On retina display, this might not be the same as the window // size. glfwGetWindowSize(g_window, &win_size[0], &win_size[1]); glfwGetFramebufferSize(g_window, &fb_size[0], &fb_size[1]); g_inputs->window_size[0] = win_size[0] / scale; g_inputs->window_size[1] = win_size[1] / scale; g_inputs->scale = fb_size[0] / win_size[0] * scale; GL(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); for (i = 0; i <= GLFW_KEY_LAST; i++) { g_inputs->keys[i] = glfwGetKey(g_window, i) == GLFW_PRESS; } glfwGetCursorPos(g_window, &xpos, &ypos); vec2_set(g_inputs->touches[0].pos, xpos / scale, ypos / scale); g_inputs->touches[0].down[0] = glfwGetMouseButton(g_window, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS; g_inputs->touches[0].down[1] = glfwGetMouseButton(g_window, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS; g_inputs->touches[0].down[2] = glfwGetMouseButton(g_window, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS; goxel_iter(g_inputs); goxel_render(); memset(g_inputs, 0, sizeof(*g_inputs)); glfwSwapBuffers(g_window); end: glfwPollEvents(); } #ifndef __EMSCRIPTEN__ static void start_main_loop(void (*func)(void)) { while (!glfwWindowShouldClose(g_window)) { func(); if (goxel.quit) break; } glfwTerminate(); } #else static void start_main_loop(void (*func)(void)) { emscripten_set_main_loop(func, 0, 1); } #endif #if GLFW_VERSION_MAJOR >= 3 && GLFW_VERSION_MINOR >= 2 static void load_icon(GLFWimage *image, const char *path) { uint8_t *img; int w, h, bpp = 0; img = img_read(path, &w, &h, &bpp); assert(img); assert(bpp == 4); image->width = w; image->height = h; image->pixels = img; } static void set_window_icon(GLFWwindow *window) { GLFWimage icons[7]; int i; load_icon(&icons[0], "asset://data/icons/icon16.png"); load_icon(&icons[1], "asset://data/icons/icon24.png"); load_icon(&icons[2], "asset://data/icons/icon32.png"); load_icon(&icons[3], "asset://data/icons/icon48.png"); load_icon(&icons[4], "asset://data/icons/icon64.png"); load_icon(&icons[5], "asset://data/icons/icon128.png"); load_icon(&icons[6], "asset://data/icons/icon256.png"); glfwSetWindowIcon(window, 7, icons); for (i = 0; i < 7; i++) free(icons[i].pixels); } #else static void set_window_icon(GLFWwindow *window) {} #endif static void set_window_title(void *user, const char *title) { glfwSetWindowTitle(g_window, title); } int main(int argc, char **argv) { args_t args = {.scale = 1}; GLFWwindow *window; GLFWmonitor *monitor; const GLFWvidmode *mode; int ret = 0; inputs_t inputs = {}; g_inputs = &inputs; // Setup sys callbacks. sys_callbacks.set_window_title = set_window_title; #ifndef NO_ARGP argp_parse (&argp, argc, argv, 0, 0, &args); #endif g_scale = args.scale; glfwInit(); glfwWindowHint(GLFW_SAMPLES, 4); monitor = glfwGetPrimaryMonitor(); mode = glfwGetVideoMode(monitor); window = glfwCreateWindow(mode->width, mode->height, "Goxel", NULL, NULL); g_window = window; glfwMakeContextCurrent(window); glfwSetScrollCallback(window, on_scroll); glfwSetCharCallback(window, on_char); glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, false); set_window_icon(window); #ifdef WIN32 glewInit(); #endif goxel_init(); // Run the unit tests in debug. if (DEBUG) { tests_run(); goxel_reset(); } if (args.input) action_exec2("import", "p", args.input); if (args.export) { if (!args.input) { LOG_E("trying to export an empty image"); ret = -1; } else { ret = action_exec2("export", "p", args.export); } goto end; } start_main_loop(loop_function); end: goxel_release(); return ret; } goxel-0.8.1/src/marchingcube.c000066400000000000000000000726741334742672700162570ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include // Number of sub position per voxel in the marching // cube rendering. #define MC_VOXEL_SUB_POS 8 // XXX: try to make it higher (up to 16!) static const int N = BLOCK_SIZE; // Marching cube data. static const int MC_EDGE_TABLE[256]; static const int8_t MC_TRI_TABLE[256][16]; // Represent a marching cube triangle vertex, by two vertex index and a factor // between them. If mu = 0, the vertex is at v0, if mu = 1, the vertex is // at v1, otherwise the vertex is somewhere in between. typedef struct { int edge; int v0, v1; float mu; float pos[3]; // Interpolated position. uint8_t color[4]; // Computed color. } mc_vert_t; static int mc_compute(const int neighboors[8], mc_vert_t (*out)[3]) { int edges, i, nb_tri; float f0, f1; int cube_index = 0; mc_vert_t verts[12]; for (i = 0; i < 8; i++) if (neighboors[i] >= 127) cube_index |= 1 << i; edges = MC_EDGE_TABLE[cube_index]; if (!edges) return 0; for (i = 0; i < 12; i++) { if (!(edges & (1 << i))) continue; verts[i].edge = i; verts[i].v0 = EDGES_VERTICES[i][0]; verts[i].v1 = EDGES_VERTICES[i][1]; f0 = neighboors[verts[i].v0] / 255.; f1 = neighboors[verts[i].v1] / 255.; verts[i].mu = (f0 - 0.5) / (float)(f0 - f1); } nb_tri = 0; for (i = 0; MC_TRI_TABLE[cube_index][i] != -1; i += 3) { out[nb_tri][0] = verts[MC_TRI_TABLE[cube_index][i + 0]]; out[nb_tri][1] = verts[MC_TRI_TABLE[cube_index][i + 1]]; out[nb_tri][2] = verts[MC_TRI_TABLE[cube_index][i + 2]]; nb_tri++; } assert(nb_tri <= 5); return nb_tri; } static void mc_interp_pos(const mc_vert_t *vert, float out[3], bool rounded) { int i; const int *p0 = VERTICES_POSITIONS[vert->v0]; const int *p1 = VERTICES_POSITIONS[vert->v1]; const float mu = vert->mu; for (i = 0; i < 3; i++) { out[i] = (p0[i] * (1 - mu) + p1[i] * mu); if (rounded) out[i] = round(out[i] * MC_VOXEL_SUB_POS / 4) * 4; else out[i] = out[i] * MC_VOXEL_SUB_POS; } } static void compute_triangle_normal(const mc_vert_t t[3], float out[3]) { int i; float u[3] = {t[1].pos[0] - t[0].pos[0], t[1].pos[1] - t[0].pos[1], t[1].pos[2] - t[0].pos[2]}; float v[3] = {t[2].pos[0] - t[0].pos[0], t[2].pos[1] - t[0].pos[1], t[2].pos[2] - t[0].pos[2]}; float n[3] = {u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]}; for (i = 0; i < 3; i++) out[i] = n[i]; vec3_normalize(out, out); } static void mix_pos(const float a[3], const float b[3], float out[3]) { int i; for (i = 0; i < 3; i++) out[i] = (a[i] + b[i]) / 2; } static bool color_eq(const uint8_t a[4], const uint8_t b[4]) { return memcmp(a, b, 3) == 0; } static bool poly_attach_triangle(int nb, mc_vert_t *poly, const mc_vert_t tri[3]) { int i, j, k; float n1[3], n2[3]; // Can always attach to an empty poly. if (nb == 0) { memcpy(poly, tri, 3 * sizeof(mc_vert_t)); return true; } compute_triangle_normal(poly, n1); compute_triangle_normal(tri, n2); if (fabs(vec3_dot(n1, n2) - 1.0) > 0.01) return false; for (i = 0; i < nb; i++) for (j = 0; j < 3; j++) { if (poly[i].edge == tri[(j + 2) % 3].edge && poly[(i + 1) % nb].edge == tri[(j + 1) % 3].edge) goto ok; } return false; ok: // Shift poly to make space for new vertex and add new point. for (k = nb; k > i + 1; k--) poly[k] = poly[k - 1]; poly[i + 1] = tri[j]; return true; } // Try to extract as many triangles as possible as a single polygon. static int get_poly(int nb, const mc_vert_t (*tri)[3], mc_vert_t *out, int *size) { int i; *size = 0; for (i = 0; i < nb; i++) { if (!poly_attach_triangle(*size, out, tri[i])) break; if (*size == 0) *size = 2; assert(*size < 6 * 6); (*size)++; } return i; } // Shift poly points in place so that the n-th point become the first one. static void poly_shift(int nb, mc_vert_t *poly, int n) { mc_vert_t tmp; int i; for (i = 0; i < n; i++) { tmp = poly[0]; memmove(poly, poly + 1, (nb - 1) * sizeof(*poly)); poly[nb - 1] = tmp; } } static int split_poly(int nb, mc_vert_t *poly, mc_vert_t (*out)[3], const float center[3]) { int i, j; float c[3] = {0, 0, 0}; mc_vert_t p1, p2; if (nb < 3) return 0; if (center == NULL) { center = c; for (i = 0; i < nb; i++) { for (j = 0; j < 3; j++) { c[j] += poly[i].pos[j]; } } for (i = 0; i < 3; i++) c[i] /= nb; } // First pass, try to remove all the plain color triangles. for (i = 0; i < nb; i++) { if ( color_eq(poly[i].color, poly[(i + 1) % nb].color) && color_eq(poly[i].color, poly[(i + nb - 1) % nb].color)) { poly_shift(nb, poly, i); out[0][0] = poly[0]; out[0][1] = poly[1]; out[0][2] = poly[nb - 1]; return 1 + split_poly(nb - 1, poly + 1, out + 1, center); } } // Second pass, try to remove all two adjacent colors into a quad. for (i = 0; nb < 6 && i < nb; i++) { if (color_eq(poly[i].color, poly[(i + 1) % nb].color)) { poly_shift(nb, poly, i); p1 = poly[0]; mix_pos(poly[0].pos, poly[nb - 1].pos, p1.pos); p2 = poly[0]; mix_pos(poly[1].pos, poly[2].pos, p2.pos); out[0][0] = poly[0]; out[0][1] = poly[1]; out[0][2] = p2; out[1][0] = poly[0]; out[1][1] = p2; out[1][2] = p1; poly[0] = p1; memcpy(poly[0].color, poly[nb - 1].color, 4); poly[1] = p2; memcpy(poly[1].color, poly[2].color, 4); return 2 + split_poly(nb, poly, out + 2, center); } } for (i = 0; i < nb; i++) { out[i * 2 + 0][0] = poly[i]; out[i * 2 + 0][1] = poly[i]; out[i * 2 + 0][2] = poly[i]; mix_pos(poly[i].pos, poly[(i + 1) % nb].pos, out[i * 2 + 0][1].pos); memcpy(out[i * 2 + 0][2].pos, center, sizeof(c)); out[i * 2 + 1][0] = poly[i]; out[i * 2 + 1][1] = poly[i]; out[i * 2 + 1][2] = poly[i]; memcpy(out[i * 2 + 1][1].pos, center, sizeof(c)); mix_pos(poly[i].pos, poly[(i + nb - 1) % nb].pos, out[i * 2 + 1][2].pos); } return nb * 2; } static int split_triangles(int nb, const mc_vert_t (*tri)[3], mc_vert_t (*out)[3]) { mc_vert_t poly[6 * 6]; mc_vert_t new_tri[30][3]; int i = 0, ret = 0, poly_size; while (i < nb) { i += get_poly(nb - i, tri + i, poly, &poly_size); ret += split_poly(poly_size, poly, new_tri + ret, NULL); } memcpy(out, new_tri, ret * sizeof(*out)); return ret; } int mesh_generate_vertices_mc(const mesh_t *mesh, const int block_pos[3], int effects, voxel_vertex_t *out, int *size, int *subdivide) { int i, vi, x, y, z, v, vx, vy, vz, nb_tri, nb_tri_tot = 0; uint8_t color[4] = {255, 255, 255, 255}, tmp[4]; uint8_t *data; int densities[8]; int p[3], s[3]; int rect[2][3] = {{INT_MAX, INT_MAX, INT_MAX}, {INT_MIN, INT_MIN, INT_MIN}}; mc_vert_t tri[30][3]; float n[3]; const bool flat = effects & EFFECT_FLAT; *size = 3; // Triangles. *subdivide = MC_VOXEL_SUB_POS; // To speed things up we first get the voxel cube around the block. data = malloc((N + 2) * (N + 2) * (N + 2) * 4); p[0] = block_pos[0] - 1; p[1] = block_pos[1] - 1; p[2] = block_pos[2] - 1; s[0] = N + 2; s[1] = N + 2; s[2] = N + 2; mesh_read(mesh, p, s, data); #define get_at(d, x, y, z, out) do { \ memcpy(out, &data[( \ (x + 1) + \ (y + 1) * (N + 2) + \ (z + 1) * (N + 2) * (N + 2)) * 4], 4); \ } while (0) // Get the smallest rect we need to consider. // XXX: can we measure how much we gain with that? for (z = -1; z < N + 1; z++) for (y = -1; y < N + 1; y++) for (x = -1; x < N + 1; x++) { get_at(data, x, y, z, tmp); if (tmp[3]) { rect[0][0] = min(rect[0][0], x - 2); rect[0][1] = min(rect[0][1], y - 2); rect[0][2] = min(rect[0][2], z - 2); rect[1][0] = max(rect[1][0], x + 2); rect[1][1] = max(rect[1][1], y + 2); rect[1][2] = max(rect[1][2], z + 2); } } rect[0][0] = max(rect[0][0], 0); rect[0][1] = max(rect[0][1], 0); rect[0][2] = max(rect[0][2], 0); rect[1][0] = min(rect[1][0], N); rect[1][1] = min(rect[1][1], N); rect[1][2] = min(rect[1][2], N); // Add up the contribution of each voxel to the vertices values. for (z = rect[0][2]; z < rect[1][2]; z++) for (y = rect[0][1]; y < rect[1][1]; y++) for (x = rect[0][0]; x < rect[1][0]; x++) { memset(densities, 0, sizeof(densities)); for (v = 0; v < 8; v++) { vx = x + VERTICES_POSITIONS[v][0]; vy = y + VERTICES_POSITIONS[v][1]; vz = z + VERTICES_POSITIONS[v][2]; get_at(data, vx, vy, vz, tmp); densities[v] = tmp[3]; } nb_tri = mc_compute(densities, tri); for (i = 0; i < nb_tri; i++) { for (v = 0; v < 3; v++) { mc_interp_pos(&tri[i][v], tri[i][v].pos, flat); uint8_t c1[4], c2[4]; get_at(data, x + VERTICES_POSITIONS[tri[i][v].v0][0], y + VERTICES_POSITIONS[tri[i][v].v0][1], z + VERTICES_POSITIONS[tri[i][v].v0][2], c1); get_at(data, x + VERTICES_POSITIONS[tri[i][v].v1][0], y + VERTICES_POSITIONS[tri[i][v].v1][1], z + VERTICES_POSITIONS[tri[i][v].v1][2], c2); memcpy(tri[i][v].color, c1[3] > c2[3] ? c1 : c2, sizeof(color)); } } if (flat) nb_tri = split_triangles(nb_tri, tri, tri); for (i = 0; i < nb_tri; i++) { compute_triangle_normal(tri[i], n); for (v = 0; v < 3; v++) { vi = nb_tri_tot * 3 + v; memcpy(out[vi].color, tri[i][v].color, sizeof(out[vi].color)); out[vi].color[3] = 255; out[vi].pos[0] = tri[i][v].pos[0] + x * MC_VOXEL_SUB_POS + MC_VOXEL_SUB_POS / 2 + 0.5; out[vi].pos[1] = tri[i][v].pos[1] + y * MC_VOXEL_SUB_POS + MC_VOXEL_SUB_POS / 2 + 0.5; out[vi].pos[2] = tri[i][v].pos[2] + z * MC_VOXEL_SUB_POS + MC_VOXEL_SUB_POS / 2 + 0.5; out[vi].normal[0] = n[0] * 64; out[vi].normal[1] = n[1] * 64; out[vi].normal[2] = n[2] * 64; // XXX: this shouldn't matter. memset(out[vi].bshadow_uv, 0, sizeof(out[vi].bshadow_uv)); memset(out[vi].bump_uv, 0, sizeof(out[vi].bump_uv)); } nb_tri_tot++; } } free(data); return nb_tri_tot; } // Static data for marching cube algo. static const int MC_EDGE_TABLE[256] = { 0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c, 0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00, 0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c, 0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90, 0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c, 0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30, 0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac, 0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0, 0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c, 0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60, 0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc, 0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0, 0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c, 0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950, 0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc , 0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0, 0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc, 0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0, 0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c, 0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650, 0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc, 0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0, 0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c, 0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460, 0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac, 0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0, 0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c, 0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230, 0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c, 0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190, 0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c, 0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0 }; static const int8_t MC_TRI_TABLE[256][16] = { {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1}, {3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1}, {3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1}, {3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1}, {9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}, {2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1}, {8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}, {4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1}, {3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1}, {1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1}, {4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1}, {4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}, {5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1}, {2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1}, {9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}, {0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}, {2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1}, {10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1}, {5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1}, {5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1}, {9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1}, {1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1}, {10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1}, {8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1}, {2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1}, {7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1}, {2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1}, {11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1}, {5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1}, {11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1}, {11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1}, {9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1}, {2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1}, {6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1}, {3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1}, {6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}, {10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1}, {6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1}, {8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1}, {7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1}, {3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1}, {0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1}, {9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1}, {8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1}, {5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1}, {0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1}, {6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1}, {10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1}, {10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1}, {8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1}, {1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1}, {0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1}, {10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1}, {3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1}, {6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1}, {9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1}, {8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1}, {3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1}, {6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1}, {0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1}, {10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1}, {10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1}, {2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1}, {7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1}, {7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1}, {2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1}, {1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1}, {11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1}, {8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1}, {0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1}, {7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}, {10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}, {2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}, {6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1}, {7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1}, {2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1}, {10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1}, {10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1}, {0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1}, {7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1}, {6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1}, {8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1}, {9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1}, {6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1}, {4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1}, {10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1}, {8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1}, {0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1}, {1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1}, {8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1}, {10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1}, {4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1}, {10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}, {11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1}, {9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}, {6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1}, {7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1}, {3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1}, {7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1}, {3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1}, {6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1}, {9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1}, {1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1}, {4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1}, {7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1}, {6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1}, {3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1}, {0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1}, {6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1}, {0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1}, {11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1}, {6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1}, {5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1}, {9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1}, {1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1}, {1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1}, {10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1}, {0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1}, {5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1}, {10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1}, {11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1}, {9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1}, {7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1}, {2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1}, {8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1}, {9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1}, {9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1}, {1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1}, {9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1}, {5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1}, {0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1}, {10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1}, {2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1}, {0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1}, {0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1}, {9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1}, {5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1}, {3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1}, {5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1}, {8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1}, {0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1}, {9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1}, {1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1}, {3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1}, {4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1}, {9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1}, {11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1}, {11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1}, {2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1}, {9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1}, {3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1}, {1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1}, {4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1}, {3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1}, {0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1}, {1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} }; goxel-0.8.1/src/mesh.c000066400000000000000000000540001334742672700145430ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "mesh.h" #include "uthash.h" #include #include #include #define min(a, b) ({ \ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a < _b ? _a : _b; \ }) #define max(a, b) ({ \ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a > _b ? _a : _b; \ }) // Flags for the iterator/accessor status. enum { MESH_ITER_FINISHED = 1 << 9, MESH_ITER_BOX = 1 << 10, MESH_ITER_MESH2 = 1 << 11, }; typedef struct block_data block_data_t; struct block_data { int ref; uint64_t id; uint8_t voxels[BLOCK_SIZE * BLOCK_SIZE * BLOCK_SIZE][4]; // RGBA voxels. }; struct block { UT_hash_handle hh; // The hash table of pos -> blocks in a mesh. block_data_t *data; int pos[3]; uint64_t id; }; struct mesh { block_t *blocks; int *ref; // Used to implement copy on write of the blocks. uint64_t key; // Two meshes with the same key have the same value. }; static uint64_t g_uid = 2; // Global id counter. #define N BLOCK_SIZE #define vec3_copy(a, b) do {b[0] = a[0]; b[1] = a[1]; b[2] = a[2];} while (0) #define vec3_equal(a, b) (b[0] == a[0] && b[1] == a[1] && b[2] == a[2]) #define BLOCK_ITER(x, y, z) \ for (z = 0; z < N; z++) \ for (y = 0; y < N; y++) \ for (x = 0; x < N; x++) #define DATA_AT(d, x, y, z) (d->voxels[x + y * N + z * N * N]) #define BLOCK_AT(c, x, y, z) (DATA_AT(c->data, x, y, z)) static void mat4_mul_vec4(float mat[4][4], const float v[4], float out[4]) { float ret[4] = {0}; int i, j; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { ret[i] += mat[j][i] * v[j]; } } memcpy(out, ret, sizeof(ret)); } static void box_get_bbox(float box[4][4], int bbox[2][3]) { const float vertices[8][4] = { {-1, -1, +1, 1}, {+1, -1, +1, 1}, {+1, +1, +1, 1}, {-1, +1, +1, 1}, {-1, -1, -1, 1}, {+1, -1, -1, 1}, {+1, +1, -1, 1}, {-1, +1, -1, 1}}; int i; int ret[2][3] = {{INT_MAX, INT_MAX, INT_MAX}, {INT_MIN, INT_MIN, INT_MIN}}; float p[4]; for (i = 0; i < 8; i++) { mat4_mul_vec4(box, vertices[i], p); ret[0][0] = min(ret[0][0], (int)floor(p[0])); ret[0][1] = min(ret[0][1], (int)floor(p[1])); ret[0][2] = min(ret[0][2], (int)floor(p[2])); ret[1][0] = max(ret[1][0], (int)ceil(p[0])); ret[1][1] = max(ret[1][1], (int)ceil(p[1])); ret[1][2] = max(ret[1][2], (int)ceil(p[2])); } memcpy(bbox, ret, sizeof(ret)); } static void bbox_intersection(int a[2][3], int b[2][3], int out[2][3]) { int i; for (i = 0; i < 3; i++) { out[0][i] = max(a[0][i], b[0][i]); out[1][i] = min(a[1][i], b[1][i]); } } static block_data_t *get_empty_data(void) { static block_data_t *data = NULL; if (!data) { data = calloc(1, sizeof(*data)); data->ref = 1; data->id = 0; } return data; } static bool block_is_empty(const block_t *block, bool fast) { int x, y, z; if (!block) return true; if (block->data->id == 0) return true; if (fast) return false; BLOCK_ITER(x, y, z) { if (BLOCK_AT(block, x, y, z)[3]) return false; } return true; } static block_t *block_new(const int pos[3]) { block_t *block = calloc(1, sizeof(*block)); memcpy(block->pos, pos, sizeof(block->pos)); block->data = get_empty_data(); block->data->ref++; block->id = g_uid++; return block; } static void block_delete(block_t *block) { block->data->ref--; if (block->data->ref == 0) { free(block->data); } free(block); } static block_t *block_copy(const block_t *other) { block_t *block = malloc(sizeof(*block)); *block = *other; memset(&block->hh, 0, sizeof(block->hh)); block->data->ref++; block->id = g_uid++; return block; } static void block_set_data(block_t *block, block_data_t *data) { block->data->ref--; if (block->data->ref == 0) { free(block->data); } block->data = data; data->ref++; } // Copy the data if there are any other blocks having reference to it. static void block_prepare_write(block_t *block) { if (block->data->ref == 1) { block->data->id = ++g_uid; return; } block->data->ref--; block_data_t *data; data = calloc(1, sizeof(*block->data)); memcpy(data->voxels, block->data->voxels, N * N * N * 4); data->ref = 1; block->data = data; block->data->id = ++g_uid; } static void block_get_at(const block_t *block, const int pos[3], uint8_t out[4]) { int x, y, z; if (!block) { memset(out, 0, 4); return; } x = pos[0] - block->pos[0]; y = pos[1] - block->pos[1]; z = pos[2] - block->pos[2]; assert(x >= 0 && x < N); assert(y >= 0 && y < N); assert(z >= 0 && z < N); memcpy(out, BLOCK_AT(block, x, y, z), 4); } /* * Function: mesh_get_bbox * * Get the bounding box of a mesh. * * Inputs: * mesh - The mesh * exact - If true, compute the exact bounding box. If false, returns * an approximation that might be slightly bigger than the * actual box, but faster to compute. * * Outputs: * bbox - The bounding box as the bottom left and top right corner of * the mesh. If the mesh is empty, this will contain all zero. * * Returns: * true if the mesh is not empty. */ bool mesh_get_bbox(const mesh_t *mesh, int bbox[2][3], bool exact) { block_t *block; int ret[2][3] = {{INT_MAX, INT_MAX, INT_MAX}, {INT_MIN, INT_MIN, INT_MIN}}; int pos[3]; mesh_iterator_t iter; bool empty = false; if (!exact) { for (block = mesh->blocks; block; block = block->hh.next) { if (block_is_empty(block, true)) continue; ret[0][0] = min(ret[0][0], block->pos[0]); ret[0][1] = min(ret[0][1], block->pos[1]); ret[0][2] = min(ret[0][2], block->pos[2]); ret[1][0] = max(ret[1][0], block->pos[0] + N); ret[1][1] = max(ret[1][1], block->pos[1] + N); ret[1][2] = max(ret[1][2], block->pos[1] + N); } } else { iter = mesh_get_iterator(mesh, MESH_ITER_SKIP_EMPTY); while (mesh_iter(&iter, pos)) { if (!mesh_get_alpha_at(mesh, &iter, pos)) continue; ret[0][0] = min(ret[0][0], pos[0]); ret[0][1] = min(ret[0][1], pos[1]); ret[0][2] = min(ret[0][2], pos[2]); ret[1][0] = max(ret[1][0], pos[0] + 1); ret[1][1] = max(ret[1][1], pos[1] + 1); ret[1][2] = max(ret[1][2], pos[2] + 1); } } empty = ret[0][0] >= ret[1][0]; if (empty) memset(ret, 0, sizeof(ret)); memcpy(bbox, ret, sizeof(ret)); return !empty; } static void mesh_prepare_write(mesh_t *mesh) { block_t *blocks, *block, *new_block; assert(*mesh->ref > 0); mesh->key = g_uid++; if (*mesh->ref == 1) return; (*mesh->ref)--; mesh->ref = calloc(1, sizeof(*mesh->ref)); *mesh->ref = 1; blocks = mesh->blocks; mesh->blocks = NULL; for (block = blocks; block; block = block->hh.next) { block->id = g_uid++; // Invalidate all accessors. new_block = block_copy(block); HASH_ADD(hh, mesh->blocks, pos, sizeof(new_block->pos), new_block); } } static block_t *mesh_add_block(mesh_t *mesh, const int pos[3]); static void mesh_add_neighbors_blocks(mesh_t *mesh) { const int POS[6][3] = { {0, 0, -1}, {0, 0, +1}, {0, -1, 0}, {0, +1, 0}, {-1, 0, 0}, {+1, 0, 0}, }; int i, p[3]; uint64_t key = mesh->key; block_t *block, *tmp, *other; mesh_prepare_write(mesh); HASH_ITER(hh, mesh->blocks, block, tmp) { if (block_is_empty(block, true)) continue; for (i = 0; i < 6; i++) { p[0] = block->pos[0] + POS[i][0] * N; p[1] = block->pos[1] + POS[i][1] * N; p[2] = block->pos[2] + POS[i][2] * N; HASH_FIND(hh, mesh->blocks, p, 3 * sizeof(int), other); if (!other) mesh_add_block(mesh, p); } } // Adding empty blocks shouldn't change the key of the mesh. mesh->key = key; } void mesh_remove_empty_blocks(mesh_t *mesh, bool fast) { block_t *block, *tmp; uint64_t key = mesh->key; mesh_prepare_write(mesh); HASH_ITER(hh, mesh->blocks, block, tmp) { if (block_is_empty(block, false)) { HASH_DEL(mesh->blocks, block); block_delete(block); } } // Empty blocks shouldn't change the key of the mesh. mesh->key = key; } bool mesh_is_empty(const mesh_t *mesh) { return mesh->blocks == NULL; } mesh_t *mesh_new(void) { mesh_t *mesh; mesh = calloc(1, sizeof(*mesh)); mesh->ref = calloc(1, sizeof(*mesh->ref)); mesh->key = 1; // Empty mesh key. *mesh->ref = 1; return mesh; } mesh_iterator_t mesh_get_iterator(const mesh_t *mesh, int flags) { return (mesh_iterator_t){ .mesh = mesh, .flags = flags, }; } mesh_iterator_t mesh_get_union_iterator( const mesh_t *m1, const mesh_t *m2, int flags) { return (mesh_iterator_t){ .mesh = m1, .mesh2 = m2, .flags = flags, }; } mesh_iterator_t mesh_get_box_iterator(const mesh_t *mesh, const float box[4][4], int flags) { int mesh_bbox[2][3]; mesh_iterator_t iter = { .mesh = mesh, .flags = MESH_ITER_BOX | MESH_ITER_VOXELS | flags, }; memcpy(iter.box, box, sizeof(iter.box)); box_get_bbox(iter.box, iter.bbox); if (flags & MESH_ITER_SKIP_EMPTY) { mesh_get_bbox(mesh, mesh_bbox, false); bbox_intersection(mesh_bbox, iter.bbox, iter.bbox); } return iter; } mesh_accessor_t mesh_get_accessor(const mesh_t *mesh) { return (mesh_accessor_t){0}; } void mesh_clear(mesh_t *mesh) { assert(mesh); block_t *block, *tmp; mesh_prepare_write(mesh); HASH_ITER(hh, mesh->blocks, block, tmp) { HASH_DEL(mesh->blocks, block); block_delete(block); } mesh->key = 1; // Empty mesh key. mesh->blocks = NULL; } void mesh_delete(mesh_t *mesh) { block_t *block, *tmp; if (!mesh) return; (*mesh->ref)--; if (*mesh->ref == 0) { HASH_ITER(hh, mesh->blocks, block, tmp) { HASH_DEL(mesh->blocks, block); block_delete(block); } free(mesh->ref); } free(mesh); } mesh_t *mesh_copy(const mesh_t *other) { mesh_t *mesh = calloc(1, sizeof(*mesh)); mesh->blocks = other->blocks; mesh->ref = other->ref; mesh->key = other->key; (*mesh->ref)++; return mesh; } void mesh_set(mesh_t *mesh, const mesh_t *other) { block_t *block, *tmp; assert(mesh && other); if (mesh->blocks == other->blocks) return; // Already the same. (*mesh->ref)--; if (*mesh->ref == 0) { HASH_ITER(hh, mesh->blocks, block, tmp) { HASH_DEL(mesh->blocks, block); block_delete(block); } free(mesh->ref); } mesh->blocks = other->blocks; mesh->ref = other->ref; mesh->key = other->key; (*mesh->ref)++; } static uint64_t get_block_id(const block_t *block) { return block ? block->id : 1; } static block_t *mesh_get_block_at(const mesh_t *mesh, const int pos[3], mesh_accessor_t *it) { block_t *block; int p[3] = {pos[0] & ~(int)(N - 1), pos[1] & ~(int)(N - 1), pos[2] & ~(int)(N - 1)}; if (!it) { HASH_FIND(hh, mesh->blocks, p, 3 * sizeof(int), block); return block; } if ( it->block_id && it->block_id == get_block_id(it->block) && vec3_equal(it->block_pos, p)) { return it->block; } HASH_FIND(hh, mesh->blocks, p, 3 * sizeof(int), block); it->block = block; it->block_id = get_block_id(block); vec3_copy(p, it->block_pos); return block; } static block_t *mesh_add_block(mesh_t *mesh, const int pos[3]) { block_t *block; assert(pos[0] % BLOCK_SIZE == 0); assert(pos[1] % BLOCK_SIZE == 0); assert(pos[2] % BLOCK_SIZE == 0); assert(!mesh_get_block_at(mesh, pos, NULL)); mesh_prepare_write(mesh); block = block_new(pos); HASH_ADD(hh, mesh->blocks, pos, sizeof(block->pos), block); return block; } void mesh_get_at(const mesh_t *mesh, mesh_iterator_t *it, const int pos[3], uint8_t out[4]) { block_t *block; int p[3]; if (it && it->block_id && it->block_id == get_block_id(it->block)) { p[0] = pos[0] - it->block_pos[0]; p[1] = pos[1] - it->block_pos[1]; p[2] = pos[2] - it->block_pos[2]; if ( p[0] >= 0 && p[0] < N && p[1] >= 0 && p[1] < N && p[2] >= 0 && p[2] < N) { if (!it->block) memset(out, 0, 4); else memcpy(out, BLOCK_AT(it->block, p[0], p[1], p[2]), 4); return; } } block = mesh_get_block_at(mesh, pos, it); return block_get_at(block, pos, out); } void mesh_set_at(mesh_t *mesh, mesh_iterator_t *iter, const int pos[3], const uint8_t v[4]) { int p[3] = {pos[0] & ~(int)(N - 1), pos[1] & ~(int)(N - 1), pos[2] & ~(int)(N - 1)}; mesh_prepare_write(mesh); block_t *block = mesh_get_block_at(mesh, p, iter); if (!block) { block = mesh_add_block(mesh, p); if (iter) { iter->block = block; iter->block_id = get_block_id(block); vec3_copy(p, iter->block_pos); } } block_prepare_write(block); p[0] = pos[0] - block->pos[0]; p[1] = pos[1] - block->pos[1]; p[2] = pos[2] - block->pos[2]; assert(p[0] >= 0 && p[0] < N); assert(p[1] >= 0 && p[1] < N); assert(p[2] >= 0 && p[2] < N); memcpy(BLOCK_AT(block, p[0], p[1], p[2]), v, 4); } static bool mesh_iter_next_block_box(mesh_iterator_t *it) { int i; const mesh_t *mesh = it->mesh; if (!it->block_id) { it->block_pos[0] = it->bbox[0][0] & ~(int)(N - 1); it->block_pos[1] = it->bbox[0][1] & ~(int)(N - 1); it->block_pos[2] = it->bbox[0][2] & ~(int)(N - 1); goto end; } for (i = 0; i < 3; i++) { it->block_pos[i] += N; if (it->block_pos[i] <= it->bbox[1][i]) break; it->block_pos[i] = it->bbox[0][i] & ~(int)(N - 1); } if (i == 3) return false; end: HASH_FIND(hh, mesh->blocks, it->block_pos, 3 * sizeof(int), it->block); it->block_id = get_block_id(it->block); vec3_copy(it->block_pos, it->pos); return true; } static bool mesh_iter_next_block_union(mesh_iterator_t *it) { it->block = it->block ? it->block->hh.next : it->mesh->blocks; if (!it->block && !(it->flags & MESH_ITER_MESH2)) { it->block = it->mesh2->blocks; it->flags |= MESH_ITER_MESH2; } if (!it->block) return false; it->block_id = it->block->id; vec3_copy(it->block->pos, it->block_pos); vec3_copy(it->block->pos, it->pos); // Discard blocks that we already did from the first mesh. if (it->flags & MESH_ITER_MESH2) { if (mesh_get_block_at(it->mesh, it->block_pos, NULL)) return mesh_iter_next_block_union(it); } return true; } static bool mesh_iter_next_block(mesh_iterator_t *it) { if (it->block_id && it->block_id != get_block_id(it->block)) { it->block = mesh_get_block_at( (it->flags & MESH_ITER_MESH2) ? it->mesh2 : it->mesh, it->block_pos, it); } if (it->flags & MESH_ITER_BOX) return mesh_iter_next_block_box(it); if (it->mesh2) return mesh_iter_next_block_union(it); it->block = it->block ? it->block->hh.next : it->mesh->blocks; if (!it->block) return false; it->block_id = it->block->id; vec3_copy(it->block->pos, it->block_pos); vec3_copy(it->block->pos, it->pos); return true; } int mesh_iter(mesh_iterator_t *it, int pos[3]) { int i; if (!it->block_id) { // First call. // XXX: this is not good: mesh_iter shouldn't make change to the // mesh. if (it->flags & MESH_ITER_INCLUDES_NEIGHBORS) mesh_add_neighbors_blocks((mesh_t*)it->mesh); if (!mesh_iter_next_block(it)) return 0; goto end; } if (it->flags & MESH_ITER_BLOCKS) goto next_block; for (i = 0; i < 3; i++) { if (++it->pos[i] < it->block_pos[i] + N) break; it->pos[i] = it->block_pos[i]; } if (i < 3) goto end; next_block: if (!mesh_iter_next_block(it)) { // XXX: this is not good: mesh_iter shouldn't make changes to the // mesh. if (it->flags & MESH_ITER_INCLUDES_NEIGHBORS) mesh_remove_empty_blocks((mesh_t*)it->mesh, true); return 0; } end: if (pos) vec3_copy(it->pos, pos); return 1; } uint64_t mesh_get_key(const mesh_t *mesh) { return mesh ? mesh->key : 0; } void *mesh_get_block_data(const mesh_t *mesh, mesh_accessor_t *iter, const int bpos[3], uint64_t *id) { block_t *block = NULL; if ( iter && iter->block_id && iter->block_id == get_block_id(iter->block) && memcmp(&iter->pos, bpos, sizeof(iter->pos)) == 0) { block = iter->block; } else { HASH_FIND(hh, mesh->blocks, bpos, sizeof(iter->pos), block); } if (id) *id = block ? block->data->id : 0; return block ? block->data->voxels : NULL; } uint8_t mesh_get_alpha_at(const mesh_t *mesh, mesh_iterator_t *iter, const int pos[3]) { uint8_t v[4]; mesh_get_at(mesh, iter, pos, v); return v[3]; } void mesh_copy_block(const mesh_t *src, const int src_pos[3], mesh_t *dst, const int dst_pos[3]) { block_t *b1, *b2; mesh_prepare_write(dst); b1 = mesh_get_block_at(src, src_pos, NULL); b2 = mesh_get_block_at(dst, dst_pos, NULL); if (!b2) b2 = mesh_add_block(dst, dst_pos); block_set_data(b2, b1->data); } void mesh_read(const mesh_t *mesh, const int pos[3], const int size[3], uint8_t *data) { // For the moment we only support the case where we get the rectangle // of a block plus a one voxel border around it! assert(pos[0] - (pos[0] & ~(int)(N - 1)) == N - 1); assert(pos[1] - (pos[1] & ~(int)(N - 1)) == N - 1); assert(pos[2] - (pos[2] & ~(int)(N - 1)) == N - 1); assert(size[0] == N + 2); assert(size[1] == N + 2); assert(size[2] == N + 2); block_t *block; int block_pos[3] = {pos[0] + 1, pos[1] + 1, pos[2] + 1}; int i, z, y, x, dx, dy, dz, p[3]; uint8_t v[4]; mesh_accessor_t accessor; memset(data, 0, size[0] * size[1] * size[2] * 4); block = mesh_get_block_at(mesh, block_pos, NULL); if (!block) goto rest; for (z = 0; z < N; z++) for (y = 0; y < N; y++) for (x = 0; x < N; x++) { dx = x + 1; dy = y + 1; dz = z + 1; memcpy(&data[(dz * size[1] * size[0] + dy * size[0] + dx) * 4], &block->data->voxels[z * N * N + y * N + x], 4); } rest: // Fill the rest. // In order to optimize access, we iter in such a way to avoid changing // the current block: start with the planes, then the edges, and finally // the 8 corners. accessor = mesh_get_accessor(mesh); const int ranges[26][3][2] = { // 6 planes. {{0, 1}, {1, N + 1}, {1, N + 1}}, {{N + 1, N + 2}, {1, N + 1}, {1, N + 1}}, {{1, N + 1}, {0, 1}, {1, N + 1}}, {{1, N + 1}, {N + 1, N + 2}, {1, N + 1}}, {{1, N + 1}, {1, N + 1}, {0, 1}}, {{1, N + 1}, {1, N + 1}, {N + 1, N + 2}}, // 4 edges moving along X. {{1, N + 1}, {0, 1}, {0, 1}}, {{1, N + 1}, {N + 1, N + 2}, {0, 1}}, {{1, N + 1}, {0, 1}, {N + 1, N + 2}}, {{1, N + 1}, {N + 1, N + 2}, {N + 1, N + 2}}, // 4 edges moving along Y. {{0, 1}, {1, N + 1}, {0, 1}}, {{N + 1, N + 2}, {1, N + 1}, {0, 1}}, {{0, 1}, {1, N + 1}, {1, N + 2}}, {{N + 1, N + 2}, {1, N + 1}, {1, N + 2}}, // 4 edges moving along Z. {{0, 1}, {0, 1}, {1, N + 1}}, {{N + 1, N + 2}, {0, 1}, {1, N + 1}}, {{0, 1}, {N + 1, N + 2}, {1, N + 1}}, {{N + 1, N + 2}, {N + 1, N + 2}, {1, N + 1}}, // 8 Corners. {{0, 1 }, {0, 1 }, {0, 1 }}, {{N + 1, N + 2}, {0, 1 }, {0, 1 }}, {{0, 1 }, {N + 1, N + 2}, {0, 1 }}, {{N + 1, N + 2}, {N + 1, N + 2}, {0, 1 }}, {{0, 1 }, {0, 1 }, {N + 1, N + 2}}, {{N + 1, N + 2}, {0, 1 }, {N + 1, N + 2}}, {{0, 1 }, {N + 1, N + 2}, {N + 1, N + 2}}, {{N + 1, N + 2}, {N + 1, N + 2}, {N + 1, N + 2}}, }; for (i = 0; i < 26; i++) for (z = ranges[i][2][0]; z < ranges[i][2][1]; z++) for (y = ranges[i][1][0]; y < ranges[i][1][1]; y++) for (x = ranges[i][0][0]; x < ranges[i][0][1]; x++) { p[0] = pos[0] + x; p[1] = pos[1] + y; p[2] = pos[2] + z; mesh_get_at(mesh, &accessor, p, v); memcpy(&data[(z * size[1] * size[0] + y * size[0] + x) * 4], v, 4); } } goxel-0.8.1/src/mesh.h000066400000000000000000000120711334742672700145520ustar00rootroot00000000000000#ifndef MESH_H #define MESH_H #include #include #define BLOCK_SIZE 16 /* Type: mesh_t * Opaque type that represents a mesh. */ typedef struct mesh mesh_t; typedef struct block block_t; /* Enum: MESH_ITER * Some flags that can be used to modify the behavior of the iteration * function. * * MESH_ITER_VOXELS - Iter on the voxels (default if zero). * MESH_ITER_BLOCKS - Iter on the blocks: the iterator return successive * blocks positions. * MESH_ITER_INCLUDES_NEIGHBORS - Also yield one position for each * neighbor of the voxels. * MESH_ITER_SKIP_EMPTY - Don't yield empty voxels/blocks. */ enum { MESH_ITER_VOXELS = 1 << 0, MESH_ITER_BLOCKS = 1 << 1, MESH_ITER_INCLUDES_NEIGHBORS = 1 << 2, MESH_ITER_SKIP_EMPTY = 1 << 3, }; /* Type mesh_iterator_t * Fast iterator of all the mesh voxels. * * This struct can be used when we want to make a lot of successive accesses * to the same mesh. * * It's also the struct used as an iterator into the mesh voxels. * * You don't need to care about the attributes, just create them with * , , or * . */ typedef struct { const mesh_t *mesh; const mesh_t *mesh2; // Current cached block and its position. // the block can be NULL if there is no block at this position. block_t *block; int block_pos[3]; uint64_t block_id; int pos[3]; float box[4][4]; int bbox[2][3]; int flags; } mesh_iterator_t; typedef mesh_iterator_t mesh_accessor_t; /* * Function: mesh_new * Create a new mesh. */ mesh_t *mesh_new(void); /* * Function: mesh_delete * Delete a mesh. */ void mesh_delete(mesh_t *mesh); /* Function: mesh_clear * * Clear all the voxels from a mesh. */ void mesh_clear(mesh_t *mesh); mesh_t *mesh_copy(const mesh_t *mesh); void mesh_set(mesh_t *mesh, const mesh_t *other); mesh_accessor_t mesh_get_accessor(const mesh_t *mesh); void mesh_get_at(const mesh_t *mesh, mesh_iterator_t *it, const int pos[3], uint8_t out[4]); uint8_t mesh_get_alpha_at(const mesh_t *mesh, mesh_iterator_t *it, const int pos[3]); /* * Function: mesh_set_at * * Set a single voxel value in a mesh. * * Inputs: * mesh - The mesh. * it - Optional mesh iterator. Successive access to the same mesh * using the iterator are optimized. * pos - Position of the voxel. * v - Value to set. */ void mesh_set_at(mesh_t *mesh, mesh_iterator_t *it, const int pos[3], const uint8_t v[4]); // XXX: we should remove this one I guess. void mesh_remove_empty_blocks(mesh_t *mesh, bool fast); /* * Function: mesh_is_empty * * Test whether a mesh has no voxel. * * Returns: * true if the mesh is empty, false otherwise. */ bool mesh_is_empty(const mesh_t *mesh); /* * Function: mesh_get_bbox * * Get the bounding box of a mesh. * * Inputs: * mesh - The mesh * exact - If true, compute the exact bounding box. If false, returns * an approximation that might be slightly bigger than the * actual box, but faster to compute. * * Outputs: * bbox - The bounding box as the bottom left and top right corner of * the mesh. If the mesh is empty, this will contain all zero. * * Returns: * true if the mesh is not empty. */ bool mesh_get_bbox(const mesh_t *mesh, int bbox[2][3], bool exact); /* * Function: mesh_get_iterator * Return an iterator that yield all the voxels of the mesh. * * Parameters: * mesh - The mesh we want to iterate. * flags - Any of the enum. */ mesh_iterator_t mesh_get_iterator(const mesh_t *mesh, int flags); // Return an iterator that follow a given box shape. mesh_iterator_t mesh_get_box_iterator(const mesh_t *mesh, const float box[4][4], int flags); mesh_iterator_t mesh_get_union_iterator( const mesh_t *m1, const mesh_t *m2, int flags); int mesh_iter(mesh_iterator_t *it, int pos[3]); /* * Function: mesh_get_key * * Return a value that is guarantied to be different for different meshes. * * This key can be used for quickly testing if two meshes are the same. * * Note that two meshes with the same key are guarantied to have the same * content, but two meshes with different key could still have the same * content: this is not an actual hash! * * Inputs: * mesh - The mesh. * * Return: * The key, if the mesh input is NULL, returns zero. * */ uint64_t mesh_get_key(const mesh_t *mesh); void *mesh_get_block_data(const mesh_t *mesh, mesh_accessor_t *accessor, const int bpos[3], uint64_t *id); // Maybe replace this with a generic mesh_copy_part function? void mesh_copy_block(const mesh_t *src, const int src_pos[3], mesh_t *dst, const int dst_pos[3]); void mesh_read(const mesh_t *mesh, const int pos[3], const int size[3], uint8_t *data); #endif // MESH_H goxel-0.8.1/src/mesh_to_vertices.c000066400000000000000000000230471334742672700171600ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" static const int N = BLOCK_SIZE; // Implemented in marchingcube.c int mesh_generate_vertices_mc(const mesh_t *mesh, const int block_pos[3], int effects, voxel_vertex_t *out, int *size, int *pos_scale); static bool block_is_face_visible(uint32_t neighboors_mask, int f) { #define M(x, y, z) (1 << ((x + 1) + (y + 1) * 3 + (z + 1) * 9)) static const uint32_t MASKS[6] = { M(0, -1, 0), M(0, +1, 0), M(0, 0, -1), M(0, 0, +1), M(+1, 0, 0), M(-1, 0, 0), }; #undef M return !(MASKS[f] & neighboors_mask); } static void block_get_normal(uint32_t neighboors_mask, const uint8_t neighboors[27], int f, bool smooth, int8_t out[3]) { int x, y, z, i = 0; int sx = 0, sy = 0, sz = 0; int smax; if (!smooth) { out[0] = FACES_NORMALS[f][0]; out[1] = FACES_NORMALS[f][1]; out[2] = FACES_NORMALS[f][2]; return; } for (z = -1; z <= +1; z++) for (y = -1; y <= +1; y++) for (x = -1; x <= +1; x++) { if (neighboors_mask & (1 << i)) { sx -= neighboors[i] * x; sy -= neighboors[i] * y; sz -= neighboors[i] * z; } i++; } if (sx == 0 && sy == 0 && sz == 0) { out[0] = FACES_NORMALS[f][0]; out[1] = FACES_NORMALS[f][1]; out[2] = FACES_NORMALS[f][2]; return; } smax = max(abs(sx), max(abs(sy), abs(sz))); out[0] = sx * 127 / smax; out[1] = sy * 127 / smax; out[2] = sz * 127 / smax; } static bool block_get_edge_border(uint32_t neighboors_mask, int f, int e) { #define M(x, y, z) (1 << ((x + 1) + (y + 1) * 3 + (z + 1) * 9)) static const uint32_t MASKS[6][4] = { /* F0 */ {M( 0, -1, -1), M(+1, -1, 0), M( 0, -1, +1), M(-1, -1, 0)}, /* F1 */ {M( 0, +1, -1), M(-1, +1, 0), M( 0, +1, +1), M(+1, +1, 0)}, /* F2 */ {M(-1, 0, -1), M( 0, 1, -1), M( 1, 0, -1), M( 0, -1, -1)}, /* F3 */ {M( 1, 0, 1), M( 0, 1, 1), M(-1, 0, 1), M( 0, -1, 1)}, /* F4 */ {M( 1, 0, -1), M( 1, 1, 0), M( 1, 0, 1), M( 1, -1, 0)}, /* F5 */ {M(-1, -1, 0), M(-1, 0, 1), M(-1, 1, 0), M(-1, 0, -1)}, }; #undef M return neighboors_mask & MASKS[f][e]; } static bool block_get_vertice_border(uint32_t neighboors_mask, int f, int i) { #define M(x, y, z) (1 << ((x + 1) + (y + 1) * 3 + (z + 1) * 9)) static const uint32_t MASKS[6][4] = { { // F0 M(-1, -1, 0) | M( 0, -1, -1) | M(-1, -1, -1), M( 0, -1, -1) | M( 1, -1, 0) | M( 1, -1, -1), M( 1, -1, 0) | M( 0, -1, 1) | M( 1, -1, 1), M( 0, -1, 1) | M(-1, -1, 0) | M(-1, -1, 1), }, { //F1 M( 1, 1, 0) | M( 0, 1, -1) | M( 1, 1, -1), M( 0, 1, -1) | M(-1, 1, 0) | M(-1, 1, -1), M(-1, 1, 0) | M( 0, 1, 1) | M(-1, 1, 1), M( 0, 1, 1) | M( 1, 1, 0) | M( 1, 1, 1), }, { // F2 M( 0, -1, -1) | M(-1, 0, -1) | M(-1, -1, -1), M(-1, 0, -1) | M( 0, 1, -1) | M(-1, 1, -1), M( 0, 1, -1) | M( 1, 0, -1) | M( 1, 1, -1), M( 1, 0, -1) | M( 0, -1, -1) | M( 1, -1, -1), }, { // F3 M( 0, -1, 1) | M( 1, 0, 1) | M( 1, -1, 1), M( 1, 0, 1) | M( 0, 1, 1) | M( 1, 1, 1), M( 0, 1, 1) | M(-1, 0, 1) | M(-1, 1, 1), M(-1, 0, 1) | M( 0, -1, 1) | M(-1, -1, 1), }, { // F4 M( 1, -1, 0) | M( 1, 0, -1) | M( 1, -1, -1), M( 1, 0, -1) | M( 1, 1, 0) | M( 1, 1, -1), M( 1, 1, 0) | M( 1, 0, 1) | M( 1, 1, 1), M( 1, 0, 1) | M( 1, -1, 0) | M( 1, -1, 1), }, { // F5 M(-1, 0, -1) | M(-1, -1, 0) | M(-1, -1, -1), M(-1, -1, 0) | M(-1, 0, 1) | M(-1, -1, 1), M(-1, 0, 1) | M(-1, 1, 0) | M(-1, 1, 1), M(-1, 1, 0) | M(-1, 0, -1) | M(-1, 1, -1), }, }; #undef M return neighboors_mask & MASKS[f][i]; } static uint8_t block_get_shadow_mask(uint32_t neighboors_mask, int f) { int i; uint8_t ret = 0; for (i = 0; i < 4; i++) { ret |= block_get_vertice_border(neighboors_mask, f, i) ? (1 << i) : 0; ret |= block_get_edge_border(neighboors_mask, f, i) ? (0x10 << i) : 0; } return ret; } static uint8_t block_get_border_mask(uint32_t neighboors_mask, int f, int effects) { #define M(x, y, z) (1 << ((x + 1) + (y + 1) * 3 + (z + 1) * 9)) int e; int ret = 0; const int *n; if (effects & EFFECT_BORDERS_ALL) return 15; if (!(effects & EFFECT_BORDERS)) return 0; for (e = 0; e < 4; e++) { n = FACES_NORMALS[FACES_NEIGHBORS[f][e]]; if (!(neighboors_mask & M(n[0], n[1], n[2]))) ret |= 1 << e; } return ret; #undef M } #define data_get_at(d, x, y, z, out) do { \ memcpy(out, &data[( \ ((x) + 1) + \ ((y) + 1) * (N + 2) + \ ((z) + 1) * (N + 2) * (N + 2)) * 4], 4); \ } while (0) static uint32_t get_neighboors(const uint8_t *data, const int pos[3], uint8_t neighboors[27]) { int xx, yy, zz, i = 0; uint8_t v[4]; uint32_t ret = 0; for (zz = -1; zz <= 1; zz++) for (yy = -1; yy <= 1; yy++) for (xx = -1; xx <= 1; xx++) { data_get_at(data, pos[0] + xx, pos[1] + yy, pos[2] + zz, v); neighboors[i] = v[3]; if (neighboors[i] >= 127) ret |= 1 << i; i++; } return ret; } /* Packing of block id, pos, and face: * * x : 4 bits * y : 4 bits * z : 4 bits * pad : 1 bit * face: 3 bits * ------------- * tot : 16 bits */ static uint16_t get_pos_data(uint16_t x, uint16_t y, uint16_t z, uint16_t f) { assert(BLOCK_SIZE == 16); return (x << 12) | (y << 8) | (z << 4) | (f << 0); } int mesh_generate_vertices(const mesh_t *mesh, const int block_pos[3], int effects, voxel_vertex_t *out, int *size, int *subdivide) { int x, y, z, f; int i, nb = 0; uint32_t neighboors_mask; uint8_t shadow_mask, borders_mask; const int ts = VOXEL_TEXTURE_SIZE; uint8_t *data, neighboors[27], v[4]; int8_t normal[3]; int pos[3]; const int *vpos; if (effects & EFFECT_MARCHING_CUBES) return mesh_generate_vertices_mc(mesh, block_pos, effects, out, size, subdivide); *size = 4; // Quad. *subdivide = 1; // Unit is one voxel. // To speed things up we first get the voxel cube around the block. // XXX: can we do this while still using mesh iterators somehow? #define IVEC(...) ((int[]){__VA_ARGS__}) data = malloc((N + 2) * (N + 2) * (N + 2) * 4); mesh_read(mesh, IVEC(block_pos[0] - 1, block_pos[1] - 1, block_pos[2] - 1), IVEC(N + 2, N + 2, N + 2), data); for (z = 0; z < N; z++) for (y = 0; y < N; y++) for (x = 0; x < N; x++) { pos[0] = x; pos[1] = y; pos[2] = z; data_get_at(data, x, y, z, v); if (v[3] < 127) continue; // Non visible neighboors_mask = get_neighboors(data, pos, neighboors); for (f = 0; f < 6; f++) { if (!block_is_face_visible(neighboors_mask, f)) continue; block_get_normal(neighboors_mask, neighboors, f, effects & EFFECT_SMOOTH, normal); shadow_mask = block_get_shadow_mask(neighboors_mask, f); borders_mask = block_get_border_mask(neighboors_mask, f, effects); for (i = 0; i < 4; i++) { vpos = VERTICES_POSITIONS[FACES_VERTICES[f][i]]; out[nb * 4 + i].pos[0] = x + vpos[0]; out[nb * 4 + i].pos[1] = y + vpos[1]; out[nb * 4 + i].pos[2] = z + vpos[2]; memcpy(out[nb * 4 + i].normal, normal, sizeof(normal)); memcpy(out[nb * 4 + i].color, v, sizeof(v)); out[nb * 4 + i].color[3] = out[nb * 4 + i].color[3] ? 255 : 0; out[nb * 4 + i].bshadow_uv[0] = shadow_mask % 16 * ts + VERTICE_UV[i][0] * (ts - 1); out[nb * 4 + i].bshadow_uv[1] = shadow_mask / 16 * ts + VERTICE_UV[i][1] * (ts - 1); out[nb * 4 + i].uv[0] = VERTICE_UV[i][0] * 255; out[nb * 4 + i].uv[1] = VERTICE_UV[i][1] * 255; // For testing: // This put a border bump on all the edges of the voxel. out[nb * 4 + i].bump_uv[0] = borders_mask * 16; out[nb * 4 + i].bump_uv[1] = f * 16; out[nb * 4 + i].pos_data = get_pos_data(x, y, z, f); } nb++; } } free(data); return nb; } goxel-0.8.1/src/mesh_utils.c000066400000000000000000000366731334742672700160030ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include #define N BLOCK_SIZE // Used for the cache. static int mesh_del(void *data_) { mesh_t *mesh = data_; mesh_delete(mesh); return 0; } int mesh_select(const mesh_t *mesh, const int start_pos[3], int (*cond)(const uint8_t value[4], const uint8_t neighboors[6][4], const uint8_t mask[6], void *user), void *user, mesh_t *selection) { int i, j, a; uint8_t v2[4]; int pos[3], p[3], p2[3]; bool keep = true; uint8_t neighboors[6][4]; uint8_t mask[6]; mesh_iterator_t iter; mesh_accessor_t mesh_accessor, selection_accessor; mesh_clear(selection); mesh_accessor = mesh_get_accessor(mesh); selection_accessor = mesh_get_accessor(selection); mesh_set_at(selection, &selection_accessor, start_pos, (uint8_t[]){255, 255, 255, 255}); // XXX: Very inefficient algorithm! // Iter and test all the neighbors of the selection until there is // no more possible changes. while (keep) { keep = false; iter = mesh_get_iterator(selection, MESH_ITER_VOXELS); while (mesh_iter(&iter, pos)) { for (i = 0; i < 6; i++) { p[0] = pos[0] + FACES_NORMALS[i][0]; p[1] = pos[1] + FACES_NORMALS[i][1]; p[2] = pos[2] + FACES_NORMALS[i][2]; mesh_get_at(selection, &selection_accessor, p, v2); if (v2[3]) continue; // Already done. mesh_get_at(mesh, &mesh_accessor, p, v2); // Compute neighboors and mask. for (j = 0; j < 6; j++) { p2[0] = p[0] + FACES_NORMALS[j][0]; p2[1] = p[1] + FACES_NORMALS[j][1]; p2[2] = p[2] + FACES_NORMALS[j][2]; mesh_get_at(mesh, &mesh_accessor, p2, neighboors[j]); mask[j] = mesh_get_alpha_at(selection, &selection_accessor, p2); } // XXX: the (void*) are only here for gcc <= 4.8.4 a = cond((void*)v2, (void*)neighboors, (void*)mask, user); if (a) { mesh_set_at(selection, &selection_accessor, p, (uint8_t[]){255, 255, 255, a}); keep = true; } } } } return 0; } // XXX: need to redo this function from scratch. Even the API is a bit // stupid. void mesh_extrude(mesh_t *mesh, const float plane[4][4], const float box[4][4]) { float proj[4][4]; float n[3], pos[3], p[3]; mesh_iterator_t iter; int vpos[3]; uint8_t value[4]; vec3_normalize(plane[2], n); vec3_copy(plane[3], pos); // Generate the projection into the plane. // XXX: *very* ugly code, fix this! mat4_set_identity(proj); if (fabs(plane[2][0]) > 0.1) { proj[0][0] = 0; proj[3][0] = pos[0]; } if (fabs(plane[2][1]) > 0.1) { proj[1][1] = 0; proj[3][1] = pos[1]; } if (fabs(plane[2][2]) > 0.1) { proj[2][2] = 0; proj[3][2] = pos[2]; } // XXX: use an accessor to speed up access. iter = mesh_get_box_iterator(mesh, box, 0); while (mesh_iter(&iter, vpos)) { vec3_set(p, vpos[0], vpos[1], vpos[2]); if (!bbox_contains_vec(box, p)) { memset(value, 0, 4); } else { mat4_mul_vec3(proj, p, p); int pi[3] = {floor(p[0]), floor(p[1]), floor(p[2])}; mesh_get_at(mesh, NULL, pi, value); } mesh_set_at(mesh, NULL, vpos, value); } } static void mesh_fill( mesh_t *mesh, const float box[4][4], void (*get_color)(const int pos[3], uint8_t out[4], void *user_data), void *user_data) { int pos[3]; uint8_t color[4]; mesh_iterator_t iter; mesh_accessor_t accessor; mesh_clear(mesh); accessor = mesh_get_accessor(mesh); iter = mesh_get_box_iterator(mesh, box, 0); while (mesh_iter(&iter, pos)) { get_color(pos, color, user_data); mesh_set_at(mesh, &accessor, pos, color); } } static void mesh_move_get_color(const int pos[3], uint8_t c[4], void *user) { float p[3] = {pos[0], pos[1], pos[2]}; mesh_t *mesh = USER_GET(user, 0); float (*mat)[4][4] = USER_GET(user, 1); mat4_mul_vec3(*mat, p, p); int pi[3] = {round(p[0]), round(p[1]), round(p[2])}; mesh_get_at(mesh, NULL, pi, c); } void mesh_move(mesh_t *mesh, const float mat[4][4]) { float box[4][4]; mesh_t *src_mesh = mesh_copy(mesh); float imat[4][4]; mat4_invert(mat, imat); mesh_get_box(mesh, true, box); if (box_is_null(box)) return; mat4_mul(mat, box, box); mesh_fill(mesh, box, mesh_move_get_color, USER_PASS(src_mesh, &imat)); mesh_delete(src_mesh); mesh_remove_empty_blocks(mesh, false); } void mesh_blit(mesh_t *mesh, const uint8_t *data, int x, int y, int z, int w, int h, int d, mesh_iterator_t *iter) { mesh_iterator_t default_iter = {0}; int pos[3]; if (!iter) iter = &default_iter; for (pos[2] = z; pos[2] < z + d; pos[2]++) for (pos[1] = y; pos[1] < y + h; pos[1]++) for (pos[0] = x; pos[0] < x + w; pos[0]++) { mesh_set_at(mesh, iter, pos, data); data += 4; } mesh_remove_empty_blocks(mesh, false); } void mesh_shift_alpha(mesh_t *mesh, int v) { mesh_iterator_t iter; int pos[3]; uint8_t value[4]; iter = mesh_get_iterator(mesh, MESH_ITER_VOXELS); while (mesh_iter(&iter, pos)) { mesh_get_at(mesh, &iter, pos, value); value[3] = clamp(value[3] + v, 0, 255); mesh_set_at(mesh, NULL, pos, value); } } // Multiply two colors together. static void color_mul(const uint8_t a[4], const uint8_t b[4], uint8_t out[4]) { out[0] = (int)a[0] * b[0] / 255; out[1] = (int)a[1] * b[1] / 255; out[2] = (int)a[2] * b[2] / 255; out[3] = (int)a[3] * b[3] / 255; } // XXX: cleanup this: in fact we might not need that many modes! static void combine(const uint8_t a[4], const uint8_t b[4], int mode, uint8_t out[4]) { int i, aa = a[3], ba = b[3]; uint8_t ret[4]; memcpy(ret, a, 4); if (mode == MODE_PAINT) { ret[0] = mix(a[0], b[0], ba / 255.); ret[1] = mix(a[1], b[1], ba / 255.); ret[2] = mix(a[2], b[2], ba / 255.); } else if (mode == MODE_OVER) { if (255 * ba + aa * (255 - ba)) { for (i = 0; i < 3; i++) { ret[i] = (255 * b[i] * ba + a[i] * aa * (255 - ba)) / (255 * ba + aa * (255 - ba)); } } ret[3] = ba + aa * (255 - ba) / 255; } else if (mode == MODE_SUB) { ret[3] = max(0, aa - ba); } else if (mode == MODE_MAX) { ret[0] = b[0]; ret[1] = b[1]; ret[2] = b[2]; ret[3] = max(a[3], b[3]); } else if (mode == MODE_SUB_CLAMP) { ret[0] = a[0]; ret[1] = a[1]; ret[2] = a[2]; ret[3] = min(aa, 255 - ba); } else if (mode == MODE_MULT_ALPHA) { ret[0] = ret[0] * ba / 255; ret[1] = ret[1] * ba / 255; ret[2] = ret[2] * ba / 255; ret[3] = ret[3] * ba / 255; } else if (mode == MODE_INTERSECT) { ret[3] = min(aa, ba); } else { assert(false); } memcpy(out, ret, 4); } void mesh_op(mesh_t *mesh, const painter_t *painter, const float box[4][4]) { int i, vp[3]; uint8_t value[4], new_value[4], c[4]; mesh_iterator_t iter; mesh_accessor_t accessor; float size[3], p[3]; float mat[4][4]; float (*shape_func)(const float[3], const float[3], float smoothness); float k, v; int mode = painter->mode; bool use_box, skip_src_empty, skip_dst_empty; painter_t painter2; float box2[4][4]; mesh_t *cached; static cache_t *cache = NULL; const float *sym_o = painter->symmetry_origin; // Check if the operation has been cached. if (!cache) cache = cache_create(32); struct { uint64_t id; float box[4][4]; painter_t painter; } key; memset(&key, 0, sizeof(key)); key.id = mesh_get_key(mesh); mat4_copy(box, key.box); key.painter = *painter; cached = cache_get(cache, &key, sizeof(key)); if (cached) { mesh_set(mesh, cached); return; } if (painter->symmetry) { painter2 = *painter; for (i = 0; i < 3; i++) { if (!(painter->symmetry & (1 << i))) continue; painter2.symmetry &= ~(1 << i); mat4_set_identity(box2); mat4_itranslate(box2, +sym_o[0], +sym_o[1], +sym_o[2]); if (i == 0) mat4_iscale(box2, -1, 1, 1); if (i == 1) mat4_iscale(box2, 1, -1, 1); if (i == 2) mat4_iscale(box2, 1, 1, -1); mat4_itranslate(box2, -sym_o[0], -sym_o[1], -sym_o[2]); mat4_imul(box2, box); mesh_op(mesh, &painter2, box2); } } shape_func = painter->shape->func; box_get_size(box, size); mat4_copy(box, mat); mat4_iscale(mat, 1 / size[0], 1 / size[1], 1 / size[2]); mat4_invert(mat, mat); use_box = painter->box && !box_is_null(*painter->box); skip_src_empty = mode == MODE_SUB || mode == MODE_SUB_CLAMP || mode == MODE_MULT_ALPHA; skip_dst_empty = mode == MODE_SUB || mode == MODE_SUB_CLAMP || mode == MODE_MULT_ALPHA || mode == MODE_INTERSECT; if (mode != MODE_INTERSECT) { iter = mesh_get_box_iterator(mesh, box, skip_dst_empty ? MESH_ITER_SKIP_EMPTY : 0); } else { iter = mesh_get_iterator(mesh, skip_dst_empty ? MESH_ITER_SKIP_EMPTY : 0); } // XXX: for the moment we cannot use the same accessor for both // setting and getting! Need to fix that!! accessor = mesh_get_accessor(mesh); while (mesh_iter(&iter, vp)) { vec3_set(p, vp[0] + 0.5, vp[1] + 0.5, vp[2] + 0.5); if (use_box && !bbox_contains_vec(*painter->box, p)) continue; mat4_mul_vec3(mat, p, p); k = shape_func(p, size, painter->smoothness); if (painter->smoothness) { v = clamp(k / painter->smoothness, -1.0f, 1.0f) / 2.0f + 0.5f; } else { v = (k >= 0.f) ? 1.f : 0.f; } if (!v && skip_src_empty) continue; memcpy(c, painter->color, 4); c[3] *= v; if (!c[3] && skip_src_empty) continue; mesh_get_at(mesh, &accessor, vp, value); if (!value[3] && skip_dst_empty) continue; combine(value, c, mode, new_value); if (!vec4_equal(value, new_value)) mesh_set_at(mesh, &accessor, vp, new_value); } cache_add(cache, &key, sizeof(key), mesh_copy(mesh), 1, mesh_del); } // XXX: remove this function! void mesh_get_box(const mesh_t *mesh, bool exact, float box[4][4]) { int bbox[2][3]; mesh_get_bbox(mesh, bbox, exact); bbox_from_aabb(box, bbox); } static void block_merge(mesh_t *mesh, const mesh_t *other, const int pos[3], int mode, const uint8_t color[4]) { int p[3]; int x, y, z; uint64_t id1, id2; mesh_t *block; uint8_t v1[4], v2[4]; static cache_t *cache = NULL; mesh_accessor_t a1, a2, a3; mesh_get_block_data(mesh, NULL, pos, &id1); mesh_get_block_data(other, NULL, pos, &id2); // XXX: cleanup this code! if ( (mode == MODE_OVER || mode == MODE_MAX || mode == MODE_SUB || mode == MODE_SUB_CLAMP) && id2 == 0) { return; } if ((mode == MODE_OVER || mode == MODE_MAX) && id1 == 0 && !color) { mesh_copy_block(other, pos, mesh, pos); return; } if ((mode == MODE_MULT_ALPHA) && id1 == 0) return; if ((mode == MODE_MULT_ALPHA) && id2 == 0) { // XXX: could just delete the block. } // Check if the merge op has been cached. if (!cache) cache = cache_create(512); struct { uint64_t id1; uint64_t id2; int mode; uint8_t color[4]; } key = { id1, id2, mode }; if (color) memcpy(key.color, color, 4); _Static_assert(sizeof(key) == 24, ""); block = cache_get(cache, &key, sizeof(key)); if (block) goto end; block = mesh_new(); a1 = mesh_get_accessor(mesh); a2 = mesh_get_accessor(other); a3 = mesh_get_accessor(block); for (z = 0; z < N; z++) for (y = 0; y < N; y++) for (x = 0; x < N; x++) { p[0] = pos[0] + x; p[1] = pos[1] + y; p[2] = pos[2] + z; mesh_get_at(mesh, &a1, p, v1); mesh_get_at(other, &a2, p, v2); if (color) color_mul(v2, color, v2); combine(v1, v2, mode, v1); mesh_set_at(block, &a3, (int[]){x, y, z}, v1); } cache_add(cache, &key, sizeof(key), block, 1, mesh_del); end: mesh_copy_block(block, (int[]){0, 0, 0}, mesh, pos); return; } void mesh_merge(mesh_t *mesh, const mesh_t *other, int mode, const uint8_t color[4]) { mesh_t *cached; assert(mesh && other); static cache_t *cache = NULL; mesh_iterator_t iter; int bpos[3]; uint64_t id1, id2; // Check if the merge op has been cached. if (!cache) cache = cache_create(512); id1 = mesh_get_key(mesh); id2 = mesh_get_key(other); struct { uint64_t id1; uint64_t id2; int mode; uint8_t color[4]; } key = { id1, id2, mode }; if (color) memcpy(key.color, color, 4); _Static_assert(sizeof(key) == 24, ""); cached = cache_get(cache, &key, sizeof(key)); if (cached) { mesh_set(mesh, cached); return; } iter = mesh_get_union_iterator(mesh, other, MESH_ITER_BLOCKS); while (mesh_iter(&iter, bpos)) { block_merge(mesh, other, bpos, mode, color); } cache_add(cache, &key, sizeof(key), mesh_copy(mesh), 1, mesh_del); } void mesh_crop(mesh_t *mesh, const float box[4][4]) { painter_t painter = { .mode = MODE_INTERSECT, .color = {255, 255, 255, 255}, .shape = &shape_cube, }; mesh_op(mesh, &painter, box); } /* Function: mesh_crc64 * Compute the crc64 of the mesh data as an array of xyz rgba values. * * This is only used in the tests, to make sure that we can still open * old file formats. */ uint64_t mesh_crc64(const mesh_t *mesh) { mesh_iterator_t iter; int pos[3]; uint8_t v[4]; uint64_t ret = 0; iter = mesh_get_iterator(mesh, MESH_ITER_VOXELS); while (mesh_iter(&iter, pos)) { mesh_get_at(mesh, &iter, pos, v); if (!v[3]) continue; ret = crc64(ret, (void*)pos, sizeof(pos)); ret = crc64(ret, (void*)v, sizeof(v)); } return ret; } goxel-0.8.1/src/model3d.c000066400000000000000000000307241334742672700151450ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { GLint prog; GLint a_pos_l; GLint a_color_l; GLint a_normal_l; GLint a_uv_l; GLint u_color_l; GLint u_model_l; GLint u_view_l; GLint u_proj_l; GLint u_clip_l; GLint u_tex_l; GLint u_uv_scale_l; GLint u_strip_l; GLint u_time_l; GLint u_grid_alpha_l; GLint u_l_dir_l; GLint u_l_diff_l; GLint u_l_emit_l; } prog_t; static prog_t prog; static texture_t *g_white_tex = NULL; static void init_prog(prog_t *prog, const char *vshader, const char *fshader) { prog->prog = gl_create_prog(vshader, fshader, NULL); #define UNIFORM(x) GL(prog->x##_l = glGetUniformLocation(prog->prog, #x)) #define ATTRIB(x) GL(prog->x##_l = glGetAttribLocation(prog->prog, #x)) ATTRIB(a_pos); ATTRIB(a_color); ATTRIB(a_normal); ATTRIB(a_uv); UNIFORM(u_color); UNIFORM(u_model); UNIFORM(u_view); UNIFORM(u_proj); UNIFORM(u_clip); UNIFORM(u_tex); UNIFORM(u_uv_scale); UNIFORM(u_strip); UNIFORM(u_time); UNIFORM(u_grid_alpha); UNIFORM(u_l_dir); UNIFORM(u_l_diff); UNIFORM(u_l_emit); #undef ATTRIB #undef UNIFORM GL(glUseProgram(prog->prog)); GL(glUniform1i(prog->u_tex_l, 0)); } static texture_t *create_white_tex(void) { texture_t *tex; uint8_t *buffer; const int s = 16; tex = texture_new_surface(s, s, TF_RGB); buffer = malloc(s * s * 3); memset(buffer, 255, s * s * 3); glBindTexture(GL_TEXTURE_2D, tex->tex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, s, s, 0, GL_RGB, GL_UNSIGNED_BYTE, buffer); free(buffer); return tex; } void model3d_init(void) { const char *shader; shader = assets_get("asset://data/shaders/model3d.glsl", NULL); init_prog(&prog, shader, shader); g_white_tex = create_white_tex(); } model3d_t *model3d_cube(void) { int f, i, v; model3d_t *model = calloc(1, sizeof(*model)); model->solid = true; model->cull = true; const int *p; model->nb_vertices = 6 * 6; model->vertices = calloc(model->nb_vertices, sizeof(*model->vertices)); for (f = 0; f < 6; f++) { for (i = 0; i < 6; i++) { v = (int[]){0, 1, 2, 2, 3, 0}[i]; p = VERTICES_POSITIONS[FACES_VERTICES[f][v]]; vec3_set(model->vertices[f * 6 + i].pos, (p[0] - 0.5) * 2, (p[1] - 0.5) * 2, (p[2] - 0.5) * 2); vec3_set(model->vertices[f * 6 + i].normal, FACES_NORMALS[f][0], FACES_NORMALS[f][1], FACES_NORMALS[f][2]); vec4_set(model->vertices[f * 6 + i].color, 255, 255, 255, 255); } } model->dirty = true; return model; } model3d_t *model3d_wire_cube(void) { int f, i, v; const int *p; model3d_t *model = calloc(1, sizeof(*model)); model->nb_vertices = 6 * 8; model->vertices = calloc(model->nb_vertices, sizeof(*model->vertices)); for (f = 0; f < 6; f++) { for (i = 0; i < 8; i++) { v = (int[]){0, 1, 1, 2, 2, 3, 3, 0}[i]; p = VERTICES_POSITIONS[FACES_VERTICES[f][v]]; vec3_set(model->vertices[f * 8 + i].pos, (p[0] - 0.5) * 2, (p[1] - 0.5) * 2, (p[2] - 0.5) * 2); vec4_set(model->vertices[f * 8 + i].color, 255, 255, 255, 255); vec2_set(model->vertices[f * 8 + i].uv, 0.5, 0.5); } } model->cull = true; model->dirty = true; return model; } model3d_t *model3d_sphere(int slices, int stacks) { int slice, stack, ind, i; float z0, z1, r0, r1, a0, a1; model3d_t *model = calloc(1, sizeof(*model)); model_vertex_t *v; model->nb_vertices = slices * stacks * 6; model->vertices = calloc(model->nb_vertices, sizeof(*model->vertices)); v = model->vertices;; for (stack = 0; stack < stacks; stack++) { z0 = -1 + stack * 2.0f / stacks; z1 = -1 + (stack + 1) * 2.0f / stacks; r0 = sqrt(1 - z0 * z0); r1 = sqrt(1 - z1 * z1); for (slice = 0; slice < slices; slice++) { a0 = slice * M_PI * 2 / slices; a1 = (slice + 1) * M_PI * 2 / slices; ind = (stack * slices + slice) * 6; vec3_set(v[ind + 0].pos, r0 * cos(a0), r0 * sin(a0), z0); vec3_set(v[ind + 1].pos, r0 * cos(a1), r0 * sin(a1), z0); vec3_set(v[ind + 2].pos, r1 * cos(a0), r1 * sin(a0), z1); vec3_set(v[ind + 3].pos, r1 * cos(a1), r1 * sin(a1), z1); vec3_set(v[ind + 4].pos, r1 * cos(a0), r1 * sin(a0), z1); vec3_set(v[ind + 5].pos, r0 * cos(a1), r0 * sin(a1), z0); for (i = 0; i < 6; i++) vec3_copy(v[ind + i].pos, v[ind + i].normal); } } model->cull = true; model->dirty = true; return model; } model3d_t *model3d_grid(int nx, int ny) { model3d_t *model = calloc(1, sizeof(*model)); model_vertex_t *v; int i; float x, y; bool side; const uint8_t c[4] = {255, 255, 255, 160}; const uint8_t cb[4] = {255, 255, 255, 255}; model->nb_vertices = (nx + ny + 2) * 2; model->vertices = calloc(model->nb_vertices, sizeof(*model->vertices)); v = model->vertices; for (i = 0; i < nx + 1; i++) { side = i == 0 || i == nx; x = (float)i / nx - 0.5; vec3_set(v[i * 2 + 0].pos, x, -0.5, 0); vec3_set(v[i * 2 + 1].pos, x, +0.5, 0); vec4_copy(side ? cb : c, v[i * 2 + 0].color); vec4_copy(side ? cb : c, v[i * 2 + 1].color); } v = model->vertices + 2 * nx + 2; for (i = 0; i < ny + 1; i++) { side = i == 0 || i == ny; y = (float)i / ny - 0.5; vec3_set(v[i * 2 + 0].pos, -0.5, y, 0); vec3_set(v[i * 2 + 1].pos, +0.5, y, 0); vec4_copy(side ? cb : c, v[i * 2 + 0].color); vec4_copy(side ? cb : c, v[i * 2 + 1].color); } model->dirty = true; return model; } model3d_t *model3d_line(void) { model3d_t *model = calloc(1, sizeof(*model)); model->nb_vertices = 2; model->vertices = calloc(model->nb_vertices, sizeof(*model->vertices)); vec3_set(model->vertices[0].pos, -0.5, 0, 0); vec3_set(model->vertices[1].pos, +0.5, 0, 0); vec4_set(model->vertices[0].color, 255, 255, 255, 255); vec4_set(model->vertices[1].color, 255, 255, 255, 255); model->dirty = true; return model; } model3d_t *model3d_rect(void) { int i, v; model3d_t *model = calloc(1, sizeof(*model)); model->nb_vertices = 6; model->vertices = calloc(model->nb_vertices, sizeof(*model->vertices)); const float POS_UV[4][2][2] = { {{-0.5, -0.5}, {0, 1}}, {{+0.5, -0.5}, {1, 1}}, {{+0.5, +0.5}, {1, 0}}, {{-0.5, +0.5}, {0, 0}}, }; for (i = 0; i < 6; i++) { v = (int[]){0, 1, 2, 2, 3, 0}[i]; vec2_copy(POS_UV[v][0], model->vertices[i].pos); vec2_copy(POS_UV[v][1], model->vertices[i].uv); vec4_set(model->vertices[i].color, 255, 255, 255, 255); vec3_set(model->vertices[i].normal, 0, 1, 0); } model->solid = true; model->dirty = true; return model; } model3d_t *model3d_wire_rect(void) { int i, v; model3d_t *model = calloc(1, sizeof(*model)); model->nb_vertices = 8; model->vertices = calloc(model->nb_vertices, sizeof(*model->vertices)); const float POS_UV[4][2][2] = { {{-0.5, -0.5}, {0, 1}}, {{+0.5, -0.5}, {1, 1}}, {{+0.5, +0.5}, {1, 0}}, {{-0.5, +0.5}, {0, 0}}, }; for (i = 0; i < 8; i++) { v = ((i + 1) / 2) % 4; vec2_copy(POS_UV[v][0], model->vertices[i].pos); vec2_copy(POS_UV[v][1], model->vertices[i].uv); vec4_set(model->vertices[i].color, 255, 255, 255, 255); } model->dirty = true; return model; } static void copy_color(const uint8_t in[4], uint8_t out[4]) { if (in == NULL) { out[0] = 255; out[1] = 255; out[2] = 255; out[3] = 255; } else { memcpy(out, in, 4); } } void model3d_render(model3d_t *model3d, const float model[4][4], const float view[4][4], const float proj[4][4], const uint8_t color[4], const texture_t *tex, const float light[3], const float clip_box[4][4], int effects) { uint8_t c[4]; float cf[4]; float light_dir[3]; float clip[4][4] = {}; float grid_alpha; copy_color(color, c); GL(glUseProgram(prog.prog)); GL(glUniformMatrix4fv(prog.u_model_l, 1, 0, (float*)model)); GL(glUniformMatrix4fv(prog.u_view_l, 1, 0, (float*)view)); GL(glUniformMatrix4fv(prog.u_proj_l, 1, 0, (float*)proj)); GL(glEnableVertexAttribArray(prog.a_pos_l)); GL(glEnable(GL_BLEND)); GL(glEnable(GL_DEPTH_TEST)); GL(glDepthFunc(GL_LESS)); GL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); GL(glCullFace(GL_BACK)); model3d->cull ? GL(glEnable(GL_CULL_FACE)) : GL(glDisable(GL_CULL_FACE)); GL(glCullFace(effects & EFFECT_SEE_BACK ? GL_FRONT : GL_BACK)); if (!model3d->solid) GL(glDepthMask(false)); vec4_set(cf, c[0] / 255.0, c[1] / 255.0, c[2] / 255.0, c[3] / 255.0); GL(glUniform4fv(prog.u_color_l, 1, cf)); GL(glUniform1f(prog.u_strip_l, effects & EFFECT_STRIP ? 1.0 : 0.0)); GL(glUniform1f(prog.u_time_l, 0)); // No moving strip effects. tex = tex ?: g_white_tex; GL(glActiveTexture(GL_TEXTURE0)); GL(glBindTexture(GL_TEXTURE_2D, tex->tex)); GL(glUniform2f(prog.u_uv_scale_l, (float)tex->w / tex->tex_w, (float)tex->h / tex->tex_h)); if (model3d->dirty) { if (!model3d->vertex_buffer) GL(glGenBuffers(1, &model3d->vertex_buffer)); GL(glBindBuffer(GL_ARRAY_BUFFER, model3d->vertex_buffer)); GL(glBufferData(GL_ARRAY_BUFFER, model3d->nb_vertices * sizeof(*model3d->vertices), model3d->vertices, GL_STATIC_DRAW)); model3d->dirty = false; } GL(glBindBuffer(GL_ARRAY_BUFFER, model3d->vertex_buffer)); GL(glEnableVertexAttribArray(prog.a_pos_l)); GL(glVertexAttribPointer(prog.a_pos_l, 3, GL_FLOAT, false, sizeof(*model3d->vertices), (void*)offsetof(model_vertex_t, pos))); GL(glEnableVertexAttribArray(prog.a_color_l)); GL(glVertexAttribPointer(prog.a_color_l, 4, GL_UNSIGNED_BYTE, true, sizeof(*model3d->vertices), (void*)offsetof(model_vertex_t, color))); GL(glEnableVertexAttribArray(prog.a_uv_l)); GL(glVertexAttribPointer(prog.a_uv_l, 2, GL_FLOAT, false, sizeof(*model3d->vertices), (void*)offsetof(model_vertex_t, uv))); GL(glEnableVertexAttribArray(prog.a_normal_l)); GL(glVertexAttribPointer(prog.a_normal_l, 3, GL_FLOAT, false, sizeof(*model3d->vertices), (void*)offsetof(model_vertex_t, normal))); GL(glUniform1f(prog.u_l_emit_l, 1.0f)); GL(glUniform1f(prog.u_l_diff_l, 0.0f)); if (clip_box && !box_is_null(clip_box)) mat4_invert(clip_box, clip); GL(glUniformMatrix4fv(prog.u_clip_l, 1, 0, (float*)clip)); grid_alpha = (effects & EFFECT_GRID) ? 0.05 : 0.0; GL(glUniform1f(prog.u_grid_alpha_l, grid_alpha)); if (model3d->solid) { if (light && (!(effects & EFFECT_NO_SHADING))) { vec3_copy(light, light_dir); if (effects & EFFECT_SEE_BACK) vec3_imul(light_dir, -1); GL(glUniform3fv(prog.u_l_dir_l, 1, light_dir)); GL(glUniform1f(prog.u_l_emit_l, 0.2f)); GL(glUniform1f(prog.u_l_diff_l, 0.8f)); } GL(glDrawArrays(GL_TRIANGLES, 0, model3d->nb_vertices)); } else { GL(glDrawArrays(GL_LINES, 0, model3d->nb_vertices)); } GL(glDisableVertexAttribArray(prog.a_pos_l)); GL(glDisableVertexAttribArray(prog.a_color_l)); GL(glCullFace(GL_BACK)); GL(glDepthMask(true)); } goxel-0.8.1/src/mustache.c000066400000000000000000000116551334742672700154310ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #ifdef WIN32 # include #else # include #endif #include enum { M_TYPE_DICT, M_TYPE_LIST, M_TYPE_STR, }; struct mustache { char type; char *key; union { char *s; }; mustache_t *next, *prev, *children, *parent; }; static mustache_t *create_(mustache_t *m, const char *key, int type) { mustache_t *ret = calloc(1, sizeof(*ret)); ret->parent = m; ret->key = key ? strdup(key) : NULL; ret->type = type; if (m) DL_APPEND(m->children, ret); return ret; } mustache_t *mustache_root(void) { mustache_t *ret = calloc(1, sizeof(*ret)); ret->type = M_TYPE_DICT; return ret; } mustache_t *mustache_add_dict(mustache_t *m, const char *key) { return create_(m, key, M_TYPE_DICT); } mustache_t *mustache_add_list(mustache_t *m, const char *key) { return create_(m, key, M_TYPE_LIST); } void mustache_add_str(mustache_t *m, const char *key, const char *fmt, ...) { va_list args; mustache_t *ret; ret = create_(m, key, M_TYPE_STR); va_start(args, fmt); if (fmt) vasprintf(&ret->s, fmt, args); va_end(args); } void mustache_free(mustache_t *m) { mustache_t *c, *tmp; DL_FOREACH_SAFE(m->children, c, tmp) mustache_free(c); if (m->type == M_TYPE_STR) free(m->s); free(m->key); free(m); } const mustache_t *get_elem(const mustache_t *m, const char *key) { mustache_t *c; if (key[0] == '#') key++; DL_FOREACH(m->children, c) { if (c->key && strcmp(key, c->key) == 0) return c; } return NULL; } static int render_(const mustache_t *tree, const mustache_t *m, char *out) { int i = 0; mustache_t tmp; const mustache_t *c; const mustache_t *elem = NULL; if (tree->key) elem = get_elem(m, tree->key); // Some text. if (tree->type == M_TYPE_STR && !tree->key) { if (out) for (i = 0; i < strlen(tree->s); i++) *out++ = tree->s[i]; return strlen(tree->s); } if (tree->key && tree->key[0] == '/') return 0; // A list if (tree->key && tree->key[0] == '#') { if (!elem) return 0; tmp = *tree; tmp.type = M_TYPE_LIST; tmp.key = NULL; if (elem->type == M_TYPE_LIST) { DL_FOREACH(elem->children, c) { assert(c->type == M_TYPE_DICT); i += render_(&tmp, c, out ? out + i : NULL); } } if (elem->type == M_TYPE_DICT) { i += render_(&tmp, elem, out); } return i; } // A variable if (tree->type == M_TYPE_STR && tree->key) { if (!elem) return 0; if (out) for (i = 0; i < strlen(elem->s); i++) *out++ = elem->s[i]; return strlen(elem->s); } if (tree->children) { DL_FOREACH(tree->children, c) { i += render_(c, m, out ? out + i : NULL); } if (!tree->parent) { if (out) out[i] = '\0'; } return i; } return 0; } int mustache_render(const mustache_t *m, const char *templ, char *out) { regex_t reg; regmatch_t matches[2]; mustache_t *tree; char key[128]; int r, len; regcomp(®, "\\{\\{([#/]?[[:alnum:]_]+)\\}\\}", REG_EXTENDED); // Create the template tree. tree = mustache_add_list(NULL, NULL); while (templ) { r = regexec(®, templ, 2, matches, 0); if (r == REG_NOMATCH) { // No more tags. mustache_add_str(tree, NULL, templ); break; } if (matches[0].rm_so) mustache_add_str(tree, NULL, "%.*s", matches[0].rm_so, templ); len = matches[1].rm_eo - matches[1].rm_so; strncpy(key, templ + matches[1].rm_so, len); key[len] = '\0'; mustache_add_str(tree, key, NULL); if (key[0] == '/') { asprintf(&tree->s, "%.*s", (int)(templ - tree->s), tree->s); tree = tree->parent; } templ += matches[0].rm_eo; if (key[0] == '#') { tree = tree->children->prev; tree->s = (char*)templ; } } regfree(®); assert(!tree->parent); // Apply the parsed tree to the given dict. r = render_(tree, m, out); mustache_free(tree); return r; } goxel-0.8.1/src/palette.c000066400000000000000000000057631334742672700152610ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" // Parse a gimp palette. // XXX: we don't check for buffer overflow! static int parse_gpl(const char *data, char *name, int *columns, palette_entry_t *entries) { const char *start, *end; int linen, r, g, b, nb = 0; char entry_name[128]; start = data; for (linen = 1, start = data; *start; start = end + 1, linen++) { end = strchr(start, '\n'); if (!end) end = start + strlen(start); if (name && sscanf(start, "Name: %[^\n]", name) == 1) { name = NULL; continue; } if (columns && sscanf(start, "Columns: %d", columns) == 1) { columns = NULL; continue; } if (sscanf(start, "%d %d %d %[^\n]", &r, &g, &b, entry_name) >= 3) { if (entries) { strcpy(entries[nb].name, entry_name); entries[nb].color[0] = r; entries[nb].color[1] = g; entries[nb].color[2] = b; entries[nb].color[3] = 255; } nb++; } if (!*end) break; } return nb; } static int on_palette(int i, const char *path, void *user) { palette_t **list = user; const char *data; palette_t *pal; pal = calloc(1, sizeof(*pal)); data = assets_get(path, NULL); pal->size = parse_gpl(data, pal->name, &pal->columns, NULL); pal->entries = calloc(pal->size, sizeof(*pal->entries)); parse_gpl(data, NULL, NULL, pal->entries); DL_APPEND(*list, pal); return 0; } static int on_palette2(const char *dir, const char *name, void *user) { palette_t **list = user; char *data, *path; palette_t *pal; asprintf(&path, "%s/%s", dir, name); pal = calloc(1, sizeof(*pal)); data = read_file(path, NULL); pal->size = parse_gpl(data, pal->name, &pal->columns, NULL); pal->entries = calloc(pal->size, sizeof(*pal->entries)); parse_gpl(data, NULL, NULL, pal->entries); DL_APPEND(*list, pal); free(path); free(data); return 0; } void palette_load_all(palette_t **list) { char *dir; assets_list("data/palettes/", list, on_palette); if (sys_get_user_dir()) { asprintf(&dir, "%s/palettes", sys_get_user_dir()); sys_list_dir(dir, on_palette2, list); free(dir); } } goxel-0.8.1/src/plane.h000066400000000000000000000060771334742672700147260ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" /* A plane is defined as the 4x4 matrix to transform from the plane local * coordinate into global coordinates: * * * n * ^ v * | ^ . . . . . * | / . * | / . * |/ . * +---------> u * P * * Here the plane defined by the point P and vectors u and v with normal n, * will have a matrix like this: * * [ux uy yz 0] * [vx vy vz 0] * [nx ny nz 0] * [px py pz 1] * * This representation has several advantages: we can access the plane unitary * vectors, normal, and origin without any computation. I used an union so * that those values can be access directly as u, v, n, and p. For the * vec4 version we can also use u4, v4, n4, and p4. * * It is also trivial to transform a point in the plane into world * coordinates, simply by using matrix computation. * */ static const float plane_null[4][4] = {}; static inline void plane_from_vectors(float plane[4][4], const float pos[3], const float u[3], const float v[3]) { mat4_set_identity(plane); vec3_copy(u, plane[0]); vec3_copy(v, plane[1]); vec3_cross(u, v, plane[2]); vec3_copy(pos, plane[3]); } static inline bool plane_is_null(const float p[4][4]) { return p[3][3] == 0; } // Check if a plane intersect a line. // if out is set, it receive the position of the intersection in the // plane local coordinates. Apply the plane matrix on it to get the // object coordinate position. static inline bool plane_line_intersection(const float plane[4][4], const float p[3], const float n[3], float out[3]) { float v[3], m[4][4]; mat4_set_identity(m); vec3_copy(plane[0], m[0]); vec3_copy(plane[1], m[1]); vec3_copy(n, m[2]); if (!mat4_invert(m, m)) return false; if (out) { vec3_sub(p, plane[3], v); mat4_mul_vec3(m, v, out); out[2] = 0; } return true; } static inline void plane_from_normal(float plane[4][4], const float pos[3], const float n[3]) { int i; const float AXES[][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; mat4_set_identity(plane); vec3_copy(pos, plane[3]); vec3_normalize(n, plane[2]); for (i = 0; i < 3; i++) { vec3_cross(plane[2], AXES[i], plane[0]); if (vec3_norm2(plane[0]) > 0) break; } vec3_cross(plane[2], plane[0], plane[1]); } goxel-0.8.1/src/procedural.c000066400000000000000000000412141334742672700157520ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ // Procedural rendering inspired by ContextFree.org. // Need to write a doc about it. #include "goxel.h" #include // Amount of time (s) after which we force stop a rendering iteration. #define MAX_ITER_TIME (16.0 / 1000.) #define NODES \ X(PROG) \ X(SHAPE) \ X(RULE) \ X(BLOCK) \ X(CALL) \ X(ARGS) \ X(TRANSF) \ X(OP) \ X(VALUE) \ X(ID) \ X(LOOP) \ X(TRANSFB) \ X(IF) \ X(RETURN) \ X(SET) \ X(EXPR) \ X(FUN_CALL) \ // List of operators and the number of args they support. #define OPS \ X(s, 1, 3) \ X(sx, 1) \ X(sy, 1) \ X(sz, 1) \ X(sn, 0, 1) \ X(x, 1, 2, 3) \ X(y, 1, 2) \ X(z, 1) \ X(rx, 1) \ X(ry, 1) \ X(rz, 1) \ X(light,1, 2) \ X(sat, 1, 2) \ X(hue, 1, 2) \ X(sub, 0) \ X(paint,0) \ X(seed, 1) \ X(wait, 1) \ X(life, 1) \ X(antialiased, 1) \ enum { #define X(x) NODE_##x, NODES #undef X }; static const char *TYPES_STR[] = { #define X(x) [NODE_##x] = #x, NODES #undef X }; enum { #define X(id, ...) OP_##id, OPS #undef X OP_COUNT }; typedef struct op_info { const char *id; int nb[3]; } op_info_t; static op_info_t OP_INFOS[] = { #define X(id, ...) [OP_##id]= {#id, {__VA_ARGS__}}, OPS #undef X }; static const shape_t *SHAPES[] = { &shape_cube, &shape_sphere, &shape_cylinder, }; typedef struct proc_node node_t; struct proc_node { int type; char *id; float v; int size; node_t *children, *next, *prev, *parent; // Pos in the source code. int line; }; typedef struct proc_ctx ctx_t; struct proc_ctx { ctx_t *next, *prev; float box[4][4]; int mode; float color[4]; bool antialiased; uint32_t seed; node_t *prog; float vars[4]; int wait; int life; bool last; // Mark the end of a frame. }; // Move a value toward a target. If v is positive, move the value toward // range of v. If v is negative move the value toward 0 of -v. // For example: // // float x = 0; // move_value(&x, 0.5, 10) // x = 5 // move_value(&x, -1, 10) // x = 0 static void move_value(float *x, float v, float range) { float dst = v >= 0 ? range : 0; v = fabs(v); *x = mix(*x, dst, v); } static inline float mod(float x, float y) { while (x < 0) x += y; return fmod(x, y); } static void node_free(node_t *node) { node_t *c, *tmp; if (!node) return; DL_FOREACH_SAFE(node->children, c, tmp) { DL_DELETE(node->children, c); node_free(c); } free(node->id); free(node); } static void ctxs_free(ctx_t *ctx) { ctx_t *c, *tmp; if (!ctx) return; DL_FOREACH_SAFE(ctx, c, tmp) { DL_DELETE(ctx, c); free(c); } } static int error(gox_proc_t *proc, node_t *node, const char *msg, ...) { va_list args; va_start(args, msg); free(proc->error.str); vasprintf(&proc->error.str, msg, args); va_end(args); proc->error.line = node ? node->line : 0; proc->state = PROC_DONE; return -1; } #define TRY(f) ({ int r = f; if (r) return r; r;}) // Just for debugging. static void visit(node_t *node, int lev) { node_t *child; assert(node); if (node->id) LOG_D("%*s%s: '%s'", lev * 4, "", TYPES_STR[node->type], node->id); else if (node->type == NODE_VALUE) LOG_D("%*s%s: %f", lev * 4, "", TYPES_STR[node->type], node->v); else LOG_D("%*s%s", lev * 4, "", TYPES_STR[node->type]); DL_FOREACH(node->children, child) { visit(child, lev + 1); } } static void set_seed(float v, uint32_t *seed) { memcpy(seed, &v, 4); } #define SIMPLE_RAND_MAX 32767 uint32_t simple_rand(uint32_t *seed) { *seed = *seed * 1103515245 + 12345; return (uint32_t)(*seed / 65536) % 32768; } static float frand(float a, float b, uint32_t *seed) { return a + simple_rand(seed) / (float)SIMPLE_RAND_MAX * (b - a); } static float plusmin(float a, float b, uint32_t *seed) { return frand(a - b, a + b, seed); } // Evaluate an expression node. static float evaluate(node_t *node, ctx_t *ctx) { float a, b, c; if (node->type == NODE_VALUE) return node->v; assert(node->type == NODE_EXPR); if (str_equ(node->id, "var")) { assert(node->v > 0); return ctx->vars[(int)node->v - 1]; } a = evaluate(node->children, ctx); if (str_equ(node->id, "int")) return round(a); b = evaluate(node->children->next, ctx); if (str_equ(node->id, "+")) return a + b; if (str_equ(node->id, "-")) return a - b; if (str_equ(node->id, "*")) return a * b; if (str_equ(node->id, "/")) return a / b; if (str_equ(node->id, "+-")) return plusmin(a, b, &ctx->seed); if (str_equ(node->id, "==")) return (a == b) ? 1 : 0; if (str_equ(node->id, "!=")) return (a != b) ? 1 : 0; if (str_equ(node->id, "<")) return (a < b) ? 1 : 0; if (str_equ(node->id, ">")) return (a > b) ? 1 : 0; if (str_equ(node->id, "<=")) return (a <= b) ? 1 : 0; if (str_equ(node->id, ">=")) return (a >= b) ? 1 : 0; if (str_equ(node->id, "||")) return (a || b) ? 1 : 0; if (str_equ(node->id, "&&")) return (a && b) ? 1 : 0; c = evaluate(node->children->next->next, ctx); if (str_equ(node->id, "?:")) return a ? b : c; assert(false); return 0; } static node_t *get_rule(node_t *prog, const char *id, ctx_t *ctx) { node_t *node, *c; float tot = 0; DL_FOREACH(prog->children, node) { if ( node->type == NODE_SHAPE && strcmp(node->id, id) == 0) break; } if (!node) return NULL; if (node->children->type == NODE_BLOCK) return node->children; // Get the total proba. DL_FOREACH(node->children, c) { assert(c->type == NODE_RULE); tot += c->v; } // Now pick one rule randomly. DL_FOREACH(node->children, c) { if (frand(0, 1, &ctx->seed) <= c->v / tot) return c->children; tot -= c->v; } assert(false); return NULL; } static void scale_normalize(float mat[4][4], float v) { float s[3], m; float u[3][4] = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}}; int i; for (i = 0; i < 3; i++) { mat4_mul_vec4(mat, u[i], u[i]); s[i] = vec3_norm(u[i]); } m = min3(s[0], s[1], s[2]); if (v) m = v / 2; mat4_iscale(mat, m / s[0], m / s[1], m / s[2]); } static int apply_transf(gox_proc_t *proc, node_t *node, ctx_t *ctx) { node_t *c; float v[3] = {0}; int i, n, op; assert(node->type == NODE_TRANSF || node->type == NODE_OP); if (node->type == NODE_TRANSF) { DL_FOREACH(node->children, c) { TRY(apply_transf(proc, c, ctx)); } return 0; } for (op = 0; op < OP_COUNT; op++) { if (strcmp(OP_INFOS[op].id, node->id) == 0) break; } if (op == OP_COUNT) return error(proc, node, "No op '%s'", node->id); DL_COUNT(node->children, c, n); if (!( (!n && n == OP_INFOS[op].nb[0]) || ( n && n == OP_INFOS[op].nb[0]) || ( n && n == OP_INFOS[op].nb[1]) || ( n && n == OP_INFOS[op].nb[2]))) return error(proc, node, "Op '%s' does not accept %d arguments", node->id, n); for (i = 0, c = node->children; i < n; i++, c = c->next) v[i] = evaluate(c, ctx); switch (op) { case OP_sx: mat4_iscale(ctx->box, v[0], 1, 1); break; case OP_sy: mat4_iscale(ctx->box, 1, v[0], 1); break; case OP_sz: mat4_iscale(ctx->box, 1, 1, v[0]); break; case OP_s: if (n == 1) v[1] = v[2] = v[0]; mat4_iscale(ctx->box, v[0], v[1], v[2]); break; case OP_sn: scale_normalize(ctx->box, v[0]); break; case OP_x: mat4_itranslate(ctx->box, 2 * v[0], 2 * v[1], 2 * v[2]); break; case OP_y: mat4_itranslate(ctx->box, 0, 2 * v[0], 2 * v[1]); break; case OP_z: mat4_itranslate(ctx->box, 0, 0, 2 * v[0]); break; case OP_rx: mat4_irotate(ctx->box, v[0] / 180 * M_PI, 1, 0, 0); break; case OP_ry: mat4_irotate(ctx->box, v[0] / 180 * M_PI, 0, 1, 0); break; case OP_rz: mat4_irotate(ctx->box, v[0] / 180 * M_PI, 0, 0, 1); break; case OP_hue: if (n == 1) ctx->color[0] = mod(ctx->color[0] + v[0], 360); else move_value(&ctx->color[0], v[0], v[1]); break; case OP_sat: if (n == 1) v[1] = 1; move_value(&ctx->color[1], v[0], v[1]); break; case OP_light: if (n == 1) v[1] = 1; move_value(&ctx->color[2], v[0], v[1]); break; case OP_sub: ctx->mode = MODE_SUB; break; case OP_paint: ctx->mode = MODE_PAINT; break; case OP_seed: set_seed(v[0], &ctx->seed); break; case OP_wait: ctx->wait += v[0]; break; case OP_life: ctx->life += v[0]; break; case OP_antialiased: ctx->antialiased = (bool)v[0]; break; } return 0; } static int set_args(gox_proc_t *proc, node_t *node, ctx_t *ctx) { assert(node->type == NODE_ARGS); node_t *c; int i = 0; DL_FOREACH(node->children, c) { ctx->vars[i] = evaluate(c, ctx); i++; } return 0; } static void call_shape(const ctx_t *ctx, const shape_t *shape, mesh_t *mesh, painter_t *painter) { uint8_t hsl[3] = {ctx->color[0] / 360 * 255, ctx->color[1] * 255, ctx->color[2] * 255}; hsl_to_rgb(hsl, painter->color); painter->shape = shape; painter->mode = ctx->mode; painter->smoothness = ctx->antialiased ? 1 : 0; mesh_op(mesh, painter, ctx->box); } // Iter the program once. static int iter(gox_proc_t *proc, ctx_t *ctx, mesh_t *mesh, painter_t *painter) { const float max_op_volume = 512 * 512 * 512; float v; int n, i; float volume, volume_tot = 0; ctx_t ctx2, *new_ctx; node_t *expr, *rule; if (ctx->life > 0) { ctx->life--; if (ctx->life <= 0) return 0; } if (ctx->wait > 0) { new_ctx = calloc(1, sizeof(*new_ctx)); *new_ctx = *ctx; new_ctx->wait--; DL_APPEND(proc->ctxs, new_ctx); return 0; } // XXX: find a better stopping condition. if (vec3_norm2(ctx->box[0]) < 0.2 || vec3_norm2(ctx->box[1]) < 0.2 || vec3_norm2(ctx->box[2]) < 0.2) goto end; DL_FOREACH(ctx->prog->children, expr) { if (expr->type == NODE_LOOP) { // loop n tranf block n = evaluate(expr->children, ctx); ctx2 = *ctx; ctx2.prog = expr->children->next->next; for (i = 0; i < n; i++) { simple_rand(&ctx2.seed); new_ctx = calloc(1, sizeof(*new_ctx)); *new_ctx = ctx2; if (expr->v) { new_ctx->vars[(int)expr->v - 1] = i; } DL_APPEND(proc->ctxs, new_ctx); TRY(apply_transf(proc, expr->children->next, &ctx2)); } } if (expr->type == NODE_TRANSFB) { new_ctx = calloc(1, sizeof(*new_ctx)); *new_ctx = *ctx; new_ctx->prog = expr->children->next; TRY(apply_transf(proc, expr->children, new_ctx)); DL_APPEND(proc->ctxs, new_ctx); } if (expr->type == NODE_IF) { v = evaluate(expr->children, ctx); if (v) { ctx2 = *ctx; ctx2.prog = expr->children->next; iter(proc, &ctx2, mesh, painter); } } if (expr->type == NODE_SET) { ctx->vars[(int)expr->v - 1] = evaluate(expr->children, ctx); } if (expr->type == NODE_RETURN) { break; } if (expr->type == NODE_TRANSF) { TRY(apply_transf(proc, expr, ctx)); } if (expr->type == NODE_CALL) { simple_rand(&ctx->seed); ctx2 = *ctx; TRY(apply_transf(proc, expr->children, &ctx2)); // Is it a basic shape? for (i = 0; i < ARRAY_SIZE(SHAPES); i++) { if (str_equ(expr->id, SHAPES[i]->id)) { volume = box_get_volume(ctx2.box); if (volume > max_op_volume) return error(proc, expr, "abort: volume too big!"); volume_tot += volume; call_shape(&ctx2, SHAPES[i], mesh, painter); break; } } if (i < ARRAY_SIZE(SHAPES)) continue; TRY(set_args(proc, expr->children->next, &ctx2)); rule = get_rule(proc->prog, expr->id, &ctx2); if (!rule) return error(proc, NULL, "Cannot find rule %s", expr->id); ctx2.prog = rule; new_ctx = calloc(1, sizeof(*new_ctx)); *new_ctx = ctx2; DL_APPEND(proc->ctxs, new_ctx); } } end: return 0; } // Defined in procedural.leg static node_t *parse(const char *txt, int *err_line); int proc_parse(const char *txt, gox_proc_t *proc) { proc_release(proc); proc->prog = parse(txt, &proc->error.line); if (!proc->prog) { proc->state = PROC_PARSE_ERROR; free(proc->error.str); asprintf(&proc->error.str, "Parse error"); return -1; } proc->state = PROC_READY; if ((0)) visit(proc->prog, 0); return 0; } void proc_release(gox_proc_t *proc) { node_free(proc->prog); proc->prog = NULL; ctxs_free(proc->ctxs); proc->ctxs = NULL; free(proc->error.str); proc->error.str = NULL; proc->error.line = 0; } int proc_start(gox_proc_t *proc, const float box[4][4]) { // Reinit the context to a single ctx_t pointing at the main shape. ctx_t *ctx; assert(proc->state >= PROC_READY); ctxs_free(proc->ctxs); proc->ctxs = NULL; proc->frame = 0; ctx = calloc(1, sizeof(*ctx)); if (box) mat4_copy(box, ctx->box); else bbox_from_extents(ctx->box, vec3_zero, 0.5, 0.5, 0.5); vec4_set(ctx->color, 0, 0, 1, 1); ctx->mode = MODE_OVER; ctx->prog = get_rule(proc->prog, "main", ctx); set_seed(rand(), &ctx->seed); DL_APPEND(proc->ctxs, ctx); if (!ctx->prog) return error(proc, NULL, "No 'main' shape"); proc->state = PROC_RUNNING; return 0; } int proc_stop(gox_proc_t *proc) { proc->state = PROC_DONE; return 0; } int proc_iter(gox_proc_t *proc, mesh_t *mesh, const painter_t *painter) { int r; bool last; double start_time; ctx_t *ctx; painter_t painter2 = *painter; if (proc->state != PROC_RUNNING) return 0; if (!proc->ctxs) { proc->state = PROC_DONE; return 0; } // Mark the last context of this frame. // XXX: This is for animations, but I think I should change the way it // works anyway: we should only animate when 'wait' is used in the code, // even for recursive shapes. if (!proc->in_frame) proc->ctxs->prev->last = true; proc->in_frame = false; start_time = sys_get_time(); while (true) { ctx = proc->ctxs; if (!ctx) { proc->state = 2; break; } DL_DELETE(proc->ctxs, ctx); last = ctx->last; ctx->last = false; r = iter(proc, ctx, mesh, &painter2); free(ctx); if (r != 0) { proc->state = PROC_DONE; break; } if (last) break; if (sys_get_time() - start_time > MAX_ITER_TIME) { proc->in_frame = true; return 0; } } proc->frame++; return 0; } // The actual parser code come here, generated from procedural.leg #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" #endif #include "procedural.inl" goxel-0.8.1/src/procedural.inl000066400000000000000000001633551334742672700163250ustar00rootroot00000000000000/* A recursive-descent parser generated by peg 0.1.15 */ #include #include #include #define YYRULECOUNT 26 // Do not edit the .inl file directly, instead edit procedural.leg. #include #include #include #include #include "utlist.h" typedef struct { int nb; char *names[16]; } vars_t; #define YYSTYPE node_t* #define YY_CTX_LOCAL 1 #define YY_CTX_MEMBERS \ int line, read_line; \ node_t *prog; \ node_t *nodes; \ const char *cur; \ vars_t vars; // Redefine YY_INPUT to keep track of the last read line in the input. #define YY_INPUT(ctx, buf, result, max_size) \ { \ int yyc = *ctx->cur; \ if (yyc == '\n') ctx->read_line++; \ if (yyc) {ctx->cur++; *buf = yyc; result = 1;} \ else result = 0; \ } \ static node_t *node_create(int type, const char *id, int line, int nb, node_t **children, node_t **nodes) { int i; node_t *node = calloc(1, sizeof(*node)); node->type = type; node->id = id ? strdup(id) : NULL; node->line = line; node->size = nb; for (i = 0; i < nb; i++) { assert(children[i]); DL_DELETE(*nodes, children[i]); DL_APPEND(node->children, children[i]); } DL_APPEND(*nodes, node); return node; } // Convenience macro to create a node. #define N(type, id, ...) ({ \ node_t *nodes[] = {__VA_ARGS__}; \ node_create(NODE_##type, id, yy->line, ARRAY_SIZE(nodes), nodes, \ &yy->nodes); \ }) // Convenience function to append a node to an other one. static void node_append(node_t *node, node_t *c, node_t **nodes) { assert(node); assert(c); assert(node != c); node->size++; DL_DELETE(*nodes, c); DL_APPEND(node->children, c); } #define A(n, c) ({node_append(n, c, &yy->nodes);}) static void clear_vars(vars_t *vars) { int i; for (i = 0; i < ARRAY_SIZE(vars->names); i++) { free(vars->names[i]); vars->names[i] = NULL; } vars->nb = 0; } /* static int push_var(vars_t *vars, node_t *var) { int i; if (!var) { for (i = 0; i < ARRAY_SIZE(vars->names); i++) { free(vars->names[i]); vars->names[i] = NULL; } vars->nb = 0; return 0; } vars->names[vars->nb++] = strdup(var->id); return 0; } */ static int get_var(vars_t *vars, const char *id) { int i; for (i = 0; i < vars->nb; i++) { if (strcmp(vars->names[i], id) == 0) { return i + 1; } } vars->names[vars->nb++] = strdup(id); return vars->nb; } #ifndef YY_MALLOC #define YY_MALLOC(C, N) malloc(N) #endif #ifndef YY_REALLOC #define YY_REALLOC(C, P, N) realloc(P, N) #endif #ifndef YY_FREE #define YY_FREE(C, P) free(P) #endif #ifndef YY_LOCAL #define YY_LOCAL(T) static T #endif #ifndef YY_ACTION #define YY_ACTION(T) static T #endif #ifndef YY_RULE #define YY_RULE(T) static T #endif #ifndef YY_PARSE #define YY_PARSE(T) T #endif #ifndef YYPARSE #define YYPARSE yyparse #endif #ifndef YYPARSEFROM #define YYPARSEFROM yyparsefrom #endif #ifndef YYRELEASE #define YYRELEASE yyrelease #endif #ifndef YY_BEGIN #define YY_BEGIN ( yy->__begin= yy->__pos, 1) #endif #ifndef YY_END #define YY_END ( yy->__end= yy->__pos, 1) #endif #ifdef YY_DEBUG # define yyprintf(args) fprintf args #else # define yyprintf(args) #endif #ifndef YYSTYPE #define YYSTYPE int #endif #ifndef YY_STACK_SIZE #define YY_STACK_SIZE 128 #endif #ifndef YY_BUFFER_SIZE #define YY_BUFFER_SIZE 1024 #endif #ifndef YY_PART typedef struct _yycontext yycontext; typedef void (*yyaction)(yycontext *yy, char *yytext, int yyleng); typedef struct _yythunk { int begin, end; yyaction action; struct _yythunk *next; } yythunk; struct _yycontext { char *__buf; int __buflen; int __pos; int __limit; char *__text; int __textlen; int __begin; int __end; int __textmax; yythunk *__thunks; int __thunkslen; int __thunkpos; YYSTYPE __; YYSTYPE *__val; YYSTYPE *__vals; int __valslen; #ifdef YY_CTX_MEMBERS YY_CTX_MEMBERS #endif }; #ifdef YY_CTX_LOCAL #define YY_CTX_PARAM_ yycontext *yyctx, #define YY_CTX_PARAM yycontext *yyctx #define YY_CTX_ARG_ yyctx, #define YY_CTX_ARG yyctx #ifndef YY_INPUT #define YY_INPUT(yy, buf, result, max_size) \ { \ int yyc= getchar(); \ result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \ yyprintf((stderr, "<%c>", yyc)); \ } #endif #else #define YY_CTX_PARAM_ #define YY_CTX_PARAM #define YY_CTX_ARG_ #define YY_CTX_ARG yycontext _yyctx= { 0, 0 }; yycontext *yyctx= &_yyctx; #ifndef YY_INPUT #define YY_INPUT(buf, result, max_size) \ { \ int yyc= getchar(); \ result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \ yyprintf((stderr, "<%c>", yyc)); \ } #endif #endif YY_LOCAL(int) yyrefill(yycontext *yy) { int yyn; while (yy->__buflen - yy->__pos < 512) { yy->__buflen *= 2; yy->__buf= (char *)YY_REALLOC(yy, yy->__buf, yy->__buflen); } #ifdef YY_CTX_LOCAL YY_INPUT(yy, (yy->__buf + yy->__pos), yyn, (yy->__buflen - yy->__pos)); #else YY_INPUT((yy->__buf + yy->__pos), yyn, (yy->__buflen - yy->__pos)); #endif if (!yyn) return 0; yy->__limit += yyn; return 1; } YY_LOCAL(int) yymatchDot(yycontext *yy) { if (yy->__pos >= yy->__limit && !yyrefill(yy)) return 0; ++yy->__pos; return 1; } YY_LOCAL(int) yymatchChar(yycontext *yy, int c) { if (yy->__pos >= yy->__limit && !yyrefill(yy)) return 0; if ((unsigned char)yy->__buf[yy->__pos] == c) { ++yy->__pos; yyprintf((stderr, " ok yymatchChar(yy, %c) @ %s\n", c, yy->__buf+yy->__pos)); return 1; } yyprintf((stderr, " fail yymatchChar(yy, %c) @ %s\n", c, yy->__buf+yy->__pos)); return 0; } YY_LOCAL(int) yymatchString(yycontext *yy, const char *s) { int yysav= yy->__pos; while (*s) { if (yy->__pos >= yy->__limit && !yyrefill(yy)) return 0; if (yy->__buf[yy->__pos] != *s) { yy->__pos= yysav; return 0; } ++s; ++yy->__pos; } return 1; } YY_LOCAL(int) yymatchClass(yycontext *yy, unsigned char *bits) { int c; if (yy->__pos >= yy->__limit && !yyrefill(yy)) return 0; c= (unsigned char)yy->__buf[yy->__pos]; if (bits[c >> 3] & (1 << (c & 7))) { ++yy->__pos; yyprintf((stderr, " ok yymatchClass @ %s\n", yy->__buf+yy->__pos)); return 1; } yyprintf((stderr, " fail yymatchClass @ %s\n", yy->__buf+yy->__pos)); return 0; } YY_LOCAL(void) yyDo(yycontext *yy, yyaction action, int begin, int end) { while (yy->__thunkpos >= yy->__thunkslen) { yy->__thunkslen *= 2; yy->__thunks= (yythunk *)YY_REALLOC(yy, yy->__thunks, sizeof(yythunk) * yy->__thunkslen); } yy->__thunks[yy->__thunkpos].begin= begin; yy->__thunks[yy->__thunkpos].end= end; yy->__thunks[yy->__thunkpos].action= action; ++yy->__thunkpos; } YY_LOCAL(int) yyText(yycontext *yy, int begin, int end) { int yyleng= end - begin; if (yyleng <= 0) yyleng= 0; else { while (yy->__textlen < (yyleng + 1)) { yy->__textlen *= 2; yy->__text= (char *)YY_REALLOC(yy, yy->__text, yy->__textlen); } memcpy(yy->__text, yy->__buf + begin, yyleng); } yy->__text[yyleng]= '\0'; return yyleng; } YY_LOCAL(void) yyDone(yycontext *yy) { int pos; for (pos= 0; pos < yy->__thunkpos; ++pos) { yythunk *thunk= &yy->__thunks[pos]; int yyleng= thunk->end ? yyText(yy, thunk->begin, thunk->end) : thunk->begin; yyprintf((stderr, "DO [%d] %p %s\n", pos, thunk->action, yy->__text)); thunk->action(yy, yy->__text, yyleng); } yy->__thunkpos= 0; } YY_LOCAL(void) yyCommit(yycontext *yy) { if ((yy->__limit -= yy->__pos)) { memmove(yy->__buf, yy->__buf + yy->__pos, yy->__limit); } yy->__begin -= yy->__pos; yy->__end -= yy->__pos; yy->__pos= yy->__thunkpos= 0; } YY_LOCAL(int) yyAccept(yycontext *yy, int tp0) { if (tp0) { fprintf(stderr, "accept denied at %d\n", tp0); return 0; } else { yyDone(yy); yyCommit(yy); } return 1; } YY_LOCAL(void) yyPush(yycontext *yy, char *text, int count) { yy->__val += count; while (yy->__valslen <= yy->__val - yy->__vals) { long offset= yy->__val - yy->__vals; yy->__valslen *= 2; yy->__vals= (YYSTYPE *)YY_REALLOC(yy, yy->__vals, sizeof(YYSTYPE) * yy->__valslen); yy->__val= yy->__vals + offset; } } YY_LOCAL(void) yyPop(yycontext *yy, char *text, int count) { yy->__val -= count; } YY_LOCAL(void) yySet(yycontext *yy, char *text, int count) { yy->__val[count]= yy->__; } #endif /* YY_PART */ #define YYACCEPT yyAccept(yy, yythunkpos0) YY_RULE(int) yy_EOL(yycontext *yy); /* 26 */ YY_RULE(int) yy_Comment(yycontext *yy); /* 25 */ YY_RULE(int) yy_Num(yycontext *yy); /* 24 */ YY_RULE(int) yy_OpMul(yycontext *yy); /* 23 */ YY_RULE(int) yy_OpSum(yycontext *yy); /* 22 */ YY_RULE(int) yy_Expr4(yycontext *yy); /* 21 */ YY_RULE(int) yy_OpCmp(yycontext *yy); /* 20 */ YY_RULE(int) yy_Expr3(yycontext *yy); /* 19 */ YY_RULE(int) yy_OpLog(yycontext *yy); /* 18 */ YY_RULE(int) yy_Expr2(yycontext *yy); /* 17 */ YY_RULE(int) yy_Op(yycontext *yy); /* 16 */ YY_RULE(int) yy_ArgsV(yycontext *yy); /* 15 */ YY_RULE(int) yy_IfStmt(yycontext *yy); /* 14 */ YY_RULE(int) yy_Transf(yycontext *yy); /* 13 */ YY_RULE(int) yy_Expr(yycontext *yy); /* 12 */ YY_RULE(int) yy_Stmt(yycontext *yy); /* 11 */ YY_RULE(int) yy_Value(yycontext *yy); /* 10 */ YY_RULE(int) yy_Var(yycontext *yy); /* 9 */ YY_RULE(int) yy_Rule(yycontext *yy); /* 8 */ YY_RULE(int) yy_Block(yycontext *yy); /* 7 */ YY_RULE(int) yy_Args(yycontext *yy); /* 6 */ YY_RULE(int) yy_Id(yycontext *yy); /* 5 */ YY_RULE(int) yy_EOF(yycontext *yy); /* 4 */ YY_RULE(int) yy_Shape(yycontext *yy); /* 3 */ YY_RULE(int) yy__(yycontext *yy); /* 2 */ YY_RULE(int) yy_Prog(yycontext *yy); /* 1 */ YY_ACTION(void) yy_1_EOL(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_EOL\n")); { yy->line++; } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_1_Var(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Var\n")); { __ = N(ID, yytext); __->v = get_var(&yy->vars, yytext); } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_1_Id(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Id\n")); { __ = N(ID, yytext); } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_1_Num(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Num\n")); { __ = N(VALUE, NULL); __->v = atof(yytext); } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_4_Value(yycontext *yy, char *yytext, int yyleng) { #define i yy->__val[-1] #define e yy->__val[-2] #define x yy->__val[-3] #define n yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_4_Value\n")); { __ = N(EXPR, i->id, e); } #undef yythunkpos #undef yypos #undef yy #undef i #undef e #undef x #undef n } YY_ACTION(void) yy_3_Value(yycontext *yy, char *yytext, int yyleng) { #define i yy->__val[-1] #define e yy->__val[-2] #define x yy->__val[-3] #define n yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Value\n")); { __ = e; } #undef yythunkpos #undef yypos #undef yy #undef i #undef e #undef x #undef n } YY_ACTION(void) yy_2_Value(yycontext *yy, char *yytext, int yyleng) { #define i yy->__val[-1] #define e yy->__val[-2] #define x yy->__val[-3] #define n yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Value\n")); { __ = N(EXPR, "var"); __->v = x->v; } #undef yythunkpos #undef yypos #undef yy #undef i #undef e #undef x #undef n } YY_ACTION(void) yy_1_Value(yycontext *yy, char *yytext, int yyleng) { #define i yy->__val[-1] #define e yy->__val[-2] #define x yy->__val[-3] #define n yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Value\n")); { __ = n; } #undef yythunkpos #undef yypos #undef yy #undef i #undef e #undef x #undef n } YY_ACTION(void) yy_1_OpMul(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_OpMul\n")); { __ = N(ID, yytext); } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_1_OpSum(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_OpSum\n")); { __ = N(ID, yytext); } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_1_OpCmp(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_OpCmp\n")); { __ = N(ID, yytext); } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_1_OpLog(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_OpLog\n")); { __ = N(ID, yytext); } #undef yythunkpos #undef yypos #undef yy } YY_ACTION(void) yy_2_Expr4(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define o yy->__val[-2] #define a yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Expr4\n")); { __ = a; } #undef yythunkpos #undef yypos #undef yy #undef b #undef o #undef a } YY_ACTION(void) yy_1_Expr4(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define o yy->__val[-2] #define a yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Expr4\n")); { __ = N(EXPR, o->id, a, b); } #undef yythunkpos #undef yypos #undef yy #undef b #undef o #undef a } YY_ACTION(void) yy_2_Expr3(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define o yy->__val[-2] #define a yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Expr3\n")); { __ = a; } #undef yythunkpos #undef yypos #undef yy #undef b #undef o #undef a } YY_ACTION(void) yy_1_Expr3(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define o yy->__val[-2] #define a yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Expr3\n")); { __ = N(EXPR, o->id, a, b); } #undef yythunkpos #undef yypos #undef yy #undef b #undef o #undef a } YY_ACTION(void) yy_2_Expr2(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define o yy->__val[-2] #define a yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Expr2\n")); { __ = a; } #undef yythunkpos #undef yypos #undef yy #undef b #undef o #undef a } YY_ACTION(void) yy_1_Expr2(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define o yy->__val[-2] #define a yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Expr2\n")); { __ = N(EXPR, o->id, a, b); } #undef yythunkpos #undef yypos #undef yy #undef b #undef o #undef a } YY_ACTION(void) yy_3_Expr(yycontext *yy, char *yytext, int yyleng) { #define o yy->__val[-1] #define c yy->__val[-2] #define b yy->__val[-3] #define a yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Expr\n")); { __ = a; } #undef yythunkpos #undef yypos #undef yy #undef o #undef c #undef b #undef a } YY_ACTION(void) yy_2_Expr(yycontext *yy, char *yytext, int yyleng) { #define o yy->__val[-1] #define c yy->__val[-2] #define b yy->__val[-3] #define a yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Expr\n")); { __ = N(EXPR, o->id, a, b); } #undef yythunkpos #undef yypos #undef yy #undef o #undef c #undef b #undef a } YY_ACTION(void) yy_1_Expr(yycontext *yy, char *yytext, int yyleng) { #define o yy->__val[-1] #define c yy->__val[-2] #define b yy->__val[-3] #define a yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Expr\n")); { __ = N(EXPR, "?:", a, b, c); } #undef yythunkpos #undef yypos #undef yy #undef o #undef c #undef b #undef a } YY_ACTION(void) yy_3_Op(yycontext *yy, char *yytext, int yyleng) { #define e yy->__val[-1] #define o yy->__val[-2] #define i yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Op\n")); { __ = o; } #undef yythunkpos #undef yypos #undef yy #undef e #undef o #undef i } YY_ACTION(void) yy_2_Op(yycontext *yy, char *yytext, int yyleng) { #define e yy->__val[-1] #define o yy->__val[-2] #define i yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Op\n")); { A(o, e); } #undef yythunkpos #undef yypos #undef yy #undef e #undef o #undef i } YY_ACTION(void) yy_1_Op(yycontext *yy, char *yytext, int yyleng) { #define e yy->__val[-1] #define o yy->__val[-2] #define i yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Op\n")); { o = N(OP, i->id); } #undef yythunkpos #undef yypos #undef yy #undef e #undef o #undef i } YY_ACTION(void) yy_3_Transf(yycontext *yy, char *yytext, int yyleng) { #define o yy->__val[-1] #define t yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Transf\n")); { __ = t; } #undef yythunkpos #undef yypos #undef yy #undef o #undef t } YY_ACTION(void) yy_2_Transf(yycontext *yy, char *yytext, int yyleng) { #define o yy->__val[-1] #define t yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Transf\n")); { A(t, o); } #undef yythunkpos #undef yypos #undef yy #undef o #undef t } YY_ACTION(void) yy_1_Transf(yycontext *yy, char *yytext, int yyleng) { #define o yy->__val[-1] #define t yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Transf\n")); { t = N(TRANSF, NULL); } #undef yythunkpos #undef yypos #undef yy #undef o #undef t } YY_ACTION(void) yy_3_ArgsV(yycontext *yy, char *yytext, int yyleng) { #define e yy->__val[-1] #define a yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_ArgsV\n")); { __ = a; } #undef yythunkpos #undef yypos #undef yy #undef e #undef a } YY_ACTION(void) yy_2_ArgsV(yycontext *yy, char *yytext, int yyleng) { #define e yy->__val[-1] #define a yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_ArgsV\n")); { A(a, e); } #undef yythunkpos #undef yypos #undef yy #undef e #undef a } YY_ACTION(void) yy_1_ArgsV(yycontext *yy, char *yytext, int yyleng) { #define e yy->__val[-1] #define a yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_ArgsV\n")); { a = N(ARGS, NULL); } #undef yythunkpos #undef yypos #undef yy #undef e #undef a } YY_ACTION(void) yy_1_IfStmt(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define e yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_IfStmt\n")); { __ = N(IF, NULL, e, b); } #undef yythunkpos #undef yypos #undef yy #undef b #undef e } YY_ACTION(void) yy_8_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_8_Stmt\n")); { __ = N(SET, NULL, e); __->v = x->v; } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_7_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_7_Stmt\n")); { __ = t; } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_6_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_6_Stmt\n")); { __ = N(CALL, i->id, t, a); } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_5_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_5_Stmt\n")); { __ = i; } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_4_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_4_Stmt\n")); { __ = N(RETURN, NULL); } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_3_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Stmt\n")); { __ = N(TRANSFB, NULL, t, b); } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_2_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Stmt\n")); { __ = N(LOOP, NULL, e, t, b); __->v = x ? x->v : 0; } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_1_Stmt(yycontext *yy, char *yytext, int yyleng) { #define a yy->__val[-1] #define i yy->__val[-2] #define b yy->__val[-3] #define t yy->__val[-4] #define e yy->__val[-5] #define x yy->__val[-6] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Stmt\n")); { x = NULL; } #undef yythunkpos #undef yypos #undef yy #undef a #undef i #undef b #undef t #undef e #undef x } YY_ACTION(void) yy_3_Block(yycontext *yy, char *yytext, int yyleng) { #define s yy->__val[-1] #define b yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Block\n")); { __ = b; } #undef yythunkpos #undef yypos #undef yy #undef s #undef b } YY_ACTION(void) yy_2_Block(yycontext *yy, char *yytext, int yyleng) { #define s yy->__val[-1] #define b yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Block\n")); { A(b, s); } #undef yythunkpos #undef yypos #undef yy #undef s #undef b } YY_ACTION(void) yy_1_Block(yycontext *yy, char *yytext, int yyleng) { #define s yy->__val[-1] #define b yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Block\n")); { b = N(BLOCK, NULL); } #undef yythunkpos #undef yypos #undef yy #undef s #undef b } YY_ACTION(void) yy_3_Rule(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define w yy->__val[-2] #define r yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Rule\n")); { A(r, b); __ = r; } #undef yythunkpos #undef yypos #undef yy #undef b #undef w #undef r } YY_ACTION(void) yy_2_Rule(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define w yy->__val[-2] #define r yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Rule\n")); { r->v = w->v; } #undef yythunkpos #undef yypos #undef yy #undef b #undef w #undef r } YY_ACTION(void) yy_1_Rule(yycontext *yy, char *yytext, int yyleng) { #define b yy->__val[-1] #define w yy->__val[-2] #define r yy->__val[-3] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Rule\n")); { r = N(RULE, NULL); r->v = 1.0; } #undef yythunkpos #undef yypos #undef yy #undef b #undef w #undef r } YY_ACTION(void) yy_1_Args(yycontext *yy, char *yytext, int yyleng) { #define v yy->__val[-1] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Args\n")); { clear_vars(&yy->vars); } #undef yythunkpos #undef yypos #undef yy #undef v } YY_ACTION(void) yy_4_Shape(yycontext *yy, char *yytext, int yyleng) { #define r yy->__val[-1] #define b yy->__val[-2] #define i yy->__val[-3] #define s yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_4_Shape\n")); { __ = s; } #undef yythunkpos #undef yypos #undef yy #undef r #undef b #undef i #undef s } YY_ACTION(void) yy_3_Shape(yycontext *yy, char *yytext, int yyleng) { #define r yy->__val[-1] #define b yy->__val[-2] #define i yy->__val[-3] #define s yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Shape\n")); { A(s, r); } #undef yythunkpos #undef yypos #undef yy #undef r #undef b #undef i #undef s } YY_ACTION(void) yy_2_Shape(yycontext *yy, char *yytext, int yyleng) { #define r yy->__val[-1] #define b yy->__val[-2] #define i yy->__val[-3] #define s yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Shape\n")); { A(s, b); } #undef yythunkpos #undef yypos #undef yy #undef r #undef b #undef i #undef s } YY_ACTION(void) yy_1_Shape(yycontext *yy, char *yytext, int yyleng) { #define r yy->__val[-1] #define b yy->__val[-2] #define i yy->__val[-3] #define s yy->__val[-4] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Shape\n")); { s = N(SHAPE, i->id); clear_vars(&yy->vars); } #undef yythunkpos #undef yypos #undef yy #undef r #undef b #undef i #undef s } YY_ACTION(void) yy_3_Prog(yycontext *yy, char *yytext, int yyleng) { #define s yy->__val[-1] #define p yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_3_Prog\n")); { yy->prog = __ = p; } #undef yythunkpos #undef yypos #undef yy #undef s #undef p } YY_ACTION(void) yy_2_Prog(yycontext *yy, char *yytext, int yyleng) { #define s yy->__val[-1] #define p yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_2_Prog\n")); { A(p, s); } #undef yythunkpos #undef yypos #undef yy #undef s #undef p } YY_ACTION(void) yy_1_Prog(yycontext *yy, char *yytext, int yyleng) { #define s yy->__val[-1] #define p yy->__val[-2] #define __ yy->__ #define yypos yy->__pos #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_Prog\n")); { p = N(PROG, NULL); } #undef yythunkpos #undef yypos #undef yy #undef s #undef p } YY_RULE(int) yy_EOL(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "EOL")); if (!yymatchChar(yy, '\n')) goto l1; yyDo(yy, yy_1_EOL, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "EOL", yy->__buf+yy->__pos)); return 1; l1:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "EOL", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Comment(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "Comment")); { int yypos3= yy->__pos, yythunkpos3= yy->__thunkpos; if (!yymatchString(yy, "//")) goto l4; l5:; { int yypos6= yy->__pos, yythunkpos6= yy->__thunkpos; { int yypos7= yy->__pos, yythunkpos7= yy->__thunkpos; if (!yy_EOL(yy)) goto l7; goto l6; l7:; yy->__pos= yypos7; yy->__thunkpos= yythunkpos7; } if (!yymatchDot(yy)) goto l6; goto l5; l6:; yy->__pos= yypos6; yy->__thunkpos= yythunkpos6; } goto l3; l4:; yy->__pos= yypos3; yy->__thunkpos= yythunkpos3; if (!yymatchString(yy, "/*")) goto l2; l8:; { int yypos9= yy->__pos, yythunkpos9= yy->__thunkpos; { int yypos10= yy->__pos, yythunkpos10= yy->__thunkpos; { int yypos12= yy->__pos, yythunkpos12= yy->__thunkpos; if (!yy_EOL(yy)) goto l12; goto l11; l12:; yy->__pos= yypos12; yy->__thunkpos= yythunkpos12; } { int yypos13= yy->__pos, yythunkpos13= yy->__thunkpos; if (!yymatchString(yy, "*/")) goto l13; goto l11; l13:; yy->__pos= yypos13; yy->__thunkpos= yythunkpos13; } if (!yymatchDot(yy)) goto l11; goto l10; l11:; yy->__pos= yypos10; yy->__thunkpos= yythunkpos10; if (!yy_EOL(yy)) goto l9; } l10:; goto l8; l9:; yy->__pos= yypos9; yy->__thunkpos= yythunkpos9; } if (!yymatchString(yy, "*/")) goto l2; } l3:; yyprintf((stderr, " ok %s @ %s\n", "Comment", yy->__buf+yy->__pos)); return 1; l2:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Comment", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Num(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "Num")); if (!yy__(yy)) goto l14; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_BEGIN)) goto l14; #undef yytext #undef yyleng } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\140\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l14; l15:; { int yypos16= yy->__pos, yythunkpos16= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\140\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l16; goto l15; l16:; yy->__pos= yypos16; yy->__thunkpos= yythunkpos16; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_END)) goto l14; #undef yytext #undef yyleng } if (!yy__(yy)) goto l14; yyDo(yy, yy_1_Num, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Num", yy->__buf+yy->__pos)); return 1; l14:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Num", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_OpMul(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "OpMul")); yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_BEGIN)) goto l17; #undef yytext #undef yyleng } { int yypos18= yy->__pos, yythunkpos18= yy->__thunkpos; if (!yymatchChar(yy, '*')) goto l19; goto l18; l19:; yy->__pos= yypos18; yy->__thunkpos= yythunkpos18; if (!yymatchChar(yy, '/')) goto l20; goto l18; l20:; yy->__pos= yypos18; yy->__thunkpos= yythunkpos18; if (!yymatchString(yy, "+-")) goto l17; } l18:; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_END)) goto l17; #undef yytext #undef yyleng } yyDo(yy, yy_1_OpMul, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "OpMul", yy->__buf+yy->__pos)); return 1; l17:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "OpMul", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_OpSum(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "OpSum")); yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_BEGIN)) goto l21; #undef yytext #undef yyleng } { int yypos22= yy->__pos, yythunkpos22= yy->__thunkpos; if (!yymatchChar(yy, '+')) goto l23; goto l22; l23:; yy->__pos= yypos22; yy->__thunkpos= yythunkpos22; if (!yymatchChar(yy, '-')) goto l21; } l22:; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_END)) goto l21; #undef yytext #undef yyleng } yyDo(yy, yy_1_OpSum, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "OpSum", yy->__buf+yy->__pos)); return 1; l21:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "OpSum", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Expr4(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 3, 0); yyprintf((stderr, "%s\n", "Expr4")); if (!yy_Value(yy)) goto l24; yyDo(yy, yySet, -3, 0); { int yypos25= yy->__pos, yythunkpos25= yy->__thunkpos; if (!yy_OpMul(yy)) goto l26; yyDo(yy, yySet, -2, 0); if (!yy_Expr4(yy)) goto l26; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_1_Expr4, yy->__begin, yy->__end); goto l25; l26:; yy->__pos= yypos25; yy->__thunkpos= yythunkpos25; if (!yy__(yy)) goto l24; yyDo(yy, yy_2_Expr4, yy->__begin, yy->__end); } l25:; yyprintf((stderr, " ok %s @ %s\n", "Expr4", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 3, 0); return 1; l24:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Expr4", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_OpCmp(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "OpCmp")); yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_BEGIN)) goto l27; #undef yytext #undef yyleng } { int yypos28= yy->__pos, yythunkpos28= yy->__thunkpos; if (!yymatchString(yy, "==")) goto l29; goto l28; l29:; yy->__pos= yypos28; yy->__thunkpos= yythunkpos28; if (!yymatchString(yy, "!=")) goto l30; goto l28; l30:; yy->__pos= yypos28; yy->__thunkpos= yythunkpos28; if (!yymatchString(yy, "<=")) goto l31; goto l28; l31:; yy->__pos= yypos28; yy->__thunkpos= yythunkpos28; if (!yymatchString(yy, ">=")) goto l32; goto l28; l32:; yy->__pos= yypos28; yy->__thunkpos= yythunkpos28; if (!yymatchChar(yy, '<')) goto l33; goto l28; l33:; yy->__pos= yypos28; yy->__thunkpos= yythunkpos28; if (!yymatchChar(yy, '>')) goto l27; } l28:; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_END)) goto l27; #undef yytext #undef yyleng } yyDo(yy, yy_1_OpCmp, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "OpCmp", yy->__buf+yy->__pos)); return 1; l27:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "OpCmp", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Expr3(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 3, 0); yyprintf((stderr, "%s\n", "Expr3")); if (!yy_Expr4(yy)) goto l34; yyDo(yy, yySet, -3, 0); { int yypos35= yy->__pos, yythunkpos35= yy->__thunkpos; if (!yy_OpSum(yy)) goto l36; yyDo(yy, yySet, -2, 0); if (!yy_Expr3(yy)) goto l36; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_1_Expr3, yy->__begin, yy->__end); goto l35; l36:; yy->__pos= yypos35; yy->__thunkpos= yythunkpos35; if (!yy__(yy)) goto l34; yyDo(yy, yy_2_Expr3, yy->__begin, yy->__end); } l35:; yyprintf((stderr, " ok %s @ %s\n", "Expr3", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 3, 0); return 1; l34:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Expr3", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_OpLog(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "OpLog")); yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_BEGIN)) goto l37; #undef yytext #undef yyleng } { int yypos38= yy->__pos, yythunkpos38= yy->__thunkpos; if (!yymatchString(yy, "||")) goto l39; goto l38; l39:; yy->__pos= yypos38; yy->__thunkpos= yythunkpos38; if (!yymatchString(yy, "&&")) goto l37; } l38:; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_END)) goto l37; #undef yytext #undef yyleng } yyDo(yy, yy_1_OpLog, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "OpLog", yy->__buf+yy->__pos)); return 1; l37:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "OpLog", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Expr2(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 3, 0); yyprintf((stderr, "%s\n", "Expr2")); if (!yy_Expr3(yy)) goto l40; yyDo(yy, yySet, -3, 0); { int yypos41= yy->__pos, yythunkpos41= yy->__thunkpos; if (!yy_OpCmp(yy)) goto l42; yyDo(yy, yySet, -2, 0); if (!yy_Expr2(yy)) goto l42; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_1_Expr2, yy->__begin, yy->__end); goto l41; l42:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41; if (!yy__(yy)) goto l40; yyDo(yy, yy_2_Expr2, yy->__begin, yy->__end); } l41:; yyprintf((stderr, " ok %s @ %s\n", "Expr2", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 3, 0); return 1; l40:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Expr2", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Op(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 3, 0); yyprintf((stderr, "%s\n", "Op")); if (!yy__(yy)) goto l43; if (!yy_Id(yy)) goto l43; yyDo(yy, yySet, -3, 0); if (!yy__(yy)) goto l43; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_1_Op, yy->__begin, yy->__end); l44:; { int yypos45= yy->__pos, yythunkpos45= yy->__thunkpos; if (!yy_Expr(yy)) goto l45; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_2_Op, yy->__begin, yy->__end); goto l44; l45:; yy->__pos= yypos45; yy->__thunkpos= yythunkpos45; } if (!yy__(yy)) goto l43; yyDo(yy, yy_3_Op, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Op", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 3, 0); return 1; l43:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Op", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_ArgsV(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 2, 0); yyprintf((stderr, "%s\n", "ArgsV")); if (!yy__(yy)) goto l46; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_1_ArgsV, yy->__begin, yy->__end); { int yypos47= yy->__pos, yythunkpos47= yy->__thunkpos; if (!yymatchChar(yy, '(')) goto l47; l49:; { int yypos50= yy->__pos, yythunkpos50= yy->__thunkpos; if (!yy_Expr(yy)) goto l50; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_2_ArgsV, yy->__begin, yy->__end); { int yypos51= yy->__pos, yythunkpos51= yy->__thunkpos; if (!yymatchChar(yy, ',')) goto l52; goto l51; l52:; yy->__pos= yypos51; yy->__thunkpos= yythunkpos51; { int yypos53= yy->__pos, yythunkpos53= yy->__thunkpos; if (!yymatchChar(yy, ')')) goto l50; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; } } l51:; goto l49; l50:; yy->__pos= yypos50; yy->__thunkpos= yythunkpos50; } if (!yymatchChar(yy, ')')) goto l47; goto l48; l47:; yy->__pos= yypos47; yy->__thunkpos= yythunkpos47; } l48:; yyDo(yy, yy_3_ArgsV, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "ArgsV", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 2, 0); return 1; l46:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "ArgsV", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_IfStmt(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 2, 0); yyprintf((stderr, "%s\n", "IfStmt")); if (!yy__(yy)) goto l54; if (!yymatchString(yy, "if")) goto l54; if (!yy_Expr(yy)) goto l54; yyDo(yy, yySet, -2, 0); if (!yy_Block(yy)) goto l54; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_1_IfStmt, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "IfStmt", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 2, 0); return 1; l54:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "IfStmt", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Transf(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 2, 0); yyprintf((stderr, "%s\n", "Transf")); if (!yy__(yy)) goto l55; if (!yymatchChar(yy, '[')) goto l55; if (!yy__(yy)) goto l55; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_1_Transf, yy->__begin, yy->__end); l56:; { int yypos57= yy->__pos, yythunkpos57= yy->__thunkpos; if (!yy_Op(yy)) goto l57; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_2_Transf, yy->__begin, yy->__end); goto l56; l57:; yy->__pos= yypos57; yy->__thunkpos= yythunkpos57; } if (!yymatchChar(yy, ']')) goto l55; yyDo(yy, yy_3_Transf, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Transf", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 2, 0); return 1; l55:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Transf", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Expr(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 4, 0); yyprintf((stderr, "%s\n", "Expr")); if (!yy_Expr2(yy)) goto l58; yyDo(yy, yySet, -4, 0); { int yypos59= yy->__pos, yythunkpos59= yy->__thunkpos; if (!yymatchChar(yy, '?')) goto l60; if (!yy_Expr2(yy)) goto l60; yyDo(yy, yySet, -3, 0); if (!yymatchChar(yy, ':')) goto l60; if (!yy_Expr2(yy)) goto l60; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_1_Expr, yy->__begin, yy->__end); goto l59; l60:; yy->__pos= yypos59; yy->__thunkpos= yythunkpos59; if (!yy_OpLog(yy)) goto l61; yyDo(yy, yySet, -1, 0); if (!yy_Expr(yy)) goto l61; yyDo(yy, yySet, -3, 0); yyDo(yy, yy_2_Expr, yy->__begin, yy->__end); goto l59; l61:; yy->__pos= yypos59; yy->__thunkpos= yythunkpos59; if (!yy__(yy)) goto l58; yyDo(yy, yy_3_Expr, yy->__begin, yy->__end); } l59:; yyprintf((stderr, " ok %s @ %s\n", "Expr", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 4, 0); return 1; l58:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Expr", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Stmt(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 6, 0); yyprintf((stderr, "%s\n", "Stmt")); { int yypos63= yy->__pos, yythunkpos63= yy->__thunkpos; if (!yy__(yy)) goto l64; if (!yymatchString(yy, "loop")) goto l64; yyDo(yy, yy_1_Stmt, yy->__begin, yy->__end); { int yypos65= yy->__pos, yythunkpos65= yy->__thunkpos; if (!yy_Var(yy)) goto l65; yyDo(yy, yySet, -6, 0); if (!yy__(yy)) goto l65; if (!yymatchChar(yy, '=')) goto l65; goto l66; l65:; yy->__pos= yypos65; yy->__thunkpos= yythunkpos65; } l66:; if (!yy_Expr(yy)) goto l64; yyDo(yy, yySet, -5, 0); if (!yy_Transf(yy)) goto l64; yyDo(yy, yySet, -4, 0); if (!yy_Block(yy)) goto l64; yyDo(yy, yySet, -3, 0); yyDo(yy, yy_2_Stmt, yy->__begin, yy->__end); goto l63; l64:; yy->__pos= yypos63; yy->__thunkpos= yythunkpos63; if (!yy__(yy)) goto l67; if (!yymatchString(yy, "transform")) goto l67; if (!yy_Transf(yy)) goto l67; yyDo(yy, yySet, -4, 0); if (!yy_Block(yy)) goto l67; yyDo(yy, yySet, -3, 0); yyDo(yy, yy_3_Stmt, yy->__begin, yy->__end); goto l63; l67:; yy->__pos= yypos63; yy->__thunkpos= yythunkpos63; if (!yy__(yy)) goto l68; if (!yymatchString(yy, "return")) goto l68; yyDo(yy, yy_4_Stmt, yy->__begin, yy->__end); goto l63; l68:; yy->__pos= yypos63; yy->__thunkpos= yythunkpos63; if (!yy_IfStmt(yy)) goto l69; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_5_Stmt, yy->__begin, yy->__end); goto l63; l69:; yy->__pos= yypos63; yy->__thunkpos= yythunkpos63; if (!yy_Id(yy)) goto l70; yyDo(yy, yySet, -2, 0); if (!yy_ArgsV(yy)) goto l70; yyDo(yy, yySet, -1, 0); if (!yy_Transf(yy)) goto l70; yyDo(yy, yySet, -4, 0); yyDo(yy, yy_6_Stmt, yy->__begin, yy->__end); goto l63; l70:; yy->__pos= yypos63; yy->__thunkpos= yythunkpos63; if (!yy_Transf(yy)) goto l71; yyDo(yy, yySet, -4, 0); yyDo(yy, yy_7_Stmt, yy->__begin, yy->__end); goto l63; l71:; yy->__pos= yypos63; yy->__thunkpos= yythunkpos63; if (!yy_Var(yy)) goto l62; yyDo(yy, yySet, -6, 0); if (!yy__(yy)) goto l62; if (!yymatchChar(yy, '=')) goto l62; if (!yy_Expr(yy)) goto l62; yyDo(yy, yySet, -5, 0); yyDo(yy, yy_8_Stmt, yy->__begin, yy->__end); } l63:; yyprintf((stderr, " ok %s @ %s\n", "Stmt", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 6, 0); return 1; l62:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Stmt", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Value(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 4, 0); yyprintf((stderr, "%s\n", "Value")); { int yypos73= yy->__pos, yythunkpos73= yy->__thunkpos; if (!yy_Num(yy)) goto l74; yyDo(yy, yySet, -4, 0); yyDo(yy, yy_1_Value, yy->__begin, yy->__end); goto l73; l74:; yy->__pos= yypos73; yy->__thunkpos= yythunkpos73; if (!yy_Var(yy)) goto l75; yyDo(yy, yySet, -3, 0); yyDo(yy, yy_2_Value, yy->__begin, yy->__end); goto l73; l75:; yy->__pos= yypos73; yy->__thunkpos= yythunkpos73; if (!yy__(yy)) goto l76; if (!yymatchChar(yy, '(')) goto l76; if (!yy_Expr(yy)) goto l76; yyDo(yy, yySet, -2, 0); if (!yymatchChar(yy, ')')) goto l76; if (!yy__(yy)) goto l76; yyDo(yy, yy_3_Value, yy->__begin, yy->__end); goto l73; l76:; yy->__pos= yypos73; yy->__thunkpos= yythunkpos73; if (!yy__(yy)) goto l72; if (!yy_Id(yy)) goto l72; yyDo(yy, yySet, -1, 0); if (!yymatchChar(yy, '(')) goto l72; if (!yy_Expr(yy)) goto l72; yyDo(yy, yySet, -2, 0); if (!yymatchChar(yy, ')')) goto l72; yyDo(yy, yy_4_Value, yy->__begin, yy->__end); } l73:; yyprintf((stderr, " ok %s @ %s\n", "Value", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 4, 0); return 1; l72:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Value", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Var(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "Var")); if (!yy__(yy)) goto l77; if (!yymatchChar(yy, '$')) goto l77; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_BEGIN)) goto l77; #undef yytext #undef yyleng } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\000\000\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l77; l78:; { int yypos79= yy->__pos, yythunkpos79= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l79; goto l78; l79:; yy->__pos= yypos79; yy->__thunkpos= yythunkpos79; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_END)) goto l77; #undef yytext #undef yyleng } if (!yy__(yy)) goto l77; yyDo(yy, yy_1_Var, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Var", yy->__buf+yy->__pos)); return 1; l77:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Var", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Rule(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 3, 0); yyprintf((stderr, "%s\n", "Rule")); if (!yy__(yy)) goto l80; yyDo(yy, yySet, -3, 0); if (!yymatchString(yy, "rule")) goto l80; yyDo(yy, yy_1_Rule, yy->__begin, yy->__end); { int yypos81= yy->__pos, yythunkpos81= yy->__thunkpos; if (!yy_Value(yy)) goto l81; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_2_Rule, yy->__begin, yy->__end); goto l82; l81:; yy->__pos= yypos81; yy->__thunkpos= yythunkpos81; } l82:; if (!yy_Block(yy)) goto l80; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_3_Rule, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Rule", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 3, 0); return 1; l80:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Rule", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Block(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 2, 0); yyprintf((stderr, "%s\n", "Block")); if (!yy__(yy)) goto l83; if (!yymatchChar(yy, '{')) goto l83; if (!yy__(yy)) goto l83; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_1_Block, yy->__begin, yy->__end); l84:; { int yypos85= yy->__pos, yythunkpos85= yy->__thunkpos; if (!yy_Stmt(yy)) goto l85; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_2_Block, yy->__begin, yy->__end); goto l84; l85:; yy->__pos= yypos85; yy->__thunkpos= yythunkpos85; } if (!yy__(yy)) goto l83; if (!yymatchChar(yy, '}')) goto l83; yyDo(yy, yy_3_Block, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Block", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 2, 0); return 1; l83:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Block", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Args(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 1, 0); yyprintf((stderr, "%s\n", "Args")); { int yypos87= yy->__pos, yythunkpos87= yy->__thunkpos; if (!yy__(yy)) goto l88; yyDo(yy, yy_1_Args, yy->__begin, yy->__end); if (!yymatchChar(yy, '(')) goto l88; l89:; { int yypos90= yy->__pos, yythunkpos90= yy->__thunkpos; if (!yy_Var(yy)) goto l90; yyDo(yy, yySet, -1, 0); { int yypos91= yy->__pos, yythunkpos91= yy->__thunkpos; if (!yymatchChar(yy, ',')) goto l92; goto l91; l92:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; { int yypos93= yy->__pos, yythunkpos93= yy->__thunkpos; if (!yymatchChar(yy, ')')) goto l90; yy->__pos= yypos93; yy->__thunkpos= yythunkpos93; } } l91:; goto l89; l90:; yy->__pos= yypos90; yy->__thunkpos= yythunkpos90; } if (!yymatchChar(yy, ')')) goto l88; goto l87; l88:; yy->__pos= yypos87; yy->__thunkpos= yythunkpos87; if (!yy__(yy)) goto l86; } l87:; yyprintf((stderr, " ok %s @ %s\n", "Args", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 1, 0); return 1; l86:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Args", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Id(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "Id")); if (!yy__(yy)) goto l94; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_BEGIN)) goto l94; #undef yytext #undef yyleng } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\000\000\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l94; l95:; { int yypos96= yy->__pos, yythunkpos96= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l96; goto l95; l96:; yy->__pos= yypos96; yy->__thunkpos= yythunkpos96; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen if (!(YY_END)) goto l94; #undef yytext #undef yyleng } if (!yy__(yy)) goto l94; yyDo(yy, yy_1_Id, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Id", yy->__buf+yy->__pos)); return 1; l94:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Id", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_EOF(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "EOF")); { int yypos98= yy->__pos, yythunkpos98= yy->__thunkpos; if (!yymatchDot(yy)) goto l98; goto l97; l98:; yy->__pos= yypos98; yy->__thunkpos= yythunkpos98; } yyprintf((stderr, " ok %s @ %s\n", "EOF", yy->__buf+yy->__pos)); return 1; l97:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "EOF", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_Shape(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 4, 0); yyprintf((stderr, "%s\n", "Shape")); if (!yy__(yy)) goto l99; yyDo(yy, yySet, -4, 0); if (!yymatchString(yy, "shape")) goto l99; if (!yy_Id(yy)) goto l99; yyDo(yy, yySet, -3, 0); yyDo(yy, yy_1_Shape, yy->__begin, yy->__end); if (!yy_Args(yy)) goto l99; { int yypos100= yy->__pos, yythunkpos100= yy->__thunkpos; if (!yy_Block(yy)) goto l101; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_2_Shape, yy->__begin, yy->__end); goto l100; l101:; yy->__pos= yypos100; yy->__thunkpos= yythunkpos100; if (!yy_Rule(yy)) goto l99; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_3_Shape, yy->__begin, yy->__end); l102:; { int yypos103= yy->__pos, yythunkpos103= yy->__thunkpos; if (!yy_Rule(yy)) goto l103; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_3_Shape, yy->__begin, yy->__end); goto l102; l103:; yy->__pos= yypos103; yy->__thunkpos= yythunkpos103; } } l100:; yyDo(yy, yy_4_Shape, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "Shape", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 4, 0); return 1; l99:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Shape", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy__(yycontext *yy) { yyprintf((stderr, "%s\n", "_")); l105:; { int yypos106= yy->__pos, yythunkpos106= yy->__thunkpos; { int yypos107= yy->__pos, yythunkpos107= yy->__thunkpos; if (!yy_Comment(yy)) goto l108; goto l107; l108:; yy->__pos= yypos107; yy->__thunkpos= yythunkpos107; if (!yymatchClass(yy, (unsigned char *)"\000\002\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l109; goto l107; l109:; yy->__pos= yypos107; yy->__thunkpos= yythunkpos107; if (!yy_EOL(yy)) goto l106; } l107:; goto l105; l106:; yy->__pos= yypos106; yy->__thunkpos= yythunkpos106; } yyprintf((stderr, " ok %s @ %s\n", "_", yy->__buf+yy->__pos)); return 1; } YY_RULE(int) yy_Prog(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyDo(yy, yyPush, 2, 0); yyprintf((stderr, "%s\n", "Prog")); if (!yy__(yy)) goto l110; yyDo(yy, yySet, -2, 0); yyDo(yy, yy_1_Prog, yy->__begin, yy->__end); if (!yy_Shape(yy)) goto l110; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_2_Prog, yy->__begin, yy->__end); l111:; { int yypos112= yy->__pos, yythunkpos112= yy->__thunkpos; if (!yy_Shape(yy)) goto l112; yyDo(yy, yySet, -1, 0); yyDo(yy, yy_2_Prog, yy->__begin, yy->__end); goto l111; l112:; yy->__pos= yypos112; yy->__thunkpos= yythunkpos112; } if (!yy__(yy)) goto l110; yyDo(yy, yy_3_Prog, yy->__begin, yy->__end); if (!yy_EOF(yy)) goto l110; yyprintf((stderr, " ok %s @ %s\n", "Prog", yy->__buf+yy->__pos)); yyDo(yy, yyPop, 2, 0); return 1; l110:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "Prog", yy->__buf+yy->__pos)); return 0; } #ifndef YY_PART typedef int (*yyrule)(yycontext *yy); YY_PARSE(int) YYPARSEFROM(YY_CTX_PARAM_ yyrule yystart) { int yyok; if (!yyctx->__buflen) { yyctx->__buflen= YY_BUFFER_SIZE; yyctx->__buf= (char *)YY_MALLOC(yyctx, yyctx->__buflen); yyctx->__textlen= YY_BUFFER_SIZE; yyctx->__text= (char *)YY_MALLOC(yyctx, yyctx->__textlen); yyctx->__thunkslen= YY_STACK_SIZE; yyctx->__thunks= (yythunk *)YY_MALLOC(yyctx, sizeof(yythunk) * yyctx->__thunkslen); yyctx->__valslen= YY_STACK_SIZE; yyctx->__vals= (YYSTYPE *)YY_MALLOC(yyctx, sizeof(YYSTYPE) * yyctx->__valslen); yyctx->__begin= yyctx->__end= yyctx->__pos= yyctx->__limit= yyctx->__thunkpos= 0; } yyctx->__begin= yyctx->__end= yyctx->__pos; yyctx->__thunkpos= 0; yyctx->__val= yyctx->__vals; yyok= yystart(yyctx); if (yyok) yyDone(yyctx); yyCommit(yyctx); return yyok; } YY_PARSE(int) YYPARSE(YY_CTX_PARAM) { return YYPARSEFROM(YY_CTX_ARG_ yy_Prog); } YY_PARSE(yycontext *) YYRELEASE(yycontext *yyctx) { if (yyctx->__buflen) { yyctx->__buflen= 0; YY_FREE(yyctx, yyctx->__buf); YY_FREE(yyctx, yyctx->__text); YY_FREE(yyctx, yyctx->__thunks); YY_FREE(yyctx, yyctx->__vals); } return yyctx; } #endif static node_t *parse(const char *txt, int *err_line) { yycontext yy; node_t *node, *tmp; memset(&yy, 0, sizeof(yy)); yy.cur = txt; while (yyparse(&yy)) ; if (!yy.prog && err_line) *err_line = yy.read_line; yyrelease(&yy); // Delete all the unused nodes. DL_FOREACH_SAFE(yy.nodes, node, tmp) { DL_DELETE(yy.nodes, node); if (node != yy.prog) node_free(node); } return yy.prog; } goxel-0.8.1/src/procedural.leg000066400000000000000000000172051334742672700163020ustar00rootroot00000000000000# Goxel 3D voxels editor # # copyright (c) 2016 Guillaume Chereau # # Goxel 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. # # Goxel 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 # goxel. If not, see . # # This file contains the procedural rendering language parser generator code. # If you change it you need to rebuild procedural.inl with 'leg': # leg -o src/procedural.inl src/procedural.leg. # # I don't really like to use a code generator, but it makes it much easier # to quickly change the grammar of the language. # # TODO: fix all the memory bugs in the code. %{ // Do not edit the .inl file directly, instead edit procedural.leg. #include #include #include #include #include "utlist.h" typedef struct { int nb; char *names[16]; } vars_t; #define YYSTYPE node_t* #define YY_CTX_LOCAL 1 #define YY_CTX_MEMBERS \ int line, read_line; \ node_t *prog; \ node_t *nodes; \ const char *cur; \ vars_t vars; // Redefine YY_INPUT to keep track of the last read line in the input. #define YY_INPUT(ctx, buf, result, max_size) \ { \ int yyc = *ctx->cur; \ if (yyc == '\n') ctx->read_line++; \ if (yyc) {ctx->cur++; *buf = yyc; result = 1;} \ else result = 0; \ } \ static node_t *node_create(int type, const char *id, int line, int nb, node_t **children, node_t **nodes) { int i; node_t *node = calloc(1, sizeof(*node)); node->type = type; node->id = id ? strdup(id) : NULL; node->line = line; node->size = nb; for (i = 0; i < nb; i++) { assert(children[i]); DL_DELETE(*nodes, children[i]); DL_APPEND(node->children, children[i]); } DL_APPEND(*nodes, node); return node; } // Convenience macro to create a node. #define N(type, id, ...) ({ \ node_t *nodes[] = {__VA_ARGS__}; \ node_create(NODE_##type, id, yy->line, ARRAY_SIZE(nodes), nodes, \ &yy->nodes); \ }) // Convenience function to append a node to an other one. static void node_append(node_t *node, node_t *c, node_t **nodes) { assert(node); assert(c); assert(node != c); node->size++; DL_DELETE(*nodes, c); DL_APPEND(node->children, c); } #define A(n, c) ({node_append(n, c, &yy->nodes);}) static void clear_vars(vars_t *vars) { int i; for (i = 0; i < ARRAY_SIZE(vars->names); i++) { free(vars->names[i]); vars->names[i] = NULL; } vars->nb = 0; } /* static int push_var(vars_t *vars, node_t *var) { int i; if (!var) { for (i = 0; i < ARRAY_SIZE(vars->names); i++) { free(vars->names[i]); vars->names[i] = NULL; } vars->nb = 0; return 0; } vars->names[vars->nb++] = strdup(var->id); return 0; } */ static int get_var(vars_t *vars, const char *id) { int i; for (i = 0; i < vars->nb; i++) { if (strcmp(vars->names[i], id) == 0) { return i + 1; } } vars->names[vars->nb++] = strdup(id); return vars->nb; } %} Prog = p:- {p = N(PROG, NULL)} (s:Shape {A(p, s)} )+ - {yy->prog = $$ = p} EOF Shape = s:- 'shape' i:Id {s = N(SHAPE, i->id); clear_vars(&yy->vars)} Args ( b:Block {A(s, b)} | (r:Rule {A(s, r)} )+ ) {$$ = s} Args = - {clear_vars(&yy->vars)} '(' (v:Var (',' | &')') )* ')' | - Rule = r:- 'rule' {r = N(RULE, NULL); r->v = 1.0} (w:Value {r->v = w->v} ) ? b:Block {A(r, b); $$ = r} Block = - '{' b:- {b = N(BLOCK, NULL)} (s:Stmt {A(b, s)} )* - '}' {$$ = b} Stmt = - 'loop' {x = NULL} (x:Var - '=')? e:Expr t:Transf b:Block {$$ = N(LOOP, NULL, e, t, b); $$->v = x ? x->v : 0} | - 'transform' t:Transf b:Block {$$ = N(TRANSFB, NULL, t, b)} | - 'return' {$$ = N(RETURN, NULL)} | i:IfStmt {$$ = i} | i:Id a:ArgsV t:Transf {$$ = N(CALL, i->id, t, a)} | t:Transf {$$ = t} | x:Var - '=' e:Expr {$$ = N(SET, NULL, e); $$->v = x->v} IfStmt = - 'if' e:Expr b:Block {$$ = N(IF, NULL, e, b)} ArgsV = a:- {a = N(ARGS, NULL)} ( '(' (e:Expr {A(a, e)} (',' | &')'))* ')' )? {$$ = a} Transf = - '[' t:- {t = N(TRANSF, NULL)} (o:Op {A(t, o)} )* ']' {$$ = t} Op = - i:Id o:- {o = N(OP, i->id)} (e:Expr {A(o, e)} )* - {$$ = o} Expr = a:Expr2 ( '?' b:Expr2 ':' c:Expr2 {$$ = N(EXPR, "?:", a, b, c)} | o:OpLog b:Expr {$$ = N(EXPR, o->id, a, b)} | - {$$ = a} ) Expr2 = a:Expr3 ( o:OpCmp b:Expr2 {$$ = N(EXPR, o->id, a, b)} | - {$$ = a} ) Expr3 = a:Expr4 ( o:OpSum b:Expr3 {$$ = N(EXPR, o->id, a, b)} | - {$$ = a} ) Expr4 = a:Value ( o:OpMul b:Expr4 {$$ = N(EXPR, o->id, a, b)} | - {$$ = a} ) OpLog = < ('||' | '&&') > {$$ = N(ID, yytext)} OpCmp = < ('==' | '!=' | '<=' | '>=' | '<' | '>') > {$$ = N(ID, yytext)} OpSum = < ('+' | '-') > {$$ = N(ID, yytext)} OpMul = < ('*' | '/' | '+-') > {$$ = N(ID, yytext)} Value = n:Num {$$ = n} | x:Var {$$ = N(EXPR, "var"); $$->v = x->v} | - '(' e:Expr ')' - {$$ = e} | - i:Id '(' e:Expr ')' {$$ = N(EXPR, i->id, e)} Num = - < [-.0-9]+ > - {$$ = N(VALUE, NULL); $$->v = atof(yytext)} Id = - < [a-zA-Z_][a-zA-Z_0-9]* > - {$$ = N(ID, yytext)} Var = - '$' < [a-zA-Z_][a-zA-Z_0-9]* > - {$$ = N(ID, yytext); $$->v = get_var(&yy->vars, yytext)} - = ( Comment | [ \t] | EOL )* Comment = '//' (!EOL .)* | '/*' ((!EOL !'*/' .) | EOL)* '*/' EOL = '\n' {yy->line++} EOF = !. %% static node_t *parse(const char *txt, int *err_line) { yycontext yy; node_t *node, *tmp; memset(&yy, 0, sizeof(yy)); yy.cur = txt; while (yyparse(&yy)) ; if (!yy.prog && err_line) *err_line = yy.read_line; yyrelease(&yy); // Delete all the unused nodes. DL_FOREACH_SAFE(yy.nodes, node, tmp) { DL_DELETE(yy.nodes, node); if (node != yy.prog) node_free(node); } return yy.prog; } goxel-0.8.1/src/quantization.c000066400000000000000000000120001334742672700163270ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2016 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { uint8_t c[4]; uint32_t n; } value_t; static UT_icd value_icd = {sizeof(value_t), NULL, NULL, NULL}; typedef struct { UT_array *values; } bucket_t; static void bucket_add(bucket_t *b, const uint8_t c[4], int n, bool check) { assert(b->values); int size = utarray_len(b->values); value_t v, *values = (value_t*)utarray_front(b->values); int i; assert(n); if (check) { for (i = 0; i < size; i++) { if (memcmp(values[i].c, c, 4) == 0) { values[i].n += n; return; } } } memcpy(v.c, c, 4); v.n = n; utarray_push_back(b->values, &v); } static int g_k; // Used in the sorting algo. // qsort_r is not portable! static int value_cmp(const void *a_, const void *b_) { int k = g_k; const value_t *a = a_; const value_t *b = b_; return cmp(a->c[k], b->c[k]); } // Split a bucket into two new buckets. static void bucket_split(const bucket_t *bucket, bucket_t *a, bucket_t *b) { int size = utarray_len(bucket->values); value_t *values = (value_t*)utarray_front(bucket->values); int i, j, k, nb = 0; uint8_t min_c[4] = {255, 255, 255, 255}; uint8_t max_c[4] = {0, 0, 0, 0}; // Find the channel with the max range for (i = 0; i < size; i++) { nb += values[i].n; for (k = 0; k < 4; k++) { min_c[k] = min(min_c[k], values[i].c[k]); max_c[k] = max(max_c[k], values[i].c[k]); } } k = 0; for (i = 0; i < 4; i++) if (max_c[i] - min_c[i] > max_c[k] - min_c[k]) k = i; // Sort the values by color. g_k = k; qsort(values, size, sizeof(*values), value_cmp); // Now take the bottom half into the first buket, and the top half into // the second one. utarray_new(a->values, &value_icd); utarray_new(b->values, &value_icd); for (i = 0, j = 0; i < size; i++) { if (j < nb / 2) bucket_add(a, values[i].c, min(values[i].n, nb / 2 - j), false); j += values[i].n; if (j > nb / 2) bucket_add(b, values[i].c, min(values[i].n, j - nb / 2), false); } } static void bucket_average_color(const bucket_t *b, uint8_t out[4]) { int size = utarray_len(b->values); value_t *values = (value_t*)utarray_front(b->values); int s[4] = {}, n = 0, i, k; if (size == 0) { memset(out, 0, 4); return; } for (i = 0; i < size; i++) { assert(values[i].n); n += values[i].n; for (k = 0; k < 4; k++) s[k] += values[i].n * values[i].c[k]; } out[0] = s[0] / n; out[1] = s[1] / n; out[2] = s[2] / n; out[3] = s[3] / n; } static int bucket_cmp(const void *a_, const void *b_) { const bucket_t *a = (void*)a_; const bucket_t *b = (void*)b_; int na = a->values ? utarray_len(a->values) : -1; int nb = b->values ? utarray_len(b->values) : -1; return cmp(nb, na); } // Generate an optimal palette whith a fixed number of colors from a mesh. // This is based on https://en.wikipedia.org/wiki/Median_cut. void quantization_gen_palette(const mesh_t *mesh, int nb, uint8_t (*palette)[4]) { uint8_t v[4]; int i, pos[3]; bucket_t *buckets, b; mesh_iterator_t iter; buckets = calloc(nb, sizeof(*buckets)); // Fill the initial bucket. utarray_new(buckets[0].values, &value_icd); iter = mesh_get_iterator(mesh, MESH_ITER_VOXELS); while (mesh_iter(&iter, pos)) { mesh_get_at(mesh, &iter, pos, v); if (v[3] < 127) continue; v[3] = 255; bucket_add(&buckets[0], v, 1, true); } // Split until we get nb buckets. I do it a bit stupidly, by sorting // the buckets at every iterations! I should use a stack! while (!buckets[nb - 1].values) { assert(!buckets[nb - 1].values); b = buckets[0]; memset(&buckets[0], 0, sizeof(buckets[0])); bucket_split(&b, &buckets[0], &buckets[nb - 1]); utarray_free(b.values); qsort(buckets, nb, sizeof(*buckets), bucket_cmp); } // Fill the palette colors and cleanup. for (i = 0; i < nb; i++) { assert(buckets[i].values); bucket_average_color(&buckets[i], palette[i]); utarray_free(buckets[i].values); } free(buckets); } goxel-0.8.1/src/render.c000066400000000000000000001054741334742672700151020ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #ifndef RENDER_CACHE_SIZE # define RENDER_CACHE_SIZE (1 * GB) #endif /* * The rendering is delayed from the time we call the different render * functions. This allows to call `render_xxx` anywhere in the code, without * having to worry about the current OpenGL state. * * Since generating the blocks vertex buffers is slow, we buffer them in a hash * table. We can evict blocks from the buffer when we need to save space or * if we know that the block won't be used anymore. */ // TODO: we need to get ride of unused blocks in the buffer, that hav not been // rendered for too long. First we might need to keep track of how much video // memory is used, so we get an idea of how much we need that. enum { ITEM_BLOCK, ITEM_MESH, ITEM_MODEL3D, ITEM_GRID, }; typedef struct { uint64_t ids[27]; int effects; } block_item_key_t; struct render_item_t { render_item_t *next, *prev; // The rendering queue. int type; block_item_key_t key; union { mesh_t *mesh; float mat[4][4]; }; uint8_t color[4]; float clip_box[4][4]; bool proj_screen; // Render with a 2d proj. model3d_t *model3d; texture_t *tex; int effects; GLuint vertex_buffer; int size; // 4 (quads) or 3 (triangles). int nb_elements; // Number of quads or triangle. int subdivide; // Unit per voxel (usually 1). }; // The buffered item hash table. For the moment it is only used of the blocks. // static render_item_t *g_items = NULL; // The cache of the g_items. static cache_t *g_items_cache; static const int BATCH_QUAD_COUNT = 1 << 14; static model3d_t *g_cube_model; static model3d_t *g_line_model; static model3d_t *g_wire_cube_model; static model3d_t *g_sphere_model; static model3d_t *g_grid_model; static model3d_t *g_rect_model; static model3d_t *g_wire_rect_model; typedef struct { // Those values are used as a key to identify the shader. const char *path; const char *include; GLint prog; GLint u_model_l; GLint u_view_l; GLint u_proj_l; GLint u_l_dir_l; GLint u_l_int_l; GLint u_m_amb_l; GLint u_m_dif_l; GLint u_m_spe_l; GLint u_m_shi_l; GLint u_m_smo_l; GLint u_bshadow_tex_l; GLint u_bshadow_l; GLint u_bump_tex_l; GLint u_pos_scale_l; GLint u_shadow_mvp_l; GLint u_shadow_k_l; GLint u_shadow_tex_l; GLint u_block_id_l; } prog_t; // Static list of programs. Need to be big enough for all the possible // shaders we are going to use. static prog_t g_progs[5] = {}; static GLuint g_index_buffer; static GLuint g_background_array_buffer; static GLuint g_border_tex; static GLuint g_bump_tex; static GLuint g_shadow_map_fbo; static texture_t *g_shadow_map; // XXX: the fbo should be part of the tex. #define OFFSET(n) offsetof(voxel_vertex_t, n) // The list of all the attributes used by the shaders. static const struct { const char *name; int size; int type; int norm; int offset; } ATTRIBUTES[] = { {"a_pos", 3, GL_UNSIGNED_BYTE, false, OFFSET(pos)}, {"a_normal", 3, GL_BYTE, false, OFFSET(normal)}, {"a_color", 4, GL_UNSIGNED_BYTE, true, OFFSET(color)}, {"a_pos_data", 2, GL_UNSIGNED_BYTE, true, OFFSET(pos_data)}, {"a_uv", 2, GL_UNSIGNED_BYTE, true, OFFSET(uv)}, {"a_bump_uv", 2, GL_UNSIGNED_BYTE, false, OFFSET(bump_uv)}, {"a_bshadow_uv", 2, GL_UNSIGNED_BYTE, false, OFFSET(bshadow_uv)}, }; /* * Create a texture atlas of the 256 possible border textures for a voxel * face. Each pixel correspond to the minimum distance to a border or an * edge. * * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |10 |11 |12 |13 |14 |15 | * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ * |16 |.. | | | | | | | | | | | | | | | * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ * | | | | | | | | | | | | | | | | | * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ * | | | | | | | | | | | | | | | | | * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ * | | | | | | | | | | | | | | | | | * * The index into the atlas is the bit mask of the touching side for * the 4 corners and the 4 edges => 8bit => 256 blocks. * */ static void copy_color(const uint8_t in[4], uint8_t out[4]) { if (in == NULL) { out[0] = 255; out[1] = 255; out[2] = 255; out[3] = 255; } else { memcpy(out, in, 4); } } static float get_border_dist(float x, float y, int mask) { const float corners[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; const float normals[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}}; float ret = 1; int i; float u[2]; float p[2] = {x, y}; for (i = 0; i < 4; i++) { if (mask & (1 << i)) // Corners. ret = min(ret, vec2_dist(p, corners[i])); if (mask & (0x10 << i)) { // Edges. vec2_sub(p, corners[i], u); ret = min(ret, vec2_dot(normals[i], u)); } } return ret; } static void init_border_texture(void) { const int s = VOXEL_TEXTURE_SIZE; // the individual tile size. uint8_t data[256 * s * s]; int mask, x, y, ax, ay; for (mask = 0; mask < 256; mask++) { for (y = 0; y < s; y++) for (x = 0; x < s; x++) { ay = mask / 16 * s + y; ax = mask % 16 * s + x; data[ay * s * 16 + ax] = 255 * get_border_dist( (float)x / s + 0.5 / s, (float)y / s + 0.5 / s, mask); } } GL(glGenTextures(1, &g_border_tex)); GL(glActiveTexture(GL_TEXTURE0)); GL(glBindTexture(GL_TEXTURE_2D, g_border_tex)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); GL(glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, s * 16, s * 16, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, data)); } static void bump_img_fill(uint8_t (*data)[3], int x, int y, int w, int h, const uint8_t v[3]) { int i, j; for (j = y; j < y + h; j++) { for (i = x; i < x + w; i++) { memcpy(data[j * 256 + i], v, 3); } } } static void bump_neighbor_value(int f, int e, uint8_t out[3]) { assert(e >= 0 && e < 4); assert(f >= 0 && f < 6); const int *n0, *n1; n0 = FACES_NORMALS[f]; n1 = FACES_NORMALS[FACES_NEIGHBORS[f][e]]; out[0] = (int)(n0[0] + n1[0]) * 127 / 2 + 127; out[1] = (int)(n0[1] + n1[1]) * 127 / 2 + 127; out[2] = (int)(n0[2] + n1[2]) * 127 / 2 + 127; } static void set_bump_block(uint8_t (*data)[3], int bx, int by, int f, int mask) { const uint8_t v[3] = {127 + FACES_NORMALS[f][0] * 127, 127 + FACES_NORMALS[f][1] * 127, 127 + FACES_NORMALS[f][2] * 127}; uint8_t nv[3]; bump_img_fill(data, bx * 16, by * 16, 16, 16, v); if (mask & 1) { bump_neighbor_value(f, 0, nv); bump_img_fill(data, bx * 16, by * 16, 16, 1, nv); } if (mask & 2) { bump_neighbor_value(f, 1, nv); bump_img_fill(data, bx * 16 + 15, by * 16, 1, 16, nv); } if (mask & 4) { bump_neighbor_value(f, 2, nv); bump_img_fill(data, bx * 16, by * 16 + 15, 16, 1, nv); } if (mask & 8) { bump_neighbor_value(f, 3, nv); bump_img_fill(data, bx * 16, by * 16, 1, 16, nv); } } static void init_bump_texture(void) { uint8_t (*data)[3]; int i, f, mask; data = calloc(1, 256 * 256 * 3); for (i = 0; i < 256; i++) { f = (i / 16) % 6; mask = i % 16; set_bump_block(data, i % 16, i / 16, f, mask); } GL(glGenTextures(1, &g_bump_tex)); GL(glActiveTexture(GL_TEXTURE0)); GL(glBindTexture(GL_TEXTURE_2D, g_bump_tex)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); GL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); free(data); } static void init_prog(prog_t *prog, const char *path, const char *include) { char include_full[256]; const char *code; int attr; sprintf(include_full, "#define VOXEL_TEXTURE_SIZE %d.0\n%s\n", VOXEL_TEXTURE_SIZE, include ?: ""); code = assets_get(path, NULL); prog->path = path; prog->include = include; prog->prog = gl_create_prog(code, code, include_full); for (attr = 0; attr < ARRAY_SIZE(ATTRIBUTES); attr++) { GL(glBindAttribLocation(prog->prog, attr, ATTRIBUTES[attr].name)); } GL(glLinkProgram(prog->prog)); GL(glUseProgram(prog->prog)); #define UNIFORM(x) GL(prog->x##_l = glGetUniformLocation(prog->prog, #x)) UNIFORM(u_model); UNIFORM(u_view); UNIFORM(u_proj); UNIFORM(u_l_dir); UNIFORM(u_l_int); UNIFORM(u_m_amb); UNIFORM(u_m_dif); UNIFORM(u_m_spe); UNIFORM(u_m_shi); UNIFORM(u_m_smo); UNIFORM(u_bshadow_tex); UNIFORM(u_bshadow); UNIFORM(u_bump_tex); UNIFORM(u_pos_scale); UNIFORM(u_shadow_mvp); UNIFORM(u_shadow_k); UNIFORM(u_shadow_tex); UNIFORM(u_block_id); #undef UNIFORM GL(glUniform1i(prog->u_bshadow_tex_l, 0)); GL(glUniform1i(prog->u_bump_tex_l, 1)); GL(glUniform1i(prog->u_shadow_tex_l, 2)); } static prog_t *get_prog(const char *path, const char *include) { int i; prog_t *p = NULL; for (i = 0; i < ARRAY_SIZE(g_progs); i++) { p = &g_progs[i]; if (!p->path) break; if (p->path == path && p->include == include) return p; } assert(i < ARRAY_SIZE(g_progs)); init_prog(p, path, include); return p; } void render_init() { LOG_D("render init"); GL(glGenBuffers(1, &g_index_buffer)); GL(glGenBuffers(1, &g_background_array_buffer)); // 6 vertices (2 triangles) per face. uint16_t *index_array = NULL; int i; index_array = calloc(BATCH_QUAD_COUNT * 6, sizeof(*index_array)); for (i = 0; i < BATCH_QUAD_COUNT * 6; i++) { index_array[i] = (i / 6) * 4 + ((int[]){0, 1, 2, 2, 3, 0})[i % 6]; } GL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_index_buffer)); GL(glBufferData(GL_ELEMENT_ARRAY_BUFFER, BATCH_QUAD_COUNT * 6 * 2, index_array, GL_STATIC_DRAW)); #ifndef GLES2 GL(glEnable(GL_LINE_SMOOTH)); #endif free(index_array); init_border_texture(); init_bump_texture(); // XXX: pick the proper memory size according to what is available. g_items_cache = cache_create(RENDER_CACHE_SIZE); g_cube_model = model3d_cube(); g_line_model = model3d_line(); g_wire_cube_model = model3d_wire_cube(); g_sphere_model = model3d_sphere(16, 16); g_grid_model = model3d_grid(8, 8); g_rect_model = model3d_rect(); g_wire_rect_model = model3d_wire_rect(); } void render_deinit(void) { int i; for (i = 0; i < ARRAY_SIZE(g_progs); i++) { if (g_progs[i].prog) gl_delete_prog(g_progs[i].prog); } memset(&g_progs, 0, sizeof(g_progs)); GL(glDeleteBuffers(1, &g_index_buffer)); g_index_buffer = 0; } // A global buffer large enough to contain all the vertices for any block. static voxel_vertex_t* g_vertices_buffer = NULL; // Used for the cache. static int item_delete(void *item_) { render_item_t *item = item_; GL(glDeleteBuffers(1, &item->vertex_buffer)); free(item); return 0; } static render_item_t *get_item_for_block( const mesh_t *mesh, mesh_iterator_t *iter, const int block_pos[3], int effects) { render_item_t *item; const int effects_mask = EFFECT_BORDERS | EFFECT_BORDERS_ALL | EFFECT_MARCHING_CUBES | EFFECT_SMOOTH | EFFECT_FLAT; uint64_t block_data_id; int p[3], i, x, y, z; block_item_key_t key = {}; // For the moment we always compute the smooth normal no mater what. effects |= EFFECT_SMOOTH; memset(&key, 0, sizeof(key)); // Just to be sure! key.effects = effects & effects_mask; // The hash key take into consideration all the blocks adjacent to // the current block! for (i = 0, z = -1; z <= 1; z++) for (y = -1; y <= 1; y++) for (x = -1; x <= 1; x++, i++) { p[0] = block_pos[0] + x * BLOCK_SIZE; p[1] = block_pos[1] + y * BLOCK_SIZE; p[2] = block_pos[2] + z * BLOCK_SIZE; mesh_get_block_data(mesh, NULL, p, &block_data_id); key.ids[i] = block_data_id; } item = cache_get(g_items_cache, &key, sizeof(key)); if (item) return item; item = calloc(1, sizeof(*item)); item->key = key; GL(glGenBuffers(1, &item->vertex_buffer)); GL(glBindBuffer(GL_ARRAY_BUFFER, item->vertex_buffer)); if (!g_vertices_buffer) g_vertices_buffer = calloc( BLOCK_SIZE * BLOCK_SIZE * BLOCK_SIZE * 6 * 4, sizeof(*g_vertices_buffer)); item->nb_elements = mesh_generate_vertices( mesh, block_pos, effects, g_vertices_buffer, &item->size, &item->subdivide); if (item->nb_elements > BATCH_QUAD_COUNT) { LOG_W("Too many quads!"); item->nb_elements = BATCH_QUAD_COUNT; } if (item->nb_elements != 0) { GL(glBufferData(GL_ARRAY_BUFFER, item->nb_elements * item->size * sizeof(*g_vertices_buffer), g_vertices_buffer, GL_STATIC_DRAW)); } cache_add(g_items_cache, &key, sizeof(key), item, item->nb_elements * item->size * sizeof(*g_vertices_buffer), item_delete); return item; } static void render_block_(renderer_t *rend, mesh_t *mesh, mesh_iterator_t *iter, const int block_pos[3], int block_id, int effects, prog_t *prog, const float model[4][4]) { render_item_t *item; float block_model[4][4]; int attr; float block_id_f[2]; item = get_item_for_block(mesh, iter, block_pos, effects); if (item->nb_elements == 0) return; GL(glBindBuffer(GL_ARRAY_BUFFER, item->vertex_buffer)); if (prog->u_block_id_l != -1) { block_id_f[1] = ((block_id >> 8) & 0xff) / 255.0; block_id_f[0] = ((block_id >> 0) & 0xff) / 255.0; GL(glUniform2fv(prog->u_block_id_l, 1, block_id_f)); } GL(glUniform1f(prog->u_pos_scale_l, 1.f / item->subdivide)); for (attr = 0; attr < ARRAY_SIZE(ATTRIBUTES); attr++) { GL(glVertexAttribPointer(attr, ATTRIBUTES[attr].size, ATTRIBUTES[attr].type, ATTRIBUTES[attr].norm, sizeof(voxel_vertex_t), (void*)(intptr_t)ATTRIBUTES[attr].offset)); } mat4_copy(model, block_model); mat4_itranslate(block_model, block_pos[0], block_pos[1], block_pos[2]); GL(glUniformMatrix4fv(prog->u_model_l, 1, 0, (float*)block_model)); if (item->size == 4) { // Use indexed triangles. GL(glDrawElements(GL_TRIANGLES, item->nb_elements * 6, GL_UNSIGNED_SHORT, 0)); } else { GL(glDrawArrays(GL_TRIANGLES, 0, item->nb_elements * item->size)); } #ifndef GLES2 if (effects & EFFECT_WIREFRAME) { GL(glUniform1f(prog->u_m_amb_l, 0)); GL(glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)); if (item->size == 4) GL(glDrawElements(GL_TRIANGLES, item->nb_elements * 6, GL_UNSIGNED_SHORT, 0)); else GL(glDrawArrays(GL_TRIANGLES, 0, item->nb_elements * item->size)); GL(glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)); GL(glUniform1f(prog->u_m_amb_l, rend->settings.ambient)); } #endif } static void get_light_dir(const renderer_t *rend, bool model_view, float out[3]) { float light_dir[4]; float m[4][4]; mat4_set_identity(m); mat4_irotate(m, rend->light.yaw, 0, 0, 1); mat4_irotate(m, rend->light.pitch, 1, 0, 0); mat4_mul_vec4(m, VEC(0, 0, 1, 0), light_dir); if (rend->light.fixed) { mat4_invert(rend->view_mat, m); mat4_irotate(m, -M_PI / 4, 1, 0, 0); mat4_irotate(m, -M_PI / 4, 0, 0, 1); mat4_mul_vec4(m, light_dir, light_dir); } if (model_view) mat4_mul_vec4(rend->view_mat, light_dir, light_dir); vec3_copy(light_dir, out); } void render_get_light_dir(const renderer_t *rend, float out[3]) { get_light_dir(rend, false, out); } // Compute the minimum projection box to use for the shadow map. static void compute_shadow_map_box( const renderer_t *rend, float rect[6]) { const float POS[8][3] = { {0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}, {0, 1, 0}, {1, 1, 0}, {1, 1, 1}, {0, 1, 1}, }; const int N = BLOCK_SIZE; render_item_t *item; float p[3]; int i, bpos[3]; mesh_iterator_t iter; float view_mat[4][4], light_dir[3]; get_light_dir(rend, false, light_dir); mat4_lookat(view_mat, light_dir, VEC(0, 0, 0), VEC(0, 1, 0)); rect[0] = +FLT_MAX; rect[1] = -FLT_MAX; rect[2] = +FLT_MAX; rect[3] = -FLT_MAX; rect[4] = +FLT_MAX; rect[5] = -FLT_MAX; DL_FOREACH(rend->items, item) { if (item->type != ITEM_MESH) continue; iter = mesh_get_iterator(item->mesh, MESH_ITER_BLOCKS); while (mesh_iter(&iter, bpos)) { for (i = 0; i < 8; i++) { vec3_set(p, bpos[0], bpos[1], bpos[2]); vec3_addk(p, POS[i], N, p); mat4_mul_vec3(view_mat, p, p); rect[0] = min(rect[0], p[0]); rect[1] = max(rect[1], p[0]); rect[2] = min(rect[2], p[1]); rect[3] = max(rect[3], p[1]); rect[4] = min(rect[4], -p[2]); rect[5] = max(rect[5], -p[2]); } } } } static void render_mesh_(renderer_t *rend, mesh_t *mesh, int effects, const float shadow_mvp[4][4]) { prog_t *prog; float model[4][4]; int attr, block_pos[3], block_id; float light_dir[3]; bool shadow = false; mesh_iterator_t iter; mat4_set_identity(model); get_light_dir(rend, true, light_dir); if (effects & EFFECT_RENDER_POS) prog = get_prog("asset://data/shaders/pos_data.glsl", NULL); else if (effects & EFFECT_SHADOW_MAP) prog = get_prog("asset://data/shaders/shadow_map.glsl", NULL); else { shadow = rend->settings.shadow; prog = get_prog("asset://data/shaders/mesh.glsl", shadow ? "#define SHADOW" : NULL); } GL(glEnable(GL_DEPTH_TEST)); GL(glDepthFunc(GL_LESS)); GL(glEnable(GL_CULL_FACE)); GL(glCullFace(GL_BACK)); GL(glActiveTexture(GL_TEXTURE0)); GL(glBindTexture(GL_TEXTURE_2D, g_border_tex)); GL(glActiveTexture(GL_TEXTURE1)); GL(glBindTexture(GL_TEXTURE_2D, g_bump_tex)); GL(glDisable(GL_BLEND)); if (effects & EFFECT_SEE_BACK) { GL(glCullFace(GL_FRONT)); vec3_imul(light_dir, -0.5); } if (effects & EFFECT_SEMI_TRANSPARENT) { GL(glEnable(GL_BLEND)); GL(glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR)); GL(glBlendColor(0.75, 0.75, 0.75, 0.75)); } GL(glUseProgram(prog->prog)); if (shadow) { assert(shadow_mvp); GL(glActiveTexture(GL_TEXTURE2)); GL(glBindTexture(GL_TEXTURE_2D, g_shadow_map->tex)); GL(glUniformMatrix4fv(prog->u_shadow_mvp_l, 1, 0, (float*)shadow_mvp)); GL(glUniform1i(prog->u_shadow_tex_l, 2)); GL(glUniform1f(prog->u_shadow_k_l, rend->settings.shadow)); } GL(glUniformMatrix4fv(prog->u_proj_l, 1, 0, (float*)rend->proj_mat)); GL(glUniformMatrix4fv(prog->u_view_l, 1, 0, (float*)rend->view_mat)); GL(glUniform1i(prog->u_bshadow_tex_l, 0)); GL(glUniform1i(prog->u_bump_tex_l, 1)); GL(glUniform3fv(prog->u_l_dir_l, 1, light_dir)); GL(glUniform1f(prog->u_l_int_l, rend->light.intensity)); GL(glUniform1f(prog->u_m_amb_l, rend->settings.ambient)); GL(glUniform1f(prog->u_m_dif_l, rend->settings.diffuse)); GL(glUniform1f(prog->u_m_spe_l, rend->settings.specular)); GL(glUniform1f(prog->u_m_shi_l, rend->settings.shininess)); GL(glUniform1f(prog->u_m_smo_l, rend->settings.smoothness)); GL(glUniform1f(prog->u_bshadow_l, rend->settings.border_shadow)); for (attr = 0; attr < ARRAY_SIZE(ATTRIBUTES); attr++) GL(glEnableVertexAttribArray(attr)); GL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_index_buffer)); block_id = 1; iter = mesh_get_iterator(mesh, MESH_ITER_BLOCKS | MESH_ITER_INCLUDES_NEIGHBORS); while (mesh_iter(&iter, block_pos)) { render_block_(rend, mesh, &iter, block_pos, block_id++, effects, prog, model); } for (attr = 0; attr < ARRAY_SIZE(ATTRIBUTES); attr++) GL(glDisableVertexAttribArray(attr)); if (effects & EFFECT_SEE_BACK) { effects &= ~EFFECT_SEE_BACK; effects |= EFFECT_SEMI_TRANSPARENT; render_mesh_(rend, mesh, effects, shadow_mvp); } } // XXX: this is quite ugly. We could maybe use a callback of some sort // in the renderer instead. void render_get_block_pos(renderer_t *rend, const mesh_t *mesh, int id, int pos[3]) { // Basically we simulate the algo of render_mesh_ but without rendering // anything. int block_id, block_pos[3]; mesh_iterator_t iter; block_id = 1; iter = mesh_get_iterator(mesh, MESH_ITER_BLOCKS | MESH_ITER_INCLUDES_NEIGHBORS); while (mesh_iter(&iter, block_pos)) { if (block_id == id) { memcpy(pos, block_pos, sizeof(block_pos)); return; } block_id++; } } void render_mesh(renderer_t *rend, const mesh_t *mesh, int effects) { render_item_t *item = calloc(1, sizeof(*item)); item->type = ITEM_MESH; item->mesh = mesh_copy(mesh); item->effects = effects | rend->settings.effects; // With EFFECT_RENDER_POS we need to remove some effects. if (item->effects & EFFECT_RENDER_POS) item->effects &= ~(EFFECT_SEMI_TRANSPARENT | EFFECT_SEE_BACK | EFFECT_MARCHING_CUBES); DL_APPEND(rend->items, item); } static void render_model_item(renderer_t *rend, const render_item_t *item) { float proj[4][4]; const float (*proj_mat)[4][4]; const float (*view_mat)[4][4]; float light[3]; if (item->proj_screen) { mat4_ortho(proj, -0.5, +0.5, -0.5, +0.5, -10, +10); proj_mat = &proj; view_mat = &mat4_identity; } else { proj_mat = &rend->proj_mat; view_mat = &rend->view_mat; } if (!(item->effects & EFFECT_WIREFRAME)) get_light_dir(rend, false, light); model3d_render(item->model3d, item->mat, *view_mat, *proj_mat, item->color, item->tex, light, item->clip_box, item->effects); } static void render_grid_item(renderer_t *rend, const render_item_t *item) { int x, y, n; float model_mat[4][4]; n = 3; for (y = -n; y < n; y++) for (x = -n; x < n; x++) { mat4_copy(item->mat, model_mat); mat4_translate(model_mat, x + 0.5, y + 0.5, 0, model_mat); model3d_render(item->model3d, model_mat, rend->view_mat, rend->proj_mat, item->color, NULL, NULL, item->clip_box, 0); } } void render_grid(renderer_t *rend, const float plane[4][4], const uint8_t color[4], const float clip_box[4][4]) { render_item_t *item = calloc(1, sizeof(*item)); item->type = ITEM_GRID; mat4_copy(plane, item->mat); mat4_iscale(item->mat, 8, 8, 1); item->model3d = g_grid_model; copy_color(color, item->color); if (clip_box) mat4_copy(clip_box, item->clip_box); DL_APPEND(rend->items, item); } void render_img(renderer_t *rend, texture_t *tex, const float mat[4][4], int effects) { render_item_t *item = calloc(1, sizeof(*item)); item->type = ITEM_MODEL3D; mat ? mat4_copy(mat, item->mat) : mat4_set_identity(item->mat); item->proj_screen = !mat; item->tex = texture_copy(tex); item->model3d = g_rect_model; copy_color(NULL, item->color); item->effects = effects; DL_APPEND(rend->items, item); } void render_img2(renderer_t *rend, const uint8_t *data, int w, int h, int bpp, const float mat[4][4], int effects) { // Experimental for the moment! // Same as render_img, but we flip the texture! render_item_t *item = calloc(1, sizeof(*item)); item->type = ITEM_MODEL3D; mat ? mat4_copy(mat, item->mat) : mat4_set_identity(item->mat); mat4_iscale(item->mat, 1, -1, 1); item->proj_screen = effects & EFFECT_PROJ_SCREEN; item->tex = texture_new_from_buf(data, w, h, bpp, (effects & EFFECT_ANTIALIASING) ? 0 : TF_NEAREST); item->model3d = g_rect_model; copy_color(NULL, item->color); item->effects = effects; DL_APPEND(rend->items, item); } void render_rect(renderer_t *rend, const float plane[4][4], int effects) { render_item_t *item = calloc(1, sizeof(*item)); assert((effects & EFFECT_STRIP) == effects); item->type = ITEM_MODEL3D; mat4_copy(plane, item->mat); item->model3d = g_wire_rect_model; copy_color(NULL, item->color); item->proj_screen = true; item->effects = effects; DL_APPEND(rend->items, item); } // Return a plane whose u vector is the line ab. static void line_create_plane(const float a[3], const float b[3], float out[4][4]) { mat4_set_identity(out); vec3_copy(a, out[3]); vec3_sub(b, a, out[0]); } void render_line(renderer_t *rend, const float a[3], const float b[3], const uint8_t color[4]) { render_item_t *item = calloc(1, sizeof(*item)); item->type = ITEM_MODEL3D; item->model3d = g_line_model; line_create_plane(a, b, item->mat); copy_color(color, item->color); mat4_itranslate(item->mat, 0.5, 0, 0); DL_APPEND(rend->items, item); } void render_box(renderer_t *rend, const float box[4][4], const uint8_t color[4], int effects) { render_item_t *item = calloc(1, sizeof(*item)); assert((effects & (EFFECT_STRIP | EFFECT_WIREFRAME | EFFECT_SEE_BACK | EFFECT_GRID)) == effects); item->type = ITEM_MODEL3D; mat4_copy(box, item->mat); copy_color(color, item->color); item->effects = effects; item->model3d = (effects & EFFECT_WIREFRAME) ? g_wire_cube_model : g_cube_model; DL_APPEND(rend->items, item); } void render_sphere(renderer_t *rend, const float mat[4][4]) { render_item_t *item = calloc(1, sizeof(*item)); item->type = ITEM_MODEL3D; mat4_copy(mat, item->mat); item->model3d = g_sphere_model; DL_APPEND(rend->items, item); } static int item_sort_value(const render_item_t *a) { if (a->effects & EFFECT_WIREFRAME) return 20; if (a->proj_screen) return 10; switch (a->type) { case ITEM_MESH: return 0; case ITEM_MODEL3D: return 1; case ITEM_GRID: return 2; default: return 0; } } static int item_sort_cmp(const render_item_t *a, const render_item_t *b) { return cmp(item_sort_value(a), item_sort_value(b)); } static void render_shadow_map(renderer_t *rend, float shadow_mvp[4][4]) { render_item_t *item; float rect[6], light_dir[3]; int effects; // Create a renderer looking at the scene from the light. compute_shadow_map_box(rend, rect); float bias_mat[4][4] = {{0.5, 0.0, 0.0, 0.0}, {0.0, 0.5, 0.0, 0.0}, {0.0, 0.0, 0.5, 0.0}, {0.5, 0.5, 0.5, 1.0}}; float ret[4][4]; renderer_t srend = {}; get_light_dir(rend, false, light_dir); mat4_lookat(srend.view_mat, light_dir, VEC(0, 0, 0), VEC(0, 1, 0)); mat4_ortho(srend.proj_mat, rect[0], rect[1], rect[2], rect[3], rect[4], rect[5]); // Generate the depth buffer. if (!g_shadow_map_fbo) { GL(glGenFramebuffers(1, &g_shadow_map_fbo)); GL(glBindFramebuffer(GL_FRAMEBUFFER, g_shadow_map_fbo)); #ifndef GLES2 GL(glDrawBuffer(GL_NONE)); GL(glReadBuffer(GL_NONE)); #endif g_shadow_map = texture_new_surface(2048, 2048, 0); GL(glBindTexture(GL_TEXTURE_2D, g_shadow_map->tex)); GL(glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 2048, 2048, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, 0)); GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); GL(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, g_shadow_map->tex, 0)); } GL(glBindFramebuffer(GL_FRAMEBUFFER, g_shadow_map_fbo)); GL(glViewport(0, 0, 2048, 2048)); GL(glClear(GL_DEPTH_BUFFER_BIT)); DL_FOREACH(rend->items, item) { if (item->type == ITEM_MESH) { effects = (item->effects & EFFECT_MARCHING_CUBES); effects |= EFFECT_SHADOW_MAP; render_mesh_(&srend, item->mesh, effects, NULL); } } mat4_copy(bias_mat, ret); mat4_imul(ret, srend.proj_mat); mat4_imul(ret, srend.view_mat); mat4_copy(ret, shadow_mvp); } static void render_background(renderer_t *rend, const uint8_t col[4]) { prog_t *prog; typedef struct { int8_t pos[3] __attribute__((aligned(4))); float color[4] __attribute__((aligned(4))); } vertex_t; vertex_t vertices[4]; float c1[4], c2[4]; if (!col || col[3] == 0) { GL(glClearColor(0, 0, 0, 0)); GL(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); return; } GL(glClear(GL_DEPTH_BUFFER_BIT)); // Add a small gradient to the color. vec4_set(c1, col[0] / 255., col[1] / 255., col[2] / 255., col[3] / 255.); vec4_set(c2, col[0] / 255., col[1] / 255., col[2] / 255., col[3] / 255.); vec3_iadd(c1, VEC(+0.2, +0.2, +0.2)); vec3_iadd(c2, VEC(-0.2, -0.2, -0.2)); vertices[0] = (vertex_t){{-1, -1, 0}, {c1[0], c1[1], c1[2], c1[3]}}; vertices[1] = (vertex_t){{+1, -1, 0}, {c1[0], c1[1], c1[2], c1[3]}}; vertices[2] = (vertex_t){{+1, +1, 0}, {c2[0], c2[1], c2[2], c2[3]}}; vertices[3] = (vertex_t){{-1, +1, 0}, {c2[0], c2[1], c2[2], c2[3]}}; prog = get_prog("asset://data/shaders/background.glsl", NULL); GL(glUseProgram(prog->prog)); GL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_index_buffer)); GL(glBindBuffer(GL_ARRAY_BUFFER, g_background_array_buffer)); GL(glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_DYNAMIC_DRAW)); GL(glEnableVertexAttribArray(0)); GL(glVertexAttribPointer(0, 3, GL_BYTE, false, sizeof(vertex_t), (void*)(intptr_t)offsetof(vertex_t, pos))); GL(glEnableVertexAttribArray(2)); GL(glVertexAttribPointer(2, 4, GL_FLOAT, false, sizeof(vertex_t), (void*)(intptr_t)offsetof(vertex_t, color))); GL(glDepthMask(false)); GL(glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0)); GL(glDepthMask(true)); } void render_submit(renderer_t *rend, const int rect[4], const uint8_t clear_color[4]) { render_item_t *item, *tmp; float shadow_mvp[4][4]; const float s = rend->scale; bool shadow = rend->settings.shadow && !(rend->settings.effects & (EFFECT_RENDER_POS | EFFECT_SHADOW_MAP)); if (shadow) { GL(glDisable(GL_SCISSOR_TEST)); render_shadow_map(rend, shadow_mvp); } GL(glBindFramebuffer(GL_FRAMEBUFFER, rend->fbo)); GL(glEnable(GL_SCISSOR_TEST)); GL(glViewport(rect[0] * s, rect[1] * s, rect[2] * s, rect[3] * s)); GL(glScissor(rect[0] * s, rect[1] * s, rect[2] * s, rect[3] * s)); GL(glLineWidth(rend->scale)); render_background(rend, clear_color); DL_SORT(rend->items, item_sort_cmp); DL_FOREACH_SAFE(rend->items, item, tmp) { switch (item->type) { case ITEM_MESH: render_mesh_(rend, item->mesh, item->effects, shadow_mvp); DL_DELETE(rend->items, item); mesh_delete(item->mesh); break; case ITEM_MODEL3D: render_model_item(rend, item); DL_DELETE(rend->items, item); break; case ITEM_GRID: render_grid_item(rend, item); DL_DELETE(rend->items, item); break; } texture_delete(item->tex); free(item); } assert(rend->items == NULL); } int render_get_default_settings(int i, char **name, render_settings_t *out) { if (!out) return 6; *out = (render_settings_t) { .border_shadow = 0.4, .ambient = 0.3, .diffuse = 0.5, .specular = 0.4, .shininess = 2.0, .smoothness = 0.0, .effects = EFFECT_BORDERS, .shadow = 0.3, }; switch (i) { case 0: if (name) *name = "Borders"; break; case 1: if (name) *name = "Cubes"; out->effects = EFFECT_BORDERS_ALL; break; case 2: if (name) *name = "Plain"; out->effects = 0; break; case 3: if (name) *name = "Smooth"; out->effects = 0; out->smoothness = 1; out->border_shadow = 0; out->shadow = 0; break; case 4: if (name) *name = "Half smooth"; out->smoothness = 0.2; break; case 5: if (name) *name = "Marching"; out->smoothness = 1.0; out->effects = EFFECT_MARCHING_CUBES | EFFECT_FLAT; break; } if (DEFINED(GOXEL_NO_SHADOW)) out->shadow = 0; return 5; } goxel-0.8.1/src/shape.c000066400000000000000000000053601334742672700147140ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" shape_t shape_sphere; shape_t shape_cube; shape_t shape_cylinder; static float sphere_func(const float p[3], const float s[3], float smoothness) { float d = vec3_norm(p); float r; if (p[0] == 0 && p[1] == 0 && p[2] == 0) return max3(s[0], s[1], s[2]); r = s[0] * s[1] * s[2] / vec3_norm(VEC(s[1] * s[2] * p[0] / d, s[0] * s[2] * p[1] / d, s[0] * s[1] * p[2] / d)); return r - d; } static float cube_func(const float p[3], const float s[3], float sm) { int i; float min_v = INFINITY; float ret = INFINITY, v; // Check if we are outside the max cube: if (p[0] < -s[0] - sm || p[0] >= +s[0] + sm || p[1] < -s[1] - sm || p[1] >= +s[1] + sm || p[2] < -s[2] - sm || p[2] >= +s[2] + sm) return -INFINITY; // Or inside the min cube: if (p[0] >= -s[0] + sm && p[0] < +s[0] - sm && p[1] >= -s[1] + sm && p[1] < +s[1] - sm && p[2] >= -s[2] + sm && p[2] < +s[2] - sm) return +INFINITY; for (i = 0; i < 3; i++) { if (p[i]) { v = s[i] / fabs(p[i]); if (v < min_v) { min_v = v; ret = s[i] - fabs(p[i]); } } } return ret; } static float cylinder_func(const float p[3], const float s[3], float smoothness) { float d = vec2_norm(p); float rz, r; rz = s[2] - fabs(p[2]); if (p[0] == 0 && p[1] == 0) return min(rz, max3(s[0], s[1], s[2])); // Ellipse polar form relative to center: // r(θ) = a b / √((b cosΘ)² + (a sinΘ)²) r = s[0] * s[1] / vec2_norm(VEC(s[1] * p[0] / d, s[0] * p[1] / d)); return min(rz, r - d); } void shapes_init(void) { shape_sphere = (shape_t){ .id = "sphere", .func = sphere_func, }; shape_cube = (shape_t){ .id = "cube", .func = cube_func, }; shape_cylinder = (shape_t){ .id = "cylinder", .func = cylinder_func, }; } goxel-0.8.1/src/sound.c000066400000000000000000000107141334742672700147430ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* Basic sound support. * * The code is probably overcomplicated, because this is adapted from * some old code I used for video games, that supported much more features, * like music, effects, ogg files... * * This is disabled by default. */ #include "goxel.h" #ifdef SOUND // Abstraction used to represent any kind of sound sources: wav, sfxr, mod. typedef struct sound_source { void *data; int rate, channels, size; int (*read)(struct sound_source *source, void *data, int size); void (*delete)(struct sound_source *source); void (*reset)(struct sound_source *source); } sound_source_t; typedef struct sound_backend sound_backend_t; typedef struct sound { UT_hash_handle hh; int state; sound_source_t *source; sound_backend_t *backend; } sound_t; static sound_t *g_sounds = NULL; static bool g_enabled = true; // Functions defined by the backend. void sound_backend_init(void); sound_backend_t *sound_backend_create(sound_source_t *source); void sound_backend_play_sound(sound_t *sound, float volume, float pitch); void sound_backend_stop_sound(sound_t *sound); int sound_backend_iter_sound(sound_t *sound); void sound_backend_iter(void); void sound_init(void) { sound_backend_init(); } bool sound_is_enabled(void) { return g_enabled; } void sound_set_enabled(bool v) { g_enabled = v; } typedef struct { void *buffer; int size; int pos; } wav_t; static int wav_read(sound_source_t *source, void *out, int size) { wav_t *wav = source->data; size = min(size, wav->size - wav->pos); if (out) memcpy(out, wav->buffer + wav->pos, size); wav->pos += size; return size; } static void wav_reset(sound_source_t *source) { wav_t *wav = source->data; wav->pos = 0; } static void wav_delete(sound_source_t *source) { wav_t *wav = source->data; free(wav->buffer); free(wav); free(source); } static sound_source_t *wav_create(const char *path) { sound_source_t *ret = calloc(1, sizeof(*ret)); wav_t *wav = calloc(1, sizeof(*wav)); const char *data; data = assets_get(path, NULL); assert(data); ret->size = wav->size = *(uint32_t*)(data + 40); ret->rate = *(uint32_t*)(data + 24); ret->channels = *(uint16_t*)(data + 22); wav->buffer = malloc(wav->size); memcpy(wav->buffer, data + 44, wav->size); ret->data = wav; ret->read = wav_read; ret->reset = wav_reset; ret->delete = wav_delete; return ret; } static sound_t *sound_get(const char *name) { sound_t *sound; char *path; HASH_FIND_STR(g_sounds, name, sound); if (!sound) { sound = calloc(1, sizeof(*sound)); asprintf(&path, "asset://data/sounds/%s.wav", name); sound->source = wav_create(path); free(path); assert(sound->source); sound->backend = sound_backend_create(sound->source); HASH_ADD_KEYPTR(hh, g_sounds, name, strlen(name), sound); } return sound; } void sound_play(const char *name, float volume, float pitch) { if (!g_enabled) return; sound_t *sound = sound_get(name); sound->source->reset(sound->source); sound_backend_stop_sound(sound); sound->state = 1; sound_backend_play_sound(sound, volume, pitch); } void sound_iter(void) { sound_t *sound, *tmp; HASH_ITER(hh, g_sounds, sound, tmp) { sound->state = sound_backend_iter_sound(sound); } sound_backend_iter(); } // For the moment the only backend we support is OpenAL. #include "sound_openal.inl" #else // Dummy API when we compile without sound support. void sound_init(void) {} void sound_play(const char *name, float volume, float pitch) {} void sound_iter(void) {} bool sound_is_enabled(void) { return false; } void sound_set_enabled(bool v) {} #endif goxel-0.8.1/src/sound_openal.inl000066400000000000000000000122231334742672700166360ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #ifdef __APPLE__ # include # include #else # include # include #endif #define SAMPLING_BUFFER_SIZE (1024 * 32) #define BUFFERS_NB 2 #if DEBUG static const char *get_error_name(ALenum r) { # define C(x) case x: return #x; break; switch (r) { C(AL_INVALID_NAME) C(AL_INVALID_ENUM) C(AL_INVALID_VALUE) C(AL_INVALID_OPERATION) C(AL_OUT_OF_MEMORY) default: return "unknown error"; } # undef C } # define AL(x) do { \ x; \ ALenum err_ = alGetError(); \ if (err_ != AL_NO_ERROR) \ LOG_E("AL error: %s", get_error_name(err_)); \ assert(err_ == AL_NO_ERROR); \ } while (0); #else // ! DEBUG # define AL(x) x #endif struct sound_backend { int format; int rate; ALuint source; ALuint buffers[BUFFERS_NB]; int buffers_start; // Index of the first buffer int buffers_count; // Number of buffers in the queue }; static struct { ALCdevice* device; ALCcontext* context; } global = {0}; sound_backend_t *sound_backend_create(sound_source_t *source) { sound_backend_t *sound = calloc(1, sizeof(*sound)); AL(alGenBuffers(BUFFERS_NB, sound->buffers)); AL(alGenSources(1, &sound->source)); sound->format = (source->channels == 1) ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16; sound->rate = source->rate; return sound; } void sound_backend_delete(sound_backend_t *b) { ALint i, nb; ALuint buff; AL(alSourceStop(b->source)); AL(alGetSourcei(b->source, AL_BUFFERS_PROCESSED, &nb)); assert(nb <= b->buffers_count); for (i = 0; i < nb; i++) { // If I don't use a temp variable for the buffer name, then I have // some strange bugs on iOS where alSourceUnqueueBuffers modifies the // values of the buffers! buff = b->buffers[b->buffers_start]; AL(alSourceUnqueueBuffers(b->source, 1, &buff)); b->buffers_start = (b->buffers_start + 1) % BUFFERS_NB; b->buffers_count--; } AL(alDeleteBuffers(BUFFERS_NB, b->buffers)); AL(alDeleteSources(1, &b->source)); free(b); } void sound_backend_init() { assert(!global.device); assert(!global.context); global.device = alcOpenDevice(NULL); global.context = alcCreateContext(global.device, NULL); AL(alcMakeContextCurrent(global.context)); } void sound_backend_release() { alcMakeContextCurrent(NULL); alcDestroyContext(global.context); global.context = NULL; alcCloseDevice(global.device); global.device = NULL; } void sound_backend_stop_sound(sound_t *sound) { AL(alSourceStop(sound->backend->source)); } void sound_backend_play_sound(sound_t *sound, float volume, float pitch) { assert(pitch >= 0.5 && pitch <= 2.0); AL(alSourcef(sound->backend->source, AL_GAIN, volume)); AL(alSourcef(sound->backend->source, AL_PITCH, pitch)); } int sound_backend_iter_sound(sound_t *sound) { ALint nb, i; int size; static char buffer[SAMPLING_BUFFER_SIZE]; ALuint buff; sound_backend_t *b = sound->backend; assert(b->buffers_count <= BUFFERS_NB); AL(alGetSourcei(b->source, AL_BUFFERS_PROCESSED, &nb)); assert(nb <= b->buffers_count); for (i = 0; i < nb; i++) { // If I don't use a temp variable for the buffer name, then I have // some strange bugs on iOS where alSourceUnqueueBuffers modifies the // values of the buffers! buff = b->buffers[b->buffers_start]; AL(alSourceUnqueueBuffers(b->source, 1, &buff)); b->buffers_start = (b->buffers_start + 1) % BUFFERS_NB; b->buffers_count--; } if (b->buffers_count == BUFFERS_NB) return 1; size = sound->source->read(sound->source, buffer, SAMPLING_BUFFER_SIZE); assert(size <= SAMPLING_BUFFER_SIZE); if (size == 0) { return b->buffers_count == 0 ? 0 : 1; } i = (b->buffers_start + b->buffers_count) % BUFFERS_NB; b->buffers_count++; AL(alBufferData(b->buffers[i], b->format, buffer, size, b->rate)); AL(alSourceQueueBuffers(b->source, 1, &b->buffers[i])); if (b->buffers_count == 1) { AL(alSourcePlay(b->source)); } return 1; } void sound_backend_iter(void) { } goxel-0.8.1/src/stack.c000066400000000000000000000045221334742672700147200ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { union { void *p; int i; bool b; }; char type; } astack_entry_t; struct astack { int size; astack_entry_t entries[8]; }; astack_t *stack_create(void) { return calloc(1, sizeof(astack_t)); } void stack_delete(astack_t *s) { free(s); } int stack_size(const astack_t *s) { return s->size; } void stack_clear(astack_t *s) { s->size = 0; } static int fix_i(const astack_t *s, int i) { if (i < 0) i = s->size + i; if (i >= s->size) return -1; return i; } char stack_type(const astack_t *s, int i) { i = fix_i(s, i); if (i < 0) return '\0'; return s->entries[i].type; } void stack_push_i(astack_t *s, int i) { s->entries[s->size++] = (astack_entry_t) {.i = i, .type = 'i'}; } void stack_push_p(astack_t *s, void *p) { s->entries[s->size++] = (astack_entry_t) {.p = p, .type = 'p'}; } void stack_push_b(astack_t *s, bool b) { s->entries[s->size++] = (astack_entry_t) {.b = b, .type = 'b'}; } int stack_get_i(const astack_t *s, int i) { const astack_entry_t *e; i = fix_i(s, i); assert(i >= 0); e = &s->entries[i]; return e->type == 'i' ? e->i : 0; } void *stack_get_p(const astack_t *s, int i) { const astack_entry_t *e; i = fix_i(s, i); assert(i >= 0); e = &s->entries[i]; return e->type == 'p' ? e->p : NULL; } bool stack_get_b(const astack_t *s, int i) { const astack_entry_t *e; i = fix_i(s, i); assert(i >= 0); e = &s->entries[i]; return e->type == 'b' ? e->b : false; } void stack_pop(astack_t *s) { assert(s->size > 0); s->size--; } goxel-0.8.1/src/system.c000066400000000000000000000121371334742672700151400ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include #include #include #include #ifndef PATH_MAX #define PATH_MAX 1024 #endif // The global system instance. sys_callbacks_t sys_callbacks = {}; #if defined(__unix__) && !defined(__EMSCRIPTEN__) #define NOC_FILE_DIALOG_GTK #define NOC_FILE_DIALOG_IMPLEMENTATION #include "noc_file_dialog.h" #include #include static const char *get_user_dir(void *user) { static char *ret = NULL; const char *home; if (!ret) { home = getenv("XDG_CONFIG_HOME"); if (home) { asprintf(&ret, "%s/goxel", home); } else { home = getenv("HOME"); if (!home) home = getpwuid(getuid())->pw_dir; asprintf(&ret, "%s/.config/goxel", home); } } return ret; } static const char *get_clipboard_text(void* user) { GtkClipboard *cb; static gchar *text = NULL; gtk_init_check(NULL, NULL); g_free(text); cb = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); text = gtk_clipboard_wait_for_text(cb); return text; } static void set_clipboard_text(void *user, const char *text) { GtkClipboard *cb; gtk_init_check(NULL, NULL); cb = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); gtk_clipboard_set_can_store(cb, NULL, 0); gtk_clipboard_set_text(cb, text, -1); gtk_clipboard_store(cb); } static void init_unix(void) __attribute__((constructor)); static void init_unix(void) { sys_callbacks.get_user_dir = get_user_dir; sys_callbacks.get_clipboard_text = get_clipboard_text; sys_callbacks.set_clipboard_text = set_clipboard_text; } #endif #ifdef WIN32 #define NOC_FILE_DIALOG_WIN32 #define NOC_FILE_DIALOG_IMPLEMENTATION #include "noc_file_dialog.h" // On mingw mkdir takes only one argument! #define mkdir(p, m) mkdir(p) const char *get_user_dir(void *user) { static char ret[MAX_PATH * 3 + 128] = {0}; wchar_t knownpath_16[MAX_PATH]; HRESULT hResult; if (!ret[0]) { hResult = SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath_16); if (hResult == S_OK) { utf_16_to_8(knownpath_16, ret, MAX_PATH * 3); strcat(ret, "\\Goxel\\"); } } return ret; } static void init_win(void) __attribute__((constructor)); static void init_win(void) { sys_callbacks.get_user_dir = get_user_dir; } #endif void sys_log(const char *msg) { printf("%s\n", msg); fflush(stdout); } // List all the files in a directory. int sys_list_dir(const char *dirpath, int (*callback)(const char *dirpath, const char *name, void *user), void *user) { DIR *dir; struct dirent *dirent; dir = opendir(dirpath); if (!dir) return -1; while ((dirent = readdir(dir))) { if (dirent->d_name[0] == '.') continue; if (callback(dirpath, dirent->d_name, user) != 0) break; } closedir(dir); return 0; } int sys_delete_file(const char *path) { return remove(path); } double sys_get_time(void) { struct timeval now; gettimeofday(&now, NULL); return (double)now.tv_sec + now.tv_usec / 1000000.0; } int sys_make_dir(const char *path) { char tmp[PATH_MAX]; char *p; strcpy(tmp, path); for (p = tmp + 1; *p; p++) { if (*p != '/') continue; *p = '\0'; if ((mkdir(tmp, S_IRWXU) != 0) && (errno != EEXIST)) return -1; *p = '/'; } return 0; } GLuint sys_get_screen_framebuffer(void) { return 0; } void sys_set_window_title(const char *title) { static char buf[1024] = {}; if (strcmp(buf, title) == 0) return; strncpy(buf, title, sizeof(buf)); if (sys_callbacks.set_window_title) sys_callbacks.set_window_title(sys_callbacks.user, title); } /* * Function: sys_get_user_dir * Return the user config directory for goxel * * On linux, this should be $HOME/.config/goxel. */ const char *sys_get_user_dir(void) { if (sys_callbacks.get_user_dir) return sys_callbacks.get_user_dir(sys_callbacks.user); return NULL; } const char *sys_get_clipboard_text(void* user) { if (sys_callbacks.get_clipboard_text) return sys_callbacks.get_clipboard_text(sys_callbacks.user); return NULL; } void sys_set_clipboard_text(void *user, const char *text) { if (sys_callbacks.set_clipboard_text) sys_callbacks.set_clipboard_text(sys_callbacks.user, text); } goxel-0.8.1/src/tests.c000066400000000000000000000134641334742672700147620ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #define TEST(cond) \ do { \ if (!(cond)) { \ LOG_E("Test fail: %s (%s: %d)", __func__, __FILE__, __LINE__); \ exit(-1); \ } \ } while(0) static void test_file(const char *b64_data, uint64_t crc64) { FILE *file; size_t data_size; uint8_t *data; if (DEFINED(WIN32)) return; // Don't test on Windows for the moment! data = calloc(b64_decode(b64_data, NULL), 1); data_size = b64_decode(b64_data, data); file = fopen("/tmp/goxel_test.gox", "w"); fwrite(data, data_size, 1, file); fclose(file); free(data); action_exec2("import", "p", "/tmp/goxel_test.gox"); TEST(mesh_crc64(goxel.image->active_layer->mesh) == crc64); image_delete(goxel.image); goxel.image = image_new(); goxel_update_meshes(-1); } static void test_load_file_v2(void) { // Load a simple file. const char *b64_data = "R09YIAIAAABJTUcgAAAAAAAAAABCTDE2LAEAAIlQTkcNChoKAAAADUlIRFIA" "AABAAAAAQAgGAAAAqmlx3gAAAPNJREFUeF5j/A8EDAwMjAwUgO+MjP85//8n" "14z/A2k/E8MwABQEPgMjJAEwjFjAxDDCAROjyvf/lIYB43cVss0YaPuHRQr4" "z3mH7EJ8tAwY8WXAaACM9FpgNAWMpoCRHQKjLcHRMmC0DBgtA0Z0CIwWgqOF" "4GghOFoIjhaCIzkERmuB0VpgtBYYrQVGa4HRWmAEh8BoNThaDY5Wg6PV4Gg1" "OFoNjlaDIzcERtsBo+2A0XbAaDtgtB0w2g4YbQeMtgNGbAiMNoRGG0KjDaHR" "htBoQ2i0ITTaEBptCI02hEZqCIy2BEdbgqMtwdGW4GhLcCSHAACDDx/OAZLa" "WgAAAABJRU5ErkJgggAAAABMQVlSmgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAQAAABuYW1lCgAAAGJhY2tncm91bmQDAAAAbWF0QAAAAAAAgD8AAAAA" "AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAA" "AAAAAAAAAAAAgD8CAAAAaWQEAAAAAQAAAAcAAABiYXNlX2lkBAAAAAAAAAAA" "AAAA"; test_file(b64_data, 0xb43e7829fd922ed7L); } static void test_load_file_v1_with_preview(void) { // Load a simple file in v1 of goxel format, with embedded preview, // as generated by the mobile version 0.7.1. const char *b64_data = "R09YIAEAAABJTUcgAAAAAAAAAABQUkVWPAUAAIlQTkcNChoKAAAADUlIRFIA" "AACAAAAAgAgGAAAAwz5hywAABQNJREFUeF5jGAWjITAaAqMhMBoCoyEwGgKj" "ITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKj" "ITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKj" "ITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKj" "ITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKj" "ITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKj" "ITAaAqMhMDhCQIeNzT6Yi6t+ND5GYAhU8fPvP6Cl9R+EuyQl9yszMNgPx2Bg" "Hk3dqCGgxsRkP1dO7oG2sLACI1AKhGU4ORU8+PgSvv38yXD99++DwynMGEcT" "ACIEirm59/vJyztghAkjIphOvHt3YObz5w33GBiGRUIYLQGAsa0ELN5nAXO9" "kZiYAjjyQRGOjJFSBKg08BxGpcGITwAhvLz1TYqKC3g5ORkYYJGOpViEVQcg" "moWFhcFCUNBBg4XF4d6XLw/eMzA8HKolKdNIrwL+//7d8O7vX5RgQI5sGBuu" "AJpIOIAJhvHfPwdgADoM5TAc8Qng2Y8fDH137jAcef2agZmZmQGjUYSlOvj6" "5w/Dgrt3Gfa+fDnk8w8LwygAh8CWV68Yrn//zhAqLs4gyMGBNVQYgYnh2b9/" "DAtv3GD4O0zCbcT3AiwZGP4jxyWoURQhL8+gx8sLaQ9CJVnZ2BjWPXzIcPHt" "W5SoP83A4PBuCPcIRnwVwGdpiRKhoJy9FBjRix4/ZvgBbRt8BlYNfRcuYEQ+" "j74+w7sh3h0c8SWAj48PuAT4ePw4wx+03A2qCJxlZBgOP3mCkkjYgNUEj4EB" "A5uEBMPChQuHdBiOtgGgUcsPLAl+AxPAJ2BCgMX2DyBjDzDy2ZGiHxT5Qh4e" "DMMFjCYApJhkFRZmAFUJ327dwigNQMqE3N3BuZ5hGIERPxD09u3bA7Kysgmw" "OGXm4mLgkJUFc0FVAiuQxQks8vltbFAi//fv3wy7d+92+Pr168OhnB5G5wKg" "sWdpablfWFgYZVAHVCWwff7MIGRsjBLHL168OHDmzJkGYOIZ8vMBo3MB0Kh9" "8uTJQhATORGASgNeYGkAGiCCpYB79+4d2Ldvn+P3798fDoeaYDQBIMUiKEeD" "qgQuLi4FEAZJcQAHhUAJAFTk79q1y+H69euNDMMIjFYBOCITViXw8fExvHz5" "8sDevXsdGUbByAoBYHVgr6mpObokbDThj4bAaAiMhsBoCIyGwGgIjIbAaAiM" "hsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiM" "hsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiM" "hsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiM" "hsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiM" "hsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiM" "hsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhsBoCIyGwGgIkBgCADB4" "2BRvDISwAAAAAElFTkSuQmCCAAAAAEJMMTb1AAAAiVBORw0KGgoAAAANSUhE" "UgAAAEAAAABACAYAAACqaXHeAAAAvElEQVR4XmMYBaMhMBoCoyEwGgKjITAa" "AqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKjITAaAqMhMBoCoyEwGgKjITAa" "AqMhMBoCoyEwGgKjITAaAqMhMBoCIz0E/kMBueFAqf7RFDgaAqMhMLAhsI+B" "4T8Ik+sKSvWPxv9oCIyGwGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhsBoCIyG" "wGgIjIbAaAiMhsBoCIyGwGgIjIbAaAiMhgCVQgAAwAEW5Yj9s+cAAAAASUVO" "RK5CYIIAAAAATEFZUpoAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAA" "bmFtZQoAAABiYWNrZ3JvdW5kAwAAAG1hdEAAAAAAAIA/AAAAAAAAAAAAAAAA" "AAAAAAAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAA" "AIA/AgAAAGlkBAAAAAEAAAAHAAAAYmFzZV9pZAQAAAAAAAAAAAAAAA=="; test_file(b64_data, 0x255469049ce34e54L); } static void test_load_corrupt(void) { FILE *file; if (DEFINED(WIN32)) return; // Don't test on Windows for the moment! file = fopen("/tmp/goxel_test.gox", "w"); fclose(file); action_exec2("import", "p", "/tmp/goxel_test.gox"); } void tests_run(void) { test_load_file_v2(); test_load_file_v1_with_preview(); test_load_corrupt(); } goxel-0.8.1/src/texture.c000066400000000000000000000145431334742672700153170ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include // Return the next power of 2 larger or equal to x. static int next_pow2(int x) { x--; x |= x >> 1; x |= x >> 2; x |= x >> 4; x |= x >> 8; x |= x >> 16; x++; return x; } static bool is_pow2(int x) { return x == next_pow2(x); } static void texture_create_empty(texture_t *tex) { assert(tex->flags & TF_HAS_TEX); GL(glGenTextures(1, &tex->tex)); GL(glActiveTexture(GL_TEXTURE0)); GL(glBindTexture(GL_TEXTURE_2D, tex->tex)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); GL(glTexImage2D(GL_TEXTURE_2D, 0, tex->format, tex->tex_w, tex->tex_h, 0, tex->format, GL_UNSIGNED_BYTE, NULL)); } static void blit(const uint8_t *src, int src_w, int src_h, int bpp, uint8_t *dst, int dst_w, int dst_h) { int i, j; for (i = 0; i < src_h; i++) for (j = 0; j < src_w; j++) { memcpy(&dst[(i * dst_w + j) * bpp], &src[(i * src_w + j) * bpp], bpp); } } static void texture_set_data(texture_t *tex, const uint8_t *data, int w, int h, int bpp) { uint8_t *buff0 = NULL; int data_type = GL_UNSIGNED_BYTE; if (!is_pow2(w) || !is_pow2(h)) { buff0 = calloc(bpp, tex->tex_w * tex->tex_h); blit(data, w, h, bpp, buff0, tex->tex_w, tex->tex_h); data = buff0; } GL(glGenTextures(1, &tex->tex)); GL(glActiveTexture(GL_TEXTURE0)); GL(glBindTexture(GL_TEXTURE_2D, tex->tex)); if (!(tex->flags & TF_NEAREST)) { GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (tex->flags & TF_MIPMAP)? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR)); } else { GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); } GL(glTexImage2D(GL_TEXTURE_2D, 0, tex->format, tex->tex_w, tex->tex_h, 0, tex->format, data_type, data)); free(buff0); if (tex->flags & TF_MIPMAP) GL(glGenerateMipmap(GL_TEXTURE_2D)); } texture_t *texture_new_image(const char *path, int flags) { texture_t *tex; uint8_t *img; int w, h, bpp = 0; img = img_read(path, &w, &h, &bpp); if (!img) { LOG_W("Cannot open image '%s'", path); return NULL; } tex = calloc(1, sizeof(*tex)); tex->path = strdup(path); tex->tex_w = next_pow2(w); tex->tex_h = next_pow2(h); tex->w = w; tex->h = h; tex->flags = TF_HAS_TEX | flags; tex->format = (int[]){0, 0, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA}[bpp]; texture_create_empty(tex); texture_set_data(tex, img, w, h, bpp); free(img); tex->ref = 1; return tex; } texture_t *texture_new_from_buf(const uint8_t *data, int w, int h, int bpp, int flags) { texture_t *tex; tex = calloc(1, sizeof(*tex)); tex->tex_w = next_pow2(w); tex->tex_h = next_pow2(h); tex->w = w; tex->h = h; tex->flags = TF_HAS_TEX | flags; tex->format = (int[]){0, 0, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA}[bpp]; texture_create_empty(tex); texture_set_data(tex, data, w, h, bpp); tex->ref = 1; return tex; } texture_t *texture_new_surface(int w, int h, int flags) { texture_t *tex; tex = calloc(1, sizeof(*tex)); tex->tex_w = next_pow2(w); tex->tex_h = next_pow2(h); tex->w = w; tex->h = h; tex->flags = flags | TF_HAS_TEX; tex->format = (flags & TF_RGB) ? GL_RGB : GL_RGBA; texture_create_empty(tex); tex->ref = 1; return tex; } texture_t *texture_new_buffer(int w, int h, int flags) { texture_t *tex; tex = calloc(1, sizeof(*tex)); tex->format = (flags & TF_RGB) ? GL_RGB : GL_RGBA; tex->tex_w = next_pow2(w); tex->tex_h = next_pow2(h); tex->w = w; tex->h = h; tex->flags = flags | TF_HAS_FB | TF_HAS_TEX; gl_gen_fbo(tex->tex_w, tex->tex_h, tex->format, 1, &tex->framebuffer, &tex->tex); tex->ref = 1; return tex; } void texture_delete(texture_t *tex) { if (!tex) return; tex->ref--; if (tex->ref > 0) return; free(tex->path); if (tex->framebuffer) { GL(glBindFramebuffer(GL_FRAMEBUFFER, tex->framebuffer)); if (tex->depth) GL(glDeleteRenderbuffers(1, &tex->depth)); if (tex->stencil) GL(glDeleteRenderbuffers(1, &tex->stencil)); GL(glDeleteFramebuffers(1, &tex->framebuffer)); } if (tex->tex) GL(glDeleteTextures(1, &tex->tex)); free(tex); } texture_t *texture_copy(texture_t *tex) { // XXX: since texture are immutable, we just increase the ref counter. if (tex) tex->ref++; return tex; } void texture_get_data(const texture_t *tex, int w, int h, int bpp, uint8_t *buf) { uint8_t *tmp; size_t i, j; tmp = calloc(w * h, 4); GL(glBindFramebuffer(GL_FRAMEBUFFER, tex->framebuffer)); GL(glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, tmp)); // Flip output y and remove alpha if needed. for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { memcpy(&buf[(i * w + j) * bpp], &tmp[((h - i - 1) * w + j) * 4], bpp); } } free(tmp); } void texture_save_to_file(const texture_t *tex, const char *path) { uint8_t *data; int w, h; LOG_I("save texture to %s", path); w = tex->tex_w; h = tex->tex_h; data = calloc(w * h, 4); texture_get_data(tex, w, h, 4, data); img_write(data, w, h, 4, path); free(data); } goxel-0.8.1/src/theme.c000066400000000000000000000147601334742672700147220ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include "ini.h" theme_group_info_t THEME_GROUP_INFOS[THEME_GROUP_COUNT] = { [THEME_GROUP_BASE] = { .name = "base", .colors = { [THEME_COLOR_BACKGROUND] = true, [THEME_COLOR_OUTLINE] = true, [THEME_COLOR_INNER] = true, [THEME_COLOR_INNER_SELECTED] = true, [THEME_COLOR_TEXT] = true, [THEME_COLOR_TEXT_SELECTED] = true, }, }, [THEME_GROUP_WIDGET] = { .name = "widget", .parent = THEME_GROUP_BASE, .colors = { [THEME_COLOR_OUTLINE] = true, [THEME_COLOR_INNER] = true, [THEME_COLOR_INNER_SELECTED] = true, [THEME_COLOR_TEXT] = true, [THEME_COLOR_TEXT_SELECTED] = true, }, }, [THEME_GROUP_TAB] = { .name = "tab", .parent = THEME_GROUP_BASE, .colors = { [THEME_COLOR_BACKGROUND] = true, [THEME_COLOR_INNER] = true, [THEME_COLOR_INNER_SELECTED] = true, [THEME_COLOR_TEXT] = true, [THEME_COLOR_TEXT_SELECTED] = true, }, }, [THEME_GROUP_MENU] = { .name = "menu", .parent = THEME_GROUP_BASE, .colors = { [THEME_COLOR_BACKGROUND] = true, [THEME_COLOR_INNER] = true, [THEME_COLOR_TEXT] = true, }, }, }; theme_color_info_t THEME_COLOR_INFOS[THEME_COLOR_COUNT] = { [THEME_COLOR_BACKGROUND] = {.name = "background"}, [THEME_COLOR_OUTLINE] = {.name = "outline"}, [THEME_COLOR_INNER] = {.name = "inner"}, [THEME_COLOR_INNER_SELECTED] = {.name = "inner_selected"}, [THEME_COLOR_TEXT] = {.name = "text"}, [THEME_COLOR_TEXT_SELECTED] = {.name = "text_selected"}, }; static theme_t g_base_theme = { .name = "Unamed", .sizes = { .item_height = 18, .icons_height = 32, .icons_button_size = 32, .item_padding_h = 4, .item_rounding = 4, .item_spacing_h = 4, .item_spacing_v = 4, .item_inner_spacing_h = 6, }, }; static theme_t *g_themes = NULL; // List of all the themes. static theme_t g_theme = {}; // Current theme. static uint32_t tohex(const uint8_t c[4]) { return (int)c[0] << 24 | (int)c[1] << 16 | (int)c[2] << 8 | (int)c[3] << 0; } static void parse_color(const char *s, uint8_t out[4]) { uint32_t v; v = strtoul(s + 1, NULL, 16); out[0] = (v >> 24) & 0xff; out[1] = (v >> 16) & 0xff; out[2] = (v >> 8) & 0xff; out[3] = (v >> 0) & 0xff; } static int theme_ini_handler(void *user, const char *section, const char *name, const char *value, int lineno) { theme_t *theme = user; int group, i; if (strcmp(section, "theme") == 0) { if (strcmp(name, "name") == 0) strncpy(theme->name, value, sizeof(theme->name) - 1); } for (group = 0; group < THEME_GROUP_COUNT; group++) { if (strcmp(section, THEME_GROUP_INFOS[group].name) != 0) continue; for (i = 0; i < THEME_COLOR_COUNT; i++) { if (strcmp(name, THEME_COLOR_INFOS[i].name) == 0) { parse_color(value, theme->groups[group].colors[i]); } } } return 0; } static int on_theme(int i, const char *path, void *user) { const char *data; theme_t *theme = calloc(1, sizeof(*theme)); *theme = g_base_theme; data = assets_get(path, NULL); ini_parse_string(data, theme_ini_handler, theme); DL_APPEND(g_themes, theme); if (strcmp(theme->name, GOXEL_DEFAULT_THEME) == 0) g_theme = *theme; return 0; } static int on_theme2(const char *dir, const char *name, void *user) { char *data, *path; asprintf(&path, "%s/%s", dir, name); theme_t *theme = calloc(1, sizeof(*theme)); *theme = g_base_theme; data = read_file(path, NULL); ini_parse_string(data, theme_ini_handler, theme); DL_APPEND(g_themes, theme); free(path); free(data); return 0; } static void themes_init(void) { // Load all the themes. char *dir; assets_list("data/themes/", NULL, on_theme); asprintf(&dir, "%s/themes", sys_get_user_dir()); sys_list_dir(dir, on_theme2, NULL); free(dir); } theme_t *theme_get(void) { if (!g_themes) themes_init(); return &g_theme; } theme_t *theme_get_list(void) { if (!g_themes) themes_init(); return g_themes; } void theme_set(const char *name) { theme_t *theme; if (!g_themes) themes_init(); DL_FOREACH(g_themes, theme) { if (strcmp(theme->name, name) == 0) g_theme = *theme; } } void theme_revert_default(void) { theme_t *theme; DL_FOREACH(g_themes, theme) { if (strcmp(theme->name, "default") == 0) g_theme = *theme; } } void theme_save(void) { char *path; FILE *file; const theme_t *t = &g_theme; int group, i; asprintf(&path, "%s/themes/default.ini", sys_get_user_dir()); sys_make_dir(path); file = fopen(path, "w"); fprintf(file, "[sizes]\n"); #define X(n) \ fprintf(file, #n "=%d\n", t->sizes.n); THEME_SIZES(X) #undef X for (group = 0; group < THEME_GROUP_COUNT; group++) { fprintf(file, "\n"); fprintf(file, "[%s]\n", THEME_GROUP_INFOS[group].name); for (i = 0; i < THEME_COLOR_COUNT; i++) { if (!t->groups[group].colors[i][3]) continue; fprintf(file, "%s=#%X\n", THEME_COLOR_INFOS[i].name, tohex( t->groups[group].colors[i])); } } fclose(file); free(path); } void theme_get_color(int g, int color, bool sel, uint8_t out[4]) { const theme_t *theme = theme_get(); if (sel) color++; while (g && !theme->groups[g].colors[color][3]) g = THEME_GROUP_INFOS[g].parent; memcpy(out, theme->groups[g].colors[color], 4); } goxel-0.8.1/src/theme.h000066400000000000000000000067611334742672700147310ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #ifndef THEME_H #define THEME_H #include #include /* * Section: Theme * * Theme structures and functions used to set goxel ui colors. * The theme is split into groups representing different part of the gui: * the widgets, the tab, the menus, etc. * * For each group we can specify a set of colors: * - Background * - Outline * - Inner * - Inner selected * - Text * - Text selected * * If a color is not set in a group, we can get it from its parent group. * * The theme also keep track of the item sizes, but this is not supposed to * be editable so the code is a bit different. */ /* * Enum: THEME_GROUP * Enum all the theme elements groups. */ enum { THEME_GROUP_BASE, THEME_GROUP_WIDGET, THEME_GROUP_TAB, THEME_GROUP_MENU, THEME_GROUP_COUNT }; /* * Enum: THEME_COLOR * Enum of all the theme colors. */ enum { THEME_COLOR_BACKGROUND, THEME_COLOR_OUTLINE, THEME_COLOR_INNER, THEME_COLOR_INNER_SELECTED, THEME_COLOR_TEXT, THEME_COLOR_TEXT_SELECTED, THEME_COLOR_COUNT }; /* * Type: theme_group_info_t * Informations about a given theme group, that can be used for a theme * editor. * * Attributes: * name - Name of this group (id). * parent - Index of the parent group. * colors - Bool array of all the colors we can set in this group. */ typedef struct { const char *name; int parent; bool colors[THEME_COLOR_COUNT]; } theme_group_info_t; extern theme_group_info_t THEME_GROUP_INFOS[THEME_GROUP_COUNT]; /* * Type: theme_color_info_t * Informations about a given theme color type, that can be used for a theme * editor. * * Attributes: * name - Name of this color (id). */ typedef struct { const char *name; } theme_color_info_t; extern theme_color_info_t THEME_COLOR_INFOS[THEME_COLOR_COUNT]; /* * Type: theme_group_t * Contains all the colors set for a given group. */ typedef struct { uint8_t colors[THEME_COLOR_COUNT][4]; } theme_group_t; /* * Macro: THEME_SIZES * X macro to list all the themes size attributes. */ #define THEME_SIZES(X) \ X(item_height) \ X(icons_height) \ X(icons_button_size) \ X(item_padding_h) \ X(item_rounding) \ X(item_spacing_h) \ X(item_spacing_v) \ X(item_inner_spacing_h) typedef struct theme theme_t; struct theme { char name[64]; struct { #define X(attr) int attr; THEME_SIZES(X) #undef X } sizes; theme_group_t groups[THEME_GROUP_COUNT]; theme_t *prev, *next; // Global list of themes. }; // Return the current theme. theme_t *theme_get(void); theme_t *theme_get_list(void); void theme_revert_default(void); void theme_save(void); void theme_get_color(int group, int color, bool selected, uint8_t out[4]); void theme_set(const char *name); #endif // THEME_H goxel-0.8.1/src/tools.c000066400000000000000000000133671334742672700147620ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" static int tool_set_action(const action_t *a, astack_t *s) { if (goxel.tool_mesh) { mesh_delete(goxel.tool_mesh); goxel.tool_mesh = NULL; goxel_update_meshes(MESH_LAYERS); } goxel.tool = (tool_t*)a->data; return 0; } void tool_register_(const tool_t *tool) { action_t action; action = (action_t) { .id = tool->action_id, .default_shortcut = tool->default_shortcut, .help = "set tool", .func = tool_set_action, .data = (void*)tool, .flags = ACTION_CAN_EDIT_SHORTCUT, }; action_register(&action); } static int pick_color_gesture(gesture3d_t *gest, void *user) { cursor_t *curs = &goxel.cursor; mesh_t *mesh = goxel.layers_mesh; int pi[3] = {floor(curs->pos[0]), floor(curs->pos[1]), floor(curs->pos[2])}; uint8_t color[4]; curs->snap_mask = SNAP_MESH; curs->snap_offset = -0.5; goxel_set_help_text("Click on a voxel to pick the color"); if (!curs->snaped) return 0; mesh_get_at(mesh, NULL, pi, color); color[3] = 255; goxel_set_help_text("pick: %d %d %d", color[0], color[1], color[2]); if (curs->flags & CURSOR_PRESSED) vec4_copy(color, goxel.painter.color); return 0; } static gesture3d_t g_pick_color_gesture = { .type = GESTURE_HOVER, .callback = pick_color_gesture, .buttons = CURSOR_CTRL, }; int tool_iter(tool_t *tool, const float viewport[4]) { assert(tool); if ( (tool->flags & TOOL_REQUIRE_CAN_EDIT) && !image_layer_can_edit(goxel.image, goxel.image->active_layer)) { goxel_set_help_text("Cannot edit this layer"); return 0; } tool->state = tool->iter_fn(tool, viewport); if (tool->flags & TOOL_ALLOW_PICK_COLOR) gesture3d(&g_pick_color_gesture, &goxel.cursor, NULL); return tool->state; } int tool_gui(tool_t *tool) { if (!tool->gui_fn) return 0; return tool->gui_fn(tool); } static bool snap_button(const char *label, int s, float w) { bool v = goxel.snap_mask & s; if (gui_selectable(label, &v, NULL, w)) { set_flag(&goxel.snap_mask, s, v); return true; } return false; } int tool_gui_snap(void) { float w, v; gui_text("Snap on"); w = gui_get_avail_width() / 2.0 - 1; gui_group_begin(NULL); snap_button("Mesh", SNAP_MESH, w); gui_same_line(); snap_button("Plane", SNAP_PLANE, w); if (!box_is_null(goxel.selection)) { snap_button("Sel In", SNAP_SELECTION_IN, w); gui_same_line(); snap_button("Sel out", SNAP_SELECTION_OUT, w); } if (!box_is_null(goxel.image->box)) snap_button("Image box", SNAP_IMAGE_BOX, -1); v = goxel.snap_offset; if (gui_input_float("Offset", &v, 0.1, -1, +1, "%.1f")) goxel.snap_offset = clamp(v, -1, +1); gui_group_end(); return 0; } // XXX: replace this. static void auto_grid(int nb, int i, int col) { if ((i + 1) % col != 0) gui_same_line(); } int tool_gui_shape(void) { struct { const char *name; shape_t *shape; int icon; } shapes[] = { {"Sphere", &shape_sphere, ICON_SHAPE_SPHERE}, {"Cube", &shape_cube, ICON_SHAPE_CUBE}, {"Cylinder", &shape_cylinder, ICON_SHAPE_CYLINDER}, }; int i; bool v; gui_text("Shape"); gui_group_begin(NULL); for (i = 0; i < (int)ARRAY_SIZE(shapes); i++) { v = goxel.painter.shape == shapes[i].shape; if (gui_selectable_icon(shapes[i].name, &v, shapes[i].icon)) { goxel.painter.shape = shapes[i].shape; } auto_grid(ARRAY_SIZE(shapes), i, 4); } gui_group_end(); return 0; } int tool_gui_radius(void) { int i; i = goxel.tool_radius * 2; if (gui_input_int("Size", &i, 1, 128)) { i = clamp(i, 1, 128); goxel.tool_radius = i / 2.0; } return 0; } int tool_gui_smoothness(void) { bool s; s = goxel.painter.smoothness; if (gui_checkbox("Antialiased", &s, NULL)) { goxel.painter.smoothness = s ? 1 : 0; } return 0; } int tool_gui_color(void) { int alpha = goxel.painter.color[3]; gui_text("Color"); gui_color("##color", goxel.painter.color); if (goxel.painter.mode == MODE_PAINT) { if (gui_input_int("Alpha", &alpha, 0, 255)) goxel.painter.color[3] = alpha; } else { goxel.painter.color[3] = 255; } return 0; } int tool_gui_symmetry(void) { float w; int i; bool v; const char *labels_u[] = {"X", "Y", "Z"}; const char *labels_l[] = {"x", "y", "z"}; w = gui_get_avail_width() / 3.0 - 1; gui_group_begin("Symmetry"); for (i = 0; i < 3; i++) { v = (goxel.painter.symmetry >> i) & 0x1; if (gui_selectable(labels_u[i], &v, NULL, w)) set_flag(&goxel.painter.symmetry, 1 << i, v); if (i < 2) gui_same_line(); } for (i = 0; i < 3; i++) { gui_input_float(labels_l[i], &goxel.painter.symmetry_origin[i], 0.5, -FLT_MAX, +FLT_MAX, "%.1f"); } gui_group_end(); return 0; } goxel-0.8.1/src/tools/000077500000000000000000000000001334742672700146045ustar00rootroot00000000000000goxel-0.8.1/src/tools/brush.c000066400000000000000000000170061334742672700160770ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { tool_t tool; mesh_t *mesh_orig; // Original mesh. mesh_t *mesh; // Mesh containing only the tool path. // Gesture start and last pos (should we put it in the 3d gesture?) float start_pos[3]; float last_pos[3]; // Cache of the last operation. // XXX: could we remove this? struct { float pos[3]; bool pressed; int mode; uint64_t mesh_key; } last_op; struct { gesture3d_t drag; gesture3d_t hover; } gestures; } tool_brush_t; static bool check_can_skip(tool_brush_t *brush, const cursor_t *curs, int mode) { mesh_t *mesh = goxel.tool_mesh; const bool pressed = curs->flags & CURSOR_PRESSED; if ( pressed == brush->last_op.pressed && mode == brush->last_op.mode && brush->last_op.mesh_key == mesh_get_key(mesh) && vec3_equal(curs->pos, brush->last_op.pos)) { return true; } brush->last_op.pressed = pressed; brush->last_op.mode = mode; brush->last_op.mesh_key = mesh_get_key(mesh); vec3_copy(curs->pos, brush->last_op.pos); return false; } static void get_box(const float p0[3], const float p1[3], const float n[3], float r, const float plane[4][4], float out[4][4]) { float rot[4][4], box[4][4]; float v[3]; if (p1 == NULL) { bbox_from_extents(box, p0, r, r, r); box_swap_axis(box, 2, 0, 1, box); mat4_copy(box, out); return; } if (r == 0) { bbox_from_points(box, p0, p1); bbox_grow(box, 0.5, 0.5, 0.5, box); // Apply the plane rotation. mat4_copy(plane, rot); vec4_set(rot[3], 0, 0, 0, 1); mat4_imul(box, rot); mat4_copy(box, out); return; } // Create a box for a line: int i; const float AXES[][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; mat4_set_identity(box); vec3_mix(p0, p1, 0.5, box[3]); vec3_sub(p1, box[3], box[2]); for (i = 0; i < 3; i++) { vec3_cross(box[2], AXES[i], box[0]); if (vec3_norm2(box[0]) > 0) break; } if (i == 3) { mat4_copy(box, out); return; } vec3_normalize(box[0], v); vec3_mul(v, r, box[0]); vec3_cross(box[2], box[0], v); vec3_normalize(v, v); vec3_mul(v, r, box[1]); mat4_copy(box, out); } static int on_drag(gesture3d_t *gest, void *user) { tool_brush_t *brush = (tool_brush_t*)user; painter_t painter2; float box[4][4]; cursor_t *curs = gest->cursor; bool shift = curs->flags & CURSOR_SHIFT; float r = goxel.tool_radius; int nb, i; float pos[3]; if (gest->state == GESTURE_BEGIN) { mesh_set(brush->mesh_orig, goxel.image->active_layer->mesh); brush->last_op.mode = 0; // Discard last op. vec3_copy(curs->pos, brush->last_pos); image_history_push(goxel.image); mesh_clear(brush->mesh); if (shift) { painter2 = goxel.painter; painter2.shape = &shape_cylinder; painter2.mode = MODE_MAX; get_box(brush->start_pos, curs->pos, curs->normal, r, NULL, box); mesh_op(brush->mesh, &painter2, box); } } if ( (gest->state == GESTURE_UPDATE) && (check_can_skip(brush, curs, goxel.painter.mode))) { return 0; } painter2 = goxel.painter; painter2.mode = MODE_MAX; vec4_set(painter2.color, 255, 255, 255, 255); // Render several times if the space between the current pos // and the last pos is larger than the size of the tool shape. nb = ceil(vec3_dist(curs->pos, brush->last_pos) / (2 * r)); nb = max(nb, 1); for (i = 0; i < nb; i++) { vec3_mix(brush->last_pos, curs->pos, (i + 1.0) / nb, pos); get_box(pos, NULL, curs->normal, r, NULL, box); mesh_op(brush->mesh, &painter2, box); } if (!goxel.tool_mesh) goxel.tool_mesh = mesh_new(); mesh_set(goxel.tool_mesh, brush->mesh_orig); mesh_merge(goxel.tool_mesh, brush->mesh, goxel.painter.mode, goxel.painter.color); goxel_update_meshes(MESH_RENDER); vec3_copy(curs->pos, brush->start_pos); brush->last_op.mesh_key = mesh_get_key(goxel.tool_mesh); if (gest->state == GESTURE_END) { mesh_set(goxel.image->active_layer->mesh, goxel.tool_mesh); mesh_set(brush->mesh_orig, goxel.tool_mesh); mesh_delete(goxel.tool_mesh); goxel.tool_mesh = NULL; goxel_update_meshes(-1); } vec3_copy(curs->pos, brush->last_pos); return 0; } static int on_hover(gesture3d_t *gest, void *user) { mesh_t *mesh = goxel.image->active_layer->mesh; tool_brush_t *brush = (tool_brush_t*)user; cursor_t *curs = gest->cursor; float box[4][4]; bool shift = curs->flags & CURSOR_SHIFT; if (gest->state == GESTURE_END) { mesh_delete(goxel.tool_mesh); goxel.tool_mesh = NULL; goxel_update_meshes(MESH_RENDER); return 0; } if (shift) render_line(&goxel.rend, brush->start_pos, curs->pos, NULL); if (goxel.tool_mesh && check_can_skip(brush, curs, goxel.painter.mode)) return 0; get_box(curs->pos, NULL, curs->normal, goxel.tool_radius, NULL, box); if (!goxel.tool_mesh) goxel.tool_mesh = mesh_new(); mesh_set(goxel.tool_mesh, mesh); mesh_op(goxel.tool_mesh, &goxel.painter, box); goxel_update_meshes(MESH_RENDER); brush->last_op.mesh_key = mesh_get_key(mesh); return 0; } static int iter(tool_t *tool, const float viewport[4]) { tool_brush_t *brush = (tool_brush_t*)tool; cursor_t *curs = &goxel.cursor; // XXX: for the moment we force rounded positions for the brush tool // to make things easier. curs->snap_mask |= SNAP_ROUNDED; if (!brush->mesh_orig) brush->mesh_orig = mesh_copy(goxel.image->active_layer->mesh); if (!brush->mesh) brush->mesh = mesh_new(); if (!brush->gestures.drag.type) { brush->gestures.drag = (gesture3d_t) { .type = GESTURE_DRAG, .callback = on_drag, }; brush->gestures.hover = (gesture3d_t) { .type = GESTURE_HOVER, .callback = on_hover, }; } curs->snap_offset = goxel.snap_offset * goxel.tool_radius + ((goxel.painter.mode == MODE_OVER) ? 0.5 : -0.5); gesture3d(&brush->gestures.hover, curs, brush); gesture3d(&brush->gestures.drag, curs, brush); return tool->state; } static int gui(tool_t *tool) { tool_gui_radius(); tool_gui_smoothness(); tool_gui_snap(); tool_gui_shape(); tool_gui_symmetry(); return 0; } TOOL_REGISTER(TOOL_BRUSH, brush, tool_brush_t, .iter_fn = iter, .gui_fn = gui, .flags = TOOL_REQUIRE_CAN_EDIT | TOOL_ALLOW_PICK_COLOR, .default_shortcut = "B" ) goxel-0.8.1/src/tools/color_picker.c000066400000000000000000000032641334742672700174300ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { tool_t tool; } tool_pick_color_t; int tool_color_picker_iter(tool_t *tool, const float viewport[4]) { uint8_t color[4]; mesh_t *mesh = goxel.layers_mesh; cursor_t *curs = &goxel.cursor; int pi[3] = {floor(curs->pos[0]), floor(curs->pos[1]), floor(curs->pos[2])}; curs->snap_mask = SNAP_MESH; curs->snap_offset = -0.5; goxel_set_help_text("Click on a voxel to pick the color"); if (!curs->snaped) return 0; mesh_get_at(mesh, NULL, pi, color); color[3] = 255; goxel_set_help_text("%d %d %d", color[0], color[1], color[2]); if (curs->flags & CURSOR_PRESSED) vec4_copy(color, goxel.painter.color); return 0; } static int gui(tool_t *tool) { tool_gui_color(); return 0; } TOOL_REGISTER(TOOL_PICK_COLOR, pick_color, tool_pick_color_t, .iter_fn = tool_color_picker_iter, .gui_fn = gui, .default_shortcut = "C", ) goxel-0.8.1/src/tools/extrude.c000066400000000000000000000125341334742672700164350ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { tool_t tool; mesh_t *mesh_orig; mesh_t *mesh; int snap_face; int last_delta; struct { gesture3d_t drag; } gestures; } tool_extrude_t; static int select_cond(const uint8_t value[4], const uint8_t neighboors[6][4], const uint8_t mask[6], void *user) { int i, snap_face = *((int*)user); int opp_face = ((int[6]){1, 0, 3, 2, 5, 4})[snap_face]; if (value[3] == 0) return 0; if (neighboors[snap_face][3]) return 0; for (i = 0; i < 6; i++) { if (i == snap_face || i == opp_face) continue; if (mask[i]) return 255; } return 0; } // Get the face index from the normal. // XXX: used in a few other places! static int get_face(const float n[3]) { int f; const int *n2; for (f = 0; f < 6; f++) { n2 = FACES_NORMALS[f]; if (vec3_dot(n, VEC(n2[0], n2[1], n2[2])) > 0.5) return f; } return -1; } // XXX: this code is just too ugly. Needs a lot of cleanup. // The problem is that we should use some generic functions to handle // box resize, since we do it a lot, and the code is never very clear. static int on_drag(gesture3d_t *gest, void *user) { tool_extrude_t *tool = (tool_extrude_t*)user; mesh_t *mesh = goxel.image->active_layer->mesh; mesh_t *tmp_mesh; cursor_t *curs = gest->cursor; float face_plane[4][4]; float n[3], pos[3], v[3], box[4][4]; int pi[3]; float delta; if (gest->state == GESTURE_BEGIN) { tool->snap_face = get_face(curs->normal); tmp_mesh = mesh_new(); tool->mesh = mesh_copy(mesh); pi[0] = floor(curs->pos[0]); pi[1] = floor(curs->pos[1]); pi[2] = floor(curs->pos[2]); mesh_select(mesh, pi, select_cond, &tool->snap_face, tmp_mesh); mesh_merge(tool->mesh, tmp_mesh, MODE_MULT_ALPHA, NULL); mesh_delete(tmp_mesh); mesh_set(tool->mesh_orig, mesh); image_history_push(goxel.image); // XXX: to remove: this is duplicated from selection tool. mesh_get_box(tool->mesh, true, box); mat4_mul(box, FACES_MATS[tool->snap_face], face_plane); vec3_normalize(face_plane[0], v); plane_from_vectors(goxel.tool_plane, curs->pos, curs->normal, v); tool->last_delta = 0; } mesh_get_box(tool->mesh, true, box); // XXX: have some generic way to resize boxes, since we use it all the // time! mat4_mul(box, FACES_MATS[tool->snap_face], face_plane); vec3_normalize(face_plane[2], n); // XXX: Is there a better way to compute the delta?? vec3_sub(curs->pos, goxel.tool_plane[3], v); vec3_project(v, n, v); delta = vec3_dot(n, v); // render_box(&goxel.rend, &box, NULL, EFFECT_WIREFRAME); // Skip if we didn't move. if (round(delta) == tool->last_delta) goto end; tool->last_delta = round(delta); vec3_sub(curs->pos, goxel.tool_plane[3], v); vec3_project(v, n, v); vec3_add(goxel.tool_plane[3], v, pos); pos[0] = round(pos[0]); pos[1] = round(pos[1]); pos[2] = round(pos[2]); mesh_set(mesh, tool->mesh_orig); tmp_mesh = mesh_copy(tool->mesh); if (delta >= 1) { vec3_iaddk(face_plane[3], n, -0.5); box_move_face(box, tool->snap_face, pos, box); mesh_extrude(tmp_mesh, face_plane, box); mesh_merge(mesh, tmp_mesh, MODE_OVER, NULL); } if (delta < 0.5) { box_move_face(box, FACES_OPPOSITES[tool->snap_face], pos, box); vec3_imul(face_plane[2], -1.0); vec3_iaddk(face_plane[3], n, -0.5); mesh_extrude(tmp_mesh, face_plane, box); mesh_merge(mesh, tmp_mesh, MODE_SUB, NULL); } mesh_delete(tmp_mesh); goxel_update_meshes(MESH_RENDER); end: if (gest->state == GESTURE_END) { mesh_delete(tool->mesh); mat4_copy(plane_null, goxel.tool_plane); goxel_update_meshes(-1); } return 0; } static int iter(tool_t *tool_, const float viewport[4]) { tool_extrude_t *tool = (tool_extrude_t*)tool_; cursor_t *curs = &goxel.cursor; curs->snap_offset = -0.5; curs->snap_mask &= ~SNAP_ROUNDED; if (!tool->mesh_orig) tool->mesh_orig = mesh_new(); if (!tool->gestures.drag.type) { tool->gestures.drag = (gesture3d_t) { .type = GESTURE_DRAG, .callback = on_drag, }; } gesture3d(&tool->gestures.drag, curs, tool); return 0; } static int gui(tool_t *tool) { return 0; } TOOL_REGISTER(TOOL_EXTRUDE, extrude, tool_extrude_t, .iter_fn = iter, .gui_fn = gui, .flags = TOOL_REQUIRE_CAN_EDIT, ) goxel-0.8.1/src/tools/laser.c000066400000000000000000000060651334742672700160650ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { tool_t tool; float box[4][4]; struct { gesture3d_t drag; gesture3d_t hover; } gestures; } tool_laser_t; static int on_drag(gesture3d_t *gest, void *user) { tool_laser_t *laser = (tool_laser_t*)user; mesh_t *mesh = goxel.image->active_layer->mesh; painter_t painter = goxel.painter; painter.mode = MODE_SUB_CLAMP; painter.shape = &shape_cylinder; vec4_set(painter.color, 255, 255, 255, 255); if (gest->state == GESTURE_BEGIN) image_history_push(goxel.image); mesh_op(mesh, &painter, laser->box); goxel_update_meshes(MESH_RENDER); if (gest->state == GESTURE_END) goxel_update_meshes(-1); return 0; } static int iter(tool_t *tool, const float viewport[4]) { tool_laser_t *laser = (tool_laser_t*)tool; cursor_t *curs = &goxel.cursor; curs->snap_mask = SNAP_CAMERA; curs->snap_offset = 0; float v[4]; float view_mat_inv[4][4]; if (!laser->gestures.drag.type) { laser->gestures.drag = (gesture3d_t) { .type = GESTURE_DRAG, .callback = on_drag, }; } if (curs->snaped & SNAP_CAMERA) { // Create the tool box from the camera along the visible ray. mat4_set_identity(laser->box); mat4_invert(goxel.camera.view_mat, view_mat_inv); mat4_mul_vec4(view_mat_inv, VEC(1, 0, 0, 0), v); vec3_copy(v, laser->box[0]); mat4_mul_vec4(view_mat_inv, VEC(0, 1, 0, 0), v); vec3_copy(v, laser->box[1]); mat4_mul_vec4(view_mat_inv, VEC(0, 0, 1, 0), v); vec3_copy(v, laser->box[2]); vec3_neg(curs->normal, laser->box[2]); vec3_copy(curs->pos, laser->box[3]); // Just a large value for the size of the laser box. mat4_itranslate(laser->box, 0, 0, -1024); mat4_iscale(laser->box, goxel.tool_radius, goxel.tool_radius, 1024); render_box(&goxel.rend, laser->box, NULL, EFFECT_WIREFRAME); } gesture3d(&laser->gestures.drag, curs, laser); return tool->state; } static int gui(tool_t *tool) { tool_gui_radius(); tool_gui_smoothness(); tool_gui_symmetry(); return 0; } TOOL_REGISTER(TOOL_LASER, laser, tool_laser_t, .iter_fn = iter, .gui_fn = gui, .flags = TOOL_REQUIRE_CAN_EDIT, .default_shortcut = "L", ) goxel-0.8.1/src/tools/move.c000066400000000000000000000135341334742672700157240ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { tool_t tool; float box[4][4]; int snap_face; struct { gesture3d_t move; } gestures; } tool_move_t; static void do_move(layer_t *layer, const float mat[4][4]) { float m[4][4]; mat4_set_identity(m); // Change referential to the mesh origin. // XXX: maybe this should be done in mesh_move directy?? mat4_itranslate(m, -0.5, -0.5, -0.5); mat4_imul(m, mat); mat4_itranslate(m, +0.5, +0.5, +0.5); if (layer->base_id || layer->image) { mat4_mul(mat, layer->mat, layer->mat); layer->base_mesh_key = 0; } else { mesh_move(layer->mesh, m); if (!box_is_null(layer->box)) { mat4_mul(mat, layer->box, layer->box); box_get_bbox(layer->box, layer->box); } } goxel_update_meshes(-1); } // Get the face index from the normal. // XXX: used in a few other places! static int get_face(const float n[3]) { int f; const int *n2; for (f = 0; f < 6; f++) { n2 = FACES_NORMALS[f]; if (vec3_dot(n, VEC(n2[0], n2[1], n2[2])) > 0.5) return f; } return -1; } static int on_move(gesture3d_t *gest, void *user) { float face_plane[4][4]; cursor_t *curs = gest->cursor; tool_move_t *tool = user; float n[3], pos[3], d[3], ofs[3], v[3]; layer_t *layer = goxel.image->active_layer; float mat[4][4]; if (box_is_null(tool->box)) return GESTURE_FAILED; if (gest->type == GESTURE_HOVER) { goxel_set_help_text("Drag to move face"); if (curs->snaped != SNAP_LAYER_OUT) return GESTURE_FAILED; tool->snap_face = get_face(curs->normal); curs->snap_offset = 0; curs->snap_mask &= ~SNAP_ROUNDED; mat4_mul(tool->box, FACES_MATS[tool->snap_face], face_plane); render_img(&goxel.rend, NULL, face_plane, EFFECT_NO_SHADING); if (curs->flags & CURSOR_PRESSED) { gest->type = GESTURE_DRAG; vec3_normalize(face_plane[0], v); plane_from_vectors(goxel.tool_plane, curs->pos, curs->normal, v); image_history_push(goxel.image); } return 0; } if (gest->type == GESTURE_DRAG) { goxel_set_help_text("Drag to move face"); curs->snap_offset = 0; curs->snap_mask &= ~SNAP_ROUNDED; mat4_mul(tool->box, FACES_MATS[tool->snap_face], face_plane); vec3_normalize(face_plane[2], n); vec3_sub(curs->pos, goxel.tool_plane[3], v); vec3_project(v, n, v); vec3_add(goxel.tool_plane[3], v, pos); pos[0] = round(pos[0]); pos[1] = round(pos[1]); pos[2] = round(pos[2]); vec3_add(tool->box[3], face_plane[2], d); vec3_sub(pos, d, ofs); vec3_project(ofs, n, ofs); mat4_set_identity(mat); mat4_itranslate(mat, ofs[0], ofs[1], ofs[2]); do_move(layer, mat); if (gest->state == GESTURE_END) { gest->type = GESTURE_HOVER; mat4_copy(plane_null, goxel.tool_plane); } return 0; } return 0; } static int iter(tool_t *tool, const float viewport[4]) { tool_move_t *move = (tool_move_t*)tool; layer_t *layer = goxel.image->active_layer; cursor_t *curs = &goxel.cursor; curs->snap_mask = SNAP_LAYER_OUT; if (!move->gestures.move.type) { move->gestures.move = (gesture3d_t) { .type = GESTURE_HOVER, .callback = on_move, }; } gesture3d(&move->gestures.move, curs, move); mesh_get_box(layer->mesh, true, move->box); render_box(&goxel.rend, move->box, NULL, EFFECT_STRIP | EFFECT_WIREFRAME); return 0; } static int gui(tool_t *tool) { layer_t *layer; float mat[4][4] = MAT4_IDENTITY; int i; double v; layer = goxel.image->active_layer; gui_group_begin(NULL); i = 0; if (gui_input_int("Move X", &i, 0, 0)) mat4_itranslate(mat, i, 0, 0); i = 0; if (gui_input_int("Move Y", &i, 0, 0)) mat4_itranslate(mat, 0, i, 0); i = 0; if (gui_input_int("Move Z", &i, 0, 0)) mat4_itranslate(mat, 0, 0, i); gui_group_end(); gui_group_begin(NULL); i = 0; if (gui_input_int("Rot X", &i, 0, 0)) mat4_irotate(mat, i * M_PI / 2, 1, 0, 0); i = 0; if (gui_input_int("Rot Y", &i, 0, 0)) mat4_irotate(mat, i * M_PI / 2, 0, 1, 0); i = 0; if (gui_input_int("Rot Z", &i, 0, 0)) mat4_irotate(mat, i * M_PI / 2, 0, 0, 1); gui_group_end(); if (layer->image && gui_input_int("Scale", &i, 0, 0)) { v = pow(2, i); mat4_iscale(mat, v, v, v); } gui_group_begin(NULL); if (gui_button("flip X", -1, 0)) mat4_iscale(mat, -1, 1, 1); if (gui_button("flip Y", -1, 0)) mat4_iscale(mat, 1, -1, 1); if (gui_button("flip Z", -1, 0)) mat4_iscale(mat, 1, 1, -1); gui_group_end(); if (memcmp(&mat, &mat4_identity, sizeof(mat))) { image_history_push(goxel.image); do_move(layer, mat); } return 0; } TOOL_REGISTER(TOOL_MOVE, move, tool_move_t, .iter_fn = iter, .gui_fn = gui, .flags = TOOL_REQUIRE_CAN_MOVE, .default_shortcut = "M", ) goxel-0.8.1/src/tools/plane.c000066400000000000000000000037541334742672700160600ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { tool_t tool; } tool_plane_t; static int iter(tool_t *tool, const float viewport[4]) { cursor_t *curs = &goxel.cursor; curs->snap_mask = SNAP_MESH; curs->snap_offset = 0; goxel_set_help_text("Click on the mesh to set plane."); if (curs->snaped && (curs->flags & CURSOR_PRESSED)) { curs->pos[0] = round(curs->pos[0]); curs->pos[1] = round(curs->pos[1]); curs->pos[2] = round(curs->pos[2]); plane_from_normal(goxel.plane, curs->pos, curs->normal); } return 0; } static int gui(tool_t *tool) { int i; bool v; v = goxel.snap_mask & SNAP_PLANE; if (gui_checkbox("Visible", &v, NULL)) { set_flag(&goxel.snap_mask, SNAP_PLANE, v); } gui_group_begin(NULL); i = 0; if (gui_input_int("Move", &i, 0, 0)) mat4_itranslate(goxel.plane, 0, 0, -i); i = 0; if (gui_input_int("Rot X", &i, 0, 0)) mat4_irotate(goxel.plane, i * M_PI / 2, 1, 0, 0); i = 0; if (gui_input_int("Rot Y", &i, 0, 0)) mat4_irotate(goxel.plane, i * M_PI / 2, 0, 1, 0); gui_group_end(); return 0; } TOOL_REGISTER(TOOL_SET_PLANE, plane, tool_plane_t, .iter_fn = iter, .gui_fn = gui, .default_shortcut = "P" ) goxel-0.8.1/src/tools/procedural.c000066400000000000000000000160251334742672700171140ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" enum { STATE_IDLE = 0, STATE_SNAPED, STATE_PAINT, }; typedef struct { tool_t tool; gox_proc_t proc; bool auto_run; int timer; bool initialized; char **progs; char **names; int nb_progs; int current; char prog_path[1024]; // "\0" if no loaded prog. char prog_buff[64 * 1024]; // XXX: make it dynamic? bool export_animation; char export_animation_path[1024]; } tool_procedural_t; static int iter(tool_t *tool, const float viewport[4]) { float box[4][4]; gox_proc_t *proc = &((tool_procedural_t*)tool)->proc; cursor_t *curs = &goxel.cursor; if (proc->state == PROC_PARSE_ERROR) return 0; switch (tool->state) { case STATE_IDLE: if (curs->snaped) return STATE_SNAPED; break; case STATE_SNAPED: if (!curs->snaped) return STATE_IDLE; bbox_from_extents(box, curs->pos, 0.5, 0.5, 0.5); render_box(&goxel.rend, box, NULL, EFFECT_WIREFRAME); if (curs->flags & CURSOR_PRESSED) { image_history_push(goxel.image); proc_stop(proc); proc_start(proc, box); return STATE_PAINT; } break; case STATE_PAINT: if (!(curs->flags & CURSOR_PRESSED)) return STATE_IDLE; break; } return tool->state; } static int list_saved_on_path(int i, const char *path, void *user_) { const char *data, *name; void (*f)(int, const char*, const char*, void*) = USER_GET(user_, 0); void *user = USER_GET(user_, 1); if (!str_endswith(path, ".goxcf")) return -1; if (f) { data = assets_get(path, NULL); name = strrchr(path, '/') + 1; f(i, name, data, user); } return 0; } // List all the programs in data/progs. static int proc_list_examples(void (*f)(int index, const char *name, const char *code, void *user), void *user) { return assets_list("data/progs", USER_PASS(f, user), list_saved_on_path); } static void on_example(int i, const char *name, const char *code, void *user) { char **progs = USER_GET(user, 0); char **names = USER_GET(user, 1); progs[i] = strdup(code); names[i] = strdup(name); } static void load(tool_procedural_t *p) { const char *path; FILE *f; int nb; path = noc_file_dialog_open(NOC_FILE_DIALOG_OPEN, "goxcf\0*.goxcf\0", NULL, NULL); if (!path) return; f = fopen(path, "r"); nb = (int)fread(p->prog_buff, 1, sizeof(p->prog_buff), f); p->prog_buff[nb] = '\0'; fclose(f); strcpy(p->prog_path, path); proc_parse(p->prog_buff, &p->proc); } static void save(tool_procedural_t *p) { const char *path; FILE *f; if (!*p->prog_path) { path = noc_file_dialog_open(NOC_FILE_DIALOG_SAVE, "goxcf\0*.goxcf\0", NULL, NULL); if (path) strcpy(p->prog_path, path); } if (!*p->prog_path) return; f = fopen(p->prog_path, "w"); fwrite(p->prog_buff, strlen(p->prog_buff), 1, f); fclose(f); } static int gui(tool_t *tool) { tool_procedural_t *p = (tool_procedural_t*)tool; bool enabled; gox_proc_t *proc; const char *dir_path; char *path; if (!p->initialized) { p->initialized = true; strcpy(p->prog_buff, "shape main {\n cube[s 3]\n}"); p->nb_progs = proc_list_examples(NULL, NULL); p->progs = (char**)calloc(p->nb_progs, sizeof(*p->progs)); p->names = (char**)calloc(p->nb_progs, sizeof(*p->names)); proc_list_examples(on_example, USER_PASS(p->progs, p->names)); proc_parse(p->prog_buff, &p->proc); p->current = -1; } proc = &p->proc; if (gui_input_text_multiline("", p->prog_buff, ARRAY_SIZE(p->prog_buff), 300, 400)) { p->timer = 0; proc_parse(p->prog_buff, proc); } if (proc->error.str) { gui_input_text_multiline_highlight(proc->error.line); gui_text(proc->error.str); } enabled = proc->state >= PROC_READY; if (p->auto_run && proc->state == PROC_READY && p->timer == 0) p->timer = 1; if (proc->state == PROC_RUNNING) { if (gui_button("Stop", 0, 0)) proc_stop(proc); } else { gui_enabled_begin(enabled); if ( (gui_button("Run", 0, 0) && enabled) || (p->auto_run && proc->state == PROC_READY && p->timer && p->timer++ >= 16)) { mesh_clear(goxel.image->active_layer->mesh); proc_start(proc, NULL); p->timer = 0; } gui_enabled_end(); } if (!DEFINED(GOXEL_MOBILE)) { gui_same_line(); if (gui_checkbox("Auto", &p->auto_run, NULL)) proc_parse(p->prog_buff, proc); gui_same_line(); if (gui_button("Export Animation", 0, 0)) { dir_path = noc_file_dialog_open( NOC_FILE_DIALOG_SAVE | NOC_FILE_DIALOG_DIR, NULL, NULL, NULL); if (dir_path) { mesh_clear(goxel.image->active_layer->mesh); proc_start(proc, NULL); p->export_animation = true; sprintf(p->export_animation_path, "%s", dir_path); } } if (*p->prog_path) gui_text(p->prog_path); if (gui_button("Load", 0, 0)) load(p); gui_same_line(); if (gui_button("Save", 0, 0)) save(p); } if (gui_combo("Examples", &p->current, (const char**)p->names, p->nb_progs)) { strcpy(p->prog_buff, p->progs[p->current]); proc_parse(p->prog_buff, proc); } if (proc->state == PROC_RUNNING && p->export_animation && !proc->in_frame) { asprintf(&path, "%s/img_%04d.png", p->export_animation_path, proc->frame); action_exec2("export_as", "pp", "png", path); free(path); } if (proc->state != PROC_RUNNING) p->export_animation = false; if (proc->state == PROC_RUNNING) { proc_iter(proc, goxel.image->active_layer->mesh, &goxel.painter); if (!proc->in_frame) goxel_update_meshes(MESH_RENDER); } return 0; } TOOL_REGISTER(TOOL_PROCEDURAL, procedural, tool_procedural_t, .gui_fn = gui, .iter_fn = iter, .flags = TOOL_REQUIRE_CAN_EDIT, ) goxel-0.8.1/src/tools/selection.c000066400000000000000000000214121334742672700167350ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" enum { DRAG_RESIZE, DRAG_MOVE, }; static int g_drag_mode = 0; typedef struct { tool_t tool; int snap_face; float start_pos[3]; bool adjust; struct { gesture3d_t hover; gesture3d_t drag; gesture3d_t resize; } gestures; } tool_selection_t; static void get_box(const float p0[3], const float p1[3], const float n[3], float r, const float plane[4][4], float out[4][4]) { float rot[4][4], box[4][4]; float v[3]; if (p1 == NULL) { bbox_from_extents(box, p0, r, r, r); box_swap_axis(box, 2, 0, 1, box); mat4_copy(box, out); return; } if (r == 0) { bbox_from_points(box, p0, p1); bbox_grow(box, 0.5, 0.5, 0.5, box); // Apply the plane rotation. mat4_copy(plane, rot); vec4_set(rot[3], 0, 0, 0, 1); mat4_imul(box, rot); mat4_copy(box, out); return; } // Create a box for a line: int i; const float AXES[][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; mat4_set_identity(box); vec3_mix(p0, p1, 0.5, box[3]); vec3_sub(p1, box[3], box[2]); for (i = 0; i < 3; i++) { vec3_cross(box[2], AXES[i], box[0]); if (vec3_norm2(box[0]) > 0) break; } if (i == 3) { mat4_copy(box, out); return; } vec3_normalize(box[0], v); vec3_mul(v, r, box[0]); vec3_cross(box[2], box[0], v); vec3_normalize(v, v); vec3_mul(v, r, box[1]); mat4_copy(box, out); } // Get the face index from the normal. // XXX: used in a few other places! static int get_face(const float n[3]) { int f; const int *n2; for (f = 0; f < 6; f++) { n2 = FACES_NORMALS[f]; if (vec3_dot(n, VEC(n2[0], n2[1], n2[2])) > 0.5) return f; } return -1; } static int on_hover(gesture3d_t *gest, void *user) { float box[4][4]; cursor_t *curs = gest->cursor; uint8_t box_color[4] = {255, 255, 0, 255}; goxel_set_help_text("Click and drag to set selection."); get_box(curs->pos, curs->pos, curs->normal, 0, goxel.plane, box); render_box(&goxel.rend, box, box_color, EFFECT_WIREFRAME); return 0; } static int on_resize(gesture3d_t *gest, void *user) { float face_plane[4][4]; cursor_t *curs = gest->cursor; tool_selection_t *tool = user; float n[3], pos[3], v[3]; if (box_is_null(goxel.selection)) return GESTURE_FAILED; if (gest->type == GESTURE_HOVER) { goxel_set_help_text("Drag to move face"); if (curs->snaped != SNAP_SELECTION_OUT) return GESTURE_FAILED; tool->snap_face = get_face(curs->normal); curs->snap_offset = 0; curs->snap_mask &= ~SNAP_ROUNDED; mat4_mul(goxel.selection, FACES_MATS[tool->snap_face], face_plane); render_img(&goxel.rend, NULL, face_plane, EFFECT_NO_SHADING); if (curs->flags & CURSOR_PRESSED) { gest->type = GESTURE_DRAG; vec3_normalize(face_plane[0], v); plane_from_vectors(goxel.tool_plane, curs->pos, curs->normal, v); } return 0; } if (gest->type == GESTURE_DRAG) { goxel_set_help_text("Drag to move face"); curs->snap_offset = 0; curs->snap_mask &= ~SNAP_ROUNDED; mat4_mul(goxel.selection, FACES_MATS[tool->snap_face], face_plane); vec3_normalize(face_plane[2], n); vec3_sub(curs->pos, goxel.tool_plane[3], v); vec3_project(v, n, v); vec3_add(goxel.tool_plane[3], v, pos); pos[0] = round(pos[0]); pos[1] = round(pos[1]); pos[2] = round(pos[2]); if (g_drag_mode == DRAG_RESIZE) { box_move_face(goxel.selection, tool->snap_face, pos, goxel.selection); } else { float d[3], ofs[3]; vec3_add(goxel.selection[3], face_plane[2], d); vec3_sub(pos, d, d); vec3_project(d, n, ofs); vec3_iadd(goxel.selection[3], ofs); } if (gest->state == GESTURE_END) { gest->type = GESTURE_HOVER; mat4_copy(plane_null, goxel.tool_plane); } return 0; } return 0; } static int on_drag(gesture3d_t *gest, void *user) { tool_selection_t *tool = user; cursor_t *curs = gest->cursor; float pos[3], v[3]; if (!tool->adjust) { if (gest->state == GESTURE_BEGIN) vec3_copy(curs->pos, tool->start_pos); curs->snap_mask &= ~(SNAP_SELECTION_IN | SNAP_SELECTION_OUT); goxel_set_help_text("Drag."); get_box(tool->start_pos, curs->pos, curs->normal, 0, goxel.plane, goxel.selection); if (gest->state == GESTURE_END) tool->adjust = true; } else { goxel_set_help_text("Adjust height."); if (gest->state == GESTURE_BEGIN) plane_from_normal(goxel.tool_plane, curs->pos, goxel.plane[0]); vec3_sub(curs->pos, goxel.tool_plane[3], v); vec3_project(v, goxel.plane[2], v); vec3_add(goxel.tool_plane[3], v, pos); pos[0] = round(pos[0] - 0.5) + 0.5; pos[1] = round(pos[1] - 0.5) + 0.5; pos[2] = round(pos[2] - 0.5) + 0.5; get_box(tool->start_pos, pos, curs->normal, 0, goxel.plane, goxel.selection); if (gest->state == GESTURE_END) { tool->adjust = false; mat4_copy(plane_null, goxel.tool_plane); return GESTURE_FAILED; } } return 0; } // XXX: this is very close to tool_shape_iter. static int iter(tool_t *tool, const float viewport[4]) { tool_selection_t *selection = (tool_selection_t*)tool; cursor_t *curs = &goxel.cursor; curs->snap_mask |= SNAP_ROUNDED; curs->snap_mask &= ~(SNAP_SELECTION_IN | SNAP_SELECTION_OUT); curs->snap_offset = 0.5; curs->snap_mask |= SNAP_SELECTION_OUT; if (!selection->gestures.drag.type) { selection->gestures.hover = (gesture3d_t) { .type = GESTURE_HOVER, .callback = on_hover, }; selection->gestures.drag = (gesture3d_t) { .type = GESTURE_DRAG, .callback = on_drag, }; selection->gestures.resize = (gesture3d_t) { .type = GESTURE_HOVER, .callback = on_resize, }; } selection->gestures.drag.type = (!selection->adjust) ? GESTURE_DRAG : GESTURE_HOVER; if (gesture3d(&selection->gestures.resize, curs, selection)) goto end; if (gesture3d(&selection->gestures.drag, curs, selection)) goto end; if (gesture3d(&selection->gestures.hover, curs, selection)) goto end; end: return tool->state; } static int gui(tool_t *tool) { int x, y, z, w, h, d; float (*box)[4][4] = &goxel.selection; if (box_is_null(*box)) return 0; gui_text("Drag mode"); gui_combo("##drag_mode", &g_drag_mode, (const char*[]) {"Resize", "Move"}, 2); gui_group_begin(NULL); if (gui_action_button("reset_selection", "Reset", 1.0, "")) { gui_group_end(); return 0; } gui_action_button("fill_selection", "Fill", 1.0, ""); gui_action_button("layer_clear", "Clear", 1.0, "pp", goxel.image->active_layer, *box); gui_action_button("cut_as_new_layer", "Cut as new layer", 1.0, ""); gui_group_end(); w = round((*box)[0][0] * 2); h = round((*box)[1][1] * 2); d = round((*box)[2][2] * 2); x = round((*box)[3][0] - (*box)[0][0]); y = round((*box)[3][1] - (*box)[1][1]); z = round((*box)[3][2] - (*box)[2][2]); gui_group_begin("Origin"); gui_input_int("x", &x, 0, 0); gui_input_int("y", &y, 0, 0); gui_input_int("z", &z, 0, 0); gui_group_end(); gui_group_begin("Size"); gui_input_int("w", &w, 1, 2048); gui_input_int("h", &h, 1, 2048); gui_input_int("d", &d, 1, 2048); gui_group_end(); bbox_from_extents(*box, VEC(x + w / 2., y + h / 2., z + d / 2.), w / 2., h / 2., d / 2.); return 0; } TOOL_REGISTER(TOOL_SELECTION, selection, tool_selection_t, .iter_fn = iter, .gui_fn = gui, .default_shortcut = "R", ) goxel-0.8.1/src/tools/shape.c000066400000000000000000000137061334742672700160570ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2017 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" typedef struct { tool_t tool; float start_pos[3]; mesh_t *mesh_orig; bool adjust; struct { gesture3d_t drag; gesture3d_t hover; gesture3d_t adjust; } gestures; } tool_shape_t; static void get_box(const float p0[3], const float p1[3], const float n[3], float r, const float plane[4][4], float out[4][4]) { float rot[4][4], box[4][4]; float v[3]; if (p1 == NULL) { bbox_from_extents(box, p0, r, r, r); box_swap_axis(box, 2, 0, 1, box); mat4_copy(box, out); } if (r == 0) { bbox_from_points(box, p0, p1); bbox_grow(box, 0.5, 0.5, 0.5, box); // Apply the plane rotation. mat4_copy(plane, rot); vec4_set(rot[3], 0, 0, 0, 1); mat4_imul(box, rot); mat4_copy(box, out); return; } // Create a box for a line: int i; const float AXES[][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; mat4_set_identity(box); vec3_mix(p0, p1, 0.5, box[3]); vec3_sub(p1, box[3], box[2]); for (i = 0; i < 3; i++) { vec3_cross(box[2], AXES[i], box[0]); if (vec3_norm2(box[0]) > 0) break; } if (i == 3) { mat4_copy(box, out); return; } vec3_normalize(box[0], v); vec3_mul(v, r, box[0]); vec3_cross(box[2], box[0], v); vec3_normalize(v, v); vec3_mul(v, r, box[1]); mat4_copy(box, out); } static int on_hover(gesture3d_t *gest, void *user) { float box[4][4]; cursor_t *curs = gest->cursor; uint8_t box_color[4] = {255, 255, 0, 255}; goxel_set_help_text("Click and drag to draw."); get_box(curs->pos, curs->pos, curs->normal, 0, goxel.plane, box); render_box(&goxel.rend, box, box_color, EFFECT_WIREFRAME); return 0; } static int on_drag(gesture3d_t *gest, void *user) { tool_shape_t *shape = user; mesh_t *layer_mesh = goxel.image->active_layer->mesh; float box[4][4]; cursor_t *curs = gest->cursor; if (shape->adjust) return GESTURE_FAILED; if (gest->state == GESTURE_BEGIN) { mesh_set(shape->mesh_orig, layer_mesh); vec3_copy(curs->pos, shape->start_pos); image_history_push(goxel.image); } goxel_set_help_text("Drag."); get_box(shape->start_pos, curs->pos, curs->normal, 0, goxel.plane, box); if (!goxel.tool_mesh) goxel.tool_mesh = mesh_new(); mesh_set(goxel.tool_mesh, shape->mesh_orig); mesh_op(goxel.tool_mesh, &goxel.painter, box); goxel_update_meshes(MESH_RENDER); if (gest->state == GESTURE_END) { mesh_set(layer_mesh, goxel.tool_mesh); mesh_delete(goxel.tool_mesh); goxel.tool_mesh = NULL; goxel_update_meshes(-1); shape->adjust = goxel.tool_shape_two_steps; } return 0; } static int on_adjust(gesture3d_t *gest, void *user) { tool_shape_t *shape = user; cursor_t *curs = gest->cursor; float pos[3], v[3], box[4][4]; mesh_t *mesh = goxel.image->active_layer->mesh; goxel_set_help_text("Adjust height."); if (gest->state == GESTURE_BEGIN) { plane_from_normal(goxel.tool_plane, curs->pos, goxel.plane[0]); } vec3_sub(curs->pos, goxel.tool_plane[3], v); vec3_project(v, goxel.plane[2], v); vec3_add(goxel.tool_plane[3], v, pos); pos[0] = round(pos[0] - 0.5) + 0.5; pos[1] = round(pos[1] - 0.5) + 0.5; pos[2] = round(pos[2] - 0.5) + 0.5; get_box(shape->start_pos, pos, curs->normal, 0, goxel.plane, box); mesh_set(mesh, shape->mesh_orig); mesh_op(mesh, &goxel.painter, box); goxel_update_meshes(MESH_RENDER); if (gest->state == GESTURE_END) { mat4_copy(plane_null, goxel.tool_plane); mesh_set(shape->mesh_orig, mesh); shape->adjust = false; goxel_update_meshes(-1); } return 0; } static int iter(tool_t *tool, const float viewport[4]) { tool_shape_t *shape = (tool_shape_t*)tool; cursor_t *curs = &goxel.cursor; curs->snap_mask |= SNAP_ROUNDED; curs->snap_offset = (goxel.painter.mode == MODE_OVER) ? 0.5 : -0.5; if (!shape->mesh_orig) shape->mesh_orig = mesh_copy(goxel.image->active_layer->mesh); if (!shape->gestures.drag.type) { shape->gestures.drag = (gesture3d_t) { .type = GESTURE_DRAG, .callback = on_drag, }; shape->gestures.hover = (gesture3d_t) { .type = GESTURE_HOVER, .callback = on_hover, }; shape->gestures.adjust = (gesture3d_t) { .type = GESTURE_HOVER, .callback = on_adjust, }; } gesture3d(&shape->gestures.drag, curs, shape); if (!shape->adjust) gesture3d(&shape->gestures.hover, curs, shape); else gesture3d(&shape->gestures.adjust, curs, shape); return tool->state; } static int gui(tool_t *tool) { tool_gui_smoothness(); if (!DEFINED(GOXEL_MOBILE)) gui_checkbox("Two steps", &goxel.tool_shape_two_steps, "Second click set the height"); tool_gui_snap(); tool_gui_shape(); tool_gui_symmetry(); return 0; } TOOL_REGISTER(TOOL_SHAPE, shape, tool_shape_t, .iter_fn = iter, .gui_fn = gui, .flags = TOOL_REQUIRE_CAN_EDIT | TOOL_ALLOW_PICK_COLOR, .default_shortcut = "S", ) goxel-0.8.1/src/utils.c000066400000000000000000000444071334742672700147610ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2015 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" #include #include #include #include #include // Prevent warnings in stb code. #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #ifdef WIN32 #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif #endif #define STB_IMAGE_WRITE_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION #define STBI_ONLY_PNG #define STBI_ONLY_JPEG #define STBI_ONLY_BMP #include "stb_image.h" #include "stb_image_write.h" #if DEFINED(HAVE_LIBPNG) #include #endif #ifdef __GNUC__ #pragma GCC diagnostic pop #endif #ifndef LOG_TIME # define LOG_TIME 1 #endif static double get_log_time() { static double origin = 0; double time; time = sys_get_time(); if (!origin) origin = time; return time - origin; } void dolog(int level, const char *msg, const char *func, const char *file, int line, ...) { const bool use_colors = !DEFINED(__APPLE__) && !DEFINED(__EMSCRIPTEN__); char *msg_formatted, *full_msg; const char *format; char time_str[32] = ""; va_list args; va_start(args, line); vasprintf(&msg_formatted, msg, args); va_end(args); if (use_colors && level >= GOX_LOG_WARN) { format = "\e[33;31m%s%-60s\e[m %s (%s:%d)"; } else { format = "%s%-60s %s (%s:%d)"; } if (DEFINED(LOG_TIME)) sprintf(time_str, "%.3f: ", get_log_time()); file = file + max(0, (int)strlen(file) - 20); // Truncate file path. asprintf(&full_msg, format, time_str, msg_formatted, func, file, line); sys_log(full_msg); free(msg_formatted); free(full_msg); } double get_unix_time(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec + tv.tv_usec / 1000.0 / 1000.0; } char *read_file(const char *path, int *size) { FILE *file; char *ret = NULL; long read_size __attribute__((unused)); int size_default; size = size ?: &size_default; // Allow to pass NULL as size; file = fopen(path, "rb"); if (!file) return NULL; fseek(file, 0, SEEK_END); *size = (int)ftell(file); fseek(file, 0, SEEK_SET); ret = malloc(*size + 1); read_size = fread(ret, *size, 1, file); assert(read_size == 1 || *size == 0); ret[*size] = '\0'; fclose(file); return ret; } uint8_t *img_read_from_mem(const char *data, int size, int *w, int *h, int *bpp) { assert(*bpp >= 0 && *bpp <= 4); return stbi_load_from_memory((uint8_t*)data, size, w, h, bpp, *bpp); } uint8_t *img_read(const char *path, int *width, int *height, int *bpp) { int size; char *data; bool need_to_free = false; uint8_t *img; if (str_startswith(path, "asset://")) { data = (char*)assets_get(path, &size); } else { data = read_file(path, &size); need_to_free = true; } if (!data) LOG_E("Cannot open image %s", path); assert(data); img = img_read_from_mem(data, size, width, height, bpp); if (need_to_free) free(data); return img; } #if !DEFINED(HAVE_LIBPNG) void img_write(const uint8_t *img, int w, int h, int bpp, const char *path) { stbi_write_png(path, w, h, bpp, img, 0); } #else void img_write(const uint8_t *img, int w, int h, int bpp, const char *path) { int i; FILE *fp; png_structp png_ptr; png_infop info_ptr; fp = fopen(path, "wb"); if (!fp) { LOG_E("Cannot open %s", path); return; } png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); info_ptr = png_create_info_struct(png_ptr); if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_write_struct(&png_ptr, &info_ptr); fclose(fp); return; } png_init_io(png_ptr, fp); png_set_IHDR(png_ptr, info_ptr, w, h, 8, bpp == 3 ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_write_info(png_ptr, info_ptr); for (i = 0; i < h; i++) png_write_row(png_ptr, (png_bytep)(img + i * w * bpp)); png_write_end(png_ptr, info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr); fclose(fp); } #endif uint8_t *img_write_to_mem(const uint8_t *img, int w, int h, int bpp, int *size) { return stbi_write_png_to_mem((void*)img, 0, w, h, bpp, size); } bool str_endswith(const char *str, const char *end) { if (!str || !end) return false; if (strlen(str) < strlen(end)) return false; const char *start = str + strlen(str) - strlen(end); return strcmp(start, end) == 0; } bool str_startswith(const char *s1, const char *s2) { if (!s1 || !s2) return false; if (strlen(s1) < strlen(s2)) return false; return strncmp(s1, s2, strlen(s2)) == 0; } void img_downsample(const uint8_t *img, int w, int h, int bpp, uint8_t *out) { #define IX(x, y, k) ((((size_t)y) * w + (x)) * bpp + (k)) int i, j, k; assert(w % 2 == 0 && h % 2 == 0); for (i = 0; i < h; i += 2) for (j = 0; j < w; j += 2) for (k = 0; k < bpp; k++) { out[(i * w / 4 + j / 2) * bpp + k] = ( img[IX(j + 0, i + 0, k)] + img[IX(j + 0, i + 1, k)] + img[IX(j + 1, i + 0, k)] + img[IX(j + 1, i + 1, k)]) / 4; } #undef IX } // Like gluUnproject. void unproject(const float win[3], const float model[4][4], const float proj[4][4], const float viewport[4], float out[3]) { float inv[4][4]; float p[4]; mat4_mul(proj, model, inv); mat4_invert(inv, inv); vec4_set(p, (win[0] - viewport[0]) / viewport[2] * 2 - 1, (win[1] - viewport[1]) / viewport[3] * 2 - 1, 2 * win[2] - 1, 1); mat4_mul_vec4(inv, p, p); if (p[3]) vec3_imul(p, 1 / p[3]); vec3_copy(p, out); } int unix_to_dtf(double t, int *iy, int *im, int *id, int *h, int *m, int *s) { time_t time = (int)t; struct tm *tm; tm = localtime(&time); if (!tm) return -1; *iy = tm->tm_year + 1900; *im = tm->tm_mon + 1; *id = tm->tm_mday; *h = tm->tm_hour; *m = tm->tm_min; *s = tm->tm_sec; return 0; } // From blender source code. int utf_16_to_8(const wchar_t *in16, char *out8, size_t size8) { char *out8end = out8 + size8; wchar_t u = 0; int err = 0; if (!size8 || !in16 || !out8) return -1; out8end--; for (; out8 < out8end && (u = *in16); in16++, out8++) { if (u < 0x0080) { *out8 = u; } else if (u < 0x0800) { if (out8 + 1 >= out8end) break; *out8++ = (0x3 << 6) | (0x1F & (u >> 6)); *out8 = (0x1 << 7) | (0x3F & (u)); } else if (u < 0xD800 || u >= 0xE000) { if (out8 + 2 >= out8end) break; *out8++ = (0x7 << 5) | (0xF & (u >> 12)); *out8++ = (0x1 << 7) | (0x3F & (u >> 6)); *out8 = (0x1 << 7) | (0x3F & (u)); } else if (u < 0xDC00) { wchar_t u2 = *++in16; if (!u2) break; if (u2 >= 0xDC00 && u2 < 0xE000) { if (out8 + 3 >= out8end) break; else { unsigned int uc = 0x10000 + (u2 - 0xDC00) + ((u - 0xD800) << 10); *out8++ = (0xF << 4) | (0x7 & (uc >> 18)); *out8++ = (0x1 << 7) | (0x3F & (uc >> 12)); *out8++ = (0x1 << 7) | (0x3F & (uc >> 6)); *out8 = (0x1 << 7) | (0x3F & (uc)); } } else { out8--; err = -1; } } else if (u < 0xE000) { out8--; err = -1; } } *out8 = *out8end = 0; if (*in16) err = -1; return err; } /* Function: b64_decode * Decode a base64 string * * Parameters: * src - A base 64 encoded string. * dest - Buffer that will receive the decoded value or NULL. If set to * NULL the function just returns the size of the decoded data. * * Return: * The size of the decoded data. */ int b64_decode(const char *src, void *dest) { const char TABLE[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int len = strlen(src); uint8_t *p = dest; #define b64_value(c) ((strchr(TABLE, c) ?: TABLE) - TABLE) #define isbase64(c) (c && strchr(TABLE, c)) if (*src == 0) return 0; if (!p) return ((len + 3) / 4) * 3; do { char a = b64_value(src[0]); char b = b64_value(src[1]); char c = b64_value(src[2]); char d = b64_value(src[3]); *p++ = (a << 2) | (b >> 4); *p++ = (b << 4) | (c >> 2); *p++ = (c << 6) | d; if (!isbase64(src[1])) { p -= 2; break; } else if (!isbase64(src[2])) { p -= 2; break; } else if (!isbase64(src[3])) { p--; break; } src += 4; while (*src && (*src == 13 || *src == 10)) src++; } while (len -= 4); return p - (uint8_t*)dest; } // Table taken from redis sources. static const uint64_t crc64_tab[256] = { UINT64_C(0x0000000000000000), UINT64_C(0x7ad870c830358979), UINT64_C(0xf5b0e190606b12f2), UINT64_C(0x8f689158505e9b8b), UINT64_C(0xc038e5739841b68f), UINT64_C(0xbae095bba8743ff6), UINT64_C(0x358804e3f82aa47d), UINT64_C(0x4f50742bc81f2d04), UINT64_C(0xab28ecb46814fe75), UINT64_C(0xd1f09c7c5821770c), UINT64_C(0x5e980d24087fec87), UINT64_C(0x24407dec384a65fe), UINT64_C(0x6b1009c7f05548fa), UINT64_C(0x11c8790fc060c183), UINT64_C(0x9ea0e857903e5a08), UINT64_C(0xe478989fa00bd371), UINT64_C(0x7d08ff3b88be6f81), UINT64_C(0x07d08ff3b88be6f8), UINT64_C(0x88b81eabe8d57d73), UINT64_C(0xf2606e63d8e0f40a), UINT64_C(0xbd301a4810ffd90e), UINT64_C(0xc7e86a8020ca5077), UINT64_C(0x4880fbd87094cbfc), UINT64_C(0x32588b1040a14285), UINT64_C(0xd620138fe0aa91f4), UINT64_C(0xacf86347d09f188d), UINT64_C(0x2390f21f80c18306), UINT64_C(0x594882d7b0f40a7f), UINT64_C(0x1618f6fc78eb277b), UINT64_C(0x6cc0863448deae02), UINT64_C(0xe3a8176c18803589), UINT64_C(0x997067a428b5bcf0), UINT64_C(0xfa11fe77117cdf02), UINT64_C(0x80c98ebf2149567b), UINT64_C(0x0fa11fe77117cdf0), UINT64_C(0x75796f2f41224489), UINT64_C(0x3a291b04893d698d), UINT64_C(0x40f16bccb908e0f4), UINT64_C(0xcf99fa94e9567b7f), UINT64_C(0xb5418a5cd963f206), UINT64_C(0x513912c379682177), UINT64_C(0x2be1620b495da80e), UINT64_C(0xa489f35319033385), UINT64_C(0xde51839b2936bafc), UINT64_C(0x9101f7b0e12997f8), UINT64_C(0xebd98778d11c1e81), UINT64_C(0x64b116208142850a), UINT64_C(0x1e6966e8b1770c73), UINT64_C(0x8719014c99c2b083), UINT64_C(0xfdc17184a9f739fa), UINT64_C(0x72a9e0dcf9a9a271), UINT64_C(0x08719014c99c2b08), UINT64_C(0x4721e43f0183060c), UINT64_C(0x3df994f731b68f75), UINT64_C(0xb29105af61e814fe), UINT64_C(0xc849756751dd9d87), UINT64_C(0x2c31edf8f1d64ef6), UINT64_C(0x56e99d30c1e3c78f), UINT64_C(0xd9810c6891bd5c04), UINT64_C(0xa3597ca0a188d57d), UINT64_C(0xec09088b6997f879), UINT64_C(0x96d1784359a27100), UINT64_C(0x19b9e91b09fcea8b), UINT64_C(0x636199d339c963f2), UINT64_C(0xdf7adabd7a6e2d6f), UINT64_C(0xa5a2aa754a5ba416), UINT64_C(0x2aca3b2d1a053f9d), UINT64_C(0x50124be52a30b6e4), UINT64_C(0x1f423fcee22f9be0), UINT64_C(0x659a4f06d21a1299), UINT64_C(0xeaf2de5e82448912), UINT64_C(0x902aae96b271006b), UINT64_C(0x74523609127ad31a), UINT64_C(0x0e8a46c1224f5a63), UINT64_C(0x81e2d7997211c1e8), UINT64_C(0xfb3aa75142244891), UINT64_C(0xb46ad37a8a3b6595), UINT64_C(0xceb2a3b2ba0eecec), UINT64_C(0x41da32eaea507767), UINT64_C(0x3b024222da65fe1e), UINT64_C(0xa2722586f2d042ee), UINT64_C(0xd8aa554ec2e5cb97), UINT64_C(0x57c2c41692bb501c), UINT64_C(0x2d1ab4dea28ed965), UINT64_C(0x624ac0f56a91f461), UINT64_C(0x1892b03d5aa47d18), UINT64_C(0x97fa21650afae693), UINT64_C(0xed2251ad3acf6fea), UINT64_C(0x095ac9329ac4bc9b), UINT64_C(0x7382b9faaaf135e2), UINT64_C(0xfcea28a2faafae69), UINT64_C(0x8632586aca9a2710), UINT64_C(0xc9622c4102850a14), UINT64_C(0xb3ba5c8932b0836d), UINT64_C(0x3cd2cdd162ee18e6), UINT64_C(0x460abd1952db919f), UINT64_C(0x256b24ca6b12f26d), UINT64_C(0x5fb354025b277b14), UINT64_C(0xd0dbc55a0b79e09f), UINT64_C(0xaa03b5923b4c69e6), UINT64_C(0xe553c1b9f35344e2), UINT64_C(0x9f8bb171c366cd9b), UINT64_C(0x10e3202993385610), UINT64_C(0x6a3b50e1a30ddf69), UINT64_C(0x8e43c87e03060c18), UINT64_C(0xf49bb8b633338561), UINT64_C(0x7bf329ee636d1eea), UINT64_C(0x012b592653589793), UINT64_C(0x4e7b2d0d9b47ba97), UINT64_C(0x34a35dc5ab7233ee), UINT64_C(0xbbcbcc9dfb2ca865), UINT64_C(0xc113bc55cb19211c), UINT64_C(0x5863dbf1e3ac9dec), UINT64_C(0x22bbab39d3991495), UINT64_C(0xadd33a6183c78f1e), UINT64_C(0xd70b4aa9b3f20667), UINT64_C(0x985b3e827bed2b63), UINT64_C(0xe2834e4a4bd8a21a), UINT64_C(0x6debdf121b863991), UINT64_C(0x1733afda2bb3b0e8), UINT64_C(0xf34b37458bb86399), UINT64_C(0x8993478dbb8deae0), UINT64_C(0x06fbd6d5ebd3716b), UINT64_C(0x7c23a61ddbe6f812), UINT64_C(0x3373d23613f9d516), UINT64_C(0x49aba2fe23cc5c6f), UINT64_C(0xc6c333a67392c7e4), UINT64_C(0xbc1b436e43a74e9d), UINT64_C(0x95ac9329ac4bc9b5), UINT64_C(0xef74e3e19c7e40cc), UINT64_C(0x601c72b9cc20db47), UINT64_C(0x1ac40271fc15523e), UINT64_C(0x5594765a340a7f3a), UINT64_C(0x2f4c0692043ff643), UINT64_C(0xa02497ca54616dc8), UINT64_C(0xdafce7026454e4b1), UINT64_C(0x3e847f9dc45f37c0), UINT64_C(0x445c0f55f46abeb9), UINT64_C(0xcb349e0da4342532), UINT64_C(0xb1eceec59401ac4b), UINT64_C(0xfebc9aee5c1e814f), UINT64_C(0x8464ea266c2b0836), UINT64_C(0x0b0c7b7e3c7593bd), UINT64_C(0x71d40bb60c401ac4), UINT64_C(0xe8a46c1224f5a634), UINT64_C(0x927c1cda14c02f4d), UINT64_C(0x1d148d82449eb4c6), UINT64_C(0x67ccfd4a74ab3dbf), UINT64_C(0x289c8961bcb410bb), UINT64_C(0x5244f9a98c8199c2), UINT64_C(0xdd2c68f1dcdf0249), UINT64_C(0xa7f41839ecea8b30), UINT64_C(0x438c80a64ce15841), UINT64_C(0x3954f06e7cd4d138), UINT64_C(0xb63c61362c8a4ab3), UINT64_C(0xcce411fe1cbfc3ca), UINT64_C(0x83b465d5d4a0eece), UINT64_C(0xf96c151de49567b7), UINT64_C(0x76048445b4cbfc3c), UINT64_C(0x0cdcf48d84fe7545), UINT64_C(0x6fbd6d5ebd3716b7), UINT64_C(0x15651d968d029fce), UINT64_C(0x9a0d8ccedd5c0445), UINT64_C(0xe0d5fc06ed698d3c), UINT64_C(0xaf85882d2576a038), UINT64_C(0xd55df8e515432941), UINT64_C(0x5a3569bd451db2ca), UINT64_C(0x20ed197575283bb3), UINT64_C(0xc49581ead523e8c2), UINT64_C(0xbe4df122e51661bb), UINT64_C(0x3125607ab548fa30), UINT64_C(0x4bfd10b2857d7349), UINT64_C(0x04ad64994d625e4d), UINT64_C(0x7e7514517d57d734), UINT64_C(0xf11d85092d094cbf), UINT64_C(0x8bc5f5c11d3cc5c6), UINT64_C(0x12b5926535897936), UINT64_C(0x686de2ad05bcf04f), UINT64_C(0xe70573f555e26bc4), UINT64_C(0x9ddd033d65d7e2bd), UINT64_C(0xd28d7716adc8cfb9), UINT64_C(0xa85507de9dfd46c0), UINT64_C(0x273d9686cda3dd4b), UINT64_C(0x5de5e64efd965432), UINT64_C(0xb99d7ed15d9d8743), UINT64_C(0xc3450e196da80e3a), UINT64_C(0x4c2d9f413df695b1), UINT64_C(0x36f5ef890dc31cc8), UINT64_C(0x79a59ba2c5dc31cc), UINT64_C(0x037deb6af5e9b8b5), UINT64_C(0x8c157a32a5b7233e), UINT64_C(0xf6cd0afa9582aa47), UINT64_C(0x4ad64994d625e4da), UINT64_C(0x300e395ce6106da3), UINT64_C(0xbf66a804b64ef628), UINT64_C(0xc5bed8cc867b7f51), UINT64_C(0x8aeeace74e645255), UINT64_C(0xf036dc2f7e51db2c), UINT64_C(0x7f5e4d772e0f40a7), UINT64_C(0x05863dbf1e3ac9de), UINT64_C(0xe1fea520be311aaf), UINT64_C(0x9b26d5e88e0493d6), UINT64_C(0x144e44b0de5a085d), UINT64_C(0x6e963478ee6f8124), UINT64_C(0x21c640532670ac20), UINT64_C(0x5b1e309b16452559), UINT64_C(0xd476a1c3461bbed2), UINT64_C(0xaeaed10b762e37ab), UINT64_C(0x37deb6af5e9b8b5b), UINT64_C(0x4d06c6676eae0222), UINT64_C(0xc26e573f3ef099a9), UINT64_C(0xb8b627f70ec510d0), UINT64_C(0xf7e653dcc6da3dd4), UINT64_C(0x8d3e2314f6efb4ad), UINT64_C(0x0256b24ca6b12f26), UINT64_C(0x788ec2849684a65f), UINT64_C(0x9cf65a1b368f752e), UINT64_C(0xe62e2ad306bafc57), UINT64_C(0x6946bb8b56e467dc), UINT64_C(0x139ecb4366d1eea5), UINT64_C(0x5ccebf68aecec3a1), UINT64_C(0x2616cfa09efb4ad8), UINT64_C(0xa97e5ef8cea5d153), UINT64_C(0xd3a62e30fe90582a), UINT64_C(0xb0c7b7e3c7593bd8), UINT64_C(0xca1fc72bf76cb2a1), UINT64_C(0x45775673a732292a), UINT64_C(0x3faf26bb9707a053), UINT64_C(0x70ff52905f188d57), UINT64_C(0x0a2722586f2d042e), UINT64_C(0x854fb3003f739fa5), UINT64_C(0xff97c3c80f4616dc), UINT64_C(0x1bef5b57af4dc5ad), UINT64_C(0x61372b9f9f784cd4), UINT64_C(0xee5fbac7cf26d75f), UINT64_C(0x9487ca0fff135e26), UINT64_C(0xdbd7be24370c7322), UINT64_C(0xa10fceec0739fa5b), UINT64_C(0x2e675fb4576761d0), UINT64_C(0x54bf2f7c6752e8a9), UINT64_C(0xcdcf48d84fe75459), UINT64_C(0xb71738107fd2dd20), UINT64_C(0x387fa9482f8c46ab), UINT64_C(0x42a7d9801fb9cfd2), UINT64_C(0x0df7adabd7a6e2d6), UINT64_C(0x772fdd63e7936baf), UINT64_C(0xf8474c3bb7cdf024), UINT64_C(0x829f3cf387f8795d), UINT64_C(0x66e7a46c27f3aa2c), UINT64_C(0x1c3fd4a417c62355), UINT64_C(0x935745fc4798b8de), UINT64_C(0xe98f353477ad31a7), UINT64_C(0xa6df411fbfb21ca3), UINT64_C(0xdc0731d78f8795da), UINT64_C(0x536fa08fdfd90e51), UINT64_C(0x29b7d047efec8728), }; /* * Function: crc64 * Compute crc64 hash * * Parameters: * crc - Initial crc value. * s - Data pointer. * len - Data size. * * Return: * The new crc64 value. */ uint64_t crc64(uint64_t crc, const void *s, uint64_t len) { uint64_t j, byte; for (j = 0; j < len; j++) { byte = ((const uint8_t*)s)[j]; crc = crc64_tab[(uint8_t)crc ^ byte] ^ (crc >> 8); } return crc; } goxel-0.8.1/src/utils_gl.c000066400000000000000000000171461334742672700154430ustar00rootroot00000000000000/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ #include "goxel.h" static const char* get_gl_error_text(int code) { switch (code) { case GL_INVALID_ENUM: return "GL_INVALID_ENUM"; case GL_INVALID_FRAMEBUFFER_OPERATION: return "GL_INVALID_FRAMEBUFFER_OPERATION"; case GL_INVALID_VALUE: return "GL_INVALID_VALUE"; case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION"; case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY"; default: return "undefined error"; } } int gl_check_errors(const char *file, int line) { int errors = 0; while (true) { GLenum x = glGetError(); if (x == GL_NO_ERROR) return errors; LOG_E("%s:%d: OpenGL error: %d (%s)\n", file, line, x, get_gl_error_text(x)); errors++; } } static int compile_shader(int shader, const char *code, const char *include1, const char *include2) { int status, len; char *log; // Common header we add to all the shaders. #ifndef GLES2 const char *pre = "#define highp\n#define mediump\n#define lowp\n"; #else const char *pre = ""; #endif const char *sources[] = {pre, include1, include2, code}; assert(code); glShaderSource(shader, 4, (const char**)&sources, NULL); glCompileShader(shader); glGetShaderiv(shader, GL_COMPILE_STATUS, &status); if (status != GL_TRUE) { glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len); log = malloc(len + 1); LOG_E("Compile shader error:"); glGetShaderInfoLog(shader, len, &len, log); LOG_E("%s", log); LOG_E("%s", code); free(log); assert(false); } return 0; } int gl_create_prog(const char *vertex_shader_code, const char *fragment_shader_code, const char *include) { int vertex_shader = glCreateShader(GL_VERTEX_SHADER); include = include ? : ""; assert(vertex_shader); if (compile_shader(vertex_shader, vertex_shader_code, "#define VERTEX_SHADER\n", include)) return 0; int fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); assert(fragment_shader); if (compile_shader(fragment_shader, fragment_shader_code, "#define FRAGMENT_SHADER\n", include)) return 0; int prog = glCreateProgram(); glAttachShader(prog, vertex_shader); glAttachShader(prog, fragment_shader); glLinkProgram(prog); int status; glGetProgramiv(prog, GL_LINK_STATUS, &status); if (status != GL_TRUE) { LOG_E("Link Error"); int len; glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &len); char log[len]; glGetProgramInfoLog(prog, len, &len, log); LOG_E("%s", log); return 0; } return prog; } void gl_delete_prog(int prog) { int i; GLuint shaders[2]; GLint count; if (DEBUG) { GL(glGetProgramiv(prog, GL_ATTACHED_SHADERS, &count)); assert(count == 2); } GL(glGetAttachedShaders(prog, 2, NULL, shaders)); for (i = 0; i < 2; i++) GL(glDeleteShader(shaders[i])); GL(glDeleteProgram(prog)); } /* * Function: gl_gen_fbo * Helper function to generate an OpenGL framebuffer object with an * associated texture. * * Parameters: * w - Width of the fbo. * h - Height of the fbo. * format - GL_RGBA or GL_DEPTH_COMPONENT. * out_fbo - The created fbo. * out_tex - The created texture. */ int gl_gen_fbo(int w, int h, GLenum format, int msaa, GLuint *out, GLuint *out_tex) { assert(format == GL_RGBA || format == GL_DEPTH_COMPONENT); assert(msaa == 1); // For the moment. GLuint fbo, color, tex = 0, depth, internal_format; internal_format = (format != GL_DEPTH_COMPONENT) ? GL_UNSIGNED_BYTE : GL_UNSIGNED_INT; GL(glGenFramebuffers(1, &fbo)); GL(glBindFramebuffer(GL_FRAMEBUFFER, fbo)); GL(glGenTextures(1, &tex)); GL(glActiveTexture(GL_TEXTURE0)); GL(glBindTexture(GL_TEXTURE_2D, tex)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); GL(glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, format, internal_format, NULL)); #ifndef GLES2 if (format != GL_DEPTH_COMPONENT) { // Create color render buffer. GL(glGenRenderbuffers(1, &color)); GL(glBindRenderbuffer(GL_RENDERBUFFER, color)); glRenderbufferStorage(GL_RENDERBUFFER, format, w, h); GL(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, color)); // Create depth/stencil render buffer GL(glGenRenderbuffers(1, &depth)); GL(glBindRenderbuffer(GL_RENDERBUFFER, depth)); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, w, h); GL(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depth)); // Attach texture. if (tex) GL(glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0)); } else { GL(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, tex, 0)); } #else if (format != GL_DEPTH_COMPONENT) { if (gl_has_extension("GL_OES_packed_depth_stencil")) { // Create depth/stencil buffer. GL(glGenRenderbuffers(1, &depth)); GL(glBindRenderbuffer(GL_RENDERBUFFER, depth)); GL(glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, w, h)); GL(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depth)); GL(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depth)); } else { assert(false); // Not implemented yet! } if (tex) GL(glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0)); } else { GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_EXT, GL_COMPARE_REF_TO_TEXTURE_EXT)); GL(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, tex, 0)); } #endif assert( glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); *out = fbo; if (tex) *out_tex = tex; return 0; } bool gl_has_extension(const char *ext) { const char *str; GL(str = (const char*)glGetString(GL_EXTENSIONS)); return strstr(str, ext); } goxel-0.8.1/src/vec.c000066400000000000000000000054651334742672700143770ustar00rootroot00000000000000#include "vec.h" #include static const int EUL_ORDERS[][4] = { // i, j, k, n {0, 1, 2, 0}, // XYZ {0, 2, 1, 1}, // XZY {1, 0, 2, 1}, // YXZ {1, 2, 0, 0}, // YZX {2, 0, 1, 0}, // ZXY {2, 1, 0, 1} // ZYX }; void mat3_normalize_(const float m[3][3], float out[3][3]) { int i; for (i = 0; i < 3; i++) vec3_normalize(m[i], out[i]); } void mat3_to_eul2(const float m[3][3], int order, float e1[3], float e2[3]) { const int *r = EUL_ORDERS[order]; int i = r[0], j = r[1], k = r[2]; int parity = r[3]; float cy = hypot(m[i][i], m[i][j]); float n[3][3]; mat3_normalize_(m, n); if (cy > 16.0f * FLT_EPSILON) { e1[i] = atan2(m[j][k], m[k][k]); e1[j] = atan2(-m[i][k], cy); e1[k] = atan2(m[i][j], m[i][i]); e2[i] = atan2(-m[j][k], -m[k][k]); e2[j] = atan2(-m[i][k], -cy); e2[k] = atan2(-m[i][j], -m[i][i]); } else { e1[i] = atan2(-m[k][j], m[j][j]); e1[j] = atan2(-m[i][k], cy); e1[k] = 0.0; vec3_copy(e1, e2); } if (parity) { vec3_imul(e1, -1); vec3_imul(e2, -1); } } void mat3_to_eul(const float m[3][3], int order, float e[3]) { float e1[3], e2[3]; mat3_to_eul2(m, order, e1, e2); // Pick best. if ( fabs(e1[0]) + fabs(e1[1]) + fabs(e1[2]) > fabs(e2[0]) + fabs(e2[1]) + fabs(e2[2])) { vec3_copy(e2, e); } else { vec3_copy(e1, e); } } void quat_to_mat3(const float q[4], float m[3][3]) { float q0, q1, q2, q3, qda, qdb, qdc, qaa, qab, qac, qbb, qbc, qcc; q0 = M_SQRT2 * q[0]; q1 = M_SQRT2 * q[1]; q2 = M_SQRT2 * q[2]; q3 = M_SQRT2 * q[3]; qda = q0 * q1; qdb = q0 * q2; qdc = q0 * q3; qaa = q1 * q1; qab = q1 * q2; qac = q1 * q3; qbb = q2 * q2; qbc = q2 * q3; qcc = q3 * q3; m[0][0] = (1.0 - qbb - qcc); m[0][1] = (qdc + qab); m[0][2] = (-qdb + qac); m[1][0] = (-qdc + qab); m[1][1] = (1.0 - qaa - qcc); m[1][2] = (qda + qbc); m[2][0] = (qdb + qac); m[2][1] = (-qda + qbc); m[2][2] = (1.0 - qaa - qbb); } void eul_to_quat(const float e[3], int order, float q[4]) { const int *r = EUL_ORDERS[order]; int i = r[0], j = r[1], k = r[2]; int parity = r[3]; double a[3]; double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss; ti = e[i] * 0.5f; tj = e[j] * (parity ? -0.5f : 0.5f); th = e[k] * 0.5f; ci = cos(ti); cj = cos(tj); ch = cos(th); si = sin(ti); sj = sin(tj); sh = sin(th); cc = ci * ch; cs = ci * sh; sc = si * ch; ss = si * sh; a[i] = cj * sc - sj * cs; a[j] = cj * ss + sj * cc; a[k] = cj * cs - sj * sc; q[0] = cj * cc + sj * ss; q[1] = a[0]; q[2] = a[1]; q[3] = a[2]; if (parity) q[j + 1] = -q[j + 1]; } goxel-0.8.1/src/vec.h000066400000000000000000000421101334742672700143700ustar00rootroot00000000000000/* Copyright (c) 2016 Guillaume Chereau * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #ifndef VEC_H_ #define VEC_H_ #include #include enum { EULER_ORDER_DEFAULT = 0, // XYZ. EULER_ORDER_XYZ = 0, EULER_ORDER_XZY, EULER_ORDER_YXZ, EULER_ORDER_YZX, EULER_ORDER_ZXY, EULER_ORDER_ZYX }; #define MAT4_IDENTITY {{1, 0, 0, 0}, \ {0, 1, 0, 0}, \ {0, 0, 1, 0}, \ {0, 0, 0, 1}} #define DECL static inline #define VEC(...) ((float[]){__VA_ARGS__}) #define QUAT(w, x, y, z) ((float[]){w, x, y, z}) static const float vec3_zero[] = {0, 0, 0}; static const float vec4_zero[] = {0, 0, 0, 0}; static const float mat4_identity[4][4] = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}; static const float mat4_zero[4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}; static const float quat_identity[4] = {1, 0, 0, 0}; DECL void vec2_set(float v[2], float x, float y) { v[0] = x; v[1] = y; } DECL void vec3_set(float v[3], float x, float y, float z) { v[0] = x; v[1] = y; v[2] = z; } DECL void vec4_set(float v[4], float x, float y, float z, float w) { v[0] = x; v[1] = y; v[2] = z; v[3] = w; } DECL void vec2_copy(const float a[2], float out[2]) { out[0] = a[0]; out[1] = a[1]; } DECL void vec3_copy(const float a[3], float out[3]) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; } DECL void vec4_copy(const float a[4], float out[4]) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; } DECL bool vec2_equal(const float a[2], const float b[2]) { return a[0] == b[0] && a[1] == b[1]; } DECL bool vec3_equal(const float a[3], const float b[3]) { return a[0] == b[0] && a[1] == b[1] && a[2] == b[2]; } DECL void vec3_add(const float a[3], const float b[3], float out[3]) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; } DECL void vec3_iadd(float a[3], const float b[3]) { vec3_add(a, b, a); } DECL void vec3_addk(const float a[3], const float b[3], float k, float out[3]) { out[0] = a[0] + b[0] * k; out[1] = a[1] + b[1] * k; out[2] = a[2] + b[2] * k; } DECL void vec3_iaddk(float a[3], const float b[3], float k) { vec3_addk(a, b, k, a); } DECL void vec2_sub(const float a[2], const float b[2], float out[2]) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; } DECL void vec3_sub(const float a[3], const float b[3], float out[3]) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; } DECL void vec3_isub(float a[3], const float b[3]) { vec3_sub(a, b, a); } DECL void vec2_mul(const float a[2], float k, float out[2]) { out[0] = a[0] * k; out[1] = a[1] * k; } DECL void vec3_mul(const float a[3], float k, float out[3]) { out[0] = a[0] * k; out[1] = a[1] * k; out[2] = a[2] * k; } DECL void vec3_imul(float a[3], float k) { vec3_mul(a, k, a); } DECL void vec3_neg(const float a[3], float out[3]) { vec3_mul(a, -1, out); } DECL float vec2_dot(const float a[2], const float b[2]) { return a[0] * b[0] + a[1] * b[1]; } DECL float vec3_dot(const float a[3], const float b[3]) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } DECL float vec2_norm2(const float a[2]) { return vec2_dot(a, a); } DECL float vec3_norm2(const float a[3]) { return vec3_dot(a, a); } DECL float vec2_norm(const float a[2]) { return sqrt(vec2_norm2(a)); } DECL void vec2_normalize(const float a[2], float out[2]) { vec2_mul(a, 1 / vec2_norm(a), out); } DECL float vec3_norm(const float a[3]) { return sqrt(vec3_norm2(a)); } DECL void vec3_normalize(const float a[3], float out[3]) { vec3_mul(a, 1 / vec3_norm(a), out); } DECL float vec2_dist2(const float a[2], const float b[2]) { float u[2]; vec2_sub(a, b, u); return vec2_norm2(u); } DECL float vec2_dist(const float a[2], const float b[2]) { return sqrt(vec2_dist2(a, b)); } DECL float vec3_dist2(const float a[3], const float b[3]) { float d[3]; vec3_sub(a, b, d); return vec3_norm2(d); } DECL float vec3_dist(const float a[3], const float b[3]) { return sqrt(vec3_dist2(a, b)); } DECL void vec2_mix(const float a[2], const float b[2], float t, float out[2]) { out[0] = a[0] * (1 - t) + b[0] * t; out[1] = a[1] * (1 - t) + b[1] * t; } DECL void vec3_mix(const float a[3], const float b[3], float t, float out[3]) { out[0] = a[0] * (1 - t) + b[0] * t; out[1] = a[1] * (1 - t) + b[1] * t; out[2] = a[2] * (1 - t) + b[2] * t; } DECL void vec3_lerp(const float a[3], const float b[3], float t, float out[3]) { vec3_mix(a, b, t, out); } DECL bool vec3_lerp_const(const float a[3], const float b[3], float d, float out[3]) { float u[3]; float d2 = vec3_dist2(a, b); if (d2 < d * d) { vec3_copy(b, out); return true; } vec3_sub(b, a, u); vec3_normalize(u, u); vec3_addk(a, u, d, out); return false; } DECL bool vec3_ilerp_const(float a[3], const float b[3], float d) { return vec3_lerp_const(a, b, d, a); } DECL void vec3_project(const float a[3], const float b[3], float out[3]) { vec3_mul(b, vec3_dot(a, b) / vec3_dot(b, b), out); } DECL float vec2_cross(const float a[2], const float b[2]) { return a[0] * b[1] - a[1] * b[0]; } DECL void vec3_cross(const float a[3], const float b[3], float out[3]) { out[0] = a[1] * b[2] - a[2] * b[1]; out[1] = a[2] * b[0] - a[0] * b[2]; out[2] = a[0] * b[1] - a[1] * b[0]; } DECL void mat4_copy(const float m[4][4], float out[4][4]) { int i, j; for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) out[i][j] = m[i][j]; } DECL void mat4_mul_vec4(const float m[4][4], const float v[4], float out[4]) { float ret[4] = {}; int i, j; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { ret[i] += m[j][i] * v[j]; } } vec4_copy(ret, out); } DECL void mat4_mul_vec3(const float m[4][4], const float v[3], float out[3]) { float v4[4] = {v[0], v[1], v[2], 1.0f}; mat4_mul_vec4(m, v4, v4); vec3_copy(v4, out); } DECL void mat4_translate(const float m[4][4], float x, float y, float z, float out[4][4]) { float tmp[4][4]; int i; mat4_copy(m, tmp); #define M(row,col) tmp[(row)][(col)] for (i = 0; i < 4; i++) { M(4 - 1, i) += M(0, i) * x + M(1, i) * y + M(2, i) * z; } #undef M mat4_copy(tmp, out); } DECL void mat4_itranslate(float m[4][4], float x, float y, float z) { mat4_translate(m, x, y, z, m); } DECL void mat4_scale(const float m[4][4], float x, float y, float z, float out[4][4]) { int i; float tmp[4][4]; mat4_copy(m, tmp); for (i = 0; i < 4; i++) { tmp[0][i] *= x; tmp[1][i] *= y; tmp[2][i] *= z; } mat4_copy(tmp, out); } DECL void mat4_iscale(float m[4][4], float x, float y, float z) { mat4_scale(m, x, y, z, m); } DECL bool mat4_invert(const float mat[4][4], float out[4][4]) { float det; int i; const float *m = (const float*)mat; float inv[16]; #define M(i, j, k) m[i] * m[j] * m[k] inv[0] = M(5, 10, 15) - M(5, 11, 14) - M(9, 6, 15) + M(9, 7, 14) + M(13, 6, 11) - M(13, 7, 10); inv[4] = -M(4, 10, 15) + M( 4, 11, 14) + M( 8, 6, 15) - M(8, 7, 14) - M(12, 6, 11) + M(12, 7, 10); inv[8] = M(4, 9, 15) - M( 4, 11, 13) - M(8, 5, 15) + M(8, 7, 13) + M(12, 5, 11) - M(12, 7, 9); inv[12] = -M(4, 9, 14) + M(4, 10, 13) + M(8, 5, 14) - M(8, 6, 13) - M(12, 5, 10) + M(12, 6, 9); inv[1] = -M(1, 10, 15) + M(1, 11, 14) + M(9, 2, 15) - M(9, 3, 14) - M(13, 2, 11) + M(13, 3, 10); inv[5] = M(0, 10, 15) - M(0, 11, 14) - M(8, 2, 15) + M(8, 3, 14) + M(12, 2, 11) - M(12, 3, 10); inv[9] = -M(0, 9, 15) + M(0, 11, 13) + M(8, 1, 15) - M(8, 3, 13) - M(12, 1, 11) + M(12, 3, 9); inv[13] = M(0, 9, 14) - M(0, 10, 13) - M(8, 1, 14) + M(8, 2, 13) + M(12, 1, 10) - M(12, 2, 9); inv[2] = M(1, 6, 15) - M(1, 7, 14) - M(5, 2, 15) + M(5, 3, 14) + M(13, 2, 7) - M(13, 3, 6); inv[6] = -M(0, 6, 15) + M(0, 7, 14) + M(4, 2, 15) - M(4, 3, 14) - M(12, 2, 7) + M(12, 3, 6); inv[10] = M(0, 5, 15) - M(0, 7, 13) - M(4, 1, 15) + M(4, 3, 13) + M(12, 1, 7) - M(12, 3, 5); inv[14] = -M(0, 5, 14) + M(0, 6, 13) + M(4, 1, 14) - M(4, 2, 13) - M(12, 1, 6) + M(12, 2, 5); inv[3] = -M(1, 6, 11) + M(1, 7, 10) + M(5, 2, 11) - M(5, 3, 10) - M(9, 2, 7) + M(9, 3, 6); inv[7] = M(0, 6, 11) - M(0, 7, 10) - M(4, 2, 11) + M(4, 3, 10) + M(8, 2, 7) - M(8, 3, 6); inv[11] = -M(0, 5, 11) + M(0, 7, 9) + M(4, 1, 11) - M(4, 3, 9) - M(8, 1, 7) + M(8, 3, 5); inv[15] = M(0, 5, 10) - M(0, 6, 9) - M(4, 1, 10) + M(4, 2, 9) + M(8, 1, 6) - M(8, 2, 5); #undef M det = m[0] * inv[0] + m[1] * inv[4] + m[2] * inv[8] + m[3] * inv[12]; if (det == 0) return false; det = 1.0 / det; for (i = 0; i < 16; i++) out[i / 4][i % 4] = inv[i] * det; return true; } DECL void mat4_igrow(float m[4][4], float x, float y, float z) { // XXX: need to optimize this. float s[3]; float v[3][4] = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}}; int i; for (i = 0; i < 3; i++) { mat4_mul_vec4(m, v[i], v[i]); s[i] = vec3_norm(v[i]); } s[0] = (2 * x + s[0]) / s[0]; s[1] = (2 * y + s[1]) / s[1]; s[2] = (2 * z + s[2]) / s[2]; mat4_iscale(m, s[0], s[1], s[2]); } DECL void mat4_mul(const float a[4][4], const float b[4][4], float out[4][4]) { int i, j, k; float ret[4][4] = {}; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { ret[j][i] = 0.0; for (k = 0; k < 4; ++k) { ret[j][i] += a[k][i] * b[j][k]; } } } mat4_copy(ret, out); } DECL void mat4_imul(float a[4][4], const float b[4][4]) { mat4_mul(a, b, a); } DECL void mat4_ortho(float m[4][4], float left, float right, float bottom, float top, float nearval, float farval) { float tx = -(right + left) / (right - left); float ty = -(top + bottom) / (top - bottom); float tz = -(farval + nearval) / (farval - nearval); const float ret[4][4] = { {2 / (right - left), 0, 0, 0}, {0, 2 / (top - bottom), 0, 0}, {0, 0, -2 / (farval - nearval), 0}, {tx, ty, tz, 1}, }; mat4_copy(ret, m); } DECL void mat4_perspective(float m[4][4], float fovy, float aspect, float nearval, float farval) { float radian = fovy * M_PI / 180.f; float f = 1.f / tan(radian / 2.f); const float ret[4][4] = { {f / aspect, 0.f, 0.f, 0.f}, {0.f, f, 0.f, 0.f}, {0.f, 0.f, (farval + nearval) / (nearval - farval), -1.f}, {0.f, 0.f, 2.f * farval * nearval / (nearval - farval), 0.f}, }; mat4_copy(ret, m); } DECL void mat4_transpose(const float m[4][4], float out[4][4]) { int i, j; float ret[4][4] = {}; for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) ret[i][j] = m[j][i]; mat4_copy(ret, out); } DECL void mat4_set_identity(float m[4][4]) { mat4_copy(mat4_identity, m); } // Similar to gluLookAt DECL void mat4_lookat(float m[4][4], const float eye[3], const float center[3], const float up[3]) { float f[3], s[3], u[3], ret[4][4]; mat4_set_identity(ret); vec3_sub(center, eye, f); vec3_normalize(f, f); vec3_cross(f, up, s); vec3_normalize(s, s); vec3_cross(s, f, u); vec3_normalize(u, u); vec3_copy(s, ret[0]); vec3_copy(u, ret[1]); vec3_neg(f, ret[2]); mat4_transpose(ret, ret); mat4_translate(ret, -eye[0], -eye[1], -eye[2], ret); mat4_copy(ret, m); } DECL void quat_set_identity(float q[4]) { q[0] = 1; q[1] = 0; q[2] = 0; q[3] = 0; } DECL void quat_copy(const float q[4], float out[4]) { out[0] = q[0]; out[1] = q[1]; out[2] = q[2]; out[3] = q[3]; } DECL void quat_from_axis(float quat[4], float a, float x, float y, float z); DECL void quat_to_mat4(const float q[4], float out[4][4]); DECL void mat4_rotate(const float m[4][4], float a, float x, float y, float z, float out[4][4]) { if (a == 0.0) { mat4_copy(m, out); return; } float tmp[4][4]; float s = sin(a); float c = cos(a); mat4_set_identity(tmp); #define M(row,col) tmp[col][row] if (x == 1.0 && y == 0.0 && z == 0.0) { M(1,1) = c; M(2,2) = c; M(1,2) = -s; M(2,1) = s; } else if (x == 0.0 && y == 1.0 && z == 0.0) { M(0, 0) = c; M(2, 2) = c; M(0, 2) = s; M(2, 0) = -s; } else if (x == 0.0 && y == 0.0 && z == 1.0) { M(0, 0) = c; M(1, 1) = c; M(0, 1) = -s; M(1, 0) = s; } else { float quat[4]; quat_from_axis(quat, a, x, y, z); quat_to_mat4(quat, tmp); } #undef M mat4_mul(m, tmp, out); } DECL void mat4_irotate(float m[4][4], float a, float x, float y, float z) { mat4_rotate(m, a, x, y, z, m); } DECL void quat_from_axis(float quat[4], float a, float x, float y, float z) { float sin_angle; float vn[3] = {x, y, z}; a *= 0.5f; vec3_normalize(vn, vn); sin_angle = sin(a); quat[0] = cos(a); quat[1] = vn[0] * sin_angle; quat[2] = vn[1] * sin_angle; quat[3] = vn[2] * sin_angle; } DECL void quat_to_mat4(const float q[4], float out[4][4]) { float w, x, y, z; w = q[0]; x = q[1]; y = q[2]; z = q[3]; const float ret[4][4] = { {1-2*y*y-2*z*z, 2*x*y+2*z*w, 2*x*z-2*y*w, 0}, { 2*x*y-2*z*w, 1-2*x*x-2*z*z, 2*y*z+2*x*w, 0}, { 2*x*z+2*y*w, 2*y*z-2*x*w, 1-2*x*x-2*y*y, 0}, { 0, 0, 0, 1}}; mat4_copy(ret, out); } DECL void quat_conjugate(const float q[4], float out[4]) { out[0] = q[0]; out[1] = -q[1]; out[2] = -q[2]; out[3] = -q[3]; } DECL void quat_mul(const float a[4], const float b[4], float out[4]) { out[0] = a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a[3] * b[3]; out[1] = a[0] * b[1] + a[1] * b[0] + a[2] * b[3] - a[3] * b[2]; out[2] = a[0] * b[2] + a[2] * b[0] + a[3] * b[1] - a[1] * b[3]; out[3] = a[0] * b[3] + a[3] * b[0] + a[1] * b[2] - a[2] * b[1]; } DECL void quat_imul(float a[4], const float b[4]) { quat_mul(a, b, a); } DECL void quat_rotate(const float q[4], float a, float x, float y, float z, float out[4]) { float other[4]; quat_from_axis(other, a, x, y, z); quat_mul(q, other, out); } DECL void quat_irotate(float q[4], float a, float x, float y, float z) { quat_rotate(q, a, x, y, z, q); } DECL void quat_mul_vec4(const float q[4], const float v[4], float out[4]) { float m[4][4]; quat_to_mat4(q, m); mat4_mul_vec4(m, v, out); } DECL void mat4_mul_quat(const float mat[4][4], const float q[4], float out[4][4]) { float qm[4][4]; quat_to_mat4(q, qm); mat4_mul(mat, qm, out); } DECL void mat4_imul_quat(float mat[4][4], const float q[4]) { mat4_mul_quat(mat, q, mat); } void mat3_to_eul(const float m[3][3], int order, float e[3]); void mat3_to_eul2(const float m[3][3], int order, float e1[3], float e2[3]); void quat_to_mat3(const float q[4], float out[3][3]); DECL void quat_to_eul(const float q[4], int order, float e[3]) { float m[3][3]; quat_to_mat3(q, m); mat3_to_eul(m, order, e); } DECL void quat_to_eul2(const float q[4], int order, float e1[3], float e2[3]) { float m[3][3]; quat_to_mat3(q, m); mat3_to_eul2(m, order, e1, e2); } void eul_to_quat(const float e[3], int order, float out[4]); #endif // VEC_H_ goxel-0.8.1/svg/000077500000000000000000000000001334742672700134545ustar00rootroot00000000000000goxel-0.8.1/svg/icons.svg000066400000000000000000003016351334742672700153200ustar00rootroot00000000000000 image/svg+xml goxel-0.8.1/tools/000077500000000000000000000000001334742672700140155ustar00rootroot00000000000000goxel-0.8.1/tools/create_assets.py000077500000000000000000000073431334742672700172260ustar00rootroot00000000000000#!/usr/bin/python # Goxel 3D voxels editor # # copyright (c) 2016 Guillaume Chereau # # Goxel 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. # # Goxel 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 # goxel. If not, see . # Read all the files in 'data', and create assets.inl with all the data. For # text file, we try to keep the data as a string, for binary files we store it # into a uint8_t array. from collections import namedtuple import os if os.path.dirname(__file__) != "./tools": print "Should be run from goxel root directory" sys.exit(-1) TYPES = { "png": { "text": False, }, "goxcf": { "text": True, }, "gpl": { "text": True, }, "pov": { "text": True, }, "ttf": { "text": False }, "wav": { "text": False }, "ini": { "text": True }, "glsl": { "text": True }, } GROUPS = ['fonts', 'icons', 'images', 'other', 'palettes', 'progs', 'shaders', 'sounds', 'themes'] TEMPLATE = '{{.path = "{path}", .size = {size}, .data =\n{data}\n}},' File = namedtuple('File', 'path name data size') HEADER = """/* Goxel 3D voxels editor * * copyright (c) 2018 Guillaume Chereau * * Goxel 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. * Goxel 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 * goxel. If not, see . */ /* This file is autogenerated by tools/create_assets.py */ """ def list_files(group): ret = [] for root, dirs, files in os.walk("data/%s" % group): for f in files: if any(f.endswith('.' + x) for x in TYPES): ret.append(os.path.join(root, f)) return sorted(ret, key=lambda x: x.upper()) def encode_str(data): ret = ' "' for c in data: if c == '\n': ret += '\\n"\n "' continue if c == '"': c = '\\"' if c == '\\': c = '\\\\' ret += c ret += '"' return ret def encode_bin(data): ret = "(const uint8_t[]){\n" line = "" for i, c in enumerate(data): line += "{},".format(ord(c)) if len(line) >= 70 or i == len(data) - 1: ret += " " + line + "\n" line = "" ret += "}" return ret; def create_file(f): data = open(f).read() size = len(data) name = f.replace('/', '_').replace('.', '_').replace('-', '_') ext = f.split(".")[-1] if TYPES[ext]['text']: size += 1 # So that we NULL terminate the string. data = encode_str(data) else: data = encode_bin(data) return File(f, name, data, size) for group in GROUPS: out = open("src/assets/%s.inl" % group, "w") print >>out, HEADER files = [] for f in list_files(group): files.append(create_file(f)) for f in files: print >>out, TEMPLATE.format(**f._asdict()) print >>out, "\n\n" goxel-0.8.1/tools/create_font.py000077500000000000000000000027511334742672700166700ustar00rootroot00000000000000#!/usr/bin/python #encoding: utf-8 # Goxel 3D voxels editor # # copyright (c) 2018 Guillaume Chereau # # Goxel 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. # # Goxel 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 # goxel. If not, see . # ************************************************************************ # Generate a small font file by removing all unwanted characters from a base # font. import fontforge import unicodedata PATH = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" CHARS = (u"abcdefghijklmnopqrstuvwxyz" u"ABCDEFGHIJKLMNOPQRSTUVWXYZ" u"0123456789" u" ?!\"#$%&'()*+,-./°¯[]^:<>{}@_=±" u"◀▶▲▼▴▾●©" ) font = fontforge.open(PATH) for g in font: u = font[g].unicode if u == -1: continue u = unichr(u) if u not in CHARS: continue font.selection[ord(u)] = True font.selection.invert() for i in font.selection.byGlyphs: font.removeGlyph(i) font.generate("data/fonts/DejaVuSans-light.ttf") goxel-0.8.1/tools/create_icons.py000077500000000000000000000036731334742672700170410ustar00rootroot00000000000000#!/usr/bin/python # Goxel 3D voxels editor # # copyright (c) 2018 Guillaume Chereau # # Goxel 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. # # Goxel 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 # goxel. If not, see . # ************************************************************************ # Create the icon atlas image from all the icons svg files import itertools import PIL.Image from shutil import copyfile import os import subprocess import re # Use inkscape to convert the svg into one big png file. subprocess.check_output([ 'inkscape', './svg/icons.svg', '--export-area-page', '--export-dpi=192', '--export-png=/tmp/icons.png']) src_img = PIL.Image.open('/tmp/icons.png') ret_img = PIL.Image.new('RGBA', (512, 512)) for x, y in itertools.product(range(8), range(8)): img = src_img.crop((x * 46 + 2, y * 46 + 2, x * 46 + 46, y * 46 + 46)) # Make the image white in the special range. if y >= 2 and y < 5: tmp = PIL.Image.new('RGBA', (44, 44), (255, 255, 255, 255)) tmp.putalpha(img.split()[3]) img = tmp ret_img.paste(img, (64 * x + 10, 64 * y + 10)) ret_img.save('data/images/icons.png') # Also create the application icons (in data/icons) if not os.path.exists('data/icons'): os.makedirs('data/icons') base = PIL.Image.open('icon.png').convert('RGBA') for size in [16, 24, 32, 48, 64, 128, 256]: img = base.resize((size, size), PIL.Image.BILINEAR) img.save('data/icons/icon%d.png' % size)
Marching Cube Rendering: Support for smooth rendering of voxels using the marching cube algorithm. Procedural rendering tool: It is possible to programatically generate shapes using goxel procedural language, inspired by ContextFree. Laser tool: Carve in real time into the volume. Layers panel: You can stack as many layers as you want. Layers can be edited independently, so that you can use one per part of your image. Plane: You can import a 2D image into Goxel, to use as a reference for your model. Palettes panel: Goxel comes with a set of predefined color palettes. Selection tool: Allow to operate on a portion of the image.